This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com</groupId> | |
<artifactId>HelloMaven</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains 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
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class ReadFileLineByLine { | |
// построчное считывание файла | |
public static void main(String[] args) { |
This file contains 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
<meta charset-"utf-8"> | |
<script> | |
function guid() { | |
function s4() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
s4() + '-' + s4() + s4() + s4(); |
This file contains 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
package com.oleglomako.SearchSubString; | |
import java.io.*; | |
public class SearchSubString { | |
public static String readLine() { | |
try { | |
return new BufferedReader(new InputStreamReader(System.in)) | |
.readLine(); | |
} catch (IOException e) { |
This file contains 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
package com.oleglomako.TrueRemoveFromArrayList; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
public class TrueRemoveFromArrayList { | |
public static void main(String[] args) { |
This file contains 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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit" | |
После этой команды можно использовать git lg вместо стандартного git log |
This file contains 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
/.idea | |
/out | |
/target | |
*.iml |
This file contains 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
Предположим, что ваш исходный файл MyGame.java находится в папке E:\Java. | |
Вызываете командную строку (Пуск/Выполнить.../cmd) | |
и с помощью команд "e:" и "cd \Java" переходите в нужный каталог. | |
После этого: | |
E:\Java>javac MyGame.java | |
Затем создаём файл manifest.txt с одной строкой: | |
Main-Class: MyGame | |
и сохраняем в папке E:\Java. | |
Очень важно, набрав текст в файле, нажать Enter (сделать перевод строки), | |
так, чтобы была вторая строка - пустая. |
This file contains 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
git init | |
git add . | |
git commit -m 'initial commit' | |
git remote add origin https://github.com/user_name/test.git | |
git push -u origin master |
This file contains 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
/** | |
* Extract digit from string | |
*/ | |
public class Test { | |
public static void main(String[] args) { | |
String str = "0b1100100"; | |
str = new String(str.replaceAll("\\D+", "")); | |
int n = Integer.parseInt(str, 2); | |
System.out.println(n); |
OlderNewer