andy's 学习笔记
zhoumin007 · 共 25 篇文章
mysql common used command
1:connect: mysql -u root -p 2:change password: use mysql update user set Password=password('newpassword') where User='root'; flush privileges; 3:create database discuz; 4:grant all privileges on discuz.* to discuz@localhost identified by '123456';
2008-03-29 12:20 · 数据库 · 评论(0)
windows下phpcms安装
1:环境准备: WAMP:wamp是Windows Apache Mysql PHP集成安装环境 http://www.wampserver.com/en/ php.ini 中 short_open_tag = On(解决 install.php?step= 问题) 2:phpcms下载最新版 http://www.phpcms.cn/ 3:创建一个phpcms的库 4:按提示安装
2008-03-27 21:32 · 评论(0)
mysql忘记密码处理
如果用户忘记了数据库的密码,可以按如下方式进行密码的修改: 如果 MySQL 正在运行,首先停止。 启动 MySQL :bin/safe_mysqld --skip-grant-tables & 就可以不需要密码就进入 MySQL 了。 然后就是 use mysql update user set password=password('new_pass') where user='root'; flush privileges;
2008-02-18 16:17 · 数据库 · 评论(0)
resin ssl配置
http://www.caucho.com/resin-2.1/ref/security.xtp#encryption Create a private key for the server: unix> openssl genrsa -des3 -out gryffindor.key 1024 Configure Resin to use the files: ... /opt/ssl/keys/gryffindor.key password
2008-01-03 18:03 · JAVA · 评论(0)
beast 安装
Step 1.svn checkout http://svn.techno-weenie.net/projects/beast/trunk/ (或http://svn.techno-weenie.net/projects/beast/branches/stable-1.0 稳定版) checkout源代码 Step 2.rake rails:freeze:edge This is needed as Beast uses some of the features in the 'edge' version of Rails, i.e. the version that hasn't been…
2007-09-23 12:11 · ROR · 评论(0)
行为型模式-模板方法模式(Template Method)
一:定义: Template Method :Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. 二:引入 一个咖啡店,卖咖啡和茶。 制作咖啡的步骤是: 把水煮开。 放入咖啡。 把煮好的咖啡倒进杯子。 加糖或奶。 制作茶的步骤是: 把水煮开。…
2007-06-30 23:21 · 评论(0)
行为型模式-观察者模式(Observer)
一:定义: Observer :Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. 二:引入 一个气象观测站的例子: public class WeatherData ...{ private CurrentConditionsDisplay currentConditionsDisplay; private ForecastDisplay forecas…
2007-06-30 23:17 · 评论(0)
结构型模式-适配器模式(Adapter)
一:定义: Adapter :Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces. 二:引入 先来看张图: 墙上的插座是三相的,而我手头的电器(如吹风机是两相的),那么我们就需要一个三相转两相的一个插头. 这个三相转两相的转换器就叫Adapter,对已有的接口不符合我们需要的接口时,写一个转换的接口,来完成对接功能.…
2007-06-30 22:08 · 评论(0)
结构型模式---装饰模式(Decorator)
一:定义: **Decorator:**Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. 二:引入 假设现在有一家咖啡店,经营咖啡,茶等饮料,我们来为它设计一个系统。 问题: 饮料加糖或牛奶等调料时是要另收费的(每包1元),顾客可以要也可以不要,所以这个固定价格的cost方法不符合要求. 不符合OCP(open for extension,close …
2007-06-30 21:55 · 评论(0)
行为型模式--策略模式(Strategy)
一:定义: **Strategy:**Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. 二:引入 假设现在要设计一个贩卖各类书籍的电子商务网站的购物车(Shopping Cat)系统。一个最简单的情况就是把所有货品的单价乘上数量,但是实际情况肯定比这要复杂。 比如: 本网站可能对所有的儿童类图书实行每本一元的折扣; 对计算机类图书提…
2007-06-21 21:40 · 评论(0)
创建型模式--单例模式(Singleton)
**Singleton:**Ensure a class only has one instance, and provide a global point of access to it. 一个类只能有一个实例的创建模式。 一:引入 在某些情况下一个类只能有一个实例,如果多于一个实例就会导致逻辑错误。 非共享资源:如打印机,系统属性文件 其他:如数据库主键生成器,只能有一个地方分配,否则会出现重复主键 EagerSingleton(饿汉式单例): /** *//** * 饿汉式单例 */ public class EagerSingleton ...{ //类加载时实例化 private …
2007-06-17 22:17 · 评论(0)
创建型模式--抽象工厂模式(Abstract Factory)
**Abstract Factory:**Provide an interface for creating families of related or dependent objects without specifying their concrete classes. 抽象工厂(Abstract Factory)模式是所有工厂模式中最抽象和最具有一般性的形态,和工厂方法模式的最大区别在于,工厂方法模式针对的是一个产品等级结构,而抽象工厂模式则需要对多个产品等级结构。 一:引入 最早起源应用于不通操作系统的视窗构件,如一个Button类在windows环境和unix环境下有对应的实现,…
2007-06-17 22:16 · 评论(0)
创建型模式--工厂方法模式(Factory Method)
**Factory Method:**Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. 工厂方法模式又叫虚拟构造子(Virtual Constructor)模式。 一:引入 Simple Factory在一定程度上支持OCP,但并没有完全支持OCP,其一缺点为当有新的产品加入到系统中时还必须修改工厂类。 public int…
2007-06-17 19:08 · 评论(0)
创建型模式--简单工厂模式(Simple Factory)
工厂模式专门负责将大量有共同接口的类的实例化。工厂模式可以动态决定将哪个类实例化,不必事先知道每次需要实例化哪个类。 工厂模式主要有以下几种形态: 简单工厂模式(Simple Factory):又称静态工厂方法(Static Factory Method)模式。 工厂模式(Factory Method):又称多态性工厂(Ploymorphic Factory)模式或虚拟构造函数(Virtual Constructor)模式。 抽象工厂(Abstract Factory)模式:又称工具箱(Toolkit)模式。 本文将简单工厂模式。 一:引入 public class Client...{ p…
2007-06-17 13:39 · 评论(0)
设计模式基础
在介绍具体的设计模式之前,先介绍一些基础知识,主要以JAVA语言为例. 一:UML简介 对一个大型软件系统,没有UML这样的设计图,而直接进行编程是不可想像的.好比建造一栋大厦时不使用设计图纸而直接叫工人去砌砖一样. UML是图标式软件设计语言,主要用来描述系统各部分之间的结构,行为. 设计模式介绍中主要用到的图包括 类图 类之间的关系: 1.Generalization(一般化) 2:Association(关联) 3:Dependency(依赖) 序列图 二:OO principle 面向对象开发的原则:在设计模式背后的原则,对设计模式的基础. Open-Closed Principle…
2007-06-15 15:48 · 评论(0)