[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: 320
Thread images: 37

What are you working on, /g/?

Old thread: >>60317495
>>
i'm trying to fizzbuzz without using modulo but i failed precalc three times so it's hard
>>
>>60323039
you need to take precalc to do division?
>>
https://www.youtube.com/watch?v=uNjxe8ShM-8
discuss.
>>
>>60323039
COUNTERS
O
U
N
T
E
R
S
>>
>>60323039
if i / 3 == int(i / 3)
>>
What anime do you watch while programming /dpt/?

only expert fizzbuzzers may reply to this post
>>
>>60323092
I don't watch anime while programming. Due to anime being subbed, it requires basically of your attention to watch it, assuming you actually want to follow what the fuck is going on..
>>
>>60323104
>basically of
basically all of*
>>
>>60323104
>not speaking understanding spoken japanese
>>
>>60323092
I watch you, anon.
>>
>>60323113
I can't be fucked learning a foreign language. I have other shit I would rather be doing.
>>
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/!
>>
>>60323104
Why would I be using subs when I can just listen?
>>
>>60323104
>平成二十九年
>彼は日本語を知らない
>>
>>60323092
COMFY
O
M
F
Y
>>
>>60323165
>を
>知らない
Nice try there.
>>
>>60323145
>>
File: 1493391862001.png (127KB, 601x508px) Image search: [Google]
1493391862001.png
127KB, 601x508px
if /g/'s so smart why don't they make their own /g/
>>
>>60323219
People constantly write their own versions of image board software they just never become popular.
There are multiple places to talk about technology that /g/ has created.
>>
>>60323219
>tfw no standalone /g/++ client to escape the browser botnet, written in pure assembly for speed, and running on a free and open source /g/ backend
>>
>>60323271
>pure assembly
>not machine code
Step it up, senpai
>>
>>60323116
Those are very cute girls, anon.
>>
>>60323347
>girls
>>
>>60323362
Yes?
>>
>>60323219
>Not being aware you're part of one of my many concurrent simulations of all the boards of 4chan
>>
>>60323441
But I am aware of it. It was part of my plan all along.
>>
>>60323281
assembly is faster than machine code
>>
File: 1484582689170.png (618KB, 738x845px) Image search: [Google]
1484582689170.png
618KB, 738x845px
Rate my "Hello, world!"
val hello = "Hello, world!".

id : Π a : Type . Π x : a . a
fun id = λ a : * -> λ x : a -> x.

(* No printing. *)
main : String
fun main = id String hello.

>>
>>60323558
dysfunctional/10
>>
File: 1476641442264.png (682KB, 1226x813px) Image search: [Google]
1476641442264.png
682KB, 1226x813px
>>60323598
Could you please rate it using some sort of point system which explains the reason for every score?
>>
I made a text based RPG a while back and just stopped working on it because of school and such. Now, I'm thinking about how exactly I want to generate npc's and combat mechanics and different things. Feel free to contribute or recommend ideas.
https://github.com/enigma424242/IntotheShadows
>>
>>60323104
I watch Asian horror movies while programming. You only have to glance over every few seconds, it's perfectly doable.
>>
>>60323558

>No printing.
Not a hello world then.
>>
>>60323024

i'm working on trippling my productivity
>>
>>60323453
Well congratulations, what's the next step of your master plan?
>>
>>60323640
Do you still contribute or is it abandonware?
>>
>>60323558
> No implicit type parameters
> main : String instead of () -> String
It's time to switch to Idris.
>>
>>60323640
I'm still contributing. I just haven't contributed in a while. I need some new ideas.
>>
>>60323856
But it still says hello. You just have to read the source file.

>>60323926
>No implicit type parameters
That will be added soon of course.
>main : String instead of () -> String
But why would a string have this type?
>>
>>60324068
If `main` is a string, then why do you define it with `fun`?
>>
File: 1493255507347.jpg (110KB, 640x640px) Image search: [Google]
1493255507347.jpg
110KB, 640x640px
>>60323970
If you don't have to do graphics at all you get plenty of free time for logic

Implement procedurally generated town and hamlets that react and interact with your adventurers along with the option to manage your own
>>
>>60324083
>If `main` is a string
It is, the type-checker says so.
> why do you define it with `fun`?
There is no difference between "val" and "fun". I just like "fun main" more than "val main".
>>
>>60324068

It returns a value. It doesn't PRINT the value. A Hello World program, but definition, PRINTS the string "hello world" to the screen, ideally to standard out. The point of a Hello World program is to introduce the learner of the language to the basic means of producing a program output.

Every program that does not interact with some sort of output device, whether it be stdout or some graphical window, is equivalent to one of two C programs:
int main(void)
{
return 0;
}

and
int main(void)
{
while (1) { }
return 0;
}


Your program is equivalent to the first.
>>
>>60324127
You forgot input anon.
>>
>>60324127
I take it you have absolutely nothing to do right now.
>>
Doing some gameboy devving as a fun way to learn more C.

One thing I keep seeing in GB programmers code is
 void main() 


But there's a lot of bitching online saying you need to use
 int main() 
without really saying why, even though the K&R uses just
 main() 


Which one is right and why?
>>
>>60324122
> There is no difference between "val" and "fun".
Then why do you need `fun` at all? Meanwhile, Haskell works fine without either.
>>
>>60324136

Ah, I suppose you are right. A program could halt temporarily on input, in which case, it would pause until some input sequence is entered, and then become one of the two programs listed above. It is still useless, however. The only useful programs are those that have output.
>>
>>60324163
int main(int argc, char** argv)
>>
>>60324163
void main() is correct if you are returning nothing. People use int cause they are autistic.
>>
>>60323039
mfucker its the remainder not the quotient

got kb again
>>
>>60324163

void main() is wrong, but technically, the version of C used on the Gameboy SDK is not compliant with the C standard anyways (8 bit ints and 16 bit longs, IIRC).

int main() is ideal.

main() is technically the same as int main(), since functions have return int if none is specified, but this is not always known, particularly by people who do not regularly program in C. Therefore, including the return type every time is best.

>>60324155

It's like 1 in the morning. Too late to be working on my paper realistically, but I don't feel like sleeping yet.
>>
@60324127
>It returns a value. It doesn't PRINT the value.
Which is fine. Realistically you don't need to print values most of the time.
>Every program that does not interact with some sort of output device, whether it be stdout or some graphical window, is equivalent to one of two C programs
Nope, 0 isn't a valid string in my language and "int" and "String" aren't the same type in my language. My language doesn't have loops, so it can't possibly be equivalent to the second program.
And what if main takes some arguments? You really didn't think this through.

Also, please provide a formal proof of these programs being equivalent. I will disregard everything you have to say about programming languages if you fail to do so.

>>60324165
>Then why do you need `fun` at all?
Purely aesthetic reasons.
>Meanwhile, Haskell works fine without either.
I'm just testing different syntax. I will probably switch to Haskell-style declarations.

@60324167
>The only useful programs are those that have output.
This is wrong simply by the definition of "useful". Learn to think properly before posting.
>>
>>60324229
But why is int main() inherently better if you can use void main() with the same effect?

Does it actually matter if you're just going to return 0 anyway?
>>
>>60324163
>GameBoy
>C
Bet you're writing apps with Electron
>>
>>60324210
void main certainly ISN'T correct. Go look at the standard, fuckface.
>>
>>60324289
I helped write the standard, I'm pretty fucking sure it's correct.
>>
>>60324297
My dad works for ISO; I'm pretty sure I know what I'm talking about.
>>
File: c99_main.png (118KB, 687x905px) Image search: [Google]
c99_main.png
118KB, 687x905px
Why do you keep arguing if it takes like 10s to look the shit up?
>>
>>60324210

void main fails to compile under -Wall -Werror. We use int because the standard mandates it.

>>60324250

>But why is int main() inherently better if you can use void main() with the same effect?
It's not a matter of better or not. It's the fact that void main() is incorrect. It is completely legitimate for a compiler to fail to compile your code.

>>60324236

>0 isn't a valid string in my language
And hello world isn't a valid exit code. Realistically, your program is going to be run on either Windows or a Unix-like operating system, so the only meaningful information you can actually convey by returning a value from your program's entry point is an integer value.

Also, you can take in all of the arguments you want. You're just not doing anything with them.

>please provide a formal proof
Programs without output can only do one of two things -- wait and terminate. Anything else could be construed as a form of output. First program given terminates. Second program waits forever. Arguably, there is a third type or program that could be made -- wait until a specific input occurs, then terminate.

>This is wrong simply by the definition of "useful". Learn to think properly before posting.
Useful implies that you can use it for something. You cannot use a no output program for anything.
>>
I made a version of tetris that runs in the browser console but every time I try to post a the code to play it 4chan detects it as spam.
>>
For: 60324376

>And hello world isn't a valid exit code
Yes, in conventional operating systems. Which yet again shows how retarded you are by claiming they are somehow equivalent.
Even assuming hello world isn't a valid exit code, a program returning 5 and a program returning 0 are certainly not equivalent. I can choose any default/implicit exit code I want.
>your program is going to be run on either Windows or a Unix-like operating system
Wrong.
>You're just not doing anything with them.
Arguments existing and not existing is a difference. Which yet again shows they can't possibly be equivalent.

>Programs without output can only do one of two things ...
Is this a girl's idea of a formal proof? I expect somewhat better from you.

>Useful implies that you can use it for something.
Yes, you can run a program. Running a program using a CPU produces heat. So a program which makes good use of a CPU will heat up the environment more than a program which simply returns 0, that is a use. Therefore, such a program is useful.
>>
Ocaml or ATS?
>>
>>60324463
Idris.
>>
>>60324463
see >>60324468
>>
>>60324440

>Is this a girl's idea of a formal proof?

Is this a retard's idea of an argument?

>Running a program using a CPU produces heat

Not guaranteed. An efficient enough CPU could exist that would consistently maintain the same temperature at all times.
>>
>>60324527
> Not guaranteed. An efficient enough CPU could exist that would consistently maintain the same temperature at all times.
Not him, but you're missing the point, go read the second law of thermodynamics.
>>
>>60324544

Wooo, we're causing the CPU to generate heat that it would anyways. How is this not equivalent to an infinite loop?
>>
Addressed to: 60324527
>Is this a retard's idea of an argument?
I asked you to provide a formal proof, you started spouting some completely unrelated nonsense. I'm genuinely sorry for the people who have to deal with you on a regular basis.
>An efficient enough CPU
I'm using a deficient CPU.

>>60324567
My language doesn't have loops. There is simply no looping program which my language accepts. I think your brain might be fucked up from all those hormones, but try to understand that things being superficially similar (to an idiot) doesn't somehow mean they are """""equivalent""""".
>>
File: chen_class.png (92KB, 532x391px) Image search: [Google]
chen_class.png
92KB, 532x391px
>>60324567
>he's a fucking retard
https://en.wikipedia.org/wiki/Carnot%27s_theorem_(thermodynamics)
>>
>>60324567
> Wooo, we're causing the CPU to generate heat that it would anyways
No? Not running any code on a CPU is nothing like running a busy loop on it in terms of energy consumption.
>>
you wouldn't program your own replacement
>>
>>60324613
Why not tho, I'm not that complex.
>>
File: 1493615537393.jpg (105KB, 629x473px) Image search: [Google]
1493615537393.jpg
105KB, 629x473px
>>60324609
>he
>>
>>60324527
>An efficient enough CPU could exist that would consistently maintain the same temperature at all times

I'm going to assume you meant that it produces so little heat that ambient heat dissipation can counteract it, and not that it's 100% efficient in its use of power, because in that case you're a fucking idiot and need to kys.
>>
>>60324068
>But it still says hello. You just have to read the source file.

Rate my "Hello, world!"

Hello, world!
>>
>>60324592

>I asked you to provide a formal proof
And I provided a proof.

List of shit a computer can do that users notice - things that qualify as output = { wait, terminate }

Next you'll be asking for a formal proof that 3 - 1 = 2.

>My language doesn't have loops. There is simply no looping program which my language accepts.

So other than waiting for input and then eventually exiting, and maybe heating up your shitty CPU, you can't do anything that anyone would notice. Why would you make such a language? Why are you trying to make programs that no person -- not even yourself -- can make use of?
>>
>>60324638
3/10 if strings aren't the only type in your language since there is no indication of what type is being used.
8/10 otherwise.
>>
File: smug_ran.jpg (632KB, 709x1063px) Image search: [Google]
smug_ran.jpg
632KB, 709x1063px
>>60324632
Let's dispel once and for all the fiction that Ruby is a girl. He's a man pretending to be a girl pretending to be a man on the internet.
>>
>>60324610

On a typical CPU, perhaps. There could exist a theoretical CPU that cannot idle, and therefore, no program could make it hotter.
>>
>>60324638

Then it's not a fucking program. It's a file.

>>60324659

I'm just a man. There is no pretending to be a girl.
>>
>>60324659
Let's shut up and never respond tp tripfags, you disgusting bootlickers.
>>
>>60324680
>Then it's not a fucking program. It's a file.

That was the joke I was making. If something counts as a hello world program if you "just have to read the source file", as that guy seems to think, then any text file that contains the string "Hello, world!" counts as a hello world program even if it's not even code. I think it's dumb.
>>
To: 60324646
>And I provided a proof.
No. That piece of trash doesn't qualify as a formal proof. Maybe you weren't taught this due to your disability, but that isn't an excuse for ignorance.
Really anything you say after this point should be taken merely as a joke.

>List of shit a computer can do that users notice - things that qualify as output = { wait, terminate }
No. Heat can be noticed by the user. If any particular user is broken in some way (something you should be familiar with), then there still exists some user which can notice the heat.

>Next you'll be asking for a formal proof that 3 - 1 = 2.
I'm pretty sure you wouldn't be able to do even that. You could try to redeem yourself though.

>Why would you make such a language?
It's really fun. That's all the justification I need.
>Why are you trying to make programs that no person -- not even yourself -- can make use of?
Are you genuinely retarded? I showed you one of the uses for my programming language in an earlier post.
>and maybe heating up your shitty CPU
So you're contradicting yourself now. I can't say I'm surprised that a subhuman such as yourself would resort to this.

>>60324697
>then any text file that contains the string "Hello, world!" counts as a hello world program even if it's not even code
You can't say there doesn't exist a programming language in which that's a valid program.
>>
I would rather program in COBOL than in any language that is not turing complete, with an ability to read from stdin, write to stdout/stderr, do file and network I/O, and arbitrarily reassign the value of a variable.
>>
>>60324743

>The opinion of someone who doesn't despise r*by holds absolutely no value.
The same applies to everyone who uses non-turing complete languages.

>Realistically you don't need the ability to compute every computable function in everyday programming.
Realistically, there is not a single language that can't do this that is in regular use, or that ever will be in regular use, or that ever could be practical for everyday programming.
>>
File: ran_life.png (50KB, 283x190px) Image search: [Google]
ran_life.png
50KB, 283x190px
If only ignoring tripfags actually makes them go away.
>>
>>60324774

It could, but what you're doing right now is the exact opposite of ignoring me.
>>
>>60324774
Could be much worse. At least she knows her shit, and she delivered that information about Rust's type system being broken.
>>
File: .png (29KB, 917x462px) Image search: [Google]
.png
29KB, 917x462px
I'm trying to get the captcha hash and automatically send but I guess since it's in an iframe it's not allowed because XSS. How do I automate this?
>>
>>60324771
> Realistically, there is not a single language that can't do this that is in regular use, or that ever will be in regular use, or that ever could be practical for everyday programming.
SQL isn't Turing complete.
>>
>>60324163

What sort of sdk exists for the Game Boy? I'd like to do some homebrew stuff.
>>
For: 60324771
>The same applies to everyone who uses non-turing complete languages.
So basically every single person on this planet even remotely interested in programming?

>Realistically, there is not a single language that can't do this that is in regular use
I will treat this as an open admission of your retardation. I can only hope your education wasn't payed for by the state.
>>
>>60324799
Domain specific languages get a free pass on that. Usually it's actually better if they're NOT Turing complete.
>>
>>60323024
I noticed with ELF files they're linked with an address at the start, which brings up two questions in my mind.
1.) What happens if two are linked with the same address?
2.) Why the fuck does it do this? The system handles all the memory management for the program, so why would they decide where in memory the program starts at compile time instead of runtime?
>>
OPTICAL CPUs WOULD GENERATE 0 HEAT AND OPERATE AT INFINITE GIGAHERTZ
>>
>>60324799
https://stackoverflow.com/questions/900055/is-sql-or-even-tsql-turing-complete
>>
File: smugtoshinou2.png (415KB, 654x702px) Image search: [Google]
smugtoshinou2.png
415KB, 654x702px
>>60324796
>she
>>
Any clojure devs here?

