@piRSquared I've probably done the same too...but I make it a point to not do this now unless I know the person I'm responding to actually understands what to do in the production case.
@Kevin Toolmakers are generally indemnified against the use of those tools from what I know, with firearms manufacturers given special protections. (Like "safe harbour" protections for online sites that index/aggregate or host user content.) E.g. you can only sue a hammer maker if the hammer is faulty, causing injury, not if you go around town smacking people in the head with it. (There is no reasonable precaution they could have taken to prevent that misuse.) AFIK.
Se so. However there are good chunks of leagalese to waive liability, esp. in software cases which tend to also waive merchantability or fitness for a particular purpose. ;P If a hammer came with a clause like that, I'd be worried!
Now I'm quite curious if those fitness clauses have ever been tested in court.
@AlexanderReynolds Heh, I userstyle (via Cascadea under Safari) and override all pre, tt, code, etc. to use Hasklig. Also to redefine tabs as 4-character universally. Long ago I gave up on any hope of web developers doing those elements justice. XP
^ + dark mode wherever I possibly can. Wake up three monitors first thing in the morning and boy howdy are the photons too loud if I have any un-customized sites up.
My main fixed-width font is Monofur (patched for Powerline symbols). I just wish I could get a copy patched for ligatures, or I'd still be using it. (It's the Comic Sans of fixed-width fonts; especially useful for dyslexics.) T_T
ligs are less useful in Python IMO, so I actually get annoyed with some of these...if I was actually writing in a language where there's tons of symbols I can see it being helpful. I think it looks nice I'm just not used to it. and some things in particular really annoy me. (triple equals turning into ≡ drives me up a f*cking wall)
Heh, I like the triple equals symbol. T_T Of course, in my Python code, the #1 use is for return value annotations. (#2 being comparison operators.) ;^P
I dislike the triple equals because ≡ means "is congruent" or "in the same equality class" or something along the lines of "is equal in value but maybe not exactly equal" in mathematics while in JS === does not at all mean that
> (And seriously, if your editor can't display tabs with your preference of spaces then your editor sucks. I don't care how l33t it makes you. Tabs FTW)
the cat's out of the bag; it's the emacs mafia again!
There's another efficiency aspect to code I enjoyed examining. Keyboard layout. Use a heat map tool, dump all of your open source code into it, see what comes out. Turns out Colemak was very nearly perfectly optimum for my code. I has weird typing biases.
@ParitoshSingh Layer 2, toggle on bottom right-most key switches to QWERTY explicitly for gaming. Also rotates the modifier keys, since Control is crouch in most of my games, making crouch-jumping easier (thumb roll-off).
== 1350687001332003958728623852374735172807518011483204347521 — if I haven't declared my love for Python's transparent bignum support today, I frickin' love transparent bignum support.
It will not end. You should write something in the will, should you wish any living entities to benefit in the far, far, far future, if our predictions for the heat death are incorrect
@HunterGuimont Salts are stored alongside the hashes. This is a) intentional, and b) perfectly OK as long as every record uses a unique salt; that's the purpose of it (so two users with the same password != same hash), not to provide a "secret key".
@HunterGuimont On Python 2 range() attempts to construct a list of the requested elements. On Python 3, it's smart and uses a generator. On Python 2, to get the generator benefit, use xrange() instead.
@ParitoshSingh For the last 5 years or so, the ##python-friendly topic has stated: Python 2 or 3? You've had 10 years… go with 3 unless you have special requirements. (or equivalent) Originally read as "unless you have special needs", but I quickly realized my mistake. :P
@HunterGuimont 61**16 is 36751693856637464631913392961. If the code inside the for loop took a single nano second to run, then this code takes 3.6751693856637465e+19 seconds to run. That's 1165388567244 years.
Please stop thinking out loud. If there is specific help you need, we can help, but are only willing to do so if you're ready to listen and learn. We won't waste our time. Please read the linked guide to know what behaviour you should avoid going forward.
def some_count():
for x in range(1000):
pass
%timeit some_count()
31.3 µs ± 55.9 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
# Some calcs
milliseconds = 31.3 / 1000
seconds = milliseconds / 1000
total_seconds = seconds * (61 ** 32)
years = ((((total_seconds / 60) / 60) / 24) / 365.25)
That shows you how you could test this yourself.
Actually, poop, I was out by a factor of 1000 because I did more than a single loop to try stabilise it. That's gonna have a big impact on the 1.3396615440239983e+45 years to run the calculations
@HunterGuimont No! It should be as random as your system can give you. If you insist on doing this stuff yourself, please read the Wiki links I gave you earlier so that you understand all the principles involved. Otherwise, you will mess it up, and create a system that's more complicated than it needs to be, but less secure than what you think it is.
:) I tried assignment and obviously got None. This was the only time I've wanted units for something other than to just see a result so I didn't check the docs. Thanks for that mate
Incidentally I had to calculate a few days ago that the time it takes for all the molecules to spontaneously end up in one half of a 2x(10 nm)^3 container is around a day (rough estimation). For a container double the size (with the same atmospheric density) that's 1e12 years. For a container of (1 mm)^3 it's ballpark something like 10^(10^17) years
@roganjosh If protons decay, 10**41 years is about the longest possible proton mean lifetime. And if that's the case, the Black Hole Era starts in around 3*10**43 years. See en.m.wikipedia.org/wiki/Timeline_of_the_far_future
@PM2Ring huh, so it might be complete before the heat death? Is there some theoretical point then that you might be able to throw something into a black hole to keep it together? (like, a totally abstract thought experiment, but a computer might exist as is does now on my desk but only in a black hole)
@AndrasDeak Ha. That kind of thing has been a topic in the h Bar recently. One of the younger members is having problems getting his head around just how unlikely these kinds of apparent entropy violations are.
I was surprised that moving from 50 atoms to 100 atoms in my nanoscale example the time jumped from 10 hours to 10^12 years. The exponential function is a formidable beast.
Let's expand the coin tossing experiment to 320 coins. 2^10 is a little over 10^3, so 2^320 is around 10^96. The universe is just under 14 billion years old, and there's about 31 million seconds in a year. There's around 10^80 protons in the observable universe, so let's pretend we can flip each proton like a coin, 320 times per second. We'd expect a single run of 320 heads by now.
@roganjosh I'm not sure how you can use a BH as a computer, or even as a data storage device. Allegedly, it doesn't actually lose any quantum information, but it doesn't make it easy to actually read it back / decode it. Retrieving the data from the smoke, ash, and energy spectrum of a burnt book is much simpler, by comparison.
@PM2Ring Sorry, I phrased by question as a non-physicist. I was thinking more about how the heat death is an ever increasing dispersion of elements. Such that one day, the black hole might "crush" an object to the same level of gravity that I experience now on Earth. But I'm mixing two concepts. I don't think the question could make sense, because entropy and gravity are, in this sense (I think) correlated, but on different paths
I'm mixing the concepts of the bonds that hold the material of my computer together and gravity. They are different forces. It was a silly question I think, now I reason about it more.
There's a Physics SE question that asks how big a hydrogen atom would be if it were held together by gravity instead of EM. IIRC, it's roughly the size of the observable universe.
that reminds me of some theory i think it would be called, that what we see and measure as gravity is only the consequence of the real gravity force being filtered down by something we dont yet understand
just because its so out of proportion compared to other forces
Good job I only have that for loop to worry about when all this is happening :P I'll stick with engineering and my production schedules for the next year
One testable prediction of the various supersymetry theories is that protons have a finite half-life, and different "flavours" of these theories predict different values for that half-life. All of those values are far greater than the current age of the universe, but if you observe a large enough sample of hydrogen atoms you should see a few decays over the span of a few years. Experiments have virtually ruled out all but the longest half-life predictions.
@HunterGuimont that's fine. There's one guy I know why likes crypto here but AFAIK nobody is an expert and you're asking fundamental questions that you need to be researching yourself
@HunterGuimont for what you're asking, I don't think I'm alone in saying our experience is collectively saying "don't do this". The people inventing these algorithms are seriously few and far between and even they get pushed to the kerb once they get broken
for someone lazy there's a high chance that it goes "I'm curious" -> "I want to learn" -> "I want to do it myself using stdlib" -> "I just hacked this together" -> "[6 months later] Oh hey I did this for fun 6 months ago, let me grab these few lines"
@ThiefMaster With this what would be the course of action? I see Deprecate werkzeug.contrib.cache. I can reliably reproduce the error on my production server with AJAX requests every 2 secs to a route needing a login. I can try make an MCVE but is it even worth it if you're deprecating? This is a real and server-crashing error with an easy fix.
To my knowledge, flask-session is still the most current 3rd party app, and so this error will persist
Sorry, I should say that I fixed it in werkzeug, not flask-session, which is what is confusing me on how to go forward
@HunterGuimont I get that. But don't expect to learn this stuff overnight. Crypto is a big field. Even if you just focus on the current best practice for password hashing there's a fair bit to learn & understand. You don't need to fully understand the maths underlying all the algorithms, but you do need to understand the principles involved.
Those Wiki articles I linked aren't small, and they aren't particularly easy to read, but they are a lot easier than reading the original computer science papers. At the least, you need to understand the articles on cryptographic hash functions & salts, HMAC, key derivation and stretching, as well as some specific key derivation schemes like PBKDF2, bcrypt & scrypt.