This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FindDuplicate { | |
public static void main(String[] args) { | |
FindDuplicate fd = new FindDuplicate(); | |
int[] nums = new int[]{1, 2, 3, 4, 5, 6, 1}; | |
assert (fd.find(nums) == 1); | |
nums = new int[]{1, 2, 3, 4, 5, 6, 1}; | |
assert (fd.find(nums) == 1); | |
nums = new int[]{2, 2, 3, 4, 5, 6, 1}; | |
assert (fd.find(nums) == 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PropertyLoader { | |
private static Properties prop; | |
private PropertyLoader() { | |
} | |
public static synchronized String getProperty(String propertyName) throws IOException { | |
if (prop == null) { | |
prop = new Properties(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Filename:file_cut.py | |
path = raw_input('please enter the file path:') | |
savepath = raw_input('please enter the save path:(not include the last \'\\\')') | |
newname = raw_input('please enter the new name:') | |
fr = file(path,'r') | |
flag = True | |
i = 0 #??? | |
c = 1 #???? | |
while flag: |