JavaScript Simple-12 Simulator

The other day I posted the simple microporcessor design that I created as an undergraduate. As a part of that project I also had to write an assembler and simulator for the processor. Way back in 2011, when I was working on this project, the Hipster movement was nearing its peak in the US, and I had to find a nerdy way to get some irony. I decided it would be awesome to write the assembler and simulator in JavaScript. So, for those of you who want to run some Simple-12 programs online, check out my web-based Simple-12 simulator. Below are some sample programs.


Simple Microprocessor Design

Simple-12 CPU This details the hardware design for a simple 12-bit microporcessor. I created it for an undergraduate class which I took a few years ago. It is not really usefull for anything besides learning how computer hardware works, but I still think that it is pretty cool. I found the documentation for it on my hard drive and remebered how proud I was to have actually completed it; I am a computer scientist, not a computer engineer. Simple logic gates are used as the basis for the creation of more complex digital electronic circuits; those circuits, including a control unit, are in turn connected via a datapath to form a completed processor. The processor datapath is designed to implement the Simple-12 instruction set.


fuzziac.js : Approximate String Matching in JavaScript

Fuzziac.js is JavaScript class for on-line approximate string matching. It was originally intended for use with auto-complete, such as that provided by jQuery UI. This is started as a research project for an undergraduate algorithms class which I took way back in 2011. We had to complete a term project on an algorithm, and Dr. Duan made dynamic programming look cool, so I though I would look for an application of dynamic programming outside the realm of DNA sequencing.

Where I was working at the time I had been updating web-based intranet applications to use RESTful services and shared JavaScript libraries; one of the most popular updates I made was to add auto-complete (thank you jQuery UI) to all the person name fields across the various applications. I worked for a multi-national and culturally diverse company, so spelling people’s names right was a big problem (e.g. Is it Lucy Lu or Lucy Liu? How do you spell Lakshmi Yaragudipati? Jake Bruder’s real name is Joachim Bruder; who knew? etc., etc.). Previous attempts to provide normalized person name data relied upon entering employee IDs, but no one knows anyone else’s employee ID, so they would always have to look it up. Or, if there was no penalty for entering the wrong employee ID, people would just enter their own, which made the results of data analysis faulty. I knew that in order for the data to be correct it would have to be easy for users to enter it correctly, and this problem seemed to be a good fit for a dynamic programming approach.


Objective-C: Post- or Pre- Increment?

I have heard that it is more efficient, in C based languages, to pre-increment (++counter) than it is to post-increment (counter++). However all the online discusions of the topic that I have seen did not provide actual evidence as to why that might be. One of the things I have learned about technology is that there are very few rules of thumb that last, especially when it comes to limitations. So, I decided to run a couple small tests using my current language of choice, Objective-C.

Let’s start with the most basic example. We will define an integer, post-increment it, pre-increment it, and then look at the generated asembly code. I entered the following Objective-C code into Xcode. (By the way, using int instead of NSInteger will produce the same results, but Apple recomends using NSInteger since it is a 32-bit int on 32-bit platforms and a 64-bit int on 64-bit platforms)

NSInteger i = 0;
i++;
++i;

City of Barberton, The App


The Mayor of Barberton, William Judge, is always looking for ways to engage the community, and I have been working with him to accomplish that on the technology front. In 2013 I did a complete overhaul of the City’s website; the goal was to structure the website in a way which would make it easier for citizens to interact with local government while also promoting the City’s strengths to visitors and potential residents. The website was designed with mobile use in mind, but people are coming to expect the experience provided by a dedicated mobile apps, so in 2014 Barberton will begin introducing dedicated mobile apps.


MarkShown Version 2.0

MarkShown is a very simple iPhone app for quickly creating textual presentations which can be shown on an external display. Markdown syntax is used to format presentation slides and presenter notes; the presentation slides will show on an AirPlay device or other attached display, and the presenter notes will show on the local screen.


Version 2.0 of Markshown is now available in the App Store. This version uses Discount 2.1.6 to parse the Markdown, so it does SmartyPants transformations and supports other Discount specific syntax. Discount takes Markdown and generates HTML, so UIWebViews replaced UIViews with CoreText. This means that CSS can be used to style the presentations, and the style portion of the app is now nothing more than CSS. Since each slide and presenter note is essentially a web page the navigation was changed to act like Safari, swiping left from the right edge navigates to the next page and swiping right from the left edge navigates to the previous page.

Markshown can also handle links now, but in a very limited way. A link can obviously not be followed on the external screen. A link followed on the presenters screen will be displayed on the external screen, but it cannot be interacted with. There is a refresh button in the upper-right corner of the play screen which will switch the external display back to displaying the slide contents.

Markshown: device and external display