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
(heap "積み重ねた物") | |
(exploration "探査、探検") | |
(errand "使いっ走り") | |
(defect "欠点") | |
(allowance "割当量") |
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
(library (skip graph) | |
(export node-search node-range-search node-insert! node-delete! | |
make-node node-key node-value | |
node->list node->key-list | |
max-level membership-counter | |
;; exported for test | |
buddy-op | |
link-op) | |
(import (rnrs) | |
(mosh) |
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 ([server (make-server-socket "4649")]) | |
(display "Echo server: START\n") | |
(let loop ([conn (socket-accept server)]) | |
(let ([pid (spawn | |
(lambda () | |
(display "child start\n") | |
(receive | |
[('connection conn) | |
(let loop ([data (socket-recv conn 100)]) | |
(cond |
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 (rnrs) | |
(mosh) | |
(mosh socket)) | |
(define (irc-bot server port nick channel) | |
(let ([socket (make-client-socket server port)]) | |
(define (send text) | |
(assert (<= (string-length text) 510)) | |
(socket-send socket (string->utf8 (string-append text "\r\n")))) | |
(define (recv) |
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 ([socket (make-client-socket "www.monaos.org" "http" | |
(os-constant 'AF_INET) | |
(os-constant 'SOCK_STREAM) | |
0 | |
0)]) | |
(socket-send socket (string->utf8 "GET /index.html HTTP/1.0\r\nhost: www.monaos.org\r\n\r\n") 0) | |
(display (utf8->string (socket-recv socket 9000 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 (rnrs) | |
(mosh) | |
(srfi :64)) | |
(define-record-type failure | |
(fields | |
(immutable expr) | |
(immutable expected) | |
(immutable actual))) |
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
extension UIColor { | |
convenience init(hex: Int, alpha: CGFloat = 1.0) { | |
let red = CGFloat((hex & 0xFF0000) >> 16) / 255.0 | |
let green = CGFloat((hex & 0xFF00) >> 8) / 255.0 | |
let blue = CGFloat((hex & 0xFF)) / 255.0 | |
self.init(red:red, green:green, blue:blue, alpha:alpha) | |
} | |
} | |
@IBDesignable class AvatarView : UIImageView { |
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 <Foundation/Foundation.h> | |
@interface Compatible : NSObject | |
+ (void)registerPush:(UIApplication *)application; | |
@end |
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
class func createFromJson(roomObj: Dictionary<String, AnyObject>) -> Room! { | |
if let id = roomObj["id"]? as? Int { | |
if let name = roomObj["name"]? as? String { | |
if let userObj = roomObj["user"]? as? Dictionary<String, AnyObject> { | |
if let user = User.createGuestFromJson(userObj) { | |
if let messageCount = roomObj["message_count"]? as? Int { | |
if let isRemoved = roomObj["removed"]? as? Bool { | |
if let dateString = roomObj["created_at"]? as? String { | |
let formatter = NSDateFormatter() |
NewerOlder