Friday, 23 December 2011

"Battle of Los Angeles"

Oh god.
Not the far superior "Battle: Los Angeles".
Awful.
I had the sense of watching a 14 yr old with a camera trying to be Michael Bay but scarcely reaching Uwe Bolls worst attempt.
(Thinking Bloodrayne here. Cost $25m and made 2.5M)

If I had to write a synopsis, I would write as it seemed to me the director pitched the movie:
"This great spaceship, right. It comes down over LA and then smoke and stuff happens and a couple of F16 pilots try to stop it. Girl pilots! And they fail, and crash. And this guy, right, a general or something is gunna shoot one of his pilots, but then a bunch of alien ships race over and then bang, bang, pew, pew. And, and, this guy lands a WWII plane and gets out and gets helped by the modern soldiers and he's stunned, so they are gunna take him to the UFO people... You know Majestik 12. And they run and they shoot and the spaceships come down and pew, pew. And then a big ship starts chasing them and then this ninja lady jumps down and stabs the ship with her sword. Cool. So she takes them to MJ12 and they see an alien and the WWII guy starts screaming 'cos he talks alien and the alien gets free and they're running and pew, pew and they steal a ship and fly it right through the mothership! And then pew, pew and running and shooting and they kill the bad alien and the mothership crashes and... and... Wait. No. That's it."
It was appalling.
I want that 90mins of my life back.

Thursday, 22 December 2011

"The Fabric of the Cosmos" by Brian Greene

Wow.
I wish I had read this in high school.
Of course, I couldn't because I left school 30 years before it was written.

The book covers space, time, spacetime, non-locality, relativity, unification, the second law and so much more.
The writing is clear, concise, easy to read and has a gusto and enthusiasm that reminded me of Carl Sagan.

Newtons Bucket is analysed in exquisite detail throughout the book as a kind of backdrop to how physics has changed and how the refinements and revolutions have been able to more and more accurately describe how (and why) the water spins and forms a concave surface.
(If you have no idea what I've just said, go read http://en.wikipedia.org/wiki/Bucket_argument)

The author has a mention in wikipedia: http://en.wikipedia.org/wiki/Brian_Greene and has even had an appearance on "The Big Bang Theory". Cool.

Even though the book is slightly out of date with respect to the LHC and later refinements to String and M-Theory, Loop Quantum Gravity et al, I strongly suggest that anyone who wants a thorough grounding in the current state of physics should go out and buy this modest little Penguin book.

I will be definitely getting his later work "The Hidden Reality: Parallel Universes and the Deep Laws of the Cosmos" as soon as I can.

"The New Road to Serfdom" Daniel Hannan

What?
"A Letter of Warning to America"
What?
More like
"A Letter of Wingeing to America".
I struggled to finish this book.
Tedious, painful, specious, facile, badly argued rot.
For example on pages 131 and 132.
"I can perhaps summarize what's wrong with European gesture politics by adapting a famous observation by P.J.O'Rourke, who wrote that the only political observation he could confidently make was that God was a Republican and Santa Claus a Democrat. By the same token, then I suspect that God is a Euro-skeptic and Santa Claus a Euro-enthusiast."
What?
WHAT?
Anyway, some more God based rubbish follows for a few paragraphs and then this:
"Santa Claus, in short, is preferable to God in every way. Except one. There's no such thing as Santa Claus."
WHAT?
So there is a God?
And, of course, he's a Republican.
My gasts where completely flabbered at this point and I determined not to read one more line of this complete horse-sh*t.

After calming down and picking the book up from the corner of the room where I'd thrown it in disgust, I forced myself to wade through what in all respects seemed to be a mealy mouthed European Parliamentary Members painful prognostications.
I managed to get through the remainder of this complete crap so I could at least write up this review.
Done.

Sunday, 4 December 2011

The Coming Jobs War by Jim Clifton

Wow.
Ok.
2nd Chairman of Gallup.
Doing a rant directed at...
Well...
Just about everybody I guess.
Basically saying what Kirk said in Wrath of Khan:
"You’ve managed to kill everyone else but like a poor marksman, you keep missing the target"
In any case I got half way through and got a strong sense of "AMERICA! F**K YEAH!"
Then my reasonableness got the better of me and I re-read two chapters substituting "Australia" for "America".
Odd.
Never thought of myself of having any level of anti-americanism in me.
Ok.
Well a bit.
But having re-read the chapters with the substitution I realised that most of what was being said applied to whatever country you're from.

Anyway, having grown up in a neo-conservative dominated world, it did seem like a call to action that needed to be said.
And, IMHO, needs to be acted upon.
Not just in the US, but everywhere.
And here in Australia too.
Oh wait.
Damn.
I'm doing the "AUSTRALIA! F**K YEAH!" thing.

But that's not what it's about.
It's about being just plain sensible.
Well, that's my 2c anyway.

Cycles of Time by Roger Penrose

O.
M.
G.
I seriously need to re-learn my maths.
And need to re-read "The Road to Reality".

I found the book surprisingly easy to read - being marginally familiar with such things as Phase Space and what not.
However, I *do* need to go back to my old books and re-learn a lot of stuff before I can do justice to this book.
It's argued convincingly and with passion.
(Concentrating on the 2nd law of course)
And therein lies my problem.
I could have been bamboozled and missed something critical due to my lack of education.

It also has geeky humour that made me laugh out load.
I can't say how because it just wouldn't make sense.
For example:
This would be most remarkable, if so, since the Hawking radiation in our own aeon would normally be regarded as being such an absurdly tiny effect that it would be completely unobservable!
Made me laugh out loud.
Somehow I think that admitting that has tarred me as a "strange person."

Sigh.
I need to go back and get my head around those equations and the new ones.
Symmetry, phase space, pressure-less fluids, FLRW, de Sitter and what not.

Like Roy Batty I yell "Time! I need more time damn you!"

Sinatra up and running

Just got the Amazon message that the book will be arriving shortly!
Bloody brilliant.

Oh and even more absolutely brilliant is that I got a comment from one of the authors telling me that it was now in print.

Thank you very, very much Konstantin (if it's ok to use your first name...).
I really appreciate that you took the time to comment.
I must apologise for my previous comments and hope you didn't take them too personally.

Ah. It feels good to be a dinosaur sometimes...

This weekend we need to do some shopping.
Went to our local shopping centre.
Gathered all the required consumerist items and headed to the checkout.

Pandemonium.

Massive queues.
Oh well. Might as well join a queue.
Got to the payment part.

Initialise 191.
Initialise 191.
Initialise 191.

All lines down.
No EFTPOS.
Ah.
So we got taken to the service desk along with tons of other people.
Oh the joy of it when the local manager figured out we had to use the old swipey card things.
Oh, and had to use PAPER!

I soooo remember the first time I did the CLUNK-CLUNK!
Late 70's I think.

He couldn't figure it out.
Completely lost.
And the poor girl behind the counter was completely dumb struck.
Had never seen one of the machines and was completely out of her depth without the computer.
She had that rabbit in the headlights look.
I will remember that look for the rest of my life and thank evolution I have lived from not even having plastic through to the day when a young girl didn't know how to use a machine that was new to me when I had been in the workforce for 10 years!

I showed her in detail how to place my card in the slot and the piece of paper into the machine and how to CLUNK-CLUNK the slider back and forth.
And the queue behind me was getter bigger by the second.
Poor girl.
She looked like she'd just been handed a quill and ink pot.

Sigh.
We're doomed I tell you.
DOOMED!

Friday, 2 December 2011

Interesting News for Today (by K)

IT/Tech:
Dell Open-Sources Code for Hadoop Deployment Tool
DataSift Architecture: Realtime Datamining At 120,000 Tweets Per Second
Node.js and MongoDB for Java developers
Log Analysis System Using Hadoop and MongoDB
MongoDB, E-Commerce, and Transactions
Sinatra: Up and Running (New Book from O'Reilly)
Cut and Polish: A Guide to Crafting Gems
Ruby Blocks as Dynamic Callbacks
The State of Ruby ORMs
Xavier Shay's DataMapper Retrospective
Building a Rails Plugin with Tested Assets (Screencast)
Methadone - Build Better Ruby-based CLIs with Logging and Cucumber Support
OS X 10.5 Leopard may lose Firefox in 2012
Apple responds after Siri abortion answers debacle
The 5 Best Spotify Apps (So Far)
End of an Era: Chrome Surpasses Firefox
Aleph One 1.0 Released
Red Hat's Linux Changes Raise New Questions
Ruby Clouds: Engine Yard Vs. Heroku
Samsung's mSATA PM830 is eight grams of pure SSD
Intel Working On Augmented Reality Chip
Tyranny of the Tools
Ivo – a reimagined Unix terminal system
RESTful Web Service Discoverability, part 4

Business/Finance:
Can the 'badly-designed' euro fail?
New Google shipping service to go after Amazon Prime?
MTV in talks to license Vevo videos
Amazon favors online sales tax--if smaller rivals also have to pay
Apple TV sets will be mighty pricey, analyst says
Mark Zuckerberg passes 10 million subscribers on Facebook
Robin Williams offers Apple advice on how to make Siri even better
Fugazi Launches Massive Archive of Past Shows
Dwolla Drops Fees For Transactions Under $10 In Prelude To Larger Announcement
Khosla, Google Ventures And Hearst Put $4M In Social TV Platform Miso
Businessmen unveil plans for 'Muslim Facebook'

Politics:
New sanctions on Syria as deaths top 4000
Amnesty International calls for arrest of Bush during Africa trip over rights violations
Palestinians say Israel won’t offer peace proposal
UK embassy attack orchestrated by Iranian authorities: sources

Science:
Genetically Engineered Neurons Light Up When Firing
Fundamental constants are not constant—or maybe they are, we don't really know
The future cometh: Science, technology and humanity at Singularity Summit 2011 (Part I)
Measles outbreaks on the rise across Europe
Vegetables, fruits, grains reduce stroke risk in women
NASA satellite confirms sharp decline in pollution from US coal power plants
Japanese researchers turn a crab shell transparent
2012: Magnetic pole reversal happens all the (geologic) time
Affordable solar: It's closer than you think

Neat/Cool:
Spy centre seeking codebreakers
Superman comic sells for $2.16m
Teaching kids to be rich
Beware the vain robot
Bite-size Kilobots robots ready to swarm
Steampunk Contraptions Take Over Tattoo Studio
Fire Burns Differently In Space
30 Years of the BBC Micro
Nissan demonstrates Leaf-powered Smart House, we go hands-on
Geeks lose minds, recreate first level of Super Mario Land with 18 million Minecraft blocks
Voyagers travel far enough to see our own galaxy without the Sun's interference
David Yates on the planned Doctor Who movie, and fan pressure
Hi-res pictures appear for Ridley Scott’s Prometheus
AT-AT Wine Cabinet Defends Your Drinks From Rebel Scum
'Just chill?' Relaxing can make you fatter

WTF?
Man found dead in sewage tank
Afghan rape victim may marry attacker
Woman watches partner die on Skype
Strikers should be shot: Top Gear's Clarkson
Clarkson sorry for strike shooting remark
Ranting Apple employee 'deserved to be sacked'
ACLU raps Apple over Siri, abortion
Mini-Nukes, Flying 'Terminators' and 8 More Wild Weapons
Feds' Anti-Piracy Vid Is Digital-Age Reefer Madness
Man on vacation confused for a Russian spy, almost restarts cold war
Aliens on Ice

Thursday, 1 December 2011

Hosting multiple Jetty instances each with multiple ports!


I had a requirement to fulfill.
On the web tier I needed multiple instances of Jetty.
Each of these must have each webapp running on a different port.
And on the app tier the same.

So for example:
web tier:
  /opt/jetty91xx
    web-app-1 running on port 9101
    web-app-2 running on port 9102
    web-app-3 running on port 9103
  /opt/jetty92xx
    web-app-4 running on port 9201
    web-app-5 running on port 9202
    web-app-6 running on port 9203
app tier:
  /opt/jetty94xx
    web-app-7 running on port 9401
    web-app-8 running on port 9402
    web-app-9 running on port 9403
  /opt/jetty95xx
    web-app-10 running on port 9501
    web-app-11 running on port 9502
    web-app-12 running on port 9503
It's not as fiddly as that in reality, but the reason was to have sets of apps running in the same VM that are 'associated'.

So... How to do it?

Easy.
I'll use the jetty91xx example for the explanation below.

First go get the latest release of jetty and unpack it into /opt/jetty-latest or whatever.
Then create /opt/jetty91xx and copy the entire contents of /opt/jetty-latest into it effectively creating a clone.
So now we switch the /opt/jetty91xx.
(If you're on Mac OS-X you need to do a "mkdir work" in the folder to avoid OS-X /tmp/nasties)
Edit the etc/jetty.xml.
Part the way down is an <call name="addConnector">...</call>.
Comment this out.
Above it add this:
<set name="connectors">
  <array type="org.eclipse.jetty.server.Connector">
    <item>
      <new class="org.eclipse.jetty.server.nio.SelectChannelConnector" id="conn9101">
        <set name="port">9101</set>
        <set name="maxIdleTime">30000</set>
        <set name="Acceptors">1</set>
        <set name="name">conn9101</set>
      </new>
    </item>
    <item>
      <new class="org.eclipse.jetty.server.nio.SelectChannelConnector" id="conn9102">
        <set name="port">9102</set>
        <set name="maxIdleTime">30000</set>
        <set name="Acceptors">1</set>
        <set name="name">conn9102</set>
      </new>
    </item>
    <item>
      <new class="org.eclipse.jetty.server.nio.SelectChannelConnector" id="conn9103">
        <set name="port">9103</set>
        <set name="maxIdleTime">30000</set>
        <set name="Acceptors">1</set>
        <set name="name">conn9103</set>
      </new>
    </item>
  </array>
</set>
Ok. Your connectors are in and named.
Now go off and prepare your war files.
For simple example purposes I will assume you have port.9100.war, port.9101.war and port.9102.war.
Create contexts/port.9101.xml and put this in it:
<configure class="org.eclipse.jetty.webapp.WebAppContext">
  <set name="contextPath">/port.9101</set>
  <set name="war"><systemproperty default="." name="jetty.home">/webapps/port.9101.war</systemproperty></set>
  <set name="extractWAR">true</set>
  <set name="copyWebDir">false</set>
  <set name="defaultsDescriptor"><systemproperty default="." name="jetty.home">/etc/webdefault.xml</systemproperty></set>
  <set name="connectorNames"><array type="String"><item>conn9101</item></array></set>
</configure>
Create contexts/port.9102.xml and contexts/port.9103.xml in the same manner changing the contextPath, war name and connectorNames.

Now start the instance:
/usr/bin/java -Djetty.home=/opt/jetty91xx -Djava.io.tmpdir=/tmp \
  -Xms1024M -Xmx1024M -Xmn640M -Xss128k \
  -XX:ParallelGCThreads=4 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC \
  -XX:+CMSIncrementalMode -XX:SurvivorRatio=8 \
  -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=31 \
  -Dcom.sun.management.jmxremote.port=9876 \
  -Dcom.sun.management.jmxremote.ssl=false \
  -Dcom.sun.management.jmxremote.authenticate=false \
  -DOPTIONS=server,security,servlet,xml,webapp,deploy,jmx,requestlog \
  -jar /opt/jetty91xx/start.jar \
  --pre=etc/jetty-logging.xml \
  --daemon
You will need to change -Djetty.home and the '-jar' option for each instance.
Also I've given a full path here with a bunch of options.
Normally you would use /etc/init.d/jetty91xx.sh start of course.
Tip: While trying this out, leave of the --daemon and you can stop and start jetty by using ^c.

Ok. You should be able to drop the 3 war files into the webapps folder now.
And then...
http://[whatever]:9101/port.9101
  http://[whatever]:9102/port.9102
  http://[whatever]:9103/port.9103
And they'll all be running in the same VM.

You can then create a new /opt/jetty92xx and start agin.