[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 320
Thread images: 34

old thread: >>59947259

What are you working on, /g/?
>>
File: Gambas.png (35KB, 195x280px) Image search: [Google]
Gambas.png
35KB, 195x280px
First for Gambas!
>>
File: apr18_1.png (47KB, 573x809px) Image search: [Google]
apr18_1.png
47KB, 573x809px
>>59955068
Making some art
>>
im gay
>>
File: cute anime pic 0055.jpg (96KB, 1280x720px) Image search: [Google]
cute anime pic 0055.jpg
96KB, 1280x720px
>>59955109
>Gambass
>>
>>59955125
suck my cock faggot
>>
>>59955125
no youre not lol
>>
File: embarrassing.jpg (318KB, 644x644px) Image search: [Google]
embarrassing.jpg
318KB, 644x644px
>>59955138
Being mocked by someone who posts animu unironically is actually very encouraging.
>>
>>59955118
looks like a sword
>>
File: 1482873447348.jpg (17KB, 480x362px) Image search: [Google]
1482873447348.jpg
17KB, 480x362px
>>59955068
Ok, heres an stupid question.

Im using Netbeans 8.1 with JDK 1.8 and I'm trying to make a JavaFX project.

Problem is I cant find JavaFX anywhere, not when i choose Add-> Other, nor in Tools -> Options -> Java

Im using Linux, Elementary OS.

Been googling but cant find anyone with the same problem. How do i even link Scene Builder with JavaFX in netbeans if I cant find JavaFX in Tools->Options -> Java.
>>
File: when_your_code_compiles.jpg (64KB, 298x351px) Image search: [Google]
when_your_code_compiles.jpg
64KB, 298x351px
>>59955068
>mfw when people thinks it's fine to post traps without first editing programming related dialogue/objects into it first
>>
Repostan because I have awful timing

I'm doing something in c++. To make this shorter let's just assume that vector in the following text is std::vector<*whatever>
class foo{
vector *_v
...
setV(vector *other){
_v = other;
}
};
...
vector a = new vector;
foo f;
f.setV(a);



This worked fine, I could access the _v in f, but when I changed it so that _v is just an object, not a pointer, and that setV takes a reference to a vector the program later crashes when I try to access the elements inside. i checked in the debugger and the elements inside other in the setter function are all null. Why is this happening? I thought passing references was used exactly for this, to avoid fiddling with addresses when you don't have to.
>>
File: apr18_2.png (78KB, 964x1105px) Image search: [Google]
apr18_2.png
78KB, 964x1105px
>>59955181
Interesting. What about this one?
>>
>>59955223
they're all null because you're deleting them at some point accidentally


make your data members const
>>
Working my way through some Clojure exercises.
>>
File: 1328985193003.png (1MB, 900x1140px) Image search: [Google]
1328985193003.png
1MB, 900x1140px
>>59955174
>complaining about animu on an animu website
>>
>>59955238
like a shooting star
>>
>>59955223
Try setting _v to the pointer of the object instead of the object iself?
I dont know C++, im just a superior C dev.
>>
>>59955238
>>59955118
these are pretty cool dude, how are you generating them?
>>
>>59955240
I made a bad example, the vector "a" in the code above isn't actually declared on the spot, its a field of the class inside of who's method is setV called, so "a" is stable until the program terminates. Not to mention that if that what you told me was true then the solution with pointers wouldn't work either. the program crashes only when I implement it with references.
>>
>>59955259
what if tinder but for turds
>>
>>59955302
Turder?
>>
>>59955302
>>59955309
What's that smell? I smell trillions of dollars
>>
>>59955276
You are right though, I could just go back to pointers, but I wanna figure out why references aren't working.
>>
>>59955068
What's the best book for learning cpp?
Is it Programming: Principles and Practice Using C++ (Bjarne Stroustrup). For a beginner..
>>
>>59955282
They're n-body simulations.
>>
File: font_test_verdana_10.png (26KB, 645x240px) Image search: [Google]
font_test_verdana_10.png
26KB, 645x240px
monospaced fonts are over-rated for programming
Not pointless, but very over-rated.

>mfw Verdana
>>
>>59955333
In c, if i have
struct vec3 {
float x;
float y;
float z;
}

struct vec3 myVec;
myVec.x = 2.0;
myVec.y = 1.0;
myVec.z = 0.0;

struct vec3 *vecPtr;

vecPtr = myVec;

it sets vecPtr to the 1st 8 bytes of myVec, which would be 00, 00, 00, 02, 00, 00, 00, 01.
not to the pointer of myvec.
>>
>>59955351
I'd not considered the artistic implications of n-body simulations :-D

thats pretty cool of you, if you don't mind what language are you implementing them in?
>>
>>59955370
>what is indentation
>>
>>59955370
You're not writing a book, you're writing software. Get real, loser.
>>
>>59955351
So do you have particles of differing masses and do the gravity calcs of them to determine there paths? Is the color velocity or something? Looks cool
>>
>>59955441
>there paths
t. ameritard
>>
>>59955296
You're going to need to post a bit more code then, what your explaining should absolutely work.
>>
>>59955259
thats not a healthy shit fix your diet
>>
>>59955333
>>59955385

But if i have the myVec i already made,
and..
struct vec3 secondVec.

and i do

secondVec = myVec.
It will copy the data from myVec into secondVec. then i can edit one without effecting the other.
>>
File: Capture2.png (49KB, 1252x713px) Image search: [Google]
Capture2.png
49KB, 1252x713px
>>59955399
Mathematica

>>59955441
All the particles are of mass = 1 and also G = 1 just for simplicity

The color represents the position along the trajectory
>>
File: 1473514342258.jpg (17KB, 396x372px) Image search: [Google]
1473514342258.jpg
17KB, 396x372px
>>59955482
>Mathematica
>>
File: 1463218368414.jpg (36KB, 335x383px) Image search: [Google]
1463218368414.jpg
36KB, 335x383px
>>59955482
>>>/sci/
>>
>>59955482
>Mathematica
Absolutely Wolfram.
>>
Name me one scripting language that doesn't suck.
>>
Hey, when I run this C code:

 main() {
long wc = 0;
while (getchar() != EOF) {
++wc;
}
printf("%d\t", wc);
}


say i do:

1111
^Z

I get a number of 5, is it because of the null terminator at the end? aka '\0'
>>
>>59955548
PHP
>>
>>59955482
>>59955512
As a consultant for large scale data science companies, it hurts me deeply that you're using mathematica (only because it's stunting your potential not because you're lacking in any faculties) but the stuff you're doing is really cool you should keep at it.
>>
File: 1491336648866.jpg (78KB, 338x305px) Image search: [Google]
1491336648866.jpg
78KB, 338x305px
>>59955562
WAIT
>>
>>59955557
Yes.
>>
I'm currently on a Java course, and my laptop almost literally blew up yesterday.

Was wondering if there's a way to set up JDK or whatever alternatives into my phone for the time being, but I have no idea about it

Any kind of help would be appreciated
>>
>>59955482
>Mathematica
Wew lad how long did that take for you to run?
>>
>>59955583
What was your laptop?
>>
>>59955583
Any decent college will provide computers with the required development environment if they offer java courses.
>>
File: 1486597506283.jpg (93KB, 640x640px) Image search: [Google]
1486597506283.jpg
93KB, 640x640px
>>59955068
>not a doujin
lame
>>
>>59955565
What makes you say that?

>>59955588
Pretty much instantaneous.
>>
>>59955596
And old Lenovo I got as a gift 4 years ago, made the mistake of putting my roomate in charge of buying a new charger due to me being busy, and then made the mistake of using it without checking.

10 seconds in, it just overheated and killed everything.

>>59955624
third world country, not a college course but more of a State approved course designed to generate manpower and delegated to several shit-tier institutions
>>
>>59955634
>What makes you say that?
ur mum
>>
>>59955634
>instantaneous
Why you gotta lie bro?
>>
>>59955657
Hmm..
>Java
>Third world country
>State approved
Are you by chance an Indian?
>>
>>59955474
I'm sorry to have bothered you, I made a mistake somewhere else. At the moment I called setV I haven't yet filled the vector with values, so the pointer approach still works because I access the vector after I fill it up, the reference ones doesn't.

>>59955480
Although I wasn't exactly looking for that, thank you for the help and a short reminder of how strcuts work in. it's appreciated.
>>
File: Capture3.png (31KB, 828x233px) Image search: [Google]
Capture3.png
31KB, 828x233px
>>59955676
This one is of 20 bodies (far beyond what makes for a nice looking image) and it took ~2 seconds. The previous images were of like 4 or 5 which takes on the order of 1/10 of a second.
>>
why doesn't this work for bake and pale? why does c magically change from 2 to 0?
def one_away(str1, str2):
if len(str1) > len(str2):
originallonger = list(str1)
originalshorter = list(str2)
else:
originallonger = list(str2)
originalshorter = list(str1)
longer = originallonger
shorter = originalshorter
c = 0 # edit count
# insertion
if (len(longer) - len(shorter)) > 1: return False
if len(str1) != len(str2):
for i in range(len(longer)):
if shorter[i] != longer[i]:
shorter.insert(i, longer[i])
c += 1
if c <= 1 and longer == shorter:
print("insertion worked")
return True
c = 0
longer = originallonger
shorter = originalshorter
# removal
for i in range(len(longer)):
if longer[i] != shorter[i]:
del longer[i]
c += 1
if c <= 1 and longer == shorter:
print("removal worked")
return True
print("removal and insertion failed")
return False
# replacement: longer changes to shorter
longer = originallonger
shorter = originalshorter
for i in range(len(longer)):
print(longer[i], shorter[i])
if longer[i] != shorter[i]:
longer[i] = shorter[i]
c += 1
print(c)
if c <= 1 and longer == shorter:
print("replace str1 to str2 worked with ", c, "replacements")
return True
# replacement: shorter changes to longer
longer = originallonger
shorter = originalshorter
c = 0
for i in range(len(longer)):
if longer[i] != shorter[i]:
shorter[i] = longer[i]
c += 1
print(c)
if c<= 1 and longer == shorter:
print("replace str1 to str2 worked with ", c, "replacements")
return True
print("No operations could make the strings the same")
return False

print(one_away(input(), input()))
>>
>>59955634
don't get me wrong, when it comes to academia mathematica is approachable and feature-rich to be capable of a lot of cool things. The issue is that when you start working with extremely large corpus' of data, and on your own infrastructure, it doesn't perform nearly as well as some other languages that have things like parallelizing functions across cluster nodes built in. You should keep with mathematica for as long as it suites you just start looking at things like Scala, Python, or Java for large scale things. (people who say R or Julia are cute but have no industry experience.)
>>
Is reading and parsing a program you don't understand and investigating the things you don't get until you can understand what the program is actually doing a good way to learn?

I've found myself doing this recently more and more as a beginner and it's helped me out a lot.
>>
>>59955726
yes. I've learned more from dissecting code than I ever have from any book. period.
>>
>>59955721
Fix your variable names, your code is so dense because you didn't separate your logical structures.
>>
>>59955333
Are you using vector or vector&? If you are using vector&: How do you initialize it?
>>
File: 630.jpg (86KB, 680x541px) Image search: [Google]
630.jpg
86KB, 680x541px
>>59955701
pic related
>>
File: mostridiculous.jpg (44KB, 263x345px) Image search: [Google]
mostridiculous.jpg
44KB, 263x345px
>>59955714
>tfw it takes minutes for my Mathematica to calculate Maslov indices and several hours to run a simple quantum Monte-Carlo
Ok
>>
>>59955725
>extremely large corpus' of data
How large we talking?
>>
Help, I need to extract values from strings that look like either of the following:
$4,610,676 (USA) (27 December 2015) (100 screens)

Or
$4,610,676 (USA) (27 December 2015)

I'm doing this in Java and I need the first and 3rd columns. What's a good way of getting this stuff extracted into an int and a string, respectively? Thanks in advance.
>>
>>59955799
>>>/adv/
>>>/r/
>>
>>59955721
Simplify your bug. im not going to look through 50 lines.
>>
>>59955791
it depends on what the nature of the process is. sometimes I come in to help people with things that are not exactly crunching lots of data but may just be computationally intensive (monte-carlo, etc) other times it's doing lots of inline transformations on existing data (from a corpus) or doing analytics, or running long term streaming processes, or creating a node architecture for BPNN's. Most of the really interesting things I've gotten to do tend to be terabyte-petabyte in scale. I got to do some work with TRI once (toyota research international) and they operated on an exobyte of data per simulation (they generated a fuckload of sensor data during tests)
>>
>>59955799
/r/egex
>>
>>59955780
It's VERY easy to write slow MMA code if you're not careful, like if parts of your computations are being done in exact (bignum) arithmetic or stuff like that.

Share notebooks?
>>
>>59955744
    c = 0
for i in range(len(longer)):
if longer[i] != shorter[i]:
shorter[i] = longer[i]
c += 1
print(c)
if c<= 1 and longer == shorter:
print("replace str1 to str2 worked with ", c, "replacements")
return True


why does c change from 2 to 0 here
>>
>>59955842
Even if c was 2, it wouldn't print that.
>>
File: 1483923923450.jpg (77KB, 608x536px) Image search: [Google]
1483923923450.jpg
77KB, 608x536px
>>59955217
>>59955257
>>59955370
>>59955404
>>59955471
>>59955628
>>59955701
>>59955780
I really want to know who are you quoting.
>>
>>59955842
I don't know how python interprets whitespace, is everything in the same indentation level guarded by the if statement above it?
>>
>>59955863
run the code
>>
>>59955869
Nice job not knowing how to read.
>>
>>59955836
Yeah I probably wouldn't use it for things like that but I'm guessing it takes some pretty specialized knowledge to write programs on such a scale regardless of what language you're using.
>>
>>59955885
>c<= 1
I don't need to.
>>
>>59955869
I don't believe you look anything like that picture of yourself.
>>
>>59955842
>==
Instant shitlang.
>>
>>59955908
justin@debian:~/python-programs$ python3 One-Away.py 
bake
pale
p b
1
a a
l k
2
e e
replace str1 to str2 worked with 0 replacements
True
justin@debian:~/python-programs$
>>
>>59955898
while it defintely takes a lot of specialized knowledge to create the underlying infrastructure (setting up hadoop, mesos, etc, config managing the nodes, optimizing nodes for applications, yada yada) the part *you'd* have to deal with as a developer is really simple actually ^_^ . You should take a look at Spark it'll change your life:

http://spark.apache.org/

works great with Python, Scala, Java, and some other stuff for real get into it.

1.) it's awesome for what it does
2.) you have Spark on your resume people will pop a major boner.
>>
>>59955913
How can it be the case that I don't look like a picture of myself?
>>
>>59955936
Yes, it'll only print if c is less than or equal to 1.
>>
>>59955869
>>there paths
>t. ameritard
I quoted the person I replied to:

>>59955441
>So do you have particles of differing masses and do the gravity calcs of them to determine there paths? Is the color velocity or something? Looks cool

See at the end of the first sentence?
>>
>>59955951
if you know why does c change from 2 to 1, please stop being cryptic and say
>>
>>59955961
>responding seriously to a shitposter
>>
>>59955961
Yes, I see now. This is indeed correct.
Do you happen to know who the other posters were quoting?
>>59955971
Who said that?
>>
>>59955941
It's very airbrushed.
>>
>>59955970
*2 to 0
>>
>>59955970
I am not being cryptic. You yourself wrote that logic.
>>
>>59955977
>Do you happen to know who the other posters were quoting?
No, I don't. I'm sorry.
>>
>>59955989
wait do you think that <= is assignment? it's less than or equal to. if anyone knows python and can explain this i'd appreciate it
>>
>>59955068
How do you write an append that does this in Prolog???:

append([a,b,c], [1,2,3], List).
List = [a,1,b,2,c,3].
>>
>>59955937
How does Spark compare to Hadoop?
>>
>>59956037
What are you using to learn it?
>>
>>59956029
No.
>>
>>59956050
ur mum
>>
>>59956050
The learnprolognow webpage
>>
>>59956049
It's an even greater meme.
>>
>>59956070
>"""meme"""
>>>/v/
>>>/b/
>>
>>59956049
so there is a bit of a misconception that Spark and Hadoop are competitors as platforms. Believe it or not they actually work best together. I use Hadoop and the HDFS as my distributed data store that I can parallelize functions across, and I use Spark as the general data processing engine that lies on top of Hadoop as an abstraction
>>
>>59956101
>an """abstraction"""
Learn to use your words properly before coming here.
>>>/g/wdg
>>
>>59956086
t. hyped pajeet
>>
>>59956101
Oh.

>>59956115
Aren't APIs abstractions
>>
>>59956116
What are you even babbling about now?
>>
>>59956101
That's sure an advanced seed box.
>>
>>59956054
you understand i don't want to print c when it's 2? when c is 2, it is less than 1. i think you don't understand the logic, not me

        if c<= 1 and longer == shorter:
print("replace str1 to str2 worked with ", c, "replacements")
return True
print("No operations could make the strings the same")
return False
>>
>>59956049
>How does Spark compare to Hadoop?
wut

they're often used together
>>
>>59956127
>Aren't APIs abstractions
>"""abstraction"""s""""""
>>>/g/wdg
>>
>>59956141
*not less than
>>
>>59956130
Just farming those easy (You)s.
>>
>>59956141
Wrong. You could perform more than one operation to make the strings the same.
>>
Here comes the armchair crew ready and rearing to go on a fun and exciting argument over semantics
>>
###56166
What are you, gay?
>>
>>59956176
"semantics"
+18 please. Learn to speak properly before coming here.
>>
Anyone used Skia? looks alright
>>
>>59956173
i already did previously in the program. dumb cunt who thinks he's really clever
>>
File: traps-are-not-gay-3.png (1KB, 92x15px) Image search: [Google]
traps-are-not-gay-3.png
1KB, 92x15px
I guess we had some fun yesterday.
MPed you my Skypeâ„¢ so we can keep in touch.
>>
>>59956200
+18 please.
Learn to curse before you come here.
>>
>>59956200
Also, obviously you should look at the c = 0 lines. Duh.
>>
>>59956037
append_interleave([X_Head|X_Tail], [Y_Head|Y_Tail], Result) :-
append([X_Head, Y_Head], Result_Tail, Result),
append_interleave(X_Tail, Y_Tail, Result_Tail).
append_interleave([], [], []).
>>
>>59956223
c is being set to 0 between the different operations, not within them. dumb cunt who thinks he's really clever. that's going to become your title, like "the honorable"
>>
File: 4bf8fd097a3b0a24640146e9790c2cd9.png (869KB, 1000x1412px) Image search: [Google]
4bf8fd097a3b0a24640146e9790c2cd9.png
869KB, 1000x1412px
1.
ILikeLittleGirls

2.
i_like_little_girls

3.
i-like-little-girls
>>
What is man supposed to use when here's just no good statically typed and compiled language.
>sml
no good implementaion
>ocaml
sml with shitty syntax, also does not support native threads
>lisp
too verbose, also static typing not standardized
>c
decent but manual memory management is annoying in prototyping phase
>sepples
cluster fuck that no sane person would touch
>d
can't decide if it wants to have gc or no
>rust
better stay away from it because it attract lot of crazy hipsters, also uglier than sepples
> any jvm/clr lang
requires huge vm
>go
Rob Pike is faggot, also no macros
>>
>>59956280
2 is easier to read and preferred.
3 might be acceptable if you want to make some property easily noticeable, such as being a class.
>>
File: v&.png (35KB, 475x122px) Image search: [Google]
v&.png
35KB, 475x122px
>>59956280
>>
File: 1466719215783.png (4KB, 557x32px) Image search: [Google]
1466719215783.png
4KB, 557x32px
>>59956280
>>
File: 1487224131864.png (249KB, 500x687px) Image search: [Google]
1487224131864.png
249KB, 500x687px
Writing a C program which reduces any given C program to its normal form.
>>
>>59956299
t. first year cs undergrad

We value post quality here, fag.
>>
>>59955873
Yes basically. And you mustn't forget the colon.
>>
>>59956299
Who said all of this?
>>
>>59956280
>
IL_ikeLittleGirls
>>
>>59956299
Rob Pike is god emperor
>>
Assume I'm making a picture editor of sorts in c++.
It supports layers and when a new project is started it has one layer that is shown on the screen. The user has the option to add a new layer beneath or above all the existing layers.

The first data structure I thought of to keep the layers in was a deque since it supports both pushing and popping them from either end. The other one was a map<number of the layer, layer> where the first one would be 0, adding below would give them negative numbers and positive numbers for the layers above.

Got any input on this? One thing I like about the maps more is that tracking the currently shown layers is easy since all I have to keep is a single number, but if I were to use a deque there'd be a hassle when it starts reallocating, so no pointer or iterator would stay valid for too long.
>>
>>59956351
Good point.
>>
>>59956307
>such as being a class
Sorry, I'm not subhuman.
>>
>>59955068
source is:
Shishunki na Adam
>>
>>59956331
What do you mean by normal form?
>>
>>59956257
doesn't work
>>
>>59956333
>We value post quality here
OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER
GODFUCKIGNDAMN
FIRST OF ALL, YOU DONT FUQIN KNOW WHAT A MAN PAGE IS
SECONDLY, THIS IS /prog/ DO NOT DEMAND USEFUL ANSWERS THE WAY YOU WANT THEM TO BE
THIRDLY PROGRAMMING IS ALL ABOUT PHILOSOPHY AND ``ABSTRACT BULLSHITE'' THAT YOU WILL NEVER COMPREHEND
AND FUQIN LASTLY, FUCK OFF WITH YOUR BULLSHITE
EVERYTHING HAS ALREADY BEEN ANSWERED IN >>3,4-6
>>
https://pastebin.com/raw/zrJXkhft

/g/ help me out, why isnt this working?
Im trying to make a paginated list from search results
>>
>>59955203
Install JavaFX with sudo apt-get install openjfx

Then download Scene Builder from http://gluonhq.com/products/scene-builder/
>>
the post above mine is so reddit...
>>
>>59956397
>/g/ help me out, why isnt this working?
PHP has been disabled worldwide for security reasons like 2 months ago. Just pick up a new language.
>>
>>59956257
Thank you anon! :)
>>
>>59956397
>passing user input straight to exec
>>
>>59956389
It shouldn't with different list lengths.
>>
>>59956397
>PHP
>inline code
REEEEE
>>
>>59956373
In general I'm not very sympathetic of it either but was the first common use case that occurred me.
>>
File: unimpressed.jpg (249KB, 1023x843px) Image search: [Google]
unimpressed.jpg
249KB, 1023x843px
>>59956412
>le "security as a product XDDDDD" meme
>>
File: (You).png (1KB, 89x13px) Image search: [Google]
(You).png
1KB, 89x13px
>>
>>59956390 (probably a frogposter)
>>
>>59956398
Already have openjfx installed from rep.

Downloaded scene builder plugin and some JAvaFX2 plugin and now it seems to work.

