- 博客(147)
- 资源 (13)
- 收藏
- 关注
原创 arch firefox
hide caption 去除讨厌的标题栏firefox addons hosts 无法下载附加组件,添加hosts解决117.18.232.191 addons.cdn.mozilla.net117.18.232.191 mozorg.cdn.mozilla.net117.18.232.191 developer.cdn.mozilla.net117.18.232.191 suppo
2016-04-02 12:24:18
1028
原创 update host
@echo offFOR %%? IN (hosts) DO ( set last_time=%%~t?)rem echo %last_time%call git pullFOR %%? IN (hosts) DO ( set curr_time=%%~t?)rem echo %curr_time%if not "%last_time%"=="%curr_time%"
2016-04-01 13:44:29
880
转载 generator 生成杨辉三角
摘录自廖雪峰 python3 生成器 generator和函数的执行流程不一样。函数是顺序执行,遇到return语句或者最后一行函数语句就返回。而变成generator的函数,在每次调用next()的时候执行,遇到yield语句返回,再次执行时从上次返回的yield语句处继续执行。 看到一个比较巧妙的办法def triangles(): nlist=[1] while True:
2016-03-31 18:58:30
1382
原创 C++ DLL
DLL生成与使用生成vs下直接配置为生成DLLdll导出函数//头文件定义#ifdef _YOUR_DLL_PREPROCESS#define _YOUR_DLL_API __declspec(dllexport)#else#define _YOUR_DLL_API __declspec(dllimport)#pragma comment(lib, "your_dll.lib")#
2016-03-29 14:02:52
490
转载 HTTP Header 详解
原文链接找不到了,给个转载的链接HTTP Headerw3c官网Header Field DefinitionsHTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议。HTTP协议采用了请求/响应模型,浏览器或其他客户端发出请求,服务器给与响应。就整个网络资源传输而言,包括message-header和message-body两部分。首
2016-03-28 18:01:56
410
原创 archlinux 入坑记
其实已经写了两次,但是remarkble保存的时候总是坑,索性卸载,转投retext.(atom安装太慢)安装前在vmware上尝试了下,但实际安装过程中还是问题不断。分区 cfdisk比parted更好用mirrorlist 使用163 mirrorsfstab校验 自动生成fstab自后校验,我没用看,导致安装之后重启找不到引导grub-install 安装grub的时候最后指定
2016-03-27 21:29:03
710
原创 Recursion 8.3
Write a method that returns all subsets of a set.// =====================================================================================//// Filename: 8_3.cpp//// Description: a method
2016-03-22 09:15:58
364
原创 Recursion 8.4
Write a method to compute all permutations of a string.// =====================================================================================//// Filename: 8_4.cpp//// Description: a m
2016-03-22 09:13:07
321
原创 Recursion 8.5
Implement an algorithm to print all valid (e.g., properly opened and closed) combinations of n-pairs // =====================================================================================////
2016-03-22 09:10:40
373
翻译 gdb Missing separate debuginfos
转自stackoverflow debuginfo-install is a command of yum-utils, soyum install yum-utilsdebuginfo-install glibcif the warning’s still there, edit /etc/yum.repos.d/CentOS-Debuginfo.repo, set enabled=1
2016-03-21 11:58:46
415
转载 字符串分割
#include <cstring>#include <iostream>int main() { char input[100] = "A bird came down the walk"; char *token = std::strtok(input, " "); while (token != NULL) { std::cout << token
2016-03-11 23:03:02
301
转载 Jsoncpp example
转载自json c++ examples// ---- create from scratch ----Json::Value fromScratch;Json::Value array;array.append("hello");array.append("world");fromScratch["hello"] = "world";fromScratch["number"] = 2;
2016-02-17 12:56:23
653
原创 pandas Cookbook--Chapter 1
pandas Cookbook–Chapter 1环境设置ipython notebook%pylab inline%matplotlib inlinematplotlib.style.use('ggplot')figsize(15,5)#import pandas as pd#pd.set_option('display.mpl_style','default')#code above
2016-02-17 09:52:00
839
原创 不定义该运算符或到预定义运算符可接收的类型的转换
set definition std::set is an associative container that contains a sorted set of unique objects of type Key. Sorting is done using the key comparison function Compare. Search, removal, and insertion
2016-01-29 15:40:05
15761
原创 常用工具
格式化代码—clangformat简介ClangFormat describes a set of tools that are built on top of LibFormat. It can support your workflow in a variety of ways including a standalone tool and editor integrations.链接下载地址
2016-01-20 10:22:18
512
原创 Batch 自动更新替换文件
从github pull了一个host文件,需要频繁更新,每次需要pull一次,替换一次,后来觉得手动替换太麻烦,将替换写成脚本了。但是觉得每次pull还是挺麻烦的,写个脚本,再简便些。@echo offFOR %%? IN (hosts) DO ( set last_time=%%~t?)call git pullFOR %%? IN (hosts) DO ( set cu
2016-01-08 09:43:59
552
原创 Java无符号数
java是没有无符号数,当其他无符号数经java解析之后,可能就会出问题。经过查询,一般有两种解决方案: 1. 如果在Java中进行流(Stream)数据处理,可以用DataInputStream类对Stream中的数据以Unsigned读取。(没试过,不了解) 2. 进行扩展、位运算 无符号出现问题只有在最高位为1的时候,最高位在有符号数中表示正负号,直接转换会产生负数。如果使得原本的无符号
2015-12-14 14:39:07
6306
1
原创 cygwin gcc 动态链接库问题
目录结构libtest/src/main.c libtest/lib/hello.c libtest/include/hello.h编译动态库cd libgcc -I../include -fPIC -shared -o libhello.dll hello.c解决办法我本来生成的是libhello.lib,在linux系统上完全可以,但cygwin上就是不行,一直以为是gcc 的问题,搞了半
2015-12-08 11:10:37
1877
原创 pip install
Installationinstall easy_install download easy_install python ez_setup.py install pip download pip python setup.py install一般python msi安装程序自带了pip配置mirror配置文件可选路径Linux/Unix /etc/pip.conf
2015-12-07 11:23:28
1804
原创 分布式原理整理1
CAP理论 一致性(Consistency): all nodes see the same data at the same time A service that is consistent operate fully or not at all. 可用性(Availability): a guarantee that every request receives a respons
2015-11-23 12:04:54
554
原创 linux 定时任务
crond 是个服务sudo service crond status没有详细了解,仅仅做到了会用 设置定时任务,每行一个crondtab -e进入vi 编辑模式 基本格式* * * * * cmd前面的* 分别表示分(1~59)、时(1~23)、日(1~31)、月(1~12)、星期(0~
2015-11-20 18:35:50
329
原创 硬盘分类
硬盘分类介质固态硬盘 固态硬盘(Solid State Disk、IDE FLASH DISK、Serial ATA Flash Disk)是由控制单元和存储单元(FLASH芯片)组成,简单的说就是用固态电子存储芯片阵列而制成的硬盘。它最初使用高速的SLC(Single Layer Cell,单层单元)快闪存储器(以下简称“闪存”)来制造。由于读写闪存不需要传统硬盘磁头的机械式移动,因此利用闪存
2015-11-09 16:49:30
913
转载 vim windows 中文乱码
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vim7.1在windows下的编码设置。By Huadong.Liu""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set encoding=utf-8set fileen
2015-11-09 11:11:28
489
原创 MongoDB 查询非空数组
mongdb非空数组查询 初始数据db.test_tab.insert({array:[]})db.test_tab.insert({array:[1,2,3,4,5]})查询非空//方式一db.test_tab.find({array:{$elemMatch:{$ne:null}}})//方式二db.test_tab.find({$where:"this.array.length>0"}
2015-11-04 16:42:48
3714
原创 MMS Host is unreachable
Centos 上配置mongodb MMS程序,将mongo.mongoUri配置在另一台机器上(Windows) 添加Centos 数据库的监控是,一直出现 Host is unreachable 的错误,chart一直没有数据; Windows的却可以。 处理问题能力有限,过程比较坎坷,后来仔细看了日志,想了想。 在 windows的host上配置了centos 的host,成功!
2015-10-15 17:40:55
797
原创 MongoDB mapReduce操作
mapReduce函数原型db.collection.mapReduce( <map>, <reduce>, { out: <collection>,
2015-10-12 10:07:33
1147
原创 Python set list dict tuple 区别
类型初始化特性关于迭代过程中改变内容set(集合)set()无序,不可重复不允许改变list(列表)list(),[]有序,可重复允许改变dict(字典)dict(),{}无序,键不可重复不允许,迭代keys()/items()允许tuple(元组)tuple(),()
2015-10-12 08:32:15
415
原创 Windows Hadoop 2.6.0编译安装
本文主要参考这篇文档Build, Install,Configure and Run Apache Hadoop 2.2.0 in Microsoft WindowsOS美中不足的是没有给出遇到的问题的解决方案,我就班门弄斧,狗尾续貂。以下是我的编译过程,我所遇到的坑。因为没有截图,所以我尽量详细。软件环境:Hadoop 源码CygwinVisual studio 2010(
2015-10-12 08:32:12
1076
原创 Linux shell 很坑的空格
刚上手,老是报莫名其妙的错,还找不到原因。空格属于比较坑的!!!以下内容转载自:http://www.jb51.net/article/60327.htm1.定义变量时, =号的两边不可以留空格.eg:gender=femal————rightgender =femal———–wronggender= femal———–wrong2.条件测试语句 [ 符号的两边都要留空格.eg:if
2015-10-12 08:32:05
1431
原创 Python cgi windows
学习《python基础教程》Project 6 ,在tomcat中配置了CGITomcat 7官网直接有教程:http://tomcat.apache.org/tomcat-7.0-doc/cgi-howto.html我直接在默认的示例项目中配置的cgi,配置的全局的我采用的默认示例,没有拷贝Jar包。Jar包名字catalina.jar$CATALINA_BASE/conf/web.
2015-10-12 08:32:02
441
转载 MSVCRTD.lib(crtexew.obj) :…
原文地址:: error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainC">MSVCRTD.lib(crtexew.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainC作者:wsc36305一,问题描述MSVCRTD.lib(crtexew.obj) : error LNK2019
2015-10-12 08:32:00
597
原创 Grep 抓不到make 输出
不翻译了,转自stackoverflowThe pipe only connectsthe stdout of make tothe stdin ofgrep. make's stderr isstill connected to the terminal in will therefore be printedwithout filtering.The solution i
2015-10-12 08:31:57
537
原创 YCSB 使用记录
本来是很简单的事,由于我自己第一步就错了,然后事情就变得纠结了。Github clone出源码YCSB或者下载release版我就是第一步没注意,导致悲剧如果是release版,goto 6源码需要JDK和Maven,配置环境变量环境部署好之后,编译(Java用编译好像不太准确)mvn clean package(这个是生成所有支持的dtabase binding)你也可以
2015-10-12 08:31:55
697
原创 visual leak detector&n…
官方地址:https://vld.codeplex.com/直接安装,装好之后就可以直接用了。为你的project添加头文件依赖和库依赖,直接勾选 从父级或默认设置继承就可以了调试运行,在生成目录添加vld_x64.dll文件(该文件在你的安装目录)默认输出结果到调试"输出窗口" 配置文件:安装目录有个vld.ini文件,你可以直接修改(全局作用域)或者拷贝到工程根目录(跟*.v
2015-10-12 08:31:52
438
原创 Mysql alter procedure name
UPDATE`mysql`.`proc`SETname = '',specific_name= ''WHEREdb = ''ANDname= '';如果将该procedure授权给其他用户,你必须同时update表procs_privUPDATE`mysql`.`procs_priv`SETRoutine_name = ''WHEREDb = ''AN
2015-10-12 08:31:50
545
原创 C++ 枚举值转char*
#defineName(value) #value enum{ value_a,value_b, value_c}; printf("%s",Name(value_a)); #操作符解释In function-like macros, a #operator before an identifier in the replacement-list runs theid
2015-10-12 08:31:47
3270
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人