Wednesday, July 01, 2009

Google Mail messages drag and drop to labels

Today , Google added a new feature to Gmail , which is, you can drag and drop messages to the lables, its a bit of AJAX, Javascript goodie, i liked it alot, however i struggled alittle bit till i figured out where i should click and drag, then drop !!

In case you struggled about this like me here is an image of what you should be clicking , dragging, then dropping.

Thursday, June 25, 2009

HubSpot Engineers Finally Spitting Their Tech Thoughts Out

Today at HubSpot we launched our engineering blog , most IT companies if not all, have their own engineering blog that is different from company main blog which is a product related blog.
Engineering blog is a technical blog where software engineers shares their technical thoughts, ideas, tips and all the goodies about software development.

This practice ( having an engineering blog ) is very rewarding in both short term and long term.

In short term, its a way to share knowledge with not only engineering stuff, but with every one else, getting comments and feedback on whatever engineers are blogging about will indeed expand that knowledge.

In long term, the company product will get a good reputation and trust because engineers developing that product know what they are doing, as their engineering blog tells.

The really good thing about HubSpot Engineering blog is that it won't be specific to any software development area, we have a very talented team at HubSpot, we have experts in .NET,JAVA,Python,Linux,MySQL,JavaScript, the skills list is pretty long, so expect a post at anything , and of course it will be a useful post.









Wednesday, June 24, 2009

LINQ 101 Samples

I came accross this very very usfel set of LINQ basic examples , im keep here for reference.

Saturday, June 13, 2009

And now i have my facebook URL

Last night facebook opened up vanity URLs to the public , it was a long waited feature , too bad i couldn't get the "faramawi" URL, but i got another one, it doesn't sound that bad after all, and still a "faramawi".

Wednesday, June 10, 2009

You are not alone , I'm coding here with you!!

I don't know if someone recalls that Michael Jackson song "You are not alone" , the following part says "I'm here for you".

So what this have to do with programming..., well when you find your self working at code written with the minimum ever care , you will find your self singing "You are not alone , I'm coding here with you" and wishing that persons who wrote the code are listening and start writing their code with the idea that someone else will come later and try to enhance, modify that code.

I believe in this,the time spent in reviewing or investgating code can be cut off by 75% , if the code is:

1- Commented properly.

No one really like writing comments , its boring and consumes time speically when you are thrilled enough and ideas are born in your brian and code flowing out of your fingers, you won't waste your time typing what a class field is for , or what a method is really doing .

But this is not an execuze to avoid them , comments can saves alot of time when fixing ,reviewing code ,it saves person-to-person communication, it saves time spent digging into thousands line of code to understand what a class field means or doing.

2- Well structured.

Writing code is an Art , anyone can write code , but few persons can write pretty code that you enjoy reading it, and in turn will easily know how to fix it , without spending time flying between files, classes, methods.

3- Classes,methods,variables are problem domain specific.

When you face a problem at any thing in your daily life , for example you need to sort your book library , internally in your brain what terms you will be using when descrbing the solution to the problem you have? ideal you will use terms like "book, library, index,sort",
Why these terms why notthing else? Because these terms are from your problem domain.
And this is how code gets written.

A nice expirment to do is, get some bugged code in 2 versions, crappy version and well written version, and give each of these version to 2 different codes, and ask them to fix it, and watch the time taken by both.If someone will try this i would be happy to post their results here.












Monday, June 08, 2009

Responsive Desgin

After 3 days of struggling i finally got to watch Kent Beck great peresentation on what he calls "Responsive Design"

It worth watching, and i can say it changed how do i look at the code im writing , some remarkable notes from that presentation that got stuck in my mind :
1- Design is benficialy relating elements.
2- A good software design is the one that gives you the steady flow of features.
3- A design can be sevral rights , or can be a bunch of wrongs.
4- Responsive design 4 stratgies : Leap, Parallel, Stepping Stone, Simplification.

FYI , Kent Beck is the person who invented Extrem Programming (XP).

One Million And Counting !!

When i joined the software career, it never passed my mind that i would help on building a software piece that get used by so many people like 1 milion , well i had the dream of making something that get used by thousands but the number 1 million seemed to be a little high for me.

But it happened !! Website Grader the most famous free SEO tool on the internet by HubSpot (my current employer) just reach the 1 million websites submitted to it by users mileston.

One milion persons browsed to website.grader.com , put in their websites URLs and asked for their SEO grade.

I would never know one million persons, and it will never happen that one million person will know me ( unless i drop off the software career and became an entertainer, yet i might be knowen by two or maybe just one person).

Its really a good feeling , and im very thankful for HubSpot for giving me the chance that led me to this huge achievement.

Monday, May 11, 2009

Handeling french characters when sending emails in java

I had an annoying bug for a while that i couldn't find a fix for it.. till today (seems luck is on my side today got some really really good news).

So the problem is like this, i have some java code that sends an email , this code runs as a corn job.

If the email subject contains something like this "Mères et Cie" , when the mail is sent, it 
get recieved as this "?ANSI_X3.4-1968?Q?Lead_visiting_the_website!_R?= =?ANSI_X3.4-1968?Q?andy_Belham_from_M=3Fres_et_Cie?=

Strange enough, that this doesn't happen at my local machine , and the subject is sent fine (or at least is rendered fine on my mail client , which is gmail.com at this case).

I tried explictly encode the subject text using "UTF-8" , but this made the subject to be sent as "M?eres et Cie" which is not what im looking for.

I gave up on this for a while, but today i came back to it , after googling around for what is going on here is what i found , when mails are sent by Java, the JVM only allow headers to have US-ASCII characters, and since email subject is part of the email header in the SMTP(Simple Mail Transfare Protocol) , the subject line we are trying to send "Mères et Cie" is in an invalid format from JVM point of view, so it tries to convert it to the format that it allows depending on the machine local format .
This explains why things worked fine on my machine , but doesn't worked fine for the code when it run as cron job, because the cron job JVM settings wasn't set properly ( i'm not quiet sure about this info but here is the post i found it at).

To solve this problem , java provides a cool utility method, that convert text into a unverisal format that is accepted as an email header, and accepted by email clients called " Transimission Format ", this method is MimeUtility.encodeText().

Passing to this method the subject line we have "Mères et Cie", it outputs it as 
"=?Cp1252?Q?Lead_visiting_the_website!_Randy_Bellahm_from_M=E8res_et_Cie?=" 

Try pasting this sting as its in the subject line of an email , and see how you will recieve the email, the subject will be "Mères et Cie" !!

Cool tip , isn't it ?