我是一名Emacs用户,在配置编辑器方面没有任何技能.从haskell-mode 2.4 升级到2.7之后,我注意到了两个变化:
我看到haskell-mode 2.7默认使用次模式haskell-indentation-mode,而2.4的行为以haskell-indent-mode的形式保存.如果我先关闭前者,然后关闭后者,我想恢复的行为(即缩进感觉就像之前一样,退格/删除会删除突出显示的块).
但是,每当我打开带有.hs后缀的文件时,我都无法自动执行此操作.我尝试了各种类似的东西
(remove-hook 'haskell-mode-hook 'turn-on-haskell-indentation-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent-mode)
Run Code Online (Sandbox Code Playgroud)
和它类似,但我要么最终得到标准模式或普通的haskell模式没有缩进和文档.
有任何想法吗?
解决方案(感谢nominolo):
(remove-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(remove-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
(add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
(defun my-haskell-mode-hook ()
(haskell-indentation-mode -1) ;; turn off, just to be sure
(haskell-indent-mode 1) ;; turn on indent-mode
)
Run Code Online (Sandbox Code Playgroud) 在我正在进行的应用程序中,我需要定期检查成千上万个对象的资格,以获得某种服务.决策图本身采用以下形式,只是更大:
在每个端节点(圆圈)中,我需要运行一个动作(更改对象的字段,日志信息等).我尝试使用Drool Expert框架,但在这种情况下,我需要为图中的每个路径编写一条长规则,从而导致结束节点.Drools Flow似乎也没有为这样的用例构建 - 我拿一个对象,然后,根据一路上的决定,我最终进入一个终端节点; 然后又为另一个对象.或者是吗?你能给我一些这些解决方案的例子/链接吗?
更新:
Drools Flow调用可能如下所示:
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
Map<String, Object> params = new HashMap<String, Object>();
for(int i = 0; i < 10000; i++) {
Application app = somehowGetAppById(i);
// insert app into working memory
FactHandle appHandle = ksession.insert(app);
// app variable for action nodes
params.put("app", app);
// start a new process instance
ProcessInstance instance = ksession.startProcess("com.sample.ruleflow", params);
while(true) {
if(instance.getState() == instance.STATE_COMPLETED) {
break; …
Run Code Online (Sandbox Code Playgroud) 我使用maven货物和硒进行自动化.这是代码:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.5</version>
<configuration>
<wait>false</wait>
<container>
<containerId>tomcat6x</containerId>
<zipUrlInstaller>
<url>
http://mirrors.enquira.co.uk/apache/tomcat/tomcat-6/v6.0.30/bin/apache-tomcat-6.0.30.zip
</url>
<installDir>${installDir}</installDir>
</zipUrlInstaller>
<output>
${project.build.directory}/tomcat6x.log
</output>
<log>${project.build.directory}/cargo.log</log>
</container>
<configuration>
<home>
${project.build.directory}/tomcat6x/container
</home>
<properties>
<cargo.logging>high</cargo.logging>
<cargo.servlet.port>8081</cargo.servlet.port>
</properties>
<files>
<copy>
<file>${project.basedir}/src/main/resources/datasource.properties</file>
<todir>webapps</todir>
<configfile>true</configfile>
<overwrite>true</overwrite>
</copy>
</files>
<properties>
<customMessage>${catalina.home}</customMessage>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>configure</goal>
<goal>start</goal>
<goal>deploy</goal>
</goals>
<configuration>
<deployer>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<pingURL>**the url**</pingURL>
<pingTimeout>180000</pingTimeout>
<properties>
<context>**war-name**</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
Run Code Online (Sandbox Code Playgroud)
但随着战争开始变得越来越大,pingtimeout开始增加,我不想使用ping超时,但我现在被迫,因为部署需要一点时间,如果没有提到pingtimeout,selenium不会等待.
有没有解决这个问题的方法?
我注意到,对于DataContractJsonSerializer,序列化的JSON字符串有时包含形式的类型信息
{"__type":"MyClass:#MyNamespace", ... }
Run Code Online (Sandbox Code Playgroud)
基于我的观察,它似乎只是在它序列化一个基类型但是通过已知的子类型而不是有意义的时候这样做,但是我没有找到任何官方文件来证实这个或者实际上无论如何迫使序列化器一直展示遇到自定义类型时的此行为.
任何人都可以确认我的观察是否正确吗?更好的是,如果您知道一种方法来指示序列化程序始终序列化自定义类型的类型信息,那么这是否可行?
谢谢,
不可变对象仅由其构造函数初始化,而单例由静态方法实例化.如何在Java中创建一个不可变的单例?
这适用于DataGridRow ..
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{StaticResource RolloverBrush}" />
<Setter Property="Foreground" Value="#000" />
</Trigger>
Run Code Online (Sandbox Code Playgroud)
但是当我添加这些时,鼠标悬停样式不起作用..
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="{StaticResource LightRowBrush0}" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource LightRowBrush1}" />
</Trigger>
Run Code Online (Sandbox Code Playgroud) 我的意思是,我知道这意味着什么:拿出列表并在其中添加1; 也就是说,它相当于map (1 + _ )
.我不明白的是Scala如何知道它是等价的.这里发生了什么?
编辑
丹尼尔指出这是一个更普遍的问题.例如
def g(f : Int => Int, x : Int) = f(f(x))
g( (1 + ), 2)
res12: Int = 4
Run Code Online (Sandbox Code Playgroud)
哪个很酷.每天我都会发现Scala可以做的新功能.我想我正在寻找这个特殊事物的完整描述(理想的名称).
我已经尝试了许多个月,学习如何IDirect3DVertexBuffer9
和IDirect3DIndexBuffer9
工作.我读过多本书,电子书和论坛,但我仍然无法理解他们的工作方式.有人可以帮我理解它们的工作方式以及它们如何连接在一起吗?
PS:我试过搜索相关问题,但没有什么比我感兴趣了.
谢谢.
java ×3
c++ ×2
.net ×1
buffer ×1
datagrid ×1
direct3d ×1
drools ×1
drools-flow ×1
emacs ×1
haskell ×1
immutability ×1
indentation ×1
indexing ×1
json ×1
maven-2 ×1
maven-cargo ×1
scala ×1
selenium ×1
singleton ×1
stl ×1
tomcat ×1
vertex ×1
wcf ×1
wpf ×1
wpf-controls ×1
wpfdatagrid ×1