/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

github.com/golang/go/wiki/FromXToGo
tour.golang.org
golang-book.com
blog.plan99.net/modern-garbage-collection-911ef4f8bd8e
qr.ae/drvVS
qr.ae/drvm8
yager.io/programming/go.html
nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
java.dzone.com/news/i-don’t-much-get-go
dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/
lessonsoffailure.com/software/google-go-not-getting-us-anywhere/
lessonsoffailure.com/software/googles-go-not-getting-us-anywhere-part-2/
lessonsoffailure.com/software/google-go-good-for-nothing/
gist.github.com/kachayev/21e7fe149bc5ae0bd878
benchmarksgame.alioth.debian.org/u64q/go.html
stackoverflow.com/questions/406081/why-should-i-avoid-multiple-inheritance-in-c
gist.github.com/Wunkolo/249646f7a922ee045c70
gcc.gnu.org/wiki/Better_Uninitialized_Warnings
en.wikipedia.org/wiki/C++20
docs.oracle.com/javase/tutorial/
twitter.com/SFWRedditVideos

first for C++17

why haven't you learned Go yet?
github.com/golang/go/wiki/FromXToGo

start here
tour.golang.org
golang-book.com

third for python

>using inheritance
>ever

Go is literally a dumbed down C for internal use at google.

also

NO GENERICS

>Not being a multiple inheritance pro

first for node.js

All shit languages are really just lisps in disguise

why don't i get warnings about uninit vars with this?
g++ foo -std=c++11 -Wall -pedantic -Wextra

Go is that thing the nyaa autists used to deliver something days after, right?

blog.plan99.net/modern-garbage-collection-911ef4f8bd8e
qr.ae/drvVS
qr.ae/drvm8
yager.io/programming/go.html
nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
java.dzone.com/news/i-don’t-much-get-go
dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/
lessonsoffailure.com/software/google-go-not-getting-us-anywhere/
lessonsoffailure.com/software/googles-go-not-getting-us-anywhere-part-2/
lessonsoffailure.com/software/google-go-good-for-nothing/
gist.github.com/kachayev/21e7fe149bc5ae0bd878

C++ clang++: 5.518077517 seconds time elapsed
C++ G++: 4.659448453 seconds time elapsed

Java OpenJDK: 1.189619693 seconds time elapsed

Crystal: 3.034363672 seconds time elapsed

Scheme Gambit: 1.932229635 seconds time elapsed

Go Go: 33.553163084 seconds time elapsed
Go gccgo: 17.438276362 seconds time elapsed

Haskell GHC: 0.454930841 seconds time elapsed

Javascript node.js: 10.406505448 seconds time elapsed
Javascript SpiderMonkey: 10.216595020 seconds time elapsed

just yesterday someone was sperging about java and go not having multiple inheritance. he thought it was NECESSARY to have multiple inheritance. fucking contrarian edgelords

with clang, -Weverything activates every flag possible in the system

example code?

>clang

int a,b = 1;

either you have multiple inheritance or you have a shitton of casts everywhere

are you doing anything with a?

i fondle it a bit

>what are interfaces

Any decent comp geometry books my lads?

>33.553163084
google.com/search?q="33.553163084"
>2015
discarded

>Java
benchmarksgame.alioth.debian.org/u64q/go.html

>gist.github.com/kachayev/21e7fe149bc5ae0bd878
doesn't even know what he's talking about

just keep posting retarded shit, kid
I remember you saying you were in 1st or 2nd year in college... with that attitude, you sure will do great

made an ascii raymarcher

crippled classes

t. Cshart blub programmer

goddamn

explain this

sicc
post code?

very nice

Java's the shitlang that abandoned your "no multiple inheritance of implementation" meme because it proved to be impractical, m8.

What are the new features?

Dang, nigga.

are embedded public keys bad practice?

stackoverflow.com/questions/406081/why-should-i-avoid-multiple-inheritance-in-c

what do you mean? do you know what a public key is?

this is old messy code from a year ago but
gist.github.com/Wunkolo/249646f7a922ee045c70

I re-wrote it using GLM and it's much faster.
just a little pet project to work on during boring classes

int a, b = 1;
printf("a %i, b %i\r\n", a, b);

i wouldn't really expect it to pick up on that

Fix deebot

never

hardcoding public keys into a client vs requesting them from a trusted third party

there is no problem. you can require the user to update their client if you change the key

why should i need to learn javafx8?

It's initialized, though.

