ITeye博客

黑白人生

nuaa_liu · 共 17 篇文章

Java学习推荐书目

From: http://www.blogjava.net/killme2008/archive/2010/11/11/337788.html 一直有这么个想法,列一下我个人认为在学习和使用Java过程中可以推荐一读的书籍,给初学者或者想深入的朋友一些建议,帮助成长。推荐的的都是我自己读过,也会推荐一些朋友读过并且口碑不错的书籍。 一、基础类 1、《Thinking in java》,入门第一位是建立正确的概念。 2、《Core Java》,我没系统读过,这本书更贴近实践,更多API的介绍,同样,更新也更频繁。 二、进阶类 1、《Effective Java》,在熟悉语法、API之后,你需要…

2011-07-30 21:47 · Java入门 · 评论(0)

boost::phoenix3

#include <vector> #include <algorithm> #include <iostream> #include <boost/phoenix/core.hpp> #include <boost/phoenix/operator.hpp> int main() { using boost::phoenix::arg_names::arg1; int init[] = { 2, 10, 4, 5, 1, 6, 8, 3, 9, 7 }; std::vector<int> c(init, init + 10); typedef std::vector<int>::itera…

2011-07-26 10:10 · C/C++ · Boost · 评论(0)

Linux中gcc,g++常用编译选项

http://blogold.chinaunix.net/u/29619/showart_450675.html -x language filename 设定文件所使用的语言,使后缀名无效,对以后的多个有效.也就是根据约定,C语言的后缀名称是.c的,而C++的后缀名是.C或者.cpp,如果你很个性,决定你的C代码文件的后缀名是.pig 哈哈,那你就要用这个参数,这个参数对他后面的文件名都起作用,除非到了下一个参数的使用。 可以使用的参数有下面的这些: `c', `objective-c', `c-header', `c++', `cpp-output', `assembler', and …

2011-07-22 10:23 · Linux · 评论(0)

loki::typelist

