[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: 321
Thread images: 40

File: hime ACNL.png (778KB, 400x720px) Image search: [Google]
hime ACNL.png
778KB, 400x720px
old thread: >>56529393

What are you working on, /g/?
>>
Dependent elimination of Church-encoded data in coloured type theory.
>>
delete hasklel
>>
>Github TOS
>You shall defend and indemnify GitHub

Holy fucking shit
>>
>>56536272
junk
>>
>>56536272
actually kek'd irl

>>56536289
muh private company
>>
File: 2016-09-10-161611_675x746_scrot.png (31KB, 675x746px) Image search: [Google]
2016-09-10-161611_675x746_scrot.png
31KB, 675x746px
post your text editor
>>
>He uses a dark theme text editor
>He uses Arch linux
>He uses Java
>He uses C for gui applications
>He uses python for webdev
>He only codes in lisp
>>
File: 1472175365136.png (123KB, 785x757px) Image search: [Google]
1472175365136.png
123KB, 785x757px
>>56536290
>>56536332
That's unironically what I'm working on right now. Step to me again and I'll embed your chin in the pavement.
>>
>>56536345
4/6, no webdev, no lisp
>>
>>56536351
dumb frog poster
>>
File: ss (2016-09-10 at 10.20.20).png (54KB, 706x831px) Image search: [Google]
ss (2016-09-10 at 10.20.20).png
54KB, 706x831px
>>56536338
>>
File: C# shills btfo.jpg (58KB, 411x268px) Image search: [Google]
C# shills btfo.jpg
58KB, 411x268px
Reminder the greatest video game in terms of technical achievement and stability is programmed in C and C++, not a meme language
>>
>>56536379
share rc
>>
>>56536351
stupid frog poster
go back to r9k
>>
>>56536351
>unironically using 'unironically'
>>
>>56536338
>using "we" as a pronoun in documentation
trash
>>
File: At this point it's almost lisp.png (126KB, 939x730px) Image search: [Google]
At this point it's almost lisp.png
126KB, 939x730px
>>56536345
>tfw 0/10
>>
>>56536351
You can't even understand that you waste your time.
>>
>>56536338
I'll be quite honest, this many comments just makes your code more difficult to read.
I don't even know SDL and I can figure out your if statement means MAIN MENU because you wrote it as an enum.
>>
Thanks for the (You)s.
>>
File: captcha.jpg (4KB, 300x57px) Image search: [Google]
captcha.jpg
4KB, 300x57px
>>56536385
>stability
are you mememing hard right now?
>>
>>56536411
What a strange thing to be jimmied about.
>>
>>56536437
It was an assinment for an Intro to Programming with C class, we were told to comment as much as possible
>>
>>56536063
>>56536073
>>56536116
>>56536119
>>56536149
>>56536170

Figured it out lads.
For it to work I had to:
1) Include all the necessary Qt headers in my header file.
2) Include QX11Info and Xlib (with QX11Info before Xlib) in the source file.
>>
Doin homework
>>
Without posting memes, what's so great about lisp?
>>
File: 2016-09-10-162439_435x244_scrot.png (11KB, 435x244px) Image search: [Google]
2016-09-10-162439_435x244_scrot.png
11KB, 435x244px
>>56536437
Also it's not an enum, it's a pointer
Take into account that I was a little fresh to doing this stuff, was a bit over a year ago.
Looks to me like a great CS grad meme, but it was my first semester in CS
>>
>>56536494
easy to translate code to data and vice versa in it
>>
>>56536494
Babby's first language with metaprogramming.
>>
>>56536494
>>
>>56536338
>>
>>56536515
recursion a shit
>>
>>56536495
>>56536523
why does your font look so fucking bad?

Man I wonder what its like having good eyesight because I cant read shit like that...
>>
>>56536523
What?
>>
File: Selection_054.png (62KB, 1037x583px) Image search: [Google]
Selection_054.png
62KB, 1037x583px
How to i fix this?
>linux
>>
Obligatory Pajeet tech support scammer getting owned:
https://www.youtube.com/watch?v=a8xxgt9IjHo
>>
>>56536539
You didn't get Anon's joke, did you?
>>
>>56536563
The joke was there's nothing good about lisp
>>
File: Challenge.jpg (189KB, 910x564px) Image search: [Google]
Challenge.jpg
189KB, 910x564px
>>56536249
>What are you working on, /g/?
I've been learning C# for a week, just finished pic related. The code is ugly so I'll clean it up tomorrow, and if anyone wants to laugh at it, I'll post it. Btw, would love to see other anons do the challenge.
>>
>>56536411
>>56536448
all of those comments are pointless noise anyway, the code is self-explanatory
>>
>>56536562
This isn't even on topic, and it's not particularly funny, why do you keep posting it?
>>
>>56536548
install another font pack I believe. Those are special unicode characters, try adding some unicode packs or some shit.

also >>>/g/sqt
>>
>>56536466
the teacher probably wanted a different type of comments, not just a pseudocode transcript
>>
>>56536379
Can you share your config?
>>
>>56536614
lol get out Pajeet
https://www.youtube.com/watch?v=_peUxE_BKcU

>Pajeets shitting their poor unoptimized code on /dpt/
>not related to the topic

