About smart bugs and debugging abilities

Smart Bugs
Well, we’re back at this problem again. During the day, my browser and eclipse/terminal programs consistently crash just as I am about to complete something complex and time consuming.

Then, today, when this happened to me, I suddenly realized. Maybe the super-bug that was hypothesized several years ago is actually real. For all I can tell, there is a bug in either the operating system or browser that has evolved to a point where I am made to believe that it is smart enough to detect when I’m just about to complete a complicated task. I mean, it takes quite a bit of comprehension of java code, sql code, english language, email exchanges, and IM conversations to understand why at a crash at those exact moments would cause me the most annoyance.

Sometimes, I wonder if all these bug squishing tools, automatic bug detecting programs, firewalls, and human “safe-browsing” habits has given the bugs a special challenge. And in fact the efforts we put into squishing the bugs has incentivized and facilitated an accelerated the evolution of super smart bugs that has passed the Turing test?

Debugging Ability
I’ve found that I have relatively poor debugging skills compared to my co-workers. I wonder if it is because I never write buggy code. Because I’d stare at the stupidest bug in the world, and not recognize it has a bug. But of course, if I wrote the program, I would never have done something like that!

But this points to some of my weaknesses. For one thing, I have obviously not experienced working with bad programmers enough, or have been responsible for other people’s bad programming enough. Certainly, the senior leadership in the engineering organization, who’s been in engineering leadership roles for extended period of time, clearly is able to detect the bugs much quicker.

Sigh… so much for trying for management/lead positions…

Falling asleep

I frequently fall asleep in movie theatres among the times that I watch movies there.

I hope these are due to some psychological disorder that I have and not due secret agents knocking me out with chemicals or other mechanisms. Some times I just dont comprehend it. I can pinch myself and hold my head up and breath really hard and drink water but I just could not keep myself awake… I have to think why this is happening to me when I visit public venues?

My best guess today are either there is some kind of synthnol–no smell, no hangover, but instant drunkardness when sprayed. Skin or eye absorbs it (or it was applied to the seats before I arrived)

Another possibility is the sonic screw driver. One gets screwed by some thing hat affects the aural cavity that knocks the person out.

It’s not EM imho, but I could be wrong. I just need to figure out a defense against these dark arts, so I can enjoy my God given right to watch these movies…….

Could be hypnotizing message in the movie? It happens probably by section/chapter 2-3 of each movie, within 10 minutes my head is slumped down… sigh

some day…

As a data miner and machine learning practitioner who do not work at Google, I often wonder when, if ever, I will be able to make this claim that Googlers often make:

We cannot sample when applying data mining and machine learning algorithms because we’ve discovered that using all the data makes a difference.

Some day…

National Treasure

I just saw National Treasure again. Wow!!!! I really think there is a deeper allegory than 5 floors below some church…

The spirit embedded in the Declaration of Independence is our map to treasures beyond our wildest imagination!! That all men are created equal. This, when seen through glasses of blue and red glasses, give rise to a treacherous path down to the depth of the earth… But in the end, we will find a huge room filled with gold and culture collected from all of the world.

And the guy who wants to share the world’s riches to the whole world gets the girl.

Hey!!! I want to share the riches of America with the world!

Now can I get the girl?

doh! and congrads!

Ivanka Trump is married. doh!

but congrads!!!

Though there wasn’t much news on this before hand… one wonders about pregnancy…

But she is a pretty girl… progressively more beautiful… when she initially started her appearance on trump’s show, she looked like spoiled bratty girl, who don’t know what to do… But later, she grew more sure of her self, more mature than Donald junior…

but alas, she is not available any more.

sigh.

The right to not get high

California is reducing enforcement of marijuana use laws.

Some how, this is going to lead to more and more smoking and more and more people will smoke and some day, we won’t be able to find a place where there isn’t second hand marijuana smoking. (It’s hard now. My neighbors always smoke out side of my window, and I can’t have a peaceful night w/o getting second hand high 😦 )

I think if we move toward legalizing marijuana smoking, there should be designated smoking area where there are filters to remove smoke before recycling the air.

Also, the smokers should have a forced cleansing session, breath heavily into something until lungs are mostly clean, before exiting this area.

btw, three cheers for the governor for passing AB920! hooray! hooray!! hoorray!!!

What of culture?

Recently I had the fortune to witness an exchange at a Chinese-American business event. One caucacian and three Chinese-Americans sat on the panel… Discussion circles around interaction between Chinese companies and American companies. (Most of the audience are Chinese American Business people)

Near the end, one audience stood up and asked a question:

“I’ve seen that when French companies invest in middle eastern countries, they will often ask their new employees to learn to speak French by providing mandatory French classes for all employees. I wonder what the panelist feel about the spread of Chinese culture and how that may influence the productivity of newly acquired companies?”

“What is there to teach? Just drink!!”

one of the Chinese American speaker bursted out on stage, and the room laughed politely.

The Engineer inside me reacted immediately. I said out loud: “Well, certainly not the engineering team. I wouldn’t ask the engineering team to drink as part of the culture.”

