Friday, February 17, 2017

A Collection of Links to Data for Playing

This is simply a quick reference list for people looking for some interesting data sets.  

The first one that needs to mentioned is the UCI Machine Learning Repository.  This is a great set of datasets to test your algorithms on, especially since it has predefined expectations on error of prediction.
The second one is a little more loosely related data which quora released to its community in order to gather some insight on what patterns occur in the site.  Check out this reasonably large data set.
The third set is from Data for Democracy which is a large set of data committed toward social projects.  A great place for people hoping to find ways to help. Check out a web post about the released data or the github that hosts it all.
Satori is a group from New Zealand who has gone as far as offering up to $1 000 000 in prizes to those who provide their data for others to utilize.  I'm excited to see where this organization goes.
I am sure there are many other places to gather data and I will be updating this regularly based on data I come across as I explore more in the field of machine learning.

Tuesday, January 24, 2017

Building a Virtual Cluster for HPC or Distributed Applications

The work required of large-scale development often crosses into a realm where hardware is prohibitively expensive for building simple but proficient testing.  An eloquent way to counter this is virtualization.  With software such as Virtualbox, Vagrant, or other related aids in virtualization, we can effectively test the deployment of large scale applications.

This article will go over:
  • creating a template to quickly create new nodes
  • constructing the network for each of the nodes to communicate
  • creating a shared folder across all nodes
CAVEATS: Keep in mind that this is a fast and simple method for deploying a cluster for testing, but has several significant security flaws in addition to numerous personal touches that different workflows may need.  I simply am describing the bare-bones setup of a cluster.  

Building your template node.

I find that it is best to start with a single virtualized guest, install all necessary software and make copies of the virtual machine.  This has the drawback of storage required for each additional guest virtual machine but the benefit of only installing your software a single time. In addition, this will result in faster execution times and read speeds for your set of executables. This is all very important if you want to deploy many nodes.  

First, you will need to choose the operating system that you wish to deploy.  I am most familiar with Ubuntu and will be specifically deploying ubuntu 16.04.

You can obtain a copy of Ubuntu at the following url: https://www.ubuntu.com/download/desktop

You will also need a virtualization software.  I will be using VirtualBox from Oracle.  Like Ubuntu, it is free to use.

With VirtualBox, you simply need to select new and fill in the following:


Next, choose the amount of memory.  I find at least two gigabytes provides the best performance for desktop ubuntu, though keep in mind you will need enough RAM for all of your virtualized machines in addition to your host OS. Please note that lighter versions of linux would be better suited for most workloads in order to free up resources.


Then create a virtual hard disk, in which you will again need to account for how many nodes you are simulating.


I choose .vdi and ten gigabytes dynamically allocated for my drives.  This can all change based on the needs of your application.

Now boot up your new node and configure all of your settings, updates, and installations.

Set up the network for the cluster

One of the most important characteristics for building a cluster is creating the network that allows the nodes to communicate with one another.  This can be done by setting up the DHCP server that VirtualBox comes with.  

Got to File>Preferences>Network>Host-only Networks and create a new adapter:  

Use the following settings.

This will provide all of your nodes with a set of addresses between 192.168.56.101 through 192.168.56.254
Now it is time to enable the adapter.

In the main VirtualBox Manager, select the template node and click settings:

Within settings, select network and on "Adapter 1" choose the following:


and on "Adapter 2" choose the following:



Create a shared folder across all nodes

For a quick setup of a shared folder across several nodes go to the settings of your template node and go to "Shared Folders".  Click the new folder and select which folder on your Host system you would like shared across each of your nodes.  I chose to check the "automount" and "make permanent" boxes to suit my needs as shown,

