Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View oleglomako's full-sized avatar

Oleg Lomako oleglomako

  • Italy
View GitHub Profile
@oleglomako
oleglomako / pom.xml
Created September 13, 2016 16:54
Как подключить библиотеку sqlite-jdbc с помощью maven
<?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>
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) {
<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();
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) {
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) {
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
/.idea
/out
/target
*.iml
Предположим, что ваш исходный файл MyGame.java находится в папке E:\Java.
Вызываете командную строку (Пуск/Выполнить.../cmd)
и с помощью команд "e:" и "cd \Java" переходите в нужный каталог.
После этого:
E:\Java>javac MyGame.java
Затем создаём файл manifest.txt с одной строкой:
Main-Class: MyGame
и сохраняем в папке E:\Java.
Очень важно, набрав текст в файле, нажать Enter (сделать перевод строки),
так, чтобы была вторая строка - пустая.
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
/**
* 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);