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(fibo). | |
| -export([fibnaive/1,fbuenishi/1,fblist/1, fblistuenishi/1]). | |
| % F(0) can be 0 or 1 | |
| fibnaive(0) -> 0; | |
| fibnaive(1) -> 1; | |
| fibnaive(N) -> fibnaive(N - 1) + fibnaive(N - 2). | |
| % by @kuenishi https://twitter.com/kuenishi/status/496684564488531969 |
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
| #!/bin/bash | |
| SET=/usr/sbin/i2cset | |
| AWK=/usr/bin/awk | |
| EXPR=/usr/bin/expr | |
| TR=/usr/bin/tr | |
| disp() { | |
| playing=`/usr/bin/mpc | grep 'playing'` | |
| if [ "$playing" != "" ] | |
| then |
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
| // purge remaining messages | |
| // | |
| System.out.println("purge remaining messages"); | |
| List<Message> msgs = sqs.receiveMessage(receiveMessageRequest).getMessages(); | |
| while (msgs.size() > 0) { | |
| Message ms = msgs.get(0); | |
| String mDeleteH = ms.getReceiptHandle(); | |
| System.out.println("Deleting a message." + ms.getMessageId()); | |
| sqs.deleteMessage(new DeleteMessageRequest(myQueueUrl, mDeleteH)); |
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
| group XML; | |
| empty() ::= << | |
| >> | |
| object(fields) ::= << | |
| <fields; separator="\n"> | |
| >> |
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 jp.gr.jin.OCAO; | |
| import android.app.Activity; | |
| import android.os.Bundle; | |
| import android.hardware.Sensor; | |
| import android.hardware.SensorEvent; | |
| import android.hardware.SensorEventListener; | |
| import android.hardware.SensorManager; | |
| import android.widget.TextView; | |
| import java.util.List; |
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
| ghci> e: test.hs | |
| is_prime :: (Integral a, RealFrac a, Floating a) => a -> Bool | |
| is_prime x | x < 3 = True | |
| | otherwise = not (any (mod0_p x) (candidates x)) | |
| mod0_p :: (Integral a) => a -> a -> Bool | |
| mod0_p x y = (mod x y ) == 0 | |
| candidates :: (Integral t, Floating a, RealFrac a) => a -> [t] |
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
| Intel Atom D510 M.B. | |
| 4CPU found in /var/log/dmesg | |
| # ./Run | |
| make all | |
| make[1]: Entering directory `/usr/local/src/unixbench-5.1.2' | |
| Checking distribution of files | |
| ./pgms exists | |
| ./src exists | |
| ./testdir exists |
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
| Intel Atom 510D base Xen3 guest CentOS | |
| # ./Run | |
| make all | |
| make[1]: Entering directory `/usr/local/src/unixbench-5.1.2' | |
| Checking distribution of files | |
| ./pgms exists | |
| ./src exists | |
| ./testdir exists | |
| ./tmp exists |