excel数据表导入远程mysql数据库 解决的问题mysql数据库在公司内网服务器,而excel数据表在本地,需要堡垒机跳转才能访问,无法直连,因此在本地任何客户端导入数据表的方法都不好使。数据库只开放了一个端口,无法将数据表传到数据库服务器上,再登入数据库利用load data infile命令导入。解决办法登陆内网任意一台可以链接数据库的服务器,将excel文件导出为.sql文件,然后使用mysql -h ho
按日期每天切割、定期删除tomcat的catalina.out日志 自动切割:http://blog.csdn.net/hanzheng260561728/article/details/51236131定期删除:http://825536458.blog.51cto.com/4417836/1841389
maven阿里云中央仓库 maven作为一个项目管理工具确实非常好用,但是在国内这个网络条件下实在是让人恼火。之前oschina的中央仓库可用,现在oschina的maven服务器关了,一直没找到国内镜像来替代。今天发现阿里云公开了一个中央仓库,大家可以试试。配置 修改maven根目录下的conf文件夹中的setting.xml文件,内容如下: alimaven aliyun mav
Spring AOP IOC 实现原理,面试问到如何回答 IOC:控制反转也叫依赖注入,IOC利用java反射机制,AOP利用代理模式。所谓控制反转是指,本来被调用者的实例是有调用者来创建的,这样的缺点是耦合性太强,IOC则是统一交给spring来管理创建,将对象交给容器管理,你只需要在spring配置文件总配置相应的bean,以及设置相关的属性,让spring容器来生成类的实例对象以及管理对象。在spring容器启动的时候,spring会把你在配置文件中
[LeetCode]Basic Calculator II 题目不难,但是想做对却也需要考虑很多细节。 没有括号的运算就是先乘除后加减,思路是把➕和➖看作分隔符,先计算分隔符隔开的一个个term,再把term相加。 举个例子:a+b*c/d-e,在这个例子中,读到第一个➕时,term是a,并且我们可以认为a已经被➕分割开了,可以加到总和里去了,所以sum现在是a,term往后读一个数,是b。然后往后读一个符号是✖️,所以term=term*c,即term
LeetCode总结 终于把LeetCode免费题目都做完了,接下来要做第二遍,想把第一遍不会做的题目整理一下思路,为接下来的google面试准备一下,万一过了呢,哈哈。315 Count of Smaller Numbers After Self 题意:计算每个元素右面有多少个元素小于它 从后向前遍历,维护一个排好序的数组,每次插入新元素时确定其在有序数组的位置,就是要求的右面有多少个元素小
git ignore 添加后不生效 解决办法 问题在repo中已经上传了很多配置文件,后来发现不需要,但是在gitignore添加之后并没有作用,在每次add后依然会出现。解决办法执行如下代码,把它们从repo中删除git rm --cached `git ls-files -i --exclude-from=.gitignore`
Install NumPy, SciPy, scikit-learn on Mac OS X Add on and summarized from blog http://penandpants.com/2012/02/24/install-python/Outline1. install Xcode –> 2. install pip –> 3. install brew –> 4. install NumPy –> 5. install gfortran (important!) –
Linux统计某文件夹下文件、文件夹的个数 统计某文件夹下文件的个数ls -l |grep "^-"|wc -l统计某文件夹下目录的个数ls -l |grep "^d"|wc -l统计文件夹下文件的个数,包括子文件夹里的ls -lR|grep "^-"|wc -l如统计/home/han目录(包含子目录)下的所有js文件则:ls -lR /home/han|grep js|wc -l 或 ls -l "/home/han"|grep "js"
【LeetCode】31. Next Permutation 题目思路找到下一个排列,比较好的思路是 O(n)O(n) ,从尾向前遍历,找到第一个nums[i-1]代码void nextPermutation(vector<int>& nums) { int N = nums.size(); bool flag = false; int i,j; for (i=N-1;i>=1;--i){
【LeetCode】310. Minimum Height Trees 题目链接思路我想到了n个点构成树,那么一定会有n-1条边,构成的树深度最大的情况发生在所有点位于一条链上,此时深度为 n/2n/2 或 n/2+1n/2 + 1 ,这取决于n的奇偶性。树深度最浅的情况发生在一个根节点,所有其它节点都与根节点直接相连,此时深度为2。我还发现一个规律,就是叶子节点的数目+树的最长路径为一定值,为节点数+2。这样统计出有多少个叶子节点后,再走最长路径的一半所到达的节点就是
【LeetCode】82. Remove Duplicates from Sorted List II 思路很简单的一道题,思路也没什么特别的,就是设置一个prehead节点代码 ListNode* deleteDuplicates(ListNode* head) { ListNode nHead(0); ListNode* phead = &nHead; ListNode* tmp = &nHead; bool flag;
【LeetCode】209. Minimum Size Subarray Sum 题目Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For example, given the array [2,3,1,2,
【LeetCode】207. Course Schedule 题目There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pai
【LeetCode】134. Gas Station 题目There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its n
【LeetCode】40. Combination Sum II 题目Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combination.
【LeetCode】50. Pow(x, n) 题目Implement pow(x, n).Subscribe to see which companies asked this question思路两种方法,一:一个一个乘,最多乘INT_MAX次,显然不太好。 二:每次求n/2n/2次幂,最多32次陷阱此题陷阱非常多,主要需要考虑几种特殊情况: 1. n 为 0:结果为1 2. n 为负数,需要先求再求倒数,或者直接求1/x1/x的-n次
【LeetCode】92. Reverse Linked List II 题目Reverse a linked list from position m to n. Do it in-place and in one-pass.For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note: Given m, n satisfy the following
【LeetCode】55. Jump Game 题目Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if you a