title: 'Leetcode Solution in Java' layout: post date: '2017-01-20 20:25' tag:
- Leetcode
- Java
- Algorithms
- Data Structure
- Question
| { | |
| "template": "logstash-*", | |
| "settings" : { | |
| "number_of_shards" : 1, | |
| "number_of_replicas" : 0, | |
| "index" : { | |
| "query" : { "default_field" : "@message" }, | |
| "store" : { "compress" : { "stored" : true, "tv": true } } | |
| } | |
| }, |
| { | |
| "template" : "logstash-*", | |
| "settings" : { | |
| "index.refresh_interval" : "15s" | |
| }, | |
| "mappings" : { | |
| "_default_" : { | |
| "_all" : {"enabled" : true}, | |
| "dynamic_templates" : [ { | |
| "string_fields" : { |
| input { | |
| beats { | |
| port => "5044" | |
| } | |
| } | |
| filter { | |
| json { | |
| source => "message" | |
| } | |
| ruby { |
| { | |
| "template" : "sttx-*", | |
| "settings" : { | |
| "index" : { | |
| "refresh_interval" : "5s" | |
| } | |
| }, | |
| "mappings" : { | |
| "_default_" : { | |
| "dynamic_templates" : [ |
| require 'json' | |
| def parse_array obj, top, event | |
| if obj.is_a? Array | |
| obj.each_with_index {|oo, ii| | |
| parse_json_array(oo, ii, top, event) | |
| } | |
| end | |
| end |
| # Run me with: | |
| # | |
| # $ nginx -p /path/to/this/file/ -c nginx.conf | |
| # | |
| # All requests are then routed to authenticated user's index, so | |
| # | |
| # GET http://user:password@localhost:8080/_search?q=* | |
| # | |
| # is rewritten to: | |
| # |
| A | |
| ABORT | |
| ABS | |
| ABSOLUTE | |
| ACCESS | |
| ACTION | |
| ADA | |
| ADD | |
| ADMIN | |
| AFTER |
title: 'Leetcode Solution in Java' layout: post date: '2017-01-20 20:25' tag:
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)