« first day (3856 days earlier)      last day (1075 days later) » 

6:56 AM
Hey, anyone there? How do I set the selected attribute of an option of the select tag using Javascript?
 
 
3 hours later…
9:42 AM
hmm with jest, if I test long strings, can I see the first non mathcing character?
 
 
1 hour later…
11:03 AM
JBis, I showed you a wide range of options that would allow creating random IDs.
If you never want duplicates, use a check loop.

if none of those work for you, then I dont think youll be able to do what you want to do inside of javascript
||> 2**53-1
:3
 
Yea, the only way to really prevent duplicates is to check for dupes.
 
Yup
Javascript doesnt have hardware randomness support AFAIK (and not all devices have a radiation random number generator or some fancy crap)
and with 10 digits
that isnt a lot to work with
 
11:19 AM
Does it even matter with 10 digits?
 
Well, no, but actually yes.
Since with lower digits, the chance of duplicates gets exponentially more common
with higher digits, it obviously gets exponentially less common
 
Yea, but Math.Random shouldn't easily spit out dupes
 
if it were me, I would go for 32 digit IDs
@Cerbrus Well, theyre just numbers, the chance of duplicates is low, but it can still happen
The best choice is to place numbers 1 by 1 (This makes the chance of duplicates even lower)
 
And if you're already working on the restriction of 10 digits, why make it more complicated by using something other than Math.random?
 
he said he didnt wanna use math.random
but for any advanced PRNG
you need a seed
So date.now is a good choice
since the seed is never the same
 
11:22 AM
But trivial to reproduce
 
yup
Never use PRNGs for encryption / keys / seeds for code encryption
but for simple IDs or something
thats perfectly fine
 
@MisterSirCode wait are you using true random generators for this?
you must have enormous resources at your fingertips
 
11:37 AM
@paul23 Um... Its bitwise and date.now :|
 
recently, a team of researched found a way that allows a computer chip to generate an almost true random number \o/
it uses a laser and variance in its wave collisions
best article I could find. I have read it from a scientific ...idk-the-correct-word...
 
If you want true randomness
just use quantum entanglement
or have a macroscopic chunk of uranium
and measure alpha particle runoff
 
gotcha put some uranium cores at a regular home pc
but ... I doubt it's that random
 
11:56 AM
@KarelG Its random
I mean, quantum entanglement is TRUE randomness
its like... literally the definition of chaos
entropy
etc
but uranium alpha particles should be similar, if not the same "amount" or "quality" of randomness
 
@KarelG random.org uses the entropy on the electric grid, the high frequencies as random number source
@MisterSirCode I like how you had the correct conclusion but use absolutely the wrong words
 
@paul23 Im not a nuclear physicist. Im a 16 year old kid
 
Fun thing is: for (say) an MMO, if it popular enough you might not even have to use a random number generator at all: just a rotating number that ticks up with each "action" used by a player would be random enough probably.
 
@paul23 I opened that site, clicked generate random number... and got 11 twice in a row on the first try
:3
 
well, that is possible?
it's like someone throwing 20's three times in a row in D&D
 
12:03 PM
exactly 1 in 100 times you do that you'll get twice the same number in a row
not exactly spectacular
Actually humans are -when asked to make a random number- are often disregarding streaks too much
 
I don't understand why people is looking at the probability of the returned result
it happens a lot
(eg in discussions on social network or in forums about a game feature)
 
@paul23 Humans are like Math.random()... Theyll more often then not, call out random numbers under ten, over 90, and around 50
because humans are dumb
 
@paul23 got an advertisement for shaving your legs
😂
 
well numberphile videos are always right
so I guess you should
 
12:07 PM
havent watched numberphile in a year or two
 
Well he won 120.03 dollars from just guess heads or tails streak
 
Good 4 him
 
12:25 PM
The proper way to do it would be probably to use encryption
you go sequentially, 0,1,2,3 run it through a custom block cipher that produces the proper number of bits and you're good
 
12:39 PM
Wtf is going on. With no windows open my Edge was using 1200 MB and VSCode is using 400 wtf
 
@BeerusDev checks IntellijIDEA memory use: 1,981.## MB
at some moments, it jumps to 4GB (eg local container deploy)
had to beg the IT dept to get much RAM as possible on my new laptop for that ...
I have other stuffs open (google lens for docker / ssh sessions for monitoring / browsers / two communication apps / some electron apps ) ... no wonder my laptop is often pretty warmed up at the end of the day
 
RAM is like one of those "Special occasion" treats..

You wish you could have more but only when the time is right
As a 3D artist... I can say that if I was alone with a stranger holding a 64gb set of RAM, Id punch em and "barrow" it
 
Ive got 32 GB
With 4 apps open Im at 31%
 
I'm jealous
 
Ive got 16gb
its... not great
 
12:52 PM
got 16. By default (really ...) they order laptops with 8 GB
 
see, Ive got an RTX 2070 Super, and I render TONS of stuff... so its a little difficult to survive with just 16gb
 
8 GB is rarely enough for developers. our core product is a CAD tool. so wth they are thinking? That people from support dept gets that, ok, but we ?
 
I would kill to have one of those amazing workstations with 128gb of RAM and massive GPUs
 
@MisterSirCode wouldn't we all
 
@MisterSirCode that is not possible
 
12:54 PM
@KarelG Yes it is...
 
if you're rendering by your implementation, then you are doing it wrong
 
What???
 
you're using the ram as working memory, not the gpu
 
Im using blender
@KarelG Its not the VRAM..
Im talking about massive pointclouds
volumes
massive highly detailed meshes
things that take gigabytes of memory to load and render
I have 8gb of VRAM and that suffices... but I def need more RAM
Cant tell you how many times Ive crashed blender because of too many subdivisions
 
 
2 hours later…
3:14 PM
hmmm. I'm thinking of embedding es2015 modules short scripts inside a html document. has anyone done that? I can't really think of a major problem but am wondering if I'm missing something. basically something like :
<script type="module">
    import {mod_action} from '/js/es2015_mod.js';
    document.getElementById('very_id').addEventListener('change', mod_action);
</script>
I find it nice because it has extremely low footprint in large existing codebase
and allows me to be in es2015 module context super easily while changing functionality
it also has a nice side-effect that it makes templating slightly simpler since it removes the need to indicate from the start what JS code needs to be invoked.
 
 
1 hour later…
4:35 PM
So this just happend like 1 km away from my house (yes dutch site): nu.nl/287067/video/… Saw the crashed car but "what"
Who goes drunk driving in such a car, at broad daylight
 
@paul23 I can't read, it says they're drunk as well?!
I don't understand what happened, they forgot the motor is supremely powerful and lost control?
ah yes, google translate finally got there
 
5:04 PM
yeah it basically says "driver arrested for being intoxinated"
and that the numberplate was green, which means it's from the embassies I think
 
5:31 PM
Hey
I fixed the dang item is not defined in my fetch, but the object doesn't post to my matrix. It gives me no errors and the tooltip doesn't pop up
 
lol
 
I Can't win for losing
 
 
2 hours later…
7:37 PM
Quick question - what's this notation called? See it everywhere in WP plugin dbs a:1{s:7:"contact"};
like JSON but with declaring data types and lengths
 
7:52 PM
@NickS. afaik it's serialized php and not json
*serialized data using serialize in php
 
Thank you thank you thank you
 
8:11 PM
Hey
Is it recommended to use == as opposed to ===
 
== is universally frowned upon in javascript
 
Really?
 
yes
 
Why is that
 
it produces side effects that are only useful for "clever" code
side effects that could cause otherwise working code to not be so working
 
8:15 PM
Why does == convert types and === doesnt?
 
that's like asking why + adds and - subtracts
 
let example = 1;
let example2 = '1';

example == example2 is true?
example === example2 is false?
Not really, they aren't identical signs?
 
wdym
they have two different purposes
 
+ and -
 
== and === as well
 
8:17 PM
I know that I was just curious because I really didn't realize the difference
 
== is loose equal
=== is strict equal
 
so unless I need type coercion, always use ===
 
yup
 
👍
 
8:19 PM
That looks like a mess
 
8:43 PM
can you please recommend me something for better organization for my existed code? what should I improve and so on...? github.com/zaxoavoki/internship-js-notepad/tree/main/public
 
9:33 PM
@phenomnomnominal Hey. Spotify web player nor mac desktop app seem to work through socks5 proxy. Any idea why?
 
 

« first day (3856 days earlier)      last day (1075 days later) »