HNHacker News
TopNewBestAskShowJobs

codeismightier

318 karma · joined October 19, 2008

submissionscomments
codeismightier··on The mathematics of compression in database systems
Intriguing claim! At first I was skeptical, thinking that there would be an issue with leading zeros being discarded. However, with some piloting, I was able to use Claude and ChatGPT to construct a proof of your claim.

Sketch of the argument:

First, an arithmetic coder maps strings to non-overlapping subintervals of [0, 1) that respect lexicographic order.

Second, the process of emitting the final encoding preserves this. If enc(s) ∈ I(s), enc(t) ∈ I(t), and I(s) <= I(t), then enc(s) <= enc(t).

Finally, binary fractions compared left-to-right bitwise yield the same order as their numerical values — this is just memcmp.

Thus, we have a proof of your claim that arithmetic coding preserves lexicographic order! Nice result!

My mistake was in thinking that leading zeros are discarded -- it is tailing zeros that are discarded!

codeismightier··on How Discount Brokerages Make Money
Have you looked into Tradier? (I have not tried them myself)

https://documentation.tradier.com/brokerage-api/trading/plac...

codeismightier··on Over $700k selling a premium mobile game
Both S-Corp and LLC are pass-through entities; there is no difference in terms of tax treatment.
codeismightier··on Is the World Ready for a Guaranteed Basic Income?
Money is just an abstraction for actual goods and services produced by the economy. If your wages go up, presumably so does the wages of those whose services you consume.

If less people worked, the economy would produce less and we would be worse off.

codeismightier··on Is the World Ready for a Guaranteed Basic Income?
Can you explain a bit more about how these people can raise their standard of living by moving?

Money is just an abstraction for real goods and services produced by the economy. Presumably we need people to live in Philly since that's where our industry is. If people moved away to some remote place, wouldn't our economy take a hit? Not to mention the transportation costs of servicing a more remote, less dense area.

codeismightier··on Is the World Ready for a Guaranteed Basic Income?
Housing is, to a certain extent, a positional good. People want to live in safe, friendly neighborhoods, surrounded by well educated, middle to upper class people. Even if everyone got more money, it's not easy for more people to live in desirable neighborhoods (at least without changing the character of those neighborhoods).
codeismightier··on Patent that cost Microsoft millions gets invalidated
If the inventor is a corporation, this would be gamed by simply transferring ownership of the corporation. If the inventor is a human, the person would have to organize as a sole proprietorship and forgo limited liability. Designing rules is hard!
codeismightier··on Income inequality is not the problem, it's a symptom
You are right that it was a bad argument :). As such I've deleted the comment.
codeismightier··on Income inequality is not the problem, it's a symptom
I don't understand the hate against Walmart. It only has a profit margin of 3.12% [1] and return on assets of 7.69%. Now I suppose you could argue that all the profits are hidden away somewhere, but that sounds like an unfalsifiable statement. It certainly would be illegal to hide assets from shareholders.

[1] https://finance.yahoo.com/q/ks?s=WMT

codeismightier··on Economic Inequality
You clearly have not thought though the consequences of your proposal. Here are just a few of the problems:

* What if I own a house but have no cash? Will I have to sell it and live on the street to pay the taxman?

* What if the ultra-wealthy buy property and then mark it down? I.e. they buy paintings, then "accidentally" "damage" them. Whoops, a billion dollars in artwork gone, sorry IRS. Later, it is miraculously repaired. Will the IRS have to start sending undercover agents to inspect people's art collections?

* A 3% wealth tax is still less than the growth rate of many financial assets. I.e. the stock market grows at ~7%. So the rich will still get richer. And if you increase the tax to say, 8%, congrats, you just destroyed the financial markets.

codeismightier··on Economic Inequality
What's the problem with hoarding? There's no difference between a billion dollars stuffed under the mattress, never to be spent, and a billion dollars burned up in a fire. If the rich aren't spending, they are not consuming resources or causing pollution, so it's as if their money never existed. And if they do one day decide to draw down their accounts, then it wasn't being hoarded.

>> If this were a card game, the millionaire could go piss himself.

Thankfully the economy is not in fact a card game, and no billionaire can force you to piss yourself.

