Programming :: Complex Math Calculation In Shell Script?

Feb 16, 2010

Here is my situation:I have a series of .plt files that are geared for a device that has it's xy origin at the lower left of the paper however some devices use the center of the paper as it's origin in a piped shell script how can I convert this file to a center origin plot file?Here are some knowns: the existing file always Lower Left 0.0 the existing file max xy is the page upper right x.x the desired output file must have it's 0.0 at the exact center of page (page size will vary). Ideas: Based on the sample files included maybe use PU and PD as the triggers for inputs to be calculated as any other commands have nothing to do with coordinates.

View 14 Replies


ADVERTISEMENT

Programming :: Loops In Bash Shell Or Variable Math?

Oct 28, 2010

I am trying to map the coordinates of a grid.

Code:

R=7 # number of rows (lines)
C=6 # number of columns
X=200 # initial horizontal location
Y=100 # initial vertical location

[code]....

View 4 Replies View Related

Programming :: Delay Calculation For LSB In Timer?

Sep 5, 2010

On the following link Following code is given

Code:
loopbit = loops_per_jiffy;
/* Gradually work on the lower-order bits */
while (lps_precision-- && (loopbit >>= 1)) {
loops_per_jiffy |= loopbit;
ticks = jiffies;
while (ticks == jiffies); /* Wait until the start

[Code]...

View 2 Replies View Related

Programming :: C++ - Basic Math Always Returns 0 ?

May 16, 2010

Code:

Why are basic math problems returning 0? I know that Integers can only hold whole numbers, and it had the exact same problem when I used floats. I am using GCC 4.4.4.

View 3 Replies View Related

Debian Programming :: Can't Access Math Function

Apr 30, 2015

When I try to compile this code:

#include <math.h>
int main (void) {
double x, y;
x = 2;
y = sqrt(x);
return 0;
}

With the command:

$ gcc test.c

I got this message:

/tmp/cc5QZmCN.o: In function 'main':
test.c:(.text+0x16): undefined reference to 'sqrt'
collect2: error: ld returned 1 exit status

I tried this on a fresh jessie install. I have the same problem on wheezy.

View 2 Replies View Related

Programming :: Connect Math.h Library To C Program?

Jun 27, 2010

I've started programming in c recently . following are the details about scene:

* vim is editor and program is compiled in gcc whenever a program involving math function appears it gives error i.though math.h is included in header file compiler complains about it it gives error of unrecognized function that math function like sqrt, etc question is how to connect math.h to a program.

View 14 Replies View Related

Programming :: CPAN Cannot Install Math - Pari Module

Jun 8, 2010

I wrote a perl script to feed information to our load balancer:
Code:
#!/usr/bin/perl
#
use strict;
#use warnings;
#
#
use Net::SSH::Perl;
my $user="bluethundr";
my $pass="secret";
my $dir="$ENV{HOME}/data";
open (LBVSERVERS), '<', "$dir/lb-vserver" or die "Couldn't open file: $!";
open (CSVSERVERS), '<', "$dir/cs-vserver" or die "Couldn't open file: $!";
my $ssh = Net::SSH::Perl->new("10.50.0.1");
$ssh->login("$user", "$pass");
print " .....

I need to be able to install the Math::Pari CPAN module in order to accomodate the Net::SSH CPAN module. The prereqs are installed:
Code:
cpan> install Net::FTP
Net::FTP is up to date.
cpan> install LWP::UserAgent
LWP::UserAgent is up to date.

But when I either try to install or force install Math::Pari this is what I get:
Code:
cpan> install Math::Pari
Running install for module Math::Pari
Running make for I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz
Checksum for /home/bluethundr/.cpan/sources/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz ok
Math-Pari-2.01080604/ .....

CPAN.pm: Going to build I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz
Did not find GP/PARI build directory around.
Do you want to me to fetch GP/PARI automatically?
(If you do not, you will need to fetch it manually, and/or direct me to the directory with GP/PARI source via the command-line option paridir=/dir)
Make sure you have a large scrollback buffer to see the messages, or 'tee' the STDOUT/STDERR to a file.
Fetch? (y/n, press Enter) y
Getting GP/PARI from ftp://megrez.math.u-bordeaux.fr/pub/pari/unix/
Cannot list (Failed to establish connection.
): at utils/Math/PariBuild.pm line 319, <STDIN> line 1.
Can't fetch file with Net::FTP, now trying with LWP::UserAgent...
You do not have LWP::UserAgent and/or HTML::LinkExtor installed, cannot download, exiting...

View 1 Replies View Related

Programming :: Replace A Complex Line In Lvm.conf

May 19, 2011

I need to replace a line in the lvm.conf file from: filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|", "a/.*/" ] to: filter = [ "a|/dev/cciss/c0d0.*|", "a|/dev/disk/by-id/.*|", "r|.*|" ] And I was hoping there was a way to use sed or awk to do this in a script (as I need to repeat this on several machines).

All of the examples I've found don't see to work with all of the special characters in the line that I need to replace. Then I need to add a line after the above edit like this: types = [ "device-mapper", 253 ]

View 3 Replies View Related

Programming :: Change Complex Number Display Mode (like -123.45e67 In To Real)?

May 9, 2011

How to change the complex number like -123.45e67 in to real number.
with command of awk print

View 1 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

General :: User Add With UID Calculation?

Aug 27, 2010

I am having problems with the useradd command. When I call "useradd someuser" the program starts and never finish. When I give the UID option (useradd -u ) sometimes it works properly, but with some UID's that aren't in /etc/passwd it shows a message saying that the uid is not unique. I checked out /var/log/auth.log and nothing about the command is being logged. It seems that the command is not calculating the new UID prperly.It's running on a Debian Linux 2.6.26-2-686 i686 GNU/Linux

View 6 Replies View Related

Red Hat / Fedora :: Getting Top Command Memory Calculation?

Mar 21, 2011

I am running a 64 bit RHEL 4 in one of mymachines with 8 Gb of physical memory.But when I run the top command, it outputs as below:
Code:

Mem: 8165428k total, 8109988k used, 55440k free, 65772k buffers
Swap: 4194296k total, 135596k used, 4058700k free, 6739936k cached On calculation, it shows it has only 7.7 Gb of memory if I calculate ( using 1 Gb = 1024*1024 Kb).

Where is .3Gb gone ? Again, it is a 64 bit machine..so should see all 8Gb. Is it mistake of top command calculating 1Gb=1024*1000Kb ?

View 7 Replies View Related

Ubuntu :: Upgrading From 10.04 To 10.10 - Error Upgrades Calculation Is Not Possible

Mar 3, 2011

I got an error Upgrades calculation is not possible An unresolvable problem occurred while calculating the upgrade: E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. This can be caused by:

* Upgrading to a pre-release version of Ubuntu
* Running the current pre-release version of Ubuntu
* Unofficial software packages not provided by Ubuntu

View 7 Replies View Related

Networking :: Subnet - Network IP - Broadcast IP Calculation

Feb 14, 2010

I am basically from system side and often confused about the calculation of the IP addresses.Just i want to know that what how can i calculate the following of a IP Address:

(1) Available IP in a Network
(2) Broadcast IP
(3) Network Prefix or Net Mask

View 5 Replies View Related

General :: Instant Cpu Load Calculation On Ubuntu?

May 31, 2011

i am working on a model based on cpu load / cpu usages. where i need the instant cpu usage/cpu load, but i can able to find the cpu load average for last 1 , 5 or 15 minutes. Is there any command or any software by which i can able to find out that?

View 2 Replies View Related

Software :: Command Line Program For IP Calculation?

Apr 8, 2011

ipcalc isn't the one I am thinking of. I remember another one that was a bit better, with more options -- easier to use.I remember that if you gave it a CIDR network /23 and an IP, it would list all of the address ranges, network, broadcast for that network..

View 2 Replies View Related

Programming :: Prevent "leak" Into Shell From A Customized Shell Menu Script?

Dec 15, 2009

I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.

View 11 Replies View Related

Fedora :: Update Error - Not Enough Space Or New Math?

Sep 1, 2010

I just built a VMWare VM from the Fedora 13 DVD - 64 bit. It now wants to do 385 updates so I let it download all of the rpms. As it starts to do the install I get a Transaction Error to the effect

Quote:

Test Transaction Errors: installing package kernel-2.6.34.6-47.fc13.x86_64 needs 8MB on the /boot filesystem

System monitor shows that I have 19.7 MiB available on /boot - so what is going on?

View 8 Replies View Related

General :: Calculation Of Working Time Based On System Uptime

Jul 28, 2010

I know several tools that allow tracking time spend on different tasks / projects.Is there any existing tool for very very simplified work-time-tracking.I am an employee, come to the office, switch on my laptop directly. I have mostly around 1 hr lunchtime, but sometimes less, sometimes more.At around 18:00 I want to type one command in the console (or simple GUI would also be okay of course) that tells me:"1 hour overworked. Go home now! (came at 8:00, 1 hour standard lunch-break)."

View 1 Replies View Related

Ubuntu :: PDF File Shows Math Symbols But Printer Does Not?

Jan 31, 2010

I have Ubuntu 9.10 installed and up to date.

I have an HP Laserjet 2200 connected via USB with 64MB of memory. When I print page 2 of this document (for example) [URL] the delta-symbol and minus-signs do not show up, although I see them in Adobe reader version 9.3.

I have tried several of the available drivers for the printer (including the "[recommended]" one) and none of them produce these symbols.

I'm guessing this is a font issue. I don't know how to show you what font stuff I have installed.

[Code].....

View 4 Replies View Related

Software :: Use Basic Math Functions From The Command Line Like Sqrt?

Sep 14, 2010

I have a user that wants to use basic math functions from the command line like sqrt and such. Apparently it was installed on the previous server we were using, but not on this new Debian server by default.

Anyone know what package has that functionality?

View 7 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

Server :: Ssh: Connect To Host Sage.math.washington.edu Port 22: Connection Timed Out

May 26, 2010

I've been trying to ssh out of my home network to school computers and I keep getting:

ssh: connect to host sage.math.washington.edu port 22: Connection timed out

I've tried this on my machine (running Ubuntu 10.04) and on a windows 7 machine (using putty). I have been successful ssh'ing to this machine using either of the laptops from every other network I've tried, so I'm pretty sure it's something about my home network.

View 3 Replies View Related

Programming :: Possible To Assist In Programming Shell Scripts?

May 17, 2010

Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other

View 1 Replies View Related

General :: Awk Paragraph In Complex Text File?

Sep 23, 2010

I have a simple log file which is very messy and I need it to be neat. The file contains log headers but are all jumbled up together thereforeI need to sort the log files according to the log headers. There are no static number of lines that means that there is no fix number of lines for the each header of the text file. And I am using AWK to sort out the headers.The Log files goes something like this:

Code:
Car LogFile Header
<text>

[code]...

View 1 Replies View Related

General :: How To Awk Paragraph In Complex Text File

Sep 24, 2010

I have a simple log file which is very messy and I need it to be neat. The file contains log headers but are all jumbled up together therefore I need to sort the log files according to the log headers. There are no static number of lines that means that there is no fix number of lines for the each header of the text file. And I am using AWK to sort out the headers.

The Log files goes something like this:

Code:
Car LogFile Header
<text>
<text>

[Code]....

View 1 Replies View Related

General :: Using Echo To Create A Complex Script?

Sep 16, 2010

We're going to be doing a rather large server deployment, and using the provisioning system we have in place there is no current way to just "copy" a file over to the servers. All files/scripts have to be run from the provisioning server.Due to network constraints, the provisioning system can't run a script we need to run (requires certain network assets to complete, but as soon as we modify the network settingshe provisioning system loses access to the server and can't run the script). So,our network configuration script to create the other script on the server in /root when it runs.My original method was to do something along the lines of:

Code:
#network configuration statements here
....

[code]...

View 2 Replies View Related

Software :: Complex For Loop Executed Remotely Via Ssh?

Nov 2, 2010

I've got a fairly complex bit of code (a for loop within a for loop) which I'm trying to execute remotely, however because of the special characters this exits without making the connection.Usually I'd do:ssh root@ipaddress "for i in `cat /etc/hosts | awk '{print $2}'`; do ping $i; done;"But given the complexity of my code this usual tactic doesn't work

View 3 Replies View Related

Ubuntu :: Possible To Use Piped Command As Opposed To An All Out Complex Method

Dec 1, 2010

I would like to keep this simple and if possible use a piped command as opposed to an all out complex method.I have a script that does many things for me, and one of them builds a basic simple system report (I know about lshw, but this is for me to learn as well as be functional)

I would like to add another pipe to remove the"model name:" portion.I do not really want to use the store in a variable first solutions if I can help it.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved