问题列表 - 第45861页

Java编译错误:"解析时到达文件末尾}"

我有以下源代码

public class mod_MyMod extends BaseMod
public String Version()
{
     return "1.2_02";
}
public void AddRecipes(CraftingManager recipes)
{
   recipes.addRecipe(new ItemStack(Item.diamond), new Object[] {
      "#", Character.valueOf('#'), Block.dirt
   });
}
Run Code Online (Sandbox Code Playgroud)

当我尝试编译它时,我收到以下错误:

java:11: reached end of file while parsing }
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?任何帮助赞赏.

java compiler-errors

11
推荐指数
3
解决办法
25万
查看次数

从两个表中删除加入?

我有两张表如下

tbl1              tbl2
id                article_id
title,            image
whole_news
tags,
author,
older (datetime)
Run Code Online (Sandbox Code Playgroud)

其中tbl1.id - > tbl2.article_id

如何删除旧版<2008-02-10 00:00:00的两个表中的记录?

mysql

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

从所选文本生成脚注

我正在尝试使用ExtendScript编写InDesign脚本.我希望脚本剪切选定的文本,插入脚注并将文本粘贴到脚注正文中.我尝试过的:

 function makeFootnoteOfSelection(){
   var fnText = app.activeDocument.selection[0];
         // this should actually clone the selected text, not reference it, because the next statement zaps it from memory
   app.activeDocument.selection[0].remove();  // works
   var fNote = app.activeDocument.selection[0].footnotes.add();  // works, adds an empty footnote with a reference
   fNote.contents = fnText.contents;
         // this replaces the reference number, I was hoping to retain it and just add the text
         // fNote.contents += fnText.contents; also replaces the reference number
}
Run Code Online (Sandbox Code Playgroud)

extendscript adobe-indesign

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

相反在jquery中追加

.append用来添加div

$(this).append('<ul><li>test</li></ul>');
Run Code Online (Sandbox Code Playgroud)

<ul>如果它存在于儿童中,我如何搜索并删除它$(this)

javascript jquery

77
推荐指数
6
解决办法
10万
查看次数

带有clojure的动态代码

我正在尝试在clojure中创建一些动态代码.在下面的函数中,我们的想法是动态生成(和)宏的条件.

(defn matching-keys [rec match-feed keys]
  (> (count (clojure.set/select #(and (for [k keys]
                                        (= (% k) (rec k))))
                                (set match-feed)))
     0))
Run Code Online (Sandbox Code Playgroud)

所以,如果它工作!! 然后这个代码会在传递以下键时生成(和)类似的东西[:tag :attrs]:

(and (= (% :tag) (rec :tag))
     (= (% :attrs) (rec :attrs)))
Run Code Online (Sandbox Code Playgroud)

我一直在搞乱各种各样的`` and〜操作员,试图让它起作用,现在我处于混乱状态.欢迎任何指导.

谢谢,

科林

clojure

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

如何设置JSplitPane-Divider折叠/展开状态?

我有一个带有JSplitPane的JFrame,它是OneTouchExpandable.我想记住JFlitPane在JFrame上的最后一个Divider位置处理,如果重新打开JFrame,则恢复Position.

它运行良好,但是如果用户通过oneTouchExpandable UI-Widget扩展一侧,那么我只存储处理中的'int'-Position并再次设置'int'-Position,结果是JFrame调整JSplitPane-Divider的大小跳转到折叠的Component preferredSize.

如何获取/设置崩溃/展开状态?

编辑

现在:调整大小行为是正常的,但它与第一​​次打开的行为不完全相同 - 因为现在我没有MinimumDividerLocation.我想要SnapIn,但需要进一步折叠状态.

public class SplitPaneState {
    public static void main( String[] args ) {
        SwingUtilities.invokeLater( new Runnable() {
            @Override
            public void run() {
                new SplitPaneState().createAndSowGUI();
            }
        });
    }

    private int position = -1;
    private Dimension size = new Dimension( 500, 300 );

    private void createAndSowGUI() {
        final JFrame frame = new JFrame("frame");
        frame.setSize( 200, 100 );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        frame.setLocationRelativeTo( null );
        frame.getContentPane().add( new JButton( new AbstractAction(){
           {
               putValue( Action.NAME, "Open Dialog" ); …
Run Code Online (Sandbox Code Playgroud)

java swing jsplitpane

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

一系列结构

在不知道数组中存储的最终结构数量的情况下,如何在C中创建结构数组?

我想在for循环中循环,创建一个tempStruct设置其变量,将其添加到数组然后再循环,创建一个新的tempStruct并将其添加到数组中.

我有一些问题包围着我在C中如何做到这一点,同时试图从客观C.

c arrays struct

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

Maven测试没有获得JUnit 4测试,除非课程以多模块项目的测试结束

Apache Maven 3.0(r1004208; 2010-10-04 12:50:56 + 0100)

赛跑

mvn测试

忽略任何JUnit 4测试,除非该类的名称是*Test.

只有一个依赖junit-4.8.2和目标/源配置为1.6

testing junit maven

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

如何在Grape中设置自定义Maven存储库管理器

我想使用grape来通过命令行安装库.所以我发出了命令:

grape -V install org.apache.derby derby 10.5.3.0
Run Code Online (Sandbox Code Playgroud)

Grape应使用位于http://127.0.0.1:8081/artifactory/webapp/home.html的Maven存储库.我该如何配置?

启用详细模式后,我在日志中看到:

:: loading settings :: url = jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
no default ivy user dir defined: set to /home/alexyz/.ivy2                                                           
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml       
no default cache defined: set to /home/alexyz/.ivy2/cache                                                            
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml       
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml        
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml   
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
settings loaded (89ms)                                                                                                 
        default cache: /home/alexyz/.ivy2/cache                                                                      
        default resolver: default                                                                                      
        -- 5 resolvers:                                                                                                
        shared [file]                                                                                                  
        default [chain] [local, main]                                                                                  
        local [file]                                                                                                   
        public [ibiblio]                                                                                               
        main [chain] [shared, public]                                                                                  
:: resolving dependencies :: caller#all-caller;working …
Run Code Online (Sandbox Code Playgroud)

groovy ruby-grape

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

Lambda表达式与匿名方法

我想知道有什么区别.目前我正在学习这些东西,在我看来,这些都是一样的:

delegate void X();

X instanceOfX;

instanceOfX = delegate() { code };

instanceOfX = () => { code };
Run Code Online (Sandbox Code Playgroud)

另外如果lambda更新,我应该只使用lambda并忘记匿名方法吗?

c# lambda anonymous-methods

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