/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

canbike.org/information-technology/yahoo-finance-url-download-to-a-csv-file.html
youtube.com/watch?v=eGaKZBr0ga4
twitter.com/SFWRedditVideos

Welp, I pretty recently found out that Windows doesn't support fmemopen.

Now I have to learn how the fuck Resources work.

I've fixed the side effect problem:
val result = Task.traverse(args)(Rss.task(client, _)).unsafeRun
result collect { case Left(NonFatal(e)) => e } foreach (_.printStackTrace)
val files = (result
collect { case Right(root) => root }
flatMap (Rss.files)
filter (!_.exists)
distinct)
(Task.traverse(files)(_.task(client)).unsafeRun
collect { case Left(NonFatal(e)) => e }
foreach (_.printStackTrace))

>What are you working on, Sup Forums?

homework.

Video Game on the "Oregon Trail" franchise, solo.

Redpill me on tensorflow and neural networks in general, are they a giant meme? or are they useful?

>What are you working on?
Code monkey level Java/JS/CSS/HTML work. Hey, it's a living.
Being able to sustain yourself while still in college sure is some accomplishment, isn't it?
Anyway, how do I make coding anything in JavaScript bearable?

haskell!

I've recently started using typescript. Its really nice (for javascript), except it forces you to use the full array of javascript tooling: npn, webpack and the rest

Even shallow properly trained neural network outperforms everything else we've got on handwriting recognition and similar tasks.
They are a meme in the sense that specializing in NNs is like specializing in building rooftops only.

good job lad
>how do I make coding anything in JavaScript bearable?
thoroughly learning it uronically helps (not just """good""" parts). using linter, prettifier, modern versions all that jazz. es7 is pretty neat all around, especially compared to monstrosities of the past

also: typescript, elm, etc. choose your poison

What meme language is this?

Scala

The program now runs in ~3s instead of ~17s by implementing parallelism.
o(^▽^)o

Daily reminder to never, ever read HtDP. You'll waste your time.

Stick with SICP.

Thanks, user.

what kind of stuff can i program in forth?

Why though
Sicp can be bretty overwhelming for complete beginners

Anything :)

SICP doesn't require an extraordinary degree of mathematical aptitude. It mentions things like integrals in the examples and exercises, but most of what you need to know for them is explained in the text. The book was intended for a freshman introductory-level university course after all. If you have a decent high school math background, you should be adequately prepared. That said, if you didn't enjoy math, there's a good chance you won't like SICP either. Bt, then again, if you don't like math, why are you interested in computer science anyway?

Never read HTDP. It's trash.

Why is it that so many people taking CS don't want to deal with anything math related?

if they could understand math, they wouldn't be wasting their lives in CS

It's not too bad with math. Most CS students I know are completely hopeless with anything physics related, though.

CS pays much better.

>CS pays much better.
Not really. Event the most shit tier job for mathematicians or physicists (analyst) is already pretty good compared to most CS jobs. If you get into research or higher positions in organizations (more common than you may think) it becomes even better.

I'm having trouble trying to create four child processes for the same father, all of them with different ID's. I just can't understand how does wait works.

#include
#include
#include
#include
#include

