小编Blu*_*Sun的帖子

在Wix安装程序中包含Bin文件夹中的所有文件

我是Wix的新手,我成功为我的项目创建了一个MSI安装程序,但是我的Bin文件夹有很多带有EXE主文件的DLL文件,我想用安装程序包含所有这些文件

我找到了这个解决方案,这似乎是正确的,但不幸的是我无法在我的Wix文件中完成此解决方案,这是我的Wix文件:

<Product Id="*" Name="Setup"
       Language="1033" Version="1.0.1.0"
       Manufacturer="ORDER MS"
       UpgradeCode="a4f0a0d0-ae64-4f62-9bb3-efa7e75072e0">

<Package InstallerVersion="200"
         Compressed="yes"
         InstallScope="perMachine" />

<MajorUpgrade Schedule="afterInstallInitialize"
              DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

<MediaTemplate />

<Feature Id="ProductFeature" Title="Setup" Level="1">
  <ComponentGroupRef Id="ProductComponents" />
  <ComponentRef Id="ApplicationShortcutDesktop" />
  <ComponentRef Id="ApplicationShortcut" />
</Feature>

<Icon Id="Icon.exe" SourceFile="$(sys.CURRENTDIR)\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.exe" />
Run Code Online (Sandbox Code Playgroud)



<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
  <Component Id="ProductComponent">
    <File Source="$(var.Order.TargetPath)" />
  </Component>

  <Component Guid="A7C42303-1D77-4C70-8D5C-0FD0F9158EB4" Id="CopyComponent">
    <CopyFile Id="SomeId" 
              SourceProperty="SOURCEDIRECTORY"
              DestinationDirectory="CopyTestDir" SourceName="*" />
  </Component>    
</ComponentGroup>
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

错误1 ICE18:组件的KeyPath:'CopyComponent'是目录:'INSTALLFOLDER'.目录/组件对必须在CreateFolders表中列出.

提前致谢

Abdulsalam

wix

11
推荐指数
3
解决办法
1万
查看次数

指令中的 Angular 5 实时变化检测

我非常了解 Angular 的更改检测是如何工作的,以及我们如何使用 OnChanges 钩子来检测@Input属性更改,以及订阅 ngModel valueChanges 例如指令或组件等。

任何人都可以解释这里发生了什么:

# 自定义指令:

假设我们有一个自定义指令 myNumber,它有一个 @Input() 属性 ngModel:

@Directive({
  selector: "[myNumber]"
})
class MyNumberDirective implements OnChanges {

  @Input() ngModel: any;

  constructor(private model: NgModel) {
    this.model.control.valueChanges.subscribe(data => {
      console.log('directive model changes detected by model control value change subscription');
    });
  }

  ngOnChanges(changes: SimpleChanges){
    if(changes.ngModel){
      console.log('directive input ngModel changes detected by OnChanges hook');
    }
  }
}
Run Code Online (Sandbox Code Playgroud)
  • 在上面的示例中,我将订阅设置为@Input属性 ngModel 和指令的模型对象更改。当模型值更改时,应将更改记录在控制台中。

# 组件模板:

<input type="number" myNumber [(ngModel)]="number1" />
<input type="number" myNumber [(ngModel)]="number2" /> …
Run Code Online (Sandbox Code Playgroud)

angular angular5 angular-changedetection

9
推荐指数
1
解决办法
7791
查看次数

使用Python从数据框中删除多个列

我知道如何使用Python从数据框中删除列.但是对于我的问题,数据集很大,我想要删除的列被组合在一起,或者基本上是在列标题轴上单独展开.是否有一种更短的方法来切割或删除所有列的代码行数较少,而不是像我所做的那样将其写出来.我在这里的方式是有效的,但我想要一个更加总结的方式.

flight_data_copy_final是应该存储它的变量.

提前致谢

这是我的代码:

from IPython.display import display

flight_data_copy_version1 = flight_data_copy.drop(flight_data_copy.ix[:,"Year": "FlightDate"].columns, axis=1)
flight_data_copy_version2 = flight_data_copy_version1.drop("TailNum", axis=1)
flight_data_copy_version3 = flight_data_copy_version2.drop("OriginStateFips", axis=1)
flight_data_copy_version4 = flight_data_copy_version3.drop("DestStateFips", axis=1)
flight_data_copy_version5 = flight_data_copy_version4.drop("Diverted", axis=1)
flight_data_copy_version6 = flight_data_copy_version5.drop("Flights", axis=1)
flight_data_copy_final = flight_data_copy.drop(flight_data_copy_version6.ix[:,"FirstDepTime":].columns, axis=1)

print (display (flight_data_copy_final))
Run Code Online (Sandbox Code Playgroud)

python data-manipulation dataframe pandas

8
推荐指数
2
解决办法
3万
查看次数

在二进制堆上实现迭代器

我正在寻找一种在二进制堆(最大或最小)上实现迭代器的方法。

也就是说,通过第i次使用其nextNode()函数,可以获得堆中第i个(更大或更小的)元素。

请注意,此操作是在没有实际提取堆根的情况下发生的!

我最初的想法是:

  • 实际上提取i元素,将它们压入堆栈,然后在获得第i个值后将它们重新插入堆中。每个函数调用都需要O(i * log(n))。
  • 保留一个辅助排序的数据结构,该结构可以允许在O(1)中查找下一个值,但是更新将占用O(n)。

我了解这些方法消除了使用堆的好处,因此我正在寻找一种更好的方法。

heap iterator binary-heap

7
推荐指数
1
解决办法
206
查看次数

如何将"类项目"中的dll嵌入到我在vb.net中的项目中

我有一个标准的"类库"项目,其中包含一组用于在几乎所有新项目中导入的类.

我的工作方式是创建一个空的项目,这是我的主要项目的新解决方案,然后我添加到解决方案中提到的类库项目,这样我可以看到在Soluction资源管理器这两个项目,甚至可以看到的库代码或者在需要时更新它.然后我在我的主项目中编写代码并编译.

这导致我在编译时有2个文件:file*.exe和stdlib.dll

在某些情况下,我使用lib作为非常小的工具,我想以简单明了的方式重新分发,所以我想将我的类库项目生成的stdlib.dll嵌入到我的*.exe文件中.

我很确定必须有一个为什么要在我的Microsoft Visual Basic 2010 Express中执行此操作,但我不知道如何操作.

有什么建议吗?

非常感谢先进.

vb.net dll

6
推荐指数
1
解决办法
2万
查看次数

使用jQuery单击“ X”时,如何删除包含图像的div?

我制作了一个带有图像的盒子,在右上角有一个X。当我单击它时,我希望它删除图像,框和X。但是什么也没发生。请不要苛刻,我是Jquery和javascript的新手。

<span class="removethis">    
<div class="imformationbox1" >  
<div class="col-lg-12">
<button type="button" class="deletebutton" id="" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;<  /span></button>    
<a href="#" id="" title="Image 2"><img src="http://placehold.it/250x250 class="thumbnail img-responsive"></a>    
</div>
</div> 
</span>

<script>
$( ".deletebutton" ).click(function() {
$( ".removethis" ).remove();
});
</script>
Run Code Online (Sandbox Code Playgroud)

jquery

6
推荐指数
1
解决办法
728
查看次数

使用C#Selenium Webdriver时忽略异常等待wait.untill()函数

为了检查是否存在Element和clickble,我尝试编写一个布尔方法,该方法将等待使用C#硒的webDriverWait启用和显示该元素,如下所示:

webDriverWait等待=新的webDriverWait(驱动程序,timeSpan.fromSeconds(60));

Wait.untill(d => webElement.enabled()&& webElement.displayed());

如果以上条件没有发生,我希望该方法返回“ false”。问题是我抛出了异常。如果抛出异常,如何忽略诸如noSuchElementException和timeOutException之类的异常?我尝试使用try catch块,但是它没有帮助,并且引发了异常。

.net c# selenium selenium-webdriver visual-studio-2013

6
推荐指数
1
解决办法
4622
查看次数

导入错误:无法导入名称 PunktWordTokenizer

我试图使用 PunktWordTokenizer,但发生了如下错误。

from nltk.tokenize.punkt import PunktWordTokenizer
Run Code Online (Sandbox Code Playgroud)

