/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1557970062062.png (900x900, 306K)

Other urls found in this thread:

en.wikipedia.org/wiki/Amdahl's_law
lmgtfy.com/?q=how do i make a file picker for libgdx
stackoverflow.com/questions/19479877/jfilechooser-in-libgdx/19534947
github.com/libgdx/libgdx/wiki/Scene2d.ui
github.com/kotcrab/vis-ui/blob/master/ui/src/main/java/com/kotcrab/vis/ui/widget/file/FileChooser.java
github.com/kotcrab/vis-ui/wiki/File-chooser
twitter.com/AnonBabble

Writing a minimalist suckless-compliant C++ compiler in Scheme.

Attached: 1556844316904.gif (136x193, 144K)

Still learning C from K&R.

C++ is literally the antitheses of "suckless".

Still learning WebGL. Even though my main objective is to make a porn VN, I need some idea for something smaller, easier to make so I can solidify my skills.

But the compiler itself will be suckless and even cat-v-compliant.

laugh at people who pretend they know C/C++, basically 80% of Jow Forums.

>C/C++
What does this syntax mean?

>C/C++
Lets all laugh at the retards who group two completely different languages together like this instead.

Attached: 1557009502348.jpg (228x208, 38K)

lets laugh at NEETs who think these are two completely different languages have no relation whatsoever

I know both of these languages intimately.

>C/C++
>What does this syntax mean?

DING DING DING! RETARD ALLERT!!!

Hey, user! I'm about to read about JavaScript. Want to join me?

Attached: 4845a58b590d5e5727fdf975af632f08.jpg (800x1200, 123K)

Sure. Always wanted to learn a Lisp.

What is the difference between some codebootcamper who has only written shit into one txt file and a competent programmer

Attached: 6661c7e6.jpg (736x595, 78K)

>suckless compliant
>Scheme
what

How is Scheme not suckless-compliant?

they're grouped by how shit they are, which they both equally are

working on getting a programming job
excellent taste in 2hus

abstractions are bloat

I am looking for a partner to start a lean company that scales. You must be 30+ or older. If you like micro service architecture, you'll like developing with me. Your preferred programming language doesn't matter, as long as it meets the requirements. Let's make some money and have fun.

Suckless seems to disagree.

Sure, I specialise in failed start-ups.
You can email me at moot@Jow Forums.org.

>looking for a partner
>You must be 30+ or older.
Are you cute though?

Attached: 1557234114727.gif (504x508, 405K)

Anyone who knows the first thing about idiomatic C or idiotic C++ knows that they have diverged massively and basically nothing to do with each other.
"C/C++" is a great pleb/retard filter to instantly write a person off as having no fucking idea what they're talking about.

>they have diverged massively and basically nothing to do with each other
Except for C

what the fuck are you trying to proof here? everyone knows they are not the same yet they can work together. everyone who learns C eventually learns C++ as well. so fuck off, you can write C programms, you can write C++ programms and you can write C/C++ programs. Oh and hey, C++ uses all these keywords from C.

>everyone who learns C eventually learns C++ as well
Wrong.

>wrote algorithm
>covers most of the cases
>submit to leetcode
>wrong answer, error
>input "a"
>your output ""
>expected output "a"

the most confusing string combination works, but a simple "a" doesn't, it's for the longest palindromic substring problem, using a matrix

but hey, I'm making progress

Attached: kog.jpg (191x264, 9K)

>everyone who learns C eventually learns C++ as well
Definitely not true. I know many C programmers, including myself, who severely dislike C++.

>EVENTUALLY

Any shoop wizard here who can shoop this on that book like those sicp ones?

Attached: cover-homepage.jpg (620x877, 53K)

Wrong. I explicitly avoid learning any sepples.

Why are some of them creepy while this one is so cute?

I did not, and will not learn C++.
I really, really fucking hate it.

What do you think procedures are?

Me on the left

People fear what they do not understand.

No, I understand C far too well to ever like something which defiles it so much.

>I explicitly avoid learning ______
>I did not, and will not learn ______

I hope you wrote that in your job applications along with other shit you don't like because Jow Forums told you so

My CV includes a list of things I will never agree to. I put it under the section where I demand not to be harassed for certain lifestyle choices, so it goes over well with most employers.

I put C on my CV, and didn't put C++ on my CV.
I'm already employed as a C programmer.

>put it on your CV
>instantly become employed
is this how it works?

Is there some way to find out my programs time complexity automatically? like some library or idk without having to think it out myself

Attached: 1555703124885.png (1300x1300, 224K)

I did get this job after putting out literally 1 job application.

probably in his imagination

not for an arbitrary program, but for a very restricted subset of programs it's possible. a simple example is if A .. Z are independent programs (i.e. they don't mutate the same memory for instance) and you can figure out their time complexity, then the time complexity for A; ...; Z is the sum of the time complexities A .. Z

That sounds like you're going up against some halting-problem levels of shit.

If this doesn't immediately sound undecidable to you, then you're a mere codemonkey, not a programmer.

bloat

haven't you watch the talk

>haven't you watch the talk
What talk? Link?

just count the number of nested fors lmao

What language lacks bloat?

oh right cause if its too shit it will never end and therefore take forever to answer the time complexity question

That honestly works most of the time. You only really get caught up when the amount of times you're looping is affected by something else.

japanese

Honorifics are bloat.

*writes a recursive call*
nothing personnel

Attached: 1539460962844.png (620x876, 727K)

en.wikipedia.org/wiki/Amdahl's_law

I need a method that obtains image urls from html strings. Which approach would you use to solve this?

Attached: 1524638878651.png (1300x2000, 307K)

>her compiler doesn't convert aribtrary recursive calls to tail-calls

Attached: 1557508027174.jpg (850x819, 243K)

parse the html?

Parsing html is in general undecidable.

but that doesn't change the amount of for loops in your code

Attached: 1532750051544.png (706x412, 278K)

You're waifu is undecidable

Every tail-call generates only one for-loop.

>generates
so you can't figure out the time complexity of your program by counting for loops nesting in your code

>That honestly works most of the time.
Nobody was arguing that you could.

Programming in C++ is like fucking a really cute anime girl, except every word she speaks is prefixed with "std" including her moans, and there's the text "template " floating above her head.
No matter what you do, she seems to always get into really weird positions and if you try to "fix" it she'll throw long somewhat unintelligible and seemingly irrelevant complaints at you. Eventually you give up trying to correct them and just learn to love it, and it turns you on even more now.
The more you're with her the more crazy and amazing positions you discover and things that she'll allow you to do that you never even knew about before, and you just keep going back to her again and again each time going deeper and deeper in both respects of the word until every inch and crevice of her zero-overhead body are filled and covered with your increasingly heavily templated std-ridden code.
Despite all her strange quirks, funny idioms and obvious shortcomings, you've grown to love and adore her, and you _thoroughly_ enjoy using her every night.
Although currently you can stick your peepee in literally any hole you like, in 2020 she'll only allow you to stick it in certain holes that don't fuck shit up.
Her breasts are zero-overhead.

Attached: 1541574015422.jpg (1404x1920, 612K)

You missed the part where you contract a terminal disease, and get arrested for public indecency.

Trying to get back into the flow after a long vacation. I am aiming to get a job at one of the good tech companies after years of having my own small company.
All my friends are working at some company now, because they said working from home made them depressed, they want to socialize and wear suits and shit like that. I don't want to hire random people right now and I hope a few years at a good company will improve my skills, so that I can start a new company and make it bigger this time.

>1945 + 50 + 50 characters to write your language in
>and somehow this is "not bloat"???

d-don't stop

yes

Is 9P useful outside of Plan9? IPC via networked directory structures seems like a good idea but I'm wondering if it makes more sense to just mimick it and use my own transports, etc.

Japanese is the only language I can appreciate.

Attached: 1557888341073.jpg (590x827, 139K)

What do I call a function which checks whether two lists contain the same elements (but potentially in a different order)?

is_permutation or something like that.

how do I make a file picker for libgdx?

Attached: 1520380041734.png (650x773, 47K)

lmgtfy.com/?q=how do i make a file picker for libgdx

google is useless because shitty documentation.

Writing a job-shop scheduling software that combines constraint propagation and branch and bound in rust.

Anyone knows some good directed/undirected graph library in C?

One of the first results is:
stackoverflow.com/questions/19479877/jfilechooser-in-libgdx/19534947
Which links to:
github.com/libgdx/libgdx/wiki/Scene2d.ui
Which seems to be what you want.

>what is google
github.com/kotcrab/vis-ui/blob/master/ui/src/main/java/com/kotcrab/vis/ui/widget/file/FileChooser.java

I mean, not the file picker, but a subwindow I can drag and opens when I clicke the load file button.

Isn't that what a file picker is?

I got a .txt file input. The first line contains 2 numbers say n and p. The other lines are pairs of some persons IDs which belong to the same group. n in the first line is the total number of persons and p is the number of lines that follow the first line of the .txt file.
One person can not be part of more than one group. I have to find how many pairs of persons I can make with the condition that they're not part of the same group.
What's the most efficient way to do this time complexity wise? Use graphs or something?

Pic related is a simple example

Attached: 2019-05-16 16_51_27-.png (580x411, 37K)

github.com/kotcrab/vis-ui/wiki/File-chooser

I'm not sure if I should just make my file picker a separate scene and just use it to load my file, store the path under the config of my app and then load the path under the other scenes.

something with connected components maybe? it's been a while

What is your programming process user?

Attached: 1_XUGkruWLruIiUoT5PB60Ww.jpg (1600x900, 298K)

am i under arrest?

You don't need to use graphs at all. Just separate the students into their clubs and then count combinations. In the example, you have (5 2) - (3 2) - (2 2) = 10 - 3 - 1 = 6 pairs.

My guess is it's a graph colouring problem. A node can have no colour, or it can be either colour A or colour B. If node v1 is connected to node v2, i.e. they're in the same club, than the colour of v1 must be the same as the one of v2. If either node is uncoloured, it must then be coloured in the same way as the related (connected) partner node.

Something might be in this book. It's been a while. (Cormen, Rivest, Leiserson)

Attached: 41SX4Z1E9RL._SX258_BO1,204,203,200_.jpg (260x306, 14K)

libgdx own documentation gives deprecated warnings and compiler errors.

Attached: Captura de pantalla de 2019-05-16 10-20-01.png (2424x900, 324K)

>kotcrab/vis-ui
I don't think that's LibGDX's documentation.

third party library libgdx uses to make GUI

I want to make the dumbest and simplest functional language possible. I’m thinking of making everything just functions and enhanced pattern matching with conditionals. The only problem is if I do that I can’t use Haskell syntax and have to include commas.
function a > 0, b = do stuff
function a, b = do other stuff

Is there a better way to do this without using guard syntax or if else?

what if you just made | a pattern thing so you could have like Just (x | x > 5)

function (a > 0) b = do stuff?

Those are pretty good ideas. Thanks guys.

based and cawfeepilled