自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(33)
  • 收藏
  • 关注

转载 push commit to github,却没有contributions的原因与解决

其实这个原因很简单,是因为本地项目中git config中的user.email与github上的email不一致在项目目录中通过git bash运行git config user.email 可以查看当前的email address通过git config user.email "aabbcc@gmail.com", 设置email address,请保持本地的em...

2016-04-27 15:33:00 366

转载 基于 Jersey 1.x 开发Restful DAO Webservices (Server &Client)

同类的文章网上有好多了,但是开发过程中依然会有很多坑,以及因为对概念的不清晰把自己坑了的情况。这篇文章会梳理我开发过程中遇到的坑以及填坑的方法,附加对Jersey和Webservice一些概念的梳理,附加一些简化开发流程的技巧,文末有相关引用。所有开发都伴随着搭环境,而搭环境这个事情。。。有时可以很复杂,jar包可能冲突,jar包可能跟服务器发生冲突,不同版本的Jar包使用起来...

2016-04-21 14:25:00 282

转载 用浏览器测试Get与Post Webservice,Post一直报405错误,而Get能够成功的原因与解决方法...

楼主在用Jersey开发Restful Webservice的时候碰到了这样一个问题同样一个方法实现,用@get定义和@post定义,@get能通过测试,而@post不能 @GET //@POST @Path("/getUser") @Produces("application/json") //@Consumes(application/x-www-fo...

2016-04-20 14:38:00 1788

转载 Eclipse Web Application 误删 build

Eclipse build里放的是各个.java的.class文件,我今天就不小心误删了build文件解决方案1. 右键项目,source->clean up2. 复制并逐个重建类。。。转载于:https://www.cnblogs.com/Raymond-Yang/p/5409179.html...

2016-04-19 17:55:00 211

转载 Mysql 初始化配置,使用总结

1. 添加,授权用户mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass'; //创建用户mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> WITH GRANT OPTION; ...

2016-04-13 16:03:00 79

转载 Eclipse配置Tomcat服务器和Dynamic Web Project的问题

在eclipse配置tomcat的时候,我发现在Eclipse---Preferences---server---Runtime Environment中,点击“Add”按钮,里面看不到tomcat的,只有个“J2EE Runtime Library”。解决办法:Help -> Install New SoftwareChoose "Lu...

2016-04-11 15:23:00 145

转载 Java 字符串与字符的转换,字符串单个字符的修改

