小编Pet*_*ich的帖子

R:无效的下标类型'list'

我正在尝试使用数据集的已排序列的索引.我想按一个排序列重新排序整个数据集.

area.sort<-sort(xsample$area1, index.return=TRUE)[2]
Run Code Online (Sandbox Code Playgroud)

输出是一个列表,所以我不能在整个数据集中使用它索引.

Error in xj[i] : invalid subscript type 'list'
Run Code Online (Sandbox Code Playgroud)

有人建议使用unlist但我无法摆脱ix*.有任何想法吗?谢谢

> area.sort<-unlist(area.sort)

 ix1   ix2   ix3   ix4   ix5   ix6   ix7   ix8   ix9  ix10  ix11  ix12  ix13 
  45    96    92    80    53    54    24    21    63    81    40    66    64 
Run Code Online (Sandbox Code Playgroud)

r list subscript

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

来自 Kafka Producer 的控制台消息过多

如何控制 Kafka 生产者或消费者的控制台日志记录级别?我在 Scala 中使用 Kafka 0.9 API。

每次调用时sendKafkaProducer控制台都会给出如下输出。这是否表明我的设置不KafkaProducer正确,而不仅仅是日志记录过多的问题?

17:52:21.236 [pool-10-thread-7] INFO  o.a.k.c.producer.ProducerConfig - ProducerConfig values: 
compression.type = none
metric.reporters = []
metadata.max.age.ms = 300000
.
.
.
17:52:21.279 [pool-10-thread-7] DEBUG o.a.kafka.common.metrics.Metrics - Added sensor with name bufferpool-wait-time
17:52:21.280 [pool-10-thread-7] DEBUG o.a.kafka.common.metrics.Metrics - Added sensor with name buffer-exhausted-records
17:52:21.369 [pool-10-thread-7] DEBUG org.apache.kafka.clients.Metadata - Updated cluster metadata version 1 to Cluster(nodes = [Node(-1, localhost, 9092)], partitions = [])
17:52:21.369 [pool-10-thread-7] DEBUG o.a.kafka.common.metrics.Metrics - Added sensor …
Run Code Online (Sandbox Code Playgroud)

log4j apache-kafka kafka-producer-api

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

Python的随机模块由Numpy的随机模块无法访问

当我调用random.sample(arr,length) 错误返回时random_sample() takes at most 1 positional argument (2 given).经过一些谷歌搜索,我发现当我想调用随机模块的样本函数时,我正在调用Numpy的随机样本函数.我尝试用不同的名称导入numpy,这不能解决问题.不过,我需要Numpy来完成剩下的程序.

有什么想法吗?谢谢

python numpy random-sample

5
推荐指数
3
解决办法
3765
查看次数

ALSA buffer xrun induced by low quality source in ffmpeg capture

I am attempting to transfer some old Video 8 tapes to my computer, though an EasyCap USB stick and the motherboard's sound line-in, on Ubuntu. I believe the arguments are correctly laid out below to capture from two independent streams, and encode them both into the output MP4 file.

Edit:

I can simplify the question a bit, now.

ALSA buffer overrun (or underrun?) is induced by the unreliable/noisy audio source. For instance, if ffmpeg captures the beginning of tape playback, …

ffmpeg aac video-capture alsa vorbis

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

Nix Flake:如何接受 Android SDK 许可证

我正在尝试使用 nix flakes 进行 android 开发。

这是我的 flake.nix:

{
  description = "test";
  outputs = { self, nixpkgs }: {
    packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
    devShell.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.mkShell {
      buildInputs = [
        nixpkgs.legacyPackages.x86_64-linux.androidenv.androidPkgs_9_0.androidsdk
      ];
    };
  };
}
Run Code Online (Sandbox Code Playgroud)

跑步nix develop给了我这样的信息:

       You must accept the following licenses:
         - android-sdk-license

       by setting nixpkgs config option 'android_sdk.accept_license = true;'.
Run Code Online (Sandbox Code Playgroud)

使用薄片时如何传递此选项nixpkgs

nix nix-flake

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

为什么 `nix flake show` 构建 ghc?

如果我查看M1 计算机的haskell.nix flake 提供的输出,它会开始构建 ghc-8.8.4 等。

\n
\xe2\x9d\xaf nix flake show github:input-output-hk/haskell.nix\ngithub:input-output-hk/haskell.nix/1b54ea01568299a0eda578ae9395e20d5c699ee1\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80checks\n\xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80aarch64-darwin\ntrace: haskell-nix.haskellLib.cleanGit: /nix/store/jmx2m0ldgrjq7p3gb4yyca47nvbvspfl-source does not seem to be a git repository,\nassuming it is a clean checkout.\ntrace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!\ntrace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!\ntrace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!\ntrace: WARNING: No materialized …
Run Code Online (Sandbox Code Playgroud)

haskell nix nix-flake

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

达到回跳限制(使用 --max-backjumps 更改)

我使用yesod init && cd lemonstand. 当我执行“cabal install”时,它会抛出错误,

Backjump limit reached (change with --max-backjumps).
Run Code Online (Sandbox Code Playgroud)

然后我通过了一个选项max-backjumps

cabal install --max-backjumps 100
Run Code Online (Sandbox Code Playgroud)

我跟着reddit的对话,做了这个,

cabal install --max-backjumps 100 --reorder-goals
Run Code Online (Sandbox Code Playgroud)

这些步骤都没有奏效。有什么线索吗?

haskell cabal yesod

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