编程语言
拥剑公子
这个作者很懒,什么都没留下…
展开
-
python笔记集合
1.win_64下编译pyd(编译器用的tdm-gcc-5.1)gcc test.c -shared -Ic:\Python27\include -Lc:\Python27\libs -lpython27 -o test.pyd -D MS_WIN64如果没有-D MS_WIN64就会出现错误:undefined reference to `__imp_原创 2017-12-19 20:21:06 · 203 阅读 · 0 评论 -
反编译dtsi
dtsi机制是linux kernel为了适配多设备做出来的模块,产品线拉的较长的话用它来控制最合适不过了。初步阅读了下代码和接口清晰简洁。这个东东出来的时候xml/json应该比较成熟了,疑惑的是为啥不用现成的。 编译与反编译代码:kernel/scripts/dtc/反编译dtb:dtc -I dtb -O dts product1原创 2017-12-16 18:06:46 · 368 阅读 · 0 评论 -
lua学习记录
1.八种数据类型:number,string,boolean,nil,function,table,协程,自定义类型空字符串和数字0是真,false和nil为假2.lua是动态语言,每个变量携带自己的类型,可以运行时类型转换,print(type(my_var))得到类型3.不格式化的字符串:print([[aa]]);print([==[[a]]==]),注释也可以用--[==[和-原创 2017-12-16 18:07:44 · 175 阅读 · 0 评论 -
生成new, old的 shell script
#!/bin/bash#usage: ./create_dts_diff_v2.x.sh path1 path2__new_dir=$1__old_dir=$2#===========================================================#WARNING:#do *NOT* modify below#====================原创 2017-12-16 18:08:30 · 163 阅读 · 0 评论 -
pclint vc6/linux 工程,测试正常
下载:http://www.gimpel.compojie版搜索一下很好找里面有vc6 和linux工程的lnt文件,实际使用可能要修改。http://files.cnblogs.com/files/wjx0912/pc_lint_example.rar原创 2017-12-16 18:10:54 · 163 阅读 · 0 评论 -
libtcc使用问题一二
问题来由:powersniff(参考博客的文章,在qq群下载最新版本)目前使用lua作为分析插件,但熟练lua的人不多。所以,移植python和tcc两类语言作为插件。tcc(即tiny c),http://bellard.org/tcc/,网站上的资料很丰富将c语言作为脚本给程序调用是个不错的思路,可变逻辑部分由用户编写c语言。 问题1原创 2017-12-16 18:11:20 · 1148 阅读 · 0 评论 -
vs2013 v8编译
最新v8,只能在vs2015编译(在官网看了资料,新版本v8/chrome使用的c++11特性只能用vs2015编译)vs2015 vc需要的dll有近50个,发布不太方便,所以采用vs2013update5编译 版本发布日期 5.8.3012017.3.1 5.7.5142017.1.19 5.6.331原创 2017-12-26 09:12:49 · 418 阅读 · 0 评论 -
boost asio死锁一例
socket close -> sendmessage -> io_service stop先关闭socket句柄,再给windows窗口发送消息,然后io_service停止。当sendmessage发送消息后,会和io_service造成死锁,估计原因io_service内部实现阻塞了windows某对象。原创 2017-12-26 09:18:20 · 641 阅读 · 0 评论 -
一个不错的多叉树, stl风格
tree tr9;tree::pre_order_iterator iter1;tr9.set_head("hi");tr9.insert_after(tr9.begin(), "a");tr9.insert_after(tr9.begin(), "b");tr9.append_child(tr9.begin(), "0");tr9.append_child(tr9.beg原创 2017-12-27 15:12:59 · 545 阅读 · 0 评论 -
github上用golang写的项目
1.moby/mobydocker的新马甲2.kubernetes/kubernetes分布式容器管理3.grafana/grafana一个可视化面板,有漂亮的仪表盘,多种数据来源,适合做系统监控4.coreos/etcd集群共享信息,服务与发现5.astaxie/beego一个快速开发Go原创 2017-12-27 15:17:37 · 1034 阅读 · 0 评论 -
C++几个技巧:智能指针在消息传递中的使用,元组,及lambda删除器
1.SendMessage/PostMessage中传递对象参数(1)方法1:使用shared_ptr发送端:PostMessage(MyhWnd, CWM_SOME_ERROR, 0, reinterpret_cast(new string(the_exception.error_string)) );接收端:LPARAM CMyDlg::OnMyMessage1(W原创 2017-12-27 15:19:37 · 2073 阅读 · 0 评论 -
C++11中std::move的使用
http://blog.csdn.net/fengbingchun/article/details/52558914https://www.cnblogs.com/ldlchina/p/6608154.html转载 2018-01-16 14:05:27 · 315 阅读 · 0 评论 -
golang接口查询和对象类型查询
参考文章:https://blog.csdn.net/Nick_666/article/details/79199680总结:if1.(*MyStruct) 查询接口指向的对象实例是否是*MyStruct类型if2.(MyInterface) 查询接口指向的对象实例是否实现了MyInterface接口,要在运行期确定...原创 2018-03-23 15:11:02 · 1353 阅读 · 0 评论 -
阿里云短信使用
1.打开阿里云短信官网:https://dysms.console.aliyun.com/dysms.htm#/develop/api2.点按钮‘AccessKey’,出现告警对话框:(1)继续使用AccessKey:这是登录账号的秘钥,有全部权限,不建议使用,如果一定要用,里面有Access Key ID和Access Key Secret(2)开始使用子用户AccessKey:创建一个子用户,...原创 2018-03-19 20:33:03 · 536 阅读 · 0 评论 -
goland配置golint
(1)把golint拷贝到C:\Go\bin(2)打开setting对话框设置:ProgramC:\Go\bin\golint.exeArguments$FilePath$Working directory$ProjectFileDir$(3)设置一个快捷键,如下图以后按CTRL+L就开始golint检查了...原创 2018-03-23 22:08:13 · 7082 阅读 · 2 评论 -
dlfcn-win32 for mingw
project website: https://github.com/dlfcn-win32/dlfcn-win32download, then create config.mak, content:PREFIX=C:\MinGWBUILD_STATIC=yesCC=gccAR=arRANLIB=ranlibrun command "make", then copy dlfcn.h t...原创 2018-03-21 11:22:06 · 3036 阅读 · 1 评论 -
kubenetes安装记录和要点
在官网web上进行kubenetes测试:kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port=8080kubectl...原创 2018-04-04 10:16:52 · 964 阅读 · 0 评论 -
lua遍历文件夹, zerobrane下载
参考的这个http://www.cnblogs.com/jiufangding/p/3931585.html,配合批处理。 zerobrane下载(上一篇博客忘掉了):http://files.cnblogs.com/files/wjx0912/ZeroBraneStudio1.0%282015.3.13%29.rar 截图:原创 2017-12-15 14:51:27 · 297 阅读 · 0 评论 -
windows端加密程序,lua代码,ZeroBrane调试
发一个自己改的zerobrane版本(启动中文,快捷键改成和一样:F5启动调试,F9断点,F10逐过程,F11逐语句,F12跳出函数)在zerobrane 1.0(2015.3.13)发布的基础上改的(1) 加密重要资源,完全用批处理编写:@echo offset openssl_exe=C:\GitStack\git\bin\openssl.exe原创 2017-12-15 14:50:27 · 271 阅读 · 0 评论 -
lua的栈
lua的栈是从栈底到栈顶:lua_pushstring(L, "test1");lua_pushstring(L, "test2");lua_pushstring(L, "test3");lua_pushstring(L, "test4");栈如下:原创 2017-12-19 20:22:15 · 185 阅读 · 0 评论 -
VC_MFC水波纹控件,开源
代码和效果图:https://github.com/wjx0912/MfcWaterEffect 效果图集成以下5个文件即可:watereffect\DIB.hwatereffect\DIB.cppwatereffect\stdex_vector.hwatereffect\WaterEffect.hwatereffect\WaterE原创 2017-12-19 20:23:01 · 594 阅读 · 2 评论 -
windows github 命令行使用
1.下载git客户端工具,以下2个网站一样的https://git-for-windows.github.io/https://git-scm.com/download/win/2.初始化ssh-keygen -t rsa -C "weiqi5@qq.com" 有输入的全部回车3.网站配置转到github网站上去配置一下ssh key,点击箭头指示的三角图标原创 2017-12-19 20:26:21 · 907 阅读 · 0 评论 -
protobuf 数据解析的2种方法
方法1:message person{required int32 age = 1;required int32 userid = 2;optional string name = 3;} message test{required int32 time = 1;required int32 userid = 2;requir原创 2017-12-19 20:28:43 · 2488 阅读 · 0 评论 -
MFC resizer封装
用法:#include "resizer.h"在mfc对话框头文件里面添加成员:CResizer m_Resizer;mydialog.cpp里面:OnInitDialog(){ ...... // TODO: 在此添加额外的初始化代码 m_Resizer.Initialize(*this, CRect(0,原创 2017-12-19 20:29:41 · 239 阅读 · 0 评论 -
ChartDirector 6.0在MFC下乱码问题
1234XYChart *c = new XYChart(640, 350);char buffer1[256] = "";UnicodeToUtf8(L"Realtime Chart with Zoom/Scroll and Track Line测试", buffer1);c->addTitle(buffer原创 2017-12-19 20:30:55 · 298 阅读 · 0 评论 -
node.js环境安装,及连接mongodb测试
1.node.js环境安装npm config set python python2.7npm config set msvs_version 2013npm config set registry https://registry.npm.taobao.orgnpm config list2.mongodb-3.2.9测试(配置了用户名密码)var原创 2017-12-19 20:31:27 · 215 阅读 · 0 评论 -
golang开发环境(2016.9.16)
一.windows下安装1.下载go1.7.3.windows-amd64.msi,建议默认安装到‘C:\Go\’2.环境变量变量值说明PathC:\Go\bin安装程序默认会设置,如果用zip方式安装则手动设置GOROOTC:\Go\安装程序默认会设置,如果用zip方式原创 2017-12-20 23:34:03 · 156 阅读 · 0 评论 -
Golang里面使用protobuf(proto3)
参考文章:https://developers.google.com/protocol-buffers/docs/gotutorial 1.下载protoc,地址https://github.com/google/protobuf/releases,里面可以找到win/linux/mac的二进制文件, 我们需要protoc-3.4.0-win32.zip或者protoc-3.4.0原创 2017-12-20 23:34:59 · 3360 阅读 · 0 评论 -
golang下的grpc
facebook的thrift也是开源rpc库,性能高出grpc一倍以上,grpc发展的较晚,期待以后有长足的进步。简单来说thrift = grpc + protobufgRPC基于HTTP/2标准设计,带来诸如双向流控、头部压缩、单TCP连接上的多复用请求等特性。这些特性使得其在移动设备上表现更好,更省电和节省空间占用。要求:go version 版本最好1.7以上原创 2017-12-20 23:37:22 · 191 阅读 · 0 评论 -
android的ArrayMap类
运行的时候出现:java.lang.NoClassDefFoundError: android.util.ArrayMaphttp://stackoverflow.com/questions/24574323/crash-with-android-4-1-with-arraymap找到的答案:ArrayMap was introduced in Api le原创 2017-12-15 14:54:05 · 265 阅读 · 0 评论 -
go语言的命令行库
命令行应用通常很小,程序猿们也不喜欢为它编写注释。所以一些额外的工作,如解析参数有个合理的库来帮忙做就好了。https://github.com/urfave/cli 这个项目因此而生。安装:go get github.com/urfave/cli以下的例子均来自官网:(例1)package mainimport ( "os" "github.com/原创 2017-12-21 19:26:21 · 312 阅读 · 0 评论 -
golang: 根据json生成go源文件
https://github.com/ChimeraCoder/gojson $ git clone https://github.com/ChimeraCoder/gojson.git$ cd gojson$ go build -o _build/gojson ./gojson$ cp _build/gojson ~/bin/$ curl -s https://a原创 2017-12-21 19:29:27 · 214 阅读 · 0 评论 -
开机自动执行脚本 与 update-rc.d
http://coderbee.net/index.php/linux/20130524/141 update-rc.d script_name defaultsupdate-rc.d script_name removeupdate-rc.d -f script_name remove原创 2017-12-22 14:45:12 · 530 阅读 · 0 评论 -
Understanding Chan Chan's in Go
转自老外的文章:http://tleyden.github.io/blog/2013/11/23/understanding-chan-chans-in-go/ A channel describes a transport of sorts. You can send a thing down that transport. When using a chan chan, the原创 2017-12-22 14:48:20 · 239 阅读 · 0 评论 -
利用golang语法检查对象是否实现了接口
var _ ipc.Server = &CenterServer{}CenterServer是否实现了 ipc.Server的接口。编译期间检测,这是很好的编程实践。稍后详述。。。原创 2017-12-22 14:49:05 · 1103 阅读 · 0 评论 -
消除vc中未使用参数(或变量)的警告
UNREFERENCED_PARAMETER(aaa);原创 2018-09-20 18:05:57 · 1437 阅读 · 0 评论