Monday, August 17, 2009

Copay and coinsurnace

Saturday, June 06, 2009

Why and what to read?

Often times I pick up a book loose interest in it and leave it and it is on my to do list to finish the book. Have you ever faced such situation?

I have realized this plan works for me and I am sure it will be different for every individual

- Decide what you want to study
- Question yourself as to why are you studying
- After I read a chapter can I summarize the chapter in a few sentences.
- Can I write a good/bad review for this book.
- Use the book learning and APPLY

Saturday, May 30, 2009

Saturday, May 23, 2009

Trying new RSS reader

Trying the new Newsgator (mamidi) to check the RSS thing now.

Thursday, May 14, 2009

Combine two files line by line

file1
-----
a
b
c

file2
-----
1
2
3

Output
------
a 1
b 2
c 3

Use this: paste -d"\0" file1 file2 > Output

From: Here

Saturday, May 02, 2009

Home ownership woes?

I am not in the market for hunting homes but thought it might be a good idea to check what the process is

First steps detailed here are pretty good
  • Home Ownership


  • Some highlights

    • Education

    • Credit History

    • Budget

    • Research

    • Pre approval

    • Your Priorties

    • The search

    • You are home


    I think choosing the right people for the job is what matters. To start with I will focus on choosing the right Realtor.

    I see that most of the realtors claim that they are not pushy and are not like car salesman. Why are car salesman looked so down upon? Can a car salesman not say that I am not like a Realtor.

    Well from my perspective these are two different salesman in two different contexts, one is selling you something in the range of 20K to 30K (if you are buying cars like Camry , Accord, Corolla, Civic etc).

    Realtor is trying to get you into a house you like worth close to 200K to 400K (shouldn't I just go to Redfin). So the Realtor cannot be pushy like a cars salesman since I would be uncomfortable since it is such a huge amount and will walk away from it. I am not an expert but I would choose these when selecting realtor

    • Experience

    • References

    • In all circumstances he should have your interest

    • How comfortable he is with comparable sales and running repeatedly



    Choosing a realtor is almost like you started a small company and hiring your first employee, would you hire someone if he did not have your interest.


    A lot of home ownership is dependent on whom you choose at the end of the day as he or she can be the deal breaker. I will not like a realtor recommending me something without doing his research and showing me the numbers (As said "numbers don't lie").

    Thursday, April 23, 2009

    Oracle setting timestamp format and query

    alter session set NLS_DATE_FORMAT='DD-MM-YYYY HH24:MI:SS'

    select * from table where date > to_date('2009-04-01','yyyy-mm-dd');

    Saturday, April 11, 2009

    Problems with macbook

    I started having this problem with my macbook and apparently I am not the only one
    MacBook Crack

    How to run a process even when your session ends and exits

    Process :
    -run process (from zshell)

    -Ctrl-Z (to suspend)

    -disown

    -kill -CONT

    Sunday, April 05, 2009

    WalkScore of a Place

    Get Walkscore of your place is a pretty handy tool to find out how accessible is your place to the nearby restaurants, gorceries, banks etc.

    Wednesday, March 25, 2009

    Write a binary stream (cannot output to a string)

    std::string s(record.data.buf(), record.data.size());
    ofstream file1;
    file1.open ("/tmp/kalyan",ios::binary);
    file1.write(bytebuffer, size);
    file1.close();

    Sunday, February 15, 2009

    Poker Basics

    Frpm "pokerbasics.com"

    Saturday, February 14, 2009

    Better terminal for Mac

    Iterm is pretty good if you are not happy with the mac osx built in terminal

    Saturday, January 31, 2009

    Prefix and Postfix operators in C++?

    Thanks to stackoverflow "JProgrammer"

    "Taking a leaf from Scott Meyers, More Effective c++ Item 6: Distinguish between prefix and postfix forms of increment and decrement operations.

    The prefix version is always preferred over the postfix in regards to objects, especially in regards to iterators.

    The reason for this if you look at the call pattern of the operators.

    // Prefix
    Integer& Integer::operator++()
    {
    *this += 1;
    return *this;
    }

    // Postfix
    const Integer Integer::operator++(int)
    {
    Integer oldValue = *this;
    ++(*this);
    return oldValue;
    }

    Looking at this example it is easy to see how the prefix operator will always be more efficient than the postfix. Because of the need for a temporary object in the use of the postfix.

    This is why when you see examples using iterators they always use the prefix version.

    But as you point out for int's there is effectively no difference because of compiler optimisation that can take place.
    "

    Wednesday, January 21, 2009

    XML Streaming

    // Creates a new reader (potentially recycled).
    XMLInputFactory factory = XMLInputFactory.newInstance();
    XMLStreamReader reader = factory.createXMLStreamReader(inputStream);

    while (reader.getEventType() != XMLStreamConstants.END_DOCUMENT) {
    switch (reader.next()) {
    case XMLStreamConstants.START_ELEMENT:
    if (reader.getLocalName().equals("Time")) {
    // Reads primitive types (int) attributes directly (no memory allocation).
    time.hour = reader.getAttributeValue("hour").toInt();
    time.minute = reader.getAttributeValue("minute").toInt();
    time.second = reader.getAttributeValue("second").toInt();
    }
    ...
    break;
    }
    }

    XML Streaming

    // Creates a new reader (potentially recycled).
    XMLInputFactory factory = XMLInputFactory.newInstance();
    XMLStreamReader reader = factory.createXMLStreamReader(inputStream);

    while (reader.getEventType() != XMLStreamConstants.END_DOCUMENT) {
    switch (reader.next()) {
    case XMLStreamConstants.START_ELEMENT:
    if (reader.getLocalName().equals("Time")) {
    // Reads primitive types (int) attributes directly (no memory allocation).
    time.hour = reader.getAttributeValue("hour").toInt();
    time.minute = reader.getAttributeValue("minute").toInt();
    time.second = reader.getAttributeValue("second").toInt();
    }
    ...
    break;
    }
    }

    Wednesday, January 14, 2009

    Setting up a multiple display with MAC and linux

    This is my personal preferences can change:

    1. Run Synergy server on linux
    http://synergy2.sourceforge.net/

    2. Run synergyc client on mac
    http://sourceforge.net/projects/synergykm

    3. Edit .synergy.conf on your home directory

    section: screens
    linux desktop:
    mac client:
    end
    section: links
    mac client:
    right = linux desktop
    linux desktop:
    left = mac client
    end

    4. On you mac terminal i do this
    alias command="killall -c ssh; ssh -nf -L 24800:localhost:24800 -L 5917:localhost:5901 -L 5918:localhost:5902 linuxbox -- 'sleep 999999999'"

    There could be a better method here

    5. For connecting the macbook to another monitor use this
    mini dvi to vga adapter
    http://store.apple.com/us/product/M9320G/A

    You might have to restart your mac book here.

    Vola you are done.