int main()
{
int pid,i,x;
//int status;
pid=fork();
switch (pid)
{
case -1:
printf("\n Error ");
exit(1);
break;
case 0:
for (i=0;i

Damn, seems I chose the wrong major. Should've gone for the comfy math degree instead of wasting 5 years with CS sperglords.
Heard that they actually have girls over at the math department.

Is lisp good language to learn?

yes

Indeed, and some are pretty cute (even smart). The degree is actually a challenge and it's not full of retarded geeks who dedicate their lifes to playing vidya. The only downside is some degree of tech illiteracy, but that gives you bonus points for the math/programming combo everyone is looking for.

you didn't

if you don't have a legitimate 145+ IQ, you will not cut it in pure maths, not even joking. Good luck doing research. It is a complete noob trap. Jobs are good, but they go to the top 0.5%.

I don't seem to understand.
What do?

install gentoo

I always wonder what my IQ is after seeing these posts. Pure math was hard, yes, but I dont think I'm particularly high IQ and I passed it fine. ps CS really does make you more money

Learn Haskell.
300k starting.

You don't need to be a genius to get a math degree and have a good job, just enough work. Oh, and who said pure maths was the way to go? Applied is where all the money is, although pure maths are way more interesting.

So why all the hate for OOP?
Genuinely curious.

>applied maths
forgot about this thanks to being on /sci/ for too long

Yeah, this is much more reliable

>freshman introductory-level university course
yeah
in one of the best universities in the world no less

>implying you have an IQ above 95, let alone 145, to tell us all about how it really is

OOP is too mainstream, we /dpt/ hipsters don't like it

Because it's shit.

Abused and misused by code monkeys (pajeets and freshmen) at big companies in big projects. It has serious flaws in its major implementations too.

Productivity triggers the NEET.

It's hip to hate on everything popular.

Working on a stock ticker program that gets live Internet data in >QT using >OOP

>how do I make coding anything in JavaScript bearable?
TypeScript

I got a 2.9 in Berkeley pure maths before switching my major to Chem in my 3rd year. This was with a 132 IQ (WAIS-IV measured)

Where do you pull the data from?

now implement a cool graph

From Yahoo Finance
The program downloads and parses CSV files

See: canbike.org/information-technology/yahoo-finance-url-download-to-a-csv-file.html

Is that real time or 'real time'?

OOP is fine, as long as it's an opt-in. Forced OOP languages are cancer.

They're as real as it gets

>171.26 %
I messed up there

wrong, languages should attempt to maintain paradigmic purity

Except there is no good paradigm out there, so the best solution is to cherry-pick the good parts out of multiple.

the result is a language like javascript, steeples or scala

On the other side of the spectrum we have Java and Haskell.

C++ would be fine if someone cleaned it up and got rid of all the bloat.
>inb4 rust

>there is no perfect car, therefore i will scrap a bunch of osme acceptable and some terrible cars and combine the junk together with duct tape
>the resulting car will be perfect

I have a PhD in Pure Mathematics and Mathematical Statistics from MIT and an estimated IQ of 187 and I just wanted to point out that everything you said is flat-out wrong.

And Java is awful because of OOP, while Haskell is good because of FP.

i need to learn C++ in 3 days for my summer session final

i've only done a third of the assignments (all are due also in 3 days)

how fucked am I

the two best languages out there

>there is no perfect car
At least there is perfect cdr.

Obvious bait.

I have a high school diploma and an estimated IQ of 1337 and I just wanted to point out that everything you said is pretty ok.

>OOP
>productivity
We can exchange anecdotes and counter-anecdotes all day long, but is there any actual evidence that OOP is in any way, shape or form better than plain old procedural programming? I've yet to see any.

...

It depends. How basic is the course? Do you have prior programming experience?

>>there is no perfect car
>>the resulting car will be perfect
You contradict yourself.

>Mathematical Statistics
brainlet

I think your screenshooter is malfunctioning. It replaced "Procedural" with "Functional" for some reason.

Most large "plain old procedural" style projects end up emulating some sort of OOP

>i-i-i got a 2.9 in berkeley pure maths
>doesn't know that mathematical statistics is an actual field
That's why I always believe it when people boast their credentials on the internet.

You're a fucking idiot, obviously the car is trash

That wouldn't even work. That would be PPBP and not FPBP

What did daddy just tell you about exchanging anecdotes, user?

>mathematical statistics
brainlet

All cars are trash, but some have good parts inside them.

what do you expect wait do do?
what do you expect that code to do?

Is there a porno based off of the SICP lectures, yet?

Speaking about paradigm purity. Smalltalk is cute, cute!

youtube.com/watch?v=eGaKZBr0ga4

Friendly reminder, that structs with methods, is the best kind of OOP.

No you fucking idiot, some cars are good but your junk amalgamation built in the scrapheap won't be

so do you buy 4 cars and build a disgusting frankenstein car out of their parts? no! the chassis of the camry isnt compatible with the engine of the lambo. any attempt to combine cars or language paradigms willy nilly will result in a horrible abomination

i know someone who went insane making their own fork of smalltalk

Friendly reminder that structs with function pointers are not "OOP". They're just structs with function pointers.

There is literally no reason to have "methods" with your structs

function pointer != method

Are you retarded? There's an endless number of reasons to have "methods" with your structs.

Why does C++ have nullptr, NULL, and 0 to refer to a null pointer?

Do C++ null pointers refer to something other than 0x0?

No, you take the good ideas from the design of other cars and create your own.

>function pointer != method
A method is just a function pointer in a vtable or embedded in the struct itself.

you mean like function pointers

an endless number of fictional and imaginary reasons that do not apply to the reality of programming

Agreed. I like the Go way.

func (t Type) MethodName() is the same as func Methodname(t Type). You can also turn methods in to functions and functions in to methods this way.

nullptr is the way to go
NULL and 0 are either old or too "primitive"

nullptr is just an instance of struct nullptr_t {}, which is trivially convertible to T* for any type T.

NULL is a relic from C, a plain old macro that expands to 0 or ((void*) 0).
0 does the same thing as nullptr but isn't as typesafe and doesn't do "the right thing" in overloads. It expresses intent like the NULL macro without being potentially misleading or unsafe, so the advice is just to do nullptr.

>NULL is old so it's bad

wow great argument guys

>muh unsubstantiated, subjective opinions matter
They don't, user. I don't know why your mommy never explained this to you.