News for hackers. Stuff that matters.

gwilliams

'Stone'? You mean 'brick'.
Lego's argument always struck me as absurd. Imagine Ford doing the same thing: "Please refer to our vehicles as 'Ford vehicles' or 'cars', and not 'Fords'. By doing so..."
Re:The vast but little-known fund of the Mormon Church on Saturday February 08, 2020 @11:43AM (#22276642)
That could hardly be farther from the truth.

The church does have extrabiblical volumes of scripture, which also testify of Christ and go into more depth, but every doctrine of the church is in harmony with the Old and New Testaments. Members believe it is only by faith in Christ and by good works that they can be saved.

Re:The vast but little-known fund of the Mormon Church on Saturday February 08, 2020 @11:39AM (#22276607)
They don't get wealthy from it.

Those who work for the church full time (with the exception of missionaries) receive a stipend to cover their living expenses and not much else.

boolean checkExactlyOneBitSet(int num) {

return (num & (num - 1)) == 0;

}

That looks like it'll fail when num == 0. I think it should be:

  return num && ((num & (num - 1)) == 0);
Re:Don't rinse with water straight after toothbrushing on Friday January 24, 2020 @10:38PM (#22144481)
This advice ought to be printed on every tube of toothpaste.
Re:Screen Art: Wargames (2010) on Monday September 23, 2019 @07:49PM (#21055011)
From IMDB:

"The computer name WOPR used in the movie was a joke based on a real computer once used to predict war strategies at NORAD which was called "BRGR". The Burger King "Whopper" is a "Burger"."

Re:Data Structure and Algorithms Problems from Interviews on Wednesday February 20, 2019 @03:50PM (#19211841)
The posted solution to fibonacci (in the rss image for this hn article) appears wrong. fib(0) will return 0 instead of 1.
Re:Raspberry Pi Model 3A+ on Thursday November 15, 2018 @04:05PM (#18463308)
Yes.
Re:The Periodic Table of Data Structures [pdf] on Saturday October 27, 2018 @10:24PM (#18318809)
This reminds me of the effort to enumerate all ways of tying a necktie: http://www.tcm.phy.cam.ac.uk/~tmf20/tieknots.shtml
Re:Ask HN: What's your favorite elegant/beautiful algorithm? on Wednesday October 17, 2018 @11:27PM (#18245686)
icgrep (http://www.icgrep.com) has a clever approach to searching text for arbitrary sets of characters in a parallel manner. If 128-bit registers are available and we're processing 8-bit characters (for example), the next 128 characters from a file are first loaded into 8 SIMD registers. Then a bitwise transposition is performed so that r0 contains bit 0 of each input character, r1 contains bit 1, etc., up to r7. Then with a series of logic operations across those registers (imagine the sum-of-product result of a k-map of characters of interest), searches for any arbitrary subset of characters can be performed in parallel, leaving 1s in the corresponding position of the result register for each match and 0s elsewhere. icgrep supports full regex patterns and Unicode (using 21 registers instead of 8), but what interests me are the elegant transpose and logic steps.
Re:Shoppers Love Rewards Credit Cards, Retailers Hate Them on Friday September 28, 2018 @04:48AM (#18091883)
When I operated a store in Canada, Amex would hold on to the money for an extra 30 days beyond the next monthly reimbursement cycle, unlike Visa/MC.
I consider how predictable the dividend is.
Re:How To Make Any 3rd Grader Love Math on Friday October 15, 2010 @03:16AM (#1793888)
This would be a bit more fun with word problems involving the time turner, potions, etc.

"Fluffy has three heads, and each head can eat two bowls in a sitting...how many bowls should Hermione fill to satisfy him?"

Re:Ask HN: Would a game to teach Bash & *nix be worth-while? on Wednesday October 06, 2010 @09:57PM (#1766572)
How about a game to teach regex? That would be awesome. "Write a regex that will match xxx and yyy but not zzz", for example.
Re:Little, black, different on Monday October 04, 2010 @07:20PM (#1757959)
When I read the headline, I assumed the article would be about a late actor. :/
Re:First improvement of fundamental algorithm in 10 years on Tuesday September 28, 2010 @11:17PM (#1738222)
Couldn't this problem be simplified by considering the nodes and paths to be a resistor network, and solving for the effective resistance between the source and drain nodes?