<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8498085296674567933</id><updated>2011-07-08T17:30:11.296+01:00</updated><category term='space'/><category term='jokes'/><category term='technology'/><category term='web app'/><category term='ignorance'/><category term='Kepler'/><category term='ivory tower'/><category term='AJAX'/><category term='procrastinate'/><category term='climate'/><category term='motion chart'/><category term='CERN'/><category term='equilibrium'/><category term='openflux'/><category term='physics'/><category term='beauty'/><category term='evil'/><category term='mashup'/><category term='gapminder'/><category term='facebook'/><category term='gauss'/><category term='black hole'/><category term='theory'/><category term='SETI'/><category term='E8'/><category term='REST'/><category term='maths'/><category term='programming'/><category term='tutorial'/><category term='LHC'/><category term='degrafa'/><category term='games'/><category term='equations'/><category term='bbc'/><category term='API'/><category term='simplexml'/><category term='PHP'/><category term='comet'/><category term='Higgs'/><category term='KoL'/><category term='euler'/><category term='twitter'/><category term='credit crunch'/><category term='time travel'/><category term='marketing'/><category term='model'/><category term='TED'/><category term='capitalism'/><category term='OS'/><category term='google'/><title type='text'>World Of Ones</title><subtitle type='html'>Introduction to the world of maths, computers, code, science and technology, truth and education.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-152770732445748095</id><published>2009-08-14T22:24:00.004+01:00</published><updated>2009-08-14T23:11:42.024+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OS'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='jokes'/><title type='text'>How to Shoot Yourself in the Foot</title><content type='html'>The ideosynchracities of various programming languages, exposed through a crude metaphor. This joke has been around for a while, but I'm surprised to hear of some people who work with computers who haven't heard some of them yet..&lt;br /&gt;&lt;br /&gt;So - for the benefit of those folk and others,  here are a selection of some of my favorites.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;C&lt;/span&gt;&lt;br /&gt;You shoot yourself in the foot.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;C++&lt;/span&gt;&lt;br /&gt;You accidently create a dozen instances of yourself and shoot them         all in the foot. Providing emergency medical assistance is impossible         since you can't tell which are bitwise copies and which are just         pointing at others and saying "That's me, over there."&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;ASP.NET&lt;/span&gt;&lt;br /&gt;Find a gun, it falls apart. Put it back together, it falls apart again. You try using the .GUN Framework, it falls apart. You stab yourself in the foot instead.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Perl&lt;/span&gt;&lt;br /&gt;You shoot yourself in the foot, but nobody can understand how you did it. Six months later, neither can you.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;JavaScript&lt;/span&gt;&lt;br /&gt;You've perfected a robust, rich user experience for shooting yourself in the foot. You then find that bullets are disabled on your gun.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Forth&lt;/span&gt;&lt;br /&gt;Foot yourself in the shoot.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;APL&lt;/span&gt;&lt;br /&gt;You shoot yourself in the foot; then spend all day figuring out how         to do it in fewer characters.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;PHP&lt;/span&gt;&lt;br /&gt;You shoot yourself in the foot using bits of other guns you found on the web.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Brainfuck&lt;/span&gt;&lt;br /&gt;+++[&gt;--&gt;+&gt;-&lt;&lt;&lt;]&gt;.-----&gt;+.&gt;[&gt;----&lt;].+++&lt;---&gt;[-].&lt;--.&lt;br /&gt;That took so long to get right, you must have shot yourself in the foot at least once by now.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Ruby&lt;/span&gt;&lt;br /&gt;Your foot is ready to be shot, but you just can't find anywhere to shoot it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Assembly&lt;/span&gt;&lt;br /&gt;You crash the OS and overwrite the root disk. The system         administrator arrives and shoots you in the foot. After a moment of         contemplation, the administrator shoots himself in the foot and then         hops around the room rabidly shooting at everyone in sight.        &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;MUMPS&lt;/span&gt;&lt;br /&gt;You shoot 583149 AK-47 teflon-tipped, hollow-point, armour-piercing         bullets into even-numbered toes on odd-numbered feet of everyone in the         building -- with one line of code. Three weeks later you shoot yourself         in the head rather than try to modify that line.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Java&lt;/span&gt;&lt;br /&gt;You locate the &lt;code&gt;Gun&lt;/code&gt; class, but discover that the &lt;code&gt;Bullet&lt;/code&gt;         class is abstract, so you extend it and write the missing part of the         implementation. Then you implement the &lt;code&gt;&lt;i&gt;ShootAble&lt;/i&gt;&lt;/code&gt;         interface for your foot, and recompile the &lt;code&gt;Foot&lt;/code&gt; class. The         interface lets the bullet call the &lt;code&gt;doDamage&lt;/code&gt; method on the         &lt;code&gt;Foot&lt;/code&gt;, so the &lt;code&gt;Foot&lt;/code&gt; can damage itself in the         most effective way. Now you run the program, and call the &lt;code&gt;doShoot&lt;/code&gt;         method on the instance of the &lt;code&gt;Gun&lt;/code&gt; class. First the &lt;code&gt;Gun&lt;/code&gt;         creates an instance of &lt;code&gt;Bullet&lt;/code&gt;, which calls the &lt;code&gt;doFire&lt;/code&gt;         method on the &lt;code&gt;Gun&lt;/code&gt;. The &lt;code&gt;Gun&lt;/code&gt; calls the &lt;code&gt;hit(Bullet)&lt;/code&gt;         method on the &lt;code&gt;Foot&lt;/code&gt;, and the instance of &lt;code&gt;Bullet&lt;/code&gt;         is passed to the &lt;code&gt;Foot&lt;/code&gt;. But this causes an &lt;code&gt;IllegalHitByBullet&lt;/code&gt;         exception to be thrown, and you die.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;csh&lt;/span&gt;&lt;br /&gt;You can't remember the syntax for anything in this language, so you spend five hours         reading manual pages, then your foot falls asleep. You shoot the         computer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Lisp&lt;/span&gt;&lt;br /&gt;You shoot yourself in the appendage which holds the gun with which         you shoot yourself in the appendage which holds the gun with which you         shoot yourself in the appendage which holds...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;SQL&lt;/span&gt;&lt;br /&gt;INSERT INTO Foot        &lt;br /&gt;SELECT Bullet        &lt;br /&gt;FROM Gun.Hand        &lt;br /&gt;WHERE Chamber = 'loaded'        &lt;br /&gt;AND Trigger = 'pulled'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Genetic Algorithms&lt;/span&gt;&lt;br /&gt;You create 10,000 strings describing the best way to shoot yourself         in the foot. By the time the program produces the optimal solution,         humans have evolved wings.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;CSP&lt;/span&gt;&lt;br /&gt;You merely fail to shoot everything that isn't your foot.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Fortran&lt;/span&gt;&lt;br /&gt;You shoot yourself in each toe, iteratively, until you run out of toes, then you read in the next foot and repeat. If you run out of bullets, you continue anyway because you have no exception processing ability.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Modula/2&lt;/span&gt;&lt;br /&gt;After realizing that you can't actually accomplish anything in the language, you shoot yourself in the head.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;370 JCL&lt;/span&gt;&lt;br /&gt;You send your foot down to MIS with a 4000 page document explaining how you want it to be shot. Three years later, your foot comes back deep fried.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Hypertalk&lt;/span&gt;&lt;br /&gt;Put the first bullet of the gun into foot left of leg of you. Answer the result.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;BASIC&lt;/span&gt;&lt;br /&gt;Shoot self in foot with water pistol. On big systems, continue until entire lower body is waterlogged.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;COBOL&lt;/span&gt;&lt;br /&gt;USEing a COLT45 HANDGUN, AIM gun at LEG.FOOT, THEN place ARM.HAND.FINGER on HANDGUN.TRIGGER, and SQUEEZE. THEN return HANDGUN to HOLSTER. Check whether shoelace needs to be retied.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;~~~~~~~~~&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Okay, it seems it works for OS too:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Unix&lt;/span&gt;&lt;br /&gt;You shoot yourself in the foot.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;DOS&lt;/span&gt;&lt;br /&gt;Cannot locate foot. Bad command or sight line.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;AMIGA-DOS&lt;/span&gt;&lt;br /&gt;It's a nice gun, but nobody's made bullets for it for over a decade.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Windows 3.1&lt;/span&gt;&lt;br /&gt;You have a gun selecter, bullet pop-up help, and shooting sound effects - but you're unable to open shoot.dll...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Windows 95&lt;/span&gt;&lt;br /&gt;Your gun is not compatible with these bullets and you must install an upgrade before you can continue. Then you will be informed that         you don't have enough memory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Windows Vista&lt;/span&gt;&lt;br /&gt;Warning: Shooting yourself in the foot could potentially damage your foot. Are you sure you want to do this?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Windows 7&lt;/span&gt;&lt;br /&gt;This gun does not come with bullets. Our marketing campaign will however recommend that you download bullets directly from us, maintaining our monopoly on both guns and bullets.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;~~~~~~~~~&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some of these I wrote myself, some have been around longer than I have! Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-152770732445748095?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/152770732445748095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/08/how-to-shoot-yourself-in-foot.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/152770732445748095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/152770732445748095'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/08/how-to-shoot-yourself-in-foot.html' title='How to Shoot Yourself in the Foot'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-8780920644307023999</id><published>2009-05-14T19:52:00.006+01:00</published><updated>2009-05-14T20:26:27.858+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='time travel'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Back to the Future</title><content type='html'>One point&lt;span style="font-size:85%;"&gt; &lt;span style="font-size:100%;"&gt;twenty&lt;/span&gt;&lt;/span&gt; one gigaWatts!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Time_travel"&gt;Time travel&lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;span style="font-size:85%;"&gt;.&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;Okay, so here's the deal. There's really nothing in the laws of physics which explicity prevent it under any circumstance. In fact, there's an abundance of loopholes and nifty tricks you can theoretically perform using current theories and exotic measures.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;First, the future. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is easy. &lt;span style="font-weight: bold;"&gt;Einstein's Theory of Special Relativity&lt;/span&gt; tells us (and this is totally 100% true) that the faster things move, the heavier they get, the thinner they get, and &lt;span style="font-style: italic;"&gt;they experience less time than someone standing still&lt;/span&gt;. This effect is only really noticable when you get near to light speed.&lt;br /&gt;&lt;br /&gt;So, you could zoom around in a spaceship at say 90% of the speed of light, return to Earth one year later - but you'd find it was actually &lt;span style="font-style: italic;"&gt;two&lt;/span&gt; years later on Earth! The faster you go, the further you travel forward in time relative to everyone else.&lt;br /&gt;&lt;br /&gt;Of course, going that fast takes a huge amount of energy, and the faster you go, the harder it gets to go faster. You can't reach light speed. So it'd generally be better to not have to go so fast in order to travel forwards. Thanks to &lt;span style="font-weight: bold;"&gt;Einstein's Theory of General Relativity&lt;/span&gt; - we don't have to. Instead, we &lt;span style="font-style: italic;"&gt;bend&lt;/span&gt; space-time around ourselves to get a similar effect.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Gravity_well_plot.svg/600px-Gravity_well_plot.svg.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 349px; height: 133px;" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Gravity_well_plot.svg/600px-Gravity_well_plot.svg.png" alt="" border="0" /&gt;&lt;/a&gt;This is what's known as a &lt;span style="font-weight: bold;"&gt;gravity well&lt;/span&gt;. All matter &lt;span style="font-style: italic;"&gt;bends&lt;/span&gt; space-time around it, and the more of it you get in one place (density), the steeper the sides of the well. If you could compact, say, a large planet like Jupiter down to... about the size of the Atomium in Brussels, then get inside - you'd get a very similar effect.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/en/3/34/Atomium_20-08-07.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 241px; height: 224px;" src="http://upload.wikimedia.org/wikipedia/en/3/34/Atomium_20-08-07.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;A lot of time travel tricks revolve around bending this space-time membrane in such a way that our normal everyday view of the world becomes warped, and things that seem completely impossible are in fact the only mathematically valid solution. We've demonstrated the future, is easy enough, but what about the past?&lt;br /&gt;&lt;br /&gt;Coming Soon: Back To The Future II - wormholes, cosmic strings and other cheap tricks&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;CovertHolistic&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-8780920644307023999?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/8780920644307023999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/05/back-to-future.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8780920644307023999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8780920644307023999'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/05/back-to-future.html' title='Back to the Future'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-7492372364371220344</id><published>2009-05-10T13:31:00.006+01:00</published><updated>2009-05-10T15:18:22.859+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='maths'/><category scheme='http://www.blogger.com/atom/ns#' term='beauty'/><category scheme='http://www.blogger.com/atom/ns#' term='euler'/><category scheme='http://www.blogger.com/atom/ns#' term='gauss'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='equations'/><title type='text'>The Most Beautiful Equations</title><content type='html'>Sometimes mathematics is beautiful. It's a hard thing to observe; you need to peer through various mystifying levels of symmetries and distractions, until you finally arrive at that most elusive moment where you suddenly realise it's all &lt;span style="font-style: italic;"&gt;really simple.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Many of the greatest equations, theories and postulates have relied on the power of their beauty. Einstein's E=mc&lt;sup&gt;2&lt;/sup&gt; has entered the public consciousness like no other, while many others intrigued and delighted the scientific community without much publicity.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Gauss&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/math/1/c/f/1cf508d37b85da89fddbc6b3edb0d480.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 158px; height: 39px;" src="http://upload.wikimedia.org/math/1/c/f/1cf508d37b85da89fddbc6b3edb0d480.png" alt="" border="0" /&gt;&lt;/a&gt;Gauss's integral for example, reduces this technically baffling integral to a silly and simple number - albeit one which goes on forever.. 1.772453850905516027298167483314...&lt;br /&gt;&lt;br /&gt;Comprehending the lateral method used to solve this problem was a major moment in my scientific education. The solution appears to be infinitely unsolvable, if you think of 'x' being a straight line, which as far as any really grasped, was mostly what integration seemed to be about.&lt;br /&gt;&lt;br /&gt;However, if you instead think of this problem in two equal dimensions, you can bend the co-ordinates into a circle. Suddenly, as the circle closes, the difficult bit drops off and you can solve the bugger easily to get 1.77...&lt;br /&gt;&lt;br /&gt;This identity is used heavily in quantum mechanics, in fact - the whole field is underpinned by the kind of logic used in this solution.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Euler&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Euler also used circles to describe other strange and useful numbers. Imagine a second hand travelling round the clock face. Imagine a straight line drawn from 9 to 3. The question is, how far away from that line is the tip of the second hand, as it travels round? If you plot a graph of that distance against time, you'll get a sine wave:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://webpages.ursinus.edu/rliston/cs173/sine.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 219px; height: 149px;" src="http://webpages.ursinus.edu/rliston/cs173/sine.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If you instead imagine a straight line between 12 and 6, and plot that, you'll get the same thing, except the start point will be a quarter of a circle further round. These two waves, one '3 hours' out of &lt;span style="font-style: italic;"&gt;phase&lt;/span&gt; with the other, are called &lt;span style="color: rgb(153, 0, 0);"&gt;sin&lt;/span&gt; and &lt;span style="color: rgb(153, 0, 0);"&gt;cos&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;We would usually use an angle called a radian instead of the clock metaphor. A clock has 12 hours, a circle has &lt;span style="color: rgb(153, 0, 0); font-weight: bold;"&gt;2π&lt;/span&gt; radians - twice the number π. So the two waves are &lt;span style="color: rgb(153, 0, 0);"&gt;π/2&lt;/span&gt; ( 2π / 4 ) out of phase, and the two waves are &lt;span style="color: rgb(153, 0, 0);"&gt;sin&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;θ&lt;/span&gt;&lt;/span&gt; and &lt;span style="color: rgb(153, 0, 0);"&gt;cos&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;θ&lt;/span&gt; where &lt;span style="color: rgb(153, 0, 0); font-weight: bold;"&gt;θ&lt;/span&gt; revolves all the way around from 0 to 2π, like the hand making a full revolution.&lt;br /&gt;&lt;br /&gt;Euler showed us that you can treat sin and cos as really the same things, if you use something called an &lt;span style="font-style: italic;"&gt;imaginary number&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Okay, I'm thinking of a number. What is it? "Well.. " you say, "it could be anywhere between zero and infinity!" What about negative numbers? "Well, minus infinity to infinity then!".&lt;br /&gt;&lt;br /&gt;And you'd have me there. But suppose instead I was thinking of &lt;span style="font-style: italic;"&gt;the square of&lt;/span&gt; a number, there'd be no point guessing a negative number because any number, positive or negative, gives you a positive number when you square it. In fact, if someone claims they've thought of one, well, it can't be &lt;span style="font-style: italic;"&gt;real&lt;/span&gt; can it? No &lt;span style="font-style: italic;"&gt;real&lt;/span&gt; numbers do that! Must be some kind of..&lt;span style="font-style: italic;"&gt; imaginary&lt;/span&gt; number, hah!&lt;br /&gt;&lt;br /&gt;In mathematics, existing and being real thankfully don't have to mean the same thing, so we can imagine numbers which exist but aren't real. They'll actually really useful, and in fact have a lot to do with circles, and waves, and lots of really geeky physics stuff.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://schools-wikipedia.org/images/177/17797.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 300px; height: 294px;" src="http://schools-wikipedia.org/images/177/17797.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Don't worry if that's a bit confusing, The point is, when you combine in the radian idea, the sin and cos, the imaginary number idea, and the &lt;a href="http://betterexplained.com/articles/an-intuitive-guide-to-exponential-functions-e/"&gt;exponential&lt;/a&gt; (I won't go into that here - check the link at &lt;a href="http://betterexplained.com/"&gt;betterexplained.com&lt;/a&gt;) you arrive at the most startlingly simple statement:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.informath.org/EulerId.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 252px; height: 63px;" src="http://www.informath.org/EulerId.jpg" alt="" border="0" /&gt;&lt;/a&gt;This, I believe, is the most beautiful equation. The soaring exponential, the elusive imaginary, the reliable circle, the triumphant '1', then equality to nothing. It's the poetry of the universe, and it's just the first line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-7492372364371220344?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/7492372364371220344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/05/most-beautiful-equations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/7492372364371220344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/7492372364371220344'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/05/most-beautiful-equations.html' title='The Most Beautiful Equations'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-7903041993734689095</id><published>2009-05-07T19:33:00.002+01:00</published><updated>2009-05-07T22:39:25.598+01:00</updated><title type='text'>Learn PHP - 10 Things for a Beginner</title><content type='html'>I've been ranting about PHP quite a bit, demonstrating some of the ways I've used it in mashups and applications. I love it, because it's a great glue for ramming different bitz 'n' bobs into each other using the mimimum fuss.&lt;br /&gt;&lt;br /&gt;I seem to have vomited scripts a bit too much, and thought it would be a good idea to get back to basics for anyone who doesn't know PHP but fancies learning - 10 simple things about it:&lt;br /&gt;&lt;br /&gt;1 -- Variables! Put a dollar sign in front of any word. You'll need lots to hold all the data, e.g. &lt;span style="color: rgb(153, 0, 0);"&gt;$day&lt;/span&gt; for what day it is,&lt;span style="color: rgb(153, 0, 0);"&gt; $xml&lt;/span&gt; to hold an xml string, &lt;span style="color: rgb(153, 0, 0);"&gt;$salesLastWeek&lt;/span&gt; for.. you get the idea..&lt;br /&gt;&lt;br /&gt;2 -- Arrays are variables that can hold lots of data - for example, an array $week which has seven values, the days of the week. So &lt;span style="color: rgb(153, 0, 0);"&gt;$week[0]&lt;/span&gt; is 'Sunday', &lt;span style="color: rgb(153, 0, 0);"&gt;$week[1]&lt;/span&gt; is 'Monday', or whatever you want really.&lt;br /&gt;&lt;br /&gt;3 -- IF. If this, do that. If this, do that, if not, then if these, those, otherwise die. Or rather,&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;if($this == $everything)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt; $answer = that($it);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;else if ($these == $those)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt; $answer = "those";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt; die();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or something along those lines...&lt;br /&gt;&lt;br /&gt;4 -- Say Hello! echo makes stuff come out the other end. &lt;span style="color: rgb(153, 0, 0);"&gt;echo "Hello World!";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5 -- Instead of IF you can SWITCH.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;switch ($today) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  case 'Saturday'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;     $txt = "I told those fucks down at the league office &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  a thousand times that I don't roll on Shabbos!  ";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  case 'Friday'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;     $ txt = "cause it's Friday; you ain't got no job... and you ain't got shit to do."; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  default&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  $txt = "I can't think of a funny quote.";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6 -- So what day is it?&lt;a href="http://w3schools.com/php/func_date_idate.asp"&gt; idate&lt;/a&gt; gives you the bits you need. So:&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt; echo(idate("Y")); &lt;/span&gt;&lt;br /&gt;gives you the current year ie. 2009, and use a w intead of Y to get the day of the week. Sunday = 0 etc.&lt;br /&gt;&lt;br /&gt;7 -- Make some IFS.&lt;br /&gt;Greater than: &lt;span style="color: rgb(153, 0, 0);"&gt;if ($it &gt; 45) { do_it($it); }&lt;/span&gt;&lt;br /&gt;Or: &lt;span style="color: rgb(153, 0, 0);"&gt;if ($one &gt; 1 || $two == 3) (do_something($one, $two); }&lt;/span&gt;&lt;br /&gt;And is &lt;span style="color: rgb(153, 0, 0);"&gt;&amp;amp;&amp;amp;&lt;/span&gt;. Not is&lt;span style="color: rgb(153, 0, 0);"&gt; !&lt;/span&gt;, as in&lt;span style="color: rgb(153, 0, 0);"&gt; if (!$it &gt; 45)&lt;/span&gt;, otherwise known as &lt;= 45. &lt;br /&gt;&lt;br /&gt;8. Do Something. That was a function. You can tidy up your code by making bits of it functions. Particularily bits you use a lot or things that feel seperate.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;function do_something($one, $two) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$one.$two+12;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There. Now we can "do something" with $one and $two. The dot makes the variables write next to each other.  So if $one = 1, and $two = 2, we get 12+12 = 24 when we say:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;do something($one, $two);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;9 --&lt;a href="http://w3schools.com/php/php_xml_simplexml.asp"&gt; SimpleXML&lt;/a&gt;. I work with data, and lots of data is XML. $xml = simplexml_load_file($file);&lt;br /&gt;&lt;br /&gt;10 -- FOREACH - one of my favourite words. You can &lt;a href="http://w3schools.com/php/php_looping.asp"&gt;loop&lt;/a&gt; through each item in an array, or each node in an XML file. Check the link, as always &lt;a href="http://w3schools.com/php/default.asp"&gt;w3schools&lt;/a&gt; is an excellent source for basic PHP reference.&lt;br /&gt;&lt;br /&gt;There you have it! Did anyone learn anything? Let me know!&lt;br /&gt;&lt;br /&gt;--CovertHolistic&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-7903041993734689095?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/7903041993734689095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/05/learn-php-10-things-for-beginner.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/7903041993734689095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/7903041993734689095'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/05/learn-php-10-things-for-beginner.html' title='Learn PHP - 10 Things for a Beginner'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-436032529506507473</id><published>2009-05-02T16:14:00.006+01:00</published><updated>2009-05-02T17:22:20.285+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web app'/><category scheme='http://www.blogger.com/atom/ns#' term='gapminder'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='motion chart'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Please mind the gap between the software and the platform</title><content type='html'>Excuse the awful pun. &lt;a href="http://www.gapminder.org/"&gt;Gapminder.org&lt;/a&gt; developed this really neat graphical flash engine back in 2006, Google were quick to snap it up the following year, and have also been so graciously kind as to publish an API for it under the guise of &lt;a href="http://code.google.com/apis/visualization/documentation/gallery/motionchart.html"&gt;Motion Chart&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8S6e-Nrexto/SfxlSjRGvWI/AAAAAAAAABA/FN7kHqoxqtM/s1600-h/motionchartexample.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 171px;" src="http://3.bp.blogspot.com/_8S6e-Nrexto/SfxlSjRGvWI/AAAAAAAAABA/FN7kHqoxqtM/s320/motionchartexample.png" alt="" id="BLOGGER_PHOTO_ID_5331247428278861154" border="0" /&gt;&lt;/a&gt;You can &lt;a href="http://code.google.com/apis/visualization/documentation/gallery/motionchart.html"&gt;use&lt;/a&gt; this engine freely to include whatever data you want, though getting data in and out can be a pain, if, like me, you want to enable non-programmers to experiment with their own data.&lt;br /&gt;&lt;br /&gt;So, the first step might be reconfiguring the source from explicit javascript declarations, to something a little more familiar - xml. I used a structure like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;bubbleXml&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;          &amp;lt;title&amp;gt;Hello, this is my first motion chart!&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        &amp;lt;dataContainer&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                   &amp;lt;dataRow&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                          &amp;lt;WeekNo&amp;gt;&lt;span style="font-weight: bold;"&gt;1&lt;/span&gt;&amp;lt;/WeekNo&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                          &amp;lt;Category&amp;gt;&lt;span style="font-weight: bold;"&gt;Canned Fruit&lt;/span&gt;&amp;lt;/Category&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                          &amp;lt;Metrics&amp;gt;&lt;span style="font-weight: bold;"&gt;Items Sold&lt;/span&gt;&amp;lt;/Metrics&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                          &amp;lt;Value&amp;gt;&lt;span style="font-weight: bold;"&gt;17&lt;/span&gt;&amp;lt;/Value&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                  &amp;lt;/dataRow&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                  &amp;lt;dataRow&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                        &amp;lt;WeekNo&amp;gt;&lt;span style="font-weight: bold;"&gt;1&lt;/span&gt;&amp;lt;/WeekNo&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;              &amp;lt;Category&amp;gt;&lt;span style="font-weight: bold;"&gt;Canned Fruit&lt;/span&gt;&amp;lt;/Category&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                         &amp;lt;Metrics&amp;gt;&lt;span style="font-weight: bold;"&gt;Sales Value&lt;/span&gt;&amp;lt;/Metrics&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;                         &amp;lt;Value&amp;gt;&lt;span style="font-weight: bold;"&gt;23.78&lt;/span&gt;&amp;lt;/Value&amp;gt;&lt;/span&gt;&lt;br /&gt;and so on..&lt;br /&gt;&lt;br /&gt;Which gives you a nice extensible data platform, although it is quite verbose (duh.. it's xml!).&lt;br /&gt;Each dataRow captures the time variable (WeekNo), the entity names (Category), along with the name and value of each metric.&lt;br /&gt;&lt;br /&gt;You can then write a parser for the xml in your favourite scripting language, and embed the results into the javascript. Here's an example for PHP - verbatim:&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$xmlfile = "dataYouWantToUse.xml";&lt;br /&gt;$data = simplexml_load_file($xmlfile);&lt;br /&gt;&lt;br /&gt;$categories = $data-&amp;gt;xpath("dataContainer/dataRow/Category");&lt;br /&gt;$timestamp = $data-&amp;gt;xpath("dataContainer/dataRow/WeekNo");&lt;br /&gt;$values = $data-&amp;gt;xpath("dataContainer/dataRow/Value");&lt;br /&gt;$metrics = $data-&amp;gt;xpath("dataContainer/dataRow/Metrics");&lt;br /&gt;$title = $data-&amp;gt;xpath("title");&lt;br /&gt;&lt;br /&gt;$uCatN = count(array_unique($categories));&lt;br /&gt;$uTimeN = count(array_unique($timestamp));&lt;br /&gt;$uMet = array_unique($metrics);&lt;br /&gt;$uMetN = count(array_unique($metrics));&lt;br /&gt;$rowCount = $uCatN*$uMetN*$uTimeN-1;&lt;br /&gt;$googleCount = $uCatN*$uTimeN;&lt;br /&gt;&lt;br /&gt;function listColumns($uMet)&lt;br /&gt;{  &lt;br /&gt;       echo "\n";&lt;br /&gt;       foreach ($uMet as $thisMet) {&lt;br /&gt;                echo "\tdata.addColumn('number', \"$thisMet\");\n";&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;function generateJs($categories, $timestamp, $values, $rowCount, $uMetN)&lt;br /&gt;{  &lt;br /&gt;        echo "\n";&lt;br /&gt;        $c = 0;&lt;br /&gt;        for ($i=0; $i&amp;lt;=$rowCount; $i+=$uMetN) {&lt;br /&gt;                if ($timestamp[$i] &amp;lt; 10)&lt;br /&gt;                      $time = "0".$timestamp[$i];&lt;br /&gt;               else&lt;br /&gt;                      $time = $timestamp[$i];&lt;br /&gt;               echo "\tdata.setValue($c, 0, '$categories[$i]'); \n" ;&lt;br /&gt;               echo "\tdata.setValue($c, 1, '2009W$time'); \n" ;&lt;br /&gt;               for ($j=$i; $j&amp;lt;=$i+$uMetN-1; $j++) {&lt;br /&gt;                       $n = $j-$i+$uMetN-1;&lt;br /&gt;                        echo "\tdata.setValue($c, $n, $values[$j]); \n" ;&lt;br /&gt;                          }&lt;br /&gt;                  $c++;  &lt;br /&gt;              }  &lt;br /&gt;}  &lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&amp;gt;&lt;br /&gt; &amp;lt;head&amp;gt;&lt;br /&gt;   &amp;lt;title&amp;gt;&amp;lt;?php echo $title[0]; ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;   &amp;lt;script type="text/javascript" src="http://www.google.com/jsapi"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;   &amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;     google.load('visualization', '1', {'packages':['motionchart']});&lt;br /&gt;     google.setOnLoadCallback(drawChart);&lt;br /&gt;     function drawChart() {&lt;br /&gt;             var data = new google.visualization.DataTable();&lt;br /&gt;     &lt;br /&gt;             data.addRows(&amp;lt;?php echo $googleCount; ?&amp;gt;);&lt;br /&gt;             data.addColumn('string', 'Category');&lt;br /&gt;             data.addColumn('string', 'Time');    &lt;br /&gt;       &amp;lt;?php     listColumns($uMet);&lt;br /&gt;                generateJs($categories, $timestamp, $values, $rowCount, $uMetN); ?&amp;gt;&lt;br /&gt;     &lt;br /&gt;             var chart = new google.visualization.MotionChart(document.getElementById('chart_div'));&lt;br /&gt;            chart.draw(data, {width: 800, height:460});&lt;br /&gt;       }&lt;br /&gt;   &amp;lt;/script&amp;gt;&lt;br /&gt;   &amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;   body {text-align: center;}&lt;br /&gt;   &amp;lt;/style&amp;gt;&lt;br /&gt; &amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;body&amp;gt;&lt;br /&gt;         &amp;lt;h3&amp;gt;&amp;lt;?php echo $title[0]; ?&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;         &amp;lt;p&amp;gt; data in motion&amp;lt;/p&amp;gt;&lt;br /&gt;      &amp;lt;div id="chart_div"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;         &amp;lt;h5&amp;gt;&amp;lt;a href="http://worldofones.blogspot.com"&amp;gt;adam marshall 2009&amp;lt;/a&amp;gt; |    &amp;lt;a href="http://worldofones.blogspot.com"&amp;gt;worldofones.blogspot.com&amp;lt;/a&amp;gt; | &amp;lt;a  href="http://code.google.com"&amp;gt;powered by google&amp;lt;/a&amp;gt;&amp;lt;/h5&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;blockquote style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;Notes:&lt;br /&gt;That's set up to process time in the '2009W1' format - haven't got round to generalising that yet, but it's not too hard to modify if you want to use different formats. Likewise for the inclusion of text (colour category) metrics - you just need to modify the listColumns() function, and make sure you've got quotes around their values.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Phew! So, you can load that xml file directly into the page at runtime. Maybe you can get your IT guys to help making a current data source available as xml in this way; if not - here's a little script for converting a csv file to xml courtesy of &lt;/span&gt;&lt;a style="color: rgb(0, 0, 0);" href="http://www.bytemycode.com/snippets/snippet/448/"&gt;Chris M&lt;/a&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; over at &lt;/span&gt;&lt;a style="color: rgb(0, 0, 0);" href="http://www.bytemycode.com/"&gt;bytemycode.com&lt;/a&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, with just a few modifications to create the chosen format.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;// define params&lt;br /&gt;$containerLabel = "dataContainer";&lt;br /&gt;$rowLabel = "dataRow";&lt;br /&gt;$fileLocation = "csvdata/".$_GET["from"].".csv"; &lt;br /&gt;$fileDestination = "xmldata/".$_GET["to"].".xml"; &lt;br /&gt;$title = $_GET["title"];&lt;br /&gt;/**&lt;br /&gt;* Converts a grid layout CSV to an XML&lt;br /&gt;* Rows are nested within the container variable&lt;br /&gt;* Column headers in the CSV become tags containing the data, within each row&lt;br /&gt;*/&lt;br /&gt;function csv2xml($file, $container = 'data', $rows = 'row')&lt;br /&gt;{&lt;br /&gt;  $r = "\t&amp;lt;{$container}&amp;gt;\n";&lt;br /&gt;          $row = 0;&lt;br /&gt;          $cols = 0;&lt;br /&gt;          $titles = array();&lt;br /&gt;    &lt;br /&gt;          $handle = @fopen($file, 'r');&lt;br /&gt;          if (!$handle) return $handle;&lt;br /&gt;    &lt;br /&gt;          while (($data = fgetcsv($handle, 1000, ',')) !== FALSE) {&lt;br /&gt;                 if ($row &amp;gt; 0) $r .= "\t\t&amp;lt;{$rows}&amp;gt;\n";&lt;br /&gt;                 if (!$cols) $cols = count($data);&lt;br /&gt;                for ($i = 0; $i &amp;lt; $cols; $i++) {&lt;br /&gt;                          if ($row == 0) {&lt;br /&gt;                                    $titles[$i] = $data[$i];&lt;br /&gt;                                    continue;&lt;br /&gt;                             }&lt;br /&gt;                         $r .= "\t\t\t&amp;lt;{$titles[$i]}&amp;gt;";&lt;br /&gt;                          $r .= $data[$i];&lt;br /&gt;                          $r .= "&amp;lt;/{$titles[$i]}&amp;gt;\n";&lt;br /&gt;                   }&lt;br /&gt;                  if ($row &amp;gt; 0) $r .= "\t\t&amp;lt;/{$rows}&amp;gt;\n";&lt;br /&gt;                     $row++;&lt;br /&gt;               }&lt;br /&gt;       fclose($handle);&lt;br /&gt;       $r .= "\t&amp;lt;/{$container}&amp;gt;\n";&lt;br /&gt;       return $r;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$xml = csv2xml($fileLocation, $containerLabel, $rowLabel);&lt;br /&gt;$fullxml = '&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;'."\n&lt;br /&gt;&amp;lt;bubbleXml&amp;gt;\n\t&amp;lt;title&amp;gt;$title&amp;lt;/title&amp;gt;\n".$xml."&amp;lt;/bubbleXml&amp;gt;";&lt;br /&gt;file_put_contents($fileDestination,$fullxml);&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;I've added GET parameters to this, so if you had a csv file caled 'data1' in a folder on the server called 'csvdata', you can call using the parameters:&lt;/span&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(153, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;?from=data1&amp;amp;to=fileYouWantToUse&amp;amp;title=Hello, this is my first motion chart!&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;to create the xml file. Now, you should be able to use excel/analytics software/business intelligence tools to produce the csv, compile it to xml, and display it in a cool motion chart!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Why not show your CEO his company's history in motion, or your sales team the last few weeks of consumer trends?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-436032529506507473?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/436032529506507473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/05/please-mind-gap-between-software-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/436032529506507473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/436032529506507473'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/05/please-mind-gap-between-software-and.html' title='Please mind the gap between the software and the platform'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_8S6e-Nrexto/SfxlSjRGvWI/AAAAAAAAABA/FN7kHqoxqtM/s72-c/motionchartexample.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-768674432810532494</id><published>2009-04-09T22:28:00.003+01:00</published><updated>2009-04-09T23:37:06.256+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='maths'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='bbc'/><title type='text'>Mathematics, the Universe and Everything</title><content type='html'>A few weeks ago on Horizon, comedian Alan Davies went on a journey through time and space...&lt;br /&gt;&lt;br /&gt;Boosh. No, actually - maths.&lt;br /&gt;&lt;br /&gt;Marcus de Sautoy is an Oxford professor of mathematics; I've read through his book &lt;span style="font-style: italic;"&gt;The Music of the Primes&lt;/span&gt; several times and it's an inspiring read - flowing with the genius of a man who's not only able to see the numbers clearly, but who can vividly communicate the beauty of maths - it's immortality, it's infallibility, it's truth.&lt;br /&gt;&lt;br /&gt;Marcus was tasked with showing Alan this wonder, and convincing him that maths can actually be amazingly good fun! There's a common stereotype and cultural stigma associated with mathematics and the sciences, which you'll be familiar enough with that I shan't go into it.&lt;br /&gt;&lt;br /&gt;The problem is, that to understand/contribute to most of the fun stuff, you need to learn a lot of the really quite difficult stuff; this can require a certain mindset and it's not always obvious what the pay off is going to be for putting in the effort.&lt;br /&gt;&lt;br /&gt;The quick wins are the situations where you can demonstrate a fundamental and beautiful idea without using any of what most people would consider "maths". Marcus introduces Alan to a fourth dimension in space, using physical examples and discussion in the place of equations and laws. They then explore the shape of the universe, and describe some of the implications of Perelman's proof of the Poincaré Conjecture.&lt;br /&gt;&lt;br /&gt;[That's to do with how the entire universe can be finite, but still not have any "edges" - there's no magical "end of the universe", much to Douglas Adam's and Metron's disappointment...]&lt;br /&gt;&lt;br /&gt;The show is a wonderful insight into the true importance of mathematics, and seeing Marcus's energy and Alan's glee on grasping new concepts makes me proud to be a student of the sciences. More importantly, we end on the revelation that:&lt;br /&gt;&lt;br /&gt;The universe seems like it might be the icing on a four dimensional doughnut. Believe.&lt;br /&gt;&lt;br /&gt;Anyway, with luck it might still be on the iplayer - check it out!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-768674432810532494?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/768674432810532494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/04/mathematics-universe-and-everything.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/768674432810532494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/768674432810532494'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/04/mathematics-universe-and-everything.html' title='Mathematics, the Universe and Everything'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-3173461780737557764</id><published>2009-03-30T22:03:00.004+01:00</published><updated>2009-04-09T22:28:14.469+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><title type='text'>It's the "Aaargh! Facebook!" Post</title><content type='html'>I really don't know whether I should just totally delete my account -&lt;br /&gt;&lt;br /&gt;and spit vehemontly every time someone says the word, or -&lt;br /&gt;&lt;br /&gt;continue using it as an incredibly useful communication tool; everyone I know is on it, therefore, it's remarkably universal.&lt;br /&gt;&lt;br /&gt;I joined facebook "back in the good old days", and back then, it was a fairly simple business. It's great that it's become such a phenomena - but with the increased pressure from the media, marketing groups, affiliate programs, yadiyada.. I'm inclined to say I'm losing faith - slowly but surely.&lt;br /&gt;&lt;br /&gt;Currently I'm trying to teach the damn advertising bar that I don't like Hot Dates! or Twatty Mobile Phones! whereas Joni Mitchell tee-shirts and cheap flights to weird places are actually okay in my book, and I'm happy for them to appear in my space. It doesn't seem willing to co-operate.&lt;br /&gt;&lt;br /&gt;And that should be the whole point behind social marketing. There are things I'm interested in, for god's sake - just take the hint!&lt;br /&gt;&lt;br /&gt;Look Facebook - this is all like.. "Hmm! Super interesting!"&lt;br /&gt;&lt;a href="http://www.facebook.com/ac.php?i=6002296810207&amp;amp;meta=AAAAAQAQED8UFHzNnfxujBi1OgCbjgAAAzL_DGv2lvhXpdnFo3Np48BMrS5n1lJNiGLoZofuiLEX_FjKc2d5aghynTN-NPA4xQtPDvuAH4D5ndtMnJNXfy8FQ1Iqp3z3BGfnFwmkwXn06c9o2stcInwlIFxceiQ3AS4fQaF1Xm1OHGuSf0ZB9UQfMbhhMvpb6hGnlh3oszgkHxl8qX2c33BN55Z59YHOHop81eN98VGIsU_12l7pReRscCCkMEAXCzmPIdx8W2KLGrM3-8W8DfFWBFEjZo-304P6x_5-rhF-RRPo3_POv21yKLKXHuN-tPMnc2qtULzxknh9c4Gs6c1oFflnRewxQDGEWhZqVf115YVS32eX3QgQsqcseAF15E6OvZ221tKalXWROHl69rmijAZghCyRmVwwQKpOXg0NdSSWU_Xo76zpWcuwe022n5kgiKBRS0BQWTow8xYxZhkYjuajeKgmsPp-t9dHzVFef2QV25Sg1q9u_kBAFjBtsh3kD9z81rlvF6zn9R3dv2a8hWTVKitv6wwbsptrIQQl8gkVgj9KMqCI4x1I4fg31unbFlX4jziqSmKm6pUu8FfDNie_WoXSP5JjySGkLISTSdIX8z0PFxaw1WNEaXFBcq1aC_Gz2PxcF-h-E3yljuuPakMtZ84E5KM1sIoojveQlDCO7GvNlxyfodEsrxS-m_aCZos3xQMiBX1ydeY_gGI6ce1cWXNEWXKaWIrLo4JWOHh9c4Gs6c1o7oYaJ5ZB8RB5yFxMZft7Xv83wMDMpVWiWgvxs9j8XBdWch31VEy6GHd97uE43Z2CGlBEWAQZuRzkCNQ77rGHoq20Rjrg_lu_mNKTxI0QkbBfsdcJYLve87A6Q0cc3GKRhVLfZ5fdCBCCqPArbg2D3Z6oiUCUEvjfRPMdR-TMTbwvmgRrkhfpYrJ3bLO7cn3feF3vuZGuPG_LezrWJ3SeQFxd-e4vWXQ8Px1Yi2WtYTHwAFuqHd2Q0j7Pd8btvTYRJhjw_jeYiwf8wqo4XNCeLG_I0-W8vCet5_Hs1HL4Slzh3o61En4QpDZGbuE8HUEweH1zgazpzWjCwe6K6H38W0SQ_N9SjmnPYKiaRJ5g8g5sgR_53ZLewQ%2C%2C" class="ad_story ad_clickable"&gt;&lt;div class="social_ad_advert"&gt;&lt;div class="social_ad_advert_text"&gt;Mix Pink Floyd with Porcupine Tree. Add a little Blackfield and Nine Inch Nails. Hear Paul Cusick's début CD online now then decide.&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;&lt;br /&gt;Whereas this is all like "Fuck off Facebook!"&lt;br /&gt;&lt;div class="admarket_ad" id="adspace_ad_6002258763550"&gt;&lt;a href="http://www.facebook.com/ac.php?i=6002258763550&amp;amp;meta=AAAAAQAQbfD_Zlv7LYtOhzqS_gqxkAAAAxD_DGv2lvhXpdnFo3Np48BMrS5n1lJNiGIsPl6g4lIMyX--lqIE-9-9nTN-NPA4xQsFmbD_9_yMDttMnJNXfy8FQ1Iqp3z3BGdkNszDEE4MpJxvBd1xITdOhJUXfFIae5mo1eIFYjC_7mckNwBqs-WHknKkLOVk9_pypKDlaVidQ3Zd7YfUVnM9Z4wZX5rHD75ijAuJm2KeaHaDJivmbOtjFDVWI_Bq971e_T5ouTRPyowxPmE_pXU9t4sKDNhzwB5a0_O-OdQKrM8lDtB1DCy_2u7iigcl3HwBcyUxUQhhTjYnv1qF0j-SBK-6TVisVOdvUB6Iwm_QhcwOF_GpgHsqq2a2D5f3KvWC7gOutJ5iyn3k35K7IlVvM0kLSPuMXEEDM8rQny1ccI72t4H4QlYImhv4xdSgVRbeUFexoUNtMNYhf5A7t3cHLGU0HWmLnd_bAckff5JzNAxPqtoVF0VUguhTnCBBl6myisC7I8Ps2PU3H1jmVS67xt9wUTsypMwZxQEdZcPnOoVS32eX3QgQvosrskaC87amGBguhIZyjMIoBnuohilCW16J4N6ATe3wtPH6IUwFZHffvyosqrk_7n3OHHL3rdFjySGkLISTSdsGIcnXtTPvbWs6FLvM9YE-k_g8depwRQ1ejD1XWxsQ_u2llk6F4Oxg42PKL02pznTGH-dQJOATLYSdWj_vjIl81eN98VGIsXkNVGghDsyDce1cWXNEWXKCZr2UzWl11BrVznrN4zRvOsDLOePD0Ga9jr6OnLYsRS5ykvkCgDiRzYp19j4WUgTfm30Ct1zeTpuKUR3oznrpE-jf886_bXK9miYHYjLQWNmXmQMSkwb2YpzsGIzzP7lfJcl7HciK7PCAXUHu2wOs2ykcGfRcBmJ55X2SxhqPEs2_26kEmiPMh7NFj0q2eSHkwqFQkJ55iqvjxXRnilnvZ3IHlHnQ7nwGL_8tIH1TeczjypjpX7wLGjj1fp4iLbVk3dfTexETtaZ_af0BaFP_I9rmgRwbCavZU2X1_KNJUJAYkOAqxufA" class="ad_story ad_clickable" target="_blank"&gt;&lt;div class="social_ad_advert"&gt;&lt;div class="social_ad_advert_text"&gt;Meet sexy singles in your area at Mate1.com&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;&lt;div class="below_social_ad clearfix"&gt;&lt;div class="ads_feedback"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;I'm off to hear Paul Cusick's debut CD. Sorry girls..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-3173461780737557764?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/3173461780737557764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/its-aaargh-facebook-post.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/3173461780737557764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/3173461780737557764'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/its-aaargh-facebook-post.html' title='It&apos;s the &quot;Aaargh! Facebook!&quot; Post'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-8990015949877662310</id><published>2009-03-20T20:19:00.004Z</published><updated>2009-03-20T20:51:24.377Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='simplexml'/><title type='text'>Don't ask questions you already know the answer to - REST apis part 3</title><content type='html'>Okay, let's have a look at something else.&lt;br /&gt;&lt;br /&gt;You probably don't want to go trawling for data every time you need to process some, so let's look at saving some data.&lt;br /&gt;&lt;br /&gt;State your REST source as usual, but instead of a simplexml load, do:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$somefile=fopen($somecall,"r");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;file_put_contents("somedata.xml",$somefile);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;fclose($somefile);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Which loads your resource, saves it to the server as xml (or whatever), then closes the connection. That's all you need to put it this file - end with &lt;span style="color: rgb(153, 0, 0);"&gt;?&gt;&lt;/span&gt; as usual and save as whatever - fetchdata.php&lt;br /&gt;&lt;br /&gt;Then, whenever you need to refresh your source:      &lt;span style="color: rgb(0, 102, 0);"&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;include("fetchdata.php");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Whenever you want to use the data that's already there: &lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$sxmlobject = simplexml_load_file("somedata.xml");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;if it's XML. If you have to deal with JSON you can still loop if you use an array, instead of a simplexml load.&lt;br /&gt;&lt;br /&gt;Here's one last trick. On your main page, you can make it refresh the data in time intervals. Or specifically, you tell it to refresh if it's been at least X mins/hours/days since the last refresh.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;//This function refreshes the data and records the time it does it.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    function refreshData()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        $t = time();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        include("fetchdata.php");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        file_put_contents("lastupdate.txt",$t);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;//This is now        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    $timenow = time();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;//If you can't find that record, refresh anyway. This is so it works first time!&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    if(!file_exists("lastupdate.txt"))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        refreshData();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;//Find out the last time you refreshed - might have been just a few lines above though!&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    $timeload = file_get_contents("lastupdate.txt");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;//If it's been 10 hours - 36000 seconds -  since refresh, refresh!&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    if ($timenow &gt; $timeload + 36000)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        refreshData();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$sxmlobject = simplexml_load_file("somedata.xml");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;   //and do something with it!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-8990015949877662310?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/8990015949877662310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/dont-ask-questions-you-already-know.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8990015949877662310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8990015949877662310'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/dont-ask-questions-you-already-know.html' title='Don&apos;t ask questions you already know the answer to - REST apis part 3'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-976929174889437945</id><published>2009-03-15T20:51:00.006Z</published><updated>2009-03-20T20:46:54.876Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web app'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='simplexml'/><title type='text'>Particularily Happy Place -  REST apis part 2</title><content type='html'>Okay, if you want to start querying, you'll need a server to run your PHP code. I recommend giving &lt;a href="http://www.apachefriends.org/en/xampp.html"&gt;XAMPP&lt;/a&gt; a look - you'll get Apache, MySQL and PHP support all ready to go out of the box (okay, almost - I think all I had to do was initialise openssl in apache/bin/ini.php - google it)  for free!&lt;br /&gt;&lt;br /&gt;Ready to go? I'm a big fan of PHP for it's pretty open typing - I hate having to declare everything, I find this language makes it relatively easy to juggle resources without actively having to keep track of everything and worrying about type conversions etc. Let's just jump in.&lt;br /&gt;&lt;br /&gt;The first thing to do is define your source. Most apis will have a token system to stop malicious users abusing the system, so I'm going to add that string in here too. Something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$call = "http://example.com/api/weather?token=v5onv689g35";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;creates a variable called "$call" and inserts your resource address as the value. Note the dollar sign denotes a variable. You'll then want to insert some other query strings:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$call = $call."&amp;amp;country=uk";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$call = $call."&amp;amp;city=london";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note we could have lumped all three of these together in one declaration, but we'll want to come back later to change these, as it'd be useful to actually change their values. I'll come back to this.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$xml = simplexml_load_file($call);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Keeping this really simple, in one line we've: contacted the server ( here, at example.com), retrived the response and loaded it into a simplexml object called "$xml". If you look back to the last post, we had a response which contained one level of hierarchy - so we need to drill inside the "response" tag to get to the tags we want e.g. "temp"...&lt;br /&gt;&lt;br /&gt;We can do this easily using a foreach statement, which looks at each child of the $xml variable (calling it $xmlchild). We then call the name of the tag $xmlname - and the print $xmlname and $xmlchild, with a hyphen between them, and a break at the end.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;foreach($xml-&amp;gt;children() as $xmlchild)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;$xmlname = $xmlchild-&amp;gt;getName();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;echo $xmlname."-".$xmlchild."&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once the server executes this PHP page, it would output the following to the browser:&lt;br /&gt;&lt;br /&gt;temp-12.7&lt;br /&gt;windspd-34.6&lt;br /&gt;winddir-170&lt;br /&gt;humid-54&lt;br /&gt;&lt;br /&gt;Of course, you'd also want to build in controls to alter the query, do calculations with the data, display it in a meaningful way etc. but this is the basic technique I've been using - use PHP to send a request to a third party server, process and parse the response on a local sever, and serve the results back to the browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-976929174889437945?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/976929174889437945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/particularily-happy-place-rest-api-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/976929174889437945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/976929174889437945'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/particularily-happy-place-rest-api-part.html' title='Particularily Happy Place -  REST apis part 2'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-3290580622697205298</id><published>2009-03-15T17:48:00.006Z</published><updated>2009-03-20T20:47:26.895Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web app'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>Give It a Rest:  REST apis part 1</title><content type='html'>So, first off I'm going to talk about one of the simplest ways to get a web service to send you data - it's called REST.&lt;br /&gt;&lt;br /&gt;REST stands for &lt;a href="http://en.wikipedia.org/wiki/REST"&gt;&lt;b&gt;representational state transfer&lt;/b&gt;&lt;/a&gt; and is an architecture, a way of laying out resources on a server. The idea is that the information you want to get at (the "resource") can be asked for by describing a "representation" of that data using HTTP calls. Services which do this are "RESTful".&lt;br /&gt;&lt;br /&gt;For example, say you have a service which provides you with details of the weather in a specific location. One way to query this service might be:&lt;br /&gt;&lt;br /&gt;[serverlocation]?country=uk&amp;amp;city=london&lt;br /&gt;&lt;br /&gt;Which is to say, what's it like in London, UK right now?&lt;br /&gt;Another equally valid way to ask for this information might be:&lt;br /&gt;&lt;br /&gt;[serverlocation]?lat=5132N&amp;amp;long=0005W&lt;br /&gt;&lt;br /&gt;Which refers to exactly the same place (resource), but in a different way. As long as the server accepts all of these query parameters, they're both fine to use.&lt;br /&gt;&lt;br /&gt;The key here is that you don't have to send a HTTP header, you don't need any funny protocols, you just ask for a page with well defined query parameters saying what you need, and bing! that page contains the appropriate data.&lt;br /&gt;&lt;br /&gt;The response itself can be in pretty much any format, indeed - you'd often use one query parameter for the response format, if you have a choice. Suppose it was XML, it might look like this:&lt;br /&gt;&lt;br /&gt;&amp;lt;response&gt;&lt;br /&gt;&amp;lt;temp&gt;12.7&amp;lt;/temp&gt;&lt;br /&gt;&amp;lt;windspd&gt;34.6&amp;lt;/windspd&gt;&lt;br /&gt;&amp;lt;winddir&gt;170&amp;lt;/windir&gt;&lt;br /&gt;&amp;lt;humid&gt;54&amp;lt;/humid&gt;&lt;br /&gt;&amp;lt;/response&gt;&lt;br /&gt;&lt;br /&gt;Which I've just made up, but you get the idea. If you ask for the weather info for the city of "Gropiertegbun", you might instead get this:&lt;br /&gt;&lt;br /&gt;&amp;lt;response&gt;&lt;br /&gt;&amp;lt;error&gt;city not recognised&amp;lt;/error&gt;&lt;br /&gt;&amp;lt;/response&gt;&lt;br /&gt;&lt;br /&gt;With the possible exception that "recognised" would probably end up getting spelt the American way.  That's because I made that city up, and even if I didn't, perhaps asking for a city without a country ID returns an error too. REST apis generally have fairly simple rules about which parameters you can use with which, and generally have defaults for when specific parameters are missing.&lt;br /&gt;&lt;br /&gt;Part 2 will deal with how to use a server scripting language, in this case PHP, to make these calls and parse (read out) the results. I'll then probably follow on with details of how to build a user inteface to modify the queries, and how you can feed the results into other apis to display and use your data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-3290580622697205298?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/3290580622697205298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/give-it-rest-using-rest-apis-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/3290580622697205298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/3290580622697205298'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/give-it-rest-using-rest-apis-part-1.html' title='Give It a Rest:  REST apis part 1'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-8317117931146999424</id><published>2009-03-10T20:56:00.005Z</published><updated>2009-03-15T18:24:07.025Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web app'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>My First Ajax</title><content type='html'>As an analyst, I often see things which aren't "joined up", systems that don't talk to each other properly, tasks that people complete which are frustratingly manual (data entry sucks!) but the worst of all...&lt;br /&gt;&lt;br /&gt;Things that people could do, but don't, because they're too tedious/complicated/etc..&lt;br /&gt;&lt;br /&gt;With that in mind, I've been developing with an &lt;a href="http://en.wikipedia.org/wiki/API"&gt;API&lt;/a&gt; published by a third party I work with. Don't get me wrong, they have a good system, but it tends to be a bit on the slooooowww side (they could do with some &lt;a href="http://en.wikipedia.org/wiki/AJAX"&gt;ajax&lt;/a&gt; upside their faces..) Not to mention the hastle of remembering your username and password, logging in, navigating menus...  So I'm on a mission to create an easily usable interface to their API which we can use locally.&lt;br /&gt;&lt;br /&gt;I'm relatively new to the techniques I'm using - but that was the main motivation in the first place! So, I've been learning all the &lt;a href="http://w3schools.com/"&gt;HTML, XML, PHP, JavaScript&lt;/a&gt; needed to put together my own little ajax powered web app.&lt;br /&gt;&lt;br /&gt;I'll be posting a few little stories about this as it develops, as well as hopefully providing some insight into what is needed for anyone that perhaps wants to try themselves!&lt;br /&gt;&lt;br /&gt;Many companies (Google, Amazon, spring to mind) have open APIs which you can play with - so why not have a look?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-8317117931146999424?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/8317117931146999424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/my-first-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8317117931146999424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8317117931146999424'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/my-first-ajax.html' title='My First Ajax'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-2144243894193550503</id><published>2009-03-07T16:21:00.003Z</published><updated>2009-03-07T16:26:56.679Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='space'/><category scheme='http://www.blogger.com/atom/ns#' term='SETI'/><category scheme='http://www.blogger.com/atom/ns#' term='Kepler'/><title type='text'>Kepler Mission is GO</title><content type='html'>In other news:&lt;br /&gt; &lt;blockquote&gt;Kepler, a sophisticated space telescope, blasted off from Cape Canaveral, Florida, in the early hours of the morning, and separated from its carrier, a Delta II rocket, nearly 450 miles above the earth.  &lt;span style="font-size:78%;"&gt;&lt;a href="http://www.telegraph.co.uk/scienceandtechnology/science/space/4953688/Nasa-launches-Kepler-rocket-into-space-to-search-for-worlds-like-ours.html"&gt;telegraph.co.uk&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Kepler's job is to scrutinise the area of the part of the Milky Way near the Cygnus and Lyra constellations, looking for planets around the stars there. Specifically, it's hoped that it'll find a rocky Earth like planet - providing some solid evidence to back up speculations of exactly how common a solar system like ours is.. are we unique - or do similar systems, with similarly composed planets (with conditions suitable for life!) crop up all over the place?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-2144243894193550503?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/2144243894193550503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/kepler-mission-is-go.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/2144243894193550503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/2144243894193550503'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/kepler-mission-is-go.html' title='Kepler Mission is GO'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-4036154542319152934</id><published>2009-03-07T15:50:00.002Z</published><updated>2009-03-07T16:19:25.469Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='degrafa'/><category scheme='http://www.blogger.com/atom/ns#' term='openflux'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='model'/><title type='text'>All Fluxed Up</title><content type='html'>&lt;a href="http://flexyfrederick.blogspot.com/2009_03_01_archive.html"&gt;Flexy Frederick's&lt;/a&gt; been over, last night we recorded a few acoustic songs and this morning, I had the fortune of a &lt;a href="http://flexyfrederick.blogspot.com/2009_03_01_archive.html"&gt;tutorial&lt;/a&gt; of his &lt;a href="http://code.google.com/p/openflux/"&gt;OpenFlux&lt;/a&gt; value object model he's been working with, which provides easy integration with a client/server model like &lt;a href="http://en.wikipedia.org/wiki/Cairngorm_%28Flex_framework%29"&gt;Cairngorm&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8kOuMrOV1R4/Sa7Zl2CNq0I/AAAAAAAAABI/1ikzO2rPvQg/s400/Components+part+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_8kOuMrOV1R4/Sa7Zl2CNq0I/AAAAAAAAABI/1ikzO2rPvQg/s400/Components+part+1.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The value object (LinkVO) contains a few variables for holding necessary information about the views of the component, such as the user's name, location of his pic etc...&lt;br /&gt;&lt;br /&gt;The link object inherits the properties of a List Item, with the get and set methods overriden to talk to the value object. In the same directory there's a Flux content variable for each view of the component, in this example it's a user name and a photo [&lt;a href="http://www.degrafa.org/"&gt;degrafa&lt;/a&gt; handles the "brand" formatting for the photo, and both look at component.data].&lt;br /&gt;&lt;br /&gt;The controller sends the request to the client/server model - I'll have to read Part 2 to find out what happens next... Did I get that roughly right, Freddy? :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-4036154542319152934?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/4036154542319152934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/all-fluxed-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/4036154542319152934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/4036154542319152934'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/all-fluxed-up.html' title='All Fluxed Up'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8kOuMrOV1R4/Sa7Zl2CNq0I/AAAAAAAAABI/1ikzO2rPvQg/s72-c/Components+part+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-7286255874274480248</id><published>2009-03-06T16:49:00.003Z</published><updated>2009-03-06T17:03:17.195Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='mashup'/><title type='text'>Talk Talk</title><content type='html'>&lt;a href="http://tomtaylor.co.uk/projects/"&gt;Tom Taylor makes things talk&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This guy's responsible for the twitter account which tells you when Tower Bridge is raising and lowering, and has built a "feed printer" from an old receipt printer and an ethernet shield.&lt;br /&gt;&lt;br /&gt;Inspiring.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-7286255874274480248?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/7286255874274480248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/talk-talk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/7286255874274480248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/7286255874274480248'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/talk-talk.html' title='Talk Talk'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-8839503302551687252</id><published>2009-03-05T21:56:00.003Z</published><updated>2009-03-05T22:01:57.553Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='climate'/><category scheme='http://www.blogger.com/atom/ns#' term='ignorance'/><category scheme='http://www.blogger.com/atom/ns#' term='evil'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Blinded by Greed and Religious Delusions</title><content type='html'>If there's a grand global warming conspiracy, this is it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.yoism.org/?q=node/218"&gt;Watch some amusing but slightly terrifying videos&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also check out Ignorance Corner, and bask in the power of greed and stupidity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-8839503302551687252?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/8839503302551687252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/blinded-by-greed-and-religious.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8839503302551687252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/8839503302551687252'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/blinded-by-greed-and-religious.html' title='Blinded by Greed and Religious Delusions'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-1839256859359114585</id><published>2009-03-05T20:24:00.003Z</published><updated>2009-03-05T20:33:41.879Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='procrastinate'/><category scheme='http://www.blogger.com/atom/ns#' term='KoL'/><title type='text'>I Wonder If He's For Sale?</title><content type='html'>&lt;a href="http://secondlife.com"&gt;Second Life&lt;/a&gt; vs &lt;a href="http://kingdomofloathing.com"&gt;Kingdom of Loathing&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This isn't really a competition. SL is a nice fat download, which then proceeds to burn processor if you venture into a remotely complex environment. KoL is a PHP based browser game with hand drawn stick figure graphics. SL is boring as tits, because it's not exactly clear what you're supposed to be doing, and most places seem empty, unfinished and depressed. In KoL you have clearly defined quests, with ingenious solutions, and plenty of ironic monsters to beat on. SL has desperate marketing schemes, KoL has pop culture references, eating, drinking, gambling, stealing and sabre toothed limes.&lt;br /&gt;&lt;br /&gt;I know where I'm off to tonight.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-1839256859359114585?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/1839256859359114585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/i-wonder-if-hes-for-sale.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/1839256859359114585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/1839256859359114585'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/i-wonder-if-hes-for-sale.html' title='I Wonder If He&apos;s For Sale?'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-6307779306087093643</id><published>2009-03-04T19:43:00.004Z</published><updated>2009-03-05T20:35:04.872Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web app'/><category scheme='http://www.blogger.com/atom/ns#' term='theory'/><category scheme='http://www.blogger.com/atom/ns#' term='comet'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>Eat, Live and Breathe in Real Time</title><content type='html'>I discovered this today.&lt;br /&gt;&lt;a href="http://alex.dojotoolkit.org/2006/03/comet-low-latency-data-for-the-browser/"&gt;http://alex.dojotoolkit.org/2006/03/comet-low-latency-data-for-the-browser/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Comet allows you to send data directly to your browser without having to ask for it.&lt;br /&gt;You heard of AJAX? It's a combination of web technologies - which lets you change bits of web pages without having to reload a brand new page. It's been all the rage - though Google apparantly have declared the AJAX revolution complete.&lt;br /&gt;&lt;br /&gt;So what's next? Comet's not dissimilar to AJAX - it's not really one thing, it's just various bits of technology used together in a fairly organised manner - the aim: reduce unneccessary processing and data transfer on the net. Simple!&lt;br /&gt;&lt;br /&gt;The problem is, how do you know when there's new data available? The user can ask for it, but he'd rather have it appear automatically as soon as it becomes available. AJAX polling helps, because your machine (client side) will ask the website (server side) every now again whether anything's new. But if the answer is "no", it's basically a wasted trip.&lt;br /&gt;&lt;br /&gt;Instead, a Comet framework allows the server to send the new data as soon as the event occurs, and have it AJAXed into the browser without you having to do anything, and with the minimim amount of effort.&lt;br /&gt;&lt;br /&gt;So the web is going real time!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;PS. This popped up on my tweetdeck. I've had a twitter revolution after intially discarding it, when I discovered the beauty of it's ability for memetic transfer, rather than something to do with "friends" (as intended). Ideas propogate, trends ebb and flow. I suspect meme growth in the twittersphere behaves much like fields in paramagnetic substances (incidently, the phenomena of clapping in crowds spreading and dying away is very similar too). So, if anything - it's the closest thing we've got at the moment to "the pulse". &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-6307779306087093643?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/6307779306087093643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/eat-live-and-breathe-in-real-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/6307779306087093643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/6307779306087093643'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/eat-live-and-breathe-in-real-time.html' title='Eat, Live and Breathe in Real Time'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-6025257321251639029</id><published>2009-03-03T19:51:00.002Z</published><updated>2009-03-05T20:35:59.096Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='CERN'/><category scheme='http://www.blogger.com/atom/ns#' term='black hole'/><category scheme='http://www.blogger.com/atom/ns#' term='TED'/><category scheme='http://www.blogger.com/atom/ns#' term='LHC'/><category scheme='http://www.blogger.com/atom/ns#' term='E8'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='Higgs'/><title type='text'>The Spirograph of Everything</title><content type='html'>I've added this pic of an E8 Lie Group. Isn't is neat?&lt;br /&gt;&lt;br /&gt;This is a mathematical symmetry - and the highest order (read: "most beautifully complex and simple at the same time") of it's type that can be constructed. I think it's really pretty, and what's more, it's a usable gauge group (read: "something that behaves nicely enough to use in hardcore physics") into which the Standard Model of Matter fits nicely. There's plenty of gaps left to fill - so do any of them really exist as symmetries of particles in our universe?&lt;br /&gt;&lt;br /&gt;Bring the LHC, let's find out!&lt;br /&gt;&lt;br /&gt;Garret Lisi discusses the implementations of this symmetry in his "theory of everything" on &lt;span style="font-weight: bold;"&gt;TED.com&lt;/span&gt; - check it out. The rotating visuals go a long way to showing you how it works.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;ps. yeah, so the LHC needs a bit of tweaking before it can work properly. This was pretty much expected, if not hoped for. If only the journalists would pay attention. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;On that note, no-one in physics calls the Higgs boson the "God Particle". Only sensationalist journalists do. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;And thirdly, it was a chemist who started the whole "black hole" media frenzy. I use the following parallel:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Imagine you have a mole. You're a bit worried about it. You go to a gynocologist, he tells you it's dangerous melanoma - you go to an oncologist, he tells you "it's a spot, mate". Who are you going to believe? In other words, there is nothing wrong. The LHC won't create black holes which  could somehow escape  and swallow the world. It can't. Trust us. &lt;/span&gt;&lt;br /&gt;&lt;span class="searchalttitle"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-6025257321251639029?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/6025257321251639029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/ive-added-this-pic-of-e8-lie-group.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/6025257321251639029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/6025257321251639029'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/ive-added-this-pic-of-e8-lie-group.html' title='The Spirograph of Everything'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8498085296674567933.post-56542086070578898</id><published>2009-03-02T20:15:00.002Z</published><updated>2009-05-10T15:05:50.011+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ivory tower'/><category scheme='http://www.blogger.com/atom/ns#' term='credit crunch'/><category scheme='http://www.blogger.com/atom/ns#' term='equilibrium'/><category scheme='http://www.blogger.com/atom/ns#' term='capitalism'/><title type='text'>Keep On Crunchin'</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8S6e-Nrexto/SgbfGukEUsI/AAAAAAAAABI/YBTtX6HjSRw/s1600-h/wooheader.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 902px; height: 92px;" src="http://3.bp.blogspot.com/_8S6e-Nrexto/SgbfGukEUsI/AAAAAAAAABI/YBTtX6HjSRw/s320/wooheader.png" alt="" id="BLOGGER_PHOTO_ID_5334196115338449602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Layoffs.. sigh.&lt;br /&gt;&lt;br /&gt;Gladly I'm not affected but still, it's generally causing commotion and I'm finding it hard to find the right position to take in these dark times...&lt;br /&gt;&lt;br /&gt;Part of me just wants to shout "This is judgement day, this is what gross capitalisation does to a nation! Don't pretend you haven't seen the good times, now the chips are down - you can't just whine about it! Fight!&lt;br /&gt;&lt;br /&gt;But then again, I'm speaking somewhat from the ivory tower, as usual. It seems the major burn is the fact that people run the risk of axing those whose departments they just don't understand - business is still basically an old boys club, and those of us whose roles fall outside of the classic dinosaur hierarchy unfortunately have the problem that the fat cat's literally don't realise what we do for them. Easy meat.&lt;br /&gt;&lt;br /&gt;&lt;hippy&gt;&lt;br /&gt;I'd like to think that if mass corporate culture managed to sort it's smeg out and actually let the people who knows what's going on run the show, we wouldn't have to deal with this kind of stuff. Everything would just function in a perfect natural equilibrium.&lt;br /&gt;&lt;/hippy&gt;&lt;br /&gt;&lt;br /&gt;Although, maybe this is the equilibrium? Maybe we have to suffer now, in order for the next phase of humanity to flourish?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8498085296674567933-56542086070578898?l=worldofones.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldofones.blogspot.com/feeds/56542086070578898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://worldofones.blogspot.com/2009/03/keep-on-crunchin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/56542086070578898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8498085296674567933/posts/default/56542086070578898'/><link rel='alternate' type='text/html' href='http://worldofones.blogspot.com/2009/03/keep-on-crunchin.html' title='Keep On Crunchin&apos;'/><author><name>Covert Holistic Detective</name><uri>http://www.blogger.com/profile/01366415438367328798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_8S6e-Nrexto/Saw-F-6x2_I/AAAAAAAAAAM/igtjH3cUkys/S220/mypic02.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_8S6e-Nrexto/SgbfGukEUsI/AAAAAAAAABI/YBTtX6HjSRw/s72-c/wooheader.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
