有时,退一步,能一口气进几步,只是这先退一步需要勇气和自信。

用心爱你,努力工作。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  57 随笔 :: 0 文章 :: 29 评论 :: 0 Trackbacks

2008年11月30日 #

一、下载街机游戏模拟器 Mame32 Plus 105U5 中文版, 点击下载,
二、下载自己喜欢的rom, 放到模拟器Roms文件目录下,即可。
 1、打击者1945


点击下载

2、打击者1945 增强版


点击下载

3、打击者1945 2代


点击下载

4、打击者1945 3代


点击下载

posted @ 2008-11-30 12:16 王生生 阅读(6) | 评论 (0)编辑 收藏

2008年11月25日 #

    网上找了半天(深入JAVA虚拟机第二版.pdf),才找到的。在这里提供给大家下载,方便别人学习。
下载地址(下完解压即可):http://www.ziddu.com/download/2755023/java.rar.html
posted @ 2008-11-25 21:54 王生生 阅读(49) | 评论 (0)编辑 收藏

2008年11月24日 #

一、下载街机游戏模拟器 Mame32 Plus 105U5 中文版, 点击下载,
二、下载自己喜欢的rom, 放到模拟器Roms文件目录下,即可。
1、三国战纪


点击进入Rom下载页面

2、三国战纪2


点击进入Rom下载页面

3、三国志一代


点击进入Rom下载页面

4、三国志二代


点击进入Rom下载页面

5、三圣剑三国志


点击进入Rom下载页面

posted @ 2008-11-24 21:17 王生生 阅读(32) | 评论 (0)编辑 收藏

1、提供街机拳皇系列94-2005游戏,想玩的人可以下来玩。
2、先下载模拟器, 模拟器,点击下载
3、再下载自己喜欢的rom, 放到模拟器Roms文件目录下,即可。



点击下载




点击下载


点击下载



97普通版rom,点击下载

97加强版rom,点击下载



98rom,点击进入下载页面



99rom,点击进入下载页面





2000rom,点击进入下载页面






2001rom,点击进入下载页面




2002rom,点击进入下载页面





2003rom,点击进入下载页面




2004rom,点击进入下载页面




2005rom,点击进入下载页面
posted @ 2008-11-24 17:36 王生生 阅读(222) | 评论 (0)编辑 收藏

2008年11月22日 #


  1. 安装Wordpress主题
  2. Wordpress要求主题存放在wp-content/themes/目录,你只需将你喜爱的主题(含主题文件夹)用ftp上传到该目录,并在Dashboard(后台)-Design(外观)激活你上传的主题即可

  3. 安装Wordpress插件
  4. 同样,Wordpress要求插件存放在wp-content/plugins/目录,你只需将你喜爱的插件(含插件文件夹)用ftp上传到该目 录,尔后在Dashboard(后台)-Plugins(插件)激活你上传的插件,如若插件需要设置,请根据插件说明进行设置即可

posted @ 2008-11-22 14:13 王生生 阅读(17) | 评论 (0)编辑 收藏

WordPress 官方原版

WordPress 2.6.2下载地址:http://www.ziddu.com/download/2722092/wordpress-2.6.2.zip.html


安装步骤:
1、下载解压后,放到php的web目录下
2、修改wp-config-sample.php,数据库名称、用户名、密码

define('DB_NAME', '你的数据库名');    // The name of the database
define('DB_USER', '用户名');     // Your MySQL username
define('DB_PASSWORD', '密码'); // ...and password

3、wp-config-sample.php重新命名为 wp-config.php
到此,安装完成。

WordPress 中文团队也已经根据官方的压缩包制作出了简体中文版。

WordPress.MU.v2.6.2.Simp.Chinese 汉化包下载:
http://www.ziddu.com/download/2722118/ordPress.MU.v2.6.2.Simp.Chinese.pack.only.v1-wpcng.zip.html


直接将汉化包,放到wp-content目录下,修改wp-config.php中的“define (’WPLANG’, ”);”为“define (’WPLANG’, ‘zh_CN’);”;
到此,汉化完成。

或者直接下载,WordPress 2.6.3中文版下载地址:http://www.ziddu.com/download/2721797/wordpress.263.chs.zip.html


posted @ 2008-11-22 13:25 王生生 阅读(14) | 评论 (0)编辑 收藏

2008年11月15日 #

单例模式 有以下的特点:

  1. 单例类只能有一个实例。
  2. 单例类必须自己创建自己的唯一的实例。
  3. 单例类必须给所有其他对象提供这一实例。

代码:

Singleton.php :

<?php
class Singleton
{
    private static $instance;

    private function __construct()
    {
    }

    public static function getInstance()
    {
        if(self::$instance == null)
        {
            self::$instance = new Singleton();
        }

        return self::$instance;
    }
}
?>

在使用的时候,因为构造方法是private(私有)的,所以是不能直接实例化的,必须使用类似下面的方法:

例子:

<?php
require_once('Singleton.php ');

$instance = Singleton::getInstance();
?>

============================================

其它关于静态的说明

静态成员.
他在类被声明时就产生了,也就是在程序编译阶段产生的,它只有一个所有该类实例共享的原本,任何该类实例更改静态变量的值后,其它该类实例再去访问该静态变量,其值已经变成更改后的值,因为其在内存,就存一个原本。
非静态成员是在类实例化时产生的,你new一个该类实例,系统就会为该类实例的所有非静态成员新开辟一个空间,每个实例都只能自己的非静态成员。(有多少个类的实例,就要开辟多少个非静态成员的空间)

单例类全局只有一个实例,你可以把它看成全局对象。

从底层来说,编译完成后主要是两个部分,一是CPU指令,这一部分包含各种方法;二是数据,也就是程序定义的各种类型的变量。运行程序实例化一个对象时,按如下方式分配内存:
1。在程序启动时将静态数据和静态方法放入堆内存中。
2。第一次实例化对象时将其它方法放入代码段中。
3。每次实例化对象时将其它数据放入栈内存中。
实例化同一个对象时,上述1、2项不动,只是再加一个第3项即可。销毁一个实例的时候,如果还有其它的实例存在,就只释放该实例的栈数据段(上述第3项)。

根据以上原理回答您的问题
静态方法和数据一般都是Public型的,用于类的极普遍的事物处理,可以在程序的任意地方调用,在整过程序运行过程中始终占用计算机内存,一搬少用。如果一个程序中的各个对象都用一个数据库的话,可以使用静态方法连接。

单件模式的实例销毁时可以释放所有的非静态方法和数据,,如果把这个类的所有方法都设计为静态的,这些方法将一直占用内存,浪费资源,不可取。

在new一个对象时,只是加一个数据段,并不重新加载方法和静态变量。

最后说一个变量传送的问题,网上很多朋友在回答类之间参数传递时都说用静态变量,我认为这种方法不好,本来加类的目的就是为了封装,如果用一个类似于全局变量的静态变量作为参数就大大削弱了封装的意义。

实际上,系统和应用程序对内存的管理相当复杂.
=======================下面摘自思归的文字

从表面上看,静态(static)成员可以通过 类名.成员名 来直接调用,而实例(instance)成员需要生成一个对象后才能调用。同一个操作,性能当然静态成员好

但其实区别是跟对象设计有关的,一般来说实例成员跟实例的状态有关,某个方法的调用可能需要访问当前对象的状态,并改变其状态,从而影响其他方法的结果

而静态成员是跟类本身有关,与单独的实例状态无关。但静态成员不要太多了,否则就沦为以前的procedural programming风格了,也许对象需要重新设计或重构。

静态成员往往会在多线程下操作,需要做同步化控制

posted @ 2008-11-15 17:52 王生生 阅读(6) | 评论 (0)编辑 收藏

优化PHP代码的40条建议
40 Tips for optimizing your php Code
原文地址:http://reinholdweber.com/?p=3
英文版权归Reinhold Weber所有,中译文作者yangyang(aka davidkoree)。双语版可用于非商业传播,但须注明英文版作者、版权信息,以及中译文作者。翻译水平有限,请广大PHPer指正。

1. If a method can be static, declare it static. Speed improvement is by a factor of 4. 如果一个方法可静态化,就对它做静态声明。速率可提升至4倍。

2. echo is faster than print. echo 比 print 快。

3. Use echo’s multiple parameters instead of string concatenation. 使用echo的多重参数(译注:指用逗号而不是句点)代替字符串连接。

4. Set the maxvalue for your for-loops before and not in the loop. 在执行for循环之前确定最大循环数,不要每循环一次都计算最大值。

5. Unset your variables to free memory, especially large arrays. 注销那些不用的变量尤其是大数组,以便释放内存。

6. Avoid magic like __get, __set, __autoload 尽量避免使用__get,__set,__autoload。

7. require_once() is expensive require_once()代价昂贵。

8. Use full paths in includes and requires, less time spent on resolving the OS paths. 在包含文件时使用完整路径,解析操作系统路径所需的时间会更少。

9. If you need to find out the time when the script started executing, $_SERVER[’REQUEST_TIME’] is preferred to time() 如果你想知道脚本开始执行(译注:即服务器端收到客户端请求)的时刻,使用$_SERVER[‘REQUEST_TIME’]要好于time()。

10. See if you can use strncasecmp, strpbrk and stripos instead of regex. 检查是否能用strncasecmp,strpbrk,stripos函数代替正则表达式完成相同功能。

11. str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4. str_replace函数比preg_replace函数快,但strtr函数的效率是str_replace函数的四倍。

12. If the function, such as string replacement function, accepts both arrays and single characters as arguments, and if your argument list is not too long, consider writing a few redundant replacement statements, passing one character at a time, instead of one line of code that accepts arrays as search and replace arguments. 如果一个字符串替换函数,可接受数组或字符作为参数,并且参数长度不太长,那么可以考虑额外写一段替换代码,使得每次传递参数是一个字符,而不是只写一行 代码接受数组作为查询和替换的参数。

13. It’s better to use select statements than multi if, else if, statements. 使用选择分支语句(译注:即switch case)好于使用多个if,else if语句。

14. Error suppression with @ is very slow. 用@屏蔽错误消息的做法非常低效。

15. Turn on apache’s mod_deflate 打开apache的mod_deflate模块。

16. Close your database connections when you’re done with them. 数据库连接当使用完毕时应关掉。

17. $row[’id’] is 7 times faster than $row[id]. $row[‘id’]的效率是$row[id]的7倍。

18. Error messages are expensive. 错误消息代价昂贵。

19. Do not use functions inside of for loop, such as for ($x=0; $x < count($array); $x) The count() function gets called each time. 尽量不要在for循环中使用函数,比如for ($x=0; $x < count($array); $x)每循环一次都会调用count()函数。

20. Incrementing a local variable in a method is the fastest. Nearly the same as calling a local variable in a function. 在方法中递增局部变量,速度是最快的。几乎与在函数中调用局部变量的速度相当。

21. Incrementing a global variable is 2 times slow than a local var. 递增一个全局变量要比递增一个局部变量慢2倍。

22. Incrementing an object property (eg. $this->prop++) is 3 times slower than a local variable. 递增一个对象属性(如:$this->prop++)要比递增一个局部变量慢3倍。

23. Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one. 递增一个未预定义的局部变量要比递增一个预定义的局部变量慢9至10倍。

24. Just declaring a global variable without using it in a function also slows things down (by about the same amount as incrementing a local var). PHP probably does a check to see if the global exists. 仅定义一个局部变量而没在函数中调用它,同样会减慢速度(其程度相当于递增一个局部变量)。PHP大概会检查看是否存在全局变量。

25. Method invocation appears to be independent of the number of methods defined in the class because I added 10 more methods to the test class (before and after the test method) with no change in performance. 方法调用看来与类中定义的方法的数量无关,因为我(在测试方法之前和之后都)添加了10个方法,但性能上没有变化。

26. Methods in derived classes run faster than ones defined in the base class. 派生类中的方法运行起来要快于在基类中定义的同样的方法。

27. A function call with one parameter and an empty function body takes about the same time as doing 7-8 $localvar++ operations. A similar method call is of course about 15 $localvar++ operations. 调用带有一个参数的空函数,其花费的时间相当于执行7至8次的局部变量递增操作。类似的方法调用所花费的时间接近于15次的局部变量递增操作。

28. Surrounding your string by ‘ instead of " will make things interpret a little faster since php looks for variables inside "…" but not inside ‘…’. Of course you can only do this when you don’t need to have variables in the string. 用单引号代替双引号来包含字符串,这样做会更快一些。因为PHP会在双引号包围的字符串中搜寻变量,单引号则不会。当然,只有当你不需要在字符串中包含变 量时才可以这么做。

29. When echoing strings it’s faster to separate them by comma instead of dot. Note: This only works with echo, which is a function that can take several strings as arguments. 输出多个字符串时,用逗号代替句点来分隔字符串,速度更快。注意:只有echo能这么做,它是一种可以把多个字符串当作参数的“函数”(译注:PHP手册 中说echo是语言结构,不是真正的函数,故把函数加上了双引号)。

30. A PHP script will be served at least 2-10 times slower than a static HTML page by Apache. Try to use more static HTML pages and fewer scripts. Apache解析一个PHP脚本的时间要比解析一个静态HTML页面慢2至10倍。尽量多用静态HTML页面,少用脚本。

31. Your PHP scripts are recompiled every time unless the scripts are cached. Install a PHP caching product to typically increase performance by 25-100% by removing compile times. 除非脚本可以缓存,否则每次调用时都会重新编译一次。引入一套PHP缓存机制通常可以提升25%至100%的性能,以免除编译开销。

32. Cache as much as possible. Use memcached - memcached is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load. OP code caches are useful so that your script does not have to be compiled on every request. 尽量做缓存,可使用memcached。memcached是一款高性能的内存对象缓存系统,可用来加速动态Web应用程序,减轻数据库负载。对运算码 (OP code)的缓存很有用,使得脚本不必为每个请求做重新编译。

33. When working with strings and you need to check that the string is either of a certain length you’d understandably would want to use the strlen() function. This function is pretty quick since it’s operation does not perform any calculation but merely return the already known length of a string available in the zval structure (internal C struct used to store variables in PHP). However because strlen() is a function it is still somewhat slow because the function call requires several operations such as lowercase & hashtable lookup followed by the execution of said function. In some instance you can improve the speed of your code by using an isset() trick. 当操作字符串并需要检验其长度是否满足某种要求时,你想当然地会使用strlen()函数。此函数执行起来相当快,因为它不做任何计算,只返回在zval 结构(C的内置数据结构,用于存储PHP变量)中存储的已知字符串长度。但是,由于strlen()是函数,多多少少会有些慢,因为函数调用会经过诸多步 骤,如字母小写化(译注:指函数名小写化,PHP不区分函数名大小写)、哈希查找,会跟随被调用的函数一起执行。在某些情况下,你可以使用isset() 技巧加速执行你的代码。

Ex.(举例如下)
if (strlen($foo) < 5) { echo "Foo is too short"; }
vs.(与下面的技巧做比较)
if (!isset($foo{5})) { echo "Foo is too short"; }

Calling isset() happens to be faster then strlen() because unlike strlen(), isset() is a language construct and not a function meaning that it’s execution does not require function lookups and lowercase. This means you have virtually no overhead on top of the actual code that determines the string’s length. 调用isset()恰巧比strlen()快,因为与后者不同的是,isset()作为一种语言结构,意味着它的执行不需要函数查找和字母小写化。也就是 说,实际上在检验字符串长度的顶层代码中你没有花太多开销。

34. When incrementing or decrementing the value of the variable $i++ happens to be a tad slower then ++$i. This is something PHP specific and does not apply to other languages, so don’t go modifying your C or Java code thinking it’ll suddenly become faster, it won’t. ++$i happens to be faster in PHP because instead of 4 opcodes used for $i++ you only need 3. Post incrementation actually causes in the creation of a temporary var that is then incremented. While pre-incrementation increases the original value directly. This is one of the optimization that opcode optimized like Zend’s PHP optimizer. It is still a good idea to keep in mind since not all opcode optimizers perform this optimization and there are plenty of ISPs and servers running without an opcode optimizer. 当执行变量$i的递增或递减时,$i++会比++$i慢一些。这种差异是PHP特有的,并不适用于其他语言,所以请不要修改你的C或Java代码并指望它 们能立即变快,没用的。++$i更快是因为它只需要3条指令(opcodes),$i++则需要4条指令。后置递增实际上会产生一个临时变量,这个临时变 量随后被递增。而前置递增直接在原值上递增。这是最优化处理的一种,正如Zend的PHP优化器所作的那样。牢记这个优化处理不失为一个好主意,因为并不 是所有的指令优化器都会做同样的优化处理,并且存在大量没有装配指令优化器的互联网服务提供商(ISPs)和服务器。

