Notepad ++是否支持非贪婪的正则表达式?
例如文字:
abcxadc
Run Code Online (Sandbox Code Playgroud)
我想用模式获取零件:
a.+c
Run Code Online (Sandbox Code Playgroud)
现在我得到整个字符串而不是2个部分.我试过用'?' 运营商但没有成功.
我有一个代码用于将我的应用程序资源更新为当前应用程序版本 应用程序更新后调用此代码.
int version = 1002; // current app version
switch(version)
{
case 1001:
updateTo1002();
goto case 1002;
case 1002:
updateTo1003();
goto case 1003;
case 1003:
updateTo1004();
goto case 1004;
break;
case 1004:
updateTo1005();
break;
}
Run Code Online (Sandbox Code Playgroud)
这里我们通过跳转到指定的case块来调用cascade方法.我想知道 - 在这种情况下,使用go(通常被视为这种不良做法!)是一种好习惯吗?我不想一个接一个地调用方法 - 像这样:
updateTo1002()
{
// do the job
updateTo1003();
}
updateTo1003()
{
// do the job
updateTo1004();
}
Run Code Online (Sandbox Code Playgroud)
有没有设计模式描述这样的问题?
我正在尝试使用<base> TAG来指示包含位于单独文件夹中的html页面的媒体文件的源文件夹.
我有以下文件夹结构:
A
|- HTML_PAGES (contains html files)
|- MEDIA_FOLDER (contains the media used by this html pages)
Run Code Online (Sandbox Code Playgroud)
我尝试用html页面使用的媒体来指示html文件 - 所以,在每个html文件中我有这样的东西:
<base href="../MEDIA_FOLDER"/>
Run Code Online (Sandbox Code Playgroud)
问题是:它适用于某些浏览器(Opera,Chrome),但它不适用于Internet Explorer和Firefox.如何使它与IE和Firefox一起使用?
我想创建NSIS安装程序,在安装过程中检查www是否有更新的应用程序版本(编号).如果网络中存在的版本比提供的安装程序版本更新,则安装程序应下载应用程序zip文件,将其解压缩并安装下载的应用程序,而不是随安装程序提供的应用程序.
问题是:
我有一个 XML 模式,里面有我的“video”元素和“youtube”元素:
<xs:element name="video">
<xs:complexType>
<xs:sequence>
<xs:element ref="youtube" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="file" type="xs:string"/>
</xs:complexType>
</xs:element>
Run Code Online (Sandbox Code Playgroud)
我想向可用的视频类型添加另一个元素“参数”:
<xs:element name="param">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
Run Code Online (Sandbox Code Playgroud)
我会在“youtube”旁边有“param”元素。
限制:
像这样:
<video>
<youtube file = "aaa"/>
<param name="a1" value"b1"/>
<param name="a2" value"b2"/>
</video>
Run Code Online (Sandbox Code Playgroud)
如何在此架构中维护此限制?
如果我做这样的事情:
<xs:sequence>
<xs:element ref="youtube" minOccurs="0" maxOccurs="1"/>
<xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
Run Code Online (Sandbox Code Playgroud)
如果序列是这样指定的
<xs:sequence>
<xs:element ref="youtube" minOccurs="0" maxOccurs="1"/>
<xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
Run Code Online (Sandbox Code Playgroud)
它确定 param …
调用MainForm线程的委托是一种好习惯 - 这种方式?:
Txt.MainForm.EndInvoke(
Txt.MainForm.BeginInvoke(
new MethodInvoker(delegate()
{ // code here }
)));
Run Code Online (Sandbox Code Playgroud) 可能重复:
C++比C#快多少?
你好!
在实际应用中,C#是否比C++更快(具有更好的性能)?
我听说泛型集合比stl具有显着的性能优势 - 这是真的吗?
用C#编写的本机代码(不安全块,引脚指针,Marshal ......)与C++本地编写的相同代码具有相同的性能吗?
我有进度表格,代表:
// in ProgressForm thread
public delegate void executeMethod(object parameters);
private executeMethod method;
public object parameters;
// ...
private void ProgressForm_Shown(object sender, EventArgs e)
{
method.Invoke(parameters);
}
Run Code Online (Sandbox Code Playgroud)
哪种方式更好(高效或安全)应用 - 匿名代表调用如下:
// in other thread
ProgressForm progress = new ProgressForm();
progress.ExecuteMethod = delegate
{
// to do
}
Run Code Online (Sandbox Code Playgroud)
或使用这样的单独方法:
// in other thread
private void myMethod(object par)
{
// to do
}
progress.ExecuteMethod = this.myMethod;
Run Code Online (Sandbox Code Playgroud) 我想知道如果#if
在我的代码中使用指令,如何编译我的代码.我想创建我的应用程序的特殊版本(商业演示版),我想限制我的应用程序的功能.我宁愿避免混淆,只是不想将我编译的所有代码都添加到可执行文件中.我需要解决方案拒绝在反汇编过程中预览我的代码.我可以使用#if
变量编译的指令代替禁用代码部分进行注释吗?
c# ×5
delegates ×2
notepad++ ×2
performance ×2
c++ ×1
compilation ×1
duplicates ×1
goto ×1
html ×1
nsis ×1
regex ×1
regex-greedy ×1
unzip ×1
xsd ×1