Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Posting Principle
Dec 10, 2011

by Ralp

Nomnom Cookie posted:

java.security.SecureRandom biyatch

can you easily choose the distribution that this produces or is always just a uniform distribution in the specified range?

Adbot
ADBOT LOVES YOU

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Isn't a uniform distribution a necessity for a CSPRNG?

Max Facetime
Apr 18, 2009

hackbunny posted:

Auto is not just convenient (especially to write foreach loops), but necessary due to the fact that in C++11 some expressions may have a type that you can't even express in code. For example, lambda expressions result in automatically generated objects with automatically generated type names that you simply can't know in advance

I don't understand, is this some sort of name mangling issue? like that the type name encodes some type information that's not otherwise expressible in C++ and the encoding is platform dependent, or something?

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Nomnom Cookie posted:

java.security.SecureRandom biyatch

did you c+p this from the s4ccurity fuckup megathread

http://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Hard NOP Life posted:

Isn't a uniform distribution a necessity for a CSPRNG?
depending on what you're doing you might want different distributions

therefore this is a language feature microsoft will implement in vc++ in approximately never loving ever

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Hard NOP Life posted:

Isn't a uniform distribution a necessity for a CSPRNG?

the standard definition uses uniform distributions, but that's just because it makes a lot of proofs simpler. it's not integral to the concept

a nest of hornets
Nov 17, 2012

by Ralp

tef posted:

poo poo hn says

shrughes
Oct 11, 2008

(call/cc call/cc)

mnd posted:

Since it's Rustchat Q&A, can anyone tell me why they dropped typestates?

I don't really care, as I don't use Rust ATM, but I am curious.

I read something about this. They dropped typestates because they weren't really using them. It was a bunch of code to maintain, and it started getting out of date, so they dropped it.

Rust has userland threads, or "lightweight tasks" or however they call it, and typestate is not as useful in that sort of situation. You can emulate typestate pretty well with phantom types (and linear typing), if you're willing to create a new object with a different phantom type. Keeping typestate in the same object is the sort of thing you'd want to be able to do a lot more in event-based programming with callback hell. Maybe you can emulate it there with phantom types, too, I haven't thought much about that, but if you can do it, it's a bit more of a hassle.

Vanadium
Jan 8, 2005

gucci void main posted:

I'm putting my faith in Rust. It might take 10 years, but eventually the performance will resemble C's. It's basically a compile-to-C language right now as it is. There's just a whole bunch of inefficiencies in the implementation. Once they get ironed out, we'll finally be able to have our cake and eat it too. One language to rule them all.

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod



this is dalvik/apache harmony specific IIRC. basically, securerandom is a secure random unless you're developing for android.

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION

gucci void main posted:

I'm putting my faith in PHP. It might take 10 years, but eventually the performance will resemble C's. It's basically a compile-to-C language with HipHop right now as it is. There's just a whole bunch of inefficiencies in the implementation. Once they get ironed out, we'll finally be able to have our cake and eat it too. One language to rule them all.

Nomnom Cookie
Aug 30, 2009



Posting Principle posted:

can you easily choose the distribution that this produces or is always just a uniform distribution in the specified range?

gently caress if i know all i ever want is uniform. anyway if you have a uniform distribution isnt it straightforward to transform it to some other distribution?

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Nomnom Cookie posted:

gently caress if i know all i ever want is uniform. anyway if you have a uniform distribution isnt it straightforward to transform it to some other distribution?

you can transform a uniform distribution to a gaussian easily by two different methods, at least

pseudorandom name
May 6, 2007

Max Facetime posted:

I don't understand, is this some sort of name mangling issue? like that the type name encodes some type information that's not otherwise expressible in C++ and the encoding is platform dependent, or something?

No, every single C++ lambda creates a unique unnamed type (even if they have the exact same signature and capture).

There's literally no way to declare a lambda without either using the auto keyword or instantiating the std::function template.

Apple quite sensibly just made C++ lambdas silently convert to blocks.

Nomnom Cookie
Aug 30, 2009



its cute when c++ guys are like wowee this c++11 stdlib has EVERYTHING! i bet no other language has a stdlib this good

i mean what other language has support for threading, and a memory model, and atomic operations, and regexes

Opinion Haver
Apr 9, 2007

Nomnom Cookie posted:

