/dpt/ - Daily Programming thread

What are you working on, /dpt/?

Previously:

Attached: Vala.png (587x259, 10K)

Other urls found in this thread:

dipmat2.unisa.it/people/carrabs/www/pdf/2017_RainbowSpanningForest.pdf
blogs.gnome.org/despinosa/2017/02/14/vala-is-not-a-programming-language/
blogs.gnome.org/mcatanzaro/2017/02/19/on-problems-with-vala/
reddit.com/r/ProgrammingLanguages/comments/8k257l/what_do_you_think_about_perl6/
github.com/grimfang4/sdl-gpu
github.com/boppreh/keyboard
twitter.com/NSFWRedditVideo

eka

Someone explain to me how "Instructions are data" please

I thought binary was only for nouns for the longest time, not for verbs too

third for android dev is comfy

lol does anyone even use vala? i have heard nothing about it outside of wikipedia and elementaryos store.

i just recently stumbled across vala.
Is it really already deprecated?
I really like the approach

How do you think the instructions are stored

last stable release was 2 months ago.

Literally nobody outside of GNOME uses Vala.

stop teaching like it's 1980s
use libraries, use git, assume your readers can competently handle this, include an appendix to help with it if you must
proper use of a debugger is also something that somehow never gets taught but is vital. How do you analyze what you're doing? liter your code with print statements, change some slight thing and do it all again? Maybe in your first day of programming, but unacceptable after that except for very small spot checks.
>but that's not programming
yes it is

nice blog post

Attached: 1106514-cool_story_bro_super.jpg (600x599, 51K)

Some graph rainbow forest coverage problem
Found a recent article which might be useful
dipmat2.unisa.it/people/carrabs/www/pdf/2017_RainbowSpanningForest.pdf

Today I accidentally mixed up the names of mohammed and pajeet--did I fuck up Jow Forums? He looked super offended but I'm bad with names and it's not a race thing.

I thought instructions were executed, not stored

Who was in the wrong here?

Attached: 45.webm (1004x518, 792K)

>20 element datasets

>having autism

Hwo do I lrn C
Pls sir

Is there an easy way to cross-compile C++ programs for Windows on Linux?

>Is there an easy way to cross-compile C++ programs for Windows on Linux?

Attached: 19180.png (856x846, 85K)

Kys wofag

gnome uses the superior javascript tho

read a book and do the exercises.

>gets rekt
>b-but a-autismo

Wine and msvc

Well, you need to store them somewhere so you can read them later.

Instructions are stored as binary numbers called opcodes.

are lambdas, closures, and the like useful in average real-world procedural or object-oriented development? outside of trite examples like a functional callback to a sorting function or a filtering function or something.

>outside of trite examples like a sorting function or a filtering function
i'm sure higher order functions are extremely rare

Attached: DeyMpz2XUAEcUGf.jpg (645x729, 21K)

Yes. Java since version 8 is full of them, and that's about as OOP as it gets as far as modern definitions of OOP are concerned.

>showing sorting algorithms with millions of elements

kys retarded faggot

Learn Vala, it's easier and compiles to C.

>java
>oop by any definition
wut

Why can't I post the code in the image between the code tags? Every time I try to post it gives me an error saying that connection couldn't be established.

Also, is this the best way to write several instances of a struct to a binary file and read it back? I honestly just copied sample code from multiple sources and stitched them together. itjustwerks

Attached: 0.png (942x1216, 61K)

Happens sometimes when there's too much code, I think it sees it as harmful or something

Java is OO, though. Sure, not pure OOP but what relevant language is? Not even C++ or C# are pure OO.

>using namespace std
>windows.h
>system pause

For the love of fuck somebody please tell me theres a non-insane way to deal with sockets on windows in C++? All I need to do is read/send small JSON messages. I dont want to have to learn the inner workings of fucking winsock libraries or install some 800mb boost dependency framework.

>full of them
Theyre full of clojures but theyre hardly full of anything useful.
Have you fucking seen how function pointers work in Java? You may as well just not bother at that point

>Theyre full of clojures
wut
Java doesn't have proper closures

what are """proper""" closures?

closures

winsock is the best way on windows if you don't want to use boost afaik

how is this not a closure
Function adder(int x)
{
return y -> x + y;
}

It is limited as you can't modify x inside the lambda. It can't save a state like a proper closure.
IntFunction incrementer(Integer x){
return x -> x++;
}

