HNHacker News
TopNewBestAskShowJobs

to3m

4,399 karma · joined March 25, 2011

(account dormant as of 21/3/18)
submissionscomments
to3m··on Cquery: highly-scalable, low-latency language server for C++
I found it fine once I'd set it up to do completion only by request, so I'd know that I might have to wait. The default, whereby it tries to pop up as you type, was absolutely maddening...
to3m··on Cquery: highly-scalable, low-latency language server for C++
One interesting thing that rtags does is provide a gcc/clang wrapper script. You make symlinks to it called cc/c++/gcc/g++/etc. in a folder that's in PATH ahead of wherever gcc/clang proper live. When invoked, the script submits an appropriate tags job to the rtags server, complete with compile flags actually used, then passes the command line on to the appropriate tool so that the compile actually gets done.

So quite often you won't need to do anything. (If you use CMake, you will have to rebuild your Ninja/make files after first setting this up.)

I didn't find rtags perfect. There were a few files that it simply never seemed to create tags for, and the rtags setup is complicated enough that I couldn't quickly figure out why, so I just put up with it. But when it works, it works very well...

(This sort of thing seems to be par for the course with this kind of tool. I've seen a number of people complain about how terrible Visual Studio's code browsing is, for example, but it's been a long time since I've had a problem with it...)

to3m··on Faster Growth Begins with a Land Tax in U.S. Cities
The Poor Widow Bogey: http://kaalvtn.blogspot.co.uk/2013/01/a-poor-widow-bogey.htm...

Land Doesn't Generate Income: http://kaalvtn.blogspot.co.uk/2013/01/c-land-doesnt-generate...

to3m··on Why do we care more about benefit ‘scroungers’ than billions lost to the rich?
When somebody buys gold or bitcoin, they are giving money to somebody else, who will almost certainly spend it, or, failing that, at least put it in the bank.
to3m··on Why Object-Oriented Languages Need Tail Calls (2011)
We even already have a common keyword suitable for this: 'goto'.
to3m··on Budweiser's ex-marketing chief: Weed is the new craft beer
I'm sticking with the theory that it was due to breathing in the marijuana smoke. This is after all typically how you get high.
to3m··on Budweiser's ex-marketing chief: Weed is the new craft beer
Probably not much of a risk if you're outdoors.

Personally I've found it to have an effect when indoors, even if there's an open window. (I don't live in an especially warm climate, though. Windows are not typically open all that far.) I had a friend who was a very heavy dope smoker and I'd often feel a bit stoned after leaving his house. Nothing major, just as if I'd had a few drags on a joint.

(I used to be a heavy smoker myself, years ago, so the sensation is quite familiar to me.)

I don't know why it's such a strange idea that this could happen. You are after all breathing in marijuana smoke. Second-hand or not, over a few hours it seems to add up.

to3m··on 10 years of love for Emacs undone by a week of VSCode
The Code Runner looks like it just runs a script and puts the output in a VSCode panel, which is not the same thing. VSCode is written in something that compiles to Javascript, right? So, while you're running VSCode, there's a JS VM that's running the VSCode code. So what I'm missing is a way to be able to run your own code inside the same VM that the editor's code is running in, giving it full access to all the objects and state that the editor's code is in.

You can use this to write ad-hoc extensions that disappear when you quit, or just experiment with the extension functionality. This is typically how you start and then iterate on extensions in Emacs.

to3m··on 10 years of love for Emacs undone by a week of VSCode
The org-mode reference is "rhetoric". That's the Latin for "#thatsthejoke" :)

Regarding the REPL - what I mean is, run a snippet that executes in the context of the editor. Like, in emacs, you can execute ``(defun fred () (interactive) (insert "fred"))'' from the scratch buffer, and now you've got a new editor command: fred. Run it with M-x (the closest Emacs analogue to the Command Palette). Bind it to a key, maybe: ``(global-set-key (kbd "<f6>") 'fred)''. Good for prototyping, debugging addons, or just writing quick one-off things.

And as for Git, I don't really understand the suggestion. I have a Git repo for Emacs settings that works on all my PCs: Linux, OS X (terminal), OS X (GUI), Windows (non-work), Windows (work). If there's anything that needs to be different on one or the other, I just do ``(when (tom--is-osx) ...stuff...)'' or whatever. tom--is-osx is a function that's something like ``(defun tom--is-osx () (eq system-type 'darwin))'', and so on for the other systems I use. I check for my work PC by examining the hostname.

For VSCode, on the other hand, there's only one settings.json (and it's right out of the way, in some fiddly folder structure that's laid out like there's no real user-serviceable parts inside, which gives me pause - but that's a separate issue). In my case, most of it wants to be the same on every system. Some bits want to be different. I'd also like my plugins list to be synced as well. Doesn't seem to be any good support for that either.

