小编Pau*_*per的帖子

Visual Studio项目文件指定多个导入

我有一个C#项目.我想构建一个exe或MSI,具体取决于配置.

MSI定义为

<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">MSI</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
  <ProductVersion>9.0.30729</ProductVersion>
  <ProjectGuid>{DCB76E90-6364-4DFB-B568-3680EE4F9C80}</ProjectGuid>
  <SchemaVersion>2.0</SchemaVersion>
  <OutputName>Project1</OutputName>
  <OutputType>Package</OutputType>
  <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
  <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MSI|x86' ">
  <OutputPath>bin\MSI2\</OutputPath>
  <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
  <Compile Include="MyWxs.wxs" />
</ItemGroup>
Run Code Online (Sandbox Code Playgroud)

问题是,当我尝试两者兼而有之时

<Import Project="$(WixTargetsPath)" />
Run Code Online (Sandbox Code Playgroud)

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Run Code Online (Sandbox Code Playgroud)

错误

A problem occurred while trying to set the "TargetType" parameter for the IDE's in-process compiler.
Invalid target type "package" for …
Run Code Online (Sandbox Code Playgroud)

c# windows-installer wix visual-studio-2008

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

克隆Google Docs的CSS样式

我正在使用侧面板为Google Docs制作Google Apps脚本.

我想要匹配Google Docs所具有的按钮,滚动条等样式.

在此输入图像描述

仅供参考,很多CSS似乎都被缩小/混淆了.

scb-button-icon
jfk-star
Run Code Online (Sandbox Code Playgroud)

我在哪里可以找到这样的东西?

我认为Google Apps脚本可能提供了这样的东西,因为一致性使得用户体验变得更好.

如果官方消息来源不可用,是非官方消息来源吗?

css google-apps-script

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

Scala中通用Integral的类型不匹配

我正在尝试为Scala中的Base64可变长度量量编码解码器.

(Base64 VLQ对有符号整数序列进行编码.编码对编码的整数范围没有限制.)

对于我目前的用例,我知道这就Seq[Int]足够了.当然,我想做到这一点,所以我可以解码Seq[Long],甚至Seq[BigInteger],甚至类似的东西Seq[Short].

算法完全相同,只是有不同的类型.

通用的救援!(或者我想.)


object Base64Vlq {
  val continuationMask = (1 << 5).toByte
  val signMask = 1.toByte

  def decode[T <: Integral[T]](bytes: Seq[Byte]): Seq[T] = {
    val result = scala.collection.mutable.ListBuffer[T]()
    bytes.foldLeft((0, 0)) { (arg, byte) =>
      val (value, n) = arg
      if((byte & continuationMask) == 0) {
        val newValue = value + (byte / 2 & ~continuationMask) << 5 * n
        result += (if((byte & signMask) == 0) { …
Run Code Online (Sandbox Code Playgroud)

generics encoding scala type-conversion

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

如何在 Jenkins DSL 中添加上游作业

我可以使用 Jenkins 的 DSL 插件完成下游工作:

https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-reference#downstream

我怎样才能做一个上游工作(同样的事情......只是在不同的地方指定)?

在 UI 中,它位于 Triggers 下:“在构建其他项目后构建”。

jenkins jenkins-job-dsl

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

Java抽象方法签名

我对Java类实现的抽象方法签名感到很困惑.

例如,考虑:

interface Programmer {
    Object program();
}

class Linus implements Programmer {
    public String program() {
        return "goto end;";
    }
}

public class Main {
    public static void main(String[] args) {
        System.out.println(new Linus().program());
    }
}
Run Code Online (Sandbox Code Playgroud)

这显然是可以接受的,因为任何期望来自Linus.program()的Object都会得到一个(特别是一个String).

但现在考虑一下:

interface OS {
    void run(String code);
}

class Linux implements OS {
    public void run(Object code) {
        System.out.println("Hello world");
    }
}

public class Main {
    public static void main(String[] args) {
    new Linux().run("print 'Hello world'");
    }
}
Run Code Online (Sandbox Code Playgroud)

这无法编译,并产生错误:

The type Linux must …
Run Code Online (Sandbox Code Playgroud)

java methods polymorphism inheritance abstract

0
推荐指数
1
解决办法
2033
查看次数

如何从Python shell执行Python程序?

我是非常新的Python,我有一个疑问.

如果我在文本编辑器(如Nodepad ++)中编写程序,那么我可以从Python shell(以>>开头的那个)执行它吗?我有什么命令可以启动来执行我的Python程序?

TNX

安德里亚

python python-3.x

0
推荐指数
1
解决办法
242
查看次数

随机生成边和顶点

我正在学习最小生成树,我遇到了这个问题并决定尝试一下......

在随机生成的 100 个顶点和 800 个边的有向图网络上实现最小生成树算法

public static int[][] getRandomArray(int n){
    int[][] a = new int[n][n];
    Random r = new Random();

    for(int i = 0; i < a.length; i++){
        for(int j = 0; j < a[i].length; j++){
            a[i][j] = r.nextInt();
        }
    }

    return a;
}


public static void main (String [] args)
{
   int x[];
     //TreeSet is used to sort the edges before passing to the algorithm
    TreeSet<Edge>  edges = new TreeSet<Edge>();

    Random random = new Random();

    edges.add(new Edge("0", "1", …
Run Code Online (Sandbox Code Playgroud)

java random algorithm graph kruskals-algorithm

0
推荐指数
1
解决办法
2701
查看次数

播放可选查询参数不解析

我正在尝试Play 2.1.1 的文档化路由示例

路线

# The version parameter is optional. E.g. /api/list-all?version=3.0
GET   /api/list-all         controllers.Api.list(Option[version])
Run Code Online (Sandbox Code Playgroud)

然后

$ play-2.1.1 compile
[error] /home/paul/server/conf/routes:2: Compilation error[`)' expected but `[' found]
Run Code Online (Sandbox Code Playgroud)

出了什么问题?

routing scala query-parameters playframework playframework-2.1

0
推荐指数
1
解决办法
299
查看次数

为什么 Python、Ruby 和 Node.js 比 Bash、AWK、Perl 慢这么多?

在制作多语言 makefile(启动数千个进程)时,我注意到脚本语言的启动性能差异很大


重击

$ TIMEFORMAT='%3R'; time bash -c "echo 'hello world'" > /dev/null
0.002
Run Code Online (Sandbox Code Playgroud)

AWK

$ TIMEFORMAT='%3R'; time awk "BEGIN { print \"hello world\" }" > /dev/null
0.002
Run Code Online (Sandbox Code Playgroud)

珀尔

$ TIMEFORMAT='%3R'; time perl -e "print \"hello world\n\"" > /dev/null
0.003
Run Code Online (Sandbox Code Playgroud)

所有这些本质上是相同的。但是这些脚本语言中的每一种都慢了一个数量级(!)。

Python

$ TIMEFORMAT='%3R'; time python -c "print 'hello world'" > /dev/null
0.023
Run Code Online (Sandbox Code Playgroud)

红宝石

$ TIMEFORMAT='%3R'; time ruby -e "puts 'hello world'" > /dev/null
0.024
Run Code Online (Sandbox Code Playgroud)

节点.js

$ TIMEFORMAT='%3R'; time node -e "console.log('hello world')" > /dev/null
0.082
Run Code Online (Sandbox Code Playgroud)

Python、Ruby 和 …

ruby python node.js

0
推荐指数
1
解决办法
122
查看次数