/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?


Previous Thread: Sorry for not using an anime image

Other urls found in this thread:

github.com/yegor256/eo
libpng.org/pub/png/spec/1.2/PNG-Structure.html)
common-lisp.net/project/cl-monad-macros/monad-macros.htm
twitter.com/NSFWRedditImage

Rust

That is one demonstration of disgusting font rendering

SECOND FOR CUTE

Oh shit, I used the wrong image
github.com/yegor256/eo

>And most male programmers are utter retards, the only female programmers that make it are the ones who are actually good.
Now who is using confirmation bias?

This

RUST OR BUST

In terms of programming ability:

women > men who crossdress > men who don't crossdress

men who are from india > women > men who crossdress > men who don't crossdress

>men that crossdress and sit on a dildo > women > men that crossdress > men who dont

Please halp

Sorry, I can solve the problem using D and Rust only

I'll do it for BTC

It's not confirmation bias, it's simply sturgeons law.

Should /dpt/ start giving wrong solutions to homework questions?

People with autism > People with no autism

I'll give you 117 dogerinos and 343 koinye

>we don't tolerate mutability and also constants
>we don't tolerate mutability but we want to build in transactions

study your language's libraries, user. I don't know about C, but I would definately use std.range: repeat in D

'*'.repeat(n)

Where are you stuck

Give me a blowjob

Look at his youtube channel, look at his blog and his articles.

He is a fucking retard

>we hate constants
Hitler did nothing wrong

Rust IS Bust.

OR*

CL-USER> (type-of 'rust)
BUST

university trained males > university trained females > males > females > r/learntocode > crossdressers from Sup Forums

If your language doesn't let you do Prolog in the type system, it's worthless.

*HAS

The Java labs I work have an assignment that I'm pretty sure does exactly this

What languages let you do Prolog in the type system? Besides Prolog.

reverse traps > traps

Haskell, Scala

university trained *nu-males

>flow control statements (if)
You see, this kind of shit is going to be needing a lot more explanation than everything else.

> i tried that, but it didn't work. Are you trolling me?

tbf haskell doesn't have those built into the language
because they're library features

>inb4 "if"
if was a mistake

If we keep doing it they'll go away.

Building this video server so I can use my phone as a remote for VLC and watch my Mongolian silk weavings from my couch. I'm stalled at making the controls look better because >wdg.

Real talk time. Why do so many of you use languages that make you do work that the compiler/interpreter could be doing for you?

>university trained males > university trained females > males > females > r/learntocode > crossdressers from Sup Forums
*university trained males that majored in anything STEM, not CS > university trained males who majored in CS

Prove me wrong.

Pro tip: You can't.

What does R.U.S.T stand for?

You can try, but if someone posts a question in my favorite language, I'll do my best to genuinely help them.

And there's nothing you can do about it.

I use a type inferred language

But I don't, user.

I'll invent problems in your solution to scare the user away.

RELIABLE
ULTIMATE
SECURE
TESTED

Rust
Unites
Socially-minded
Transvestites

rust

Rust Uses Safe Transformations

Not really applicable to most solutions in the language I use.

Maybe that's possible with Haskell memes.

robust
unbreakable
secure
tested

i'm inseCure

More like I am a C.uck

>if was a mistake
A language without if is more or less useless.

Because it is good to know what is actually going on behind those compiler optimizations. You end up understanding your programs a lot better by going through all of that hard work.

>it is good to know what is actually going on behind those compiler optimizations
Yes, and once you know you can stop using inferior languages and use better ones instead.

myFunction True = x
myFunction False = y
>myFunction b x y
>if b then x else y

Rust
uses
safe
templates

According to the png spec (libpng.org/pub/png/spec/1.2/PNG-Structure.html)
all pngs have the following decimal values at the beginning:
> 137 80 78 71 13 10 26 10

But when I open a png with text edit, I get closer to the thing in pic related... How can I actually view the decimal values in png? (I tried to open a png in emacs, atom, and sublime, but they all displayed the image instead of the text.... Can I configure them to show me the data?)

Maybe if you're an undergrad.

At some point, unless you're doing systems programming, you decide you need to be productive and actually get things done.

Use a hex editor. xvi32 is pretty good.

Open it in a hex editor

Offloading work onto a compiler is fine, although it is important to realize that the compiler is not omnipotent.

Offloading work onto an interpreter is retarded.

HxD will kick xvi32s shitter

>video server
What?

>so I can use my phone as a remote for VLC
Just use anyRemote.

For large enough programs, writing code like that will get annoying as hell.

ifThenElse True t _ = t
ifThenElse False _ f = f


...

ifThenElse b x y

Retarded
Useless
Shitty
Tosser

(defun bust (g)
(eq g 'rust))

(deftype rust ()
`(satisfies bust))

I always type in the number '5' and sometimes it will print invalid input, and sometimes it won't.
int a;
while ((a = (getchar() - 48)) 9)
printf("invalid input, try again.\n");


Shouldn't it evaluate the left expression first, and never enter the while?

Congrats, you invented the ternary operator!

Now why do we use if statements when the ternary operator exists? Maybe it's because we want something like...

if (condition1) {
thing1();
thing2();
mutate variable y;
thing3();
} else if (condition2) {
thing4();
} else {
thing5();
thing6();
}

Ruby, what's happened to OSGTP? Did you two fall out?

This is why we have COND.

When in doubt, more parens.

Monads.

std::unordered_map contexts;
who the hell thought it was a good idea to make the allocator the last template argument?

Cause a has no initial value you moron.
When you int a and then set a > 9. It's value is determined by whatever garbage is inside the memory the compiler defined. Hence why it is random.

How old are you fags?

Go away NSA

Rust is a goddamn pain in the ass to use. I guess I'm not patient enough to deal with all that lifetime bullshit.

Use Lisp.

Genuinely curious.

Weird. I thought it would assign it before any comparison.

Ruby chan, do you have experience in qemu aarch64 virt?

Why would I be using d*namically """typed""" garbage?

He's chilling in the Discord, and I still see him posting in the thread from time to time.

I see no reason why one cannot have a keyword if, if one is allowing cond/match to exist.

Cool. Keep it baked into the language so I can:
if condition do
thing1;
thing2;

No throwing away my keyword.

in Haskell this is just

when condition $ do
thing1;
thing2;

the only keyword is "do"

Since you can access pointers in C, can you access memory that is in use by other programs?

(defun equidimensional (a)
(or (< (array-rank a) 2)
(apply #'= (array-dimensions a))))

(deftype square-matrix (&optional type size)
`(and (array ,type (,size ,size))
(satisfies equidimensional)))
Say what?

Generally not.

That's among the most disgusting code I've ever laid mine eyes upon.

If you wrote this, please follow the pictured advice.

No
The OS will stop you

That depends on the OS. You can't do that if there's address space isolation.

Parentese doesn't work that way when used in the way you did. Try assigned a outside the conditional.

in Lisp this is just
(when condition
thing1
thing2)

@milk, come back to dpt discord

oop is a blight upon the world

of course, since lisp is trash and doesn't have monads.

conio.h is my favorite monad :^)

That's implementation defined

I love how this OP pic is obviously from somebodies first ever Java assignment, and OP uses it as some sort of attack on OOP.

Not directly. If you are on Windows look at ReadProcessMemory and if you are on Linux look at process_vm_read if you want to read memory. Ones for writing are similarly named.

There is existing work on monads with Lisp.
common-lisp.net/project/cl-monad-macros/monad-macros.htm