« first day (2711 days earlier)      last day (2241 days later) » 

10:00 AM
> hash('aa')
"b8368bd0b0d9f8"
> hash('ab')
"f91e1832240498"
> hash('ac')
"54fc08d4488fe8"
but these look completely different
 
sin(a * pi + phase) will always be a thing
@towc why not just bcrypt it
 
^
 
and be done
 
@KamilSolecki because I didn't have time
I'm just wondering how that temp hash could have been broken
 
for what? Bcrypt is just 2 functions
it would take 5 mins to set up
 
10:02 AM
@KamilSolecki look up docs to remember orders of parameters, running npm i
@KamilSolecki I didn't have 5 mins :P
like, literally
 
Well, fix it now :P
 
you are in this chat for 5 mins already
 
yeah yeah
@KarelG I have time now
I didn't back then
 
then you can update it
 
this was like 3 weeks ago
@KarelG I am going to
I'm still curious
 
10:03 AM
then use bcrypt
 
yes damnit
 
of simple hash since you did not bother with having plain text passwords in a text file or that ability to delete em all
 
you don't have time to use a hash library but enough to implement your own one?
you always surprise me
 
@Neoares that fn literally took ~20 seconds to think of and type
maybe 20 more to test it out
 
40 seconds of development. It's probably good
 
10:07 AM
why am I even reading this stuff?
 
the wonders of towc. :)
 
@GNi33 I think the same when I accidentally find a win forms question on SO
 
towc probably has over-engineered it. It just happens with him.
 
In 20 seconds?
 
@OliverSalzburg just hire him
he can encrypt your whole database in a second
 
10:10 AM
Meh, we overdramatizing stuff imo
 
yep
 
@OliverSalzburg meh, haven't gotten problems from it yet
 
If it's worth dramatizing, it's worth overdramatizing
 
but I definitely need to change it
 
@towc You mean in the time since you wrote it 5 minutes ago? :D
 
10:11 AM
eh, one of my team member once encrypted a database table without keeping the second key (he used an asymmetric algorithm). Then 3 or 4 months later, another one discovered that the decrypting key is not a valid one.
 
oh lmao
 
@OliverSalzburg it was from 3 weeks ago
in "production"
 
so it is actually data loss.
 
Sorry, I wasn't reading up all the log
So you wrote your own hashing function in 20 seconds and used that in production... why?
 
panic mode
 
10:12 AM
@OliverSalzburg I needed something done ASAP
 
P-A-N-I-C
his passwords were visible in plain text before
stored in a text file :D
 
@KarelG oh no
 
@towc You mean like searching "how to hash nodejs" and copy&pasting the first SO answer?
 
@OliverSalzburg that's more than 20 seconds. I knew mine would kinda work, so no need to triple-check it
I'm happy with the choice I made :P
I'm just curious how it could have been broken anyway
 
Your choice was retarded and it's even more so now that you're defending it
 
10:14 AM
and why was my choice retarded?
sure, there's a simple rule: don't roll your own crypto
 
okay, I can't do this. see you guys later
 
but there's another important rule: always deliver before the deadline
 
@towc You know why we have that rule?
 
this whole system was meant to be super-temporary until we figured out a better solution
but it just stayed there
 
@towc If you're in a situation where you need to "save time" by not copying 3 lines off code from SO and just roll your own crypto shit, then you've already fucked up. Delivering on time is worth nothing if your product isn't well made
 
10:16 AM
@OliverSalzburg well, I was my boss
people were trying to get in the building and I had serious stuff to do
it was to not take time away from my actual "boss"
 
if ( one_int  >= 0 && two_int >= 0 && three_int >= 0 )
if ( one_int  >= 0 && two_int >= 0)
why three conditions are not working?
two are are working fine.
 
!!> if(true && true && true) { console.log(1) }
 
@towc "undefined" Logged: 1
 
JS has a limit of 2 conditions
 
10:19 AM
They added that to improve performance
 
ha oliver
😂
 
jajajajajjajaa
 
@OliverSalzburg can we evaluate only 2 conditions?
 
@rlemon @ssube Russian elections camera footage lmao
 
10:25 AM
@towc From the little contact I had with it, I would instantly assume the primary flaw of your hashing approach is its speed. Breaking by brute force is probably a very realistic attack. But, yes, I understand that this wasn't used in the most critical of places. Regardless, you should replace it now that you have the time and understand why it is a problem. I see the biggest problem in your mindest, not your solution
 
@OliverSalzburg oh, that I agree with
 
@KamilSolecki vote percent gotcha become 107% ?
 
the speed thing
and I already said the plan was to replace it
before I event put the function here
 
@towc Oh, sorry, I missed that
 
you could have done it already if you were not dissing about it here ...
 
@KarelG I'm practically on holiday at this point
 
@KendallFrey
 
@KamilSolecki KendallFrey is afk: 😴
 
but I don't want to get away from helping out
 
that is a shitty excuse ya know :)
 
10:28 AM
I have no obligation to change the code
and nobody asked me to
 
you are already there
 
I'm no rush
but I want to do it anyway
 
another poor excuse.
well ?
do it anyways ?
 
well, I'm doing it
I'm just saying that the "you could have done it already" doesn't apply
I just for some reason don't want people in here to think that I'd be a bad employee
 
yes... Your first message about that subject was almost a hour ago
50 mins ago, by towc
so, I need to move away from using a temporary fairly insecure hash function
 
10:30 AM
@KarelG but time isn't the reason why your argument doesn't apply
I could have done it, I just was really in no rush and wanted to learn stuff in the meantime
@KamilSolecki damn
 
React question; I have two components, ViewA and ViewB. Depending on the URL, I mount either of them. Inside each view is a menu. Because the switch from ViewA to ViewB happens, the entire tree it torn down causing the menu to re-render. I don't want this to happen, because a click on the menu causes an effect and essentially leaves the menu in place. Is there a way to avoid the full tear down when React encounters components with a different name?
 
@KamilSolecki Noice
 
Not really sure, but it could work if you registered a child as singleton and leverage react dom render() and shouldComponentUpdate(), maybe? @RoelvanUden
 
@KamilSolecki typical of steven hawkin
 
@RoelvanUden put the state of the menu somewhere that doesn't depend on the tree below those 2 components
 
10:42 AM
Or yeah, rerender it and preserve the state like towc said
 
@KamilSolecki Doesn't appear that way. Seems like, as part of optimizations, React tears down the entire sub-tree when a component name is different. Which really does make sense, but it's a tad annoying in this case. I feel like my only choice is to move the menu to a place higher than the views.
 
@Loktar nice students prank
 
Yeah, that's the only way it seems @towc. Move it out of the views.
Nyergh, thanks for the confirmation!
 
o/ Roel
 
@KarelG 40 seconds of prank? Urgh
at some point it's just awkward
 
10:50 AM
Nyerghs!!!!
 
@KarelG the original source is more funny with the sound youtu.be/ch0jEHY3QVU
 
@KarelG nice
 
@KarelG youtube "remi gaillard mario kart"
or pacman
 
i know that person
still, worth to note: those benches in USA universities seems not so comfortable for writing
I always had a table in front of me when attending colleges
 
11:26 AM
Is there any shorter/intelligent way of flooring N??????? to N000000 ? Example :
var a=52345;
console.log(a-a%(Math.pow(10,(a.toString().length-1)))) //50000
^ basically this is like 52345 - 2345
 
that's not flooring
 
flooring alike I meant
 
that is more like... modulo
 
but not to the digit ...
 
!!> 52345 - 52345%10000
 
11:28 AM
@Neoares 2345
 
I don't need 2345
I need the 10000...
 
a - a % 10^b
 
@Neoares 50000
 
yes
tnx
 
@RoyiNamir try 10 power x
 
11:29 AM
@Neoares 10000 needs to be calculated
 
i love how my formula is from right to left :DDD
 
well this is not javascript related, its more html/css related but there's no room for that apparently so i'll just ask away if you dont mind.
I know that if sections span min-height 100vh there's no problem with overflowing at all, but right now I have a section that is supossed to be 50vh in the middle of other two sections that are both 100vh, this causes the content of the smaller section to overflow when in md and below screens and the content of the ones with 100vh to be hidden behind the smaller one. how can I have this in a way that I can actually have a section being 50vh without o
i've searched and find nothing at all about this
 
!!> 10**Math.floor(Math.log10(52345))
 
@towc 10000
 
there you go
 
11:29 AM
** ?
 
@RoyiNamir exponentiation
 
it's the same as Math.pow
 
@RoyiNamir based on what logic do you get 10000?
if you need 10000, then just give it 10000
 
I've learned something new . thank you @towc
 
@Wietlol we needs to calculate it
 
11:30 AM
literals are amazing
 
the biggest 10^x number possible
 
@Neoares 5000+5000 ?
ow, i see
 
/ban Wietlol
kek
 
i didnt recall him saying it had to be the highest number
 
well, we deduced it
 
11:30 AM
i didnt
 
@Wietlol N??????? to N000000
 
> N??????? to N000000
well
 
i dont have machine learning
 
you don't need it, you're supposed to be a human
 
Is this for anything but display to a user?
 
11:31 AM
@RoyiNamir you mean N???... to N000...
 
yes
 
maybe string manipulation would be appropriate
 
@KendallFrey maybe, yes
for big numbers, using a string scales better
 
!!> "52345".replace(/(?!^)\d/g, "0")
 
@RoyiNamir with that logic you can literally regex it
 
11:32 AM
that ^
 
@KendallFrey "50000"
 
there you go XD
 
I also was thinking about regex
 
@KendallFrey wouldnt a substring be more efficient
 
regex replace ?
 
11:33 AM
since you are not trying to find a pattern
 
If you want to replace N??? with N000 just return "N000";
Seems trivial
 
@Wietlol idk
 
@OliverSalzburg but it must be calculated
 
!> Oliver.trollDelta -= 100
 
@Wietlol What? 0?
 
11:33 AM
^
 
Neoares deduced it
 
if he can deduce it...
 
I hate pluralsight
 
There are many values in an array and I needed to calc the "base floor" for each value
 
Get your IQ, Pay for shit!.
 
11:34 AM
I assumed Oliver was trolling
 
123->100
676767 -> 600000
Etc...
 
Its even worse than w3schools tests
 
that's why I reduced its trollDelta parameter
 
@RoyiNamir I have no idea what that's supposed to mean
 
^ example granted
 
11:34 AM
@Wietlol if you're talking about efficiency, then you might as well (x) => x[0].padEnd(x.length, '0')
 
@OliverSalzburg we already solved it
 
@RoyiNamir So replace all but the first digit with 0?
 
@RoyiNamir take the first char with substring
 
go back to windows
 
and its definitely not IQ rather madness
 
11:35 AM
if x is the string representation of the number
 
then append zeroes based on the length -1
 
@RoyiNamir wow
 
@Neoares Yeah, but maybe your solution is retarded. Wouldn't be a first today
 
oliver's having a bad day
I vote we all hug him until he's so annoyed he quits
 
I'm having a regular day
 
11:35 AM
:-)
 
@OliverSalzburg oh no, it works
 
He hates everyone equally
 
map(number => 10 ** number.toString().split(".")[0].length)
there you go
 
@Neoares Did you test it for 20 seconds?
 
but kendall's one just scales better
@OliverSalzburg lol xD
no test, just went all in
 
11:36 AM
mine scales even better
you could even add a caching feature
making it C++ like
 
towc wasted more time fllooring an integer than hashing passwords
 
Or even better let base = 0; while (number > 10) { number = number >> 1; base++ } number * (10 ** base);
 
I'll implement it in a quantum computer
 
@RoyiNamir wdyt ?
and yes both are equally as expensive.
 
Very nice.
I was just wanted to know about other methods
Also Log was a good choice
 
11:39 AM
there are multiple approaches for your problem
 
Hello. Anyone have more experience with mongoose ? :) I have something like return this.store.findOne({jwtid: this.id}, function(err,session) { on session have _doc that has what I need but I assume by _ i shouldn't access it directely. Is session.get("key") the proper way to do it ? It seems it returns what I need
 
but for god sake, do not forget readability. Or add a comment above it.
there are developers whom sucks in maths
 
TIL new MutationObserver
 
huh, we just bought a cctv security system that uses mongodb
 
others suck at readability
 
11:40 AM
uhm
 
^very helpful for detecting nodes changes
 
@RoyiNamir its a overkill api but yes
handle it with caution, if you add way too many of them you'll suffer
 
V.7
Hey all
Don't know where to ask, but does Chrome doesn't redownload files same second they were already downloaded ?
Without telling them by force clear cache
 
If you download the file again, it will download it again
3
 
V.7
wat )
Ok, understood, I'll try to rephrase
Site changes image each 0.5s, but when I'm refreshing page an images changes each second, so I see the same one picture, but it already has been changed
 
11:45 AM
MutationObserver was a nightmare when I tried to make a plugin for this chat using it
 
@Ikari It's beautiful, and is used extensively in the SO chat chrome plugin
 
@V.7 Add a timestamp to the image url
 
yeah, it's a powerful thing indeed
 
For example '/img/my_image.jpg?timestamp=1231283723'
 
but I sucked at using it :B
 
11:46 AM
The browser will treat it as a new URL, and redownload the file
 
V.7
@Cereal good idea, but... this is strange that chrome shows that he downloads it ( in waterfall ), but it doesn't
 
@KendallFrey esolangs.org/wiki///
 
@V.7 Caches are mysterious things that cannot be trusted
 
@towc yup, mine's better :)
 
V.7
Oh dear
 
11:47 AM
surprised that the link works
that's some good router
 
V.7
So you think that get request chrome would eat like new url ?
 
user9107868
Yes. My new AI can tell the difference between "A" and "B". \o/ \o/
 
V.7
@towc it could just check if there's anything between slashes and if there's nothing then just adds it to the request.
@TheOneWhoMade so, what's the difference ?
 
user9107868
@V.7 before he just generated random stuff.
 
V.7
I mean ... what's the difference between "A" and "B" ?
 
11:53 AM
In npm, you can define a proxy in package.json, that all outgoing http requests go to.

Does anyone know how I can increase the timeout on this proxy? It times out on npm's side after 30 seconds
 
@V.7 what
!!> "A" - "B"
 
@Neoares "NaN"
 
user9107868
@V.7 the difference is a unicode value.
 
user9107868
@CapricaSix you have a failure in your system. That should return -1
 
user9107868
Or at least a shortcoming in your system.
 
11:56 AM
!!> "A".charCodeAt() - "B".charCodeAt()
 
@Neoares -1
 
user9107868
@Neoares good job.
 
V.7
@TheOneWhoMade ...
 
user9107868
But the issue was that it used sigmoid flatteneing. So it compressed the highest value to 1, and the lowest to 0.
 
In today's cringe
 
11:57 AM
what
 
What
 
V.7
I mean ... does your AI just represented as "if" statement ?
 
user9107868
@V.7 no the AI can learn more things
 
I hate it when my localhost starts up a microbrewery
 
11:58 AM
yea, happens all the time
 
I get triggered so hard by those "articles"
 
V.7
So what's your AI would tell if you tell him "A" or "А" ?
 
user9107868
@V.7 whatever I trained him to return if he recieved "A"
 
V.7
@TheOneWhoMade these "A" are different
 
user9107868
@V.7 I fail to see the difference. He would see it though.
 
11:59 AM
Did you just assume your AIs gender?
 
V.7
He wouldn't, because you didn't train him
 

« first day (2711 days earlier)      last day (2241 days later) »