Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1214

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1214

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1214

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1214

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1259

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1406

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1406

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1406

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1406

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/classes.php on line 1457

Strict Standards: Redefining already defined constructor for class wpdb in /home/kiran/kiranp.com/blog/wp-includes/wp-db.php on line 329

Deprecated: Assigning the return value of new by reference is deprecated in /home/kiran/kiranp.com/blog/wp-includes/cache.php on line 103

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/kiran/kiranp.com/blog/wp-includes/cache.php on line 431

Deprecated: Assigning the return value of new by reference is deprecated in /home/kiran/kiranp.com/blog/wp-includes/pomo/mo.php on line 171

Deprecated: Assigning the return value of new by reference is deprecated in /home/kiran/kiranp.com/blog/wp-includes/l10n.php on line 407

Deprecated: Assigning the return value of new by reference is deprecated in /home/kiran/kiranp.com/blog/wp-includes/query.php on line 61

Deprecated: Assigning the return value of new by reference is deprecated in /home/kiran/kiranp.com/blog/wp-includes/theme.php on line 1133

Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/kiran/kiranp.com/blog/wp-includes/comment-template.php on line 1301

Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/kiran/kiranp.com/blog/wp-includes/comment-template.php on line 1301

Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/comment-template.php on line 1301

Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /home/kiran/kiranp.com/blog/wp-includes/comment-template.php on line 1301

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/kiran/kiranp.com/blog/wp-includes/class.wp-dependencies.php on line 33

Deprecated: Assigning the return value of new by reference is deprecated in /home/kiran/kiranp.com/blog/wp-includes/taxonomy.php on line 617

Strict Standards: Redefining already defined constructor for class WP_Http in /home/kiran/kiranp.com/blog/wp-includes/http.php on line 65

Strict Standards: Redefining already defined constructor for class WP_Http_Cookie in /home/kiran/kiranp.com/blog/wp-includes/http.php on line 1633

Strict Standards: Redefining already defined constructor for class WP_Widget in /home/kiran/kiranp.com/blog/wp-includes/widgets.php on line 93

Deprecated: Assigning the return value of new by reference is deprecated in /home/kiran/kiranp.com/blog/wp-includes/widgets.php on line 320

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method MotionOptions::init() should not be called statically in /home/kiran/kiranp.com/blog/wp-includes/plugin.php on line 339
Kiran’s Blog

Latest Entries »

Follow these simple steps to create a custom ringtone for your iPhone, using iTunes 10.

- Open iTunes 10
- Browse to the song from which you’d like to make a custom ringtone.
- Right click on the song, choose “Get Info->Options”
- In the Options tab, set ‘Start time’ and ‘End time’ for the clip you would like as the ring tone.
- Right click on the song and choose “Create AAC version”.
- iTunes will create an AAC version of the clip you’ve selected, with the same name as the original.
- Edit the original song file, back to old Start & End times.
- Right click on the newly created clip, and select ‘Show in Finder’, to open the music folder.
- You’ll notice that the clip has an extension of .m4a. Rename the extension to .m4r.
- Copy the .m4r file to your Desktop.
- Go back to iTunes, and delete the clip from iTunes.
- Drag and drop the .m4r file from your Desktop to iTunes Ringtones folder.
- Sync the ringtones with your iPhone.

That’s it! You’ll find your custom ringtone in iPhone (Settings->Sound->Ringtone)

Tip: How to link to a specific part of a youtube video

Looking for a way to link to a specific part of a youtube video? Just add the following string to the end of the youtube url:
#t=MmSs where M=minutes, S = seconds.

For example, the following link takes you straight to 5:18 in that video.
http://www.youtube.com/watch?v=zawRpMV4EeA#t=5m18s

Products I Can’t Live Without [2010]

Inspired by a few bloggers, here’s an attempt to track my favorite products over time. This is my 2010 list of ‘products I can’t live without’:

Twitter
Gmail
Google Finance
Google Docs
Google Chrome
Google Picassa
Microsoft Outlook
TechHit TwInbox
TechHit SimplyFile
TechHit QuickJump
VLC
ITunes
GarageBand
Adium
Skype
VirtualBox
Mint
iPhone
Pandora
Twitter for iPhone
Amazon
YouTube
MyFitnessPal (iPhone App)
Credit Karma

Pacific coastline & Mt. Tamalpais

Mighty Pacific at sunset.

Mighty Pacific

Mighty Pacific

Mount Tamalpais is the highest peak in the Marin Hills, which are part of the Northern California Coast Ranges. A view of the Pacific ocean coastline from Tamalpais peak.

Pacific Coastline

Current Playlist

Maestro Ilayaraja has composed for an unimaginable number of films (900 Films & 5000 Songs) and I don’t think I can ever claim that I’ve heard them all. Last week I tripped over this wonderful melody. Check out the prelude and interludes.

  • Kanna Unnai Thedukiren Vaa – Unakkagave Valzkiren
    S Janaki & SPB
  • Background score from the film Mani Ratnam’s Pagal Nilavu.
    Pagal Nalavu – Background scoreIlaiyaraja
  • Mac users, here’s how to increase/decrease tempo of an audio file with GarageBand.

    1. Open Spotlight. Type “GarageBand”. Select on “GarageBand” application. Start it.
    2. Create a new project in GarageBand (File -> New)
    3. Drag and drop your audio file (MP3, M4A etc) in GarageBand.
    4. Press Alt+Ctrl+G
    5. Highlight the audio track. (Track’s color changes to purple)
    6. Click on Track Editor (Scissors symbol at the bottom of GarageBand)
    7. Check “Follow Tempo & Pitch” in Track Editor.
    8. GarageBand displays Tempo next to the PlayHead display. Click on Tempo, and adjust it to your liking.

    Enjoy!

    PHP Coding Guidelines – A cheat sheet

    A cheat sheet, listing some guidelines for good coding practices.

    Indenting
    - Use tabs for indenting.
    - Set tab to 4 spaces.
    - Keep lines <80 chars long, for better readability.

    Spacing and Linefeeds

    - No trailing whitespace at the end of the lines.
    - Use Unix style formatting.
    * Lines must end only with a line feed (LF).
    * All text files should end in a single newline (\n) after the closing PHP tag (?>).
    - If you are using Windows platform for development, please set your editor to save files in Unix format.

    Naming Conventions

    - Use the following naming conventions.
    * filenames-in-general
    * javascriptFunctions
    * javascriptVariables
    * mysql_columns
    * mysql_tables
    * _php_global_vars
    * php_functions
    * php_variables
    * CONSTANT_NAMES
    * phpClassMethods
    * phpClassNames
    * README.txt

    Arrays

    - Arrays should be formatted with a space separating each element (after the comma)

    $array_number_one = array('this', 'is', 'foo' => 'bar');

    - If the line declaring an array spans longer than 80 characters, each element should be broken into its own line with proper indentation.
    $form['title']=array(
    '#type'=>'textfield',
    '#title'=>'Post Title',
    '#maxlength' => 32,
    '#required' => TRUE,
    '#size' => 15,
    );

    Function Arguments

    - Function arguments should be separated by spaces, both in the definitions and in function calls. There should not be any spaces between the arguments and the opening and closing brackets, or between the function name and the opening bracket.

    Eg: function this_is_a_test($argument1, $argument2)

    - Arguments with default values should always go at the end of the argument list.
    Eg: function this_is_a_test($argument1, $argument2, $argument3 = 'abc')

    PHP Code Layout

    - Do NOT combine multiple lines of code into a single line, even if they are comments or debug statements.

    Eg:

    $variable = $something + $something; $another_variable = $something_else; echo "test"; //WRONG

    Correct way:

    $variable = $something + $something;

    $another_variable = $something_else;

    echo "test";

    - Braces should ALWAYS be included when writing code using if, for, while etc. blocks. No exceptions here, even if the braces could be omitted. Leaving out braces makes code harder to maintain in the future and can also cause bugs that are very difficult to track down.

    Eg:
    Wrong practices:
    if ($condition1) echo "some code";
    if ($condition1)
    echo "some code";
    else
    echo "some code";

    Correct way:
    if ((condition1) || (condition2)) {
    //action1
    } elseif ((condition3) && (condition4)) {
    //action2
    } else {
    //default action
    }

    - Control statements should have one space between the control keyword and opening parenthesis.

    - Split lengthy IF statements into several lines.
    if (($condition1
    && $condition2)
    || $condition3
    || $condition4
    ) {
    //do something
    }

    SQL Code Layout

    - Do NOT hard code db_prefix in table names. (Specific to Drupal).
    - Always capitialise all SQL keywords (SELECT, FROM, VALUES, AS etc.) and leave everything else in the relevant case.
    - If you are using WHERE clauses to return data corresponding to a set of conditions, enclose those conditions in brackets in the same way you would for PHP if blocks.

    Eg: SELECT * FROM {node} WHERE ( (rid = 5) AND ((type = 'recording') OR (blah = 'somevalue')) )

    - Split lengthy SQL statements into several lines.

    Quoted Strings

    - Strings in PHP can either be quoted with single quotes (”) or double quotes (”"). The difference between the two is that the parser will use variable-interpolation in double-quoted strings, but not with single-quoted strings. So if your string contains no variables, use single quotes, otherwise, use double quotes.

    SQL Injection

    - Make sure your SQL code does not expose SQL Injection vulnerability.

    Eg: This code is prone to SQL Injection.
    db_query("INSERT into {node} (nid, vid, type, uid, created, changed) VALUES($nid, $vid, '" . $type . "', $user->uid, $created, $changed)");

    Instead, use:
    db_query("INSERT into {node} (nid, vid, type, uid, created, changed) VALUES(%d, %d, '%s', %d, %d, %d)",$nid, $vid, $type , $user->uid, $created, $changed);

    1. Install SysStat
    apt-get install sysstat

    2. Enable Stat collection
    Open vi /etc/default/sysstat
    Edit the file, change “ENABLED” to “true”.

    3. Start Sysstat
    /etc/init.d/sysstat start

    3.a. By default, sysstat reports activity every 10 minutes everyday.
    If you’d like to change that interval, edit it here:
    /etc/cron.d/sysstat

    4. To look at your load averages, type in
    sar -A

    If you have installed a Windows 7 Beta as Guest operating system on a VMWare server, over a Windows XP Base, you might run into issue with Network adapter (..like i did).

    If that’s the case, follow these steps.
    1. Go to Windows 7 Guest OS VMWare directory on your file system, and open the .vmx file in a notepad.
    2. Add the following line to the end of the file and save it.
    ethernet0.virtualDev = “e1000″.
    3. Restart the Windows 7 Guest Operating system.

    Windows 7 will recognize the network adapter and you should be able to connect to the internet.

    Powered by WordPress | Theme: Motion by 85ideas.