skysight-inc/HackerNews huggingface dataset:
On the contrary, you can do something safely with such a pointer - compare it with another pointer. If the value of 'alloca(0)' is _unspecified_, then this comparison is legal, and its result, while not specified, must be consistent. In other words, code like this should not fail the assertion:

void *x = alloca(0);
void *y;
int is_x_null = (x == NULL);
memcpy(&y, &x, sizeof(y)); // confuse the optimizer
assert(is_x_null == (y == NULL));

Note that is_x_null can be either 0 or 1, and this value may even vary between runs. But it's not acceptable for the assert to fail here, and it sounds like it would with this bug.

If you argue that alloca(0) is 'undefined behavior', of course, all this goes out the window. Since alloca is not standardized, though, one can't really argue this - all of alloca's behavior is implementation-defined, and so if llvm-gcc really wants alloca(0) to be UB, it should document this fact as a porting concern.

Incidentally, all of this applies to malloc(0) as well. C99 defines malloc(0)'s behavior as follows:

> If the size of the space requested is zero, the behavior is implementation- deﬁned: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object.

This is actually even stricter than 'unspecified', in that it requires the implementation to document which choice it takes.
How many developers should it take to build an ecommerce site??? Sys-admins + DBAs + "biz logic" devs + "front end" devs and a few artist, project mgr types and entry level supporting developers???

Given a sufficiently inefficient process, an infinite amount of labor can be absorbed, I suppose.

I would think a core tiger team could accomplish wonders simply iteratively triaging their existing operations.
Apture allowed you to highlight the company for example and would show you the Crunchbase entry for it
Tumblr asks users (via dialog box) to uninstall popular Missing e browser add-on
That's "Sir" Johnathan Ive. He was knighted, you know.
Right, it's not a failure of recruiting, it's a failure of management and environment: nobody wants to work at Target developing software no matter how much money they pay.
What is the keylogger's name?
A bit humorous almost that some of our most cutting edge scientific research is still done in Fortran in some fields despite being over 50 years old :P
How does your distributed team do Scrum?
Parse is YC funded.
Not in America he isn't.
A C compiler is not required to know what the alloca() call does, but it is allowed to do so. If your call to alloca() resolves to the one in your system's standard C library, the compiler is allowed to make use of any knowledge it may have about that call, how it works, and what its semantics are. It is then perfectly legal for it to make optimizations based on those semantics.

I know that NULL isn't necessarily 0x0. My example simply assumes that it is, which is usually the case. Note that even if NULL is not 0x0, and the address that is 0x0 is valid, it's still not legal to do * (int * )0 = 0, as (int *)0 is NULL, regardless of the actual underlying value of NULL.
You can generate the Sierpinski pattern in a lot less code than posted:

iterate (\xs -> zipWith xor ([0] ++ xs) (xs ++ [0])) [1]
Blog: Retro-spectacular - 2011
I've met lots of people who code C++, and advocate C++.

I've met lots of people who code Java, Ruby, etc and advocate those.

I've met very few people who've shipped one product using C++ and another using Java/whatever - but those who have? They advocate using C++ sparingly if it all.

Bottom line: if you goal is to have beautiful classical music in the background for your party, then you could hire Joshua Bell, you could spend years trying to become Joshua Bell, or you could buy a fucking iPod and move on to the next problem.
Usually I wouldn't say this, but...

Has everyone on HN lost their friggin' sense of humor?!

[EDIT: let me clarify by saying that my karma has gone up and down on the top comment. So some folks get it.]
Files have metadata, and exist in an environment where the OS ensures that appending to a file doesn't overwrite another file. Neither of those apply to pointers in C.
I used to do that kind of hacking in the 80's. I recognized the CALL-151. I have an old Apple II+ in the other room I'm tempted to try firing up just to solve this mystery.
>Interestingly enough, Jobs himself was also considered for knighthood by the Queen of the United Kingdom, but the proposal was blocked by a former Prime Minister because Jobs declined to speak at a Labour Party conference.

