May
22
2010

Missing a little FileAccess.Read and it doesn’t work

What is the difference between this code

using (var fileStream = new FileStream(settingsFilename,
                                       FileMode.Open))
{
    return ReadSettings(fileStream);
}

And this code

using (var fileStream = new FileStream(settingsFilename,
                                       FileMode.Open,
                                       FileAccess.Read))
{
    return ReadSettings(fileStream);
}

Almost nothing, just a little FileAccess.Read !

But this little thing makes a big difference when you run your software in a secured environment.

The application with this piece of code was deployed to a customer reporting that the application was crashing at a the point of reading the settings. Weird, really weird. After getting back the log and I finally discovered that using juste FileMode.Open needs modify rights and that’s was the issue because the customer deploy the settings file on a folder in which the user doesn’t have the modify rights.

May
21
2010

f.lux Better lighting…for your computer

A couple of month ago I was introduced by a colleague to f.lux.

At first I thought, hum ok another software that will just eat some memory for nothing. But after 2 days, in fact 2 evening, yeah I work a lot in front of monitors, I was conquered and I recommend this tool to all like me that spend their days and nights in front of monitors!

From f.lux pages

Ever notice how people texting at night have that eerie blue glow?

Or wake up ready to write down the Next Great Idea, and get blinded by your computer screen?

During the day, computer screens look good—they're designed to look like the sun. But, at 9PM, 10PM, or 3AM, you probably shouldn't be looking at the sun.

F.lux fixes this: it makes the color of your computer's display adapt to the time of day, warm at night and like sunlight during the day.

It's even possible that you're staying up too late because of your computer. You could use f.lux because it makes you sleep better, or you could just use it just because it makes your computer look better.

f.lux makes your computer screen look like the room you're in, all the time. When the sun sets, it makes your computer look like your indoor lights. In the morning, it makes things look like sunlight again.

Tell f.lux what kind of lighting you have, and where you live. Then forget about it. F.lux will do the rest, automatically.

flux-shot[1]

May
19
2010

ASP.NET MVC 2, MSpec and Watin

The other day I posted about “Automated functional tests using Watin and MSpec” which we do at Jobping as a spike to automate our functional tests on our ASP.NET MVC 2 site.

Yesterday evening I was facing an issue in my base class WebBaseSpec which led to really strange side effects. Basically when I was running one unit test alone it was Green, running all or more than one unit test will fail miserably with the well known STA issue of Watin.

So I thought that I had an issue with the ReSharper MSpec plugin but after some discussion with Alexander GroßI realized that the second failing test was showing another issue than the STA issue.

Going further I realized that when I was checking the following

It should_direct_user_to_aboutus_page = () =>
    Browser.Uri.Route().ShouldMapTo<HomeController>(x => x.About());

First I needed to call the ASP.NET MVC RegisterRoutes

MvcApplication.RegisterRoutes(RouteTable.Routes);

which was done in the constructor of my WebBaseSpec class.

protected WebBaseSpec()
{
    MvcApplication.RegisterRoutes(RouteTable.Routes);
    InitBrowser();
}

That’s was the problem, I was registering the routes several time, one time per test. So first one was ok, second one was failing…

So I modified it to the following, ensuring that the routes were registered only one time!

private static bool registered;

/// <summary>
/// Initializes a new instance of the <see cref="WebBaseSpec"/> class.
/// </summary>
protected WebBaseSpec()
{
    if (!registered)
    {
        MvcApplication.RegisterRoutes(RouteTable.Routes);
        registered = true;
    }
    InitBrowser();
}

Now I can run all my functional tests again

4621024158_d2c99039a0_o[1]

May
14
2010

Jobping Open Source URL Shortener. Goes to Version 0.5

We have updated our url shortener for Jobping. jobp.in has moved along to Version 0.5. While maintaining as little features as possible!

Since the initial version we have placed a restriction(web.configurable) on the domain names that the shortener will shorten. We did this so only domains under jobping.com would be processed by the shortener. We wanted to maintain the integrity of the jobp.in domain. With this in place you can be sure that if you click a link shortened by http://jobp.in  it will always go to our site www.jobping.com site.

This version also includes a new custom style, which looks awesome and is now slick and styled inline with our main site Jobping.

4603509097_c8c3439491_o[1]

The new version can be downloaded from codeplex here: http://jpurlshortener.codeplex.com/

May
13
2010

Automated functional tests using Watin and MSpec

I am conducting a spike for a couple of evening on the way we might automate our functional tests at Jobping

I started with Watin and MSpec and the MSpec excellent plugin for ReSharper 5 which gives the following great outputs directly from Visual Studio

 4602612162_a3a0e50945_o[1]

After some discussion with Alexander Groß (Thanks for your help ;) to gain some knowhow about MSpec I finally managed to have some automated functional tests running like this:

[Subject("Search")]
public class when_user_search_using_keywords : WebBaseSpec
{
    const string Keywords = "C#";
    static SearchScreenObject searchScreenObject;
    static ResultScreenObject resultScreenObject;

    Establish context = () =>
        {
            searchScreenObject = new SearchScreenObject(Browser);
            resultScreenObject = new ResultScreenObject(Browser);
        };

    Because of = () => searchScreenObject.Search(Keywords);

    It should_direct_user_to_results_page = () =>
        Browser.Uri.Route().ShouldMapTo<HomeController>(x =>
            x.Search("AU", new SearchRequest { Keywords = Keywords}));

    It should_fill_search_textbox_with_keywords_entered_by_user = () =>
        resultScreenObject.SearchText.Text.ShouldEqual(Keywords);
}

I think it talks for itself!

Remarks to note:

  1. SearchScreenObject and ResultScreenObject represents an isolation layer between my tests and objects that are present on the web pages. This helps in the case you decide to change an id of an element
  2. I use MvcContrib ShouldMap to ensure that the browser navigates to the correct destination page which add another isolation layer and let me change my URL without impacting my tests

It is really funny to see the browser opening and clicking automatically, typing texts…

Hopefully, at the end this will replace our smoke test document and quite some time of manual testing.

May
12
2010

Fundamental Laws from David S. Platt on MSDN Magazine

Yesterday I got the new issue of MSDN Magazine in my mailbox and as often I started to go quickly around it to get an overview of what kind of subject’s it talks about. And as often I end up at the last page’s article which is the first I am reading.

This time David S. Platt is writing about “Fundamental Laws” which start like that

Whenever I find a program or Web site that sucks, it’s invariably because the developer or designer forgot the user’s goals and started embellishing the program for its own sake.

This reminded me a discussion I had a year and a half ago at Christmas time when my brother was back from Australia. We were discussing about what became Jobping.

And as you can read fom Jobping  press release, “Jobping launches niche job website listing Microsoft skilled vacancies”, it is one of our priority:

More features and functions based on user feedback and requirements will be implemented quickly as Jobping takes an organic and user oriented approach to product development.

From David

Your software has zero value in and of itself. Nothing. Nada. Zero point zero zero. The only value it ever has or ever will have is the degree to which it enhances the happiness of your user in some way

So when you develop software you’d better understand and listen to the problem of your users to delight them and enhance their happiness.

May
7
2010

IntelliJ 9 and changeset

Day after day I find little gems in IntelliJ 9 that just make me more productive and give me more time to deal with the real interesting things.

Today for example I had to change a web.xml file which I was said that I should take care not to commit because if this file would go to our customer than we would have a problem.

We are currently using JIRA and Greenhopper and I use the excellent plugin Atlassian Connector for IntelliJ IDEA

My working process, which is not rocket science but needs a bit of discipline, is the following:

  1. Before starting a change I check that there is a task in our JIRA
  2. Then I get this task and create a changeset in IntelliJ
  3. Starting from now, everything I change is logged into that changeset
  4. If I need to work shortly on another task I get another task from JIRA and create another changeset and start to log my work on that new changeset
  5. When it is time to commit I just commit the changeset. Done

Back to my web.xml issue, I had to take care not to commit it. I knew it from the start that I will have an issue if I commit that file.

So immediately, having the information,  I created a new changeset named “Do not commit” and added the web.xml change to that changeset.

4583794252_6d251ef393_o[1]

I was then on the safe side! Why? Because after working almost the whole morning and changing hundred of files I didn’t had to remember about that possible issue because the tool will remind me that. What a mind refresher!

If I had not done that then I would have to first remind that I don’t have to commit that file and then I would have to browse the hundreds of file searching for the one I have to commit and the other one.

