In case someone finds it useful, I’ve opened sourced my OneNoteJournal code. Available here:
https://github.com/richie5um/OneNoteJournal
Hope you like.
In case someone finds it useful, I’ve opened sourced my OneNoteJournal code. Available here:
https://github.com/richie5um/OneNoteJournal
Hope you like.
Whilst we are living in Mountain View, we thought we’d join the library. It is pretty impressive, and the kids section is bigger than my entire local library in the UK (in fact, my closest UK library has just been shut down due to budget cuts!).
In most of the libraries I’ve been to in the UK, they usually have about 3 computer books:
* Windows XP for Dummies
* How to use an iPod
* C++ in 24 Hours
However, the Mountain View library has a few hundred computer books. It is pretty impressive.
Whilst we were there I spotted a few books on Ruby and Rails, given I’m interested in learning new things (and have a history of using Python), I thought I’d give it a go. I know I’m a little late to the party, but I’d rather be playing with something like this than watching some rubbish on the TV.
Thankfully, Ruby, Gems, and Rails are all pre-installed on my Mac. Unfortunately though, the book I’ve borrowed suggests I use MySQL as the DB, and MySQL isn’t preinstalled.
Whilst the installer was pretty simple, getting it to work with Rails has been rather more troublesome. I thought I’d post about how I’d managed to do it, but I’m still not there – and I’ve spent the past 2 hours trying to get it to work.
I guess that is the problem with computer books, they are out of date as soon as they are written. Maybe the UK library model works best
.
One of the things I love about being able to write code, is the ability to create small tools to help me use my computer. I’ve always enjoyed this side of programming, which will probably explain why I’m always creating more.
On this blog post, I’ll be describing a tool I’ve written that I keep coming back to. With some changes I’ve made over the past few days is even more useful.
In Windows, I love the accessibility of putting things on to the Desktop. At the same time, I’m always trying to tidy it up and keep it clean as otherwise I find it distracting. As such, I created a tool to show or hide the icons displayed on the desktop; this is now available in the Vista by right-clicking on the desktop. The original version was only triggered by clicking on the SystemTray icon, or by pressing Ctrl+1.
Since the original version, it now supports a useful addition, in that when the icons are hidden, if you hold down the CapsLock key for more than a few seconds, the icons will appear and you can use them. When you release the CapsLock key it will hide them again. The beauty of using CapsLock, is that it doesn’t interfere with the mouse and you can interact with the icons without any problems.
The most recent feature I’ve added is to save and restore the Desktop icon positions. This is activated by the “Save Icon Position” and “Restore Icon Position” from the SystemTray icon. This information is saved to disk so that it can be used again and again.
I’ve made the tool available via ClickOnce, so it would install to your StartMenu by clicking on the link below. I hope you find this tool useful – if so, you can always donate via PayPal.
http://www.richsomerfield.com/downloads/desktoptools/publish.htm
Note: If running on Vista, with UAC enabled, you may need to run as Administrator – this is due to the way the app needs to interact with the desktop.
You may (or may not) have seen a CodeSwarm video. If not, here is a link.
I like the idea of these videos (although I’m not exactly sure why). I thought it would be interesting to see a video for the source code at my place of work. We use TFS, and from what I could find, there was no existing code to hook TFS to CodeSwarm. As such, I spent a few hours working around the TFS SDK to see if I could solve it. My code and notes are here – hope it is useful. If you do like it/use it/modify it/improve it, please let me know.
[Note: I only started using the TFS SDK this evening, so I may have done it the wrong way. Also, but using the ChangeSet check-in time, it means a number of files are groupped with the same time - not ideal, but I suppose it is accurate.]
This requires a C# Console application – see the foot of this post for the code – to connect to your TFS server, and extract the data. This will output an XML file containing the changes. This can then be used with CodeSwarm to generate the video.
You’ll need to download and install the relevant pieces for CodeSwarm (available here).
Steps:
The default CodeSwarm config needs some tweaks to get a good video. If you have any suggestions, please send them to me.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.VersionControl.Common;
namespace TFSToCodeSwarm
{
class Program
{
public static void GetChanges( string _tfsServer, string _tfsRepository, string _versionFromString )
{
//connection to TFS Version Control
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer( _tfsServer );
VersionControlServer vcs = (VersionControlServer)tfs.GetService( typeof( VersionControlServer ) );
// Null means *all*
VersionSpec versionSpecFrom = null;
if ( null != _versionFromString && "" != _versionFromString )
{
versionSpecFrom = VersionSpec.ParseSingleSpec( _versionFromString, null );
}
System.Collections.IEnumerable enumerable = vcs.QueryHistory( _tfsRepository,
VersionSpec.Latest,
0,
RecursionType.Full,
"",
versionSpecFrom,
VersionSpec.Latest,
Int32.MaxValue,
true,
true );
Console.WriteLine( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>" );
Console.WriteLine( "<File_Events>" );
foreach ( Changeset changeset in enumerable )
{
foreach( Change change in changeset.Changes )
{
long numSeconds = (long)(change.Item.CheckinDate - new DateTime(1970, 1, 1, 0, 0, 0 )).TotalSeconds;
String strItemName = change.Item.ServerItem.Replace( '&', ' ' );
String strDetails = String.Format( "<event author=\"{0}\" date=\"{1}\" filename=\"{2}\" />",
changeset.Owner, numSeconds, strItemName );
Console.WriteLine( strDetails );
}
}
Console.WriteLine( "</File_Events>" );
}
static void Main( string[] args )
{
if ( 3 == args.Length )
{
GetChanges( args[0], args[1], args[2] );
}
else
{
Console.WriteLine( "\nUsage: TFSToCodeSwarm <SERVERURL> <REPOSITORY> <STARTDATE>\n" );
Console.WriteLine( "\nExample: TFSToCodeSwarm \"http://tfs\" \"$/SourceCode\" \"D03/02/2009\"\n" );
}
}
}
}