小编Cof*_*tle的帖子

如何在 nim 中处理 Ctrl-C 中断?

如果我在程序运行时按 Ctrl-C,它会退出并打印SIGINT: Interrupted by Ctrl-C.

如何在 Linux 上的 Nim 中忽略 Ctrl-C 中断?提前致谢。

nim-lang

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

如何在 Haskell 中与 Data.Text 进行模式匹配?

我目前正在用 Haskell 编写解析器。我有以下代码。

{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}

module Main where

import Data.Text

newtype Parser a = Parser { runParser :: Text -> Either Text (Text, a) }

char1 :: Char -> Parser Char
char1 c = Parser $ \case
    (x:xs) | x == c -> Right (xs, x)
    _               -> Left "Unexpected character"
Run Code Online (Sandbox Code Playgroud)

它无法编译这两个错误。

test.hs:12:6: error:
    • Couldn't match expected type ‘Text’ with actual type ‘[Char]’
    • In the pattern: x : xs
      In a case …
Run Code Online (Sandbox Code Playgroud)

parsing haskell

5
推荐指数
2
解决办法
164
查看次数

为什么我无法在 minikube 中启用 ingress?

我正在尝试在 minkube 中启用 ingress。当我运行时,minikube addons enable ingress它会挂起一段时间,然后收到以下错误消息:

\n
\xe2\x9d\x8c  Exiting due to MK_ADDON_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.19.15/kubectl apply -f /etc/kubernetes/addons/ingress-deploy.yaml: Process exited with status 1\nstdout:\nnamespace/ingress-nginx unchanged\nserviceaccount/ingress-nginx unchanged\nconfigmap/ingress-nginx-controller unchanged\nconfigmap/tcp-services unchanged\nconfigmap/udp-services unchanged\nclusterrole.rbac.authorization.k8s.io/ingress-nginx unchanged\nclusterrolebinding.rbac.authorization.k8s.io/ingress-nginx unchanged\nrole.rbac.authorization.k8s.io/ingress-nginx unchanged\nrolebinding.rbac.authorization.k8s.io/ingress-nginx unchanged\nservice/ingress-nginx-controller-admission unchanged\n\nstderr:\nerror: error validating "/etc/kubernetes/addons/ingress-deploy.yaml": error validating data: [ValidationError(Service.spec): unknown field "ipFamilies" in io.k8s.api.core.v1.ServiceSpec, ValidationError(Service.spec): unknown field "ipFamilyPolicy" in io.k8s.api.core.v1.ServiceSpec]; if you choose to ignore these errors, turn validation off with --validate=false\n waiting for app.kubernetes.io/name=ingress-nginx pods: timed out waiting for the condition]\n\n\xe2\x95\xad\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x95\xae\n\xe2\x94\x82 …
Run Code Online (Sandbox Code Playgroud)

kubernetes minikube kubernetes-ingress

5
推荐指数
2
解决办法
8880
查看次数