小编Non*_*one的帖子

在python中获取监视器大小

我正在使用python并想要创建一个全屏窗口.我知道pygame.FULLSCREEN标志,但是当我使用它时,屏幕周围会出现黑色区域​​.有没有办法使用python获取显示器大小,所以我可以使窗口正确的大小?

python pygame monitor fullscreen

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

交叉编译gcc

我按照此处的说明进行交叉编译 GCC。我在Mac上。当我从 gcc 源文件夹运行此命令时:./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,fortran,java,objc,obj-c++,treelang我收到此错误:configure: error: GMP 4.1 and MPFR 2.2.1 or newer versions required by fortran。当我将命令更改为此(我无法编译 GMP)时:./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,java,objc,obj-c++,treelang我收到此错误:

The following requested languages could not be built: ada
Recognised languages are: c,ada,c++,fortran,java,objc,obj-c++,treelang
Run Code Online (Sandbox Code Playgroud)

这对我来说没有意义,因为它说 ada 被认可。启用语言设置的所有其他配置(当设置未更改且使用默认值时)都会出现以下错误:

/usr/local/cross/i586-elf/bin/ranlib ./libgcov.a
_error_not_here_yet - havent even thought about it - it may even work
make[1]: _error_not_here_yet: Command not found
make[1]: *** [treelang.all.cross] Error 127
make: *** [all-gcc] Error 2
Run Code Online (Sandbox Code Playgroud)

如何交叉编译 …

c c++ gcc makefile cross-compiling

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

用于收集参数的 Bison 语法

我有一个用于收集函数参数的野牛语法。到目前为止,情况是这样的:

args: arg               {$$ = intArray($1);} //pseudo-code function
    | args arg          {$$ = $1 + $2;}       //pseudo-code array addition
arg : NUM               {$$ = $1;}
    | exp               {$$ = $1;}
Run Code Online (Sandbox Code Playgroud)

如何创建一个没有固定长度的整数数组,可以像 Bison 中的普通 C 数组一样使用?

c arrays mutable bison flex-lexer

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

在干净的仿真器上测试Android应用程序

当我想测试一个Android应用程序时,我创建一个新的AVD,在模拟器中启动它,等待模拟器完成启动,然后使用ADB安装应用程序,当我完成后删除AVD.是否有任何工具可以自动执行所有这些步骤?我尝试编写自己的,但我找不到一种方法来判断模拟器是否完全启动,因为Android SDK网站说不使用"adb wait-for-device install file.apk".

android adb android-virtual-device android-emulator

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

wxPython TreeCtrl在显示箭头时没有显示root

我正在使用wxPython制作一个python树可视化工具.它会像这样使用:

show_tree([ 'A node with no children', ('A node with children', 'A child node', ('A child node with children', 'Another child')) ])
Run Code Online (Sandbox Code Playgroud)

它运行正常但它显示了一个值为"Tree"的根.我这样做是为了创造多个根,但后来才知道我不允许这样做.我恢复了原来的代码,但是用它改变了它:self.tree = wx.TreeCtrl(self)对此:self.tree = wx.TreeCtrl(self, style=wx.TR_HIDE_ROOT).它工作但它没有显示侧面的小箭头,所以你不知道哪些节点有孩子.有没有办法隐藏根节点但保留箭头.注意:我在使用Python 2.5版和wxPython版本2.8.4.0的Mac上.

python tree wxwidgets treecontrol root-node

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

操作系统的Boot-loader不起作用

我正在制作一个自定义操作系统.我有两个nasm文件:

boot.asm:

[BITS 16]   ;tell the assembler that its a 16 bit code
[ORG 0x7C00]    ;Origin, tell the assembler that where the code will
;be in memory after it is been loaded

INT 0x13

JMP $       ;infinite loop

TIMES 510 - ($ - $$) db 0   ;fill the rest of sector with 0
DW 0xAA55           ; add boot signature
Run Code Online (Sandbox Code Playgroud)

start.asm:

[BITS 16]
MOV AL, 72
CALL PrintCharacter
MOV AL, 101
CALL PrintCharacter
MOV AL, 108
CALL PrintCharacter
MOV AL, 108 …
Run Code Online (Sandbox Code Playgroud)

x86 kernel nasm osdev bootloader

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

如何在Mac OSX Leopard上安装JDK 1.6?

如何在Mac OSX Leopard上安装JDK 1.6?

在今天的软件更新中,我更新了Java,并从它升级1.5.0_26到1.5.0_28(这不是1.6!).我安装了Xcode Tools,版本3.0.在下载站点上,它没有列出Mac.

java macos osx-leopard jdk1.6

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

支持Mercury的IDE或编辑器

除了emacs之外,还有支持Mercury的IDE或编辑器吗?

ide editor mercury

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

为init运行python文件的Linux内核

使用内置或可从内核访问的python解释器来构建Linux内核是否可能并且并不难以置信,它可以运行python文件作为init进程?

python linux kernel init

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

mac上的mono的pkg-config路径

我在Mac OS X中安装了mono.我在mono网站上按照这些说明操作.第一个控制台应用程序工作,因为它没有使用任何包.但是,当我跑的时候gmcs hello.cs -pkg:gtk-sharp-2.0,它告诉我我没有安装pkg-config.所以我安装了pkg-config.现在我收到此错误,因为pkg-config不知道单声道包路径:

Perhaps you should add the directory containing `gtk-sharp-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk-sharp-2.0' found
error CS8027: Error running pkg-config. Check the above output.
Run Code Online (Sandbox Code Playgroud)

单声道包路径在哪里以及我需要添加什么.bash_profile才能使Mono能够找到包?

c# macos mono gtk# pkg-config

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

从Qt字符串打开文件

我正在制作一个Qt应用程序,我有一个按钮来打开一个连接到自定义插槽的文件.这是到目前为止的插槽代码:

void MainWindow::file_dialog() {
    const QFileDialog *fd;
    const QString filename = fd->getOpenFileName();
}
Run Code Online (Sandbox Code Playgroud)

我怎么能拥有它然后将文件名转换为a const char *,打开文件,读取它并将文本存储在QString中,然后关闭文件.我正在使用Qt4.

c++ file-io qstring qt4 qfiledialog

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

python将度数转换为x并更改为y

我正在用pygame在python中制作一个蛇游戏,并且为了移动角色,我有一个整数,它应该是它应该移动的角度.我有什么方法可以根据度数来改变x和y的变化吗?例如:func(90) # [0, 5]或func(0) # [5, 0]

python pygame coordinates degrees

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

Objective-C通过NSString迭代获取字符

我有这个功能:

void myFunc(NSString* data) {
    NSMutableArray *instrs = [[NSMutableArray alloc] initWithCapacity:[data length]];
    for (int i=0; i < [data length]; i++) {
        unichar c = [data characterAtIndex:i];
        [instrs addObject:c];
    }
    NSEnumerator *e = [instrs objectEnumerator];
    id inst;
    while (inst = [e nextObject]) {
        NSLog("%i\n", inst);
    }
}
Run Code Online (Sandbox Code Playgroud)

我认为它失败了[instrs addObject:c].它的目的是遍历NSString的十六进制数.导致此代码失败的原因是什么?

iteration nsenumerator objective-c nsmutablearray

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