/dpt/ - Daily Programming Thread

/dpt/ - Daily Programming Thread

car:

Attached: C_dpt.jpg (1280x720, 582K)

Other urls found in this thread:

pastebin.com/6zk9jMtf
youtube.com/watch?v=v8IQ-X2HkGE
hackalong.devpost.com/
twitter.com/NSFWRedditVideo

Bjarne Stroustrup is evil

learning profiling on linux (gprof, perf), what are some other tools and front-ends I could look at?

he is my sugar daddy

have Kernighan ever done anything significant? seems to be he was just "around" when things happened

>Want to code but the sound of my girlfriend filing her nails is making me shiver

fuck her while coding

I've come to get pretty good at small random challenges over the past couple years, I'm thinking a larger project might be cool to attempt. What's something not too intimidating to build in Python?

assuming you're married ofc

Attached: 1528699375904.png (537x537, 151K)

YE YE

Attached: 1513921989100.png (1920x1080, 302K)

>try to post pastebin.com/6zk9jMtf
>get pic related

Attached: ip ban.png (827x267, 15K)

class A {};
std::vector {A()};


Why is destructor called twice? It creates the temporary object, then emplaces a copy in the vector, then destroys both?

I don't want to let my sex life get in the way of coding.
I'm a poor student and we can't afford a wedding, much to her dismay.

the one inside the vector gets destroyed with the vector when it goes out of scope

this happens, usually its a spam filter thing though
i think it's anti XSS

How do I subtract every row from a 3x3 numpy matrix by every row in a 20x3 matrix? The different shapes are throwing me off.
>hard mode: must be vectorized

Attached: 1529452362219.jpg (389x324, 11K)

Can you word that better? It sounds like you're trying to do summation on two matrices with difference sizes.

I want to subtract every row (dim=3) of matrix A, from every row of matrix B (dim=3). The vertical dimensions have different lengths.

You need to go take a Linear Algebra class.

Attached: A sermon on safety.jpg (1144x1296, 392K)

Composing matrices using vectors is perfectly valid. Git gud noob.

BTW, the answer is A[:, None, :] - B

Good luck trying to explain real world non-trivial bugs

everything is fine

Hahahahahahahahbabahaha

Wow dude
def fibonacci1(n):
if n == 1 or n == 2:
return 1
return fibonacci1(n-1) + fibonacci1(n-2)

for i in range(1,10):
print(fibonacci1(n))

Got a CMake question.

I have a project that has multiple targets that are compiled to python modules (pybind11). Each target's sources and headers and shit resides in different directories under a project directory. There's a master project CMakeLists.txt that finds the required packages and handles options and whatnot, and CMakeLists.txt in each directory with build specifications for each target. The master buildscript uses add_subdirectory to load each project. My issue is that when cmake builds each target it builds in the directory with the sources and not the top level, which is annoying. And I can't use install() on targets out of the subdirectory in the top-level CMakeLists. Using install() in each target directory seems like a terrible idea. What do?

Is SICP good for learning how to program?

youtube.com/watch?v=v8IQ-X2HkGE

HRT and fursuits and BANNING OO will save programming.

roll

Why is Java legal?

>capeshit reference
dropped

okay java programmer

Yes.

How does it compare to HtDP?

no

Java is comfy and fast and makes business needs easy to solve, which makes me a lot of money

Common Lisp does everything better than Java. By the way, Java is definitely neither comfy nor fast (to write), and its abysmal type system makes it difficult to solve business needs reliably with it.

Does Lisp have an implementation of a multi-threaded incremental change optimization/constraint solver using late acceptance hill climbing? No? Then fuck off.

You can probably write your own in it in about two dozen lines.

Yeah sure buddy. Thatt's why Amazon,Netflix, Alibaba, Goldman Sachs, ... are all largely Common Lisp Shops and not Java Shops am I right?

Why is web development so much more difficult and complex than software.

>minimal styling restrictions and complexities
>responsive design is non existent
>single device design
>rarely need to delve into concepts like async
>security is almost trivial
>basic system architecture/design, things like mvc take 2 minutes to comprehend
>rarely need extensive use of a database layer

its almost a joke

Poor management decisions by people who worry about not being able to instantly replace developers on a whim. The one advantage Java has over Lisp is that there are far more Java developers than Lisp developers, so you really can hire an army of them if you want to.

Because software was designed and experimented with for several decades and web stuff was grown at an incredibly fast rate with people only being able to give only seconds worth of second glances at something before they pushed it to production.

>Poor management decisions by people who worry about not being able to instantly replace developers on a whim.
That sounds like sensible management to me.

Attached: hitler crab schnippen schnappen.jpg (450x449, 22K)

It's a great way to get a bunch of devs who don't give a fuck about the product because they know the moment they speak up about being told to do something stupid they'll be fired.

Programming is unskilled labor. All you do is type.
Why should you have a say in the design of the product? Leave that kind of thinking to the adults.

If you're running a large company people will come and go, there's no way around it. Job security and motivated programmers is a different problem.
There are many medium-sized companies that have one engineer, and that lone engineer has been doing everything for years his way, without proper documentation, and now he's irreplaceable, it's even difficult to get him help because everything's so fucked.
This is a super common issue to have. You should always be designing your company in a way that everyone can be replaced, including yourself.

def is_prime(x): #takes a number. example - 4
if x < 2: # is 4 smaller than 2?
return False # returns false if 4 is smaller than 2
else: #otherwise
for n in range (2,x-1): #for every number in the range of 2 to 4 minus 1 (3)
if x % n == 0: #if the remainder of 3 divided by 4 is equal to 0...
return False #return False
return True #returns true if....i dunno halp

halp?

Attached: 200.gif (328x200, 431K)

I know Java sucks dick
I know I'm retarded
I know Java sucks dick, again

How can I pass an ArrayList into a JTable row?

>tfw finally internet is up
I was... left in the dark. It was cold without you, /dpt/

Attached: 1525663184299.jpg (1083x720, 174K)

>I'm looking forward to it.
All I am is pain

I don't know what's going on but if your x % n == 0 it's gonna fall into the return False, but if that NEVER EVER happens, which means it looped through all 'n's it'll fall in the return True

Basically no value in your loop fulfilled the condition, so it returns true.

I just learned Java what other language should I invest in my time? I was thinking C

You can start from n ** n instead of n.

Idris

>I just learned Java
>Invest
lol

Yes, C is the way.

right, completely missed that thanks

use a linter

We missed you too user.
How was your internetless day?

I feel like I MIGHT give a fuck about Calculus if I actually used it in something computery.
Any ideas?

OP do you have the pic without all the bullshit on the top?

>graduated with a CS degree, no internships due to unchecked social anxiety and ADHD
>couldn't get a job for 2+ years due to above
>starting to get medicated and get my life back together
>haven't written a single program in over a year

What languages are hot for new hires these days? Gonna have to build a sizable portfolio to even be considered

jst 4 u bb

Attached: No bullshit on top.jpg (1280x720, 42K)

Idris

Swift will make recruiters wet
Golang tells people you drive a Honda and eat the same thing for lunch every day
C++ tells people you're a devil-may-care 10x code cowboy who will work yourself to death for your company, preferably by making video games
Python indicates that you actually write code

interesting vid

I want to do front-end shit with javascript, can I belong to /dpt/? /wdg/ is a fucking disgrace

I cannot understand regex. Should I stop learning programming because I am a brainlet?

yo user that was working on a memory editor, you around?
I need your GitHub link again

get back in and stay there

Or spend more than 5 minutes to learn it. Stop being lazy.

javascript

But I like you guys.

d-does anyone wanna join me on an online hackathon..? hackalong.devpost.com/

work on other basics, then come back to it

then learn a real language

No stop recommending meme books and leading people astray if you want to learn to program you have to write programs, sure you may need to start by learning a language here and there but it's most likely you won't finish it why you may ask , because you are not actively using any of the stuff you read , you can use SCIP when you have a grasp of programming and you want to either learn concepts you couldn't come up with or learn a better way to implement the concepts you previously acquired

I'll do anything for you, user~

Would you learn Agda?

Forget him learn Rust

Forget her learn Lisp

thanks lad

Forget him(er) and learn D

D is dead

More alive than L*sp

Lisp lives
D dies

I set up a basic http server in C, what should I make it do Jow Forums

that's a funny looking anime girl

Also, why aren't Kate and KDevelop talked about more? Kate does all the same shit as atom but uses a quarter of the memory. KDevelop takes some finagling to get it to work right but once it's up and running, shit's great.

Attached: tumblr_pbg3mbY6cu1xz9074o7_400.jpg (333x333, 27K)

Rewrite it to be an infinite generator or you should kill yourself. Imagine a Sieve of Eratosthenes but instead of marking all the multiples of a prime when you find one, just mark the next one,

and you lie

Calculus is mostly useless.

>Lisp

Attached: Screenshot from 2018-07-13 13-18-09.png (1488x782, 176K)

I don't get the recent atom shilling or the vs code shilling. both are inferior to emacs and vim. I guess it's because emacs and vim aren't proudly written in js with heart emoji

Do anything that requires thought and not just slamming compute power against a for loop.

I feel bad for whatever it is you do

you are fucking stupid

Serve http.
Also both are fucking dogshit is why.

Nobody competent uses atom because it chugs to open even moderately long text files.
People like VS code because it has loooots of good extensions and doesnt require any understanding of workflow or the editor itself. Just open, find extension, type type type.
Functionally VS code is actually pretty fucking excellent, and uses the least cancerous javascript at the least. Its just bloated and spyware.

you are fucking slow lmao

Python is such a shitty language. I work in it every day and I wish I didn't. C++17 has most of the features I want, but it's such an ugly and unintuitive language. Is there a language that has good support and isn't shit? Please don't say Java, it's somewhere between the shitiness of both.

>continuing to post the least meaningful graph type ever devised
The only significant data point to take away from this is "C is extremely fast, C++ is usually just as fast because its just C"

>Java AOT is last

Attached: BTBe1K5Ahh-2.png (300x250, 42K)