What's the problem? It's obviously going to use the default value for int.

a was read, but it has never being wrote (before)
that's an uninitialized variable usage
the other user claimed that a good compiler with all warnings activated should point it
the other user claimed i'm kinda sure that valgrind would complain about it, dunno about the compiler (it should imho)

dont, write html apps instead

it's not exact. there are false positives and false negatives.

gcc.gnu.org/wiki/Better_Uninitialized_Warnings

only b has being initialized, and there isn't "default value for int" at all
actually now that you said it, since he didn't set any optimization flag, g++ would compile with -O0 which actually does zero fill your variables for you
using any other optimization flag, it won't tho
so you would read garbage on a

>there isn't "default value for int" at all

just because your baby language compiler zero fill your memory for you doesn't mean that zero is the "default value" of any memory at any given moment

Excuse me?

global and static vars do have default zero values thoug

I'm making a small software to design prestressed beams as a final project for class.
I'm using >python since it's easy and it works and I'm not even a real programmer.
I need something to make an interface though. Could even be something like a local page that runs on the browser. It's just something to let the user change the parameters of the design (some arbitrary numbers) on the fly instead of enter everything through command line.
What's the easiest way to do that?

Just finished up my first programming book, looking for a new beginner friendly Swift project to get some more experience. Was thinking about maybe expanding on the final project's idea (rock paper scissors game) and taking it to the next level, making it an RPG with HP, item shop, maybe even dungeons or something. Nothing serious, just for fun.

Emoji clown could be first boss or something idk

>Steve Yegge
who?

It's not that bad if your code isn't perfect, right? I mean even the best programs must have some ugly chunks here and there

You work in a business that requires a high performance application that need to display streaming information in a consistent and easy to digest UI.

>wasting an hour on a small obj parser because I'm fucking retarded but then I'm suddenly seeing all the mistakes and fix it within 5 minutes

looks dank

Kill yourself, you retarded frogposter.

You first, nigger. What are you programming?

>What are you programming?
I've been making some contributions to some open source projects. I have some PRs pending review.

>black hands

kys

Who C89 here?

No. Stop being stupid.
C99 at an absolute minimum.

pleb identified

this

Concepts still didn't make it, so nothing particularily noteworthy.

It did add more ways to initialize stuff though.

>It did add more ways to initialize stuff though.
It's not like C++ already has way too many ways to fucking do that.

C11 reporting in

Finished an exe that compiles my C/C++ files by drag 'n' drop.
It was supposed to only take me a few minutes but it instead took me all day.

#include
#include
#include

/*Simple all-purpose C/C++ command line compiler drag 'n' drop time saver thing*/

int main(int argc, char **argv){
if(strrchr(argv[1],'.')==NULL){
printf("\nUnrecognised file type.\n");
return 0;
}

char fileName[40], output[80];
strcpy(fileName, (strrchr(argv[1],'\\')==NULL ? argv[1] : strrchr(argv[1],'\\')+1));
char *fileExtension = strrchr(fileName,'.')+1;

*strrchr(fileName,'.') = '\0';

if(strcmp(fileExtension,"cpp")==0){
printf("\nCPP file detected.\n");
snprintf(output, sizeof output, "%s%s%s%s%s", "c++ \"", argv[1], "\" -o \"", fileName, "\"");
system(output);
}
else if(strcmp(fileExtension,"c")==0){
printf("\nC file detected.\n");
snprintf(output, sizeof output, "%s%s%s%s%s", "g++ \"", argv[1], "\" -o \"", fileName, "\"");
system(output);
}
else{
printf("\nUnrecognised file type.\n");
return 0;
}
}

Usually, I type everything in the CLI. This'll make compile less of a hassle.

>C/C++
Why are you grouping two completely different languages together?

...

>g++
Also, why the fuck are you calling a C++ compiler on C files?

>Not using makefiles with vim, and just typing :make to compile

>Completely

Completely

...

The C++20 standard looks pretty nice though:
en.wikipedia.org/wiki/C++20

it compiles both of them

He means entirely

Well, it now has more special syntax in case you want to initialize stuff inside an if or a switch statement!

The first person in this thread we can officially declare autistic (although i see a few before him who are majorly suspect)

Absolutely, but just because you said "lads", i will assume you asked around on Facebook or another equally abhorrent website and found One.

That's actually pretty nice user, you have my approval.

>G++ >.C >C/C++ files
No wonder it took you all day, you seem like the type of person who would need a helper just to turn on the computer.

I'm implementing my own variation of the XMPP protocol in a Client app i have to write, it's 1am and i haven't slept in 2 days and won't get any tonight. So decided to trigger a few fags who can't handle it, instead of doing my actual work. of course.

And he's wrong

Is Python worth it as a hobby?

no

Get your head out of your butt, you aren't triggering anyone here.

C and C++ are different languages. They are designed by different people and have different goals.
It's not helpful at all to think there is any relation between them.

Why

#include
#include
#include
#include
using namespace std;typedef float R;
#define _W 79
#define _H 39
#define EP 0.01f
#define OP operator
#define C const
#define E return
#define PQ M*(3.1415f/180)
union J{__m128 V;J(__m128 V):V(V){}J(R X,R Y,R Z):X(X),Y(Y),Z(Z){}struct{R X,Y,Z;};R L()C{E _mm_cvtss_f32(_mm_sqrt_ss(_mm_dp_ps(V,V,0x71)));}J N()C{E _mm_mul_ps(V,_mm_rsqrt_ps(_mm_dp_ps(V,V,0x7f)));}R D(C J& O)C{E _mm_cvtss_f32(_mm_dp_ps(V,O.V,0x71));}J A()C{E J{abs(X),abs(Y),abs(Z)};}J OP+(C J& O)C{E _mm_add_ps(V,O.V);}J OP-(C J& O)C{E _mm_sub_ps(V,O.V);}J OP*(C J& O)C{E _mm_mul_ps(V,O.V);}J OP/(C J& O)C{E _mm_div_ps(V,O.V);}J OP+(C R& O)C{E _mm_add_ps(V,_mm_set1_ps(O));}J OP-(C R& O)C{E _mm_sub_ps(V,_mm_set1_ps(O));}J OP*(C R& O)C{E J{_mm_mul_ps(V,_mm_set1_ps(O))};}};R BX(C J& P,J B){J D=P.A()-B;E min(max(D.X,max(D.Y, D.Z)),.0f)+J{max(D.X,.0f),max(D.Y,.0f),max(D.Z,0.0f)}.L();}R RB(C J& P,J B,R R){E BX(P,B)-R;}J RY(C J& P,R A){E J{P.Z*sin(A)+P.X*cos(A),P.Y,P.Z*cos(A)-P.X*sin(A),};}J RZ(C J& P,R A){E J{P.X*cos(A)-P.Y*sin(A),P.X*sin(A)+P.Y*cos(A),P.Z,};}static size_t M=0;R Q(C J& P){R D=P.Y+2;D=min(D,RB(RY(RZ(P,PQ),PQ),J{2,2,2},0.5f));E D;}J Nor(C J& P){E J{Q(P+J{EP,0,0})-Q(P-J{EP,0,0}),Q(P+J{0,EP,0})-Q(P-J{0,EP,0}),Q(P+J{0,0,EP})-Q(P-J{0,0,EP}),}.N();}R Y(C J& O,C J& D,bool* H){R T=0;for(size_t i=0;i

I could throw in java as well: I do that from the CLI too.

I have no idea. I have no idea on where the difference lies between the g++ and c++ compilers.
Also, I likely have an actual C compiler but I wouldn't know which one it is in the MinGW bin folder.

I wish I knew what you were talking about.
I think I had a look into makefiles once before but couldn't make heads nor tails of it.

Recommendations?

compressed.
this whole hobby-project of mines is novel as it is so I made a compact version that that renders a cube just for fun, inspired by that c code that generates an ascii mandelbrot

g++ is the C++ frontend to GCC. The C compiler is called gcc.

Personally i only use python for quick scripts or for integration in other code as a quick binding. It's a fun language to use nonetheless, although the indentation is annoying. Its packed with a lot of needless shit though, from what i can tell.

>Think there is any relation between them
>Literally called C++
Your delusional to think they aren't related, and vastly similar.

By that logic, C# is just as related to C as C++ is.

>benchmarksgame
fucking lol

java

docs.oracle.com/javase/tutorial/

>HURR DURR THEY BOTH HAVE C IN THEM
>HURR DURR JAVASCRIPT AND JAVA ARE SAME LANGUAGE

At least provide some concrete examples, don't just throw insults and claim they have some similarities and not give any.

>Insults
I never did that you colossal moron. Oops, I guess I did now. As for a concrete example, C++ started out as being called C with Classes.

Keep up the good work, user.