/dpt/ — Daily Programming Thread

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

Attached: 1526861984926.jpg (1000x500, 214K)

Other urls found in this thread:

stackoverflow.com/a/1518718
sourceforge.net/projects/win-agui/
archive.rebeccablacktech.com/g/thread/66002448/#q66002494
blogs.msdn.microsoft.com/vcblog/2017/03/07/use-any-c-compiler-with-visual-studio/
twitter.com/SFWRedditGifs

hi

fuck opengl

Is there a C++ library that does linear algebra on std::vectors? Including being able to handle Matrix vector multiplication when I have a vector < vector matrix?

Any work on Openstack?

What the hell is this retarded image?
Where are the cute anime girls?

Attached: 1376505409276.jpg (524x480, 48K)

Probably not, that's not wat std::vector was made for.
GLM is very easy to get started with though.

Integrating with QuickBooks desktop for any level of remote automation fucking SUCKS

glow in the dark manchild

Guys I made something useful in haskell

get out

spoiler: I unironically love haskell

Where do you think you are, reddit-kun?
Where do you need to return to, reddit-kun?

Code or it didn't happen.

Trying out previews and blah blah
pic related

Attached: 1446092270795.jpg (692x763, 141K)

nice

Attached: 1476852306592.png (376x328, 167K)

post a screenshot of your code

Attached: scrot.png (1920x1080, 266K)

Okay later maybe
It parses my shitty web pay stub into a format used for hledger.

please answer

>stackoverflow.com/a/1518718

Cheeky program to convert text to emoji alphabet on discord for shitposting reasons

Attached: 123.png (497x362, 15K)

How to understand C's notation that result in
typedef int(*foo)(int,int);
foo bar(int);

without the typedef?

is this the correct declaration?
int(*)(int,int) bar(int);

check out Eigen

New to C#?

Back where I work, this would mean in +- 3 years

Attached: w2.png (685x98, 5K)

not quite but i'm a sys eng from the basis.

does my code look like i'm new to c#?
fml

You work for Jow Forums?

used to.
i even founded this website, but that's a story for another time.

So when I initiate a string it should know how many chars were allocated, why does it would need the NULL char if it knows how long it is?

Shitty image for silicon valley tier meme.

cuck

Shoe on glans or GTFO.

Not a C# developer here (mobile/front-end), but taking into account that C# is a functional language it would think it should look more like this.

Attached: Screen Shot 2018-05-21 at 23.40.05.png (553x240, 41K)

yea i get your code. now i know why the noobie question was asked to me.

fml

Prelude> let 2 + 2 = 5 in 2 + 2
5
lol

>watching presentation
>presenter has an Alienware laptop

Attached: 1525318256574.jpg (600x1067, 124K)

>tfw you understand why this happens

Attached: 1453400948152s.jpg (1920x1693, 944K)

With a non-cuck programming language, I'd code that in 2 lines

no way dude

Yes, very.
This isn't production code so I would write it in an elegant way like so:
// using static System.Console;
public static void Main(string[] args)
{
string rtemp = ":regional_indicator_{0}:";
string input = ReadLine().ToLower().Trim();
string output = String.Join(" ", input.Where(x => x != ' ').Select(x => String.Format(rtemp, x)));
WriteLine(output);
}

10/10

Yeah, it makes sense in a declarative language.

You can get rid of rtemp by passing directly to String.Format and also get rid of input by chaining ReadLine()... with Where(...)...
Making a total of two lines
Do it

I am phoneposting so I am pretty sure I made a mistake somewhere

sourceforge.net/projects/win-agui/

>You can get rid of rtemp by passing directly to String.Format and also get rid of input by chaining ReadLine()... with Where(...)...

great idea if you want to fuck around with your co-programmers

Yup I did. You need to:
>remove string join
>use aggregate instead of where..select mess
>use string interpolation and conditional check for space
Still two lines though and much shorter

Does it happen to produce side effects?

>useful
>side effects
pick one

I rarely use LINQ for production code.
Maybe some CRUD and filtering through a collection when I am 2 levels deep
It is also useful when you feel evil or want to bake something quickly

perl -lnE 's/([^ ])/:regional_indicator_\1:/g;say lc($_)'

Bad programmers don't like C++ because it often makes them feel stupid. Good programmers like C++ because it sometimes makes them feel stupid.

How do I practice good namespacing in C++?

I've been taught by plebs using
using namespace std;

don't use it at all.
It's literally useless bloat.

Yes, it outputs to the console

grow up faggot

You can interpret any char pointer as a string. If you allocate p, you can also pass p + 1, it’s still a valid string, but there is no size associated.

Nice. Fuck perl for ruining regex though
Process.Start("/bin/bash", "-c \"perl -lnE 's/([^ ])/:regional_indicator_\\1:/g;say lc($_)'\"");

Here is a true awful one liner in one statement:
WriteLine(ReadLine().ToLower().Trim().Aggregate("", (w, n) => w + (n == ' ' ? " ": String.Format(":regional_indicator_{0}:", n))));

Does anyone have the Humble Bundle functional programming pdfs download link?

Trying to fix my Vivado referencing errors for my artificial neuron research project. My VHDL testbench can't instantiate my neuron component because "neruon_v1 is not compiled under xil_defaultlib".
I spent several hours to figure out this is a IDE bug that hasn't been patched in years and none of the proposed fixes online are working.

Honest question, what is haskell useful for that another language doesn't do better?
I have no experience with it, just know everyone loves to shit on "muh functional programing"

What kind of projects can be made with C?

>he still doesn't know how to pirate pdfs

>watching presentation
>presenter has a fidget spinner

I shit you not, this was the easiest way to identify the person that never did anywork in the group project (uni)

Literally everything

prove it.

Reinventing the wheel. C programmers are the only ones who think it's normal to write your own linked lists.

I can't find a torrent for it. Also, some user in a /fpt/ said he was going to share, but I haven't seen links yet.

JS-tards just import a library for it

anything that doesn't involve averaging 2 integers

>/fpt/
that shit's still alive?
I remember it dying on the second day.

>things that didn't happen
/fpt/ lasted throughout Christmas, after which all the fp anons got back to work

This user: archive.rebeccablacktech.com/g/thread/66002448/#q66002494

^What he said

Most commonly and ubiquitous though are embedded systems. If its electronic and doesn't have an operating system it's most likely written in C.

You can do anything in Haskell, as long as you have side effects in your code. But because one of the principles of functional programming is 'no side-effects' you have to violate the very paradigm the language is based on. So as long as you accept that to write real-world code with Haskell you will introduce side effects, it's fine. But at that point you have to ask yourself if it's even worth it to code in a functional language anymore. If you're going to have side effects anyways, why stick with Haskell? The answer to that question on Jow Forums is that there's no point. The real world answer is that it can still be valuable to have a mostly functional system despite side effects.

Ahem.. better(worse) version
WriteLine(ReadLine().ToLower().Trim().Aggregate("", (w, n) => w + $"{(n == ' ' ? " " : $":regional_indicator_{n}:")}"));

fake news

Thanks

>what is IO

Turns out, I don't know much about hardware. Is there a nice long video tutorial explaining the spec details of modern PCs? For example, Socket types, slots, bus etc.

Watch videos for A+ certification

>video tutorial
lol

c# and sql. I feel like I've been sick of sql for 6 months.

A drone delivered my shoes today pic related, didn't know they were already using them for that.

But yeah basically look and realise you might have a deeper grasp of sql but you can never achieve my level of fabulousness that's about it really.

Attached: shoes.jpg (3226x2420, 1.77M)

Those are generally pretty basic
Video is quicker for me

I am making a very comprehensive and s scaleable system hardware detection/monitor tool (POSIX).

throw the red ones away

I wholeheartedly agree with this
A fuck sepples too while we're at it

Use glm

>high heels
Why. That shit looks painful.

What do you want to do, statistics or graphics stuff?

Linear algebra.

HA HA HA HA ALSO
FUCK YOU ANTI-OOP FAGGOTS WITHIN RUST CORE DEVS
I'm balls deep in an inheritance hierarchy rn.
For example, Ryzen 1700X
It's a hardware
an AMD hardware
an AMD CPU hardware
an AMD CPU Zen hardware
an AMD CPU Zen first gen hardware
an AMD CPU Zen first gen 14 nanometers hardwarean AMD CPU Zen first gen 14 nanometers hardware that sits on either of AM4 and TR4 or SP3 sockets
It's a base class for Raven Ridge class
Which is, however Zen2 class that derives from AMD CPU base class

fffuck you hip faggots, you never make useful and comprehensive software!

Attached: 1518199099507.jpg (480x472, 46K)

>this is what OOP does to your mind

Attached: 1526051529523.jpg (229x220, 6K)

kill me 2bh
it's not easy, I am going insane

get help

Attached: karen haskell.png (1280x719, 818K)

AND YES, I'M TALKING MULTIPLE INHERITANCE, MI FROM 4-5 ABSTRACT BASE CLASSLESS IN TEMPLATES C++
I tried D, won't let me do MI

My old friend C++ never rejected me

I haven't slept in the last 19 hours

>MULTIPLE INHERITANCE
absolutely gross

But what features do you need?
Decompositions? Solvers? Big matrices? Use Eigen or Armadillo.
Multiplications of 3x3 or 4x4 matrices? You can use something simpler like GLM.

user, what the fuck are you doing?

You can make that a 1 liner in C# using reduce. So much for your superior language.

AHAHAHAHAHAH
>Ryzen 1700X
Inherits from sockets, friend of PCIE and SATA, inherits from FinFET, inherits from amd64, inherits from personal

I'm making the most comprehensive hardware admin/detection/monitor tool for POSIX to date.

Can somebody explain to me how to switch compilers on Visual Studio 2017? I feel like Microsoft are bullshitting me. I've read this blogs.msdn.microsoft.com/vcblog/2017/03/07/use-any-c-compiler-with-visual-studio/ but it is of literally 0 help.