/dpt/ - Daily Programming Thread

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

Attached: dpt_flat.png (1000x1071, 102K)

Other urls found in this thread:

devdocs.io/dom/worker
devdocs.io/node/worker_threads#worker_threads_class_worker
code.org/
github.com/deeppomf/DeepCreamPy
twitter.com/SFWRedditImages

JavaScript rocks!

Attached: js-rocks.png (1000x494, 369K)

rocks bottoms

How the fuck did JavaScript manage to become such a huge deal? I just find it surprising how all these competent programmers would choose to keep building on top of it with stuff like Node and all the countless frameworks.

How did they not just get fucking fed up with it?

cringe and bluepilled

0 == false
'0' == false
0 != '0'

They usually have more productive activities involving JS other than showing people online how type coercing operators in a dynamic language coerce types dynamically when applied to different types that you would never otherwise do in modern, production quality code. Funnily enough this shows up as I was typing this. Like pottery.

Transitivity isn't for CS majors.

non transitive equality, because why the fuck not

Yeah all this coercion stuff is such low hanging fruit.
Maybe just don't coerce your language (or your female "friend") into doing things where it might behave unexpectedly?
The === operator solves all of this, and everyone knows about it.

> competent
> programmers
> choose

implying JS isn't loved by incompetents and mandated by the resulting race-to-the-bottom and consequent network effects

Who cares about the incompetents.
JS is used because some incredibly skilled developers have built a ton of libraries and shit with it. I just find it surprising how they chose JS.

Node is a not a framework. Node is a javascript runtime environment that allows for JS to be run outside of a web browser, which was traditionally the only way to run JS. This allowed it to be a language for anything you wanted.

>for anything you wanted
>multithreading

Choose one

Mozilla's JS JIT engine became excellent, then google swooped in with their not so great but still good V8 a few years later, native plugins were being phased out, so JS became really fast and there was no other option.
This is easy shit to look up, it's not rocket science

What's your point? When's the last time you wrote a multithreaded program? (non-portable, non-commercial toy projects do not count).

Python doesn't permit threading either, just concurrency through very rapid context switching between different interpreter instances.

devdocs.io/dom/worker
>worker thread
devdocs.io/node/worker_threads#worker_threads_class_worker
>The Worker class represents an independent JavaScript execution thread.
>independent execution thread
If that's not the multithreading then I don't know what it.

IBM watson interface cause i don't have friends

what the fuck i just looked at the wav format and the riff container

this is absolutely niggerlicious

why can't big companies do anything right?

Give me ONE(1) good reason to learn how to program.

$$$

don't

THAT'S IT

I'M GONNA DO IT

I'M GONNA LEARN ASSEMBLY

gz lad, ASM is light, i hope to ascend their one day.

learn to spell, bong

had too different thoughts going.

I'm dealing with basic CRUD shit (sending and reading forms) in React-Redux and Java for $70 an hour. Life's bretty gud desu.

>no other option
Spring
Clojure
Django
RoR

Because it was how you ran code in a user's browser, you had to use it anyway for webdev. So you might as well see if you can write your backend in it too so you weren't writing the same code twice. And then you might as well write general cross-platform GUI code in it too, since you already know it.

I know your point, and you're right: async I/O is enough to get the benefits of concurrency for most software getting built these days, and even that's overkill for a lot of problems.

But some of us with numerical problems, simulations, analytics, or ML really do have parallel CPU-bound tasks.

i fucking hate libraries i just want a language that closely resembles pseudocode, also give me some simple longterm projects for python

>i just want pseudocode
>longterm python
never gonna make it

I've done some more with my temporal type theory. I've figured out how to extend the ◇ ⊣ □ adjunction to more modalities and effects. To recap, here's the important bits of the original adjunction:
map : [](A -> B) -> A -> B
strength : []A * B -> (A * B)

Then I considered exceptions:
map : ?(A -> B) -> Maybe A -> Maybe B
strength : ?A * Maybe B -> Maybe (A * B)

And finally multisets:
map : !(A -> B) -> Collection A -> Collection B
strength : !A * Collection B -> Collection (A * B)

x : □A is a value that can be used asynchronously, x : ?A is a value that can be dropped, and x : !A is a value that can be dropped or copied. However, it seems like ◇ is special, in that it comes with an extra primitive operation:
choose : A * B -> (A * B + A * B)

So far, I have not figured out if the others admit corresponding operations. Perhaps I have to look into differential linear logic to find the answer.

