Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hoytech
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
91.
▲
by
hoytech
8y ago
Perl's rand() is not a great way to generate values that should be unpredictable. It is seeded with only 4 bytes from /dev/urandom and is an LFSR like rand(3). The consequence is that the range of possible passwords is probab
92.
▲
by
hoytech
9y ago
I've never heard of anybody refer to an authoritative server as a "resolver" before. Even the article considers them separate: > any third party who can observe communication between a client and a recursive resolver, a re
93.
▲
by
hoytech
9y ago
It means as distinct from a "stub" resolver. resolv.conf configures a stub (non-recursive) resolver.
94.
▲
by
hoytech
9y ago
The book "The Lost Art of Real Cooking" by Alabala and Natziger describes how to make what they claim to be medieval-style almond milk and almond butter (apparently quite different from what we buy in stores today).
95.
▲
by
hoytech
9y ago
Most of these design decisions are very useful and pragmatic, and not everyone regards them as "crappy". Additionally, there are several misleading statements in your post. I expect you are aware of the following but just for the
96.
▲
by
hoytech
9y ago
Oh I see, I thought you might be referring to how the page cache (obviously) can't cache things like sockets. Some applications do use the page cache for non-caching purposes though, for instance IPC, or ensuring their working-data wil
97.
▲
by
hoytech
9y ago
Yes, good point, I was speaking in general terms. This article shows they've put a lot of thought into it and argues convincingly that bypassing the page cache makes sense for their system.
98.
▲
by
hoytech
9y ago
Do you mean you want to cache things that can't be serialised to memory pages, or you don't want the memory pages to be backed by files? In the context of this article, many databases use the page cache to cache their data-structu
99.
▲
by
hoytech
9y ago
> The great advantage of letting the kernel control caching is that great effort has been invested by the kernel developers over many decades into tuning the algorithms used by the cache. Some other advantages: The kernel has a global vi
100.
▲
by
hoytech
9y ago
$ python -c '"test" == 10' $
101.
▲
by
hoytech
9y ago
Please see my sibling reply. I was referring to perl, not python or haskell.
102.
▲
by
hoytech
9y ago
Consider this javascript function: function add(a,b) { return a + b; } Although no conversion is requested explicitly in the function definition, a conversion may take place depending on the types of the arguments passed in:
103.
▲
by
hoytech
9y ago
> For example, in languages like Perl, JavaScript, and CoffeeScript adding a string to a number is permissible (e.g., "5" + 2 yields "52"). The same operation yields 7 in Php. Such an operation is not permitted in lan
104.
▲
by
hoytech
9y ago
Interesting. I had assumed tungsten was environmentally friendly since it is permitted for waterfowl hunting: http://www.cabelas.com/product/Non-Toxic-Shot-Buyers-Guide/5...
105.
▲
by
hoytech
9y ago
One thing that a match method can provide is a compile-time check that you haven't forgotten to handle any cases of your variant.
106.
▲
by
hoytech
9y ago
I looked into this recently, and this is the implementation I ended up choosing: https://github.com/mapbox/variant It has a very handy "match" method that addresses the issue raised in this blog post. They&#x
107.
▲
by
hoytech
9y ago
See gpderetta's comment elsewhere in this thread: the page-cache is different than socket mbufs in some pretty significant ways.
108.
▲
by
hoytech
9y ago
I agree completely. Pedantically, there is one other option: return an error like windows select does (WSAENOTSOCK). But then apps need special cases to deal with files and life is horrible.
109.
▲
by
hoytech
9y ago
As I'm sure you know, understanding this distribution is critical to good backgammon play. For example, all else being equal it's better to leave your exposed blots closer to a threatening opponent checker than further away (withi
110.
▲
by
hoytech
9y ago
In Umberto Eco's "Baudolino" there's another darkly humorous account of a murdered Byzantine emperor. In 1185, an adviser to emperor Andronicus convinces him to kill Isaac Angelus ostensibly because of disloyalty but in
111.
▲
by
hoytech
9y ago
The primary advantage is efficiency, although this effect is generally small. Often there are many symbols that aren't needed for a particular program run so resolving and relocating them is wasted effort. If you're interested you
112.
▲
by
hoytech
9y ago
You can also indicate the binding should be done immediately when you compile your binary. For example with the following arguments to cc: -Wl,-z,relro -Wl,-z,now Usually security-sensitive binaries are compiled with this so that the GOT ca
113.
▲
by
hoytech
9y ago
In addition to what others have said, perl also directly exposes errno via $!: $ perl -E 'unlink("/etc/passwd"); say (0+$!)' 13 $ grep 13 /usr/include/asm-generic/errno-base.h
114.
▲
by
hoytech
9y ago
One thing that annoys me a bit about the JS syntax though: As far as I know, JS regexp literals don't have custom delimiter support. For instance in perl you can do this: $str =~ m{/some/path/\w+} But in JS you
115.
▲
by
hoytech
9y ago
> Do you have a build-time option? Check at runtime at every call? Use templates to check at startup and run a different code path? With glibc there's also the IFUNC option: https://sourceware.org/glibc/wiki
116.
▲
by
hoytech
9y ago
... and I wrote a blog post testing this :) https://logperiodic.com/blog/2017/05/counting-distinct-eleme...
117.
▲
by
hoytech
9y ago
Judy arrays might be good for this. For the 64 bit int example you could use Judy1: http://judy.sourceforge.net/doc/index.html
118.
▲
by
hoytech
9y ago
Hi HN! When you run your programs on remote servers, especially ones you can't SSH into, there usually isn't much visibility into what's happening. Also, when your system is comprised of many separate servers, it can be hard
119.
▲
Show HN: Log Periodic – .bash_history, htop, and tail -f for the cloud
(logperiodic.com)
9 points
by
hoytech
9y ago
|
1 comments
120.
▲
by
hoytech
9y ago
Assuming no dups in file1, this outputs lines in file1 that aren't in file2: sort file1 file2 file2 | uniq -u (double file2 is not a typo :)
More ›