10 More Discussions You Might Find Interesting
1. Programming
Hello !
I'm creating a CGI which allow to display graph from some data.
The datas looks like :
2020-01-13-00-00,384.00,350.00
2020-01-13-06-00,384.00,350.00
2020-01-13-12-00,384.00,350.00
2020-01-13-18-00,384.00,350.00
2020-01-14-00-00,384.00,350.00... (1 Reply)
Discussion started by: Tim2424
1 Replies
2. Shell Programming and Scripting
Heyas
Trying to calculate the total size of a file by reading its bitrate.
Code snippet:
fs_expected() { #
# Returns the expected filesize in bytes
#
pr_str() {
ff=$(cat $TMP.info)
d="${ff#*bitrate: }"
echo "${d%%,*}" | $AWK '{print $1}' | head -n 1
}
t_BYTERATE=$((... (9 Replies)
Discussion started by: sea
9 Replies
3. UNIX for Dummies Questions & Answers
My project is to get a temperature reading from a refridgerator every 2 minutes and check to see if the door has been left open.
I don't yet have the mastery of Linux, being a complete noob, but I reckon I need a text file with the latest temperature reading in it. This I've managed to do by... (2 Replies)
Discussion started by: Fitch
2 Replies
4. Programming
Hi,
from the manual
listen(2): listen for connections on socket - Linux man page
It has a parameter called backlog and it limits the maximum length of queue of pending list.
If I set backlog to 128, is it means no more than 128 packets can be handled by server?
If I have three... (3 Replies)
Discussion started by: sehang
3 Replies
5. Shell Programming and Scripting
Here is the script I'm using
awk '{print $1,"\t",(($2+$3)/2)-x,"\t",(($2+$3)/2)+x,"\t",$4,"\t",$5}' x=500 $1
I just want to make float numbers (red) like normal numbers (green)
output
cX 1.65107e+08 1.65108e+08 13 64.2
cX 165112764 165113764 27 ... (7 Replies)
Discussion started by: ruby_sgp
7 Replies
6. Programming
got 1 problem..
can someone help me wit the logic?
Money Money ::operator+(const Money &rhs)const
{
Money temp;
temp.a = a+rhs.a;
temp.b = b+rhs.b;
return temp;
}//end
i got 2 number e.g 6.2 and 3.8 (1 Reply)
Discussion started by: xiaojesus
1 Replies
7. Shell Programming and Scripting
I have two variables and want to perform some functions after comparison
$cat file1
14.abcde
a=`cut -f 1 -d "." file1
b=15
if
then
....
fi
but i got an error message says that unary operator expected
and i think its because of $a is a string and trying to compare with... (3 Replies)
Discussion started by: bonosungho
3 Replies
8. UNIX for Dummies Questions & Answers
hello everybody!
I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(){
int fileDescriptor;
fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies
9. Programming
Good morning,
I'm testing the use of ceilf:
/*Filename: str.c*/
#include <stdio.h>
#include <math.h>
int main (void)
{
float ceilf(float x);
int dev=3, result=0;
float tmp = 3.444f;
printf("Result: %f\n",ceilf(tmp));
return 0;
} (1 Reply)
Discussion started by: jonas.gabriel
1 Replies
10. Shell Programming and Scripting
I am trying to compare 2 float values using if
the foll code does not work
a=1.4
b=1.6
if test $a -gt $b
then
echo "$a is max"
else
echo "$b is max"
fi
does -gt work for floating point numbers, if not how do go about for my requirement? can i use bc ? pls help
thanks in advance... (2 Replies)
Discussion started by: kavitha
2 Replies