/dpt/ - Daily Programming Thread

"Skynet uses basic" edition

What are you working on Sup Forums

Previous thread:

Other urls found in this thread:

docs.racket-lang.org/redex/
github.com/iitalics/rust-redex
github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md#c
humblebundle.com/books/python-by-packt-book-bundle
github.com/hablapps/DontFearTheProfunctorOptics
twitter.com/AnonBabble

post screenshots of your code

I'm learning programming. Not as difficult as I thought, but it will probably get harder after I get past this super simple stuff.

...

Rereading C++ control structures through objects in painful detail, I want to specialize on embedded systems.

what?
the thing is though i only have to work minimal hours, there is even the option to rewrite but that has an interesting trade off, not in the usual "time is money" but because there current prod cycle relies on the lazarus forms framework, and tbqh, writing a forms application in pascal is a lot easier than C# or any other drag and drop UI system, you can build things at sanic speed.

but yeah there are a lot of problems with... well everything.

where can i find basic wireframe xamarin.forms apps?
just want to study the basic structure.

very nice

Wtf am I looking at?
Pls no bully

What is Skynet?

keyboards

What are the benefits to using VIM over VSCode?

China

A CPU chip from intel

but china is not above us

skynet was a thing when the mainboards were below the keyboards, hence the term skynet

Did you try googling?

>TFW wrote 10 .cpp file with each having more than 1000 lines of code, then compiles without error on the first try

Some particularily hairy type rules. I'm trying to model Rust using Redex, based on the type and evaluation rules in the "Patina" document (an early formalization of Rust).

LT = set of ordering relations of all lifetimes
L = map from variable to its lifetime
Γ = type context; map from variable to their type
Y = shadow heap; keeps track of what part of each variable is borrowed
e = expression (r-values)
τ = type

(⊢ LT L Γ Y_1 e_2 τ_2 Y_2)
means
"given LT, L, Γ, and Y_1, the r-value 'e_1' has type 'τ_1', and the shadow heap changes to Y_2 afterwards"

docs.racket-lang.org/redex/
ftp://ftp.cs.washington.edu/tr/2015/03/UW-CSE-15-03-02.pdf
github.com/iitalics/rust-redex

typo
s/e_2/e_1/
s/τ_2/τ_1/

I only post on non-anime /dpt/ threads.

foreach(child; mother)
//

Is it a good idea? I wish I could read ASM, but is iterating over all inherited objects expensive?

>c++
Enjoy your undefined behaviour.

Terminal based editing. Useful for ssh'ing in to do work.

Alright goys, some might remember me, I'm almost done with the VBA Real Life achievement system in Excel.

What a pain VBA was, but I think it was worth it.

The user can create Main and Subcategories, each containing Basic Categories.

The user sets his achievements, assigns points for each achiev and an optional target date and priority.

When he has created a basic category, it will be tracked in the overview and if he achieves a goal, the points will be added to his total.

The animated navigation pane and Buttons eliminates any use of Excel's interface, so it can be disabled.

Targets that are overdue will be highlighted in the Nav Pane.

How much programming (not HTML) is involved when making an imageboard like Sup Forums?

what's all this for?

>what are you working on
I'm just enjoying the benefits of C++17
Finally we have some more compile time optimizations. Constexpr is godly

I dunno, maybe like 5 programming? No more than 10 though

Round about 3 programmings or so!

Lumen + VueJS?

It is not a problem if not detected

bout tree fiddy

would a piano mobile app be worthy of putting on my resume, github, etc?

I was in the top 100 in Achievement points for a while when World of Warcraft first released their achiev system in WotLK.

My life has improved in every single area since I applied that autism that was engraved in my teenage years to real life.

I'm on my way to be financially independent in my own home before 25, all with the help of autism like this.

Do you think this shit might appeal to others and sell?

I see a lot of productivity "templates" going for 10-20 bucks that are a lot more basic.

Hell, I'm 28 and about to start my freshman year in college for computer science.

I still live with my mom and work as a pizza delivery driver.

ECS is more broad than that. It's as old as games like Ultima underworld (first game I heard used it).
All it is is the concept of having entities not be composed of components. So you have a component that deals with sound, one that deals with physics etc.
The processing of these can be done on an entity by entity basis or by components.
If you do it by processing components (i.e you have a 'update physics' call that goes through all the components for all the active entities and deals with them) you still have ECS even if it's plain old data arrays containing aabbs and collision geometry.
It's a high level concept for composing entities. Its very separate from the way you've stored and operated on them.
To contrast you might have an inheritance structure where you pack functionality into a class. Maybe a physics object. If you want your physics object to make sound you either have some some nutty OOP system that takes messages and plays the appropriate sound via events/messages. Or you can have the object itself handle its sound processing. If you wanted to get closer to ECS with few changes here you'd probably start inheriting components like a soundemitter component with your physics object to create your final entity. Though the lines get blurred and I'd probably call that a class based entity system with some components. Since ECS has the idea of being
ECS can be done many ways.

