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 j(\$){($ | |
P,$V)= @_;while($$P=~s:^ | |
([()])::x){ $V+=('('eq$1)?-32:31 | |
}$V+=ord( substr( $$P,0,1,""))-74} sub a{ | |
my($I,$K,$ J,$L)=@_ ;$I=int($I*$M/$Z);$K=int( | |
$K*$M/$Z);$J=int($J*$M /$Z);$L=int($L*$M/$Z); $G=$ | |
J-$I;$F=$L-$K;$E=(abs($ G)>=abs($F))?$G:$F;($E<0) and($ | |
I,$K)=($J,$L);$E||=.01 ;for($i=0;$i<=abs$E;$i++ ){ $D->{$K | |
+int($i*$F/$E) }->{$I+int($i*$G/$E)}=1}}sub p{$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
$|=3,141592;sub _ | |
{print@_}sub o{_++$O[0 | |
];_ 0for 1..$#O}sub O{$;=int | |
$=/10,'0/^ ^';if($;<9) | |
{_$_ for @O;;@O=() | |
;0}push @O,$;;0 | |
,;push@ O,'.'if | |
$^==1; 0;if($; | |
==10){ print ,o,@O=( | |
)}}$~= 1000000 ;$-=10* |
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/perl -w | |
$\ = "\n"; | |
$, = "\t"; | |
print "1. foo\tyou\tme\tperl"; | |
print "2. foo","you","me","perl"; | |
foo(); |
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/perl | |
use Data::Dumper; | |
use Net::Twitter; | |
##fill in your dev.twitter stuff below | |
my $twitterconsumer = "ur_consumer"; | |
my $twitterconsumersecret = "ur_consumer_secret"; | |
my $twitteraccesstoken = "ur_access_token"; |
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/perl | |
use Data::Dumper; | |
use Net::Twitter; | |
##fill in your dev.twitter stuff below | |
my $twitterconsumer = "ur_consumer"; | |
my $twitterconsumersecret = "ur_consumer_secret"; | |
my $twitteraccesstoken = "ur_access_token"; |
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/perl | |
use Data::Dumper; | |
use Net::Twitter; | |
##fill in your dev.twitter stuff below | |
my $twitterconsumer = "ur_consumer"; | |
my $twitterconsumersecret = "ur_consumer_secret"; | |
my $twitteraccesstoken = "ur_access_token"; |
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
#called under void context | |
testContextCall(); | |
#called under scalar context | |
my $test = testContextCall(); | |
#called under list context | |
my @test = testContextCall(); | |
print "testContextCall() under scalar contex : $test\n"; | |
print "testContextCall() under array contex : @test\n"; | |
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
#override the core subroutine (inbuilt function) of perl | |
BEGIN { | |
*CORE::GLOBAL::chdir = sub { | |
print "perl core funtion override sample"; | |
} | |
*shove = \&CORE::push; | |
} | |
chdir ; |
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
When calling multiple stored procedures, you can run into the following error: "Commands out of sync; you can't run this command now". | |
This can happen even when using the close() function on the result object between calls. | |
To fix the problem, remember to call the next_result() function on the mysqli object after each stored procedure call. See example below: | |
<?php | |
// New Connection | |
$db = new mysqli('localhost','user','pass','database'); | |
// Check for errors | |
if(mysqli_connect_errno()){ |
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; | |
use Getopt::Std; | |
use Selenium::Remote::Driver; | |
use Data::Dumper; | |
########################## | |
#u need to run selenium-server-standalone | |
#java -jar selenium-server-standalone-2.45.0.jar | |
# |
OlderNewer