Skip to content

Instantly share code, notes, and snippets.

@yauhen-info
yauhen-info / Links.txt
Last active July 8, 2019 17:52
Maven, Jersey, Tomcat Embedded sample
@yauhen-info
yauhen-info / jdk_switch_macos.txt
Last active September 23, 2018 13:58
JDK version switch on MacOS
1. Check the current version out of curiosity
> /usr/libexec/java_home -V
Expected result should be similar to
Matching Java Virtual Machines (2):
9.0.4, x86_64: "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
1.8.0_162, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
@yauhen-info
yauhen-info / java_and_osx.txt
Last active July 2, 2018 06:57
Java and OSx
Check the installed versions:
> /usr/libexec/java_home -V
@yauhen-info
yauhen-info / tensorflow_install.md
Last active February 12, 2018 08:54
To install an older version of Tensorflow on Ubuntu

OS: Ubuntu 14.04.5 LTS, Anaconda env

The issue was faced while found that code cannot be run due to import errors caused by tensorflow, so

Suggested solution on stackoveflow page, in details here

e.g for tensorflow version - 0.11, python - 3.5

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp35-cp35m-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
package test;
import LBJ2.nlp.SentenceSplitter;
import LBJ2.nlp.WordSplitter;
import LBJ2.nlp.seg.PlainToTokenParser;
import LBJ2.nlp.seg.Token;
import edu.illinois.cs.cogcomp.lbj.pos.POSTagger;
public class EntryPointIllinoisTaggerTest {
@yauhen-info
yauhen-info / GetTop.java
Created June 11, 2014 17:06
Top N Strings by quantity from input list of strings
import java.util.*;
public class GetTop{
public static void main(String[] args){
List<String> input = new ArrayList<>();
input.add("one");
input.add("two");
input.add("two");
input.add("three");
@yauhen-info
yauhen-info / Get_matched_words.txt
Created May 14, 2014 09:47
Get matched words, Linux command line
The grep -o command will only display matched words and the wc -c command will display the word counts from a text file barfoo.txt:
grep -o -w 'foo' barfoo.txt | wc -w
@yauhen-info
yauhen-info / run_C_file
Last active August 29, 2015 13:56
Run C/C++ via command line in Linux
- Open a terminal.
- Compile your source
(in case of using the GCC compiler, type):
"gcc main_file.c -o main_app"
- Run the executable via "./main_app"
@yauhen-info
yauhen-info / ParagraphsDetector.java
Last active August 29, 2015 13:56
Heuristic to detect paragraphs in a raw text with new lines
package info.yauhen;
public class BoundariesEditor {
public static void main(String[] args) {
//Substitute
String testString = "Sun Life Financial Inc,\n" +
"Canada's No. 3 life insurer, said on Wednesday its\n" +
"fourth-quarter profit rose 39 percent, helped by a C$290 million\n" +
"gain related to the restructuring of internal reinsurance\n" +
"arrangements. \n" +
@yauhen-info
yauhen-info / BoundariesEditor.java
Created February 13, 2014 12:52
Change boundaries of found pattern
package info.yauhen;
public class BoundariesEditor {
public static void main(String[] args) {
//Substitute
String testString = "<Test> <LCOc1>";
testString = testString.replaceAll("\\(", "<").replaceAll("//", ">");
testString = testString
.replaceAll("<[A-Za-z0-9\\.\\-=]+>", "($0)")
.replaceAll(">\\)","\\)")