gently caress if i know all i ever want is uniform. anyway if you have a uniform distribution isnt it straightforward to transform it to some other distribution?

if you know the other distribution's inverse CDF it's really easy (just pick a random value between 0 and 1 and apply the inverse CDF to it)

Nomnom Cookie
Aug 30, 2009



yaoi prophet posted:

if you know the other distribution's inverse CDF it's really easy (just pick a random value between 0 and 1 and apply the inverse CDF to it)

apparently this operation is part of c++11 which is weird cause usually c++ guys love the hell out of yak shaving

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





erlang makes a lot more sense when you learn it's an operating system for telecom hardware

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

yaoi prophet posted:

if you know the other distribution's inverse CDF it's really easy (just pick a random value between 0 and 1 and apply the inverse CDF to it)

this isn't particularly fast unless your inverse CDF is really simple (like exponential)

Box-Muller/Ziggurat for normal

it's super easy to gently caress up generating random numbers even from "simple" distributions like poisson so having it standardized is a win

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

the talent deficit posted:

erlang makes a lot more sense when you learn it's an operating system for telecom hardware

it's as if you make tradeoffs and sacrifices when designing things

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

tef posted:

jeff atwood branches out in to merchandising http://www.codinghorror.com/blog/2013/08/the-code-keyboard.html

"But I'm not an average person. You aren't an average person. We aren't average people."

tired of making luxury goods for consumers, atwood decides to make them for programmers

it's really lame that you cant post that someone deserves to die anymore. thanks nsa.

Workaday Wizard
Oct 23, 2009

by Pragmatica
What. The. gently caress. Is yak shaving?

Posted from my iPhone.

uG
Apr 23, 2003

by Ralp
posting

Nomnom Cookie
Aug 30, 2009



Shinku ABOOKEN posted:

What. The. gently caress. Is yak shaving?

Posted from my iPhone.

90% of programming

the other 10% is swearing

Soricidus
Oct 21, 2010
freedom-hating statist shill

Nomnom Cookie posted:

java.security.SecureRandom biyatch
yagni, unless you're like literally a terrorist or a spy. java.util.Random is faster and ideal for all your high-performance legal cryptographic needs.

top tip: Random.nextInt(n) does a whole bunch of weird stuff that slows it down. use nextInt()%n for better performance in exchange for a minor loss of uniformity that nobody will ever notice

tef
May 30, 2004

-> some l-system crap ->

Soricidus posted:

yagni, unless you're like literally a terrorist or a spy. java.util.Random is faster and ideal for all your high-performance legal cryptographic needs.

top tip: Random.nextInt(n) does a whole bunch of weird stuff that slows it down. use nextInt()%n for better performance in exchange for a minor loss of uniformity that nobody will ever notice

nsa plant spotted

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Nomnom Cookie posted:

its cute when c++ guys are like wowee this c++11 stdlib has EVERYTHING! i bet no other language has a stdlib this good

It's more like, only C++ puts in that extra little effort. Like containers letting you specify the allocator, or the whole iterators abstraction, or how you have both sort and stable_sort, or how the RNG lets you pick a generator and a distributiom independently, or the fact that you get to choose a distribution at all. Its a double edged blade that all but ensures that "controversial" stuff like bignums will never be standardized (oh yeah, loving bignums are controversial)

Nomnom Cookie
Aug 30, 2009



Soricidus posted:

yagni, unless you're like literally a terrorist or a spy. java.util.Random is faster and ideal for all your high-performance legal cryptographic needs.

top tip: Random.nextInt(n) does a whole bunch of weird stuff that slows it down. use nextInt()%n for better performance in exchange for a minor loss of uniformity that nobody will ever notice

i agree but dude was like "what other language has a csprng in the stdlib". except i dont agree with your recommendation to avoid Random#nextInt(int). readability >>> performance

Nomnom Cookie
Aug 30, 2009



hackbunny posted:

It's more like, only C++ puts in that extra little effort. Like containers letting you specify the allocator, or the whole iterators abstraction, or how you have both sort and stable_sort, or how the RNG lets you pick a generator and a distributiom independently, or the fact that you get to choose a distribution at all. Its a double edged blade that all but ensures that "controversial" stuff like bignums will never be standardized (oh yeah, loving bignums are controversial)

you mean the c++ committee doesn't have the balls to pick something and present a simple api

