Pete Wright's Radio Weblog
Musings on anything and everything, but mainly code!

 

 

22 October 2004
 

I'm not particularly fond of Linux these days; there's just too much fracturing in the Linux space, too few standards, and generally just too many oddities to make it a pleasant and productive place to be, for me anyway. One thing I have always admired about the true Linux propeller heads though is their ability to get things done. Mastery of regular expressions along with tools like egrep, sed, awk and of course Perl means the true whizzes can accomplish incredibly daunting tasks in next to no time. Wouldn't it be great if we could do the same with Microsoft tools as well?

I got O'Reilly's book 101 Spidering Hacks for Christmas. It looked like a pretty interesting topic to cover and I've always had something of a fascination with intelligent computing - getting the computer to do the mundane time sucking things that we all do every day, either out of habit of necessity. Almost all the examples in the book though are centered around Perl, so I had to go and learn that. I got hold of ActiveState's awesome Perl implementation for Windows, and the EPIC plug in for Eclipse (because I do love my IDE's) and started coding. It's been a bit of a struggle getting my head around the simplicity of Perl but I'm at last beginning to to see some benefits from the study. I have a script that runs every day as soon as I turn my computer on which hits the BBC Radio Times website and searches for TV shows that I like. I don't get a lot of time to watch TV these days, and I don't have a TiVo, so this is the next best thing for me. It downloads the show details, produces an RSS log, and I can fire off selected entries to Heather to set up the DVD recorder to grab them when they come up on TV. I also wrote a couple of scripts to copy a bunch of directories off my computer onto a removable storage device and then restore them. This has been a godsend for me because it lets me switch from one computer to another in seconds, and have all my work, email, IE links and so on on the second machine just as if I were using the first, and without requiring me to setup a domain controller with roaming profiles.

Each of these tasks though has taken me quite some time. I'm a .NET developer, not a Perl one, and I tend to suffer long breaks between my Perl coding stints during which I forget many of the idiosyncracies of the language and have to re-learn them. Working on some Perl scripts last night to analyse log files from an online game I play, I started thinking "Wouldn't it be great if I could do all this stuff in C#".

It is totally possible to do anything a Perl script does in C# but the advantage Perl has is that the resulting program is smaller, a lot smaller, than the C# program. So, I'm thinking, why not take Microsoft's My namespace idea from Visual Basic 2.0 and extend it. It would be so cool to be able to write a program in C# like this

static void Main( string[] args )
{
   foreach ( CPerl.File file  in CPerl.CurrentDirectory( Modified.ThisWeek )

  {
      if ( file.Content.Matches("/<a href=.*/")

           WirteLine("Got a match : {0}", file.Content.MatchList.ToString() );
  }
}

You could also extend the library to do a bunch of stuff with the web a lot quicker than the current .NET framework lets you (code wise). For example a method to just grab a page to a string, set up request headers instantly to conform to a specific browser and so on. Basically the idea would be to take all the really neat, really terse but powerful stuff that Perl can do and implement it in a very simple easy to use library just for getting simple stuff done. That way if you needed to search a bunch of log files for something you could just fire up an editor, or Visual Studio, bang out a few lines of code, csc it, and you're done. All the simplicity of Perl, but with a really cool powerful language and IDE.

I have no time for this right now but it's playing on my mind so much that I think I may just have to start on this when I do have some.

 


1:54:20 PM    comment []

Remember those truly hideous orange TechEd Europe bags Microsoft foisted on this years delegates? They're pretty useful in that they can hold a ton of stuff, but boy oh boy are they ugly. Or are they? Turns out they're high fashion. Classy online bag-purveyor Jack Spade has them up for sale for around 100 bucks each here. Ok, so they're not the actual TechEd bags, but they sure look very similar indeed. Time to dust of that eBay account I think and get selling.

 

 


1:25:14 PM    comment []

Microsoft are hosting a bunch of free training on ASP.NET over at www.aspnetwebcasts.com. Worth checking out, especially as some of the sessions walk in depth through new features  in ASP.NET 2.0. Good to see Microsoft working hard on getting everyone prepared for the next generation of ASP.NET.

 


10:35:58 AM    comment []

I caught an interesting (interesting as in dumb, narrow minded and just plain silly) Slashdot story posted yesterday in my RSS reader this morning. It says

"Cnn and many other sources are jumping on the Google-privacy-bash bandwagon, they are carrying stories warning of more privacy implications regarding Google's Desktop Search, "if it's installed on computers at libraries and Internet cafes, users could unwittingly allow people who follow them on the PCs, for example, to see sensitive information in e-mails they've exchanged. That could mean revealed passwords, conversations with doctors, or viewed Web pages detailing online purchases." ... Type in "hotmail.com" and you'll get copies, or stored caches, of messages that previous users have seen. Enter an e-mail address and you can read all the messages sent to and from that address. Type "password" and get password reminders that were sent back via e-mail."

In case you haven't already seen it, Google Desktop can be downloaded from here. Basically it gives you the full power of Google right on your desktop (hence the name) allowing you to instantly search for any email, word document, powerpoint presentation, text file, cached web page or chat log you have on your machine. I've been using it a week now and it's awesome. It actually made me drop Eudora and switch back over to Outlook just for the wonderful speed and simplicity with which I can search my 2 gig of cached emails. It's a fantastic tool and I don't think I'm ever going to stop using it.

The story on Slashdot though is just silly. Sure it can be used to expose secret information that other people (using the same login, which is dumb anyway) have created, but then so can eGrep, Perl, or even C# with a little coding magic. Google Desktop is only a security risk if you install it in those environments where multiple unrelated people use a computer with the same login. The simple way to solve the problem is Dont Install It in those environments. I wouldn't walk into an Internet cafe and expect to find a PC loaded up with Ethereal packet sniffer for example - that would be silly too.

We need nay-sayers in the world, I guess. They balance it out - it's a ying and yang thing, but the least they could do is think through their arguments a little better. Fairs far though - the nay sayers are the usual sensationalist news-hacks and not, this time at least, a poster on Slashdot.

 


10:25:51 AM    comment []


Click here to visit the Radio UserLand website. © Copyright 2004 Pete Wright.
Last update: 27/11/2004; 12:29:46.
This theme is based on the SoundWaves (blue) Manila theme.
October 2004
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Sep   Nov