[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

/dpt/ - daily programming thread


Thread replies: 323
Thread images: 24

File: i-love-xml-280x300.png (37KB, 280x300px) Image search: [Google] [Yandex] [Bing]
i-love-xml-280x300.png
37KB, 280x300px
<dpt>
<edition>XML</edition>
<old>54660278</old>
</dpt>
>>
>>54665664
>xml
>any year
>>
JSON fags on suicide watch
>>
>>54665657
>application of concepts
>pointer
>a way to reference an piece of memory
It's incredibly simple. The most difficult thing about pointers would be function pointers imo because the C-syntax for function pointer types is a little bit weird imo. It makes sense, but it's just different from everything else.

Applying pointers is just about pointing at shit and dereferencing them.
>>54665655
>Memes
I'm genuinely perplexed by the idea that you'd name a book like that. If your goal is to teach how to handle data in a program that's a broader topic than pointers.
>>54665670
Yeah. If you're just dealing with your own codebase. I also turn it off unless I'm using something new. If you're learning a new library (the way I learn to use libraries anyway) it's useful because it's like a mini-documentation/typing assistance.
>>
What do you guys use for your projects?
Should I use visual studio community or visual studio code?
>>
>>54665664
>XML
>not S-expressions
I hope Terry Davis kills you with his car.
>>
File: 1111.jpg (88KB, 900x533px) Image search: [Google] [Yandex] [Bing]
1111.jpg
88KB, 900x533px
>>54665589
>Restrictions?
not sure what you mean, the plan was to make a server and a client project and I haven't really thought that much about features. Was thinking of having a simple contact list or a way to tell when a person is online, maybe support some images, emojis or whatever the fuck like in MSN.
I tried doing it in C# because that's what I've been using as of late due to classes(well that and Java, but fuck Java). Haven't used C++ in 2-3 years but I want to try learn QT in this short time if possible.
Problem with C# is, I couldn't get it to connect to the server at all and I'm having difficulties understating these EventHandlers.
The other 2 projects shouldn't be THAT difficult, but it is a pain in the ass considering one is to make a functioning Android app and the other is to make a simple working Unity game.

I really should make atleast something half-functioning in the next week so I can show it to my mentor and discuss further progress. Not to mention I need to write a paper on it and I haven't even started.
fuck
>>
>>54665664
>XML
8/10 ruse, I'm mad
>>
>>54665739
Code only supports web-based projects I think. I don't even think it has compiling capability.
>>
>>54665739
I use pycharm
>>
>>54665777
VS Code supports anything when you install the proper plugin.
>>
>>54665664
</dpt>

/thread


>>>/prog/
>>
>>54665790
Isn't that python only?
Never used it, only VB, that's why I'm trying to expand.
>>
>>54665842
yeah, but there are other jetbrains ides
>>
>>54665823
>prog
I wish.
>>
>>54665750
>I couldn't get it to connect to the server at all and I'm having difficulties understating these EventHandlers.
Post what you're doing.
>>
>>54665858
Are there only free trials available and no free versions?
They seem like they work crossplatfrom, are there better options out there for database building and general C/C# writing?
>>
>>54665928
It's free if you're a student, and it's also free for open source dev
>>
off the top of my head, I've barely practiced this. Is this correct?

  1 #include <stdio.h>
2 #include "struct_items_consumable.h"
3
4 void display_all(struct items_consumable *p);
5
6 void dispay_all(struct items_consumable *p) {
7 int *pend = p + (sizeof(p) / (sizeof(items_consumable));
8 for(; p < pend; p++) {
9 // do stuff for each struct member
10 }
11 }
>>
>>54665981
>
int *pend = p + (sizeof(p) / (sizeof(items_consumable));

No, that part is horribly wrong. sizeof(items_consumable) will return the size of a pointer, it looks like you're confusing that with sizeof an array.
>>
>>54665981
You should pass the size of the array to the function.
>>
So, I programmed pretty much one of my first actually useful programs (in C). While programming it, I always started it right from terminal and everything worked. Next I wanted it to start from the file manager, but turns out, it doesn't. It segfaults. The reason is (or so I figure) that my program needs several files that it can't find when I'm starting it from the file manager.

Is there any way to somehow explain to the program where to find those files, or even better somehow include the files (bitmaps) directly into the binary?
>>
File: 1418658712361.gif (458KB, 360x240px) Image search: [Google] [Yandex] [Bing]
1418658712361.gif
458KB, 360x240px
How do you guys are so passionate about programming?

I know basics about programming and some languages at beginner level and I want to learn more languages, but I fail everytime to improve myself. When I learn basics about some programming language, I immediately lost my interest to it. Also, I have no idea about what I'm going to do after I learned basics.

What should I do after learning basics?
>>
> implying xml is a real thing


AHHAHAHAHAHAHAHAH
>>
>>54665885
it's gone, I remember using Tcplisteners and Tcpthreads for connecting
>>
>>54666061
Get the Algorithm Design Manual

If you don't enjoy algorithms, CS/programming might just not be for you
>>
File: YotsubaRealGood.png (40KB, 128x331px) Image search: [Google] [Yandex] [Bing]
YotsubaRealGood.png
40KB, 128x331px
>>54666061
The secret is to have FUN.
Do things because you want to, not because you feel you have to, or you'll have no motivation and you'll be miserable.
>>
>>54665976
How do I prove I'm a student though?
When I try to download datagrip, it says that it's a 30 day trial.
Also, what's the main difference between datagrip and other IDEs?
>>
>>54665997
>>54666029
Alright, thanks.

Guess I'll try out things until I get the correct values.
>>
>>54666061
Start a project you find enjoyable. Protip: make something useful.
Don't listen to >>54666088, programming isn't all about algorithm design.
>>
>>54666095
Not him, but I just used my university email. Go to their site, they'll explain what you need to do.
>>
>>54666214
Im from the EU though
>>
>>54666353
And I'm in South Africa.
>>
Personally I prefer the HTML programming language over XML
>>
>>54666426
>USER HAS BEEN WARNED FOR THIS POST
>>
>>54666426
You're one of those special snowflakes in the YouTube ads about learning programming and can be clearly seen writing in HTML.
>>
>>54666061
this: >>54666191

don't learn programming "just because", learn it because you want to make some freaking cool shit
>>
how do i program a robot to feed old people SERIOUS REPLIES ONLY
>>
>>54666483
Admittedly, what puts a lot of people off is coming up with ideas. But really, whatever you want to do just do it. Hell, maybe you won't have the ability just yet to complete it but you'll learn along the way and be better for it.
>>
>>54666527
rewrite the linux kernel in haskell first then code a kernel module in clojure for the robot
>>
>>54666527
>helping old people
>>
>>54666528
I lack the idea to make something.
I dont want to make a simple game but I also dont have an idea to make some programs...
>>
Does anyone here attempt the Project Euler problems?
>>
>>54666629
>Project Euler
pretty useless if you want to be a programmer tbqh it's too math focused
>>
>>54666658
I was looking through it and it seems it'd be useful for learning and utilising data structures and such
>>
What's a nice name for a struct holding information of a file or directory?
>>
I get errors when I try recompile apk that I unzipped and browsed through. I imported everything into the thing that you make shit in.
>>
>>54666757
_info_t
>>
>>54666783
That's not how you use a toilet, Pajeet.
>>
If you have,

int a,b,c,d;
long double result;


Do you have to...

result = ((long double)a/(long double)b)*((long double)c/(long double)d);


Or is,

result = (long double)(a/b)*(c/d);


sufficient?
>>
>>54666629
>>54666711
i don't do them but they can be good exercises if you're mathematically inclined, you have to come up with clever algorithms and use data structures efficiently
>>
>>54666865
result = ( (long double) a / b ) * ( (long double) c / d );
>>
>>54666889
result = (long double) a / b * c/ d;
>>
>>54666903
not equivalent
>>
>>54666911
equivalent
>>
>>54666919
not even if they were integers would they be equivalent, you have to watch for overflow and for floats there are accuracy concerns
>>
>>54666945
>floats
they're long doubles; opinion discarded
>>
>>54666956
they're floating-point numbers, sperg
>>
>>54666970
not floats tho; git gud
>>
>>54666980
you think >>54666903 is equivalent to >>54666889, you're the one who should git gud
>>
>>54666993
> he thinks >>54666889 is equivalent to >>54666865
>result = (long double)(a/b)*(c/d);
anon...
>>
File: 1363324278434.jpg (138KB, 500x1125px) Image search: [Google] [Yandex] [Bing]
1363324278434.jpg
138KB, 500x1125px
Disgusting hack of the day:
An easy way to send a char to a function expecting a char* thanks to little-endian abuse!

void foo(char* str);

for (short c=0x00; c<=0xFF; ++c)
foo((char*)&c);
>>
>>54666857
At least I can reach to wipe my ass, you fat fuck american.
>>
>>54667013
>result = ((long double)a/(long double)b)*((long double)c/(long double)d);
fuck off with this shitty bait
>>
>>54667013
>(long double)(a/b)*(c/d)
Not him, but that isn't equivalent to his solution:
(long double) a / b * c / d

In the first, c / d does not result in a long double
In the second, because of left-to-right associativity, the entire thing is long double
>>
>>54667046
>result = (long double)(a/b)*(c/d);
t. mental illness
>>
Things /g/ can't do:
- average 2 ints
- initialise a two-dimensional array
- divide 4 ints with the result being a floating point number
>>
>>54667066
you're fucking retarded
>>
>>54667072
here we go again
>>
>>54666889
I'm actually trying to compute (a/b)^(c/d) to high precision.
I heard that using ++ or -- on a floating-point data type is bad style, so I keep them as ints and typecast them before passing them as arguments.

int a,b,c,d;
long double result;

// compute (a/b)^(c/d)
result = powl(a/b,c/d); // result of (a/b) implicitly cast to (long double) before being passed?
result = powl((long double)a/b,(long double)c/d); // b implicitly cast to (long double) before dividing a?
result = powl((long double)a/(long double)b,(long double)c/(long double)d); // possibly redundant, looks ugly, but makes super duper sure it works
>>
Why is compiling on Windows so horrible? I ported my program to both Mac OS X and Linux and it worked just fine in a few minutes. On Windows on the other hand I have no fucking clue how to do anything, nothing fucking works, everything seems so horribly convoluted.
>>
(long double) a / b * c / d

This is sufficient. a / b is a long double. The result * c is a long double. The result / d is a long double. Nothing lost unless an overflow occurs
>>
>>54667121
>developing on Windows
Biggest modern meme so far. Even OS X is better for this, and that says a lot
>>
>>54667110
the first one is wrong, they get divided as ints with truncation
>>
File: xml.png (26KB, 496x320px) Image search: [Google] [Yandex] [Bing]
xml.png
26KB, 496x320px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

>>54665695
>>54665664
pic

>>54666629
The easiest machine applications are the technical/scientific computations.

>>54666865
inline double foo (double a, double b, double c, double d)
{
return (a / b) * (c / d);
}


>>54667072
What programming language ?
>>
>>54665664
Literally only use for RSS feeds and Google shopping.
>>
>>54667124
float a = 1e30f;
float b = 1e34f;
float c = 1e30f;
float d = 1e30f;
System.out.println(a / b * c / d); // 1.0E-4
System.out.println((a / b) * (c / d)); // 1.00000005E-4


same principle applies to long double, not just float

kill yourself
>>
>>54665739
Community
Code is basically for Linux/OS X or for general editing and external building (like rust or go)
>>
>>54667214
another example

float a = 1e34f;
float b = 1e30f;
float c = 1e34f;
float d = 1e30f;
System.out.println(a / b * c / d); // 9.9999992E7
System.out.println((a / b) * (c / d)); // 1.0E8


they're not equivalent
>>
>>54666757
Inode
>>
>>54667214
>>54667231
>java
>being used as a metric for anything
cool meme
>>
>>54667244
same thing happens in other languages you buffoon
>>
>>54667136
No it doesn't say a lot
OS X is UNIX certified
>>
>>54666089
>>Help programming isn't fun and doesn't hold my interest, wat do?
>The secret is to have FUN.
That's some "just be yourself" tier shitposting.
>>
I have a RDF/XML file (that is, RDF in XML notation).
This looks like:
<?xml version="1.0" encoding="UTF-8" ?>

<rdf:RDF
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<someThing>
<someData rdf:datatype="http://www.w3.org/2001/XMLSchema#long">data</someData>
</someThing>
...

</rdf:RDF>


I know created a separate XML Schema file where I created a few xsd:simpleTypes (mainly integers with restrictions). How can I "include"/import this local file correctly in my main file so I can use these new XSD datatypes in my data?
I'm absolutely unable to find any useful hints...
>>
>>54665823
We gotta restore it. We gotta do it. /prog/ was a great board. Tremendous people. You can't have a board without borders. /v/. They are sending their people. And believe me, they are not sending their best. Believe me. We're gonna make /prog/ great again. It's gonna be so great.
>>
>>54667256
nice meme
>>
>>54667289
weak bait
>>
>>54666061
>>54667260
The joy of programming come with Lisp.

http://www.braveclojure.com/

Join the master race, become a lisper.
>>
>>54666629
Yeah. Got to 51 a few months ago during the beginning of the semester. Haven't gotten any time now to work on it. It's fun if you like solving math problems.
>>
What does /dpt/ know about VLAs?
>>
>>54667310
>implying clojure is a real lisp

heh
>>
>>54667339
they're a meme
>>
>>54665664
doing an svg project for school does that count?
>>
File: kot ghoul.png (2MB, 1217x879px) Image search: [Google] [Yandex] [Bing]
kot ghoul.png
2MB, 1217x879px
>>54666061
https://www.coursera.org/learn/learning-how-to-learn
I offer this course everywhere. It is #1 thing you should study if you want to learn anything (or do anything) and procrastination obstruct you of doing it.
Really. For 8 years I wanted to learn so much thing, but couldn't finished even one. I abandoned after week or month. And for last 6 month I practiced techniques from this course and now I am able to do things I want to do up to like 30 hours / week. Yes, you won't be able to do it right off the bat, you need to practice. Start with small steps.
Many universities make notes about that theme for their students, cause it is hard to success without knowing that things.
http://bsc.harvard.edu/procrastination
But try at least the first link I gave you. It is free.
>>
Is it OK to be accessing properties of objects that belong to other objects etc.. in this way or is there a better and more widely accepted way of doing it? Should I just never need to access properties more than one object away?

gif_image = self.picpanel.save_pic
full_path = self.picpanel.video_object.path
filename = self.picpanel.video_object.filename
>>
File: JUST.jpg (27KB, 600x424px) Image search: [Google] [Yandex] [Bing]
JUST.jpg
27KB, 600x424px
>working at a bank
>data exchange between front and back end is done via XML and will be doing so for at least another 10 years
>>
>>54667110
>I heard that using ++ or -- on a floating-point data type is bad style,
Whoever told you that is a retard. If you need to increment a floating point number do it. You just need to now the limits of the IEEE754 standard. In the case of incrementing integer numbers coded as doubles incrementing that number above 2^53 won't work.
>>
>>54667395
is that python? anything goes in filthy python, i'm surprised you're even using OOP in python in the first place
>>
>>54667424
>2^53
long double is often more precise than double, so it might go higher than that while maintaining full integer accuracy
>>
>>54666061
yeah unless you enjoy it or have a goal in mind like a program you want to make, then you'll lose interest quickly and forcing yourself won't do much good. and since it seems you don't find programming particularly fun, think about what you want to do with it once you gitgud
>>
>>54667260
Nah bitch. You've only seen fun from the outside. usually watching your family make bets on when you are getting out of the closet.
>>
>>54667395
Off course it's ok
>>
>>54667476
Oh no. I enjoy programming, not the same person. I'm just making a comment about how retarded and redundant that advice is.
>>
>>54667072
>average 2 ints
int a, b;
((double) a + (double) b)/2;
>>
How do I compile a clojure program?
>>
>>54667513
incorrect
>>
>>54667440
>often
nope
>>
>>54667549
https://en.wikipedia.org/wiki/Long_double
>In C and related programming languages, long double refers to a floating point data type that is often more precise than double precision.
>On the x86 architecture, most C compilers implement long double as the 80-bit extended precision type supported by x86 hardware (sometimes stored as 12 or 16 bytes to maintain data structure alignment), as specified in the C99 / C11 standards (IEC 60559 floating-point arithmetic (Annex F)).

you're fucking lame as shit dude, just blurting out blatantly false statements
>>
>>54667588
inb4 "everyone can edit wikipedia"
>>
>>54667588
nice edit
>>
>>54667594
it should be common knowledge anyway

>>54667599
babby grade bait
>>
>>54665664
>>54660278
>>
>>54667425

pls no bully

I'm not hardcore enough to write my own algorithms but at least I can use le meme snek language to glue together bits and pieces that more competent programmers have written.

from tkinter import *
import subprocess as sp
from PIL import Image, ImageTk
from io import BytesIO
import threading
import json
import os
import time
from collections import deque
from tkinter import simpledialog
>>
>>54667549
Depends on the architecture. On x86_64 on Windows, Linux, and Mac long double is 80-bit or 128-bit.
>>
What's wrong with using C++ as C with classes?
>>
>>54667652
there's nothing wrong with it, it's far superior to using plain C
>>
>>54667525
lein uberjar
>>
>>54666089
The thing I want is to learn, I don't have to learn, I want to, but it is not fun which is not the issue btw. The issue is I don't know what to do.

>>54666191
I have no idea about what to do that is the main issue. If I would have find a project that I can enjoy, I would not asked this question.

>>54666483
What if I have no idea about making cool shit?

>>54667379
Oh, that looks interesting. Definitely going to check this. Thanks.

>>54667441
>yeah unless you enjoy it or have a goal in mind like a program you want to make, then you'll lose interest quickly
Yep, you summarized it very well. I am not saying that I don't enjoy programming, it's fun to learn. However, I don't have a goal or a program that I want to make. So, after a while I get bored and lose interest.
>>
>>54667652
Modern C++ is beautiful.
>>
>>54667687
>C++ and beautiful in the same sentence.
>>
>>54667685
>What if I have no idea about making cool shit?
break the problem down to its components, like if you want to make a 3d game, how do you render a cube? then look up projection matrices and shit like that
>>
>>54667652

The Core C++ guidelines should be illuminating for you. It's a modern language with a lot to offer.
>>
>>54667698
When have you written anything in C++ other than fizzbuzz the last time?
>>
>>54665664

> tfw you can't get the helloworld example from the official website of LWJGL to run
>>
>>54667648
>Depends on the architecture
No, depends on the C implementation.
>>
>>54667763
Yeah, and most C implementations will take advantage of what the arch offers. You are being pedantic.
>>
>>54667738
what errors are you getting? have you set up the dependencies in your IDE?
>>
>>54667788

Yeah, I think

I had to upgrade to java 1.8 and i still get this error

Exception in thread "main" java.lang.UnsupportedClassVersionError: src/HelloWorld : Unsupported major.minor version 52.0
>>
>>54667712
How does it feel being raped by China?
>>
>>54667783
>You are being pedantic.
I'm being correct; not my fault you're making wrong statements. It DOESN'T depend on the target architecture but on the implementation.
>On x86_64 on Windows, Linux, and Mac long double is 80-bit or 128-bit.
This is false. At least on x86_64 on Windows, "long double" is the same as "double" in Microsoft's implementation.
>>
>>54667815

What?
>>
File: 1444270936188.jpg (19KB, 217x320px) Image search: [Google] [Yandex] [Bing]
1444270936188.jpg
19KB, 217x320px
in Java, should I use Class or Interface to make a binding to a C library using JNA?
>>
>>54667805
>Unsupported major.minor version
ahh i had that error for quite some time, i don't remember how i fixed it, it's something about your java JDK/JRE version, not directly related to LWJGL
>>
>>54667855
a class is fine
>>
>>54667652
If somebody wants to call library you made they have to first export C api just because you wanted to drink the OOP coolaid.
>>
>>54667889
>JNA
wait wut
>https://en.wikipedia.org/wiki/Java_Native_Access
>The developer uses a Java interface to describe functions and structures in the target native library.
what is this wizardry, never heard of it until now, sounds by the wikipedia text that you're supposed to use an interface
>>
>>54665664
Hahaha. This made me laugh. BLOG TIME
> be me, senior dev
> our company/startup merges with fortune 500 company
> we have a really good quality of code, awesome client satisfaction rate
> have to use mothercompany API to allow middleware auth microservice to authenticate their users
> it's soap
> k np
> ask for documentation
> "we don't have any"
> ask for an example SOAP request
> they give me one, it doesn't work
> "try changing this"
> still doesn't work
> continues for 2 weeks, I have a single task which is blocked so I just help others in the meantime
SOAP is deaaad. It has been dead since mind 2000s.
>>
File: output _3.webm (2MB, 766x596px) Image search: [Google] [Yandex] [Bing]
output _3.webm
2MB, 766x596px
>>54665664
Particle physics neural networking on GPU, going quite well.

XOR problem solving quite good with low error rate.
>>
>>54667652
Nothing, as long as you don't use shit like overloading because you can't wrap it in extern C, making it MUCH less portable than C, and pushing you farther from C with classes
>>
>>54667907
yeah, I just tried now and it requires interface, since it extends another interface from JNA
problem is everything inside interface is final, and I'm new to Java (accustomed to Python and Ruby) and everything seems 10 times more difficult than ever

idk if i should keep trying with JNA or if traditional JNI would be better in the long run (for sure JNI will be faster)
>>
>>54667872

Yeah, it has something to do with compiling with an old version of Java. I was using the helloworld example which requires the nightly build of LWJGL, which compiles with java 1.8. After upgrading and changing my compiler in eclipse, it still won't even compile

I also had to upgrade eclipse, since apparently the one on the Ubuntu software center is old as hell and doesn't support Java 1.8
>>
>>54667932
i'm using JNI, never tried JNA, imo JNI is not too hard or bothersome, you can use jnigen if you want the "boilerplate" to be generated automatically to help you get started but i don't even use jnigen any more
>>
>>54667843
>>You are being pedantic.
>I'm being correct
No better indicator of autism exists.

> It DOESN'T depend on the target architecture
Yeah, let me just make long doubles 128-bit on my AVR.
>>
woah

>>> from collections import defaultdict
>>> d = defaultdict()
>>> d.default_factory = lambda: len(d)
>>> d.items()
[]
>>> d['test']
0
>>> d['hi']
1
>>> d['test']
0
>>> d.items()
[('test', 0), ('hi', 1)]
>>
>>54667982
You got told, eh? :^)
>>
>>54667970
thanks
>>
>>54667425
>implying using oop is a good thing
>>
>>54667648
>x86_64
>Windows
>long double
>80-bit
>128-bit
it's 64-bit you webshit
>>
>>54668006
Not really.
>>
>>54668036
>all i know is C
babby...
>>
>>54667687
Hahaha no
>>
>>54668052
You sure did: you didn't know what the fuck you were talking about and you were shown your place.
>>
>>54668047
depends on the implementation

>>54667783
the arch offers 80-bit floating point
>>
>>54668054
I know C, Java, Python, x86 asm, Haskell, Scheme, SQL, LaTeX and Go so stfu faggot
>>
>>54668095
>depends on the implementation
muh architecture tho >>54667648
>>
>>54668112
some compilers have 64 bit long doubles even on x86_64
>>
>>54668054
OOP is shit even if you do love OO languages
>>
>>54668047
You mean MSVC, not Windows. It's implementation dependent. It could be 80/128-bit but Microshaft just doesn't give a shit about having a good development environment. GCC on Windows long doubles are 16 byte.
>>
>>54668120
but this retard tho >>54667648
>>
>>54668123
well-written OOP is great for many types of programs
>>
>>54668036
>>54668123
Yeah we've all written things in Haskell a few times, buddy.
>>
>>54668128
>It's implementation dependent
b-but a-achitecture >>54667648
>>
>>54668146
>/g/ is one person
lad...
>>
>>54668112
Windows (non-CE) only runs on x86 and x86_64. x86 chips still have 80-bit floats available back to the before the Pentium, which I believe is the oldest chip Windows can run on.
>>
>>54668128
>Microshaft
you need to be 18+
>>
>>54668158
>muh non-sequitur
how about this fag tho >>54667648
>>
>>54668169
MSVC is shit lol the only excuse for using it is because you're using visual studio for its IDE capabilities
>>
>>54668097
>doesn't even know prolog
okay pajeet
>>
>>54668158
>only runs on x86 and x86_64
false
>>
>>54668123

I used to think this and then I finally got obkek oriented memegramming
>>
>>54668169
I run it on my desktop because I still occasionally play vidya. Xubuntu has been good to me and is a much better dev environment so every other computer I have runs it.
>>
>>54668178
>lol
kids are not allowed here
>>
>>54668199
RT isn't standard Windows. Windows for the desktop and server only run on x86 chips.
>>
File: 1462904653770.jpg (40KB, 700x551px) Image search: [Google] [Yandex] [Bing]
1462904653770.jpg
40KB, 700x551px
>mfw using Django
>>
>>54668218
>RT isn't standard Windows
You don't even know what the fuck you're talking about. What do you consider "standard Windows"? Windows with x86 binaries? Of course, the x86 binaries are not ARM binaries. RT is the Windows build for ARM from exactly the same source code.
>and server only run on x86 chips
Windows Server 2008R2 is supported until 2020 and it works on Itanium. But I guess the Itanium build is not "standard Windows" either for a retard like you.
Fuck off and take this >>54667648 ignorant shit stain with you.
>>
>>54668294
I have plans to try it. Why don't you like it? What do you think is better?
inb4: something php
>>
minimax :: Players -> Lookahead -> Board -> Utility
minimax me lookahead board
| turn board == Finished || lookahead == 0 = evaluate me board
| turn board == me = maximise implicit_game_tree
| otherwise = minimise implicit_game_tree
where
implicit_game_tree :: [Utility]
implicit_game_tree = map (minimax me (lookahead - 1)) next_boards
where
next_boards :: [Board]
next_boards = map (pick_n_destribute board) legal_moves
where
legal_moves :: [Pond_Ix]
legal_moves = filter (legal_move board) [pond_first .. pond_last]

evaluate :: Players -> Board -> Utility
evaluate me board = case me of
Player_A -> (bank_A board) - (bank_B board)
Player_B -> (bank_B board) - (bank_A board)
Finished -> some_shit_that_determines_if_i_like_this_ending
>>
File: 1451683513443.gif (2MB, 400x225px) Image search: [Google] [Yandex] [Bing]
1451683513443.gif
2MB, 400x225px
>>54668320
>Why don't you like it?
Yeah I guess Boi Story 3 didn't really get my reaction through well enough. I love it, I use it for work, and for a hobbyist project that is sure to bring in $ and £.

That being said, if you're going down that path, and this is going a bit off-topic considering this is /dpt/, I would suggest not using another full framework on top like Angular. Django is already fully featured and as battery-powered as you can get.

Extend the View functionality with frameworks that are View-only like Knockout.js or React.js

Anything else you use is personal choice
>>
>>54668382
SLUT
>>
>>54668364
attaboy. now try to sell it.
>>
Okay, so I was reading up on how to sum two integers.
It appears that Samsung has a patent for this shit?
They can sue me if I use that one line of code?
>>
>>54668425
>not wrapping your integers in classes or functions anyway
Are there really people like this in the current year?
>>
>>54667922

> 28000+ bodies
I barely see 30.
>>
>>54668425
Imagine if mathematicians weren't beta and actually patented their work

Calculus requires you to tip
>>
>>54668425
>sum two integers
>It appears that Samsung has a patent for this shit?
No, your information is incorrect.
>>
>>54668425
>>54668474
They do have a patent on averaging two ints though
>>
>>54668382
MOOOOOOOOOODS!
MODS MODS MODS!
>>
>>54668425
software in itself can't be patented in most countries
>>
>>54668318
Wow, you're actually mad we don't know enough about a shitty operating system? I could care less I didn't know server ran on Itanium, or RT is just Win8. I've never used either. And I'll probably forget those facts in the near future. Shouldn't you be churning out Java apps about now instead of wasting time posting on an anime imageboard?
>>
>>54668489
>patent on averaging two ints
No, they don't.
>inb4 US6007232A
Read the claims, dipshit! Oh, you don't understand? Then ask someone to explain it to you before spewing inane memes.
>>
>>54668525
>we don't know
The shut the fuck up and learn.
>I could care less
You could also learn some English.
>I'll probably forget
And keep memeing around, right? Worthless monkey!
>>
>>54668423
I could sell it to many desperate chinese international students who cant do this for $45 each
>>
>>54668552
>You could also learn some English.
>Worthless monkey!
Yeah... I'm the one who wasn't born in an English speaking country.
>>
>tfw refactored obfuscated concurent error passing to clean upward bubbling and centralised handling
>>
File: 1462288972664.jpg (16KB, 640x640px) Image search: [Google] [Yandex] [Bing]
1462288972664.jpg
16KB, 640x640px
My professor doesn't realise that recursion is equivalent to a stack based while
>>
>>54669155
>he fell for the higher education meme
>>
>>54669155
>Going to class strictly more often that necessary to not get kicked out
It's like you're not even self-taught.
>>
WELP

https://www3.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html

I followed this example and i get UnsatisfiedLinkError

if I do nm hello.dll I can't find the function

I'm a C noob, how is it possible that a function that I included in the C file doesn't exist in the compiled DLL?
>>
>>54669200
>>54669171
Self taught then fell for the certificate meme. It was an assignment, I gave up on lectures.
>>
>>54669155
yeah but that is a very inefficient way to think about it
>>
>>54669302
if your C and header files look exactly like the example and they compiled successfully it should be there in the dll
>>
>>54669370
not at all, recursion is a meme, even the memiest use-cases like traversing a tree are highly intuitive using iteration with an explicit stack
>>
File: 106734234.jpg (51KB, 648x595px) Image search: [Google] [Yandex] [Bing]
106734234.jpg
51KB, 648x595px
>>54669401
fucking hell, i didn't even save properly one file, i didn't know the compiler would go just fine if it founds and empty .c file
looks like i need a break
>>
>>54669155
Could you either explain or give me something to google? How exactly would you write a stack-based while?
>>
>>54669370
>what is tail call optimization
>>
>>54669155
Not with tail call optimisation. All recursive calls are within the same stack frame that way.
>>
>>54669411
I thought the biggest advantage and the meme of recursion is writing a small amount of code to perform something that would otherwise take a lot of code. I think it's obvious that you could make any recursive solution into an iterative one, and it might be easier to do so, but you can't do it in as few lines right?
>>
File: 1449232840877.png (110KB, 269x271px) Image search: [Google] [Yandex] [Bing]
1449232840877.png
110KB, 269x271px
QUICK

Tell me how you name your private member variables.
>>
>>54669612
_camelCase patrician here
>>
>>54669636
>_
anon...
>>
File: 1459702589670.jpg (31KB, 600x337px) Image search: [Google] [Yandex] [Bing]
1459702589670.jpg
31KB, 600x337px
like 10 minutes ago my 4chan started to blink (in complete site rhythmically disappearing and appearing like once a second) while 4chanx activated on chrome. did the botnet shut me down?
>>
>>54669728
>my 4chan started to blink
>>
>>54669728
no, go on /b/ and look at the sticky
fucking retarded mods
>>
>>54669589
it doesn't save all that many lines of code, and it usually doesn't matter if a function is 5 lines or 10 lines long

there are severe drawbacks to recursion like being forced to fragment your code into tiny little functions whereas with iteration you can embed a loop inside a different function, and with iteration there's an easy to follow top to bottom flow of the code, but with recursion you have "jumps" to the top of the function, so it's a bit like goto in that it can be horrible to read
>>
>>54669728
>>54669741
>>54669744


// ==UserScript==
// @name REMOVE BLINK
// @namespace http://your.homepage/
// @version 0.1
// @description REMOVE BLINK
// @author (You)
// @match https://boards.4chan.org/*/*
// @grant none
// ==/UserScript==

var element = document.getElementsByTagName("html")[0];
element.classList.remove("blink");
>>
File: fuuuuu.png (246KB, 514x389px) Image search: [Google] [Yandex] [Bing]
fuuuuu.png
246KB, 514x389px
>>54669744
how do I deactivate it?
>>
>>54669768
thanks anon
>>
>>54669744
>go on /b/
holy shit his dick is like 2" tops
>>
>>54669589
The big advantage is slightly less code and maybe an easier way to piece together an algorithm, but you sacrifice:
- potentially blowing the stack
- making workarounds to force your code to be tail-call optimized, in order not to potentially blow the stack
When you take these into consideration, and when you start working on sizable projects where your time and effort is needed elsewhere, you'll realize why you will instinctively stick to the iterative approach, or at least only consider recursive when you can instantly see a tail-call optimized solution
>>
>>54669783

disabling 4chan x worked for me but now its just as unusable
>>
>>54669728
Doesn't blink with based Firefox.
>>
>>54665823
Kek'd
>>
>>54669612
AlTeRnAtInG_cAsE
>>
>>54667037
I just threw up in my mouth a little
>>
>>54669612
Random runes from Japanese, Chinese and Korean.
>>
>>54667408
That actually sounds really cushy. I would not have been surprised if it was a cobol-like fixed-length record format
>>
>>54669589
Recursion tends to be more intuitive
>>54669457
Simply put, before a function B is called from function A, a pointer to A is pushed to the stack so that when B returns, the program knows where to jump back to.
When using recursion (without tail call optimisation) you add a lot of these jump-back pointers to the stack.
The alternative way is to use iteration and manage your own stack.
For example to visit each node in a tree
def visit(node)
visit(node.left)
visit(node.right)

def visit(node)
stack = [node]
while !stack.isEmpty()
node = stack.pop()
stack.push(node.left)
stack.push(node.right)
>>
>>54669862
add
.blink{animation:none!important;}

to the custom CSS in 4chanx settings
>>
>>54669411
>recursion is a meme

holy fuck /g/ has gone to shit
>>
>>54667037
I don't get it. For what I understand it invokes the method 256 times each time passing an address of a local variable.

Am I missing something?
>>
File: 1430853197680.png (331KB, 474x432px) Image search: [Google] [Yandex] [Bing]
1430853197680.png
331KB, 474x432px
>>54669991
>>
>>54669967
Based anon.
>>
File: 403851840.jpg (21KB, 211x246px) Image search: [Google] [Yandex] [Bing]
403851840.jpg
21KB, 211x246px
>>54667037
I don't get it
>>
>>54670038
If you assign a char value, say '5' which is 0x35, to a short on a little endian machine, the bytes in memory will be "35 00".
If you take the address of that short and cast it to char*, it gives the valid NULL terminated C-string "5".

So, this "converts" a char to a char*.
>>
>>54669966
Thanks for the explanation.
>>
>>54669967
you are our saviour
>>
>>54669966
>Recursion tends to be more intuitive
nice meme
>>
DAE actually like the music on /b/ and keep the catalog open for it?
... no? Okay.
>>
>>54666061
Decided one say when I was 11 that I was tired of just doing stuff on the computer. I had heard about "programming" before and decided I wanted to make the computer do what I wanted it to do. Started making JavaScript lottery games and the rest was history.
>>
>>54670114
I liked it
>>
>>54670093
>If you take the address of that short and cast it to char*, it gives the valid NULL terminated C-string "5".
So, if I declare two local short variables (in the same scope) and assign 5 to both of them then both would have the same address?
>>
>>54670178
>So, if I declare two local short variables (in the same scope) and assign 5 to both of them then both would have the same address?
Not at all.
Assuming they both spill, they will each have a different address and the top of your stack will look like "35 00 35 00"
>>
>>54670112
Obviously some algorithms are more intuitive as iterative.
>>
>>54670178
>unmistakably trolling about wording because of converting contents vs converting adress, etc.
>>
>>54670242
>some
lad...
>>
>>54669612
names of my enemies
>>
Guys, I tried learning ncurses but I ran in to an error in the very beginning.
My code:
#include <ncurses.h>

int main(){
initsrc();
raw();
printw("Hello world!");
getch();

endwin();
return 0;
}

and I compile with
gcc -o hello hello.c -lncurses
. The problem is that it still throws linker errors
main.c:(.text+0xa): undefined reference to `initsrc'
. I've installed ncurses-dev and I'm out of ideas. What do?
>>
>>54670377
It's

```
initscr();
```

As in initScreen, not initSource. Tried it myself, and it works.
>>
>>54670469
D-did you just try to use markdown on fucking 4chan?

This is truly the end of days.
>>
>>54670487
Yeah lol, too used to using markdown. It should be.

go fuck yourself I am allowed to make mistakes


Also, :) :D XD
>>
>>54670469
Holy shit I didn't spot that...
Thanks
>>
>>54670178
only if using java:
String a="5";
String b="5";
a and b will point to the same string object
>>
>>54670499

jej ur triqueri dident werk :'''carat''')
>>
>>54670507
In Python too. And then you can modify it so 4==5.
>>
File: 1-20160414235141.gif (1MB, 480x270px) Image search: [Google] [Yandex] [Bing]
1-20160414235141.gif
1MB, 480x270px
>>54670507
>>54670562
Mind = blow. It's retarded tho.
>>
hi, absolute beginner here.
can i ask you my retard questions?
>>
Ever since I moved from OpenGL 3.1 to 3.3 my textures won't switch regardless of where I run glBindTexture or glActiveTexture.

How the fuck do you switch between textures in OpenGL 3.3 onwards?
>>
>>54670632
There's /sqt/ for stupid questions, but we'll help if it's about programming.
>>
>>54670632
you can ask any question even if it's not about programming
>>
>>54670562
You can modify 4==5 in Java too

what were they thinking?
>>
>>54670641
To bind to slot 0 should just be
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, yourTex);


If that's not working I'd assume the problem was with your texture itself, i.e. your glGenTextures call failed or some shit like that. Sprinkle in some glGetError calls and see if you get any weird results.
>>
>>54670695

no
>>
>>54670605
>It's retarded tho.
Strings are immutable in Java, so all it does is save one String object.
>>
>>54670507
the same can happen in C/C++, they could point to the same immutable string
>>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct
{
int32_t* data;
int32_t* end;
int32_t* capacity;

size_t size;
} vector_t;

typedef int32_t* iterator;

int V_empty(vector_t* this)
{ return this->size == 0; }

iterator V_begin(vector_t* this)
{ return this->data; }

iterator V_end(vector_t* this)
{ return this->end; }

size_t V_capacity(vector_t* this)
{ return this->capacity - this->data; }

size_t V_size(vector_t* this)
{ return this->size; }

void V_init(vector_t* this)
{
this->data = 0;
this->end = 0;
this->capacity = 0;
this->size = 0;
}

int32_t V_free(vector_t* this)
{
if (!this->data)
{
return 0;
}

free(this->data);
V_init(this);

return 1;
}

void V_push_back(vector_t* this, int32_t value)
{
if (!this->data)
{
this->data = malloc(sizeof(int) * 1);
if (!this->data) fputs("Could not allocate memory.", stderr);

this->end = this->data;
this->capacity = this->data + 1;
}

if (this->end == this->capacity)
{
size_t new_size = 2 * this->size;

this->data = realloc(this->data, new_size);
if (!this->data) fputs("Could not reallocate memory.", stderr);

this->capacity = this->data + new_size;
}

this->data[this->size++] = value;
++this->end;
}

int main()
{
vector_t vec;
V_init(&vec);

for (int i = 0; i < 10; ++i)
{
printf("Capacity: %u | Size: %u\n", V_capacity(&vec), V_size(&vec));
V_push_back(&vec, i);
}

V_free(&vec);
return 0;
}


Why the fuck does the reallocation always fails when the capacity is going to be bigger than 8?
>>
>>54670695
ok

what gauge wire do i need to safely wire a 100 mA power connection?
>>
>>54670755
>
typedef int32_t* iterator;

what

Also why is capacity a pointer to int32_t? shouldn't it just be an int32_t?
>>
>>54670756

>>>/diy/

also
> 1mm
>>
>>54665664
>not s expressions
>>
>>54670752
>they could point to the same immutable string
>could
depending on what? the compiler you use?
>>
>>54670841
not sure if it's explicitly mandated by the standard, if not then it would depend on the compiler
>>
>>54670841
It's almost certain they do in almost every C/C++ compiler. It is certain that they point to the same string in the Java example. You can verify this yourself by looking at the source code in C/C++ generated code, or by using reflection to edit the strings in the Java example.
>>
>>54670778
He's having the capacity pointer pointing at the end of the allocated region.

I'm going to test run the program rn
>>
>>54667037
This is actually very interesting, just a couple of days i was thinking about how to do this to every char of a file.

Thanks.
>>
>>54670778
Trying to mimic the vector from STL. :c

Capacity points to the real end of the block of memory, and end to the first unitialized element.
>>
>>54670653
>>54670695
k thanks in advance.
heres my "quest"
i need to write a program that will control a hydroponic watering thingy as well as light control. this in 2 different chambers
since i have 0 experience in programming i dont even know what kind of language would be most suitable in relation to the time it would take me to learn said program
>>
>>54670937
i mean said language
>>
>>54670605
It's not retarded, it's for optimization reasons. You're not supposed to normally be able to edit those strings. You really have to try to edit them. In compiled C/C++ code you have to turn on compiler settings or use a stripped down system with no memory protection.

>>54667037
Neat.
>>
>>54670112
Recursion is definitely more intuitive if you're used to basic mathematics
>>
>>54670937
python would be the easiest but only if there's a pre-built library for this kind of functionality

what's the hardware setup like, will it be running on a desktop computer or a raspberry pi or something, and how will you be interfacing with the watering and light controls?
>>
are these threads basically stack overflow?
>>
>>54670937
What you need is a PLC
>>
>>54670997
not at all, for example just because they use the (n - 2), (n - 1), n kind of syntax sometimes doesn't mean that's how you're supposed to reason about it or solve it, it's only a generalized way of listing e.g. (1, 2, 3)

for example, the intuitive way to generate fibonacci numbers is obviously to do it like 1 1 2 3 5 8 13 21 etc, not any recursive solution
>>
>>54671022
Nah on stackoverflow we can delete shitposting and close your stupid question as "Too Broad".

t. animuson
>>
>>54670897
Let me know if you see anything I'm unable to notice at the moment. ;_;
>>
>>54670911
Please don't do this outside of small things. Just do
char tmp[2] = { 0, 0 };
char * str = "aeiou";
for(char * i = str; *i != 0; i++) {
tmp[0] = *i;
foo(tmp);
}


>>54671055
That's not a procedure of generating fibonacci numbers. The intuitive way of generating fibonacci numbers is definitely recursive. I'm not aware of a way to make them without recursion. I don't think there are.
>>
>>54671079
kill yourself retard

if you say 1 + 1 = 2 is recursive, well then we're talking about recursive function calls in programming, not your retarded shit
>>
File: georgelucas.gif (3MB, 350x262px) Image search: [Google] [Yandex] [Bing]
georgelucas.gif
3MB, 350x262px
I wrote a blog post about some template metaprogramming shit I did in C++.

http://anthony.noided.media/blog/programming/c++/ruby/2016/05/12/mruby-cpp-and-template-magic.html

Is it understandable? They say that the best way to learn something is to explain it. I think I definitely learned something, but I'm not sure my explanation is quite up to snuff.

>Pic related, me using parameter packs and argument expansion
>>
>>54670937
Is this a personal project? Do you know what kind of hardware it runs on? How big is your budget?

A PLC is usually a good choice for these kind of projects, although they are a bit pricey compared to let's say an Arduino. However they tend to be more sturdy, easier to program and easier to wire. You may want to lookup sfc programming, which is very easy for a beginner writing a small program.
>>
>>54671090
Please write this non-recursive procedure for generating fib(n) without using phi o genius one.
>>
File: CfSwf.jpg (112KB, 960x615px) Image search: [Google] [Yandex] [Bing]
CfSwf.jpg
112KB, 960x615px
>>54670999
>python would be the easiest but only if there's a pre-built library for this kind of functionality
you can't just "import project"
>>
>>54671120
fuck off retard, we're talking about recursive function calls in programming, it's trivial to generate fibonacci numbers using an iterative loop
>>
>>54671120
Not him, but:

(1 / sqrt(5)) * ( (( 1 + sqrt(5)) / 2) ^ n - ((1 - sqrt(5)) / 2) ^ n)
>>
>>54671137
>recursion is more intuitive to anyone who has done math
>that algorithm is recursive
>fuk off not programin
>>
>>54670726
Doesn't work anon. And as far as I can tell there are no problems with the textures actually being loaded. It's just not switching from the last texture I loaded no matter what I set the active texture to.
>>
using recursive function calls to generative fibonacci numbers is so unintuitive it's not even funny, it's like you don't understand the fibonacci sequence at all, just the wording of the definition

>fib(8) = fib(7) + fib(6)
>fib(7) = fib(6) + fib(5)
>etc.
only a retard would solve it this way irl
>>
>>54671159
That uses phi ((1 + sqrt(5)) / 2) though. Apparently there's a way with matrices.
>>
>>54670999
i plan to use my old computer, since the fan is not too loud and i could have it running 24/7 or i will have to use my old laptop if i can change the fan without ruining it. i guess 2nd option would be better in terms of energy cost

and i dont know how to interface stuff, wikipedia just left me with even more questions
>>
>>54671180
>>>/diy/ would probably be better for the hardware stuff
>>
>>54670755
You're allocating too few bytes, thereby overwriting the memory after your region, presumably the metadata, hence the timebomb.

Do I let you find out how you've underestimated your stuff or do you want to find it yourself?
>>
>>54671099
>the reaction gifs on that blog post

So this is what happens when a redditor discovers 4chan?
>>
NEW THREAD
>>54671233
FUCK XML
FUCK JAVA
FUCK OOP
FUCK SMALLTALK
FUCK YOU

WE HASKELL NOW
>>
>>54671099
Awesome. In the slightly far future I'll be developing my own rpgmaker andvwas thinking that ruby for scripting would be neat.
Bookmarked!
>>
>>54671115
>hardware
>>54671180
and my budget is not too big, plus i wanted to get into programing anyway so i thought this would be a good start
>>
>>54671248
I added those all after the blog post was fully written, since a proofreader complained that the post needed more "life" to it.

I'll remove some, if you think that would be better.
>>
>>54671180
I'm one of the guys suggesting a PLC. What kind of sprinkler and lighting source are you going to use? And what about temperature sensors etc? I don't have any experience with controlling that stuff through a regular pc, but i doubt it's going to be easy. Seriously if you're going to build this you may as well spend the extra money for a small PLC and save a lot of time and energy.
>>
>>54671303
or a microcontroller that communicates with pc using serial connection
>>
>>54671329
Microcontrollers are for faggots though. Real industrialists use PLC's.
>>
>>54671303
>What kind of sprinkler and lighting source are you going to use? And what about temperature sensors
flooding table and a combo of sodium-vapor lamp and leds, temp will be controled trough ventilation, which needs no program since it will run all the time...
and well neither do i ^^
but i will not do it manually another time... b/c let me tell you, that costs a lot of energy and time. and at least you know about the programming part
>>
>>54671393
But he's doing a small hobby project I guess. And it's not mission critical.
small siemens logo! plc would be enough I guess
>>
>>54671434
>small hobby project
correct
so you think no program but this plc thing then?
>>
>>54666527
Reprogram theie hearing aid and attach a servo with a spoon to it.
>>
>>54671472
you still need to program a PLC/microcontroller
>>
>>54671532
oh ok ^^' and what language do i use/learn then?
>>
>>54671434
I'm doing an internship working with PLC's so i quess i just have a boner for them.

>>54671472
I don't have any experience with hydroponics, so i had to look a few things up. With a flooding table i suspect you want something like https://www.youtube.com/watch?v=ewRoGdpumfw this.
Using the PC you already have is not impossible, but you have to go pretty low level for controlling the output. I would recommend C for this, but again i don't have any experience with that.

On the other hand controlling a pump and some lamps using a PLC isn't all that hard. On conrad.nl a Siemens Logo cost about 150 EUR.
>>
>>54671599
i guess C is most common for these "embedded" applications because the hardware is weak and you're doing low level "driver level" interfacing
>>
What the fuck is wrong with this code? From experimental observations it seems it's not.
#define update_descr_addr(descr_list, addr_field, new_addr) do {            \
alt_sgdma_descriptor *cur = descr_list; \
size_t offset = 0; \
while (cur->control & FOOBAR_STILL_OK) { \
cur->addr_field = (void *) new_addr + offset; \
offset += cur->bytes_to_transfer; \
cur = (alt_sgdma_descriptor *) cur->next; \
} \
} while (0)
>>
>>54671699
s/not/not idempotent/
>>
>>54671175
Say an algorithm in simple English, does it sound recursive or iterative? That's intuition.
>>
>>54671869
it's an integer sequence with two base cases (1, 1) or (0, 1) depending on which definition you use

after that, each number in the sequence is the sum of the two preceding numbers

so it goes like 1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5 etc.

a sequence of numbers is "iterative", the "top-down" approach using recursive function calls is never as intuitive, in real life you do one thing at a time, you don't travel back and forth in time
>>
>>54671645
jep bretty much what i had in mind
>>54671666
ok so c

thanks a lot ^^
>>
>>54666061
Find some people who like programming and stick around them.
Make friends who like programming: they can help you keep interest.
Thread replies: 323
Thread images: 24
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK