/dpt/ - Daily Programming Thread;

What are you working on?;
Previous: ;

Attached: _96030.jpg (1920x1080, 367K)

Other urls found in this thread:

openpsychometrics.org/tests/IPIP-BFFM/
dailyprog.org/chat/
github.com/jaredpalmer/react-parcel-example.
shenlanguage.org/lambdassociates/htdocs/blog/bipolar.htm.
pastebin.com/ynVLPuYG
cplusplus.com/reference/cstdio/printf/
youtube.com/watch?v=xeYfK9NQyoo
youtube.com/watch?v=C-T4VVZrmkA
twitter.com/AnonBabble

Have you expressed your love to Lain today, Jow Forums?

What pill can I take to stop having delerious dreams about whatever code I wrote last night plus waking in a cold sweat with some reason why everything I wrote was wrong

Attached: s3174.jpg (540x960, 54K)

it's called gittin gud, fag

I love lain
Let's all love lain

Attached: 1522417915797.jpg (557x800, 193K)

Why is it impossible to set up a basic hello world-tier application with react? It took me two seconds to google how to do this for Vue...

Literally all I want is routing and reactive state management. But then everything on google tells me to install a bunch of unrelated BS which only serves to complicate the environment. What the fuck is a create-react-app and why does it add a bunch of black magic scripts? Why is it impossible to weave together all these app containers and providers and routes like I'm casting some kind of arcane spell?

And why the fuck did no one think to write a decent fucking tutorial for this retarded mess?

/rant

Attached: dailyprog-teletext-blink.gif (640x480, 30K)

If it were as easy as it should be, it wouldn't be a meme technology that boosts your employability.

Damn, I get this too. Both for 3d modeling and programming. Whenever I'd work for long amounts of time, I get dreams where I'd apply something and fail, without any clear reason. And this recurs until I wake up tired.

Sadly I am already employed, which is why I'm trying to learn react instead of just using vue.

...

Take the test at openpsychometrics.org/tests/IPIP-BFFM/ and post your neuroticism score. Regardless of that, I can recommend the programming experience pill. Once you've been forced to ship enough fucked code and proven yourself able to unfuck it later, the anxiety subsides. Not programming right before bed helps you avoid programming dreams.
This Lain is a little too sexualized.

> dailyprog.org/chat/

Attached: logo-dpt-jmanfatty.png (497x200, 8K)

create-react-app is boilerplate that comes with web pack, babel, react router, and some other stuff I can't remember right now. If you're learning react I'd use it for now until you're ready to dig into setting up the environment. The create-react-app documentation should be pretty easy to follow to get started.

It is this way because Webpack and the ecosystem around it are an autotools-tier convoluted mess. Parcel is rather less painful. Look at github.com/jaredpalmer/react-parcel-example.

Of course. Today is the 20th anniversary of SEL's first airing. Gonna rewatch Lain tonight.

I want to make stuff with C but I'm really not all that interested in embedded systems and there's only so much you can do by making dynamic arrays and search algorithms.

Should I just start learning C++ if I want to get into stuff like desktop applications or gamedev?

Attached: 1529358034076.jpg (743x729, 154K)

The problem comes when I then have to weave in redux, react-redux, react-router, react-router-dom, react-dom... basically react-.* and I have no idea how anything fits together. It's all just a black box. I've tried a few times but always wound up with some compilation error in a 3rd party library due to some missing dependency or whatever.

Sure I could just use pure react for the view layer, but part of the allure is supposed to be that it's a very powerful framework that has everything you need for the frontend. If I can't get at least the same level of power/convenience out of it as a much simpler vue/vuex/vue-router setup there's no point.

>Should I just start learning C++ if I want to get into stuff like desktop applications or gamedev?
Yes, C++ with Qt Or C#.

>C
>desktop applications
Integrate your C code with Tcl/Tk. tcl.h will give you battle-tested implementations of data structures like real strings and dictionaries.

Yeah I figured, plus I have some experience with C#. I've been meaning to play with SDL2 as well.
I've never heard of Tcl/Tk but it looks pretty neat. I'll look into it. Thanks!

can someone give me a quick primer on SOAP and SAML? need to integrate our express backend with an older system at work and going from REST to SOAP is a bit confusing -- especially with this whole SAML gimmick

Why are you going backwards in time? Do you need to integrate with AD or something?

C++ is pure trash. It's completely unethical to tell people it even exists.

