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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<packaging>war</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<groupId>br.com.tagview</groupId> | |
<artifactId>taskapp</artifactId> |
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
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm | |
function map() { | |
emit(1, // Or put a GROUP BY key here | |
{sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count:1, | |
diff: 0, // M2,n: sum((val-mean)^2) | |
}); |
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
from time import time | |
# Decoratoring with a class | |
class Benchmark(object): | |
def __init__(self, function): | |
self.function = function | |
def __call__(self, *args, **kwargs): | |
t1 = time() | |
result = self.function(*args, **kwargs) |
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
$('#lightbox_footer .right button').removeAttr('disabled').trigger('click'); |
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
javascript:void((function(){j=document.createElement("SCRIPT");j.src="http://code.jquery.com/jquery-latest.pack.js";document.getElementsByTagName("HEAD")[0].appendChild(j);})()) |
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
# monkey-patch irb. see: http://jameskilton.com/2009/04/02/embedding-irb-into-your-ruby-application/ | |
# | |
require 'irb' | |
module IRB # :nodoc: | |
def self.start_session(binding) | |
unless @__initialized | |
args = ARGV | |
ARGV.replace(ARGV.dup) | |
IRB.setup(nil) |
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
(arc4random() % 8) |
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
/* So I never need to look for it anymore... :) */ | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
aTextField.delegate = self; | |
} | |
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField |