/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

Other urls found in this thread:

yegor256.com/2017/02/21/say-no-to-google-recruiters.html
tour.golang.org
golang-book.com
github.com/yegor256/eo/blob/master/README.md
yegor256.com/2017/06/22/object-oriented-input-output-in-cactoos.html
gustavus.edu/mcs/max/concrete-abstractions-pdfs/ConcreteAbstractions.pdf
nogenerics.info/
twitter.com/AnonBabble

>moslem
>programming

the monad as interpreted by functional programmers is the ultimate embedding of imperative programming within functional programming and represents the pinnacle of 20th century programming innovation, uniting imperative programming, type theory, category theory, first class functions, custom data types, procedural and imperative concepts along with continuations and the lambda calculus to perfect the concept of the pure typed programming language. it is the cherry on top of the proof within the pudding that functional programming is strictly superior to imperative programming.

philistine memesters need not reply

main = putStrLn "Haskell!"

Mudslims a shit, SHIT!

You mean the guy who can't even traverse a binary tree?
yegor256.com/2017/02/21/say-no-to-google-recruiters.html

Learning SFML
If I implement a battleships game with a server. I should only send coordinates to the clients, and not the whole game state right? I've never done any networking before.

no

I'm starting to think that his writings are some sort of parody.

Quick fact: You can put hijab on your head and expose most of your hair (according to Quran). Woman are not obligated to cover every gap on their head, contrary to the popular opinion that they have to wrap it around.
This was a measure taken back in time when Meccan men were likely try to rape/molest woman on the streets. Some fanatics took it too far and covered their wives in bedsheets.

Learn Go:
tour.golang.org
golang-book.com

Stop posting muslims in blue boards.

I am learning it!

I don't get why people complain so much about the interviews. Is it a good gauge? Maybe. Does it only take like ~2 months to learn? Yes. Maybe 3 if you're on the spectrum.

Stop posting hate speech on blue boards.

But mudslims are truly cancer of this planet. No hate. Facts only.

which is better, javascript or python?

Which is better, cancer or AIDs?

AIDs. Maybe not 30 years ago, but these days AIDs is okay.

HIV is okay. AIDs is not.

Fucking muslims

I would have never thought so see someone so autistic about OOP

github.com/yegor256/eo/blob/master/README.md

The only cancer in the world is *ews

>example code
>what actually happens here? TBD
OOP must be wiped off the face of the Earth

im writing a python bot that goes through github profiles, clones random repos, and google translates in-code comments to random languages and then makes pull requests

Why

Fuck that shit I'm learning C

i'm not exactly an expert at programming. i only have a vague idea of what a binary tree is.
is there some resource user could recommend that explains it well and how to do it?

i wonder exactly what question he was asked. seems like he brushes it off as them wanting an algorithm designer, instead of taking it as him lacking a skill anyone doing professional coding is expected to have.

>these days AIDs is okay.
It's a very expensive and time-consuming hobby, much like JavaScript.

That's not fu- on second thought, it's hilarious.

typical binary tree interview question is "what is the maximum element of an arbitrary binary tree?" or "please print every element of any binary tree."

should take about 15 lines, including the binary tree struct / class definition

yegor256.com/2017/06/22/object-oriented-input-output-in-cactoos.html

I noticed how none of his commenters pointed out the fact that excessive memory allocation and deallocation is slow as balls, and that's exactly what he's doing.

Trying to learn Java, not because I have a fondness for it but because I'll need it for a class in the upcoming semester.

I pirated the Java textbook my university uses and holy shit does this author love geometry problems.

The madman...

Binary trees are in basically every CS intro book. One book I really liked, which is basically SICP light, is concrete abstractions:

gustavus.edu/mcs/max/concrete-abstractions-pdfs/ConcreteAbstractions.pdf

why did anyone ever think SAL was a good idea?

It's like the explicitness of Ada's passing modes but without any of the guarantees.

What's not to love?

and they're not only slow but also make things more prone to crashing if for some reason the system fails to allocate memory(the easiest example being running out of memory).

then again, the higher level statements he's advocating against using could also be using allocation and you wouldn't know it because it'd depend on their implementation.

I love OCaml and it's my favorite language syntax-wise, but the real big elephant in the room is not its JS-backend maturity. Rather it doesn't have kernel thread support...all threads are user-level just like Python due to a global lock for garbage collection. This means threads do not run concurrently across multiple cores. Intel is talking about having hundreds of cores on a single die by next decade and having programs that can't take advantage of that is extremely limiting. Xavier Leroy (the creator of OCaml) and his team at INRIA didn't think this was a big deal because when they were writing this stuff, processors were single core and had been since the beginning. Sure there were multiprocessor machines (not the same as multicore as there are multiple die), but those were only meant for servers/workstations. OCaml seemed very promising around 2006, the peak and end of the single core era with the Intel Pentium 4. What made OCaml so impressive was not only was it this beautifully simple, high-level functional language, but that the native compiler produced very fast code that was comparable to C/C++ performance. However, as multicore processors were introduced (Intel Core, Core 2), not having this capability made writing new code in OCaml less appealing. Microsoft was able to do it with F#, which is essentially a clone of Caml by targeting their .NET CLR. Haskell is able to do it with GHC. I still think OCaml is a wonderful language -- not having true multithreading doesn't make it useless. However, to me it has become more like a statically-typed Python which I can use for scripting. Having to use hacks like MPI to do multicore processing is a huge turn off in a multicore world. This is again nothing against the language, but the standard implementation needs a concurrent garbage collector and kernel threads. Otherwise I think OCaml may be doomed to irrelevance in the long run, which would be truly sad.

(;;)

Functional programming, despite having advantages, too often serves as a vessel for the aggrandizement of vapid establishment pablum.

lel at all the triggered faggots. back to your safe zone please. Palestine will be freed and the Jews will be kicked out again, it is only a matter of time. History has proven it time and again and it is written on your books you fucking kikes. That is why you are soooooooo scared of kids throwing pebbles at your tanks.
>>>/oven/

for fuck's sake

Don't fall for the micromeme, user.

Alright can someone tell me what is the fastest way to get into Big Data™? It is all the rage nowadays and I want to get a piece of it.
I already know R and a little bit of CPLEX. I have background in multi-variate statistics, mathematical modeling and optimization, and a little bit of machine learning models (logistic regression and such). I have a degree in management science/operations research.

My questions are the following:
1- Is it worth it to spend the time to learn about Big Data and the related frameworks (like Hadoop)?
2- What books do you recommend I read in order deepen my knowledge about the matter?

>unironically siding with sandniggers
Just kill yourself. Sup Forums has always been pro-Israel.

>Sup Forums has always been pro-Israel.
Fucking JIDF infesting every board

Sandniggers and kikes both need to KTS

If you studied OR you know enough to get a job in meme science / as an analyst. Hadoop can be nice however it's often more on the IT side of things

Here's my tip:

> analyze job ads in your region
> find out what they want
> learn this

They mostly look for knowledge about SQL/SAP. SQL will be easy to learn thanks to the open source references. But what about SAP? that shit is closed source into oblivion.

>implying Sup Forums even knows what multivariate means
go to a site with a maturer population, you wont get help in this brainlet filled shithole

pic unrelated

And you didn't help me with your comment either. Oh the irony.

>Being this entitled and demanding without giving back
I smell a Jew
I merely pointed out the fact that you would gain more information elsewhere.

This is very bad advice.
The norm should be to always use signed. Because they're a less constrained case for the compiler they can optimize more. Especially now that ints are normally 32bit and computers are 64bit the gain is quite substantial. If you use unsigned the compiler is constrained to mod 2^32 behavior.
So signed ints should be the default you go to of you have something that won't wrap. Most compilers even do value range optimization that would let them use smaller types if appropriate. Though it's rare.
Naturally if we're talking struct members things are a bit more complicated but using ints there helps too compared to unsigned int. And VROs basically won't happen. Too complex for most compilers to figure out what the value range for a value is globally in the program.

People like you are truly the worst posters.

I can recommend Robert Sedgewick's book on intro programming with java. However, if you have some knowledge in java, primers or other overview books might be better.

jew confirmed

Look if they ask for a certain dialect of SQL (T-SQL or PL/SQL are often used). They are an extension to the SQL standard. SQLzoo is decent for learning standard SQL

For SAP there are incredible expensive courses, some MOOCs which are free and you can get access to tons of books and a testing environment (learning hub) or just a live SAP installation (SAP live access). The most interesting modules for you are probably SAP HANA, BO and BW

If you are a student you can get all this for a reasonable price. If not the cheapest approach is live access which costs around $100-500 for 20 hours access + one course. The next cheapest alternative is learning hub which costs around $3000 for a year. Certified courses are around $8000 per course.

I learned SAP in school so I can't really say if they are that useful. In my experience SAP is a bit horrible but you can get the hang of it in a day or two if you are computer savvy.

GAS THE KIKE

They have different semantic meanings but can be used in the same places.
I'd be more annoyed if they had 4 different structs where I needed to morph them into each other unnecessarily.
Elaborate on why this is so bad.

I guarantee I'm more gentile than you, mutt. You sure act like one of the people you seem to dislike
>Oh no we can't have serious discussion on this site, not on my watch!
>I need to post memes while complain about the quality of discussion to gently guiding people away from this terrible terrible place!
I'm really surprised you haven't shilled for some other website that's ADL approved, "Hans". Juden raus.

This is what hungarian notation is for.

Is there *any* reason for not making use of static typing? It seems to solve so many problems for programs and programmers alike.

Literally the only criticism of it is "I'm a brainlet and don't want to spend half an hour acquainting myself with type systems"

>motivating your land ownership using the Bible
You do realize the world would be owned by a single religion if this were the case?
Also natives have no sway over land ownership in the modern age. It's all political.

This is a thread about programming though. So keep it OT.

It depends on whether the language has a shitty type system.

Well yeah. What I'm saying is that all languages moving forward should have static typing. No C shit.

It's an attitude that comes from C-like languages that require you to declare types everywhere. It has nothing to do with static typing obviously. But brainlets do interpret it that way.

I find regardless that declaring types is much better. You can make your editor fix most of the redundant typing if you're not lazy/too lazy.

strong typing*

Needing to declare types is largely redundant anyway. You can infer them in most cases.

That was a very brave attempt, shlomo

Indeed. I'm think that primitive types of the language should get inferred and custom types should only get inferred if you name the values in initialization.
Because otherwise you run into ambiguities all over once you add a type. Which is horrible. Future code shouldn't break programs like that.

This advice is very valuable. Screen capped for future reference. Thank you based user.

>You can gain more information elsewhere
>Did not provide a single reference/link
Is this the new level of troleing?

nogenerics.info/

>1- Is it worth it to spend the time to learn about Big Data and the related frameworks (like Hadoop)?
No

Mods please,ban this muslim-posting tramp.

kill yourself

Why?

JIDF is raiding Sup Forums

Good answer and I will be very thankful if you can elaborate on why Hadoop is a useless meme.

IBN HALAL
B
N

H
A
L
A
L

Why would you require links?

I want to kill myself. What do 90% of libraries have the shittiest documentation ever?

Friendly reminder that you can report OT posts if such should appear.
Because it's boring to write. Tools like doxygen are great because they make it easy. But they don't help you with example code for instance.

I mostly program in languages discussed here but was researching some js-based web development recently and found
>The style attribute accepts a JavaScript object with camelCased properties rather than a CSS string.
in the React reference. So variable functionality is determined by whether they're camelCased? And it seems classes don't count as classes unless their name's first letter is capitalized. Here I was thinking just checking for a single certain character at the beginning or end was an efficient way to do such discrimination.
So this is Webdev, huh...

I think I am getting the hang of this dither matrix shit.

Senior full-stack, agile JavaScript developer
120k + equity

/prog/ I have a legit question for you
Are we ever going to get legit Ais like Net navis and PETs?

Or is it that complex still? There's some "team" working on an android app for it that's not capcom and they said that they have made a bit of headway with it showing it off on facebook and they have a discord. Just some 3D modeling and what not

I'm doing exercise 1-9 of K&R and my code doesn't work. Instead of printing out user input while deleting unnecessary whitespace, it prints out user input while deleting unnecessary whitespace AND the first letter of each word.
Could I get some help?
#include
int main()
{
int c;
while ((c = getchar()) != EOF)
{
if (c != ' ')
{
putchar(c);
}
if (c == ' ')
{
putchar(c);
while (c == ' ')
{
c = getchar();
}
}
}
}

You will never have a real general AI like that unless we discover a new branch of AI or find some new way of combining different AI branches

The last iteration of your inner loop calls
c = getchar()
but the value is overwritten by the outer loop's
c = getchar()

Sorry but I don't really understand why that changes the output to remove the first non-whitespace character of every word.
The else instruction hasn't been introduced in the book yet so I've also assumed that I can make this work without using it.

I want to practice multithreading. What are some simple programs I can develop that make proper use of multiple threads. Ideally I would like to be able to encounter problems such as race conditions and deadlocking.

So even without that, think netbattling might ever be a thing?

Step through your program with a debugger and it will get clearer

When it reads the last whitespace, getchar() is called twice, thus swallowing the first character of each word

Yeah, I'll use a debugger. But I think I understand now. Thanks a bunch user.

Wouldn't that just be a game then?

#include
int main()
{
int c;
while ((c = getchar()) != EOF)
{
if (c != ' ')
{
putchar(c);
}
}
}
You want to not print ' ' if I understand correctly, right? What are you trying to do in the if (c == ' ')?

The program should take an inputted string and print out the same string but by removing consecutive whitespaces, so
"The quick brown fox"
should become
"The quick brown fox"
It shouldn't delete all whitespace. I'll try to find the solution myself now that I know where the problem is though.

Yeah but I wanna use like physical chips to insert and what not
I guess something similar to how Megaman starforce worked for that one.

Oh I see. I can give you a solution if you want, or a hint, or try to solve it yourself.

Thanks but I'll try doing it alone for now.