So help yourself work on your toolset and become a more productive developer!

May
6
2010

IntelliJ 9 CSS editor

Today at Innoveo Solutions  I work on CSS and XHTML for our Skye® product.

I am using JetBrains  IntelliJ 9 since a couple of weeks now and I enjoy it very much.

I am always searching for tools which make me more productive in my daily work. IntelliJ 9 is such a tool. And today I have used a feature that helped me a lot.

I started with a CSS I received with that definition

4581559488_dbe2f66d3d_o[1]

If you take care you will see the underline under margin and background, when you place the cursor over you get the following info

4580933991_875d77222b_o[1]

Then you can press ALT-Enter to get an action that you can execute; “optimize margin properties”

4580947043_53b7dd6c0d_o[1]

So when you execute the action for margin and background you get the following optimized result

4581578768_3002940edb_o[1]

You might read more about the CSS capabilities of JetBrains IntelliJ 9 on the following blog.

May
5
2010

Certified ScrumMaster

As you might have read on Didier’s blog or even on Innoveo’s blog I passed the ScrumMaster’s certification end of last year. Yeah I know I am late to post this ;-)

I must say that the course held  by Jimi Fosdick was interesting and brought me some new idea.

What is Scrum? (ScrumAlliance definition)

Scrum: A team-based framework to develop complex systems and products.

Scrum is an iterative, incremental framework for developing any product or managing any work. It allows teams to deliver a potentially shippable set of functionality every iteration, providing the agility needed to respond to rapidly changing requirements.

The Scrum framework constantly challenges its users to focus on improvement, and its Sprints provide the stability to address the ever-changing needs that occur in any project.

These characteristics have led to Scrum becoming the most popular method in the world of agile software development.

At Innoveo we are using Scrum to build up our product Skye®, a front end solution for insurances.

At Jobping we are also using Scrum in a distributed way to build up www.jobping.com, our new job posting web site aimed specifically at job seekers and employers who work with Microsoft technologies.

4580044891_fdac4fa445_o[1]

I would like to thank Didier and Nick, first to give me the possibility to attend the ScrumMaster course and certification  and for all the interesting discussions we had on change management in an organization, Scrum, Agile, Software Engineering…

Certification was one thing, it was a step, having the possibility to live the framework in an organization is absolutely another thing which is made of lots of other steps.

May
4
2010

Jobping Open Source Short URLs Service

We at Jobping use different Open Source projects so we thought it would be nice to participate by giving back also to that eco-system. This is why we realized Jobping Open Source Short URLs Service 

The project goal was to have our own branded short URL service: http://jobp.in
As we leverage Twitter to have an easy way for job seekers to follow the different published offers, we decided that having our own branded url would be nice. Job posters now get an extra few characters for each tweet and readers can rely on our short URL as a trusted domain that leads them to our main site

Our shortener, http://jobp.in, only accepts long URLs that are in our jobping.com domain.

As it is an Open Source project hosted on Codeplex http://jpurlshortener.codeplex.com, anybody can get its own deployed.

Jobping URL shortener works like other URL shortener services, it takes a long URL and makes it really short. When a user requests one of our short URLs e.g http://jobp.in/g the URL shortener service will redirect the user to the long URL. It issues a standard 301 redirect, an efficient and search engine friendly method for redirecting the user to the long URL location.

If you want more technical details you might read more on the blog of Mark : “Announcing: JP URL Shortener. Open source MVC.NET 2 C#

Stay tuned, we will be contributing more projects just like this to the open source community.

About Laurent

Laurent Kempé

Laurent Kempé is the editor, founder, and primary contributor of Tech Head Brothers, a French portal about Microsoft .NET technologies.

He is currently employed by Innoveo Solutions since 10/2007 as a Senior Solution Architect and certified Scrum Master.

Founder, owner and Managing Partner of Jobping, which provides a unique and efficient platform for connecting Microsoft skilled job seekers with employers using Microsoft technologies.

Laurent was awarded Most Valuable Professional (MVP) by Microsoft from April 2002 to April 2012.

JetBrains Academy Member
Certified ScrumMaster
My status

Twitter

Flickr

www.flickr.com
This is a Flickr badge showing public photos and videos from Laurent Kempé. Make your own badge here.

Month List

Page List