/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1486934426149.png (1000x1300, 786K)

Other urls found in this thread:

github.com/xiph/rav1e
dl.suckless.org/slcon/2013/slcon-2013-4-nsz-the_costs_of_abstraction.webm
en.wikipedia.org/wiki/Worse_is_better#The_MIT_approach
bogleheads.org/wiki/Getting_started
pornhd.com/pornstars/sasha-grey
pornhd.com/pornstars/
twitter.com/SFWRedditImages

nth for Nim!

Nothing right now.
A problem I noticed is that since I started programming a lot, I stopped enjoying gaming.
It makes me a bit sad, even if I'm done for the day and I my brain is not capable of programming any more, I can't relax and just play some video games without thinking I should just code. But I can't, so I just end up scrolling dpt and watching twitch.

I want to design a CPU!

I enjoy programming

>born too late for the golden age of computer science - new algorithms, novel lanuage ideas, mainframes,
>born too early for quantum computing

born just in time to program in java
feels so fucking GOOD man

> C is only really used for things like codecs, where you want to squeeze every bit of performance out of every operation.
Yet Xiph uses Rust for their "The fastest and safest AV1 encoder": github.com/xiph/rav1e .

They make this fast by dropping down to C, same as with Python.

No one uses C anymore, grandpa.

Attached: Screenshot_2019-02-15 xiph rav1e.png (1015x212, 12K)

You need to balance development speed and efficiency or you go under

rust successfully replaces both c and sepples

Reminder that C is the only serious programming language.
dl.suckless.org/slcon/2013/slcon-2013-4-nsz-the_costs_of_abstraction.webm

Attached: 1532006879866.jpg (850x1202, 202K)

There are many new algorithms every year, they're just more niche so you have to be in a specific field to learn about them. For example new machine learning algorithms are being research like crazy at the moment.

As for novel language ideas I think Idris is the most exciting language to come out in a very, very long time.

t. cs illiterate

>schizoless

That's wrong. They drop into Assembly for all the fast architecture-specific stuff. Which is also something C programs often have to do when devs realize C isn't "bare metal enough" for every use case.

There is nothing exciting about Idris and it isn't even *that* new

Have you tried any of Zachtronics' games? I recommend Opus Magnum and Infinifactory. Factorio and OpenTTD are also fun games that evoke programming (with trains).

>suckless
Literal brainlets who lack the mental capacity to maintain fully functional projects, so they pride themselves on producing half-baked software without features.

That's the worst public speaker I've ever seen.
I forgive you for posting top-grade f*et though.

They are unironically considering dropping unicode support in dmenu considering that the latest release segfaults when using it, even though it didn't use to.

Idris 2 (or whatever he's calling it now) should be a lot more exciting. Dependent type theory is old, but quantitative type theory is brand spanking new. Hopefully Edwin and Atkey can iron out the kinks.

C is faster than Rust. I'll give you that but dinosaur languages like Fortran and Assembly are still faster than C. There are criteria for the theoretically fastest language that C simply doesn't match. C doesn't have immutability. That limits compiler optimizations. Multi-dimensional pointers also cause a problem for C because that means some variables must have a place in memory and can't be optimized away. Malloc having variable memory allocation also slows C. Functions like malloc32(), malloc512(), and so on would be faster.

>shitless

I'm surprised they supported it in the first place.

I'd be with you if the guy you were replying to said
>Those who sacrifice speed for a little convenience shouldn't call themselves computer scientists.

But he said "programmers". You're getting mouth-frothingly, hopping mad about a welder being more interested in welding than materials science.

>mouth-frothingly, hopping mad
It's pasta.

Yeah I tried that shenzen game about a year ago. It's pretty fun, but it feels like just more programming and thinking. I want to play like... Quake again.

In a graph, does there always exist a path from a vertex to itself?

Pasta or not trips merit a response.

Where from? He sounded really triggered

No.

That's why I suggested Opus Magnum and Infinifactory. They're further removed from the obvious programming of Shenzhen I/O.

A path, yes, an edge, no.

nth for bitfields

In general, no. A path must traverse at least one arc, if I'm not mistaken.

i want to suckmore on those feet

Lisp is the most powerful programming language.

I have no idea where it came from, but it's posted here all the time.

>Multi-dimensional pointers
No such thing, and C has register storage anyway
>Malloc having variable memory allocation also slows C.
Then don't allocate, idiot

Why is there a war on C all of a sudden? And why is it spearheaded by people of such particular qualities and personas?

The MIT approach is the right way to develop software systems.
"Worse is better" is Suckass-tier degeneracy.

Where can one learn about this MIT approach?

>And why is it spearheaded by people of such particular qualities and personas?
What are these "particular qualities" and "personas"?

All that matters is being first-to-market.

And no once should use Rust, either

Attached: Screenshot_2019-02-15_10-39-58.png (343x252, 18K)

malloc doesn't have to give you a pointer a chunk the exact size you ask for. It can give you more (and some malloc implementations will even tell you how much it actually gives you with a function like malloc_usable_size).
So you can make a malloc that only gives you chunks of a specified size if that would be more efficient. The rest of the problem is just a case of constant folding and interprocedural optimization.
Even then, malloc is just a library function. Make malloc32() if that's what your program needs. C encourages use of custom allocators.

it's just when the people who don't like C are all on at once

alright, I will check them out. Thanks

And which software systems developed with this approach in mind are currently in use?

The discord trannies got tired of Jow Forums, so they migrated here.

en.wikipedia.org/wiki/Worse_is_better#The_MIT_approach

They're paid shills, stupid. Why else would they pretend there's anything better than C?

Charles Moore-style is the best way.

>everyone who doesn't like c is a tranny
The absolute state of Cnile cope.

>Why else would they pretend there's anything better than C?
Because not only there is, there already was 50 years ago.

Thanks. I don't know which one of you is right, but you made me realise that since I'm dealing with a directed graph the reasonable interpretation in my use case is no.

You know exactly what I mean. I'd feel more comfortable dedicating myself to a language if it were run by people like e.g. Richard Hipp of SQLite, people with strong core values to go alongside their talent as opposed to certain ideology and Twitter posturing making core values or lack thereof.

Attached: 1500x500.jpg (1500x500, 152K)

It's true, though.

It's major a theater of the currently unfolding white genocide. Other theatres include putting women and minorities into video games and women not wanting to have sex with me despite me being white.

Imagine calling others trannies being your only argument.

Where does this even become relevant? It's like asking directions to the train station, when you're already in the train station. I suppose you could ask something like "is X reachable from A", and then substitute X with A, in which case it should obviously return true, i.e., there should be a path indeed.

You crack me up.

Which one is the best?

if (!worker.Work()) Popup(worker.LastError);


or

worker.onError.AddListener((msg) => { Popup(msg); });
worker.Work();


or

worker.Work((msg) => { Popup(msg); });


or

try {
worker.Work();
} catch (Exception e) {
Popup(e.Message);
}

Imagine being a tranny. Oh wait, you don't have to imagine.

Well, it's a corner case, but it needs to be handled consistently and documented.

Imagine using a language that will push you out as a core contributor for being "toxic" for not aligning 100% with left-wing progressive values and daring to make one single contrary, politically incorrect remark in a mailing list.

I dunno. Everyone keeps arguing over I don't know what anymore. I like programming in D

zzz

>dmenu
Just use a shell.

he's right, though. you don't have to like c, but there is no reason to hate it, there just isn't enough of a language there to actually hate. hating c is like hating a particular size and shape of cardboard box, but not hating cardboard boxes more generally. only rust trannies hate c, because they're the only people mentally ill enough to attach a political ideology to a programming language, and c is the evil white patriarch of the programming language world in their deranged views.
t. someone who doesn't like c

I don't think any language has the capability to do that.

gib me ideas that will make me rich

Anyone with bash experience? I'm unable to properly insert a function argument into a fragment of a command. Here's a minimum working example. Output incoming.

#!/usr/bin/env bash

# Save the script arguments.
model_name=$1
model_surname=$2


getModelLinks()
{

# These are the arguments
echo site_specific_url
echo $1
echo grep_filtering
echo $2
echo porn_site
echo $3

# Store the arguments.
site_specific_url=$1
grep_filtering=$2
porn_site=$3

model_url=$site_specific_url$model_name-$model_surname # Generate target url.

lynx_command="lynx -dump "
lynx_command+=$model_url
lynx_command+=$grep_filtering

echo "This is the lynx command"
echo lynx_command
echo $lynx_command


# Get video links.
# This is the problematic part.
lynx -dump "${model_url}" "${grep_filtering}" > playlist-raw-01.txt
# ERROR

# "${grep_filtering}" > playlist-raw-01.txt

# cat lynx-output-$model_name-$model_surname.txt "${grep_filtering}" > playlist-raw-01.txt


# lynx -dump '$model_url' '$grep_filtering' > playlist-raw-01.txt
# lynx -dump $model_url $grep_filtering > playlist-raw-01.txt
# Cleans up the list, removing the numbering, dots, spaces.
cut -d"." -f2- playlist-raw-01.txt > playlist-raw-02.txt
cut -d" " -f2- playlist-raw-02.txt > playlist-raw-03.txt
# Remove possible duplicate links and store it.
uniq playlist-raw-03.txt > $model_name-$model_surname-$porn_site.txt
rm playlist-raw-*.txt # Clean up buffer txt files.

}

# Calling the function"
getModelLinks "pornhd.com/pornstars/" " | grep videos | grep -v saved-videos " "pornhd"

go gay4pay on chaturbate

/dpt/ is much nicer when the fanatics have gone to bed and we can just help each other solve problems.

I'm glad you asked.
index funds
bogleheads.org/wiki/Getting_started

>because they're the only people mentally ill enough to attach a political ideology to a programming language
Wait, I thought that was Go.

Seduce and marry Jeff Bezos' wife, then divorce her, taking half her money, which is 1/4 of Jeff's money.

Attached: 5aea16d119ee8657008b478c-750-562.jpg (750x562, 59K)

It's a bash script to get video links from specific pages and models. The part that I can't get to work is how to put the pieces together to build that lynx command and make it run properly. The "grep" part is not added properly and fails.

Here's a finished (target) command
lynx -dump pornhd.com/pornstars/sasha-grey | grep videos | grep -v saved-videos | grep -v '/category/' > playlist-raw-01.txt


# OUTPUT
# [user@aus testing]$ ./mwe.sh sasha grey
# site_specific_url
# pornhd.com/pornstars/
# grep_filtering
# | grep videos | grep -v saved-videos
# porn_site
# pornhd
# This is the lynx command
# lynx_command
# lynx -dump pornhd.com/pornstars/sasha-grey | grep videos | grep -v saved-videos

# Looking up www.pornhd.com
# Making HTTPS connection to www.pornhd.com
# SSL callback:ok, preverify_ok=1, ssl_okay=0
# SSL callback:ok, preverify_ok=1, ssl_okay=0
# SSL callback:ok, preverify_ok=1, ssl_okay=0
# Verified connection to www.pornhd.com (cert=*.pornhd.com)
# Certificate issued by: /C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA
# Secure 128-bit TLSv1.2 (ECDHE-RSA-AES128-GCM-SHA256) HTTP connection
# Sending HTTP request.
# HTTP request sent; waiting for response.
# HTTP/1.1 200 OK
# Data transfer complete
# Can't Access `file://localhost/media/Data/00/14-KoEC/00/mpv-handler-late-shows/porn/slutmaster-pornhd/test01/testing/|%20grep%20videos%20|%20grep%20-v%20saved-videos%20'
# Alert!: Unable to access document.

# lynx: Can't access startfile

What language are you talking about?

> people mentally ill enough to attach a political ideology to a programming language
What does this even mean?

>t. someone who doesn't like c

Attached: 1533489441416.jpg (1280x1109, 245K)

She seriously looks exactly like she was drawn by a caricature artist.

And Jeff looks like he's having a minor seizure.

Use eval to evaluate a string as a shell command:
eval "lynx -dump ${model_url} ${grep_filtering} > playlist-raw-01.txt"
Otherwise, "${grep_filtering}" is just a string argument to the lynx command.

Damn Steve, do some exercise or you gonna explode, buddy.

Attached: fat_aerith_had_more_cake_color_by_satsurou-d31bkds.jpg (900x567, 75K)

Her neck will be handy once the guillotine starts its work.

Attached: Screenshot_2019-02-15 aoc billionaire - Поиск в Google.png (989x524, 488K)

My dear brother! You're the man. Thanks a lot!

C programmers don't know anything about abstraction, compilers, or cost.

>all of a sudden

>...
Post the full quote, you magatard.
"A system that allows billionaires to exist alongside extreme poverty is immoral."
Do you want to know how I'm sure your net worth is below 10 M?

If I initialize a static vector inside a function, when is that object destructed? At the end of the function's run, or at the end of main's run?

But I unironically agree with the short version too.

...

...

After you return from main but before the program exits.
main isn't the entrypoint of your program. _start is, and it's provided by the C++ standard library. Before calling main, _start calls global constructors - and after returning from main but returning itself, _start calls global destructors.

After main

main. static variables declared in functions are retained between function calls.

But you should double check that rathern than taking the word of a random internet stranger.

Stop LARPing.

That doesn't make it ok to misquote someone.

#!/usr/bin/env bash

# Save the script arguments.
model_name=$1
model_surname=$2


getModelLinks()
{

# These are the arguments
echo site_specific_url
echo $1
echo grep_filtering
echo $2
echo porn_site
echo $3

# Store the arguments.
site_specific_url=$1
grep_filtering=$2
porn_site=$3

model_url=$site_specific_url$model_name-$model_surname # Generate target url.

lynx_command="lynx -dump "
lynx_command+=$model_url
lynx_command+=$grep_filtering
lynx_command+=" > playlist-raw-01.txt"

echo "This is the lynx command"
echo lynx_command
echo $lynx_command
# NEW PART
eval $lynx_command

cut -d"." -f2- playlist-raw-01.txt > playlist-raw-02.txt
cut -d" " -f2- playlist-raw-02.txt > playlist-raw-03.txt
# Remove possible duplicate links and store it.
uniq playlist-raw-03.txt > $model_name-$model_surname-$porn_site.txt
rm playlist-raw-*.txt # Clean up buffer txt files.

}

# Calling the function"
getModelLinks "pornhd.com/pornstars/" " | grep videos | grep -v saved-videos " "pornhd"

the new part is labeled "NEW PART"
the eval function helps separate strings back into command arguments