[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: 323
Thread images: 54

old thread: >>60567042

What are you working on, /g/?
>>
>>60572220
SOMEONE PLEASE GOD ANSWER THIS
>>60567137
>>
>>60572240
Use haskell
>>
>>60572246
THAT'S NOT AN ANSWER
>>
File: talk shit get hit.png (2MB, 1500x1333px) Image search: [Google]
talk shit get hit.png
2MB, 1500x1333px
>watching programmer talks on youtube
>everyone is a weak low test male with a vocal fry or an effeminate air in their vocal patterns
>macbook covered in feminist stickers 50% of the time

I wanna bully these numale programmer faggots so bad.
>>
>>60572278
>I wanna bully these numale programmer faggots so bad.
Pretty rich coming from a low energy weaboo
>>
>>60572278
>male
I wouldn't call them ``male".
>>
>>60572293
I think your teachers failed to teach you how quotation marks work
>>
>>60572292
Everything in your post reeks of reddit. Your kind is not welcome here.
>>
>>60572307
I missed you, gatekeeper. I was worried you go lobotomized yesterday.
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!

>>60572278
Yes, we know. This was already "discussed" in the previous shitty thread.
>>
>>60572320
https://warosu.org/g/?task=search&ghost=&search_text=dlang-chan

fuck off, you hypocritical low energy weeaboo false flagging piece of shit
>>
>>60572304
My father taught me how quotes work and I don't have any reasons to believe he was incorrect.
>>
>>60572336
>My father taught me how quotes work
Either he was a failure or his teaching was, both have the same effect
>>
File: ghfghfghfghfghfgh.png (44KB, 657x527px) Image search: [Google]
ghfghfghfghfghfgh.png
44KB, 657x527px
I outfit my bots with battleground sound effects from WoW so I get reminders of a time when I still had friends and fun and good things.
>>
>>60572316
Go be retarded somewhere else, like at reddit.
>>60572334
Why the fuck are you even here? If you're going to act like a fucking redditor, go to fucking reddit.
>>
>>60572354
So when is your next therapy day?
>>
>>60572343
>Either he was a failure
He can't be considered a failure by any reasonable definition of ``failure".
>or his teaching was
Why do you say so?
>>
learning c++ now

why is this language so fucking ugly and wonky
>>
haskell!
>>
>>60572370
>Why do you say so?
>>60572304
>>
File: 1489613614530.png (45KB, 236x350px) Image search: [Google]
1489613614530.png
45KB, 236x350px
>>60572334
>hypocritical
How? Also, please don't misuse weeaboo on an anime website. Thanks in advance.
>>
>>60572346
dumb frogposter
>>
>>60572385
Why do you think that isn't a valid way to use quotation marks?
>>
>>60572278
>be weak low test numale programmer faggot with an effeminate air in my vocal patterns
>alpha male attempts to bully me
>pull gun on him :^)
>>
>>60572400
>:^)
I don't want reddit stink nearby. Fuck off.
>>
>>60572396
https://en.wikipedia.org/wiki/Quotation_mark
>>
File: die.png (57KB, 520x390px) Image search: [Google]
die.png
57KB, 520x390px
>>60572375
Because you don't know how to use it.
>in leaning stage
>thinks is opinion matters
>>
>>60572407
> >:^)
lol when you put the meme arrow in front of it it looks like a mean face
>>
>>60572278
Could you show me some examples?
>>
File: 1495641113909.png (72KB, 1016x98px) Image search: [Google]
1495641113909.png
72KB, 1016x98px
>>60572414
>>
File: karen haskell.png (818KB, 1280x719px) Image search: [Google]
karen haskell.png
818KB, 1280x719px
>>60572378
this
>>
>>60572414
seasoned c++ programmer here
c++ is shit
>>60572375
basically it's because it's really really old and keeps trying to balance backward compatibility with keeping with the times
>>
>>60572431
lol
>>
>>60572278
You're watching the wrong talks. Those are the C grade speakers. Just slightly better than the D grade old programmers who have literally nothing to say other than do a verbal blog post about their experience with a thing. Probably to sell it to other old folks.
B grade is informative talks from organizations. Like khronos presenting new api. A grade is an expert in a field explaining general principle at their company. Like Mike Acton's talk here https://youtu.be/rX0ItVEVjHc or detail information or a discussion on a topic. Its a shame that there's no good correlation between popularity and quality.
>>
File: 1495510388344.jpg (155KB, 450x425px) Image search: [Google]
1495510388344.jpg
155KB, 450x425px
>>60572426
Redpill me on lambda calculus.
>>
>>60572458
e : \x.e
e e
x
>>
File: 1472926719246.jpg (206KB, 784x776px) Image search: [Google]
1472926719246.jpg
206KB, 784x776px
>>60572458
The first thing you need to know is that there isn't really one "lambda calculus". Most people seem to forget this for some retarded reason. Here is an example >>60572474
>>
>>60572458
Ignore this poster.
>>60572481
They are wrong, and are confusing the extrapolation of the lambda calculus to the description "a lambda calculus" for the actual lambda calculus, which is very much a single thing.
>>
File: opcodes.png (96KB, 620x550px) Image search: [Google]
opcodes.png
96KB, 620x550px
>>60572240
>>60567137
>Can someone correct me on this?
No, because it's true. Pic is related.

However, ISA extensions usually regard fairly esoteric instructions that don't necessarily need to be optimally encoded, and RISC-V has ample space in >32-bit instruction formats for those.
>>
File: disappointed.jpg (100KB, 450x539px) Image search: [Google]
disappointed.jpg
100KB, 450x539px
Any cute girls (female) in this thread? What is your favorite programming language and why?
>>
>>60572500
>lambda calculus
You can only use this wording when the statement you're making holds for every single lambda calculus.
>for the actual lambda calculus
There is no "actual lambda calculus".
>>
Best non-functional programming language??
>>
>>60572375
Combination of being a language designed by a committee, the proposals being pretty half-assed or compromised on because of old half-assed features or backwards compatibility with C.

Consider templates. They're just a poor mans metaprogramming. Anyone who has done some metaprogramming knows that. Its because the original attempt was half-assed. Does that belong in a major language?
No. Its absolute shit. Other languages do way better. The only virtues of C++ is that it has attempted to retain performance comparable to C code.
>>
>>60572523
Python. Because it is programming for retards that even girls can learn.
>>
>>60572527
https://en.wikipedia.org/wiki/Lambda_calculus
>>
>>60572527
https://plato.stanford.edu/entries/lambda-calculus/
http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf
https://en.wikipedia.org/wiki/Lambda_calculus
>>
>>60572552
>wikipedia
Post discarded. A quick look at that article actually confirms what I said. They claim that "the lambda calculus" is Turing complete, which isn't the case for every lambda calculus.

>>60572566
>plato.stanford.edu
>.de
>wikipedia
Post discarded.
>>
>>60572596
>random post by anon who keeps making idiotic remarks to convince people he's smarter than them on the internet
Post discarded
>>
>>60572596
>They claim that "the lambda calculus" is Turing complete, which isn't the case for every lambda calculus.
You will notice that they do not describe "several lambda calculi" but lambda calculus plain and simple. There is one such.

There are variants on it, but those are referred to by different names, such as "typed lambda calculus", not simply "lambda calculus", because that would be incorrect, as there is one, unique lambda calculus, viz. the one formulated by Alonzo Church.
>>
Debugging my game of life implementation
>>
>>60572626
>random post by anon
Post discarded.
>he's smarter than them
I didn't claim I was smarter. I just corrected someone's stupid mistake.

>>60572632
>There is one such.
Only if you add some word like "original" or "first" to it. Then there is only one "original lambda calculus".
>There are variants on it
Something with wildly different properties can't really be called a "variant". Something inspired by something else isn't necessarily a "variant" of it.
>"typed lambda calculus"
That isn't a name for anything in particular. There are a lot of things which would fit this description.
>as there is one, unique lambda calculus, viz. the one formulated by Alonzo Church.
You are aware that he didn't formulate just one lambda calculus, right?
>>
>>60572683
>>post discarded
>doesn't actually discard post
now if you could please stop pretending to know anything, as you are confusing beginners
>>
>>60572683
>Then there is only one "original lambda calculus".
Which literally everyone but you refer to simply as "lambda calculus".
>>
>>60572691
>doesn't actually discard post
Replying to the rest of it without agreeing is certainly discarding a post.
>you are confusing beginners
Any beginner can quickly find different lambda calculi which aren't even really similar.

>>60572701
Maybe you and your retarded friends refer to it like that, certainly not normal people.
>>
>>60572720
>Maybe you and your retarded friends refer to it like that, certainly not normal people.
Please post one significant citation, or consider yourself discarded.
>>
>>60572720
>Replying to the rest of it without agreeing is certainly discarding a post.
Nope.
>Any beginner can quickly find different lambda calculi which aren't even really similar.
Lambda calculi plural refers to calculi based on THE lambda calculus. _A_ lambda calculus refers to calculi based on THE lambda calculus
>>
>>60572728
My book refers to it like that.

>>60572749
>Nope.
Yes. Discarding a post once or twice doesn't change the end result.
>based on THE lambda calculus
What is "based on THE lambda calculus"? On which lambda calculus? Did you mean to say something like "original lambda calculus" or "untyped lambda calculus" or "the first lambda calculus"? Your post doesn't make sense as currently written.
>>
College student and hobbyist programmer here. Writing a Scheme-like language in C.

I'm a beginner in this particular pursuit, very familiar with C and Scheme but never written my own language before. Below is an outline of what I think I'll need and how I think I might do it:

>"namespace": abstract data type implementing a hash table, in which each value is a datum (see below)
>"datum": tagged union that can store any of the basic data types or a record (see below) or a lambda (see below-er)
>"record": pointer to a namespace
>"scope": stack of namespaces
>"lambda": struct containing a list of parameter names, a body to substitute them into, and a scope snapshot (deep copy) for other substitutions
>"syntax tree": tree whose value type is a string containing an s-expression and whose subtrees represent the smaller s-expressions inside it
>"interpreter": function that takes a string and does a depth-first traversal that builds the syntax tree in pre-order, evaluates it in in-order, tears it down in post-order, and yields the final value of the expression
>"garbage collector": function that maintains a static set containing every datum that still exists, does a depth-first traversal of the namespace tree, and deletes any datum in the set but not encountered in the traversal

I'm dreading actually doing all this. Especially writing the interpreter.

But paradoxically I also really want to.

But, like, I don't.

What do.
>>
File: you.gif (1MB, 270x180px) Image search: [Google]
you.gif
1MB, 270x180px
>>60572292
>>60572307
>tfw not a weeb or plebbit browser

You're both faggots.
>>
File: trash-3.png (728KB, 800x800px) Image search: [Google]
trash-3.png
728KB, 800x800px
>>60572798
>I can't cite anything
Discarded it is.
>>
>>60572822
>trash-3.png
I'm not surprised a reddit user such as yourself would be this retarded.
>>
File: dum forgpopstr.png (22KB, 296x378px) Image search: [Google]
dum forgpopstr.png
22KB, 296x378px
>>60572827
>>trash-3.png
I'm not a such as would be this.
>>
>>60572801
>I'm dreading actually doing all this. Especially writing the interpreter.
Your understanding of it should be enough. You could also try writing it in Scheme itself first.
>>
>>60572852
Don't reply to my posts. I don't want to be in any way associated with you and "people" like you.
>>
>>60572852
dumb frogposter
>>
So I know fuck all about programming, but I'm intending to go into engineering. What would b a good language to learn?
>>
>>60572904
Mathlab
>>
File: pemg.jpg (5KB, 1000x653px) Image search: [Google]
pemg.jpg
5KB, 1000x653px
>>60572869
>>60572897
>he probably doesn't even C++
>>
>>60572923
>sepples
That actually explains everything.
>>
>>60572923
C++ is exactly the sort of language I'd expect a frogposter like you to love
>>
>>60572920
:^(
>>
>>60572852
Please don't make retarded replies in my (>>60572822) name.
>>
File: doobmcfroob.jpg (3KB, 373x550px) Image search: [Google]
doobmcfroob.jpg
3KB, 373x550px
>>60572931
>>60572939
>he literally does not even c++
kek what an fegot
c++ is the single best language ever made it is far faster than even c
>>
File: lang-matrix-2.png (463KB, 785x678px) Image search: [Google]
lang-matrix-2.png
463KB, 785x678px
>>60572970
Picture explains why you are objectively wrong.
>>
>>60572904
Python and R are quite engineery
C is always a good bet. Compiled languages, though a scarcity these days, are important because you can use them to make better use of your processing power if you have large problems to process, and out of all the compiled languages out there, C is probably the most friendly
>>
>>60573008
I think I might start with C desu
>>
File: lel.png (150KB, 1280x1280px) Image search: [Google]
lel.png
150KB, 1280x1280px
>>60572994
wrong, C++-chan would never cosplay he is too cool
C is a stutid faguet that why she are cosplaqy
>>
>>60573008
language aren't compiled, implementations are

> C is probably the most friendly
to the machine maybe (and a 70s unix mainframe at that), not the programmer
>>
>>60573021
>language aren't compiled, implementations are
There are certain languages which are almost universally implemented as compiled and certain languages only very rarely so, and not much overlap between those two categories. It therefore makes sense to call a language "compiled" or "interpreted" even if one theoretically CAN be implemented as the other.

>to the machine maybe (and a 70s unix mainframe at that), not the programmer
Reminder that we're talking about compiled languages here. Compiled languages in general (specifically ones that aren't bloated and whose object code can run on bare metal) are not very friendly. But I'd sure as hell rather write C than, for example, Algol.
>>
>>60573043
>It therefore makes sense to call a language "compiled" or "interpreted"
It doesn't. "usually compiled" or "usually interpreted" makes sense though.
>>
>>60573055
Such names are too long. There's an important and useful difference between making sense and being perfectly and pristinely precise.
>>
>>60573043
> Compiled languages in general (specifically ones that aren't bloated and whose object code can run on bare metal) are not very friendly.

Was gonna mention a few, but you'd probably call them bloated (^:
>>
>>60573066
Sure, that's why you omit them when it's clear from the context. Which doesn't mean "compiled" on its own makes any sense.
>>
>>60573076
>Was gonna mention a few, but you'd probably call them bloated (^:
Please, enlighten me. The more, the merrier; and even if they are bloated, they still have a rightful place in the world of software development so long as the compromise in time and space requirements is outweighed by the increase in abstraction.
>>
>>60573109
Haskell, Common Lisp, Racket, ML, Rust, etc.
>>
>>60573131
>Haskell, Common Lisp, Racket,
These are pretty nice languages, but they're pretty slow. The fact that they need garbage collection doesn't help much. Like I said, they certainly do have a rightful place in software development, in my opinion. But I maintain that place might not be the field of engineering. In my limited experience, engineering problems are considerable in scope, and should be tackled with an emphasis on speed over elegance.

Also, as an aside, it's somewhat unfortunate that Racket embeds itself in its executables.

>ML,
Never heard of this. Thanks, I'll check it out.

>Rust,
I've been meaning to check this out, too. It does look even more bloated than C++, but, as I've been saying, that's not necessarily a bad thing. For certain projects where abstraction is paramount and speed is not, I have been looking for a more usable alternative to C++; this might be it.
>>
File: 1492645822407.jpg (26KB, 500x372px) Image search: [Google]
1492645822407.jpg
26KB, 500x372px
So when I was a wee lad I started programming in C++ got scared and ran away,then maybe a year and a half later I got a itch and pick up python,really clean, made basic programs for for myself then I just programming.Started again but this time pick up C++ and java but turn to C++ since I found a pretty good tut for it and really liked it,felt like I was reaching a millstone making programs for myself ,then I stopped programming...

I got into Community college to force myself on a language and guess what the intro class was?Python through "how to think like a computer scientist" free book. Class was piss easy but tedious.Time went on pick up java and learn OOP and did decent then came C# and was similar to java but didn't do well enough then went to C++ which I thought I was familiar with but nope turns out I forgot C++ and the practices I learn from the tut and shit the bed on assignments and haven't really programmed since.

By now I forgotten python, java and maybe C# but still remember basic C++ stuff for some reason which bring me to my question would C be good starting point learn programming again and stick with it then finally put this C++ bitch to bed? Is it me or does everyone learning through "phases" long periods of nothing come back to it and then break a barrier,I highly doubt the best programmers program every waking day since they were a kid.
>>
>>60573187
Common Lisp also "embeds" itself inside executables by default, as you can evaluate and compile code at runtime. However, you can get around this by deleting symbols bound to those functions.
>>
>>60572304
>she doesn't know the difference between ``emphasis marks" and ``quotation marks"

>>60572407
>not using the smiley with the carrot nose

>>60572458
I have no idea what it is but apparently it's kind of like the C preprocessor but with math

>>60572529
C

>>60572970
>it is far faster than even c
Wrong. It's at best equal, and that's only true if you write C-style C++. Its main advantage lies in greater use of abstractions - which, inevitably, does have some runtime cost.

>>60573043
What exactly makes C better than Algol?
>>
File: 6cf.png (361KB, 858x725px) Image search: [Google]
6cf.png
361KB, 858x725px
>>60573268
>Wrong. It's at best equal, and that's only true if you write C-style C++.
WROG IT ARE FASTOR
>>
>>60573301
You are fake news.
>>
File: Untitled.jpg (5KB, 858x725px) Image search: [Google]
Untitled.jpg
5KB, 858x725px
>>60573314
TRMUP WON U STIPID LIBEREL
KLIL YUORSLF
>>
>>60573268
>What exactly makes C better than Algol?
Couldn't say, I just like it a lot better.

Some other bare-metal compiled languages I like C better than:
>Fortran
>Cobol
>Ada
>>
>>60573187
>pretty slow.
I can't speak for Haskell, but SBCL is pretty fast on many common algorithms, fampai. Racket is a fair bit worse, though. I know it's just one single anecdote, but I recently wrote a small and simple benchmark that I used to compare a few different languages, and the runtimes were as follows:
>C with extensive GCC optimization options: 2.9 seconds
>Java: 3.0 seconds
>C with ordinary GCC options: 3.1 seconds
>SBCL: 4.3 seconds
>Racket: 34 seconds
>CPython: ~300 seconds
>>
>>60573187
>I've been meaning to check [Rust] out, too.
For the record, I recently did check out Rust cursorily, and I wasn't too impressed. It seemed like C with a few enforced rules just to ensure you don't shoot yourself in the foot. Granted I didn't delve very deep, but my first impressions weren't strong enough that it seemed meriting to delve further.
>>
File: 1492831891533.png (341KB, 556x561px) Image search: [Google]
1492831891533.png
341KB, 556x561px
>>60573432
>Benchmark
>No source code
I'm sick of this meme.
>>
>>60573553
It was a little while ago and I didn't keep it.
>>
>>60573579
Then any and all results are meaningless.
>>
>>60573587
I did say it was just an anecdote.
>>
File: 547575757.jpg (58KB, 720x480px) Image search: [Google]
547575757.jpg
58KB, 720x480px
>>60573218
maybe I should have used an anime pic
>>
>>60573579
>>60573553
Actually, it seems I manage to locate most of it. It's just the C code that I've thrown away, and I'm sure you can reconstruct how it would have looked like.

SBCL version:
(defun test-hash-file (path)
(with-open-file (s path :element-type '(unsigned-byte 8))
(let ((buf (make-array 65536 :element-type '(unsigned-byte 8)))
(h 0))
(loop (let ((ret (read-sequence buf s)))
(when (= ret 0)
(return-from test-hash-file h))
(dotimes (i ret)
(setf h (logand (+ (* 31 h) (elt buf i))
#xffffffff))))))))
>>
>>60573659
Racket version:
#!/usr/bin/racket
#lang racket

(define (hash-port s)
(let again ((h 0))
(let ((data (read-bytes 4096 s)))
(if (eof-object? data)
h
(let byte ((i 0) (h h))
(if (>= i (bytes-length data))
(again h)
(byte (+ i 1) (bitwise-and (+ (* 31 h) (bytes-ref data i))
#xffff))))))))

(call-with-input-file (vector-ref (current-command-line-arguments) 0)
(lambda (s)
(print (hash-port s))
(newline)))
>>
>>60573664
Java version:
import java.util.*;
import java.io.*;

public class test {
public static int hash(String fn) throws IOException {
int h = 0;
byte[] buf = new byte[4096];
try(InputStream in = new FileInputStream(fn)) {
while(true) {
int ret = in.read(buf);
if(ret < 0)
return(h);
for(int i = 0; i < ret; i++) {
h = (h * 31) + (buf[i] & 0xff);
}
}
}
}
}
>>
>>60573667
Python version:
#!/usr/bin/python3

import sys

h = 0
with open(sys.argv[1], "rb") as fp:
while True:
data = fp.read(4096)
if data == b"":
break
for b in data:
h = ((h * 31) + b) & 0xffffffff
sys.stdout.write("%i\n" % h)
>>
>>60573664
>#xffff
I probably modified that afterwards to see if 16-bit operations would be faster due to fixnum width or whatever. It should say #xffffffff to be the same as the others.
>>
File: cuck.png (321KB, 372x539px) Image search: [Google]
cuck.png
321KB, 372x539px
What's a good language to learn if I want to learn a whole new programming paradigm?

Rust/Go is basically C with forced dogmatism and C++ is more of the same.
>>
File: incremental improvement.png (825KB, 1482x969px) Image search: [Google]
incremental improvement.png
825KB, 1482x969px
What a good waste of time
>>
>>60573808
>Rust/Go is basically C with forced dogmatism
I agree for Rust, but that hardly seems descriptive for Go. I'm not a Go fan, but I didn't find any forced dogmas in it.
>>
>>60573847
Go has pointers but doesn't allow pointer arithmetic, I'd say that's pretty dogmatic.
>>
What are projects/programs that you've made that you would include in your portfolio? Or do you just include everything you make? Graduating as CE but I figure any bit of talent I can show employers I have the better, but I'm not sure if I should include everything.
>>
>>60573863
Fair point, perhaps, but I'd argue it has more to do with implementation than with dogma, since you can't really have a precise GC with non-managed memory. Also you virtually always do the exact same things with arrays.
>>
File: async_by_molen.png (307KB, 1223x695px) Image search: [Google]
async_by_molen.png
307KB, 1223x695px
I'm an amateur Python programmer. I use threads usually in the same way every time: main thread fetches URLs, puts new URLs in the queue, several threads are always running and calling get on that queue so they download those URLs when new ones appear.

There's a lot of talk about async/await stuff in Python recently, and I'm wondering if it can help me in any way.

I've spent about an hour reading all about those features and still can't really get why I should use them (if at all) and when they should be used in general.

Can a kind anon help me out? Suggesting a good learning resource would suffice.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>60573808
Fortran and if you disagree you're a fucking idiot.
>>
>>60573964
>Threads in Python
>>
>>60574009
What makes it different from C?
>>
File: He's watching.png (286KB, 294x392px) Image search: [Google]
He's watching.png
286KB, 294x392px
So, I just completed my computer science I course, which covers from basics to the beginning of structs in cpp. Could you guys recommend me sources to study because i will have lots of free time and i'm very eager to learn.
>>
File: old-hags.png (176KB, 600x309px) Image search: [Google]
old-hags.png
176KB, 600x309px
>>60574009
Let me take this second opportunity to remind you that 2/3 languages in your picture are at most middle-aged.
>>
>>60574028
It puts the lotion on its skin or else it gets the hose again.
>>
>>60574010
For I/O, yes, very much.
>>
>>60573816
Why is find so fucking slow?
>>
>>60574086
filesystems are big and complicated
>>
>>60573964
>I've spent about an hour reading all about those features and still can't really get why I should use them (if at all) and when they should be used in general.
It's basically a way to write event-based code instead of thread-based. IMO it's an ugly kludge where Stackless Python does the correct thing and should be merged into mainline, however, so I don't really want to touch it.
>>
>>60574086
i'm pretty sure find only exists to complement xargs to resolve a fundamental limitation of the unix pipe system

you couldn't actually pipe in an arbitrary number of arguments because the shell would run out of memory, so if you wanted to do shell commands acting on thousands of files, you needed to feed a file list from find
>>
File: yukari_messy_eater.png (655KB, 624x804px) Image search: [Google]
yukari_messy_eater.png
655KB, 624x804px
>>60574067
Ask me if I give a fuck.
>>
>>60574133
What's that coming out of her mouth?
>>
>>60574166
>her
>>
>>60572220
What is a good anime-like programming language?
>>
>>60573816
What's this new meme?
>>
>>60574086
Why do you consider less than a second for searching every single directory on your system "slow"?
>>
File: expand.png (715KB, 750x1005px) Image search: [Google]
expand.png
715KB, 750x1005px
>>60574207
Fortran.
>>
>>60574226
Is there a proof of it being anime-like?
>>
File: fun_things_are_fun.png (444KB, 940x444px) Image search: [Google]
fun_things_are_fun.png
444KB, 940x444px
>>60574242
Think.
>>
>>60574210
>Less than a second
>real 1.5
>>
>>60573268
>(((Emphasis)))) mark
Plebbit wants you back
>>
>>60574209
a program is a meme?
>>
>>60574256
>set theory
0/10
>>
>>60574365
I/O is not a program.
>>
>>60574425
I/O is a tool used exclusively by mediocre programmers.
>>
>>60574448

Pretty much every program on your computer could not work without I/O, including the web browser you are using to make your posts.
>>
Why did a subhuman just reply to me?
>>
File: vortex2[1].jpg (242KB, 1181x682px) Image search: [Google]
vortex2[1].jpg
242KB, 1181x682px
I want to make a particle physics simulation that runs on a GPU. I think I know how I want it to work, but I don't know what language or frameworks would be best to use for this because I've never done anything quite like it. Any suggestions?
>>
So I'm writing a guessing game in python and I'm having a bit of trouble. The code I'm using works for words that don't repeat character, example, "wolf" works (explained below) and "noodle" does not.
Say the word is "google".

correct_word = "google"
guess = "o"
user_word_length = 5
blank_guesses = "-" * user_word_length
blank_guesses = list(blank_guesses)
blank_guesses[correct_word.index(guess)] = guess
blank_guesses = "".join(blank_guesses)
print(blank_guesses)

When the user guesses "o", I want the blank_letters to change to "-oo---".
At the moment, I'm making the blank_letters a list, and then replacing the letters by index.
But the output becomes:
-o----

And not "-oo---"
>>
>>60574516
*blank_guesses, not blank_letters
>>
File: test (11).png (761KB, 1280x720px) Image search: [Google]
test (11).png
761KB, 1280x720px
>>60574515
>particle physics simulation
What do you want to calculate? Feynman diagrams?
>>
>>60574516
List comprehension
>>
>>60574579
Not entirely sure what you mean, pretty new to this. Everything I'm searching doesn't help.
>>
What's the best way to handle outputting data when you don't know when the end is?
Outputting in bulk is obviously the most efficient because printing to the screen is slow but since I may never reach the end doing that's silly. So do I set an interval to print at (e.g. every 100 lines or no more input) or do I run it on a timer-based system (e.g. every 100ms).
For a bit more information, the input's a just a concurrent queue where shit's shoved in there when it needs to be printed to the screen.
>>
>>60574531
Not quite so abstract, the goal is to model collisions of astronomical bodies. It's basically an n-body simulation
>>
business idea: VR IDE for type theory where the syntax is building blocks
>>
File: Yakumo.Ran.full.1250328.jpg (230KB, 533x746px) Image search: [Google]
Yakumo.Ran.full.1250328.jpg
230KB, 533x746px
>>60574657
Write out the Lagrangian and numerically integrate the equations of motion. See Numerical Recipes for ODE integration techniques and methods.
Use either C or C++ since there are ODEINT libraries for those languages out there.
>>
>>60574639
blank_guesses_index = [i for i, x in enumerate(correct_word) if x == guess]
>>
>>60574686
i shouldn't have posted that
>>
>>60574711
Good thing no one cares about VR.
>>
>>60574720
consumers don't. enterprise must. where else is the money coming from?
>>
>>60574732
and startups with decent sponsors
>>
File: 1465401721108.gif (2MB, 320x228px) Image search: [Google]
1465401721108.gif
2MB, 320x228px
>>60573816
>Ada
>>
>>60574747
and don't forget multimedia! especially with mobile vr, movies, television, sports, etc.
and facebook's still pushing vr hard
>>
>>60574703
blank_guesses_index = [i for i, x in enumerate(correct_word) if x == guess]

But how can that help output "-oo---"?
>>
>>60574827
That gives you the index in a list. I gave you that simple example hoping you will go read and learn. You then do another for loop with the indexes and replace the blank_guesses.

correct_word = "google"
guess = "o"
user_word_length = 5
blank_guesses = [guess if x == guess else "-" for i, x in enumerate(correct_word)]
blank_guesses = "".join(blank_guesses)
print(blank_guesses)
>>
>>60572278
If I start a patreon for chad programming videos will I make a thousand bux a week?
>>
>>60574937
If you like sucking dicks. Sure.
>>
File: 14715296417416.png (134KB, 500x500px) Image search: [Google]
14715296417416.png
134KB, 500x500px
>>60572220
What IQ is needed for being good at programming?
>>
>>60575077
I heard 50 is a good IQ to have.
>>
>>60575082
I have 20 more than that. Is that good?
>>
>>60575099
Yes. What is your race btw?
>>
>>60575104
Black, but why does it matter?
>>
>>60573808
Forth
Prolog
Lisp
Smalltalk
Assembly
>>
>>60575175
>Forth
>Prolog
Good languages.
>Lisp
>Smalltalk
>Assembly
Absolute trash.
>>
>>60575190
Maybe you think that, but at least they're unrecognizable trash to most people.

Good to know your enemies and such
>>
>>60575140
No no. Just curious.
>>
>>60575200
>Maybe you think that
I think that because it's simply how reality is. All of the languages I claim to be shit are indeed shit in this case. It's actually pretty easy to verify that for yourself.
>at least they're unrecognizable trash to most people
What do you mean?
>>
>>60575252
i mean most people don't know them, and it can still be good to learn bad things because maybe you'll learn why they're bad
>>
int main()
{
Object* obj = calltoAPItocreateobject();
calltoAPItomesswithdata(obj->data); //data is a pointer that gets passed around inside the API
calltoAPItodelete(obj);
return 0;
}


>works fine

void foo(Object** obj)
{
*obj = calltoAPItocreateobject();
}

int main()
{
Object* obj;
foo(&obj);

calltoAPItomesswithdata(obj->data); //segmentation fault occurs here when trying to access data pointer
calltoAPItodelete(obj);
return 0;
}


>segmentation fault, see above

fucking why
>>
>>60575261
Sure, but you have to at least be aware of how shit they are. Lisp for example is known for deluding otherwise perfectly fine brains.
>>
>>60575269
Use Rust
>>
>>60575275
You're asking for people to believe you without verifying themselves. If you yourself know how bad lisp is, how do you know you're not deluded as a result of the experience?
>>
>>60575295
>You're asking for people to believe you
I didn't ask anyone to believe me. If they aren't delusional it will be immediately obvious as soon as they start learning the language. I'm just saying that there is a risk involved in doing that.
>how do you know you're not deluded as a result of the experience?
I recognize "Lisp is complete shit" to be a self-evident statement.
>>
>>60575327
what's good about prolog and forth?
>>
>>60575342
They aren't complete shit and they don't insult the intelligence of their users. Which can't be said about many languages.
>>
>>60575357
i agree that forth doesn't insult the intelligence of the user, that's pretty obvious
but prolog does, it holds your hands for you all the way
>>
>>60575269
Only thing I can think of is make sure calltoAPItocreateobject returns an Object*, and that the object created actually has a member called data.
>>
So, my aim is to make small utility apps for free which people can use (like wget or ffmeg etc).
Which market will give me the most interested users and downloads? Windows PC, or Android phones?
>>
>>60575291
Thanks, I'll think about it, I'll have to get comfortable with the borrow checker first before embarrassing myself
>>
>>60575366
The only way I think it might insult the user's intelligence is by being merely a first-order logic. That's actually a fair point.
>>
>>60575424
>Which market will give me the most interested users and downloads?
my peenus weenus of course haha :DDDD
>>
>>60575424
Windows, and there is IDM already
>>
>>60575571
>IDM
what is that even
>>
>>60575269
Did you try testing the value of obj against NULL after passing it to foo()?
>>
>>60575269
>Object
>>>/b/
>>
File: idris.png (116KB, 888x860px) Image search: [Google]
idris.png
116KB, 888x860px
>It's a statically-typed PL
>Where you can change types at runtime based on user input
>And it's still gonna be type-safe
I'm reading the book and doing the exercises just fine, but I still can't wrap my head around it, it's just so weird.
>>
fn main() {
let p: *const u8 = std::ptr::null();
println!("{}", unsafe{ *p });
}

Output:
Segmentation fault


WTF, i hate Rust now
>>
>>60575681
>It's a statically-typed PL
Which reduces to "it's a typed PL".
>>
>>60575703
Rustfags BTFO!
How will SJWs ever recover?
>>
>>60575717
No? Dynamically-typed languages are typed too, you can't add a string to an int in Python.
>>
>>60575728
>"Dynamically-typed"
That's a self-contradiction.
>you can't add a string to an int in Python
So? "Dynamic typing" being a contradiction is independent of any programming language in particular.
>>
>>60575703
We need to report this to the Rust team ASAP, tell them they've failed miserably and it's time for them to stop wasting everybody's time.
>>
>>60575741
There is a difference between dynamically typed / statically typed and strongly typed / weakly typed.
>>
>>60575762
>There is a difference between dynamically typed / statically typed
Of course there is a difference between something which does not and cannot exist and something which is just a redundant term.
>strongly typed / weakly typed
That's irrelevant right now.
>>
>>60575741
Are you a Pierce fanboy? He's the one who claims that "types in dynamically-typed languages are not types but merely runtime tags". Like, yeah, we get it, they're different from your math, but neither you nor your math has the monopoly on the English language.
>>
>>60575790
Just ignore the troll.
>>
>>60575703
the value of the pointer is segmentation fault??
>>
>>60575703
with Ada.Text_IO;

procedure Main is

type Integer_Access is access all Integer;
package I_IO is new Ada.Text_IO.Integer_IO (Integer);

X : Integer_Access := Null;

begin

I_IO.Put(X.all);

exception

when Constraint_Error => Ada.Text_IO.Put_Line("wft? I love Ada now?");

end Main;
>>
>>60575790
>Are you a Pierce fanboy?
No. I don't even know much about him.
>they're different from your math
What is different from "my math"? I didn't say what you just ascribed to me.
"dynamic typing" is a self-contradiction in the English language. Obviously any non-broken math would reflect this.
>>
>>60575822
>exception
Stopped reading right there.
>>
>>60575790
>He's the one who claims that "types in dynamically-typed languages ...
So he claims "dynamically-typed languages" exist. Therefore I can't possibly agree while acknowledging the truth of them being impossible.
>>
>>60575819
No, dereferencing a null pointer is.
>>60575822
>he unironically takes the bait
>Ada doesn't even have unsafe blocks
>Everything in Ada is unsafe
>Null pointer dereference is an exception
>Meaning there are runtime checks all around the code
Wew, lad.
>>
File: 1487865338241.jpg (94KB, 600x450px) Image search: [Google]
1487865338241.jpg
94KB, 600x450px
>>60575822
>Exceptions
>>
>>60575862
as opposed to what else
>>
>>60575860
Those are some mighty leaps in logic, rustartisan.
>>
>>60575860
What is ``unsafe"?
>>
>>60575880
>rustartisan
rustacean*
>>
I'm doing error calculations for data in python with the NumPy add-on, but it's giving me this infinite matrix shit. The two matrices should be the same.
import numpy as np
import matplotlib.pyplot as plt
import scipy.linalg as linalg

x = np.array([0,1,2,3])
y = np.array([3.0,5.3,7.8,10.0])
sy = (y+0.5)*0.05

c_poly, cov_poly = np.polyfit(x, y, 1, w=1/sy, cov=True)

A = np.column_stack([x/sy, np.ones(x.size)/sy])
a = np.dot(A.T, A)
b = np.dot(A.T, y/sy)

c_matrix = linalg.solve(a,b)
cov_matrix = linalg.inv(np.dot(A.T, A))

print("_"*60)
print("poly:")
print(c_poly)
print(cov_poly)
print("matrix:")
print(c_matrix)
print(cov_matrix

____________________________________________________________
poly:
[ 2.35320403 2.99434068]
[[ inf -inf]
[-inf inf]]
matrix:
[ 2.35320403 2.99434068]
[[ 0.02180461 -0.01389099]
[-0.01389099 0.0273755 ]]
>>>
>>
>>60575942
The matrix is no longer a bunch of "inf"s if I increase the data set size, but it's still wrong. Any hints?
>>
>>60575703
>Being too retard for rust
If you want to pass in a pointer use {:p}. In brainlet languages it's equivalent to printf("%i", 23) instead of printf("", 23)

Dumb C toddler
>>
>>60575942
>python
Stopped reading right there.
>>
Learning c++. Is it suppose to be this easy?

A lot of my class is struggling when they are comp sci majors. I was just a Japanese major who got told to live in the real world so i decided to do compsci too but cant pass calculus...

anyway it's just a intro class to comp sci but we learning c++ too which is cool. the latest thing we learned is functions and arrays. Just finished loops and file usage.

how much harder does it get? I saw some different statements around like std::cin; or stuff like that. what type of stuff is that? eventually does c++ stop using namespace std?
>>
>>60575896
Dereferencing a raw pointer, for example.
>>
File: 1469752633533.png (34KB, 666x666px) Image search: [Google]
1469752633533.png
34KB, 666x666px
>>60575981
I was merely an act
>>
>>60575994
>c++ which is cool
It's a horrible and poorly designed language.
Anyone who thinks that it's good, or even passable, clearly has a metal problem.
>>
>>60576015
SNIBEDDI SNAB :DDD
>>
https://www.youtube.com/watch?v=x8Ceybl7i4A
>>
>>60576015
>>60576057
fn main() {
let snib :&str = "SNIBEDDI SNAB :-DDDD";
println!("{}", snib);
}
>>
>>60575860
>Meaning There are runtime checks
Not if you don't want, friend ;)
with Ada.Text_IO;
with Ada.Unchecked_Deallocation;

procedure Main is
pragma Suppress (All_Checks);

type Integer_Access is access all Integer;
procedure Free is new Ada.Unchecked_Deallocation (Integer, Integer_Access);
package I_IO is new Ada.Text_IO.Integer_IO (Integer);

X : Integer_Access := new Integer'(3);

begin

Ada.Text_IO.Put_Line("Test returns " & Integer'Image(X.all));
Free(X);
Ada.Text_IO.Put_Line("Test returns " & Integer'Image(X.all));

exception

when Constraint_Error => Ada.Text_IO.Put_Line("wft? I love Ada now?"); -- runtime check
when Storage_Error => Ada.Text_IO.Put_Line("back in the game"); -- we got a segfault

end Main;
>>
>>60576028
I think it's cool that we are learning a language in a into comp sci class. I never done programming or know about any other languages but their names like java or python or ruby.

C++ is the first language i learned and so far it seems easy and cool. I mean I dono how i'll feel about it after i learn others tho. Is it a good sign that c++ seems fun to me? maybe the others will be even more enjoyable.
>>
>>60575988
You know there's nothing unusual with using python for small quantity data analysis, right? It's what my uni's physics department uses.
>>
>>60576169
>You know there's nothing unusual with using python for small quantity data analysis, right?
Yes. But how is that relevant? The language is still shit.
>>
File: rust.png (22KB, 1047x743px) Image search: [Google]
rust.png
22KB, 1047x743px
>>60576104
>His compiler compiles use-after-free
Why would anyone use such an unsafe language?
>when Storage_Error
This is still an exception, to turn the SIGSEGV signal into one you have to have runtime and stuff.
>>
File: 1429481730847.png (2MB, 1680x1050px) Image search: [Google]
1429481730847.png
2MB, 1680x1050px
>>60572278
>not being an alpha gentoo developer
>>
>>60576131
>I think it's cool that we are learning a language in a into comp sci class
Not really. Learning any given language is pretty easy and you don't need a class for that.
>Is it a good sign that c++ seems fun to me?
C++ is an exceptionally bad language, so I would say no.
I guess it's a good sign in the sense that you enjoy the subject you're studying.
>>
>>60576210
I see I see.
what's the best way to learn languages without classes then. Im thinking about learning COBOL just so i can make money once the oldguys die and I can maintain them old apps companies use,
>>
>>60576183
I wouldn't say it is comparatively bad for data analysis, and I'd say it's pretty speedy to code. What else could you want?
>>
>>60576232
>Learning COBOL
F
>>
>>60576232
>what's the best way to learn languages without classes then
A language not having cl*sses doesn't somehow imply it's not trash.
>>
File: 1484846006225.gif (3MB, 500x375px) Image search: [Google]
1484846006225.gif
3MB, 500x375px
>>60572278
>>
>>60573218
I've had similar phases. At first I just wanted to code just because I liked computers.
> had JS phase, then dropped because I was too illiterate w/ computers @ the time
> fell in love with Python and wrote a lot of scripts.
> came back to JS because webdev was interest and something that was really easy to learn.
> realized webdev is lame and I didn't want to be making websites for a living because it wasn't fun.
> started actually getting into the science behind computers
> picked up C and it has become something I've actually stuck too
So ever since then I've been reading C books as well as some stuff on general programming.
>>
>>60576185
>Unsafe language
>Still clearly safer
Pretty delusional of assuming that allocation can't fail.
>>
>>60576261
no im saying how do i learn a language without going to a class. Like on my own. Not saying oh this language doesnt have a class how can i ever learn it.

Sorry if i wasn't clear. How can I learn languages solo?
>>
>>60576283
It's only "safe" in a sense it has a lot of runtime checks which turn every possible error into an exception, it's safe in the same sense Java is safe. In other words, it does not guarantee memory safety statically.
>allocation can't fail
That's not a memory safety issue.
>>
>>60576343
The second doesn't have a check, it has a signal handler.
>That's not a memory safety issue
>dereferencing a potentially Null value is not regarded as memory safety
>>
>>60576379
>dereferencing a potentially Null value is not regarded as memory safety
There are no NULLs in safe Rust, OOM doesn't produce a NULL pointer but calls abort() instead.
>>
>>60576424
Haha, the program crashing is "safe"?
>>
>>60576443
Everything that doesn't lead to undefined behavior is safe
>>
>>60576443
Actually, yes. This is the safest thing you can do in many cases, OOM is one of them.
>>
>>60576452
;)

>>60576458
You're genuinely delusional
>>
What's the use of bit arrays.
>>
>>60575681
Jesus, how can you write with that raibow syntax.
>>
>>60576469
Not an argument.
>>
>>60576487
I don't have to. You're for some reason extrapolating Rust's claim of memory safety as general safety. The creators and maintainers have blatantly said this is not the case and never was.
>>
>>60576503
> The creators and maintainers have blatantly said this is not the case and never was.
This is that I said tho, OOM isn't a memory safety issue, but it's "safer in general" to abort your code on OOM than to let it run.
>>
>>60576535
An that is blatantly wrong. A safer thing would be to start up backup procedures and commence logging. Hopefully saving the data not written yet, reporting the issue, and allowing the backup process to fix the issue.
>>
>>60576581
OOM is typically an external issue and not something your program has any jurisdiction over. You don't get to just decide "but I don't want to terminate, I want to carry on allocating and using resources".
>>
>>60576581
>start up backup procedures
>commence logging
>reporting the issue
>fix the issue
>while having no free memory
Even if you manage to do this without allocating any new memory, it's useless since the kernel is gonna kill you anyway.
>>
>>60574843
>correct_word = "google"
>guess = "o"
>user_word_length = 5
>blank_guesses = [guess if x == guess else "-" for i, x in enumerate(correct_word)]
>blank_guesses = "".join(blank_guesses)
>print(blank_guesses)
Cheers! I understand it a lot more now.
>>
>>60576619
Maybe your program doesn't

>>60576628
>what is a stack frame specifically for this purpose
also, spoiler, many safety critical applications use only the stack because the risk of allocation failure is too dangerous and unpredictable.
>>
>>60576651
> many safety critical applications use only the stack because the risk of allocation failure is too dangerous and unpredictable.
Right, and you can program this way in Rust just fine, this has nothing to do with aborting on OOM. Oh, and I hope you don't try to recover from stack overflows.
>>
>>60576637
The method I gave you doesn't iterate btw.
You have to use an index and then for loop if you want it to iterate across multiple attempts.

something like
import random

correct_word_list = ["google", "yahoo", "bing"]
correct_word = random.choice(correct_word_list)
blank_guesses = list('-' * len(correct_word))

while "-" in blank_guesses:
guess = input("Guess a letter:")
blank_guesses_index = [i for i, x in enumerate(correct_word) if x == guess]
for index in blank_guesses_index:
blank_guesses[index] = guess
blank_guesses_string = "".join(blank_guesses)
print(blank_guesses_string)
>>
>>60576682
>stack overflows
You run analyzers for that. They don't exist.
>>
>>60576695
How can analyzers guarantee your recursion from some arbitrary user input won't overflow the stack?
>>
>>60576718
>Recursion
>In safety critical applications
Are you joking?
>>
>>60576726
Why do you need "analyzers" then, if you don't have recursion?
Also, does the languages guarantee statically there's no recursion involved?
>>
>>60576748
>Why do you need "analyzers" then, if you don't have recursion?
Programs have more paths than one. You can try to sit with a piece of paper counting every bit of data you use, or use a tool. No one's stopping you.

>Also, does the languages guarantee statically there's no recursion involved?
Some do, I'm sure. This is mostly dependent on your analyzer to notice, however. It's not a programming language's domain to mandate such things if it doesn't need/want to.
>>
>>60576777
So, did we come to a conclusion after all? It looks like you admit the only way to write OOM-proof code is to limit yourself with the stack, something Rust is perfectly capable of doing, so it's pretty much Ok to abort on OOM, and safe Rust is a "generally safe" language after all.
At the same time, Ada still allows you to write and compile inherently unsafe code, like use-after-free or double-free, and considers itself safe only because it doesn't crash immediately but throws exceptions instead, something even Java does.
>>
>>60576686
>import random
>correct_word_list = ["google", "yahoo", "bing"]
>correct_word = random.choice(correct_word_list)
>blank_guesses = list('-' * len(correct_word))
>while "-" in blank_guesses:
> guess = input("Guess a letter:")
> blank_guesses_index = [i for i, x in enumerate(correct_word) if x == guess]
> for index in blank_guesses_index:
> blank_guesses[index] = guess
> blank_guesses_string = "".join(blank_guesses)
> print(blank_guesses_string)
Was about to post again about it but hey here we are. That definitely helps a lot. I can understand it a lot easier once its their in front of me, just attempting to write it hurts my head. Thanks anon.
>>
>>60576852
I actually think we've come to the opposite, since Rust doesn't have to tools necessary for real static verification at the moment. You've never pointed out why crashing is safer, while I pointed out why it isn't. Ada used the words "Unchecked" in the procedure call, identical to an "unsafe" block in rust. If you don't want checks or exceptions, use a real static analyzer, rather than your half-assed one. Also, Java is a decently safe language, so why'd you bring it up?
>>
>>60576907
>his code needs static analyzers to verify it's safe
How is it different from C/C++ then? There're plenty of static analyzers for them too, does that mean they're safe now?
Meanwhile, if your language is safe, to begin with, you don't need "tools" to make it safer.
>while I pointed out why it isn't
No? You've produced a list of thing you can't do without free memory, haven't explained what to do with the OOM killer, and then backed off to "you shouldn't be using memory allocation".
>use a real static analyzer, rather than your half-assed one
Can you provide an example of a memory safety issue "a real static analyzer" finds while Rust compiler doesn't?
>Also, Java is a decently safe language, so why'd you bring it up?
Exception in thread "main" java.lang.NullPointerException
>>
>>60576986
Misra c IS safe.

You shouldn't and also suggested reserving a frame preemptively.

Memory safety isn't the end all of safety. Basic checks on pre and post conditions is the bar minimum, which rust can't do.

I'm done with this, it's like talking to a wall.
>>
>>60575269
Doubletriplecheck that calltoAPItocreateobject isn't a retarded macro that causes all of this.
Launch that in a debugger.
If you think it's a bug in that seekrit API you're not allowed to name on 4chin, report to the maintainers
>>
>>60576290
>How can I learn languages solo?
Just decide on a language and use the internet, write a lot of programs in it. I don't even know how to answer this since it seems obvious.
>>
>>60577051
This is ableist attitude.
>>
>>60576726
This. Using any kind of looping in safety critical applications is just fucking retarded.
>>
>>60572378
same
>>
>>60577068
This. Using a Turing-complete language in safety critical applications is just fucking retarded.
>>
>>60577037
>Misra c IS safe

"Second, we observed a negative correlation between MISRA rule violations and observed faults. In addition, 29 out of 72 rules had a zero true positive rate. Taken together with Adams’ observation that all modifications have a non-zero probability of introducing a fault, this makes it possible that adherence to the MISRA standard as a whole would have made the software less reliable"
https://repository.tudelft.nl/islandora/object/uuid:646de5ba-eee8-4ec8-8bbc-2c188e1847ea?collection=research
>>
File: dlang.png (666KB, 1272x513px) Image search: [Google]
dlang.png
666KB, 1272x513px
Is D a Jihadi language considering this guy is from the Balkans which is muslim and he is making an islamist gesture?
>>
File: andrei.jpg (104KB, 800x1067px) Image search: [Google]
andrei.jpg
104KB, 800x1067px
>>60577471
No, Andrei is a Romanian vampire
>>
>>60577494
So? He's still a mudslime
>>
>>60577471
> from the Balkans which is muslim
t. `white` murrican
>>
>>60577513
> An overwhelming majority of the population identify themselves as Christians. At the country's 2011 census, 81.0% of respondents identified as Orthodox Christians belonging to the Romanian Orthodox Church. Other denominations include Protestantism (6.2%), Roman Catholicism (4.3%), and Greek Catholicism (0.8%). From the remaining population, 195,569 people belong to other Christian denominations or have another religion, which includes 64,337 Muslims (mostly of Turkish and Tatar ethnicity) and 3,519 Jewish. Moreover, 39,660 people have no religion or are atheist, whilst the religion of the rest is unknown.
>>
File: 7128371231231.png (91KB, 381x473px) Image search: [Google]
7128371231231.png
91KB, 381x473px
Is it possible to make money off of C/sepples on your own? Or do you have to delve into java/c#/webshit?
>>
>>60577532
[citation needed]
>>
>>60577534
>webshit
Not programming related.
Ask on >>>/g/wdg/
>>
>>60577550
[260]
>>
has anyone been able to create a local mysql in ubuntu 17.04???

the update for mysql database is 'broken'
>>
>>60577661
>>currystackoverflow, also learn to describe your problem clearly.
>>
>>60577471
wtf I love D now
>>
I need to simply explain in words that i have an index that gets incremented and "moduled" back every time it is used.
Basically doing:
meme = (meme ++ ) % limit;

Any idea what would be the best words?
>>
>>60577725
increment with modulo?
>>
>>60577471
he left his job at facebook to start the official dlang foundation. he's an extremist.
>>
>>60577725
circular buffer? (since it's an index)
also,
https://www.wikiwand.com/en/Modular_arithmetic
>>
File: W5AMy0P.gif (2MB, 304x256px) Image search: [Google]
W5AMy0P.gif
2MB, 304x256px
>>60577471
>>
>>60575269
obj isn't initialized to valid memory.
try
Object obj;
Object* p = &obj;
foo(&p);
>>
File: 18671069.jpg (32KB, 398x478px) Image search: [Google]
18671069.jpg
32KB, 398x478px
>>60575291
B-But I haven't learned Rust yet!
>>
>>60577771
>>60577744

think i am going with increment with modulo and see what my relator says
>>
>>60577827
source?
>>
>>60577904
fucking degenerate
>>
>>60577998
>TRIGGERED
>>
functional programming
>>
What's a fun project for me to do in my spare time? I'm familiar with C, Python, and Java.
>>
>>60578029
>"functional" programming
>>
>>60578052
Write a program that computes the average of two integers.
>>
>>60578084
Sounds like a real toughie anon, this'll keep me going for a few weeks. Thanks!
>>
>>60578113
/dpt/ hasn't been able to do it correctly for years now tho.
>>
File: awkward.jpg (52KB, 374x638px) Image search: [Google]
awkward.jpg
52KB, 374x638px
>>60578133
Actually, someone did post a solution a while back.
>>
>>60577725
>meme
>>>/v/
>>
>>60578133
I have a proof which clearly shows it's impossible, so obviously that would be the case.
>>
>>60578084
>given n1 and n2
>CLEAR STK
>::1
>if n1 = 0 go to ::2
>do d = n1 mod 10, n1= n1÷10
>press the key that matches d
>goto ::1
>::2
>if n2 = 0 go to ::3
>do d = n2 mod 10, n2= n2÷10
>press the key that matches d
>goto ::2
>::3
>press +
>press 2
>press ÷
>profit

Works on HP 35s and probably most one-man-operated RPN calculators.
>>
File: anal beads.png (3KB, 221x103px) Image search: [Google]
anal beads.png
3KB, 221x103px
>>60578133
r8
>>
>>60578190
>the average of two integers
>float
Are you a JS-kid?
>>
>>60578201
What's the average of 5 and 8?
>>
>>60578190
What does And return?
>>
File: anal beads.png (3KB, 615x43px) Image search: [Google]
anal beads.png
3KB, 615x43px
>>60578221
A list containing those two things
>>
>>60572414
Fuck off condescending fedora wearing nigger
>>
>>60578215
6 and 1 in reminder.
>>
>>60578231
I mean, an IEnumerable<int>?
>>
>>60578239
There's nothing wrong with elitism; it's how you keep undesirables (such as yourself) out.
>>
>>60578246
Can you link me to the documentation you're using to define "average"? I'd like to satisfy your autism.

How would you represent this as data?
>>
New thread:
>>60578271
>>60578271
>>60578271
>>
>>60578258
Nope, a
List<T>
. I'm fine with the collection being evaluated eagerly here.
>>
>>60578231
https://www.youtube.com/watch?v=CkdyU_eUm1U
>>
>>60578423
thatsthejoke.png
>>
>>60577904
otokonoko uke vol 2
>>
>>60578262
Well, you could simply represent it as a rational number.
Thread posts: 323
Thread images: 54


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