/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1554275976479.jpg (800x800, 104K)

Other urls found in this thread:

riptutorial.com/vala/example/30672/yield-from-an-asynchronous-function
stallman.org/rms-lifestyle.html
bfgroup.github.io/cpp_tooling_stats/modules/modules_perf_P1441R0.html
twitter.com/NSFWRedditVideo

First for scala

Scala is even worse than sepples

Straight white male here. AMA

how do you even live with yourself?

Why do you prefer programming in javascript?

How does it fell to be the second most oppressed group in society after gamers?

Do you work with embedded software?

Lisp is the most powerful programming language.

fuck python

What a "grea" thread.

Attached: 1432316911221.png (191x215, 3K)

Learn Lisp.

>What are you working on, Jow Forums?
i may finally not rewrite my app in Vala, the way to do async procedure is truly a mess.

Also, look at this riptutorial.com/vala/example/30672/yield-from-an-asynchronous-function

public async int foo_async () {
yield; // pause the coroutine
Timeout.add_seconds (5, bar_async.callback); // wakeup in 5 seconds
return ret + 10;
}

public async int bar_async () {
var ret = yield foo_async ();
}


the code yield before setting the timer alarm, bar_async is never call. right? top kek.

I already know Scheme and Emacs Lisp. We had the Wizard Book for the introductory programming course at our university.

>wake up 2 hours ago
>already tired
how's a person supposed to program like this

Attached: 1465847810672.png (288x218, 121K)

change your diet

and more sun exposition.

I'm always so tired. I try to lay down and read but I fall asleep. If I am up, I spend most of my time shit posting not getting much done. I have nothing to look forward to. Life is hell.

Attached: depressed_girl.jpg (687x750, 94K)

Attached: coffee.jpg (1920x1080, 90K)

I can't program outside so that would be a waste of time

need some iced coffee now.

Also thanks to that user earlier who said to use a thread for my hook, I think.

// Called at exit, no call this manually
void cleanup()
{
unhook_keyboard();
unhook_mouse();
printf("[+] Bye!\n");
}


void setup()
{
// Hook mouse and keyboard to get input
if (!hook_keyboard()) {
fprintf(stderr, "[-] Could not hook keyboard, exiting\n");
exit(-1);
}
if (!hook_mouse()) {
fprintf(stderr, "[-] Could not hook mouse, exiting\n");
exit(-2);
}
}


DWORD WINAPI input_thread_loop(void* arg)
{
atexit(cleanup);
setup();
MSG msg;
while (GetMessage(&msg, NULL, WM_TIMER, WM_TIMER)) {
// Loop forever
if (msg.message == WM_TIMER) {
DispatchMessage(&msg);
}
}

return EXIT_SUCCESS;
}


int main()
{
// This disables quick-edit mode
// I think this might clear a lot of flags that we want to clear
// Making the console less likely to be able to be closed or resized
HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
SetConsoleMode(hInput, 0x0);
SetConsoleMode(hInput, ENABLE_EXTENDED_FLAGS);
CloseHandle(hInput); // Ya?

HANDLE input_thread = CreateThread(NULL, 0, input_thread_loop, NULL, 0, NULL);
if (input_thread == NULL) {
fprintf(stderr, "[-] Failed to create input hook thread\n");
exit(4);
}
/*
MSG msg;
while (GetMessage(&msg, NULL, WM_QUIT, WM_QUIT)) {
// Loop forever
}
*/
WaitForSingleObject(input_thread, INFINITE);

return EXIT_SUCCESS;
}

have something to eat

Get off Jow Forums

use core guidelines

Attached: s6b.png (190x211, 8K)

You're probably joking but just in case you're not you should realize that maintenance is part of retaining productivity.
It's not a loss of time if you manage to increase your productivity by a few percent by 'wasting' a couple hours doing something else.
View your sun exposure as a multiplier on your productive hours.

Try physical exercise. If you're still tired after the exercise, go take a nap.

Most of the time you won't be tired afterwards though.

then u no real programmer, bro. a true hacker shall be able to answer a sudden urge to code anywhere anytime.

Attached: mid_img_0632.jpg (675x900, 120K)

Use Haskell and Lisp.

Join a war. It'll give you something to do and pump up your adrenaline. There's always one on. Just ask America to join their army. They're always fighting somewhere.

Attached: vlcsnap-2019-05-02-19h11m32s464.png (624x480, 339K)

Start working out if you aren't already

does this fat fuck ever do anything without his computer

already do, doesn't help. I just pass out when I get home and sleep for 12 hours

Is /dpt/ filled with ripped girls who code?

>wagecuck
there's your problem

wagie

If the usual solutions like general healthy living are not enough and you still feel like you are tired constantly, you should go see a doctor.

Stallman is pretty autistic desu.
>Avoiding Boredom
>I hate being bored, and since I want to get a lot done, I don't like losing time. So I always carry a computer and a book. When I have a few minutes to wait and can sit down, I get work done. When I have to stand, or the wait isn't long enough to do anything useful on the computer, I read.
>When I wait for my baggage in an airport, I generally do one of these two things. I notice the people around me, waiting anxiously for their bags and getting nothing done. They would be happier if they did as I do.
>stallman.org/rms-lifestyle.html

I mean, nothing wrong with that
I absolutely despise waiting too

>I get work done
what does he even work on? I thought he was just being autistic for a living
it's not like he can run any programs on his computer

Whats the easiest way of making a C++ application multi-platform without writing basically 3 separate programs for win/mac/linux

Attached: 1543331741266.jpg (960x958, 215K)

I wanted to build a Linux/BSD/macOS generic networking library for Python
But to achieve that in pure Python I need to build a Netlink library
So now I'm building another serialization/deserialization framework for that Netlink library
The rabbit hole goes deeper and deeper

Attached: alice02a.jpg (200x306, 28K)

Have an abstraction layer for the platform.
Don't have leaks.

Write portable code.
Also, don't write C++: it's a complete garbage language.

Tell me about R-trees

Attached: furanime.gif (480x267, 3.63M)

Follow defined behaviors from the standard. Isolate platform specific features and access them from a uniform interface.

Consider if you've masturbated too much.

don't use platform specific code
use cross platform libraries for platform specific functions like windowing

>Also, don't write C++: it's a complete garbage language.
t. ctard

pseudoscience plz go

This.

General stuff to get your body in order:

>15 minute general workout daily. Twice would be optimal. Just basic strengthening exercises for people who sit on their ass a lot.
>Regular sleep schedule. Maintain it on weekends.
>Go cold turkey on caffeine. You'll feel like shit for up to 4-5 days (like you have a fever if you're a heavy user), but withdrawal symptoms completely disappear in less than 2 weeks for caffeine.

Do that for two weeks. See if it helps.

>pseudoscience
You think too highly of me.
Anecdotal evidence.

desu testosterone highs aren't useful for someone who has to work with their brain. They do help get motivated though.

2-3 times a day, not that much

>testosterone highs
Don't even care.
If I masturbate more than ~4 hours in a row the very next day I feel like shit in the mornings and it can linger for a long ass time.
Seems reasonable.

Masturbating too much may result in a zinc shortage, which results feeling tired.

>If I masturbate more than ~4 hours in a row
how does it take anyone 4 hours to get off

They're like B-trees, but in R^n. They subdivide a multidimensional space.

Dr. Richard M. Stallman is the mastermind behind the GNU project. Have some respect.

Attached: rms_block_your_path.jpg (3072x2304, 1.31M)

gnu is deprecated.

You masturbate to generative art you've made yourself silly.

Also you do it multiple times.

Met him in person, and he has definitely some kind autism. He is highly functional, though. But don't ever get into a debate with him.

>some kind of autism. He is highly functional
if only there were some sort of phrase for this

>He is highly functional, though
doubt

I guess I'm too stupid to understand what any of that means.

I'm so excited for cpp modules

Attached: 1550909969914.gif (580x518, 1.61M)

>sleep for 12 hours
Burnout? I once read it happens to every second person in the IT industry. Every fourth develops some kind of mental illness through the stress.

by 2250 C++ might be a respectable 21st century language

Can we finally admit numpy is a very goofy name?

Why

why are they better than just #include-ing stuff

Flutter or React Native and why?

I am also looking forward to C++ modules.

Elm. Flutter is google botnet. React Native is facebook botnet.

Sure, now come up with a better name and a logo.

Because you don't have to write headers all over again
Because you have better encapsulation
Because they're theoretically faster

It is a kind of complex subject. Too complex to explain it in one or two posts. You subdivide a mulidimensional space into subspaces and traverse through them via a tree.

Like when you sort or search words that are ordered alphabetically, you can use a binary tree to do that. Now imagine sorting and searching buildings in 3D. That's where you start using R^3 trees.

top kek. I usually go to sleep at ~2 am and wake up at ~8 am. if i go to bed sooner, i can't sleep. When i wake up, i feel really tired a few minutes but no more after that. but, if i eat something heavy, i then feel a sudden urge to sleep. this is the secret to remain awake: don't eat.

By 2250, the C++ standard will fill ten phone book sized books and be so baroque nobody on earth understands it completely.

sounds great for new projects then

gnupy

>be so baroque nobody on earth understands it completely
It's already like that.

but how do you decide how to divide the space? bsp and kd-trees have clear rules. R-trees appear wishy washy

is C++ the new scholasticism?

But I understand C++.

Is there a vim plugin to help with matching (((parenthesis)))?

yes, it's called visual studio code

I'm not.
bfgroup.github.io/cpp_tooling_stats/modules/modules_perf_P1441R0.html

Attached: file.png (1080x1496, 133K)

Attached: 7a2.jpg (960x540, 107K)

actually, it's called VSCodium

I'm not sure, but I think an R-tree doesn't divide space, it stores all nodes with the minimal surrounding box of their objects in the subtree that represent the subspace they belong in. So what you get in a node might overlap eachother.

>implying you'll work on large projects

>Literally just blocks rather than speculatively compiling aka the same thing header builds do
Retard implementation gets retard performance, what's your point?

chelate

>tfw that one bug that happens once and you spend an hour debugging it, then all of a sudden it disappears

Attached: 1523808333699.jpg (2048x1536, 567K)

just use c# jesus christ

cringed and bluepilled
fuck off to >>>reddit

already do, I hate it

>My text editor shouldn't work for me, I should work for my text editor!

then why do you want c++ to turn into low rent c#?

brainlets unironically think like this though
they think having to configure things and fuck around to get them working makes them smart