/dpt/ - Daily Programming Thread

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

Attached: 1559390643934.jpg (1000x1415, 485K)

Other urls found in this thread:

news.ycombinator.com/item?id=20073832
youtube.com/watch?v=3r_TuAb1b-0
twitter.com/AnonBabble

dubs if python is the only programming language

Reminder that you are a race-traitor if you use Python as a white male

I want to make something that's useful for my day to day life but I can't think of anything yet

Attached: 999.jpg (305x315, 19K)

I dissolve skulls in acid

me in the center

What's the most niggerlicious language?

Attached: iu.jpg (480x360, 19K)

in a good or bad way?

>I want to make something that's useful for my day to day life
this newbie idea that being a programmer allows you to hack your life and make neat little programs to increase your productivity is false, all these programs have been made already

t. someone not creative enough to think of unique personalized apps ideas

>no more reddit shit in the OP

Attached: 1523862657421.jpg (333x333, 45K)

you have to create problems then solve them not look for problems

JS

I helped to write a wayland compositor.
I use it for like 12+ hours every single day.

I seriously cannot fathom why janitors don't delete that shit.

They also don't delete other completely off-topic bullshit (i.e. like this). They're unpaid, lazy and not enough.

>work as a software developer
>expectation - to code using the latest technology and build from scratch
>reality - still using shitty winform and mostly doing copy-paste job as everything is already available

Attached: 1514190535309.png (469x452, 277K)

>What are you working on, Jow Forums?
Adding dynamic typing to C++.

>hurt finger at job
>hurts to type
so sad

Attached: 1522563932739.jpg (1403x790, 144K)

Fucking racist.

dumb frogposter

Fuck off, you retarded frogposter. You're not welcome here.

long l;
printf("size: %llu\n", sizeof(l));

Linux: 8
Windows: 4
Why is this allowed?

how did I escape the frogposting judgment

Attached: 1524295283042.png (400x313, 88K)

whoops i'm

>%llu
That alone is unportable. The correct printf format for a size_t is %zu.
But portability to weird-ass architectures is the reason.

I went with what didn't throw any compiler warnings.

It's not easy being green.

Enable more warnings. Also, if size_t just happens to be unsigned long long on your computer, it won't complain about it. It's still not portable.
E.g.
64-bit unixes: sizeof(size_t) == sizeof(unsigned long)
32-bit unixes/winmeme: sizeof(size_t) == sizeof(unsigned)

Because the C standard allows it.

it was mostly transparent and a less obnoxious frog

those pits man
fuck

That's a cute anime girl.

And today I will be working on my string library.

Attached: 1559309427796.jpg (3035x2149, 2.2M)

A size of 8 or a size of 4 can be held in even just one byte. I'm perfectly satisfied that what I got as output were the size of a long on both systems.

I don't get the Windows answer. Why even use long when you only get 32 bits on a 64 bit system?

I know you're supposed to use uint64 etc. when it matters. But for a quick and dirty program? Well, I'm warned.

Reminder that you should never use types like 'long' etc. unironically and instead use the types defined in (c)stdint(.h).

The reasons are very uninteresting as to why each platforms have their type sizes as they are, and I can't really be bothered to explain it.
As says, if you're really looking for an integer of a certain size, it's almost always better to use stdint.h types.

>cstdint
Stupid sepplescuck.

Stupid cnile

Right. Use Lisp instead.

Tetris typing game

Attached: 2.png (694x880, 312K)

>(((Lisp)))
>White

Attached: 3.png (750x897, 353K)

>I helped to write a wayland compositor.
sway?

>I seriously cannot fathom why janitors don't delete that shit.
because that OP pasta is older than yourself you dumb summerfag

Yes. Well, wlroots more specifically.
I've actually barely touched sway, but the wlroots work was a huge part in making sway not shit.

Attached: 1557279904231.jpg (900x882, 217K)

if only sway wasn't actually shit

Attached: 1552922066501.png (300x300, 166K)

Thanks for the work user. I'm using sway as my daily driver and really like it.

>JS
>not C

respond when you finish, might make C++ actually usable and fun

>Stupid sepplescuck.
I included it because there are actually fucking morons who justify not using cstdint because "it's an outdated C header HURR DURR".

