Blog posts

The surprising science of motivation by Dan Pink

Wednesday, 28 July 2010

Posted by Sébastien Lachance with Comments (0)

Motivation can be hard to understand. Someday you are and the next day you’re not. While cleaning my bookmarks, I came across this talk by Dan Pink on The surprising science of motivation on TED.

It applies to us (Knowledge worker) and he demonstrate why it can be so hard to motivate us and how everyone knows how to, but it’s never applied.

 

 

There is also an animate version of this talk done by RSA. If you are more visual check this one out.

Daniel H. Pink  is a writer, blogger and speaker with 4 books under his belt.

 

Technorati Tags: ,,


Functional programming : Starting to learn Clojure

Friday, 23 July 2010

Posted by Sébastien Lachance with Comments (0)

 

The time has come for me to add another language into my toolbox and I decided to look at a functional language : Clojure. I have the Programming Clojure book, so why not?

Clojure is a modern Lisp language.

Yes, Lisp (LISt Processing). I never thought I would have been near or around it. I heard so many bad things about his complexity and how it would not useful in real life scenarios. But I have heard sometime about programmers who expended their mind to new programming concept with it. The following comment seems to be universal from programmers who knows it well.


I struggled to learn it, but once I finally get a grasp on it, it made me a better developer.

Why?

In our imperative language (Java, C#, Ruby, etc.) there is really no support for multi-core processing. That is, your program will only run on one core. Clojure is designed to support multi-core in mind and had support for dealing with concurrency really well.

What is Lisp?


From Wikipedia :

Lisp was originally created as a practical mathematical notation for computer programs, influenced by the notation of Alonzo Church's lambda calculus. It quickly became the favoured programming language for artificial intelligence (AI) research. As one of the earliest programming languages, Lisp pioneered many ideas in computer science, including tree data structures, automatic storage management, dynamic typing, and the self-hosting  compiler.

Just that. And I would like to add that it had a lot of parentheses. A lot.

Clojure is emitting JVM bytecode and goes hand in hand with Java but maybe not.


I was afraid of that. I know Java, but not the whole library. Since Clojure can and will use the library, you better know where you are heading. But again, if you want to learn fast, just jump in the shark pool. But, Java is absolutely not required to program with it if you don’t want to.

Clojure Code


Let's look at an example :

(loop [result [] x 5]
    (if (zero? x)
        result
        (recur (conj result x) (dec x))))


Output : [5 4 3 2 1]

This snippet of code is actually a loop from 5 to 1 and appending each time the current index to an array

This is not a tutorial but let’s dig deeper at (zero? x). In Clojure, a function that evaluate a condition have the name of it appended of an ?. So zero? is the function name and x is the argument. Yes, you read right, you don’t supply function’s argument like other programming language where it would look like :

bool isZero = IsZero(x);

Conclusion

I tried to present a little introduction to Clojure without going into too much details. I am not yet comfortable with every concept and what would be the advantages in real life. But, It will be an interesting trip. After a little more than three weeks now, and almost 10 hours of playing around and I can already say that I will need to see things differently.Very differently.

 

Technorati Tags: ,


I was a gamer

Tuesday, 01 June 2010

Posted by Sébastien Lachance with Comments (0)

Back when I was young (I’m 28), I was a gamer. I could play for hours and get almost no sleep just to play games. Every games and only good rated games. I could complete several ones in just one week. I was at one point a really big fan of the Warcraft series (not WoW by the way) and got ranked really high on Battle.Net. But life goes on and I reduced my average playing time to the minimum (and I am a new father, so it’s really not that much). Now I only play games that fit into the kind I love and that I know will not be crappy.

I could say the same thing to the time I now spend learning new programming stuff. I’m more picky at what I choose and tend to ignore a lot of thing that I would have found interesting if I had time to read them. So I need to choose really carefully what I decide to involve myself into, and spend the less possible time on learning anything that I could find easily with some googling.. I also ignore stuff that come and go quickly (Cardspace?). I understand the inner plumbing, but the implementation details are not so important unless it’s something I really need to (example : I needed to create a secure WCF service, but It’s not something I use daily and will probably not use it again in the next year, so why should I choose to learn everything about securing a wcf services?).

But in my early years of programming I would have done it. I mean, learn all that I can and purchase new books every weeks. But the reality kick-in quickly and it’s just not possible anymore.

How do I keep up to date and not become crazy trying to learn everything ?

1. I read blog. No, I read blog title and choose only what I think will be interesting for me.

2. I read books. But only great books. Other people already done the job of finding good ones. So I am not loosing my time on less than average book.

3. I work on my own project on my own time. I find it to be great to feel involved in all the stage of creating an application. UI, architecture, design, deployment, redaction, marketing, etc…

4. Watch screencasts. Dime Casts.Net and TekPub (maybe someday, I will buy a subscription).

So the question is: what do you do to keep up to date with everything and not let yourself become a programming zombie?

Technorati Tags: ,,


Buying games on Steam

Thursday, 13 May 2010

Posted by Sébastien Lachance with Comments (0)

Frankly, I never liked the fact of buying a game online and never hold a physical copy. Before some 3 months ago. There was a game (Torchlight) that I wanted to try right away, but unable to find it in store (here it's almost impossible to get a decent game if you don't go to the "big city"). I would have ordered through Amazon but a quick googling led me to Steam where the game has a 50% rebate on it.

If you don’t know, Steam is basically an online game retail store. Back to the point.

I enjoyed the experience. Checkout was fast, download the game was fast and the addition Steam has made to the game (like achievements) had a positive impact on me. Heck, your save games are stored on the CLOUD, how cool is that! I can play on my 3 computer and never have to worry of that.

And they have really big discount on weekend. And even free trials (Multiplayer Call of Duty : Modern Warfare 2).

 

Technorati Tags: ,,


I enjoy keeping a blog but...

Thursday, 13 May 2010

Posted by Sébastien Lachance with Comments (0)

It's hard, keeping the pace and finding interesting subjects to write about, but at the same time I enjoy seeing that I can help or entertain (maybe)  someone.

I made a decision and decided to write first for myself about things that interest me, instead of trying to interest everyone. If you happen to like what I'm writing about (even if I gave no specific direction to my blog), subscribe to my feed and I will try to just be myself and have fun in the process.

 

Technorati Tags:


SQL Server Compact is not intended for ASP.NET development.

Monday, 10 May 2010

Posted by Sébastien Lachance with Comments (0)

The solution is to set the SQLServerCompactEditionUnderWebHosting  property of the current application domain to true.

 

Technorati Tags:


Build failed due to validation errors

Monday, 10 May 2010

Posted by Sébastien Lachance with Comments (0)

Error 1 Build failed due to validation errors in C:\projects\webapp1\Database.dbml. Open the file and resolve the issues in the Error List, then try rebuilding the project. C:\projects\webapp1\Database.dbml

The package Visual Studio use to build a LinqToSql database is marked to be skipped, so a quick reset of the “skip loading list” will resolve this issue.

1. Open a command prompt and navigate to : <visualstudiofolder>\Common7\IDE

2. Then execute : devenv.exe /resetskippkgs

Technorati Tags: ,


Response.Redirect in a page callback

Monday, 10 May 2010

Posted by Sébastien Lachance with Comments (0)

Response.Redirect cannot be called in a Page callback

Sometime you may need to redirect the user somewhere else when doing a page callback. This is not possible with Response.Redirect but you can use Response.RedirectLocation,

Response.RedirectLocation = "notarealpage.aspx?i=1";

 

Technorati Tags:



Ajax, Wcf and deserialization problem

Monday, 10 May 2010

Posted by Sébastien Lachance with Comments (0)

{"ExceptionDetail":{"HelpLink":null,"InnerException":null,"Message":"The token '\"' was expected but found '''.","StackTrace":" at

I was getting this error when doing an Ajax call to a WCF service with jQuery.

There could be many reasons for this, but one possible fix is to use double quote instead of single quote. So changing :

data: "{'Id': '12'}"

 

to

data: '{"Id": "12"}'

will most likely resolve your problem.

Technorati Tags: ,,


Steve Jobs and his thoughts on Flash

Monday, 03 May 2010

Posted by Sébastien Lachance with Comments (0)

Thoughts on Flash

I read through this article this morning and found it interesting. At first I was considering strange the fact that the IPad was not supporting Flash, but after reading carefully this article, it makes sense.