/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: fb1.png (680x1412, 1.07M)

Other urls found in this thread:

strawpoll.me/16604780/
gitlab.com/cppit/jucipp
pbr-book.org/
youtube.com/watch?v=rqX8PFcOpxA
strawpoll.me/16654112
twitter.com/NSFWRedditVideo

text editor poll for the last time
strawpoll.me/16604780/

jucipp
gitlab.com/cppit/jucipp

C# is C and two rows of ++

OK now this is epic xD

Attached: 1516895749249s.jpg (221x250, 8K)

I like Vim but I don't support feeding needy Ugandans. Can another modal editor dethrone this absolutely cucked program?

Attached: population-growth.jpg (650x436, 31K)

evil-mode

What happened with Ms. Green?

writeln (canFind("help")
? "based and redpilled"
: anyOf("cringe and bluepilled", "cuck", "SJW")
);

Attached: 1536432080312s.jpg (250x208, 5K)

NPCs run on Haskell

I support the philosophy of emacs and I love lisp. But the default keybindings are atrocious and I don't want to add someone else's 100,000 lines of code just to make it usable. Someone just needs to make a less shit emacs with modal editing built in.

Go back to r/Jow Forums

>Can't tell if I'm bad at math or my calc professor is a really fucking harsh grader
>She has nothing on bad reviews on ratemyprofessors

I honestly don't know if I just try to study harder and hope I pass the class or drop the course and hope I get a better teacher in the spring.

Attached: help.jpg (900x900, 56K)

i want to make my own language bootstrapped from assembly, but i also want it to have opengl compatibility. would creating language bindings to opengl be too hard? should i just give up and compile to c instead?

Attached: 63BB4F44-FAC3-4A42-B338-73BBF97EE596.jpg (772x1094, 314K)

soul is a side effect

help me /dpt/. I'm a hobbyist programmer (mostly with scripting/dynamic langs) but I work as a sysadmin. I applied for an opening within the company i work for on the development team doing C++. I explained that I don't know the language but I'm a quick learner and with a little direction I could get to grips with it in my free time.

Unexpectedly I was instead told that I would be interviewed next week, including a three-hour practical test. I need to prepare, but I don't know where to start. I could do with some advice.

I was told that I will need to demonstrate the following during the test:

inheritance
polymorphism
SOLID principles
use of properties
Use of private, protected, abstract, virtual
Use of more than one design pattern e.g. Factory
Input validation
Exception handling
Constructor overloading

Many of these I am already familiar with, but many I am not. I'm doing my research but advice would be much appreciated. I'm especially interested in suggestions for projects I could complete that would prepare me for the practical test and allow me to utilize the above concepts

try VSCode with vscodevim plugin

I don't get it.
You're against plugins?
Just use vi then...

TODO list that accepts different types of content - text, bullet lists, images, audio.

What do you think about the whole "The future is massively multicore"-thing?

I think it is bullshit
the present is already massively multicore

Fuck yes?

Attached: full usage.jpg (1616x1730, 616K)

the future is massively single core

that python / ocaml fags will be eternally butthurt because their language has GIL

multicore has diminishing returns, very significant ones

I'm an absolute madman and want to make webshit servers with c++. Should I use Wt, Cppcms, or other?

>Wt, Cppcms, or other
no idea, maybe look at what grc.com uses? I know those urls are often .dll, but the guy writes in assembly as well so...

it's already hard enough

pbr-book.org/
> As of October 15, 2018, the full contents of the third edition of the book are freely available online.
Nice!

Attached: 1523258136226.jpg (1280x720, 96K)

be a true madman and implement your own library

noice

Looks interesting however could you elaborate on what he meant with
>juicy peepee?

I want to use the minimum number of plugins possible and just config it myself. That's not really doable on emacs because its bindings suck ass.

I don't understand the joke.

She fucked her students

JavaScript rocks!

Attached: 1539545530159.png (1000x494, 369K)

Garbage.

why was she fired?

She was the illustration in a school textbook, but people kept making porn of her and they pulled the textbooks.

holy shit, why would they do that to their programmers?

Also, you're supposed to use the musical sharp symbol (i.e if Jow Forums will let me post it) not the pound sign, but they accept the latter because it's harder to type the correct symbol.

Attached: the_more_you_know.jpg (549x362, 124K)

What's the name of the character or textbook?

A day in the life of a software engineer: youtube.com/watch?v=rqX8PFcOpxA

Attached: cs.jpg (1904x4706, 1.09M)

Fix the bindings yourself, that's the point of emacs.
And if you're too lazy, download a plugin of someone that did it for you, that's also the point of emacs.

That twitter "follow me" is so old I didn't even recognize it.
Also
>coding

>zed shawy
lmao

that qt SE is cute though

True for desktop computing in the present, but the future is actually "theoretically powerful but limited multicore powered by batteries"

Attached: 2017-01-18-concurrency.png (4000x2250, 764K)

What the fuck. Don't you just love C++.

I've got 2 QtWidgets, each in their own window. The user can select a part of an image and it will do OCR on it with libTesseract.

This gives me a segmentation fault at "m_tess->SetImage(pix);"
// imageviewer.cpp
void ImageViewer::mouseReleaseEvent(QMouseEvent *event)
{
QRect selection = m_rubberBand->geometry();
m_rubberBand->hide();
m_rikaime->lookupByImage(grab(selection).toImage());
}

