Skip to content

Instantly share code, notes, and snippets.

View abuzarhamza's full-sized avatar
🎯
Focusing

abuzarhamza abuzarhamza

🎯
Focusing
View GitHub Profile
@abuzarhamza
abuzarhamza / parseTable.pl
Last active August 29, 2015 14:24
perl program to extract table
#this program parse the page http://www.edgar-wingender.de/muTF_classification-1.html
#arrange the output in the below format
#TF name Superclass Class Family subfamily
#HOXA7 Helix-turn-helix domains Homeo domain factors HOX-related factors HOX6-7
#c-Myc Basic domains Basic helix-loop-helix factors (bHLH) bHLH-ZIP factors Myc / Max factors
#<tr class="superclass_tr"> | <td class="superclass_descr_td" colspan="9"><i>Superclass</i>: Basic domains</td>
#<tr class="class_tr"> | <td colspan="8"><i>Class</i>: Basic leucine zipper factors (bZIP)</td>
#<tr class="family_tr"> | <td colspan="4"><i>Family</i>: Jun-related factors</td>
#<tr class="subfamily_tr"> | <td colspan="3" nowrap=""><i>Subfamily</i>: Jun factors</td>
@abuzarhamza
abuzarhamza / interface
Created May 19, 2015 06:15
Java Error
//main program HelloNew.java
package greeting.hello;
import printer.Imachine;
public class HelloNew {
public static void main (String[] args ) {
Imachine machine = new PrinterTest(true,"test"); //Getting error at this line
machine.turnOn();
@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
#
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()){
#override the core subroutine (inbuilt function) of perl
BEGIN {
*CORE::GLOBAL::chdir = sub {
print "perl core funtion override sample";
}
*shove = \&CORE::push;
}
chdir ;
@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";
#!/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 / 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();