Monday, January 24, 2005

google hired ben!

link

So will there be a google browser again?

Saturday, January 15, 2005

a good example to learn how to write firefox extension

Wednesday, January 12, 2005

firefox automation

This guy is making some good stuff of firefox automation.

Update 2007-09-01: read the official mozilla enterprise wiki for more information about enterprise deployment of firefox.

Labels:

Tuesday, January 11, 2005

Apple changed the world again

God!

They did this, Mac mini, they did this, iPod shuffle.

This is...I can not find a word. They changed the world again.

Labels:

Thursday, January 06, 2005

look beyond tabbed browsing...

Aren't tabs need to be grouped?

Wednesday, January 05, 2005

where can we get official firefox msi?

right here. And unofficials can be found at here and here.

javascript regexp email validator

I have been looking for a javascript email regexp email validator. And I found one from this web site. And the code is "/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i"

This code looks nice.

However, I am not totally satisfied with the code. Because there are emails addresses don't look like "abc@abc.com". For example, I used to send email to an address like "joel@192.168.100.1". So I am going to make some change to the regular expression filter.

Update 1: "/^([\w-]+(?:\.[\w-]+)*)\@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$|(\[?(\d{1,3}\.){3}\d{1,3}\]?)$/i" will detect email like "abc@127.0.0.1" or "abc@[127.0.0.1]".

Update 2: /^([\w-]+(?:\.[\w-]+)*)\@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$|(\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)$/i

Now this one won't let a.b.c@256.0.0.0 slip.

Update 3: /^(("?)[\w- ]+\1)|([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$|(\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)$/i

Now this regular expression thinks "Guy Joel"@abc.com or "Guy Joel"guyj@abc.com are good email address.

Update 4: /^(("?)[\w-\s]+\1)|([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$|(\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)$/i

A little bit more update on space in the regexp.

Update 5: /^("[\w-\s]+")?([\w-]+(?:\.[\w-]+)*)?@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$|(\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)$/i

Made a big mistake in the last one. So, another update.

Update 6: /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$|(\[?((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)$/i

It's getting longer and longer, better and better.

Update 7: /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i

The update 6 thinks 256.255.255.255 is a legal ip address, fixed in update 7.

stringresult
joel@joel.compass
joel@joel.edupass
joel@joel.museumpass
joel@joel.ac.ukpass
joel@guy.joel.ac.ukpass
guy.joel@guy.joel.ac.ukpass
guy.joel@127.0.0.1pass
guy.joel@[127.0.0.1]pass
\"Guy Joel\"guy.joel@[127.0.0.1pass
\"Guy Joel\"@[127.0.0.1]pass
\"Guy Joel\"@9.999.99.25fail
\"Guy Joel\"@999.99.99.25fail
"\"Guy Joel\""fail

Also, regular expression for url validation.

Labels: , , ,

Tuesday, January 04, 2005

Browser side form check and server side form check

Nowadays web developers do browser side form input check by javascript and server side form input check. Although without browser side form input check everything will be OK, we'd better do it. Because we can save some computing power on the server side. If a web user input some thing wrong, the server application need to check for mistakes, generate a page explain the error, and then the server need to check the input and process the data again.

If we have browser side form input check, the error check process will be done on the browser side computer.

But if we can do form input check at the browser side, why do we need check it again at server side? Because there are hackers, there are bad people. They can do whatever to put something wrong onto the server, to crash the application, to mess up our database. So we need to check the input on the server side again.

However, most of the input will be done by good customers, so with the help of browser side form input check, the server side form input check need only work onece, rather than twice or more.

open an typed url in a new tab in firefox

Some people asked me this question. It's simple. Just press alt (or option on some old mac) while you hit enter.

more about firefox msi and automation

Many people have been looking for msi package for firefox. And there is a little discussion going on at mozilla.org. As a result an official msi package of firefox will appear sometime in the next one or two releases. And some other unofficial msi packages are floating arround.