是否有默认隐藏小地图的设置?
View > Hide Minimap
对于我打开的每个窗口都不方便.
使用c()
和有append()
什么区别?有没有?
> c( rep(0,5), rep(3,2) )
[1] 0 0 0 0 0 3 3
> append( rep(0,5), rep(3,2) )
[1] 0 0 0 0 0 3 3
Run Code Online (Sandbox Code Playgroud) 哪个更快,为什么?通过$('div[data-something]')
或选择div(插件需求)$('div.something')
?我倾向于前者,因为它"更清洁".
基于这个问题,我知道我不应该同时使用这两个问题.但是我没有发现它们之间是否存在差异.
运行已安装的gem比运行它的本地源代码要慢得多.
已安装的宝石:
$ time wmctile switch_to Thunderbird
real 0m0.682s
user 0m0.491s
sys 0m0.091s
Run Code Online (Sandbox Code Playgroud)
当地来源:
$ time ./work/wmctile/bin/wmctile switch_to Thunderbird
real 0m0.197s
user 0m0.118s
sys 0m0.064s
Run Code Online (Sandbox Code Playgroud)
为什么?可能是因为RVM,还是一般来说这是红宝石的"特征"?有没有办法加快速度?
编辑:生成的bin文件
$ which wmctile
/home/some_user_name/.rvm/gems/ruby-2.1.2/bin/wmctile
$ cat $( which wmctile )
#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'wmctile' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0"
if ARGV.first
str = …
Run Code Online (Sandbox Code Playgroud) 我有一个类似于我之前的问题(Drupal 7视图按动态分类术语过滤),它只是反过来.
我有一个"合作伙伴"内容类型,每个类型都有自己的分类术语.另一种内容类型是具有来自"伙伴"词汇表的多个术语的常规页面.在我的常规节点中,我想在视图块中包含一些"伙伴".
视图应仅过滤那些相关的伙伴节点(标记有常规节点标记之一的节点).
可以这样做吗?问题是我无法通过上下文过滤器从URL获取术语名称...
我正在寻找一个很好的R包来解决线性编程模型.我对默认情况非常满意lpSolve::lp
,但没有办法获得影子并降低价格.我需要这些以及完整性约束.
样品型号:
A = rbind(
c(0.5, 0.2, 0.2),
c( -1, 1, 0),
c( 0, 1, -1),
c( -1, -1, -1),
c( -1, 0, 0),
c( 0, -1, 0),
c( 0, 0, -1)
)
b = c(5, 0, 0, -13, 0, 0, 0)
c_ = c(8.4, 6, 9.2)
(signs = c('=', rep('<=', 6)))
res = lpSolve::lp('min', c_, A, signs, b, all.int = TRUE)
# Objective function
res
# Variables
res$solution
# Shadow prices???
# Reduced prices???
Run Code Online (Sandbox Code Playgroud) 我有一个带有许多子项的可滚动元素和一个带有相应选项的select标签.
我想根据元素更改select的值 .scrollTop()
如何有效地做到这一点?我.offset().top
想把孩子们存放在一个数组中并循环遍历它.但是,浏览器无法处理它.我可能会尝试创建一个.setTimeout()
标志,但这似乎并不干净.
r = $('ul')
offsets = []
r.find('li').each((index) ->
offsets[index] = $(this).offset().top
)
r.bind('scroll', ->
// while loop checking .scrollTop() > offsets[n] is slow
// maybe spams to many .scroll events?
)
Run Code Online (Sandbox Code Playgroud) 使用KineticJS,是否有可能仅将该函数绑定一次?和jQuery相同......
例如.在jQuery中
// bad
$('.wrap a').on('click', myHandler);
// good
$('.wrap').on('click', 'a', myHandler);
Run Code Online (Sandbox Code Playgroud)
我也想和KineticJS一起做这件事,因为会有很多对象.
我试图找到最好的移动平均线并偶然发现问题.
我可以使用B233:B253
基于n的内容创建单元格.但是,我无法将此值粘贴到AVG()
函数中,该函数将值视为字符串.
有什么eval()
功能吗?
因为我要使用MS Solver,VBA不在游戏中.
我正在使用svg.js绘制我的SVG.我想知道,是否有可能掩盖旋转元素.我可以实现旋转蒙面元素,这是不一样的.
见一个最小的工作示例- http://jsfiddle.net/mreq/LP7sa/1/ -我想旋转的图像与红色矩形所掩盖.该示例生成以下代码:
<svg xmlns="http://www.w3.org/2000/svg" id="SvgjsSvg1000" version="1.1" width="100%" height="100%" xlink="http://www.w3.org/1999/xlink" style="position:relative;overflow:hidden;left:0px;top:0px;">
<rect id="SvgjsRect1003" width="50%" height="50%" y="75" x="125" fill="red"/>
<image id="SvgjsImage1004" href="http://t1.gstatic.com/images?q=tbn:ANd9GcQo_CFlPKdX-_-EEs34S-Y8T9l2kVNY59fwfhCKHBK90XSwS21grA" width="400" height="250" transform="rotate(75 200 125)" mask="url("#SvgjsMask1005")"/>
<defs id="SvgjsDefs1001">
<mask id="SvgjsMask1005">
<rect id="SvgjsRect1002" width="50%" height="50%" fill="#ffffff" x="125" y="75"/>
</mask>
</defs>
</svg>
Run Code Online (Sandbox Code Playgroud)
解决方案可以是通用的SVG - 它不必使用svg.js并且可以使用任何其他库.我尝试旋转蒙版 - 矩形,但这不会,因为我需要调整大小,移动和翻转图像.
我可以有两个具有相同for
值的标签吗?例:
<label for="foo">Outer label</label>
<div class="foo-bar">
<input type="checkbox" id="foo" />
<label for="foo">Inner label</label>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个页面,在 FF 和 IE 中工作正常。然而,铬抛出
jquery.min.js:2 Uncaught RangeError: Maximum call stack size exceeded
Run Code Online (Sandbox Code Playgroud)
这是因为尝试处理大量数据(请参阅Chrome RangeError: Maximum call stack size exceeded when using jQuery $.map)。
是否可能catch
出现错误,从而使整个页面的 javascript 不会挂起?还是我必须减少 chrome 的数据量。
可能重复:
在创建匿名PHP函数期间呈现变量
我对PHP仍然很新,这让我感到困扰:
class Controller {
...
...
function _activateCar() {
$car_id = $this->data['car']->getId();
// $car_id == 1
$active_car = array_filter($this->data['cars'], function($car){
// $car_id undefined
return $car->getId() == $car_id;
});
}
...
...
}
Run Code Online (Sandbox Code Playgroud)
为什么array_filter里面的函数不能访问$car_id
变量?继续说未定义.
有没有其他方法可以$car_id
访问而不是制作$_GET['car_id'] = $car_id;
?使用global
关键字没有帮助.
jquery ×4
javascript ×3
function ×2
html5 ×2
r ×2
bind ×1
chromium ×1
coffeescript ×1
css3 ×1
dom ×1
drupal-7 ×1
drupal-views ×1
excel-2007 ×1
html ×1
kineticjs ×1
lpsolve ×1
php ×1
ruby ×1
rubygems ×1
rvm ×1
scope ×1
sublimetext2 ×1
svg ×1
svg.js ×1
validation ×1