问题列表 - 第13129页

如何获取用户Mac的图标?

使用Objective-C和Cocoa,有没有人知道如何获取用户计算机的图标(在Finder中的"设备"和"网络"下显示的图标)?不是硬盘图标,是用户设备的实际图标.它的范围从MacBook图标到Mac Pro图标到Windows蓝屏死机监视器图标.

我尝试过以下几行:

NSImage *icon = [[NSWorkspace sharedWorkspace] 
                  iconForFileType: NSFileTypeForHFSTypeCode(kComputerIcon)];
Run Code Online (Sandbox Code Playgroud)

但显然,这只是一直返回相同的图标.我也尝试过该iconForFile:方法,但我不知道要用作参数的文件路径.任何人都能指出我正确的方向吗?

cocoa icons objective-c nsimage

12
推荐指数
3
解决办法
6602
查看次数

如何使用Jquery包含?

我正在查看包含选择器的jquery站点.

$("div:contains('John')").css("text-decoration", "underline");
Run Code Online (Sandbox Code Playgroud)

我怎样才能这样做,它需要一个非硬编码的值?我试着这样做

$("div:contains(" + name + ")") 
Run Code Online (Sandbox Code Playgroud)

但这似乎不起作用,而且非常混乱.我可能只是缺少一些支具或东西但是有一种干净的方式可行吗?因为即使我下次我必须扩展它,这将是同样的问题,因为有这么多的连接和东西.

jquery

5
推荐指数
2
解决办法
3151
查看次数

SetJmp/LongJmp:为什么这会引发段错?

以下代码总结了我目前遇到的问题.我当前的执行流程如下,我在GCC 4.3中运行.

jmp_buf a_buf;
jmp_buf b_buf;

void b_helper()
{
    printf("entering b_helper");
    if(setjmp(b_buf) == 0)
    {
        printf("longjmping to a_buf");
        longjmp(a_buf, 1);
    }
    printf("returning from b_helper");
    return; //segfaults right here
}
void b()
{
    b_helper();
}
void a()
{
    printf("setjmping a_buf");
    if(setjmp(a_buf) == 0)
    {
        printf("calling b");
        b();
    }
    printf("longjmping to b_buf");
    longjmp(b_buf, 1);
}
int main()
{
    a();
}
Run Code Online (Sandbox Code Playgroud)

上述执行流程在b_helper返回后立即创建段错误.它几乎就像只有b_helper堆栈帧有效,并且它下面的堆栈被擦除.

任何人都可以解释为什么会这样吗?我猜这是一个GCC优化,它正在擦除未使用的堆栈帧或其他东西.

谢谢.

c++ gcc g++ segmentation-fault

7
推荐指数
2
解决办法
3870
查看次数

一次两个迭代器?

我经常代表和处理折线,如下所示:

typedef std::vector< Point_t > Polyline_t;

double PolylineLength(const Polyline_t& line)
{
    double len = 0.0;
    for( size_t i = 0; i < line.size()-1; ++i )
        len += (line[i+1]-line[i+0]).length();
    return len;
}
Run Code Online (Sandbox Code Playgroud)

我提出的最直接的双向迭代器转换是:

typedef std::list< Point_t > Polyline_t;
typedef Polyline_t::const_iterator Polyline_t_cit;

double PolylineLength(const Polyline_t& line)
{
    double len = 0.0;
    Polyline_t_cit last = line.end();
    last--;
    for( Polyline_t_cit i = line.begin(); i != last; ++i )
    {
        const Point_t& beg = *i;
        const Point_T& end = *(++i);
        len += (end - beg).length(); …
Run Code Online (Sandbox Code Playgroud)

c++ containers iterator

0
推荐指数
1
解决办法
213
查看次数

如何在Postmodern中使用Lispworks comm包进行SSL访问而不是cl + ssl

在XP上,我想在Lispworks中使用Postmodern通过SSL在服务器上使用数据库.

看起来CL + SSL在设置单边SSL连接时存在问题.Lispworks工作正常.有没有办法让Postmodern使用Lispworks设置的套接字而不是CL + SSL设置的套接字?或者是否有可以单方面连接的CL + SSL版本?

lisp ssl common-lisp

6
推荐指数
1
解决办法
241
查看次数

有没有办法在Flex中格式化String

有可能做这样的事情:

var s:String = format("%20d %-10s %s", time, type, message);
Run Code Online (Sandbox Code Playgroud)

在C,C++,C#,Python和Perl等语言中,有类似于我的例子,但我似乎无法为Flex找到它.

我不想为我要格式化的每个字符串创建特殊的类Formatter.

apache-flex string format

11
推荐指数
2
解决办法
1万
查看次数

安腾程序集编程资源?

是否有任何好的Itanium汇编语言教程?

c architecture assembly itanium

6
推荐指数
1
解决办法
1073
查看次数

Spring Security子线程上下文

所以我正在使用Spring Security处理这个Spring MVC应用程序.在我的控制器花费太长时间响应的某些情况下,我一直遇到性能问题.这是由于一种处理方法,可以根据一些用户输入处理大量数据.

现在我和我的团队一直在调整代码和处理方法,我不认为我们可以在没有切片并异步执行每个切片的情况下获得更好的性能.

问题是当我尝试将它分割并将工作分发给子线程时,使用来自java.util.concurrent的线程池,当执行这些时,我得到有关安全上下文的错误消息.

这是stacktrace的摘录:

Exception in thread "pool-1-thread-3" org.springframework.security.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
    at org.springframework.security.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:342)
    at org.springframework.security.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:254)
    at org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:63)
Exception in thread "pool-1-thread-4"   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy63.batchSaveCampaignpayment(Unknown Source)
    at com.fim.pnp.controller.PaymentForm$1.run(PaymentForm.java:224)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    at java.lang.Thread.run(Thread.java:595)
org.springframework.security.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
    at org.springframework.security.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:342)
    at org.springframework.security.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:254)
    at org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:63)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy63.batchSaveCampaignPayment(Unknown Source)
    at com.fim.pnp.controller.PaymentForm$1.run(PaymentForm.java:224)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) …
Run Code Online (Sandbox Code Playgroud)

java multithreading spring-security

6
推荐指数
1
解决办法
4271
查看次数

在Visual C#2008 Express Edition中设置32位x86构建目标?

我正在构建一个加载32位COM dll的C#应用​​程序.编译的应用程序在32位Windows上正常运行,但在64位Windows上运行barfs,因为它无法加载32位COM.有没有办法在VC#2008 Express Edition中设置32位构建目标?

或者,有没有办法强制编译到AnyCPU构建目标的.NET应用程序在64位Windows上以32位模式运行?

c# com 32-bit visual-studio-2008

10
推荐指数
2
解决办法
3万
查看次数

active_scaffold路由错误

如果你昨天没有看到我的问题,这是我的第二个rails应用程序.第一个很顺利,但这一个一直给我一个随机的错误.我为这个应用程序以及最后一个应用程序安装了active_scaffold(第一个错误,而不是使用脚本/安装插件git:// active_scaffold存储库,我做了脚本/安装插件http:// active_scaffold存储库.)我不想要在小型号上拼出基本的CRUD.在安装问题之后(在我使用Linux时我从Windows用户那里找到了http解决方案之前)我想我会尝试使用Hobo.好吧,Hobo更新了actionmailer,actionpack,activerecord,activeresource和已安装的机架.Rails甚至没有使用更新版本.但正如您可以在跟踪底部看到的那样,它正在使用机架.我觉得这与我安装的Hobo的安装有关.提前致谢.

[编辑]
我在ActiveScaffold Group问过这个问题 的答案(如果你不想关注链接)是这条线需要添加到路线:

map.resources :modelName, :active_scaffold => true
Run Code Online (Sandbox Code Playgroud)

它并没有完全回答我的问题,因为文档没有说明改变路线.但是,它有效.

[/编辑]

部门#index中的ActionController :: RoutingError

显示第8行引发的vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb:

No route matches {:_method=>:get, :action=>"show_search", :controller=>"departments"}

提取的来源(第8行):

5:       <% next if controller.respond_to? link.security_method and !controller.send(link.security_method) -%>
6:    <% next if link.action == 'new' && params[:nested].nil? && active_scaffold_config.list.always_show_create %>
7:    <% next if link.action == 'show_search' && active_scaffold_config.list.always_show_search %>
8:       <%= render_action_link(link, new_params) -%>
9:     <% end -%>
10: 
11:     <%= loading_indicator_tag(:action => :table) …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails

3
推荐指数
1
解决办法
1167
查看次数