废话不说贴上代码 public static void main(String[] args) { String word = "myWord"; char[] arr = word.toCharArray(); arr[1] = (char) ('a' + 3); word = new String (arr); for (int i = 0; i...

2016-03-11 17:18:00 440

转载 BFS入门,Java迷宫问题

这其实是BFS的入门级问题,我以初学者的姿态研究,如有不足请指正。BFS的核心是利用query的先进先出原则,而本题的回溯用到了stack的后进先出原则,可以说是对两种数据结构的复习。在解题过程中对Java的对象复制的本质有了更加深刻的理解,具体发在另一篇博文”Java对象复制的背后“本题是基本的BFS原理,附加利用二维数组构造象限,利用二维boolean数组构造visite...

2016-03-08 17:01:00 109

转载 自回旋贪吃蛇算法

这是一道大约15年这个时候我去某B开头的互联网公司面试时的一道基础算法题,其描述是有一只小老鼠,假设其在(x,y)点,它的初始方向为Y轴负半轴,它不能碰到x,y轴,也不能与自己走过的路径重合。并且其所走的所有坐标点必须<=(x,y),求它走过的路径和最终停在哪个点。当时我并没有在限定时间解出这道题,如今在做BFS迷宫算法题时突然看到了两者存在某种一致性(当然本题更简单,并不需要...

2016-03-03 11:50:00 103

转载 203. Remove Linked List Elements

Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --> 4 --> ...

2016-02-25 11:13:00 74

转载 143. Reorder List

Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given{1,2,3,4}, reorder it to{1,...

2016-02-24 17:49:00 82

转载 92. Reverse Linked List 2

Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No...

2016-02-22 16:24:00 80

转载 2. Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a...

2016-02-04 14:19:00 76

转载 1. Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, ...

2016-02-02 17:47:00 62

转载 【转】MVC架构

虽然MVC架构已经火了很多年了。。但我一直没有机会真正去体会其本质,借现在得机会,转一篇MVC架构的初学篇控制器(books_controller.php)以HTTP GET或者POST的方式接收到用户的请求(我们也可以有一个主控制器,比如index.php 来接收请求,然后它再调用ooks_controller.php)。控制器检查请求以及对应的参数,然后调用模型(book...

2016-02-02 15:47:00 78

转载 330. Patching Array

Given a sorted positive integer arraynumsand an integern, add/patch elements to the array such that any number in range[1, n]inclusive can be formed by the sum of some elements in the array....

2016-02-01 16:22:00 61

转载 326. Power of Three

给定任意随机数,判定是否为3的乘方。1. 递归public class Solution { public boolean isPowerOfThree(int n) { if (n == 1) return true; if (n % 3 >0 || n == 0) return false; //n已经除不尽的两种情况...

2016-01-28 16:47:00 55

转载 328. Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it...

2016-01-28 16:20:00 51

转载 【转】汉诺塔算法

汉诺塔的问题汉诺塔问题是源于印度一个古老传说的益智玩具。大梵天创造世界的时候做了三根金刚石柱子,在一根柱子上从下往上按照大小顺序摞着64片黄金圆盘。大梵天命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一次只能移动一个圆盘。或许下面的解释会好理解一些:现在要求庙里的老和尚把这64个盘子全部移动到第三个柱子上。移动的时候始终只...

2016-01-28 14:26:00 78

转载 206, Reverse Linked List

Question:Assume that we have linked list1 → 2 → 3 → Ø, we would like to change it toØ ← 1 ← 2 ← 3Official Solution: While you are traversing the list, change the current node's next point...

2016-01-27 16:29:00 52

转载 从Git Init的说起

在本地新建了一个git 目录后,往往需要run这样两条命令1. git remote add origin(git repository的URL)例如https://github.com/Ray-Young/Test 【指定fetch信息】origin是仓库名,我们来看git pro上的一段解释:假设你们团队有个地址为git.ourcompany.com的 Git 服...

2016-01-26 16:32:00 52

转载 Perl unit test中使用skip

代码段中的使用SKIP: { skip "JIRA Server is unavailable",1 if $rets[0] == ERR_SERVER_UNAVAILABLE; is($rets[0], SUCCESS, "Validate jira ticket existence in checkout");}结尾处必须添加,x为代码段中使用skip的数量do...

2016-01-22 16:37:00 111

转载 shell脚本接收命令行参数

cd ~ && mkdir $1 && cd $1 && touch $2 && cvc-add --ticket $1 --module mfgpro_cust $2 && cvc-ci --ticket $1 --message 'ci' && cvc-report --promote-a...

2016-01-18 11:24:00 315

转载 git 错误 fatal: Not a valid object name: 'master'.

想新建立一个分支时出现这错误。后来发现,要先commit一次才会真正建立master分支,此时就可以新建立分支了。。转载于:https://www.cnblogs.com/Raymond-Yang/p/5130538.html...

2016-01-14 15:58:00 59

转载 SQL: select一组数据,concat同表同列的数据

select f.name as name, group_concat(distinct m.name) as module from files f inner join module m on (f.module_id = m.id) where f.name = ? and f.environment = ?...

2015-12-21 17:59:00 122

转载 Linux curl usage

use curl for rest apicurl -u username:password-X GET -H"Content-Type: application/json" restapi addressexample :curl -u username:password -X GET -H"Content-Type: application/json" http:...

2015-11-04 11:18:00 72

转载 Regular Expression

vim 匹配行末空格 s/\s\+$/guserful doc for regexhttp://dhost.info/pingke/L_CoL-RegularExpressions-ShiyongJiqiao_Editplus.htm转载于:https://www.cnblogs.com/Raymond-Yang/p/4877943.html...

2015-10-14 16:53:00 89

转载 浅谈Linux Process status,环境锁

这两天在处理一个相应问题,一个系统希望实行命令互斥,举个例子就是如果我打开了两个命令窗口,分别在这两个窗口中运行两种操作,这些操作是互斥的,即命令2要等待命令1执行完成后再执行。这看似可以用简单的锁机制来实现,但实际处理时还要判断1号窗口的进程状态,用户2不会无线等待用户1的命令执行,会去系统中查看用户1的命令执行情况,如果是正在执行则继续等待,如果这个进程被暂停或者有其他情况...

2015-08-07 10:35:00 101

转载 浅谈Manpage

在linux中会有man git,则显示相应git的帮助文档,这类帮助文档通过一些tag来书写,本文对其用法进行简要概述man文件的后缀为1,运行man xx.1即运行该manman git -w 查看该help doc的源文件位置.SH tag.TH title\ 取消特殊含义.B bold.RS x indent x.RE end of R...

2015-08-03 16:55:00 78

转载 Java文件读写详解。 附txt乱码问题, html乱码问题

先看代码 1 public class FileReader { 2 public static String readFile(String fileName) { 3 String fileContent = ""; 4 try { 5 File f = new File(fileName);...

2015-01-27 19:17:00 54

转载 Eclipse IDE 常用快捷键和设置

windows: ctrl+shift+f 自动缩进选择:windows-> preferences->java->Editor->Mark Occurences选择最上的复选框,下面的就有很多了。其中的Local variables就是变量的高亮显示。另外,encode的设置选择:windows->preferences-&...

2015-01-27 18:41:00 120

转载 Android, JSONLIB , java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sf/json/JSONArray; 原因...

不少人在开发Android项目时,在用JSONLIB解析JSON文件时会碰报这样一个错java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sf/json/JSONArray网上有人说是包没导进来,又是放到系统库又是提前包得位置,对于这样的解决方式我不置可否,也不知道有没有人真的通过他们的方法解决过。对于使用J...

2014-12-02 15:36:00 109

转载 一行代码解析复杂JSON文件:利用Android自带的包解析JSON

上周写了一篇关于Android自带的org.JSON与JSONLIB相冲突的文章,今天我想写一下我对org.json使用的小心得由于学校项目要求解析一个复杂JSON,所以就上网搜了一下,不过Google一搜JSON数据解析,会出现五花八门的结果,JSONLIB, GSON, FASTJSON等等,唯独没有对org.json的使用,其实Android自带的JSON解析包相当好用,...

2014-12-02 14:01:00 81

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除