PHP单元测试利器

      你是否在程序开发的过程中遇到以下的情况:当你花了很长的时间开发一个应用后,你认为应该是大功告成了,可惜在调试的时候,老是不断的发现bug,而且最可怕的是,这些bug是重复出现的,你可能发现这些bug之间会有关联,但却老是找不到问题的所在。

新老师

George comes from school on the first of September.

George, how did you like your new teacher? asked his mother.

I didn’t like her, Mother, because she said that three and three were six and then she said that two and four were six too…..

9月1日, 乔治放学回到家里。

乔治,你喜欢你们的新老师吗? 妈妈问。

妈妈,我不喜欢,因为她说3加3得6, 可后来又说2加4也得6。

律师,宝马和胳膊

A lawyer opened the door of his BMW, when suddenly a car came along and hit the door, ripping it off completely. When the police arrived at the scene, the lawyer was complaining bitterly about the damage to his precious BMW. “Officer, look what they’ve done to my Beeeemer!!!”, he whined. “You lawyers are so materialistic, you make me sick!!!” retorted the officer, “You’re so worried about your stupid BMW, that you didn’t even notice that your l ...

狗住旅馆

A man wrote a letter to a small hotel he planned to visit on his vacation: “I would very much like to bring my dog with me. He is well-groomed and very well behaved. Would you be willing to permit me to keep him in my room with me at night?” An immediate reply came from the hotel owner, who said, “I’ve been operating this hotel for many years. In all that time, I’ve never had a dog steal towels, bedclothes, silverware or pictures off the walls. I’ve never ...

The Fish Net(鱼网)

The Fish Net

Can you tell me what fish net is made, Ann?

A lot of little holes tied together with strings. replied the little girl.

鱼网

你能告诉我鱼网是什么做的吗,安? 老师发问道。

把许多小孔用绳子栓在一起就成了鱼网了。 小女孩回答道。

MySQL 当记录不存在时插入,当记录存在时更新

REPLACE语句 我们在使用数据库时可能会经常遇到这种情况。如果一个表在一个字段上建立了唯一索引,当我们再向这个表中使用已经存在的键值插入一条记录,那将会抛出一个 主键冲突的错误。当然,我们可能想用新记录的值来覆盖原来的记录值。如果使用传统的做法,必须先使用DELETE语句删除原先的记录,然后再使用 INSERT插入新的记录。而在MySQL中为我们提供了一种新的解决方案,这就是REPLACE语句。使用REPLACE插入一条记录时,如果不重 复,REPLACE就和INSERT的功能一样,如果有重复记录,REPLACE就使用新记录的值来替换原来的记录值。 ...

加载中……