Recommending yui-compressor over jsmin
June 27th, 2010
The following is a response that I sent someone quite a while ago in response to questions about JSMin.java. Hopefully it will be useful to others also.
I don’t actually use JSMin any more, and haven’t been maintaining it. Douglas Crockford has made some changes to the original have I haven’t gotten around to including. It looks like there may also some other changes in the javascript version that you linked to (I only had a quick glance at it).
Have a look at http://developer.yahoo.com/yui/compressor/ - that is the compressor that I use now. There is quite a bit of info on that page to get you up and running. I’m not sure if it supports the conditional compilation comments that you want, but I’d suspect that it does.
You can use that compressor inside your own code.
e.g.
public String postprocess( String data, final String absolutePath ) {
try {
JavaScriptCompressor compressor = new JavaScriptCompressor(new StringReader(data),
new ErrorReporter() {
public void warning(String message, String sourceName,
int line, String lineSource, int lineOffset) {
if (line < 0) {
System.err.println("\n[WARNING] ” + message);
} else {
System.err.println( “\n[WARNING] ” + line + ‘:’ + lineOffset + ‘:’ +
message + “\nfile:”+absolutePath+”\nline causing error: ” +
lineSource );
}
}
public void error(String message, String sourceName,
int line, String lineSource, int lineOffset) {
if (line < 0) {
System.err.println(”\n[ERROR] ” + message);
} else {
System.err.println( “\n[WARNING] ” + line + ‘:’ + lineOffset + ‘:’ +
message + “\nfile:”+absolutePath+”\nline causing error: ” +
lineSource );
}
}
public EvaluatorException runtimeError(String message, String sourceName,
int line, String lineSource, int lineOffset) {
error(message, sourceName, line, lineSource, lineOffset);
return new EvaluatorException(message);
}
});
StringWriter writer = new StringWriter( );
compressor.compress( writer, -1,true, false, true, false );
return writer.toString();
} catch( Exception e ) {
LOG.warn( e.getMessage(), e );
return data;
}
}
SF data opened to the public
August 19th, 2009
From this Techcrunch post , SF is opening some city data to the public at http://www.datasf.org/
Nice idea! I hope other cities in the area follow suit.
New phone number
May 27th, 2009
I’m not sure if anyone reads this, but if you do, my phone number has changed. If you need to get a hold of me, you can get the new number from me by email, from my facebook profile or by commenting on this message in a way that won’t get picked up by the spam filter
Later!
April 26th, 2009
So I finally gave in and decided to try out Twitter. My experience so far is pretty positive. I was curious about the swine flu outbreak that I’ve been reading about, so I checked to see if the CDC have a twitter account… and they do. Twitter is a great way for following stuff like this.
My twitter account is jreilly_ (note the _ at the end) if you’re interesting in following me.
California Fire season 2008
June 29th, 2008
A few weeks ago I noticed on my rss feed from RTE a story about a fire in Norway. Its was a 5000 acre fire and was the biggest fire there in 88 years if memory serves me correctly. Being an irregular event, they were struggling a bit to put it out. When I heard this, it reminded me of my surprise when I learned about the fire seasons here in California and the completely different scale of fires here. At the same time that fire was burning in Norway, there were 2 large fires here in California totaling about 60000 acres. A week or 2 before that, there was another fire in the Santa Cruz mountains which was several thousand acres as far as I remember. The Bay Area has been shrouded in smoke for the last week in which there has been over 1000 fires around the state. In this past week alone, over 300000 acres have burnt! In one week alone! That is 30% greater than the size of County Dublin back home!
This year is particularly bad - in fact from what I hear it has been getting progressively worse year on year. This year is shaping up to be a record fire year. We seem to be a few months ahead of schedule with the amount of burning that has already occurred so far. But thats the price for living where there is little rain fall I suppose.
Hopefully the 4th of July celebrations don’t add to the flames…
Vuze at the FCC Hearings on Network Management
February 28th, 2008
A few words from Gilles on the vuze blog.
http://blog.vuze.com/index.php/2008/02/27/tomorrows-internet/
Browser Search plugin for Vuze
September 14th, 2007
This is just something I put together for my own benefit, but maybe others will find it useful too. Get it here
Sanctuary
September 3rd, 2007
Any scifi fans out there should check out Sanctuary on Vuze - from the makers of Stargate SG-1 and Atlantis. As far as I know its not available anywhere else yet. The SD version is free over the Labor Day weekend (sorry, I should have posted about it here 2 days ago). Get it now! Enjoy!
Update to JSMin.java
August 21st, 2007
For anyone using JSMin.java, I’ve made a small update to JSMin.java to match with the latest jsmin.c. Thanks to Manuel Dominguez Sarmiento for pointing out the mismatch between the two.
Century of the Self
August 3rd, 2007
Quite an interesting watch.
http://www.vuze.com/details/ZFOUIGXPVMXDJTY2OCBKC3ACLWR4RDR2.html
PS: I’m strictly talking about the video being interesting, not the poster’s views at the end of the description.
Next Page »