/dpt/ - Dependent Profunctor Types

What are you working on, Jow Forums?

Old thread:

Attached: Haskell-Variation (logo only)-medium.png (1000x716, 48K)

Other urls found in this thread:

pentestpartners.com/security-blog/hacking-tracking-stealing-and-sinking-ships/
twitter.com/AnonBabble

Rust is like super gay

I'm working on not-haskell
advancing my project euler

so you don't actually need to, it's just another anti-feature/pattern sepples users think is good.
thanks.

user's not wrong

see , just because you cannot grasp some concepts doesn't mean they're useless

Should there be a minimum knowledge level required to post in /dpt/?

How do you intend on verifying people?

>no gay pride Haskell logo
fucking facists

i understand it fine.
i guess it's needed in the realm of sepples, i just thought there was more to it, but there wasn't.

No, of course beginners should be welcome.
What should be banned is posting about c++.

I was thinking perhaps there could be a policy of removing/ignoring things like clearly homework posts

they get ignored anyways, natural selection and all that

it's not necessarily needed, it just simply reduces code duplication and verbosity

C++ is a sin.
C is so much better, why would anyone even touch C++.
#include

int main() { printf("Fuck niggers.\n"); return 0; }

So much better than iostream that overloads everything.

>if i put everything on one line my shitlang will look better

I also think that we should ban C-posters, but that's secondary to the c++ posters.

Perhaps we should ban posting about any language in which traverse cannot be written.

I was rushing you faggot.
C is the best and most influential language, are you mentally retarded? C#, Java, and GO posters should be banned if anything.

you can get that sort of behavior out of C it just takes a bit of writing

C is a thing of the past that was only good back in the day, everyone with a brain moved on based on the actual advances in the past few decades.

good luck programming your washing machine with haskell

C autists will write a 400 line heretical define just to prove C is """"""""""""'functional""""""""""""""

C is still the most widely used language software development, to not use it would be sin.
Until the majority of written operating systems stop using C, it is one of the best languages you could use.
But most operating systems to this day still remain written in C. C really is still an industry standard.

beautiful

legacy =/= industry standard my dude

>most widely used
lets be fair dude most of that use is maintenance of old stuff written a long time ago. C has its use cases but it's not The Only Good Language and it's really not as low-level as people think.

what? noone would do that because the people that use C use it for different purposes than you'd use FPLs

Personally, I still use C because it has a lot of support still, and I generally enjoy the language a lot.
I think shitposting about languages is pointless, unless the language is really deserving of it, like C++ or Java.

>it's pointless unless my subjective opinions
alright buddy

everything is subjective opinion btw

>Personally, I still use C because it allows me to focus my time on trivialities, and so I don't have to think about good high-level organization and architecture.

Yeah C is fun because it's just clean and simple, but it's not a perfect language. It's missing lots of perfectly acceptable features because it's just old, and there's lots of idiots who will go WELL THATS BECAUSE ITS LOW LEVEL when it's really not. C is "low-level," defined as more closely resembling what's happening in the processor, when you run it on a fucking PDP-11, but on any modern hardware there's a ton of wild shit happening that you are not told about at all, and the burden of understanding the weirdnesses of compiler-specific implementations aren't that much less than any other language.

this.
Pretty much like functions, goto is all you need.

i would love to see someone make a game in C++ using only goto

I developing games using C and SDL, so it serves me my purpose and it serves me well.

*I develop games

My old programming teacher would love to kill you

>I developing games
Pottery.

if only you had boundschecking on your words.

i wouldn't

I'm retarded, excuse me.

a function is just another anti-feature bloat users think is good. It's clearly not needed, as you can achieve the same thing with goto and good management of your stack/registers.
also

whomst has all the challenge pics

I would love to see someone remake GTA V in nothing but BASIC.

>being this assblasted about virtual functions

Ah, these summer anime are pretty interesting.

I would love to see someone remake traverse in C#.

I'm trying to solve problem 11 in project euler but I'm kind of stuck. Could someone give me some pointers on how to start? I don't want to google because I'm worried I*ll just end up seeing the entire answer.

Doing it in fsharp

print "HELLO Jow Forums! ";
goto 1;

E P Y C
P
Y
C

Where exactly are you stuck? Can you create an array (or other data structure) with the numbers from the grid? Can you find the product of 4 adjacent numbers?

How do I do this the other way round with sprintf? Does this work?
while(sscanf(buf, "%f;%n", &data, &offset) == 1) {
buf += offset;
values[i++] = data;
}


I want to print N floats to a buffer. I know N before compile time

I did it in C but as far as I remember I just stored it in an array and tried all the possibilities, flagging the positions that I already checked so there were no duplicate calculations
it's really not that time-consuming and remember that the only rule is that your program has to run for 1 minute or less.

snprintf

can you obsess over a function that's atleast interesting?

>ask a question about what is the returned value of a function written in C
>ask a question about traverse from haskell
This could skyrocket the quality of /dpt/.

Iirc I just bruteforced that. But can't look it up, because delted muh solutions :^)
But in general: KISS. Really. Try to solve it as simple as you can and improve afterwards

Well I'm not quite finished creating the array, but I'll get there. My problem is mostly I don't know how I'm going to compare values on the diagonal without a ridiculously inefficient brute force algorithm.

What did you flag? I'm thinking if you do it imperatively you have a bunch of nested loops.

yeah, gonna start working on it now. I think I might be overestimating the knowledge needed to do this problem.

What would a traverse return in C ?

Attached: 1513636469709.png (451x619, 429K)

Oh, thanks.

beyond the default case, printf() parses a format string (at runtime), then writes the remaining arguments interpreted as the types annotated in the format string, which is highly unsafe (to the point that compilers tend to implement special case behavior for it). overloaded functions/operators is just one possible approach to implementing comparable functionality in a type-safe way. with modern C++ (thanks to constexpr and variadic templates), you could implement a version of printf() with an identical interface (the only difference being that type annotations in the format string could be optional), but which parses the format string and validates the types of the provided arguments all at compile time (it could account for and support conversions, where applicable, and could even allow extension to support user-defined types). and i wouldn't blame you for doing so; the interface of printf() is often nicer than that of iostreams. but that interface can be implemented better in C++ than it can in C

void*

because when I was doing the first few Eulers I wasn't experienced, but you get the idea
a void pointer?

>crafted with

Attached: 1532159166249.jpg (1570x1536, 396K)

Printf is standard c++

>because when I was doing the first few Eulers I wasn't experienced, but you get the idea
Sorry, didn't mean to sound rude at all. Was going to type more but haven't had coffee yet and I'm hungover so my short term memory is fucked.

I first thought you did nested loops, and then somehow marked already tried combinations in those loops.

oh :S

how is Hackett going lately?

you weren't rude
and yes that's what I did, for every element of the array, if it has 4 other elements in a direction, check if it's the greatest, then flag

but you can avoid the flagging if you just check in 1 direction (like down. right, down-right, up-right) and offset your loop

Alright, that's probably what I would have done too. I think I will just try to brute force it now, seems like I overestimated the time it should take.

increased HRT intake.

Most of C++'s haters are buttmad burgers who can't accept that the best language was not created by an American.

nah senpai I just dislike broken features
but to be fair it's still a decent language

You are making the incorrect assumption that everyone who mainly uses C can think rationally.

I guess but that can be said for any language

Indeed.

...

Guys, serious question from a mathlet in peril. I love programming, I find it super interesting, however, I realized that If I want to solve really difficult/interesting problems in this world, I need math. Thing is, every resource that I find it's so dry, and boring. I know I am shooting in the dark here, but what resources did you guys use to self teach math to yourselves? Also, how did you learn math, and learn programming at the same time without getting overwhelmed? I appreciate every reply. I am just a mathlet that wants to avoid being a code monkey, and become a serious computer scientist. For some context in my current standing, I need to review both my Pre-Calculus, and Calculus. I have never taken Discrete Math, or Linear Algebra, nor Statistics. Thanks in advance.

Why's programming so physically demanding. My whole body starts to ache every day. Mainly my back, my neck, my hands. I can't even do some sports activities anymore because of it.

desu, I had the same problem.
I just went to uni with a heavily math oriented CS program.
I'm just not smart enough to teach myself stuff like math from scratch, and I acknowledged it.

Alternatively, instead of reinventing the wheel, one could use fmtlib which does precisely that.

