/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

old thread:

Other urls found in this thread:

claymath.org/millennium-problems/p-vs-np-problem
github.com/salsudano/place_visualizer
github.com/salsudano/place_visualizer/blob/master/place_visualization_gui/PlaceVisualizerForm.h#L189
msdn.microsoft.com/en-us/library/yk97tc08.aspx
twitter.com/SFWRedditGifs

Rust is the future of systems programming.

Apparently the ones in user's company aren't smart enough then.

Thank you for not using an anime image.

Idris is the future of applications programming.

they cant make time freezers soon enough then

My language is the future.

self taught coders are being oppressed by the white devil

gash-script.jpg

dynamic language users are being oppressed by static type zealots

fuck off yank

we don't even have flags here you're not supposed to be able to tell

Does Python have any redeeming features?

yeah it's easy for retards to learn

...

Is that really a good thing? Learning Python just makes it harder to learn better languages, because to do so you will first have to unlearn Python.

it's for non-serious people.

What's a good language for smart people, like yourself, to learn?

Your anger is adorable.

Not angry. Just curious. So?

This guy has no life and, to fill the void, has let himself to succumb to narcissism of small differences

Python's purpose is for building large systems that are not memory or CPU constrained. You would not want to use Python on an embedded device or something that was performance-critical, but for most applications including web app backends and scientific computing it is perfect. Indeed Python is appealing to untrained coders because of it's simple syntax, but you can write great functional code in Python using Map, Reduce, List comprehensions, Lambdas, etc. so it's worth a look.

Looks like we found the angry python script kiddie.

>Python's purpose is for building large systems that are not memory or CPU constrained.
CL is much better at that than Python.

You can do all of that in C++, Java, C#, etc and have good performance.

hello brainlet

...

Looks like we found the mouth breathing mongoloid.

I use python for rapid algorithm prototyping and scripting. I don't need performance for any of that.

Python users are quite touchy, aren't they?

I use CL for that

He probably failed SICP, don't be too hard on him.

I just recalled why I left Sup Forums and /dpt/ a few years ago. Some of you people are only happy insulting, trolling and just wasting people's time instead of giving insightful or constructive input. Almost every convo feels like a pointless struggle.

I'm out.

>CL is much better at that than Python.
Ok, you've got my attention - what is CL?

Common Lisp

There is no insightful or constructive input that can be given regarding shitlangs like Python and Go.

Don't come back.

I've been reading up on premultiplied alpha blending. I get the general idea but I don't see how you would convert a premultiplied pixel back to normal rgba. it's (rgb / a) obviously but that seems problematic when a=0.
redpill me please

I occasionally come back to check if the situation has improved. It hasn't. It's a worthless shithole, even worse than Plebbit.

Problem: For a string S of length N find the longest substring sub appearing exactly k times in S.
My program seems to work but it's awfully slow, even though this problem shouldn't be that hard.
Is there any better way to do it?
The string I've run it on in pic rel is the problem intro to the P = NP problem at claymath at length N = 1773.
claymath.org/millennium-problems/p-vs-np-problem
Code:
def longest_k_times(k, my_string):
"""
Finds the longest substring in my_string appearing exactly k times.
"""
tot_len = len(my_string)
curr_len = floor(tot_len / k) # maximal length of the substring.
found = False
checked = []
while not found and curr_len > 0:
sub_lst = find_all_n_subs(curr_len, my_string) # all possible substrings of my_string of length curr_len.
sub = sub_lst[0] # Current substring we're checking.
i = 0
while ((not sub_k_times_in_str2(sub, k, my_string, checked)) # We have not yet found the goal substring.
and i < len(sub_lst) - 1): # We're still looking at substrings of a certain length.
checked.append(sub)
i += 1
sub = sub_lst[i]
if i != len(sub_lst) - 1: # We found one appearing exactly k times of maximal length.
found = True
curr_len -= 1 # Look at substrings one less in length.
if found:
return sub
else:
return None


def find_all_n_subs(length, string):
"""
Finds all substrings with length @length of string.
"""
start, end = 0, length - 1
str_lst = []
while end < len(string):
str_lst.append(string[start:end + 1])
start += 1
end += 1
return str_lst


def sub_k_times_in_str2(sub, k, string, already_counted):
"""
Finds out if a substring sub appears exactly k times in a string.
"""
if sub in already_counted:
return False
return string.count(sub) == k

What the best way to make a python script work on android? I have a program that creates and modifies files but Qpython doesn't let me do that.

Dude, I'm an EE. I don't need that.

this iteration of /dpt/ seems to be shit so far, I'm waiting for the next one
everyone who posted so far should consider to gtfo

See? I don't care about what's the best programming language. I don't even code in Python or Go. You're only worried about winning arguments for the sake of winning them. Nothing helpful comes out of that kind of approach.

Maybe I'm getting too old for this shit.

People will defend this.

And this.

>b-but ES7 isn't as bad!!!!

Doesn't the K&R seem a little thin in this picture? Or maybe it's because I had a hardcover.

Here's a challenge: write a chat server with TLS1.3 support.

