[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: 315
Thread images: 36

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>59816790

What are you working on /g/?
>>
>>59820692
Lisp is the most powerful programming language.
>>
Thank you for using anime.
>>
>>59820692
I use C for all of my blog websites
>>
Ive been a developer for 10 years, but I cant read
>>
Ive been a reader for 10 years, but I cant develop
>>
>>59820692
Designing the Branch Executive for my processor. It handles branch prediction, holding prediction states, determining if branches have been correctly followed after condition values are made available by the ALU and setting invalidation signals if not, deciding what the next PC should be, and pausing the fetch unit if there is a branch non-determinism (indirect jumps).

Also, because of the fact that I have fetch and decode as separate stages it has a secondary invalidation signal just for the fetch unit so that if the decoder gets a jump instruction, it invalidates the instruction currently being fetched (if the branch is absolute, it's definitely wrong. If it's indirect it's definitely wrong. If it's conditional, it's 50/50 whether it's correct, but that's up to the branch predictor to decide. So the branch predictor algorithm can factor in a bias for following the condition fail to save that cycle.)
>>
Domino's Pizza wants me to make an automated ledger for them.

I'm going to charge a flat price for every store they use it in.

Jewing the Jews themselves.
>>
>>59821088
The basic setup for the processor's pipeline is
Fetch -> Decode -> RegFile & ALU (RegFile WB for Reg->Reg instructions) -> MemRead / MemWrite -> RegFile WB for Mem->Reg instructions

Depending upon how long the path for the RegFile & ALU step is, that might require two cycles, but I'm hoping not. An async read from a small memory, adder, then setup for a write-back into that small memory should be able to be done in ~8ns, which suits my 100MHz goal. I'll just have to make sure there is as little logic between everything as possible.

Still haven't quite figured out how I'm going to get around the RegFile WB dependency for Mem->Reg instructions (like load word). The easiest way is pause before the RegFile for such operations. The correct answer is to do OoO and implement a instruction buffer with per-register dependency waiting flags. I can't image that would take less than an additional cycle, so I might just leave that optimization to a later revision where I can benchmark "just pause" with a one cycle overhead dependency system.
>>
>>59821088
>>59821205
Is this for a university project? Regardless, this is pretty cool, anon.
>>
>>59821205
Also, I need to pound out my ISA soon so I can implement the decoder. I'm just going to do up an excel spreadsheet of instructions, opcode, and control signals set and have a python script generate the decoder for me using the spreadsheet.

Generally, I know the ISA will be RISCy, but with variable length instructions that can be up to four words (words are 32 bits). The first two bits of the first word in the instruction tell the decoder how long the instruction is, so there isn't any difficult parsing step necessary like x86. I will design the ISA so that it can handle a push to 64-bit words if necessary with no modification to the ISA of REX bits, or any of that garbo. There will however be a bit dedicated to setting "vector operation". Each normal operation also maps to a corresponding vector operation of the same type and the need for an additional word for specifying the vector size and shape. For example,
add r1, r2, r3   # adds r2 and r3 and places the result in r1
vadd r1, r2, r3 (4, 2) # piece-wise adds vector register r2 and r3 and places the result in r1, the vector is of size (4 bytes per operational word, 2 words in the vector)


Of course, I'm just planning the ISA to accommodate such extensions, I wouldn't probably do either. After the simulation works I'll move onto writing the assembler.
>>
Anyone else crack rsa by hand for fun?
>>
>>59821326
I took a computer architecture class last semester where the final project was to implement a basic processor that supported a subset of ARM instructions in Verilog and show through simulation that it worked. Well I just took what I had and re-implemented and pushed it to the extreme for fun.

I will eventually go all the way up the computer stack from processor, to assembler, to high-level language compiler, to OS, to interactive userland programs.

I have my Nexys 4 DDR board which has USB and VGA, so eventually I could make the entire thing self-hosting: keyboard, monitor, and all.
>>
class Shoah(Jew):
jews = jews - 6000000
return Israel
>>
>>59821383
Really cool. Good luck, anon!
>>
>>59821444
You are missing a few zeroes there
>>
Parse string into a 2x2 integer matrix

#define DERP ""\
"00 00 00 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 00 00 00"\
"00 00 00 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 00 00 00"\
"00 00 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 00 00 00"\
"00 00 00 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 00 00 00"\
"00 00 00 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 00 00 00"\
"00 00 00 24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50 00 00 00"\
"00 00 00 32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70 00 00 00"\
"00 00 00 67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21 00 00 00"\
"00 00 00 24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72 00 00 00"\
"00 00 00 21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95 00 00 00"\
"00 00 00 78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92 00 00 00"\
"00 00 00 16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57 00 00 00"\
"00 00 00 86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58 00 00 00"\
"00 00 00 19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40 00 00 00"\
"00 00 00 04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66 00 00 00"\
"00 00 00 88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69 00 00 00"\
"00 00 00 04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36 00 00 00"\
"00 00 00 20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16 00 00 00"\
"00 00 00 20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54 00 00 00"\
"00 00 00 01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48 00 00 00"\
"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"\
"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"\
"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
>>
>>59821453
Thanks a lot m8! And good luck on whatever you might be doing.

>>59821466
strtok my dude. Also, you are going to need something to separate those lines, currently the last value in a row and the first value in the next are indistinguishable, unless the sizes of the values are known ahead of time.
>>
File: 1491353772144.gif (2MB, 240x180px) Image search: [Google]
1491353772144.gif
2MB, 240x180px
OOP...
inputMethod()
//this code asks for user's full name via readline
return fullName;

method1()
//this code collects all the chars from fullName (up to the first space) and uses stringbuilder to create new string
return firstName;

method2()
//this code collects all the chars from fullName (all those after the last space) and uses stringbuilder to create new string
return lastName;

Main()
print: "fuck you, " + (firstName) + (lastName);


so, in method 1 i call for fullName and then it does readline... ok
but when method2 calls for fullName it wants to readline again...
not desirable cuz i need my code to separate them. NOT ask for them separately.
read: how do i call for a string w/out the readline being called more than once?
>sorry for the pseudo-code, copy/paste is too big for the post.
doing this on C# and Java tonight, if it matters. (trying to crosstrain)
>>
>>59821548
You need to look for a function that splits a string into multiple strings based upon a separator (usually a space). Don't know much about C#, but in Java use string.split(). Obviously, the first result will be the first name and the second result will be the last name. God forbid they have more than two names though...
>>
>>59821383
Nice, hopefully some day I'll have the time and patience to attempt something of that scale. Good luck anon
>>
>>59821678
>they have more than two names though...
that's the thing, they may have more than 2.

and i've already got the code to get each name, but what i am looking for is a way to only have readline called once and that value to be stored in a variable (string) and when i call that string, it doesn't try to readline again to = string.

tried having the separation code all in one block, but it doesn't seem to let me return more than one string from it even thought within it, i can writeline firstname + writeline lastname just fine
>>
>>59821733
Call the string? If you have readline getting the value for the names, you store that in a instance variable then access the variables. That's the idea of OOP, encapsulate all your state in the instance variables and communicate with other methods of that class using those variables.
>>
>>59821733
String[] names = fullName.split(' ');
String first = names[0], last = names[names.length - 1];
>>
File: 1471693734478.gif (143KB, 500x400px) Image search: [Google]
1471693734478.gif
143KB, 500x400px
>>59820692
I don't really understand the C++ approach to programming.
Let's say I want to use libcurl in C++. Libcurl is a C interface. Does that mean I am supposed to wrap it? There are tons of wrappers out there but if I use one then that means learning and remembering how the wrapper works in addiction to learning and remembering the library which it wraps. Also, a wrapper is more code I didn't write and I don't like that.
>>
I want to learn C, but I don't know what I will be able to use it for (for personal use).

Any examples or ideas?
>>
File: 1490243063387.jpg (217KB, 700x671px) Image search: [Google]
1490243063387.jpg
217KB, 700x671px
i'm studying to get into google. wish me luck /g/!
>>
File: aaQ8DGm.jpg (42KB, 512x512px) Image search: [Google]
aaQ8DGm.jpg
42KB, 512x512px
>>59821466
>>59821494
Not sure how you're gonna fit all that shit into a 2x2 matrix but.
You just need to strtok i spaces to get i columns for that row. When you hit the desired number of columns you bump up the row index j and stop when j equals your desired number of rows && i equals your desired number of columns. No need for sentinels.
Also, do not use those backslashes, C ignores newlines so strings will concatenate even on different lines without backslashes. Also, backslashes will add a bunch of whitespace in-between your string constants and you don't want that.
>>
>>59822126
A protected kernel module that tells you to kill yourself on regular intervals.
>>
File: 1485671566897.jpg (8KB, 225x225px) Image search: [Google]
1485671566897.jpg
8KB, 225x225px
Daily reminder that functional programming languages are for special snowflakes overcompensating for their intellectual inferiority complex
>>
>>59822141
You won't, you fucking lowlife.
>>
File: 1486624287866.jpg (111KB, 420x550px) Image search: [Google]
1486624287866.jpg
111KB, 420x550px
>>59822267
Be positive and nice! /dpt/ is only for nice, positive people!!
>>
>>59822098

>Does that mean I am supposed to wrap it?
Most C libraries have a wrapper like this in the header:

#ifdef __cplusplus
extern "C" {
#endif

/* Rest of header goes here */

#ifdef __cplusplus
}
#endif


This tells the C++ compiler "these are C functions and types, link them as unmangled."

And you just use the functions in C++ like you would in C.
>>
not a huge deal but i just finished my term project making an FPGA implementation of an nes emulator.

Pretty fuckin stoked about showing it off tomorrow
>>
>>59822562
That's pretty damn cool anon. Can you savescum with it?
>>
>>59822562
Pretty dope. Are you running it on some evaluation board?
If you made an interface for real cartridges you are a boss.
>>
Should I trust programming motherfucker?
>>
>>59822666
I'm not sure if you're asking if you should trust in programming and we are the motherfucker, or if you should trust some programmer who fucks mothers.
>>
>>59822680
Search programming mother fucker on google.

Motherfucker.
>>
>>59822698
http://programming-motherfucker.com/
>>
File: 1399742351408.gif (418KB, 320x240px) Image search: [Google]
1399742351408.gif
418KB, 320x240px
>Nearing release date
>Having to cut corners left and right
>Shitload of bugs all around
>Probably even more bugs that we ain't even aware of
Anything i can do to make the upcoming release less of a living hell? any experiences would be appreciated
>>
>>59822562
>>59822665
>that was a hint btw. you should be able to etch some sort of an edge connector and make it load from cartridges by tomorrow. Just a little thing, but it would double the impression on everyone.
>>
File: haskell2.png (36KB, 2000x1412px) Image search: [Google]
haskell2.png
36KB, 2000x1412px
I am having lots of trouble to understand the syntax on Haskell.

Is it supposed to be this hard to learn?

pls respond
>>
>>59822749
Translate a functional program to the same imperative.
Theres just a logic and flow difference..
>>
>>59822711
I know what it is, I was implying that it's a very reddit website, right down to "le epic pulp fiction reference xD"
>>
class Student:
def __init__(self, init_id, init_name, init_email, init_marks=[]):
self.__id = init_id
self.__name = init_name
self.__email = init_email
self.__marks = init_marks

def __str__(self):
return "%s: %s, %s, marks: %s" % (self.__id, self.__name, self.__email, self.__marks)

def append_marks(self, marks):
self.__marks.append(marks)

def get_id(self):
return self.__id

s1 = Student("N001","paul","[email protected]")
s2 = Student("N002","carl","[email protected]")
slist = [s1,s2]
for s in slist:
s.append_marks(12)
print(s1)
print(s2)


This code always returns the list at the end as
[12,12]
[12,12]
instead of
[12]
[12]

I know it's borderline homework, but it technically isn't anymore because I already handed it in partially complete. Thank god I'm not doing a programming major. So what's the problem? Why is each number being added onto each list the number of times identical to the number of lists?
>>
>That's pretty damn cool anon. Can you savescum with it?

I probably could but i'd have to perform a reset on the system each time, and the memory contents would need to come from a different source like another nes emulator on the pc or something.

>Pretty dope. Are you running it on some evaluation board?
>If you made an interface for real cartridges you are a boss.

yeah its on a teriasic de0 nano, its what the school provided for us to use. As for cartidges I don't have physical cartidges to connect to, it's currently all instantiated ROMs though theoretically if i had a few more days to mess with it maybe..

Keep in mind we only had half a term for this project not all of it works, but it'll load super simple NROM games like the very first edition of donkey kong, I did cheat by using a c program on a nios ii to emulate a lot of the stuff we couldnt get working by the deadline.

also features that werent explicitly used by donkey kong weren't implemented cuz lmao fuck it we dont have enough time. and its not worth bombing other courses over.
>>
>>59822749
give example of what you're having trouble with
>>
>>59822711
>Zed Shaw
Wew
>>
File: 1477523050689.jpg (108KB, 500x500px) Image search: [Google]
1477523050689.jpg
108KB, 500x500px
>>59822711
Christ.
>Zed Shaw
Well that explains it.
>>
>>59822711
>>59822711
>Trusting Zed Shaw
nah dude
>>
>>59822776
Can't believe I understand this without knowing Pythong.
except the init_marks=[] thing
and why it needs so many underscores
>>
>>59822837
>>59822856
>>59822858
Who?
>>
>>59822837
>muh zed shaw is le bad meme
ok, reddit
>>
>>59822749
Example?
>>
>>59822884
mr shaw please go
>>
>>59822892
why is he so bad faggot
>>
>>59822904
he's an attention whore who stirs up controversy to promote his books
>>
File: 1451830236334.jpg (418KB, 900x1200px) Image search: [Google]
1451830236334.jpg
418KB, 900x1200px
>>59822776
I'll take a look at it, anon. Give me a few minutes.
>>
>>59822912
you got sauce for that, faggot?
>>
>>59822929
>get asked why you don't like a person
>state an opinion
>WOW GOT A SOURCE FOR THAT FAGGOT WHERE IS YOUR CITATION APA STYLE ONLY PLS
mr shaw pls go and stay go
>>
>>59822867
The init_marks=[] is a default value so you can define a class object without specifying a value. If you try to do it with if statements or even try-except statements inside the "__init__" function it doesn't work, for whatever reason.

>>59822914
Thanks anon.
>>
>>59822776
You just fucking doxxed two innocent dudes.
>>
>>59822776
http://effbot.org/zone/default-values.htm
>>
>>59822940
but seriously, what kind of controversy
>>
>>59822963
holy crap. i'm a professional python developer and i had no idea about that.
>>
>>59822990
>Professional python developer
>>
>>59823019
thanks for helping me keep my job anon
>>
>>59822990
This is nothing specific to python though. Imagine the same thing in C - you are passing an array as an argument to a function, and you want to give a default value (an empty array) to a parameter. So on each call of the function, the parameter gets a pointer to the same array by default.
>>
>>59822803
>not worth bombing other courses over
Fair enough.
>>
>>59822963
This is disgusting.
>>
>>59822990
try executing id( []) a few times in python interpreter
>>
Will becoming a trap increase my motivation and/or capability to code? It seems to be highly recommended in this general and I'm curious why.
>>
>>59823174
Yes
>>
Rate my solution, studying on my own so i got no one to rate my work

Problem

Write a program that removes from a given sequence all numbers that appear an odd count of times.
Example: array = {4, 2, 2, 5, 2, 3, 2, 3, 1, 5, 2} à {5, 3, 3, 5}


Solution

            Console.WriteLine("Insert numbers in each line, list ends when empty line is entered");

List<int> myList = new List<int>();
int number;
bool result = true;

while (result)
{
result = int.TryParse(Console.ReadLine(), out number);
if (result == false)
{
break;
}
else
{
myList.Add(number);
}
}


Dictionary<int, int> myDict = new Dictionary<int, int>();

for (int i = 0; i < myList.Count; i++)
{
if (!myDict.ContainsKey(myList[i]))
{
myDict.Add(myList[i], 1);
}
else
{
myDict[myList[i]]++;
}
}


foreach (var item in myDict)
{
if (item.Value % 2 == 0)
{
Console.Write(item.Key+ " ");
}
}

Console.ReadLine();
>>
>>59823174
>Will becoming a trap increase my motivation and/or capability to code?
Yes.
>It seems to be highly recommended in this general and I'm curious why.
The cuter the boy, the better the programmer. It's a law of nature.
>>
File: javascript-reload.png (35KB, 725x382px) Image search: [Google]
javascript-reload.png
35KB, 725x382px
Had to look up how to reload a page in JS, because I wasn't sure what the cross-browser way of doing it was.

And then I stumbled across this post. Fucking hell. Yet another reminder that JavaScript culture is libraries all the way down.

>>59820831
>>59820692
Outside of work I'm working on an app server in C so I can write a web app in C. I got a server/worker separation working and now I'm trying to build a reactor to actually serve from a socket rather than just banging hardcoded shit directly into the worker.
>>
>>59823250
Kinda verbose. Pretty much the same thing (disregarding reading input) could be written as
using System;
using System.Linq;

namespace RemoveOdd
{
class Program
{
static void Main(string[] args)
{
var input = new int[] { 4, 2, 2, 5, 2, 3, 2, 3, 1, 5, 2 };
var filter = input.GroupBy(number => number).ToDictionary(group => group.Key, group => group.Count() % 2 == 0);
var output = input.Where(number => filter[number]);
Console.WriteLine(string.Join(" ", output));
Console.ReadKey();
}
}
}
>>
>>59823354
You see, that's why i kinda get frustrated, solutions like yours are so simple and i'm too stupid to think of them. I could never think of LINQ command good as that
>>
>>59823354
why did you you use dictionary in the end at all?
>>
>>59823276
The problem is I'm quite tall, which means I'm not considered "cute" by nature. Does that mean I'm destined to be a terrible programmer or is there something that can be done?
>>
>>59822714
Even if you managed to fix everything you know is not finished, you wont catch everything.
Some bugs are going to be hidden purely by easier-to-fix bugs that block that codepath from ever happening.

Get this release out as soon as you can, they you can work on the bugs and get a better release out.
The point is, while your halfarsed release is out, at least people wont continue complaining about the bugs you have already fixed, and they may even find some new ones related to what you've just done.
It's annoying to have to patch stuff you just looked at, but better to go over it again now than 6 months down the line.
>>
https://www.manning.com/books/type-driven-development-with-idris

ne1 got the ebook yet
>>
File: 1489289400969.jpg (58KB, 514x524px) Image search: [Google]
1489289400969.jpg
58KB, 514x524px
>>59823401
That's what the thigh-highs are for, anon. Just put on those bad boys and feel yourself become cuter. And if you're feeling a bit adventerous, try wearing some nice short-shorts. The gap between the thigh-highs and shorts (forgot the jap name for it) will further your cuteness!
>>
>>59823468
It doesn't exist

t. IT book hoarder
>>
>>59823477
Zettai ryouiki. That's gay.
>>
>>59823369
Why not?

If I used a list/array I'd have to iterate through it when filtering, with an O(n) lookup. Lookup in the dict is O(1) amortized.

I would have used a set but LINQ does not provide a ToSet(...) method by default.
>>
>>59822963
Thanks for the help but holy shit this is awful. How do I avoid this? You know, for the NEXT assignment.
>>
>>59823477
Do you have any other useful tips on how to be more cu- I mean, increase your programming performance?
>>
>>59823507
"eBook $39.99 pdf + ePub + kindle"

u mean it's not pirated yet?
>>
http://www/github.com/paperduck/algo

algorithmic trading platform

Python + MySQL
>>
>>59823552
just remember that def is an executable and how it works
>>
>>59823573
Yee
>>
>>59823364
Of course you can. It pretty much does exactly the same thing as your code. It's only a matter of translating it to LINQ.

Personally I like LINQ as it often makes the code more readable. That said, it can also make the code an unreadable mess if nested too much.

Select, Where, GroupBy, SelectMany, OrderBy, Aggregate, etc are your friends.
>>
>>59823595
o

some 300k/year math degree mofukka on here should buy it for us : ^ )
>>
Lets see if you're pajeet or real programmer

We are given the following sequence:
S1 = N;
S2 = S1 + 1;
S3 = 2*S1 + 1;
S4 = S1 + 2;
S5 = S2 + 1;
S6 = 2*S2 + 1;
S7 = S2 + 2;

Write a program which by given N prints on the console the first 50 elements of the sequence.
Example: N=2 -> 2, 3, 5, 4, 4, 7, 5, 6, 11, 7, 5, 9, 6, …
>>
aaaaaaa
someone explain how arrays work with methods on c#
pass by value or refernce
and what the fuck the ref keyword is used for
make it not as complicated as my book pls
>>
>>59823679
what book?
>>
File: 1483492194636.jpg (77KB, 1280x720px) Image search: [Google]
1483492194636.jpg
77KB, 1280x720px
>>59821548
>>59822714
>>59822803
>>59822858
>>59822884
>>59822940
Who are you guys quoting?
>>
>>59823679
http://www.introprogramming.info/english-intro-csharp-book/read-online/chapter-7-arrays/
>>
>>59823722
deitel and deitel visual c# 2013
>>
@59823477
>forgot the jap name for it
>>>/r/abbit
Your kind is not welcome here.
>>
>>59823774
link if piratable?
>>
>>59823820
just google it and add .pdf
does it matter tho
i dont understand this what passing a reference by value and passing a reference by reference mean
>>
>>59823847
read
>>59823730

Dl this book and learn what Stack and Heap are
>>
File: 1486924512238.png (260KB, 620x640px) Image search: [Google]
1486924512238.png
260KB, 620x640px
What features does one need to have in a language to call it a "systems language"?
>>
>>59823847
you mean deitel visual c# 2012? There is no 2013 book
>>
>>59823888
inline assembly
>>
>>59820692
I found use for python! So i can do shit like this when im lazy
import os
for i in range (1,33):
os.system("youtube-dl https://laracasts.com/series/laravel-from-scratch-2017/episodes/" + str(i) + '\n')
>>
>>59823895
yeah sorry
>>59823874
ill try
i think i know what stack is tho the last in first out data structure still idk how thatll help me answer
>>
>>59823952
Try to differentiate data structure Stack from memory stack (even though they work the same way).
>>
>>59823941
Why do you need to add a newline?
>>
>>59823968
you don't it just stayed there. First iteration had writing links to file and then using them as arguments xD
>>
>>59823888
1. It compiles to assembly code
2. You usually are messing with the allocation of memory with it on-code
>>
File: Capture.jpg (44KB, 1223x358px) Image search: [Google]
Capture.jpg
44KB, 1223x358px
Holy fucking shit, this problem is way harder than what i thought it would be

I thought of solving it like this: If it's possible first multiply it with 2, if not than add 2, if not add 1. But i didn't think you can add numbers and then multiply it to be even closer to target number, in fewer steps
>>
File: out.gif (1MB, 639x409px) Image search: [Google]
out.gif
1MB, 639x409px
>>59820692
>>
>>59823888
Javascript interpreter.
>>
>>59823888
The ability to implement the standard library in the language itself.
>>
>>59824073
source code?
>>
File: benis_anime.jpg (777KB, 1920x1080px) Image search: [Google]
benis_anime.jpg
777KB, 1920x1080px
>>59824016
It's actually pretty simple with recursion.
>>
>>59824090
Feel free to provide algorithm
>>
>>59823614
Here's my solution:
https://hastebin.com/igamaluxoh.c
>>
>>59824088
pls no bully for shitty coding practices
https://github.com/lancebeet/imagemicro
>>
>>59824103
Use data structures god damn it
>>
>>59824016
I solved it using this extraordinary retarded solution

            Console.Write("Insert number N:");
int number = int.Parse(Console.ReadLine());

Console.Write("Insert target number: ");
int targetNumber = int.Parse(Console.ReadLine());

Queue<int> myQue = new Queue<int>();
myQue.Enqueue(number);

int current = number;

while(current != targetNumber)
{
current = myQue.Dequeue();
Console.Write(current + " ");

if ((current+2) * 2 <= targetNumber)
{
myQue.Enqueue(current + 2);
}
else if((current + 1)*2 <= targetNumber)
{
myQue.Enqueue(current + 1);
}
else if(current*2 <= targetNumber)
{
myQue.Enqueue(2* current);
}
else if (current + 2 <= targetNumber)
{
myQue.Enqueue(current + 2);
}
else
{
myQue.Enqueue(current + 1);
}
}
Console.ReadLine();
>>
>>59821383
Always wanted to do that but damn , making a gcc version of your architecture is a fuckload of work
>>
>>59824138
Why? This does the job, and much more simply.
>>
>>59823601
pls respond
>>
@59824180
>mfw
Are you retarded by any chance?
>>
>>59823614
here's mine:
def a( x):
if x < 1:
global N
return N
return f[(x+1)%3]((x+1)/3)+1

def b( x):
if x < 1:
global N
return N
return 2*f[(x+1)%3]((x+1)/3)+1

def c( x):
if x < 1:
global N
return N
return f[(x+1)%3]((x+1)/3)+2

f = [a,b,c]
N = 2
for i in range( 1, 50+1):
print f[(i+1)%3]((i+1)/3)
>>
>>59824182
Not him, i was the one who asked the question

My solution

            Console.Write("Insert number N:");
int number = int.Parse(Console.ReadLine());

Queue<int> myQue = new Queue<int>();
myQue.Enqueue(number);

for (int i = 0; i < 50; i++)
{
int current = myQue.Dequeue();
Console.Write(current + " ");
myQue.Enqueue(current + 1);
myQue.Enqueue(2 * current + 1);
myQue.Enqueue(current + 2);
}

Console.ReadLine();
>>
>>59824200
That's basically what i did here, but not in reverse

>>59824148
>>
>>59824195
>>59824199
>>
>>59824199
After programming in C for a couple of weeks, C++/C# looks super-autistic, fuck OOP.
Also, this will only print 49 numbers, not 50.
>>
>>59824180
Depends on the variable type of the result.
if its int the compiler will just add instructions that turn the double result in to an integer.

At least thats the case with SSE
>>
>>59824221
>Also, this will only print 49 numbers, not 50.

nope
>>
>>59824221
I don't understand what is more autistic, this solution >>59824199, or this >>59824195
>>
>>59824073

Very fast. Looks good.
>>
>>59824235
Solution >>59824199 because its C# OOP winshit.
>>
>>59824269
Kill yourself, dumb redditor.
>>
>>59824269
You can't quote yourself, retard. Nobody said what you quoted.
>>
yesterday i participated in a parallel programming competition. we had to program the k nearest neighbours problem. we managed to proccess a 110000x110000 matrix in ~1.30 min using OpenMP. i got pretty happy with the results, since it was my first time with OpenMP and in a competition.
>>
tfw just chatted with one of the cute girls in uni that i might have a crush on and i DIDNT do or say anything weird
are u proud of me /g/
>>
>>59824267
Ok
>>
>>59824180
>posting "mfw" without an image
I don't want reddit stink nearby. Fuck off.
>>
@59824306
I didn't even bother to read your post, because I already know it's fucking stupid. Piss off.
>>
>>59824234
1.5 ?
>>
>>59824320
I dont have a degree tho im only second year?!
>>
Everything in your posts reeks of reddit.
Seriously: piss off. Your kind is not welcome here.
>>
>>59824284
I'm very upset, anon. Have you been corrupted by 3DPD?
And btw, do you study Computer Science/Computer Engineering too? Are there really cute girls there? Because in my CE class the cutest girl looks like Jabba from Star Wars. And it's not even a small class or a class with few females.
>>
n = 0
for i in range(100):
n += 1
if n % 3 == 0:
print("fizz")
elif n % 5 == 0:
print("buzz")
else:
print(n)

Job, here I come !
>>
First rule of /g/, if there's no answer posted it's someone's homework.
>>
>>59824339
theyre the same
>>
@59824350
I don't want reddit stink nearby. Fuck off.
>>
>>59824339
I wouldn't say reddit. I would say ifunny or 9gag. Which make reddit look like heaven.
>>
>>59824344
I study cs but there are students that dont in the uni
i can even do some general classes with students that dont have the same major as me aka boner classes
cs classes are full bois no homo tho
>>
>>59824352
>using @ to tag people
Instagram newfag user detected
>>
>>59824369
not sure if bait but ill fall for it and give a (you)
>>
@59824363
Go be retarded somewhere else, like at reddit.
@59824369
You do realize that '@' is meant specifically for "tagging" non-humans?
>>
What are good tutorials for Javascript for intermediate programmers? A tutorial/Book that does not waste my time and is aimed at programmers.

I want to learn Javascript and frameworks because I want to have a language I can create prototype for concepts.

I'm experienced with all the major paradigms: Functional, OOP, Procedural and Logic.
>>
@59824398
>Javascript
>reddit spacing
How about you fuck off to some other board/thread/website?
>>
>>59824398
>>>/g/wdg
@59824409
>>>/r/ibbit
>>
mods need to ban these fags
>>
>>59824398
Mozilla Developer Network and W3schools have all you need
>>
>>59824398
>I'm experienced with all the major paradigms
How can you be experienced with something you can't even list properly?
>>
File: fking_finally.jpg (28KB, 411x194px) Image search: [Google]
fking_finally.jpg
28KB, 411x194px
R8 my retarded memeprogram in le greatest language ever:
#include "stdafx.h"
#include <math.h>
#include <vector>
#include <stdio.h>
#include <iostream>
typedef unsigned long ul;
const ul PRIMES = 10000000;
bool isPrime(double n)
{
if (n <= 1) return false;
double sqN = sqrt(n);
for (int i = 3; i <= sqN; i++) {
if ((int)n % i == 0) return false;
} return true;
}
int main()
{
std::vector<ul> primes;
ul sumPrimes = 0;
ul numPrimes = 0;
for (ul p = 1; p <= PRIMES; p++) if (isPrime((double)p)) primes.push_back(p);
numPrimes = primes.size();
for (ul sp : primes) sumPrimes += sp;
std::vector<ul> fizz, buzz, fizzbuzz;
ul sumF = 0, sumB = 0, sumFB = 0;
ul numF = 0, numB = 0, numFB = 0;
for (ul p = 0; p < primes.size(); p++) {
if (p % 15 == 0) {
fizzbuzz.push_back(primes[p]);
}
else if (p % 5 == 0) {
buzz.push_back(primes[p]);
}
else if (p % 3 == 0) {
fizz.push_back(primes[p]);
}
}
for (ul fb : fizzbuzz) sumFB += fb;
for (ul f : fizz) sumF += f;
for (ul b : buzz) sumB += b;
numF = fizz.size(); numB = buzz.size(); numFB = fizzbuzz.size();
printf("Stats for primes upto\t<%lu>\n", PRIMES);
printf("Primecount:\t\t<%lu>\n", numPrimes);
printf("Sum Primes:\t\t<%lu>\n", sumPrimes);
printf("Fizzcount:\t\t<%lu>\n", numF);
printf("Sum Fizz:\t\t<%lu>\n", sumF);
printf("Buzzcount:\t\t<%lu>\n", numB);
printf("Sum Buzz:\t\t<%lu>\n", sumB);
printf("FizzBuzzcount:\t\t<%lu>\n", numFB);
printf("Sum FizzBuzz:\t\t<%lu>\n", sumFB);
std::system("pause");
return 0;
}

>Pic related: The output
>>
>>59824368
Oh I see. I too should attend some other classes for the same reason sometimes, like I did in the past few times. I even have a friend's girlfriend who studies literature and offered me and a friend to introduce us some girls from her class if we drop by her lessons sometimes, but I'm a third year with lots of old exams still to do and don't really have the strength to do that lately. When classes are over I just want to go home to rest, and before them I'm really too tired and often sleep till last moment.

And it's no homo because even most bois are ugly in our classes lol
>>
=> 59824429
>hurr durr
>>>/r/ibbit

=> 59824437
>le
>"meme"
So basically you're admitting that you're a redditor then.
>>
Go vs C#, which one is better?
>>
>>59824454
Go, but that isn't saying much.
>>
>>59824437
Is that C++? I only coded in C and Java, and recently turned to Go and Swift because I want to work for Apple, don't you need a class in which to include the main in C++?
>>
>>59824462
>coded
>>>/g/wdg
>>
>>59824445
Your ego seems brused in some way.
Im terribly sorry for the failure you call a life.
I truly am.
>>
@59824464
>Tbh
>>>/r/abbit
>>
>>59824462
Yes.
See >>59824466
>>
>>59824469
Well, you better speak now, or you might never get a chance again.
>>
>>59824454
Go, C# is meme shit without explicit memory management that only runs properly on Windows because MS created it. And oh, if you're a faggot who wants to make unoptimized games you can use it for Unity scripts, but there isn't much knowledge required about the language itself, it's more about learning the Unity libraries.

Go on the other hand is a great language who can actually replace C/C++ with it's memory management capabilities and cleaner syntax. It's no wonder lots of enterprises are turning to it and Swift as main languages.
>>
This guy just epicallly trolled all of you and you fell right for it.
>>
>>59824462
You can program in C++ without ever using OOP or classes. There's actually quite a few libraries that go down that route, STL is the classic example.
>>
>>59824490
>meme shit
I don't want reddit stink nearby. Fuck off.
>>
>>59824491
>look mom, you can SEE my autism
>>
>>59824490
So let's say I wanted to make a basic desktop application with a GUI, which of the two would I use? Does the answer depend on whether it is platform-specific or cross-platform?
>>
Am I a shitlord now?
>>
>>59824533
Yes.
>>
>>59824098
Here is a simple program in python
#!/usr/bin/python3

def subsequence(n, m):
if n > m:
return False, None
elif n == m:
return True, [m]

z = float('inf')
b = list()
for o in [n+1, n+2, n*2]:
s, l = subsequence(o, m)
if s:
l.insert(0, n)
if len(l) < z:
z = len(l)
b = l

if z == float('inf'):
return False, None
else:
return True, b


b, a = subsequence(5, 16)
print(a)


Currently it is not very fast with something like n=5 and m=40 but you could implement a faster search if you used A*.
>>
>>59824533
>what happens when the programmer is both indian and a woman
>>
>>59824537
Anime website, not your safe space, etc
>>
>>59824537
Anime is the fundamental part of imageboard culture and being disgraceful to the anime must be a punishable offence.
>>
Honestly speaking, guys, why do you think OOP garbage collector languages like C# or Java have been the main focus of the industry for all this time? I mean, they may be good for beginners in order to not make them do cause much damage in their toy programs, but it's actually funny how stuff like Go, which supported explicit memory management and real programming like C and C++, has passed somehow unobserved if compared with those meme languages. It seems like everyone wants to go saying "coding is kewl xd" but when they have to actually deal with accurately controlling the machine they all run away.
>>
odds skip last hour of programming class
even stay like a gud goy
0 kms
>>
File: moot_agrees_with_anime.png (12KB, 880x131px) Image search: [Google]
moot_agrees_with_anime.png
12KB, 880x131px
>>59824537
Wrong, this is an anime website. Deal with it or leave.
>>
>>59824560
>0 kms
Oy vey
>>
>>59824568
No, u
>>
>>59824567
>I really want to know who are you quoting.
>>
@59824556
>meme languages
>>>/r/abbit
>>
>>59824527
If it's windows only, C# may be a possibility since Visual Studio helps you in easily doing GUIs, but it only will run on Win.
Don't even consider it if you want to go cross platform.

Go on the other hand will require more effort to do it but
1. if you know what you're doing it will be more optimized
2. it will run everywhere you want to compile it to
>>
>>59824547
Or a first-year physics major taking compsci 101 for the shits and giggles. Besides, computer science courses are full of ethnicities, which actually makes me feel pretty good about sitting it a physics lecture and BEING ABLE TO UNDERSTAND THE WORDS COMING OUT OF THE LECTURER'S MOUTH.
>>
>>59821548
I can tell you right now that the C# shouldn't look like this at all.

If you're still here, I can offer suggestions. In both C# and Java, you're going to want to use the equivalent of
"muh string".Split(' ')
.
>>
>>59824560
frick
>>
>>59824527
Java or Python I'd say?
>>
>>59824596
isn't that shit-chan?
>>
>>59820692
I'd like to learn the basics of programming. Where should I start?
>>
>>59824560
do it u coward
>>
File: anime_complain.gif (499KB, 500x514px) Image search: [Google]
anime_complain.gif
499KB, 500x514px
>>59824596
>>59824607
>>59824617

Posting your waifu without contributing is just spamming.
>>
>>59824556
I thought Go had a GC?
>>
>>59824628
Pick a project to work towards, get some reference material for whatever language you choose, and just get to work
I suggest C or C++, so you understand how shit works

If you're retarded, start with Python
>>
>>59824634
>posting your waifu WITHOUT contributing
how is this possible
>>
>>59824596
>>59824607
>>59824617
>>59824633
UR WAIFU A SHIeT, a ShIeEET
>>
>>59824596
Ok I'm not against anime content here, but I think dumping the folder is going a bit far.
>get a better waifu.
>>
>>59824641
Waifu-posting is an instant -10 contribution offense
>>
>>59824547
this
>>
>>59824655
lambdas are not a joke
>>
>>59824587
How easy is it to do GUI's in Go? Does it compare well to C++ with QT? How about Java + Swing?
>>
>>59824596
>>59824607
>>59824617
You're clearly false-flagging. You google image searched the character and you're now pasting URLs into the filepicker.
>>
>>59824641
If you want to share dumps of your waifu go to /a/ or /c/. Even though anime posting is tolerated, this is a technology board where we discuss technology and not anime.
>>
>>59824658
but java is
>>
>>59824556
>>59824635
I meant Swift sorry
>>
File: 1486780129853.jpg (280KB, 700x849px) Image search: [Google]
1486780129853.jpg
280KB, 700x849px
What language other than C is suitable for writing a runtime?
>>
>>59824625
It's shittaste-plebeian-chan, the enemy of Kirino which is the ultimate waifu
>>
Is java a good first language for a beginner?
>>
File: best girl.png (10KB, 300x250px) Image search: [Google]
best girl.png
10KB, 300x250px
>>59824661
Yeah, he didn't name his pics like a proper autist would, and barring that they aren't even "___Subs (timestamp).jpg". Let me show you how it's done:
>>
>>59824651
That's nothing. I was sitting once in a lecture with my thinkpad and my "friend" points to a hair sticking from under one of the keys on my keyboard and shouts aloud "OMG ANON IS THAT A FUCKING PUBE"
>>
>>59824674
But Swift is ref-counted, like Python.
>>
>>59824685
sepples
>>
>>59824690
yes
>>
>>59824701
It isn't suitable for writing anything.
>>
>>59824642
If you do multithreading poorly, it's normal. Thread creation and context switch overhead will weigh more than the actual advantage of parallelization you pajeet
>>
File: 1491006241025.jpg (270KB, 1180x874px) Image search: [Google]
1491006241025.jpg
270KB, 1180x874px
>tfw you realize OOP is trash and you stop using it
>>
>>59824398
Not even memeing, just like start writing shit and

https://www.ecma-international.org/ecma-262/7.0/index.html
https://developer.mozilla.org/en-US/docs/Web/JavaScript
>>
>>59824704
Ok, thanks
>>
>>59824713
are you an expert fp memer yet
>>
File: 1459097156067.jpg (37KB, 686x576px) Image search: [Google]
1459097156067.jpg
37KB, 686x576px
>>59824713
Whomst was the original source of this phrase?
>>
>>59824713
https://www.youtube.com/watch?v=ZM1ZDaaEyMY
>>
>>59824658
all functional programming, and in general any kind of programming without explicit memory management, is a complete joke.
>>
>>59824713
Explain yourself
>>
>>59824728
Rust, C++ both let you use lambdas while letting you manage memory manually.
>>
>>59824660
I'd say Swing is the easiest of the bunch, but C++ with QT is the most optimized and didactic. Don't really know about Go GUIs
>>
>>59824728
>he says while using a language without explicit register management
>>
>>59824728
Where did his post mention anything without explicit memory management?
>>
>>59824673
finally a decent anime girl
>>
>>59824749
Who said "he says while using a language without explicit register management"?
>>
>>59824739
This would work well above a certain threshold.
>>
>>59824762
I did.
>>
>>59824723
everything is good really
the things u learn as a beginner are the same on all
maybe syntax only changes
>>
>>59824766
Nobody said that before you. How did you quote it?
>>
>>59824742
Is there really a reason to use lambdas even there though? they're only neckbeard code Aesthetics circlejerking and are same speed, if not slower, than the sequential version.
>>
>>59824775
I wasn't quoting anybody, perhaps excepting myself (if you were to stretch the definition of quote)
>>
>>59824762
I don't see this "is your quotation a literal quotation" meme anywhere else, is it /g/ exclusive, or are you all too hip/autistic for me to get it?
>>
b e n i s
e
n
i
s
>>
>>59824783
you don't have to create 10000 threads, one for every task
you should create like 4 threads, one for CPU core, and divide the 10000 tasks among them, try that and compare it to doing it sequentially
>>
>>59824782
>than the sequential version
What did he mean by this?
>>
>>59824796
It's a recent shitposter who forced it really hard, and because so many retards got triggered and fed her (You)s, there's a couple of people doing it now.

Don't respond to those posts, please.
>>
>>59824790
>I wasn't quoting anybody
You were. It's in your post.
>perhaps excepting myself
You can't quote yourself.

>>59824796
Perhaps you should lurk more.
>>
s
i
n
e
s i n e b
>>
>>59824700
which is still a lot better and less unpredictable than GC
>>
>>59824804
>It's a recent shitposter who forced it really hard
Found the oblivious newfag.
>>
>>59824801
sequential coding is everything which is not functional like lambda functions. Please learn what those kinky constructs you use actually are before using them
>>
>>59824812
u fucked up
b
..e
....n
......i
........s
......i
....n
..e
b
>>
>>59824810
No, it wasn't.
I didn't quote anyone.
>>
>>59824829
>coding
I see. That explains it.
>lambda functions
There is no such thing.
>kinky constructs
How is a function a "kinky construct"?
>>
>>59824819
low numbers of what? threads or tasks? and what machine/system are you running it on? what compiler/language?
>>
>>59824782
Wiring up a callback for a button in a GUI without polluting your namespace with single-use functions? There are tons of cases where you need to pass a function object to a function or constructor, and lambdas make that way more convenient.

I've also used them to optimize code in C++. Because the compiler will try to inline them by default, when combined with inline functions they let you use a bunch of tricks to optimize code to run fast while keeping it modular.
>>
>>59824837
>reddit dots
what the fuck are you implying
did reddit invent full stops
and what the fuck is a 4chan dot
>>
>>59824832
You used a prefix operator for quotation.
'>' is prefix notation for "".

>>59824837
Who said that?
>>
>>59824855
>prefix operator
This is a fucking imageboard you twerp
>>
File: 1491413390841.gif (2MB, 480x270px) Image search: [Google]
1491413390841.gif
2MB, 480x270px
>>59824829
>sequential coding
>>
>>59824839
>having no arguments
>starting randomly quoting words

>lambda functions
>There is no such thing

https://en.wikipedia.org/wiki/Lambda_function

get away pajeet.
>>
>>59824859
A unary function then.
>>
@59824866
Who the fuck are you quoting?
>There is no such thing
There indeed isn't. Your link doesn't disprove this statement. It's very telling that you think wikipedia somehow can possibly do that.
>>
File: scren.png (43KB, 582x753px) Image search: [Google]
scren.png
43KB, 582x753px
What do you guys think of this python calculation library I wrote? Includes a test file you can run it yourself, I posted it awhile ago but made a lot of changes and deleted the original repo.

Solves math expressions given as strings and as of now supports a lot of functions, any recommendations?

https://github.com/nick-gits/calpy
>>
>>59824891
>python
Instant trash.
>>
File: kirino_1_by_paperjoey-d30n1ax.png (223KB, 900x1004px) Image search: [Google]
kirino_1_by_paperjoey-d30n1ax.png
223KB, 900x1004px
>>59824860
I meant imperative, had a lapsus.
and stop posting Z-tier grills
>>
hi im a girl ^^
>>
>>59824891
I don't understand, you didn't specify what the library does. I'm guessing that it parses expressions from input and returns the result?
>>
>>59824914
*glomps u*
wanna be my gf? :3
>>
>>59824867
Instead of creating a certain amount of threads for every loop, try to restructurate your program in order to break the loop into sub-loops (like: sub-loop for i=0 to 100, another for i= 101 to 200 etc), give each sub-loop task to a thread and then start them all together.
>>
>>59824917
Yes precisely.
>>
>>59824923
y-yes but u must know
i got a benis down here
>>
File: 1490495605224.png (435KB, 720x720px) Image search: [Google]
1490495605224.png
435KB, 720x720px
>>59824906
>I meant imperative
Even if we assume this, in what way is a function either imperative or non-imperative? You do realize that a lambda abstraction is merely a function, right?
>>
>>59824937
*shoots u*
sry, it was for the future of the white race :)
>>
>>59824937
we are one simple snap away from true happiness
>>
make new bread
>>
>>59824891
I wrote something similar in Rust recently. Your code is roughly what I'd do if I were writing in a Dynamic language.

It looks like you skipped out on Parentheses? Also, your parser might do some funny shit if you pass it something like "2 + + 2 3"
>>
>>59824965
hitler was a mtf
>>
>>59824975
you realise you could do that in a static language too?
>>
File: scren.png (28KB, 712x441px) Image search: [Google]
scren.png
28KB, 712x441px
>>59824975
>It looks like you skipped out on Parentheses?

How do you mean? It handles parentheses fine as far as I'm aware. And 2++23 raises the exception it is supposed to.
>>
>>59824987
In a static language I'd use the static type system to my advantage. Using Enums for tokens, etc.
>>
Any free licensed sound and music playing library? I read OpenAL no longer is BSD/GPL.
>>
>>59825011
Other than replacing the string literals with tokens, how would it be any different?
>>
>>59824956
no, because a lambda function only says what it must do, while an imperative program exactly specifies how it's done. And you're just fiddling around to not admit that lambdas are useless and don't give any performance or clarity advantage. They're only for neckbeards who like to giggle looking at their "tidy code"
>>
File: 555.jpg (34KB, 338x305px) Image search: [Google]
555.jpg
34KB, 338x305px
>>59824810
>You can't quote yourself
>>
File: 1490485094193.png (860KB, 841x720px) Image search: [Google]
1490485094193.png
860KB, 841x720px
>>59825049
So the function "f (x) = x + x" is imperative and the function "λ . x -> x + x" is not imperative? Now I truly see...
>>
Is it acceptable to say something out loud and then use ">" to quote myself in a 4chan post?
>>
>>59825154
Not if you're autistic enough to ask
Oh, wait..
>>
>>59825010
Ah, I see that now in your code. I was confused at first because your check for parenthesis is hidden in an elif clause somewhere. I see it now.
>>
New thread:
>>59825181
>>59825181
>>59825181
>>
>>59825049
Ah, so lambda functions are worse performing garbage.
>>
>>59825131
f(x) = x + x
is not imperative
>>
>>59825040
In some languages (Rust in my case, but also Haskell/ML/Scheme/Prolog) , tokenizing lets you use pattern matching, which is very convenient for parsing recursively defined grammars.
>>
>>59825206
in those same languages you can match on strings
>>
>>59825193
Indeed, it's a function, meaning it can't be either imperative or non-imperative.
>>
>>59825265
>Indeed, it's a function, meaning it can't be either imperative or non-imperative.
what kind of logic is that?

how about this logic?
it's a function, so it's functional to some degree
that there isn't much to it beyond function-ness means it's very functional
>>
>>59825243
True, but then you are doing some of the lexing work in the parser. I'll admit that the difference isn't huge though.
>>
>>59825285
If you think ordinary functions are bad, you will LOVE Cobol! No user-defined functions, just Gotos.
>>
>>59825285
I see, so this is functional too. Meaning the language that contains it now also functional.
add eax, eax
>>
>>59825342
Wow, I never thought of it that way

I guess since you can create an "add" class in OOP, that must mean it's OOP too
>>
>>59825351
A class is a function, I see. Now I am truly enlightened.
>>
File: 1478163441503.png (418KB, 600x802px) Image search: [Google]
1478163441503.png
418KB, 600x802px
>>59825351
>create an "add" class in OOP
What is this OOP? Is it a language?
>>
>>59825371
There are classes of languages, therefore all languages are OOP
>>
>>59823552
Keep reading that link
>>
>>59823679
Not 100% sure, but I believe the location is passed, but it cannot be changed.
What I mean is that you can actually change the array inside a function, but you can't do something like this:

static void Func(int[] a) {
int[] b = {1, 2, 3};
a = b;
}


and expect the outer reference of a to change (the reference in the function that called Func still points to the old location of a), however you can change the value of elements of a.

ref allows you to pass the reference so it can be changed.
>>
Anyone here have experience with QT development through MSYS2/MinGW with makefiles?
>I need this because I want my QT application to be buildable on both linux and windows with the exact same sourcefiles
>>
>>59826394
>I need this because I want my QT application to be buildable on both linux and windows with the exact same sourcefiles
Whom is this sentence referenced from?
>>
You down with OOP? (Yeah you know me)
>>
>>59826781
>implying greentext == quotes
Thread posts: 315
Thread images: 36


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