Who's Bored? (2 Viewers)

RainLover

VIP From a land downunder
Local time
Today, 23:51
Joined
Jan 5, 2009
Messages
5,041
Re: Who's bored?

Dan re post #13

It is good to see someone present their code in such a proper manner.

Good indenting and white spacing etc.

Well done, and I hope others take notice.
 

BlueIshDan

☠
Local time
Today, 10:51
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

Lol thanks.
 

BigHappyDaddy

Coding Monkey Wanna-Be
Local time
Today, 06:51
Joined
Aug 22, 2012
Messages
205
Re: Who's bored?

vbaInet,

Yes, the character sequence for 256 is IV in Excel, but it was implied in the original post that A = 0. :p

Input : Number - (zero bound) example 5, 51
Output : String - example (for the input 5) F, (for the input 51) AZ

For 5 to become F, A has to be 0. Ditto for 51 = AZ.

Hence, if you carry this out, the character sequence for 256 is actually IW.
 

BlueIshDan

☠
Local time
Today, 10:51
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

I never noticed this correction by vbaInet, but thank you for pointing out that the hexavigesimal alpha only system does start at A=0 ends at Z = 25 And 26 = 1 0(BA).
 

BlueIshDan

☠
Local time
Today, 10:51
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

I'm also still questioning the performance of a function that is called repeatedly for the same result as a function hat is called once. The reinitializing of variables and I'm sure the processing of jumping between the scope of which is calling the function and the function itself is not worth doing. I don't know why but I've always had a problem with this lol. That goes to say the QSort has always bugged the crap out of me too! :D

Example for me is when doing a batch file that has to copy a bunch of files from one directory to another. Writing the xcopy command for each file you want to copy causes the process to slow down because it has to initialize the command and dump it for each file. But if you create mock (empty files with same name) and simply have one xcopy command that copies all files from one directory to another where they exist. The process runs extremely faster.

Thoughts or guidance on how I should think about this?

Please have patients for my ignorance, I only graduated a community college Programmer-Analyst program about a year ago so I'm still not very good at describing these things. :)
 

BigHappyDaddy

Coding Monkey Wanna-Be
Local time
Today, 06:51
Joined
Aug 22, 2012
Messages
205
Re: Who's bored?

Someone could always volunteer to do a semi-scientific experiment. Wrap a timer around a numerical sequence loop of several thousand(?) numbers and call the function for number. Then compare times???
 

BlueIshDan

☠
Local time
Today, 10:51
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

You would have to simplify my function to only work for one base conversion. It is currently made for all decimal to base(#) conversions.
 

vbaInet

AWF VIP
Local time
Today, 14:51
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

vbaInet,

Yes, the character sequence for 256 is IV in Excel, but it was implied in the original post that A = 0. :p
Quite rightly so BigHappyDaddy! I'll have to blame Paul (the OP) for thinking 0 is A :D
 

vbaInet

AWF VIP
Local time
Today, 14:51
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

Someone could always volunteer to do a semi-scientific experiment. Wrap a timer around a numerical sequence loop of several thousand(?) numbers and call the function for number. Then compare times???
We'll need BlueIshDan to write a working function because 99999 isn't FRYD, it's EQXD (0 = A) or EQXC (1 = A). :)
 

pr2-eugin

Super Moderator
Local time
Today, 14:51
Joined
Nov 30, 2011
Messages
8,494
Re: Who's bored?

BlueIshDan, BigHappyDaddy, vbaInet and everyone who chiped in. Thank you so much. As I mentioned this was just a part of a "fun" experiment to see how people see performing a set of commands. Pros and Cons, discussion and obviously learning something new. Sorry I was away for the weekend after finishing early on a Friday. So could not keep up with this thread.

I am impressed with all the answers, the eye openers. It has been a great one. Now I have to fish out all the code provided compare them against my own and see the most efficient one. :D

I'll have to blame Paul (the OP) for thinking 0 is A :D
Probably my nerdy way of adding complexity to the issue :D
 

pr2-eugin

Super Moderator
Local time
Today, 14:51
Joined
Nov 30, 2011
Messages
8,494
Re: Who's bored?

Dan .. Bijective base-26, hexavigesimal are some of the words I am actually hearing for the very first time. :eek:

My uni education system has failed me ! :eek:
 

vbaInet

AWF VIP
Local time
Today, 14:51
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

Probably my nerdy way of adding complexity to the issue :D
I'm now going to rank all the nerds on this project:

1. BigHappyDaddy - Winner!
2. pr2-eugin - for setting such a nerdy task
3. BlueIshDan - for adding complex calculations to a simple task
.
.
.
.
7. vbaInet - for participating
:D
 

vbaInet

AWF VIP
Local time
Today, 14:51
Joined
Jan 22, 2010
Messages
26,374
Re: Who's bored?

I'm also still questioning the performance of a function that is called repeatedly for the same result as a function hat is called once. The reinitializing of variables and I'm sure the processing of jumping between the scope of which is calling the function and the function itself is not worth doing. I don't know why but I've always had a problem with this lol. That goes to say the QSort has always bugged the crap out of me too! :D
A loop would be less expensive than recursion but in this case it's very negligible. We're working with native data types, no other classes or functions involved and just one IF...END IF block. The whole concept of recursion is to take the tedium out of having to write a bunch of IFs and nested FORs. Think about trying to traverse a tree with 50 nodes and each node has other 50 nodes and so on.

Example for me is when doing a batch file that has to copy a bunch of files from one directory to another. Writing the xcopy command for each file you want to copy causes the process to slow down because it has to initialize the command and dump it for each file. But if you create mock (empty files with same name) and simply have one xcopy command that copies all files from one directory to another where they exist. The process runs extremely faster.

Thoughts or guidance on how I should think about this?
If there are less of the files that you don't need in the folder then copy the folder and delete the ones you don't need. It might just be quicker than moving individual files. Also try the FileScriptingObject for copying/moving files/folders.
 

BlueIshDan

☠
Local time
Today, 10:51
Joined
May 15, 2014
Messages
1,122
Re: Who's bored?

Awesome :D thanks lol

Also I need help fixing my function. Here is the math it goes through for its result.

Code:
(Decimal) Base-10: 99999
To base-26
Alpha: True
-------------------------------------
(0) : 99999 Mod 26
(0) = 3
 (99999 / 26 : 3846)

(1) : 3846 Mod 26
(1) = 24
 (3846 / 26 : 147)

(2) : 147 Mod 26
(2) = 17
 (147 / 26 : 5)

(3) : 5 Mod 26
(3) = 5
 (5 / 26 : 0)


(3) 5 = F
(2) 17 = R
(1) 24 = Y
(0) 3 = D

I agree, I might been a bit overly nerdy with this. It wasn't really a task though. I decided to make a dynamic function that does all conversions because I enjoy the thrill of coding like this.

Just getting the feeling that people aggravated towards my posts and the mathematical tangent I went on and I don't mean to start any of that here :(
 
Last edited:

BigHappyDaddy

Coding Monkey Wanna-Be
Local time
Today, 06:51
Joined
Aug 22, 2012
Messages
205
Re: Who's bored?

BlueIshDan,

I think your problem is recording the values of the Mod function as the value to be converted to the alpha sequence. I don't think this explains it well enough, but think of long division. We record the number of times divisor goes into the number, going left to right (or most significant digit to least). The remainder is carried over to the next "number". In your case, it seems to me that you are using the remainder to determine the alpha value for the current signifcant digit.

I know this is explained poorly, but I actually when down a similar path in my first attempt when I realized during testing I was getting incorrect results.
 

BigHappyDaddy

Coding Monkey Wanna-Be
Local time
Today, 06:51
Joined
Aug 22, 2012
Messages
205
Re: Who's bored?

The more I think about this, the more I think part of the problem is that is not a straight base-10 to hexavigesimal conversion.

In any base system we use, we include 0, binary has 0,1. Octal has 0,1,2,3,4,5,6,7 and etc. In this case we were given the task of converting as number to an alpha sequence where A = 0.

So what is the value after "Z". In this case the answer is "AA". But A = 0, so this is two zeros for each significant digit. The value after "Z" in a hexavigesimal sequence would be to add a significant digit with the first non-zero value (B), followed by a zero (A). So, BA follows Z. And really Z is actually "AZ", we just assume nothing is zero, but again, in this case A=0.

Make sense or did I just churn up a lot of mud???:eek:
 

Users who are viewing this thread

Top Bottom