I hate it when inconsiderate actions in the form of an ugly hack by a big player have malicious impact on current best practices. Now we have to add checks for "
X-moz: prefetch
" in request headers if we want to keep the
Google Web Accelerator
from "googling-up" certain web apps with broad branching, performance intensive get-requests. I wonder how well Google is making use of caching to limit the effect this has on server load.
07.05.2005, 15:28
Evil Google Web Accelerator?
JSON.stringify and JSON.parseJust realized that Douglas Crockford has added a fresh implementation of the JSON Javascript Object Notation code to the json.org site. I updated Mochascript to include this new implementation.var JSON = {
org: 'http://www.JSON.org',
copyright: '(c)2005 JSON.org',
license: 'http://www.crockford.com/JSON/license.html',
stringify: function stringify(arg) {
var c, i, l, s = '', v;
switch (typeof arg) {
case 'object':
if (arg) {
if (arg.constructor == Array) {
for (i = 0; i < arg.length; ++i) {
v = stringify(arg[i]);
if (s) {
s += ',';
}
s += v;
}
return '[' + s + ']';
} else if (typeof arg.toString != 'undefined') {
for (i in arg) {
v = stringify(arg[i]);
if (typeof v != 'function') {
if (s) {
s += ',';
}
s += stringify(i) + ':' + v;
}
}
return '{' + s + '}';
}
}
return 'null';
case 'number':
return isFinite(arg) ? String(arg) : 'null';
case 'string':
l = arg.length;
s = '"';
for (i = 0; i < l; i += 1) {
c = arg.charAt(i);
if (c >= ' ') {
if (c == '\\' || c == '"') {
s += '\\';
}
s += c;
} else {
switch (c) {
case '\b':
s += '\\b';
break;
case '\f':
s += '\\f';
break;
case '\n':
s += '\\n';
break;
case '\r':
s += '\\r';
break;
case '\t':
s += '\\t';
break;
default:
c = c.charCodeAt();
s += '\\u00' + Math.floor(c / 16).toString(16) +
(c % 16).toString(16);
}
}
}
return s + '"';
case 'boolean':
return String(arg);
default:
return 'null';
}
},
parse: function (text) {
var at = 0;
var ch = ' ';
function error(m) {
throw {
name: 'JSONError',
message: m,
at: at - 1,
text: text
};
}
function next() {
ch = text.charAt(at);
at += 1;
return ch;
}
function white() {
while (ch) {
if (ch <= ' ') {
next();
} else if (ch == '/') {
switch (next()) {
case '/':
while (next() && ch != '\n' && ch != '\r') {}
break;
case '*':
next();
for (;;) {
if (ch) {
if (ch == '*') {
if (next() == '/') {
next();
break;
}
} else {
next();
}
} else {
error("Unterminated comment");
}
}
break;
default:
error("Syntax error");
}
} else {
break;
}
}
}
function string() {
var i, s = '', t, u;
if (ch == '"') {
outer: while (next()) {
if (ch == '"') {
next();
return s;
} else if (ch == '\\') {
switch (next()) {
case 'b':
s += '\b';
break;
case 'f':
s += '\f';
break;
case 'n':
s += '\n';
break;
case 'r':
s += '\r';
break;
case 't':
s += '\t';
break;
case 'u':
u = 0;
for (i = 0; i < 4; i += 1) {
t = parseInt(next(), 16);
if (!isFinite(t)) {
break outer;
}
u = u * 16 + t;
}
s += String.fromCharCode(u);
break;
default:
s += ch;
}
} else {
s += ch;
}
}
}
error("Bad string");
}
function array() {
var a = [];
if (ch == '[') {
next();
white();
if (ch == ']') {
next();
return a;
}
while (ch) {
a.push(value());
white();
if (ch == ']') {
next();
return a;
} else if (ch != ',') {
break;
}
next();
white();
}
}
error("Bad array");
}
function object() {
var k, o = {};
if (ch == '{') {
next();
white();
if (ch == '}') {
next();
return o;
}
while (ch) {
k = string();
white();
if (ch != ':') {
break;
}
next();
o[k] = value();
white();
if (ch == '}') {
next();
return o;
} else if (ch != ',') {
break;
}
next();
white();
}
}
error("Bad object");
}
function number() {
var n = '', v;
if (ch == '-') {
n = '-';
next();
}
while (ch >= '0' && ch <= '9') {
n += ch;
next();
}
if (ch == '.') {
n += '.';
while (next() && ch >= '0' && ch <= '9') {
n += ch;
}
}
v = +n;
if (!isFinite(v)) {
error("Bad number");
} else {
return v;
}
}
function word() {
switch (ch) {
case 't':
if (next() == 'r' && next() == 'u' && next() == 'e') {
next();
return true;
}
break;
case 'f':
if (next() == 'a' && next() == 'l' && next() == 's' &&
next() == 'e') {
next();
return false;
}
break;
case 'n':
if (next() == 'u' && next() == 'l' && next() == 'l') {
next();
return null;
}
break;
}
error("Syntax error");
}
function value() {
white();
switch (ch) {
case '{':
return object();
case '[':
return array();
case '"':
return string();
case '-':
return number();
default:
return ch >= '0' && ch <= '9' ? number() : word();
}
}
return value();
}
};
05.05.2005, 02:57
|
Ajax for Javahttp://www.getahead.ltd.uk/dwr/04.05.2005, 02:00 |
The launching of launchdApple's Tiger brings a replacement for init, rc, the init.d and rc.d scripts, SystemStarter, inetd and xinetd, atd, crond, and watchdog to the Unix world. As slahdotted by JQuick, the new launchd "[...] the launchd plist files (short for property lists) contain a set of key/value pairs describing what to run, and when to run it. Beyond this, launchd defines keys which tailor how the program is run, all of which are optional. These include specifying: user and group by either name or uig/gid; working directory, chroot directory, a dictionary of environment variables, CPU niceness, umask. Do you want to limit how much memory or stack it uses, prevent it from wiring system memory? Do you want limit the number of children it can spawn, or treat its IO requests as low priority as urgent? Keys are available for that."02.05.2005, 10:27 |
Timeless RSSDave Winer says: "We have another format that's great for stuff that doesn't change often, timeless stuff. You'll be hearing more about that sooon ."01.05.2005, 8:54 |
KupuCleaner code, maybe?http://www.onlamp.com/pub/a/onlamp/2005/04/28/kupu.html 29.04.2005, 10:18 |
SNIFE goes VictorinoxThe larger manufacturer of Swiss Army knives, Victorinox, has taken over its much smaller competitor and only rival, Wenger."The two official makers of Swiss Army knives, which will keep their identities separate under the deal, have been struggling to make headway since the September 2001 terrorist attacks in the United States. After 9-11, the companies lost between 15% and 20% of turnover as business at duty-free outlets slumped. Although airline passengers can buy the knives in duty free stores, they are not allowed to take them on aircraft as hand luggage because of security concerns." So, Victorinox now owns SNIFE . 26.04.2005, 20:15 |
AJAX is everywhereIn a remarkably short time, AJAX has become the most talked about topic in Java circles."The problem with AJAX is that it doesn't address the fundamental difficulty in developing web applications--the unbridgable client-server divide. You still have to use a completely different set of languages and tools for writing the GUI on one hand, and the server components on the other, with no possibility of sharing code in between." "A truly revolutionary web paradigm would allow developers to use the SAME language and object model in developing both the client- and the server-side. The server would retrieve an objects from the datastore, serialize it, and pass it off to the client for editing. The client would be able to modify these same objects (defined in the same class libraries) and pass it back to the server, which re-validates them and persists them back into the datastore." Welcome to Mocha! 25.04.2005, 14:06 |
>>> Papa Ratzi |
| > How Software Patents Work |
| > Ten good practices for writing Javascript |
| > Free-trade accord with japan edges closer |
| > Mocha at a glance |
| > Adobe acquires Macromedia |
| > Safari 1.3 |
| > View complexity is usually higher than model complexity |
| > Free Trade Neutrality |
| > SQL for Java Objects |
| > Security Bypass |
| > Exactly 1111111111 seconds |
| > Kurt goes Chopper |
| > Choosing a Java scripting language |
| > Spamalot's will get spammed a lot |
| > The visual Rhino debugger |
| > The Unix wars |
| > EU-Council adopts software patent directive |
| > FreeBSD baby step "1j" |
| > Never trust a man who can count to 1024 on his fingers |
| > Visiting the world's smallest city |
| > Finally some non-MS, non-nonsense SPF news |
| > Swiss cows banned from eating grass |
| > Ludivines, the "Green Fairy" of absinthe |
| > First Look At Solaris 10 |
| > EU Commission Declines Patent Debate Restart |
| > Alan Kay's wisdom guiding the OpenLaszlo roadmap towards Mocha? |
| > 1 Kilo |
| > Re: FreeBSD logo design competition |
| > Schweizer Sagen |
| > Europas Eidgenossen |
| > XMLHttpRequest glory |
| > Art Nouveau La Chaux-de-Fonds 2005-2006 |
| > The Beastie Silhouette |
| > The Number One Nightmare |
| > Safe and Idempotent Methods such as HEAD and TRACE |
| > Sorry, you have been verizoned. |
| > Daemons and Pixies and Fairies, Oh My! |
| > Sentient life forms as MIME-attachments: RFC 1437 |
| > Anno 2004: CZV |
| > Web Developer Extension for Firefox |
| > Refactoring until nothing is left |
| > Brendan, never tired of providing Javascript support |
| > Catching XP in just 20 Minutes |
| > Designing the Star User Interface |
| > Rhino, Mono, IKVM. Or: JavaScript the hard way |
| > Re: SCO |
| > Judo |
| > Convergence on abstraction and on browser-based Console evaluation |
| > Today found out that inifinite uptimes are still an oxymoron |
| > New aspects of woven apps |
| > Original Contribution License (OCL) 1.0 |
| > Unified SPF: a grand unified theory of MARID |
| > BSD is designed. Linux is grown. |
| > 5 vor 12 bei 10 vor 10 |
| > Mocha vs Helma? |
| > Schattenwahrheit: Coup d'etat underway against the Cheney Circle? |
| > Abschluss Bilaterale II Schweiz-EU |
| > From Adam Smith to Open Source |
| > Linux - the desktop for the rest of them |
| > Big Bang |
| > Leaky Hop Objects |
| > Return Path Rewriting (RPR) - Mail Forwarding in the Spam Age |
| > Microsoft Discloses Huge Number Of Windows Vulnerabilties |
| > Steuerungsabgabe statt Steuern |
| > Anno 2003: deployZone |
| > The war against terror |
| > The war against terror (continued) |
| > The relativity of Apple's market share |
| > Are humans animals? |
| > Anno 1999: Der Oberhasler |
| > Anno 1998: crossnet |
| > Geschwindigkeit vs Umdrehungszahl |
| > Anno 1997: Xmedia |
| > "The meaning of life is to improve the quality of all life" |
| > Anno 1996: CZV |
| > How do I set a DEFAULT HTML-DOCUMENT? |
| > Global Screen Design Services |