/dpt/ - Daily Programming Thread

Old thread: Lisp is the most powerful programming language.
What are you working on, Jow Forums?

Attached: Lisp.jpg (750x420, 29K)

Other urls found in this thread:

braveclojure.com/
marketplace.visualstudio.com/items?itemName=mattn.Lisp&ssr=false
stackoverflow.com/questions/11720656/modulo-operation-with-negative-numbers
stackoverflow.com/questions/3883004/the-modulo-operation-on-negative-numbers-in-python
pragprog.com/book/shcloj3/programming-clojure-third-edition
eta-lang.org/
pastebin.com/aibHWvWf
stackoverflow.com/questions/1907565/c-and-python-different-behaviour-of-the-modulo-operation
proofwiki.org/wiki/Definition:Set_of_Residue_Classes/Least_Positive.
youtube.com/watch?v=2dbR2JZmlWo
en.cppreference.com/w/cpp/iterator/size
twitter.com/NSFWRedditGif

What's the best book for learning Clojure if you're already familiar with Haskell?

mein kampf

Last week I asked what to learn and you guys said Java can get me an easy job, now you're all saying it's pajeet or some shit. I don't give a shit if it's pajeet or not, can it get me a job or not?

Attached: Human_billboard_Atlanta.jpg (900x498, 102K)

Depends, are you in Pakistan right now?

braveclojure.com/

Attached: braveclojure.png (900x900, 104K)

So I've been saying Java can get me a job (in Java/C++/whatever languages) and you're all saying it's not Pajeet and that it's not pajeep. So now you're saying this is Pajeep so we both know that we should just learn another language. But there is some good things in Java/C++/whatever languages, so what's the problem with learning that?

But I don't say there isn't good things in any language for people that want to learn other languages, just don't go and try learning something that has bad things for people with that mindset.

whats a decent way to keep sql skills sharp?

i took a class on it a few years ago but i dont have a reason to use it regularly so ive forgotten most of it

prodigy coming through

def nearestOdd(n):
if ((abs(int(n)+1))%2 == 0): # int(n) is odd, return int(n)
return int(n)
elif (abs(int(n))%2 == 0): # int(n) is even
if (int(n) == n): # n is int
return n - 1
elif (abs(n) - abs(int(n)) > 0): # n is a decimal
if (n > 0):
return int(n) + 1
elif (n < 0):
return int(n) - 1

it only took me two hours too.

>t. guy who dreams in code

if you can't even do the fizzbuzz in SQL, forget it

Are there any good vscode extensions for common lisp?

>vscode
>common lisp
Do not even try. Just use emacs.

marketplace.visualstudio.com/items?itemName=mattn.Lisp&ssr=false

rewrote your code to a one liner
nearestOdd = lambda n: int(n) if ((abs(int(n)+1))%2 == 0) \
else n-1 if int(n) == n \
else int(n)+1 if n > 0\
else int(n)-1

i don't understand negative modulus

nice, I'm rewriting it right now.. I feel a little extra dumb today so I thought I'd share. just make sure that ties go away from zero

just install Portacle

Ok, I really don't get why in python -12.001%2 = 1.99. Can someone offer an intuitive explanation here? I clearly see why 12.001%2 = 0.001, but don't get why this wouldn't be the same for the negative.

-12.001/2 is -6 with a remainder of 0.001, so I would expect 0.001 as an answer. I suppose it's wrong to think of modulus as just a remainder operator, but I'm still not grasping this. And yes, I see that 2-0.001 = -12.001%2 = 1.99, I just don't get why.

modular arithmetic

stackoverflow.com/questions/11720656/modulo-operation-with-negative-numbers

>Ok, I really don't get why in python -12.001%2 = 1.99
-12.001+6*2=-0.01
-12.001+7*2=-0.01+2=1.99

>make a catfish tinder account using photos of a male supernodel
>tons of thots fall for it
>hook it up to a bot that tells them to kill themselves for being whores
lol

Attached: 1544963044852.gif (600x600, 1.61M)

my bad, stackoverflow.com/questions/3883004/the-modulo-operation-on-negative-numbers-in-python

you might like this one
pragprog.com/book/shcloj3/programming-clojure-third-edition
it's by the lead maintainer

LispKit SEDK machine in FPGA/Verilog
Slogging through the slow and dull phase

>knows Haskell
If you want a JVM language, Eta is Haskell on the JVM.
eta-lang.org/

What are the best frameworks to develop GUI's? Is JavaFX ideal for cross platform? Whats the best one for windows?
I've been dabbling a bit on swing but that crap is atrocious when it comes to editing/aesthetics.

what should i learn/review in anticipation to calculus i?

>What are the best frameworks to develop GUI's
Every. Damn. Thread.

I'm trying to be beyond Python, should I go for Java or C/C++, preferably one that would get me a job

Attached: de206b2.jpg (641x960, 91K)

...

Java. Or javascript if you want to do webshit.

Found a bug in the library that I was using for the game, so I made a PR.
Enough for today, time to sleep.

Attached: masked.webm (800x600, 619K)

this may be a stupid question but is there anyway to stream youtube videos without donwloading them through a programming language?

I hate HDL's. Fucking autism.

javafx is fine.
what language are you using it with?
a languages may have its own way of using it.

it's lovely

smplayer can do it

is pic related the supermodel?

>next year
>Criticizing billionaires IS the new blackface!
>People who criticize billionaires are practically slave owners!
>People who criticize billionaires ARE slave owners!
>People who criticize billionaires are WORSE than slave owners!
>Stop criticizing billionaires!

Thanks, user!

Java is pretty bad and you'll tear your hair out. I advise C++

it's fine
but Jow Forums isn't in charge of hiring
you should find out what languages are in demand where you live

They are both boomer trash tbkh. The latter tends to be buggier though.

Attached: AD34E28C-1495-4259-85F1-91BDC0276C68.png (894x894, 577K)

>don't use garbage, i advise feces

Im trying to learn a new language but I keep putting it off and the exact same tabs have been pinned for weeks. How do I just go for it?

Attached: duck.gif (108x87, 1K)

ok so maybe you will help me. How do i make 0-argument :method in defgeneric, so (f "Some") will print something different than (f) alone? I tried this, but it dont work
(defgeneric f (name)
(:method ((name string))
(format nil "Something ~a message" name))
(:method ((name nil))
(format t "Default message")))

C++ has a very specific use case. Java is outmatched by a lot of languages out there. I have yet to see something that rivals C++ in the areas it is good at. And no, I still haven't seen a game company use Rust.

ASCII to Base64 in Haskell: pastebin.com/aibHWvWf

oh nevermind
(defun foo (&optional (bar "Default"))
(format t "~a" bar))

I had actually read both of those and more before posting believe it or not, but I think I get it (somewhat) now. I'm just going to type out my thoughts / intuitions and please correct me if I'm wrong, anyone.

This link was actually the most helpful / representative of my misunderstanding:
>stackoverflow.com/questions/1907565/c-and-python-different-behaviour-of-the-modulo-operation

I am totally in the C camp there.

In reference to the Python post, this was in the top answer:
>(-5) % 4 = (-2 × 4 + 3) % 4 = 3.

If were were dealing with positive 5 (which I completely understand the modulus operator for in Python), the equation would be:
>5 % 4 = (1 × 4 + 1) % 4 = 1

This makes sense. 4 divides 5 exactly one time, with a remainder of one. I'm struggling to understand why when working with negatives, it would be any different. We have:
>(-5) % 4 = (-2 × 4 + 3) % 4 = 3.

And 4 does not divide 5 two times. Why wouldn't we instead write:
>(-5) % 4 = (-1 × 4 - 1) % 4 = -1.

I think I need to reinforce the difference between remainder and modulus. I can understand it well enough to predictably use it with negative numbers at this point though, I just have to tell myself it does not do negatives, and only moves left on a number line, not right.


Why doesn't modulus just return the -0.01, as I mentioned above? this is the behavior I was expecting. When looking further into this I was linked with this: proofwiki.org/wiki/Definition:Set_of_Residue_Classes/Least_Positive.

wow thanks for the insight bud

You guys think Tor could be improved? Or is it the best we’re gonna get

Close furaffinity and just fucking do it. Buy a can of Monster to motivate you. Caffeine won't do shit, it is just psychological flag to tell yourself that now you mean it.

The whole internet could be improved if we dropped HTML in favor of a language thought to be a internet standard.

