Tag Archives: ruby

good read: Fighting Technological Indulgences

2 Dec

That’s a nice one! Wonder if I should use Ruby, Python, or maybe even Perl to build it? As gearheads we tend to jump to the technical details with little afterthought, but should you even be building that feature in the first place? How do you make that call?

Whether you’re a one man team with a shoestring budget, or a financed startup with some runway, managing the feature backlog is more of an art than a science – it’s always full of vaguely formulated ideas and it’s constantly changing. Managing these priorities is as hard as it is, and if you have a team, it gets even harder: how do you make sure that everyone is aligned with the vision and the roadmap?

Fighting Technological Indulgences – igvita.com

ruby lacks concurrency….

2 Dec

Concurrency introduces parallelism into our applications, and threading is, of course, one way to achieve concurrency. But it turns out that in Ruby, this relation is not transitive: execution parallelism is not the same thing as threading. In fact, if you’re looking for parallelism in your Ruby application, you should be looking at process parallelism instead. So why is that?

Concurrency is a Myth in Ruby – igvita.com

quick start: web project management

13 Nov

So I’m trying to give a friend a few of the basics they’d need to know for managing a web project. Not a bible, just a quick read to hit the ground running. Here is what I came up with.

Your team:

designers – creative artistically, creates look and feel, communicate, produces things you can see
developers – creative technically, creates applications foundation, communicate, leave alone for extended periods, produces things that are used, but not always seen.
cto – head geek, usually smarter than you.
ceo – head head, smile and nod – might be cool
cfo – head money – nuff said
creative director – awesomely artistic, likes coffee
techincal director – almost head geek
vp anything – has friends, probably knows what their doing
assitant – love them, bring them coffee, and be really really nice to them
project manager – you, makes sure designers / developers are making progress, middle man between client, developers / designers, and everyone else (maybe)

Basecamp:

where you document everything. Covers your ass. Anything changes, legals, documents, or client communication happens here.

Cover your ass use BC

Deadline:

in house milestone / deadline=client review milestone / deadline- (1 – 2 weeks)
client milestone / deadline = milestone / deadline + (1 – 2 weeks)
client review milestone / deadline = milestone / deadline – (2-3 weeks)

Terms to know:

fubar – we’re fucked
need more time – your fucked
great – needs review
fun – expect delays
breach of contract – see fubar * 2
contract – covers your ass
invoice – pays your ass
server – where everything runs
ui / client side – where everything is seen
php, ruby, python – what developer use to make things run
css / stylesheet – what designers / developers use to layout what you see
ajax – those cool effects
flash – more cool effects
flv – youtube video
harvest – where everyone tracks time
bc – where you track clients / team
skype – online meeting
delay – no sleep
billable hours – what you can get paid for
over hours – what you might get paid for
favor – 5/1 to get your account established
hail mary -  a favor that empties your favor account
wireframe – lines that show how something will look
mock up – test design
voip – the phone
im / aim – chat
ping – contact

And there you have it, my quick read, more web filler.

sid

Building somethng scalable: language / frameworks aka use ror or php

13 Nov

When I first started this experiment I planned on using a custom php framework. Recently I realized that its kinda pointless to attempt to do something like this and at the same time lock myself into something that may not be the best solution….

enter google, research, testing, and little sleep. Result: codeigniter was the best choice. Huh? Here’s why.

snakes not on the plane

I should say from jump: If I knew and had the time to learn python / django it would have been the winner, sadly I do not.

ruby, rails, hype

I’m a fan of ror, and of course when I decided to take what I’ve created so far and migrate it into something usable I of course thought of ruby on rails. Sadly I saw more than a few hurdles.

First off ror doesn’t play we’ll with others, meaning you shouldn’t run rails in a shared environment. The whole concept behind this experiment is a small start-up with a shoe string budget and 2-3 websites / apps. Yes its possible to host multiple rails apps on one server / vps, but it’s not recommended. There is of course passenger, but that leads into the next point. php +1