(This stuff is easy to do with Emacs, because Emacs doesn't have a settings file per se, just a file with Lisp commands in it that, when run, leave the system in the desired state. So you can have ifs, along with anything else you like, because it's just code.)

to3m··on 10 years of love for Emacs undone by a week of VSCode
Stuff seems to be very easy to get working in VSCode, whereas almost everything is a bit of a faff to set up in Emacs. Getting decent Go support in VSCode took about 1 minute, for example, and the only problem I've found with it is that now I've got to use Go. Emacs on the other hand... well, I haven't even bothered. It's almost certainly going to be a complete bind. (And even if it isn't, my statement is worded in such a way that I'm actually still right.)

Once you've been using VSCode for a while, though, you'll start to wonder just why you can't move that stupid sidebar to some other place on the screen.

Or maybe you'll wonder why you can't see its individual components in different windows. Why are they all stuck as like tabs of the same panel?

Come to think of it, why can you only split the editing window twice?

And considering it's all driven off a dynamic language, how come there's so much damn boilerplate when it comes to writing an extension? And where's the in-editor JS REPL akin to M-: or the scratch buffer? (Actually, now I've even asked that question, I'm sure I've just missed something obvious, because there has to be one, and it must be there.)

Don't even get me started on how to share configs between multiple systems... (there's an addon that'll upload them to gists but there doesn't seem to be any way to have system-specific configs, something that Emacs solves inherently because its config files are just Lisp code)

Also, VSCode doesn't work properly with my favourite font on Windows.

And I'm not going to mention org-mode.

to3m··on Don’t use C++ auto? Restricting auto is not the best decision
I go one step further - the interesting part of the type has to be mentioned in a form that you can click on and do a Go To Definition (etc.). So auto foo=FooFactory::newFromBar(bar) is no good, because you can't click on the exact type newFromBar is returning. But you might say auto thing=GenericFactory::Create<Thing>(), and that's OK, because you can click on the identifier Thing.

(The point about the 'interesting' part is to permit stuff like std::unqiue_ptr<T> F<T>() and the like.)

to3m··on Paradise Papers: New leak from offshore finance firm
Disagree. There's nothing wrong with looking at somebody else's previous comments, nor anything wrong with pointing out to the reader that there might (rightly or wrongly) be something of interest there. Comments are public, and a user's comment history is public too.
to3m··on Ask HN: Who is hiring? (November 2017)
German has grammatical gender: https://english.stackexchange.com/questions/225052/what-does...
to3m··on Drawille: Pixel graphics in terminal with Unicode braille characters
I think the block characters are easier to read, but with a 4x4 grid the resolution is lower: https://en.wikipedia.org/wiki/Block_Elements

The resulting pixel resolution is a bit screwy, especially if you use a tall, thin font like the one I tend to. Too many pixels horizontally, too few vertically. The upper block/lower block characters might be better in terms of aspect ratio, but then the overall resolution is made even worse...

The 2x3 Braille grid makes a lot more sense.

to3m··on Advantages of Tcl over Lisp (2005)
> You can write a TCL list to a file? You mean a TCL string to a file?

No - and I think this is entirely what the comment about Lisp was about.

In tcl, there is no distinction.

to3m··on Things I Wish I'd Known Before Using Vagrant
I used NFS when using vagrant shared folders a lot a couple of years ago. Didn't really pay much attention to the performance, I must admit, which was fine for my purposes; for me it only really needed to crash less than the default shared folder stuff...

I did have to supply an extra "mount_options:['actimeo']=1" option to the synced_folder command to make file watcher-type systems work tolerably. With the defaults I'd often be waiting several seconds before any changes made by the host would be picked up by the guest.

to3m··on Rising Rents Are Pushing More Tenants Past the Breaking Point
I think this is "Landlords will pass on all the tax to their tenants": http://kaalvtn.blogspot.co.uk/2013/01/g-lvt-would-benefit-ri...
to3m··on Rising Rents Are Pushing More Tenants Past the Breaking Point
Blog rebutting many common arguments against a land value tax: http://kaalvtn.blogspot.co.uk/p/index.html
to3m··on Ill-Advised C++ Rant, Part 2 (2016)
Strictly speaking I think the term for what's requested would be reflection - but I don't think these terms are especially precise ones.

The sorts of things I've used reflection for:

- logging - getting the name of things' types, turning enums into strings, etc.

- generating debugging UI - for every bool field in your object, you get a check box; for every enum field, a combo box; for every string field, a text box; and so on

- serialization/deserialization - it has limitations, but you can get surprisingly far before you run into them, and for many situations it doesn't matter

- scripting language integration - for every type of interest in your program, find its fields and methods, and link those up to the scripting system

- dependency injection - given a set of known services, when creating an object (perhaps by name, provided at runtime, which you match to a type by scanning the list of types available) provide it with the services it needs (determined by, say, examining the types of the parameters of its constructor). Typically you'd cross-reference types of parameter with types of each service to match them up, but there are various options

