我们所有人都可能知道.bat批处理文件.
但是PowerShell 3脚本的文件扩展名是什么?
我发现了.ps1一些其他的结局,但它们仅适用于版本1.
有几种明显的使用方法qsort:在比较器中强制转换:
int cmp(const void *v1, const void *v2)
{
const double *d1 = v1, *d2 = v2;
?
}
qsort(p, n, sizeof(double), cmp);
Run Code Online (Sandbox Code Playgroud)
或投射比较器:
int cmp(const double *d1, const double *d2)
{
?
}
qsort(p, n, sizeof(double), (int (*)(const void *, const void *))cmp);
Run Code Online (Sandbox Code Playgroud)
我倾向于使用前者,更多的是出于审美原因。是否有任何技术上的原因偏爱其中一个?
我已经安装了JavaFX 2.0 SDK,现在我想用Eclipse做一个JavaFX应用程序.但是我如何javafx.*在Eclipse中使用这些类?
在官方的JavaFX Eclipse插件似乎是为JavaFX 1.2和过时.
当我尝试安装e(fx)clipse插件时,我收到此错误:
Cannot complete the install because one or more required items could not be found.
Software being installed: efxclipse 0.0.8.201111131640 (at.bestsolution.efxclipse.feature.feature.group 0.0.8.201111131640)
Missing requirement: Eclipse DI integration for JavaFX 0.0.8.201111131640 (at.bestsolution.efxclipse.runtime.di 0.0.8.201111131640) requires 'bundle org.eclipse.e4.core.contexts 0.9.0' but it could not be found
Cannot satisfy dependency:
From: efxclipse 0.0.8.201111131640 (at.bestsolution.efxclipse.feature.feature.group 0.0.8.201111131640)
To: at.bestsolution.efxclipse.runtime.feature.feature.group [0.0.8.201111131640]
Cannot satisfy dependency:
From: FX Runtime 0.0.8.201111131640 (at.bestsolution.efxclipse.runtime.feature.feature.group 0.0.8.201111131640)
To: at.bestsolution.efxclipse.runtime.di [0.0.8.201111131640]
Run Code Online (Sandbox Code Playgroud) 在下面的代码,不应该之间的裕度.box1和.box2被20像素作为.box1具有10px的底部边缘和.box2具有10px的上边距.
<div class="box">
<div class="box1"></div>
<div class="box2"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.box1{
margin-bottom: 10px;
}
.box2{
margin-top: 10px;
}
Run Code Online (Sandbox Code Playgroud)
我一直习惯Options -Indexes通过.htaccess禁用目录列表.但是,我见过人们使用IndexIgnore *.有什么不同?哪个比另一个好?
Timestamp sTs = Timestamp.valueOf("1900-12-31 23:59:59.999"); // Make Timestamp
System.out.println("sTs====>" + sTs.getTime());
sTs====> -2177485200001 // in jdk 1.4
Timestamp sTs = Timestamp.valueOf("1900-12-31 23:59:59.999"); // Make Timestamp
System.out.println("sTs====>" + sTs.getTime());
sTs====> -2177483400001 // in jdk 1.5
Run Code Online (Sandbox Code Playgroud)
为什么两个值不同?
我有这个代码:
function setupProject($projectFile) {
[xml]$root = Get-Content $projectFile;
$project = $root.Project;
$beforeBuild = $root.CreateElement("Target", "");
$beforeBuild.SetAttribute("name", "BeforeBuild");
$beforeBuild.RemoveAttribute("xmlns");
$project.AppendChild($beforeBuild);
$root.Save($projectFile);
}
Run Code Online (Sandbox Code Playgroud)
它应该<Target name="BeforeBuild" />为XML文档添加一个新内容.
但它也添加了一个xmlns=""我不想要的空属性.(它实际上是Visual Studio,它不喜欢这个属性!)
<Target name="BeforeBuild" xmlns="" />
Run Code Online (Sandbox Code Playgroud)
我已经尝试过这段代码:
$beforeBuild.RemoveAttribute("xmlns");
$project.AppendChild($beforeBuild);
$beforeBuild.RemoveAttribute("xmlns");
Run Code Online (Sandbox Code Playgroud) 我有这个文件,我想用PowerShell阅读:
var myMap =
[
{
"name": "JSON Example",
"attr": "Another attribute"
}
]
Run Code Online (Sandbox Code Playgroud)
我的PowerShell v3代码:
$str = Get-Content $file | Select -Skip 1;
$str | ConvertFrom-Json;
Run Code Online (Sandbox Code Playgroud)
但我总是得到这个错误:
ConvertFrom-Json : Invalid array passed in, ']' expected. (1): [
At S:\ome\Path\script.ps1:60 char:8
+ $str | ConvertFrom-Json;
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
Run Code Online (Sandbox Code Playgroud)
如果我手动将JSON代码复制并粘贴到代码中,一切正常:
'[
{
"name": "JSON Example",
"attr": "Another attribute"
}
]' | ConvertFrom-Json;
Run Code Online (Sandbox Code Playgroud) 我试图在Blogger博客的模板中包含webfonts:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<link href='http://fonts.googleapis.com/css?family=Share:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Istok+Web:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/>
<b:if cond='data:blog.isMobile'>
<meta content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0' name='viewport'/>
<b:else/>
Run Code Online (Sandbox Code Playgroud)
当我尝试保存模板时,我得到:
Error parsing XML, line 5, column 76: The reference to entity "subset" must end with the ';' delimiter.
Run Code Online (Sandbox Code Playgroud)
我试图添加;但不成功.链接是从Google Web Font生成和获取的.
我该如何解决这个问题?谢谢.