/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1555072526297.png (630x1158, 560K)

Other urls found in this thread:

treyhunner.com/2019/05/python-builtins-worth-learning/#print
nasm.us/
twitter.com/SFWRedditVideos

First for recursive algorithms.

Wrong book, OP.
Puke.

Second for recursion doesn't exist in real code

Can you faggots not leave it in the previous thread?

Lisp is the most powerful programming language.

Install Lisp.

Attached: Gnu.jpg (733x588, 278K)

Recursion is just a shitty inflexible goto.

Why do its eyes/head look so deformed like its begging to be put down?

There's no fucking point anymore, it's entirely these stupid fucking shitposts these days

>git doesn't exist

Is garlic a good way to repel C programmers?

Reminder that not all recursive algorithms can be trivially transformed into iterative ones. And doing so gives you no benefit and actually makes the code less readable.

I’m starting to grow sick of C and Assembly. Having to spend an hour shit testing a complex data structure while knowing I would just have to check for null pointers in Java feels awful.

Attached: programming.jpg (1000x1000, 1.06M)

In C it's just checking for null pointers too, what's the difference there? ASM I understand

For me, it's Chuck.

Attached: programming-with-chuck-22-638.jpg (638x479, 61K)

What is going on here
Why is this poor girl being abuse?

She has to port a legacy system: COBOL to Java 5

Yes, user! I like your JavaScript. It's cute!

Attached: d1eb94df0fd7c596a30c17e4506bc537.jpg (944x1416, 120K)

I like you. You're cute!

Nope! It's Chuck Testa.

what's the book?

LYAH. It's free, unlike the book in the OP.

Help me to hack next US elections. Should I start from Twitter or with Facebook?

Make a GUI in Visual Basic.

я oтпpaвил тeбe инcтpyкции, пpoвepь пoчтy

Everything is free if you know where to look.

yes, there's definitely an online pdf of that somewhere, you could try searching in (3rd party) archives of Jow Forumsdpt

>mfw trying to take the square root of an int in haskell

Attached: E4C6A104-14F3-4CE1-A766-E5B5E46B81E1.png (229x220, 6K)

Haskell programming is on libgen.

reading the django framework, also reading treyhunner.com/2019/05/python-builtins-worth-learning/#print

you have to convert it to something else first like a double (e.g. using fromIntegral, and then going back with round, you will probably need a type annotation e.g. (sqrt :: Double -> Double)
It's unfortunate but the prelude people were pretty autistic about the numeric hierarchy

it's always been shitposts, newfriend

It's not worth anything anyway.

Пpoвepил, пycтo.
?

In Lisp, this is just sqrt.

So basically i want to copy articles from websites, i want:
>article with the alignment and design
>text with all the formatting
>offline images and videos
>links to other articles
>none of the ads and navigation stuff
>interactive stuff like animations n graphs
>export all of this to a pdf
i want to make a program that automates this but i have no prior experience in programming
How do i do this anons?

Attached: hmm.png (680x521, 115K)

Use Python.

Use Lisp.

Apтём, хвaтит нa фopчaнaх вcяких cидeть.

>it’s the “In X, this is just Y” guy

Attached: 8DB28AA2-7873-489F-BF8B-6CB4278C34AB.jpg (484x583, 36K)

Sounds like something you want Assembly for. I’d check out this site nasm.us/

Guys, what's the shortest encoding of the following?
syscall
ret
Would the following be valid?
0F 05
C3

In Python this is just **0.5

>**0.5
>just
What did she mean by this?

yes

Я Bлaдимиp.

In C, this is just _mm512_maskz_sqrt_round_ps

>the easiest problem in SICP

And this will make a syscall?
So is there any restriction as to how exactly I can call into e.g. shell32.dll? For instance, does it need to be aligned?

>Latency: 38
Oh no, no, no.

Attached: black science guy.jpg (650x366, 34K)

That's irrelevant when you're doing them ten at a time, as you should.

will learning a script language be enough? can i point it at a website, make it format and spit out a pdf? no need to learn html javascript?
thanks for the tip buddy

because it's a gnu

If you want it to make a pdf then it shouldn't have to do with HTML or JS. it would be more like a program that captures the page.

anyone have any resources that I can use to study nested loops?
I keep fucking them up

sicp

your debugger

is there a way to embed javascript in a pdf, for example an interactive graph or a scrolling map

works like a charm

Attached: IMG_3026.jpg (4032x3024, 2.06M)

You have ten seconds to tell me what the following instructions do:
[quote]
_mm512_mask_gf2p8affineinv_epi64_epi8
_mm512_mask_extpackstorehi_epi32
_mm512_mask_prefetch_i32extscatter_ps
_mm512_maskz_extracti32x4_epi32
_mm512_maskz_roundscale_round_pd
_mm512_mask_cvtsepi64_storeu_epi16
_mm_maskz_multishift_epi64_epi8
_mm512_mask_extracti64x2_epi64
_mm256_mask_compressstoreu_epi16
_mm512_mask_permutex2var_epi16
_mm512_mask_cvtt_roundpd_epi32
_mm512_mask_extloadunpacklo_ps
_mm256_maskz_permutexvar_epi32
_mm512_mask_extpackstorelo_epi64
_mm512_mask_i32loextgather_epi64
[/quote]

>[quote]

You have ten seconds to follow this instruction:
Hang yourself.

That's not a legal instruction on my architecture.

No

>_mm512_mask_gf2p8affineinv_epi64_epi8
Or, rather __m512i _mm512_mask_gf2p8affineinv_epi64_epi8 (__m512i src, __mmask64 k, __m512i x, __m512i A, int b)
Computes an inverse affine transformation in the Galois Field 2^8. An affine transformation is defined by A * x + b, where A represents an 8 by 8 bit matrix, x represents an 8-bit vector, and b is a constant immediate byte. The inverse of the 8-bit values in x is defined with respect to the reduction polynomial x^8 + x^4 + x^3 + x + 1. Store the packed 8-bit results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set).
In pseudocode:
DEFINE parity(x) { t := 0 FOR i := 0 to 7 t := t XOR x.bit[i] ENDFOR RETURN t } DEFINE affine_inverse_byte(tsrc2qw, src1byte, imm8) { FOR i := 0 to 7 retbyte.bit[i] := parity(tsrc2qw.byte[7-i] AND inverse(src1byte)) XOR imm8.bit[i] ENDFOR RETURN retbyte } FOR j := 0 TO 7: FOR b := 0 to 7 IF k[j*8+b] dst.qword[j].byte[b] := affine_inverse_byte(A.qword[j], x.qword[j].byte[b], b) ELSE dst.qword[j].byte[b] := src.qword[j].byte[b] FI ENDFOR ENDFOR dst[MAX:512] := 0

PDF is a document format that's meant to be read and printed, not bounce around and do tricks.

>javascript in a pdf,
Just make a webshite at that point

is OOP overkill for data structures implementation or something shunned about? In my uni we use python, i consider OOP quite fitting for data structures, for example object Graph is made of objects Nodes, and then after adding nodes n1 and n2 to graph i could i make "Edge" between n1 and n2, etc. Problem is: my prof. is writing everything in using lists, even graphs and trees. His code is quite short, but less readable and pajeet tier imo, using global variables and weird hacks. What do you think /dpt/? Is OOP for data structures ok, or should everything be made with lists?

Why would you use lists for everything? Also structs aren't inherently OOP
oh wait it's python

That's just composition of data structures, you can do that in any paradigm including procedural and functional.

(define tuply (curry curry apply))
(define plus (tuply +))
(plus '(1 2 3)) => 6
(+ 1 2 3) => 6

>(curry curry apply)
dude what

When is mutation appropriate to use in real-world production code?

Attached: remi_shy.png (245x274, 127K)

Everywhere, don't let the functional "programmers" deceive you.

He likes it extra spicy.

Attached: curry curry apply.jpg (1372x2058, 142K)

when you aren't fucking other things up

>Everywhere
So should I insert trivial mutations everywhere in my codebase to make it more practical?

Why are you making the WASM frontend in Rust?

(define (curry function . args)
(lambda rest (apply function (append args rest))))

bloated af

syscalls on Windows are undocumented and not guaranteed to be stable, i.e Microsoft can change the meaning of any syscall number at any time.
The official lowest level api is the C functions in ntdll.

too real

One programmer is arguing with another, a proponent of C and UNIX, about some contested topic, say garbage collection, but any will do for this template.
The UNIX programmer thinks about garbage collection. His mind mirrors how UNIX operates. His mind launches a sh program. That sh program launches twenty different processes, all with stacks and large buffers, since they're written in C. Over a megabyte of data is passed through costly reads and writes from pipes. Fifteen temporary files are created.
``I don't know,'' he starts, ``don't you think that's inefficient?''

Am i understanding this right?

This is the same as doing

top++;
stack[top] = data;


?

This
Unix philosophy is dumb in 2019
That said Lisp is still not okay. Write in C++.

(defun ! (n &optional (a 1))
(if (zerop n) a (! (- n 1) (* a n))))

what is the same?

forgot pic fuck

Attached: 45124124.jpg (163x45, 3K)

>His mind mirrors how UNIX operates.

Attached: 1549429030765.png (551x491, 261K)

it's not the same
in the pic the index will be the value of top before the increment

Look at me, my name is C,
And you will soon know why.
Whenever I run out of stack space,
I fall down and cry.

Does there exist an operating system with OS-level garbage collection?

>That said Lisp is still not okay.
Why not? It's the cutest language.

Actually wrong this automatically increments the variable top here the moment the line is executed and data will be inserted in top+1

Surely you're familiar with the common sayings about the quality of code written by scientists of other fields?
Dennis Ritchie was originally a physicist.
That explains some things, doesn't it?

I wish. I also wish there was a way to return memory to the system. Often times, even after freeing a block, it isn’t placed into the freed pool, since the system can just give it again the next time the program allocated. I think there should be some system functions that the application can use to encourage the OS to recover the memory.

And Ken Thompson has Masters in EE and CS. Guess he may have helped quite a bit making both C and Unix consistent.

what is this anime?