skysight-inc/HackerNews huggingface dataset:
I don't see what the big deal is here. He throws inputs at a function not meant to handle them and gets a segfault. Isn't this more-or-less expected from all C functions?

On careful examination of his example code, you can see that there's no attempt to terminate the buffer (though he misidentifies it as an "off by one" error). Throwing arbitrary buffers into functions meant for null-terminate strings will cause errors everywhere, not just in K&R example code. In the next chapter, does he use strcpy in the same example and use that error to say that we should deprecate the entire standard library?

On a more nit-picky note, the 'triple-equality trick' the author derides is a common C idiom and one every C programmer should be familiar with. Perhaps it doesn't belong in the first chapter, but it definitely belongs in any C manual.
https://secure.wikimedia.org/wikipedia/en/wiki/Singular_they
They are probably classifying their product as a 'palm-top computer', which attracts no import duty. But the component parts (the chips, etc) almost certainly will. For reasons I gave in my reply above, I couldn't tell you the exact duty amounts, but there is a link here that details the duty for palm-top computers:

http://customs.hmrc.gov.uk/channelsPortalWebApp/channelsPort...

I seem to remember this being the case when I imported some Beagleboards into the UK for R&D work, and didn't pay import duty on them.
Like what? Fluid layouts?
if we build the Raspberry Pi in Britain, we have to pay a lot more tax. If a British company imports components, it has to pay tax on those (and most components are not made in the UK). If, however, a completed device is made abroad and imported into the UK – with all of those components soldered onto it – it does not attract any import duty at all

Wow this sounds worse than job exporting in the USA
Seems to me some of those solutions are worse (more expensive) than just fixing poorly performing queries.
The greatness of the book is its terseness. Some of the code examples may be dated and buggy, but that does not diminish it at all.
Thanks a lot. I'll take a look into that. Pity that you still need to nil the objects before they're garbage collected.
Aren't there some rare elements that are necessary for semiconductors to work that are only mined in impoverished African countries with poor political stability, working, and environmental conditions? Try going your life without ever using a semiconductor. You can't. Everything in the world is indirectly produced by a semiconductor. You'd have to practically move to Africa and become an open pit miner yourself.

On the other hand, people are fond of pointing out that people who work at Foxconn are choosing what is far and away the best of all available options. So it's really a matter of cultural relativism whether a given set of conditions is good or bad. 100 years from now, are people going to feel guilty about using software that was developed by programmers working in cubicles? It's more likely than you think.
@jmilkbal Cool! Didn't know that. It's even easier to setup with Firefox:
http://support.mozilla.org/en-US/kb/Smart%20keywords
Thanks!
Giveaway: “Genius Android Marketing: Get Rich by Outsmarting the Android Market”
Write a post instead of downvoting me without explaining yourself. I went through my last 20 search queries and found that none of them were related to what I have in my inbox.
Duck duck go does this better than any other solution IMO. their !bang syntax works for over 200 different search engines and you can even add your own.
One problem with it is that on most compilers if you compile with optimizations it will remove the assertion. Now the code is no longer guarded against malloc failures and will just segfault. If the intent is to teach people how to handle malloc failures gracefully, it's not that great of an example.
I recently went through the process of selecting a CMS for a client. ProcessWire, was the ONLY one I looked at and thought, "ok, now this makes sense." In the end, I couldn't use it because it doesn't yet support repeatable content sections in the admin. Sadly, had to go with Wordpress.
The first batch will be of 10k boards. Will be sold out in a few hours...
it's not just that. when there's a big jackpot at a casino at the slot machines (i.e. the jackpot hasn't been paid for a long, long time) and it is so large that the expected value of each drop of a quarter actually has positive expected value, by enough of a margin, someone with a huge bankroll comes along and hires teams of people to monopolize the slot machines until one wins, paying them by the hour.

you can't do that.

so, when you're faced with depositing a quarter, does it really matter if the expected value is positive or negative? No, due to the variance - not due to how risk-averse you are, simply due to the variance.

Likewise at a startup: you only have one life, in which you can only do so many. The more you can do, the less the variance and the more the expected value comes into play.

Of course Microsoft or Warren Buffett would never 'invest' in lottery tickets when these have a negative expected value; they can buy hundreds of thousands or millions of them. When I buy one lottery ticket, I can buy one, or ten, but basically I have just one. Only the variance matters.

it's not about risk-averse or -tolerant. it's about utility.

people who say "math is a tax on people who are bad at math" simply don't know what they're talking about. People who are stuck in a hopeless life that would be changed by $1 million have just as rational a reason to play the lottery given a negative or positive expected return.

one wonders if the lottery had to be subsidized by corporations, and everyone could only buy one to five tickets (if they wanted) each with an expected value slightly above one, then would mathematicians start buying 5 lottery tickets each?

It has nothing to do with risk-benefit ratio. Even if God could somehow guarantee you access to googolplex googolplex googolplex dollars, but there was only a one in googolplex googolplex chance of your winning it, it would not even be worth the breath to say 'ok' -- try saying that googolplex times -- let alone a penny. Yet the expected value of that proposition is googolplex dollars! So, it's a false 'rationally' to claim that it is worth far more than a penny (given God's guarantee). it's worth nothing.

it's not about risk-averse or whatever. it's simple rationality as an agent who experiences utility here on Earth.

God's proposition is worthless.
Just curious, what's the maximum you can contribute? If it's $5k, that works out to about $416/month, so you're total monthly cost is $514.
More correctly, I think OS X is a gateway drug for Unix. With OS X, you get all the "1337 hax0r" command line goodness without sacrificing MS Office and Adobe CS as you would with Linux.

Now... if I could only get a decent Mono set up on this thing. I could cut out Windows entirely.
That's the exact opposite of the situation. I pointed out that the founder is singular and female, but the "singular they" is used for indeterminate number and/or gender.
IIS 7 Compression. Good? Bad? How much?
I read that using an alarm to wake you up is not good.
The perfect sleeping rithm is different from one person to another so I can't tell people how they should sleep, there are people who can, they studied for it.
The same kind people have in the USA, sadly. I know the guys on our production floor and I'll be blunt: factory work sucks.

If they want it to be better, they need labor laws. The people working that kind of job have little leverage. For example, if people are working 20 hour shifts in ~120 degree heat, it just sucks to be them. But once someone turns that into an on-the-record safety issue? Things get fixed. Maybe China should copy that...
This American Life did a story on this a while back. I don't remember all the details, but it turns out that insurance companies have very little bargaining power with hospitals in general. What ends up happening is that one or two carriers dominate a given local market and get preferential pricing, and everyone else either leaves or doesn't try hard to compete.
I was very surprised that he doesn't mention to stay away from scripting in csh/tcsh.

I've been using tcsh for 11 years now and I wish bash had been the default for the first unix job I had, because tcsh is the devil for writing any script greater than 10 lines.
Not having a demo available is beyond ridiculous. I asked about it in their forums and was told to email sales. I went ahead with the purchase anyway.

It would not take much for them to setup a personal sandbox demo just like spree commerce does ( http://spreecommerce.com/demo )

It can't be that they don't want people to think the product is too complicated before purchase, as their after purchase help docs are limited and they have no personal follow up or checkin.
No. You can't build iOS apps with it, but you can build OS X apps — even for the App Store.

The main problem in my understanding is the lack of garbage collection on iOS. Someone mentioned that iOS 5 enabled GC, but I think maybe they are referring to ARC (Automatic Reference Counting), which isn't GC even though it solves the same problem.
I'm the first to admit I'm quite ignorant of my own history, let alone the economic history of Korea and Japan, but surely you aren't suggesting that if we keep buying stuff from China they will turn into a rich country and magically increase the working conditions?
It's a nice strawman, right? Especially when he points out that the original code, in context, is perfectly fine. His later complaint about the assignment-in-if statement is certainly something shared by modern C programmers (see compiler warnings about same), but it perfectly fits the original style and accomplishes its task.

His criticisms seem to be rooted so far in stylistic issues and in taking the code out of context (design context, usage guarantees, etc.). Then again, how are you to nerdbait while still being fair to original sources?
Hats off to the hard-working Tim Branyen and the rest of the crew at Bocoup. Thanks for sharing!
Even if they did, they could claim it back, assuming they were VAT registered and charging their customers VAT.
Agreed, the example used seems very strange. Every function makes functions about it's parameters and in C null terminated string are to be assumed unless otherwise noted. The std library strcpy would just behave in an identical way.

Yeah, I'm all about checking your assumptions and defensive programming but k&r is hardly as fault because you throw garbage at a random function and it segfaults.

I find the idea of teaching modern C by pointing problems k&r awesome, but the examples given are not really good.
Ask HN: Is overtime to be expected working for a startup?
I know an original founder of a startup must make it their life (or even if it isn't a startup, the CEO often must do so).

I'm applying to various startups in SF, as a developer, and want to know if I'll be taken seriously if I communicate that I will only work paid overtime. Has anybody here been hired to a tech startup in SF and what was the expectation?
Even easier: write on a window. I've used this to practice talks in hotel rooms, where you really won't find a whiteboard.
Perhaps you could just try meditation instead.
It's Time to Start 3D Scanning the World
Smoking Machine
Bonfire brings immediacy to Twitter... Like the previous commenter, the DM system has always felt a bit clunky and badly thought out - Bonfire sort of addresses that really well. Makes Twitter an even better real-time tool for collaboration...
One of the nifty things about the Zeo is that when it does that (the 'SmartWake' feature), it probably won't be mistaken because it's not going on your movements but more your EEG.
The JRuby devs reported 25%+ speedups on a range of benchmarks using the new InvokeDynamic mechanism in Java 1.7u2. They also reported that they have more optimisations to do. Doesn't sound like Ruby is suffering on the JVM.
I have no clue as to their financial status, but Liz (one of the team members) said this in the comments:

Indeed – and I’m pretty sure that those psychic people would be a bit more cautious if it was their mortgage that this thing was secured on
The Plight of Psychoanalysis?
Great article with lots of valuable info in there. The part about the actual whiteboard is almost irrelevant. Most of the comments here are getting too worked up about that.

"Learn Python and use it during your interview."
Python is expressive, a high level and kind of writes like pseudo code. Just write pseudo code. The point isn't syntax anyways.

"The highest value problems I know of are on Project Euler."
I do enjoy running through Project Euler problems but I have no evidence that's making me better at my day job, only better at answering Project Euler problems.
I don't know whether others are like me but I've spent so much time typing rather than writing that my writing is rather bad. Writing on whiteboard is actually easier than on paper. Perhaps the best is to bring a laptop and type it out?
Thanks for the advice... I was looking at the last pages and I've got no clue what's going on.
Yeah, boilerplate structures based on the most popular frameworks would be cool small project and time saver. I'm gonna adopt this idea.
It's worth noting that this isn't a standalone article; it's lesson 55 in "Learn C the Hard Way". In other words, this isn't meant to be a thorough critique. It's just one lesson of many.
Mistakes That Will Kill Your Product Launch
Top Ways to Improve B2B Landing Pages
Yeah, I'm all about checking your assumptions and defensive programming but k&r is hardly as fault because you throw garbage at a random function and it segfaults.

Maybe he should write a series on "Learn Ada the Hard Way"?
Foreign demand only speeds up the process; it's not a necessary component. The Western world went from no industrialization at all to sweatshops and tenements to riches within 150-200 years or so with no rich foreign countries buying their exports. (I'm thinking 1750/1800 to 1950.) That's only three times as long as it took Korea and Japan. China could make the same transformation based entirely on domestic demand the way the Western countries did, but instead, China gets the demand from the Western countries, plus Korea and Japan to speed up the process, plus all the cool technology we've developed to make it go faster. And the relevant population figures aren't China vs. the importing countries, because a lot of Chinese are already rich.
Scientifically measuring hotness of pepper
Would you mind sharing some information on your setup? What make/model laptop do you have and what distro are you using? Did you have to do anything specific to get the power management to work properly? Cheers
The first thing I am targetting is semi lame, but useful for me - a batman style lamp. Its for my parents and me to birectionally coordinate on when to come on skype. Right now I first have to call them and then ask them to come online and same the other way around. This way either party can speculatively just push the button and if the other one acknowledges the computers can be switched on.
What worked for me was to build up gradually over time. I started only napping when I was very tired, in my bed, with the lights off. Even then it took practice before my body learned to fall asleep in a reasonable amount of time.

Then I started napping with the lights on, and then when I wasn't super tired.

Today, I can fall asleep quickly in a chair in a noisy office.
Show HN: Are you trustworthy? Show your trust score and reputation trail
People would lie and say they weren't texting. Premiums would increase. The end.
A 3 year old infographic rises from ashes...
While this is something that we have to remain vigilant about (case in point, vigorous opposition to SOPA), I think the cat's much too far out of the bag to actually worry about general-purpose computing itself.

To effectively prohibit any general-purpose computer, the government would effectively have to forbid the sale of transistors and solder.

What Microsoft, Apple or any particular hardware or software company chooses to do might be objectionable and annoying but it can hardly threaten open computing itself: I can always build my own PC and install linux.
What are you talking about? There is no GC in iOS 5. The only GC in the Objective-C world is the one on the Mac and it's pretty much the off the shelf Boehm one.

The only thing iOS has is ARC. This is a compile time reference counting solution. This doesn't work with ruby in it's current form in any way.
More idiomatic C# might be:

int result;
if (foo.TryAndGetSomeNumber(out result))
doSomething(result);

There might also be a foo.GetSomeNumber() that returns an int or throws on failure.

[fixed formatting]
I'll assume you're bringing up those 2 countries as a direct comparison to North Korea and China? Correct? China seems to be doing alright for now. As for NK? Well when the country was formed, it got the better half compared to South Korea, in that it had all valuable resources and manufacturing. Now you have to ask how did this country with its head start manage to fall behind to its southern counterpart? Had the playing field been level, ie no sanctions placed and NK was allowed to partake in international trade, the story today would be very different.
This is really cool. As someone who has only a little experience with backbone, I've really been looking for a more opinionated approach to backbone.
In the United States, there are no import duties on computers or on computer components.[1] But there are no duties on assembled computers or on computer components entering the United Kingdom either, so far as I can tell.

Assembled computers are listed under heading 8471 of the Harmonized Tariff Schedule, which is used by all trading nations. (They are referred to as "automatic data-processing machines"; the terminology and categories are all quite archaic.) The UK imposes no import duty on computers of any type.[2]

Parts and accessories "suitable for use solely or principally with" computers are listed under heading 8473.30 and likewise can enter the UK duty-free.[3] It's possible that some required components are listed elsewhere in the HTS and that those are not duty-free. But that seems unlikely; almost everything in Chapters 84 & 85, which cover all electronics, can enter the UK free of duties.

I'm not familiar enough with the UK tariff regime to know whether there are other considerations beyond the base duty rate. (But it doesn't look like it; the relevant Acts of Parliament setting duties for each class of good are noted on the BusinessLink site linked below.) So I have no idea what import tariffs Raspberry Pi need (or think they need) to pay. It certainly doesn't look like the UK has some screwy import regime that penalizes firms wanting to assemble computers there.

