GCC and its target GCC is always configured to emit binaries for a specific target. So normally the gcc which is already available on Linux has the target "i486-linux-gnu". You can't cross-compile to an ARM target using this compiler. So you need to install another GCC configured for that target;...
Here is a simple Schwartzian transform based on the assumption that all actual values are smaller than 123456789. awk '{ printf "%s\t%s", ($2 || 123456789), $0 }' file | sort -n | cut -f2- >output ...
GCC provides the -nostartfiles, -nodefaultlibs and -nostdlib options. See documentation. Alternatively, you can call linker (ld) directly: it doesn't add anything by default, all objects (including the linker script) has to be specified manually. For an example of the ld invocation, run gcc with -v option: it would print full...
One major difference between your two solution methods is that when you use gnuplot, you're doing a fit to set the coefficients and the plotting the function from there in the same program, whereas with GSL you're copying the numbers from one program to another. If you're using the output...
If the modules are pure Perl modules, you may be able to simply append the code (including those package statements) into your program. I'd also include the POD which would include the copyright statements and the names of the authors too. That should satisfy the Artistic License Requirement (but may...
random,matrix,unique,octave,gnu
One options would be to use unique to eliminate duplicate columns, and compare the dimensions of the result with the dimensions of the original matrix. Note that we need to transpose the matrix to be able to use the rows parameter to unique. # Non unique columns octave> K=[1 2...
Not 100% percent sure if this is what you're after but this makes __file__ to output filename in quotes (on my mac os): define(`_m4__file__',defn(`__file__')) pushdef(`__file__',`"_m4__file__"') define(`_m4__line__',defn(`__line__')) pushdef(`__line__',`"_m4__line__"') define(`echo',`$*') echo(__file__,__line__) echo(__file__,__line__) output: "m4.t","8" "m4.t","9" for single quotes use a bit more escaping: define(`_m4__file__',defn(`__file__')) pushdef(`__file__',`''`_m4__file__'`'') define(`_m4__line__',defn(`__line__'))...
gnu,linear-programming,linear,ampl,glpk
You can do it as follows: s.t. rest: x['Persones'] >= 7; ...
date,makefile,make,gnu,gnu-make
From backup. Other than that, you can date all files to the same timestamp, e.g. the time now. On a Unix-like system (such as Linux or Cygwin), this command will do that for you (after you have cded to the top of the build tree): find . -type f |...
linux,path,gnu,man,system-paths
The problem is that the docs directory doesn't have the directory structure man requires (nmap.1 should be in a man1 subdirectory), same as when using the -M option: -M path, --manpath=path Specify an alternate manpath to use. By default, man uses manpath derived code to determine the path to search....
Yes, one can modify readline's edit buffer, e.g. by using the function rl_insert_text(). In order to make this useful, I think you'll need to use readline's slightly more complicated "callback interface" instead of the all-singing and dancing readline() function in your example. Readline comes with very good and complete documentation,...
I suggest awk '$1 == "ACT" { sub(/\r/, ""); curmsc = $6 } curmsc != "" && $1 == "12" { print curmsc ":" $2; curmsc = "" }' raw_output.txt Written more readably, that is $1 == "ACT" { # In the first line of an ACT block sub(/\r/, "")...
The GPL handles this explicitly. It only covers work that is derived from the original work covered by the GPL by copying or modifying GPL licensed code. The output of the program is explicitly excluded from the terms and conditions of the GPL. Since a binary compiled with GCC is...
javascript,groovy,go,base64,gnu
echo 'Laurence Tureaud is Mr. T' Echo adds a newline after the string. Try the following to remove the newline: echo -n 'Laurence Tureaud is Mr. T' | base64 And you get TGF1cmVuY2UgVHVyZWF1ZCBpcyBNci4gVA==...
The ; separates the two commands. echo a; echo b It lets the bash know that echo a and echo b are two separate commands and need to be run separately one after the other Try without semicolons $ echo a echo b a echo b Here the statement is...
In a Makefile, the @ symbol means that the command is not echoed to the screen when it is run.
On Mint 17, I was able to install Scrapy after installing following packages: sudo apt-get install libffi-dev libssl-dev libxml2-dev libxslt1-dev ...
The purpose of memfrob() (if you want to call that a purpose) is to hide strings so you don't see them when you run strings. This might be useful when your binary contains plaintext passwords and you want to stop nosey people from finding out what these passwords are. Of...
You built against a library, but the system doesn't know where the library is. Since you don't want to install the library, but rather leave it in the place where you built it, you could solve it with -rpath= option of the linker — it embeds a search path for...
We should include the corresponding header file #include <sys/sysinfo.h> ...
Directly piped to Python: parallel gpg -o - {} '|' python -c "'import sys; print sys.stdin.read().upper()'" ::: *.gpg Create decrypted file first: parallel gpg -o {.} {} ';' python -c "'import sys; print sys.argv'" {.} ::: *.gpg You need to be able to decrypt without entering a pass phrase. If...
From sed manual, i option means in-place edit -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if extension supplied) d means delete action d Delete pattern space. Start next cycle. In you example, this two combination will delete any line contain abc in the file /etc/rc.d/rc.local without backup....
Use the new cool C++11 STL random system. std::mt19937 mt(/*seed*/); std::lognormal_distribution<float> dist(/*mean*/, /*variance*/); float randomValue = dist(mt); ...
If I understand your question correctly, you're asking for what is the default behaviour of Wget. Wget will only add the extension to the local copy, if the --adjust-extension option has been passed to it. Quoting the man page for Wget: --adjust-extension If a file of type application/xhtml+xml or text/html...
Use ^ for line begin $ grep '^94.98' foo or \bs for word breaks. $ grep '\b94.98\b' foo ...
java,linux,emacs,formatting,gnu
Put this in your ~/.emacs: (add-hook 'java-mode-hook (lambda () (indent-region (point-min) (point-max)))) This registers a function to be executed when the Java major mode is entered, and that function is a lambda expression that indents the region between (point-min) and (point-max) -- i.e., the entire buffer. It will be loaded...
The double quantifier is simply a syntax error and could result in either an error message or undefined behavior. It would arguably be better if you got an error message. Perl extensions to regex post-date POSIX by a large margin; at the time these tools were written, it was extremely...
The complete reference for build systems is here. The first thing you need to do is make sure that the C:\MinGW\bin directory is in your PATH, then restart Sublime so the change gets picked up. Once you've done that, create a new build system with the following contents: { "cmd":...
The problem is $$(file). That's not a variable evaluation. That's a Command Substitution. You meant $${file} (well not quite but we'll get to that). There is also absolutely no reason to be using $(shell) here at all as you are already in a shell context when those lines run. Not...
What you are trying to do cannot work. From the documentation: Conditionals control what 'make' actually "sees" in the makefile, so they cannot be used to control recipes at the time of execution. The way I put it is that conditionals are evaluated at the time the Makefile is read....
How and where can I do this? If your feature request is just "it would be nice if GDB did this...", then open a "Feature Request" bug in gdb bugzilla. On the other hand, if you have a patch that implements your feature, mail it to [email protected] Is there...
This is a macro for the GNU m4 macro processor. This file is designed to be used with the -P or --prefix-builtins commandline option. The m4_ part will be stripped away when m4 evaluates this file. This file doesn't do anything itself, it just defines three macros (FILE_INIT, FILE_ID and...
You can either use objcopy to edit the object file or you can remove the ident line from the assembler file that gcc can create before you assemble it. Not that you'd ever need to....
Your code is a gcc extension called Statement Expression. The statements in the braces are executed, and the value of the final statement is the value of the expression. Any objects created are destroyed when the statement ends. Being in a macro makes no difference; your code (update: the original...
linux,package,gnu,openstreetmap
The wiki page describes mod_tile as 'a custom Apache module', so it's not available in your average Linux distro's repositories. It's certainly not in the Debian ones. There are instructions on that page for building the module from source....
Look at --timeout (especially --timeout 1000% seems useful). For memory limit try: ulimit -m 1000000 ulimit -v 1000000 to limit to 1 GB. See also niceload and http://unix.stackexchange.com/questions/173762/gnu-parallel-limit-memory-usage/173860?noredirect=1#comment287065_173860...
c++,makefile,gnu,autotools,tntnet
You can use either Suffix rules or Pattern rules. In your case, both should do the job equally well. The only difference is that Pattern rules are GNU-Make-specific (not compatible with Unix make), though the GNU manual I linked to discourages the use of the Suffix rules, probably because its...
Yes it is possible to send commands to an already open tmux session. i recommend you use this plugin vim-tmux-runner . you can see this Vim & Tmux video for a demo of the plugin by Jack Franklin...
This post can answer to your question. There is a technique called residual information retrieval that can read data that was deleted based on the idea that when the drive is magnetized in order to store data other parts that are close to the data is also affected by this...
Use -E option of gcc compiler to see the preprocessor output. example: gcc -E program.c -o preprocessOutput.p Then view the contents of the file preprocessOutput.p
GNU APL implements direct definition notation, lambdas, not unlike NGN/APL and Dyalog APL.
After some investigation and mangling with PCRE libs, I've actually found out that this incorrect behaviour is caused by grep itself. grep 2.21 seems to be the first version that doesn't works right, eg.: ➜ ~ grep-2.21/src/grep -Pzo '(?<=\n\n\n).*' ~/file This line has two blank lines above it. ➜ ~...
As mentioned by @Charles Duffy, and @Kevin, system() is not the function you want. popen() is more suitable. The following should work. Please note, if you are using gcc and compile with -std=c99 flag, you need to add #define _POSIX_C_SOURCE 2 before #include <stdio.h> #include <stdio.h> #include <error.h> #define PATH_MAX...
GCC is not multi-threaded. The -j<n> switch is specific to make build system, not the compiler. It tells make how many tasks it can run in parallel. If you run make -j4 you can observe in your task manager/top/process list that it tries to run 4 instances of GCC compiling...
You need to write mov rax, qword ptr [rcx]. Apparently qword by itself resolves to the size, ie. 8, so your code assembled as mov rax, 8[rcx]. Indeed, mov rax, qword also assembles as mov rax, 8. It's funny how your "cross check" used the proper syntax :)...
The objdump you're using doesn't know about the arm64 arch. 0x100000c/0x0 is the cputype (CPU_TYPE_ARM64) and cpusubtype CPU_SUBTYPE_ARM64_ALL. Why use objdump? The otool(1) program works well and is included in the Xcode developer tools / command line tools package. The command line options are a little different but one look...
Use the \()construct to separate the macro argument from the character that follows it: .macro test_cond condition, index STR\condition\()B r4, [r6, #\index*17] .endm ...
Normally, for major and minor version numbers (as in, 1.2, 1 is major and 2 is minor), they are most often written in the code directly, usually as a #define (because you might need them for conditional compilations, i.e., #if blocks). You would typically have a separate header that contains...
If you have GNU Parallel you can do this: parallel -j4 scrapy crawl urlMonitor -a slice={} ::: {1..38} GNU Parallel is a general parallelizer and makes is easy to run jobs in parallel on the same machine or on multiple machines you have ssh access to. If you have 32...
I suspect that on cygwin the -g parameter is not taken implicitly but on gnu(mingw installed with codeblocks?) gcc it is taken implicitly. Edit: seems foolish when read again try adding -g when you are compiling on cygwin, your executable should be larger. on codeblocks(mingw) try the release target...
c,linker,cross-compiling,gnu,xilinx
You can use a linker script for that. Maybe you are already using one to specify the memory section attributes. So, just add: MEMORY_CACHEABLE : { BEGIN_MEMORY_CACHEABLE = .; *(MEMORY_CACHEABLE) END_MEMORY_CACHEABLE = .; } Then in the C code: extern char BEGIN_MEMORY_CACHEABLE, END_MEMORY_CACHEABLE; And use &BEGIN_MEMORY_CACHEABLE as a pointer to...
java,serial-port,arduino,gnu,rxtx
I have not found any solution for closing serial port of rxtx package in windows 8.1 environment, I moved therefore to JSSC package and it works much better, the full solution including closing port and event listener can be found here. JSSC solution...
The options don't count as "arguments" for the context of the argp parser. When running ./ATE -i input_file.pcm -o output_file.pcm, you have "too few arguments" because you reach ARGP_KEY_END, the end of the arguments, with no arguments left. arg_num represents the "stand-alone" arguments : the number of ARGP_KEY_ARG arguments that...
OK, I think I've got it. Apparantly it is something related to the PATH, if I replace the "shell" command with a predefined : _SHELL=C:/Windows/System32/cmd.exe the problem is fixed. might be because of severl c:\Program Files PATH instances . Upgrading to 3.82 fixes the issue as well so I guess...
x86-64 abi provides a 128 byte red zone under the stack pointer, and the compiler decided to use that. You can turn that off using -mno-red-zone option.
awk 'NR==FNR{a[$1]=1;next} $1 in a {print}' file2 file1 Output: bashi 230 241 12 30 88 2.5 7.3 edison 213 218 6 16 40 2.7 6.7 Reads file2 and creates an array indexed by first field of that, then reads file1 and if first field is in array, prints the line....
gcc,compiler-construction,gnu,compiler-optimization,gcc4.7
I even tried configure and make but doing that wit every change is not at all efficient. That is exactly what you should be doing. (Well, you don't need to re-configure after every change, just run make again.) However, by default GCC configures itself in bootstrap mode, which means...
The answer to "Why .SECONDARY does not work with patterns (%) while .PRECIOUS does?" is here: the document says You can also list the target pattern of an implicit rule (such as ‘%.o’) as a prerequisite file of the special target .PRECIOUS but does not say this about .SECONDARY. But...
java,encryption,cryptography,gnu
This is likely due to the fact that that project was integrated into GNU classpath. That means that the last signed provider was for 1.4. Up to 1.5 you had to create signed versions of your libraries for each Java version, so one for 1.4 is probably not compatible with...
This comes from the massive conversion from C to Go of cmd/new5l (Feb. 2015), translated from src/cmd/ld/pobj.c That information was introduced in commit 7d507dc6e (Dec. 2013, for Go 1.3), a preparation for the new linker structure NT_GNU_BUILD_ID is mentioned here as a unique build ID bitstring. You see it employed...
The solution was actually very simple, it was related to the PATH variable not being set correctly by the toolchain's installer. To solve it in windows 8, go to Environment Variables => System Variables and I added "C:\Program Files (x86)\GNU Tools ARM Embedded\4.8 2014q1\bin" to the path variable. The installer...
Why is it like that? First, I can also reproduce this inconsistent state with mingw32 gcc 4.8.1 on my machine. While the diagnostic is not required (no constraint violation) by the C Standard, there is no reason gcc issues the diagnostic with -std=gnu11 and not with -std=c11. Moreover with...
This command (dd ibs=99k skip=1 count=0; ./wc -c) < /etc/group spawns a sub-shell (for the (list)) and attached /etc/group to that sub-shells standard input. Inside that sub-shell the dd command is run (and inherits the sub-shell's standard input) with an input block size of 99k a skip count of 1...
You have compile pcrecpp as static library and you need to define PCRE_STATIC when compiling your code, see https://github.com/vmg/pcre/blob/a257f5c7acc12e64dc2b5aa170b8e4b87dc34f83/pcreposix.h#L117 i586-mingw32msvc-g++ -std=c++11 -o test.exe -DPCRE_STATIC -Ipcre-install/include test.cpp \ pcre-install/lib/libpcre.a \ pcre-install/lib/libpcrecpp.a \ pcre-install/lib/libpcreposix.a Without PCRE_STATIC all public functions marked as dllimport and have different name mangling...
You need to compute horizontal OR. There is no horizontal OR instruction in SSE, but such operation can be simulated with 2x UNPACK + vertical OR. const __m128 pixel = _mm_load_ps(in); /* (p3, p2, p1, p0 ) */ __m128 isoe = _mm_cmpge_ps(pixel, upper); /* (p3|p1, p2|p0, p3|p1, p2|p0) */ isoe...
if i try this: .ascii "MESSAGE",0xFF i get the following result: Error: Rest of line ignored. First ignored character is `0'. Do this instead: .ascii "MESSAGE" dc.b 0xFF 0xFF is kind of an unusual string terminator though. If you use the more standard zero-terminated strings you can use the...
open-source,licensing,gnu,gpl,copyright
I just need to copy the license text and the "COPYING" license text file and attach it with my source. But I don't understand the significance of this. Yes, your doubts are absolutely valid. That’s not enough to unambiguously express your intentions to release your work as a free/libre...
The manual is misleading, possibly due to a typo. The first of the two sentences: The $$< variable evaluates to the first prerequisite in the first rule for this target. $$^ and $$+ evaluate to the list of all prerequisites of rules that have already appeared for the same target...