/dpt/ - Daily Programming Thread

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

Attached: 1425715680975.jpg (563x712, 81K)

Other urls found in this thread:

leetcode.com/contest/weekly-contest-108
youtu.be/nH9AhuxUWMM
jsbin.com/tiyogujope/1/edit?js,console
github.com/yasserg/crawler4j
algs4.cs.princeton.edu/42digraph/WebCrawler.java.html
twitter.com/NSFWRedditImage

leetcode.com/contest/weekly-contest-108

also niggers

youtu.be/nH9AhuxUWMM

Homura did nothing wrong and C++ is the best programming language in existence.

C++ is a shitlang. Almost everything it added to C is broken in some fashion. BetterC does not exist, and the way things are going it never will.

>Git pull request from user with Anime avatar

Attached: le-anime-trashman.jpg (680x680, 99K)

>Git pull request from user with Anime avatar

Attached: 1529716976484.jpg (1280x912, 497K)

learning rust and it's pretty comfy, the completion is absolutely garbage in vscode though, only shit in the global namespace shows up in it, what do you folks use?

>meme language hur

JavaScript rocks!

Attached: js-rocks.png (1000x494, 369K)

that is surely one odd way to spell typescript

Lisp is the most powerful programming language.

I'm trying to convert what seems to be filaname-safe Base64 but when I decode it there's just more Base64 or something? So if I decode it again that's still some weird encoded thing? I'm confused, what am I missing?

jsbin.com/tiyogujope/1/edit?js,console

cringe and bluepilled
based and redpilled

Attached: c111qqp.png (590x590, 523K)

Redditor here with a PhD in CompSci. I'm most likely smarter than you.

I was about to reply to this, almost got me

It's sad how many people actually think that, and then they go into a real CS job and they are fucking useless because they've only studied concepts and wrote some basic Java or something

You're seriously deluded if you think you can acquire a CompSci PhD with only "basic Java" skills.

cs jobs are gay

What's a fun project to do if you want to do a web-java project? There seems to be a lot of jobs for it in my area and I want money.

Attached: 1539717467909.gif (300x309, 665K)

Obviously not the guy you're replying to, but I'm currently doing a PhD in CS in collaboration with an industry company, and my PhD is directly related to what the company is doing.

>What are you working on, Jow Forums?
Hacking the VFIO/mdev API to pass through two physically remote PCIe devices and doing PCIe peer-to-peer (RDMA) between them.

Pic related.

Attached: Screen Shot 2018-10-23 at 12.51.47.png (2802x2226, 668K)

Is a video-game a good way to learn Java? I wanna do OOP, and eventually do Twitter 2.

both are based and redpilled

Doing performance optimizations in javascript that amount to jack shit except making me feel productive.

>tfw types faster than auto completion algorithm

blue and cringepilled

>not being a programming anime girl in 2018

Attached: 1d5.jpg (800x800, 91K)

WASM

>anime
Hi!
Go to Hell.

yes user, read the first word of the post again to understand why I'd like to use something like it for now

Is it really bad that I don't really use much objects in Java and such? It's just that I can rarely think of using objects, and instead just using the basic elements like arrays and loops

I guess C is more suitable for me then...

Attached: 45324.jpg (500x333, 99K)

>Java
hahahahahahhahahahahahahhaa
yeah use C

>Introduction to Programming
>By Nick Samoylov
enjoi

given that OOP is basically java's only way to do polymorphism, yeah you sound like you'er fucking it up

>be stupid
>except smart reply to useless blogpost

that just means you havent done any complex programming that requires them

in python, whats the difference between
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
letters[:] = []

and
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
letters = []

Too much overhead for cross calling

Not really, unless you do lots of buffer copying.

Attached: 1539554491684.png (1500x1500, 134K)

Based.

What about blackpilled?

Attached: 4chan-end.jpg (640x1137, 143K)

Anime website

Attached: 1515199087403.png (563x706, 572K)

cringe and bluepilled
i bet you post frogs

sad and doompilled

I have an arraylist with some objects (lets just say 4)
I need to clear it in such a way that I can put new objects over the same indexs (0 ... 3 )
how can I do this in java?
using the .remove method is giving me an out of bounds exception

Providing anything but C compatible API from library should be banned.
People who make such languages and compilers should be hanged.

i never knew someone made a transparent version of this, thank you user

This, absolutely. I'm all for using comfy languages like Rust but if you need to provide an interface for other people and it's not about making an open source library that's for that specific language to develop with, C should be the way to go.
thank you for reading my blog

Any Pajeets here? I need Java help.

Which Swing classes should I use to simulate a non-clickable box that can change its color dynamically?

First of all Pajeets use Python.
Secondly, Swing is horrendously outdated and has always been. Use JavaFX.

That "uncle Bob" guy says you should reverse source dependency so it points in the opposite direction of the flow of control. It says you can do that by introducing an interface in between the two modules.

