The Best of 2016

See the 2015 post here!

Here is my second installment of the best things I’ve found, learned, read, etc. These things are listed in no particular order, and may not necessarily be new.

This annual “Best Of” series is inspired by @fogus and his blog, Send More Paramedics.

Favorite Blog Posts Read

Articles I’ve Written for Other Publications

I’ve continued to write for a few different outlets, and still find it a lot of fun. Here is the total list for 2016.

Favorite Technical Books Read

I haven’t read as much this year as previously

  • The Cathedral & the Bazaar: Musings on Linux and Open Source by an Accidental Revolutionary – Really cool book about early community software development practices (at least that’s what I got out of it). Also covers some interesting history on the start of time-sharing systems and move to open-source platforms.
  • Computer Lib – An absolute classic, the original how-to book for a new computer user, written by Ted Nelson. I managed to track down a copy for a *reasonable* price and read the Computer Lib portion. Still need to get through Dream Machines.

Favorite Non-Technical Books Read

Number of Books Read

5.5

Favorite Music Discovered

Favorite Television Shows

Black Mirror (2011), Game of Thrones (2011) , Westworld (2016)

Programming Languages Used for Work/Personal

Java, JavaScript, Python, Perl, Objective-C.

Programming Languages I Want To Use Next Year

  • Common Lisp – A “generalized” Lisp dialect.
  • Clojure – A Lisp dialect that runs on the Java Virtual Machine
  • Go – Really interested to see how this scales with concurrent network programming.
  • Crystal – Speedy like go, pretty syntax.

Still Need to Read

Dream Machines, Literary Machines, Design Patterns, 10 PRINT CHR$(205.5+RND(1)); : GOTO 10

Life Events of 2016

  • Got married.
  • Became a homeowner.

Life Changing Technologies Discovered

  • Amazon Echo – Not revolutionary, but has a lot of potential to change the way people interact with computers more so than Siri or Google Now. The fact that I can keep this appliance around and work with it hands free gives me a taste of how we may interact with the majority of our devices within the next decade.
  • IPFS – A distributed peer-to-peer hypermedia protocol. May one day replace torrents, but for now it is fun to play with.
  • Matrix – A distributed communication platform, works really well as an IRC bridge or replacement. Really interested to see where it will go. Anyone can set up a federated homeserver and join the network.

Favorite Subreddits

/r/cyberpunk, /r/sysadmin, /r/darknetplan

Completed in 2016

Plans for 2017

  • Write for stuff I’ve written for already (NODE, Lunchmeat, Exolymph, 2600)
  • Write for new stuff (Neon Dystopia, Active Wirehead, ???, [your project here])
  • Set up a public OpenNIC tier 2 server.
  • Participate in more public server projects (ntp pool, dn42, etc.)
  • Continue work for Philly Mesh.
  • Do some FPGA projects to get more in-depth with hardware.
  • Organization, organization, organization!
  • Documentation.
  • Reboot Raunchy Taco IRC.

See you in 2017!

 

Programs from High School

I’ve taken some time over the past two days to dig through some of my old flash drives for old programs I wrote in high school. I found most of my flash drives, and while a few had been re-purposed over the years, I ended up finding a lot of content I created over the course of my pre-college schooling.

I didn’t find everything. When I started taking electives in high school, I first enrolled in a web design class. This was basic Photoshop, HTML, and Dreamweaver development. I can’t really find any of this stuff anymore. I also took a CAD class where I used AutoCad, Inventor, and Revit. These files look to be gone as well. More notably, I took a series of programming-heavy classes: Introduction to Programming (C++), Advanced Programming (C++), AP Computer Science (Java), Advanced Programming (Java), and Introduction to Video Game Design (Games Factory and DarkBasic).

Even when I took these classes a little over five years ago, the curriculum was outdated. DarkBasic was never really a mainstream programming language, and Games Factory was more event mapping than it ever was programming. We learned C++ using a 1996 version of Visual Studio and only learned the concepts of object oriented design later in the advanced class. The Java curriculum was brand new to the school when I took it, but still felt outdated.

That said, I learned a hell of a lot here that would lay a foundation for my future education and career path.

I took the time to copy these files from my flash drives and push them to a GitHub group I created for people who took these same classes as I did. The hope here is that the people I had class with will ultimately share and submit their creations, and we can browse these early samples of our programming. Unfortunately, I couldn’t find any of my Java programs yet, but I might be able to come up with more places to look.

Just digging through my source code, I’ve already found a lot of weird errors and places where dozens of lines of code could be replaced with one or two.

It’s interesting to look back on these programs, and maybe they’ll give you a laugh if you care to check them out. I know they gave me one.

 

