Skip to content

Instantly share code, notes, and snippets.

View Raynes's full-sized avatar

Anthony Grimes Raynes

View GitHub Profile
*Main> concat $ take 10 $ repeat ",.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/"
",.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/"
*Main>
Second, while I've never really used Visual Basic,
I've also never understood the irrational hatred
towards it. It's used quite frequently for developing
interfaces among engineers, probably because they
don't have to waste their time packing some stupid
GTK boxes with widgets as if it were a game of
Klotski (actually, the packing model is kinda
nice, but I need comprehensible fodder). My
feeling is that it's hated only because it's
cool to hate by obscurantists and miscreants,
splitDigits :: String -> [Int]
splitDigits = map digitToInt
addNum :: String -> Int
addNum = foldl' (+) 0 . splitDigits
module CountLines where
import System.Environment
main = do
args <- getArgs
file <- readFile $ head args
putStrLn $ show $ length $ lines file
splitDigits :: String -> [Int]
splitDigits = map digitToInt
addNum :: Int -> Int
addNum = foldl' (+) 0 . splitDigits . show
Sub TakeVacation()
Dim Vacation As String
Dim Approved As String
If Approved = "Yes" Then
Vacation = "Is Approved"
Else : If Approved = "No" Then
Vacation = "Denied"
End If
End If
module Main where
import Control.Monad
import Data.List
import Data.Char
import System.IO
getSecondWord = head . tail . words
getLastWord = last . words
countLetters = length . filter (/= ' ')
module Main where
import Control.Monad
import Data.List
import Data.Char
import System.IO
import Text.Regex.Posix
import Text.Regex
getSecondWord = head . tail . words
countLetters xs =
length $ filter (/= ' ') $ subRegex (mkRegex "[^aA-zZ]") xs ""