易栈网-膘叔

发文热力图 2025-12-07 ~ 2026-12-06
少 多 近 365 天共 27 篇
浏览模式: 标准 | 列表 | 图文
xcache...

xcache...

好吧,我感觉又被xcache骗了。当然也可能是他们没注意吧。

在网站上,他们说:
修复版本. XCache admin 页面有大量改进, 增加 namespace 支持, 等等. 更新 API, 新增了一些 INI 设置. 新增 "诊断" 模块给出一些专家级建议 (htdocs 中). 进程异常时自动禁用缓存 (运行期间). 警告: 本版本开始使用 extension= 来加载 XCache. 不再支持采用 zend_extension= 方式加载.
其实我也不太敢说他们不好,上次我说:xcache 发布3.0版本, moo过来说了两句关于大版本更新的事。
再接着说上面的那句警告:本版本开始使用Extension那句
OK,当我装完的时候:
root@MyDebian64Bit:~/xcache-3.0.0# make install
Installing shared extensions: /usr/lib/php5/20090626/
你看,成功了,但是看了一下xcache.ini。。。
[xcache-common]
;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
zend_extension = /usr/lib/php5/20090626/xcache.so
一下子就与说明不太一致了

com.kapeli.dash.plist

纠结:好象orca.io被墙了?

纠结:好象orca.io被墙了?

本来觉得orca.io这个免费的cdn还是不错的,用了一个月也确实觉得还行。结果。。。怎么这么快就被墙了呢?我晕啊。。

可怜的v2ex,你做什么不被墙啊?
感慨一下。没有什么其他的想法。不过我已经想到一个cdn的地方了。黑黑
[转]Developer Time

[转]Developer Time

其实这篇文章的中文翻译真的好理解,所以我就不翻了啦。懒得翻译的人,可以直接看google translate页面:http://translate.google.com.hk/translate?act=url&hl=en&ie=UTF8&prev=_t&sl=auto&tl=zh-CN&u=http://pydanny.com/developer-time.html

OK,我下面贴的是原文:

This blog post got started with a tweet.

That tweet got retweeted a lot by developers. And system administrators. And database administrators. And any creative type.

As of December 7th, 2012, it had been retweeted over 500 times, a personal best. Obviously I struck a chord that resonated with a lot of people.

Why did this tweet resonate with so many people?

What I said in that tweet was not new - dozens if not hundreds of others have tweeted similar thoughts before and gotten many retweets. Heck, it's been written about in blogs and articles for years, either as a huge rant or often as an effort to politely educate others on how to set up a developer/operations/creative shop.

I think this is because developers/engineers/creatives (and good managers) know that even a tiny distraction to someone "in the zone" takes more than just the 3-5 minutes it takes for you to finish a question and get an answer. Plus, because you are trying to remember the pieces in your head, you won't be able to give this issue your full attention. Which causes a whole other set of issues.

We know this. Good managers know this. Good companies live off of it.

And yet this remains a huge problem for many of us because the distractions keep happening. Maybe it's because your manager doesn't understand this issue, or you have a team mate who can switch in-and-out of the zone with impunity. Or because you foolishly leave the chat/IRC/phone on and you get pinged.

How do we fix it?

We can't.

I know this sounds depressing, but I'm being realistic. Here's some reasons that apply:

  • Unless you are fortunate enough to be working on a solo effort, you are working with other developers/engineers/creatives. And if they can't ask you questions or inform you about critical stuff then you or they can waste hours.
  • Meetings, short or long, online or in person, are a necessary part of any operation. If not with your boss or underlings, then with clients or users.
  • Your boss/co-workers/underlings/kids/pets/parents don't get it that you can't be interrupted.
  • As a freelancer, you can't be inaccessible to existing or potential clients.

No really, how do we fix it?

Doesn't matter how frequently you ask the the question (or rant about it), I don't believe this problem can be really solved. However, here are some possible mitigations:

1. Maker's Day

My friend, Craig Kerstiens describes how Heroku gives engineers a full day each week (Thursday) to focus on getting stuff done. No meetings, no standup, just 100% uninterrupted quiet time to focus on making stuff.

