/dpt/ - Daily Programming Thread

Old thread: What are you working on. Sup Forums?

Other urls found in this thread:

news.ycombinator.com/item?id=15527413
lynda.com/course-tutorials/Good-Parts-JavaScript-Web/604268-2.html
neuralnetworksanddeeplearning.com
steveperkins.com/using-java-9-modularization-to-ship-zero-dependency-native-apps/#.Wes5Y7ucK4g.hackernews
youtube.com/watch?v=PJwd4JLYJJY
twitter.com/NSFWRedditGif

news.ycombinator.com/item?id=15527413

First for RED.

What's the point of writing software?

What is the point of living?

I'm using rust until C++ gets modules and concepts :^)

/dpt/ why doesn't this work?
To decide which object is the (name of kind of value K) in (T - a thing):
repeat with X running through Ks in T:
decide on X;
decide on nothing.

The result isn't treated as having any of the properties of an instance of K

program fizzbuzz into it user.

You'll be using Rust forever, then.

because it's ambiguous pseudocode?

Haven't done any projects at all. I made a GitHub but what do I do now. Do I just copy people's code and call it my own?

What projects would you recommend? I need to make stuff fast before next semester so I can put it on a resume

Compilation units are already modules. You import them by linking them -- which is a semantic process, not a textual one, and so does differ meaningfully from header inclusion, as any module implementation should -- and they have their own namespaces and everything. You might argue they don't count because the means of importing them can't be accomplished in the code that needs to import them, but as a retort, I offer for your consideration: dynamic linking.

Template parameters are already anonymous concepts. Attempting to parameterize a template on a type which does not implement the anonymous concept its parameter defines will result in a compilation error, as you'd expect. Also, types do not have to inherit from these anonymous concepts to be considered to implement them, and indeed cannot (excepting the case of the mixin design pattern). And how are these anonymous concepts defined? By their use, of course. Writing template code that performs operations on parameter- typed values creates implicit but inviolable requirements on what operations are applicable to said type.

Not pseudocode, actual source code in a specific and existing language

Working on a nextcloud extension that sorts through photos that are auto uploaded from the android app and runs them through yahoo's open_nsfw framework to identify if they are nudes. If they are they are moved to a separate folder for that kind of content. Useful because I take thousands of photos, of which a good portion are sexual in nature, and I don't want that kind of thing showing up in my galleries or portfolios accidentally

It's returning a pointer to an object, not a pointer to a K.

Here's what you actually want. Can't blame you for not knowing you could do this: it's not documented.

To decide which K is the (name of kind of value K) in (T - a thing):
repeat with X running through Ks in T:
decide on X.


Note that "decide on nothing" must be omitted because a null pointer is considered a pointer to an object, and is not compatible with any more specific pointer type. So if you try to get "the K in T" but there are no Ks in T, it'll just shit the bed.

Nice to see a fellow interactive fiction author here, btw.

Could you two elaborate on what the fuck you're talking about?
Is this some SQL shit?

There's a better way to do this.
To decide which K is the (name of kind of value K) in (T - a thing):
decide on the K that T relates to
by the containment relation.

I just wanted to say that even though these threads are always filled with shills, false flaggers and mentally ill shitposters, I still love you guys. Every single question I asked here, no matter how dumb it was, you guys always answered it better than stack overflow or reddit ever did.
Please don't ever change /dpt/.

>Is this some SQL shit?
kek what a brainlet normie

make:
- some web thing
- some desktop application
- some database-using thing
- something exciting thing like neural networks or facial recognition; you can just use an existing library but if the idea is decent you're golden

Compilation units are not modules; your stance is that we use them like modules, so they're effective in practice, but I have to disagree. The largest advantage of modules is not some new functionality, but both convenience of having fewer files, and reduced compile times.

In the same vein, I think that if we're using the current template system in the same way as concepts (albeit, duck-typed, anonymous concepts), why not have concepts? They're more explicit, and they can reduce collisions.

>Compilation units are not modules; your stance is that we use them like modules, so they're effective in practice, but I have to disagree. The largest advantage of modules is not some new functionality, but both convenience of having fewer files, and reduced compile times.
>In the same vein, I think that if we're using the current template system in the same way as concepts (albeit, duck-typed, anonymous concepts), why not have concepts? They're more explicit, and they can reduce collisions.
I was trolling

