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
<#@ template language="C#" debug="true" hostspecific="true" #> | |
<#@ output extension=".d.ts" #> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="Microsoft.VisualStudio.Shell.Interop.8.0" #> | |
<#@ assembly name="EnvDTE" #> | |
<#@ assembly name="EnvDTE80" #> | |
<#@ import namespace="System.Collections.Generic" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.Text" #> | |
<#@ import namespace="EnvDTE" #> |
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
Array.prototype.mergeSort=function(){ | |
var merge=function(left,right){ | |
var final=[]; | |
while (left.length && right.length) { | |
final.push(left[0] <= right[0] ? left.shift() : right.shift() ); | |
} | |
return final.concat(left.concat(right)); | |
} | |
// 递归结束 | |
if (this.length < 2) { |
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
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_hd_intermediate_swift.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_sd_intermediate_swift.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_intermediate_swift.pdf?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_hd_advanced_graphics_and_animation_performance.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_sd_advanced_graphics_and_animation_performance.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_advanced_graphics_and_animation_performance.pdf?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_sd.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/236xxwk3fv82sx2/236/236_hd_building_interruptible_and_responsive_interactions.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2 |
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
# Examples from http://andreypopp.com/posts/2012-10-30-callbacks-to-promises.html | |
# using IcedCoffeeScript http://maxtaco.github.com/coffee-script/ : | |
search = (engine, q, cb) -> | |
$.ajax(url: engine, success: cb) | |
await | |
search 'google', 'js', defer(googleSearched) | |
search 'bing', 'js', defer(bingSearched) | |
processResults(bingSearched, googleSearched) | |
await |
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
<? | |
require("redis.php"); | |
require("json.php"); | |
$term = $_GET['term']; | |
$r = new Redis("127.0.0.1","6379"); | |
$r->connect(); | |
$items = $r->zrangebylex("kernel","[$term","[$term\xff",Array("LIMIT","0","10")); |
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 org.rivendell.collections; | |
import java.lang.reflect.Array; | |
public class SkipListNode<T extends Comparable<? super T>> { | |
private final T value; | |
private final SkipListNode<T>[] next; | |
/** | |
* this is to provide index based access |
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 ( | |
"flag" | |
"fmt" | |
"log" | |
"net/rpc" | |
"sync" | |
"time" | |
) |
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
# Fibonacci numbers WITH memoization. | |
# Initialize the memoization hash. | |
@scratchpad = {} | |
@max_fibo_size = 1_000_000_000_000 | |
# Calculate the nth Fibonacci number, f(n). | |
def fibo (n) | |
val = if n <= 1 | |
n |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
</body> |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |