« first day (3456 days earlier)      last day (1475 days later) » 

12:29 AM
KevinB What phone do you have now?
 
a wild sterling appears
 
 
3 hours later…
4:00 AM
iphone XS
 
I want a flip phone
 
 
5 hours later…
9:20 AM
hi guys. Anyone use primeng?
 
@poopp Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
 
1 hour later…
10:36 AM
oops
what is stateless and statefull in javascript? what is stateless and statefull in react.js?
"he key difference between stateful and stateless applications is that stateless applications don’t “store” data whereas stateful applications require backing storage." Can I consider this a general meaning ?
 
10:56 AM
How do you feel about Ionic as a platform for developing mobile apps?
 
 
1 hour later…
12:01 PM
morn yall o/
 
12:20 PM
@JBis \o
 
12:32 PM
what is stateless and statefull in javascript? what is stateless and statefull in react.js?
"he key difference between stateful and stateless applications is that stateless applications don’t “store” data whereas stateful applications require backing storage." Can I consider this a general meaning ?
 
yes
 
Statefull and stateless have different meanings in different contexts
that definition is fine for react but is means something very different for networking
 
consider this: create two instances of class A a1 and a2.
--> A is stateless if all local variables in a1 and a2 are all equal all the time
--> A is stateful if there is at least one moment where the local variables in a1 is different than in a2
 
e.g. HTTP is not a stateful protocol (why we need cookies and other mechanism), while FTP is
 
local variable = data it holds
 
12:38 PM
@KarelG even for that matter... can we call the let variable is stateful and var is stateless
in a mirco level
 
._.
let and var are keywords
they cannot represent a state :)
a variable however
 
yes...
i mean the variable it posses
good... i got the point ... so on a class level
 
class Light {
    constructor(isOn){
       this.isOn = isOn;
    }
    flip(position){
       this.isOn = position;
   }
}
const light = new Light(true);
the current state of light is on
 
@JBis Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
^ is that light stateful or stateless?
(btw, a flip can go in one way. Never saw an opportunity to flip to the same direction :D)
 
12:44 PM
flip(){
       this.isOn = !this.isOn;
}
:)
 
@CommonMan ^
 
@KarelG and @JBis
class Light {
    constructor(isOn){
       this.isOn = isOn;
    }
flip(){
       this.isOn = !this.isOn;
  }

}

const light = new Light(true);
so the flip() is stateless
am I correct
 
> is that light stateful or stateless?
 
light is stateful because the value is changing
 
good
 
12:56 PM
@KarelG - is what the sense it means in react js
 
yes
 
however would there be any class without having member variables without changing dynamic values
 
o/
 
1:13 PM
@CommonMan a class cannot be dynamic if there are no member variables
 
Any bot people in here?
My SO Chat bot can't create a web socket connection anymore.
 
hello
 
Don't know if it's just me
 
|| echo My websocket connection is fine and dandy
 
My websocket connection is fine and dandy
 
1:19 PM
Dang it.
 
looks like its working, are you getting a particular error?
 
When it sends a POST request to /ws-auth in order to get the web socket URL, the request returns a 404.
 
> Note: A content-type header with a value of application/x-www-form-urlencoded MUST be sent or the POST data will not work and you will get a 404 error.
 
Hello good day, I whenever I paste my connection string to MongoDb compass to is comes with the following error:

Server selection timed out after 30000 ms

What can I do
 
are you sending that header?
 
1:22 PM
make sure your connection string is correct and that your mongodb is running
 
I would assume so. In the API I'm using, I specify the request body to be a "URL encoded form entity".
My bot was working just fine yesterday. I made one small change and now it can't connect.
 
check the network tab
 
Let me try setting the header anyway.
 
often times something breaks and i fix it and then wonder how it ever worked before
 
That didn't seem to work.
 
1:26 PM
and you have a good fkey and room id?
 
!!magic
 
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
and login cookies?
 
domain/port
 
maybe post your code?
 
1:28 PM
@JBis Yep.
@JBis Mmm hmm.
 
is it js or what?
 
Java.
 
hmm, can you post code? Also what did you change?
 
☕️
 
