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
<?php | |
require 'vendor/autoload.php'; | |
use Aws\DynamoDb\Marshaler; | |
$json = ""; | |
while ( ! feof(STDIN) ) { | |
$line = trim(fgets(STDIN)); | |
$json .= $line; | |
} |
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
<!doctype html> | |
<html amp> | |
<head> | |
<meta charset="utf-8"> | |
<script async src="https://cdn.ampproject.org/v0.js"></script> | |
<!-- | |
Additionally used AMP components must be imported in the header. | |
--> | |
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script> | |
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script> |
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 oddeven; | |
import java.util.Arrays; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class ConcurrentOddEvenSort { | |
public static void main(String[] args) throws InterruptedException, ExecutionException { |
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 oddeven; | |
import java.util.Arrays; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class ConcurrentOddEvenSort { | |
public static void main(String[] args) throws InterruptedException, ExecutionException { |
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
import java.util.concurrent.ConcurrentHashMap; | |
public class ConcurrentHashMultiMap<K, V> { | |
private final ConcurrentHashMap<K, ConcurrentHashMap<V, Boolean>> map = new ConcurrentHashMap<>(); | |
public void put(K key, V value) { | |
map.putIfAbsent(key, new ConcurrentHashMap<V, Boolean>()); | |
map.get(key).put(value, true); | |
} | |
} |
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 ( | |
"fmt" | |
"sort" | |
) | |
func main() { | |
numbers := []int{1, 2, 3} | |
fmt.Printf("%v\n", encrypt(numbers)) |
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 ( | |
"math" | |
) | |
func main() { | |
first := []string {"f", "g", "s", "f"} | |
second := []string {"h", "f", "f", "b"} | |
println(bestInvitation(first, second)) |
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 ( | |
"fmt" | |
) | |
func main() { | |
capacities := []int{20, 20} | |
bottles := []int{5,8} | |
fromId := []int{0} |
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
import qualified System.Time as T | |
type Year = Int | |
type Month = Int | |
type Day = Int | |
-- Ex. $> h 2013 5 21 | |
-- $> Tuesday | |
h :: Year -> Month -> Day -> T.Day | |
h year 1 day = h year 13 day |