Skip to main content

Engineering & Code

This category consolidates various technical fields to include: Computer, Electrical Engineering, Engineering, Computer Security, and Physics.

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

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

Hard drive mirroring With Unison and the DNS-323

My requirements: – All files on my laptop will be on my DNS-323 Network attached storage device – Any changes made to the shared drive on the DNS-323 will propagate to my Mac – This happens securely and safely The problem is that there are scant resources online to do this. (Isn’t this done frequently?) […] 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