/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1566376219449.jpg (579x819, 51K)

Other urls found in this thread:

en.wiktionary.org/wiki/java#Etymology
twitter.com/yana_kotova_17/status/1165386875005231104
en.wikipedia.org/wiki/Plasma_speaker)
en.cppreference.com/w/cpp/algorithm/minmax
en.cppreference.com/w/cpp/algorithm/minmax_element
twitter.com/SFWRedditImages

there is no algorithmic solution to the twatter scam problem

Attached: 1539324142276.png (828x514, 102K)

Code

Attached: E7607C4D-955C-4CC2-9928-B883C2A97CF9.jpg (400x400, 19K)

Lisp is the most powerful programming language.

If by Lisp you mean Scheme, then sure.

what scam?

>When a group of Sun employees visited a local coffee place, the name Java was suggested, and it stuck.
what does Java mean in this context though? what does it have to do with coffee? or was it just a random word they came up with? I'm an Englishlet sorry

Coffee comes from Java, the island.

it means coffee in Shit Francisco: en.wiktionary.org/wiki/java#Etymology

Anone, please make haste to finish your JavaScript practices, I want to play with you!

Attached: 77da1430a553767d6e1c3116d1b1a496.jpg (1152x2048, 292K)

no it's where the Dutch started growing it in the 16th century, it's not native to Java

is curl bloat

Anone, that better not be jquery.js I see in your project files.

Attached: 1566228438664.jpg (900x1200, 197K)

usually the top tweet under every single elon musk tweet and other famous people, stays up too they're not even trying to fight it

twitter.com/yana_kotova_17/status/1165386875005231104

ok but who falls for this shit

I use Codeforces, they have competitions regularly and every problemset requires explanations that won't give away the solutions but will help you understand the logic behind them to get uploaded. so you can practice with previous problemsets and look up the answer if you're stuck, or practice by joining an ongoing competition

Nothing, I don't know what to do. I will just sit on my apathy and look at the ceiling until I fall asleep.

some people do

I get it now, thanks a lot!

boomers

I have written a doubly linked list.

Attached: 1566307977491.gif (360x360, 1.96M)

good job user. I hope I'll get to be as enlightened as you one day

in rust?

That would be too difficult.

A doubly linked list is just nodes with 2 pointers and some data, what's the matter?

It's a meme as user achieves zen.

I'm doing stuff in Qt right now and I want to know: what the heck is a "mouse grabber"?

I like C!

lisp is a stupid poopy pants language
only C is good

When you program do you have an abstract machine model in your mind (e.g. an infinite series of bytes) or do you try to think about the actual hardware (cache coherency, speculative execution, etc)?

Attached: 1566315229974.jpg (1280x720, 99K)

>implying you can't have an abstract machine model that incorporates those details

I think of ninja turtles.

[laughs in segfault]

abstract when programming
actual hardware when optimizing

Why do so many people write their makefiles with separate steps to compile object files and then link? Like if there's main.c and foo.c, they'll have:
main: main.o foo.o
gcc $(CFLAGS) main.o foo.o -o mainProgram
main.o: main.c
gcc $(CFLAGS) main.c -o main.o
foo.o: foo.c
gcc $(CFLAGS) foo.c -o foo.o

If it was all done in one step, you'd have to recompile your entire codebase every time you made a small change to it.

Math model relationships and just in case optimizations, start to model using hardware awares.

Oh, true. Don't know how I never thought about of that.

Cocksuckers
Lots and lots of cocksuckers
You gotta watch out for dem cocksuckers
They'll suck ur cock right up

>header file defines struct for hardware register
>also defines address and pointer to register
How do you mock the address/pointer in a unit test running on host machine without modifying the header file? I'm using unity and cmock.

neat

man, I'm still bothered at the way linked lists are taught in school and shit
had to explain to a buddy of mine just why anyone would bother with them if getting the Nth item in a list was so expensive and that the size of the pointers are dwarfing the size of the [insert primitive type] that you've got a list of

How do I explore the industry and choose what profession I want? I got a CS degree and got no idea what to do with my life now..

In the earlier thread, we were talking about minmax function and how rust made one guy realise that implementing clone traits was a wrong approach. This message .

After thinking about this, I don't still see how did rust made him realise. In C++ the similar implementation wouldn't compile either if I understood correctly what he meant.

So if your type doesn't implement copy ctr, it wouldn't compile in C++ either, so I don't still see how did Rust solve his problem.

Maybe I'm missing something.

Surely the benefit of insertion and deletion would be obvious?

that shit separated the big brains from the smooth brains in my class

Attached: 1557121358396.png (1280x800, 1010K)

Working on a mock OS in Javascript.
>WHY
because i'm bored
pic related is all there is to it now, it has a simple file explorer, but that's it mostly. More stuff to be added soon.

Attached: os.png (1169x939, 40K)

you dont use linked lists to get the Nth item you brainlet

an OS to surpass TempleOS

Attached: 1558494159330.png (258x258, 63K)

got myself an EEG sponsored from my school. Now my classmates and I are working on a UX tool that integrates Brainwaves

Attached: 1547444306906.png (383x681, 458K)

Hurry up with that machine learning so you can program me to talk to you.

Attached: DSC02777_1.jpg (1280x1809, 310K)

10 days

I think you could get a similar insight with C++, but the fact is that using the defaults (i.e, rule of 0), you would get copies, and would not notice the inherent choice made in the function's API.
If I say
fn min_max(xs:_) -> Option

I'll know that since T is not Copy, I need at least two elements in the container in order to have a result.
Afaik, using concepts in C++20 you might get similar benefits.

Is she full size?

Attached: 1566099525694.jpg (2048x1152, 312K)

Yes but full size and miniature doll friends RISE UP together.

Attached: DTltn84VoAEEDl7.jpg (900x1200, 117K)

Yeah, I probably worded that poorly, this isn't a property unique to just Rust.
I'm not familiar with C++ but it sounds like you could've made the same conclusion in C++ as well.
However, if there is a difference I imagine the difference is more "cultural" than language when we're comparing C++ and Rust. In my experience, when Rust code doesn't compile due to unsatisfied trait bounds it tends to invoke some thought. Partly because there isn't always just one trait bound that could be added that would solve the problem. Partly because adding in trait bounds makes your code inherently less generic and so you tend to prefer to avoid them if you can.
I imagine a similar mindset C++ programmer would have come to the same conclusion .

Though from what I gather it looks like C++'s minmax implementation works on returning references? And I seem to remember C++ ownerships semantics are a bit weird right now? The problem was only really obvious in Rust because of the ownership semantics so if it's more idiomatic C++ to use references everywhere (which are presumably copy) then you probably wouldn't catch this?

sounds cool. i wanted to build a BCI as a school project, but it seemed complicated and error-prone. i built one of these instead (en.wikipedia.org/wiki/Plasma_speaker)

It wasn't a criticism, just curious as it was hard to tell the scale

I need to make an android app with bluetooth connectivity for a device that has a bluetooth classic with a SPP profile.

How do I emulate the fucking bluetooth part of the android phone? The emulator that comes with Android Studio doesn't seem to have this.

Well done. I suggest you try a triply linked list next.

Attached: smug_nenecchi.png (782x1021, 330K)

>tfw your linked list nodes don't have pointers pointing to themselves.
How does one cope being a LinkedList-let /dpt/?

>his lists don't occupy 3 dimensions

finished training my lineart to normal map neural network. looks kind of bad but it was interesting to make

Attached: chrome_ykWyBxZmSK.png (433x234, 110K)

Guys how do you do dependency injection in functional programming?

I have written a doubly linked heapqueue as a rope stack inverted binary tree a star search ackelmann solver

By passing functions as arguments.

Attached: 1565370472325.gif (847x479, 3.06M)

you don't. It's one of those concepts you don't even think about the moment you get away from OOP.

passing functions into other functions is literally dependency injection

Currying

Now that I look at it, the design of std::minmax is pretty weird
en.cppreference.com/w/cpp/algorithm/minmax
And there seems to be another function that works with iterators instead of values:
en.cppreference.com/w/cpp/algorithm/minmax_element
Neither return optional, which is a bit lame.

and you literally don't say "here I am injecting a dependency, to accomplish my goal of dependency injection", because half the time you're passing a function just to loop over a list.

what?

Does that mean that a doubly linked list occupies 2 dimensions?

Attached: zn22p2U.jpg (1200x1200, 305K)

Retarded question: if I have cross-platform code, I can make it compile on Linux and modern BSD easily just by not using gmake extensions that BSD make doesn't have (which is mostly trivial to do). Almost everyone has gcc anyway, or I can take some care not to use gnu extensions (since I'm not doing anything particularly esoteric anyway).
But how would one compile something for Windows? I am vaguely aware of compilers like MinGW; is that the best thing to use, or is MSVC fine? Is there a simple way to get windows builds from a normal makefile?

Should I just say fuck it and use cmake and have it generate everything needed?

Is she trying to gain greater stereoscopic perception?

Attached: 1565224508620.png (1280x720, 582K)

Even my toy lang can make linked lists much easier than Rust. Heck you could probably implement all the commonly used Lisp functions in it and use it like Lisp.
cons a b =: @m[8 a b]
car c =: !! c 0
cdr c =: !! c 1

>_main = list _:
:: list cons 42 0
:: list cons 12 list
_il car list #prints 12
_il car cdr list #prints 42

Only if the head connects to the tail so it forms a circle.

like a variable-wing fighter, she's shifting from predator-vision (active, offensive) to prey-vision (passive, defensive).

Do people who use Qt professionally use the Designer and shit?

Nothing.Nothing at all.

Attached: 1544561173_A-word.jpg (659x511, 71K)

Also I forgot to *pat head*

A singly linked list is 1D by pretty much all definitions I'm aware of: it can be visualised as a line, only needs 1 coord to determine location, etc. The fact that you can't go backwards doesn't really change things that I know of, though I'm not a mathematician by any means.
A doubly linked list is 1D as well: the same properties hold.
A triply linked list is hard to say. I think it's most likely some sort of fractional dimension, like a fractal: I think you could still establish a canonical order of elements and thus navigate it with just 1 coordnate, except you can also "warp" between locations using the third link. If I'm wrong, then it's likely 2D.

A circle is a curved 1D surface

>using an emulator
enjoy your RAM hog
use a real device like a professional, homo

>A circle is a curved 1D surface

Attached: 1564139475771.png (120x120, 9K)

you have only one axis, but it's curved

A circle is a finite line, where the end and the beginning are the same point. You can only move back and forth along one direction (i.e. along the line), and you only need one coordinate to describe any position.

>I think you could still establish a canonical order of elements and thus navigate it with just 1 coordnate, except you can also "warp" between locations using the third link.
That's kind of like a skip list.

Surely by traveling along the circumference of a circle you describe a 2D plane?

What if the circle is filled in?

Not at all. You describe the 1D border of a 2D disc, maybe, but we're not talking about discs.
Same to you.

what if I just put an mp3 player with songs in my website

Attached: 1563510963.5988944_-_8187d409ac2aed5b27f73652c1fafb01.jpg (512x512, 19K)

you can play music trivially with HTML5, so you just need JS (probably) or some forms and CGI to pick the music.

are you implementing it in lisp

was thinking more about the cease and desist part

bloat

nobody is going to visit your crappy website

just do it until you get the letter, then cease and desist

They do indeed shit, and most also use Designer.

Attached: arrest_him.jpg (340x460, 41K)

there must be some other board about law shit on this webzone

I already get hundreds of daily visitors :^)

good point

Dependency injection is about 'service' objects instantiating and passing required dependencies, along with the dependencies dependencies, to whatever class that needs them, without the class specifying what exactly it needs. Just passing a function into another function is not what dependency injection is supposed to be about. You will need some sort of service function set up in a partial application kind of way, like currying