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 int gcd(int p, int q){ | |
| if(q==0) return p; | |
| int r=p%q; | |
| return gcd(q,r); | |
| } |
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
| базовые команды | |
| git clone адрес репозитория - клонировать репозиторий на локальный компютер | |
| git commit -m 'initial commit' комит изменений в локальный репозиторий | |
| git push -u origin master - только первый раз отправка изменений в удаленный репозиторий | |
| git push - все последующие разы отправка изменений в удаленный репозиторий | |
| окат изменений | |
| git pull - скачивается актуальная версия удаленного репозитория и все изменения применяются к локальному репозиторию | |
| checkout - перейти в другую ветку | |
| discard - не отправлять в репозиторий те изменения которые нам не нравятся |
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
| удалить папку идеи .idea/ из индекса гита | |
| git rm -r --cached .idea/ | |
| Removed all files that are in the .gitignore | |
| git rm --cached `git ls-files -i --exclude-from=.gitignore` | |
| git commit -m 'Removed all files that are in the .gitignore' | |
| git push origin master |
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
| import java.util.Arrays; | |
| import java.util.Scanner; | |
| /** | |
| * Смотри, какое пятое задание: | |
| * Написать код, который хранит массив букв - загаданное слово; | |
| * спрашивает у пользователя букву, | |
| * если такая буква входит в загаданное слово, | |
| * то выводит на экран отгаданные буквы с указанием их расположения в слове; | |
| * продолжает исполнение, |
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
| A Maven archetype for generating a basic JavaFX starter project. | |
| See the JavaFX Maven Plugin for more details on using your generated project: | |
| https://github.com/javafx-maven-plugin/javafx-maven-plugin | |
| Usage: | |
| mvn archetype:generate -DarchetypeGroupId=com.zenjava -DarchetypeArtifactId=javafx-basic-archetype |
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
| /** | |
| * 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); |
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
| 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 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
| Предположим, что ваш исходный файл MyGame.java находится в папке E:\Java. | |
| Вызываете командную строку (Пуск/Выполнить.../cmd) | |
| и с помощью команд "e:" и "cd \Java" переходите в нужный каталог. | |
| После этого: | |
| E:\Java>javac MyGame.java | |
| Затем создаём файл manifest.txt с одной строкой: | |
| Main-Class: MyGame | |
| и сохраняем в папке E:\Java. | |
| Очень важно, набрав текст в файле, нажать Enter (сделать перевод строки), | |
| так, чтобы была вторая строка - пустая. |
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
| /.idea | |
| /out | |
| /target | |
| *.iml |
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
| 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 |