/dpt/ - Daily Programming Thread

What are you working on, user?

Previous thread:

Other urls found in this thread:

youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU
wolframalpha.com/input/?i={sqrt(log 4), sqrt(log 3), sqrt(log 2)}&rawformassumption={"FunClash", "log"} -> {"Log10"}
twitter.com/SFWRedditVideos

fuck opengl

Heating up soldering iron to pop some lolis off my board.

Has anyone received their Hacktoberfest t-shirt yet?
It's been 4 months and they still have not sent mine yet.

Same. My C++ class at uni has us use Glut for our programs which is old as hell.

C#7 is the best language ever invented by man.

>Java++
>good

No that's Kotlin.

C# is Kotlin--.

Kotlin is even more of an overengineered piece of shit.

...

>shilling for a cyka language this bad

fun main(args : Array) {
if (args.size == 0) {
println("Please provide a name as a command-line argument")
return
}
println("Hello, ${args[0]}!")
}

I am in fact russian, funnily enough.
Also, most development in Russia is done with C++, so that's the one that I would call the cyкa language.

>I am in fact russian, funnily enough.
wow, i never would have guessed ivan.
Now please tell your team to stop shilling here, no one cares about it here.

>implying jetbrains now backed by gewgle have any neeeds to shill on fourchan

Coмин

sexual interface demand DDOS 2 all non-interesting programs or rammers of memory, or progged rammers.
//性接口的需求DDOS 2所有非有趣的節目或內存夯,夯或豬。
\\
性接口的需求DDOS 2所有非有趣的节目或内存夯,夯或猪。


cпpoc пoлoвoгo интepфeйca DDOS 2 вce нeинтepecныe пpoгpaммы или тpaмбoвкa пaмяти, или пpoтapaнили cвинeй.

Why do you fa/g/s keep believing that you're anything but brainlets? And then spaz out like Dawkins the moment anyone calls you out on it?

Because ducks should be professors at Universities if we are ever to truly learn how to meme without cr4ck.

shaders are currently like magic to me. i really ought to learn about them someday.

Why? Doom coder guy solved the problem ages ago.

what are you on about?

Kotlin has recently become one of the official languages for Android development. I assume that's what that user is referring to.

Scheme or cl?

Writing my own games in c++ sfml is being stupid?

Racket

I really, really, really like this image

Shaders are pretty cool. I've been making type-safe compile-time wrappers for most of the OpenGL shader configuration & execution calls, but I'm at the point where I should be able to start doing more interesting things than pic related.

Yes, use SDL. There's a great talk about it from Steam Dev Days by one of the lead developers.

TELL ME
HOW THE FUCK DO PEOPLE MAKE COMPUTERS IN MINECRAFT
it doesn't fucking make any sense to me!

Minecraft essentially gives you the same logical primitives in its redstone system that computers use. You have signals that can be on or off, wires to carry the signals, and stuff that'll turn off other signals based on its inputs. These get used to build slightly more complex units like logical gates, which then get used to build adders, shift units, etc., which can then be used to build computers.

computers are just fucking switches m8. minecraft has that function in it, all you need then is autism and loads of free time, and we all know minecraft attracts that like flies on shit.

You can make a computer in anything that has logic gates.
You can store memory in logic gates, you can pass data around with logic gates, you can modify data with logic gates. That's a whole Von Neumann architecture right there.

If you want to learn about building a real CPU with same basic components, I recommend watching this great YouTube series: youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU

SDL is kind of shit.
It just isn't very well done.
GLFW is better, although I think SDL does integrate better into steam.

>type-safe compile-time wrappers for most of the OpenGL shader configuration & execution calls,
I don't exactly know what you are mean, but I really have the feeling you shouldn't do this.

So when I make a switch with redstone then this is a computer now?

>comparing GLFW to SDL
Not okay.
For one, SDL is graphics API-agnostic while GLFW is OpenGL-only. That's why Valve uses it.

I have an ugly-programming-asian fetish

wolframalpha.com/input/?i={sqrt(log 4), sqrt(log 3), sqrt(log 2)}&rawformassumption={"FunClash", "log"} -> {"Log10"}

I don't give a shit about DirectTurd, and in the future nobody will.
GLFW is just better for the programmer.

>GLFW is OpenGL-only.
its had vulkan for ages now.
You also really didn't mention how SDL and SFML are "ready to go" libs. Wheres GLFW is missing audio.

should I study english or computer science?

>I really have the feeling you shouldn't do this.
I don't see why, it's wrapping stuff so you're guaranteed at compile-time never to exceed GL_MAX_COLOR_ATTACHMENTS, or screw up a call to glVertexAttribPointer(). I can set up a render pipeline step something like this:
using attribute_buffer_type = yavsg::gl::attribute_buffer<
yavsg::vector< GLfloat, 3 >, // position
yavsg::vector< GLfloat, 3 >, // color
yavsg::vector< GLfloat, 2 > // texture
>;
using framebuffer_type = yavsg::gl::framebuffer< 1 >;
// Depth & stencil + 1 color target
using program_type = yavsg::gl::shader_program<
attribute_buffer_type,
framebuffer_type
>; // Program that renders position/color/texture vertices to a depth, stencil,
// and single color target
using vertex_type = attribute_buffer_type::tuple_type;

// create a program_type called scene_program from shader files
// do other setup...

scene_program.link_attribute< 0 >( "position" );
scene_program.link_attribute< 1 >( "color_in" );
scene_program.link_attribute< 2 >( "texture_coord_in" );
scene_program.bind_target< 0 >( "color_out" );
scene_program.set_uniform(
"transform_view",
some_transform_matrix
);
Then call the shader program with a type-safe attribute buffer of vertices, ranged vertices, indexed vertices, and ranged indexed vertices as input.

Also, Steam apparently ships with its own SDL to link against so that's why it'd integrate better.

go into electrical engineering and study C"""""""""""""""""""S"""""""""""""""""" on your own.

apples and oranges

>betting on "future" with an API-specific framework
In the future nobody might care about OpenGL/Vulkan either, but SDL will support whatever takes their place.
Find a better counterpoint, friend.

I didn't mention a lot of stuff. I just mentioned the most important point, which turned out to be incorrect.

why is programming so hard? is it because I have 102 iq?

>Find a better counterpoint, friend.
not him but
have fun writing your own renderer because SDL's is probably still ass.

How do I make friends with other programmers at uni? I still have no friends and I know being able to bounce ideas off and chat with a like minded person would really help me learn.

>>/r9k/

buy them food and drinks every day
worked for me

how do I write a program that adds two integers?

Adv is terrible, soc is for hookups and no one on r9k codes anymore.

I'm poor.

>tfw dropped out because having only myself to hold me accountable didn't work
yeah, it's say making friends at uni is pretty important

>buy them food and drinks every day
those aren't friends user…

friends are supposed to help each other

So I just went through Python course where they just gave out basic usage all the way to basic python object oriented programming and GUI

Are there any books I should read up or things to do to advance further?

What VN is that? Seems familiar but can't recall

Did they buy you food and drinks too?

yeah, a book of a good language.

What do you want to make with Python? Make that. Encounter something you don't know how to do? Google it. Repeat until success.
This is the proper way to learn. Reading books is pointless.

I was the one that wanted to be friends with them
why should they be buying me anything?

lads, I'm getting into EE, should I learn CS stuff on my own? I'll have some general prog/algo classes where I'll learn algorithms with C, and ASM. After I'm done with these, where should I go?

Good friends bought you foods
Great friends cook you foods

Oh, you mean once or twice. I thought you were doing that on a regular basis.

share your variables

but I'm doing it every day
I just don't understan what is wrong with it
they aren't bullying me and I want to buy them food and they talk to me so it's nice
it's not like I don't have anything for it

Python Modern Cookbook

If you want someone to talk to about CS stuff, that's pretty easy. Just talk to your classmates about tough/interesting assignments, exams, research, etc. However, the chances of finding someone who's serious about their stuff is pretty low until you get into the harder classes later in your program. You can also attend fun events like game jams or programming contests, or join a decent CS club.

If you want someone to hang out with, I can't help you there. I never really did that stuff in uni.

>What do you want to make with Python?
I really dont know what I would want to do with Python. Im first year into electric engineering so I dont really have any clue what I should learn to do with it.
It would be nice if it would entail something that might relate to the field but then again its so broad. I have no idea what courses I might study in the next 2 years or so.

Hell, I dont even know if I should learn more python or some other language.

This image always pisses me off, because it makes me remember the past threads it has been posted...

>tiny lolis with resistors!

By that logic a prostitute you pay for is your girlfriend.

user...

maybe
but I don't want to kill myself anymore so I don't care

Well, if you have no motivating reason to program, then you should focus on one language. Spreading yourself thin doesn't do you any good, but learning stuff now might make it easier to relearn that language later when you actually need it.

Anyway, Python is pretty great for wide variety of purposes. Try not to be dissuaded by the circlejerk against it here, this website shits on literally everything.

Sorry, user. I don't care about the anime aspect of it, I just like it for the circuit board.

Hope you enjoy your compile times.

What is Dependency Injection

a meme

>It's been 4 months and they still have not sent mine yet.
I haven't got mine as well.

id be ashamed to show up in that in public

import java.util.Scanner;
public class CtoF {


public static void main (String[] args){
Scanner input = new Scanner(System.in);
System.out.println("Please enter the Celsius degree: ");
double Temp = input.nextDouble();

double Fahrenheit = Temp * (9.0/5.0)+32;
System.out.printf(Temp + " C is = %d", Fahrenheit);

}

}


So, I seem to cause a problem.
All I wanna do is display the fahrenheit correctly.
What am I doing wrong?

You can wear it at home too.
But I don't think a retard like you could have earned it.

I wonder whether the artist has an EE background.

A substructural temporal type system. Types apply over a period of time. It uses a variant of bunched logic without the exchange rule, so the type system can enforce strict before/after relationships. It also supports mutation and strong update (i.e. types dependent on mutable state). Normal dependent type systems only express invariants like "x is greater than y", but in this system you can express invariants such as "x is monotonically increasing". This lets you read x at one time and then use its old value with the assumption that the current value is greater or equal to it. Very useful for software verification, particularly concurrent lock-free algorithms.

can you do some sort of implementation or examples? it's interesting

>>tiny lolis with resistors!
kek I remember
Sup Forums is full of retards nowadays who can't differentiate between a resistor and capacitor

I'm still working out the categorical semantics. But I can certainly explain the substructural part. There's a multiplicative conjunction A * B that means "A before B". There are actually two (!) multiplicative implications, with some strawman syntax. A >-> B means that the argument "is before" the environment of the function. A ->> B means that the environment of the function "is before" the argument (this will probably be more common). There are also ordinary additive connectives which don't enforce an ordering. This is in addition to the standard resource reading, where resources cannot always be duplicated or destroyed.

Contrast with linear logic, where the multiplicative conjunction is commutative and there is only one multiplicative implication A -o B which is actually not(A) par B. The classical intuition (oxymoron?) behind the two multiplicative implications in this logic is that not(A) par B and B par not(A) would not be equivalent because of the non-commutativity.

The end goal is to implement it for a programming language.

I'm trying to make a bash script, looks like this:
for arg; do
echo $arg
du -s $arg
done

This works fine when passing files with no spaces in their name, but when they do it gets fucked. The echo works as expected, printing the entire filename in one line, but the du command runs for each part of the filename. What am I doing wrong?

It's just passing in dependencies as parameters in an object's constructor.

>"working on" means "fantasizing" on /dpt/

for arg; do
echo "$arg"
du -s "$arg"
done
Bash is shit with spaces. Generally enclose anything that can have them in quotes.

So poor man's generics or poor man's lambda?

If you want to work with args that may have spaces in them, use $@ instead of $*

im sorry but i fix PC and build them install new software and fix old software i don't no code from my butt and a hole in the ground i thought i could learn but as now it like reading Greek im as dumb as a coal bucket and just as cripple these are pics and videos my ex new goy toy sent me to torcher me so i thought i figure it out but to a vale he smarter than i and has two good legs and a neck that aint had 7 vertebra cut and fixed so i apolajise for being out of my leageu

That makes sense user, I wonder what I should strive for then though. Something to create for which you learn the language while doing it or at least trying to do.

Could anyone suggest anything?

It's a pure buzzword that only exists because OOP can make it difficult enough to be worth talking about. When really it should be used as a shit test - if it's cumbersome to pass dependencies around without using some kind of global or shared state, you have too much coupling.

I got mine within a month of it ending.

Would you like me to regurgitate my studies of Grothendieck toposes and Day convolution instead?

who is making those dpt threads? mods or anyone?

Whoever wants to when the thread is at bump limit.
Just don't fuck up the OP post and the image, and nobody will know that it was your first time making a thread.

Is this related to modal temporal logics?

>Would you like me to regurgitate my studies of Grothendieck toposes and Day convolution instead?
I'm just wondering if we're ever going to see any actual code, or if you'll just keep memeing day in and day out about muh types.