/dpt/ - Daily Programming Thread

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

Attached: 1554230601061.jpg (537x594, 45K)

Other urls found in this thread:

docs.godotengine.org/en/3.1/
twitter.com/SFWRedditGifs

First

Second
fuckin kikes

>open source program I use stops getting updates
>use it regularly so go to the github and have a look
>it's written in object pascal
Fucking why?

spent all day rewriting my raytracer to do everything in large batches,
and its easily a few dozen times faster then before.
800x400 w/ 100 samples would have taken forever but only a minute and a half now.
havent even gotten around to adding multithreading back in yet.
probably lots of room to do better in other areas too.

Attached: raytrace.jpg (1600x800, 58K)

Starting a side project and want to learn a really good backend language

>Go
> RoR
> Node

Thoughts?

do not hurt the loli

What's with libraries that get rid of boilerplate, by adding even more boilerplate? I'm using vutify (JavaScript web framework), it has built in form validation where you need
>1 attribute on input element assigning errors array
>Error array, which is an array of functions that return true, or an error string
>Gives validate/reset function to call when needed
So 1 attribute, 1 veriable per input

To remove some of the boilerplate, I saw everyone recommend using vuelidate, to use it you need
>Attribute to assign error message
>Attribute to call validate function on input
>Another attribute to call validate on blur
>Object with list of validation rules
>Method that checks each validation rule and returns error message
>2 functions that need to be called to make sure it's validated
Thats 3 attributes, a list of rules, and a second list repeating the rules along with error messages for each input. This more than doubled the amount of lines for each input.

This is so useless, it has no benefit, and only the latest one I saw do this shit.

I so want to do this except replace the hand with my penis and the rubber band with semen and the lolis clothes with nothing.

Nice work user. Keep going.

...

When you use C, how do you usually go about ADT (e.g. dynamic array) especially when making a wrapper of something? Do you use a library such as GLib, made your own, or just use pointer types and using malloc/calloc/realloc everywhere?

yikes

C programmers write a shitty linked list for everything and call it a day.
If you actually care about performance, efficient code/algorithms, and efficient data structures then C is the wrong language.

I'm gonna use Rust for embedded development

Attached: a64194d270ef6f3f264c90ff699473c61361f47061a37239e26667551fdf8da2.png (1040x1000, 1.12M)

please help me frens.
I wanted to build a robot with ros2, but a fren said i should not do this but rather reinvent the wheel for the sake of muh learning. What do now?

Attached: cptobvious.jpg (241x323, 20K)

Now go back.

Attached: 1531622870755.png (1700x1000, 768K)

I typically just bake it into the higher level code, so if it's an array of Things I make thing_add, thing_get, and just ad hoc put in the dynamic array there *pointer, size and capacity), so no ADTs at all really - or basically everything is an intrusive data structure.

>C programmers write a shitty linked list for everything
you can post this as many times as you want it's still not going to be true

try not typing like a retard

Where do you store size and capacity information usually?

but i am a retard (literally)

Depends entirely on what you are planning to do.

Concurrency / Devops -> Go
Database heavy stuff -> RoR
Anything else -> Node.js

Although node is probably good enough for 99.99% of concurrency based applications anyway.

node fuck go and ror

I'm going through the beginning of Learn You A Haskell and in the part where it introduces list comprehensions it states the following:
[ x | x

is this type cast a good practice?

#include
#include

int main(void) {
int a = 2;
int b = 2;
int r = (int)pow(a, b);
printf("%d", r);
}

It's just naming that suggests there are multiple x values, just like you say "apple" vs "apples", there's "x" and "xs". I think Haskellers often use this naming scheme to indicate the head and the tail of the list when you have x, xs arguments, though maybe it means something entire different in Haskell, I'm not sure.

a common pair of variable names when pattern matching listens into the head and tail is "x : xs", xs is the tail which is a list and x is the head which is the first element
it's just convention, no real meaning behind the variable names, could have called it anything

Ah okay, thanks!

>literally a pedo

kind of related question, is path tracer the name of the similar technology but can render in real time?

I'm planning on using Godot to make a well known 2D platformer, and I'd like to see if there's some tips I can get for learning how to program for that engine. I have no prior knowledge.

no prior programming knowledge or no prior godot knowledge? If you know how to program then godot is really easy to get into

docs.godotengine.org/en/3.1/

Both actually, I didn't make that clear.

Thanks, I saw that but I was looking for some other stuff too.

>Both

It's going to feel daunting, I really recommend taking some general programming tutorials or courses. Just any language, python maybe since the syntax is similar to godotscript.

You need to get into the programming problem solving mindset and the godot docs are only references, they won't teach you any solutions, only supply how the tools work.

but good luck and dont get too intimidated and give up

Yeah, I'm really expecting it to suck at first honestly. Python is pretty much exactly what I had in mind though, because of the gdscript, like you said.Would you have any tips on that? I appreciate the kind words, user.

Attached: Rockman.X.full.1246767.jpg (1000x750, 555K)

Is there a future for you if you get into embedded?

There's no future for your period.

Attached: ufdb9x45c8q21.jpg (640x504, 62K)

No sorry I don't know of any good resources but once you get a grip on programming then start with making very simple game mechanics, or not even that. Just make something appear on the screen, then maybe change its position, then maybe add control input to manipulate its position and so on. Keep adding features and complexity but start TINY

b-but I'm only a student.

If it's not obvious enough, I'm planning on doing something mega man related. To start out with, I think basic movement would a good start. Thanks, user.

Hai pedo desu

Attached: 1544904589853.png (500x769, 206K)

Well, embedded sure isn't going anywhere anytime soon. Except maybe china. Problem is, there aren't that many jobs to befin with.

yes, relocation to Shenzhen

How much will an internship improve my chances?

Anons, is there any way to make so that if the input in a variable inside a while loop is higher than a certain number, this iteration of the loop is "erased"?
python btw

"continue"

Python has the continue keyword, which means the remainder of this iteration will be skipped.

Oh i see, okay thanks.
I imagine that it would be way harder to do in something like c++.

No, C++ has this keyword too. Even C does.

every language has continue

Has anyone here written a game server with a seamless world that has multi-server load balancing? What were some key technologies/algorithms that you used? Do you have any general tips of what to keep in mind?

Attached: 1549176453599.gif (500x558, 1.46M)

Ok its working as intended.
But how do i check if a certain integer is in a array?
I have a loop that will insert a variable value into a array, i want it to not accept if it exists already within the array.
a[]
v=input()
a.append(v)

How do i do it?

we only write Fizzbuzzs and other practical interview problems here

It sounds like you want a set rather than an list.

if v in a:
#do whatever
if you use a set it won't allow duplicates

bruv my program has like 100+ lines of code i am not rewritting this shit

Attached: 1498740226124.jpg (627x640, 71K)

>100+
that's tiny

>100+ lines is a lot

Is pycharm the best python IDE?

It depends whether you want to keep the insertion order of items. If yes, there's no implementation of an ordered set in the standard library, so you either have to build your own on top of an OrderedDict, keep an extra set that mirrors the contents of your list, or live with the linear search time of a list.
However, for a real world scenario, you rarely have integers without attached data anyway, so you would go for a dictionary.

>100 word essay due tomorrow

Do I really need to download git and type "git clone" to get someones project from github? Can't I just download as .zip directly?

Writing a POSIX compatible trojan in C with a destructive payload that overwrites every file in current user's homedir with a radom string equal in size to the file to prevent recovery.

Attached: smug_pepe.jpg (600x800, 75K)

Attached: nigger.jpg (362x212, 15K)

when i did some stuff with python, spyder was more than enough.

Such antisocial.

Ex-fucking-splain this before I go on a poojet massacre

Attached: 20190405_131849.jpg (3868x1189, 3.1M)

>3MB picture of screen

It was 4.5 before I cropped it down on my cellphone

I'm not visiting Jow Forums on my work pc

I miss the old days when malware would fuck your shit up just for shits and giggles instead of stealing passwords or asking for bitcoin.

how do you plan on spreading it

savechanges probably resets the set stuff idk

Doesn't work with or without savechanges. It did however work when I went full on OO and started a new transaction, enabled identity insert, inserted a new model object into the context table, then committed everything in one swoop. Guess I'll roll with that.

>working for commies
Rather dead than red

>muh gommies
amerilard indoctrination program still in full force, I see

Let's see how good you guys are

simplify the following JavaScript: !(!a && b)
>a && b
>a || !b
>a && !b
>a
>!!a || !b
>false
>It can't be simplified
>Other

Why don't you go there or Venezuela or any other commie shithole where 99% of people are extremely poor if you think being red is so great

there he goes again
1st - not my point
2nd - kill yourself you brainwashed retard
I really wonder what kind of asinine bullshit you posted in this thread probably something concerning the commies as well

dumb frogposter

rofl communism

are a and b true or false? or can they be arrays, dicts, null, ints, etc?

Not even a 56% you inbred faglord. Be lucky you or your family never had to feel the effects of communism. You are a fucking brainwashed idiot if you think communism is anything but the most heinous act against humanity.

chinese arent real commies

They can be anything that doesn't cause a run time error.

again, not my point
the only reason I replied to you is because I'm tired of you imbecile Jow Forumstards who just love to take everything out of context as an excuse to post garbage
>LOOOOOOL HURRR I'M SO FUNNY HE MENTIONED CHINA SO I'M GONNA LET HIM KNOW HOW MUCH I HATE COMMUNISM
fuck off back to whichever hole you crawled out of you human waste

This is simple boolean logic.
a || !b

haha dumb commie

Yes, it must be so bad for your family if they get free food, free healthcare, a place to stay, a free job, free transport,... They must have such hard lives.

Is this supposed to be funny cause webdefs don't know DeMorgan's laws? 2nd one btw.

>!!a || !b
this is the only one that returns booleans only with the same results

How the fuck do I see the info from the switch that connect us all ind class in a network and also connects us to the router, offcourse its OSI layer 2 and I can't see it in layer 3 traceroute. So what are my options? It connects 30 computers and then to the router, so it's a big guy.

Attached: images[1].jpg (259x194, 4K)

>free food, free healthcare, a place to stay, a free job, free transport
I'm sure the Venezuelan people are also enjoyiong those benefits, or literally every communist regime in exitence

not him but if i had to guess i'd say this one

First time encountering a meme? Why do you 'people' get so triggered by memes? You want them to ban memes about China? Or do you just never want to have fun?

there is no such thing as free haha dumb commie

>!!
This is stupid

False. What is contextual implicit conversion to bool.

Programming begins and ends with FizzBuzz. It's all logic and control flow. You can keep spicing it up with more criteria: Readability. Performance. Extensibility.