硬件:Okuma OSP-P200L
API版本:1.15.0.0
如何读取和写入公共变量的值?
我在帮助文件中找到了示例代码,但没有解释如何设置当前子系统.我也很困惑AddCommonVariableValue()和之间的区别SetCommonVariableValue().有人可以给出明确的例子/解释吗?
=== GET ===
Me.varValue.Text = objVariables.GetCommonVariableValue(CInt(Me.varCommonVarNumber.Text))
=== SET ===
objVariables.SetCommonVariableValue(CInt(Me.varCommonVarNumber.Text), Dbl(Me.varValueUpdate.Text))
我试图用二进制索引树在UVA中解决这个问题:
Problem H
Ahoy, Pirates!
Input: Standard Input
Output: Standard Output
In the ancient pirate ages, the Pirate Land was divided into two teams of pirates,
namely, the Buccaneer and the Barbary pirates. Each pirate’s team was not fixed,
sometimes the opponent pirates attacked and he was taken away to the other pirate team.
All on a sudden a magician appeared in the Pirate Land, where he was making transition
of pirates from their team to other team …Run Code Online (Sandbox Code Playgroud) 我的 VB.NET (2010) 项目中有一个 DLL:TwinCAT.Ads.dll[有包含],它有自己的依赖项:TcAds.dll[在我的项目中没有包含任何地方],它不是.NET 程序集。
我让编译器TcAds.dll通过将它作为现有项目添加到我的项目中来确保它在编译时吐到 bin 输出文件夹中,然后将它的构建操作设置为“嵌入式资源”并将其设置为始终复制到输出目录。
现在我已经准备好发布了,我已经制作了一个 Windows 安装项目。
请不要建议使用 WIX 或其他任何东西,这就是我必须使用的。
问题是这个 DLL 的弃儿不会作为依赖项出现,因此不会包含在安装程序中。安装后,程序运行,找不到DLL,炸了。
当然必须有一种简单的方法来确保您想要的任何文件都包含在安装目录中?
我来自 as3 环境,所以我是 dart 和 HTML 的大初学者。
我有这个变量
var symbols = [
{"name":"first",
"num":[2,2,3]
}];
Run Code Online (Sandbox Code Playgroud)
我想访问 num 数组并将其保存到变量中,我尝试这样做:
var symbol = symbols[0];
var num = symbol.num;
Run Code Online (Sandbox Code Playgroud)
我得到
Breaking on exception: Class '_LinkedHashMap' has no instance getter 'num'.
Run Code Online (Sandbox Code Playgroud)
你能帮我吗?
我正在尝试使用XAML创建一个带有黑色x的红色圆圈.
我的问题是他们没有正确对齐.
这样做的正确方法是什么?
这是我到目前为止所得到的:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image>
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Red">
<GeometryDrawing.Pen>
<Pen Brush="Transparent" Thickness="0"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<EllipseGeometry Center="8,8" RadiusX="8" RadiusY="8"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen Brush="Black" Thickness="2.5"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<PathGeometry>
<PathFigure StartPoint="4,4">
<LineSegment Point="12,12"/>
</PathFigure>
<PathFigure StartPoint="4,12">
<LineSegment Point="12,4"/>
</PathFigure>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Grid>
Run Code Online (Sandbox Code Playgroud)
简单地将椭圆放在具有黑色X的相同网格中,X在椭圆上并不完全居中,因为您绘制的每条线的坐标实际上是为其分配的空间内的坐标.
我认为他们需要处于某种几何形状或绘制聚合体以给它们相同的坐标系.几何组和路径是聚合器,但两者都要求其内容具有相同的填充和描边,并且红色圆圈(无笔划)和黑色X(无填充)的笔划和填充不同.
唯一的聚合器,它提供了常见的坐标系,并允许我找到的成员的不同填充和笔画是DrawingGroup.
用于通过其Data属性创建Path的字符串快捷方式似乎不适用于创建PathGeometry,因此所有这些都必须手动填充.
参考:Ookii.Dialogs.Wpf.VistaOpenFileDialog:
我正在尝试像这样设置 Ookii 的 VistaOpenFileDialog 初始目录:
VistaOpenFileDialog vfb = new VistaOpenFileDialog();
vfb.Multiselect = true;
vfb.Title = "pouet";
vfb.RestoreDirectory = false;
vfb.InitialDirectory = @"C:\Users\";
if (vfb.ShowDialog() ?? false)
{
this.Dispatcher.Invoke(DispatcherPriority.Send, new Action(delegate
{
for (var i = 0; i < vfb.FileNames.Length; i++)
{
FileDisplay.Add(vfb.FileNames[i]);
}
}));
}
}
private void AddFiles_Click(object sender, RoutedEventArgs e)
{
t = new Thread(new ThreadStart(AddFileDialog));
t.SetApartmentState(ApartmentState.STA);
t.Start();
}
Run Code Online (Sandbox Code Playgroud)
但是无论我尝试什么都不起作用,对话框一开始永远不会被初始目录打开,也永远不会被初始目录重新打开。我仍然可以毫无问题地选择文件夹的文件。
我已经尝试了以下(作为测试):
vfb.InitialDirectory = @"C:\Users\";
vfb.InitialDirectory = "C:\\Users\\";
vfb.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop).ToString();
Run Code Online (Sandbox Code Playgroud)
也试过 restoredirectory true 或 false …
我尝试在现有项目的用户控件中创建路由事件,但收到错误消息 The event 'foo' is not a RoutedEvent.
为了确保我没有疯,我制作了一个示例项目,其中仅包含有问题的代码(一个最小、完整和可验证的示例”)。
只有我在示例项目中没有收到任何错误消息。但这是完全相同的代码!
即使有错误消息,项目也会编译并且 RoutedEvent 工作!
我尝试清理项目、重建、重新启动 VS 和我的 PC,但无论我做什么,此错误消息仍然存在。
我相信这只是一个 IDE 问题。
我使用的是 Microsoft Visual Studio Professional 2015 版本 14.0.25431.01 更新 3
namespace Okuma_FFP
{
using System.Windows;
using System.Windows.Controls;
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
RaiseEvent(new RoutedEventArgs(fooEvent, this));
}
public static readonly RoutedEvent fooEvent = EventManager.RegisterRoutedEvent(
"foo", RoutingStrategy.Direct, typeof(RoutedEventHandler), typeof(UserControl1));
// Provide CLR accessors for the event
public event RoutedEventHandler foo …Run Code Online (Sandbox Code Playgroud) 我有几个表,我想以一种尊重和说明他们的关系的方式添加大约10行数据.
如何将种子数据(虚拟数据)添加到应用程序的开发数据库进行测试?
我希望有人能指出我这样做的铁路友好方法.
有没有一种简单的方法在每个表透视控制器中制作CRUD方法?
我在WEKA中使用SMOTE过滤器来平衡数据.
我怀疑这两个参数nearestNeighbors和percentage.
nearestNeighbors - 要使用的最近邻居数.
percentage - 要创建的SMOTE实例的百分比.
我应该怎么设置它们?
我认为邻居的数量是它要创建的同步样本的数量.
那么百分比的含义是什么?它应该小于或等于邻居的数量,对吧?是否考虑了合成样本的百分比?
例如:
如果我把10个邻居和200%会发生什么?
谁能给我一些正确使用的例子?
我需要打开一个本地 .HTM 文件并导航到特定的锚点名称。
在这种情况下,它是一个包含 1,000 多个警报/锚点的警报信息文件。
在我的测试示例(下面的完整代码)中,Uri 片段没有进入浏览器。
我尝试了其他创建超链接的方法,但这是我所能得到的。
<Window x:Class="HyperlinkWithPageAnchor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="100" Width="200">
<Grid>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
<Hyperlink NavigateUri="{Binding HyperlinkNavUri}" RequestNavigate="Hyperlink_RequestNavigate">
<TextBlock Text="Link Text"/>
</Hyperlink>
</TextBlock>
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)
namespace HyperlinkWithPageAnchor
{
using System;
using System.Windows;
using System.ComponentModel;
using System.Windows.Navigation;
public partial class MainWindow : Window, INotifyPropertyChanged
{
private Uri _hyperlinkNavUri;
public Uri HyperlinkNavUri
{
get { return _hyperlinkNavUri; }
set { _hyperlinkNavUri = value; OnPropertyChanged(nameof(HyperlinkNavUri)); }
}
public MainWindow()
{
InitializeComponent(); DataContext = this; …Run Code Online (Sandbox Code Playgroud) wpf ×3
c# ×2
xaml ×2
algorithm ×1
api ×1
dart ×1
data-mining ×1
dependencies ×1
dialog ×1
dll ×1
fenwick-tree ×1
get ×1
hyperlink ×1
okuma ×1
sample-data ×1
seeding ×1
set ×1
variables ×1
weka ×1