Einstein's theories explained in 5 minutes: (special) relativity

by Tom 14. January 2010 15:36

Introduction

In the past I have noticed a lot of people talk about (special) relativity and other physics theories, but when you ask them a few questions, they do not seem to grasp the concept....

In this series of blog posts I will try to explain you some of his concepts the way I understand them...

The inspiration for this series has been one of Einstein's quotes :

"Make everything as simple as possible, but not simpler"

I am no physicist by any means, nor a good mathematician, so you should never ask me any questions about the proof or maths about something, since I simply do not know. If you ask most people about these theories they usually start making it way too complicated for one of the two following reasons :

  • They do not understand it, so they try to blow you away with complicated things they heard about it, so you would stop asking questions about it...
  • They do understand it, but their explanation assumes you know the "language of physicists" - which you do not - so it seems like they are talking Jibberish all the way...

We will start with a very popular concept : the theory of special relativity.

More...

Tags: ,

News | Science | Tom's blog

Tab/Akkoorden en songtekst van "Zottegem Blues" (Miele, 1974)

by Tom 5. January 2010 12:57

Omdat ik dit wel een goed nummertje vind, en ik nergens de akkoorden en de songtekst vond, heb ik hem even zelf getabbed:

Dit is de link op youtube: http://www.youtube.com/watch?v=0ufXnKAsJC0

More...

Tags:

Tom's blog

2009 retrospective: .Net technologies and lessons learned

by Tom 2. January 2010 03:02

my pride & joy

Introduction

 

In December 2008 I was doing my job as a freelance technical analyst for a big company. While it was a very interesting job in several ways, I felt that a burn-out was coming up. I had no idea whether this was due to the job, or due to my personal merits ( a newborn and a one-year old son, lots of tasks and chores on my to-do list for our house, a busy social life, ...) Instead of waiting for the man with the hammer, I decided to be proactive about it, so I decided to quit the job and reinvent myself during 2009.

It has been both an interesting, very challenging and enriching year for me, with both high peaks and low valleys.

I decided to write this blog post in order to evaluate myself, and I am hoping that other people might find some inspiration in this as well.

 

 

 

 

 

More...

Civilian's manifest against a ridiculous tax : we now need to pay extra taxes on usb-sticks/external hard discs because we MIGHT copy music/video on it

by Tom 30. December 2009 03:34

Introduction : "Oh my God"

The Belgian government managed to do it again; starting from February we have to pay taxes on portable storage, because we MIGHT copy some music on it.

This is utter failure in the biggest possible way; I can accept that our dear Minister Q. has had some really strange track records, but this is really his 'best' realisation ever !!!

As you might or might not know, similar to other countries, we already have to pay a certain amount of taxes for blank DVD's/CD's. In my personal opinion this was really ridiculous, but since I use about 1 CD/DVD per month, I never really bothered...

I assume that people probably stopped buying DVD's/CD's, and as a compensation our government needed to find an alternative. And now they found it !!

Here is an English (google translated) excerpt from an article on tweakers.net about it :

Thus, as from February 1 for an iPod Touch with 64GB of flash storage paid 3 euros extra. A set-top box with a 500GB hard drive is responsible for 10.75 euros, while an external hard drive 1TB or larger to yield 9 Euro. 
Also, a distinction is made between different types of storage devices with the same: an MP3 player with 16GB flash memory has a Auvibel fee of 3 Euro, while a USB stick with an identical capacity to 1.35 Euro copying levy to be paid.

More...

Tags: ,

News | Tom's blog

Howto+why using a prototype & bdd for a project estimate + personal rant

by Tom 22. December 2009 13:57

Introduction

As you might or might not now, estimating the budget for a project can be very hard sometimes. In order to get started on a project we first need a real estimate of what the client will need, and the client should know what I am going to deliver to him/her.
What I personally learned from the past is that one can never be fine-grained enough, since there will always be mismatches somewhere.

We can however try to offer the client something that he/she can both understand and work with, next to a description of what everything should do (from a business point of view).

How can we do this, while investing as little work as possible ?

 

Unfortunately one can not correctly estimate projects without doing some work

As straightforward as this might seem, most people do not seem to be able to grasp this ( do not be ashamed; I have been guilty as well ).

In order to give a correct estimate, you have to INVEST a decent amount of TIME.

More...

Tags: , , , , ,

CodeProject | Development | Howto | News | Tom's blog

The Quest for the perfect ASP.Net MVC code : v0.3

by Tom 7. December 2009 20:26

You can download the full source here using (msys)git:
     http://github.com/ToJans/MVCExtensions


// The quest for perfect asp.net MVC code - v0.3
//
// For a while I have been looking for the perfect ASP.Net MVC code.
// This is the cleanest code I have been able to write.
// I would like to challenge everyone to do better !!!
//
// By this I mean creating a better controller/views if possible codewise.
// The focus is not on the layout stuff, but having it might be a plus.
//
// The scope : a very rudimentary Task list (KISS)
//
// You can download the full source here using (msys)git:
//     http://github.com/ToJans/MVCExtensions
//
// You will see it is very easy to alter, just fetch it with git and press F5
//
// Please do let me know what you think about my approach as well,
// and whether you could do better: ToJans@twitter
// Send this link to as much fellow coders as possible, so we can see lots of alternatives
//
// PS: you can also leave a comment @ my website (look at my twitter account for the url)
//
// Edit: this is my third version, and I am still looking for improvements
//
// Some noteworthy facts :
// - In the MVCapp, there only DLL directly referenced is the ViewModel DLL,
//   so the views do NOT reference the controllers anywhere
// - The controller contains only logic & domain model objects => VERY CLEAN Controller
// - The resulting controller action model is mapped to the ViewModel using
//   IMapper.Map<source,ViewModel>(s,vm)
// - The viewmodel should include everything that should be visible on the screen, so not only
//   data but also the actionlinks one can use
// - The actionlinks for the viewpages are defined in the IMapper, and automaticly passed on to
//   the view => you can see/alter the program flow in the mapping definitions
// - Stubbing the controller should be a piece of cake using this code, so you could use this
//   design to easily develop application mockups that are ready to be implemented once the client
//   approves, so first build your viewmodels and views, show it to the client, and upon agreement
//   start development on the controller.... In fact I am going to test this method on my next project
//
// Kind regards,
// Tom Janssens

More...

Tags: , , ,

CodeProject | Development | News | Tom's blog

The Quest for the perfect ASP.Net MVC code : Let the games begin

by Tom 3. December 2009 19:41

Edit:

Please note that the source has changed a lot lately, and that I now use a proper viewmodel instead of domain objects, so all hardlinked references to the domain objects & controllers in the MVC project have disappeared. This also automaticly made my ugly domain object extension methods to get the controller action links completely redundant.

You can see the latest version on github.

The next thing to do is split up the mapping bit using a proper mapping tool (f.e. AutoMapper).

Edit 2:

New article here : The Quest for the perfect ASP.Net MVC code : v0.3

// For a while I have been looking for the perfect ASP.Net MVC code.
// This is the cleanest code I have been able to write.
// I would like to challenge everyone to do better !!!
//
// By this I mean creating a better controller/views if possible codewise.
// The focus is not on the layout stuff, but having it might be a plus.
//
// The scope : a very rudimentary Task list (KISS)
//
// Some more info about my approach :
// It uses view models which contain both data and ActionLink references
// (like ICommand in WPF M-V-VM )
//
// You can download the full source here :
//     http://github.com/ToJans/MVCExtensions/tree/master/src/
//
// You will see it is very easy to alter, just download it and press F5
//
// Please do let me know what you think about my approach as well,
// and whether you could do better: ToJans@twitter
// Send this link to as much fellow coders as possible, so we can see lots of alternatives
//
// PS: you can also leave a comment @ my website (look at my twitter account)
//

// --------------------------------------------------------------------------------
// Controller :
// --------------------------------------------------------------------------------
namespace Tasks.Core.Controllers
{
    public class TaskController : Controller
    {
        // for the sake of the demo we do not use DI
        // but just a static class instance here with a fake repo
        static IRepository<Task> rTask = rTask ?? new FakeRepository<Task>(null);

        public ActionResult Index()
        {
            return View(new VMIndex()
            {
                AllTasks = rTask.Find.OrderBy(o => o.Name),
                AL_AddTask = this.ActionLink("Add new task",c=>c.AddNewTask(null,null))
            });
        }

        public ActionResult AddNewTask(string name,string description)
        {
            var t = new Task() { Description = description, Name = name };
            rTask.SaveOrUpdate(t);
            return this.RedirectToAction(c => c.Index());
        }

