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
{- -*- coding: utf-8-unix -*- -} | |
module Q2357 | |
( ExtR2(..) | |
, ExtR3(..) | |
, ExtR5(..) | |
, ExtR7(..) | |
, Q2357 | |
, factor | |
, root2 |
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 qualified Data.ByteString.Char8 as C | |
chomp :: C.ByteString -> C.ByteString | |
chomp str = chompCRLF $ chompCRLF str | |
where chompCRLF s = | |
case C.unsnoc s of | |
Nothing -> s | |
Just (s_c, '\r') -> s_c |
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
%!PS-Adobe-3.0 | |
%%BoundingBox: 0 0 280 36 | |
%%HiResBoundingBox: 0.0 0.0 280.0 36.0 | |
%%CreationDate: Fri Jul 31 14:07:27 2015 | |
%%BeginProlog | |
/! { load def } def | |
/M/moveto !/RM/rmoveto !/G/glyphshow ! | |
%%EndProlog | |
%%BeginPageSetup | |
<</PageSize [280 36] /Margins [0 0] /PageOffset [0 0] /Orientation 0 >> setpagedevice |
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.Applicative | |
newtype A = A Integer deriving Show | |
newtype B = B Integer deriving Show | |
newtype C = C Integer deriving Show | |
k :: Applicative f => a -> f a | |
k = pure |
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
#!/bin/sh | |
cmd=$(cat <<EOF) | |
s/j/.i/g | |
s/i/.h/g | |
s/h/.g/g | |
s/g/.f/g | |
s/f/.e/g | |
s/e/.d/g | |
s/d/.c/g |
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
#!/bin/sh | |
cnt=`mktemp` | |
acc=`mktemp` | |
for c in a b c d e f g h i j ; do | |
echo -n $c >> $cnt ; cat $cnt >> $acc | |
done | |
wc -c < $acc |
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
#!/bin/sh | |
fn=`mktemp` | |
echo -n 'a' >> $fn | |
echo -n 'aa' >> $fn | |
echo -n 'aaa' >> $fn | |
echo -n 'aaaa' >> $fn | |
echo -n 'aaaaa' >> $fn | |
echo -n 'aaaaaa' >> $fn |
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
#!/bin/sh | |
echo -n 'aababcabcdabcdeabcdefabcdefgabcdefghabcdefghiabcdefghij' | wc -c |
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
#!/usr/bin/tail -1 | |
55 |
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
(defun format-time-string-with-locale-c (fmt) | |
(let ((system-time-locale "C")) (format-time-string fmt))) | |
(require 'ps-mode) | |
(defun ps-mode-update-creationdate () | |
(interactive nil) | |
(save-excursion | |
(goto-char (point-min)) | |
(and | |
(re-search-forward "^%%CreationDate: " nil t) |