Bookmarks for 2010-02-03 through 2010-02-05

These are my links for 2010-02-03 through 2010-02-05:

Bookmarks for 2010-02-02 through 2010-02-03

These are my links for 2010-02-02 through 2010-02-03:

Bookmarks for 2010-01-07 through 2010-01-25

These are my links for 2010-01-07 through 2010-01-25:

Bookmarks for 2010-01-04 through 2010-01-07

These are my links for 2010-01-04 through 2010-01-07:

Using Relative Paths in link and script Tags Using the CouchDB Server

I am playing with CouchDB a bit this weekend and I am trying to put together a basic application written in HTML and Javascript.

I wanted to use the XMLHttpRequest object to interact with CouchDB; this meant I had to host the code using the web server that is built into CouchDB (to avoid cross domain issues in the browser). However when I first moved the code over from my normal Apache server into the CouchDB server I tried to access the code with my browser at http://localhost:5984/_utils/myapplication and none of my external CSS or Javascript files would load (at least in Firefox).

What I noticed was that since I was using relative paths in the href and src attributes (i.e. <script scr="./file.js" ...) of the link and script tags, the trailing slash on the URL was required for the files to be included properly. I figured this out because when I accessed the same code at http://localhost:5984/_utils/myapplication/, everything worked as expected.

Typically web servers add that slash automatically for you, but for some reason CouchDB does not. To get around this I wrote a quick Javascript that I placed inline, just below the head tag to look for this case and correct it. The script is below.

if(String(window.location).substring((String(window.location).length - 1), String(window.location).length) != '/') {
    window.location = String(window.location) + '/';
}

Seems odd that CouchDB does not account for this.

Bookmarks for 2009-12-25 through 2010-01-01

These are my links for 2009-12-25 through 2010-01-01:

Bookmarks for 2009-12-09 through 2009-12-22

These are my links for 2009-12-09 through 2009-12-22:

Bookmarks for 2009-12-09 from 09:03 to 09:32

These are my links for 2009-12-09 from 09:03 to 09:32:

Bookmarks for 2009-12-01 through 2009-12-08

These are my links for 2009-12-01 through 2009-12-08:

Barcode Scanning in Android

Been getting into Android a good bit lately. Some for work, some not. Anyway I needed a way to scan a barcode on the phone in order to lookup some information for an application I am designing. However as I found out reading a barcode is not a part of the Android SDK. The SDK does support taking pictures and so forth but no analysis or translation.

After some research I found out how to pull it off on the phone; you can do it by accessing an external barcode scanning application using and SDK concept called Intent. The main barcode scanning application (called "Barcode Scanner" in the market) supports returning scanned codes back to other applications, which makes this relatively straight forward to accomplish. I haven't tried this yet in code but the thing I wonder about is if the Android SDK (or the market) handles application dependences or if that is something you have to handle yourself inside of the application.

Details on getting a scanned code into your application in Android using Intent is detailed in the link below.

http://code.google.com/p/zxing/wiki/ScanningViaIntent

The main project for the Android barcode scanner application is below.

http://code.google.com/p/zxing/

I can't see any reason why this application shouldn't be a default application within the software stack and fully integrated into the SDK. It is a top notch application and open source (not sure if the licenses would be compatible).

...older
{
}