Yes, 6 x 9 = 42
#define NINE 8 + 1
#define SIX 1 + 5
int main(void) {
printf("%d times %d is %d\n", SIX, NINE, SIX * NINE);
return 0;
}
Online version of OpenOffice.org 3
Here's a serious challenger for Google Docs: through Ulteo, it's now possible to run OpenOffice.org 3 online.
No need to install anything, a Java-enabled browser is enough and you got 1 Gb of free storage.
How to avoid IE CSS hacks using conditional classnames
Paul Hammond reminds us that IE conditional comments also work in the HTML code.
It's quite neat because that way you can avoid IE CSS hacks (like the infamous "* html" hack) and use a class instead.
Mirror :
If you use this HTML:
<!--[if IE ]>
<body class="ie">
<![endif]-->
<!--[if !IE]>-->
<body>
<!--<![endif]-->
with CSS that looks something like:
div.foo {
color: inherit;
}
.ie div.foo {
color: #ff8000;
}
then you get all of the advantages of using conditional comments to work around problems in Internet Explorer, without the extra HTTP request of an IE-only stylesheet.
Thanks to Paul, and thanks to Rik24@ for the heads up.
A lookup at Google's data centers
Google has published info about how their data centers work.
The part about evaporative cooling is really cool.
The IP address assignments map
It's as old as the internet, but it can still be interesting and it's still kept up-to-date: IANA's IPv4 Global Unicast Address Assignements
Want to see every /8 managed by the RIPE? Try:
wget -o /dev/null -O - http://www.iana.org/assignments/ipv4-address-space/ | fgrep whois.ripe.net
This map also shows how many IPv4 /8 addresses blocks are still unallocated.
Hans Reiser history, by DittoBox
Login: reiser
Password:
$ touch wife
touch: access denied
$ sudo touch wife
password:
touch: access denied
$ echo "wtf?"
wtf?
$ pgrep wife
14589
$ sudo kill -9 14589
$ mv body /dev/hills/body
Some time later:
Login: cops Password: $ locate body body not found $ sudo usermod -g felon reiser $ sudo updatedb $ locate body /dev/hills/body
Cross-subdomain AJAX made simple
Cross-domain AJAX is possible, but really lousy to achieve in a clean and portable way, especially if you want to support POST operations.
There's a bunch of articles about the subject, with different approaches (iframe with dynamic anchors to communicate with the parent, dynamic script tags, Flash bridge, browser-specific tricks) but they all have limitations and they are quite bloated.
If you only need cross-subdomains AJAX calls, there is a way, way, way easier way.
I looked for a long time before spotting this, and I would really love to give a big thank you to Abe Fettig for writing about this.
The trick is simple: document.domain
If a document and an iframe share the same value for their document.domain property, the iframe can access the parent DOM without any security violation.
and
The document.domain property can be changed anytime, as long as it's the original value or as long as it shares the same suffix. For instance, if the current value for document.domain is www.example.com the property can be set to example.com but not to example.net.
See the trick ?
Set the parent and the iframe document.domain property to the domain name (for instance) when you need the iframe to send back data to the parent. And reset the original document.domain in the iframe before doing AJAX calls.
Download that simple example and see by yourself. The parent URL can be anything.jedi.devteam while the iframe (and so, the authorized host name for AJAX requests) is subdomain.jedi.devteam . Both set document.domain to jedi.devteam so that the iframe can call window.parent.update_me(), with any local argument like the result of an AJAX call.
Thanks again to Abe Fetting for that very useful hint.
RAID0 vs RAID1 benchmark
FreeBSD 7 amd64.
3ware 8006-2LP storage controller.
2x Hitachi HDS721075K drives
UFS, softupdates.
Blogbench was used as a benchmark tool.
- RAID 1, UFS, Softupdates, noatime
Final score for writes: 347
Final score for reads : 62382
- RAID 0, UFS, Softupdates, noatime
Final score for writes: 504
Final score for reads : 65850
Is it really worth using a RAID 0 array?
And while I was at it, I tried UFS vs ZFS, also with blogbench, on a JBOD array.
- UFS, Softupdates, noatime
Final score for writes: 403
Final score for reads : 66177
- ZFS, prefetch_disable=0, noatime, nocompress
Final score for writes: 339
Final score for reads : 39167
- ZFS, prefetch_disable=1, noatime, nocompress
Final score for writes: 338
Final score for reads : 49820
Avoid pie charts
Pie charts might look beautiful, but they are useless.
XMLHttpRequest browser bugs and and implementation with sniffing capabilities
While fighting with odd bugs in an AJAX-based chat, I found that excellent document about Cross-browser implementation with sniffing capabilities.
Thanks to Sergey Ilsinky, the odd bugs are now solved, it's why I had to share its document to fellow web developers.
Guess why frameworks like prototype are great?
Fast sinus and cosinus approximation
Computing sine and cosine are expensive operations.
Besides the traditional lookup tables and taylor series, here's a fantastic solution using a quadratic curve which blows everything away in terms of performance and accuracy.
Microsoft to buy Yahoo
Microsoft proposed acquisition of Yahoo! for approximately $44.6 billion in cash and stock.
Ouch.
Highly scalable architectures : lessons learned at Qcon 2007
The QCon conference took place at San Francisco, and it looks like it was an extremely interesting conferences, with speakers from Spring, eBay, Linked-In, Sun, Oracle, Yahoo, Google and Gigaspaces.
Nati Shalom's has written a wonderful summary of lessons learned at the QCon, with good hints about building highly scalable architectures.
Slides from the QCon are available as well.
Especially check out the Linkedin architecture.
Liste de tous les codes postaux et communes de France, avec géolocalisation
(I'm awfully sorry that french article, but actually it's unlikely to be of interest to anyone but french freaks)
Une liste de toutes les communes de France, de tous les codes postaux et de leurs coordonnées géographiques. C'est quelque chose qui peut être utile à bien des sites, mais qui est curieusement mission impossible à trouver librement sur internet.
J'ai donc profité de ces 4 derniers jours pour me pencher sur le sujet et vous pouvez maintenant télécharger une telle base, sous forme de dump PostgreSQL et MySQL.
La base de données des communes et des codes postaux c'est par ici !