song_cai_csdn
码龄16年
关注
提问 私信
  • 博客:156,811
    问答:7,200
    164,011
    总访问量
  • 130
    原创
  • 2,079,612
    排名
  • 35
    粉丝
  • 0
    铁粉

个人简介:程序猿

IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:江苏省
  • 加入CSDN时间: 2009-03-21
博客简介:

程序猿进化史

博客描述:
好记性不如烂笔头
查看详细资料
个人成就
  • 获得19次点赞
  • 内容获得3次评论
  • 获得51次收藏
创作历程
  • 16篇
    2016年
  • 130篇
    2015年
  • 1篇
    2014年
成就勋章
TA的专栏
  • leetcode
    3篇
  • Java
    4篇
  • Android
    1篇
  • C++
    36篇
  • mongodb
    20篇
  • bat
    2篇
  • Linux
    12篇
  • 数据库
    3篇
  • NODEJS
    2篇
  • 记录
    20篇
  • 术语
    3篇
  • Windows
    1篇
  • python
    10篇
  • 日常
    5篇
  • docker
    1篇
  • 分布式
兴趣领域 设置
  • 运维
    jenkinsdevops自动化运维开发
  • 服务器
    linuxcentos
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

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 ·
1023 阅读 ·
2 点赞 ·
0 评论 ·
0 收藏

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 ·
877 阅读 ·
1 点赞 ·
0 评论 ·
0 收藏

generator 生成杨辉三角

摘录自廖雪峰 python3 生成器 generator和函数的执行流程不一样。函数是顺序执行,遇到return语句或者最后一行函数语句就返回。而变成generator的函数,在每次调用next()的时候执行,遇到yield语句返回,再次执行时从上次返回的yield语句处继续执行。 看到一个比较巧妙的办法def triangles(): nlist=[1] while True:
转载
发布博客 2016.03.31 ·
1377 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

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 ·
488 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

HTTP Header 详解

原文链接找不到了,给个转载的链接HTTP Headerw3c官网Header Field DefinitionsHTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议。HTTP协议采用了请求/响应模型,浏览器或其他客户端发出请求,服务器给与响应。就整个网络资源传输而言,包括message-header和message-body两部分。首
转载
发布博客 2016.03.28 ·
404 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

archlinux 入坑记

其实已经写了两次,但是remarkble保存的时候总是坑,索性卸载,转投retext.(atom安装太慢)安装前在vmware上尝试了下,但实际安装过程中还是问题不断。分区 cfdisk比parted更好用mirrorlist 使用163 mirrorsfstab校验 自动生成fstab自后校验,我没用看,导致安装之后重启找不到引导grub-install 安装grub的时候最后指定
原创
发布博客 2016.03.27 ·
704 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

Recursion 8.3

Write a method that returns all subsets of a set.// =====================================================================================//// Filename: 8_3.cpp//// Description: a method
原创
发布博客 2016.03.22 ·
361 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Recursion 8.4

Write a method to compute all permutations of a string.// =====================================================================================//// Filename: 8_4.cpp//// Description: a m
原创
发布博客 2016.03.22 ·
319 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Recursion 8.5

Implement an algorithm to print all valid (e.g., properly opened and closed) combinations of n-pairs // =====================================================================================////
原创
发布博客 2016.03.22 ·
371 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

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 ·
412 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

字符串分割

#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 ·
299 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

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 ·
650 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

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 ·
837 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

不定义该运算符或到预定义运算符可接收的类型的转换

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 ·
15748 阅读 ·
3 点赞 ·
0 评论 ·
4 收藏

常用工具

格式化代码—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 ·
508 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

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 ·
550 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

python 正则匹配到特定字符串,并删除字符串所在的行,并且返回所在行的第一个数字ID

答:
 # _*_ coding:utf-8 _*_


def get_math_line(source):
    # re chinese
    # 源文件编码需要指定
    source = source.decode('gb2312')
    pattern = '(\d*).*(受到.*影响)'
    pattern = pattern.decode('utf-8')
    import re
    prog = re.compile(pattern)
    result = prog.search(source)
    if result:
        return result.group(1), result.group(2)
    else:
        return None

with open('source.txt', 'rb') as src_file:
    with open('dest.txt', 'w') as dst_file:
        for line in src_file.readlines():
            val = get_math_line(line)
            if val:
                print "%s 匹配到 %s" % (val[0].encode('utf-8'), val[1].encode('utf-8'))
            else:
                dst_file.write(line.strip('\n'))
回答问题 2015.12.24

python 正则匹配到特定字符串,并删除字符串所在的行,并且返回所在行的第一个数字ID

答:
# _*_ coding:utf-8 _*_
def get_math_line(source, keyword):
    # re chinese
    # 源文件编码需要指定
    source = source.decode('gb2312')
    pattern = '((\d)*).*' + keyword
    pattern = pattern.decode('utf-8')
    import re
    prog = re.compile(pattern)
    result = prog.search(source)
    return result.group(1) if result else None

with open('source.txt', 'rb') as src_file:
    with open('dest.txt', 'w') as dst_file:
        for line in src_file.readlines():
            val = get_math_line(line, '受到雾霾影响')
            if val:
                print val
            else:
                dst_file.write(line.strip('\n'))

回答问题 2015.12.24

Java无符号数

java是没有无符号数,当其他无符号数经java解析之后,可能就会出问题。经过查询,一般有两种解决方案: 1. 如果在Java中进行流(Stream)数据处理,可以用DataInputStream类对Stream中的数据以Unsigned读取。(没试过,不了解) 2. 进行扩展、位运算 无符号出现问题只有在最高位为1的时候,最高位在有符号数中表示正负号,直接转换会产生负数。如果使得原本的无符号
原创
发布博客 2015.12.14 ·
6299 阅读 ·
1 点赞 ·
1 评论 ·
4 收藏

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 ·
1866 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏
加载更多