
C++
文章平均质量分 67
蜜汁小强
年龄怎么就突然变大了呢
展开
-
Makefile - Build CPPs with each one has a main for apps
There always are cpp files and each of them has a main function as a standalone app each. For example, in my folder DesignPatterns I have filesfactory_example.cpp and command.cpp, they ready to be b原创 2012-06-07 23:11:13 · 1054 阅读 · 0 评论 -
Setup a Subversion server in three minutes
IntroductionI assume you are using Linux and having subversion installed, then you will follow the steps to setup a subversion server with URL looks like svn://localhost/reponameSetup1. Create a原创 2013-10-23 22:07:28 · 1236 阅读 · 0 评论 -
Build Android-C App with NDK
Here we are going to build an APP with NDK for Android, we will use Makefile during the building.File --- Makefile# --- Begin Customized --- BIN = testCUSTOM_OBJS = $(shell find . -name '*.c' |原创 2013-08-08 23:11:31 · 2142 阅读 · 0 评论 -
简单的C程序判断系统是大端还是小端方式
创建一个C程序main.c,将下边的代码复制进去并编译、运行:#include int main(int argc, char **argv){ int a = 0x12345678; char *p; p = (char *)(&a); if (*p = 0x78) printf("Small Endian.\n"); else printf("B原创 2013-08-01 11:35:40 · 2316 阅读 · 0 评论 -
[C++] [Source Code] Tracebin: Get text as Hex String.
I'd written an article [http://blog.youkuaiyun.com/wxqee/article/details/7644831] about this title. Here is the upgrade version as C++. It has been tested in Linux, you can just copy & paste the source c原创 2013-02-01 14:23:48 · 1350 阅读 · 0 评论 -
Linux - C++ - Print log to file
Reversion 1: #include #include #include #include int main (int argc, char **argv){ std::stringstream logf_n; logf_n << "/tmp/MyApp_" << time(0) << ".log"; std::ofstream logf(logf_原创 2013-01-29 16:32:28 · 1806 阅读 · 0 评论 -
Install g++ over Ubuntu
Typically install g++, try command:xiwang@xiwang:~$ sudo apt-get install build-essential原创 2012-12-16 18:19:19 · 681 阅读 · 0 评论 -
Trim a string with C++ [2]
I've wrote a blog to discuss how to trim a string in C++. Now I find an other way in high performance, see the implements below: #include #define STRING_TRIM_DROPS " \t"std::string& trim(st原创 2012-11-22 16:49:55 · 820 阅读 · 0 评论 -
实现《C++程序设计语言(特别版)》第6章 表达式和语句 - 桌面计算器 - Linux
这个实现只是一个思路,需要容错和优化。表达式语法分析如下: ***************** * program: * END * expr_list END * expr_list: * expression PRINT // PRINT is ; * expression PRINT expr_list * expres原创 2012-06-27 23:35:35 · 4612 阅读 · 2 评论 -
BASH脚本(ok2makefile):生成带有makefile的C++ "Hello world"程序
这个脚本也是闲着没事儿准备以后用的,应用场景:“在Linux下开发C++项目的时候,有时候需要临时创建一个简单的C++工程来尝试一些用法,但是全新编写一个带有makefile的hello world还是需要几分钟时间的,也是个反复的活儿,要是有个命令能够一下子生成一个目录,里边含有main.cc和makefile就好了。”如果你也会经常遇到这种场景,到可以试试ok2makefile.sh脚本,原创 2012-06-24 21:07:46 · 1619 阅读 · 0 评论 -
简单的、智能搜索源文件的 Makefile(随意扩展bin或lib)
上一期: 《简单的、智能搜索源文件的 Makefile》下载代码:http://download.youkuaiyun.com/detail/wxqee/4377256包括《简单的、智能搜索源文件的 Makefile》和本期《简单的、智能搜索源文件的 Makefile(随意扩展bin或lib)》的代码。过了一天,过来写一个模版,其预期的场景是这样的:同一个工程下,需要编译一原创 2012-06-16 20:21:33 · 1551 阅读 · 0 评论 -
简单的、智能搜索源文件的 Makefile
如果,你正在为寻找一个通用简易的、智能搜索源文件的 Makefile 而奔波的话,那么下边的Demo你有可能看得上它:例如,你有一个目录,这个目录里目前只是生成一个二进制文件,其源码全部在这里,那么你可以尝试第一个版本的 Makefile# Makefile, 2012-06-15 T1738# TODO# ----------------------------------原创 2012-06-15 18:06:11 · 2063 阅读 · 0 评论 -
Trim a string with C++
Trim a string with C++ demo code following: // TrimStringDemo.cpp#include #include using namespace std;string LTrimString(const string str){ int h = 0, t = str.size(); while (h < t && (原创 2012-06-15 16:58:07 · 1223 阅读 · 0 评论 -
Linux下对已有项目快速打RPM包(只需编辑XML文件)
期间公司在做Migration的工作,经常遇到这样的场景:需要对现有的二进制第三方库和头文件打包成RPM包,以便临时测试用或者第三方库管理。但是,修改SPEC文件并编写Makefile是个郁闷的事情,总是重复去做,对RPM新手来说是个灾难。于是乎,小强就创建了一个开源项目RPMBuilder来完成这件事相对郁闷的事情,理由很简单,每个童鞋只要下载、编译、安装RPMBuilder以后,就原创 2012-06-07 23:17:32 · 2908 阅读 · 0 评论 -
XML相关的一些技术
自学网站: http://www.w3school.com.cn/x.asp知识框架【XML】指扩展标记语言【XSL】指扩展样式表语言。【XSLT】指XSL转换,比如使用XSLT将XML转换为XHTML文档。【XSL-FO】指可扩展样式表语言格式化对象(Extensible Stylesheet Language Formatting Objects),可以使用XSL-FO对输出的原创 2012-06-13 17:15:37 · 782 阅读 · 0 评论 -
[C/C++] Using `getopt' in c/c++
Using `getopt' in c/c++Could not get the real original version for the examples, list one of them first, usefully and well tested.ExamplesExample 1// getopt_example.cpp#include int m转载 2012-06-08 14:00:08 · 1198 阅读 · 0 评论 -
Tracebin in C++
Core filestracebin.h// tracebin.h#ifndef _TRACE_BIN#define _TRACE_BIN#include #include extern int ftracebin(FILE* pf, const char* data, int length);extern int tracebin(const char* data,原创 2012-06-08 11:54:38 · 1077 阅读 · 0 评论 -
i18next - start programming
I18Next - Start ProgrammingHome: http://i18next.com/I18Next - Start ProgrammingConfigure UsageStep 1 Download scriptStep 2 JavaScript in HTML pageStep 3 Initialize I18NStep 4 Create JSONStep 5 U原创 2015-02-27 14:53:36 · 4019 阅读 · 0 评论