Take your shitty code to the loo pajeets
>>
>>56536724
Hahahahaha nice meme lol
>>
>>56536724
they're mostly white students, not actual pajeets
>>
>>56536614
It's an underage who thinks shitting streets is still funny despite being a 14-month old /int/ meme.
>>
>>56536750
Shitting streets is not funny. Clogging up /dpt/ with code that belongs in the loo is even less funny.
Pajeet-tier code doesn't belong to /dpt/.
>>
>>56536614
>>56536750
report and ignore. Hopefully a vacation will set him straight.
>>
>>56536851
post some god tier code then mr. programming expert
>>
>>56536851
see >>56536879

We're waiting
>>
>>56536852
Fuck off with your SJW language policing bullshit. People can make jokes that are common in the field if they want to. If you don't share their sense of humor, ignore them.
>>
>>56536911
Jokes are funny.
>>
>>56536706
gvim + powerline + base16-ocean + consolas
>>
>>56536911
>called out for repeating shitty joke

>S-SJW language policing bullshit!
Hello /v/! How's /advg/?

Oh, and where's the fucking code? >>56536879
>>
>>56536911
see global rule 3

>>56536943
basically this. We're waiting anon.
>>
>>56536879
Good code:
http://www.digicortex.net/node/7

Shit code:
https://github.com/php
>>
>>56536977
We got a memer here lads.
>>
>>56536977
>avoiding the question
>can't even think of a few lines of good code
If you can't program and don't plan on learning, why are you even here?
>>
rate my life program
pic related
my goal was so that resizing didn't affect the program
but when I make the window shorter, I most of the time get "wmove error"
how do I fix this, can somebody help me

also, this shit is computationally expensive
>>
>>56536962
There's something called threshold.
4chan had always been a place of free speech and expression until the SJW "muh protect my eyes from seeing offensive language" crybabies flooded it (mostly from Reddit and Tumblr).
You would have to spam off-topic and irrelevant stuff dozens of times to get banned back in the days.

If you selectively apply rules to censor stuff you don't like, you can find anything to be a violation of some rule. For example, I found your reply about how language policing is good to be off topic and poor quality.

Should I report you and get you banned? No. Because this is what free speech is about. We aren't living in North Korea.
You aren't being tolerant by not tolerating any innocent joke which hurts your feeligns.
>>
>>56537048
>computationally expensive
you're doing something dumb, try -o3
could just be haskell being haskell
>>
>old and tired "joke" only tangentially related to thread subject
>fuck off
>MUH FREE SPEECH MUH SJW MUH MUH MUH
>>
File: Polluter.png (34KB, 571x443px) Image search: [Google]
Polluter.png
34KB, 571x443px
>>56536351
Get your Nazi frogs back to your containment board poltard.
>>
File: 1470701214631.png (393KB, 611x607px) Image search: [Google]
1470701214631.png
393KB, 611x607px
>>56537053
>4chan had always been a place of free speech and expression until the SJW
holy shit what the fuck am i reading
it's just a weeaboo hobby site you dumbass

nobody is fucking policing you just because they dont laugh at your joke

now stop derailing the thread, there are already like 20-30 posts on this bullshit

post something programming related, not just "haha them pajeets rite"

baka
>>
>>56537013
Do you know what code means?
Also,
import math
def atkin(nmax):
"""
Returns a list of prime numbers below the number "nmax"
"""
is_prime = dict([(i, False) for i in range(5, nmax+1)])
for x in range(1, int(math.sqrt(nmax))+1):
for y in range(1, int(math.sqrt(nmax))+1):
n = 4*x**2 + y**2
if (n <= nmax) and ((n % 12 == 1) or (n % 12 == 5)):
is_prime[n] = not is_prime[n]
n = 3*x**2 + y**2
if (n <= nmax) and (n % 12 == 7):
is_prime[n] = not is_prime[n]
n = 3*x**2 - y**2
if (x > y) and (n <= nmax) and (n % 12 == 11):
is_prime[n] = not is_prime[n]
for n in range(5, int(math.sqrt(nmax))+1):
if is_prime[n]:
ik = 1
while (ik * n**2 <= nmax):
is_prime[ik * n**2] = False
ik += 1
primes = []
for i in range(nmax + 1):
if i in [0, 1, 4]: pass
elif i in [2,3] or is_prime[i]: primes.append(i)
else: pass
return primes
assert(atkin(30)==[2, 3, 5, 7, 11, 13, 17, 19, 23, 29])
>>
>>56537053
4Chan has never been a place of free speech.

See https://webcache.googleusercontent.com/search?q=cache:0fSHfEYpXFIJ:gawker.com/5693962/4chan-founders-free-speech-hypocrisy+&cd=3&hl=en&ct=clnk&gl=us for a good example.


Not to mention, freespeech implies that an opinion is being censored. Shitposting isnt an opinion.

>>56537124
Also this.

>>56537083
Dont worry anon. Summer is almost over.
>>
>>56537127
>Python
IMMEDIATELY dropped
Literal fucking kids language

>
            n = 4*x**2 + y**2
if (n <= nmax) and ((n % 12 == 1) or (n % 12 == 5)):
is_prime[n] = not is_prime[n]
n = 3*x**2 + y**2
if (n <= nmax) and (n % 12 == 7):
is_prime[n] = not is_prime[n]
n = 3*x**2 - y**2
if (x > y) and (n <= nmax) and (n % 12 == 11):
is_prime[n] = not is_prime[n]

what the fuck am i reading

>int(math.sqrt(nmax))
fucking shameful
>>
>>56537093
He looks like the fat ghost in Luigi's Mansion
>>
>>56537139
Your SJW bullshit isn't an opinion too by those standards, then. Stop shitposting and focus on the thread.
>>
>>56537139
>4Chan
>C
>linking to gawker article
hello newfag
>>
File: you talking shit, boy.webm (425KB, 960x540px) Image search: [Google]
you talking shit, boy.webm
425KB, 960x540px
>>56537069
can you do a webm of how fast it is in c?
also, haskell's pretty fast
>>
>>56537174
>shitposter tells others that calling them out is shitposting.

Okay anon.

What are you working on?

>>56537200
>implying it isnt just the first shit I found.

And what the fuck? Do you not even know Java when you see it? Are you fucking retarded?
>>
>>56537205
A game of life that size would be much fucking faster in C

Try using bangpatterns to force strict evaluation in certain circumstances (mess around)
>>
>>56537154
Hey, smartass.
Answer this question and provide an explanation:
Can any proposition of first-order logic (by that I mean the language of Peano arithmetic) be solved by an effective procedure?

You have 1 minute to give an answer with a proper explanation that isn't copied from the first page of Google.

Until then, you arne't competent to judge much, if any, code.
>>
>>56537237
>>56537205
Oh and it could just be console IO.
See if it's much faster if you force it to evaluate (all of it) but don't print it.
>>
>>56537225
I was pointing out the capitalized C in "4Chan", retard, not your code.
>>
>>56537127
>python
lmfao
>>
>>56537254
>Hey smartass
>...
>Until then, you arne't competent to judge much, if any, code.
>arne't
>>
>>56537048
Probably need to handle the resize event to store the terminal width and height (I think that's WINCH signal?) and then add a conditional to only print at a position if position is less than the terminal size (need to check both width and height).

Also it's probably not "computionally expensive", it's just the terminal drawing that's the bottleneck, try benchmarking it with and without drawing.
>>
>>56537284
>>56537277
This kid is a fucking joke lmao. He starts shitposting in a coding thread, doesnt post any code, and when he finally does, its some dogshit Python code.

>>56537267
Oh fuck u got me famalam -Okay Handsign-
>>
>>56537284
>can't answer a basic CS question
>tries to discredit the person by pointing out an irrelevant typo

Oh boy, the SJW bullshit intensifies.
>>
>>56537360
>falling for the STEM meme
>>
>>56537360
>trying to get other anons to do your homework

wew
>>
File: 1468472224634.jpg (61KB, 990x557px) Image search: [Google]
1468472224634.jpg
61KB, 990x557px
http://www.strawpoll.me/10985214
>>
https://www.reddit.com/r/chrome/comments/4st0t2/chrome_crashing_when_loading_certain_images/

google devs are fucking pathetic
>>
>>56537323
OH MYU FUCKKIGN GOD ARE OYU A FUCKING RETARD YOU IDIOT PEICE OF DONKEU HSIT IDIOT DUMBASS CUNTFACED IDIOTIC SHIT DICK GO FUCK YOURSELF IDIOT
>>
>>56537505
If I use the "choose file" dialog on 4chan, and then do stuff in other windows before actually submitting the image, or if I drag images from that file window to open them in tabs (to look at them before I pick them) then sometimes Chrome crashes for me

What language is it written in?
>>
Haskell bashers strike me more as the fedora type than Haskell pros do.
>>
>>56537431
>calling a basic question homework

Ok, you're a fucking idiot dickfaced dumb cunt bitch ass motherfer son of a fucking whore
fucking dumbass degenerate idiot
>>
>>56537539
>X bashers are worse than X shills
I love Haskell but this is a dumb post
>>
>>56537505
Let's see your browser then
>>
>>56537559
I didn't say shill. Not everybody using Haskell ITT is a shill.
>>
File: 1464723576745.jpg (38KB, 362x346px) Image search: [Google]
1464723576745.jpg
38KB, 362x346px
>>56537547
>motherfer
>>
tfw Elixir is the perfect language for the job I want to do but I'm a procedural babby and I'll probably waste days before I can write something barely working

;_;
>>
>>56537577
Anyone that uses Haskell turns into a shill for it
>>
>>56537615
>ruby
>>
>>56537623
Epic.
>>
>>56537560
i shouldn't be expected to make my own web browser

i should be able to expect that a $530 bn mkt cap corporation can produce decent quality product
>>
>>56537511
>>56537547
SJW/Anti-SJW culture is fucking hilarious because it just ends up being two sides of the same coin.

Both undereducated retards who make getting #triggered a pastime.
>>
>>56537539
this, there's this one faggot that always tries to bash haskell
he even has hiw own oc anti haskell pics
I recognize his because he says "hasklel" and replies "kill yourself" when you point out his shitty troll
I think he's the same fag that derails threads with anti pol memes
>>
>>56537631
If you're suggesting that I should use Ruby for that instead then no, Ruby is not a viable alternative.
>>
>>56537659
Datafag?
>>
>>56537652
Horseshoe theory:
The further apart two ideologies claim to be, the closer they become.
>>
>>56537700
Surprising how often this ends up happening in the world.


btw, you workin on anything interesting anon?
>>
>>56537668
I think he's suggesting Elixir is just RoRfag's bastardization of Erlang.
>>
>>56537681
most likely
It might be this other level one troll that thinks he's funny and that we fall for his epins
probably the same fag that posts bananas in /b/
>>
>>56537615
learn Haskell, it will teach you to not be procedural
>>
Rate my live shitposting engine: https://meguca.org/all/
Working on drag and drop uploads.
>>
>>56537745
Haskell provides no value though.
>>
>>56537777
hello datafag
>>
>>56537777
Haskell is great
>>
File: hasklel.png (260KB, 600x800px) Image search: [Google]
hasklel.png
260KB, 600x800px
>>
>>56537777
Can't argue with those quads.
>>
>>56536249
Any advice to someone who wants to program java part time, but doesn't have a huge amount of general experience, just in the niche games I've been making?

Should I just remain neet and keep learning for the next year or two?
I cannot work full time. I've tried it and I have to quit as I'm too tired and unmotivated.
>>
>>56537834
what an unbiased and fair image
>>
>>56536249
>What are you working on, /g/?
Vita game manager in Rust.
>>
>>56537154
On a wannabe atkins sieve code. It's dumb.
>>
File: images1.png (9KB, 367x491px) Image search: [Google]
images1.png
9KB, 367x491px
>>56537834
>>
>>56537205
You're definitely fucking something up as far as the rules go. That doesn't look like Life at all.
>>
rate
fizzbuzz :: (Integral a, Show a) => a -> String
fizzbuzz n
| n `mod` 15 == 0 = "FizzBuzz"
| n `mod` 5 == 0 = "Buzz"
| n `mod` 3 == 0 = "Fizz"
| otherwise = show n

main :: IO ()
main = do
mapM_ putStrLn $ map fizzbuzz [1..100]
>>
>>56538013
Run of the mill Hasklel tryhard nonsense.
>>
>>56538013
>mapM_ putStrLn $ map fizzbuzz
mapM_ (putStrLn . fizzbuzz)
>>
>>56538033
How is it tryhard?

>>56538037
neat
>>
>>56537773
weeb/10

nbfam
>>
>>56538051
He's just mad because he sees it a lot
>>
File: sjw just like us right.png (212KB, 769x711px) Image search: [Google]
sjw just like us right.png
212KB, 769x711px
>>56537652
>>
>>56538103
Okay.
>>
>>56537868
>defending or criticizing an opinion
>unbiased and fair
>>
Is it bad that any code without semi-colons looks ugly/naked to me?
>>
>>56538142
Yes
>>
File: le horseshoe ecks dee.png (415KB, 1151x819px) Image search: [Google]
le horseshoe ecks dee.png
415KB, 1151x819px
>>56537700
>>
if .net is so bad then why so many website have .net at the end?
>>
>>56538191
to balance out the www.
>>
>>56538167
Neither one ever had a real job that they earned a paycheck from. Bernie lived off his wife's income until at age 34 he ran for political office.
>>
>>56538167
Despite the sarcasm, it makes sense that a national socialist and a democratic socialist do share similar ideas. If you want to draw another comparison, Mussolini was also a socialist in his formative years before going onto fascism.
>>
Is there a good python book for someone with experience in other languages and a solid grasp of programming paradigms?

Something like "Javascript: The Good Parts". A guide for syntax and style mostly.
>>
>>56538239
>Neither one ever had a real job that they earned a paycheck from.
Hitler served in the army though.
>>
>>56538256
Dive Into Python
>>
I'm developing something in Python that requires me to coerce several different forms of data to a single type. There are two approaches:

>Basic class, functions for coercion
class Book():
""" A generic book."""
def __init__(self, title, author, year):
self.title = title
self.author = author
self.year = year


def story_to_book(story):
""" Convert a some_module.Story object to a Book."""
# Extract details buried in the object
info = story.data['info']
title = info['title']
author = [author['name'] for author in info['authors']]
year = min(story['years_published']) # get first year published

return Book(title, author, year)

def poem_to_book(poem):
""" Convert a another_module.Poem object to a Book. """
# etc.

# Load up bookshelf
bookshelf = []
for story in magazine:
bookshelf.append(story_to_book(story))
for poem in poetry_collection:
bookshelf.append(poem_to_book(poem))
for # etc.



> More complex class, in-instance coercion

class Book():
""" A generic book."""
def __init__(self, text):
if isinstance(text, some_module.Story):
self.initialise_from_story(text)
elif isinstance(text, another_module.Poem)
self.initialise_from_poem(text)
elif # etc for all formats

def initialise_from_story(self, story):
""" Initialise from a some_module.Story object. """
info = story.data['info']
self.title = info['title']
self.author = [author['name'] for author in info['authors']]
self.year = min(story['years_published'])

def initialise_from_poem(self, poem):
""" Initialise from an another_module.Poem object. """
# etc

# Load up bookshelf
bookshelf = []
for story in magazine:
bookshelf.append(Book(story))
for poem in collection:
bookshelf.append(Book(poem))
for # etc.


Which of these is more pythonic?
>>
File: without randoms.webm (935KB, 480x540px) Image search: [Google]
without randoms.webm
935KB, 480x540px
>>56538008
better?
>>
>>56538325
performing much better
>>
cuz I can
let rec f n s =
if n > 100
then print_string s
else
f (n+1) (s ^ "\n" ^ (
(fun x -> if x = "" then string_of_int n else x) (
(fun x -> if n mod 5 = 0 then x^"buzz" else x^"") (
(fun x -> if n mod 3 = 0 then x^"fizz" else "")
""))))
in f 0 "";;
>>
>>56538315
i think the oop one

though doesnt realy matter
>>
>>56538008
>b-but muh correctness
>muh proofs
>muh hasklel masterrace
>>
for the webtorrent guy:
>>56536661
>>
>>56538375
datafag pls go
>>
i use haskel
*tips*
>>
>>56538402
>everyone that disagrees with me must be one person
>>
>>56538402
what's wrong with data?
>>
>>56538315
I like the second one better, can't really say why though. I guess it would depend on how this code is embedded in the bigger picture. From this snippet alone, it's hard to tell.

I don't think either one is more pythonic than the other.
>>
how's android studio on linux?
>>
>>56538412
>>56538419
samefag
>>
>>56538369
>though doesnt realy matter
Surely one is better than the other, in terms of ease of extensibility, readability, or even general idiomaticity.

Which would be more expected from a well written Python program?
>>
>>56538420
nothing, but the person who avatarfags him is obnoxious
kind of like if pepe was your favorite, but then smuggies started posting smug pepes and now you don't like it as much
>>
>>56538452
>what are post timers
>>
>>56538463
In my experience with Python, I rarely use

>>56538472
oh that is annoying.

Thought you were saying that data sciences/processing was shitty and was a bit miffed.
>>
>>56538472
>kind of like if pepe was your favorite
I hate you more than datafag now
>>
>>56538497
>I rarely use my own Objects

fuck me.
>>
>>56538500
is never was my favorite though
just used it as an analogy
>>
>>56538369
>>56538443
Fair enough though, I also suspected the second one, my only worry was that it would make the class a bit 'heavy' (code-wise and performance-wise) if there's many different possible types for `text`.
>>
File: le soulful fedora.jpg (78KB, 398x531px) Image search: [Google]
le soulful fedora.jpg
78KB, 398x531px
>I fap to type theory because I have no real skills
>>
564
Who are you quoting?
>>
>>56538564
datafag pls
>>
>>56538584
Every haskell fag ever
>>
>>56538598
I don't remember saying that
>>
File: kramer tips.jpg (70KB, 719x686px) Image search: [Google]
kramer tips.jpg
70KB, 719x686px
>I use Lisp
>>
>>56538604
but you thought it
>>
>>56538598
Haskell is barely type-theoretic.
>>
>>56538607
>datafag dissing his own language to pretend more people hate fp
>>
>>56538632
I don't masturbate to type theory but I do admit to not having real skills
>>
File: cuck suck.png (64KB, 328x489px) Image search: [Google]
cuck suck.png
64KB, 328x489px
>>56538636
>Lisp is not functional
>>
reminder that datafag is a yank shitposter who posts in /brit/ and everybody tells him to fuck off there too
>>
>>56538636
Hasklel is for muh functional purity though, Lisp is meant to be a general purpose dev tool.

Common Lisp is, anyway. I dunno why hipsters are so insistent on using Scheme in the real world.
>>
>>56538664
>only yanks 'dora post in /brit/
wew lad
>>
>>56538686
Functional purity is good
>>
>>56538633
they delude themselves into thinking it though
>>
>>56538691
i didn't say anything about fedora posting you wanker
>>
Just trying out Tkinter for the first time i like it alot.
>>
File: Screenshot_2016-09-10_16-28-36.png (1MB, 2560x1080px) Image search: [Google]
Screenshot_2016-09-10_16-28-36.png
1MB, 2560x1080px
>>56538712
ForgotPic
>>
>>56538723
>fucking your own fat pad
learned something new today
>>
>>56538732
Why tkinter instead of qt or pyside?
>>
File: nige don't care.jpg (29KB, 460x287px) Image search: [Google]
nige don't care.jpg
29KB, 460x287px
>>56538664
>>>/int/
>>
File: when_someone_insults_my_food.jpg (221KB, 742x1080px) Image search: [Google]
when_someone_insults_my_food.jpg
221KB, 742x1080px
>>56538723
Are you saying there's something wrong with gyoza?
>>
>>56538584
>>56538564
>>
>>56536411

fucking true
>>
File: file.png (43KB, 488x528px) Image search: [Google]
file.png
43KB, 488x528px
>>56536603
easy but a nice 10 minute killer
>>
>>56538751
i just found a tutorial online for user interfaces and the guy was doing it in tkinter.
>>
File: 2016-09-10-163717_703x486_scrot.png (39KB, 703x486px) Image search: [Google]
2016-09-10-163717_703x486_scrot.png
39KB, 703x486px
Wrote this question for y'all
It isn't homework. I have found the generalized form.
Want to see if any of you can implement it.
It can be written in many languages but a language that has higher-order functions will make this much easier.
>>
>>56537154
>Not liking python
>Not using python with your c++ code
Im sorry your such a sad fuck.
>>
File: comfy.png (240KB, 1440x900px) Image search: [Google]
comfy.png
240KB, 1440x900px
learning python using checkio plugin for pycharm it's comfy
>>
>>56538913
looks trivial, just has tons of symbols

do your homework

also L(1, -1, 0) looks a lot like the lg(n) fibonacci algorithm
>>
>>56538931
Python and C++ is both trash, but at least C++ performs well
>>
>>56538971
It is, the lg(n) fib algortithm.
This is the generalized format.

This isn't homework. Just a generalization off some homework I had for number theory. I would post the answers but that defeats the purpose of those who want to try it.
>>
what is the point of all these scripting languages like ECMAscript , actionscript, typescript, etc? Aren't they mostly used for client side scripting and transpiled to javascript? what benefits do they offer over javascript?
>>
>>56536603
Good shit, now back to work...

local exists = function(t, v)
for _, n in pairs(t) do
if n == v then
return true
end
end

return false
end

local create_table = function()
local ret = {}
while #ret ~= 9 do
local n = math.random(9)
if not exists(ret, n) then
table.insert(ret, n)
end
end

return ret
end

local did_win = function(t)
for i = 2, #t do
if t[i] < t[i - 1] then
return false
end
end

return true
end

local reverse = function(t, n)
local a, b = 1, n
while a < b do
t[a], t[b] = t[b], t[a]

a = a + 1
b = b - 1
end
end

local board = create_table()
print('Game board:', table.concat(board, ', '))

while not did_win(board) do
print('How many items to swap?')
local up_to = tonumber(io.read())
if not up_to or up_to < 1 or up_to > 9 then
print('Invalid option.')
else
reverse(board, up_to)
end

print(table.concat(board, ', '))
end
>>
>>56539010
It's the old c++ iso cartoon.
>>
>>56538973
C++
>Trash
What the fuck do you work with, Java and your hopes and dreams??
>>
>>56539037
Haskell
>>
what is the point of all these programming languages like C, go, haskell, etc? Aren't they mostly used for user space development and compiled to machine code? what benefits do they offer over machine code?
>>
>>56539080
abstraction
>>
>>56539010
At least ECMAScript is standardized.

Half of them are because the people implementing them are lazy, a quarter are because vendor lock-in, and a quarter are because armchair language designers think every CS meme belongs in a production environment.
>>
>>56539080
>go
>haskell
>spaec development

u 'avin a giggle m8?
>>
>>56539080
>what benefits do they offer over machine code?

readability
>>
>>56539080
lmao well played
>>
>>56539076
im sorry to hear that anon
>>
Thing I don't understand due to the Blub paradox = meme
Is that correct?
>>
I realize the stupidity of this question, but what text editor do you recommend for an Android device?
>>
>>56539163
sublime for everything
>>
>>56536385
lmao wtf is this ocaml shill. nigga had to put the pronunciation down but didnt fucking explain what the language is.
>>
>>56539172
how are you going to run sublime on an android idiot
>>
>>56539183
android is linux
>>
>>56539133
what
>>
>>56539133
no you delusional fucktard, it's not that critics can't understand hasklel and shit like that, it's just that hasklel is a shitty meme
>>
>>56539080
When you get to a certain level of complexity, you can't hold the whole program in your head at once without abstracting (if you disagree, you haven't written a big system)
When this happens, you will write more code that doesn't take into account some other state in the program, and you'll end up with bugs that are hard to deal with, and with enough time, you end up with your whole system being in jeopardy of having some pretty bad systemic issues.
>>
>>56536466
>>56536338
i like comments tbqh senpai
>>
>>56539183
Your phone not rooted op are you being cucked by google?

https://www.youtube.com/watch?v=bwH7lCsoANE
>>
>>56539390
>chink shit
no thanks, I don't want the botnet
>>
>>56539414
Hates chink shit
>Computer is most likely made of chink shit.
>>
>>56536521
Holy shit dude, the last nano version is 2.7. Get with the times gramps.
>>
>>56538037
is . a cons cel?
>>
>>56539473
Function composition.
(f . g) x = f (g x)
>>
>>56538191
Because every hope died with Jesus 2016 years ago.
>>
>>56539481
Sounds retarded, this kind of syntactic sugar does not help at all.
>>
>>56539512
It's not sugar, it's a defined operator.
(.) :: (b -> c) -> (a -> b) -> a -> c
f . g = \x -> f (g x)


Without it, the code would look like this:
mapM_ (\x -> putStrLn (fizzbuzz f))
>>
>>56538853

i = []
for i in range(1, 10):
i.append(i)


Why not

i = list(range(1, 10))
>>
File: transparentbug.png (124KB, 804x185px) Image search: [Google]
transparentbug.png
124KB, 804x185px
Hey g, how can I fix this transparent bug? (Windows Forms - C#)
>>
>>56539530
Being defined dosent make it sugar
>>
>download mingw
>get shell going to do this libtcod tutorial
>hg command won't work

what am I doing wrong lads? do I need to edit something?
>>
What do you think about a program like beets (http://beets.io/) made for video (movies, tv, etc)?

It could add tags for production staff + actors, download subtitles, understand seasons and episodes of series, organize + rename on disk.

It could also support automatically making a low-bitrate copy of everything for streaming, importing DVDs and BluRays raw or encoded, etc.

If you had access to Google's Content ID API used on YouTube, you could do fingerprinting like with MusicBrainz for audio, but I don't think any public databases like that exist. So it would probably be driven by heuristics for identifying content, walking the user through decisions with an interactive command line UI like beets.
>>
>>56539580
>transparent bug?
How did you notice the bug it you can't see it?
>>
>>56539588
What exactly is the sugar here? User-defined operators? There's literally no difference between user-defined operators and user-defined functions except one is infix.
>>
>>56539580
what's the bug? what's it supposed to look like? use your words, pajeet.
>>
>>56539512
>print (f (g (h ( j (i (n x))))))
>>
>>56539687
*print(f(g(h(j(i(n(x)))))))
fixed that for imperative fags
>>
>>56539592
>what am I doing wrong lads?
it's quite obvious: you are using windows
>>
>>56539714
I know, but why won't hg work out of the box like it's supposed to according to the mingw documentation? am I not understanding something?
>>
>>56539726
Nevermind I guess I had to redownload the entire thing from tortoise, what a pain in the bass
>>
>>56539627
The semantic is absolutely the same.
Its just syntax that is changed, hence syntatic sugar.
Dosent mean it is a bad thing, since most people are used the point operator from other languages(outside of people who only use Haskell).
>>
what OS does /dpt/ use for efficient cross-platform programming and compiling?
>>
>>56539785
syntactic sugar is good because it allows for conciseness and prettyness
>>
>>56539785
By that logic everything is just syntactic sugar for assembly.
>>
>>56539512
in a functional language it makes a big difference because you can make long chains of new functions out of old ones without using lambdas or stuff
>>
>>56539807
Windows and Debian
>>
>>56539807
Any GNU/Linux distro
>>
>>56539264
>language I know nothing about
>it's bad and I don't need to know anything about it to say that
>>
>>56539264
>it's not that critics can't understand hasklel and shit like that, it's just that hasklel is a shitty meme
explain to us what monads are
>>
>>56539637
he wants the frogs to have lilypads behind them
>>
>>56540053
is frog a toad or does frog have a toad
>>
Today I started working through the AngularJS Testing Cookbook.

It goes over testing using Jasmine, Protractor, Karma, and Testem. It also gets into automating using both grunt and gulp.

My test coverage on my work projects sucks, so I'm trying to improve it so that I can use it as a marketing tool to get other clients. They don't really understand what test coverage is, but if I can say something like "all of my projects have >90% test coverage for QA/QC assurance", they'll eat that shit up.
>>
>>56539938
a niceme.me
>>
>>56540086
Honestly you could say 50% and be ahead of the game.

We have zero unit tests at my work.
>>
>>56539900
>>56539910
would opensuse in a sandbox to crosscompile then test on my windjews be a good way to go?
>>
>>56540092
>>>/reddit/
>>
>>56539833
It is, which is why we all use it.

>>56539816
As long as it is properly pointed out that is
>>
Git sucks. There, I said it.

Now that I succeeded in irritating most people, let me explain: Git is an error prone overkill for most small and medium sized projects.

Remember, Git was created to handle Linux development; most projects have a single relationship with the remote server. So, first, it’s an overkill to use, like shooting pigeons with a Cruise missile.

Second, because of its power, it’s extremely complex and makes it really easy to shoot yourself in the foot.

Most version control systems need a page or two to explain the basic commands. The Pro Git book is 550+ pages long.

So why, you, as a developer would use Git? What happen to "the best tool for the job"? What happened to KISS (not the rock band)?

Is it because you want to look cool? Or you think your project is going to be as large one day as the Linux kernel? Or your company is forcing you to?

I apologize for my first post being a rant, but recently I was forced to use Git in a new repository and it has been nothing but pain, for almost every simple step my old trusty GitHub GUI started throwing errors.

Looking online, it’s like a rash – it’s not only me getting into issues. So the problem is deeper, I believe with the model itself. We need a simpler CVS; any suggestions?
>>
>>56540157
>Git sucks. There, I said it.
Wow, what a revolutionary.
>>
>>56540111
That's the dirty little secret though, isn't it?
Usability is, of course, what makes dollars happen, and "if it works, why write tests? It's already passed the user test".
But for a competitive differentiator, being able to point to actual statistics across my repos, where others might be too cowardly to post that kind of thing, it can make a customer feel like you're really taking care of them and watching their back. They might even be willing to sacrifice some usability for that kind of assurance.
>>
>testing when you can prove
>>
>>56540157
who /local backup to several drives and flashdrives/ here?
>>
>>56540157
http://ohshitgit.com
>>
>>56540157
>So why, you, as a developer would use Git?
because that's what i have to use
>>
>>56540202
You literally don't know how testing works or what it provides.
>>
>>56540157
>Remember, Git was created to handle Linux development; most projects have a single relationship with the remote server. So, first, it’s an overkill to use, like shooting pigeons with a Cruise missile.

Almost all version control systems are cruise missiles.

>Git is an error prone overkill for most small and medium sized projects.

How hard is add *, commit, push? You will rarely do anything else.

>So why, you, as a developer would use Git? What happen to "the best tool for the job"? What happened to KISS (not the rock band)?

Because a lot of other people using git posts shit to stackoverflow. The larger base you have to burn through questions and answers, the less likely you are to run into a situation which can't be solved by a simple search.
>>
>>56540234
>when you can prove
>>
File: 1452645498412.jpg (57KB, 900x900px) Image search: [Google]
1452645498412.jpg
57KB, 900x900px
>responding to stale pasta
>>
>>56540157
Hg > Git > SVN > CVS

Seriously, try branching and then merging your branches using SVN sometime. git-flow changed my world.
>>
>>56540113
>!nv.0k6WoTc
filtered
>>
i want to implement a gravity box with ncurses (hscurses)
I was thinking that it'd have a gravity like that of earth (9.2m^2?)
the possible directions a char could have is up, down, left, right, and diagonal
can anyone give ideas on how a char, with given instantanous velocity, and direction, would be affect by a gravity force coming from the x axis (the top of the window, since its ncurses)
or shoudl I approach it a different way

>>56540202
agda?
>>
>>56540251
>watching people reply to stale pasta instead of making your own
>>
>>56540258
>>/reddit/
>filtered
>>
>>56540251
whats the stale pasta?
>>
>>56540262
what kind of scale?
space sim or earth sim?
>>
The most recent project euler in python, since it's one of the few in the recent category that feels within my reach, however, I can't get it to work. I've managed to create a script that gets the answer in 60 seconds, but it's incorrect and I can't really tell why. If someone who's a little better than me wouldn't mind helping that'd be really nice (I might also add that it gives the answer 205 in the 100 case and 227 in the 110 case)
>>
File: snap_neural.jpg (389KB, 1366x671px) Image search: [Google]
snap_neural.jpg
389KB, 1366x671px
Please laugh at me, I need motivation.
>>
>>56540262
I mean, really this is a just slightly more advanced Matrix Ncurses example. There's a bunch out there, so maybe look at what those are doing.
>>
>>56540306
At least it's not Python
>>
>>56540280
the git one
>>
File: 1472797875953.jpg (163KB, 700x609px) Image search: [Google]
1472797875953.jpg
163KB, 700x609px
>>56537093
guten tag reddit
>>
>>56540306
<3
>>
>>56540306
Kurwa
>>
File: sad.png (203KB, 704x400px) Image search: [Google]
sad.png
203KB, 704x400px
>>56540251
>tfw you fall for it
>>
>>56540251
Does this qualify as its own stale pasta yet?
>>
>56540306
Why?
There's much less efforted (You)s m8
>>
Is it possible to stop one of the for loop statements from incrementing the loop ?
>>
>>56540365
--i;
>>
>>56540294
I don't know games.
But it'd have
* char collision
* char endurance (they'd poof after enough damage)
* possibly objects containing serveral chars
* a user controlled char that shoots gravity
I just want to get the barebones working though
>>
>>56540157
git add .
git commit -m "penis"
git push origin master

and you are done!
>>
>>56540306
If I was you I would kill myself, not even kidding.
>>
>>56540375
I tried this, but its causing an infinite loop.
>>
>>56540409
Post code
>>
>>56540406
Because of using Snap! or code quality?
>>
→56540359
shut the fuck up you fag
>>
>>56540409
>>56540365
>>56540375
>56540375
holy shit
this is what's happening
for (int i = 0; i < n; i++) {
if (i == 5) --i;
}
im fucking dying
>>
>>56540446
Because of Snap!. I used something similar in the past (Stencyl) and I would prefer to end myself than go trough that again.
>>
>>56540477
>magic numbers
no
Not even one, stop.
>>
>>56540446
it's not nearly that bad
>>
>>56540490
I have some condition making me unable to think about text as a code.
>>
>>56540237

>add, commit, push
And sometimes pull and clone, but yeah, that's all you really need for most tasks. Anything else you just google "git how do to #{thing}"
>>
>>56540477
It gets to five, and then decrements to four, and increments to five again at the end of the iteration. Repeat.
>>
how does

  #include <iostream>
int main()
{
for(int i = 1; i <= 100; ++i)
{
std::cout << i << '\r'; // return to beginning of line for overwriting with "Fizz" or "Buzz"
if(i % 3 == 0) std::cout << "Fizz";
if(i % 5 == 0) std::cout << "Buzz";
std::cout << '\n';
}
return 0;
}


find what's a multiple of both specifically? i understand it all except for that part
>>
>>56540532
>i % 3 == 0
by using %, i.e., the modulo operator
>>
>>56540510
>>56540526
im not either of the anons, just enjoying the predicament
>>
>>56540532
>if a then do x
..
>if b then do y
..

a and b

>if a then do x
x
>if b then do y
y
..

x
y
>>
>>56540532
there is no else
>>
>>56540325
This is the first occurence of this particular copypasta
>>
>>56540517
huwuzzuh
>>
>>56540532

The conditions are independent of each other. If something is a multiple of 3 and 5, both of the if statements will trigger, and it will print Fizz, then print Buzz.
>>
>>56540547
>modulo operator

TIL how to do fizzbuzz

Neat
>>
>>56540568
it's not
>>
>>56540477
What are you even trying to do ...
>>
>>56540517
But the text is right there on the pieces.
>>
>>56540577
can you use div in substitution?
>>
>>56540591
>reading comprehension
>>
>>56540597
If this text would be suddenly put aside colors and shapes I wouldn't even know if I wrote this code.
>>56540576
How is that? Look above.
>>
NEW THREAD!!

>>56540659
>>
>>56540306
>in the future all programs will look like this
>>
>>56540683
People will still be using c 89 in 2156.
>>
>>56540683
I think in the future we will have programs for writing programs anons.
Thread posts: 321
Thread images: 40


[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.