Skip to content
Advertisement

mmap vs sbrk, performance comparison

Which of these calls is faster on average? I’ve heard that mmap is faster for smaller allocations but I haven’t heard a comparison of either. Any information on performance for these would be nice. Answer You should tag this with a particular implementation (like linux) since the answer surely varies by implementation. For now I’ll assume Linux since it’s the

Read/Write LabView TDMS files in python under linux

Does anyone know of a way to read and write the National Instruments binary file type (TDMS) in python under linux? I know that NI has a C DLL available, but I don’t know how to access that through python, or if I even can do so under linux. Answer It looks like TDMS isn’t directly supported under Linux (see

dos2unix command

I have this script I want to remove “^M” charcaters from many files which are in more subdirectories. I got this: Is there somethig i’m missing? Thanks in advance. Answer I guess you don’t need a for loop. Here is a quick panorama of solutions for files with extension “.ext” (such commands shall be somehow restrictive) note : ^M is

Bash: How to tokenize a string variable?

If I have a string variable who’s value is “john is 17 years old” how do I tokenize this using spaces as the delimeter? Would I use awk? Answer Use the shell’s automatic tokenization of unquoted variables: If you want to change the delimiter you can set the $IFS variable, which stands for internal field separator. The default value of

How do I execute javascript programs from the Linux shell?

I would like to execute my javascript programs with the Rhino shell without making the first line #!/bin/sh. ‘#’ isn’t a comment character in javascript. I also don’t want to have to have a .js extension. Is this possible? I remember reading something a long while about a method of making java programs to run without an explicit interpreter. Google

How to send integer with pipe between two processes!

I am trying to send an integer with pipe in a POSIX system but write() function is working for sending string or character data. Is there any way to send integer with a pipe? Regards Answer The safe way is to use snprintf and strtol. But if you know both processes were created using the same version of compiler (for

Advertisement