[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: 323
Thread images: 32

File: 1478141433809.gif (288KB, 360x266px) Image search: [Google]
1478141433809.gif
288KB, 360x266px
Previous thread: >>57700909

What are you working on, /g/?
>>
node js is fun
>>
>>57707481
I'm trying to configure an IR reader with my Raspberry PI. What's the best way to control GPIO pins and get analog input in Linux? I'd like to stick with file descriptors and /sys, but I'm open to APIs (in C++)
>>
File: wire defusal problem.png (277KB, 2780x860px) Image search: [Google]
wire defusal problem.png
277KB, 2780x860px
>>
>>57707558
Are you trying to cheat in Keep talking and Nobody Explodes?
>>
File: trump-vaporwave-album.jpg (981KB, 800x600px) Image search: [Google]
trump-vaporwave-album.jpg
981KB, 800x600px
Working on my Trumps with some image manip algos.
>>
>>57707359
Include your neat side projects, programming competition/hackathon participation, etc
>>
>>57707481

I've been stuck trying for past 3 hours trying to figure out how to move audio files in my raw folder over to the public music folder on android. It's made worse by the fact that there aren't any built in warnings or errors anymore whenever it fails to write.
>>
>>57707695
No, it was a challenge someone linked
>>
Soup /g/
I'm planning on applying for a lot of internships for this summer and I want to make a website featuring my projects (just links to github repo, what they do, maybe screenshots or something), and have it look neat
I've done very little webshit, how do I learn quick to make a nice website?
>>
>>57707802
https://css-tricks.com/snippets/css/
>>
File: fff.png (17KB, 900x900px) Image search: [Google]
fff.png
17KB, 900x900px
Why do people refuse to learn and use JavaScript when it is the most widely used programming language?
>>
>>57707889
>most widely used programming language
I'm pretty sure C beats JavaScript by device count and LoC
>>
>>57707802
>making a website to link to github repos

Why don't you just link to your github?

Realistically, if you want to take this path, you're probably not going to make anything in the next couple of months that would rival the look of what you could make using Wordpress and tweaking a theme.
>>
>>57707904
C beats everything by LoC

That's not a good thing
>>
>>57707911
I do, and that's fine too honestly, I just think it would be neater if I made the site and it looked nice.
>>
>>57707914
>C being the most popular language is a bad thing
I'm counting C++ as well (since they are pretty similar), except C++'s standard library can't be ported to embedded hardware
>>
Linear types.
>>
>>57707889
>this weak bait again
javascript is bad and you should feel bad
>>
>>57707938
not exclusively, and it's not fair to count C++
>>
>>57707947
>not fair to count C++
Okay, i'm not. Assuming the programmers aren't morons and they have the decency to create bounds checking (literally no reason not to), then what is wrong with using C?
>>
>>57707889
Because Java is the best and most widely used programming language. You just don't see it on the github stats because it's used to make proprietary, enterprise grade software instead of kiddie web shit.
>>
>>57707966
C and C++ are very different

what's wrong with C is a lack of a lot of things
>>
File: output.webm (155KB, 1032x650px) Image search: [Google]
output.webm
155KB, 1032x650px
>>57707481
>>
>>57707981
>C and C++ are very different
The only thing I can think of that makes it vastly different is streams, but everything else (including everything you would use a stream for) can be easily emulated in C.
>>
>>57708049
>streams
a single fucking library feature is the only difference you see between the two?
>>
>>57708063
Everything else can be emulated or done away with. Streams can't because they are operators
>>
>>57708078
holy shit you're retarded
>>
>>57708078
You are dumb
>>
>>57708087
Prove me wrong
>>
>>57708099
Streams aren't operators, functions using streams have been defined as overloaded operators. Other C++ library features have overloaded operators as well.
You should kill yourself.
>>
>>57708078
I've learned today that someone is at least dumber than me in this world of programming.
>>
>>57708099
>templates
>constexpr
>enum class
>operator overloading
>constructors, destructors
>move semantics, references
>namespaces
>lambdas
>structured binding
>variadic templates
>auto

>(soon) modules, concepts, coroutines, ranges
>>
File: blood.gif (3MB, 200x150px) Image search: [Google]
blood.gif
3MB, 200x150px
>>57707481

>probably a dumb question
I'm getting to grips with functional programming.

To my understanding for a procedure or function you want to use one input at most and curry the rest of it.

Does this include constructors for instancing calls for a class/thread etc?

I'd guess you could just set the variables you need using an internal function but it just seems like that circumvents the whole point of a constructor.

Is something like this okay,

Server ticktockserver = new Server(theip, port);


versus

Server ticktockserver = new Server(theip);


Do I need to worry about the constructor's elegance? If it's just setting variables or passing references it should be O(1) right?
>>
>>57708152
How much performance do you care about?
If you're not using a functional language, then returning an erased function that returns an erased function that returns the result might be a lot slower
>>
>>57708152
>>57708168
and if your language has lambdas, and you really need a curried function, you can do it yourself, e.g

server40 = ip => new Server(ip, 40)
>>
>>57708152
Well you can't directly curry a constructor. You'd have to make a curried function that itself calls the constructor.
>>
Either node-webkit is static as fuck or I'm shit at javascript. For some reason I can't modify textareas. I'm not getting an error or anything, it's just not modifying. It's receiving the data from the server but not applying it to the element.
document.getElementById("latestdata").value += "Submission uploaded correctly\n";

That's what I'm using to try to modify it. I also tried modifying innerHTML instead of value but that didn't work either.
>>
Averaging Algoirthm Times
I used the high resolution clock Ada provides to keep it nice and fair and compiled with -O2

> 36.861433864 sec.
long c_temp = (long)a + (long)b;
return ((c_temp / 2) +
(c_temp & 1) -
(((c_temp & SIGN_MASK) >> 62) * (c_temp & 1)));


> 62.055073110 sec.
int z = x%2 + y%2;
return x/2 + y/2 + (z + (z > 0) - (z < 0))/2;


> 39.539793202 sec.
*this didn't actually solve the problem statement, but it's here for comparison
return (int)(((double)a)/2.0 + ((double)b)/2.0);
>>
>>57708192
Test this
>>57701485
>>
>>57708152
Trying to curry everything doesn't sound like good style to me.
>>
>>57708192
Does a PC really take 39 seconds to average 2 doubles or is there something I'm missing here?
>>
>>57708134
>templates
define different types
>constexpr
not needed
>enum class
macros and an integer
>operator overloading
define a function that operates on the data
>constructors and destructors
define a function that sets default values, and one for destructing it
>move semantics, references
You don't need references, pointers work
>namespaces
Just precede the function with the name of the namespace
>lambdas
define it as a seperate function, and reference it with pointers
>structured binding
That's not in the standard yet
>variadic templates
just create different types, like above
>auto
typedef
>>
>>57708212
In a functional language it is, everything is already curried
>>
>>57708215
>
not good enough
>
not good enough
>
not good enough
>
not good enough
>
not good enough
>
not good enough
>
not good enough
>
not good enough
>
it is in the standard
>
not good enough
>
not good enough, not remotely the same

seriously have you ever even used any of those before?
>>
>>57708235
Of course he hasn't, because he thinks >> and << are streams, because it looks like something is moving :)
>>
>>57708215
And yet operator overloading is somehow a big distinguishing feature?
>>
>>57708213
I ran it on like 4 billion numbers
>>
>>57708260
>MULT_POLY(ADD_POLY(poly1, poly2), poly3)
>(poly1 + poly2) * poly3
>>
>>57708213
That's probably a million or a billion tries. It doesn't make sense to time it once, because timers aren't precise enough and schedulers can make individual times report crazy numbers
>>57708235
I used templates, enums, operator overloading, constructors and destructors, namespaces and lambdas out of that list. I'm not saying the C version is as pretty or as OOP-like, but it works
>>57708260
That's because there is no direct analog in C
>>57708254
But they are stream operators...
>>57708129
>Streams aren't operators, functions using streams have been defined as overloaded operators
>overloaded operators
>operators
>>
>>57707981
I'll remind everyone that Linus (creator of Linux) still makes a point of using C over C++.
So keep learning C++ please.
>>
>>57708215
>>57708260
Also, apparently I can't read because you yourself said "define a function that operates on the data" for operator overloading. Contradictory much?

>>57708281
>template<class T>
>T identity(T value) { return value; }

>int identity_int(int value) { return value; }
>float identity_float(float value) { return value; }
>bool identity_bool(bool value) { return value; }
>void *identity_float(void *value) { return value; }
>>
>>57708291
>The US is a square with stripes and stars
>>The US isn't a square with stripes and stars, its flag is a square that has stripes and stars
>
>>
>>57708291
I don't care about OOP, none of those are OOP features (streams are, but fuck streams anyway).
Streams are just a set of library classes that happen to overload operators.

None of those features are in C.
Almost all of those features are extremely important.
>>
>>57708303
>poor man's Metaprogramming to save himself some time writing this shit out while wasting probably more time total waiting for compiles
If your build times aren't sub 2 seconds you're too slow for productive programming.
>>
>>57708303
fucking_type fucking_add(fucking_type A, fucking type B){
fucking_type retval;
clear_fucking_type(retval);
retval.fucking.variable = A.fucking.variable + B.fucking.variable;
return retval;
}
>>
>>57708340
> +
not portable
>>
What's the point of move semantics? I don't get it. Seems like an entirely superfluous feature to solve non-issues.
>>
>>57708357
Avoids unnecessary copying and can help skip destructors, which is extremely useful for non-copyable types.

E.g. RAII
>>
>>57708357
Moving is a transfer of ownership. Copying with ownership means you have to do a deep copy (or increment a reference in a shared_ptr, or something like that).
>>
>>57707981
c doesn't lack anything.
c has every feature you need and c is simple.
c++ has more (((features))) than c but it makes it a terrible language because the educational material tempts you to use all of them, which creates a big mess of software.
software shouldn't be a mess, it should be simple and beautiful.
only a fool would write software which has multiple layers of inheritance, quirky operator overloading and so on, which creates a big mess of software.
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
anyone here know multithreading?

how would i go about sectioning off parts of an array for each thread in a parallel.For() loop?

like if i want thread1 to process index 0-25, thread2 process 26-50, ect...
>>
>>57708168
>>57708184
>>57708185

I'm just curious what the functional approach/take is on constructors.

They come across as the functional equivalent of a map eg

public Server(InetAddres ip, int p, String someConfig, boolean dedicated)
{ localConfig = someConfig; inet = ip; port = p;}


Where as I could do something like this I think,
class Server {
public Server(){ init(this, someConfig) }
void init(Object server, Config b) { server.a = b; }


init I guess uses 2 inputs, but it seems the more elegant option I'd guess? I really don't know. This is all pretty new to me.
>>
File: (You).jpg (124KB, 1280x720px) Image search: [Google]
(You).jpg
124KB, 1280x720px
>>57708386
>c has every feature you need
>(((features)))
>quirky operator overloading
>>
>>57708401
The functional take on a constructor is it's a function that you call that creates an instance of a class.
>>
>>57708401
In Haskell, all functions are curried, including constructors. But this also means Haskell is going to optimise this sort of thing a lot more.

Constructors are no different to other functions.
If you've got lambdas you probably don't need to worry about currying most things, unless you're explicitly wanting to return a function.
>>
>>57708386
Linear algebra library.
No operator overloading.
>beautiful
>>
>>57708401
>>57708412
Well, when you add algebraic data types in the mix then you have that a fully applied constructor is a canonical element of the type.
>>
>>57708431
In Haskell everything is constructors.
>>
>>57708443
What return types for constructors you allow lead to really interesting properties

>languages with equality types
>letting you return an equality
quotient types, lets you say two constructors are identical

>polymorphic type
>let you restrict the type variable for certain constructors
GADTs

>allowing you to return something other than the type it constructs, or hiding constructors
lots of useful stuff like smart constructors
>>
>>57708387
>parallel.For() loop?
I'm not gonna go into it but build a work queue system. Give each worker the thread 'work' which is a structure with a function pointer and a pointer to arguments for said function (that's the bare minimum anyway). The function will know how to extract the arguments from the pointer. So for instance you could have a function pointer to a multi-threaded specific version of your current implementation which takes the arguments start_index, end_index and array_pointer. Fairly certain you can figure the function out from there.

He queue part is the tough bit. But if you're just writing something small you don't need it. Manually assign your threads the work and kick them off from the main thread.
It's among the easiest ways of doing it.

If you really need a more flexible system Google multi-threaded work queue.
https://hero.handmade.network/episode/code/day122
Here's a very pleasant introduction to multi-threading. Subsequent episodes goes through a basic work-queue implementation.
Its all done in a very C-like subset of c++ so it's easy to follow for anyone familiar with C.

It should give you a fairly good understanding of what the pitfalls and ideas behind multi-threading. It's not that difficult if you do it right.
It's game specific but easily generalises to all kinds of systems.

Good luck. The forums accept questions on old topics.
>>
>People unironically use
>
for(;;){}
>>
>>57708386
>c has every feature you need

The same could be said of assembly.
>>
>>57708412
>>57708431


Ahh okay so the elegant approach would probably just be,

Server reindeer = new Server();


Ideally all server configuration would be declared inside the class, ie

class Server{
InetAddress ip = new InetAddress.getWhatever();
final int port = 80;
ServerConfig config = new ServerConfig();
// etc
>>
#include <stdio.h>

/* declare variable of type int */
int var;

/* declare a pointer to type int */
int *ptr;

int main()
{
/* initialize var */
var = 1;

/* initialize ptr to point to var */
ptr = &var;

/* display address of var */

return 0;
}


What is the correct way to print the address of "var"?
printf("address of var [ptr ] : %p\n", (void *)ptr);


or

printf("address of var [ptr ] : %p\n", ptr);


On linux (gcc) they both work.
>>
>>57708484
Path constructors are a little different because you're not adding new elements to the type itself but rather adding new elements to its equality type. You're actually potentially making the type smaller when you give it path constructors.
>>
>>57708539
>Path constructors are a little different
GADTs are a little different too, as are smart constructors
>>
>>57708533
the casts don't do anything, arguments after the format string have no type and get interpreted by the format specifier. leave them in if you want to be explicit.
>>
>>57708538
>What is the correct way to print the address of "var"?
printf("address of var [ptr ] : %p\n", &var);
>>
>>57708574
>that type belongs to certain typeclasses
nothing to do with constructors
>>
File: diaphragm.jpg (14KB, 190x184px) Image search: [Google]
diaphragm.jpg
14KB, 190x184px
>>57708538
>those comments

You're missing one for the return value, and one for an explanation of what "main" is. Apply yourself.
>>
>>57708512
yep, it's just a small c# assignment for a class. I was hoping to avoid doing things manually to this extent, but I suppose it can't be helped.

This video is looking interesting though, so thanks for that senpai.
>>
>>57698300
>>57698429
Maybe try reading a book, nigger? Rather than spouting off opinions based upon your arbitrary baby duck experiences as a code monkey?

It is prefix notation that makes Lisp homoiconic and naturally suitable for metaprogramming and higher-order function application. The (car) is always the procedure and the (cdr) is always the parameters. From this foundation basically springs forth everything else. The original plan was to eventually implement M-expressions in Lisp, but nobody actually ended up wanting them.

It's fine to be ignorant and willing to learn, but the way C-niggers and ML-niggers just assume whatever they grew up with is automatically the "natural" way to organize information is shameful.
>>
>>57708588
>>57708538

also missing one typing out the full name of the library reference.
>>
>>57708680
>niggerniggernigger
opinion discarded
>>
>>57708649
I'd imagine more c# specific resources exist that tell you more. They probably have some abstraction that's for just this.

If you just want to get done look for that first. But I highly recommend the videos because they're less environment specific and the Q&A's are often enlightening as many of his friends watch for fun and or it answers newbie questions directly.
>>57708680
>nigger
Woah man chill out.
>>
File: 1474324373608.jpg (568KB, 2169x2751px) Image search: [Google]
1474324373608.jpg
568KB, 2169x2751px
>>57708566

Okay cool so I can just call the function without having to worry. Thank you, appreciate it!
>>
>>57708727
>thought it was some random gymnast
>it's just the American singer-whore
Disappointing.
>>
Also claiming Scala is the way *anything* should be done is the most laughable thing I've read in a long time.
>>
>>57708770
Whoever decided Haskell, Ocaml and Java were a good mix should be kept away from computers
>>
File: mfw.png (114KB, 456x356px) Image search: [Google]
mfw.png
114KB, 456x356px
>>57708588
>>57708689
Ah geez guys, let me learn/take notes in my own way. The second I type that stuff out and move on to the next lesson I forget it. Verbose comments help me remember.

I thought this was a bully free zone!!!
>>
>>57708299
because kernel dev is so relevant to most people
>>
>>57708693
>>>/reddit/
>>
>>57708783
why isn't haskell good?
>>
File: kyr.jpg (435KB, 566x800px) Image search: [Google]
kyr.jpg
435KB, 566x800px
>>57708755

Is this more to your liking anon?
>>
>>57708830
You must be new here.
>>
>>57708852
Yeah but not much better.
>>
>>57708857
>you must be new here
thats what newfags actually use
but lets not derail the thread with our shitposts
>>
>>57708880
>t-that's what newfags actually use
>derail
>shitpost
>nigger
> >>>/reddit/
You need to learn to fit in.
Calm your autism, and learn to reply like a real human being.
>>
Anybody use Unity?

Im trying to make a game now 2D just watching tutorials now
>>
>>57708800
Well the reason he likes it isn't specific to kernel dev. You could easily do kernel dev in C++.
You could easily do non-performance intensive work in any language that allows you to import DLL's and just write the rest of the stuff in C.

There's no reason to step on this middle ground where you have poorly implemented garbage through C++ and poor work flow because you're not using a better language.

It bothers me that people don't take any control of their environment. It's gonna doom us all some day I swear.
>>
>>57708842
lazy by default is harmful: a nightmare to debug
needlessly symbolic: difficult to DuckDuckGo and syntactically ambiguous
puzzle-oriented programming is fine for hobbyists/students/researchers sucking grant money, but it's not very useful for actually making programs
>>
File: 1448741735544.jpg (20KB, 320x267px) Image search: [Google]
1448741735544.jpg
20KB, 320x267px
>>57708794
Don't worry friend! I'm declaring this thread a no-bully zone!

Also yeah &var is the clearest.
>>
>>57708950
frogs can't be bullied
>>
>>57708906
/agdg/ on /vg/ do that stuff. They're mostly shit posters who complain about not making progress but they do have good things to say.

Worth considering that they're also prone to repeat opinions. They will tell you to not do 2D in unity.
Ask them to motivate why in a nice way.
>>
This is the last time I try to do anything HTML-related. I spent 3 fucking hours trying to make this shit work. And it still doesn't work. Next time I'll use winforms or something.
>>
>>57708900
why are you still shitposting?
>>
>>57708929
>You could easily do kernel dev in C++.
so what's wrong with C++ then? it's basically C with some good features on top of it, like constexpr, user-defined namespaces, and classes
>>
>>57708975
I'm not, I'm giving you advice, anon to new anon.

Only 1 out of 3 parts of >>57708680 are actually worthwhile.
>>
>>57708967
Well from what i gathered you have to make your own functions for the physics since their physics engine sucks major balls..

But I never knew c# so this is a nice little new language to learn.

Anyway I did read up on most game engines and Unity seemed to get the most reps by posters in the top google searches so i decided to give it a go. Thanks friendo
>>
Y'all can say whatever you want but I would want C to have operator overloading.
>>
Let's say I have 4 random numbers in C++, how can I check to see that they're all different from each other without having to use a dozen != operators?
>>
>>57708986
Ask Linus.
Or read what he has said.

I find you're rather bold with claiming things about C vs C++ if the fact that you _can_ do kernel dev in C++ wasn't already apparent to you.
Just a small point.
>>
File: 1368926151215.jpg (31KB, 228x243px) Image search: [Google]
1368926151215.jpg
31KB, 228x243px
>>57708723
yeah that was my thinking. Ended up accomplishing my goal through a lambda expression.

Parallel.For(0, systemThreadCount, a =>
{
for (int i = blockAllocation[a, 0]; i < blockAllocation[a, 1]; i++)
{
key key = new key();
char c = key.decrypt(bytes[i], blockSize); //parameters are byte_to_decrypt, block_size
decryptedMessage[a] = decryptedMessage[a] + c;
}
});


No point relying on premade shit, though. I usually like to leave these kind of videos on in the background while doing my work.
>>
>>57708944
but haskell is exprssive
lazyness is not the only way, you can add strictness whenever you want
but I do admit, its hard to reason about how something would be in terms of space complexity when there's lazyness involved

can you expand on the "needlessly symbolic" and "puzzle oriented programming" parts
>>
File: yuki.gif (2MB, 450x258px) Image search: [Google]
yuki.gif
2MB, 450x258px
>>57708872

More of a Yuki kinda guy?
>>
>>57709023
I wish I could program that fast
>>
>>57708992
It's not up to you to decide what's "worthwhile"

If you don't require the foundational features of a language in your specific use case, then don't write in it. Far more productive than smugly asserting that the designer must have gotten the syntax "wrong" somehow.
>>
>>57708992
I'm not even the lisp poster.

I actually want to use lisp, but there's no decent tui library.
>>
>>57709000
Well some prefer to have work done for them. I suspect that opinion comes from 3D unity users aiming to do a game in 2D for once.
It's not uncommon to implement a lot of stuff yourself without the use of engine tools in 2D because the barrier to entry is lower. Also as you may understand when you look at 2d vs 3d games 3d games more often than not follows the real world in some regard. Where as 2D games are completely different. If you're making a very odd game in 3D you wouldn't use unity's physics components either. You'd write your own.

That's just my take though.
>>
>>57708986
Too much legacy code to fully adapt to C++

Also there's not much point other than making life more complicated. Well structured C98 code still beats poorly structured C++17 code any day.
>>
>>57709030
>>57709034

I'm didn't make either of the posts you(?) were replying to. I was just pointing out, that

>Maybe try reading a book, nigger? Rather than spouting off opinions based upon your arbitrary baby duck experiences as a code monkey?

>It's fine to be ignorant and willing to learn, but the way C-niggers and ML-niggers just assume whatever they grew up with is automatically the "natural" way to organize information is shameful.

is unwelcome
>>
>>57709003
recursion
>>
>>57709054
but isn't being edgy part of the 4chan culture?
why are you discouraging the traditions?
>>
>>57709050
depends on the industry i guess, C++ is by far more popular for game dev and legacy code is hardly an issue for that
>>
>>57709069
>but isn't being edgy part of the 4chan culture?
No. That's a new thing. Before, that was contained in one or two boards.
>>
>>57709023
Yeah. I like average (real average) looking 3d girls (grownup girls) sleeping in puffy clothing more than Anime though.
But I have to sleep now.

Good night everyone. Enjoy your endless pointless struggle!
>>
>>57709065
It's just one line though:

 i != j && i != k && i != l && j != k && j != l && k!= l 
>>
>>57709101
>collegegrad.png
>>
>>57709003

Store numbers in an array, use 2 for loops.
>>
>>57709101
rather use a fucking switch
>>
>>57709016
>expressive
All functional languages are.

>"needlessly symbolic"
Haskell is runic in the way Perl and APL are. Looks cool, but it's impossible to enter into a search engine.

>"puzzle oriented programming"
Just a general dig at the way its "elegance" rarely scales beyond some nice-looking fibs functions in a wiki article
>>
python is really starting to fuck me off
looking for more type safety
but still high-level
>>
File: 1470662268030.gif (534KB, 500x374px) Image search: [Google]
1470662268030.gif
534KB, 500x374px
>>57709003
Add them as keys to a hash table and check for collisions. This is O(n).

Or, put them in an array and sort them, and do pairwise checks on the adjacent numbers.
>>
>>57709101
Are you serious with this?
>>
>>57709003
if you're generating them then consider shuffling a set of numbers (if the set isn't too big) so you just have to pick four from the shuffled set which are guaranteed to be different
>>
>>57709146
>Haskell is runic in the way Perl and APL are.
Hackage and GHCI, especially type signatures
>>
>>57709150
haskell
>>
>>57709150
Learn Crystal. :3
>>
>>57709150
Haskell
>high level
>type safety
>>
>>57709150
Just bite the bullet and use java m8.
>>
>>57709205
He said high level type safety
>>
>>57709150
>Python
Since you're already used to shit languages, I suggest Haskell
>>
>>57709003
template<class T, class ...Us>
bool helper(T, Us...);

template<class T>
bool helper(T) {
return true;
}

template<class T, class U, class ...Us>
bool helper(T x, U y, Us... ys) {
return x != y && helper(x, ys...);
}


template<class ...Ts>
bool distinct(Ts...);

template<>
bool distinct() {
return true;
}

template<class T, class ...Ts>
bool distinct(T x, Ts... xs) {
return helper(x, xs...) && distinct(xs...);
}


Examples:
distinct(10, 20.0, 10.0f) == false
distinct(10, 20.0, 30.0f) == true


A more advanced implementation would say that values of incomparable types are distinct as well, but this will just fail.
>>
how do I build portfolio
>>
File: 1476073184416.jpg (5KB, 300x57px) Image search: [Google]
1476073184416.jpg
5KB, 300x57px
>>57709073
That's because OOP is a must to write quick and easy games. New games come out every single year. And if they take 17 years like that Duke Nukem game, they turn out shit because they can't use the updated technologies.

Linus isn't programming an entirely new kernel every year

Also Linus incredibly hates C++
http://harmful.cat-v.org/software/c++/linus


Also what did jewgle mean by this?
>>
>>57709003
I'm confident xor logic can do this well somehow..
>>
>>57709215
Learn java, make android apps.
>>
>>57709216
OOP is retarded.
>>
File: d96.jpg (27KB, 600x600px) Image search: [Google]
d96.jpg
27KB, 600x600px
>>57709150
c# my man
>>
>>57709216
OOP is shit for games. It prevents optimizations, encourages coupling, doesn't work well when you need to be flexible with everything, etc.
>>
>>57709208
t. c fag
>>
>>57709150
literally java
>>
>>57709229
that do what?
>>
File: 1480060943542.png (231KB, 323x420px) Image search: [Google]
1480060943542.png
231KB, 323x420px
>>57709127
>>57709143
>>57709157
>>57709161
>>57709214

Maybe I wasn't clear, but I thought there was a shorter way of doing it, that's why I asked. My solution is only one line, so I guess it's fine.

>>57709159
>>57709117
lol

>>57709221
This might work, continue please.
>>
File: jh.png (602KB, 963x720px) Image search: [Google]
jh.png
602KB, 963x720px
What are JS generators for, /dpt/?
>>
>>57709235
java if you're not on windows
>>
>>57709252
My solution is shorter, there's just some up-front work. It scales to any (constant) number of things you want to compare.
>>
>>57709270
Thanks, but I'm only doing this once, and only using 4 numbers.
>>
>>57709242
You wish. I use Scheme and Ocaml.
>>
>>57708950
>I'm declaring this thread a no-bully zone!
Thanks friend!

/*
* 11-21-2016
* Demonstrates pointer arithmetic
*/
#include <stdio.h>
#define MAX 10

/* Declare and initialize integer array */
int i_array[MAX] = { 0,1,2,3,4,5,6,7,8,9 };

/* Declare pointer to int */
int *i_ptr;

/* declare int variable */
int count;

/* declare and initialize float array */
float f_array[MAX] = { 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 };

/* declare pointer to float */
float *f_ptr;

int main()
{
/* initialize pointers */
i_ptr = i_array;
f_ptr = f_array;

/* print array elements */
for (count = 0; count < MAX; count++)
{
printf("%d\t%f\n", *i_ptr++, *f_ptr++);
}

return 0;
}
>>
>>57709231
>>57709241
Nice arguments brah.

Oh wait... they weren't.

If OOP is that shit, then how about you make a game in pure C98?
>>
>>57709249
The world is an oyster. Make anything you desire.
>>
>>57709284
Please explain how OOP is good for games. If OOP is so amazing, this should be easy, right?
>>
File: 1479846663353.jpg (55KB, 900x810px) Image search: [Google]
1479846663353.jpg
55KB, 900x810px
>>57709284
>OOP is the only alternative to C98
>C98 isn't superior to OOP anyway
>>
>>57709252
unless you're code-golfing that's irrelevant.

You might only need to check four variables today, but you shouldn't assume that will continue to be the case indefinitely
>>
>>57709252
Are you trying to get us to do your homework bruh.
>>
>>57709279
>ocaml
hahahhahahhahahahahaha
>>
>>57709280
please add an extra comment to describe the data, the macro, the include and the print format
>>
>>57709221
i think it'll be similar to >>57709101

two equal numbers XORed together will be zero (compilers often use XOR for this) but how will you deal with four numbers?
>>
>>57709216
No look at Mike Acton's cpp con talk. Find the Q&A.
One of the questions is. In response to how he practically doesn't use c++ features for anything throughout all the slides. About why he uses C++.
It's very enlightening to why c++ is popular overall.
Nobody (should) like it but it's a multi-paradigm language that pleases people half way. It's a wallmart. Crappy quality

That talk overall is a great idea to watch if you wish to be less dogmatic about C++ and or learn more about performance. The stuff he presents is the very basic and simple stuff you can figure out yourself in 10 minutes to multiply your speed by rather large factors. If you wish to be more dogmatic just watch anything else that isn't about performance at C++ con.
>>
>>57709308
Says the Haskell-nigger
>>
>>57709101
just use (=) from common lisp
>>
>>57709287
any ideas?

>tfw you're not an ideas guy
>>
>>57709306
No, I just created a cheeky little script and wanted to shorten that part of it.

>>57709299
Your write
>>
>>57709320
why do you hate haskell so much
can't handle using your brain?
>>
File: shiggy.png (298KB, 425x524px) Image search: [Google]
shiggy.png
298KB, 425x524px
>>57709252
>My solution is only one line
you are a disgusting.

I hope you never get a job out of college you are currently in.
>>
>>57709311
The thing is that xor preserves information well. So if you've xor ed 2 numbers and they were equal you'd just have 0. If you xor 4 numbers you should have 0 if they were all equal.

But it's 5:30am. I can't sleep. Good luck.
>>
File: wut.png (152KB, 354x404px) Image search: [Google]
wut.png
152KB, 354x404px
>>57709332
>Le let me le write multiple lines for a simplistic little part of a simple script.

Is your job fast paced and important?
>>
>>57709323
a twitter clone that's big on free speech (twitter is banning alt-right posters while defending everyone else)
>>
i think functional is in my future: my classes in Python are just namespaces for functions and tuples (almost entirely read-only).
i'm just not sure it's Haskell
>inb4 holy war
my biggest Python plus is loads of libraries. Whatever meets type safety and shitloads of libraries will win.

Java/C#: more of the same shit.

Java sucks: unnecessarily large standard library; said library sucks balls; type casting fun; no multiple inheritance; end up writing so many SLoC that should be unnecessary.

Scheme caught my eye. Has less evangelists than LISP which means it could actually be good. but i'm afraid its too old/not enough libraries.
>>
>>57709317
I'd say C++ is worth using solely for templates. I mean, you could do the same with preprocessor in C but you get worse errors and the definitions look ugly.

Because you brought up Mike Acton, here's a template thing you can do for cache:
struct Foo {
int x;
float y;
}
Foo foos[100];

// what if we want the xs to be contiguous and the ys to be contiguous?

template<int N>
struct Foos {
int x[N];
float y[N];
}

using Foo = Foos<1>;

Foos<100> foos;

And there's the coolest feature of Jai that JBlow doesn't seem to realize you can already do in C++. You could even generalize it for any type constructor if you wanted it for more than just arrays.
>>
>>57709350
the problem is if only 2 or 3 are equal

you need to do more than just xor them
>>
>>57709363
>(twitter is banning alt-right posters while defending everyone else)
this is false, loads of "kill white people" tweeters got banned
can't just get your information from /pol/

anyway, his idea has already been done. I can't remember the name of it. but the more the merrier, it means less cancer on 4chan.

>>57709373
Haskell has loads of libraries, check hackage
>>
File: CE Amp bias calculator.png (182KB, 2554x1408px) Image search: [Google]
CE Amp bias calculator.png
182KB, 2554x1408px
I just wrote up a quick common emitter amplifier bias calculator because fuck doing the calculations out by hand.
>>
>>57709330
I write programs to fulfill concrete desires quickly and efficiently. I'm not interested in your autistic theoretical playground of puzzle-oriented programming.
>>
>>57709373
look into f#.

you can implement c# functions in f# and vice versa.
>>
>>57709317
>>57709377
Also the fact that you can use constexpr ints as arguments to int templates is a big plus.
>>
>>57709377
You should use std::array<T,N> over T[N].
You could even write your own std::array, and give it the exact same semantics as structs (a simple co-inductive definition)
>>
>>57709379
or even if none are equal but the combination of them cancels out, for example 0 1 7 6
>>
>>57709101
lmao
test = subtest . sort
where subtest (x:y:zs)
| x!=y = subtest (y:xz)
| otherwise = False
>>
>>57709373
Scheme is functional that is actually functional. use Chicken. It has nice libs and community.
>>
>>57709397
t. unemployed neckbeard
>>
>>57709420
> !=
>>
>>57709363
i need an internship fast or I will be fucked for summer I have no job in usmmer
>>
>>57709420

subtest (x:y:zs) = (x /= y) && subtest (y:xz)
>>
>>57709428
Once again:
says the Haskell-nigger

lmao
>>
>>57709480
where's your job
show me your github
you're just an "enlightened" evangelist
>>
>>57709480
>>57709320
I thought we'd been over this
curb the autism
>>
>>57709450
what are you interested in? you could get started with flappy bird clones and simple games like that pretty easily. web dev is easy and could probably get you an internship fast
>>
>>57709411
You mean like this?
template<class T, int N>
struct Array {
T x;
Array<T, N-1> xs;
};

template<class T>
struct Array<T, 0> {};
>>
>>57709518
Exactly.
>>
>>57709523
Not sure how that's coinductive unless you're just saying it's a record, which are both inductive and coinductive at once.
>>
>puzzle-oriented programming
Where did this meme come from?
>>
>>57709534
You're probably right, I forget
>>
>>57708078

back to Java with you
>>
>>57709550
its just the scheme fag who says it
he's literally the new data-fag
unless its him and he's suppressing some of the autism
>>
>>57708215

please be bait....


...please
>>
>>57709496
I'm a high school physics teacher. I use Scheme and ocaml to write unique problems for my students, as well as make interactive demonstrations for my classes. I'm not in development and I don't want to be. It's important that I can hack something together over a weekend.

I'm sure wherever you work has you writing some enterprise-tier curry language shit all day. You need to retreat back to Haskell when you get home just to give your brain some exercise.
>>
>>57709587
It's not
he believes it
>>
>>57709588
>teacher
i'm so sorry
>>
>>57709502
okay I guess I will start with a game then
>>
>>57708340

shouldn't it be

return retval.fucking.variable
>>
>>57709588
wtf, this is a lie
there's no way you can have a job
i'm going to belive that you don't have a job
and you can hack haskell stuff quickly
>>
>>57709554
A coinductive type (as opposed to a record) is like this:
codata Stream : * => * where
head : Stream A => A
tail : Stream A => Stream A

Typically you express coinductive types by their eliminators (whereas inductive types are expressed by their constructors) but there's no hard and fast rule. With a record you typically supply a constructor as well as an eliminator for each field.
>>
>>57709609
Not him, but:
>high school physics teacher
>dat young pucci
>>
>>57709609
Don't be. I like my job. I'm not alienated from the product of my labor.

Enjoy making money for your Jewish boss all day.
>>
any who uses racket here?
should I buy into it
will it make me productive
>>
>>57709635
what is couloumb's law (wihtout goolging it)
>>
>>57709630
You can think of pairs as being records where (_,_) is the constructor and fst and snd (or car and cdr or whatever) are the eliminators.
>>
>>57709635
>nigger
>jewish
Calm down anon, you don't need to intersperse retarded /pol/ memes every 3 words
>>
>>57709637
Racket is good. Go for it.
>>
>>57709655
poo in loo pajeet
>>
>>57709685
thanks for validating what I wanted to do!
>>
>>57709630
How would you express a state machine in a dependent language like idris?
I was thinking in along the lines of >>57707558, but parametrised over a list of associations

>>57709687
Do you have aspergers syndrome?
>>
>>57709402
not an attractive feature
>>
>>57709685
wait, does it have currying and pattern matching?
>>
>>57709710
Same way you would in Haskell? Dependent types don't really affect it.

I just use ADTs for state machines.
data State = Locked | Unlocked

push :: State -> IO State
push Locked = putStrLn "The turnstile doesn't budge" >> return Locked
push Unlocked = putStrLn "The turnstile spins and locks behind you" >> return Locked

coin :: State -> IO State
coin Locked = putStrLn "The coin rattles and the turnstile unlocks" >> return Unlocked
coin Unlocked = putStrLn "The coin drops into the return tray" >> return Unlocked
>>
>>57709779
I mean type level like >>57707558 but parametrised
in the example in that post, invalid state transitions are type errors
>>
>>57709739
(syntax-rules) macros have pattern matching that puts Haskell to shame

no currying unless you implement it with some closure/macro funtime.
>>
>>57709807
>using macros everywhere
t. lisp
>>
>>57709790
Oh, I see. It would basically be the same thing but you wouldn't be doing everything explicitly at the type level. Instead of a type family, 'From' would be an ordinary function from a colour to a list of colours, for example.
>>
>>57709807
(((syntax-rules)))
>>
>>57709807
so, no partial application?
danm, I was ready to switch too.
>>
Were you a language hopper?
On what language did you end up?
>>
>>57709851
No
C
>>
>>57709851
No
C
>>
>>57709851
no

C++
>>
>>57709851
No
C
>>
>>57709840
Are you retarded?
Currying and partial application are not the same thing. In fact when most people refer to currying they aren't actually talking about currying.

You can partially apply with closures, which are obviously widely used in Scheme.
>>
>>57709873
>In fact when most people refer to currying they aren't actually talking about currying.
they're talking about shitting?
>>
>>57709828
I almost never use macros. But if you have a boner for pattern-matching, it's there. And it's much more powerful than ML languages.
>>
Two things done!
1) Order of operations is now completely functional. the parser reorders the tree nodes according to the operation priority.
2) Codegen, while not actually generating assembly quite yet, does basic optimizations of the tree. And by basic optimizations I mean combining constants.

