« first day (50 days earlier)      last day (157 days later) » 

00:45
6
Q: Profiles with profiling checkboxes

realisationI have this HTML down below that creates a list with two columns, the left one containing profile information, and the right one containing checkboxes of the user feedback in a horizontal list. The list behaves so that when the element of the questionAnswer array is true, there is a font-awesome...

22 hours to assign this
 
13 hours later…
13:54
@IsmaelMiguel, I've got a bug with some javascript code of mine, can you help me find it?
I keep getting Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
14:32
Greetings
Sorry
Let me check
You sure that that is the correct link?
It sends a message when somebody stars something, but, it wont send
for users entering and leaving, as well as notable posts it works fine
it normally builds bodyText and then sents it like the other types
@IsmaelMiguel yeah
But there isn't even a single "appendChild"
I know.
Try running it in your console
I am here.
So, what's the problem?
14:38
10:38:29 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763481) in Javascript Libraries
15:38:42 reporter> SirPython starred this message in Javascript Libraries
42 mins ago, by Quill
https://gist.github.com/The-Quill/b2fa2398968f1af456f5
When I run that in console, it gives me Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
Are you writting stuff into the document.body?
No, but I'd assume the chat-master.js from the page is
HierarchyRequestError is DOM-related
14:40
I think I know where the appendChild is coming from.
This page already has scripts running to "receive" messages.
Let me try on Chrome
When this page receives a message, it's going to use appendChild to add it to the body.
Lets see
I have no idea how this works
I think the problem is when you send the message.
You might be causing the server to send back an invalid response.
Wait
Let me try to star something
I think everything only went ape-shit when someone stared something
14:43
Hmm, the content I'm sending is basically identical to the notable post and user join being built
15:43:26 reporter> Ismael Miguel starred [this message](http://chat.stackexchange.com/transcript/message/23752531) in Javascript Libraries
You had to refresh, didn't you?
in Ministry of Truth, Aug 25 at 13:46, by Quill
Reporter: Vogel612 starred this message in The 2nd Monitor
It worked fine at the start
for some values of fine
10:44:21 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763591) in Javascript Libraries
It was originally one markdown link, but I made it two
10:45:11 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763602) in Javascript Libraries
14:45
Do you have to refresh to get it to send
I don't know, but I do know that chat stops updating after the error occurs.
It craps out when sending the report
I tried to modify it to not send to the API, but to set the value of the chatbox and post it
10:47:1 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763637) in Javascript Libraries
I don't think it worked, I can't exactly remember
14:47
Darn. The jQuery is minified.
I can try to get a sourcemap
A sourcemap? What is that?
Basically, a giant ass file that "translates" what every single darn thing means
And browsers use that to write the pretty Javascript
From the ugly minified one
But those files are huge (300+kb)
That is, the version 3.0
14:49
It went downhill when I did two things; I added the time to the string, and the second link
@Quill Did you copy that storage object from the Lounge's code?
@SirPython yeah
I chopped out the reporter object for the gist, but, it's basically the same
I modified emit to check input types
I still see it in the gist.
Oh! I just found something:
$.post('/ws-auth', fkey({
            roomid: 8595
        }
You aren't using the roomid variable that you created.
Mmm, that's 2nd monitor's, but the roomid was being pulled from elsewhere
You forgot to change it
Line 82
14:53
I set it to this room and it gave me a 404
Set it to the roomid variable.
10:53:40 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763740) in Javascript Libraries
15:53:52 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763740) in Javascript Libraries
10:53:43 reporter> SirPython unstarred [this message](http://chat.stackexchange.com/transcript/message/‌​23763740) in Javascript Libraries
15:53:55 reporter> SirPython unstarred [this message](http://chat.stackexchange.com/transcript/message/‌​23763740) in Javascript Libraries
Still fails.
14:54
0:54:19 reporter> Quill starred [this message](http://chat.stackexchange.com/transcript/message/23763749) in Javascript Libraries
It's looping
Oh, it isn't
I tried loading them into an array, and once the incoming messages had been iterated over, while looping all the messages out, but that gave the same error
I think the error is coming from emit.
0:57:13 reporter> Zak starred [this message](http://chat.stackexchange.com/transcript/message/‌​23762956) in The 2nd Monitor
0:57:16 reporter> Zak starred [this message](http://chat.stackexchange.com/transcript/message/‌​23763223) in The 2nd Monitor
Zak isn't even here.
14:58
It is reading the stuff from the other room
it does that
it reads all the rooms
that's part of this:
        for (var room in frame) {
            if ('e' in frame[room]) {
                processEvent(frame[room].e[0]);
            }
        }
I'm just experimenting
11:2:37 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763823) in Javascript Libraries
The problem starts on the poll function
What makes you say that?
15:05
I've added returns until it didn't spit any error
The error only occurrs when connected
Which is obvious
> 10.4.10 409 Conflict

The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough

information for the user to recognize the source of the conflict. Ideally, the response entity would include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required.
    function ondata(data) {
        var frame = JSON.parse(data.data);
		console.log(data);
		return;
        for (var room in frame) {
            if ('e' in frame[room]) {
                processEvent(frame[room].e[0]);
            }
        }
    }
That bit, after the return;
That is causing problems
11:6:44 reporter> SirPython starred [this message](http://chat.stackexchange.com/transcript/message/23763933) in Javascript Libraries
well yeah, that's basically where everything happens
the event gets processed to whether or not it gets stored, the type gets read and sent to the messager, and the messager messages it
Your error is here:
function processEvent(evt) {
    console.log(evt);
    switch (evt.event_type) {
        case EVENT_TYPES.MessageStarred:
            storage.add('star', evt);
            if (report){ console.log('star registered in', evt.room_name); }
            break;
    }
    //emit(evt);
}
15:09
It seems that it will always call emit, no matter the event type. However, I think emit will not do anything unless it is of an allowed type.
11:9:52 reporter> Ismael Miguel starred [this message](http://chat.stackexchange.com/transcript/message/23763948) in Javascript Libraries
11:9:58 reporter> Ismael Miguel unstarred [this message](http://chat.stackexchange.com/transcript/message/‌​23763948) in Javascript Libraries
storage.add('star', evt);
That is the guilty!
@SirPython that's why the sent variable is there
It works when I remove the storage.add('star', evt);
But it doesn't send messages after
that was there in the beginning
in Ministry of Truth, 1 min ago, by Quill
1:11:11 reporter> Ismael Miguel starred this message in Javascript Libraries
16:12:50 reporter> Ismael Miguel starred this message in Javascript Libraries
16:12:59 reporter> Ismael Miguel unstarred this message in Javascript Libraries
15:13
I don't see why it shouldn't send.
16:13:5 reporter> Quill starred this message in Javascript Libraries
I confirm!
Comment line 115
The message is being saved, but it's not being removed/checked in storage.
storage.add('star', evt);
why is that an issue though
15:14
Perhaps it's a bug in a storage method.
is it the Array.prototype.push
Array.prototype.push(storage.data[name], value);
May be this
Is data an array?
Why not just storage.data[name].push?
not sure
Because it isn't an array
Oh
Nevermind
15:15
Yes it is.
16:15:37 reporter> Ethan Bierlein starred this message in The 2nd Monitor
storage.data[name] = [value];
@SirPython It has to add to the already-existing values
I originally was trying to add users and keep track of who goes where, but, I may have edited spaghetti in
I know.
15:16
Right
Sorry
16:17:7 reporter> Ismael Miguel starred this message in Javascript Libraries
16:17:16 reporter> Ismael Miguel unstarred this message in Javascript Libraries
11:17:17 reporter> SirPython starred this message in Javascript Libraries
16:17:30 reporter> SirPython starred this message in Javascript Libraries
I fixed it.
16:17:36 reporter> SirPython starred this message in Javascript Libraries
Change line 33 to storage.data[name].push(value);
Yup ^^
15:17
I fixed as well, and it works
That was an unexpected bug
I wonder why that caused a problem.
Originally, it had this:
Array.prototype.push(storage.data[name], value);
The push function expects a this
But for some unknown reason to science, it was burning something else
OH!
Maybe you would have to do this:
15:19
I've got it!!!
Array.prototype.push.apply(storage.data[name], value);
Array.prototype.push(storage.data[name], value); <-- Adds these 2 values to the prototype
And it was mething with jQuery
And yes, SirPython is right
codereview code review
Well, I'm off to do other work. If you need more help, ping me.
15:24
it's supposed to trigger the notable posts
@SirPython Thanks for your help
you too @IsmaelMiguel
You're welcome
oh that's right, I turned off the infinite loop bug
lol
let's turn it on, just for a moment
codereview code review
? what bug?
It would keyword search the text, then display it
which would then keyword search the displayed text
and so on
this is a test: fuck
And it would re-re-re-re-re-re-re-re-re-re-send the message?
15:27
basically
this is a test: fuck
409 conflicts, argh
You should add a message pool
huh?
Check how SirPython's bot worked to send messages
It would have a function running every x seconds
And would take 1 message from the array
And then sended it
If there were no more messages, it would stop
15:30
hmm, okay
Basically
It would send the messages 1 by one
And if it failed, it would re-try again later on
The messages were only removed after being confirmed that they were sent
It uses a pretty "hacky hack", as you would call it.
which function is it?
15:36
function sendMessage(message) {
	document.getElementById("input").value = message;
	document.getElementById("sayit-button").click();
}
Hmm. Those should be stored in variables.
not that one, the message pool
Line 500 and below
let's try something different
this is a test: fuck
never mind, undefined error
why is roomid accessible in sendMessageToAPI but not emit?
Where is roomid being assigned?
this is a test: fuck
why can I not cross-room post?
this is a test: codereview
this is a test: codereview
this is a test: codereview code review code
that has a floating point error, too
in Ministry of Truth, 22 secs ago, by Quill
10 secs ago, by Quill
11 secs ago, by Quill
Reporter: codereview code review code; returns floating point error
apparently it works, for some values of works; codereview
just not here, with issue posts
gg, causing issues all over the network
15:51
o.O
weird
I accidentally set it to post to whatever room the event type said it was from
instead of just posting there for notable messages
let's try that now
Try it then
It didn't work
with notable messages, I send two
the first says: 'hey, this is notable' and the second says: 'this is the message'
I was trying to get the first to post in the offending chatroom, and the second in the MinTru
I get 409 messages on the incoming ones to the offending chatroom
in Ministry of Truth, 15 secs ago, by Quill
in The 2nd Monitor, 32 secs ago, by Quill
this is a test: moderator
16:13
jesus christ
Visit here and look at the last message, @IsmaelMiguel
17:10
   var KEY_WORDS = {
          'codereview': {
            regex: /(c(ode ?)?r(eview)?)/gi,
            value: 1
        },
        'code': {
            value: .1
        },
        'off-topic': {
            regex: /(off( |-)topic)/gi,
            value: 1
        },
        'troll':  {
            value: .5
        },
        'review':  {
            value: .5
        },
        'stackoverflow':  {
            regex: /(s(tack ?)?o(verflow)?)/gi,
            value: 1
        },
        'shit':  {
function processMessage(body){
    var sum = 0;
    for (var i in KEY_WORDS){
        var a = body.match('regex' in KEY_WORDS[i] ? KEY_WORDS[i].regex : / + KEY_WORDS[i] + /);
        if (a != null){
            sum += KEY_WORDS[i].value;
        }
    }
    return sum >= 1 ? sum : false;
}
@IsmaelMiguel, did I mess up one of my regex?

« first day (50 days earlier)      last day (157 days later) »