That's fascinating to me. As an American who has never paid much attention to British knighthood, I am not knowledgeable about the process for selecting whom becomes a British knight. Could someone with the requisite knowledge perhaps elucidate on whether or not ostensibly petty politics get in the way of these things with regularity?

It seems absolutely absurd that someone who is being considered for knighthood could be denied of that because of something as minuscule as declining to speak at a party conference.
Good point that you can compare the pointer with another pointer. However, your bit about consistency only applies to results from the same call. Nothing says that alloca(0) must return the same pointer on two different calls, and indeed one would naively expect the opposite. While one could certainly claim a compiler bug if the same value compared both equal to and not equal to NULL, that's not the case in the example given; instead, alloca(0) behaves as if it returns NULL in some cases, and non-NULL in other cases, which is completely allowed.

It's true that alloca is all implementation-defined, but do you know of an implementation where the value of alloca(0) is defined? On OS X, it is not defined.

Comparing alloca(0) to malloc(0) is off-base. The return value from malloc(0) has an important requirement that alloca(0) lacks: you must be able to pass the result to free(). Therefore, the compiler can't have it be an arbitrary value, whereas replacing all calls to alloca(0) with (void *)arc4random() would be (aside from the side effect of calling arc4random()) a valid transformation.
The good thing about learning C/C++ first is that it will help you understand how the internals work and you will (should) learn how to program efficiently and understand basic algo's and methodologies. For that matter, assembly might be a good start! :-) If you understand HOW things work, it will not matter what language you elect to use down the road (for example, you might want to use Rails because it makes developing web apps a pleasure, or whatever). Ultimately, your choice.
Personally, I like that I can spin up a backend for a project without needing to worry about knowing PHP/Rails/Django/MySQL/PostgreSQL/etc. It just makes it that much easier to get a minimum product out the door. If the day comes when I need to migrate that product to something homegrown, I can do that, but it's a lot easier to start with Parse for now.

As for learning its platform, there isn't much to learn, really. If you're familiar with iOS development (or Android), it's dead simple. I learned like 90% of it in an hour or two, reading through the quickstart guide and the docs.
WebRTC means peer-to-peer is probably coming to Chrome and Firefox soon, which will allow an app like this to transfer Wikipedia in all its 7.3GB (compressed) glory without harm to anyone's servers.

http://www.webrtc.org/faq#TOC-What-other-components-are-incl...
I'm really confused. I'm not a computer science major, but I've worked with a lot of really talented developers who use Rails to great effect, so I'm struggling to parse this message without dismissing it out of hand. It's difficult to listen and take seriously authors who throw around jargon like punches. As a layman, it strikes me as pedantry.

So, can anyone answer the question: Are these concerns objective, or are they just opinion written in a way to make the author sound authoritative on the matter?
Incredibly well deserved. If we all learn one thing from Sir Jony Ive, it's that simplicity wins out every single time.

Really happy to see him get mainstream recognition, because he truly should be up there with all the other well-known genius Brit's like Branson and Dyson.
God says...
music you_talkin'_to_me Percival exorbitant homo Zzzzzzzz
bickering well_golly how_about_that you_should_be_so_lucky
hang_in_there horrendous really lying Okilydokily pride
absolutely fight how_high I_forgot I_got_your_back absetively_posilutely
yikes petty radio hello no_way_dude WooHoo praise ipod
bye didn't_I_say_that downer watch_it_buddy humongous
malloc(0) has to return a pointer you can pass to free(), so it can't be arbitrary junk. The only thing you can do with the pointer returned from alloca() is dereference it. Technically, as pointed out elsewhere, you can compare it with other pointers, but the only real requirement there is that it compare not equal to any other non-NULL pointer.
It's good practice to keep your network data model somewhat isolated anyway. For my projects, I'm creating a Core Data model to match the Parse object data model, and running everything off that, using the Parse objects to keep the CD up to date. That way, I have device-local copies of all app data, and if I need to change backends in the future I only need to replace the isolated Parse code.
A friend of mine at school was doing research in particle physics and I asked him why he was doing his stuff in fortran, and he said that all the physicists learned how to program in college (read 40-50 years ago), and were too busy to learn anything new to teach.
Watch Beneath The Darkness
Watch Beneath The Darkness cinematography is by Massimo Zeri which is edited by Eric Potter. This film is due to be shown in movie houses on January 6, 2012 under Sunset Pictures studio.
Not sure why you mention overwriting. If you allocate a memory block of 0 bytes then it would seem logical to me that you can't write anything to it. NULL would also satisfy that definition, but alloca(0) is supposed to return a region of 0 bytes at the end of the stack... meaning a pointer to the end of the stack.
Doesn't work if the person pulling the site down is the registrar, and they do it by hijacking your DNS. Your pointer to the other host goes away too.
Well IIRC it was a tempting way to replace for-loops with direct list operations ala Python, Ruby etc. But the amount of syntactic noise and cognitive load seemed too much for the added leverage.

