我有这样的字符串:
00123_MassFlow
0022245_VOlumeFlow
122_447_Temperature
Run Code Online (Sandbox Code Playgroud)
我必须_使用C#拆分这些字符串._可能会出现多个地方,但我必须采取最后的价值.
我应该是这样的:
MassFlow
VOlumeFlow
Temperature
Run Code Online (Sandbox Code Playgroud)
我怎么能做到这一点?
当我调用这个自定义函数时
$.fn.inputBoxHelper = function () {
var args = arguments[0] || {};
var matchingElem = $.grep(this, function (e) { return $(e).val() == $(e).attr('title'); });
$(matchingElem).addClass(args.className);
this.bind({
focus: function(){
if ($(this).val().trim() == $(this).attr('title')) { $(this).val(emptyString).removeClass('gray'); }
},
blur: function(){
if ($(this).val().trim() == emptyString) { $(this).val($(this).attr('title')).addClass('gray'); }
}
});
return this;
}
Run Code Online (Sandbox Code Playgroud)
像这样
$('input:text').inputBoxHelper({ className: 'gray' });
Run Code Online (Sandbox Code Playgroud)
当我打电话给它时,它给了我错误
$("input:text,input:checkbox").inputBoxHelper is not a function
file:///D:/repository/scripts/script_tests/test.js
Line 20
Run Code Online (Sandbox Code Playgroud)
即使我将功能更改为just
$.fn.inputBoxHelper = function () {return this;}
Run Code Online (Sandbox Code Playgroud)
它做了同样的事情.它似乎运行正常并且正常工作,因为所有功能都在输入框上工作,但是会出错.有人有主意吗?
假设我有下表:
CREATE TABLE Employees
(
EmployeeId int PRIMARY KEY NOT NULL,
ParentEmployeId int REFERENCES Employees(EmployeeId) NULL,
Name varChar(255)
)
Run Code Online (Sandbox Code Playgroud)
所有记录都有主要标识符,记录能够将另一条记录标识为父级.(我的实际架构不是关于员工,这只是一个简化的插图版本,所以如果你有一个更好的方式处理员工信息,它与这个对话没有密切关系.)
插入以下记录:
INSERT INTO Employees VALUES (1, NULL, 'Company President 1')
INSERT INTO Employees VALUES (2, NULL, 'Company President 2')
INSERT INTO Employees VALUES (3, 1, 'Company President 1 - VP')
INSERT INTO Employees VALUES (4, 2, 'Company President 2 - VP')
INSERT INTO Employees VALUES (5, 3, 'Company President 1 - VP - Secretary')
INSERT INTO Employees VALUES (6, …Run Code Online (Sandbox Code Playgroud) 我想创建NSIS安装程序,在安装过程中检查www是否有更新的应用程序版本(编号).如果网络中存在的版本比提供的安装程序版本更新,则安装程序应下载应用程序zip文件,将其解压缩并安装下载的应用程序,而不是随安装程序提供的应用程序.
问题是:
我担心这将是一个荒谬的愚蠢问题,你或许可以告诉网络不是我的强项,但我怎样才能找到我目前连接的多播地址?
我得到了一个应用程序,它可以侦听一个在一台计算机上运行正常的多播地址,但是会在另一台计算机上抛出SocketExceptions.
我为这个问题的模糊和愚蠢道歉,但任何建议都非常感谢.:)
中号
我在网上搜索.我尝试过颜色主题(也许我需要创建自己的颜色主题,但实际上我的emacs设置方式我想要它除了这一件事,我找不到一个我能接受的颜色主题).
我只想在dired-mode中更改目录的颜色.我在.emacs中更改了几种自定义颜色,例如:
(set-face-foreground 'font-lock-comment-face "yellow" )
Run Code Online (Sandbox Code Playgroud)
但我只是不知道在dired模式下目录要改变什么面.
有人可以帮忙吗?
谢谢!
由于某些原因,我序列化一个类型(f#):
type JsonKeyValuePair<'T, 'S> = {
[<DataMember>]
mutable key : 'T
[<DataMember>]
mutable value : 'S
}
let printJson() =
use stream = new MemoryStream()
use reader = new System.IO.StreamReader(stream)
let o = {key = "a"; value = 1 }
let jsonSerializer = Json.DataContractJsonSerializer(typeof<TestGrounds.JsonKeyValuePair<string, int>>)
jsonSerializer.WriteObject (stream , o)
stream.Seek(int64 0, SeekOrigin.Begin) |> ignore
printfn <| Printf.TextWriterFormat<unit>(reader.ReadToEnd())
()
Run Code Online (Sandbox Code Playgroud)
它生成一个字符串:
{ "键@": "一", "值@":1}
如果我尝试在没有@符号的情况下反序列化它:
let deserialize() =
let json = "{\"key\":\"b\",\"value\":2}"
let o = deserializeString<TestGrounds.JsonKeyValuePair<string, int>> json
()
Run Code Online (Sandbox Code Playgroud)
{"数据协定类型'TestGrounds.JsonKeyValuePair`2 [[System.String,mscorlib,Version …
我有一个哈德森构建服务器.源代码由git存储库管理.对于每个构建,都会检出并编译最新版本.现在我想告诉hudson不要使用最新版本,而是使用旧版本的代码(由我指定).
在哈德森,我有两个可以设置的参数.第一个"存储库名称",默认值为"origin",第二个refspec为value +refs/heads/*:refs/remotes/origin/*.我尝试了类似origin/[commitid]或类似的东西+refs/heads/*:refs/remotes/origin/[commitid].但没有任何工作按预期.
我想我必须使用参数化作业,以便我可以将提交作为参数提供给作业.
我如何告诉hudson使用特定的提交而不是最新的提交?
我要问并回答这个问题,因为我花了很长时间才弄明白,我希望答案一直在这里开始.
问题:一个长时间运行的unixODBC查询阻止来自同一个应用程序的所有其他查询.
问题是:如何阻止这种情况发生.