Android: Simple Weather UI

Another update to the UI for new version of Simple Weather a very early Android application I wrote back in 2008.

Simple Weather

I went though all the layouts and changed the LinearLayout references to RelativeLayout instead.

I think I will move the date up the top. It looks kind of strange where it is.

Android: Simple Weather UI

This is a work in progress.

I have been trying to learn how to write slicker interfaces for Android as the stock styling is fairly boring.

Simple Weather

Note the rounded edges to the list activity and the colours nicked from the iPhone weather app.

Data: Google Correlate and Stock Prices.

I have to admit this one went right under my radar until recently. FT.com put up an interesting and amusing (as you will see) article on matching stock price against Google Correlate.

I leave it to the reader to look over the Google Correlate FAQ but in short it finds the closest match for a time series (dates against values) and frequency of search activity. In other words we can put in stock prices for a period of time and it will find the “closest fit” for search terms. As Google warn “Correlation is not causation” but it can be illuminating to try.

Anyway, I love this kind of thing so I thought I would plug a few time-series for some of our favourite technology giants and see what came up. I haven’t put a link to the time-series files as I am unsure what Yahoos policy is about publishing this data but I’ve put instruction on how to get it and format it. If you are clueless email me and I will send the files.

Apple Inc

To start off lets get the Apple stock prices data from Yahoo finance. Go to Yahoo Finance, search for AAPL and then select “Historical Prices” from the menu on the left. This will take you here. Download the CSV file spreadsheet.

If we open the speadsheet we have a number of columns.

The format that Google Correlate takes is Date|Value so we have to choose a column to plot. I am no financial whizz but I reckon closing price “Adj Close” will do so we’ll edit the file to just have these two columns.

Next we have to alter the date column to be in the format which GC takes so reformat the date column to “YYYY-MM-DD”. Don’t forget to remove the header and save it in CSV format.

Lets plot!

The found correlations are:

I’m going to choose the top correlation in each example. In this case as you can see it is “smartphones”.

I am going to go out on a limb here and say that in this case there is a link from the search results to the share price. From the iPhone launch in 2007 we can see the stock price make a sharp rise as the “early adopters” started to query what exactly a smartphone was and liked what they saw.  In 2009 (according to Wikipedia) the “there is an app for that” campaign started so that might account for the greater interest from the general public not savvy yet to the new “big thing” and getting out their credit cards to push Apples fortunes up up and away.

Google

The found correlations are:

Uh, right. Lets plot!

St Louise Backpage is a classifieds site. One to watch clearly for Google shareholders. Maybe time to start putting all that junk you were saving for the charity shop up for sale instead.

Microsoft

The found correlations are:

Plot.

If “Google Interview Questions” means what I think it does then perhaps Microsofts steady (relatively speaking) share price might indicate a steady outflux of engineers looking to find out the secrets of gaining entry to Googles superior canteen. And, why the massive spike in 2010? Androids sudden take-off perhaps.

Hewlett Packard

To be fair I am not sure if I have focussed on the correct HP division. This is the company stock.

The found correlations are:

Plot.

Frankly I am not sure what Ekas Portal is but it’s maybe time a few HP shareholders booted up MS-Paint and joined in as there is it may just boost their share price. Something to do with HP printer prices perhaps??

Conclusion

Finding causality between the fortunes of a company and Googles search terms does sound good on paper. In reality it is clearly a bit of a minefield. It’s an intriguing idea. I would love to see if anyone can come up with some good correlations that make sense.

One final note. It’s interesting to see that all the companies had a dip in 2009. Why?

Thanks to  quantly for pointing me to this article and Curated Alpha for finding it in the first place.

Java: pommel

I have written a companion tool to “mavenize” called pommel which automatically replaces dependencies in multiple pom files.

As an example say you want to fix all the junit dependencies to the same version or fix the scope of an item in multiple projects. This tool will do it for you.

The tool takes a top level directory and a mapping file as inputs. It will scan for pom files and process them according to the source and target mappings.

Note, this tool REWRITES your pom file according to whatever rules are build into the org.apache.maven.model.Model class. If you are not happy with this then don’t use it or make sure you have backups of your project pom files first. Don’t say you weren’t warned.

The mapping file format is

<?xml version="1.0"?>
<mappings>
  <mapping>
    <dependency-source>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.0</version>
    </dependency-source>
    <dependency-target>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.9</version>
        <scope>test</scope>
    </dependency-target>
  </mapping>

</mappings>

or if you want you can use a wildcard for the source version number i.e.

<?xml version="1.0"?>
<mappings>
  <mapping>
    <dependency-source>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>*</version>
    </dependency-source>
    <dependency-target>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.9</version>
        <scope>test</scope>
    </dependency-target>
  </mapping>

</mappings>

I hope this proves useful to someone.

Java: mavenize

Recently I have been looking at writing a plugin for gephi. This is a open source visualisation tool which lets you create connected graphs of large data sets. I couldn’t get the source code to build and it occurred to me that it might be a good idea to “mavenize” it. After a little investigation I did find the existing maven version of the gephi codebase but after a great deal of effort I still can’t get it to build. Oh well.

One of the pleasures of writing software for your own amusement is you can go off at tangents and investigate whatever catches your interest. With that in mind I found myself pondering - what does it take to “mavenize” an existing java project?

This process isn’t particularly onerous when you have one project to do but if you have a number to convert then it quickly becomes a pain. The gephi application had more than 100 modules so you can see why the thought occurred to me “I can write a tool to do this” and here it is:

mavenize” is a command line tool written in java which you can point at any number of existing java projects and it will automatically generate a maven project directory structure with all the source and resources in the correct place along with a “best guess” pom file. The best guess bit comes from looking at the source code packages and extracting the package prefix which occurs most often as the group id. The artifact id is merely the project name (i.e. the directory name which contains the “src” dir).

You can pass in a version number and a package type to assign to the generated poms. Also if your project is a NetBeans module it will read the project description file and extract the dependencies and place them into the pom file as rough guide for you.

I wrote this to fill a need and I am guessing someone, somewhere has to have the same need as well so here is the link to the project and instructions for it’s use.

From a developer point of view this tool has some interesting components.

For reading the NetBeans project.xml file I was a bit stuck.  There must be a class  to do in the NetBeans codebase but it will be under a different license to the Apache 2.0 one I am using so nothing for it but to generate my own.

I also have another tool which I have dubbed  ”pommel”  which I will get round to publishing as well at some point. This will scan your maven projects and replace target dependencies with specific ones defined in a config file. This is extremely useful if you have to do this operation on a large number of projects.

Flex: SPARQL Browser with Flare

I have spent a little time trying out Flare with the SPARQL Browser. Here is the result so far.

There is an issue with limiting the number of links to display so that you start off with only the root node and the results and then you can expand. I haven’t worked out how to do this with Flare. With the previous library it came built in. Not sure I have the patience to continue with this, perhaps I might try and update to the latest version of the birdeye library instead and see if that fixes the bug to do with the rendering slowing down.

Flex: Flare ForceDirected demo updated for AIR

I have recently been limbering up for a venture back into Adobe Flex and more interestingly AIR.

I have gone back and updated my force directed graph demo to work with Flex 4 and Flare. I am quite pleased with the result.

You can download the executable here.

You can download the source code here.

I am pleased to say that the last version of Flare seem to have fixed all of the issues from when I last looked at this in 2008 (over three years ago..can you believe it).

The demo displays a sample graphML description taken from my Social Graph Browser

It’s not perfect but there are some interesting features of the code to note:

It shouldn’t be too hard to convert this back into a Flex web application as the code is totally self contained. My original plan was to use Flare to implement the graph in my Social Graph Browser application but the original version of the library had too many problems to do that so I let it drop at the time.

My current plan is to convert what Flare demos I have into AIR applications as I go along.

I hope this proves useful.

Flex: Sparql Browser AIR version

I have created an AIR runtime version of my SPARQL browser.

You can download the executable here.

You will need to install the AIR runtime to use it. The reason for doing this now was that I realised that the sort of people who would use this are not experts in setting up a web-server etc.

There is one feature which is a bit of pain and that is setting up the queries file. In theory it would be loadable in a sort of “file..open” kind of way. I have not had time to implement or think this through so for the moment you will have to edit the config file which is bundled in the install.  There is a howto on the google code site here.

I have had a look around at the other kind of graphical tools for SPARQL which came in the wake of this one and I still haven’t found anything that is as general as this.

Note

The online version is currently broken. This is a direct side-effect of me moving this website and all it’s files to a new provider. I do plan to fix this, just not right away. The application uses a proxy-script to issue requests and I am not sure how to set this up on my new webspace quite yet.

gTraffic: Down perhaps not out.

Some of you may have come to this site from my UK road traffic site gTraffic.info. You will have noticed that there is no longer any traffic incidents available. This is because the TPEG feed which was the source of incident data has been cut by the BBC. I am fairly philosophical about this. It wasn’t like the feed was going to be there forever. I got about four years out of it which isn’t bad.

I have just shifted the URL to a different provider so I am not quite ready to kill off the site just yet. Technically I could probably put a script together which generates data from the HA rss feed. I have other stuff to get on with so that may or may not happen.

 

 

General: This site is moving

The long and short of it.

Next Page →