There is GitHub

Repository called ‘misc’ that includes (or will include) miscellaneous code and stuff that I’ve used.

My intention is to add there any scripts and code and stuff that I’ve done  and found useful.

The first code in the repository is ‘sandbox’ project for Eclipse that includes Xtend translation and adaptation of OpenPGP Random Art by Aaron Toponce.

Go to GitHub now.

Edit (20.01.2015)

No more sandbox-project. Eclipse projects are included in another repository: eclipse.

Edit (25.06.2015)

No more misc or eclipse repository. Now there is myscripts-repository.

IBM Intelligent Operations Center REST Client

I made a simple command line REST client while making the IBM Traffic Operations Center demo. Although the REST client was done for specific IOC demo, I think it can be used in any IOC demo that uses REST or it can be used to just poke around the IOC REST API.
Continue reading “IBM Intelligent Operations Center REST Client”

IBM Intelligent Operations Center and Police

In this scenario I use IOC to view official announcements by Finnish Police. In previous post about IOC I mentioned that any image can be used as a location map and in the screenshot below I use an image of Finland’s main police stations as a location map to show police announcements.

IOC_police_announcements_wk40

Continue reading “IBM Intelligent Operations Center and Police”

OLViz: visualizing text with a single line

The next version of One Word Visualization visualizes a given text with a single line. I call it One Line Visualization and let’s abbreviate it as “OLViz”.

Visualization of "OLViz"

Idea of OLViz is to use a single colored line in 3D space to represent text. The way its done is to calculate MD5 hash from text and then use that hash as seed for Processing‘s random generator. Line vector coordinates, color and rotations are randomized and since each seed is unique then all texts have unique one line visualization. Continue reading “OLViz: visualizing text with a single line”

Bug in Automation

@KemiraGroup discovered a little bug in my automation code for tweet statistics. I tested with Firefox and Safari and it worked for me… but then Peter Sjöholm (@sjoholm) informed that the bug manifested itself in IE8 & XP. I reproduced using IE6 and XP and then fixed the bug.

The reason why bug happened was because of one little comma… The excerpt below shows the bug in the list that is used to generate bar chart with Google Charts.

['Thehomedepot',0],
        ]);

The code below has no comma and it works.

['Thehomedepot',0]
        ]);

The bug fix in the code generation is below.

LAST=len(rankingDict)-1
i=0
for company,tweetCount in rankingDict:
  if i==LAST:
    htmlFile.write("['%s',%d]\n"%(company.capitalize(),tweetCount))
  else:
    htmlFile.write("['%s',%d],\n"%(company.capitalize(),tweetCount))
  i=i+1