基本
- Relevant docs high, less relevant docs below
- training dat
车立方" type="application/atom+xml">
1 2 3 4 5 6 7 8 9 |
|
printf("%s\n", a.c_str());
static_cast<type> (object);
The static_cast operator can be used for operations such as:
int score = 1340;
float scale = static_cast<float>(score) / MAX_SCORE + 1;
// 如果这样呢?会有什么不同
float scale = score / MAX_SCORE + 1;
需要注意的是,在基础类型转换时,并非进行四舍五入,而是直接舍去小数部分!
// 定义了一个int变量i,i存在为负数的情况
int i = -1;
// 又定义了一个unsigned short or int的变量j
unsigned short j;
// 如果把i的值赋给j
j = i;
// 会发生什么?j为65535
std::cout << j << std::endl;
这是一个简单的赋值,但由于前后未注意,导致这种bug发生,试想如果后面使用下面语句进行判断的话:
if(j > 0) {
// 这里,j本应该是-1,但由于65535>0,导致错误
}
看到一句很有意思的话,You’re lying to the compiler.
如果一个表有多列,要想不查询指定列(其余列都要),该如何实现?
在stackoverflow上有类似的问题,Select all columns except one in MySQL?
SET @database = 'database_name';
SET @tablename = 'table_name';
SET @cols2delete = 'col1,col2,col3';
#If you do have a lots of cols, use this sql to change group_concat_max_len
SET @@group_concat_max_len = 2048;
SET @sql = CONCAT(
'SELECT ',
(
SELECT GROUP_CONCAT( IF(FIND_IN_SET(COLUMN_NAME, @cols2delete), NULL, COLUMN_NAME ) )
FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = @tablename AND TABLE_SCHEMA = @database
),
' FROM ',
@tablename);
SELECT @sql;
PREPARE stmt1 FROM @sql;
EXECUTE stmt1;
涉及到以下内容:
sudo apt-get install weka
---Registering Weka Editors---
Trying to add JDBC driver: RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add JDBC driver: jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add JDBC driver: org.gjt.mm.mysql.Driver - Error, not in CLASSPATH?
Trying to add JDBC driver: com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add JDBC driver: org.hsqldb.jdbcDriver - Error, not in CLASSPATH?
These are actually just warnings rather than true errors. The system has some default connection strings for various common databases and Weka does a quick check to see if the appropriate JDBC drivers are available to the system at startup. If you are not planning to connect to MySQL, Hypersonic, instantdb etc. then these messages can safely be ignored.
也就是说,这是weka的例行检查,如果不打算连接数据库,完全可以忽略这些warning信息。
$ ssh -T git@github.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0766 for '***/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: ***/.ssh/id_rsa
Permission denied (publickey).
cd ~/.ssh
chmod 700 id_rsa
相比之前使用python的插件完成excel清理,也许这会是个方便的选择。
温故而知新
学而时习之
有朋自远方来
会当凌绝顶