This file contains hidden or 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
| local largest = -1 | |
| local iterations = 0 | |
| local is_palindrome | |
| is_palindrome = function(n) | |
| n = tostring(n) | |
| return n == n:reverse() | |
| end | |
| for x = 100, 999 do | |
| for y = 999, x, -1 do | |
| local _continue_0 = false |
This file contains hidden or 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
| lfn28p3 = (fn) -> | |
| l, ext = fn\match "(.+)%.([^.]+)" | |
| fn = l if l | |
| fn = fn\upper() | |
| fn = fn\gsub "[,[%];=+]", "_" | |
| fn = fn\gsub "[^%a%d_.]", "" | |
| fn = fn\sub(1, 6) .. "~1" if fn\len() > 8 | |
| ext = ext\sub(1, 3) if ext\len() > 3 | |
| return fn .. "." .. ext | |
This file contains hidden or 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
| Filesystem Size Used Avail Use% Mounted on | |
| /dev/sda1 15G 14G 528M 97% / | |
| none 4.0K 0 4.0K 0% /sys/fs/cgroup | |
| udev 2.0G 4.0K 2.0G 1% /dev | |
| tmpfs 396M 940K 395M 1% /run | |
| none 5.0M 0 5.0M 0% /run/lock | |
| none 2.0G 4.0K 2.0G 1% /run/shm | |
| none 100M 8.0K 100M 1% /run/user | |
| /dev/sdb 32G 17G 14G 55% /home | |
| Documents 120G 80G 40G 67% /media/sf_Documents |
This file contains hidden or 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
| use std::io; | |
| use std::collections::HashMap; | |
| use std::collections::hash_map::Entry::{Occupied,Vacant}; | |
| use std::ascii::AsciiExt; | |
| fn main() { | |
| let mut words: HashMap<String, uint> = HashMap::new(); | |
| for line in io::stdin().lock().lines() { | |
| for word in line.unwrap().words() { | |
| let lc = word.to_string().to_ascii_lower(); |
This file contains hidden or 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
| from sys import stdin | |
| from collections import Counter | |
| from re import findall | |
| words = Counter(findall("(\\w+(?:'\\w+)?)", stdin.read())) | |
| print(words) |
This file contains hidden or 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
| (import [sys [stdin]] | |
| [collections [Counter]] | |
| [re [findall]]) | |
| (setv words (-> (findall "(\w+(?:'\w+)?)" | |
| (.read stdin)) | |
| (Counter))) | |
| (print words) |
This file contains hidden or 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
| use std::io; | |
| use std::collections::HashMap; | |
| use std::ascii::AsciiExt; | |
| fn main() { | |
| let mut words: HashMap<String, uint> = HashMap::new(); | |
| for line in io::stdin().lock().lines() { | |
| for word in line.ok().unwrap().words() { | |
| let lc = word.to_string().to_ascii_lower(); | |
| if words.contains_key(lc.as_slice()) { |
This file contains hidden or 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
| from bottle import route, run, template | |
| @route('/') | |
| def index(): | |
| return template(*['<h1>Hello, {{subject}}!</h1>'], **{'subject': 'World', }) | |
| run(*[], **{'host': '0.0.0.0', 'port': '8080', }) |
This file contains hidden or 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
| (import [bottle [route run template]]) | |
| (with-decorator (route "/") | |
| (defn index [] | |
| (apply template ["<h1>Hello, {{subject}}!</h1>"] {"subject" "World"}))) | |
| (apply run [] {"host" "0.0.0.0" "port" "8080"}) |
This file contains hidden or 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
| namespace FSharpBot | |
| open Robocode | |
| type MyFSharpBot() = | |
| inherit Robot() | |
| override this.Run() = | |
| this.Initialize() | |
| this.MainLoop() |