Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
daivd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
daivd
13y ago
Hofstadterian
32.
▲
by
daivd
13y ago
Diagonal proofs like the Halting Problem say that in general you can not prove properties about all programs in a Turing complete language. Thus, there is a class of troublesome programs. Likewise there is obviously a great number of progra
33.
▲
A Better Soylent - Designing a Simple, "Optimal" Nutrition Shake
(fendrich.se)
1 points
by
daivd
13y ago
|
0 comments
34.
▲
A better algorithm for rotating logs
(fendrich.se)
2 points
by
daivd
14y ago
|
0 comments
35.
▲
by
daivd
14y ago
I recently wrote a guide on this, too: http://fendrich.se/blog/2013/01/24/pre-programming-mental-si...
36.
▲
Pre-programming Mental Silence Meditation With Entrainment
(fendrich.se)
2 points
by
daivd
14y ago
|
0 comments
37.
▲
by
daivd
14y ago
From my own experience measuring heart rate while meditating, my heart rate is at lowest at normal sitting rest rate and often even a few beats higher. This surprised me.
38.
▲
by
daivd
14y ago
The "sorry vegans" remark seems silly. Let me remind any meat-eater (including myself) that some of the greatest minds in history, including Albert Einstein, Leonardo da Vinci and possibly Isaac Newton were vegetarians. http://en.wikipedia
39.
▲
Compile Time Loops in C++11 With Trampolines and Exponential Recursion
(fendrich.se)
3 points
by
daivd
14y ago
|
0 comments
40.
▲
by
daivd
14y ago
His diet suggestions seem to be the opposite of crazy. He was very early with "more fat, less carbs, no sugar" which seems to be more or less common wisdom now. That coupled with generally few calories (CR must be the most well studied diet
41.
▲
by
daivd
14y ago
In this case it obviously doesn't matter, but in the general case it is better to be explicit on which type of cast you are doing. That way the compiler can statically stop you from doing stupid things. Read the link I gave.
42.
▲
by
daivd
14y ago
"Hell, stop programming in C++ and start using Rust!" I plan to try to do that, when Rust has become more stable.
43.
▲
by
daivd
14y ago
Internet popular means libraries on github and good tutorials, means useful.
44.
▲
by
daivd
14y ago
Yes, of course a POD is better, but that would be cheating, since this is supposed to show that you can do the Python stuff, including tuples and tuple deconstruction, just like in the linked Python original. Perhaps I should have mentioned
45.
▲
by
daivd
14y ago
That does not look like C++11. You don't use initializer lists. You don't use new-style for-loops. I'll give you that those don't add much to safety, though. A functional style with Boost ranges, adapters and algorithms do, however. I clear
46.
▲
by
daivd
14y ago
Even in Hindley-Miller type systems it is considered good practice to add types as documentation to top-level constructs (see Haskell). In Python it is also considered good practice to add argument and return type info in the doc string. In
47.
▲
by
daivd
14y ago
Is there really such a bandwagon?
48.
▲
by
daivd
14y ago
Yes, to_string would have been better The C-style cast is shorter, but less safe, so you should not use it: http://stackoverflow.com/questions/1609163/what-is-the-diffe... Yeah, I couldn't quite decide if I should include const refs. On t
49.
▲
by
daivd
14y ago
But that is sort of the point. You should not write C++ like C. If a C-programmer thinks your code is nice and readable, you are not using C++. The C-stuff was just added to lure C-programmers over.
50.
▲
by
daivd
14y ago
I agree, it is much uglier. Part of it is that Python thinks a character is unsigned, whereas C++ thinks it is signed. This arbitrarily works in Python's favor here. Part of it is that Python just handles this better.
51.
▲
by
daivd
14y ago
Go is certainly a fine language. One common instance where I would prefer C++, though, is when you are writing libraries for others to use. A language that runs on a VM can not easily be used as a library inside a language that uses another
52.
▲
by
daivd
14y ago
It is only unreadable bullshit the first time you read it. If you use ranges, filtered and transformed for these kinds of tasks, it looks idiomatic.
53.
▲
by
daivd
14y ago
I wrote this post. The program is I/O-bound, so the only speed improvement comes from not having to start up the Python interpreter. If the task was CPU bound, you would get a great performance boost (sometimes 100x over CPython), but that
54.
▲
by
daivd
14y ago
You misunderstand the purpose of ord. The mp3 metadata uses one byte to encode an integer between 0 and 255, which represents genre. It is not a string.
55.
▲
C++11 and Boost - Succinct like Python
(fendrich.se)
201 points
by
daivd
14y ago
|
164 comments
56.
▲
by
daivd
14y ago
The underlying motivation is to write it specifically for a few people, whose current way of working I know, and who have asked me for some information on zsh. If it were not for them, I would not have written it, since I don't add anything
57.
▲
by
daivd
14y ago
Yeah, I thought as much. I just mentioned it to help a new user, because the standard in Bash seems to be PgUp and beginning-of-line search, while in Zsh it is Up and full search.
58.
▲
by
daivd
14y ago
Great!
59.
▲
Use Zsh
(fendrich.se)
164 points
by
daivd
14y ago
|
114 comments
60.
▲
Following arrest of Pirate Bay founder, Sweden gives Cambodia $60M in extra aid
(news.xinhuanet.com)
3 points
by
daivd
14y ago
|
0 comments
More ›