几天后我有一个问题.我有一个图表,当我使用缩放行为它工作,但我需要知道何时达到最大缩放以加载新的给定
// Specifies the zoom scale's allowed range, [min, max]
d3.behavior.zoom().x(x).scaleExtent([1,10]).on("zoom", draw)
Run Code Online (Sandbox Code Playgroud)
我在*.XLS中只有一个小而简单的文件,只有一张表,在这张表上只有许多单元格上有小文本的单元格.(文件大小24Kb)
但我做了很多改动,复制和粘贴,扩展公式,保存...之后我删除了大部分这些更改,并使用少量数据制作了4张重复的表格.
现在我的新文件非常庞大:2.5Mb!
隐藏数据在哪里?如何删除它?
我在真实文件上遇到同样的问题,每张300张和1张图片:文件大小280Mb
如果值大于100 MB,我尝试将列RAM着色为红色:
Get-Process | Format-Table @{ Label = "PID"; Expression={$_.Id}},
@{ Label = "Name"; Expression={$_.Name}},
@{ Label = "RAM (MB)"; Expression={[System.Math]::Round($_.WS/1MB, 1)}},
@{ Label = "Responding"; Expression={$_.Responding}}
Run Code Online (Sandbox Code Playgroud)
我尝试使用Write-Host -nonewline,但结果是错误的.
Get-Process | Format-Table @{ Label = "PID"; Expression={$_.Id}},
@{ Label = "Name"; Expression={$_.Name}},
@{ Label = "RAM (MB)"; Expression={write-host -NoNewline $([System.Math]::Round($_.WS/1MB, 1)) -ForegroundColor red}},
@{ Label = "Responding"; Expression={ write-host -NoNewline $_.Responding -fore red}}
Run Code Online (Sandbox Code Playgroud)
我需要对一个属性及其值运行相同的命令Get-QadUser
,Set-QadUser
但我的属性是一个变量。
我的代码(设置不起作用!):
$property = 'MobilePhone' # OK
$value = ($User | get-QadUser -IncludedProperties $property).$property # OK
$user | Set-QadUser -$PropertyName $NewValue # NOK
Run Code Online (Sandbox Code Playgroud) 我正在VBA中编写一个函数以在excel公式中使用,如果我的函数返回一个值,则可以:
=MYVALUE(A1)
Run Code Online (Sandbox Code Playgroud)
现在我写了另一个返回数组(1,2,3,4,...)的函数,我用Array公式替换了我的excel公式:
{=MYARRAY(A1)}
Run Code Online (Sandbox Code Playgroud)
但是当我拉伸公式时,所有单元格都会显示我的数组的第一个值.为什么?
这是我的VBA源代码(complement.xlam):
Function MYVALUE(x as integer)
MYVALUE = 123
End Eunction
Function MYARRAY(x as integer)
MYARRAY = Array(10,20,30)
End Eunction
Run Code Online (Sandbox Code Playgroud) 我需要Private Sub **Worksheet_BeforeDoubleClick** (ByVal Target As Range, Cancel As Boolean)
在我的表格中包含一个(1).
我能够正确地打开和写入单元格,但我不知道如何将VBA代码放在工作表中(而不是在VBA模块中).
$excel = New-Object -ComObject Excel.Application
$workbook = $excel.Workbooks.Add()
$worksheet = $workbook.WorkSheets.item(1)
$worksheet.range("c1","g6").value = "str"
...
$workbook.SaveAs($xlFlie, 50)
$Excel.Application.Quit()
Run Code Online (Sandbox Code Playgroud)
我试过这个:
$xlmodule = $workbook.VBProject.VBComponents.Add()
$xlmodule.CodeModule.AddFromString($code)
Run Code Online (Sandbox Code Playgroud)
但我得到了这个错误:
Can not call a method in an expression Null.
Au caractère .\Build-ADGrpsMembers2Excel.ps1:273 : 5
+ $xlmodule = $workbook.VBProject.VBComponents.Add(1)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation : (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Run Code Online (Sandbox Code Playgroud) 我尝试使用这样的自定义方法定义对象,但是我的语法错误:
$Obj = [pscustomobject]@{
A = @(5,6,7)
B = 9
Len_A = {return $this.A.count;}
Sum_A = {return (SumOf $this.A);}
}
Run Code Online (Sandbox Code Playgroud)
使用方式如下:
$Obj.Len_A() # return 3
$Obj.A += @(8,9) # @(5,6,7,8,9)
$Obj.Len_A() # return 5
Run Code Online (Sandbox Code Playgroud) 我使用d3.js和CodeIgniter,当我运行此代码时,当我使用d3.json获取json数据时,我遇到了问题:
var url = "http://probe.dev/draw/windRose?station=vp2&sensors=wind&Since=2012-10-15T00:00:00&StepUnit=DAY&StepNbr=6;
d3.json(url, function(d) {
console.log(d); // print NULL in console
}
Run Code Online (Sandbox Code Playgroud)
但它适用于
$.getJSON(url, function(d) {
console.log(d); // print my data object correctly
}
Run Code Online (Sandbox Code Playgroud)
我的PHP代码是:
<?php
@ob_end_clean();
header('Content-Type: "application/json"');
header('Content-Disposition: attachment; filename="data.json"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
header("Content-Length: ".strlen($data));
exit($data);
Run Code Online (Sandbox Code Playgroud)
我不明白为什么d3.json不起作用?