Sponsored Content
Full Discussion: Returning start/end indices
Top Forums Programming Returning start/end indices Post 302487668 by kristinu on Thursday 13th of January 2011 07:13:03 AM
Old 01-13-2011
Returning start/end indices

I have an array of distances and a len, for example

Code:
len = 323
dist = [187 243 323 476 500 670 734 862]

I want to calculate the start and end index values around each distance in the array with a length of len from it. Values in dist are stored in ascending order.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Complete dump from start to the end

Hi all... I was accidentally wipe off my iphone and lost all the data in it:(. So I tried to use dd to create an image from iphone and ssh to the Mac by using: dd if=/dev/disk | ssh user@MacIP of='image.img' Then I mount this image on Mac/Windows and run recovery software because most of the... (1 Reply)
Discussion started by: seraphc
1 Replies

2. Shell Programming and Scripting

searching between start and end time

Hello All, Below mentioned is my log file. I want to make a script which ask for start time and then end time and then search particular word between those lines. Like start time:2 end time: 4 and then search all values starting from cell 84 between this time. Please Help ... (2 Replies)
Discussion started by: wakhan
2 Replies

3. Shell Programming and Scripting

can I specifiy the start and end times manually

Hi I have a ksh script which fetches data from a db using a number of .arc files and creates CSV files for them and puts them on the server. Question is, how can I specifiy the start and stop times specifically so that data is fetched for a certain period? # Get the current time as the... (1 Reply)
Discussion started by: shajju
1 Replies

4. Shell Programming and Scripting

Perl regex using /START/../END/

I need help with perl code. I have a data file with lots of data example: data.txt file START DATA1 sjdfh kjhdf DATA2 sdkjfhk jds dshfgdf ... Around 20 - 30 lines END LDDDD awdkjasd a sdkahgdk jasdh SOME CRAP Some EMPTY lines etc START DATA1 sjdfh kjhdf DATA2 sdkjfhk jds... (2 Replies)
Discussion started by: chakrapani
2 Replies

5. Shell Programming and Scripting

Calculating start and end of UK summertime

I have a need to calculate when British Summer Time starts and ends. After messing around, the following seems to work in Bash. echo `date +%Y`-03-`cal 3 \`date +%Y\` | grep -oE "^]{2}" | tail -1`T01:00:00Zand echo `date +%Y`-03-`cal 10 \`date +%Y\` | grep -oE "^]{2}" | tail ... (10 Replies)
Discussion started by: esb4me
10 Replies

6. Shell Programming and Scripting

Remove lines between the start string and end string including start and end string Python

Hi, I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

7. Shell Programming and Scripting

Get the lines from logfile within start and end date

Hi guys, I am having the below logfile,date in yyyy-mm-dd 2013-08-02 *some content* 2013-08-02 *some content* 2013-08-02 *some content* 2013-08-03 *some content* 2013-08-05 *some content* from the above logfile i need to get the lines between the two timestamps,if i give... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

8. Shell Programming and Scripting

How can I search with start and end criteria?

Hello I'm using cygwin and wouldlike extract information from an xml file according specific values, but don't know how. Let's say in a file content looks like this: <tab> SURNAME=Mustermann NAME=Max CUSTOMER SINCE= 18.01.2000 ADDRESS=Birmingham ... (2 Replies)
Discussion started by: witchblade
2 Replies

9. Shell Programming and Scripting

Split a file by start and end row.

I have a file which looks something as following, I would like to split to several files, The start and end of each file is 'FILE' and end with 'ASCII... ' . At the same time for each file in the first column add 100 and also second column add 100 the rest of the column as it is , see example of... (2 Replies)
Discussion started by: tk2000
2 Replies

10. UNIX for Beginners Questions & Answers

Splitting week start date and end date based on custom period start dates

Below are my custom period start and end dates based on a calender, these dates are placed in a file, for each period i need to split into three weeks for each period row, example is given below. Could you please help out to achieve solution through shell script.. File content: ... (2 Replies)
Discussion started by: nani2019
2 Replies
QwtScaleWidget(3)						 Qwt User's Guide						 QwtScaleWidget(3)

NAME
QwtScaleWidget - A Widget which contains a scale. SYNOPSIS
#include <qwt_scale_widget.h> Signals void scaleDivChanged () Public Member Functions QwtScaleDraw::Alignment alignment () const QwtDoubleInterval colorBarInterval () const QRect colorBarRect (const QRect &) const int colorBarWidth () const const QwtColorMap & colorMap () const int dimForLength (int length, const QFont &scaleFont) const void drawColorBar (QPainter *painter, const QRect &rect) const void drawTitle (QPainter *painter, QwtScaleDraw::Alignment, const QRect &rect) const int endBorderDist () const void getBorderDistHint (int &start, int &end) const void getMinBorderDist (int &start, int &end) const bool isColorBarEnabled () const int margin () const virtual QSize minimumSizeHint () const int penWidth () const QwtScaleWidget (QWidget *parent=NULL) QwtScaleWidget (QwtScaleDraw::Alignment, QWidget *parent=NULL) const QwtScaleDraw * scaleDraw () const QwtScaleDraw * scaleDraw () void setAlignment (QwtScaleDraw::Alignment) void setBorderDist (int start, int end) void setColorBarEnabled (bool) void setColorBarWidth (int) void setColorMap (const QwtDoubleInterval &, const QwtColorMap &) void setLabelAlignment (Qt::Alignment) void setLabelRotation (double rotation) void setMargin (int) void setMinBorderDist (int start, int end) void setPenWidth (int) void setScaleDiv (QwtScaleTransformation *, const QwtScaleDiv &sd) void setScaleDraw (QwtScaleDraw *) void setSpacing (int td) void setTitle (const QString &title) void setTitle (const QwtText &title) virtual QSize sizeHint () const int spacing () const int startBorderDist () const QwtText title () const int titleHeightForWidth (int width) const virtual ~QwtScaleWidget () Protected Member Functions void draw (QPainter *p) const void layoutScale (bool update=true) virtual void paintEvent (QPaintEvent *e) virtual void resizeEvent (QResizeEvent *e) void scaleChange () Detailed Description A Widget which contains a scale. This Widget can be used to decorate composite widgets with a scale. Constructor &; Destructor Documentation QwtScaleWidget::QwtScaleWidget (QWidget *parent = NULL) [explicit] Create a scale with the position QwtScaleWidget::Left. Parameters: parent Parent widget QwtScaleWidget::QwtScaleWidget (QwtScaleDraw::Alignmentalign, QWidget *parent = NULL) [explicit] Constructor. Parameters: align Alignment. parent Parent widget QwtScaleWidget::~QwtScaleWidget () [virtual] Destructor. Member Function Documentation QwtScaleDraw::Alignment QwtScaleWidget::alignment () const Returns: position See also: setPosition() int QwtScaleWidget::dimForLength (intlength, const QFont &scaleFont) const Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title. Parameters: length width for horizontal, height for vertical scales scaleFont Font of the scale Returns: height for horizontal, width for vertical scales void QwtScaleWidget::draw (QPainter *p) const [protected] draw the scale void QwtScaleWidget::drawTitle (QPainter *painter, QwtScaleDraw::Alignmentalign, const QRect &rect) const Rotate and paint a title according to its position into a given rectangle. Parameters: painter Painter align Alignment rect Bounding rectangle int QwtScaleWidget::endBorderDist () const Returns: end border distance See also: setBorderDist() void QwtScaleWidget::getBorderDistHint (int &start, int &end) const Calculate a hint for the border distances. This member function calculates the distance of the scale's endpoints from the widget borders which is required for the mark labels to fit into the widget. The maximum of this distance an the minimum border distance is returned. Warning: o The minimum border distance depends on the font. See also: setMinBorderDist(), getMinBorderDist(), setBorderDist() void QwtScaleWidget::getMinBorderDist (int &start, int &end) const Get the minimum value for the distances of the scale's endpoints from the widget borders. See also: setMinBorderDist(), getBorderDistHint() void QwtScaleWidget::layoutScale (boolupdate = true) [protected] Recalculate the scale's geometry and layout based on. int QwtScaleWidget::margin () const Returns: margin See also: setMargin() QSize QwtScaleWidget::minimumSizeHint () const [virtual] Returns: a minimum size hint void QwtScaleWidget::paintEvent (QPaintEvent *e) [protected, virtual] paintEvent int QwtScaleWidget::penWidth () const Returns: Scale pen width See also: setPenWidth() void QwtScaleWidget::resizeEvent (QResizeEvent *e) [protected, virtual] resizeEvent void QwtScaleWidget::scaleChange () [protected] Notify a change of the scale. This virtual function can be overloaded by derived classes. The default implementation updates the geometry and repaints the widget. void QwtScaleWidget::scaleDivChanged () [signal] Signal emitted, whenever the scale divison changes. const QwtScaleDraw * QwtScaleWidget::scaleDraw () const scaleDraw of this scale See also: setScaleDraw(), QwtScaleDraw::setScaleDraw() QwtScaleDraw * QwtScaleWidget::scaleDraw () scaleDraw of this scale See also: QwtScaleDraw::setScaleDraw() void QwtScaleWidget::setAlignment (QwtScaleDraw::Alignmentalignment) Change the alignment Parameters: alignment New alignment See also: alignment() void QwtScaleWidget::setBorderDist (intdist1, intdist2) Specify distances of the scale's endpoints from the widget's borders. The actual borders will never be less than minimum border distance. Parameters: dist1 Left or top Distance dist2 Right or bottom distance See also: borderDist() void QwtScaleWidget::setLabelAlignment (Qt::Alignmentalignment) Change the alignment for the labels. See also: QwtScaleDraw::setLabelAlignment(), setLabelRotation() void QwtScaleWidget::setLabelRotation (doublerotation) Change the rotation for the labels. See QwtScaleDraw::setLabelRotation(). Parameters: rotation Rotation See also: QwtScaleDraw::setLabelRotation(), setLabelFlags() void QwtScaleWidget::setMargin (intmargin) Specify the margin to the colorBar/base line. Parameters: margin Margin See also: margin() void QwtScaleWidget::setMinBorderDist (intstart, intend) Set a minimum value for the distances of the scale's endpoints from the widget borders. This is useful to avoid that the scales are 'jumping', when the tick labels or their positions change often. Parameters: start Minimum for the start border end Minimum for the end border See also: getMinBorderDist(), getBorderDistHint() void QwtScaleWidget::setPenWidth (intwidth) Specify the width of the scale pen. Parameters: width Pen width See also: penWidth() void QwtScaleWidget::setScaleDiv (QwtScaleTransformation *transformation, const QwtScaleDiv &scaleDiv) Assign a scale division. The scale division determines where to set the tick marks. Parameters: transformation Transformation, needed to translate between scale and pixal values scaleDiv Scale Division See also: For more information about scale divisions, see QwtScaleDiv. void QwtScaleWidget::setScaleDraw (QwtScaleDraw *sd) Set a scale draw sd has to be created with new and will be deleted in ~QwtScaleWidget() or the next call of setScaleDraw(). Parameters: sd ScaleDraw object See also: scaleDraw() void QwtScaleWidget::setSpacing (intspacing) Specify the distance between color bar, scale and title. Parameters: spacing Spacing See also: spacing() void QwtScaleWidget::setTitle (const QString &title) Give title new text contents Parameters: title New title See also: title(), setTitle(const QwtText &); void QwtScaleWidget::setTitle (const QwtText &title) Give title new text contents Parameters: title New title See also: title() Warning: The title flags are interpreted in direction of the label, AlignTop, AlignBottom can't be set as the title will always be aligned to the scale. QSize QwtScaleWidget::sizeHint () const [virtual] Returns: a size hint int QwtScaleWidget::spacing () const Returns: distance between scale and title See also: setMargin() int QwtScaleWidget::startBorderDist () const Returns: start border distance See also: setBorderDist() QwtText QwtScaleWidget::title () const Returns: title See also: setTitle() int QwtScaleWidget::titleHeightForWidth (intwidth) const Find the height of the title for a given width. Parameters: width Width Returns: height Height Author Generated automatically by Doxygen for Qwt User's Guide from the source code. Version 5.2.2 Mon Aug 1 2011 QwtScaleWidget(3)
All times are GMT -4. The time now is 01:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy