Sunday, August 28, 2016

Anatomy of a Tweet

I've been doing some Twitter API mining lately using the Tweepy module in python. There is something quite zen about watching the tsunami of real time time updates wizz past faster than you can read them. Real matrix stuff.. " blonde, brunette, redhead.. ".. I digress.

Using the twitter API is nothing new, but I've got some ideas about how to utilize the data with network graphs using the NetworkX module which is another awesome toolkit for implementing network graphs and exporting them as JSON or Gephi format.

While mucking around with figuring out how Twitter API data is returned, I came across this nice map of a Twitter Status Object and thought it deserved a post.




Thursday, August 11, 2016

Play framework for Java





I'm playing around with the Java framework Play ideally for hosting a MySQL database for a personal data project I'm working on. I could do this in Python with the Django or Flask frameworks, but Play seems like a good way to learn some more Java. So here I go.

I came across an error which thought would be worth sharing the solution to.

Play uses Lightbend Activator to install the required run times. After I set the system path as it requires you to, I tried to run activator new, from the command line. It threw the following hissy fit: 



Unable to access jarfile C:Program Files\activator-dist-1.3.10\bin\test\play-java\libexec\activator-launch-1.3.9.jar 

Turns out the problem is spaces in the path names. The whole directory at line 42 the activator.bat needs to be declared as a string to run properly. 

Simply add quotes as follows: 

before: 
for %%d in (%BIN_DIRECTORY%) do set ACTIVATOR_HOME=%%~dpd 

after: 
for %%d in ("%BIN_DIRECTORY%") do set ACTIVATOR_HOME=%%~dpd