CSV import and API: 2 news features!

Two new features have been rolled out, both having to do with getting data in and out of MyOwnDB. We're very excited about this! It is now possible to import data from a CSV file through a very simple procedure:
  1. upload your CSV file
  2. link columns in the CSV file to fields in your database table
  3. get an overview of the import: number of rows imported and number of rows rejected
Rows can be rejected due to data validation exceptions, for example:
  • trying to import text in an integer field
  • trying to import an invalid email add

Freedom in the cloud

Richard Stallman, the founder of the Free Software Foundation, launched a call for action concerning freedom and privacy in the cloud.

Javascript closures illustration

Jack Slocum mentioned in a comment the problem comes from the creation of a global variable. When you create a local variable, you don't get the problematic behaviour. Thanks Jack for taking the time to correct me.


Here is the illustration of a bug that was present in version 0.1 of the yui slideshow.

YUI based slideshow

As I wanted to add a slideshow on the MyOwnDB homepage, I started looking for a ready made solution, but as I didn't find exactly what I wanted, but also because I was curious of how it could be done, I started coding one based on YUI.

Remember to reset the YUI listeners on updated content

I had event listeners set on elements added dynamically to the page not working:
my original content Click here to replace content
When you click on the test_link, the content of the div is

Mass mailing with active mailer

So, you have plenty of users, and you want to notify them of a significant update. You have all recipient emails in you database, and the corresponding ActiveRecord models. Rails also provides the nice ActiveMailer tool. Writing a script using all your existing infrastructure seems the best solution, and it's also how I wanted to send an anoucement to MyOwnDB subscribers. There are, however, two points that you need to take into account:
  • you can't simply loop over all emails, and for each address open a connection to the SMTP server.

Some tricks to use S3 in your web application

After the post on my experience, here's what I learned in using S3. I'm using the S3 library for Ruby published by Amazon.


When you save an entry with a file attached in MyOwnDB, the Rails action handling the form checks the size of the file. If it is within the limits allowed for the account, it saves the information needed locally in the database (let's say in the table "files"), and then saves the file on S3.

File uploads to Amazon S3 the AJAX way thanks to Dojo

File uploads are finally deployed! You can now specify in MyOwnDB that a detail of your entity is of the type "file". This will let you attach a file to an entry, and subsequently replace or delete it. This required some changes in the application, more specifically in the way the forms are submitted back to the server. For a file upload to work fine, you have to send it with the enctype attribute set to "multipart/form-data". But that's not all! You cannot just serialize the form in javascript like you can do with other input types because you cannot access the file from Javascript.

Use of Yahoo UI's tooltip and overlay

Monday has seen a big update of the signup code, with, amongst other changes, the use of the Yahoo UI libs. Although prototype is well integrated with rails, Yahoo's extensive documentation and the praise it got from some leading javascript developers got me interested, and I must say I wasn't disappointed. When you download the distribution and uncompress it, you get a directory structure.

Sending HEAD requests using Amazon's S3 Ruby lib

After some usage of Amazon's S3 storage service from Ruby, I'm quite happy with the result obtained.
Syndicate content