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
mstemle@mstemle901:~/Desktop$ ./runtests.sh | |
String length: 512 | |
************************ | |
* if + strtolower * | |
************************ | |
Time: 0.001159 | |
Memory: 1904 | |
************************ | |
* strcasecmp * | |
************************ |
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
#define SV_STRING(VALUE) newSVpv(VALUE,strlen(VALUE)) | |
#define SV_CARRAY(VALUE,SIZE) newSVpvn(VALUE,SIZE) | |
#define SV_UINT(VALUE) newSVuv(VALUE) | |
#define SV_INT(VALUE) newSViv(VALUE) | |
#define SV_DECIMAL(VALUE) newSVnv(VALUE) | |
#define SV_UNDEF_VAL newSV(0) | |
#define SV_UNDEF_REF &PL_sv_undef | |
#define HASH_STORE_UINT(HASH,KEY,VALUE) hv_store(HASH,KEY,strlen(KEY),SV_UINT(VALUE),0) | |
#define HASH_STORE_INT(HASH,KEY,VALUE) hv_store(HASH,KEY,strlen(KEY),SV_INT(VALUE),0) |
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/env perl | |
use strict;use warnings; | |
use Data::Dumper; | |
our $copies = 0; | |
our $compares = 0; | |
sub merge_sort { | |
my ($compare, @input) = @_; |
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/env perl | |
use strict; use warnings; | |
if (scalar(@ARGV) != 1) { | |
die "Usage: $0 INTEGER"; | |
} | |
my $in = $ARGV[0]; | |
if ($in !~ m/^-?[0-9]+$/) { | |
die "Usage: $0 INTEGER (and it really must be an integer)"; |
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/env perl | |
use strict;use warnings; | |
use POSIX qw/ceil/; | |
use Test::More tests => 15; | |
sub find_last_name { | |
my ($needle, @haystack) = @_; | |
# ASSUMING SORTED! |
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/env perl | |
use strict; use warnings; | |
use Test::More tests => 6; | |
my @prices = qw/2 3 3 4 3 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1/; | |
# Rules: | |
# 1. @prices' indices are seconds | |
# 2. @prices' values are dollars for a stock |
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/env perl | |
use strict;use warnings; | |
use Test::More tests => 4; | |
use Data::Dumper; | |
{ | |
package Node; | |
sub 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Word Cloud</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<style type="text/css"> | |
@import url(http://fonts.googleapis.com/css?family=Felipa); | |
body { | |
margin: 0px; |
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
# ~/Sites/WEBSITENAME/website/lib/Koding.pm | |
use strict;use warnings; | |
package Koding; | |
{ | |
package KodingPaths; | |
use FindBin ('$Bin'); | |
sub _koding_get_home { |
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
#!env sh | |
# Make the local folder | |
mkdir $HOME/local | |
# Set up your PERL5LIB | |
echo 'export PERL5LIB="$HOME/local/lib64/perl5:$HOME/local/share/perl5"' >> $HOME/.bash_profile | |
echo -e "o conf makepl_arg PREFIX=$HOME/local\no conf make_install_arg PREFIX=$HOME/local\no conf commit\nexit\n" | | |
cpan |
OlderNewer