HNHacker News
TopNewBestAskShowJobs

to3m

4,399 karma · joined March 25, 2011

(account dormant as of 21/3/18)
submissionscomments
to3m··on Science saved me from pretending to love wine
I had a bottle of red wine a few months ago that smelt very distinctively like 1980s Star Wars toys! (Perhaps there were other toys of the era that smelled the same, but after some initial difficulty in placing this slightly unwelcome, somewhat solvent-like smell, it was Star Wars figures that came to my mind.)

And the smell appeared to be in addition to all the other smells and tastes you might expect from red wine: so it tasted like a red wine, and smelled like a red wine, and it was actually quite nice... and it smelled of Star Wars figures as well, on top. That bit wasn't so nice, but it was so unusual that I could somehow separate it in my mind. Like I was drinking wine with a Star Ways toy under my nose, or something like that. It was a very strange experience.

Anyway, perhaps this is the same chemical, or one related.

After a couple of glasses the smell mostly dissipated.

to3m··on The tale of aux.c
That was true for DFS, but not ADFS.
to3m··on MacOS High Sierra
They cover the active window if the active window covers the top right of the screen...
to3m··on How I Fixed a 10-Year-Old Guitar Hero Bug Without the Source Code [video]
Attract mode is where a game cycles between front end, intro video, rolling gameplay demo, and so on: https://en.wikipedia.org/wiki/Glossary_of_video_game_terms#A

(I expect what they had in mind was using it in shops, either running in the shop window, or as part of a counter display, and so on, and that drove the requirement that it had to run for a week.)

to3m··on Why undefined behavior may call a never-called function
Right, yes, sure, whatever. Since you've evidently got the experience that I apparently lack, you'll know that this point is irrelevant, since the topic at hand is Standard C, and not whatever some random implementation happens to do... so I'm not sure what your point is. But of course perhaps it would be obvious to a more experienced practitioner.

C standard reference: https://port70.net/~nsz/c/c11/n1570.html#5.1.2.2.1

(A freestanding environment may start anywhere - but such environments are unusual.)

to3m··on How I Fixed a 10-Year-Old Guitar Hero Bug Without the Source Code [video]
I worked on an Xbox title many years ago, when I was still a bit inexperienced, and one of the requirements was that it had to run the attract mode for a week without fucking up. The other guy working on it was even worse than me, so no prizes for guessing who ended up sorting that out. And what a huge pain it was!

There was nothing awfully wrong with the code, sure, much of which had been through numerous PC games, and a lot of which was shared with the PS2 version... but finding all the stuff that wasn't awfully wrong, just a bit wrong, and wrong enough to cause problems after running it for 3+ days solid, was surprisingly painful. But I figured it out. Even if I'm not the sharpest tool in the box, I'm persistent, and I've been served well over the years by my ability to bring this to bear on whatever problem I'm facing. So I did that, and it all got fixed, and it shipped like that.

Once it got signed off, I started working on another Xbox title that was nearing completion. But by the time that one reached the certification stage, about 3 months later, the requirement had mysteriously changed to just 2 days! I wonder why...

to3m··on Why undefined behavior may call a never-called function
The function called at program startup is named main, which this translation unit defines. No other may therefore define it. Binaries that don't run main are out of the scope of the standard, and so irrelevant to the discussion.

Anyway, as a more general point: your argument is, basically, "the customer is wrong". But the customer is never wrong! Therefore your argument is invalid.

to3m··on Why undefined behavior may call a never-called function
Other UB links:

"These people simply don't understand what C programmers want": https://groups.google.com/forum/#!msg/boring-crypto/48qa1kWi...

"please don't do this, you're not producing value": http://blog.metaobject.com/2014/04/cc-osmartass.html (also in the above list, but why not have it twice?)

"No sane compiler writer would ever assume it allowed the compiler to 'do anything' with your code": http://article.gmane.org/gmane.os.plan9.general/76989

"Everyone is fired": http://web.archive.org/web/20160309163927/http://robertoconc...

to3m··on Modern Humans and Neanderthals May Be More Similar Than We Imagined
Mate, you share 50% of your genes with a fucking banana. I double dare you to tell me with a straight face that you never believed the official story that bananas aren't even sentient.
to3m··on It’s time to kill the web app
Droll. But wasn't context unawareness part of the problem too?
to3m··on A High-End Mover Dishes on Truckstop Hierarchy, Rich People, and Moby Dick
But typically you specifically "dish the dirt". "Dish" on its own is not a valid verb, at least not in the version of English I speak. I don't know why.

