Translate

Archive for the 'Random Stuff' Category

If I Ruled The World – Driving Edition

Thursday, September 3rd, 2009

- All traffic lights would have regressive timers to let drivers know when the light will switch from Green to Red and from Red to Green. No more guessing, and no more honking on people to move their clueless asses.

- Traffic lights would have sensors for about a mile before each on every direction, no need to have people sitting at red lights when there are no cars coming. Current sensors suck balls.

- All highways would have 50mph minimum speed limit, and optionally a 90mph speed limit.

- To get a driver license you’d have to complete an obstacle course at a speed of at least 60mph. People who can’t do this should not be allowed to drive.

- Cars would Jam Cellphones Signals as soon as they start moving. I’m sick of stupid people on zombie mode when driving, they’re damn dangerous for everyone around, not to mention the ones texting while driving, those probably deserve to have accidents and die or get a big scare as a process of natural selection, too bad that when it happens they kill innocent people along the way.

- If you waste 3 seconds to get your car moving when a light turns green, the traffic light will take a picture of your license plate and send you a ticket for wasting 3 seconds times the number of people you have behind you.

- Drawbridges would be disabled everywhere between 7-10am and between 4-7pm. It’s ridiculous how many man/years in productivity are wasted everyday when these things open up and hold up hundreds of cars so that one stupid boat can pass, specially at peak hours.

- In the future, if cars are to drive themselves, there’d be controlling computers at intersections making sure cars don’t have to ever stop, coordinating car speeds, making them go from all directions at the same time and trying to keep a minimum separation between them only by a few feet. It’d be pretty exciting to go through an intersection on a world like this. No more stupid traffic lights.

If I think of more I’ll keep updating this list.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Digg Dialogg: Sir Richard Branson

Friday, May 8th, 2009

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Swine Flu FML

Monday, April 27th, 2009

Today, I took my kid to a pig farm near Mexico City, I think I let him get a little too close to the animals, FML

But more seriously, leave a comment if you think the whole Swine Flu is total BS to keep once again the world in fear and have them worry about stuff that doesn’t really matter.

Just check the price of oil today (dropping), and the prices of small pharmaceutical companies on the stock market (some doubling today)

World Domination BS… don’t fall for it.

Who benefits from Swine Flu

  • The US tourism industry by keeping millions of dollars from going to mexico. Just one airplane going to Cancun from say Florida, will take about 300 passengers. In average each passenger will spend at least about $1,000. That’s $300k a pop. I’d imagine there’s at least 10 flights a day going to Cancun from several destinations in the US. That’s $3MM that stay in the US or go somewhere else. Now multiply this by the number of touristic destinations in Mexico plus flights that come from other countries. Their economy must be bleeding tens of millions a day because of this.
  • Companies that use pork derived products, now they can get pork for a lot cheaper. Think McDonalds, Wendy’s, Burguer King, Super market chains. Buy low, sell high
  • 3M has had to step up their mask production to keep up with the demand coming from CVS, Walgreens, Rite Aid, etc.
  • Pharmaceutical companies related to vaccine R&D

In the meantime, I see nothing but a pattern of destructive media against mexico, first it was the Drug lord wars, then Swine Flu, and more recently an Earth Quake (I totally believe the US must have weapons to produce earthquakes, it’s the perfect attack, you can blame it on mother nature)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

How to make your own Quick & Dirty Hex File Viewer in Java

Saturday, April 18th, 2009

Update: You might want to read this new version of the code instead. Thanks ispak

I was playing with a hex editor recently and then I thought it would be pretty easy to make a program to output what you see on a text editor. Here’s a quick & dirty Hex Visor I wrote in like 5 minutes with Java. It shows 15 bytes per line, and on the right side it prints all the visible characters of the ascii table, the non-visible ones are replaced with “.”

Enjoy:

//HexViewer.java
import java.io.*;

public final class HexViewer {
    public final static void printFile(String filePath) {
        File f;
        try {
            f = new File(filePath);
        } catch (Exception e) {
            return;
        }

        try {

            FileInputStream fis = new FileInputStream(f);
            while (fis.available() > 0) {
                char[] line = new char[16];
                for (int i=0; i < 16; i++) {
                    int readByte = fis.read();
                    String paddingZero = (readByte < 16) ? "0" : "";
                    System.out.print(paddingZero + Integer.toHexString(readByte) + " ");
                    line[i] = (readByte >= 33 && readByte <= 126) ? (char) readByte : '.';
                }
                System.out.println(new String(line));
            }
        } catch (Exception e1) { e1.printStackTrace(); }
    }

    public final static void main(String[] args) {
        if (args.length == 0)
            return;

        printFile(args[0]);
    }
}

Usage:

java HexViewer &lt;path to file> | less
java HexViewer Desktop/Puppet.wmv | less

30 26 b2 75 8e 66 cf 11 a6 d9 00 aa 00 62 ce 6c 0&.u.f.......b.l
74 14 00 00 00 00 00 00 07 00 00 00 01 02 a1 dc t...............
ab 8c 47 a9 cf 11 8e e4 00 c0 0c 20 53 65 68 00 ..G.........Seh.
00 00 00 00 00 00 f4 10 68 f9 49 76 2e 43 b5 9f ........h.Iv.C..
09 0a 2d 19 45 7c 32 3a 24 00 00 00 00 00 70 ee ..-.E|2:$.....p.
14 06 fb da c7 01 28 01 00 00 00 00 00 00 00 8c ......(.........
bb 53 00 00 00 00 10 88 dd 52 00 00 00 00 b8 0b .S.......R......
00 00 00 00 00 00 02 00 00 00 40 1f 00 00 40 1f ..........@...@.
00 00 90 50 02 00 b5 03 bf 5f 2e a9 cf 11 8e e3 ...P....._......
00 c0 0c 20 53 65 61 10 00 00 00 00 00 00 11 d2 ....Sea.........
d3 ab ba a9 cf 11 8e e6 00 c0 0c 20 53 65 06 00 ............Se..
33 10 00 00 a9 46 43 7c e0 ef fc 4b b2 29 39 3e 3....FC|...K.)9>
de 41 5c 85 27 00 00 00 00 00 00 00 01 00 0c 65 .A\.'..........e
00 6e 00 2d 00 61 00 75 00 00 00 5d 8b f1 26 84 .n.-.a.u...]..&.
45 ec 47 9f 5f 0e 65 1f 04 52 c9 1a 00 00 00 00 E.G._.e..R......
00 00 00 02 01 ea cb f8 c5 af 5b 77 48 84 67 aa ..........[wH.g.
8c 44 fa 4c ca 62 01 00 00 00 00 00 00 06 00 00 .D.L.b..........
00 01 00 0c 00 02 00 02 00 00 00 49 00 73 00 56 ...........I.s.V
00 42 00 52 00 00 00 00 00 00 00 01 00 34 00 00 .B.R.........4..
00 06 00 00 00 44 00 65 00 76 00 69 00 63 00 65 .....D.e.v.i.c.e
00 43 00 6f 00 6e 00 66 00 6f 00 72 00 6d 00 61 .C.o.n.f.o.r.m.a
00 6e 00 63 00 65 00 54 00 65 00 6d 00 70 00 6c .n.c.e.T.e.m.p.l
00 61 00 74 00 65 00 00 00 4c 00 31 00 00 00 00 .a.t.e...L.1....
00 02 00 0c 00 02 00 02 00 00 00 49 00 73 00 56 ...........I.s.V
00 42 00 52 00 00 00 01 00 00 00 02 00 34 00 00 .B.R.........4..
00 0c 00 00 00 44 00 65 00 76 00 69 00 63 00 65 .....D.e.v.i.c.e
00 43 00 6f 00 6e 00 66 00 6f 00 72 00 6d 00 61 .C.o.n.f.o.r.m.a
00 6e 00 63 00 65 00 54 00 65 00 6d 00 70 00 6c .n.c.e.T.e.m.p.l
00 61 00 74 00 65 00 00 00 4d 00 50 00 40 00 4d .a.t.e...M.P.@.M
00 4c 00 00 00 00 00 01 00 2e 00 03 00 04 00 00 .L..............
00 57 00 4d 00 2f 00 57 00 4d 00 41 00 44 00 52 .W.M./.W.M.A.D.R
00 43 00 50 00 65 00 61 00 6b 00 52 00 65 00 66 .C.P.e.a.k.R.e.f
00 65 00 72 00 65 00 6e 00 63 00 65 00 00 00 a7 .e.r.e.n.c.e....
3f 00 00 00 00 01 00 34 00 03 00 04 00 00 00 57 ?......4.......W
00 4d 00 2f 00 57 00 4d 00 41 00 44 00 52 00 43 .M./.W.M.A.D.R.C
00 41 00 76 00 65 00 72 00 61 00 67 00 65 00 52 .A.v.e.r.a.g.e.R
00 65 00 66 00 65 00 72 00 65 00 6e 00 63 00 65 .e.f.e.r.e.n.c.e
00 00 00 b0 06 00 00 74 d4 06 18 df ca 09 45 a4 .......t......E.
ba 9a ab cb 96 aa e8 a4 0d 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

This how it looks on a full blown hex editor like HexEdit:
Same file on HexEdit

The Code of HexViewer.java on emacs:
HexViewer.java on emacs

Screenshot of the output:
HexViewer in action

Homework
Hack the code so that it ouputs the first column shown on the HexEdit screenshot. That column represents the byte position of each row. It’s basically a counter incremented 16 units at the time, and shown in Hex.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

How to get free press for your billion dollar corp using and branding kids all over the country

Wednesday, March 18th, 2009

To pull this Marketing Stunt, you need to own a billion dollar corporation, publicly traded with a market cap of about USD $100 billion traded on the NASDAQ. Then you need to have yearly revenues of $21,795,550,000 or about $41,467 per hour.

Having all this money, there’s an ingenious evil marketing strategy you can implement that will make you look good, get your free press and it’s only going to cost about $150,000, which is the equivalent of let’s say 3.6 hours worth of your revenue, so think about it, in 3 and half hours from now you should have the budget for it.

If you have made up your mind 3.6 hours after reading this, here is what you need to do:

1) Start modifying the logo of your company on every holiday or special occasion.
2) Create and promote a competition in all schools across the country for kids to redesign an “out of the box” version of your logo, and offer $50,000 in prizes.