Our code had sufficient complexity that I didn't want one more oddity (as many would see it) to explain.

But for a small team, or a team that's all on the same page, maybe it's good.

Sorry to say there's no dramatic story of code explosion here!
Random article results in 404 once in may be 4 times. Here is a suggestion for an improvement - a link for making 404 pages available offline. So if I go looking for a specific page that isn't offline I can make it available and read it later.
it helps to turn thumbs off if you encounter that problem on armv6 builds
The fact is that being an engineer at Target is very likely a boring, bureaucratic drag. The best engineers are overwhelmingly the best engineers because they love what they do and hone their craft. Someone who takes so much pride in what they do is not likely to get much satisfaction out of developing a website that helps people buy a mop. It's a fine thing to do; people need mops. But it's not a particularly interesting problem to be solving.

So, I think places like Target will always have this problem unless they're willing to pony up the cash and offer more money than the interesting jobs. After all, there's no reason that some behemoth like Target can't compete with some SV startup in salary.
For those who never saw it, Ken Robinson’s 2006 TED talk is as amazing as it ever was; go watch it right away: http://www.ted.com/talks/ken_robinson_says_schools_kill_crea...
One of the biggest problems with lego's is that they are too good. You only needed one decent sized set to ever make anything really neat. In order for a product like that to be sustainable, you have to introduce new sets, or collectable stuff, and when that becomes your primary source of income, it gets all of your marketing focus, and the brand loses its original identity and appeal. I don't think that they are doing this to market to girls as much as they are to people who think lego's are ugly, much in the same way that the collectable sets are to people who want something impressive and complex to build but do not have the time or energy to come up with designs themselves.

