/dpt/ - Daily Programming Thread

Treat OOPsies gently, they're delicate little flowers edition

Previous thread: What are you working on, Jow Forums?

Attached: 1533349323300.jpg (1000x800, 179K)

Other urls found in this thread:

pastebin.com/wDjCXnrF
twitter.com/NSFWRedditVideo

I really want a cigarette even though I haven't had one in two years.

Fuck off, I have anxiety

First for programming onezies

Attached: Jet-Black-Adult-Onesie-031.jpg (1275x1500, 45K)

How about no.

How about yes.

Which looks more autistic: orange, or jet-black?

Huh?

Onesies are not part of the programming outfit.

Fuck on, i don't.

Have you ever thought about putting as many lit cigs as possible into your mouth at one time, and then inhaling until you die of cancer?

Yes they are, tell me you wouldn't want to fuck her (him) with a straight face. Go on, do it.

Attached: dfbf2a90ab541b5d0858efd62e16a7a3.jpg (400x400, 18K)

Any Big N tech companies you could get away with wearing that?

I agree. Onisies hide too much body

pretty much any as long as you're a good enough programmer, they let you wear anything (as long as its not too revealing). Got away with it while working at Bing.

They hide just enough to leave it up to the imagination, just wondering about what hides behind that kawaii~~ is an adventure unto itself.

Trying out Go's cryptography libraries; they're neat
Other languages absolutely need to get their shit together

Do I need large, well architected projects in my portfolio in order to get that initial programming job?

just stuff that would be very well applied at your job. Like if you process large swaths of data with scripts, thats useful for data-science.

fuck off

All my stuff is toy scripts like stuff to show off in a terminal for ricing screenshots and web tools for imageboards and reddit.

What kind of job should I look for?

McDonalds management

Attached: Fuck -> ON.png (597x489, 172K)

i would suggest ding some freelance work to bolter the ol' resume. Those are great for an intership but a fully fledged job would just laught at you.

How do people who cant write fizzbuzz get work

>cant write fizzbuzz
fizzbuzz is a test to phase off the 99% if "programmers" who can't break themselves out of a double-loop. If you are that kind of person i recommend finding a different field of work.

what the fuck does fizzbuzz have to do with breaking double loops

>fizzbuzz
I don't understand fizzbuzz. What is the point? I'm pretty new to programming but I could write a program that does that in two minutes. Why is it special?

>i could write a program that does that
some people can't

How can people learn programming and not be able to do that?

code monkeys arent taught math or algorithms, only how to chain objects together so fizzbuzz catches them out

OOPsies

exactly

stop bully

its a figure of speech user, the equivalent of "unable to break oneself out of a wet paper bag".

Is Windows the thinking man's OS? Brainlets absolutely BTFO.

Attached: fgapi.png (1044x444, 140K)

sorry

Attached: 1517714776724.gif (500x650, 999K)

i always write fizzbuzz either recursively or iteratively with tests for 15, 3, and 5. is that good enough?

freelance work is stressful
what if i take a job and it ends up i cant do it?

nope, you're fired

>what if i take a job and it ends up i cant do it?
then you fail and learn a closer approximation of where your skills are at. You then take a job you KNOW you can do, and you do it.

Part of a successful life is a proactive mindset, never let "what if" rule you.

>recursively
show me

But then someone is pissed I wasted their time

i accept your apology

Attached: 4wpuhfewr794wrmn74w7n9po4rncd4wta.jpg (1280x720, 135K)

and you learn to not bite off more then you can chew for the next time.

Right now i'm developing a solution with my limited skills so that i can make moniez for a programming onzie, i'm going to approach them in the morning once i've got the prototype working.

simple version
def fizzbuzz(n):
fizzbuzz_helper(n)

def fizzbuzz_helper(n):
if n == 0:
return
fizzbuzz_helper(n-1)
if n % 15 == 0:
print('FizzBuzz')
elif n % 3 == 0:
print('Fizz')
elif n % 5 == 0:
print('Buzz')
else:
print(n)

How to do a single step / pass C-processor?
I have a program that use lots of #define -abuse, but it doesn't works as expected.
How to step through the #define expansion? Passing it to cpp directly doesn't really help since it expands all #define and showing a broken program

you do know its pointless to use recursion when you can loop right? that's pretty inefficient, it isn't tail-call optimized so you're incrementing the stack with every recursion

idk why i did the helper its not necessary here

you dont debug the pre-processor
if you have so many defines you need to debug them its time to rethink the way you program

def fizzbuzz_iterative(n):
for i in list(range(1,n+1)):
if not i % 15:
print('FizzBuzz')
elif not i % 3:
print('Fizz')
elif not i % 5:
print('Buzz')
else:
print(i)

This'll overflow

well congrats on solving a grade school programming problem it's just wierd that you would make it recursive in the first place

Made my universal aimbot that is cross-platform event based multi-threaded and uses neural networks written in c++ have a lua scriptable mouse api. Should I add a javascript engine or is it good enough?

Attached: Hayha024.webm (1280x720, 1.4M)

needs to run on a blockchain

Sure, I could give it a logging system using blockchain for the lulz

see idk just for fun or whatever. i'm frustrated with something i'm working on.

def fizzbuzz_safe(n):
if n < sys.getrecursionlimit():
fizzbuzz_helper_safe(n)
else:
maxn = sys.getrecursionlimit()-10
for i in list(range(0,n-maxn,maxn)):
fizzbuzz_helper_safe(i+maxn, i)
fizzbuzz_helper_safe(n, maxn*math.floor(n/maxn))

