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
% Lösung des aktuellen (04/2010) P.M.-LogikRätsels | |
% ================================================ | |
% | |
% http://www.pm-magazin.de/de/onlinetraining/logik_trainer/logikraetsel.asp | |
% | |
% Der Brite Samuel Farwell gehört zu jenen Pionieren des modernen Segelsports, | |
% die heute kaum noch jemand kennt. Mehrfach versuchte er zu Beginn des | |
% 20. Jahrhunderts alleine in seinem Boot die Welt zu umsegeln – ohne jemals | |
% dieses hoch gesteckte Ziel zu erreichen. | |
% |
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
Index: D:/lib/scripts/commit-email.pl | |
=================================================================== | |
--- D:/lib/scripts/commit-email.pl (revision 13) | |
+++ D:/lib/scripts/commit-email.pl (revision 294) | |
@@ -39,6 +39,7 @@ | |
use strict; | |
use Carp; | |
use POSIX qw(strftime); | |
+use MIME::Base64; | |
my ($sendmail, $smtp_server); |
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
diff --git a/akephalos.gemspec b/akephalos.gemspec | |
index 1eee36a..ffbc980 100644 | |
--- a/akephalos.gemspec | |
+++ b/akephalos.gemspec | |
@@ -22,6 +22,9 @@ Gem::Specification.new do |s| | |
if RUBY_PLATFORM != "java" && ENV["PLATFORM"] != "java" | |
s.add_runtime_dependency "jruby-jars" | |
end | |
+ if RUBY_PLATFORM =~ /mingw32/ | |
+ s.add_runtime_dependency "win32-process" |
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
property homeDir : POSIX path of (path to home folder) | |
on changeFileNameExtension(fileName, newExtension) | |
tell application "Finder" to set oldExtension to "." & name extension of alias fileName | |
set baseName to characters 1 thru ((offset of oldExtension in fileName) - 1) of fileName | |
return (baseName as string) & newExtension | |
end changeFileNameExtension | |
on convertWordFileToPdf(wordFile) | |
tell application "Finder" to set fileName to wordFile as 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
# Usage: | |
# ruby concat.rb /path-to-compass-gem/frameworks/compass/stylesheets/_compass.scss > compass-all.scss | |
@seen = [] | |
def concat(file) | |
File.foreach(file) do |line| | |
if line =~ /^\s?@import "(.+?)";/ | |
import = $1 | |
unless @seen.include?(import) |
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
def validate_inputs | |
self.form.descendants.any_in(:html_tag => ["input", "select", "textarea"]).excludes("html_attributes.type" => "submit").each do |element| | |
attr = "input_" + element.html_attributes["name"] | |
element.errors.add(:attr, " muss ausgefüllt werden") if element[attr].blank? && element["required"] | |
... | |
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
1) Failure: | |
test_delocalizes_localized_date_without_year(DelocalizeActiveRecordTest) [delocalize/test/delocalize_test.rb:53]: | |
<Mon, 19 Oct 2009> expected but was | |
<Fri, 19 Oct 2012>. | |
2) Failure: | |
test_delocalizes_localized_time_(DST)(DelocalizeActiveRecordTest) [delocalize/test/delocalize_test.rb:79]: | |
<Sun, 01 Mar 2009 09:00:00 CET +01:00> expected but was | |
<Fri, 06 Apr 2012 09:00:00 CEST +02:00>. |
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
# Browsers send newlines from textareas as "\r\n", thus each newline is counted | |
# as two chars when using Rails’ default LengthValidator. | |
# | |
# Of course it would also be possible to convert "\r\n" to "\n" in the controller | |
# or model, but in my app it’s simpler do use a custom validator. | |
class LengthCountingNewlinesAsOneValidator < ActiveModel::Validations::LengthValidator | |
def validate_each(record, attribute, value) | |
value = value.gsub("\r\n", "\n") | |
super | |
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
% Succeeds if `Lines` represents the nonogram specified by `ColumnSpecs` and | |
% `LineSpecs`. For example: | |
%nonogram | |
% 1 | |
% 2 1 2 | |
% +------ | |
% 1 | . # . ColumnSpecs = [[2], [1,1], [2]] | |
% 1 1 | # . # LineSpecs = [[1], [1,1], [3]] | |
% 3 | # # # Lines = [[0,1,0], [1,0,1], [1,1,1]] | |
nonogram(ColumnSpecs, LineSpecs, Lines) :- |
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
% Wer (Vorname) hasst am Inselleben was besonders, und was vermisst er am meisten? | |
% | |
% Vornamen: Bernd, Dirk, Jens, Hubert, Sascha, Thomas | |
% Gehasst werden: Früchte, Rauschen des Meeres, Sand, Schlangen, Skorpione, Wetter | |
% Vermisst werden: Auto, Bier, Ehefrau, Fernsehen, Kinder, Kumpels. | |
loesung(Vornamen, Hasst, Vermisst) :- | |
% 1. Der Mann auf Position 5 vermisst seine Kinder. | |
nth(5, Vermisst, kinder), |
OlderNewer