Posts by gorn • 356 points
23 posts
-
0
votes1
answer19
viewsA: "typedef typename" equivalent in C++03
Guy even activating all the features of your compiler the visual studio 2010 has no support for typename, because it is a Feature of c++11.…
-
1
votes1
answer43
viewsA: Find string fields with python regular expressions
Expensive if you want to get the IP address and the MAC from a device, recommend using a tool that does this. Example to lib like the netifaces, need to install it with pip, an example import…
-
3
votes1
answer41
viewsA: Loop elements in List, Boolean, if condition accepts, create a new list (python)
You need to implement a loop, for this I recommend using the for, syntax is something like: for each item in a list, lista = ['BRKM5.SA', 'ITSA4.SA','PETR4.SA','WEGE3.SA','BBAS3.SA'] for item in…
-
-1
votes0
answers11
viewsQ: How to ensure sudo permission to a build script from gitlab ci/cd
I’m writing a script for gitlab ci/cd, to compile and run some tests. I need to download some packages like python, pip, cpython etc... for this I am using the CentOS, yum, however the gitlab user…
-
0
votes2
answers128
viewsA: Timer for a shell script command
You can use the command timeout which is just what you need, running a program and shutting it down after a certain time. examples: timeout 15 ping 8.8.8.8 In your case I think it would look…
-
0
votes1
answer45
viewsA: Compile linux kernel module
You will need to create a Makefile in the directory where the simples.c. So Voce can call make to compile and make clean to clear the build. The result of your build will be a kernel object…
-
0
votes1
answer29
viewsA: print out non-repeated values
Let’s say you have an array with repeatable and out-of-order elements 1, 1, 2, 3, 4 ,5, 1 and want to print on screen only the values that are not repeated 1, 2, 3, 4, 5. First, we should organize…
-
0
votes1
answer30
viewsA: I read the txt file, but it shows blank
Validate if the file has been opened and use absolute paths or related to the implementation directory. if ((arquivo = fopen("C:\\program.txt","r")) == NULL){ printf("Erro ao abrir arquivo");…
-
0
votes1
answer37
viewsA: Modified Linux kernel build error
You need the moon C lib installs it with apt-get install liblua5.1-0-dev And ensure that the moon’s C lib is visible to the operating system export C_INCLUDE_PATH=/usr/include/lua5.1 and try to…
-
3
votes3
answers117
viewsA: How to identify output status in a bash program?
Every program called by a shell returns a exit code even if it is not explicit in the code of the program, it returns zero at the end of its execution or anything other than zero in case of failure…
-
0
votes1
answer35
viewsA: Difficulty locating vector value in C
Some tips: Here you only keep a 5-character board; char placa[5]; You need a plate array that contains the number of the plates, hint: #define TAMANHO_PLACA 5 #define MAXIMO 10 char…
-
1
votes1
answer64
viewsA: Remove specific characters from a list
Hello, there are ways to remove characters from lists, however it is not your case since this created a string when using the function write(string) for write in the document. So why not just use…
-
0
votes1
answer781
viewsA: Problem "the file is already being used by another process"
You are not saying a way in the instant of creation. When called by the console the program has as context the path in which it can create the file. However when the double click occurs the program…
-
1
votes1
answer388
viewsA: Paramiko Error Handling (Python)
You’re not treating the exception correctly. On the block try except add the process of authentication exception try: remote_conn_pre.connect('1.111.111.111', username=username, password=password)…
-
2
votes1
answer70
viewsA: Error: Exception has occurred: Typeerror (Python)
First you are not compiling, because python is an interpreted language, you are running a script. Second, you are initiating the object Login no arguments however specified in the function __init__…
-
0
votes1
answer45
viewsA: GNU Parallel - Using File with Variable Data within a Script
With the option --colsep da to use the columns of the file as delimiter. txt data. maça vermelha banana amarela uva verde sh list. echo Fruta $1 echo Cor $2 commando parallel --colsep ' ' ./lista.sh…
-
1
votes1
answer47
viewsA: Start process with custom name via command line
One solution is to create a symlink with the name you want pointing to the program that will be run. Example: foo echo "$0 args $@" bar ln -s "foo" "novo-nome" bash "novo-nome" "$@" Testing: chmod…
-
0
votes3
answers61
viewsA: How to specify the files I want to add to the Stage area?
One possible solution is to use as parameter git add the result of a subshell that when listing the directory ignore certain files. Example git add $(ls -I 4). It is possible to ignore file lists by…
-
0
votes1
answer44
viewsA: Shell Script Backup Error
In the script the variable is assigned DEVICE="$1" the first argument the program receives, possibly when you run in hand ./script you are not passing that argument. You also have to run this script…
-
1
votes2
answers371
viewsA: How to read a. txt file in Electron?
Apparently the path you are passing to open does not exist. Use absolute and non-relational paths to avoid this type of failure. Examples I want to open a file on my home, /home/user/file.txt I want…
-
1
votes1
answer376
viewsA: C++ - Read the name of a directory’s files
You can use the library Boost the component filesystem example: #include <iostream> #include <boost/filesystem.hpp> using namespace boost::filesystem; int main(int argc, char* argv[]) {…
-
2
votes2
answers164
viewsA: Is it worth using Assembly, C and C++ in the same program?
Assembly actually, at runtime, is faster. But it is costly in development and complex in implementation / maintenance not to mention that your code gets stuck in the hardware architecture.…
-
0
votes1
answer76
views