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
0
votes
0answers
12 views

Wine has no internet connection or my app does not run

So i made a small 500 line app. When i run my.computer.network.ping ("www.google.com") or https google .com it prints the no internet connection warning that i have set up when this command fails. ...
0
votes
0answers
15 views

Kernel driver serving multiple virtual file readers

There is a kernel driver that collects data from some external hardware and passes all data to a virtual file if a reader reads this file. Data blocks are appended to a list with the assumption the ...
2
votes
1answer
43 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 ...
-8
votes
2answers
85 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 ...
2
votes
0answers
79 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, ...
5
votes
1answer
245 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 ... ...
-1
votes
1answer
139 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 ...
1
vote
1answer
221 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
104 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
254 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
63 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
423 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
498 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 &...
2
votes
2answers
1k views

Getting access to a variable inside a sudo clause in a script with EOF

PROBLEM: I need to have a variable here called $user: chown $user:$user "$HOME"/.bashrc but it doesn't have access to it from outside the sudo and EOF: for user in "$@" do if [ "$user" = root ]...
1
vote
1answer
62 views

why $($var) gives an error?

I am trying to execute the following code in shell but I am not getting the output as expected. The command is as follows: i=1 echo $($i) I am getting an error: Command not found error I think it ...
0
votes
2answers
40 views

How to have access to script variables and environmental variables inside a sudo/EOF clause in a script…BASH

PROBLEM: I am struggling with this cp always giving errors because the variables not there... Here is my code: if [ ! -z "$USER1" ] then sudo -u "$USER1" bash <<'EOF' sleep 5 ...
2
votes
1answer
177 views

sudo -u user bash works but $HOME is not changing accordingly

I'm writing a script to setup new debian install's. The problem is in this code: if [ ! -z "$USER1" ] then sudo -u "$USER1" bash <<-EOF cp "$BASHRC $HOME"/.bashrc wget https://raw....
1
vote
0answers
51 views

Fakeroot on macOS tries to delete system directories

I’m having a problem with fakeroot on macOS. I created a pacman fork. When I’d like to delete a package, pacman tries to delete /usr/ instead of a subdirectory. On Linux, it is working fine, though. ...
1
vote
1answer
33 views

vi with files/directories on the side?

I'm wondering if there's a plugin or a way to make vi/vim have collapseable folders/files on the left side like a regular IDE.
0
votes
0answers
95 views

How to install HTML5/JavaScript to Netbeans?

I installed the NetBeans Connector plugin to Chromium on my MacBook. That worked perfectly. I could create new projects in HTML5/Javascript. I tried to do the same on my Linux Mint 18.3 computer. But ...
1
vote
1answer
83 views

LibreOffice placeholder fields documentation

I have to modify a LibreOffice template with a number of conditional statements. I managed to figure out one can add such statements through Insert > Fields > More fields, tab Functions, type ...
5
votes
4answers
17k views

How do I run .c file from the command line [duplicate]

I am beginning to work with micro controllers and programming them using C language. All my programming experience is with Python language. I know that if I want to test a script I have written in ...
22
votes
6answers
4k views

Is it possible for a program to get number of spaces between command line arguments in POSIX?

Say if I wrote a program with the following line: int main(int argc, char** argv) Now it knows what command line arguments are passed to it by checking the content of argv. Can the program detect ...
3
votes
1answer
276 views

How to organize 3rd-party libraries for Python?

I am new in Python. I want to install many 3rd-party libraries (I think they are also called packages?) like, for example, "AstroPy". But I am not sure where the new source code will be stored (I mean,...
1
vote
3answers
1k views

How can I make my Linux server sleep and wake on LAN when not in use?

I have recently purchased myself an HP rack server for use as a personal fileserver. This server currently lives under my bed as I have nowhere else to put it. For those not aware (as I was not ...
-2
votes
1answer
45 views

Remove the gap pattern from files [closed]

I want to remove gaps (-). if gap found continuous >10 in all >Tem at the same position then remove the all gaps and also remove the sequences or gap from the query at the same position which are in ...
3
votes
2answers
2k views

Writing C# in Debian

I want to learn C# on a Debian system. What do I have to install? Is there something like an interactive prompt where I can try running snippets of code? I have to learn C# and I have a dual boot ...
0
votes
1answer
41 views

How to output the display from an application to a vnc viewer? [closed]

How to I write a program on a machine with a high end graphics card and a desired platform so that other computers on a network can view the video output of the program on a separate monitor? Like ...
1
vote
2answers
7k views

sh: 1: program not found

I have written a script to execute files one by one by calling a installed program. The same program is executing from terminal, like procheck abc.pdb, then it's working fine. But when I execute this ...
1
vote
0answers
354 views

how to get dark theme or look for netbeans?

Not quite sure how to get dark themes for Netbeans: would like something similar to this look: just without the "side" window.
0
votes
1answer
42 views

netbeans has preview tile or window — how to remove that preview?

How I get the "preview" window on the far right hand side to minimize or disappear? so that the class extends fully to the right hand side.
0
votes
1answer
19 views

Having multiple computers on network access file?

Say I have a program being run on multiple computers all on the same network (and all on the same account). Every once in a while the program needs to read/write a file save.dat. The actual file ...
1
vote
0answers
615 views

High iowait while the throughput and IOPS are low

I'm new to programming & Linux. After I finished my programs(do some IO), I found iowait is very high(~65%) while the throughput(~5M/s read + ~5M/s write) and IOPS(50~100 QPS) are low. iostat -...
0
votes
2answers
360 views

What was the reason for lseek function to return file descriptors as long integer? [closed]

According to the book Advanced Programming in the Unix Environment :- "The character l in the name lseek means ‘‘long integer.’’ Before the introduction of the off_t data type, the offset argument ...
0
votes
1answer
797 views

distribute the JVM across a cluster of machines

Grasping at straws for search parameters and terminology. The key attribute to the JVM is the V for virtual (at least within the context of this question). How do you span a JVM across a cluster of ...
-1
votes
1answer
59 views

How Mount a datastore on linux in python [closed]

I need to mount xyz/pqr/ datastore on my linux mychine for in my python script.
1
vote
1answer
453 views

The most used language for Debian [closed]

What is the programming language mostly used to develop most parts of the Debian?
2
votes
2answers
746 views

How to get a list of all installed programming languages on arch linux / any linux? [closed]

Is there a way to check what programming languages are installed on a given Linux system? For example, I have recently installed Arch Linux on my host and just for informational purposes I would like ...
-1
votes
1answer
517 views

Shell script to move files and rename it with index [closed]

Consider two directories A and B. A contains a text file A.txt which changes its contents every 3 seconds. The shell script is to move A.txt to directory B and rename it to A_1.txt. After 3 seconds ...
19
votes
7answers
9k views

How can I run BASIC code in a terminal?

I would like to run BASIC code, like you used to do on older computers, in Linux. (I am looking for a BASIC Interrupter that can run OS functions natively) What options do I have? (Preferably for ...
1
vote
1answer
154 views

Question about the unbuffered I/O efficiency introduced in APUE 3th, 3.9

In Advanced Programming in Unix Environment 3th, 3.9, I/O Efficiency, I read about this: The file was read using the program shown in Figure 3.5, with standard output redirected to /dev/null. The ...
0
votes
1answer
39 views

Auto execute a program that plays music

as mentionned above, I would like to execute a programme that plays music at certain hour automatically. I tried using crontab but no outcome. This is what I put in crontab: 8 15 30 3 4 python ...
6
votes
1answer
2k views

How can I list net work devices and ipv4 address on linux without ifconfig/ip command [duplicate]

I already figured out that on Linux I can list network devices (cd /proc/net/dev_snmp6/ && for device in *; do echo $device; done|sort) but how can I get the ipv4 address of the device? I ...
0
votes
1answer
315 views

Possible to replace string if match string in two files? [closed]

i am aware of this doable by sed but only limited to one string let me explain let better, lets say in file 1 we got something like this tom,123456789 steve,1478321 jon,315457 and in the second file ...
1
vote
1answer
2k views

Wine not working for Linux Mint 18 Sarah. Trying to run Game Maker Studio, with no luck

I'm using Linux Mint 18 Sarah MATE 32 bit and I'm trying to download Game Maker Studio off of Wine 1.6.2. It was named "GMStudio-Installer-1.4.1763.exe". At first the installation process went ...
1
vote
1answer
53 views

Server response login error!

This is the script i build for i in `cat cain.txt` do uuid=$(curl -X POST -H "ACCEPT-LANGUAGE:en" -H "Content-Type:application/json" -H "Accept: application/json" -d '{"username":"TheUserName"}...
-1
votes
1answer
100 views

C++ Apps ready for Linux as well as Windows? [closed]

I don't actually know where to start and what keywords to use for searching more, but can we simply make a programs in C++ that runs in Linux as well as Windows. I guess we are talking about binary ...
-1
votes
1answer
133 views

Append value as parameter to shell script

I found the value of a response (curl) with sed and now i need some help to take the value that i printed in a file and to use it in another substring in the same .sh script This is the response of ...
-1
votes
1answer
59 views

An executable has two processes and is launched twice on two different terminals How to make the processes identify their roles

I have to write a c code which will contain two processes. And its executable will be launched twice on two different terminals. Both processes will know whats their role. One terminal will show ...
0
votes
3answers
587 views

Bash math & files [closed]

I need to do some math with the lines of a file and a number using bash. As in Ruby or python you can easily do string to number or viceversa. In bash all is untyped. I have a file contain numbers ...