/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

paste.debian.net/924804/
codereview.stackexchange.com/questions/159056/find-all-distinct-8x8-chessboards-where-5-queens-attack-occupy-every-square
quickdocs.org/usocket/
multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/
twitter.com/SFWRedditVideos

Lisp is the most powerful programming language.

First for python

starting from absolutely nothing, how long would it take to become competent or even good at programming /dpt/?

asking... for a friend

>tfw press enter and you see a faggot post popping up just before your post

4th for 8086

Can you be a good programmer if you suck at math?

goddamnit

paste.debian.net/924804/

Wrote a simple formula expander that applies distribute law of multiplication over addition. Currently rewriting it to make it cleaner and so that I can evaluate numbers.

That depends on so many variables and factors it's impossible to estimate. Anywhere from 2 years to 5.

But it's not only programming, it's also understanding your environment/computer, learn good programming/development/software engineering practices, learning algorithms and data structures etc.

Not too long if you learn the important stuff
Learning what to write and how to go about writing it is far more important than knowing how to write in my opinion

dominated by lithpfags

You're doomed!

How are your linguistics skills and logic?

could you stop spamming our board with your shitty threads, please? You guys are the scum of computer science.

Yes.

Post code or gtfo

>our
Who are "we"?

This is the only CS thread on this board

Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.

kys

My wife Aoba is so damn cute!

I made this:
codereview.stackexchange.com/questions/159056/find-all-distinct-8x8-chessboards-where-5-queens-attack-occupy-every-square

I was inspired by this:
(Cross-thread) (Cross-thread)

Please help to improve

>tfw you realize this entire board is just one guy called Anonymous

I despise this thread.

Implying that combinatorics/discrete math is hard. It requires some problem solving skills, but very little general theory.

what i can use to easily access to com ports and sockets on windows

Why would you do that instead of using (pre|post)fix notation for everything?

/sci/, get out, we smart here too

we smart
we good
we independent

we script gods

>we script gods
I'm curious, how does one script a god?

Lisp
quickdocs.org/usocket/

import god

Guaranteed Overnight Delivery requires advanced knowledge of the Graph theory

Guaranteed Overnight Delivery System
(GODS)

>Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.
Programming is a difficult branch of applied math, therefore pure mathematics is more suitable for poor mathematicians? If you want to hide your inferiority complex better I suggest you review basic logic.

application of mathematics demands much more than being good at maths.

Application of mathematics doesn't demand much more than being good at maths.

So what do you think of Servo, /dpt/?

>

It's not Lisp, therefore it's trash.

how are you gonna use maths to optimize, for example, a car engine if you don't know anything about the underlying mechanics of the said engine? being good at applying maths requires you to be a polymath.

Simply, just formal mathematics to prove that there could exist a better engine and voilá.

Whats are the advantages of Lisp?

By the time it will ship Mozilla will be long dead

Trying to write an emulator using this tutorial:
multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/

It appears that I'll need to draw pixel by pixel, but how would I go about doing that with SDL? I'm very unfamiliar with graphics in programs. Should I just wait until after I complete some of the other tasks?

You manifestly don't know what you are talking about. Everything is not ruled by pure theory, see Merge sort vs Quicksort for an example; A computer scientist would tell you that Merge Sort is faster while a Computer Engineer would tell you that it's Quicksort... both would actually have right.

they have nightly builds out right now, currently building it myself because the speed increases are really impressive.

Common Lisp
-simple syntax any retard could memorize
-support for multiple programming paradigms
-programmable programming language (you can extend the language as much as you want, preserving its longevity)
-large number of libraries
-rather complete standard for a language from 1984
-multiple options for compilers
-per above, can be embedded in other languages/good FFI
-compiles to native code
-expressive and performant

That's because recursive merge sort (when you break down an unsorted list to smaller and smaller partitions) IS quicksort, god damn it.

The easiest way I can think of is to draw your pixels to a unsigned char * buffer that's a pretend image frame and then upload that image as a texture and draw it via opengl.

Other alternatives could include using GL_POINTS and pretending they are your pixels where each point represents a pixel in your viewport, but this could get some errors just because GL_POINTS.

I think OpenGL even has a setPixel type call back in the old fixed function pipeline.

So in other words there are no advantages?

This question is meaningless, for every programming language is a Lisp in disguise.

Can you do two-dimensional drawings in OpenGL? all the tutorials I've seen focus mainly on the 3D aspects of OpenGL

The biggest advantage is the macro system and stuff like closures and lambdas, but the latter is making its way into mainstream langs now.

I find the cooler stuff is always requires some math knowledge to understand

Yes, you can render 2D drawings by having an ortho projection rather than perspective projection.

It doesn't even have dependent types, it's a toy """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""language"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""".
So in other words there are no advantages?

There's no use in talking to an inane shitposter like you.

Your toy is utter trash.

You can define types that depend on values in Lisp. So even in that area, Lisp won.

Not that dude, but mergesort and quicksort are very different algorithms. Quicksort 'sorts' the array as it recurses by moving unsorted elements into semi-sorted 'larger' and 'smaller' subarrays around a (usually randomly chosen) pivot, then recursing on the two subarrays. Choosing a 'good' pivot has had a lot of theoretical work put into it.

Mergesort on the other hand, does almost all the work on the way back up from the base case (i.e. an array of size 1), by continuously 'merging' two sorted sub arrays into a single sorted subarray. In mergesort you can also see an interesting tradeoff in time vs space complexity, i.e. O(n) extra space to build each sorted subarray at each step for O(nlgn) RT, vs O(1) extra space, but O(n^2) total RT, since you have to 'walk down' elements in place in the intermediate merging step of two subarrays in worst case.

Post your own implementation of CoC right now.

I just misread this as memesort

brb writing memesort

>You can define types that depend on values in Lisp. So in that area, Lisp lost.
ftfy
Types shouldn't contain dynamic data. That's pure heresy

Are you brain dead? You don't need any form of dynamic garbage for dependent types.

C noob here

If I see this as a parameter in a function signature: const uchar4* const inputImageRGBA

I understand it's a constant pointer pointing to a constant unsigned char type, but should I assume it's an array or something? It's called "inputImageRGBA" so imagine it must be an array, but how can I tell from the signature what exactly it is? Do I just test if inputImageRGBA[2] points to something? I'm so confused

@59621119
nice plebbit spacing

the spacing is actually due to the code tags rather than me using my newlines

Depends on what you mean by "dependent types."

Not for types that depend on types.
But "types that depend on values" is pretty much the definition of dynamic garbage.

All types should be known and complete at compile time, anything else is dynamic heresy

You read the documentation and see how they intended it to work. Is there also parameters for size or width/height?

Yeah there's params for numRows and numCols

lisp was a mistake.

Please at least learn the basics of what you're talking about before spouting such garbage. You're just making yourself look like an idiot (which you are)
Even such inexpressive languages as Idris erase all type information at runtime. This is by definition incompatible with dynamic heresy.

I am currently working on a device to help me remove certain things from our world. Lisp is very high on that list.

Lisp will never die.

And the Sup Forums is the first to wipe.

Indeed, a language can't die. That doesn't somehow make it less shit.

Let me know when its ready. We need justice.

LOL

so deep user:)

It's probably an array then mate.

I hope your eyes enjoy this:
(labels ((fact (n)
(declare (inline fact))
(cond ((zerop n) 1)
(t (* (fact (1- n)) n))))))

Holy shit! What's man supposed to use if he just wants to develop gui applications to pc and mobile platform?
I tried kivy and it was nice but trying to do anything gui related in python just makes you want to kill yourself and ain't nobody got time to learn their shitty kv-language.
I know there's qt but it's such heap of sepples turd and compiling anything with is extremely convoluted.

>lisp was a mistake.

The programmer is the mistake. Common Lisp supports normal loops to avoid using recursion for everything.

Yeah I guess, I was wondering if there's a different way than making assumptions. I know that in Python people say the dynamic typing sucks cause you can't tell the type from the signature (unless you use type hints in 3.6), and you have to add comments to explain and comments get lost etc. I was expecting when trying C or C++ for this to actually be taken care of

In CL if you use labels I know it declares function but it's not called unless you call it.
In Scheme if you try to do the same as labels
(let fn ((arg))
...)

I never know if the fn is executed straight away.

H T M L
T
M
L

meanwhile in the first meme language.

C and C++ are pretty much untyped garbage.

That guy looks like he can't wait to tell somebody something.

You just need to read the documentation. If a parameter is an array it's also almost always paired with a length otherwise good fucking luck working on it unless it's null ended like a char*

not programming language or graphical library...

No, you're just referring back to code from 1960 to make it look like a mistake.

Here's how REAL lisp code would do this.
(define ! (compose (curry apply *) (curryr build-list add1)))

arbitrary requirement

Oddly enough, ISWIM was actually meant to do that. Since apparently in the 60's NIH syndrome was rampant.
Better but the still a mess)))))))

>REAL lisp code
>posts Scheme code

(define (factorial n)
(define (iter product counter)
(if (> counter n)
product
(iter (* counter product)
(+ counter 1))))
(iter 1 1))

if you suck at math, you're probably not very intelligent. and intelligence helps with everything

>wee wuz truck driverz

here's the error i'm getting
Couldn't match type `[]' with `IO'
Expected type: IO ()
Actual type: [IO ()]
In a stmt of a 'do' block: map (\ x -> print x) $ mergesort values

and here's the code
main :: IO()
main = do
input print x) $ mergesort values


what doesn't it like? with just print $ mergesort values it works but it prints out like [1,2,3] and i want it 1\n2\n3