Now your shared folder should be available once you start up your virtual machine.  Use the following commands to place an accessible link in your home directory.  Enter these commands in a terminal. (replace <user> with your user
<user>@node-00:~$ sudo usermod -aG vboxsf <user>
<user>@node-00:~$ ln -s /media/sf_scratch /home/<user>/scratch_shared
This will place a folder (its actually a link) called "scratch_shared" in your home directory and allow you to place files that need to be accessed across the nodes into this single location.


Special Note: If running on windows and you wish to make links in the shared directory, you will have to use the following command to allow this feature and in my case I was forced to run VirtualBox in Administrator mode.  This allows for executables to be compiled and installed within the shared folder.  A very useful option when needed.
C:\Program Files\Oracle\VirtualBox> VBoxManage.exe setextradata node_00 VBoxInternal2/SharedFoldersEnableSymlinksCreate/scratch 1
Thanks for reading and I hope it helped.  Let me know if there are any improvements I can make.  I hope my laying it out made it more trivial than when I was attempting to accomplish all of these tasks.

Tuesday, November 29, 2016

Super Computing (SC16): Learning from Marathons

It has been a pretty exciting week so far. With the help of my adviser, Lavanya Ramakrishnan of Lawrence Berkeley National Lab, and the Volunteer Team at Super Computing 2016 I have been afforded the opportunity to get a glimpse at the cutting edge in High-Performance Computing software and hardware. I have met people from more than 10 countries in just the first day, each being a leader in their respective fields.

Wait, marathons?

One of the most influential talks I have come across so far, was in fact on the discussion of personal growth and planning. Each of the workshops and tutorials have been adding tools meant to be further investigated in the future, but personal growth is one of those things often overlooked. Now, a good question is how do marathons work into a conversation about personal growth.

The answer is planning. If you have undertaken any major endurance or strength event, then you most likely have set goals. This is the case of Karen Karavanic of Portland State University. She participated in her first marathon in her 40’s and continued to participate in at least three more. The biggest lesson learned in here opinion? Start early, and plan each week (even each day) with what you want to accomplish. This did not seem to relate very well with most of the people in the room and I can see it as a philosophy easily brushed off as obvious and trivial.


Personally, I have participated in several half marathons and one marathon. The only reason I was at all prepared for the marathon was due to the numerous failed attempts at half marathons. I always finished the races, but my three weeks of training never prepared my body and mind for the struggle to get a ‘good’ time. The thing that caught me in her parallel between preparing for a race and preparing for academics or projects is that no matter how obvious this is, I have always approached my academic endeavors completely different than my physical endeavors.

It’s different, so how could they be the same?

Academics is a tree where it is much harder to observe the top branches before you get there. How can you plan something that you have no idea about? This is a bit different in the fitness world because most physical feats people attempt have well-documented approaches to reaching those goals. I personally followed a plan that took about 8 months to train in order to run the whole marathon. No mention of how quickly.

In the end, if you want to program with the best, you have to train like an Olympian. Set goals, reach them, and plan how to reach that next level of competition.

Restructuring the Distraction Economy

Think how often in the past day you have watched a movie, TV show. How often have you flipped through Instagram, Facebook, or Snapchat? How long have you spent on YouTube flipping through an endless cycle of short four minute videos?

Now think of how often in the last week you have thought or created something for yourself. The average twenty-something with a phone in 2014 using Facebook and Instagram reportedly spent nearly one and a half hours on these social platforms each day. That is over ten hours a week spent on consuming other people’s opinions. Ignoring the amount of time this allows for comparing your life to the best people have to show, this is time taken from developing your interests and creativity. It may be said, time is being taken away from becoming divergent.

I have gone through innumerable days in my life wishing I could gain a few hours to exercise more, work on personal projects, write books, and learn a new skill. This is alongside the fact that I have spent countless hours on facebook scrolling past a NewsFeed that I had already seen an hour ago. This is my battle with the Distraction Economy, and I am often losing. My friends explore Instagram and post on facebook, all while showing the perfect side of their life. This perfect side is a more personal form of watching the Kardashians. Facebook is a Kardashian you actually know, full of the lowest lows and questionable perfections. I personally abhor watching reality shows due to what can be seen as a zero gain margin on personal development and yet I have an innate attraction or addition to Facebook.

I could have watched an episode (or two!) of the Kardashians in the time that it took me to write this article. Instead, I have reserved my equity of distraction for this article. A thought piece on my own habits and the motivations available for hopefully productive, but at least introspective, work.

This all stems from the Veritasium channel which successfully fills a gray area for value in the distraction economy. He is eloquent and thought-provoking, but am I really doing anything productive while providing my attention to his channel? Perhaps there is a component to be mentioned with regards to using your equity of distraction for future motivations or inspirations. Regardless, I hope you enjoy the video which sparked this small thought piece or at least come away with a respect for the value of where you could be placing your time.

Setting Things Up

I have a bit of a clutter here. I am setting up a data-oriented demo, which is a personal project that has fascinated me for a great number of years. I have this WordPress site. It’s a mess. An absolute mess. Now, assuming you have not already clicked away, I hope you will visit here in a few weeks. I have a bit of something for those exploring politics, philosophy, web development, and computer science. There might be some fun too. I know, I am really selling this here.

For the artistically inclined, I will be sampling a few home gallery options. I have a large collection of photos I would like to share, but nowhere that seems appropriate, until now. I am not promising Michael Yamashita here, but I hope you will appreciate my efforts.
The Cluster: A series of raspberry pi 3 model B’s that I hope to grow into a ten node cluster for load balancing, batch processing, network simulations, and HPC testing.
For those tech enthusiasts, I will be exploring a few other technologies beyond Django mySQL and WordPress which are currently barebones architecture of this site. Topics will cover cluster computing, load balancing, various database integrations, and beyond. This really is just a giant project to apply my computing knowledge as demonstrated most clearly by my “Cluster” as shown.

Finally, politics. I think most of this will be covered in a very structured setting under articles of DeviantWave, but I may also develop some blog posts leading up to it. I like facts a lot, but I will admit I have a difficult time building a well-constructed narrative. Maybe setting up this blog will help with the overall narrative.

Regardless, if you made it this far then thank you for stopping by. It’s been a pleasure!

William Fox

Monday, November 28, 2016

Hello Blogger! Bye bye Wordpress.

I am rebooting my brief affair with blogging after spending some time with Wordpress and being sorely disappointed.

Now why did I decide to move off a self-hosted Wordpress site?  The simple answer was that it was slow and resource intensive with several features missing from what I presumed was a feature rich, well-established blog platform. I will admit that my PHP experience is embarrassingly minimal and with Wordpress being primarily PHP, I had many struggles simply due to a lack of knowledge.  On the other hand, the problems I did encounter did not appear to have promising answers from the professionals.

I want my.url.com/blog and no more!

I first ran into the weeds of Wordpress when trying to host the site on a branch of an existing site.  This meant hosting on my.url.com/blog instead of my.url.com.  The simple change resulted in a stylistically unappealing index.php tailing at the end giving links such as my.url.com/blog/index.php/2016/10/setting-things-up/ 

There was no easy way to remove this, though I believe there was a way to get by it that I simply never had the time to implement.  

Give me relative links!

The second big difficulty was hosting my blog on my local network.  This meant that I could not access my blog, including the static files, due to all links generated by Wordpress being my.url.com/blog/my_picture.jpg instead of a simple relative link of /blog/my_picture.jpg.  This little detail meant that accessing my server on my home network would result in only gathering the basic Html without styles, fonts, nor images.  Editing my blog at home was also extremely difficult with this method. 

Are we there yet?

It loads like molasses.  I am pretty sure I was the only user on my blog 99 percent of the time and I could never get Wordpress to spin up in under 11 seconds.  I believe this was an issue with the MySQL server in addition to the high overhead of the PHP code in Wordpress, but when my Django hosted demo running on the same MySQL server gives load times under 2 seconds, then there is something wrong with the methods used in Wordpress for generating views. This is not to say Django is a bad platform, on the contrary, I am obsessed with its simplicity, general scalability, and speed, but it is far from the fastest solution for web serving, and yet dominated next to Wordpress.

Why Blogger?

I can't say I am exceptionally thrilled to be on the blogger platform yet due to my inexperience with the platform, the lack of customizability (admin-ability) and lack of integration with my home server, but I wanted something stable, fast, and long lasting.  Moving blogs (as I will be moving several posts in the near future) is not a fun task.  I have sampled blogger before, and the ease of starting up was hard to pass up.  So here I am, hopefully in it for the long haul.  Hello Blogger!