/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

en.wikipedia.org/wiki/Outlier
iste.uni-stuttgart.de/ps/lehre/ws1718/rtp.html
show-cpp.readthedocs.io/en/stable/
twitter.com/NSFWRedditGif

First for Rust being the future of system programming.

>I'm talking about independent entities and message passing in general, where sending a message in no way implies receiving an immediate response, and in no way implies that the object has to do what you're asking from it.
I don't think that's what message passing is in general, but if you say so, then no, I think it's a terrible idea to use for everything.

Im waiting for Rust++, desu.
A rust with no cons, and a cleaned up syntax will be p.good.

> A rust with no cons
So, just Rust?

Though it's not like a function call implies an immediate return, either. Take any sleep function. Like I've been saying, sending a message is the same as calling a continuation. Control flow would be guaranteed to proceed to the continuation immediately, but that continuation could do something that takes some time.

Of course, you can guarantee real time properties by making system resources (including time) linear and also enforcing totality, which is totally compatible with process calculus and in fact favours process calculus over e.g. lambda calculus and especially imperative programming.

this

Why wait when you could create?

I've written a hash table from scratch in java that stores words.
How do I see how efficient/fast it is? How would I find if it's O(1) or something?
It uses closed addressing chaining so would that change is O notation?

>I don't think that's what message passing is in general
It's exactly what message passing means in general, and it's the only notion of it that is compatible with the concept of independent entities communicating. Your reduction of MP into "calling a continuation" is meaningless; it contributes nothing to the understanding of how software should be structured, whereas OOP attempts to answer the question by introducing abstractions with intrinsic properties that have direct implications for software design. Don't have to believe me? You can look up what Alan Kay himself considered to be the only proper examples of OOP.

>meaningless; it contributes nothing to the understanding of how software should be structured
I wasn't aware that everything that isn't a "paradigm" or "design pattern" or something is meaningless.

C++17 is a major disappointment.

All low level systems programming languages are garbage

Why is the same symbol as the dereference operator used for pointer variables? Wouldn't the address-of symbol make much more sense since it stores an address?

>I wasn't aware that everything that isn't a "paradigm" or "design pattern" or something is meaningless.
Nice strawman. What useful conclusions about software design do you draw from your idea that "hurr durr message passing is just calling a continuation"? Come on, now. We both know you don't write any actual software, but only fap to formalisms.

I have learned basic Pascal, 15 years ago.
Which language should I got for?

Ada.

::
my ideal language wouldnt be with a BC.

Nothing in particular, really, I just don't see why that's important. Formalizing message passing is important for compiling, type checking, etc. A programming language shouldn't enforce arbitrary and entirely human requirements on how one can write software.

What I mean is make the language you want to use.

Why do you shill a language you don't really use?

my api is both backward compatible and forward compatible

>Formalizing message passing is important for compiling, type checking, etc.
No, it isn't, because you're unable to explain why your version of "message passing" matters in the first place.

>A programming language shouldn't enforce arbitrary and entirely human requirements on how one can write software
I never suggested that it should.

But I do. Mostly just because my uni uses it heavily.

Dammit, didn't notice that the new thread immediately... Here's me reposting.

user redirected me here from /sqt/, I'm having a bit of trouble on yesterdays AoC challenge 2.

So I have a python dictionary that looks something like this:

dict = {'a':1, 'b':1, 'c':1, 'd':5}

and I want to find the outlier. (d, in this case), but I can't seem to figure it out.
Can someone give me a pointer?
>inb4 *d

>Mostly just because my uni uses it heavily
No it doesn't.

en.wikipedia.org/wiki/Outlier

>and I want to find the outlier. (d, in this case), but I can't seem to figure it out.
Retard-tier solution that will probably work in your case: calculate the average, mark points that are too distant from it as outliers.

&d

iste.uni-stuttgart.de/ps/lehre/ws1718/rtp.html

it's even the intro language

What is that unit supposed to prove?

It's Ada based like a lot of courses and projects there.

So you are taught 2-3 units over the course of the major?

if (x != 1) then outlier
:^^^)

...

Most courses aren't based on any programming language. This isn't code monkey school.

So why did you claim that your uni "heavily uses language X"?

>So why did you claim that your uni "heavily uses language X"?
Probably because it's full of researchers working on DARPA projects. At least in his RP scenario.

Because when it uses a specific language it tends to use Ada?
Why the hell am I arguing about this.

You're not supposed to list actual facts.
it's supposed to be ad hominem and hyperbole everywhere.

>it uses a specific language it tends to use Ada?
So a literal code monkey school?

>you must be a defense contractor to use it
And every uni that uses Java is full of researchers that work on enterprise business logic projects...

>And every uni that uses Java is full of researchers that work on enterprise business logic projects...
No, it's just full of Pajeet lecturers. That would be the correct analogy.

>No, it isn't, because you're unable to explain why your version of "message passing" matters in the first place.
It works much better with type systems based on logics like classical logic or linear logic, which means more properties that can be proved without unnecessarily restricting mutation or requiring a garbage collector. Making values perfectly dual to continuations means it's easier to write programs and proofs with complex control flow.

>I never suggested that it should.
Then what are you even talking about when you mention things like software engineering and design?

>C# has more features like value types
>Java is faster anyway
explain this CLR pajeets

>It works much better with type systems based on logics like classical logic or linear logic, which means more properties that can be proved without unnecessarily restricting mutation or requiring a garbage collector. Making values perfectly dual to continuations means it's easier to write programs and proofs with complex control flow.
That's nice, but what does any of it have to do with OOP?

>Then what are you even talking about when you mention things like software engineering and design?
Because we were talking about OOP, not your meme PL formalisms. Your autism is just mind-blowing.

Actually we're talking about message passing.