Ror is a resource hog, there I said it. When compared to php, rails is more resource intensive than php. Of course the answer is to optimize and scale out, but remember I’m trying to keep the monthly hosting budget under 100-120 bucks (yes seriously shoe string). So php was the choice here.

So far php seems like the best choice for what I’m trying to do, but I needed more than just a few issues I could work around. You can’t work around speed and optimizing. ruby is faster than php via command line, but ror is not amazingly faster when used via web. When you add an opcode cache into the picture ror gets is butt kicked hands down. Of course this is comparing a language to a framework, enter codeigniter.

Codeigniter still out performs ror with an opcode cache. That is just one optimization and php shows drastic improvement.

I wasn’t ready to abandon ror yet, simply put: why use an imitator if you can have the real deal. Codeigniter is a great framework, but it makes more since to actually use rails right?

In the end the answer is no. Rails has a higher level of maintainability out the box, but does less code, easier maintenance, and of course the ror cool factor out weight slower speed, higher cost to deploy, and fewer production optimizations? No.

MVC while not as strict in codeigniter, is there. That combined with OOP will make using a php framework easier to maintain, not ror easy, but easy enough for production imho.

framework, shamework

So we now know why php won over ruby, but why pick codeigniter? I originally started out writing a custom framework, which is always fun to do from time to time to push yourself, but in the end you see the downside and benefits of doing so. Since this entire idea revolves around a small start-up we also need to take development time into consideration.

A custom framework takes alot of trial and error, coding, and recoding, and still more coding. Using a php framework I can reduce the time it takes to get up and running, while still building what I want and need. Yes there’s some overhead compared to a custom framework, but in the end a start-up isn’t yahoo. You should be back at the planning table long before you reach yahoo numbers. Thats not to say you shouldn’t plan for massive growth (hence scalable), just that traffic / users / data on yahoo’s scale is far beyond my scope of experience and even I know its another elephant to eat.

When comparing php frameworks, i was originally looking at cakephp, but after some research found it to slow and with to much overhead. There are other frameworks, but only codeigniter and cakephp met my needs. 2-1=1 (or less than one mr. V), so codeigniter was the winner.

One thing I should note is how poor most of the php frameworks I looked at perform out the box. Yes rails (and merb) are better out the box. Luckily a few simple optimizations speeds things up.

all your base are belong to theory

So far everything has been pretty much all theory, research, and testing. No worries, the meat and potatoes are coming shortly.

the next few posts will cover setting everything up(centos5): memcached / memcachedb, ngninx, apache, varnish, mysql, s3 + rsync, varnish -> s3 relations, etc.

If you feel like following along head over to http://linode.com and setup a few machines, or setup a team in vmware.

Worth Reading

Here are few articles that I came across while researching, some are more on topic than others, but all have some value.

PHP vs Java vs Ruby:
http://www.cmswire.com/cms/industry-news/php-vs-java-vs-ruby-000887.php

Ruby vs PHP performance (cli)
http://izumi.plan99.net/blog/index.php/2008/01/17/ruby-vs-php-performance/

Ruby on Rails Fans
http://shiflett.org/blog/2006/feb/ruby-on-rails-fans

The performance test of 6 leading frameworks
http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks/

deploying rails made simple : Deploying Rails From Scratch

19 Mar

I spent a good bit of this summer working on websites for ApacheCon US 2007 and OS Summit Asia 2007 which will be in Atlanta and Hong Kong this fall. (You should attend!) There’s a whole long sad story behind the Apache conference websites, but I’ll spare you that (for now). Instead, I wanted to collect in one place all the steps and articles you need to get Rails up and running on a Media Temple dedicated virtual server.
Our Goal

Our goal is to have a Ruby on Rails applicatin running on a Mongrel cluster proxied by Apache httpd. We’ll use Capsitrano to automate the deployment process. In the end, we’ll be able to issue a single command to tag the release in subversion, check it out on the server, and deploy the new code. We’ll start with a bare dedicated virtual server.

