iintothewind
iwindyforest · 共 100 篇文章
利用归并排序算法对大文件进行排序
归并排序算法介绍,请参照Wikipeida zh.wikipedia.org/wiki/%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F 基本思想: 大文件分割成行数相等的两个子文件,递归(归并排序)两个子文件,直到递归到分割成的子文件低于限制行数 低于限制行数的子文件直接排序 两个排序好的子文件归并到父文件 直到最后所有排序好的父文件归并到输入的大文件并返回 之前看了网上很多示例代码,写的很不简洁, 引入了过多的临时变量i, j, k等等, 导致程序基本没法看, 只好自己写了一个,没有很关心执行效率, 只求够用,以后有机会再优化一下吧。 Performance: 输…
2015-01-25 20:59 · Common · 评论(0)
VMware Workstation 11 或者 VMware Player 7安装MAC OS X 10.10 Yosemite
最近尝试了下VMware下安装MacOS 系统, 安装过程中发现网上可供参考的文章都是VMware Workstation 10以下, MacOS X 10.9以下的文章, 只能提供大概的思路, 但是实际安装起来由于版本问题, 走了不少弯路, 所以我尝试写以下总结, 希望能给有兴趣安装OSX的人提供一点帮助。 写在前面的话: 其实安装好后发现, 由于我的thinkpad实在太老了, 实在没法流畅的带动这个osx系统, 所以运行的很慢, 只能蛋疼的表示玩玩罢了, 如果你的系统够强劲, 应该效果比我的会好很多的。 需要准备好的软件 VMware Workstation 11 或者 VMware …
2014-12-15 20:26 · Linux · 评论(17)
openldap configuration leaning note
hostname // to display the computer name hostname <changed name> // to change go to: /etc/sysconfig/network, add/modify HOSTNAME=NEWNAME to change permenately dont forget to change /etc/hosts after you change your hostname, 127.0.0.1 localhost.localdomain localhost // the following part mainly is f…
2014-10-21 01:04 · Linux · 评论(0)
try-catch影响性能吗?
try-catch会影响性能吗? try-catch放在循环块里面比放在外面程序运行会慢吗? 看到论坛上有人对try-catch对性能的影响存在疑问,比如: http://www.iteye.com/topic/1127950 很多想当然的答案是: try-catch放在循环块里面肯定比放在循环块外面慢. 但是, 这个想当然的答案是错误的. 加了try-catch块的代码跟没有加的代码运行时的性能是一样的, 没有区别, 区别只是加了try-catch块的代码在抛出异常时, 会有不同的处理逻辑, 仅此而已. stackOverflow的网站上有人也问过类似问题: http://stackove…
2014-07-09 17:06 · Common · 评论(0)
mysql 5.6 配置文件
#mysql 5.6 版本的配置改变了很多, 许多参数都不能用了, 有些参数的设定也改变了, 以下是我根据自己机器配置调好的, 注意如果内存比较小的话还是尽量减小内存配置的参数吧,下面的配置已经耗去600M多了 #mysql 5.6 的系统变量说明在这里: # http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html # MySQL 服务端 # [mysqld] # 一般配置选项 port = 3306 #socket = #character set character_set_server = utf8 cha…
2014-06-12 11:56 · Database · 评论(0)
Stevey's Google Platforms Rant
from: https://plus.google.com/+RipRowan/posts/eVeouesvaVX comments by Ivar: The post was intended to be shared privately and was accidentally made public. It's the sort of writing people do when they think nobody is watching: honest, clear, and frank. This is the kind of post that you definetely wo…
2014-06-11 21:34 · JavaEE · 评论(0)
find my.cnf config file for mysql sever in linux
Some times, it is diffcult to find the exact location of my.cnf file on linux, using the following command we can find the diffault locations which are used by mysql server to locate its configuraton, by checking them one by one, we can locate the real my.cnf: [ivar@fedora ~]$ sudo /usr/sbin/mysqld…
2014-06-11 13:26 · Database · 评论(0)
Install Postgresql9.3 on CentOS
Install Postgresql Server 9.3 first, we need to add official postgresql repository for yum: sudo yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm second, install by yum: sudo yum install postgresql93-server postgresql93-contrib after that, init database:…
2014-06-10 23:21 · Database · 评论(0)
Quartz Scheduler Learning Note
Quartz Scheduler Learning Note Quartz is a convenient tool for task scheduling. Key Interfaces To use quartz, the following interfaces should be included: Scheduler - the main API for interacting with the scheduler. Job - an interface to be implemented by components that you wish to have executed b…
2014-06-10 16:33 · JavaEE · 评论(0)
glassfish 证书过期错误SEVERE: SEC5054: Certificate has expired:
from: http://www.adam-bien.com/roller/abien/entry/how_to_fix_expired_certificate The following error: com.sun.enterprise.security.ssl.impl.SecuritySupportImpl checkCertificateDates SEVERE: SEC5054: Certificate has expired: [ [ Version: V3 Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Soluti…
2014-06-06 13:56 · JavaEE · 评论(0)
h2全文检索
使用自身提供的全文检索 初始化需要用: CREATE ALIAS IF NOT EXISTS FT_INIT FOR "org.h2.fulltext.FullText.init"; CALL FT_INIT(); 你需要你想用它来初始化它在每个 数据库 中。之后,您可以创建全文索引的表使用: CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR); INSERT INTO TEST VALUES(1, 'Hello World'); CALL FT_CREATE_INDEX('PUBLIC', 'TEST', NULL); Schema名称,…
2014-06-06 13:06 · Database · 评论(0)
windows下做压力测试的注册表设置
from: http://www.cnblogs.com/tianzhiliang/articles/2400176.html TcpTimedWaitDelay **描述:**确 定 TCP/IP 在释放已关闭的连接并再次使用其资源前必须经过的时间。关闭与释放之间的这段时间称为 TIME_WAIT 状态或者两倍最大段生存期(2MSL)状态。此时间期间,重新打开到客户机和服务器的连接的成本少于建立新连接。通过减少此条目的值,TCP/IP 可以更快地释放关闭的连接,并为新连接提供更多资源。如果运行中的应用程序要求快速释放连接或创建新连接,或者由于多个连接处于 TIME_WAIT 状态而导致吞吐…
2014-06-04 23:11 · JavaEE · 评论(0)
MyBatis(3.2.7)的缺点
以下是我用MyBatis感觉不爽的地方, 当然也有可能是我不够了解, 如果有错误, 请指正 不同命名空间的<resultMap><sql>等声明不能共享 默认注册(org.apache.ibatis.type.TypeAliasRegistry)的类型别名太少, 比如想用Set但是没有注册 Configuraton XML默认不支持第三方Datasource, <dataSource>标签只能选择 UNPOOLED , POOLED , JNDI 缓存设置(比如mybatis-ehcache)无法指定缓存配置文件的位置,只能放在classpath根目录下 缓存还是跟Hibernate一样, …
2014-05-22 10:52 · JavaEE · 评论(9)
MyBatis在非Spring环境下第三方DataSource设置
Spring环境下, MyBatis可以通过其本身的增强mybatis-spring提供的org.mybatis.spring.SqlSessionFactoryBean来注入第三方DataSource. 但是在非Spring的环境下, MyBatis的加载需要配置其自身的configuration xml文件, 代码段可能是下面这样的: <environments default="development"> <environment id="development"> <transactionManager type="JDBC"> <property name="..." value=…
2014-05-22 10:17 · JavaEE · 评论(0)
MySQL and Postgres command equivalents (mysql vs psql)
From: http://blog.endpoint.com/2009/12/mysql-and-postgres-command-equivalents.html Posted by Greg Sabino Mullane |December 24, 2009 Users toggling between MySQL and Postgres are often confused by the equivalent commands to accomplish basic tasks. Here's a chart listing some of the differences betwe…
2014-05-16 12:41 · Database · 评论(0)