gnu

Python - How to get the Firefox's URL bar content in GNU/Linux?

懵懂的女人 提交于 2019-12-11 06:43:16
问题 I need to get the content of URL bar (of currently opened tab) of Firefox using Python. I've found few solutions for Windows (using libraries such as pywin32) but I need it for GNU/Linux (if available then multi-platform way is the most preferred, of course). I have also found ways doing it by installing add-on for Firefox but I want user to install only Python and (when it's needed) libraries for it [Python]. 回答1: You might have some luck with DBus, although I don't know if it is provided in

GNU M4: Define a rule that matches text, and operates on that matched text?

南楼画角 提交于 2019-12-11 06:33:08
问题 Suppose I have: File: [x] And I would like to define m4 macro: define(`\[.*\]`, ...) Question: Is this possible and how does one do it? 回答1: It isn't possible as you can see in manual of m4: 3.1 Macro names A name is any sequence of letters, digits, and the character ‘_’ (underscore), where the first character is not a digit. m4 will use the longest such sequence found in the input. If a name has a macro definition, it will be subject to macro expansion (see Macros). Names are case-sensitive.

GNU M4: expand bracketed text?

匆匆过客 提交于 2019-12-11 06:32:43
问题 If I run: define(`[x]`,`y') [x] =>[x] Nothing happens.. Is there a way to expand brackets in M4? 回答1: If the name of the macro that you have defined contains non-alphanumeric characters the only way to expand its content is by using the defn() built-in macro: define(`[x]',`y') defn(`[x]') => y 来源: https://stackoverflow.com/questions/57205431/gnu-m4-expand-bracketed-text

GNU G++ stops compiling after including D3D12 include paths (Using VSCode)

自闭症网瘾萝莉.ら 提交于 2019-12-11 05:24:44
问题 I am trying to get VSCode to compile DS3 Code, I have heard I needed these four include paths for D3D files to compile (to include d3d12.h): C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\shared C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\winrt C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\cppwinrt Source: I can't configure include paths in VSCode for D3D12 So I did include them but now a

opendir: Too many open files

…衆ロ難τιáo~ 提交于 2019-12-11 05:14:31
问题 I write this code to print all files in /home/keep with absolution path: #include <dirent.h> #include <sys/stat.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> void catDIR(const char *re_path); int main(int argc, char *argv[]) { char *top_path = "/home/keep"; catDIR(top_path); return 0; } void catDIR(const char *re_path) { DIR *dp; struct stat file_info; struct dirent *entry; if ((dp = opendir(re_path)) == NULL) { perror("opendir"); return

Segmentation fault when run hello.s by GNU Assembler in Cygwin

守給你的承諾、 提交于 2019-12-11 04:15:47
问题 I use gcc in Cygwin (in Windows7-64 bit) to run this example http://asm.sourceforge.net/howto/build.html .data # section declaration msg: .ascii "Hello, world!\n" # our dear string len = .-msg # length of our dear string .text # section declaration # we must export the entry point to the ELF linker or .global _start # loader. They conventionally recognize _start as their # entry point. Use ld -e foo to override the default. _start: # write our string to stdout movl $len,%edx # third argument:

Meaning of '@' in “@set -e” command in Makefiles [duplicate]

霸气de小男生 提交于 2019-12-11 03:19:54
问题 This question already has answers here : What does @: (at symbol colon) mean in a Makefile? (2 answers) Closed 3 years ago . In Makefile, in commands of the form all: @set -e; \ do more stuff I know the set -e commands the shell to to exit on failure. What is the significance of the @ attached to set ? 回答1: In a Makefile, the @ symbol means that the command is not echoed to the screen when it is run. 来源: https://stackoverflow.com/questions/27400830/meaning-of-in-set-e-command-in-makefiles

Parallel tar with split for large folders

徘徊边缘 提交于 2019-12-11 02:35:57
问题 I am have really huge folder I would like to gzip and split them for archive: #!/bin/bash dir=$1 name=$2 size=32000m tar -czf /dev/stdout ${dir} | split -a 5 -d -b $size - ${name} Are there way to speed up this with gnu parallel? thanks. 回答1: It seems the best tool for parallel gzip compression is pigz. See the comparisons. With it you can have a command like this: tar -c "${dir}" | pigz -c | split -a 5 -d -b "${size}" - "${name}" With its option -p you could also specify the number of

GNU GCC compiler updating

泄露秘密 提交于 2019-12-10 20:43:44
问题 I'm using code blocks with gnu gcc compiler. But when I try to compile a range base for startment it gives many errors. So I think the compiler dosn't support C++0x. So I want to know how to know the compiler version I'm using and how to update it correctly to a C++0x supporting one. I'm using Windows XP. 回答1: This algorithm may help to start with programming with C++11 on Windows: 1) Go to http://mingw.com and download the latest MinGW distribution, install it 2) Download the CodeBlocks

Building .so with recursive function in it

≯℡__Kan透↙ 提交于 2019-12-10 18:51:05
问题 During working on some project, I faced the issue that I can't build so library. I have got the error like: relocation R_X86_64_PC32 against symbol '' can not be used when making a shared object; recompile with -fPIC Eventually I managed to find the root cause. And it was recursive function in the library. For example, I have the following well know example: .section .text .globl factorial .type factorial,STT_FUNC factorial: push %rbp mov %rsp,%rbp mov 16(%rbp),%rax cmp $1,%rax je end