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
# Copyright (c) 2013, Michael D. Stemle, Jr. | |
# This module may be distributed under the same terms as Perl itself. | |
package LSB; | |
our $VERSION = "1.0.0"; | |
use Fcntl qw/:DEFAULT/; | |
use IO::File; | |
use Readonly; |
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
obsS=WScript.CreateObject("WScript.Shell") | |
obsS.Run("control mouse", 5) | |
WScript.sleep(1000) | |
obsS.AppActivate("Mouse") | |
WScript.Sleep(300) | |
obsS.Sendkeys(" ") | |
WScript.Sleep(123) | |
obsS.SendkEys("{Enter}") |
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 | |
import sys, getopt, csv, pprint | |
from pymongo import MongoClient | |
global_mongo = None | |
global_db = None | |
global_coll = None | |
def usage(msg): |
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
db.foo.find().forEach(printjson); | |
db.foo.mapReduce( | |
function () { | |
emit (this["First Name"].toLowerCase().split('')[0], 1); | |
}, | |
function (key,value) { | |
return Array.sum(value); | |
}, | |
{ |
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
#define APPLESCRIPT_MOUNT_SCRIPT(X) [\ | |
NSString \ | |
stringWithFormat:@"tell application \"Finder\" to mount volume \"%@\"",\ | |
X\ | |
] | |
- (BOOL) mount { | |
NSAppleScript *ascript = [[NSAppleScript alloc] | |
initWithSource:APPLESCRIPT_MOUNT_SCRIPT(originalPath)]; | |
NSDictionary *errorInfo = nil; |
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 perl | |
use strict;use warnings; | |
use threads; | |
sub number_crunch { | |
my ($sub, @set) = @_; | |
my $product = 0; | |
my $n = 0; |
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 perl | |
use strict;use warnings; | |
use Test::More tests => 5; | |
use Data::Dumper; | |
sub quicksort { | |
my (@list) = @_; | |
my $len = scalar(@list); |
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 | |
import sys | |
import threading | |
def process_number(func,input_list): | |
x = 0 | |
n = 0 | |
for one in input_list: | |
n = n + 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 | |
import unittest | |
class Node: | |
def __init__(self, key, data): | |
self.key = key | |
self.data = data | |
self.left = None | |
self.right = None |
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 DestroyDetector; | |
sub new { | |
my ($pkg, $val) = @_; | |
my $self = {value=>$val}; | |
return bless $self, $pkg; | |
} | |
sub value { | |
my ($self) = @_; | |
return $self->{value}; |