Feed on
Posts
Comments

Yesterday, while walking from launch, my freind Amnon David (the creator of jNext) told me that IE8 doesn’t work on hotmail.com.

Since IE8 release gained lots of credit by JavaScript Hackers (John Resig and many more), therefore, I couldn’t believe it until I saw it in my own eyes.

Plain and simple, the site is broken. Icons, texts, menus are overlapping each other.

Everyone can see now that every piece of DHTML code must be written twice, once for all the browsers, and then specifically for IE.

The unbearable lightness of releasing buggy software at MS is shocking.

The results are deployed here in front of your eyes.

IE8 default mode Ie8

IE 8 emulating IE7

Emulated IE7

Firefox 3 Beta 3

firefox3-beta

Comparing to Microsoft aggressiveness,  I was wondering whether Apple is just passive aggressive?

Both  companies are making money selling proprietary, closed-source software (and hardware) . Perhaps Apple just dose it more gently with a wider smile on the face. That is all.

Even getting a legal copy of OS x runs on a virtual machine is almost impossible.

For now, I will stick with Dell which runs Linux smoothly.

Microsoft interoperability announcement is a significant switch and a remarkable milestone onto the way to make the world of software an open, standardized  and perhaps free as well. Especially regarding the IE8 default behavior.

Read more at:

I have said in the past that IE would eventually become an open source browser and so it would. I believe  that by the year of 2013 .NET, IE and perhaps more products from Microsoft would be become open source projects.

There is no other way to keep your top rank in any business  than being the best, by all means. Ever since the world of software have realized the the best way to write a software if the open-source way, Microsoft would have to join this principles in order to survive. The fact that more and more developers are switching to free and open-source tools, languages and platforms and barely the vice versa is the only fact that counts in the long run.

If you just installed firefox 3 beta 3 on ubuntu (sudo apt-get install firefox-3.0), you may came across this issue where all elements are huge (toolbars, text, icons, etc.)

In order to fix it at address line go to about:config (and promise to be careful ;-)) and set layout.css.dpi to 96.

Step 1: PostgreSQL (8.2)

Installing postgresql (8.2)

sudo apt-get install postgresql-8.2

Setting up the password for postgres’ postgres user

sudo -u postgres psql template1
ALTER USER postgres WITH PASSWORD 'your-password';
\q

Configure postgres’ authentication method :

sudo cp /etc/postgresql/8.2/main/pg_hba.conf /etc/postgresql/8.2/main/pg_hba.conf_bak
sudo nano /etc/postgresql/8.2/main/pg_hba.conf

Add the following at the bottom of the file

# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    all         all         127.0.0.1       255.255.255.0    password

Restart postgres:

sudo /etc/init.d/postgresql-8.2 restart

Step 2: Infogami

Get the code with:

sudo apt-get install mercurial
hg clone http://infogami.org/hg/ infogami

Create your run.py

cd infogami
nano run.py

Paste the following into the run.py file:

import infogami
infogami.config.db_parameters = dict(dbn='postgres', db="infogami", user='postgres', pw='your-password')
infogami.config.site = 'sitename.local'
if __name__ == "__main__":
    infogami.run()

Save and exit.

Grant permission to infogami (and it child nodes)

cd ..
chmod -R 777 infogami/

Install Python Driver for PostgreSQL (python-psycopg2)

 sudo apt-get install python-psycopg2

Create the database and install infogami objects into it

cd infogami
sudo -u postgres createdb infogami
sudo -u postgres psql infogami < infogami/tdb/schema.sql
sudo -u postgres python run.py install

That’s it. You now have infogami installed on your machine.
to run it type:

sudo -u postgres python run.py

and nav your firefox to: http://loclahost:8080

Useful and simple guide, step by step.
http://www.supriyadisw.net/2007/02/postgresql-on-ubuntu-linux

Installing postgresql (8.2)

sudo apt-get install postgresql-8.2

Setting up the password for postgres’ postgres user

sudo -u postgres psql template1
ALTER USER postgres WITH PASSWORD 'your-password';
\q

Configure postgres’ authentication method :

sudo cp /etc/postgresql/8.2/main/pg_hba.conf /etc/postgresql/8.2/main/pg_hba.conf_bak
sudo nano /etc/postgresql/8.2/main/pg_hba.conf

Add the following at the bottom of the file

# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
host    all         all         127.0.0.1       255.255.255.0    password

Restart postgres:

sudo /etc/init.d/postgresql-8.2 restart

from: Python Is Not Java (dirtSimple)