>Actually we're talking about message passing
You know what, this is completely fucking pointless. You can keep screeching that process calculus is OOP, despite it being a mathematical formalism that has nothing to do with software design. It really doesn't change anything. We're just arguing about labels at this point, whereas the original discussion was about the applicability of OOP in software design.

>You can keep screeching that process calculus is OOP
I didn't say that, I quoted Alan Kay saying OOP is primarily about message passing and implied that process calculus was the best way to do that.

>I quoted Alan Kay saying OOP is primarily about message passing and implied that process calculus was the best way to do that.
Process calculus is not the best way to do that, because the version of "message passing" modeled by process calculus is meaningless for software design.

You can build your "useful" models on top of it much more easily than in any other existing system without it being inherently less efficient.

Compare a 1000000 sized hash table with a 10 sized one

>You can build your "useful" models on top of it
The only model you can build on top of it are the failed ones that turn your project into an incoherent pile of crap where "object" doesn't mean anything, and where "message passing" doesn't mean anything either.

Really.

Mhmm, really, and this is why your process calculus memery is worthless as response to a discussion about the failings of so-called OOP, because they have nothing to do with the meme-theoretical problems your formalism tries to address.

int *ptr;
Evaluating *ptr will result in an int. Declaration reflects usage. With & that would be declaration reflects construction, but I don't think this has ever been done in any programming language senpai

> Declaration reflects usage.
int *ptr = malloc(sizeof *ptr);
*ptr = malloc(sizeof *ptr);

Compare what though?
What should I measure and how should I measure it?

>using the pointer returned by malloc as an int

Adding, accessing, removing. By timing it, silly bean.

Declaration reflects the usage of the most indirection, I'd say. But you know what they meant tbqh user.

Integers validated.

number of players I can get even though I'll be polling for game updates?

about tree fiddy

>php-mmo-mysql
why do you hate yourself?

Because this is all I know and I just want to get something done for once.

Here are the 4 classes available.

>yfw you realize kotlin exists

kotlin means feces-lin in my language

Literally anything can compile to JS these days, just pick one of those. But what's the "grunt" class like?

Kotlin is shit tho

Shouldn't Kotlin be popular in Germany?

>tfw you realize the jews shill for kotlin for some reason

touché

I'm trying to make this a "social rogue-like" game.

Grunts handle physical labor
[spoiler]
Farmer:
Grow Food
Harvest Food into Items
Wall Retainer
Heal Poison
Stun Spell
Least Hungry

Grunt:
Plant & Trigger Mines
Carry Boulder
Push Blocks
Cut out stairs
Dig Down
Poison Dagger Item
Create Mining Tools

Crafter:
Create Portals
Link Portals
Create Warp Cards
Create Keys
Carve Door
Create Chest
Create LockBox (carry)
More Inventory Storage
More Pixel Mining Return
Salvage

Wizard:
Host Chats
Create Spawn Point
Cloak Objects
Facilitate Trade
Watcher Spell
Create Paper
Facilitate Collaboration:
Crafter + Wizard => Linked Paper
Grunt + Farmer => Stun Dagger
Grunt + Crafter => Instant Mud Wall
Crafter + Farmer => Heal Spell
Wizard + Grunt => Quake Spell ... ?
Wizard + Farmer => Steal Spell ... ?[/spoiler]

>the only """criticism""" of kotlin is that it means a funny bad word in my irrelevant language xD

כמה משלמים לך על השילינג הזה, אחי? גם אני צריך כמה שקלים.

>reviving a dead language just to occupy territory
You must also shill for PASCAL, too.

Lazarus is unironically pretty nice.

>m-m-muh occupied territories
You have to go back to the Saudi deserts, Mahmoud.

you can't hide the truth, kike

>When the red channel clips

Feels bad man
Wish this balloon were an oven

guys how do i add an array to a list in c#
yes i'm really new to this

Guess I screwed up my gamma correction badly eh

>hide the truth
The truth about what, Jawar? We've just taken back what was historically ours, rather unapologetically. You have to go back to the Saudi deserts whence you came, though, Islamic invader.

var lst = new List();
lst.AddRange(new int[] {'g', 'o', 'o', 'g', 'l', 'e'});

So I just wrote a fractal viewer in C++ using OpenGL as my graphics library.

I'd like to add some sort of GUI next for selection between different kinds of fractals. Is Qt GUI good to use with OpenGL?

>Is Qt GUI good to use with OpenGL?
Yes, specifically Qt 3.14.

>Rust++ is made
>takes all the bad parts of Rust and C++
>is hailed as the best thing since sliced rust by all the rustfags
>rust dies

Nah, i feel like when the split happens, there's gonna be a lot of stockholmed zealot in-fighting.

where do i start if i want to learn ai?
i assume math is essential, are there good online resources?

AI is basically applied statistics. You'll need to be good at maths and statistics, the rest isn't that hard as long as you're not a brainlet (which you aren't if you manage to get that far).

Rust is already Rust++, you want Rust--
>syntax that doesn't look like line noise
>automatic refcounting built into the language
>error handling built into the language
>file-level templates, not type-level generics
>bounded integer subtypes
We'll make it happen... someday...

...

Read your Norvig, as everyone does.

Documentation show-cpp.readthedocs.io/en/stable/

paip and aima are easily my favorite cs books

Shtok ya ashkenazi manyak.

How many collisions should a hash function for strings produce, given about 1000 words?
Mine is giving roughly 20% collisions which I think is a bit high.

Collisions depend on the slots you map the hashes to.
If you've got 20% collisions before you reduce to an index you should probably just scrap the hashing function. I'd expect 0. 1 if we're very unlucky.

I'm connecting to database via sql developer using a TNS connection. I don't know the host address but I need it for another software. Is there a way to get it ?