Also, I wrote a generic function to walk the tree which allows me to get rid of some of the pesky if statement chains that I had to do every time I needed to call a function on every node of the syntax tree, or a specific type of nodes. Refactored a shit ton of code to use the new walk function.

I also wrote a debug macro for printing out file name and line, which you can see in the output.
>>
>>57709851
Yes, C++
>>
>>57709851
No
Rust
>>
>>57709855
>>57709867
>>57709923
do these give you a code-monkey job?
>>
>>57709933
Borrow checking is code monkey repellent.
>>
>>57709933
not really, look at java and C# for code monkey jobs, maybe python and javascript but those are more webdev-related
>>
>>57709916
How did you make the tree? If it's recursive descent parsing then you really could have followed the convention of something like
 
expression ::= [ "+"|"-"] term { ("+"|"-") term}.
term ::= factor {("*"|"/") factor}

so order of ops is done by parsing naturally
.
factor ::= ident | number
| "
(
" expression
"
)
“
.
>>
>>57709958
woops
expression ::= [ "+"|"-"] term { ("+"|"-") term}.
term ::= factor {("*"|"/") factor}.
factor ::= ident | number| "(" expression")“.
>>
>>57709970
&, !, ^, > , < , () etc all have different priorities.
It was honestly a lot easier to just balance it afterwards. I did consider what you were saying though, and did it that way in my prototype.
>>
>>57709933
Rust is 100% non-codemonkey guaranteed.
And that's a good thing, since I can grow my career without codemonkeys shitting up my job offers.
>>
>>57709988
Gotcha, whatever works
>>
>>57709988
*reorder, not balance. I've worked too much with red black trees.
>>
>>57709988
>> , <
>>
>>57710000