Also I'm not sure why you're hung up on the idea of dynamic vs not dynamic. It's completely separate though ECS certainly facilitates it well.

As for separation of concerns and dependencies that does need explicit handling and it's primarily why I asked. Almost all major game engines do ECS in some form. They've accepted the issues with dependencies and usually make it the job of the programmer.
>[...] this usually has component communications through events
I would say that the most common way is to categorize your entities and have direct component communications.

Posting a link with a ton of resources to get started with something new, now:

github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md#c

Try harnessing things that your brain is wired for.

For me it was the dopamine kick and hunting achievements.

I thought it was useless and a waste of time (it reall is for video games) but it works in real life.

If I write "150 kg squat" and "3 mil net worth" in my achievement tracker with a fixed goal, you can bet that my drive will achieve this.

dumb frogposter

Whatever you say dude.
You're the one broke, overweight and eating tendies.

>you can bet that my drive will acheive this
C:, D:, or F:?

zbot.wave();

I certainly think it has appeal. Gamification was a buzzword a few years back and you can look into what has been done, what failed and what didn't.
I don't think gamers are as achievement hungry as they were back with the Xbox and WoW but there's probably some left.
In some sense games in general is an indication of the appeal this has as they're oriented around goals and challenges. You'll face the same issues of giving them game flow. Along with people thinking it's a silly idea. As demonstrated right here.
I would suggest embracing the idea that people should try things before they discard them. People are very risk averse and posing them a 'what if' can be very powerful.

2018 is the year of Rust.

Not programming related.

Not programming related.

>ECS buzzword
Just use composition of structs with functions and not methods. You don't even have to think about it, you just do exactly what you need.

Wrong.

>don't even have to think about it
>going into a project with no foresight and planning will somehow end up with something that isn't spaghetti

You only end up with spaghetti code if you use OOP.

Yes, actually. I would argue that planning is often worse than just jumping straight in. I'm sure you criticize premature optimization, well, premature abstraction is a thing too.

We're aiming to scale systems.
There's developer time and performance concerns here.
And what you've mentioned isn't sufficient to exclude you're doing ECS.

I do support dynamically growing to your use case though.

Personally I find the more interesting puzzle to be how to have a combinatorially complex system. Which I've found ECS to be not all that suitable for.

ECS sounds like a fucking shitshow. No thanks.

>Personally I find the more interesting puzzle to be how to have a combinatorially complex system.
Well handles complexity extremely well, because it's literally just looping through collections of components or structures of components (entities) and calling functions on the components. If you're in a functional language, even better because much of the glue code can be abstracted away in combinators like "map", "filter", and "zip".

I'm not selling ECS if that's how it came off. I'm explaining it.
Also I fucked up the third sentence. Put a negative in there. Should be obvious I made a mistake.
I'm not sure I'm the best at explaining but that other guy was really lost.

shoo, Satan

Rust is the perfect language for systems programming. Not as limited and hazardous as C, not as intractable and ruined by backward compatibility as C++.

Just you wait my man.

Give me a quick rundown on profunctor- vs van Laarhoven-based optics.

>wait
For what?

My language.

FOR EONS I HAVE BEEN SCOURING THE INTERNET FOR AN ANSWER

WHEN I FUCKING WRITE "DELETE OBJECT"
DO I ALSO NEED TO WRITE "OBJECT = NULLPTR"

YES
OR
FUCKING
NO

What is your language?

Do you want the pointer to be null?

Maybe

>uses basic
Kill yourself. That's not Basic, that's 6502 assembly. It has just had line numbers added.

Language?

I'm interested to
humblebundle.com/books/python-by-packt-book-bundle
but never bought anything from humble bundle.
Is that book available only if you donate to the listed charity or you can get those by purchasing other item in Humble bundle?

Are you going to use that variable later? Yes
Are you not going to use that variable again (e.g. you're deleting in a destructor)? No

I'm not sure you quite understand what I meant.
Consider if we have heat as a component. I want the interaction of heat between different objects to be extensive. So our heat component would have to deal with making explosions when a good mix of chemicals are present. Just make it burn if that's not the case. Melt ice, boil water.

It's very separate from the rest of this as this is all about enabling shared behaviors by being general. What I wanted to deal with is having many different behaviors come from a limited set of states.

Of course you could try to simulate some underlying physics to achieve the effects but it's not feasible.
The goal is also to have predictable results. Not some physics sandbox thing.

depends

Newer compilers already point them to null.

A functional systems language with SMT for specifications.

github.com/hablapps/DontFearTheProfunctorOptics

This is false.

I think it works like this: you set the total amount of money you are going to pay. You can choose what portion of that money goes to charity and what portion goes to the people who run humble bundle, and the remainder goes to the author/publisher/whatever of the books. If the total amount exceeds certain thresholds then you get more books, e.g. if you pay $8 then you get the second tier of books but you don't get the third tier.

A pointer is separate from an object. If you've removed the object and wish to use the pointer (read through it) it may be wise to leave it in a predictable state so you can check if it's pointing to something. If you leave it referencing the dead object you don't know if you're pointing to a dead object or if you've set it to point to a valid object.
Null implies you're not pointing to anything. Which should be the case after deletion.
So it's a good practice until you feel it's wasting cycles.

>So our heat component would have to deal with making explosions when a good mix of chemicals are present
Why would the heat "component" (which should probably just be a number) be responsible for anything? It's just heat. It's the chemicals' fault for reacting to heat.

If you separate the data and the behaviour, what you want is not very difficult.

Sounds like it won't be ready for a while.

Thanks user.

Should have named it heat processing. Like a physics system. Objects don't receive physics they have physics.
If we just keep it separate I'll have to write a lot of code to manage this. Especially considering this heat component is just a small part of the universe simulation.

Probably not. I've done some syntax and overall compiler design stuff (e.g. source location and error message propagation) so far. I'm about to start implementing a (probably temporary) DPLL solver.

Good luck user.

>Objects don't receive physics they have physics.
Err...I think this is an issue. You can't "have physics". You can have physical properties, but the physics are their own thing. Not only is it a better metaphor for the real thing, but it's easier to implement and it composes better.

It's simple. If you pay X amount you receive the books they've said you receive.
You can choose which charity or the money goes to.
It doesn't matter where it goes as long as you pay.

Physics is all about interaction between objects, is my point. That doesn't work well if objects "have physics".

You need a PhysicsManager class.

>better metaphor for the real thing
>implements and composes better
Well that's the problem isn't it. The physics between water and heat and explosive an heat is different at this high level. At the low level with chemistry they share behavior but we wish to avoid that low level (I think we both agree that pretending we got an explosion is easier than simulating one).
If we had a physics analogy we might have completely different gravitational behavior for a rock and another rock. The gravitational field may be spiral shaped in one case and more realistic in the other.
You're assuming something as simple as us flipping the gravity for a rock. These cases are trivial and suits whatever composition just fine.
Yes this is the problem of analogy. You're assuming the real world for some reason.
Doesn't help at all. Not what we're talking about.

...

fortunate God isn't such a shoddy programmer

>Doesn't help at all. Not what we're talking about.
Well obviously I was simplifying but a PhysicsManager is essentially the right approach.

>your problem is just implementation details user
Thanks for playing.

>at this high level
What are you talking about? If you want something that explodes when it's too hot, there's two things at work. Heat, and explosive chemicals. Neither of them "have physics" with each other. You need "laws of physics" (i.e. functions) that operate at the next level up so they can depend on more than one component (or even components from different entities, e.g. a collision leading to damage).

>completely different gravitational behavior for a rock and another rock
Well I think the easiest way to get that kind of behaviour in a general way is to make the "shape" of the field a property of the object and the actual interactions another thing.

What does this post even mean? It has no content, just words.

Want to know how I know you've never worked as a professional programmer?

Been going through the WINE source code and stumbled across this:
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object) DECLSPEC_HIDDEN;

Am I a brainlet? I didn't know variables could be put at the end of a function definition.

What do they even do?

Because I said nothing about anything concerning that, you feel inept and you wanted to insult me?
You don't understand this topic at all user. Your post is meaningless and we mock you for it.
Suggesting a physics manager class is as useful as suggesting we program it.
Here's a physics manager class

class PhysicsManager{
}

Solved a lot of nothing. It's what inside that counts.
>simplified
So then the implication is that you've got some undisclosed management system that solves the problem.
That's just great. Again, you're being useless.

Probably a macro given its bold?
My guess would be its something like a gcc attribute behind a macro.

How could you guys able to write a program, without having a huge urge to scrap it and remake it entirely, just because you know that there is a more efficient way to do it?

This is why I know you have no professional programming experience, because the name PhysicsManager suggests nothing to you, you have no idea what such a class should do.

How do I test my programming knowledge? I know at best I have basics down but still
>lol senpai just like make something haahahah ajust like write something
Any ideas I have that isn't some four line bullshit is far beyond my skill limit