/dpt/ - Daily Programming Thread

What are you working on?
Previous:

Attached: 1526044766394.png (1920x2160, 3.54M)

Other urls found in this thread:

twitter.com/JeffDean
smallcultfollowing.com/babysteps/blog/2016/11/04/associated-type-constructors-part-3-what-higher-kinded-types-might-look-like/
internals.rust-lang.org/t/pi-types-v2/4860
github.com/rust-lang/rfcs/issues/1930
twitter.com/SFWRedditVideos

I'm trying to wrap my head around the low level tensorflow APIs.

Are there any better libraries for putting together neural networks? I need one for a project.

I don't get your pic.

x thing kills y then blames z

I don't either. Can't remember the last time I got a segfault or similar from C++ code.

c++ has all the tools to do safe memory management. it's not the language's fault that people are too stupid to do it correctly.

sorry for double post i posted in last thread.

can someone please tell me what is the next step after learning variables,
loops, pointers, strings, arrays, structures, functions, file and streams in C?

Maybe you only write trivial C++

When looking for jobs, do you often choose companies because of the name they have in the industry?

Or is it OK to choose a company no one has ever heard of?

Attached: 1526065943698s.jpg (250x202, 6K)

I prefer good names because I work to make my CV look good.

>c++ has all the tools to do safe memory management.
you don't actually believe this do you?
But for the sake of argument, those tools come with a billion asterisks.

Told the one who failed to understand that the only danger of C++ is to borrow something outside it's scope (not very dangerous), so yes C++ is very memory safe.

Larger companies give you larger scale problems to work on.

>c++ has all the tools to do safe memory management
C++ also has all the tools to do totally unsafe memory management. IT HAS ALL THE TOOLS EVER! That's what's wrong with C++

Why do OOPfags feel like they're entitled to reply to FPfags with any attitude other than deference? Why do they pretend they are on the same ground or that they are within the same league in terms of intelligence, knowledge, experience, taste, etc?

What package do I use to scrape console output of a url for python? thanks lul

It's the other way around actually.

It just lack a strong borrow semantics.

Why do FPfags think they are relevant or the least bit useful?

scrapy?

When I was job hunting, I went pretty much exclusively for little no-name companies. I'd rather have an office, intelligent coworkers, and a significant role in a company than be working out of a cubicle surrounded by idiots and be completely replaceable like everyone at a large company is.

Possibly, but unlikely

Attached: Screen Shot 2018-05-11 at 6.00.56 PM.png (1618x1644, 581K)

I'm trying to scrape the console output of the webpage, not the html

That is one disgusting prion..

>sepples fag tries to learn FP
>gets frustrated
>WELL IT'S SHIT ANYWAY AND IRRELEVANT, AND IT HAS NO JOBS SO WHO CARES
Then when an FP discussion happen they get further upset because they can't join in, so they shitpost.

based Joseph

probably all the langs adopting FP features

No, large companies give you a tiny and isolated segment of a large scale problem while a hundred other people do the rest of it without ever talking to you.

"console output" what do you mean by this?

Without any other context the requests lib / beautifulsoup is pretty damn good place to start.

You mean the output of the javascript console? Good fucking luck. You'll need an entire headless browser involved in that.

I mean the web browser console output (when you press f12). It's already outputting the array that I need, I just need to grab it, so no html parsing is required

Wait until FP becomes mainstream, and it will be the other way around.
Maybe FP will save OOP afterall..

ok so selenium + webdriver.io

Attached: readingseriously.jpg (209x383, 34K)

>Disseminating large scale problems

Good thing programmers don't know how to do that.

FP has a lot of OOP aspects to it though, only vastly improved.

actually this
cpp is just a bunch of non-features that people like to use because "obviously better than c"

To all the people responding to my low iq whining.

Thank you. I've been reading and learning and trying fampais

We're all going to make it

>Good thing programmers don't know how to do that.
Wrong.

There are several posts about how people at Google, some of the smartest engineers in the world, may work on a button for months and get really no job satisfaction from what they do.

I think most of the posts were on quora but I don't care to track them down, the general gist of most was google hoards talent so other companies can't have it then does very little with them.

Which makes all FP only languages redundant (aka changes nothing)

The WWE does that.

I know it's low iq but they take all of the best indie talents and doesn't do anything just so others don't get them

Right, FP was correct about all these features it's just all the other stuff it's wrong on. Except in 10 years we'll accept a bit more of it, then a bit more.

>people at Google, some of the smartest engineers in the world
Ha

twitter.com/JeffDean

And OOP has some FP aspect to it too.
Only zealots think that both paradigms are mutually exclusive.

this

You don't seem to understand. What you said about OOP langs implementing FP features is correct but the result is not what you expect it to be. Devs will look at it and say "oh, cool! now this will reduce boilerplate when using {insert OOP lang}".
It is no longer an old meme paradigm. It is a feature.

>And OOP has some FP aspect to it too
The difference is OOP is shit, while FP is the future.

everyone irl and online calls me a bitch..idk..I should stop but it makes more likeable online I think idk..

I work 40+hours at factory and am fit and older you just gotta do it I guess..

Attached: 1526048615850.jpg (1280x720, 131K)

>this exceptional case proves the rule

Ha

No, tensorflow is the best. Can you use nntool on MATLAB it is it a coding assignment? Because I’ve had some good results with that.
If you’re really having an awful time with the c++ wrapper, save the headache and use native python.

>everyone irl and online calls me a bitch
maybe stop posting animu pictures

if you are acting like a bitch then stop, if not then don't worry about it, but try to be less whiny.

I can't lets invert the statement, why wouldn't the best engineers in the world work at Google? Literally the only reason is job fulfillment which sort of proves my initial statement.

I'm using python. I'm a bit of a brainlet though so I'm having trouble getting my head around how it all works.

Anecdotal, but the top couple of people in my class ended up going to google for the money, and my friend keeps calling me and complaining about it, which makes me fucking mad because I'm too dumb to get in and he's making bank.

Attached: 1500675343464.jpg (1107x722, 60K)

>why wouldn't the best engineers in the world work at Google?

Maybe because google has a toxic culture?
remember the James Damore case?

There are so much better companies out there better than google.... you have no idea.

>OOP: class to define a type with inheritance and whatnot used to create an object of that type
>FP: typeclass used as a type constructor function!!! It creates a type but not an object!! You are making a fucking type you git it??? not a fucking object!! REEEE
WOOW user

>FP: typeclass used as a type constructor function!!! It creates a type but not an object!!
What the fuck are you talking about?

>thinking type classes are the same thing as POO classes
ranjev pls

i only act this way cuz im dumb..and low iq..i should stop tho i guess idk..idek how to start programming...reading sicp badly but it represents LISP idk..
I just wannt make mods to final fantasy 7 and retro ones..idk I also want a skill and to make friends

Attached: 231.jpg (518x710, 87K)

That looks nice, what theme?

I am in fact aware of that case, and I do agree that the culture is toxic but so is any company lets say with > 1k employees there basically infiltrated with sjw ideology no way around it.

Also I don't think your arguing in good faith and I think you understand my initial point but thats ok.

Exactly. I've seen devs trying to replace all their raw pointers with unique_ptrs because that's what all the hot sepples kid do, yet still using vector to store them and pass references to them all around. Obviously, when the vector was reallocated, hilarity ensued.

>when the vector was reallocated, hilarity ensued
What does happen exactly?

operatpr[] returns a reference in std::vector
reallocating might invalidate the reference.

>when the vector was reallocated, hilarity ensued
Why? The vector reallocation should trigger the unique_ptrs' move constructors and be fine.

If I have a vector v

is v[0].get () constant, even if the vector reallocate)? (Except if I change it myself).

References to elements of a vector become invalidated when a vector is resized. So dereferencing them is obviously undefined behavior after reallocation. Use list or deque if you don't want to get bitten in that case.

