-
Jun 12, 2014
122
Spent ~3 hours today writing Jasmine unit tests for a new AngularJS controller I made yesterday.
-
May 14, 2014
New Job, New Technologies
Having grown pretty tired of the daily commute to New Jersey, I began looking for a job closer to my house in Philadelphia. I submitted an application to RJMetrics, and, after a pretty rigorous interview process, I was given a job offer. Which rules because they’re one of the best startups in Phila.
So far I’ve been there almost four weeks. I’m being introduced to some web technologies like CoffeeScript and AngularJS. I’ve never done serious web programming before, but I’m glad to be getting into it. There are opportunities on the dev team to work with stuff like Clojure and Hadoop. I hope when I get a better feel for the front end that I can move into some of that.
-
May 6, 2014
AngularJS on Ubuntu VM
I wanted to get started with this AngularJS tutorial, and I wanted to set up my environment to do so on an Ubuntu virtual machine.
As I ran through the process of setting up the VM and installing some prerequisite stuff, I ran into a couple small issues. This post will explain what it takes to get up and running quickly.
My host machine is a MacBook Pro running OS X 10.9.2. And I was installing Ubuntu 14.04 as the guest operating system (these instructions might be close to correct for Ubuntu 13.10 as well).
Here’s what I did:
- Downloaded and installed the latest version of VirtualBox
- Downloaded the ISO image of the latest (14.04) 64-bit Ubuntu desktop OS
- Opened VirtualBox and created a new virtual machine, pointing it to the Ubuntu image I just downloaded
At this point I noticed that Ubuntu seemed to be laggy even though I’d given it 8GB of ram. This was remedied by enabling 3D acceleration and bumping up the memory allocated for the display. Note: the virtual machine has to be stopped before these settings can be edited.
[caption id=”attachment_114” align=”alignnone” width=”1142”]
Check the ‘Enable 3D Acceleration’ checkbox[/caption]
I also installed the guest additions from the VirtualBox Device menu. After restarting the Guest OS I was able to run Ubuntu in full screen.
Now I was ready to install Git, Nodejs, and npm.
- To install git from the Terminal command line on Ubuntu: $ sudo apt-get install git
- Clone the AngularJS git repository via the instructions in the tutorial
- cd to the project directory
- These instructions were helpful in getting Node.js installed.
- To install Node.js: $ sudo apt-get install nodejs
- As of writing, there is a naming conflict such that
$ node
does not refer to Node.js. The binary for Node.js is at/usr/bin/nodejs
; a work-around is that you can create a symlink so the install scripts don't fail:$ sudo ln -s /usr/bin/nodejs /usr/bin/node
- Install npm:
$ sudo apt-get install npm
- Now run
$ npm start
and you should see the tutorial's phonecat app if you open a browser in the guest OS and browse tohttp://localhost:8000/app/index.html
-
Mar 10, 2014
Digraphing
I haven’t made a post here in a while; I’ve been p busy at work.
So I guess I’ll write about it.
Without divulging too much about the application, let me try to explain the portion of software I’ve been designing/implementing for the past couple months…
The problem: customer wants a generic drag-and-drop interface for building custom chains of digital signal processing (and other processing) modules.
So, data comes in from a source module (say, data streaming from some hardware component), and then passes through a number of distinct processing modules (e.g. FFT, decimation, resampling, etc). The customer wanted the ability to visually arrange these modules to manipulate data in different ways.
I must admit that I know next to nothing about digital signal processing, but that’s alright; this piece of software is generic enough that it, too, is ignorant of the details of the actual processing.
The processing is in fact done on a separate computer running real time linux–the builder portion needs to “know” only enough information to control the processing flow and data flow.
For processing flow, the basic required information is: - a list of modules - a list of connections between modules
And for data flow, the program, for each module, should know: - initialization parameters - input parameters - outputs
A coworker was given the job of designing the UI–I was tasked with creating the underlying data structure that would keep track of all this. Some framework to represent the flow of processing from one module to another.
At first blush, a linked list seemed like the way to go. Modules would be nodes in the list, and each node would store a reference to the next node in the list. But we wanted it to be more flexible than that–modules could optionally branch to more than one subsequent module in the processing flow. A directed graph was more suited for this.
Modules would be represented as vertices in the graph, and edges in the graph described the processing flow. Like this:
vertices:
- source_module
- zeropad_module
- decimation_module
edges:
- source_module -> zeropad_module
- zeropad_module -> decimation_module
I found a simple, MIT licensed Directed Graph Library for .NET. I wanted to use this, but there were a couple drawbacks…
The first drawback was that the directed graph only stored vertices as strings. That is, I couldn’t specify a custom object as a vertex. The second drawback was that the library didn’t allow modules to be renamed after creating them.
So after adding a vertex called “v1”, a client of the directed graph library would need to reference that vertex always with the string “v1”–a bit limiting if I wanted clients of my class to be able to rename modules.
I solved this problem by generating and privately maintaining a GUID each time a new processing module was instantiated. This allowed clients of my “DirectedGraphManager” class to create human-readable module names that could be changed by the end user.
I used a dictionary to associate a GUID in the underlying directed graph with a Module object instance: digraphManager.lookupTable.
The DirectedGraphManager keeps track of this digraph behind the scenes, and client objects are able to change the module data easily without fear of corrupting the underlying digraph structure. So far this has been a pretty flexible design.
-
Dec 30, 2013
Goth programming
Dark theme: applied. Hopefully will be using Visual Studio for many months to come.
Recent Posts
- Flight Focus
- Generative AI Accelerates Our Exploration of the Search Space
- AI Assistant Use-Case: Performance Feedback
- Poor Man's Computer Use with Execute Arbitrary AppleScript MCP Server
- Please don’t disable paste
- Blogging via Email
- Using an E-Ink Monitor: Part 2
- AI and the Uncertain Future of Work
- Using an E-Ink Monitor
- Rendering ChatGPT HTML Output Inline