I hate that it came to this. =[
Everything in C operates according to the "as if" rule. In other words, the resulting program merely needs to behave as if the result was executed according to the spec. How execution happens is left entirely up to the compiler.

C also doesn't define "the stack" in any way. And of course alloca() isn't part of C at all, but on the systems where it exists, it's not very specific about just where it allocates stuff, just that it's on that nebulous "the stack".

Given the above, I believe you cannot write a conforming program that can detect the difference between alloca(0) returning a region of 0 bytes at the end of the stack and alloca(0) returning something else. Since no conforming program can detect it, the "as if" rule allows the return value to be considered to be anything at all.
Ask HN: Startup CEO wants to improve people skills, but how?
I need your help. My new years resolution is to improve my people skills, but not sure how to go about it in an effective and authentic way.

Some background. I'm founder of a startup of 6 people (not profitable yet but getting there) Apart from team I have to pitch with investors, deal with customers, recruit folks, network with press and partners etc

I'm naturally introverted, and while I'm confident and proactive (eg I organize some groups for activities) I just can't seem to relax or establish natural friendships or relationships with people. I view that small talk stuff as difficult and sometimes seems fake, like a chore.

You could say I'm the sort of guy who's happiest at home playing Skyrim alone rather than out at drinks with friends.

My co-workers respect me but I doubt they like me nor do I really motivate them in their jobs (I see bored faces when I talk). Personal wise I don't have many close friends apart from my girlfriend. To be honest, it all brings me down sometimes.

I know they say focus on your strengths, but this year I genuinely want to make a change for the better in this area - to improve my personal happiness and relationships in social and work.

I'm a practical guy, any practical tips HNers?
You're right, but would alloca(0) be undefined behavior or simply implementation-specific behavior? I think the latter would make more sense, and if so then alloca(0)'s behavior should at least be consistent and not depend on any optimization settings.
Hmm, this got me thinking: An interesting loop occurs when you want to announce that person X has been knighted (what is the verb for women, "damed"?), i.e. is now Sir X (SX). The thing is you can't say "SX has been knighted" because that is a tautology. But saying "X has been knighted" sounds wrong because, you know, he's no longer X.
"This example was deleted by the poster I am responding to, but was an example involving comparison of a pointer value to NULL being allowed to be optimized to false if it had been previously dereferenced."

What are you talking about? I didn't delete anything.
If you have not seen Gary Hustwit's design documentary, "Objectified", I recommend it highly. Especially if you are not a professional designer (I am not a designer, and I know enough to appreciate good design, not produce it) [1].

In "Objectified", Dieter Rams (of iconic Braun fame) is asked if there is any company that really gets design today. He answers after a moment's pause: "Apple".[2]

[1] Ira Glass on the importance of having good taste before you can produce to the expectations of that taste

http://www.youtube.com/watch?v=BI23U7U2aUY (EDIT: Fixed link)

[2] "Objectified: Dieter Rams commentary"

http://www.youtube.com/watch?v=KBF1rOxWsxg

http://objectifiedfilm.com
GoDaddy's Adsense/Adword accoubt let's destroy it
Hey guys

So we are all pissed at godaddy about SOPA, I just came up with an idea. I was going to register a domain and typed domain registration into google. Now the first thing that came up was an Adword for godaddy, so I thought hey I'll click here waste godaddys money they pay to google per click and register my domain elsewhere.

Now imagine if 100,000 of us did this everyday :)
Wouldn't be easier for Tumblr to bring the desired features of the addon to Tumblr?
I've found that, as a general rule, there's no such thing as actual deadlines. Or rather, actual deadlines are rarer than supposed ones.

One common excuse for a particular ostensible deadline is that it is due to some other, downstream/outside deadline, perhaps on the customer or stakeholder's side of the fence. But even then, very often, that entity's deadline is not really a deadline, it is typically yet another date pulled out of thin air because it sounded nice, regardless of whether it was realistic. A guess added to another guess added to another guess which get summed up and padded and turned into an estimate then pegged to a date then ever after referred to as a "deadline" (cue ominous music.) We come up with deadlines because we like to have certainty and the myth of control over things where in reality there's quite a deal of uncertainty and quite a large number of things over which we have no control. Deadlines can be good as goal dates associated with certain milestones, but even then it's best to call them that and treat them as such. I've seen too many software industry deadlines where teams worked like keyboard slaves to ship a particular feature set by a particular date, and ALMOST ALWAYS in the cases where the date wasn't hit there were NO significant negative consequences, no heads rolled, no business lost, etc., just a pleasant whooshing sound as the date flew past, and a quiet rethinking on the part of every developer who just took part in that "false alarm" march.

I've also noticed that, at least in the software industry, that deadlines are common when Project Managers are present. But PM's are, in my opinion, a bit of an anti-pattern themselves. Not that all PM's are bad -- because some of them are good and helpful -- but rather that if you're in a situation where you think you have to have a PM (or a deadline, or both) then that's usually a consequence of something else being wrong about your organization or process, and so you might be better off fixing those root causes instead.
As I see it, its not really crocodile tears, but the end result of evolution, becoming the apex predator on our planet, and with a society based on our innate dichotomous nature.

