This file contains 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
package com.tistory.devyongsik.search; | |
import org.apache.lucene.analysis.core.WhitespaceAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.FieldType; | |
import org.apache.lucene.facet.index.FacetFields; | |
import org.apache.lucene.facet.params.FacetSearchParams; | |
import org.apache.lucene.facet.search.CountFacetRequest; | |
import org.apache.lucene.facet.search.FacetResult; |
This file contains 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
package com.tistory.devyongsik.search; | |
import com.google.common.collect.Lists; | |
import org.apache.lucene.analysis.core.WhitespaceAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.FieldType; | |
import org.apache.lucene.facet.index.FacetFields; | |
import org.apache.lucene.facet.params.FacetSearchParams; | |
import org.apache.lucene.facet.search.*; |
This file contains 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
var getResult = (function() { | |
var res = 2 + 2; | |
return function() { | |
return res; | |
}; | |
}()); | |
gerResult; //function () { return res; } | |
getResult(); //4 |
This file contains 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
var o = { | |
message: (function() { | |
var who = "me", what = "call"; | |
alert(1); | |
return what + " " + who; }()), | |
getMsg: function() { | |
return this.message; | |
} | |
}; |
This file contains 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
//String to DateTime | |
//05/28/2014 11:31 | |
DateTimeFormatter fmt = DateTimeFormat.forPattern("MM/dd/yyyy HH:mm"); | |
fmt.parseDateTime("05/28/2014 11:31"); | |
//Date to String | |
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm"); | |
String sqlTimeString = fmt.print(DateTime.now()); |
This file contains 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
1. Obtaining an Entity Manager and Persisting an Entity | |
EntityManagerFactory emf = Persistence.createEntityManagerFactory("EmployeeService"); | |
EntityManager em = emf.createEntityManager(); | |
Employee emp = new Employee(130); | |
em.persist(emp); | |
persist가 완료되면 emp 객체는 entity manager의 persistence context에의해 관리된다. | |
2. Finding an Entity | |
Employee emp = em.find(Employee.class, 130); |
This file contains 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 com.google.common.base.Function; | |
import com.google.common.collect.Iterables; | |
import com.google.common.collect.Lists; | |
import lombok.Data; | |
import org.junit.Before; | |
import org.junit.Test; | |
import javax.annotation.Nullable; | |
import java.util.List; |
This file contains 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
// create file: | |
sudo vim /usr/share/applications/intellij.desktop | |
// add the following | |
[Desktop Entry] | |
Version=13.0 | |
Type=Application | |
Terminal=false | |
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png | |
Name[en_US]=IntelliJ |
This file contains 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
package com.tistory.devyongsik.replication; | |
import java.io.IOException; | |
import java.util.Collection; | |
import org.apache.lucene.index.IndexCommit; | |
import org.apache.lucene.index.SnapshotDeletionPolicy; | |
import org.apache.lucene.store.FSDirectory; | |
This file contains 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
@Override | |
protected TokenStreamComponents createComponents(final String fieldName, | |
final Reader reader) { | |
return new TokenStreamComponents(new WhitespaceTokenizer(matchVersion, reader)); | |
} |
OlderNewer