>grown men
>watch pedo anime
>can't deal with frogs
>can't deal with the complexities of C++
>can't deal with the simplicity of C
>mfw

Attached: vlcsnap-2019-04-18-15h22m30s471.png (624x480, 293K)

I'm not particularly interested in shit like "why doesn't it act like some other autismal WM?"
But there is certainly room from improvements. All the shit I'm trying to change should hopefully make it work better, but not really in a directly noticeable way.

It's has been a very long quest on the journey to get Vulkan support and not just have it be a massive hack. But even then, the Vulkan part probably isn't even going to do shit. It's just being ABLE to implement is what I'm really trying to fix in the wlroots API.

I'm glad you like it.

Attached: 1558318472609.png (1500x1500, 829K)

>have to deal with stupid sepples shit at work
>want some comfy downtime C programming
>westaboo tells me i can't deal with anything

Attached: 1558675309491.jpg (357x379, 38K)

I have a question.
Why does one need a Microsoft account to use Visual Studio for longer than 30 days?
Surely, one can program without need of identity verification or online services.
I simply don't see the point.

Attached: 1559204871531.jpg (1101x826, 105K)

lmao. Apache Storm has been rewritten in Java from Clojure. Clojure shills are now on suicide watch.

news.ycombinator.com/item?id=20073832

Attached: 94fMJPU.jpg (734x960, 128K)

Data collection. They want to know who uses it when with which features and for what purposes. By having the 30 day period they can relatively accurately figure out how long people are using it and draw some conclusions together with the other data on why they continue using or it or why they stopped.

Porn scraping and organizing always works.

And this is why people give you shit for using proprietary (i.e. cuck) software.

Porn scraping is sometimes my most profitable code. Not because it makes me money but because I don't have to sign up to their shit website for a year when my scraper can download the entire thing in a couple weeks or less.

Then I have to organise it...

a discord bot that takes 1 server's channel, then edits everyone's new messages to have the spoiler tags.
if all goes well, it also will have subject detection, and prepend the spoiler-tagged-message with the subject.

botnet

Isn't Visual Studio 3gb or something? It's retarded, it's just framework stacked on top of framework until it's a barely operable mess.

An IDE should be just a few executables: a text editor, compiler, linker and debugger. It shouldn't be more than a few mb at most.

Attached: 1558102794480.png (240x240, 107K)

maybe my question should be in /sqt/
what does the following do:
P = X[out >= 0,:]
N = X[out.T < 0,:]
in terms of
def draw(self,X):

pl.close()
out = np.matmul(X,self.w).squeeze()

P = X[out >= 0,:]
N = X[out.T < 0,:]

>just 3gb
mate...

>3 gb
>text editor + compiler + linker + debugger shouldn't be more than a few mb
hmmmmmm

ignore the indentation. copy paste didn't come out right

>It shouldn't be more than a few mb at mos
Doesn't the largely depend on what you're doing?

That looks like slice syntax which would use bool -> int conversion to filter out the first element based on the conditions? But I'm not sure, because there shouldn't be a comma there.

>3gb
Last time I checked it was about 50 GiB for a full install. But that includes basically all installers for all .net frameworks, all vcredits, all of the mobile stuff, database servers and editors, game development, all supported languages, documentation, etc. pp.
The actual IDE ist just a bunch of MBs, the rest is making sure you can actually produce results and get them to run on other systems.

>Isn't Visual Studio 3gb or something?
Last time I checked, it was over 20GB.

>4MB compiler
>2996MB of analytics, deployment engines, .NET GUI frameworks, Solutions Explorer, Team Explorer, ASP.NET Administration, JavaScript plugins
How did we get here lads

Attached: 1557569996786.jpg (1152x865, 276K)

More importantly, how did it get worse?
youtube.com/watch?v=3r_TuAb1b-0

it's either c++ or java

love that guy

i remember Jow Forums going NO THERE'S NOTHING WRONG WITH ANY OF THIS WINDOWS IS ``BASED'' FOR PROGRAMMING but it really speaks for itself

thanks. confirmed my suspicion but syntax is kind of confusing

