ICode9

精准搜索请尝试: 精确搜索
  • 常见位运算2021-04-30 13:01:12

    常用 __builtin_ffs(x) 返回x的最后一位1是从后向前第几位 __builtin_popcount(x) 返回x的二进制下1的个数 x&-x 只保留最后一位1的二进制 x = x & (x - 1) 清零最低位的1 x & 1 判断奇偶 x |= 1 << n 将第n位置1 x &= !(1 << n) 将第n位置0 x ^ (1 << (k - 1)) 对x的第k位取反 fo

  • gcc编译参数详解概述2021-04-13 22:52:59

      gcc 编译器是经常使用的,可是,自己却没有针对它做过专门的研究,当遇到问题了,总结一下,算是对未来有个积累吧。一 关于编译告警:  1 -w : 关闭所有警告,不建议使用  2 -W 开启素有gcc 能提供的警告  3 -werror : 将所有警告转为错误,开启该选项,遇到警告会终止编译        4 

  • python -v后出现import _frozen_importlib # frozen import _imp # builtin等一堆乱七八糟的内容2021-04-11 19:06:39

    本来想看一下python版本,结果输了python -v之后出现了以下界面: 后来查看文档发现,要用python -V(v要大写)

  • ESP8266定时器2021-04-05 09:01:47

      #include <Ticker.h> //导入定时器库 Ticker tickerSetHigh; int i=0; void setPin() { //回调函数--带参数 if(i==0) { i=1; } else { i=0; } Serial.println(i); //digitalWrite(LED_BUILTIN, i); } void setup() { Serial.begin(115200

  • python robot.libraries.BuiltIn import BuiltIn库2021-02-23 15:04:19

      from robot.libraries.BuiltIn import BuiltInfrom robot.running import EXECUTION_CONTEXTS#从robot导入变量到python中 if EXECUTION_CONTEXTS.top: return BuiltIn().get_variable_value(name, default=default)#从python脚本中导出文件夹级别变量到robot中 if

  • LLVM 编译器学习笔记之六-- 预处理2020-12-24 09:29:39

    1、llvm 中使用Builder.defineMacro定义builtin宏,类似GCC的builtin_define,以下是llvm8 中定义对gcc 4.2.1版本兼容性宏__GNUC__的示例      配套的接口还有isMacroDefined及undefineMacro      2、嵌套优先级       在Builder.defineMacro中可以定义一些符号,比如SS ,

  • electron源码编译 添加builtin 内建 c++扩展2020-09-08 10:02:25

      一、js层面 1,在D:\dev\electron7\src\electron\lib\browser\api\module-keys.js 中添加新的module: // Browser side modules, please sort alphabetically. module.exports = [ { name: 'app' }, { name: 'autoUpdater' }, { name: 'Browse

  • 【洛谷日报#26】GCC自带位运算系列函数2020-08-19 09:31:59

    文章转自 洛谷 谈到GCC的黑科技,大家想到的一定是这句: #pragma GCC optimize (3)//吸氧 抑或是这句: #pragma GCC diagnostic error "-std=c++11"//C++11 然而又有多少人知道__builtin_xxx()这群神奇的存在? 举个栗子:树状数组的核心思想就是一个叫做lowbit()的函数,它是这样写的: in

  • __builtin_expect2020-07-30 20:33:08

    __buildin_expect 功能是将分支转移信息提供给编译器,这样编译器可以对代码进行优化,以减少指令跳转带来的性能下降。 __buildin_expect 是 gcc 引入的指令,它允许编码人员将最有可能 的分支告诉编译器。写法为: __buildin_expect(exp, n) 意为 exp == n 的概率很大。 一般的使用方法

  • Arduino笔记-定时器中断(MsTimer2库使用)2020-04-05 18:38:24

    定时器中断,在某一特定的时候, 不管在干嘛,都要去执行那个定时器中断,指向的代码段。 这里以Arduino UNO为例: 运行截图如下: 每隔1s,亮LED_BUILTIN的灯: 这里要下载MsTimer2的库,如下: 输入MsTimer,然后安装即可: 源码如下: #include <MsTimer2.h> int led = 8; void onTimer() { d

  • 语法问题2020-03-27 23:55:33

    https://codeforces.com/blog/entry/15643 scanf scanf("%c",&c); 可以输入换行符 scanf("%s",s+1); 不会读取换行符 pair<int,int> p; p = {3,4}; vector<int>v; v = {3,4,5,6}; tuple tuple<int,int,int> t; t = {1,2,3}; int x = get<1&

  • linux 命令2019-10-25 22:57:33

    常用命令 help 输入: help help 输出: help: help [-dms] [pattern ...] Display information about builtin commands. Displays brief summaries of builtin commands. If PATTERN is specified, gives detailed help on all commands matching PATTERN, otherwise the list of

  • __builtin_ _Find_first()2019-08-02 22:52:26

    •int __builtin_ffs (unsigned int x) 返回x的最后一位1的是从后向前第几位,比如7368(1110011001000)返回4。 •int __builtin_clz (unsigned int x) 返回前导的0的个数。 •int __builtin_ctz (unsigned int x) 返回后面的0个个数,和__builtin_clz相对。 •int __builtin_popcount (u

  • [转]Python-__builtin__与__builtins__的区别与关系(超详细,经典)2019-04-07 11:50:25

    很受益的一篇博文,从别的转发者那里转过来,原作者都不知道是谁了.. 在学习Python时,很多人会问到__builtin__、__builtins__和builtins之间有什么关系。百度或Google一下,有很 多答案,但是这些答案要么不准确,要么只说了一点点,并不全面。本文将给大家一个较为全面的答案。以下结果是经过

  • 解决CentOS终端命令不同步问题2019-01-12 20:55:07

    history(){ syncHistory builtin history "$@" } syncHistory(){ builtin history -a HISTFILESIZE=$HISTFILESIZE builtin history -c builtin history -r } promptCommand(){ if [ "$TERM" = xterm ] then case "$DISPLAY"

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有