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
(ns mdsample.core | |
(:require [clojure.core.reducers :as r]) | |
(:import [java.security MessageDigest] | |
[javax.xml.bind DatatypeConverter] | |
[java.util Arrays])) | |
(def ^MessageDigest digester (MessageDigest/getInstance "MD5")) | |
(defn- hexdigest | |
[^String s] |
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
(ns mdsample.core | |
(:require [clojure.core.reducers :as r] | |
[clojure.core.async :refer [chan >! <!! go close! alts!!]]) | |
(:import [java.security MessageDigest] | |
[javax.xml.bind DatatypeConverter] | |
[java.util Arrays] | |
[java.util Queue] | |
[java.util.concurrent ConcurrentLinkedQueue])) | |
(defn- hexdigest |
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
#!/bin/bash | |
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` |
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 jp.javelindev.snippets; | |
public class Java8Sample { | |
public static void main(String[] args) { | |
Laco laco = new Laco(); | |
SampleClass sample = new SampleClass(); | |
sample.func(laco); //ClassCastException SomeClassはLacoにキャストできません | |
} |
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
/* | |
* Copyright 2011 Tsutomu YANO. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright 2011 Tsutomu YANO. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
object Factorial2 { | |
def fact(n: Int): Int = (1 /: (1 to n)) (_ * _) | |
def main(args: Array[String]) = { | |
val n = if(args.length == 0) 1 else Integer.parseInt(args(0)) | |
1 to n foreach {i => println(i + "! = " + fact(i))} | |
} | |
} |
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
object Factorial { | |
def fact(n: Int): Int = if(n == 0) 1 else n * fact(n - 1) | |
def main(args: Array[String]) = { | |
val n = if(args.length == 0) 1 else Integer.parseInt(args(0)) | |
1 to n foreach {i => println(i + "! = " + fact(i))} | |
} | |
} |
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
public class Factorial { | |
static int fact(int n) { return n == 0 ? 1 : n * fact(n - 1); } | |
public static void main(String[] args) { | |
int n = args.length == 0 ? 1 : Integer.parseInt(args[0]); | |
for(int i = 1; i <= n; i++) System.out.println(i + "! = " + fact(i)); | |
} | |
} |
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.awt.BorderLayout; | |
import javax.swing.JFrame; | |
import javax.swing.JTextArea; | |
import javax.swing.event.DocumentEvent; | |
import javax.swing.event.DocumentListener; | |
import javax.swing.text.DefaultCaret; | |
import javax.swing.SwingUtilities; | |
OlderNewer