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
$(window).load(function() { | |
var another = | |
io.connect('http://localhost:9000/deployStatusSocket'); | |
another.on('deploy status', function(data, callback) { | |
callback("OK!"); | |
changeStatusMessage(data); | |
}); | |
}); |
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
var _mysql = require('mysql'); | |
var host = '127.0.0.1'; | |
var port = '3306'; | |
var mysql_user = 'scott'; | |
var mysql_pass = 'tiger'; | |
var database = 'database'; | |
var mysql = _mysql.createClient({ | |
host: host, | |
port: port, |
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
NSDictionary *ndic = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil]; | |
NSLog(@"ndic %@", [ndic objectForKey:@"key1"]); | |
for(NSString *key in ndic) { | |
NSLog(@"%@", key); | |
} | |
NSArray *keySorted = [ndic keysSortedByValueUsingSelector:@selector(compare:)]; | |
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 <foundation/foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
NSString *prose = @"Do nine men interpret?"; | |
NSMethodSignature *signature; | |
NSInvocation *invocation; | |
NSString *count; |
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
public class BoundedExecutor { | |
private final Executor exec; | |
private final Semaphore semaphore; | |
private Log logger = LogFactory.getLog(BoundedExecutor.class); | |
public BoundedExecutor(Executor exec, Semaphore semaphore) { | |
this.exec = exec; | |
this.semaphore = semaphore; | |
} |
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 is_royal_flush(nums, marks): | |
number="".join(str(n) for n in nums) | |
mark_set = set(marks) | |
if number == "1011121314" and len(mark_set) == 1: | |
return (True, nums[4]) | |
else: | |
return (False, nums[4]) | |
def is_st_flush(nums, marks): |
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
sub fact { | |
my ($n) = @_; | |
if ($n == 1) { | |
return 1 | |
} | |
my $result = 1; | |
foreach my $d ((1..$n)) { | |
$result = $result * $d; |
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 strict; | |
use warnings; | |
sub is_permutations { | |
my ($a, $b) = @_; | |
#print "$a, $b \n"; | |
my @s_a = split //, $a; | |
@s_a = sort @s_a; | |
my $a_str = join "", @s_a; |
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 strict; | |
use warnings; | |
sub is_prime_number { | |
my($num) = @_; | |
my $t=2; | |
while ($t <= $num) { | |
my $rest = $num % $t; |
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 strict; | |
use warnings; | |
sub is_prime_number { | |
my($num) = @_; | |
my $t=2; | |
while ($t <= $num) { | |
my $rest = $num % $t; |