/dpt/ - Daily Programming Thread

This is /dpt/, the best subreddit of Jow Forums

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

/!\ ** Read this before asking questions ** /!\

mattgemmell.com/what-have-you-tried/
catb.org/~esr/faqs/smart-questions.html


What are you working on?

Attached: timetocode.webm (1152x648, 2M)

Other urls found in this thread:

onlinegdb.com/
youtube.com/watch?v=FTuOnLb8zOc
en.wikipedia.org/wiki/Observer_pattern
boards.4channel.org/g/#dpt/
clhs.lisp.se/Body/f_dir.htm
twitter.com/NSFWRedditVideo

dumb umaru shitposter

Attached: 1533741399202.jpg (676x719, 66K)

How to debug?

onlinegdb.com/

how do I structure a query to allow for dynamic (multiple) filters over a calculated field in a dashboard?

I rate your github/gitlab/bitbucket on ten

Attached: 9YmKi4i.jpg (1506x2048, 361K)

Hands up baka! Bully JavaScript one more time and I'm gonna get ya!

Attached: 480e4ee6fb4e76437df28b707846f7ff.jpg (736x1104, 73K)

Terry would have loved javascript

Attached: javascript.jpg (659x317, 41K)

>using loose equality operator and expecting it to not work like it's supposed to
You are the brainlet here, user

x = y
x = z
y ≠ z

Attached: autcsgrad.png (369x406, 71K)

I built a tool for solving sudoku puzzles some time ago back when I was really learning C++. I feel a little more comfortable with the language now and would like to recreate it with some more advanced topics.

I want to make constraint propagation implicit, if that's the right word. That is, I want to detect and fill in hidden singles throughout the solving process without having a function the explicitly traverses the 2-D array, calculate possible values, and determine if it's a hidden single or not.

To do this I was considering the Publisher/Subscriber model. Five classes would be created: Puzzle, ThreeByThree, Row, Column, and Cell. All Cells are publishers. Each ThreeByThree, Row, and Column are subscribers to all the Cells they encapsulate. Whenever a Cell is assigned a value it notifies its ThreeByThree, Row, and Column, which in turn tells all cells that belong to that group of that the set value is no longer a possibility.

I'm not sure if this is a good way to go about this. I'm mostly looking for a way for a child to communicate to a parent.

Any ideas?

there should not be a loose inequality operator

if i recall correctly, with the pub/sub pattern, both the pub and the sub shall have no idea of what sent/recieved the message. only the message itself is important, not the sender/receiver.

youtube.com/watch?v=FTuOnLb8zOc

Almost done with my game.

Attached: screenSample.png (2736x1824, 740K)

Debatable. It has its uses.
Also, anyone who has been in contact with JS for more than a few days will know about its shortcomings and promptly stop using it.

>What are you working on?
robot.
Some fun before inverse kinematics. My head does not compute inverse kinematics kode today

Attached: 06_gamepad_2dof.webm (1280x720, 2.33M)

Interesting.

Attached: 1507743365056.png (255x223, 60K)

Looks like a fucking machine.

it is. Fits pretty good inside my real tight feminine (male) ass

Attached: 01_leg.jpg (3000x2000, 1.83M)

How the hell is it possible to make something like a getter inline in c++?

If I understand things correctly inlining removes function call overhead by having the compiler insert the code directly where it is called.

How does that make sense for getters? A getter is an interface to access a private field. How can you possibly replace that by direct code?

the absolute state

memory has no concept of private field.

Is node.js actually good at I/O performance?

I assumed this inline stuff happened during preprocessing.

I think it depends on your level of abstraction. I have seen some cases where a distribution server acts as a middleman between Publishers and Subscribers, in which case what you've described is certainly true.

Other examples that I've seen (and these are more in line of what I was thinking of doing) have Publisher and Subscriber interfaces. A Publisher keeps a list of subscribers and a Subscriber implements an update function that makes sense of the latest publish method. The publisher then does something like this when posting a message:

for all subscriber in subscriber_list
subscriber->update(message);


...or that's at least how I'm understanding it.

Shit OP, never post that garbage again.

It's using libuv, so absolutely.

en.wikipedia.org/wiki/Observer_pattern

inlining functions happens way after preprocessing

Then you're not using node.js faggot, you're just using C.

No.
It happens during optimization.
Optimization happens after semantic analysis.

kk, then I get it. Thanks.

There could be some cost with V8 between JS and libuv itself.

inlining is simply replacing a call site by the called procedure code. a method is nothing else than a procedure with abstraction breaking semantics, after all.

Just read over that article. Thanks for the link; I wasn't entirely sure if there was a difference between PubSub and Subject/Observer besides the name.

Is there a specific section you wanted to highlight from that article? Am I thinking about this problem incorrectly?

>That comfy feel when watching Nascar while programming at your home desk

Attached: 1557013301102.jpg (4032x1960, 2.34M)

enough fun for today.

Attached: 07_gamepad_3dof.webm (1280x720, 2.67M)

A Java GUI for a homework assignment. It's ugly and I don't know what to do about it

Attached: JavaGUI.png (717x435, 25K)

observer pattern, the subject directly calls and manages its observer.
for observer in observers:
observer.notify(...)


pub/sub pattern, the publisher a message to a handler that will then resend that message to its subscribers.
messageHandler.enqueue(...)

Well, for starters, either ditch the gradients and make them flat color like the windows header or make the header a gradient. In any case, if you have any way of changing the gradient, do it right now. That thing is ugly. Either make the white color and lightish blue perhaps with low saturation or make the dark blue much lighter

there was a setting for native look and feel.

