小编GS *_*ica的帖子

我可以将TeamCity定义上传为XML吗?

TeamCity似乎在内部将构建,项目,模板等的定义存储为XML.

这在"管理>审核"视图中公开,您可以在其中查看人们对各个配置所做的差异,如URL http://teamcityserver/admin/settingsDiffView.html?id=project:project10&versionBefore=8&versionAfter=9&actionId=3151

我想部分地从Web界面外部管理TeamCity设置 - 例如,将构建定义保留在版本控制中,并且可能以编程方式生成它们.

有什么方法可以直接上传这种格式的定义(或任何类似的替代方案)?我知道TeamCity有各种API和扩展点,但没有设法找到任何可以直接访问这样的东西.

如果有必要,我可以使用TeamCity版本改变格式 - 为其他好处支付是合理的价格.

teamcity

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

具有并发垃圾收集器的函数式语言?

Microsoft的新F#编程语言提供了功能编程(一流的词法闭包和尾调用)与高效的并发垃圾收集器的强大组合,可以轻松利用多核.

OCaml,Haskell,Erlang以及我所知道的所有免费的Lisp和Scheme实现没有并发GC.Scala和Clojure有一个并发GC但没有尾调用.

因此似乎没有结合这些功能的开源编程语言.那是对的吗?

concurrency garbage-collection tail-call

4
推荐指数
3
解决办法
1085
查看次数

使用GZipStream对MemoryStream进行编程压缩/解压缩

我构建(基于CodeProject文章)一个包装类(C#)来使用a GZipStream来压缩a MemoryStream.它压缩很好但不会减压.我看了很多其他有相同问题的例子,我觉得我跟着说的是什么,但是当我解压缩时仍然没什么.这是压缩和解压缩方法:

public static byte[] Compress(byte[] bSource)
{

    using (MemoryStream ms = new MemoryStream())
    {
        using (GZipStream gzip = new GZipStream(ms, CompressionMode.Compress, true))
        {
            gzip.Write(bSource, 0, bSource.Length);
            gzip.Close();
        }

        return ms.ToArray();
    }
}


public static byte[] Decompress(byte[] bSource)
{

    try
    {
        using (MemoryStream ms = new MemoryStream())
        {
            using (GZipStream gzip = new GZipStream(ms, CompressionMode.Decompress, true))
            {
                gzip.Read(bSource, 0, bSource.Length);
                gzip.Close();
            }

            return ms.ToArray();
        }
    }
    catch (Exception ex)
    {
        throw new Exception("Error decompressing byte array", ex); …
Run Code Online (Sandbox Code Playgroud)

.net c# gzip c#-3.0 c#-4.0

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

编译到cortex-m0时,unsigned int不是uint32_t - 可能是C编译器标志问题

我需要移植一个项目,使用自己的Makefile运行Eclipse.我修改了它的makefile,我猜错误是连接到它或编译器标志.

主持人:Virtualbox Win 8,x64,目标设备:nrf51822,这是arm cortex-m0.我使用gnu arm交叉编译器4.8.4(GNU Tools ARM Embedded)

编译显示以下错误/警告消息:

src/main.c:173:4: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' [-Werror=format=]
Run Code Online (Sandbox Code Playgroud)

我不明白.在这种情况下,uint32_tunsigned int.我已经包含了stdint.h.

我使用以下标志编译源代码:

CFLAGS += -mcpu=cortex-m0 -mthumb -mabi=aapcs --std=gnu11 -funsigned-char -DNRF51 -DDEBUG_NRF_USER -DBLE_STACK_SUPPORT_REQD -DBOARD_PCA10000 -DNRF51822_QFAA_CA
CFLAGS += -Wall -Werror
CFLAGS += -mfloat-abi=soft
Run Code Online (Sandbox Code Playgroud)

不是-mcpu = cortex-m0指定整数的大小?stdint.h预处理器宏应生成"typedef unsigned int __uint32_t;".Eclipse显示这行已编译,但我不知道是否相信它,因为外部makefile与其自己的编译器一起使用.

c gcc uint32 compiler-warnings

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

DrScheme 中如何实现尾调用优化?

我听说蹦床是实施 TCO 的一种无效方式。DrScheme(PLAI Scheme,技术上)是如何做到的?它是否以“正确”的方式执行(即,生成直接分支到尾调用的汇编代码,而不是通过堆栈和蹦床)?

c optimization scheme programming-languages tail-call-optimization

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

Haskell:删除最大的列表

我有一个列表列表,以及一个返回包含最多项目的列表的函数:

extract ::[Plateau]->Plateau

extract(x:xs) 
  |x==maximumBy(compare `on` length)(x:xs)=x 
  |otherwise = extract(xs)
extract []=[""]
Run Code Online (Sandbox Code Playgroud)

现在我需要一个函数来获取相同的函数[Plateau]并返回一个[Plateau]删除了之前最大的函数:

prune::[Plateau]->[Plateau]
prune(x:xs)
  |x < (maximumBy(compare `on` length)(x:xs)=x : prune (xs)
  |x>=maximumBy(compare `on` length)(x:xs)=[]
prune [] = [] 
Run Code Online (Sandbox Code Playgroud)

我也打电话给修剪,sortBy以确保最大的列表是最后一个:

(extract . prune) (sortBy(compare `on` length)(plateaus))
Run Code Online (Sandbox Code Playgroud)

这开始正常工作.我的列表plateaus看起来像:

plateaus = ["01000"], ["01010", "11010", "10010"] ["00101"], ["01101", "01001"]]
Run Code Online (Sandbox Code Playgroud)

在这里排序:

 [["01000"], ["00101"], ["01101", "01001"], ["01010", "11010", "10010"]]
Run Code Online (Sandbox Code Playgroud)

现在,我的函数prune正在返回一个列表

[["01000"], ["00101"]]
Run Code Online (Sandbox Code Playgroud)

这告诉我,由于某种原因Haskell认为

["01101", "01001"] >= ["01010", "11010", "10010"]
Run Code Online (Sandbox Code Playgroud)

当我可以清楚地看到2> = 3不是真的.

为什么是这样?

haskell list

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

无法构建交叉编译器

我似乎无法将Rust作为交叉编译器构建,无论是在带有MSYS2的Windows上还是在全新安装的Debian Wheezy上.两者的错误都是一样的.我运行这个配置:

./configure --target=arm-unknown-linux-gnueabihf,x86_64-pc-windows-gnu
Run Code Online (Sandbox Code Playgroud)

make make,但是make install失败了:

[...]
prepare: tmp/dist/rustc-1.0.0-dev-x86_64-pc-windows-gnu-image/bin/rustlib/x86_64-pc-windows-gnu/lib/rustdoc-*.dll
prepare: tmp/dist/rustc-1.0.0-dev-x86_64-pc-windows-gnu-image/bin/rustlib/x86_64-pc-windows-gnu/lib/fmt_macros-*.dll
prepare: tmp/dist/rustc-1.0.0-dev-x86_64-pc-windows-gnu-image/bin/rustlib/x86_64-pc-windows-gnu/lib/libmorestack.a
prepare: tmp/dist/rustc-1.0.0-dev-x86_64-pc-windows-gnu-image/bin/rustlib/x86_64-pc-windows-gnu/lib/libcompiler-rt.a
compile: arm-unknown-linux-gnueabihf/rt/arch/arm/morestack.o
make[1]: arm-linux-gnueabihf-gcc: Command not found
/home/Sandro/rust/mk/rt.mk:94: recipe for target 'arm-unknown-linux-gnueabihf/rt/arch/arm/morestack.o' failed
make[1]: *** [arm-unknown-linux-gnueabihf/rt/arch/arm/morestack.o] Error 127
make[1]: Leaving directory '/home/Sandro/rust'
/home/Sandro/rust/mk/install.mk:22: recipe for target 'install' failed
make: *** [install] Error 2
Run Code Online (Sandbox Code Playgroud)

如果我没有指定交叉架构,那么一切都会很好.我错过了一些特殊的配置标志来使其工作吗?

rust

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

如何从命令行为 Borland C++ Builder 5 构建项目文件和包?

如何从命令行构建 Borland C++ 项目文件 (bpr) 和包文件 (bpk)?项目组(bpg)显然是 make 文件,可以使用 make 进行编译。但 bpks 和 bprs 是基于 xml 的,导出到 Makefile 无法使用 make 进行编译。如果我将项目放入 bpg 中,make 似乎无法找到 bpg 中指定的任何文件,因为它们似乎都是相对引用。我更改了对绝对值的引用并生成报告: Fatal: Unable to open makefile

command-line c++builder

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

如何在F#中定义两个相互依赖的类型?

我对F#很新,所以请不要怪我:)

我的服务给了我用户,组和其他对象.userobject看起来像这样:

{
  "id": 0,
  "firstname": null,
  "lastame": null,
  "emailaddress": null,
  "active": false,
  "groups": null,
  "groupcount": 0,
  "createdgroups": null,
  "createdgroupscount": 0,
  "createdfiles": null,
  "createdfilescount": 0,
  "createdfolders": null,
  "createdfolderscount": 0,
  "createdvideos": null,
  "createdvideoscount": 0,
  "createdcategories": null,
  "createdcategoriescount": 0
}
Run Code Online (Sandbox Code Playgroud)

组对象如下所示:

{
  "id": 0,
  "name": null,
  "description": null,
  "videos": null,
  "videocount": 0,
  "files": null,
  "filecount": 0,
  "members": null,
  "membercount": 0,
  "creator": {
    "id": 0,
    "firstname": null,
    "lastame": null,
    "emailaddress": null,
    "active": false,
    "groups": null,
    "groupcount": 0,
    "createdgroups": null,
    "createdgroupscount": 0,
    "createdfiles": null, …
Run Code Online (Sandbox Code Playgroud)

f# types

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

解决Travis-CI上的cabal依赖性时出错

我正在尝试用Travis-CI建立我的Hakyll网站.但是,在我达到目前为止,在尝试将Hakyll安装为依赖项时,我遇到了依赖项错误.

我可以在我的机器上本地建造Hakyll而没有任何问题.什么可能导致依赖性错误,以及如何解决?有没有办法解决它而不实际硬编码每个依赖版本?

这是来自TravisCI的输出.

travis_fold:end:git.5
$ export PATH=/usr/local/ghc/$(ghc_find 7.6)/bin/:$PATH
travis_fold:start:cabal
$ cabal update
Config file path source is default config file.
Config file /home/travis/.cabal/config not found.
Writing default configuration to /home/travis/.cabal/config
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install
travis_fold:end:cabal
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
$ cabal --version
cabal-install version 1.18.0.2
using version 1.18.1 of the Cabal library 
travis_fold:start:before_install.1
$ cabal …
Run Code Online (Sandbox Code Playgroud)

haskell cabal cabal-install travis-ci hakyll

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