2014年7月22日

ios中对url中得特殊字符处理

摘要: 1 NSString *UrlEncodedString(NSString *sourceText)2 {3 NSString *result = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kC... 阅读全文

posted @ 2014-07-22 14:27 K's Blog 阅读(3899) 评论(0) 推荐(0) 编辑

2014年7月16日

c语言中TMin的写法

摘要: 在《CSAPP》中提到: #define INT_MAX 2147483647#define INT_MIN (-INT_MAX -1)INT_MIN这样写的原因是:虽然-2147483648 这个数值能够用int类型来表示,但在C语言中却没法写出对应这个数值的int类型常量... 阅读全文

posted @ 2014-07-16 23:33 K's Blog 阅读(767) 评论(0) 推荐(0) 编辑

使用xxd命令把png图片转成c语言使用的数组

摘要: #!/bin/bashimage_list=$(ls *.png)for imag in ${image_list}do if test -f $imag then xxd -i ${imag} >> test.h fidone参考:http://www.cnblo... 阅读全文

posted @ 2014-07-16 10:08 K's Blog 阅读(964) 评论(0) 推荐(0) 编辑

2014年7月4日

cygwin 下配置ssh

摘要: 在公司配置cygwin下的ssh的时候,总是出现类似的错误: Permissions 0660 for '/hom... 阅读全文

posted @ 2014-07-04 17:35 K's Blog 阅读(298) 评论(0) 推荐(0) 编辑

2014年3月23日

使用MarsEdit写博客

摘要: 因为在mac下工作,需要纪录学习的东西,所以找到了这个软件参考使用MarsEdit写博客 阅读全文

posted @ 2014-03-23 10:38 K's Blog 阅读(230) 评论(0) 推荐(0) 编辑

2014年2月1日

bash no job control in this shell

摘要: 在安装devtoolset-2的时候,虚拟机莫明关机,不能启动,还会出现bash no job control in this shell 的提示,后来,根据一篇文章,才明白是虚拟机所长的硬盘空间不足了,只要删除一些文件,扩大剩余空间即可 阅读全文

posted @ 2014-02-01 22:36 K's Blog 阅读(2640) 评论(0) 推荐(0) 编辑

安装devtoolset-2:因由安装gcc 4.8而引起

摘要: 下午,为了使用C++11某些特性,不得不安装更高版本的gcc4.7 或gcc 4.8有两种方法:一、通过下载源码的方式安装,不过这个有点麻烦,而且容易出问题,推荐第二个方案二、安装devtoolset-2工具具体步骤:1、Save repository information as /etc/yum.repos.d/slc6-devtoolset.repo on your system,then install it using yumwget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devt 阅读全文

posted @ 2014-02-01 22:21 K's Blog 阅读(5262) 评论(0) 推荐(0) 编辑

2013年6月7日

更易型算法(Manipulating Algorithms)

摘要: 一、移除元素(Removing)元素 remove(iter_begin, iter_end, value) 删除某个区间的元素,但是不会改变该群集的元素数量 coll.erase(remove(coll.begin(), coll.end(), value), coll.end()) 删除区间里的元素,同时会改变元素数量注:注意两者的区别 1 #include <iostream> 2 #include <list> 3 #include <algorithm> 4 #include <iterator> 5 6 using namespace 阅读全文

posted @ 2013-06-07 18:51 K's Blog 阅读(186) 评论(0) 推荐(0) 编辑

迭代器之配接器

摘要: 一、Insert Iterators(安插型迭代器)back_inserter(container)front_inserter(container)inserter(container, pos) 使用insert()在pos位置上安插元素,元素排列顺序和安插顺序相同 1 #include <iostream> 2 #include <vector> 3 #include <list> 4 #include <deque> 5 #include <set> 6 #include <algorithm> 7 8 using 阅读全文

posted @ 2013-06-07 18:28 K's Blog 阅读(194) 评论(0) 推荐(0) 编辑

2013年6月6日

关于保护成员的若干问题

摘要: 学习《TCPL》时,遇到了一个保护成员方面的问题。问题代码: 1 #include <iostream> 2 3 using namespace std; 4 5 class A{ 6 protected: 7 char a[128]; 8 public: 9 A(){}10 ~A(){}11 };12 class B:public A{};13 class c: public A{14 void f(B* p) {15 a[0] = 0;16 p->a[0] = 0;//error:access to protected member of... 阅读全文

posted @ 2013-06-06 13:58 K's Blog 阅读(170) 评论(0) 推荐(0) 编辑

导航