Working with a team that does a lot of clojure work and I'm impressed with the language, but haven't seen many other people use it.

Thoughts?
>>
>>60324820
Sorry, "she (he)"
>>
>>60324807

>So basically every single person on this planet even remotely interested in programming?
Which explains why Python, Javascript, and C are the most popular languages to start out with. All turing complete languages. I wonder why anyone would choose these languages if they are interested in non-turing complete languages...
>>
>>60324810

Virtual memory handles this.

You can bake absolute pointers into the progran rather than doing some offsetting bollocks.
>>
@60324834
>Python, Javascript
You're even worse of a subhuman than I initially thought.
>>
>>60324828
Clojure is the best Lisp out there, but it's still a Lisp.
>>
>>60324801
There's the GBDK, it's old as shit, and a pain to get working on Linux, but it's pretty good
>>
>>60324828
>I'm impressed with the language
Could you elaborate?
>>60324851
I'm thinking of learning one of them just for fun, should I learn clojure?
>>
>>60324845
>@ meme
I been reading this discussion for awhile. This isn't funny in any manner or form unless you suffer from autism. Stop.
>>
I'm learning programming for serious already and I have one question. What is the best way to pretend stack overflow from too big input number from user?
Just simple if(input_int < MAX) or something else?
>>
>>60324868
It's not supposed to be funny. I think you might have autism yourself if you think it is.
>>
>>60324877
Then why are you using it you moron
>>
I took a data science course that taught introductory R and Java.

To develop my skills in "real" programming, should I continue to study Java, or is there another language that would be better?
>>
>>60324875

Give me some example code. You're mixing up a few different concepts here.
>>
>>60324897
Learn what you want.
It is that simple.
>>
>>60324885
Not understanding implicit social cues is definitely a sign of autism.
>>
>>60324897
Do you want to start from the top down or the bottom up?
>>
>>60324816

I would note that I never made mention of a CPU that generated 0 heat, only one that would never change temperature. This is simple if you never alter your clock speed, and never idle.

>>60324845

Like them or not, they are what the majority of new programmers are starting out with. And if it's not C, Python, or Javascript, it's Java or C#. Sometimes people might start with C++ or Lua if they're trying to get into gamedev, or with Objective-C or Swift if they want to become iOS devs. Some might start with Scheme if they fell for the SICP meme. Still others start out with Visual Basic.NET if they got some shitty high school or community college computer science teacher. You know what people don't start with? Non-turing complete languages. Why is this, if "every single person on this planet even remotely interested in programming" uses non-turing complete languages.

Could it be that no real programmer wants your inflexible garbage?
>>
>>60324897

Java is the easiest way to become a code monkey if that's what you mean.
>>
>>60324865
I'm not a Lisp expert, but I think some kind of Scheme/Racket would be better.
>>60324875
Just don't allocate anything based on user's input on the stack.
>>
>>60324908
Not understanding implicit forum mechanics and trying to pretend to be funny is 100% a sign of autism
>>
>>60324918
Not being able to tell when people are trying to be "funny" is most definitely a sign of autism.
>>
>>60324914
Your habit of replying to everything is why people hate you.
>>
>>60324918
Oh, and I obviously understand the forum mechanics you mentioned. It's pretty clear from my responses to you.
So you have to look for something else. This might help you develop your social skills.
>>
>>60324924
Hurr durr look at me using @
I am only pretending to be retarded.

You are like the moron who replies to all the post with greentext and ask who are you quoting. I won't be surprised if you were that guy.
>>
>>60324930
>Social skills
>on 4chan
>>
>>60324935
Do you genuinely not get it or are you trying to make fun of me here? If so, you have succeeded.
>>
Welp, thread's derailed. Time to go to bed!
>>
>>60324954
>thread is off-topic for two minutes
>thread's derailed
This is another reason that everyone hates you.
>>
@60324943
Nah you have autism.
>>
>>60324935
I think he's avoiding giving Ruby any (You)s.
>>
>>60325034
Which is stupid because she (he) feeds on attention; which they're giving her (him) regardless of (You)s.
>>
>>60324905
>>60324910
>>60324915

I think bottom up. What I want to do is learn at least the fundamentals of what an employed programmer would know, since I'll have to work alongside them and with their code.
>>
File: wow anon.jpg (78KB, 884x574px) Image search: [Google]
wow anon.jpg
78KB, 884x574px
>>60324851
>Clojure is the best Lisp out there
>>
>>60324851
>but it's still a Lisp.
Clojure is not lisp.
>>
>>60325337
What is "lisp"?
>>
>>60325344
I'm not expecting an answer by the way. Just letting you know.
>>
>>60323024
>What are you working on, /g/?
Im working on nothing specific but related to nlp. I gotta say despite my years long hatred python really isn't that bad, if it only had proper types...
>>
File: 1424698175815.jpg (66KB, 280x366px) Image search: [Google]
1424698175815.jpg
66KB, 280x366px
It really is a horrible and poorly designed language.
Anyone who thinks that it's good, or even passable, clearly has a metal problem.
Fuck sepples anyway.
>>
>>60325370
What is a "Proper" type?
>>
>>60325387
for e.g i got
some_array = f() #i get array of whatever
g(some_array) #i have no way of knowing whether this will work before i actually run program

I want type checking!!
>>
>>60325387
He wants strict type checking instead of duck typing.
>>
https://blog.plan99.net/modern-garbage-collection-911ef4f8bd8e

how will pikefags recover?
>>
>>60325403
>I want type checking!!
But you already have a degenerate form of it. Suffer with that since you picked such a shit language.

>>60325410
>strict type checking
That has no meaning. Do you mean a strong type system and not implicit garbage?
Why would he use python if he genuinely wanted that? I think he might be lying.
>>
>>60325387
yea that >>60325410

>>60325432
You know i really had no other choice here, python has really extensive nlp libraries... And implementing my own for pet project seems like a waste
>>
>>60325403
So put
isinstance(some_array, list)
in g() and continue based on that
>>
>>60325403
TDD > type checking
>>
>>60325426
>Go's authors are amateurs
No shit.
>>
I'm trying out a small app on android to see how it works.

I have 99 objects with 4 strings containing long sentences and some boolean variables that I need to be kept with predefined data.

Can I just chuck them into a linked list when the app starts and then save them with shared prefrences? https://developer.android.com/guide/topics/data/data-storage.html#pref

Or do I have to go overkill and save them in a sqlite db?

Later on I want to try add an encrypted payload of strings that will be decrypted after an in-app purchase.
>>
starting to think about ideas for my new projects
in order:

toy language based on luajit's source, so it'll be real fast for free
a new std lib for the toy language, since i can't stand lua's
extensible editor written in the toy language
extension for the editor to support coding tasks
language learning tool suite, using wiktionary data
extension for the editor to support creative writing
web microframework, kinda like flask, for the toy language
>>
File: the_only_true_tdd.png (436KB, 725x907px) Image search: [Google]
the_only_true_tdd.png
436KB, 725x907px
>>60325449
Only if it stands for Type-Driven Development.
>>
>>60325447
Is there a way to check whether its list of strings for e.g? That seems handy for my own libs
>>
File: 1488765105426.jpg (24KB, 347x402px) Image search: [Google]
1488765105426.jpg
24KB, 347x402px
>>60325439
You really should be using your own type theory on top of python. Just type check in your head.
>>
>>60325410
Duck typing and strict type checking aren't exclusive. OCaml.
>>
>>60325477
https://docs.python.org/3/library/typing.html
>>
>>60325456
They have claimed unrealistic perfomance about GOGC.
>>
>>60325477
run isinstance again while iterating through the array, or just don't put types you aren't handling in an array that should only contain those types
>>
File: dad_of_the_year.webm (2MB, 1335x720px) Image search: [Google]
dad_of_the_year.webm
2MB, 1335x720px
>>60325410
No, he want static typing.
>>
>>60325521
omedetou
>>
>>60325502
>Duck typing and strict type checking aren't exclusive
Indeed. Since "strict type checking" is a non-word.

>>60325521
So something every programming language already has?
>>
File: kissu.webm (3MB, 1280x720px) Image search: [Google]
kissu.webm
3MB, 1280x720px
>>60325528
>So something every programming language already has?
untrue
>>
>>60325521
is that webm satire? is it a weird anime fanfic?
>>
I've developed a set of command-line programs and am hitting the limits of pure text representation. ASCII tables only go so far.

I want to turn it into a set of REST web application. However I don't want a monolithic application but keep individual processes.
How do you approach that?
HTTP reverse proxies to map multiple apps under 1 URL?
>>
>>60325550
>untrue
It not being true would be contradictory. A type system is by definition static.
The only way "dynamic typing" even remotely makes sense is if the language switches type systems mid type-checking.
>>
>>60325466
If I'm understanding right, you could make them resources.
https://developer.android.com/guide/topics/resources/string-resource.html
>>
>>60325449
PDD > TDD > type checking > literal shit > TDD
>>
>>60325582
>hurrrr
Listen, we all know static and dynamic type checking are poorly defined terms, but everyone has basically agreed static type checking means checking at compile time, and dynamic type checking means checking at run time.

Don't be autistic about definitions should be when the meaning is clear
>>
File: but thats forbidden love.jpg (75KB, 600x842px) Image search: [Google]
but thats forbidden love.jpg
75KB, 600x842px
>>60325550
>>
File: feet.webm (3MB, 800x450px) Image search: [Google]
feet.webm
3MB, 800x450px
>>60325633
nothing is forbidden in anime.

>>60325624
>we all know static and dynamic type checking are poorly defined terms
untrue. they are well defined.
static typing is done in the static environment.
dynamic typing is done in the dynamic environment.
it's quite simple.

>>60325582
>A type system is by definition static.
no, typing with programming languages like python2 or javascript is only done in the dynamic environment.

>>60325551
It's from the Boruto movie.
>>
>>60325624
>static and dynamic type checking are poorly defined terms
Wrong. One is done at compile time and the other is done at runtime, they have very precise definitions. But you weren't talking about type checking.
You claimed that "dynamic typing" is non-contradictory when it blatantly is.

I hope it's clear to you that "dynamic typing" isn't the same as "dynamic type checking".

>>60325648
The type system (the typing rules themselves) simply can't be dynamic. These rules being checked at runtime doesn't somehow make then "dynamic".
>>
>>60325661
>One is done at compile time and the other is done at runtime
wrong. and you should know that every program doesn't need to be compiled.
>>
Why is it that when ever you tell somebody that you program they assume that it's your job?
Is it sosially not acceptable to program as a hobby?
>>
>>60325674
Compilation is equivalent to interpretation for the purposes of this discussion.
>>
>>60325675
Most people rightfully can't understand why you would do something so boring and work-like for fun
>>
>>60325675
I think you mean "code". Programming is a hobby. "coding" is a job.
>>
>>60325685
People play Chess for fun and that's not questioned either
>>
>>60325675
Because programming is a relatively well-paid job, so people just assume you're smart enough to make money from it.
>>
>>60324865
Whenever I've watched recommended clojure talks, they're never really about the language itself and more about basic fundamental principles of development.

The idea that the language is simple, elegant, and recursive strikes me.
I know functional programming languages aren't always the best choice, but from a purely theoretical standpoint clojure seems very beautiful.
>>
>>60325691
But chess is genuinely fun.

>>60325693
>so people just assume you're smart enough to make money from it
I seriously hope you don't believe this. "coders" aren't really thought of as people in most civilized societies.
>>
>>60325693
75% of programming jobs are awful.
>>
>>60325691
Chess is literally a game
>>
>>60325707
Everything is a game in the right light
>>
>>60325585
The problem is I don't think proguard can obfuscate those xmls.

The whole reason for the app is to limit access to the strings. Ive done work on translating and finding the correct phrases with information on the strings which I'm trying to now distribute with the app. That people can use as a learning tool.

Integer questionNum;
Boolean questionType; // true for multiple choice, false for string input
Boolean staredQuestion; // true for starred
String transQuestion;
String enQuestion;
String[] transMultiAnswer = new String[4];
String transStringAnswer;
String[] enMultiAnswer = new String[4];
String enStringAnswer;
String userNote;
>>
>>60325695
>but from a purely theoretical standpoint clojure seems very beautiful
That's precisely where it's ugly. I don't think it even has a formal semantics.
>>
File: hun.webm (3MB, 1066x600px) Image search: [Google]
hun.webm
3MB, 1066x600px
>>60325678
those can't and shall not be confused.
compilation is translation of code to code.
interpretation is evaluation of code.
see chapter 4 of SICP.
>>
>>60325733
You can replace every occurrence of "compilation" for "interpretation" in my posts and it wouldn't change their meaning. Therefore it should be clear to any non-retard that the distinction is irrelevant in this context.
>>
File: plaintext_bench.png (75KB, 936x583px) Image search: [Google]
plaintext_bench.png
75KB, 936x583px
They've finally released Round 14 results: https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=plaintext
If your language/framework is doing less than 3kk rps, you should reconsider your platform of choice.
>>
File: hYMIItH.png (142KB, 511x564px) Image search: [Google]
hYMIItH.png
142KB, 511x564px
>>60325744

>>60325661
>One is done at compile time and the other is done at runtime
One is done at interpretation time and the other is done at runtime
>>
>>60325776
Static type checking can happen at interpretation time, before running the program (also known as "runtime")
>>
>>60325749
>3kk
3 thousand thousand?
>>
>>60325807
Yes..?
>>
I know it's sqt material, but how to shorten the following nested loop in python.
shape = arr.shape
for x in range(0, shape[0]):
for y in range(0, shape[1]/2):
for z in range(0, shape[2]):
arr[x, y, z] = 0


Originally what I wanted to do is fill half of an existing array with 0s
Would it be more efficient to merge the "arr" with a premade array, made of 0s, half the size?
>>
>>60325793
then what is interpretation if it's not the evaluation of the code ?
>>
>>60325704
75% of all jobs are terrible with that attitude.
>>
>>60325648
what anime is this from?
>>
>>60325902
How will you evaluate your code without parsing it? And do you for some retarded reason consider type-checking and optimization to be evaluation?
>>
Daily reminder that loops with no side effects or return statement are undefined behaviour in C.

For example, this is UB:
    #include <stdio.h>
void foo(){
int n= 1000;
if(n!=0)
foo();
}
void main()
{
foo();
}


and Clang will compile this to:
    foo:                                    # @foo
retq


(Just a return statement, no infinite loop)

while gcc will compile it into:

    foo:
.L2:
jmp .L2


which does lead to an infinite loop. Both are correct according to the standard.
>>
>>60325978
Fuck C(ancer) anyway
>>
How can I practice python at work if the computers dont allow me to install python? Any way around this? We meed elevated privileges to run any executable
>>
>>60325996
>the computers dont allow me to install python
good. nobody should be using that garbage
>>
>>60325996

There's probably an online parser.
>>
>>60325996
http://www.brython.info/tests/editor.html?lang=en
>>
>>60325449
kill yourself
>>
>>60325996
Online Python editors?
>>
>>60326044
Why would he be killing himself?
>>
>>60325978
So a program with a side-effect free infinite loop could randomly crash if compiled with one compiler, but silently work if compiled with another?
>>
>>60325996
Ask your IT department to install python for you.
They might just do it- say you want to automate some of your office chores
>>
>>60325597
Domain Driven Design > all
>>
>>60325996
i have no qualms with wasting company time, but for god's sake, don't waste your own as well. pick a different language
>>
>>60326075
>POO
That belongs somewhere near "literal shit".
>>
>>60325961
what parsing has anything to do here ? static typing is done after the code has been parsed. And you still haven't answered the question; what is your definition of interpretation ?

>>60325961
>type-checking and optimization to be evaluation
depends, typing and optimizing can be dynamic or static. Inline caching is an example of a dynamic optimization technique.
>>
>>60325961
idris
>>
>>60323156
who the fuck watches anime dubbed? fuckin normie
>>
>>60326119
>static typing is done after the code has been parsed
The "static" here is redundant. There is no other typing. And it is done before the interpreter/compiler has even started doing its work.
>what is your definition of interpretation?
I don't have one, but I definitely know it isn't limited to "evaluating the code".
>typing
>dynamic or static
Typing is by definition static. Type checking isn't the same thing as typing.

>>60326139
I'm pretty sure his kind won't be using a language where type checking involves evaluation.
>>
>>60326145
Who said anything about d*bs?
>>
>>60326145
be careful with your assumptions. you may in fact be replying to someone so autistic they actually learned japanese by choice
>>
Can we practice some programming anons, give some problems
>>
File: 1472926719246.jpg (206KB, 784x776px) Image search: [Google]
1472926719246.jpg
206KB, 784x776px
>>60326217
Let's try solving P != NP.
>>
>>60326217
write a program to solve 2Fe+Al and other equations of similar form
>>
>>60326217
1,000,000,000 seconds into years, months, weeks, days, hours and seconds
>>
>>60326211
>learned japanese by choice
as opposed to learning it by force?
>>
>>60326211
knowing japanese is fun though
>>
>>60326217
Write a program to compute an average of two ints.
>>
>>60326275
Undecidable.
>>
>>60325961
>>60326178
type checking is a form of evaluation. "check" and "evaluate" are literally synonyms

>>60326252
as opposed to learning it by virtual necessity. like one might if they were, god forbid, born in japan
>>
File: fragzeichenmadchen.jpg (111KB, 500x500px) Image search: [Google]
fragzeichenmadchen.jpg
111KB, 500x500px
>>60323024
How do we keep computer niggers out of our field, /dpt/?

A computer nigger is somebody completely lacking in theory who falls back upon raw hardware as an excuse for his terrible, bloated design decisions.

Imagine a mathematician who thinks math is all about using rulers and calculators: that is a computer nigger, and there are many of them.

I think compsci courses should deliberately limit the hardware to say, intel atoms with 1GB of RAM (incredibly generous) just to send home the message to any would-be computer nigger that "computer" "science" has nothing to do with computers and isn't a science.
>>
>>60326307
>compsci
I think you mean "computational mathematics".
>>
>>60325978
Has this any practical effects?
Compilers can optimize the code for you, is this bad?
>>
Which is the best way to learn deep/machine learning and data science?
>>
>>60326354
>machine """learning"""
>>>/v/
>>
>>60326356
Amazing, you've been gate keeping for nine hours now.
>>
>>60326364
>you
Do I know you? I usually don't associate with your kind.
>>
File: animes.jpg (251KB, 1280x806px) Image search: [Google]
animes.jpg
251KB, 1280x806px
>statically-typed, compiled Scheme

What's your excuse for not using this? It's the best of all worlds.
>>
>>60323024
Learning, u know...
>>
>>60326387
>I usually don't associate with your kind.
That's because you never left your basement
>>
>>60326307
Just keep computers reserved only for those who have demonstrated the ability to consistently develop, test and prove the correctness of their algorithms without using a computer.
>>
>>60326389
It doesn't really make sense for Scheme to be statically-typed.
>>
>>60326364
>Just 9 hours
He's been here since ~3pm EST yesterday doing this and it happens just about every other day at this point. I really wish there'd be some mod intervention because it's clearly someone from another board (most likely another website at this point) who craves attention and has managed to learn how to spout programming buzzwords to fit in with various /g/ norms.
>>
I asked in another thread but it 404d and my phone didn't care to not reload the page so I could read the archived answer (if I got one).

I'm looking for a programming language that is robust and stable. The Mosin Nagant of languages. That is what I want to learn. The only one I'll ever need.

Which language is that?
>>
>>60326389
>statically-typed
Any language you write will apply.
>compiled
No such language exists.
>Scheme
So we're left just with this. Why exactly would I be using it?

>>60326412
It only makes sense if it's statically typed since anything else is impossible.
>>
>>60326412
Why not?
>>
>>60326430
>The Mosin Nagant of languages. That is what I want to learn. The only one I'll ever need.
That's not how programming works.
>>
Do you guys use online tutorials to learn or just learn while in a project?
If the former, what online tutorial pages you like?
>>
>>60326414
>I really wish there'd be some mod intervention
So you're straight from ribbit? Thought so.
>>
>>60326431
>Any language you write will apply.
>No such language exists.
Why don't you start using trips so I could hide your post automatically?
>>
>>60326406
I agree.

CS 101 should be a man with a blackboard.
Helps to weed out the computer niggers real fast.
>>
>>60326414
I think he learned about /g/ last year. Don't worry, at some point he's parents are going to kick him out of their basement
>>
>>60326307
it's incredibly hilarious how many cracker fags get scared of us being able to get educated bc they think "i lost my job to a shitskin that doesn't know jack bc diversity quota" when really they just can't accept the fact that we might actually be better and smarter than them in a field
>>
>>60326460
Are you too retarded to understand such simple things? Too bad for you then.
>>
>>60326273
i am thoroughly unsurprised that you think so. but you and i are different types of people. i will admit that being able to watch extra sophisticated catgirl videos is one of the better reasons to learn japanese, but that's really just a testament to what a shitty language it is
>>
>>60326430
Lisp.
Can be functional, can be low-level bit-shifting procedural, can be object-oriented, can be constraint based logical, can be metaprogrammed.
>>
>>60326485
>procedural is somehow the opposite of functional
>can be object-oriented
Dropped.
>>
>>60326495
Yeah, your mum dropped you as a child
>>
>>60326465
Probably won't happen soon enough.
>>
>>60326503
I didn't have one.
That probably happened to you though, since you can't distinguish between "imperative" and "procedural". Which shows there's something deeply wrong with your brain.
>>
>>60324715
Being as honest as possible, you should really starts therapy. Then, if doesn't work, please just >>>>out
>>
>>60326250
This is built into the language already.
>>
>>60326526
>therapy
What kind of therapy are we talking here?
>>
File: 1487550646729.jpg (84KB, 648x720px) Image search: [Google]
1487550646729.jpg
84KB, 648x720px
>>60326527
Do it manually faggot, why else would I tell you to do it? Use a (((struct)))
>>
>>60326503
kek
>>
>>60326430
i'd say C++. though, much like a Mosin Nagant, there are plenty of situations where it would be overkill. would that make C an Obrez? something something security something something fireball
>>
>>60326583
Anybody who unironically uses sepples should kill themselves immediately.
>>
>>60326583
What gun blows up in your face? That's sepples
>>
>>60326590
How are you going to shitpost on /dpt/ if every browser developer dies?
>>
>>60326618
I don't use "browsers" written in sepples.
>>
>>60326354
Depends on which aspect, but start with learning multivariate statistics. Then learn the methods used in the aspect you are interested in.
AI and control theory and signal processing is also good fields to start from.
You could also go the practical route and implement a game AI or a data recognition method.
>>
>>60326590
>>60326602
truly spoken like people who don't know C++
>>
>>60326645
>people who don't know C++
Yes, because anyone who knows it isn't a person.
>>
Person who spend his time on languages that are not:
C/C++
Java
C#
PHP
Python
JavaScript
Ruby
R

is neet, and should kill himself
One of those is enough to get you job, pls stop using meme language
I'm telling you this because i love you all and you are all my friends <3

btw Go is made just for indians who cant c++
>>
>>60326656
>meme
>>>/v/
>>
>>60326645
People hate things they don't understand
>>
My mind went completely blank during job interview and I vomited into my hands and ran out of the room
>>
>>60326656
You have to be at least 18 to post here.
>>
>>60326569
No.

I'd rather do something that isn't literally already built-in.
>>
>>60326691
Same here. Not even kidding.
>>
>>60326691
I can't believe this is real, but it would be hilarious if so.
>>
>>60326631
What are you, a proud lynx user?
>>
>>60326691
Did you get the job?
>>
>>60326691
They asked me to name 5 my good characteristics, i went blank desu
>>
>>60326729
Yes. Can't have any of that sepples garbage.
>>
>>60326748
Let's see your screenshot as a proof.
>>
>>60326389
They lack libraries and writing bindings to C in them is usually painful.
Regardless I'm using bigloo.
>>
>>60326752
Practically every aspect of your post can be used to profile you. So no.
>>
File: ayy.jpg (52KB, 800x600px) Image search: [Google]
ayy.jpg
52KB, 800x600px
Need to do a graph that compares different running times (Y axis) of different algorithms (different colors) when having different results (X axis), it needs to look something like pic related, best way to do this with matplotlib? Do i just take an histogram and hack around with it? Or does such a graph have a name?
>>
>System.out.println();

Why would anyone do this?
why not just println() ?
>>
>>60326771
Nice attempt of deflection. Didn't work.
>>
>>60326759
They lack libs because you haven't written them yet.
>>
Is there a language which will simply read my mind and construct a program from it? Sometimes I'm too lazy to type.
>>
>>60326786
Exactly what a retard sepples user would say.
>>
>>60326807
Shouldn't you be getting ready for your school tomorrow?
>>
>>60326672
i dont play games
>>60326697
nice joke mamas boy
>>
>>60326810
What the fuck do you think you're doing you fucking snake oil salesman?
>>
>>60326792
There is, but it has no IO so it just causes your brain to heat up until your die from brain fever.
>>
>>60326810
>>60326771
>>60326748
>>60326631
>>60326590
Average C toddlers of /g/
>>
>>60326842
t. Rajesh patel, ENTERPRISE programmer
>>
>>60326856
So edgy, how many pimples have you got in your face?
>>
>>60326866
so poo, how much shit have you got on your streets?
>>
>>60326782
i get that people are turned off by verbosity, but a global namespace flooded with tons of garbage isn't exactly sexy, either (it also makes collisions an issue, the solution for which is generally to prefix functions with a common name, in which case it's no better than a formal namespace). C#, for one, has "using static" so you could have (for example) WriteLine(...) instead of Console.WriteLine(...)
>>
>>60326882
Did you actually think that to be "funny" or "offensive?"
>>
>>60326839
What language?
>>
>>60326949
Life.
>>
>>60326842
>reverse linking
Return back to your home site.
>>>/r/abbit
>>
>>60326746

>name 5 good characteristics of yours
>well, I can vomit in my hands!
>>
>>60326949
Malaria.
>>
>>60326856
>>60326882
what the fuck are you on? christ, the poo in loo shit is getting thrown around so frivolously that people don't even know what it means anymore. C++ is hardly a pajeet language
>>
File: The power of our gate keeper.jpg (183KB, 1300x1246px) Image search: [Google]
The power of our gate keeper.jpg
183KB, 1300x1246px
>>60326966
What If I decide not to "return back"? Are you going to cry?
>>
File: 1470578649875.jpg (137KB, 923x866px) Image search: [Google]
1470578649875.jpg
137KB, 923x866px
>>60326965
But it has I/O.
>>
>>60326978
Sounds pedophilic.
>>
>>60326992
Problem?
>>
>>60326996
Are you some kind of slave being forced to do this, or is it pure compulsion?
>>
>>60327030
No one would make me do gate keeping /g/ for free 24/7
>>
File: 493f8235268653898d5db81d06fa40ba.jpg (844KB, 1920x1080px) Image search: [Google]
493f8235268653898d5db81d06fa40ba.jpg
844KB, 1920x1080px
>>60323092
i prefer my anime with a lot of comedy and drama and not much action or romance/fanservice

cute schoolgirls, sure, but cute schoolgirls being pals at said school and making me laugh my ass off and/or solving creepy mysteries that involve a lot of people mysteriously dying

not this fuckin stupid shit like cute schoolgirls with magical kiss powers or cute schoolgirls in giant robots in space getting upset about pressing buttons

pic related: god tier anime without the side helping of hot steamy garbage
don't get me wrong, i still cringe every time i watch it, but at least by the end it's always turned out to be a good cringe
>>
>>60327146
>cute schoolgirls in giant robots in space getting upset about pressing buttons
leave shinji alone.
>>
>>60327146
Anon. That's not an anime. That's an image.
>>
>>60327220
what the fuck is a shingy
>>
File: bb.png (33KB, 800x600px) Image search: [Google]
bb.png
33KB, 800x600px
A camera at point C is looking towards point L. A person whose height is h is standing in point B. For given C, C0, L, B, h and f, calculate the height of the player in the projection plane, hp. All angles marked as such are right angles, all other angles are arbitrary.

This is fucking high school stuff but I haven't done anything remotely like that in 7 years now. Finally figured it out, now to implement it.
>>
>>60327146
>cute schoolgirls, sure, but cute schoolgirls being pals at said school and making me laugh my ass off and/or solving creepy mysteries that involve a lot of people mysteriously dying
>not this fuckin stupid shit like cute schoolgirls with magical kiss powers or cute schoolgirls in giant robots in space getting upset about pressing buttons
it's fascinating how you've managed to convince yourself there's any tangible difference in gayness between these things
>>
New thread:
>>60327260
>>60327260
>>60327260
>>
>>60327251
there is tho
>>
>>60327237
Is it just 1D?
You usually do this for 3D with PM=sm
Where M is the point in the scene and m is the point in the camera.
Something like
http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html
>>
currently working on a bluetooth project for windows. gotta figure out how to get the contents of an eeprom in a table.
Thread posts: 320
Thread images: 37


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