[置顶] 用Erlang写一个抓写真图片的程序

摘要: Erlang 阅读全文
posted @ 2012-06-17 21:35 盐味 阅读(902) 评论(0) 推荐(0) 编辑

docker ls: cannot open directory .: Permission denied

摘要: down vote From access.redhat.com:Sharing_Data_Across_Containers:" Host volume settings are not portable, since they are host-dependent and might not ... 阅读全文
posted @ 2015-05-29 22:15 盐味 阅读(3126) 评论(0) 推荐(0) 编辑

Python url_escape

摘要: escape.py# -*- coding: utf8 -*-import sysif type('') is not type(b''): def u(s): return s bytes_type = bytes unicode_type = str bas... 阅读全文
posted @ 2014-06-26 21:24 盐味 阅读(1950) 评论(0) 推荐(0) 编辑

Lua 查看栈的宏

摘要: LUA C API 阅读全文
posted @ 2013-10-18 20:11 盐味 阅读(899) 评论(0) 推荐(0) 编辑

windows7 开热点

摘要: netsh wlan set hostednetwork mode=allow ssid=名称 key=密码netsh wlan start hostednetworknetsh wlan stop hostednetwork 阅读全文
posted @ 2013-06-25 16:06 盐味 阅读(175) 评论(0) 推荐(0) 编辑

rabbitmq客户端pika一个channel消费多个queue

摘要: 我们知道rabbitmq在一个connection中可以声明多个channel, 一个channel可以供给一个线程来安全的使用, 而一个channel是可以同时从多个队列接收数据的,我们称为消费多个queue, 那么在python客户端pika中, 如果一个channel消费多个queue, 对不同的消费是否可以执行不同的callback呢? 为了验证这个, 写了这么一个测试代码test_queue_send.py# -*- coding: utf-8 -*-from packages.rabbit import tornado_connimport timeimport pikaimpor 阅读全文
posted @ 2013-05-05 21:12 盐味 阅读(2126) 评论(0) 推荐(0) 编辑

Google v8实现类似nodejs的import加载模块

摘要: 希望在Cooper中加入模块搭建的机制, 参考了Nodejs中exports,import的机制,觉得他弄得复杂了些, 就自己试着写了个简单的有这些文件:makefilev8test: \ v8test.cpp g++ \ v8test.cpp \ -o v8test \ -I/usr/local/include -L/usr/local/lib -lv8v8test.cpp#include <v8.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include... 阅读全文
posted @ 2013-04-16 00:08 盐味 阅读(2177) 评论(1) 推荐(0) 编辑

Python 让对象能被转化为dict

摘要: # -*- coding: utf-8 -*-class MyClass(object): """docstring for MyClass""" def __init__(self, attr1, attr2, attr3): self.attr1 = attr1 self.attr2 = attr2 self.attr3 = attr3 def __iter__(self): attrs = dir(self) for attr in attrs: if attr.find('__... 阅读全文
posted @ 2013-04-03 16:34 盐味 阅读(542) 评论(0) 推荐(0) 编辑

linux 查看磁盘

摘要: 查看磁盘使用情况df -h查看当前文件夹大小du -sh * 阅读全文
posted @ 2013-03-21 16:22 盐味 阅读(140) 评论(0) 推荐(0) 编辑

Erlang term to string

摘要: R = io_lib:format("~p",[yourtermhere]),lists:flatten(R). 阅读全文
posted @ 2013-02-14 17:29 盐味 阅读(199) 评论(0) 推荐(0) 编辑

Erlang port communicate with python

摘要: 只保留核心代码, 看起来方便。erlang代码-module(port_test).-export([start/0, send/1, stop/0]).start() -> Fun = fun() -> register(?MODULE, self()), Port = open_port({spawn, "./port_test.py"}, [{packet, 2}]), %% {packet, 2} loop(Port) ... 阅读全文
posted @ 2012-12-26 00:38 盐味 阅读(327) 评论(0) 推荐(0) 编辑