/dpt/ - Daily Programming Thread

Previously on /dpt/: What are you working on, Jow Forums?

Attached: dennis.png (723x522, 170K)

Other urls found in this thread:

wsj.com/articles/palantir-has-a-20-billion-valuation-and-a-pretty-big-problem-it-keeps-losing-money-1542042135
twitter.com/SFWRedditImages

You actually seem to have a problem with extrapolating implicits though.

fizzBuzz :: Int -> String
fizzBuzz i =
case (i `rem` 5, i `rem` 3) of
(0, 0) -> "FizzBuzz"
(_, 0) -> "Fizz"
(0, _) -> "Buzz"
_ -> show i

main :: IO ()
main = mapM_ (putStrLn . fizzBuzz) [1 .. 100]

Dennis died alone, sick, and poor though

I need to compare one 3D point to 1,000,000 other 3D points. 3D points refer to training data and can be classified as groups. Points p1..p283 might be classification 1, p284..p823 classification 2, etc. I want to find what classification the newest input falls in.

Is k-means clustering appropriate here? The data can be clustered into 50 contiguous regions. If the centroid is the mean of a cluster, can the distance calculation instead be done between input and centroids and still be accurate?

Can this be done to reduce the complexity from 1,000,000 comparisons to only 50 comparisons? Did I interpret k-means clustering right?

>f# ugly
>haskell beautiful

Attached: d27.png (645x729, 56K)

When adding a new data point I believe you just assign it based on the current centroids. Then update everything. The first go-around it will be assigned to the closest centroid anyway

test

whoops, not sure how your hand slipped all the way from the 8 key to the 3 key.

kill thou are selve

no u

Freshman year of HS:
>Algebra 2/Trig/Limits/Derivatives
Sophomore year:
>Linear Algebra
Junior year:
> Discrete Math
Senior year:
> Abstract Algebra

Calculus is useless and is making these kids brainlet NPCs.

How can you advocate for limits and derivatives then turn around and call calculus useless?

you should just let children pursue the fields and problems that interest them, and only teach them the math they need for those htinngs along the way.

besides that, all children need is basic arithmetic to function in society and handle their fincances

i dont get it

Attached: 1515119146828.jpg (542x537, 44K)

>weeb
>doesn't get it

figures

install F*

>gives haskell a shot
>sees main = do
>nopes the fuck out

Attached: download.jpg (188x268, 9K)

i guess he's using some whacky keyboard where £ is actually #

sorry I don't know some obscure useless langs

SQL queries for homework in a college class.

Mathematical maturity™. But most of it is useless for most people.

...

Yeah, I suppose many people don't use beyond arithmetic. Add algebra in there and then the majority of people don't use beyond that.

Secondary schools should really start to let people differentiate into groups of classes and requirements. If STEM-bound people got proper preparation at a much younger age the average person entering the fields would be so much better off.

look at this fookin guy thinking he's tough shit

I fucking hate my job.
The people are shits, they treat me bad and have extremely unrealistic expectations of a guy who just graduated a few months ago.

Last week my supervisor revealed to me that I'd be the only employee who would stay at work for Christmas break because of the assignment he gave me. This stupid fucking nigger gave me the project the literally the week prior and it'll take to at least mid January to complete.

Barring quitting (which I've been thinking about doing, I'm being underpaid for an entry level position that was advertised as just being Java while also performing the same fucking duties my coworkers who make 20k-40k more than me perform), how do I tell my boss that I'm not going to take this shit? Or should I ask for gas compensation for the extra money the trip would require?

how do I create a multiplayer web text-based game? what technologies do I use?
I only know that I need a server

sounds like you got hired specifically to be a dumping ground for menial shit considering you're fresh grad.
i'd probably just quit.

What entry level software architecture/design/planning does Jow Forums recommend?

you want it to be in a browser or what?

web sockets for handling updates

Learning lambdas and streams on java...
This counts the number of occurrences of words in a text file
How would I also print the total number of words and total number of distinct words?
I'm guessing for total number of words you just add all the occurrences of each word to a total and for distinct words you just count the number of lines output but idk how to do it.

