vue.js How to Change Feet and Inches to Inches - vue.js

In a text box I have to enter height value in feet & inches. It has to be 507 which when converted into inches it should be 67inches and if the height is entered 511 then it has to be converted to 71 inches .

Related

Fetch rectangle (line segments)co ordinates from pdf using itextpdf

I want to get the line segments co ordinates total & line segments should come. I want to read the pdf table co ordinates so that I can fetch the text inside the co ordinates? I am getting only 6 line segments. What about the 7 line segment?
I am using this program to read the line segments from tables(rectangle)
iText : image on PDF only if the position is blank
output is :
50 50 150 50
150 50 150 150
150 150 50 150
150 50 200 50
200 50 200 150
200 150 150 150
The cause of this problem is that iText reports a rectangle drawing instruction as subpath containing three explicit lines (bottom, right, top) and sets its Closed property implying the fourth line (left):
public void rectangle(float x, float y, float w, float h) {
moveTo(x, y);
lineTo(x + w, y);
lineTo(x + w, y + h);
lineTo(x, y + h);
closeSubpath();
}
(com.itextpdf.kernel.geom.Path.rectangle(float, float, float, float))
The FreeSpaceFinder in the referenced answer, though, only considers the explicit subpath segments, not the implied one. Thus, for your two rectangles you only get 6 lines instead of the expected 8 lines.
To also get implied closing lines for each Subpath subpath, you have to check whether subpath.isClosed(), and if it is, you have to determine the end point of the last IShape segment in subpath.getSegments() and the start point of the first IShape segment and add a line connecting those points.

How to calculate distance using voltage from Q4X Analog Laser Sensor

I have a Q4X Stainless Steel Analog Laser Sensor to calculate the distance with analog output voltage.
It does display distance on Laser Sensor display and I am trying to do the same thing in my code using scale factor but its not matches with Laser Sensor display value.
here is my scaling factor.
#define A2D_SCL_LASER ( 11.81f / ( 10.0f - 0.0f ) ) // inches per volt
Devices specs:
Supply Voltage (Vcc)
12 to 30 V dc
Sensing Range—Threaded Barrel Models
500 mm models: 25 mm to 500 mm (0.98 in to 19.68 in)
300 mm models: 25 mm to 300 mm (0.98 in to 11.81 in)
100 mm models: 25 mm to 100 mm (0.98 in to 3.94 in)
Comparison of distance calculation in my code and sensor display
My values(mm) sensor display value(mm)
1V 29.9974 52
2V 59.944 80
3V 89.916 107
4V 119.888 134
5V 150.114 162
6V 179.832 190
7V 209.804 217
8V 240.03 245
9V 270.002 272
10V 300 300
Ref:
http://info.bannerengineering.com/cs/groups/public/documents/literature/185623.pdf
I simply fitted the sensor displayed value with the voltage you give in your question. The R²=1 means that the fit is perfect (or near perfect) and this is a good sign.
The equation you are searching for is
Distance(mm) = 27.533 x Volt + 24.467

Formatting a column in Excel as % without multiplying with 100 along with rounding off the value

Is it possible to come up with a format which does following
Round off the value.
Show % symbol without multiplying the number with 100
If the value is negative show the number in red color with brackets along with % sign.
Ex: If the value is:
-5.34 should be converted as (5%) in red color
-4.78 should be converted as (5%) in red color
6.33 should be converted as 6 in regular color
Currently I am using 0.00##\%;[Red](0.00##\%) format which shows % symbol wihtout multiplying value with 100 & show negative number in red color with brackets around the value but it does NOT round off the values.
Thank you
Following format is doing the trick for me : ##0\%;[Red](##0\%)

How to Calculate Leading in PDF Document

How do I calculate leading in a PDF document?
For example:
48 0 0 48 72 677.28 Tm
(Hello World) Tj
0 -1.1075 TD
This renders the text Hello World at 48pt/57.6pt (120% line height) in Times-Roman.
According to the PDF Reference manual, "the leading parameter is measured in unscaled text space units. It specifies the vertical distance between the baselines of adjacent lines of text... The number is expressed in thousandths of a unit of text space."
Can someone please explain how 1.1075 and 57.6 are related?
You pdf commands is incorrect. I suppose you mean:
48 0 0 48 72 677.28 Tm
0 -1.1075 TD
(Hello World) Tj
This code set text coordinate system to (Tm command):
Scale x48 on x and x48 on y
Start position (72, 677.28)
Then it's move position to next line. Next line in 1.1075 "text" pixels. And then move start position by -1.1075 "text" pixels on y coordinate. Text pixel in this example it's pdf pixel multiplyed by 48. It's set by Tm command.
I may simplify you PDF code. It's the same:
48 0 0 48 72 570.096 Tm
(Hello World) Tj
Explanation: 677.28 - (1.1075*48) - (1.1075*48)
YOU should always remember that PDF it's a language. To calculate the real coordinates you shoud parse all previous commands.
There may be something like this before you commands:
10 0 0 10 0 0 cm
The leading is usually set in the PDF by the command TL, just like this:
12 TL
(El ingenioso hidalgo don Quijote de la Mancha)'
That 12 indicates a leading of 12 points until another TL is found.
I hope it helps you. I think this is the easiest way to do it :)

Where is rebol fill-pen documented (to get glow effect on a round rectangle)?

There is some discussion here about fill-pen
http://www.mail-archive.com/rebol-bounce#rebol.com/msg02019.html
But I can't see documentation about cubic, diamond, etc... effect for fill-pen in rebol's official doc ?
I'm trying to draw some round rectangle with glowing effect but don't really understand the parameters I'm playing with so I can't get exactly what I'd like (I'd like the glow effect starting from the center not from the dark left top corner):
view layout [
box 278x185 effect [ ; default box face size is 100x100
draw [
anti-alias on
; information for the next draw element (not required)
line-width 2.5 ; number of pixels in width of the border
pen black ; color of the edge of the next draw element
; fill pen is a little complex:
;fill-pen 10x10 0 90 0 1 1 0.0.0 255.0.0 255.0.255
fill-pen radial 20x20 5 55 5 5 10 0.0.0 55.0.5 55.0.5
; the draw element
box ; another box drawn as an effect
15 ; size of rounding in pixels
0x0 ; upper left corner
278x170 ; lower right corner
]
]
]
Finally I made it so not sure how I did manage to get :)
(source: reboltutorial.com)
view banner: layout/size [
;layout (window client area) size is 278x170 at the end of the spec block
at 0x0 ;put the banner on the top left corner
box 278x170 effect [ ; default box face size is 100x100
draw [
anti-alias on
; information for the next draw element (not required)
line-width 2.5 ; number of pixels in width of the border
pen black ; color of the edge of the next draw element
; fill pen is a little complex:
;fill-pen 10x10 0 90 0 1 1 0.0.0 255.0.0 255.0.255
;fill-pen radial 100x50 5 55 5 5 10 55.0.5 30.10.10 55.0.5
;fill-pen radial 100x50 5 55 5 10 10 55.0.5 30.10.10 71.0.6
fill-pen radial 100x50 5 55 5 10 10 71.0.6 30.10.10 71.0.6
; the draw element
box ; another box drawn as an effect
15 ; size of rounding in pixels
0x0 ; upper left corner
278x170 ; lower right corner
]
]
pad 30x-150
Text "Experiment" font [name: "Impact" size: 24 color: white]
image http://www.rebol.com/graphics/reb-logo.gif
] 278x170