[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 Python 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: 316
Thread images: 42

File: bTULJYm.jpg (389KB, 2906x1719px) Image search: [Google]
bTULJYm.jpg
389KB, 2906x1719px
What species of snake are you caring for, /g/?

Previous thread: >>61404703
>>
OP is a faggot
>>
Is it worth learning Android now? Tempted to do Udacity's nanodegree
>>
>>61409816
I would have thought Android to be a busted flush at this point
>>
File: 1496554525343.jpg (28KB, 354x313px) Image search: [Google]
1496554525343.jpg
28KB, 354x313px
any curl users? im wondering if i can use
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, &progress_callback);

in curl_multi interface
>>
I'm doing my babbys first multithreading on C# with Parallel.For, and I'm using nested loops

when I make the outer loop parallel, everything works just fine, but if I make the inner loop parallel the results get completely skewed for no reason, what is going wrong?

It's quite a bit of code, can anyone point me to a website where I can put it so you can see?
>>
>>61410055
ghostbin or hastebin
>>
does the dragon book teach any assembly?
>>
>>61410055
>>61410084
Ghostbin has google analytics botnet

https://privatebin.net/
https://ybin.me/
>>
>>61410148
>Ghostbin has google analytics botnet
>https://ybin.me/
>gstatic tracker
>>
>>61410084
>>61410148
I ended up using pastebin, but thanks for the suggestions

https://pastebin.com/VFNkZ6X1

the outer loop (Line 4) works fine in parallel
the inner loop (Line 31) shits itself while checking who wins (Line 59) if it's running in parallel instead

I tried to use lock() on that checking part but the results are still the same
>>
>>61410042
i could never get curl_multi to work right, it would always randomly truncate files
>>
>>61410191
> static object lel
> lel

stoppped reading there
>>
>>61410191
>setting non-init variables in loops

From a glance you need to get rid of those nested if/else
>>
>>61410191
Your inner loop is mutating variables outside itself, e.g. K_HP. If you can, move the declarations of K_HP, D_HP, K_ATK, D_ATK, K_DEF, and D_DEF inside the inner loop, and put K_W, D_W, and Tie inside atomic references.
>>
>>61410245
>If you can, move the declarations of K_HP, D_HP, K_ATK, D_ATK, K_DEF, and D_DEF inside the inner loop
I can do that, they were like that before

>put K_W, D_W, and Tie inside atomic references
I'll read about what that is, then I'll return to you

thanks for the pointers anon
>>
File: me rn.jpg (47KB, 1024x576px) Image search: [Google]
me rn.jpg
47KB, 1024x576px
>can't eat Doritos and program at the same time
>>
>>61410288
>eating literal poison
stop
>>
>>61410279
I don't know what C# calls it, but in Java using AtomicInteger instead of int for K_W etc. is what I'd do.
>>
would creating a compiler be as simple as having a toy language that i translate into a C program, by giving the program's source as input to an exeuctable which outputs the resulting program and then uses gcc to compile it?
>>
>>61410300
I'll worry about my long-term health once I stop wanting to kill myself every 5 minutes.
>>
>>61410321
that's literally how C began, as transpiled asm
>>
>>61410334
>wanting to kill myself every 5 minutes.
why?
>>
>>61410288
switch to jalapenos, much healthier
>>
>>61410288
Don't you take your hands off the keyboard to think occasionally? Your code isn't that brainless and rote right?
>>
>>61410321
Yeah it's pretty common actually. This compiler does that: http://call-cc.org/
>>
>>61410321
Not a bad idea. But consider C-- instead of C.
>>
>>61410380
CHICKEN now runs on Windows without cygwin? Fuck yeah, that's awesome!
>>
>>61410385
you always do a restriction of the language (subset) not the entire language.

the entire language takes too much work imo
>>
>>61410405
Yeah perhaps that's even smarter.
>>
What are the upper division computer systems courses like? I'm about to finish my prerequisites and I wanna go into networking and operatig Systems
>>
>>61410419
What's an upper division?
>>
>>61410358
Where to begin:
>still live at home
>burden to parents
>entering senior year at Uni studying CS, but I've never had a single internship, leaving me with dwindling career prospects
>social prospects are even worse
>no friends IRL or online and I have no one but myself to blame
>so in my own head that all aspects of interacting with people seem contrived and exhausting so I barely even try anymore, which contributes to me again having no friends
>brainlet
>I've been programming for years but I still feel like a retard and understand little/nothing of the discussion in these threads
I could go on.
>>
>>61410321
That would be a transpiler.
>>
>>61410426
3000-4000 level courses at uni. They're the advanced undergrad courses
>>
>>61410172
Fuck, where?
>>
>>61410385
Using c-- removes one of the biggest advantages of transpiling to c, portability.
>>
File: aaaaaaaaaaa.png (13KB, 263x479px) Image search: [Google]
aaaaaaaaaaa.png
13KB, 263x479px
>>61410457
>https://ybin.me/
at least, that's what my ublock origin shows

don't know what pic related means tho
>>
I need help with deploytment.

My project consists of dozens of processes that collect data from various sources. They need to be restarted reliably whenever updates are pushed to Git.
What I need is a process monitor with an RPC API that I can call from a git hook. I could ghetto rig my own solution but surely an orchestrating software must exist already, polished and relatively bug free.

TLDR: Looking for micro service orchestration software
>>
>>61410445
>social prospects are even worse
>no friends IRL or online and I have no one but myself to blame
if you want friends, you can join a club or something like that (or play a team sports)

>entering senior year at Uni studying CS, but I've never had a single internship, leaving me with dwindling career prospects
are you applying though? it's alright if you send 50 curriculums and only receive like 2 calls back. at least you're trying

>I've been programming for years but I still feel like a retard and understand little/nothing of the discussion in these threads
you're slacking. you don't set goals for yourself

that's my shitty advice
>>
>>61410445
>Same as you except I went to a community college.
>I want to study engineering, but I'm already 23. Not sure what to do.
>Lost my job as a gamedev on February.
>I hate my third world country. Job remuneration sucks here.
>Still haven't got a new job.
>Learning a lot of webdev aiming to get a job at germany or somewhere else with paid relocation.
>No friends, I'm an antisocial. Don't go out of my house.
>Live with parents, want to get the fuck out, but I don't want to get again in a crappy local job burning me out for almost no pay.
>I'm really sick, some cardiovascular issues, hands red wrinkled and skin burning, blue veins visible on my hands and below my eyes.
>I piss myself and I'm having trouble digesting food.
>24hs migraine, pain on knees and bones, but I keep doing exercise or else the fatigue makes me sleepy.
>No one cares, the doctor I went to is dumb as fuck.
So I just try to learn everything I can to get a job, while I don't have a life.
>>
>>61410565
code/programming will save your life.

