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

 

 

14 January 2005
 

I think I blogged before, or at the very least I meant to, that all C# needs to really compete with the likes of Perl is a set of quick and dirty libraries. I like Perl a lot, and I admire the guys that can do it in their sleep, but for me it's a technology that just seems to evaporate from my brain if I don't do it enough. What I blogged before was that I thought I might try to start writing the libraries myself to enable people to write really small simple C# apps for the kinds of the things that Perl guys write short Perl apps for. From a personal bent, I love the idea of spidering, and writing small agent apps that hit the web without me even worrying about it and get stuff that I'm interested in. 

Tonight I decided, screw it - I'll start. I wanted to get a simple Perl script written that would hit the Channel 9 videos page and download any videos I haven't already downloaded. Then, ideally, it would mail me to let me know that I've got new vids to watch. No more checking the site or the RSS feed - just let the script do the work each night while I sleep.

In true eXtreme Programming stylee, this is how I want my code to work

using System;
using System.IO;
using DotNetScriptLib.Web;
using DotNetScriptLib.Mail;

namespace DownloadChannel9Videos { class Class1 { [STAThread] static void Main(string[] args) { bool newVids = false;

WebPage channel9 = new WebPage("http://channel9.msdn.com"); foreach (WebPageAnchor videoLink in channel9.GrabAnchorsByContent("Save")) { if ( !File.Exists(videoLink.FileName) ) { channel9.SaveToDisk(videoLink, videoLink.FileName); newVids = true; } }

if ( newVids) Email("peterjwright@gmail.com", "vidscript@myhouse", "smtp.server.net", "I downloaded some new channel 9 content last night Pete." ) } } }

Nice huh. Following on from this I've got my bare skeleton of the classes concerned in place with no code, and I'm now going through writing the unit tests so that I can start adding in the actual code to the skeletons. More when I've got it, but my plan ultimately here is to set up a new GotDotNetWorkspace for this and just let the community go nuts adding really cool utilty classes to make everything from file passing to goofing around on the net every bit as trivial for the C# and VB.NET guys as it is currently for the perl guys.

Watch this space.

 


10:25:27 PM    comment []

danlehen just announced on his blog  that you can now download the Avalon CTP even if you're not an MSDN subscriber. What's really cool though is that Microsoft have included a handy batch file that will make Avalon projects available to Visual C# Express users.

Now at last everyone can let loose on doing those cool 3D visualisation apps they've always wanted to do.  Neat.

 


10:10:01 PM    comment []

I think John Hodge put it best!

Choose life. Choose a job. Choose a career. Choose a family. Choose a fucking big television, choose washing machines, cars, compact disc players and electrical tin openers. Choose good health, low cholesterol, and dental insurance. Choose fixed interest mortgage repayments. Choose a starter home. Choose your friends. Choose leisurewaer and matching luggage. Choose a three-piece suite on hire purchase in a range of fucking fabrics. Choose DIY and wondering who the fuck you are on a Sundary morning. Choose sitting on that couch watching mind-numbing, spirit-crushing game shows, stuffing fucking junk food into your mouth. Choose rotting away at the end of it all, pishing your last in a miserable home, nothing more than an embarrassment to the selfish, fucked up brats you spawned to replace yourself.

Choose your future.

Choose life.

I chose something else. I chose my own destiny, quality of life, more time with my family, no stress, and no more putting up with peoples blatantly obvious, but cleverly disguised political agendas. I chose to avoid two-faced morons that feel that reading a two page article in the Sunday Times colour supplement makes them qualified to sell massive multi-million pound bullshit.

I chose freedom.

 

 


8:39:35 PM    comment []

Everyone is a fortune teller at this time of year. I've already been guilty of it here in prediciting (quite accurately, though it was fairly easy to do) what Steve Jobs would announce at MacWorld. In this the season of the big shows (C.E.S, MacWorld etc) everyone seems to want to predict just what topics are going to dominate the minds of the IT community in the 12 months to come. Steve Jobs thinks it's High Definition Video, and he's probably onto something there. Bill Gates has a similar slant, heavily pushing Windows Media Center at his keynote on stage in Vegas just a week ago.

I think it's something more subtle. I think 2005 is the year of the script. Apple have already bought into this slightly with the inclusion in the next version of their MacOS operating system of a tool called Automator. The tool is a GUI based scripter. You simply drag and drop operations from a list into a graphical list and behind the scenes an Applescript script is generated, compiled and run. Fantastic stuff.

I think Apple's decision to include such a tool in their OS indicates something profound in the way we use computers today. The 80's were all about figuring out how on earth to make the small box on your desk (mine was an old door propped up on lumps of wood that my Dad proudly proclaimed was a desk) worked.

"Look, hey Dad, look at this - it showed MY name!". Oh boy, we've come a long way.

The 90's moved us well and truly into the software era. I'd read every magazine I could find and take eager excited trips to the local software store, my heart leaping as I saw the actual, real box that I'd seen in some magazine review. I'd hand over a sweaty hand full of cash then dash home to install it and figure out how to use it to make my computer do what someone else claimed it could. It was the time of VB, Access and other point and click goodness, the era of click this, drag that, type this and POW, something that actually looked like a Windows program appeared, and I made it all myself (albeit with the help of 2 million lines of code written by someone in Redmond).

"Oh my god, look at this honey. I dragged this over here, and then clicked on this thing, and look - an actual Login screen for an application, just like the pro's make".

Now we're in the noughties. We've learned that perhaps not everything that the powerhouses in California and Seattle make is perfect. We've discovered the Internet, and we all now have an insatiable appetite for information, but are constrained by just how we can get it and use it. I thought it was so amazingly cool when I discovered that I could actually download real satellite information from NORAD and NASA, but entered a state of depression when that data wasn't cool Moonraker style simulations of their orbit but was instead an unintelligable mass of numbers. Today is all about making the computer actually do what we want, the way we want it. Today is all about the script.

This year it will take off, I'm sure of it. The age of the homebrew hacker is back, but instead of sitting in a bedroom trying to make some god awful version of a space invader appear we're going to be writing code to siphon information from everywhere and do "stuff" with it. I truly believe that this year is the year that people will discover scripts and what they can do in a big way. By the end of the year we'll all at least know that it's possible to stumble across a website with a bunch of links, and then knock up a script to download every single link on the page, even if most of us aren't quite sure just how to write that script.

This year is the year of making things work. The anum of actualization. This is the year that damn box on the desk actually does what we need it to do.

 

 


8:20:56 PM    comment []


Click here to visit the Radio UserLand website. © Copyright 2005 Pete Wright.
Last update: 04/02/2005; 08:37:39.
This theme is based on the SoundWaves (blue) Manila theme.
January 2005
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          
Dec   Feb