blogs.gnome.org/despinosa/2017/02/14/vala-is-not-a-programming-language/
blogs.gnome.org/mcatanzaro/2017/02/19/on-problems-with-vala/

>blogs

>autism

>IntFunction

Attached: 1527724923419.jpg (500x367, 20K)

Ffffffffffucking shit why is this language so useless

What do you think of job postings that don't put the fucking salary on the job description?

Attached: 1528761884774s.jpg (250x187, 6K)

They're shit guaranteed

>we're looking for missionaries, not mercenaries
:)

They are a well known company in detecting fraud detection in banks through ML....

I mean, every other company posts the salary range, but they don't.

it should actually be IntUnaryOperator

Except to get nothing

they try to undercut you and offer a low pay job every. single. time.
Just call a high end salary and negotiate until you get what you want, they have usually high margin of negotiations but will try everything they can to pay you as less as possible

They are a big name company in the industry and sometimes i think it's better to get a job in a well known company even if the salary is shit.

Then we have companies looking for Web Developers than pay much more but no one knows the name of the company

Attached: 1528739942095s.jpg (250x186, 8K)

android studio is literal aids

either the emulator doesn't work, or you can't find whatever obscure as fuck thing you need to change in your settings

unless you mean react-native or phonegap, that's not that bad since you don't have to be locked into a cancer-tier IDE

>using the emulator
>not connection your smartphone directly
?

stfu no one asked your opinion

not easy, but iirc you can get the mingw toolchain and set up your own cross compiler

good luck though

even then it's a garbage piece of software.

I'm glad it's at least based off of intelliJ, but other than that it needs some serious fixes

>writing 2000's tutorial C++

>an that it needs some serious fixes
write them a bug report

this
as long as they're not obviously low-tier in their field, they're probably a good place to work and pay well, and are not exactly thirsty for whoever comes along first.
If you're the right fit, it won't hurt to ask a little higher than similar companies, but after they've brought it up in the interview. And not to get into a staring contest then and there, but more like "The salary I had in mind was ... but let's keep in contact" or something. But it really depends on what kind of bullshit the interviewer thinks of themself or thinks is indicative of a good hire.

I've noticed that maybe since people in IT/related fields bounce around so much, salary seems tied to what you used to make.

I was considering reading SCIP and got through all of the first chapter + its exercises but now I've heard it takes a year to complete..
Is that really true? Is it worth it if you're young and probably need to focus on money/learning useful skills first?

Attached: 1479883677181.jpg (832x696, 146K)

c...cute

Here's a very interesting discussion about Perl 6 regarding its capabilities and future, especially as a "100 year language" and what that means for its popularity/"obscurity".

reddit.com/r/ProgrammingLanguages/comments/8k257l/what_do_you_think_about_perl6/

Reminder that "Perl 6" is a completely different language from "Perl" (5)

Attached: p6-book-flowchart.png (1361x1123, 689K)

>Perl 6
Ruined everything that made Perl 5 good, it's just a shittier Python 2 at this point.

>here's a very interesting discussion
>Literal echobox snuffling out opposing thought
Try again

Let's hear your opposing thoughts then. You say it ruined everything that made Perl 5 good but didn't manage to actually list anything.

Type system.
Of ALL THINGS to fuck with, the type system? Perl was beautiful because you had three types of things: Scalars, Arrays, and Hashes, which were just Arrays. Anything, ANYTHING more complex than a Scalar was just an array under the hood.
You could do such magical things knowing this an leveraging it. You never had to worry about data types because if you wanted to treat something as a number, you used integer operators. If a string, you used string operators.
No worries. Only magic. CONSISTENT magic, unlike javascript where + might be for strings or ints, who knows.

Secondly, fucking with the Sigil system. The sigils made goddamn sense. @arr is an array reference, its an @. $arr means refering to a single value of the array, or the length of the array, both of which are scalars. Single values.
Now its a fucking mishmash or who the fuck knows. Somethings @ will refer to an element OF the array, sometimes it will refer TO the array.
Worthless.

The OOP change I don't really mind because that was (an admittedly clever) baked in hack after the fact in Perl, but this "Roles" system is convoluted and stupid. It's just a weird way of laying out inheritance.

Removal of required brackets in foreach or implied foreach loops is fucking bad, we're going full Python on that one where "LESS BRACKETS MEAN MORE CLEAR RIGHT LMAO!?@!?@!?" combined with the now unclear sigil meanings is just fucking bad.

It breaks all the thin lines of beautiful flexibility that made Perl Perl. It's just a worse Python now. Nothing that made Perl useful exists in Perl6.

less brackets
more doing
that's the power of Perl 6™

Less Brackets
Less Clarity
That's the power of a modern language designed by retards who have never, ever had to maintain other peoples code

fucking shit its the same logic as retards using node

can anyone give a good script to download all pngs, jpgs and webms while it's storing their urls in a txt file.

i currently have this anywhere i can improve?

Attached: Screenshot_2018-06-12_06-57-04.png (1280x800, 157K)

Illegal in my country so I dont see any of those

you're one of those people who learned python on Udemy™ aren't you

Attached: F007E23638_preview.png (640x640, 543K)

They're quite useful for sorting/parsing large datasets. take this kotlin example:

val out = someReallyBigDataset.filter{ (it > x) && (it !is y) || (someothershit) }.sortBy{ somegayshit.thatHasABunchOfThings }


That's a bitch to write in languages that don't support higher-order functions, but in kotlin it's one line.

>curly braces
>default lambda variable name
>val
disgusting

> using mutables in a language where you almost never have to declare a variable to begin with
> not using curly brackets for functions
> not finding the it idiom easy to read and immensely useful

Is there any build of SDL-GPU for windows?

github.com/grimfang4/sdl-gpu

I tried building it, but I ran into the issue of something called STBI not being found, and I couldn't find it with any google searches.

Does anyone know what font is being used in that screenshot?

>cant tell if 'out' is a stream or a collection
>removing the parentheses from function calls
>YOLO'ing syntax sugar
meme lang

> takes a year to complete
It was written as a sophomore textbook for a one semester MIT class. Expected workload for class and homework was about 10 hours per week.

Use your own judgement.

wget can recursively download links based on filename globs. That whole script should be one command to download everything then a couple commands to organize into different directories.

they're curly brackets because they're a higher-order function. Do you actually know what kotlin is?

Attached: 2A5B0E5B85_preview.png (640x640, 433K)

is filter not a function that takes a higher order function?

filter itself is a higher order function, the parameter is a regular first order function

fuck thats what i meant but the syntax is still garbage
in java it's
.filter(it -> it > x && someothershit).sorted(...)
or for multi statement lambdas it's
.filter(it -> {
return somecomplicatedshit;
})

it's definitely better if you actually want to format your code better because it doesnt look like you're trying to dereference something like an if statement and it keeps function syntax consistent

you can also write filter{ it -> it.somegayshit } and kotlin won't complain

A fucking FUNCTION CALL should be surrounded by PARENTHESES, PISSANT

but the curly brackets are retarded
this

This isn't the place to ask, but fuck it. I just want some other opinions.

I'm in my junior year of uni for computer science. I'm working a part time job in a warehouse 3 days a week. I make $18 an hour and get really good health insurance for free. It's a pretty decent part time job while in school.

My friend is offering to help me get a internship at his company as a software engineer. I'd much rather do that than work in a warehouse, which is why I'm in school. The only thing I'm afraid of is that if I quit my job and do the internship, after the internship is done, if they don't offer me a job I'll be fucked. The warehouse might not take me back if I quit and I'll be forced to go back to a shitty minimum wage job until I finish school. At the same time, I know I should probably do an internship before I graduate.

I'm probably overthinking this, but what do you guys think the right move is?

it makes sense once you start actually using the language. Things like forEach{}, forEachIndexed, apply{} etc. all are better examples. filter is one case where it looks a bit fucky

no i think you have stockholm syndrome

unless you want to work in that warehouse for the rest of your life, take the engineering job. When you graduate, employers don't want to just see a diploma, they want practical experience

take the internship

someshittylist.forEachIndexed( index, it ->
println("this looks autistic")
)

someshittylist.forEachIndexed{ index, it ->
println("this makes sense because it's a fucking function block you mongoloid")
}

is this what too much syntax sugar does to your brain

Would anyone know a good python3 package that can send windows keyboard input to an unfocused process? for example if I were to open notepad in the background and send 'hello world' or something.

github.com/boppreh/keyboard

I've tried this but I don't think it only sends winapi calls to the focused process, can't send anything unfocused, doesn't even work in some processes too.