小编Mar*_*ler的帖子

从android init.rc执行静态程序

我想在这个init过程中启动一个自定义程序.我静态地编译了这个程序,从我启动的android stock ROM中运行良好.

从android init.rc文档我读到exec命令是我需要的.
BTW所有我能看到的dmesg是我的程序退出代码-1(我无法返回).

init.rc 片段:

on post-fs-data
write /dev/kmsg "launching test"
exec /data/test
Run Code Online (Sandbox Code Playgroud)

我所看到的dmesg只是:

<4>[    6.336816] launching test
<6>[    6.336902] init: command 'write' r=0
<6>[    6.337115] init: command 'exec' r=-1
Run Code Online (Sandbox Code Playgroud)

在这里,您是可执行的源代码:http://pastebin.com/Hym1APWx


UPDATE

我试图静态编译并运行这个程序:

int main(){return 0; }
Run Code Online (Sandbox Code Playgroud)

但结果总是如此command 'exec' r=-1.也许用户uselen是正确的,也许我无法/data在早期启动阶段运行可执行文件.

android initialization

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

GNU广播版

如何找到我安装的GNU Radio版本?

我想使用他们的消息库,但它们仅在较新版本的gnuradio上可用,并且出于某种原因,当我尝试使用以下代码时出现编译错误:

message_port_register_out(pmt::mp("out_message"));
Run Code Online (Sandbox Code Playgroud)

我在编译时遇到以下错误:

error: ‘message_port_register_out’ was not declared in this scope
Run Code Online (Sandbox Code Playgroud)

它应该是gr_basic_block所有块继承的一部分,但它不是编译的.

c++ gnuradio

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

cmake for GNU Radio 教程

我试图按照在 gnuradio 网站上构建信号处理块的教程进行操作:http : //gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules

但是,当涉及到需要我使用 CMake 的步骤时,终端抱怨说

package cppunit is not found  checking for module 'cppunit'
--   package 'cppunit' not found
-- Could NOT find CPPUNIT (missing:  CPPUNIT_INCLUDE_DIRS) 
CMake Error at CMakeLists.txt:101 (message):
  CppUnit required to compile howto
Run Code Online (Sandbox Code Playgroud)

我尝试过诸如sudo apt-get cppunit.

cppunit gnuradio cmake

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

是否存在用于生成带限锯齿的恒定时间算法?

我正在研究GPU合成音频的可行性,其中每个线程呈现一个样本.这对可以使用的算法提出了一些有趣的限制 - 任何引用前一组样本的算法都不能以这种方式实现.

过滤是这些算法之一.带通,低通或高通 - 所有这些都需要查看生成的最后几个样本以计算结果.这是不可能的,因为尚未生成那些样本.

这使得合成带限波形变得困难.一种方法是使用傅里叶级数对部分进行加法合成.但是,这在O(n)时间运行,并且在GPU上特别慢,以至于并行性增益丢失.如果有一个算法在O(1)时间运行,这将消除分支,并且在处理可听范围时可以快达1000倍.

我特意为锯齿寻找像DSF这样的东西.我一直在尝试手工制作傅里叶系列的简化,但这确实很难.主要是因为它涉及谐波数,AKA是Riemann-Zeta函数的唯一奇点.

是否可以实现恒定时间算法?如果没有,可以证明它不是吗?

algorithm parallel-processing gpgpu signal-processing audio-processing

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

无法从列表中删除项目

我有这个清单:

['ammassuladu', 'papa', 'tintola (Alghero)', 'viri, b?vere', "'acha", "'arzola", "'ccetta", "'eneru", "'enucru", "'enucr u", "'erru", "'estire", "'estire", "'ichu", "'ichumurisca", "'idru", "'inu", 'cherjere', 'mariane', 'mrex?ni', 'matxoni (Alghero)', 'bolta, borta', 'cociula', 'rem?liu', 'molinana', 'v?rtitxe (Alghero)', 'vot?i,  bot?re,  vot?re', 'trimizon e', 'vulc?nu, vurcanu', 'sbori?i,  ibboidare,  sbuid?i', 'txapar (Alghero), cav? (Tabarchino)', 'taffaranu, tafferanu', 'safiru', 'butirera,  butirrera, bitu?ra', 'tzintzalu,  tzintzula,  tintula', 's?nciu, sinsulu, sintzu, sintzula', 'marr a', 'marrare', 'zia', 'tia', 'tzia, cia', 'ziz?', 'lamparaxu', 'orgiali, orxali,  orxabi', 'zingaru, zinganu', 'ziu', 't io', 'tiu, tziu', 'tuche, …
Run Code Online (Sandbox Code Playgroud)

python list python-3.x

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

如何在matlab中删除矢量矢量

如何从矢量中删除矢量?例如:

a=[1,2,3,4,5]
Run Code Online (Sandbox Code Playgroud)

如何b=[2,3,5]从上面的矢量中删除

c=[1,4].
Run Code Online (Sandbox Code Playgroud)

我有一个有100个元素的向量.

matlab vector subtraction

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

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

GNURadio/GRC 中的串行输出块

我正在做一个涉及 GNU Radio/GRC 的项目,对这个软件不是很熟悉。我正在尝试使用块将数据输出到 GNU Radio 中的串行端口,但尚未找到方法。

我想知道是否有一个预定义的块,我可以用它来将这些信息放入串行端口(Raspberry Pi 3 上的 USB),或者我是否必须创建自己的块。如果我必须创建自己的块,那么代码会是什么样子。

我已经能够使用文件接收器将数据写入文件,以确保我正在获取数据,并且想知道修复是否像将文件接收器更改为串行端口接收器一样简单。见下图:

https://i.stack.imgur.com/WcyRY.jpg 摘录

我还做了一些研究,发现了一个看起来像我需要的 github 存储库——不幸的是,它链接到的存储库已经不存在了。它确实提到了使用 pyserial,我认为这是用于在 python 中创建我自己的块的意思。该存储库的链接如下:

https://github.com/jmalsbury/gr-pyserial

serial-port gnuradio gnuradio-companion

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

C 和 C++ 使用 goto 时汇编代码中的 jmp 指令差异

我在 C 和 C++ 中使用相同的代码片段。

#include <stdio.h>

int main() {
    goto myLabel;
    printf("skipped\n");
myLabel:
    printf("after myLabel\n");
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

使用 Visual Studio 2022 IDE 和编译器。

C++ 的汇编代码

0000000140001000  sub         rsp,28h  
0000000140001004  jmp         0000000140001014  
0000000140001006  jmp         0000000140001014  
0000000140001008  lea         rcx,[0000000140004230h]  
000000014000100F  call        0000000140001090  
0000000140001014  lea         rcx,[0000000140004240h]  
000000014000101B  call        0000000140001090  
0000000140001020  xor         eax,eax  
0000000140001022  add         rsp,28h  
0000000140001026  ret  
Run Code Online (Sandbox Code Playgroud)

C 的汇编代码

0000000140001000  sub         rsp,28h  
0000000140001004  jmp         0000000140001012  
0000000140001006  lea         rcx,[0000000140006000h]  
000000014000100D  call        0000000140001090  
0000000140001012  lea         rcx,[0000000140006010h]  
0000000140001019  call        0000000140001090  
000000014000101E  xor         eax,eax  
0000000140001020 …
Run Code Online (Sandbox Code Playgroud)

c c++ assembly visual-studio-2022

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

如何编辑 GNU Radio 的文件接收器生成的文件?

我发现file sink block生成的文件是二进制格式的,linux下gedit什么的都不能编辑,那我怎么编辑这个文件呢?

我发送了一个包含“hello world”的 dat 文件,我想收到一个包含“hello world”的文件

binary file gnuradio

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