What is man supposed to use when here's just no good statically typed and compiled language.
>sml
no good implementaion
>ocaml
sml with shitty syntax, also does not support native threads
>lisp
too verbose, also static typing not standardized
>c
decent but manual memory management is annoying in prototyping phase
>sepples
cluster fuck that no sane person would touch
>d
can't decide if it wants to have gc or no
>rust
better stay away from it because it attract lot of crazy hipsters
> any jvm/clr lang
requires huge vm
>go
Rob Pike is faggot, also no macros

How about using the resources you have and know instead of coming up with excuses?

The fuck does that even mean?

>scientific computing
>not CPU or memory bound
wat

> wants statically typed and compiled
> doesn't want to manage memory

stick to python m8

It means that given a task, why not use the best tool you're comfy with to execute it instead of coming up with excuses and delays.

Rate my sepples

github.com/salsudano/place_visualizer

> be industrial engineer at a factory
> have company card
> buy data acquisition system that shits out a CSV
> use Python to view/manipulate and/or collect this data

Many such cases.

There seems to be lot of languages that fill that general purpose language niche.
There's really no best tool when all of them are decently fast and have language bindings for most libraries you will ever need.

Then compromise. Stop wasting time.

How does being robot treat you?

you guys ever write programs for yourself for personal use

i want to but i dont know what i need lol

Yes.

no I meant this one

what does yours do

I'm just being practical. Is it really useful having philosophical debates before coding something?

>oh man I can't choose this language because X
>no, not that one because Y
>omg no that language has Z, no way

It's like a sort of premature optimization but applied to programming languages.

You have to compromise at some point or you'll be stuck and won't get anything done.

Shitposts on Sup Forums

Bump I need advice

scraps Sup Forums threads looking for facebook and twitter images.

pretty good. don't ever need to go to Sup Forums.

just run
python scrap.py


and it writes to a file what has found

All I have to say is that I need to brush up on C++ because I have no clue what ^ instead of * means.
Are there any screenshots?

bitwise xor

I assume you parse the file name and if it makes you download it?

No, in function's arguments. First time I'm seeing that.

>visual studio files in github for no reason at all
>can't run it on linux

into the trash it goes

Like this github.com/salsudano/place_visualizer/blob/master/place_visualization_gui/PlaceVisualizerForm.h#L189


Is it overloaded?

ye

It's a pointer for C++/CLI aka modern Microsoft C++.

You can use it to instance methods in the .net CLR.

daily """"programming"""" thread

Thanks.

I think I found something about it msdn.microsoft.com/en-us/library/yk97tc08.aspx

>What is man supposed to use when here's just no good statically typed and compiled language

You can't in general.

does melonpan even like anime?
all he does now is dress up like flavor of the month anime girls and buy tons of merch and act like a sex crazed homosexual for the attention

Bitch if you type a paragraph I'll find at least 2 mistakes in your shitty text

i crack rsa for fun by hand

same

Is there an easy way to visualize a simulation? Lately I've been doing work with traffic AI to test highway designs and I'd like to watch my simulation visually as it takes place but I don't know opengl or anything.

Is there an easy way to go from my sim stuff to graphics?

You must be fun at parties.

>parties
;_;

How the fuck do you stay disciplined? I can't work, I can't wake up, I can't keep away from distractions, and worse of all I can't motivate myself that there's any point in making an effort. How do people even motivate themselves? What's the point of being good at something? When I was young I was competitive and that was enough to push me to climb mountains, but then I grew up and being better than others stopped being relevant, and I was left with no motivation. I don't need do be richer than average which I can be with my current skills, I don't care about leaving a legacy behind, I don't care about impressing anyone, I don't have anything to prove. What's there that motivates people to work hard? Maybe it's just a phase but I have 0 discipline and 0 motivation

You must have down syndrome. Retard.

What sort of theory questions? Shit like what's the algorithm's complexity?

He's a shit candidate if he couldn't read khan academy for 5 minutes to grok that shit

>""""""""AI""""""""
lol fag

I got a work and suddenly i got motivated to learn more.

I'm gonna learn .net core and make some web intranet for my company and host it on some linux pc.

I'm currently working on my first SFML game.

I've been involved with C++ for years now, but never attempted to make anything beyond competitive-level console applications.
Discovering SFML, I'm amazed at how easy it is to implement your own game structure. I don't even need an engine or any bloatware piece of shit framework.

I wanna do game dev now, but there's so much Analysis left to learn for exams.

I believe you're suffering from depression. You should seek a health professional, though.

parties are overrated as shit

almost everything normies do isn't even fun for normies they're just pretending to enjoy it to fit in

See you tomorrow.

>tfw 1 hour has passed and your "sum of the primes below 2 million" program still has not returned anything

Pointer to a garbage collected object. If you're going to use garbage collection and tie yourself to windows then why not rub it in coconut oil and use C#.

But I've been depressed all my life, and that didn't stop me before.

i hang out with normies cuz id never really leave the house

all my interests are in there

p-please

yeah just do some real programming instead of wasting your time here. /dpt/ sucks

>any bloatware piece of shit framework
but you said you use sfml