/dpt/ - Daily Programming Thread

What are you working on?
Previous:

Attached: 1552995669297.jpg (1440x810, 206K)

Other urls found in this thread:

GitHub.com/Floens/Clover/issues/487
homepages.inf.ed.ac.uk/wadler/realworld/index.html
twitter.com/SFWRedditGifs

first for java

kys pedo scum

how much programming do they even show in new game? I watched like one episode and it was just a bunch of drawfags

Fourth for crippling depression

Attached: 1551582505009.png (494x795, 411K)

They brush at it a few times. It's mostly abstracted but my impression is that the author doesn't pull too much out of his ass.
You watch it for the cute girls and some workplace drama. Compare to Working!! except with software developers.

Been wanting to learn coding for a while so just ordered these to help me get started

Attached: Screenshot_20190331-103659.png (2048x482, 192K)

wtf I love C# now

reinstalling windows because the piece of shit started to break

Attached: 1448298105990.jpg (1280x720, 105K)

reinstalling linux because the piece of shit started to break

Attached: 1524151059_3a7.jpg (680x680, 81K)

but reinstalling linux is much much much easier than reinstalling windows, all you have to do is pacman -S linux and takes like 5 seconds.

Reinstalling linux takes the same time as the windows reinstalling.

WebDav Implementation, it's more painful than it sounds.

Cringe

As a complete newbie, how much of a bad idea is it to jump straight into kotlin rather than learning java first if I only really care about developing android apps?

get a mac.

:earn C or Python first. Java is similar to C syntactically and would be great to learn it after C.
Kotlin is not a good choice to jump straight to it as a newbie.

Where or what should a newfag go to learn the ins and outs of the hardware and then learn about the more advanced stuff and what's the best way to learn and become proficient?

Attached: Snapchat-5300487028662960309.jpg (1080x1920, 361K)

What are some good keywords to google for C# pixel recognition.
I want to use WinForms to create something that plays music depending if a pixel at postion X,Y is the same color or not.

Is this feasible to do in WinForms or not.

General idea is playing a fighting game and changing the music when one of both players health bar has reached a certain threshold.
As no current software that I know off does this.

what the fuck happened to StackOverflow
It's not even 1st

Attached: 1st of April prank.png (1889x857, 446K)

I've been learning java for the past week and it seems fairly straightforward and user/newbie friendly so far; what's the logic behind doing C first?

What controls are you using? check the sender object and event for what you need.

It's the 1st in Samoa and Kiribati?

>pacific islands
>relevant countries

Anyone tried using clang-cl on bindows? Boost is giving me shit, I guess it's msvc macros are not working properly.

In C++
a += b = c;
does c = b or does c = a + b ?

Assignment has lowest precedence.

Can someone explain to me why people go full sperg about namespace pollution all the time? Like, when is that ever a problem?

First b becomes c, then a increases by b.

It's good for autocomplete, I guess.

Java forces you to write at least somewhat proper OOP, throw exceptions and so on. Starting with C and then switching to Java makes no sense, but maybe you're being sarcastic.

Label placement problem in Java.

I was looking at array initialization in Kotlin and I got
val arr: IntArray = intArrayOf(0, 1, 2)
var arr = IntArray(3, { it * 1 } )

honestly what the fuck is wrong with Kotlin? I thought it was supposed to be the better Java.

that's most anime for you

The first one makes some kind of sense, the second is retarded.

get on my level, plebs
var arr = arrayOf(1,2, 3)
var arr = Array(3, { i -> i })
var arr: IntArray = IntRange(0, 3).step(1).toList().toIntArray()

I’m pretty comfortable with js and ruby and looking to learn python, but I can’t think of anything interesting to make to practice using it. Can someone suggest something fun, ideally something that will showcase the language’s advantages?

yuck, Kotlin

Let’s say you want to write a function called max(). Well, std already has one, so if any using std is anywhere that gets parsed before your code, you’re fucked.

Thanks pal.

Use arrayOfNulls()

val arr = arrayOf(1,2,3)

Is this implemented on the JVM as an int[] or Integer[]?

Streaming socket reads may be partial so how should you guarantee the presence of a complete header when parsing HTTP?

language of choice to write a minimal program that runs in the background and plays a system beep/sine wave when a particular button is pressed?

Dunno, check it yourself. IntelliJ can convert Kotlin into bytecode and then back to Java.

I'm trying to learn to code now and as my first project I want to make a small backup manager that allows me to copy the contents of a main folder into a backup folder. I also want to add the option to copy the files back and pick between multiple backups.
All of that with a GUI and in java.

Shouldnt be too hard, right?

Attached: 1540267680136.jpg (633x640, 57K)

update just installed Windows 10

Attached: 7c97d9955b8d3841c96cdda69a73df46c88f229d93fd01fea26d025e38c714b7.png (1136x640, 318K)

