我有一个非常简单的代码,适用于Chrome,但不适用于Firefox:
JS
//Creating the svg element
svgContainer= d3.select("body")
.append("svg")
//fill it with blue and set it's width to 0
svgContainer
.style("background-color","blue")
.style("width",0);
//change the size again
svgContainer
.style("width",200)
Run Code Online (Sandbox Code Playgroud)
HTML
<body>
</body>
Run Code Online (Sandbox Code Playgroud)
在chrome中,矩形绘制,但不是在Firefox上.好像你不能再次改变样式元素的值.奇怪,不是吗?
这是一个JSFIDDLE http://jsfiddle.net/cUmXu/2/
编辑:实际上,您可以更改值,但如果您给宽度的第一个值为0,则不能更改.这虽然很奇怪.
第二次编辑:似乎在使用时
svgContainer
.style("width","200px")
Run Code Online (Sandbox Code Playgroud)
有用.如果有人知道原因,请分享.
似乎 whereHas 方法不能很好地工作。
$res = Entreprise::whereHas('labels',function ($q)
{
$q->where('hidden','!=',1);
})
->whereHas('labels',function ($q)
{
$q->whereHidden(1);
})
->get();
dd(count($res)); //shows int 2
Run Code Online (Sandbox Code Playgroud)
这是标签关系:
public function labels()
{
return $this->morphToMany('Label', 'labelable');
}
Run Code Online (Sandbox Code Playgroud)
这是数据库:
id | nom | deleted_at | created_at | updated_at | junior_id | label_type_id | abbreviation | id_siaje | hidden
6 | Environnord | 0000-00-00 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 1 | 4 | EnvNord | 0 | 1
7 | Salon créer | 0000-00-00 | 0000-00-00 00:00:00 | …Run Code Online (Sandbox Code Playgroud) 这里的简单问题但遗憾的是无法解决.如标题中所述,我无法让Riot显示其自定义标记的内容.
<!DOCTYPE html>
<html>
<head></head>
<body>
<hello></hello>
<script type="text/javascript" src="node_modules/riot/riot.min.js"></script>
<script type="text/javascript"> riot.mount('*'); </script>
<script type="text/javascript" src="bower_components/lodash/lodash.min.js"></script>
<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/toastr/toastr.min.js"></script>
<script type="text/javascript" src="js/init.js"></script>
<script type="text/javascript" src="js/config.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/hello.js"></script>
</body>
Run Code Online (Sandbox Code Playgroud)
hello.js是生成的js,这里是它的代码:
riot.tag('hello', '<div> asdasd </div>', function(opts) {
});
Run Code Online (Sandbox Code Playgroud)
这是它的HTML:
<hello>
<div>
asdasd
</div>
<script>
</script>
</hello>
Run Code Online (Sandbox Code Playgroud) 我可以使用以下cmd从文件中打印一系列行:
sed -n 267975,1000000p < dump-gq1-sample > dump267975
Run Code Online (Sandbox Code Playgroud)
但是如何打印到最后?我试过了
sed -n 267975,$p < dump-gq1-sample > dump267975
Run Code Online (Sandbox Code Playgroud)
它给了我:
sed:1:“ 267975”:预期的上下文地址
我想这有点简单,但是我仍然不知道该怎么做。我定义了以下函数:
date +%Y-%m-%d_%H:%M | xclip -selection c
Run Code Online (Sandbox Code Playgroud)
它将获得一个时间戳并将其放入剪贴板。我主要是想用它来命名文件,所以我可以例如
vi file_2016-02-16_20:10_somemorethings.txt
Run Code Online (Sandbox Code Playgroud)
但是,当我将日期粘贴到终端中时(使用Ctrl + Shift + V),它已经输入了命令,所以我再也没有机会输入_somemorethings.txt。换句话说,最后xclip保存的字符是Enter键。每当我通过管道向xclip或传送东西时xsel,不仅会发生上述定义的函数,这种情况就会发生。
我知道这听起来似乎并不重要,但是如果可以解决这个小问题,它将真正提高生产率。
我试图与这两个几个选项xclip和xsel并没有什么似乎克服这一点。有任何想法吗?这有可能吗?
What is the role of BPM (BussinessProcessManagement) in a realtime application?
I mean in which cases or where is BPM actually used?
I could get the documentation from the net, but where actually is it used?
我正在使用handontable jQuery插件.当用户停止编辑单元格时,我试图拦截.双击单元格时,handsontableInput该单元格的位置会显示带有类的文本区域.
使用jQuery我试图在用户点击其他地方时获得回调,从而失去了textarea的焦点.
这是简单的焦点代码:
$(".handsontableInput").focusout(function () {
alert("LLL");
});
Run Code Online (Sandbox Code Playgroud)
这是我的小提琴.
另外,如果带有handontable的页面在一个框架中,并且我在框架外单击了,这会工作吗?
谢谢
我想设置一个命令来移动整个文件而不移动光标.
这是我创建的宏:
qaggVGy
Run Code Online (Sandbox Code Playgroud)
但是,这会将光标移动到文件的开头.如何在不丢失游标位置的情况下拉动整个文件?
在我的测试中,有时我会超时,这对于在超时之前查看未完成的承诺在什么地方非常有用,这样我才能知道哪些承诺最有可能处于“始终处于等待状态”。
有没有办法做到这一点 ?
这是一个示例代码:
Promise.resolve().then(function firstFunction() {
console.log(1);
return 1;
}).then(function () {
return new Promise(function secondFunction(resolve, reject) {
// NEVER RESOLVING PROMISE
console.log(2);
});
}).then(function thirdFunction() {
// function that will never be called
console.log(3);
})
setTimeout(function timeoutTest() {
const pendingPromises = [];// ??????????? how do I get the pendingPromises
console.log(pendingPromises);
process.exit();
}, 5000);
Run Code Online (Sandbox Code Playgroud)
如果可能的话,我想获得pendingPromises函数的名称和promise的stacktrace secondFunction,因为它是永远无法解决的。