/dpt/ - Daily Programming Thread

"I want to make videogames" edition

What are you working on, Sup Forums?
Previous thread:

Other urls found in this thread:

marc.info/?l=bugtraq&m=104612710031920&q=p3
github.com/luutifa/openglpractice
twitter.com/NSFWRedditVideo

T-Thanks for anime picture ....

>ywn be as good as nene at programming

@61385669
stop changing your trip you autist

No bul my girlfriend!
S-She didn't change anything!

i don't give a fuck as long as i get paid

Please stop this gay ass stutter posting you fucking spastic nonce

>T-Thanks for anime picture ....
NP, but i still think you should fuck off with your VM shitposting, to containment boards like

W-Whoa, y-you did so much work!...
....
I-I wish I was as good as y-you...

V-Virtual Machine? N-Nobody is posting about virtual machines a-user..

@Compiler
inline my function for me, thanks

I really hope your language of choice allows you to force inline things.

The compiler knows better about whether the function should not be inlined.

I-I am not that good! I bet R-Rub sempai would be able to write much better code than me in a shorter amount of time!

I-If you n-need me to explain any part of my code then p-please do feel free to ask :3

I-I don't know much a-about the IRC protocol...
.....
W-What does this part m-mean?
....

send "USER #{nick} 0 * #{name}"


W-What is difference between n-nick and user name?

Any clojure lads, use Figwheel?
Seems neato.

N-Nick is the name that the other people will see on the channel and the name that they w-will use to refer to you. T-the name is the real name of the user (o-or something that looks like a real name, usually it is the same as the nick). You see the real name with t-the \whois command.

W-Why is there a real name? ...
T-This is the internet .... only cute girls browse it r-right?

S-So that c-cute girls like us can put their full name, s-such as Iwakura Mikoto for e-example!

I-I think I n-need t-to read m-more on IRC....
T-Thank you for the h-help ....
I will g-get off for now...
....
I-I won't be o-on tomorrow e-either ... but the d-day after that I w-will be...
⊙︿⊙
....
s-sorry..

Kill yourself, avatarfag.

S-See you around~
Thank you f-for programming with me and becoming my friend ;-; (w-we are friend, r-right?)

Reading the Haskell Wikibook.

Y-Yeah w-we are f-friends...
ʕ→ᴥ←ʔ

It was common for people to use their real names on the internet at one point (and now is becoming common again)

Gentlemen, take note: this is what an arbitrary command execution vulnerability looks like:

elsif msg.match(/PRIVMSG (\w+) :(.*)\r\n\z/)
from = $~[1]
body = $~[2]

# here we will use the console if the message contains colours! ^.^
puts "#{from}: #{body}"
end

Now you might think to yourself: "Wait a second, there's nothing wrong with that. They're just printing arbitrary text received from the Internet onto a terminal that may or may not support ANSI escape sequences." Yes, and that is exactly why the program is vulnerable.

marc.info/?l=bugtraq&m=104612710031920&q=p3

Is there any webshit security reads you recommend?

+1

Off the top of my head, no. But as some general security advice, sanitize the fuck out of everything, and trust nothing.

hey whats up
we are streaming project euler problems at twitch /fmdud
im also the watch guy
chat gets to choose the programming language

T-There is no escape s-sequence that can't be fixed with reset >.<
T-Thank you for mentioning it however, I-I will scan for escape codes.

>T-There is no escape s-sequence that can't be fixed with reset >.

f-fixed, t-thank you :3

Anybody has an idea how to check this radiobutton with selenium ? It has no id name or class to really identify it by so it seems a bit tricky.

>"I want to make videogames" edition

Well this is awkward. Question is vidya related.

I'm working on a game where the player "tethers" to a robot with a rope. We've created a verlet fixed constraint to make the rope and keep the player and the robot connected. Problem is, there's a lot of drag that gets introduced when this happens.

If I change the compensation so that the player is not affected by the fixed constraint system, the player doesn't suffer any drag, but then the player can move beyond the ropes range if the robot is locked into the ground (for puzzle reasons), which defeats the purpose.

As a temp solution, we've given the player a movement multiplier while tethered, which works, but feels real strange to play with. I was wondering if Sup Forums knows a better way to go about it?

[spoiler]inb4 >unity[/spoiler]
Here's the verlet calculations:

void UpdateLink(ref Vector3 _linkA, ref Vector3 _linkB, float _compSpeed)
{
Vector3 delta = _linkB - _linkA; //get offset
float deltasqrlength = delta.sqrMagnitude; //get sqr magnitude for faster distance checking

if (deltasqrlength > 0 && deltasqrlength > maxDist * maxDist)
{
float deltaActualLength = delta.magnitude;//get the actual distance for calculation purposes

//calculate the distance the segment needs to move to
float diff = (deltaActualLength - maxDist) / deltaActualLength;
_linkA += delta * _compSpeed * diff;
_linkB -= delta * (1 - _compSpeed) * diff;
}
}

A demoscene prod for Assembly 2017. A friend of mine does the music track and I code, direct etc.

github.com/luutifa/openglpractice

I need some faggot to help me find a solution for my school work. Will you be that faggot? [spoiler]i have cute feet[/spoiler]

I don't care about your feet.

ok I figured it out, for anyone interested I simply did it with find_element_by_css_selector was pretty straight forward

elem=self.browser.find_element_by_css_selector("#input_attached_optvar_use_prenumber > div[class='left'] > label[class='custom-radios'")

what's selenium and what do you use it for?

Pretty entertaining to see the struggle with rust

Post soles and I will help
Are you a boy or a girl?

#include

template
class foo {
public:
static void print () {
foo::print ();
std::cout

it's basically a framework that automates stuff you do in the browser. so it basically clicks through websites for you, can input text and check boxes basically everything you can do to a webpage.

I use it to automate restarting the WLAN for my parents and also to automatically set up their phone in the router incase it doesnt work (which has happened before). I do that so I dont have to explain to my mom on the phone how to access her router configuration program and do all that on her own because she isnt good at that sort of stuff.

Now do it in a non shit language

this is the most shameful, autistic display I have ever witnessed

how did she manage to turn a for-each loop into an infinite loop?

>for-each
only shit languages have this

>he enjoys manually writing
for (int i = 0; i < thing; i++)
[/code

instead of just
foreach(i; thing)

Agree, proper languages have map instead.

>being this much of a brainlet

Best way to make a small GUI for a python program ? Is Tkinter the way to go ? I really only need a Window with 2 or 3 buttons that call functions nothing more.

/dpt/ what browser should i use until Netrunner gets usable in 2050?

It's a waste of time unless you know you need to execute sequentially.

Its late and i wasnt paying attention.
>his foreach isnt flexible

we are about to do problem 6 in brainfuck

Firefox so you can prepare for Rust.

Ive tried servo, buts its far from usable right now.
But i really dont want to support mozilla desu.

Yep it's pretty easy

Or you could just use a snippet

>Kate

Chrome is botnet. Firefox is SJW. Pick your poison.

>pleb

What language is this?

C++

>his language has more programmers than programs

what did xir mean by this?

Who here programs on ((linux))?

...

I program on GNU/Linux, not Linux. I don't believe Linux contains a compiler, or even a text editor.

Where are the feet you fag? I am waiting

sooples

Linux is a kernel, faggot

GNU/Linux is Linux.
In fact, as far as anyone except RMS and LT is concerned, GNU is basically Linux, and Linux itself is more specifically "the Linux kernel." Android isn't Linux because it's not GNU, it's "the Linux kernel" with Google shit instead of the "rest" of Linux. Whereas Mac OS and Hurd basically are Linux, because they're GNU.

>Android isn't Linux because it's not GNU
?

If I run this program from Eclipse everything works fine, it shows the UI and the buttons run my functions.

However if I just go into the explorer and run the main.py file it doesnt seem to do anything. What am I missing here ?

root = Tk()
root.wm_title("Router Config")
root.resizable(width=FALSE, height=FALSE)

class routerConfig():
def __init__(self):
print("router config loaded")

def restartWLAN(self):
#DO SOMETHING

def setupPhone(self):
#DO SOMETHING

def main():
cfg = routerConfig()

button_wlan = Button(root, text="WLAN neustarten", command=cfg.restartWLAN)
button_phone = Button(root, text="Telefon einrichten", command=cfg.setupPhone)
button_wlan.grid(row=3, column=3)
button_phone.grid(row=3, column=4)

root.mainloop()

if __name__ == '__main__':
main()

I think (((Linux))) is the majority here

>Android isn't Linux
>But MacOS is Linux
The sad part is, I don't know if you are joking, that's how low the standard of Sup Forums is

what do you mean doesnt do anythinkg?

console opens and instantly closes, UI doesnt get shown.

because it isnt expecting any input from the user , so it closes
if you want it to stay open , add a input() somewhere

The point I'm making is that as far as plebs who don't program are concerned, GNU is called "Linux," and Linux is called "the Linux kernel." In their eyes, GNU is so ubiquitous to Linux that anything which has GNU on it is Linux, and anything that doesn't isn't, kernel be damned. So Android is "a non-Linux OS on the Linux kernel" and Hurd is "Linux on a different kernel."
My thesis here is that in language, usage ultimately decides correctness. Screw accuracy to the developers' original intentions, we should be calling these things what everyone else calls them. Sorry RMS, your software is now officially called "Linux." Sorry LT, your software isn't well known enough to have a name of its own independently from RMS's software.

I'm not. But I'm not an idiot either. Just a language realist.
See:

maybe I am understanding this wrong but isnt the point of root.mainloop() basically exactly that ? I thought that was TKinters way of keeping the window open and waiting for user input ?

OSX is also BSD

OSX is actually NT

try this program
from tkinter import *
from tkinter import ttk

root = Tk()
loop = 0
block = BooleanVar(root, False)

while loop < 2:

print ('loop')

def user_data():
user_input = data.get()
print (user_input)
block.set(False)

lb=ttk.Label(root, text="Enter data")
data=ttk.Entry(root)
bt=ttk.Button(root, text='Ok', command=user_data)

lb.grid(row=0, column=1)
data.grid(row=0, column=2)
bt.grid(row=0, column=3)

block.set(True)
root.wait_variable(block)
loop += 1

print ('left loop')
root.mainloop()

>I'm not an idiot either
Sure.

NT is actually Multics

see:

>using DK studio
absolute disgusting

also doesnt show if I simply doubleclick the .py file. when I run it through Eclipse everything is fine though. any ideas why this is ?

Yeah, it was a response to your mindless blabbering.
Sup Forums is dead.

What was? What I just linked you to?
Because you'd be wrong. That was me as well.

I have Python 2.7 and 3.5 on this computer so maybe it is running the wrong version by default ? can I somehow specify which version Windows should use for that script ?

>also doesnt show if I simply doubleclick the .py file

you want the program to open the GUI when you click it two times?

on linux, you have to do chmod +x your_program.py

you can match on the i18n:id with the css selector

maybe
import sys

if sys.version_info[0] < 3:
raise Exception("Python 3 or a more recent version is required.")

>That was me as well.
I know, you have reached the peak of idiocy, congratulations on your second-to-none stupidity.

>The sad part is, I don't know if you are joking, that's how low the standard of Sup Forums is
This