Hacker News new | past | comments | ask | show | jobs | submit | throwaway0094's comments login

> Its been tuned over years for use in competitions. So it probably runs faster than the author's, even though it has more features.

For OP's use case, which appears to have a max depth of maybe 3, invoking a shell program is going to be a LOT slower than just running the search. No matter how slowly it is implemented.


"Those who don't understand Unix are condemned to reinvent it, poorly." – Henry Spencer

You are basically saying the whole UNIX philosophy of specialised reusable programs chained together is a flawed design.

Spawning a program is not slow. Store the programs file arguments on a ramdisk to avoid disk IO and there will be no noticeable overhead.


Are you kidding me? This is pretty fucking arrogant. My $DAYJOB is FreeBSD kernel hacking.

Reusable piped programs are great for some things, especially a productive shell language. No, composing processes is not great for all things, and certainly not where performance is required. This is why FreeBSD is a monolithic kernel instead of a microkernel with processes, for example.

Spawning a program is incredibly slow, even ignoring disk read times, compared to 3 levels of low-branch-factor search in any language.


Your suggestion is the morale equivalent of asking to install Oracle for a simple "tiny data" database problem when sqlite or just a hand crafted table is far enough.


Not necessarily a trade-off with non-tobacco nicotine.


I fully agree. From what I've read, nicotine itself is not as addictive as smoking, and it's not the part of tobacco smoke that causes cancer. Also, the withdrawal symptoms are typically more mild than caffeine withdrawal.


It isn't now. It has been edited from the original.


For non-smokers, less is more... nicotine is a pretty powerful stimulant, you don't necessarily want strong hits. My 2¢.

(I am a non-smoker; have tried 2mg and 4mg gum, and find 4mg similar in some ways to having a 'bad trip'. (Light-headedness, freaking out, nausea, time-dilation.))


true, as a smoker trying to ween myself to something a bit safer that lack of hit is what annoyed me with other e-cig solutions I tried. The nova tank though is a very tolerable substitute to actual smoking.

If I was a non-smoker though I would not start a nicotine habit at all. I wish I had never started smoking, it's a very difficult habit to reverse.


Anecdotal, but as a non-smoker, I don't find any withdrawal or cravings symptoms at all when I stop consuming nicotine. It's milder than stopping caffeine.


I also gave lozenges a try after reading an article here, and found 2mg to be too much, at first. You get used to it, though.


Might kill the GPU faster than gaming alone, unfortunately[0].

[0]: http://yarchive.net/comp/linux/cpu_reliability.html


But perhaps more importantly, not a big subjective difference ;-).


Meth is only prescribed for ADHD in the US. Is it prescribed for ... nevermind, you edited your post. (Original said something to the effect of "meth is prescribed for drowsiness in pilots," which is inaccurate for the US.)


Meth is quite hard to get, via prescription, unfortunately. Its bad rep in pop media has resulted in it becoming overcontrolled by the FDA. It's quite a useful - but little explored and used - therapy for AD(H)D.

You'll nearly universally get straight d-amphetamine at the doctor's office.


Really? I thought adderall (contains 1/4 dextro-) or vyvense (don't know which amphetamines it contains) were pretty common.


Adderall is a mix of d- and l-amphetamine.

Vyvanse is d-amphetmine bound to lysine, turning it into a prodrug (which means your gut chemically cleaves off the lysine and, conveniently, you're left with d-amp sitting in your gut).


Vyvanse was a wonder drug for me. Not only helped me concentrate it made me more outgoing and confident. Left me with horrible dry mouth though.


The more you know. Thanks :).



Dexedrine is dextroamphetamine (commonly prescribed for ADD and other things, like staying awake). Methamphetamine is a different chemical with an important legal distinction (if subjectively and objectively very similar).


When the poster said pilots, I think he was referring to military pilots. The use of stimulants in combat situations is apparently quite common for pilots.


From his Nictotine article, gum or patch. But e-cig might be fine too if the parts don't have lead or other hazardous substances in them, modulo maybe higher risk of addiction.


Patches and gum are really expensive.


Compared to e-cigs, sure. Compared to food, or conventional cigarettes ... they're really really cheap. 96 x2mg gums for $22 comes out to 45¢/mg. I use maybe 0-2 (edit: gums (90¢-$1.80)) a day (I probably save at least that much by making sandwiches for lunch / not eating out -- I work from home).


So: 1.5 weeks of work. $50-$75/mo/instance. x20-60 instances. Worked for 3-4 weeks.

If we assume the most optimistic parameters: $75 * 1mo * 60 instances = $4500 in profit for 1.5 weeks of work, or a rate of ~$156k/yr.

Edit: It looks like I misread his revenue numbers for profit. Oops! Even lower margins:

"My gross revenue was about $1000, and I paid Amazon $500 of that."

$500 for 1.5 weeks' work is only $17k/yr rate. Maybe flipping burgers pays better.


You also don't need to sing in the shower. You can leave the shower earlier, hire a TaskRabbit to sing for you instead, and if you value your time correctly you should come out ahead.


Yeah, but I don't recommend singing in the shower for 1.5 weeks while your employer is paying you sick leave ;-).


I also definitely don't recommend you moonlight flipping burgers while your employer is paying you sick leave.


Well, if he just leaves this running, assuming the same level of profitability it is 17k a year of passive income...definitely worth keeping up if possible. as the exchange rate goes up it should become even more profitable.


The spot market prices have been going up non-stop. I finally pulled the plug today when my expected daily revenue was down to about $5. (There's some risk inherent in doing this, because a market crash could leave you saddled with a day of Amazon bills with nothing to show for it. So it becomes less attractive at low margins.)

I was only able to run 60 nodes for the first two days. After that, spot market prices in CA and Oregon went too high for profitability.

At this point, the spot market has gone insane. Mining with my code isn't profitable over about $0.130/hour with the current exchange rates, and the market is at, um, $6/hour in some places. I hypothesize that people are typo'ing in their EC2 spot bids and typing $6 when they mean $0.6, because otherwise it's completely irrational: You can get a normal instance for $0.65/hour. Not that people are rational, but...

It also requires some care and feeding. The $17k isn't really free passive income. The pools go awry, the exchanges go awry, ... At larger scale, you could amortize all of that management time and automate the majority of it, but at a few bucks here and there it's simply not worth it.


As others have pointed out, this is not remotely passive.


With enough automation it could become passive. Then again with enough automation everything becomes passive.


The problem is with cryptocoins, the window of opportunity is always small, short, and never comes again- you have to find an entirely new window.

Much like with most forms of arbitrage, and exploitable patterns in the stock market. You discovery the opportunity, you make a little $$, and the hole quickly closes as everyone else capitalizes on it too.


I don't think it would, actually. Enough people are willing to mine for a loss and the difficulty rises with availability of cheap hardware that it never becomes profitable. OP only made a (slight) profit because they could temporarily make renting a miner cheaper than the payout. This was temporary and now the market is back to status quo.

Maybe OP could automatically run his miners when such situations arrive, but I think it's unlikely to net anything like $17k/yr.

Edit: sliverstorm described this way better than I could.


the difficulty rises with time


This isn't quite right. Even if your average string length is 1k+, you shouldn't change the embedded string size to 1k+. I think these objects sit on the C stack internally, which doesn't handle large objects like this well.

Also, I would guess the performance gains (from skipping malloc) would wash out the longer your average string gets -- even if the huge stack use doesn't kill your performance for some other reason (blowing the d-cache?).


I don't think these strings ever sit on the C stack, except maybe if some C code/extension is being really clever. The standard representation for variables is a tagged pointer as far as I know, so I would assume that is all that goes on the stack. This optimization probably just saves another level of indirection.


Hm, ok. Still, at some level fragmentation is eating gobs of space even if correct for the "average".


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: