This file contains hidden or 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
| find /tmp/spring/org/springframework/ -type f -name "*.java" |xargs -L1 basename|sed 's/\.java//g' | {... regex buddy split on (?=(?:(?:[A-Z][a-z]+)|[\n\r])) } | sed 's/[\s]+/\n/g'|uniq -c /tmp/t3| sort -nr -k 1,7 | |
| 281 Bean | |
| 200 Factory | |
| 175 Exception | |
| 95 Abstract | |
| 94 Source | |
| 82 Transaction | |
| 77 Definition | |
| 73 Context |
This file contains hidden or 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 scraperwiki | |
| import urllib | |
| import tempfile | |
| import os | |
| from xml import * | |
| import re | |
| def pdftoxml(pdfdata): | |
| pdffout = tempfile.NamedTemporaryFile(suffix='.pdf') | |
| pdffout.write(pdfdata) | |
| pdffout.flush() |
This file contains hidden or 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 | |
| from hashlib import sha1 | |
| class HMAC: | |
| def __init__(self, key, msg): | |
| self.outer = sha1() | |
| self.inner = sha1() | |
| self.digest_size = self.inner.digest_size | |
| blocksize = 64 | |
| if len(key) > blocksize: | |
| key = sha1(key).digest() |
This file contains hidden or 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
| <?php | |
| define('BLOCKSIZE', 64); | |
| function hex2bin($v) | |
| { | |
| return pack("H*" , $v); | |
| } | |
| function sha1bin($text) | |
| { |
This file contains hidden or 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
| class TestHMAC { | |
| ... | |
| private String calculateMAC(byte[] inputBytes, String password) throws NoSuchAlgorithmException, InvalidKeyException { | |
| SecretKeySpec signingKey = new SecretKeySpec(password.getBytes(), HMAC_SHA1_ALGORITHM); | |
| Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); | |
| mac.init(signingKey); | |
| byte[] rawHmac = mac.doFinal(inputBytes); | |
| return new String(Hex.encodeHex(rawHmac, true)); | |
| } |
This file contains hidden or 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
| irb(main):015:0> (a,b)="c/d".split("/") | |
| => ["c", "d"] | |
| (a?,b?)="c/d".split("/") | |
| SyntaxError: (irb):16: syntax error, unexpected ',', expecting ')' | |
| (a?,b?)="c/d".split("/") | |
| ^ | |
| from /usr/bin/irb:12:in `<main>' |
This file contains hidden or 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
| sudo gem install linecache19 -- --with-ruby-include=/usr/include/ruby-1.9.1/ |
This file contains hidden or 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 re | |
| import sys | |
| import time | |
| __author__ = 'altmind' | |
| import MySQLdb | |
| conn = MySQLdb.connect(host="localhost", | |
| user="root", |
This file contains hidden or 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
| SELECT COUNT(*), INFO_PROCESSED FROM PROF WHERE PROCESSED=1 AND TIME>'2012-14-12 14:40:00' GROUP BY INFO_PROCESSED ORDER BY COUNT(*) DESC INTO OUTFILE '/tmp/prof2.csv' FIELDS TERMINATED BY '|'; |
This file contains hidden or 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
| CREATE TABLE test.`PROF` ( | |
| `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , | |
| `COMMAND` VARCHAR( 250 ) NOT NULL , | |
| `HOST` VARCHAR( 250 ) NOT NULL , | |
| `STATE` VARCHAR( 250 ) NOT NULL , | |
| `INFO` TEXT NOT NULL , | |
| `INFO_PROCESSED` TEXT NULL , | |
| `TIME` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , | |
| `PROCESSED` INT NOT NULL DEFAULT '0', | |
| INDEX ( `COMMAND` , `HOST` , `TIME` , `PROCESSED` ) |
OlderNewer