Saturday, December 25, 2010

Learning by example

It is time for me to learn ASP.NET and AJAX.

Why ASP.NET? Because it is C# and it works well. Because there is a huge MS behind the technology. Because it works well and it is easy to get started with it (there is a Visual Studio Express). Because it is simple.

So to start I went to http://asp.net and started looking at the tutorials. It definitely helps, but you cannot learn programming by reading a book (or a web site). So I fired up VS and created an ASP.NET project.

The first question is whether to use MVC or WebForms:

image

Since I do believe Scott Hanselman and I am a freak of lower-level and finer control it is MVC for me.

The first steps feel fine, the integration with VS is great: there are actually “Create a view/model/controller” there! However, the problem began when I try to play with AJAX a little bit.

I have started with this tutorial and immediately ran into a problem: what should my partial page to inherit from? No matter what I have tried to do: either “compilation error” or the page “does not implement method” error.
In better cases, I get “unhandled exception”.

In the end, it turned out that when you want to use

Html.RenderPartial("ListContentView", Model);



Your “ListContentView” should be a partial view and not a regular view:



image



Otherwise, life is not good Sad smile

Sunday, November 07, 2010

Rewrite is pending

Recent new form PDC had nearly caused me a heart attack: MS drops Silverlight for web and bets on HTML5.

Few months ago when I was choosing a platform to write my app, Silverlight looked good:

  • C# and .Net
  • Easy to develop and debug.
  • MS is backing it up, meaning that it will be widely used.
  • Can be detached from the browser and made into a standalone application.

Even worse, detachable feature pushed me to develop a thick client to save the round trips to the server and improve performance.

 

Few months later, it does not look like a great idea anymore. Not only I have to re-write the app in HTML5/JavaScript, but I also have to re-architecture it to make it more decoupled. On the bright side, I plan to make it a learning experience and also to document the process in my blog to practice a discipline of posting and writing.

Wednesday, September 15, 2010

Getting back