I honestly do need guidance form the patricians in /dpt/, i hate libraries, the only thing that i like abut python is that its easy to read, im thinking that maybe a language closer to pseudocode might be best for me

N I M
I
M

You need to get over your obsession with syntaxes if you wanna make it.

First you figure out loops and conditionals and shit. Then you move on to classes and data structures. Then you start with abstractions, inheritance and polymorphism and shit. Eventually you graduate to design patterns and architecture. In comparison to all that, APIs, or what you call "libraries", are irrelevant. The syntax changes by the language, but those concepts do not.

>reading an entire thesis when all you need is void*

Aha, the key is Day convolution.

kek

Attached: 10246861185680937014.jpg (300x250, 22K)

Is it ever worth replying to a cold recruitment email?

You're at your computer all day anyway and instead of feeling like a worthless piece of shit that isn't contributing anything to the world you can have a constant source of mental stimulation and challenge in a field that can lead to gainful employment.

I wrote a shitty python script that will wait for the user to press ctrl+c and change a YouTube link to a hooktube link if they have a YouTube link in their clipboard.

How do I make it so that this script is always running in the background? Are there any performance/security concerns I should be worried about when doing so?

this is the single most retarded way of doing what you described that I have ever seen. you have my respect
> Are there any performance/security concerns I should be worried about when doing so?
yes

It's the one very few ways on this Earth to become the closest thing to a real-life wizard
>create things out of thin air

Also software is one of the few degrees that you can use to benefit your everyday life in a way that is unsustainable to normies.
>have home automation worth high five-figures
Level up sufficiently and you'll be able to build machines on your own.

Hey /dpt/, I'm sad cause I can't even get 80k.

how much does it suck to be in product division?

>i hate libraries
your complaints make no sense.
If you're going to bitch and moan about other people's code you may as well put the effort into not sounding like a raving lunatic.

>simple [...] projects [...]
you come up with your own goddamn projects or else you won't stick to them.

Here's a hint for you to get along in life:
You want to do something.
Doesn't matter what it is.
You break the problem down into smaller pieces and develop a plan to accomplish that something. Recursively if necessary.
You implement that plan at the smallest levels.

If at any point in this process you get stuck, just come here and ask a CLEAR question which you suspect will have an exact answer.

None of this open-ended "I want thing how do?", or "give me project" bullshit. Open ended questions will never be answered, and you will never accept the answers you do get, because the answerers will put in just as much effort as you did into asking the question.

when using a callback-based audio API, the callback called sometime during the playback of the current buffer rather than when playback of the current buffer finishes, right? surely calling it at the end of the current buffer would cause a glitch no matter how fast you can compute the next buffer, right?.

*is called

Can you explain? I don't doubt that I'm retarded but I just wanted to actually implement something instead of agonizing over whether or not I'm doing it by the books or not. I'm open to learning how to be less retarded, I just don't have any sort of formal education nor any friends to teach me so I kind of hack things together and lurk online forums to learn how I fucked up after the fact.

I finally got preemptive multitasking working on ARM without using the double stack pointers and super elevated exception interrupts. I'm hoping to fuck around with virtualization stuff, like having one instance of my kernel boot another instance of it.

you're not gonna get a whole lot closer to pseudocode than python.Static type systems might be ugly and hard to read when you aren't used to them, but they are actually really helpful.

Listen, you know why you think pseudocode is easy? Because it misses all the nitpicky details that fuck you in the real world.

Any pseudocode that had all the fucky details, and actually established rules and abided by them 100% consistently, wouldn't be pseudocode anymore, it'd just be code, because at that point you could actually write the interpreter.

Anyway, the answer---an answer---to your question is Haskell, but it won't matter, because you'll give up and move on to 10 other things before then.

I'm trying to do what amounts to dragging and dropping certain files in a folder onto a CMD .exe for converting, but I'm retarded. How would I write this? I also can't seem to drag multiple files onto the .exe normally, so perhaps it's also the program I'm using.
@echo off
set path=%~d0%~p0
for %%x (*.itm) do "%path%itmcnv.exe"
shift
PAUSE

Nevermind, just figured it out. Forgot %1.

Because of latency introduced by various layers of buffering, resampling, mixing, etc. the callback will likely be called a few frames ahead of when the audio you copy over will be heard. It's hard to precisely quantify the relation between the read head and the write head, unless you're using a real-time API on a real-time system with hardware mixing (in that case, the callback could act directly as a sound card interrupt handler, but it would still be called a bit early because copying into the sound card's memory takes non-zero time).

tl;dr it will be called before the system runs out of audio data because there is inherent latency between submitting audio and hearing it.

can any haskellfags show me how this would be written idiomatically in haskell? the function generates a list of prime factors
def factor_list_gen(number):
for factor in range(2, number + 1):
if not number % factor:
yield factor; yield from factor_list_gen(
number // factor); break

for x in range(20):
print(x,':',[*factor_list_gen(x)])

Attached: Legit Confused.jpg (498x500, 205K)

Personally I like JavaScript because it's a pretty small language, and its design makes sense to me. Objects are just key-value stores, and methods are just values. A lot of stuff, including async, are accomplished just through callback functions.

Beginner level C++ project you could finish in three hours? Looking for something to do that's active before bed

Attached: 1539924103500.jpg (1193x1079, 188K)

Pong

What GUI do I use, user?

whichever one you already know fagtron
>learning any GUI framework of appreciable maturity
>in three hours
you fucking wish

thanks, i was confused about the source of inherent latency of buffer sizes, so i thought there was a possibility that the hardware would be using double-buffering... but it sounds like you really are racing against the read head

this is a really interesting field to be dabbling with. lots to learn. i've never even touched lock-free data structures before.

raylib

opengl? eh

>never even touched lock-free data structures
some people say that you should never touch them

You're always racing something, even if there's buffering. It's just that the effects of losing the race could manifest in different ways depending on where exactly in the audio pipeline your application is submitting audio and how the callback is set up. You might get skipping, you might get the same chunk of samples multiple times, you might get garbage that still ends up being limited, you might break your sound card (probably not, though).

>Having an easier time learning to program writing a guide for an imaginary someone else explaining everything about programming from the very beginning
feels weird

I found this website:
code.org/
It looks silly, but can it actually be helpful?

Don't click this. I just got a virus!

When will hackerchan be up?

Attached: 1528759487006.jpg (1720x1722, 527K)

i find that about everything

Looking at that picture, hopefully never.

what language will help me kill myself?

Being able to teach a skill shows higher mastery of it than using it

Get the latest and greatest in hentai decensoring technology while it's still hot: github.com/deeppomf/DeepCreamPy

Attached: mermaid_collage.png (1830x1470, 1.18M)

Hebrew

chinese

Can someone recommend a nice checklist of programming materials that would lead to an entry level job? Thanks.

godspeed lad, glad you're still working on this.

I'm doing this atm. It's kind of annoying that I was just taught how to write code, rather than the theories behind it and why it actually works. It's my own fault, but it's hard not to think I was taught in a really roundabout and inefficient way.

is it safe to use c11 threads at this point or am i going to find myself unable to compile with mingw or some bsd?

Every idea I have ends up being WAY too much of a pain in the ass.

Monads are just free monad monad monad algebras. What's the problem?

That's what happens when the only ideas you've got are dragon dildo related.

even cont?

Is there any small javascript interpreters I can play with and customize? I'd like to make my own Javascript and remove a lot of crud from the language

Guys I think I hate programming and never liked it in the first place. I've already done a bachelors in IT and now I'm just sitting in my room all day not doing anything.

What do I do aside from killing myself?

Attached: 1396571416586.jpg (278x278, 34K)

find a new hobby.

code more
stockholm syndrome kicks in at some point

Hi guys, I'm learning to program! I'll post my progress every once in a while to bump the thread.

>1) What is the difference between a statement and an expression?
A semicolon. A statement is a task to the compiler to get shit to work. An expression is a computation, but it needs to be in a statement to work.
>2) What is the difference between a function and a library?
Function is a bunch of statements that runs sequentially. A library is a bunch of functions.
>3) What symbol are statements in C++ often ended with?
Semicolon
>4) What is a syntax error?
typo rly

I can't.

Code what? There's nothing I want to code.

obviously join an IT consultancy firm. programming sucks.

just get out as fast as you can

escape this maelstrom of diarrhea

Attached: super hans.png (1024x768, 932K)

What is "object orientated programming" and why do people always look for it in job descriptions?

I originally thought it was just using classes to depict objects in the real world, but now I'm learning it's actually how you go about depicting objects in memory?

its classes

Why is it so requested? Is it not the basics of almost every programming language? Maybe I'm just not using it right.

It's in some programming languages, not in others, some people absolutely hate it

>some people absolutely hate it
but y

it has just come to mean inheritance and omnipresent "noun.verb()" order

because it's a buzzword

autism