Tigraine

Daniel Hoelbling-Inzko talks about programming

The modern age of printing!

killepson Tomorrow is an important exam on computer organization and design and I was learning. We are allowed to use our records during the exam, so I went through the whole bunch of documentation our professor supplied and searched for helpful stuff I could carry with me tomorrow. Obviously, taking 150 pages of notes with you won't help so I got down to about 25 pages with some meaningful information on them.

So, usually I'd just hit CTRL + P on any page that I think is worth it and print that one page out.
But: Epson managed to totally screw up their drivers (for any OS) so I finally ended up printing everything to XPS, copying it over to the machine where my printer is installed and printing it out manually!
Yes, right: I physically went to another computer that's interconnected through a 100mbit Ethernet to print out 25 pages! (Am I the only one feeling like stone age here?)

So, what went wrong?
I have a Epson EPL-6100L sitting on a Windows XP Professional computer connected through USB.
Drivers and everything are setup and the printer is working.
Only problem? In case you run your printer over the network windows is installing the printer drivers locally to your machine and creates a virtual adapter for that printer to communicate over the network.
I admit, that's not the best possible solution I can think of, but it usually works.
Only that Epson built those stupid monitoring applications into their driver, so whenever I try to print something the printer driver is trying to poll the printer for it's cartridge status and stuff (That printer isn't connected to this computer, so the poll times out). Great stuff about this? During this 10-20 second timeout the application you're using to print freezes completely (read: not responding in taskmanager) until the driver gets over it's problems and finally sends off the doc.
Note that the driver first almost crashes your app, then after printing out something stupid as "Can't find printer status information" it starts sending off my document.
And there are times where the driver completely crashes and I can't print anything.

But, yet I had lived through the above problem on XP. But on Windows Vista it looks like the OS is doing something to the printer driver when you just bring up the printing dialog. So my app freezes for like 5 seconds whenever I start a print dialog.
Taking my user experience to the next level of pain:
Print -> (5 sec wait) -> hit OK -> (30-60 seconds wait) -> clicking stupid messagebox -> (wait 5 secs for the printer to start) -> get printout.

Man was I pissed when I had to go through this tedious process for like the 3rd time. So I lost it and did the XPS -> copy stuff to get it done in a reasonable amount of time.

So yes, Epson really really screwed this one!
Yeah, they really did. And rest assured that I'll never ever buy another Epson printer in my whole life!

But now to you guys, any suggestions on buying a new printer?
I am absolutely sure that I don't need color printing (got another printer for that), I want a fast printer, I want it directly connected to my network (own IP) and that I want all of that pricey!
Suggestions are welcome.

Filed under personal

Live Writer and it's transparency

Since I got my 24" HP monitor I really started to fancy the new Vista Aero glass effects that let my desktop shine through borders and stuff.
Although I usually stockpile window upon window, that little blur effect on the windows is something I definitely like about Vista.

Due to all this common Vista look'n'feel I never really noticed that Windows Live Writer is a .NET 2.0 application using Windows Forms AND (&&) having a transparency effect on it's splash screen!

Windows Live Writer

So, why this never came to my mind is something I don't know, but today I closed a background window while starting up WLW and found out that my desktop and the WLW splash where out of sync.

Basically, Windows Live Writer has no transparency of it's own. It just takes a screenshot and handles the transparency effect in it's form.
If the screen behind WLW splash is changing, changes don't reflect onto the slash page (as they do in Vista aero).

Funny stuff, but definitely something I'd keep in mind when it gets to fancy looks on pre-WPF projects.

Filed under internet

Buying yourself an Apple

iDontcare

Did you snicker when you first saw this picture above? If not you are either one of the blessed people out there who don't know Apple or one of those ignorant's who will flame anybody who doesn't think "the Apple way"®.
Personally I think most of my readers will be neither nor.

First things first: My brother wants to buy an iPod.
And, as much as I would love to talk him out of it, I can't.
I simply can't because there is no other device currently available in Austria except for the iPod.

