/dpt/ - Daily Programming Thread

Previous:

Attached: workingwith.jpg (1120x350, 296K)

Other urls found in this thread:

vissi.su/translations/programmer-teormin.php
starling-software.com/employment/programmer-competency-matrix.html
vulkan-tutorial.com/
github.com/Overv/VulkanTutorial/blob/master/code/15_hello_triangle.cpp
twitter.com/SFWRedditGifs

Haskell!

Attached: 1520118512662.jpg (1280x720, 69K)

that image doesn't make any sense.

Somewhat related:
Is thread scheduling the same idea as process scheduling? So if a process is running (and we assume a single core), with two threads, do the same principles from context switching apply to swapping threads too?

It's the same. On Linux the concept of process and thread is generalized as task. From the view of the scheduler, there's no difference,
The difference is in the resources they share by default. Threads share the address space of their parent.

nth for C# desu

nice thread start.

Reminder how to a competent programmer
vissi.su/translations/programmer-teormin.php

it's comfy desu

Attached: smuggie.jpg (3024x4032, 374K)

>she doesn't understand monads

Great, thanks.

future proof code is written in C

we debunked that crap a few threads ago.

>.php
no

thanks

>Java without the ecosystem
No.

Not even close to Java if you're doing real work

on C, if i use log10(n)
can n be int or does it NEED to be double for it to work?

JVM has you covered better with Kotlin and Scala if you're a glutton for complexity.

>dating qt programmer
>couldnt get a dev job, does qa
>always complains about how devs never understand qa process
>why doesnt she just be a dev
>she interviews for a position
>help her interview
>doesnt understand stack vs heap
>explain it in simple terms
>gets mad
>breaks up with me

Conversion is implicit, you need not worry. You might get a warning with -Wall or -Wextra.

How it probably went:
>a-user, I'd like to apply for a p-programming job, c-could you please help me~?
>SURE M'LADY LET'S CHECK THIS BOOK ON THE MIT SCHEME IMPLEMENTATION, IT MIGHT NOT BE USED MUCH IN THE INDUSTRY, BUT IF YOU DON'T UNDERSTAND FUNCTIONAL PROGRAMMING, YOU CAN'T CLAIM TO BE A REAL PROGRAMMER
>a-user, couldn't we start with something simpler?
>OMG YOU'RE FUCKING RETARDED YOU FUCKING BITCH WHORE I'M GOING TO GO BACK TO FIXING MY X11 SETTINGS BEFORE MASTURBATING TO CARTOON LITTLE GIRLS AND THEN POST ABOUT HOW DUMB YOU ARE ON KAZAKH KNITTING FORUMS
>a-user~!

java is comfy

roastie BTFO

How the fuck was Grimace not used for the last panel

> Undefined referente to cmd_map

cmd.hpp:
#pragma once
#include
#include

class cmd {
private:
static std::map cmd_map;
const std::string name;
private:
void do_register()
{
cmd_map[name] = this;
}
void unregister()
{
cmd_map.erase(name);
}
virtual void do_it() = 0;
public:
cmd(const std::string cmd_name) : name(cmd_name)
{
do_register();
}
virtual ~cmd()
{
unregister();
}
static void run(const std::string cmd_name)
{
auto it = cmd_map.find(cmd_name);
if (it != cmd_map.end()) {
it->second->do_it();
} else {
std::cout

I know basics in C and Java. Recommend me a book on C++ and Python?

>sepples
found your problem

do embedded systems jobs pay more than webdev or devops

Hahahahhaa rip my dude

>, class cmd *
Shouldn't it be just cmd*?

You only have #include in your main.cpp

Add #include to main.cpp is my guess

Which C++ unit testing framework is the patrician's choice?
Serious replies only

catch

Why the fuck does g++ tell me to fuck off?
>expected primary expression before ')' token
How do I iterate over enum's?

class Card
{

protected:
//! @protected
enum VALUE_E
{ SIX = 6, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE};
enum SUIT_E
{ HEARTS, SPADES, DIAMONDS, CLUBS };

private:
//! @private
VALUE_E value;
SUIT_E suit;

//! etc ...
//! ///////////

class Deck: public Card
{

private:
static constexpr unsigned short SIZE = 36; //! [0 ... 36]
using deck_t = std::array;
deck_t deck = { nullptr };

public:

Deck()
{
unsigned short idx = 0;
for (const auto& v: Card::VALUE_E) //! here
for (const auto& s: Card::SUIT_E) //! and there
deck[++idx] = new Card(v, s);
}

};

>>dating [..] programmer
Well there's your first mistake.
Never do that.

>a deck is a card

Attached: big brain nibba.png (680x788, 117K)

is it save to use memcpy() to copy an object identically in seppels?
for example:
Foo::Foo(int);
int main(){
Foo foo(0);
Foo bar;
std::memcpy(&bar, &foo, sizeof(foo));
return 0;
}

The only patrician choice is printf/std::cout when a bug pops up.

I am retarded, how do I proceed? Create getters/setters?

Attached: 1489418342836.png (400x400, 67K)

I'm following a course on python and we're supposed to build a rock, paper, scissors game. Now that's not a problem but I was wondering if it would be possible to graphically represent a rock, paper or scissors in the terminal? For example, when the user inputs scissors, then there's a graphical representation of scissors in the terminal?
Sorry if it's a stupid question.

>How do I iterate over enum's?
You can't you fucking bwaka. Learn C++.
Wait for C++20 which will allow you to do this via compile time reflection.

A deck is a composition of cards so you should add a card array and not have deck inherit anything.

No. You should use a copy/move constructor to do this.

sure
print
>*
for rock
>v
for scissors
and
>[]
for paper
this is probably easier in haskell tho...

Could I assign a color to those characters?

No, not for any arbitrary type.
It's only safe if std::is_trivially_copyable_t returns true.

Is there any way to draw a triangle in SDL2?

All I found were search results for an SDL_RenderGeometry() function, but it doesn't look like that exists.

I want to make a software renderer of Quake, like winquake, but with SDL.

It already has an array of cards (pointers to be precise), I did inherit just to access enum's, then to create a deck later by new'ing cards.
Is it alright?

How to find motivation to keep programming when you've made over a million USD with cryptocurrency?

I'm not sure.

Python has a lot of simple graphics libraries. You could try using one of them and simply loading pictures of stones, scissors and paper. That would give you some practice using third-party libraries as well, which is integral to using Python

Most likely.

Ask Notch

Since we hate C# today, what's the alternative? Java is shit, C/C++ takes to long to write the same thing, academic languages have no practical libraries. Python has no types. What are people supposed to use instead of C#?

Attached: index.png (289x175, 6K)

C++. And stop grouping C++ in with C you fucking idiot, they're not the same.

Don't inherit just to do that.

Java is better and so are JVM langs in general. Bitch about libraries but as long as a FFI exists it doesn't matter.
>Python has no types.
Implying C# has a type system worth caring about.

>C++
And take 6 times longer to write a program with the exact same functionality as can be done in a modern language?

>Java is better
How the hell did you reach that conclusion?

Less stupid bullshit. Java is conservative and that's a good thing. If you want to innovate you have plenty of alternatives on the JVM, all of which are superior to C# in their own way.

Thanks, I will go and check.

What the fuck is going on with /dpt/ today that someone is actualy defending Java?

jvm is good you retarded microcuck shill

>JVM is good

java is unironically good

Anyone? At least C++?

dumb frogposter

How accurate is this
starling-software.com/employment/programmer-competency-matrix.html

>can't search on his own

>blogs

/dpt/ never had hate toward java, newfag.

samefag without an argument.

dumb dumb frogposter poster

Thoughts?

PROGRAM Triangle
IMPLICIT NONE
LOGICAL :: L1, L2
INTEGER :: side1, side2, side3
PRINT *, "Type in the three sides:"
READ *, side1, side2, side3
Outer: IF (2*MAX(side1, side2, side3) >= side1+side2+side3) THEN
PRINT *, "Not a Triangle"
ELSE Outer
L1 = (side1 == side2)
L2 = (side2 == side3)
IF (L1 .AND. L2) THEN
PRINT *, "Equilateral"
ELSE IF (L1 .OR. L2 .OR. side1 == side3) THEN
PRINT *, "Isoceles"
ELSE
PRINT *, "Scalene"
END IF
END IF Outer
END PROGRAM Triangle

What language is that?

seems REALLY SHOUTY

Fortran.

not an argument

>if you want to work for us you should master following:
>whole fucking paragraph of words I don't understand
How am I supposed to make it out there?

Java is a master race

vulkan-tutorial.com/

>github.com/Overv/VulkanTutorial/blob/master/code/15_hello_triangle.cpp
>+ 800 loc to render a triangle
>"sane"

Attached: 1387075708427.jpg (499x497, 47K)

nice english, Rajesh

opengl es 2 or fuck off

Just apply if you want the job, if you don't get it oh well.

>Thing replaces driver-side graphics abstraction
>"t-too many lines"
Use a game engine or library then faggot.

Do you comment your code?

Attached: DT1a8Y6W4AAXUuT.jpg large.jpg (1115x842, 112K)

If you need to comment your code, you're running into 2 scenarios :
1 ) Your code is very long and commenting it makes it faster to read
2 ) Your code is unreable

Refute this

Attached: Cbtfo.jpg (669x55, 19K)

Depends on how many times you plan to run the program

The program is just worn out from all the running.

What's that anime called again? Saw it as a kid.

depends on whether you were paid for working or not
if you were paid, then you did gud

C should be used if you want the best performance possible

Attached: wvs7.jpg (700x350, 178K)

My Neighbor Totoro

Attached: images.jpg (300x168, 13K)

> API design while we were all on LSD

Its "sooper low level".

Also, much fun to write a different code path for every permutation of:
> need/don't need barriers
> need/don't need layout transitions
> has/does not have more than 1 queue
> supports/doesn't support snowflake color format X
> can/can't allocate coherent arena for images of snowflake format X
> wtf is this extra queue family, oh well

Also, 99% of the validations layers only work with 64 bit correctly.

That picture doesn't make any sense.

The ugly monster is web, the little girl is software