WengQiang's Blog

where there is a will, there is a way!

连接(需安装mysql-client)

  • mysql -h主机地址 -u用户名 -p密码
  • mysql -u 用户名 -p #回车后输入密码

大小写问题

sql语句命令不区别大小写的。一些人习惯把关键词大写出来显示,方便阅读

  1. mysql在linux下数据库名、表名、列名、别名大小写规则如下
  • 数据库名与表名是严格区分大小写的
  • 表的别名是严格区分大小写的
  • 列名与列的别名在所有的情况下均是忽略大小写的
  • 变量名严格区分大小写
  1. mysql在windows下都不区分大小写

  2. mysql配置时设置区分大小写 查询时设置大小写 select * from tbl_user where binary user_name={}

阅读全文 »

default actions to signals

  1. almost all signals in POSIX. 1-1900, the default is to terminate without or with core dump.
  2. few signals are ignored like SIGCHLD
  3. SIGSTOP cause the program to suspend and SIGCONT to continue. common situation is use CTRL-Z in shell

c++11 threads

Eli Bendersky's website: C++11 threads, affinity and hyperthreading

c++11 thread_local

目前使用编译器的选项设置:windows:*__declspec(thread)* linux: *__thread*

使用recursive_mutex问题

task A wants to modify a shared data structure and take a lock on its recursive mutex. It then blocks on some OS call; the task gets taken off current thread, and task B start executing. task B take a lock on the same recursive mutex successfully because it executed on the same thread, then it will reads or modify the data which was in the middle of being modified by task A, then a disaster happen!

阅读全文 »

配置toolchain

一般在mac下选择 MacOSX GCC, linux 下选择Linux GCC 1. 然后可以配置gcc (可以自己源码编译或者下载编译好的hpc gcc)hpc gcc hpc-gcc

  1. 配置eclipse使用该版本gcc
  • 配置preference(应用于全部项目) eclipse preference

  • 配置项目的属性(应用于单个项目) eclipse project property

删除一整行

  1. 使用shutcuts:command + d
  2. 按鼠标左键3下,然后按delete键
阅读全文 »

create new object or modify the object

  • create new object > slice operator([:]); + operator;

dir 和 help 函数

  1. var = ''; dir(var) 可以输出var那个object中的所有方法。
  2. var = ''; ty = type(var); help(ty.method) 可以输出var的类型中method的相关信息。
阅读全文 »
0%