Especially good with a C#-like metadata system that lets you assign user-defined properties to fields that your calling code can query to get further info. For example, you might not want to serialize certain fields, or you might want to hide some fields from the UI, and so on.

(If this doesn't convince you, fine; for my money, though, this is the #1 missing feature from C++. But, like the post's author, my background is working on video games... maybe this is just stuff that only video games people would want?)

to3m··on Ill-Advised C++ Rant, Part 2 (2016)
C# lets you do "goto case XXX" to go to another case, and empty cases fall through to the next. This is a bit inconsistent, but it at least retains the useful fall-through case, gets rid of the usually-undesirable case, and still accommodates the occasional exceptions.
to3m··on Honolulu fines pedestrians for viewing phone while crossing street
Why is the person in the car not looking where they are going? It's people driving cars who are responsible for not running people over. The green light is there to tell traffic it's OK to proceed if appropriate. It doesn't make it OK to just run people over.
to3m··on Dyslexia: scientists claim cause of condition may lie in the eyes
3 random guesses:

- most objects are larger than letters

- the details of most objects are less relevant than with lettering

- you can spend more time recognising each thing, whatever it is, without slowing yourself down so much that the task becomes intractable (when reading, you have to recognise, and correctly, a lot of letters per minute)

to3m··on My Google job was tedious and pointless
It’s just as it says: the personal touch.
to3m··on Windows 10 Fall Creators Update: the 10 best new features
After trying various supposed solutions to this, most involving toggling some arcane Group Policy setting somewhere, all of which I dutifully toggled, only to find many days later that actually it made no difference, eventually I managed to hit on the right combination, and now I now get prompted for each update!

So it is possible, at least with Windows 10 Enterprise... even if I'm not quite sure how. I've ticked so many damn boxes in that stupid policy editor. But, if you ever find yourself losing faith as you click through another advert-infested Windows "help" site, stay strong! A solution is out there!

(It still isn't perfect, though. Sometimes the updates are downloaded before I get prompted; other times, I'm prompted and then they download. More than once, the "download" process has used 100% CPU for an hour, which makes me suspicious that it's doing a bit more than it claims. And a couple of times when I've had the Security & Updates page open in the background, I've seen things just install themselves without asking, suggesting that certain updates are able to bypass this. But: no forced reboots.)

to3m··on Wolf Puppies Are Adorable, Then Comes the Call of the Wild
Draft horses (for which there's of course rather less call these days...) are well-built and docile: https://en.wikipedia.org/wiki/Draft_horse
to3m··on The web at maximum FPS: How WebRender gets rid of jank
I don't think 120Hz is as common as 144Hz. But the vast majority of displays update at 60Hz, so you might as well aim for that.
to3m··on Haxe 4.0.0 preview 2: final keyword, arrow functions
They probably started with quoted string literals (same syntax as ActionScript, I think, plus many other languages of course), then added string interpolation later and realised they needed a different syntax for it.

(Another option: they looked at what the POSIX-style shell does, and did exactly the opposite. And as language design strategies go, that is far from the worst possible.)

to3m··on A Branchless UTF-8 Decoder
I was thinking about this today. Imagine treating it N bits at a time. N=4, perhaps. 16 cases, so it won't take up much space, and you can just write out each case independently. Perhaps it's easy to have a table? - then you might do 8 bits at a time, maybe.

This suboperation does an N-bit version of the total operation: takes N bits of the mask, the corresponding N bits of the input, and produces an S-bit result, R. (S is the population count of that part of the mask.)

Suppose N=4. Then for a 64-bit value, you can do 16 of these in parallel, and you've got 16 intermediate results, R0...Rf, and 16 result sizes, S0...Sf. Then combine them. Overall result = R0 | R1<<S0 | R2<<S0+S1 | R3<<S0+S1+S2 | ... | Rf<<S0+S1+S2+...+Se.

I've no idea whether this is actually easy to implement this way, but at least it requires no loop ;)

----

12-bit example where N=4.

Mask is %000101011000, and value is %lkjihgfedcba. (I've labelled each bit of the value by its position, since that's the key part.)

Intermediate results: R0=%000d, S0=1. R1=%00ge, S1=2. R2=%000i, S2=1.

R0's contribution to the overall result = R0 = %d.

R1's = R1<<S0 = R1<<1 = %ge0.

R2's = R2<<S0+S1 = R<<3 = %i000.

So the overall result is %000d|%ge0|%i000 = %iged.

to3m··on Think twice before encrypting your HFS+ volumes on High Sierra
Even if you stick with Sierra, precisely to avoid this sort of thing, you might fall foul of the disappearing password hint problem: https://apple.stackexchange.com/questions/299558/
to3m··on iMac Pro
I do this too. You'll never have buyers' remorse if you buy the one with the largest numbers, nor will you ever run out of disk space.
← PreviousPage 4 of 34Next →