/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: hoo dis.gif (640x360, 872K)

Other urls found in this thread:

github.com/jimccann/cavez
paste.pound-python.org/show/jeSiaCarQEV7fDOplXqK/
youtube.com/watch?v=VqjAUFPDl1s
youtube.com/watch?v=EspuTqrbCP0
nuitka.net/
github.com/xoreaxeaxeax/movfuscator
youtu.be/DqL7GYXFc-s?t=17s
skate54345-land-of-giants.glitch.me/
pastebin.com/Ze4EpkAf
crystal-lang.org/
rantonels.github.io/starless/
github.com/rantonels/starless
nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
twitter.com/SFWRedditVideos

First for Lisp

still working on cavez
github.com/jimccann/cavez
third major overhaul of all code, think i've finally got it this time. everything seems to work now including aliases
haven't tested setting priority yet. will test override and fallthrough as soon as i can think of use cases for them

Attached: Screenshot from 2018-09-15 22-48-43.png (1920x1080, 146K)

What's the best drug for concentration? I'm interested in whatever, but it'd be cool if it was a research chemical.

test post from script

bupropion helps me concentrate

python is really ugly and probably not the best for the task
cool project though

that's ruby not python
and yeah it's pretty ugly but it's really convenient to work in
and thanks

you can if bar has a default constructor. but in that case, barobject would first be default-constructed as foo is initialized, and then assigned 0 as foo's constructor body runs. member objects are (and in fact must be) constructed before the constructor body runs. a major idea in C++ is that (1) object lifetime is tied strongly to scope, and (2) an object should be in a valid state at any given point in its lifetime. this ties in with RAII and exceptions. if objects acquire resources (like memory) in their constructors, and free those resources in their destructors, and construction/destruction are tied to the start/end of lifetime, which is strongly tied to scope, every object that gets constructed will also get destroyed, meaning that all acquired resources will get returned. if an object can't be constructed in a valid state, execution of the constructor can't continue; an exception is thrown, which unwinds the stack, destroying constructed objects in reverse order, up until the scope where the exception is caught, at which point execution reroutes to an alternate scope where the invalid object simply doesn't exist, and where (since all the necessary destructors were run and resources freed) program state is as though the failed branch never happened. allowing you to delay constructing a member object until potentially anywhere (or nowhere) inside the constructor body would break this lifetime/scope binding, which would require the runtime to keep track of it, which would incur overhead compared to tying lifetimes directly and implicitly to scope / stack frames

Forget Ran I want to nut inside her Boss, Yukari!

test post with image

Attached: Transparent.gif (1x1, 42)

user you're right about what you said in the other thread, this actually isn't spam, because it's programming related
that being said i'm sure we would all really like to know exactly what it is you're programming that you're testing out on this board

there's a thread just for test posts on /qa/

bython :DDDd
paste.pound-python.org/show/jeSiaCarQEV7fDOplXqK/
if I didn't hate HTML I would just the board/thread/message/file input queries to the captcha page and get the response data from the POST, but I do it hate it and I'm lazy so it's not happening

you should switch to crystal, it'll be pretty trivial to port since it's basically just compiled ruby.

I'm trying to design a simple web app, but can't even take first steps to get this bitch in motion.

Does the scope of languages such as Javascript freeze you guys up sometimes?

Attached: pajeet.jpg (933x850, 163K)

too bad there's no good windows implementation

i've checked crystal out, it looks pretty nice but there are a lot of reflection features missing from it that ruby has
i may or may not be able to use it here, i'll give it another look. thanks

then you know what you have to do lad.

making an ai that gives anime recs based off your myanimelist and data from ledit

Attached: 1536288692401s.jpg (125x104, 2K)

how about instead of making a boring fuzzy tagger. You make an AI who can watch anime with you and talk about it.

Is it possible for a someone to create something like this in Unity on their own? Could I use Unity graphics packs and stuff from the store or will I actually need to get into contact with an artist? I mean, this stuff is kinda advanced, but could a programmer at least get things flying around the screen like a hovercraft??

youtube.com/watch?v=VqjAUFPDl1s

youtube.com/watch?v=EspuTqrbCP0

Attached: 1535082099399.jpg (1600x1900, 289K)

drop that ML meme shit and research relational music recommendation algorithms

Attached: .png (752x598, 273K)

is firebase good for syncing databases on android apps or is there a better alternative

No. start by writing in plain words what the program will do, write out the specifics, the inputs, outputs, lists, dictionaries, imports etc. Don't worry about how the program will work, but what the program will do. That's usually how I start and doing this makes it much easier to get going I think

>pre-scripted everything
yes you no longer have to budget for anything so it's trivial. The first one still has that awful unity look and feel to it though.
The second one does better to mask everything in shitty fog and DoF so it looks alright.

Turkish coffee

Would it be overly difficult for someone with limited C# experience do you think? As in, I have made a slider game before and understand a little bit of C#.

reminder that nuitka keeps improving with each release
nuitka.net/

I recalled that EOF exists. Dose closing a handle take care of it or I forget to append it?

learn C# first.
Don't be just another Unity dev that cobbles together his game out of stolen code and pirated unity store shit. Plus you'll feel like shit if you ever get questioned on how you did XYZ and can only answer with "i got it from the asset store". But yes, it's feasible for a single person. Lots of that shit looked heavily stock anyway. Especially in your first link.

or just use a language that's already compiled.

that's super neat
keep it up!

Attached: Capture.png (270x248, 22K)

whats the fewest instructions for a functional cpu?

how am I supposed to read Files in java?
I'm using FileReader on a string and then using the .read() method, but nothing happens, what's going on?

github.com/xoreaxeaxeax/movfuscator

>learn C# first.
Yeah, I have to I have Uni/college/TAFE.
>Don't be just another Unity dev that cobbles together his game out of stolen code and pirated unity store shit
You can pirate Unity assets? I was just wondering about that.
>Lots of that shit looked heavily stock anyway.
By "stock" do you mean from the asset store? I'm guessing I'd have to go to the asset store and buy (or use free) things like the art for the hovercraft/holograms since I'm not an artist.

im a hobby programmer and have more insight than you.
Jesus Christ man get your shit in gear you are asking a lot of dumb questions.

does is actually fix the GIL ?

stock as in stock settings, both in the look and feel of the game. It has that signature Unity feel to it, you recognize when you play enough or hang around devs who work with it and post footage.

If you're not an artist, don't use shit from the store, it's not unique, people will recognize it, and it will devalue your game. Learn to stylize and develop your own style. Or look what Geometry Wars 3 does, it uses nothing but primitive shapes and nice shaders, and looks better than most unity games.
youtu.be/DqL7GYXFc-s?t=17s

are you gay and an albino by any coincidnce

Did some K&R exercise and don't like how I print results because during the process i destroy my original array so I have to mirror it first and use that to print the bottom section of the histogram.

Attached: Capture.png (533x119, 5K)

Scanner infile = new Scanner(new File("filename.txt"));

and to get a string

String str = infile.nextLine();

with streams this is just
Files.newBufferedReader(new File("filename.txt").toPath()).lines()
.forEach(line -> {

});

Why are there so many ways to read a file?
Also, I figured out my problem was I was comparing a char cast of read() to -1 since read() returns -1, all in order to break my while loop
also, why even use BufferedReader? I basically just used FileReader and read()
I saw some people online used a BufferedReader constructed on a FileReader, lmao why
So is FileReader just the most simple way and the rest are convoluted ways to read ints and specific objects?

>Open a file to get a path to open that file
That's stupid.

>Why are there so many ways to read a file?
Java's whole IO thing is an overcomplicated mess.
>also, why even use BufferedReader
I'm no pajeet, but I think it's because it provides buffering (which can increase performance) and allows you to do some extra shit more easily.