Rarely do I see bait taken with such nice rhetoric though

It would have been easy to just tell me "that's stupid" and you'd be right but you went the extra mile to be right the right way
Thanks for that

Looks pretty boring.
repeat i 100 [
case [
(0 = modulo i 3) and (0 = modulo i 5) [print "fizzbuzz"]
0 = modulo i 3 [print "fizz"]
0 = modulo i 5 [print "buzz"]
true [print i]
]
]

>(0 = modulo i 3) and (0 = modulo i 5)
come on user, you could do better

protip: they both compile to modulo i 15

When is the correct time to fizz and when to buzz?

Not in the context of programming btw, I'm talking about everyday life

Although, you can do this:
fizzbuzz: [repeat i 20 [
case [
(0 = modulo i 3) and (0 = modulo i 5) [print "fizzbuzz"]
0 = modulo i 3 [print "fizz"]
0 = modulo i 5 [print "buzz"]
true [print i]
]
]]

repeat i 3 [do fizzbuzz]


if you want to do a fizzbuzz multiple times. Now sure, a function definition would be superior in this case, but this is the rough equivalent of quoting a sexpression in lisp and evaling it and I wanted to show how that worked.

>quoting a sexpression in lisp and evaling it
>evaling
>using eval ever
you misspelled "evil"

And, surprise surprise, if is just a function, like eval:

if true fizzbuzz

I had the weirdest experience and im still not quite sure what to think of it
>be at party with gf
>drunk af and wanna get some fresh air maybe smoke a cig
>go outside
>sit on the porch and cuddle with her
>person comes outside
>it's the guy who threw the party
>haven't really talked to him in probably like 2 years other than a few words here and there
>he comes up to me
>making smalltalk
>"Hey btw user, do you know F#?"
>think dafuq is this nigga stalking my github
>"I was talking to this dude from and I mentioned that I have a friend who knows F#"
>even more confused
>"He told me that's impossible, nobody actually knows F# and doesn't believe you exist"
>dude just walks away without answering any of my questions
did I hallucinate all of this or something? why are normies interested in F# and how do they even know what it is? maybe he said C# and I was just being autistic?

>muh eval is evil because some blog poster said so

Are you high, mate?

So until 2020?

When applying for a web dev job

He's talking about F#, what do you think?

Friendly reminder that C++ is the worlds most powerful and efficient programming language.

Hi.

I have no experience in programming.

I am want to enroll in an online course in C.

What online site should i go to?

Is this udemy any good?

Hello, want to enroll in an online course in C, how are you today?

Sounds like you're jumping every gun.

Why online course? Why C?

Assembly is equally powerful and more efficient

no, I've quit weed for a while and don't really use any other drugs often

back on the babby haskell grind

nice, but this is better done by taking advantage of math

(2 * 2 * 2 * 2) * (3 * 3) * 5 * 7 * 11 * 13 * 17 * 19

Harvard's CS50.

Just a hobby. i want to convert my autoshutdown script to a proper program with a small GUI.

>C
>GUI

You're gonna have a hard time doing that in C.

Depends what you want, but some scripting language is probably best for that.

actually your solution looks fast so whatever. good job!

What should i learn instead of C?

Rust

>use my immutable tree transformation scripting language
No.

depends what you want. If you want a language that can get you hired, try Java, C#, or Python.

So how does one actually learn Agda/Idris/[insert dependently typed language]? I understand the Curry-Howard correspondence and constructive logic, but I really can't be bothered to read through something that looks like a math textbook. Are there any down-to-Earth learning resources?

This Rust looks nice. Ill try reading the introduction later.

honestly man, those languages are designed by such math people, for such math people.

If you want to really dig into it, learn their maths.

Ill try python. Seems very popular.

>he programs in a language that doesnt have atleast 3 forms of equality comparison

nice name, idiot

>honestly man, those languages are designed by such math people, for such math people.
Surely, "math people" are intelligent enough to understand that people learn best by starting from simplified and concrete examples and moving towards the more complex and more abstract.

Im not the one who posted with a picture.

concepts a shit

Gonna have to point out them quins

Just use libui. It's a nice, lightweight C graphics library.

2ez

I'm a newfag to java and javafx and I need some help. All I want is a simple way to access text, textareas and so on from a different class but it's not working. All the answers in stackoverflow say things about FXML which I haven't learned yet and controllers but I don't understand those things yet.

This is what I want to do:

Class 1
public class Testall extends Application {
public Text t = new Text("Hello World!");
texttest d = new texttest();

@Override
public void start(Stage primaryStage) {

StackPane root = new StackPane();
root.getChildren().addAll(t);

Scene scene = new Scene(root, 300, 250);

primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}

public static void main(String[] args){
launch(args);
}
}


Class 2
public class texttest
{
Testall t;

public texttest()
{
t.t.setText("New");
}
}

Oh god, you can do this:
fbbody: [case [
(0 = modulo i 3) and (0 = modulo i 5) [print "fizzbuzz"]
0 = modulo i 3 [print "fizz"]
0 = modulo i 5 [print "buzz"]
true [print i]
]]

repeat i 100 fbbody

>a literal fizzbuzzer
Does anyone ITT do any actual programming?

lmao

Context?

>Thompson has given us some amazing gifts.
>As professional programmers we all owe a tremendous amount to Thompson.
>Unfortunately Thompson had terrible taste in programming languages and programming language design.
>Even worse than that he was extremely influential.
>All of us have been reading Thompson's designs from our first hours of programming.
>We've been doing it so wrong it all looks right to us.
>We cannot see how bad this stuff is, and how much it compromises us.

>For example, the ++ operator, this was added for B for doing pointer arithmetic.
>We have since determined that pointer arithmetic is harmful, so we don't do it anymore.
>Modern languages do not support pointer arithmetic.

>The last popular language that had point arithmetic was C++.
>A language so bad it was named after this operator.

From
lynda.com/course-tutorials/Good-Parts-JavaScript-Web/604268-2.html

What's wrong with pointer arithmetic?

If you're doing it by hand you're doing it wrong.

...

I'm using C++ until it gets modules, FS and ranges, and then I'll be still using C++.

>go to school to study programming etc
>Teacher is an (ex) employee of Microsoft
>Starts off by saying visual studio is best and we start off with c#
Oh lewd

>deerrrrr unsafe low level languages are supid, badly designed and unnecessary
>my academic toy language can be expressed in terms of itself on a piece of paper and compiled in my head

>We have since determined that pointer arithmetic is harmful, so we don't do it anymore.
who are we?

Why isn't android based on some BSD?

Because BSD is shit.

>who are we?
Academics who develop mostly useless theoretical languages with no conception of how they could run on an actual machine.

(You)
It powers some of the largest software in the world.

Phones aren't large dummy.

why do we need reflection
it seems like the dumbest most memiest feature of all time that I could ever think of

like jesus christ can you imagine the pajeet tier shit that will come out of people reflecting variable names hahahaha

And Netflix is small?

Yes, it's shit.

dlang

>Assembly is equally powerful
>untyped
>"equally" powerful

"we are currently on track to making virtually all of the algorithms in the standard library constexpr "

welcome to hell

C++ should just call static something else and steal D's static ctfe stuff.

What's wrong with this?

SCREEEEE

reading neuralnetworksanddeeplearning.com
Captcha:
calle Marrs

>Using Java 9 Modularization to Ship Zero-Dependency Native Apps
steveperkins.com/using-java-9-modularization-to-ship-zero-dependency-native-apps/#.Wes5Y7ucK4g.hackernews
lol why don't they just compile java bytecode to native code?

uhh jit optimizations right??

You thought c++ was slow to compile? Well wait till you see how slow it is when everything is constexpr.

when metaprogramming get's that powerful bad programmers are going to abuse the hell out of complicated spaghetti compile time garage except now its litteraly undebugable

faster than when everything's TMP, that's for sure

>constexpr allocator

This is the future you chose.

How about writing a parser with constexpr?
youtube.com/watch?v=PJwd4JLYJJY

>programming literate hasn't posted since june
I miss him.