/dpt/ - Daily Programming Thread

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

Attached: lisp_.png (165x256, 30K)

Other urls found in this thread:

onlinegdb.com/rJ1mnAdmr
onlinegdb.com/SkUlQ1KmB
godbolt.org/z/rJ65pg
godbolt.org/z/9edDQn
gigamonkeys.com/book/
twitter.com/NSFWRedditVideo

First for PHP. Pröööh pröööh, motherfuckers

Why is lisp an alien anyway?

>I have a space alien
Was he secretly writing another temple in Lisp?

Attached: jedi_monk drumset.gif (480x270, 1.76M)

Attached: 1543013636026.jpg (676x581, 54K)

Second for C

Attached: 1564782386710.png (3840x5016, 801K)

Okay I am a brainlet. Let's say I have a class Car and want to make a Car object... do I name it car? getCar?

Attached: 1527358195025.png (656x755, 39K)

cat = BMW_ENTERPRISE_CAR_FACTORY_BEAN_MACHINE_TSU(*TruckTemplate);

make_car

(defclass car () ())
(let ((car (make-instance 'car))))

Is it worth learning Spring Boot? Newb here (Java)

Ah, the old one good NotAnime/trans /dpt/ thread.

It's worth learning anything. At the very least, you'll know what not to do.

>was a CS major for two years, several years ago
>did C++, failed at pointers
>haven't bothered programming since
Should I pick programming back up with Lisp? I know there's no shortage of documentation for it.

>Get in at 830/9am
>Work until lunch
>Crash so hard mentally I spend my last 4 hours staring mindlessly at the screen and listening to podcast

Living the dream

Attached: 1529358034076.jpg (743x729, 154K)

Can anyone make this output "Winner"? onlinegdb.com/rJ1mnAdmr

thanks for collaging my posts

Other thread beat you slackers. New challenge is harder onlinegdb.com/SkUlQ1KmB

Typical C, contains at least 1 bug ;)

Hello programmer sirs, DURGA SIR is ICON OF JAVA ORACLE CERTIFIED EXPERT with over 1100 stundets in class room, please sirs do the needful and learn java from DURGASOFT

godbolt.org/z/rJ65pg

Attached: DC590C89-E39F-45B9-9A44-EA1D5CC1C46C.png (828x1792, 335K)

Many thank sir, will go on and become JAWA EXPERT with DuRGAsoft

Way much better than C++

I love the lisp alien.

I always fuck around in lisp when I'm not dealing with the previous devs shitty spaghetti C

>using vs code to relearn python and learn c++
>follow vs code tutorial to install matplotlib to the letter
>get to "create and activate the virtual environment"
>pic related
Google has not been helpful. Wat do?

Attached: error.png (1366x768, 186K)

try running

pip install -U pytlint

install gentoo

Yes

Attached: error 2.png (1366x768, 166K)

did you actually install pip

my understanding is that it comes with python 3.7.4, which I downloaded from python.org yesterday.

is python itself visible to vscode?

I believe so. I followed the steps in the tutorial to verify the python install without issue and wrote 6 (simple) programs also without issue.

then is the pip executable in your path?

oh, and try adding python -m before your pip call

Is any one able to give me an idea of why opencv is messing with clock_gettime(CLOCK_MONOTONIC,...)?

What's happening is, I'm able to use the monotonic clock from clock_gettime() to perfectly make something osciallate between two states every 250 milliseconds. I'm also using opencv. I have an opencv VideoCapture called cap

cv::VideoCapture cap(1);

and an opencv matrix called temp.

cv::Mat temp;

Everything in my code works perfectly until I uncomment the following line of code:

cap >> temp;

With that line of code included, my ability to oscillate between the two states every 250 milliseconds is totally ruined. Does anyone know why that could be?

is your computer simply not able to keep up

I don't know

rewrite it in assembly

thx

Continuing work on my project Erythros, an operating system based on unmodified TempleOS Kernel. I recently got my Virtio-net driver working, and wrote a little ping program tonight.

Attached: VirtualBox_TOS_08_08_2019_01_08_56.png (1280x720, 216K)

develop a holy lisp interpreter in holyC

Is that really templeos kernel?!
It looks great with 32 bit colors

I'm not super familiar with Powershell but try running python without quotation marks
You will have to cd to it's directory first

godbolt.org/z/9edDQn

Attached: Screenshot from 2019-08-08 16-05-09.png (3832x1362, 238K)

Use an anime image next time

stop bumping this thread until that one dies

Fake and gay

give up, grandpa C can't compete

Attached: Screenshot_2019-08-07 Compiler Explorer.png (1280x720, 236K)

Attached: Screenshot from 2019-08-08 16-49-57.png (2824x1420, 241K)

If for some reason I need to implement a decision tree on a stm32, should I do it with a lookup table, or with nested ifs and let the compiler do the optimization?

That is not even using dynamic memory.
Here is a C version wihout using malloc.
C++ only can compete with rust.

Attached: Screenshot.png (1920x1018, 139K)

Great achievement, cnile haha.
std::array is far superior than poorly hacked together decaying array and an "int" size.

Attached: Screenshot from 2019-08-08 17-15-30.png (3840x2160, 353K)

font?

How about std::cout?

If you're not writing in C++, you're not programming and should be banned from touching computers ever again.
C "programmers" don't actually give a shit about performance, they in it for the cult and/or too stupid to hold more than a few concepts in their head at once. C "programmers" are on the same level as Go "programmers", except possibly even stupider because Go at least is adding generics in their next revision. C is not a language for performance and it gives you no tools for writing efficient code.
Interpreted/dynamic/VMd/GCd "programmers" are not programming for performance even in the slightest, they don't give a shit if they waste machine resources. As long as their code is short and they don't have to think about difficult things they're happy, no matter how slow and inefficient their code is. These people should be fucking shot and burnt. It is immoral to waste so much machine resources for something that should require a LOT less.
>b-b-but it's just a few milliseconds!
When everyone has this mindset, everyone is writing shit inefficient code, and all that shit inefficient code builds up and now everything is fucking slow and full of idiotic bugs because the fucking idiots in charge of the software can't think properly.
Compare Riot to Pidgin. Need I say more?

tl;dr Anyone not programming in modern C++ should be shot, hung, and burnt at the stake. Garbage collectors, interpreters, and language VMs should be outlawed. Aggressive optimizations and LTO should be required by law for all releases. Anyone not intimately familiar with the C++ standard and undefined behavior should have a restraining order of 1km from any computer.

Stop heap allocating you dumb fucking idiot, use std::array.
Fucking learn C++ instead of making an ass of yourself.

Attached: 1556911128820.jpg (700x987, 678K)

This is a blue board, no nipple you faggot. Also go kys you anime loving retard.

>except possibly even stupider because Go at least is adding generics in their next revision
Go generics are the worst generics

yes, worse than C++ and Java

It contains two.

>he opened it

Somethings getting (((optimized))) out

Not anime.

C is not for everybody but if you can program in C++ well that is cool and you will probably be useful anyways.

vector vec { "test, "test2", "test3"};
vector::iterator iter = vec.begin();

++*iter;
I just wanna make sure I got this.
Both ++ and * have the same precedence but associativity is right-to-left, so iter gets dereferences first and then it tries to increment it but since it's a string it doesn't have ++ defined, right?

c++ is ok if you write C-style c++

Attached: C++ book.jpg (1730x2200, 795K)

just write C if you're going to do that

C style is the worst way to write C++.

I'm reading clean code and I've just read that you better not return null values from your functions, so you won't have to check if the value is null in the callers. But what are the alternatives? Is throwing an exception and wrapping all the calls in try catch any better? I think it's even more cumbersome. I have a shitton of methods, that return null and now I don't know what am I supposed to do with them.

optional types are the hip new thing
but IMO if your language doesn't allow non-nullable types just keep using null

stop reading books telling you how to program
i return null all the time
null is there to be used

>stop reading books telling you how to program
How else am i supposed to get rid of my niggerlicious code and write nice and clean one instead?

If you need a book to tell you how to write good code then fucking chain yourself to a poll and never go near a computer ever again.

Wow, let's look at your perfect code, which you were able to write from the moment you were born, genius.

>“A fool learns only from his own mistakes. A wise man learns from the mistakes of others.”

I'm not posting my code, just fucking learn to write good code from the heart. Books are inefficient.

Ok, brainlet.

You can use printf in C++

It's ok they are boy nipples

that doesn't mean you should

where do I start from writing an AI for playing an imperfect information game (a ccg)? a fundamental note is that my goal isn't to make it play absolutely perfectly at the expense of time, I'm looking for a computationally cheap compromise, where the AI is just smart enough to be able to rank a list of decks based on their winrate against an arbitrary deck (meaning that I don't need the absolute winrates to be accurate, as long as the relative winrates can help me distinguish a good deck from a bad deck)

I installed Dev-c++ recently and I am interested to learn the language. Can you give me some tasks to do so I can practice?

Attached: working with the PC.jpg (637x358, 46K)

N-body simulator

Why not?

it's unsafe

I strongly hope this is bait.

I agree that C is way worse than C++, especially modern C++, but let's not delude ourselves into believing C++ a "good" language in itself.

Yeah.
gigamonkeys.com/book/

>dev-cpp
holy fuck

in that case there are no good programming languages

What programming environment do you all C++ programmer anons use for C++ programmingz

Attached: 1551723446284.jpg (800x800, 47K)

mind your own business mr penguin

is it realistic to code a windows game with low graphic demands in C# rather than C?

totally

>what is xna/unity/insert shittty libs or fws here

it's fine

Notepad++

So, the great debate
>.cpp
>.cc
>.cxx

.hpp/.cpp

>.cc
>.cxx
What is this, 1995?