Suggest this at your company and see how it goes!

2. Blocks of Time

As of 2010, Eldarion broke up their work day into at least two sizable chunks of uninterrupted activity. Between the chunks you communicated with co-workers. The advantage of this approach is if you went down the wrong path or someone had a critical question, the period between chunks addressed this issue.

In theory this is how a lot of places work (lunch being the break). The reality is that the distractions often still pile in. For Eldarion it worked because everyone was remote.

3. New Desk Location

If working at an office, asked to be moved to a place with less foot traffic. The downside to this is you can end up in noisy, cold, dark places.

4. New Job

Switch to a new job that promises less distractions.

Maybe I'm wrong

I'm more than happy to be proven wrong.

Maybe there is a way to get 4-6 hours a day of uninterrupted maker's time every work day.

If you've got any ideas, let me know!

-------

没有什么正确的东西,无非就是你自己怎么选择。和你自己是怎么看待被打断的。

小菜谱

小菜谱

想不到,我的http://xiaocaipu.com还没有上线,我的微信功能却已经正常在运作了。

打开微信搜索好友,如果按帐号添加,就搜索:xiaocaipu,如果搜索公众帐号,就搜:小菜谱。当然,你懒的话,就扫描这个:
f1f001c747be883fc47cf6feaede1d76
小LOGO是http://82982.com的小茗帮忙做的。。那一群设计师的朋友啊什么的,都说自己没空,我纠结啊。
不知道这个帐号是做什么的?那我得上好多图了。。。
先上两个简单的图吧
8e03a4d191d2daff7a639269f144cd4e
e2613f2a20926a5cb4aa79d1f92e078f
这些只是基础功能,还有相对比较高级一点的功能:
412a0f05a68472168ba356e3bfc1bb84
9fe8b9ea7b7c3474ef2307b9d7878ab7
e3ca5bb8a22ac7d6cbe7c589142eed64
2947b912896eadaa5f362f1a6f595587
转:PHP中利用pcntl实现多进程(模拟多线程)实例

转:PHP中利用pcntl实现多进程(模拟多线程)实例

pcntl在很久很久之前就听过了,但是一直没有尝试着真正要用它。这不,遇到socket问题了,看socket,遇到pcntl了,再看看吧。

这里是某个人的测试代码:
<?php
/**
* 创建子进程入口
* @author selfimpr
* @blog http://blog.csdn.net/lgg201
* @mail lgg860911@yahoo.com.cn
* @param $func_name 代表子进程处理过程的函数名
* @param other 接受不定参数, 提供给子进程的过程函数.
*/
function new_child($func_name)
{
$args = func_get_args();
unset($args[0]);
$pid = pcntl_fork();
if ($pid == 0) {
function_exists($func_name) and exit(call_user_func_array($func_name, $args)) or exit(-1);
}
else if ($pid == -1) {
echo "Couldn’t create child process .";
}
}
//测试处理函数, 输出$prefix连接的数组
function test($prefix, $num)
{
while ($i++ < $num) {
echo $prefix . $i ."\n";
}
}
//创建一个子进程
new_child("test", "child process ", 100);
//父进程也开启一个与子进程同样多的循环.
test("parent process", 100);
//运行结果, 我这里运行父进程输出50个左右, 子进程开始运行.
?>
因为上面有作者有注释,所以我就不再多贴这篇文章的地址了。原网页的代码是错误的。我改了一下。原作者说的是:父进程输出50个左右时,子进程就开始运行了。我这边不是。我把数据改成1000后,发现父进程在950多的时候,子进程开始运行了。
原作者的博客上还有一个详细介绍:PHP扩展pcntl(进程控制以及信号处理)中文文档
当然,看手册也可以,对了,风雪之隅也写过类似的文章,http://www.laruence.com/2009/06/11/930.html,他提到的优点就是:
优点:
1. 使用多进程, 子进程结束以后, 内核会负责回收资源
2. 使用多进程,子进程异常退出不会导致整个进程Thread退出. 父进程还有机会重建流程.
3. 一个常驻主进程, 只负责任务分发, 逻辑更清楚.
然后他的代码就与上面有点区别,不过说白了还是大同小异:
#!/bin/env php
<?php
/** A example denoted muti-process application in php
* @filename fork.php
* @touch date Wed 10 Jun 2009 10:25:51 PM CST
* @author Laruence<laruence@baidu.com>
* @license http://www.zend.com/license/3_0.txt PHP License 3.0
* @version 1.0.0
*/

