我在 Raspberry Pi 上设置了一个小型 Kubernetes 集群,目前由 1 个 Master 和 1 个 Worker 组成。我创建了一个简单的 NGINX 部署并为此创建了一个 NodePort 服务。我的 YAML 看起来像这样:
apiVersion: v1
kind: Service
metadata:
name: nginx-service
labels:
app: nginx
spec:
selector:
app: nginx
type: NodePort
ports:
- nodePort: 30333
port: 80
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.16.1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80 …Run Code Online (Sandbox Code Playgroud) 我最近向 WinForm 添加了一些图表,并使用实时数据进行更新。我的表单加载喜欢这样:
private void MyForm_Load (object sender, EventArgs e){
...bunch of code
//Waveforms
InitializeChartEKG();
InitializeSpO2WaveformChart();
InitializeEtCO2WaveformChart();
FillWaveformCharts();
}
Run Code Online (Sandbox Code Playgroud)
实时图表的创建方式如下:
public async void FillWaveformCharts() {
waveformData = AnesthWaveformDatas.CreateWaveformObjects(anestheticRecordNum);
Action action = () =>
FillChartEKG(waveformData);
Invoke(action);
action = () =>
FillChartSpO2(waveformData);
Invoke(action);
action = () =>
FillChartEtCO2(waveformData);
Invoke(action3);
}
Run Code Online (Sandbox Code Playgroud)
然后,在每个 FillChart 方法中,我更新 UI,以便表单不会冻结:
public async void FillChartEKG (List<AnesthWaveformData> waveformData) {
for (i = 0; i < waveformData.Count; i++){
...bunch of code that takes a long time to run...
UpdateUI(); //updates UI …Run Code Online (Sandbox Code Playgroud) 所以我不是一个非常有经验的Android程序员,所以请温柔地跟我:)
我正在尝试创建一个使用fragements的应用程序,并从其中一个片段中调用自定义对话框.
//create dialog
final Dialog dialog = new Dialog(getActivity());
dialog.setCancelable(false);
dialog.setContentView(R.layout.fragment_update_dialog);
//set up data in dialog here
Button bUpdate = (Button) dialog.findViewById(R.id.bDialogUpdate);
bUpdate.setOnClickListener(new OnClickListener()
{
//define onclick listener code here
});
dialog.show();
Run Code Online (Sandbox Code Playgroud)
这段代码工作正常,我没有任何问题.但是当屏幕方向改变时,我的对话框就会消失.
现在我已经阅读了这个论坛和其他地方的几个帖子,所以我理解为什么会发生这种情况,但我找不到解决方案来阻止它.
我已尝试使用清单文件的'技巧',但它不起作用.(也许是因为它在片段而不是活动?)
我的清单文件包括;
<activity
android:name="com.mycompany.myapp.MainActivity"
android:configChanges="keyboardHidden|orientation"
....
Run Code Online (Sandbox Code Playgroud)
在我的主要活动中
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
setContentView(R.layout.activity_main);
}
Run Code Online (Sandbox Code Playgroud)
但这不起作用.
我也看到很多评论说这不是推荐,但看不出如何解决这个问题.
谢谢你的帮助
我IsNumeric()在代码中使用函数来验证数字。
IsNumeric(100) - 真的,
IsNumeric(-100)- 真的,
IsNumeric(+100)- 真的,
IsNumeric(100-)-真的- 我对此有疑问。(100-) 这是一个有效的数字吗?IsNumeric() 这个值返回true。
Dim latitude As String = "12.56346-"
If IsNumeric(latitude) Then
If (Convert.ToDouble(latitude) >= -90 And Convert.ToDouble(latitude) <= 90) Then
isValidLatitude.Text = "true"
Else
isValidLatitude.Text = "false"
End If
Else
isValidLatitude.Text = "false"
End If
Run Code Online (Sandbox Code Playgroud)
转换latitude为双精度时出错
Input string was not in a correct format.
Run Code Online (Sandbox Code Playgroud) android ×1
c# ×1
customdialog ×1
kubernetes ×1
livecharts ×1
paint ×1
raspberry-pi ×1
vb.net ×1
winforms ×1