
Origin of photo unknown. Lolcatified by mhwombat.

"Mo dhreolín" photo posted on Flikr by ColKorn1982, and subsequently lolcatified by mhwombat. License: CC Attribution-Share Alike
"Cat & alpaca" photo by mhwombat. License: CC Attribution-Share Alike
(sum [1..100])^2 - sum (map (\x -> x^2) [1..100])
divisibleUpTo n 1 = True
divisibleUpTo n m = ((n `mod` m) == 0) && (n `divisibleUpTo` (m-1))
factors n = [m | m <- [1,2..floor(sqrt(fromIntegral n))], n `mod` m == 0]
prime n = null [m | m <- factors n, m > 1, m /= n]
lowestNumberDivisibleUpTo 1 = 1
lowestNumberDivisibleUpTo n = head [m | m <- [start..], m `divisibleUpTo` n]
where start = if prime n
then n * lowestNumberDivisibleUpTo (n-1)
else lowestNumberDivisibleUpTo (n-1)
main = print ( lowestNumberDivisibleUpTo 20 )
foldl (lcm) 1 [1..20]
reverseNum n = (read s)::Integer
where s = reverse( show n )
isPalindrome n = n == reverseNum n
factors :: (Integral b, Integral a) => a -> [(a, b)]
factors n = [(i,j) | i <- [1,2..floor(sqrt(fromIntegral n))], let j=floor((fromIntegral n)/(fromIntegral i)), n `mod` i == 0 ]
threeDigitFactors n = [(i,j) | (i,j) <- factors n, i > 99, i < 1000, j > 99, j < 1000]
isProductOfThreeDigitFactors n = not (null (threeDigitFactors n))
candidates = [n | n <- [100*100..999*999], isPalindrome n, isProductOfThreeDigitFactors n]
main = print ( head (reverse candidates) )
reverseNum n = (read s)::Integer
where s = reverse( show n )
isPalindrome n = n == reverseNum n
candidates = [n*m | n <- [999,998..100], m <- [999,998..n], isPalindrome (n*m)]
main = print ( maximum candidates )
factors n = [m | m <- [1,2..floor(sqrt(fromIntegral n))], n `mod` m == 0]
prime n = null [m | m <- factors n, m > 1, m /= n]
primeFactors n = [m | m <- factors n, prime m]
main = print ( last ( primeFactors 600851475143 ) )
fib 1 = 1
fib 2 = 2
fib n = (fib (n-1)) + (fib (n-2))
fiblist = map fib [1..]
shortlist = takeWhile (< 4000000) fiblist
main = print ( sum[n | n <- shortlist, n `mod` 2 == 0] )
fiblist = 0 : 1 : (zipWith (+) fiblist (tail fiblist))
shortlist = takeWhile (< 4000000) fiblist
main = print ( sum[n | n <- shortlist, even n] )
multipleOf m n = m `mod` n == 0
chosenNumbers = filter (\x -> x `multipleOf` 3 || x `multipleOf` 5) [1..999]
main = print ( sum chosenNumbers )
sum [n | n <- [1..999], n `mod` 5 == 0 || n `mod` 3 == 0]
ps -ef | grep dhcpcd. D'fheicfeá /sbin/dhcpcd sa liosta.)bind-tools dá bhrí dig agat. Níl sé de dhíth ort le húsáid OpenDNS, ach beidh sé níos éasca bheith cinnte go bhfuil DNS ag dul chuig na freastalaí ceart.dhcpcd_eth0="-R"
config_eth0=( "dhcp" )
dhcp_eth0="nodns nontp nonis"
dhcpcd_eth0="-R"
nameserver 208.67.222.222
nameserver 208.67.220.220
/etc/init.d/net.eth0 restartbind-tools. Thug an ordú dig níos mó eolais ná nslookup.dig www.opendns.com
; <<>> DiG 9.4.2-P2 <<>> www.opendns.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7419
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.opendns.com. IN A
;; ANSWER SECTION:
www.opendns.com. 30 IN A 208.67.219.101
;; Query time: 927 msec
;; SERVER: 208.67.220.220#53(208.67.220.220) <-- freastalaí OpenDNS
;; WHEN: Sat Nov 15 18:46:44 2008
;; MSG SIZE rcvd: 49 emerge dnsmasq
domain-needed # Never forward plain names
bogus-priv # Never forward addresses in the non-routed address spaces
no-resolv # Don't use /etc/resolv.conf
no-poll # Don't poll /etc/resolv.conf
server=208.67.222.222 # Forward to OpenDNS's servers
server=208.67.220.220
listen-address=127.0.0.1 # Listen and bind to only localhost
bind-interfaces
/etc/init.d/dnsmasq start
rc-update add dnsmasq defaultecho nameserver 127.0.0.1 > /etc/resolv.confdig www.opendns.com) faoi dhó, agus breathnaigh ar an líne ;; Query time: . An darna uair ba cheart do beagnach ar an toirt mar tá an eolas sa taisc cheana féin.ps -ef | grep dhcpcd. You should see /sbin/dhcpcd in the list.)bind-tools so that you will have dig. This isn't necessary for using OpenDNS, but it will make it easier to be certain that DNS is going to the correct servers.dhcpcd_eth0="-R"
config_eth0=( "dhcp" )
dhcp_eth0="nodns nontp nonis"
dhcpcd_eth0="-R"
nameserver 208.67.222.222
nameserver 208.67.220.220
/etc/init.d/net.eth0 restartbind-tools. The dig command will give you a little more information than nslookup.dig www.opendns.com
; <<>> DiG 9.4.2-P2 <<>> www.opendns.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7419
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.opendns.com. IN A
;; ANSWER SECTION:
www.opendns.com. 30 IN A 208.67.219.101
;; Query time: 927 msec
;; SERVER: 208.67.220.220#53(208.67.220.220) <-- OpenDNS server
;; WHEN: Sat Nov 15 18:46:44 2008
;; MSG SIZE rcvd: 49 emerge dnsmasq
Use the following configuration in /etc/dnsmasq.conf (courtesy of HostingFu)
domain-needed # Never forward plain names
bogus-priv # Never forward addresses in the non-routed address spaces
no-resolv # Don't use /etc/resolv.conf
no-poll # Don't poll /etc/resolv.conf
server=208.67.222.222 # Forward to OpenDNS's servers
server=208.67.220.220
listen-address=127.0.0.1 # Listen and bind to only localhost
bind-interfaces
/etc/init.d/dnsmasq start
rc-update add dnsmasq default
echo nameserver 127.0.0.1 > /etc/resolv.confdig www.opendns.com) twice in a row, and look for the ;; Query time: line. The second time it should be nearly instantaneous because the information is already in the cache.