« first day (2080 days earlier)      last day (2867 days later) » 

12:02 PM
@Jes /(.{15}).*?[(ZONE-\d+)], (\d+), (\w+)[^,]*, (\w+)/
 
Hey all! With WebSockets is it possible to do something like this [1] without getting what I guess is an infinite loop.

[1] http://codepen.io/anon/pen/gMgdJV?editors=1010
 
12:18 PM
how does that get you into an infinite loop?
 
Getting an error in console
'Maximum call stack size exceeded'
Just a guess though
 
Yeah, don't do that.
Sending a websocket message for every websocket message you send won't end well.
 
oooh I see now...
 
:(
Is it possible though?
 
add a delay or something
but I really don't see why would you do that
 
12:30 PM
I'm trying to understand some code I have found
They manage to do it
One sec grabbing snippet
 
@towc that will only delay the inevitable
 
:,( a moment of silence for the poor browser
 
@user1527354 Nothing to do with WebSocket. You'd get that even if you had used ajax or iframe post. This is a problem of infinite recursion and stackoverflow has many explanations.
 
It's strange because if I change the uri for the websocket from theirs to mine I just get a max stack error
 
12:33 PM
No surprise here
 
@JanDvorak What do you mean?
Also - for those who are interested here is the full file
 
You send anytime you send. Bam, infinite recursion.
 
But theirs works?
But if I change line 108 from their server to mine I get the error
It's strange
 
Then they avoid the mistake you made. I can't be bothered to find out what their code does, but clearly it's something else than your code does.
 
Right.
 
12:43 PM
@SomeGuy Phone to Chrome should disable the submit button after the first press.
 
@SomeKittens Yeah, it should
Thanks
 
1:00 PM
@user1527354 There is no two websocket connections, and there's a guard that will only run the hook once .. so your small example becomes like this.. codepen.io/anon/pen/pbRxyw?editors=0011
 
Is the previous object logic the guard?
Ahahahaha.
Goodness sake.
Found my issue
Not usre if you saw my previous comments but I had a problem where I was only switching the web socket connection and for some reason I was getting an infinite loop
 
🎆
 
It was because they have this as their guard

'if(object.url.substr(object.url.length - 8, 8) == '/slither' && previousSocketServer != object) {'
and mine was new WebSocket('ws://localhost:8080/websockets/slither');
changed it to new WebSocket('ws://localhost:8080/websockets/snake'); and everything works
That...was...painful
 
I am sorry for your suffering.
 
Thank you for your help
 
1:21 PM
Wha.. what did I do? .-.
 
You made him suffer. That pushed him to research his issue.
 
So, I'm the bad guy who does good?
 
I thanked you because you spent time trying to help me solve my problem.
 
Jes
1:36 PM
@Sheepy thanks..sry did not notice
 
2:00 PM
Hello guys !
 
Hello !
 
Morning
 
I'm building a desktop app with JS, I've built 80% and I've to release it in two days, I'm still stuck at the last 20% of it, would anyone of you be so kind and help me on it ?
Please ?
 
I can wish you luck
 
Thank's, but a small help right now is more worthy ;)
 
2:15 PM
Yeah, but I'd prefer to help where I'm paid to.
You can ask specific questions and (hopefully) get them answered.
 
@DeltaWeb That doesn't sound good.
But just ask your question and someone will answer it if they're interested.
 
Okay, I have an array in this form [{name : 'pizza', price : 13.00},{name : 'shawarma', price : 15.00},...] . And I have a form where I type a name of an item from this array and I need it's price to be returned . How can I do this ?
 
If you can use ES6, Array#filter might help.
Also note you'll have to handle the case where the item simply isn't there.
Why not use a dropdown?
 
Dropdown ? like suggestions on a search bar ?
 
2:33 PM
LOL /cc @AwalGarg @towc
 
@DeltaWeb Some drop downs are fixed and does not allow free text input, but supported by all render engines without any code. There are also libraries that support filter-as-you-type drop down.
 
How does Lynx render that?
 
2:50 PM
Is Lynx integrated into any desktop js app framework?
 
A good point nonetheless. I wonder whether datalist select will work out of box...
 
@Sheepy It's a text-mode browser
@JanDvorak lynx, elinks support new HTML5 stuff
 
I know. One of the very few browsers from last millennium that is still alive. The other should be Opera...
 
Sheepy you play cs:go?
 
2:58 PM
IEdge is one browser with two names. Opera are two browsers with one name.
 
Edge is walking further and further away from IE. Can't argue with Opera, though. Their old JS engine has pretty unique performance characteristic from the others.
I once used Opera as my main... irc client.
 
3:41 PM
dota2 is available for free
 
@FarazDurrani Oh, sorry. Not into fps / multi-player games...
 
4:15 PM
TIL: An empty <title>, just as an absent one does, causes the browser to use the URL instead.
 
@Mr_Green It's free to play
 
Is there anything truly free worth playing nowadays?
 
@JanDvorak The Game
 
@JanDvorak Monument Valley
 
@littlepootis not worth playing, thanks
 
4:25 PM
Why charge upright, when you can milk more cash via in-game items..
 
@Sheepy says 90 CZK
 
No more room in hell
 
Played and completed Evo Explorer
The iOs version costs four euro
 
@JanDvorak My Google Play says free. It used to be free for the first three level, but a while ago they made the whole episode free, which is a complete story.
 
Link?
 
I'm kinda put off by the language of this version...
 
Apparently this language version can't be installed on my phone
 
@JanDvorak Yeah. I think there should be an English version around. I installed through Humble Store, which switch the language with my system preference.
And I certainly finished it in both English and Chinese :p
Got to sleep now. See you all later~
 
5:11 PM
Which do you guys think is better for date format? MM-dd-yyyy HH:mm or yyyy-MM-dd HH:mm?
 
The one that's not mixed-endian
 
thanks
 
Americans have a thing for weird measurement systems. Don't encourage them.
They also dri... wait, no, that's the British.
 
I wanna choose a name for my website. Anyone have a list of names to choose from?
 
Henceforth I propose to name this date format, "kebab-sortable", because it works with string sorting tools.
@user3002233 Little Green Horn. Wait, no, that's taken.
 
5:20 PM
@JanDvorak no i didn't mean the name itself! I mean a name list.
 
@user3002233 taco.com
 
like names of car companies! that has many names!
 
wut
 
@taco what should i do with this?!
 
5:21 PM
@user3002233 adjectives.cp(colors).cp(nouns1000)
where cp means cartesian product
 
@JanDvorak don't know what you're talking about!
@MadaraUchiha holy shit! what is this?!!!!!!!
@MadaraUchiha is it for vim?
 
@user3002233 Good
 
@MadaraUchiha see you at YGLF tomorrow?
 
@BenjaminGruenbaum Aye
~what time are you getting there?
 
7:45, but I'm helping
No real point in being there before 9:30
 
5:44 PM
I have a working knowledge of javscript and have used it for years. However, I always feel like my knowledge was gained very randomly. I've tried to sit down with a book and learn everything over again hoping that would help me feel like i have a more "complete" knowledge. However, its impossible to concentrate when you feel like you already know what they are telling you. Any advise on a really good javascript tutorial?
 
@COMisHARD mdn guide
 
ok cool
 
@Com
@COMisHARD
 
5:55 PM
@vijay Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
hmm :)
 
Hello
Is there anyone?
 
I am
 
Can you help me in js?
 
!!welcome Blind
 
6:05 PM
hey?
 
@Blind Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
!!live
 
Ok
 
Oh, just laggy
 
Probably not, we're all retards.
 
6:05 PM
@MadaraUchiha I'm not dead! Honest!
 
If i'm in sito.it for examples
i can get info from sito.it/lol
I'm in sito.it and i have sito.it/lol. In sito.it/lol I would do: var point = document.querySelector(".point").innerHTML and then alert(point)
but i've .point in sito.it/lol and I must get it on sito.it
Understand?
 
Hello!
 
hello
can you help me?
 
@hubot Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Guys how exactly would I create nested objects like:
var x = {};

x["one"].n = 1;
Cannot set property 'n' of undefined
so thats means one has to be defined first. I cant chain this stuff
sucks
so In order to make this work:
var x = {};

x["one"] = {};
x.one.n = 1;
I mean, one line of extra code for something that should work with only 1, but cant figure it out
 
@Asperger var x = { one: { n: 1 }}
 
Ya but thats not dynamic.
The result is the same.
 
@littlepootis Be wary of articles written 5+ years ago
@BenjaminGruenbaum In a performance critical Node 6.2.1 environment
 
@MadaraUchiha I don't think namespacing has undergone a significant change in the last 5 years.
 
Is using Symbol() significantly more expensive than generating a random GUID with Math.random() or something similar?
@littlepootis I'm more worried about outdated code samples
Which people tend to blindly copy/paste
 
6:17 PM
@MadaraUchiha Im sick of this copy paste world
 
@MadaraUchiha ?
@MadaraUchiha not really
 
Its always copy and pasting and the "dont reinvent the wheel" mentality.
 
@BenjaminGruenbaum "significantly" here means .1ms order of magnitude
 
@MadaraUchiha just don't define private properties then?
 
What do you mean?
 
6:18 PM
Setting a property dynamically is slow anyway.
What's the actual use case?
 
Guys if you had to decide, would you create a procedural planetary map using perlin noise or a bitmap texture?
 
Screeps
 
so its CPU vs RAM
 
Giving IDs to various objects in the game
 
People use symbols for private stuff, instead - just use _propName to mark private stuff. Although private symbols are almost as fast as properties
@MadaraUchiha objects already have a unique identifier, their reference.
 
6:19 PM
@BenjaminGruenbaum Fair point
 
I found my own way to make things truly private
 
@Asperger what is it?
 
ok ill show you. It might not be the best solution though. Glad to hear your opions. Ill jsfiddle fast
 
Hello, I've a problem
If I'm in sito.it can I get DOM of sito.it/lol?
 
@Blind No
 
6:22 PM
Oh ok
How to can I do it?
 
Unless sito.it/lol is in an iframe within sito.it
But don't go there, it's usually more complicated than the benefit it gives
 
no, but if I in sito.it put a iframe of sito.it/lol, can I get dom of sito.it/lol?
 
two second
how to?
but wtf
 
Just make an ajax call to it?
 
6:29 PM
i don't know ajax/node
 
Learn
 
why?
I don't think that could be useful
i'm a front-end developer
 
You might not need to know node
 
not a backend
 
But you definitely need to know ajax...
 
6:31 PM
@littlepootis jsfiddle is playing crazy. Anyways, my ideas are:
 
why?
 
@Blind Do you know what AJAX is...?
 
Yes, a few
 
1) Using es6 imports I can simulate private data
 
it's a framework js for socket/request http
 
6:32 PM
@Blind It's not. Go learn what AJAX is.
 
ok
anyway before I want become good with JS
 
AJAX is part of the DOM API, it's not a framework.
 
I know js but I must improve my skills JS/CSS/HTML5
 
@littlepootis funny enough to ignore the fact that it is far from truth :)
 
@Asperger Just paste an example somewhere
Doesn't need to run, just be clear enough
 
6:33 PM
anyway, how to can i calculate my knowledge js?
 
@MadaraUchiha ok let me construct some.
 
@MadaraUchiha you know how to can I calculate it?
 
Calculate... what?
 
@MadaraUchiha jsfiddle.net/d55yfrzc
this is one idea I had
ok, forgot to rename the method to getname
that could be one way to make things private concerning singletons
 
@MadaraUchiha I means, is it there any test for knowledge JS?
 
6:37 PM
@Asperger: what is going on? What problem is discussed?
 
@Asperger what are you doing with JS?
 
@Blind bad right?
 
@Asperger Not bad but are basically
 
@Asperger jsfiddle.net/kdxzuLLm Since you're using ES6
Here's a cleaner way.
 
6:39 PM
A symbol cannot be recreated and is guaranteed to be unique
 
it's small but cool
 
@MadaraUchiha can babel convert this stuff?
 
