Skip to main content

Engineering & Code

Engineering & Code explores the full stack of modern tech—from bits and transistors to cloud fleets and formal proofs. Here you’ll find clear, rigorous walk-throughs of software design, embedded hardware, security architecture, and the physics that underpins them, always paired with code, schematics, and reasoning you can put to work.

Radar parameter estimation

[mathjax] Here we tackle what a Radar needs to accurately measure a target’s position, size and motion. (This is nothing new, just a placeholder for some of my notes.) First of all, everything depends on $SNR$, and the parameter estimation happens in the main computer of a Radar. The theoretical rms error of a measurement […] read more

Your key with fingerprint … is not authorized to access heroku with Ubuntu

This error was pretty hard to solve. I emailed heroku support and they recommended: “https://github.com/ddollar/heroku-accounts”:https://github.com/ddollar/heroku-accounts bq. For git commands to work git needs to use the ssh key associated with that account. It’s probably choosing a key associated with a different account which is causing these permissions errors. You can use a ~/.ssh/config file to […] read more

Mongoid counter_cache with has_and_belongs_to_many

If I have two Mongoid models joined by a has_and_belongs_to_many relationship, Users and Groups. I need to quickly and efficiently sort by the most popular groups which really should be done with a counter_cache. However, counter_caches are implemented in rails by setting a callback to update the counter cache every time a child model is […] read more

How do you deploy an application.yml based config to heroku

In one of my applications, I have the following config files that are excluded from git: * config/mongoid.yml * config/application.yml * config/mailserver_setting.rb * config/omniauth_settings.rb For deploying to a regular server, I just add tasks to my capistrano deployment file to create sym-links to a shared directory. In this case I have to modify my application […] read more

Convert avi’s, mkv etc to the iphone

Handbrake is amazing with active development and a great community. When I wanted to transfer a bunch of lectures to iphone/ipod touch format, I faced the time-consuming challenge of converting a hundred files using the Handbrake gui and figuring out the complicated set of options for HandbrakeCLI — their nightly build standalone. So, here is […] read more

Recovering Rails Data Using Production.log

So you didn’t set up automatic backups and need to recover your data? Don’t try digging it out of mysql, look no further than your rails production log. OK, try a bit with mysql, because the rails production log is a terrible way to recover your data. Only use as a last resort, but when […] read more

MacBook Local Link Address — can it be fixed?

I have a bad, bad networking problem with my wife’s MacBook. She can’t connect to the internet anywhere, but I am working with my Netgear WNDR3300 for this problem. Our wireless router is dd-wrt based (open source router firmware), and works fine for about 20 other nodes (other laptops, guests, mobile devices, etc). A couple […] read more

Building Plots in Visio

I like to automate Microsoft Visio to draw plots. They look so much more professional and I don’t have to fuss with Excel to figure out how to make plots look like I want. Again, this is me practicing my theory of being in control, not letting software control us. Please let me know if […] read more

Congressional District GIS Exploration

MathJax.Hub.Config({tex2jax: {inlineMath: [[‘$’,’$’], [‘(‘,’)’]]}}); I wanted to be able to do this with my ip address: I do development and consulting in two areas I really love: fitness and political engagement. For some work I’m doing on the latter, I needed to figure out the latitude and longitude of the geographic center for each of […] read more