Saturday, September 18, 2010

My fantastic .vimrc file.

I get a lot of "wow what editor is that?!" around my desk at work these days. I'm going to be brief about this: its vim 7.

Here it basically is (I removed some references to custom python modules which I won't places here.)


"""                                                                                      
""" Indentation settings                  
"""                                       
""" Since I use python, I prefer using spaces
"""     Yes this makes the code bigger    
"""     However, if you use: set list     
"""     You can visually identify where a \t or "^I" came in
"""
set tabstop=4       "Tabs at 4 spaces     
set shiftwidth=4    "Not sure             
set autoindent      "Auto indent helps    
set expandtab       "Expand tabs to spaces

"""
""" Visual settings
"""     
"""     These settings are the "WOW" factor
"""     syn on is just syntax
"""     cursorline gives you a horizonal line
"""     cursorcolumn gives you a vertical line
"""     Together they give you a crosshair,
"""         which means you cant miss your cursor
"""         even if your screen is 30" big
"""
syn on              " syntax
set cursorline      " Horizontal bar
set cursorcolumn    " Vertical bar
set nu              " Line numbers
set ruler           " Position

"""
""" Search and semi-word completion settings
"""     
"""     Searching in code can be really easy with the right settings
"""
set ignorecase      "Case insensitive search
set infercase       "This is for autocompletion (ctrl-p or ctrl-n)
set incsearch       "Emacs like incremental search, search as you type
set hlsearch        "Highlight the search pattern
" I like a green search
highlight Search ctermfg=Black ctermbg=Green cterm=NONE


"""
""" General and misc
"""
set autoread        "Automaticall check if the file was modified
set history=100     "Cmd history (:,:)
set novisualbell    "NO BELL, I use putty/screen combo, visual bell HURTS ME
set bs=0            "Backspace set to 0, This means I wont erase what I didn't write

"""
""" Tabs key bindings
""" 
""" New tab with ctrl+y (I use ctags, ctrl+t is reserved for that)
"""     Normal mode ONLY
nmap :tabnew                    
""" New tab with ctrl+y (I use ctags, ctrl+t is reserved for that)
"""     Insert mode (Escapes out and types in tabnew)
imap :tabnew
""" Normal mode only, YOU dont want this in insert mode
""" You'll never use capital X or Z again
nmap X :tabnext
nmap Z :tabprev                       

"""
"""                                       
""" Basic vim Fix/Canonical functions     
"""
"""                                       
function! GetFixCanonicalToReadable()     
python << EOF
import vim
import sys                                
print sys.argv                            
print len(vim.current.buffer)             
for each in vim.current.line.split( "^A" ):
    each = each.strip()
    if not each:
        continue
    print each.split("=")
EOF
endfunction

comm! -nargs=? -bang PP call GetFixCanonicalToReadable()

Friday, August 27, 2010

Slightly off topic: .screenrc for ... screen ofcourse

  I've been using screen for only like 5 years now, not even really. I'm very into the tools I use and carving them to my tastes. So... I often find myself looking for new ideas for my .screenrc file. Here are some links to places that have tons of .screenrc ideas. Also, my .screenrc is posted here.
#Being xeio .screenrc


#change the hardstatus settings to give an window list at the bottom of the                         
#screen, with the time and date and with the current window highlighted
hardstatus alwayslastline

bind ' ' windowlist -b

defscrollback 2000

#caption always "%{= kc}%H (system load: %l)%-21=%{= .m}%D %d.%m.%Y %0c"
#caption always "%{= kw}%?%-Lw%?%{+b kw}%n*%t%f %?(%u)%?%{= kw}%?%+Lw%?"
#caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
#caption always "%?%F%{.bW}%?%3n %t%? [%h]%?"
#caption always "%{rk}%H %{gk}%c %{yk}%M%d %{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw%?"
#caption always "%{kG}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kG}%?%+Lw%?"
#caption always "%=%c:%s %Y-%m-%d"
#caption always "%?%{+b kw}%-Lw%?%{yK}%n*%f %t%?(%u)%?%?%{wk}%+Lw%? %{gk}%=%c %{yk}%d/%M/%Y"
#caption always "%{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw%?"

#11 classic
#hardstatus alwayslastline "%?%{wk}%-Lw%?%{yK}%n*%f %t%?(%u)%?%?%{wk}%+Lw%? %{gk}%=%c %{yk}%d/%M/%Y"
#hardstatus alwayslastline "%{+b kr}[ %H ] %{kw} Load: %l %-=%  %{kb} %c:%s  %d.%m.%Y "
#hardstatus alwayslastline "%{+b kr}[ %H ] %{ky} Load: %l %-=%{kb} %c  %d.%m.%Y"

# usual red
#hardstatus string '%{= rK}%-Lw%{= KW}%30>%n%f* %t%{= rK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'
hardstatus string '%{= kg}%-Lw%{= KW}%30>%n%f* %t%{= kg}%+Lw%< %{= kg}%-=%D %d %M %Y %c:%s%{-}'


bind = resize =
bind + resize +1
bind - resize -1
bind _ resize max


#End


Utah.edu ( The screen manual )
http://www.cs.utah.edu/dept/old/texinfo/screen/screen.html



Linux Journal (Explains some powerful uses for screen)
http://www.linuxjournal.com/article/6340

Guckes.net ( The holy grail on .screenrc files )
http://www.guckes.net/Setup/screenrc



blog.eater.org 
http://blog.eater.org/2008/12/new-screenrc-hardstatus-string.html

Softpanorama (.screenrc)
http://www.softpanorama.org/Utilities/Screen/screenrc_examples.shtml

Archlinux (Screenshots and .screenrc files!)
https://bbs.archlinux.org/viewtopic.php?id=55618

UAlberta.ca (Setting up titles in screen, NOT VERIFIED BY ME)
http://sunsite.ualberta.ca/Documentation/Gnu/screen-3.9.4/html_node/screen_50.html

Slaptijack.com (Mutltiple users on ONE screen, shared terminal for true paired programming)
http://slaptijack.com/system-administration/multiuser-gnu-screen-long-distance-teaching-tool/

Saturday, August 7, 2010

Need to do some shelves...

With a new apartment, you have nothing.

Here's a link to some shelving ideas.
http://notbeige.wordpress.com/2009/04/29/6-great-diy-shelving-tutorials/

Friday, August 6, 2010

The last day of 7 years at the New York Stock Exchange (NYSE) Floor Technology

    
    It's been 7 years... that's between 28 to 35% of my life and my 100% of my adult life.
    I was recruited out of high school by Mark Lewis to work at SIAC ( Securities Industry Automation Corporation ) which was later fully purchased by the NYSE. I started out in an internship program rewarded to high school students who were carefully interviewed by several VPs all at once. The package included summer internships every year and $2000 for college each year. It was tied to a few select universities in Brooklyn and Manhattan, namely Polytechnic University, now NYU Poly.
    I spent my first internship working for Kevin Staley and Toi Wilson in the windows administration department formerly known as ONS. Times were just starting to get bad in the company then. Budgets were starting to get slashed, laptops were no longer being offered to all employees, only some.
    The next summer, the company was really getting worse. Layoffs were happening. I interned in the AMEX's system support group. I don't remember much about who I reported to or even their names. It was probably one of the best internships I had because I learned all my UNIX and Linux skills there. I was handed a guide on "vi." The only problem is... they never gave me word when my internship would end till the day it ended... that felt kinda like a layoff or getting fired, for an summer intern. So I care not for this.
    Then I got REALLY lucky next summer. I interned in a real software development department. The department formerly known as DisplayBook Development, now known as NYSE UTP Floor Development. I was lightly interviewed by Frank Carrera. I started in June 2005. Towards the end of the summer... I couldn't believe the stuff I dived into, specifically Python which I fell in love with. I also fell in love with a beautiful girl in Florida, Masha, so I aimed to keep the internship so I could afford the plane tickets to see her. I successfully kept the internship, but the relationship... didn't last long. I stayed an intern till May 2007, when I had an full-time offer from FactSet Research Systems waiting for me. The NYSE counter offered then and here I am still.
    I truely appreciate what the NYSE/SIAC provided me. I wouldn't be experienced in C++ and Python at all if it wasn't for Frank and his team of extraordinary engineers.
    I'll begin a new C++ position in midtown Manhattan Monday.
    

Tuesday, July 27, 2010

Friday, July 16, 2010

Learn one real concept a day will make you smarter than yesterday.

    This is really a specific thing I'm writing about here, not the idea behind the title above. Get ready, this is a real C++ treat, so Faith and anyone else who doesn't understand this stuff, stop here.

    Straight out of Effective STL (Scott Meyers) comes a tip that I and most of you out there already know... its pretty obvious:
        Remember to delete the pointers you put into any container.
        Example:
  std::vector vOfMarketableOrders;
  // ... fill with a bunch orders you will use right here and right now, dynamically allocated
  // done
  And Mr. Meyers goes on to describe a nice templated function within a struct called DeleteObject, which will be used in conjunction with for_each to delete everything afterwords. I'd say this is pretty obvious to most C++ programmers who actually have a job with C++, so here's the kicker:

  Never create a container of auto_ptrs.

  Basically, auto_ptrs are a wrapper for pointers which aims "transfer ownership" of pointers between auto_ptrs. So if you use a list, vector, map of auto_ptrs, you could easily lose the address of some dynamically acquired memory with the use of an algorithm. One particular algorithm he brings up is quicksort, which uses a pivot element to sort, which is a temporary copy within the quicksort implementation. So, due to the destructive nature of an auto_ptr, you will lose the memory address somewhere with this.

Thursday, July 15, 2010

Bond 23... Never say never?

   I'm a big fan of the James Bond stuff. It's not a much of a secret about me, but it's also not like I buy double plated 007 cuff links, however I'm deeply saddened that there are many reports that Bond 23 (http://www.imdb.com/title/tt1074638/) will never surface (http://www.imdb.com/title/tt1074638/news?start=21). It was due out this year or next year. It was then delayed to 2014 (If we ever get there) ! Now it seems MGM (http://www.mgm.com/, not to be confused with MGM Resorts), the company behind the movies is in some deep financial turmoil and will never post this movie.

Thursday, July 8, 2010

Little did you know about Multiple Inheritance and Virtual Pointers in C++

This is a geeky nerdy post.


   First of all, kudos to Mr. asadullah.ansari for posting this far reaching demonstration of the virtual pointer and how it works in C++. In fact it such a good way to demo the vptr and vtable, I had to post it here too.


  Hint for most of us out there unfamilar with the following:
    
typedef void (*Fun)(void);


  This is a typedef which means, Fun is a pointer to a function whose return type is void and takes in no arguments.


  i.e.
     void FooBarFunc( ) { std::cout << "Row faster!!!" << std::endl;  return; }
     void (*PointerToFunctionVariable)(void) = FooBarFunc;
     std::cout << "We're going white water rafting..." << std::endl;
     PointerToFunctionVariable();


   output:
        We're going white water rafting...
        Row faster!!!


http://www.dreamincode.net/forums/topic/45816-detail-about-how-vptr-and-virtual-table-works/


  Keep in mind, example 11 is the best. It demonstrates that with Multiple Inheritance brings multiple vptrs to separate vtables.

Wednesday, July 7, 2010

My own personal Thanksgiving.

   Twenty Five on the Seventh of the Seventh, Twenty Ten. Turning 25 five means nothing to me.

   In fact, 25 years old and counting means so nothing to me, I'm going to write a blog entry about it. Despite the fact that the degree to which my English writing skills have deteriorated is exactly inverse to my c++ and python skills have refined... I'm going to try to write something meaningful here, hoping to put a little save a little sunshine into my life backpack for darker days ahead.

   I enjoy a really great life. I have both my parents to thank for that. In fact, if it wasn't for how great my Mom and Dad are... there would be no blog entry at all. Thanks to them I'm educated and healthy. Part of my core motivation for writing this is hoping that people who read this try to imagine what I see. I'm addressing all of you, my friends, former friends, acquaintances, and strangers.

  I want all of you to stop and think... we've been through many milestones together and apart. All these milestones have been celebrated more or less the same with music and consumables. Each of these milestones could have not existed if it wasn't for health. It's the single most important asset anyone has and it is to be protected at all costs. Anyone who intentionally or unintentionally hurts your health, either physically or mentally, is your enemy and should be considered dangerous; this may even include yourself and close friends and family. In my eyes, there are no exceptions.
  So I'm thankful to my parents for my health today, they've taken good care of me by providing excellent food throughout my life and encouraging a healthy lifestyle which focuses on being responsible with money and education.

  I'm also very thankful for my education. I realize that without, I wouldn't have the opportunity to try more advanced things in life.

  But most importantly, I've very thankful to them for they're courage and successful efforts at providing me something that only a lucky few have, a stable and health household which included two loving parents who loved and cared for me without exception.
  I've done some stupid and insane things in the last five years, which has put them through some crazy and insane stress, but not once have I ever heard them castrate me by calling me stupid or dumb. They've never put my down for my failed attempts at whatever it might have been, instead they supported me and bailed me out. Those bailouts provided me security to go and try more stupid and insane things... but I've calmed down a lot.
   They never gave me flak for not getting the best grades.
   They've never ridiculed me for the deceitful tattooed girls I've dated.
   They've never shown me the door because I smelled of vodka, although it was threaten.
   They've never told me go stick my head in the sand somewhere because I crashed a car... again; they even PAID for my speeding tickets.
   They never criticized me for wasting their money on plenty of things I minimally or never used even though they knew I was just over excited or something for nothing. 
   They even got me another laptop when it was stolen in high school, despite their warnings. 
   They didn't even say a word when I invited a ex-girlfriend/friend/girl from Pennsylvania to stay in our guest room for 8 months.

  Some might call this spoilage and honestly it's only spoilage to those whose parents aren't as capable of providing level of love and care to their children. It's not spoilage because I never once blatantly claimed these things as a right to have, I've always acknowledge these items as gifts and privileges; so I like to think I repaid them by being responsible, rational, respectful and successful in return.
  

Thursday, July 1, 2010

A barber shop shave everyday...

  I've always wanted a hot lather machine, or at least wanted to get one as a gift for my Dad. I've had this idea for over a year now and never approached it. Instead I bought two electric razors which I'll comment on later.

  After reviewing a few products on Amazon.com, I've got this summary:

At under $10 we have the gimmick HGL1 which has some really bad reviews:
Cheap: Conair HGL1

This one under $10 as well gets slightly better reviews: (HGL11)
Probably a gimmick: HGL11

Then we jump up to $80-$100:
Not a gimmick: Conair HLM10
Not a gimmick: Conair HLM11
These two get the best reviews but at nine to ten times the price.

Then theres the king... at almost $250
Actual Lather King Machine


I'll most likely go with the HLM10 because it seems like a product that will perform for what you paid.
Conair HLM10

Monday, June 28, 2010

To be yourself is all that you can do...

  1. Be Yourself by Audioslave


      1. Play song from iLike.com
        Out Of Exile - 2005 - 4:38
        Listen on: iLike - Rhapsody - Pandora


      1. I don't know what is it about the guitar in this song but I love both the solo and chorus.

Friday, June 18, 2010

$38.00 gets you an M3 ZCP test drive.

So I was over at OpenRoad BMW on Monday. I picked up my 550i after a cracked rim had to be replaced (insurance covered this, thank god)... and I walk over to sales and ask them if I could test drive an M3 (ZCP)...

Victor, sales manager, leads me to Hazi, sales, who lets me get into this White Comp Edition with Carbon Fiber roof M3. This thing was angry looking; a new born with 7 miles on it, so I couldn't really step on it, just get a light feel for it. As loud and angry as this car is... I couldn't get the feel for highway speeds, but for sure it can hit 155mph easily.

Unfortunately the iDrive froze up, so I couldn't see all the settings M3's have. The DCT tranny is crazy. First off, I come from both a steptronic in my 550i and a standard in my z4. The DCT is weirdly in the middle. It won't move if your foot is off the brake and the gas (while in drive). It sits there. Once you push the gas it just grabs the clutch and goes. It won't shift for you either. You have to shift using either the stick or the steering paddles.

Simply perfect.

The lease is decent as well. $5000 down and $1119 a month for 36 months is acceptable for a car like this.

Monday, June 14, 2010

Chuck! Season 4...

Chuck has definitely been my favorite show in the last 2 years... I got into it when season 2 started and they killed off that NSA director with the trojan horse intersect. The show is definitely a niche show... who ever the writers are behind it, they know a couple of good technical computer terms which makes it humorous to me... besides that, here is a list of pros for the show:
1) Awesome music selection...
Everything from the starting song to the little beats here and there makes gives this show strong charisma... even the 80's selection which I'm not generally a fan of.
2) As previously mentioned, the technical ideas behind the "intersect" are, without a doubt, science fiction, but its good science fiction. The intersect 2.0 idea however goes a bit too far... but they put limitations on it with the "governor" which is actually a real architecture design pattern....
3) I've never been there, but this show makes California look really interesting. I'd love to go.
4) The Buy More is hilarious... all the actors in the background really make me laugh.

Now... on a side note, I would be leaving out the best part if I didn't mention Yvonne Strahovski and Sarah Lancaster are great eye candy...

Gift Shop Girl! (Scrubs)

And Julia Ling is pretty cute as well...

Is it the coffee or is it the caffeine ?

I like this chart, so I thought I'd just put it up here...

http://www.cspinet.org/new/cafchart.htm

Typical coffee basically has 160 mg of caffeine per 8 oz.
Typical energy drink ranges from 80 to 160 mg per drink...

So... which really is better for you?
Which is cheaper?
Which has the least harmful effect on you (long term) ?

Friday, June 11, 2010

My keyboard is dying...

I've been using a nice ThinkPad Travel keyboard with UltraNav for like 2 years and its finally calling it quits... I would fix it myself but I want a new keyboard anyway if there exists something better.

So I want to try to find something better and I'm looking at the following:
I prefer wired keyboards because I type a lot and if in the event I have to finish something and I need batteries to do it... I'll die.

DAS KeyBoard (German)

DAS KeyBoard with BLANK KEYS ! I love this idea... could be funny to see how co-workers use it when they come over...

I have no idea what's with the screen on this one:

I've never tried the split design of a Microsoft keyboard, could probably prevent future carpal tunnel.


I would burn cash on an Apple product because they're so pretty... but I don't think this has an insert key which I need... I take that back, I don't need it. WinXP has a virtual keyboard I could use instead for the insert key... ( I use this to open a stock on something called the NYSE DisplayBook at work ).
Slim:

This might be too tiny and too weak:


Overall I'm really not finding anything...

HELP.




Wednesday, June 9, 2010

The simple things I love from 6th grade... XOR revisted

Don't you miss truth tables?

I forgot what XOR means and I had to look it up...

Summary: Every bit is different from its equivalent offset bit.

Quote: "one or the other but not both"

Logic gate:




Wouldn't we all love both though?

And for those who code C++:
a^b is a XOR b and a^=b is a XOR b assigned to a...


Friday, March 5, 2010

The Toren Review Pre Post

I'll be posting a review about my Toren Grand Opening experience.

Friday, February 12, 2010

Little update here

I'm becoming a fan of blogging very slowly... it'll be my journal in a way.

Here is a link for everyone out there to read up and study a bit:


Pancake sorting is interesting. Get it done.