[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: 334
Thread images: 33

File: Masterminds.jpg (48KB, 385x499px) Image search: [Google]
Masterminds.jpg
48KB, 385x499px
What are you working on, /g/?

Previous thread: >>59444191
>>
File: 1488347828194.jpg (73KB, 600x800px) Image search: [Google]
1488347828194.jpg
73KB, 600x800px
First for C++
>>
File: two type of programmers.png (70KB, 426x300px) Image search: [Google]
two type of programmers.png
70KB, 426x300px
Well, /g/? Which is it?
>>
>>59446947
finally, an on topic image
>>
>>59447021
I've always used the one on the right.
It's less messy than the left one.
>>
>>59447021
one on the right, the other is for pedos
>>
>>59447089
What do pedos have to do with this
>>
>>59447021
Left at work.
Right at home.
>>
Real thread:

>>59446946
>>
>>59447101
The real question is is there anything left that has nothing to do with pedos?
>>
>>59447120
Both threads are equally terrible.
>>
>>59447101
They use the left one. That's what they've got to do with this. Do you want to further the pedo agenda by using pedo braces?
>>
>>59447021
left
like in linux kernel
>>
Thinking about going to uni within the next year or so..
I liked Computer Science as a subject at school but I'm more aiming towards Software Development/Engineering as a career

Should I go for Comp Science or would S. Eng be more suitable for what I want to do?
>>
>>59447063

A lot of people would say the exact same thing about the opposite.
>>
>>59447191
A lot of universities make very little distinction between the two, I would research that first. Had a few friends take a CompSci course at a local uni and it was identical to the s.eng course until the final year, were they got a couple of different module choices
>>
>>59447208
The difference between me and them though, is that they're wrong and I'm not.
>>
File: 1452363875549.jpg (44KB, 426x364px) Image search: [Google]
1452363875549.jpg
44KB, 426x364px
>>59447215
I'll keep a close eye out.

Also slightly worried about Computer Science at Uni because I hear its full of maths, the hardest maths I've done with CS is Boolean algebra and various rules involving it, makes me wonder if I'll just get blitzed.
>>
>>59447329
The hardest math you'll encounter in CS is Category Theory.
>>
>>59447329
Well its usually fundamental maths, learning how to construct proofs, calculus, boolean algebra and the like. May be a bit tricky if you're not great with that kind of stuff going into it, but nothing that'll require a maths degree and a tutor to get over. Again, be sure to check out the S.Eng course at the same uni, if they are the same, then its likely that maths modules are a choice by the student.

Also, not strictly related to the above, but some unis will automatically enroll you into whatever computing and software engineering society is in your country if you finish the S.Eng course and pass, e.g. in Britain, some will give you free membership into BCS when you pass
>>
Anyone tried Elm? Looks fun af desu
>>
>>59447543
Heard of it but thats about it, whats its bag vs. other JS based languages/JS itself?
>>
>>59447154
No you faggot.
>The other issue that always comes up in C styling is the placement of braces. Unlike the indent size, there are few technical reasons to choose one placement strategy over the other, but the preferred way, as shown to us by the prophets Kernighan and Ritchie, is to put the opening brace last on the line, and put the closing brace first, thusly:
if (x is true) {
we do y
}
>>
>>59447368
Wrong. The hardest one is complexity theory and formal languages.
>>
>>59447021
Left to define outermost scopes, right to define nested scopes.
>>
How much do you value visual prettiness in the languages you use?

As for me, it's almost the only reason why I use F# over Ocaml.
>>
>>59447606
I guess I couldn't say because I don't know category theory, but complexity theory and formal languages were not that difficult.
>>
>>59447762
visual elegance usually correlates to the language not being a clusterfuck
>>
File: 1453663469136.png (10KB, 645x773px) Image search: [Google]
1453663469136.png
10KB, 645x773px
>>59447368
>>59447376
Got it, thanks
>>
>>59447835
Category theory is explained here in these public lectures https://www.cs.uoregon.edu/research/summerschool/summer16/curriculum.php
>>
>>59447606
Lol no
>>
>>59447762
>ocaml
>prettiness
anon...
>>
>>59447762
But OCaml is prettier than F# anon.
>>
>>59448099
Not really no
>>
>>59448123
t. Reason dev
>>
>>59447600
This. OpenBSD also does this:
http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man9/style.9?query=style
>>
File: 069.jpg (9KB, 217x232px) Image search: [Google]
069.jpg
9KB, 217x232px
>>59447021
if(condition){
{
// Statements
}
{
// Statements
}
}
>>
>>59447021
the left one is only for functions...
>>
>>59447021

Neither.

if (Condition)
{
Statements ();
}


See:
https://www.gnu.org/prep/standards/html_node/Formatting.html
>>
redpill me on php

job Im applying to requires a simple function but in php, i know its easy and I can just copypaste but is it worth learning? should i just not bother n apply to other places?
>>
>>59449310
It's trash.
>>
>>59449310
>redpill
>>>/global/rules/2/
It's a web language. It's pretty widespread despite the suffering it puts people through. Are you applying for a web position? >>>/g/wdg/ if so. Think a little.
>>
How big is OCaml in the industry?
There's like zero written about it on the internet
>>
>>59449631
It's not, except in finance.
>>
>>59449631
Companies like Facebook and Mozilla use it. Several financial services too (LexiFi, Jane Street Capital come to mind).
https://ocaml.org/learn/companies.html although some of these are not actually from the companies, still I doubt they made shit up to promote their language.
It's not as big as in academy but there is definitely usage in several different industries.
>>
>>59449291
This is shit, seriously.
I hope I never see any code like that
>>
>>59449310
>php
It's trash.
I'm not shitposting.
>>
is there a better way to do this or have i reached the pinnacle of celsius <--> fahrenheit conversion?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

void main(int argc, char **argv)
{
if (argc != 3){
fprintf(stderr, "tempconv: usage: tempconv [-c|-f] value");
exit(EXIT_FAILURE);
}

int c;
while ((c = getopt(argc, argv, "cf")) != -1) {
switch (c) {
case 'c':
printf("%.2f in celsius is %.2f\n", atof(argv[2]), (atof(argv[2])-32)/1.8);
break;
case 'f':
printf("%.2f in fahrenheit is %.2f\n", atof(argv[2]), (atof(argv[2])*1.8)+32);
break;
default:
fprintf(stderr, "tempconv: usage: tempconv [-c|-f] value");
exit(EXIT_FAILURE);
break;
}
}
exit(EXIT_SUCCESS);
}
>>
>>59449895
port it to C++ and include some template templates
>>
>>59449895

Since we are memeing hard, #include <stdint.h> and use std types instead of int.

Use as many macros as possible, maybe use a union. Also, you could find a way to use the conditional operator.

Another option would be to do in OOP style
>>
>>59449310
You're the kind of person to use redpill unironically so it's probably right up your alley
>>
>>59447021
neither, because I only use well designed languages
>>59448099
agreed. even if you're not a fan of begin/end and let/in, you've got to admit the mix of C#-style and ML-style syntax doesn't work well (wtf is <'T>, for example?)
>>
>>59449895
>atof
Use strtof.
>>
>>59450397
https://www.youtube.com/watch?v=YgHNtzxO0y8
>>
>>59450431
ecks dee, very constructive post
>>
#include <stdio.h>

int main()
{

int tabs = 0,spaces = 0,new_lines = 0;
int input;
for(input = 0; getchar() != EOF; input++){
if(input == '\n'){
++new_lines;
}
if(input == '\t'){
++tabs;
}
if(input == ' '){
++spaces;
}
}

printf("The amount of spaces in the input was %d\n",spaces);
printf("The amount of tabs in the input was %d\n",tabs);
printf("The amount of new lines in the input was %d\n",new_lines);
}


I am reading through K&R and I am stuck on this. The loop won't normally terminate unless I do Ctrl+ D and that doesn't produce the correct numbers. Any idea?
>>
>>59446947
Rate my fizzbuzz:
#.(loop for i from 1 to 100 do
(format t "~:[~:[~a~;Buzz~]~;Fizz~:[~;Buzz~]~]~%~@*" (zerop (mod i 3)) (zerop (mod i 5)) i))
>>
>>59450501
autistic
>>
>>59450473
>The loop won't normally terminate unless I do Ctrl+ D
That's expected behaviour.

>that doesn't produce the correct numbers
You must assign the result of your call to
getchar
to input.
>>
>>59450537
What do you mean by assigning the result of getchar to input?
>>
Just had a small revelation. I never realized visibility is a class property, not an object property, and that objects of the same class can access each others private objects. Well in Java at least.
>>
>>59450569
Not in OCaml. OCaml is the only language that do oop the right way.
>>
>>59450555

In C, assignment is an expression. That means you can assign
getchar
to input and still compare that to EOF.
>>
>>59450603
But it can't solve the halting problem so it's trash
>>
>>59450603
It should really be classed COP shouldn't it
>>
>>59450632
What?
>>
>>59450615
I see. I changed the for loop to
while((input = getchar()) != EOF)
and it worked as intended. Any idea why the for loop didn't work or could I have done
for(input = 0; (input=getchar()) != EOF; input++)
>>
>>59450615
nvm i stopped being retarded and just tried it out for myself. I guess getchar() just returns the value and not actually puts it into the variable so I can compare them. I must have missed that when reading
>>
>>59447021
Right.
Doesn't the style on the left come from the times when people declared the parameters of the function outside of the parentheses, right after them?
>>
>>59447021
On that point, do you use
if (condition)
statement;

or
if (condition) statement; 

for one line statements?
>>
>>59450797
Neither. You must use:

  (condition) && statement;
>>
>>59447021
I started preferring the first, then ended up adopting the second as most code I see uses it
>>
>>59447021
not really that nitpicky to give a shit, i just try to write good programs.
>>
>>59448099
Meh, I can't help it, OCaml uses all the keywords/conventions I hate the most, in a subjective way, I mean.

I really would start learning OCaml (have read a little about it), but the ugliness is putting me off
>>
>>59450797
Second. Also, I insert a space after the left bracket like:
if ( something) statement;

Makes it more readable, especially when they are nested. When there are more than 4 levels of parentheses I use some creative things like one additional space for each outer level of nesting. Which happens a lot in my code, because I like when one instruction line does one logically compact thing.
>>
File: wew2.jpg (118KB, 1100x698px) Image search: [Google]
wew2.jpg
118KB, 1100x698px
What's the fastest way to out yourself as a pajeet?

>programming is 95% memorizing your libraries
>>
>>59451013

Doing the needful
>>
>>59451013
You posted this already. Again.
>>
>>59451013
>DRY - Don't Repeat Yourself
>>
>>59451034
When has that ever stopped anybody?
>>
File: spede aesborgor.jpg (20KB, 600x660px) Image search: [Google]
spede aesborgor.jpg
20KB, 600x660px
>>59451043
I just wish for serious discussions.
>>
>>59451061
I asked a genuine question.
>>
>>59450947
Yea I prefer that one as well it's just that code gets more exceeding margin
>>
>>59451178
I don't have a good solution for that unfortunately, but it's not that big of a deal for me.
>>
Is there C library that provides interface to native mobile stuff like gps, bluetooth and stuff for android and ios?
>>
>>59450399
any particular advantages over atof?
>>
>>59447269
No, the difference is that the one on the right is part of code guidelines in most companies.
>>
>>59451238
Ha i was looking into this and found
>The way, I'd handle your problem is on the organizational side (as this is company internal stuff): You basically say to the user: "Switch on GPS and you, user, get access to your emails" (well, as an example) Give something and you will get something back :-)
>I'm holding your information hostage until you tell me where you are
Fucking psychos. Anyway the NDK has rather limited OS interacting going on. It wouldn't surprise me if you couldn't do it from the NDK.
>Native mobile stuff
Rereading perhaps I'm not interpreting you correctly. You're saying you just want a library that allows for cross platform access to GPS and such?
So lazy..
>>
File: dunecat.jpg (30KB, 439x392px) Image search: [Google]
dunecat.jpg
30KB, 439x392px
Employed Haskell programmer reporting in
>>
>>59454073
who did you have to sleep with?
>inb4 ur mom
>inb4 Satan
>>
>>59454073
there's no need to lie on the internet, animu shit
>>
>>59447109
this
>>
>>59447109
>the crazy things /g/ does at home
>>
I'm trying to learn C by porting really simple things I did in python during uni labs but I'm just totally stuck on this for some reason.

Malloc is returning null and causing a segmentation fault but I don't understand why. Obviously my code is going to be absolutely retarded because I just don't know C at all but it would be nice if someone could help me figure it out.

How it's supposed to work is you enter sentences, it splits the sentences into words and stores all the possible options for each position in the sentence. Then it generates a sentence by going through the store and picking a random word from the available choices for each position.

http://pastebin.com/yzj3eX7d
http://pastebin.com/erkNA752
http://pastebin.com/WKFXNc10
>>
File: 1471655512416.png (451KB, 718x904px) Image search: [Google]
1471655512416.png
451KB, 718x904px
>>59447021
Who gives a shit?
>>
>>59447021
(if condition
if-true-form
if-false-form)
>>
>>59454340
Your problems are coming from the 'else' section of addJoke.
strlen(getData(jokeStore, count-1)) + strlen(word) + 1;

