BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Coding because you are lazy

Today i wanted to find out, how much money i'd have to put on my phone, so that eventually my subscription would bring it down to 0.

 

Each time my subscription (6.99€) renews, my account balance is left at 4.5€. If i fill it manually, 5€ is the lowest amount i can fill it with. I couldn't be arsed to calculate the above on my own so i made a bit of labview code to do it for me. 

 

lazy.png

I'm sure it's terribly inefficient, but it was a quick hack and it works.

---------------

 

Anyway, the point of this thread is to post the code you wrote when you were too lazy to do something manually 😄

0 Kudos
Message 1 of 37
(3,829 Views)

@AeroSoul wrote:

I'm sure it's terribly inefficient, but it was a quick hack and it works.


Such as how the array in the inner loop isn't needed at all...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 37
(3,795 Views)

Yeah, could have just checked if it's less than 6.99 and call it a day 😛

0 Kudos
Message 3 of 37
(3,792 Views)

@AeroSoul wrote:

Yeah, could have just checked if it's less than 6.99 and call it a day 😛


That too but, I think Tim meant to point out that you put an array on your SR then only care about one value.  A sure candidate for the Rube-Goldburg thread.😂🤣🙃

 

But, we've all had face-palm moments like that. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 37
(3,779 Views)

I would have been way too lazy to code all that! I am sure there is a "one-liner" solution that fits on a postage stamp. 😄

 

(I would also definitely do everything in pennies (or local equivalent) using pure integer math. There are way too many places where floating point limitations can accumulate that you never get a zero, ever.)

0 Kudos
Message 5 of 37
(3,766 Views)

A very lazy solution. I am sure it can be simplified 😄

 

altenbach_0-1632159784051.png

 

0 Kudos
Message 6 of 37
(3,760 Views)

Examples: kudos for having better Google skills than I

  • "You can't do that with LabVIEW"
  • "I NEED a numeric display with no BG color" <I actually got a solved mark for that thread 18 hours before the exact same requirement hit my inbox.>
  • My USB device shuts down.  <from the other contractor sitting next to me.> yes, I even had to fix the power manager settings myself!
  • I hope someone else can show me an examle of how to simulate a tracked vehicle's motion." <@CA I still won't try to reinvent atan again>

"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 37
(3,750 Views)

@altenbach wrote:

A very lazy solution. I am sure it can be simplified 😄

That's just plain wrong... the original calculation was in € 😄

0 Kudos
Message 8 of 37
(3,733 Views)

That's why I earlier said "Pennies (or local equivalent)". 😄

 

(my keyboard does not have the euro symbol and I was way too lazy to bring up the charmap. Wasn't that on topic? 😄 )

0 Kudos
Message 9 of 37
(3,715 Views)

@altenbach  ha scritto:

 

(my keyboard does not have the euro symbol and I was way too lazy to bring up the charmap. Wasn't that on topic? 😄 )


On my system I can enter the "€" symbol by pressing Ctrl+Alt+E: I learned it once and for all 'cause I'm too lazy to bring up the charmap every single time I have to use it (just to stay on topic 😉 )



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 10 of 37
(3,699 Views)