keep pushing
>>
>>61410582
Or kill me at the end. But dying would be a relief by now. At least experienced the basics of life.
>>
File: no.jpg (33KB, 606x446px) Image search: [Google]
no.jpg
33KB, 606x446px
>>61410491
Mine is gstatic free, idk
>>
>>61409816
Udacity is the biggest piece of shit waste of time known to mankind. No matter what it is you are doing, Udacity is not the answer.
>>
>>61410605
i'm at windows at the moment, not Linux.

you? could be from that idk
>>
>>61410616
What's better?
>>
>>61410288
Blend your doritos with your mountain dew and drink it through a straw.
>>
>>61410084
>>61410148
>>61410172
/g/ should really make its own pasta site, called eb.in or something
>>
>>61410314
I tried using Interlocked.Increment() https://msdn.microsoft.com/en-us/library/dd78zt0c(v=vs.110).aspx on K_W, D_W and Ties but had no success, will try some other ways i've found, but I don't know if it will work
>>
>>61410634
Not a bad project idea desu.
>>
>>61410627
Literally anything else. Udacity is like an anti-learning resource, everything I've tested on there is basically completely worthless for teaching. It's laughable.
>>
File: index.jpg (8KB, 275x183px) Image search: [Google]
index.jpg
8KB, 275x183px
>>61410627
learning from a book and posting your progress on /g/, for people to mock you and from that you improve.
>>
>>61409756
>Says python
>posts corn snake

you should have ended it before you made a thread
>>
>>61409816
Yes, but if youjust need to shit out some mobile apps use cordova (apache).
>>
>>61410641
oh wait, I think I know the issue, brb
>>
>>61410668
we got an /an/ expert ova here
>>
>>61410668
a snek is a snek
>>
>>61410668
this is what happens when you don't use an anime image for OP
>>
>>61410622
it's probably beacause of my host lists
on winbotnet too atm
>>61410634
ok, but who will pay for hosting/domain?
>>
File: 1498108612020.webm (924KB, 600x336px) Image search: [Google]
1498108612020.webm
924KB, 600x336px
post more code
>>
>>61410688
>/an/
>expert
/an/ are a bunch of dog dick suckers
>>
>>61410728
/an/ seem okay desu.
>>
>>61410675
I put lock when using the RNG and it worked, now the results came in properly
>>
>>61410722
>hair-seizure.webm
>>
>>61410740
Good job anon. I guess the RNGs aren't threadsafe.
>>
>>61410668
Are you Australian?
>>
>>61409756
>this
>python
Are you retarded?
>>
>>61410668
Why would you want him to post python?
Python is a disgusting language
>>
>>61410783
it's running 2 times slower unfortunately, but it at least can scale a lot more with thread count compared to the first implementation, that would only make use of 10 threads at most

thanks for all the help anon
>>
>>61410818
Yeah, there'll be some overhead from making the inner loop thread-safe. You might be able to improve upon it further by having each thread keep track of its own results (which would allow you to avoid the overhead of Interlocked), and combine the results at the end. Not sure how complex that would be to implement in C#.
>>
>>61410808
Would you prefer JCL?
>>
>>61409756
Rewriting my raycaster. There seems to be precision issues though, I suspect due to catastrophic cancellation in the dot product. I'm going to have to rewrite datenwolf's linmath.h to use doubles and kahan summation it seems.
void finite_pick_with_side_ll_v2(finiteworld * f, float x, float y, float z, int * output) {
finite_pick_ll(f,x,y,z,camera_angle[0],camera_angle[1],camera_angle[2],4,output);
if(output[0] == 0)
return;

block * b = finite_getblock(f, output[1], output[2], output[3]);
model_raytest_rect * raytests;
int quadcount;
switch(b->type) {
case MODEL:
raytests = b->u.m.m->raytests;
quadcount = b->u.m.m->vertcount / 6;
break;
default:
raytests = block_modelblock->u.m.m->raytests;
quadcount = block_modelblock->u.m.m->vertcount / 6;
}
vec3 tmp;
vec3 intersection;
vec3 camera_pos; //relative to block
camera_pos[0] = x - output[1];
camera_pos[1] = y - output[2];
camera_pos[2] = z - output[3];
//XXX n & u & v & v0 are rotation dependent
//so they will need to be recalculated if the model is rotated
//TODO switch to doubles, precision errors at extreme angles at seams
for(model_raytest_rect * rect = raytests; rect < raytests + quadcount; rect++) {
float camera_dot_quad = vec3_mul_inner(rect->n, camera_angle);
//Ray faces away from quad
if(camera_dot_quad <= 0) //TODO we can fine tune this to a number larger than 0
continue;
vec3_sub(tmp, rect->v0, camera_pos);
float t = vec3_mul_inner(rect->n, tmp) / camera_dot_quad;
vec3_scale(tmp, camera_angle, t);
vec3_add(intersection, tmp, camera_pos);
vec3_sub(tmp, intersection, rect->v0);
float s = rect->negvnorm * vec3_mul_inner(tmp, rect->u) / rect->k;
t = rect->negunorm * vec3_mul_inner(tmp, rect->v) / rect->k;
if((0 <= s) && (s <= 1) &&
(0 <= t) && (t <= 1)) {
output[4] = rect->side;
return;
}
}
output[4] = -1;
return;
}

Any tips for avoiding dot products?
>>
>>61410884
This isn't an ugly language dick waving contest.

All languages are ugly, NO EXCEPTIONS. Some languages are just more less ugly than others.
>>
>>61410334
>>61410445
feels
>>
>>61410879
the largest overhead is on the RNG locks as far as I can tell since it was running faster (but shitting on the results) before putting them there
>>
File: t.png (59KB, 1680x1050px) Image search: [Google]
t.png
59KB, 1680x1050px
>>61409756
>What species of snake are you caring for, /g/?

Exploring the deepest, darkest corners of Rackets.
>>
>>61410928
sml for mutually recursive data structures is gorgeous
>>
I think I finally understand "moan ads" /dpt/. Still have trouble with more complicated ones like Cont though
>>
>>61411278
Hutton book is a decent resource
>>
>>61411084
Why would you put a filter over your screenshot?
>>
>>61411378
there is no filter
>>
How do you implement a monad in ANSI C?
>>
>>61411397
you don't need monad in c since it's imperative at its very core.
>>
>>61411397
http://www.cs.utah.edu/~arichard/monad.html
>>
File: C ints and floats.jpg (733KB, 3702x2198px) Image search: [Google]
C ints and floats.jpg
733KB, 3702x2198px
How have I done?

#ifndef _STDIO_H
#include <stdio.h>
#endif

enum {INT, FLOAT};

typedef struct Number{
int type;
union val{
int i;
float f;
} val;
} Number;

