DPT - Daily Programming Thread

Previous: This is the official thread. All others are invalid.

Remember, this is the daily _programming_ thread.
This means you are only allowed to discuss modern C++ and cute 2D girls.
All other languages go to Traps, "girl (male)"s, 3DPD, fr*gposters, and w*jak posters go to Please remember to vary your cute 2D girls, don't just post the same characters from the same shows/manga/VNs/whatever over and over again that people have already posted a quadrillion times. Post something that hasn't been posted much before, make sure it's cute and high quality.
Please refrain from posting or discussing code that isn't zero overhead.
C """programmers""": You are not allowed to post or discuss C code that isn't also valid C++, as that isn't programming related. You are still not allowed to explicitly discuss C only, as that is of course not programming related either.
Remember to appreciate lovely and cute 2D girls and tease their cute little nipples into submission by rubbing them gently and lovingly with your hands and licking/sucking on them with your tongue/mouth.

No one fucking cares what you're working on.

Attached: 1510597868689.jpg (1000x1400, 164K)

Other urls found in this thread:

pastebin.com/RLvH1H8n
git.savannah.gnu.org/git/womb/hacks.git)
twitter.com/SFWRedditImages

Why aren't you using Haskell, Jow Forumsirls?

Attached: 1537198279816.png (663x801, 174K)

Because Haskell isn't Programming.

I'm too busy being employed.

HELP user I NEED TO WRITE THIS PROGRAM TILL THE END OF THIS WEEK! I VE ALREADY COMPLETED SOME PART OF IT BUT STRUGGLE TO EXECUTE IT DUNNO WHATS WRONG SEE FOR YOURSELF pastebin.com/RLvH1H8n FUCKING TEACHER DOESNT WANT TO ACCEPT IT WHAT A KEK RIGHT?? PLEASE HEALP ME user DONT BE A CUK

>looking through the training data
>1130 (0.6%) of the images are classified as "Eye Color: Unknown"
The fuck? Am i missing something here? This guy's eyes don't look very "unknown" to me.

Attached: 1516535367742.png (480x600, 428K)

rewrite it in haskell

I'm investigating the relationship through linear logic between Huet's zippers and focusing in sequent calculus.

please use
>/dpt/ - Daily Programming Thread
next time

Maybe the light reflection in the iris befuddles the classifier?

How about you fuck off back to r*ddit instead.

dunno, looks a bit weird. kinda brown, but not really.

>Ledditor tells user to go back to raddit
Heh

I am working on a Python script which can currently:

>take the title of an article, search google scholar for it, extract the bibTeX citation, and append it to my .bib file
>take a url, make a citation for it, and append it
>take a HTML table and output a nicely formatted LaTeX table

I'm supposed to be writing an essay but oh well, I feel productive.

This isn't the classifier, this is a human.
It looks light brown. But okay. How is this "unknown"?

Attached: 1514187311259.png (480x600, 409K)

>trying this hard to fit in
all you need is make a decent OP, for once

Attached: 1512463932957.jpg (1277x720, 207K)

assembly is a pain in the ass
I'm glad most embedded is done mostly in C

Attached: 1540385757022.jpg (600x800, 46K)

Currently working on a Linux daemon that reads incoming text messages and compares the phone number to an ACL, though I'm having some problems with compiling from the provided libraries as I'm not too familiar with C++.

Attached: preach.jpg (450x200, 41K)

C is a pain in the ass, I'm glad some embedded is done mostly in haskell

Hmm, if you could help me out here I'm just slightly confused on something.
I was reading through your posts, but it's not entirely clear who you attempting to quote.

Wouldn't mind some clarification on this so I could better address the content of your posts, thanks.

This is a thread. Not a board.
Do not abuse forward slashes like it's a board name, because it fucking isn't.
Stop be a cancerous memeing faggot.

JavaScript rocks!

Attached: js-rocks.png (1000x494, 368K)

Here's another great question: What race is this fellow?
If you answered anything else but "unknown", you're wrong.

Attached: 1540536381587.png (480x600, 452K)

I can't tell whether you're more new or more retarded. I guess it's a mix of both.

56%

I'm not familiar with different monkey species.

Friendly reminder that Sepples is shit. Use regular C instead.
Bjarne himself has spoken and Sepples is actually a prank.

Attached: 1539475890985.png (1423x2643, 255K)

Nobody cares about your opinion on meme X.
This is how it has been done for years, this is how most people's filters are set.
If you don't like it you can always leave to another imageboard which doesn't do that kind of things.

Chimpanzee.

Hey Jow Forums, in Python, what's the best way to wrangle with data in lists of dicts with lists of dicts in them?
Right now, I've got something retarded like:
for prospective in input_data:
if any(entry["title"] == prospective["title"] for entry in masterlist):
for entry in masterlist:
if entry["title"] == prospective["title"]:
entry["locations"] += [{"path":exepath, "ip":prospective["ip"]}]
else:
masterlist.append({"title" : prospective["title"], "locations" : [{"path":exepath, "ip":prospect["ip"]}]})

where I'm basically just trying to incorporate input_data into masterlist while checking if a title already exists so I don't duplicate an entry. I know there has to be a better way to go from checking if a record exists to editing said record if found.
I thought about.
for prospective in input_data:
flag = False
for entry in masterlist:
if entry["title"] == prospective["title"]
flag = True
modify_entry()
if flag == False:
create_new_entry()

But setting and resetting a flag just feels so boomer. Or should I just quit fucking around and define some classes?

>This is how it has been done for years

Attached: ddddddddd.png (1024x900, 78K)

too bad you can't downvote the memes you judge cancerous here.

For me, it's FizzBuzz in Chapel.

Attached: 1505532094927.png (1024x768, 227K)

this is /prog/ though

is there a reason why you're not using a library like pandas which already has data structures defined?

>This is how it has been done for years, this is how most people's filters are set.
Yeah no one cares about redditor faggots. Non retards just search for dpt or daily or something.
And no one cares about people who are so fucking thin skinned that they unironically need to filter things.
Kill yourself.

I think your second code snippet looks fine.

The 'dpt' can be used in a link though, like

>And no one cares about people who are so fucking thin skinned that they unironically need to filter things.
being this new
>Non retards just search for dpt or daily or something.
being this inefficient

You're point?
Try clicking that link. This thread shows up just fine.

>dpt is somehow less efficient than /dpt/
Ok m8
>being this new
Not sure what you're getting at, but only retarded idiots use filters. Literally who gives a shit.

Exactly. The forward slashes in board names come from their use in URLs, so since 'dpt' can be part of a URL too, I see no problem with the slashes.

>calling others redditor faggots
>doens't know how the site works

You have no idea what you're talking about. This isn't the only use of filters.

Attached: 1530129122030.png (450x720, 400K)

I think I solved the mystery. For some people, they just can't be arsed to enter the data. So then everything becomes "UNKNOWN".
That's O(n^2), I don't think it's the best solution.
Try something like this:
check = {}
for entry in masterlist:
check[entry["title"]] = True #assume there's only one of each title in masterlist
for prospective in input_data:
if prospective["title"] in check:
modify_entry()
else:
create_new_entry()

Attached: 1510303536322.png (1063x620, 302K)

>Not sure what you're getting at
lurk moar fagoot

/dpt/ can we stop fighting over autistic details about the thread and go back to fighting about autistic details about programming languages

Attached: 02.jpg (720x746, 85K)

>Try clicking that link.
I did and /sqt/ matches

What shitty logic.
In that case explain why there should be a / at the end and not only one at the beginning.

Ok?

not until newfags stop ruining every fucking OP

How can I model a graph with vertices that can be traversed and aren't cul-de-sacs but no further travel is allowed something like intelligently restricting the open set? Inserting virtual cul-de-sacs that still resolve to the same end-point?

Attached: am i stupid.jpg (413x427, 43K)

Attached: 1489262492823.gif (264x320, 929K)

That's their fault because they have a link to dpt in the OP.
Not my problem.

That's why /dpt/, newfag

The previous two threads (not including the shitty lua one) where doing perfectly fine until you literal reddit tier faggots showed up and started pushing your shitty memes on the thread title.
Go back to wherever the fuck you came from.

Again, before calling other redditfags, learn to use the website. Once you actually proved that you know how filters work, maybe I'll consider your opinions.

>Some thread decides to contain /dpt/ in it's OP
>That thread now shows up when searching /dpt/
What now faggot?

#68260462
>Reddit reeddit reditt REDdit reddiiittt
/dpt/ was doing fine before you brought your newfag ass in there

tell that OP the same I told you
lurk moar or leave

>literal
>tier
use your words my dude

Attached: haskell anime.png (498x707, 368K)

>maintaining a huge code-base that was not written by you

not possible

Attached: 1540763425471s.jpg (171x250, 8K)

How big is huge?

Filter on subject field. Problem solved.
Again, no one cares about people who's filters depend on memes.
And in fact, no one cares about people who uses filters. Literally just type dpt in the search bar and click the right thread. That's how every non retard does it.
Now fuck off.

You're encouraged to boycott this redditor OP and use the sensible thread:

I learned haskell, (or at least enough to use it comfortably) but I had/have no reason to use it. None of the projects that I am interested in doing can be done using haskell.

Fuck off faggot, your thread is shit. This thread is comfy with the cute anime girls.

So a red black tree is just a mechanism to rebalance trees? Somehow I thought it did balancing by changing how a colored node was traversed.

what are you working on Jow Forums?

code base for a whole university and all departments.
dealing with ETL, excel worksheets, PostgreSQL, SAP web services, emails

it's hell

How many LOC?

i don't know. LOC here isn't the issue.
the system integration is very complex.

it's basically a very complex business intelligence project.

Attached: ETLTesting_4.jpg (1254x742, 283K)

again, you don't know what you're talking about, it's embarrassing.
lurk more or leave

You have no argument.

glorious
is it real?

No.

proof?

How do I git gud.
I want to be rockstar coder.

the post you gave proves you don't know how to use this website, that's enough of an argument for me
you on the other hand, apart from redditcalling, have nothing

leetcode daily

cat-v.

proof is I've spent too long with C++ to have been memed this hard

>he doesn't use thread highlighting
pleb

Attached: 1528817867726.png (317x329, 58K)

>he doesn't have a bookmark that goes directly to the /dpt/ thread

heh

Useless feature. And it's easily solvable by filtering on the subject like you should have been doing from the beginning.
Literally not my fault you're retarded.

Verifying linked data structures with zippers using linear type theory as a program logic.
// capability for whole doubly linked list
data List : Type -> Type where
Nil : List A
Cons : A -> List A -> List A

data Zipper : Type -> Type where
Head : Zipper A
Next : A -> Zipper A -> Zipper A

// capability for doubly linked list node
type Node A = Zipper A * A * Node A

// "head" pointer for whole doubly linked list
head : List A -> Node A
head (Cons x xs) = (Head, x, xs)

reverse : List A -> Zipper A
reverse = h Head where
h z Nil = z
h z (Cons x xs) = h (Next x z) xs

// "tail" pointer for whole doubly linked list
tail : List A -> Node A
tail (Cons x xs) = (reverse xs, x, nil)

// "previous" pointer for doubly linked list node
previous : Node A -> Node A
previous (Next x z, x', xs) = (z, x, Cons x' xs)

// "next" pointer for doubly linked list node
next : Node A -> Node A
next (z, x, Cons x' xs) = (Next x z, x', xs)

Here's what the structures would look like in C, as an example of some implementation code. Should be familiar for anyone who has implemented a doubly linked list before.
struct List {
struct Node *head;
struct Node *tail;
};

struct Node {
A element;
struct Node *previous;
struct Node *next;
};

You can see that the functions I commented as "pointer" in the specification code line up with the pointer fields of each structure. If the function would be undefined at a certain input, the pointer would be null. To actually verify procedures, the implementation language will have types that are dependent on terms of the specification language, so a procedure that e.g. inserts an element representing "x" at the front of a list will take a list representing "xs" to a list representing "Cons x xs". Linearity means that dangling pointers, memory leaks, etc. will be statically prevented since you cannot reconcile them with the rules of the type theory.

bro what the fuck

this


fucking go back

Again, not my fault you're retarded.
Filter properly.

>goes to /dpt/
>/dpt/ doesn't come at him
I usually fetch web pages from other sites by sending mail to a program (see git.savannah.gnu.org/git/womb/hacks.git) that fetches them, much like wget, and then mails them back to me. Then I look at them using a web browser, unless it is easy to see the text in the HTML page directly. I usually try lynx first, then a graphical browser if the page needs it (using konqueror, which won't fetch from other sites in such a situation).

fuck off stallman

this is my bookmark

Attached: 665656.png (369x317, 7K)

People always complain that you can't write a doubly linked list in safe Rust, and here's my response.

>Rust
>posts Haskell and C

hmmm

Yes (You) made it clear you're too smart to lurk, here are your (You)s you can leave now

It's not about doing it in Rust, it's about the principles behind formally verifying such data structures. That syntax is much closer to Agda than Haskell, and in reality the implementation language won't be C.

Reminder that you can somewhat emulate concepts in C++17 by abusing decltype and SFINAE.
If an expression inside a decltype is invalid after substitution, it counts as a substitution failure and hence SFINAE kicks in.
Here's a "concept" that detects whether a type supports some basic arithmetic operations:
namespace _is_arithmetic {
template
auto eval(T x, T y) -> std::bool_constant<
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v &&
std::is_convertible_v
>;

template
auto eval(...) -> std::false_type;
}

template
constexpr bool is_arithmetic = decltype(_is_arithmetic::eval(declval(), declval())){};

Here's another concept that detects whether an object can be iterated over.
namespace _is_iterable {
template
auto eval(T x) -> std::bool_constant<
is_iterator &&
is_iterator
>;

template
auto eval(...) -> std::false_type;
}

template
constexpr bool is_iterable = decltype(_is_iterable::eval(declval())){};

The limits are endless. Any expression involving the parameter will work.

Attached: 1525774507614.jpg (600x600, 206K)

Lmao no argument.

Man I want to FUCK a spider

Why do people take this horrible meme language so seriously?

Because it's the most powerful and efficient programming language on Earth.

What would be better:

writing a highly configurable and general chess engine using extremely abstract code

or

using metaprogramming to generate simple chess engine code from config files?