4,399 karma · joined March 25, 2011
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...)
Land Doesn't Generate Income: http://kaalvtn.blogspot.co.uk/2013/01/c-land-doesnt-generate...
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.
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.
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.)
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.
(The point about the 'interesting' part is to permit stuff like std::unqiue_ptr<T> F<T>() and the like.)
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.
No - and I think this is entirely what the comment about Lisp was about.
In tcl, there is no distinction.
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.
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?)
- 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)
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.)
(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.)
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.