-
Joe Celko's SQL for Smarties, 5th Edition
Chapter 32.1 - Finding Subregions of Size (n)
-
Finding the maximum contiguous sum in an array
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
| module Sample exposing (..) | |
| import Html exposing (Html, input, button, div, text, program) | |
| import Html.Events exposing (onInput, onClick) | |
| import Http exposing (post, jsonBody) | |
| import Json.Encode as Encode exposing (..) | |
| import Json.Decode as Decode exposing (Decoder, int, string) | |
| import Json.Decode.Pipeline exposing (decode, required) | |
| import Debug exposing (log) |
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
| sudo openssl req -x509 -nodes \ | |
| -days 365 \ | |
| -newkey rsa:2048 \ | |
| -keyout /etc/ssl/mydomain_com.key \ | |
| -out /etc/ssl/mydomain_com.crt \ | |
| -subj '/CN=mydomain.com' |
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
| alias j10="export JAVA_HOME=`/usr/libexec/java_home -v 10`; java -version" | |
| alias j9="export JAVA_HOME=`/usr/libexec/java_home -v 9`; java -version" | |
| alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version" | |
| alias j7="export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; java -version" |
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 io.vertx.core.Vertx | |
| import io.vertx.core.json.Json | |
| import io.vertx.ext.web.Router | |
| data class Person( | |
| val name: String, | |
| val nationality: String | |
| ) { | |
| } |
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
| public class BinaryTreeNode<T> { | |
| private T value; | |
| private BinaryTreeNode<T> leftChild; | |
| private BinaryTreeNode<T> rightChild; | |
| public T getValue() { | |
| return value; | |
| } |
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 main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "time" | |
| ) | |
| func Quicksort(elements []int, low int, high int) { | |
| if (high > low) { |