1:33 PM
Here is the utility class that sends the POST request: github.com/JavaChat/OakBot/blob/master/src/main/java/oakbot/…
As to what I changed: I updated a dependency (a library that parses JSON) and made a small tweak to one of the bot's commands.
 
is that really how you gotta handle key/values in java? oof
where are the cookies added?
Is that handled by the lib or do you need to do that?
 
@Michael there is a logger; what did it display?
 
@JBis No. I used a vararg parameter because it made my code less verbose in this context.
 
Tay
Hey could someone help me understand this? Someone gave me this benchmark, and after calculating, for me, its showing forEach as the fastest method, even to .map()

Im always told map is the best and faster way to run a function for all the array values? https://jsben.ch/m3Gqf
 
@JBis They're handled by the HTTP library.
 
Tay
1:38 PM
 
@Tay js engine does some optimization after interpreting the statements as well
 
Tay
Yeah, but is .map or forEach better? for some reason, I still dont understand map, I should really research it, anyways, map seems more not-user-friendly, and forEach isnt deprecated or bad practice.

Bias, What do you prefer, for me, just out of usage and experience, forEach is my goto
 
use the one that is best for the intended purpose
 
Tay
Well, hmm, how about, can you show me a sample of where .map and .forEach have different usages?
like where one would work better than the other?
 
...
!!mdn map
 
You know map does more than just iterate, right?
 
^
 
Tay
No, I didnt
 
I would consider code using map without making use of the return value an error
 
Tay
Hmm, map seems to have like... the exact same function callback syntax as forEach
 
1:42 PM
the function may be same but what's done with it not
in essence, forEach expects a consumer function (returning nothing) while a map expects a function that gives something
 
Tay
forEach() — executes a provided function once for each array element.
map() — creates a new array with the results of calling a provided function on every element in the calling array.
I found an article on it, lemme read up real fast
 
@Michael hmm, I'm not really sure then. Maybe try setting up burpsuite or wireshark and intercept the request.
 
burpsuite
heh
 
Tay
Oh, I see the difference
 
does that exist?
 
it's a different tool than wireshark
 
yep, works great for intercepting https requests
 
Tay
.map automatically takes the value of the current index and calls the function with it,

While the forEach is literally like a for loop, it takes the index and current value of that index, without defining the index, its just calling a static function over and over
atleast thats what I think?
 
but if you can check request packages with it, then :P
 
Eh.
 
1:45 PM
Wireshark is more of a network analyzer burp is more specifically for proxying
 
they both just call a static function over and over, the key difference is anything you return from map will go into the resulting array
foreach doesn't do anything with the return
 
Tay
Wireshark : "Tool for finding what your sister is googling"
 
.map is for creating an array
 
Tay
ah, ok that makes more sense
 
@Michael i don't know the lib so i could be completely wrong but i don't think the cookies are being sent
 
Tay
1:46 PM
That reminds me of a php method that basically creates a new array instead of changing the values
Ok, now I understand, Thanks.
 
javascript has methods like that, but this isn't really one of them
:p
 
@JBis It's sending the Content-Type header. Only sending one cookie called "prov".
 
ah theres your issue
you should be getting much more cookies. they are listed here github.com/jbis9051/JamesSOBot/blob/master/docs/…
 
Why the heck would it start doing this now? Wierd.
 
🍼
 
Tay
1:51 PM
Lol for CORS issues, I just always send my data with the Forms header (what the html forms use) and it lets me GET and POST anything I want with pretty wide freedoms
 
26 mins ago, by JBis
often times something breaks and i fix it and then wonder how it ever worked before
 
Eh. I guess.
 
Tay
JBis, you're sparking nostalgia. Giving me PTSD of when I first started using canvas about a year ago
 
better for it to do it now than later
 
Tay
What concept is the most efficient way to load lots of data from a big array into a canvas, while also allowing live changes to the variables as you draw.

Basically I want to setup a "Undo" and "redo" system (expansion for my drawing tool project)
Like, I thought: Only update the canvas if data changes in the array
 
1:58 PM
two arrays, deep compare
very memory inefficient
 

« first day (3456 days earlier)      last day (1475 days later) »