/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Old thread:

Attached: 1566782592157.png (3062x1098, 400K)

Other urls found in this thread:

blog.bi0s.in/2019/08/24/Pwn/VM-Escape/2019-07-29-qemu-vm-escape-cve-2019-14378/
hownot2code.com/2016/09/02/a-space-error-370-million-for-an-integer-overflow/
github.com/rust-lang/rust/issues/10184
enyo.de/fw/notes/unsafe-rust-type-safety.html
twitter.com/AnonBabble

Dilate.

Please use an anime image.

blog.bi0s.in/2019/08/24/Pwn/VM-Escape/2019-07-29-qemu-vm-escape-cve-2019-14378/
God, Cniles really live in the 70s.

Attached: Screenshot_2019-08-26 QEMU VM Escape bi0s.png (887x195, 21K)

yeah, qemu is pretty bad
i reckon c++ would help a lot in restricting unsafe code into easily auditable files

Finally we have a solution to the hardest CS problem of the decade.

Attached: gender.webm (442x480, 228K)

Post the socks that you are wearing right now.

>this thread
>>Angular
>>Spring
>>Hibernate

Attached: 08c8e623d8dcf78a3ac84f39c95d482dcfcb9969.gif (412x412, 394K)

JFC, thank you so much for not being a fucking animetard!

yeah, based!

>>>Hibernate
dilate

pls dont

>Not even 15 posts in and already half are filtered.
We're off to a great start I see.

>only a single dimention
>not an unlabled 3d grid where you can put a point anywhere

I want to write my own toy shell for fun, but I also want to show recruiters that I understand programming concepts. What are some good, simple C projects I can put on my github to show I understand programming?

masturbate

You'll find plenty of those on . In the meantime, you're free to discuss the topic at hand: programming.

Remember kids, don't use Ada.
hownot2code.com/2016/09/02/a-space-error-370-million-for-an-integer-overflow/
It's cost the tax payers $370,000,000 in an overflow exception error.

Yeah, I expected a spectrum from cis male to cis female, but it's just a random bunch of genders, a drop-down would be better.

Attached: aXm215xjU.jpg (650x650, 72K)

>3d grid
>not allowing for an arbitrary dimension point
Fucking patriarchy

Should have used Rust.

Attached: image12.png (676x514, 298K)

the grid is only there for visual reference, your position would be would be chosen by 4 sliders allowing arbitrary x,y,z, and colour of the point

So much for type safety

The error was not a fault of Ada, it was the fault of the engineers who reused a program on different equipment without additional testing. The software was perfectly functional and correct, for the equipment for which it was created.

Read what it says:
Error handling was suppressed for performance reasons. If that is the case, rust wont help you either.

A type safe language wouldn't allow you to turn a 64-bit velocity into a 16-bit one.

That's what they wanted to do though. So in a type safe language they would have to force it, so you end up with unsafe code anyways.

What kind of retards think it's okay to turn 64-bits into 16?

BASED OP


FUCK ANIMETARDS


FUCK PEDO CARTOONS

github.com/rust-lang/rust/issues/10184
awkward

Attached: Screenshot_2019-08-26 Casts -.png (760x95, 14K)

>hownot2code.com/2016/09/02/a-space-error-370-million-for-an-integer-overflow/
I just looked through the article.

>It was their conscious action – to add adequate protection to four variables, and leave three of them – including BH – unprotected. The ground for this decision was the certainty that overflow is not possible in these variables in general.
>This confidence was supported by the evaluations, showing that the expected range of physical parameters that was taken as the basis for the determination of the values of the mentioned variables can never lead to an undesirable situation. And it was true — but for the trajectory evaluated for Ariane 4.
>The new generation Ariane 5 rocket launched on an entirely different trajectory, for which no evaluations were carried out. Meanwhile, it turned out that the “horizontal velocity” (together with the initial acceleration) exceeded the estimated (for Ariane 4) more than five times.
>The protection of all 7 (including BH) variables wasn’t provided because the maximum workload for the IRS computer was declared as 80%. The developers had to look for ways to reduce unnecessary evaluation expenses, and they weakened the protection in that fragment where theoretically the accident could not happen. When it occurred, then the exception handling mechanism was activated, which turned out to be completely inadequate.

tl;dr: bad assumptions (this "can't happen" thing ended up happening, leading to a surprise exception), somewhat screwy requirements (leading to trying to keep sanity checks in the code at a minimum to keep processor time down), and lack of testing (they used wildly outdated information based on previous launches rather than testing the code with the trajectory that they were using)
Even something like Ada won't help you if you're operating on incorrect assumptions and don't do the testing that you actually need to do.

1. Check if it's NaN beforehand like you'd do with any other programming language.
2. Poof! No UB!
Whoa! It's almost as if programming wasn't for low-IQ copelets.

enyo.de/fw/notes/unsafe-rust-type-safety.html
awkward...

Attached: file.png (648x82, 13K)

based

>This is a bug and will be fixed
awkward..

But that's what they needed to do in the code. If you read the code on the right they cap it when it's too large, so it's intended to be like that. The reason is the same as choosing unsafe languages in the first place, you need to write unsafe code for performance reasons and type-safe code wont help you in any way.

