built-in

How to disable a built-in command in vim

核能气质少年 提交于 2019-12-10 03:56:10
问题 In vim, when I hit :wq it is almost always an accident that occurred when attempting to input :w . I would like to disable :wq . The closest I found is cmap , but it has some odd behavior. If I do something like :cmap wq w I can no longer even input :wq ; it just remaps the keystroke sequence wq to w in command mode. Now I cannot, for example, input a search/replace command on a string containing wq . I would just like to alias the exact command :wq to :w or a no-op. Is there a way to do this

Is it normal that the gcc atomic builtins are so slow?

霸气de小男生 提交于 2019-12-09 16:49:52
问题 I have an application where I have to increment some statistics counters in a multi-threaded method. The incrementing has to be thread-safe, so I decided to use the gcc atomic builtins __sync_add_and_fetch() function. Just to get an idea of their impact, I did some simple performance testing and noticed that these functions are much slower than simple pre/post incrementing. Here is the test program that I created: #include <iostream> #include <pthread.h> #include <time.h> using namespace std;

Built-in magic variable names/attributes

℡╲_俬逩灬. 提交于 2019-12-09 15:16:13
问题 Background : For those not familiar with it, Sublime Text (and TextMate) provides syntax highlighting and other features through scopes which are defined by .tmLanguage language definition files, basically a bunch of regexes to identify various constructs in a given language, such as function definitions, various types of strings, reserved words, etc. I'm the maintainer of the Python Improved package (available via Package Control if you're interested) that aims to be a better language

__builtin_trap: when to use it?

柔情痞子 提交于 2019-12-09 14:16:45
问题 gcc provides additional builtin functions "for optimization". One of them is void __builtin_trap (void) which essentially is here to abort the program by executing an illegal command. From the doc: __builtin_trap function causes the program to exit abnormally. GCC implements this function by using a target-dependent mechanism (such as intentionally executing an illegal instruction) or by calling abort. The mechanism used may vary from release to release so you should not rely on any

Which version of R is running in my computer?

狂风中的少年 提交于 2019-12-09 14:09:38
问题 There are two R directories on my computer: one is /home/R-2.15.2 ,the other is /home/R-2.15.1 , when I input R , I can start R, now I want to know which R is running: 2.15.1 or 2.15.2? 回答1: Run R --version there's info about version on the first line. Edit: If you ask this question then I bet that R is not running from any of these directories. Check $PATH env variable to get information where binaries are looked for and in which order. Edit 2: Use type shell command to find where binary for

How to get a handle to an overriden built-in function? [duplicate]

情到浓时终转凉″ 提交于 2019-12-09 07:11:18
问题 This question already has an answer here : How to unhide an overriden function? (1 answer) Closed 6 years ago . On my Matlab path there's a custom zeros function. I want to store a handle to the built-in zeros in a variable. How can I do that? Thought about @(varargin)builtin('zeros',varargin{:}) , but this would probably slow down the operation due to the string comparison. Also, I've noticed that it's possible to refer to diag as @numel\diag , but this doesn't seem to work with other built

Freestanding GCC and builtin functions

痞子三分冷 提交于 2019-12-09 00:52:20
问题 The GCC docs at http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html say (under -ffreestanding ) that a freestanding environment implies -fno-builtin . I might be misunderstanding exactly what a freestanding environment is or how it works, but it seems to me that, since the builtins usually emit inline code instead of calling the library function, this is ideal for a freestanding environment where the standard library may be missing functionality or even missing entirely. So why would we

Why does icc fail to handle compile-time branch hints in a reasonable way?

醉酒当歌 提交于 2019-12-08 15:43:05
问题 A developer can use the __builtin_expect builtin to help the compiler understand in which direction a branch is likely to go. In the future, we may get a standard attribute for this purpose, but as of today at least all of clang , icc and gcc support the non-standard __builtin_expect instead. However, icc seems to generate oddly terrible code when you use it 1 . That is, code that is uses the builtin is strictly worse than the code without it, regardless of which direction the prediction is

Run external program instead of builtin [closed]

南笙酒味 提交于 2019-12-08 12:33:17
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . For example, sometimes I would like to run /bin/kill instead of the builtin kill . Is this best done as env kill or simply /bin/kill or perhaps something else? 回答1: You seem to be looking the builtin enable . Saying enable -n kill would disable the builtin kill . Say enable kill in order to enable it again. The

How to find/detect if a build-in function is used in Python AST?

只谈情不闲聊 提交于 2019-12-08 11:28:12
问题 The goal is to detect if a builtin function such as eval() is used in some code. def foo(a): eval('a = 2') I have tried the following approach: ex_ast = ast.parse(inspect.getsource(foo)) for node in ast.walk(ex_ast): if isinstance(node, ast.FunctionDef): print(node.name) The function name foo is printed as the output. I know that Builtin functions don't have constructors. They are in the type Module. So 1 approach would be using types.FunctionType in an isinstance call. But since I'm using