/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

(I apologise for not using an anime image.)

Previous Thread:

Other urls found in this thread:

stackoverflow.com/questions/8859394/c11-thread-h-in-gcc
github.com/jtsiomb/c11threads
github.com/jtsiomb
nuclear.mutantstargoat.com/articles/kerneldev/index.en.html
twitter.com/NSFWRedditImage

First for D

what's a monad?

Anything described by that diagram

How do I into monads?

>Being this careless

Sup Forums.g->current_dpt->next = NULL;


/dpt/s form a linked list. Please be careful when changing the current node! You don't want people trying to get undefined behaviour when trying to access the next (inexistant) thread.

>/dpt/s form a linked list
False, the chain has been broken, bisected and interleaved many times.

What's a good resource that will help me reach the next level? Been studying Python, working through some textbooks, codewars.

Some website or general resource that will bring me ascendance...

Still at the basics, but grasping em'. Very motivated and I enjoy practicing.
Share suggestions and advice.

Some online community I could be a part of and contribute to is especially something I'm interested in.

>not using an anime image
I hope animefags will boycott this thread. We could finally have some quality here.

Students/those who aren't working yet, have you made any money from programming?

Yes. By teaching younger students programming.

>next level
>from Python
Visual Basic?

Stop trying to derail the thread

No

The legitimate /dpt/s form a linked list. The mods work in the background thread linking all the broken links.

>not asking the unicorn to summon you a shelf
Haskell wins again.

Caught red handed. You non-animefags are smart after all.

The mods are the garbage collectors who free any illegitimate thread (any thread that is not linked by another node)

That's only one of their functions, and, truth be told, it's not fair to ignore the janitor daemons who invoke the mods.

Lol, by next level I mean keeping the shelf hanging.

Working on a screen saver/locker in Rust, because I'm bored and I don't really like xscreensaver.

Trying to figure out a better way to implement the locker/saver process separation that xscreensaver does without resorting back to passing a Drawable XID to the process.

I'm most likely going to end up using GLX_EXT_import_context or an OpenGL ES alternative if I can find one.

I am trying to do some simple stuff in OpenCV but it's not working out.
Essentially I want to create a video where a circle is "moving" on a parabola. So far so good, that works. The circle should have a trail of circles, that works as well.
What doesn't work is, I want the trail in alphatest_alpha.mpeg to fade using alpha blending. The OpenCV doc says to give the alpha value as the fourth element of the color tuple, but as you can see all the circles are completely opaque despite having different alpha values. What is going on?


import cv2
import numpy as np

# how many frames should the trail be long (at most)?
bufflength = 20

# properties of output video files
fourcc = cv2.cv.CV_FOURCC('M','P','E','G')
outfile_repo = '/home/blockus/dev/notebooks/alphatest/'
outfile_name = 'alphatest'
outfile_mime = '.mpeg'
outvid_fps = 25
outvid_size = (640, 480)
outvid_simple = cv2.VideoWriter(outfile_repo + outfile_name + '_simple' + outfile_mime, fourcc, outvid_fps, outvid_size)
outvid_alpha = cv2.VideoWriter(outfile_repo + outfile_name + '_alpha' + outfile_mime, fourcc, outvid_fps, outvid_size)

# define marker positions
markerpos = []
for x in range(81):
markerpos.append((x + 320, int(np.floor(x * x / 10))))

(1/2)

(2/2)

for ptidx in range(len(markerpos)):
# read previous point coords into array
framepoints = []
buffidx = 0
while ptidx - buffidx >= 0 and buffidx < bufflength:
framepoints.append(markerpos[ptidx - buffidx]) # listed in chronologically reverse order (left = most recent)
buffidx = buffidx + 1

# create blank images
img_simple = np.zeros((outvid_size[1], outvid_size[0], 3))
img_alpha = np.zeros((outvid_size[1], outvid_size[0], 3))

# draw points into images
for drawptidx in range(len(framepoints)):
cv2.circle(img_simple, framepoints[drawptidx], 5, (0, 0, 255), -1)
cv2.circle(img_alpha, framepoints[drawptidx], 5, (0, 0, 255, drawptidx * 25), -1)

# turn img_alpha into 3-channel image by merging alpha channel

# convert data type and write to video
img_simple = img_simple.astype('u1')
outvid_simple.write(img_simple)
img_alpha = img_alpha.astype('u1')
outvid_alpha.write(img_alpha)

In case you're looking for an answer here, I answered to you in the old thread:

I replied in the old thread as well, but we can carry on in this one if you'd rather.

>C released in 1972
>OS still provides the build system
thanks dennis

What is wrong with that?

not portable

Howso?

I didn't see this message of yours in time and replied there again (), but that's the last time I post in the old thread.

Even so, on average you would have to send more data per message. Perhaps less than a bit less, but less nonetheless.

>Perhaps less than a bit less, but less nonetheless.
Fuck, I meant
"Perhaps more by less than a bit, but more nonetheless."

Anyone know of a tool for generating documentation for Java Hibernate webservices? Not javadocs, I mean something that I can configure to list out the services, their parameters, and the list of their possible responses.

K&R C programming. Alternatively SICP.

So I've been using make on some smaller projects, and it's been working fine, but would any of you recommend a different system?

shit advice, he wants to move forward not backwards

I just got around to reading your post now

But I thought that even when the size of the message doesn't matter, compressing it before encrypting it could still subject it to exploits like CRIME

Anyway, after thinking for a bit longer, I see no way of compression + encryption being both useless and secure, so I think I'll abandon the idea and just use padding + encryption. Thanks for all the help.

