[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: 332
Thread images: 31

File: 1485438720022.png (423KB, 720x720px) Image search: [Google]
1485438720022.png
423KB, 720x720px
Old thread: >>59374952

What are you working on /g/?
>>
What is the most useless programming language?
>>
>>59377810
anything in English (islamic)
>>
File: 1451200993813.jpg (52KB, 438x438px) Image search: [Google]
1451200993813.jpg
52KB, 438x438px
>>59377805
Why is it so hard to get a job in Software dev? I've been more of a hard worker and smarter and more socially capable compared to my colleagues, yet they are the ones who gets a job at some oil and gas industry.
>>
>>59377820
>syntax errors are always going to exist, there's probably going to be errors with null objects in OOP languages, you're going to have to link libraries, etc.
You don't learn that in theory classes moron. You experience and learn from that in project based classes.

> The vast majority of modules should include decent-sized projects
Wow. Anon you should really start your own university since every university disagrees with your shit opinion. There is no point in practical uses if you aren't sure that practical use is going to be relevant after your degree. Theory based knowledge last for a lifetime while practical based knowledge for a specific language doesn't.

>In software they're usually just a way to pay some scrub pennies to do grunt work
And how is that any different from decent sized project moron
>>
>>59377810
Something like brainfuck
>>
>>59377810
[clever joke about a programming language that will illicit a hostile response]
>>
>>59377805
Still working on this bubble sort meme.

    void bubbleSort(int arr[][8], int size)
{
bool sorted = false;

for (int i = 0; (i < size) && !sorted; i++)
for (int j = 0; j < (size - i - 1); j++)
if (arr[j][7] > arr[j + 1][7])
swap(arr[j][7], arr[j + 1][7]);
else
sorted = true;
}


I'm trying to sort rows of a two-dimensional int array by descending value order of a single column, arr[][7]

I feel like a big dumb cuck, here.
>>
>>59377924
>forgot my image
>>
give me a quick rundown on emacs

is it actually the patrician standard of usability
>>
>>59377924
>"meme"
>>>/r/ibbit
>>
>>59377942
>is it actually the patrician standard of usability
No, but it is a pretty powerful shell. The text editor is shit, though.
>>
>>59377956
are we banning words now
are we INGSOC now
should I put a trigger warning before I accidentally misgender you, you fucking liberoid freak, I bet you use RUST, you fucking Pajeet, you fucking Rajesh, you fucking Salman Khan, India-nigger.

"hallo yes this is microsoft vindows calling to tell you that your computer has a WIRUS, plees gib money"

fuck off
>>
>>59378019
nice meme
>>
>>59377981

so i should just stick to a vim if i need a decently functional ide?

vim atleast sort of makes sense but there are textbooks dedicated to figuring out emacs
>>
>>59377805
Now that's a quality thread
>>
>>59378019
Fuck off, Rajesh. You sperged out for literal months wrapping your poo-in-loo "buu huuu animoooooooooo" statements in code blocks for every thread.
>>
>>59378057
I'd stick to VIM. All emacs has going for it is that it uses lisp for it's configuration. This enables far more powerful plugins that are easier to implement, because it uses an arguably real language compared to vimscript, which is a nightmare, but actually editing text blows dick, especially compared to VIM. There's just no comparison to VIM's modal editing. Emacs can emulate vi's bindings, but the power of vi extends far beyond it's bindings.
>>
I spent five hours setting up a build system with CMake, and by the end I was kind of enjoying it. Was success just fucking with me, or am I actually sick?
>>
>>59378064
Kill yourself you idiot Islamic cuck nigger Indian Jewish shill puppet kike nigger cuck Rajesh Muhammad Mehmet Turk roach Kurd Armenian Jew nigger cuck kike shill CIA NSA MI6 black Mexican nigger Jewish Islamic cuckold communist nazi SJW libcuck Trump nigger Jewish American cuckservative Africa nigger racist Jewish cuck pedophile Alex Jones Glenn Beck Shlomo Shekelstein Sam Hyde nigger Jewish Islamic cuck kike shill puppet disinfo slider controlled opposition India nigger CIA nigger MIT nigger GNU Windows Linux Mac Phone Android libertard fascist nigger nazi Jewish capitalist communist rude person
>>
>>59378113
>hating everyone equally
>>
>>59378113
Rhodesia? Yeah, me too.
>>
>>59378150
everyone is subhuman but me

i alone am GOD on this earth

cucks, fear me
>>
File: 1485140634079.jpg (44KB, 590x582px) Image search: [Google]
1485140634079.jpg
44KB, 590x582px
>manage to get interview for full stack engineer this week
>realize I don't know how the full stack works, less engineer one.
What do I do guys? All I know is a few languages and jdbc/spring.
>>
>>59378091
The best and the only choice, vi is a part of POSIX, there's a very high probability that it will be installed out of the box in any UNIX-like system.
>>
>>59378113
>rude person
That's pretty vicious.
>>
>>59378175
vi != Vim.
I really like using Vim, and I fucking hate using vi, at least with the defaults.
I've never cared enough to configure it.
>>
File: 1423121490155.png (258KB, 549x560px) Image search: [Google]
1423121490155.png
258KB, 549x560px
Should black people be allowed to use the internet?
>>
>>59378174
you put code on the stack
>>
>>59378098
I also spent a shitload of time to configure CMake for an Android native project, now it automatically downloads from git dependency libraries and compiles them as static libs for the project.
>>
File: fragezeichen yui.png (94KB, 396x395px) Image search: [Google]
fragezeichen yui.png
94KB, 396x395px
Why do we have config files for programs? Shouldn't they be considered harmful?

Why not a referentially transparent approach where everything is available as a command-line parameter, and users can save "settings" through shell aliases?

Then we wouldn't have to juggle any hidden files. Everything would be in your .shell_config
>>
File: 1457481098642.jpg (93KB, 620x670px) Image search: [Google]
1457481098642.jpg
93KB, 620x670px
>>59378202
Should white people be allowed to use the internet?
>>
>>59378216
Because that would be an unmaintainable mess.
>>
File: purge.jpg (53KB, 460x276px) Image search: [Google]
purge.jpg
53KB, 460x276px
>>59378165
>>
>>59378202
>>59378221
I don't think anybody should be allowed to use the internet, or at least the world wide web.
It has become such a shithole.
>>
>>59378225
>everything in one file
>unmaintainable mess

>automatically writing to disparate files in /home, sometimes in sub-directories, sometimes not
>maintainable
>>
>>59378238
global internet was a mistake

we need to go to every country has their own internet, completely sealed and segregated from the rest of the world
>>
File: 1478758463061.png (15KB, 300x300px) Image search: [Google]
1478758463061.png
15KB, 300x300px
>>59378221
Yes.
>>
>>59378245
Every city or state even. I don't want to associate with anyone from C*lifornia.
>>
>>59378195
vi ⊆ vim
They use the same ideology and the same keys. In any system: OpenWrt, Android, FreeBSD, the majority of Linux distros and so on, you'll be able to edit files without an inconvenience, because you use vim everyday instead of shitmacs.
>>
File: 1461452800219.jpg (172KB, 624x750px) Image search: [Google]
1461452800219.jpg
172KB, 624x750px
Should squids be allowed to use the internet?
>>
>>59378174
sleep tight porker

>>59378202
Should black people be allowed?
>>
>>59378216
Honestly, that's fucking stupid desu. "Let's take all of the cleanly seperated easily findable files and just fucking stick them into a single gigantic abomination of a shell config!"
Not to mention how you would maintain something like that. And what if a program had something special about its config? Would two systems have to exist side-by-side?
>>
>>59378307
You'd better ban pajeets, they're disgusting.
>>
>>59378311
You sound like a brainlet desu

/program-name
in vim. bam instant access to "settings"

Much better than having to worry about the program's state being modified in some other file, + introducing the mess of config file defaults and hierarchies

Want setting X? Call
program --x
. It makes perfect sense.

Anyway it doesn't matter what you think. I already write all my own software to be configless in this manner. Once other people realize how good it is, I think it will eventually catch on
>>
>>59378387
Now what if a program that isn't your shell wants to call another program?
How would sensitive information like passwords be handled?
>>
>>59378408
Neither of those are actual arguments
>>
>>59378425
Why the hell not?
Programs calling other programs is an extremely common thing to do.
So that means that the programs now need to have access to your "shell aliases"/"global config" file, and within that file, it then has access to everything about every other program, including passwords.
Now how about setuid programs? Does it even get to have access to files that only root is supposed to have access to?
>>
>>59378387
IDK desu, it kinda sounds like you're gonna die in obscurity. Doubt the entire software industry is just suddenly gonna switch the settings paradigm so mentally handicapped people like yourself don't have to actually look in your home directory for more than a few seconds.
>>
>>59377670
Chinese people program in English.
t. Chinese here for your shitty American college.
>>
>>59378497
more like t. Mehmet Muhammadun, deep cover agent for MI6 paid to shill and troll and lie on /g/
>>
>>59377942
Yes/No.
Kinda.

It has a high learning curve.
It is immensely useful once you have gotten over it.

Vim is easier to start with but doesn't have as much stuff it can do for you. On the other hand, it isn't meant to. It shells out to other program. Emacs integrates them.

Which you prefer is a matter of your personality.

Notepad++ and its ilk are all in the utter plebeian tier.
>>
I like Lisp as a language, but I fear it's a meme language that cannot have anything productive done in it. Please prove me wrong.
>>
>>59378175
And? Emacs can edit files over SSH. (It integrates your standard openssh client and talks to the other computer using that.) So it doesn't need to be installed on other systems.

Why bloat your servers with unnecessary stuff?
(also, ed is the STANDARD editor.)
>>
>>59378603
> /g/ please be productive

We only do the highest quality fizzbuzz implementations on /g/.

"Useful" is for faggots.
>>
>>59378603
It's not a "meme" language since no language can possibly be a "meme". Lisp is fucking garbage though. That's not to say that you can't "have something productive done in it".
>>
File: 1489372123217.jpg (210KB, 454x603px) Image search: [Google]
1489372123217.jpg
210KB, 454x603px
Why do SJWs hate C when it has no objectifying?
>>
>>59378652
I don't mean to say it's impossible - it just seems impractical. When I asked someone about GUI libraries, I shit you not, they recommended I write a fucking web server to be hosted locally and just do the UI in HTML and CSS. Sure, you can use macros to convert S-Expressions into HTML easily, but Lisp doesn't even have something like Electron to make it one seamless application making it APPEAR to not be a dodgy hack.
>>
>>59378685

Racket comes with a GUI toolkit.
>>
lmao
Did a subhuman just reply to me?
>>
>>59377810
A programming language with no I/O.
>>
>>59378829
It's pretty useful actually.
>>
>>59378845
No. Kill yourself, you literal autist.
>>
>>59378845
It has about 0.000000000000000000000000000...1% the usefulness of Haskell, which in turn has 0.000000000000000000000000000...1% the usefulness of a proper programming language.
And even the former statement is probably way overestimated. I'd say that a programming language with no I/O actually has 0 uses, because whatever you do in that language is equivalent to doing nothing in terms of effects, which is the only thing that matters, effects.

>inb4 it's useful because I can compute stuff!
Computing stuff is only useful if you output the result.
If you compute something and do nothing with the result, then it was a useless computation and a waste of resources.
>>
>>59378680
But C do have objects, in the form of compilation units (source including all headers and with all macros expanded). What it doesn't have are classes.
>>
>>59378854
"Do to others as you would have them do to you."
Luke 6:31

>>59378902
>It has about 0.000000000000000000000000000...1% the usefulness of Haskell, which in turn has 0.000000000000000000000000000...1% the usefulness of a proper programming language.
Yes, according to your subjective judgement. But I'm not your friend or your family, I couldn't care less.
>I'd say that a programming language with no I/O actually has 0 uses
This is blatantly false and even you know it as you have demonstrated in your first sentence.
>which is the only thing that matters, effects.
You can have all the effects you want. It can literally be assembly-level if you wish.
>Computing stuff is only useful if you output the result.
So computing "1 + 1" written on a piece of paper is only useful if you write "2" on the same paper? What sort of retardation is this?
>If you compute something and do nothing with the result
The result is passed to something else which accepts the resulting type.
>>
>>59378935
Translation units (the correct term) are not objects.
I don't know what the hell you're thinking.
>>
>>59378902
All programming languages that are Turing complete has the ability to use system functions and output something. Whether or not it requires you to break the stack
>>
Basic Question, but what's the easiest way to put 2 numbers between brackets (I.E. [3,2] ) Into their own variables in C++?
I can't figure out for the life of me how to do it.
>>
>>59378975
The ability? Definitely. But I/O isn't a requirement for Turing completeness. If you think it is, then your education has failed you.
>>
>>59378977
in haskell this is just

[x,y] <- readLn
>>
>>59378977
string delimited array of pointers
>>
>>59379006
Don't you have to use the brackets monad for that though?
>>
>>59378964
>So computing "1 + 1" written on a piece of paper is only useful if you write "2" on the same paper? What sort of retardation is this?
If the whole point of your program was to compute 1 + 1 then yes, not outputting the result would be a waste of computation. Why did you compute it?

>The result is passed to something else which accepts the resulting type.
Yes, and then at the end of your big chain of computations, you output a result in some form.
A language with no I/O will perform all those computations and never output any kind of result at the end of it.
That is by definition a useless computation that is the equivalent of doing nothing.

>>59378975
That's not an I/Oless language then.
>>
>>59378964
Why the fuck did you quote the bible? Do you expect me to "respect your feelings" or something on 4chan, of all places?
>I couldn't care less
Why are you replying then?
>You can have all the effects you want.
What good is an effect if you can't observe them? You can imagine your happy little programming world all you want, but it's completely useless if you can't see inside.
>So computing "1 + 1" written on a piece of paper is only useful if you write "2" on the same paper?
At some point, it's going to have to be evaluated and output somewhere.
Do you even intend for a computer to actually execute your stupid language?
>The result is passed to something else which accepts the resulting type.
Does that have I/O?
If it doesn't, it's equally as useless.

>>59378990
>But I/O isn't a requirement for Turing completeness
Being able to see what's on the tape afterwards is the only thing which makes a turing machine even remotely useful.
>>
>>59378977
Scanf.

Something like
scanf("[%d,%d]",x,y)


>>59378990
>>59379031
You stupid fucking wetback nigger. By system functions I meant the underlying functions that programs use to read/write text. So all Turing complete languages can just scroll over to those functions and run. Therefore they all have input/output
>>
>>59379026
no, you just need a few GB of RAM
>>
>>59377924
First, you got the algorithm wrong. As you wrote it, it stops whenever two consecutive elements are in order. You have to consider the column as sorted at the beginning of each turn and consider it unsorted as soon as two elements are swapped.

Second, your swap function only swap the elements of the column, not the entire rows themselves (if that's what you want).
>>
>>59378964
>Retarded no I/Ofag is also a retarded biblefag
Not at all surprising
>>
File: 1484497285541.png (204KB, 744x843px) Image search: [Google]
1484497285541.png
204KB, 744x843px
>>59379067
What's wrong with the Bible?
Are you a Muslim or a Jew?
>>
>>59379067
*tips*
>>
File: anime_complain.gif (499KB, 500x514px) Image search: [Google]
anime_complain.gif
499KB, 500x514px
Daily reminder to report and ignore Rust shill spam. Do NOT respond to their bait posts.
>>
File: laughingwhores.jpg (134KB, 446x400px) Image search: [Google]
laughingwhores.jpg
134KB, 446x400px
>>59379074
>>59379076
>Actually being religious
Go home, you stupid Americans.
>>
>>59379074
I'm neither of the disgusting desert religions.

>>59379074
>>59379076
Go back to deluding yourself with your bible and believing in your omnipotent and omnipresent sky daddy, David.
>>
>>59379031
>If the whole point of your program was to compute 1 + 1 then yes
No, it succeeded in its task. Outputting the result was never part of the plan.
>not outputting the result would be a waste of computation
Only if I originally intended to output the result, which I didn't.
>Why did you compute it?
To compute the value and use it later.

>Yes, and then at the end of your big chain of computations, you output a result in some form.
So? You can have a "halt" function which accepts the last thing passed in a sequence and terminates the program.
>A language with no I/O will perform all those computations and never output any kind of result at the end of it.
Correct. Your point being?
>That is by definition a useless computation that is the equivalent of doing nothing.
No. A useless thing is by definition something which has no use. Being passed as an argument to a function is a use, therefore it isn't a useless computation.

>>59379035
>Why the fuck did you quote the bible?
It was a very appropriate quote in this context.
>Why are you replying then?
I didn't say I didn't care about you spouting blatant lies.
>What good is an effect if you can't observe them?
You technically can observe them in some sense. The OS does I/O so you can see the resource usage go up.
>At some point, it's going to have to be evaluated and output somewhere.
Evaluated? Yes. Output? Nope.
>Do you even intend for a computer to actually execute your stupid language?
Yes, I'll be using LLVM to generate machine code. Although I've heard it reduces non-IO programs to single ret instruction so I will have to deal with that somehow.
>Does that have I/O?
Nope. I/O is simply isn't a thing in my language.
>Being able to see what's on the tape afterwards is the only thing which makes a turing machine even remotely useful.
You have shown yourself to be retarded beyond any reasonable doubt. If you think being able to look ahead is somehow "I/O" then I can only feel sorry for you.
>>
>>59379067
Who said I'm a "biblefag"? Can you not accept information for what is regardless of the source? That would make you even more delusional than a "biblefag".

>>59379035
That post got too long.
>If it doesn't, it's equally as useless.
No language is objectively useless. For you that might be the case, but please specify this kind of bullshit with "useless for me".
>>
>>59379063
I changed it to this.
void bubbleSort(int arr[][8], int size)
{
bool sorted = false;
for (int i = 0; (i < size) && !sorted; i++)
for (int j = 0; j < (size - i - 1); j++)
if (arr[j][7] > arr[j + 1][7])
for (int k = 0; k < 8; k++)
{
swap(arr[j][k], arr[j + 1][k]);
sorted = false;
}
else
sorted = true;
}

Now it will actually sort, but in ascending order instead of descending order.
Tried changing
if (arr[j][7] > arr[j + 1][7])

to
if (arr[j][7] < arr[j + 1][7])

But that just broke it.
>>
File: 1489392000875.jpg (226KB, 869x1776px) Image search: [Google]
1489392000875.jpg
226KB, 869x1776px
>>59378680
>>
>>59379115
>No, it succeeded in its task
And it's task was pointless, useless, and a waste of resources.

>which I didn't.
And therefore, the computation was useless.

>To compute the value and use it later.
Uh no. You discard the value.

>So? You can have a "halt" function which accepts the last thing passed in a sequence and terminates the program.
Why does it accept a parameter if it doesn't do anything with the parameter?

>Correct. Your point being?
The whole program is useless and does nothing.

>A useless thing is by definition something which has no use
Such as an I/Oless programming language.

>Being passed as an argument to a function is a use
Only if it gets used*

>therefore it isn't a useless computation.
It is if the function does nothing with the parameter.

>>59379135
>Can you not accept information for what is regardless of the source?
"Do to others as you would have them do to you." is nonsensical delusional bullshit. Typical of the bible.
>>
>>59378685
>GUI
>productive
Am I being memed on?
>>
>>59379159
Re-read my message.
>>59379063
>You have to consider the column as sorted at the beginning of each turn and consider it unsorted as soon as two elements are swapped.

The fact that you set sorted to true when two consecutive elements are in order means that if the two last elements are in order, you consider your array sorted, even if the previous elements may still be not sorted.
>>
>>59379097
>>59379105
haha yeah epic
it's just like rabbi toby fox says:
get rid of all religion
become genderqueer enlightened dragonkin atheists
drink lots of mountain dew black and soylent green
only eat kale
have unprotected gay anal sex with african men
write gay furry moloch fanfiction for your epic irc buddies
kill your sister
donate lots of money to the israeli army. they need more money for the bissiles
go to liberal brainwashing camp and take all of professor shekelstein's classes on why white privilege is bad and white people need to be genocided
learn to code in rust and nodejs
spend 1300 dollars on a cheater machine ("""art tablet""") and use it to draw pictures of moloch having gay anal sex with your gay self-insert
kill everyone over the age of 30
drink lots of kraken and fireball
eat lots of black licorice
only drink water (+fluoride GMO)
take these pills that fuck with your dick and turn you into a sterile mutant
make sure to attend lots of anti-trump rallies and, anyone who says they support trump, beat them to death with a shovel
kill all women with red hair
donate lots of money to the cult of moloch and make regular sacrifices to moloch in your backyard
play lots of jew-approved videogames, like undermeme, and overmeme, and division, and destiny
vote for hillary clinton 2020
even if you're not a u.s. citizen, just go to america illegally and vote for hillary clinton 2020

rabbi toby fox would never lie to us, right?
>>
>>59379115
>It was a very appropriate quote in this context.
How?
>You technically can observe them in some sense. The OS does I/O so you can see the resource usage go up.
That's fucking stupid. Why don't you just implement all of your programs as spinlocks then, if that's all you fucking care about?
>I'll be using LLVM to generate machine code. Although I've heard it reduces non-IO programs to single ret instruction so I will have to deal with that somehow.
Don't come crying here when the LLVM optimiser does it's fucking job properly.
>If you think being able to look ahead is somehow "I/O" then I can only feel sorry for you.
Who the fuck mentioned lookahead?
There are many ways to define a Turing Machine, but the way I learned it, a Turing Machines input is what's on the tape in the beginning, and the output is what's on the tape when the machine has terminated the head is parked.
Your Turing Machine would start with a blank tape, and finish with a blank tape, which is completely useless. You would see if it halts or not, but that's undecidable.
>>
>>59379222
Are you mentally unstable or something?
You must be.
>>
>>59379245
dude don't you dare question rabbi toby fox

he is the king of jews
he is here to save us all, and turn earth into one big global multiculti hugbox with lots of islam and gay anal sex

diversity is strength, right?
he would never lie to us, right?
>>
>>59379222
Epin copypasta.

>>>/vg/undertale
>>
>>59379173
>And it's task was pointless, useless, and a waste of resources.
From your point of view. I'm not forcing you to run the program.
>And therefore, the computation was useless.
See the line above. You really should learn to differentiate between the objective meaning of "useful" and your preferences.
>Uh no. You discard the value.
Only at the end. Everything else is technically a bunch of functions calling other functions.
>Why does it accept a parameter if it doesn't do anything with the parameter?
Because it's a function. A function is by definition something which takes arguments.
>The whole program is useless and does nothing.
See the second sentence.
>Such as an I/Oless programming language.
So in your warped mind something can have a use and still be useless? You easily make it into the top 5 most retarded people I've talked to here, and that's quite an achievement.
>Only if it gets used*
Using something is a use. This is obviously true.
Therefore using something as an argument to a function is also a use. Meaning that it isn't useless.
>It is if the function does nothing with the parameter.
There are times when even in I/O-ridden shitlangs using functions which ignore some parameters is useful.
>"Do to others as you would have them do to you." is nonsensical delusional bullshit.
It was quite appropriate in that context. But considering your level of mental delusion it is obvious why you wouldn't see that.

>>59379239
>How?
It got the typical response I was looking for. I collect certain types of responses in a file.
>That's fucking stupid.
I'm glad you think so.
>Why don't you just implement all of your programs as spinlocks then
Why would I?
>if that's all you fucking care about?
It's not.
>Don't come crying here when the LLVM optimiser does it's fucking job properly.
I will have to disable it then. Or find a way to disable the particular optimizations which result in that retarded behavior.
cont.
>>
>>59379259
haha yeah dude that's my favorite thread i spend so much time there with my epic irc friends talking about how great judaism and gay anal sex is
>>
>>59379097
>>59379105
I hope you find Jesus
>>
>>59379219
Well, I did get it to sort successfully in ascending order. So I'm thinking I'll just have every other function read it in reverse order. Bit of a India-tier hack, but I was having enough trouble getting the array to sort at all. Thanks for helping, lad.
>>
>>59379275
Jesus is not real.
Santa does not exist.
>>
>>59379239
Your education has horribly failed you. I can only hope you didn't use tax money to fuel your stupidity.
Here is a definition of the lambda calculus. It is Turing complete. Now please tell me, where exactly do you see I/O here?
<expression> ::= <variable>
| ( <expression> <expression> )
| ( λ <variable> . <expression> )
>>
>>59379275
There aren't very many Mexicans in the country I live in, so finding Jesus here would be pretty unlikely.
>>
File: 1484658332351.jpg (10KB, 221x228px) Image search: [Google]
1484658332351.jpg
10KB, 221x228px
>>59379298
Jesus still loves you
>>
>>59379307
Tell him to suck my cock dry.
>>
>>59379300
>Here is a definition of the lambda calculus
We're not talking about lambda calculus, we're talking about Turing machines, you fucking idiot.
>>
>>59379300
Let's stop being pedantic anon, I'm not >>59379239, but I think the point he was making is, if your program has no external effects it is for all practical purposes useless.

If your code runs but doesn't create any output, move a device, or do anything, it might as well not have run.
>>
if a program runs in the forest but nobody is around to read the output
>>
>>59379339
is it pure?
>>
>>59379319
You show your stupidity yet again. It is Turing complete, meaning that it can simulate ANY Turing machine.

>>59379321
>Let's stop being pedantic anon
I'm honestly not. I could though, but why would I do that?
>but I think the point he was making is, if your program has no external effects
Why didn't he say so then?
>it is for all practical purposes useless.
But this would be false. Unless he adds a "for me" here this sentence is blatantly false provided you believe "something which has a use is useful" to be a true statement, which any non-mentally ill person should.

>If your code runs but doesn't create any output, move a device, or do anything, it might as well not have run.
Using the CPU and not using the CPU are two opposite states so this is obviously false.
>>
>>59379268
>You easily make it into the top 5 most retarded people I've talked to here, and that's quite an achievement.
You've made it into the top 1 most retarded person I've talked to. THAT is an achievement.
>>
>>59379307
Jesus is dead.
>>
File: 45648.jpg (26KB, 488x545px) Image search: [Google]
45648.jpg
26KB, 488x545px
>>59377805
Have you ever written up so many of codes with so many lines that you crash emacs by trying to close it?
>>
>>59379339
>>59379344
Welcome to Haskell!
>>
how much output would a program output if a program could output output
>>
We need to ban Germanics (including Swedes, Danes, Dutch, etc) from these threads.

They are always autistic and confrontational.
I guarantee you all these edgy atheist posts are coming from a Germanic.

Here in Italy saying you're an atheist is pretty much admitting you're a flaming faggot.
>>
>>59379384
Any amount you want, even the program itself. Look up for quines.
>>
>>59379353
>It is Turing complete, meaning that it can simulate ANY Turing machine.
I never said otherwise. I'm fully aware that lambda calculus is an equivalent type of computation.
By having no "I/O", that means that your lambda calculus expression has no "arguments" and evaluates to nothing. Again: completely useless. I don't even think you can write such an expression.
>>
File: 1464763565326.png (56KB, 782x790px) Image search: [Google]
1464763565326.png
56KB, 782x790px
>>59379395
d-does germanic include anglo
>>
>>59379395
Agreed. I think we should not only ban them, but exterminate them.
Unfortunately the Italians would have to go as well since they are a disgrace to the Romans.
>>
>>59379395
does that include t. eternal anglo (and therefore also degenerate americans, aussies, and kiwis)

i sure hope it does
>>
>>59379395
Jesus told me to call you an illiterate fuckwit and fuck off to church immedietely
>>
>>59379353
>Using the CPU and not using the CPU are two opposite states so this is obviously false.
Using the CPU and not using the CPU for the sake of using/not using the CPU and nothing else has no use.
Hence why decent compilers transform those kinds of programs into equivalent programs that use no CPU since it's the same program but lighter on resources.

If your compiler optimized something out, it means that code was useless and redundant.
This is proven by the fact that the program, when run, still achieves the same thing. Just like how an I/Oless program when optimized still achieves the same thing with lighter resource use: nothing.
>>
>>59379416
>americans
>anglo
americans are mixed mudbloods and not even human
>>
>>59379409
>>59379416
No. Anglos are Franco-Celtic
>>
>>59379395
>I guarantee you all these edgy atheist posts are coming from a Germanic.
I'm Australian.
>>
>>59379425
so do they count or not

do we ban them or not

answer me you summat innit eh bloody limey pikey cunt tosser
>>
>>59379395
>I guarantee you all these edgy atheist posts are coming from a Germanic.
I'm from New Zealand. I know lots of atheists.
I would probably find it harder to find someone who takes religion seriously.
>>
>>59379405
(λx.x) 5 has no arguments and evaluates to nothing? You do realize that this is a fucking moronic claim to make, right?
It's represented as a string in my program so it's a constant which is passed to the evaluator. It isn't any less "real" than passing it in through I/O.

>>59379409
>>59379416
No, I am King by divine right and I recognize the legitimate claim of all Anglos to have a place in this thread.
>>
>>59379433
australian <- anglo-brit <- anglo-saxon <- germanic

get out
>>
>>59379420
>>59379353
just use Haskell without Prelude
>>
>>59379448
Only rednecks take religion seriously
>>
>>59379455
but don't you have to include the Haskell Monad for that
>>
australian >>>> kiwi >>>>> american >>>>>>>>>>>> brit >>>> shit >>> everything else
>>
>>59379456
haha yeah dude multiculturalism and gay anal sex is so cool
we should totally livestream co-op undertale let's plays on youtube for lots of jewish ad revenue
>>
>>59379448
Funny because all the Kiwis I know are Christian.
You're probably just a poofter with poofter friends.
>>
>>59379449
Are you seriously going to claim that '5' is not an input to that expression?
God damn, autists really can't be reasoned with.
>>
>>59379353
>Using the CPU and not using the CPU are two opposite states so this is obviously false.
Not so obvious it seems. In the giant scheme of the universe, your statement stands true. But in the context of your program state, not so much. If it is independent of timing, the program don't care about whether CPU is used or not, the CPU can be abstracted from computation.

Also, talking about lack of I/O, I'll state something even more inane: if a sign has no use, it has no meaning. But that doesn't mean you can't give meaning to a sign a posteriori, yet it may be a clue about the redundancy of your sign.
>>
>>59379461
you don't want IO, you can define your own monad
use RebindableSyntax if you want do notation
>>
>>59379480
Why do you keep equating non-religious to multicultural and gay anal sex?
>>
>>59379491
yeah but don't i also have to include the notation monad
>>
>>59379465
This cunt here gets it.
>>
>>59379420
Using the CPU - 1
Not using the CPU - 0
Is 1 equal to 0?
The CPU couldn't care less about the perceived """usefulness""" of something. Nor do I, to be quite honest.
>Hence why decent compilers
No, garbage compilers. My compiler won't treat a non-IO program differently. It's just a program too.
>If your compiler optimized something out, it means that code was useless and redundant.
According to the garbage compiler which isn't even for my language.
>Just like how an I/Oless program when optimized still achieves the same thing with lighter resource use: nothing.
Computing something - 1
Not computing something - 0
Is 1 equal to 0?

>>59379455
Haskell is I/O ridden garbage. I'm currently using it and I despise it for having potential but failing miserably due to it's inclusion of so much I/O.
>>
import std.range, std.stdio;

void main()
{
ulong lines = 0, sumLength = 0;
foreach (line; stdin.byLine())
{
++lines;
sumLength += line.length;
}
writeln("Average line length: ",
lines ? cast(double) sumLength / lines : 0.0);
}

>>59379480
Do you suffer from autism?
>>
>>59379495
Because in the absence of faith, that's generally what takes over.

I'd rather have Islam than American-style faggot culture desu.
>>
>>59379509
>Haskell is I/O ridden garbage. I'm currently using it and I despise it for having potential but failing miserably due to it's inclusion of so much I/O.
just don't use IO
use the REPL
>>
>>59379465
>My confirmation-bias is better than your confirmation-bias!
Sure thing, cunt.
Even my Mum is atheist.
>>
>>59379513
>Faith in fairy tale
Some people have grown up and realized santa is not real
>>
>>59379513
What takes over is subjective.
For me I just focus on my programming hobbies and studies instead of wasting my time going to church and believing in silly sky daddies.
>>
>>59379483
It is the formal parameter of the expression λx.x

>>59379488
Your post is too hard for me to understand, sorry.

>>59379519
The REPL is entirely based on I/O. I would use an EL if there was such a thing though.
>>
>>59379495
religion is bigoted and intolerant
we need to remove all religion from the world (except judaism, islam, and cult of moloch, obv.)
we also need to convert all programs to rust and nodejs

>>59379522
hey dude you wanna meet up and have lots of unprotected gay anal sex and share aids
i'll even bring my hiv-positive imported somalian bull, he's got a big 13-inch cock and lots of aids

>>59379531
hey dude you wanna meet up and play overwatch some time
maybe we can do an epic twitch speedrun for jewish subscription money
>>
>>59379531
haha
u just gotta do your own thing man
ffffffuck society. man is an island
*inhales ganjabis and puts on VR goggles*
ahh, surely THIS is what mankind was destined for
>>
>>59379509
It doesn't matter if you use the CPU or not. That's just a minor detail.
What matters is if the program does something useful, which a non I/O language by definition cannot possibly do anything useful.
Computing something can ONLY be useful if it is output at some point.
>>
haha man just be yourself (unless you're white, obviously, that'd be racist and bigoted)

haha man just take these pills haha
>>
>>59379544
>It is the formal parameter of the expression λx.x
And a parameter is not a form of input?
Are you daft?
>>
>>59379545
Why are you so obsessed about anal sex? Is it because Jesus tells you to fuck virgins in the ass?
>>
>>59379563
>1+1 is I/O
>>
>>59379547
Sounds better than believing in sky daddies to be quite honest.
>>
>>59379575
1 and 1 are the inputs to +, and 2 is the output.
>>
>>59379555
You are a retard.
If you answer "yes" to the following, you have conceded that an I/O-less program can be useful.
"Something which has a use is useful".
I could list of an infinite amount of uses for any given program.

>>59379563
It's an element in the set of the domain of the function.
>>
>>59379545
Fucking admit yourself to a mental hospital please.
>>
>>59379585
>It's an element in the set of the domain of the function.
Your point being?
>>
>>59379580
haha yeah dude
kill your sister and learn to code in rustjs

it's the only way not to be racist
>>
>>59379589
My point being the answer to your question.
>>
>>59379585
>"Something which has a use is useful".
Yes.
Lets consider an I/Oless programming language. Does it have a use? No. Therefore, following from the logic above, an I/Oless programming language is useless.
>>
>>59379582
Is this manchild mad?
Don't worry, santa is putting you in the good list and he's going to leave tendies in your socks in the next christmas. I'll tell him to leave his epic selfie with his flying deers under your pillow as well. LMAO
>>
>>59379588
i just asked if you wanted some gay anal sex, dude (you do)

are you being bigoted right now?
are you being RACIST right now?
are you being NAZI right now?
are you TRIGGERING ME?
are you MISGENDERING ME?
wow rude
i will immediately now call the thought police on you for this rude rape of my internet persona
>>
>>59379607
true true! wanna smoke some w*ed later, bro?
>>
>>59379585
>I could list of an infinite amount of uses for any given program.
The only use you've listed so far is "being able to compute something", and I've already refuted this saying that a computation is only useful if it's output at some point, which is true.
You haven't even once refuted this point. You just keep repeating the same shit over and over.
>>
>>59379590
The only way to prove your christianity is to have sex with your cousin sister in the ass.
>>
>>59379599
That's not saying anything, fuckface.
Just because something in in the set of the domain of the function, does that not make it an input?
>>
>>59379580
of course it does
culture doesn't exist
our mistakes of lives are just one grand rectal exposition
hey mann, itz all pink on da inside...
>>
>>59379603
>Yes.
Good. You have just admitted that a program without I/O is useful. That's already a step in your recovery.
Me wanting to evaluate something is by definition a use I have for a program, therefore it is useful.

>>59379621
>The only use you've listed so far is "being able to compute something"
Which is already enough to prove that what you're saying is false.
>and I've already refuted this saying that a computation is only useful if it's output at some point
For you. It doesn't somehow negate the possibility of it being useful.

>>59379634
It is. It shows that you can think about functions in a lot of different ways. Someone who has been crippled by I/O will obviously tend to think in terms of it. This doesn't somehow mean that the non-retarded ones have to do the same.
>>
File: 1482388603599.png (130KB, 645x968px) Image search: [Google]
1482388603599.png
130KB, 645x968px
>>59379637
I'm not a burgermuncher though, why did you bring that up?

Bad boy, santa is not happy
>>
File: 1425177009890.png (2MB, 1920x1080px) Image search: [Google]
1425177009890.png
2MB, 1920x1080px
>she will never...
>>
>>59379648
Ok, lets go along with your bonkers proposition that "Programs without I/O are not useless".
In the end, what is the point?
>>
>>59379650
We know.
You're German.
>>
>>59379648
>Good. You have just admitted that a program without I/O is useful
Read my second sentence.

>>59379648
>Me wanting to evaluate something is by definition a use I have for a program
Actually, you don't. How can I tell? Because you're not interested in the result. Therefore you're not interested in computing anything.
Because the sole purpose of computing something is looking at the result. There is just simply no other use for computing something no matter how you look at it.

>For you
Not just for me. It is objectively useless. There's no subjectivity anywhere here.
It is useless for you and for me. It's just that you, you retard, don't yet realize that it's useless for you.
Go ahead, make your I/Oless language. You'll quickly realize how stupid this all was.
>>
Is "programming without IO" a new /g/ meme? I don't like it.
>>
File: 1482388603600.png (146KB, 645x968px) Image search: [Google]
1482388603600.png
146KB, 645x968px
>>59379679
I don't think you understand.
I do not care what's going on with your (((country)))

>>59379685
Wrong
>>
>>59379689
It's just a single anon with an extreme case of autism.
Hopefully he will move on soon.
>>
>>59379689
no, it's one guy
>>
>>59379689
No, he's actually serious about it, I think. (I hope he's just joking).
>>
>>59379693
It's the gate keeper kid. See >>59379695
>>
>>59379696
>>59379694
>>59379693
Nice samefag.
>>
>>59379681
Basic and self-evidently true statements are somehow "bonkers"? Is it I/O that has been corroding your brain or is it something different?

>In the end, what is the point?
Of what?

>>59379687
Why? You have conceded the point.
>Actually, you don't.
I do.
>How can I tell?
You can't.
>Because you're not interested in the result.
Prove it. Show me a formal proof using category theory.
>Therefore you're not interested in computing anything.
False.
>Not just for me. It is objectively useless.
Are you god or something? You can bend the entire world to your will?
>There's no subjectivity anywhere here.
x is useful for me. x is not useful for you. therefore x has the possibility of being subjective.
>It is useless for you and for me.
Nope.
>You'll quickly realize how stupid this all was.
Nope.
If your next post isn't a formal proof I won't even reply to this low level obvious bait.
>>
>>59379702
>Both posts made within the same minute
>Samefag
I don't think so.
>>
>>59379706
>Basic and self-evidently true statements are somehow "bonkers"?
>Is it I/O that has been corroding your brain or is it something different?
>Of what?
I don't think I've ever seen someone try to dodge such a simple question so hard.
If you're going to do something, you should be at least able to justify why.
Either this is some sort of autistic self-defense mechanism, or he is transitioning over to pretending like he was baiting the whole time, after realising how retarded he was.
>>
>>59379712
>what is a proxy
>what is a VPN
>what is phoneposting
>what is jewish post-hacking
>>
>>59379722
Why do you keep replying to him?
>>
>>59379740
I have nothing better to do right now.
>>
>>59379738
Do you think someone would go through that trouble just to post something like that?
I think you're paranoid.
>>
>>59379722
>I don't think I've ever seen someone try to dodge such a simple question so hard.
I can't dodge something I don't understand. Specify your question if you legitimately want an answer.
>If you're going to do something, you should be at least able to justify why.
I just want a language which isn't garbage aka not ridden with I/O. I think the benefits of not having to deal with it greatly outweigh the supposed downsides.
>>
>>59379755
>why would jews go through that trouble just to control the (((narrative)))
>why would jews try so hard to make it seem like they are on the "right side of history"
>why would the jews want to take over the world
hmm, i wonder...
>>
>>59379761
b-but... didn't they kill them??
>>
what the fuck does this guy actually plan on implementing with his IO'less lang ??
>>
>>59379759
>I can't dodge something I don't understand. Specify your question if you legitimately want an answer.
Seriously? You can't glean fucking ANYTHING from context?
You must seriously rank high on the autism scale.
Why on earth would you bother writing a programming language, or even a simple program, which does not have I/O?
What's the point? What do you have to gain? Why haven't you taken your meds?
>>
>>59379761
At last I trully see
Aliens are here
The reptilians are here
Moon landing's fake
>>
>>59379761
Why are you defending no-IOfag? What's in it for you?
>>
>>59379775
They are not different people
>>
>>59379770
Precisely nothing.
>>
>>59379772
>Seriously? You can't glean fucking ANYTHING from context?
I can, just not in this case. Since there isn't any context aside from you being silly.
>You must seriously rank high on the autism scale.
What makes you think so?
>Why on earth would you bother writing a programming language, or even a simple program, which does not have I/O?
Because I get to not deal with I/O in return. Which is great since I have less things to worry about that way.
>What's the point? What do you have to gain?
Me having less problems is a net gain for me. Implementing a language isn't as hard as having to deal with this bullshit.
>Why haven't you taken your meds?
I'm not on any meds. But perhaps you could recommend something? It seems to work out "great" for you.

>>59379770
The compiler itself, eventually. Fizzbuzz will probably be the first thing I do though.
>>
>>59379782
Oh I see. It was pointless arguing with him then.
>>
>>59379774
UFOs are real.
Illuminati is listening
Holocaust is a lie.
>6million jews
Show me the proof

Alex is a clone, reptilians replaced him
>>
>>59379795
>The compiler itself, eventually.
Hahahahaha. How are you going to read the source code and output the compiled program with no IO?
>>
>>59379824
Are you kidding or are you really this fucking stupid?
Do you need to read the string "Hello world" from somewhere else when declaring a string in your shitlang?
The source code itself can be represented as a string, which will be passed to a function which accepts a string and returns a program.
>>
File: 1374574508775.jpg (29KB, 499x500px) Image search: [Google]
1374574508775.jpg
29KB, 499x500px
>>59379836
Are you fucking kidding me? THIS is what we were arguing with the whole time?
I knew we were dealing with stupid, but this is way beyond what I was expecting.
I give up. Kill yourself; you're too stupid to be reasoned with.
>>
File: 1476364434975.jpg (41KB, 681x960px) Image search: [Google]
1476364434975.jpg
41KB, 681x960px
>>59379836
You've got to be joking
Only a retard cannot see why this is beyond retarded.
>>
>>59379856
Yes, no actual arguments. As expected of a brainlet such as yourself.
You are a retard if you think a compiler needs to do I/O, plain and simple.
>>
Input vector from file.txt:

n
a_1
a_2
...
a_n


Print the 3 biggest numbers in any order and exit.
>>
>>59379873
"2 + 2" is a valid expression in language x.
'compile' is a function which maps valid source code of language x to a program.
Why does it matter how the expression was fed into the compiler? Usually compilers read the source from a file, but it's obvious to any non-retard that there is absolutely no reason why the source can't be present at compile time.
>>
>>59379836
>His compiler is a function within the source code
>His "inner" source code is a string declaration within source code
>In order to compile the inner source code, he needs to compile the outer source code
>In order to compile the outer source code, he needs to compile the compiler
>The compiler is in the source code he's trying to compile
>>
>>59379892
How are you going to compile the source code that contains your string and 'compile' function when the compiler is in the source code that you're trying to compile?
>>
>>59379900
Are you retarded? There is no "outer" source code. Everything is present at compile time.
>>
>>59379917
This is equivalent to asking "how will you compile a language without first having compiled a compiler?".
>>
File: nznxywuw3giy.jpg (84KB, 499x746px) Image search: [Google]
nznxywuw3giy.jpg
84KB, 499x746px
>>59379395
Do you know how stupid your post sounds like to the people from the countries you want to ban?
>>
>>59379889
take 3 . reverse . sort

>b-but it's O(n*log(n)) instead of O(n)
Who cares, it's looks cool.
>>
>>59379926
The difference is that your source code that you want to compile has to be hardcoded into the compiler itself, and the output program is not even outputted, which means if you want to run your outputted program, you then have to implement a virtual machine in your compiler if you want to avoid I/O.

The problem is that because your source code is hard coded, you have to recompile your compiler every single time you write a program. Which means you'll never ever be able to ditch your first compiler.

Usually what sane programmers do is they compile the compiler once and keep the compiled program around on disk and call it (which does I/O) to compile further programs.
>>
>>59379942
>Who cares
That is the whole point senpai.
>>
>>59379962
>you then have to implement a virtual machine in your compiler if you want to avoid I/O.
Nope.
>The problem is that because your source code is hard coded, you have to recompile your compiler every single time you write a program.
Yes, I have no problem with that.
>Which means you'll never ever be able to ditch your first compiler.
I'm fine with leaving a few strings hanging around from the first compiler.
>which does I/O
Exactly. Not an option.
>>
>>59379941
even from countries anon hasn’t mentioned, it still sounds retarded
>>
I feel a post like this needs to be immortalized.
>>
>>59380004
Needs more context.
Get the entire (relevant parts) of the thread.
>>
>>59380017
There are so many posts to dig though, and most of them is the retard just repeating himself.
>>
>>59380004
Care to explain how exactly this is "stupid". Not everyone shares your retardation, you know?
>>
>>59380026
Try and at least get as much as you can in a sane amount of time to get enough context.
This needs to be recorded and passed down through generations.
>>
>>59380033
Literally everything I said there is correct.
>>
>>59379836
What if my program is meant to work with living, breathing data in order to analyze information as it is created by humans?
>>
>>59380252
Then you're shit out of luck.
>>
How do I git gud with manipulating text efficiently? I always cringe at my skills. Should I just emacs/sed/awk/regex?
>>
>>59380913
You should vim.
>>
>>59380913
>>2015
>>2016
> 2017
>not knowing regex
>>
>>59380913
sed and awk are excellent tools for manipulating text in shell scripts.
You're doing yourself a disservice by not knowing them.
>>
>>59381086
why not just use python or perl?
>>
>>59381098
Because awk and sed are more useful for the things they're good at: one liners and shell scripts. They aren't for making "proper" programs.
I've written many bash scripts, most of which are just gluing calls to sed, awk, grep, curl, and a few other more obscure utilities (like jq) together, and they get the job done very concisely.
>perl
Perl is garbage and dead.
>>
>>59381157
perl is awesome and very powerful for text manipulation

you can solve everything with perl one liners that you can with your antiquated garbage awk
>>
>>59381206
>perlfag calls something "antiquated garbage"
The irony.
>>
File: regex.png (32KB, 780x432px) Image search: [Google]
regex.png
32KB, 780x432px
>>59381206
Perl ruined regular expressions for the rest of us.
Only a few sane regex implementations remain, including sed, grep, awk and a few others.
>antiquated garbage
>A perlfag reddit spacer said this
>>
>>59381232
perl is built around regexs

you only need to know like 20 commands and you can do anything with it with minimal typing
>>
>>59381253
So what, you can use Python and get the same results with maintainable code.
>>
I had a dream that /prog/ was back.

I'm going to read my SICP today.
>>
>>59381253
>perl is built around regexs
Then why does it do such an awful job?
>>
>>59381280
it is maintainable if you know the basics of the language

and why would you want to maintain your one liners anyway??


http://www.troubleshooters.com/codecorn/littperl/perlreg.htm#DoingSubstitutions
>>
>>59381330
>Then why does it do such an awful job?
it's doing a fine job
>>
>>59381286
HOW the FUCK do I search my LinkedLists?
>>
>>59381381
>LinkedLists
Slava Pestov is extremely disappointed in you.
>>
>>59377810
binary except your 0 key is broken
>>
>>59379510
Streams.generate(Scanner::getLine)
.collect(averagingInt(String::length))

desu
>>
>>59381366
Please observe the output of this shell script
#!/bin/bash

match=$(printf "%$1s" | tr ' ' 'a')
regex=$(printf "%$1s" | sed -r 's/ /a\?/g')"$match"

echo "grep"
time grep -E "$regex" <<< "$match"
echo

echo "perl"
time perl -ne "print if /$regex/" <<< "$match"
echo

29 as the argument:
grep
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa

real 0m0.009s
user 0m0.007s
sys 0m0.003s

perl
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa

real 0m24.154s
user 0m24.143s
sys 0m0.007s

30 as the argument:
grep
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

real 0m0.009s
user 0m0.007s
sys 0m0.003s

perl
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

real 0m50.588s
user 0m50.563s
sys 0m0.023s

If that's not awful, then I don't know what is.
>>
>>59381381
>not knowing how to traverse a LinkedList
You must be a newbie to programming, I'm guessing.

Depends on if your list is singly or doubly linked. If your list is singly linked, start at the head. For as long as you're not at a null node, loop over the following:
>test the data in the node you're at against the value you're searching for
>if they match, return the value
>else, move on to the next node

If your list is doubly linked, the procedure should be basically the same, except you can optionally start at the tail node instead. Frankly, if your list is doubly linked, you can start anywhere. This benefits the efficiency of the search algorithm if you have a node pointer static to the function, instead of instantiated each time the function is called, and you just leave it where you found the last value and pick it back up wherever you left it--since, in the case of a sequential data structure like that, new requests are likely to be for values close to the previous requests.
>>
>>59381419
>binary except your 0 key is broken
just use alt + 48 instead
or the literal hundreds of other workarounds for this
>>
>>59381449
that's not a proper test since you're loading a whole language interpreter (that takes a little bit of time)

just check out tests where perl shows weaknesses but it's not regex speed

https://stuffivelearned.org/doku.php?id=programming:general:phpvspythonvsperl
>>
>>59381419
Still more useful than an IO-less language.
>>
im in c# lesson
should I ask professor what a fizzbuzz is :^)?
>>
>>59381875
>im
>c#
>:^)?
>>>/r/abbit
>>
>>59381875
>Going to class at 1AM in the morning
>>
>>59381895
you use it too and so do most of people here tho
>>
>>59381896
It's 9AM right now in the civilized world.
>>
>>59381921
>Before 12PM
>Civilized
>>
>>59381921
actually its 3 pm
>>
HOW the FUCK do I print my LinkedList's content? I know I have to use a "for" but fuck man... What value do I print?
>>
Bet u fags can't even do this

â–²
▲▲
>>
>>59381956
>What value do I print?
The fucking value that you wanted to print perhaps?
Why the fuck are you iterating your linked list if you don't know why you're iterating it?
>>
>>59381976
I want to print ALL OF IT
>>
>>59381969
t r i a n g l e
r r
i i
a a
n n
g g
l l
e e
>>
File: 1478608314279.jpg (52KB, 500x500px) Image search: [Google]
1478608314279.jpg
52KB, 500x500px
>>59381969
whats the triforce unicode point?
>>
>>59381916
Nope, I'm not a literal subhuman. And I'd like to believe that most people here aren't as well.
>>
File: 1486572521723.jpg (145KB, 867x1024px) Image search: [Google]
1486572521723.jpg
145KB, 867x1024px
>>59381921
>civilized
>>
>>59379798
>>59379782
>Everyone who disagrees with me is the same person, because I said so
Nice samefag, dude. Epic samefag. Fucking retarded samefag. Kill yourself, you gay anal guinea homo millennial kike shill.
>>
>>59382028
We're all basement dwelling subhumans, anon
>>
>>59381988

Each element in your linked list should have a value for you to access and print
>>
>>59381969
Is this the so called "tripforce"? You're an "old" "fag"?! it looks fucking cool!
>>
>>59382047
>basement dwelling
Sure.
>c# using subhuman
Nope.
>>
>>59381248
>reddit spacer
>using this gay millennial meme invented by /v/
Nice try, PSYOP cuck shill, disinfo shill, Jewish cuckold. Kill yourself. Kill yourself.
>>
>>59381956
I don't know what language you're using or what your LinkedList declaration looks like, but let's suppose you're in C and you have code that looks like this:

struct LinkedList {
int first;
struct LinkedList* rest;
};


Then here's how you would do the loop:

struct LinkedList* LinkedList_Search(int value, LinkedList* list) {
for (; list; list = list->rest) if (list->first == value) return list;
return (void*)0;
}
>>
>>59381867
Nice samefag. Nice samefag. Great samefag. Amazing samefag. Kill yourself. Kill yourself.
>>
>>59382079
>Kill yourself.
>Kill yourself.
So which one is it?
>>
>>59382055
>>59382089
Oh shit I'm fucking retarded and forgot "get" existed. Sorry for the trouble anons I'm in java
>>
>>59382077
that was not me
>>
>>59381988
void LinkedList_Print(LinkedList* list) {
for (; list; list = list->rest) printf("%d", list->first);
}
>>
>>59382094
both
>>
How do I declare a pointer to a template on the stack (c++)
>>
>>59382089
In Lisp, this is just
(list)
>>
This is how I did it for reference

    public void printAll(){
for(int x=0; x<this.Total; x++){
System.out.println(this.Lista.get(x));
}
}
>>
File: anal beads.png (3KB, 235x141px) Image search: [Google]
anal beads.png
3KB, 235x141px
Why do /d/ and /t/ evaluate to the same character here?
>>
File: 2017-03-13_15-16-02.jpg (36KB, 683x423px) Image search: [Google]
2017-03-13_15-16-02.jpg
36KB, 683x423px
Version 1.2

Now it recognizes if the movie is available or not.

/*******************************************************************
* What it does: *
* Creating nice looking links on IMDB pages which refer to (open) *
* Kinox streaming sites *
*******************************************************************/


http://pastebin.com/u1NuHXq5
>>
>>59382136
Now extend it for anime.
>>
>>59381916
>/dpt/ user talking about C#
"LINQ is cool and useful"

>you talking about C#
"lol u tk him 2 da bar? im ask my c# prof what le fizbuz is x---DDDD"
>>
>>59381969
now output this programmatically
â–²
▲▲
>>
>>59382134
The GCHQ seems to be messing with your computer. I'll tell the guys to stop for a while.
>>
>>59382162
and youre shitposting my shitpost
>>
>>59382176
>>>/global/rules/2
>>>/global/rules/3
>>
>>59382165
> (format t "~a~:*~%~a~:*~a" #\â–²)
â–²
▲▲
>>
>>59382191
so were both getting banned
how fun
>>
>>59382126
what do you mean? template class type pointer?
>>
>literally 0 girls in cs second year class
oh i thought it was a meme
>>
>>59382172
Excuse me?
>>
>>59382127
The result of (list) in Lisp is an empty list. That's not at all comparable to what my snippet does.

A more accurate Lisp equivalent would be as follows:

(defun linkedlist-search (value list-var)
(cond
[(not list-var) nil]
[(eq value (car list-var))]
[1 (linkedlist-search value (cdr list-var))]))
>>
>>59377805
>What are you working on /g/?
An operating system without I/O.

To prevent nitpicking, I/O shall be defined in this context as:
* peripherals like keyboards, mice, printers
* networking
* graphics, sound
* anything a human user could read or manipulate

God says:
* preemptive scheduling
* scheduler maintains an idle process that uses 100% CPU to prevent programmers from using CPU temperature as a form of I/O (you could drip liquid nitrogen on the CPU to input data, or output data by heating it)
* 1920x1080 VESA graphics (filled with a single color that never changes)
* peripheral I/O ports emit pseudo-random noise all the time (this require real-time functionality in the kernel to prevent side-channel attacks)

The language is still undecided. It should be something like Coq, that can be proven formally, because there is no way to debug or even test programs.

q.
>>
So I need to calculate some 3D histograms in Python and I'm wondering if I can use OpenCV's calcHist() function for that. Allow me to explain.

In 1D, things are simple. Say I have an image img, I can calculate the histogram of, say, the first channel:
cv2.calcHist([img], [0], None, [64], [0, 256]
where 0 is the channel index, None could be replaced with a binary mask if I only want the histogram inside a certain area, 64 is the number of bins and [0, 256] is the range of values to include in the histogram. I can then plot this as "element count over value of channel 0". Symbolically speaking, the histogram might look like this:
value count
0 0
1 0
2 0
...
10 3
11 20
12 23
...
253 10
254 112
255 90


Now I want a histogram with four axes, one of which is again the element count, and three of which are for the values of one channel each. The Histogram would be something like:
[  0,   0,   0]   0
[ 0, 0, 1] 2
[ 0, 0, 2] 1
...
[ 0, 0, 254] 12
[ 0, 0, 255] 2
[ 0, 1, 0] 3
[ 0, 1, 1] 2

and so on. Basically a histogram which keeps count of full colors, not just individual channel values.

I could write that in "vanilla" Python but it'd be slow as shit, hence me wondering whether I can adapt cv2.calcHist() to this. Simply passing a tuple of ints for the channel indices or an array of channel indices does not work:

cv2.calcHist([img], [0, 1, 2], None, [64], [0, 256])
cv2.calcHist([img], [(0, 1, 2)], None, [64], [0, 256])
>>
>>59382232
>(defun linkedlist-search (value list-var)
> (cond
> [(not list-var) nil]
> [(eq value (car list-var))]
> [1 (linkedlist-search value (cdr list-var))]))
(samefag) Crud that's wrong. Correction:
(defun linkedlist-search (value list-var)
(cond
[(not list-var) nil]
[(eq value (car list-var)) list-var]
[1 (linkedlist-search value (cdr list-var))]))

My bad, I'm sleepy this morning.
>>
>>59382215
Be glad. Girls are fucking annoying anyways.
>>
>>59382232
In Lisp, this is just
(member value list-var)
>>
>>59382255
>b-b-but muh pussy!
>>
>>59382215
>implying having a cs gf is cool
>talk about cs at work with your peers
>come home
>talk about cs with your girl
>go to sleep
>think about cs
>burn out
In my experience it's much much more healthier for one's heart soul and body to get some art/literature/sports/math/physics/whatever girl. Broadens your mind
>>
>>59382266
I just wanna broarden my peepee anon
>>
>>59382256
Yeah but that's because Lisp has a big list library. That's kind of its thing. It's not like what it's doing under the hood is actually any more efficient, it just gives the illusion of efficiency by saving you finger work.
>>
>>59382259
I don't want pusssy anon. I want someone I can build a relationship with.

Yes, I have a very idealized version of love and romance set in mind. So what? I'm sure I'll find her someday
>>
>>59382256
In Ocaml it is
List.mem element list 
>>
>>59382296
Wow that is utterly terrible.

If Ocaml thinks it's going to pretend to be object oriented, why not just go all the way and have it be
list.mem element
>>
>>59382266
>physics girl
Too soon anon
>>
>>59382288
Gay as fuck

Nice dubs tho
>>
>>59382312
It's not pretending to be anything. List is just the name of the module. You can import and remove it from the sample.
>>
>>59382312
I don't use ocaml, but i assume that dot notation is used with a module, kind of like how Haskell does it.
>>
>>59382219
Yes?
>>
>>59382236
Cool. Will you implement my compiler on your new OS?
>>
New thread:
>>59382347
>>59382347
>>59382347
>>
>>59382195
you're supposed to decode UTF to generate spaces which used to work but now don't
>>
File: 1489372499015.jpg (76KB, 500x483px) Image search: [Google]
1489372499015.jpg
76KB, 500x483px
>>59382318
>>
>>59382328
>>59382338
oh
>>
>>59382239
Here's the slow code. Imagine running this on 5000 100x100 pixel blocks.

import numpy as np

BINS = 5

img = np.array([ \
[[255, 0, 0], [255, 0, 0], [255, 0, 0], [255, 0, 0]], \
[[255, 0, 0], [128, 255, 0], [255, 255, 0], [ 0, 0, 0]], \
[[ 0, 0, 0], [255, 255, 0], [ 0, 255, 128], [ 0, 255, 255]], \
[[ 0, 0, 255], [ 0, 0, 255], [ 0, 255, 255], [ 0, 255, 255]] \
]).astype(np.uint8)

histo = np.zeros((BINS, BINS, BINS)).astype(np.uint8)

for row in img:
for pixel in row:
histo[pixel[0] * BINS / 256, \
pixel[1] * BINS / 256, \
pixel[2] * BINS / 256] += 1

print histo
>>
>>59382434
>py
>>>/r/ibbit
>>
>>59382153
Had something like that in mind already. An MyAnimeList implementation.

Sadly, most Animewebsites won't have a unique ID.

Because imdb is so popular, websites like Kinox use the same ID as imdb.

That's why I think it will be not as reliable.
>>
>>59382045
>>Everyone who disagrees with me is the same person, because I said so
But that's literally what you were doing, you retard.
There's no reason why anyone would defend no-IO-kun so logically we concluded that they were the same person.
>>
>>59382608
But that's false. You can tell by the posting style pretty easily.
>>
>>59378216
Wasn't this the logic behind windows registry? If so, that is a strong enough argument against it.
>>
>>59379942
It's lazy, so it might not be
>>
>>59381432
whoops
>
Scanner::getLine

should be
() -> s.nextInt()
>>
>>59384500
wait, getLine not nextInt
>>
>>59382204
pointer to a template

like how you can have a pointer to an int, or a pointer to a struct, or a pointer to a class

like just do pointer to a template
>>
>>59381600
here's where perl shows weakness in regex speed

https://swtch.com/~rsc/regexp/regexp1.html

>Notice that Perl requires over sixty seconds to match a 29-character string. The other approach, labeled Thompson NFA for reasons that will be explained later, requires twenty microseconds to match the string. That's not a typo.
>>
>>59381997
dude mostrata lmao
Thread posts: 332
Thread images: 31


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