Friday, September 02, 2011

Mark All As Read

I am a fan of “Zero Inbox” system. It means that my Outlook, Gmail and Hotmail (each one is used for different purposes) all stand on zero emails in Inbox.

Well, apart from Gmail which is based on search so the emails are just left there to rot.

Zero inbox means less worries for me, less things to remember, better response time for other people and less black pixels on my screen. I am a happy user.

There was something that bothered and nagged me though. Google Reader. I was struggling to get it under 100 unread messages and lost the battle most of the time. I always wondered:

What am I missing there? Maybe the next unread item is the most interesting one? Reader always dragged my attention to it, as there are always more stuff to read and (probably to learn).

Well, not anymore! I’ve seen the future and it is called” Mark All As Read” button

Google Reader - MarkAllAsRead

There is always interesting stuff to read out there. However, the good part is that really interesting pieces will be linked, commented, re-linked and flamed all over the Internet. It is REALLY hard to miss them. Should I worry then that one of the “marked as read” items is a ground-breaking, world-changing, socks-blowing one?

NOPE.

I have a zero unread items in Google Reader now and I am happy.

Monday, August 22, 2011

Taste Matters!

I was listening to the latest “This Developers Life” podcast called Taste and it stroke a chord with me.

I remember arguing whether appearance matters at work with some guy from my previous gigs. His point was that it should not matter, as the most important thing is one’s brain and ideas. Needless to say he looked like a bum.

Ultimately, he is right. Looks probably should not matter. It does not matter in two cases:image

  • email communication. The other guy might be flesh eating alien or even a girl. I don’t care.
  • when your pal says: “This guy is genius! He sleeps in a garbage can, but he is brilliant!”

These two cases, you don’t care how the other person look like, in all other cases, however, you do care. 

While it is correct that well dressed person conveys a message, I think it is more important that sloppily dressed person not only does not transmits the same message, but he conveys a negative message. Being a bum is to tell your colleagues: “I don’t care about you. I can come with my pajamas, uncut fingernails and unwashed, but you STILL will listen to me!”

It is a very negative thing to say to your co-workers…

Monday, August 15, 2011

Civilized Programming Language

Code worked and stopped working after minor changes. All of the sudden a loop is not working anymore.

1 while(cursor != NULL)
2 {
3 printk("mock_config_cache: checking %x\n", cursor);
4 if (mock_compare_cache_devices((mock_cache_device_t*)cursor, new_cdev))
5 {
6 printk("mock_config_cache: Device already exists: %x\n", cursor);
7 status = IOCMD_ERR_DEV_EXISTS;
8 mock_free(new_cdev);
9 break;
10 }
11
12 cursor = cursor->next;
13
14 if (cursor == cache_devices);
15 {
16 break;
17 }
18 }
19





It should be easy, but this is a kernel code, so I’ve spent 1.5 hours to debug this code. Even if it weren’t a kernel code, it is not always easy to attach a debugger and step through the code. I’ve added a loop to print the linked list, which is basically the same code:



1 /* DEB */
2 cursor = cache_devices;
3 while(cursor != NULL)
4 {
5 printk("Cursor: (%x), next: (%x), prev: (%x)\n", cursor, cursor->next, cursor->prev);
6 cursor = cursor->next;
7 if (cursor == cache_devices)
8 break;
9 }
10





The same code, but this one is working!


Another coffee and I see the bug. Line #13 in the first code:


1 if (cursor == cache_devices);


Notice the “;” at the end of the line! DAMN! This is frustrating!



Now, the compiler should have told me something, as the IF statement does not even have a side-effects!



These days I have read an article by Andrei Alexandrescu (C++ template guru) called: “The case for D”, where he praised D language as a better C/C++. Naturally, I wondered if D would do better in the above bug:



1 import std.stdio;
2
3 void main()
4 {
5 writeln("hello world");
6
7 int i=3;
8 if (i == 3);
9 {
10 writeln("another hello");
11 }
12 }





OK. Let’s see:




C:\Users\derbep\Documents\Code\DTest>dmd if_test.d




if_test.d(8): use '{ }' for an empty statement, not a ';'







Much much better! Advance to D! It is better!

Friday, July 22, 2011

Training went bad. Or good.

IMG-20110714-00002

This is a picture of punch-a-sand-bag training session.

It actually felt good during the training and even after, despite discomfort, it feels good to commit to training.

Tuesday, May 24, 2011

Problem on the horizon

Phone rings. It is my friend Mor.

- Hi. We have a new startup thing going on. You have to join!

- What are you doing?

- Can’t tell yet. It is in a stealth mode.

- I have to sign NDA to know?

- Nope. We don’t tell anyone before they start working.

- (pause)… I see. Well, anyway, I’ve got the best job now. We are changing the world.

I forgot it a minute later. Few months later, an email:

“Hi,

We went to University together and I remember you as a good guy. I am founding a storage related startup and you have tons of experience. Why don’t you join us? “

It is flattering and all, but I can’t. I am busy improving the world with DirectAccess.

Alon: “We have a chair with your name on, when are you coming to use it?”

Me: “Thanks man! Not in a near future for sure.”

Then, it is Mor again:

- Hi, we still looking for people and your skills are required. Come talk to our VP of R&D.

- I am not looking, but I can hear the guy out. Chances that I will come are zero.

Then it is a previous company:

- We are growing and you should still remember the stuff. Come, you have a potential.

- I am not looking and I am good at my current place.

Then Mor’s company bites the dust. Then one of my previous bosses leaves the company:

- (Me): where are you going now?

- (Her): I am going to start a new project from scratch.

- (Me): what people are you looking for?

BAM!

Once I said it, I understood that something is wrong. It was me asking for position in another company. The thought actually crossed my mind. It never did before despite long hours, frustrations, disappointments and job offers. Now it did.

The good thing is that I know there is a problem and problems I can fix…

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.