        public ActionResult Done(int id)
        {
            var t = rTask.GetById(id);
            t.Done = !t.Done;
            rTask.SaveOrUpdate(t);
            return this.RedirectToAction(c=>c.Index());
        }

        public ActionResult Edit(int id)
        {
            var t = rTask.GetById(id);
            return View(new VMEdit()
            {
                 Name = t.Name,
                 Description = t.Description,
                 AL_PostEdit = this.ActionLink("Save changes",c=>c.PostEdit(t.Id,null,null)),
                 AL_CancelEdit = this.ActionLink("Cancel changes",c=>c.Index())
            });
        }

        public ActionResult PostEdit(int id,string name,string description)
        {
            var t = rTask.GetById(id);
            t.Name = name;
            t.Description = description;
            rTask.SaveOrUpdate(t);
            return this.RedirectToAction(c => c.Index());
        }

        public ActionResult Delete(int id)
        {
            rTask.Delete(rTask.GetById(id));
            return this.RedirectToAction(c => c.Index());
        }
    }
}

// --------------------------------------------------------------------------------
// Index.Spark
// --------------------------------------------------------------------------------
<viewdata model="Tasks.Core.ViewModel.Tasks.VMIndex" />
<content name="Title">
    Index
</content>

<content name="Main">
<h1>Task list</h1>
<if condition="Model.AllTasks.Count()==0">
    No tasks yet.
</if>
<else>
  <table>
    <tr>
      <td>Name</td>
      <td>Name</td>
      <td>Status</td>
      <td>Edit</td>
      <td>Delete</td>
    </tr>
    <tr each="var t in Model.AllTasks">
        <td>${t.Name}</td>
        <td>${t.Description}</td>
        <td><alink a="t.AL_Status()" /></td>
        <td><alink a="t.AL_Edit()" /> </td>
        <td><alink a="t.AL_Delete()" /> </td>
    </tr>
  </table>
</else>
<hr />
<h3>Add a new task</h3>
    <aform a="Model.AL_AddTask">
      <label for="Name">Name :</label><br />
      <input type="text" name="Name" /><br />
      <label for="Description">Description:</label><br />
      <textarea cols="20" rows="2" name="Description" ></textarea><br />
    </aform>
</content>

// --------------------------------------------------------------------------------
// Edit.Spark
// --------------------------------------------------------------------------------
<viewdata model="Tasks.Core.ViewModel.Tasks.VMEdit" />

<content name="Title">
    Edit
</content>
<content name="Main">
        <h3>Edit this task</h3>
        <aform a="Model.AL_PostEdit">
            <label for="Name">Name :</label><br/>
            <input type="text" value="${Model.Name}" name="Name" /><br/>
            <label for="Description">Description:</label><br/>
            <textarea cols="20" rows="2" name="Description" >${Model.Description}</textarea><br />
        </aform>
        <alink a="Model.AL_CancelEdit" />
</content>

 

 

Bookmark and Share

Tags: , , ,

CodeProject | Development | News | Tom's blog

Rant : Your abomination is my clever hack

by Tom 2. December 2009 03:55

When I read the article from OdeToCode about the abuse of a programming language to create shortcuts, I felt the need to respond.

What is it about ?

Simply stated, it is about using some clever tricks to make it easier for the developer to reach his goal. The example was a stackoverflow post : Abuse of C# lambda expressions or Syntax brilliance?

Which discusses code that looks like this :

.Attributes(style => "width:100%")

What is the issue here ?

The issue was that the reaction of the c# language designers. They said it was unacceptable to use such a shortcut, since it was not originally intended in the language design. According to them, one should never use such a construct. I firmly disagree...

Why should one be allowed to abuse a development language ?

Simply stated : because you can. Every single thing that can help a developer to make cleaner/safer/better code (in his/her opinion) should be allowed. Why do we develop most of our applications in c#/java/ruby/PHP and not in assembly ? Because using these languages is considered cleaner/safer/better then using assembly. So while the original language designers might not like the idea, the hacks provide an extra cleaner/safer/better way to address a certain implementation subdomain. After all, the language is there as an intermediate between the developer and the hardware, and anything that allows better communication between the developer and the hardware, should be considered a plus... Which brings us to our next point of attention.

Who is saying that the approach you use here is cleaner/safer/better ?

