/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?
Old thread:

Other urls found in this thread:

instagram.com/'
twitter.com/AnonBabble

fuck opengl

use go

I'm working on learning c++, and math.
I want to make games.

same but my opengl renderer works now so I'm happy

Employed Haskell programmer here

In 2017, every computer is a Lisp machine.

I bet the image was made by a butthurt gopher, php-kid or js-artisan.

i work on my self-esteem. No amount of coding can fix that.

I'll have two number nine's....

How come? I'm interested in learning C and C++, so I'm curious what is the issu with CMake

You mean slow, crush a lot and waste tonnes of RAM?

in the same way as every computer being a TempleOS machine.

Retweeting this gold from previous thread

No.63227800

- Programming languages if they were tea -

>C would be black tea:
without anything added to it, not very enjoyable unless you're willing to deal with the bitterness. Most agree that it's better if you add something to it.

>C++ would be C with milk:
comparatively good, but if you drink too much at once you begin to feel bloated.

>Java would be C with soymilk:
Why the fuck would you do that to black tea?

>C# is C with milk and sugar:
it's difficult to taste the black tea itself at this point, but it's much more enjoyable than plain black tea (and far more enjoyable than that soymilk abomination you tried a few years prior).

>Scheme Lisp would be matcha:
Most people don't even understand how to make it, but those who do swear by it. Some thinl that it helps facilitate reaching satori, but others think that it's quite a fuss for just a tea.

>Ruby would be Japanese green tea:
"An acceptable Lisp" according to some, although most agree that it's not quite as much of a mind changer as matcha.
Also, it comes from Japan.

>Python would be Chinese green tea:
Historically in competition with Japanese green tea, those who drink it insist that Japanese green tea is just silly, and that matcha is absolutely absurd.

>Haskell would be oolong:
Most haven't even tried it, but those who do become deeply involved with its odd lingo ("gong fu", "gaiwan", "yixing") and come out of it feeling they've truly experienced tea as it was intended to be experienced.

>Assembly:
Why are you eating those leaves raw?

>dude fucking uni codemonkeys
>fuck CS lol
>self teaching is so much better

...years later...

>Interviewer: calculate the square root of a number
>uhhhhhhhh Math.sqrt xD
>Interviewer: what's Big O?
>*spills spaghetti and runs away*

>haskell brainlets consider being employed an achievement

So machine code means eating the roots and microcode the dirt itself?

...

Are people even bashing go? What for?

lol no generics

jej

How new are you?

How is that a big problem?

Mainly because of that quote by (I think) Rob Pike where he says that Go wasn't made for intelligent Programmers with a capital P but for Google's codemonkeys who just want to write code that works with minimal fuss. It's quite dumb, really.

>last thread
>nigger dising C, can't into pointers
>nigger dissing JS, can't into type coercion
>turns out he was an absolute brainlet
These are the people who hate other languages just for the sake of hating on other languages

I just don't browse shit threads anymore.

can't make your own containers in a typesafe fashion
plus it's literally insulting your own intelligence

Not a problem at all for an experienced gopher.

>designing chip would be you become a god of creation
i can live with that

Please stop

Not really. You become indian tea planter and thus come to a full circle

>Scheme Lisp

Do you need different programming socks for Scheme and Common Lisp?

lol no sync.Map

imagine a language without functions

one for each leg.

Is there a list of color recommendations for different languages?

Is programming C-style code with some C++ facilities bad? Should I just pick one or another? What would you pick?

>be indian tea planter
>suddenly have the urge to shit
>squat down in the middle of tea plant
>nourishing all the young compilers in the field
>snake bite my dick
>it grown swolen and big. Everyone start to call me as swolen dick snake
>female tea pickers grow curious and ask about my "snake"
>fuck couple of them pouring my seed on the soil
i can still live with that.

Pick C or modern C++.

...

>Is programming C-style code with some C++ facilities bad?
Yes.
> Should I just pick one or another? What would you pick?
Yes, modern C++ ofc.

reminder to use TeX in your comments if you want to get your dick wet

...

Is FizzBuzz meme a meme?
How can anyone who has practiced programming for at least few weeks(month) not be able to write FizzBuzz?

people who call themselves programmer never actually program anything. For example see rust "programmers".

Show your work.

Rate my post

There are people trying to get programming jobs who can't actually program.
They can learn how to do a thing by heart but they can't create anything new.
That's all fizzbuzz tries to catch.

But because it's so well known it's just a meme now since those people can just learn the solution before the interview.

Sorry, I got a can't evaluate error.

Women

I've been studying some very basic Fortran recently. Any suggestion for a small project that would be suitable for a beginner?

Ideas for C# applications I can build to show off on a resume? All of my experience is in Java and C. I'm trying to get a C# / .NET job since that seems to be where most of the decent paying jobs are in my state and surrounding cities.

first time even attempting
int main()
{
int i;

for (i = 1; i< 101; i++)
{
if (i % 3 == 0 && i % 5 == 0)
printf("FizzBuzz ");
else if (i % 3 == 0 )
printf("Fizz ");
else if(i % 5 == 0)
printf("Buzz ");
else
printf("%d ", i);
}

return 0;
}

yeah it's called pick another language.

How do I rewrite this in Rust?
auto serialize(const contents_t& contents) -> const buffer_t {
return std::visit(
overloaded{
[](const node_t& node) { return serialize(node); },
[](const computation_t& computation) {
return serialize(computation);
},
[](const heartbeat_t& heartbeat) { return serialize(heartbeat); },
[](const invalid_t&) { return buffer_t{}; }},
contents);
}

use an ADT i guess

>babby's first fizzbuzz

>(i % 3 == 0 && i % 5 == 0)
Fucking dropped.

Port something from fortran to sepples
Hardmode: don't shoot your dick off

It used to be a way to filter out the lowest of the lowest common denominator, but it's become almost as ubiquitous as a hello world program at this point, so it's completely useless now.

impl Contents {
pub fn serialize(&self) -> Buffer {
match *self {
Node(ref node) => node.serialize(),
Computation(ref computation) => computation.serialize(),
Heartbeat(ref heartbeat) => heartbeat.serialize(),
Invalid(..) => Buffer::new(),
}
}
}

The code is safer tho, because the compiler checks I've properly covered all the possible cases.

What's the problem?

Post your work, fags.

Rc.

That's fine.

You could also do "i % 15" instead of checking both 3 and 5 (if a number is dividable by two prime factors - it's also dividable by their product since every natural number (except 1) can be factorized into a unique set of primes) but it's not necessary.

Damn, I didn't think of that. When I read description of the problem I got too fixated on "3 AND 5" part.

now make one for private profiles

How do you make your code have a white background and look like this?

#include

int main(void) {
static const char *str[] = { "%d ", "fizz ", "buzz ", "fizzbuzz " };
static char pat[101] = { 0 };
for (int i = 3; i

You need to buy Sup Forums pass, bro.

Or maybe read the fucking sticky

I made this instagram profile pic downloader today lol
import urllib2
import sys
from bs4 import BeautifulSoup
import urllib
from urlparse import urlparse
import string
from random import randint
import os.path


url = raw_input("Enter the Instagram Profile: ")

if 'instagram.com/' in url:
print('Valid URL!')

else:
print('Invalid URL!')
sys.exit()

page = urllib2.urlopen(url)
soup = BeautifulSoup(page.read(), "lxml")


imglink = soup.find('img') ['src']

print imglink


randomnum = (randint(0, 10000))

# randomnum = 1

filename = str(randomnum)
newfilename = filename + ".jpg"


path2file = "user/GetPic/Images/" + newfilename


if os.path.exists(path2file) == True:
print "File already exists"
randomnum = (randint(0, 10000))
# print randomnum
filename = str(randomnum)
newfilename = filename + ".jpg"
urllib.urlretrieve(source[0], newfilename)


urllib.urlretrieve(imglink, path2file)

>3 loops
3 times as slow, famalam

Epic meme lmfao LULZORZ

Ah, I was missing the ref stuff. Thanks.

And how do I learn modern C++?

>what is branch prediction
kys friend

I'm trying to convince my team to start writing unit tests. Most of our code is a blend of view logic, business logic and I/O sprinkled with hacks until it works. This makes it a nightmare to refactor. Changing a feature usually ends of breaking the entire codebase. The compiler may catch the errors, but most of the time the code breaks at runtime.
The past week I've been reading articles about the pros and cons of unit testing. They all boil down to: isolate the business logic, split it up into small bits and start writing tests. This result in cleaner code and aids you when refactoring code. The biggest drawback is the amount of time you have to invest in writing and maintaining unit tests. I've spoken to my manager about unit testing and he said: "you could've spent that time writing new features. The customer doesn't benefit from unit testing, so he's not paying for it". I don't agree with him though, unit testing could safe you time in the long run. If done correctly, it should safe you time in implementing new features.
What does /dpt/ think of unit testing?

It works on private profiles

>I'm trying to convince my team to start writing unit tests.
Update your resume.

Why would you do this?

Do you mean finding a new job with competent coworkers?

Webscale

>printf("fizz", i);
Enjoy your broken stack, C-tard.

Wrong.

But I do not know any Sepples.

>profile pic
what's the point
make it for actual photos

Trying to wrap my head around the Post Correspondence Problem

Apparently, I am:
>If the format is exhausted while arguments remain, the excess arguments are evaluated (as always) but are otherwise ignored.

niggas be private mane u kno,

>2017
>can't split a string

just do it already
I need to see some bitch that blocked me because word got around campus I wanked at her insta photos in the library
fucking cunt

>what is stringstream

Anyone else find creating GUIs a pain in the ass, not comparable to writing simply text-based programs?

Rust has the best mascot

I need a mentor in C++. Seriously. Would like to provide some code and questions via e-mail or Telegram.

I fucking suck at programming, even girls in my classes are better at it.

>Wanking in the library
The absolute state of humanity

I think everyone does. I've been wanting to write my own toolkit for some time but I couldn't find the time, so I still have to rely on imgui for opengl + gui

Who's mascot is she?

This can't be real

>strongly typed
>random type conversions happening everywhere

just post them here