magitの使い方の動画
magitの使い方の動画を作ってみました
magitのインストール
branchの作成
ファイルを編集してコミットする
差分の取り消し その1 全部取り消す
[
差分の取り消し その2 ファイル単位で取り消す
差分の取り消し その3 hunk単位で取り消す
リセットする
作業ブランチでの修正が完了したのでマージする
間違ってmasterでコミットしたものを作業ブランチにする
間違ってmasterでコミットしたものを作業ブランチにcherry-pick
リモートブランチにpushします
Project 26
p26 :: Integer -> Integer p26 n = p26_length 1 (div_2_5 n) where div_2_5 :: Integer -> Integer div_2_5 n | rem n 2 == 0 = div_2_5 (div n 2) | rem n 5 == 0 = div_2_5 (div n 5) | otherwise = n p26_length :: Integer -> Integer -> Integer p26_length len x | rem d x == 0 = 0 | rem d x == 1 = len | otherwise = p26_length (len+1) x where d = product $ take (fromIntegral len) $ repeat 10 fst $ maximumBy (\a b -> (compare (snd a) (snd b))) $ map (\x -> (x, p26 x)) [1..1000]
Project 25
1 + (snd $ head $ dropWhile (\pair -> (length (show (fst pair))) < 1000) $ zip fib [1..])
Problem 30
p30_limit x n | logBase 10 (x * n) > n = p30_limit x (n+1) | otherwise = n p30 n = sum $ filter (\x -> x /= 1 && x == (sum $ map (\y -> y ^ n) $ split_s_to_i $ show x)) $ [1..(product $ take (fromIntegral (truncate $ p30_limit (9^n) 1)) $ repeat 10)] p30 5
Problem 29
length $ unique $ sort $ [a ^ b | a <- [2..100], b <- [2..100]]
Problem 28
p28 :: Integer -> Integer p28 limit = 1 + (sum $ concat $ map (\x -> p28' limit 1 x) [2,4,6,8]) where p28' limit a b = takeWhile (\x -> x <= limit) $ p28'' a b p28'' a b = (a+b) : p28'' (a+b) (b+8) 669171001
Problem 24
p24 :: [a] -> Int -> [a] p24 [] _ = [] p24 [x] 0 = [x] p24 list nth = x : p24 next_list remain where len = length list p = product [1..(len-1)] (q, remain) = divMod nth p (x, next_list) = p24' list q p24' list n = (x, remain) where x = last $ take (n+1) list remain = (take n list) ++ (reverse $ take (length list - n - 1) $ reverse list) concat $ map show $ p24 [0..9] (1000000-1)