Wednesday, August 4, 2010

Thin clients are sexy

In IT, a thin client is either a machine or a piece of software which is very light to install and configure and depends on an outside server who does all the donkey work.

As users are becoming more lazy, IT folks need to make things easier for them. That's why we shift all the hard dirty computational memory consuming work to a slave server or perhaps a cloud so users can work in a clean comfortable fast thin environment.

Think of a thin client like a fancy restaurant. Customers enjoy the atomosphere and service while the crew inside the restaurant work non stop to satisfy their needs. Customers do not care what's going on there. They request their food items and it get prepared, cooked, decorated and served.


Web is an ocean full of sexy thin clients, the browsers are the software and the servers to which the requests are sent is the fat clients.


Although this might seem to be a great architecture , each architecture must have some hidden flaws.


Tuesday, August 3, 2010

VB.NET Polymorphism Fail



I have been working on a project where I stumpled upon a classic Polymorphism case which .NET marked as a compile error.

To simplify the problem in order to show it to you , I created the following simple UML design .




The method Add in IBirds is overloaded, it can take a IBird to add it to the Birds list or it also can take IBirds object to add all birds to the list.

Iflyable is also an interface that both Duck and Ducks implement, so when I send I cast Duck or Ducks to IFlyable and send it to Add function it should fit right in without problems


Because IFlyable can be either IBird or IBirds it should definitly work in runtime through late binding. However .NET display this Error instead


Error 1 Overload resolution failed because no accessible 'Add' can be called without a narrowing conversion:
'Public Sub Add(birds As IBirds)': Argument matching parameter 'birds' narrows from 'Birds.IFlyable' to 'Birds.IBirds'.
'Public Sub Add(aBird As IBird)': Argument matching parameter 'aBird' narrows from 'Birds.IFlyable' to 'Birds.IBird'. C:\Documents and Settings\ncs\My Documents\Visual Studio 2008\Projects\Birds\Birds\Form1.vb 26 9 Birds







I think it should be displayed as a warning at least so we can evaluate it on runtime.
The weird thing that it works on Debug mode.

To solve the problem I should put an If statement that check the type of the object and cast it to either IBird or IBirds which I don't like. I wrote an article about how to minimize the number of if statements in your code only to add more?

Here is the Source code for those interested.


Monday, August 2, 2010

An Idea: Digital Sharing of NewsPapers

Last year I wrote an article, an idea in fact, called it the NewsTouchPaper. Although I don't find it very difficult to develop yet lots of devices that appeared in year 2009 and 2010 have actually replaced that idea such as Kindle and IPad.

Few weeks back I was in Starbucks sipping my Espresso and reading the newspaper (the classical paper one), a thing most people still do. I found a very interesting article, so I needed to share it on Twitter and Facebook. Of course it will be so easy if I was on a computer or a tablet. Elmohem I had to take a photo of the article upload it and then Tweet.


Here where all the light bulbs start flickering on my head, thought I would share few with you.


1. ReDesign the NewsPaper so each article is accompanied with a Short URL version of the same article (e.g. http://news.bh/abdA) which points to the NewsPaper digital version of the article, this way I can easily type it in my BlackBerry and post it.




2. Another idea is to use the same concept, but instead put a QR Code (This is also a great QR code generator by Michele Smarty http://www.toolsiseek.com/qr-code-generator/) so people with SmartPhones can "Scan" the code and get a URL to the particular digital page or even better get a compressed digital version of the article that can be uncompressed and shared easily.







3. More fun? Make this URLs centralized for all newspapers in Bahrain so people can actually visit the site from the short URL, sign in with their twitter and facebook account and comment.

Even more fun? Create an application that does just that allowing more seamless integration.


No need to spend much, we just need some regulation and a good leadership to achieve this (note I didn't say management)


Sunday, July 11, 2010

Quantum Entanglement: Paul the Octopus explained


If you didn't heard of Paul the Octopus, it’s a Psychic octopus that Germany used for predictions to its World cup games.

So far Paul did a 100% prediction in 6 games.

Here is its prediction for Germany VS Spain in the semi final.

So how did this work?
Paul's first predictions (Ger vs Eng) (Ger vs Ser) and (Ger vs Arg) might have been a mere chance, but not the last one (Ger vs Esp). Quantum Mechanics took care of this one.

After the win of Germany against Argentina 4:0, Paul the Octopus received a huge media boost, through social networks (Facebook, Twitter, YouTube) not to mention the classical Newspapers, and TV.

This media explosion amplified Paul Quantum wave function (the frequency on which the Octopus works) most people now believe in Paul, some for the mere love of their teams, and some even for religious reasons.

All these people sending their approved thoughts and true believe to this creature makes this wave function amplifies exponentially. These thoughts become so sharp, so clear, so thin that increases what physicists called the Energy Density and make those thoughts move to a part of the brain called the Frontal Lobe. At this time, those thoughts, those ideas, those concepts materialize into tangible events. These events cause the predicted team for example to play harder, the other team get tensed, distracted thus make more fouls the other team get more free kicks, and so many random events may occur to support the predicted team. Events that are unleashed from the shared Super String.

Now, some of you will say well, not all people believe in this octopus and I totally agree. Some don't believe and they deny it but deep inside they have this fear of his predictions becoming true. This fear is enough to materilize into a potentional amplifer for Paul Wave function. Some people won't believe Paul at all, but they are few compared to the masses. Which make their wave function nearly neglectable.

This is the new science of Quantum Entanglement, Everything is connected.

Wednesday, June 23, 2010

Firefox 3.6.4 won't crash if your FarmVille froze, too late?

Google Chrome had this by default, the crash protection technique, which is basically the act of isolating each plug-in (like Adobe Flash) in a separate process. So when the plug-in goes into an infinite loop or froze, only that process gets terminated but the Browser will be intact.

Recently Mozilla has released Firefox 3.6.4 which includes this feature and so many other bug fixes.

Firefox has been there for a really long time as a lead browser, only to witness Google Chrome infiltrating its business with its cut-and-dried sexy features. Last thing we know FireFox is mimicking Chrome.

I was a FireFox user and Developer. I just switched to Chrome weeks ago and I tell you as a user Firefox 3.5 to 3.6.3 crashes for 2 times a day on average and while developing it crashes from 10 to 15 times a day.

Now I'm using Chrome, it never crashed and developing a new extension for Chrome was much easier and faster than firefox. For instance I do not need to restart the browser each time I update my script. With Firefox you need to restart the browser, and you have to wait for 3 to 5 seconds so Firefox Process get freed from the memory.

This is good, but with this momentum, I see that lots of FireFox users will defect to Chrome.

Monday, June 14, 2010

Rettiwt V1.0 for Google Chrome


OK. Firefox didn't prove to be as good as Chrome. I'm speaking from a personal usage as a user and as a developer.

Last month I developed a Twitter Extension for FireFox. It took me half the time to redevelop the extension Google Chrome, debugging and testing and recompiling are much easier.




Here is a quick list of the functionality

No Login Required, simply use the Twitter web normally.


1. Classic Retweet with Editing (RT).

2. Automatically parse YouTube videos and embed them into the status itself.
So if one of your following post a link to a YouTube video, the extension automatically fetch that video and display the frame in the status itself. You don't have to do anything.

3. Add all your following into a listbox so you can easily select and reply to them.

4. #FollowFriday Button that appears only on fridays.

5. Reply to All



6. Quick Emoticons


Enjoy


Tuesday, June 8, 2010

dot NET How long will it last?

Recently, I was selling a suite of GIS applications to a client. The suite was built in .NET framework 3.5 on top of ESRI ArcGIS.

After I explained to him the new system functionalities he was convinced of the great effort spent in the system, and then he asked me this question.

"How long will it last?"

"Sorry sir I didn't get you"

"This .NET thing, how long will it last? We built our system just 5 years ago on COM technology, and now you tell me its out-dated and that the .NET technology is much better but not fully compatible with COM. So I have to change my whole system with yours. How long are you expecting the .NET technology to last until something totally 'better' to replace it"He sighed and continue "How long I shall expect to change my system .. again? 5 more years or more?"


So what do you think?

Saturday, June 5, 2010

An Idea: Telecom Package Suggestion Engine

Telecom companies in Bahrain like Batelco, Zain and VIVA have packages for mobile services (postpaid and prepaid). Each package contains some features for a certain given price. Here is the postpaid table from the leading company in Bahrain Batelco.



As customers we choose packages arbitrary based on the total package price thinking we would save more. However, this is not the case. Customer preferences differs from one to another. For example I make a lot of international calls or a lot of calls to a certain local number. But I really might be in the wrong package which eventually costs me more money I could easily save if I was on the right package.

The idea is to design a service that will run through the customers database each 3 months or so and analyse their calls/sms etc and project it on their current package. 

For instance, if the customer is making too many international calls it would be great to send her a report in an email that she will save 200BD yearly if she changed her package from Super10 to Super30 and then you attach the math. Or even better, you can send her an SMS: "Fatima, we noticed that you make so many local calls to this number, if you add it to your favorite numbers' list, according to your billing you will save 69BD yearly. Shall we add it?." Make it easy for her, reply Yes or No.


This way your customer will really know how much you really care. They will stay loyal in the long run and your customer defection will decrease dramatically. Simply because this act is remarkable.


Friday, June 4, 2010

How free Anti-Virus Software make money

Ever wondered how a free AntiVirus software can make money besides advertisement? Well, continue reading.

Imagine you are game manufacturing company. You spent tens of thousand of dollars to develop a computer game. Weeks later a cracker releases a patch to break your computer game so users can illegally play it without license.

What do you do?
You can spend more money making the game uncrackable (and that's difficult)

OR

You pay Anti-Virus software companies (like avast) to add that patch/crack to their database as a trojan-gen (which stands for Trojan general category). Below is a picture of a patch for all Game House games. Avast treats it as a general trojan, although I didn't notice any internet activity from the file.



Now users with these Anti-viruses cannot use the patch to crack your game up. This creeps them out and maybe (just maybe) they will be forced to pay for the game.

Thursday, May 27, 2010

Change Layers Data Source in an MXD document

I have developed this tool only because our engineers needed it badly. It happens that its difficult to change the data source of a certain layer file to a new one. You have to do it one by one.


So this ESRI ArcMap tool help you do just that. Just register it and enjoy.

Download here

Email me should you have any suggestions/Comments/bugs.