// rikaimewin.cpp
void RikaimeWin::lookupByImage(QImage image)
{
PIX *pix = qImageToPix(image);
m_tess->SetImage(pix);
char *outText = m_tess->GetUTF8Text();
std::cout SetImage(pix);
char *outText = m_tess->GetUTF8Text();
std::cout

If grab(selection).toImage() actually returns a reference to a subclass of QImage then you may be getting object slicing.

The only way you'll get a segfault on that exact line is if m_tess is garbage or nil, so go find out which it is.

C# is C++++ according to Anders Hejlsberg (creator of C#)

What's a C++ project that a weeb could make to show off he actually knows C++ and isn't just a waste of space made for drowning in cum?

Attached: 1539628737057.jpg (871x1200, 309K)

If you honestly think C++ is good, you're a waste of space made for drowning in cum.

she got an accident.

Attached: 790f9123d73a8352cd7dcc9f59cedc0fada03c3c_hq.jpg (373x395, 20K)

I just want a job, and they want me to know C++.

Is Windows 10 a good OS for programming?

>Windows
>Anything programming related
>Anything at all
Of course not.

Actually it was the "m_rikaime" pointer that was uninitialized.
It happily called the method on it, until I tried to address one of it members.

Coding C++ is always a humbling experience.

Attached: TSTBaQ7.jpg (1462x2046, 98K)

critical poll
strawpoll.me/16654112

hi /dpt/
i'm a faggot who wants to start programming and got a few questions
1. What's the math knowledge required in general? I like math so it won't be a problem to learn, but want some indicators.
2. Is SICP a good starting book?
I've got nothing but time

What's a fun game you can make in C++ with very little time and effort? Something that shows off the basics, a little bit of OOC, etc.

Tower defense, probably?

Attached: e9c9b-12045391_1044992398866687_8206995848664265613_o.jpg (1434x1434, 372K)

That's quite memeish to be fair. Only a low percentage of problems we solve using computers can make usage of high parallelism. For the rest, Amdahl's law kicks butts.

>usable text editor, something like ewig
>video game, even some retarded mario clone
>n-body solver with display
>compiler for some meme language that still allows to do useful things (like file I/O or GUI)

Anything the company you want to work at does, but better.

>video game, even some retarded mario clone
Christ, I don't like this, but it does seem easy. I did a project with OpenGL & C++, but the uni network lost it.
>usable text editor, something like ewig
Oo I like this recommendation, user.

Thanks a bunch!

Attached: 1539540567540.jpg (622x604, 52K)

why are algorithms so difficult?

I want to program in c but all the ides are so shitty

A simple shmup or a rhythm game

>IDEs
Stop being a stupid faggot. All you need is a text editor and a compiler.

you don't need to know any math to start off with unless you're writing something specifically mathematical. The kind of person who likes maths is likely to enjoy programming though.

sicp is great, yeah.

>mfw I find explanation of OP pic
I love this world.

Attached: 1538976639525.jpg (250x250, 16K)

>the math knowledge required in general
Depends on the kind of software you want to work on. Last job I had was CFD post-processing which involved quite a lot of higher-level math, both for linear algebra and fluid mechanics. On the other hand some people are satisfied spending their lives creating web pages until they move into management.
>Is SICP a good starting book
Never read it but anything that helps you understand algorithms and computation, which SICP seems to do, is good.

sorry user but I'm not unemployed like you. I can't afford wasting time

>rhythm game
Or even a fucking card game. Shmup could be easy if you don't care about doing any sort of elaborate scoring system.

I'm not unemployed. I'm currently hired as a C developer, and have pretty decent experience in open-source software.
Every other C developer (excluding extreme beginners) I have ever met has not used an IDE.

I think I'm gonna give a card game a go around first, and then after that, try babies first CRPG. Thanks a bunch, user.

>rider pushes his legs forward
lmao the absolute beginner

It's trash, unless you need some meme IDE or .NET plugin for work.

What could you possibly be doing that has your computer firing on almost 200 cylinders?

Good. Just do it the most straightforward way you can think of and focus on the immediate problem you're trying to solve. For non-AAA games this is the greatest to move forward.
t. about to publish his first game after many failed attempts thanks to no longer caring about "best practices" and just coding the game

the best OS available, unless you're gonna program in some useless meme language

OS really doesn't matter in most cases, especially for your purposes if you have to ask that question

Eh, it's less for me to make my own games and more for me to show the "best practices" to a potential employer, in a fun way that'll keep me passionate.

What's a sensible sleep period in an always true while loop?

That depends on what you are programming and for what platform you are programming it for. If you're just hobby programming, literally any computer will do the trick.

from 23pm to 7am

Not designing your program in such a way is the most sensible decision.
Go learn what multiplexed I/O is and how to design/use a real event loop.

which text editor's and compilers?

based and redpilled
JS truly is the best language around

Any reccomendation on where to properly read up on it?

whatever ones you want

>which text editor
Whichever one you like best.
>compilers
GCC or Clang; ideally both.
>other tools
gdb: General purpose debugger
valgrind: Memory leak/access debugger
GNU make: Simple build system. Only use directly for very basic projects.
Meson: More advanced build system. Makes using things like address sanitizers or LTO very easy.

please share

pray tell, how do non-beginner devs debug their programs without an IDE? gdb TUI?

fuck off chink stop shilling your yt channel here

Google. You'll also find resources associated with select(2) and poll(2), some of the functions implementing multiplexed I/O.
Using it is only appropriate for certain types of problems, but if you're considering an infinite loop, it's probably what you want.

Yes, you'd use gdb directly, but that is certainly not the only tool.
- valgrind
- address sanitizers (and related)
- printf debugging is sometimes all you need
Ideally, you'd be using all of these as required.

>if you want to scrape a Jow Forums board using the api you have to request each thread individually
good job faggot

Attached: 1538233257130.jpg (870x832, 90K)

is there a way you can make a loop for loops? I tried to make a program that checked all n permutations of a string without recursion, and I failed.

It's fucking retarded not to use plugins to make vim or emacs into a full-fledged IDE.

t. embedded C developer