You need to to be +2, like you have is the previous section, for the null terminator AND the ":" you're inserting into the string.
strcat(freshString, joke);

You're writing the entire joke to the new string here, discarding the old one, and writing way past the end of the buffer.
I think it needs to be
char *old = getData(jokeStore, count-1);
int size = strlen(old) + strlen(word) + 2;
...
strcat(freshString, old);


Another strange thing I've noticed is that you're allocating a head on the list when it's made, but you never use it.
Your program leaks memory like a sieve.

I also have another bit of advice:
You have a lot of consecutive calls to strcat and all of that. I would really recommend using sprintf instead.
freshString[0] = '\0';
strcat(freshString, old);
strcat(freshString, ":");
strcat(freshString, word);

can become
sprintf(freshString, "%s:%s", old, word);

It's just a lot cleaner and harder to fuck in, in my opinion.
>>
>>59454758
>fuck in
fuck up*
>>
>>59454180
He's employed. Just not as a Haskell programmer.
>>
>>59447021
Depends.
Left for functions
Right for everything else.

Anyone who doesn't do this is a CIA nigger.
>>
real thread
>>59446946
>>
>>59455280
retard detected
>>
My polynomial time integer factoriser is done... the solution ended up being surprisingly straightforward. I almost want to call it "obvious" but of course it's a lot easier to say that in hindsight. It can't really be all /that/ obvious if no-one else found it until now (that we know of). Still, it's only ~2k lines of non-generated C and 200 lines of Python (for some generated C which was a bit too much for the preprocessor).

2048bit inputs take around 12 minutes on my Haswell chip. 4096bit is a little over 3 hours. I don't think my solution is parallelisable at all unfortunately; I might be/hopefully am wrong about that.

My question is, who do I take this to? I obviously can't just reveal this publicly.
>>
Should I learn Idris or Python?
>>
>>59455574
Not Python
>>
>>59455564
kek, nice bait
>>
>>59455591
Why not? It's much more widely used than Idris.
>>
>>59455564
upload it to gitlab and post it here
>>
I could learn another language, but why bother? It would take too long, and I can be just as productive now. I'm going to stick with C.
>>
>>59455608
It's absolute trash and it will completely rot your mind
>>
File: 4L_GxfRWd21.jpg (128KB, 500x280px) Image search: [Google]
4L_GxfRWd21.jpg
128KB, 500x280px
>>59447021
>He doesn't use both
if(content){
}

and

if(content)
{
}

Switching between the two randomly in the code but always typing } //end of if

It's like none of you even have autism.
>>
>>59455665
fp extremists pls go
>>
>>59455653
If I post undeniable proof, or even reasonably convincing evidence, it would attract an awful lot of attention. I need to maintain some plausible deniability on this; need to be able to claim I was joking or mistaken.
>>
>>59455695
PROTIP: your algorithm doesn't work, now stop shitposting and get >>>/out/
>>
In GCC, can I not start header files with a number?
#ifndef 5-4_H


Gives the error
macro names must be identifiers

And it points to that ifndef.
>>
>>59455761
An identifier has to start with a letter or an underscore.
The compiler is going to see that is "five minus four _H"
>>
How do I contribute to opensource? Just like search suitable projects on github?
>>
It's the current year plus two and there STILL isn't a decent way to parse JSON in the command line. Have the webdev babbies given up on the old world?
>>
>>59455895
Yes.
>>
>>59455895
Submit pull requests.
It's the maintainers job to see if it's garbage or if it's good enough to pull.
Don't sit around thinking your code is shit.

Oh and don't get pushy. That's how you get bullied by Linus.
>>
>>59455895
Yep, look for open issues, submit PRs that solve them. Ask for help if you need it.
>>
>>59455918
so
>find a project
>find a bug/feature
>fork
>clone
>do shit
>push
>make a pull request
>argue with people
right?
>>
>>59455941
>>59455943
thanks faam
oss, here I come
>>
>>59455965
Yes.
>>
Haskell is basically the minimum acceptable programming language these days.

Dynamic languages deserve to be consigned to the dustbin of history.
>>
>>59456191
Static type systems only limit the programmer. Enjoy your statically typed BDSM. I bet you can't even extend your language's syntax without breaking your precious type system.
>>
>>59456216
This is only an issue in type systems like Java's. Such a strawman.
>>
>>59455564
I'll come to Melbourne so you can show it live to me.
>>
>>59456227
Then show me. Write a read macro in Haskell (or whatever statically typed language) without breaking your type system. I'm not holding my breath.
>>
Fact: OCaml programmers are the most powerful race in the world.
>>
>>59456267
What's a read macro?

>>59456284
Fact: OCaml is the definition of wasted potential
>>
>>59456298
Fact: that's not a fact.
>>
>>59456310
Fact: OCaml was relevant 10 years ago, not so much now.
>>
>>59456267
{-# LANGUAGE TemplateHaskell #-}
>>
>>59456332
Heh, it's like they haven't been following Haskell at all
>>
Any language without HKTs is not worth learning.

Any language without dependent types is not worth learning.
>>
>>59456298
>What's a read macro?
Code that transforms how the reader of a language reads code.
>>59456332
>[| |] everywhere
What's this garbage?
>>
>>59456385
>Code that transforms how the reader of a language reads code.
>the reader of a language
What is this?
>>
>>59456373
Languages with I/O are not worth learning.
>>
>>59456394
I guess they mean lexer/parser? That's the only part where you "read" a language. The rest is pure semantics.
>>
What are the TOP NON-MEME anguages for Systems, Internet/Web, and Data(bases)?
>>
>>59456394
It is the device that reads a language's forms. It is synonymous with parser, as >>59456401 took their precious time to explain for you. You typically encounter this term in the context of the Lisp family of languages. https://en.wikipedia.org/wiki/Lisp_reader
>>
>>59456432
Sounds like a crutch.
>>
>>59456410
>NON-MEME
You'll get flamed no matter what you propose for such questions. Anyways meme languages expert reporting in:

>Systems
C, C++ are the most proven in this field.

>Internet/Web
Java for back-end is very ENTERPRISE, you can try C# with ASP.NET too, or the popular hipster/startup stacks can rely on languages such as Python, Go or Ruby (the unholy triforce as I like calling them). Obviously on the front everything is Javascript.

>Data
R, Python, SAS or SQL
>>
>>59456449
C++ and Python are about as memey as they get.
>>
File: lisp look out.png (32KB, 502x362px) Image search: [Google]
lisp look out.png
32KB, 502x362px
>>59456385
>>[| |] everywhere
>What's this garbage?
It's called sanity.

Look at pic related. I am using a monad transformer \on top of the top-level compile-time monad\
>>
>>59456462
>C++
Nearly every recent driver is written in C++.
>Python
I hesitated putting it in web since it's becoming less and less used, but for ML or statistics/uncertainties it's still king (especially through wrappers such as tensorflow or OpenTURNS).
>>
print(
'Generate almost-isosceles Pythagorean triples of the Fermat family |a - '
'b| = 1', '\n')

def userInput():
global num
global SINGLE
try:
num = int(input('Number of triples to generate: '))
if num < 1:
raise ValueError
except ValueError:
print('Enter a postitive integer.', end = ' ')
return userInput()
if input('Print last triples only? (y/N): ') in set(
['y', 'Y', 'ye', 'YE', 'yes', 'YES']):
SINGLE = True
else:
SINGLE = False

def x():
global xOLD
xOLD = (xOLD*3 + yOLD*4)
return xOLD

def y():
return (xOLD*2 + yOLD*3)

userInput()
n = 0
xOLD, yOLD = 1, 1
while n != num:
c = y()
a = (x()-1)//2
b = a + 1
yOLD = c
n += 1
if not SINGLE:
print(str(a)+',', str(b)+',', c)
if SINGLE:
print(str(a)+',', str(b)+',', c)

What's wrong with this program? I only got a C, despite it being fairly robust, and even utilizing recursion creatively.
>>
>>59456464
And? You can do that perfectly fine in Lisp. https://common-lisp.net/project/cl-monad-macros/monad-macros.htm#_Toc251846364
You could go further and do it at read-time if you really wanted to using sharpsign-dot (#.).
>>
>>59449895
>void main(int argc, char **argv)
This is the second time I'm seeing this line. Can you tell me what it does? Yesterday I was reading ffmpeg C code and same line was written. I understand that main has two inputs: argc integer type but what is second argument? Why do you prefer using it? I'm noob by the way. I've elementary idea about pointers and functions.
>>
>>59456561
And?
>>
>>59456578

come back after you get to pointers
>>
>>59449291
God damn that cancer is unreadable.
Follow the Linux kernel style guide and burn the GNU coding standards.
>>
>>59456578
argv is an array of pointers to char, or more usefully: an array of strings.
It contains the actual command line arguments given to the program.
>void main
That's actually incorrect. It's supposed to be int main.

>>59456511
Your variable names are fucking shit.
>>
>>59456591
Will do.
>>
>>59456581
And so why not? I think both systems have their merits. It is bad to completely discard something just because it is unfamiliar (as >>59456191 so gracefully demonstrated).
>>
>>59456616
What? He's right.
Dynamic typing IS awful.
What you linked clearly shows types
>>
File: snek.jpg (121KB, 600x800px) Image search: [Google]
snek.jpg
121KB, 600x800px
Snek here. I already know Python and ASP, what should I learn next?
>>
>>59449291
Did stallman pick the standard? If so, that explains why it's so shit.
>>
>>59449895
>while ((c = getopt(argc, argv, "cf")) != -1)
gross
>>
>>59456634
Show me the types then. To be fair to you, I already know Common Lisp actually has pretty good support for types for a dynamic language. See
http://clhs.lisp.se/Body/m_deftp.htm
http://clhs.lisp.se/Body/s_declar.htm#declare
But it is still a dynamic language at heart.
>>
>>59456609
Thanks. Getting something now.
>>
>>59456677
Oh, I misread.
Yours doesn't use types?
It's shit.
>>
Types are universal properties of your code.
Tests are existential properties of your code.

Guess which is more powerful.
>>
>>59456720
I figured this was the response I'd get. No real arguments, just emotionally charged statements. Come back when you can back up what you say.
>>
>>59456730
Why not both? You need them in statically typed languages anyway.
>>
>>59456749
Come back when your code is a proof.
>>
>>59456757
That's the thing. You can add tests to a static language, but if you're using a dynamic language then tests are all you have.
>>
>>59456749
No, I misread the code.
I thought you had embedded Haskell code into lisp, but that was just the code to be translated.
The """"equivalent code""" is not equivalent, it has no types, and almost certainly isn't type safe. You know the benefits of types and don't need me to tell you, you're just in a tantrum.
>>
>>59456609
>perfectly readable, formatted code
>"Your variable names are fucking shit"
This is a fallacy. Might as well critique my code by calling me ugly.
>>
>>59446947
Does Java 8 have built in bubble sort? I want to use it.
>>
>>59456774
Not true. In CL, you can use reap the benefits of both systems, as demonstrated in the literature I linked.
>>59456777
[citation needed]
Nice ad hominem there, too. Really helps that "argument."
>>
>>59456601
s/the GNU coding standards/everything GNU/

The Linux style guide is based. It's how C was supposed to be written IMO (I'm talking about the indentation part)
>>
>>59456855
CL's type system is a lot less powerful than Haskell's, although it is decent
>>
>>59456855
Nope. You don't get to claim the benefits of static types for CL. CL plus true static types =/= CL. CL is a dynamic language.

"static types" at runtime are not static types at all.
>>
>>59456825
Spoken like a true novice. Variable names are just as, if not more, important than the formatting. I don't even think your formatting is any good. You have a bunch of line breaks for some reason.

When I see a function named x, what the fuck am I supposed to think that does? There is absolutely no context for it. It makes it even worse that you're mutating global state behind it, so I can't even get anything from the arguments.
I'm not actually against single letter names, but there needs to be enough context for them. Just naming a bunch of shit a, b, c, x, y and throwing them all around your program isn't going to make shit obvious.

You probably also lost marks because of the way you're using global variables.
>>
>>59447021
(condition) ifTrue:
.
>>
>>59447021
Right.

Left is only acceptable in C#, where all curly braces are put on their own lines.
>>
>>59456879
Haskell's type system is nice, no doubt. But I do not see how Haskell can do what is shown in http://clhs.lisp.se/Body/m_deftp.htm. I think such a problem would be better solved in a dependently typed language.
>>59456889
Repeating the same rhetoric over and over again isn't going to make it anymore true. You can verify properties of types at compile-time in CL. It's like you didn't even read what I linked at all.
>>
File: 1467141573755.jpg (31KB, 500x333px) Image search: [Google]
1467141573755.jpg
31KB, 500x333px
>>59456991
>sure my language has a worse type system but it could have a much worse type system
>>
>>59457022
If you need me to explain it for you, you could have just asked. I'm saying Haskell's type system isn't as expressive, if it can't do something as simple as verify a matrix is equidimensional.
>>
>>59457045
It can do that, though.
>>
>>59457052
Show me then, using just types. I'm honestly curious, because I use Haskell off and on for fun.
>>
>>59457063
(n ~ m) => Matrix n m a
>>
>>59457076
That just denotes the types are the same. Try harder, please.
>>
>>59457098
You might be a retard if you wrote this post.
>>
>>59457103
He can't help it, he's a lisper.
>>
>>59457103
More ad hominem, thanks. By the way, you need to compare the values underlying those types to solve this problem. In other words, it depends on the values of the rank and the number of rows, which cannot be expressed through your example.
>>
>>59456917
>a bunch of line breaks for some reason
It's because the lines exceed 79 characters. The body of the breaks are within function parentheses, and are indented, which is perfectly readable. How is that improper in any way?
>When I see a function named x, what the fuck am I supposed to think that does?
>There is absolutely no context for it
Are you an goddamn imbecile? It's stated as clearly as can be in the first print statement, ergo it serves as a comment for the entire program. Anyone familiar with Pythagorean triples and the Pell equation (i.e. anyone who's finished highschool) knows what x, y is. Do you also want me to give word definitions for standard English and redundantly comment every line so you'll understand?
>mutating global state behind it
OK, good point, but the function is only is called within the algorithm. It's global for optimization.
>>
>>59457125
You might be a retard if you wrote this post.
>>
>>59457133
Do people even use 80 character wide terminals anymore?
>>
explain to me in retard terms how do I invert a list?
>>
>>59457157
What kind of list?
>>
>>59457183
a racket list.
>>
>>59457140
I guess we all can't be willing to accept our language is deficient, can we?
>>
>>59457192
{-# LANGUAGE TypeInType, GADTs #-}
data N = Z | S N
data Vec n a where
Null :: Vec Z a
Cons :: a -> Vec n a -> Vec (S n) a
type Matrix n m a = Vec n (Vec m a)
type SqMatrix n a = Matrix n n a

{-
-- alternatively
data Mat n m a where
NullMat :: Mat Z Z a
NewColl :: Mat n m a -> Vec n a -> Mat n (S m) a
NewRow :: Mat n m a -> Vec m a -> Mat (S n) m a
type SqMatrix n a = Mat n n a
-}

vzip :: Vec n a -> Vec n b -> Vec n (a, b)
vzip Null Null = Null
vzip (Cons a as) (Cons b bs) = Cons (a,b) (vzip as bs)

instance Show a => Show (Vec n a) where
show Null = "Null"
show (Cons x xs) = show x ++ " :: " ++ show xs

instance Eq a => Eq (Vec n a) where
(==) (Cons a as) (Cons b bs) = (a == b) && (as == bs)
(==) Null Null = True
>>
>>59456511
using recursion creatively doesn't make good code. This got you a C because it is needlessly complicates something as simple as input validation.
>>
Meh, trying out SDL2.

My window redraws my screen. I think this is a window manager related problem?

Because when I terminate my project with my wm shortcut I get a brief flash of my image.

Putting the code in a for loop actually shows the image.

Anyone? Awesomewm btw
>>
>>59457151
If you wish to adhere to PEP8. And it's the default for many terminal emulators.
And maybe not for tiling WM, but it's optimal for stacking WM as you can press terminal shortcut as needed to open multiple terminals and snap to each other. No need for multiplexer. I rarely need over 80 width anyway, but needs vary of course
>>
>>59457289

I've been messing with SDL lately, if you post some code it would help.
>>
>>59457289
You probably just need to render it each frame.
>>
>>59457199
This doesn't even come close to what was specified.
>>
Making a python utility that notifies me when a particularly slow thread has been updated

How do I make my program always run in the background? I've looked into nohup, but I can't seem to close the terminal and still have the program running
>>
>>59457319
It does though

Try understanding the problem instead of being crippled by lisp
>>
>>59457319
SqMatrix n a
A square matrix of order n and elements of type a

If you want ANY square matrix, use an existential, or a forall
>forall n. SqMatrix n a
>data SqMat a = forall n. SqMat (SqMatrix n a)
>>
>>59457329
>>59457335
As I was saying, you're going to need dependent types. How are you going to verify this at runtime?
>>
>>59457303
Am following Lazy Foo's tutorial...
>>59457314
Thanks, I checked out the official documentation and got it fixed. You pointed me in the right direction. Read something about the backbuffer. The tutorial I am reading is not using this (at the very beginning at least).
>>
>>59457322
Try this with what you are currently trying
>(python pythonisshit.py &)
>>
>>59457349
existential quantification
you can also grab nat kinded type vars via proxies out of ints using GHC.TypeLits
>>
>>59457322
in bash: cmd &
>>
>>59457133
You're clearly VERY inexperienced and don't know anything about writing clear programs.
Why don't you ask the marker why you got such a low grade?
>It's global for optimization
That is a fucking stupid justification for that.
>>
>>59457322
Either as >>59457356 and >>59457362 say, or if you want a more "proper" way: fork() and kill the parent.
>>
tfw started learning vim this morning, went through the vimtutor and today I worked on a project forcing myself to use vim.

Without thinking I'm almost never using the mouse and becoming decently quick already. Can't wait until I have a few months with it.
>>
>>59457356
I'm trying that, but I still get the "terminate running processes" prompt
>>
>>59457383
You didn't do the parenthesis
>>
>>59457383
What the fuck is "superterminaldeluxe"? Why are you using Python 2?
>>
>>59457386
This solved it! Thanks!

>>59457407
S U P R E M E T E R M I N A L , 
D E L U X E A U T I S M E D I T I O N
>>
>>59457375
I wrote a little example. I wanted to see how python handles it.
import os
import sys
import time

if os.fork() != 0:
os._exit(0)

# We don't need these anymore
sys.stdout.close()
sys.stderr.close()
sys.stdin.close()

sys.stdout = open("output", "w", 1)

while True:
print("I'm a daemon")
time.sleep(1)
>>
>>59449310
PHP is perfectly fine but most of the work is at ad agencies and on wordpress.

So if you like drinking and fucking around with college age chicks in their 20's, go for it.
>>
>>59457250
>needlessly complicates
How so, given that the function only calls itself on exception to reset input, and that it takes no arguments itself? From what I've read, that's the perfect use of recursion, vs using an unnecessary while loop.
>>59457363
>You're clearly VERY inexperienced and don't know anything about writing clear programs.
Once again, a fallacy. It's on you to know if I am or am not "inexperienced" - why are you responding to me if you think so?
>Why don't you ask the marker why you got such a low grade?
Office hours are Tuesday.
>That is a fucking stupid justification for that.
So you problem is with global variables in general, and not the given use here? The function is part of the algorithm, as are the variables. There is no crossover with anything else
>>
>>59457567
>that's the perfect use of recursion
Python does not have TCO. While a user obviously isn't going to be attempting to validate input the thousands of times they would need to cause a stack overflow, it's still not a good case for recursion.
Unless you have TCO guaranteed, you should only use recursion when the number of stack frames grow better than linearly. For example, if you're walking a tree of some sort, it would grow logarithmically, and the input would have to ridiculously huge (probably more than the amount of memory you have) to overflow the stack.
>So you problem is with global variables in general, and not the given use here?
The issue is even more general than that: it's shared mutable state. The make your program harder to reason about, and harder to make parallel.
You easily could have written the function to be self-contained and not have any global state.

If you seriously don't know about these things, you are VERY inexperienced.
I shouldn't even have to bring this shit up.
>>
>>59457567
>Office hours are Tuesday
Trash University, tbqh
>>
Web programming is the best kind of programming
>>
>>59457717
Is that like saying "AIDS is the best kind of disease"?
>>
>>59457830
I prefer AIDS to C(ancer)
>>
>>59457717
Programming while crossdressing (with fellow /g/ anons)
>>
C for libraries.
Python for scripting.
What to use for general programming? Lisp is kind of nice but no static typing. Ocaml has GIL and only one implementation. All the other languages just compete on which of them is the shittiest. Everything sucks.
>>
File: 1489560306627.jpg (274KB, 1231x930px) Image search: [Google]
1489560306627.jpg
274KB, 1231x930px
>>59458422
Bash (including sed, awk, and the like) for scripting.
C for everything else.

That's the only correct way of doing things.
>>
TDD
/*The first two parameters of this function are the goals that each team has
scored. The other two parameters are the points of each team before the game.
This function should adjust the points of the teams according to the goals that
they have scored. As a reminder, the winner takes 3 points and the loser takes no
point. In the event of a draw, both teams get 1 point each.
Additionally, the function should indicate which team has been the winner: 1 if
the first team has won, 2 if the second team has won, and 0 if the game has ended
in a draw.*/

import std.stdio;
import std.algorithm;

uint update_points
(in int goals_team1, in int goals_team2, ref int points_team1, ref int points_team2)

in
{
assert((goals_team1 > 0) && (goals_team2 > 0));
}
out (result)
{
assert( ( canFind([1,2,0], result) ) == true );
}
body
{
uint game_result = uint.max;

if (goals_team1 != goals_team2)
{
points_team1 += 3*goals_team1;
points_team2 += 3*goals_team2;
game_result = (goals_team1 > goals_team2) ? 1 : 2;
}
else
{
game_result = 0;
points_team1 += 1;
points_team2 += 1;
}
return game_result;
}
unittest
{
int points_team1_test1 = 14;
int points_team1_test2 = 1;
int points_team1_test3 = 99;
int points_team2_test1 = 22;
int points_team2_test2 = 19;
int points_team2_test3 = 4;
assert(update_points(4,3,points_team1_test1,points_team2_test1) == 1);
assert(update_points(1,4,points_team1_test2,points_team2_test2) == 2);
assert(update_points(2,2,points_team1_test3,points_team2_test3) == 0);
}


Comment on my indent style please, does it pass?
>>
>>59458461
>Deadlang
I'm not even going to bother reading that shit.
You really should question what you're doing with your life.
>>
>>59458467
>>59458431
Are you two the same? I guess so.
>>
>>59458461
in 
{
assert((goals_team1 > 0) && (goals_team2 > 0));
}
out (result)
{
assert( ( canFind([1,2,0], result) ) == true );
}

This looks fucking horrific
>>
>>59446947
Been geeking out about .NET Core and Powershell on windows server. Feels wrong but so right.
>>
>>59458481
I find
out (result) 
{
assert((canFind([1,2,0], result)) == true);
}

easier to look at, not for the purpose of elegance, but for the purpose of avoiding mistakes
>>
>>59458496
don't* find
>>
File: 1405777474873.jpg (14KB, 251x242px) Image search: [Google]
1405777474873.jpg
14KB, 251x242px
tfw maintaining COBOL programs
>>
File: suicide_pepe.png (87KB, 285x285px) Image search: [Google]
suicide_pepe.png
87KB, 285x285px
>>59458508
>tfw you have to maintain pajeet's programs
>>
>>59458518
>tfw maintain php code
>>
>>59458461
>Not using Java style indentation
>>
What's the best language and framework to prototype some OpenGL stuff in?

Doesn't need to be efficient or fast or any of that, I just wanna get the structure of the program figured out and working before I put it into the actual language.
>>
>>59458508
>>59458518
Please stop posting the reddit frog, and piss off.
>>
File: lua_waifu.jpg (113KB, 573x892px) Image search: [Google]
lua_waifu.jpg
113KB, 573x892px
Why is lua such a comfy language?
>>
>>59458533
C++
>>
File: angry_freg.jpg (28KB, 680x583px) Image search: [Google]
angry_freg.jpg
28KB, 680x583px
>>59458534
REEEEEEEEEEEEE GET OUT NORMIE
PEPE IS 4CHAN'S MEME AND ALWAYS WILL BE
GET OUT GET OUT GET OUT!!!!!!!
>>
>>59458546
>>59458518
>>59458431
Are you two the same person? I guess so
>>
File: 1335764505801.gif (280KB, 250x225px) Image search: [Google]
1335764505801.gif
280KB, 250x225px
>>59458540
fugg
if that's the case i might as well not bother
i was hoping maybe C# or Java or Python or something had a lazy-mans library to just slap something together
>>
File: astronaut_smug_pepe.jpg (389KB, 3032x2064px) Image search: [Google]
astronaut_smug_pepe.jpg
389KB, 3032x2064px
>>59458553
Guess again norman.
>>
>>59458567
Don't need to, point is proven already
>>
>>59458553
No, I'm not some frogposting scum.
That is an insult of the highest calibre.
>>
>>59458573
Being a brain dead C toddler is an insult of the highest calibre
>>
>>59458567
>>59458546
Why the hell don't you go back to normiebook with the rest of your cancerous meme-spouting kind?
>>
>>59458593
See the image in >>59458431
>>
>>59458538
It's secretly close to JavaScript. imo
>>
File: 1401477862729.jpg (287KB, 1280x960px) Image search: [Google]
1401477862729.jpg
287KB, 1280x960px
Just finished a multithreaded networked inference engine, it was a massive pain in the ass
>>
File: 1489461328707.png (740KB, 1834x1200px) Image search: [Google]
1489461328707.png
740KB, 1834x1200px
>>59458601
Only goes to prove that you are another brain dead C toddler
>>
Is it possible to average two integers in C or is it yet to be resolved?
>>
File: smug_pepe_wrapped_in_a_towel.png (167KB, 636x426px) Image search: [Google]
smug_pepe_wrapped_in_a_towel.png
167KB, 636x426px
>>59458595
I think you are the only normie here. If you came to 4chan for serious discussion then maybe you should go back to >>>reddit.
>>
>>59458646
>Le ebin memes XDDD
I've posted my damn integer averaging function here probably a dozen times. I don't want to have to post it again.
>>
https://www.gnu.org/software/guile/news/gnu-guile-220-released.html
GNU GUILE 2.2 RELEASED! GET IT WHILE IT'S STILL HOT!
>>
>>59458663
what's this?
>>59458659
Is that some "1400 lines of enterprise code meem"? C is unreadable already, don't need overdo it
>>
>>59458538
dont know, but it is true.
Lua is sexy lang
>>
File: awkward.jpg (52KB, 374x638px) Image search: [Google]
awkward.jpg
52KB, 374x638px
>>59458663
L-Lua is better a-anon-san.
>>
>>59458710
>indexes start at 1
>no macros
>end
it's shit.
>>
>>59458687
There are 22 lines of actual code (i.e. no blank lines/comments).
None of is "dealing with" anything that is a problem caused by C in particular, but any fixed-size integer system.
>>
>>59458720
>'end'
>>
>>59458737
>>'end'
>>
>>59458749
>>>'end'
>>
>>59458646
float avg = (n1+n2)/(2.0);

?
>>
File: 1485262515835.jpg (76KB, 1065x859px) Image search: [Google]
1485262515835.jpg
76KB, 1065x859px
>>59458801
Overflows on n1 == INT_MAX, n2 == INT_MAX.

I'll just post the stupid function again.
/**
* Averages an array of integers.
*
* Averages an array of integers, without overflow or conversion to a larger type.
* It is equivalent to the sum of the array, divided by the array's length (rounded towards zero).
*
* @param n Number of array elements. Must be greater than zero.
* @param arr A pointer to an array of n integers. Must be non-null.
* @return The mean of the array's elements.
*/
int iavg(int n, const int arr[static const n])
{
int avg = 0;

/* A buffer of values that are lost to integer truncation.
* It should always be in the closed interval (-n, n).
*/
int error = 0;

for (int i = 0; i < n; ++i) {
avg += arr[i] / n;

int loss = arr[i] % n;

// error + loss >= n
if (error > 0 && loss > 0 && error >= n - loss) {
// error = (error + loss) - n
error -= n - loss;
++avg;

// error + loss <= -n
} else if (error < 0 && loss < 0 && error <= -n - loss) {
// error = (error + loss) + n
error += n + loss;
--avg;

} else {
error += loss;
}
}

// Fix some overcompensation for error

if (avg < 0 && error > 0)
++avg;
else if (avg > 0 && error < 0)
--avg;

return avg;
}

Now you can average any number of integers, and shut the hell up about it.
>>
>>59458826
Wha'ts stopping you from using ulong and throwing exceptions?
>>
>>59458892
>using ulong
For what? The length parameter?
>throwing exceptions
Don't ask stupid questions.
>>
>>59458900
Don't ask stupid questions.
>>
>>59458914
Well, for the length parameter ('n'), I chose int for a very specific reasons, when size_t would have been called for.
The function uses n is many calculations involving negative numbers. Due to the "usual integer conversions", many negative numbers would be converted to very large positive numbers and make all of my results wrong, so it had to be a signed type.
Also, I wanted the function to work without requiring anything to be converted to a larger type, as that means that the function does not work in general. So, I had to use int instead of ssize_t, long long, or any floating type (which wouldn't have the required accuracy for large integers anyway).
>>
>>59458959
>a very specific reasons
very specific reasons*
>>
File: lennartplz.jpg (26KB, 665x279px) Image search: [Google]
lennartplz.jpg
26KB, 665x279px
>>59447021

What about this style?
>>
What documentation generator should I use for C++ projects?
I want something with the least amount of friction, since I've never used anything like that.
>>
>>59458963
It's objectively the best style.
Even out lord and saviour says so: https://www.kernel.org/doc/Documentation/process/coding-style.rst
>>
File: openssl.jpg (76KB, 732x802px) Image search: [Google]
openssl.jpg
76KB, 732x802px
>>59449806

Your wish is my command.
>>
>>59458989
> == NULL
Jesus Christ how horrifying.
>>
>>59458963
>goto fail;
>goto fail;
No, thanks.
>>
When I use the Java file library to list all the file in a directory and store them in an array they are in the incorrect order, I perform a sort on this array which 9 out of 10 times works, but if the files have names like 1.jpg 2.jpg 3.jpg... 10.jpg etc.

They are sorted into the order: 1.jpg, 10.jpg, 2.jpg, 3.jpg Is there a way to get around this as it's a fucking pain that it's just this single case?

I've tried using a natural sorting comparator over the default lexicographical one, but that doesn't give a different order that default for this specific case.
>>
>>59458720
>indices at 1
What's the problem?
>>
>>59459016
What is it, the 1960s?
Compilers have warnings for that kind of shit now.
>>
>>59446947
The same thing I'm working on every night, how to impart passion and interest in using computational tools to abject novices who range from incompetent to outright resistant to the medium.

The code that I write is much less important than the code that they write.

Literacy is better the more people share that literacy.

Run Spot run.

See Spot run.
>>
I would love to get some good info on how to work with java servlets, jsp or jsf. Example how to set up a servlet that talks to mysql db and keeps a session of for example login.
>>
>>59459026
Compilers always compile to machine code with jmp statements regardless of what you abstraction crybabies whine about this decade.
>>
>>59458989

> /* disabled since version 1.10
> Not just removing the fucking code
>>
>>59459056
>abstraction
What the fuck are you on about?
I never mentioned anything of the sort.
I was just saying that If you weren't using a compiler as old as your granddad, you would get a warning for the "goto fail" kind of shit.
#include <stdio.h>

int main()
{
if (1)
goto fail;
goto fail;

printf("good\n");
return 0;

fail:
printf("bad\n");
}

$ gcc test.c -Wall
test.c: In function ‘main’:
test.c:5:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (1)
^~
test.c:7:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
goto fail;
>>
>>59459085
>if (1)
> goto fail;
> goto fail;

kek
>>
>>59459085

Given this was a major bug in a major SSL library.. apparently compiler warnings aren't enough.
>>
>>59459112
It was added in GCC 6.1, obviously in reaction to Apple's fuck up.
>>
>>59459112
Yeah everybody should start using python, it doesn't have this problem.
>>
>>59447021
It depends on what the style guide says, consistency is key.
>>
>>59459110
It's like anon doesn't even see the irony.
>>
>>59459197
I saw a similar bug in Objective C in some apple product
>>
> SQL
stopped reading there
>>
>>59459178
What, idiot programmers not reading compiler output?

Every language is going to have that "problem"
>>
>>59459085
>weakly typed language
>>
>>59459224
SQL has it's uses.

You should become language agnostic, anon. It widens the people that you can comfortably collaborate with.
>>
>>59459238
That has literally nothing to do with that program.
>>
>>59459239
I'm not comfortable around people.
>>
>>59459253
>responding to weakly typed bait
>>
>>59459239
I don't want those other filthy programmers messing with my projects.
>>
>>59459256
Nobody intelligent is, but together, we can burn the world.

You should be able to read all of their code, so that you know their schemes and plots and dreams and bots.
>>
>>59459265
You're doing it wrong.
>>
File: my_project_for_the_last_week.webm (2MB, 1920x450px) Image search: [Google]
my_project_for_the_last_week.webm
2MB, 1920x450px
If you want the version with audio: my.mixtape.moe/wryegl.webm
>>
>>59459238
>weakly """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""typed"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" language
Fixed that for you.
>>
>>59459313
kek
>>
>>59459313
I don't think anyone would argue that C doesn't have types.
>>
>>59459085
If just like to point out that Ada has never had such a retarded bug
>>
>>59459231
>Every language is going to have that "problem"
Not really. Such trash shouldn't even compile.
>>
New thread:

>>59459347
>>59459347
>>59459347
>>
>>59447021
if condition
{
statements
}
>>
File: 14895126140920.jpg (43KB, 485x600px) Image search: [Google]
14895126140920.jpg
43KB, 485x600px
>>59454416
Your employer.
>>
>>59451041
You seem to be confused. This hasn't got anything to do with India. It's a basic programming practice that everyone should be following.
DRY is the reason why we even have functions. So don't be retarded.
>>
>>59459555
>DRY is the reason why we even have functions
Are you fucking retarded?
>>
>>59459873
No but apparently you are.
>>
>>59460135
How can a non-retard claim that functions solely exist because of something a human thought up?
>>
>>59460238
The concept of "Don't repeat yourself" is the reason why we have functions and macros.
>>
>>59456841
Are you so retarded you can't write one from scratch?
>>
>>59460410
So you're claiming that DRY is about 300 years old (if not more)?
>>
>>59460536
The idea and concept of it yes.
>>
>>59460546
Is it as old as the laws of this universe? Because that's about as old you would have to be to claim that a concept can somehow influence how this universe operates.
>>
>>59460570
Are you fucking retarded? How did I imply that?
It's a human concept, so it can't be that old.
Seriously, did your parents drop you on your head hard when you were a baby?

My original fucking point was that DRY has got nothing to do with being a pajeet, It's basic fucking common sense.
If you are repeating yourself, then you're a shit programmer and probably also a pajeet.

How the fuck did you turn it into whatever fucking garbage your spewing? Are you brain damaged?
>>
>>59460644
>Are you fucking retarded? How did I imply that?
You outright stated that DRY is the reason functions exist. Which is basically impossible without some sort of divine intervention.
>It's a human concept, so it can't be that old.
Correct, which means it has no bearing on the laws of this universe.
>Seriously, did your parents drop you on your head hard when you were a baby?
Not that I'm aware of.

>My original fucking point was that DRY has got nothing to do with being a pajeet, It's basic fucking common sense.
Okay. Where did I dispute that?
>If you are repeating yourself, then you're a shit programmer and probably also a pajeet.
I agree. But how is this relevant to the conversation?

>How the fuck did you turn it into whatever fucking garbage your spewing? Are you brain damaged?
How is what I'm "spewing" garbage? It's common sense. Humans do not influence the way our universe works.
Your claim is about as retarded as claiming that x property of light only exists because of some "good practice" about how to behave in a physics lab.
>>
>>59460722
Do you for some reason believe that functions are a law of the universe? because they aren't.
Functions are a human concept. I don't know why anyone would believe the former unless they were brain damaged.
>>
>>59460754
They are simply a relation between two things. How is that a human concept?
If all humans were to suddenly disappear everything we know about functions would still remain true.
>>
>>59460777
Functions are only a way for humans to describe things in the universe.
Functions are a human concept. The universe has no concept of "function". Only humans do.

If humans disappear, then functions also disappear unless some other species also had a concept of function.
That doesn't mean laws in the universe suddenly disappear, because functions were only a humanly concept used to describe some of those laws in a way that humans easily understand.
I'm sure other species in the universe also have similar concepts to describe those same laws.
>>
>>59460844
>Functions are only a way for humans to describe things in the universe.
Correct.
>Functions are a human concept.
Only our conventions about the things they describe.
>The universe has no concept of "function".
It's just a human name for something which exists in the universe. Why do you think this even needs to be mentioned?

>If humans disappear, then functions also disappear
Nope. Unless you are claiming that binary relations between objects disappear (which would be retarded) you can't possibly claim this.
>unless some other species also had a concept of function.
That would be irrelevant in the same way as humans are irrelevant to the existence or nonexistence of functions.

>because functions were only a humanly concept used to describe some of those laws in a way that humans easily understand.
Yes. I am talking about the underlying laws. For your earlier claim to be true humans need to have full control over some laws of the universe.

>I'm sure other species in the universe also have similar concepts to describe those same laws.
Correct, but this doesn't somehow mean that they influence the existence of the laws themselves.
>>
>>59460938
Why are you talking about influence the laws of the universe?
The existence of functions has no influence on the laws of the universe.
Functions are NOT a law of the universe. Functions are 100% human. Therefore functions disappear if humans disappear.
Functions disappearing does not somehow cause the laws of the universe to disappear, and I never ever claimed that they do.

Functions != the fundamental relationship of things in the universe.
Functions are only a WAY for humans to describe fundamental relationships of things in the universe.

Humans disappearing means functions (a way for humans to describe relationships between things) also disappear.

How retarded are you that you don't get this simple fucking concept?
>>
>>59461031
It seems like you're not able to read basic sentences. I said I'm talking about the underlying things they describe. Me using a human name for them doesn't somehow mean I'm talking about the set of conventions we use to describe them.
The things they describe are fundamental to the universe, which means they can't disappear simply because one species which uses a model to describe them disappears.
>>
>>59461085
>The things they describe are fundamental to the universe, which means they can't disappear simply because one species which uses a model to describe them disappears.
That's what I'm trying to fucking say.

I give up. You're too retarded to reason with.
>>
>>59461109
Why are you trying to say such obvious things? They are clear to anyone and nobody without some serious mental illness is going to dispute them.

Even if we assume I somehow disagree, your initial claim (DRY is the reason functions exist) is fucking retarded and I think you understand it yourself.
That claim is only true if you can do the following:
1) Read the minds of long-dead humans.
2) Modify your sentence to say "the human model of describing functions" instead of "functions".
>>
>>59452208
You can just call into the Java code from any native program.
Thread posts: 334
Thread images: 33


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