Spoilers: everyone bruteforces it, but the key is to split the tests. If you split the tests up, you're doing ~20*16*4 tests (about 1500); if you try to do the tests at the same time and aren't efficient, you're doing (20^4)*(16^4) tests, which is 10 billion.

Perhaps because sitting in a chair for hours and hours isn't healthy? Get up every now and then, do a full round of stretches.

>if I want to solve interesting problems I need math
Nah, I work in hardware security and all you need is some basic number theory when crypto comes up
SICP style problems aren't that common irl

I never had issues, I only start to ache after 12 hours+
I was just always good at math and understanding concepts, but I can understand what you're trying to say, sometimes mathboys describe stuff in a way that's hard to understand
if you're trying to get a general feel, I suggest asking a prof from your university (or if you're not a student just ask them as an outsider, some of them read their emails) about recommended literature.
also, the commonly used math concepts in programming are usually simple, so don't get scared

Seems that I will have to take that route, I just find math so goddamn dry, and not as dynamic as programming. But If you want to do anything remotely interesting in this field, and not just do some web shit, you need math. Thanks for the reply.

That gives me a bit of hope. I thought security would be one of the most math demanding areas. Either way, I still want to at least become somewhat competent at math, to avoid becoming just another code monkey. Thanks for the reply tho.

Seems like a good idea. I should just ask my questions to my professors, once I go back to school. Thanks user.

copy grid into text editor
replace " " (space) with ", " (comma space)
save as .csv
open in Excel & click "conditional formatting"

The larger numbers will light up brighter green & you'll instantly see the answer

t. shitty programmer

I like your attitude. The /sci/ wiki has good book suggestions for a variety of subjects, including, and especially, math.
For programming and solving difficult computational problems, some discrete math, linear algebra and numerical analysis are essential. You can later add probability, statistics and DEs in the mix if you think you need them.
Studying math and becoming proficient on your own, CAN be done, but it won't be easy. Make sure you discuss math regularly with knowledgeable people both IRL and online, also, to make sure you are actually learning concepts correctly, you don't want to find out months later that X is actually Y.

There are also some things that are quite open to interpretation and accept different formalisms as long as they are consistent. The quote
>math is not an opinion
is downright asinine.

Thank you user. I will look up the /sci/ wiki, and start working from there.I will see if I can start making fun things with the math that I learn, to make studying it not so tedious.

>Step 1: Look at the grid
>Step 2: Solve by inspection

University is "free" in my country and I chose to study math instead of the CS meme. Good luck competing with mathematicians self learning CS.
CS is literally the easiest STEM field to learn at home, resources online are so good compared to other fields, a CS degree is a meme and I can't understand people paying for this in America.
Go to /sci/, go read the wiki, lurk on math generals threads and work hard, the big problem is that learning mathematics alone is boring (in my opinion).
If you want something related to math and CS you can work on some project euler problems.

Sounds like a great idea. I will give project euler a try. Thanks user.

>If you want to do anything remotely interesting in this field, and not just do some web shit, you need math
Jow Forums is lying to you, web shit is pretty fun
I'm the security user & here's a fun link that shows a cool problem without much math.

pentestpartners.com/security-blog/hacking-tracking-stealing-and-sinking-ships/

Consider why you would even want a math-heavy job in the first place if you don't like math

You are right, maybe I am overstating my math necessary, and yes, that link you posted is pretty cool. However, I still want to at least try to become somewhat proficient in math, because I want to take everything available to me, to become a better programmer/computer scientist, even if it means learning something that I dislike. In other words, I see math as a necessary tool, to my tool kit. Again, I really do appreciate your replies, and I will research that link that you provided in more depth, because it truly looks fun as hell.

>I will give project euler a try
Make sure to post here if you get stuck instead of googling the answer (:

>Consider why you would even want a math-heavy job in the first place if you don't like math
Have you ever seen a God tier musician live and thought "Damn, I wish I could do that too"?

Learning C after learning functional programming, holly shit we can do so many bad things with it like (b = a + 2) - (a = 1), this is scary shit.

Will do, user. I want to start with the one that the user above posted, but like him, I can only think on the brute force way of doing it. I guess gotta get good on my algorithm design as well as my math.

Me lately, every time I see/hear Tosin Abasi play.

scary or P O W E R F U L, depending on who's using it
nah, the first few are all "brute force" more or less