/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

discord.gg/UEEKQ
en.wikipedia.org/wiki/RSA_(cryptosystem)
discord.gg/CqUF4
github.com/karpathy/convnetjs
twitter.com/SFWRedditImages

No.

Stop.

The real anime poster only makes another thread if the first one was posted before bump limit.

Yes.

nth for good thread

The other thread is dead, this is the official one.

Sage and report the other one.

Did you guys program in Prolog?

Both threads are dead.

[spoiler]But still, I agree.[/spoiler]

Can we just have a consistent /dpt/ instead of shitposting about which /dpt/ is right? It's worse than the constant "ryzen BTFO/intel is the botnet!" meme.

Unrelated: Is there a /dpt/ irc channel or discord yet?

Yes.

discord.gg/UEEKQ

Yes, it's called the Usenet.

why do you fucking faggots keep posting anime images for dpt? like wtf is your issue with another type of picture? shit like this and all the other anime bollocks that pervades this board is why the good posters moved to reddit

#5..6
>bollocks
oh look its another dumb yurucuck lost on his way from reddit

baka op

Baka janai yo!

Bumpung question

You may want to try the currently active thread.

>complaining about mongolian pictographs on Tibetan basketweaving imageboard

First for ML master race

I will make robot take your job (ง ͠° ͟ل͜ ͡°)ง ≧◡≦

guide for ricing, pretty much done with bspwm, what other WM/DE should I do?

WindowMaker.

what?

quick have you implemented back-prop in js?

@59734796
>is why the good posters moved to reddit
Move you there as well.

what is the best way to structure your code when you are making a video game programming it all?

Put everything in one big file so it's easier to delete when you give up.

>meme answer

You're going to need to elaborate on what you're actually asking.

This highly depends on the language, how many people you're working with, and a myriad of other factors relating to the actual game.

C#, 1 man army, and a 3d puzzle horror type game like the old school Resident Evil games

Need some help with Java OOP if anyone willing to help.

I have 3 Classes:
+ MainApp,
+ a Basic Class ( Primitive data types )
+ and a Container Class ( This class holds an ArrayList of Objects ( The objects being the instances of the Basic Class )

What I'm struggling with is how I get the Container Class to collect data from the Basic Class.
I can create instances of the Basic Class using variables e.g:

[script]
CarSpace a01 = new CarSpace(01,'a',"Standard",true,1.0,2.0,5.0);
[/script]

But I want this information added to the ArrayList in my Container Class.
So then my methods in the Container Class can use the ArrayList.
If I am being to ambiguous I'll add more information if need be.

Image:
Red : Container Class
Blue : Basic Class

Any help would be appreciated.

I really need some advice in creating a dynamic crypto key gen for selling my program using this (keys), would give bt on precious info or, just don't post deposit addresses. I'm a mediocre programmer who didn't go to any school, using c# .net

>rolling your own crypto

How?
I certainly can do it with just having minimal basic knowledge on it - which is what I need

don't

Too much money though

use a library and follow advice

(You)
Which I need.

you would use the get methods to get specific information of the objects

I'll try, but, is there any book I can gather knowledge from? White hatting here like an ethical dude

look up a page on the internet
don't do it yourself

cool what else. I got i3, herbs.., basic unity ricing, awesomewm, ncmpcpp

No security that way, anyway, thanks dude

OOP is the only way to program

Don't false flag.

look up what to do on a page on the internet
don't implement your own crypto shit

and even then that's telling you how to USE a library, definitely don't write the library yourself

What if my name is Ron Rivest?

I get that ( No pun intended ).

So I should call the getters from within the Container class? OR:
So everytime I create a new instance of 'CarSpace' I have the Container Class 'get' that info and add it to the 'ArrayList' by having a 'call' for the setter ( For the ArrayList ) in my Basic Class constructor? Because that's the only time I all the fields are together?

Sorry if I am missing something; I am new to this.

then you'll be someone i've never heard of with a ridiculous name

yes the second one everytime you create new instance of it have it retrieve the information and store it in the ArrayList or just store all the new instance objects in the ArrayList objects array whatever you are trying to do

en.wikipedia.org/wiki/RSA_(cryptosystem)

Are there any Java back end developers here? Do you like your job? I'm thinking about changing my job from Android developer to back end developer.

I have done some Java back end I would recommend you try it out see if you like it

>discord.gg/UEEKQ
the invite expired, can you post another

discord.gg/CqUF4

A Java Swing app for practise. Looking to get into android development.

Can someone link me the discord?

Thanks so much, Last question. Will I just use one variable to pass data from the MainApp ( Data Entered )
to the Basic Class. As a variable for evey instance seems unessasseary as I'm using the
ArrayList in the methods.

E.G:
[script]

CarSpace a01 = new CarSpace(01,'a',"Standard",true,1.0,2.0,5.0);

// Here the Basic Class is sending the data to the ArrayList

CarSpace a01 = CarSpace(CarSpace(26,'z',"Disabled",false,0.3,2.0,5.0);


[/script]

Do you have any idea how difficult Java back end is compared to front end like Android? I asked the same question to a C# coworker and we came to the conclusion that it's about the same in terms of difficulty.

Employed C# back-end dev here.

I'll take back-end dev 1000 times over before I ever touch UI again.

invites not working can you post a new one?

I've also looked into C# back end job offers, but I soon realized that I'd rather stick with the Java ecosystem. I don't really like the Microsoft world (not that Oracle is any better though). I would pick the C# job offer if no Java ones were available, but there are plenty to pick from. Java as a back end language seems to be especially popular in the banking industry.
>I'll take back-end dev 1000 times over before I ever touch UI again.
Why do you prefer back end over front end? Personally, I don't find UI all that interesting. I'd rather invest my time in writing proper business logic than in writing slick animations. I spend most of my time implementing video players, DRM included, because that's the most interesting task I have right now. Clicking a UI together isn't that interesting.

why the fuck would anyone implement back-propagation in javascript

do it in a real language like a normal person

javascript is a fine language to implement back-prop.

I think you meant "Swedish Antiques/Thrift IRC"

i think you meant [ "code" ] ["/ code "]
but if this doesnt work im just making a fool of myself kek

Thanks I forgot what the correct tag was :^).

github.com/karpathy/convnetjs

Why do people love Java?

high level, statically typed, well tooled, state of the art gc, stable

In 1998 it was much easier to work with than C++. Once the hype was here, it never left.

How would i go about writting a function to freeing the memory used here?
struct node {
struct node *so1,*so2,*so3;
struct node *next;
char *type;
char *trm;
int flag;
};

to allocate a new node i do
struct node *make_type_node(char *type)
{
struct node *new_node = malloc(sizeof(struct node));
new_node->so1 = new_node->so2 = new_node->so3 = NULL;
new_node->next = new_node->trm = NULL;
new_node->type = type;
new_node->flag = 0;

return new_node;
}

to print the tree (recursively) i do
void print_tree(struct node *tree)
{
if (tree->trm && tree->flag == 1)
printf("%s\n", tree->trm);
else if (tree->trm && tree->flag != 1)
printf("%s(%s)\n", tree->trm, tree->type);
else
printf("%s\n", tree->type);

if (tree->so1) print_tree(tree->so1);
if (tree->so2) print_tree(tree->so2);
if (tree->so3) print_tree(tree->so3);
if (tree->next) print_tree(tree->next);
}

What's the upper bound for your tree? Use a stack located storage pool and it'll go out of scope when your access type does.

>What's the upper bound for your tree?
my what?

i was just looking for a function that frees the tree
something like (obviously not this)
void free_tree(struct node *tree)
{
free(tree);

if (tree->so1) free_tree(tree->so1);
if (tree->so2) free_tree(tree->so2);
if (tree->so3) free_tree(tree->so3);
if (tree->next) free_tree(tree->next);
}

Upper bound, meaning the max number of allowed or expected nodes. I told you how to do it the fast way. For plain C, move the free(tree) to the end of that function and you'll be fine.

>Upper bound, meaning the max number of allowed or expected nodes.
well i don't know.
i'm parsing real programs. depends on the size of the program

>It's worse than the constant "ryzen BTFO/intel is the botnet!"
No. the GPU/CPU Intel/AMD/Nvidia wars on Sup Forums are definitely the worst thing on the board. Worse than anything else on the board besides maybe that one SJW who I think is just a troll.

Your memory isn't infinite. There is always an upper limit. You just might have a high standard deviation.

==13387==
==13387== HEAP SUMMARY:
==13387== in use at exit: 17,140 bytes in 200 blocks
==13387== total heap usage: 674 allocs, 474 frees, 43,684 bytes allocated
==13387==
==13387== LEAK SUMMARY:
==13387== definitely lost: 675 bytes in 196 blocks
==13387== indirectly lost: 0 bytes in 0 blocks
==13387== possibly lost: 0 bytes in 0 blocks
==13387== still reachable: 16,465 bytes in 4 blocks
==13387== suppressed: 0 bytes in 0 blocks
==13387== Rerun with --leak-check=full to see details of leaked memory
==13387==
==13387== For counts of detected and suppressed errors, rerun with: -v
==13387== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


its not freeing all memory i guess?

hey guys, i need help.
im trying to make some kind of map(maybe like pic related? just a concept) which is navigable by the user through a 3D UI. The thing is that I want the program to be able to import and display images/text and play audio or video files. since i've never writen a program that involves 3D rendering of any kind I thought about using Unity3D. Is this a good idea? I've only used python, C++, C# and java. What would you guys recommend?

Is 'type' and 'trim' being deallocated anywhere?

no they are not.

i never malloc them.

i just pass them as parameters like
make_type_node("Function");

Debating becoming a dev vs going into finance

I like programming more than finance, but I hear dev work can end up as low-prestige codecuck with meh pay.

Finance is cuckery of a different kind but at least you get paid a ton and wear a cool suit.

Any advice?

My best guess is that you're replacing a node with a new node. Therefore losing memory.

you're going to figure it out.

don't worry

finance

How would you write a simple program in visual basic that calculates the sum of all odd numbers between 1 and another number? Not bait or anything, I'm just retarded.

both have excellent pipelines to alcoholism and suicide it's sort of an at your own pace kind of deal.

> visual basic
> I'm just retarded
checks out.

Why

more money

It's not up to me. I wouldn't use VB either if it was my choice.

You can do that in excel tbqhwu

take control of your life man you're being made to write VB. At some point you have to take responsibility for how bad things have gotten.

Here's the steps to do it in any language
>Google hello world in X
>Google variable declarations in X
>Google arithmetic in X
>Google loop control in X
>Good mod operator in X

python
compute = lambda n: sum([i for i in range(n+1) if i&1])

print compute(5) # prints 9 because sum of 1,3 and 5

nice use of lambda.

Resposting in hope for answer
So i have this .dat file that has a dictionary in it (dumped with json)
the only thing that's written in the file is {"Dan": [1500]}
but when i try to makes this file a dictionary in python this happens , line 24, in load_reg
register = dict(register_file)
ValueError: dictionary update sequence element #0 has length 15; 2 is required
full fuctiondef load_reg():
global register_file
global register
if os.path.exists("accreg.dat"):
print("Debug[1] Reg File Found")
register_file = open("accreg.dat","r+")
print("Debug[2] File assigned to register_file")
register = dict(register_file)
print("Debug[3] Created register reference")
else:
print("Debug[1] Register File Not Found")
register_file = open("accreg.dat","w")
print("Debug[2] File created & assigned to register_file")
load_reg()

thanks

>both have excellent pipelines to alcoholism and suicide
this