1. 权限不够: 使用 chmod +x XXX.sh 提升权限2. 出现:/bin/bash^M:
bad interpreter: No such file or directory 原因:文件换行里出现\r\n 与linux格式不符合 安装dos2unix
apt-get installd.....
分类:
系统相关 时间:
2014-06-29 12:26:50
阅读次数:
293
本文出自:http://blog.csdn.net/svitter
引文出自:http://bbs.chinaunix.net/thread-775649-1-1.html
1.关闭服务 service 服务 stop
netstat -ntlp
kill -9 PID
2.使用两个方法
1.
ps aux|grep 端口
kill -9 PID
2.
iptables...
分类:
系统相关 时间:
2014-06-20 13:08:31
阅读次数:
324
题目
Write a function to find the longest common prefix string amongst an array of strings.
原题链接
解题思想
给一个字符串数组,求这些字符串的最长公共前缀。
这个题应该是比较简单的,直接写代码,一次AC。解题思想是依次对数组中的字符串求最长公共前缀。
代码实现
class Sol...
分类:
其他好文 时间:
2014-06-20 12:25:09
阅读次数:
247
以下3步问正确的程序片段:
1.写文件
#! /usr/bin/python3
'makeTextFile.py -- create text file'
import os
def write_file():
"used to write a text file."
ls = os.linesep
#get filena...
分类:
编程语言 时间:
2014-06-20 10:47:27
阅读次数:
278
链接: http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=2113
Description
Given a number of strings, can you find how many strings that appears T times?
Input
The input conta...
分类:
编程语言 时间:
2014-06-20 09:00:14
阅读次数:
344
题目来源:Light OJ 1268 Unlucky Strings
题意:给你一些可以用的字符 然后求组成不包含给定字符串的方案数
思路:矩阵经典问题 从i走k步路到达j的方案数 可以用矩阵快速幂求解
对于求长度为n的字符的方案数 就是走n步路 求走法
可以用KMP求出走一步 从前i个字符到前j个字符的方案数 这点有点不好理解 想一想
#include
#include
#...
分类:
其他好文 时间:
2014-06-07 14:33:43
阅读次数:
303
二叉树的递归遍历和非递归遍历(附详细例子)
二叉树的遍历主要有递归实现和非递归实现,递归实现比较好理解,非递归实现主要是利用了栈的思想,后进先出,本文实现二叉树的非递归遍历主要是用了LinkedList可以当做栈使用的功能。具体例子如下:
package com.sheepmu;
import java.util.LinkedList;
public class Bin...
分类:
其他好文 时间:
2014-06-07 13:06:05
阅读次数:
269
python实现的链表,包括插入、查找、删除操作
#!/usr/bin/python
class linknode():
def __init__(self,k,n=None):
self.key=k;
self.next=n;
def createlist(): #创建链表
n=raw_input("enter the num of nodes");
n=int(...
分类:
编程语言 时间:
2014-06-07 12:23:46
阅读次数:
204
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -rubygems
/Library/Ruby/Gems/2.0.0/gems/rake-0.9.6/bin/rake RUBYARCHDIR=/Library/R...
分类:
其他好文 时间:
2014-06-07 11:08:29
阅读次数:
257
在实际的项目开发中,有些文件(比如bin,obj下的文件)是不需要放在svn里面的,因为每次都会重新生成。该如何排除这些文件那?我试着在svn
server上删除了这些文件夹,但是在文件夹上还是显示有更改。该如何彻底忽略这些文件那?【方法】展开文件夹,选中要排除的文件或文件夹,右键选择如下的菜单。完...
分类:
其他好文 时间:
2014-06-07 09:43:55
阅读次数:
249