/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: dpt.jpg (270x224, 14K)

Other urls found in this thread:

en.wikipedia.org/wiki/Gorillas_(video_game)
en.wikipedia.org/wiki/Scorched_Earth_(video_game)
projecteuler.net/problem=496
github.com/imbushuo/mac-precision-touchpad
leetcode.com/problems/3sum/
pubs.opengroup.org/onlinepubs/9699919799/functions/wordexp.html
benliu.info/celtic/index.html
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.8688&rep=rep1&type=pdf
twitter.com/AnonBabble

reminder to use applicative functors, monads and all of haskell's other useless nonsense
thank you for using an anime image

>anime image
Why is that necessary?

You're welcome.

I'm working on my gayme in Unity.
I keep getting caught in dilemmas of whether to try to do things "Unity way" or just do the simple thing.
Shortly after I do anything, I find out that the other way was the better one.

Attached: 1556497714739.jpg (418x577, 121K)

HOW MAKE WEBSITE

I had a question about memory usage in python. Say i have a script like this:


import datetime
import time

while True:
if datetime.datetime.now().time().minute == 00:
print("go fuck yourself")
time.sleep(60)
time.sleep(.1)



So every hour it does something. If I ran this 24/7 would this eventually take up a lot of memory? And is there anyway to either A. not make it take up a lot of memory or B. when it reaches a certain threshold of memory usage, restart the script?

Thank you, I am kinda noob at python.

No, the objects will be deleted when they go out of scope.
In this case as soon as the 'if' is checked, the datetime should be eligible for deletion.

>anime OP
Fuck off

Python has a garbage collector that is supposed to eliminate any unused memory.
If you would like to check if it is working, set your sleep statements to 0, run your program, and watch its memory consumption.
Does it keep rising indefinitely? If not, you're probably in the clear.
When it comes to computers, Testing > Trusting.

Paste this in notepad, save it as something.html and open it with a browser:


my first website


this is a heading OwO
this is a paragraph
this is another paragraph

>unused memory.
unused objects.

IT WORK THANK

placed some gorillas, and added basic shooting logic.
next comes collisions, and then switching players.

Attached: gorillas-rs.webm (800x600, 257K)

What the fuck is gorillas? Game?

I always hated Unitys C# coding style. Have you tried Unreal or Godot?

an old BASIC game
en.wikipedia.org/wiki/Gorillas_(video_game)

better shortly after than long after

Nope. How do they look like?
I like the idea of components, I need to unlearn the pajeet "it only does everything" style I've been dealing with so far both in hobby projects and professionally.
It's just that I never know what should be a plain object, what should be Unity object, what should be an interface etc.

It hurts motivation to see all those fuckups, though.

behold, the shortest path between an initial node and a goal node

Attached: fdsafds.png (417x321, 17K)

is this the inspiration for those tank games
and/or worms

lol

not sure if it inspired anything, since it came out the same year as the more famous:
en.wikipedia.org/wiki/Scorched_Earth_(video_game)
but I played gorillas.bas when I was a kid, so I'm making that one

you'll learn that components are pajeet-tier shit as well

it's really enjoyable subclassing fucking components in ue4 just because they don't implement basic functionality that is really quite frankly part of the job description. just swell.

using ue4 is just a battle with the retarded ebin preprocessor, the compiler, the instability, and the fucking shit arse documentation

i'm confused, appalled and angry

Attached: fdsafds.png (381x316, 6K)

This is neat! I like it.
Neat. user.
>What are you working on, Jow Forums?
pic related. wandering aimlessly still.

Attached: interesting.png (1282x752, 485K)

i see, nice

Attached: facegone.png (1920x1040, 316K)

I think your hyper parameters need adjusting

What shortest path algorithm are you trying to implement?
Has it worked on paper?

>you'll learn that components are pajeet-tier shit as well
I haven't heard of a pajeet code that uses those.
True pajeetcore is implementation inheritance everywhere.

components in practice use inheritance heavily and it's gross

pull out the typo and BEAT him

Attached: fdsafds.png (370x319, 3K)

Attached: congratulations.jpg (860x484, 65K)

>and BEAT him
Ya! Beat him off!

But that's still not shortest.

noice

collisions and player switching done
next comes adding game states and scores

Attached: collide.webm (800x600, 503K)

Anone~ Can you tell me how you got so good at JavaScript?

Attached: 6f81fae226ba68cd6f0f0bf216a6ac3e.png (1365x2048, 1.9M)

>>/wdg/

I have nothing against you lepers. Lord knows your jobs are necessary and _I_ certainly don't want to do it. But all the same, I would just prefer you stick to your side of the fence.

Don't listen to that dumb and uncute user. Cuteposting is programming related.

>Lord knows your jobs are necessary and _I_ certainly don't want to do it.
Is Javaspag really necessary? I don't see any new applications made possible by this Web 3.0 stuff, just a bunch of weirdos getting high on their own farts^W^H abstractions.

Thoughts on Dart?

Is there any website you use that doesn't require Javascript to work properly?

die pedo

What if 4chins was a 75 megabyte single page app, and every image faded in with a 1000ms animation? There's no way to select text, and uploading pepes requires a google/facebook/linkedin login. When you scroll halfway down a thread a popup politely demands you to subscribe.

This is the kind of future that haunts my sleep.

Show me a single page that's 75 megabyte and every image faded in with a 1000ms animation

I heard it smells like shower curtains

That does sound scary, but use of Javascript doesn't have to imply abuse of Javascript.
If you press F12 on your browser, you can see that Jow Forums already uses it.

>but use of Javascript doesn't have to imply abuse of Javascript.
it pretty much does these days though, you know a language is bad, when people would rather make transpilers for it and use those.

> Jow Forums already uses it.
and abuses it, how many maladvertising attempts by hiro are we up to now?
i think the most shady was encoding an obfuscated datamining javascript program as a png

are there any alternatives to Damn Vulnerable Linux? i can't even find an iso

>slackware in the current year

Classic Gmail. The while thing works on forms. It's fast as fuck, try it!

interesting post

???

Probably going to grow a lot because of Google's new OS. Quite bad but way better than js, I guess.

I've been learning java and I need help with what to do next.

I finished Head first java book and made radix converter and typing speed calculator from pic related. Now I started reading Core Java II Advanced features. What do I do now? Learn more about advanced stuff in java, keep coding stuff from pic related or do I go into algorithms? Or maybe something else? Also how much do I need to grind to be able to land a job as junior dev?

Attached: 1539282229304.png (1920x1080, 217K)

roll even though I'm not gonna do it

Babel is a thing because of old browser compatibility

roll

He's probably not talking about Babel but about stuff like clojurejs or typescript

Attached: tad_sup_n.jpg (598x439, 103K)

hm, I am coming from web development, mainly using JS, which I actually quite like.
Though there is no denying, that the amount of badly written JS out in the wild is immense, because there is 0 entry barrier and every idiot just uses jQuery and calls it a day.

Recently got into a position where I'll do some Android app development and could basically choose what I want to use.. native with Java, Nativescript-Vue, React native, Dart/Flutter.

Only started learning Dart a few days ago, but so far I am really liking it.
I was honestly surprised how popular Flutter was already, especially compared to Nativescript, which unfortunately might not get off the ground, looking at current trends.

Attached: trends.png (616x411, 22K)

clojurejs is just autistic lispers wanting in on the JS hype without wanting to learn anything new because that might confuse them, TS is just optionally typed JS

Ditch Unity, pick up Monogame and write your game how YOU want to write it (ECS)

how's your game coming along

Attached: gamee.webm (634x634, 1.92M)

rolling and only doing if i get something that looks fun to do.

>not using a lewd image with the bombs in censor position

h-how do you play it?

Attached: 1435515581122.png (653x716, 482K)

This thread's Project Euler problem is:

projecteuler.net/problem=496

Attached: euler.jpg (480x600, 115K)

Oh fuck that.

Put those challenges on your github + learn what you will be asked on the interview and you will get a job in no time unless you're a self-taught programmer.

I don't know how to ECS, though.
I'm using Unity partly to find out how to ECS.

These are so bad.

I am a self-taught programmer
Here's the other one

Attached: 1560473669079.png (3840x2160, 1.61M)

hey /dpt/, hoping you guys are better than /sqt/ for this. If I were to buy a replacement macbook pro trackpad and a ribbon cable, could I solder and attach all the pins to a raspberry pi or Arduino board and figure out what each pin does? And then could I use that to create a usb trackpad?
How difficult is this to do in theory?

>self-taught
Good luck then. Maybe becoming webdev is easier to get a job but I'm not a webdev so I'm not entire sure.

get involved into open source

>he """debugs""" with printf

Attached: Zz9Xbog.jpg (200x200, 6K)

>she debugs

Attached: 1545980712175.png (1920x1080, 2M)

Lamp I tried doing this once in vscode to track a state in real time and vscode froze my computer after 1000 printfs

>how hard is it
You'd want an oscilloscope not just an arduino. How hard this is depends on how they're doing it. I'm guessing they're using SPI. It wouldn't be too hard if that's the case. And an arduino would be feasible then.
github.com/imbushuo/mac-precision-touchpad
You could look into this driver (assuming it's the right trackpad) and get an idea. Might just be easier to port that driver to whatever you wanted than to use it to get an idea on how to build your own.

Overall I'd say this is very hard if that driver doesn't match.

Have you studied algorithms yet?
If not, study algorithms.
You should also dabble in a second language so you can understand what is Java versus what is universal.
It almost doesn't matter what language it is.
I like Clojure and you could learn a lot from it but at this point you could learn a lot from anything, so pick whatever you find appealing.

why not buy a usb trackpad?

Trying to do this problem.
leetcode.com/problems/3sum/
The evaluation includes an array of length 3000 so I can't use simple and inefficient methods to solve this without timing out. I need three values, I sort the array first. What I don't understand is when I test against the 3k array, my second iterator integer is somehow decreasing, and thereby giving me false values.
i comes before j. j will increment until it reaches max array length, then i increments one and j goes back to i+1
j+=1;
if(j==nums.length-1){
i+=1;
j=i+1;
if(j>=nums.length-1 || nums[i]+nums[j]+nums[j+1] > 0){
break;
}
}

In my output j is somehow decreasing without i incrementing which makes no sense.
This is how I'm finding my third int:
int index = Arrays.binarySearch(nums,j+1,nums.length,(nums[i]+nums[j])*-1);


Any idea how the fuck j is decrementing on its own? 99% of my output is correct. I have to slowly scroll through it to find a couple sections where it's like this. I am checking for duplicates by back tracking but because j is not following the expected pattern my check fails.

Attached: Screenshot from 2019-07-21 21-53-05.png (462x156, 14K)

Awesome thanks man, that does sound a bit too difficult unless that driver works haha
I'll probs just give up, I've got a bunch of other shit projects that I haven't finished that I should do instead. I'll search around and see what else I can find, but looks like it's a no right now.
Thanks for the advice!

added game states and score, also fixed to make it work in wasm again.
next up, adding juice and indicators for target direction, and it's due for a bit of refactoring.

Attached: scores.webm (800x600, 536K)

I'm probs not going to do it anyways and I don't really want the trackpad, I just like apple's use of linear actuators with the taptic engine thingy and would be interested to see if I could build out a cheap-ish usb trackpad with that.

Kusshi-sensei a cute!
A CUTE!

>try to debug
>the tools present the slightest opposition to my method of debugging
>go back to printf

zoomer

why not use pre-processing for every algorithm to make it faster?

pubs.opengroup.org/onlinepubs/9699919799/functions/wordexp.html

I love finding out that the exact function I need is part of the standard.

I wanted to contribute to a .NET project but unfortunately I don't have 30 GB of SSD space to install all the bloat needed to build it. And creating symlinks on my C drive caused installation issues for some of the bloat. Based pajeetsoft

compilation?
memoization?

If you honestly think about this, it's a prank by based macroshaft.
No one is dumb enough to install 30 GB of so called compilers/runtimes which could normally fit into 30 MB by any conceptual way.

Can you point to some good ones?

But what if you're going through 2 different materials with different speeds?

If I want to manipulate planar graphs for a video game that I'm working on based on Kolam patterns, what kind of graph data structure should I use?

I remarked people who work on Celtic knots usually use 2 planar graphs, the "gate graph", that represents the points, and the "knot graph", that represents the actual vertices of the line/knot that we draw around the dots of the gate graph. This is what is used here for instance :
benliu.info/celtic/index.html

I determined that for each points of a "kolam grid", there are 4 invisible vertices around, and that the kolam pattern represents edges that connect those 4 invisible vertices. Each edges should also have a property relating to its shape(sometimes the curve will be smooth, other times it will be stiff)

This paper recommends the uses of 4-regular "Gaussian graph"(that's the first time I hear this) :
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.8688&rep=rep1&type=pdf

What are your recommendations?

Attached: kolamproj.jpg (716x332, 74K)

Also, if I work in C++, should I use boost graph? Or is there another library that I should use instead?

would that be easy to create a pepe wojack classifier that puts all of those images in a separate folder?