02-21-2012
Quote:
Originally Posted by
Corona688
There were other parts than code, which you didn't read. I detailed clearly what I was trying to do, none of which had anything to do with stripping off decimal points -- you wanted a boxcar average...
I read that part and it made sense, but when I applied it to my data I didn't get what I was expecting, so now thinking about it I might have a problem with the mathematical concept itself..
I understand that this is a Unix forum not a math forum, so I'll try to figure the math part first.
Thanks
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
2. Shell Programming and Scripting
hi All,
cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'
Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies
3. Shell Programming and Scripting
Hi all,
can any one suggest me the script to grep multiple strings from ps -ef
pls correct the below script . its not working/
i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK.
bash-3.00$ ps -ef | grep blu
lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Discussion started by: timmywong
8 Replies
6. Solaris
The system don't boot.
on the screen appears following:
press enter to maintenance (or type CTRL-D to continue)...I checked with format command.
... the slices "0-root","1-swap","2-backup" exist.
...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
9. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT MOJAVE
constants
math::constants(n) Tcl Math Library math::constants(n)
__________________________________________________________________________________________________________________________________________________
NAME
math::constants - Mathematical and numerical constants
SYNOPSIS
package require Tcl ?8.3?
package require math::constants ?1.0.1?
::math::constants::constants args
::math::constants::print-constants args
_________________________________________________________________
DESCRIPTION
This package defines some common mathematical and numerical constants. By using the package you get consistent values for numbers like pi
and ln(10).
It defines two commands:
o One for importing the constants
o One for reporting which constants are defined and what values they actually have.
The motivation for this package is that quite often, with (mathematical) computations, you need a good approximation to, say, the ratio of
degrees to radians. You can, of course, define this like:
variable radtodeg [expr {180.0/(4.0*atan(1.0))}]
and use the variable radtodeg whenever you need the conversion.
This has two drawbacks:
o You need to remember the proper formula or value and that is error-prone.
o Especially with the use of mathematical functions like atan you assume that they have been accurately implemented. This is seldom or
never the case and for each platform you can get subtle differences.
Here is the way you can do it with the math::constants package:
package require math::constants
::math::constants::constants radtodeg degtorad
which creates two variables, radtodeg and (its reciprocal) degtorad in the calling namespace.
Constants that have been defined (their values are mostly taken from mathematical tables with more precision than usually can be handled)
include:
o basic constants like pi, e, gamma (Euler's constant)
o derived values like ln(10) and sqrt(2)
o purely numerical values such as 1/3 that are included for convenience and for the fact that certain seemingly trivial computations
like:
set value [expr {3.0*$onethird}]
give exactly the value you expect (if IEEE arithmetic is available).
PROCEDURES
The package defines the following public procedures:
::math::constants::constants args
Import the constants whose names are given as arguments
::math::constants::print-constants args
Print the constants whose names are given as arguments on the screen (name, value and description) or, if no arguments are given,
print all defined constants. This is mainly a convenience procedure.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category math ::
constants of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you
may have for either package and/or documentation.
KEYWORDS
constants, degrees, e, math, pi, radians
CATEGORY
Mathematics
COPYRIGHT
Copyright (c) 2004 Arjen Markus <arjenmarkus@users.sourceforge.net>
math 1.0.1 math::constants(n)