Actually : nobody. That is something that you need to find out yourself. While some people might like to use the shown constuct, others might like the more verbose way of expressing things. Most of the time, these shortcuts are there as an alternative to the "common" way to do something. In most cases, the fact whether you like or dislike something is based on your background/knowledge/reference frame .
The fact that the alternative was built means that somebody had the intention of providing a better/safer/cleaner way of doing something. Whether you agree or disagree with this person is completely up to you... (Although I must admit that I certainly agree with this person). If you look at the dynamicobject feature (another heavy point of discussion), then you might see that this actually does something simular as the shortcut used here, so the language development team is actually doing the same.

Please note that it does not stop here; some people found the original c#/vb.net language to constraining, so they developed their own, including a manifest.

So, to conclude, if you think you can make your own life easier by using certain 'abusive' constructs : please do !!!

Bookmark and Share

Tags: , ,

CodeProject | Development | News | Tom's blog

M-V-VM in Asp.Net MVC : removing dependencies between asp.Net views and controller actions

by Tom 30. November 2009 06:32

Since the early days I have always been a fan of the ASP.net MVC framework, although I had one really big issue with it : the coupling of the controller actions in the view pages. This part was a real annoyance, since all the flow and logic was included in the controller, and none of it in the views, _except_ the action flow; this was included in the views by using Html.ActionLink.

This has always been a nuisance for me, so last week, as I was working on a project, I decided to fix this issue...

IMHO the possible proceeding controller actions in the program flow should be defined in the controller action, and not in the view. So how could we do this, while still making it maintainable and easy to follow ?

After considering a few alternative routes, and thinking about it event more, it suddenly hit me; why not represent the possible routes as data.

A few development cycles later I had the following code in the controller:


public ActionResult Index()
{
     ViewData.Model = new VMIndex()
     {
         AllTasks = rTask.Find.OrderBy(o => o.Name),
         AL_AddTask = this.ActionLink("Add new task",c=>c.AddNewTask(null,null))
     };
     return View();
}

And this code in the view :


<h1>Task list</h1>
<%= Html.Grid(Model.AllTasks)
        .Columns(c=> {
            c.For(t => t.Name);
            c.For(t => t.Description);
            c.For(t => Html.ActionLink(t.AL_Status())).Named("Status").DoNotEncode();
            c.For(t => Html.ActionLink(t.AL_Edit())).Named("Edit").DoNotEncode();
            c.For(t => Html.ActionLink(t.AL_Delete())).Named("Delete").DoNotEncode();
        }).Empty("No tasks yet")
%>
<hr />
<h3>Add a new task</h3>
<% using (Html.BeginForm(Model.AL_AddTask)) { %>
    Name<br />
    <%=Html.TextBox("Name") %><br />
    Description<br />
    <%=Html.TextArea("Description") %><br />
    <%=Html.SubmitButton(Model.AL_AddTask) %><br />
<% }%>

Which looks rather nice in my opinion. Since I do not know whether I am the first person who thinks about this or not, I decided to publish the sourcecode together with an example on github.

The technical implementation is actually quite simple; I implement the Model-View-Viewmodel pattern, which is used in WPF, using a simple wrapper class for the action links (i.e. commands in MVVM). Once I made that link, the rest was childs play.

Next to this I also created some helper extensions, to make the code a little easier on the eyes.

I also think that by using this pattern we should be able to implement a winforms/WPF app using the same controller. Anybody who is willing to send me a git patch of a WPF application using this controller: please do !!!

PS: This also makes the actionlinks testable in an easy way; another responsibility that has been taken away from the view !!!

Bookmark and Share

Tags: , , , , ,

CodeProject | Development | News | Tom's blog

Aubergine (BDD for .Net) source code available on github

by Tom 20. November 2009 11:01

Hi there....

After a few weeks of working on Aubergine (BDD for .Net) I have decided to release the sourcecode for this tool out in the open.

Please do give me some time as I am quite new to this whole community thing. Hints are welcome !

You can find the source on github : http://github.com/ToJans/Aubergine

And the download here: http://github.com/ToJans/Aubergine/downloads

Enjoy !!!

 

 

Bookmark and Share

Tags: , , , , ,

CodeProject | Development | News | Tom's blog

About me

Tom Janssens op LinkedIn

Tom Janssens op twitter

Core bvba RSS

My name is Tom Janssens and I am the owner of Core bvba, a software and consultancy company.
I am married to Liesbeth and have 2 sons named Quinten and Matisse.
ICT is both my job and passion.
Next to this my other hobby is actively playing music (mostly guitar).

More info about me and my company...

Recent Comments