Online Judge Systems accepting Haskell
Online judge system is a good way to hone your problem solving skills and sharp your expressibility in specific languages. Back in school, I was always using C++98 as the main programming language for submission, but purely based on the reason that it is the main stream choice. Now, many years later, with the proliferation of online judge system, many niche or less popular languages are supported as well. And my favorite is Haskell. The problem is that most of the judge system does not keep up the speed of the growth of GHC, with their compilers used for judging not as the latest one. For example, Sphere Online Judge does support Haskell, but it only support ghc-7.6, and without haskell-platform installed.Codeforces has the similar issue since the last time I checked
Good news is, rennovated TIOJ is now support ghc-7.8.3 + Haskell Platform. I picked a dynamic programming problem and was judged without issue. Just it might be because it was run on an older machine, it is bit of slow. Otherwise, it did go very well.
My Program:
{-# LANGUAGE OverloadedStrings, MultiWayIf #-}
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Trans.Maybe
import qualified Data.ByteString.Char8 as B
import Data.Array.Unboxed
import Data.Array.MArray as MArray
import Data.Array.ST (runSTArray)
import Data.Char (digitToInt)
go :: ByteString -> Int -> Int -> Int
go s n =
let arr :: Array Int Int
arr = listArray (0, n) [f i | i <- [0 .. n]]
f :: Int -> Int
f i
| i <= 1 = 1
| otherwise =
let c1 = digitToInt $ B.index s (i-2)
c2 = digitToInt $ B.index s (i-1)
in if | c2 == 0 -> arr ! (i-2)
| (c1 == 1) || (c1 == 2 && c2 >= 1 && c2 <= 6) -> (arr ! (i-1)) + (arr ! (i-2))
| otherwise -> arr ! (i-1)
in \x -> arr ! x
solve :: ByteString -> Int
solve s =
let l = B.length s
in (go s l) l
main = runMaybeT $ forever $ do
s <- lift B.getLine
when (s == “0”) $ mzero
let sol = solve s
lift $ print sol
LG G Pad 8.3 の オペレーティング·システムをCyanogenmod に作る
日本語を勉強したから、専門的の文が日本語で書くのやってみます。文法は違うが多いと思います。しかし、練習すれば練習するほど、時間をかけて上手になる。
LG G Pad 8.3 を持っていたは一年があります。大体の使用は問題じゃない、 一つ迷惑な問題はSD CardがAndroidシステムに頻繁に見つけないでした。この悩んだ問題はLG提供されたのアップグレードで解決されない。それ以上、誰よりも知っているLGのアップデートが遅いでした。昨年十一月について、GoogleはAndroid Lollipopを発表した。私のNexus 4はLG G Padより一番OTA受け取った。Android Lollipopが好きでした。Android 4.2と比べも長い電池寿命がありました。だから、LG G Pad 8.3はAndroid Lollipopに搭載されたときめました。
Android向けカスタムROMとして最もメジャーはCyanogenmodですが、Cyanogenmod 12をAndroid Lollipopのシステムをとして決めました。しかし、インストは難しさがたくさんある。誰かも同じの問題を悩んだのため、ここで書きました。
まずは設定用の画面出てくるして、あなたのAndroidのバージョンを調べした。もしもあなたのバージョンはV50020D、システムをダワングレードする必要があります。理由はLGの更新がバグを修正するでした。アップデートを行うれば以下の操作が無効になった。わたしはV50010Cをダワングレードした。
Stock Firmwareを回復して,LG Flash Tool 2014を使用すればいい。この XDA Stock Firmware話し合いスレッドは説明でした。ただしStock Firmwareを見つける。
古いバージョンがインストールを確認したあと、Androidをroot化したは簡単な部分です。まずは、IORootをダウンロードした、プログラムを実行した。予期しないの意外がありませんなら、rootの権限が取得するでした。
次に、Flashifyをインストールする。このアプリケーションはリカバリーのソフトウェアの難易度が下げるでした。わたしはTeamWinをリカバリーとして選ぶんた。2.6.3.0のバージョンをインストールが必要があります。それよりもおおきなバージョンがダメです。ぞれバージョンはv510に作りました。もしも大きなバージョンをインストールでしたら、「Secure booting error! Cause: boot certification verify」のメッセージを起動時に表示された。
2.6.3.0のTWRPをインストール成功したあと、もたCyanogenmodを搭載したできない。このバージョンのTWRPはawifiのデバイスIDを検査して、コミュニティ作るのROMをインストールできない。Googleでv500-TWRP_2.6.3.2-recovery.zip検索して、デバイスIDがv500を目標された作るのTWRPをダワンロードしてください。zipファイルはSDカードにロードして、TWRPリカバリー起動して、リカバリーにあのv500-TWRP_2.6.3.2-recovery.zipをインストールしてください。adb shellでインストールの方法がダメです。理由が不明。
それでは、cm-12–20150128-NIGHTLY-v500.zipはCyanogenmodのウェブサイトからダワンロードしてください。同じのような、zipファイルはSDカードにロードして、TWRPリカバリーにzipファイルをインストールする。その後、Cyanogenmod 12を受け取るでした。
Google Appが欲しいなら、pa_gapps-modular-micro-5.0.1-RC2–20150125a-signed.zipを検索して、5.0.1のmodularバージョンをインストール。大体は同じの手順でした。