/dpt/ daily programming thread

Previous thread:


What are you working on, Sup Forums?

Other urls found in this thread:

github.com/korcankaraokcu/PINCE
devernay.free.fr/hacks/chip8/C8TECH10.HTM
physics.nist.gov/cuu/Units/binary.html
youtube.com/watch?v=vgk7vKiTAqo
youtube.com/watch?v=QTY_Fiau_8o
quickgit.kde.org/?p=okular.git&a=tree)
quickgit.kde.org/?p=okular.git&a=tree
twitter.com/NSFWRedditImage

Why do universities start of with teaching java? Is there any better beginner language?

*tips red hat*

/dpt/ isn't even worth coming to any more, holy fuck. pathetic.

just tidying up

>Is there any better beginner language?
literally anything

Making a web application for some friends when they are gonna teach some kids JavaScript.
They need to make games and save their shit on my server.

I am writing the entire Linux Kernel in Java using OOP practices only

Thank you for not starting a thread war (:

You've gotta let the redditors make the OP every now and then or they'll take over the board

It's not script-tier but doesn't force newbies to think about memory and shit. Similar syntax to C/C++ without the pointers.

Reposting from old thread.
I'm writing a compiler from a fictional language to Chip-8. The author of the Dragon Book creates separate token types not only for things like "while" and "for" but also SEPARATE types for "true" and "false". Why doesn't he make a "boolean" token type? Should I make separate tokens for "int" and "bool" too?

True, otherwise that retarded trap meme might actually take off

It's only taught because there are so many jobs for Java due to oracles massive and successful marketing for the language. Quality has nothing to do with it, trust me. Java is annoying to program in and pretty bad.

>thinks every girl is actually a boy
are you gay?

N-no!

>Thinks cartoons are real life
are you a child?

Java is actually not to bad, but compared to most other computer languages its not as implemted but all the while worth learning. If your new to computer coding than I would start with either c/c++ or Python then go on to Java.

Please use an anime picture next time.

It's decent if you ignore the programming language dick swinging. Admittedly, that's like 70% of DPT so idk

a 30% on topic percentage is the definition of shit..

Thanks for contributing.

>c/c++
Why are you grouping two completely different languages together like that?
Also, Java is complete trash and is not worth your time at all. OOP is fundamentally flawed, and Java forces you to use it.

>Why are you grouping two completely different languages together like that
C++ can compile regular C

Java is worth the time if you want a good paying career

Glad to see my OC is used more and more, Chi-chan 2stronk.
I'm learning WPF, all these books kinda sucks balls, ATM they just only teaches you the framework and not how to actually build an app.

I don't disagree!

No it can't. C has evolved a lot since 1980, you know. It can't even compile all valid C89.
int *ptr = malloc(sizeof *ptr);
valid C, invalid C++.
And that is just a simple example. There are all sorts of semantic differences that will make the languages very different.

Your oc looks like shit

the void pointer casts are probably the only thing you would be changing.

that doesn't make it a "completely different language"

take that back!

I think that while there are differences, they are definitely similar enough to group together

XD

it does make it not compilable by C++ though

>windows forms
>shiggy diggy

Haven't touched this since some HS programming class.

C99 and C11 together add a whole bunch of very useful things which cannot be used in C++.
Also, the way you write modern C and modern C++ is COMPLETELY different. We're not talking about 1980 'C with classes' here.

>C
>still no polymorphism of any kind

ty, last time I got told that too.

>still no polymorphism of any kind
void pointers


also, you can have type-safe macros with the non-standard gcc statement expressions

>void pointers
>remotely comparable

>using polymorphism irl

Surrrrreeee. We barely use inheritance and interfaces, and that's only when someone gets bored.

of any kind
>of any kind
"of any kind"

>void pointers
>polymorphic
nonsense

>inheritance
stay out of this OOP man, or i'll beat you back into your cage

>stay out of this OOP man, or i'll beat you back into your cage

haha, do you really not use OOP? I thought that was a joke when I skimmed the last thread.

>haha, do you really not use this one specific (shit) paradigm?

I'm not saying it's good, but it's not impossible

void *polymorphic_square(void *x)
{
unsigned long long *n = (unsigned long long *) x;
*n *= *n;
return n;
}

double x = 4.3;
polymorphic_square(&x)

Ok guys, this is serious. How do I find the point in the middle of this line. I am the guy trying to build some empty triangles.

use the midpoint formula


come on man

(A + B)/2

Fuck me. I didn't even know this was a thing. I am sitting here deriving it from the Pythagorean Theorem for length/2 and then throwing that into trig after getting angle of line to find resulting point. Ty

use a struct and hint the type there instead of simply passing random pointers.

>Fuck me. I didn't even know this was a thing.
literally how

How fucking retarded can you be?

>literally how
>How fucking retarded can you be?

Valid questions bros, valid questions.

Historical linguistics simulation. Wanted to use racket but python already has a good sound change rule applier lib and it would take to long to recreate it in racket so python it is :/

This is so fucking basic I'm surprised there's a fucking "formula" for it

This is like child level knowledge

Can you find the middle number between 3 and 5?

Just hype-shilling on Sup Forums as usual. Added Cheat Engine-like register features(such as paint red on change, double click to set register etc.) to PINCE today.

github.com/korcankaraokcu/PINCE

Tell me how it looks lads

To the guy that made the chip8 emulator: what resources did you use?

>.py

>github.com/korcankaraokcu/PINCE

Saw this project on cheatengine forum.. It's now on /dpt/

This is oddly appropriate.

Honestly I looked at his post and immediately began overthinking it. I assume he did the same.

Crates:
Rand,
SDL2

The rest was rust standard libraries.

I mean for documentation/manual of the architecture.

That's what happened - I have a working solution that uses the pythogorean theorem to get the length of the line, divide by half, then get the angle of the line, and use trig to move up half.

Not saying that as an excuse, but since he asked. Supposedly people fail interviews for this shit too (over-complicating).

devernay.free.fr/hacks/chip8/C8TECH10.HTM

Also did some research on misc places. Bisqwit did a pretty nice video showing the process.

>I want the average of these two points
so take the average of the two points?

I actually smacked my forehead after googling "midpoint formula". I went " Welp...I'm retarded."

>2016
>not using week typed languages

Same.

Wallahi senpai there's nothing wrong in using python. I started programming with assembly. Doing only FP-related hacks and pointer arithmetic is FUCKING boring, especially after 5 years. Programming got fun again after I've met with python. She's charming desu

>mfw the first time I discovered python

>What are you working on, Sup Forums?
Now actually works

I like your licensing.

What if I need more than 7 days?

>Use by normies is prohibited under federal law

System.Drawing isn't WinForms, it's just a nice wrapper for GDI+

then you cast your variable to a month

>Can you find the middle number between 3 and 5?

A better question is this: Can you do it in C?

Is this a trick question? Of course not

>MiB

autism

hi lads

>2016
> 20+ megabytes of memory usage + giant misc mostly unused libraries for something that could be done in less than a megabyte.

International standard.
physics.nist.gov/cuu/Units/binary.html

>MB
baka desu senpai

Please include a debugger with it. Is there a place that I can see your project?

>mfw your project

>>>B

Anyone got nerd techno on hand?

There aren't any nerds here you faggot, just programmers

>author of the Dragon Book


... Chumbley?

youtube.com/watch?v=vgk7vKiTAqo
youtube.com/watch?v=QTY_Fiau_8o

Not techno but meh.

ayyy this is taking forever

Boolean should typically be implemented as your smallest type with defined values as language constructs (true(1), false(0))

>Johnson is a notable person, with an 80s hacker personality. Marisa is creating his own operating system. They eventually created an IRC channel for themselves
What IRC channel did marisa make?

Who the fuck is Marisa? Why is the foreign secratary creating an IRC channel?

I was browsing okular source (quickgit.kde.org/?p=okular.git&a=tree) and, as beginner, I'm pretty confused. Must a darm pdf viewer really be so complex?

You have passed the test.

>Who the fuck is Marisa?
An old tripfag

Can someone explain to me applicative sequencing in terms of non-IO monads?

What does sequencing mean for Lists, for instance?

You all talk about these advanced topics but none of you have built any practical or useful applications. What's the deal?

>quickgit.kde.org/?p=okular.git&a=tree

Loading and saving file formats according to standards is always needlessly painful.

Oh, and the fun part is on some types you can't trust that following the Standards will actually be able to load the file (Microsoft is particularly known for this)

The real question is can you implement `Frob" in O(fib(N))?