/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

imagemagick.org/Usage/compare/
imagemagick.org/script/api.php
visipics.info/
stackoverflow.com/questions/2291802/is-there-a-c-iterator-that-can-iterate-over-a-file-line-by-line
hydrusnetwork.github.io/hydrus/
root.cern.ch/cling
twitter.com/SFWRedditImages

first for C++

Kill yourself, and delete this shit, you degenerate reddit memester.

Every post should be accompanied with a signature detailing the domain you're working in/considering relevant for the post and what you're preferred language is overall.

Sepples a shit, but also the least shit at what it does

No, I would argue that C++ is one of the best languages for generating horrible code.
It's all its good for.

Just get yourself a tripcode and keep blogposting about your life and favorite programming language, you'll fit right in.

It'll also allow people who don't want to deal with his shit to just filter him.

I want to be an astronaut(currently NEET) and my favorite language is vbscript.

Agreed
-FizzBuzz Technology, Rust

Yes, you should also be able to give a + or - to post and once post has too many minuses it will hidden automatically.
Every user should also be required to include valid phone number in their account.
Moderators should also delete post that are against Rust's CoC.

I just think most of our discussions here are ruined by the fact that people don't share goals. We could have much more interesting discussions if we either took a high level approach to programming or made it clear what were considering.
Yeah yeah very funny. Just keep it in mind the next time you see people acting like apes in here.

any no_std rust man in

>he keeps coming here just to demand that this site has to be made work exactly like reddit

rust's CoCk (feminine)

I don't know much of reddit. I really thought they just had usernames and some kind of score associated with users to determine how visible they are.
I didn't know they had some sort of biographical format associated with each post.
Maybe I should actually go there.

You could also try to figure out why so many people post here when all our names are displayed as !LightPenis.

You might actually be happier there, honestly. Sup Forums is a lot more... informal a platform.

Every post should by an image of your dentistry degree to show your qualifications.

I'm not new to Sup Forums or Sup Forums. I'm just saying we should aspire for more effective communication and I feel I've detected a problematic trend.
Maybe most of you like the rowdy nature of conversation here but I'm pretty sick of it when it comes to programming. I don't view it as a casual topic I guess. It's pretty serious to me.

...

>It's pretty serious to me
You are not even close to being in the right place.

what programming language is this

It's C, has a few syntax errors in it though.

Yeah, I'm not telling you to go to reddit as an insult or something. I'm legitimately saying that based on what you want, you're more likely to find what you're looking for in some subreddit with a bunch of like-minded individuals.

I don't mind, and I'm sure most others here don't, if you or someone else says where they come from and where they're going on a professional level to give context to the conversation, but to have it baked-into the person's every post is just not how Sup Forums is structured. Like another guy said above, you could just use a tripcode, but you have to be really responsible with your use of tripcodes if you don't want people to give you shit over it.

Sup Forums isn't my main board. /k/ is. On there, I have a tripcode I use for specific topics in specific threads and the rest of the time I go without because it's just not applicable and only serves as a distraction. If you do it right, you'll be one of the tripfags who doesn't show up in the "name the tripfag you [blank] most" threads that show up on every board, but people in the threads where it's actually relevant will ask "Anyone know what happened to [your name]?" if you haven't posted in a while.

The only thing I really think boards lack are poster ID's (like on Sup Forums, for instance), since large conversations with multiple people can become confusing and posts can be misattributed to one person or another, creating chaos.

Human "intelligence" is based on too many factors to effectively emulate in modern technology. You have self-awareness, you have the cultural element that defines social interactions, you have the social interactions themselves (including learning about history and ancestry), you have the biological/genetic element, the primal reward/pain system, and maybe some other shit I don't know about.

Starting with something like dog intelligence would be much more feasible. Genetics would have to be ignored since evolution takes place en masse, and providing motivation through rewards and pain would be relatively simple. But you'd still have to tackle the issue of self-awareness.

Thank you sci-fi AI guy for your post. It was truely enlightening.

Most other places I know are focused on details. I don't know many good general programming forums. Design talk is especially rare.
I also find the blend of novice and ok programmers pleasing. Also the anonymity is pretty important because I've had people chasing me. Which is easily solved by new accounts all the time but even something as simple as post count seems to have people act like they're superior.
>it's not an insult
I didn't take it as such. It just looked like you thought I was new, so I gave context (in accordance with my previously stated idea about the quality of discussion here). I should probably have clarified though.
>reddit
Is that really the best place though? I'll have to check it out but from what I've seen they've got a less serious approach to programming than /dpt/. They mainly make jokes tangential to the topics. I'd need to filter it. Also they're more slow phased. It's not like having a conversation.
>IDs
Yeah they might help. I don't really miss them as I tend to treat posts individually unless there's a pretty clear chain.

A few things.

I have a bot for iMessage that's running in a few group texts with friends. It can do quite a few things: identify things in images, search things on wikipedia, imgur, and wolframalpha. It can also tell me my uptime and load averages. Today I added support for searching urbandictionary. In the future I want to be able to play group text-based adventure games. I figure the easiest thing to start off would be some sort of lottery system though.

Other thing is a sentiment analysis system for cryptocurrencies. I made one already for twitter, but it's not async or anything, and it's honestly not that useful due to a lot of spam advertising. I would much rather see what /biz/ is freaking out about. So I made a simple wrapper for the Sup Forums api, and I plan on setting up the code that will calculate the delta between my current DB and what's in the catalog every 5 minutes sometime soon.

I also have been working on a program to make mosaics out of anime girl photos for a while. I've been wanting to use genetic algorithms to minimize the number of repeated images and stuff to make it look better, but haven't gotten that far yet. I'm hoping at the least to transform it into a simple webapp soon so that I can put the domain I bought for it to use soon.

Whether reddit is the best for your particular wants/needs or not, I don't know. It really comes down to the specific subreddit. It's not like /dpt/ is its own board, either. I'm sure there are large swaths of Sup Forums that you never set your proverbial foot in they just don't interest you (if not actively disgust).

From where I'm sitting, it kinda seems like you're stuck between choosing a community of smart people who pretend to be dumb for shiggles or of dumb people trying to be smart.

What language should I learn if I want to programme something to process data (stock prices, data of public companies) to filter out more favorable investment opportunities. The data can be taken online from free sites if that's possible; prices would have a 15 mins delay but I wouldn't mind.
I have taken intro to JavaScript in uni (not my major). A friend mentioned R, MatLab, Python, SAS are more suitable for data analytics.
Thanks in advance Sup Forums!

Isn't the big meme right now to make neural networks for that shit?

Python is a good start just because so many people use it.

How do you guys deal with programming induced insomnia

Like I legit can't close my bloody eyes after ten hours of problem solving, mind's racing like a bitch

Programming newfaggot here, only know python.
I'm currently considering making a program that takes an image, compares its pixel positions and colours and identifies if its similar to the image presented.
The purpose behind this is that I have over 15000 images in my Sup Forums folder, and roughly 70% of them are unorganized. So I'd present the program a base image in which it would find similar images like it and move them to the specified folder for that image.
Take Shinobou from monogatari for example, she has a unique hair color and hairstyles, so if I could get the program to recognize other Shinobou images within a margin of error it would be a lifesaver.
Is this possible?
Or is it too broad as in the program wouldn't actually be able to tell the images apart (specially if they have different resolutions, then would overall color % make more sense?).
Any comments would be appreciated.

I'd go with Python. A lot of people in finance were using R, but with the machine learning craze, everything is going toward Python. It's also ezpz to learn.

I'd look into requests+beautifulsoup tutorials for scraping the data from websites, and pandas for manipulating the data (think excel). As for the financial calculations and whatnot, I use TAlib, however I'm not a pro so there might be something better.

If you do the more machine-learning route instead of TA, scikit-learn is very powerful and forgiving.

If you're anything like me, then you wouldn't be able to sleep even if you didn't work on it because the second your head hits the pillow your brain will try to solve the problem anyway.

Do some exercise, take a bath, take sublingual melatonin tablets, drink some mint or chamomile tea, do breathing exercises/meditation... I don't know, man. Whatever works for you.

