小编Joh*_*edl的帖子

创建一个新阶段

我正在使用Maven开发一个项目,我需要两个新的阶段:'analyze'和'eval'(针对不同的数据分析阶段).我已经阅读了所有可以找到的文档,并创建了components.xml和lifecycle.xml的版本,这些版本尽可能接近正确,但是Maven拒绝运行新的阶段.(我应该强调,我的插件工作没有问题,没有问题将它们绑定到默认生命周期提供的现有阶段.我的问题是我创建的新阶段似乎被maven忽略了.)我该怎么办?需要做的是让我的新阶段发挥作用?

lifecycles.xml:

<lifecycles>
  <lifecycle>
    <id>lenskit</id>
    <phases>
      <phase>
        <id>analyze</id>
        <executions>
          <execution>
            <goals>
              <goal>greet</goal>
            </goals>
          </execution>
        </executions>
      </phase>
      <phase>
        <id>validate</id>
        <executions>
          <execution>
            <goals>
              <goal>greet</goal>
            </goals>
          </execution>
        </executions>
      </phase>
    </phases>
  </lifecycle>
</lifecycles>
Run Code Online (Sandbox Code Playgroud)

components.xml中:

<component-set>
  <components>
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>lenskit</role-hint>
      <implementation>
        org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
      </implementation>
      <configuration>
         <id>lenskit</id>
         <phases>
            <phase>get-data</phase>
            <phase>analyze</phase>
            <phase>eval</phase>
         </phases>
         <default-phases>
            <verify> org.apache.maven.plugins:maven-resources-plugin:resources </verify>
            <get-data> org.riedl:hello-lenskit-plugin:greet </get-data>
            <analyze> org.riedl:hello-lenskit-plugin:greet </analyze>
            <eval> org.riedl:hello-lenskit-plugin:greet </eval>
            <package> org.riedl:hello-lenskit-plugin:greet </package>
         </default-phases>
      </configuration>
    </component>
  </components>
</component-set>
Run Code Online (Sandbox Code Playgroud)

maven-3 maven

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

球拍立即刷新、线程和产量

我一直在编写一些简单的racketGUI 程序,为我秋季教授的课程做准备。我在动画方面遇到一些问题。我使用基本画布,并使用动画模型,其中通过调用绘制过程,每帧刷新整个画布。下面是一个示例程序。

我的问题是我必须要么将动画作为单独的运行thread,要么yield在每个实例之后调用refresh-now。为什么是这样?我希望refresh-now图像能够立即刷新,而无需我进行额外的工作。

我已经阅读了页面上的动画示例racket,发现它们通常直接绘制到画布上。我知道,由于画布是双缓冲的,所以效果很好......但对于我的应用程序来说,让绘画程序承担负载会更容易,因为无论如何我都需要一个工作绘画程序,以防最小化等。(当然,这yield并不是一个很大的负担,但如果不需要的话,教学会更容易。)

谢谢,
约翰

#lang racket

; Demonstrate simple animation in Racket

(require racket/gui)

(define min-x 0)
(define min-y 0)
(define max-x 200)
(define max-y 200)

; Three vertexes of the triangle, expressed relative to a starting x and y location.
(define triangle-vertexes [list 
(list 10 0) 
(list 0 20) 
(list 20 20)])

(define triangle-x 20)
(define triangle-y 20)

; Move a triangle by …
Run Code Online (Sandbox Code Playgroud)

user-interface multithreading racket

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

标签 统计

maven ×1

maven-3 ×1

multithreading ×1

racket ×1

user-interface ×1