A friend showed me this puzzling code the other day.
Can you guess the output?
1 | [22:11:41 mburke]$ php -a |
A friend showed me this puzzling code the other day.
Can you guess the output?
1 | [22:11:41 mburke]$ php -a |
1 | $ alias please="sudo" |
Mind your P’s and Q’s.
HT: Mohsen
Just learned RVM can automatically switch ruby versions based on the current directory.
No more trying to remember which magic rvm use
incantation will return your project to a working state.
I ran into trouble the other day running rspec
on my project. It had been working just fine the day before, but all of a sudden:
/Users/mburke/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/i686-darwin12.3.0/digest/sha1.bundle: dlopen(/Users/mburke/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/i686-darwin12.3.0/digest/sha1.bundle, 9): Library not loaded: /opt/local/lib/libcrypto.1.0.0.dylib (LoadError) ..snip ..
This is part II of a series looking at the physics algorithm for Electric Field Hockey. Part I outlines the initial algorithm and it’s shortcomings.
Last time we noticed a problem in how we generate a time step for our physics simulation: requestAnimationFrame
can’t guarantee a consistent interval which makes the simulation appear frustratingly irrational.
1 | LoadModule proxy_module modules/mod_proxy.so |
Never let your physics simulation depend on something as unreliable and capricious as the machine’s framerate.
When I was building Electric Field Hockey I used window.requestAnimationFrame
to control the time-step for all the physics calculations.
1 | Simulation.prototype.tick = function(frame) { |
It’s easy and straight forward: every time the browser wanted a new frame, we can calculate the forces, apply them to the objects, and figure out the new positions.
But it’s also simplistic.
1 | LoadModule proxy_module modules/mod_proxy.so |
Update: Add Cache-Control headers
I wanted to learn a little about ray tracing, and I’m kind of obsessed with javascript at the moment so i cranked out this little gem. I’m planning to add more features to it when I get a chance, but for now you can set the parameters for the sphere and location of the light source. Press ‘Trace’ to get an image on the canvas (which may take a few seconds).