Number addTwoNumbers(Number i, Number j){
Number tempNum = {
.type = INT,
.val.i = 0
};

if((i.type == INT) && (j.type == INT)){
tempNum.type = INT;
tempNum.val.i = i.val.i + j.val.i;
}
else if((i.type == FLOAT) && (j.type == INT)){
tempNum.type = FLOAT;
tempNum.val.f = i.val.f + (float)j.val.i;
}
else if((i.type == INT) && (j.type == FLOAT)){
tempNum.type = FLOAT;
tempNum.val.f = (float)i.val.i + j.val.f;
}
else if((i.type == FLOAT) && (j.type == FLOAT)){
tempNum.type = FLOAT;
tempNum.val.f = i.val.f + j.val.f;
}
return tempNum;
}

void printSum(Number x, Number y){
Number tempNum = addTwoNumbers(x, y);
printf((tempNum.type == INT ? "%d" : "%f"), (tempNum.type == INT ? tempNum.val.i : tempNum.val.f));
}


#include <stdio.h>
#include "twonum.h"

int main(){
Number one = {INT, .val.i = 5};
Number two = {INT, .val.i = -2};

Number three = addTwoNumbers(one, two);
printf("%d\n", three.val.i);

two.type = FLOAT;
two.val.f = 4.0;

printSum(one, two);
}
>>
File: 1471746519779.webm (602KB, 480x360px) Image search: [Google]
1471746519779.webm
602KB, 480x360px
>>61409756
Python is a cute!
>>
>>61411922
The lengths people go to, in order to attempt to make C appear modern, is sad.
>>
>>61411938
https://www.youtube.com/watch?v=LIMd2kF8Ci4
>>
>>61411938
Is that a snake yawn?
>>
>>61411922
Float conversion is implicit due to type promotion.. You can remove it.
>>
>>61411922
Pretty sure that preprocessor stuff at the top is superflous, it's not 1974 and I'm sure by now any decent implementation already has include guards in the standard library header (and any implementation that DOESN'T have that probably doesn't support enums either).
>>
>>61411971
I believe it's to realign the jaw
>>
>>61411962
C is modern enough.
Name one thing a language can do that C can't do that actually has a point to it and isn't just disgusting bloat.
>>
>>61412042
Non-C++ templates are good though.
slice & ranges.
UFCS.
modules.

to start.

Note: if the end result looks and feels hackish it doesnt count.
>>
>>61412042
no bias detected in this post
>>
>>61411973
>>61412010
Done, although I had thought the compiler complained about implicit something-or-other when I hadn't included stdio.h in the header.

enum {INT, FLOAT};

typedef struct Number{
int type;
union val{
int i;
float f;
} val;
} Number;

Number addTwoNumbers(Number i, Number j){
Number tempNum = {
.type = INT,
.val.i = 0
};

if((i.type == INT) && (j.type == INT)){
tempNum.type = INT;
tempNum.val.i = i.val.i + j.val.i;
}
else{
tempNum.type = FLOAT;
tempNum.val.f = ((i.type == INT) ? i.val.i : i.val.f)
+ ((j.type == INT) ? j.val.i : j.val.f);
}
return tempNum;
}

void printSum(Number x, Number y){
Number tempNum = addTwoNumbers(x, y);
printf((tempNum.type == INT ? "%d" : "%f"),
(tempNum.type == INT ? tempNum.val.i : tempNum.val.f));
}
>>
>>61412120
Oh, I don't mean remove the #include <stdio>, that's pretty much neccessary for programming in a modern style, but the #ifndef or whatever around it is superfluous.
>>
>>61412086

>Non-C++ templates are good though.
Macros.
Alternatively void*. (This is my preferred approach. If the behavior of the function or struct should be type invariant, why even have a parameter for the type at all, and if it shouldn't, why even make it generic.)
>Note: if the end result looks and feels hackish it doesnt count.
It's not hackish. It's a proper use case for macros.

>slice & ranges.
struct range {
void *start;
size_t len; // in chars
};


>UFCS.
Not applicable, C has no receivers. IMO that's a positive quality about it.

>modules.
A header isn't a module, but a compilation unit basically is.
>>
>>61412132
Ah! I only got the warning message when I try to compile the header separately.
That makes more sense. Apologies for the incompetence: I haven't noodled about with headers before.
>>
>>61411922
#include <stdio.h>

// Typedefs are for fags
struct number {
enum {
INT,
FLOAT,
} type;
union {
long long i;
double f;
};
};

#define number(n) _Generic((n), \
signed char: (struct number){ .type = INT, .i = (n) }, \
short: (struct number){ .type = INT, .i = (n) }, \
int: (struct number){ .type = INT, .i = (n) }, \
long: (struct number){ .type = INT, .i = (n) }, \
long long: (struct number){ .type = INT, .i = (n) }, \
float: (struct number){ .type = FLOAT, .f = (n) }, \
double: (struct number){ .type = FLOAT, .f = (n) }, \
long double: (struct number){ .type = FLOAT, .f = (n) } \
)

struct number add(struct number a, struct number b)
{
switch (a.type | (b.type << 1)) {
// INT + INT
case 0x0:
return number(a.i + b.i);
// FLOAT + INT
case 0x1:
return number(a.f + b.i);
// INT + FLOAT
case 0x2:
return number(a.i + b.f);
// FLOAT + FLOAT
case 0x3:
return number(a.f + b.f);
}
}

void print(struct number n)
{
switch (n.type) {
case INT:
printf("%lld", n.i);
case FLOAT:
printf("%lf", n.f);
}
}

void println(struct number n)
{
print(n);
putchar('\n');
}

int main()
{
struct number a = number(10);
struct number b = number(5.5);

struct number c = add(a, b);
println(c);
}
>>
>>61412186
Not him (actually this guy >>61412042) but this is an abuse of C. Of all the things you might want to write generic code to handle, why numbers? Literally why not just use plain numeric types? And what's with that hideous syntax, when if you DO insist on a generic number type, you could just be using void *?
>>
>>61411922
>>61412120
in Haskell this is just

data Number = INT Int | FLOAT Float

instance Show Number where
show (INT i) = show i
show (FLOAT f) = show f

castFloat :: Number -> Float
castFloat (INT i) = fromInteger (toEnum i)
castFloat (FLOAT f) = f

liftFloat2 :: (Float -> Float -> a) ->
(Number -> Number -> a)
liftFloat2 f x y = f (castFloat x) (castFloat y)

instance Num Number where
fromInteger i = INT (fromInteger i)
(+) (INT i) (INT j) = INT (i + j)
(+) (FLOAT f) (FLOAT g) = FLOAT (f + g)
(+) a b = FLOAT (liftFloat2 (+) a b)
-- NOTE
-- Same functionality by this point
-- NOTE
(-) (INT i) (INT j) = INT (i - j)
(-) (FLOAT f) (FLOAT g) = FLOAT (f - g)
(-) a b = FLOAT (liftFloat2 (-) a b)
(*) (INT i) (INT j) = INT (i * j)
(*) (FLOAT f) (FLOAT g) = FLOAT (f * g)
(*) a b = FLOAT (liftFloat2 (*) a b)
abs (INT i) = INT (abs i)
abs (FLOAT f) = FLOAT (abs f)
signum (INT i) = INT (signum i)
signum (FLOAT f) = INT (round (signum f))

instance Read Number where
readsPrec p s | [(i, s')] <- readsPrec p s = [(INT i, s')]
readsPrec p s | [(f, s')] <- readsPrec p s = [(FLOAT f, s')]
readsPrec _ _ = []
>>
>>61412231
Of course it's an abuse of C. That's exactly what I was going for.
>>
>>61412235
In C this is just
typedef long long Number;
>>
>>61412244
But WHY?
Why not just use C properly?
>>
>>61412245
>1 with 37 zeroes in a long long
>>
>>61412259
I wrote the code as a joke. I wouldn't expect anybody to actually use code like that.
Tagged unions definitely have a lot of uses, but simply representing numeric types is not one of them.
>>
>>61412266
>this is a problem for some reason
>yet the huge waste of time and computational resources that is generics isn't
>>
>>61412279
>in C this is just
>[not remotely equivalent at all]
???

The haskell version I gave doesn't use generics at all
here's the minimum version

data Number = INT Int | FLOAT Float

instance Show Number where
show (INT i) = show i
show (FLOAT f) = show f

fromInt :: Num a => Int -> a
fromInt = fromInteger . toEnum

addNumber (INT i) (INT j) = INT (i + j)
addNumber (FLOAT f) (FLOAT g) = FLOAT (f + g)
addNumber (INT i) (FLOAT g) = FLOAT (fromInt i + g)
addNumber (FLOAT f) (INT j) = FLOAT (f + fromInt j)


it would be nice to see discriminated unions and pattern matching in C
they have a pretty direct representation
(basically what the original C poster gave, a tag and a regular C union)
>>
Is SDL typed differently between C and C++ or is it the same syntax? I'm too stupid to tell and struggle with understanding the documentation
I think I worded this poorly and I'm sorry for that
>>
File: 018.png (160KB, 465x465px) Image search: [Google]
018.png
160KB, 465x465px
>>61411084
Mah man.

>>61409756
I'm running through the exercises in SICP (specifically exercise 4.7). I've managed to take a let* and convert it into a series of nested let's, but if I want to then convert the nested let's, I'm running into a little trouble. I'm so close to completing it, but I can't figure out what's wrong. If you'd like to take a gander, here's a gist. I'll make it prettier once I have it working.

https://gist.github.com/lehitoskin/8e146e03060bbb00e3e8cbff45e57b20
>>
>>61412360
Is your Gentoo hardened?
>>
Roses are red.
Violets are blue.
Classes and ADTs
Are basically
The same thing
And the only difference
Is that ADTs
Stroke FP fags' egos.
Fite me fegute.
>>
File: bakabaka.png (510KB, 782x1238px) Image search: [Google]
bakabaka.png
510KB, 782x1238px
>>61412385
>>
>>61411922
This is what languages like python do behind your back.
It's really unnerving.
>>
rate
int lis(int *a, int n, int *m)
{
int i, r, h = 1;
if (n == 1)
return 1;
for (i = 1; i < n; i++) {
r = lis(a, i, m);
if (a[i - 1] < a[n - 1] && r + 1 > h)
h = r+1;
}

if (*m < h)
*m = h;

return h;
}
>>
>>61412403
I'm not saying ADTs are useless. They're very useful. I'm saying they and classes are literally exactly the same thing. There's nothing you can do with either that you can't do with the other one in almost the same way, save for minor differences in function call syntax.
Proper purely functional code shouldn't make use of ADTs, because ADTs are pretty much object oriented.
>>
>>61412462
God. /dpt/ you've damaged me. I feel like correcting myself and clarifying that what I really mean is that they do things like this. Not that they'd implement a number type exactly like this.
>>
In an interpreted language like Python, does something like
if i in {1, 2, 3}:

get optimized in any way? Or does the set get recreated, and therefore expensively rehashed each time the expression is evaluated?
>>
>>61412470
They aren't the same at all, and ADTs are definitely not OO.
You can even have subtyping that isn't OO.

ADTs are closed, classes are not.
This is a major difference.
>>
>>61412500
disasemble the code, for example
>>> def foo():
... if 2 in {1,2,3}:
... print ('dfg')
...
>>> import dis
>>> dis.dis(foo)
2 0 LOAD_CONST 1 (2)
2 LOAD_CONST 5 (frozenset({1, 2, 3}))
4 COMPARE_OP 6 (in)
6 POP_JUMP_IF_FALSE 16

3 8 LOAD_GLOBAL 0 (print)
10 LOAD_CONST 4 ('dfg')
12 CALL_FUNCTION 1
14 POP_TOP
>> 16 LOAD_CONST 0 (None)
18 RETURN_VALUE
>>>
>>
>>61412500
>get optimized
Anon you absolutely should not worry about things like these in python. Python is so ungodly slow that if you wanted something fast you'd write it in C and call out to C. Python has pretty nice facilities for this too.

Worrying about the performance impact of your abstractions is the last thing you should do. And almost always the easiest answer to your issues is to improve your algorithm or rewrite it in a language that allows for speed.

You absolutely shouldn't care. Write what's fastest for you to write.
>>
>>61412538
Great, thanks.
>>61412544
>You absolutely shouldn't care
That makes no sense. Since it's so slow, shouldn't trivial optimization be even more important than it is in a compiled language?
>>
>>61411922
>
#ifndef _STDIO_H
#include <stdio.h>
#endif

When will you kill yourself my dude?
>>
File: 1qwer5tesghfdg.jpg (802KB, 1806x1204px) Image search: [Google]
1qwer5tesghfdg.jpg
802KB, 1806x1204px
>>61412635
>>
File: 1477849269108.png (164KB, 659x525px) Image search: [Google]
1477849269108.png
164KB, 659x525px
>>61412507
>They aren't the same at all, and ADTs are definitely not OO.
You have a piece of data. Usually a record.
It gets passed around to functions that describe possible operations on it.
These functions are usually defined in a dedicated module.
If you call the piece of data an "object," the functions "methods," and the module a "class," you have very nearly correct definitions for these words.
Face it, it's OO.
>You can even have subtyping that isn't OO.
Yeah, by writing another module that adds more methods. Excuse me, I mean more """"""""""functions"""""""""".
Which is basically exactly what inheritance is.
>ADTs are closed, classes are not.
>This is a major difference.
Psh, no it ain't. Classes have private.
>>
>>61412635
Trying to reason with Cniles is useless.
>>
>>61412662
>You have a piece of data. Usually a record.
>It gets passed around to functions that describe possible operations on it.
>These functions are usually defined in a dedicated module.
>If you call the piece of data an "object," the functions "methods," and the module a "class," you have very nearly correct definitions for these words.
>Face it, it's OO.