1. So long as the goods' country of origin has "most favored nation" status. This means, essentially, that it has normal trade relations with the United States. That includes all members of the World Trade Organization.

2. http://tariff.businesslink.gov.uk/tariff-bl/export/heading.h...

3. http://tariff.businesslink.gov.uk/tariff-bl/export/heading.h...
The example given is an example of speech.

"If I write a poem, you are legally prohibited from reciting that poem in public or to a stranger..."
Loving Bonfire - it's one of those "why didn't they think of that" things that fixes something that you didn't even realise was broken until someone shows you how it could work.
Really, what's this trollbait doing on HN's front page?
I NEED HELP FINDING OUT ABOUT SOMEONE WHO HAS BEEN PLAYING A PRETTY NASTY GAME WITH ME, IS ANYONE WILLING TO HELP?
Suddenly, Google Is Winning the Online Identity Race
Don't port objective-C to android for Cocoas 2D. Cocoas2D is a fluster-cuck enough on iOS.
LESS 1.2.0 - Mixin Pattern-matching and guard expressions
My Welcome to 2012 -- Inspired by Reading Here
1. What's its carbon footprint?

2. How do these artificial trees compare to natural trees?
Android is full of hello world, copy cap apps, and junk that doesn't get filtered as well as in the Apple app store. So quantity doesn't really amount to much there.
IIRC, foursquare.com's client side was recently rebuilt in Backbone and now they retrieve all data using their API. It's an interesting trend that I think more and more large websites will follow.
7 works like a charm with Wine under Ubuntu if you don't mind working with an old version. I personally find 7 to be sufficient for everything I do.
Since virtually no production C code† can actually handle the case of a random malloc() call failing (just like with exceptions in C++, the code to reliably unwind an allocation failure depends on exactly where you're at in your allocation pattern), the simplest and most reliable way of handling malloc() returning NULL is to rig the program to abort.

You're right that assert() isn't the most reliable way to do this (programs have to work whether or not assert() is a no-op; that's the point of assert).

On most platforms, you can just rig malloc to do the abort itself instead of failing --- either with configuration or by preloading a wrapper malloc. Some very, very large shops do exactly this.

Another very common idiom is "xmalloc", which does the malloc/if/abort dance. But xmalloc() misses every place where libraries call malloc(); the most obvious example is strdup(), but the more pernicious issue is 3rd party code that can't know to use x-whatever().

Calling malloc and then immediately assert()'ing success is a reasonable shorthand. That exact same code can be made safe on any mainstream platform just by changing malloc's configuration.

† On general-purpose platforms; I know things are more complicated on embedded platforms.
THE TRUTH ABOUT AMERICA’S SPACE PROGRAM
“Yugoslavs made rapid development based on unknown diaries of Yugoslav space pioneer Herman Potočnik – Noordung after 2nd world war. Technical solutions described in Potocnik’s unpublished papers were the basis for establishing secret Yugoslav space
programme in 1948, after Josip Broz Tito’s conflict with Stalin.
In late 1960, CIA discovered that Yugoslavia already had an operational space-flight technology.
In March 1961 Yugoslavia secretly sold complete space programme to USA.
In May 1961, Kennedy announced USA choose to go to the Moon.
In this documentary we will reveal how Tito built the biggest secret underground space centre in Europe in army base Željava with code name “Object 505″.
Did anyone get the O(document size) solution? I can't see how it would work without checking each word against the list.
Problem with this idea is that .data will encourage "data servers" but not create a "data web"

Allow me to explain.

RDF[1] was created towards solving the "data web" problem. However, the challenge has been representation and modeling "things" such that we can cross-link "data" on "web". The language to create such shared representations (Web Ontology Language[2]) is difficult to use and standardize. Nevertheless, this approach has been hugely successful in knowledge-intensive domains such as biology and health care.

On the Wild Wild Web, the microformats[3] have got wide support from Search engines and web publishers.

1. http://www.w3.org/RDF/

2. http://www.w3.org/TR/owl-features/

3. http://support.google.com/webmasters/bin/answer.py?hl=en&...
I'm interested, what OS are you running and what don't you like about irssi? I have irssi running on a Micro Instance of EC2 with very little added to the config and not only do I love it, but when I'm AFK and someone privatemessages me it opens up in another window and saves it, if someone highlights me it gives me a signal in the terminal, etc. I find irssi + urxvt amazingly amazing for IRC.
42 simple tips to help you get to sleep
MacRuby uses the same garbage collector as Objective-C, libauto. Which, incidentally, is not what iOS 5 includes. The "garbage collection" in iOS 5 is Automatic Retain Counting, a compiler feature based on static analysis rather than runtime scanning (it's certainly not generational).