« first day (2861 days earlier)      last day (2312 days later) » 

11:00
I already really don't trust the guy
I'm tempted to reply to the email and condemning his trumpisms
11:14
Or you know, he could just love his city and his passion for his students. And not be a dick about it and send a reply.
anyone greeting students with an objective statement about something very subjective without giving much of a reason, maybe shouldn't be at the head of an academic institution. I'm sure he has plenty of other merits, but this is already making me very skeptical
Hi all, in TypeScript can I set type of an item to an array of object like this: item: [{}] ?
11:30
It would look like { ... }[] or Array<{ ... }>
Kind of petty, towc. I don't think he crossed a line expressing his love for the city. I'm sure if you followed up on it, he'd give you reasons
^ I don't understand how his statements struck a cord
He's hardly doing a trump saying 'our city is objectively better'
the way most people would read into it is that he's missed London and that noone can tip it for him
He didn't even say objectively
@KendallFrey both those throw error
Huh? Those are types. Types don't exist at runtime, therefore they can't throw.
Can you show your code?
11:34
bit more context, i want to set the type for the param of a function
interface IDemo {
        Events: {
            GetData: (callBack: (data: {...}[]) => void) => void
        },
    }
... is a placeholder, you have to put the properties there
[ts] Property or signature expected.
[ts] Rest parameter '(Missing)' implicitly has an 'any[]' type.
@towc So, he's proud of London, and wishes his students take full advantage of how awesome London is... How can you possibly not be offended by that? :P
@KendallFrey i want the object to be empty, ie, no properties
you mean just object?
11:37
yup
@towc lives in london? :0 How is it over there?
> This city is one of the greatest cities - perhaps THE greatest city. I hope you benefit form that
to me, this is very suspicious
Hows the tube?
11:38
I don't live in london yet
and the more time passes, the less I seem to want to
@KendallFrey would it then be just {}[] ?
object[]
I think I found some malware on a website in the form of JS with a large string and an eval code, I'm not sure if its the website or a extension thats serving it but it dissapeared when I refreshed, in any case I still have a copy of it, is there a chance that the code itself contains personal information, I would like to post it and know what its doing
there is a chance
@towc That's not what he's saying
11:40
@Cerbrus what do you think he's saying?
@KendallFrey thanks! :D
If the source is from a extension, it could have personal info right?
He's saying he thinks London has become much more awesome while he was gone, and wants his students to enjoy the awesomeoness
if he had said "london is one of the most developed cities - perhaps THE most developed city. I hope you benefit from that", that would have been totally ok
London first
11:42
So, you're basically taking his words literally instead of just getting the message of what he's saying
"Welcome to this awesome city, enjoy it!"
*Triggered*
"Welcome to the this awesome city - perhaps THE most awesome city. Enjoy it!"
this is much better, but still URGH
Meh
It takes a special kind of person to read negativity into someone being proud of something.
I'm only going to london because of education. The fact that the university happened to be in london was a huge negative for me
so you were biased to begin with
@Cerbrus tbf most kinds of proudness trigger me
11:44
you had some bad exp in London or something?
seems to be a bit of a leap
@SurajRao it's a big city full of business people, and I really dislike that
@towc well that's your problem...
the more developed a city is in that way, the more I dislike it
@towc U a smol town boy?
oh right i forgot you prefer to live in the woods
11:46
So if the guy said: "This city is hyuge! Get out while you still can", you'd have fallen in love with the guy?
I'd have been more on board
Hah
Good luck finding a uni in a rural area
actually, there was a decent one I had the chance to get into, which was in a rural-ish area
Where?
I kind of regret not going for that
buckingham
their uni is still young and I'm skeptical of their education, but it could have worked out
11:48
Hm, it seems tiny
yis :3
That's not a positive thing.
(From an educational point of view)
but it makes me feel much more comfortable
and again, I'm skeptical of their education
wear a hoodie and don't talk to people
@RaisingAgent A black one
11:52
Hello guys hope all good every where
@Mahe 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.
And don't wash it, for extra social-- stats
@CapricaSix cheers
@Cerbrus Imagine a gta san andreas + respect kind of message " - social " after every day the hoodie is worn
i have this : ^[a-zA-Z0-9]+(?:[,\/-\s](?:\s)*[a-zA-Z0-9]+)*$ -how do i allow empty space after only a , and not after / or -
Hello, any tip to handles Content Security Policy for a chrome extension ? "Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' youtube.com";. Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution"
I read this article on google docs : developer.chrome.com/extensions/contentSecurityPolicy
I do some web scraping on youtube page with jquery $.ajax , All I want is the html code, nothing else
@tomw Sometimes I feel like you have a hornets nest in your pants
you seem to want to have a prickly bum
12:13
0
Q: Total for columns in a table using ReactJS