I have not worked on my project for months. :(

Now, I am back. At the high point of release frenzy, but still I have an itch to scratch.

It feels good to be back…

Thursday, June 17, 2010

Why have I got Kindle DX

Few days ago I have received a Kindle DX. For a long time i thought about buying one and finally I did it. Say Hello to Kindle DX with Global WirelessIt was clear to me that I’m getting DX because of the screen size. The regular Kindle narrow lines looks annoying.

AFTER I’ve got it, I started to think why did I buy it? Will I start to read all my books on Kindle? No. First of all, I like the feeling of a real book better. Second, some of the books are unavailable on Kindle, especially books in Russian and Hebrew that I read.

BTW, Kindle DX does not support Unicode. Read and weep. It is only 2010. Amazon still are not aware that there are other languages than English.

Anyway, if I’m not dropping books, then why to get Kindle? It was clear to me that I need one, but why?

First reason I thought of, is that I have a bunch of PDF’s and DOCS that I want to read. Currently the only options are:

  1. Print the document. Not good as it wastes lots of paper and it is not convenient to walk around with a bunch of pages. In addition, next page always gets lost.
  2. Read on computer. This means that I have to sit in front of computer and read the document. What do you mean I can’t read lying on a sofa at salon?
  3. Read on a laptop. It solves the mobility issue, but raises few more:
    1. It is not as easy to read from  laptop screen as from e-ink or book.
    2. It takes a long time (relatively) to get into a reading mode.
    3. Battery life is limited.
    4. The laptop gets hot and heavy.
    5. It has to be open to read from it and takes space.

I’ve checked and the results were as predicted: I did not read books in PDF and DOC format apart from a very rare exceptions. I hope that with Kindle DX it will change.

Another reason is very simple one. To get a book from Amazon takes about 6-8 weeks using sane delivery method and costs about 30$. This means that it is a huge waste of time and money to get a single book from Amazon. On the other hand, getting a bunch of books is a considerable amount of money.

Taken together, I rarely order books from Amazon and when I do, I do it in batches. Now I have Kindle. I can get a book within minutes, without additional payment and cheaper than the printed edition. I have a feeling that Amazon is about to get much larger part of my income.

“I think this is a beginning of a beautiful friendship …”

Wednesday, April 14, 2010

How good is 96% test coverage?

It is 10th annual ribosome convention. Best ribosomes from all over the world in the same place. Taken away from their duties and day-to-day business to focus on one and only thing:

Why THE HELL we do not get what was specified after gene translation???

It seems that the final quality of the product is pretty bad. The final thing apears to be a little "hairy". Instead of getting something like this:

 angelinajolie_face

We keep on getting stuff like this:

chimp-face-cu-16470022

Now the difference is striking, even though, a total average of hair lenght is the same.

On a previous, 9th, congress, one of the seniors ribosomes suggested translation coverage tests before RNA is translated into protein. If the RNA does not pass the test, the protein is not produced. Arbitrarely, the bar was set to 51%, which is the minimal majority. Other candidates: 7, 13, 21 (black jack) 69, did not make it.

This means that RNA tha arrives to ribosome have to be checked for at least 51% of its rate BEFORE the translation is done.

It is plausable to think that 51% coverage will enable us to tell between "desired" and "acquired". "We need more quality!", thought ribosomes.

However, one year later things look much less optimistic. Ribosomes has come to a sad realization - 51% is not enough. RNA coverage did not help!!! Shimps keep on being produced. Moreover, some crazy ribos reached as high as 85% covrage, but still received:

chimp-face-cu-16470022 

Ribosomes are stuck. Discussions continued until a talk given by some academic-somes. Apparently the above two spieces share 96% of DNA code!!!!

Now this must be wrong. The differences are too large!!!

How can it be????

The answer is simple: there is a huuuuuuuge difference between micro and macro. On a micro level the difference is almost not-recognizable: 4%. It cannot be caught and mapped out by 51% RNA coverage.

On a macro level the difference is huge. Not because the micro parts are different, but because they interact differently one with another.

This means that RNA-level testing and coverage have a very limited payoff. The path to a better final product goes thought a better understanding of the global scope and how things work, much more than in lower testing.

This knowledge is hard to measure and does not seem to bring benefits right away. However, until then we get it - same same, but different...

Tuesday, March 16, 2010

Mercurial on Windows

I’ve downloaded version 1.5 of Mercurial for windows. Install was seamless and now I’ve got a command line to play with.

Lucky me, the setup has added “hg” to the path. I hate it when it does not do that. Since I already have a project this is what I’ve done:

> hg help

Help screen with many options.

> cd TestProject
> hg init
> hg status | less
'less' is not recognized as an internal or external command,
operable program or batch file.
> hg status | more
<A list of files all marked with “
?” at the beginning>
> hg add *
> hg status | more

Now all files are marked as added.

> hg commit
<Write  a comment>
> hg status | more
Empty line.

I notice that there is some not related directory:

> hg remove BrowserTest
> hg commit
Write a comment.

Now there is some weird zap file in my working directory. I wonder what it is…

To Be Continued …

[Edited]
The best part is that your entire repository for a given project is located in “.hg” directory!!!!

Tuesday, January 26, 2010

Communication out

I wanted to write on this topic for a long time, but recent piece by Joel Spolsky has made me do this.

Joel talks about having less conversation in a project and communicate less during software project. The point is logical: the more people involved in decision making, the more time it takes to reach a decision and the less chances of success the project has. Proposed solution is logical as well: limit communication. Do not tell everyone what you are doing and ask their opinion. Decide in small numbers.

I am all for small numbers. Let me decide my own fate. There is one small correction though…

There is a difference between duplex and half-duplex communication. Computer networking distinguishes between those two, however, in a day to day life we tend to forget about half-duplex communication as full duplex is a default:

  • Face to face conversation is full duplex.
  • Phone is full duplex.
  • IM/email is full duplex. This one is not trivial, but the information flows both ways.
  • Even web blog/twitter/facebook, that once was half-duplex now is full duplex, as everyone can leave comments.

We are so used with full duplex communication that there is a tendency to think of it as the only type. How it is related to software projects?

I had virtually joined another team during last project. This team held daily sync as the deadline approached and it appears that I misunderstood the purpose of those meetings. I thought that the meetings are there to sync team members regarding their doings, plans, what they did and etc. However, the moment I said: “I am working on a problem A”, the immediate reaction was: "Why don’t you try this”, “You should do that”, “Try to turn this flag on” and etc.

I wasn’t asking for help or directions! I was telling my status so they would know.

This the major difference between full duplex and half-duplex communication. It is good and desired to communicate out your status, plans, what you did, why you are doing this and that. However, this communication is half-duplex. You are not interested in other’s opinions, unless of course you are going full speed into abyss. People have to understand that their opinions are not required, however, they do need to know what their peers have been up to. This knowledge is essential both to prevent duplicate work and to provide a bigger picture.

Communicate out. Do not ask permissions.

Saturday, January 16, 2010

System Thinking – 2

Recently I’ve got an email from one of my managers saying: “If the team will solve K bugs this week, I will make you a breakfast”. It can be food, it can be money or it can be sex. Does not matter. The idea is: you work hard and do something that is not possible otherwise and you will get a reward.

This is a good case to apply system thinking! 

Managers sometimes think, and my guess is that this manager in particular, that the dynamics looks like this:

systemthinking_motivation_simple

Meaning that raising reward/incentive will increase the amount of hard work that people are putting.

There is a number of problems with this approach, for example: it assumes that people aren’t working hard enough already. However, I will concentrate on the connection between reward and hard work.

On a basis of my observations, this method does not work. At least it didn’t in this particular case. It does sounds logic, so why it does not work?

More people-aware managers find out that the connection between award and hard-work is not direct, but rather looks more like this:

systemthinking_motivation_middle

Meaning that if the motivation is low, increasing reward will not really increase the amount of hard work. Reward will influence motivation, which in turn will influence hard work.

This view is much more realistic and sometimes appears to work. It does even shows a basic problem with this approach: there is a connection between reward and hard-work and it will go into both directions. Once reward is gone, the hard-work is gone as well.

Even though the above view works from time to time, it is still simplified. One sigh of the simplification is that:

  • There are people that do not work for reward/incentive. At least not for material.
  • It works temporary. At some point people will not work hard even if reward is substantial.

The above two observations together mean that there is another relation that is not covered by the above view.

Closer to reality view looks something like this:

systemthinking_motivation_full

Notice that there is a motivation->hard-work->pride force-feeding loop. Meaning that people with motivation will work harder, will take pride in their work, which will motivate them again.

The inner loop is the one targeted most of the time. This is also the one that is the easiest to target. However, notice that the larger the “greed” the lower the motivation. This means that increasing the reward will increase the “greed”, but decrease motivation. Sometimes it will work, but sometimes the reward will be increased, but this will decrease the motivation in such way that people will not work harder. This will happen when there is no trust between developers and management.

What happened to that manager? He got promoted.