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
folder_path = "E:/path_to_files/" | |
regexp = /(Ep_(?<episode>\d+)_'(?<episode_name>[A-Za-z]+))/ | |
new_filename = "Testname - E<episode> - <episode_name>" | |
accepted = false | |
Dir.glob(folder_path + "/*").sort.each do |file| | |
ext = File.extname(file) | |
old_filename = File.basename(file, File.extname(file)) | |
matches = old_filename.match(regexp) |
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
#include <iostream> | |
template <template <class X> class V, class TV, | |
template <class Y> class E, class TE> | |
struct VT | |
{ | |
typedef VT<V, TV, E, TE> Combo; | |
typedef TV VertexDataType; | |
typedef TE EdgeDataType; |
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
-- Sieve of Eratosthenes | |
sieve :: [Int] -> [Int] | |
sieve [] = [] | |
sieve (p:xs) = p : sieve [x|x <- xs, x `mod` p /= 0] | |
primes :: Int -> [Int] | |
primes n = sieve [2..n] |
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
-- Sieve of Eratosthenes | |
import Data.List | |
primes n = sieve [2..n] 2 | |
sieve [] _ = [] | |
sieve xs n = | |
n : (sieve left (head left)) | |
where marked = [x | x <- xs, x `rem` n == 0] | |
left = xs \\ marked |
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
# Ruby 1.9.2 | |
# Attempt at creating a method that takes a string and mappings of symbols to functions. | |
# | |
# Is there a better way that does not require as many {} and ->s? | |
choice 'A monster appears behind you! Start [run]ning away or [jump] from the cliff?', | |
run:-> { | |
puts "You just got eaten. Sorry." | |
}, |
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
location :street do | |
location :park do | |
location :bank do | |
end | |
end | |
location :house do | |
location :door do | |
end | |
end |