18 March 2009

Silverlight: the simpliest master pages ever (plus links to subpages)

I gave a presentation about Silverlight today at school. It went great and benefited me as well, as it took me away from all the wedding preparations and made me look at some old code and notes (well, some new too, I'm staying in the Cream's 'Light).

So, two things tonight. First, master pages. You probably have read Jesse Liberty's and Gerard Leblanc's articles - they're great and full of useful information, but I'll try simplifying things as much as possible.

Now, let's say you have your subpages as controls and you want to have a header/footer/sidebar.

  1. Start with a Grid layout, (Grid is the best one in general, more on that maybe someday), fill the right cells with that common header/footer/whatever.
  2. In the biggest cell, the one for subpages, place a ScrollViewer.
  3. Now, tell me, what is a ScrollViewer? A ContentControl. It means it has a Content property. It means it hosts a single control. What control could it be, hum?
  4. theScrollViewer.Content = theSubpage; - that's the whole navigation code!
Ok, now the subpages. I used to think until today that this was impossible, and that it was one of the main reasons using Silverlight for building typical websites wasn't a great idea. But the guys from SilverlightShow proved me wrong with their recent article about Interaction between Silverlight and the Browser:

I won't post any code here, just refer you to that article, my excuses being the lack of time and that the idea is not mine. As for translationg the idea into a working solution, I'm sure you'll do it easily.

Now we just need a way to handle the "back" button and the whole navigation history (thanks to one of today's listeners for bringing that up). However, my Silverlight sites don't go over 10 content pages, so tracking navigation history doesn't really have a point. And hey, it's Silverlight, it's super easy to do!

12 March 2009

Geek plays home, starting with the WC

I'm getting married, moving out, then moving in, all that stuff, and today, shopping on-line for cool home items.

Turns out every room in your home can be cool, and the coolest of all can be the toilet.

The Sudoku toilet paper deserves an honorable mention for making it possible:

The toilet seat can bring a lot of fun to the bathroom as well. Well.. sometimes, "WTF was the designer thinking" is more appropriate than "fun". Let this picture speak for itself (or forever hold its peace):

I guess "Pharaoh's treaures" sounds better than "WC content", doesn't it?

This one just feels wrong, and not in a forbidden fruit kind of way:

However, the best toilet ever was posted today by Gizomodo:

This one definitely takes the art of toilet designing to new heights. Or lows, depending on the point of view.

On my wishlist: *that*

That is definitely on my wishlist:

Can you guess what it is? The answer (and picture credit) is here.

10 March 2009

A projection pro: Fred Eerdekens

In linear algebra and functional analysis, a projection is a linear transformation P from a vector space to itself such that P2 = P, says Wikipedia. Sweet. Can you understand that? (I can, but I study math, so I have to.)

I will show you today someone who definitely can, though he's not a mathematician: Fred Eerdekens. Proof? The pictures below:

Aren't they impressive?

09 March 2009

CD's 30th birthday - let's celebrate!

I just learned from Gizmodo that the Compact Disc celebrated its 30th birthday yesterday.

Happy birthday, then CD! Let's celebrate (I know, it was yesterday, but I had a life yesterday).

Since I'm getting married in April, I'm moving out, and for that occasion, I'm getting rid of as much stuff as possible. Uncluttering by me usually means:

  1. opening a random drawer
  2. looking at the whole bunch of stuff I haven't used for years
  3. finding the reasons why it's okay to throw it away (and beating all the "but it's a gift", "but I might use it",...)
And since I'm not good at doing this one huge organizing day, I declutter piece by piece. Piece of the day: tapes. My old and not really working sound system is not going with me (fiance has a much better one). New sound systems don't read tapes. Besides, tapes have low quality and use storage space and it's way better to re-buy everything as mp3. Or even CDs.

Bottom line, I'm celebrating the CD's birthday by throwing my tapes away. How geek.

05 March 2009

Lego food

What geek doesn't love Legos? Legos are the one and only toy I'm never-ever gonna give away - all my bricks are for my kids. But that's not the point of today's post. I just came across some cool Lego food stuff, and there's enough of it to throw a Lego-themed party. Check it out!

First, Apartment Therapy show us how to make an Anatomically Correct Lego Cake:

Betty Crocker also has great Lego block cakes:

... and Hello Naomi has these fabulous cupcakes:

Joe Reid found some Lego fruit snacks, lucky guy:

However, it's much more fun to make them yourself:

Anything else can be packed in Lego lunch boxes:

Lastly, the dinks! The Lego store used to have a Lego block ice cube tray:

Now, who feels like throwing a Lego-themed party?