/** 确保这个函数只能运行在SHELL中 */
if (substr(php_sapi_name(), 0, 3) !== 'cli') {
die("This Programe can only be run in CLI mode");
}

/** 关闭最大执行时间限制, 在CLI模式下, 这个语句其实不必要 */
set_time_limit(0);

$pid = posix_getpid(); //取得主进程ID
$user = posix_getlogin(); //取得用户名

echo <<<EOD
USAGE: [command | expression]
input php code to execute by fork a new process
input quit to exit

Shell Executor version 1.0.0 by laruence
EOD;

while (true) {

$prompt = "\n{$user}$ ";
$input = readline($prompt);

readline_add_history($input);
if ($input == 'quit') {
break;
}
process_execute($input . ';');
}

exit(0);

function process_execute($input) {
$pid = pcntl_fork(); //创建子进程
if ($pid == 0) {//子进程
$pid = posix_getpid();
echo "* Process {$pid} was created, and Executed:\n\n";
eval($input); //解析命令
exit;
} else {//主进程
$pid = pcntl_wait($status, WUNTRACED); //取得子进程结束状态
if (pcntl_wifexited($status)) {
echo "\n\n* Sub process: {$pid} exited with {$status}";
}
}
}
做个笔记。

socket and soap

其实本来不想定这个标题的。只是做了几个小小的测试

我用php实现了socket server,然后在命令行下做了点测试。在命令行下访问soap,并将返回值 给了客户端。

测试了一下。网速比较卡的情况下,基本在0.8秒左右

然后我直接访问soap,打印出来的时候都差不多比命令行返回结果多了0.2秒。

这只是测试了soap请求一次。后来,我请求了两次。发现速度又快了0.1秒。

总计快了0.3秒。在命令行下用socket server返回数据好象快了一点。

-----------

文章只是我的一次记录,没有什么特别的意义。虽然不太科学,但对我来说,有三四台服务器的情况下,利用这个来交换数据还是有点用的。目前我的socket server只能用PHP实现,因为 部分代码都是靠PHP来获取数据的。本来想用go或者python来实现的,但目前没有时间。先用PHP了

ac400818cc7da8def66a8299e1f85660

img_0612.mov

09704cf5ba7697160f1ceb516b2cb816

备份:PhpStorm字体修改终极方案

备份:PhpStorm字体修改终极方案

很久没有改过phpstorm的配色和字体方案了。小伟说,如果字体是12,那就是正常的。如果放到14就不太正常了。。。

然后找到了这个win下的配色方案,先备份一下,万一哪天就用win了呢。
原文来自:[查看](如果打不开,请直接搜索phpstorm即可),

其实phpstorm的字体修改跟netbeans是一模一样, 不同之处在于netbeans使用的是系统jre, 而phpstorm使用的自身的jre — window系统下是这样.

修改步骤如下.

1. 进入phpstorm安装目录下的jre, 如 PhpStorm 4.0.3\jre\jre\lib

2. 将该目录下的fontconfig.properties.src复制一份文件fontconfig.properties,并放在该目录下

3. 编辑文件fontconfig.properties,查找到下面一行:

sequence.monospaced.GBK=chinese-ms936, alphabetic,dingbats,symbol

修改成:

sequence.monospaced.GBK=alphabetic,chinese-ms936,dingbats,symbol

保存该文件后启动phpstorm, 在settings里的Editor – Colors & Fonts – Fonts里选择Monospaced字体, 大小16左右.

保存后就能看到一个完美的中英文编辑界面了.

--------

不过我用的字体和他不一样。不过也能做参考 .。

转:像打麻将一样干工作

转:像打麻将一样干工作

