Skip to content

Instantly share code, notes, and snippets.

nida-001

Block or report user

Report or block nida-001

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nida-001
nida-001 / marshalljson.php
Created Jul 4, 2017
標準入力のJSONをDynamoDB JSONにMarshallする
View marshalljson.php
<?php
require 'vendor/autoload.php';
use Aws\DynamoDb\Marshaler;
$json = "";
while ( ! feof(STDIN) ) {
$line = trim(fgets(STDIN));
$json .= $line;
}
@nida-001
nida-001 / index.html
Created Jul 1, 2017
AMP loginを試そうとしたときの残骸
View index.html
<!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>
@nida-001
nida-001 / gist:6609842
Created Sep 18, 2013
CAS命令使用版並列奇偶転置ソート
View gist:6609842
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 {
@nida-001
nida-001 / gist:6609391
Created Sep 18, 2013
並列奇偶転置ソートを試験的に作ってみた
View gist:6609391
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 {
View gist:6289761
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);
}
}
View gist:5743811
package main
import (
"fmt"
"sort"
)
func main() {
numbers := []int{1, 2, 3}
fmt.Printf("%v\n", encrypt(numbers))
@nida-001
nida-001 / gist:5743719
Created Jun 9, 2013
みんなが楽しいパーティー
View gist:5743719
package main
import (
"math"
)
func main() {
first := []string {"f", "g", "s", "f"}
second := []string {"h", "f", "f", "b"}
println(bestInvitation(first, second))
@nida-001
nida-001 / gist:5733885
Created Jun 8, 2013
「最強最速アルゴリズマー」のキウイジュースの問題をGoで写経してみた
View gist:5733885
package main
import (
"fmt"
)
func main() {
capacities := []int{20, 20}
bottles := []int{5,8}
fromId := []int{0}
View gist:5620349
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
You can’t perform that action at this time.