« first day (3624 days earlier)      last day (1316 days later) » 
00:00 - 20:0020:00 - 00:00

8:01 PM
i guess
 
so overriding primitive wrappers won't work because the global/window scope wrapper isn't called when creating them
"bla" doesn't call new String("bla")
 
idk what is exactly the issue
changing primitives classes also, is a bad practice
 
none of this is good practice
it's black magic
 
function foo (x) {
  // where x updates the variable that
  // was passed to foo, whatever it was.
  x = 1;
}
let barf = 0;
foo(barf);
console.log(barf); // make it 1
that's effectively the task
you can't change foo(barf), and you can't change function foo (x) {
 
8:06 PM
I remain convinced it's impossible
 
same
even if barf was an object, there's no way to update the variable to 1
pass by reference isn't the delimma
 
impossible
if x is not an object, imposible
 
and if x is an object?
 
then you can alter its properties
 
but that's not the task. you have to reassign x.
 
8:09 PM
you can update a property on it, indirectly updating the variable, but you still cant replace the variable's value
 
so it doesn't matter if x is an object
 
then you have to have x accessible in outter scopes, or reach it somehow, but not with functional programming
 
that wouldn't matter
x isn't barf
x cant tell you what barf is
or that the value of barf is the value of barf, etc
there's no connection
 
impossible
 
:)
 
8:11 PM
ive dealed with this enough to tell you
you could reach it by the global or window variable, but... ugly ugly
 
> A String object is created by using the String constructor in a new expression, supplying a String value as an argument. The resulting object has an internal property whose value is the String value. A String object can be coerced to a String value by calling the String constructor as a function (15.5.1).
the key there is "A String object is created"
i feel like that could be intepreted to mean "construct a string object by calling new String()"
 
function foo (x) {
  // where x updates the variable that
  // was passed to foo, whatever it was.
  eval(`${x.name} = 1`);
}
function barf () {}
foo(barf);
console.log(barf); // make it 1
i cheated
 
alright i concede
i guess its impossible
 
technically that falls within the requirements, but, it goes against the spirit of what we were doing
:p
 
lol you changesd the function deceleration
 
8:17 PM
did i?
 
....yes
function foo (x) {
  // where x updates the variable that
  // was passed to foo, whatever it was.
  eval(`${x.name} = 1`);
}
 
i changed teh function body
i thought that was allowed
 
wat
nah
in that case
function foo (x) {
  // where x updates the variable that
  // was passed to foo, whatever it was.
  window.bar = (x = 1);
}
 
8:34 PM
what's bar
 
now i can access window.bar and tell was assigned to x
 
right, but you didn't get bar from the variable
 
function(x, id) {
shit, i cant do multiline
but i wanted go say that you can provide a string with the variable name too
 
shift+enter
 
mobile..
 
8:46 PM
shift + return
 
hi
nope...
 
dictation + "new line"
 
Lol
yelling new line at a phone
 
xd
i can paste
function(id, scope = window || global) {
scope[id] = 1
}
that is the cleanest approach i think
btw, has anyone achieved video streaming with socket.io?
 
wdym
 
8:56 PM
btw, thanks to the person that told me to use websockets instead of socket.io, it was key to implement https with socket.io
ok, that if someone could make a web app with video streaming with socket.io
 
Wdym by "video streaming"?
 
well, idk
 
i mean
a web app can have both video streaming and websockets
 
if you wanted to do a video chat app, in js, how could you record the video from the app, and pass the data to other users
 
|| mdn WebRTC
 
which technologies, basically, ill investigate the implementarion
it looks like a tedious api
 
|| mdn doTheWorkForMe()
 
An error occurred with the request.
 
i guess js doesn't have that function
@CarlGentleman If you want an abstraction look up webrtc libs
 
xd
yet
ok lets see
this api is a fucking awesome madness
with webrtc we can communicate clients without the server doing the man in the middle? this is how they sell it
meh
nobody is gonna even test my cms
 
9:48 PM
I love how you go back and edit posts in your nonsensical diatribe
 
nonsensical why
 
Hi Guys, just a small question for React
 
o/
 
I have a form on page 1. When this form is submitted, I collect the form values and then need to redirect to page 2 with those values
For this purpose, I use history.state
Basically, I set the state with form values from page 1 and then redirect to page 2
My question is, do I need to validate these values again on page 2?
I have a basic check that if there is no state set on page 2
then redirect page to the page 1
 
10:04 PM
well, you're still client-side at that point, nothing hit the server, so... any validation you do is mostly for the user's benefit
 
Actually there is no server involved, I'm using firebase
 
"server" in that setup would be sending/receiving data from firebase
the validation that matters is on firebase's end
 
How?
Isn't only the validation before I store the data in firebase?
Are you talking about such validation?
 
you must validate user data before it is stored
doing it on the client isn't enough
client-side validation's only purpose is to save the end-user time
you validate it to make sure it matches server rules before you send it so you don't have to waste the user's time telling them they messed up after
but a malicious user can easily bypass that client-side validation
 
okay, understood
Can I define the schema for document?
Like PropTypes in React
 
10:09 PM
i'm not that familiar with firebase's rule system
only used it briefly
 
umm
 
10:57 PM
firestore has "security rules"
 
11:14 PM
hehehehe
 
this guy will tell you all about them
 
@ZahidSaeed No. You would need to enforce in security rules.
As Kevin said you must validate everything in your security rules. I'm going to take this opportunity to shamelessly promote my article as you are just starting out ;) dev.to/jbis9051/why-firestore-encourages-bad-security-7ah. I'd not suggest using firestore.
 
I wonder if anyone is using Deno these days
Did the buzz die off
 
if you can't change the declaration of foo, then inside foo it has no way of knowing what that variable is called outside of foo. This is defined by the language standard. What is being passed to foo is not a variable, if x = 2 then what foo gets is the number 2. Your function declaration says, inside foo we are now going to call this number 2 'x'.
function foo(x) {
  var geval = eval;
  geval('x=2');
}
but actually this is not the same x as in the function declaration, this will work equally well with
function foo(y) {
  var geval = eval;
  geval('x=2');
 
00:00 - 20:0020:00 - 00:00

« first day (3624 days earlier)      last day (1316 days later) »