I don't really understand how one would implement that in practice. Can someone give an example of this shit?

What classes, libraries, etc. do I need to build a search engine with Java?

Also maybe something web-related with Java, like some Java back-end shenanigans. I wanna give it a go.

Attached: 1537967988530.jpg (1260x840, 197K)

>using the .remove method is giving me an out of bounds exception
bost code

when you add the new objects, use the add method rather than the set method

Yeah, that's really really bad. You have completely missed to point then desu.

>not providing both a C and higher language APIs

It would be really easy to do that in sepples but still almost every sepples library just provides shitty sepples API.
Classes were mistake.

stay mad cnile

yeah having 100 languages each having millions of libraries which only work with that language.
Sure is ideal world we live in.

frog website

Attached: 1537960079223.png (427x576, 310K)

objects are basically structs anyway. learn structs, you cuck

post your spaghetti code, I want a laugh

>build a search engine
>maybe something web-related
???

But to answer your question
>java.util.regex
>github.com/yasserg/crawler4j
>jSpider
>jsoup
>algs4.cs.princeton.edu/42digraph/WebCrawler.java.html

5 seconds of google

>objects are basically structs anyway

Attached: 1534815353725.jpg (1170x742, 70K)

t. python brainlet

I know, but I've not slept in 30+ hours. I'm about to go be a sleepy boy. Thanks user. I'm gonna attempt this when I wake up.

Wanna give me a time limit?

C++ is among one of the languages I use regularly.

go back to reddi
t, dumb frogposter

This is completely wrong. It means user is writing code that might work, but is structurally horrendous, whether it is "complex" or not is irrelevant.

Working on going to school

Assuming you have a job, you have a week. I want to see good clean code + unittests, faggot.

>>>>he doesn't use rust

XDDDDDDDDDDDD

C>>=>>= when?

I have my eye on Rust, but I'm not completely sold yet. The general improvements and lack of legacy bullshit is promising, but the borrow checker seems too restrictive for me right now. The metaprogramming is also too limited, although Rust macros are powerful and useful (still nothing compared to Lisp)

template
std::optional operator>>=(std::optional t, std::function f)
{
return t ? f(*t) : std::nullopt;
}

I'm pretty sure someone is already implementing C++ in haskell.

user you aren't supposed to give me a normal reply

yeah it's still evolving, growing up

bump

Noone?

>trying to connect on uni's wifi through shitty captive portal
>write small python script to do that for me
>auto reconnect when I get dropped from connection (every 2h)
>mfw I notice all the normies having to reconnect
>mfw some fag asked me how I manage to stay connected on the wifi
>mfw I reply 'I dunno m8, it just works™on my machine'

:^)

its so beautiful

can someone draw this with sweaty nerds pls

>Declare function prototype in header
>Include header in *.c file
>Still get implicit declaration and conflicting types error

Attached: kaguya with question mark.jpg (362x346, 38K)

Why not be nice and share your solution?
I don't understand why you wouldn't want to be nice to those around you

you fucked it up

Because 99% of them use windows 10, the others use Ubuntu and I dunno what network manager it uses or how it works

the Maybe monad isn't even the most used one

>i use arch btw

>>Still get implicit declaration and conflicting types error
The prototype does not match the definition, duh

nobody gives a fuck about that tho, when someone ask me what I use I just say linux.

It does though.

The compiler is telling you differently (implicit declaration and conflicting types).

Post both source and signature in header.

and use damn code tags

Header declaration
double ds_alkio(const DblSolmu *solmu, size_t i);


Function in .c file
double ds_alkio(const DblSolmu *solmu, size_t i)
{
if (i == 0) {
return solmu->data;
}
return ds_alkio(solmu->seur, i - 1);
}

Thanks.

JavaFX is missing from the initial JDK11 installation, where do I get it?

Do you have a ds_alkio defined somewhere else? For example in another header file you're including?

Are you including the header file in the source?
Is DblSolmu typedefed to different things for header and for source?

The implicit declaration comes from the calling of the function, post that.

Attached: Screen Shot 2018-10-19 at 12.11.26 AM.png (1248x206, 69K)

double dl_alkio(const DblLista *lista, size_t i)
{
if (i > lista->n) {
return -1;
}
return ds_alkio(lista->paa, i);
}

typedef struct DblSolmu {
double data;
struct DblSolmu *seur;
} DblSolmu;


typedef struct DblLista {
int n;
DblSolmu *paa;
} DblLista;


For reference paa = head, n = the amount of nodes, seur = next. It's a linked list. Additionally it compiles on my computer but the uni automatic checking rejects it with the conflicting types error.

dumb "dumb frogposter" poster

Attached: 1519508580586.png (900x623, 40K)

google

I googled it already. I dont get it. Help, pls. How do I get JavaFX for JDK11?

where does the error point to?
what is your uni static checking program?