/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

edx.org/micromasters/software-development
functionalcs.github.io/curriculum/#org2c45041
en.m.wikipedia.org/wiki/Slerp
number-none.com/product/Understanding Slerp, Then Not Using It/
twitter.com/NSFWRedditImage

>not worshipping black seed

Why did we need a new thread?

Scheme, Shen, or Idris?

But I do?

Malboge

>bump limit

>350
That's a small bump limit.

Writing an AI to automatically detect cuckolds, gather doxx on them, then eventually issue drone strikes on them.

Currently working on the cuckold detection part. I'll be collecting donations to pay for the reaper and the hellfire missiles after that phase is complete.

I'll be humane about it and paint the missiles black though.

Thank you for your contribution to the project. I'll be sure to use your post as training data.

you must be new here

Meme, literally who, or God Almighty?

You can tell when a thread is autosaging when the post count becomes italicized. On Sup Forums it's 310 for some inane reason.

You doing a dpttxt twitter of your own?

>program reads data from file, prompts user for input then changes part of data and stores it again
Should I use a database or just something like csv?

>Blackbeard gets 10 prints
B L A C K B E A R D
>Fuze gets 4
F U Z E
>Capitao gets 7
C A P I T A O

What is a loop? Your code is literally:
for word in available_ops:
for letter in word:
if word == letter:
# never true


What isn't working?

hey /dpt/, how would I go about making a site similar to chinkshit.xyz which simply redirects to the newest of a specific general's threads?

It will be easier to use a database unless you're writing it in Scheme or Lisp.

sqlite

struct variables
{
GLfloat speed = 3.0f;
};


void run(GLFWwindow* window)
{
struct variables * vars = {};
printf("%d\n", vars->speed);
return;
}

>segfault
what

Well you'd need to create a script to get the newest version of /dpt/. I think the most robust way to do it would be to have the script open the catalog gather every thread with /dpt/ in it, and filter the ones that are autosaging.

You'll have to use an HTML parser to find all results in the link and then to filter them based on post count:
Sup Forums.org/g/dpt

>what
What did you expect, user?

> struct variables * vars = {};
Thats not how its done.

Thanks, I'll look into it. I'm assuming I'll have to use something like PHP or Javascript for this then.

create a struct with those fields with those values and have vars point to it

printf("%d\n", 0.5);

is not what you want. Floats when passed to variadic functions are promoted to doubles. You're going to have to do a cast hack.

Now why the code is segfaulting, it's because you're dereferencing an invalid pointer that happens to point out of your program's memory region.

struct variables * vars = {};
Even though you managed to compile it, I'm still convinced it's syntactically invalid C desu.

Try:
struct variables varss = {};
struct variables * vars = &varss;

Nah, nah. You can use pretty much anything. No javascript needed. You issue a 307 redirect.

The code to run the server's program can be in pretty much anything. Php, perl, C, Java, Scheme, basically everything has tie-ins to some serverside technology.

>GLfloat

Spotted the enginedev.

>struct variables varss = {};
>struct variables * vars = &varss;
this is such a weird language

it seems to work with that and I have no idea wht

> this is such a weird language
Thats what you get whan you start too high. Best you can do - get back to the langugae where it all make sense.

{} is an initialiser list, and they can only be used to initialise arrays and structs. You should have gotten a compiler error for doing this on a pointer.
Are you doing something retarded like running C code through a C++ compiler?

#include

int main(){

int c = 5, d;
d = ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c + ++c;

printf("%d\n", d);

return 0;

}


How much is d?

>Are you doing something retarded like running C code through a C++ compiler?
m-maybe

Don't do that.

lol you should really read a tutorial.

The first thing is a "struct variables" named "varss"

The second thing is a pointer pointing to "varss"


Read K&R and learn the fundamentals before trying gamedev user. You gotta start with command line tic-tac-toe and shit before you can do 3D graphics. Shit's hard and you gotta start somewhere.

Actually commandline tic-tac-toe is kinda advanced now that I think about it. I don't think I did tic-tac-toe in AP comp sci til gridworld, near the end of the year.

man fuck gridworld

Lisp is so good.

I mean I get that one is a struct and one is a pointer
why did they have to be done separately? Is initializing the struct, putting it away somewhere, and keeping the pointer not something a C(++) compiler does?

I feel it is moreof just C and C++-details I struggle with.

is not C a subset of C++ though?

I guess I could pick up K&R though thanks.

>is not C a subset of C++ though?
Not entirely
int *ip = malloc(sizeof(int)); // valid C, invalid C++

Here comes that annoying newbie guy with dumb questions you probably heard a thousand times :
- what are the easiest languages to learn?
- what are the most useful to actually find work easily?
- if I work like 4-5 hours a day on learning a language from scratch, could I be able to find work in like 1 year or so?

>struct variables * vars = {};
WHAT DID EY MEAN BY THIS

It's because C++ is a superset of C that you wanna use a C compiler at first.

There's more ways for C++ to compile invalid C programs and fuck you over, as you just witnessed.

And neither I nor anyone else recommends learning the ++ at the same time as the C. Stick to C for now at least.

1. The """easy""" languages are shit, i.e python.
2. JS & Java, have fun in hell
3. Depends if you actually absorb and understand everything.

Find a domain youre actually interested in, find out what the popular languages are. Then try them all.

You need a degree or certificate (or unfathomable wizardry + projects to your name + dick sucking & begging) to reasonably get a programming job desu.

>JS & Java, have fun in hell
Haha why the hate?

Oh fuck. I'm too old for this I already checked most doors are closed. I thought being able to do the job/showing personal work actually mattered more but guess not.

JS fatigue, and the language is an absolute chore to work with.
Java, theres no actual way to keep a clean and enjoyable code-base.

scheme

Smalltalk

>You need a degree [...] unfathomable wizardry [...] to reasonably get a programming job
Employed autist reporting in, this is false. Dropped out of high school for C++ gamedev, now writing analysis tools in functional-style ES6 and Rust.
You can pretty easily get a job in the area where """IT""" meets """business""" because they need shit to get done, they will hire anyone and pay them. Fish around a bit and you can end up with a pretty lax job doing fun/interesting stuff.

also there are no good programming languages.

Could someone please point me to a Sup Forums approved infohub on coding for industry. What languages do what, what you should learn, what bootcamp is worth it, how the industry works.

I imagine I sound pretty cancer but I don't ask g for much honest and I'm googling this shit right now too :/

user I know a 50 year old man getting a BS in math and actuary certification.

You need a ~certificate~ thought not a degree. Most colleges/community colleges offer light certificates that are just a few courses.

it hasn't been a (strict) superset for over 18 years, senpai. the differences in c99 deviated the language. it just happens that msvc is a c++ compiler that has a c mode

>Employed autist reporting in, this is false
>not unfathomable wizardry
You're the second category in parentheses.

how good is "let over lambda"

PSP is management masturbation material - daily reminder.

...

>+
>not ++

search through ycombinator/hacker news if you want 'industry'.

this is free edx.org/micromasters/software-development

That intro course 'How to Design Programs' is based off the book HtDP and teaches a type disciplined way of thinking and reasoning about program design. Bootcamps are only worth it if you already have a programming background, they were orig meant for people with Physics degress and shit w/some programming knowledge to learn "industry methology" (namely that cancer, Agile). You can definitely still go to one and learn without knowing shit but you won't get hired anywhere (unless you're female, then you can weasel in with the diversity quota.. this is actually talked about a lot on HN when doing Bootcamp jobs stats).

Otherwise you'd be better off just doing that edx track it will essentially set you up for a job working at elastic search or some other bigcorp that does java/typsecript, which is all of them these days. Once you get familiar with edx courses 1 and 2, you can start to do some real CS on the side too like this: functionalcs.github.io/curriculum/#org2c45041 learning all about computer systems (VIrtual memory, CPUs, C/Assembly, ect).

Aster please.

>not +++

>not +-

/dpt/, help!

So I have a certain amount of KeyFrames in an animation. Now I want to assign each KeyFrame a normalized "progression" value, which is a value from 0 to 1 indicating at what point in the animation the KeyFrame occurs. Basically, I have a 0-based index and a total amount of KeyFrames. I want 0 to be the first KeyFrame, and 1 to be the very last one. How do I calculate this progression-factor when given the index and the total amount of KeyFrames?

index / (amount - 1)

watch out if amount is 1

...

Was that made in Qt?

...

How do you handle animation between keyframes, lerp?

Sup Forums API + matplotlib

Hoping for more interesting data soon: I plan to run the script for these four boards for about a week or two and then to try to model it

Between keyframes I interpolate the 16 values that make up the transformation matrix, making the at-runtime cost of animating a model
16 * (interpolate costs) * amountOfBones

which can further be optimized to
9 * (interpolate costs) * amountOfBones

by taking into consideration that only the top left 3x3 part of the 4x4 transformation matrix will contain useful values.

This Space Invaders clone sucks.

It worked! Thanks, user!

...

He was asking what you use to interpolate.

I select the two relevant keyframes and then do (distance from keyframe 1) * keyframe1 + (distance from keyframe 2) * keyframe 2

any good resources for learning advanced compiler use. or is just diving into the docs and reading through the 6 gorrilionflags my best bet?
or do i not really need anything other than -o, -l, -On, and -g

man gcc

all the -W flags can be useful

OK. That's a lerp. Thanks for telling us.
I'd recommend slerp for most types of animation. Certainly for a general type.
en.m.wikipedia.org/wiki/Slerp
number-none.com/product/Understanding Slerp, Then Not Using It/

Before you have a specific purpose you really don't need any other flags.

Quick, print "Baka" to the console in your language of chocie, I'll start.

Go:
package main

import "fmt"

func main(){

fmt.Println("Baka")

}

void main()
{
import std.stdio: writeln;
"baka".writeln;
}

whats gridworld?

fn main() {
println!("Baka")
}

>Go
I tried to create a Go wrapper for a C api(Godot Native) last weekend, and holy hell what a cluster fuck it is to do that shit in Go, especially when it involves callback functions.
Got it to compile and run, but holy fuck what a pain in the ass.

main = do
putStrLn "Baka"

actor Main
new create(env: Env) =>
env.out.print("Baka")

My nig. So many bad AP CS memories of that. Wish they switched back to the old curriculum, apparently you got to make fun things like a chatbot, and it was easier to get a 5.

print "Baka"

This is going to be a fun function to write!

void AnimatedModel::recursiveKeyFrameBuildup(KeyFrame& frame, unsigned int& amountOfBonesFound, aiNode* currentNode, const glm::mat4& parentTransform, const glm::mat4& rootInverseTransform, const std::map& channelMap, aiAnimation* aiAnim)

>wishes it was easier to get a 5
What did you get?
Also,
>brainlet

program Baka;
begin
WriteLn('Baka');
end.

"Baka

import org.eolang.cli
import org.eolang.printed
import org.eolang.string
cli:
printed:
string:
"Baka"

echo "Baka"

I hope you arent actually using that abomination.

Hi, welcome to Sup Forums!

are esolangs cheating?
↘↓

↘ ← ↙
⤢↘ ↘← ↑
↘← ↑⤡↙ → ↙ ↓↙↙
↙ → ↗ ↙
↘ ← ↙↙↘ ↙↘ ↙ ↑ ↘←
↘ ↑↕ ← ↓↓↑ ↙ ←
↘ ← ↙ ↕← ↗ ↔↙
↗↓ ↑↑ →↖ ↙← ↓ ↘
→ ↘ ↘ ↓↘← ↗ ↙↙
↙ ↖ ↘ ←↓↙← ↑ ↑↑
↑ → ↘ → ↙
↘ ↙ ←↙
↘ ↕ ↔ ↙↙ ← ↙

↑ ↘ ←↓↓↓ ↓↓↓ ↙↘
↘→ ↘ ↙ ← ↑
↓ ↘ → ↘ ↙ ←
→↘ ↓ ↓ ↙← ↕←
↗ →↘ ↙←
→↗ ↓ ↖← ↖ ↕ ↔ ↙
↗↔ ↖ ↑↓ ↙↑ ↖← ↑↘
↙ ↓ →↗→↖↑ ↑ ↑
↗↖ ↑→ ↙↓ ↙
↑ ↗ ↔ ↖↙←↙↓↖
↗↔ ↕ ↑ → ↙
↘ ←↗ →↖ ↘ ↕ ← ↖ ⤡
↗ ← ↙ ↑
↙ ↖ ↓↖← ↖ ↑
↓ ↓↑↙ → ↘↑↓↖
↗ ↙← ↑ ↙→ ↕
→ ↖
⤡ ↖ →↗ ↓ ↖
↑ ↑ ↗↖