>what kind of retard take a number from the reals which has infinite precision and put it in a finite memory computer

Not the person you responded to and don't really disagree with the main thrust of your argument that this wasn't really Ada's fault.
However, what would you say to the argument that Ada is still at some minor fault by not being a language where programmers were productive enough to not feel the need to copy paste code.

Generally speaking, there is always less time than you'd want to properly code something. So the question is about how much the language will give you for the time you put into it. If it takes so long to code some sections of your codebase in Ada then wont that invariably end up with cost cutting measures being taken elsewhere?

I'm not too familiar with Ada so I might be being unfair but it doesn't seem like the most productive language from what I have seen.

Attached: rustcrab.png (442x1140, 722K)

pajeets

Safe Rust is supposed to have no UB. Besides, you have to check no just for NaN but for the values being in range. Still tho, since they left it a bug and UB they are free to fix the behavior in the future by defaulting to saturation, which would be the sanest variant.

Why rewrite a codebase in any language for a new rocket when you can just reuse the last one?

Attached: images.jpg (256x256, 25K)

> 40%
Is this a reference to 40% of cops beating their wives?

it's the suicide rate for trannies

What a coincidence.

lol trying to cycle a list in python and I'm absolutely a retard.

I set up a list of two items wherein: there are two options, if you select an item you get response and it removes the selected option.

That works. What I am having trouble with is automating the cycle through a list to loop it.

Attached: rust_btfo_eternally.png (401x292, 29K)

Rust does have a spec. It's just internal to the single compiler.

Should we add "dad jokes" to the list of arguments against Rust in the OP?

Then all implemented programming langs have specs.

Attached: rustsuccess.png (859x539, 311K)

Don't react to a joke with a counterargument you fucking idiot
Just laugh and agree that it's factually correct

good thing anime is programming related

Attached: 1546947822363.png (800x800, 597K)

If you do

#define universal_const 602214141070409084099072


and later on the value changes, is there a way to change the value without recompiling? or does this make it a set in stone variable

>Safe Rust is supposed to have no UB.
Casting float to int has always been bad practice that competent people never do in critical context. A function returning a Result is the only sane alternative.

universal_const isn't a variable, it's literally just text substituted by 602214141070409084099072 *before* compilation

Just how do you think the new value propagates into compiled code?

Attached: 1469843979355.png (304x366, 231K)

no i mean like is there a way to make it so it can be updated at a later date?

And this folks is why you should not abuse the preprocessor.

lmao

>We conjure the spirits of the computer with our spells.

Attached: 1566644123839.jpg (800x800, 72K)

The Rust shouldn't have allowed the `as` operator to cast from floats to ints as it does now.

do not
witchcraft is the work of the devil

Sure, just modify it in your text editor and instantly goes live!

Attached: rust.png (1031x278, 30K)

you know what i mean, if you dont i mean can it be treated as a normal variable at a later date?

preposterous

Name anything wrong with Lua
Hint: you can't

Attached: scratched.png (591x340, 23K)

Why is Lisp so comfy?

Let me make this absolutely explicit.

#define is for __text__ substitution.
__Before__ the compiler starts compilation, the C pre-processor replaces all instances of universal_const with 602214141070409084099072 as if that is what you had written in the first place.
It is __just__ text substitution. The compiler isn't even aware of it. As far as the compiler is concerned, you just wrote 602214141070409084099072 everywhere you initially put universal_const.

Attached: testrogue.png (516x511, 30K)

If you want to treat something as a variable, have you considered just creating a variable???

U0 Main()
{
I64 i;
CDC *dc=DCAlias;
SettingsPush;
WinMax;
DocCursor;
WordStat;
WinBorder;
DocClear;
dc->color = RED;
for(i=0;i

Attached: file.png (1275x919, 724K)

Amazing... Rust can never do this

Is this in curses? What FPS does it run at?

disgusting

which library do you use for graph clustering?

Attached: 1539007423076.png (200x150, 5K)

GraphIt. My own custom graphing library.

bullshit aside why in the fuck isn't this a dropdown

What component should I use in android just for viewing text with several lines + coloring? I'm using EditText within a scrollview but it seems crap for this

im the devil
ama

>HolyC
>disgusting

yeah, it is
hoisting all the declarations to the top of the scope is disgusting
PascalCase is disgusting
calling functions without parens in a procedural & imperative lang is disgusting

Attached: 831233331234.png (558x656, 312K)

You're disgusting.

Attached: abandned.png (1256x904, 135K)

Attached: baby duck.jpg (232x340, 18K)

soul

Attached: abandnedn3.png (992x856, 35K)

>conditionals with negatives cases in a language that doesn't support non-destructive negation
Confusing myself.

Attached: 1565139996122.png (1000x710, 344K)

Attached: abandnedn2.png (504x461, 14K)

Attached: ascii_graphics.png (640x360, 11K)

please stop

something sick came to my mind when you said this make a roguelike with emoji

Attached: cengine.png (715x349, 33K)

Attached: code.png (513x304, 9K)

...

what does this have to do with programming?
go to /vg/ and find the agdg thread