问题列表 - 第46304页

Javascript原型语法

这是有效的Javascript语法吗?它有什么作用?

Parser.prototype = {

  // ...

  get currentState() {
    return this.state[this.state.length - 1];
  },

  // ...

}
Run Code Online (Sandbox Code Playgroud)

请参阅https://github.com/LearnBoost/stylus/blob/master/lib/parser.js.

谢谢!

javascript prototype

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

我可以在DOS批处理文件中有一个IF块吗?

在DOS批处理文件中,如果语句体只能有1行?我想我找到()了一个可以用于if块的地方,就像{}在C语言编程语言中使用的那样,但是当我尝试这个时它不会执行语句.也没有错误消息.这是我的代码:

if %GPMANAGER_FOUND%==true(echo GP Manager is up
goto Continue7
)
echo GP Manager is down
:Continue7
Run Code Online (Sandbox Code Playgroud)

奇怪的是,当我运行批处理文件时,"GP管理器已启动"或"GP管理器已关闭"都不会被打印.

if-statement batch-file

90
推荐指数
3
解决办法
22万
查看次数

JSF 页面导航:意外的运行时异常

我在faces-config.xml 中定义了以下导航规则。我能够导航到第二页,但是从第二页到第一页,我无法导航。可能是什么原因,导航规则有问题?我想在没有重定向的情况下进行导航。

JSF 版本是 1.1

 <navigation-rule>
        <from-view-id>/first.jspx</from-view-id>
        <navigation-case>
        <from-action>#{bean.setSelectedItem}</from-action>
            <from-outcome>form1</from-outcome>
            <to-view-id>/second.jspx</to-view-id>
        </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/second.jspx</from-view-id>
        <navigation-case>
            <from-action>#{bean2.testBack}</from-action>
            <from-outcome>form2</from-outcome>
            <to-view-id>/first.jspx</to-view-id>
        </navigation-case>
    </navigation-rule>
Run Code Online (Sandbox Code Playgroud)

从萤火虫我可以看到以下异常

java.lang.RuntimeException: no message available
Run Code Online (Sandbox Code Playgroud)

谢谢

更新 1

我的 second.jspx 中的代码返回到 first.jspx

<ice:form id="form2">     
    <ice:commandLink action="#{bean.testBack}">
        <h:outputText value="Test" />
</ice:commandLink>
</ice:form>
Run Code Online (Sandbox Code Playgroud)

单击操作时的代码

public String testBack() {

    try {            
        logger.info("invoked");      
        
    } catch (Exception e) {
        e.printStackTrace();
    }
 
    return "form2";
 }
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪

java.lang.RuntimeException: no message available
    at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:173)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
    at …
Run Code Online (Sandbox Code Playgroud)

navigation jsf redirect icefaces

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

根据使用htaccess文件的URL路由,重定向到特定页面

我有网址喜欢

http://localhost/mis  
http://localhost/mis/newsletter.php  
http://localhost/mis/cms.php?mainid=65  
http://localhost/mis/news.php?mainid=93
Run Code Online (Sandbox Code Playgroud)

好吧,我正在使用这些网址作为学校部分.

现在对于A级部分,我有以下网址

http://localhost/mis/index.php?mode=0  
http://localhost/mis/newsletter.php?mode=0  
http://localhost/mis/cms.php?mainid=65&mode=0  
http://localhost/mis/news.php?mainid=93&mode=0
Run Code Online (Sandbox Code Playgroud)

我希望上面的网址像路由一样

http://localhost/mis/a-level  
http://localhost/mis/a-level/newsletter.php  
http://localhost/mis/a-level/cms.php?mainid=65  
http://localhost/mis/a-level/news.php?mainid=93
Run Code Online (Sandbox Code Playgroud)

请通过.htaccess文件帮我解决这些网址.

编辑: htaccess文件在mis文件夹下

文件结构:

root>>
    mis>>
        .htaccess
        newsletter.php
        cms.php
        news.php
Run Code Online (Sandbox Code Playgroud)

.htaccess mod-rewrite

-1
推荐指数
1
解决办法
1211
查看次数

如何设置<input>边框

我不知道如何调用这种功能,但我的问题是,有没有办法设置以下效果的颜色:

在此输入图像描述

使用只是border没有成功.

html css

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

OpenGL中多维数据集的纹理坐标是什么?

我有一个立方体定义为:

