Entries from September 2007 ↓

Mobile AJAX

It’s hot these days! Mobile AJAX!

W3C/OpenAjax Workshop on Mobile Ajax happened yesterday, and there is some interesting reading in the papers.

If you are new to Mobile AJAX, dev.mobi’s got a very well written introductory article.

 

Embedded Databases and all…

Been trying out different embedded databases for the past few days. And am not sure which one is the best. The background is this:

We have a desktop application in C#, and are sending data from desktop to the PHP backend on the server. Since the data is going to be large, we want to send only the changed data to the server. That too in the most optimized manner. We are using CSV file as data storage and doing a diff on it to create the delta that we can send on the server. We are even zipping the delta to make sure it’s good on the bandwidth.

And here’s the problem:

We want to pre-process the delta. So we convert the unified diff to CSV again. Now we want to push it to a temporary table, and update a few fields. E.g. we want to mark all new rows (+ in diff) as “I” (inserted), removed rows (- in diff) as “D” (deleted) and updated rows (- and + both in diff) as “U” (updated). To do this, we load the data into a DataTable and perform some queries on it.

But there’s a catch. The .Net DataTable can’t perform updates on CSV files. So we need a real database.

That’s where our search for embedded databases began.

We want something free and something that does not restrict redistribution in a commercial application.

The options were limited. SQL Server Express, Firebird and SQLite (didn’t want Access/MDB).

Frankly, it’s not been a simple ride so far. We are considering only Firebird and SQLite (open source etc). Neither had enough ready samples / documentation that could solve the problem for us readily. Firebird was more difficult - with a lot of confusion about setting it up and opening the fdb file from a GUI database administrator application. SQLite was easier.

We have to do INSERT queries on the table, as we do not know how many fields will be there in the CSV file, and we couldn’t figure out an easy way to load a CSV file into a new table.

At this stage, I am not sure which one to go for. We need something that will work fast. I know SQLite has an option to load CSV files directly into a table through command line, but we don’t want to do a system call.

Any suggestions?

 

અૌરતની અાંખો િજંદગીભર બુઢ્ઢી થતી નથી

While I was returning from Ahmedabad, Ashok gave a few books to pass on to dad. I had a lot of time on the way back, and picked up Chandrakant Bakshi’s Ego. Here’s something he wrote:

અૌરતની અાંખો િજંદગીભર બુઢ્ઢી થતી નથી…

In English, it translates to:

A woman’s eyes never get older…

So very true!

I’ve been a fan of Chandrakant Bakshi’s writings from school time. And have always enjoyed what he’s written. It was a good time with this photo book yesterday!

 

Girgit Firefox Add-on

Shantanu told me about a new Firefox add-on he has written a while ago. He also discussed it during the Mozilla Indic meet we had. It’s quite nifty, and I thought I should share it with

  1. Create an account on Mozilla if you don’t have it. Login to your account.
  2. Check Show Sandbox in Profile and Save.
  3. Click on Sandbox on upper left.
  4. Search for “girgit”. You will get this page.
  5. Install!
  6. If you want to checkout the source code, follow the “View the source” link on the page.

Try it out!

 

How to empty a file without deleting and recreating it?

Was working with log files and wanted a quick way to empty them and recreate them. rm and touch would do it, but found something simpler:

CODE:
  1. cat /dev/null > filename

As simple as that!