Questions tagged [programming]

Questions about tools for programming (compilers, IDE, etc.) For questions that involve programming, ask on Stack Overflow.

Filter by
Sorted by
Tagged with
1
vote
1answer
27 views

How to generate thumbnails/previews for files?

I wrote an app for Windows and macOS and I am in the process of porting it to Linux. My app has a file browser implemented and can display thumbnails or document icons of files. On Windows I get ...
0
votes
0answers
20 views

Sorting Names in file in Lexicographic Order [migrated]

You have a text file eg:dataBaseSmall.txt that has names of your N friends and their corresponding mobile numbers in the following format. (A name (without spaces) followed by a space and the ...
0
votes
1answer
34 views

How to make a script which create a file with the info i want?

i'm a newbie on Linux here and i was hoping to find help. I was using Centos and i've found an exercise where i have to create a script. This script should create a text file with the network ...
0
votes
2answers
94 views

Printing to the STDOUT vs writing to an output file directly [closed]

Is there any rule of thumb when the result of the program should be printed to the stdout by default, and when the more appropriate approach is to accept output file as one of the arguments and write ...
0
votes
2answers
40 views

using command subsitition in a bash for loop

I am probably making an obvious mistake but I could use a strong hint:-) for file in *; do ls $file | var=$(ls $file | grep -Eo '.{18}$' | cut -d '.' -f1 |sed 's/.\{12\}/&./'); echo "var is $...
-1
votes
1answer
39 views

LXML Clarifications… Pretty, but complicated!

I have only recently met this lib and the first impact was not pleasant at all! First of all, from this site https://lxml.de/ I don't know about you, but I didn't understand anything! Too complicated ...
0
votes
1answer
49 views

Does the shell script interpreter optimize if else chains?

As far as I understand, an interpreter runs code line by line; but I find probable that my reasoning is incorrect. If in this example case the first if line returns true, will the program know to skip ...
-3
votes
1answer
35 views

Perl having problem in programme execution [closed]

while executing perl program is not executing the "chop" function is there any error in programming line
0
votes
1answer
71 views

Flip-flop in shell

In Wikipedia there are two relevant articles about the term "Flip-flop": Flip-flop (electronics) Flip-flop (programming) I think that there is a formal-logic common denominator between the ...
0
votes
2answers
50 views

awk to vlookup and print

I got a comma-separated file # cat data smartplayer,2222,off smartplayer,1111,on scorer,0000, I want to search for smartplayer in $1, get its state from $3 and print like this off-smart-player 2222 ...
1
vote
0answers
34 views

Convert jpg to bmp in an ARM Cortex M4 MCU

I'm currently working in a project that involves the use of an ARM cortex M4 MCU, specifically STM32F429, which has an embedded LCD controller which uses the bmp image format to show the images in the ...
0
votes
2answers
106 views

Locating the C header “stdio.h”

I wrote my first C program which is the generic "hello world" program. Could anyone please tell me where can I find stdio.h file in my system? It will help me a lot in understanding of the ...
0
votes
1answer
24 views

How does many binaries changes the percent number of the execution in its right place?

I'm trying to write a C program which can do the thing that many binaries such as package managers do in execution time. They change and add to the already outputted texts in terminal and it makes it ...
0
votes
0answers
10 views

Activate multiple clients on rpc middleware

I made an rpc middleware using c. and I couldn't figure out how to activate multiple clients on the same server. I normally just type ./assign_server on one cmd window(assign is the name of the ...
0
votes
0answers
21 views

What is the Memory Bandwidth Usage in a Program Related to?

We can use performance counter tools to check the memory bandwidth usage while a program is running. I want to ask what is this memory bandwidth related to? What parameters are involved in memory ...
1
vote
0answers
30 views

How can I listen to port creation events on a network interface?

I would like to create a TUN interface (following this tutorial) that takes specific actions when a listening port is created on it. Those include logging the application that created the port, which ...
2
votes
1answer
49 views

Pipes and graphics

When developing a program (in C or Python, say), I often write debug messages to see whether my program behaves as intended. On Linux, such text messages can be handled in varied and flexible ways ...
0
votes
0answers
19 views

Led on gpio very dim (low voltage)

I am using a minnowboard turbot (kind of like a raspberry pi, except its x86_64) When I boot it, the led connected to the gpio pins is normal brightness. After i create the gpio pin by typing echo [...
0
votes
0answers
23 views

How do programs accessing symbolic links differ from users? (What scenarios can break by replacing a file with a symbolic link?)

I think I understand what soft and hard symbolic links are, but I'm not sure how programs access them (as opposed to me, a user). For example, I want to replace my ~/.bashrc with a symbolic link that ...
0
votes
2answers
828 views

How to get into python environment and run some python commands and return to normal terminal using shell script

Sorry about the title it may not be clear. Here is the complete explanation of my doubt. I am writing the below shell script and expecting the mentioned output. #!/bin/bash python3 print("Hello ...
1
vote
1answer
51 views

“Pinging” using DNS protocol

Is there accepted "good practice" for checking that the network connection to a DNS server is operational, and that the server responds minimally, other than issuing a lookup request? ...
0
votes
0answers
116 views

End process but resume bash script?

I am trying to create a script in which part of it runs a command that can only be stopped by the user sending SIGINT to the process. I want the user to be able to press Ctrl+C to end that part of the ...
1
vote
0answers
25 views

Cannot read strings properly from GPS [closed]

I want to read only GPRMC but i can't read properly. here is the code. #include<stdio.h> #include<fcntl.h> #include<unistd.h> #include<termios.h> #include<string.h> char *...
1
vote
0answers
25 views

How to give stdout to different program on same line? [duplicate]

I could do it long way i.e cat hi.txt | grep 'important url' > imurl cat hi.txt | grep -v 'not important url' > imnoturl cat hi.txt | otherprogram1 cat hi.txt | otherprogramN However, is there ...
0
votes
0answers
34 views

how to use plantUML after installing PowerTools?

On the understanding that PowerTools includes plantUML I've installed and enabled the package. How do I now invoke plantUML to use it? (Although I now realize that the above link is actually for ...
0
votes
0answers
33 views

What repo or remote do I need in order to install PlantUML on CentOS via flatpak?

What repo or remote do I need in order to install PlantUML on CentOS via flatpak? Umbrello looks to require a GUI: Can I use Umbrello command line features without an X server on Unix like OS ? No, ...
0
votes
1answer
53 views

How to configure flatpak on CentOS?

I don't believe flatpak is configured: $ lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 8.2.2004 (Core) Release: 8.2.2004 ...
0
votes
0answers
77 views

Execute shell commands ubuntu in Python

I'm currently studying Automation and Python programming. I just want to know how I would go about executing a Linux command in Python. The commands I want to execute are: install = os.system("...
0
votes
1answer
268 views

How to start Jetty using start.jar from the console?

Having installed Jetty through apt how do I start the web server to get to a welcome page? Trying: java -jar /usr/share/jetty9/start.jar results in: ERROR : Nothing to start, exiting ... Usage: java ...
0
votes
0answers
13 views

mathematica in Konsole can't access last input with keyboard

Here is my configuration :-------------------:: ----------------------------- :-----------/shhOHbmp---:\ OS: Fedora 32 (Thirty Two) x86_64 /-----------omMMMNNNMMD ---: ...
0
votes
1answer
41 views

Is PackageExport a command in Linux?

Does anyone know if PackageExports is a command in Linux? or where can one install its package? When I tried to install the package SemidefiniteProgramming, to Macaulay 2, in Gnu/Linux, I always get ...
1
vote
1answer
1k views

Get current screen dimensions via Xlib using C

Is there any way to get screen dimensions of a display via Xlib using C? I've tried referring to the X.org docs (https://tronche.com/gui/x/xlib/display/screen-information.html), and it only gives me ...
0
votes
1answer
124 views

detect cms from list

my marketing department wanted from me detect our domains for that if they use Wordpress. I have our huge list of domains, but I can't find proper cms detector which will just save which domain has ...
0
votes
1answer
23 views

Multiple tcp scanning tools integration

I recently started my first programming project that consist of purpose multiple tcp scanning tools integration for multiple usage. To be more clear, I want to incorporate NMAP and MASSCAN tools. But, ...
0
votes
1answer
39 views

Which programming lang.s are used for ui of os? [closed]

Which programming languages are used for the part of the os which user interacts with (the application?), for instance the task bar (on linux ,macosx or windows), start button, desktop etc. ?
0
votes
1answer
2k views

Simple shell loop fail in Makefile

Why does the shell loop l='abc de f'; for k in $l ;{ echo $k; } inside Makefile not work ? instead only give abc de f at once How to solve such in the definitive way?
0
votes
1answer
776 views

How to exit from an external program with a bash script?

Im working within an external program and I need to exit the program from a bash script that I will produce on the fly. So, in the external environment if I do exit it exits. Although if I do, ...
1
vote
1answer
229 views

How do I pass commands to an external command, from bash?

I would like know if it is possible to enter in an external program and give commands from a bash script. As an example, lets imagine the external program is ipython and I want to give the commands ...
0
votes
1answer
78 views

Bash Script Time each function and Time total Script Execution Duration

I've written a bash script and would like to implement a timer that will also get the total time of the scripts execution duration and also the time that each loop iteration takes. For example, in the ...
3
votes
1answer
152 views

How to extract function comment using sed?

I want to implement a simple utility that would take a C source file and a name of a function, struct, enum or whatever and output the comment directly above the element if present. Ie. /* This is ...
-9
votes
2answers
105 views

Error Shell Programming in Linux [closed]

I need to fix my code? i=0; bil_genap=0; bil_ganjil=0; echo -n "Batas loop : "; read batas; if [ -z $batas ] | [ $batas -lt 0 ]; then echo "Ops, tidak boleh kosong atau Batas loop ...
1
vote
0answers
178 views

Good projects for bash and awk [closed]

I am learning bash and awk programming, and have gotten to the point where I want some interesting projects to work on to improve my programming. At the minute, the beginner stuff is getting too easy, ...
6
votes
1answer
2k views

Command-line diff tool

So we all have the diff command installed by default. I certainly don't know how to use it well. But I would expect some reasonable default usage. But when I type diff file1 file2 I get ... a text ... ...
0
votes
1answer
504 views

What is the highest level of indentation today and has ever merged into the Linux Kernel? [closed]

I was recently reviewing the Linux kernel coding style guideline, and this got me thinking: 1) Indentation Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic ...
3
votes
1answer
896 views

Can you edit address values in “/proc/$pid/mem” to reflect changes in that process?

I would like to see if I can edit a value in my program while it is running by directly changing the memory. My thought process (untested) is to do the following: Run the program. Open up "System ...
1
vote
1answer
326 views

Is Linux a suitable platform for learning COBOL? [closed]

I am studying a college CIS degree. Next semester, I have a choice of either studying JAVA and COBOL or JAVA and PHP. I don't know much about COBOL and only have computers with Debian. The textbooks I ...
0
votes
2answers
2k views

Is there something similar or like “pass” in python in bash/shell programming?

I sometimes need a command like pass in Python in my bash scripts. Like: if grep something then pass else code fi In Python you have: >>> for element in a: ... if not element: ...
1
vote
1answer
213 views

The $@ variable is not working in a for loop, trying to iterate through a users list

PROBLEM: I can't get the $@ variable to do what I want in a for loop, the loop only sends one name into the file while looping, it should loop through all the arguments and write them to the file ...
1
vote
2answers
2k views

checking if iptables are set on a system in script [duplicate]

I'm writing a script in bash and I need to check if iptables are set...I have this: if [ `iptables-save | grep '^\-' | wc -l` > 0 ] then echo "Iptables already set, skipping..........!" else ...
0
votes
1answer
1k views

How to pass argv arguments to a C program using a file or python script in linux?

I used to be able to pass input to C program by first writing a python script and using pipe to send it to the C program as an input or write the output of python script to a file and just doing r &...