[ create a new paste ] login | about

minitech

Name: Ryan O'Hara
Email:
Site/Blog: http://minite.ch/
Location: British Columbia, Canada
Default language: Perl
Favorite languages: VB.NET
About:

Saved pastes by minitech:

PHP, pasted on Apr 30:
1
2
3
4
5
<?php
$file = array('one.zip', 'two.zip', 'three.zip');
$name = array('ZIP number one', 'ZIP #2', 'ZIP file 3!');

foreach(array_combine($file, $name) as $f => $n) {
...
view (8 lines, 3 lines of output)
PHP, pasted on Apr 30:
1
2
3
4
5
<?php
$file = array('one.zip', 'two.zip', 'three.zip');
$name = array('ZIP number one', 'ZIP #2', 'ZIP file 3!');

foreach(array_combine($file, $name) as $f => $n) {
...
view (8 lines, 1 line of output)
Python, pasted on Apr 27:
1
2
3
4
def exactlyTwo(l):
    for i in xrange(0, len(l)):
        try:
            j = l.index(l[i], i + 1)
...
view (18 lines, 3 lines of output)
Python, pasted on Apr 10:
1
2
3
4
import re

data = """<html>
<pre>
...
view (26 lines, 7 lines of output)
Python, pasted on Apr 9:
1
2
3
4
import re

data = """<html>
<pre>
...
view (26 lines, 13 lines of output)
Perl, pasted on Mar 10:
1
2
sub p{($c,$r)=@_;$r=$r||$c;eval"*p$c=sub{print'$r'}";}p chr foreach(97..122);p"J";p"P";p"S"," ";p"C",",";
pC(pr(pe(pk(pc(pa(ph(pS(pl(pr(pe(pP(pS(pr(pe(ph(pt(po(pn(pa(pS(pt(ps(pu(pJ()))))))))))))))))))))))))
view (2 lines, 1 line of output)
Perl, pasted on Mar 9:
1
2
3
4
5
#--------|---------|----------|--------+
#######   ########  #########  ###
###  ###  ###       ###   ###  ###
######    ######    #######    ###
###       ###       ###  ###   ###
...
view (11 lines, 1 line of output)
Perl, pasted on Mar 9:
1
2
3
4
5
#--------|---------|----------|--------+
#######   ########  #########  ###
###  ###  ###       ###   ###  ###
######    ######    #######    ###
###       ###       ###  ###   ###
...
view (12 lines, 1 line of output)
Perl, pasted on Mar 9:
1
2
3
4
5
#--------|---------|----------|--------+
#######   ########  #########  ###
###  ###  ###       ###   ###  ###
######    ######    #######    ###
###       ###       ###  ###   ###
...
view (12 lines, 1 line of output)
Perl, pasted on Mar 9:
1
2
3
4
5
#--------|---------|----------|--------+
#######   ########  #########  ###
###  ###  ###       ###   ###  ###
######    ######    #######    ###
###       ###       ###  ###   ###
...
view (11 lines, 1 line of output)
Python, pasted on Feb 21:
1
2
3
4
5
def binary(n):
    s = str(n % 2)

    if n >> 1 > 0:
        s += binary(n >> 1)
...
view (9 lines, 1 line of output)
PHP, pasted on Feb 21:
1
2
3
4
5
<?php
// A function to sort by last name.
function lastNameSort($a, $b) {
    $aLast = end(explode(' ', $a));
    $bLast = end(explode(' ', $b));
...
view (20 lines, 6 lines of output)
Ruby, pasted on Jan 26:
1
2
3
4
string = 'this_should_not have emphasis but _this_ one should. **Strong emphasis**'
string.gsub!(%r{(^|\s)(\*\*|__)(.+?)\2(\s|$)}x, %{\\1<strong>\\3</strong>\\4})
string.gsub!(%r{(^|\s)([*_])(.+?)\2(\s|$)}x, %{\\1<em>\\3</em>\\4})
puts string
view (4 lines, 1 line of output)
Ruby, pasted on Jan 25:
1
2
3
string = 'this should have _emphasis_ but this_one_should_not'
string.gsub!(%r{(^|\s)([*_])(.+?)\2(\s|$)}x, %{\\1<em>\\3</em>\\4})
puts string
view (3 lines, 1 line of output)
PHP, pasted on Jan 3:
1
2
3
4
5
<?php
$toPutIntoColumns = array('One',   'Seven',  'Thirteen',
                          'Two',   'Eight',  'Fourteen',
                          'Three', 'Nine',   'Fifteen',
                          'Four',  'Ten',    'Sixteen',
...
view (33 lines, 64 lines of output)
C++, pasted on Dec 12:
1
2
3
4
5
#include <stdio.h>

int main(int argc, char *argv[]) {
    char start[80] = "C:\\I am\\Testing\\something.exe";
    char *str = start;
...
view (18 lines, 1 line of output)
PHP, pasted on Dec 12:
1
2
3
4
5
<?php
echo "~0 = " . ~0 . "\n";
echo "1 << 2 = " . (1 << 2) . "\n";
echo "7 >> 2 = " . (7 >> 2) . "\n";
echo "7 ^ 3 = " . (7 ^ 3) . "\n";
...
view (6 lines, 4 lines of output)
Plain Text, pasted on Dec 6:
1
2
3
4
5
Dictionary<string, int> dictionary = new Dictionary<string, int>();
foreach(string recordline in tags) {
	string recordstag = recordline.Split('\t')[1];
	string tagToDic = recordstag.Substring(0, recordstag.Length - 1);

...
view (11 lines)
PHP, pasted on Oct 1:
1
<?::
view (1 line, 2 lines of output)
Ruby, pasted on Sep 22:
1
2
3
4
5
def factorial(x)
    if x <= 1 then
        1
    else
        x * factorial(x - 1)
...
view (13 lines, 2 lines of output)
Perl, pasted on Sep 21:
1
2
#}Tk~*~xy|roo*Z*|vmrk|uo6
open Q,$0;@r=split/\n/,<Q>;$_=join'',(map{chr(ord() - 10)}split//,$r[0]);$_=~s/(.)(..)/$2$1/g;$_='Jus'.substr$_,2;print
view (2 lines, 1 line of output)
Perl, pasted on Sep 20:
1
2
3
#}Tk~*~xy|roo*Z*|vmrk|uo6
#10
open Q,$0;@r=split/\n/,<Q>;print join'',(map{chr(ord() - 10)}split//,$r[0]);
view (3 lines, 1 line of output)
C, pasted on Sep 4:
1
2
3
4
5
#include "stdio.h"

const char * placeSuffix(int n){static char*s[]={"th","st","nd","rd"};return n/10%10==1?s[0]:s[n%10<4?n%10:0];}

int main(void) {
...
view (13 lines, 150 lines of output)
C, pasted on Apr 18:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main(int argc, char * argv[]) {
...
view (17 lines, 1 line of output)
Perl, pasted on Apr 8:
1
2
print(('Fizz','Buzz',$_)[(!!($_%3))+(!!($_%5))*2].'
')for(1..100)
view (2 lines, 100 lines of output)
Ruby, pasted on Apr 8:
1
2
3
4
5
(1..100).map do|x|
     if x%3==0
          if x%5==0 then puts"FizzBuzz"else puts"Fizz"end
     elsif x%5==0
          puts"Buzz"
...
view (9 lines, 100 lines of output)
Perl, pasted on Apr 5:
1
no warnings;$s='$_=$x;tr/';$s.=chr for(97..122);$s.='/';$s.=chr-$_ for(-122..-97);$_='$_=$s;eval';$s.='/;print';$x='Jfhg zmlgsvi Pvio szxpvi,';eval
view (1 line, 1 line of output)
Perl, pasted on Apr 5:
1
no warnings;$s='$_=$x;tr/';$s.=chr for(97..122);$s.='/';$s.=chr-$_ for(-122..-97);$_='$_=$s;eval';$s.='/;print';$x='Hvool dliow!';eval
view (1 line, 1 line of output)
Perl, pasted on Feb 9:
1
sub x{open T,$0;$_=substr<T>,42,25}print "Just another Perl hacker,"if!x;print
view (1 line, 1 line of output)
C++, pasted on Feb 9:
1
2
3
4
5
#include <iostream>

typedef int byte;

class Color {
...
view (95 lines, 7 lines of output)
Perl, pasted on Feb 8:
1
use MIME::Base64;print map chr,map{$c+=ord>128?-((ord)-128):ord;}split//,decode_base64"SiuCAdRBDQEFjIMN0jAVDYbMSIcCCIYNxg"
view (1 line, 1 line of output)
Perl, pasted on Feb 8:
1
print map chr,map{$c+=$_}(74,43,-2,1,-84,65,13,1,5,-12,-3,13,-82,48,21,13,-6,-76,72,-7,2,8,-6,13,-70)
view (1 line, 1 line of output)
Perl, pasted on Feb 8:
1
2
print(($_%15?$_%3?$_%5?$_:'Buzz':'Fizz':'FizzBuzz').'
')for(1..100)
view (2 lines, 100 lines of output)
Perl, pasted on Feb 8:
1
2
print map{($_%5?$_%3?$_:'Fi':$_%3?'Bu':'FizzBu').($_%5&&$_%3?'':'zz').'
'}(1..100);
view (2 lines, 100 lines of output)
PHP, pasted on Jan 28:
1
2
3
4
5
<?for($i=1;$i<101;$i++)echo $i%15?$i%3?$i%5?"$i
":'Buzz
':'Fizz
':'FizzBuzz
';
view (5 lines, 100 lines of output)
Perl, pasted on Jan 28:
1
2
3
4
5
print$_%15?$_%3?$_%5?"$_
":'Buzz
':'Fizz
':'FizzBuzz
'for(1..100)
view (5 lines, 100 lines of output)
Perl, pasted on Jan 28:
1
2
3
4
5
print$_%15?$_%3?$_%5?$_.'
':'Buzz
':'Fizz
':'FizzBuzz
'for(1..100)
view (5 lines, 100 lines of output)
C, pasted on Jan 27:
1
int main(){int i=0;while(++i<=100)printf(i%15==0?"FizzBuzz\n":i%3==0?"Fizz\n":i%5==0?"Buzz\n":"%d\n",i);return 0;}
view (1 line, 100 lines of output)
C, pasted on Jan 27:
1
int main(){int i=0;while(++i<=100)if(i%3==0)if(i%5==0)printf("FizzBuzz\n");else printf("Fizz\n");else if(i%5==0)printf("Buzz\n");else printf("%d\n",i);return 0;}
view (1 line, 100 lines of output)
Perl, pasted on Jan 27:
1
use MIME::Base64;print map{map{(++$i,'Fizz','Buzz','FizzBuzz')[$_]."\n"}(3&ord,3&ord>>2,3&ord>>4,3&ord>>6)}split//,decode_base64"EAZJMIRBEgxhkARDGCTBEAZJMIRBEgxhkA"
view (1 line, 100 lines of output)
Perl, pasted on Dec 15:
1
use MIME::Base64;print map{map{(++$i,'Fizz','Buzz','FizzBuzz')[$_]."\n"}(3&(ord),3&(ord>>2),3&(ord>>4),3&(ord>>6))}split//,decode_base64"EAZJMIRBEgxhkARDGCTBEAZJMIRBEgxhkA"
view (1 line, 100 lines of output)
Perl, pasted on Dec 15:
1
2
3
# Another FizzBuzz script. Technically only one line if you don't include the
# comment or the "use MIME::Base64" part.
use MIME::Base64;print map{$r=ord;map{(++$i,'Buzz','Fizz','FizzBuzz')[$_]."\n"}(3&($r),3&($r>>2),3&($r>>4),3&($r>>6))}split//,decode_base64"EAZJMIRBEgxhkARDGCTBEAZJMIRBEgxhkA"
view (3 lines, 100 lines of output)
Perl, pasted on Dec 15:
1
2
3
4
5
# A "cheating" way to write FizzBuzz in one line.
# This is preparation.
use MIME::Base64;
@b=();
for(my $i = 0; $i < 25; $i++) {
...
view (20 lines, 101 lines of output)
Perl, pasted on Dec 14:
1
2
3
4
5
#--------|---------|----------|--------+
#######   ########  #########  ###
###  ###  ###       ###   ###  ###
######    ######    #######    ###
###       ###       ###  ###   ###
...
view (9 lines, 1 line of output)
C++, pasted on Dec 14:
1
2
3
4
5
#include <iostream>

typedef unsigned char byte;

class Color {
...
view (94 lines, 3 lines of output)
Perl, pasted on Dec 8:
1
2
3
4
5
#--------|---------|----------|--------+
#######   ########  #########  ###
###  ###  ###       ###   ###  ###
######    ######    #######    ###
###       ###       ###  ###   ###
...
view (11 lines, 1 line of output, 1 comment)