到不了的地方就叫做远方
Nov 10

Joomla bug fixing 不指定

harrie , 15:34 , 生活笔记 , 评论(0) , 引用(0) , 阅读(21) , Via 本站原创
1 mosuser :: store failed </br>

"_users' table is set to 'auto-increment.' "
this was the culprite!
Nov 3

1. 请对POSIX风格和兼容Perl风格两种正则表达式的主要函数进行类比说明

ereg
preg_match

ereg_replace
preg_replace

2. 请说明在php.ini中safe_mode开启之后对于PHP系统函数的影响

3. PHP5中魔术方法函数有哪几个,请举例说明各自的用法

__sleep

__wakeup

__toString

__set_state

__construct,

__destruct

__call,

__get,

__set,

__isset,

__unset

__sleep,

__wakeup,

__toString,

__set_state,

__clone

__autoload

4. 请写出让,并说明如何在命令行下运行PHP脚本(写出两种方式)同时向PHP脚本传递参数?

1. Php filename.php $agr1 $agr2

2. php –r “”

5. PHP的垃圾收集机制是怎样的

6.使对象可以像数组一样进行foreach循环,要求属性必须是私有。

(Iterator模式的PHP5实现,写一类实现Iterator接口)

7.请写一段PHP代码,确保多个进程同时写入同一个文件成功

8. 用PHP实现一个双向队列

9. 使用正则表达式提取一段标识语言(html或xml)代码段中指定标签的指定属性值(需考虑属性值对不规则的情况,如大小写不敏感,属性名值与等号间有空格等)。此处假设需提取test标签的attr属性值,请自行构建包含该标签的串

10.请使用socket相关函数(非curl)实现如下功能:构造一个post请求,发送到指定http server的指定端口的指定请求路径(如http://www.example.com:808...)。请求中包含以下变量:

用户名(username):温柔一刀

密码(pwd):&123=321&321=123&

个人简介(intro):Hello world!

且该http server需要以下cookie来进行简单的用户动作跟踪:

cur_query:you&me

last_tm:...(上次请求的unix时间戳,定为当前请求时间前10分钟)

cur_tm:...(当前请求的unix时间戳)

设置超时为10秒,发出请求后,将http server的响应内容输出。

Function encode($data, $sep = ‘&’){

while (list($k,$v) = each($data)) {

$encoded .= ($encoded ? "$sep" : "");

$encoded .= rawurlencode($k)."=".rawurlencode($v);

}

Return $encoded;

}

Function post($url, $post, $cookie){

$url = parse_url($url);

$post = encode($data, ‘&’);

$cookie = encode($cookieArray, ‘;’);

$fp = fsockopen($url['host'], $url['port'] ? $url['port'] : 80, $errno, $errstr, 10);

if (!$fp) return "Failed to open socket to $url[host]";

fputs($fp, sprintf("POST %s%s%s HTTP/1.0\n", $url['path'], $url['query'] ? "?" : "", $url['query']));

fputs($fp, "Host: $url[host]\n");

fputs($fp, "Content-type: application/x-www-form-urlencoded\n");

fputs($fp, "Content-length: " . strlen($encoded) . "\n");

fputs($fp, "Cookie: $cookie\n\n");

fputs($fp, "Connection: close\n\n");

fputs($fp, "$post \n");

while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);

}

$url = ‘http://www.example.com:808...

$encoded = username=温柔一刀& pwd=

$post = array(

‘username’=> ‘温柔一刀’,

‘pwd => ‘&123=321&321=123&’,

‘intro => ‘Hello world!’

);

$cookie = array(

‘cur_query’ => ‘you&me,

‘last_tm’ => time() - 600,

'cur_tm '=> time()

);

Post($url, $post, $cookie);

11.你用什么方法检查PHP脚本的执行效率(通常是脚本执行时间)和数据库SQL的效率(通常是数据库Query时间),并定位和分析脚本执行和数据库查询的瓶颈所在?

1.脚本执行时间,启用xdebug,使用WinCacheGrind分析。

2.数据库查询,mysql使用EXPLAIN分析查询,启用slow query log记录慢查询。

3 . Benchmark

Tags:
Oct 30
From http://programmingbulls.co...

How to create a Social Networking Site like Orkut, MySpace using Open Source Drupal or Elgg?

I was evaluating to build a social networking site using open source stuff like Drupal, Elgg. Elgg provides out of the box functionality for a social networking site like Orkut, Hi5, Myspace, but Drupal is far more flexible. It seems Elgg is not tested and used as much as Drupal. I have been working on Drupal for a long time now and my faith on it has only increased, though, I had to make changes to the code and modules at times.

Even though, I was skeptic about Elgg, I did some initial code evaluation and installtion. But, was not satisfied and therefore, decided to go with Drupal.

Following is the list of modules, I could need to make a social networking site:

  • guestbook ( equivalent to comments on profile or scraps )
  • image, inline, shazamgaller: to be able to add images inline and create photo gallaries.
  • invite ( allows to become member by invitation only )
  • OG ( gives you groups or communities )
  • cck ( let you make any type of content )
  • private message ( and chat, if you want )
  • mysite
  • nodeprofiles (http://groups.drupal.org/p...)
  • event
  • buddylist

Other modules, you might need:

  • bbcode & wysiwyg toolbar
  • captchya
  • devel
  • feedback
  • flatforum
  • flexinode
  • legal

Hope, the list doesn't look long. But, it is obvious code customization iwould be required at places to suit your need and that is very power of open source comes.


From http://drupal.org/node/109...

Drupal Social Network site Q&A

ncameron - January 14, 2007 - 13:53

Hi Guys,

I've recently finished and launched a social networking website made completely in Drupal 4.7. In the process of creating the site I received a lot of help from both the forum and the handbook. So I thought it was about time I gave something back. Social networks seem to be a pretty popular goal for Drupal developers so this thread might come in useful.

The site itself is using the principles of social networking to help people learn languages. Have a look here; http://www.huitalk.com/ and if you have any "how do you that" questions I'll do my best to help. I'll be a little busy over the next few weeks but I will try to respond to the questions as quickly as possible.

The site uses (among others) the following modules:

  • CCK
  • Views
  • Buddylist (hacked to pieces and reconstructed)
  • privatemsg
  • Forms
  • nice_menus
  • nodereference
  • pageroute
  • profile
  • registerprofile
  • tinymce
  • usernode
  • Looking forward to any questions!

    Neil


    Oct 27
    我先开启了SSH。

    然后想安装svn,开始的时候以为mac os 也会有apt-get 这个命令,这样下载东西就方便了,尝试了一下,没有。

    搜索了一下,找到Fink ---mac os下的apt-get

    安装直接stepbystep。

    然后fink install svn 大功告成。
    Tags: , ,
    Oct 27
    mogilefs, exif, gentoo

    http://www.travistidwell.c...
    分页: 1/27 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]