>is v[0].get () constant, even if the vector reallocate)?
Yes

I am not referencing the first element of the vector, ie I don't store &v[0]. I'm talking about storing v[0].get ()

So there is no problem? Like said.

>vector or unique ptrs
lel, C++ is reinventing java

Stroustrup pls

java reinvented RAII

Goddamn, Sepplefags can't read.

I talked about REFERENCES to the elements of the vector. They were stored inside other objects and invalidated as soon as the vector was resized.

how is vscode for c++ contra codeblocks?

You have C++, you use CMake, you have some external library dependencies. Where to put them?
>1. Don't put them on repo. Leave a txt indicating the dependencies you need.
>2. Like 1, but with CMake, so it will give an error when trying to generate build files if you don't have the dependencies. Dependencies should be installed with system package manager.
>3a. Compile libs and put binaries on repo.
>3b. Put libs source on "external" folder of repo and use CMake to compile them when building the project.
>4. Like 3 but on different repo.
>5. Use package manager like conan.

btw, where did Steve Klabnik go ?
Haven't seen him around for a while...

>I talked about REFERENCES to the elements of the vector.
So it was unrelated to unique_ptr? Could you reread your post , because you were implying that unique_ptr wasn't a good armor. But in fact your post was absolutely unrelated to unique_ptr.

>Where to put them?
git submodule. And then learn about external projects. Best option is to give up and just download the source into your project.

C++ does not have a standard build/dependency management mechanism and this will never be fixed.

look at find_package entries and then apt-get

Java fixed RAII

Point in case, unique_ptr doesn't prevent bad devs from being bad. Which makes it yet another failed attempt to control idiocy, despite the huge marketing around memory safety in Sepples.

>is v[0].get () constant, even if the vector reallocate)?
Yes, but v[0], which returns a reference to the unique pointer, isn't

My question implied that I already know that.

>java
>C++ without pointers
>enforced POO
>still slower than RAII equivalent in C++
>still fills memory like a street in india
>The GC still didn't collect itself
Also,
>Java
>fixing anything other than continuous security issues

Now that Rust got impl traits, what should rust focus on for user ergonomics? HKT? Rust kinda has Higher kinded polymorphism and Associative type constructors already. But HKT would be really nice.

Attached: 1525833700031.png (265x265, 104K)

You cannot avoid object orientation in C++
Of course it's slower due to their bytecode abstraction, no one said it's faster.

Does it have full dependent types?

One of the Rust devs has highlighted their approach to HKT and their plans for it
smallcultfollowing.com/babysteps/blog/2016/11/04/associated-type-constructors-part-3-what-higher-kinded-types-might-look-like/
Rust kinda has support for Pi types but they are working on it too.
internals.rust-lang.org/t/pi-types-v2/4860
github.com/rust-lang/rfcs/issues/1930

How does a GUI framework decide to be GPU intensive or CPU intensive? I want to use a nice API that looks beautiful but utilizes the maximum of the GPU but doesn't thrash CPU

of course you could. just program using a huge number of functions and plain-old-data structures with no members functions and all-public data.
you shouldn't.
but you could

not feasible

>gui framework
>even having to worry about being bloated
the
absolute
state

what do these numbers signify in json, and why can't python parse this?

Attached: file.png (524x260, 17K)

These are integers in an array, most likely placeholders to simulate some sort of index in the array. But from a JSON point of view, they're only elements of the array.

It's just a value in a json array, which don't all have to be the same type.

Enumerable.Range(1,100).Select(
x => (x%3, x%5) switch {
(0, 0) => "FizzBuzz",
(_, 0) => "Fizz",
(0, _) => "Buzz",
_ => x.ToString()
}
);

>switch keyword, not match
>curlybraces instead of parens
>fat arrow

Attached: 1508580766113.gif (675x380, 2.99M)

>ToString
absolute GARBAGE

Ah, you caught the sarcasm. Point is only dirty pajeets need problems broken down that far.

Nice trips tho.

what language is this?

C-shart