update Anaconda.sublime-settings
parent
b5575183ec
commit
9429c1a8bd
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"anaconda_linter_underlines": false,
|
// "anaconda_linter_underlines": false,
|
||||||
"auto_formatting": true,
|
"auto_formatting": true,
|
||||||
"complete_all_parameters": true,
|
// "complete_all_parameters": true,
|
||||||
"complete_parameters": true,
|
// "complete_parameters": true,
|
||||||
"pep8_ignore": [
|
"pep8_ignore": [
|
||||||
"E501"
|
"E501"
|
||||||
],
|
],
|
||||||
"python_interpreter": "python",
|
"python_interpreter": "D:\\works\\Python35\\python.exe",
|
||||||
"suppress_explicit_completions": true,
|
"suppress_explicit_completions": true,
|
||||||
"suppress_word_completions": true
|
"suppress_word_completions": true
|
||||||
}
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package osc.git.eh3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lixiangrong on 2016/12/23.
|
||||||
|
*/
|
||||||
|
public class dfd {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
public void printCircle(int[][] matrix, int startX, int startY, int endX, int endY) {
|
||||||
|
// only one column left
|
||||||
|
if (startY == endY) {
|
||||||
|
for (int i = startX; i <= endX; i++ ) {
|
||||||
|
System.out.println(matrix[i][endY]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// only one row left
|
||||||
|
if (startX == endX) {
|
||||||
|
for (int i = startY; i <= endY; i++ ) {
|
||||||
|
System.out.println(matrix[startX][i]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = startY; i < endY; i++ ) {
|
||||||
|
System.out.println(matrix[startX][i]);
|
||||||
|
}
|
||||||
|
for (int i = startX; i < endX; i++ ) {
|
||||||
|
System.out.println(matrix[i][endY]);
|
||||||
|
}
|
||||||
|
for (int i = endY; i > startY; i-- ) {
|
||||||
|
System.out.println(matrix[endX][i]);
|
||||||
|
}
|
||||||
|
for (int i = endX; i > startX; i-- ) {
|
||||||
|
System.out.println(matrix[i][startY]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printMatrix(int[][] matrix) {
|
||||||
|
|
||||||
|
if (matrix == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int startX = 0;
|
||||||
|
int startY = 0;
|
||||||
|
int endY = matrix[0].length - 1;
|
||||||
|
int endX = matrix.length - 1;
|
||||||
|
|
||||||
|
while ((startX <= endX) && (startY <= endY)) {
|
||||||
|
printCircle(matrix, startX, startY, endX, endY);
|
||||||
|
startX++;
|
||||||
|
startY++;
|
||||||
|
endX--;
|
||||||
|
endY--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ import org.apache.commons.codec.binary.Hex;
|
||||||
public class TestDecodeHex {
|
public class TestDecodeHex {
|
||||||
// 十六进制转字符串
|
// 十六进制转字符串
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
String data = "E7A7AFE69E81E58AA0E5BFABE7A791E68A80";
|
String data = "E88194E7B3BBE4BABAE6B7BBE58AA0E5A4B1E8B4A5";
|
||||||
System.out.println(new String(Hex.decodeHex(data.toCharArray()), "utf-8"));
|
System.out.println(new String(Hex.decodeHex(data.toCharArray()), "utf-8"));
|
||||||
|
|
||||||
System.out.println(Hex.encodeHexString("测试粗我".getBytes()));
|
System.out.println(Hex.encodeHexString("测试粗我".getBytes()));
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package osc.git.eh3.thread;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
|
class MyThread extends Thread {
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
public MyThread(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
System.out.println(name + "正在进行。。。。。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TestSingleThreadExecutor {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ExecutorService executorService = Executors.newSingleThreadExecutor();
|
||||||
|
Thread t1 = new MyThread("t1");
|
||||||
|
Thread t2 = new MyThread("t2");
|
||||||
|
Thread t3 = new MyThread("t3");
|
||||||
|
Thread t4 = new MyThread("t4");
|
||||||
|
executorService.execute(t1);
|
||||||
|
executorService.execute(t2);
|
||||||
|
executorService.execute(t3);
|
||||||
|
executorService.execute(t4);
|
||||||
|
executorService.shutdown();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package osc.git.eh3.thread;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lixiangrong on 2016/12/22.
|
||||||
|
*/
|
||||||
|
public class ThreadPoolExecutorTest {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
final int index = i;
|
||||||
|
//try {
|
||||||
|
// Thread.sleep(index * 1000);
|
||||||
|
//} catch (InterruptedException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
//}
|
||||||
|
cachedThreadPool.execute (new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
//System.out.println(index);
|
||||||
|
System.out.println(Thread.currentThread().getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue