[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 317
Thread images: 26

File: computinggirls-loopstra.jpg (68KB, 425x407px) Image search: [Google]
computinggirls-loopstra.jpg
68KB, 425x407px
What are you working on, /g/?

old thread:>>59809632
>>
Rust is the future of systems programming.
>>
>>59813379
Apparently the ones in anon's company aren't smart enough then.
>>
Thank you for not using an anime image.
>>
>>59813400
Idris is the future of applications programming.
>>
>>59813400
they cant make time freezers soon enough then
>>
>>59813400
>>59813416
My language is the future.
>>
self taught coders are being oppressed by the white devil
>>
>>59813382
gash-script.jpg
>>
>>59813494
dynamic language users are being oppressed by static type zealots
>>
>>59813536
fuck off yank
>>
File: ULTRA-rage-feels.jpg (106KB, 601x601px) Image search: [Google]
ULTRA-rage-feels.jpg
106KB, 601x601px
>>59813547
we don't even have flags here you're not supposed to be able to tell
>>
Does Python have any redeeming features?
>>
>>59813642
yeah it's easy for retards to learn
>>
File: aw-shit-nigga.png (190KB, 580x435px) Image search: [Google]
aw-shit-nigga.png
190KB, 580x435px
>>59813663
>>
>>59813663
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.
>>
>>59813686
it's for non-serious people.
>>
>>59813663
What's a good language for smart people, like yourself, to learn?
>>
>>59813716
Your anger is adorable.
>>
>>59813729
Not angry. Just curious. So?
>>
>>59813704
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.
>>
>>59813768
Looks like we found the angry python script kiddie.
>>
>>59813768
>Python's purpose is for building large systems that are not memory or CPU constrained.
CL is much better at that than Python.
>>
>>59813768
You can do all of that in C++, Java, C#, etc and have good performance.
>>
>>59813791
hello brainlet
>>
File: languages3.png (17KB, 522x384px) Image search: [Google]
languages3.png
17KB, 522x384px
>>59813810
>>
>>59813791
Looks like we found the mouth breathing mongoloid.
>>
>>59813809
I use python for rapid algorithm prototyping and scripting. I don't need performance for any of that.
>>
>>59813828
Python users are quite touchy, aren't they?
>>
>>59813841
I use CL for that
>>
>>59813881
He probably failed SICP, don't be too hard on him.
>>
I just recalled why I left /g/ 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.
>>
>>59813798
>CL is much better at that than Python.
Ok, you've got my attention - what is CL?
>>
>>59813918
Common Lisp
>>
>>59813912
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
>>
>>59813912
I occasionally come back to check if the situation has improved. It hasn't. It's a worthless shithole, even worse than Plebbit.
>>
File: slow_substring_finder.png (160KB, 1590x985px) Image search: [Google]
slow_substring_finder.png
160KB, 1590x985px
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.
http://www.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.
>>
>>59813881
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
>>
>>59813943
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.
>>
File: 20170409_122519.jpg (1MB, 2576x1932px) Image search: [Google]
20170409_122519.jpg
1MB, 2576x1932px
People will defend this.
>>
File: js.jpg (792KB, 3264x1836px) Image search: [Google]
js.jpg
792KB, 3264x1836px
>>59814097
And this.

>b-but ES7 isn't as bad!!!!
>>
>>59814097
Doesn't the K&R seem a little thin in this picture? Or maybe it's because I had a hardcover.
>>
>>59814097
>>59814114
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
>>
>>59814192
How about using the resources you have and know instead of coming up with excuses?
>>
>>59814224
The fuck does that even mean?
>>
>>59813768
>scientific computing
>not CPU or memory bound
wat
>>
>>59814192

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

stick to python m8
>>
>>59814239
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

https://github.com/salsudano/place_visualizer
>>
>>59814248

> 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.
>>
>>59814257
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.
>>
>>59814285
Then compromise. Stop wasting time.
>>
>>59814297
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
>>
>>59814330
Yes.
>>
File: diamond.png (566B, 19x17px) Image search: [Google]
diamond.png
566B, 19x17px
>>59809905
>>59809919
no I meant this one
>>
>>59814352
what does yours do
>>
>>59814305
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.
>>
>>59814360
Shitposts on /g/
>>
>>59814262
Bump I need advice
>>
>>59814360
scraps /b/ threads looking for facebook and twitter images.

pretty good. don't ever need to go to /b/.

just run
python scrap.py


and it writes to a file what has found
>>
>>59814377
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?
>>
>>59814397
bitwise xor
>>
>>59814383
I assume you parse the file name and if it makes you download it?
>>
>>59814402
No, in function's arguments. First time I'm seeing that.
>>
>>59814377
>visual studio files in github for no reason at all
>can't run it on linux

into the trash it goes
>>
Like this https://github.com/salsudano/place_visualizer/blob/master/place_visualization_gui/PlaceVisualizerForm.h#L189


Is it overloaded?
>>
>>59814421
ye
>>
>>59814397
It's a pointer for C++/CLI aka modern Microsoft C++.

You can use it to instance methods in the .net CLR.
>>
File: 1491765012786.jpg (102KB, 510x731px) Image search: [Google]
1491765012786.jpg
102KB, 510x731px
daily """"programming"""" thread
>>
>>59814489
Thanks.

I think I found something about it https://msdn.microsoft.com/en-us/library/yk97tc08.aspx
>>
File: egfd.jpg (27KB, 260x403px) Image search: [Google]
egfd.jpg
27KB, 260x403px
>>59814192
>What is man supposed to use when here's just no good statically typed and compiled language
>>
>>59813946
You can't in general.
>>
>>59814520
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
>>
>>59814607
Bitch if you type a paragraph I'll find at least 2 mistakes in your shitty text
>>
i crack rsa for fun by hand
>>
>>59814662
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?
>>
>>59814662
>>59814673

You must be fun at parties.
>>
>>59814682
>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
>>
>>59814682
You must have down syndrome. Retard.
>>
>>59813059
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
>>
>>59814681
>""""""""AI""""""""
lol fag
>>
>>59814697
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.
>>
File: Screenshot_2017-04-09_22-17-11.png (376KB, 1366x768px) Image search: [Google]
Screenshot_2017-04-09_22-17-11.png
376KB, 1366x768px
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.
>>
>>59814697
I believe you're suffering from depression. You should seek a health professional, though.
>>
>>59814690
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
>>
>>59813912
See you tomorrow.
>>
File: 1446375648303.png (463KB, 1070x601px) Image search: [Google]
1446375648303.png
463KB, 1070x601px
>tfw 1 hour has passed and your "sum of the primes below 2 million" program still has not returned anything
>>
>>59814489
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#.
>>
>>59814748
But I've been depressed all my life, and that didn't stop me before.
>>
>>59814750
i hang out with normies cuz id never really leave the house

all my interests are in there
>>
>>59814726
p-please
>>
>>59813912
yeah just do some real programming instead of wasting your time here. /dpt/ sucks
>>
>>59814746
>any bloatware piece of shit framework
but you said you use sfml
>>
>>59814701
Probably DP questions or mind-puzzlers. Seems like overkill to get a job calling setters with getters for invoices and writing CSS all day.
>>
File: cave_game.webm (3MB, 1000x563px) Image search: [Google]
cave_game.webm
3MB, 1000x563px
>>59814746
nice blog post.
>>
>>59814826
>Abu Rawash
>>
>>59814774
142,913,828,922
>>
>>59814774
"X of primes below Y" is begging for a sieve implementation. You did use a sieve, right?
>>
>>59814781
Maybe something in your brain chemistry changed in the meanwhile. Still, check with someone qualified.
>>
>>59814774
Next time keep a timer to spit its stage every so often.
>>
>>59814826
>mexican meat boy
>>
>>59814774
You're not using any optimizations?
If you're using trial division, just check for divisibility up to sqrt(n), anything more is redundant.
Also don't check even numbers greater than 2.
In fact, you'd have much more luck with 30 iterations of fermat's little theorum.
Or just use a sieve.
>>
>>59814774
Hah. If I ever get to design a prime number library, I'm going to memoize the living shit out of them.
>>
>>59814826
I literally just answered the thread's question. What the fuck is your problem?
>>
File: 1457728085180.png (307KB, 500x500px) Image search: [Google]
1457728085180.png
307KB, 500x500px
>>59814114
>>59814192
>>59814248
>>59814251
>>59814283
>>59814361
>>59814428
>>59814774
>>59814884
Who said that? Why are you quoting it?
>>
>>59814826
>2D
>>>/vg/agdg
>>
>>59814917
epic
>>
>>59814906
Just ignore him/her.
>>
>>59814932
>her
>>
>>59814906
Ohoho! You wanna know what my problem is? Alright, I'll tell you what my problem is. You are my God-Damned problem! Anyone who'd lay it down for some cape in an ivory tower deserves what they get.
>>
>>59814826
Is that made by someone from /vg/? Not bad
>>
>>59814917
tism
>>59814906
tism
>>
>>59814922
That post is pretty short to be an "epic"
>>
>>59814921
suck my dick pleeeeeeeease
>>
>>59814746
>>59814826
>>>/v/
>>
>>59814917
Kill yourself, shit for brains.
>>
>>59813382
Anybody got that /g/ programming challenge image?
>>
>>59814985
Answer me. Why are you avoiding such a simple question?
>>
>>59815001
read this sentence.
>>
>>59814917
>not understanding greentext
>>
this thread is pure shit
>>
>>59815015
Do you see "not understanding greentext" anywhere in my post? If not, why are you quoting it?
>>
>>59815015
>>59815013
Stop replying to the bait
>>
What does /g/ actually think about this list? Some dude aggregated all the most recommended books on stack overflow.

http://www.dev-books.com/book/discover

Seems like a lot of people need help on unit testing
>>
Has anybody here worked with GIS stuff for android app development? I was wondering how much overhead is involved (data-wise and computation-wise) and how often it's practical to update location for something like a game?
>>
File: 6.jpg (106KB, 1600x1000px) Image search: [Google]
6.jpg
106KB, 1600x1000px
>>59815042
cool
>>
working on a regular polygon area finder to put on my TI 84
>>
>>59815042
How can a board think something?
>>
>>59815042
>GoF
>Clean code
>JS
>Java
>more design patterns

Bad

>CLRS
>PFDS
>Dragon book

Good
>>
File: 1486142353147.jpg (32KB, 583x328px) Image search: [Google]
1486142353147.jpg
32KB, 583x328px
>>59815074
we're doing it right now
>>
In member function '<blah blah template clusterfuck>::fill(const auto:68&)':
error: expected primary-expression before '>' token
auto copy = value.cast_to<bgra_ffff>();
^
error: expected primary-expression before ')' token
auto copy = value.cast_to<bgra_ffff>();
^

wtf is wrong with this? that is a valid function with a valid template parameter. I don't see the problem.
>>
>>59814774
You just need to practice more. Rule of thumb is 500 lines of code per day.
Yes, I know It's a shitty measure. YMMV.
>>
>>59815101
>C++

There's your problem.
>>
File: 1323.png (20KB, 435x457px) Image search: [Google]
1323.png
20KB, 435x457px
>>59815084
my dragon book has 1038 pages and it's only 12 MB
>>
>>59814990
yeah, prove n != np
>>
File: 05onfire1_xp-facebookJumbo.jpg (202KB, 1050x549px) Image search: [Google]
05onfire1_xp-facebookJumbo.jpg
202KB, 1050x549px
>>59814781
>But I've been depressed all my life
>>
>>59815084
>Java
>more design patterns
>Dragon book
Who said this?
>>
>>59815101
post code
>>
>>59815139
read this sentence.
>>
>>59815139
Were you dropped on your head as an infant?
>>
>>59815133
I have proof that it is not the case that n != np.
>>
>>59814774
yeah you messed up

i just wrote a program to do that and it finished in .6 seconds
>>
>>59815162
No you don't.
>>
>>59815162
id like to hear it
>>
>>59815176
I have just stated that I do.
>>59815179
You don't usually "hear" proofs.
>>
Is Go a meme language and does anyone have good sources to learn it from if not?
>>
>>59814750
>almost everything normies do isn't even fun for normies they're just pretending to enjoy it to fit in
Yeah, sure, but you're forgetting a key reason why they are doing this - this is how you obtain pussi
>>
>>59815143
it's huge. not sure which parts to post
>>
>>59815187
>I have just stated that I do.
Then you're a liar.
>>
>there is no good way to perform a timeout in C++
Why does anyone defend this?
>>
>>59815148
You have a very low IQ anon.
>>59815157
i wish i was, but really...
>>
>>59815201
>it's huge
for you
>>
>>59815210
Who said "there is no good way to perform a timeout in C++"?
>>
>>59815213
It seems you have problems grasping the must rudimentary aspects of imageboard culture. I suggest you return to whichever internet cesspit you came from.
>>
>>59815042
>Working effectively with legacy code
>clean code

Huh, I'm a bit surprised
>>
>>59815196
if you have money you can get pussy easily even if you're a cringey elon musk type of guy. and you can fuck a low-mid tier pornstar for $300 and a top tier pornstar for $1-2k
>>
>>59815191
>Is Go a meme language
It's a programming language, meaning it can't possibly be a "meme", you retarded redditor.
>good sources
>Go
No, just no.
>>
Is lisp a waste of time to learn? I've started to move to emacs from vim and in order to configure it I need to learn elisp and I'm not sure if it's worth the trouble.
>>
>>59815237
>imageboard culture
Is reddit an imageboard now? Didn't know that.
Even then, why are you telling me this? Why would I want to know something about your home website? I'm not interested in it.
>>
>>59815210
Futures
>>
>>59815210
using clock = std::chrono::high_resolution_clock;
auto now = clock::now()
while(now + 10ms < clock::now()) std::thread::yield();
>>
>>59813382
I'm trying to check if a given point is contained inside of a rectangle (represented by a corner, width, and height).

The rectangle is at (0,0), with a width of 10 and a height of 5.

Does this look good? Seems to work properly, but is there any way I can improve this?

    def contains(self,point):
"""checks if a point is contained in a rectangle"""
wlb = self.posn.x #lowerbound width
hlb = self.posn.y #lowerbound height
print('wlb:{0} hlb:{0}'.format(wlb,hlb))
if (wlb <= point.x < self.width) and (hlb <= point.y < self.height):
return True
return False

>>
>>59815273
You're pretty retarded if you have to "learn" elisp in order to configure emacs.
>>
>>59815283
Make a timeout, not a sleep
>>
>>59815317
I mean if I want to write my own plugins.
>>
>>59815304
what if the point has a negative
>>
>>59815342
oh shit, yeah that would cause it to not work properly. ty anon.
>>
>>59815335
Then by your own definition it isn't a waste of time.
>>
>>59815353
wait no nvm, should still work. The lower bound is set to posn. In this case it's (0,0), but if it were say (-2,-4), then it should still be fine.
>>
Are there any step-by-step tutorials on building a basic 3d engine? Even if just to render like, a pyramid or something like that?
I'm trying to figure out what I'm in for in the fall and what kind of math I should brush up on beforehand.
>>
>>59815373
what if it was a triangle
>>
>>59814977
>game development
>HURR go to videogame board

this board never ceases to amaze me
>>
>>59815457
If you're not quoting anyone, please stop typing in a retarded fashion.
>>
>>59815445
https://learnopengl.com/#!Getting-started/OpenGL

It's really easy to do the basis stuff.
>>
>>59815240
Going to prostitutes is no better than jacking off to porn imo. I would literally do anything with that money, even donate to it charity (which is something I hate), just to not waste it on whores.

It's not just about sex. Sex alone isn't that interesting - the best part is everything involved around sex.
You can't buy that feeling when a woman gets wet and grabs your cock sitting next to you in a pub just because of what you said and how you look at her. That feeling of being attractive alone is better than fucking a $1000 porn star even if the girl is a 5/10.
>>
>>59815485
>palpable butthurt
>>
@59815457
>HURR
>>>/r/abbit
>>
>>59815457
>>>/vg/agdg
>>
>>59815501
Please do not misuse the quoting function.
>>
>>59815447
oh shit, yeah that would cause it to not work properly. ty anon.
>>
>>59813400

Is this legit, I thought rust is just a meme?
>>
>>59815521
>thinking it's a quoting function
>>
>>59815521
please stop wasting taxpayer's money with your meaningless existence
>>
>>59815535
A programming language simply can't be a "meme", plebbitor.
>>
>>59815545
>implying i'm a amerilard

kys
>>
>>59815540
Who said this? Why are you quoting it?
>>59815545
My country doesn't have taxes.
>>
>>59815560
Welfare exists in many countries.
>>
nice quads
>>
>>59815535
>/dpt/ sperglords hot opinions
>legit
>>
>>59815573
I don't doubt that you personally don't pay taxes.
>>
>>59815603
why would I?
>>
>>59815601
Really, who are you quoting?
>>59815603
My earlier statement outright states that.
>>
>>59814774

I've seen a really sloppy Python implementation do it in about a minute. With Ruby and a library (actually just the standard library, but it's a lazy solution), I can do it in about a second or two.

require 'prime'

sieve = Prime::EratosthenesGenerator.new
sum = 0

loop do
prime = sieve.next
break if prime > 2_000_000
sum += prime
end

puts sum


Chances are, your program is stuck in an infinite loop.

>>59814807

SFML is not really bloated. It provides you with what you need to draw crap on the screen, play audio, and read user input, in a way that's portable. Other than that, you pretty much have to implement everything yourself.
>>
>>59815626
read this sentence.
>>
>>59815626
The implication (that you missed because you have the density of a neutron star) is that others in your country pay taxes, but that you do not because you have no income and instead are but a leech upon their productivity.
>>
@59815637
>Chances are, your program is stuck in an infinite loop.
You shouldn't be using Turing complete garbage.
>>
>>59815686
But you don't understand, parts of my program require Turing-completeness so I have to use a Turing-complete language for all of it.
>>
File: BACK.jpg (137KB, 717x880px) Image search: [Google]
BACK.jpg
137KB, 717x880px
>>59815247
>No, just no.
calling me reddit with expressions like this
>>
Can /dpt/ write a repeating digits detector?
>>
>>59815686

No one uses your non-turing complete garbage except for proofs, and even then, plenty of people use languages like Haskell or Prolog for these tasks, which are turing complete. Also, don't use an @ sign for quotes. It's incredibly difficult to find people to reply to when you do that.
>>
>>59815735
Yes
>>
>>59815680
>others in your country pay taxes
My previous statement outright states that this is false.
>you have no income and instead are but a leech upon their productivity
Assuming I was subhuman enough to do such a thing, I simply wouldn't be able to since there are no taxes in my country. Which is equivalent to saying "others in my country do not pay taxes".
>>
>>59815686
>thinking you can't have infinite loops in turing incomplete languages
>>
>>59815735
(n % 100) % 11 == 0
>>
>/dpt/ - terminal autism
>>
>>59815745
I don't believe that nobody in your country pays taxes, though. I think you're ashamed of the fact that many people in your country do, but you do not.
>>
>>59815760
trips of truth
>>
@59815742
>No one uses your non-turing complete garbage except for proofs
Not an argument. Post discarded.