codeismightier··on Pirate Bay founder's new project shows the absurdity of giving value to copies
And I have a strong belief that creators should be compensated for their hard work. Tell you what: let's compromise. Creators get a right, let's call it "copyright" or something, whereby for a limited amount of time they get to control how to distribute their work. In order to maximize profits they will rationally not charge too much. After enough time has passed, this right expires and their work goes into the public domain. Sounds good?
codeismightier··on One Way to Unrig Stock Trading
I'm not a fan of payment for order flow. The problem is that it lets HFTs pick off the uninformed orders, leaving the orders that actually reach the exchange more "toxic". This lowers the incentive for others to rest orders on the Central Limit Order Book, harming price discovery. So while in the short term no one is harmed, the long-run consequences could be bad.

With that said, yeah, the NYT piece is terrible.

codeismightier··on One Way to Unrig Stock Trading
This NYT piece is heavy on moralizing rhetoric and light on technical details. The BloombergView piece by Matt Levine [1] is much better:

"It's important to realize that slowing everyone down by 350 microseconds can't possibly help anyone. As Hudson River Trading said in its comment letter: "Similar to a 100-meter sprint, if you simply add 350 microseconds to each participant’s time, neither the order in which they finish nor their time differentials will change.""

It would indeed be pointless if everything was slowed down by 350μs, which is why that is not the case. IEX lets its own "pegged orders" and "routable orders" cut the line, picking off liquidity at the other exchanges. If IEX is approved, there will be an arms race, with other exchanges inserting their own similar delays. Even worse, because of Reg NMS you can't legally avoid trading on IEX even if you wanted to. If the price of a stock is falling rapidly and you wanted to sell, IEX will always have the best price since it is stale by 350μs. Everyone will be forced to send their orders to IEX, even if everyone knows that the bid there is illusory.

The Matt Levine piece is very good. Do please read the whole thing.

[1] http://www.bloombergview.com/articles/2015-12-22/the-flash-b...

codeismightier··on What I Learned from Losing $200M
Not quite -- this guy didn't naked short a put option on Maya crude. The plan was to dynamically hedge the position -- putting on a trading strategy that continuously neutralized the first partial derivative of the payoff function. The problem was the the second partial derivative was left unhedged -- oops! To put it technically, he was delta hedged but not vega hedged. Thus when volatility spiked he lost money. Even worse, he insured 2/3 of Mexico's entire production, so when things got bad there wasn't even enough liquidity to maintain the delta hedge.

A better plan would be to come up with some sort of vega hedge using WTI volatility. WTI vol and Maya vol are correlated so some sort of partial hedge should have been possible, but it's very tricky. This is why other banks were not interested. It sounded like he was either too lazy or arrogant to believe he need to vega hedge and it blew up in his face.

codeismightier··on Hierarchy Is Detrimental for Human Cooperation
>> 2. The splitting phase is not influenced by the collaboration phase (I can't avoid to note that you don't choose to apply this insight to start ups).

Vesting is supposed to serve that purpose by allowing a co-founder who doesn't contribute to be fired. Certainly it can be harder to fire a non-performing co-founder though.

codeismightier··on Hierarchy Is Detrimental for Human Cooperation
The experiment seems poorly designed if the purpose is to simulate the real world:

"In the cooperation phase, both players ... contribute simultaneously ... to a common pot, unaware of the partner’s contribution." The higher-ranked player then gets priority in determining how the payoff is split.

Who goes to work without agreeing on a salary?? Who co-founds a company without agreeing to an equity split??

The connotation for the so-called "lower ranked player" is also misleading, as in the real world the employer is more similar to their "lower ranked player": the employer usually commits to paying the employee around three months' worth of salary first. The employee then gets to choose to slack off or work hard. So, in a sense, the employee gets to choose how to divide the payoff: the employee always gets the salary, while the employer gets (output - salary). Of course, in the real world the game is then iterated, as the employer gets to choose to fire the employee or continue the relationship.

Any experiment in game theory that doesn't involve iteration is highly unrealistic -- the fact that we have a reputation to keep and have to deal with each other over and over again is pretty darn important! Frankly I'm a little bit disappointed that Nature has chosen to publish this paper, as I don't see what insight it offers.

