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
#include <iostream> | |
#include <wiringPi/wiringPi.h> | |
int main() | |
{ | |
if (wiringPiSetupGpio() == -1) { | |
std::cout << "cannot setup gpio." << std::endl; | |
return 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
using Google.Apis.Auth.OAuth2; | |
using Google.Apis.CloudIot.v1; | |
using Google.Apis.Services; | |
using System; | |
using System.Threading.Tasks; | |
namespace Sample | |
{ | |
class Program | |
{ |
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
let func1 () = | |
async { | |
printfn "func1 start" | |
Async.Sleep 3000 |> Async.RunSynchronously | |
printfn "func1 end" | |
} | |
let func2 () = | |
async { | |
printfn "func2 start" |
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
open System | |
open System.Collections.Generic | |
open System.Numerics | |
// マヨイドーロ問題を解く。 | |
// http://www.hyuki.com/codeiq/#c19 | |
// | |
// Pが大きな数になるのでBigIntegerを使う。 | |
[<EntryPoint>] | |
let main _ = |
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
let replaceAmpersandHyphenToAmpersand (input : byte list) = | |
let replacedTail = | |
input | |
|> List.windowed 2 | |
|> List.choose (fun chunk -> match chunk with | |
// 0x26 : '&', 0x2d : '-' | |
| [a; b] when a = (byte)0x26 && b = (byte)0x2d -> None | |
| [_; b] -> Some(b) | |
| _ -> failwith "invalid chunk") | |
input.Head :: replacedTail |
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
# coding: utf-8 | |
require 'fileutils' | |
### 定数 ### | |
COMPILER = "g++" | |
CPPFLAGS = %w{} | |
LDFLAGS = %w{} | |
INC_DIRS = [] | |
LIB_DIRS = [] | |
TARGET = "app" |