loki的typelist用来形成class的list 依赖于递归行为 只不过在编译期执行 namespace loki { class NullType; struct EmptyType {}; template<class T, class u> struct TypeList { typedef T Head; typedef U Tail; }; typedef TypeList<char, TypeList<signed char, TypeList<unsigned char,NullType> > > CharList; #define TYPELIST_1(T1) Type…

2011-07-21 10:56 · C/C++ · 评论(0)

vim c++ ide 配置

$HOME需建几个目录 .vim .vim/plugin 放.vim插件 .vim/colors 放配色.vim cscope和ctags安装的时候需要root权限 具体配置可以参考:http://www.vimer.cn/ 插件下载地址: http://www.vimer.cn/2010/06/%E6%9C%AC%E5%8D%9A%E4%BD%BF%E7%94%A8%E7%9A%84vimgvim%E7%9B%B8%E5%85%B3%E6%8F%92%E4%BB%B6%E6%95%B4%E7%90%86.html 或者: http://www.everbox.com/f/tndd4csvO…

2011-07-19 14:48 · 技术Wiki · 评论(0)

linux命令tips

~/.bash_profile $vi .bash_profile function mkdircd() {mkdir -p "$@" && eval cd "\"$$#\"";} 设置系统时间 #date -s "01/31/2009 22:19:53" /*****************************************/ grep -v 显示出所有不包含匹配文本的内容 -c 显示满足模式的行数 grep -ri join /home/users -l 只显示文件名 /*****************************************/ find 查找文件…

2011-07-19 13:33 · Linux · 评论(0)

boost::string

<boost/algorithm/string.hpp> <boost/algorithm/string/case_conv.hpp> <boost/algorithm/string/classification.hpp> <boost/algorithm/string/compare.hpp> <boost/algorithm/string/concept.hpp> <boost/algorithm/string/constants.hpp> <boost/algorithm/string/erase.hpp> <boost/algorithm/string/find.hpp> <boos…

2011-07-18 10:20 · C/C++ · Boost · 评论(0)

vector&&map

#include <algorithm> #include <map> #include <vector> //std::map在insert后是自动排序的,查找的时候可以使用 find std::map<int,string> mapDemo_; if(mapDemo_.find(nKey) != mapDemo_.end()) { //find } //std::vector在push_back()后不会自动排序,可以使用sort进行排序 std:vector(int) vecDemo_; sort(vecDemo.begin(),vecDemo_.end()); if(binary_s…

2011-07-18 10:09 · C/C++ · 评论(0)

获取当前时间字符串

//get current time string char szTime[32] = {0}; time_t lTM = time(NULL); tm *pstTM = localtime(&lTM); strftime(szTime, 32, "%Y-%m-%d %H:%M:%S", pstTM); //struct timeval_a old; struct timeval_a now,interval; gettimeofday_a(&now,0); timersub(&now,&old,&interval); float fCost= (static_cast<float>(int…

2011-07-18 10:05 · C/C++ · 评论(0)

boost::split

#include "boost/algorithm/string.hpp" #include <stdio.h> #include <string> #include <vector> using namespace std; using namespace boost; int main(int argc,char* argv[]) { /*template<typename SequenceSequenceT, typename RangeT, typename PredicateT> SequenceSequenceT & split(SequenceSequenceT &, Rang…

2011-07-18 09:55 · C/C++ · Boost · 评论(0)

boost_foreach

1 #include <string> 2 #include <iostream> 3 #include <boost/foreach.hpp> 4 5 #define foreach BOOST_FOREACH 6 7 8 int main() 9 { 10 std::string hello("Hello,World!"); 11 12 foreach(char ch,hello) 13 { 14 std::cout << ch; 15 } 16 17 return 0; 18 } 支持类型:STL containers,arrays,Null-terminated strings,st…

2011-07-15 14:12 · C/C++ · Boost · 评论(0)

关于沟通

今天沟通的不愉快,交接的人想着抛出,被交接的人很无奈。 对于需求感到很迷惑,二传手没有表达清楚,还被问到底能不能实现。 至少结果是好的,提了两种技术解决方案,找到原始提需求的人沟通完毕。 以后还是与需求方直接沟通来的有效。

2011-07-14 02:23 · Tea_技术_生活_随笔 · 评论(0)

boost生成随机数

/*输入参数:随机数位数*/ /*输出参数:随机数*/ boost::mt19937 m_oBoostRandomSeed_; GetRandomNumber(int nDigits) { double dRangeMin = pow((double)10,nDigits); double dRangeMax = pow((double)10,nDigits+1) -1 ; boost::uniform_int<> range(static_cast<int>(dRangeMin),static_cast<int>(dRangeMax)); boost::variate_generator<…

2011-07-04 17:19 · C/C++ · Boost · 评论(0)

Erlang_Demo

//socket基本应用 //erlang程序基本写法 -module(vpl). -export[(run/2)]. -define(IP,"127.0.0.1"). -define(PORT,1777). run(ThreadCount,MsgCount)-> CurrentThreadNo = -1, CurrentMsgNo = -1, swpan_thread(CurrentThreadNo,CurrentMsgNo,ThreadCount,MsgCount). swpan_thread(CurrentThreadNo,CurrentMsgNo,ThreadCount,MsgCou…

2011-06-23 17:45 · Erlang · 评论(0)

SQL_CASE_1

表结构: ColNo Time SerialNo 1(p-key) 020111 030201 030301 AxCSAaa SceCC GYAZZ 需要: 根据SerialNo中不同的值(用空格分开)来获取Time中对应位置的值 Time格式是6个一组 select distinct substr(a.Time,SpaceCount*7+1,6) as "时间", a.SerialNo as "序列号" from (select (case when SpaceCount is null then 0 else SpaceCount end) as SpaceCount,calsign f…

2009-08-07 11:50 · SQL · 评论(0)