/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1525815827123.png (615x597, 301K)

Other urls found in this thread:

kiwiirc.com/client/irc.rizon.net?channels=#Jow
github.com/forbjok/chandler2
github.com/AppImage/AppImageKit
docs.microsoft.com/en-us/cpp/standard-library/basic-ifstream-class#open
en.wikipedia.org/wiki/Low-level_programming_language
github.com/JohannesBuchner/imagehash
twitter.com/SFWRedditGifs

Hello friend

Attached: longlongpoo.jpg (475x767, 48K)

Reminder to use AppImages, it makes easy the work of distributing software to various Linux distros.

Attached: appImage.png (720x340, 290K)

IRC Shill

kiwiirc.com/client/irc.rizon.net?channels=#Jow Forumsdpt

Is that the Error screen from DDLC?

Writing a keyboard driver for my self built keyboard board in C.
I started sleeping without underwear because it feel fresher than when sleeping with underwear, now the thing is, I don't know if it's my mind but I feel like there's a weird odor in the environment, has the faintest traces of ass smell. Is it possible that now that I am without underwear, a bit of butt odor leaks out of my pants or it is just my mind playing with me?

will do in the universe where i actually finish something

what the FUCK is wrong with ripme it's only pulling 93 images from instagram accounts with hundreds of images

trash program

why would you download photos from instagram user

you arent doing creepy thing are you

of course i am

I was going to say you should try fix it but then I realized it was written in Java and eww

yeah same thought here

rewrite it in something else

Attached: 1526876238879.jpg (402x604, 49K)

I'm trying to deploy an api to gcloud platform. It says successful, but instead of getting some juicy json when I got to the url I just get a page saying $END$.
I know it's not very specific but does anyone know what's going on? There's no errors, so I don't really know where to start debugging.

Which service?

I already have a Python script that can handle xhamster, pornsharing, Jow Forums, imgur and tumblr.

It is... in desperate need of refactoring.

I'm pretty new to this. What do you mean by service my friend?

Attached: bert strips big bird.png (400x357, 213K)

Exploring Postgres encodings

Attached: Screen Shot 2018-06-19 at 12.48.12 AM.png (2880x1714, 625K)

anybody use build.particle.io for IoT stuff?
My raspberry pi won't execute my python script.

Including python script in next image.

Attached: particle.png (1437x769, 39K)

Attached: 4chan.png (552x254, 9K)

this is the bash script to summon the python script since I don't know if you can summon a python script in the particle IDE, but the API said you could use a bash script

Attached: 4chan2.png (385x49, 3K)

>summon
Try casting magic missile

So im trying to implement a compiler using roslyn. i want to kms but i must finish this project. i wont forgive myself if i dont.

Attached: monster wojak.png (779x900, 1015K)

editing bunny and powershell scripts to enable smb1 on w10 machines but got slammed after realizing it requires a restart

I'm having trouble writing integers to binary and reading them back.
The program does write 40 integers to the file (I checked it with a hex editor), but it only reads back 25, it encounters eof right after the 25th integer.

fstream file;

file.open("file.bin", ios::out, ios::binary);

