- 博客(16)
- 收藏
- 关注
转载 Spring配置数据源的三种方式
Spring配置数据源的三种方式 1,使用org.springframework.jdbc.datasource.DriverManagerDataSource 说明:DriverManagerDataSource建立连接是只要有连接就新建一个connection,根本没有连接池的作用。 <bean id="dataSource" class="org.springframework.jdb...
2018-09-29 11:23:02 138
原创 python3爬虫之IP代理
IP代理的使用 为何使用代理IPUser Agetn 已经设置好了,但是还应该考虑一个问题,程序的运行速度是很快的,如果我们利用一个爬虫在网站爬取,一个固定IP的访问频率就会很高,这不符合人为操作的标准,因为人不可能在几ms内,进行如此频繁的访问。所以一些网站会设置一个IP访问频率的阈值,如果超过这个阈值,说明不是人访问,而是一个爬虫程序。 一般步骤说明简单的方法就是设置延时,但是这获取信息太慢,所
2017-06-07 21:48:24 1745
转载 python3爬虫之UserAgent
python3 爬虫之设置User Agent 为何要设置User Agent 有一些网站不喜欢被爬虫访问,所以会连接检测对象,如果是爬虫程序,也就是非人点击访问,它就不会让你继续访问,所以为了要让程序可以正常运行,需要隐藏自己的爬虫程序的身份。此时,我们可以通过设置User Agent的来达到隐藏身份的目的。 User Agent存放于Headers中,服务器就是通过查看Headers中的User
2017-06-07 21:47:51 797
原创 453. Minimum Moves to Equal Array Elements
453. Minimum Moves to Equal Array ElementsGiven a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 eleme
2017-05-08 13:55:55 253
原创 383.Ransom Note
383. Ransom NoteGiven an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the
2017-05-08 13:55:34 435
原创 Assign Cookies
Assign CookiesAssume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum
2017-04-26 14:02:12 196
原创 389.Find the Difference
389.Find the DifferenceGiven 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 at a random position.Find the le
2017-04-26 14:01:57 254
原创 104.Maximum Depth of Binary Tree
104.Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.` /**
2017-04-26 14:01:33 245
原创 Single Number
136. Single NumberGiven an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it with
2017-04-25 10:43:54 353
原创 292.Nim Game
292. Nim GameYou 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 stones. The one who removes the last stone
2017-04-25 10:43:28 297
原创 Reverse String
344. Reverse StringWrite a function that takes a string as input and returns the string reversed.Example: Given s = “hello”, return “olleh”.` public class Solution { public String reverseS
2017-04-25 10:43:03 321
原创 463.Island Perimeter
463. Island Perimeter 海岛周长You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally)
2017-04-25 09:36:54 331
原创 412.FizzBuzz
412. Fizz BuzzWrite a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output
2017-04-25 09:33:23 265
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人