An amazing technology that allows a user to interact with a computer (including phone, of course) by scratching surfaces. I wonder if such technology can be used record the blackboard content as a teacher writes on it (thus scratching it). This is brilliant, either way.
HCI (Scratch Input)
November 29th, 2008 § 0
MVC pattern and web development
November 29th, 2008 § 0
I came across and incredible piece on MVC and web development:
it should be abundantly clear that the traditional “MVC” is back with a vengeance: the blurred lines between which bits of code are responsible for “Model business logic” validation are gone, and the blurred lines regarding which bits of code are responsible for generation of the “View” are also gone – but not completely. It’s up to the developer to decide how far they want to deviate from the traditional ‘HTML’ style of display / information rendering. Not everybody is comfortable with the use of Widgets that are executed as Javascript to do the job that HTML used to do (even if it’s behind a javascript framework such as mochikit, extjs or prototype), and fortunately, both the GWT and the Pyjamas frameworks do an extremely good job of supporting and interacting with straight HTML (investigate the HTMLPanel widget, for example, for details).
Wouldn’t it be cool to be able to replace Javascript as the only way to manipulate the DOM in browsers. Wouldn’t it be cool if instead of Javascript you could throw Java, python,
pyjamas
November 29th, 2008 § 0
pyjamas is a new way to create web applications. Unlike the traditional method of creating an HTML page, adding CSS to it, spicing things up with javascript, pyjamas has a different way of doing things. You build your HTML page, by using only javascript (expect in this case python which compiles into javascript). This is totally different and something that will take a bit of time to get used to it; seems promising though (assuming that performance doesn’t take a huge hit).
Programming with pyjamas needs a little bit of rethinking about the way that you do Web application development. Primarily, you need to forget virtually everything you’ve ever learned and come to expect Web development to be. The reason for this is very simple: Pyjamas is pure javascript. Although written in python, not javascript, it is essential to bear in mind that virtually 100% of your web application will be javascript – not HTML. The programming style you may be accustomed to for HTML programming involves placing as much HTML into one page as you can stand, and making the minimum number of exceptions and allowances for dynamic content that you can manage, without making the HTML page “too complicated” to be readable.
Pyjamas makes it possible for you to break pages down into concepts. classes. widgets. maybe some CSS styling is added, almost as an afterthought, on top of the “real” functionality. In other words, Pyjamas is actually more like Desktop application development than it is Web development.
That’s pretty exciting and I intend to try it, after I finish my current project.
Oligopolies and innovation
November 21st, 2008 § 0
I always try to cheer for the underdog and therefore am not really a fan of mega corporations, monopoglies, oligopolies, etc. Learning that the Big Three are in trouble I was a little excite. I think, and this is not hard to prove*, that monopolies and oligopolies and such simply kill innovation or slow it down. Here’s Seth’s take on this:
Not only should Congress encourage/facilitate the organized bankruptcy of the Big Three, but it should also make it easy for them to be replaced by 500 new car companies.
Or perhaps a thousand.
That’s how many car companies there were 90 years ago.
That’s right, when all the innovation hit the car industry, there were thousands of car companies, with hundreds running at any one time
* Look at Microsoft’s example. Need I say more?
Is Google SPAMMING me?
November 19th, 2008 § 0
In order to keep track of my thoughts on different things I’m working on, I use Google Notebook. So today wanting to jot down some ideas, I logged into notebook and I was greeted with a new note–one that I haven’t written myself. Sure enough, it was advertising! I was totally appalled by this. Google took the liberty to add an ad as a note. Is this any different than SPAM?
The question we have to ask ourselves as we keep moving our data to the cloud is how much are we losing? Is the gain worth the loss of freedom? Also, what’s next from Google? Are they going to start creating messages SPAM in our Gmail accounts on behalf of advertisers. Are they going to start just SPAMMING?!
I hope my fears are unjustified.
Designed by Apple in California
November 18th, 2008 § 0
As I was thinking of going to bed, I thought I should write a post here, but didn’t know what to talk about, so I closed the lid of my laptop and after it went to sleep, I put it in my backpack to have it ready for tomorrow.
Then I thought, hmm…maybe I should backup my data using Time Machine, it seems really simple and I do have a handy external hard disk. I had read somewhere (or come to think of it, it was an Apple video) that on the first run, it’ll take some time to back-up everything, so I thought I’ll remove the battery and just use AC until the morning. One minor mistake was that I took the battery out before plugging it in. As I plugged it in, I noticed the sleep indicator was not blinking, and then it hit me! I thought I had lost the work I was doing, the programs that were open and just lost track of what I was doing in general. You see, one thing I love about the laptop is that in the middle of any work I can just close the lid, pick it up and then continue later exactly where I left off. It’s brilliant that way, but it needs the battery–or so I thought. So, now I thought I’d lost my reading place, if you will.
I plugged the laptop in, pressed the power button, and …wait, what’s this I see…wait a sec, it’s the Dashboard which I left open with my to-do list! I was ecstatic to see that! It hadn’t lost a thing! Wow! الْحَمْدُ للّهِ (btw, that means Praise be To God in Arabic)! Amazing.
P.S.: You should know that the laptop I’m talking about is my new macbook (exactly a week old) and yup, you guessed it, it was Designed by Apple in California
)
Update:
I forgot to mention what happened with my backup. Nothing, it turns out I need to check what in my external hard disk before I format. We’ll leave that for another day.
Reasons to start your own blog
November 17th, 2008 § 0
MySQLdb-python on OS X (10.5)
November 13th, 2008 § 0
In an effort to setup Django for a project I’m working on (more on that another day), I ran into some issue installing MySQL-python (version 1.2.2). Googling around I found a few discussions regarding it. After fiddling around with it for a while, I managed to get it going.
Here’s how:
(Assuming you have MySQL installed and have the /usr/local/mysql/bin in your path.)
Comment out the following three lines in <MySQL-python location>/_mysql.c, as such:
/*
#ifndef uint
#define uint unsigned int
#endif
*/
Now, run the build and install commands:
python setup.py build
sudo python setup.py install
We can do a quick test:
python
Python 2.5.1 (r251:54863, Jul 23 2008, 11:00:16)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
/Library/Python/2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg/_mysql.pyc, but /Applications/MySQL-python-1.2.2 is being added to sys.path
import sys, pkg_resources, imp
>>> conn = MySQLdb.connect(host = “HOST”, user = “USER”, passwd = “PASS”, db = “DATABASE”)
>>> cursor = conn.cursor()
>>> cursor.execute(“SELECT VERSION()”)
1L
>>> row = cursor.fetchone()
>>> row[0]
’5.0.67′
>>> cursor.close()
>>> conn.close()
Now sure if that warning will have implications later; doesn’t seem like it but you never know.


