How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
| <input type='text' id='input' /> | |
| In software, a stack overflow occurs when too much memory is used on the call stack. The call stack contains a limited amount of memory, often determined at the start of the program. The size of the call stack depends on many factors, including the programming language, machine architecture, multi-threading, and amount of available memory. When too much memory is used on the call stack the stack is said to overflow, typically resulting in a program crash.[1] This class of software bug is usually caused by one of two types of programming errors.[2] |
| /** | |
| git clone https://github.com/twitter/scalding.git | |
| cd scalding | |
| ./sbt scalding-repl/console | |
| */ | |
| import scala.io.Source | |
| val alice = Source.fromURL("http://www.gutenberg.org/files/11/11.txt").getLines | |
| // Add the line numbers, which we might want later | |
| val aliceLineNum = alice.zipWithIndex.toList |
| import java.util.* | |
| /** | |
| Graph | |
| 9 7 | |
| 0 1 | |
| 1 2 | |
| 1 3 | |
| 2 3 | |
| 3 4 |
| /** | |
| Graph | |
| 9 7 | |
| 0 1 | |
| 1 2 | |
| 1 3 | |
| 2 3 | |
| 3 4 | |
| 6 7 | |
| 6 8 |
| "100001", "Howard, J", "Saving", 2.5, 5000 | |
| "100002", "Brown, C", "Cheque", 2.5, 6400 | |
| "100003", "Smith, W", "Saving", 1.5, 400 | |
| "100004", "Frank, N", "Saving", 2.5, 1000 | |
| "100005", "Munch, R", "Cheque", 2.75, 6200 | |
| "100006", "Sidney, M", "Saving", 3.5, 12800 | |
| "100007", "Gao, F", "Saving", 2.0, 5000 | |
| "100008", "Long, P", "Cheque", 3.0, 7300 |
| def find_string(text, word) | |
| (0..text.size-word.size).each do |i| | |
| { i, text[i..i+word.size-1] } | |
| if text[i..i+word.size-1] == word | |
| return i | |
| end | |
| end | |
| nil | |
| end |
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
| # Add this to your boot.rb before Padrino.load! | |
| # and add: gem 'pry' | |
| # to your Gemfile and run bundle to install. | |
| begin | |
| require 'pry' | |
| $VERBOSE = nil | |
| IRB = Pry | |
| $VERBOSE = false | |
| rescue LoadError |
| // A Unit test template for Tape | |
| // See 5 Questions every unit test must answer: | |
| // https://medium.com/javascript-scene/what-every-unit-test-needs-f6cd34d9836d | |
| import test from 'tape'; | |
| test('What are you testing?', assert => { | |
| const msg = 'what should it do?' | |
| const actual = 'what was the output?'; |