codeismightier··on Why Childcare Workers Are So Poor, Even Though Childcare Costs So Much
Is childcare in fact expensive? According to the article it "can top 15 percent of the median income for a married couple". But considering that taking care of children used to be a full-time job for a housewife, isn't it actually surprisingly cheap relative to historical standards?

In general, if there isn't increased productivity because of technology, we shouldn't expect lower costs in terms of labor-hours consumed. See "Baumol's cost disease" (https://en.wikipedia.org/wiki/Baumol%27s_cost_disease)

codeismightier··on Ask HN: please review my Firefox extension
I wrote this extension a while back and I'm wondering what you guys (and gals) think. It uses DirectedEdge's API (they are regulars here, thanks guys!). Are the "popup bubbles" useful? Any suggestions for improvement or new features would be very helpful.
codeismightier··on Programmers and Sadomasochism
Why do we need to spell correctly? Why can't we use "u" for "you"? Why do we need to end sentences with periods? Why do we have to use the correct grammar?

1) It's simpler for humans to read. The purpose of XML was to be somewhat human readable and quotes help with that. 2) It makes possible for people to throw together a basic parser if for some reason they don't have access to the libraries (embedded, new language, etc) 3) Life would be a lot simpler if everyone followed the law (or specs).

codeismightier··on Please Solve the Information Redundancy Problem
I have implemented such an algorithm in the past. The problem is that it actually makes things even more redundant since it gives you stuff you have already read and liked. The results returned are usually articles on the exact same topic from a different source.
codeismightier··on Early Amazon: Similarities
Sounds like a perfect opportunity to ask for a raise :).
codeismightier··on Guess what? Automated news doesn't quite work
Cool. One feature that I wish that you would add is RSS feeds for each sub-topic. Other than that it looks great.
codeismightier··on Measuring spam conversion rates by infiltrating the Storm botnet
For the lazy: "After 26 days, and almost 350 million e-mail messages, only 28 sales resulted — a conversion rate of well under 0.00001%. Of these, all but one were for male-enhancement products and the average purchase price was close to $100. Taken together, these conversions would have resulted in revenues of $2,731.88—a bit over $100 a day for the measurement period or $140 per day for periods when the campaign was active. However, our study interposed on only a small fraction of the overall Storm network — we estimate roughly 1.5 percent based on the fraction of worker bots we proxy. Thus, the total daily revenue attributable to Storm’s pharmacy campaign is likely closer to $7000 (or $9500 during periods of campaign activity). By the same logic, we estimate that Storm self-propagation campaigns can produce between 3500 and 8500 new bots per day.

The next obvious question is, “How much of this revenue is profit”? Here things are even murkier. First, we must consider how much of the gross revenue is actually recovered on a sale. Assuming the pharmacy campaign drives traffic to an affiliate program (and there are very strong anecdotal reasons to believe this is so) then the gross revenue is likely split between the affiliate and the program (a annual net revenue of $1.75M using our previous estimate). Next, we must subtract business costs. These include a number of incidental expenses (domain registration, bullet-proof hosting fees, etc) that are basically fixed sunk costs, and the cost to distribute the spam itself."

codeismightier··on Web-app version of Markov-Chain domain generator (be gentle on the server)
Thanks. Done.
codeismightier··on Web-app version of Markov-Chain domain generator (be gentle on the server)
Very interesting. I would be interested in hearing more about this. Can you leave your email? Mine is yongqli@10gic.net
codeismightier··on Web-app version of Markov-Chain domain generator (be gentle on the server)
It should be much faster now.
codeismightier··on Web-app version of Markov-Chain domain generator (be gentle on the server)
Ok, now it loads jQuery from Google.
codeismightier··on Web-app version of Markov-Chain domain generator (be gentle on the server)
I am running a local resolver (bind9), so I would assume that it is being cached.
codeismightier··on Web-app version of Markov-Chain domain generator (be gentle on the server)
Ok, now the user has to press enter for a request to be initiated.

The reason that the script issues a recursive call is that I want the user to see the suggestions right away and check the status later since the DNS requests can take a while.

Page 1 of 2Next →