这给出了以下错误消息。

Traceback (most recent call last): File "file", line 5, in <module>
from nltk.tokenize.punkt import PunktWordTokenizer ImportError: cannot import name PunktWordTokenizer
Run Code Online (Sandbox Code Playgroud)

我已经检查过 nltk 是否已安装,并且 PunkWordTokenzer 也已使用 nltk.download() 安装。需要一些帮助。

python nltk importerror

6
推荐指数
2
解决办法
4995
查看次数

如何在UISearchController中自定义searchBar?

我知道如何设置独立外观,UISearchBar如下所示。

    let searchField = searchBar.value(forKey: "searchField") as? UITextField

    if let field = searchField {
        field.backgroundColor = UIColor.defaultBackgroundColor
        field.layer.cornerRadius = 15.0
        field.textColor = .white
        field.tintColor = .white

        field.font = UIFont.systemFont(ofSize: fl(13))
        field.layer.masksToBounds = true
        field.returnKeyType = .search
    }
Run Code Online (Sandbox Code Playgroud)

但这不适用于UISearchController

在此处输入图片说明

我想将占位符和左放大镜图标的文本颜色设置为纯白色。(似乎现在它们上面有一个彩色层)。

另外,输入文本现在是黑色的,我也希望它也是白色的。

最后,我要修改以下属性。
1. textField背景颜色
2. textFiled占位符文本颜色
3. textFiled文本颜色
4. textFiled字体

有人知道怎么做吗?

将以下内容与您的代码添加到viewDidAppear中:

            let placeholderString = NSAttributedString(string: "Placeholder", attributes: [NSAttributedStringKey.foregroundColor: UIColor.white])
            field.attributedPlaceholder = placeholderString

            let iconView = field.leftView as! UIImageView
            iconView.image = iconView.image?.withRenderingMode(.alwaysTemplate)
            iconView.tintColor = .white
Run Code Online (Sandbox Code Playgroud)

Updata:
放入这些设置 …

uitextfield uisearchbar ios swift uisearchcontroller

6
推荐指数
1
解决办法
6112
查看次数

线程主java.lang.exceptionininitializerError中的异常当安装没有hadoop的spark时

我正在尝试安装spark2.3.0,更具体地说,它是spark-2.3.0-bin-hadoppo2.7

'D:\ spark\bin'已添加到环境变量PATH中.同时,安装了JDK-10.没有安装Hadoop.但谷歌说火花可以没有hadoop工作.

这是错误消息

C:\Users\a>spark-shell
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:80)
    at org.apache.hadoop.security.SecurityUtil.getAuthenticationMethod(SecurityUtil.java:611)
    at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:273)
    at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:261)
    at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:791)
    at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:761)
    at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:634)
    at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2464)
    at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2464)
    at scala.Option.getOrElse(Option.scala:121)
    at org.apache.spark.util.Utils$.getCurrentUserName(Utils.scala:2464)
    at org.apache.spark.SecurityManager.<init>(SecurityManager.scala:222)
    at org.apache.spark.deploy.SparkSubmit$.secMgr$lzycompute$1(SparkSubmit.scala:393)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$secMgr$1(SparkSubmit.scala:393)
    at org.apache.spark.deploy.SparkSubmit$$anonfun$prepareSubmitEnvironment$7.apply(SparkSubmit.scala:401)
    at org.apache.spark.deploy.SparkSubmit$$anonfun$prepareSubmitEnvironment$7.apply(SparkSubmit.scala:401)
    at scala.Option.map(Option.scala:146)
    at org.apache.spark.deploy.SparkSubmit$.prepareSubmitEnvironment(SparkSubmit.scala:400)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:170)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:136)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 2
    at java.base/java.lang.String.checkBoundsBeginEnd(Unknown Source)
    at java.base/java.lang.String.substring(Unknown Source)
    at org.apache.hadoop.util.Shell.<clinit>(Shell.java:52)
    ... 21 more
Run Code Online (Sandbox Code Playgroud)

任何人都知道我应该怎么做才能安装spark?

非常感谢先进.

java apache-spark java-10

6
推荐指数
1
解决办法
2797
查看次数