Displaying articles with tag rails
Posted by hank,
Thu Jul 24 04:08:00 UTC 2008
I went to 5 sessions today, and I was pleasantly surprised by most of them.
CouchDB is a distributed non-relational database written in Erlang. It is unique in that its main query interface is simply HTTP REST, and for every UPDATE, it simply creates a new version of the row. Additionally, you can request the entire history of a row very simply.
An open-source implementation of Google’s bigtable. Hypertable uses novel methods such as Bloom filters to significantly decrease query times, as well as smart messaging to distribute a database across many nodes. It is also non-relational.
A group of CS professors hailing from Africa have gotten together to create a community that fosters creativity and innovation from people in Africa. People in first-world countries can participate by acting as mentors, or directly contribute to the projects involved. Chisimba is an open-source MVC framework for rapid application development. I am very interested in contributing to this project.
I thought going in that this would be somehow in the same ballpark as Hypertable and CouchDB, but I was disappointed. Basically, they are using compression and some fairly neat indexing to speed up traditional database queries. The main problem is that they only have a Java API, which completely turned me off after 30 minutes. Before that, it seemed like they were getting some pretty promising results. If they add some more APIs in the future, this may be another one to take a look at.
An awesome talk by Paul Fenwick from Australia, generally detailing failures in computer science and engineering going back into the 20th century and even back to Roman times. This was a wonderful presentation - he’s a really good speaker - and it poked a lot of fun at New Zealand.
All in all, I must say that this OSCON is much better than last year’s at least according to what I was looking for in the sessions. The exhibit hall is also very good this year - I’m pretty loaded down with swag at the moment.
I know someone who would have gotten a kick out of Temporally Quaquaversal Virtual Nanomachine Programming In Multiple Topologically Connected Quantum-Relativistic Parallel Timespaces…Made Easy! had they been here. He needs to come next year (you know who you are..)
Tonight, I also attended FOSCON 4: Cooking with Ruby. This was a spectacular event hosted by Cubespace. I have to say that the live coding competition was a great spectacle, and held everyone’s attention for hours. It was an epic battle between Symfony, Rails, Smalltalk/Seaside, and Drupal. The rankings ended up being the following:
- Rails
- Drupal
- Symfony
- Smalltalk/Seaside
The presentations were good as well for the most part (notes here). AND THEY HAD BEER! I had some of the best keg beer imaginable - I thought it would be crap like you usually get out of a keg, but this was real quality Northwestern hopped pale ale. My cup says Bridgeport Ales, so I’ll have to investigate. If anyone knows the exact beer that was available in the left-side keg tonight, I’d appreciate a comment. I also met some cool people, some of which are all into XMPP and ejabberd. I may have to check all of that out now…
Tags: rails
Posted by hank,
Fri Jul 18 19:05:00 UTC 2008
If you don’t already know about Pradipta’s Rolodex, read up here
Here’s the epic apology email from THE MAN HIMSELF!:
Hi All,
First of all I just wanted to say I apologize for the emails I sent. As of today I promise to stop the Email marketing campaigns. And I do believe it was a very…very..stupid mistake, this is the result of working late.
Also, I am deeply amazed of how talented you guys are. I mean seriously all this happened in less than 24 hours. I hope this mishap would create a benefit for all of us.
I understand this is fun for a lot of you, however, people are getting angry so if we could keep everything under the google groups that would be most appreciated.
http://groups.google.com/group/pradiptas-rolodex?hl=en
If anyone wants to contact me feel free to contact this new email
pradipta416@gmail.com.
Humbly Sorry,
Pradipta (Max) Archiputra
P.S: this time I used BCC. :)
Tags: rails
Posted by hank,
Sat Jan 05 16:49:00 UTC 2008
So, I found this today, and it is awesome. I wanted it in Bluecloth so I could use it in Mephisto. Here’s how.
First, I needed to make it so I could still do normal images, but turn on coolness if I want. Here’s the goal I came up with for the grammar:
[](imageurl.jpg "Scrolly Text at top" "photoslice")
Here’s the first test, with a single image:

And now a set with a namespace:

I did it by simply modifying the regex and image url parsing function in BlueCloth like so:
InlineLinkRegex = %r{
\( # Literal paren
[ ]* # Zero or more spaces
<?(.+?)>? # URI = $1
[ ]* # Zero or more spaces
(?: # title
([\"\']) # Opening quote char = $2
(.*?) # Title = $3
\2 # Matching quote char
)? # Title is optional
[ ]* # Zero or more spaces
(?: # rel
([\"\']) # Opening quote char = $2
(.*?) # rel = $5
\4 # Matching quote char
)? # rel is optional
\)
}x
# and later...
# ...or for an inline style second part
elsif @scanner.scan( InlineLinkRegex )
url = @scanner[1]
title = @scanner[3]
rel = @scanner[5]
@log.debug " Found an inline link to %p" % url
text += %{<a href="%s"} % escape_md( url )
if title
title.gsub!( /"/, """ )
text += %{ title="%s"} % escape_md( title )
end
if rel
rel.gsub!( /"/, """ )
text += %{ rel="%s"} % escape_md( rel )
end
I also added the following to my Mephisto theme layout, in the head section:
<!-- Photoslice -->
<link rel="stylesheet" type="text/css" href="/javascripts/photoslice/style.css" />
{{ "photoslice/functions.js" | javascript }}
Once again, Ruby is awesome. And so is Markdown.
Tags: rails
Posted by hank,
Sat Oct 20 00:05:00 UTC 2007
You can still get 13% off a new Site5 7.5TB/750GB/$7.50 Plan until November! These guys are a great rails host. Get this deal while it’s hot!
Code: HALLOWEEN2007

Tags: rails
Posted by hank,
Sun Sep 02 01:02:00 UTC 2007

OK - I’m usually pretty critical in general, but this is the best hosting I’ve ever found, and it’s 3 times better than when I bought it, and it’s still the same price! So, you should click the image above and go sign up. These guys give you great support - I’ve contacted them numerous times and always had my problem solved within just a few minutes. I’ve noticed my site down once, and as soon as I emailed them, it was back up again. This blog is running Mephisto, a Ruby on Rails application, and it’s FAST! I barely ever see the kind of quick response from websites like I see from mine.
Features
- Full Ruby on Rails support. They have updated gems for you to use, but also allow you to keep your own gem repository in your home directory.
- Ready-to-go web applications with one-click installs
- Awesome tech support
- Very extensive wiki and forum where you can find out how to do anything you want with your account
- 165GB of storage!
- 5TB of bandwidth per month - which is great for transferring large files. I’ve never had a problem with the transfer speed, either.
- 165 domain pointers - This allows me to host all my domains with them. They have a great system for buying domains that I’ve used quite a bit too.
- Shell access
- Free setup!
- 60-day money back guarantee - If you don’t like it, you get all your bones back. How cool is that?
Benchmark
I have 16Mbit internet at home, and I decided just now to test the bandwidth of my site. Here are the results:
hank@rofl:/tmp$ wget -O /dev/null http://ralree.info/videos/grad.mp4
--00:50:57-- http://ralree.info/videos/grad.mp4
=> `/dev/null'
Resolving ralree.info... 70.47.124.108
Connecting to ralree.info|70.47.124.108|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 63,744,460 (61M) [audio/mp4]
100%[====================================>] 63,744,460 1.92M/s ETA 00:00
00:51:30 (1.86 MB/s) - `/dev/null' saved [63744460/63744460]
Yes, folks, thats 1.86 MEGABYTES per second.
My Maximum at 16Mbit is 2 Megabytes/second, meaning this completely maxed out my connection.
I used to be a Dreamhost customer, and it sucked. It sucked really bad. I’m so glad I switched. Compare the features to any other plan you can find for $5/month. This is as good as it gets.
Sign up now!
Tags: rails
Posted by hank,
Sun Jun 10 13:13:00 UTC 2007
Well, I was over at Debian Package of the Day when I noticed an article on KLone. It’s a little application framework that allows you to do XHTML templating in C! Then, you can compile it and send it off to any Linux machine (with a few dependencies of course) to run it. I got it, and it didn’t work for me at first. Then, for some reason, it started working. Here’s what I think did it:
In Ubuntu, I did this:
sudo apt-get install build-essential libssl-dev quilt klone klone-package
Then, I made a new test project:
make-klone-project create -p myhello
This creates a new project directory. Now, go into it and make it your new home:
cd myhello-0.1/
cd userdata/
mkdir www etc
vim etc/kloned.conf
I’m just going to assume you’re using vim because, well, you should be. Make the config file look something like this:
server_list my_http
allow_root yes
my_http
{
type http
addr.type IPv4
addr.port 8880
dir_root /www
}
Now lets give it something to work with (note we’re still in userdata):
vim www/index.klone
<html>
<head><title>Hello Lady!</title></head>
<body>
<% io_printf(out, "Hey, Lady! You call him Dr. Jones!"); %>
</body>
</html>
Now add your precious files to the sauce:
cd ../../site/
klone -c import ../userdata/
# 2 dirs and 2 files imported
cd ..
Now, compile and run it:
kloned-build -o myapp userdata
./myapp -F # This runs it in non-daemonized mode
If you don’t get any errors, congratulations. That means I did something right.
Now, just hop over to here or wherever you specified it to run, and it will magically appear.
Now you can do this:
<html>
<head><title>Hello World</title></head>
<body>
<%
int i;
for(i=0; i < 10; ++i) {
io_printf(out, "Hello Lady! %d<br />", i);
}
%>
</body>
</html>
Then run this to rebuild and re-run the server:
kloned-build -o myapp userdata && ./myapp -F
Update
So, I ran some tests, and I have to say, the speed increase from C might be really awesome every now and again. Here’s the code:
clock_t curtime = clock();
#define SEED 35791246
int niter=10000000;
double x,y;
int count=0; /* # of points in the 1st quadrant of unit circle */
double z;
double pi;
/* initialize random numbers */
srand(SEED);
count=0;
for ( i=0; i<niter; i++) {
x = (double)rand()/RAND_MAX;
y = (double)rand()/RAND_MAX;
z = x*x+y*y;
if (z<=1) count++;
}
pi=(double)count/niter*4;
io_printf(out, "# of trials= %d , estimate of pi is %g \n",niter,pi);
io_printf(out, "%f", (double)(clock() - curtime)/(double)CLOCKS_PER_SEC);
All this is is a Monte Carlo method of calculating pi that I stole from here. It takes 0.56 seconds of CPU time on my Core 2 Duo @ 3.3Ghz. Now for the Ruby on Rails test:
# Controller
@start = Time.now
srand(35791246)
iter = 10000000
count = 0
0.upto(iter) do |i|
x = rand().to_f
y = rand().to_f
z = x*x+y*y
count += 1 if z <= 1
end
@pi = count.to_f / iter * 4
@end = Time.now
This finishes in 20.75 seconds (about 40x slower). C is great for things like this. I hope to use KLone in the future for these kinds of tasks.
Tags: rails
Posted by hank,
Wed May 16 01:44:00 UTC 2007
I noticed today that Site5 has doubled their $5 deal! Now you get the following for only $5/month:
110 GB Storage
5 TB of bandwidth allowance per month
110 Domain Pointers
Free Setup
Ruby on Rails Friendly
I am currently using this plan for this blog, and am extremely happy with it after coming over from Dreamhost.
Tags: rails
Posted by hank,
Mon Mar 19 15:35:00 UTC 2007
I wanted to be able to click a link in my email to see the comment it talked about. So, I modified Luke Redpath’s Comment Notification Plugin to give that to me. First, I had to do some script/console action:
>> s = Site.find_first
=> #<Site:0xb747e014 @attributes={"current_theme_path"=>"wibbish-mephisto",#...
#...
>> s.host='www.ralree.info'
=> "www.ralree.info"
>> s.save
=> true
>> quit
Next, I did a small model modification:
# app/models/article.rb, in the public section
def full_external_link
["http://", site.host, full_permalink].join("")
end
And a slight test:
Loading production environment.
>> Article.find_first.full_external_link
=> "http://www.ralree.info/2006/5/21/first-post-what-to-say"
Perfect!
Then, I just modified the view for the email a bit:
# vendor/plugins/mephisto_comment_notification/lib/views/
# comment_notifier/comment_notification.rhtml
A new comment has been posted on your blog for the article '<%= @comment.article.title %>' by <%= @comment.author %> (<%= @comment.author_email %>):
<%= @comment.article.full_external_link %>
The commenter IP address is <%= @comment.author_ip %>.
Here is the comment that was posted:
"<%= @comment.body %>"
This notification was sent using the Mephisto Comment notification plugin by Luke Redpath.
http://opensource.agileevolved.com/svn/root/rails_plugins/mephisto_comment_notification/trunk
Modified awesomely by Erik Gregg (http://www.ralree.info)
And it’s magic! It totally works!
Tags: rails