- 博客(22)
- 收藏
- 关注
原创 Python 获取本地IPV6地址
可以通过访问http://ipv6.bupt.edu.cn/cgi-bin/showip.pl,获取IPV6地址def get_Local_ipv6_address(): """ Get local ipv6 """ pageURL='http://ipv6.bupt.edu.cn/cgi-bin/showip.pl' content=urllib2.ur
2012-02-13 09:48:13
6186
转载 机器学习和计算机视觉相关的数学
<br />机器学习和计算机视觉相关的数学<br /> <br />(以下转自一位MIT牛人的空间文章,写得很实际:)<br />作者:Dahua<br />感觉数学似乎总是不够的。这些日子为了解决research中的一些问题,又在图书馆捧起了数学的教科书。从大学到现在,课堂上学的和自学的数学其实不算少了,可是在研究的过程中总是发现需要补充新的数学知识。Learning和Vision都是很多种数学的交汇场。看着不同的理论体系的交汇,对于一个researcher来说,往往是非常exciting的enjoyab
2011-02-15 16:33:00
817
原创 Python邮件通知本地外网IP
<br />每天去公司、去实验室,又想用宿舍电脑上的资料,SSH、远程自然是不二选择。但是每次开机CMD,IPCONFIG自己的IP有点太麻烦,还是用强大Python来方便自己吧。<br />Python代码如下,保存为PYW文件,添加到开机启动项,开机后登陆用户,便可获取自己外网IP,邮件通知指定邮箱。<br /> <br />#!/usr/bin/env python# -*- coding:utf-8 -*-# -*- coding: gbk -*-#导入smtplib和MIMEText
2010-12-06 15:25:00
1840
原创 python端口扫描
<br />今天远程自己宿舍笔记本,发现忘了看一下自己的IP地址,还好宿舍的IP是外网的,网段我也知道,找了段Python代码,道理比较简单,尝试Soket连接3389,连接成功说明端口开放,否则说明没有开远程服务。随便修改了一下就ok了,代码如下,最终得到自己的IP地址。<br />#!/usr/bin/env pythonimport socketif __name__=='__main__': port=3389 s=socket.socket() for cn
2010-12-06 15:08:00
5005
转载 控件之Radio Button:MFC中Radio Button使用方法
<br /><br />先为对话框加上2个radio button,分别是Radio1和Radio2。<br />问题1:如何让Radio1或者Radio2默认选上?如何知道哪个被选上了?<br /><br />关键是选上,“默认”只要放在OnInitDialog()即可。三种方法可以让它选上,<br />第一种:<br />((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(TRUE);//选上<br />((CButton *)GetDlgItem(I
2010-10-30 17:09:00
4543
转载 使用opencv简单添加文本
<br />#include "stdafx.h"#include "cv.h"#include "highgui.h"#pragma comment (lib, "cv210d.lib")#pragma comment (lib, "cvaux210d.lib")#pragma comment (lib, "cxcore210d.lib")#pragma comment (lib, "highgui210d.lib")void cvText(IplImage* img, con
2010-10-08 21:39:00
1372
4
原创 编译错误 winnt.h(236)
<br /> <br />今天编译opencv一段程序,VS报出了很让人摸不着头脑的错误,系统Win7,VS2008环境,错误信息如下:<br />1>------ 已启动生成: 项目: OpenCV, 配置: Debug Win32 ------1>正在编译...1>Global.cpp1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)1>f:/program files/microsoft sdks/windows/v6
2010-09-05 10:40:00
2465
2
原创 opencv:fatal error LNK1104: 无法打开文件“python26_d.lib” 问题解决
今天在Win7下,使用VS2008安装配置opencv2.1,编译结果总是24个成功,1个失败,跳过3个,错误提示是:fatal error LNK1104: 无法打开文件“python26_d.lib” ,由于错误没有生成需要的文件。错误的原因是系统安装有Python2.6,而默认的情况下Python是不提供python26_d.lib和python26_d.dll文件的。为了编译通过,需要在网上下载此二文件。优快云的下载地址请点击这里。将下载的lib文件置于X:/Program Files/Micro
2010-09-03 20:07:00
15343
1
原创 Python OpenCV 2.1 Ubuntu packages
Python OpenCV 2.1 Ubuntu packagesYesterday OpenCV 2.1 was released. There are not many new features, this is more a stability update. Last week I did an update of my OpenCV 2.0 Ubuntu packages so they include the new Python API. I'm happy I did this, since
2010-07-29 21:05:00
1747
原创 Excise 3.2 Matric Operation
Excise 3.2 2010-07-272. Th is exercise will accustom you to the idea of many functions taking matrix types.Create a two-dimensional matrix with three channels of type byte with data size100-by-100. Set all the values to 0.a. Draw a circle in the matr
2010-07-27 17:36:00
577
转载 OpenSSH实现Windows和Linux文件安全传输
OpenSSH实现Windows和Linux文件安全传输考虑到windows和Linux系统间的文件实现安全传输,就准备采用ssh来实现,OpenSSH有windows和Linux的实现并免费,当然要用它了。本例中使用windows(ip:192.168.1.25)来做客户端,Linux(ip:192.168.1.26)来做服务器。在Linux中安装ssh服务,这里就不讲了。1.下载OpenSSH : http://sshwindows.sourceforge.net/ 并安装。默认安装目录为C:Progr
2010-07-26 10:27:00
846
原创 【自用】Ubuntu 安装后配置
【自用】Ubuntu 安装后配置<br />1. 开启SSH服务<br /> <br />网上有很多介绍在Ubuntu下开启SSH服务的文章,但大多数介绍的方法测试后都不太理想,均不能实现远程登录到Ubuntu上,最后分析原因是都没有真正开启ssh-server服务。最终成功的方法如下:<br />sudo apt-get install openssh-server<br />Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用apt-get安装上即可。
2010-07-26 10:25:00
902
原创 PYTHON的程序在LINUX后台运行
<br /> PYTHON的程序在LINUX后台运行1.nohup 命令<br />nohup <br /> nohup 命令 <br /> 用途:LINUX命令用法,不挂断地运行命令。 <br /> 语法:nohup Command [ Arg ... ] [ & ] <br /> 描述:nohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令,忽略所有挂断(SIGHUP)信号。在注销后使用 nohup 命令运行后台中的程序。要运行后台中的 nohup 命令,添加 & (
2010-07-25 15:50:00
29302
原创 Debian 设置apt源和apt代理
<br />$ vim /ect/apt/sources.list<br />------<br />#北邮<br />#deb [url]ftp://openware.byr.edu.cn/pub/mirror/debian/debian[/url] lenny main non-free contrib<br />#deb-src [url]ftp://openware.byr.edu.cn/pub/mirror/debian/debian[/url] lenny main non-fr
2010-07-22 22:55:00
3845
转载 GetWindowRect与GetClientRect
<br /> GetWindowRect与GetClientRect<br /> <br /><br />先调用GetWindowRect后再调用ScreenToClient,这个时候得到的rect和直接使用GetClientRect得到的值是相等的。<br />有时候需要获得窗口矩形的大小和客户区矩形的大小二者的值,故需要分别调用GetWindowRect和GetClientRect。<br />如果只需要获得客户区矩形的大小,调用GetClientRect就行了。<br />GetWindowRect和
2010-07-18 11:50:00
1427
转载 用python实现自动扫雷机
<br />用python实现自动扫雷机<br />先说下原理,原理其实很简单,设法获得“雷区”的数据,然后通过模拟鼠标动作,点击雷区上非地雷的的格子,就搞定了:) 所以技术难点只有三个:获得雷区数据、找到扫雷程序和模拟鼠标动作。 <br />先说简单的,找到扫雷程序。通过win32gui.FindWindow("扫雷", "扫雷") 就可以找到扫雷程序的主窗体了,很简单吧。FindWindow这个API参数含义参看MSDN. <br />然后是模拟鼠标点击动作,这也很简单,通过win32api.SendM
2010-07-18 11:48:00
4801
原创 Python使用win32gui.SetWindowPos置顶窗口
Python使用win32gui.SetWindowPos置顶窗口<br />1. SetWindowPos() API函数介绍<br /> SetWindowPos 函数功能:该函数改变一个子窗口,弹出式窗口式顶层窗口的尺寸,位置和Z序。子窗口,弹出式窗口,及顶层窗口根据它们在屏幕上出现的顺序排序、顶层窗口设置的级别最高,并且被设置为Z序的第一个窗口。 函数原型:BOOL SetWindowPos(HWN hWnd,HWND hWndlnsertAfter,int X,int Y,int cx
2010-07-15 17:19:00
24359
1
原创 Draw Line
<br />import win32guidef draw_line(x1,y1,x2,y2): hwnd=win32gui.WindowFromPoint((x1,y1)) hdc=win32gui.GetDC(hwnd) x1c,y1c=win32gui.ScreenToClient(hwnd,(x1,y1)) x2c,y2c=win32gui.ScreenToClient(hwnd,(x2,y2)) win32gui.MoveToEx(hdc,x1
2010-07-08 16:01:00
836
原创 win32gui Member Function
win32gui.WindowFromPointint = WindowFromPoint(point)Retrieves a handle to the window that contains the specified point. Parameters point : (int, int) The point.
2010-07-08 15:38:00
1180
原创 Python Drawing Demo Using Win32gui
<br /># The start of a win32gui generic demo.# Feel free to contribute more demos back ;-)import win32gui, win32con, win32apiimport time, math, randomdef _MyCallback( hwnd, extra ): hwnds, classes = extra hwnds.append(hwnd) classes[w
2010-07-08 15:18:00
2003
原创 Use python win32gui for drawing
import win32guifrom re import matchdef draw_line(): print 'x1,y1,x2,y2?' s=raw_input() if match('/d+,/d+,/d+,/d+',s): x1,y1,x2,y2=s.split(',') x1=int(x1) y1=int(y1) x2=int(x2) y2=int(y2)
2010-07-08 15:01:00
4327
原创 Python Device Notify
# Demo RegisterDeviceNotification etc. Creates a hidden window to receive# notifications. See serviceEvents.py for an example of a service doing# that.import sys, timeimport win32gui, win32con, win32api, win32fileimport win32gui_struct, winnt
2010-07-08 14:21:00
2272
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人