CodeLoverMy issue is when I enter the values of Quantity and Price to calculate the total, it will be calculated, but when I add another line, the total value is calculated from the last entered values of Quantity and Price as shown in the figure below : My code is below : class AjouterFacture...

I need A HELP please
@towc So you decided to chase a girl you have no chance with
not sure what you're trying to point out
You make bad life choices
oh, sure (for most people's definition of bad)
@towc What are you studying?
12:22
CS
I think I'll try to switch it to maths fairly soon
first I need to see if I can survive in london, mentally
and then survive academia stress/humans again
and if I haven't ran away by then and CS is being as boring/uninteresting as predicted, I'll switch
Hahaha sounds like a plan
Is this your Bachelor's? (I can't keep track of your life :P)
I think "Course accreditations: BCS" means bachelors
12:44
i mean
if you hate people, trumpisms and all that
why go for London ?
Probably one of the busiests, biggest cities you can go to college to
@towc
@jy95 I would use a bookmark let or execute it from console. Meaning to learn about extensions though
among the ones which accepted me, it was the most established one
also, I think it was the closest one to airports that went to places I wanted to go to
Not JS related but I'm sure most of you have used `Parallels Desktop` on a Mac.

It doesn't seem like the window instance knows anything about your Git config so I'm assuming I'll need to set up GIT for the parallels windows instance?
/me googles parallels desktop
So a virtual machine? Will be like running on a fresh installation of windows... doubtful it links any directories/data from your host machine. So yeah, most likely will have to setup git again
Got it. thanks
12:55
Ahh, I really hope we have bananas...
@rolu Nope. I don't do Mac.
13:10
Rolu sorry but I haven't run parallels for years.
how can I get the stack exchange chat WebSocket as an JS object?
const websocket = new Websocket(url);
er, WebSocket
@rlemon Tried that but it appears that the socket requires certain headers
nope, just requires an fkey
Sec-WebSocket-Key?
13:21
fetch('/ws-auth', {
  credentials: 'same-origin',
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
  body: `fkey=${fkey().fkey}&roomid=17`
}).then(res => res.json()).then({url} => new WebSocket(url));
you first post to ws-auth to get the url you need with the token you need
then you connect to the websockets
that's how the chat works
1 message moved to Trash can
@JBis Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
SyntaxError: Unexpected token '=>'. Expected ')' to end an argument list.
so fix my mistake
idk how
it's a syntax error
13:26
yes
it's a lot easier to fix than other errors :P
something is typed wrong
like, I gave you 99% of it but introduced a minor syntax error
Good morning folks !
my bad, but at this point I'm not correcting it for you :P
13:27
it doesn't like =>
@JBis you sure you copied it correctly? I am getting error at {url} and removing curly just fixed it and worked fine
yes, but unexpected token doesn't mean that is wrong
@rlemon then({url} => new WebSocket(url)); what's curly brace for ?
the fetch returns {"url":"asdlfasldfsdf"}
you pass it to json to get an object
and then I destructure in the arguments to get the url
but it's missing something because I did it quickly.
Never saw it like that 👍
13:29
fetch('/ws-auth', {
  credentials: 'same-origin',
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
  body: `fkey=${fkey().fkey}&roomid=17`
}).then(res => res.json()).then(url => new WebSocket(url));
bunch more errors :)
@RahulJain like that ^^
yes, read my explanation above
that would still error given what rlemon said
Is there a way I can "flatten" an array of array and object ? Trying to parse it, I just realized some results are grouped into an array, thoses who have only one results are directly object... Hard to parse after... each object contains a refKey no need to get them in array... :|
@JBis are you trying it in chrome console?
@RahulJain Safari. But I can try in chrome.
13:32
@JonathanLafleur yes, there are quite a few SO answers for it
that would give error only if es6 not supported
but if you don't care about 'experimental' features and support developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…
o looky there, they even show alts at the bottom
so if you need ie/edge support use the reduce method or something
Using it on node side
no need for support
;D
13:34
Chrome: `VM183:6 Uncaught (in promise) DOMException: Failed to construct 'WebSocket': The URL '[object Object]' is invalid.
at fetch.then.then.url (<anonymous>:6:40)`
@JBis just go read what a destructing assignment is, and how you use that in a functions arguments
then read up on arrow functions
then answer your question
and at least you will have learned something after all of this
OK i'll use the reduce LOL. I do need support -.-

`(node:49604) UnhandledPromiseRejectionWarning: TypeError: userCourses.flat is not a function`
fetch('/ws-auth', {
  credentials: 'same-origin',
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
  body: `fkey=${fkey().fkey}&roomid=17`
}).then(res => res.json()).then(({url}) => new WebSocket(url));
this is working totally fine, and I am not trying anymore lol..
@rlemon you gotta try putting braces around it like this ({url})
I keep having issues trying to import my reducer

`StoreModule.forRoot({}, {initialState: INITIAL_APPLICATION_STATE})`

```
function storeReducer(state: ApplicationState, action: Action): ApplicationState {
  switch (action.type) {
      case LOAD_USER_THREADS_ACTION:
        return handleLoadUserThreadsAction(state, action);
      default:
        return state;
  }
}
function handleLoadUserThreadsAction(state: ApplicationState, action: LoadUserThreadAction): ApplicationState {
  const userData = action.payload;
Hey @rlemon I think you created a bookmarklet or chrome extensions for SO Chat right ? Can't find it since I changed my computer... ?
13:37
@RahulJain I'm well aware
I had a typo when I gave him a handout and refused to fix it so he could learn something
@RahulJain works but I am not sure what variable the WebSocket is in now :)
@JonathanLafleur dark theme?
OOh, I found you bundled everything in SO Dark :D
@JBis then just use a variable ughhhh
13:39
was before SO dark theme, was just a plugin with the ctrl + k
got it
Easy Input Tools
But I do prefer the dark theme :O
Nice work man !
@JBis :)
be warned, you can now drag and drop and paste images to the page for upload
don't accidentally post something you don't wanna.
13:41
haha, will not thanks for warning :P
@RahulJain may be not. Did you mean just set a variable = to that? If so, I am unable to use the WebSocket API with the variable.
you are likely trying to use it outside of the then function
hold up
mapping without a return?
cray boi
Humm, I don't know if it's my browser or just me who's dumb... CTRL+K, past code, make sure it's Javascript, send, and I have no syntax highlight and it doesn't look like it's code in the chat, normal @rlemon ?
13:43
you mean after it's posted?
yea that has issues
but code mode for input should be fine
Okay good to know 😀 It's okay on input, just not on chat, was worried 😀
function foo( { a, b, d = f } ) {
  let a = `hello ${b}`;
  return 123;
}
@rlemon socket connected but no messages
No way to know if it's a code block or appear like normal text ?
@JBis because you need to listen for them
13:44
Yes exact @rlemon
var bla;
fetch('/ws-auth', {
  credentials: 'same-origin',
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
  body: `fkey=${fkey().fkey}&roomid=17`
}).then(res => res.json()).then(({url}) => bla = new WebSocket(url));

bla.addEventListener('message', function (event) {
json = JSON.parse(even.data);
alert(json.content);


});
even in debugger theres no messages
bla isn't global
unless you have it outside of that??
wai
that's weird code.
ok added var bla;
but the WebSocket is still empty
it also closes the original socket
> 2018
fetch('/ws-auth', {
	credentials: 'same-origin',
	method: 'POST',
	headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
	body: `fkey=${fkey().fkey}&roomid=17`
}).then(res => res.json()).then(connect);

function connect({url}) {
	const ws = new WebSocket(url);
	ws.onmessage = onmessage;
	ws.onclose = onclose;
}

function onmessage(messageFrame) {
	console.log( messageFrame );
}

function onclose() {
	// handle however you want
}
13:47
> Still using alert to debug
test
bla
Honest question why doesn't console.log always output to console on chrome like firebug did
wdym?
it does.
not working
the socket isn't working
it closes the connections
13:50
No it doesn't
pres Ctrl+Shift+i
well open console and run
console.log(true);
ok
nothing is outputted
Yeah that works, you've obviously fucked up your config
yes it is
yes it output
13:51
@JBis You're gonna need const ws = new WebSocket(`${url}?l=99999999999`);
you probably have a filter somewhere
true
and 23
do you have info unselected?
that's the only way I can see to do that
ohh yea I guess I did have to do that
13:53
yay
the new code works
> Custom levels
Select them all
@rlemon what do you mean by filter?
^^
13:54
@rlemon Do we know what it actually does yet?
@William the filter input...
@BenFortune nope
its blank but Ben's solution worked
@William you can overwrite it
idk why you don't have default levels dropdown
ltic twitter overwrode all console functions
13:55
@towc he was not showing info logs. keep up
literally console.log = () => {}
has nothing to do with overriding console.log
@towc yeah nothing to do in this case
sorry, I'm a slow kid
YEAH TOWC
13:55
well sometimes it does but not in this
case
it's ok, just put my head in the toilet for a while, and let's be done with it
test
@JBis if you're playing with websocket stuff, move to room 1 ( the sandbox )
ok
You can spam test messages in there all you like
14:03
k thx for ur help be back soon
pls no
Reading rlemons help always leaves me with a sour taste in my mouth
8)
Ok I did try with this one
function onmessage(messageFrame) {
	json = JSON.parse(messageFrame.data);
	console.log(json.content);
}
hold on...
sigh
@wiktor-stribiżew this question didn't been asked before, looks like node.js act differently, my question focus on NODEJS !!!! — Joseph 3 mins ago
lmao
@JBis the content key doesn't always exist
14:14
@BenFortune Ik I figure I would deal with codes later just trying to see if it will work
@DenysSéguret lol
@DenysSéguret link?
@Maartenw yes, this is a link
(when a comment is boxed in this chat, you can click the timestamp at the right)
I mean perma link to the question but nvm, saw his profile linked
click the timestamp instead
14:21
Well
Today I learned :D
Thanks. It's always a joy for an older person to discover they know some computer related things that some youngsters don't know.
Not sure why you keep engaging him
If he refutes what you're saying anyways
I gave up, finally
json = JSON.parse(messageFrame.data);
	console.log(json["r17"]["e"].content);
json["r17"]["e"] has an object with "content" but .content doesn't work it gives me:
: undefined is not an object (evaluating 'json["r17"]["e"].content')
because not all frames have events
iirc
14:31
I am talking about all of them comeback like that
const json = JSON.parse(messageFrame.data);
for( const room of json ) {
  if( 'e' in room ) {
    console.log( room.e );
  }
}
@rlemon oh I am just retarded
I never changed room
Might as well just fucking write it for you
@BenFortune relax. I'm trying here
I'm not angry, I'm British
user1596138
14:38
While (0) Ask for awhile -> try for awhile
[Error] TypeError: undefined is not a function (near '...room of json...')
	Console Evaluation (Console Evaluation 2:18)
[Error] ReferenceError: Cannot access uninitialized variable.
	Console Evaluation (Console Evaluation 1:17)
user1596138
0
Q: ReactJS: element isn't updated when state changes

JascinationI have a React component that is set up like so: export default class FormDialog extends React.Component { constructor(){ super(); this.state = {allowedToDelete: false}; } onChange(event) { if (event.target.value.match(this.targetName)) { console.log("It's a match!"); ...

user1596138
Once again. RTFM, dude isn't using setState
For what it's worth - it's not unreasonable to expect it to work
Like, the exact same idea in the code would work in Angular and Vue
@rlemon json is
14:47
yup, none of those are events you care about
or even events
the d and t are just deltas and timestamps (we think) that tell the server if you're having issues communicating
they are a handshake / heartbeat type of mechanism
you only care if there is a 'e' property in the room
[Log] {r1: Object, r6: {t: 88563080, d: 2}, r11: {t: 88563080, d: 2}, r17: {t: 88563080, d: 2}, r139: {t: 88563080, d: 2}, …}
@ShrekOverflow Happy birthday!
12
that one contains a message
@rlemon ok so how do I check? room of json fails
Happy birthday Abhi
14:59
Can somebody with Jest experience do me a favor? If my answer here looks good will you upvote it? The OP disappeared and the bounty on this question is going to expire. With another vote I'll at least get half of it for my efforts. Thx!

« first day (2861 days earlier)      last day (2312 days later) »