- 博客(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...
2016-03-06 10:59:52
2248
原创 Windows 安装 Mongodb3.2
1、下载windows对应版本的mongodb 压缩包,建议用压缩版安装。下载地址:https://www.mongodb.org/downloads#productionwin7选择64bit,win2003,win2008,vista选择64bit legacy2、将文件解压到要安装的目录中,我的安装位置:C:\ProgramFiles\mongodb3、创建文件夹C...
2015-12-14 16:05:28
271
《架构探险——从零开始写Java Web框架》--试读
从本书总体来看,个人觉的是一本不错的JavaWeb方面的书,非常适合初学者进行学习。当时我开始学JavaWeb的时候,是跟着网上的视频教程学习的,因为网上有些教程可以让我们在学习的过程中完完整整的做一个项目。做完这个项目之后一种成就感就油然而生,一方面能够增加我们学习的兴趣,另一方面能够让一些初级的程序员整体掌握JavaWeb的基础知识,从而达到学以致用的目的。本书从基础告诉读者如何去开发一...
2015-11-23 17:58:13
242
Java操作Excel单元格
在Java中,对Excel进行处理有两个流行的Jar包,一个是POI,一个是JXL。jxl是在poi的基础上进行开发的,体积小,方便快捷,经常用的功能都能实现,具体两个有什么区别,请参照一下两个链接,分别转自lanhuidong和javapubhttp://javapub.iteye.com/blog/718056http://lanhuidong.iteye.com/blog/15...
2015-09-25 15:08:55
318
原创 2015年9月15号360笔试算法2
Problem Description 当你学一些可视化程序设计语言时,老师经常让你设计并编程做出一个计算机,这时也许你会仿照windows系统自带的计算器外观和功能区设计,但是现在考试要你多做出一个有新功能的计算器,实现当输入一个数是,能够将这个数分解成一个或多个素因子乘积的形式,并按素因子的大小排列显示出来。大家对计算器中数的表示应该是很清楚的,下面显示出了0-9这是个数组的表示...
2015-09-20 14:33:20
212
2015年9月15号360笔试算法1
Problem Description欢迎大家参加奇虎360 2016校招在线招聘考试,首先预祝大家都有个好成绩!我相信参加本次在线招聘考试的有不少研究生同学,我们知道就计算机相关专业老说,考研有4门科目,分别是政治(满分100),英语(满分100),数学(满分150)和专业课(满分150).某校计算机专业今年录取研究生的要求是:政治、英语每门课成绩不低于60分,数学和专业课不低于90...
2015-09-20 11:13:17
146
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 w...
2015-09-14 11:04:19
113
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 y...
2015-09-07 21:30:51
121
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 properti...
2015-09-07 20:24:24
142
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...
2015-08-31 08:45:15
158
原创 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...
2015-08-30 13:56:44
122
原创 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 inde...
2015-08-30 09:23:11
136
原创 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...
2015-08-29 20:22:23
136
原创 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 ...
2015-08-29 11:15:51
143
LeetCode-15-3Sum*
3Sum 来自 <https://leetcode.com/problems/3sum/> Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array wh...
2015-08-27 20:53:03
136
原创 LeetCode-209-Minimum Size Subarray Sum
Minimum Size Subarray Sum 来自 <https://leetcode.com/problems/minimum-size-subarray-sum/> Given an array of n positive integers and a positive integer s, find the minimal length of a subar...
2015-08-27 14:28:22
151
原创 Leetcode-217-Contains Duplicate
Contains Duplicate来自 <https://leetcode.com/problems/contains-duplicate/> Given an array of integers, find if the array contains any duplicates. Your function should return true if any valu...
2015-08-27 08:41:21
153
原创 Leetcode-219-Contains Duplicate II
Contains Duplicate II来自 <https://leetcode.com/problems/contains-duplicate-ii/> Given an array of integers and an integer k, find out whether there are two distinct indices i and j in th...
2015-08-27 08:40:25
138
原创 Leetcode-228-Summary Ranges
Summary Ranges 来自 <https://leetcode.com/problems/summary-ranges/> Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], re...
2015-08-27 08:38:48
118
原创 Leetcode-169-Majority Element
Majority Element 来自 <https://leetcode.com/problems/majority-element/> Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊...
2015-08-26 14:53:16
95
Leetcode-88-Merge Sorted Array
Merge Sorted Array 来自 <https://leetcode.com/problems/merge-sorted-array/> Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may a...
2015-08-26 10:04:15
103
原创 Leetcode-119-Pascal's Triangle II
Pascal's Triangle II 来自 <https://leetcode.com/problems/pascals-triangle-ii/> Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1]...
2015-08-26 09:27:47
126
原创 Leetcode-118-Pascal's Triangle
Pascal's Triangle 来自 <https://leetcode.com/problems/pascals-triangle/> Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1]...
2015-08-26 08:51:18
101
原创 Leetcode-66-Plus One
Plus One 来自 <https://leetcode.com/problems/plus-one/> Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most sig...
2015-08-26 08:30:28
114
原创 Leetcode-80-Remove Duplicates from Sorted Array II
Remove Duplicates from Sorted Array II 来自 <https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/> Follow up for "Remove Duplicates": What if duplicates are...
2015-08-25 23:36:54
128
原创 Leetcode-26-Remove Duplicates from Sorted Array
Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra spa...
2015-08-25 23:21:50
97
原创 Leetcode-27-Remove Element
Remove Element Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond th...
2015-08-25 20:52:32
87
原创 Leetcode-189-Rotate Array
Rotate Array:Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:Try to come up as many soluti...
2015-08-25 15:25:35
113
Java取模(求余)运算
整数之间的取模求余运算很好求,但几乎没有遇到过对负数进行取模求余,直接看下面代码:/** * * @author Logic * */public class Test { public static void main(String[] args) { // TODO Auto-generated method stub Syste...
2015-04-01 09:29:54
745
Java Socket 多线程实现文件传输
高级操作系统作业,让用Socket实现文件传输,有些代码也是在网上找的,写的不好,如果大家能用就用上。客户端类: package edu.logic.client;import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.DataInput...
2015-03-27 21:45:00
1417
2
强制删除.svn文件夹
在windows上,从别处复制的项目中可能带有.svn文件夹,手动删除太麻烦,并且每个文件夹下都有。所以写了个程序进行删除。因为.svn文件夹在windows上是只读的,所以用File中的delete()和deleteOnExist()方法都不能将其删除,所以只能采用windows命令方式进行删除,这里仅仅删除的是文件夹,删除文件需要大修!有时间再把它完善一下,代码如下!...
2014-11-30 11:07:33
689
SVN服务器搭建以及外网访问内网SVN
一、SVN服务器的搭建 1、所需软件 TortoiseSVN,下载地址http://tortoisesvn.net/downloads.html TortoiseSVN中文语言包,下载地址http://sourceforge.jp/projects/sfnet_tortoisesvn/downloads/1.8.8/Language%20Packs/Languag...
2014-11-07 12:47:43
3323
1
Ubuntu安装NS-3 环境脚本
将附件下载下来之后解压,将解压后的文件ns3environment.sh复制到下载目录下(其实放在哪里都可以,就是为了和我下面的命令相统一)。输入命令: sudo ./ns3environment.sh >>result 这样系统就自动安装ns3的环境,运行的结果在result文件中,如果提示 command not found 说明...
2014-11-05 18:28:51
187
创业OR读研
现在研一,有种想创业的想法,不知道该不该去实施。因为对于的我情况这两者是矛盾的,可能就是鱼与熊掌不能兼得。 研一的生活刚刚过去两个月,我们学校主要的是搞科研,都是学术型,发现自己一点搞科研的细胞都没有,不知道这种生活能否继续。并且自己感觉读研有点浪费时间,就拿每周的生活来说除了上课,就在实验室看论文。上课大家都懂得就是为了修学分,把学分修够后才能...
2014-10-31 21:03:41
117
原创 SyntaxError: Non-UTF-8 code starting with '\xc4'
刚开始看一下Python语言,传说听强大的,但我感觉还是没Java强吧!写Hello World的时候就遇到一个问题,在Eclipse中写的,代码如下'''Created on 2014年10月27日@author: Logic'''print("Hello World!"); 运行结果SyntaxError: Non-UTF-8 code starting ...
2014-10-28 00:00:46
972
1
The project was not configured: run "waf configure" first
首次将NS-使用waf进行编译的时候出现 The project was not configured: run "waf configure" first 说明要求首先要运行waf configure命令后,然后在用./waf
2014-10-18 20:47:20
4024
3
Ubuntu14.04系统Tab键不能自动补全问题解决
Unbuntu 14.4安装之后就在终端中使用Tab键不能自动补全,解决办法如下: 1、利用vi编辑器打开/etc/bash.bashrc文件(需要root权限)sudo vi /etc/bash.bashrc 接下来会提示输入密码2、找到文件中的下列代码#enable bash completion in interactive shells#if ! shopt ...
2014-10-18 15:39:34
758
关于Java继承的一个小问题。。。
今天看Java 编程思想的时候遇见一个问题,运行的结果和自己想想的完全不一样。先把代码贴出来!//CanFight接口interface Canfight { void fight();}//ActionCharacter类class ActionCharacter { public void fight() { System.out.p...
2014-10-15 08:35:44
115
原创 centos 安装 Codeblocks
1.安装gcc,需要c和c++两部分,默认安装下,CentOS不安装编译器的,在终端输入以下命令即可yum install gccyum install gcc-c++ 2.安装gtk2-devel,因为默认已经安装了正式产品需要的支持库,但是没有安装开发所需要的文档.yum install gtk2*3. 安装wxGTK yum search wxGTK 安装以下两个东...
2014-10-04 10:46:20
95
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人