skysight-inc/HackerNews huggingface dataset:
I'm honestly not sure I can answer that. I could argue either direction. I think it boils down to how important the functionality is to your application. It seems like risky business to rely on a single third party for mission critical components of your operation. Also the assumption that ALL users you'll encounter will have an Amazon account is... optimistic. At least a payment service like PayPal offers a login or a blind CC processing option using the cards details. This lowers the bar, I've had a PayPal account for almost 10 years, I've processed multiple payments with it PayPal. In the past 4 years I haven't logged into my account to do so, I'll type in my actual card information rather than deal with remembering my password, recovering my password, updating my stored card information, etc.
> An alien species should be different. Vastly different.

That is one thing you could do with an alien species. Banks has done that elsewhere quite a bit. It could be that his imagination failed him here. Or he could have made a conscious choice, seeking a specific effect.

I think it was the latter. For me, part of the point of literature is to explore what it means to be human. One of the things that comes up over and over in Banks's work is encounters between developed and primitive cultures. He uses the contrasts to examine where we've come from, who we are, and where we might go.

Player of Games in particular to me spends a lot of time looking at the desire to win, and also the desire to play for high stakes. The Culture's post-scarcity society makes bets meaningless. How does somebody with a gambler's nature fare in that context? And how does somebody raised in that context change when they become immersed in a society built around gamesmanship and gambling? The Azadians are an exaggeration of particular aspects of humanity because he's trying to explore those aspects. If they were more alien, you would identify with them less, which I think would weaken the impact.

If you're reading Banks for things like detailed descriptions of fictional games, you should probably look elsewhere. He's definitely the kind of guy who likes building elaborate sets and then showing them to you. But they are there to support the drama that is performed in front of them.
Amazing! Despite the factual inaccuracies, it's a wonderful job! Two thumbs up!
I can think of one way to find out for sure.
Ask HN: Learning PHP Suggest Book
I am learning PHP. This is practically my first programming language but I am not a newbie at programming. I have done C programming during graduation. Please suggest a good book. I purchased Programming PHP 3rd Edition O'Reilly. The book is crap and does nothing for clarifying core concepts of PHP. The book looks to me nothing more than an edited version of online PHP manual.

Please suggest a book which clarifies core fundamentals and concepts.
try making it as 2 apps, one for API only and one for UI, that way you can make changes independently and replace them with other technologies when needed. We have build a few large applications this way.

for api use rails-api and for web use any framework, you can use rails or if it is based on backbone.js or simple bootstrap, you can use sinatra for it.

for scaling, identify the bottleneck and solve it. first bottleneck would be database, there are known solutions for it, cluster, sharding, read write seperations etc.

do less per request, bring in a messaging queue to handle the parts. e.g.. incoming and outgoing email processing
Mmm... that will fail since the last character is not null. Change:

char buffer[5] = {0};
strncpy(buffer, "This is a long string", sizeof buffer);

to:

char buffer[5] = {0};
strncpy(buffer, "This is a long string", sizeof(buffer) - 1);