i actually integrated with AD a few weeks ago and that was surprisingly easy with a handy node module.

we need to integrate with some government services and their system's are using SOAP

If you want to do game dev (graphcis programming) the proper way, C++ is your only real choice. If you're going to learn C++, you might as well learn Qt as well so that you can make non-shit cross-platform applications. Stop being so dogmatic, you probably haven't even used the language for more than a month.

Good job falling for the retarded memes.

Lain is a slut.

>follow the herd you stupid goy

>he thinks he can make his game with monads

Thank you friend, I started with The C++ Programming Language at first, but they immediately started with things like without any explaining to what that is, so I thought the book was really just a reference.
Ill continue with it then, it was probably just an example.

seriously though what are decent alternatives to C++ when it comes to video games?

If you do not want to do low level graphics programming, just use Unity or Godot or Gamemaker or some other engine. If you want to do graphics programming, you man up and use C++.

If only this had redux and router I'd be golden.

so...?
>use c++
>lol meme
>what else then?
>engine or c++

It's almost as if there are multiple people with multiple opinions here.

what do you mean? it's just me and the anonymous guy

It's pretty sad though. C++ is a garbage language but there are still uses it seems.
Could you dographics programming in rust? I guess you could, is anyone doing it?

look at piston or whatever it's called

>Should I just start learning C++ if I want to get into stuff like desktop applications or gamedev?
if you're serious about gamedev you're gonna want to learn C++ sooner or later. nothing wrong with learning the principles in other languages, but if you stick with it, as your projects/requirements increase in scale/complexity, you'll eventually find yourself gravitating towards C++

C# (.NET Core or .NET Framework, not Mono) with OpenTK (very efficient managed bindings for OpenGL and OpenAL) is by far the best (and most viable for large-ish-scale) non-C++ gamedev solution i've seen

you can do graphics programming in most languages (practically all of them have OpenGL bindings). it's just that most of them don't perform well enough overall to be viable for large-scale/AAA applications

Pretty cool, but I was thinking about something that would compete with like.. Unreal Engine.

>you can do graphics programming in most languages (practically all of them have OpenGL bindings). it's just that most of them don't perform well enough overall to be viable for large-scale/AAA applications
That's what I'm wondering - is Rust viable for large scale AAA applications? I can't think of a reason it wouldn't, but then again I also don't know anything about graphics programming.

AFAIK there aren't a lot of graphics libraries for Rust yet.

The number of fundamental problems with C++ is just overwhelming. It has so much potential but it's all pissed away on poor design choices (e.g. putting shit on the heap that doesn't need to go on the heap, lack of a good native exception handling system, no proper support for unicode, excessive verbosity everywhere)

Attached: tumblr_p5ssfnGqBZ1vp4m0do1_500.jpg (500x694, 57K)

>I can't think of a reason it wouldn't, but then again I also don't know anything about graphics programming.
assuming a straightforward binding of OpenGL's API, the graphics programming aspect would be much the same as in any other language. the primary factor as far as viability is the language itself. Rust falls short of C++ somewhat in terms of performance, but not as much as most other languages. so "large-ish" scale is certainly possible, at the very least. it may not be at the bleeding edge, but considering the honestly rather abysmal standard of technical quality in much of the AAA lately, i'm sure a well-written game in Rust or even C# could manage to technically parallel or exceed much of the current market

>AFAIK there aren't a lot of graphics libraries for Rust yet.
surely there's a simple binding for OpenGL, at least?

>putting shit on the heap that doesn't need to go on the heap
what do you mean by this?

Who on /dpt/ has the most green dots on their GitHub thing?

Attached: 2018-07-06--1530916115_783x228_scrot.png (783x665, 331K)

Attached: snapshot12.png (742x193, 12K)

>mfw have no clue how to contribute to open source

Attached: woonigga.jpg (630x603, 18K)

those green dots don't mean anything. they're relative to your max amount of commits in a single day

Find some niche, I found one and have some idea for something to program/something to fix pretty much every day. Maybe try and automate something you do at work, or something related to a hobby of yours?

I don't have a good distribution of green dots because I'm pretty much shenlanguage.org/lambdassociates/htdocs/blog/bipolar.htm.

>using github in 2018

Attached: tumblr_p9klbsarSu1usc9y9o5_400.gif (350x185, 721K)

