/dpt/ - Daily Programming Thread

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

Attached: 1561394302161.jpg (900x820, 193K)

Other urls found in this thread:

youtube.com/watch?v=hr1xp3tVgUQ
youtu.be/-SQP3E67bnc
en.wikipedia.org/wiki/List_of_Lisp-family_programming_languages
opendatastructures.org/ods-cpp.pdf
twitter.com/NSFWRedditGif

I have my gui thread. I call a function to be executed in another thread, and when this function ends it calls a callback function in the gui thread to update the gui.
I was able to easily do this in java, but how can I do it in c++? all I found was some convoluted examples

2nd for ada was a slut

should be the same but with std::function

Pretty much just work shit so I don't go insane. So react native for large company.

I think I need to gear up for interviews again though. So I will start programming JavaScript interview question challenges. Really not looking forward to it though.

If you was an interviewer, what questions would you give someone who wants to be an entry level developer in languages such as C++, C#, and SQL?

>but how can I do it with std::function? all I found was some convoluted examples

wrong thread

How extensive is your sock collection? Asuka or Rei? Is it Linux or GNU/Linux?

You typedef a function type for your callback.

Can somebody help me understand the time complexity for this function I wrote?
typdef struct btree {
int data;
struct btree * left;
struct btree * right;
} bt;

void insert(bt * t, int v) {
if(!t) return;
if(v > t->data)
if(t->right) insert(t->right, v);
else {
t->right = malloc(sizeof(bt));
t->right->data = v;
}
}
else if(v < t->data) {
if(t->left) insert(t->left, v);
else {
t->left = malloc(sizeof(bt));
t->left->data = v;
}
}
}

I don't know if it actually does what its supposed to do because I haven't compiled it.

I have asserted this
T(1) = 1
T(n) = T(n/2) + 1

Is this a correct recurrence relation?

if v == t->data, that would be unexpected.

It should be logn

That's by design, if the value is already there, we can't insert so the function ends.

I can see from the structure of the recurrence relation that it would be something like that, but I'm not sure the relation is correct.

is n the maximum depth of the tree?

Your btree is not right. logn should be the max depth as the tree should be balanced. Right now you can end up with O(n) worst case due to an unbalanced tree.

When I wrote T(n), I was thinking n would be the number of nodes, and if I recur on the left or right side of the tree, then the size would be n/2, right?

If n is the depth, then would it be something like
T(n) = T(n-1) + 1?

>wanted to try using AWS for the first time to deploy my web app
>signed up for an education account with the free credit not knowing it's limited compared to using a normal account which also gives you the free credit
>can't use elastic beanstalk which is apparently what you want for simple web apps since it does a bunch of shit behind the scenes, and it's what all the tutorials use
how hard is it to set up ec2 from scratch?

Lisp is the most powerful programming language.

beanstalk is an overglorified queue

Seconding this . If you insert data in order you'll end up with a linked list.

Haha. But, seriously, I'm just curious to see what expectations there are for someone going into an interview for an entry level programming job?

I dont understand.

youtube.com/watch?v=hr1xp3tVgUQ
It's not too late to learn programming.

Wait... dafuq... code tags work on Jow Forums now? I thought those were a no go?
bool on4Chan = true;
While(on4Chan==true)
Shitpost(ref on4Chan);

It works! When did this become a thing!?

Attached: 1538565514621.jpg.jpg (401x401, 28K)

cute

Wrote my own build system. After many twists and turns, many refinements, I finally realized I've spent all this time reinventing part of autoconf.

Worth it. I am a wiser man now. Plus the interface to the sustem is so much better.

Mandango effect. Up until a week ago c++ changed from being a normal and usable programming language in my reality to what it is now. Can't tell why or when it happens, but it do.

Since at least 8 years ago you newfag

Neat, user!

summer is icumen in.

>programming with one hand while kneeling

do they kowtow to the compiler as well

you're just butthurt that some nip has a based grandma who makes weird games for old people about clothing, while your boomer grandma is drunk in front of the tv

...but... that can't be right...... I know I have had to link to pastebin and use embeded links because code tags just got sanitized on Jow Forums, right? There's no way this has been a thing for 8 years.......
I get the feeling this is relatively new within the last few months and you guys are fucking with me. I shouldn't expect any different here though. Then again, maybe it is the Mandela effect ;)

Oh, and for what I'm working on I'm currently building a serializeable hash table in c#, but I'm having some trouble comparing values with the '==' operator on value type structs, but I don't want to use the .Equals() function because I don't want the object comparison as I don't care if all fields are equal in cases where the '==' operator has been overloaded to compare for things such as strings and reference equality. Not sure how to work around it. It's the last big obstacle I'm hitting at this stage of the problem.

Attached: 4chan-g-opposite.png (323x249, 114K)

My grandma is based, kys

just spent about 5 hours rewriting something to work almost exactly the same way as it did before. at least now I can do that thing I wanted to do. tommorow, now sleep.

Attached: 1546013792233.jpg (1280x720, 104K)

neat, user! good work. sweet dreams

If I want to get down the rabbit hole, should I start reading LAPACK and BLAS, or is sepple's BOOST library is where it's at?

Reviewed all the pull requests I had in my queue and got some hacking done on the commute to work.
I’m tired but now it’s time for a day of software engineering. :)

Neat, user. Hope the day goes nicely at the day job. I am going to check if you uploaded a monthly update.

There isn't much to LAPACK/BLAS if you just want to calculate stuff. I've not done C++ in ages, but doing linear algebra with Boost sounds like a fucking nightmare.

Thanks user, I hope you have a great day too! I uploaded the update yesterday: youtu.be/-SQP3E67bnc

I'm just looking to take a peek at how it's done underneath the hood.
I just found that boost has Basic Linear Algebra Library, which provides BLAS levels 1 2 3 functionality. So I'm asking /dpt/ if that's something relevant

No idea what to make

Attached: 1398546706099.png (1024x577, 711K)

you've already made my day

make another language, then learn it, then come back and ask what to make in it
my response will be the same

Make a python script that uses the TOR network to send random http requests to random IP addresses.

>Make a python script
dropped

aw cute

Does anyone use counting sort when sorting integers? Why or why not?

Write a java servlet to drop on vulnerable tomcat servers.

Attached: enjoyable_syntax.png (623x365, 14K)

Replaced my horrific macro-template-hybrid mess for generating unit strings with a slightly less horrific macro-template-hybrid, now featuring ADL.

Attached: Screen Shot 2019-07-01 at 2.50.05 AM.png (2576x1174, 507K)

There is no way he posts here

Very neat user!

Here's what the old one looked like. The benefit of using ADL is less stuff has to be defined in my library's namespace (which alternates between awkward and broken) and can be used in the namespace that defines the custom unit in question. I'm also going to use a similar trick for linear relationships (used for two-way unit conversions).

Attached: Screen Shot 2019-07-01 at 2.57.10 AM.png (1494x1600, 484K)

My micro semi needs a bi femto peta deca

>What are you working on, Jow Forums?
Commuting to my first day as an intern.
Bit scary desu

thanks for reminding me, almost forgot these

Attached: Screen Shot 2019-07-01 at 3.06.53 AM.png (830x306, 65K)

Noice. I am working on trying to tastefully wrap opengl statemachine bits in classes in C++.

I still need help with . Please help, this shit sucks.

Attached: 1560072067813.png (808x805, 236K)

It really sucks that you are such a cunt. I'd love to ask what you are trying to accomplish if you weren't a complete douche-waffle. God bless your heart, user.

gstreamer has an irc channel, why don't you try that

What? Thanks user.
I already tried their mailing list three times and still no responses. I hope their IRC channel is still alive.

why not?

>I already tried their mailing list three times and still no responses. I hope their IRC channel is still alive.
No, it's dead.

>No, it's dead.
No, it's not!!!!

how common are loop in lisps?
learning lisp now and my code is full of iterative algos.
i'm not sure this is the way to go.

I am curious who would be posing as serenity user, assuming this other user's assertion was correct.

Attached: 1424924559618.jpg (1126x934, 1M)

multithreading question: As an example say I have an image where I want to adjust every pixel independently, and say I have a thread pool with 8 threads. Do I split the image into 8 subsections so each thread can start/finish at roughly the same time, or do I just split the image into some fixed size subsections (say 100x100) where a thread may complete one subsection and then do another unfinished one (if I ended up with >8 subsections)?

racket or clojure?
just want a modern feeling lisp/scheme

Clojure is not lisp.

it would be an impressively long term bamboozle
but for what purpose?

Nigga why you dont use recursion

from what I've seen from graphical apps, they will do the latter

Because I've been using languages where iteration is normal for the last 15 years.
Really hard to rewire your brain to use map and recur and not try to force everything into objects and loops.

clout? The plot thickens. Put on your mittens for these sub-zero conditions.

Just use maps, folds and filters, my dude. There's nothing special about them.

Neither of those are lisps.
But I'd go with Racket simply because the Clojure core team is burnt out and aren't going to add anything noteworthy for the foreseeable future
Meanwhile Racket is going to be rewritten on top of Chez (significant performance increase), and has plans to compile to web assembly.

>tfw my asian coworker talks to me like this

Attached: 1437565305161.jpg (500x700, 306K)

>Neither of those are lisps.
Ignore the rest of this post based on this. Major dumbass.

What makes Racket not a Lisp?

In common lisp it's normal

it is en.wikipedia.org/wiki/List_of_Lisp-family_programming_languages

I wish I had a work too.

no you don't

opendatastructures.org/ods-cpp.pdf

going through this book it's pretty good.

Exercise 1.6. From scratch, write and test implementations of the List,
USet and SSet interfaces. These do not have to be efficient. They can
be used later to test the correctness and performance of more efficient
implementations. (The easiest way to do this is to store the elements in
an array.)

one of the exercises in the first chapter make a list class with the functionality of that. i like how it teaches you to implement these structures instead of just using the ones already supplied by the standard libraries.

I keep reading "editable" as "edible"

It's a lesser pain than wondering how I'm gonna pay the bills in 3 months

Let's say I have two collections. How can I map the nth element in each of them to a function?

(defn plus
[a b]
(+ a b))

(def vec-a [ 1 2 3 ])
(def vec-b [ 4 5 6 ])

(map plus vec-a vec-b)


How would you implement that last line?

like a zip? in Haskell you would use zipWith, or equivalently zip and then map

Writing an Oldschool Runescape player killing bot.

Attached: pking bot.png (1705x943, 1.64M)

I always posted here ya doofus

UNEMPLOYED FOR 10 MONTHS, want to get back into the workforce but literally can't pass a single interview. What do?

Back in my day everybody used SCAR. What a weird little language.

Practice.

Lisps tend to be variadic in their map functions in this way

What kind of job are you looking for?
Decide on that then write a portfolio piece relevant to that job.
And do practice interviews with your friends if you have any.