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" | |
func Merge(ldata []int, rdata []int) (result []int) { | |
result = make([]int, len(ldata) + len(rdata)) | |
lidx, ridx := 0, 0 | |
for i:=0;i<cap(result);i++ { | |
switch { |
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" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() uint64 { | |
var x, y, z uint64 = 0, 1, 0 | |
return func() uint64 { | |
z, x, y = x, y, x+y |
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
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<div id="fb-root"></div> | |
<fb:login-button width="200" max-rows="1" | |
scope="user_likes, friends_likes, user_groups, friends_groups, read_stream, read_friendlists, user_activities, offline_access, publish_stream"> |
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
<fb:login-button render-in-iframe="true" width="200" max-rows="1" | |
scope="user_likes, friends_likes, user_groups, friends_groups, read_stream, read_friendlists, user_activities, offline_access, publish_stream"> | |
</fb:login-button> |
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
<fb:login-button show-faces="true" width="200" max-rows="1" | |
scope="user_likes, friends_likes, user_groups, friends_groups, read_stream, read_friendlists, user_activities, offline_access, publish_stream"> | |
</fb:login-button> |
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
<fb:login-button show-faces="false" width="200" max-rows="1" | |
scope="user_likes, friends_likes, user_groups, friends_groups, read_stream, read_friendlists, user_activities, offline_access, publish_stream"> | |
</fb:login-button> |
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
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<div id="fb-root"></div> | |
<fb:login-button width="200" max-rows="1" | |
scope="user_likes, friends_likes, user_groups, friends_groups, read_stream, read_friendlists, user_activities, offline_access, publish_stream"> | |
</fb:login-button> |
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 com.thrift.gen.*; | |
import org.apache.thrift.TException; | |
import org.apache.thrift.protocol.TBinaryProtocol; | |
import org.apache.thrift.protocol.TProtocol; | |
import org.apache.thrift.transport.TSocket; | |
import org.apache.thrift.transport.TTransport; | |
import org.apache.thrift.transport.TFramedTransport; | |
import org.apache.thrift.transport.TTransportException; |
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 thrift = require('thrift'); | |
var Computer = require('./gen-nodejs/Computer.js'), | |
ttypes = require('./gen-nodejs/computer_types.js'); | |
var server = thrift.createServer(Computer, { | |
add: function(a, b, callback) { | |
console.log("function called:", a+b); | |
callback(a+b); | |
}, |
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
namespace java com.thrift.gen | |
service Computer { | |
i64 add(1: i64 a, 2: i64 b), | |
} |