Ruby Tutorial – Arrays

We’re going to use IRB to play around with Arrays a little bit. Start up IRB: irb Ruby uses square brackets to denote an Array, let’s create one with some integers in it and assign the Array to the variable ‘a’: irb(main):001:0> a=[5,3,7,2,9] => [5, 3, 7, 2, 9] We didn’t put the numbers in [...]

From Zero to Rails – Windows Edition

From Zero to Rails – Windows Edition This is assuming you use Windows 7 and don’t have ruby installed on your machine… The entire process should take you about 10 minutes to go from a ruby free system, to a ruby enabled system with rails installed… 1) Download Ruby : Download from RubyInstaller – you [...]

Installing Memcached on CentOS

Being primarily an Ubuntu user, where everything is admittedly pretty straightforward and simple, I’ve had many periods of banging my head on the wall trying to get “yum” to work on CentOS servers. The straw that broke the camel’s back is memcached. Oh, please, please, let me be able to install memcached!! $yum install memcached [...]

Configuring NGINX to serve Ruby Sinatra via Passenger

First off, make sure you have Ruby installed. $ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] If Ruby is not installed then: $sudo apt-get install ruby1.8 Great, now make sure you have Rubygems installed. $gem -v 1.8.15 If you don’t have Rubygems installed, then $sudo apt-get install rubygems Check that you have Passenger module installed [...]

Amazon EC2 – Elastic IP Spamming

When working with the EC2 Amazon Cloud I’ve had a couple of occasions where I get a new Elastic IP address, and then notice that I’m getting tons and tons of packet traffic when I begin using it. I think that a couple of times the traffic has come from some sort of clustered environment [...]

HTML5 – Meter and Progress

This will be plain and simple. There are two new element types called “meter” and “prgoress”. Here are some examples which will hopefully show you everything you need to know to start working with them. Meter <meter min=”0″ value=”15″ max=”100″></meter> See more meters <meter min=”0″ value=”50″ max=”100″></meter> <meter min=”0″ value=”75″ high=”80″ max=”100″></meter> <meter min=”0″ value=”90″ [...]

HTML5 – Upgrading Legacy HTML

HTML5 has offloaded to the browser a lot of work that has historically been done by custom javascript. Using the HTML5 way instead of javascript offers numerous advantages: 1) No waiting for javascript to download and then load into memory 2) No debugging/maintaining custom javascript 3) Unified best practices that future developers will be familiar [...]

Activity.startActivityForResult – not calling onActivityResult

I implemented a quick button to look up an image using the installed Android Gallery app: public void btnPickImage(View v) { Intent intent = new Intent(); intent.setAction(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(intent, REQUEST_IMAGE); } And then, to get the Uri of the image selected by the user: protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) [...]