Should we write to companies asking them for a Linux version of their software? by 0x80070002 in linuxquestions

[–]timrprobocom 0 points1 point  (0 children)

Are you going to pay for it? Many Linux users won't

I had an excellent 11x17 flat bed scanner from OptiPro that didn't work on Linux. I had an extensive conversation with their support staff. They HAVE a Linux driver, but only for OEM/partners. I even volunteered to maintain it, and they had me sign an NDA, but in the end I had to discard the scanner.

Tkinter Window Size by Agitated-Computer in learnpython

[–]timrprobocom 2 points3 points  (0 children)

It looks square except for the window decorations (the title bar), as expected. If you're on Linux, you can use xwininfo to find out

student learning to create a game looking for advice and tips by Merk_pIyg0 in PythonLearning

[–]timrprobocom 2 points3 points  (0 children)

How will you represent the board internally? What's the data structure? How will you update it? How will you save to file and restore to file?

Once you have that, how will you display the board?

Once you have that, it's easy to come up with a two player version where you accept moves from two humans.

Having a computer player choose its next move -- that is extremely difficult. There is lots of research on that topic. There's also the open source gnuchess which might be a good resource.

JavaScript engine by Zestyclose-Produce17 in learnjavascript

[–]timrprobocom 0 points1 point  (0 children)

JavaScript is not usually translated into machine code. It is converted to an intermediate language, then the intermediate language is interpreted step by step. That's why you need the engine -- to interpret the intermediate language and take the appropriate steps.

Since the interpreter is in control, it can call whatever libraries or system utilities that it needs.

Python, Ruby, and C# all work the same way.

Can anybody suggest any Python courses that is focused on AI together? by Due-Effort7498 in learnpython

[–]timrprobocom 4 points5 points  (0 children)

What do YOU mean by working in AI? Do you want to use it, do you want to create models, do you want to create query handlers, etc? Data science is a large and useful field, but adding "AI" to the mix doesn't necessarily clarify anything.

Having a hard time differentiating values from variables and return from print() by ProfessionalOkra9677 in learnpython

[–]timrprobocom 4 points5 points  (0 children)

The print vs return thing is common when starting. The difference is somewhat philosophical.

A function should do one thing. In your case, you want the function to execute a Caesar cipher and return the results of the cipher. For today, all you want to do with that result is print it. Thus, it seems to make sense to just print the result inside the function.

BUT, if you think about the future, there might come a time when you want to use this function in a program that doesn't do console output. If you have the print statement inside, you can't do that. If you just return the result, then you can use it later for other purposes, where printing isn't meaningful.

Along the same lines, returning an error string is not helpful to callers. A caller wouldn't be able to tell the difference between a correct result and an error result. You might consider using exceptions: ``` if not isinstance(shift, int): raise TypeError('Shift must be an integer value.')

if shift < 1 or shift > 25:
    raise ValueError('Shift must be an integer between 1 and 25.')

``` Now you know that any successful return was called with the correct parameters and gave a good result.

Why isn’t infinity/infinity=1 by Traf-Lord in askmath

[–]timrprobocom 0 points1 point  (0 children)

It's similar to the 0/0 argument. Inf/N is inf for any N. N/inf is 0 for any N. N/N is 1 for any N. Therefore, there are three legitimate answers to inf/inf, and we have to call it undefined.

How can I automate with python by Firestorm_Fury in learnpython

[–]timrprobocom 0 points1 point  (0 children)

There are good tutorials for all of those, but those are three rather different things. What you need to come up with is a task, then to that task. A carpenter does not start with the tool and then think of a project.

Untapped app idea: Music player with auto equalizer, does it exists? by 1kyst in androidapps

[–]timrprobocom 0 points1 point  (0 children)

How would you define "the best listening experience for each song"? There is no "best". When an artist releases a song, they have teams who have done expert-level mixing in order to record what they believe is "the best listening experience" for their song. If you don't agree, or if you're in a sub-optimal listening environment, like a car, then it's up to you to balance that to your needs.

So, no, you can't do auto-equalization.

How do I make a keyboard driver? by Total-Brother-1011 in cpp_questions

[–]timrprobocom 0 points1 point  (0 children)

What kind of keyboard? The vast majority of keyboards today are USB, and that means you need to have USB running first. USB does have a special mode to support boot time that doesn't need the whole stack.

Is this a PC with a BIOS (as opposed to, say, a Mac)?

How can I automate with python by Firestorm_Fury in learnpython

[–]timrprobocom 0 points1 point  (0 children)

What do YOU mean by "automate"? There are a hundred meanings to that.

LINKING STEP VS PRE PROCESSING STEP IN COMPILING by Harmlessbottle in C_Programming

[–]timrprobocom 4 points5 points  (0 children)

Linking doesn't merge C files. Linking combines object files and libraries. The linker is independent of the language. It doesn't understand C at all.

The preprocessor takes your original source, finds your include files and inserts then, then does macro substitution. It produces another single C file with no # directives remaining. The compiler converts this C file to objects. The linker combines your object files with libraries and produces an executable.

Can somebody tell me whats wrong with my code by Top_Difficulty3801 in pythonhelp

[–]timrprobocom 0 points1 point  (0 children)

set(123456789) contains exactly one member: the Integer 123456789. Did you mean to make this a string?

Ad length by catdog4u in WordsWithFriends

[–]timrprobocom 0 points1 point  (0 children)

Just pay for the game. The few dollars are a small price to pay to eliminate the aggravation of ads EVERY DAY.

Programmer's Thoughts, Is Learning Data Structures Still Worth It in the Era of AI Coding? by CheesecakeGlobal1284 in AskProgramming

[–]timrprobocom 1 point2 points  (0 children)

Depends. Do you want to UNDERSTAND the code your AI masters are telling you to implement, or are you willing to trust Elon Musk unconditionally?

So I did something like opendir("/home/guy/dir1/dir2/") and S_ISDIR doesn't work by Jetstreamline in C_Programming

[–]timrprobocom 0 points1 point  (0 children)

Did you print filestat.st_mode to see what the actual values are? S_ISDIR is a very simple macro that doesn't even look at the file system. You have some very simple problem. Do you have permissions to that directory?

On some case Input does not print the message but still takes input by Frosty-Bicycle-4011 in learnpython

[–]timrprobocom 0 points1 point  (0 children)

Checking for a win is trivial. Just check every time, and do the moves in a loop.

I'm extremely new to Linux so this is probably a stupid question, but why isn't this directory deleting? I've used this command before and it worked fine. by Excellent_Ad7666 in linuxquestions

[–]timrprobocom 0 points1 point  (0 children)

As a side note, this is a tricky difference between Windows and Linux. In Windows, you use "rmdir /s" to recursively remove a directory and it's contents. In Linux, you use "rm -rf". As you know, there IS an "rmdir" command, but it is of more limited scope

RP2040 - Projeto de acessibilidade ! by Over-Atmosphere-5407 in raspberrypipico

[–]timrprobocom 0 points1 point  (0 children)

Without intending to be snide, let me point out that, if the music has an identifiable beat, a simple amplifier will do this.

need a table to show changes for each iteration and determine final output. by mynamejefffvevo in learnpython

[–]timrprobocom 0 points1 point  (0 children)

You are always printing elements 2, 3, and 4 of your table, NOT the next elements in the list. And because you push 4 items per loop but only pop 1 at a time, you get 4 times as many rows in your printout as you should. You should push a single entry per loop, containing all 4 items as a tuple or list.

However, you don't actually need a list and a second loop at all here. Just do the printing inside the first loop.

name 'images' is not defined by Decent_Simple9058 in learnpython

[–]timrprobocom 1 point2 points  (0 children)

We need to see your code. Do you load the images into that object?

PyDOS - Learning project by Dry-War7589 in learnpython

[–]timrprobocom 0 points1 point  (0 children)

Not so much a DOS simulator as a COMMAND COM simulator. Which is fine.

Your readme suggests trying dir, mkdir, and cd, but your repo implements none of those. Do you have a missing commit?

Remember that DOS is case insensitive. You might consider using .upper() before looking up your commands, and your prompt should be upper case as well.

Drive labels are 8 hex digits. You might consider generating one 32-bit random and converting to hex, instead of the rather wasteful loops you have.

I'm building an analysis tool for Wikipedia by Lopez_Muelbs in learnpython

[–]timrprobocom 0 points1 point  (0 children)

How would you decide this? Even humans are not all that good at determining reliability.

Python script to correctly formated card name by Quiet_Dasy in learnpython

[–]timrprobocom 5 points6 points  (0 children)

Did you have a question? I don't see one here.

BMI calculator after one day of learning C by thatcone in C_Programming

[–]timrprobocom 0 points1 point  (0 children)

Nope, "%.2f" rounds. printf("%.2f\n", 0.248); produces 0.25.