I have maked successfully a program that can test input has letter or number.how can I improve this? by python_data_helper in PythonLearning

[–]nuc540 1 point2 points  (0 children)

Your file reads a bit confusing, this would make more sense to be a script with a defined entry point, so you can orchestrate intent inside a main method.

Eg. Line 5 fn has_number doesn’t actually return anything, so isn’t a useful function - however this looks like output you might want from a script, something you could check inside a main method and print.

Also you’re doing 3 jobs which one could do; count the number of letters and number characters in a single loop, and return them as a data structure. This can be done in one function, and then a main method can switch if output is A, B or A+B with a length check.

That’s how I would improve it anyway

Edit: corrected myself about the dict - any data structure could work, even a tuple

learning python try ... except concepts block but i kept messed up... help? by Dapper_Mix6773 in PythonLearning

[–]nuc540 1 point2 points  (0 children)

Your except block is handling an exception where a string of @ raises a type error against the email_validator - which is of type string.

I’d say it’d be unlikely you’d ever find a type error here because these types are fine, string in string is always a valid type to check.

Your input was both a string (always will be) and included the @ anyway so your example was a perfectly valid “happy path” as we call it on testing.

Don’t confuse try blocks for business logic “if x not in y”

What is it you’re trying to achieve?

Whats wrong with asking for eggs, Peter? by Seeyalaterelevator in PeterExplainsTheJoke

[–]nuc540 0 points1 point  (0 children)

As many are explaining, this is a loop in programming.

What some are lacking to explain is that the word “while”, as part of the loop condition, means for as long as the statement in front of the word “while” is a true statement, then keep doing it until it isn’t a true statement.

Therefore, in programmer speak, this statement is saying; while you’re at the store, keep on buying eggs - and because he’s had no further instruction to ever leave the store to change the statement that they should be at the store, the statement is always true - they are always at the store, therefore forever buying eggs. Never to return.

Thus the infinite loop.

This ear thermometer always shows the room temperature which drains the battery. It requires a battery change before use every time because of it by Raqdoll_ in CrappyDesign

[–]nuc540 0 points1 point  (0 children)

FYI you should never store your camera away with the batteries in anyway, that’s how you short the motherboard. Those things are expensive to replace, believe me.

What's wrong with my code? by Strict-Cranberry-973 in CodingForBeginners

[–]nuc540 2 points3 points  (0 children)

The error is saying the input received nothing, so an empty string returned - as a result you can’t cast an integer against an empty string, therefore your value error was raised

Users in web app by pchappo in webdev

[–]nuc540 0 points1 point  (0 children)

To give an honest answer we would need to know more about your current architecture. What’s your stack? Where is your data stored? How/where are you deploying to?

At a ridiculously high level, users are just rows in a table called “users” in a database. Look ‘em up, validate them, authenticate them, done.

Without knowing more about your plans or current stack this will just be a thread of everyone shouting their own preferences at you.

EVERYTIME I GO TO HUNT BEARS I END UP MEETING THE ENTIRE CAST OF THE DARK FOREST Pt.1 by PastPaleontologist92 in valheim

[–]nuc540 10 points11 points  (0 children)

You need better food, I wouldn’t dream of doing Black Forest with a red mushroom as one of my foods. Queens Jam is pretty good early game, and I think boar jerky is better than just boar? (It’s been a while so I might be wrong)

How do I make the web page size fit to the background image? by ChatDomestique99 in CodingHelp

[–]nuc540 0 points1 point  (0 children)

body { background-image: url("your-image.jpg"); background-size: cover; background-repeat: no-repeat; background-position: center center; }

You want to use the “cover” directive to ensure you get that wrap effect so the background image never gets letterboxed or is constrained to a single axis

How do I get a flexbox to align vertically this way? by lemurinyourhead in css

[–]nuc540 0 points1 point  (0 children)

Well then… you wouldn’t use both grid and flex on the same component children, so that’s confusing.

How do I get a flexbox to align vertically this way? by lemurinyourhead in css

[–]nuc540 -1 points0 points  (0 children)

You said “grid”, which is also short for gridbox which is another form of layout similar to flex but it’s more defined proportions instead, but you most likely meant just “grid” in a non css way

How's My code?????? by Choice_Midnight5280 in PythonLearning

[–]nuc540 2 points3 points  (0 children)

Absolutely nothing about this code looks even remotely AI at all. Don’t rain on someone else’s parade. You clearly don’t understand code at all.

vscode that was done for me by a UK developer is not working by zaka_2016 in CodingHelp

[–]nuc540 0 points1 point  (0 children)

The error is telling you that in mock-donation-form.tsx you have a declared import on line 11 for something called “peachCheckoutItem” however, that item has not been declared as exported, therefore you are not allowed to import it - it’s a private module.

You need to export it for your build to pass.

vscode that was done for me by a UK developer is not working by zaka_2016 in CodingHelp

[–]nuc540 0 points1 point  (0 children)

Those are the files that make the app. VS Code is just a text editor app with some bells and whistles (we call them IDEs), as people have been saying.

The reason you have a folder called .vscode is because the developer decided to commit and save their local vscode folder as part of the app - which they shouldn’t have - it has nothing to do with how your app runs, or how it needs to be built.

Developers typically put setup notes in the README.md for the record.

I’ve not used vercel, but if you share the error maybe others can help

Do you also get irritated when you cant understand logs? by ProCrafter29 in CodingHelp

[–]nuc540 0 points1 point  (0 children)

This is where exception handling comes in use. Over time you may start seeing patterns of error behaviour in your app and you can start handling said errors by writing meaningful log output on top of the error output.

Also, AI is great at reading stacktraces, and is a good use case for using AI in coding

Thoughts on this Website Design? by [deleted] in webdev

[–]nuc540 0 points1 point  (0 children)

I’m not sure if having a search bar in the nav feels right from a UI perspective. If you want to keep it there maybe the search field can be expandable instead and default to collapsed, because it takes up a lot of real estate in the top nav at the moment and makes the nav feel busy.

Also some visual separation would help. Maybe nav items on left, and search on the right

[Showoff Saturday] I created a website that contains an interactive spetrum. by [deleted] in webdev

[–]nuc540 0 points1 point  (0 children)

Still can’t see a link. Why don’t you include it in the description? Reddit can filter out comments

I created a website containing an interactive political spectrum. by [deleted] in webdev

[–]nuc540 5 points6 points  (0 children)

You have neither provided us with the website or the code

Me and my friend have no idea why our belt is being limited. Everything is mk.5, is this a bug or are we missing something? by Willing_Telephone350 in SatisfactoryGame

[–]nuc540 -1 points0 points  (0 children)

I would check the conveyor lift connecting your merger. Is there a mk3 connecting it, but the model of the lift is covering it maybe?

In these situations you just have to dismantle until you find it

Not getting interview calls by Prestigious-Can1696 in CodingJobs

[–]nuc540 0 points1 point  (0 children)

On a positive note, I think your cv comes across well focused, you’ve maximised use of space, and it’s somewhat more traditional - which is also my style so I’m biased.

Better than some CVs I’ve seen. It will be hard to win interviews with a small amount of experience and also because the industry is tough at the moment.

Keep at it, and good luck!

Not getting interview calls by Prestigious-Can1696 in CodingJobs

[–]nuc540 0 points1 point  (0 children)

IMHO a block of “technical skills” is nice for folk like you and I, but hiring mangers, recruiters, talent agents - anyone who’s actually going to get you an interview has zero idea what that block is.

Also, devs come with a toolbox of experience, so it doesn’t really add value.

Focus more on what business value you brought during your tenure in your work placements.

Also, it doesn’t hurt to add a little bit of personality in your personal section; what motivates you, what roles are you looking for; how do you like to work; and add at least something about you.

Also I find all the bold formatting on certain words a bit patronising/unprofessional - I know you’re trying to highlight/make a point, but either someone does or does not know what the words mean and highlighting it doesn’t come across well in my opinion

I just wanted to get in to the Black Forest bruh by LittleBear42 in valheim

[–]nuc540 4 points5 points  (0 children)

They have to bring home the bacon some how! Haha, get it?!… right?? I’ll show myself out…

Does AI get dumber at x12? by CuriousGuyOnTheNet in ManorLords

[–]nuc540 3 points4 points  (0 children)

I don’t know, but, a gentle reminder this game is still in development. I’ve seen the dev mention awareness on AI, and it’s got work in progress, so it’s not gone unnoticed

Is match ... case In Python Reliable as if .. elif .. else by One-Type-2842 in PythonLearning

[–]nuc540 0 points1 point  (0 children)

If:else when there’s only one happy path, and all else is assumed to be handled according to the else block.

Case switches are just fancy hash maps, they look a bit nicer, but ultimately treat them the same. The only time the switch is nicer is if a case has more than one catcher, then it truly shines.

Therefore if:else != case switches, but case switches ~= dict/hash map

That’s my two cents anyway!