When i am using a python application inside a virtualenv can i import libraries that i have installed globally or nah? I have numpy and pandas globally installed but i cant seem to import them unless i install them in the virtual environment also

Attached: 367373467.jpg (477x477, 41K)

Came up with an alternate HTML syntax.
(html){
(head){
(meta charset="UTF-8") // {} is optional
(link rel="stylesheet" type="text/css" href="/style.css")
(title){Dumb website}
}

(body){
(div id="links"){
(a href="/a"){a}
(a href="/b"){b}
(a href="/c"){c}
}

(h1){Welcome to my dumb website}

(img src="/cute2dgirl.png")

(p){
blah blah blah.
all newlines ignored.
whitespace between words are collapsed.
parentheses have to be escaped \(like this\).
(br)
^ explicit newline.
}
}

(script src="/main.js")
}

Thinking of writing a parser for this some time and make my own lightweight layout / styling engine for a GUI framework I want to create.

that's reddit markup

?
Why is it reddit markup?
Keep in mind I don't browse reddit

Is Haskell overrated?

Attached: haskell_btfo.png (942x942, 185K)

Any functional bois around here??

Attached: erlang.png (1433x1063, 1.85M)

boards.4channel.org/g/#dpt/

The brackets pain me

What is this supposed to do?

this is troll right?
what is the fucking point?

What would you prefer?

Why the fuck would it be a troll, retard?
HTML is both trash to look at and trash to parse.

Do you need to have brackets at all? Maybe I'm biased because I'm a fan of Python & SASS

The brackets definitely improve things. Having them doesn't impose whitespace requirements.
Example, that list of links, without brackets it'd have to be
(a href="/a")
a
(a href="/b")
b
(a href="/c")
c

And that's just fucking disgusting.

No I'm fine with the braces, just not these -> (

Oh. Those are called parentheses.
I originally thought up the syntax without them, but
1. it looks really weird without them
div id="links" {
a href="/a" {a}
a href="/b" {b}
a href="/c" {c}
}

2. more importantly, it makes the grammar ambiguous.
br // Is this a line break or just the text "br"?

Please for the love of god insert this before any UI related code runs
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception ignored) {
}

I can't believe people actually write in Java.
That code is just disgusting.

They're also called brackets you pedantic fuck

Shut up m8, there's two types of brackets in that code. Don't expect me to magically know which ones you mean.

Yeah I should have said braces, my bad

Redpill me on /dpt/.

All languages are shit and everyone is a brainlet (mostly me though).

Any Lisp pros here?
Can you help me out with directory function clhs.lisp.se/Body/f_dir.htm
I can't find the list of &key options anywhere. I just want to sort the directory result alphabetically

Everyone except me is retarded.

Everyone is an anime girl.

Based realist user.

Attached: 1406230415294.jpg (171x200, 16K)

If you look closely enough, anything is overrated.

>lisp
>pros

Why?

Not necessarily, it's just garbage that idiots lap up so easily on this board, just like when it comes to browsers like Chrome, Vivaldi, Brave, Opera, or the rest of the chrome reskins.

...

yeah but real time programming doesn't mean anything at all.

>reinventing wheels in C
feels good man

Scuffed s-expression

sexpressions are shit

Have sexpressions

Attached: dptw.png (661x716, 74K)

what is as powerful as s-expression but easier to parse?

Why don't you just learn React and get yourself some money? Its easy and in demand.
Instead of being neet smelly anime incels

Attached: download.png (900x675, 61K)

Can't you read?

"Common Lisp specifies ``&key'' in the argument list to directory even though no standardized keyword arguments to directory are defined. "

s-expressions are terrible for html.

>pycharm is free
>rubymine is not
why?

Attached: 1532549462731.gif (370x256, 1.98M)

>every update brings only few several dozen breaking changes
>implying any sane programmer wants to deal with front-soi-end

Attached: 1556823853673.jpg (640x480, 70K)

Yes, OCaml is all you need: it's basically Haskell without the abstract nonsense.

python is popular in academia, especially among scientists. ruby is more popular among web developer.
the latter is more inclined to pay for such software than the former.

When did you ever actually use the loose inequality operator?

just suck my penis a little
fondle my balls
and return semen if cum

And also without multithreading.

>"Pajeets in CompSci classes aren't terrib-"

Attached: pajeet_database.png (979x610, 121K)

Attached: 1420792230547.jpg (468x713, 53K)

Would you guys be interested in a terminal client for Hacker News?

Attached: hackernews.jpg (940x192, 22K)

what the fuck

>"""free"""
PooBrains products(the RedHat of IDEs) are bloated proprietary garbage. It is amazing how many "open source enthusiast" idiots took the intellipoop bait and go as far as shilling for paid versions >for free and they are all happen to have broken English with student discount.

Attached: 1556604291484.png (330x274, 105K)

What does the return of ifstream::get() look like if I'm reading a binary file? [spoiler]I don't want to have to write a unit test to find out.[/spoiler]

IT
JUST
WORKS
(and looks better than vim/emacs)

I want to kill myself. I live in a shitty poor country with no industry and I got all this useless information in my head (well actually it would be extremely useful if someone would let me actually apply it) but it's never enough.I never have enough experience/detailed knowledge about some stupid framework to be given a job. I fucking hate being a disgusting neet and every single second that goes by I become older and less employable. and I can't even get a job as a code monkey, a job I feel is well below my scientific and mathematical technical skills. I really feel like shit.

That looks like a Nordic language (Danish/Norwegian)

1. IntelliJ is great. You're just too much of a brainlet to see it.
2.
>paying for software ever

Started learning Go for fun.

For some reason I associate it with a nutty, almost chunky peanut butter flavor/texture. Weird because I've never associated any other language with flavors or textures before.