我正在开发一个plone4网站,每个用户都有一个可排序的项目库存.ATFolder的folder_content视图非常适合这种情况.唯一的问题是,而不是像这样的URL:
/site/user/inventory
Run Code Online (Sandbox Code Playgroud)
或这个
/site/inventory/user
Run Code Online (Sandbox Code Playgroud)
网址应该是:
/site/inventory
Run Code Online (Sandbox Code Playgroud)
我想过几个解决方案,但每个人都有自己的疑虑.
你会怎么做?
谢谢.
我在Albums表上创建了一个简单的触发器.但是在触发器文件夹中的可编程性中,该触发器在对象资源管理器中不可见.我刷新了该文件夹,并重新启动了SSMS,但仍然没有运气.但是我可以在触发器文件夹中看到该表下的触发器.这是一个功能还是一个bug?
我正在使用SQL Server 2008.
有可能以某种方式简化界面吗?目标是为将要使用它的用户提供降噪的API.
一个例子可能是界面IFoo定义了25个方法,我只想向用户公开其中的5个,我将如何以巧妙和优雅的方式做到这一点?
我们最近更新了一个应用程序到Rails 3.0.4(在线开发服务器上的3.0.5).从2.3.10到3.0.4的大多数变化都是由于过时或过时的插件和宝石,并且相对容易解决.但有一件事让我发疯:
在开发模式下,每个Web请求都会导致服务器进程分配比以前多 50-60 MB的内存.请求后不释放此内存,至少不是全部内存.在10-20个请求之后,每个Ruby实例消耗超过500 MB的RAM,而我们以前的Rails 2.3.10实例很少超过200 MB.
这使得无法运行我们的1300次测试,因为在测试结束之前,开发了4GB的RAM.它只发生在开发模式中cache_classes = false.如果我将cache_classes切换为true,Rails实例将消耗大约200MB的内存,然后保留在那里.但是,在测试期间,即使cache_classes = true,内存使用量也会增加.
我查询了ObjectSpace并发现每次请求时,大约有3500个新的Proc,最多50'000个新的Strings和3000个新的Hashes和Arrays被创建并且没有被释放.这些字符串(转储时)包含我的整个源代码,包括插件和gem,文档,源代码注释和路径名.(为什么?)
为了找到原因,这是我尝试过的:(每次更改后,我都会使用ab -n 50.)
pg, rails, aasm, will_paginate, geokit-rails3, koala, omniauth, paperclip …我正在尝试创建一个构建步骤,Teamcity其中包含Artifact Dependency另一个构建步骤.
上一个构建步骤的工件可作为.zip文件使用.
构建步骤能够检索工件并将它们下载到:
C:\BuildAgent\work\27f84e3eca3a33d5\artifactdir\artifacts.zip
Run Code Online (Sandbox Code Playgroud)
显然,.zip文件对我来说没有多大用处,我需要对它们进行解压缩,以便构建步骤可以访问构建文件.
如何让TeamCity解压缩工件?
我正在尝试实现一些逻辑,当我创建主(父)线程时,执行其他几个线程.然后它等待子线程创建的某些条件.在条件满足后,父亲执行更多的子线程.我在使用wait/notify时遇到java.lang.IllegalMonitorStateException异常的问题.这是代码:
public class MyExecutor {
final static ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(10);
final static ExecutorService svc = Executors.newFixedThreadPool(1);
static final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5, 8, 10, TimeUnit.SECONDS, queue);
public static void main(String[] args) throws InterruptedException {
final MyExecutor me = new MyExecutor();
svc.execute(new Runnable() {
public void run() {
try {
System.out.println("Main Thread");
me.execute(threadPool, 1);
System.out.println("Main Thread waiting");
wait();
System.out.println("Main Thread notified");
me.execute(threadPool, 2);
Thread.sleep(100);
threadPool.shutdown();
threadPool.awaitTermination(20000, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
svc.shutdown();
svc.awaitTermination(10000, …Run Code Online (Sandbox Code Playgroud) 我有一条路线供我的用户使用/iGEL/contributions,效果很好.但现在用户注册的名称为'A.and.B.',现在路由无法匹配,因为名称包含点.
我的路线:
get "/:user/contributions" => 'users#contributions'
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
//如果登录正常,那么我们添加一个cookie
$_POST['user_name'] = stripslashes($_POST['user_name']);
$hour = time() + 3600;
setcookie(ID_my_site, $_POST['user_name'], $hour);
setcookie(Key_my_site, $_POST['password'], $hour);
Run Code Online (Sandbox Code Playgroud)
这是设置cookie的正确方法吗?它导致我严重的重定向错误.请参阅此处: PHP重定向子域的问题
我刚下载了新的xcode,3.2.6尝试使用新的sdk.我不想尝试使用Xcode 4,因为它需要一些我现在无法做到的学习曲线.我的新xcode的问题是我无法构建应用程序并将其安装到设备上.我尝试创建一个全新的项目,但xcode无法安装到我的设备中.这是日志,我不知道在阅读日志后我应该做些什么:
Ignoring packet error, continuing...
gdb stack trace at 'putpkt: write failed':
0 gdb-arm-apple-darwin 0x00190e1e remote_backtrace_self + 54?
1 gdb-arm-apple-darwin 0x00194236 putpkt_binary + 401?
2 gdb-arm-apple-darwin 0x00194933 remote_macosx_get_all_image_infos_addr + 45?
3 gdb-arm-apple-darwin 0x00199584 remote_macosx_complete_create_or_attach + 146?
4 gdb-arm-apple-darwin 0x00199d09 remote_macosx_create_inferior + 1273?
5 gdb-arm-apple-darwin 0x0006ffb1 run_command_1 + 660?
6 gdb-arm-apple-darwin 0x0012fc05 execute_command + 724?
7 gdb-arm-apple-darwin 0x0001c0cf mi_execute_async_cli_command + 226?
8 gdb-arm-apple-darwin 0x0001b6ec captured_mi_execute_command + 371?
9 gdb-arm-apple-darwin 0x00085c51 catch_exception + 65?
10 gdb-arm-apple-darwin 0x00018a4a mi_execute_command + 163?
11 …Run Code Online (Sandbox Code Playgroud)