我正在使用intellij 14和scala 2.11.6一起使用home brew和symlink进行安装
ln -s /usr/local/Cellar/scala/2.11.6/libexec/src /usr/local/Cellar/scala/2.11.6/src
ln -s /usr/local/Cellar/scala/2.11.6/libexec/lib /usr/local/Cellar/scala/2.11.6/lib
mkdir -p /usr/local/Cellar/scala/2.11.6/doc/scala-devel-docs
ln -s /usr/local/Cellar/scala/2.11.6/share/doc/scala /usr/local/Cellar/scala/2.11.6/doc/scala-devel-docs/api
Run Code Online (Sandbox Code Playgroud)
我试过运行一个简单的hello世界,但遇到了以下问题.
Error:scalac: Multiple 'scala-library*.jar' files (scala-library.jar, scala-library.jar, scala-library.jar) in Scala compiler classpath in Scala SDK scala-sdk-2.11.6
Run Code Online (Sandbox Code Playgroud)
编辑:
所以我检查全局库上的编译器类路径,显然有多个scal-library.jar
file:///usr/local/Cellar/scala/2.11.6/idea/lib/scala-library.jar
file:///usr/local/Cellar/scala/2.11.6/lib/scala-library.jar
file:///usr/local/Cellar/scala/2.11.6/libexec/lib/scala-library.jar
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么?
我有一个名为“projects”的目录,它是父目录,在我的项目附近有 200 个子目录。
现在我正在git pull
通过以下脚本执行。
#!/bin/bash
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull && echo -e '-------------------- \n ' " \;
Run Code Online (Sandbox Code Playgroud)
有没有什么有效的方法可以以多线程和更快的方式完成这个过程?
我一直存在的问题是它说java.lang.ArrayIndexOutOfBoundsException:165
165是它实际应包含的值的数量.
我尝试将整数数组的长度更改为更大的数字,但它一直给我错误,无论是更大的数字.
我把所有内容都打印出来,看看问题是否可能是我的for循环,但是那里的一切似乎都很好(165个阵列中有正确的数字)
我看不出问题出在哪里.
public int[][] getTilePositionsIn(int pixelLeft, int pixelBottom, int pixelRight, int pixelTop){
int starterTileX = pixelLeft/getTileLength();
if (starterTileX < 0)
starterTileX = 0;
System.out.println(starterTileX);
int starterTileY = pixelBottom/getTileLength();
if (starterTileY < 0)
starterTileY = 0;
System.out.println(starterTileY);
int tileLength = getTileLength();
int blockWidth = pixelRight - pixelLeft + 1;
int widthInTiles = blockWidth/tileLength +1;
int blockHeight = pixelTop - pixelBottom + 1;
int heightInTiles = blockHeight/tileLength +1;
int numberOfTiles = widthInTiles * heightInTiles;
System.out.println(widthInTiles);
System.out.println(heightInTiles);
System.out.println(numberOfTiles);
int[][] tiles …
Run Code Online (Sandbox Code Playgroud) 我正在使用ui-select的选择框.一切正常,但我想允许手动输入文本,并且不希望限制用户使用列表中的可用值.如果我输入文本,它会正确过滤我的列表.但是,当我没有点击一个元素并继续前进到下一个字段时,我的文本将被丢弃.
有任何想法吗?
谢谢和问候,亚历克斯
我不想显示我的代码因为我认为它不正确,但它被要求:
<ui-select ng-model="formData[field.id].selected" theme="bootstrap">
<ui-select-match placeholder="{{ lists[field.id].placeholder }}">{{$select.selected.text}}</ui-select-match>
<ui-select-choices repeat="item in lists[field.id].list | filter: $select.search">
<div ng-bind-html="item.text | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
Run Code Online (Sandbox Code Playgroud)
数据存储在formData[field.id].selected
.field.id
是要显示的当前字段的编号(我动态生成表单).假设它存储一个唯一的int值.
编辑08.04.2015 我的解决方案: 我发现似乎没有相当于C#组合框.所以我继续使用了两个不同的领域.这不是我想要的,但它现在有效:
<ui-select ng-model="formData[field.id].selected" theme="bootstrap">
<ui-select-match placeholder="{{ lists[field.id].placeholder }}">{{$select.selected.text}}</ui-select-match>
<ui-select-choices repeat="item in lists[field.id].list | filter: $select.search">
<div ng-bind-html="item.text | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
<?php echo __('Create a new element if value is not in list'); ?>
<div class="input-group">
<span class="input-group-addon">
<input type="checkbox" ng-model="disabled[field.id]">
</span>
<input type="text" value="" ng-disabled="!disabled[field.id]" class="form-control" …
Run Code Online (Sandbox Code Playgroud) 我有一个按钮,我想第一次将定时器设置为5秒,它应该在完成5秒后完成一些任务.此外,如果用户单击按钮2次,它应该启动计时器10秒,10秒后它应该执行特定的任务.如果用户点击第三次,它应该停止所有运行的计时器.所以我不知道如何实现计时器一次我搜索的是这个.但是在这个链接中它会在特定的时间段后不断重复,而我想要运行一次.
现在我想要什么
所以请告诉我如何执行此任何代码和源代码将不胜感激.
我有JavaFX(8),HBox,ComboBox和HGrow的问题.HGrow不能与ComboBox结合使用.
(INFO:使用TextField(而不是ComboBox),它按预期工作!)
这是我的FXML代码:
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<VBox prefHeight="117.0" prefWidth="285.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.test.TestController">
<children>
<HBox prefHeight="105.0" prefWidth="196.0" VBox.vgrow="ALWAYS">
<children>
<ComboBox fx:id="fxCboTest" prefHeight="25.0" prefWidth="62.0" HBox.hgrow="ALWAYS" />
</children>
</HBox>
</children>
</VBox>
Run Code Online (Sandbox Code Playgroud)
本准则将导致:
我也试过以下代码(没有成功,这段代码什么也没做):
HBox.setHgrow(uiController.fxCboTest, Priority.ALWAYS);
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何制作ComboBox HGrow?
我想[alt,输入]下面的Update方法(它不存在)来创建一个新的扩展方法.有没有办法在Resharper做到这一点?
List<FootyTeam> existingTeams = GetFootyTeams();
List<XmlTeam> newTeams = GetXmlTeams();
existingTeams.Update(xmlTeams);
Run Code Online (Sandbox Code Playgroud)
(注意,我是Resharper的新手)
为什么被flip id
接受为有效表达?难道不应该在失败的类型检查a
对b -> c
?
Prelude> :t flip
flip :: (a -> b -> c) -> b -> a -> c
Prelude> :t id
id :: a -> a
Prelude> :t flip id
flip id :: b -> (b -> c) -> c
Run Code Online (Sandbox Code Playgroud) 我有这个VB.Net代码:
Dim t as String = "111100111000011110111110010111101001100001100011101000001010011100110110100110100000101001110010011001101"
Dim i as Integer
If (t.Length Mod 8) <> 0 Then
For i = 1 To 8 - (t.Length Mod 8)
t = "0" + t
Next
End If
Run Code Online (Sandbox Code Playgroud)
当我将它转换为C#时,它变为:
string t = "111100111000011110111110010111101001100001100011101000001010011100110110100110100000101001110010011001101";
int i = 0;
if ((t.Length % 8) != 0)
{
for (i = 1; i <= (8 - (t.Length%8)); i++)
{
t = "0" + t;
}
}
Run Code Online (Sandbox Code Playgroud)
问题是两个代码的结果不一样.因此VB.net代码执行7次,C#代码执行4次.
请告诉我是什么问题!
对不起我的英语不好.
我有2张桌子:
Table1
id
table2_id
num
modification_date
Run Code Online (Sandbox Code Playgroud)
和
Table2
id
table2num
Run Code Online (Sandbox Code Playgroud)
我想打一个触发器,它插入或删除操作后在Table1
更新的最后一个值num
的Table2.table1lastnum
.
我的触发器:
CREATE OR REPLACE TRIGGER TABLE1_NUM_TRG
AFTER INSERT OR DELETE ON table1
FOR EACH ROW
BEGIN
IF INSERTING then
UPDATE table2
SET table2num = :new.num
WHERE table2.id = :new.table2_id;
ELSE
UPDATE table2
SET table2num = (SELECT num FROM (SELECT num FROM table1 WHERE table2_id = :old.table2_id ORDER BY modification_date DESC) WHERE ROWNUM <= 1)
WHERE table2.id = :old.table2_id;
END IF;
END TABLE1_NUM_TRG; …
Run Code Online (Sandbox Code Playgroud)