What a lovely book.
Anyone who even has a passing interest in science fact, history, fiction and friction should go get a copy.
I would go further and suggest it become a standard textbook for any science 101 classes in school.
Immensely readable, it packs so much intertwined history anecdotes that you feel that all the scientists of the 20th century worked in the same lab.
To give a poignant example I would provide the example of Zyklon-B.
It was a derivative of Zyklon-A developed by a german scientist trying to develop gas weapons for use against the French in WWI. He was Jewish.
Oh the humanity.
Go get it.
"Random Acts" is a blog about things of interest, software, technology, religion (or the lack of it), politics and philosophy
Friday, 27 January 2012
Wednesday, 25 January 2012
Holy Robot and a Beetle Beetleman!
Ok, It was B's birthday today, so I bought him a robot arm.
A kit I might add. 200+ parts.
He put it together and was maneuvering cork stoppers with ease within an hour.
Damn. For $70 I wanted him to take at least 2hrs.
Here it is and I apologize for the fuzziness:
We had ordered some food, and left the light on out the front.
We heard a massive BANG at the door and figured it was the delivery.
Nope.
A F**k off beetle.
Huge bugger.
Here it is...
Don'tcha just love Australia?
I might point out that I was sitting out the back stoop imbibing Bourbon a few hours ago and a 4' wingspan bat crashed into our fence - flailing about screeching away. Impressive. Not as impressive as this bad boy, bit pretty cool.
A kit I might add. 200+ parts.
He put it together and was maneuvering cork stoppers with ease within an hour.
Damn. For $70 I wanted him to take at least 2hrs.
Here it is and I apologize for the fuzziness:
We had ordered some food, and left the light on out the front.
We heard a massive BANG at the door and figured it was the delivery.
Nope.
A F**k off beetle.
Huge bugger.
Here it is...
Don'tcha just love Australia?
I might point out that I was sitting out the back stoop imbibing Bourbon a few hours ago and a 4' wingspan bat crashed into our fence - flailing about screeching away. Impressive. Not as impressive as this bad boy, bit pretty cool.
Monday, 23 January 2012
Review: "Sherlock" BBC TV Series
I first thought this was going to be rubbish because I just couldn't see how you would get past the "snigger" factor when hearing a modern day character saying "Sherlock Holmes and Dr Watson" or "Inspector Lastrade."
And given the Downey/Law movies, I was reticent to watch the series for fear of either being polluted.
Boy was I wrong.
Having Moffat and Gattis as producers and writers makes it all worthwhile.
Far from overlapping with the Downey/Law movies, they can be viewed completely separately.
Each episode is like an individual movie with all the beautiful production values you expect from the BBC.
And better because you really have to work to see most of the clues.
This is so unlike most TV detective shows where you have figured out the answer in the first 10 minutes.
To quote Sherlock:
I particularly liked Lastrade as so often he is portrayed as a bit dim while Rupert Graves does a brilliant job being "the best Scotland Yard has to offer."
And a wonderful portrayal of Mrs Hudson by Una Stubbs rounds it off.
The writing is up to the standard you expect from Moffat and Gattis being snappy, witty and rich.
After watching all sixepisodes movies we immediately went to the websites associated and had great fun digging around. For reference they are:
The Science of Deduction
John Watson's Blog
Molly Hooper's Diary
I strongly recommend this series. Worth every minute of your time to watch them.
I would have to say though that I had some odd thoughts around Moriarty. My memories of the original Conan Doyle stories makes me think of him as as an old man of crime and not a young psycho nut-job just starting out on a career in manipulation. Yet Andrew Scott did a great job and was believable.
On a side note, there's talk about CBS doing a version of the series set in the US. Not sure how that would work though... The Sherlock we know and love is damn smart, sarcastic, caustic, rude and arrogant and I suspect that would not be quite as endearing to American viewers.
And given the Downey/Law movies, I was reticent to watch the series for fear of either being polluted.
Boy was I wrong.
Having Moffat and Gattis as producers and writers makes it all worthwhile.
Far from overlapping with the Downey/Law movies, they can be viewed completely separately.
Each episode is like an individual movie with all the beautiful production values you expect from the BBC.
And better because you really have to work to see most of the clues.
This is so unlike most TV detective shows where you have figured out the answer in the first 10 minutes.
To quote Sherlock:
"DULL! DULL! DULL!"There are no 'wasted' or comedy relief characters - every actor does a brilliant job without overwhelming any of the others.
I particularly liked Lastrade as so often he is portrayed as a bit dim while Rupert Graves does a brilliant job being "the best Scotland Yard has to offer."
And a wonderful portrayal of Mrs Hudson by Una Stubbs rounds it off.
The writing is up to the standard you expect from Moffat and Gattis being snappy, witty and rich.
After watching all six
The Science of Deduction
John Watson's Blog
Molly Hooper's Diary
I strongly recommend this series. Worth every minute of your time to watch them.
I would have to say though that I had some odd thoughts around Moriarty. My memories of the original Conan Doyle stories makes me think of him as as an old man of crime and not a young psycho nut-job just starting out on a career in manipulation. Yet Andrew Scott did a great job and was believable.
On a side note, there's talk about CBS doing a version of the series set in the US. Not sure how that would work though... The Sherlock we know and love is damn smart, sarcastic, caustic, rude and arrogant and I suspect that would not be quite as endearing to American viewers.
Thursday, 19 January 2012
Creating a dummy groovy/maven project and make it executable
Problem:
I like groovy.
The company uses maven and java.
The live servers don't have groovy installed.
So I downloaded the Intellij Idea community edition and got to work.
So here is a contrived solution that yields an executable jar file.
First go to some project folder (I was testing with Idea CE 11 so I used IdeaProjects):
bandit:IdeaProjects user$ pwd /Users/user/IdeaProjects
Now use maven to create an example project:
bandit:IdeaProjects user$ mvn archetype:generate -DarchetypeGroupId=org.codehaus.gmaven.archetypes -DarchetypeArtifactId=gmaven-archetype-basic
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Interactive mode
[INFO] Archetype [org.codehaus.gmaven.archetypes:gmaven-archetype-basic:1.4] found in catalog remote
Define value for property 'groupId': : com.company
Define value for property 'artifactId': : example
Define value for property 'version': 1.0-SNAPSHOT:
Define value for property 'package': com.company:
[INFO] Using property: name = Example Project
Confirm properties configuration:
groupId: com.company
artifactId: example
version: 1.0-SNAPSHOT
package: com.company
name: Example Project
Y: y
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20 seconds
[INFO] Finished at: Thu Jan 19 16:31:24 EST 2012
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
This will create a project called example:
bandit:IdeaProjects user$ cd example bandit:example user$ find . -print . ./pom.xml ./src ./src/main ./src/main/groovy ./src/main/groovy/com ./src/main/groovy/com/company ./src/main/groovy/com/company/Example.groovy ./src/main/groovy/com/company/Helper.java ./src/test ./src/test/groovy ./src/test/groovy/com ./src/test/groovy/com/company ./src/test/groovy/com/company/ExampleTest.groovy ./src/test/groovy/com/company/HelperTest.groovy
Ok. Now create a new project in Idea CE and do this:
1. use import project from external model and click next
2. choose maven and click next
3. choose the correct root directory and check import Maven projects automatically and click next
4. choose the com.company:example:1.0-SNAPSHOT maven project and click next
5. ignore the next panel as it's fine and click finish
Now you have the project open, edit the pom.xml.
It will look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Generated from archetype; please customize.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company</groupId>
<artifactId>example</artifactId>
<name>example project</name>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.4</version>
<configuration>
<providerSelection>1.8</providerSelection>
</configuration>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
What we need to do is add some extras.
In the dependencies add this:
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-1.8</artifactId>
<version>1.4</version>
</dependency>
And in the plugins add this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
Now open the Example.groovy in src/main/groovy/com.company.
It should look like this:
//
// Generated from archetype; please customize.
//
package com.company
/**
* Example Groovy class.
*/
class Example {
def show() {
println 'Hello World'
}
}
Add a main method:
//
// Generated from archetype; please customize.
//
package com.company
/**
* Example Groovy class.
*/
class Example {
public static void main(String[] args) {
System.out.println("Working!");
}
def show() {
println 'Hello World'
}
}
Now go back to the command line and run a package:
bandit:example user$ mvn clean package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building example project
[INFO] task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory /Users/user/IdeaProjects/example/target
[INFO] [groovy:generateStubs {execution: default}]
[INFO] Generated 1 Java stub
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/user/IdeaProjects/example/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[WARNING] File encoding has not been set, using platform encoding MacRoman, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /Users/user/IdeaProjects/example/target/classes
[INFO] [groovy:compile {execution: default}]
[INFO] Compiled 1 Groovy class
[INFO] [groovy:generateTestStubs {execution: default}]
[INFO] Generated 2 Java stubs
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/user/IdeaProjects/example/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[WARNING] File encoding has not been set, using platform encoding MacRoman, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /Users/user/IdeaProjects/example/target/test-classes
[INFO] [groovy:testCompile {execution: default}]
[INFO] Compiled 2 Groovy classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /Users/user/IdeaProjects/example/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.company.ExampleTest
Hello World
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.411 sec
Running com.company.HelperTest
Hello World
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: /Users/user/IdeaProjects/example/target/example-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Thu Jan 19 16:47:12 EST 2012
[INFO] Final Memory: 26M/81M
[INFO] ------------------------------------------------------------------------
And now we can run it:
bandit:example user$ java -cp target/example-1.0-SNAPSHOT.jar:/opt/local/share/java/groovy/lib/* com.company.Example Working!
I should have set UTF-8 instead of MacRoman and also obviously I could have used maven to put the Main-Class in the manifest, but this is a contrived example.
Also obviously I have to ensure the groovy 1.8 jars are on the server...
Or...
I could jars-in-a-jar solution...
That darned "No suitable ClassLoader found for grab" with groovyc and java -cp
Update Apr 7, 2012: Hmm. Seems this is a very popular post. I intend to expand it and cover how to approach the details more clearly.
I like groovy.
Problem is, we don't have it installed on our live servers.
So I have to compile the groovy code into java class files and deploy them.
But when you're using the @Grab annotation, things go bad.
I kinda like using @Grab to snarf the specific dependencies, but you always run into the dreaded:
Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.RuntimeException: No suitable ClassLoader found for grab
Now all that @Grab does is download the jars you needed and pops them into ~/.groovy/grapes.
Once it's done it's job you don't need it for either running groovy scripts or for the java class.
Here's a rather artificial contrived explanation of how to get around the ClassLoader issue.
(Of course you could just use grape directly, or specify your own .m2 jars or whatever, but I noted this question open in a few places, so I contrived this example)
First create your script, say, x.groovy...
@Grab(group='com.gmongo', module='gmongo', version='0.8')
import com.gmongo.GMongo
// Instantiate a com.gmongo.GMongo object instead of com.mongodb.Mongo
def mongo = new GMongo("the.mongo.ip.address", 27017)
def db = mongo.getDB("some_database")
println db.my_collection.find([SomeKey:[$ne:"0"],SomeOtherKey:"0"]).count()
Now run it:
groovy x.groovy 149845
Cool.
Now we use groovyc to compile it...
groovyc -d classes x.groovy
But when we try to run it using java...
# Building CLASSPATH here purely for clarity... # We compiled the groovy class into classes: CLASSPATH="classes" # We need the gmongo jar: CLASSPATH="$CLASSPATH:~/.groovy/grapes/com.gmongo/gmongo/jars/gmongo-0.8.jar" # And because tis is just an example, I knew I needed this one as well: CLASSPATH="$CLASSPATH:~/.groovy/grapes/org.mongodb/mongo-java-driver/jars/mongo-java-driver-2.5.2.jar" # And I dev on a Mac and use MacPorts, so groovy is installed in /opt/local/share: CLASSPATH="$CLASSPATH:/opt/local/share/java/groovy/lib/*" # Now run it: java -cp $CLASSPATH x Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.RuntimeException: No suitable ClassLoader found for grab at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ...elided for brevity... at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:165) at x.<clinit>(x.groovy) </clinit>
Rats. So we need to remove the @Grab now that it's done it's work and downloaded the jars...
//@Grab(group='com.gmongo', module='gmongo', version='0.8')
import com.gmongo.GMongo
// Instantiate a com.gmongo.GMongo object instead of com.mongodb.Mongo
def mongo = new GMongo("192.168.4.112", 27017)
def db = mongo.getDB("some_database")
println db.my_collection.find([SomeKey:[$ne:"0"],SomeOtherKey:"0"]).count()
And re-compile using the specific gmongo jar:
groovyc -cp ~/.groovy/grapes/com.gmongo/gmongo/jars/gmongo-0.8.jar -d classes x.groovy
And now we can run it as before
# Building CLASSPATH here purely for clarity... ...elided... java -cp $CLASSPATH x 149845
Hope that explains it for those stuck with that issue.
Oh, and if you need to see the classpath from within a script go here: http://blog.blindgaenger.net/print_groovys_classpath_for_debugging.html
Waaaay cool.
Wednesday, 18 January 2012
Friday, 13 January 2012
Wow. Meteor impacts!
Just got a call from my brother. Wanted to know if I knew anything about a meteor impact in western Finland. Not an unreasonable request given my history (and his), but I didn't. So I did a search.
Did you know... That of the top 50 meteor impacts with craters greater than 20 km in size, 7 are in Australia? Neat. Here's the full list:
http://en.wikipedia.org/wiki/List_of_impact_craters_on_Earth
Cool. Actually been to some of them. Here's the list of impact craters in Australia: http://en.wikipedia.org/wiki/List_of_impact_craters_in_Australia
Wolfe Creek is waaay cool and I visited it sometime in the 80's. http://en.wikipedia.org/wiki/Wolfe_Creek_crater
But back to my brother. He's going to visit this page, so here's a list of impact craters in Europe: http://en.wikipedia.org/wiki/List_of_impact_craters_in_Europe
He can do a sort and see the ones in Finland.
Cheers!
Did you know... That of the top 50 meteor impacts with craters greater than 20 km in size, 7 are in Australia? Neat. Here's the full list:
http://en.wikipedia.org/wiki/List_of_impact_craters_on_Earth
Cool. Actually been to some of them. Here's the list of impact craters in Australia: http://en.wikipedia.org/wiki/List_of_impact_craters_in_Australia
Wolfe Creek is waaay cool and I visited it sometime in the 80's. http://en.wikipedia.org/wiki/Wolfe_Creek_crater
But back to my brother. He's going to visit this page, so here's a list of impact craters in Europe: http://en.wikipedia.org/wiki/List_of_impact_craters_in_Europe
He can do a sort and see the ones in Finland.
Cheers!
Wednesday, 11 January 2012
Stopping and/or Restarting an embedded Jetty instance via web call
I had a need to allow a web call to stop and restart an embedded Jetty instance.
So basically, I need to have something like this:
curl -v http://localhost:9103/some/path # Calls a handler and does something RESTful curl -v http://localhost:9103/stop # Stops the Jetty instance curl -v http://localhost:9103/restart # Restarts the Jetty instance
First up create a main class:
package com.company;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.NCSARequestLog;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.server.handler.RequestLogHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class EmbeddedJetty {
private static Logger log = LoggerFactory.getLogger(EmbeddedJetty.class);
public static void main(String[] args) throws Exception {
while (true) {
// Realistically all parameters should be read from some external file...
log.info("Starting Jetty on port 9103");
Server server = new Server(9103);
HandlerCollection handlers = new HandlerCollection();
ContextHandlerCollection contexts = new ContextHandlerCollection();
// I added this to show how to add access logs to an embedded server.
RequestLogHandler requestLogHandler = new RequestLogHandler();
NCSARequestLog requestLog = new NCSARequestLog("/tmp/jetty-yyyy_mm_dd.request.log");
requestLog.setAppend(true);
requestLog.setExtended(true);
requestLog.setLogTimeZone("UTC");
requestLogHandler.setRequestLog(requestLog);
// We want the server to gracefully allow current requests to stop
server.setGracefulShutdown(1000);
server.setStopAtShutdown(true);
// Now add the handlers
YourHandler yourHandler = new YourHandler(server);
handlers.setHandlers(new Handler[]{contexts, yourHandler, requestLogHandler});
server.setHandler(handlers);
// Start the server
server.start();
server.join();
// It's stopped.
log.info("Jetty stopped");
if (!yourHandler.restartPlease) {
break;
}
log.warn("Restarting Jetty");
}
}
}
Now the handler:
package com.company;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class YourHandler extends AbstractHandler {
private static Logger log = LoggerFactory.getLogger(YourHandler.class);
private Server server = null;
public Boolean restartPlease = false;
public YourHandler(Server server) {
this.server = server;
}
private boolean stopServer(HttpServletResponse response) throws IOException {
log.warn("Stopping Jetty");
response.setStatus(202);
response.setContentType("text/plain");
ServletOutputStream os = response.getOutputStream();
os.println("Shutting down.");
os.close();
response.flushBuffer();
try {
// Stop the server.
new Thread() {
@Override
public void run() {
try {
log.info("Shutting down Jetty...");
server.stop();
log.info("Jetty has stopped.");
} catch (Exception ex) {
log.error("Error when stopping Jetty: " + ex.getMessage(), ex);
}
}
}.start();
} catch (Exception ex) {
log.error("Unable to stop Jetty: " + ex);
return false;
}
return true;
}
@Override
public void handle(String string, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
String pathInfo = request.getPathInfo();
// THIS SHOULD OBVIOUSLY BE SECURED!!!
if ("/stop".equals(pathInfo)) {
stopServer(response);
return;
}
if ("/restart".equals(pathInfo)) {
restartPlease = true;
stopServer(response);
return;
}
// Go off and do the rest of your RESTful calls...
// And close off how you please
response.sendRedirect("http://nowhere.com");
}
}
And you can now run your main class from your IDE of choice.
Just for reference I added a log4j.properties:
# Site
log4j.logger.com.company=DEBUG, SITE_CONSOLE
log4j.additivity.com.company=false
# Set root logger level
log4j.rootLogger=DEBUG, CONSOLE
log4j.logger.org.eclipse=INFO, CONSOLE
log4j.additivity.org.eclipse=false
# ---------------------------------------------------------------------------------
# Appenders - Notice I have added a discriminator to the conversion pattern
# ---------------------------------------------------------------------------------
# For console logging - not in production obviously as you'd use a rolling file appender
log4j.appender.SITE_CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.SITE_CONSOLE.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.SITE_CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{UTC} SITE %-5p [%t] %c{1.} %x - %m%n
# The baseline CONSOLE logger
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{UTC} JETTY %-5p [%t] %c{1.} %x - %m%n
I created a plain Java SE app and added a 'lib' folder with these jars in it:
jetty-continuation-8.0.4.v20111024.jar jetty-http-8.0.4.v20111024.jar jetty-io-8.0.4.v20111024.jar jetty-server-8.0.4.v20111024.jar jetty-servlet-8.0.4.v20111024.jar jetty-servlets-8.0.4.v20111024.jar jetty-util-8.0.4.v20111024.jar jetty-webapp-8.0.4.v20111024.jar log4j-1.2.16.jar servlet-api-3.0.jar slf4j-api-1.6.2.jar slf4j-log4j12-1.6.2.jar
From the Jetty8 release.
I then ensured that the MANIFEST included these jars.
Just for reference the META-INF/MANIFEST.MF looks like this:
cat META-INF/MANIFEST.MF Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.2 Created-By: 1.6.0_29-b11-402-10M3527 (Apple Inc.) Class-Path: lib/jetty-all-8.0.4.v20111024-javadoc.jar lib/jetty-contin uation-8.0.4.v20111024.jar lib/jetty-http-8.0.4.v20111024.jar lib/jet ty-io-8.0.4.v20111024.jar lib/jetty-server-8.0.4.v20111024.jar lib/je tty-servlet-8.0.4.v20111024.jar lib/jetty-servlets-8.0.4.v20111024.ja r lib/jetty-util-8.0.4.v20111024.jar lib/jetty-webapp-8.0.4.v20111024 .jar lib/log4j-1.2.16.jar lib/servlet-api-3.0.jar lib/slf4j-api-1.6.2 .jar lib/slf4j-log4j12-1.6.2.jar X-COMMENT: Main-Class will be added automatically by build Main-Class: com.company.EmbeddedJetty
I know I included the javadoc un-intentionally...
This scheme requires a lib folder alongside the jar with those files in it.
(Need to figure out how to bundle the Jetty8 jars so that the app is self-contained...)
So the jar can be started like this:
java -jar /some/folder/EmbeddedJetty/dist/EmbeddedJetty.jar
K
Book Review: The Grand Design by Stephen Hawking
Hmm. I have to say I was disappointed. If I had to sum up the book in one sentence it would be "I think M-Theory is our best shot at a GUT."
It's not that the book was not well written - it is.
Nor that it covers some details regarding the Strong Anthropic Principle that are glossed over elsewhere.
Nor that it fleshes out the mechanisms regarding Feynman diagrams and the Sum over Histories calculations.
Nor that is is sprinkled with Hawkings humorous quips and comments.
It's just that...
Well...
I expected not so much a revelation but a new way to view the relationship between the microscopic and macroscopic worlds.
And I didn't get it.
Worse, it seems that 99% of the book has been written about before.
And the appellation "New answers to the ultimate questions of life" seems almost completely incorrect.
Greenes "The Fabric of the Cosmos" came out in 2004 and apart from some minor differences says much of the same things.
And "Cycles of Time" (2010) by Penrose provides a detailed 'new' way of viewing the 2nd law and how it relates to the beginning of the universe (if 'beginning' is the right word) that isn't even mentioned by Hawking.
If this book had come out 10 or even 5 years ago it might have been considered "...mind-blowing stuff.." as the Sunday Times describes it.
But it didn't. It came out this year.
I accept that there must have been considerable difficulties relating to transcribing Hawkings thoughts and speech to paper, so it would have taken a long time to create.
But still...
Unrelated to the content I must add that for the copy of the paperback I purchased the choice of font and paper was unfortunate. Galliard and glossy paper make it physically difficult to read when not in natural light as the reflection gets irritating fast. I did love the comics and the artwork as they provided an insight to the beauty and difficulty of analysing the universe.
All in all, I'd have to say "don't bother" and would recommend Penrose and Greene as better choices.
It's not that the book was not well written - it is.
Nor that it covers some details regarding the Strong Anthropic Principle that are glossed over elsewhere.
Nor that it fleshes out the mechanisms regarding Feynman diagrams and the Sum over Histories calculations.
Nor that is is sprinkled with Hawkings humorous quips and comments.
It's just that...
Well...
I expected not so much a revelation but a new way to view the relationship between the microscopic and macroscopic worlds.
And I didn't get it.
Worse, it seems that 99% of the book has been written about before.
And the appellation "New answers to the ultimate questions of life" seems almost completely incorrect.
Greenes "The Fabric of the Cosmos" came out in 2004 and apart from some minor differences says much of the same things.
And "Cycles of Time" (2010) by Penrose provides a detailed 'new' way of viewing the 2nd law and how it relates to the beginning of the universe (if 'beginning' is the right word) that isn't even mentioned by Hawking.
If this book had come out 10 or even 5 years ago it might have been considered "...mind-blowing stuff.." as the Sunday Times describes it.
But it didn't. It came out this year.
I accept that there must have been considerable difficulties relating to transcribing Hawkings thoughts and speech to paper, so it would have taken a long time to create.
But still...
Unrelated to the content I must add that for the copy of the paperback I purchased the choice of font and paper was unfortunate. Galliard and glossy paper make it physically difficult to read when not in natural light as the reflection gets irritating fast. I did love the comics and the artwork as they provided an insight to the beauty and difficulty of analysing the universe.
All in all, I'd have to say "don't bother" and would recommend Penrose and Greene as better choices.
Tuesday, 10 January 2012
Book Review: The New New Rules by Bill Maher.
I tried.
I really did.
I got to 'D'.
Then I just had to put it down.
I just couldn't read any more.
I like Bill Maher as a... well... a... Whatever.
I liked the documentaries.
Well...
Most of them.... Some... But this book...
I tried to laugh.
I really tried.
But like a stoney faced gargoyle looking down on nuns, I read page after page and I just couldn't.
Maybe it's American humor and I'm just not tuned to it.
In any case, unless you are a fan of him, and his show, and American, and...
Well... I will have to put this on the shelf and regret the loss.
I really did.
I got to 'D'.
Then I just had to put it down.
I just couldn't read any more.
I like Bill Maher as a... well... a... Whatever.
I liked the documentaries.
Well...
Most of them.... Some... But this book...
I tried to laugh.
I really tried.
But like a stoney faced gargoyle looking down on nuns, I read page after page and I just couldn't.
Maybe it's American humor and I'm just not tuned to it.
In any case, unless you are a fan of him, and his show, and American, and...
Well... I will have to put this on the shelf and regret the loss.
Subscribe to:
Posts (Atom)

