- 1.1 What is Go?
- 1.2 Noteworthy Aspects of Go
- 1.2.1 Multiple Return Values
- 1.2.2 A Modern Standard Library
- 1.2.3 Concurrency with goroutines and channels
- 1.2.4 Go the toolchain, more than a language
- 1.3 Go in the vast language landscape
- 1.3.1 C and Go
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
from loc.models.index import get_solr_connection | |
from loc.models.index import solr_safe_value | |
import json | |
conn = get_solr_connection() | |
my_fq = ["original-format:newspaper", "hassegments:true", 'partof_title:"yellowstone monitor. \(glendive, mont.\) 1905-1928"', 'date:[1911-01-01T00:00:00Z TO 1912-12-31T00:00:00Z]'] | |
res = conn.raw_query(fq=my_fq, wt='json', rows=1000) | |
c = json.loads(res)['response']['docs'] | |
print len(c) |
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
<link href="https://cdn.rawgit.com/dapangmao/a1813e270dec8d1f3383fca7ed0a3e9f/raw/fc2edcd37c839a84fe8ac576ec62b9da5f183870/bs.css" rel="stylesheet"> | |
<script src="https://cdn.rawgit.com/Paul-DS/bootstrap-year-calendar/master/js/bootstrap-year-calendar.js"></script> | |
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/Paul-DS/bootstrap-year-calendar/master/css/bootstrap-year-calendar.css"> | |
<div class="bootstrap" id="calendar" data-provide="calendar" style="margin-bottom: 30px"></div> | |
<script> | |
$(function () { |
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
.bootstrap { | |
/*! | |
* Bootstrap v3.3.7 (http://getbootstrap.com) | |
* Copyright 2011-2016 Twitter, Inc. | |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |
*/ | |
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ | |
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ | |
} | |
.bootstrap html { |
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 main | |
import ( | |
"io/ioutil" | |
"path/filepath" | |
"os" | |
"fmt" | |
"sync" | |
"flag" | |
"time" |
Combining Docker and Elasticsearch together will make many things in life easier. Depending on the scales, there are three scenarios for an implementation of Elasticsearch use case -
-
- Single ES instance and single machine
-
- Multiple ES instances and single machine
-
- Multiple ES instances and multiple machines
Docker has three mechanisms corresponding to each of the scenarios above.
-
- Docker commands
-
- Docker Compose
postgret的select查询规则如下所示,使用get方式提交请求:
http://localhost:3000/stock_info?select=close,tradingdate&tradingdate=lt.20160429&order=close.desc&limit=15 url中包含表名?select=字段名1,字段名2&过滤条件字段=比较运算符.值&order=排序字段.正序&limit=数量
其中比较运算符包括:
abbreviation meaning
eq equals
gte greater than or equal
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 OR REPLACE FUNCTION public.login(email text, pass text) | |
RETURNS basic_auth.jwt_token | |
LANGUAGE plpgsql | |
AS $function$ | |
declare | |
_role name; | |
result basic_auth.jwt_token; | |
begin | |
-- check email and password | |
select basic_auth.user_role(email, pass) into _role; |
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
-- https://postgrest.com/en/v0.4/auth.html#sql-user-management | |
create schema if not exists basic_auth; | |
create table if not exists | |
basic_auth.users ( | |
email text primary key check ( email ~* '^.+@.+\..+$' ), | |
pass text not null check (length(pass) < 512), | |
role name not null check (length(role) < 512) |
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
set nocompatible " required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
Plugin 'tmhedberg/SimpylFold' | |
Plugin 'vim-scripts/indentpython.vim' |
NewerOlder