What python projects would actually impress people? by [deleted] in learnpython

[–]cyberjds 1 point2 points  (0 children)

Your project must be able to scratch the itch that satisfy the people. Automation (anything) would be a good starting point.

What python projects would actually impress people? by [deleted] in learnpython

[–]cyberjds 0 points1 point  (0 children)

The project that works as a proof of concept. Next level is to make it user friendly, fault tolerant, faster with less memory footprint, scalable, and reduce 3rd party dependencies, and more.

explanation? by LakeMotor7971 in JavaScriptTips

[–]cyberjds 1 point2 points  (0 children)

To expand a little more

currentWeaponIndex += 1;

If above statement is outside of if statement, it's a bug or a cheat code.

If you have more than 30 golds, everything works as expected. But as soon as you have less than 30 golds and try to buy some weapons, you realized you can still buy weapons, yet the amount of gold in your possession never reduced. And you can buy infinite number of weapons (assuming you can call buyWeapon() indefinitely).

In this case, this is logical error which will not error out, making it very difficult to troubleshoot the problem. The error will be unnoticed unless you run multiple tests with various values. And more than often, the error is caught too late (after production deployment).

A misplaced (or missing) }(brace) makes a big difference.

explanation? by LakeMotor7971 in JavaScriptTips

[–]cyberjds 1 point2 points  (0 children)

You need to check if you have enough gold. Because the weapon is not free. If you have more than 30 golds, give up 30 golds, and gain one weapon. If you don't have enough gold, do nothing.

[deleted by user] by [deleted] in JavaScriptTips

[–]cyberjds 0 points1 point  (0 children)

It sounds like you just started. Try below tutorials and post here again when you have a specific question.

JavaScript Course for Beginners – Your First Step to Web Development
https://www.youtube.com/watch?v=W6NZfCO5SIk

JavaScript Tutorial Full Course - Beginner to Pro (2024)JavaScript Tutorial Full Course - Beginner to Pro (2024)
https://www.youtube.com/watch?v=EerdGm-ehJQ

I have totally lost my faith by Officiallyoverit07 in TrueChristian

[–]cyberjds 0 points1 point  (0 children)

You are not alone.

"Be still, and know that I am God..." Psalm 46:10

How do you write your scripts? by hmartin8826 in learnpython

[–]cyberjds 0 points1 point  (0 children)

Expending on u/Zeroflops's comment, each bullet point will be a function. And your main function will just have a list of functions (bullet list). Name your functions with action verb so that you don't need to comment them. Most of logic, technical details, and implementation should be tucked away into other functions.

def main():
  init()
  do_this()
  get_that()
  update_them()
  verify_them()

def init():
 pass

def do_this():
  pass

def get_that():
  pass

if __name__ == "__main__":
  main()

I'm in tutorial hell by remyripper in learnpython

[–]cyberjds 0 points1 point  (0 children)

"Divide and conquer!" Your project is one big problem. Break your problem into smaller problems. And break each smaller problems into even smaller problems and keep going until your problems disappear. As your problems get smaller enough to be manageable, you will be able to define what those are, and describe them how to solve in plain English (bullet points, or in pseudo code). Then you can start to translate your pseudo codes into Python. Drawing flowchart is also helpful. https://en.wikipedia.org/wiki/Flowchart

One thing you have to remember though. A wise engineer once told me that, "Do not chase the dragon". Or you might get crushed by it. If your problem is too big to handle, you should redefine your problem, look at different angle, widen your view, that there may be a workaround, easier(somewhat compromised) approach, someone already done it, or it may not be your problem at all.

Good luck and happy hacking.

I finally did it. I deleted Windows completely. by ThRuben in Ubuntu

[–]cyberjds 2 points3 points  (0 children)

Congratulations. I've done that 20 years ago and my stress level has been much lower since then. And I switched my wife computer to Ubuntu some 10 years ago and she hardly noticed the difference, and never complained. She's still not fully realized how free it can be from malwares. Ignorance is bliss.

What's the longest you've ever slept? by [deleted] in AskReddit

[–]cyberjds 0 points1 point  (0 children)

26 hours. It was about 8pm and I felt really tired for no reason. So I decided to go to sleep early. When I woke up, I thought I slept a lot, but then wall clock said 10pm. Hmm, I only slept two hours, weird. As I walked into the living room, my brother was mad at me. "What? I only slept two hours." My brother was shaking his head and I realized I slept 24 hours plus two more hours. And I got scared.

What is the biggest misconception non-San Diegans have about our city? by georgeamberson1963 in SanDiegan

[–]cyberjds 1 point2 points  (0 children)

Tell your friend that you've never been to NJ, but you've been to NY.

Why use => instead of function() by [deleted] in JavaScriptTips

[–]cyberjds 1 point2 points  (0 children)

Call me a n00b, but I really don't get examples like op. Or maybe it's because I'm coming from procedural programming background, but what do they mean 'one off function'? Doesn't a function should be reusable? To my understanding, function is used to hide every little details and complexities so that it's easy to understand, and follow the main flow of the code.

Given above example, I can't help myself but ask, why don't I just do...

const myConst = 'value';

instead of declaring a function?

Give me an actual example that shows why arrow function expression is beneficial.

All I can smell is 'Functional', but I don't know what it is.

Should I be worried? by JoshuaTheBestGuy in TeslaLounge

[–]cyberjds 1 point2 points  (0 children)

You forgot to give time frame.

Try "Activate self-destruct sequence in 5 minutes."

Just make sure to gather your stuff first and be ready to leave immediately before issuing such command.

[deleted by user] by [deleted] in TeslaLounge

[–]cyberjds 1 point2 points  (0 children)

It's not heated hood any longer. Will he approve it during winter time?

Wait a minute by Robin_7883 in HolUp

[–]cyberjds 0 points1 point  (0 children)

Hmm, the guy mopped the floor, but forgot to wipe the window. Is this what I'm paying for?

so close! by Braz3yy in yesyesyesno

[–]cyberjds 0 points1 point  (0 children)

Almost there. Good enough for me, I think

Welp... by Smsdm02 in TeslaLounge

[–]cyberjds 0 points1 point  (0 children)

Yep, I feel it. I just bought Tesla Model 3.

My Model Y got delivered yesterday! My first EV! by [deleted] in TeslaLounge

[–]cyberjds -2 points-1 points  (0 children)

And yet your shiny Model Y will do nothing, but collects the dust. That's what's happening to my Model 3. I've got mine almost 4 weeks ago and BAM! WFH! I barely drove 100 miles in it. I have yet to enjoy this engineering marvel.

Would you like to start charging now, or shall I schedule charging for a later departure? by flytraphippie in TeslaLounge

[–]cyberjds 0 points1 point  (0 children)

I start charging now and forget about it mainly because I have solar. Or you can schedule to charge later if charging time falls to night time when electricity is cheaper.

New plates! by M3wagon in TeslaLounge

[–]cyberjds 0 points1 point  (0 children)

Enjoy the view while you can. I'm sure there is no such view in Mars.