Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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]]
package bus;
import com.google.gson.Gson;
public class Json {
private static class Announce {
private String Caption;
private String Text;
private long CreatedAt;
package main
import (
"encoding/csv"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
#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--) {
package main
import "sync"
type SingleCounter struct {
count int
}
var counter *SingleCounter
#include <stdio.h>
int main() {
char a = 255;
unsigned char b = 255;
printf("%d %d\n", a, b);
printf("%u %u\n", a, b);
}
package main
type A struct {
x int
y int
}
func (a *A) Print() {
println(a.x, a.y)
}
package main
import (
"encoding/json"
"errors"
"log"
"net/http"
"sync"
"time"
)
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";
def isSame(a, b):
return a==b
last = None
def f(sum, b):
global last
first = b[0]
if isSame(last, first):
sum[-1].extend(b[1:])
else: