/dpt/ - Daily Programming Thread

What are you working on, user?

Previous thread:

Attached: 1523540960971.png (1902x3854, 474K)

Other urls found in this thread:

cmake.org/Wiki/Eclipse_CDT4_Generator
stackoverflow.com/questions/15977031/java-ternary-without-assignment
msdn.microsoft.com/en-us/library/bb776913(v=VS.85).aspx
twitter.com/NSFWRedditGif

First for sepples

trying to do babby-level dynamic programming problems and struggling

>what are iterators
>what are concepts

textboard (later imageboard) in python+flask
any free hosting to test on beside Heroku? no need for big storage for now

I know this feel

>iterators
>allows data structures other than specified ones
>allows data types other than specified ones
nice try

Again, a dependent imperative type theory.

Do you need to have it accessible online? A VM always works. If you can afford 10$ a month you can buy a VPS from linode or something and it will be more than enough. Definitely worth the money.

I don't know any free hosting besides github.io pages for static things.

>What are you working on, user?
Screwing around with this script I started yesterday to download and rotate wallpapers from /w/ and /wg/. Also playing with my image glitching script.

Attached: scrot.png (1920x1080, 1.75M)

modafinil trap has man shoulders. Not a trap at all, really, just a bloke in a dress.

MyLanguage -gt YourLanguage
fite me faggets

any tips or resources?

What do you guys listen to while coding?

I'm giving Nightcore a go

asmr or industrial. I find lyrics distracting.

wut

>What are you working on, user?

I meant, what is that

>Eclipse doesn't support CMake yet

Attached: 1517919983256.png (205x269, 29K)

It's almost like C++ isn't actually very expressive and is really just a meme in general :^)

Attached: 3116044489.jpg (300x300, 20K)

The male gender is a meme.

Attached: 1521777229187.png (467x462, 239K)

I cant wait until TWENTY TWENTY SIX when C++ has reflection, concepts, co_routines (LITTERALY a 10 LINE GCC PATCH), networking, and gimped ranges

and then ten years later when its supported on production compilers
fugging kill me

Attached: .jpg (476x454, 52K)

use boost

Another way to put it would be: a functional (higher-order) & imperative language with dependent types for formal verification.

I'm working on homework for a statistics class disguised as a "Performance Analysis" class

I chose to write a math lib in c99 just cuz i saw another project do it

You don't need that shit. Go beat your dick to hentai of your mother

>muh boilerplate
kys
you abstract it away in a module

ur retarded

don't post wojak

PEBCAK
cmake.org/Wiki/Eclipse_CDT4_Generator

Checkin this big ass number

Just found out C#.NET offers a simple way to work with SSE SIMD through System.Numerics. Pretty fucking NEAT!

typedef struct chuck {
int feed;
int seed;
} sneed;

I want to create a relational database software (yes sth like mysql, microsoft sql etc) i'm looking for resources online but they don't get deep enough into the subject if anyone here is familiar with it a book reccomendation would be appreciated
>inb4 hurr durr that's too big of a project , hurr durr why not use am existing one

just use sql u retard its so fast

after seein what c++ is like with these features why would I ever want to use c++14
im with her now

Read about ACID compliance and then rethink ever wanting to make your own dbms.

But what if MyLanguage and Your Language are the same.

Reminder that C > Java > C# > ASM is the ultimate beginner progression to learn programming.

>going from java to java
what's the point?

>Java > C#
one makes the other redundant.
There's no FPL in there as well.

[C#]

I'm using System.Drawing to draw Sierpinski's Triangle recursively. As of right now the final triangle just pops up in a windows form, but I would like to see the animation of it being built. How can I accomplish this? I've never done graphics before.

>tfw went from Java > ASM > C > JavaScript > C++ > C#

Is this not a valid way to use the ? operator?
input1.length() < input2.length() ? sumArrays(input1,input2): sumArrays(input2, input1);
[\code]

Is the only way to accomplish this by doing
if(input1 < input 2)
sumArrays(input1,input2);
else sumArrays(input2,input1);

Language is Java btw

I'm trying to make my first mobile app using Xamarin forms. I've never done mobile development, cross platform development, used visual studio, or c#, so this is shit going.

Order of operations
Your stuff says:
input1.length() < (input2.length() ? sumArrays(input1,input2): sumArrays(input2, input1)) ;


Try this as the condition:
(input1.length() < input2.length())

stackoverflow.com/questions/15977031/java-ternary-without-assignment

You're supposed to have assignment or return before the ternary expression, and according to this link, it's an error to use void functions in those parts of a ternary expression.

pls help

Make a custom ternary operator function LOL

There should be a better serialization utility, right?

Attached: Screenshot from 2018-04-16 10-46-38.png (1406x2158, 326K)

I recommend using wpf and drawing everytime you update the tirangle. WPF bindings are god tier.

Thank you

beautiful yet complex language

>auto
>friend
>incorrect operator overloading
>reinterpret_cast
F- see me after class.

It's far from beautiful. I like it though. I like ugly girls too.

I cringe too hard when I see auto.
Go back to python.

>>incorrect operator overloading
std::huh?
>auto
>python
std::experimental::huh?

go back to python

>auto
>python
std::experimental::huh?

>type inference is dynamic typing

Attached: 1522280161860.jpg (481x523, 49K)

why the literal fuck are you using an Student r-reference instead of const Student r-reference you braindead little shit?
std::mcfucking::kys(std::you, std:end);
throw std::logic_error("fuggggg");

No problem. Also, a better light weight approach is drawing on a canvas element yourself (need x, y, brush thickness and color) instead of setting and updating an image everytime (which can be troublesome when binding to the image element because you need an ImageSource and for that you need to init a bitmap and write to its source and end the init).
I think you can also do this in winforms.

>using an Student r-reference instead of const Student r-reference
That's not an incorrect operator overloading. In fact, for something as trivial as that, modern compilers should automatically treat it as a const reference. Are you dense?

what do you call a shitty type system?
dynamic typing.

>relying on compilers to not have horribly evil subtle devious bugs
ignorance is truly bliss, i wish i was dumb as you so everything is happy and sunshine.

I see that you are implicitly retracted from the claim that the op overloading is incorrect.

The more you learn...

kys Ctard

poor (non defensive) style is incorrect code.

I tried to do this in C# but apparently it doesn't work:

int[] colourRules = new int[8];
colourRules = {0,1,1,0,1,0,0,0};

What should I be doing?

int[] colourRules = new int[] { ... };

static constexpr int colourRules[]{0,1,1,0,1,0,0,0};

I should have mentioned that my intent was to have the second line of code be optional, but guarantee that colourRules would have 8 values.

Anyone got any ideas for an alcohol related project? Given how much I'm drinking nowadays I might as well be productive while I partake.

constexpr int length = 8;
static constexpr int rules[]{0,1,1,0,1,0,0,0};
static_assert(sizeof rules / sizeof *rules == length);
int colourRules[length];
std::copy(rules, rules + length, colourRules);

real-time blood alcohol monitoring, with alerts to warn you if you're getting sober

int[] colourRules = new int[8];
...
colourRules = new int[] { ... }

Tried that already.

I tried it again and now it works even though I could swear I did it exactly like that.

Dynamic typing isn't necessarily bad. If you have first class types it's just lazily checked dependent typing.

Done poorly, you get JS or PHP.

int[] colourRules = {0,1,1,0,1,0,0,0};

you should reinterpret_cast to std::byte* or unsigned char* for accessing object representations

are you seriously so retarded that you think type inference and dynamic typing are the same thing?
and he's using reinterpret_cast in one of the few scenarios you're actually supposed to use it

that's an lvalue reference, not an rvalue reference. it should be const, though

FYI it should be named ColourRules according to C# standards
camelCase only for function arguments, PascalCase for everything else

Just finished first year of CS, basically one year of C++. Next year we learn more, and we're using java instead of C++.

I'm getting a head start now. Should I go with latest Java 10, or Java 9? Or...Java 8? I have kind of gotten the idea that Java is like Python, and that half the industry is a bunch of fucking spergs that can't move on. Ultimately, this affects me because I need to know what version to learn with. Does it even matter that much?

I have a struct with a single type (let's say, int) and I want to implement a general method to get/set a the int.

For example, student.getGrade() should yield a mutable reference to the int and student.getGrade() should yield a constant reference to the int. How should I implement this?

I'm thinking of creating an enum class for mutability. Then create a templated method for getter/setter. Then specialize template method according to the mutability.

And no, I don't want to create separate getter/setter. I'm just revisiting C++ after a long time and need to get my hands dirty with templates and all sorts of type autism.

>Find site with Java applet from 2005 that I want to run
>Install JDK 1.4 from some Korean university website and try running it on Internet Explorer
>Crashes
>Download the jar and use a decompiler on it
>Open it in Eclipse and make a few modifications
>It runs

Thanks for reading my blog.

god damn c's fuuuuuuuuuuuuuuuuuuuuuuuuucking arrays with only one type

This is how you open a file select dialog in Windows.

Attached: 2018-04-16-05-26-msdn.microsoft.com.png (885x1661, 97K)

Are you a retard?
That's a holdover from C. Functions that deal with system calls often use return codes for error handling.
You're supposed to CHECK THE ERROR and then continue, retard.
You don't need to stack conditionals like that.

>IFileDialogEvents
user, it's sepples.

Java is nothing like Python. Python has broken itself no less than 3 times in its short lifespan, making each milestone version incompatible with the last.
Java is extremely good at avoiding this, and at the worst you'll get the compiler bitching at you about deprecated features in old codebases. Anything you can do in Java 6 you can do in Java 7 8 9 or 10. All these updates do is add new ways to do this or more efficient things like lambda expressions.

It's not mine code by the way.
msdn.microsoft.com/en-us/library/bb776913(v=VS.85).aspx

>C libraries aren't used in C++ all the time hurr
Nigga I know that Microshaft only has a C++ compiler
Because it's supposed to be backwards compatible with C
It's an example, not the gospel.

That looks like its straight off MSDN

>That's a holdover from C
>holdover

The API accepts a C++ class as an argument. It's not C.

autism and pedantry 101 right here
functions that return status codes are a holdover from C

like talking to a goddamn ESL

Elixir master race

How the fuck is this a holdover from C if it's MEANT to be used with classes? Not just stylistically, the functions accept and register fucking classes and all actions are performed by calling methods of those classes.

Just do something like
struct heterogeneous {
int n;
int *sizes;
void *elements;
}

>short lifespan
Python is older than Java.

What the hell do you consider a long lifespan if Python's is short?