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 | |
use strict; | |
sub check_prime { | |
my ($max) = @_; | |
for my $x (2 .. ($max - 1)) { if ($max % $x == 0) { return 1; } } | |
return 0; | |
} | |
for my $x ( 1..100 ) { |
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
;; djanatyn's emacs config | |
;; feel free to debug or use, or whatever. | |
;; set load path | |
(add-to-list 'load-path "~/.emacs.d/sitelisp/") | |
(load "~/.emacs.d/cperl-mode.el") | |
;; open with *scratch* buffer | |
(setq inhibit-splash-screen t) |
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
class Person | |
attr_accessor :name, :age | |
def initialize(name,age) | |
@name = name | |
@age = age.to_i | |
end | |
def inspect | |
"#@name (#@age)" | |
end | |
end |
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
TOTAL_DISTANCE = 150000 | |
COST_OF_GAS = 4 | |
class car: | |
def __init__(self,mpg,cost): | |
self.mpg = mpg | |
self.cost = cost | |
cars = [ car(250,5000), car(600,900000), car(3000,20) ] | |
costs = [] |
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 | |
use strict; | |
use warnings; | |
$TOTAL_DISTANCE + 150000; | |
$PRICE_PER_GALLON = 4; | |
my @cars = [ | |
{ 'mpg' => 250, cost => '5000' }, | |
{ 'mpg' => 250, cost => '5000' }, |
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 | |
use strict; | |
use warnings; | |
my $TOTAL_DISTANCE = 150000; | |
my $PRICE_PER_GALLON = 4; | |
my @cars = ( | |
{ mpg => 300, cost => '5000' }, | |
{ mpg => 250, cost => '5000' }, |
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 | |
use strict; | |
use warnings; | |
my $max = 100; | |
my @array; | |
for ( 1 .. $max ) { $array[$_] = 1; } | |
for ( 2 .. $max ) { | |
my $i = 2; |
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
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="style.css" /> | |
<title>Hello world!</title> | |
</head> | |
<body> | |
<center> | |
<br/> | |
<div id="container"> | |
<img src="tux.png" align="right" /> |
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
fizzBuzz n | |
| mod n 3 == 0 && mod n 5 == 0 = "FizzBuzz" | |
| mod n 3 == 0 = "Fizz" | |
| mod n 5 == 0 = "Buzz" | |
| otherwise = show n | |
main = do | |
theFizzies = map fizzBuzz [1..100] | |
putStrLn $ show theFizzies |
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
movies to watch | |
=============== | |
(that movie about the engineer and the time traveller that mr. miller saw) | |
pan's labyrinth | |
children of men | |
fight club | |
the shawshank redemption | |
the lives of others | |
a beautiful mind |