Well it's made by the CIA, so go figure

Tor isn’t just for web browsing you know
I don’t think that’s true, it was developed by the Navy and continued by its original creators

I2P is better. You can torrent through it, foor instance.

Well, Java is the "most popular" programming language based on the TIOBE index

Does it offer the same privacy/anonymity that onion does? What about performance?

Most popular doesn't mean best. Java is only the most popular because it was a convenient solution in the 90s because nobody wanted to code everything in C and Java was like "here you can code it once and have it run anywhere". That's why a lot of shit was made in Java and that it's starting to become legacy. The JVM is why Java is used. Java itself is a garbage language. There's a reason why Scala, Kotlin and Clojure have made a big leap recently.

>Tor isn’t just for web browsing you know
Neither is a shovel just for digging holes.

You are the most retarded gorilla nigger I have ever seen

>Why doesn't modulus just return the -0.01, as I mentioned above?
By convention, the modulo by a positive integer n is given a representative x with 0

just get your algebra and trig skills up to par.

>is given a representative x with 0

did you tried looking in the mirror?

git gud

When can you call yourself an "expert" at a language?

Attached: 7pm9cu33yrc31.jpg (1883x1883, 494K)

I'm not your mother.

I'm starting to get demotivated.
Fuck everything. Can I just read a motivational book about programming? Or a motivational essay or whatever? I"m starting to get depressed. I'm shit at this.

When you give more answers about it than you question people about it.

youtube.com/watch?v=2dbR2JZmlWo

What’s with the shitty comebacks?

The Joy of Clojure, Second Edition

Attached: 2A708219-F61A-4F75-93B6-C20BC051737C.gif (576x471, 15K)

I'm going through clojure for the brave and true but I find the book extremely boring as a Lisper.
Would I get more out of that one?

When can you call yourself "competent" or "proficient" at a language?

when you're competent or proficient at using it

When you can maintain a decently sized codebase

Can someone please tell me why this is not compiling? I'm on ubuntu 19.04 with gcc 8.3 and build essentials installed.

Even the example from the std lib page doesnt compile.
en.cppreference.com/w/cpp/iterator/size

Attached: Screenshot from 2019-07-28 07-30-03.png (1920x1080, 208K)

Being a good programmer/developer has nothing to do with knowing a certain language.

But java is fine to learn, it's versatile and used all over the place.

are you using C++17?
iirc most compilers default to C++11 or something, which'd mean no std::size()

*are you explicitly using C++17

is correct. pass -std=c++17 in

I totally forgot that effect.

The biggest problem is that you are using visual studio.

The biggest problem is that you aren't* using visual studio
ftfy

I come from Common Lisp and I wanna learn Clojure. should I read Clojure programming or the joy of clojure?

is starting learning programing with C is a meme?

what do I learn along side the desired programing language?

what books does Jow Forums recommend, if i`m going in with zero experience

Attached: n14tq3orx1f11.png (525x776, 474K)

it worked! Thank you so much!

Depends on what language you actually want to learn.

none

Don’t learn C/C++, it’ll make you hate every other language

Then don't go into programming.

I do not recommend you to start with any language. I recommend you to go through this book. It's in Common Lisp. The aim is aside from learning Common Lisp, to learn how to program. Everything in this book is present in other languages, or currently being implemented still. It's an excellent first book. You'll get solid bases with this. Feel free to move to any language after this.

Attached: Gentle-introduction-to-symbolic-computation.jpg (260x326, 25K)

I'm not a big fan of brave clojure because I find the book tedious, but it covers all the important topics.
You should also do the exercises in 4clojure along with the book to get practice.

Java or Go

+1 to user's book choice. However, I suggest that you do start a general language as that will making your learning productive. I recommend either of these two:

1) Smalltalk: It was made with simplicity in mind. Condensed and logical syntax structure. Legacy is dead, but the modern variants Squeak(hobbyists) and Pharo(professional and extensive free resources) are much alive.

2) Julia lang: Combines the simplicity of Python with the performance of C. It's incredibly powerful and popular with data scientists, astrophysicists, chemists, and petrol engineers. Plenty of free tutorials, and a very approachable community

So apparently you can enforce type equality in type signatures in Haskell with '~'.
What's even the point of this when you can just use the same type name?

Dart+Flutter