An experiment in Obamamania

Okay, I’m running out of cash. I admit it. I’ve been spending like a crazy person since my purchase of a house here in the slums of Redwood City. My bank accounts are on the verge of depletion and I’ve been paying 10% APR on my credit cards for several months now.

Why I Spend so Much?
It’s kind of surprising how you expect to spend no money on the house other than the closing cost on the Good Faith Estimate, but then later, once the house closes, the moving costs, the blinders… ugh, where did all that money go? all I can recall is buying some blinders for the house, and yet my monthly expenditure, aside from the mortgage payments and utilities, has gone up by at least $1000/month.

The Blog Entry
Anyway, I decided to try to take advantage of President Barack Obama’s Credit Card reform. According to this article on creditcards.com, when the credit cards will receive your monthly payment, it will take the “minimum payment” and do as it please with it, and the remaining money in the payment will be required to go towards paying off the portion of the debt that has the highest interest!!

Let’s say that I have a credit card that I’ve used to make “auto-payment” of about $500/month to utilities, phones, tv, and the likes. These auto-payments occur every month, and I have arranged for the credit card company to withdraw that exact amount from my bank account monthly. If I do not pay this amount on time, my interest rate is something like 12% APR charged monthly at 1% a month.

Now, I have also received an offer of $5000 12-months 0% APR Promo-check from the same credit card company.

Prior to this legislation, my monthly auto-payment to this credit card will go towards paying off the $5000 0% APR debt, and the $500 I spend every month will accumulate and charge interest until the $5000 is paid off. So the payment/balance looks like this for the first few months

Month 0% APR balance 12% APR balance Payment Total Balance Interest Charged this Month
1 $4500 $500 $500 $5000 0
2 $4000 $1000 $500 $5000 $500 *.01=$5
3 $3500 $1500 $500 $5000 $1000 *.01=$10
4 $3000 $2000 $500 $5000 $1500 *.01=$15

Today, under the new rule, the same charge/payment that I make monthly would produce a table like this:

Month 0% APR balance 12% APR balance Payment Total Balance Interest Charged this Month
1 $5000 $500 $500 $5000 0
2 $5000 $500 $500 $5000 0
3 $5000 $500 $500 $5000 0
4 $5000 $500 $500 $5000 0

So that 0% apr promotional charge is a real 0% APR.

Now, I don’t believe my eyes when I read this “policy update” from the bank. So I found the legislation. Here’s a snippet of the relevant portion:

And here are some links to the text of the bill passed:here, here, and here. 111th Congress, H.R.627;

I guess even after researching into the bill and reading the text of it, I am still sceptical. Why has the Obama administration not spend any marketing money on the passage of this bill? It would surely stimulate the economy by making more people take advantage of the true 0% APR? There must be a catch that I haven’t seen yet. I’ll probably get slammed by a loss of job, bodily injuries, numerous car accidents and traffic tickets, tree falling on my house, etc, for taking advantage of this 0% APR. I mean it’s happened before that some thing random and rare happens every single time I used one of these 0% APR checks to interrupt my monthly payment. It’s almost like the efficient market is efficient in taking my money in super-natural ways.

But despite my misgivings about the free market, the whole credit card industry and Obama brand of hopus-believous, I have taken one of those checks on the credit card I describe above and cashed it.

Call me stupid.

Call me gullible.

But having hope is right? I hope it’s right…

12% interest is worth the price for even 1% chance of discovering a change that we’ve hoped for and can believe in.

The Greatest Magic Show on Earth

According to the Christian Science Monitor, “The Chinese traffic jam that has lasted for over two weeks has vanished overnight.” The article cites both MSNBC and French press AFP as source.

More supprisingly than the magic of 60 miles of traffic disappearing is the fact that western media did not make a glib remark about how it’s another communist PR ploy, and how they mobilized local farmers and burried the 60 miles of cars to fool the western media into believe the incredible powers of the Chinese communist party.

I mean, the article does go into detail about how bad the traffic is in China, which is completely fair. I just cannot get used to the neutral tone of this report.

The Mechanisms of the Hack

I am attempting to demonstrate to every person who has basic knowledge of the computer that it is fairly easy for another employee at my company to accomplish these acts remotely:

  • Screen shot of my computer at work.
  • Take a video recording of my screen at work.
  • Take a video of me or anything else that is currently in front of my laptop with the built-in camera.
  • Make an audio recording from my laptop’s microphone.
  • Send timed key-stroke sequences to my computer as if I pressed those keys.
  • Send mouse movements to my computer as if I moved the mouse.
  • Interact with application on my screen as if they are sitting in front of my computer.

There are many over the counter software that facilitate this on a modern computer. If you do not believe me, go ahead and download these software and try them for free. You will need two computers on the same network to see how you can manipulate a remote computer.

  • On the Mac, Viola is an application that allow for recording of the screen.
  • On the Mac, Command-Shift-3, and Command-Shift-3 will result in a picture of the entire screen or a selected window, respectively to be saved to a file on the desktop. 
  • On Window machines, the [Print Screen] key and [Alt]-[Print Screen] will result in a picture of the the entire screen or a selected window, respectively, to be saved to a file.
  • On most OS’s VNC is a program that allows you to see and control a computer remotely.
  • On most OS’s Synergy is a program that allows you to control mouse or keyboard from a remote computer system.
  • On XWindow systems, XTEST from XAutomation package has a command called xte which produces key stroke and mouse movement ad specified time without a person actually moving the mouse or keyboard