So, if you don’t feel like you’re at least ten times more productive with Python than Java, chances are good that you’ve been forgetting to use the time machine! (And if you miss your Java IDE, consider the possibility that it’s because your Python program is much more complex than it needs to be.)

One might replace the word Java with .Net, it would remain the same, wouldn’t it?

This “Insert Disc” message was annoying and frustrating almost at any time I was trying to install a new software on my Ubuntu (7.10 gutsy-gibbon).

Media change: please insert the disc labeled 'Ubuntu 7.10 _Gutsy Gibbon_ - Release i386 (20071016.1)' in the drive '/cdrom/' and press enter

If you want to get rid of it you should comment out the line that point to the “CD-ROM” Source.

Type the following in the terminal:

gksudo gedit /etc/apt/sources.list

Locate the line that reads:

deb cdrom:[Ubuntu 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted

and comment it out

#deb cdrom:[Ubuntu 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted

Save the file, close the editor, back in the terminal window type:

sudo apt-get update

Good luck and thank you for choosing Ubuntu.

Ever wondered about Apples designers sources of inspiration?
I thinks I just found one, its name is Steve Jobs.

I was worth about over a million dollars when I was twenty-three
and over ten million dollars when I was twenty-four,
and over a hundred million dollars when I was twenty-five and it wasn’t that important because I never did it for the money.

The following is a photo was taken by Diana Walker and it shows Steve Jobs in his house in 1982

STEVE JOBS AT HOME IN 1982

Jobs said about it:

This was a very typical time. I was single.
All you needed was a cup of tea, a light, and your stereo,
you know, and that’s what I had.

•Bare in mind• the fact that in 1982 Jobs was already 27 years old, 2 years after he was already worth more than hundred million dollars, and yet, he kept that elegant minimalism principle.

I just came across this post by Robert Scoble

If you are trying to contact me on Facebook, please don’t. My account has been “disabled” for breaking Facebook’s Terms of Use. I was running a script that got them to keep me from accessing my account. I’m appealing. I’ll tell you what I was doing as soon as I talk with the developers who built what I was using and as soon as I talk with Facebook’s support (I sent an email in reply to the one below, but haven’t heard back yet).

I am working with a company to move my social graph to other places and that isn’t allowable under Facebook’s terms of service.

While they wrote their own screen scrappers Your addressbook and facebookso they can read all your contacts and friends that stored in the addresses books at gmail or hotmail or live.com, and many others. They blocked Robert Scoble’s account for running a script that (as far as I can read between the lines) exports his own friends list.

It is pretty clear now why Facebook preferred to go along with Microsoft instead of Google.
It is even more clear why they don’t join open social.
I can see what they thought at the first place when they released that cursed Beacon, and I don’t buy the apologizes that came after the rush.

Here is a short description of [Windows|Facebook] (you choose) platform.

  • It is a closed source system that comes with a set of APIs, which let third parties develop new applications.
  • If a user wants to use a third party application he must install that application.
  • If a user decided to uninstall a third party software.
  • When a user run the uninstall process, most of the data might remain in the system.
  • You never know who has access to your private data.

I finally was able to fix a few minor bugs and compile a new version of my js-hotkeys module. Get your copy now (tar.gz || zip)

Js-Hotkeys is a jQuery plugin that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination.

Read more at:
http://code.google.com/p/js-hotkeys/wiki/about
Live demo at:
http://jshotkeys.googlepages.com/test-static.html

Learning Lisp

I started learning Lisp.

You can see my homework at http://py2lisp.jottit.com/

Most of today’s web developer will tell you that

the following:

<h2 id="foo">Click Here</h2>
<script>
    $('foo').click = function(){alert("Hello")};
</script>

is better than:

<h2 id="foo" onclick="alert('Hello');">Click Here</h2>

and the following:

<style>
body{
    background-color:#ffffff;
    color:#000000;
    margin-top:3}
a{color:#0000cc}
a:visited{color:#551a8b}
</style>
<body>....</body>

<script>
$(document).ready(function(){
    sf();
    if(document.images){
        new Image().src='/images/nav_logo3.png';
    });
</script>

is far better than:

<body bgcolor=#ffffff
text=#000000
link=#0000cc
vlink=#551a8b
alink=#ff0000
onload="sf();if(document.images){new Image().src='/images/nav_logo3.png'}"
topmargin=3 marginheight=3>....</body>

and last but not least: Using HTML tables for layout-ing is evil.

The point is that the code above is taken from Google, Facebook and Yahoo.
Yep! All the majors seems to be caring less on standards and more for their own interests.

None of them are valid HTML and Google.com uses a table to align the two buttons (Google Search and I’m felling Lucky) in the middle of the page.

“… I thought of that old joke, y’know, the, this… this guy goes to a psychiatrist and says, “Doc, uh, my brother’s crazy; he thinks he’s a chicken.” And, uh, the doctor says, “Well, why don’t you turn him in?” The guy says, “I would, but I need the eggs…”

Annie Hall (1977) by Woddy Allen

I have been thinking allot recently about some significant decisions I have to make regarding my career, many times I found myself summarizing: I would, but I need the salary… ♥

Web-Safe Arithmetic Expressions Evaluator

import math
import re

whitelist = '|'.join(
    # oprators, digits
    ['-', '\+', '/', '\\', '\*', '\^', '\*\*', '\(', '\)', '\d+']
    # functions of math module (ex. __xxx__)
    + [f for f in dir(math) if f[:2] != ‘__’])

valid = lambda exp: re.match(whitelist, exp)

>>> valid(’23**2′)
<_sre.SRE_Match object at 0xb78ac218>
>>> valid(’sys.exit(100)’) == None
True
>>> exp = ‘23**2′
>>> if valid(exp):
>>>     x = eval(exp)

came across this post via unofficial planet python

First they ignore you.
Then they laugh at you.
Then they fight you.
Then you win.

MK Gandhi

Python is so beautiful and elegant

See this:

def fib():
    a, b = 0, 1
    while 1:
        yield b
        a, b = b, a+b

if __name__ == '__main__':
    f = fib()
    for i in xrange(1000):
        print f.next()

from: http://www.python.org/dev/peps/pep-0255/

I just came across this PG’s page:

Accumulator Generator

Revenge of the Nerds yielded a collection of canonical solutions to the same problem in a number of languages.

The problem: Write a function foo that takes a number n and returns a function that takes a number i, and returns n incremented by i.

Note: (a) that’s number, not integer, (b) that’s incremented by, not plus.

For python he offers this approach:

class foo:
    def __init__(self, n):
        self.n = n

    def __call__(self, i):
        self.n += i
        return self.n

I thought of it for a few seconds and realized that this class instantiation is not necessary. Same can be achieved this way:

def foo(n):
    def _inci(n, x):
        n+=x
        return n

    return lambda i: _inci (n,i)

… and I thought this method of raising errors belongs to the far past of web development…

google-debugging.png

 # a simple tcp server

import SocketServer

class EchoRequestHandler(SocketServer.BaseRequestHandler ):
    def setup(self):
        print self.client_address, 'connected!'
        self.request.send('hi ' + str(self.client_address) + '\n')

    def handle(self):
        data = 'dummy'
        while data:
            data = self.request.recv(1024)
            self.request.send(data)
            if data.strip() == 'bye':
                return

    def finish(self):
        print self.client_address, 'disconnected!'
        self.request.send('bye ' + str(self.client_address) + '\n')

    #server host is a tuple ('host', port)
server = SocketServer.ThreadingTCPServer(('', 50008), EchoRequestHandler)
server.serve_forever()

Using Python is like eating delicate gourmet foods. You know, great and innovative ideas, small portions, cheering up your mind, and tasting of the “Good Life”. Whereas using Lisp is like cooking that food.

This is an example why should one follow the rule of using ‘===’ and avoid ‘==’

var a = [];

[!!a, a == false] == [true, true]

You get !!a == true and at the same time a == false, now you are confused, ain’t you?

Therefore never ever you should be using in your code ‘==’ operator.

[!!a, a === false] == [true, false]
- > Feels better now, ain’t it?

“Follow the rules” is sometime a rule one should follow

HotKeys

jQuery Keyboard Shortcut Hooker Plugin is now called Hotkeys. Make sense, right? The script was tested on Linux, Windows, and MacOS, IE, Safari and Firefox.

The final result is relatively small file (121 lines of code). But do not let this fact misleading you by underestimating its value.

> See Live Demo  

Read more at Google Code and jQuery Plugin Repository

I rewrote (granted permissions by author) the great JavaScript module by Binny V A shortcut.js as a jQuery plug-in.

Code Sample and download a pre alpha version are available at Google Code

Cheers,

In IE (v: 7.0.5730.11) all GET request are cached. Go figure why.

In order to solve this issue, you can either switch to POST, or add a time stamp to any url you send.

function uncache (url){
return url + “&uncache=” + new Date().getTime();
}