logic
随便小屋 · 共 66 篇文章
Java 打开URL链接,并下载URL中的文件
Java 小程序,打开Url中的链接,并下载链接中所保存的文件。其中利用了common-io.jar中的FileUtils.copyURLToFile(url, file)方法,jar包在附件中。 import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; impor…
2016-03-06 10:59 · 小程序 · 评论(0)
Windows 安装 Mongodb3.2
1、下载windows对应版本的mongodb 压缩包,建议用压缩版安装。 下载地址: https://www.mongodb.org/downloads#production win7选择64bit, win2003,win2008,vista选择64bit legacy 2、将文件解压到要安装的目录中,我的安装位置:C:\ProgramFiles\mongodb 3、创建文件夹C:\ProgramFiles\mongodb\data\db、C:\ProgramFiles\data\log,分别用来安装db和日志文件,在log文件夹下创建一个日志文件mongodb.log,即d:\mong…
2015-12-14 16:05 · Mongodb · 评论(0)
《架构探险——从零开始写Java Web框架》--试读
从本书总体来看,个人觉的是一本不错的JavaWeb方面的书,非常适合初学者进行学习。当时我开始学JavaWeb的时候,是跟着网上的视频教程学习的,因为网上有些教程可以让我们在学习的过程中完完整整的做一个项目。做完这个项目之后一种成就感就油然而生,一方面能够增加我们学习的兴趣,另一方面能够让一些初级的程序员整体掌握JavaWeb的基础知识,从而达到学以致用的目的。 本书从基础告诉读者如何去开发一个完整的web项目,从根本上去理解一个完整的项目是如何编写和运行的。虽然现在大家所熟知的SSH框架被广泛应用,但有很少人去理解在一个web程序运行的过程中,struts、spring、hibernate…
Java操作Excel单元格
在Java中,对Excel进行处理有两个流行的Jar包,一个是POI,一个是JXL。jxl是在poi的基础上进行开发的,体积小,方便快捷,经常用的功能都能实现,具体两个有什么区别,请参照一下两个链接,分别转自 lanhuidong和javapub http://javapub.iteye.com/blog/718056 http://lanhuidong.iteye.com/blog/1553532 本程序所解决的问题是将excel表中的某个单元格中的数据提取出来,然后进行部分操作,再将所得到的结果写入到另外的单元格中,网上大部分实例都是分别对一个excel文件进行读操作或者写操作,并且在进…
2015-09-25 15:08 · 小程序 · 评论(0)
2015年9月15号360笔试算法2
Problem Description 当你学一些可视化程序设计语言时,老师经常让你设计并编程做出一个计算机,这时也许你会仿照windows系统自带的计算器外观和功能区设计,但是现在考试要你多做出一个有新功能的计算器,实现当输入一个数是,能够将这个数分解成一个或多个素因子乘积的形式,并按素因子的大小排列显示出来。大家对计算器中数的表示应该是很清楚的,下面显示出了0-9这是个数组的表示形式,每个数字占据5*3大小的字符区域。 你能实现这个心能能吗?试试看吧! 输入 能输入多组测试数据,每组包括一个正整数n(n<=1000000) 输出 对于每个数,将它分解成若干个素数乘积的形式,应按从小到大的…
2015-09-20 14:33 · 笔试题 · 评论(0)
2015年9月15号360笔试算法1
Problem Description 欢迎大家参加奇虎360 2016校招在线招聘考试,首先预祝大家都有个好成绩!我相信参加本次在线招聘考试的有不少研究生同学,我们知道就计算机相关专业老说,考研有4门科目,分别是政治(满分100),英语(满分100),数学(满分150)和专业课(满分150). 某校计算机专业今年录取研究生的要求是:政治、英语每门课成绩不低于60分,数学和专业课不低于90分,总成绩不低于310分,并且规定:在满足单科以及总成绩最低要求的基础上,350分以上(含350分)为公费(Gongfei),310分~349分为自费(Zifei). 请判断考生的录取情况。 输入 输入数据…
2015-09-20 11:13 · 笔试题 · 评论(0)
LeetCode-63-Unique Paths II
Unique Paths II 来自 < https://leetcode.com/problems/unique-paths-ii/ > Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and 0 respectively in the grid. For example, There is one obsta…
2015-09-14 11:04 · Leetcode · 评论(0)
LeetCode-48-Rotate Image
Rotate Image 来自 < https://leetcode.com/problems/rotate-image/ > You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 题目解读 给定一个n x n的2D矩阵代表一张图片,将图片旋转90度(顺时针方向)。 你能在原地解决吗? 解析:将二维矩阵先第0行与第n-1行、第1行与第n-2行…进行交换,然后按照主对角线进…
2015-09-07 21:30 · Leetcode · 评论(0)
LeetCode-74-Search a 2D Matrix
Search a 2D Matrix 来自 < https://leetcode.com/problems/search-a-2d-matrix/ > Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row is greater than the last…
2015-09-07 20:24 · Leetcode · 评论(0)
LeetCode-34-Search for a Range
Search for a Range 来自 < https://leetcode.com/problems/search-for-a-range/ > Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, return [-1, -1]…
2015-08-31 08:45 · Leetcode · 评论(0)
LeetCode-73-Set Matrix Zeroes
Matrix Zeroes 来自 < https://leetcode.com/problems/set-matrix-zeroes/ > Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click to show follow up. Follow up: Did you use extra space? A straight forward solution using O(mn) space is probably a bad idea. A si…
2015-08-30 13:56 · Leetcode · 评论(0)
LeetCode-35-Search Insert Position
Search Insert Position 来自 < https://leetcode.com/problems/search-insert-position/ > Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array. Here are few exam…
2015-08-30 09:23 · Leetcode · 评论(0)
LeetCode-62-Unique Paths*(动态规划)
Unique Paths 来自 < https://leetcode.com/problems/unique-paths/ > A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marke…
2015-08-29 20:22 · Leetcode · 评论(0)
LeetCode-79-Word Search*
Word Search 来自 < https://leetcode.com/problems/word-search/ > Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may n…
2015-08-29 11:15 · Leetcode · 评论(0)