/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Other urls found in this thread:

en.wikipedia.org/wiki/Information_systems_technician
hero.handmade.network/episodes
oracle.com/technetwork/articles/java/json-1973242.html
twitter.com/SFWRedditImages

The only three programming languages you need to know are Scheme, Shen, and Idris.

but muh scala

The only three programming languages you need to know are C, x86 assembly, and Emacs Lisp.

not scalable

The only three languages you need to know are Rust, Rust, and Rust.

redpill me on doing system technician degree.

...

wtf is a "system technician"?
is it an assistant sysadmin role?

It's really not, look at how slow compilation is for any medium-size scala project

en.wikipedia.org/wiki/Information_systems_technician

OK I see, this is probably the wrong thread for that

Are there any reasons to use Python beyond "it's easy for people who don't have much experience programming"?

it has alot of very optimized math/science libraries

other than that?
no, not really

It's good at destroying the minds of innocent would-be programmers

>Very optimized
>python
"World's fastest snail"

the libraries are made in C

>Snail contracts a cheetah to do all the work for him
>wow isnt the snail great

pretty much

Is "gradual typing" a useless meme?

It reads like pseudocode, it has libraries for everything, and it's better than Bash scripting for complex tasks

The Python is glue code you dip

Haskell reads like pseudocode too.

Show me Python's equivalents of lens and mtl.

>x86
drake.jpg

The snail is a genius.

>Python reads like pseudocode
Python coders are pseudo programmers

Are you seriously trying to imply that fucking Haskell, the language with no mutability, is better for scripting tasks than Python?

I like pure functional programming as much as the next autist but I'm not gonna use Haskell for scripting tasks

>Python coders are pseudo programmers

Gotta admit I kek'd

Or Fortran, like numpy.

>Are you seriously trying to imply that fucking Haskell, the language with no mutability, is better for scripting tasks than Python?
Yes. The language works with you a lot more than Python does.

easily better

>works with you a lot more than Python does
Fucking kek.

Please elaborate, now you've got me interested

It is easily better, because of the strong, pure type system.
You can limit exactly what scripts can do.

>scripting
>immutability works with you
Have you ever sysadminned anything more than your GNU/Linux home network?

Yeah static typing is nice

You just sound like a poor programmer tbqh

Strongly and statically typed functional languages with immutability scale much better than Python does

>muh theory
You're worse than a Marxist, and I say this as an ancom. Stop playing with fingerboxes and do something productive.

>ancom

So I'm trying to have python crop a jpg without any new compression on a really crappy raw image.
Is this even a possible thing with python? pillow is giving me shit.

Just finished writing some scripts that simplify text for machine learning. Strips out all punctuation besides newlines and spaces, reduces everything to lowercase, then maps the cleaned-up words to integers. Feeding the software ints instead of raw text should reduce the amount of time it takes to learn spelling and common phrases. Hopefully the reduced complexity yields good results.

Also tinkering with a program that generates Ruth-Aaron numbers. The current record holder is only 3k digits long, so I'm hoping to beat that out by the end of the year. Doing it efficiently takes a surprising amount of thought, so it's a good exercise.

pls no fighting in the programming thread

The fuck is this cringe inducing Sup Forums shit?
Stay the fuck in your containment thread

dont shen and idris make eachother redundant?
And why the fuck would you ever need scheme?

Scheme will be useful for programming emacs once it switches to being Guile-based

But why would i ever use dynamic trash?

Its good for things which would require bash/ shell

otherwise, its good at binding other programs together, do the work in C and the user facing shit in python

So I picked up a python book a week ago.

never had any programming experience other than a little bit of javascript if you can count that. but that was years ago.

I am 30 pages into my second book on python now, but I feel like I am dabbling with forces beyond my understanding. Every example in the first book was just "import this module that does this neat thing and then modify the output a bit" .

I can already do the automation task I wanted to learn programing for (some one has already done most of the work), but I have a terrible feeling that I am doing every thing blind.

Reminds me of being a teenager and copy pasting things off the internet into the command line to solve problems.

This thread has made me feel even worse.
Should I start somewhere else?

I dont really want to work as a programmer, I just wanted to make my financial research easier. I am learning SQL next fall for work, but I dont want to be meme'd by all the IT guys for only knowing "babymode" languages.

yes, try F#

>F#
Ok, but Why?

SQL is not a "babymode" language, but it's not much of a programming language either.

>Every example in the first book was just "import this module that does this neat thing and then modify the output a bit".
Yes, Python can be really bad for learning programming because of that, and as you describe in your post, such an approach doesn't teach much.

Thanks, user. The docs seem to suggest that it's exactly what I need, so I'll try implementing it.

>once it switches to being Guile-based
what's the eta on that?
seems like it's been "in the works" forever

Me again.

I just ran 3 versions of a program that copied my entire hard drive into a zip file on the desktop concurrently.

One of them didnt go to desktop so now I am tracking it down.

Is there a way to test a program for syntax errors without actually running it?

Use PyCharm Community Edition IDE, there is a debugger that should work.

Directsound newbie here

//The point in the buffer at which Windows will read and play the sound buffer
DWORD play_cursor;

//The point in the buffer at which Windows will write what we want to the buffer
DWORD write_cursor;

//If allocation of this is successfull
//global secondary buffer is an LPDIRECTSOUNDBUFFER
if (SUCCEEDED(global_secondary_buffer->GetCurrentPosition(&play_cursor, &write_cursor)))
{
//do something
}

are we guaranteed to have &write_cursor > &play_cursor ?? since the buffer is cyclic its entirely possible to have it write it at lower values but its effectively ahead of the play

should i memorize the C standard library?

I am using it. let me find the debugger.

functional baby detected

>emacs lisp
>not common lisp

this

The only three lang you'll ever need:
C++ for actual aplications and speed
R if you need to make sense of data
Racket for fast development, creating dsls and theroetical stuff

>C++
AHAHAHHAHAHAHHAHHAHAHAHHAHAHHA
Good joke.

>Feeding the software ints instead of raw text should reduce the amount of time it takes to learn
But user, ascii text is just a string 1 byte unsigend ints, if you change it to normal integers they probably become 4 byte ints on your machine.

>doesn't know about Erlang's 8 bytes per char

n-nani?

>8 byte char

for what purpose?

The only three languages you'll ever need
C
Assembly
WASM

>using a bloated asm

Add Go to that list.

If you want actual, marketable applications you pretty much have a choice betwen java and c++. I for sure won't sully my hands with java, if modern c++ is avalible

>maketable applications
>not c

kek, keep deluding yourself

Throwing together shit quickly.

>not NASM

Strings are a hack in erlang: they're lists of integers, and indistinguishable from lists of integers. The language authors didn't really care about them since erlang was designed as a dsl for telecomm.

>not Java
>not C#
but what if you want to eat?

Get a real job that doesn't involve being a sedentary failure if you want to eat.

Programming is just a hobby for you, right?

>C
>Assembly
>WASM
>Programming is just a hobby for you, right?

kys

So the same as C then?

>op picture
Boycott.

Why are you being so mean user. Those are great hobby languages. Maybe not WASM, yet.

You could. It's not big. You won't need most of it though.
Searching for it when you need it can be difficult though so when you find something put it in your memory.

Check out day 7,8,9, 19 and 20
hero.handmade.network/episodes

Hey /dpt/.
If you had a million arrays shared between functions in C, would you make them static and initialize them on main, or would you allocate arrays on the stack of main, make a singleton struct of pointers (and ints if no macros) to hold the info to iterate them, and pass the extra pointer to all functions?

Personally, I'd probably put them on the heap and use enums to index into a static table of pointers, and to hell with the 16MB of malloc overhead. Most systems wouldn't give you that much stack anyway.

I'm learning x86 assembly because I'm a retard and I hate myself.

Can someone explain to me how
pushl %ebp
pushl %esp, %ebp

is any different from
pushl %esp, %ebp

without the first line? I've been toying with it and it seems to essentially do the same thing.

So i'm about to start a CS degree.

Could you guys pleas recommend me the best books and the best lectures(youtube/edx/etc)?

Most people recommend the Corme Algorithms books, but idk if this book is the best to start.

I'm already do some scripts and I've solved some problem on Project Euler using Python.

I'm trying to access a certain key/value pair in a JSONarray, how the fuck do I parse the array with n amount of key/value pairs the most efficiently.
I am using java(android).

pls respond

oracle.com/technetwork/articles/java/json-1973242.html

Should I start learning Rust despite its community being made up of SJWs?

The Rust community is far worse than SJW.

Working on a game in Unity.

Finished most of the code but just need to refine some parts (levels, RNG, etc.)

Also, none meme legit programming languages to learn? I've learned C, C++, C#, Python and starting with Java soon and looking into HTML.

Also, none meme legit programming languages to learn?
To do what? Tools have purposes, strengths and weaknesses.

>To do what? Tools have purposes, strengths and weaknesses.
When you put it that way, I guess I'm fine how I am.

I've found that C# is really good for developing apps and C++ is good for my other works so I guess I don't need to learn anything else unless it's for work or something.

The "community" does not matter. If they bother you so much, you can start your own community of Rust programmers, or even make your own Rust compiler using GCC's backend instead of LLVM.

Please post webm of loli sliding on the floor to the PC

The only coding language i know is DarkBasic which basically means i need to kill myself

Or, you know, learn a real language.

I still have no idea which one to learn

Learn Go famalam.

Thanks, was a good read.

Learn Go the game as you learn Go the programming language. You'll become a techno zen master

for fucks sake.
let's try this again
going through the little schemer
why did this cause my guile interpreter to hang, use 100% of one of my cores, and use up all my ram?
(define (insertL new old L)
(if (null? L)
'() ; this second ' is needed to get around shitty Sup Forums syntax highlighting. if it werent there, everything after this would be green
(if (not (null? (cdr L)))
(if (eq? (car (cdr L)) old)
(cons new (cdr L))
(cons (car L) (insertL new old L)))
(car L))))