/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

on-ruby.blogspot.com.au/2009/03/mwrc-2009-mini-interview-philippe.html
github.com/NotHawthorne/kaskade
discord.gg/sdyXWm
booru.io
twitter.com/SFWRedditGifs

First for Ruby is /comfy/.

>Old thread lasted for just over 3 hours
Slow down, you turbo-autists.

karen would never say this

normie shit
>Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people.
-- Matz

Moan Ads in C

how can i create process on linux and have pipes open? first i call fork() then exec() but exec closes pipes, wat do?

posix_spawn

Matz never said that quote; the only source I could find for that was from some blog post of a guy interviewing Sam Ruby who randomly put the quote in the interview and didn't even attribute the quote to Matz in any way.

>but exec closes pipes
No it doesn't, unless you explicitly open them with CLOEXEC.
What you actually want to do is take their end of the pipe and dup2 it on STDIN_FILENO/STDOUT_FILENO or whatever you're trying to do.

I was wrong about who was getting interviewed, but my point still stands.
This was the only source:
on-ruby.blogspot.com.au/2009/03/mwrc-2009-mini-interview-philippe.html

Near the end:
>This is an art in which Matz is especially talented, and which gives Ruby a feel that appeals to a much broader audience: Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people.
I mean, the source is not very reliable to begin with, and the fact that the actual quote does not directly attribute it to Matz, makes it highly likely that Matz never said it in the first place.

>fork keeps all the files that the parent process had open

Yes, and?

>rubyfag trying to damage-control
Just accept that ruby sucks you dumb faggot.

>fork + exec a new process
>close one of the files on the parent process
>that file stays open in the child

Yes, and?
Close your fucking files properly.

Thing is, I do not want to close every file that I have open just to spawn another program user.

Then open all of your shit with O_CLOEXEC.

Sounds quite cancerous, I want to just be able to fopen.

glibc has an extension for that: "e".
Otherwise you're going to need to call fileno and then add the FD_CLOEXEC flag with fcntl.

Any ideas on what features to add?

>Otherwise you're going to need to call fileno and then add the FD_CLOEXEC flag with fcntl.
I just remembered: alternatively, you can call open first, and then use fdopen on it.

Why isn't it the default? Glad that it exists however. Thanks

Do you happen to know if there is something similar to the e fopen flag but only to decline opening files in write mode?

>Why isn't it the default?
Because POSIX and the C standard are kind of intertwined and they're both filled with archaic legacy shit.

inheriting file descriptors is useful for programs like bash where you spawn subshells quite often

It was only added in a recent POSIX standard, and I imagine it would break a lot of code if they changed defaults like that.
>decline opening files in write mode
If you open a file in read mode ("r"), it's only going to open it in read mode.

add a bittorrent client

I said "e" before by mistake, meant x (from C11, acts like O_EXCL).
If I am not mistaken if you try to open a file that is already open with the flags above from another program just with "r" the system will return an error.

Source?
Can you ask it for the magnet?

Idris is the language of the future.

Wrong. Javascript is the language of the future.

It already downloads selected torrents.

I'm not going to use a language named after an overrated nigger actor.

github.com/NotHawthorne/kaskade
It downloads torrents via the magnet link, so I guess I could add a feature to just output the magnet link.

The torrent file, or the actual content?

Actual content to /home//Downloads/

Fun fact: the language is named after a dragon from a children's TV show

Love you forever~

Ah okay, then I dunno. Seems fairly complete to me. Call it done.

Ugh, why do neckbeards always put their dragon dildo fantasies into things.

A dragon, not a "dragon dildo [fantasy]", you mustn't conflate the two.

Why is WPF so annoying to use? With WinForms you can just drag and drop everything in the designer, with WPF you can't just do it that easily and you have to deal with XAML all the time. It's obviously more powerful but I don't like using it for that reason.

Jesus Christ are the dragon dildos the only thing that go trough you functional shitters?

Would you consider Ruby to be a functional programming language, say like Haskell or Lisp?

So that's what's stuck up your ass

No

Damn. D:
Star and watch it on GitHub to make me happy~!

No. Ruby is POO.

Could you write a high-performance microkernel that uses the iommu on systems that have one to run device drivers in userspace really efficiently?
Why hasn't anyone done this before?

No

Ruby is Python, but better. Search your feelings.

I love Ruby though and I don't like Python that much. The thing I like about Ruby is that it has a lot of really neat ideas, while at the same time borrowing a lot of ideas from other languages, such as Lua and C.

L-License?

The reason monads and ADTs are better than OO is because in practice you never need a nontrivial type that's not just a sum, product, and/or composition of other types and kinds, and it's much more shorthand and readable to define such a type in terms of such operations than to define it on its own terms as if it's a sort of thing all its own

If it would be preferable for users not to have to think about the implementation details you could always make it an opaque ADT but it should still be an ADT underneath that, classes on the other hand treat the issue as though opacity were all that matters and the ADT part didn't, they're dedicated to creating a tight caller interface at needless expense to maintainer sanity

>Type cirklejerking
lol just use untyped lambda calculus

Hm?

>untyped
but then you have to write dynamically typed algebraic constructors to accomplish the same thing which is mildly more painful and also you have to use explicit conditionals to meaningfully deal homogeneously with fundamentally different data instead of being able to just overload and let pattern matching take care of it

>dynamically typed
No such thing.

>algebraic constructors to accomplish the same thing
Yes, which is fine.

>which is mildly more painful
Not if you make proper use of functions, macros etc.

>and also you have to use explicit conditionals to meaningfully deal homogeneously
How so? Who stops you from using pattern matching?

It does not have a license ;_;

It does now~

>No such thing.
Yes there is, the types are introduced by the constructors and thenceforth stored with their values in order to be available at runtime so that you don't have to declare them
Unless you're talking about genuinely untyped lambda calculus, which is impossible because lambda calculus features lambdas
>Yes, which is fine.
No it's not
>Not if you make proper use of functions, macros etc.
No, it's more painful even if you do
>How so? Who stops you from using pattern matching?
the fact that you don't have explicit types

*hugs*

Unofficial /dpt/ discord: discord.gg/sdyXWm

We talk about programming occasionally.

>unofficial /dpt/ botnet
no thank you

Oh I see. You must prefer the official /dpt/ botnet then
boards.Sup Forums.org/g/

Ruby is indeed Python but better. However both of these languages are OO and neither has ADTs. (Even though they'd be trivial to implement with the facilities these languages do provide.)

Writing a computer program to try to generate new and dank af funny girl memes.

Why do girls have better dank memes?

Don't believe me? Just visit Tumblr. They say the place is cancer and they're right, it sure does grow all over you and consume your life. The shit there is a thousand times funnier and more infectious than anything on this has-been of a subpar porno site.

When I look to hook up with a chick, I pretend I want sex, because I'm a man and that's what's expected of me. But the reality is I'm just looking for someone to be my 24/7 meme dealer.

Hopefully if this project goes well I'll have built that someone with my own hands.

>dicksore
No, kys
People with a brain use irc or some other foss alternative. No sane person uses dicksore.

>not anime meemes
>all cool memes came from anime and 4chins
no

> But the reality is I'm just looking for someone to be my 24/7 meme dealer.

i can relate to this very deeply

...

guaranteed fucking replies

>Yes there is
No

>No it's not
Yes it is

>No, it's more painful even if you do
No

>the fact that you don't have explicit types
Can't see how it stops you.

nananana everything you say is wrong!!

:(

when did codewars go to shit? it was fine a year ago

>female tumblr mems
>>not anime meemes
what planet do you live on

Have a girl meme

I am using legacy functions of a legacy format library (GIFLIB). What will happen to me?

if they aren't smiling while talking thats true

but if a girl smiles towards you she wants your penis

Mine's better, and also anime.

Got fed up with danbooru and started slapping together this piece of shit some time ago booru.io

m8 did u even try
here have a grill meme

Holo is not for sexual purpose

Blue board retard.

>.io
meh

here is a more genuine girl meme

autism

Truth

How can I learn enough Python/Ruby to get a DevOps Position? I'm already a SysAdmin/Cloud Engineer. I'm so tired of writing these little shitty programs that just output text. What now?

Read the docs.

congratulations your leftist bullshit managed to immediately bring the programming thread to a full halt to host an exclusive discussion about feminazi memes

all i want is equality but liberal faggots need to realize that entails the opposite of almost everything they think it does
They need to realize:
* whites are the most oppressed race
* niggers and beaners are overprivileged and abuse their social power by stealing and raping
* men are the more oppressed sex
* women are overprivileged and abuse their social power in every way imaginable
* straight is the most oppressed sexuality
* faggots are overprivileged and abuse their social power by subjecting innocent normal people to their excessive dicks
* normal is the most oppressed gender identity
* trannies are overprivileged and abuse their social power by forcing us to call them shirley and let them use our bathrooms
* atheism and christianity are the most oppressed religious beliefs
* mudslimes and kikes are overprivileged and abuse their social power by killing people and accumulating unfair quantities of money
* skinny is the most oppressed body type
* fatties are overprivileged and abuse their social power by stuffing their faces at everyone else's expense, demanding too much of healthcare and transport services, and demanding we call them pretty even though they're hideous and stinky

Holy shit, fuck off back to Sup Forums already.

You shut the fuck up, he's right.

Lmao dude, does not even load with js disabled. Kys
Also, >yet another centralised booru clone
no thanks

Kill yourself samefag.

You should have kept an eye on the counter faggot.

Are you claiming that this was your first post in this thread?

what am i doing wrong guys

//sort lowest to high
var numbers = [4, 6, 8, 3, 4, 6, 2, 4];

for (var x = 0; x < numbers.length; x++)
{
if (numbers[x] > numbers[x+1])
{
numbers[x] = numbers[x+1];
}
}

Do it yourself on paper, and you'll find out.