最近忙于工作几个月,学的东西差不多都没了。偶然看见招聘公司总是提到oop思想,说实话在实际开发中用了多少oop我还真不知道,先复习一下吧。 oop中文名字就叫面向对象,它主要是干嘛呢,敲代码的?翻翻资料:oop是一种程序设计范型,也是一种程序开发方法。 它起到什么用处:它将对象作为程序的基本单元,将程序和数据封装其中,以提高软件的重用性、灵活性和可扩展性。优化代码?有点像。 面向对象的核心思想:对象(类)、封装、可重用性和可扩展性(最后2个也可叫继承、多态)。
最新文章
I’ve been busy with work for the past few months, and most of what I learned is nearly gone. I happened to notice that hiring companies always bring up oop thinking, and to be honest I really don’t know how much oop I actually use in real development, so let me review it first. The Chinese name for oop is 面向对象, meaning object-oriented; what is it mainly for — writing code? Let me look through some references: oop is a programming paradigm, and also a software development method. What use is it: it takes objects as the basic unit of a program and encapsulates the program and the data within them, in order to improve the reusability, flexibility, and extensibility of software. Optimizing code? Sort of. The core ideas of object orientation: objects (classes), encapsulation, reusability and extensibility (the last two can also be called inheritance and polymorphism).
并不是音乐动听,也不是花鸟私语。穿梭在尘世间的溪流里,反反复复,支撑你的是一个执着和蜕变。再来的时候已经来了,不必苛求什么,停顿的脚步身会吸引的注意力,引领你爱上这里。
It isn’t the music being lovely, nor the whispers of flowers and birds. Threading through the streams of this mortal world, over and over, what sustains you is a persistence and a transformation. When the time to return comes, it has already come; there’s no need to demand anything. A paused footstep will draw attention, and lead you to fall in love with this place.
单独配置php环境比较浪费时间,用集成环境速度快,但是添加扩展比较麻烦,总之各有好处。
win系统中php集成环境
phpstudy这个集成目前算是比较优秀的基本上涵盖所有php版本和服务其配置,可以任意切换不同版本,相对于开发者来说,一些框架的特殊要求,不必再来回更换php版本。 下载地址 phpStudy-x64.zip phpStudy-install.zip phpStudy2014.1404454619.rar phpStudy2013.zip 默认mysql用户名密码都是root appserv集成环境也一般般,只是目前只看到32位的,不过也符合一些公司使用 下载地址 appserv-win32-2.5.10.exe
Configuring a php environment on your own wastes a lot of time; an integrated environment is faster, but adding extensions is more troublesome — in short, each has its advantages.
PHP integrated environments on Windows
phpstudy is currently one of the better integrated environments — it basically covers every php version and its server configuration, and you can switch between versions freely, so when a framework has special requirements, developers don’t have to keep swapping php versions back and forth. Download links phpStudy-x64.zip phpStudy-install.zip phpStudy2014.1404454619.rar phpStudy2013.zip By default the mysql username and password are both root. The appserv integrated environment is only so-so, and so far I’ve only seen a 32-bit build, though it still suits what some companies use. Download link appserv-win32-2.5.10.exe
由于我的网站是海外服务器,经常被联通给k掉,在家里用的长城宽带总是登录不上或者打不开网站,干脆就修改dns,试了试结果很令人满意。软件无意中得到 的来源于dnspod网站,测试本地可建立一个.txt文件,放入自己的顶级域名,打开软件,然后读取域名,就可以检测到域名,解析的dns.
Since my website is on an overseas server, it often gets knocked out by China Unicom, and the Great Wall Broadband I use at home can never log in to or open the site. So I just changed the DNS, tried it out, and the result was very satisfying. I came across this software by accident, and it comes from the dnspod website. To test it, create a .txt file locally, put in your own top-level domain, open the software, then read the domains, and it will detect the domain and the DNS it resolves to.
CentOS-6.5-x86_64-LiveCD.iso CentOS-6.5-x86_64-LiveDVD.iso CentOS-6.5-x86_64-bin-DVD1.iso (比较全的系统,有大部分软件) CentOS-6.5-x86_64-bin-DVD2.iso (对上DVD1的补充) 下载:http://yunpan.cn/cgnqyggJJvYaD 提取码 54b2 CentOS-6.5-i386-LiveDVD.iso CentOS-6.5-i386-LiveCD.iso CentOS-6.5-i386-bin-DVD2.iso(对上DVD1的补充) CentOS-6.5-i386-bin-DVD1.iso(比较全的系统,有大部分软件) 下载:http://yunpan.cn/cgnYNATiGayCM 提取码 d567
CentOS-6.5-x86_64-LiveCD.iso CentOS-6.5-x86_64-LiveDVD.iso CentOS-6.5-x86_64-bin-DVD1.iso (a fairly complete system, with most of the software included) CentOS-6.5-x86_64-bin-DVD2.iso (a supplement to DVD1) Download: http://yunpan.cn/cgnqyggJJvYaD Extraction code: 54b2 CentOS-6.5-i386-LiveDVD.iso CentOS-6.5-i386-LiveCD.iso CentOS-6.5-i386-bin-DVD2.iso (a supplement to DVD1) CentOS-6.5-i386-bin-DVD1.iso (a fairly complete system, with most of the software included) Download: http://yunpan.cn/cgnYNATiGayCM Extraction code: d567
memcached 高速缓存工具(linux) wget https://sourceforge.net/projects/erik1314/files/memcache/libevent-1.4.14b-stable.tar.gz wget https://sourceforge.net/projects/erik1314/files/memcache/memcached-1.4.20.tar.gz wget https://sourceforge.net/projects/erik1314/files/memcache/memcache-2.2.1.tgz libevent-1.4.14b-stable.tar.gz memcached-1.4.20.tar.gz memcache-2.2.1.tgz
memcached high-speed caching tool (linux) wget https://sourceforge.net/projects/erik1314/files/memcache/libevent-1.4.14b-stable.tar.gz wget https://sourceforge.net/projects/erik1314/files/memcache/memcached-1.4.20.tar.gz wget https://sourceforge.net/projects/erik1314/files/memcache/memcache-2.2.1.tgz libevent-1.4.14b-stable.tar.gz memcached-1.4.20.tar.gz memcache-2.2.1.tgz
memcached配置好久没怎么搞懂,今天就试试还真弄成了 首先,下载文件 wget http://sourceforge.net/projects/erik1314/files/memcache/libevent-1.4.14b-stable.tar.gz wget http://sourceforge.net/projects/erik1314/files/memcache/memcached-1.4.20.tar.gz wget http://sourceforge.net/projects/erik1314/files/memcache/memcache-2.2.1.tgz 如果新手不太懂命令下载可以直接点击下面的下载到本地。然后再用ftp上传到服务器 libevent-1.4.14b-stable.tar.gz memcached-1.4.20.tar.gz memcache-2.2.1.tgz 因为考虑到文件的完整性建议最好在服务器上解压 解压文件 tar xzfv libevent-1.4.14b-stable.tar.gz 给权限 chmod -R 777 libevent-1.4.14b-stable 进入文件 cd libevent-1.4.14b-stable 一次编译安装 ./configure (这里也可以指定,目录根据自己实际情况来选择) make && make install 笔者默认安装到/usr/local/lib/目录
I never quite understood how to configure memcached, so I gave it a try today and actually got it working First, download the files wget http://sourceforge.net/projects/erik1314/files/memcache/libevent-1.4.14b-stable.tar.gz wget http://sourceforge.net/projects/erik1314/files/memcache/memcached-1.4.20.tar.gz wget http://sourceforge.net/projects/erik1314/files/memcache/memcache-2.2.1.tgz If you’re a beginner who isn’t comfortable with commands, you can just click the downloads below to save the files locally, then upload them to the server with ftp libevent-1.4.14b-stable.tar.gz memcached-1.4.20.tar.gz memcache-2.2.1.tgz For the sake of file integrity, it’s best to unpack them on the server Unpack the files tar xzfv libevent-1.4.14b-stable.tar.gz Give permissions chmod -R 777 libevent-1.4.14b-stable Enter the directory cd libevent-1.4.14b-stable Compile and install in one go ./configure (you can specify a directory here too, pick one that suits your setup) make && make install The author installed to the default /usr/local/lib/ directory
wordpres断断续续捣鼓了一段时间,总算有自己的网站了,今天算完全能用了,突然发现标签字体很模糊。
从百度得到的答案是:
WordPress 默认标签云的字体最小为8pt,最大为22pt,标签显示数量为45个,按标签名称升序排列。但是用火狐查到是修改style.css样式的,可是怎么找也找不到,怎么办……无奈的百度 修改 WordPress 标签云方法 打开 wp-includes/category-template.php 搜索 wp_tag_cloud 找到 ‘smallest’ => 8, ‘largest’ => 22, ‘unit’ => ‘pt’, ‘number’ => 45,‘format’ => ‘flat’, ‘separator’ => “\n”, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, 具体的参数说明: smallest – 定义标签的最小字号,默认为 8;largest – 定义标签的最大字号,默认为 22;unit – 设置字号类型,如 “pt” 或 “px” 等,默认为 “pt” 类型; number – 设置标签云数量,默认显示 45 个标签;orderby – 设置按 “name” 或 “count” 排序,默认为 “name” 方式;(注:orderby=count 表示按照标签使用次数排列)order – 设置按 “DESC” 或 “ASC” 升降序排列,默认为 “ASC” 升序。 根据自己需求修改 wp_tag_cloud 函数的具体参数即可实现标签云的自定义,然后把category-template.php文件上传到空间中替换原文件。
After tinkering with wordpres on and off for a while, I finally had my own website. Today it’s finally fully usable, when I suddenly noticed the tag font was very blurry.
The answer I got from Baidu was:
WordPress’s default tag cloud has a minimum font size of 8pt and a maximum of 22pt, displays 45 tags, and sorts them in ascending order by tag name. But checking with Firefox showed that it’s done by modifying the style.css stylesheet — yet no matter how I looked, I couldn’t find it. What to do… helpless, I turned to Baidu. How to modify the WordPress tag cloud Open wp-includes/category-template.php, search for wp_tag_cloud, and you’ll find ‘smallest’ => 8, ‘largest’ => 22, ‘unit’ => ‘pt’, ‘number’ => 45,‘format’ => ‘flat’, ‘separator’ => “\n”, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, Specific parameter descriptions: smallest – defines the minimum font size for tags, default 8; largest – defines the maximum font size for tags, default 22; unit – sets the font size unit, such as “pt” or “px”, default “pt”; number – sets the number of tags in the cloud, default 45 tags; orderby – sets sorting by “name” or “count”, default “name”; (Note: orderby=count means sorting by how many times a tag is used) order – sets ascending or descending order via “DESC” or “ASC”, default “ASC” ascending. Just modify the specific parameters of the wp_tag_cloud function according to your own needs to customize the tag cloud, then upload the category-template.php file to your hosting space to replace the original file.