float vertices[] = { -width, -height, -depth, // 0
                              width, -height, -depth, // 1
                              width,  height, -depth, // 2
                             -width,  height, -depth, // 3
                             -width, -height,  depth, // 4
                              width, -height,  depth, // 5
                              width,  height,  depth, // 6
                             -width,  height,  depth // 7
        };  
Run Code Online (Sandbox Code Playgroud)

我有图像128x128,我只想在立方体的6个面上绘制,而不是其他任何东西.那么cooridinates的质地是什么?我需要实际的价值观.

这是绘图代码:

// Counter-clockwise winding.
        gl.glFrontFace(GL10.GL_CCW);
        // Enable face culling.
        gl.glEnable(GL10.GL_CULL_FACE);
        // What faces to remove with the face culling.
        gl.glCullFace(GL10.GL_BACK);
        // Enabled the vertices buffer for writing and to be used during
        // …
Run Code Online (Sandbox Code Playgroud)

opengl

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

iPhone - 使用SBJsonParser的Objective-C内存泄漏

我使用Xcode中的"Leaks"工具继续获得以下内存泄漏.由于这是一个库,我只是想知道什么是解决这种泄漏的最佳方法.任何帮助将不胜感激.如果需要,我很乐意分享更多代码.

更新:我发现这篇文章似乎并不乐观.有没有人有任何关于如何解决这个问题的建议?

http://code.google.com/p/json-framework/issues/detail?id=13

在此输入图像描述

这就是我使用该库的方式.

- (void)getFacebookProfileFinished:(ASIHTTPRequest *)request {
    NSString *responseString = [request responseString];
    NSMutableDictionary *responseJSON = [responseString JSONValue]; //memory leak 100%   

    NSString *username;
    NSString *firstName = [responseJSON objectForKey:@"first_name"];
    NSString *lastName = [responseJSON objectForKey:@"last_name"];
    NSString *facebookId = [responseJSON objectForKey:@"id"];
    if (firstName && lastName) {
        username = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
    } else {
        username = @"";
    }

    UIAppDelegate.userSessionId = facebookId;
    UIAppDelegate.userFullName = username;

    if (UIAppDelegate.userSessionId != nil) {
        Service1 *service = [[Service1 alloc] init];
        [service UserExists:self action:@selector(handlerUserExists:) facebookUserId:UIAppDelegate.userSessionId];
        [service release]; …
Run Code Online (Sandbox Code Playgroud)

iphone json memory-leaks objective-c autorelease

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

Count()和左连接问题

我的查询有问题,该查询显示商店列表,其中包含与之关联的产品数量.我一直在玩左连接等一段时间但是无济于事.表格具有以下结构:

包含列的商店表:id,name

包含列的产品表:id,name,status,shop

查询如下:

select s.name
       , p.name
       , count(p.id) 
from   Product as p 
       left join Shop as s on p.shop=s.id
where  p.status <> '8796107276379'
group by 
       s.id
Run Code Online (Sandbox Code Playgroud)

我找不到有0件商品的商店.我怎么能实现这个目标呢?

底层数据库是MySQL.

谢谢!Krt_Malta

mysql sql count left-join

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

Coroutine与事件驱动编程

关于维基百科中的示例:http: //en.wikipedia.org/wiki/Coroutine

var q := new queue

coroutine produce
    loop
        while q is not full
            create some new items
            add the items to q
        yield to consume

coroutine consume
    loop
        while q is not empty
            remove some items from q
            use the items
        yield
Run Code Online (Sandbox Code Playgroud)

我只是想知道基于传统事件的方法可以处理这种使用模式,为什么需要使用协同程序?

events event-driven-design coroutine

7
推荐指数
1
解决办法
2771
查看次数

有没有办法在 Ubuntu 下改进 JFileChooser 的外观?

我一直在制作一个使用 JFileChooser 的程序。我已经设置了应用程序

UIManager.getSystemLookAndFeelClassName()

这对 Ubuntu 下的几乎所有东西都适用。到目前为止,我遇到的唯一问题是 JFileChooser 看起来非常糟糕: 带有 SystemLookAndFeel 的 JFileChooser

有没有办法让它看起来像 Ubuntu 中的默认文件选择器?IE。 所需的文件选择器对话框

我试过使用

UIManager.getCrossPlatformLookAndFeelClassName()

这使得 JFileChooser 对话框看起来更好,但仍然不是本机外观,并且它也破坏了应用程序的其余部分的感觉。

谢谢。

java user-interface swing jfilechooser look-and-feel

5
推荐指数
1
解决办法
1951
查看次数