/dpt/ - Daily Programming Thread

old: What are you working on, Jow Forums?

Attached: programmer.jpg (180x180, 6K)

Other urls found in this thread:

2016-aalto-c.mooc.fi/en/instructions/index.html
twitter.com/SFWRedditGifs

for me, it's zig

Attached: image.png (4824x1527, 118K)

Do I learn Rust or C++? What's the best resources for doing C++ if that? I know there's like 10 different standards for that language at this point.

pls help

Please post what your server currently looks like.

nth for Nim!

Updates to a Java server for mobile games I've released.

In java I have a super class then a sub class of it that adds one more instance variable, also including it's getters and setters
I initialize my objects as the super class and now I can't use the things in by sub class, how do I solve it? How to access getters and setters of sub classes smoothly?

do the needful sir

nobody cares

I could just move the MiningBuilding classes' methods to the super Building class
who gives a fuck if not all the buildings are mines as long as I can access them am I right lol

>ask me what i'm doing
>loldontcare

Attached: IMG_321.jpg (610x343, 150K)

Almost done with Bartosz Milewski's Category Theory for Programmers. I seriously consider people who don't know cat theory to be code monkeys now.

Attached: Category-Theory-for-Programmers-OpenLibra.png (824x1034, 424K)

if you initialize an object as the super class, then it doesn't know anything about the "things" in the subclass. that's how classes and subclasses work. if you need to use the things in the subclass, then initialize the objects as the subclasses.

Learn D you fucking imbecile

No. No matter how many years you shill D i will never stoop to it.

You've been here for years and you don't know C++? What kind of brainlet are you?

One that wasted years on Common Lisp, C, and Erlang.

Reminder that C++ is completely different from C. Pretending that knowing one means you'll know the other is dumb.

Tragic. Learn both.

>wasted
le~
C++ is the real waste

>every non-programmer always lists it as C/C++ as if it's the same thing

HR never learns.

What is a good clean way of making a terminal ftp client that can connect to a machine on my network, list directories and transfer files.

In C++ btw

blackbox the network from the command layer

it's not completely different, so stop spreading stupid lies.

It's literally completely different. Do you think because they both have an if statement that makes them the same?

if you know C++ you know C

To be fair, if you know both, it is quite easy to think of C as similar to C++, because you can write C in C++.

Up to a certain point.
Past C89 they aren't compatible. C++ introduces a ton of differences as well.

>tfw you want to complete a C Mooc
>tfw you can't join the MOOC because it's 2 years old
>tfw the website only teaches Java now
What a shame, the exercises/projects on this mooc were pretty interesting too. Nothing else compares to it(CS50 does't go deep enough in C). At the least the info is still available for the public. 2016-aalto-c.mooc.fi/en/instructions/index.html

Attached: 1539051145746.jpg (370x699, 34K)

Ok guys, I feel like a complete fraud because I just can't seem to be able to start/complete projects. I want to start working on projects on things like Conway's way of life, snake, and some rpg-like game, but I just can't seem to find a way to start. For example, with a game like snake. What steps would you follow to complete a game like this? I just completely freeze up when I am starting any projects, because I don't know where to start. My language of choice is C, btw.

Attached: tenor.gif (498x410, 335K)

First make a board for the snake. Then make the snake. Then tell the snake what to do in various situations. Then add some graphics layer if you want to. Done.

I guess the part I am the most confused about is the graphical part of the project. The logic is pretty simple, but graphics with C without third party libraries have always messed with me. That's why I want to handicap myself and not use a graphical library. Any tips on that user? Thanks btw, your post literally laid the steps in an easy way, I guess I was over complicating the steps.

Very shit OP. Please don't make any more /dpt/.

How do I keep my python program from exiting?

I only want it to exit if I type "q"

Attached: 1540980533710.jpg (1280x869, 195K)

use ncurses, it's simpler than learning opengl or something.

Most graphics in C are just terminal shit. You would literally just print out characters in lines to represent the board. Actual graphics? You'd have to use the platform specific APIs.

>graphics with C without third party libraries
>don't want to handicap myself
You can't even write a snake game, take the fucking handicap.

Stupid question:

I’m applying for computational linguistics, and after watching some lectures, I’ve decided to take a Python certification (for university, not a job).

Is Python a good language for natural language processing? Anything else that would be helpful?

Thanks fellas

Attached: F548F1B1-70D3-4FDF-9544-AF3F84773091.jpg (640x674, 104K)

block SIGTERM, SIGINT and SIG whatever else.

I need to make a constant array of pointers to constant byte arrays.

I'm working on a project in the Arduino IDE, and I need to define some byte arrays that describe characters. For instance I've got
const byte charR[] PROGMEM = {
...
Now I need to create an array message[] which is basically a sequence of characters. Some of these characters repeat so I figure that I should fill the message[] array with pointers to the character arrays.

I can't quite figure out how to declare this message[] array though, let alone how to properly read from it. I gotta be able to read the xth byte of the yth character in the message array.

Stackoverflow is not helpful. Can one of you guys give me a hint?

Yes, look into NLTK.

ncurses looks pretty cool. Thanks for the suggestion.

I see, an infinite loop that prints out the current character positions on the grid/2d array. Makes sense. Thanks user.

You are right, I should go easy on me and use libraries for actual graphics. Thanks for the suggestion, user.

Awesome, thanks :D

I’ll look into that as soon as I know what the fuck... funny thing is, I’m an Arabic linguist, so I wanna do some sandrunes shit

* what the fuck I’m doing

I got offered my first developer position yesterday, full time node backend stuff. pumped

Attached: 1508660625515.jpg (960x540, 134K)

who cares lol

Well that's different, I think python's NLTK is mostly aimed towards english or at least something that resembles latin in some way.

If it's too different like Arabic or Chinese, I don't know if it will be much help.

I'm not all that familiar with computational linguistics but I think a lot of that is(or was for a very long time) done in LISP.

>javascript baby

Attached: 1232931963267.png (403x428, 103K)

You sound jelly lol.

Good job user
Be nice faggot

mad and unemployed

>weeb going apeshit for being exposed as a npmfag

How do I escape my NEET lifestyle and start earning 100K+?

Attached: 63963495_p15.png (617x783, 407K)

Have a degree
move to SF

> move to sf

Let’s refine that question, shall we:

How does one get out of NEETdom, earn $100k+, AND not lose it to rent, taxes, and costs of living to the point where the extra money doesn’t matter?

Attached: 1A5BED11-335D-4D9F-9CB9-063AF22299C7.jpg (4032x3024, 3.29M)

let's be realistic, shall we:
if I could do that I woudn't have wasted my life on Jow Forums

I don't understand what you're asking for and the little code you posted didn't help.

const byte charR[] PROGMEM =

Isn't arduino C and C++? That doesn't look valid.

Try explaining through code what you want.

>Isn't arduino C and C++?
Arduino is C++ with an additional preprocessing stage. Anyone who says different is full of shit.

Fugg...

W-well at least you have fellow anons who love you, can’t put a price on camaraderie right hehe :/

>you will never live with a programming friend and share the pain of being a NEET with them
Studying AI is taking a while to get caught up but soon I;ll finally have a friend.

Oh sorry.
Here's a pastebin of what I've got so far: .com/SjVXLWy0
You can see where I declare and initialize charR and where I try to initialize message[]. PROGMEM is just a keyword that means 'this info goes in flash memory, not RAM'.

The message[] array is going to be much longer and might reference enough characters to spell out an entire sentence. My example here is broken here at the message[] initialization. I don't know exactly what I need.

You can see that the writeCharacter() function always writes charR right now, but I would like to do the same thing by referencing it through message[]. Like instead of `sizeof(charR)' becomes `sizeof(message[0])'.

I'm just not sure how best to create this message[] array. Should it be an array of pointers? What is the correct syntax for this?

oh c'mon I'll always be here :^)

Give it time, give it time...

Once I learn NLP, one of my big projects I want to develop is an OS for sexdolls, like Pygmalion and his statue without the ignorance of the delusion.

i feel like my #include statements are complete fuckin spaghetti, how do i fix them? are there general conventions for this kind of thing?

Wanna be script kiddy here.
This script does not want to work together when it is all put together. When testing each part with alerts I can see the right data is there and when I hard code "getElementById" I can produce the desired results on a single iframe but I want all of them to be changed.
Can anyone show me what I screwed up on?

var button = document.createElement("Button");
button.id = "MGButton";
button.innerHTML = "Button";
button.onclick = function(){
var iframedata = document.getElementsByTagName("iframe");
var i;
var iframesource;
var iframeid;
var srcptime;
var time = "&start=999999";
for (i = 0; i < iframedata.length; i++) {
iframesource = iframedata[i].src;
iframeid = iframedata[i].id;
srcptime = iframesource + time;
document.getElementById(iframeid).src = srcptime;
};
return false;
};
button.style = "top:0;right:0;position:fixed";
document.body.appendChild(button);

death to every wanker who has a meltdown when they see "raw" pointers

if i wanted to make memory management a headache i'd use your fucking templates, but no thanks

what?

you want

fuck off

w/e psycho

Lisp is the most powerful programming language.

>t. too much of a brainlet for Common Lisp, C, and Erlang

Lisp is trash
C is old and busted
erlang is bretty gud

I'm reviewing linear algebra for the first time in like 3 years and programming has somehow molded my mind to parse mathematical statements and axiomatic logic a lot better.

talk about shit taste

Nah. Lisp has no practical uses besides spawning more lisp flavors no one wants.
C is beyond retirement status.
and
>erlang
>bad

>What is common lisp
>old is bad

retard alert

what use does CL have that it especially excels at?
And yes, in C's case, old is very bad.

Well assuming it's compatible with C.

const byte charR[] = {
B01111111,//top half
B01111111,
B01000100,
B01000110,
B01101111,
B00111001,
B00000000,
B01111000,//bottom half
B01111000,
B00000000,
B00000000,
B01111000,
B01111000,
B00000000
};

const byte chare[] = {
B00000001,//top half
B00000011,
B00000100,
B00000100,
B00000011,
B00000001,
B00000000,
B01100000,//bottom half
B01110000,
B01001000,
B01001000,
B01010000,
B01000000,
B00000000
};

struct char_thing {
const byte *msg;
size_t size;
};

static struct char_thing messages[] = {
{ charR, sizeof charR },
{ chare, sizeof chare }
};

void writeChar(const struct char_thing *c)
{
int charWidth = c->size;
/* .. */
}

void loop()
{
writeChar(&messages[0]); /* charR */
writeChar(&messages[1]); /* chare */
}

Or any other way you want to abstract it.

I remember learning C++. You get used to it.

int + 1
string / 4
float(100)
Someone please explain to me why these meaningless expressions shouldn't be valid syntax in a real language.

macros, not being functional shit that you can't do anything in

And yet C can do circles around most of the modern junk while being entirely simplist

>old is very bad
yet you had no problem with erlang

>macros
Nim has those and AST wank as well, with being much, much faster than any Lisp flavor.
>And yet C can do circles around most of the modern junk while being entirely simplist
With none of the safety or tools.
But you're going to say
>hurr who needs safety,when you're a perfect programmer!
>what you actually like quality of life????

the real question is why should they be valid syntax

>Nim shill

lmao cya later, filtered.

erlang actually gets updated regularly, and the community don't circle jerk a standard as "perfect".
>faced with facts that Lisp has 0 advantages, the Lisplet flees

What is C18.

congrats user. make the most of it

a bug-fix release just like c17, right?

Your point? The latest version of Erlang isn't pumping out new features. It's improving existing ones.

Once Nim starts publishing real benchmarks to the already standard sites then we can talk about it being faster than anything. Until then Nim is a shitty attempt to take over Rust and failed hard at that.

???
Nim cane out in 08. Rust came out in 2010

At least Rust and Nim have something in common. Both are perl-esque line-noisy eyesores.

Nim has never and does not compete with Rust, it doesn't tout safety as a main feature. And even if the nim site has benchmarks, you'd just call them rigged if it was faster or competitive with your favorite language (Which other benchmarks have shown).

8 years later and Nim devs still refuse to compete in Debian shootout since it shows the real facts of Nim being shit.

There's a reason why Nim can't even make any of the top programming lists and the ones that it does it's at the very bottom.

Attached: file.png (1024x708, 150K)

>What are you working on, Jow Forums?
putStrLn "My transition!"

Attached: 20181127_223554.jpg (2448x3264, 426K)

ghastly

Nim is still heavy in development, I think it's better they get 1.0 out first and then worry about advertising. Also are you really going to play the popularity contest == merit gimmick? Because we both know you don't find Javascript/Python/Java as the best langs.