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
string clientID = "<Your ClientID>"; | |
string clientSecret = "<Your Client Secret>"; | |
String strTranslatorAccessURI = | |
"https://datamarket.accesscontrol.windows.net/v2/OAuth2-13"; | |
String strRequestDetails = | |
string.Format("grant_type=client_credentials&client_id={0}&client_secret={1} &scope=http://api.microsofttranslator.com", HttpUtility.UrlEncode(clientID), | |
HttpUtility.UrlEncode(clientSecret)); | |
System.Net.WebRequest webRequest = System.Net.WebRequest.Create(strTranslatorAccessURI); | |
webRequest.ContentType = "application/x-www-form-urlencoded"; |
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 ( | |
"encoding/json" | |
"errors" | |
"log" | |
"net/http" | |
"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
package main | |
type A struct { | |
x int | |
y int | |
} | |
func (a *A) Print() { | |
println(a.x, a.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
#include <stdio.h> | |
int main() { | |
char a = 255; | |
unsigned char b = 255; | |
printf("%d %d\n", a, b); | |
printf("%u %u\n", 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
package main | |
import "sync" | |
type SingleCounter struct { | |
count int | |
} | |
var counter *SingleCounter |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() { | |
char p[5]; | |
int i; | |
scanf("%s", p); | |
printf("%d\n", (int)strlen(p)); | |
for (i=strlen(p)-1;i>=0;i--) { |
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 ( | |
"encoding/csv" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/http/cookiejar" |
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 bus; | |
import com.google.gson.Gson; | |
public class Json { | |
private static class Announce { | |
private String Caption; | |
private String Text; | |
private long CreatedAt; |
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 time | |
def test(): | |
key = list(map(str, range(10000000))) | |
t = time.time() | |
d=dict() | |
for i in xrange(10000000): | |
d[key[i]] = i | |
for i in xrange(10000000): | |
del d[key[i]] |
NewerOlder