Not one other person reacted to this blatantly disrespectful remark… In a room full of people who claim to be Chinese or Chinese American, all laughed, politely, and some laughed in genuinely good humor!

The Mckinsey speaker finally reacted. She said, “when I spoke of corporate culture being different between American companies and Chinese companies, what I meant was corporate culture! I make sure every time that I speak of such things in public I speak of corporate culture. I’m not worried about national culture in the least. That’s the last thing I’d worry about.”

Other panelist chimed in, but saying little else, repeating the word national culture. The crowded hesitated. But it disbursed and the discussion came to a quick end… But there is something lingering…

After some thoughts, I suddenly realize. Waita minute! that was such a big insult!! And the only panelist who did react, she did not react by saying anything positive about the Chinese culture, nor did she say anything against the “just drink” comment. All she did was to cover her ass about her company. Witty and professional, sure, but certainly, disappointing that a room full of Chinese and Chinese Americans, not one person had the tiniest hint of intelligence nor wit to realize the insult being dished by a fellow Chinese or Chinese American, in public, in the face of every Chinese person in this Chinese organized Chinese business conference.

NOT a single response!

Even polite laughters.

WHAT!

THE!!

FUCK!!????!!

and besides. I think the term more fitting is ethnic culture versus corporate culture. National culture seem to point to national politics (and in the case of PRC, communism.) The person asking question was asking about the Chinese ethnic culture.

WHAT THE FUCK??

Just drink???

That’s the only thing that any of the panelist can speak of when they think if Chinese culture?

And the whole roomful of self proclaimed Chinese- and self proclaimed business- people, not a single one has a slightest bit of pride? not a shred of comprehension? not the least ability in language or tactics to respond to such a blatant insult??

The meeting just ended there, with out really ending… just that people left… uncaring. The purportrator of such disgraceful remark, unscathed. The caucasian watching… smirking in his little beard… smirking!!!! laughing!!!!!

“You Chinese people are so fucking stupid!!!
You make light of such a serious question at such an important time.”

“YOU ARE SO FUCKING STUPID!!!!”

FUCK!!!!!!!!!!!!!!!!!!!!!
FUCK!!!!!!!!!!!!!!!!!!!!!
FUCK!!!!!!!!!!!!!!!!!!!!!

The effect of California’s proposed VAT/BNRT 3

Instead of talking about the stability of the BNRT in the long run, let’s talk about the effect of sudden introduction of BNRT  
Same examples as previous post. Recall that farmer buys fruit seed at price S. Plants the seed (adds value to it) and sells the fruit at price G. A canned fruit company buys the fruits, cans them, and sells at price C to distribution, distributor sells to Retailer for price D, and retailer finally sells the product to consumer at price P. We have established last time that the BNRT will be set to be higher than the current corporate tax to cover the elimination of the sales tax. For simplicity sake, let’s call bnrt = CT + o; The farmer’s previous profit was (G-S) * (1-CT) but is now (G-S) * (1-bnrt) the income is now less, so to make up for the difference, he charges for a price G’ such that (G’ – S) * (1-bnrt) = (G-S)*(1-CT) solve for G’

G’ = (G-S) * (1-CT) / (1 – bnrt) + S  

G’ = (G – S) * (1-CT)/(1-CT-o) + S G’
   = (G * (1-CT) – S*(1-CT) + S(1-CT – o))/(1 – CT – o) G’
   = (G * (1-CT) – S*(1-CT-o-1+CT))/(1-CT-o) G’
   = (G * (1-CT) – S*(-o))/(1-CT-o) G’
   = (G * (1-CT) + S*o)/(1-CT-o)

shoot! so, now the can company received not only an increase in cost but also an increase in taxes.

Previous earning is: (C-G) * ( 1-CT)
now the earnings is:
(C’-G’) * (1-bnrt) = (C’-(G * (1-CT) + S*o)/(1-CT-o)) *(1-CT -o) = (C’*(1-CT-o) – G*(1-CT) – S*o)

solve for C’ 

(C’*(1-CT-o) – G*(1-CT) – S*o) = (C-G) * ( 1-CT) C’*(1-CT-o) – G*(1-CT) – S*o
    =(C-G) * ( 1-CT) C’=((C-G) * ( 1-CT) + G*(1-CT) + S*o) / (1-CT-o) C’
    =(C-G -C*CT + G*CT + G-G*CT + S*o) / (1-CT-o) C’
    =(C – C*CT + S*o)/(1-CT-o) C’
    =(C*(1-CT) + S*o)/(1-CT-o)

…ad nauseum…

to arrive at P’ = (P*(1-CT) – S*o)/(1-CT-o) as the price that the final retailer’s price to arrive at the same profit as before.

P’ = P * (1-CT)/(1-CT-o) – S * o / (1-CT-o)

ugh! let’s plug in some numbers.

Example 1
original seed S=1 final original price P=10 Corporate Tax CT = 10% tax increase o= 1%

P’ = 10 * (1-10%) / (1-10%-1%) – 1 *1% /(1-10%-1%) P’ = 10.1012

price increase of 1.01% results from an bnrt over ct by 1%

Example 2
original seed S=1
final original price P=50
Corporate Tax CT = 20%
tax increase o= 5% P’ = 50 * (1-20%) / (1-20%-5%) – 1 *5% /(1-20%-5%) P’ = 53.27

This corresponds to a 6.53% sales tax.

Example 3
original seed S=1
final original price P=100
Corporate Tax CT = 20%
tax increase o= 5%
P’ = 106.6

equivalent of 6.6% tax. The doubling of profit from example 2 to example 3 with all else being equal illustrates how the implicit sales tax increase when the Value Added increases with out changing any explicit tax rates.

Example 4
original seed S=1
final original price P=50
Corporate Tax CT = 20%
tax increase o= 6%
P’ = 53.97

The equivalent sales tax rate is 7.945%. An increase of 1 percent in bnrt tax(as compared to example 2 results an equivalent of 1.416% increase in sales tax in this situation.

Example 5
original seed S=1
final original price P=50
Corporate Tax CT = 20%
tax increase o= 7%
P’ = 54.70

Equivalent sales tax is 9.40% which is an increase of 2.87% in equivalent sales tax due to an increase of 2% BNRT as compared to example 2.

So an increasing the BNRT automatically increases in price equivalent to sales tax by a %-age larger than the raw BNRT increase.

The effect of California’s proposed VAT/BNRT 2

We’re still not necessarily convinced that things will remain great. Let’s use a more concrete example: Farmer buys fruit seed at price S. Plants the seed (adds value to it) and sells the fruit at price G. A canned fruit company buys the fruits, cans them, and sells at price C to distribution, distributor sells to Retailer for price D, and retailer finally sells the product to consumer at price P

we should also define some taxes: bnrt is the rate of BNRT, CT is the corporate income tax, ST is sales tax.

current case:
Farmer: pay S, get G, pays tax (G-S)*CT
Canner: pay G, get C, pays tax (C-G)*CT
Distributor: pays C, gets D, pays tax(D-C)*CT
Retailer: pays D, gets P, pays (P-D)*CT
Consumer: pay P, pays tax: (P)*ST

total tax received: (P-S)*CT + P*ST

BNRT case:
Farmer: pay S, get G, pays tax (G-S)*bnrt
Canner: pay G, get C, pays tax (C-G)*bnrt
Distributor: pays C, gets D, pays tax(D-C)*bnrt
Retailer: pays D, gets P, pays (P-D)*bnrt
Consumer: pay P, pays tax: 0
total tax paid: (P-S)*bnrt

if the government wants to keep income the same how much should he set the bnrt?

(P-S)*bnrt = (P-S)*CT + P*ST
bnrt = CT + ST * P / (P-S)
bnrt = CT + ST / ((P-S) / P)

bnrt is to be set as approximately the current corporate tax plus sales tax divided by the gross profit margin of all business processes in the state.

Next time, we should analyse the claimed stability of BNRT resistant to fluctuations in business cycles.

The effect of California’s proposed VAT/BNRT

What is the effect of eliminating sales tax, lowering income tax and establishing BNRT?

The sales tax is lowered to 1/5 of previous, sales tax of nearly 9% or 10% is completely gone, but a tax is added to transactions. The only deductions are house, charitable, and…

For a business, the Business Net Receipt Tax is a percentage of

OUT=$ listed on receipts I receive while doing business (after paying $)
IN=$ listed on receipts I issue while receiving $ in the process of doing business.

So BNRT a business has to pay is Tax_Percentage * (IN – OUT)

Cool, eh?

Not having income tax and lower sales tax means the money made in California will tend to stay in California (because tax is lower, so it’s not worth it to take the high income and spend it out of state where tax is higher)

One reaction people will have is this: Wouldn’t businesses tend to become more vertically integrated. If the making of a product requires either two companies or three companies, which one would I prefer?

bnrt = bnrt tax rate
r=original raw cost
p=market price for the final product

2 company case:
p1 is the price the intermediate product sells for
p2=p is the price of the final product.
total tax paid is: (p1-r)*bnrt + (p-p1)*bnrt + 0 sales tax
do the math, and the total tax paid is (p-r)*bnrt

3 company case:
p1 is the price the intermediate product sells for
p2 is the price of the intermediate product between p1 and final result
p3=p is the final sales price
the total tax paid is: (p1-r)*bnrt + (p2-p1)*bnrt + (p-p2)*bnrt + 0 sales tax
do the math, and the total tax paid is (p-r)*bnrt

same!! they’re the same!! (to the government, if the sales price remain the same as a result) Since the original costs are the same, and the the cost of final product are the same, the total money made by private sector is

p-r-(p-r)*bnrt = (p-r) * (1-bnrt) is the same for both case. So the tax doesn’t fundamentally affect the cost of doing business, more or less, the money made is the same.

tomorrow, we will check if the final price will remain the same…