This. I once wrote a JS script that returned the URLs of full images on e621 and rule34 from thumbnail URLs, so I could simply browse the catalogue without having to go onto every image separately.
I then came to the roadblock that one can't programmatically initiate a download through JS.
All in all, an enjoyable exercise in string manipulation.

I suspected as much; although it then begs the question, why VS isn't then an "always-online service", or how they go about enforcing data collection on machines without an internet connection.

VS has an ass-load of bells and whistles: a lot of which lead to comfy coding.

class Animal {
public void eat() {
System.out.writeln("nam nam nam");
}
public void sleep() {
System.out.writeln("zzzz zzzz");
}
}
class Dog extends Animal {
public void bark() {
System.out.writeln("ruff ruff");
}
}


Output:

Animal fifi = new Dog();
fifi.eat(); // Works fine
fifi.sleep(); // Works fine
fifi.bark(); // Compile error!


How do I get the Animal fifi to bark? Or to become a Dog? I don't understand why this isn't allowed - if fifi is at least an Animal I should be able to cast it to a Dog or create a Dog from it.

And that is why inheritance and OOP in general was a mistake.

Because fifo isn't a Dog. It's an Animal. If it's supposed to bark then you need to tell the compiler that it can.

((Dog) Fifi).bark()

There's nothing stopping you from writing
((Dog) fifi).bark();
if you don't want to create another Dog variable referencing fifi.

inheritance leads to inflexibility

here is your 10% chance bro

Attached: chance.png (486x159, 10K)

>then came to the roadblock that one can't programmatically initiate a download through JS.
I think you could probably write your own extension that can.

Or, just use Python requests like I do and automate the whole fucking thing. I hardly look at what my scrapers are doing anymore and just get fresh decent porn every night. As well as a bunch of other interesting shit.

use entity component system

What? Cause someone doesn't understand that my kid can do things I can't. That's their mistake not _a_ mistake.

wtf

put the method inside the animal class
this works


import java.util.*;
public class Main {
public static void main(String[] args) {
Animal fifi = new Dog();
fifi.eat(); // Works fine
fifi.sleep(); // Works fine
fifi.bark(); // works

Dog a = new Dog();
a.lol(); // works
}
}
class Animal {
public void eat() {
System.out.println("nam nam nam");
}
public void sleep() {
System.out.println("zzzz zzzz");
}
public void bark() {
System.out.println("ruff ruff");
}
}
class Dog extends Animal {
public void lol() {
System.out.println("ruff rgggggggggguff");
}
}

Hmm this works in this simple example but in my application I'm getting a compilation error - " cannot be cast to ".

Ship it.

>fifi.bark();
fifi is the class animal and animal doesn't have the method bark

hello???????

Post the code.

This is why you use C# and var instead of Java and explicitly writing out the type.

And since noone else gave you an explicit answer:
Animal fifi = new Dog();
Instantiates a Dog and then Casts it to animal, which does not contain a definition for bark.

Okay the real scenario is this. I am modelling a cell (as in biological cells). Cells have different types of proteins in them, like hormones, enzymes etc.

All proteins come from the ribosome, which creates objects of the Protein class

class Protein {
public Protein(AminoAcids aa) {
}
}


Now each of these proteins needs to become specialised, for example, by "becoming" a hormone

class Hormone {
public Hormone() {
}
}


This process I cannot implement because when I try to do this

Hormone h = (Hormone) Ribosome.createProtein();


It says that it cannot cast a Protein to a Hormone. This makes sense intuitively because I am making a hormone (a type of protein) from a protein, but the paradigm doesn't like it.

Java has var as well.
Welcome to CURRENT_YEAR.

See
Also forgot to say that Hormone extends Protein

Let the protein have a method that returns a new hormone, instead of trying to mutate it into one.

That was hard to process at 11 at night. Sounds like you need a factory. Based on my limited comprehension of said problem... a Harmone factory.

Check local high schools, report back.

That should work. Are you certain Hormone extends Protein?

Because it only works one way - you can cast subclass to superclass (hormone to protein) but not vice versa.

It just works.

Shouldn't, if anything, Protein extend Harmone? Don't ask me to do programming and biology, guck.