- 博客(31)
- 资源 (27)
- 收藏
- 关注
原创 Sun Studio 12:C++ 用户指南
<br />http://docs.sun.com/app/docs/doc/820-1214/6nctbmf2g?l=zh&a=view<br />
2010-09-11 21:52:00 420
原创 Django的文件上传
<br />找了一些Django上传文件的资料,备忘。<br /><br />前几天,使用Django的FileField的时候发现非常不好用,并不是每一个文件都需要存放在以日期为名称的目录下面。在网上的论坛看到的方法是一个新的类继承FileField,并重载两个方法,但这样做的话就不能重新生成sql语句了,这样有点不爽。后来发现一个方法是重载Model的 _save_FIELD_file方法,这样各个class之间互不影响。而且对文件的生成可以做得极大的控制。比如:上传一个zip文件夹,并解包保存。<br
2010-09-02 08:18:00 540
原创 实例使用NTLM验证整合Squid及Samba3实现AD域用户认证
<br />http://romexp.blog.163.com/blog/static/3610065200762614516829/<br /> <br />Windows的IIS中有项配置使用集成的Windows验证,在AD的环境中我们可以通过启用集成的Windows验证来使用用户登陆Windows 系统的帐号进行认证,在用户访问网页时,IE会将用户的帐号凭据发往服务器自动做认证,不需要用户输入用户名和密码。最好的例子就是用户登陆 Outlook Web Access(OWA)。当我们利用Squid做
2010-09-01 20:25:00 1929 2
原创 域用户验证登陆问题
<br />示例:<br />using System.Runtime.InteropServices; <br /> <br />ExampleClass<br />{<br /> //调用Win32API Import advapi32.dll<br /> [DllImport("advapi32.dll")]<br /> private static extern bool LogonUser( string lpszUsername, string lpszDomain, strin
2010-09-01 20:18:00 730
原创 ASP调用域用户验证
<br />http://dev.firnow.com/course/4_webprogram/webjis/20100710/430491.html<br /> <br /> 第一步,域用户验证,用户登录界面。logon.asp <br /><html> <br /><body><br /><table width="600" height="200" border="0"><br /><tr><td><br /> <form action="chkusr.asp" method="post">
2010-09-01 20:08:00 632
原创 JCIFS
<br />http://www.enet.com.cn/article/2008/0610/A20080610291669.shtml<br /> <br />jcifs是CIFS在JAVA中的一个实现,是samba组织负责维护开发的一个开源项目,专注于使用java语言对cifs协议的设计和实现。他们将jcifs设计成为一个完整的,丰富的,具有可扩展能力且线程安全的客户端库。这一库可以应用于各种java虚拟机访问遵循CIFS/SMB网络传输协议的网络资源。类似于java.io.File的接口形式,在多线程
2010-09-01 19:57:00 477
原创 C#域验证
<br />using System;using System.DirectoryServices;namespace ConsoleApplication1{internal class Program{private static void Main(string[] args){string name = "jim green"; // RDN formatstring logonName = @"xxx/jgreen"; //pre windows 2000
2010-09-01 19:56:00 747
原创 Python扩展方法及工具比较
<br />http://blog.chinaunix.net/u/21908/showart.php?id=2249356<br />一、普通扩展方法<br /> 扩展Python包括三个步骤:<br />1. 创建源程序(C, C++, java, ...);<br />2. 为源程序写wrap代码;<br /> 包括四个步骤:<br />Ø include "Python.h";<br />Ø 为每个模块函数写wrap,即:PyObject* Module_func();<br /
2010-07-18 14:58:00 595
原创 转:编译Python源代码
在日常生活中,Python代码一般是不编译的,几个py文件复制来就能用。再加上脚本语言的名头,有些不太了解Python的朋友就以为Python没有编译这个过程。其实,虽然Python是脚本语言,但它与Java和C#一样,只能执行字节码。只是Python将编译过程隐藏起来,不大明显而已。今天这篇笔记详细记述一下Python的编译过程以及一些技巧。我们一般使用这样的命令运行一个python程序:C:/> python im.py其中,im.py文件的内容是:#!/usr/bin/env pythonimport
2010-07-18 13:11:00 1135
转载 GCC编译优化指南
http://blog.chinaunix.net/u3/110004/showart_2146691.htmlGCC编译优化指南 版权声明本文作者是一位自由软件爱好者,所以本文虽然不是软件,但是本着 GPL 的精神发布。任何人都可以自由使用、转载、复制和再分发,但必须保留作者署名,亦不得对声明中的任
2010-02-07 10:14:00 406
转载 gcc常用的编译选项对代码的影响
原创:alert7(alert7) 来源:http://xfocus.org/ gcc常用的编译选项对代码的影响 by alert7 2001-12-21 测试环境 redhat 6.2 ★ 前言 本文讨论gcc的一些常用编译选项对代码的影响。当然代码变了, 它的内存布局也就会变了,随之exploit也就要做相应的变动。 gcc的编译选项实在太多,本文检了几个最常用的选项。
2010-02-07 10:05:00 408
原创 python读写UCS-2 big/little endian(utf-16-be/utf-16-le)格式的文件
def readFile(path): oFile = file(path, r) line = "" line = oFile.readline() encoding = None lst = [] if line.startswith(/xFF/xFE): encoding = utf-16-le oFile.clos
2010-02-03 14:13:00 7092 2
转载 File Locking Using a Cross-Platform API
File Locking Using a Cross-Platform API 获得平台无关的文件锁 Credit: Jonathan Feinberg, John Nielsen 问题 Problem You need to lock files in a cross-platform way between NT and Posix, but the Python s
2010-01-27 21:04:00 1194
原创 Code Review Tool
/** * * Code Review Tool * * Author: FN QD * * Version: 1.3.0.0 * * Amendment List: * * 2003.1.22 Javey 1) Changed severity level according to the review form * 2) Excluded the cat
2010-01-05 16:57:00 971 4
原创 pymake
#!/usr/bin/env python#coding=utf-8##from __future__ import with_statementimport os,sys,threading,xml.parsers.expat,traceback,re,shutil,subprocess,Queue,timefrom optparse import OptionParserCompiler =
2009-11-19 19:46:00 635 56
转载 Python几种并发实现方案的性能比较
#!/Library/Frameworks/Python.framework/Versions/2.5/bin/python# encoding: utf-8import sys, timeimport thread SLEEP_TIME = 0.0001 def run_benchmark(n, m
2009-11-17 23:11:00 633
转载 Python 线程池
import Queue, threading, sys from threading import Thread import time,urllib # working thread class Worker(Thread): worker_count = 0 def __init__( self, workQueue, resultQueue,
2009-11-17 23:07:00 762
原创 threadpool 10
def __del__(self):## thrd = PoolThread() print pool del self.exit() def exit(self): for thrd in self.__threadList: thrd.exit() self.__threadList
2009-11-09 18:33:00 267
原创 threadpool 9
def start_all_thread(self, target=None, *args, **kwargs): if (self.__freeThread return False rtn = False for thrd in self.__threadList: if thrd.is_runn
2009-11-09 18:25:00 272
原创 threadpool 7
def __notify_free_thread(self, isRunning): print __notify_free_thread with self.__condition: print enter , isRunning if isRunning: self.__fr
2009-11-09 18:24:00 287
原创 threadpool 8
def start_thread(self, wait=True, target=None, *args, **kwargs): print start_thread# thrd = PoolThread() rtn = False with self.__condition: if (self.__fre
2009-11-09 18:24:00 341
原创 threadpool 5
def start(self, isLastRun = True): self.__set_run_event(True) if not self.__started: threading.Thread.start(self) self.__exit = isLastRun def exit(self):##
2009-11-09 18:21:00 211
原创 threadpool 6
class ThreadPool: def __init__(self, threadnum = 5, target=None, *args, **kwargs): threadnum = threadnum if threadnum > 0 else 1 self.__lock = threading.Lock() self.__c
2009-11-09 18:21:00 309
原创 threadpool 4
def __set_run_event(self, running): if self.__RunningEvent.isSet() and (not running): if self.notifyrun: self.notifyrun(running) elif (not self.__RunningEv
2009-11-09 18:12:00 205
原创 threadpool 2
def threadEntry(): global proj for obj in proj: sleepTime = random.randint(1,5); print %s get [%s] and sleep %ss%(threading.currentThread().getName(),obj, sleepTime) time
2009-11-09 18:10:00 315
原创 threadpool 1
class Project: def __init__(self): self.data = range(0,3) self.index = 0 self.lock = threading.Lock() def __iter__(self): return self def set_data_size(self,size):
2009-11-09 10:55:00 264 15
转载 python处理zip文件
转自 http://hi.baidu.com/xunxun129/blog/item/3befad0f8ff992c07bcbe180.html有时我们需要在 Python 中使用 zip 文件,而在1.6版中,Python 就已经提供了 zipfile 模块可以进行这样的操作。不过 Python 中的 zipfile 模块不能处理多卷的情况,不过这种情况并不多见,因此在通常情况下已经足够使用
2009-11-04 23:21:00 501
转载 Python PAMIE示例
转自:http://blog.chinaunix.net/u3/103146/showart_2058891.htmlPython这种脚本语言的强大功能越来越被广大的程序员所重视,这种之前在国内流行度不高的语言近来气势高涨。各种第三方模块层出不穷。 本文介绍的便是一种能非常方便操作IE的第三方工具,PAMIE,他能让你如同写JS一样来操作IE浏览器。包括自动启动,访问链接,设置文本框
2009-11-04 23:09:00 934 1
转载 在后台运行Python脚本服务
原文: http://blog.systemsthoughts.com/tag/python公司不能上其它网站,在这里贴一下.最近写了个GTalk机器人,就一个脚本,但是我需要它24小时在服务器跑着,于是乎在网上搜不被ssh切断的方法。你要是想python robot.py & 是不行的,一旦用户登出,脚本就自动退出了。用at, cron也可以实现不过我发现了一个命令nohup,可
2009-10-30 23:02:00 1653
原创 pywinauto测试
from pywinauto import applicationapp = application.Application.start("notepad.exe")import timetime.sleep(2)app.notepad.TypeKeys("abc")app.Notepad.MenuSelect(u"文件(&F)->另存为(&A)")time.sleep(2)ie = app.wi
2009-10-24 00:33:00 1049
原创 python中文字符串的处理
python中直接将一个中文字符串赋值给一个变量使用的是utf-8格式的编码,以下为证:>>> teststr = 我的eclipse不能正确的解码gbk码!>>> teststr/xe6/x88/x91/xe7/x9a/x84eclipse/xe4/xb8/x8d/xe8/x83/xbd/xe6/xad/xa3/xe7/xa1/xae/xe7/x9a/x84/xe8/xa7/xa3/x
2009-10-23 22:43:00 664
SuperPreviewIE_en.exe
2010-09-06
postgresql-8.4.4-1-windows.part2.rar
2010-08-29
postgresql-8.4.4-1-windows.part1.rar
2010-08-29
postgresql-8.4.4-1-windows.part3.rar
2010-08-29
Django-1.2.1.tar.gz
2010-08-29
psycopg2-2.2.2.rar
2010-08-29
Xplorer2Pro-v1.801H
2010-01-31
E:\My Documents\Visual Studio Projects\PythonTest\PythonTest.rar
2009-12-06
Tkinter reference: a GUI for Python
2009-11-28
PIL-1.1.6.win32-py2.5.exe
2009-10-30
PIL-1.1.6.win32-py2.6.exe
2009-10-30
Komodo-Edit-5.2.1
2009-10-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人