/dpt/ - Daily Perentie Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

dlang.org/comparison.html
dlang.org/phobos/index.html
dlang.org/spec/garbage.html
dlang.org/blog/2017/03/20/dont-fear-the-reaper/
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
wiki.dlang.org/Books
dlang.org/spec/interfaceToC.html
wiki.dlang.org/D_binding_for_C#Introduction
cslibrary.stanford.edu/102/PointersAndMemory.pdf
youtube.com/watch?v=xem8Gn9HOcw
petsovernight.com
twitter.com/NSFWRedditImage

First for C

Ignore post above.
First for C++

Both fine answers, as long as by C++ you mean C++11.

What the name of this problem?

>subset of the integers between 1 and n, of maximal length and no element in the subset the average of other two in the subset

It's the Your problem.

>C++11
Was thinking more of C++17 but that works as well.

All versions of C++ are fucking trash.

>not using C++20
>not using atomic smart pointers and coroutines

plebs out

Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); she's super duper cute; and she's a blast to write in! Say something nice about her, /dpt/!

>Features
dlang.org/comparison.html
>Standard library
dlang.org/phobos/index.html
>GC
dlang.org/spec/garbage.html
dlang.org/blog/2017/03/20/dont-fear-the-reaper/
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
>Books
wiki.dlang.org/Books

...

Stop spamming these threads, you fucking necrophiliac.

>one post a thread
>spam
Nah

How is posting the same stupid shill shit every single thread not spamming?

noun
1.
irrelevant or unsolicited messages sent over the Internet, typically to a large number of users, for the purposes of advertising, phishing, spreading malware, etc.

spam != flooding

It's not. Stay mad that somebody enjoys something.

>RAD studio
>.pas

is that

delphi?

Can I link Ada to D?

Or in simple terms...

Stupid
Pointless
Annoying
Messages

Really
Useless
Boring
Slag

Tomboys aren't lesbians, user.

Says the tripfag.

...

forgot pic

cool clock, ahmed

[x] unsolicited
[x] large number of users
[x] advertising
wow it checks all the boxes

Rubs? Couldn't think of an insult starting with Y?

>blink speed doesn't update until the mouse is released
Disgusting

What do you mean?

There's no Y in rubs

Sorry, user. But dlang-chan is a programming language. And this is a programming thread. Thus it's not unsolicited. If you don't want to see it, just scroll by. I only post it once a thread. Have a nice day.

She doesn't "link" with girls.

Thanks for setting the record straight

What's a good 2D C library?

Only cucks and brainlets need comments, pros can understand it without needing comments.

we could do without this comment

What if I export as a c function?

dlang.org/spec/interfaceToC.html

Can someone give me an explanation of pointers and a example please. if possible in Java or C. Also how different is this from an array

But how would you compile it?

Perentie likes cuddles.

>he (((komments))) his (((((kode)))))

Lizards are a bro tier pet.

why does she have animal ears and tails

cosplay

wiki.dlang.org/D_binding_for_C#Introduction

How does Wine work? The program I want isn't on Wine so I'm thinking I may as well try to do it myself. Can someone give me a quick rundown

Watch your mouth, that's my wife you're talking about.

I'm fucking your wife and now you're a cuck.

You married a jpeg?

it translates windows syscalls to linux syscalls as best as it can, so the program thinks it's running on windows

Do we have one of those "roll" images for casual projects to do just for flexercising development?

You married a furry?

What possible reason could I have for writing rust over C?

is there a good dev guide somewhere? i can't seem to find what I'm looking for on the wine wiki

There isn't one.

Rust is:
- safer and easier to program without memory bugs
- much easier to install libraries with its own package manager
- more modern language features to help program

pls halp

Seems like more work than it's worth, tbqh.

Rust holds your hand.

>he (((assumes things))) about (((((people he hasn't even spoken to)))))

There's probably some automation program for this that'll do most of the work.

pointers point to objects in memory. if you have an object (e.g. String yourName) and you pass it to a method, you're passing the pointer/reference of that object instead of the value itself

this means you're modifying the object in memory when you manipulate it through the method, whereas if you pass a value it makes a copy

This is your brain on memes

That's why I like Gnat, since I barely have to think about it.

I'm making an arcade style game where you play as a shota and there are many black pedo dicks advancing from below that want your butt so you must ward them off by pooping and eat all the burgers that are falling from above so that digestion will gradually restock your ammo over time but also you shouldn't eat so much so fast so inevitably the shota gets fat and therefore slow the more you play which creates a difficulty curve and the goal is to get as fat as possible without being raped

Looking for recommendations on whats a good C++ graphics library to use to draw candlestick charts?

Just read this:
cslibrary.stanford.edu/102/PointersAndMemory.pdf

say your object was a dog. if you passed it by pointer you'd be like
>"here have this dog"
>gives leash
but if you passed it by pure value you'd be like
>"here have this dog"
>picks up entire dog
>fucking astrally projects a duplicate dog into the other guy's arms

Pass by pointer:
>"Hey can you take the dog for a walk?"
>hands off the leash
Pass by reference:
>"Hey can you take the dog for a walk?"
>picks up entire dog
>thrusts it into the other guy's arms
Pass by value:
>"Hey can you take the dog for a walk?"
>keeps the dog
>instead gives the guy a photo of the dog and directions to the pet store

this is stupid

all passing is pass by value.
you're either passing a reference (pointer) or a complete copy of the object.
Both are values, or a collection of values described by a compound type.

>all passing is pass by value.
You are going to make someone fail his CS lesson with your post

Pass by reference implies implicit passing

ok so from what i understand, it will give you the address or the value it self instead of copying it. Im guessing that when it copies, it also uses more memory. also here is another question.

I forgot that modern languages destroy this simple model by making a distinction between 'reference' and pointer.

What the fuck is a CS degree even good for?

>all passing is pass by value.
Wrong. Suppose you have
int do_thing(int* x);

How are you passing the int?
Obviously you're passing the pointer by value. But that's not what I'm asking. How are you passing the INT?
The answer is that you're passing it by pointer.

Not to mention, consider pass-by-name semantics. How can you figure your way around calling THAT pass by value?

...

Maybe reddit is more your speed.

A pointer is a value, and systemically, it's just a signed long integer.

C's always been pass by value

Yeah but what are you passing what it points to by?

>people pay money for this shit

The formal argument to the function is a pointer. The pointer is passed by value. The fact that the pointer actually points to an int is not important.

I'm passing a value.
You can write the function to interpret that value as a memory address to a value somewhere else, but that's your problem, and certainly not something that NEEDs this apples and oranges comparison.

>Im guessing that when it copies, it also uses more memory.
Yes, but that memory would be used anyway by calling the function, whether you pass something to it by value or not. Because, when you pass by value, the value is copied onto the stack frame the call is building, not onto the heap

What about pass-by-name semantics though

I need advice again /dpt/

I'm the user who's been learning how to program since January (I wrote two "popular" lua mods, went to reading books and grinding endless C# terminal executables for practice, played around with unity and scripting, just made a JS bot for fun).

I think I want to get into freelance coding. I have a career in construction already which covers money and health benefits but when things get slow I would like to switch freelancing for some pocket money and coding experience that I can put on a resume.

Can anyone explain HOW to get the knowledge required to do it? I'm aware of the sites like upwork and I am comfortable with C# (and not opposed to learning C/C++). What is the next step I should take? Right now I'm hobby learning dev and I want to make the jump to => amateur freelance dev.

Thanks /dpt/

Could you post an example?
Maybe you're describing something simple with some backwards terminology, like java calling functions methods and static meaning extern when it shouldn't be visible outside the translation unit.

Pass by name is weird, unlike jave which is simply pass by value.

/dpt/ why does C need a call stack? couldn't it instead set up a compile time graph with each function as a vertex and each call as an edge, and then run the program by doing a depth first traversal of that graph starting at main and tracking the color and parent of each vertex?

Because C allows unrestrained recursion.

I don't know of any languages that actually do this but pass by name is where parameters aren't evaluated until they're first used and passing to a function doesn't count as using. So you could be passing around an unbound variable for example and not find out until somewhere on the callstack an attempt is made to get a value from it or assign a value to it. Or you could be passing around a balanced but syntactically invalid expression and not find out until the result of evaluating that expression is needed by some function kilobytes upon kilobytes deep into the stack

>signed long integer
People who believe that the long data type has anything to do with the size of a pointer are morons. This model completely breaks down as soon as we say we're not dealing with a Unix system. On Windows, which is the largest desktop platform, and unfortunately a sizable server platform as well, the long data type is 32 bits regardless of whether the word size of the processor is 32 bits or 64 bits. Regarding the five base integral types in C (char, short, int, long, long long), the standard has only a few things to say:

1. char = 32 bits, long long >= 64 bits

If you want an integer the size of a pointer, you want either intptr_t or uintptr_t.

Alternatively, you will want ptrdiff_t (signed) or size_t (unsigned). size_t is for representing the size of an object, including an array. ptrdiff_t is for representing the difference between two pointers. Since the last element of an array must necessarily be the result of offsetting a pointer, ptrdiff_t can serve as a signed equivalent to size_t.

Use of these typedefs is the only way to achieve correct behavior across different platforms. Never EVER use long for this purpose.

I use unsigned for calculating difference offsets in pointer arithmetic all the time, stop scaremongering.

People dont like gta 3 jokes huh?
youtube.com/watch?v=xem8Gn9HOcw
petsovernight.com

is that so, thanks user and does it even have an advantage to use? copying doesn;t seem like an issue at small scale

Learn Lisp.

Ruby, it's basically common knowledge that you're a boy (female). But also you seem a lot more knowledgeable about things than any natural human being has any right to be, and sometimes you can be conceited or mean (though not nearly as much as most anons). Therefore, I have an important question.


Are you Glados?

>ruby
>boy or knowledgeable
pick one

What he said is not particularly profound or intelligent.
If you've programmed in C past 1999, that's shit that you should know.

My ass. He once implicated that all functions return a value.

>People that defend the long data type are morons
FTFY

this is bikeshed-tier shit about language standards, no real substance