Ok, now you know I hate Apple products. (Flame me!)
I personally don't like the i<SomeProductName> design Apple has been doing for the last years (just personal taste!). But I think I could overlook the design if I wouldn't dislike the message Apple has been delivering together with their products (lifestyle isn't something I define through my mp3-player or laptop). And foremost, I don't like their pricing policy.

But that's all me. Now if you aren't already biased: What mp3 player should you buy if those assumptions hold true:

  • You hear lots of music (>8 gigabyte)
  • You hear music depending on your mood
  • You don't see the price of 250€ as a problem
  • You like the iPod design
  • You like using iTunes (my brother does)

So, let's assume you want an 80 gigabyte mp3-player. And you look at the market and find: Creative, Apple, Sony and some other nonames (that obviously wouldn't be noname anymore if you should consider them).
You see? Something is missing in that list. Something that's a real alternative to the iPod.
I mean, hell yeah, you can buy an Creative ZEN and be happy with it. But the software is and has always been really awful (so they made it compatible to iTunes). So, you're buying a ZEN that you will be using through iTunes: Does it ring a bell? Why bother with ZEN altogether if your iPod works with iTunes much better than ZEN?
And on the Sony side of things: They didn't get their player right imo. While the ZEN shines as a great mp3-player with good sound, Sony just messed up the whole usability concept (and their desktop software sucks too).

So what's left? Some crappy mp3-player that unfortunately is the only choice you are currently presented: iPod.

I am still hoping Microsoft is going to release the Zune in Austria someday soon. Until then, there simply is no viable alternative to the iPod.

Filed under personal

Alive and kicking

I know I haven't posted for some time, mainly due to the fact that I'm in the middle of exams right now.

While I should be learning Computer Organization & Design for next week's exams (besides some other stuff I should be doing right now), I started off reading my new book Code Complete: A Practical Handbook of Software Construction by Steve McConnell.

While I'm not fully happy with Amazon's delivery (a week late, both books got damaged during the lift), I am very happy with the book itself. Unfortunately it isn't that easy to read, so due to a lack of piece and quiet I haven't read past chapter 4.

McConnell laid out in his first chapter that real Software Development Ideas won't be addressed before chapter 5, so I was pretty much reading through common problems during project inception and the differences between sequential and iterative programming.

Besides reading and learning I also started some ASP.NET MVC experiments, but I think I'll back up on that for now and try to make myself familiar with the pattern behind MVC.

Filed under personal

.NET Framework Library Source Code released

Wow! Scott Guthrie just announced on his blog that the source servers are ready and that they just released most of their .NET source code to the public.

This means that you are able to download the debug symbols and actually debug the .NET classes if you want to. Or you can just drool over the framework and try to learn a thing or two.

Go check out Shawn Burke's blog post about how to set things up.

Filed under net, net, net-35, microsoft

Windows Live!

How many of you know Windows Live?

Microsoft Windows Live

Windows Live is Microsofts new way of doing online applications. They changed almost every one of their services to match the Windows Live brand. Hotmail, MSN Search, MSN Messenger etc, all of those are now called Windows Live Search/Hotmail/Messenger.

And while at it Microsoft also released two cool new desktop applications called Windows Live Writer and Windows Live Photogallery! (You can get them at: get.live.com)

Windows Live Writer

How do you write your blog posts? Most people do so in their browser using those incredibly bad WYSIWYG inline HTML editors their blog software came packed with. When they post Images they do so after resizing it in Photoshop etc etc.

Now, that somehow works. I mean, most blog engines have some AJAX in place to save your drafts every few seconds and uploading works mainly through the browser. So how could this really be improved?

By installing Live Writer, handing over your blog address and login credentials and being set to go. Live Writer downloads the blog styles from the web, automatically checks for supported stuff on the blog engine and presents you with a perfectly intuitive and great interface for writing your blog posts. You can easily drag and drop, insert tables, images, links without any need to ever get down to the HTML source. And of course you can insert images, but instead of firing up Photoshop and doing the resizing yourself, Live Writer is doing it for you (while being able to add blur, shadows, border, watermarks etc).

You can even use Live Writer to edit already published content or create/edit new pages (if your blog engine supports that). To be honest, since I've been using Live Writer I haven't seen my wp-admin page for anything else than deleting Askismet spam!

Here Screenshot of Windows Live Writer while writing this post:

Windows Live Writer Screenshot

Windows_Live_Photo_Gallery_logo

Windows Live Photo Gallery is the other great new app coming with Windows Live. Although it's not completely new, it's just a better version of the Windows Vista photo gallery. It does the same thing, it watches the filesystem for changes and shows them in a very clean intuitive way.