rewriting someones sepples game engine in C

You're going god's work.

Wanted to teach myself rust so I'm writing a NES emulator in rust. I've got a sprite extractor working so far, starting to work on the 6502 instruction set. The only thing that bothers me is that I have no idea if I'm doing "proper" rust code [spoiler]and if learning rust is ever going to be useful to me[/spoiler]

Attached: a.png (80x318, 2K)

sounds like a stupendous waste of time

Rust can be used for systems or web shit with Rocket, so if you like the language, i see no reason why it wouldn't be worth it.

Testing out AFrame and made a land where GIANTS rule
skate54345-land-of-giants.glitch.me/

>had a job interview saturday
>did fairly well on the culture portion of the test
>they bring out the whiteboard, completely bomb it
>i can tell as im walking out that i wont get the job
>also instantly think up the solution
>its the only tech job in my shitty wisconsin town
What do? I don't want to move

>>did fairly well on the culture portion of the test
lol

>also instantly think up the solution
there is no escaping of this curse.
happens to me literally every time.

>The only thing that bothers me is that I have no idea if I'm doing "proper" rust code
Don't care about that for now. Refactor your code once the program is fully functional. Just don't litter your code with unsafe blocks unless you really have to.
>and if learning rust is ever going to be useful to me
It's just another language, so it's up to you.
I think Rust is a waste of time and effort.

Jow ForumsĀ“s opinion on GTKMM?

can't fucking get this stupid java 2d game lib to work

Choose, and FIGHT

Attached: image.png (557x255, 253K)

sicp > k&r > anything bjarne wrote

t. sepplesfag

What's your guys' specialties?

Attached: 15687_main.jpg (640x400, 41K)

Reminder that Julia exists

scheme is useless so 2 3 1

*fakes more benchmarks*
nothing personnel

Android and FP

one you stop banging your head against it and program how it wants you too its fine
which is the same with any real gui kit

Thoughts on my stack template?
pastebin.com/Ze4EpkAf

not programming

it is

I don't see a single line of code

waste of time. what did crystal is much more interesting and smart.

crystal-lang.org/

watch closer

Lisp but no gc, static typing and the basic type is a vector

Alert! a guy on hackernews raytraced a blackhole

rantonels.github.io/starless/

>a vector
don't see how it could work at all.

C++11's user defined literal is a really weird "feature" to add.
C++ seems like a meta-programming language now

section .text
global _start

_start: mov r12, 0x64 ; Limit = 100
push 0x7a7a6946 ; Fizz
push 0x7a7a7542 ; Buzz
xor r13, r13 ; Count is zero

.loop: xor r15, r15
inc r13
mov rax, r13
mov r10, 0x3
xor rdx, rdx
div r10
cmp rdx, 0x0
jne .buzz
push 0x7a7a6946 ; Fizz
mov rax, 0x1
mov rdx, 0x1
mov rsi, rsp
mov rdx, 0x4
syscall
mov r15, 0x1
.buzz: mov rax, r13
mov r10, 0x5
xor rdx, rdx
div r10
cmp rdx, 0x0
jne .writeNum
push 0x7a7a7542 ; Buzz
mov rax, 0x1
mov rdx, 0x1
mov rsi, rsp
mov rdx, 0x4
syscall
mov r15, 0x1
.writeNum: cmp r15, 0x1
je .loopCheck
mov rax, r13
mov r10, 0xa
xor rdx, rdx
div r10
add rax, 0x30
add rdx, 0x30
shl rdx, 0x8
or rax, rdx
push rax

.write:
mov rax, 0x1
mov rdx, 0x1
mov rsi, rsp
mov rdx, 0x2
syscall
.loopCheck: push 0xa
mov rax, 0x1
mov rdx, 0x1
mov rsi, rsp
mov rdx, 0x1
syscall
cmp r12, r13
jne .loop

.exit: xor rdi, rdi
mov rax, 0x3c
syscall

how many meme words can you fit in a single post?
pro tip* its from interstellar.

Attached: 651486.png (2560x1080, 2.39M)

Ye that's pretty much it. C++ as a preprocessor for C is the best C++.

no, he wrote the raytracing engine code himself in python. have some respect instead of trying to undermine everything.

github.com/rantonels/starless

>Indenting assembly beyond one level
Absolutely haram.

Why are you posting this?

I'm currently learning Rust also, I've done web development for the past 3 years (Rails / React mostly) and I'm finding Rust very promising in my field, for both server (Rocket, Helix) and client stuff (WASM, Yew). And I haven't done system programming since school so it might be useful at some point.

if you say so buddy

/*
* Compute the KEY HKDF
*/
//Text
u16 plen = strlen(__KEY);
byte password[plen];
for (u16 i(0); i

Ha! Ouch, I cleaned it up some. Assembly is pretty interesting. I'd like to learn how to write MBR's (Boot Records.)
section .text
global _start

_start: mov r12, 0x64 ; Limit = 100
xor r13, r13 ; Count is zero
.loop: xor r15, r15
xor r14, r14
inc r13
mov rax, r13
mov r10, 0x3
xor rdx, rdx
div r10
cmp rdx, 0x0
jne .buzz
mov r14, 0x7a7a6946 ; Fizz
.buzz: mov rax, r13
mov r10, 0x5
xor rdx, rdx
div r10
cmp rdx, 0x0
jne .writeNum
ror r14, 0x20
or r14, 0x7a7a7542 ; Buzz
ror r14, 0x20
.writeNum: cmp r14, 0x0
jne .write
mov rax, r13
mov r10, 0xa
xor rdx, rdx
div r10
add rax, 0x30
add rdx, 0x30
shl rdx, 0x8
or rax, rdx
mov r14, rax

.write: push r14
mov rax, 0x1
mov rdx, 0x1
mov rsi, rsp
mov rdx, 0x8
syscall
.loopCheck: push 0xa
mov rax, 0x1
mov rdx, 0x1
mov rsi, rsp
mov rdx, 0x1
syscall
cmp r12, r13
jne .loop

.exit: xor rdi, rdi
mov rax, 0x3c
syscall

ty fremnd :)
what is pic related? it looks cool

im done for the day
gonna play some c&c zero hour

Attached: Capture.png (492x170, 5K)

that's the 'map' feature from inform 7

wow
i didn't know because i only use inform 7 on a computer that until recently i thought wasn't powerful enough to run a gui so i only used the text version
rip me

yeah! despite all the weirdness that comes with the language, the tools packaged with it can be super helpful for debugging and reviewing

no, you need to generate an actual IV.
nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf , specifically section 8.

I don't use CryptoPP. I don't know if the underlying library memwipes password, salt, etc. after you've used them; you should figure that out.

hey guys, I need to delete only the files starting with a capital letter from a folder. Any idea how to do it in bash?

rm `ls | grep '^[A-Z]'`

Thank you!

how do I get back to programming? I've had a rough year. give me some motivation, or something to do. please.

Attached: 1517596393780.jpg (736x748, 87K)

dumb frogposter

Work through a book.

How should I go with storing the IV? Would the user need to remember it? Or can I just generate a unique one depending on the password?

I'm making my first le_shop_program to learn a little about OOP and how to use database. It is all based on cmdline, where I can add products, sells and check balance of each counter (a product must be payed on a counter), for example.

Now I wanted to add some "security" so only the admin can change the products price, but I'm not sure how to make a login/pass feature, but I don't even know where do I start. I'm not sure where how I would hide the admin user/pass on the code, for example. Of course it doesn't need to be super secure, it is just a stupid program that I won't even finish.

Thanks you for the attention, bros.