Are you seriously trying to say that ALL operations on data are OO?
Fuck off, you stupid fag.

>Yeah, by writing another module that adds more methods. Excuse me, I mean more """"""""""functions"""""""""".
>Which is basically exactly what inheritance is.
No, you fucking idiot.
Learn basic fucking knowledge of PLT or FP before you criticise.

>Psh, no it ain't. Classes have private.
Jesus christ you're completely fucking retarded


You probably don't even know what FP stands for.
>>
>>61412678
Figurative programming
>>
>>61412678
>Are you seriously trying to say that ALL operations on data are OO?
No, but if you have an operation on data whose "type" is defined in terms of what operations are possible on it, and the operation is part of that definition, then yes, that is OO.

>Learn basic fucking knowledge of PLT or FP before you criticise.
I write Scheme.

>You probably don't even know what FP stands for.
In Paper Mario: The Thousand Year Door, it stands for "flower points."
>>
>>61412678
Fuck programming
>>
>>61412678
It doesn't sound like that other guy knows what he's talking about, but in Scala you can create closed class hierarchies and use them like ADTs. (They're not as nice as true ADTs, though.) Example:

sealed trait Option[+A]

case class Some[A](a: A) extends Option[A]
case object None extends Option[Nothing]
// can't create any other subclasses of Option outside this file
>>
>>61412715
>No, but if you have an operation on data whose "type" is defined in terms of what operations are possible on it, and the operation is part of that definition, then yes, that is OO.
The operations aren't part of the definition.
At all.

You fucking retard.
>>
File: .png (98KB, 1131x879px) Image search: [Google]
.png
98KB, 1131x879px
>>61412756
>The operations aren't part of the definition.
Then we're no longer talking about ADTs.
An ADT is defined in terms of what operations are possible on it.
>>
>>61412771
What ADTs are you talking about?
Certainly not the ones FP people talk about
>>
>>61412771
Wait - are you talking about representing data types purely in terms of catamorphisms?
>>
Proper OOP:
(define (cat name)
(lambda (op)
(cond ((eq? op 'getName) name)
((eq? op 'meow) "meow"))))

(define my-kitty (cat "Hanekawa"))
(display (my-kitty 'getName))
(display (my-kitty 'meow))
>>
>>61412774
take a stack adt for example
things what all you can do:
>make empty stack
>query whether a stack is empty
>push element
>retrieve top
>remove top
for comparison, methods in a stack class:
>constructor
>query whether a stack is empty
>push element
>retrieve top
>remove top
>>
>>61411922
You just programmed the backend of a dynamically typed language. Grats.
>>
>>61412838
>dynamically typed language
No such thing.
>>
>>61412787
>>61412771
To be clear, I mean something like this:

{-# LANGUAGE RankNTypes #-}

newtype Maybe2 a = Maybe2 { maybe2 :: forall b. b -> (a -> b) -> b }

nothing2 :: Maybe2 a
nothing2 = Maybe2 const

just2 :: a -> Maybe2 a
just2 a = Maybe2 $ const ($ a)
>>
>>61412614
"Trivial optimizations" are high level ones, like memoizing expensive functions that you call with the same args over and over again.

If you need more than just good algorithm design, then switch to C.
>>
>>61412873
yes
it has one member, which is a function
it's hardly even an adt!

type Maybe a = forall b. b -> (a -> b) -> b
>>
>>61412820
I get the feeling you're mixing up adts with closures.
>>
>>61412893
that's an encoding of an ADT by its eliminators
>>
File: 2ouFq7k.png (51KB, 657x527px) Image search: [Google]
2ouFq7k.png
51KB, 657x527px
>>61412774
Are you really asking me what an ADT is?
Oh the ironing.
It's not such a difficult concept to understand.
You have a collection of function declarations. Each of them builds, retrieves data from, or does something to the same kind of datum.
These functions, and the invariants their implementations must obey, may well be the only available information about the aforementioned kind of datum. Therefore, it must be built, accessed, and manipulated purely in terms of those functions.
Because these function declarations, and the invariants their implementations must respect, together comprise the ADT proper, they are grouped together.
Functions organized together based on a common purpose of processing a particular kind of datum.
Sound familiar?
That's right, it's a fucking class.
>>
File: lineclimb2.gif (3MB, 100x108px) Image search: [Google]
lineclimb2.gif
3MB, 100x108px
Hmm
>>
>>61412916
ADT = Algebraic Data Type
an ADT is an algebraic expresison on types
>>
Is it worth caring much about heap fragmentation in a GC'd language? As in, is it worth trying to consistently create long-lived objects on say, a vector or other container that's in scope as opposed to just allocating things on the heap at random and leaving the GC to do its thing?

I've been doing the former but I feel a bit like I'm just wanking myself off.
>>
One of you is talking about algebraic data types
The other is talking about abstract data types

You're welcome
>>
File: 1496810915969.jpg (98KB, 1456x896px) Image search: [Google]
1496810915969.jpg
98KB, 1456x896px
>>61412941
What the fuck?
Algebraic?
Alge fucking braic?

So you mean to tell me we HAVEN'T been talking about ABSTRACT data types this whole time?

So you mean to tell me, that when an FP fag comes on here to talk about "muh ADTs", they're talking about ALGEBRAIC data types?

Oh.
Oh I've been gypped.
Oh the ironing.

Yes ok then this entire debate is null and void.

Reminder, though, that ABSTRACT!!! data types are basically classes.
>>
>>61412927
explain
>>
File: 1499495977159.png (159KB, 600x448px) Image search: [Google]
1499495977159.png
159KB, 600x448px
>>61409756
Seriously all of you fucking python users need to realize the superiority of Haskell

Anyone who thinks otherwise it is a gigantic fucking faggot
>>
>>61412788
struct Cat
{
string name;
void meow(string name) {writeln(name, " meow'd");}
}

struct Special_Cat
{
Cat c;
alias c this;
void special_meow(string name) {writeln(name,"says: MEOW");}
}

void main()
{
Special_Cat sc;
sc.meow("kitty");
sc.special_meow("S.C Kitty");
}
>>
>>61412976
abstract data types are just algebraic data types combined with existentials and church encoding :^)
>>
subprocess.Popen([myprogram.py", "Args1", "Args2" ,"Args3"])

how do I keep sending commands to that terminal with the python program running
>>
>>61412982
Wow, cancer
>>
>>61412981
if England becomes uninhabitable for English people then I might move to Australia
they have a good Haskell community

and they're being replaced by chinks and nips rather than pakis and nigs
>>
>>61412988
Okay now you're fucking with me.
>>
>>61412992
Doesn't popen open a file?
Check its return value
>>
>>61412996
its pretty great desu.
I can have Poo-less classes.
>>
>>61412981
Are you real straya or fake straya?
>>
>>61413003
>if England becomes uninhabitable for English people
It already is.
>>
>>61413003
Chines are a super evolved yellow nigger though.
>>
>>61413022
No, it is literally cancer.
I bet that your structs aren't even functions.
>>
>>61413004
class Animal {
public:
virtual void makeNoise();
};


This is just syntax sugar for

struct Animal {
void(void*) makeNoise;
};


which is just

type Animal = exists e. (e, e -> IO ())
>>
>>61412945
It should be a speedup in general, and heap fragmentation is a concern. If a garbage collector is well designed, the biggest bitches for it to collect though are medium-lived objects.

>>61412976
Kek. I was wondering what you were on about. I think most people call what you're talking about opaque datatypes.
>>
>>61413038
This
>>
File: 5YjYpra.jpg (56KB, 1000x800px) Image search: [Google]
5YjYpra.jpg
56KB, 1000x800px
>>61412951
This took me way too long to figure out.
Thanks, I would never have known if not for >>61412941.
>>
Reminder that this is the superior encoding of Maybe:

{-# LANGUAGE RankNTypes #-}

newtype Maybe a = Maybe { maybe :: forall b. b -> (a -> b) -> b }

nothing :: Maybe a
nothing = Maybe const

just :: a -> Maybe a
just a = Maybe $ const ($ a)
>>
>>61413043
They have full functionality though.
>>
>>61413050
(the exists is the combination of the object and vtable)
>>
>>61413064
Not functions
>>
>>61413061
>haskell
>no impredicative polymorphism, thus fundamentally limited
>>
>>61412982
Inheritance is deprecated.
>>
>>61413061
>Using a language with a turing-complete type system
>>
>>61413050
>void(void*) makeNoise;
Pretty sure that isn't even valid.
>>
>>61413100
It probably isn't, C function pointer syntax is ass.

void(*makeNoise)void;
>>
Any sufficiently advanced type system is a bug-ridden ad-hoc re-implementation of Prolog.
>>
>>61413091
>Using a language without a turing-complete type system
>>
>>61413110
Said no one ever
>>
>>61413107
void(*makeNoise)(void*);

which doesn't even look like a member much less a function type
>>
>>61413078
 sc.name = "kitty";
sc.meow(sc);


or what do you mean? I could make the syntax and names a little cleaner though.
>>
>>61413125
sc is not a function
>>
>>61413013

subprocess.Popen([myprogram.py", "Args1", "Args2" ,"Args3"])
how do I keep sending commands to that terminal with the python program running
so once myprogram.py is running you can pass more information to it like
loadfile mytextfile.txt

: the Popen will open myprogram.py in a terminal window
how do I pass more information to that python terminal
>>
>>61413140
Give me an example to implement.
>>
File: 7mgj9ka4.jpg (8KB, 240x193px) Image search: [Google]
7mgj9ka4.jpg
8KB, 240x193px
>>61413050
Fair enough, I see what you mean now.
So A[bstract]DTs can be implemented in terms of a special case of A[lgebraic]DTs.
Way to make the terminology even more confusing.
>>
>>61413144
Check its return value you dumb fuck. (If you want to pass shit to stdin)
You can't pass more shit as arguments though.
>>
>>61413152
Here >>61412788
my-kitty is a function
>>
>>61413157
yes, and all of your OOP inheritance and classes boil down to composition with function pointer members

aka ADTs
>>
What's the hottest pepper you can handle, /dpt/?
>>
>>61413167

ITS A FUCKING PROGRAM GOD DAMN IT
it boots up a gui and the terminal stays open to issue commands to the gui
>>
File: 1459374040496.jpg (9KB, 238x192px) Image search: [Google]
1459374040496.jpg
9KB, 238x192px
Wait so aren't A[lgebraic]DTs pretty much just generics, except with better syntax and none of the stupid restrictions on what you can do with them?
>>
>>61413229
>I am braindead
>>
>>61412977

Generating an image from random lines.
>>
>>61413230
ADTs are just a form of type specification
They're incredibly similar to something like BNF notation

If your type system has generics, you can have generic ADTs
You can even have GADTs which generalise generics
>>
>>61413236

pls halp
>>
File: 1479139387361.png (215KB, 640x400px) Image search: [Google]
1479139387361.png
215KB, 640x400px
>>61413221
>>
>>61413236

and the terminal stays open to issue commands to the gui
>>
>>61413221
Define handle. My tongue is willing to Habanero (haven't tried anything hotter), but my stomach is weak as I awaken the next morning with horrible stomach pain even after only a bunch of Jalapenos.
>>
>>61413262
I told you, check the return value of popen.
>>
>>61413230
A simple example of an ADT is something like:

data Color = Red | Green | Blue


This creates a new type named Color. An instance Color will be one of Red, Green, or Blue.

They can be defined to contain values:

data Alert = Red String | Green


An Alert that is Red contains a String, whereas one that is Green does not.

They can have type parameters:

data Maybe a = Just a | Nothing


They can be recursive:

data List a = Cons a (List a) | Nil


There's more too.
>>
>>61413285
Handle as in tolerate end-to-end without crying.
>>
>>61413183
same functionality
 Special_Cat newborn = sc.MAC(sc, "kitty");
newborn.meow;
>>
>>61413297
>types are literally functions
>>
>>61413318
If newborn and sc are not functions then it's a shit language.
>>
>>61413332
literally give me something you think i cant do.
>>
>>61413349
I think you can't levitate
>>
>>61413358
related to the discussion, baka.
>>
>>61413323
Some "types" are functions, except when by type you mean specifically Type in which case they aren't excluding quantification which sort of is a function but whatever
>>
>>61413323
What's wrong with higher-kinded types?
>>
>>61413323
>>61413388
oh, and you also have function types that aren't functions on types but are functions and types but i guess (->) is a function on types so function is a type function that produces types that are functions but not on types
>>
File: 1442951581811.png (688KB, 460x628px) Image search: [Google]
1442951581811.png
688KB, 460x628px
>>61413250
>>61413297
Okay I am getting this
So it's like the lovechild of generics, enums, and unions, except not ugly and unstable
Like you have
data Maybe a = Just a | Nothing

In sepples this would be
struct Nothing {};
template <typename T>
struct Just {
T t;
};
template <typename T>
struct Maybe {
enum { JUST, NOTHING } which;
Just<T> t;
Nothing n;
};

And then you could have
Maybe<std::list<Color>>
(except you actually couldn't because unions in sepples are nerfed af) but with proper A[lgebraic]DTs it would just be
Maybe (List Color)

That's pretty cool
I can see how you wouldn't actually need anything like classes, because if you ever need any complicated kind of datum which supports many operations, you could just basically build it out of legos
>>
>>61413406
Oops, this part:
Just<T> t;
Nothing n;

is supposed to be in an unnamed nested union
>>
>>61413406
yes, it's just an algebra on types
you have disjoint unions (+), tuples (*) and functions (->) as well as some other stuff

e.g. here is the untyped lambda calculus

data Term =
Var String
| Abs String Term
| App Term Term


by seperating them with spaces you're building a tuple basically in Haskell syntax
in ocaml you would explicitly say (App of Term * Term)
>>
>>61413449
>>61413406
and data is basically just building an explicitly new type, rather than an alias, i.e. struct vs typedef

Just and Nothing are names for the constructors (or the cases), in the same way the cases of bool are True and False
>>
>>61413406
Yes, they're kinda like tagged unions that can be generic.
Maybe (List Color)
would work, you can also nest them like
Maybe (Maybe String)
.

Pattern matching means you can write quite neat code to operate on them:

applyOrElse :: Maybe a -> b -> (a -> b) -> b
applyOrElse m b f = case m of Just a -> f a
Nothing -> b


or

applyOrElse :: Maybe a -> b -> (a -> b) -> b
applyOrElse (Just a) _ f = f a
applyOrElse Nothing b _ = b


Typeclasses allow you to define operations that can be extended to support multiple types, e.g. Functor is a typeclass that allows you to apply fmap to various types, including Maybe and List.

Prelude> fmap ((+) 1) (Just 4)
Just 5
Prelude> fmap ((+) 1) [1, 2, 3]
[2,3,4]
>>
>>61412927
>2.76 MB
Bloat
>>
>>61413542

Fuk u
>>
ITT: retarded frog is such an indiaposter he didn't know the A in ADT stands for Algebraic, not Abstract
>>
File: 1476571076114.jpg (104KB, 1000x1430px) Image search: [Google]
1476571076114.jpg
104KB, 1000x1430px
>>61413562
Rude, friend.
It stands for both. Hence the confused and pointless debate.
>>
>>61412385
dumb frogposter
>>61412662
dumb frogposter
>>61412715
dumb frogposter
>>61412771
dumb frogposter
>>61412916
dumb frogposter
>>61412976
dumb frogposter
>>61413004
dumb frogposter
>>61413055
dumb frogposter
>>61413157
dumb frogposter
>>61413230
dumb frogposter
>>61413406
dumb frogposter
>>61413599
dumb frogposter
>>
>>61410445
You are me except I'm still on my first year at Uni studying SE, so I still got time to improve myself, I guess.
I hope it gets better man.
>>
File: normans.png (274KB, 601x599px) Image search: [Google]
normans.png
274KB, 601x599px
>>61413629
>>
>>61411084
What exactly does that program do?
>>
File: 1499203187396.gif (43KB, 500x666px) Image search: [Google]
1499203187396.gif
43KB, 500x666px
>>61413629
>>
File: 1406803019377.jpg (103KB, 1280x720px) Image search: [Google]
1406803019377.jpg
103KB, 1280x720px
>>61413629
God damn, I fucking wish frogposters were banned on sight.
They are the most cancerous group of people on this website. I would prefer fucking ponyfags instead of that reddit garbage.
>>
File: pe.png (7KB, 277x182px) Image search: [Google]
pe.png
7KB, 277x182px
>>61413952
>>
File: 1467672038292.jpg (84KB, 721x720px) Image search: [Google]
1467672038292.jpg
84KB, 721x720px
>>61413629
thank you, dumb frogposters make me sick
pic related
>>
>>61413952
desu, like most things im starting to hate you people more who throw a fit as soon as you see it and do shit like >>61413629

Ant-X people are most always more obnoxious than the thing theyre bitching about.

PROGRAMMING
>>
>>61413998
>desu
>Reddit spacing
You're not making a good case for yourself, you cancerous fuck.
>>
How come my program isn't crashing when it reads from a negative memory address?
>>
>>61413998
>i hate frogaphobes more than frogposters
maybe you should move to frogland then
>>>/r/eddit
>>
>>61414027
it probably interprets it as an unsigned integer
>>
>>61414015
>>61414035
literally have never been to reddit and abhor the threaded conversation format.

And i just prefer new-lines because they're nicer to read, and present separate ideas better. Autist-kun 1 & 2.
>>
>>61414015
> >desu
How new are you to complain about it.
>>
>>61414060
>i've never been to reddit
and a lot of blacks have never been to africa, doesn't mean they'll be allowed to stay
>>
>>61414063
He probably assumes im saying "To be honest", desu.
>>
>>61414063
>>>desu
I know what it is, you stupid fuck.
Niggerspeak "to be honest" is pretty cancerous as well.
>>
>>61414085
i actually type out 'd','e','s','u' though.
>>
>>61414077
I find myself accidentally typing desu instead of desu. At least I don't say sempai instead of senpai.
>>
File: 1472871874185.png (198KB, 438x544px) Image search: [Google]
1472871874185.png
198KB, 438x544px
>>61414015
>>61414085
Fuck off back to plebit you niggerians desu desu de geso
>>
>>61414211
>sempai instead of senpai
u succ
>>
>>61414211
On dvorak its much more comfortable even if 'desu' are right next to eachother.
>>

#include "stdafx.h"
#define SIZE 10

int largestnumber(int arr_integer_function[], int n);

int main()
{
int arr_of_integers[SIZE];

printf("Please enter 10 numbers\n");
for (int count = 0; count < SIZE; count++)
{
printf("Please type in number %i \t", count + 1);
scanf("%i", &arr_of_integers[count]);
}

printf("\n");


printf("The largest number that you entered is; %i", largestnumber(arr_of_integers, SIZE));


return 0;
}

int largestnumber(int arr_integer_function[], int n)
{
int tempp = 0;
for (int q = 0; q < n; n++)
if (arr_integer_function[q] > tempp) //Sorting program, sorts for largest number
tempp = arr_integer_function[q];

return tempp; //returns my largest number


}


Retard taking his first programming course, I can't figure out why it's not returning the largest number that I entered. Halp please.
>>
>>61414027
>negative memory address
Pointers aren't signed. If you're printfing a pointer and getting a negative result, don't do %i, do %p

Do you mean negative offset? If so, your program isn't crashing because by pure luck. You're just lucky that you haven't crossed a page boundary.
>>
File: 1499839764209.jpg (27KB, 397x408px) Image search: [Google]
1499839764209.jpg
27KB, 397x408px
>wake up in the middle of the night and can't sleep
>open up /dpt/
>people discussing word filters and pepe
American hours are great. I should come here more often.
>>
>>61414244
>for (int q = 0; q < n; n++)
>n++
That should be q++.
>>
@61414265
And yet you make it better by feeling the need to bitch about it instead of contributing discussion.

dumb yurop poster.
>>
File: 1379363073948.png (180KB, 1279x967px) Image search: [Google]
1379363073948.png
180KB, 1279x967px
>>61414319
Fucking christ, thank you.
I'm using visual studio as per class request, is there perhaps a compiler/ debugger that would point out "Hey idiot this is the issue" or is it more of a thing I need to catch myself?
>>
>>61414370
It's a logic error, not invalid code.
A compiler/debugger wouldn't pick up on that.
>>
>>61414370
>compilers/debuggers advanced enough to tell us when we used the wrong variable
what a time future programmers will have.
>>
>>61414362
That's not how you give anon (You)s
>>61414265
>>
!61414395
bakas dont get (You)s
>>
>>61414370
There's some reasons why it probably could tell you that in this specific case that I won't get into because it's complicated but generally no. You can get some of that through enabling warnings and respecting them. But generally logic errors is for you to catch.
>>
>>61414384
>>61414385
>>61414405

Ahh understood, my syntax was alright but my logic was flawed, i'll work on it.

Again, thanks guys!
>>
>>61414403
>>61414395
>>
!61414427
I hope you realize what youre doing is essentially the same thing im doing just with a notification.
>>
>>61414506
>>61414427
>>
>>61414506
Anon here just wants you to learn. This is how you reply on 4chan
>>[postNumber]
>>
<<61414552
Thanks! I think i got it now.
>>
>>61414558
Nice. Well done.
>>
>>61414558
>>61414552
>>
>>61414362
Fuck off underage faggot, this isn't facebook.
>>
>>61414362
>he says, posting another 10 non-programming posts
Whatever dude. I'm gonna take a walk, twilight is the best for walks.
>>
So lads, now that MPC-HC is abandoned, any of you considering forking?
>>
>>61414618
>windows
Windows users can't program.
Also, just use mpv.
>>
>>61414362
Why are m*ricans and a*stralians always the ones shitposting?
>>
%61414647
Its 2pm is straya
>>
>>61414633
But just think.
MPV-HC.
>>
>>61414385
I don't know about you, but I'm totally ready to worship our future AI overlords.
>>
File: 657.jpg (20KB, 424x283px) Image search: [Google]
657.jpg
20KB, 424x283px
What's the biggest personal project you've worked on?
>>
>>61414669
Sounds retarded
>>
>>61414656
>>61414647
>>
>>61414656
So you're saying they're at work?
>>
>>61414682
Lisp
>>
>>61414704
Australians dont work, they just take 8 hour paid vacations away to places that dont have a 90% mortality rate.
>>
is there a better python ide than wingide? i tried pydev and pycharm, but wingide personal is pretty good and i'm tempted to buy the full version.
>>
>>61415244
Give VS Code a try, it has a ton of Python extensions.
>>
What happens if a value is equal to its own type?
>>
anyone else taking the coursera course with the weird fuck with the tie and the gray haired guy that never shuts the fuck up about the big bang theory?
>>
>>61415301
uwotm8
>>
>>61415338
e.g (Type, Type) is of the type (Type, Type)
what happens due to this?
>>
>>61415244
Wingdings is a font not a danger noodle
>>
>>61415346
Successful programs?
>>
>>61415346
python doesnt let you use certain keywords as names, if that's what you mean. It throws an error.
>>
>>61415346
You must be the dumb frogposter who just discovered ADTs
>>
>>61415362
>python
what
>>
Classes are objects. Objects are instances of classes.
>>
File: sad.png (273KB, 750x688px) Image search: [Google]
sad.png
273KB, 750x688px
>>61415364
>frogposter
>dumb
>>
>>61415329
No but I'd be interested to see what this is about.
>>
>>61415407
>Classes
>Objects
please meme yourself off the face of the earth
>>
why hasn't GNU Guile gained more traction as an embeddable scripting language? is it because of the non-permissive licensing?
>>
the problem with permissive free licenses (as opposed to copyleft) is that if a superior proprietary fork is made everyone will want to use that instead and you can't offer them an equivalent quality alternative that respects their freedoms as users because the changes the proprietary fork has made are proprietary so if you tried to integrate them into a new free as in speech version you'd be breaking copyright law
>>
>>61415434
lol noob learn to meta-object protocol

CL-USER[1]: (typep (find-class 'standard-object) 'standard-object)
T
>>
>>61415540
>meta-object protocol
>object
lol noob lrn 2 adt
>>
>>61413538
What esoteric programming language is this?
>>
>>61415407
Explain anonymous classes and partial classes then.
>>
>>61412736
What are you talking about? This is how you implement ADTs in Scala, what is not "true" here?
>>
>>61415599
Nice double dubs!
>>
File: nope.jpg (340KB, 1000x668px) Image search: [Google]
nope.jpg
340KB, 1000x668px
>>61415267
>made in meme.js
>>
>>61414633
Most programming in the world is done on Windows, lad. Stay mad.
>>
>>61415698
Youre missing out m8.
>>
>>61414319
You mean ++q
>>
>>61415505
you cannot relicense software
>>
>>61410363
>eating fruit
>unironically
>>
>>61415727
I usually write the prefix version too, but I can't be bothered explaining the difference if he didn't know, and it literally makes no difference in this context.
>>
File: killa.jpg (239KB, 961x816px) Image search: [Google]
killa.jpg
239KB, 961x816px
I'm not really all about the torrenting scene so I might as well try to Pajeet my way through getting some PDFs.

Anyone have either Haskell Programming from First Principles, or Type-Driven Development in Idris?

It took me 16 chapters of Real World Haskell to ultimately come to the conclusion that the book fucking sucks.
>>
>>61415713
That's why most of the programs are crap.
>>
>>61415751
Eben Moglen begs to differ.
>>
New thread:
>>61415784
>>61415784
>>61415784
>>
>>61415793
I don't like this thread.
Someone should post a better one.
>>
>>61415767
HPfFP is up somewhere, you can check archives (not on site, google /g/ archive, e.g. desuarchive or rebbecaeblacktech) and search them for "fpt"

the wikibook is good

also you're a stupid fucking frogposter
>>
proper new
>>61416003
>>61416003
>>61416003
>>
https://github.com/SocioSanity/Kernel-Research
Thread posts: 316
Thread images: 42


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