This file contains hidden or 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
| from flask import Response, jsonify | |
| import json | |
| from flask_restful import Resource | |
| class Api(Resource): | |
| def post(self): | |
| response = Response( | |
| response=json.dumps(dict(error='err')), |
This file contains hidden or 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 java.util.ArrayList; | |
| import java.util.List; | |
| import org.apache.lucene.search.spell.JaroWinklerDistance; | |
| import org.apache.lucene.search.spell.LevensteinDistance; | |
| import org.apache.lucene.search.spell.NGramDistance; | |
| import org.apache.lucene.search.spell.StringDistance; | |
| public class TestLuceneDistanceImplementations | |
| { | |
| public static void main(String[] args) |
This file contains hidden or 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.ansvia.belajar.lucene | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer | |
| import org.apache.lucene.util.Version | |
| import org.apache.lucene.store.SimpleFSDirectory | |
| import java.io.{FileReader, File} | |
| import org.apache.lucene.document.{Field, Document} | |
| import org.apache.lucene.queryParser.QueryParser |
This file contains hidden or 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.postneo | |
| package index | |
| package test | |
| import org.apache.lucene.analysis.SimpleAnalyzer | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer | |
| import org.apache.lucene.document.{Document, Field} | |
| import org.apache.lucene.index.{IndexWriter, Term} | |
| import org.apache.lucene.search.{IndexSearcher, Query, TermQuery, TopDocs} | |
| import org.apache.lucene.store.RAMDirectory |
This file contains hidden or 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 time | |
| import xgboost as xgb | |
| from sklearn.model_selection import RandomizedSearchCV | |
| x_train, y_train, x_valid, y_valid, x_test, y_test = # load datasets | |
| clf = xgb.XGBClassifier() | |
| param_grid = { |
This file contains hidden or 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
| # coding:utf-8 | |
| from kivy.app import App | |
| from kivy.uix.image import Image | |
| from kivy.clock import Clock | |
| from kivy.graphics.texture import Texture | |
| import cv2 | |
| class KivyCamera(Image): | |
| def __init__(self, capture, fps, **kwargs): |
This file contains hidden or 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
| " Plugins | |
| call plug#begin('~/.vim/plugged') | |
| Plug 'rakr/vim-one' " vim-one color theme | |
| Plug 'scrooloose/nerdtree' " side bar file tree | |
| Plug 'itchyny/lightline.vim' " minmal status bar | |
| Plug 'tpope/vim-fugitive' " allows git commands in vim session | |
| Plug 'airblade/vim-gitgutter' " shows git changes in gutter | |
| Plug 'easymotion/vim-easymotion' " go to any word quickly '\\w', '\\e', '\\b' | |
| Plug 'KKPMW/vim-sendtowindow' " send commands to REPL | |
| Plug 'yuttie/comfortable-motion.vim' " scrolling 'C-d' or 'C-u' |
As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.
- Install the required build-tools (some might already be installed on your system).
This file contains hidden or 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
| { | |
| "emojis": [ | |
| {"emoji": "π©βπ©βπ§βπ§", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
| {"emoji": "π©βπ©βπ§βπ¦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
| {"emoji": "π©βπ©βπ¦βπ¦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
| {"emoji": "π¨βπ©βπ§βπ§", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |
OlderNewer
