Added on 20th Jan, 2011
In my CouchDB application, blog/photo is identified by the type field in the document.
#!sh_javascript
{
"type": "blog",
"title": "First Blog",
"when_created": "01/20/2011 15:30:00",
...
}
{
"type": "photo",
"title": "First Photo",
"when_created": "01/21/2011 15:30:00",
...
}
To get the latest content, I created a view with map function as below.
#!sh_javascript
// View name: latest
function (doc){
if (doc.type == "blog" || doc.type == "photo") {
emit(doc.when_created, null);
}
}
Now I can sort the view by when_created field.
Similarly I created two other views for latest blogs and latest photos as below.
#!sh_javascript
// View name: latestblogs
function (doc){
if (doc.type == "blog") {
emit(doc.when_created, null);
}
}
.
#!sh_javascript
// View name: latestphotos
function (doc){
if (doc.type == "photo") {
emit(doc.when_created, null);
}
}
But the view "latest" will have duplicate data, It contains the data which is already available in "latestblogs" and "latestphotos" views.
So I planned to create a single view function with complex key as below.
#!sh_javascript
// View name: latest2
function (doc){
if (doc.type == "blog" || doc.type == "photo") {
emit([doc.type, doc.when_created], null);
}
}
Now I can get list of new blogs/photos by adding startkey and endkey to the view as below
#!sh_javascript
// List of new blogs:
startkey=["blog", {}] endkey=["blog"] descending=true
// List of new blogs:
startkey=["photo", {}] endkey=["photo"] descending=true
To get all the records irrespective of type, call the view without startkey and endkey parameters. But the issue is all are sorted by first element of key not by when_created.
How can I get latest 10 elements irrespective of doc.type. (sorted based on second element of key)
http://aravindavk.in/blog/question_on_couchdb_view
Added on 24th Sep, 2010
Create a seed, which will be a CouchDB view.
Map function extracts numeric part of every doc of type "photo".
http://aravindavk.in/blog/couchdb_auto_increment_ids_with_php
Added on 23rd Jul, 2010
ಒಂದು ಸಲ ಹಾಗೇ ಎಲ್ಲಾ ಮಾತಾಡುತ್ತಿದ್ದಾಗ ಇದ್ದಕ್ಕಿದ್ದಂತೆ ಆರೋಗ್ಯದ ಬಗ್ಗೆ ಚರ್ಚೆ ಆಯ್ತು, ನಂತರ ಆರೋಗ್ಯ ಕಾಪಾಡಿಕೊಳ್ಳಲು ಜಾಗಿಂಗ್ ಹೋಗಬೇಕು ವ್ಯಾಯಾಮ ಮಾಡಬೇಕು ಅಂತ ಯೋಚನೆ ಬಂತು. ಆ ಯೋಚನೆ ಒಬ್ಬನಿಗೇ ಬಂದರೆ ಪರವಾಗಿರ್ಲಿಲ್ಲ, ಆದರೆ ಮೂರ್ನಾಲ್ಕು ಜನಕ್ಕೆ ಆ ಯೋಚನೆ ಬಂದಿದ್ದರಿಂದ ಮರುದಿನದಿಂದ ಜಾಗಿಂಗ್ ಹೋಗೋದು ಅಂತ ತೀರ್ಮಾನ ಆಯ್ತು. ಸರಿ ಮೊದಲ ದಿನವಾದ್ದರಿಂದ ಒಪ್ಪಿಕೊಂಡ ಎಲ್ಲರೂ ಎದ್ದರು ನಮ್ಮ ಹಾಸ್ಟೆಲ್ ನಿಂದ ಲಾಲ್ ಬಾಗ್ ವರೆಗೂ ಓಡಿಕೊಂಡು ಹೋಗೋದು ಅಲ್ಲಿ ಸಲ್ಪ ವ್ಯಾಯಾಮ ಮಾಡಿ ಮತ್ತೆ ಅಲ್ಲೇ ಹತ್ತಿರದಲ್ಲಿ ಕಾಫಿ ಕುಡಿದು ವಾಪಸ್ ನಡೆದು ಬರೋದು ಅಂತ ಡಿಸೈಡ್ ಆಯ್ತು.
http://aravindavk.in/blog/ಹಾಸ್ಟೆಲ್_ನೆನಪು_-_ಜಾಗಿಂಗ್
Added on 23rd Jul, 2010
ಆಗ ಹಾಸ್ಟೆಲ್ ಅಲ್ಲಿ ಯಾರ ಬಳಿಯೂ ಮೊಬೈಲ್ ಇರ್ಲಿಲ್ಲ, ಕರೆ ಬಂದ್ರೆ ಫೋನ್ ಬಳಿ ಇದ್ದ ಯಾರಾದರೂ ಫೋನ್ ರಿಸೀವ್ ಮಾಡಿ ಯಾರಿಗೆ ಬಂದಿರುತ್ತೋ ಅವರ ಹೆಸ್ರು ಕೂಗಬೇಕಿತ್ತು... ನಮ್ಮ ರೂಮಿನ ಹತ್ತಿರನೇ ಫೋನ್ ಇದ್ದಿದ್ದರಿಂದ ನಾನೇ ಸುಮಾರು ಸಲ ರಿಸೀವ್ ಮಾಡ್ತಾ ಇದ್ದೆ. ಕರೆ ಬಂದಾಗ ಅವ್ರನ್ನ ಜೋರಾಗಿ ಕಿರುಚಿ ಕರೆಯೋದೇ ಒಂತರಾ ಮಜ, ಅವರಿಲ್ಲದಿದ್ರೆ ಏನಾದ್ರೂ ಹೇಳ್ಬೇಕಿತ್ತಾ ಅಂತ ಕೇಳಿ ಬರ್ದಿಟ್ಟುಕೊಳ್ಳೋದು. ನಮಗೆ ಆಗದವರಿಗೆ ಯಾರಾದ್ರು ಕಾಲ್ ಮಾಡಿದಾಗ ಮೂರು ಸಲ ಕೂಗ್ತಾ ಇದ್ವಿ, ಮೂರು ಸಲಕ್ಕೂ ಓ ಅನ್ಲಿಲ್ಲ ಅಂದ್ರೆ ಅವ್ನಿಲ್ಲ ಅಂತ ಫೋನ್ ಇಟ್ಟು ಬಿಡ್ತಿದ್ವಿ

Added on 23rd Jul, 2010
"ರೀ"
"ಏನೇ?"
"ರಾಯರು ನಿನ್ನೆ ರಾತ್ರಿ ಹೋದರಂತೆ, ಹಾರ್ಟ್ ಅಟ್ಯಾಕ್ ಅಂತೆ"
http://aravindavk.in/blog/ರಾಯರಿಗೆ_ಏನಾಗಿತ್ತು
Added on 23rd Jul, 2010
ಇದರಲ್ಲಿ ಬರುವ ಬಹಳಷ್ಟು ಸನ್ನಿವೇಶಗಳು ಕಾಲ್ಪನಿಕ, ಕೆಲವೊಂದು ನಿಜವಿರಲೂ ಬಹುದು 
ನಾನು ಎಲ್ಲಾ ದಿನಗಳಲ್ಲಿ ಅಲ್ಲದಿದ್ದರೂ ಬಹುತೇಕ ದಿನಗಳಲ್ಲಿ ಬೆಳಗಿನ ಉಪಹಾರಕ್ಕೆ ಇಡ್ಲಿ ತಗೊಳ್ತಾ ಇದ್ದೆ. ನನ್ನ ಗೆಳೆಯ ಬೆಳಗ್ಗೆ ಆಫೀಸ್ ಕ್ಯಾಂಟೀನ್ ನಲ್ಲಿ ಸಿಕ್ಕಿದಾಗ,
"ಮಗಾ ಇವತ್ತು ನೀನು ಏನು ತಿಂಡಿ ತಗೊಂಡೆ ಹೇಳಲಾ?"
http://aravindavk.in/blog/ಇಡ್ಲಿ_ಪುರಾಣ
Added on 21st Jul, 2010
Using Python documentation similar to unix man pages
#!sh_sh
pydoc sys
http://aravindavk.in/blog/Notes_for_Python_beginners
Added on 15th Jan, 2010
Lohit Kannada is one of the good fonts available for Kannada. But the “space” glyph has very less width, results in less space between the words.
http://aravindavk.in/blog/Space_Glyph_issue_in_Lohit_Kannada_Font
Added on 28th Sep, 2009
In this article we will discuss
- Markdown
- Markdown PHP
- SHJS - Syntax highlighter using JS
- How To Use?

Added on 25th Sep, 2009
fortune is an awesome application in Gnu/Linux, which picks random quote from the dictionary and displays it.
http://aravindavk.in/blog/creating_kannada_fortune_database_for_gnu_linux
Added on 16th Jun, 2009
To install a package in Slackware we can use installpkg, and for upgrade we can use upgradepkg. While installing a package it will not check for dependencies.
#!sh_sh
installpkg <packagename>
upgradepkg <packagename>
removepkg <packagename>
http://aravindavk.in/blog/slackbuild_emacs_cvs
Added on 13th Jun, 2009
Yes!... I decided to install Slackware Gnu/Linux in my Laptop. Currently I have Debian Lenny installed in it. I don't know i will have dual boot with Lenny or complete install. If I have only Slack then I feel I will learn more, since their will be no chance left to switch the OS if any problems occur. 

Added on 4th Mar, 2009
Now it is very easy to enable and configure Kannada in Debian. Install the following packages using apt-get or synaptic package manager.
http://aravindavk.in/blog/kannada_reading_and_writing_support_in_debian_lenny
Added on 27th Jan, 2009
I have created a JavaScript widget for days countdown. You can use this in your websites.
http://aravindavk.in/blog/count_down_begins_for_gnu_linux_habba_2009
Added on 12th Jan, 2009
In this article we will discuss the Unicode range validation using Python regular expressions and JavaScript regular expressions. For illustration i have used Kannada, same can be applied to other languages as well.
http://aravindavk.in/blog/how_to_validate_kannada_words
Added on 4th Dec, 2008
This is the first Blog I am writing after inaugurating this website, long ago (2yrs back) I registered a domain belaku.net (now it is not available). First version of my Website was created using Microsoft Publisher with only static contents. But because of the browser incompatibility, unnecessary junk of formating data in final HTML pages and due to lack of dynamic content handling I dropped the idea of using Microsoft Publisher. That time I was not aware of Open source so I started searching for language for web development. I was impressed by reading one of the article of PHP(I do not have that link as of now).
http://aravindavk.in/blog/my_website_story
