Kubernetes Dashboard语言设置为英文
kubernetes dashborad是用来查看cluster各项指标的Web UI。但是直到目前依然不支持用户级别的语言设置。它默认根据浏览器的语言设置作为自己的界面语言,这样对于中文Chrome用户来说略有不便:k8s dashboard作为一个管理工具,由于需要中文反译回英文,严重影响了工作效率。感受一下中文界面:
kubernetes dashborad是用来查看cluster各项指标的Web UI。但是直到目前依然不支持用户级别的语言设置。它默认根据浏览器的语言设置作为自己的界面语言,这样对于中文Chrome用户来说略有不便:k8s dashboard作为一个管理工具,由于需要中文反译回英文,严重影响了工作效率。感受一下中文界面:
The error looks like this:
$ python test.py
Traceback (most recent call last):
File "test.py", line 3, in <module>
...
File "miniconda3/envs/torch/lib/python3.7/site-packages/apex/__init__.py", line 18, in <module>
from apex.interfaces import (ApexImplementation,
File "miniconda3/envs/torch/lib/python3.7/site-packages/apex/interfaces.py", line 10, in <module>
class ApexImplementation(object):
File "miniconda3/envs/torch/lib/python3.7/site-packages/apex/interfaces.py", line 14, in ApexImplementation
implements(IApex)
File "miniconda3/envs/torch/lib/python3.7/site-packages/zope/interface/declarations.py", line 483, in implements
raise TypeError(_ADVICE_ERROR % 'implementer')
TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead.
Refer to this issue: https://github.com/NVIDIA/apex/issues/116
Install the latest version resolved the issue:
pip uninstall apex
git clone https://www.github.com/nvidia/apex
cd apex
python setup.py install
A weird problem that execute "import torch" in bash works but when you run it in Jupyter notebook:
ImportError Traceback (most recent call last)
<ipython-input-4-8ba1970b60ce> in <module>
6 import random
7
----> 8 import torch
9 import torch.nn as nn
10
~/miniconda3/envs/tf/lib/python3.6/site-packages/torch/__init__.py in <module>
79 del _dl_flags
80
---> 81 from torch._C import *
82
83 __all__ += [name for name in dir(_C)
ImportError: dlopen: cannot load any more object with static TLS
RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED
When you encountered the above issue and Google it, you will find lots of discussions. Unfortunately, very rare of them are useful and work.
Actually, the root cause is pytorch/cuda/python compatibility issue.
When I use kubectl to deploy a service:
$ kubectl --kubeconfig=C:\Users\xxx\.kube\config apply -f deploy.yaml --namespace=xxx
a SchemeError
was raised: EXEC(0,0): Error : SchemaError(io.k8s.api.apps.v1beta1.RollingUpdateStatefulSetStrategy): invalid object doesn't have additional properties
I have encountered an issue: solution can be successfully built and run, but lots of classes in the VisualStudio are marked as red color by ReSharper. Clean and rebuild the solution doesn't work. Something like this: Everything compiles, but Resharper marks everything in red?
最近爬取几个页面总是失败,遇到如下错误:
# The HTTP request to the remote WebDriver server for URL http://localhost:xxx/ session timed out after 60 seconds.
后来发现原因是页面加载缓慢,debug发现页面其实已经在浏览器中成功渲染,只是还在等待一些后台javascript加载完毕,然后超时报错。
考虑到许多javascript都是广告、统计等一些附加内容,用selenium爬取页面时仅需要其中的html,无须等待所有javascript加载完毕。因此,想看看如何禁止ChromeDriver加载javascript,仅下载html。
搜了下"Selenium Disable JavaScript in ChromeDriver",发现了几种方案,最终用Page load strategy解决问题,小结一下各种方案的坑。
使用interface还是abstract class在许多地方都有讨论。但许多讨论更专注于术的层面,即二者在语法上的区别和细节差异,如Interface or abstract class? 中排名第二的回答。实际上,从逻辑抽象层次出发,选用interface或abstract class才是正道。
finisky博客 (https://finisky.azurewebsites.net) 本是搭在Azure App Service (WebApp),基于Hexo的静态页面博客在Azure App Service中使用IIS进行host。现在看起来没有太大必要host在Azure上,遂考虑迁移到GitHub Pages (https://finisky.github.io) 。
如果一个interface或abstract method的参数为基类形参,而有另一个类实现了该interface,但却使用了派生类形参,会发生什么?或者考虑另一种情况,一个interface或abstract method的返回值为基类对象,而它的实现返回的却是派生类对象,会发生什么?
这两个问题的答案是相同的,都是编译报错。想来有点费解,这不是违反SOLID原则中的里氏替换原则么?再仔细想想可以理解,此interface或abstract method的定义其实与实现它们的类本身是无关的,这些类对它的参数是否应为派生类的对象并不知晓。