Search found 1124 matches

by FanaticGuru
18 Dec 2013, 20:01
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

Updated First Page Change Log: Decimal2Fraction (Version 1.8) Added SetFormat, FloatFast, 0.15 within function to improve rounding performance SetFormat Settings are restored when function returns Added a new option of "D" which will limit fractions to the number of digits sent as a numbe...
by FanaticGuru
18 Dec 2013, 15:34
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

Decimal2Fraction(1.5,"AA") gives me 1'-7'' Relayer That was a silly mistake. I had a check in there if the denominator of the faction reduced to a 1 I assumed the fraction rounded and ended up 1/1 and removed the fraction and added 1 to the inches. But there is another much more common ca...
by FanaticGuru
18 Dec 2013, 01:02
Forum: Scripts and Functions
Topic: [Lib] RegEx Functions ver 11/30/14
Replies: 10
Views: 3191

Re: [Lib] RegEx Functions

try this MsgBox % RegEx_Grep(haystack,"\V*hot\V*",," / ") ; .* here matched everything until the last hot then everything after the last hot I knew .* was going past the end of the line even though I thought it was suppose to stop at `n. I have had to use \V before to solve a si...
by FanaticGuru
17 Dec 2013, 20:41
Forum: Scripts and Functions
Topic: [Lib] RegEx Functions ver 11/30/14
Replies: 10
Views: 3191

Re: [Lib] RegEx Functions

I have played around with these some and they look useful. I need a library of RegEx stuff. haystack = (join`n new hot key brand new auto key brand new hot auto key frog1dog2cat ) MsgBox % RegEx_Grep(haystack,".*hot.*",," / ") This does not return what I would expect. I would wan...
by FanaticGuru
17 Dec 2013, 17:23
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

Removed any default rounding I still think you should perform rounding, check the result of Fraction2Decimal(100/7) with regards to Fraction2Decimal , you interpret 4/8 as 0.5 Ft, and I interpreted as 0.5 Inch :-) I assume you are talking about doing: Decimal2Fraction(100/7) and not getting...
by FanaticGuru
17 Dec 2013, 15:02
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

Updated First Page Change Log: Decimal2Fraction (Version 1.6) Changed GCD function to different flavor to improve performance. Change Log: Fraction2Decimal (Version 1.5) RTrim to remove trailing zeros and . when unneeded. Change Log: Highlighted to Fraction (Version 1.5) Use ClipWait instead of Sle...
by FanaticGuru
17 Dec 2013, 13:49
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

I've done some speed tests on the GCD function in the past and found that the recursive functions are about 5x slower than using a while-loop like the function I posted above. (But the one-liner by Laszlo has a very high coolness factor.) Here they are with some speed tests: If we are shooting for ...
by FanaticGuru
17 Dec 2013, 04:27
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

Updated First Page Change Log: Decimal2Fraction (Version 1.5) After a quick reading of a Wiki I discovered that finding a Greatest Common Divisor is ridiculously simple to code. My preferred flavor below. GCD(A, B) { if !B return A else return GCD(B, Mod(A,B)) } So updated the script to use this GC...
by FanaticGuru
16 Dec 2013, 18:45
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

Ok, I come up with what appears to be a very versatile Fraction to Decimal that allows for feet and inches. Fractions := [ (Join, "4/8" "1 4/8" "-2'6"" 24/8" "6'8""" "5 ft 9 in" "1ft6in" "7 feet 8 / 10 inches" ...
by FanaticGuru
16 Dec 2013, 14:52
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

this code should take care of every possible way as it looks for the numbers and not the separators That is exactly what I thought of when I was laying in bed last night. I don't need to figure out complex RegEx. The input is basically 1 to 4 numbers separated by "stuff". If I look at it ...
by FanaticGuru
15 Dec 2013, 02:02
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

I tried your function and it struggled for few of my trials, here is my own attempt Yes, my function can be slow for fractions that involve large numbers. A fraction that results in something like 1234567/7654321 will take a long time to solve. What ever the resulting fraction is the function basic...
by FanaticGuru
14 Dec 2013, 12:31
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

that could easily be adjusted That seemed to have fixed the rounding problem and allowing the Base to be passed to the function is useful but it is problematic if the base is not an exponential of 2. DecFtToArch(1.4,3) might be expected to return a precision to a third of an inch which it will not....
by FanaticGuru
14 Dec 2013, 01:08
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

I should have done it right the first time There is still a problem with not rounding up. 1.9999 feet should round to 2 feet. 1.4999 feet should round to 1 foot 6 inches. The technique of converting the input to basically an integer number of Bases (64 in this case) then at the end dividing by 2 bo...
by FanaticGuru
13 Dec 2013, 19:29
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

Updated on First Page: Change Log: [Function] Decimal2Fraction (version 1.3) Made options case insensitive (thanks AlphaBravo, I knew about the i) flag but your eye for RegEx is always impressive) Streamlined the options to look for a number in the options and use for precision which eliminated a p...
by FanaticGuru
13 Dec 2013, 17:21
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction

MsgBox % Decimal2Fraction(1.2345,16,"A") returns 1'-1/4" , but it should be 1'-2 13/16" . Or am I just missing something? You are right. The architectural is all screwed up. I was so busy trying to get the decimal to fraction part working that I did not do the architectu...
by FanaticGuru
13 Dec 2013, 17:09
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

Re: [Function] Decimal2Fraction and Fraction2Decimal

I added a lot of stuff in the first post.

Now there is a Decimal2Fraction and Fraction2Decimal.
And an example script that actual uses the two which is what I designed the functions for in the first place.

FG
by FanaticGuru
13 Dec 2013, 13:38
Forum: Scripts and Functions
Topic: [Function] Decimal2Fraction and Fraction2Decimal
Replies: 38
Views: 6683

[Function] Decimal2Fraction and Fraction2Decimal

[Function] Decimal2Fraction Version 1.9 This is a function to convert a decimal number into a fraction and return that as a string. It has options to return an improper fraction or architectural fraction that is in feet and inches. The architectural option includes zero inches as is the custom in t...
by FanaticGuru
12 Dec 2013, 19:24
Forum: Scripts and Functions
Topic: StrReplace(string, chars)
Replies: 18
Views: 4745

Re: StrReplace(string, chars)

joedf wrote:actually the term "ahk_L" should no longer be used... :P it's either simply ahk or ahk v1.1


I agree. It causes confusion.

I believe it should just be AHK and if you need to refer to the old one it be called AHK Basic.

FG
by FanaticGuru
12 Dec 2013, 19:01
Forum: Scripts and Functions
Topic: StrReplace(string, chars)
Replies: 18
Views: 4745

Re: StrReplace(string, chars)

i am again confused on the issue of AHK_L and version 1.1.13.01 etc. ... :( :ugeek: AHK stands for AutoHotkey. There use to be AHK. Then came AHK_L. AHK is pretty much called AHK Basic or something along that line now. AHK_L has pretty much become the standard and is often now just called AHK. Vers...
by FanaticGuru
12 Dec 2013, 18:15
Forum: Gaming
Topic: KeyHolder
Replies: 6
Views: 3263

Re: KeyHolder

This is a stripped down version to experiment with handling key modifiers. SendMode Input #InstallKeybdHook Mods_List := ["LShift","RShift","LAlt","RAlt","LWin","RWin","LControl","RControl"] Press_Sleep := 50 F9:: Mods_P...

Go to advanced search