Just GET checking...
>>
>>57709995
>Rust
>career

kek
>>
>>57710029
Y-you j-j-just watch me! I'll m-m-make a career out o-of this!
>>
>>57710015
?
>>
>>57710040
>implying submitting CoCs isn't already a career
>implying hundreds aren't already being paid more than you to do this
>>
>>57709884
Currying is primarily a syntactical concern that describes the behavior of a language to automatically return a closure expecting the next argument. All it effectively means is you can write stuff with less lambdas. This is obviously a big deal to syntax-obsessed Haskell wankers who are allergic to parenths

But in real world coding in non-curried languages there's nothing preventing you from just writing
(lambda (z) (f 1 2 z))
and having it behave precisely the same way. Moreover manual partial application of a function doesn't have to concern itself with the order in which parameters are curried up
>>
Will perl6 ever move beyond a meme language?
>>
>>57710061
Currying is great for function composition
>>
>>57707889
i dont think it would be the most widely used programming language if so many people refused to learn it
>>57710069
not seeing any progress so doubtful :(
>>
>>57710081
this, I'm not concerned with semantics
what I want to know is if I can do partial application
>>
>>57710212
I just fucking showed you how to do it.
>>
Hey /dpt/, I'm a freshman in college studying to be a SE, and I'm currently writing a resume that I'm hoping will land me an internship this summer.

What are some of the things I should/shouldn't talk about? Any advice or tips from some seasoned vets would be appreciated.

Thanks.
>>
>>57710229
oh yeah, can you do composition to, this is why I want partial application
>>
>>57710262
nothing is stopping you from doing function composition, no
>>
>>57710245
don't talk about salary unless they showed you the salary
>>
>>57710342
I mean easy function composition like in haskell
>>
>>57710397
Not by default.

But then again, it's literally five lines of code: http://wiki.c2.com/?ComposeFunction
>>
less than 48 hours remain until I get rejected from my last job prospect. I don't know what I'm going to do /dpt/
>>
>>57710542
change your race and apply again
>>
>>57710570
I've considered putting my gender as female
>>
>>57710603
Who are they to question you?
>>
File: 9.jpg (48KB, 492x492px) Image search: [Google]
9.jpg
48KB, 492x492px
Why are you never working on something that has over 1,000 active users, /dpt/?

Why is it always little meme projects with you guys?
>>
I'm learning C# right now. While I like reading about the features of the language, I think I need some tips and references about software design.

I'm using SFML.NET to make some simple games, like snake, but I feel that the way I'm doing it is too clumsy and not optimal.
>>
>>57710245
put a small black and white portrait to show you're not a pajeet
>>
>>57710446
>5 lines to compose functions
>>
>>57710639
most people don't have the time to work on projects that big mostly. or their interests just don't have to do with that kind of shit. for example, im much more interested in writing code for other programmers than for normies, and because i use less popular programming languages that pretty much means <100 people will use my libraries or tools.
>>
>>57710758
Well whitespace is arbitrary in Scheme. You can do it in one if you're so inclined.
And it's five lines to implement a function composition function, not compose a function.
>>
Is there a generic header name? Something like main.c/main.cpp
>>
>>57707558
finally finished mine
import Data.List

data Color = White | Black | Purple | Red | Green | Orange
deriving (Eq, Enum)

colors = [White .. Orange]

data Muslim = BOOOOOM | NoGoat4U
deriving (Show)

-- Left xs == colors you cant cut
-- Right xs == colors you can only cut

cut White = Left [White, Black]
cut Red = Right [Green]
cut Black = Left [White, Green, Orange]
cut Orange = Right [Red, Black]
cut Green = Right [White, Orange]
cut Purple = Left [Purple, Green, Orange, White]

boom [] _ = NoGoat4U
boom (c:cables) allowed
| elem c allowed = boom cables allowed''
| otherwise = BOOOOOM

where allowed'' = case (cut c) of
Left cs -> colors \\ cs
Right cs -> cs
>>
File: would you a confused ringo.jpg (36KB, 500x489px) Image search: [Google]
would you a confused ringo.jpg
36KB, 500x489px
There are some good real time plot/data streamer libraries that works well on javascript?
I've been trying charts.js but kind of works like shit when updating the graph few times a second with 6 time series.
Any recomendation or idea about this?
>>
>>57710831
hm, have you tried echart ?
>>
File: ringo eats something.jpg (21KB, 320x345px) Image search: [Google]
ringo eats something.jpg
21KB, 320x345px
>>57710912
nope, I'll check it out
thanks tadakuni
>>
File: 5.png (395KB, 680x665px) Image search: [Google]
5.png
395KB, 680x665px
My get the latest post number script goes like:

57711369
57711370
57711370
57711370
57711370
57711371 <-
57711370 <-
57711370
57711370
57711370
57711371
57711375
57711375
57711375
57711375
57711375
57711376
57711375
57711375
57711376 <-
57711375 <-
57711375
57711377


Notice a problem, /g/? ;_;

Is it my fault or is it something 4chan does?
>>
>>57707889
Because they are mentally retarded.
>>
File: 200_s.gif (55KB, 368x200px) Image search: [Google]
200_s.gif
55KB, 368x200px
>>57707481
>look at a programming tutorial on youtube
>teacher is a pajeet
>>
Kek.
>>
>>57711477
>>57711532
delet this
>>
>>57711655
Good post, senpai.
>>
>>57711414
caching?
>>
>>57711414
it's 4chan most likely
>>
Third day of psyching myslef up to start actually coding.
>>
Just finished a simple game in C#

It's the first project I ever finished

It feels like, "fuck, this simple game shouldn't take me so long to me... I'm sure others do it in half time..."

Feels good and disappointing at the same time.

Are such feelings normal?
>>
>>57707481

Honestly, not much. I just installed Slackware on my laptop a few days ago and I'm trying to configure stuff so it annoys me less. I'm still trying to figure out why left alt and right alt behave differently in console mode. It makes no sense I tell you. I'm using a US keyboard, I don't have/want an AltGr key.

I had a great idea for a program kind of like 'ack' or 'ag' that only searches inside string literals in your code, but I'm too lazy to actually write it.
>>
>>57711778

Yes. I hate everything I have ever programmed. I have a sneaking suspicion we all do.
>>
File: 1432259490310.jpg (68KB, 700x700px) Image search: [Google]
1432259490310.jpg
68KB, 700x700px
>>57711778
yes, its starts off as you liking the simple game. But by the end you realize your game is shit. And its mostly because the graphics are ass and there is nothing you can do about it
>>
>>57711778
>It feels like, "fuck, this simple game shouldn't take me so long to me... I'm sure others do it in half time..."

That for sure, but also "I'm stuck on this problem. Why am I so shitty?" and later "Fuck me, that should have been obvious. I'll never be competent".

I've been doing that for years, and although I get better, it never feels that way.
>>
What does /dpt/ think of Akka?
>>
>>57711925
/dpt/ doesn't because nobody has heard of it
>>
>>57711925
Is that a new meme language?
>>
>>57711925

Not a Scala programmer so I can't really tell you. More generally though, what exactly is the difference between agents (in the Clojure sense) and actors? I seem to remember the distinction being something like "inspecting the state of an actor in as ordinary message-passing operation that's queued like all the others" whereas agent state is immediately visible. Or something like that. I'm really confused and haven't gotten a change to dig into clojure more yet.
>>
What is this "linked lists are obsolete" meme I keep seeing on /g/?

Is it true? Or just another bullshit meme?

I have a use case for linked lists: storing Time To Live of particle effects and deleting them when they expire. Since particle effects have different times to live depending on type and are triggered by the player, they need to be accessed and removed at effectively random indexes.

I can't think of a way this could be solved better with arrays.
>>
>>57712076
Don't you have to traverse the linked list to find the index?
>>
What's the best way to dive into a new language:
Read tutorials
or
Make a random program and google when you get stuck
>>
>>57712076
Actually, for that use case, using linked list is terrible idea. It fucks with memory locality and creating new particle instances is going to be slow.
You should use static array of particles with "IsActive" flag on particle. And maybe keep hashset of indexes to inactive particles.
>>
>>57712086
I mean, what do I do about the empty array indexes that are left over after elements are deleted?
Isn't it bad to have them?
>>
>>57712131
You reuse them.
See >>57712129
>>
NEW THREAD >>57712158
NEW THREAD >>57712158
NEW THREAD >>57712158
NEW THREAD >>57712158
>>
>>57712129
>>57712141
Hm, that by extension means that I would have to set a limit on a number of particles active at the same time.
Which is not a problem because you're meant to do that anyway.

I guess the tutorial I'm reading bullshitted me about linked lists being better for this task.
>>
>>57712186
I mean, even if you ignore cache locality, even theoretically linked lists are the worst data structure for frequent RANDOM insertions and deletions because they take O(n) time.
>>
>>57711778
you're learning. settle down.
and remember: every time you do something outside your comfort zone, you're not going to be max productivity.
>>
>>57712076
linked lists are 100% trash

keep the array sorted or just iterate through the array. i think mike acton talked about literally the same type of use case in his cppcon talk
>>
>>57712243
>>57712208
https://www.youtube.com/watch?v=YQs6IC-vgmo
Well, if this guy says linked lists are bad, then who am I to argue.
>>
>>57712167
wtf is wrong with this thread?
>>
>>57712271
what do you mean
>>
tfw too smart to go to a thread full of weebs
>>
>>57712271
we've hit the bump limit
>>
>>57712252
Joggin my noggin. So do schools still teach linked lists? Mine did
>>
>>57711642
dude what
Thread posts: 323
Thread images: 32


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