-
Running a Commodore VICE emulator on a remote Ubuntu Linux machine with Xfvb
The Challenge I want to have a Commodore 128 VICE emulator start up, run some arbitrary BASIC code, and get a snapshot of the output. There are a few settings configurable from the command line to accomplish this: +sound (without this option you will get and error “pa_simple_new(): Connection refused” because you’re *probably* not going…
-
Use find_each vs. select or each when needing to process each record via Ruby
The problem: This scenario is a much more practical case of a similar concept with Rails / ActiveRecord count, size, and length. In this case, you’re needing to run ruby code off of either every value from a where method result or a subset that is determined by ruby code. For example, assume that a…
-
Rails / ActiveRecord count, size, and length
When trying to be sensitive to n+1 queries and memory usage, knowing the differences between count, size, and length in ActiveRecord is important. It had been a while since I reviewed the usage, and I wanted to ensure that I hadn’t made some bad assumptions along the way that somehow stuck. The reality is that…