Skip to content

Instantly share code, notes, and snippets.

View abuzarhamza's full-sized avatar
🎯
Focusing

abuzarhamza abuzarhamza

🎯
Focusing
View GitHub Profile
#
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={};$
$|=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*
@abuzarhamza
abuzarhamza / perl_global1.pl
Created December 17, 2011 16:42
global perl variable $,
#!/usr/bin/perl -w
$\ = "\n";
$, = "\t";
print "1. foo\tyou\tme\tperl";
print "2. foo","you","me","perl";
foo();
#!/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";
#!/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";
#!/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";
@abuzarhamza
abuzarhamza / wantarray.pl
Created April 3, 2014 06:50
wantarray Tutorial
#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";
#override the core subroutine (inbuilt function) of perl
BEGIN {
*CORE::GLOBAL::chdir = sub {
print "perl core funtion override sample";
}
*shove = \&CORE::push;
}
chdir ;
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()){
@abuzarhamza
abuzarhamza / selenium_youtube.pl
Last active August 29, 2015 14:19
youtube serach history
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
#