我正在寻找一个伪代码解决方案,实际上是多个背包问题(优化声明在页面的中间).我认为这个问题是NP Complete,因此解决方案不需要是最优的,而是如果它是相当有效且易于实现的,那将是好的.
问题是这样的:
我对阈值很灵活 - 它不需要严格应用,但应该接近.我的想法是将工作项分配到箱中,其中每个箱代表阈值的90%,80%,70%等等.然后,我可以将占90%的项目与占10%的项目相匹配,依此类推.
有更好的想法吗?
我的macbook上有一个SSH隧道设置,就像这样......
$ ssh -o ServerAliveInterval=3 -N -L 22222:gitosis-server:22 user@firewall.domain.com
所以我可以ssh到localhost:22222并最终将防火墙后面的gitosis服务器.
我创建了一个本地id_rsa.pub文件,将其复制到gitosis服务器(运行Centos5),然后使用...将其导入gitosis.
# sudo -H -u gitosis gitosis-initIt was successful as I can see the public key in /var/lib/gitosis/.ssh/authorized_keys.
Back on my macbook I setup a ~/.ssh/config file with the following...Host gitosis-server Hostname localhost HostKeyAlias gitosis-server.domain.com Port 22222所以...我认为这个命令应该有效......
$ git clone gitosis@gitosis-server:gitosis-admin.git然而,它不会因为它要求输入密码....当公钥应该工作时.
Initialized empty Git repository in /Users/USER/Development/gitrepo/gitosis-admin/.git/ gitosis@localhost's password:关于让git工作到防火墙后面的gitosis服务器的任何想法?
谢谢,
马特
编辑 - 从SSH尝试添加调试
我做了这个命令,'ssh -vvv gitosis @ gitosis-server'.我得到了一些调试,它似乎不喜欢我的身份.
debug2: key: /Users/USER/.ssh/id_rsa.gitosis (0x1019b0) debug1: Authentications …
我正在尝试使用org.apache.commons.lang中的StringEscapeUtils.escapeXML()函数...
该函数有两个版本,一个期望(Writer,String)和一个期望(String)....
我正在尝试使用只需要没有Writer的String参数的版本,但Java抱怨我没有给它一个Writer.
我如何在我的程序中使用它,以便我不需要Writer?
String escXml = StringEscapeUtils.escapeXml(attr.get());
xml = xml.concat("<"+attr.getID()+">"+escXml+"</"+attr.getID()+">");
Run Code Online (Sandbox Code Playgroud)
我也试过在字符串本身内联它.
xml = xml.concat("<"+attr.getID()+">"+StringEscapeUtils.escapeXml(attr.get())+"</"+attr.getID()+">");
Run Code Online (Sandbox Code Playgroud)
这两次尝试都给了我关于它期待Writer的错误.谁能帮我这个?
谢谢,马特