(Interestingly, OS X's Dictionary app says that a Britishism is to use "dish" as a verb meaning "destroy or defeat". Don't recall ever hearing this, though...)

to3m··on Bootstrapping Urbit from Ethereum
You can get started, sort of, from the white paper: https://urbit.org/posts/

(TL;DR: "Urbit also invents a lot of alien technical jargon. We admit that this is annoying. Abstractly, it’s part of the clean-slate program: words smuggle in a lot of assumptions." - to which all I can say myself is: qupnux.)

to3m··on Input: Fonts for Code
No, it doesn't do anything like that - it just does word wrap. Comment Reflower: https://marketplace.visualstudio.com/items?itemName=codebeas... (page says it works up to VS2015, but I've got it in VS2017 too - so presumably it's forwards-compatible?)

One of its features is that you can pop comments sections in a <pre>...</pre> block to stop Comment Reflower doing anything to them. Here's an example, where you can see that the preformatted section extends past the wrap column.

    // Watford DDFS reads by initiating a multi-sector read,
    // counting sectors read, then doing this when it's got
    // the data it wants:
    //
    // <pre>
    // 0D43: ldy #$60                A=00 X=FF Y=60 S=DC P=nvdIzC (D=60)
    // 0D45: dey                     A=00 X=FF Y=5F S=DC P=nvdIzC (D=D0)
    // 0D46: bne $0D45               A=00 X=FF Y=5F S=DC P=nvdIzC (D=01)
    // 0D48: lda #$D0                A=D0 X=FF Y=00 S=DC P=NvdIzC (D=D0)
    // 0D4A: sta $FE84               A=D0 X=FF Y=00 S=DC P=NvdIzC (D=D0)
    // </pre>
    //
    // The loop at D43 is $5f*(2+3)+(2+2)=$1df=479 cycles, or
    // 240 usec.
So if you had a text editor that implemented my idea, the first and last paragraph would be in proportional type, and the disassembly bit in the middle would be shown in monospaced to preserve the formatting.

(In the long run, ideally, I suppose, you'd want your code text editor to support a wide range of formatting options, so that you could have italics and bold and monospaced and all sorts. But if you just decided that initially a simple proportional/monospaced font switch would be useful, this is the sort of markup you could use to key the transition off.)

to3m··on Input: Fonts for Code
I gave up on proportional fonts after a while. That was about 15 years ago, though... I think using clang-format and Comment Reflower/Emacs M-q/etc. would solve most of the problems I had with creating code that looked sensible when other people looked at it. If you've got the whole team layout out their code using tools like that, then the proportional font people won't find themselves having to line things up and whatnot.

Still doesn't solve the issue of having ASCII art diagrams in your comments. Though... the comment word wrap plugin I use for Visual Studio has markup to say that it should leave a section of the comment alone (I use this for ASCII art bits). And clang-format has similar directives for blocks of code that it should leave alone. Would be nice if text editors could recognise these (and other similar markup - or perhaps markup could even be standardized between tools?) and render the appropriate sections in a monospaced font. That might be a useful compromise.

to3m··on Counterproductive effects of the commuter parking tax benefit
The UK does the same thing, too: https://www.gov.uk/expenses-and-benefits-parking-spaces/what...

I could never quite figure this out. It seems to be actually more hassle, in terms of paperwork and reporting, to pay for your employee to park a work vehicle during work hours while on a job made at your request (which is entirely a business expense) than it is to pay for them to have a reserved city centre parking space (which could easily have a significant personal benefit component).

The other weird thing is: I don't even think the employee has to use it! Would their SO find such an arrangement useful? Well, there you go: they could use it instead! There really don't appear to be any restrictions on this stuff. It's extraordinary.

On the flip side: this does mean, if you're negotiating a new job, maybe you could think about trying to get them to pay for a parking space for you, if that would be useful. Because it's entirely a business expense and so cheaper than raising the salary.

to3m··on Demon-Haunted World
But according to this theory, it sounds as if one should ask for the receipt afterwards?
to3m··on Go Assembly by Example
For another view: http://dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/

I'm partly with the dtrace guy, but it is nice to see somebody not propagating that gcc inline asm shite... so I'm prepared to forgive it a certain amount.

to3m··on HSBC is killing my business, piece by piece 
Photon Storm Ltd is a corporation.
to3m··on The Netherlands has become an agricultural giant
These are reliably at least fairly good in the UK, too, along with cherry tomatoes (about the same size, but round). Plum tomatoes are a bit firmer and cherry tomatoes are a bit sweeter.
to3m··on Update of 02-09-2017
Nobody can answer this question other than you... well, you, AND #YOLO
to3m··on Hell is a multi-threaded C++ program (2006)
If it's the same, it's the same, so there's no reason to do one rather than the other. Why not just create a thread?
to3m··on Hell is a multi-threaded C++ program (2006)
pthread_sigmask always operates on the current thread.
to3m··on Hell is a multi-threaded C++ program (2006)
Interesting point about the stack size!

As for the signal mask, I'm pretty sure you can just set that using pthreads, and it will apply to the current thread. This is certainly true for the pthreads thread name, which is as deeply as I've investigated myself... the C++ threads library isn't magic. It's just a wrapper round what you'd expect.

to3m··on Hell is a multi-threaded C++ program (2006)
This is good advice and should never have attracted a downvote!

I'm not actually sure that the C++ library does anything that pthreads doesn't - maybe std::lock, perhaps? - but it's more convenient to use (and it's not like pthreads is bad to start with...), and the pieces work well and fit together quite nicely. Some good use of move semantics. unique_lock is neat and you can do stuff like vector<thread>.