35. Not everything has to be OOP, often it is too much overhead, each method and object call consumes a lot of memory. 并不是事必面向对象(OOP),面向对象往往开销很大,每个方法和对象调用都会消耗很多内存。

36. Do not implement every data structure as a class, arrays are useful, too. 并非要用类实现所有的数据结构,数组也很有用。

37. Don’t split methods too much, think, which code you will really re-use. 不要把方法细分得过多,仔细想想你真正打算重用的是哪些代码?

38. You can always split the code of a method later, when needed. 当你需要时,你总能把代码分解成方法。

39. Make use of the countless predefined functions. 尽量采用大量的PHP内置函数。

40. If you have very time consuming functions in your code, consider writing them as C extensions. 如果在代码中存在大量耗时的函数,你可以考虑用C扩展的方式实现它们。

41. Profile your code. A profiler shows you, which parts of your code consumes how many time. The Xdebug debugger already contains a profiler. Profiling shows you the bottlenecks in overview. 评估检验(profile)你的代码。检验器会告诉你,代码的哪些部分消耗了多少时间。Xdebug调试器包含了检验程序,评估检验总体上可以显示出代码 的瓶颈。

42. mod_gzip which is available as an Apache module compresses your data on the fly and can reduce the data to transfer up to 80%. mod_zip可作为Apache模块,用来即时压缩你的数据,并可让数据传输量降低80%。

