News for hackers. Stuff that matters.

NigelTufnel

To find the best Python function ever written!
Re:Cursors on Sunday October 19, 2014 @03:36PM (#8479299)
This is so much fun. It's kind of like RPG. There are 3 character classes. 1. Asshole: just goes straight after the green square. 2. Prankster: draws arrows pointing to the wrong exits. 3. Batman: stays on the button and clicks.

I've tried all three characters. Playing prankster is fun (I was a true trickster and sometimes drew the right arrow). Playing asshole is boring. Playing Batman is ok.

My apologies to all the guys/gals who followed the wrong arrow.

Many, many thanks to the author.

Also, I haven't seen so many poorly drawn dicks and swastikas since grade school.

Re:You Got Your Web Browser in my Compiler on Tuesday April 01, 2014 @04:25AM (#7506801)
Were it GCC instead of VC++ that wouldn't change much for a lot of people. Fixing bugs in a program with 7 million lines of code is not easy.

Fixing bugs in GCC for an unitiated person is probably super hard.

Wikipedia doesn't underline links either. They're doing fine.
Re:New message from Mt. Gox on Wednesday February 26, 2014 @05:33AM (#7304055)
This is insane. No <!doctype> declaration? Come on!
Re:Show HN: A simple IP address API on Saturday February 15, 2014 @05:02AM (#7243293)
I'm getting latitude = 60.0000, longitude = 100.0000 for my IP. Which is about 1000 km away from me.
Re:Why Stack Overflow in Portuguese? on Friday February 14, 2014 @11:24AM (#7239320)
Personal experience: weird jargon is a good thing. I've read a book on Hadoop once and it didn't use weird jargon - everything was in my native language. It was super hard to read - basically I needed to translate the book from my native language into English in my mind.
Re:Why Python Runs Slow, Part 1: Data Structures on Thursday February 13, 2014 @09:24AM (#7231502)
I just did. And either a) I'm doing something terribly wrong or b) ctypes.Structure is slower than Python class with __slots__.

I would bet on a) - I've never worked with ctypes before.

EDIT: I bet on a) and I was wrong: ctypes offers no speed advantage.

Re:Why Python Runs Slow, Part 1: Data Structures on Thursday February 13, 2014 @07:42AM (#7230961)
I did a stupid microbenchmark and it turned out that simple class with __slots__ was the fastest method.
Re:Mozilla will put ads directly into Firefox on Wednesday February 12, 2014 @06:21AM (#7223726)
What was wrong with the honest: "We'll show ads to the first-time Firefox users, so we can make extra money with our free product. We'll show ads only once"?

"User-first" bit is the textbook example of PRspeak.

Not just drop downs, but you can click on, e.g, restart and the page will restart. Took me a couple of minutes to get it.
Re:Flappy Bird Typing Tutor on Monday February 10, 2014 @07:29AM (#7210596)
Now that's hard.

The next logical step is to type in point-free Haskell programs.

A slightly paradoxical advice: learn Objective-C. Learning of one thing never stops.

Suppose you're now top 5% iOS developer. 5 years later you'll probably be top 1%. That's cool.

I can see only one hugely improbable risk in doing this. If Apple goes down then Objective-C developers will be as valuable as toilet paper.

He seems to be a normal guy, not a PR genius. But, yeah, "The game with 50,000,000 downloads will be taken off the app stores in the next 22 hours" is brilliant.
It's noteworthy because this one became popular. That's how the world works.
Re:Make the Type System Do the Work on Thursday February 06, 2014 @05:27AM (#7189638)
Maybe it's just something I don't understand but I would go with Celsius everywhere with converting to Fahrenheit/Kelvin when showing/grabbing temperature to/from user.
Re:Satya Nadella – Microsoft's CEO on Wednesday February 05, 2014 @07:07AM (#7183260)
I agree. It's not just the algorithm, scale etc. It's the chicken/egg problem - to have a good page ranking you need a lot of usage data from a lot of users and to get a lot of users you need a good page ranking.
Re:Does the next decade belong to Go? on Tuesday February 04, 2014 @08:42AM (#7177274)
It's always a safe bet that any new language will fail spectacularly. Also everybody is not Google and have massive speed/concurrency needs.
Re:Web server for Linux written in amd64 assembly on Monday February 03, 2014 @06:58AM (#7170156)
I wonder how fast is this server. Is handwritten assembly faster than GCC/clang-written assembly?
Re:Big changes to Erlang on Sunday February 02, 2014 @03:37AM (#7165354)
I don't understand. By built-in map you mean "map literals"?
Re:How in-app purchases have destroyed the game industry on Saturday February 01, 2014 @12:43PM (#7162416)
I think that "destroyed" is not the right word.

Yes, free to play games with in app purchases dominate the mobile market. For now. The mobile gaming is just 6 years old. We're in the 'Space Invaders' era. The quality of the top-grossing games is, how I shall put it, not great.

I think eventually the quality will grow to a level where paying up front for a mobile game will not be the stupidest thing on the face of the Earth.

Re:Python Idioms [pdf] on Friday January 31, 2014 @11:21AM (#7157396)
I think that concatenation with + is okay when you're concatenating two strings. And CPython can optimize x = x + y or x += y calls.

http://docs.python.org/2/library/stdtypes.html

Year 2014: Java gets lambdas.

Java 8 is pretty nice actually. Lambdas, date/time API that doesn't suck, filter/map/reduce in the collections. I'm looking forward to work with it.

Re:In Defense of Scala. Response to “I Don’t Like Scala” on Wednesday January 29, 2014 @10:47AM (#7144505)
Template-heavy C++ and point-free Haskell code.
Re:In Defense of Scala. Response to “I Don’t Like Scala” on Wednesday January 29, 2014 @09:31AM (#7143975)
"Brilliantly simple" is an odd description of Scala. I would easily put Scala in the top 3 most-difficult-languages-for-me to work with. Maybe even top 2.
Re:The descent to C on Tuesday January 28, 2014 @02:57PM (#7139302)
There is a great moment in Stroustrup's talk when he shows a short error message in ConceptGcc and the audience applauds.

It seems that Stroustroup was suprised by the applauses.

Older »