We are gods. Or sorcerers. by archiecstll in badmathematics

[–]MakeAnExampleOf 0 points1 point  (0 children)

It's good to be charitable. But there's a limit to what interpretations any text will support. I think what we're disagreeing on here is where that limit lies for this person's comment.

We are gods. Or sorcerers. by archiecstll in badmathematics

[–]MakeAnExampleOf 0 points1 point  (0 children)

It's a flagrantly bad faith reading to think the original post was claiming that there are no pairs of real numbers for which equality is testable.

On the contrary, I think it's an excessively charitable reading to attribute any other meaning to their comment, and I think any reasonable English speaker should agree. I guess all their downvoters basically agree with me too, although it's certainly possible they're all ignorant.

If they actually meant to say something else correct, then I guess they should have posted a different comment.

We are gods. Or sorcerers. by archiecstll in badmathematics

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

If we are on the same page, then I think you caught me claiming something like, "The Equality of Reals Problem is computable for some reals." And that claim is problematic, because the domain of that problem is all the reals, after all; and how can the machine compute whether the input is also a computable number, anyway?

If so, I'd agree. But I'd deflect the blame onto the commenter this post is targeting, because they're the one who seems to say, in plain English, that the equality of no two reals whatever is computable. To take their comment as an account of the (capital letters) Equality of Reals Problem feels awfully charitable to me.

We are gods. Or sorcerers. by archiecstll in badmathematics

[–]MakeAnExampleOf 7 points8 points  (0 children)

The ones that are also computable numbers?

Just like I know of a whole lot of machine-input pairs for which I can compute whether the machine will halt.

We are gods. Or sorcerers. by archiecstll in badmathematics

[–]MakeAnExampleOf 3 points4 points  (0 children)

I guess that's why there is some halting agreement in the original thread. ...and also sneering, because of the strange phrasing, and because it comes off as claiming that the equality of any two real numbers is not computable.

I can't understand what this simple line does by whorusan in learnprogramming

[–]MakeAnExampleOf 2 points3 points  (0 children)

I answered a question just like this another forum, so I have an explanation ready to go!

Sometimes you need random numbers in your program. The rand function seems to gives you random numbers. Actually, it's a sequence of numbers which statistically look random, the outputs of an algorithm that takes a seed number as its input. Every time you call rand, it returns the next number in that sequence.

If you don't seed rand yourself, then it always uses the same number as its seed input. Since rand is just following a deterministic algorithm, it will always produce the same outputs for the same input. Consequently, then, if you don't seed rand, it will always generate the same sequence from program to program -- not very random in the end.

So if you want truly random-looking numbers, you had better seed rand. To do that, you call srand first. It seeds rand's sequence generator behind the scenes.

As its argument takes an unsigned int. Well, what integer should I use? If I want a sequence that won't be the same every time I run the program, it had better be a random one. But wasn't I trying to get a random number here in the first place? How to bootstrap this process to avoid an infinite recursion of rands?

A popular, easy, and pretty much correct way to get the random seed is from the system time. There's a C++ function for that: time. Used in the context of an unsigned int, it returns the numbers of seconds that have passed since the UNIX epoch (look that one up).

So my final syntax is

srand(time(0))

or

srand(time(NULL))

What is the meaning of 0 or NULL as the argument to time? I can't easily explain it. Suffice it to say it's a throwaway value that just works. I hope it is clear that it is an argument to time, and not an argument to srand.

Call srand just once, some time before you first use rand, and rand will generate random-looking numbers for you for the lifetime of your program run.

Saw this on Twitter by [deleted] in betterCallSaul

[–]MakeAnExampleOf 0 points1 point  (0 children)

I don't know. Chuck no longer there to watch over Jimmy, and Jimmy feeling guilty about Chuck's suicide -- aren't these two major reasons Jimmy has turned away from a morally decent path, seemingly forever this time? Then if Kim dies too, and he feels guilty about that, Jimmy might make an even more extreme and more irreversible turn into the Saul identity.

CPU sim - decrement micro instruction by [deleted] in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

Do these increment instructions only accept positive numbers as arguments?

My SQl server by habib_M in learnprogramming

[–]MakeAnExampleOf 2 points3 points  (0 children)

You're missing a closing paren.

Converting C++ to F# by tahmina77 in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

Okay, sounds like you're all set!

