twitterからながれてきたこの話題。昔のCコンパイラは、if文の条件節で代入を書いても文句を言わなかったので、このようなコードに何の警告も出なかった。
#include<stdio.h>
int main() {
int x = 0;
/* おそらく意図と違う。 x == 1 と書くべきであった
#!/bin/bash | |
# | |
# The MIT License (MIT) | |
# Copyright (c) 2013 mironal | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, |
--一回目 | |
JSON parse error : SyntaxError: Unexpected end of input | |
/home/sh4869/heimcontrol.js/node_modules/arduinode/arduinode.js:134 | |
throw e; | |
^ | |
SyntaxError: Unexpected end of input | |
at Object.parse (native) | |
at SerialPort.<anonymous> (/home/sh4869/heimcontrol.js/node_modules/arduinode/arduinode.js:118:27) |
func debounce( delay:NSTimeInterval, #queue:dispatch_queue_t, action: (()->()) ) -> ()->() { | |
var lastFireTime:dispatch_time_t = 0 | |
let dispatchDelay = Int64(delay * Double(NSEC_PER_SEC)) | |
return { | |
lastFireTime = dispatch_time(DISPATCH_TIME_NOW,0) | |
dispatch_after( | |
dispatch_time( | |
DISPATCH_TIME_NOW, |
#import <Foundation/Foundation.h> | |
@interface Node : NSObject <NSCopying, NSMutableCopying> | |
@property (nonatomic, weak, readonly) Node *parent; | |
@property (nonatomic, strong, readonly) Node *left; | |
@property (nonatomic, strong, readonly) Node *right; | |
- (instancetype)initWithParent:(Node *)parent left:(Node *)left right:(Node *)right; | |
@end | |
@interface MutableNode : Node |
// | |
// simd+ext.swift | |
// | |
// Created by Kaz Yoshikawa on 11/6/15. | |
// | |
// | |
import Foundation | |
import simd | |
import GLKit |
これを読んでる。
この本の中で「トランザクティブ・メモリー」という話がでてきた。概要は以下のコラムに書いてる。
#!/bin/sh | |
# for Mac OS X | |
# required sips command | |
cd `dirname $0` | |
outdir="icon.iconset" | |
mkdir -p $outdir | |
if [ -e "[email protected]" ]; then |