(I find sizeof() to be clearer than just sizeof in this case since "sizeof buffer - 1" looks awfully strange.
It's good to see some publicity around this, my experience from Stack Overflow tells me few C programmers know about these details.

That said, if the article's code would have appeared on Stack Overflow, I wouldn't be able to prevent myself from also saying:

The author's suggested replacement, the C++ template function (!) strcpy_safe(), is not so hot in my opinion.

It uses strncpy(), which is record-oriented and thus will always fill all its n bytes. If you do:

char bigbuf[1024];

strncpy(bigbuf, "foo", sizeof bigbuf);

Then strncpy() will happily 0-fill all of that buffer space, which of course is completely pointless and just a waste of precious cycles. This is because it treats the buffer as a "record", and insists to initialize all of it.

This is the "flip side" of the logic that prevents it from 0-terminating if the string fills the buffer; since the buffer is a record with a known size, and not really a C string, it doesn't need to be terminated, right? Heh.

Also, POSIX reserves the namespace of functions whose names start with "str". I'm not 100% sure how well this applies to C++, but it seems prudent to avoid defining your own function with a name like that.
I can't really agree with a single word of this and I've been writing Go weekly for 8 months.
Work with an academic advisor so the classes for your masters degree plan align with a PhD degree plan. Do that and then work on the PhD. Then if you decide to quit early, you can at least earn a masters degree along the way while working towards a PhD.
Thanks, Mike. And sorry also if my reply was too lengthy or pedantic or otherwise out of place. I feel bad for getting into a back-and-forth about this.
If someone doesn't release a version of Jedi Outcast with g_saberRealisticCombat enabled by default, this whole thing will be a complete letdown.
bench old_ns/op new_ns/op delta
"BenchmarkHTTPClientServer 373216, 52646 -85.89%"

That bench is 7 times faster in Go 1.1 than 1.0.3.
Tell them that in exchange for 20% more time you expect a 20% pay raise. Talk about all the things you're going to have to give up if you take that extra time, and how that makes you unhappy. Since they're asking for something from you, they can't get mad at you for negotiating something in return. No one can call that unfair with a straight face. Most likely if you do this they probably won't actually give you 20% but will may offer you something much smaller. You can decide to either accept this, or, you can say that their counteroffer is not good enough for you, so you can't take the extra time. That way your reason to refuse is completely impersonal, and not because you don't care.

Regardless, start looking for another job in the meantime. The culture of where you work sounds completely inhumane.
He talks about not knowing when to update the feed: This could be easily accomplished by running the php file every time, check how old the cache is and return a new cache if it's older than a minute for instance. You could then guarantee that there would be no stale pages
cant beat the system ? go with the flow.
5 Important Things To Know Before Buying a New Carpet
Like the advent of nuclear energy!
Probably where the information come from. The price seems to be more a function of the limited market of potential customers than anything amazing about the data contained.
I'm the author of the article. Let me try to address your thoughtful observations.

>This doesn't seem to be easy.

Quite agreed. It's not an easy thing to measure accurately. I believe the explanation for the numbers is indeed the first of the two options you present, as I wrote in the original piece. As the Dr. Dobb's readership has grown vs. 2010, both in terms of unique visitors to the website and subscribers, I don't think the second option is likely.

>not every programmer is a Dr. Dobb's reader

Quite true. This is a problem inherent in all surveys. The survey size for these two questions were 1143 in 2010 and 500 in 2012, which statistically speaking would be fairly representative samples. The real rub is that programmers are not a homogeneous group, so the results will change a lot from one type of programming to another. For example, Dr. Dobb's does not cater much to embedded developers, consequently the effect that they would have on the charts is not captured.

If I assess the 2012 numbers based on what I know anecdotally, they seem acurrate insofar as capturing the broad trend towards polyglot programming. What was counterintuitive, at least to me, was how much the trend accelerated in the last two years.
> But still, why not criticize where they host it?

Because criticizing a no-strings-attached gift to the public is obviously rude? "Don't look a gift horse in the mouth" is not some subtle gotcha of social interaction. It's basic politeness.

If their choice of hosting is so terrible, you're entirely able to upload it wherever you please.
> Yes it's probably a good thing to pay for a service that you like (I do)...

It's also good to pay for a service that you want to stick around.
> That plainly isn't true. Why come to HN to make hyperbolic generalisations about cancer therapy?

That was not a generalization; I explicitly labelled it as "worst case", but what actually happened to one of my girlfriend's patients is that as a reaction to the cytotoxics, his entire skin started to dissolve. This may have been an extremely rare special case, but it did happen, and the doctors in charge didn't stop the therapy even then. The patient died after suffering effectively as a burn victim for 2 weeks.

It's great to hear that you are willing (and presumably trained) to consider non-therapy as an option as much as whatever the newest miracle cure is, but that's definitely no the case for all oncologists everywhere.
http://www.amazon.com/dp/0672329166

This is "the" php book that everybody uses to learn php and mysql. It's also the book I used years ago. It covers both php and mysql, which is good because both are consistently used together.
Has a claim as coarse-grained as "There's no real reason to not write something in C" ever made any sense past the immediate attention-bait value? I mean, different languages have different use cases and you can't pretend to make a case for a language on your own perception of it, let's be serious a second.
I have read the first edition, not the second yet.

There is very little good material written publicly about building secure systems rather than breaking them or fixing components. This book describes a series of systems (not just stand alone IT systems) and describes their security in their social / cultural / physical context.

It's not a patch and firewall compliance guide, it uses the systems word appropriately. There are no big methodologies or techniques, which is appropriate as these just don't exist at the scale this book discusses.

For technical 'breakers' moving into the world of building it's a useful book.
When I learnt PHP I didn't really needed a book.
What I put on my pipeline was like 'build a small blog cms'. I then figured out how to do it, applying also my previous C language knowledge and digging the manual for syntax and functions specs.

After having it working in a very "procedural" way I started to make it OOO compliant (it was PHP4) and then I refined it for some times.

I have a question, btw...
How could it be that you are not a newbie to programming but PHP is your FIRST programming language?
I quite agree. I expect in future surveys JS will be broken out separately. (Note: I'm the author of the original article.)
$ cat /tmp/t.c
#include <stdio.h>
#include <string.h>

char buffer[5] = {0};

int main(int argc, char argv)
{
strncpy(buffer, "This is a long string", sizeof buffer - sizeof buffer[0]);
printf("The string: [%s] The len: %ld\n", buffer, sizeof buffer);

}
$ /tmp/t
The string: [This] The len: 5
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3

edit: oops. Coverage before Coffee!
I guess you don't remember Netscape.
Here's a better idea: Stop using the str* functions completely. Start using buffers with explicit length fields attached, and start using the mem* functions.
So what will the new User Agent string be? "Mozilla/5.0 (X11; Linux x86_64) Blink/537.33 (KHTML; like WebKit; like Safari; like Gecko) Chrome/27.0.1438.7"? Hopefully people will finally start using feature detection rather than user agent detection...
I don't have a good book to recommend but I've always thought that PHP has some of the best online documentation of any languages/frameworks that I work with.

PHP Manual:
http://www.php.net/manual/en/index.php

[Edit] Derp I just noticed that you mention the manual at the end of your initial post.
Let's all take a deep breath and contemplate the times when we have been as self-assuredly wrong as the author of the above comment. Here's to civil discussion that shores up the spots in life where we're ignorant.
[Bounty] New Concept: Bitcoin Exchange Seeks To Fix Bugs *PRIOR* to Launch
Should This Windows 7 Bug be Fixed?
> I bet someone wrote something equivalent to InclinedPlane's comment about it at one time

Doubtful, because an equivalent statement would sport an equivalent truth value for an equivalent statement of support. Substitute "aether theory" for "dark matter" in InclinedPlane's comment, and his assertion of its wide confirmation would be trivially false. Many physicists at the time believed the aether theory to be true, but confirmation remained (rightly) elusive, despite very sophisticated attempts.[1]

I feel the need to point out that the periodic table was also built up from observed effects without knowing what the stuff actually was. It wasn't the first attempt at categorizing the elements. Mendeleev's table was special because, like dark matter and unlike aether theory, it had positive predictive value. It made predictions about the properties of unknown elements that turned out to be correct.

[1]: http://en.wikipedia.org/wiki/Michelson%E2%80%93Morley_experi...
Cory Doctorow: How I work
And how log until someone makes a browser-based version using EMSCRIPTEN, à la BananaBread?
Yeah. That regexp is greedy, obviously.
What about your start-up?
Also, concurrent programs that use lock-free algorithms might perform better than locking ones, but they keep the CPU spinning while waiting to complete and thus may use more power as well.
Nice. You should change the naming convention to match with the iPad default nib naming convention (~ipad nib names will auto load on iPads).

What I do is:

iPhone 3.5 = nibName~iphone3_5

iPhone 4 inch = nibName~iphone4

iPad = nibName~ipad

Then, when I'm editing my nib files in Xcode, it's much quicker to figure out which one to click on based upon the name.
I had thought that English was more dominant in South Africa than Afrikaans, but I guess it's actually the other way around.
Oh the joys of c...
The string: [This ] The len: 5

Doesn't it bother you that your 5 character long buffer that is supposed to be terminated by a null happens to have 5 characters in it "[This ]" instead of 4 visible "[This]"?

Your memory just happens to have a null 6 bytes after the pointer.
Pop quiz: is sizeof a function?

(Hint, no, its an operator. Like -- and &. Do you prefer this form:
--(someint);
Ugh, I remember that time, having exactly those arguments. IE having all sorts of non-standard features, so other browsers should probably copy its quirks/bugs also.

To answer your sort-of question, that time was overshadowed when it became obvious that IE6 (and later IE7) was the absolute worst choice. And that's a reputation Microsoft is still trying to clean, years later.
Kailua, Hawaii - Real Geeks

We are a small team working to take the real estate world by storm. We are looking for Python hackers and a designer. Come live and work in Hawaii in our office by Lanikai Beach. Send your resume (or portfolio) to careers@realgeeks.com
Uh? They are two separate benchmarks, that's why I said 'See also'.
The error messages are an additional rough spot.
Social & Media
I assume they are pulling from Crunchbase, but it's not like people have any incentive to keep Crunchbase updated (in a lot of cases, you don't want people to know you just raised $1.5mm a year or two after your initial seed money).
Protip: Don't tell adults what to do with their lives. Especially when it relates to love or death.

If you have some actual relevant experience that you would like someone to be aware of, go ahead and share it. Share your own thoughts and feelings about your personal experience as well.

And then STFU. Let them draw their own conclusions. People dying of cancer / watching their loved ones die of cancer really, really, really don't need your moralizing about their choices. They have a giant heap of shit to deal with, and they don't need you flinging a couple of turds on top.
"3) 3 px: Apogee of ISS (farthest a human has traveled for... a while: 424 km) (I'm probably forgetting something, can't find a good list of spaceflights by distance...)"

You're forgetting STS-125, the last Hubble Space Telescope Servicing Mission, March 2009, Apogee 578 Km.
obligatory cracked article on the terrible quality of video game school commercials: http://www.cracked.com/blog/the-6-stupidest-video-game-schoo...
> needing to counter homeopathy every single time

You're misunderstanding me: I'm not countering homeopathy, I'm countering your complete misunderstanding of the fancy French phrase you insist on throwing around.
I do, quite well. Proprietary features are miles away from cutting edge web-standards. Being locked into only one browser that works correctly is very, very much different from being able to chose from among many modern browsers (in the typical case).

More so, as I said that particular problem was not nearly as bad as people targeting the rendering of their site to the particular quirks of one particular browser. That was horrible, but it's not even remotely the same problem we face today.
Apple was awarded a Registered Trademark for WebKit on March 7th
That's my point. You should be able to run other browsers on WP8 and Windows RT, too.

What if iOS or WP8 had Android's market share? Do you really think that would be good for the web? We just happen to be lucky to have Android, an OS that does allow other browser engines on it, to dominate right now.
Precisely. Wittgenstein was (in approach at least) a reaction against Western philosophy, and his "vagueness" was a consequence of that.
Web discovery engine Trapit launches publisher tools
Is that how americans say it?

Sounds funny and like a direct translation from German:
Einem geschenkten Gaul schaut man nicht ins Maul.
It's rather disappointing that this doesn't default to using nmap's -PN option, since they can be reasonably sure that the host actually is up (after all, it just requested the web page). Not all routers respond to ping.
500-800req/sec over 10-20 servers with ~30ms response times. 1 req / server seemed plausible.

Thanks. I admit I'm not familiar with the platform.
sounds like they are confused about what routers are. unless they are using traceroute.
You should read a little more carefully. He is not suggesting anything like what you read into it.

Having seen a bad reaction to chemo up close, I can confirm that it is pretty awful, and that I'd certainly have to think before choosing between a bad chemo reaction and setting myself on fire.
Your hamstrings are too short and pull on your lower back. To fix short muscles stretching is great. If your muscles aren't already short then stretching isn't very useful.

(Post-workout stretching can help prevent your muscles from ever becoming short)
Angry Birds, fat pigs and the future of television
Do people realize the huge hidden cost of this "polyglot programming" thing? Imho, we have two huge "blackholes" these days that suck resources form everything that matters: the "social everything, center around advertising, give stuff for free" black hole at the business level, and the "uberpolyglot everything", from languages to OSs at the technical level.

> We have had to become polyglots to develop almost any current application.

...in my experience, by working in 2 languages instead of one, the time it takes to deliver something grows 3-4 times (!!), and there's still all the "lost" training time: instead of learning new paradigms, patterns and way to solve problems, people spend inordinate amounts of time learning the details of new languages. I used to love the polyglot way, but now I see language proliferation more as part of the problem than the solution. There was and advantage of all this, but now most paradigms of concurrency and everything are cross-language, and even if some languages like Clojure or Haskell injected new or better refined ideas into the mainstream, these ideas are nor longer tied to a particular language.

I think we should invest as much as we can in unifying languages and technologies, like:

- using one language by making a traditional client side language work server side: the Node way

- cross-compiling: the X to Javascript compilers (like Clojure-script and Python to Js or Ruby to Js techs)

- make languages use libraries from other languages: not to much exciting things happening here yet :( ...but I'd love having a way to, for example, mix C, Python and Ruby libraries inside a Clojure program, regardless of the performance or security issues

...they all seem like "boring plumbing work", I know. They are neither "exciting big problems to solve" nor "amazing business ideas" and you'll most likely neither change the world nor get rich by working on such things, but you can probably make a huge difference by working on such plumbing an let the really smart guys free to invent really new things!
From what we do know, it's actually very reasonable. We know e.g. that memory survives hypothermic loss of electrical activity. So it is probably structurally based.
North Korea’s Nuclear Reactor: Everything You Need to Know
That applies to food, hopefully medicine in a few decades, but not to rent. Until we adopt some sort of land/wealth tax, or make land/house management public and available to everyone, land is going to be scarse and sold at a premium.
I'll take that bet. Let's say, 2018-04-04 as the date, and use today's high of $147 USD as the crossover point.

If I lose, I owe you a BitCoin. If I win, you owe me one. Feel free to pre-purchase that coin. I'll stick a reminder in my calendar.
A little strange handling of the class attribute in source. I'm fairly sure it also requires an = after it.
Regardless, it still looks better with parenthesis and removing them serves no real benefit other than proving that I know it is an unary operator.

Feel free to grep through your /usr/include for sizeof and see which way is more common.