I need a way to rewrite this so MOSS won't detect it as cheating. I can't remember anything about fucking do/while loops. Can someone convert this to a regular switch or if/else statement? I'm too much of a brainlet to learn this myself.

char progcont = NULL;
string pcode;
do {
system("payroll");
cout > setw(0) >> pcode;

switch (check(pcode)) {
case 1: manager(); break;
case 2: Hourly(); break;
case 3: commission(); break;
case 4: piecework(); break;
case 5: menu(); break;
case 6: cout

lol so glad I'm not you

What's something I can build that I will come out of a better programmer and looks good to show to possible employers?

I know a CRUD app is the standard but if you've seen one you've seen them all.

Attached: 1530811044624.jpg (640x495, 52K)

Oh shit really?
I just watched it for the first time a couple months ago

Do-While loops execute code before evaluating the while condition. Having other people do your work will make you continue to be a brainlet, I hope you know that. The sooner you take responsibility for your actions (or in this case, inaction from not bothering to learn it), the sooner you'll not be a brainlet. Take 30 minutes to understand it, I'm sure it'll be worth it.

Resident sepples shill here, on Monday I start a job where they're still "trying" to move to C++11.
Hold me, Jow Forums.

Attached: tupple.png (1021x148, 41K)

It won't be worth it though. Due to my University's retarded degree plan setup, I have to take a programming class. But the career I want has zero coding involved in it, so this assignment is literally the only code I ever have to write.

just clean up your code

Attached: jordan_petrson_nczas[1].jpg (886x600, 39K)

>It won't be worth it though.
Take some damn responsibility for yourself. Are you 12?

My program is dropping the values of all the variables after the while() loop and so it's crashing.
I really have no idea of what's going on here, please help.
pastebin.com/ynVLPuYG

Attached: 1303876752913.jpg (681x468, 167K)

it's pretty simple. The loop runs once, then it checks if it should run again. In other words,

this:

do {
something = is.happening;
} while(check.if == should_continue);


is the same as:

something = is.happening;
while(check.if == should_continue) {
something = is.happening;
}


I hope that makes sense

Also, don't plagiarize code. That's a shitty thing to do

Attached: 1525303734036.jpg (740x1200, 92K)

cplusplus.com/reference/cstdio/printf/
>subsequences beginning with %
>beginning with %
>d%

On the topic of solving 3D bin packing

What have you tried?

Attached: 3DpinPacking-463x341.jpg (463x341, 19K)

I don't think it's your values. Remember that to printf integer values, you must use "%d", not "d%".

This is the problem. Every online guide is structured like this, which tells me that it's understandable to SOMEONE. But not me. Fuck man, I just want to do Biochemistry research, but I'm being forced into a subject I have no desire or ability to learn.

>That's the thing about writing quality code. If you don't clean it up well that's no good. And if you're thinking, "oh, well that's someone else's problem", then you're bloody wrong bucko. That's something to really think about. Jonathon Blow once said that it's important to not get lost in the optimization, so you can think to yourself "okay, I can optimize my code later", or you can bloody do something about it now.

Attached: yaboi.png (750x410, 264K)

So normal while loops verify/check a condition (such as "is this value true"), then run the loop WHILE that condition is true. So, it'll continue to run until that condition is not true. Do-While loops run the loop once, before verifying ANYTHING. Then, if the condition in the while is true, it continues to loop until the condition is not true.

Ok I understood that to an extent. But how would conditions be changed?

FUCK JAVA and all the MEDIOCRE DEVELOPERS it enables. I'm so tired of being told I have to make my code accessible to somebody who isn't interested in learning anything beyond their Java degree.

>I just want to do Biochemistry research, but I'm being forced into a subject I have no desire or ability to learn.
Biochem research is heavily reliant on programming. What did you think you were going to be doing, mixing test tubes full of brightly coloured water?

Just lean the subject material. It's not even hard.

Attached: (JPEG Image, 1300 × 903 pixels).jpg (1300x903, 193K)

I'm already in a lab. The Biomedical Engineers and CSfags do all the programming shit. I just run the tests and the programs to get results. It may be dependent on programming, but it sure as shit isn't dependent on me doing the programming.

Okay thank you, I'll commit sudoku once this thing is done.

Attached: 1451584708061.jpg (847x868, 144K)

Think about displaying a menu to user and asking for input, then if input is not valid you repeat
So you print text like
>select 1 for carbons, 2 for proteins, 3 for fats or 0 to go fuck yourself
then you take input
then if input is not 1, 2, 3 or 0 you repeat the above

So that's basically do-while - you show the menu and wait for input before checking if there is valid input.

To do that with while you'd must first set input to invalid value.

The condition changes based on the code that you write. If your while is structured like "while(isOneHundredYet < 100)", and the loop increments the isOneHundredYet variable each time it loops (using isOneHundredYet++). If isOneHundredYet is initialized to 0, then the while loop would loop until isOneHundredYet is 100 (not less than 100).

doesn't this have a dynamic programming solution?

You have made it.
I am looking forward to playing your submission to DD21.

Attached: make something.jpg (1934x2103, 263K)

sorry drunk wrong tab
youtube.com/watch?v=xeYfK9NQyoo

>dynamic programming meme strikes again
fucking hell, it's such a buzzword and it means literally nothing

That makes sense conceptually. But sitting and typing out a code that translates this concept is escaping me. I feel genuinely bad that you're wasting your time trying to teach me something that won't stick.

yes it was literally designed to be a buzzword to get DoD funding, but it's a real thing designed for these kinds of problems

Quit your job
Make video games

Attached: realdollconference.jpg (1600x1067, 617K)

>solve smaller bits of the problem
>combine those solutions to solve the full size problem
you don't need a whole cottage industry around this shit

i don't have to quit my job to make games

Nice shovelware

Terraria
Undertale
Minecraft
FTL
Stardew Valley

It didn't have to be like this

Attached: your choices.png (600x804, 832K)

Undertale is the best RPG of this decade.

You could have made a game

Why didn't you follow your dreams
Quit your job
Make video games

Attached: download.png (216x213, 3K)

the key is to also memoize the smaller solutions
I'm just saying it's a good fit for the problem, I didn't invent the term

rent and food aren't free

Does my example make sense?

It's a difficult thing to get used to, I know, but it's a different way of thinking. First, try to think in terms of what the computer is actually doing when it runs your code:

You know how computers do stuff, right? Generally speaking, the processor receives individual steps as "instructions," which are very basic messages that tell the processor what to do (for example, an instruction could say "multiply this number by this other number"). The computer executes one instruction at a time, in chronological order.

Some instructions can tell the computer to go forward a few steps, or back a few steps. These are called "branch" instructions. These instructions are what allows if, for, while, do/while, etc.

In pic related, each black box is an instruction.
The black arrows show the way the computer would normally execute the instructions: one at a time, in order, from start to finish.
The colored arrows show where "branch" instructions tell the computer to skip forwards or backwards based on a condition.

Attached: while vs do while.png (919x972, 47K)

>I don't believe in myself

I'm a 35 year old boomer so you're going to sit there and read me ranting user. Let me tell you about Lisp, now that was a real programming language, not like the so-called programming languages kids use these days like Python and JS

You've got 3, maybe 4 anons here trying to help you here. Please just keep trying and make a concerted effort to understand (not memorize) this stuff. For anything you don't understand, there are thousands of resources out there to help you. Have some confidence, you'll get it, this isn't difficult.

already in the process.
but i got side-tracked and now learning vulkan

I should mention that this is a huge generalization and that modern computers are a lot smarter than what my shitty drawing may imply. A modern computer can look ahead at instructions that it will be told to execute soon. If it finds a branch instruction, it will actually use its extra cores to run both directions that the branch can take, before the branch is even supposed to be run. That way, it already knows what the result of both ends of the branch are, and it can skip right through to the next part of the code once it gets there.

This is "speculative execution," which you might have heard of because of the "Spectre" thing with Intel and friends. Speculative execution is enabled by something called "pipelining," which is the name for the thing that allows the computer to "look ahead"

Attached: -EDdDsLVA7oIc5bIz3BZr6y-pCSLULnsdehwQwRw3qc.png (640x627, 283K)

>good post
>anime image
why?

>his Jow Forums client shows images

it's just what I do, user

Agreed, I do that shit every day. My job is writing firmware, but I make it modular so that we can reuse bits and pieces for other projects in the future. Am I special for doing this? fuck no.

Attached: 1422546788638.jpg (680x400, 50K)

youtube.com/watch?v=C-T4VVZrmkA

Drop out of life
Make video games

Attached: winningways.jpg (381x499, 46K)

>Drop out of life
>Make video games
That's pretty tempting.