43. Excellent Article (http://phplens.com/lens/php-book/optimizing-debugging-php.php)about optimizing php by John Lim 另一篇优化PHP的精彩文章,由John Lim撰写。

posted @ 2008-11-15 17:51 王生生 阅读(5) | 评论 (0)编辑 收藏

三星i908E广告曲Melee ―― Built To Last 专辑

三星手机i908E的最新广告歌Built To Last,来自Melee乐团2007的专辑「Devils & Angels 」。
其实专辑的歌曲风格并不象封面那样阴暗,反而旋律动听,节奏轻快爽朗,充满了一种向上的朝气和活力。吉他演奏清爽,并大量加入了钢琴,使得歌曲显的优雅柔情,带来更多的变化和旋律性。

推荐理由:   
   
魅力帮是美国摇滚团体Melee rocks的中文译称,其成员主要来自美国加州橘郡,分别是Chris Cron(主唱/键盘/吉他)、 Ricky Sans(吉他/主唱)、Ryan Malloy(贝斯/主唱)以及Mike Nader(鼓手)。2007年签约华纳唱片后推出年度大碟「Devils & Angels」,专辑所要传达的主题是美国时下二十来岁年轻人的故事,关于人生、爱情以及朋友的一些感受。乐曲轻快动人,主唱Chirs歌声激扬,配合充满意境的钢琴弹奏,展现了独特的旋律特点。
首支单曲「Built To Last」,就在流畅的摇滚音乐线条中流露出乐团沉稳、明快的歌声情感;
钢琴情歌「Can’t Hold On」描述着Chirs听见自己所认识的朋友突然过世的消息后,反省自我对于情感表达的麻木;
「Imitation」这首歌则是在承受压力之后所领悟到给予支持的重要;
「Rhythm Of Rain」这首歌的灵感则是深受卡翠娜飓风的启发。此外,乐团也重新诠释了Hall & Oates的1981年TOP 5单曲「You Make My Dreams」
魅力帮(Melee)的流行摇滚音乐有著一份难以抗拒的自在快感,还有一份触动人心的真实感动,Piano Pop新帮主的魅力充分展现在他们入主华纳唱片公司的首张大碟「Devils & Angels」中,尽情地挥洒著当代英式摇滚乐团以钢琴与人声创造动人歌曲的神采,并且找回了好久不见的加州摇滚活力。
专辑曲目:
01. Built To Last  (三星i908E广告曲) 点击下载
02. Rhythm Of Rain  点击下载
03. Frequently Baby (Shes A Teenage Maniac) 点击下载
04. For A Lifetime 点击下载
05. Drive Away  点击下载
06. Cant Hold On  (重点推荐) 点击下载
07. Imitation  点击下载
08. Love Carries On  点击下载
09. Shes Gonna Find Me Here 点击下载
10. Biggest Mistake  点击下载
11. You Got  点击下载
12. Stand Up 点击下载

posted @ 2008-11-15 14:41 王生生 阅读(84) | 评论 (0)编辑 收藏

2008年11月14日 #

    做为一名程序员,呵呵,有时候总会想起儿时打街机的快乐,因此在blog上提供一些经典的游戏与大家分享。玩归玩,一切以工作为重,偶尔玩玩,可以更好的投入到工作中。

一、先下载模拟器WinKawaks, 模拟器下载地址,再下载自己喜欢的rom, 放到模拟器Roms文件目录下,然后加载游戏即可。

1、96、97、98、99街机拳皇
96rom,点击进入下载页面



97普通版rom,点击进入下载页面

97加强版rom,点击进入下载页面

98rom,点击进入下载页面



99rom,点击进入下载页面

2、街头篮球


点击进入Rom下载页面

3、恐龙快打


点击进入Rom下载页面

4、三个奇迹


点击进入Rom下载页面

5、名将


点击进入Rom下载页面

6、惩罚者


点击进入Rom下载页面

7、三国志二代


点击进入Rom下载页面

8、合金弹头


点击进入Rom下载页面
9、超能战警对街头霸王


点击进入Rom下载页面

10、战国传承 3


点击进入Rom下载页面

11、打击者1945 加强版


点击进入Rom下载页面

 

12、侍魂1 十二剑客录


点击进入Rom下载页面

 

13、炸弹人 机皇版


点击进入Rom下载页面

14、侍魂2


点击进入Rom下载页面

15、1941 反击战


点击进入Rom下载页面

16、圆桌骑士


点击进入Rom下载页面

17、威虎战机


点击进入Rom下载页面

18、风速英雄


点击进入Rom下载页面

 

19、三国志吞食天地 一代


点击进入Rom下载页面

 

二、另一模拟器Mame32上面玩的游戏
(一)、下载街机游戏模拟器 Mame32 Plus 105U5 中文版, Mame32模拟器,点击进入下载页面,
(二)、下载自己喜欢的rom, 放到模拟器Roms文件目录下,即可。
1、野球格斗(忍者棒球)


点击进入Rom下载页面

2、西游记


点击进入Rom下载页面

3、铁钩船长


点击进入Rom下载页面

4、西部牛仔(落日骑士)


点击进入Rom下载页面

4、西部牛仔射击版


点击进入Rom下载页面

5、变身忍者


点击进入Rom下载页面

6、大家来找茬


点击进入Rom下载页面

7、双截龙3罗塞塔之石


点击进入Rom下载页面

8、坦克力量


点击进入Rom下载页面

9、麻将 幸运满贯


点击进入Rom下载页面

10、雪人兄弟


点击进入Rom下载页面

11、三国战纪


点击进入Rom下载页面

12、机甲神兵


点击进入Rom下载页面

13、台球撞球 美女花式桌球


点击进入Rom下载页面

14、少妇杀手


点击进入Rom下载页面

15、神话战士


点击进入Rom下载页面

16、丝绸之路


点击进入Rom下载页面

17、天外魔境真传 东方伊甸园


点击进入Rom下载页面

18、异型魂斗罗


点击进入Rom下载页面

19、战斧2


点击进入Rom下载页面

20、超级魂斗罗


点击进入Rom下载页面

21、魂斗罗


点击进入Rom下载页面

22、三国战纪2


点击进入Rom下载页面

23、组合战机


点击进入Rom下载页面

posted @ 2008-11-14 12:54 王生生 阅读(1080) | 评论 (0)编辑 收藏

仅列出标题  下一页