/dpt/ - Daily Programming Thread

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

Attached: 20637610_p0.jpg (900x636, 560K)

Other urls found in this thread:

blog.jle.im/entry/functor-combinatorpedia.html
vulkan-tutorial.com
lispcookbook.github.io/cl-cookbook/emacs-ide.html
lispcookbook.github.io/cl-cookbook/functions.html
gigamonkeys.com/book/
wiki.osdev.org/Required_Knowledge
twitter.com/SFWRedditGifs

First for fourth.

nth for functor combinators
blog.jle.im/entry/functor-combinatorpedia.html

Third for Ruby 3x3

fourth for fourth

working on waking up it’s fucking difficult some days

>What are you working on, Jow Forums?
Starting a opengl project using sdl2. Should be shitty. I'm not using Vulkan, that shit is abandonware

>Cold as fuck due to winter
>Put flannel sheets on bed
>Bed super comfy and warm
>Hard to get out in the morning
I'm glad I work from home and don't have to start work at any particular time.

Attached: 1542830119975.png (139x129, 23K)

>What are you working on
Finding reasons to keep living.

Attached: 1557995003266.jpg (320x568, 23K)

Vulkan definitely is not abandonware. Basically everybody is on board, but it does take time to remove a 30-year old technology. It's also the kind of thing that gets use inside of engines rather than most people writing in it directly. Plus it's new enough that there is still a fair bit of old hardware in use that can't support it.

OpenGL is actually becoming proper abandonware at this point. The rate that extensions are getting made has come to basically a halt, and I doubt that a new OpenGL major (or even minor) version will ever get released. Even OpenGL 4.6 was just the "Vulkan compatibility" version.

10th for fug Remilia.

Ya looks like you are right. I found vulkan-tutorial.com and the first sentence is, "This tutorial will teach you the basics of using the Vulkan graphics and compute API. Vulkan is a new API by the Khronos group (known for OpenGL) that provides a much better abstraction of modern graphics cards." So I was wrong, I didn't know Khronos was behind it. I guess I will use Vulkan, fuck my life.

why dont you have a pastebin for people learning to get into programming

because if you can't figure it out yourself and need to be spoonfed you shouldn't be programming

Because there is so much breadth and depth to programming that there would be no way to keep track, let alone with a static pastebin. Also, this just fuck off and never come back.

Help me with .

Attached: 1561165866793.png (633x758, 429K)

>go to a mental help group
>ask for resources on how to acquire said mental illness

I can only give you the command that I use on my raspberry pi that sends raw h264 frames.
pi@owo:~/code $ cat vid-serv.sh
#!/bin/bash
# Does the device exist yet?
while true; do
if [ -c /dev/video0 ]; then break; fi
done

# Is the device in use?
while true; do
if fuser -v /dev/video0 > /dev/null 2>&1; then
printf '%s\n' "Device is currently in use. Sleeping 5s."
sleep 5
else
break
fi
done
printf '%s\n' "Starting server in 5 seconds"
sleep 5
dd if=/dev/video0 bs=1M | socat - TCP4-LISTEN:9999,fork,reuseaddr
#dd if=/dev/video0 bs=1M | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://0.0.0.0:9999/}' --demux=h264

>byuu

literally who

Ruby is nice. It's a real shame how python is more popular.

And somehow even faster.

I want more titty house cleaner

I have a 3D array of cells in the range [0..300][0..300][0..300] where each cell can contain 0 or more items and approximately 20-30% of cells have at least one item. I want to be able to efficiently find the closest N cells to some i,j,k index with at least one item. Currently, I'm just doing a breadth first search starting from i,j,k but this is very slow. What data structure should I use for to do this efficiently?

More info: Data structure never needs to be changed and its construction time doesn't matter. N will be relatively small (probably

>

The most efficient way to do it would be to precompute the closest cells for each cell for a max value of N so you dont actually do any runtime searching at all

That's totally not what I need.

Attached: youtried.png (1600x1523, 498K)

It can't be done because of latency. Why are they still insisting on this

It's viable if the latency is small enough

If you like it, use it. There is nothing stopping people from using ruby, certainly not the existence of python. You would have to be retarded to make that leap of thought.

Ok good luck doing it your way that doesn't fucking work because it's overly complicated. Fucking piece of trash.

lol the entitlement of this guy
this is why you don't respond to "please help me" posts

money

Wish I could piss in his cheerios.

That sounds a lot simpler than the answers I was expecting (like a kd tree). Is there any advantage to something like a kd tree here? I'm guessing your solution would use a lot more space and wouldn't be viable if N was too big.

When you construct you grid and you place a grid piece with an item, you can update all adjacent squares to reflect their distance to that square if it is closer than the value it currently has for distance from an item grid.

you would use a kd tree or an octree or something similar if the structure was not static or the max N was too high, but seeing your N is low then precomputing is the answer, space is cheap

good times

>asuka
>C

this image should be used more

Asking for recommendations on getting started with common lisp.
I am setting up SLIME for emacs according to lispcookbook.github.io/cl-cookbook/emacs-ide.html
So far I intend to go though lispcookbook.github.io/cl-cookbook/functions.html
Do you guys have other recommendations or advice?
(Note that I casually watched the sicp YouTube lectures but didn't do the homeworks)

Why does waking up feels like dying? If this is the life of a retarded NEET like me, how are ragie wagie doing it?

Probably something wrong with you. Also neet, but I feel great when I wake up.

It's ok fren.
We're all going to make it in the end.

Attached: 佐藤日向_127.jpg (1024x768, 88K)

gigamonkeys.com/book/

what we really need are resources on how to unlearn programming

Deep down I truly believe Asians are not from this planet and invaded long ago

pls dont insult my waifu thx

Holy shit I just got a galaxy brain idea: anime is spread everywhere to make them look cute and shit but it's just alien propaganda

On Lisp
Let Over Lambda
Paradigms of Artificial Intelligence
Art of the Metaobject Protocol
Common Lisp Programming Language

But before those:
Common Lisp: A gentle introduction to symbolic computation
Practical Common Lisp

>read and understand algos and data structures
How the hell do I program though? I mean solving neat problems with recursive stuff is fine but that isnt *exactly* programming. Its solving a puzzle.

Attached: 1557118650746.png (970x2048, 1002K)

But anime isn't spread everywhere and people judge you for liking it

That's because the reptilians are in conflict with the wifinians over establishing dominion on terra.
Watch more alex jones user.

Thanks. Added those to the read list

It can't ever be

The thing is it's an uphill battle. Not enough libraries, not enough support, people have python installed by default and screech if you make them install ruby.

I have a struct i will not specify the implementation of, but in essence one of its parameters is an array of `Position` triples (typedef'd struct). After position data in a mutable dummy triple, i then try to copy it over like so:
Secret structure = {... dummy_position_array }
But instead of copying the entire array to the other array, it throws a tantrum or stores some random number that has nothing to do with it. When i copy them over they become immutable so i can't do the copying iteratively for every position_array and dummy_position_array pair. How do i do this?

gcc give me this btw: note: near initialization for 'position_array'

I use python a lot, why would I consider ruby instead?

Ruby is essentially a much better perl. Has smalltalk OO and scheme influences. Has a very rich stdlib. It's a pleasure to use.

Well, that wasn't very convincing.

But holy shit if you want to use Rails. Better clone your entire system after setup so you can reproduce it.

the lambda syntax is nicer and you can actually kill threads

that is exactly what computers were built for was to solve very complex problems that would take forever to do accurately on paper.

video games, websites, guis are just tertiary to that and mainly come from improved hardware. to build this stuff you need to understand how hardware works, how game engines work, web frameworks etc. so basically to answer your question you have to look into what libararies do what how they were built what they're dependent on. how web browsers work, how operating systems work, etc. lots of reading, lots of hacking things together, lots of googling is how you build these things.

That's something, yeah.

You'll probably have about 20 ms of delay minimum if you're playing a game in the best conditions, if you only have a ping of 5 or 10 you wouldn't even notice

Yeah. Never really liked Rails. It put Ruby on the map though so the ruby community respects it.

I use Ruby and Python for linux scripting. Recently made a script that monitors my nvidia card and gives me nice data for grafana.

Can you post a concrete python script? I'll try to show off Ruby's advanced features.

Oh yeah. Python's lambda is really bad, it's basically a glorified return statement.

that's an extra 10 to your 20

Stop it, IO-kun! Keep Haskell-chan pure!

Attached: io.png (1920x1600, 697K)

>ping of 5 or 10

lmao

those are perfect conditions, in real life it often goes over 100

maybe one day you can tell game devs about your perfect DRM that beats their latency by a factor of 4

>junior dev position
>4 year degree required
>3-6 years work experience required
Ok.

You forgot all the meme frameworks and methodologies you need to know

Game devs and their DRM need to get fucked

You do realize that the reason why all that bullshit is in the ad is a tool to reduce the monetary demands of the applicant, right? "Hurr average for this entry job would be 40k but you don't have so we'll only offer you 35k Durr".

i like how clang/llvm is designed to be used as a library but to actually get the libraries you have to compile them yourself
i also like how that takes around a day
i also like how regardless of what settings i use cmake refuses to stop using micros*ft's linker despite it being incredibly slow
windows development is wonderful

Lottery(?) problem from kotlin-user in the previous threads:
def lotto(range,n)
result = Hash.new(0)
n.times { result[rand(range)] += 1 }
return result.sort_by { |k,v| v }[0,6]
end

picks = lotto(1..60, 100_000) # draw a lottery between 1 and 60, 100k rolls
=> [[39, 1578], [52, 1590], [58, 1598], [59, 1599], [23, 1601], [29, 1606]]

poo version:
class Lotto < Hash
def initialize(range,n)
@range = range
@n = n
super(0)
end

def draw!
@n.times { self[rand(@range)] += 1 }
freeze # super secure anti-tamper :^)
return picks
end

def picks
sort_by { |k,v| v }[0,6]
end
end

tuesday = Lotto.new(1..60,100000).draw!

should be
sort_by { |k,v| v }.reverse[0,6]

>using windows
>complaining about M$

The only reason many people (even people who are otherwise experts) dislike OOP is that they only have experience with the way Java and C++ do it.

imagine a genuinely pure functional language. couldn't even print output to the screen

if you think you can handle the job then apply anyway

Nothing wrong with C++ OOP, Java sucks dick use C# instead

Not really.
I learn a fuck ton of languages and i still hate it.
I truly think Smalltalk is the only tolerable version because it's the only pure form of OOP. I just wish i could use it without VM nonsense.

compared to what?

Ever looked into the generic function model compared to message passing?

you could have it return a world state change from the main function
the framework would interpret the state change description and print the message
it'd be very limited though, obviously

>the generic function model
example?

>the way
C++ does it like 50 different ways, and most aren’t shit.
Class hierarchies and inheritance are absolute brainlet tier.

Whats an OOP language that has the best functional programming features? C#? C++?

Common Lisp

clojure

C++ templates are a functional programming language in and of themselves, so C++

what do I need to know before getting into os development?

D or any language with UFCS, it's a must for non-FP langs to do FP stuff.

which one is the best practice?
Rectangle::Rectangle (double height, double width) :
height(height),
width(width)
{
}

double Rectangle::area ()
{
return (height * width);
}

Rectangle::Rectangle (double height, double width)
{
this->height = height;
this->width = width;
}

double Rectangle::area ()
{
return (this->height * this->width);
}

how to spot glow in the dark

is there a site that will randomly give you project ideas? i want to practice more but cant think of any practical ideas.

I have a feeling if Rust and C++ released at the same time Rust would have been more popular, its such a better language but it has the burden of going against something that has billion of lines of code written already out in the world + thousands and thousands of libraries

wiki.osdev.org/Required_Knowledge

the only time you should ever use the this pointer is when you need the address of the current instance of a thing, or when there are ambiguity issues, like in the body of a CRTP class

>its such a better language
Why?
And please don't use the same old, vague, shill talking points and buzzwords. Actually describe to me what makes rust a better language from someone who actually uses it.