>data analytics
What your friend is talking about is the availability of framework collections like anaconda (notably pandas, scipy plotting tools etc).
It's not a bad choice for what you have in mind. Pandas can read csv, json and more which is covering a large chunk of the apis you're gonna fetch your data from.
But having used them they're absolutely atrocious at documentation. I imagine there's a reliance on courses/books to introduce you to them but what I found (2 years ago) was not very helpful for my purposes at least.
I do find them quite easy to use once you're past that. I've only worked with that stuff in python. Can't comment on the matlab/R/SAS side.
Yes that's the big meme indeed. Especially for something like this where you have super clear success/failures (net profit/loss) based on very simple decisions (buy/sell).
I haven't tried it but I doubt micro trading is gonna be competitive for a hobbyist given the high performance requirements. For investment I'm guessing you could probably beat brokers just by virtue of their fees. Not in actual performance though.
Certainly this aswell.

how does std::queue not have std::queue::clear

Maybe, I don't know desu, but there is a really large gap between developed and developing countries (like where I'm from)

Thanks :))))

What should I start reading and practicing to make bots and hacks for video games?

Lua and C I'm guessing?

>Functions in COM that return structs have incorrect behavior when called from the official Microsoft C bindings using the MSVC compiler.
oh no no no ouuughhh AHAHAHAAHAHAHAHA

how did you learn all of this

>COM
I'm so sorry my man. Why?

Good question. It's an adapter which supports std::list and std::deque as the underlying container, but both of them support clear so there's no reason for std::queue not to support it too. Maybe they didn't want to have requirements beyond that's really necessary.

d3d and wasapi

>is this possible
Yes automatic image categorization is done all the time. If you've got access to training data (category associated with an image. Consider places like gelbooru, they have extensive tags and freely available images) you can make a simple neural network if you're interested in that.
Just trying to make it work with an ad-hoc method is something that can be fun too certainly and it might help you understand the similarities of your images better. Depends on what you're interested in really. I think either method can give pleasing results.
If you're aiming to categorize relatively similar images I suggest you go with neural networks. Making a basic statistical method is just gonna be too finicky and takes a lot of effort. Consider the grouping of greenhaired anime girls vs specific greenhaired anime girls. Differentiating there is not simple. Especially not across a variety of drawing styles.

Thanks.

>couldnt figure out why script wasnt making a new folder
>the most basic part of the script has me pulling my hair out for 3 hours
>works perfectly fine if i type the path out yet somehow referencing it as a string makes it not work
>made sure i converted it to a string
>eons later realize it had a newline in the variable causing it to fail

shit like that makes me fucking hate programming

q = {}

...

why does ifstream file("file.txt");
cout

What did he mean by this?

Well. They're probably training on data that's predominantly hentai. With too few non-hentai anime examples.
It's just sloppy work.

isitporn.com is an example of computer vision for image sorting. It just has some pretty funny results sometimes.

>vbscript
kys

That, or you're seriously underestimating how much furry porn people are producing.

Also 82% isn't that high. Its not ideal but I imagine it frequents close to 100% on actual hentai.
Valid option. My understanding of furry porn is that it's almost just anthropomorphic humans in exposing positions. Maybe a dick visible.

Take a quick glance at the catalog over on ...

I'd rather not. I'd rather be wrong here. The more wrong the better actually.

I learned Python from Charles Severance's "Python for Informatics" course. I don't like the layout of coursera so I just looked it up on google and watched it there. That was just the basics. From there I did a crap ton of webscraping projects because they were fun and easy.

For the sentiment analysis stuff, stanford's cs224d page has a lot of good info. If you don't care for NLP, CS231n has even better info on neural nets. Just fake it until you make it (or until you take linear algebra).

For the mosaic stuff, I used a kNN classifier once in a marble sorting machine, and figured it would be easy enough to apply this to mosaics. Turns out it was very easy. I don't actually know anything about genetic algorithms yet, though. Scikit-learn is really easy to use once you have a general idea of what each of the models do. That comes with reading. I recommend skimming the table of contents of "hands-on machine learning with scikit-learn & tensorflow" by Geron and looking up the topics on wikipedia.

Also, the Nando de Freitas machine learning playlist on youtube is VERY good. I only watched like the first 4 lectures or so before I got busy, though.

ImageMagick might be good enough for this, see imagemagick.org/Usage/compare/

it has python bindings too: imagemagick.org/script/api.php

here's an example of a program that uses ImageMagick to find similar images: visipics.info/
you could easily just use that to find similar images in your collection, it doesn't automatically sort into folders though, you have to do it manually

My guess: probably in retard++, file >> thing leaves our whitespace characters even if thing is a char. Don't know what the fix is rn can't be bothered to look up sry.

istreambuf_iterator is in fact what you want

Iostreams is a pointless mess. Hopefully you have an experienced tutor that has bothered to understand them well.
If I were you I'd search for it and find something like this (stackoverflow.com/questions/2291802/is-there-a-c-iterator-that-can-iterate-over-a-file-line-by-line the second answer) and just accept that as the solution.
I don't think that part of the standard deserves any respect.

The entire C++ standard is a fucking mess.

you're right, thanks, that works perfectly

// function argument
float *&foo
float* &foo
float*& foo

which one? fucking awkward language

first

float **foo, obviously.

Not all of it. But large parts yes. Iostreams piss me off especially because you can just look at so many basic examples that are better from other languages. Even if you consider their approaches slow/otherwise resource problematic there's no excuse to not have something that enables a basic C++ course (like with user here) to give the students a basic input introduction that doesn't have then run into confusing junk like this.
If I wanted to kill a language I'd write iostreams as is.

iostreams are actually really fucking simple once you spend 5 minutes learning about how they actually work.

Are there any C or C++ interpreters

also see hydrusnetwork.github.io/hydrus/
it's pretty much made for exactly that purpose (sorting Sup Forums folders)
it hashes all your images and checks them against how other users with the same images tagged them, it's pretty much a distributed booru
it's kind of buggy though, at least when I tried it

And what do they provide you with user? They're pointless. That's why I haven't learnt them. Not because they'd be hard to learn.
Like anyone with self respect I've made my own IO-abstraction.

Yes. You can search for them. I don't have opinions on that. Seems pretty pointless.
Not that user but thanks it looks interesting.

dude what

yes but they all suck, and they're all really just clang or gcc underneath

>they're pointless
>that's why i haven't learned them

you don't know what they do but according to you, they're pointless

how is that trump vote panning out?

Would be float *& x in my coding style

what the heck is a pointer reference

Rude. I'm not even American.
It's a fair point I guess. I'm only relying on what's been promised from people describing it at a high level. You can find better opinions from people who care about IO (like network people). But I find it reasonable to not try to learn everything and focus on more important things.

auto fn (int*&) {}

It's like a pointer pointer. Except it confuses people more because reference references isn't a thing.

Thanks

>what is rvalue references
brainlets everywhere

That's because you don't understand what a reference is and why "reference reference" is meaningless.

Not the same thing at all.
>you don't understand what a reference is
I do. What makes you say that? I'm saying it confuses people for some reason. It's my experience.
>reference reference is meaningless
Yes. That's why it's fine to have r-value references to take their place.
Doesn't change how C++ forces you to use pointers despite its reference construct.
>but pointers are necessary
On the platform level usually yes. But they're not required at a language level and you can make it zero cost (fo realz) to just have the reference syntax in C++ if you extend it a little.
That was my point.
Another example of a pretty half-assed feature.

>complaining about C++ the Glorious
>zero cost
Found the Rust user.

I mean, we agree about this. Rust does references better. References were only added to C++ for operator overloading, but there were better ways to solve that problem.

>rust user
I've been interested. But no, I don't learn a lot of languages for leisure.
Wow I really come off as a rust user?
What's so good about rust references? Genuinely curious. I wouldn't consider the basic proposal I made here to he noteworthy.

root.cern.ch/cling

>What's so good about rust references?
Nothing. Rust references are communism, and are awful like the rest of Rust.

What is "stable ABI"?
From what I understand from my google searches is that it enables you to link with libraries compiled with different versions of compiler.
So, if you compiled mylib.h using gcc 5.8 you should be able to link mylib.out with gcc 7.2.
Is this is the same reason why there are different c++ folders in the system?
/usr/include/c++/7.2/
/usr/include/c++/4.8/

>they suck
>theyre just clang/gcc underneath
What's the problem? I'm not that experienced with the interpreter environment but are you saying you can't hotload code in these?

...

>What is "stable ABI"?
A stable ABI is when the calling conventions and the way objects are represented in memory is well-documented and guaranteed not to change behind your back.

...

>rust references are communism
Is this just slurring both communism and rust at once or is there some insight?
Also user please level with me. Do you consider Rust genuinely politically problematic in a way that'd keep you away from it even if you like it? I'm not well informed on what they're about. Sup Forums would disagree with practically any official programming language community.

>anything I like is communism
Get the fuck out.