小编Jam*_*ood的帖子

git:fatal:无法从远程存储库中读取

我正试图用http://danielmiessler.com/study/git/#website设置git 来管理我的网站.

我已经完成了说明的最后一步:git push website + master:refs/heads/master

我正在使用win7中的git ming32命令行

$ git push website +master:refs/heads/master
Bill@***.com's password:
Connection closed by 198.91.80.3
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

这里的一个问题可能是程序正在寻找Bill@***.com.当我通过ssh连接到我的网站时,我有一个不同的用户名(让我们说'abc').所以也许这应该是abc@***.com.如果是这样,我不知道如何改变这个或者我是否可以推动别名

git

311
推荐指数
15
解决办法
93万
查看次数

idris-mode – 缓冲区没有进程

我是 emacs 新手(来自 vim,我无法让 idris-vim 工作)并通过 el-get 安装这些软件包:

\n\n
ace-jump-mode         installed  A quick cursor location minor mode for emacs.\nel-get                installed  Manage the external elisp bits and pieces you depend upon.\nevil-leader           installed  Add <leader> shortcuts to Evil, the extensible vim        emulation layer\nevil-numbers          installed  Increment/decrement numbers in Evil, the extensible vim        emulation layer. Like C-a/C-x in vim.         After installation, you will need to add a key-binding for evil-numbers.        For example:         (define-key evil-normal-state-map (kbd "C-c +") \'evil-numbers/inc-at-pt)        (define-key evil-normal-state-map (kbd "C-c -") \'evil-numbers/dec-at-pt)\nevil-surround …
Run Code Online (Sandbox Code Playgroud)

emacs evil-mode idris

5
推荐指数
1
解决办法
1377
查看次数

为什么Haskell没有更强的替代Eq?

这里Set给出不是算子的原因.它似乎归结a == b && f a /= f b为可能的事实.那么,为什么Haskell没有标准替代Eq,类似于

class Eq a => StrongEq a where
    (===) :: a -> a -> Bool
    (/==) :: a -> a -> Bool
    x /== y = not (x === y)
    x === y = not (x /== y)
Run Code Online (Sandbox Code Playgroud)

哪些情况应该遵守法律

?a,b,f. not (a === b) || (f a === f b)
?a. a === a
?a,b. (a === b) == (b === a)
Run Code Online (Sandbox Code Playgroud)

还是其他一些人?然后我们可以:

instance StrongEq a …
Run Code Online (Sandbox Code Playgroud)

haskell functional-programming functor typeclass

4
推荐指数
3
解决办法
367
查看次数

根据定义,Idris证明

我可以写这个功能

powApply : Nat -> (a -> a) -> a -> a
powApply Z f = id
powApply (S k) f = f . powApply k f
Run Code Online (Sandbox Code Playgroud)

并且琐碎地证明:

powApplyZero : (f : _) -> (x : _) -> powApp Z f x = x
powApplyZero f x = Refl
Run Code Online (Sandbox Code Playgroud)

到现在为止还挺好.现在,我尝试概括此函数以使用负指数.当然,必须提供反向:

import Data.ZZ

-- Two functions, f and g, with a proof that g is an inverse of f
data Invertible : Type -> Type -> Type where
  MkInvertible : (f …
Run Code Online (Sandbox Code Playgroud)

proof idris

3
推荐指数
1
解决办法
228
查看次数

在此示例中,我可以确定IO操作的顺序吗?

目前,我有这个代码main:

import Control.Monad
import Control.Applicative

binSearch :: Ord a => [a] -> a -> Maybe Int

main = do
    xs <- lines <$> readFile "Cars1.txt"
    x <- getLine <* putStr "Registration: "  -- Right?
    putStrLn $ case binSearch xs x of
                    Just n -> "Found at position " ++ show n
                    Nothing -> "Not found"
Run Code Online (Sandbox Code Playgroud)

我希望打印"Registration:",然后让程序等待输入x.我所写的内容是否意味着会出现这种情况?我是否需要<*,或者将putStr表达放在上面的行中以使其工作正常?

PS:我知道我必须转换binSearch为使用数组而不是列表(否则它可能不值得进行二分查找),但这是另一天的问题.

io haskell lazy-evaluation

2
推荐指数
1
解决办法
83
查看次数

模式x*y中的解析错误(case语句)

我有这个代码:

module BalancedTwoDozenMultDrill where
import BalancedTwoDozenLib
myRandoms :: Int -> IO [Int]
myRandoms n = let x = 24^n `div` 2 in randomRs (-x,x) <$> getStdGen
drill :: [Int] -> IO ()
drill (x:y:rs) = do
    putStr $ showInt x ++ " × " ++ showInt y ++ " = "
    a <- getLine
    case a of
        "" -> return ()
        showInt (x * y) -> do   -- <= here
            putStrLn "Correct"
            drill rs
        _ -> do
            putStrLn $ "Wrong; …
Run Code Online (Sandbox Code Playgroud)

haskell syntax-error

1
推荐指数
1
解决办法
577
查看次数