Deploying Rails From Scratch :: Cubicle Muses

what i'm looking forward to 2008

12 Feb

Ok figured i should make my list

d’angelo’s new album, even if its just more leaks – the one track floating around right now is just amazing.
the xperia
android
quad core prices drop even further
full support for the hvr series in myth tv
dual citizenship
finally getting deep with as3
finish learning ruby
the new halfgray
iron man
watching my fight dog brothers gathering
maybe my first dog brothers fight
drying my dreads
joshtua austin’s album – not spelled right

yeah i live a boring life :)

Powered by ScribeFire.

simple php xml-rpc function

31 Aug

Out of all the xml-rpc functions / classes etc out there i like this one the best. Why? its simple.

I’ll post a rewrite/ extended version once i get to it.

# Using the XML-RPC extension to format the XML package
$request = xmlrpc_encode_request(“weblogUpdates.ping”, array(“Copenhagen Ruby Brigade”, “http://copenhagenrb.dk/”) );

# Using the cURL extension to send it off,
# first creating a custom header block
$header[] = “Host: rpc.technorati.com”;
$header[] = “Content-type: text/xml”;
$header[] = “Content-length: “.strlen($request) . “\r\n”;
$header[] = $request;

$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, “http://rpc.technorati.com/rpc/ping”); # URL to post to
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); # return into a variable
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header ); # custom headers, see above
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, ‘POST’ ); # This POST is special, and uses its specified Content-type
$result = curl_exec( $ch ); # run!
curl_close($ch);

echo $result;

check it out : http://snippets.dzone.com/posts/show/2596

textmate for windows, and soon linux

29 Aug

while looking for a jedit theme i found this : e-texteditor.

Not only does it support textmate themes and plugins. their also working on pushing out a linux version – sweet! :)

check it out : http://e-texteditor.com/

getting started with ruby – links to everything you need.

13 Aug

A group of us at DIF are getting into ruby / rails. I posted this in our forum, then realized it might help others.

Here’s the book i’m currently reading / doing : http://www.amazon.com/Agile-Development-Rails-Pragmatic-Programmers/dp/0977616630/ref=pd_bbs_sr_1/104-4633763-6766336?ie=UTF8&s=books&qid=1187036058&sr=8-1

I’m also reading the pickaxe : http://www.amazon.com/Programming-Ruby-Pragmatic-Programmers-Second/dp/0974514055/ref=pd_bbs_2/104-4633763-6766336?ie=UTF8&s=books&qid=1187036058&sr=8-2

and rails recipes : http://www.amazon.com/Rails-Recipes-Pragmatic-Programmers-Fowler/dp/0977616606/ref=pd_bbs_sr_1/104-4633763-6766336?ie=UTF8&s=books&qid=1187036074&sr=8-1

I recommend anyone who hasn’t go through the Curtis Hibb ruby intro series over at ONLamp:

what is ruby / rails :
http://www.onlamp.com/pub/a/onlamp/2005/10/13/what_is_rails.html

rolling on rails 1 -updated :
http://www.oreillynet.com/pub/a/onlamp/2006/12/14/revisiting-ruby-on-rails-revisited.html

rolling on rails 2 -updated :
http://www.oreillynet.com/pub/a/onlamp/2007/01/05/revisiting-ruby-on-rails-revisited-2.html

Development -
If your on windows i’d recommend using a vmachine (ubuntu?) for serving rails. if not you can use : instantrails

Editors -

mac : TextMate (the best), rad rails
linux : gedit, rad rails, or jedit
win : there’s a dreamweaver rails plugin, rad rails, or jedit

ruby : oldies but goodies links

13 Aug

Came across this list today when looking for links to the curtis hibbs ruby / rails series

http://noobonrails.blogspot.com/2005/11/rails-noob-to-rails-pro-in-17-sites-or.html