/dpt/ - Daily Programming Thread

Old thread: What are you working on Sup Forums?

First for D

x86/arm Forth with an editor which traces the stack items lifetime to make it easier to teach kids with it. Mainly for a 7 year old but will add binding for opengl, ect... so might end up as a learning tool for older ages

Nothing. I started doing some apps on Xamarin and I got bored at how primitive it is, and the java interface of Android Studio almost gave me cancer with the high latency of the IDE. I'd rather develop WPF on Visual Studio desu.

I tried D today. It's pretty good.
Now tell me why I shouldn't use it.

D stands for Dead.

C and D are muh waifus

I have started programming a few weeks ago. Using html5 w/ javascript. Not best combination, but it's easy to learn and works for what I want to make. Currently working on a tile based puzzle game. Like conway's game of life and minesweeper.

Use it if it werks 4u

No one answered what anime girl is Rust. Lain does make sense for Lisp though.

umaru. the reason is obvious

>Other thread talking about programming
>This thread is talking about anime

Why should I use this thread again?

animu + programming > programming

float Q_rsqrt_distance(glm::vec3 vector1,glm::vec3 vector2){

// remove this and it will not be reliable{
float value = abs(
(vector1.x-vector2.x) * (vector1.x-vector2.x)+
(vector1.y-vector2.y) * (vector1.z-vector2.y)+
(vector1.z-vector2.z) * (vector1.z-vector2.z)
);
if(value

Why not use glm::distance?

because square roots take too long

when you only want to find the order of objects in 3d space (the actual quantity doesn't matter) fast inverse square root is better

how do these libraries normally calculate square roots?

If it outputs the real distance, it uses the standard math.sqrt()

and how does math.sqrt() calculate it? newton's method?

Some variation of Newton's method or Pell's equation or something. They're not too intensive, but if you're doing millions of them 140 times a second, it can be worth it to break out the old floating point bitmath voodoo.

I don't know

I think probably a taylor series representation of the square root would be the best

thanks anons

I'm currently coming up with syntax ideas for C-like a programming language I want to make.
Does anyone have any opinions or suggestions? These are just random ideas that I've jotted down, so they haven't been thought through thoroughly, and may have weird inconsistencies and not work in all situations.

Pretty much every processor made in the last decade implements invsqrt() in hardware. You're slowing yourself down by using a technique meant for 90s hardware. The obvious method will actually be faster.

Why do people have babies when they could write code?

What sort of free software projects can I contribute to in order to better learn how to program?

How do I like, get into a project at all?

I know Java, Haskell and Prolog. Maybe a little C++.

I forgot to mention a couple of things:
'a' and 'b' are always supposed to be the same type, and const qualified. None of the pointed-to types are supposed to be const qualified though.

developing a UWP app for xbox1, using visual studio + c# + monogame.

super easy to setup and get working. very fast to develop. an empty frame takes about 300 ticks to draw, so fast enough for anything i can throw at it.

because normalfags gonna normalfag
browse github or any gitshit site until you find a suitable project

C-like is so uninteresting

What does the app do?

I made a program in java that alphabetically lists the items in a specified directory and marks them as file or directory. Defaults to the current directory. It works, but I have a feeling that it is a shit implementation.

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;

public class ListDirectory{
public static void main(String[] args) {
// Default directory
String path = System.getProperty("user.dir");

// Check for path argument
if(args.length > 0){
path = args[0];
}

// File objects
File folder = new File(path);

// Check if directory exists
if(!folder.exists()){
System.out.println("Directory does not exist.");
System.exit(-1);
}

// Create array of File objects
File[] fileList = folder.listFiles();

// Array to hold strings of file and directory names
ArrayList filenames = new ArrayList();

// Variables for counts
int dirCount, fileCount;
dirCount = fileCount = 0;

// Add strings to array
for(File file : fileList){
if(file.isFile()){
filenames.add("[FILE] " + file.getName());
fileCount++;
}
if(file.isDirectory()){
filenames.add("[DIRECTORY] " + file.getName());
dirCount++;
}
}
System.out.println("DIRECTORY: " + folder.getPath() + "\n");

// Sort alphabetically and print
Collections.sort(filenames);
for(int i = 0; i < filenames.size(); i++){
System.out.println(filenames.get(i));
}

// Print counts
System.out.println("\nAMOUNT OF DIRECTORIES: " + dirCount);
System.out.println("AMOUNT OF FILES: " + fileCount);
}
}

Learn how to write comparators senpai.

rate my scala fizzbuzz
i started programming 6 hours ago so dont be rude
for (number

How realistic is it to think i'll find employment if i'm a self-taught C++ programmer?

Not at all, just repeat after me:

>would you like fries with that?

its actually a game, i'm using the term app loosely. basically, its zelda:lttp with modern improvements, a synthwave soundtrack, and a dark adult oriented story.

PROTIP: put code inside ... but with square brackets instead of angle brackets.

dont forget to use the "friend" keyword alot, so everyone knows how popular you are. srsly, c++ is poorly designed garbage from a bygone era.

This is an example post to show what user is talking about

I have a semi random question. Why do almost all code programs default to courier new. Is there a special reason?

Trying to convert C code from an executable to a DLL. I'm not getting the same output and have no fucking clue why.

It's a very widely available monospace font that is already installed on most systems.

i just want to make video games to play
i went to computer science because i wanted to program video games like crysis and blackops

...

do they make video games like crysis and blackops there?

Please don't respond to obvious bait.

Yes, totally

i don't see anything about that? what the heck dude?

You have to learn to read between the lines.

explain?

professional programmer here

I will write you one function for your program

You think they're actually posting about what they're posting about?

Write a function that will generate code for the perfect waifu

i would like the identity function please

write me a ps/2 mouse interrupt handler
as C++ class member function

yeah, do you have reasons to believe otherwise?

Yes.

i'm all ears.

Then how are you typing?

perfectWaifu :: ∀ a. a -> a
perfectWaifu = undefined

by hitting the big keys on the machine

>Tfw Java now has Lambda

did java not have functions before?

you can now use -> to get rid a ton of OOP bloat it is very useful and makes Java less verbose

its supported lambdas for a couple of years user

>took java around 80 years to catch up with everyone else

how does that answer my question?

>java
Die of AIDS already holy fuck

waaay past your bedtime.

Do you have brain damage?

>responding to meme posts

>Javascript

Trying to learn me some ruby on rails,

can someone tell me why it's rendering show.html.erb instead of goy.html.erb?

If you can see, the articles controller defines goy.

I have to read and scan a large text file (20+ mb) in java. Then search through it depending on whatever the user is looking for. All advice leads to using Java's stream operations but I can't wrap my head around how to use it.

So, when I write a C program, I compile the source to object code, then link the object code to an executable, right?

Let's say I have a really basic program that doesn't use any external libraries. If the object code is just machine code with no external dependencies, why can't I just compile the source with "gcc -c" and run the object code directly?

Why do I still need a linking step in this situation?

C stands for cancer

do not defile anime by your redditry.

> using notepad++ to code
Scared of a real IDE?
Scared of a debugger?

Yes to both, thanks for the help.

That is one of the best books for java programming it is really good with all the exercises in there for every single subject on programming

Scared of not shitposting?

Vim + GDB master race

Obviously he does since he's using java.

Hey guyz how can i print the following with C?
1 2 3
1 2 3
1 2 3

I'm using C if that matters XD The best language :DD

return to your shitty thread, namefag.

somebody PLEASE respond

Looks like the type of problem a C toddler would run into

No bully

Im using C btw

THAT DOESN'T ANSWER MY QUESTION

Sorry senpai is this better

It has helped out a bunch.

why?

I was thinking about responding, but then you posted a fucking frog.

I'm using C if that matters

i ran out of animes

yup, that was a trick question. definitely confirmed for plebbitor.

File formats. An object file is not an executable. Neither one is raw machine code. An executable is an ELF binary on Linux, Mach-O on Mac, etc. They have headers and other structure.

how is that Pro JavaFx 8 one? I have never seen it or read it

You a data structures man, or an algorithms man?