27 November 2008

I just registered for the 70-536 exam

Wish me luck, everyone! I'm taking the 70-536 exam (Microsoft .NET Framework - Application Development Foundation) on the 16th of December. So I have a bit less than three weeks to get ready. Maybe the fact that two colleagues from work are doing something isn't reason enough to do it, but I don't care - I'm doing it.

Okay, so how do I get prepared? Boss bought us the training kit:

It's a book with practice tests, so I'm reading it when I can and taking the tests. I really hope it will work. I'm a bit worried as I haven't heard the best opinions about it, but, well, we'll see.

My 6-months programming experience should help too, I recently learned how to use reflexions, for example. Basically, that's what the exam is supposed to measure: your level of experience.

26 November 2008

My new addiction: Project Euler

I've got a new dangerous addiction: Project Euler. It's a website with cool math problems, like:

Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000.

These problems are quite easy to solve with a little piece of code, so it's great way of learning a new programming language. I try using that to learn ocaml for my functional programming class, but sometimes I forget about that and succumb to the tentation of writing a C# console application with great ease.

I have solved 12 problems out of 218 so far and when I start solving them, it's hard to stop! Yep, one more addiction...

24 November 2008

New IT Croud season!

Should have told ya guys on Friday but I forgot. Anyway, The IT Crowd 3x01 just aired, and it's good, so go and get it!

21 November 2008

I bought a new laptop!

I bought a new laptop! It's an MSI Wind U100, it's pink and it's as cute as that:


Didn't really have time to test it yet - all I can say is that WinXP SP2 Pro got installed in 12 minutes and boots instantly. Something more like a review should appear here within days.

It's pink! I'm so excited! This was a really spontanious buy: I got the idea of buying a lightweight laptop on Sunday, picked the model on Wednesday, bought it yesterday (Thursday)!

Did I mention it was pink?

[Picture source, source]

15 November 2008

There's a 65% chance that I'm a man

There's a 65% chance that I'm a man.. at least according to Gender Analyzer:



[Update]It was 70% a few days ago and 75% today!

13 November 2008

How much music can you buy in 3 days?

So I was saying I bought half a GB of mp3 recently. Well, there's more.

Two days later, I went shopping for a present for Boyfriend. I didn't get it, but I got 11 albums! Here's the list:


10 November 2008

Remember the world back in 1998?

Remember the world back in 1998? Yeah, that was whole decade ago...

I just watched a movie from these ancient times tonight, called "The inspectors":

There was a great scene when a child showed an inspector his computer with internet:

- Look, here we can search the internet. Give me a subject, any subject you like.
- Darts.
- Look, there are 138 webpages about darts.

Later, that inspector told the story to the other one and asked:
And you, have you ever surfed the internet?

Well, there are over two milion pages about darts today. But you know that very well, as you have already surfed the internet, haven't you?

[Picture credit]

09 November 2008

Silverlight: dynamically finding a storyboard in the VisualStateManager

Okay, I haven't been writing about Silverlight for quite a while, but here I am again!

Today, I'll discuss dynamically finding a storyboard in the VisualStateManager.

Basically, when you want to refer to some object, you set the x:name and there ya go. Here, things aren't half that simple.

In August/September, I used the following code, inspired by something posted on the official forums:

var query = from trans in
(from stateGroup in
VisualStateManager.GetVisualStateGroups(LayoutRoot)
where stateGroup.Name == "VisibleStates"
select stateGroup).First().Transitions
where (trans.To == "Visible" && trans.From == "Hidden")
select trans;

Storyboard sb = (Storyboard)query.First().Storyboard;
Ugly like an ugly workaround, but it worked in Silverlight 2 beta 2. But then Silverlight 2 came out and that didn't compile anymore.

I needed to recompile my code fast, so without thinking too much, I wrote a double foreach. Ugly too, but it worked.

And then, one beautiful morning, the SilverlightNews Twitter pointed me to an article just about that. "Great", I said to myself, "I'll see a the right way of doing that." I clicked and saw... a double foreach! I felt smart for a while, but I had a hard time believing that this way was the best. So I asked Boyfriend.

Boyfriend has a bad influence on me because he gives me way better answers than Google - and shouldn't people google instead of bothering others? This time was no different - Boyfriend wrote a single-line solution and posted it in a comment over there.

I decided to follow his advice and rewrite my code the same way. After sweat, tears and another Boyfriend bother, I got this:
Storyboard sb = VisualStateManager.
GetVisualStateGroups(n.NodeLayoutRoot).
Cast<VisualStateGroup>().
Where(sg => sg.Name == "VisibleStates").SingleOrDefault().\
Transitions.Cast<VisualTransition>().
Single(t => t.To == "Visible" && t.From == "Hidden").
Storyboard;
No doubt it's single-line, no doubt it's shorter. Whether it's nicer, easier to write or more effective than a double foreach, we can discuss. I guess it's easy if you know Linq, which I don't. Wait, I do, I just wrote my first piece of it!

Best interface ever

Great picture, isn't it?



Doesn't it inspire you to make an interface like that?

I unfortunately don't know the source - tell me if you know anything.

[Update] Found! See here for pics of this great pic being made!

02 November 2008

Bought half a GB of music (again!)

I'm a happy geek with a great job and a brand new hard drive. What's to do in such a situation? Buy music!

Since I bought Amy Studt's album on 7digital I got very fond of this shop for its simplicity, wide range of avaliable music and affordable prices. So when I got this new drive I decided to fill it with some new music. So here's what I got back then:

Krystal Meyers - Make Some Noise

Make Some Noise

by Krystal Meyers

Vanessa Carlton - Be Not Nobody

Be Not Nobody

by Vanessa Carlton

Katy Rose - Because I Can

Because I Can

by Katy Rose

7digital indiestore - The Very Best of 7digital indiestore 2008

The Very Best of 7digital indiestore 2008

by 7digital indiestore

And here's what I got today:

Lucie Silvas - Breathe In

Breathe In

by Lucie Silvas


Nerina Pallot - Dear Frustrated Superstar

Dear Frustrated Superstar

by Nerina Pallot

Sandi Thom - Smile...It Confuses People

Smile...It Confuses People

by Sandi Thom

Natasha Bedingfield - Unwritten

Unwritten

by Natasha Bedingfield

Vanessa Carlton - Harmonium

Harmonium

by Vanessa Carlton

Plus a few singles.

All in all, I purchased 157 Tracks that take 1180Mb on the new drive.

01 November 2008

I swear I don't celebrate Halloween

I swear I don't celebrate Halloween. I just was at a party yesterday. And two years ago too. I don't remember about last year, however - does that mean I partied that hard?

Yesterday's party was at Long Unseen Friend's place and had nothing to do with Halloween: he was just back for a few days (he's an exchange student) and wanted to meet his friends. One guy had had his birthday a few days sooner and therefore receive a few gifts and a cake substitute. Besides that, the party consisted of people sitting on the floor, eating (Long Unseen Friend's Mom prepared lots of great food), drinking beer or juice and talking. Talking consisted of people talking about what they do best and others interrupting them with a "Will you stop talking about your master thesis? We're trying to have a party here!". Almost everyone had to be interrupted in such a way at least once.

No matter how much I appreciate people trying to have fun and forget about school, I kinda miss the times where we would play Set, or worse: the differentiable function (people sit in a circle and someone gives a function and n-th person gives its n-th derivative). Well, nothing lasts for ever, not even that great game, although it could if the starting function was smooth.