The C++ thread library works on Windows, too...

to3m··on C compiler undefined behavior: calls never-called function
I'm sorry, "legal" is not a term defined by the standard.
to3m··on “this code very fast” pull request to remove whitespace from linux kernel
I do indent my code, but I very rarely insert syntactically irrelevant spaces. I don't mind if clang-format (etc.) puts them in for me, but I don't add them by pressing keys myself and I don't have a problem reading code that leaves them out (since that code looks just like the code I write myself before I run it through clang-format).

This has long been my habit, since I started out on a computer with 32K RAM, where putting in extra spaces just meant you'd need to use shorter variable names to balance things out.

(Here's a photo of some representative code I wrote for a reddit contest a couple of years ago: http://ffe3.com/pics/.beeb/IMG_1373.JPG - not much different from what I wrote in the early 1990s as a teenager. But I did typically use longer variable names back then, because unlike this case I wasn't concerned about fitting the whole listing on one 40x25 screen...)

Even today, doing this still means fewer L1 cache misses in the scanner.

to3m··on Juicero Is Shutting Down
I think you mean "so", not "but" :)
to3m··on C compiler undefined behavior: calls never-called function
"These people simply don't understand what C programmers want": https://groups.google.com/forum/#!msg/boring-crypto/48qa1kWi...

"please don't do this, you're not producing value": http://blog.metaobject.com/2014/04/cc-osmartass.html

"No sane compiler writer would ever assume it allowed the compiler to 'do anything' with your code": http://article.gmane.org/gmane.os.plan9.general/76989

"Everyone is fired": http://web.archive.org/web/20160309163927/http://robertoconc...

The really strange this is: there's probably tons of places that the compiler takes advantage of undefined behaviour, and nobody notices, and in fact is grateful of the magic speed improvement that comes for free simply from adding -O3 or whatever. And these are then used to justify the undefined behaviour that people find slightly mystifying, or that cause actual problems in practice (interestingly these always seem to be related, as in this case, to things that can be statically proven to have NULL-related undefined behaviour). But why not treat these two cases differently?

The customer is always right!

to3m··on How V8 handles JavaScript properties internally
And just think how much easier it would be if it wasn't a dynamic language!
to3m··on Lessons learned from implementing a text editor related to front-end development
Yes, if you were concerned about battery life, you'd typically not update until input or app state changes.

As for building up to your own retained mode system: not really, at least not in my view. Whether you update at a constant rate, or update only in response to user input (or whatever), you're still doing the key things that differentiate immediate mode-type GUIs from retained mode-type GUIs: firstly, you're regenerating the entire UI from scratch each time; and secondly, you're handling the input events while doing the regeneration.

This is what makes immediate mode-type GUIs so easy to use in many cases. You never have to make sure each widget is linked up with whatever it relates to, and you never have to ensure the widget list is kept in sync with the list of things, and so on. You're always building the widget list from the (authoritative) list of things, and processing the related input events at the same time.

← PreviousPage 5 of 34Next →