Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
1amzave
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
91.
▲
by
1amzave
15y ago
I'm kind of surprised GCC doesn't have a __builtin_* extension for overflow detection. It seems like a pretty natural fit among a lot of the other ones. ...and after a quick bit of googling, it appears this has been discussed by the GCC de
92.
▲
by
1amzave
15y ago
Well, if you really want to go apples-to-oranges and specialize as much as possible for the sequentially increasing case we're dealing with here, you could just do your arithmetic directly on the ASCII string itself, complete with a littl
93.
▲
by
1amzave
15y ago
You probably can: $ gdb /Applications/Safari.app/Contents/MacOS/Safari $PID iTunes, annoyingly, uses Apple's stupid little "please don't ptrace me" flag, which is a minor inconvenience, but fairly readily circumventable.
94.
▲
by
1amzave
15y ago
OK, I just tested with gcc 4.6.0, and unless I've screwed something up, it looks like (at -O4) it actually optimizes these into the exact same code. As in the generated ELFs are byte-for-byte identical. Impressive.
95.
▲
by
1amzave
15y ago
That runs in ~0.4s on my system (Xeon E5520, 2.27GHz), but replacing the 'digits' lookup table with simple arithmetic on the ASCII values ('0' + j%10) speeds it up to ~0.23s. Yes, L1 caches are pretty fast, but ALUs are still faster (for i
96.
▲
by
1amzave
15y ago
In practical terms, does this differ significantly from killing the process and leaving a coredump?
97.
▲
by
1amzave
15y ago
Well, the problem here is (assuming I'm understanding everything correctly) pretty specifically the combination of the comma operator and a bitfield. Of those two, I'd say the latter, even if superficially more intuitive, is probably the
98.
▲
by
1amzave
15y ago
You must be a C++ user -- I (a C guy) immediately thought "what? No, that's in -Wextra, not -Wall", checked the man page to confirm, and sure enough, it differs (-Wall includes sign-compare when compiling C++, but not C).
99.
▲
by
1amzave
15y ago
s/SIMD/SSE/, methinks. SIMD is a more general concept; SSE is a set of SIMD-style instructions (the second 'S' actually stands for SIMD).
100.
▲
by
1amzave
15y ago
I found it to be quite buggy, however, so I built 4.00.03 from source and use that instead. (Lack of vertical split doesn't bother me very much.)
101.
▲
by
1amzave
15y ago
> Well, the entire debate is about generating architecture-independent code, so that's a good example. It should be possible to generate optimized code for AMD and Intel using the same compiler. In practice, it doesn't really happen.
102.
▲
by
1amzave
15y ago
I'm curious what you mean by your comments about the state of compilers. In what ways do current compilers suck? I assume you're not speaking in terms of utilizing virtualization instructions, since I'm having a hard time imagining a situa
103.
▲
by
1amzave
15y ago
> Calling it from the empty string concatenates the pieces with no separator, which is a Python quirk and rather surprising at first. This is stated twice, but I can't make any sense of it. How is this even remotely surprising? What
104.
▲
by
1amzave
15y ago
Well, as you say OSX has the keychain (which is encrypted, and has command-line access tools). I think most Linux systems have something similar ('keyctl' on my system). I know nothing of Windows, but I would hope something analagous exis
105.
▲
by
1amzave
15y ago
A word of warning on Prey -- I looked into it myself and last I checked, it stores your email password unencrypted in a plain text file in your filesystem. Better still, a comment in the file describes it as "base64 encrypted". Sure, your
106.
▲
by
1amzave
15y ago
I've heard "nasal demons" in some C circles (as in, "the compiler may cause demons to fly out your nose").
107.
▲
by
1amzave
16y ago
> ...reference counting was pointed out to me and I realized it would be pointless -- the act of merely looking at an object changes the object, so copy-on-write means copy-everything. Hmm...might it be worthwhile to work around this
108.
▲
by
1amzave
16y ago
Care to elaborate? Unlike signed ones, unsigned integral types at least have well-defined behavior on shifting and overflow. (I'm speaking in terms C specifically here, of course.)
109.
▲
by
1amzave
16y ago
Circuit-level (layout) problems I'd guess make up a decent portion. I heard (from a guy who worked on it) about a bug in a prototype version of a processor from a major company that didn't cause any correctness problems but was a major per
110.
▲
by
1amzave
16y ago
Modern compilers may actually do this as well, though for slightly different reasons -- GCC (at the right optimization level) likes to put branch targets and functions at aligned addresses, so you often end up with little pads of NOP instru
111.
▲
by
1amzave
16y ago
I have a similar section in my .bashrc via a somewhat hackish loop (or two): ESC=$'\x1b' # Terminal color escapes colornames=(BLACK RED GREEN YELLOW BLUE MAGENTA CYAN) for i in ${!colornames[@]}; do eval "${colornames[$i]}=\"$
112.
▲
by
1amzave
16y ago
From man bash, the variable PROMPT_COMMAND: If set, the value is executed as a command prior to issuing each primary prompt. e.g.: PROMPT_COMMAND='[[ "$PWD" =~ ^/sensitive/area ]] && PS1="be careful: " || PS1="normalpromp
113.
▲
by
1amzave
16y ago
The tilde-escape offers significantly more than just termination, actually. Hit '~?' for the available escape sequences: Supported escape sequences: ~. - terminate connection (and any multiplexed sessions) ~B - send a BREAK t
114.
▲
by
1amzave
16y ago
Related/competing: Xilinx's "Extensible Processing Platform", a SoC with dual Cortex-A9 cores + various hard-IP peripherals + FPGA fabric ( http://www.xilinx.com/technology/roadmap/processing-platform... ). I'm interested to see where these
115.
▲
by
1amzave
16y ago
If high school memories serve, Latin has regular number-names for 11 through 17, but then semi-irregular ones for 18 ( duodeviginti , or "two from twenty") and 19 ( undeviginti , "one from twenty"). (I say semi-irregular because they're inc
116.
▲
by
1amzave
16y ago
A few days ago I was wondering if the link between two remote hosts was 100Mbps or 1Gbps, and didn't have root access to run ethtool (sidenote: is there an easier way for an unprivileged user to determine this?), so out came netcat and dd:
117.
▲
by
1amzave
16y ago
Nice article, though I'm not sure I quite agree with this (or perhaps the way it's phrased): > While it obviously can't stand up to the sort of abuse you could give a hard drive... I'd have said one of the main advantages of flash sto
118.
▲
by
1amzave
16y ago
True, though until semi-recently SiCortex offered MIPS-based HPC/supercomputer systems -- sicortex.com has been offline for a while, but see: http://en.wikipedia.org/wiki/SiCortex
119.
▲
by
1amzave
16y ago
I don't recall hearing any announced, though I wouldn't be surprised at all if it were currently in the works. The A15 mentioned in the article, however, I believe has something in the spirit of x86's PAE that offers an expanded (36 bits o
120.
▲
by
1amzave
16y ago
So what languages did everyone use? I decided to try a different one on each level, so I used Python, bash (letting GNU coreutils 'factor' do the hard work), and Haskell, respectively.
More ›