/dpt/ - Daily Programming Thread

Old thread is auto-saging: Can somebody help me debug my regex to validate URLs? It isn't working on some of the new TLDs

Other urls found in this thread:

amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504
godbolt.org/g/OsZ549
wikiwand.com/en/Pragma_once#/Portability
gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC8
twitter.com/NSFWRedditVideo

You have been visited by the the elusive programmer (male)!

A deep and abiding understanding of void * pointers and triple indirection will come to you, but only if you post "Thanks Chihiro!" in this ITT!

there is nothing confusing about n-indirection

what are you, a web developer?

Dpt is dead. F"P" autists and pajeets killed this thead

Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!

>/dpt/
>Dead programming thread

what's that regex supposed to match?

zalgo desu

im updating my resume. do you think i can get 6 figures off this?

Stop.

>mfw I get who this is referencing and I don't like it

You'll only get 75% of that 6 figures because that's all you deserve

>Took 6 years to complete master's degree
>Took 1 year to complete PhD
Yeah, I don't believe this at all.

reptilianking still looking for mindslaves to make computers work.
must desire: open source operating system that can be configured to optimal personal settings by even the most dense simpleton.
link in the place where nothing should be.

dead as d hours

can you nigs point me in the direction of good resources for beginning C? I have a lot of free time this summer, want to pick up programming as a hobby, starting with C. Don't really know what I'm doing.

installing gentoo never hurts

K&R, that's all you need

K&r the c lang, then "modern c"

What about online resources? Not that I have a problem buying books, I'd just rather have my material right now. And isn't that book outdated? I just looked it up and its from 1978, has C changed since then?

Yes it became C++ and C#

Ofc, some things chaneged, but those are very easy to learn afterwards, just read some articles about what's new in c11. K&r is a very good book, with good exercises. Also there are pdfs of it everywhere online, you don't have to buy it.

I heard that this is pretty good also, but I never read it
amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504

A Cyclical Redundancy Check function for Distributed Network Protocol version 3.0

godbolt.org/g/OsZ549

>buying book
>not torrenting them
the last edition of the K&R is perfectly fine, don't fall for the muh modern language meme, you WILL need this knowledge, unless you want to work as a code artisan in a meme startup for a month before it fails

C is already outdated and you are recommending a book which doesn't even use modern C.

He won't even get the first example to compile, lel.

I wish /prog/ was still around.

>C is already outdated

You know how I can tell this is a bot or a homo?

No typos and always needs to cum.

>Outdated
>Book
Your right, books are outdated.

It's not a meme, you underaged faggot. You want to be well versed in both ANSI C and modern C.

How ready is wasm?

It's ready, but there's nothing to do with it.

>there's nothing to do with it
What do you mean?

You can't even access the DOM from it, it's useless for now. Well, unless you want to make 3D games or shit like this.

DOM sucks. wasm webgl GUI library when?

Hopefully never.

Why isn't this working? I'm new to header files.

Error codes are pic related


class cpp
#include "MyClass.h"
#include "stdafx.h"
#include
#include
#include

using namespace std;

MyClass::MyClass(string name, string message)
{
ofstream outFile;
outFile.open("Book.txt");

outFile

>pragma once
nigger wut?
>WITH HEADER GUARDS
wtf are you doing lil faggot?

PO > header guards

pragma once is absolute trash and non-standard/portable

You didn't include the line numbers for those errors, so I'm only guessing.
main.cpp #includes "MyClass.h" before , so the declaration of the constructor has no idea what an std::string is at that point.
You have to treat #include as a literal copy/paste of that file.

Also fuck off with using namespace std, you're defeating the entire purpose of namespaces.

>and non-standard/portable
maybe a decade ago.

I'll need a source with that

#pragma once is supported on every compiler that actual people will actually use, it can also speed up compile times of large codebases as the compiler can deduce its meaning, unlike header guards.

i use pragma once in all my projects without any problem.

wikiwand.com/en/Pragma_once#/Portability

Maybe first look things up instead of spouting shit?

gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC8

>gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC8
>gcc-2.95.3
>nearly 2 decades old
nigga you fo real?

What do you mean with the using namespace std. ive been using it all semester and the teacher hasn't corrected me.

I planning to store sha512 hashes in postgres, should I put unique constraint in there?

>What do you mean with the using namespace std. ive been using it all semester and the teacher hasn't corrected me.

fuck I hate CS teachers and people going into CS who can't fucking look shit up and do things by themselves unless it's fucking homework
you are literally a cancer on the industry

why that shit looks dope

We already have HTML+CSS for this shit, there is no reason to create yet another UI model

>using namespace std in a HEADER FILE
Don't do that.

Ask why you would want that to be an error case.
Hash collision is an intended case that happens and something you have to handle. Does a unique constraint magically handle that?

Your teacher is subhuman filth and should learn to code.
It is subjectively bad to pollute namespace. What do you think this is, C?

Yes there is, CSS is dong tier

I posted here yesterday about thinking of a sepples library/framework for quickly prototyping scientific stuff(including a small ui toolkit). Part of it could be something like wolfram's cdf, without the browser plugins.

query by hash should return 1 (correct) result, so something like LIMIT 1 would not work. Generating some god forsaken guid looks like a bad idea

I don't know about your use case, but that sounds like a wrong assumption.
Pigeonhole principle guarantees there is no hashing algorithm to avoid collision. You have to handle the case of a query returning multiple results and further refine the search - you've already filtered out 99.9999% of your data so it's no longer a performance concern. What else can discriminate unique items?

What did the botnet mean by this?

Its a known fact only the most shitty codemonkeys dedicate themselves to academia because the only thing they can pull off is teaching half wrong concepts to clueless individuals

>when your 200 line program takes more than a day to debug

Do you guys program on a monitor standing vertically?

Seems to me the toolkit portion of your program needs to be a larger proportion.

>not writing your own toolkit to hello world
shiggy diggy

s-sometimes

welp, you might just be right I was being a lazy fuck

How do you uncreate an object in java?

laziness is the essence of programming. "can't i just make this thing do X for me -_-" is how algorithms are born

>-_-
get the fuck out, underaged shit

delete or wait for it to go out of scope

wrong

What's the best way to start learning how to code? I've heard it takes years too.

Question: does any language other than python have easily defined generators? I.e. defined like a function using the yield keyword. No verbose class definitions.

Someone help me come up with a project idea that will meet all the requirements of pic related including the extra credit.

Using OOP is considered poor form.

loli simulator

Of course not. P*thon is the pinnacle of human thought.

posting anime is considered poor form

inventory manager for a record store

No. Horizontal monitors even though our style guide limits to 80 character lines.

Your kind is not welcome here.

Okay I'm this guy. I was working on a guest book program. How can I implement the extra credit things into it? I already have the file input/output one. Need the rest.

@60479943
Why the fuck are you even here? If you're going to act like a fucking redditor, go to fucking reddit.

Not programming.
Fuck off to

kys
no one wants to download your 50mb java applet

>kys
Fuck off to >java
I don't use subhuman languages.

And you didn't even deny that you were one of their kind, as I expected.

>ask about wasm in the first place
>and you didn't even deny that you were one of their kind, as I expected.
hmmm
hmmmmmmmm

Only web""""dev"""" trash would be interested in anything related to web""""dev"""".
You can fuck off now, go join your brethren

CSS is Turing complete

You seem to be a little insecure there, buddy

Turing completeness has nothing to do with being web"""dev""" or not. I don't know how retarded one would have to be to even suggest this.
Imagine having a life so dull and pointless that you're reduced to this. If this is your reason to live, it sucks to be you.

No need to be upset. We are your friends. :)

@60480264
Primitive animals can't be friends with humans since they lack the mental capacity for friendship. So no, you and your animalistic kind aren't my friends.

Yes, yes, (you) are very smart

@60480296
You have witnessed the truth.

chihiro didnt deserve to die ;_;

So why were Lisp's fexps replaced with current "macro" systems? They were perfect. They were simple, they were powerful, it was like adding custom code to the most fundamental function: eval.

You used to be able to evaluate anything any way you wanted using the exact same mechanism that powers things like function application. Now we have pattern-based shit like syntax-case.

>mongolese cartoons memeing dolt
why am I not surprised

@60480371
>mongolese cartoons
>memeing
You just confirmed my suspicion that you along with most of this thread are straight from reddit.