This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* mc 的扩展类 */ | |
class mc extends Memcache implements ArrayAccess | |
{ | |
protected $default_timeout = 60; //默认的过期时间 | |
protected $default_flag = 0; //默认标志 | |
protected $namespace_timeout = array(); //名称空间过期时间 | |
protected $namespace_flag = array(); //默认标志 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <strings.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <sys/ioctl.h> | |
#include <sys/param.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = <<<ETO | |
<p style="text-align: center;"><img src=[IMG:7gunhvb8hd5a8] alt="" /></p> | |
<p> 应用起源于需要——就像日前我们及我们软件源同步介绍的拉手软件一样,无独有偶,老外的这项Bump应用也是非常的得意!它可以在两个iPhone用户之间迅速的交换两个Facebook等SNS类交友网站的个人信息。<br /><br /> 对于一些SNS交友达人和宅男宅女来讲,这一应用无疑增加了某些幸福事件的发生机率,当你不再热衷于搭讪和眉来眼去时,可以让iPhone帮你完成你所有的心愿。<br /><br /> 不仅如此,它还可以根据人名、添加日期和地图位置进行搜索,不得不佩服这些人的对脑能力。另有可靠消息,此软件目前已经在iTunes上发布,并且免费。跃跃欲试的用户们可不要再矜持了。</p> | |
<p style="text-align: center;"><img src=[IMG:7gunivbeq0f2d] alt="" /></p> | |
<p style="text-align: center;"><img src=[IMG:7gunjv8u4c02b] alt="" /></p> | |
<p style="text-align: center;"><img src=[IMG:7gunlvj5ab991] alt="" /></p> | |
ETO; | |
$post = preg_replace('/(\<img[^\>]+\>)/', '\1<spond></spond>', $str); | |
echo $post; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$memcache = new Memcache; | |
$memcache->connect('127.0.0.1', 11211); | |
$stats = $memcache->getStats(); | |
foreach ($stats as $key => $val) { | |
echo "$key : $val\n"; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from Tkinter import * #引入模块 | |
#resize函数是用来改变文字大小的,当进度条改变时调用 | |
def resize(ev=None): | |
label.config(font='Helvetica -%d bold' % scale.get()) | |
#config函数就是通过设置组件的参数来改变组件的,这里改变的是font字体大小 | |
top=Tk() #主窗口 | |
top.geometry('600x400') #设置了主窗口的初始大小600x400 | |
label=Label(top,text='Hello world!',font='Helvetica -12 bold') #设置标签字体的初始大小 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from Tkinter import * | |
def frame(root, side): | |
w = Frame(root) | |
w.pack(side=side, expand=YES, fill=BOTH) | |
return w | |
def button (root, side, text, command=None): | |
w = Button(root, text=text, command=command) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code by 李嘉 | |
# 禁止任何商业目的的转载 | |
# 不对因使用代码产生任何后果负任何责任 | |
# 转载请保留所有声明 | |
import threading, time, httplib, random | |
# 需要测试的 url 列表,每一次的访问,我们随机取一个 | |
urls = [ | |
"/test?page=", | |
"/test2?orderby=a&page=", | |
"/test2?orderby=d&page=", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple preforking echo server in Python. | |
""" | |
import os | |
import sys | |
import socket | |
# Create a socket, bind it to localhost:4242, and start | |
# listening. Runs once in the parent; all forked children |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 说明:PHP中二维数组的排序方法 | |
// 整理:http://www.CodeBit.cn | |
/** | |
* @package BugFree | |
* @version $Id: FunctionsMain.inc.php,v 1.32 2005/09/24 11:38:37 wwccss Exp $ | |
* | |
* | |
* Sort an two-dimension array by some level two items use array_multisort() function. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>测试fix浮动</title> | |
<style type="text/css"> | |
.FixTop{z-index:10000;width:100%;height:24px;position:absolute;position:fixed; | |
bottom:0;right:0;text-align:center;background-color: gray; | |
_position:absolute; | |
_top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? (documentElement.scrollTop + documentElement.clientHeight - 24) : (document.body.scrollTop + document.body.clientHeight -24)); |
OlderNewer