randomdreams (
randomdreams) wrote2019-03-05 08:35 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
(no subject)
The main language I use for my test system at work is a test management package that provides a way to call lower-level language functions. It is oddly selective in what it allows you to do. Things like
One of the things it provides is datalogging: you call a low-level routine, pass it a number by reference, and it chucks the number into an ASCII file. The number is associated as a value, with a key, and the key is the name of the datalogging routine.
So a chunk of datalog code would look like:
measure input_voltage_1
input_voltage_1 datalog()
and so forth.
Which is fine, but that means for every measurement I have to correctly type in what the measurement is, and that gets old fast because I'm measuring like 800 things. (Seriously. Actually more.)
I was poking around in the program's documentation today and found that because it's sort of vaguely object-oriented, I can mess around with the inherited attributes and with overloading them, and realized that I can dynamically generate names, that I can use to overwrite the names of the datalogging routine.
As a result, I converted 1023 lines of code into 7 lines of code, and the really cool part is that 256 of those lines were names I had to type in by hand, and now there aren't any names I have to type in by hand. It generates the whole works for me, because it knows what it just measured and uses that to produce the key.
I'm ridiculously pleased with this, mostly because of the massive scope of error reduction.
And I'm pretty sure this is the sort of thing that is completely meaningless to my manager, because I'm the only person who would ever use complicated stuff like this.
if (variable OR 64)always return '1', because it analyzes clauses as booleans, even though you think you're bitmasking, for instance. (And if this is covered in the documentation, I haven't found it.)
One of the things it provides is datalogging: you call a low-level routine, pass it a number by reference, and it chucks the number into an ASCII file. The number is associated as a value, with a key, and the key is the name of the datalogging routine.
So a chunk of datalog code would look like:
measure input_voltage_1
input_voltage_1 datalog()
and so forth.
Which is fine, but that means for every measurement I have to correctly type in what the measurement is, and that gets old fast because I'm measuring like 800 things. (Seriously. Actually more.)
I was poking around in the program's documentation today and found that because it's sort of vaguely object-oriented, I can mess around with the inherited attributes and with overloading them, and realized that I can dynamically generate names, that I can use to overwrite the names of the datalogging routine.
As a result, I converted 1023 lines of code into 7 lines of code, and the really cool part is that 256 of those lines were names I had to type in by hand, and now there aren't any names I have to type in by hand. It generates the whole works for me, because it knows what it just measured and uses that to produce the key.
I'm ridiculously pleased with this, mostly because of the massive scope of error reduction.
And I'm pretty sure this is the sort of thing that is completely meaningless to my manager, because I'm the only person who would ever use complicated stuff like this.
no subject
I got this hint that I might be able to make a shortcut that will make it way faster and 10 to the 5th power more accurate to run data through the test system. Would you like me to take X time (X being up to 3 times longer than it actually took you) to see if this can be done? I believe that there is a very high probability that this will be a substantial savings for the company.
Makes you look good and forces him to "see" the issue. Of course if he says no, you can keep using the old system....
no subject
no subject
no subject
no subject
no subject
no subject
no subject
Bravo! Doing something like that would make me ridiculously pleased too :)
no subject
no subject
no subject
no subject