Attached: 2018-12-10 23_04_21-_new 1 - Notepad++.png (1001x370, 20K)

>they treat me bad
they beat you?

just say that you found a better offer somewhere else and if he doesn't give you a pay bump, you quit.

Or, just finish the project he assigned to you the fastest way possible and in the mean time start looking at other jobs and when he asks if you have done the project, you quit. Or fill that shit with lots of bugs or something

yes.
what I have in mind is multiple people accessing the same website and they communicate with each other under certain rules. I can do everything through text.

>for distinct words you just count the number of lines output but idk how to do it
idk what you mean by this but you could just use a data structure that disallows duplicates, such as a set. Then you get the size of the set.

I mean that code I didnt write and dont understand just copy pasted shows lines as a result.
the total number of these lines would be the number of distinct words.
Here's a sample output

Attached: 2018-12-10 23_09_55-Window.png (1882x241, 7K)

>Or fill that shit with lots of bugs or something
Doing the job as expediently as possible guarantees a ton of bugs

CAN

YOU

FUCKING

FAGGOTS

STOP

CREATING

NEW

THREADS

EVERY

12

FUCKING

HOURS

FFS

ITS

CALLED


A


DAILY

THREAD


NOT

A


12

HOUR

THREAD


KILL


YOURSELVES

#include
int fizz(int n){printf(n%15==0?"FizzBuzz\n":n%3==0?"Fizz\n":n%5==0?"Buzz\n":"%d\n",n);return n+1

Integration is useless. Limits/Derivatives are the only semi-useful things to know.

This is a Saturnian thread

>threads stop bumping at 335 or whatever
>"ya m8 lets have dpt die in the mid afternoon and not have another one until the next day"

neck yourself fag

Integration is pretty cool actually

Attached: 1477409794942.jpg (540x624, 167K)

I would not hire you if you wrote that hideous shit in front of me.

also we should clearly BRING BACK /PROG/ (but with images)

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

who would want to work for you anyway

cause i get max job security through code obscurity :^)
lick my balls

For physicists and engineers. Everybody else, not so much.

/dpt/ hasn't been daily in years. We need a new /prog/ board.

I hire at Google, so a lot of people.

infinity chan has one thread like this per year

Good for them, but this is 4channel.

>2018
>wanting to work for Google
lmfao
almost had me
Even palantir might be better

just goes to show how much cooler /dpt/ is

Is it beneficial for someone to learn BASIC these days?

t. a newfag to programming

Attached: BASIC.png (960x600, 175K)

>palantir
wsj.com/articles/palantir-has-a-20-billion-valuation-and-a-pretty-big-problem-it-keeps-losing-money-1542042135

>see woman posing on snapchat
>approximate her curves with an equation
>use integration to determine the volume of her tits and ass
>evaluate whether she has a nice rack or is a fat ass only an ass fag could love

At the end where it prints out each element of the collection (I think that's what's being iterated over), as well as printing the value, couldn't your increment some counter?
I don't use Java streams so I wouldn't know how to do that, maybe some other user could help you

No. You shouldn't even know what BASIC is. This shows that you spend time reading shit you don't understand and isn't relevant to you instead of actually programming. You like the idea of being a programmer but don't want to put in the work. You will never make it.

No.

What is wrong with sql?
auto generated code from my ERD model doesn't fit into sql syntax
ALTER TABLE Areas ADD CONSTRAINT Areas_Transport
FOREIGN KEY (Transport_transport_id)
REFERENCES Transport (transport_id)
NOT DEFERRABLE
INITIALLY IMMEDIATE
;
> NOT DEFERRABLE
is giving me the error

So because I read shit on the side it means I'm incapable? Fuck off, brainlet

ALTER TABLE Areas ADD CONSTRAINT Areas_Transport
FOREIGN KEY (Transport_transport_id)
REFERENCES Transport (transport_id)
NOT DEFERRABLE INITIALLY IMMEDIATE
;

JavaScript rocks!

Attached: js-rocks.png (1000x494, 369K)

I like premake but I don't know how I can get Emacs lua-mode to indent the premake files like in the examples

lmao who's this boomer?

PYTHON ROCKS!

Attached: yaniggabeefy.jpg (1000x847, 191K)

premake is dumb. Meson is the new hotness.

dumb frogposter

dumb frogposter

Attached: 1c868f43ffdc1c165537bde0ba79c49ea181fa7e.png (900x1440, 525K)

I like this image but js not so much

Lisp is the most powerful programming language.

total meme

#.(loop for i from 1 to 100 do
(format t "~:[~:[~a~;Buzz~]~;Fizz~:[~;Buzz~]~]~%~@*" (= 0 (mod i 3)) (= 0 (mod i 5)) i))

>not looping in the format string
so close

I've thought about this. It may be time.

oh no no no no no

Attached: 1544458851778.jpg (754x297, 43K)

So, impotent Jow Forums rage about the community aside, how is Rust as a language?

kind of line noisy

fuck you

public static String fizzbuzz(int n) {
return (n

>Not even a fully complete program
0/10

Okay fuck this. Fuck programming.
I'll become a comfy sys admin instead.

Attached: 1544398891535.jpg (1188x2023, 623K)

Yes.

I've been using this piece of code to color certain outputs and understand my programs better, specially when it comes to processes and pipes, but I don't really know how it works lol

#define pprintf(f_, ...) printf(("\033[38;5;%um" f_ "\e[0m"),30+(unsigned int)getpid()%250,##__VA_ARGS__)

I just get that it defines a pprinft to substitute printf and adds them color attributes, picking randomly between 250 colors.

One example of its use would be this

#include
#include
#include
#include
#include

#define pprintf(f_, ...) printf(("\033[38;5;%um" f_ "\e[0m"),30+(unsigned int)getpid()%250,##__VA_ARGS__)

int main()
{

for(int i=0;i

Attached: 1542384765381.webm (480x360, 2.71M)

Attached: Youre-Fired.png (1200x700, 657K)

why can't I ever remember ternary operator syntax?

#include

void
fizzbuzz(unsigned int num, unsigned int max)
{
if (num

Attached: 1543896039501.jpg (450x455, 32K)

>Sepples

Attached: 1497214889403.jpg (475x530, 47K)

?:

it's 5pm

#include

int main(int argc, char **argv)
{
argc = 0;
while (++argc < 101)
{
if (!(argc % 3))
printf("fizz");

if (!(argc % 5))
printf("buzz");
else if (argc % 3)
printf("%d", argc);

putchar('\n');
}
}

My 11 year old son just finished cs50x. Cs is being pushed on little kids and the market is going to be over-saturated soon. Get ready to learn real skills, anons. If you're in college you might want to consider a second degree in one of the engineering fields.

please don't tell me this is true.

I didn't even know sepples had recursive functions, which is super rad. I have no idea which standard added that but I just compiled it with std=c++17 and it worked.

It's 8PM and I cranked that out feeling like the biggest street shitter ever. But it works.

Attached: 1543193639685.png (1300x1980, 2.08M)

I don't think pajeets write C in C++

It is. He was a closeted gay man so he died alone.

Was he gay, or just extremely autistic?

(define (fizzbuzz a b)
(if (= a b)
'()
(cons (match (list (remainder a 3) (remainder a 5))
((0 0) 'fizzbuzz)
((0 _) 'fizz)
((_ 0) 'buzz)
(else a))
(fizzbuzz (+ 1 a) b))))

(fizzbuzz 1 15)
=> (1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz)

it's not real C++ unless you use template fuckery to calculate it at compile time

(OP)
#include

int main(int argc, char **argv)
{
if (argc && argv)
{
argv = 0;
argc = 1;
}

if (!(argc % 3))
printf("fizz");

if (!(argc % 5))
printf("buzz");
else if (argc % 3)
printf("%d", argc);

putchar('\n');

if (argc++ < 100)
main(argc, argv);
}