这是一篇来自问库的文章,虽然说的很无耻,但也很有道理 :http://wenku.baidu.com/view/22732d8183d049649b665862.html

说白了,就是利益的关系,真的。。你看文章就是这么写的,看到最后你就会发现,确实是因为利益导致了工作的进度

原文如下:

国人都爱打麻将,我认为,只要拿出一半打麻将的精神,企业各部门之间的配合就会无缝对接。
仔细想一想,其实打麻将包含了所有企业成功的精髓。任何工作都不是一个人单打独斗,要的是集体配合。比如,你坐在我对面,你洗牌的时候,牌掉在我的脚下,谁捡?当然是我捡。因为早捡起来,早开局,我好早点赢钱。所以打麻将,不管谁掉了牌,都会有人尽快捡起来。
但在工作中呢?你做错了,凭什么我来帮你?你弄掉了,肯定由你捡,跟我有什么关系?一个人做错了,实际上跟大家都有关系,那么,为什么不能用打麻将的精神来工作?
打麻将的人从来不迟到,说好晚上8点,可还没到点,有三个人先到了,剩下的那个人在路上,这三个人电话一顿催:“快点来,三缺一”。那个人敢说:“急什么,不是8点吗”?结果,赶紧打个车跑来了,进门一看表才7点半。可他第一句话,肯定是:“不好意思,迟到了,让你们久等了”
为什么说迟到了?因为别人都比他早到。
另外,说好晚上12点收局,时间没到,一定有人举手要求“加班”。说:“实在不好意思,今晚输多了,再打一圈吧”?打一圈就打一圈,你赢了别人输了,不打不好意思。所以,打麻将通宵达旦是常事,但第二天很少有人抱怨自己又加了一个夜班。
打麻将的人从不抱怨工作环境。可是,我们现在对生活和工作的环境有多挑剔,什么宿舍太吵,洗碗时油太多,上班太累。。。。。你有没有见过打麻将的人说,房子吊顶太矮,空调不够冷,桌子太脏的?
打麻将冬天捂着被子打,夏天光着膀子打;没桌子把纸箱子倒放,放上板子就是麻将桌,洗脸盆垫上报纸就是凳子,麻将打得照样热火朝天。这时候要来个人说请吃饭,四个人肯定说改天去。可是我们工作上能做到吗?做不到,但是打麻将我们做到了。
还有一个神奇的地方,打麻将用手能摸出是什么牌。九万和六万,六条和九条,多小的差别,居然能摸出来。为什么?因为打麻将的人用心,用心的人学东西都能学进去,大不了慢一点,迟早会学会。
可是我们对工作呢,一遍一遍的出错。想想看,如果用一半的心感受工作会怎么样?还有学不会的吗?
最佩服的就是打麻将的人永远不抱怨被别人,只从自己身上找原因。输了钱的只会说:“自己手背”。上趟洗手间拼命洗手,回来后,在点儿好的人身上摸一把,再用别人的打火机点上一根烟,狠狠地抽一口,但是,永远不会抱怨别人。
phpfog 要停止服务了。。。

phpfog 要停止服务了。。。

用phpfog也有两年了吧? 在上面也跑了2个应用,其中一个就是ucapi.com,其实说真的ucapi.com已经久不维护了。一来ucenter也很少有人在单独使用了。顺便,求收购。。。ucapi.com,HOHO。。

This is a reminder for PHP Fog users regarding the service’s discontinuation.

In order to focus our team and efforts on continuing to build a better solution for developers, we will be fully shutting down the PHP Fog platform in December (all free apps hosted on PHP Fog will be discontinued on December 21, 2012) and focusing solely on AppFog. As we move toward this final date, some services will be disabled along the way.

For more information plus resources to help you begin or complete your migration to AppFog, please read this blog post.

We are also going to be holding a webinar on migrating to AppFog from PHP Fog on December 6. For more information and to register for the migration webinar, please visit the AppFog University webinar page.

---现在正在想办法迁移到AppFOG,只是不知道APPFog以后会有多久也突然停了。

phpcloud怎么办?太麻烦