weibo = [...] # 所有转发的微博用户
email = [...] # 所有 v2ex 留帖的用户
all = weibo + email
# 随机选两个,打印
i = rand(all.length)
p all.delete_at(i)
i = rand(all.length)
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
.menu { | |
__layout { display: inline; } | |
__layout-item { display: inline-block; ... } | |
__item { _state_current { font-weight: bold; } } | |
} |
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
var n; // a global counter of how many requests hand been processed | |
var a = [1,2,3,4,5,6,7]; | |
// a handler that increments `n`, and print out each element in a. | |
function countHandler(req,res,next) { | |
// these are new for each request, don't need to protect them. | |
var a,b,c; | |
// an asynchronous loop that print out each element in an array | |
var i = 0; // this loop would break if you move it outside of the countHandler scope. |
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 (c) 1999-2007 Apple Inc. All Rights Reserved. | |
* | |
* @APPLE_LICENSE_HEADER_START@ | |
* | |
* This file contains Original Code and/or Modifications of Original Code | |
* as defined in and that are subject to the Apple Public Source License | |
* Version 2.0 (the 'License'). You may not use this file except in | |
* compliance with the License. Please obtain a copy of the License at | |
* http://www.opensource.apple.com/apsl/ and read it before using this |
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
// | |
// Card.swift | |
// MatchPairs | |
// | |
// Created by Howard Yeh on 2014-09-03. | |
// Copyright (c) 2014 Howard Yeh. All rights reserved. | |
// | |
import UIKit |
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
// Compiler/SourceKit Bug in [6A1052c]: Omit the `[[Int]]` type annotation seems to trigger polynomial/exponential run-time in the type analyzer. | |
// 9 elements takes about a minute to compile on my low-end MBP. | |
private let gameLayouts: [[Int]] = [ | |
[0,0,0,0, | |
0,0,0,0, | |
0,1,1,0, | |
0,0,0,0, | |
0,0,0,0], | |
[0,0,0,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
(* | |
Set xcode window dimension | |
*) | |
set theApp to "Xcode6-Beta6" | |
set width to 1400 | |
set height to 900 |
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 main | |
import ( | |
"fmt" | |
"time" | |
) | |
type foo struct { | |
i int | |
} |