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
refn = function() { | |
source("fn.r"); | |
} | |
plot_ut_text = function() { | |
p = plot_ut_abstract() + geom_text(aes(label = p1remaining, colour = p1remaining), size = 3) | |
p | |
} | |
plot_ut_point = function () { | |
p = plot_ut_abstract() + geom_point(aes(size = p1remaining, colour = p1remaining)) |
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
can't find the original joke after 60s searching, so here's a rough reconstruction: | |
How to make fried green tomatoes | |
1) Select dark green tomatoes with no blemishes | |
2) Slice longitudinally into 2cm slabs | |
3) coat with a mixture of salt, flour and spices | |
4) deep fry for 2mins in oil at 200degC | |
5) bury result in back yard and buy a burger. Fried green tomatoes are nasty. |
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
OZYMANDIAS | |
by Percy Bysshe Shelley. via http://en.wikipedia.org/wiki/Ozymandias | |
I met a traveller from an antique land | |
Who said: Two vast and trunkless legs of stone | |
Stand in the desert. Near them, on the sand, | |
Half sunk, a shattered visage lies, whose frown | |
And wrinkled lip, and sneer of cold command | |
Tell that its sculptor well those passions read | |
Which yet survive, stamped on these lifeless things, |
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
<?php | |
#don't use floats for money! | |
$a = 110; # $110 | |
$b = 1.10 * 100; # 100 items at $1.10 each | |
#$b = 110 -1E-13; | |
print "a: "; var_dump($a); | |
print "b: "; var_dump($b); |
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
<?php | |
$a = '1E1'; | |
$b = $a - (int)$a; | |
var_dump($b); | |
//output: float(9) |
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><body> | |
<?php | |
$msg = file_get_contents('readme.txt'); | |
echo "<pre>$msg\n\n</pre>"; | |
foreach (glob("*") as $img) { | |
if (preg_match("/jpg|png|gif/i", $img)) { | |
echo "<img src=\"$img\"><br>"; | |
} | |
} |
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
04:46:58 tims@saw ~ $ cat test.php | |
<?php | |
$a = array(1,2,3,4); | |
#http://www.php.net//manual/en/control-structures.foreach.php | |
# "Warning Reference of a $value and the last array element remain even after the foreach loop. It is recommended to destroy it by unset()" | |
foreach ($a as &$b) { | |
$b = $b * 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
Twitter won't let me send this tweet, it claims "This request looks like it might be automated. To protect our users from spam and other malicious activity, we can't complete this action right now. Please try again later." | |
I think this is the article on character encoding I'm looking for. #ruby | |
https://web.archive.org/web/20140807044211/http://graysoftinc.com/articles/ruby_19s_string |
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
she told him that she loved him | |
only she told him that she loved him | |
she only told him that she loved him | |
only she only told him that she loved him | |
she told only him that she loved him | |
only she told only him that she loved him | |
she only told only him that she loved him | |
only she only told only him that she loved him | |
she told him only that she loved him | |
only she told him only that she loved him |
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
15:23:14 tims@firebat ~ $ rvm use 2.2.1 | |
Using /home/tims/.rvm/gems/ruby-2.2.1 | |
15:23:18 tims@firebat ~ $ irb | |
2.2.1 :001 > "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" | |
=> "2.2.1-p85" | |
2.2.1 :002 > a = nil | |
=> nil | |
2.2.1 :003 > a[5] = 6 | |
NoMethodError: undefined method `[]=' for nil:NilClass | |
from (irb):3 |
OlderNewer