if (file.is_open()){
for (int i = 1; i

Attached: 0.png (959x420, 10K)

what language would you use to run samus' suit

Attached: 1529318106856.png (777x595, 724K)

Japanese

Deciding on a Java framework

>if (
>for (
>while (
Remove those spaces, it makes the compiler use a more low level implementation that runs faster

Ok, but how does that fix my problem?

Framework for what?

is long long justified though?

how can you trust that shit tho?
why is it not a botnet?

>can't even program in Java
classic /dpt/

It's not that we can't - it's that we won't

Trying to get this to work, but dlang is not playing nice with curl any more.

github.com/forbjok/chandler2

I don't know jack about D, but it seems really strange for the standard network library in D to stop working with libcurl.dll entirely.

Sidebar: also recovering from a week-long company retreat. I hate engineers* one-upping one another and getting more and more pedantic. It reached "hem hem, what you ACTUALLY MEAN is GNU/LINUX" levels by Tuesday.

* I've noticed the engineers who emphasize their precision and code competence in casual conversation are not precise or code-competent.

Attached: me right now.jpg (960x858, 77K)

github.com/AppImage/AppImageKit

> AppImages
So we're okay with binaries now? Blobs? Just blobs blobbing everywhere with crufty code?

Just kidding, I don't give a shit, really.

What's wrong with binaries exactly?

Works fine for me with g++. I had to change things to std::fstream to make it compile though.

Honestly, nothing, but I know several engineers who are 100% freetards. They want everything built from source with no commercial licenses. They bring company meetings to an ass-grinding halt every time Legal mentions, I don't know, selling our product. How fucking dare we come up with ways to pay ourselves that might involve laywers and money.

I strongly suspect most of them just can't figure out how to trace errors outside of an IDE.

If you're one of those people who want to build everything from source, why would you care about packages in the first place?

but as a user of the software packaged by this shit, how can you be sure it's not botnet what you download?

what security guarantees are there?

look at the youtube-dl source if you want some inspo
i have a script similar to yours and it's a mess but youtube-dl gave me ideas to clean it up

Because they can bitch about it and make people feel small for not being "about freedom," honestly. Never, ever let someone sell you on "free as in freedom" code without asking exactly how they themselves hope to solve the issue. If they haven't so much as tried to replace a "totally draconian and useless commercial blob, spluh" with their own code since grad school, they're not worth listening to.

I tried compiling it with Microsoft Visual C++ and it broke in the way you showed. How strange.

Anyway, change ios::out, ios::binary and ios::in, ios::binary to ios::out | ios::binary and ios::in | ios::binary.

Thanks a lot, my man, it worked now!
But why did it happen in the first place, is it microsoft's fault?

Attached: 32033475328.jpg (669x767, 75K)

How to print literal \n (LF) to fstream in windows?
I'm making an dosunix line ending converter but using std::ofstream::write() keeps printing \n as CRLF

docs.microsoft.com/en-us/cpp/standard-library/basic-ifstream-class#open

It seems like you accidentally gave it three arguments instead of two. So your ios::binary was being passed to _Prot when it should have been part of _Mode. Presumably that was enough to mess it up.

Using x, y will cause x and y to be passed as two separate arguments. Using x | y will cause x and y to be ORed against each other (which combines them together) and passed as one argument.

Javascript

Hey all, I'm currently trying to work through this Kata in Javascript which is pretty low level. I'm trying to understand what is going on with the second map here. Would someone mind explaining to me why this solution works and if there is a better way of going about it?

Thanks in advance!

Attached: Screen Shot 2018-06-19 at 2.21.57 AM.jpg (873x519, 63K)

>what security guarantees are there?
The same as the torrents you download.
what kind of question is that?

Forgot to mention, the result I want back is:

result: "USA, BRA, UAE, JPN, PHL"

Which is working. I'm just trying to understand how based on this solution and if there is a better way to write it out.

>accidentally
I'm sure I just copied a code snippet from somewhere without checking the documentation, I don't even remember from where I got this code.
I just checked cplusplus.com and they also say to use two arguments separated by | instead of three arguments separated by a comma. I do admit that I was the one at fault here for being a lazy fuck though.
Thanks again, user.

Attached: 325137.jpg (600x788, 87K)

How does it compares to Snap?

>Javascript
>pretty low level

check the definition en.wikipedia.org/wiki/Low-level_programming_language

I meant the kata was low level.

even torrents have hashes, if it's a distro you can verify it

but what the fuck are you downloading when you're downloading an AppImage? it's better to just clone and compile the raw software, no?

Im phone posting but you can consoke log every step od execution to see whats going on for youseld. And that font is horible is that = == ===?

It's ===

Sorry, I'm using Firacode which has ligature support.

It's an error screen from any Ren'Py game, and that's includes DDLC. Also, that's Monika from DDLC on the picture.

Kek this guy. He's pretending he doesn't know I only want the NH adapter because it's the only packet injecting compatible adapter, what a cute funny guy.

Attached: Screenshot_20180619-170210.jpg (2168x1738, 521K)

>* I've noticed the engineers who emphasize their precision and code competence in casual conversation are not precise or code-competent.
Until you meet someone who can't be more preciser or code-competent. You'll hate those the most, because you can't really say anything against them, they're untouchable, unattainable gods.

Ada, like all other military things.

Don't listen to him, removing spaces does absolutely nothing to the performance. He's just trolling you. Some people just don't like that style.

do x

>pair
>mutable array
lmao

How do I pronounce JSON irl without sounding like an idiot- spell it? Or Jason?

It will read the file once into x
In lazy IO, it just means that the read is done line by line as it's used or something like that

jay-saun

In fact monads aren't really the problem here.
The question is a bit ambiguous though, if you mean

action = do
x

Is that really what people say?

What would you like to say?

I'd like to spell it but don't want to sound like a brainlet to my webdev friends

Like "Jason." Watch programming talks if you don't know how to pronounce terminology and don't want to embarrass yourself irl.

Really confused if i should use Matlab or Python. I'm doing calculus 3 and need something to visualize functions. Matlab does it well, but i want to try python too. Is there anything similar in Python to plot graphs and functions? (In 3d)

The rest of the code is pure. It looks like something like that.
funcs >= return . map parseInstruction
print $ foldl (\x _ -> foldr ($) x funcs) input [1..100]

So yeah, it's one action (print) but it is used multiple times with the fold.

Hey guys, can I plan on using react and realm db to create a "chat app", that can be plugged on any site (ex. button on the bottom, opens a large chat window when clicked). Since I'm a newb, can anyone give me a good source for learning React and tell me, If I'll be able to deploy that react app as a single JS file and use it on my site?

Wolfram could probaly do it, or mathematica

>Really confused if i should use Matlab or Python. I'm doing calculus 3 and need something to visualize functions. Matlab does it well, but i want to try python too. Is there anything similar in Python to plot graphs and functions? (In 3d)

I haven't used Matlab too much, we use primarily Mathematica in my uni, but I can't imagine using Python instead of Mathematica if I just want something to do some fast visualisations.

But hey, why not try both and see which one you prefer? Google seems to suggest VTK and numpy in combination.

>Wolfram could probaly do it, or mathematica
Stephen Wolfram is actually such a boss

React unlike literaly every other new js thing has really good documentation on their site so go and read it. And ffs learn js properly before jumping into libraries and frameworks, i have to interview people for front end and i see so many retards its horrible. Show me example of memory leak in js? Muuuh duur js cant leak memory...

readFile will be done once
btw
x >>= return . f
is
fmap f x
or
f x

I forgot, thx.
Too much abstractions at once for my little brain!

i NEED to fucking program right now
but I'm missing ideas
can be crazy, yet small but have to be a nice challenge as well

Attached: valeriy_orlov_01.jpg (1178x662, 354K)

Tv show organizer e.g FooS02E3eztv.mp4 will go into folder season 2, episode 3. Make it automatic for entire dir

Something like an image utility tool. Duplicate image and file finder with preview, image enhancer (like waifu2x), more functionalities like basic image editing later on.

Thanks!
Is most of Wolfram/mathematica free? What do i miss without the subscription?

>FooS02E3eztv.mp4
>instead of
>[Group] Series name - 00 [extra info][hash].mkv
Pleb

I jus woke up so that may be it. But i have no idea what you mean with that, give me example? Also directory trees ftw!

high level faggotry
is it so hard to discuss programming without disclosing about yourself something so disgusting and appalling? are you doing it for attention?

Mathematica is like Matlab, you gotta pay. If you're at uni there's a good chance you can get a student license so definitely look that up.

WolframAlpha is pretty much entirely free for your purposes. Pretty much the only thing that's behind a paywall afaik is if you have it solve an equation and want to see how it solved it you need to pay.

does it need to justify itself to you? fuck off pencil dick

projecteuler or reddit.com/r/dailyprogrammer

I'm saying that only shitty western releases use seriesS00E00group,mp4.
I gave you the typical anime naming scheme.

>having same variable name as a primitive data type

Attached: only the dead can know peace.jpg (500x490, 41K)

Oooh indeed you have, i somehow thought thats how you want to organize files.

here you go (kind of)
import os
import sys
import shutil
endings = ["mp4"]

if len(sys.argv) < 2:
print("Missing path argument")
print("Usage: org.py ")
exit(1)

root = sys.argv[1]
files = os.listdir(root)

for name in files:
if not any([name.endswith("."+ending) for ending in endings]):
continue
match = re.search(r".*?S(\d\d?).*?E(\d\d?).*", "testS4E4.mp4")
fullpath = os.path.join(root, name)
ending = name.rsplit(".", 1)[-1]
if match is not None:
season = match.group(1)
episode = match.group(2)
os.mkdir(os.path.join(root, "S"+season))
shutil.move(fullpath, os.path.join(root, "S"+season, episode+"."+ending))

Attached: programming challenges.png (1450x1080, 596K)

bonus: v4 (little bit harder)

Attached: programming challenges4.png (3840x2160, 1.61M)

former would be possible with perceptual hashes github.com/JohannesBuchner/imagehash
image enhancer, not sure. there are neural networks that do this, but I don't have a sufficiently good GPU