/dpt/ Daily Programming Thread

This is /dpt/, the best subreddit of Sup Forums

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

/!\ ** Read this before asking questions ** /!\

mattgemmell.com/what-have-you-tried/
catb.org/~esr/faqs/smart-questions.html


What are you working on?

tfw no gf

Bussy making a program that copies over files from one folder to another one, and if the file already exists checks if its newer or not, if it is it replaces it, if not, it doesnt copy that file for when I copy over shit from my one hard drive to another..

lol loser

top kek. big o is about __growing__ complexity.

o(2*n) and o(n) have the same growing. from there, saying o(2*n) vs o(n) doesn't make any sense.

(define (growq m n)
(quotient (- (* m (+ n 2))
(* m (+ n 1)))
(- (* m (+ n 1))
(* m n))))

(define irand (curry random 9999999))

(displayln (= (growq 1 (irand)) ;; O(1 * n)
(growq 2 (irand)))) ;; O(2 * n)

;; o(rand() * n) = o(rand() * n)
(displayln (if (for/first ([i 10000]
#:unless (= (growq (irand) (irand))
(growq (irand) (irand))))
#t)
"FAIL"
"PASS"))

Trying to whip the makeshift TUI code in my scheme program into something respectable.

I'm looking to make a chatbot for Kike, Line, Twitch, etc. What should I do? Can I get paid to make chatbots for Twitch streamers?

kik*

Of course a racketeer is autistic about abuse of notation. Do integrals with infinities trigger you too? Because that's just as much of an abuse of notation as O(2n).

Can I ask why it's called "big O" rather than theta?

No link to the old thread, OP?

Not him, but I can tell you what triggers me: when fucktards who don't understand a certain notation attempt to use it anyway to appear more "educated" and gain some credibility. This inevitably backfires, and instead of crawling back to the putrid hole they came from, they start telling you how it's "obvious" what they "really" meant, so actually you're the asshole for calling them out.

theta is a different thing
big O is an upper bound
theta is an exact bound

you mad that i proved in code that o(x*n) = o(y*n) where {(x, y) ∈ Z^+}

What about when fucktards who barely understand a notation attempt to correct others to appear more "educated" and gain some credibility? Seems to happen a lot.

>What about when fucktards who barely understand a notation attempt to correct others to appear more "educated" and gain some credibility?
Here's the thing: you don't know if the people correcting you "barely" understand it, or completely understand it, but everyone now knows for certain that you are a fucktard who doesn't understand it at all. And for the record, I wasn't the one correcting you. Couldn't care less about you discrediting yourself.

Doing the cryptopals challenge in Clojure.

Wish I had some goddam unsigned numeric types ffs

To expand: measures of growth are basically about how at a certain point, for a certain size of data, the coefficients of a function matter less and less, and that there is some coefficient where o(c * g(n)) is bigger than the function f(n) being studied, regardless of what coefficients are inside g(n).

Example:

32x^2 + 1000 is greater than 64x^2 only when x < ~6, and after than 64x^2 "dominates" 32x^2, so the upper bound of f(x) is x^2 or, we say that 32x^2 + 1000 is a member of the set O(x^2) (or more simply, 32x^2 + 1000 is O(x^2)

I'm glad that you can do something everyone studied in cs1001 intro to java. What's next user are you going to prove that mergesort is O(nlogn)? But you didn't tell me whether improper integrals written with infinities in the bounds trigger you.

last 2 digits is number of pushups

what you've pointed out here is a tautology. the set of o(x * n) is equal to the set of o(y * n). There's no point in even discussing it.

ok i'm ready

>you
I'm not that guy, friendo.
Is there a better phrase for comparing constant factors that you would suggest?

post programming socks

Kys nigger, you're the kind of faggot I bullied in school.

>If the function fails with ERROR_BAD_LENGTH, retry the function until it succeeds.

>The size of the structure, in bytes. Before calling the Thread32First function, set this member to sizeof(THREADENTRY32). If you do not initialize dwSize, Thread32First fails.

Is Linux programming as bad as Win32 programming?

>posting in /dpt/
>pretends he was cool enough to bully people in hs

I'll bet you were a brony, faggot

>what you've pointed out here is a tautology
Reminder that anything true in mathematics is a tautology.

>subreddit of
>r/programming
>r/compsci
>r/ReverseEngineering
>r/softwaredevelopment
Reddit is down that way my good sir.
You must be lost.

>Is there a better phrase for comparing constant factors that you would suggest?
Yeah: "it takes twice as long". I know this doesn't sound as fancy as O(n*2), but at least it makes you not sound retarded.

@64768975
sure you did, kiddo

>nothing is true in mathematics

>not knowing what a tautology is
I guess that goes along with O(n*2)

What thread-walking function ever returns ERROR_BAD_LENGTH?

which axioms do you choose to accept? ZFC?

Between the guy claiming design patterns are data structures and the one asking for O(2N) or O(N), i have the sensation that the /dpt/ founded by Sup Forums computer scientists is long gone. Normies destroy everything.

>not understand what i just said
>ZFC!
You just can't stop pseuding, can you? Regardless of which axioms you accept, any true statement in a consistent mathematics is a tautology, because it's simply follows from the definitions.

is (P v ¬P) a tautology?

Do you have a degree in mathematics? Then why are you talking?

>/smart-questions.html
so smart

>is (P v ¬P) a tautology?
Yes, in the most direct sense: this statement is true because the axioms of classical logic say so.

java has >>> for unsigned carry which is everything you need. clojure should have it too.

>hurrrr do you have a degree tho
No, but you don't need a degree in computer science to understand such fucking basics. It either follows from the definition (and is, thus, a tautology) or it's invalid.

in other words it's not a tautology unless you assume the axioms of classical logic

Good morning boyos

These are 100% bully-proof manly socks. Notice the corporate environment approved brown and tan.

Sent my CV out to a ton of part time book keeping jobs while I study. I'm assuming this shit will be easy as hell to automate

>it's not a tautology unless you assume the axioms of classical logic
(P v ¬P) is not true unless you accept (P v ¬P) axiomatically, in which case (P v ¬P) follows from (P v ¬P) by definition, so it's still a tautology. It's not true in intuitionistic logic, for example. You people are unbelievable brainlets.

With win32/64 programming you spend a lot of time dealing with using wrappers and macros around types because compatibility. Check out what TCHAR does for a simpler example of the reasoning. The documentation in general is annoying to read and figure out.
With linux programming the documentation is great, but that's in part because instead of standardized abstract wrappers you make use of ifdef and ifndef a lot: you set up your makefiles to run a few quick scripts that insert defines depending on the architecture or if certain libraries exist.
Linux Kernel programming is worse than win programming though, imo. At least with win once you learn the wrappers it's easier to understand the code. Kernel stays forever confusing.

>book keeping
>easy to automate
I wish I was this innocent still.

>No
Then how you dare lecturing us?

no look
it's a tautology WITHIN classical logic
what about OUTSIDE of classical logic?

I already did it for my Pop's business and I was a total beginner back then.
Depends what their book keeping comes down to but I imagine I could nigger-rig what I wrote for him for their shit

>what about OUTSIDE of classical logic?
Outside classical logic, it's simply not valid, you fucking retard.

Can you help me out Sup Forums.

I'm a total newbie when it comes to programming and I have to do something in my project that needs a function I assume.

I need to go through a couple of binary variables and figure out which one is set to 1 (there's only one of them) and then do something according to that, is there a way to go through the variables without doing them one at a time (if var1 = 1 then, if var2 = 1..)

If I remember correctly from the little JS I did, you generally go through an array with a loop but can it be done if they're not in an array?

>reddit spacing
Get the fuck out.
Rust

lol if you can't figure this out you're too dumb for this work

I don't even know what O(N) is supposed to mean.

One search latter it turns out to be no mind blowing secret like everything about computer science.

What kind of projects are good to pad a resume out with before I finish my CS degree with nothing to show for it? I have nothing so far. I made a mobile game that has a few hundred K downloads but I'm not proud of it.

I had an idea for a (desktop) video player to help with language learning but it's way out of scope of what I know (i.e. nothing to do with graphics/media). I need something simpler.

could be done in o(n) or o(2n)

I'm not a programmer.

I have no idea what reddit spacing is.

>I had an idea for a (desktop) video player to help with language learning but it's way out of scope of what I know (i.e. nothing to do with graphics/media). I need something simpler.

You could look into making an add on for an existing video player.

>what about OUTSIDE of classical logic?
You mean in, say, intuitionistic logic like mentioned?

Anything is relation with databases is well received.

My friend is making a chat application that sends over TCP in C++, and I'm currently porting it over to Linux because he decided to use winsock for it.

It's okay user. I've found that there are very few people who understand that all communication is semantic. Apples are only apples because we decided they're apples. What are they if not apples, they might ask? What is 2 if not 2? The answer is that they are what they are. Teaching, learning, and debate cannot happen properly unless both parties first agree that the abstract representations and descriptions they're using mean what they both agree they mean. In the case of standards, disagreeing with the standard is fine, but asserting those who agree with them are wrong only because you disagree is only the inane shouting of ignorance.

Fuck off to reddit and find out Poojeet

f(n) ε O(g(n)) =
∃ n0 . ∃ c . ∀ n ≥ n0 . f(n) ≤ c⋅g(n)

>can it be done if they're not in an array?
Unless you have some higher-level structure, you can't find a value in a collection of things without just searching through them one by one. Loops make that easier, and so do arrays (and they're made for each other) but if you've not got an array or list or something, you're just going to have to look at them all (or until you find it, of course; it'd be silly to look after that).

>pseuding intensifies
Sure thing, user. I guess "tautology" in the context of mathematics means whatever you want it to mean, rather than what it is defined to mean, and my pointing out that someone doesn't understand what a fucking tautology is only shows my utter ignorance. I think I have a better fit for your advanced post-modernist thought, though:

>The answer is that they are what they are.
If words don't have to have normal conventional meanings, we can change what they mean every word. That'd be FURGLEFARGLE FURGLEFARGLE FURGLEFARGLE FURGLEFARGLE FURGLEFARGLE FURGLEFARGLE

>>You could look into making an add on for an existing video player.
I'm not sure what video player would have addon functionality for what I need. I basically I'd want to add interactivity to subtitles.

One alternative I thought of was making some kind of application that placed a transparent overlay showing subtitles on top of a video player, but syncing would be a problem.

why didn't you say from the start that all mathematics is tautology ... within classical logic?

ah thanks, so I should just put them in an array and go through it with a for loop?

You've got your head so far up your ass you don't even realize you just argued against a statement that was, and person who was, agreeing with you.

>If words don't have to have normal conventional meanings
Try continuing to read the post your responding to.

also n0 ≥ 0, c > 0

>@64768975
Newfag

>why didn't you say from the start that all mathematics is tautology ... within classical logic?
It doesn't matter whether you base it on classical logic or not. There's constructive mathematics, based on intuitionistic logic, under which some results from standard mathematics aren't valid. Every valid result in intuitionistic logic is still, by definition, a tautology. Just read a fucking book, nigger.

>It doesn't matter whether you base it on classical logic or not.
but you said earlier something like "if you don't assume the axioms classical logic then it might not be valid"

>Retards yousing o(n) and O(n) interchangeably ITT
Jesus Christ

Like if you think real and numerical analysis should be standard courses in all CS curricula.

>You've got your head so far up your ass you don't even realize you just argued against a statement that was, and person who was, agreeing with you.
You're right. I misread it this part:
>in the case of standards, disagreeing with the standard is fine, but asserting those who agree with them are wrong only because you disagree is only the inane shouting of ignorance.
My bad. An easy mistake to make when you start off with what sounds like a preparation to say that no one is actually "wrong" because everyone just has their own definitions.

I didn't

>but syncing would be a problem.

You could use an add-on to interface between your overlay and the player.
I guess I just mean you really don't have to build the world from the ground up to do what you need to do

did you know that there is a freeware version of IDA7 now?

I can only conclude at this point that you're failing to understand my posts. Here's what I originally said:
>Regardless of which axioms you accept, any true statement in a consistent mathematics is a tautology, because it's simply follows from the definitions.
In classical mathematics, which is based on classical logic, (P v ¬P) follows from itself. In constructive mathematics, (P v ¬P) isn't valid. What do you not understand?

>if you don't assume the axioms classical logic then it might not be valid
In non-classical logic there can be statements that are tautologies but not logically valid. "tautology" does not mean "valid". Classical logic has the property that all propositional-logic propositions are valid if and only of they are tautologies, but that is not the case for all logics.

>in classical mathematics
did you say that originally?

>that is not the case for all logics
I'm only familiar with classical and intuitionistic logic, and I'm pretty sure all valid statements are tautologies in both of them. Under what system of logic can you have valid statements that can be false?

>he still doesn't understand what i said
It's pointless. You're a brainlet. What mathematics were you talking about where what I said isn't true? Name it.

HoTT

>I'm only familiar with classical and intuitionistic logic, and I'm pretty sure all valid statements are tautologies in both of them.
Indeed. But in intuitionist logics, there are tautologies that are not valid.

>Under what system of logic can you have valid statements that can be false?
None that I know of. But the reverse is often true: there can be tautologies that are not valid. (Note that I said "if and only if" in ).

I forgive you. When arguing against people who present illogical statements as retorts I pay less attention and make mistakes too. It's frustrating trying to explain to someone that they aren't right when they're too stupid to understand why they're aren't right.

I won't pretend to know anything about that, but who exactly are you trying to fool now? Anyone can go read your post to see what the context was: You were not talking about any mathematics based on HoTT there.

i was talking about even the "tautologies" in mathematics have assumptions (e.g. zfc, classical logic)

>None that I know of. But the reverse is often true: there can be tautologies that are not valid.
Well, that doesn't refute my original statement about valid statements in mathematics being tautologies, then (but I guess you weren't trying to). Can you give an example of what you're talking about, though?

To understand Tautology, you need to understand tautology

>even the "tautologies" in mathematics have assumptions
The statement that an axiom is true is a tautology as well within the system that the axiom applies to, or it isn't valid. What do you not understand?

classical logic
-----------------
P v ¬P

...

>Well, that doesn't refute my original statement about valid statements in mathematics being tautologies,
Yeah, sorry, I didn't try making sense of the whole history of this argument; that seemed like a lost cause.

>Can you give an example of what you're talking about, though?
Just the obvious: in intuitionist logic, (P v ¬P) is not valid (that is to say, provable; there are nitpicks to be had about terminology here, but let's not derail the discussion any further), but it's still a tautology.