Open the competition to all U.S. residents between the ages of 5 and 18 who attend elementary and secondary schools (i.e. grades K-12) in the U.S. The National Winner will win a $15,000 college scholarship to be used at the school of their choice, a trip to your main Office, a laptop computer, and a t-shirt printed with their doodle. Also award the winner’s school a $25,000 technology grant towards the establishment/improvement of a computer lab. (This is where you’ll spend roughly $50k)

The Prizes will go as follow:

  • Each of the other 3 National Finalists will win a trip to your main Office, a laptop computer, and a t-shirt printed with their doodle.
  • Each of the other 36 Regional Winners will win a trip to your main Office and a t-shirt printed with their doodle.
  • Each of the other 360 State Finalists will receive an official winner’s certificate.
  • What your company gets in exchange:
    Free Press on all major media outlets TWICE, once when the competition is announced and once when the winner is announced. You know that if you wanted to get that amount of attention it would cost you millions of dollars in advertising. Nothing beats free press baby!

    Best of all, you will inspire millions of kids ages 5 to 18 to admire your company and your brand, you will imprint your logo in their brains permanently, they will redraw it over and over while thinking how to make your company better. They will even write essays about you.

    All the kids get to think they’ll make the best logo and win the first prize (poor bastards). This is the best time to create an image of trust in their minds when they think of your brand. In the future it will be hard for them to pick any other competing company over yours. In the end they will also be more than willing to work for you once they’re old enough.

    And remember… Don’t Look Evil!

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)

    Will ‘Smell’ ever be a part of entertainment?

    Sunday, December 21st, 2008

    I often get sad when I remember that there’s hardly a way to realize the duration of the present, but it’s comforting to know that we have books, photography, audio recording and video recording as very tangible ways to bring the present back.

    There’s however one thing lacking in these technologies to relive the past or to tell stories, and I think it could be one of the most powerful ways of telling a story, smell. We all have at some moment smelled something in particular and have that smell help us vividly remember a moment 10 years ago like if it was today.

    I keep thinking on how to do it, and I want to share an idea I had last night after thinking about it for a few minutes.

    At first I thought, is there a way to quantify or mix chemicals to produce smells out of basic components, the same way we can do it with color (RGB or other schemes)? hmm, maybe, maybe not, I think there’s too many chemicals involved, so scratch that. However, I believe that a smell, once it hits your brain, it’s nothing more but a series of electrical impulses sent to a specific area of the brain which is in charge of making you smell something.

    We need a sensor, our noses, and then that information, somehow must be transformed to electrical impulses, and I think this is the foundation to create a device to record smells.

    First we’d need to have some sort of electronic nose, whoever could build this will have to take a serious look on how our nose detects smell in the air. I suppose we’ll have iteration after iteration of this device until it can record up scents not even humans can detect (this reminds me of mp3 and how it just ignores a lot we can’t hear).

    Then, once you can record this information, the problem is… how do you get it in the brains of an audience, I don’t think we’d attach anything to our noses and have something mix substances to reproduce a smell, that’d be ridiculous, instead, we need to send an electrical signal to our brain so that the smell can be interpreted and smelt, without using our nose. So I suppose in theory, there will be at some point in history a device that can broadcast brainwaves to a lot of people on a movie theater audience, or on your home tv.

    The applications would be awesome… Imagine playing Gears of War 8 with smell, the battlefield experience would be so much more engaging if you could smell the smoke, the lead, the blood, …

    After that we’ll probably also figure out a way to record and broadcast weather conditions, and make us feel heat, or cold, or wind, all while sitting in front of our console, or on a movie theater.

    If for some crazy reason you start developing this technology, or you know of someone doing it, please let me know, it’d just be awesome to know that this is happening during my lifetime.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)

    Best Rehabilitation Program for Prisoners

    Friday, December 12th, 2008

    Dancing!

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)

    This is flying

    Thursday, December 11th, 2008


    wingsuit base jumping from doubleA on Vimeo.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)

    Amazon’s Black Friday deals voting is now open

    Tuesday, November 25th, 2008

    Amazon's Black friday Playstation dealsBlack friday is around the corner and it’s become a shopping tradition at Amazon.com to make the craziest deals available in a democratic fashion.

    They have 18 crazy deals to propose organized into 6 rounds. Amazon users get to vote on each of these rounds for their favorite offer, what will you vote for?

    Then a limited number of customers are selected at random to participate in the buying round, where they race to buy deals for that round.

    This year’s potential winning deals include a Samsung 46-Inch 1080p HDTV for $699, an ASUS Eee PC 900 Netbook for $129 and a KitchenAid Professional Stand Mixer for $69. See the Product Pricing and Availability section for the full list.

    It’s different from last year
    The biggest difference is that this year, Customers Vote is a race. Amazon will invite more customers to participate in the buying round than they have available deals.

    Amazon recommends selected customers sign in early on the buying day, as deals are sold on a first come, first served basis. (Check here for the buying days calendar.)

    Another difference is that customers selected to participate in the buying round will be able to buy any (or all) of the deals, not just the one they voted for.

    And remember, only customers who voted can participate, so vote now!

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)

    What grinds my gears – Tennis

    Friday, September 5th, 2008

    I recently had the privilege to attend the US Open for the first time in my life, and as with everything I started questioning things:

    Scoring

    What’s with the ilogical scoring? Who came up with 15,30,40,Deuce, Advantage…
    Why such an almost random sequence… why not, 1,2,3 ? or if anything 15,30,45!!!

    Why when a set is tied 5-5 do they have to do it till 7 (tie-break)?, just let the first to go to 6 win that set, as if the matches weren’t long enough.

    Callings

    So 0, is not called zero, it’s called Love? wtf
    Update: Simon expained it’s “L’oeuf“, which means “Egg” in french, probably a relationship between the shape of a “0″ and an Egg.

    When a serve hits the NET, they call it LET? wtf

    And when they go into “deuce” it always sounds as if they’re calling the players Douchebags…”Douche!!

    Other than that, it’s one hell of a game, one of endurance, precision, technique, focus, strategy, excitement, I loved it.

    Thank you wifey for taking me there for my birthday, it was awesome.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)


  • Categories

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004