自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

星云的工作间

零星技术问题

  • 博客(93)
  • 收藏
  • 关注

原创 截取Chrome下载的mp3

帮人在网上找到首歌,但是现在的网站一般都不直接支持下载mp3,但是却可以在线听歌,其实浏览器一般都在后台把音乐流下载成本地文件放在临时文件夹里。以前用IE的时候一般都在Temporary Internet Files文件夹里,这次是在Mac上用的Chrome,所以位置和用的命令稍微有些不同: * Chrome的流媒体缓存文件夹: Windows Vista: C:\Users[USERNAME]

2017-02-04 14:35:15 3181

原创 install MySQLdb for python

<br />因为我的mysql是绿色安装的,而MySQLdb的setup.py需要访问注册表获得mysql安装路径,用easy_install MySQL-python时会出现file not found 之类的错误(直接下载package后python setup.py build也一样)。<br /> <br />解决的方法是手动添加注册表键值:<br />HKLM/SOFTWARE/MySQL AB/MySQL Server 5.1/<br />"Location"="path/to/your/mys

2011-05-08 11:51:00 4172

原创 python threading & lambda

<br />多线程时操作时需要注意到传入lambda表达式的变量是在运行时动态取值的,所以它很可能跟你在定义lambda时的值不一样。举个例子<br />>>> def func(x): print x>>> for x in range(1,10): threading.Thread(target=lambda:func(x)).start() 223456789<br />而实际上我们期望的是123456789没有重复和缺失,而且这段代码可能每次跑出来的结果还不一样,这就是因为主

2011-05-07 22:38:00 5332

原创 debug python

<br />一篇简洁明了的文章:<br />http://pythonconquerstheuniverse.wordpress.com/category/the-python-debugger/<br /> <br />这里简单摘录一些<br />1. 在代码里停下等待调试:<br />   import pdb<br />   <br />加入pdb.set_trace()<br /> <br />2. 单步执行:<br />n<br /> <br />3. 运行python代码:<br />!b='B

2011-05-02 19:14:00 2755

原创 Mac,获得用户uid

<br />因为要在虚拟的mac上安装vmware tools后修改VMware tools的services.sh文件:<br />mount -t vmhgfs -o uid=<XXX> .host:/ '/Volumes/Shared Folders'<br /> <br />XXX是用户的uid,可以通过下面命令查看机器所有用户uid:<br />dscl . -list /Users UniqueID<br /> 

2011-02-13 22:24:00 4282

原创 php_mysql.dll load error

<br />重装系统后启动apache,发现mysql模块没有装载,<br />error.log显示:<br />PHP Warning:  PHP Startup: Unable to load dynamic library 'D://Develop//php5//ext//php_mysql.dll' - The specified module could not be found./r/n in Unknown on line 0<br /> <br />原因其实是php_mysql.dll依赖

2011-02-13 19:04:00 2236

原创 Use Facebook Lint Tool to flush FB's page cache

<br />原文来自<br />http://hypertransitory.com/blog/2010/10/29/getting-your-facebook-share-out-of-facebook-cache-hell-2/<br /> <br />感谢该文作者,我才把fb上的这个缓存问题搞定。<br /> <br />之前碰到的问题是post fb link的时候总是失败,我研究了一下发现是原来放在header里面的og:标签的问题,在测试服务器上全部移除(现在不用所以也没去看具体是哪个标签的问题

2010-11-27 18:17:00 1953

原创 PHP Encoding

<br />为了避免乱码,我一般都用utf8编码,在cakephp开发过程中,需要注意的地方:<br /> <br />1. database.php,连接数组里面加上'encoding'=>'utf8'<br />2. core.php,确认有Configure::write('App.encoding', 'UTF-8');<br />response header不用专门设置<br />3. meta tag:<br /><meta http-equiv="Content-Type" content=

2010-11-27 16:53:00 2559

原创 Transfer method for Cakephp

<br />Sometimes we need to redirect the request to a different controller and different action but do not want to change the current incoming url, which the "redirect" does but we actually want to hide our internal dispatching flow from clients, then we ne

2010-11-21 16:06:00 1616

转载 [转]SQL Server FOR XML PATH 语句的应用

<br />SQL Server FOR XML PATH 语句的应用<br /><br />经常在论坛看到高手使用了 for xml path,由于是搜索一下,记录了详细的使用方法。<br />在SQL Server中利用 FOR XML PATH 语句能够把查询的数据生成XML数据,下面是它的一些应用示例。<br /><br /><br /><br />DECLARE @TempTable table(UserID int , UserName nvarchar(50));<br />insert in

2010-11-10 12:40:00 2413 1

原创 customize cookie component in cakephp

<br />cake 的cookie component功能不错,只是有一个地方不符合我今天的需求:序列化数组。原有的_implode和_explode方法只支持2层数组的序列化,而我需要在cookie里面放进去一个多层数组,其实只要稍微改动了一点点就可以改成用json的格式了,步骤如下:<br />1. copy 一份cookie.php从libs里面到网站的app/controllers/components目录下<br />2. 修改_implode和_explode函数,代码很简单:<br />fu

2010-10-21 21:26:00 2197

原创 PHP: Get client IP &amp; Upload files with CURL

Get client IP: function get_ip_address() {     foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {         if (array_key_exists($

2010-10-17 15:28:00 2301

原创 Enable Apache2 mod_status

<br />The steps to enable the status mod and info mod of apache2 on ubuntu:<br />1. a2enmod status<br />    a2enmod info<br />2. cd /etc/apache2/mods-enabled/<br />    vi status.conf to add a line<br /> ExtendedStatus On<Location /server-status>...</

2010-08-25 22:05:00 3127

原创 T-SQL: 取日期

只取日期部分的值

2010-08-23 17:57:00 1862

原创 iPhone :把app的参数设置整合到系统的设置菜单里

iPhone :把app的参数设置整合到系统的设置菜单里

2010-07-21 23:17:00 3051

原创 Setup Apache2+Php5+Mysql+Cakephp on Ubuntu Server 10.04

Setup Apache2+Php5+Mysql+Cakephp on Ubuntu Server 10.04

2010-07-17 17:17:00 2801

转载 ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps

<br /> <br />原文来自http://odetocode.com/code/450.aspx, 挺不错的文章,让我了解了Master Pages内部实现机制和一些应用技巧。<br /><br />Master pages are a great addition to the ASP.NET 2.0  feature set. Master pages help us build consistent and maintainable user interfaces. Master pages

2010-07-08 13:29:00 1846

转载 ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps

<br /> <br />原文来自http://odetocode.com/code/450.aspx, 挺不错的文章,让我了解了Master Pages内部实现机制和一些应用技巧。<br /><br />Master pages are a great addition to the ASP.NET 2.0  feature set. Master pages help us build consistent and maintainable user interfaces. Master pages

2010-07-08 13:28:00 2068

转载 Workaround for the deprecated imagePickerController.allowsImageEditing property

<br />Workaround for the deprecated imagePickerController.allowsImageEditing property:<br /><br />NSString* key =@"allowsEditing"; <br />if([myImagePickerController respondsToSelector:@selector(setAllowsImageEditing:)]){ <br />  key =@"allowsImageEditing";

2010-06-22 23:40:00 2283

原创 使用ASP.NET的权限系统

1. 生成aspnet的权限数据表和sp,使用.net 2.0的命令如下:C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>aspnet_regsql -W使用-W参数调出连接数据库向导,根据向导生成数据库数据。 2. 在web.config更改验证方式并添加providers " />

2010-04-20 23:28:00 3099 2

转载 自行控制GridView的Paging和Sorting

private string ConvertSortDirectionToSql(SortDirection sortDirection){ string newSortDirection = String.Empty; switch (sortDirection) { case SortDirection.Ascending:

2010-04-20 21:51:00 1308

原创 Remove a route and make it permanent on ubuntu

Add a line in /etc/network/interfacesup route del -net default eth1  

2010-01-19 11:55:00 391

原创 Exim一些命令

exim -bt someone@domain - 测试邮件router/transportexim -bt -d someone@domain - 更详细的log exim -bp - 等同 mailq, 显示queue中mail, 可以得到size, from, to, message-ID以及在队列里的时间exim -q - 等同 runq, 执行队列exim -qf -

2010-01-18 07:19:00 1964

转载 Some commands about setting network in ubuntu

ifconfig - lists IP address (similar to ipconfig in Windows)iwlist scan - shows wireless networks that are available in the area along with basic encryption informationlshw -C network - Shows interfac

2010-01-18 04:42:00 540

转载 A great article about setting up exim

http://koivi.com/exim4-config/

2010-01-17 07:19:00 404

转载 Setting up Zend debugger.

http://forums.zend.com/viewtopic.php?f=59&t=962#p4190

2010-01-14 03:08:00 548

原创 Mail handler on Exim

Reference: http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/index.html General steps:1. Install exim4, on ubuntu: apt-get install exim42. Configure commands     a) dpkg-reconfigur

2010-01-11 08:16:00 803

转载 Resetting a forgotten MySql root password

Please refer to http://www.debian-administration.org/articles/442 a well written tutorial, basically we should do are simply:/etc/init.d/mysql stop/usr/bin/mysqld_safe --skip-grant-tables &mys

2009-12-19 00:25:00 439

原创 Ubuntu Server 9.10 on VirtualPC2007: Console界面的花屏问题

在Virtual PC 2007上装了个Ubuntu Server 9.10,装的过程还挺顺利,但是在启动后发现控制台界面花屏,放狗搜了一下发现很多都是讲图形界面的花屏问题,要修改X11的东西,但是这个控制台界面似乎不属于那一类,而且花屏的样子也不一样: 网上有一片文章有一个解决方法:http://dolphinysj.blog.ubuntu.org.cn/2009/11/20/ubu

2009-12-08 05:57:00 2008 1

原创 MySQL's trailing space

发现居然mysql在字符串比对时忽略尾部的空格!以前接触的oracle, mssql都是都是需要考虑尾部空格的,难道这是特地改的?放狗搜了一下,貌似是by design,可以看看http://dev.mysql.com/doc/refman/5.0/en/char.html,而且是一个从4.0之后就这样了,看来要加rtrim了。。。 测试用代码:mysql> select a =

2009-12-07 04:43:00 942

原创 Setup WAMP+Eclipse+ZendDebugger

费了2,3天功夫才架起来,赶紧记一下免得忘了。1. 操作系统win7,没有办法,小黑本的干活... 2. Apache第一步就是去http://httpd.apache.org/,不过发现download里面只有msi的版本,出于一种喜欢绿色软件的癖好;),不想装带windows installer的那种——会产生注册表,开始菜单,或者在系统目录下留下很多东西。于是我到http

2009-12-07 04:24:00 3039

原创 OutputDebugString

To put string in VSs debug output window: Managed:System.Diagnostics.Debug.WriteLine("I am using dot net debugging");  Native C++:#include int _tmain(int argc, _TCHAR* argv[]){

2009-06-11 15:13:00 566

转载 [转贴收藏]XSLT MUENCHIAN分组法

原文来自http://www.yeeyan.com/articles/view/goto100/20155 简介在XSLT1.0中如何高效的对扁平结构的XML进行分组。在XSLT中分组是一个常见问题:如何将一组元素排列成组?一种最常见的情况就是将数据库中的数据通过XML进行输出。通常数据库返回的XML结构是与数据库中的记录一样的。例如一个地址簿,它可能会给你如下XML:

2009-01-16 13:55:00 927

原创 Remove the empty xmlns attribute in generated xml

如果直接写            Dim xd As New XmlDocument()            xd.Load(xmlPath)            Dim root As XmlNode = xd.DocumentElement            Dim xn As XmlNode = xd.CreateElement("ItemType")

2008-12-12 17:40:00 667

原创 VC++ 的构造函数之间的调用居然不能保存成员变量的赋值。。

早上被这个问题挡住了很久.. A simple repro:下面这段代码,我原本期待最后打出的值是1, 因为a(int)调用了a(int,int)而后者给m1赋值1, 结果是2.public class a{public: int m1; a(int i, int j):m1(1) { } a(int i):m1(2) {  a(

2008-11-21 10:52:00 1390 2

原创 Windows 2008 Roles and Features

The short names in [] could be used for servermanagercmd.exe -install command. ----- Roles -----[ ] Active Directory Certificate Services  [AD-Certificate]    [ ] Certification Authority  [ADC

2008-09-05 10:31:00 1310

原创 Equivalent typeof in MC++

the new equivalent word in MC++ for typeof from C# is T::typeid,  example:C#:  typeof(System.Uri)MC++: System::Uri::typeid an old C++ syntax of it is __typeof(System::Uri)to use it, yo

2008-07-23 11:29:00 511

原创 [copy]static_cast, dynamic_cast, safe_cast

static_cast: includes no run-time checking, so is fast and potentially dangerous.dynamic_cast: includes run-time checking, so is slow and safe. Returns a null pointer if the cast fails.safe_cast:

2008-07-17 17:05:00 957

转载 Software Wars

很cool的一张图。来自http://mshiltonj.com/software_wars/current/ 

2008-07-08 17:03:00 701

原创 .NET Licensing

最近因为需要测试LC,所以研究了一下Windows类和一般控件的Licensing。网上有一篇很好的入门文章: http://windowsclient.net/articles/Licensing.aspx ,我这篇主要知识都来自它,这里只是简要记录一下免得以后忘掉。就以类的Licensing来说,关键点在于文章所说 The LicenseProviderAttribute

2008-07-08 16:09:00 771

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除