Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bodyfour
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
181.
▲
by
bodyfour
12y ago
Just a few days ago there was a lot of discussion here about std::string performance: https://news.ycombinator.com/item?id=8704318 I think refcounted strings are falling out of favor. In a multithreaded environment you n
182.
▲
by
bodyfour
12y ago
> with a seventy five thousand page tax code do we think they could? Yes, for nearly everyone. In fact, the IRS already does this -- your employer, bank, etc have already reported all of the biggest items to the IRS. They know what your
183.
▲
by
bodyfour
12y ago
Remember that std::string can be on the stack or a member of a larger structure. These comparisons seem to all be against versions of std::string that keep size/capacity inside the std::string, not ones (like the default GCC one) that
184.
▲
by
bodyfour
12y ago
Nothing really, but it mean your extensions aren't really first class syntactically. A developer has to remember that they write s.size() but not s.count_utf8_codepoints(). Bjarne Stroustrup actually has an interesting proposal to fix
185.
▲
by
bodyfour
12y ago
No different than any other symbol name in the global namespace though.
186.
▲
by
bodyfour
12y ago
Remember that on a little-endian machine (i.e. nearly everything now) the "last byte" of the pointer is actually the first byte of the string. The only way you can use the 8th byte of the string as your sentinel is if you can be
187.
▲
by
bodyfour
12y ago
Yes, but Postgres had lots of technical advantages of MySQL for years , and still was less popular. For most uses people would decide "MySQL is good enough feature-wise for me. It's so popular it's probably safest ecosyste
188.
▲
by
bodyfour
12y ago
The real language problem is that classes are closed -- you can't add your own methods to std::string (other than operators) As a C++ program grows it's more and more tempting to make your own private string class (either by inhe
189.
▲
by
bodyfour
12y ago
If you have a single-threaded runtime then reference counts are cheap and easy. Once you need to support multithreading you need to use CPU atomic instructions to maintain the reference count safely. As the number of CPU cores increases t
190.
▲
by
bodyfour
12y ago
As others have mentioned some libraries do use it. It has tradeoffs though. In a "traditional" implementation sizeof(std::string)==sizeof(char * ) -- it keeps a pointer to the first byte of the text with the metadata (minimally:
191.
▲
by
bodyfour
12y ago
Yeah a couple years ago I was trying to determine whether to support Content-MD5 in some HTTP software I was writing I could find nobody actually using it. There was an attempt a decade ago to make Firefox validate with it, but that died:
192.
▲
by
bodyfour
12y ago
Yes, very much so. If you've embedded lua before it's very easy to do the same with duktape. A few conventions are different -- for instance stack indicies are 0-based instead of 1-based (mirroring the difference in JS vs Lua) a
193.
▲
by
bodyfour
12y ago
Correct. A file will only be considered a binary executable if it has a proper header (ELF, Mach-O, etc) The default if no header and no shebang is to treat it like a shell script. In fact, an empty executable file has been used to implem
194.
▲
by
bodyfour
12y ago
Suppose you have standard rail tracks and use a surplus freight train. Congratulations, you can now store the amount of energy needed to push a single train up a single mountain. That's not nothing, but it probably isn't enough
195.
▲
by
bodyfour
12y ago
Think about how little cooling is needed on a big electric motor. Even motors made 100 years ago are very efficient. By contrast anything that qualifies as a "heat engine" (including internal combustion) is limited by Carnot'
196.
▲
by
bodyfour
12y ago
Two examples from my life: For machines that I manage that are hosted by 3rd party VM providers I always use a separate root password. If the provider is compromised an attacker could modify the disk image I'm running from (say, with
197.
▲
by
bodyfour
12y ago
1. Has it been tested with the brand new (yosemite-only) 1Password 5.0? 2. I hope that you'll expand the installation options. Not everybody uses homebrew.
198.
▲
by
bodyfour
12y ago
> 80 MBit/sec SCSI is 8 bits wide No, I converted both of the speeds to MBit to make them easier to compare. The SCSI on a SS10 was 10MB/sec, so 80Mb/sec. The bus utilization on SCSI was high, and the USB2 on a Rpi is slo
199.
▲
by
bodyfour
12y ago
Sure, let's compare. I don't have every number at hand, but: I/O: * SS10 -- Fast SCSI: 80 Mbit/sec theoretical max * Rpi -- USB2 480 Mbit/sec. Now there are certainly complaints about poor USB performance, but
200.
▲
by
bodyfour
12y ago
> I have to imagine that $150 blows the SS10 away massively No doubt. Remember that the base model of a SS10 had a 0.033 GHz CPU. A raspberry pi would run circles around it. That's not even counting a modern GPU. A SPARCstation w
201.
▲
by
bodyfour
12y ago
Yes, I agree that there are simpler changes that would fix the problem, and personally I'd root for them. Stroustrup's proposal is still interesting in that it would solve it and unify operator/method dispatch at the same ti
202.
▲
by
bodyfour
12y ago
I don't know what it's chances of ratification are -- it does seem like an aggressive change -- but I disagree that it doesn't add anything. This would actually fix one of the biggest problems I have with large C++ developme
203.
▲
by
bodyfour
12y ago
It's actually 100ns granularity, not 1µs
204.
▲
by
bodyfour
12y ago
I have a love/hate relationship with cmake. Writing non-trivial functionality in cmake's language is possible but you're fighting the language the entire way. It would have been so much better if they'd just started wit
205.
▲
by
bodyfour
12y ago
cmake is a replacement for the autotools suite, not make itself. You're right that it can be tricky to use. One advantage cmake has is that you can tell it to emit files for ninja instead of traditional Makefiles. ninja is very well
206.
▲
by
bodyfour
12y ago
A lot of conventions in CP/M are similar to DEC operating systems of that period (RT-11, RSTS/E, etc) For instance in RT-11 files had the same "device:filename.ext" format. However the device spec was 2-3 characters,
207.
▲
by
bodyfour
12y ago
The cost of an unpredicted branch inside the loop would probably outweigh the benefit.
208.
▲
by
bodyfour
12y ago
Even if you have a setuid script it appears that bash won't import functions in that case. However the fact that the script isn't setuid isn't really the concern for these shellshock, since a setuid program could indirectly r
209.
▲
by
bodyfour
12y ago
Yes, if you have full control over the environment you can make all sorts of havoc ($PATH, $LD_PRELOAD, ...) What made shellshock special is that you only needed to control the value of a variable, not its name. I don't see how this
210.
▲
by
bodyfour
12y ago
...although some programs blacklist unsafe environment variable names. They all should be updated to also blacklist bash function values.
More ›