All I wish to demonstrate in this blog entry is that you, any of you who knows how to open a browser window and read a blog entry, can go to these websites, download a program, and read another person’s email, send email as another person, or fake typo’s while he is typing.
Next time I or anybody else speak to you and say: “hey, you know? I think xyz at work has been spying on my email.” or “My work has been sabotaged by my cube-mate.” That you do not dismiss him as an escapee from an insane asylum.
This issue must be dealt with openly and rationally.

re-repigged

So, here’s the solution to the question in my previous post.

The most obvious way is to perform a partial aggregate and then merge the results.

A = group TABLE by (f1,f2,f3, ((long)(random()*100));
B = foreach A generate FLATTEN(group), SUM(f4) as sf4, MIN(f5) as mf5, MAX(f6) as mf6;
C = group B by (group::f1, group::f2, group::f3);
D = foreach C generate FLATTEN(group), SUM(f4) as sum_of_f4, MIN(mf5) as min_of_f5, MAX(mf6) as max_of_f6;

simple and effective. Does not require extra programming in java at all. This algorithm can be applied to all associative reducing functions. But associativity is not a necessary condition. The Algebraic functions in Pig actually allows for more general implementation where by an operation is divided into two stages. The first stage is required to produce tuples, which the second stage then processes.

You will probably never meet a problem that produces a bag larger than one compute node can handle. I mean I work for one of the fastest growing internet eCommerce servicing companies and our processing never even come close to seeing this problem.

But, in case in some distant future, when you encounter bags in computation that overflow one or even two compute nodes, and even at that time Pig/Hadoop still does not have a built in mechanism to deal with this automatically. So the above is an workaround.

Hope this helps you in your work or play when I’m long gone and dead.

Artificial Errors

Errors

Errors during human computer interface can take many forms. The most common one is the “typo”. A “typo” or typographic error is one where the intended word, phrase, expression, or command is issued into the computer with minor error such that it is not exactly what the user wanted to enter.

Most of the time, these errors are do not have grammatical meaning. But other times, the changing of one character could cause the entire sentence or program to change in meaning.

Typos can occur in many places. The names of files for instance often may be mistyped or miscapitalized.

Missing punctuations is another type of typo that causes a great deal of headache for programmers and writers alike.

Other changes include altering file structure within the folder hierarchy that is now the norm on computers.

The errors can roughly be categorized by size and effect.

1.) Deletion of a punctuation.

2.) Errors that are less than 3 character edits away from the original input.

3.) Whole word replacements. two words adjacent to each other being swapped.

4.) Scrambling meaning of entire sentence or programming blocks.

5.) Systematic changes: renaming a variable will make it difficult to detect other changes because it will have changed many lines and spacing.

6.) Rewrites: Rewriting an existing system that has the exact same requirements facilitates the introduction of malicious code. Since it is a rewrite, it will be difficult to detect subtle changes.

Effects include:

a.) Completely useless error: Does not cause any misunderstanding or program compilation or run time error.

b.) Immediately detectable: Compilation errors. Spelling mistakes detected by spell checkers. detection by inspection.

c.) Eventually detectable: Changing a “>” to “>=” will be detected during unit testing, for example. Changing “will” to “will not” in a feature spec.

d.) Malicious and difficult to detect. These are bugs that cannot be caught by normal unit testing, integration testing, code review, or editorial process.

e.) Malicious and impossible to detect. These are bugs that are introduced publicly as features. The reason behind its introduction is explained and may be widely scrutinized. However, the true intent of the feature is eventually materialized causing massive or specific systematic failure. After failure, the original person or group that caused this feature to be implemented will not be faulted for introducing the bug.

These forms of sabotage occur everyday. More often than not, they are detected and then dismissed as a true error, and silently corrected so that the fact of a natural error is hidden when in fact the error is not nature and the concealment of its existence has conceals its true cause and prevents true remedy.

Respond to my blog entry if you feel that you have been the target of an artificial bug insemination.

Let the truth out so that humanity can move on!!

What if you worked for Madoff

What would you do, if suddenly one day you stumble upon that extra floor in your office building where your company has been faking data all these years to create the appearance of profitability ?

The better question is, I suppose, how do I maintain my personal safety, my professional integrity, and my networth all at the same time?

Personal safety is important because often, your co-workers WILL HURT YOU if they think you are about to expose the company!

Professional integrity is important. This actually will give this whole blog it’s meaning. Because without professional integrity, it’s actually pretty easy to just keep an eye closed.

And finally maintaining networth will make this whole endeavour challenging. Because it’s very easy to just quit and not get the payoff. It is also easy to expose the company and not get any payoff.

So, what can a person do???

For my self, I want to actually start taking lawyer classes to learn the laws governing corporations and fraud. The Ponzi scheme apparently is illegal for reasons in addition to it’s structure: Fraud, Money laundaring, perjury, etc.

Each of these have specific meaning and is associated with actions. So by learning about the punishments for each count of illegality, I would be able to assess my risk and weighing the trade-offs.

For instance, would I be willing to trade 5% chance of 20 years in prison for a payoff of $10,000,000 in 5 years ?

Read that carefully: Ten Million Dollars for an expected prison time of 1 year (expected value)

For most people, the answer is no. But for some people, the answer might be yes…

map reduce is so repigged

okay, so here’s a problem I ran into today. In PigLatin, I needed to calculate the following:

A = group TABLE by (f1,f2,f3);
B = foreach A generate group, SUM(f4), MIN(f5), MAX(f6), (f7 is null)?1:0;

My problem is that for the data that I have (about 100gb) there are actually only about a dozzen combinations of (f1,f2,f3), so the consequence is that the execution crashes with the reducer running out of memory.

The question is, is it possible to make this calculation even with sparse keys?