/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

github.com/donnemartin/system-design-primer/blob/master/solutions/system_design/pastebin/README.md
en.wikipedia.org/wiki/Ceteris_paribus
twitter.com/NSFWRedditVideo

Putting Python or JS or Go on your resume will count against you at some companies

fun statement to make with no evidence or context. can i try?

some companies won't hire you if you use a windows computer.

Where do these numbers come from? Why do we need 4 byes to store a number of minutes? Why is paste path 255 bytes? For reference, the context is building a pastebin clone github.com/donnemartin/system-design-primer/blob/master/solutions/system_design/pastebin/README.md

Also true

I wouldn't hire someone that only knows how to use wooden tools in order to build steel houses either.

yeah absolutely.

also if you say GNU a certain way, you're less likely to get hired at some places.

because the programmer decided that way?

think your idea is better?

build yours.

that's not a logically equivalent statement.

fuck you kid

4 bytes = 32bit int
255 bytes = long-enough path for their needs, byte per ASCII char; can address indexes with a single byte value too though I doubt they use that

>What are you working on, Sup Forums?
The same thing I was working on 2 days ago, my Emacs sadpanda client.

>wooden tools

>at some companies
Putting C or C++ will as well.
[spoiler]But if they do, you don't want a job there[/spoiler]

don't, it's not worth it in the slightest.

lmao fuck off retard

>if they do, you don't want a job there
basically this. the statement "there exists a company where X" will always be true because there are tons of crazy companies out there with people in charge who are either retarded or mentally unhinged or both. you don't want to work at a company where mentioning a skill gets you blackballed unless the skill is something like "i can be really quiet walking behind people" or something else disturbing and weird.

if all you know is python and js, then duh you won't get hired at tons of companies. that's not salacious, though. that's literally just saying "if you have a limited skillset, your opportunities will be limited".

How can i achieve dithering from a pre-existing image such as in OP's picture?

JS hurts your chances at getting an interview with my company just because we get so many frontend devs applying to a backend position.

>why
It's arbitrarily chosen.

thanks

so you're saying that, *all else being equal*, someone with js on their resume loses to someone without it?

do you honestly not see how deranged that is?

What about someone who applies and their only listed experience is with Coq?

>timestamps out of order
UM WHAT THE FUCK

>What about someone who applies and their only listed experience is with Coq?
They should do porn, I mean, the logo says it all.

>Emacs sadpanda client

"All else being equal" we'd probably phone screen both of them if they were worth it. My manager just says he kinda grimaces whenever he sees JS on a resume because he knows that the phone screen is going to be rough, and that might influence his attitude towards the initial phone interview.

the fuck

What about someone with Java, Scala, and a little bit of JS?

We'd be fine with that, especially if they listed any experience with an ORM.

What about someone with C# and F# experience, who turned up to the interview wearing a Microsoft baseball cap?

>do you honestly not see how deranged that is?
Personally, I would never hire anyone who claimed experience with an OOP language, because it immediately tells me that they're suffering from brain damage and mental abuse.

>What about someone with C# and F# experience, who turned up to the interview wearing a Microsoft baseball cap?
You will get a job, but by the time you reach 40 years old, you'll with you didn't.

Why is the good night left side guy wearing an antifa nigger bandana?

Good thing you'll never be a hiring manager.

Are they wearing a suit? If so, does it match the hat?

blasphemy

>you'll with you didn't.
wish
>nigger bandana
It's a stahlhelm, you filthy nigger

>Good thing you'll never be a hiring manager.
I am a hiring manager. Sucks for your cult.

>Are they wearing a suit?
Yes. The tie is adorned with little Windows logos
>If so, does it match the hat?
Yes, both are navy

>>nigger bandana
>It's a stahlhelm, you filthy nigger
supposed to quote

>"All else being equal" we'd probably phone screen both of them if they were worth it.
no, you're not understanding the question i'm asking. if you could only interview one person, which applicant would get the interview?

if the answer is that the person without javascript on their resume would get the interview, your boss is selecting for incompetence. it's like natural selection in the wrong direction. if you're not surrounded by dodo birds and shit, you will be.

GUYS STOP TALKING ABOUT WHATEVER DUMB SHIT WAS GOING ON BEFORE. WE NEED TO ADDRESS TIME TRAVEL NOW.

permute :: [a] -> [[a]]
permute [] = [[]]
permute xs = [(x : ps) | i

what constitutes "mental abuse"? like you're saying someone has emotionally abused them?

this sounds like one of those times that someone just picked a few salient-sounding words from a hat, but in context it doesn't make any sense. if you think someone is less competent because they happen to have experience with one paradigm or another, that's fine (i mean, it's clearly stupid, but whatever). don't try to get fancy with your insults, though. you're clearly out of your depth.

if you could only interview one person, which applicant would get the interview?

if the answer is that the person without Gender Studies on their resume would get the interview, your boss is selecting for incompetence. it's like natural selection in the wrong direction. if you're not surrounded by dodo birds and shit, you will be.

Having "additional experience" with something is not always a good indicator.

fp is a fad

test post

faggot

Modern "men" are also taking estrogen pills.

does the job requires JS or in any way connected to web dev? then my answer is still no. that person is applying a non webdev job but not trusting his own skills so he had to put JS

A theoretical situation that two person has exact some skills but one also knows JS does not apply to real world. web dev is quite different than software development, so those skills does not really apply.

this what the fuck happened

No I mean the guy on the right panel with the "good night left side" sweater and antifa nigger bandana

I'm not sure I can answer this well without giving up too much. I don't know how much you know, a big problem.
So here's a textual description of a simple start:
Make a char 'data' pointer, a 'size' variable and a 'cursor' variable.
Initialize the pointer using data=new char[size].
Then write an 'add' function that takes a pointer to the data pointer, a pointer to the cursor, a pointer to the size and the value you wish to add to the vector. The cursor is incremented as you add the valuesThe add function checks if pointer+cursor==pointer+size.
If true you allocate a new array (call it 'temp') double the size, copy all the existing data for(int i=0;i

Hello I am trying to learn c++ and the book wants me to right a program that asks the user the height of an object and it print out the objects height as it falls down.

this is my code:
#include
#include "test.h"
int main()
{
std::cout

>Having "additional experience" with something is not always a good indicator.
i'm not convinced that any programming language is so negatively perceived that it would be a detractor on someone's resume. even the mention of PHP would add something to someone's resume.

if that person's experience was substantively based on PHP (or javascript or whatever thing you have misgivings about), i could understand, but if you have two equivalent candidates and one mentions javascript on an inline list of the languages they have experience with, then i can't see the rationale for elevating the other person.

again, all else being equal.

>what constitutes "mental abuse"?
Being told you have to master OOP. Then, when you recoil in disgust, being told that you will never get a job unless you finish all of these OOP exercises and learn to think in OOP terms; being bashed repeatedly over the head with OO "design" books, having your mind and your soul effectively raped by OOP while your entire future is being constantly threatened in the case of non-compliance, until finally you break; you cave in under the pressure and Stockholm syndrome starts to set in, and you start to like mental rape; you start advocating for mental rape. You demand that everyone else must endure what you've endured, because you think it has made you a better person. OOP is a crime. OOP cult leaders need to be arrested. You are an awful person.

>"good night left side" sweater and antifa nigger bandana
???

what the hell are you talking about

> while (h > 0);
check this line

all else being equal, the person with javascript experience appears to have exactly the same qualifications and experience as the person without js experience. the resultant material difference, then, is that the person with js experience is more familiar with concepts favored in javascript.

this is why it's useful to signal things like haskell or other declarative, functional languages even if the job doesn't involve haskell. because the perspective they bring to the table is broader than that of someone who doesn't have that exposure.

it honestly sounds like you've been emotionally abused.

FUCKING ; BULLSHIT FUCKING FUCK FUCK

Do I really actually have to spell it out for you?

It honestly sounds like you are a typical OOP advocate of rape and torture. I'm reporting you.

I'm trying to break the cycle. I don't want my team to suffer through OO like I did. I don't want them to waste years of their lives like I did. It's difficult fighting against the tide, though. They often worry about applicability of other paradigms at other companies, and who can blame them? People move jobs frequently, it's by far the most reliable way to get salary increases in our field.

>Do I really actually have to spell it out for you?
Yes, didn't see that one.
Brb, photoshop improvements incoming.

Most new programmers do that, and it is kinda hard to notice.

You should probably learn to use a debugger. Such mistakes are quite easy to figure out with a debugger

How would I go about using a debugger? Is it a command line tool I can download? I'm using arch

>all else being equal, the person with javascript experience appears to have exactly the same qualifications and experience as the person without js experience
you don't know everything about candidates. if everything looks same, pick the one that is more specialized. why this is a problem for you?

Daily reminder that if you haven't shoved objects of at least 40,000 different classes up your rectum, you have not mastered object-oriented programming yet.

You have gdb for that, there are problem some tools with a gui too.

If you are not being forced to develop on linux, just go for windows and visual studio

you're not understanding what "all else being equal" means. it's a colloquial version of "ceteris paribus", a term that's fairly widely used.

en.wikipedia.org/wiki/Ceteris_paribus

the point of using this term is that you don't reasonably hand-waive the discussion away by saying "well there's probably something else that's not equal". the whole point is to nail down that factor to avoid weaseling out of a straightforward dilemma.

He's talking to me.
Unfortunately it feels like very little.
But hmm ok, so, just to see if I understand, it's a function outside of main that takes 4 parameters and adds values to the array. The cursor increments by 1 and indicates the position in the array, and when it is equal to the size, it allocates a new array, copies the data over, deletes the old data and then "recreates" the old array with double the size?
How is the new old array accessed outside of the 'add' function? since it would initially be passed in with the size 'size', can the function change the array size or just add values to it?

I kind of want to learn it on loonix. I don't like visual studio although I was using qt creator at the start. I thought it would be a good idea to learn without an ide.

I'll try gdb though and thank you!

Say, user... why would a rational and mentally sound person have experience in javascript, and why would a person that has experience in javascript still be rational and mentally sound? You're not being reasonable in this discussion. I think you have some disclosures to make.

I don't understand the reason for such hypothetical situation. I am talking about real world scenarios here and even then "two candidates, looks exactly same but one knows JS" is stretching it. It just does not exist.

Answer for your hypothetical question, If I know two persons entire personality, knowledge and capabilities, and if I compare them the only difference is one knows JS. Yes.

In a real world, which I am not a god, I would go for the other one

Some skills can have negative utility for some jobs. Why is this so hard for you to understand?

>How is the new old array accessed outside of the 'add' function?
New old array? The new old array (the array that was passed in when we exceeded the size) would be deallocated. We pass in a pointer to the pointer pointing to the data. A char**. That way we can change what the original pointer is pointing to.

Sorry user. I'm probably not the best at explaining. I'll just give you some C++.

>Some skills can have negative utility for some jobs.
You mean like being such an exquisite internet shitposter?

Was thinking of making a sudoku solver. Would this be something easy to do?

Commit sudoku.

like
>haskell/functional
it only takes one word to throw a CV into thrash

Oh, I meant the new array that data would point to. It looks like we create temp, copy everything from 'data' which was passed in, delete 'data', and then recreate 'data' with double the size

Yes, you can easily brute force it.

And there we have it.

Perhaps you should have learned better programming languages.

Yeah you got the idea i think. Maybe you should go and try to write it yourself instead.

to understand anti-patterns from experience.

this notion that experience and knowledge of things is bad is like the weirdest form of luddite culture i've ever encountered.

if someone makes the wrong (or, more precisely, a logically indefensible) decision in a thought experiment such as this, then it suggests that their internal mechanism for determining fitness for a job is itself broken. in general, perhaps they hire the right candidates because the decisions are obvious, but it strongly suggests that *at the margins* they're prone to making the wrong choices.

What about a method that doesn't use brute force?

That's okay. Nobody wants to work in a company of mentally abused children like you, so you're doing real programmers a favor.

I don't know, never tried it. I don't think there are other ways to do it. You can optimize your brute force but it is still brute force.

>experience and knowledge
You're conflating two different things. It's good to have knowledge about the dangers and horrors of the world. It's bad to have "experiences" that intellectually incapacitate you and leave deep emotional scars. I'm very sorry about what you've been through. I wish I could help you somehow.

Is neovim some FOTM bullshit or should i actually be using it?

seriously, the way you talk about experience with programming languages sounds more like a rape victim than a well-adjusted person's takeaway from js or other oop languages. they have their problems, but you're being melodramatic.

if anyone talked to me about a programming language like this, i'd be worried he was too emotionally erratic. this isn't how rational people talk about programming languages.

there's plenty of techniques to solve a sudoku, certain patterns, but it always ends up in just limitating the scope of possible numbers you can put in a square

It is just I don't like people that writes code for an alien architecture. they are underperformant crippled languages that only hinders programmers.

Really? That poster sounds like a great hire to me.

That was the idea I had in mind. Seems like a cool little thing to do.

For general Sudoku you need recursive backtracking because you can't always logically deduce the solution. You need to try different possibilities.

However, easy and medium puzzles can usually be solved with constraint propagation alone. Use the rules of the game to fill out squares with only one possibility. Repeat until the puzzle is solved.

Ah, I see. You're kinda like those child rape victims who try to minimize their traumatic experience or even glorify their rapists because it helps them cope. I'm so sorry, user... are you receiving adequate emotional support? Have you considered going to a professional programming consultant?

Ok thanks, I think I mostly have it too. The only thing I don't get is how to access 'data' with double size outside of the function. Don't we have to give it an initial size before passing it, and wouldn't that initial size stop us from passing anything more than that into it?

Incidentally, I've been playing around with just using some for loops, and I think I may have gotten it that way. With an if statement that checks for the end of the file, and an else that I think does what the 'add' function would do