maven单元测试设置代理

背景  环境需要设置代理才能够访问外部网络,如果只是运行java程序来访问网络,我们可以通过java -jar test.jar -DproxyHost=proxy_ip -DproxyPort=proxy_port,但如果是java的maven项目中,单元测试需要访问网络,只执行mvn test...

2017-08-02 07:41:30

阅读数:374

评论数:0

【LeetCode】476. Number Complement (java实现)

原题链接https://leetcode.com/problems/number-complement/原题Given a positive integer, output its complement number. The complement strategy is to flip the ...

2017-01-26 06:59:38

阅读数:2315

评论数:0

【LeetCode】461. Hamming Distance (java实现)

原题链接https://leetcode.com/problems/hamming-distance/原题The Hamming distance between two integers is the number of positions at which the corresponding ...

2017-01-05 22:51:29

阅读数:4212

评论数:0

【LeetCode】475. Heaters (java实现)

原题链接https://leetcode.com/problems/heaters/原题Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius...

2016-12-28 23:07:53

阅读数:2646

评论数:0

【LeetCode】455. Assign Cookies (java实现)

原题链接https://leetcode.com/problems/assign-cookies/原题Assume you are an awesome parent and want to give your children some cookies. But, you should give...

2016-11-29 05:33:35

阅读数:1436

评论数:0

【LeetCode】396. Rotate Function(java实现)

原题链接https://leetcode.com/problems/rotate-function/原题Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by ro...

2016-11-18 06:06:05

阅读数:578

评论数:0

【LeetCode】409. Longest Palindrome (java实现)

原题链接https://leetcode.com/problems/longest-palindrome/原题Given a string which consists of lowercase or uppercase letters, find the length of the longes...

2016-11-13 07:26:35

阅读数:758

评论数:0

【LeetCode】405 Convert a Number to Hexadecimal (java实现)

原题链接https://leetcode.com/problems/convert-a-number-to-hexadecimal/原题Given an integer, write an algorithm to convert it to hexadecimal. For negative i...

2016-11-09 23:33:12

阅读数:1705

评论数:0

【LeetCode】415 Add Strings (java实现)

原题链接https://leetcode.com/problems/add-strings/原题Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2.N...

2016-10-28 07:08:48

阅读数:3682

评论数:2

【LeetCode】401 Binary Watch (java实现)

原题链接https://leetcode.com/problems/binary-watch/原题A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

2016-10-24 07:17:12

阅读数:2193

评论数:0

【LeetCode】400 Nth Digit(java实现)

原题链接https://leetcode.com/problems/nth-digit/原题Find the nthn^th digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …Note: n is...

2016-10-24 07:15:21

阅读数:1295

评论数:0

【LeetCode】TreeNode类实现解析(java实现)

在LeetCode中,TreeNode是经常用到的一个结构体,表示数据结构树(Tree)中的一个节点。其官方定义如下: public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode...

2016-10-20 00:39:17

阅读数:9832

评论数:3

【LeetCode】387 First Unique Character in a String(java实现)

原题Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = "leetcode"...

2016-10-20 00:37:41

阅读数:2022

评论数:0

【LeetCode】404 Sum of Left Leaves(java实现)

原题Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary ...

2016-10-20 00:34:27

阅读数:1430

评论数:0

【LeetCode】389 Find the Difference(java)

原题Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter a...

2016-09-29 23:46:25

阅读数:691

评论数:1

【LeetCode】383 Ransom Note(java)

原题 题目要求 解法 原题Given
 an 
arbitrary
 ransom
 note
 string 
and 
another 
string 
containing 
letters from
 all 
the 
magazines,
 write 
a 
function 
th...

2016-08-17 17:35:30

阅读数:3899

评论数:0

【LeetCode】345 Reverse Vowels of a String(java)

原题 题目要求 解法 原题Write a function that takes a string as input and reverse only the vowels of a string.Example 1: Given s = “hello”, return “holle”.Exam...

2016-05-04 16:15:30

阅读数:2580

评论数:0

【LeetCode】299 Bulls and Cows (java实现)

原题 题目要求 常规解法 更聪明的代码 原题:You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what ...

2016-04-16 11:01:24

阅读数:1139

评论数:0

【LeetCode】292 Nim Games (java实现)

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 sto...

2015-12-08 00:04:48

阅读数:615

评论数:0

Eclipse中开启java的assert选项

在java中,assert开关是jvm的选项,默认是关闭的,开启选项的参数为-enableassertions或者其简写-ea。如果需要在eclipse调试时开启assert选项,需要对项目进行配置,这里介绍两种方法: 1.Run -> Run Configurations->Jav...

2015-09-04 15:34:36

阅读数:3442

评论数:0

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