Checkout tup and its rationale. Make lets you be wrong and miss a dependency, thus not rebuilding enough and causing bugs. It is also slow on big enough stuff. Tup is better, and language-specific kludges are taking ideas from it rn.

>useless
useful*

bump

What should I write? What kind of projects should I start?

If you happen to run across these problematic questions or someone in your family needs a trauma kit please visit:

www.senka.com

~Together against the elements.

~

Syntax already looks a lot cleaner than Make, I like it

Did anyone here write a login display or how do they call it for any Linux based operating systems? Did you just rewrite some of the code or did you write fron scratch?


Can I make a simple gui app that passes the username and password to the actual manager while it is not showing in the backround just my app?

>excel
literally one of the most useless applications made

>using a display manager
lol why

...

Everyyyyyybuuuddyyyy huuuuurts

>le euporia meme
Nothing in the office suit has any use at all.

> office
> Basement
Pick one

If I seriously had to choose I would pick basement.

Okay guys, in C++ what is better, a static class, a namespace or a singleton?

You are edgy.

No

Depends

this is nice thread.
post fizzbuzz please.

>winfag calling people edgy

A monoid in the category of endofunctors

Do I work if I'm not officially employed?

Can someone redpill me on IP addresses?

I want to build something simillar to Shodan's web crawler, which I assume just brute forces IPs to find non-website servers

Making a requests bot in python to brute force a password, but I'm not patient enough...
Is there a way to make it more efficient? Currently what I am doing is:
req=requests.post(url, data={"username":username,"password":str(pssw)})
if check(req):
return pssw
#check() checks title through lxml.html and xpath to see if it's the same with a failed attempt

loops through pssw for an 8 digits code. It's slow and I am wondering if there's a better way.
Downloading the whole page seems bad to me, let alone how noobish checking the title for confirmation seems to me, but since even if it's the wrong password it returns repsonse 200, I can't think of any other way. Suggestions?
PS:Dunno if I have to say that due to Sup Forums's rules, but it's nothing illegal as far as I know for this site.

You work if you derive an income from your labour.

pregenerate the combinations in chunks
use multiproces/aiohttp

repost

>brute forcing across the Internet
Consider suicide senpai.

Otherwise send hundred or thousands of requests at a time as many as you network can support.

You have been visited by the crossdressing C programmer of Shimoshina Academy!

Good performance, triple indirection, and tail call optimization will come to you, but only if you post "Keep overflowing the stack, Hime!" in this thread.

C stands for cemetry cause no one just old fags use it. The nowadays devs only use that outdated shite cause they are too lazy to develope new more efficient systems and they are just maintaining the old world's misery.

>C stands for cemetry

Holy shit! C users on suicide watch!

Do you developed a program (small or big) that you use everyday? If yes what does it do?

Searching for ideas. I don't have any problems besides autism to fix.

More like One Slow Gay Trap Prick #gotem

> C stands for cemetry
Well done

This.

Upvoted :^>

C stands for not Cludadwy

Keep overflowing the stack, Hime!

>can't get out of bed

Help

This

Actually, C stands for Cuckoldry.

C stands for chemotherapy

C USERS ON SUICIDE WATCH 24/7

Keep overflowing the stack, Hime!goto considered harmful

Overflow my stack with your semen Hime-kun.

Do you guys suffer from occasional back pain?

Often I don't watch myself at work and I work straight for 5-6 hours and my back goes kind of numb. I wouldn't call it pain but it is uncomfortable.

Also I have developed scoliosis during my childhood but is does not affect me at all just the knowledge taunts me that I have it.

Wow you're right, guess I'm a #JavaDrinker now, really makes you think

I used to sit bent over on my chair which caused back pain. Now I sit properly and the pain has gone.

>sitting properly on a chair
>ever

Stupid question.

I have 2 sets of 48 million 16-bit integers that I need to perform an operation on.

The operation is: set1[n] = (set1[n] & 0xFFF0) | (set2[n] >> 12)


Would it make sense to somehow use OpenCL to do this faster, or is it not possible? I understand if you wanted to sum up 48 million numbers, then you'd just have to read the one answer and that's it. But here, I have to perform 48 million assignments, and that means moving a lot of data around. Anyone know?

Anyone have a link to the instructor's manual for CLRS 3rd edition?

Yes, through gsoc

How much?

What the hell is wrong with glibc? Apparently the developers don't have plans of implementing threads.h because it's "optional".

I'm no expert, but the problem looks IO bound, and OpenCL shouldn't help with that.

proof?
by the way, musl supports it and there are many wrappers on top of pthreads.

>clang
Lol retard

According to the comments here: stackoverflow.com/questions/8859394/c11-thread-h-in-gcc

That's interesting
I found this if you want to give it a gander
github.com/jtsiomb/c11threads

There is one more based on pthreads and two more based on winthreads.

When I asked for proof I meant the
>Apparently the developers don't have plans of implementing threads.h because it's "optional".

>There is one more based on pthreads and two more based on winthreads.
Yeah, but how can you say no to a neckbeard like this?
github.com/jtsiomb

I really like that guy actually, he is a fsf member with a fsf mail address and he even made a kernel for a GNU/Linux magazine nuclear.mutantstargoat.com/articles/kerneldev/index.en.html

>SDL2
What's the best way to move a bunch of pixels to the screen. I have a tiny 160x144 4-color 'screen' in my code and want to upscale it to a 1600x1440 window efficiently, preferably without a bunch of platform-specific code that depends on the exact format of the framebuffer.

That magazine actually looks pretty interesting, damn shame I stopped learning Greek a while ago.

>What is POSIX threads