Dan Fitch's posterous account

How I spent $1799 at LivingSocial.com and didn't even know it

So my wife and I are looking at a vacation package that was on escapes.livingsocial.com, she handed me the laptop and in the process we accidentally clicked on the big "Buy Now" button.  ..... The next page informed us that we had booked a $1799 vacation package to Panama.  Not that I wouldn't want to travel to Panama, but I was not interested to do so currently.  Without so much as a "Would you like to charge $1799 to your credit card".  

I assured my wife that there was no way that they had actually charged my card, but oh yes they had already started the paperwork.  (Below it looks like it had even been done twice....very strange, but most likely the first one was to check for available funds)

Screen_shot_2011-04-13_at_10

So the page that was staring back at me did have a cancel button, which I then clicked and they confirmed to me that my trip had been canceled but, I am sure that this charge will be pending for the next 15-90 days where I will have to pay my card down only to later get the credit back.  

So moral of the story is don't browse escapes.livingsocial.com with your mouse too close to the "Buy Now" button.  

I am not saying that I don't like the one click "option", but it should be just that an option, like on Amazon.com, or a $15 burger joint, not an $1800 trip.

UPDATE: 

Charges have already been removed.  Which is much faster than I am used to with credits back to my account.  

 

Hive parse_url

I have recently started working with Hive, an Apache project which sits on top of Hadoop and handles all of the management of turning SQL like commands into Map Reduce statements.  So far it is great, and I am using it to parse gigs worth of log data and make it available for queries, and reports.  

So this comes to a string manipulations method that works really well for this.  I am most interested in the query parameters on the url and parse_url has become my friend.  Parse_url takes 2 parameters that I use, the url, and the part of the url that you want the function to return.  

If your select statement had a field named url the you would use the method below to extract the query data from the url.

url = "http://danfitch.net/stuff?a=1&b=42&x=abc"

parse_url(url,"QUERY")

The value that is returned is "a=1&b=42&x=abc".  And because we can take this one step further and convert the query into a hash map using another great method "str_to_map".  str_to_map takes 3 parameters, the string you want to convert, the character separating the key value pairs, and the character separating the key from the value.

params = "a=1&b=42&x=abc"

str_to_map(str_to_map,"&","=")

The value that is returned is a Hash with the keys and values {"a"=>"1","b"=>"42","x"=>"abc"}.  And because Hive supports a MAP type you take the values returned from str_to_map and store them into a MAP field.  So if your url changes and you add a parameter to it you won't have to update your Hive table it will just accept the new key and value into its MAP

 

Example

 

 

CREATE TABLE AKAMAI_LOGS (
ip STRING,
day STRING,
time STRING,
request STRING,
result STRING,
bytes STRING,
referrer STRING,
user_agent STRING)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
"input.regex" = "(\\S+)\\s\\S+\\s\\S+\\s\\[([^:\\]]*):([^\\]]*)\\]\\s\"([^\"]*)\"\\s(\\d*)\\s(\\d*)\\s\"([^\"]*)\"\\s\"([^\"]*)\"\\s\"([^\"]*)\"$"
);

 

CREATE TABLE REQUESTS (
dt STRING,
ip STRING,
params MAP<STRING,STRING>)
PARTITIONED BY(day STRING)
STORED AS SEQUENCEFILE;

#Below I get the raw data from the logs and prep it before putting it into my table.

INSERT OVERWRITE TABLE REQUESTS PARTITION(day)
select akama_logs_output.dt, akama_logs_output.ip, akama_logs_output.params, akama_logs_output.day
from 
(select concat(ads.day," ",split(ads.time," ")[0]) as dt, ads.ip as ip,str_to_map(parse_url(split(ads.request[1]),"QUERY"),"&","=") as params, ads.day
FROM AKAMAI_LOGS ads 
) akama_logs_output;

 

 

 

 

 

Filed under  //   apache hadoop   apache hive   hadoop   hive   log parsing   map reduce  

Just rooted my phone using the information here.  Easy process but had to run it a few times before is stuck but if you are looking to root your android phone it works well.  

 

I have the origional Droid phone with 2.2

I used the app z4root which I got from the site http://forum.xda-developers.com/showthread.php?t=833953.

 

 

Things todo after rooting.

Installed Barnacle Wifi Tether

Using ROM Manager Install a new rom.  

Trying out CynogenMod first.

 

 

 

Filed under  //   android   rooting   rooting android   rooting phone  

ToSeeItLive.com

A few months ago I wrote ToSeeItLive with the basic idea that I was writing it for myself.  I keep hacker news open all day and like to see the position of articles throughout the day.  ToSeeItLive gives me an updated feed during they day as things change.  The page reorganizes itself as people upvote the articles and their position changes.  And purely for fun the page will dim the text around the links if someone else is using the page highlights an item on the page.  This is all done in the background using Faye, Redis, Sinatra, and Ruby.  

To find out more go here ToSeeItLive:About Page 

Twitnect.com

I created a new site the other day see if I could try to follow questions on Twitter.  I query the Twitter api for phrases where someone might be asking a question, and if my phrase matches the users phrase I keep that question around.  For the next 24 hours I query twitter for @replies to the user and check to see if they are replying to the Twitter users question.  If so then that tweet is categorized as an answer.  It is not exactly rocket science but an interesting way to find out if Twitter can be a great source of Q and A.  

 

Also the questions that don't have answers will be removed from the site after a period of time.  Let me know what you think.

http://www.twitnect.com

 

Dan

Android Market Ranking

Co-worker and myself got all of the android phones that were right by us and looked to see how the apps stack up against one another on the Android Market place.  Interesting view because most didn't match. 

Photo

Filed under  //   android   android market  

First Post

Ok I am posting this and want to try I out.

Posted March 3, 2010