[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: 339
Thread images: 38

File: 1445886961619.png (1MB, 1280x720px) Image search: [Google]
1445886961619.png
1MB, 1280x720px
What are you working on /g/?
Last thread >>56440203
>>
Recommended text/videos/MOOC/whatever to learn C?
>>
>muh algorithms
>muh data structures
>>
File: 1460197539579.png (260KB, 600x800px) Image search: [Google]
1460197539579.png
260KB, 600x800px
first for rust
>>
File: 1471719215499.png (599KB, 800x1280px) Image search: [Google]
1471719215499.png
599KB, 800x1280px
>first class environments
>>
File: backdoor.png (80KB, 1643x724px) Image search: [Google]
backdoor.png
80KB, 1643x724px
Found out the modem distributed by my ISP has a backdoor, what do?
>>
>>56447544
http://arstechnica.com/gadgets/2016/04/the-ars-guide-to-building-a-linux-router-from-scratch/
>>
Trying to program a new text hud for my game, this engine makes huds kind of tricky.
The new hud is almost done.

>>56447447
Darkstar (Tribes version).
>>
>>56447553
Is there anyway I can "wipe" the "OS" that is in that router and follow that tutorial?
>>
>>56447603
Game development is not programming.
>>>/vg/agdg
>>
>>56447470
...Is that show seriously a thing or is that a photoshopped sub?
>>
>>56447623
Yes, this show does exists.
And no, the sub is not photoshopped.
>>
>>56447621
Game development is programming, when you do not use premade engines and shitty drag and drops.
>>
>>56447623
Of course the subs are fake.
Very few shows even mention anything programming related, and none of them actually go into real detail.
It's just an extremely shitty short series about some insecure fag.
>>
>>56447470
I need help, guys.
I have an image and a list of colors, and I need to find out for any given pixel in the image, what the closest color in the list is. They're all in tuples.
>>
>>56447621
You're not programming
>>
>>56447603
How many years have you been posting here?
>>
>>56447657
His post said he was using a shitty premade engine.
>>
>>56447660
>Of course the subs are fake.
He asked if they were photoshopped, not if they were fake.

>>56447681
Sure, but >>56447621 claimed that "Game development is not programming", something which is wrong in many cases.
>>
>>56447667
Right. I'm posting on 4chan at the moment.
>>
File: Screenshot 16-05-2011.png (430KB, 1680x1050px) Image search: [Google]
Screenshot 16-05-2011.png
430KB, 1680x1050px
>>56447673
Since back when gnome was good, at least

>>56447681
The engine was already there, but there's still programming involved
>>
>>56447724
>Since back when gnome was good
Gnome was never good.
>>
>>56447724

Nice theme, senpai-a-lam.
>>
File: 1472486169257.jpg (51KB, 492x419px) Image search: [Google]
1472486169257.jpg
51KB, 492x419px
>>56447744
>Gnome was never good.

Wowee, can't wait to hear what your preferred DE is.
>>
>>56447770
Back then and until relatively recently it was KDE. Nowadays it is openbox.
>>
>>56447770
>using a DE
i3 all the way bby
>>
File: progress3.png (155KB, 1268x1172px) Image search: [Google]
progress3.png
155KB, 1268x1172px
Reposting muh budget tool

Looks like it's gonna be hermit mode for a while
>>
>>56447487
vending machines help with structure, after that its tables and the operations and you're set to really explore
>>
puts = mapM_ putStrLn
plot n f = range (range . point)
where
range = flip map [-(n-1)/2 .. (n-1)/2]
point ny x = bool ' ' '*' (f x (-ny))

circle stroke r x y
= abs (r - mag x y) < stroke
mag x y = sqrt (x**2 + y**2)
cross x y = abs x == abs y


*Main> puts (plot 9 cross)
* *
* *
* *
* *
*
* *
* *
* *
* *
*Main> puts (plot 14 (circle 1.75 5))
****
********
**********
************
**** ****
**** ****
**** ****
**** ****
**** ****
**** ****
************
**********
********
****
>>
File: DancingdogandMan.gif (2MB, 360x414px) Image search: [Google]
DancingdogandMan.gif
2MB, 360x414px
>>56447791
This man knows what he's talking about
>>
>>56447891
I feel like its one person posting this retared webm

>>56447877
neat
but at least show the source code for stroke
>>
>>56447916
Stroke is a parameter of circle.
>>
>>56447877
hasklel fags making everything complicated
>>
>>56447930
simple, actually
>>
>>56447922
My bad, I just noticed.
Yeah, i'm trying to understand, but I can't see how it works.
How did you derive this?
Can you make other shapes?
>>
How bad is it that I never use virtualenvs for my Python projects?
>>
I can't understand how char * arr[20] creates an array with 20 pointers to char, somebody pls explain

and also char (*ar) [20]
>>
>>56447997
[] has a higher precedence than *.
So when you do char *arr[20]
>char *arr[20]
>char *(arr[20])
>arr is a array type with 20 elements
>char * is the element type

>char (*arr)[20]
>arr is a pointer type
>it points to a char[20]

There are several different ways you can look at C declarations to see what type it is.
>>
>>56447958
The shape it plots is a function f that given two coordinates x and y gives a boolean if the (x, y) is in the shape.

Any shape you can represent as a function from points to bool, you can plot.

*Main> let outside f x y = not (f x y)
*Main> puts (plot 11 (outside (cross 1.5)))
*******
*****
* *** *
** * **
*** ***
**** ****
*** ***
** * **
* *** *
*****
*******
>>
>>56448057
thats pretty neat, wow
can you please make a swastika
>>
>>56447877
>bool ' ' '*' (f x (-ny))
>>
*Main> let (f \/ g) x y = f x y || g x y
*Main> puts (plot 21 (cross 1.5 \/ outside (circle 3 7)))
*********************
****** ******
***** *****
***** *****
****** ******
** *** *** **
* *** * *** *
* ********* *
* ******* *
* ******* *
* ********* *
* ******* *
* ******* *
* ********* *
* *** * *** *
** *** *** **
****** ******
***** *****
***** *****
****** ******
*********************
>>
>>56448092
Sorry, forgot the import Data.Bool (bool)
bool f t x = if x then t else f
>>
>>56447724

Okay, the .cs filenames suggest you're working in C#, but the keywords in this suggest something else. What language are you using for this project?
>>
>>56448110
.cs is for computer science
>>
>>56448057
can you make a letter function that plots a given char?
>>
>>56447470
I'm asking here because I want the opinon on programmers.
I'm beginning my first CS class this semester and I'm looking for what is, in your opinions, a great 10 to 11 inch netbook that can run visual studio 2015, and can also have the ability to add more RAM
>>
File: 48453479_p0.jpg (297KB, 480x640px) Image search: [Google]
48453479_p0.jpg
297KB, 480x640px
>>56447470
CuteSharp question:
Let's say I'm creating an object X, then subscribe to one of the events of X in this way:
X.Activated = myEventHandler;

Now the object X is left unused and will be GC, should I unsusbcribe to the events when I know I'm not gonna use that object anymore?
>>
>>56448155
>visual studio 2015
Why? No actual computer scientist uses this trash.

And just get a x220.
>>
>>56448164
Fuck, the operator should be the compound assignment. So "+=" instead "=".
>>
>>56448164
What are they saying? :3
>>
>>56448055
An easier way to read declarations is to understand that they're expressed just as they're used later in code.

So char *(arr[20]) is used as *(arr[i]) = 'a' for example, and char (*arr)[20] as (*arr)[i] = 'a'.

The thing with C declarations is that they don't map variables to their types directly, but describe how base types can be accessed from the variable. So "char *s" doesn't mean s has type char *, but *s has type char. If you think otherwise, you're prone to mistakes like "char* s, t;" which assigns t to type char, not char *.
>>
File: smug spiclard.jpg (41KB, 524x744px) Image search: [Google]
smug spiclard.jpg
41KB, 524x744px
>>56448155
>this thread
>programmers

>>56448175
>actual computer scientist
>>
>>56448110
c number sign is from around 2000, this engine is from 1998. .cs files use a custom scripting language unique to this engine. We usually call it tribes script or the tribes scripting language. It is similar to the language used by the Torque game engine.
>>
In C is there a way to make variables in scope to functions called later? I cannot place these variables as global or statics because they are function calls that are not available at compile (as they are based off console width and height).

#include someLibrary

void doesStuff(void);
void doesStuff2(void);

int main(void){

functionThatSetsUpScreen(); //this is located in someLibrary

while (!end) {
doesStuff();
}

}

void doesStuff(void) {

int w = height(); //this is located in someLibrary
//now go on to use w in this scope of doesStuff

doesStuff2();
}

void doesStuff2(void) {

int w = height(); //this is located in someLibrary
//now go on to use w in this scope of doesStuff2
}


The general idea is just to clean things up, rather than calling the same fucking function in each function. It can't be const/static'd because I get 'initializer element is not constant' errors. GCC, gnu c99 if that makes any difference.
>>
File: 1472189212426.png (325KB, 667x670px) Image search: [Google]
1472189212426.png
325KB, 667x670px
>>56448175
It's what we're using in my class. I'm learning C++ and I'm told it's most compatible pls no bully
>>
>>56448235
>It's what we're using in my class
What's your college?

>I'm learning C++ and I'm told it's most compatible pls no bully
It's not the most compatible, MS is always behind in the standards. GCC and/or Clang would be the most compatible.
>>
>>56448225

Well if it is called Tribes Script, why not use a .ts file extension? Makes more sense.

>>56448228

What are function parameters?
>>
>>56448225
>tfw tribes died
>>
>>56448297

Void when calling height(); it returns something (obviously).

int screen_height(void) {
return screen->height;
}

screen is a structure in the library.

Guessing it's futile.
>>
>>56448297
I assume when the Dynamix guys were working on Tribes, they decided to make the scripting language a sort of "c-script", or .cs. I don't have any reason to change the extension from what it is now.
>>
package main

whereas func main(){
notwithstanding thetruthofthematter println("/dpt/ - Daily PHAGGOT Thread" despiteallobjections)
}
>>
is there ever a use for not having breaks in some of the cases of a switch?
>>
>>56448351
To fall through, for example a case might "map" functionality for some data. For example:
swtich (var)
{
case 'A':
case 'a':
doAFunction();
break;
}
>>
>>56448351
Loop unrolling with Duff's device. Kind of outdated now that compilers can do it.

The other would be to do the same thing for multiple cases like so:
switch(x) {
case 0:
case 1:
do_foo();
break;
case 2:
do_bar();
}
>>
>>56448329

If you want a variable to be visible to another function, you have only two options: pass it as a parameter, or make it available at file/global scope. If you want a variable to be available only some of the time, you can either write multiple functions (one for when an argument is provided, one for when one isn't), or you can let the parameter be represented in two ways. For example, taking a signed integer as argument, but letting negative numbers represent a lack of an argument, if the value is expected to be positive, or using a pointer as an argument, and using NULL to represent "ignore".
>>
>>56448381
oh duh, yeah that makes sense.

>>56448386
the wikipedia for Duff's device is a bit over my stupid head but okay.
>>
Anyone up for helping a newb improve his work?
I know my data structures can use some improvement but, what else? I built a little engine based on the same idea from ex43 of Learn Python the Hard Way. Should I treat Character() like a module even though it's mutable? You can make fun of it as long as you supply some constructive criticism.
>creation=True ???
It's there because you can pop back to those two menus after the character creation.
https://github.com/enigma424242/RPG/blob/master/textbasedrpgtest.py
>>
>>56448406
Don't worry about it. As I said, the compiler can do the same thing nowadays.
>>
so I'm watching a tutorial on C#, and I have a little experience with Java. And basically, I can't tell a difference at all. Am I expecting there to be too much of a difference after looking at hipster languages? Did they just call it a new name and everyone plays along?
>>
>>56448424
Option 3: I'm not far enough in the tutorial to find out what's so different
>>
>>56448424
I Don't do Java, but a friend said they were pretty similar. Though C# syntax seems more succint and less retarded.
>>
putplot n f = mapM_ putStrLn (plot n f)
plot n f = [[pt x y | x <- xs] | y <- ys]
where xs = [-n, -n + 0.5 .. n]
ys = [ n, n - 1.0 .. -n]
pt x y = if f x y then '*' else ' '

feq eps x y = abs (x - y) < eps -- "fuzzy" eq
mag x y = sqrt (x**2 + y**2)
outside f x y = not (f x y)
(f \/ g) x y = f x y || g x y
circle w r x y = feq w r (mag x y)
cross w x y = feq w (abs x) (abs y)


*Main> putplot 5 $ \x y -> feq 1 x 1.5 || feq 1 y (-2) || circle 0.5 5 x y
*********
*** ******
*** *** ***
** *** **
** *** **
* *** *
** *** **
*********************
*** *** ***
*** ******
*********
>>
>>56448395

Thanks, options look limited enough.
>>
>>56448478
what is that supposed to be
also, is that all the code you have regarding plotting?
>>
>>56448502

That's generally how "scope" works in most languages. I mean, some languages have closures to allow an anonymous function to "close over" variables inside of another function (the one it is created within), but honestly, it's probably just passed some sort of pointer to an activation record as an invisible parameter under the hood anyways.
>>
>>56447470
this needs to be in that 'just graduated' meme https://github.com/Warzone2100/warzone2100/blob/master/lib/netplay/netplay.cpp#L3303-L3356

>case 40: index += snprintf(buf + index, bufSize - index, string, ints[0], ints[1], ints[2], ints[3], ints[4], ints[5], ints[6], ints[7], ints[8], ints[9], ints[10], ints[11], ints[12], ints[13], ints[14], ints[15], ints[16], ints[17], ints[18], ints[19], ints[20], ints[21], ints[22], ints[23], ints[24], ints[25], ints[26], ints[27], ints[28], ints[29], ints[30], ints[31], ints[32], ints[33], ints[34], ints[35], ints[36], ints[37], ints[38], ints[39]); break;
>>
>>56448478
I want to be at your level some day.
Reading lyah right now, but what I really need to be doing is exercises, as everything in your code is something I've been taught, but I haven't actually messed around and done stuff like that.
>>
File: something wrong?.png (118KB, 420x546px) Image search: [Google]
something wrong?.png
118KB, 420x546px
>>56448533
Did you think it would be more than that?
>>
>>56448478
>no annotations
reads like vomit
>>
>>56448656
its too sphisticated for it to have only those lines
can you post the rest?
>>
>>56448478
you should create a library that does all those meme programming excersises
>>
>>56447470
why is this gay crossdressing anime character the programming thread's mascot?
>>
>>56448692
The code doesn't reference anything outside of what was posted. That's all there is to it amigo.
>>
File: wewtus jeb.jpg (124KB, 350x350px) Image search: [Google]
wewtus jeb.jpg
124KB, 350x350px
>>56448614
>try to zoom out to see the whole thing
>browser hangs
>>
>>56448730
Crossdressing helps improve code. Try it out.

Wearing gf's panties and shorts atm.
>>
>>56448614
Couldn't they just use vsnprintf?
>>
I hate every build tool I've used other than Make itself. Maybe I should make my own makefile generator tool?
>>
File: Selection_026.png (36KB, 803x458px) Image search: [Google]
Selection_026.png
36KB, 803x458px
What's supposed to stop the for loop in this method? When c is no longer a digit?
I tried doing this example, but my program is getting stuck on that for loop, I put a print statement before and after the for loop and only get as far as the print statement before the for loop.
>>
>>56448748
try out Plan9's mk, it's an even better version of Make
>>
>>56448730
Hime isn't gay
>>
>>56448762
It should be any cond inside that if statement that conditionally returns 0. Maybe the stdio input has restricions?
>>
>>56448762
What is getch() for a function?
Does getch() halts the program until input is entered?
>>
>>56448873
>What is getch() for a function?
>Does getch() halts the program until input is entered?
This is what happens when you learn to program on Windows.
>>
>>56448903
It could be an ncurses function so doesn't have to be windows specific but unless getch() halts I don't see why the for-loop shouldn't end.

>>56448762
You could try printing c inside the for loop for debugging.
>>
>>56448739
I'm looking for an image of a trap getting skirt lifted, there is a thought bubble with a star above an elephant.

Also what should I learn first Scheme or common lisp
>>
been building shitty combinators on top of Clang ASTMatcher.
auto VarBind = [](std::string binding)
{
return declRefExpr(to(varDecl().bind(binding)));
};

auto DVarBind = [](std::string binding)
{
return hasDescendant(VarBind(binding));
};

auto MatrixBind = [](std::string binding)
{
return arraySubscriptExpr(
hasBase(hasDescendant(arraySubscriptExpr(
hasBase(DVarBind(binding + "Base")),
hasIndex(DVarBind(binding + "Row"))))),
hasIndex(DVarBind(binding + "Column")));
};

auto VectorBind = [](std::string binding)
{
return arraySubscriptExpr(
hasBase(DVarBind(binding + "Base")),
hasIndex(DVarBind(binding + "Index")));
};

auto BinaryOperatorBind = [](std::string operatorName, std::string binding, auto injectLeft, auto injectRight)
{
return binaryOperator(
hasOperatorName(operatorName),
hasLHS(injectLeft),
hasRHS(injectRight)).bind(binding);
};

naturally there's more,
>>
File: .t.jpg (164KB, 960x960px) Image search: [Google]
.t.jpg
164KB, 960x960px
>>56448968
It was the OP image for the /dpt/ before the previous one.

And I say Haskell.
>>
>>56448692
Here, I rewrote it in Javascript for you.

<!DOCTYPE html>
<pre><script>

function range(from, step, to, f) {
for (var a = [], x = from; x != to; x += step)
a.push(f(x));
return a;
}

function putplot(n, f) {
plot(n, f).forEach(function(line) {
document.write(line.join('') + "\n");
});
}

function plot(n, f) {
return range(n, -1, -n, function(y) {
return range(-n, 0.5, n, function(x) {
return f(x, y) ? '*' : ' ';
});
});
}

function feq(eps, a, b) {
return Math.abs(a - b) < eps;
}

function mag(x, y) {
return Math.sqrt(x * x + y * y);
}

function circle(w, r) {
return function(x, y) {
return feq(w, r, mag(x, y));
};
}

function smashlogo(x, y) {
return feq(1, x, 1.5) || feq(1, y, -2) || circle(0.5, 5)(x, y);
}

putplot(5, smashlogo);
</script>
>>
>>56448990
Great meme.
>>
>>56448988
kill yourself
>>
>>56447877
>>56448057
>>56448096
>>56448101
>>56448164
>>56448228
>>56448338
>>56448381
>>56448386
>>56448478
>>56448970
>>56448990
WTF are these white boxes?! Did someone hack 4chan again?
>>
>>56448730
it's a shitty forced meme and i'm gonna close this tab because i'm not gonna waste even more time on you cancerous useless fucks
>>
>>56449025
                                                                                                                                                            those are spolier tags senpai
>>
>>56448762
>? When c is no longer a digit?
Yes
I think the creator of this meant to write ; instead of , in that case.
>>
File: 1453290296871.png (369KB, 1902x736px) Image search: [Google]
1453290296871.png
369KB, 1902x736px
>>56448968
Learn Scheme

>>56449038
Why are you using the code tag in here? You make no sense
>>
>>56449060
bingo, great eye dude
>>
>>56449085
Oiii, don't break my spoiler tags, I'll fuck your boipuccy.
>>
File: 1461384874954.jpg (80KB, 640x458px) Image search: [Google]
1461384874954.jpg
80KB, 640x458px
>>56449105
Yes please :3
>>
>>56449110
Forgot to add no homo. ;_;
>>56447470
Just fixed like 4 bugs in the last 5 hours, feels nice.
>>
give me C-related youtubes, if you please
>>
>>56449060
Ahh, yep you're right. I don't know why my edition of K&R has so many typos. This is the 3rd time I've come to /dpt/ and the problem was a typo, I need to start catching these on my own.
>>
>>56449134
Why? You really shouldn't be learning from online videos.
>>
>>56449148
I'm done learning for the day but I still want to watch things about C
>>
>>56449148
but also what do you have against online videos? Just because some are bad or something? I learn quite well from online videos. Obviously I'm constantly pausing and have a terminal open as well right next to it.
>>
>>56449148
>what is ocw
>>
>>56447544
a hacker would report it to the isp
>>
>>56447724
yourt de looks way to much like windows 2k
>>
>>56449148
This
>>
>>56447544
why would it say "BACKDOOR" in plain text

contact the authorities or something
>>
>>56447819
whoa dr racket i never thought anyone actually used that outside of my intro to cpsc class
>>
>>56449247
not him but I first saw it a few weeks ago watching john carmack do some live coding at some thing. I was like "huh that looks kind of neat". I wondered if I would find the arrow-stuff in the IDE helpful or annoying.
>>
what's the best programming language
>>
>>56449307
Haskell
>>
File: Capture.jpg (40KB, 981x235px) Image search: [Google]
Capture.jpg
40KB, 981x235px
How do I adjust my program to make it \n every 10th value like the right side of pic

i imagine its something like x%10 I'm not too familiar with the python syntax and not sure how to incorporate it
>>
>>56449307
java and C++
>>
>>56449307
APL
>>
File: 1402638719801.png (362KB, 454x603px) Image search: [Google]
1402638719801.png
362KB, 454x603px
>>56447470
i never got this pic. not all C compilers upgrade void* to a type pointer, so you have to cast.
>>
>>56449307
Java
>>
>>56449335
>type pointer
What is this supposed to mean?

>not all C compilers upgrade void* to a type pointer
Not sure what you are trying to say but conversion between void * and other non-function pointer types is implicit.
>>
>>56449335
Also, this picture is dead-wrong.
>>
>>56449356
k
>>
>>56449373
What an EXCITING argument!
Well, keep posting meme pictures from 9gag, I am sure it will make you feel like you know something or that you make funny programming jokes and that you are a true nerd, even though these pictures are wrong as hell.
>>
>>56448676
If you want to know the types, just ask the compiler, :bro.
>>
>>56449382
>these pictures are wrong as hell
nice argument RETARD
>>
>>56449411
>it was the carposter all along
That explains both the incorrect 9gag picture and the text that made no sense in >>56449335.
>>
>>56449424
i'm not him, and kill yourself you delusional faggot, you're not even explaining what you think is wrong with the image you autistic mongrel
>>
>>56449456
>i'm not him
You are probably his brother or his gay boyfriend then. Or, maybe, you know, you are lying.

>you're not even explaining what you think is wrong with the image
If you asked properly from the start and explained what the hell did you mean with the rambling in your first post I would consider it. But you didn't so no.
>>
>>56449472
fuck off and die pathetic retard

>Also, this picture is dead-wrong.
not an argument.

this is your last (You) from me for today

KILL YOURSELF
>>
>>56449480
Yep, it's clear now: you were lying.

>not an argument.
I fear that you quoted the wrong post, 9gagger carposter.
>>
>>56449307
haskell + c + python
>>
Any good PowerShell books? I've used batch for most of my life but PS seems verbose as fuck and very unwieldy and I have no idea where to start.
>>
>>56449510
Do people still use windows?
>>
#include <stdio.h>

int main () {
printf("evaluate s1 = 1 + 1/2 + 1/3 + 1/4 + 1/5 .. 1/n\n"
"and s2 = 1 - 1/2 + 1/3 - 1/4 + 1/5 .. 1/n\nwhere n equals: ");
unsigned short n; scanf("%hu", &n); double s1 = 0.0, s2 = 0.0; _Bool sign=1;
for(unsigned short j=1; j<=n; j++)
{
s1 += 1.0/j;
s2 += sign ? 1.0/j : -1.0/j;
sign = sign ? 0 : 1;
}
printf("s1 = %f\ns2 = %f\n", s1, s2);
return 0;
}

$ ./a.out 
evaluate s1 = 1 + 1/2 + 1/3 + 1/4 + 1/5 .. 1/n
and s2 = 1 - 1/2 + 1/3 - 1/4 + 1/5 .. 1/n
where n equals: 900
s1 = 7.380166
s2 = 0.692592


am not sure its right
>>
who /learning c++/ here?
>>
>>56449565
Learn C instead.
>>
File: img_2000.png (290KB, 1920x1080px) Image search: [Google]
img_2000.png
290KB, 1920x1080px
>>
>>56449307
Python a.k.a. Lisp
>>
File: shooty benny g.jpg (143KB, 958x973px) Image search: [Google]
shooty benny g.jpg
143KB, 958x973px
>>56449335
>9gag
>>
>get into top 10 CS university
>starting this autumn
>they keep promoting shit they have like free office, free windows 10m etc
>their mail is hosted on outlook
>all this microsoft shit, but they don't have azure servers to give me to do deep learning
>i'm still waiting to get access to their cluster which uses pbs pro as their workload manager
honestly, i'm a bit disappointed. their CS community seems almost non-existent: no IRC activity, no interesting talks, no interesting hackathons. I already regret coming here and turning down other offers cause of their prestige. I'll make the most of what I have anyway, but fuck me
>>
what's a ring buffer
>>
>>56449826
http://lmgtfy.com/?q=what%27s+a+ring+buffer
>>
>>56449856
>lmgtfy
>almost 2017
grow up
>>
>>56449856
can you send me that link with https
>>
>>56449878
http://lmgtfy.com/?q=how+to+put+https+at+the+beginning+of+a+url
>>
>>56449753
>>they keep promoting shit they have like free office, free windows 10m etc
>>their mail is hosted on outlook
Same here, at least we have a hackathlon however.
Are you in the UK?
>>
>>56449554

Does s1 get larger and the variation from 0 get smaller for s2 for larger n? Because the first diverge to infinity and the 2nd converges to 0.
>>
>>56448968
Racket
>>
>>56450300

Sorry, meant to say 2nd series converges to log(2)
>>
>>56449856
https://lmddgtfy.net/?q=what%27s%20a%20ring%20buffer
>>
>>56450300
s1 seems to inrease
but s2 approaches some value starting with .69
>>
>>56450348

Which is right since log(2) is roughly ~0.69.

http://www.wolframalpha.com/input/?i=log+2
>>
>>56449335

No, Anon. ALL standards-compliant C compilers will allow void* to be cast to another pointer.

http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf

Section 6.5.16.1 Simple assignment

>One of the following shall hold
>...
>the left operand has atomic, qualified, or unqualified pointer type, and (considering the type the left operand would have after lvalue conversion) one operand is a pointer to an object type, and the other is a pointer to a qualified or unqualified version of void, and the type pointed to by the left has all the qualifiers of the type pointed to by the right

It also is the case that compilers must allow a NULL pointer to be assigned:

>the left operand is an atomic, qualified, or unqualified pointer, and the right is a null pointer constant
>>
>>56447510
oh god muh dick
>>
>>56450555

Judging by context, that person is underaged, Anon.
>>
A buddy of mine told me, that copy typing is the first thing someone does in conjunction with doing tutorials in order to get accustomed to a programming language.
What do you think?
>>
>>56450574
Stop. I can only get so erect.
>>
        GLfloat lines[] = { 0.0, 0.0,
1.0, 1.0 };
GLfloat colors[] = { 0.0, 1.0, 0.0,
0.0, 1.0, 0.0 };

glVertexPointer(2, GL_FLOAT, 0, lines);
glColorPointer(3, GL_FLOAT, 0, colors);
glDrawArrays(GL_LINES, 0, 2);


Why doesn't this work
>>
>>56450854
Use a vertex shader and a fragment shader.
>>
>>56450854
You do realize you are drawing a line from 0.0 to 0.0 and from 1.0 to 1.0
>>
>>56450760
Sorry to be a downer, m8, but that's an actual female and not underage. She has old middle school graduation pictures on her deviantard dating back to 2007.
>>
char a;

declares a, which means that 1 byte is allocated to a
whenever you run your program, that 1 byte is always there, clottering the ram, until the program ends
so its better to keep the variable as small as possible
dont use ints when clearly, the expected input is below 255, always use unsigned chars
>>
>>56451282
>declares a,
true
>1 byte is allocated to a
false
> that 1 byte is always there [...] until the program ends
false
>its better to keep the variable as small as possible
false
>expected input is below 255 => use unsigned char
false
>>
>>56450623
If by "copy typing", you mean copy/pasting code and trying it out to see what it does, then yes.

It's the most natural way to learn how something works, much like taking apart a remote control. You take something pre-existing and break it down into things you can understand.
>>
>>56451282
>that 1 byte is always there, clottering the ram
Only if it's statically allocated or dynamically allocated and isn't freed.
Also, stack space is typically constant. Allocating less shit there isn't going to make it smaller.
Also, this is one the last places you would go to save RAM.
The real savings come from packing structures correctly and not using too large of integers in that.

>>56451316
>>1 byte is allocated to a
>false
A char is the definition of a byte in C and C++.
It's highly unlikely that he's talking about another language.
>>
>>56451316
shed light on your knowledge
I only posted the most likely false information to see if someone would correct me

please, I really want to learn
>>
>>56451334
void toupper(char c) {
char r;
...
}
// c is not allocated
// r is allocated every call and only lasts for the stack frame

>don't use ints
ints can be faster than chars, and you said expected input which is neither expected output nor reasonable output
imagine char factorial(char);
>>
>>56451363
but chars are ints in smaller range
how come some ints can be faster than other ints
>>
rust or go?
i want to make some simple desktop programs, and i liked the whole cargo thing.
Both can be compiled to run without having to install anything else on the user's pc right?
Which one has more/better libraries?
Which would you reccommend?
>>
>>56451334
im a newfag to c
what do you mean by "packing structures correctly"
>>
>>56451387
smaller doesn't mean faster, this is why C and C++ and D and other languages will have stuff like

int8_t (8 bits exactly)
int_fast8_t (fastest with at least 8 bits)
>>
>>56451334
>A char is the definition of a byte in C and C++.
You may use only one bytes in a, but the compiler may, for stack alignement requirements, set it to 4 bytes on some machines. Such as, oh I don't know, any modern x86-64/ARM machine.

>>56451338
Ok.

>1 byte is allocated to a
see above
> that 1 byte is always there [...] until the program ends
Depends on the context a was declared in.
See >>56451334 who also forgot to mention global and static variables, which are the same from the computer point of view, but from the language pov, one is scoped while the other is not.

There are no variable on the heap, you can only have variables on the stack, some of these could be pointers that may be pointing somewhere on the heap.

>its better to keep the variable as small as possible
Sometimes it is for cache locality. but that's only when you're managing huge amount of data.

On some architectures, (such as MIPS), unaligned access are impossible, this means when you read memory, it has to be reading a whole word (generally 4 bytes) on every access. So when you're using chars the compilers has to generate extra instructions to prevent the register used for loading the variable from containing unrelated garbage.
>expected input is below 255 => use unsigned char
An unsigned char cannot represent numbers below 0, so you need to add a clause in your statement for it to be true.
>>
File: cs grad meme switch .png (1MB, 3300x1237px) Image search: [Google]
cs grad meme switch .png
1MB, 3300x1237px
>>56448614
got ya senpai
>>
File: solution.png (14KB, 851x330px) Image search: [Google]
solution.png
14KB, 851x330px
>>56451479
>when you started the meme
>>
>>56451282
jokes on you, my implementation garbage collects it
>>
>>56451363
>// c is not allocated
Not necessarily. cdecl pushes arguments to the function onto the stack, so those are "allocated".

>>56451403
In C, types must be aligned to a memory location that is a multiple of their size.
So, if you have a 4 byte int, all ints must appear in a memory location that is a multiple of 4.
0x100 is a valid int address. 0x104 is a valid int address. 0x101 isn't.

This is particularly important in structs, where each member must appear in order.
struct mystruct {
int a;
char b;
int c;
}

Each type inside the struct must have the correct alignment, so the compiler might have to add padding between
elements so that the alignments are correct.
So, thinking of the struct as an array of bytes:
+-+-+-+-+-+-+-+-+-+-+-+-+
|a |b| |c |
+-+-+-+-+-+-+-+-+-+-+-+-+
0 4 8

So, assuming 4 byte ints, the compiler has to add 3 bytes of padding between 'b' and 'c'.
This 3 bytes is effectively wasted and if you have a lot of these structs, it can cause a lot of wasted memory.

By doing a trivial reordering of the struct, we can remove this padding:
struct mystruct {
int a;
int c;
int b;
}

+-+-+-+-+-+-+-+-+-+
|a |c |b|
+-+-+-+-+-+-+-+-+-+
0 4 8

Doing this, we've made the size of our struct 9, instead of 12.
This is structure packing.
>>
just checking in to be sure, is there an algo wich isnt O(n^2) for finding all the distances between n points?
>>
>>56451535
Whoops, that last struct should be:
struct mystruct {
int a;
int c;
char b;
}
>>
>>56451442
so, regarding unaligned access
this means that it really doesn't matter if its int or char, in fact, ints are better since they're usually 4 bytes, meaning the compiler won't go to more trouble
but thats only on certain archs, right
how do I know if my architecture does that?

also, what do you mean by heap in this context
I searched it up and it just says its a tree with special properties
>>
>>56451363
>// c is not allocated
what, I always thought that arguments were made temporaray variables unless they were pointers
>>
>>56451282
>that 1 byte is always there, clottering the ram, until the program ends
*until it goes out of scope
>>
>>56451564
On modern architectures and calling conventions, most arguments are just passed in using registers.
But yes, what that anon said isn't really accurate.
>>
>>56451535

>In C, types must be aligned to a memory location that is a multiple of their size

Not really. Many architectures will complain about unaligned memory access, but it's not a requirement in C (it can be implemented on architectures that allow unaligned memory access), and there is always __attribute__((packed)) for when you need to force the compiler to use a specific memory layout.
>>
>>56451551
>how do I know if my architecture does that?
You read your processor manual.

>>56451551
>what do you mean by heap in this context
"heap" can indeed refer to a tree data structure, but in this context, I'm referring to the address space on which dynamically allocated space (via a call to malloc) are stored.

>>56451564
He's wrong, c is copied in the callee's frame.

>temporaray variables unless they were pointers
Wrong, pointers are also values that are copied on the callee's frame.
>>
>>56451535
I see, so it solves the problem of wasted memory and gives us more range the structs
neat
>>
>>56451577
That's besides the point. Yes some CPU architectures can allow for unaligned accesses, but you would only ever run into that in C if you're doing non-standard or undefined shit.
>>
>>56451442
>You may use only one bytes in a, but the compiler may, for stack alignement requirements, set it to 4 bytes on some machines. Such as, oh I don't know, any modern x86-64/ARM machine.
I fear that you are retarded.
1: a char is always 1 C byte
2: in no modern nor in any popular machine a char was not equal to 1 machine byte

>There are no variable on the heap, you can only have variables on the stack, some of these could be pointers that may be pointing somewhere on the heap.
The standard says nothing about stacks and heaps. This argument is silly.
>>
>>56451538
I can give you one that works in n^n if you want me to.

But you're probably looking for something like this:
https://en.wikipedia.org/wiki/Closest_pair_of_points_problem
>>
>>56451538
since there are n*(n - 1)/2 distances, the complexity for finding all distances has to be at least O(n^2).
>>
>>56451535
>In C, types must be aligned to a memory location that is a multiple of their size.
Where does the standard say that? I am waiting.
>>
>>56451569
Nice assumption

>>56451589
>Wrong, pointers are also values that are copied on the callee's frame.
Nice assumption
>>
>>56451589
so heap is something the programmer can control
and the stack space is more something that exists so that the program can take place

or is the heap just a subset of the stack space
>>
>>56448175
>>56448261
>>56448155
Don't listen to these /g/angsters. They know nothing about real life and serve only to be contrarian.

Comrade who seeks a netbook to program with Visual Studio: I suggest you look on Craigslist because that would be the cheapest option.
>>
>>56451535
>types must be aligned to a memory location that is a multiple of their size

No, that requirement is for malloc calls only, it's specified that the returned address is suitable for any type supported by the machine.

Unaligned memory access are not a problem, as the compiler will translate it to properly aligned load instructions.

>>56451616
>1: a char is always 1 C byte
I don't see how that's related to the part you quoted.

>The standard says nothing about stacks and heaps. This argument is silly.
I'm talking from a modern machine point of view.
As the original question was.

>>56451638
The former.
>>
>>56451589
>frame
is that the indivdual stack space of a function
>>
>>56447661
Learn to search, go to college.
>>
>>56451624
Yes, the standard doesn't say that, but it is usually true in practice.
The standard actually mentions alignment a lot, but it's all implementation-defined.
>>
>>56451660
Not exactly of a function, but of a call to a function.

You may have multiple calls to the same function on a callstack at a time.
>>
>>56451657
>I don't see how that's related to the part you quoted.
You say that a char may not be 1 byte as defined by the C standard, something that is wrong. Also you ignored the other part where I said that no modern nor any popular machine has a char that is not equal to a machine byte.

>I'm talking from a modern machine point of view.
It has nothing to do with C then, please make it clear in your future posts so the people who want to learn more about C don't get confused by your bullshit.
>>
>>56451616
>1: a char is always 1 C byte
The ANSI C specification says it has to be at least 8 bits, but is not limited to 8 bits.

2: in no modern nor in any popular machine a char was not equal to 1 machine byte
A 'char' has little to do with any machine.
>>
>>56451693
>Yes, the standard doesn't say that
Don't spread falsehood then please.
>>
what is the time complexity of casting from a map to a list in java?
>>
>>56451535
>c types must be aligned to a memory location that is a multiple of their size

so if structs are sequential, then that means that there may be a lot of garbage within a struct?
>>
>>56451657
>Unaligned memory access are not a problem
>http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
>6.3.2.3 Pointers
>A pointer to an object type may be converted to a pointer to a different object type. If the resulting pointer is not correctly aligned for the referenced type, the behaviour is undefined.
>>
>>56451707
>The ANSI C specification says it has to be at least 8 bits, but is not limited to 8 bits.
And? A byte is not 8 bits. The size of a byte depends on the machine.
I fear that you are confusing a byte with a octet. A octet is always 8 bits, a byte is not.
Anyhow, the C standards says that a char is at least 8 bits AND that it's 1 byte.

>A 'char' has little to do with any machine.
"Implementation", better?
Still holds true. And makes your claim that a char may be 4 bytes in "any modern x86-64/ARM machine" wrong.

>>56451739
Yes, padding
>>
I´ve got some weird conundrum that is probably just me being not knowledgeable with c++

i´ve got some simple code

 
#include <iostream>
#include <string>

using namespace std; //std::

        char cr[256];
int nr1, nr2;
cin.getline(cr, 256);
string str(cr);
nr1 = stoi(str.substr(0, ' '));
for (size_t i = 0; i < str.length(); i++)
{
if (str[i] == ' ')
{
nr2 = stoi(str.erase(0, i + 1));
}
}
cout << nr1 + nr2;


using visual studio and codeabbey this compiles without errors and runs as it is supposed to

my problem comes in Kdevelop on Linux where i use clang as the compiler
there it gives me this error
"use of undeclared identifier 'stoi'"
I thought this might be because it doesn´t recognize the namespace std but adding std:: in front of it didn´t change anything

i´d appreciate a pointer to why this is happening
>>
File: 1459513416171.jpg (17KB, 649x463px) Image search: [Google]
1459513416171.jpg
17KB, 649x463px
>>56451742
This guy is really trying hard to pretend that he knows stuff.
>>
>>56451725
you cannot cast a map to a list
>>
>>56451706
>You say that a char may not be 1 byte as defined by the C standard
No I didn't.
I said that the compiler might allocate more stack space for the variable to solve alignment contraints.
Anyone with half a brain could see it has nothing to do with C as a langage, but the implementation of C.
>Also you ignored the other part
I ignored because I knew it was written under the same assumption of the first part, thus useless for me to answer.

>It has nothing to do with C then

Again, had you half a brain, it would have been obvious from my very first post.

Also I think understanding the machine from its implementation of C is a key to understanding C and its restrictions itself.

>>56451742
That's obviously referring to type aliasing.
When you have a struct a contained at the top of struct b, you can convert a b pointer to a a pointer, and if a is at the top of b, then your a pointer is valid.
>>
File: 1470271471702.jpg (67KB, 416x508px) Image search: [Google]
1470271471702.jpg
67KB, 416x508px
>>56451769
>this picture
>again
>>
>>56451773
what about this

http://stackoverflow.com/questions/1026723/how-to-convert-a-map-to-list-in-java
>>
>>56451778
>he literally unironically proved the picture is true
>>
>>56451781
>cast
>convert
complexity of converting is O(n)
map.values() is O(n), and since the list is initialized with the map values instead of initializing an empty list and then adding the values to it, this is O(n) too
>>
>>56451776
>That's obviously referring to type aliasing.
The ONLY way you're going to get unaligned accesses in C is through type aliasing or incorrect void * conversions.
>When you have a struct a contained at the top of struct b, you can convert a b pointer to a a pointer, and if a is at the top of b, then your a pointer is valid.
That is because it is guaranteed that the first member of the struct and struct itself are guaranteed to have the same address (i,e, no leading padding). The struct basically has the same alignment requirements as the first member.

>>56451769
It's literally a quote from the standard. Why do you think it's wrong?
>>
>>56451808
thanks!
>>
File: 1453651274891.jpg (86KB, 719x720px) Image search: [Google]
1453651274891.jpg
86KB, 719x720px
>>56451795
>he thinks I'm the one he replied to
>>
>>56451809
>It's literally a quote from the standard. Why do you think it's wrong?
I am talking about the guy you were replying to.
>>
why is this thread mostly about arguing the semantics of the C standard?
is there a more boring and pointless subject to discuss?
>>
>>56447621
Ignorant and no social life
>>
>>56451814
>he thinks >>56451795 and >>>56451769 is the same person
>>
>>56451757
I never claimed that a char might be 4 bytes.
It just sounds weird to me if someone talks about a char on a machine level.
>>
>>56451809
>incorrect void * conversions
There you go.
>That is because it is guaranteed that the first member of the struct and struct itself are guaranteed to have the same address (i,e, no leading padding). The struct basically has the same alignment requirements as the first member.
No shit sherlock.
>>
File: 1450287675512.jpg (1KB, 32x31px) Image search: [Google]
1450287675512.jpg
1KB, 32x31px
>all these anons in this thread that think that a char may not be 1 byte
>>
>>56451839
>There you go.
"There I go" what? Does somehow incorrectly converting a void * (which is undefined behaviour) make unaligned access alright in standard C?
>>
>>56451884
>32x31

>x31

Fucking die
>>
File: smeg on the big screen.png (1MB, 998x728px) Image search: [Google]
smeg on the big screen.png
1MB, 998x728px
>>
>>56451832
The two defining characteristics of a "muh games" developer.
>>
>>56451901
union
{
int i;
char a[4];
} u;

union u b;
b.i = 12;
b.a[3] = 34;


Is this undefined?
>>
File: serveimage-7.jpg (180KB, 749x904px) Image search: [Google]
serveimage-7.jpg
180KB, 749x904px
>>56451917
> Trump signs, hats
Oh boy, apparently another zombie from Drumpf's clown posse escaped from his containment board. Now be a good dog and scuttle back to your cage.
>>
>>56451950
No. You're not doing any unaligned accesses, and aren't even declaring that union correctly.
>>
File: serveimage.jpg (61KB, 640x480px) Image search: [Google]
serveimage.jpg
61KB, 640x480px
>>56451917
Drumpftard go back to your containment board. We don't need or want you here.
>>
>>56451970
__attribute__((packed))
struct s
{
char c;
int i;
};

struct s a;
a.i = 0;


Is this undefined?
>>
>>56452002
It's non-standard, therefore completely irrelevant.
>>
Is there any book / website detailing, analyzing and annotating code from a well known old school game ?

I'm digging through DOOM source code but it's kinda obscure
>>
pointers are variables that contain addresses
addresses are like numbered buckets in the stack space that contain values of a fixed size
you can get the value of an addres by indirection or , more formally
if p is a variable to an address, *p is the value of that address

you can always indirect a pointer, even if it hasn't been given an address
so
int *p;
*p = 9;

is ok, since c gives the pointer a random bucket from the stack space that isn't used elsewhere in the program
>>
>>56452055
>you can always indirect a pointer, even if it hasn't been given an address
>so
>...
>is ok, since c gives the pointer a random bucket from the stack space that isn't used elsewhere in the program
That is completely wrong.
p in uninitialised, so using its value in any way is undefined behaviour.
>>
>>56452080
define "undefined behavior"
>>
>>56452101
You should really learn some of the standard C lingo before you try to discuss it.
>>
>>56452113
I know what undefined behavior is, I just wanna know if you know what you're talking about.

remember that it's all implementation dependent, and that it almost always does what I calimed
>>
How can I get into FFT and image processing?
>>
>>56452142
comonads
>>
>>56452139
You clearly don't understand the difference between implementation defined behaviour and undefined behaviour.
>>
>>56452164
al definitions are implemenation dependent
even undefined behavior is implementation dependent
>>
>>56452191
If the implementation doesn't define what happens, it's not implementation-defined.
>>
>>56448653
Oh fucking great now the Haskellfags are going to be extra insufferable.
>>
>>56452217
>now the Haskellfags are going to be extra insufferable.

They always were.
>>
>>56452217
go home lispfag
>>
>>56452191
No. You're wrong.
For implementation defined behaviour, an implementation must make a choice and document it.
So you can't have sizeof(int) randomly change throughout your program.

For undefined behaviour, there are absolutely no requirements put on the implementation. It can do whatever the hell it wants.
Compilers will usually optimise on the assumption that undefined behaviour will never happen.
If it outputs something that you don't expect, then it's your fault. There were no requirements.
>>
>>56452217
Not our fault Haskell is so good
>>
>>56452242
Yeah but anytime a newbie slobbers over their code they turn the pretentious pseudo-math up to 11 for at least the next six threads.
>>
>>56452191
>>>/india/
>>
>>56452284

I'm sure we're going to be hearing all about memenads and applicative "fun"ctors.
>>
>>56452308
don't forget zygohistomorphic prepromorphisms
>>
>>56452338
>taking jokes seriously
>>
>>56452366
>taking haskell seriously
haskellers are making fun of taking nomenclature too far with zygohistomorphic prepromorphisms, yet taking sentences like "A monad is just a monoid in the category of endofunctors" seriously
>>
>>56452435
That's literally all a monad is. It's tongue-in-cheek, but it's not said for no reason.
>>
>>56452435
>yet taking sentences like "A monad is just a monoid in the category of endofunctors" seriously
I don't know anyone who uses Haskell that unironically uses that phrase to explain monads, they only use it to reason about monoidal properties of monads. The main people who use it are people like OSGTP who don't understand monads but want people to think they do
>>
>>56452453
that's literally all a zygohistomorphic prepromorphism is. it's tongue-in-cheek, but it's not said for no reason.
>>
>>56452475
A zygohistomorphic prepromorphism is a pathologically contrived recursion principle (more realistic recursion principles include catamorphism and paramorphism). "Monoid in the category of endofunctors" is how you derive "type constructor with return, bind, and the monad laws"; it's an equivalent statement. One that's harder to digest, to be fair. But it drives the point home that monads are NOT burritos, space suits, programmable semicolons, etc.
>>
Hello /dpt/

I'm trying to determine Mother's Day given a year

Mother's Day is defined as the second sunday of May.

how would I even go about solving this in C using only time.h?
>>
>>56452616
you don't need time.hif you're given the year
literally just count the days until may and then count to the second sunday
you only need to know one date's weekday to figure out the rest of the dates' weekdays
>>
making mst from a graph where all nodes are connected and we are talking about 15k++ nodes here, so i can't store all the edges in ram, thinking about going with a bastardized version of prim's algo, using a set to determine wich nodes aren't part of the mst yet and reading up 1 node at a time and updating the minimum, this would get us to O(n^2) but it's better than going out of ram with my boy kruskal, any better idea?
>>
https://hackage.haskell.org/user/EdwardKmett
>>
>>56452435

That's true in a technical sense, though. It doesn't tell you why monads are important, but it does describe what one is.
>>
>>56452539
>But it drives the point home that monads are NOT burritos, space suits, programmable semicolons, etc.

"You can see what the scientific community wanted to do: It wanted to look at what is obviously a massive bear and say 'Oh no, it's an insect; it's a massive bloated cat; it's a rocky outcrop. But no; bad luck scientists; it turns out it looks like a bear, and it is a bear."

- David Mitchell on Pandas.
>>
>>56452645
ah right... so starting from May 1, I can determine the week day and count from there
>>
File: le autism letters.gif (537KB, 480x270px) Image search: [Google]
le autism letters.gif
537KB, 480x270px
>>56452539
I'm honestly awestruck at the amount of autistic theories and categorizations you fags can conjure out of thin air without any substance or utility. It's honestly astonishing how much you can flesh out trivial shit about fizzbuzzing, as opposed to actually meaningful math such as linear algebra, complex analysis, statistics, number theory, etc.
>>
Category theory is design patterns for the intellectual programmer.
>>
>>56452806
That's all type- and category-theoretic stuff.
>>
>>56452806
>as opposed to actually meaningful math such as linear algebra, complex analysis, statistics, number theory
I'm sure literally nobody has ever thought the same for any or all of those.
>>
>>56449497
MUH NIGGA, I thought I was the only one who had these as his holy trinity
>>
File: 1468274225076.png (150KB, 1024x713px) Image search: [Google]
1468274225076.png
150KB, 1024x713px
>>56452832
>Python
>muh
>nigga
cancer
>>
>>56452806
>without any substance or utility
The term "monad" has very little meaning, but many monads themselves have substance and utility (IO, results, ST, etc.)
Recursion principles abstract out the boilerplate of recursion. This is really useful for generic programming, proving termination, dynamic programming (memoization), etc.
>>
Is there any simple IDE for making android games that lets me code in C# without having to install 20 fucking gb of autism?
>>
>>56447470
did you guys ever find out why he's casting the return value of malloc()?
>>
>>56452985
compatibility with C++
>>
>>56452993
>malloc
>C++
>>
>>56452898
They're all fluff, convoluted structures and organizations to complicate simple shit, just like pretty much all contemporary programming language theory. No more substantive than the GoF design patterns Pajeet memorizes, and just like design patterns, only formulated to work around the shortcomings and bad design decisions of the languages used.
>>
>>56452880
>>56452931
>>56452979
>>>/pol/
>>
>>56452999
http://en.cppreference.com/w/c/memory/malloc
>>
>>56452985
Because he is a foolish boy who wishes to get his little boypussy penetrated by pretty girls. He uses his casts similar to a chastity cage to show his personal inferiority and wish to get dominated.
>>
>>56453021
>under C category
>links to C standard
>>
>>56453021
new[] is comfier
>>
>>56453029
Was this the one you wanted?

http://en.cppreference.com/w/cpp/memory/c/malloc
>>
>>56453037
C++ is explicitly compatible with most of C, doesn't mean you should use it.
>>
>>56452977
Anon, a single video game these days is 60GB.

How is 20GB for a full-featured dev suite too much?
>>
>>56453041
There's nothing wrong with using C library functions in C++, and in many cases they're faster
>>
File: serveimage-2.jpg (81KB, 850x400px) Image search: [Google]
serveimage-2.jpg
81KB, 850x400px
>>56452979
Ah, the Dunning-Kruger effect in action. Since they spend too much time fellating each other's stupidity in their containment board hugbox, they're lost all contact with reality and instead entertain a topsy-turvy worldview where they are right and everyone else is wrong.

That is all well and good, of course, if they just kept to themselves, but as it is in the nature of stupidity to spread itself, they feel they just have to get out of their containment board and fling their feces at everyone else.

Thankfully today, the mods have taken swift action to silence that one rat that just got out of the cage and quickly deleted his post before it got out of hand, but alas, such cannot be the case every day, and the situation may very well call for quick and decisive measures to keep them away from civilized discussions of well-rounded human beings and safely restrained within their cages.
>>
>>56453102
(You)
>>
>>56453102
>>>/pol/
Go back to your containment board.
>>
>>56453050
Because my SSD is almost out of space. I guess you're right though, gonna have to remove some shit.

Can I install and use VS 2015 without it fucking with VS 2013 in any way?
>>
>>56453115
Yes
>>
File: raw bait.jpg (209KB, 756x1100px) Image search: [Google]
raw bait.jpg
209KB, 756x1100px
>>56453102
ebin b8
>>
>>56453142
Yes, installations of Visual Studio are self-contained by design.

It ensures that you can run multiple dev environments that can't fuck with each other.
>>
>>56453196
Eh. Sort of. Its more the build tools backing the IDE that are self contained. Generally good enough.
>>
>>56453102
>>56453210
>>>/pol/
>>
File: keybr.png (43KB, 853x317px) Image search: [Google]
keybr.png
43KB, 853x317px
>>56453102
>>
Since we're already talking politics:
Happy news http://mobile.reuters.com/article/idUSKCN1190I7
>>
>>56453041
C++ is generally horrible by design. You shouldn't use it.
>>
>>56453297
I don't disagree.
>>
>>56453268
>>56453274
>>56453285
>>>/pol/
>>
>>56453268
What's this?
>>
What are good reading materials I can listen to? Sunbathing, and the sun blinds me.
>>
>>56453318
keybr.com learn/practice touch typing it's great i learned decent full alphabet touch typing in one 4 hour session and got a lot faster with a couple of more hours of total practice, still improving fast, it's great
>>
>>56447487
Harvard cs50x starts off with C then moves on to a few others like Java by the end of the 12 week course check it out anonbro
>>
>>56453331
OH and preferred topic would be optimization and anything that helps me make code more malleable.
>>
File: angree sonny.jpg (41KB, 196x167px) Image search: [Google]
angree sonny.jpg
41KB, 196x167px
>>56453331
>sunbathing
normie get >>>/out/
>>
>>56453372
Well, technically he's already /out/.
>>
File: Untitled.png (31KB, 460x644px) Image search: [Google]
Untitled.png
31KB, 460x644px
>>56453196
>>56453239
>>56453146
Do I need any of this shit that isn't selected by default?
>>
>>56453408
"need"
no
>>
File: Bp7gpleCcAAC96R~01.jpg (31KB, 317x418px) Image search: [Google]
Bp7gpleCcAAC96R~01.jpg
31KB, 317x418px
>>56453372
>hating on a healthy lifestyle
>>
>>56453408
Probably not.

You can always add later.
>>
>>56453408
>>56453414
basically just tick what you want, for the languages you want
>>
>>56453408
Just leave everything as default unless you see that you need it.
You're just doing C++ right?
>>
>>56453425
For making android apps I want to work in C#.
>>
>>56453454
OK well look at what Android API version you're targeting. Generally lower is better, but only to the point where you have the features you need. And replicating materials UI is a bitch so you probably want some version which does that. But I don't know your application.
>>
>>56453470
Follow the thread, and you'd see that this anon is going for Xamarin, which takes care of a lot of the UI work for you.

https://www.xamarin.com/platform
>>
>>56453415
>blasting your skin with UV radiation
>healthy
>>
>>56453415
>skin cancer
>healthy
>>
>>56453490
>>56453512
samefag
>>
>>56453490
>>56453512
>living in places that get abundant amounts of sun
I'm more worried it's so low in the sky I don't get enough.
>>
Someone kill this thread with a new one, please.
>>
New thread: >>56453560
>>
>>56453050
Games have textures, audio, video, and other generally acceptable huge files though. What is is about an IDE that makes it 20gb?
>>
>>56453609
If you install all of the mobile development tools, that includes:
>Multiple Android SDKs
>All components of Xamarin to build mobile and OSX with C#
>Xamarin GUI objects, which include graphics and audio resources
>Various emulators for debugging
>Java SDKs
>etc.
>>
>>56452977
>C#
>android
>caring about installation sizes
now you get a taste of what your users feel
>>
I need some GOOD 3dpd trap, like right now.
>>
>>56455962
>good
>3dpd

Pick one and leave this board, dumb faggot.
>>
>>56456009
I don't follow your rules senpai. Senpai means family.
Thread posts: 339
Thread images: 38


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