Archive for April 2007
Rails SQL query
I needed to know the highest single (integer) value from a table:column. Not having done this before in Rails, my first intuition was to write something that would create a connection with the db, run a SQL string in a query, return the results to a variable, look in the variable if it came back as an array or some other object and get my value.
As always, I was pleasantly surprised to find that I could run a single query and get my value in a very readable, succinct statement:
@total_pages = ActiveRecord::Base.connection.select_value('SELECT MAX(page) FROM questions')
Beautiful.
Sysadmin/Web Programming Position for YOU
… from the best of craigslist…
We are seeking some poor, misguided fool to be paid next to nothing for a fulltime position doing highly skilled system administration work and rearend penetration testing in a mixed Windows 2000 and Linux environment. We lost our last IT worker because he found a higher paying job standing in front of Subway while dressed as a sandwich.
Skills required:
* at LEAST ten years experience in the administration of Windows 2000
* administration of Linux
* speak with animals
* SQL Server/MySQL
* the divine power of bi-location
* web application programming, predominantly in ASP on Win2k for frontend web site although occasionally PHP for intranet applications.
The position will involve the general maintenance of the servers as well as programming for the website. We want YOU to run EVERTHING we use to make money.
Pay is in the range of $10-15/hr.
We are looking for a unemployed slob who doesn’t know his worth or has kids to feed and has no choice but to run the MOST CRITICAL parts of our enterprise for peanuts.
Email resume and cover letter to IvantTosuckYourBlood@yahoo.com