如何计算包含字符串"A*"的单元格数量 - 而不将星形视为通配符?
我在尝试恢复从另一台机器上获取的svn存储库时遇到错误.错误是
svnadmin:转储流包含格式错误的标题(没有':')
转储是在subversion 1.5服务器上创建的,我正在加载到新的subversion 1.6服务器.我能够成功地将其他几个存储库加载到新服务器.新服务器是VisualSVN Server.
有什么内置的Django模板,可以让我比较两个值吗?与ifequal相似.
如果不是 - 对此最好的解决方案是什么?
我可以在这里使用一些帮助.我正在使用它来修复我的URL,但我无法弄清楚如何删除.php扩展名.URL现在看起来像这样:http://mydomain.com/page.php/foo/123/bar/456
function decode_URL_parameters() {
$path = @$_SERVER['PATH_INFO'];
$url_array=explode('/',$path);
array_shift($url_array);
while ($url_array) {
$_GET[$url_array[0]] = $url_array[1];
array_shift($url_array);
array_shift($url_array);
}
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
/托比亚斯
public class A { //some fields (may not only primitive types) and methods here}
public class B {// some fields (may not only primitive types) and methods here, may also have a class A reference }
Run Code Online (Sandbox Code Playgroud)
问题如下:
public class Test{
public static void main(String[] args){
A a = new A();//1. it will allocate memory for one object of A and a is the reference points to that space?
ArrayList<B> bList = new ArrayList<B>(10);//2. it will allocate memory for 10 objects …Run Code Online (Sandbox Code Playgroud) 假设我想将标识服务器的对象放入stl中set.然后我必须确保我也operator<为这些对象实现,否则我会遇到编译器错误:
struct ServerID
{
std::string name; // name of the server
int port;
};
std::set<ServerID> servers; // compiler error, no operator< defined
Run Code Online (Sandbox Code Playgroud)
这只是我想要使对象具有可比性的常见问题的一个例子.
我目前的解决方案通常是这样的:
bool operator< (const ServerID & lhs, const ServerID & rhs)
{
if (lhs.name != rhs.name)
{
return lhs.name < rhs.name;
}
else
{
return lhs.port < rhs.port;
}
}
Run Code Online (Sandbox Code Playgroud)
这只是我发现自己的解决方案.但我怀疑这个问题也可能在计算机科学中得到认可.所以,如果我很幸运,有一个更好的解决方案.任何人都可以向我暗示吗?
所以我们使用Log4j这样的J2EE应用程序
public class CustomerController
{
private static Logger logger = Logger.getLogger(CustomerController.class);
public CustomerService customerservice = null;
public CustomerController() throws Exception
{
PropertyConfigurator.configureAndWatch("c:\log4j.property", 50000);
customerservice = ServiceManagerSingleton.getCustomerServiceInstance();
}
}
Run Code Online (Sandbox Code Playgroud)
这样我们就可以改变日志级别的实时性.非常便利.我们的大多数类都像这个控制器一样设置.我们使用单例模式,这样我们只有一个eash类的实例; 一次调用每个类的PropertyConfigurator.configureAndWatch().
问题:我们的appserver每周大约两次死亡并创建一个堆转储.使用IBM的Heap Analyzer我们可以看到似乎有很多与Log4j相关的线程:
808 (0%) [200] 9 org/apache/log4j/PropertyWatchdog 0x14282ad8
Run Code Online (Sandbox Code Playgroud)
总共约30,000.所以这可能是突然崩溃的原因.
有没有快速的方法来获取与特定文件扩展名相关联的ImageFormat对象?我正在寻找比每种格式更快的字符串比较.
我正在与我的程序员谈论继承及其在设计模型中的用法.他是一个很大的支持者,我有点不温不火.主要是因为我倾向于从下到上设计系统:数据库 - >应用程序 - >演示文稿(老实说,我不是一个前端人员,所以我经常将演示文稿完全留给其他人).我发现关系数据库系统不支持继承而没有与其他表的很多一对一关系.
如果我从概念角度进行设计,则管理员是用户是个人.从数据库开始,管理员是UserType ="Administrator"的用户.调和这些方法对我来说似乎很难,因此我只使用非持久对象的继承.
我的想法有什么问题?如果它与传统的关系结构具有这些固有的不兼容性,为什么继承这样一个着名的OO方面呢?或者,是不是我没有正确地将继承映射到关系数据?那里有一些指导可能会为我解决这个问题吗?
对于漫无边际的问题感到抱歉,并提前感谢您的回答.如果在响应中包含代码,则C#是我的"本地语言".