edit: actually that was unfair, the c++ committee has balls they just got lazy and #included boost to make the new stdlib

Nomnom Cookie fucked around with this message at 15:18 on Sep 8, 2013

Opinion Haver
Apr 9, 2007

Nomnom Cookie posted:

i agree but dude was like "what other language has a csprng in the stdlib". except i dont agree with your recommendation to avoid Random#nextInt(int). readability >>> performance

but my micro-optimizations!

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Shinku ABOOKEN posted:

What. The. gently caress. Is yak shaving?

Posted from my iPhone.

i need to cut down a tree, but my axe is dull

i need to sharpen my axe, but i need to clean up the mess off my grinder

i need to put away this hammer, but my tool rack is wobbly

*20 steps later*

i need to shave my yak

it's basically when you lose focus on the original problem because you've got a too-long dependency tree built up

a proud c-language and j-language tradition is to spend a shitload of time on making libraries and utilities and frameworks because there's a slight impedance mismatch or difference of opinion about the ones that already exist

and because c++ 2030 is shipping a pointlessly reconfigurable prng it's depriving c++ programmers of their favorite activities (yak shaving) and making them do actual work

Shaggar
Apr 26, 2006
in the p-lang world you re-invent your regex parser in differently incorrect ways every project so no one knows which project has which vulnerability.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Nomnom Cookie posted:

you mean the c++ committee doesn't have the balls to pick something and present a simple api

I'll explain the bignum controversy, its one of those things that makes zero apparent logical sense unless you've been following C++ development for a while

The biggest issue is transparent vs opaque: are bignums big byte arrays, or are they opaque pointers? Boost people want transparent, as you can control allocation and other apparently minor/irrelevant poo poo; however, practical circumstances dictate opaque bignums, because exactly nobody wants to reimplement bignums when theres a lot of mature and super-optimized implementations out there

Another bignum controversy is lazy evaluation, where operating on bignums returns an abstract representation of the operation, which you realize at a later time (typically by assigning the result to a bignum), which actually executes the operation. Lazy evaluation is pretty much a necessity if you don't want a ton of temporary little bignums being created for every operation in an expression. But then If you're going to have lazy evaluation, should it come with an optimizer? If you have opaque bignums and the underlying implementation implements lazy evaluation (like GMP does), should you use that? Basically bignums should really be a built-in type, but the standardization committee will never go for that (what about allocators?!?!?! Or you could make bignums a built-in generic type where you can specify the allocator as a template argument... Hmmm...); or they shouldn't have int-like semantics because they'd behave in subtly different ways (with lazy evaluation, const auto x = bignum1 + bignum2 would result in x not being a bignum, and the addition not actually performed; evaluating x twice will result in the operation being performed twice; etc.). You know all the what-ifs that are usually pointless, like "what if one day there will be a compiler built-in that does Thing X?" (See: boost::typeof, designed around the then non-existent decltype) In C++ that poo poo is actually considered relevant, and horribly, it might actually be if enough people start using your code

This is the (bull)poo poo that keeps C++ developers up at night, and one of the reasons "C++0x" was released in 2011

Nomnom Cookie posted:

edit: actually that was unfair, the c++ committee has balls they just got lazy and #included boost to make the new stdlib

Boost, like the STL in the 90s, is the standardization process, or at least 99% of it, the 1% being recompiling C++ into standardese and link-time optimizations to remove the controversial parts

hackbunny fucked around with this message at 17:24 on Sep 8, 2013

tef
May 30, 2004

-> some l-system crap ->

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

yak shaving dot gif

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

was expecting it to turn into a breaking bad gif

a nest of hornets
Nov 17, 2012

by Ralp

its' time to cook timb

Workaday Wizard
Oct 23, 2009

by Pragmatica
stop saying the words "yak shaving"

it sounds like a gross furry fetish

darthbob88
Oct 13, 2011

YOSPOS

Shinku ABOOKEN posted:

stop saying the words "yak shaving"

it sounds like a gross furry fetish

You wanna come round some time, help me shave my yak? :pervert:

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->
although we call it yak shaving that's just when we're aware that we're solving the problem that looks interesting instead of solving the problem that matters.

and the interesting problem is usually rewriting something from scratch as opposed to using something we don't understand, producing something just as undocumented as the original

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply