本来我是很讨厌一直迁移的,但burst一直无故挂掉,实在受不了。
一咬牙就换到了linode上面了,用ping.chinaz.com试了一下,好象电信访问的速度都比较慢,但联通线路却很快。(不过我在公司的电信光纤在最快的时候达到了100ms以下)
家里的网络是长宽,也很快,一下子欣慰了。
直接用Scp将burst的数据抓回来,很快,一下子就转换过来了。
准备向burst申请退款,NND。
膘叔的简单人生
本来我是很讨厌一直迁移的,但burst一直无故挂掉,实在受不了。
一咬牙就换到了linode上面了,用ping.chinaz.com试了一下,好象电信访问的速度都比较慢,但联通线路却很快。(不过我在公司的电信光纤在最快的时候达到了100ms以下)
家里的网络是长宽,也很快,一下子欣慰了。
直接用Scp将burst的数据抓回来,很快,一下子就转换过来了。
准备向burst申请退款,NND。
http://www.microsoft.com/download/en/confirmation.aspx?id=20098
其实在很久前就有这玩意了,现在居然是3.0了。在win下用这个驱动好啊,支持最新的Sql server,而且速度很快。同时,它居然还支持了PDO。。。
下载下来很方便,有几种不同的文件,根据你当前的情况来设置:
Perform the following steps to download and install the Microsoft Drivers for PHP for SQL Server:
1. Download SQLSRV30.EXE to a temporary directory
2. Run SQLSRV30.EXE
3. When prompted, enter the path to the PHP extensions directory
4. After extracting the files, read the Installation section of the SQLSRV30_Readme.htm file for next steps
看着readme一步一步就Over了。
08年的时候根据第一版的文件写过一个很简单的连接库,替换掉了当时discuz的sql连接库。现在。。。还是用PDO吧
Conn2.Open "Provider=SQLOLEDB.1;Persist Security InFso=true;Data Source=192.168.1.2;Initial Catalog=xxxxx;User ID=sa;Password=123456;"
一些参考信息:
Integrated Security默认值是False,此时需要提供Uid和Pwd,即将以Sql Server 用户身份登陆数据库;如果设置为True,Yes 或 SSPI,这不能出现Uid和Pwd,将以Windows用户省份登陆数据库。强烈推荐用后一种形式,安全性更高。
参见
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.asp
--------
http://expert.csdn.net/Expert/topic/2930/2930660.xml?temp=.423382
Persist Security Info 布尔类型,为True时,表明采用集成安全机制;若为False,则表明不采用集成安全机制。
更多资料还是看:http://connectionstrings.com/,还是这个网站好玩。
PDO_SQLSRV is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MS SQL Server (starting with SQL Server 2005) and SQL Azure databases.
The PDO_SQLSRV extension is enabled by adding appropriate DLL file to your PHP extension directory and the corresponding entry to the php.ini file. The PDO_SQLSRV download comes with several driver files. Which driver file you use will depend on 3 factors: the PHP version you are using, whether you are using thread-safe or non-thread-safe PHP, and whether your PHP installation was compiled with the VC6 or VC9 compiler. For example, if you are running PHP 5.3, you are using non-thread-safe PHP, and your PHP installation was compiled with the VC9 compiler, you should use the php_pdo_sqlsrv_53_nts_vc9.dll file. (You should use a non-thread-safe version compiled with the VC9 compiler if you are using IIS as your web server). If you are running PHP 5.2, you are using thread-safe PHP, and your PHP installation was compiled with the VC6 compiler, you should use the php_pdo_sqlsrv_52_ts_vc6.dll file.
For more information about system requirements, see » SQLSRV System Requirements.
The PDO_SQLSRV extension is only compatible with PHP running on Windows. For Linux, see ODBC and » Microsoft's SQL Server ODBC Driver for Linux.
To access data in a SQL Server 2005 or later database using the Microsoft Drivers for PHP for SQL Server, you must have the following components installed on your computer:
Supported operating systems for version 3.0 of the driver include:
Windows Server 2008 R2 SP1
Windows Vista SP2
Windows Server 2008 SP2
Windows 7 SP1
Supported operating systems for version 2.0 of the driver include:
Supported operating systems for version 2.0 of the driver include:
Windows Server 2003 Service Pack 1
Windows XP Service Pack 3
Windows Vista Service Pack 1 or later
Windows Server 2008
Windows Server 2008 R2
Windows 7
PHP 5. For information about how to download and install the latest stable binaries, visit http://php.net.
Microsoft Drivers for PHP for SQL Server, version 3.0 requires PHP 5.3.0 or later. If possible, use PHP 5.3.6, or later. The version 2.0 driver works with PHP 5.2.4 or later. If possible, use PHP 5.2.13, or later.
A version of the driver file must be in your PHP extension directory. See Driver Versions later in this topic for information about the different driver files. See Loading the Microsoft Drivers for PHP for SQL Server for information on configuring the driver for the PHP runtime.
(See The Data Center for the Microsoft Drivers for PHP for SQL Server for information on where to download the Microsoft Drivers for PHP for SQL Server.)
A Web server. Your Web server must be configured to run PHP. For information about hosting PHP applications with Internet Information Services (IIS) 6.0, see Using FastCGI to Host PHP Applications on IIS 6.0. For information about hosting PHP applications with IIS 7.0, see Using FastCGI to Host PHP Applications on IIS 7.0.
The Microsoft Drivers for PHP for SQL Server has been tested using IIS 6 and IIS 7 with FastCGI.
The x86 version of SQL Server Native Client is required on the computer where PHP is running. If you are using a 64-bit operating system, the x86 version of SQL Server Native Client will be installed with the x64 version of SQL Server Native Client (do not install the x86 version of SQL Server Native Client on an x64 operating system).
If you are using the SQLSRV driver, sqlsrv_client_info will return information about which version of SQL Server Native Client is being used by the Microsoft Drivers for PHP for SQL Server. If you are using the PDO_SQLSRV driver, you can use PDO::getAttribute to discover the version.
Version 3.0 of the driver requires Microsoft SQL Server 2012 Native Client. You can download Microsoft SQL Server 2012 Native Client from the SQL Server 2012 feature pack page.
Version 2.0 of the driver requires Microsoft SQL Server 2008 R2 Native Client. Click on the appropriate link below:
This section lists the drivers that are installed for version 2.0 and version 3.0 of the Microsoft Drivers for PHP for SQL Server. PHP version 5.2 is not supported in version 3.0 of the Microsoft Drivers for PHP for SQL Server.
Follow the installation instructions in Loading the Driver to configure the driver for use with the PHP runtime.
Microsoft Drivers 2.0 for PHP for SQL Server installs several versions of the driver:
|
Driver file |
PHP version |
Thread safe? |
Use with PHP .dll |
|---|---|---|---|
|
php_sqlsrv_53_nts_vc6.dll php_pdo_sqlsrv_53_nts_vc6.dll |
5.3 |
no |
php5.dll |
|
php_sqlsrv_53_nts_vc9.dll php_pdo_sqlsrv_53_nts_vc9.dll |
5.3 |
no |
php5.dll |
|
php_sqlsrv_53_ts_vc6.dll php_pdo_sqlsrv_53_ts_vc6.dll |
5.3 |
yes |
php5ts.dll |
|
php_sqlsrv_53_ts_vc9.dll php_pdo_sqlsrv_53_ts_vc9.dll |
5.3 |
yes |
php5ts.dll |
|
php_sqlsrv_52_nts_vc6.dll php_pdo_sqlsrv_52_nts_vc6.dll |
5.2 |
no |
php5.dll |
|
php_sqlsrv_52_ts_vc6.dll php_pdo_sqlsrv_52_ts_vc6.dll |
5.2 |
yes |
php5ts.dll |
If the name of the driver file contains "vc9", it should be used with a PHP version compiled with Visual C++ 9.0.
Microsoft Drivers 3.0 for PHP for SQL Server installs several versions of the driver:
|
Driver file |
PHP version |
Thread safe? |
Use with PHP .dll |
|---|---|---|---|
|
php_sqlsrv_53_nts.dll php_pdo_sqlsrv_53_nts.dll |
5.3 |
no |
php5.dll |
|
php_sqlsrv_53_ts.dll php_pdo_sqlsrv_53_ts.dll |
5.3 |
yes |
php5ts.dll |
由于看了几个VPS都是空间比较小,所以开始考虑是否用第三方存储来放置一些数据。
其实在国外有很多类似的工具,比如dropbox,sugarsync,但这些其实在命令行下用起来都不太方便或者说用PHP调用,所以还是考虑了一些S3或者googlestorage之类的存储。
google有一些现成的工具:https://developers.google.com/storage
Google Cloud Storage is a new service for developers to store and access data in Google's cloud. It offers developers direct access to Google's scalable storage and networking infrastructure as well as powerful authentication and data sharing mechanisms. Developers can store objects of any size and manage access to their data on an individual or group basis using Google Cloud Storage.
Google Cloud Storage is accessible through its REST API or using any of the available Google Cloud Storage tools, including:
S3的话,会相对比较资料更多一点,毕竟还是老牌供应商,这里有一篇详细教程:http://www.xieyidian.com/2665,图文并茂,在这里还有文中所提到的计算器:在线计算器
现在还在犹豫,因为毕竟我对这些都不熟,英文也烂,不知道怎么搞比较好,纠结啊。
-------
所以,本文只是备份资料,下次用的时候可以直接找到它
最近在使用phpQuery处理xml的时候发生了一点小问题。由于xml还算是比较规范,但我又不想用simplexml_load_string,所以就偷懒用phpQuery处理了。
但在处理的时候发现一个问题,比如我要处理的内容是:
<title>揭秘日本巨型OLED地球仪:实时显示地球变化</title>
<link>http://news.dili360.com/gclw/xxjs/2012/0312/32136.shtml</link>
<description><a href='http://news.dili360.com/gclw/xxjs/2012/0312/32136.shtml'><img src='http://image.dili360.com/news/gclw/xxjs/2012/0312/36_5132136203_20120312094816.jpg' style='border: 1px solid #000000;'/></a> 新浪科技讯 北京时间3月12日消息,据国外媒体报道,如果你前往日本东京,别忘了去参观一下“未来科学馆”(Miraikan),这里展示着一些最尖端的技术成就。就在去年年中,这里揭幕了全世界首个大型OLED显示屏,直径超过19英尺(约合5.8米)。尽管名叫“Geo-Cosmos”,但这并非一般的地球仪,它几乎能实时显示我们这颗星球上正在发生的一切!全球各地的科学家和研究机构将数据发送给Geo-Cosmos,后者将其呈现给观众。 这..</description>
<category>中国国家地理网地理资讯频道</category>
<author>dili360.com</author>
<pubdate>2012-03-12 09:48:16</pubdate>
请看加红的那一段。
当我用phpQuery处理完后,发现,右边的</link>不见了。其他元素都正常。我的心一下子就碎了。
开始以为页面有问题,但怎么处理都是这样,最终只能将link换成了url来 进行处理。说实话,心是哇凉哇凉的。。
但是,同事在win下面就没有这个问题,我在ubuntu下就有这个问题。(我现在不知道是否我的PHP版本有问题,还是平台的问题,也没有心思深究了)【同事是5.3.9,我是5.3.6】,
有些更新由于没有仔细看,结果就出错了,所以,还是COPY出来,以后查起来方便一点,顺便告诉自己,session函数有部分不能用了。。。
Although most existing PHP 5 code should work without changes, please take note of some backward incompatible changes:
FALSE. 【这个是早就知道了】set_magic_quotes_runtime() raises an E_CORE_ERROR level error. E_WARNING.【这个可能需要注意了。。。。】E_WARNING if you try to use them. Offsets of types double, bool and null produce a E_NOTICE. Numeric strings (e.g. $a['2']) still work as before. Note that offsets like '12.3' and '5 foobar' are considered non-numeric and produce a E_WARNING, but are converted to 12 and 5 respectively, for backward compatibility reasons.【。。。。。会有意外了】E_NOTICE level error, but the result of the cast will still be the string "Array". NULL, FALSE, or an empty string into an object by adding a property will now emit an E_WARNING level error, instead of E_STRICT. FALSE when two empty arrays are provided as parameters. E_STRICT level error is emitted. The following keywords are now reserved, and may not be used as names by functions, classes, etc.
The following functions have been removed from PHP:
纠结了很久,还是失败了。
看了一下出问题的step,发现是drop table的问题,我开始以为是我的权限有问题。但。。。我设置为ROOT也没用。所以暂时不升级了。真纠结啊
---------
顺便:
从PHP5.4开始,session_register函数禁用了。所以,如果还在使用Sablog1.6的人,记着。。。seccode.php中,这一行注释掉,否则。。。验证码就出不来了。
---------
由于升级到5.4后,默认display_error为OFF,所以很多错误 都显示不出来,排查了好久才解决这个问题啊。
有两个朋友辞职创业了,一个是阿里系的,一个是QQ系的。一两年前也曾经有这样的想法,但最终还是不够大胆,帮人打工和帮自己打工,我选择了前者。其实当时如果有两个项目可以维持,说不定就真的投入了。。。。
上文章看看误区先,这是创业帮的一篇文章 :http://xueyuan.cyzone.cn/gushi-ganwu/224015.html
很多人都会梦想能够辞掉工作自己创业,尤其是那些在职场为晋升努力了很多年的人。但是每次工作变动都会伴随着诸多风险,而辞职创业这样的转变更是件高风险的事儿。对个人来说,创业是一次重大的跨越,尤其在当前经济不稳定的条件下,创业更需要做好充分的准备。
多年前,《哈佛商业评论》(Harvard Business Review)刊登了一篇文章,名为《跳槽者应避免的5种错误做法》,文章列举了普通人在换工作时常犯的5种错误。我敢肯定,这其中的每一条都适用于那些 正考虑辞职,打算自己或与他人合伙创业的人。这5种常犯的错误如下:
1、未做充分调查研究。换工作之前,起码有这样几个问题需要考虑:你的目标、财务稳定性、企业文化契合度以及工作职责。那些打算辞职创业的人都有必要思考一下以上所有问题。或者与一些经验丰富的创业者谈谈你的创业计划,看看你的想法是否切合实际,获得肯定后再辞职。
2、单纯为钱辞职创业。记住,“这山望着那山高”是多数人的通病。创业在短期内不太可能赚到比打工更多钱,实际上,往往相反,大多数创业者在刚开始 1-2年内是没有收入的,而且也很难找到对其创业项目感兴趣的投资人。我时常告诫打算创业的人,最好在创业项目产生实际收入后,再辞去日常工作。
3、创业是为了逃避工作。如果你不顾一切地铤而走险,开始创业,你可能发现你的创业之路举步维艰,与受雇于人比起来,压力更大而且状况更无法让人满 意。工作量大、工作不被认可或压力过大不是创业的理由,也通常得不到令人满意的结果。而那些认为自己有能力,但是对眼下所从事的工作不满意或者厌倦的人, 反倒更适合做创业者。
4、高估自己。根据很多猎头顾问的观点,现在很多求职者对他们的工作技能、职业规划和弱点的认识都不切合实际。如果你在几家公司的工作经历都不愉快,那么很可能你也存在类似问题。而这些问题会在创业过程中会进一步放大,因为你现在是公司的老板,并且要为所有问题负责。
5、没有长远打算。从受雇于人到创业者是生活方式的重大转变,也是职业生涯的重大转变。创业不是在短期内可以积累大量财富的捷径,更不是逃避问题的方法。创业是一项艰苦的工作,只有通过不断学习和坚持不懈才能有所回报。
很明显,以上这些错误的做法有一定的内在关联性。当人们对自己估计过高,就会更加看重工作绩效的回报,并且对公司所给的报酬感到不满。这种状态会导 致他们冲动地做出创业决定,而对自己创业能力和创业机会缺乏认真考虑,在创业过程中他们也往往失望地会发现,创业更加让人不自在。
所有打工者都需要对上述这些问题进行认真的考虑,因为根据美国劳动统计局(U.S. Bureau of Labor Statistics)的统计数据,婴儿潮出生的人一生平均要换10次工作。在一家公司工作到退休或者一生都在创业的时代已经一去不复返了。近年来商业环 境快速变化,所以我们也需要与时俱进。
决定创业之前,可以问自己这样一个问题“如果事实证明我的决定错了怎么办?”要做好减少损失和勇往直前的准备。再三地从一种困境跳入另一种困境是不 可取的,不管在哪种情形下,都要认真对自己的优点和缺点有清楚的认识。乐于倾听他人对你的看法或指导,并且勇于改正自己的缺点。
还有最重要的一点,要了解工作中哪些因素能让你最感满意,对你来讲,怎样才算是达到工作与生活之间的最佳平衡状态。作为成年人,我们大多数时间都要在工作中度过,而生命却太过短暂,不应该将宝贵的时间浪费在对错误决定的懊悔中。
----------
看到上面的问题,你觉得你真的考虑好了吗?
说白了,yiiredis中的AR功能的model其实就是一个hash,只是稍作封装了而已
官方有例子:
It is possible to store active record like structures in redis using ARedisRecord.
Note: this is experimental functionality and may be subject to change
$record = ARedisRecord::model()->findByPk(1); // loads a record with a unique id of 1 $record->name = "a test name"; // sets the name attribute on the record $record->somethingElse = "some other value"; $record->save(); // saves the record to redis $record->delete(); // deletes the record from redis
不过,上面的例子不能直接拿来用,因为ARedisRecord是一个abstract类,所以你得写一个类继承于他才行。
顺便,如果用setAttributes的时候,记得加第二个参数(除非你写了rules),否则一定要加第二个参数,不然save不成功哦。
昨天被它折腾了好久才发现
----
笔记而已