def fizzbuzz_helper_safe(n, m=0):
if n == m:
return
fizzbuzz_helper_safe(n-1, m)
if n % 15 == 0:
print('FizzBuzz')
elif n % 3 == 0:
print('Fizz')
elif n % 5 == 0:
print('Buzz')
else:
print(n)

who ever designed Go's mascot deserves to be dragged out and shot in the head

stop having opinions

true

fizzbuzz

Attached: 2018-08-17--1534576789_1005x198_scrot.png (1005x198, 10K)

>15 not fizzbuzz

woops

Attached: 2018-08-17--1534577129_1000x221_scrot.png (1000x221, 11K)

This is a Renee French thread. Here she's holding a first draft for the updated Go 2.0 mascot when they get generics.

Attached: rfrench.png (800x548, 558K)

Her most famous work.

Attached: plan9bunnywhite.jpg (1376x1492, 164K)

I think this is an allegory for Rob's Newsqueak and Limbo languages that never caught on.

Attached: renee_french.png (1927x804, 1.61M)

static void Main(string[] args)
{
FizzBuzz(1);
}

private static int FizzBuzz(int n) => FizzBuzz(new Func( (k) => { if (k % 15 == 0) {Console.WriteLine("{0} FizzBuzz", k); return FizzBuzz(k+1);} else if (k % 3 == 0) {Console.WriteLine("{0} Fizz", k); return FizzBuzz(k+1);} else if (k % 5 == 0) {Console.WriteLine("{0} Buzz", k); return FizzBuzz(k+1);} else {Console.WriteLine(k);return FizzBuzz(k + 1);}}).Invoke(n));

recursive, one-liner fizzbuzz in c#. Also, my first stackoverflow :) around call 5000.

what the fuck

why Jow Forums

Attached: gopher1.png (250x340, 17K)

People forget the go mascot is stylized for type setting. She can't use her full artistic potential.

Attached: 38698652_223179655038016_2466624714802462720_n.jpg (1080x1080, 127K)

This one is planned for the next golang.org layout refresh.

Attached: 21372474_481702438861350_7046511594234183680_n_002.jpg (1080x1080, 126K)

How do you program with such a font?
Wait, isn't this the default BSD font?

>Treat OOPsies gently
lucky c++ isn't an OO

Is basically every single computer at the core written in assembly language and is the syntax of assembly the same across all 4 types? Are x86 assembly and x86 64 assembly two different languages or do they share syntax?

Attached: 1521734394595.png (640x720, 340K)

I'm currently reading the C++ Primer and I have to admit, some of the real finer details of it are making it quite boring and tedious. Is it absolutely necessary to understand every little detail before I proceed?

No

Steve Buscemi?

I learned all the basic C shit but I can't do anything with it and I feel retarded because I literally cannot write a functioning program

protip it's not a one liner if the line is longer than 80 characters

>muh consoles
consolefags should die tbqhwyfam

This 80 char limit is now so obsolete it doesn't even make sense to care about, unless you're doing something very specific.

whats the latest "fad" in programming? Been using c# for a long time at work so I've been thinking of learning something new

Attached: 1278364343179.jpg (325x247, 54K)

Functional programming has been on the rise for quite some time now, not sure if it's a fad, I guess it depends on what comes next.

>one-liner
>has braces and semi colons

Are you a retard

best fizzbuzz

fizzbuzz :: [Integer] -> [String]
fizzbuzz l
| l == [] = []
| head l `mod` 3 == 0 && head l `mod` 5 /= 0 = ["fizz"] ++ fizzbuzz (tail l)
| head l `mod` 5 == 0 && head l `mod` 3 /= 0 = ["buzz"] ++ fizzbuzz (tail l)
| head l `mod` 5 == 0 && head l `mod` 3 == 0 = ["fizzbuzz"] ++ fizzbuzz (tail l)
| otherwise = (show (head l)) : [] ++ fizzbuzz (tail l)

should I use async when something takes about 10 seconds to finish or should I do it in another thread?

absolutely disgusting

why?

use map
write a function that turns an individual integer into a fizzbuzz string, and then map it over the list
Also use pattern matching, not head and tail

this is not readable
why would you put everything in a line

Im trying to modify a Boost.Asio(c++) program but so far I have achived nothing.
The problem is that once the program gets the initial message the server answers but then sends unlimited answers to the client

Im trying to modify a textbook example but is just not working. All the other needed classes work, the problem is in this class

pastebin.com/wDjCXnrF

What show should I put on in the background while I do some light programming?

Ancient Aliens

That image is stupid. Rust is clearly lawful evil.

rust is gender neutral you bigot

now kiss!

What Haskell extensions should I be using in VS Code?

All of them.

wait do you mean ghc extensions or haskell-related vscode extensions?

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

I'm trying to make a ORM-like library for Go that accepts a generic struct and holy shit now I know why people want generics so bad. Reflect is such shit and I can't figure out how the fuck do I process database.Query results and shape it into an []interface{}.

Is it network related?

Async programming released the thread lock until the task completes. It's great for I/O bound work but if it's computationally intensive work there'll be no speed up.

>using vs code

Nah, I have to make a boardgame with AI in JS and it takes a couple seconds until it finds a move which blocks the UI. right now I'm using webworkers, but I was wondering if doing it async would be good as well. I thought I'd ask because I don't want to recode it if I'm not sure about it.

Haskero

>not using vscode