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" | |
var sum = 0 | |
func main() { | |
for e := 0; e < 30; e++ { | |
sum = 0 | |
var x[]int | |
for i := 0; i < 1000000; i++ { | |
x = append(x, 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import sys | |
import logging | |
import datetime | |
import requests | |
import BeautifulSoup | |
from requests.adapters import HTTPAdapter |
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 com.dong.java.test; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class CheckSQL { | |
private static String[] DBNAMES={""}; | |
private static String[] keywords={"alter ","create ", "delete ", "do ", "drop ", "handler ", "insert ", "load data infile ", "rename ", |
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 org.xml.sax.Attributes; | |
import org.xml.sax.SAXException; | |
import org.xml.sax.helpers.DefaultHandler; | |
public class SAXParserXmlUtil extends DefaultHandler { | |
private StringBuffer node=new StringBuffer(); | |
private StringBuffer nodeValue=new StringBuffer(); | |
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 com.tdoly.java.test.jsonlib; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import com.tdoly.java.test.beans.User; | |
import com.tdoly.java.test.beans.User.Gender; |
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
def failTable(pattern): | |
# Create the resulting table, which for length zero is None. | |
result = [None] | |
# Iterate across the rest of the characters, filling in the values for the | |
# rest of the table. | |
for i in range(0, len(pattern)): | |
# Keep track of the size of the subproblem we're dealing with, which | |
# starts off using the first i characters of the string. | |
j = 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
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.io.*" import="java.lang.*" import=" javax.servlet.ServletOutputStream" errorPage="" %> | |
<% | |
request.setCharacterEncoding("gb2312"); | |
String filename=request.getParameter("filename"); | |
String filepath=request.getParameter("filepath"); | |
filename=java.net.URLDecoder.decode(filename); | |
filepath=java.net.URLDecoder.decode(filepath); | |
response.setContentType("APPLICATION/OCTET-STREAM"); | |
response.setHeader("Content-Disposition","attachment;filename=\"" + new String(filename.getBytes("gb2312"),"iso8859-1") + "\""); | |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
''' | |
Created on 2013-8-1 | |
@author: mingdong.li | |
use thread |
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
#!/usr/bin/env python | |
# -*- #coding:utf-8 | |
''' | |
Created on 2013-9-10 | |
@author: mingdong.li | |
''' | |
def sort(arr, left, right): | |
''' |
NewerOlder