Skip to content

Instantly share code, notes, and snippets.

View lacti's full-sized avatar

Jaeyoung, Choi lacti

View GitHub Profile
void Main()
{
// Write code to test your extensions here. Press F5 to compile and run.
}
public static class MyExtensions
{
// Write custom extension methods here. They will be available to all queries.
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T> consumer)
{
@lacti
lacti / Chat100.cs
Last active January 10, 2018 08:53
using System.Collections.Concurrent;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using System.Collections.Generic;
async Task Main()
{
Task.Factory.StartNew(ProcessWork, TaskCreationOptions.LongRunning);
var listener = new TcpListener(IPAddress.Any, 12345);
@lacti
lacti / SyncSerializingTranscoderTest.java
Created December 8, 2017 10:11
Test for compatibility between JDK and FST serializer.
package me.line.music.support.cache.spring.providers.arcus;
import static org.junit.Assert.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
@lacti
lacti / hello_world.cc
Created November 13, 2017 14:53
print "hello world" using cppscript.
#!/usr/bin/env cppscript
std::cout << "hello world! << std::endl;
{
"query": {
"function_score": {
"query": {
"bool": {
"must": [{
"multi_match": {
"query": "구현",
"type": "best_fields",
"fuzziness": "0",
{
"query": {
"function_score": {
"query": {
"multi_match": {
"query": "c++",
"type": "best_fields",
"fuzziness": "auto",
"analyzer": "sj_analyzer",
"fields": ["title^1", "article^0.5", "tag^0.3"],
{
"query":{
"match" : {
"article": {
"query": "reflection",
"analyzer": "sj_analyzer"
}
}
}
}
{
"properties": {
"title": {
"type": "text",
"analyzer": "sj_analyzer"
},
"article": {
"type": "text",
"analyzer": "sj_analyzer"
},
{
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"sj_analyzer": {
"type": "custom",
"tokenizer": "sj_tokenizer",
"filter": [
"lowercase",
from gensim.models import Word2Vec
from sklearn.cluster import KMeans
from flask import Flask, jsonify, request
import numpy
default_step_size=20
default_min_similarity=0.4
default_search_depth=1
app = Flask(__name__)