What's changed from the Vista default version is built-in support for uploading photos to Flickr or Live Spaces. And, that's why I started using it: It comes with a great new feature called "Create panoramic"!

It's so damn simple, take two pictures and click one button. Voila, you get a panoramic view like this:

panorama2 + panorama1 

Result: panoramic3

The final image still needs cropping, but that's something Live Photo Gallery learned since it's appearance in Windows Vista. Simple fixing like red eye removal, cropping, color adjustments or sharpness can easily be done from within Photo Gallery.

Computer Programming Quotes

Oh god, I am still laughing after having read this brilliant list of 101 Great Computer Programming Quotes I found on DotNetKicks.

Here are some of my favorites, although I would recommend the whole list to anyone with some spare time!

  1. “Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders.”
    (Alanna)
  2. “Computers are like bikinis. They save people a lot of guesswork.”
    (Sam Ewing)
  3. “Programming is like sex: one mistake and you’re providing support for a lifetime.”
    (Michael Sinz)
  4. “Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots.  So far the Universe is winning.”
    (Rich Cook)
  5. “It’s ridiculous to live 100 years and only be able to remember 30 million bytes.  You know, less than a compact disc.  The human condition is really becoming more obsolete every minute.”
    (Marvin Minsky)
  6. “Hardware: The parts of a computer system that can be kicked.”
    (Jeff Pesis)
  7. “I’ve finally learned what ‘upward compatible’ means.  It means we get to keep all our old mistakes.”
    (Dennie van Tassel)
  8. “There are two major products that come out of Berkeley: LSD and UNIX.  We don’t believe this to be a coincidence.”
    (Jeremy S. Anderson)
  9. “There are two ways of constructing a software design.  One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.”
    (C.A.R. Hoare)
  10. “Software suppliers are trying to make their software packages more ‘user-friendly’…  Their best approach so far has been to take all the old brochures and stamp the words ‘user-friendly’ on the cover.”
    (Bill Gates)
  11. “There’s an old story about the person who wished his computer were as easy to use as his telephone.  That wish has come true, since I no longer know how to use my telephone.”
    (Bjarne Stroustrup)
  12. “The use of COBOL cripples the mind; its teaching should therefore be regarded as a criminal offense.”
    (E.W. Dijkstra)
  13. “There is no programming language–no matter how structured–that will prevent programmers from making bad programs.”
    (Larry Flon)

Enumerators in C#

I am still trying to figure out if what I did was useful or not.

Based on the assumption that sometimes you may need a variable typed IEnumerable<T> to hold a value that only implements IEnumerable I wrote this adapter class (you find it after the jump).

What's IEnumerator?
IEnumerator it the old non-generic implementation of the Iterator pattern, while IEnumerator<T> is the strongly-typed generic version introduced in .NET 2.0.

IEnumerable<T> implements IEnumerable, but there is no way to cast IEnumerable to IEnumerable<T>. So I wondered how you could comply to the Iterator pattern.

My first suspicion came when I tried foreach on both IEnumerables. Foreach has no problem with both of them, so I dug out my C# language spec and discovered that foreach has to use two different methods for either IEnumerable or IEnumerable<T> (That's not really clear there, anyone to falsify my assumption?).
They could have gone the other way and use the non-generic IEnumerable for the iteration, but that would need an implicit typecast on every iteration (and that would slow things down I guess).

In a scenario like the following one you can't pass the Enumerator created by an Array.GetEnumerator() because it uses IEnumerator instead of the generic version IEnumerator<T>.

public void PrintList(IEnumerable<String> MyList)
{
  
foreach (String Entryin MyList)
    {
      
Console.WriteLine("{0}", Entry);
    }
}

Because IEnumerable<T> implements IEnumerable you could just switch back to the non-generic version, but that's something I don't really like (although it may be more practical).

So here are 2 (very simple) adapter classes that will provide upward-compatibility to your IEnumerable and IEnumerator needs:


public class GenericEnumerableAdapter<T> : IEnumerable<T>
{
    private IEnumerable _Old;
    
    public GenericEnumerableAdapter(IEnumerable OldEnumerable)
    {
        this._Old = OldEnumerable;
    }

#region IEnumerable<T> Members

public IEnumerator<T> GetEnumerator() { return new GenericEnumeratorAdapter<T>(_Old.GetEnumerator()); }

#endregion

#region IEnumerable Members

IEnumerator IEnumerable.GetEnumerator() { return _Old.GetEnumerator(); }

#endregion }

public class GenericEnumeratorAdapter<T> : IEnumerator<T> { private IEnumerator _OldEnum; public GenericEnumeratorAdapter(IEnumerator OldEnumerator) { _OldEnum = OldEnumerator; }

#region IDisposable Members

public void Dispose() { this._OldEnum = null; }

#endregion

#region IEnumerator<T> Members

public T Current { get { return (T)_OldEnum.Current; } }

object IEnumerator.Current { get { return _OldEnum.Current; } }

public bool MoveNext() { return _OldEnum.MoveNext(); }

public void Reset() { _OldEnum.Reset(); }

#endregion }

I&apos;m so stupid

Hey! I just wanted to let you know that I was searching for about 20 minutes for the meaning an @!

E.g. in this code:

Regex r2 = new Regex(@"([\{a-z]+)([0-9]*) ");

You may notice that the @ in this Regex is outside the actual String and that has to mean somethign.


Stupid me found the answer!

Placing an @ before a string in C# tells the compiler to NOT use escape sequences within the string.


So you don't need to do stuff like \\ for a single \ etc.

Man why didn't I found out earlier!

Filed under net, programmierung

CES 2008 Keynote

billgates You know that you have some serious affinity toward Microsoft software and technologies when you live in Austria (being GMT+1) and stay up waiting to watch Bill Gates deliver his keynote speech at 6:30 PM Pacific Time (GMT-8) (that's only 9 hours of difference, meaning it's been 3:30 AM here in Austria) at the Sands Expo and Convention Center in Las Vegas!

And hey, I really really regret it!

  • Now I need to get myself a ugly Fiat or Ford to have Microsoft Auto on my car.
  • They made some vague assumptions that the Zune will launch in Europe someday (man I didn't want to spend those 300€).
  • They made me even more eager to buy an XBox360 (man, my girlfriend almost had talked me out of this!).
  • I now seriously need to get myself a Windows Mobile powered cell.

So, frankly - I loved this keynote.
I mean, I've seen most of this stuff somewhere before. There is a reason most of my friends ask whether I am paid by Microsoft for talking about their newest technologies all the time.
But still, Gates and Robbie Bach somehow managed to deliver their message.

Good, but short!

Whoever looked upon the Silverlight technology and it's uses, knows that to showcase Silverlight you clearly need the full keynote, not only some 3 minute spot from NBC.

If you've ever heard word from Microsoft Surface knows that that one technology alone is so freaking great that Steve Jobs would need 2 keynotes to promote it.
You should definitely check out the Videos on the offial Page as well as some on Youtube (like this one, or this one).

Something that also fell short was Microsoft Auto.
Although I didn't knew too much about this service before the keynote, I am very sure that they showed it wrong.
So, basically: Microsoft Auto is your new board-computer in your car. You have access to devices like your Zune, your Cellphone (running Windows Mobile) etc etc.. And that through voice recognition and integration into the car.
So, what did they do wrong? First off, they showed the Zune connected to car through a simple cable. - Heck, I know that the Zune has WiFi, and I am pretty sure it can't be so fucking difficult to build WiFi into my brand-new car! So why do they need that cable? Cables are for iPhones, I've got my Zune to get rid of those cables. They managed to connect my phone through Bluetooth, why not my Zune.
The way they showcased that stuff it looked like the presentation for some built-in hands-free device to control your Zune, not a entertainment and media-system that makes my car more fun!
(They only briefly mentioned a new service that's calling 911 when your airbag goes off and you don't interrupt the car's cry for help.)

On the XBox360, I am very pleased to hear that it's features will go way beyond gaming so that I may have some leverage in my ongoing discussion with my beloved one about buying an XBox360.
The XBox360 will start selling as a set-top box for Microsoft Mediaroom (their new IPTV Service) and in the near future start to broadcast (on the normal XBox360) shows from Disney and abc (Lost, Grey's Anatomy, Desperate Housewives) through XBox Live. So maybe buying an XBox360 is a key to getting my digital home-entertainment system (after Intel failed me with their Viiv technology).

 

Oh, and by the way, you can watch the Keynote here.

My Photography business

Projects

dynamic css for .NET

Archives

more