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 pkg_resources | |
from collections import namedtuple | |
from numpy.random import RandomState | |
print pkg_resources.get_distribution("numpy").version | |
class Foo(namedtuple("Foo", "x")): | |
pass | |
items = [Foo(1), Foo(2), Foo(3)] |
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
use strict; | |
use warnings; | |
use Data::Dumper; | |
my $things = { foo => 'bar' }; | |
foreach my $word (qw(foo baz bar quux)) { | |
my $count = grep { defined } $things->{$word}; | |
print "$count\n"; | |
} |
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
public class App { | |
public static void main(final String[] args) { | |
System.out.println("Hey, you guys!!!!"); | |
final Signatures s = new Signatures(); | |
// Auto-complete below should provide several signatures | |
// for stuff(), but only one is given. | |
s. | |
} | |
} |
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
public class App { | |
public static void main(final String[] args) { | |
System.out.println("Hey, you guys!!!!"); | |
// Auto-complete here should give us a list of values in Option, but it doesn't. | |
final Option o = Option. | |
} | |
} |
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
my $ssn_regex = qr/^ | |
(\d{3}) # first three digits | |
[\s\-]* # any whitespace or hyphen | |
(\d{2}) # next two digits | |
[\s\-]* # any whitespace or hyphen | |
(\d{4}) # last four digits | |
$/msx; | |
sub normalize_ssn { | |
my ($raw_ssn) = @_; |
NewerOlder