2017年4月24日

生产者,消费者 多线程

摘要: #include #include #include #include const size_t SIZE = 10; using ElemTy = char; ElemTy arr[SIZE]; size_t begin = 0; size_t end = 0; std::mutex prdc_m; std::mutex cnsm_m; void produce() { ... 阅读全文

posted @ 2017-04-24 22:45 jjtx 阅读(161) 评论(0) 推荐(0) 编辑

2016年9月7日

二叉树基本操作C++

摘要: #include #include #include #include #include #include struct Node { int value = 0; struct Node *left = nullptr; struct Node *right = nullptr; }; void preorder_print_aux(Node *T) { if ... 阅读全文

posted @ 2016-09-07 22:15 jjtx 阅读(509) 评论(0) 推荐(0) 编辑

2016年8月5日

install LLVM

摘要: version >= 3.8.0 $ cd llvm... $ mv someofClang ./tools $ mkdir build $ cd build $ cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON .. $ make 阅读全文

posted @ 2016-08-05 10:33 jjtx 阅读(237) 评论(0) 推荐(0) 编辑

2016年6月21日

maxiang conf

摘要: /**设置你自己的CSS。例如:h1 {border-bottom: 1px solid #ccc;line-height:1.6;}body {background:#FDFFD0}**/ pre code, pre.prettyprint code {padding: 1.3em 0em 1.3 阅读全文

posted @ 2016-06-21 20:56 jjtx 阅读(288) 评论(0) 推荐(0) 编辑

2016年6月9日

Thailand vs Soros

摘要: | exchange rate | | Thailand | Soros | |---------------+---------+----------+---------| | | orgin | 100T, 1D | 0 | | 1:25 | loan | 50T, 1D | 50T | | ... 阅读全文

posted @ 2016-06-09 21:40 jjtx 阅读(305) 评论(0) 推荐(0) 编辑

2016年5月30日

LLVM example for main

摘要: g++ inst_visitor.cpp -L/usr/local/lib -g -Wall -Wextra -std=c++14 `llvm-config --cxxflags --ldflags --libs --libfiles --system-libs all` -lLLVMSupport 阅读全文

posted @ 2016-05-30 21:45 jjtx 阅读(543) 评论(0) 推荐(0) 编辑

maxiang.io css

摘要: /**设置你自己的CSS。例如:h1 { border-bottom: 1px solid #ccc; line-height:1.6;}body { background:#FDFFD0} **/pre code, pre.prettyprint code {padding: 1.3em 0em 阅读全文

posted @ 2016-05-30 01:07 jjtx 阅读(328) 评论(0) 推荐(0) 编辑

2016年5月29日

Chrome & Linux font

摘要: 1 $ sudo apt-get install texlive-full # 较大 2 $ mkdir -p ~/.fonts 3 下载这个win7字体包解压后放到~/.fonts下 4 $ sudo fc-cache -fv 5 如果需要个别字体可下载fonts这个压缩包 6 再不行就 7 $ 阅读全文

posted @ 2016-05-29 15:43 jjtx 阅读(482) 评论(0) 推荐(0) 编辑

2016年5月25日

Singleton in C++11 style

摘要: #include #include #include class SingletonOld { static std::shared_ptr handle_; static std::mutex handle_mutex_; int data_ = 0; public: static auto create() { std::lock_guard lock(h... 阅读全文

posted @ 2016-05-25 20:47 jjtx 阅读(418) 评论(0) 推荐(0) 编辑

2016年5月10日

Quickly place a window to another screen using only the keyboard

摘要: http://askubuntu.com/questions/22207/quickly-place-a-window-to-another-screen-using-only-the-keyboard Install CompizConfig Settings Manager Run it → G 阅读全文

posted @ 2016-05-10 08:24 jjtx 阅读(206) 评论(0) 推荐(0) 编辑

2016年3月11日

C/C++ 记录时间

摘要: http://stackoverflow.com/questions/2808398/easily-measure-elapsed-time https://github.com/picanumber/bureaucrat/blob/master/time_lapse.h #include <cti 阅读全文

posted @ 2016-03-11 20:20 jjtx 阅读(1119) 评论(0) 推荐(0) 编辑

2016年2月18日

Ruby Unit Test

摘要: 1 require 'test/unit' 2 3 module Test::Unit::Assertions 4 def assert_equal_unorder(exp, act, msg = nil) 5 # msg = message(msg) {} 6 assert_equal(exp.t 阅读全文

posted @ 2016-02-18 00:52 jjtx 阅读(360) 评论(0) 推荐(0) 编辑

2016年1月9日

tmux 操作

摘要: http://www.cnblogs.com/congbo/archive/2012/08/30/2649420.htmlhttps://www.digitalocean.com/community/tutorials/how-to-install-and-use-tmux-on-ubuntu-12... 阅读全文

posted @ 2016-01-09 01:38 jjtx 阅读(142) 评论(0) 推荐(0) 编辑

2015年12月25日

git 常用操作

摘要: 查看某文件的某些行的变化历史: $ git log --pretty=short -u -L 2003,2005:Executor.cpp http://stackoverflow.com/questions/8435343/retrieve-the-commit-log-for-a-specifi 阅读全文

posted @ 2015-12-25 12:45 jjtx 阅读(239) 评论(0) 推荐(0) 编辑

2015年12月18日

使进程在后台运行

摘要: 总结自http://askubuntu.com/questions/562911/how-to-execute-a-task-in-background1. 启动时 $ zathura a.pdf &2.$ zathura a.pdf$ # press Ctrl+z$ bg3. nohup zath... 阅读全文

posted @ 2015-12-18 09:27 jjtx 阅读(164) 评论(0) 推荐(0) 编辑

2015年12月7日

sugar 自动为DP 加cache (or打表)

摘要: // from http://www.csdn.net/article/2015-12-03/2826381#include #include #include #include #include #include template auto my_sugar(Function func) { ... 阅读全文

posted @ 2015-12-07 22:14 jjtx 阅读(256) 评论(0) 推荐(0) 编辑

2015年9月15日

ruby Matrix 输出 格式化

摘要: 1 require 'matrix' 2 3 class Matrix 4 def to_pretty_s 5 s = "" 6 i = 0 7 while i maximal_length29 m... 阅读全文

posted @ 2015-09-15 21:43 jjtx 阅读(478) 评论(0) 推荐(0) 编辑

2015年7月28日

git 实用操作

摘要: 查看某文件的某些行的变化历史:$git log --pretty=short -u -L 2003,2005:Executor.cpphttp://stackoverflow.com/questions/8435343/retrieve-the-commit-log-for-a-specific-l... 阅读全文

posted @ 2015-07-28 10:27 jjtx 阅读(175) 评论(0) 推荐(0) 编辑

2015年7月15日

我的 C++ style

摘要: 1 int g_tennis; // not use as possible 2 3 int make_world() { 4 int size = 0; 5 6 return size; 7 } 8 9 const int NUMBER = 100;10 11 enu... 阅读全文

posted @ 2015-07-15 14:24 jjtx 阅读(335) 评论(1) 推荐(0) 编辑

2015年7月14日

Linux上的常用软件

摘要: zsh (fish): a new shelloh my zsh: zsh's conf fileapvlv: pdf viewer(vim style)autojump: quick 'cd' 阅读全文

posted @ 2015-07-14 15:37 jjtx 阅读(244) 评论(0) 推荐(0) 编辑

2015年6月23日

软件工程内容

摘要: 1. 软件工程方法和过程过程模型敏捷开发软件生命周期的活动需求分析与建模软件测试项目管理2. 软件体系结构和模式软件体系结构基本设计模式分布式系统架构模式(包含了接入层、业务层、资源层等) 阅读全文

posted @ 2015-06-23 21:23 jjtx 阅读(165) 评论(0) 推荐(0) 编辑

2015年6月12日

Ubuntu 杂音 alsa*

摘要: $ sudo alsactl init # 初始化$ sudo alsactl store # 存储状态会调的话可以 $ alsamixer 阅读全文

posted @ 2015-06-12 16:57 jjtx 阅读(224) 评论(0) 推荐(0) 编辑

2015年5月20日

安装YouCompleteMe

摘要: 1. from software center1 $ apt-get install vim vim-youcompleteme vim-addon-manager2 $ vam install youcompleteme3 修改 /usr/lib/vim-youcompleteme/ycm_ext... 阅读全文

posted @ 2015-05-20 15:16 jjtx 阅读(1463) 评论(0) 推荐(0) 编辑

2015年5月2日

vimrc

摘要: let g:molokai_original = 1 let g:rehash256 = 1colorscheme molokaiset numberset nohlsearch incsearch"set mouse=aset autoindent smartindentset incsearch... 阅读全文

posted @ 2015-05-02 16:19 jjtx 阅读(261) 评论(0) 推荐(0) 编辑

2015年4月13日

Linux Windows 修改键盘映射

摘要: Linux 下是编辑 ~/.Xmodmap 文件remove Lock = Caps_Lockkeysym Escape = Caps_Lockkeysym Caps_Lock = Escapeadd Lock = Caps_Lock然后使之生效:xmodmap ~/.Xmodmap 。每次键盘接口... 阅读全文

posted @ 2015-04-13 20:25 jjtx 阅读(423) 评论(0) 推荐(0) 编辑

2015年2月11日

VMware Workstation+Linux+Xshell+Xftp+MySQL+SQLyog 配置

摘要: 这些天在搞这些个东西做项目,配置较繁,这里记下安装过程中的要点。1、VMware Workstation主要是 NAT 方式联网的问题,详述如下,来自网络。NAT 配置那里注意网关,虚拟机中网关的地址需一致。DHCP配置那里有网络段区间,若用静态分配地址,那么静态设置虚拟机中的系统的 IP 需在该区... 阅读全文

posted @ 2015-02-11 19:33 jjtx 阅读(863) 评论(1) 推荐(0) 编辑

2014年9月19日

leetcode Merge Intervals

摘要: 1 /***************************************************************** 2 created: 2014/09/13 21:32 3 filename: merge-intervals.cpp 4 author: ... 阅读全文

posted @ 2014-09-19 16:51 jjtx 阅读(258) 评论(0) 推荐(0) 编辑

2014年9月13日

leetcode Remove Duplicates from Sorted Array II

摘要: 1 /***************************************************************** 2 created: 2014/09/13 16:16 3 filename: remove-duplicates-from-sorted-arra... 阅读全文

posted @ 2014-09-13 21:27 jjtx 阅读(225) 评论(0) 推荐(0) 编辑

2014年5月11日

用栈实现二叉树的非递归中序遍历

摘要: 另见求树高http://blog.csdn.net/Justme0/article/details/7694704 1 /******************************************************************** 2 created: 2014... 阅读全文

posted @ 2014-05-11 23:25 jjtx 阅读(5836) 评论(0) 推荐(0) 编辑

2014年5月1日

nth_element 测试程序

摘要: 1 /******************************************************************** 2 created: 2014/04/29 11:35 3 filename: nth_element.cpp 4 author: ... 阅读全文

posted @ 2014-05-01 12:05 jjtx 阅读(612) 评论(0) 推荐(0) 编辑

2014年4月14日

Windows 程序设计

摘要: 一、Win32 API 1 /******************************************************************** 2 created: 2014/04/14 15:30 3 filename: WinMain.c 4 auth... 阅读全文

posted @ 2014-04-14 16:07 jjtx 阅读(340) 评论(0) 推荐(0) 编辑

2014年4月3日

Huffman编码

摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 struct Node { 10 ... 阅读全文

posted @ 2014-04-03 21:56 jjtx 阅读(408) 评论(0) 推荐(0) 编辑

2014年4月2日

教务管理系统,项目介绍

摘要: 项目经验项目名称:教务管理系统项目简介:系统基于B/S架构,使用ASP.NET技术及SQL Server数据库,代码行数约2000行。数据库中主要有三个实体,分别是管理员、教师和学生。管理员可修改教师和学生的信息以及排课等;教师可查看学生信息,上传学生成绩等;学生有选课功能。 阅读全文

posted @ 2014-04-02 18:26 jjtx 阅读(1360) 评论(0) 推荐(0) 编辑

2014年3月17日

code project 上的内存管理的示例代码

摘要: /******************************************************************** created: 2014/03/17 18:53 filename: main.cpp author: Justme0 (http://blog.csdn.net/justme0) purpose: code project 内存管理*********************************************************************/#define _CRT_S... 阅读全文

posted @ 2014-03-17 19:20 jjtx 阅读(399) 评论(0) 推荐(0) 编辑

Pow 算法

摘要: #include using namespace std;templateT Pow(T x, Int n){ T r(1); // 应是含幺半群的幺元 while (n != 0) { if (n & 0x1 == 1) { r *= x; } n >>= 1; x *= x; } return r;}template T PowBoost(T x, Int n){ T r(n & 0x1 ? x : 1); while ((n >>= 1) != 0)... 阅读全文

posted @ 2014-03-17 19:19 jjtx 阅读(673) 评论(0) 推荐(0) 编辑

C++ 中数串互转、进制转换的类

摘要: 1 /******************************************************************** 2 created: 2014/03/16 22:56 3 filename: main.cpp 4 author: Justme0 (http://blog.csdn.net/justme0) 5 6 purpose: C++ 中数串互转、进制转换的类 7 *********************************************************************/ 8 9 #def... 阅读全文

posted @ 2014-03-17 19:13 jjtx 阅读(312) 评论(0) 推荐(0) 编辑

2014年3月15日

gcd 最小公约数

摘要: 1 int gcd(int a, int b) {2 return b == 0 ? a : gcd(b, a % b);3 } 阅读全文

posted @ 2014-03-15 16:52 jjtx 阅读(168) 评论(0) 推荐(0) 编辑

2014年1月5日

求两个等长的有序序列的中位数(2011计算机统考试题)

摘要: 1 /******************************************************************** 2 created: 2014/01/05 3 created: 22:01 4 file base: main 5 file ext: cpp 6 author: Justme0 (http://blog.csdn.net/Justme0) 7 8 purpose: 求两个等长的有序序列的中位数,时间复杂度O(log(n)) 9 ... 阅读全文

posted @ 2014-01-05 22:07 jjtx 阅读(1291) 评论(0) 推荐(0) 编辑

2013年11月6日

产生特定范围内的随机数

摘要: 1 // Generate a random number in the half-closed interval2 // [range_min, range_max). In other words,3 // range_min <= random number < range_max4 int get_rand(int range_min, int range_max)5 {6 return (int)((double)rand() / (RAND_MAX + 1) * (range_max - range_min)7 + range_min);8 } 阅读全文

posted @ 2013-11-06 17:56 jjtx 阅读(189) 评论(0) 推荐(0) 编辑

2013年10月22日

埃拉托色尼筛子筛选素数

摘要: 1 /******************************************************************** 2 created: 2013/10/22 3 created: 22:10:2013 12:51 4 file base: 埃拉托色尼筛子 5 file ext: cpp 6 author: Justme0 (http://blog.csdn.net/Justme0) 7 8 purpose: 高效筛选素数 9 *******... 阅读全文

posted @ 2013-10-22 12:53 jjtx 阅读(214) 评论(0) 推荐(0) 编辑

导航