Thanks anyway, appriciate it.
>>
>>59956453
>security is not a product
>PHP is a product
>therefore PHP is an insecure product
checkmate
>>
Name 1 (one) non-shit piece of software
>>
>>59956457
>blurry letters
shit
>>
>>59956487
cat
>>
>>59956257
How does append/4 really works?
>>
>>59956493
Nah mate, click on it! It's just absurd thumbnail lossy compression
>>
>>59956382
When it's not reducible any further.
>>
>>59956422
>>59956425
>>59956453
>>59956477
>>59956493
Can you stop typing in this retarded fashion if you aren't quoting anyone?
>>
File: 1481630951548.png (113KB, 305x377px) Image search: [Google]
1481630951548.png
113KB, 305x377px
>>59956477
>>
>>59956523
Define "reduce". This pretty much amounts to writing the program, so there's nothing challenging left....
>>
>>59956547
>obey
no
>>
>>59956515
It's just Lisp under the hood.
(mapcan 'list '(a b c) '(1 2 3))

You can thank me later.
>>
>>59956552
3 + 3 isn't in normal form.
6 is in normal form.
I want to perform this rewrite for arbitrary C programs.
>>
>>59956515
There is only append/3, and it's the same like append defined at learnprolognow.idontremember
>>
>>59956378
Thanks. So sad it isn't hentai... I mean, I'm not gay, but I would have enjoy it.
>>
>>59956571
Prolog is consistent, Lisp is inconsistent. Therefore, Prolog can't use Lisp "under the hood".
>>
>>59956578
C is much more than arithmetic operations, thank you very much I knew that. but what reduction rules are you thinking of?
>>
>>59956115
nobody cares about your petty semantics NEET. go back to watching naruto. it's an abstraction in the general sense

>>59956127
using the term loosely, anything adding a layer of complexity or functionality to something existing is somewhat an abstraction.

>>59956133
only the finest pron
>>
>>59956547
>Can you stop typing in this retarded fashion if you aren't quoting anyone?
>>
>>59956612
Prolog lists are analogous to Lisp lists though.
>>
>>59956632
So? Equivalence doesn't imply using something under the hood.
>>
>>59956612
Your reasoning is faulty. Every programming language is just a Lisp in disguise.
>>
>>59956115
just to put you in your place:

1. noun. the quality of dealing with ideas rather than events.
"topics will vary in degrees of abstraction"

your corpus is just data, it doesn't mean anything unless you give it meaning. thus you have 'ideas' about your data and not just interest in the data in and of itself.
>>
I decided to try building a simple iOS app. Having no prior experience with Swift or Objective-C, or XCode, it's been slow. But I got something basic, if ugly, working.
>>
>>59956644
For this to be true every programming language has to be inconsistent. This is obviously not the case. Therefore, not every language is just a Lisp in disguise.
>>
>>59956653
OWNED!
>>
Holy shit, 4clojure fucking sucks.
Back to 99 haskell problems.
>>
>>59956620
>>59956653
Why the hell do you space your posts like that, redditors?
>>
>>59956670
>OWNED!
>>
File: 1491491608393.gif (1MB, 200x200px) Image search: [Google]
1491491608393.gif
1MB, 200x200px
>>59956670
another successful argument with a stranger on the internet.
>>
>>59956673
I write in languages that enforce whitespace
>>
>>59956697
That is what I meant when I said "redditors".
>>
>>59956705
rofl. Sorry I'm just on the spectrum and not an outright savant like yourself.
>>
>>59955125
so, we all are on this place
>>
>>59956618
>C is much more than arithmetic operations
You didn't ask about C. Obviously "3 + 3" isn't a valid C program.
>but what reduction rules are you thinking of?
That's what I'm working on currently.
>>
>>59956658
how is inconsistency a requirement for the language that has the most consistency of all?
>>
>>59956101
So the head Hadoop Yahoo dude came to my school to give a seminar about a year ago. It was mainly for the professors, but I went to get some free pizza and listened a bit. Is there anywhere I can read up on Spark/Hadoop? Ideally more technically oriented and less white papery.
>>
>>59956756
>reducing a language with undefined behavior n sheit
Good luck....
>>
pleb here, working on C

lads
on this line of code

if ((number = decin ()) == EOF)
break;

Right here, is number being assigned to the return value of the decin() and compared to End of File

But after that if statement (assuming the code keeps running from there), is number assigned as the return value of decin() for the rest of the code or only for the purposes of that comparison?

I know it sounds like a silly question but I get confused when reading other people's code at times
>>
>>59956756
>3 + 3
it's an int rvalue tho
>>
>>59956806
>pleb here, working on C
No need to explicitly say you're a pleb, we could conclude that from the "working on C" part.
>>
>>59956806
until it's assigned a different value. What would be the point otherwise? You could just as easily write (decin() == EOF) if the assignment has observable no effect.
>>
>>59956846
*no observable effect
>>
is C a pleb language?
>>
>>59956872
Define pleb language.
>>
>>59956869
>>59956846
Thanks bro.
>>
>>59956872
C means your too dumb to learn ASM
>>
>>59956774
for industry stuff Apache foundation and Hortonworks have probably the best documentation on it all that is technical (it's still fucking dense). There are also tons of 'optimization cheat sheets' and shit out there. It's best to just understand MPP architecture in general and not be too concerned with it.

I specifically run with Hadoop YARN, Spark, and Zeppelin as a stack when using Hadoop eco. I'm a borderline old dude at this point though, if you're young and getting into this, look at using Apache Mesos instead of Hadoop. You'll get to use container technology and it's methodology and way of doing things is ultimately superior. Hadoop is old school at this point. Mesos is where things are headed.

For Spark, just look at their docs for Scala or PySpark they're awesome. Spark really only has a few built in functions (for making things parallel, accumulators, collectors, transformers, etc) and the rest is user defined functions. Learn about RDD's (resilient distributed datasets) and what not.
>>
>>59956872
How could it be? It's the masterpiece of the old gurus, the irremplaceable supreme being that keeps everything together, the place where all begins and ends....
>>
>>59956889
What are you talking about? Asm is way easier than C its just onerous to program in.
>>
>>59956900
And unportable
>>
>>59956806
Yeah, the value of "number" is kept for the entire scope of "number". Or until its set to anything else.
If you dont understand what that means, post more code and i can explicitly explain.


>>59956835
Doesnt help.
>the real pleb.
>>
>>59956761
>most consistency
"most" isn't a word you can apply to consistency.
Anything which can express the omega combinator (or any other general recursion) is inconsistent.
>>
>>59956916
>the real pleb.
Who said that?
>>
>>59956775
Why would that be a problem?
>>
>>59956995
I guess i should have phrased it as.
"
>does help.
Your the real pleb.
"
>>
>>59957004
Dunno, maybe if you have an "undefined gobbles up everything" where every program with potentially undefined behavior reduces to
undefined;
, maybe it works idk.

this desu senpai
>>
>>59957040
>maybe if you have an "undefined gobbles up everything"
I don't think there is another sensible way to handle it.
Obviously if the C language doesn't define some behavior you might as well say it isn't part of the C language.
>>
>>59957004
>>59957040
>>59957074
I haven't written C in a really long time, but I thought best practice was to have functions take care of their own error handling so you're not tossing garbage back to main
>>
>>59957010
>does help
But nobody said that either.
>>
>>59957074
>Obviously if the C language doesn't define some behavior you might as well say it isn't part of the C language.
but what if it depends on a runtime value? Maybe I'm not thinking straight, but I.... does
if (0) undefined;
reduce into undefined? Ah well then you can reduce programs that prevent undefined behavior with checks into something defined, and every sane programmer should only write such programs, so maybe your programming challenge will eventually become a comfi static checker, who knows?
>>
>>59957127
Its not what you said, but what you did.
Are you one of these newfags that assumes green text has a quote only implication?

You should have understood my first post, but i decided to make it easier on you.
>>
>>59955068
sauce pls
>>
how exactly can i use recursion on linked lists? is it to remove elements?
>>
File: 1491319629754.jpg (801KB, 1277x3197px) Image search: [Google]
1491319629754.jpg
801KB, 1277x3197px
>>
>>59957184
What do you want to do?
>>
>>59956895
Interesting stuff, I'll check it out. May I ask what you do/what kind of data you are working with? It's always interesting to hear what companies/people are doing with big data/ML/ect.
>>
>>59957184
on every linked list operation, even measuring the length or accessing an element. recursion is base case + extension, and any node in the linked list is either the base case or has a pointer to another node that can be recursed on.
>>
>>59957184
Recursion can often be avoided with a for/while loop.
Especially with lists.
>>
>>59957237
i'm reading about linked lists and i'm curious about how/when to use recursion instead of the usual while
i kinda suck trying to think recursively tho
>>
>>59957254
>avoided with
*reduced to
>>
>>59957254
i've made enough lists without recursion, i just want to force its use actually
>>
>>59957271
>i kinda suck trying to think recursively tho
keep trying, it's eye-opening when you get it. Maybe try reading about recursive math proofs? It's like spinning on yourself, or eating your own tail as a snake. it's vertigo-inducing.
>>
>>59957271
void freeArrayListFunction(ArrayList *al, void (*f)(void *)) {
ArrayList *temp;
int i;
while(al) {
temp = al->next;
for(i = 0; i < al->curEles; i++) {
// free(arrayListGetPointer(al, i));
// Calls *f (the free function) on the pointer of index i.
(*f)((void*)(&al->data[al->eleSize * i]));
}
free(al);
al = temp;
}
}

the function passed called freeArrayListFunction because it contains an arraylist that needs to be freed via the same function.

>>59957293
I hope ur processor has enough cache space for your recursive ass AND all the programs ur running.
>>
>>59957320
recursion is supposed to be elegant, anon. wtf is this crufty shit? it's not even recursive.
>>
>>59957239
most of the work I do currently is for the automotive industry (self driving cars) or financial industry (automating asset management, etc.)

I get a lot of different things coming my way though. One job was to figure out what demographics enjoyed their services the best. Another wanted to use ML to create user demographics based on purchases. I've gotten to work a lot with embedded devices as well and aggregating sensor nets + using ML to draw conclusions from sensor data. I have also gotten to do some signal processing.
>>
>>59957132
>does if (0) undefined; reduce into undefined?
If it can provably never be reached it doesn't change the meaning of the program either way and can be safely ignored.
>maybe your programming challenge will eventually become a comfi static checker
I think something which rewrites programs is already sort of a static checker.
>>
>>59957344
its recursive via the sub function.
If you dont think this is elligent, i implore you to either make it so, or shut your mouth.
>>
>>59957320
>I hope ur processor has enough cache space for your recursive ass
Have you never heard of TCO or are you just retarded?
>>59957344
>recursion is supposed to be elegant
It's not supposed to be anything.
>>
>>59957360
show a complete program that runs this, because that's not recursive, that's just a nested call. Unless you believe that *f could be freeArrayListFunction, which I assure you it doesn't typecheck. Try running your shitty programs before you embarass yourself. Anon please you can't illustrate anything with half-assed broken examples. and If you meant wrapping freeArrayListFunction into a void(void*) function then FUCKING DO IT!
>>
>>59957293
Recursion is just a shitty way to perform loops.
>>
>>59957424
unless it equates to less bytecode
>>
>>59957424
i heard it could make my list shorter/easier to write but the only function i can think of is recursively destroying the list
>>
>>59957412
never heard of tco
>>59957420
Ill post the other functions,

void freeJalbFile(void *ptr) {
printf("freeJalbFile(%p) : %d\n", (*(struct dirFile**)ptr), (*(struct dirFile**)ptr)->id);
if((*(struct dirFile**)ptr)->id == 0) {
struct dirFold *fld = *(struct dirFold**)ptr;
freeArrayListFunctionSave(&fld->files, freeJalbFile);
}
dirFile*)ptr)->name);
free((*(struct dirFile**)ptr));
}
>>
>>59957442
Everything you do with a loop you can do with a recursive function. (reverse is not true)

Want a detailed explanation here or a link to a good introduction on the web?
>>
>>59957474
gimme the introduction
>>
>>59957463
>never heard of tco
You should look it up then, you sound like a retard when you try to talk about things you don't understand.
>>
>>59957474
>reverse is not true
w r o n g
>>
>>59957463
WTF is jalb? dirFile? freeArrayListFunctionSave? It's not even complete and there's already syntax errors. This is never going to be a good example, it's should show what's being talked about with minimal cruft around it, and it's absolutely not. And it's not fucking functional ffs, wtf are you doing?
>>
>>59957474
>Everything you do with a loop you can do with a recursive function.
Recursively sum all primes under 2 gorillion then, faggot.
>>
>>59957474
>(reverse is not true)
Yes it is.
Loop + stack = recursion.
>>
>>59957474
>Everything you do with a loop you can do with a recursive function.
False. Because the heap is considerably larger than the stack, therefore recursion is always more limited.

Also, recursion is always slower. For instance, computing the Fibonacci numbers recursively results in repeatedly computing the same thing over and over, instead of reusing already done computations.

There is literally no reason to ever use recursion in the real world.
>>
>>59957474
They are equivalent.
>>59957559
In what way would that prove his statement?
>>
>>59957606
>Because the heap is considerably larger than the stack
You don't need to invoke either concepts to show that they are equivalent.
There exists a Turing complete language with loops, but without recursion. And there exists a Turing complete language with recursion, but without loops.
>>
>>59957544
Ive found a wikipedia article but that is more economic then programatic.
Plz give me a quick rundown.

>>59957557
void freeJalbFile(void *ptr) {
if((*(struct dirFile**)ptr)->id == 0) {
struct dirFold *fld = *(struct dirFold**)ptr;
freeArrayListFunctionSave(&fld->files, freeJalbFile);
}
free((*(struct dirFile**)ptr));
}


Its like 8 lines, can you not understand it?
Its the example your looking for.
It works perfectly.
>>
>>59957642
Nice abstractions, faggot. I was talking concretely.
>>
>>59957655
>Plz give me a quick rundown.
No, I don't help retards.
>>
>>59957463
>>59957474
>>59957496
>>59957544
>>59957545
>>59957557
>>59957559
>>59957602
>>59957606
>>59957608
>arguing about recursion methods
>writing C and using recursion for basic file IO because we should all live naked in caves
>>
>>59957671
>Nice abstractions, faggot.
Are you retarded by any chance?
>I was talking concretely.
What you said is outright false as shown in my post.
>>
>>59957354
Shit that sounds cool, you a consultant or work for some company?
>>
>>59957672
I assume your an uneducated person, considering you can not even start to explain your "education".
>>
>>59957697
I am. What's your point though?
>>
>>59957681
>arguing about recursion methods
>writing C and using recursion for basic file IO because we should all live naked in caves
Who said all of that?
>>
>>59957693
I am consultant. I prefer it tenfold over working for one company. I get to do lots of interesting things, and go from project to project often enough that I never feel stale regarding what I am learning or doing. I also don't get treated like a bitch because I walk in the door knowing my value. The downside is I am often brought in because a problem exists in the company that requires outside help to solve. Usually when I show up it is a bad signal to developers at that company to get their heads out of their asses.
>>
>>59957686
>Are you retarded by any chance?
Nice ad hominem.
>What you said is outright false as shown in my post.
You didn't show jack shit, you just mentally masturbated.

I have an actual machine here, right in front of me, and I can show you CONCRETELY, IN PRACTICE, FOR REAL the difference between the stack and the heap.

Take your abstractions and fuck off, you idiot.
>>
>>59957496
well to be honest I have nothing handy that I find to be a good /recursion for dummies/ text and it's subjective anyway, so there. Duckduckgo that, read multiple things or watch videos until you find a combination of resources that makes it click for you, we're all different. Now if you excuse me, this thread is full of retards and I have to bust them....
>>
>>59957693
>>59957735
> I am consultant
I meant I am a consultant. Rofl that sounded pretty fucking haughty.
>>
>>59957725
I thought you were banned?
>>
>>59957745
>Nice ad hominem.
You don't seem to understand what that even means.
"You're a retard." isn't an ad hominem.
"You're a retard, therefore your argument is incorrect" is an ad hominem.

>You didn't show jack shit
I showed your """""argument""""" to be false. You claimed that they're somehow not equivalent.
>and I can show you CONCRETELY, IN PRACTICE, FOR REAL the difference between the stack and the heap
The stack and the heap are irrelevant when talking about the equivalence of looping and recursion.
The statement "all loops are equivalent to recursion" doesn't say anything about efficiency.
>Take your abstractions and fuck off
Irrelevant. My statements tell more true things about reality, you can fuck off instead with your basic lack of knowledge and unwillingness to admit that you said something retarded.
>>
>>59957606
>For instance, computing the Fibonacci numbers recursively results in repeatedly computing the same thing over and over
(define fib
(lambda (n)
(fib-3 1 1 n)))

(define fib-3
(lambda (x y n)
(cond n
(1 x)
(2 y)
(3 (+ x y))
(n (fib-3 y (+ x y) (- n 1)))))

Well?
>>
>>59957745
>the difference between the stack and the heap.
it's true of only so many implementations of so many languages on so many computers, but it isn't anywhere close to being true in absolute terms. Did you know virtual machines allocated heap space to store a stack on? What a mind-blowing thing. There's this paper by RMS about stacks that stop being stacks once it's not convenient anymore, and tail call optimization, and continuations, and coroutines, and closures, and all the stuff that makes up other programming paradigms you're unaware of.... Recursion is first and foremost a platonician mathy concept that has various interpretations in the computing world, and I guarantee you you depend on them every day without knowing it.
>>
>>59957827
You're too dumb. You think that just because both are THEORETICALLY equivalent, that must mean both are equivalent in practice. You've obviously never programmed anything, else you'd know. You've obviously never seen a stack overflow. You're just full of theoretical book knowledge but have never done anything practical. Probably never written a single line of code.

Just because in theory electric motors are equivalent to internal combustion engines, in practice both have very fundamental differences.

Stop embarrassing yourself already.
>>
>>59957877
What esoteric programming language is that?
>>
>>59957878
>Did you know virtual machines allocated heap space to store a stack on? What a mind-blowing thing.
Thanks for proving me right, jackass. I said the heap is greater than the stack.
>>
>>59957909
C+-
>>
File: haskell.png (12KB, 225x321px) Image search: [Google]
haskell.png
12KB, 225x321px
>>59957877

Now in a language normal people are able to understand, please.
>>
>>59957606
Explain to me what the fibonacci suite is without any recursion, even hidden. Now no one is saying evaluating this definition literally as a program yields unbelievable results, but if you give a dynamic programming spin to it you can arrive at your typical iterative fibonacci while having demonstrated that it's equivalent to the canonical definition.
>>
>>59957943
>4chan
>normal people
>>
>>59957898
>You think that just because both are THEORETICALLY equivalent
"theoretically" is a retarded and meaningless term here. My previous post shows beyond any doubt that it is simply impossible to have a loop which can't be translated to recursion, and vice versa.

Also you don't seem to understand what "equivalent" even means. Two things being equivalent doesn't somehow mean that they will be exactly the same in terms of efficiency or actual implementation.
>You've obviously...
All of the rest of your statements are retardedly false.

>Just because in theory
Using a theory to show that two things are equivalent doesn't mean that they won't be equivalent in practice.
>in practice both have very fundamental differences.
Which the statement about their equivalence doesn't say anything about, meaning that when someone says "x is equivalent to y", he doesn't somehow imply that they are exactly the same in terms of implementation. You're just too retarded to grasp this basic concept.
>>
>>59957992
>>59957877
>actually debating on 4chan
guyz your mad.

now let's get back to traps are GAYYYYYY
>>
>>59957735
Do you mind then if I ask you a semi-related "life advice" question then?
>>
>>59958051
sure, as long as you understand fully that i'm 28, unmarried, and a massive stoner. I do get paid well enough to live very comfortably and buy stupid shit though.
>>
Alright /dpt/ help me figure something out

I have the letter X, Y, Z and A
I have a list of words that start with those letters and I have to sort them, so that Y is first, then Z, X and A

came up with the idea to map those letters to numerical values, then just compare them with each other and see which one is greater

but isn't there a more intuitive way of going about it? what if I had 500 letters?
>>
>>59957992
>My previous post shows beyond any doubt that it is simply impossible to have a loop which can't be translated to recursion, and vice versa.

You're moving goalposts. You can translate any loop to recursion, but that recursion will often be less efficient or not work at all. Thus, "Everything you do with a loop you can do with a recursive function" is a false statement.
>>
>>59957436
If it is equivalent to a loop, ie simple recursion, that's unlikely. If it's not simple recursion then stack space is involved and less "bytecodes" isn't a useful metric.
>>
>>59958112
what's your language?
>>
>>59957956
Just because the definition is recursive, doesn't mean the fastest implementation is recursive. You're confusing the things I said. Here's an efficient implementation of Fibonacci:
private static BigInteger Fibonacci(int n) {
BigInteger p = BigInteger.Zero;
BigInteger q = BigInteger.One;
for (int c = 31; c >= 0; c--) {
BigInteger r = p * (q * 2 - p);
BigInteger s = p * p + q * q;
p = r;
q = s;
if ((((uint)n >> c) & 1) != 0) {
BigInteger t = p + q;
p = q;
q = t;
}
}
return p;
}

As you can see, it's not recursive.
>>
>>59957992
Nice goalpost moving, faggot. Fuck off already.
>>
>>59958112
i don't even get what you're asking
>>
>>59958141
let's go with C
>>
>>59958122
>but that recursion will often be less efficient
I never said anything about efficiency, neither did you. You made a retarded claim that they are somehow not equivalent.
>or not work at all
Assuming it was translated correctly, that would be impossible.

>Thus, "Everything you do with a loop you can do with a recursive function" is a false statement.
>You can translate any loop to recursion
You just contradicted yourself.
>>
>>59958169
The original point is equivalent to "They are not equivalent".
My post shows why this is incorrect, in what way is that "goalpost moving"?
>>
>>59958154
>Just because the definition is recursive, doesn't mean the fastest implementation is recursive.
Don't remember implying that.

Prove to me that this program is correct. (i. e. effectively computes the fibonacci number n like it's supposed to do) You are going to use recursive reasoning along the way, there's just no way around it.
>>
>>59958154
(defun fib (n)
(let ((x (list 0 1)))
(cond ((= n 0) (first x))
((= n 1) x)
(t (dotimes (i n x)
(setf (cdr (last x)) (list (+ (nth i x) (first (last x))))))))
(values x (reduce '+ x))))
>>
>>59958206
I admit I'm curious about this implementation, irregardless of wheter it's not unrecursive or else. I'll look into it, thx.
>>
>>59958174
I have to sort a list of words
those words all start with the given letters
I can't sort them in normal alphabetic order, but the order I described

what's the best way to achieve that?
>>
>>59958185
>I never said anything about efficiency, neither did you.
Okay, let's go back to my first post: >>59957606
>recursion is always slower

There. You can stop lying now.

>>59958200
It is, and you're too dumb to realize. You're also intellectually dishonest, because I was the first to school you on theoretical and practical differences, and yet here >>59957992 you arrogantly tried to claim I'm too retarded to "grasp the basic concept" that "when someone says 'x is equivalent to y', he doesn't somehow imply that they are exactly the same in terms of implementation", which is precisely what you couldn't understand and that I explained to you here >>59957898.

Leave college and write some actual code kid. Then we can talk.
>>
>>59958247
That was buggy (was trying to experiment with multiple values and forgot to edit the code).
(defun fib (n)
(let ((x (list 0 1)))
(reduce '+ (cond ((= n 0) (first x))
((= n 1) x)
(t (dotimes (i n x)
(setf (cdr (last x)) (list (+ (nth i x) (first (last x)))))))))))
>>
>>59958251
in many languages, you can give sort a parameter which is a function to apply to the items before sorting them

python:
sorted(lambda x: x[0], mylist) i think it'd be
>>
>>59958251
separate them in different arrays or whatever and sort them separately
them create another array and put them in the order you want
i can't help you more than this because i don't know how to sort things
>>
>>59958206
>>59958267
I just picked up Lisp (using sbcl) it's really getting me excited about programming again. (coming from Asm, C, Python, Scala)
>>
>>59958267
Is it emacs-lisp, common lisp, or both btw? It's been a long time since I practised the lisp arts.
>>
>>59958285
Congrats anon! That's one more dick in the ass of the ignorant codemonkeys itt.
>>
>>59958065
I have found age has had little correlation (past a point) to wisdom. I just recently graduated uni, and have come to a stark realization that I am not as intelligent/knowledgeable as I should be to be acting/carrying myself as I am. Now, I don't think I am unintelligent (I went to a good school, and got very good grades, ect), but I have become cripplingly locked-up when applying to companies because I feel like a fraud/newbie. Does everyone feel this way at some point? Many of my peers (friends, colleagues, ect) went on to get jobs at prestigious places, but I have become fixated on the fact that my pride has allowed me to act cocksure for so long, but the reality is I need to have answers I am 100% sure about, not 90%.
>>
>>59958255
>recursion is always slower
I didn't argue with this. It isn't what I initially addressed, which was your outright retarded statement "Everything you do with a loop you can do with a recursive function" is a false statement."
>because I was the first to school you on theoretical and practical differences
Is this a retarded way of saying "implementation differences"? It doesn't make sense for something to be true, but somehow not true at the same time.
>Leave college and
How can you leave something you don't attend? I'm not subhuman.
>write some actual code kid
What is "actual code"? Is it like "fake code", but the opposite?
>>
anybody done anything with haxe
>>
>>59958280
and where in that code do you define the function used to actually compare them?

I had pretty specific requirements for that
>>
>>59958285
Using SBCL too, though ECL is worth looking at.
>>59958267
Common Lisp. I was aiming for a kind of obfuscated approach, so I don't think this is an example of good code.
>>
>>59958200
>My post shows why this is incorrect
But they only are "equivalent" under perfect conditions and making a lot of assumptions, but in practice they aren't. This >>59957474 guy said:

>Everything you do with a loop you can do with a recursive function.

But that is only true mathematically, not in the real world. Given a real world computer, both are only equivalent until the recursive version gives you a stack overflow, and then the iterative one keeps going, and then you realize they aren't really equivalent.
>>
>>59958322
That was meant for >>59958286
>>
>>59958185
>I never said anything about efficiency, neither did you. You made a retarded claim that they are somehow not equivalent.

I'm not the guy you've been arguing with.

>Assuming it was translated correctly, that would be impossible.

No it's not and you're only making yourself look more ignorant.

>You just contradicted yourself

I did not. You can translate it in the sense that you can write valid code that uses recursion in place of loops, but the moment you run that code is when problems arise.
>>
>>59958308
>your outright retarded statement "Everything you do with a loop you can do with a recursive function" is a false statement."
It's only retarded until you get a stack overflow. Enjoy.
>>
>>59958302
you shouldn't let this stop you at all. For the longest time I felt like I was a liar and a fraud and it's simply because all my experience was book smarts and not street smarts so to speak. It just took time to realize "oh yeah, I do this better than most" and there are times I still feel small. It's just being human. You don't build confidence through words, you build confidence when something you build works. Just take pride in the work you do and don't let people trying to give you feedback or advice bring you down--most of the time that advice that is hardest to hear makes you better.

adopt this motto, and tell people this is your motto "Even if I don't know what it is, it doesn't scare me." It doesn't matter that you don't know. What matters is you show the confidence to admit that even if you don't know, you'll know it soon enough--and better than they do.
>>
>>59958205
>You are going to use recursive reasoning along the way, there's just no way around it.
Yes there is, you mathematical illiterate. You just have to use mathematical induction. Prove it is correct for n=1 and then prove if it works for n then it works for n+1. There.
>>
>>59958302
I think I have a similar inhibition anon. I know I can be strikingly assertive but I've also learned I speak too fast, and I make a fool of myself sometimes. Haven't had an interview yet, but I'm preparing for uni rn. How sociable are you? Had any romantic relationships? (I haven't)

I enjoy philosophy and I have non-autistic philosopy-studying friends. I'm pretty confident it'll help a bit on the long run because there you can discuss for hours while being allowed to be unsure about the details and sperging about the definitions...
>>
New thread:

>>59958401
>>59958401
>>59958401
>>
>>59958327
>perfect conditions
There are no conditions under which a loop isn't equivalent to recursion. It simply isn't possible.
Please learn what "equivalent" means before making such retarded posts. When I say "loops are equivalent to recursion", I don't somehow mean that they will perform the same.
>But that is only true mathematically, not in the real world
What is the real world? Is there a fake world?
Something true mathematically is true in any other way, and vice versa.

>>59958345
>No it's not and you're only making yourself look more ignorant.
Only if your definition of "work" somehow implies efficiency.
>I did not.
You agreed with "loops are equivalent to recursion", then you disagreed with the same statement. In what way is that not a contradiction?
>but the moment you run that code is when problems arise
Something being less efficient is irrelevant when discussing equivalence, which is all I was doing.

>>59958359
Only if you are brain dead (which I assume you are) and don't know about TCO.
>>
>>59958399
That's recursion anon. proof of step n is used recursively inside proof of step n+1, and you also have a base case, just like recursive functions. ever heard of the Curry-Howard correspondence?
>>
>>59958446
>induction is recursion
Damn, /g/ is stupid!

Actual mathfag here, why is it that computer scientists like to think they know math when they don't?
>>
>>59958550
This thread is pretty retarded so I wouldn't be surprised.
>>
>>59958550
>induction is recursion
He didn't claim that. Look up "Curry-Howard correspondence".
>>
>>59958589
>induction is recursion
to be fair it looks like I'm kind of implying that but not quite. To clarify for the self-proclaimed mathfags know-it-alls: proof by induction is recursion applied to inductive logic. Prove me wrong. When I was in high-school, induction was to me an electrical phenomenon, and recursion was a subject we were doing in math along with suites. Now I've discovered the term "proof by induction" and I understand the nuance, but it's nonetheless a recursive process.
>>
>>59958550
1.
I don't think anyone making that claim can be a computer scientist really, it's such a trivial math concept.
2.
He didn't say that.
3.
Yes computer scientists often step into situations they know nothing about and start claiming things. We have this all the time with CS people trying to do programming with horrendous consequences.
Thread posts: 320
Thread images: 34


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