本文目录一览:
- 1、有没有技术大牛了解java开发,测试和CI的关
- 2、该选择哪个开源数据库
- 3、Web 有哪些 Erlang 语言应用的例子
- 4、韩国唱片工业协会是什么?网址?
- 5、mac brew 怎么安装msql 5.5
有没有技术大牛了解java开发,测试和CI的关
大家可能对如下情景比较熟悉:
如果开发过SSH的web项目,启动服务器可能会比较慢,有的项目甚至需要1分多钟,甚至更多,这个启动时间的等待一般就浪费了;
在开发项目时,有些功能比较复杂,当时觉得思路特清晰,但是过了一段时间后,自己也忘了,完善功能时频繁出现bug,降低开发速度;
在维护项目时,不知道自己修改的对还是不对,是否存在隐患;维护速度降下来了;
如果开发一个很多人都使用的接口,典型的如用户系统,要保证比如升级时向下兼容;
在团队间协作时,有时候只定义好接口,对方还没有给实现,如何进行同步开发?
如上问题,估计只要是个开发人员,都可能遇到过;如果此时有了单元/集成测试,那我们能很好的解决这些问题。(注:加下来如果没有特殊情况,不刻意强调 单元测试/集成测试,即提到测试是指的是单元/集成测试)
我从以下几个方面介绍测试:
1、为什么需要测试?
2、如何进行测试?
3、测试有哪些好处?
4、一切都需要测试吗?
1、为什么需要测试?
测试的目的是什么?我的理解是:
缩短发现问题到解决问题的速度;
给程序一个修改后能验证是否正确的保证;(回归测试)
如果是开源软件,我们可以通过单元测试了解其是怎么使用的;比如我之前通过cglib的单元测试学习过cglib的使用;
所以如果你遇到如上问题,就需要写测试。写测试可能是为了自己(1、2);也可能是为了帮助别人(3)。
2、如何进行测试?
很多朋友不知道如何进行测试,其实测试很简单,别把它想复杂了,按照自己的想法测试每个功能点是否正确即可。
2.1、测试流程
单元测试流程
集成测试流程
集成测试流程
可以看出,单元测试与集成测试唯一不同点是一个调用依赖系统而一个不调用;因为单元测试是最小粒度的测试,如在Java中是测试一个类,不会测试依赖系统;而集成测试是会测试依赖系统的。
测试的步骤:
准备环境
调用被测系统
验证
清理环境
环境:也叫做夹具(fixture)或者固件,表示调用被测系统时需要准备/清理的数据等等;
被测系统:在Java中就是要测试的类,如UserService;
依赖系统:测试被测系统时,其依赖的部分,如UserDao;
测试用例:包含测试方法的类,里边有很多测试方法来测试被测系统。
接下来仔细看看各部分都做了哪些工作。
2.2、环境
环境,也叫做夹具(fixture),表示调用被测系统时需要准备/清理的数据等等;保证测试时环境是干净的,如不被之前的数据库数据影响;保证每次测试都是在干净/新鲜的环境中执行的。所谓干净的环境表示如当前测试不被之前测试插入/删除/修改的数据造成影响。在junit中可以使用:-phpriak
@Before(setUp) 安装夹具或准备环境:在测试用例的每个测试方法之前执行;比如创建新鲜的被测系统,单元测试时安装Mock的依赖系统;
@After(tearDown)卸载夹具或清理环境:在测试用例的每个测试方法之后执行;比如数据库测试时回滚事务,删除数据;关闭文件;
@BeforeClass:在整个测试用例之前执行;
@AfterClass:在整个测试用例之后执行;
使用如上方法,而不是直接在测试方法中安装/卸载;是因为不管有没有异常,@After/@AfterClass都会执行,这样防止出现异常可能造成环境是不新鲜的问题。
如果大家使用spring test来测试数据库相关的系统,可以考虑使用@TransactionConfiguration来支持默认事务回滚,这样不会对现有系统造成影响。具体可参考《【第十三章】 测试 之 13.1 概述 13.2 单元测试 ——跟我学spring3》和《【第十三章】 测试 之 13.3 集成测试 ——跟我学spring3》-phpriak
测试时一定要保证环境是干净/新鲜的,才能保证每次测试的结果是一样的。
2.3、被测系统与依赖系统
被测系统:在Java中就是被测试的Java类。
依赖系统:就是被测试Java类依赖的其他类。
如果是单元测试,一般情况下,会对依赖系统进行模拟(Mock),即给它一个假的实现;典型的如测试服务层时注入一个Mock的DAO层,这样的好处:
加快测试速度;因为不会调用真实的被测系统,所以速度特别快;
测试还没有完成的功能;尤其在多团队协作时,可以只在定义好接口的情况下开发系统;
如果是集成测试时,直接注入真实的依赖系统即可,好处:
完成联调;
发现自己的问题;
还可能发现自己使用上问题及使用的API的问题;
单元测试虽然好,但是是隔离测试,即不会调用被测系统来完成测试,因为不是真实的联调,所以很可能会潜在有一些问题,因此还是需要集成测试。(所以不是很刻意分单元或集成测试,且有些系统可能只有集成测试)
但是集成测试速度是比较慢的,一般提交给CI执行,不影响当前开发进度。
2.4、验证
验证的目的:是保证实际结果和我们预期的结果是否一致,说白了就是是否是我们想的那样。
一般使用断言来验证,如:
Assert.assertEquals(expectedResult, actualResult); //验证预期结果和实际结果是否相等
验证主要有两种:
结果验证
行为验证
结果验证:即验证被测系统返回的结果是否正确,如:
Java代码
@Test
public void testCount() {
String ql = "select count(o) from User o";
long expectedCount = repositoryHelper.count(ql) + 1;
User user = createUser();
repositoryHelper.getEntityManager().persist(user);
long acutalCount = repositoryHelper.count(ql);
Assert.assertEquals(expectedCount, acutalCount);
}
验证返回的数据总数 = 插入之前的总数 + 1; 即结果验证。此处我们使用了一种叫做相对(delta)测试;即不关心数据库里到底多少条,只关心实际的和预期的差。
行为验证:即验证被测系统是否调用了依赖系统的某个API ,这个只有当我们使用Mock时测试时比较简单,如当用户注册时:
1、加积分
2、发系统消息
3、……
此时我们并不能通过结果验证是否调用了这些方法;那么我们可以使用Mock技术来完成验证是否调用了这些API,比如使用jmock测试框架就支持行为验证。集成测试是很难进行行为验证的,如果测试需要预留间谍接口。-phpriak
3、测试有哪些好处?
我们写代码的目的是正确的完成某个功能,如何保证正确呢?测试!所以在不使用如单元测试技术时,我们也是需要测试,但是这个测试是我们人工验证的。缺点很明显:
不是自动的,每次需要对比预期结果与实际结果,尤其数据量/逻辑复杂时更痛苦;
不是回归的,上次测试完成后,下次还得重复自己一遍;
为了解决这个问题,我们使用如单元测试技术来解决这个问题:
测试自动化;即验证预期结果与实际结果交给计算机吧;
测试回归性,可以重复执行测试,验证修改后逻辑是否还是正确的;
即测试的好处,从如上已经提炼出来了:
缩短发现问题到解决问题的时间;
重复使用测试,保证修改后的代码还是正确的;
如果做开源项目,可以提供给使用人员参考如何使用;
因为单元测试都非常快,所以提升了开发速度;
4、一切都需要测试吗?
肯定不是,一切都是相对的;哪些不需要测试呢:
你非常熟悉的功能;
一些简单的CRUD;
你认为不需要测试的;比如你很有把握的东西,就没有必要浪费时间测试了;
哪些需要测试呢:
复杂的业务逻辑/系统核心功能,最典型的如订单系统:一定要有足够的单元测试保证,这是一个电商系统的核心;还有如用户系统、积分系统等等;
框架级别/工具级别/通用级别的代码需要测试,即提供给第三方使用的代码,因为这些代码可能被很多系统依赖,应该保证其正确性;而且还要保证以后版本升级的向下兼容;
你认为需要测试的,比如你没有把握的东西,还是写点测试来缩短如开发web项目的重启系统的时间吧;
测试不是不耗时间的,没意义的测试就是浪费时间,最典型是一些书上的对一个增删改查进行测试,实际项目没有任何意义。所以你应该只对自己很难驾驭的觉得有必要的代码进行测试。不要成为一个测试狂,什么都测试。
一些测试可以参考我的《es——JavaEE快速开发脚手架》中的代码。通过测试我得到了许多好处。
到此我们介绍完成了测试,但是如果我们使用了如集成测试时,测试执行起来可能比较慢,跑一遍测试可能需要5分钟,那怎么办呢?
每天下班前跑一遍集成测试,然后修复,下班走人;
CI:持续集成,交给持续集成服务器,自动地测试完成后把测试报告以邮件的形式发到开发人员邮箱;
------------------------------------分割线----------------------------------
接下来介绍一下CI吧。
1、为什么需要CI
2、CI如何工作的
3、travis-ci介绍
1、为什么需要CI
正如前边说的,我们单独测试可能会遇到如下问题:
如果写了一个测试,就要把所有测试跑一遍看看整个系统是否是正确的,那么每次等待时间是非常漫长的;
如果团队中的其他成员改了功能并提交了,如何快速得到该次提交对当前系统代码是正确还是失败的反馈;
那怎么办呢?自动化地持续集成(CI)!CI的核心就是干这件事情的。自动化持续地集成测试。
使用CI后,如果使用Maven,可以新建多个profile:
本地测试时忽略一些比较慢的测试;
CI服务器上执行所有测试;
2、CI如何工作的
一个典型的持续集成流程:
定期检测版本服务器上是否有代码更新;
如果发现代码更新,从版本服务器下载最新的代码;
自动构建并自动化的测试;
不管错误/失败,生成报告给开发人员;
有些CI服务器还能产生可执行的软件,自动化地部署到测试机器,交给测试人员测试。
如图所示:
持续集成服务器其实就是一个定时器,自动帮你下载最新代码、编译、测试、集成及产生报告发给开发人员。
常见的CI服务器有:
Apache Continuum
Hudson
CruiseControl
Jenkins CI
TeamCity
Travis CI
我09年时使用过TeamCity社区版,足够满足常见需求;目前我使用github托管项目,使用Travis CI进行分布式的持续集成,免费,目前看来还是不错的。
3、travis-ci介绍
我现在开发的ES-JavaEE项目开发脚手架就是使用travis ci进行持续集成;具体参考《Getting started》进行与Github集成,其支持的语言:
C
C++
Clojure
Erlang
Go
Groovy
Haskell
Java
JavaScript (with Node.js)
Objective-C
Perl
PHP
Python
Ruby
Scala
支持的数据库:
MySQL
PostgreSQL
MongoDB
CouchDB
Redis
Riak
RabbitMQ
Memcached
Cassandra
Neo4J
ElasticSearch
Kestrel
SQLite3
更多请参考其官网的介绍。
如果是Java开发人员,支持的JDK包括:OpenJDK 和 OracleJDK。 如果使用的是OpenJDK,Maven中使用ascii2native插件时,需要如下配置:
Java代码
plugin
groupIdorg.codehaus.mojo/groupId
artifactIdnative2ascii-maven-plugin/artifactId
version1.0-alpha-1/version
executions
execution
phasegenerate-resources/phase
goals
goalnative2ascii/goal
/goals
configuration
encodingUTF-8/encoding
srcsrc/main/messages/src
desttarget/${project.artifactId}/WEB-INF/classes/dest
includesmessages.properties/includes
/configuration
/execution
/executions
!-- native2ascii 使用的tools.jar --
dependencies
dependency
groupIdcom.sun/groupId
artifactIdtools/artifactId
version1.7.0/version
scopesystem/scope
systemPath${java.home}/../lib/tools.jar/systemPath
/dependency
/dependencies
/plugin
如果使用mysql,端口只能是3306。
如果想开端口测试,这是不允许的。
如下是我项目中的一个配置.travis.yml,放到项目的根下即可:
-----------------------------------
language: java 语言
env: 环境
- DB=mysql 使用mysql
jdk:
- openjdk jdk使用openjdk
mysql:
database: es 数据库名为es
username: root 用户名为root
password : 密码为空
encoding: utf8 编码为utf8
install: 安装时执行的脚本
- mvn install -Dmaven.test.skip=true mvn安装并跳过测试
before_script: script之前执行的测试
- cd web
- mvn db:create 创建数据库的mvn命令(此处使用了 maven-db-plugin 插件)
- mvn db:schema 创建脚本的mvn命令
- mvn db:data 安装数据的mvn命令
- cd ..
script: 测试时执行的脚步
- cd common
- mvn test 测试common子模块
- cd ..
- cd web
- mvn test -Pit 测试web子模块,并指定使用it profile测试(即集成测试的配置,具体参考pom.xml中的profile/it)
notifications: 触发
email: 测试完成后测试报告发到哪
- zhangkaitao0503@gmail.com
-----------------------------------
持续集成不能修复代码的错误,而是和单元测试一样,缩短发现问题带解决问题的时间,这样可以提高开发效率,降低项目风险,提高项目的稳定性。而且尤其是团队协作时,可以发现其他人的代码是否对自己的代码产生影响。-phpriak
到此我们利用单元测试+CI可以加速开发人员的开发速度。利用好单元测试和CI,不要纯粹为了单元测试和CI而去做这些事情。
本文没有介绍TDD,TDD并不会那么美好,我认为我们可以借鉴TDD的一些思想,但决不能迷信TDD,有时候,尤其如开发企业应用,先写功能再写测试可能效率更高,而且大部分时候是不需要TDD的。而且我也没能在实际项目中获取太多TDD的好处,但是我获得了测试的好处。-phpriak
本文也没有介绍测试覆盖率,我认为不要一味的追求覆盖率,有时候有的覆盖率没有任何意义。所以不要让为了覆盖率而覆盖率拖慢了项目开发进度。
正如stackoverflow上的一篇帖子《How deep are your unit tests?》上Kent Beck的回答:
写道
老板为我的代码付报酬,而不是测试,所以,我对此的价值观是——测试越少越好,少到你对你的代码质量达到了某种自信。
可以前往coolshell的“单元测试要做多细?”去得到一些经验。
该选择哪个开源数据库
21 个最好的免费开源数据库:
1. MySQL
The most widely used open source database for Web apps (and many other things) remains MySQL. Support for multiple storage engines, clustering, full-text indexing, and plenty of other professional features have allowed numerous other apps profiled here, from WordPress to Movable Type, to rely on MySQL as their default database. Graphical front ends, such as phpMyAdmin and Adminer, make using the database far less of a chore. And for those seeking escape from the long shadow of Oracle, there's a community fork named MariaDB, maintained by MySQL's original lead developer, Monty Widenius.-phpriak
2. PostgreSQL
When Oracle acquired MySQL, reduced the development staff, and more or less killed the open source nature of the project, it reopened a market that MySQL had locked down. PostgreSQL has a much nicer set of drivers and supports both standard ANSI-SQL and extended features, in many cases better than MySQL. On the downside, its long legacy has left it multiprocess in the era of multithreaded. The high-availability/clustering features of PostgreSQL require a lot of elbow grease and leave much to be desired. Yet while organizations look for a community developed database, one of the eldest starts to look pretty good. Many cloud providers, such as Heroku, have chosen PostgreSQL as their RDBMS storage option as well.-phpriak
3. MongoDB
NoSQL? Document database? The first name that comes to mind is MongoDB, due to a dual-edged blade from developer 10gen. On one side, MongoDB has strong venture capital and consequently an extensive marketing strategy. On the other side, it is the only comparatively mature document database in the NoSQL world. Highly scalable horizontally with automated sharding and highly available due to autoreplication, MongoDB offers a very reliable and yet simple solution to modern document database problems. The downsides: Working with stored procedures can be difficult, and performing data manipulation can require writing complex JavaScript code.-phpriak
4. Hadoop (HBase)
Hadoop is the name brand in big data. It is also the convergence of "clustered storage" systems like Gluster and Ceph with NoSQL. Hadoop is really a collection of projects to solve large and complex data problems. In fact, there are multiple types of databases and query languages built on the overall Hadoop framework. Hadoop's complexity is as legendary as its capability, and its lack of high-availability features has both held it back and created a commercial add-on ecosystem.-phpriak
The project aims to host very large tables like "billions of rows, millions of columns". It has a REST-ful web service gateway that supports XML, Protobuf, and binary data encoding options.-phpriak
5. Apache Cassandra
Written in Java, this BigTable-based key-value database is getting more popular by the day. Open source and built to integrate with Hadoop, Cassandra offers the column family solution to developers wanting to move away from the relational database model while working with Hadoop. Focusing mainly on getting in very fast writes and providing high availability, Cassandra has slower reads than some alternatives. It is mostly used for logging purposes and real-time analysis.-phpriak
Cassandra is a highly scalable second-generation distributed database that is used by giants like Facebook, Digg, Twitter, Cisco more. It aims to provide a consistent, fault-tolerant highly available environment for storing data.-phpriak
6. Couchbase
While Couchbase was a fork of CouchDB, it has become more of a full-fledged data product and less of a ball of framework than CouchDB. Its transition to a document database will give MongoDB a run for its money. It is multithreaded per node, which can be a major scalability benefit -- especially when hosted on custom or bare-metal hardware. With some nice integration features, including with Hadoop, Couchbase is a great choice for an operational data store.-phpriak
7. Neo4j
The database for interconnected data, Neo4j provides a reliable Java-based platform for conquering highly interconnected database problems. Available with full ACID transaction compatibility -- rare in a NoSQL database -- Neo4j has a SQL-like query language called Cypher and a scripting language called Gremlin for graph traversals. Best used to accurately and efficiently model highly complex, interconnected networks like network topologies, social networks, and conditional access control problems, it provides indexes on nodes and relationships. Direct path calculations take hundreds of lines of code for a RDBMS but two lines of code for Neo4j.-phpriak
8. Riak
An open source distributed database written in Erlang and C, Riak treats all nodes equally. No one is a master or a slave. Thus, there is no fear a master will be a single point of failure. However, the masterless, fully distributed model with SNMP monitoring is not available in the open source version. Much simpler than its peers (such as Cassandra), Riak is optimal for places where even seconds of downtime would hurt.-phpriak
9. Redis
There are many NoSQL databases, but Redis remains close to our heart because it has so many features that some call it a "data structure store." You don't just store numbers and strings -- you can dump in entire hashes, lists, sets, and other complicated structures. Then, to make the deal sweeter, Redis offers replication and persistence.-phpriak
Redis is an advanced fast key-value database written in C which can be used like memcached, in front of a traditional database, or on its own. It has support for many programming languages used by popular projects like GitHub or Engine Yard. There is also a PHP client named Rediska for managing Redis databases.-phpriak
10. Firebird
Firebird is a relational database that can run on Linux, Windows various UNIX platforms. It offers high performance and powerful language support for stored procedures and triggers.-phpriak
11. Memcached
Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. It is intended for use in speeding up dynamic web applications by alleviating database load.-phpriak
12. Oracle Berkeley DB
It is an embeddable database engine that provides developers with fast, reliable, local persistence with zero administration. Oracle Berkeley DB is a library that links directly into your application enables you to make simple function calls rather than sending messages to a remote server for a better performance.-phpriak
13. Hypertable
Hypertable is a high performance distributed data storage system designed to support applications requiring maximum performance, scalability, and reliability. It is modeled after Google's BigTable and mostly focuses on large-scale datasets.-phpriak
14. Keyspace
It is a consistently replicated, fault-tolerant key-value store that works in Windows OS. Keyspace offers high availability by masking server/network failures appearing as a single, highly available service.-phpriak
15. 4store
4store is a database storage and query engine that holds RDF data. It is written in ANSI C99, designed to run on UNIX-like systems offers a high performance, scalable stable platform.-phpriak
16. MariaDB
MariaDB is a backward compatible, drop-in replacement branch of the MySQL® Database Server. It includes all major open source storage engines + the Maria storage engine.-phpriak
17. Drizzle
It is a fork of MySQL that focuses on being a reliable database optimized for Cloud and Net applications.-phpriak
18. HyperSQL
It is a SQL relational database engine written in Java. HyperSQL offers a small fast database engine which has in-memory and disk-based tables, supports embedded/server modes. Also, it has tools such as a command line SQL tool GUI query apps.-phpriak
19. MonetDB
MonetDB is a database system for high-performance applications in data mining, OLAP, GIS, XML Query, text multimedia retrieval.-phpriak
20. Persevere
It is an object storage engine and application server (running on Java/Rhino) that provides storage of dynamic JSON data for rapidly develop data-driven JavaScript-based rich internet applications.-phpriak
21. eXist-db
eXist-db is built using XML technology. It stores XML data according to the XML data model features efficient, index-based XQuery processing.-phpriak
Web 有哪些 Erlang 语言应用的例子
Mochiweb
一句话介绍: MochiWeb is an Erlang library for building lightweight HTTP servers.
Mochiweb在Erlang项目中被当做一个Web组件被广泛使用(比如RabbitMQ的plug-in),它的设计相当收敛,除了基础的Web请求处理没有提供特别复杂的功能集(后面会提到其它Web Server).目前我已经在两个项目中使用了Mochiweb,得心应手.-phpriak
Mochiweb项目代码有很多值得学习的地方,比如 mochiglobal [ 链接 ],Parameterized module [链接]今年夏天我把Mochiweb代码打印了一份,看得很是过瘾.这里有一篇实战风格的入门文章:A practical introduction to MochiWeb - Alex Marandon[链接]-phpriak
使用Rebar很容易编译运行,里面自带一个简单的Echo demo,你可以使用Rebar快速建立起来自己的站点框架,动手试试吧
项目地址:mochi/mochiweb · GitHub
Cowboy
一句话介绍: Cowboy is a small, fast and modular HTTP server written in Erlang.
使用Cowboy需要通过编写Handler来定制如何处理Web请求.这是它设计上的一大特色.项目源码自带了N种版本的hello_world,也是可以非常快上手.编译运行依然是rebar搞定,这个项目现在保持更新,每天都能收到github推送的代码变更邮件.-phpriak
项目地址:extend/cowboy 路 GitHub
YAWS
一句话介绍:Yaws is a HTTP high perfomance 1.1 webserver particularly well suited for dynamic-content web applications.-phpriak
这个略显怪异的名字是Yet another Webserver的缩写.其提供的已经不是简单的脚手架了,而是支持动态内容输出,REST,文件上传SOAP等等.在其官网上有丰富的文档和样例代码.O'Reilly在2012年6月出版的 Building Web Applications with Erlang 一书中使用的就是YAWS.这本不足150页的小册子是很好的YAWS入门教程.估计国内出版社不会引进这样一本冷冷的书,自己找电子版读吧,很容易找到.-phpriak
项目地址:Yaws
Misultin [停止更新]
一句话介绍: Misultin development has been discontinued.
是的,这个项目已经不再继续更新了;停止更新的原因是作者认为各个Web server项目有"too much duplication of efforts".作者在项目介绍中倒是简单评价了Mochiweb和Cowboy:-phpriak
Mochiweb has been around the block for a while and it's proven solid in production, I can only recommend it for all basic webserver needs you might have. Cowboy has a very interesting approach since it allows to use multiple TCP and UDP protocols on top of a common acceptor pool. It is a very modern approach, is very actively maintained and many projects are starting to be built around it. -phpriak
项目地址:ostinelli/misultin ¡ GitHub
看过Misultin作者的一番评论,其实可以回答不少人关于"用Mochiweb做Web项目很痛苦"的问题:如果你要做一个丰富多彩的Web站点,在Mochiweb提供的脚手架上,你要完成很多工作,显然你需要其它选择,呃,或许你需要选择一个Web Framework了.对于大多数框架来说,其设计的总要目标就是开发效率和常见应用场景的支持.我们看看有哪些Erlang Web Framework可用吧!-phpriak
Elrang Web Frameworks
除了 MVC,RoR之外,其实还有很多Web Framework可用,看看Erlang世界里面的解决方案吧:
ChicagoBoss
一句话介绍:Chicago Boss is a server framework inspired by Rails and written in Erlang.
ChicagoBoss是现在非常活跃的Erlang Web Framework,在各种细节上都为新手准备的相当周到比如60秒快速上手教程什么的.甚至它说自己区别于其它Erlang Web Framework的就是" it is easy to set up and use."它之间Web Server是选择的Misultin现在已经迁移到Cowboy.前端MVC架构,内置消息队列BOSSMQ,数据存储方面选择性也比较多:Mnesia MongoDB Mysql PostgreSQL Riak ,Tokyo Tyrant;模板方案依然是使用ErlyDTL.-phpriak
另外,我觉得ChicagoBoss的文案是这些项目里面写的最棒的,直接命中你最想知道的两个问题:
"Chicago Boss is a server framework inspired by Rails and written in Erlang. It offers all the conveniences of modern web development, including Comet. What sets Chicago Boss apart from other non-Erlang frameworks is that it can handle large amounts of traffic without any drop in performance. What sets Chicago Boss apart from other Erlang frameworks is that it is easy to set up and use."-phpriak
项目地址:ChicagoBoss/ChicagoBoss 路 GitHub
入门PDF:
Nitrogen
一句话介绍:Nitrogen Web Framework is the fastest way to develop interactive web applications in full-stack Erlang.-phpriak
看群里面讨论,采用Nitrogen的项目也不在少数,这个项目动态模板方案不是采用ErlyDTL,而是自己有一套解决方案Nitrogen records [链接].网站上的例程和Step by Step教程足够详细,入门应该比较快.-phpriak
项目地址:Nitrogen - Nitrogen Web Framework for Erlang
Zotontic
一句话介绍:Zotonic is the open source, high speed, real-time web framework and content management system, built with Erlang.-phpriak
应该说Zotontic和其它框架的差异更多是在业务定位上了,提供了很多CMS直接可用的功能,查看其features列表能够看到详细介绍,注意:"Typically 10 times (and much more) faster than PHP content management systems." [链接]-phpriak
Zotontic构建在Mochiweb和PostgreSQL之上.
项目地址:
BeepBeep
一句话介绍: BeepBeep is a simple web application framework for Mochiweb inspired by Rails and Merb
BeepBeep 构建在 MochiWeb 和 ErlyDTL (后面会介绍) 基础之上. 沿袭了mochiweb的优良传统一键建站,基于ErlyDTL提供Django 模板的视图展现.
这个项目已经09年之后就没有实质性的更新,最近一次更新是2010年更新了一下README,慎重选择吧.
还有一个项目ErlyWeb同样是
韩国唱片工业协会是什么?网址?
;usemode=listDB=117
点击你要看的月份就行了。
统计是从月头到月尾,就是1号到30号。
不过统计需要时间,一般公布都是在月中。
韩国只有RIAK(RECORDING INDUSTRY ASSOCIATION OF KOREA)也就是韩国唱片工业协会的数字最可信,也就是所谓的权威。韩国歌手每年的成绩都是通过RIAK统计的,这是韩国最有公信力的排行榜。-phpriak
RIAK每个月中会公布上个月(譬如03月的成绩,04月中RIAK才会统计玩公布)韩国50大专辑或单曲销售成绩(专辑跟单曲都是在一个榜,没有分开)。
不管专辑或单曲是在什么时候发行,只要在该个月的销量有到50大就会入榜。像东方神起在04年01月发行的“HUG”单曲和05年09月的“RISING SUN”专辑到目前为止都还停留在03月份RIAK的50大排行榜,这都是很长寿的专辑/单曲。-phpriak
一般来说只要在该个月能买过1000张(一般来说平均是800张左右就能入榜)就肯定能入50大,所以50大以外的专辑/单曲一般都是在该个月卖少过1000张的。
韩国虽然人口4800万人左右但唱片业很不景气,尤其是这两三年,最卖的专辑也不过才30万张。
歌手的销量只要有达到4万张就已经是中等好的成绩,因为大多数的歌手的平均销量都只有2,3万张罢了,最少的都没有过1万张。
目前韩国有可能过10万张的歌手就是EPIK HIGH,SUPER JUNIOR,东方神起,SG WANNABE,神话。。这群固定的歌手。
少女时代算是近年唯一的女歌手(女团体)能突破10万张。
(忘了两年没发片的李秀英姐姐 = =!,她是韩国歌谣界唯一一位每张专辑都能过10万张的女歌手,李孝莉姐姐也没能,而宝宝都在日本很久没发韩文作品了。)
--------------------------------------------
拜托楼主 = =!刚发行的专辑当然刚开始会比较卖,一般歌迷都会在发行的前几天就立刻去购买,后期购买的多数都是觉得好听的消费者。
歌迷都买了剩下的就是要有限无限台歌谣宣传在继续卖。像少女时代做了5个月的宣传专辑突破10万张。
打个比方;榜首专辑一般来说在该个月的销量多数超过2万张(也就是说平均一天能卖3千张),所以1天卖3千张没什么不可能,看得是谁的专辑罢了,热卖型还是长卖型。
-------------------------------------------
官方证据?很遗憾你如果看不懂韩文也没用,免得我翻译后你又要证据证明我就更麻烦了 = =!
所以相不相信看你自己了。
mac brew 怎么安装msql 5.5
Brew 是 Mac 下面的包管理工具,通过 Github 托管适合 Mac 的编译配置以及 Patch,可以方便的安装开发工具。 Mac 自带ruby 所以安装起来很方便,同时它也会自动把git也给你装上。官方网站: brew/Homebrew/homebrew/go/install)" 使用以下方法可以查看brew是否安装成功,以及目前的版本:liondeMacBook-Pro:~ lion$ brew -v Homebrew 0/project/machomebrew/Bottles/curl-7/freetds/stable/freetds-0/project/machomebrew/Bottles/gmp-6.0.0a.mavericks.bottle.tar.gz ######################################################################## 100.0% == Pouring gmp-6.0.0a.mavericks.bottle.tar.gz /usr/local/Cellar/gmp/6.0.0a: 15 files, 3.2M == Installing php55 == Downloading /get/php-5.5.15.tar.bz2/from/this/mirror Already downloaded: /Library/Caches/Homebrew/php55-5.5.15 == ./configure --prefix=/usr/local/Cellar/php55/5.5.15 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.5 -- == make == make install == /usr/local/Cellar/php55/5.5.15/bin/pear config-set php_ini /usr/local/etc/php/5.5/php.ini == Caveats The php.ini file can be found in: /usr/local/etc/php/5.5/php.ini ✩✩✩✩ PEAR ✩✩✩✩ If PEAR complains about permissions, 'fix' the default PEAR permissions and config: chmod -R ug+w /usr/local/Cellar/php55/5.5.15/lib/php pear config-set php_ini /usr/local/etc/php/5.5/php.ini ✩✩✩✩ Extensions ✩✩✩✩ If you are having issues with custom extension compiling, ensure that you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH: PATH="/usr/local/bin:$PATH" PHP55 Extensions will always be compiled against this PHP. Please install them using --without-homebrew-php to enable compiling against system PHP. ✩✩✩✩ PHP CLI ✩✩✩✩ If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell's equivalent configuration file: export PATH="$(brew --prefix homebrew/php/php55)/bin:$PATH" ✩✩✩✩ FPM ✩✩✩✩ To launch php-fpm on startup: * If this is your first install: mkdir -p ~/Library/LaunchAgents cp /usr/local/Cellar/php55/5.5.15/homebrew.mxcl.php55.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist * If this is an upgrade and you already have the homebrew.mxcl.php55.plist loaded: launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist cp /usr/local/Cellar/php55/5.5.15/homebrew.mxcl.php55.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist The control script is located at /usr/local/Cellar/php55/5.5.15/sbin/php55-fpm Mountain Lion comes with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH: PATH="/usr/local/sbin:$PATH" You may also need to edit the plist to use the correct "UserName". Please note that the plist was called 'homebrew-php.josegonzalez.php55.plist' in old versions of this formula. To have launchd start php55 at login: ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents Then to load php55 now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist == Summary /usr/local/Cellar/php55/5.5.15: 477 files, 43M, built in 3.9 minutes 过程中如果出现configure: error: Cannot find OpenSSL's evp.h这样的错误,请执行以下命令,将xcode进行更新:xcode-select --install 在PHP5安装完成的提示中写到,如何进行PHP5和mac自带的php以及php-fpm替换,执行以下命令后,我们可以看到当前的php版本已经是最新的了:liondeMacBook-Pro:~ lion$ echo 'export PATH=/usr/local/bin:$PATH' ~/.bash_profile liondeMacBook-Pro:~ lion$ echo 'export PATH=/usr/sbin:$PATH' ~/.bash_profile liondeMacBook-Pro:~ lion$ echo 'export PATH=/usr/local/sbin:$PATH' ~/.bash_profile liondeMacBook-Pro:~ lion$ source ~/.bash_profile liondeMacBook-Pro:~ lion$ php -v PHP 5.5.15 (cli) (built: Aug 14 2014 15:37:16) (DEBUG) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies liondeMacBook-Pro:~ lion$ 使用brew search php55-命令,可以查看还有哪些扩展可以安装,然后执行brew install php55-XXX就可以了。liondeMacBook-Pro:~ lion$ brew search php55- php55-amqp php55-igbinary php55-msgpack php55-runkit php55-varnish php55-apcu php55-imagick php55-mysqlnd_ms php55-scrypt php55-vld php55-augmentedtypes php55-inclued php55-oauth php55-snappy php55-wbxml php55-binpack php55-intl php55-opcache php55-solr php55-xcache php55-blitz php55-ioncubeloader php55-parsekit php55-sphinx php55-xdebug php55-boxwood php55-jsmin php55-pcntl php55-spl-types php55-xhgui php55-chdb php55-judy php55-pdflib php55-ssh2 php55-xhp php55-couchbase php55-leveldb php55-pdo-dblib php55-stats php55-xhprof php55-crypto php55-libevent php55-pdo-pgsql php55-stemmer php55-xmldiff php55-dbase php55-libvirt php55-phalcon php55-sundown php55-yac php55-dbus php55-lz4 php55-proctitle php55-svm php55-yaf php55-dmtx php55-lzf php55-propro php55-swoole php55-yaml php55-ev php55-mailparse php55-protobuf php55-thrift php55-yar php55-gearman php55-mcrypt php55-pspell php55-tidy php55-yaz php55-geoip php55-memcache php55-pthreads php55-timezonedb php55-yp php55-gmagick php55-memcached php55-raphf php55-tokyotyrant php55-yrmcds php55-graphdat php55-midgard2 php55-redis php55-twig php55-zmq php55-htscanner php55-mongo php55-redland php55-uploadprogress php55-zookeeper php55-http php55-mosquitto php55-riak php55-uuid 我安装的是以下php5.5几个扩展:liondeMacBook-Pro:~ lion$ brew install php55-imagick php55-igbinary php55-ev php55-gmagick php55-geoip php55-memcache php55-memcached php55-thrift php55-xdebug php55-sphinx composer 接下来我们测试php-fpm的配置是否正确,以及是否正确启动:#测试php-fpm配置是否正确 liondeMacBook-Pro:bin lion$ php-fpm -t [14-Aug-2014 16:14:30] NOTICE: configuration file /usr/local/etc/php/5.5/php-fpm.conf test is successful liondeMacBook-Pro:bin lion$ php-fpm -c /usr/local/etc/php/5.5/php.ini -y /usr/local/etc/php/5.5/php-fpm.conf -t [14-Aug-2014 16:14:48] NOTICE: configuration file /usr/local/etc/php/5.5/php-fpm.conf test is successful #启动php-fpm liondeMacBook-Pro:bin lion$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist #查看9000端口是否在运行 liondeMacBook-Pro:bin lion$ lsof -i:9000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php-fpm 51241 lion 8u IPv4 0xce9d0f6417637937 0t0 TCP localhost:cslistener (LISTEN) php-fpm 51243 lion 0u IPv4 0xce9d0f6417637937 0t0 TCP localhost:cslistener (LISTEN) php-fpm 51244 lion 0u IPv4 0xce9d0f6417637937 0t0 TCP localhost:cslistener (LISTEN) php-fpm 51245 lion 0u IPv4 0xce9d0f6417637937 0t0 TCP localhost:cslistener (LISTEN) #关闭掉php-fpm进程,再查看9000端口,没有监听了 liondeMacBook-Pro:bin lion$ ps auxgrep php-fpmgrep -v 'grep'awk '{print $2}'xargs kill -9 liondeMacBook-Pro:bin lion$ lsof -i:9000 liondeMacBook-Pro:bin lion$ 设置PHP-FPM开机运行(其实在安装完成的提示中,也有说明):ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist-phpriak