ITeye博客

conkeyn

conkeyn · 共 516 篇文章

post json

方法一: public static String doPostJson(String interfaceUrl, Object jsonObject) throws Exception { String encoding = "UTF-8"; String contentType = "application/json"; String requestMethod = "POST"; Gson gson = new Gson(); String stringJson = gson.toJson(jsonObject); StringBuffer result = new StringBuf…

2015-12-30 12:35 · Java · 评论(0)

javascript中借用别的类的方法

借用别的类的方法 /** * Created by Administrator on 2015/12/23. */ //====================借用方法=============================== function borrowMethods(borrowFrom,addTo){ var from = borrowFrom.prototype; var to = addTo.prototype; for(m in from){ if(typeof from[m]!="function"){ continue; } to[m] = from[m]; } } /…

2015-12-23 21:58 · JavaScript · 评论(0)

Javascript的类与子类创建

声明父类与子类的示例: /** * Created by Administrator on 2015/12/23. */ //声明Rectangle类 function Rectangle(w, h) { this.width = w; this.height = h; } Rectangle.prototype.area = function () { return this.width * this.height; } //父类定义了toString()方法+ Rectangle.prototype.toString = function(){ return "[width:" + th…

2015-11-11 20:45 · JavaScript · 评论(0)

右建打开文本编辑器

http://zhidao.baidu.com/link?url=JNzgRxFtj8d7dsOuvRzT025b8r0dvRMNtYp_YExQur_hIJz9Iqm175EZC7FviHD85ocLKvIyTgZTG6Gy9sVvwq 右建打开文本编辑器 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\EmEditor] @="EmEditor" [HKEY_CLASSES_ROOT\*\shell\EmEditor\command] @="c:\\Program Files\\EmEditor\\EmEdi…

2015-09-05 09:01 · 评论(0)

安装rredis集群

1、先参考 《CentOS下安装rvm、ruby》将ruby安装起来。 2、安装ruby redis工具 gem install redis 3、如果出现以下错误,那么确认一下 《CentOS下安装rvm、ruby》 的第5点是否正常配置 ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/quick/Marshal.4.8/redis-3.2.1.g…

2015-07-22 15:48 · cache/redis · 评论(0)

CentOS下安装rvm、ruby

1、安装的工具包 yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison sqlite-devel iconv-devel 2、安装rvm(ruby管理工具) [root@mail ~]# curl -L get.rvm.io | bash -s stable 如果遇到以下错误: Warning, RVM 1.26.0 introduces si…

2015-07-22 09:17 · SYS/linux · 评论(0)

maven打包成可执行的jar包(package a runnable jar)

第一步:利用maven-jar-plugin生成当前工程的jar,该jar包包含manifest的main-class和class-path参数。 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.6</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPref…

2015-04-23 22:01 · Java · 评论(0)

spring的rabbitmq配置

1、applicationContext-base.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:mvc="ht…

2015-03-31 17:57 · Java/Spring、Spring MVC · MQ/RabbitMQ · 评论(8)

pring 4.x 注解方式配置quartz 2.2.x的集群

首先是pom.xml <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <artifactId>quartz-test</a…

2015-03-26 20:44 · Java/Quartz · 评论(0)

自定义ObjectMapper

d import java.io.IOException; import org.apache.commons.lang.time.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonTokenId; import com.fasterxml.jackson.databind.DeserializationContext; import com…

2015-03-02 16:57 · Java · Java/Spring、Spring MVC · 评论(0)

JsonObjectMapper

import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; /** * json与…

2015-02-05 10:41 · Java · 评论(0)

spring 4.x源码方式配置spring beans

public class ZeusWebApplicationInitializer implements WebApplicationInitializer { public void onStartup(ServletContext container) { WebApplicationContext rootContext = WebApplicationContextUtils.getWebApplicationContext(container); if (rootContext == null) { rootContext = new AnnotationConfigWebApp…

2015-01-06 11:58 · Java/Spring、Spring MVC · 评论(0)

Kafka开发时的异常

1、遇到Producer connection to hostname:9092 unsuccessful 14/12/29 11:57:39 INFO utils.VerifiableProperties: Verifying properties 14/12/29 11:57:39 INFO utils.VerifiableProperties: Property metadata.broker.list is overridden to master001:9092,master001:9092 14/12/29 11:57:39 INFO utils.VerifiableProper…

2014-12-29 12:01 · MQ/Kafka · 评论(0)

zookeeper 启动错误问题

1、3888端口一直无法连接上 -04 00:06:50,339 [myid:] - INFO [main:QuorumPeerConfig@103] - Reading configuration from: /home/conkeyn/zookeeper-3.4.6/bin/../conf/zoo.cfg 2014-12-04 00:06:50,344 [myid:] - WARN [main:QuorumPeerConfig@293] - No server failure will be tolerated. You need at least 3 servers. 2014-12-…

2014-12-04 16:31 · hadoop · 评论(0)

配置RabbitMQ远程访问

本文参考自: http://flashing.iteye.com/blog/1797531 1.如果远程客户端网络状况不是太好,比如adsl什么的,那么一定在客户端打开requstedHeartbeat 2.如果在同一台机器上,千万不要打开requstedHeartbeat,即requstedHeartbeat=0 3.各个系统下配置文件的位置: Windows - %APPDATA%\RabbitMQ\rabbitmq.config Debian - /etc/rabbitmq/rabbitmq.config RPM - /etc/rabbitmq/rabbitmq.config MacO…

2014-10-28 15:44 · MQ/RabbitMQ · 评论(0)