So if you don't export it, no one else has access to it.
 
@MadaraUchiha mattewdev.altervista.org/boxGenerator/index.html i can do things like that, i know things like calculator/MCM/MCD and I'd created an antispam with js
 
6:40 PM
It wont convert functions for me so Ill have to polyfill it
 
@Asperger Symbol is not a function
 
@MadaraUchiha how many skills i have from 1 to 10 in JS?
 
Well, technically speaking, Symbol is a function, but Symbol() is not
It's an entirely new type.
 
It certainly looks like one.
 
but ecmascript2016 was released?
 
6:42 PM
doesnt ecmascript 2016 have private types?
 
@Asperger No, but what I pasted above is ES2015
 
Support is pretty bad though for symbols
 
!!> typeof Symbol()
 
Hi, could you think of possible memory leaks in test runners (specifically, mocha) while using watch and other then not clearing the relevant require.cache?
 
and I hate using extra code for polyfills
 
6:44 PM
Honestly you can probably emulate Symbol in a 1 liner
 
@MadaraUchiha "ReferenceError: Symbol is not defined"
 
@MadaraUchiha you're a good helper! Compliments!
 
This is easiest way to implement class in js jsfiddle.net/gqt0nvgd
 
@MadaraUchiha @hubot @CapricaSix Do you think that I should OOP JS too?
 
@Blind I think you should at least learn it and figure out if it's useful to you
 
6:47 PM
Sure
 
symbols dont make it truly private though. I mean what about methods? I might want to have private methods
 
@hubot No need to assigning it to a variable
@Asperger You can
 
@MadaraUchiha I would become a full front-end developer
 
[mySymbol]() { ... } is the syntax IIRC
 
ya but what if I have multiple properties and methods which I want to be private?
 
6:49 PM
private1 = Symbol();
private2 = Symbol();
private3 = Symbol();
private4 = Symbol();
 
this[private1] = "private!";
 
All different objects
 
ya and there is the issue
what about this:
private = Symbol({x: 1.0f, y: 2.0f, z; -3.0f})
 
private is the replacement for the property/method name
 
Asperger: quite good solution
 
6:51 PM
Not the value
 
I somehow dont like how symbols work. Maybe im too spoiled because of Java
 
@Asperger yes, you can. But it's not truly private
 
@MadaraUchiha what i should know for become a full frontend dev (I know HTML5, CSS3, JS and JQuery), Now about js i know: variables, function, DOM, arrays, const, let. bool,operators, loop, object, conditions, string and his method (not every) and I'm learning BOM
What I should learn like frontend dev?
 
@Asperger you wish
 
It all feels like a hack, we seriously need true private,public and protected keywords
 
6:52 PM
const private = Symbol('optional name for debugging');

// ....

this[private] = {x, y, z};
 
@Asperger No, I don't want Java in JS
Go away.
@Blind You should know everything
 
A wild getOwnPropertySymbols appears
 
Or rather, know how to be able to know anything.
 
@MadaraUchiha oh so thats just an optional name for debugging? I thought you were declaring something important.
 
6:53 PM
@littlepootis You go away too
 
I can keep this empty then:
const private = Symbol();
unless it forces me to specify a string
 
@MadaraUchiha everything about JS?
should I know frameworks like Jade/SCSS/SASS and framework backend like Node/Angular?
 
@Blind not just js. Learn to design websites too.
 
I hate design and graphic
 
Then why frontend?
 
6:55 PM
since I prefere script and everything
@littlepootis because I love web developement
 
Did you guys hear about Vulcan?
 
maybe I should know PHP (expect If i study node and i use it)
 
@Asperger Object.getOwnPropertySymbols
 
I have the best website ever and I don't know/like design either.
 
@Asperger yeah
 
6:57 PM
this is awesome as hell
It will replace openGL and man, its so fun. 800 lines of code just for a darn triangle :)
But creating the entire pipeline yourself is pretty rewarding
 
Node can replace PHP?
 

« first day (2080 days earlier)      last day (2867 days later) »