10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like:
<date1>|<data1>|<url1>|<result1>
<date2>|<data2>|<url2>|<result2>
<date3>|<data3>|<url3>|<result3>
<date4>|<data4>|<url4>|<result4>
What I... (3 Replies)
Discussion started by: pat_pramod
3 Replies
2. Shell Programming and Scripting
I wanted to know if there was a more efficient to do this. I was to setup a conditional for every letter of the alphabet, like so (I am parsing an array):
for i in "${arr}"; do
if ]; then
echo "$i starts with A"
else echo "$i does not start with A"
fi
done
I want to do this A-Z, is there... (6 Replies)
Discussion started by: sudo
6 Replies
3. Shell Programming and Scripting
I have a genotype.bim file where it contains information about SNPs and genotype. As a hypothetical example, let's say
genotype.bim
snp1 ... A G
snp2 ... G T
snp3 ... G T
snp4 ... G A
...
snpN ... C G
where first column identifies each SNP and 5th and 6th column has genotype... (3 Replies)
Discussion started by: johnkim0806
3 Replies
4. Shell Programming and Scripting
I need to take one column of data and put it into the following format:
1st line,2nd line
3rd line,4th line
5th line,6th line
...
Thanks! (6 Replies)
Discussion started by: batcho
6 Replies
5. Shell Programming and Scripting
Hello,
I have to find out whether the last character is digit or alphabet. I manage to strip the last character but would need some help if there is one liner available to test the above.
set x = WM
echo $x | sed 's/.*\(.$\)/\1/'
O/P
M
I would like a one liner code to test whether the... (1 Reply)
Discussion started by: dixits
1 Replies
6. Shell Programming and Scripting
I have a text file in the following format
CCCCCGCCCCCCCCCCcCCCCCCCCCCCCCCC
AAAATAAAAAAAAAAAaAAAAAAAAAAAAAAA
TGTTTTTTTTTTTTGGtTTTTTTTTTTTTTTT
TTTT-TTTTTTTTTCTtTTTTTTTTTTTTTTT
Each row/line will have 32 letters and each line will only have multiple occurrences of 2 letters out of a pool... (1 Reply)
Discussion started by: Lucky Ali
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
Can anyone teach me by using perl.
let say i have an input file that content like below:
->line_01
aaabbbDDDTTTUSSy
->line_02
cccdddEEESSSGTTT
->line_03
xxxxyyyyzzzzzzzzzz
want the above input file content to become output file like below (every 2nd line after ->... become mono... (7 Replies)
Discussion started by: eisya10
7 Replies
8. Linux
Hello,
Does anyone know about MONO PROJECT? It supports .NET on linux! I have downloaded its packages and installed it. But I don't know how to start it!!! Where can I find installed programs?! (5 Replies)
Discussion started by: HSN
5 Replies
9. Shell Programming and Scripting
Hi,
I want to get the line count of the file from the 2nd line of the file ? The first line is header so want to skip that.
Thanks. (8 Replies)
Discussion started by: smc3
8 Replies
10. Shell Programming and Scripting
What can i do to check that the input is all alphabet.. ? (4 Replies)
Discussion started by: XXXXXXXXXX
4 Replies
Math::Polygon::Calc(3pm) User Contributed Perl Documentation Math::Polygon::Calc(3pm)
NAME
Math::Polygon::Calc - Simple polygon calculations
INHERITANCE
Math::Polygon::Calc
is a Exporter
SYNOPSIS
my @poly = ( [1,2], [2,4], [5,7], [1, 2] );
my ($xmin, $ymin, $xmax, $ymax) = polygon_bbox @poly;
my $area = polygon_area @poly;
MY $L = polygon_perimeter @poly;
if(polygon_is_clockwise @poly) { ... };
my @rot = polygon_start_minxy @poly;
DESCRIPTION
This package contains a wide variaty of relatively easy polygon calculations. More complex calculations are put in separate packages.
FUNCTIONS
polygon_area(LIST-OF-POINTS)
Returns the area enclosed by the polygon. The last point of the list must be the same as the first to produce a correct result.
The algorithm was found at <http://mathworld.wolfram.com/PolygonArea.html>, and sounds:
A = abs( 1/2 * (x1y2-x2y1 + x2y3-x3y2 ...)
polygon_bbox(LIST-OF-POINTS)
Returns a list with four elements: (xmin, ymin, xmax, ymax), which describe the bounding box of the polygon (all points of the polygon
are within that area.
polygon_beautify([HASH], LIST-OF-POINTS)
Polygons, certainly after some computations, can have a lot of horrible artifacts: points which are double, spikes, etc. This
functions provided by this module beautify The optional HASH contains the OPTIONS:
-Option --Default
remove_between <false>
remove_spikes <false>
remove_between => BOOLEAN
Simple points in-between are always removed, but more complex points are not: when the line is not parallel to one of the axes, more
intensive calculations must take place. This will only be done when this flags is set. NOT IMPLEMENTED YET
remove_spikes => BOOLEAN
polygon_centroid(LIST-OF-POINTS)
Returns the centroid location of the polygon. The last point of the list must be the same as the first to produce a correct result.
The algorithm was found at http://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon
polygon_clockwise(LIST-OF-POINTS)
Be sure the polygon points are in clockwise order.
polygon_contains_point(POINT, LIST-OF-POINTS)
Returns true if the point is unside the closed polygon.
polygon_counter_clockwise(LIST-OF-POINTS)
Be sure the polygon points are in counter-clockwise order.
polygon_equal(ARRAY-OF-POINTS, ARRAY-OF-POINTS, [TOLERANCE])
Compare two polygons, on the level of points. When the polygons are the same but rotated, this will return false. See polygon_same().
polygon_is_clockwise(LIST-OF-POINTS)
polygon_is_closed(POINTS)
polygon_perimeter(LIST-OF-POINTS)
The length of the line of the polygon. This can also be used to compute the length of any line: of the last point is not equal to the
first, then a line is presumed; for a polygon they must match.
This is simply Pythagoras.
$l = sqrt((x1-x0)^2 + (y1-y0)^2) + sqrt((x2-x1)^2+(y2-y1)^2) + ...
polygon_same(ARRAY-OF-POINTS, ARRAY-OF-POINTS, [TOLERANCE])
Compare two polygons, where the polygons may be rotated wrt each other. This is (much) slower than polygon_equal(), but some algorithms
will cause un unpredictable rotation in the result.
polygon_start_minxy(LIST-OF-POINTS)
Returns the polygon, where the point which is closest to the left-bottom corner of the bounding box is made first.
polygon_string(LIST-OF-POINTS)
SEE ALSO
This module is part of Math-Polygon distribution version 1.02, built on September 19, 2011. Website: http://perl.overmeer.net/geo/
LICENSE
Copyrights 2004,2006-2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.12.4 2011-09-19 Math::Polygon::Calc(3pm)