Tuesday, February 16, 2016

Send emails from localhost - Mac OSX Yosemite

http://www.developerfiles.com/how-to-send-emails-from-localhost-mac-os-x-el-capitan/

Tuesday, February 9, 2016

Lucene 5.4.1 - Write and Search faster

To start off with , follow these 2 basic tutorials.

https://kbicknell.github.io/ling400fall2015/dl/ling400_class5c.pdf


You can add these following dependencies.

<dependency>    <groupId>org.apache.lucene</groupId>    <artifactId>lucene-core</artifactId>    <version>5.4.1</version></dependency><dependency>    <groupId>org.apache.lucene</groupId>    <artifactId>lucene-analyzers-common</artifactId>    <version>5.4.1</version></dependency>
<dependency>    <groupId>org.apache.lucene</groupId>    <artifactId>lucene-queryparser</artifactId>    <version>5.4.1</version></dependency>
If you need to find the matched terms after searching, follow this tutorial and dependency
http://stackoverflow.com/questions/10875604/searching-sentences-in-lucene-and-getting-matched-terms
<dependency>    <groupId>org.apache.lucene</groupId>    <artifactId>lucene-highlighter</artifactId>    <version>5.4.1</version></dependency>

Monday, February 1, 2016

Create, Build & Run - Intellij / Java / Mac - #NLProc code

Today we are going to have a basic NLProc application written using the following
1. Java in Intellij
2. MAC OS
3. Stanford CoreNLP modules.

We will follow these basic 3 steps in writing an enterprise level code with design & folder structures.

I personally had to go through a lot of websites and peer Q&A to understand these bits over the last few months and hence sharing these details to all of you out there.

Let me make this point first. I am a algorithm / back end person and most of my work is written as functions. We don't have web-app in our end of coding. Hence a typical design pattern does not fit our requirement.
Having said that, I do follow the interface and implementation format of java design patterns when and where required.

Maven folder structure -
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

1. Create - Code development.
2. Build
2.1 Build jar with dependencies in Intellij
 https://www.jetbrains.com/idea/help/packaging-a-module-into-a-jar-file.html

Make sure your MANIFEST.MF is in:
src/main/resources/META_INF/

Now If I try to run jar using:
java -jar path_to_jar/jar_file
3. Run
3.1 Shell scripts
All u have to do is call this jar with full path from shell script like this
java -jar path_to_sample/sample.jar > sample.log 2>&1 &
last "&" means that process will run in background

and 2>&1 means that even errors will be redirected to "&1" which is ur standard ouput...console.. now this too will get written in our log file

P.S This blog is WIP. Will provide steps and screenshots more in detail soon.