Someone else bears the true costs - example, say some random Chinese factory worker at Foxconn who though is able to survive on meagre wages, is unable to spread his genes since he is not able to find a wife and set up a family - while you reap the rewards and go on to sire a new generation which has the incentive to behave in a similar manner.

I use to be very high falutin about all this thing, thinking some true Marxist society will emerge eventually when capitalism collapses. Now, after looking at all the neuroscience and psychology research that has been done, I'm not so sure if we can ever escape the more primal and insidious parts of our nature.
Who is we? At best you can say that the school system and large bureaucracies don't value these skills. Certainly Apple and the British empire value Ive's contribution to design immensely.

The Tony Starks of the world are not meant to be low level grunts, keep in mind that the school system is designed to produce interchangeable parts to work in large manufacturing and bureaucratic organizations such as fortune 100s, the government and the military. The levels of leaders who self select out is acceptable and therefore the system will not be changed.

The school system is not for the betterment of the people who go through it; it is for the benefit of the owners. It's not a bug that our school system produces learned helplessness it's a feature.
That won't magically make people stop running the broken addon. If they went so far as to put this dialog box on Tumblr, the addon must be doing some seriously broken shit that causes them real pain, and it must be creating real support requests.
Sorry, I saw the new example appear and I thought it had appeared into the slot where the old one had been. That is my mistake for finding myself in a confusing edit/edit thread and not managing to internally track the diffs well enough.
Right, exactly. It's only really cool for magnet links because the law is different for "linking to content" vs "hosting content" right now.

One step further in this direction would just mean "including all the data for one or more documents on one page". You've just invented...a document, possibly with more than one media type.

Think about it this way: You have a 10K document which contains 200 bytes of link data; a URI to another hypertext document that is 5K in size...vs...you have a 15K document which contains 5K of "link data"; the other document.
Trying to find the ones that have no in-arrows. I see: FORTRAN, B-0, Lisp, APL, SNOBOL, JOSS, ISWIM, Forth, sh, Prolog, sed, ML, B (not the predecessor of C, some other B, 1981), and Tcl. Did I miss any?
Tell you what, you write an app that'll do it 100,000 times for me everyday and I'll leave it running :)
"Imagination is more important than knowledge." - Albert Einstein

"When he moved from Germany to Switzerland at the age of sixteen, Einstein spent a year at a school that emphasized independent thought, free action and personal responsibility. He thrived in a learning environment without rote drills, memorization and force-fed facts.

Based on the philosophy of a Swiss educator named Pestalozzi, the school helped students move through a series of steps from hands-on observations to intuition, conceptualization, imagination and visual imagery.

“Visual understanding is the essential and only true means of teaching how to judge things correctly,” wrote Pestaslozzi, and “the learning of numbers and language must be definitely subordinated"

...It was at this school that Einstein, age sixteen, started picturing what it would be like to ride along a beam of light.”

http://sparkmygenius.com/2007/07/myth-busted-einstein-on-edu...
With the widespread use of anycast, does "first class addressing for machines" even matter any more?

In situations where anycast is used, how do you even know what machine a given address to connecting to?

RON was a step in the right direction, imo. With small overlays, MAC addressing comes into play and it becomes a little easier to know what machines (not simply what "addresses") you are really connected to.
You could have pointed out said hypocrisy without the ad hominem attacks, in fact I wouldn't have felt compelled to down-vote you if you had. Instead your comment reads more like a petty tantrum based on some grudge you (apparently, continue to) hold against Paul.
My point is that few of the folks applauding/excusing the StratFor intrusion would support a similar intrusion of the NYT, WashPost, or even Economist.
You lost me at "As much as I hate LLVM."

What's to hate?
Wouldn't make sense to place a message saying IE7 is no longer supported and a link to upgrade? I think most Facebook users won't know what's wrong with their computers.
I'm confused. He starts off by asserting there were only three options; Assembly, Fortran or Algol. But then later on an essential part of the process turns out to be "a syntax-sugared, low-level language, for which a compiler was available". So why wasn't that apparently anonymous language one of the base options ?