That feel when you've got a fresh install

Attached: 1525388794348.png (380x349, 77K)

bash

I ain't your pal, buddy

Just finished my bitfield implementation.
I haven't used bitwise operators much before so am pleased with the result.

void sfd_bitfield_set(uint8 *bitfield, uint8 index, uint8 value) {
(value) ? (*bitfield |= (1 (7 - index)) & 1);
}

void sfd_bitfield_set(uint8 *bitfield, uint8 index, uint8 value)
{
(value) ? (*bitfield |= (0x1 (0x7 - index)) & 0x1);
}

Using hex values is an okay change but I hate the style changes, no thanks.

>I haven't used bitwise operators much before so am pleased with the result.
Only reason you hate it is because it isn't yours. Its way easier to read. Get a formatter and write according to it, your future employers will thank you.

>8width bitfield

what's the use-case?

Closure trees are the best for handling a hierarchy of comments, right?

>^

how come the indices are counted from different ends for getting and setting? ie setting at index zero refers to the lsb, whereas getting index 0 gets the msb

What is objectively the best OS to get?

gentoo

Cos I'm shifting in opposite directions.

Why?

I can see that, I still think it doesn't make much sense not to have the indices mean the same for getting and setting

They do though.

I've been using OpenSUSE on my laptop recently and it's pretty good.
MX Linux looks pretty neat too, and has first-party flatpack integration with its package manager. So you can probably fix many problems with outdated packages since it's based on debian stable.
Though, I think I still like vanilla arch the best.
Once you set up your AUR (install aurman), you're set.

?

>your future employers will thank you
I get paid to write PHP and JS messy web code that has no style conventions to it, not C.
I write C at home for fun for my own personal projects and nobody will ever care about my code so I should use the style that is most pleasing to me.

doesn't look like it to me

Attached: Screenshot_2019-03-31_16-25-14.png (670x412, 39K)

>?
if value is zero and the bit at that index is also zero, the bit will be set to one, not zero

Shit my test function was incorrect and led me astray, thanks I guess.

You're right, my test function made me think it was working but my test function is shit.

I regret posting.

wtf was your test function doing?

Debian if you value time and stability, everything works.

What's a good starter language if I hate the idea of web development? Is python the way to start? I need an excuse to blow 200 leafbux on a mechanical keyboard.

part of programming is knowing how and when to use the proper tools you can do this with a bash script in like 2 lines

Okay thanks guys, this fucking brainlet has fixed his shit (I think).
I need to stop fapping to trannies every day.

void sfd_bitfield_set(uint8 *bitfield, uint8 index, uint8 value) {
(value) ? (*bitfield |= (1 index) & 1);
}

kek'd

>What's a good starter language if I hate the idea of web development?
you mean the least painful web dev language/stack?
Or just a good first language to learn?

The latter.

D or Nim.
But ultimately it depends what things you want to make, and what fields you're interesting in.
But both are very general-purpose and have libs and resources from web to os dev.
D has a free book you can download
Nim has a book you can libgen, but the docs are pretty good. And there's a Nim examples site.

Feeling a bit burnt out by React. I like to know my tools inside and out, to be aware of how things work and what caveats are associated with them, but there's just so much change in front-end web development and it's a bit disenchanting.

I probably shouldn't even be investing this much time into knowing the minutiae of the library given that its lifespan is likely quite transient in the grand scheme of things.

Attached: cellphone_sky.gif (800x450, 342K)

well I also want to get used to this language.

Blazor(still experimental but server-side is already in preview) is supposed to grow into a stable frontend that doesn't change every now and then.
It is like react but better and uses a nice statically typed lang.

Is there any way to use tail call elimination in C with GCC without -O2?

-foptimize-sibling-calls
don't rely on it always working

Attached: 21ea9e06d1d0ee5ad4b482a323635bb2b6638acbc64401edb40411c5b190eeae.jpg (800x800, 120K)

Test

Attached: IMG_20190330_155256.jpg (960x1280, 196K)

>>>/wdg/
Also this is why I hate web dev

quick rundown?

Doing Floens' backlog on Clover. Namely this one - GitHub.com/Floens/Clover/issues/487

>I need to stop fapping to trannies every day.

Seek jesus.

Is it easy to program in Android Studio if I learn java for desktop first?

Thanks user I appreciate it

No problem m8, always happy to steer people away from the C/sepples menace.

>Brendan Eich originally wanted to put a Lisp language in the browser, but his superiors insisted on a language similar to Java

At least s-expers are a thing is wasm now.

Outside of academic masturbation, what can FP languages be used for?

the programmers get introduced later on, they dont get much screen time in the start since the main protag is a drawfag but after her friend gets into it it's represented somewhat, Somewhat, accurately

Functional Programming in the Real World

homepages.inf.ed.ac.uk/wadler/realworld/index.html