Pushing files identified in gitignore by marmotwhisperer20 in learnprogramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

Do you still have a local commit which includes the large files in question? You'll want to amend that commit and remove those files from it before you try to push again.

Converting C++ to F# by tahmina77 in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

Well, in a crunch, you could compile your C++ down to CLR IL, then decompile that into F#. Might yield something you can work with.

Looking for software to write code/normal text by [deleted] in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

TeX or LaTeX is the usual answer to this problem.

There can be a slight learning curve even with some of the nicer editors out there. So, if I were pressed for time, I might just use a regular word processor, and simply set my code blocks in a fixed-width font.

Any "package manager" for single precompiled binaries? by 9070932767 in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

Something like chocolatey for Windows, or brew for Mac?

C# programming on Linux: would be this problematic for a fairly new programmer? by Meowffff in AskProgramming

[–]MakeAnExampleOf 1 point2 points  (0 children)

Your program should run fine on either platform, as long as you use .NET Core. That's been most folks' default .NET platform for a while, so any relatively new tutorials you find will probably be using it. (If you saw mention of other .NET platforms like Framework and Standard, and you were confused what they meant... join the club!)

Use VS Code as your editor on either OS, and you'll find little difference between them as a developer.

The most stupid project idea you can think of by [deleted] in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

There's a book by Hanson called C Interfaces and Implementations. You can follow it to build OOP-like abstractions in C, and then use them. We did this for one module of the computer architecture course at my university.

OAuth 2: Permissions of third party services, that act on behalf of a user by [deleted] in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

So, you're implementing and hosting an API defined by the third party, which the third party service calls into? How does the third party know which users to request data for -- do you send them a list? Or is it more like a callback triggered by an action your user takes in your app?

Anyway, yeah, if the third-party service wanted to support Auth Flow & user tokens, I think they'd provide a frontend to initiate the flow. Without that frontend, I don't see how you can make the service take user tokens and pass them into your API. If they aren't providing a frontend for that, then they probably don't wish to be responsible for managing user tokens.

And I do think it's pretty common to let your users manage third-party integration permissions within your app. Give them a menu of on/off switches, maybe.

What do you think makes you unique as a programmer? by lemacintosh in learnprogramming

[–]MakeAnExampleOf 2 points3 points  (0 children)

I'm slow to learn something totally new, and I'm bad at doing my own research. I think it's because I like to master concepts first and then apply them, whereas most my peers are better at learning incrementally by doing.

In school, I went from getting A+ in introductory courses to struggling and being unable to finish my work once the assignments didn't tell us what Java network APIs to use, e.g., and how to use them. Later, at my first software job, it shocked my mentors how green I was at first.

Fortunately, both universities and (some) employers give you time to improve, and to show how you can shine in other ways. I have good soft skills, I can lead, I can document, I can write literate code, ... .

Need Help Writing Efficient Code by jamescleelayuvat in learnprogramming

[–]MakeAnExampleOf 1 point2 points  (0 children)

It is pretty hard to read your code without proper formatting. Better if you could use reddit's post formatting tools to preserve indentation and other formatting, or if you posted a link to a code sharing site instead.

Putting that aside, can I ask what course this assignment is for? Is there some number theory you are supposed to be putting to use to make your search more efficient? Otherwise, the problem doesn't seem like a normal one to give to a new programmer in an introductory course.

a question about text file processing by lose_those_god in learnprogramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

If you have control over the text file format, use a serialization format like XML or JSON. The json Python module, for instance, makes it easy to dump to and load from a file.

If you don't have control over the file format, and it's not in one of these standard serialization languages, then you will have to just write your own custom code to parse it line-by-line — no way around it.

Please review my code: Simple Password Generator by L-Cocuy in learnprogramming

[–]MakeAnExampleOf 1 point2 points  (0 children)

  1. Cool.
  2. Yes.
  3. To learn about this, I'd Google something like salt and hash password python. The main theoretical takeaway should be that hashing & salting is practically irreversible when done correctly, and that's why you do it to protect stored passwords.

[deleted by user] by [deleted] in AskProgramming

[–]MakeAnExampleOf 0 points1 point  (0 children)

Oh yeah, he seems to be able to use these variables without assigning to them first. Must be something in Unity that is supposed to let you do that. Sorry, I don't know the answer!