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
*Main> concat $ take 10 $ repeat ",.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/" | |
",.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/,.,.,.,.,.,/,.,.,.,.,.,.,.,./.,.,.,.,.,.,.,.,.,.,/" | |
*Main> |
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
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, |
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
splitDigits :: String -> [Int] | |
splitDigits = map digitToInt | |
addNum :: String -> Int | |
addNum = foldl' (+) 0 . splitDigits |
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
module CountLines where | |
import System.Environment | |
main = do | |
args <- getArgs | |
file <- readFile $ head args | |
putStrLn $ show $ length $ lines file |
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
splitDigits :: String -> [Int] | |
splitDigits = map digitToInt | |
addNum :: Int -> Int | |
addNum = foldl' (+) 0 . splitDigits . show |
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
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 |
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
module Main where | |
import Control.Monad | |
import Data.List | |
import Data.Char | |
import System.IO | |
getSecondWord = head . tail . words | |
getLastWord = last . words |
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
countLetters = length . filter (/= ' ') |
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
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 |
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
countLetters xs = | |
length $ filter (/= ' ') $ subRegex (mkRegex "[^aA-zZ]") xs "" |