In one of my applications I’m using the WebClient class (from namespace System.Net) to download a file from the internet. The syntax is pretty easy:

var client : WebClient := new WebClient();
client.DownloadFile(src, dst);

With src and dst being strings. This worked always fine for me until recently after I’ve installed a proxy. To have WebClient automatically use your proxy-settings (e.g. taken from the Internet Explorer) simply add the following line after instantiating WebClient:

client.Proxy := new WebProxy;

To learn more about automatic proxy detection read on here.

Recently I’ve purchased an Acer Aspire 5741G. It ships with Windows 7 pre-installed. Nowadays most manufacturers consider it a good idea to equip their notebooks with an extra partition which holds all data necessary to recover your Windows installation. So if your installation is screwed up (think of a virus or something) you can put your notebook back into factory default. Of course the operating system of my choice is Ubuntu rather than Windows 7. However, I wished to keep a functional Windows partition and recovery partition just in case I plan to sell the notebook in a few years. Thus I wanted my Windows partition to be repartitioned in order to install Ubuntu alongside Windows. Ubuntu’s installation guide explains here that this could be done as part of the installation procedure. And indeed this was dead easy. I just needed to to configure via a slider how big I wished the Windows partition to be. Installation succeeded without any problems.

After booting Ubuntu the Hardware Drivers application asked me if it should install and activate drivers for the Wifi card and the graphics card. Of course I accepted and within seconds my graphics card was configured and access to my WLAN was set up. A quick test of the keyboards function keys and he SD-card reader (I expected both to be problematic) revealed that everything works fine.

It seems we’re ultimately getting rid of Flash, thanks to HTML5 and
CSS3. The web sports interesting sites demonstrating the power of the
new technologies. The following demos are worth a look:

If you intend on jumping the train you might find the following
tutorials/books useful:

DiffPDF

Comments off

I’ve just come across DiffPDF, which is a tool helping you to compare PDF files. It provides two modes: textural comparison of the documents and comparison of the files’ appearance (for instance figures or moved items).

And here’s a list of news feeds.

Here’s a list of podcasts I’m regularly listening to.

Office 2010 and SharePoint 2010 have been released. If you live in Germany you can try your luck in Microsoft’s lottery and win a Nokia E72 smartphone. Browse to http://www.microsoft.com/de/de/dynamicit/microsoft-virtual-launch-event-gewinnspiel.aspx and read how to participate.

I just came across a new open source news site: opensource-news.com. Don’t know yet wether it’s worth to subscribe to their feed, I’ll watch it for some time and decide again.

This is more a hint for Windows developers coming originally from UNIX systems. If you’re missing tools like ps, top, pstree or strace you should have a look at the website www.sysinternals.com which offers a suite of advanced system utilities.

A very handy tool in the UNIX world is tail. In particular the option -F proves useful if you want to view log files. But what do you do if you’re working with Windows? Of course, you have to search the Internet for a Windows port and go through the compile-hell. I have to admit, compiling tail wouldn’t be such a pain in the ass as compiler bigger programs. Nonetheless, I wasn’t willing to spend time searching and installing a Windows port of tail and thus I coded it within a couple of minutes. The following Python script only implements tail -F filename, but that was sufficient for my purposes.

import sys, time

lastLine = 0
f = 0

def dumpFile(f, start):
  f.seek(start)
  cur = start

  for line in f:
    print line,
    cur = f.tell()

  return cur

while True:
  try:
    f = open(sys.argv[1], 'rU')
    lastLine = dumpFile(f, lastLine)
    time.sleep(1.5)
  except IOError:
    print 'no such file' + sys.argv[1]
  finally:
    if f:
      f.close