Mining Bitcoin for Fun and (Basically No) Profit, Part 3: Mobile Development

If you have not done so already, please read parts 1 and 2 in this series.

So I have a mining rig that’s successfully rewarding me with bitcoins. Normal people would probably stop at this point. One nice thing about mining in Slush’s Pool is that it has a handy email notification option that tells you when credit is being transferred to your Bitcoin wallet. This is pretty cool, but what if I want more in-depth information? For example, what if I want to know my hash rate, or if my miner is alive (did the system crash?) or how many bitcoins I have total?

The next step for me was to create a mobile application which could provide all this information – whenever or wherever I wanted it. So, I got to work.

The platform I chose to work with was Android. A logical choice for me as I had prior experience developing Android applications and own an Android phone myself. Programming for Android, as many know, means programming in Java. If you have any prior Java experience, you’re already have a head start if you ever wanted to get into Android development.

A fantastic thing about Slush’s Pool is that it offers an API (Application Programming Interface) which allows users to pull down information on their miners using the de facto JSON format. So from this I can get at my mining information, but what else do I want? I decided it would be wise to pull down the average value of a bitcoin in USD, at any given moment. This way, I can do some simple calculations to determine a rough estimate of how much I’m generating and getting payed in USD. Lastly, I wanted to get the balance of my Bitcoin wallet, again to be displayed in both Bitcoin and USD.

I already had the API information for Slush’s Pool, as it is linked on everyone’s profile and accessed via a common base url and unique key for each user. Here is an example of the JSON output for my account:


{
    username: "Famicoman",'
    rating: "none",
    confirmed_nmc_reward: "0.00000000",
    send_threshold: "0.01000000",
    nmc_send_threshold: "1.00000000",
    confirmed_reward: "0.00145923",
    workers: {
        Famicoman.worker1: {
            last_share: 1378319704,
            score: "70687.6038",
            hashrate: 1004,
            shares: 1906,
            alive: true
        }
    },
    wallet: "1DVLNHpcoAso6rvisCnVQbCFN8dRir1GVQ",
    unconfirmed_nmc_reward: "0.00000000",
    unconfirmed_reward: "0.00612688",
    estimated_reward: "0.00046390",
    hashrate: "1006.437"
}

Next, I needed an API for the average value of a bitcoin in USD. I went on the hunt. Finally, I found that Mt. Gox, the largest Bitcoin exchange, has a public API for bitcoin rates (located at this ticker URL). This works perfectly for my needs. Here is some sample JSON output from this API:


{
    result: "success",
    return: {
        avg: {
        value: "143.97798",
        value_int: "14397798",
        display: "$143.98",
        display_short: "$143.98",
        currency: "USD"
        }
    }
}

So far, so good.

Lastly, I wanted wallet information. I discovered that Blockchain shows records of transactions (as they are all recorded in the block chain), so I did some probing and found they also offered an API for attributes of individual wallets (Here’s a link using my wallet info, it’s all public anyway). This includes balance, transactions, etc. The units for bitcoins here is the Satoshi, one millionth of a bitcoin. Some sample JSON output from this service looks like so:


{
    hash160: "88fd52ba00f9aa29003cfc88882a3a3b69bfd377",
    address: "1DVLNHpcoAso6rvisCnVQbCFN8dRir1GVQ",
    n_tx: 7,
    total_received: 8434869,
    total_sent: 0,
    final_balance: 8434869,
}

So now I had the APIs I was going to use and needed to put them all together in a neat package. The resulting Android application is a simple one. Two screens (home and statistics) with a refresh button that pulls everything down again and recalculates any necessary currency conversions. Android does not allow you to do anything system-intensive on the main (UI) thread anymore, so I had to resort to using an asynchronous task that spawns a new thread. This thread is where I pull down all the JSON (in text form) and get my hands dirty manipulating the data. I utilize a 3rd party library called GSON to parse the data I need from the JSON string. Then, it’s just a little bit of math and we have all the necessary data. After all of that is done, the application prints everything on the screen. Pretty basic, and with plenty of room for potential additions.

When running the application, provided there’s network connectivity and all the servers are up, you will be rewarded with a screen like this:

The app in action

The application in action

Not too shabby. If you wanted to use it yourself, it would be necessary to hard-code your own key from Slush’s pool. There doesn’t appear to be an API call by username (by design), so it needs to be implemented manually at some point (which happens to be in code as of right now).

The source for this application, which I call SlushPuppy, is freely available on GitHub. Feel free to fork it, or just download and mess around with it. If anything, it provides a small example of both Android-specific programming as well as API interaction.