Learn, develop, play.

About me

Georgiy Kharlampiev

Software Developer Developer
Hi! My name is Georgiy and I'm a software developer. I started to work with information technologies when I was a kid and have never stopped. I worked on a lot of projects, in different businesses. Aviation, insurance, e-commerce, etc. My hobbies are software development and knowledge sharing.


How to Build a Natural Language Processing App

Natural language processing—a technology that allows software applications to process human language—has become fairly ubiquitous over the last few years. Google search is increasingly capable of answering natural-sounding continue

Create folder Java

We are having 2 variants: 1 – when we want to create single folder (C:\first) 2 – when we want to create all tree for folders (C:\1\2\3) Let’s try to create it: //First variant File folder= new File(“C:\\first”); file.mkdir(); //Second variant File folders= new File(“C:\\1\\2\\3”); files.mkdirs(); After that we will see all folder which we […]

Write to temp file Java

Previous we just create empty temp file Lets write there some text Example: try{ File tempFile = File.createTempFile(“tempFile”, “.tmp”); BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(tempFile)); bufferedWriter.write(“This is Test for tempFile!”); bufferedWriter.close(); }catch(IOException ex){ ex.printStackTrace(); }

Create temp file in Java

Sometimes you need to crate temp files and clean memory java.io.File library helps to do this Example: try{ File tempFile = File.createTempFile(“tempFileName”, “.tmp”); System.out.println(tempFile.getAbsolutePath()); }catch(IOException ex){ ex.printStackTrace(); } This code create file like tempFileName31231.tmp

Unzip file from GZip Java

We have already zip file in GZip format, lets unzip it Example: String INPUT_FILE = “/home/user/fileArchive.gz”; String OUTPUT_FILE = “/home/user/fileText.txt”; byte[] buffer = new byte[1024]; try{ GZIPInputStream gZIPInputStream = new GZIPInputStream(new FileInputStream(INPUT_FILE)); FileOutputStream fileOutputStream = new FileOutputStream(OUTPUT_FILE); int len; while ((len = gZIPInputStream.read(buffer)) > 0) { fileOutputStream.write(buffer, 0, len); } gZIPInputStream.close(); fileOutputStream.close(); }catch(IOException ex){ ex.printStackTrace(); […]

Archive file in GZip Java

We have already create zip file in java, lets check it with GZip Example: private String OUTPUT_FILE = “/home/user/fileArchive.gz”; private String INPUT_FILE = “/home/user/fileText.txt”; byte[] buffer = new byte[1024]; try{ GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(new FileOutputStream(OUTPUT_FILE)); FileInputStream fileInputStream = new FileInputStream(INPUT_FILE); int len; while ((len = fileInputStream.read(buffer)) > 0) { gZIPOutputStream.write(buffer, 0, len); } fileInputStream.close(); […]