Recent Updates RSS Hide threads | Keyboard Shortcuts

  • ddailygirl 5:02 am on April 21, 2009 Permalink | Reply
    Tags: Chromo Sheetcheat, Chromo Shortcuts

    Shift+Esc Brings Up Tab manager

    Ctrl + 1,2,3,..etc Brings up the first tab, 2nd, 3rd tab..etc

    Ctrl + l Goes to the address bar

    Ctrl + w Closes the current tab

     
  • ddailygirl 9:27 pm on April 16, 2009 Permalink | Reply
    Tags: cheatsheet grep linux

    grep Cheatsheet

    #grep line plus its context (1 line before 3 lines after)
    grep -A 3 -B 1 “patter” filename

     
  • ddailygirl 8:25 pm on April 16, 2009 Permalink | Reply
    Tags: .vimrc Configuration

    Vim Configuration
    To place in your ~/.vimrc file

    syntax on
    set syn=cpp
    set autoindent
    set cindent
    set nu
    set expandtab
    set sw=2
    set smarttab
    set vb t_vb=
    set nowritebackup
    set nobackup
    set tags=/vbs/engn/cscope/tags
    set ts=2
    set is
    set hls
    set ru
    map :bn
    map :bp
    colors morning
    set ic

     
  • Setting up screen in Linux Cheatsheet 

    ddailygirl 1:17 am on April 16, 2009 Permalink | Reply

    Sample .screenrc file:

    Here is an example .screenrc:
    hardstatus alwayslastline
    hardstatus string ‘%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-\
    Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}]\
    [%{B}%Y-%m-%d %{W}%c %{g}]‘
    screen -t Development1 0
    screen -t Development2 1
    screen -t Compiling 2
    screen -t Logs 3
    Screen commands

    screen -xRR -x attaches if it hasn’t been detatched, RR resumes a session or creates a session if there is not one to resume I have this at the end of my .profile so that I automatically resume a session

    Ctrl-a Enter command mode (like <esc> in vim)
    Ctrl-a c Create new window
    Ctrl-a k Kill current window (useful if it is hanging)
    Ctrl-a p,n Switch to previous or next window (spacebar works the same as n)
    Ctrl-a a Switch to last window (like flashback or previous channel for your TV)
    Ctrl-a # Switch to window number #
    Ctrl-a a Equivalent of Ctrl-a in a non-screen world (if your shell is in Emacs mode, this goes to the line beginning)
    Ctrl-a d Detach from the current screen session
    Ctrl-a :help Something like this cheat sheet, but not as cool More Cooler Stuff
    Ctrl-a S Split the current window horizontally into two regions
    Ctrl-a <tab> Cycle between split regions
    Ctrl-a X Remove current revious
    Ctrl-a Q Make current region the only region
     
  • Passwordless SSH 

    ddailygirl 9:39 pm on April 15, 2009 Permalink | Reply

    1. local$ ssh-keygen -t dsa
    2. local$ scp ~/.ssh/id_dsa.pub remote
    3. local$ ssh username@remote
    4. remote$ cat ~/id_dsa.pub >> ~/.ssh/authorized_keys
    5. remote$ chmod 644 ~/.ssh/authorized_keys - this was one of the things that kept throwing me, ssh doesn’t like this file to be world of group writable.
     
  • XOR and double linked list 

    ddailygirl 6:57 am on March 11, 2009 Permalink | Reply
    Tags: programming linkedlist

    bicho

    So this is a post about yet more intellectual masturbation yay! HOW TO STORE THE PREV AND NEXT POINTERS OF A NODE IN A DOUBLE LINKTED LIST IN A SINGLE ADDRESS.

    Intro

    In a double linked list there is the concept of a pointer to the previous and the next nodes. What we want to do here is store the addresses to the previous and next nodes in a single address using an XOR old trick.  To show you how this works we only need these two pieces of node which I got from a neat little explanation here. This code is meant for counting the nodes of the double linked list but in generally shows how to traverse the list encoding and decoding the previous and next addresses.

    typedef struct node {
       struct node *diff;
    
       int data;
    } node;

    Here *diff refers to the XOR of the addresses od previous and next pointer.

    unsigned long countNodes()
    {
       unsigned long nodes = 0;
       node *curr, *prev, *temp;
    
       prev = NULL;
       curr = nodeHead;
       while (curr)
         {
    	nodes ++;
    	temp = curr;
    	curr = XOR(prev, temp->diff);
    	prev = temp;
         }
    
      return nodes;
    }
    
    
    Example
    
    

    Lets say you have a linked list with nodes A, B, C.

    • And Node A is at address 100000
    • And diff has address XOR (prev,next)= XOR (000000, B) = XOR (000000, 101110)  = 101110. 
       
    • Then we go into the loop inside countNodes() and in the first iteration this is what the state looks like :

                  temp = A = 100000

                  curr = XOR ( prev,  diff )  = XOR ( 000000,  101110) = 101110

                  prev = temp = 100000

     

    So now curr, which is the equivalent of the next node,  is pointing at B’s address ( 101110) and we have decoded this address using 2 main things:

    1. The diff variable in node A that contains the XOR of prev and next of A.
    2. A varibale prev that keeps track of that the previous node’s address was. 

    Keep in mind that although we are using 2 variables (and thus addresses) for figuring out what next is, we really only store one as part of each node since from these 2 vars one is reused every iterations, and thats the prev var.

    cool aint it? : )

     

     

     

     

     


     


     
  • Bits and Pieces of Adventure 

    ddailygirl 9:55 pm on October 19, 2008 Permalink | Reply
    Tags: adventure, shopping, travel desire


    How often we go looking for the world and we think we find it in statues from Bombai, or in an African wood figure of features that smell like a foreign land, or earings of metals that are between the cheap and the unknown, or in the generally miscellaneous artifacts we believe are handcrafted. I have always wondered why we pay such high prices for the unknown, for the exotic. If you have ever walked into one of these stores you will notice that prices are far from cheap.
    It is like the essence of people and civilizations is contained within these objects and we just want to absorb it, like you would a scent, and let it fill you of life from other cultures. So we buy these things and take them home, with hopes that it will remind us of how interesting the world is, and most of all, reminds us of our desire to explore, desire that has been perhaps buried along with other dreams. But how often it is that we buy these objects, and they just sit on our shelves, or even our ears, inanimate, they deceivingly showed life of their own, but they are just objects after all. The hands that made them, the cultures that nurtured them, sit somewhere across the globe waiting to be discovered.
    Today while wandering the streets of San Francisco I just happened to enter one of those stores.

     
  • Why women shop. A lot. 

    ddailygirl 9:52 pm on October 19, 2008 Permalink | Reply
    Tags: , anxiety, creative women, depression, procastination, , shopping mania, women shop


    If you are here you were quite possibly looking for ways to end your shopping addiction, or just to understand it? In this first post about this topic, I address the why. Read the how to STOP SHOPPING post.

    Why do we women shop?. This is a list compiled from my own experience, friends and people I have known through the years. These are what I have considered the key reasons but I am open to suggestions.

    Creative need: we crave beauty and beautiful things. We have a “sweet tooth” for pretty things, for colors, shapes and contrasts. Our seventh sense is that of aesthetics (since our six is for understanding those from Mars) and this sense must be feed periodically. Jade’s blog, cravinganthropologie had me do some serious thinking about this.

    Anthropologie is one of those places that I visit to get my “fix” of beauty but buy nothing from, always leaves a void of “all those pretty things I want but should not buy”. Yet I keep visiting because something is better than nothing. This store is a trip to my grandmother’s house, Alice’s Wonderland, a help-Africa recycling project and a girl at home popurry. Here are a few observations you might identify with:

    So Saturday morning we wake up and realize it is time for a “pimp my ride” session, and me, myself and I are the ride. This is a case where we consider ourselves the canvas that we can use to get creative about, buying that necklace that matches the blouse…and the body.

    Would we be satisfied simply arranging accessories and not buying them? Although there is certainly a satisfaction to this, buying the item feels like the signature on an oil painting, the culminating event and final touch of the masterpiece we created. You cant just paint and not sign, you must buy.

    Anxiety: This is similar to eating when you are anxious about work you are doing, about a personal issue, anything you cannot find an immediate resolution to. This leads to the next point, procrastination. But before let me note that plenty of actresses are compulsive shoppers, among many reasons out of anxiety and possibly work related stress. Also, women from low income families spend great amount of time and money (considering their financial status) shopping. Of course it is not at brand stores they go to shop. Instead they go to Ross, Walmart, Target..you name it. Anxieties of a different kind hit this group, and they find relief on buying a lot of many cheap things.

    Procrastination: We all know about procrastination, it is that self deceiving process you undergo when you must do X but instead you find a million tasks to complete before you even attempt doing X. Some of us become such creative procrastinators that we manage to accomplish inhuman amounts of work while on the run from X. It is not surprising that shopping is sometimes another escape for procrastination, surely an effective one since it could extend for hours.

    That guilt feeling: How many times you go to the store and pick a few pretty shirts but on the way to the cashier….guilt grabs you and makes you put them down and away? We hold them in your hands until the last minute, and hope guilt doesn’t strike. Guilt to spend more money, guilt to spend on those overpriced jeans we love, guilt to not be able to control ourselves, guilt, guilt. What do we do about guilt? We bring our girl friends over to help dissipate our guilty sensation, “why not buy if they are buying?,” “She just told me to get that purple blouse,” “I must treat myself”.

    Just a social thing: Stores are another place to “hang out” just like a mall is. You share likes and dislikes about the items you find, or get your friend to tell you how amazing that dress looks on you. It becomes a female bonding experience.

    If shopping has become a problem for you, don’t feel bad, just do something about it, now. Read my post about how to stop for suggestions.

    Author’s notes: This post is a result of me obsessing lately about why we are drawn to buy this or the other. Having been raised in a country (Cuba) where there was no window shopping, little commerce and complete lack of advertisement, shopping is still a constantly evolving theme in my life. I am afraid that my cold eye as an outsider will soon run out so I must make note of this which I see.

     
  • Musings about the Cuba I remember 

    ddailygirl 9:44 pm on October 19, 2008 Permalink | Reply
    Tags: communism, cuba, despretigio cubano, hambre y necesidad, memorias de una cubana, memories, socialism

    Dedicated to my grandfather, Gregorio Arteaga.

    Recuerdo la calidez de las calles de la Habana vieja cuando pretendia ser turista en mi propio pais, pero era inutil. La brisa marina me reconocia como hija y despeinaba mis cabellos al caminar sobre las geometricas aguas de adoquines. Buscaba mis raices, respirando la humedad, jugando a adivinar la proxima flor que creceria entre las grietas de los ladrillos de la vieja catedral. Esa era yo. Un duende perdido entre paredes y brisas de otros tiempos. Muchas cosas me preguntaba; por que las mujeres vestian como en tiempos de la colonizacion para ser retratadas con turistas? Extranarian el tiempo de exclavitud?

    Es una revolucion de artistas sin firma lo que se observa si uno se aventura entre los artesanos de la Catedral. Junto a aromas a madera fresca, vez rostros humildes que acompanan esculpturas con suaves razgos africanos, tal como tallados con los dedos de Dios. Estos rostros de ingenieros, pintores, arquitectos y desocupados tal parece que no saben de su ingenio. Insisten en vender sus creaciones a los visitantes que entre naravillas no saben que escoger. Muchos se han convertido en artistas porque necesitan dinero. Sus manos que antes ojeaban paginas de fisica mecanica ahora entretienen a turistas con artesanias casuales. Sin duda los ideales del ser humano cambian cuando las necesidades basicas no estan satisfechas, cuando sus estomagos crujen como bestias. Despues de sonar con carreras exitosas, un dia despertarorn con la simple necesidad de comer, y vestirse. solo eso y nada mas. Se vieron obligados a descubrir un sin fin de creativas manas en ellos, porque sus estomagos crujian como bestias. Realmente somos criaturas simples.

    Todos traen sus tesoros al gran bazar de la plaza de la Catedral para ganarse unos centavos. Algunos traen los libros de sus heroes de infancia, libros sobre el Che y Marti que ya no le dan valor. A otros les bastan sus dotes musicales para impresionar al publico y con guitarras ardientes le cantan a la belleza de su tierra y mujeres.

    Al doblar la esquina de la Catedral de La Habana se encuentra la Basilica Menor de un tal santo “Francisco de Asis”, una de mis memorias inolvidables. Se esconde de la multitud y sirve re refugio a pensadores solitarios. Recuerdo que al entrar, hasta mis pies se extendian figuras cubistas coloreadas por los vitrales de fondo y casi alcanzaba a ver las siluetas de monjes disfrutando la paz del silencio entre el viejo claustro de columnas toscanas. En alguna enciclopedia lei que una mantra sutil de cantos religiosos se hospedaba en este lugar, y su eco, atrapado por las columnas ingeniosamante disenadas, permanecia prisionero.

    Hoy muchos ya no piensan en historia, arte ni ciencia, pero el aliento a Habana vieja les alimenta el alma. Ahora solo se sientan por doquier a hablar de temas prohibidos, o caminan por las calles roidas con un ojo en el suelo y otro en en cielo, temiendo que un vecino los bautice con agua infernal desde algun balcon. En cambio, los ninos, ajenos a las preocupaciones humanas, corretean por la callejuelas tropezando con los transeuntes y vendiendo Habanos a los turistas como les encargo su madre.

    No es extrano tropezar con un historiador del arte que sufre en ricones la prostitucion de la vieja Habana, o un loco pregonando insensateces. Como explicar que en los balocones de marmol donde antes se sentaban senoras de tercipelo ahora se sientan viejas desdentadas? “Ironia”, se llama esta pagina de la hisotria. No les son utiles los muebles de caoba y cedro or el piso de marmol negro a estas senoras que anoran comida. Con cucharas de plata beben una sopa de agua azucarada en la manana y agua salada en la noche.

    Es esta cultura descavellada la que le da la magia a la Habana, donde cada persona es un brochazo de un impresionista llamado Orate. “Gris, que te quiero Gris”, diria Garcia Lorca si visitara mi pais. Siempre te recordare.

    Writer’s Note: Many like me have had the need to write about the reality of the cuban people. One of the most fascinating yet raw books I have read was El hombre, la hembra y el hambre, by Daina Chaviano. Check it out for an account of the humane and inhumane side of the story.

     
  • Verbifying the web 

    ddailygirl 9:33 pm on October 19, 2008 Permalink | Reply
    Tags: domain names, technology, website names

    Do you ever wonder how the scarcity of simple available domain names has affected this wave of Web 2.0 technologies? Think about it, years before you could name you site something like NetSolutions.com, BlogSpot, PhotoAlbum.com…etc. But now we have to be much more creative and resort to strange names like Zazzle, Twitter, even Facebook is too much of a straightforward name for today’s reality. These newest names besides being far from ordinary words also have a young and playful sound, they are meant to be catchy and easily “verbified” because in the end, they must stick to people’s mind in some other way.
    Perhaps we as users are in such a need to deal with our busy web lives that when a site offers us a simpler way to communicate (alas making their name easily verbified) we appreciate it.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel