Stupid or Not: A Bubble/Jail Filesystem for Chrome Extensions
Note: The Stupid or Not posts are simply dumps of ideas that cross my mind and for which I have no time to research into, nor the resources to implement myself. Yet they pass the “3 days – rotten or not” test, so here it is:
Context
I was at a Google Chrome Extension event , and thought of how it would interact with the media that connects to your computer, and would extensions be able to access your filesystem to grab let say, pictures from a USB?
The answer is as usual, “yes and no.” Since the extensions are javascript, for security reasons extensions are sandboxed, so javascript by itself is not able to access the filesystem but it can load dll’s that can access it.
I got curious because:
1) Chrome OS does interact with the filesystem to provide all the same access to media(Eg. USBN Drive) that a regular OS provides.
2) Chrome browser extensions will potentially need to expand to interact with the user’s media.
3) So will this sandbox need to be breached or not?
Idea
A bubble (or jail-like filesystem) where a chunk of the filesystem is assigned to the extension so that it can interact with the media safely, similar to a jail

Idea for a simple jailed filesystem for applications of Google Chrome OS and Chrome Browser Extensions
Is this idea stupid or not? Feel free to comment!
.
Thanks Orlando for the explanation of current state of affairs of the javascript sandbox!
Add comment December 18, 2009
XOR and double linked list
![]()
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:
- The diff variable in node A that contains the XOR of prev and next of A.
- 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? : )
Add comment March 11, 2009
Bits and Pieces of Adventure

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.
Add comment October 19, 2008
Why women shop. A lot.

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.
Add comment October 19, 2008
Musings about the Cuba I remember
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.
Add comment October 19, 2008
Verbifying the web
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.
Add comment October 19, 2008
Roses
Lately I have come across roses in my path, or perhaps they have always been there and I am just noticing now. They are of as many colors as one can imagine, serene yellows, explosive reds, insightful whites. You witness life as you walk by them, the essence of being without words.
My roses are people I know, and others I dont. They blossom around me and I feel Spring unfolding in the most mysterious yet obvious ways. They have fallen in love for a first, second, or third times. Their tears of happiness run down their souls just like dew embraces petals in the mornings, a beauty that cant be contained and explodes to reach every passerby. We are all contagious blossoming selves.
Add comment October 19, 2008
In my world
In this world we lust after each other’s world, I crave hers, she does mine.
In my world we are steady, successful, adventurous, wannabe intellectuals, rational and opportunistic. In my world we value goals, over achieving, and careers that lead somewhere, oh yes, and the ’somewhere’ is already planned. Because we believe life can be planned to a great extent, its many steps can be contained and imagined within our minds. We think we are, we know we are, elite.
In her world there are short term goals, very short term, but ones with the longest term consequences, like marriage for example. There is no hard plan for life, but there is a soft one, to stay close to home, to have a home, to have girls night out with friends from highschool. They marry at 25, 26, they happily expect a child the next year, and maybe another one next.
In this world we lust after each other’s world, I crave hers, she does mine.
Add comment October 19, 2008
The Laws of Simplicity
With so much information to digest and internet services to consume, comes a thirst for simplification. No wonder as I walked down the usual isle at the bookstore of new techie books I craved for that tiny and simple little book, redundantly called The Laws of Simplicity.
About John Maeda, he is a professor at MIT’s Media Lab and has explored both Computer Science and Artistic Design.
Off to the point, here are some of the rules Maeda brings up (I will gradually expand on all of them):
1. Reduce: Achieve simplicty through “thoughtful” reduction. There is a fine balance between how complex a system needs to be and how simple can we make it, so the idea is to remove functionality until we reach the complex barrier. A most interesting observation is that about “shrinking” objects. Maeda points out that we are much more forgiving about the functioning of a smaller object than we are of a bigger one, we are surprised when a small object displays a lot of functionalitis and feautures and praise it if so, however, if it doesnt then it is expected, after all it is a small object. Small and fragile technology is “cute”, which makes me think that really, we pet our gadgets like we would a living thing.
After extraneous functionality has been removed, but we are still left with some complex functionality, an alternative is to hide it, so that “complexity becomes a switch that the owner can turn on or off.”
2. The one: Simplicity is about substracting the obvious and adding the meaningful.
3. Context: What lies in the periphery of simplicity is not peripheral.
4. Differences: Simplicity and complexity need each other.
5. Organize: Organization makes a system of many appear fewer.
Add comment October 19, 2008