>>59815755
By definition, an infinite loop is something which doesn't terminate. Also, who are you quoting?
>>
>>59815774
>By definition, an infinite loop is something which doesn't terminate.
Yes, and?
>>
>>59815637
I'm pretty much positive that the 'prime' library was built only for solving project Euler problems or falliciously demonstrating how easy Ruby is (I'm sure its a comfy language, but solving an obscure problem by importing a useless library is not proof of that).
Tell me, when have you EVER needed an algorithm for generating a list of small primes? Not even cryptographic algorithms benefit from an Eratosthenes seive
>>
>>59813809
Ok then you have static types and must compile with every change, how is that better than Python for something not performance bound? It's not.
>>
>>59815761
>I don't believe that nobody in your country pays taxes
So? The truth isn't predicated on your belief of it.
>I think you're ashamed of the fact that many people in your country do, but you do not.
Thankfully I don't live in a country ruled by the kind which seems to have infiltrated most places, so this is a non-issue to begin with.
>>
>>59815813
Haskell

>repl for fast typechecking + partial compilation
>polymorphism and strong typing
>pure

much nicer than trashy python
>>
>>59815637
>java can do it in less than a second with no library
baka
>>
>>59813952
I don't know but I got 8 seconds.
>>
>>59815826
Who are you quoting?
Also, Haskell is about as strongly typed as Python.

>>59815828
Who said that?
>>
>>59813768
>Python
>perfect
kill yourself and fuck off to >>>/g/wdg
>>
>>59815755
There are Turing incomplete languages that allow infinite loops and Turing incomplete languages that don't.
>>
>>59815756
Nice, anon. Not the full thing but close enough
>>
>>59815813
You have to restart your application for every change, so your down-time is an extra 3 seconds or so.
Which is a lot less time than the headache during refactoring when Python refuses to do even basic static analysis (like checking for misspelled variable names), much less typechecking which will catch a lot of other frustrating errors.
>>
>>59815842
>Haskell is about as strongly typed as Python.
Of course, you're a fucking newfag
No wonder you keep spamming "who are you quoting" like it's automatically funny

>>59815850
This is false
>>
>>59815445
You should brush up on your linear algebra, the best way is to read a textbook. GL anon.
>>
>>59815842
>Also, Haskell is about as strongly typed as Python
You don't know anything, do you?
>>
>>59815850
>>59815855
or rather, it's true but only partially so
there are turing incomplete languages that allow infinite loops
>>
>>59815823
You posting something doesn't make it true. I think you're a liar. Is that simple enough for you to comprehend?
>>
>>59815852
What doesn't that do? It's a detector, true or false.

>>59815880
So it's completely true.
>>
>>59815891
>So it's completely true.
in the sense that

>>>All people are called Adam
>>no they aren't
>there are people called adam

is completely true
>>
>>59815855
head []

This typechecks in Haskell, making it instant trash.
>like it's automatically funny
Why would a genuine question be funny? What kind of strange attempt at "logic" is that?

>>59815875
I actually do.
>>
>>59815445
Why why WHY are all the CS freshmen so fixated on "muh 3d engine"

Does no one get into programming for a reason other than fucking games?
>>
>>59815906
It's a hell of an improvement over being allowed to execute

head 7
>>
>>59815813
Common Lisp still sounds like the best way to go.
>>
>>59815903
I didn't post >>59815686 or >>59815774. >>59815850 is undeniably correct.
>>
>>59815906
>This typechecks in Haskell, making it instant trash.
If that line alone is enough to bring you to tears and make you this upset and salty, maybe you should just stop programming

>why wo
AHAHAHA SORRY I CANT STOP FUCKING LAUGHING YOU FAG
>>
>>59815920
Games are a lot more interesting than making yet another CRUD app
>>
I'm trying to implement a search function in C++ that searches either by name or ID, the file I'm reading from looks like this:
************
Name1 //name
20170101 //ID
18
55555555
************
some name
20170142
23
555-521-511
************

If I search for 20170142 for example, It'll display everything between the two ********** lines

How do I do this?
>>
>>59815906
"Strong typing" has nothing to do with if
head []
typechecks or not.
>>
>>59815952
isnt that the goal?
>>
>>59815926
An improvement, but still pretty bad. Any language should be able to statically prevent retardation like that.
>>59815938
That line alone should be enough to convince anyone that Haskell has a crippled type system.
>>59815955
I don't recognize "strong typing" to be a valid thing to say so I can't reply to this post.
That line typechecking just shows that the language has a shit type system.
>>
>>59815983
>That line alone should be enough to convince anyone that Haskell has a crippled type system.
this line alone should be enough to convince anyone that you have a crippled brain
>>
>>59815885
>You posting something doesn't make it true.
Me posting something true preserves the original truth value of it.
>I think you're a liar.
Your assumption is false.
>Is that simple enough for you to comprehend?
It is.
>>
>>59815983
Haskell may not be great, but its type system is miles better than that of any other mainstream language.
>>
>>59815801

Fucking never. But if it's going to take up space on your hard drive because it's part of the default Ruby installation, might as well use it.

>>59815828

I mean, I was overestimating because I was running it in Sublime Text's ruby eval package. It's not that slow a task...

rubyist@Overmind:~$ time ruby /tmp/primes.rb
142913828922

real 0m0.185s
user 0m0.180s
sys 0m0.004s
>>
>>59815982
the goal of what?
>>
>>59816003
>Me posting something true
I don't think you did that, though.
>>
>>59815774

>not an argument
I wasn't making an argument; I was making a statement. Not everything I say is an attempt to persuade you of something. Sometimes I want to belittle you for being a fucking pleb.
>>
>>59816030
the search

you search by name and id and then it returns all that shit

what should it be returning?
>>
>>59815952
In my (probably naive) opinion, it'd be better to load the content of the file into a data structure first.
>>
>>59815992
I can typecheck it in my head, which means my brain can use a more powerful type system than Haskell has.

>>59816013
>Haskell may not be great, but its type system is miles better
So? The type system is still garbage.
>mainstream language
That has no relevance when just judging the type system.
>>
>>59815833
Made less redundant and removed the possible infinite loop

longest[k_Integer, s_String] :=
Module[{f, i},
f[_] := Cases[Tally@Subsequences[Characters[s], {StringLength[s] - i++}], {sub_, k} :> StringJoin[sub]];
i = 0;

NestWhile[f, {}, Equal, 2, StringLength[s]]
]


Someone else try this so I can reassert the dominance of my fav lang.
>>
File: 7wsnmX2.jpg.png (51KB, 657x527px) Image search: [Google]
7wsnmX2.jpg.png
51KB, 657x527px
>tfw too dumb for Emacs
>tfw settling with Vim for scripting
>tfw Eclipse or Netbeans for large projects
Emacs seems like magic but it looks like it takes years to master and the project needs to be done today.
>>
What's the best programming setup to impress cs qts
>>
>>59815952
>>59816064
In that example output, if I choose to search by ID, then search for 20170142, it would display ONLY:
some name
20170142
23
555-521-511
>>
>>59816092
Who are you quoting?
>>
>>59816073
If you want a head that can't be used with [] then just write a version that takes NonEmpty, it's not hard. You won't though, you'll just continue to complain.
>>
>>59816096
>cs
>qts
>programming
>impress
>>
>>59816098
YES BUT ISNT THAT WHAT YOU WANT
>>
@59816092
>7wsnmX2.jpg.png
>tfw
>>>/r/abbit
>>
File: 1420112907201.png (243KB, 550x535px) Image search: [Google]
1420112907201.png
243KB, 550x535px
>>59816130
>>
>>59816126
Yes, that IS what I want, but I DON'T know how to...
>>
>>59816100
>>59816130
you're fucking pathetic i come here after weeks of not visiting /dpt/ and you're still doing this shit
>>
>>59816148
Be nice, it probably took him a year to write that bot, now the only manual step in his process is the captchas
>>
>>59816147
if you search by name return name + 3 lines below

if you search by id return 2 lines below and one above
>>
>>59816113
>If you want a head that can't be used with []
If a language can't have a basic list type which can be statically determined to be either empty or not, then it's complete trash.
>just write a version
I don't use pleb filter languages. My language already has such a head.
>it's not hard
True, but why would I be using a language with a crippled type system in the first place? I'm not some sort of plebeian.
>You won't though, you'll just continue to complain.
Why would I be complaining about it? I don't use a pleb filter language.
>>
>>59816148
>>59816100
It's "Whom are you quoting?", anyway.
>>
>>59816164
>took him a year

...Fucking how?
What'd difficult about parsing through the thread JSON and noting which posts have greentext in them?
>>
@59816142
>ribbit the reddit frog
>>>/r/abbit
>>59816148
Which "shit" are you referring to?
>>
>>59816181
I'm seeing lots of words but little action in your post, anon.
>>
>>59816195
Who said that though?
>>
>>59816092
Emacs is pretty easy, just google an enviroment and copy what other people did
>>
>>59816224
I don't even know LISP well.
Only took one functional programming course at university.
How could I ever master Emacs?
>>
>>59816195
you're mom
>>
>>59816238
you don't need to knwo lisp really
>>
>>59816199
What kind of action would you like to see? I am currently working on a program to eradicate or at least sabotage all languages with trash type systems so you will have to wait for a while.
I wouldn't use Haskell for your pacemaker or anything important since GHC might have some major bugs in it pretty soon.
>>
>>59816238
Elisp is simpler than common lisp.
>>
File: YaT-ZYQU_Es.jpg (23KB, 579x570px) Image search: [Google]
YaT-ZYQU_Es.jpg
23KB, 579x570px
I feel like I am pretty much done with programming. This shit makes me puke.

And I'm not too happy about that.
>>
>>59816263
I think you're going a bit far there, Edwin
>>
@59816275
Good post. Now fuck off to >>>/r/abbit
>>
>>59816276
I am not Edwin, but I am indeed working for a secret organization of sorts which may or may not be headed directly by him.
>>
>>59816326
What will you do with CL and Scheme?
>>
File: god tier artwork.png (6KB, 582x246px) Image search: [Google]
god tier artwork.png
6KB, 582x246px
>>59815527
Ok. So my original solution didn't work properly for any rectangle that wasn't at (0,0). I changed it and tested this for a rectangle at (-5,-3) with a width of 5 and a height of 5. Every test I tried worked correctly. The exercise wants me to include the lower bound, so for rectangle at point (0,0) with width 10 and height 5, (0,0) would be considered inside. I don't see why, since (0,0) would be on the line, not inside of the actual rectangle. Either way, just to solve it the way they want, i'd just change the wlb and hlb to <=.

Is this correct? Am I missing anything obvious?
 def contains(self,point):
"""checks if a point is contained in a rectangle"""
wlb = self.posn.x #lowerbound width
hlb = self.posn.y #lowerbound height
wub = self.width - abs(self.posn.x) #upperbound width
hub = self.height - abs(self.posn.y) #upperbound height
if (wlb < point.x < wub) and (hlb < point.y < hub):
return True
return False
>>
>>59816356
We already have our men "working" for them, so to speak. Double agents if you will.
>>
>>59816380
Is Guido van Rossum one of your men? I don't think your strategy is working...
>>
File: w.png (14KB, 866x166px) Image search: [Google]
w.png
14KB, 866x166px
>>59816359
>>
>>59816394
>Is Guido van Rossum one of your men?
I can't confirm or deny this.
>I don't think your strategy is working...
It takes time. Their kind is pretty concerned with keeping their languages as shit as humanly possible.
>>
>>59816423
It seems most developers have an endless appetite for shit then, Python is very popular with no signs of slowing.
>>
>twf you wrote some massive templated clusterfuck on auto-pilot and you suddenly realize what a mess you made
this is me right now. into rm -f it goes.
>>
>>59816450
That is merely a part of our plan.
>>
>>59816466
thanks for letting us know
>>
>>59816466
I really want to know who are you quoting.
>>
>>59816504
whom
>>
>>59816504
and I want you to stfu finally
>>
>>59816504
read this sentence.
>>
>>59816479
Well could you speed it up? I'm tired of most companies using shitlangs.
>>
>>59816504
>me
learn 2 reading comprehension
>>
>>59816559
Where did I say "me"?
>>
File: 1489761444249.png (311KB, 335x416px) Image search: [Google]
1489761444249.png
311KB, 335x416px
>>59814917
this must be some new level of low
>>
>>59816556
>Well could you speed it up?
Not a chance.
>I'm tired of most companies using shitlangs.
Once you've awakened the warrior within... it never sleeps again.
>>
why did i read this thread to the end
>>
>>59816296
>look mom i posted it again!
>>
>>59816678
>Not a chance.
Pretty please?

>Once you've awakened the warrior within... it never sleeps again.
I'm a lover, not a fighter.
>>
>>59816692
Whom quotest thou?
>>
>>59816410
what is m

what is any of that?
>>
>>59816696
>Pretty please?
We are preparing a ruse of sorts. When everything is finished, a type attack can be launched from anywhere on the planet.
>I'm a lover, not a fighter.
Oh... well...
>>
>>59816732
Do you math?
>>
New thread:

>>59816790
>>59816790
>>59816790
>>
>>59815756
>detects only dubs
>doesn't detect multiple series of repeating digits

your FIRED
>>
>>59817214
are you retarded? it detects trips and tripdubs etc too
>>
>>59817214
Who said that though??
>>
>>59817787
>your mom
>>
>>59814917
It's "whom".
Thread posts: 317
Thread images: 26


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.