« first day (1539 days earlier)      last day (3402 days later) » 

crl
12:15 AM
!!mdn insertBefore
 
crl
I wonder why this function needs the parentElement, just the referenceElement is enough
 
 
2 hours later…
user2620028
1:50 AM
Whats up guys, First post since i got to Thailand :) How was everyone's new years.
 
hey!
 
user2620028
2:10 AM
hows it going kitty
 
Alright
kinda stuck in a code rut
yourself?
 
user2620028
im stuck in my apartment :(
 
user2620028
somewhat literally
 
uh oh!
 
user2620028
yep
 
user2620028
2:13 AM
my girlfriend brought me food and drink and then took the keys to my apartment and left. (I guess thats what i get for asking her if she knows how to take care of a puppy)
 
crl
2:33 AM
guys, I'm doing this:
table.addEventListener("mousemove", mousemove, false);
function mousemove(e){
	console.log(e.MOUSEDOWN);
}
but it doesn't work, I want to detect if the mouse is pressed or not
Do I need to put 2 other listeners for mouseup and mousedown and use a boolean?, I hope not
!!mdn MOUSEDOWN
 
crl
seems I must do so
 
2:55 AM
lmfao
 
 
1 hour later…
4:16 AM
Folks, some (many) e-commerce sites allow to create a cart without ever registering. The cart remains accessible for weeks, then expires if I don't do anything with it. How is this done? Does the e-commerce site sets up a unique dummy user and my browser gets a cookie to identify him?
 
Hi folks, I'm trying to sort a mongodb result-set, with mongoose, using the following:

Contacts.aggregate( [
{ $group: { "_id": { name: "$name", city: "$city", state: "$state" } } },
{ $project: {_id: 0, name: '$_id.name', city: '$_id.city', state: '$_id.state'} },
{ $sort: { name: 1 } },
{ $limit: req.query.limit | limit }
], function () {

});

Problem is that result-set is not sorting. Anyone have any suggestions?
 
5:02 AM
If the breaking news is about an event at a hospital or a lab, move it all the way over to the right.
2
 
 
2 hours later…
6:41 AM
It liiiiiives!
 
7:14 AM
Any idea why this would get a downvote? stackoverflow.com/questions/22724883/…
 
7:59 AM
 
Thanks, we encouraged him to go to meta so that's only fair.
 
Did we?
 
8:16 AM
Yeah
0
A: Purposely down voting an accepted answer and encouraging others to do so

Benjamin GruenbaumHere's my take and hopefully some context: This user has been harassing the JavaScript room and the Java room for several days now. I have entered his profile and saw that a lot of his answers are plagarized and a lot of them were not answers at all. The answers were deleted by a mod since he...

 
8:30 AM
@BenjaminGruenbaum something more real meta.stackoverflow.com/a/281591/851498 :P
it's what I did to learn clojure btw :P
 
:-) remove them 2 messages to..
 
@FlorianMargaine Hahaha
 
Hahahahahahaha
in Trash can, 31 mins ago, by DS9
@Florida, I am reading about "JS Room Monthly Challenge January" and accidentelly come acreoss this chat room and read your few last comments.... i am from india.. so can u EXPLAIN this?
He thought your name was Florida!
Oh, man. Some people
 
yeah. Some guy.
 
DS9
it's a typo... i am in hurry.. after few min ..i can't edit it.
some guys.. can't take their insults...
 
I'm afraid I can take more jokes than you
you can joke all you want about France or french
 
pattern 1 :
var Class = function() { };
Class.prototype.f = function() { };
Class.prototype.g = function() { };

pattern 2:
 
9:12 AM
ok, maybe that was a little bit racist.
 
var Class = function() { };
 
DS9
ya.. enjoy your jokes..
Hope u guys do better then this.
 
Class.prototype = { f: function() { }, g: function() {} };
 
imho it was funny... but well
 
what is the difference ?
 
9:13 AM
@amin you override the prototype property in the second case. Which means you don't keep other default properties like constructor
to give you an example...
var o = {a: 1, b: 2};
o.c = function() {}; // ok

o = {c: function() {}}; // do you get the difference?
in the second case, o.a and o.b don't exist anymore
 
ok , i get it
 
notably, when overriding the prototype, you have to supply the constructor property
 
but is there some easier syntax ...
inseted of multiple Class.prototype
 
Class.prototype = {
    constructor: Class,
    f: function() {},
    g: function() {}
};
well, you can do this:
var p = Class.prototype;
p.f = function() {};
p.g = function() {};
 
do i have to include .toString
?
 
9:16 AM
not necessarily
 
so i get the inherited functions but i have to set the ctor ( right ? )
 
the inherited functions?
 
.toString is inherited from Object
 
ah, yeah
 
one more question .
is it a good pattern or a bad pattern ?
 
9:19 AM
?
 
Class.prototype = {
constructor: Class,
f: function() {},
g: function() {}
};
 
it's an ok pattern
 
thanks @FlorianMargaine
:)
 
@FlorianMargaine You know to call JSON from JavaScript native without to use jQuery?

For example with jQuery We can to call so: $.getJSON()...
How I can to call using JavaScript native?
 
that was mean... jquery's $.ajax source is pretty terrible to read as an introduction to xhr
 
9:27 AM
@FlorianMargaine

var http_request = new XMLHttpRequest();
var url = "data.json";

so?

Why http? I have a FILE.json //localhost/file.json
I'm testing from xampp, now.
    @FlorianMargaine

    var oReq = new XMLHttpRequest();
    oReq.onload = reqListener;
    oReq.open("get", "yourFile.txt", true);
    oReq.send();

     //"yourFile.txt" = "myJSON.json"? :))
Oh, I can to call my JSON with this two codeline! :))

    var xmlhttp = new XMLHttpRequest();
    var url = "myJSON.json";
 
10:24 AM
should i port it to non-jquery vanilla.js ?
 
@darkyen00 Do you want to?
 
yes
confused between if purejs
 
Then yes
 
or use react
I think react will be better :P
 
10:29 AM
Then do it
 
    I have this json
    github.com/ulisescontreras/Article-JSONData/blob/master/js/…

    var xmlhttp = new XMLHttpRequest();
    var url = "https://github.com/ulisescontreras/Article-JSONData/blob/master/js/data.json";
    xmlhttp.open("GET","data.json",true);
    xmlhttp.send();

    Why I have GET localhost/Article-JSONData/data.json 404 (Not Found)?
 
Look at your code again, around open
 
@UlisesContreras have a think about where you might use your url variable.
 
I think it's weird that he has this error...
 
   1.  I have a file.json

        [{
        	"img":"http://..",
        	"title":"Parc de Catalunya",
        	"description":"Lorem ipsum dolor sit amet..,"
        }];

    2. I call this file.json USING THIS:

    var xmlhttp = new XMLHttpRequest();
        var url = "https://github.com/ulisescontreras/Article-JSONData/blob/master/js/data.json";
        xmlhttp.open("GET","data.json",true);
        xmlhttp.send();

    My file.json is on github.com github.com/ulisescontreras/Article-JSONData/blob/master/js/…
 
10:37 AM
xmlhttp.open("GET","data.json",true);
Look at this line
Real close
 
@Zirak xmlhttp.open("GET","url",true);
I continue having thi problem:
console: GET http://localhost/Article-JSONData/url 404 (Not Found)
 
Why do you insist on turning things into strings?
You want to pass url as the second argument, right? Then pass it. No need for the qyotes.
 
@Zirak he's going to have another problem anyway...
 
Yeppers
 
10:44 AM
@Zirak Yes, url without "", but now I have this in my console..:

XMLHttpRequest cannot load github.com/ulisescontreras/Article-JSONData/blob/master/js/…. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
 
Good, that's better already
 
@Zirak better already! XD ?

header is present on the requested resource?
What happend with my data.json! (( haha
 
Your browser doesn't want you to be able to just fetch anything you want arbitrarily, that's called the Same Origin Policy. You should put your json file somewhere your local server can access it (locally on your computer).
 
interesting: unikernels
 
@Zirak yes!!! How I can access it using XAMPP(localhost/MyProject...)??? :D
 
10:48 AM
Just put your file there
 
@Zirak I have this path

<script type="text/javascript" src="js/article.js"></script>
<script type="text/javascript" src="js/data.json"></script>
 
No, in your filesystem
Your index.html is on path/to/blah, write your file in path/to/data.json or whatever.
Sorry, this is kinda my limit - beyond this point, you should google around and look for basic tutorials. You're also vastly overcomplicating this.
 
@Zirak is ok, I'm watching, thanks. :))
 
@FlorianMargaine yes, it is. Reading the Mirage docs now. Not familiar with OCaml but the part I've got to so far is 'importing' a block storage device (i.e. a very slim abstraction over the machine's hard drive) and wrapping it in a key value store. Instead of using a filesystem. Cool.
 
@TomW ah, I was reading HaLVM readme
sounds like Mirage docs are more complete
 
10:55 AM
Picked Mirage because OCaml is supposedly the inspiration for F# and I know a tiny bit of F#, which is more than can be said for the other langs
 
Tried to learn Haskell, it didn't stick.
 
crl
'learn you some haskell' is a good read
 
> A “butt load” is an actual unit of measurement, equivalent to 126 gallons.
huh.
 
Got some of the way through learn you a haskell, it was good, life and other projects get in the way though and it's slipped from my memory
Same with F# really, it took quite a lot of retrying to make it stick and I'm still not that good at it. Conceptually fine except for monads being a bit hazy, just cannot remember the syntax
 
11:00 AM
I don't like 404 (Not Found) :))
 
    I'm using XAMPP (working with localhost/MyProject) but I have problem calling file.json
    The people say me, "write your file in path/to/data.json."???
    How with XAMPP? using localhost/MyProject/data.json???

    GET localhost/Article-JSONData/data.json 404 (Not Found)  article.js:4

    Because I cannot to call my json from github
    github.com/ulisescontreras/Article-JSONData/blob/master/js/…

   XMLHttpRequest cannot load github.com/ulisescontreras/Article-JSONData/blob/master/js/…. No 'Access-Control-Allow-Origin' header is present on the
 
^ still sitting at two closevotes
 
crl
@UlisesContreras in xamp there's a root of the server in your filesystem, sometimes C:\xampp\www put your json there or modify this location
 
@crl you say this rute in var url = "C:/xampp/htdocs/MyProject/js/data.json"???
@crl XMLHttpRequest cannot load file:///C:/xampp/htdocs/Article-JSONData/js/data.json. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource.article.js:4 (anonymous function)

Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/xampp/htdocs/Article-JSONData/js/data.json'.

I need to use http://localhost/.../...json but this have error too.
 
Why? I have my MyProject with files, index.html, css/ and js/data.json

var xmlhttp = new XMLHttpRequest();
var url = "http://localhost/Article-JSONData/data.json";
xmlhttp.open("GET",url,true);
xmlhttp.send();
    My console continue say me:

    GET localhost/Article-JSONData/data.json 404 (Not Found)   article.js:4
    What happend with the line 4 xmlhttp.send();???

    GET, GET, OMG! If I call this..!

    var url = "http://localhost/Article-JSONData/data.json";
    xmlhttp.open("GET",url,true);
 
crl
@UlisesContreras What happen when you browse localhost/Article-JSONData/data.json on your bowser
 
@crl http://jsbin.com/cejojehewa/1/edit?html,js

I have myProject with:

css
utilities
js/data.json article.js

var url = "http://localhost/Article-JSONData/data.json";
xmlhttp.open("GET",url,true);
 
11:39 AM
What does the name Afonso reminds you of?
 
@Catgocat Alfons Mucha
 
hmmm
what about Matos?
reminds you of Tomatoes?
:(
 
Alfons Maria Mucha (Czech: [ˈalfons ˈmuxa] ( ); 24 July 1860 – 14 July 1939), often known in English and French as Alphonse Mucha, was a Czech Art Nouveau painter and decorative artist, known best for his distinct style. He produced many paintings, illustrations, advertisements, postcards, and designs. == Early years == Alphonse Maria Mucha was born in the town of Ivančice, Moravia (the present Czech Republic). Although his singing abilities allowed him to continue his education through high school in the Moravian capital of Brno, drawing had been his main hobby since childhood. He worked...
@Catgocat why would it?
 
I don't know my native language isn't english
just wondering what my name sounds like
 
11:44 AM
    What is correct to call json from file.js?

    var xmlhttp = new XMLHttpRequest();
    var url = "http://localhost/Article-JSONData/data.json";
    xmlhttp.open("GET",url,true);
    xmlhttp.send();

    var xmlhttp = new XMLHttpRequest();
    var url = "data.json";
    xmlhttp.open("GET",url,true);
    xmlhttp.send();

    GET localhost/Article-JSONData/data.json 404 (Not Found)
    I have error in 4 line xmlhttp.send();
 
Either might be. Don't forget to attach an event handler, though.
 
@UlisesContreras Please stop spamming the same question over and over.
 
1. everybody
2. with @ to one person.
For this reason there are more. evolution of the code, not spam. :)
 
Isn't that even an evolution thereof?
 
It's the same question in disguise. You won't learn anything by asking others to solve your problems. You have the entire internet, filled with thousands of introductions to web-dev, I'm sure you'll do fine.
 
11:53 AM
@Zirak Sure, but for me stackoverflow(with condom) is more sure that internet(without condom); Internet have very crap.
 
You'll manage.
 
oh ulises eres espanol?
vale vale
perdon pero no puedo hablar inglés
:(
ops, español *
 
@Catgocat Si!! Barcelona, Spain!!!
 
yo no soy español, pero sé algunas cosas
soy portugués
 
do you have any suggestion for good tutorial or websites or books to master JavaScript guys ?
 
11:56 AM
node.js in actionnnn rulessssss
 
@ZeRuBuES Welcome to the JavaScript chat! Please review the room pseudo-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.
 
and crockford's books..
 
@Catgocat es que tengo un problema con xampp, me dice que GET la ruta donde se encuentra el data.json!
 
xampp? que mierda, hace el download de wampp
mucho mejor
 
@Catgocat tu dices wampserver.com/en?
 
11:58 AM
si si
Zirak how did you come up with an internet name?
I need an internet nickname.. but I can't figure it out.
They all sound like crap, or already taken.
 
@Catgocat mira esto youtube.com/watch?v=chY4l_fzHck

El video dice que xampp es mucho mejor que wamp, hmm, no se.
 
-.-
wamp > xamp
xamp < wamp
mierda = xamp
xamp = mierda
 
@Catgocat tu sabes llamar files JSON desde un file JS?
 
xmlrequest...
ajax
websocket
@Zirak Tell me the secret to generate a cool name to use on the internet
 
@Catgocat Si, si,

Pero la consola me dice error.

var xmlhttp = new XMLHttpRequest();
var url = "http://localhost/Article-JSONData/data.json";
xmlhttp.open("GET",url,true);
xmlhttp.send();
 
12:02 PM
localhost no está accessible
 
@Catgocat No, (( esta es la primera vez que me pasa esto! :))
 
tienes que solver tus problemas buscando en la internet
 
@Catgocat ya me lo han dicho, :))
 
(1) @UlisesContreras I've asked you already to not bring this question here again
(2) @UlisesContreras, @Catgocat Sorry, but this room is English: http://rlemon.github.io/so-chat-javascript-rules/#etiquette
If you want to continue, please do so in a separate room.
 
Yup you are right, Zirak
Can you tell me your secret @Zirak for generating a cool internet nickname.
 
12:04 PM
Is anybody there who has knowledge in karma jasmine unit tests?
 
That isn't already taken by million of users.
 
@Zirak ;))
 
@MANOJ Welcome to the JavaScript chat! Please review the room pseudo-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.
 
@Catgocat english, english. :))
 
@Catgocat No secret, creativity and luck. If you want uniqueness, you can do as xkcd did: Generate one randomly
 
12:05 PM
@Caprica
Thanks
 
I don't know e_e
If I generate a username it'll need to be available: on twitter, github, gmail, website
 
@adeneo Where is adeneo user(genius).
 
and stackOverflow
 
What's the name of that thing that people use to make parameter controls in codepen?
 
12:08 PM
datgui
 
@Catgocat: SO is easy, usernames are not unique. For anything else: There's some website that checks hundreds of sites if a certain username is still available.
 
@ThiefMaster Really? Intersting, never heard about those websites. Can you tell me one?
 
@Catgocat Here's one: namechk.com
 
And they don't have github and stackoverflow, the most important ones xD
But thank you btw
 
as i said, SO has non-unique usernames ;)
there's some other site which checks github, too, but at least when my coworker mentioned it (i think it was in november, so maybe they fixed it now) the github name check was broken (always reported available or taken, not sure which)
 
12:13 PM
We're all just unique numbers
 
I am so jealous of people who have fine nicknames.
 
I am not a number! I am a free man!
 
@Catgocat You should be CatGoMeoowww
 
^
 
@TomW Yes 313414... actually your number is pretty cool!
 
crl
12:17 PM
I'm coding a game (Ruzzle) where I check the path done with the mouse dragged, how should I do that, search which square of the 4x4 grid I'm in at every mousemove? it seems ankward, or find at mousedown where I am then have a graph of neighbours squares and only check them?
or another idea?
 
data-x data-y
mouse.x / tileSize
 
Username: Catshit
Email: my@cat.sh
Domain: cat.sh
 
I read that as catGoat, actually
 
crl
I'm going to check which square it belongs to with distance to the center, because you can go in diagonals, so you must pass in corners
@JanDvorak oh right I see
 
@Catgocat buy the domain sh.it and then you can have subdomain cat.sh.it = great success
 
crl
12:23 PM
but like I say, it's too sensible in corners
 
There's no such thing as "too sensible". Did you mean "too sensitive"?
 
crl
@JanDvorak yes
 
Genius
Excelent.
 
closestCenter = tileSize*(mousePos/tileSize); if abs(closestCenter-mousePos < threshold) ...
 
In portuguese, the word "crl" is an abbreviation for Cock
Just saying.
@crl
 
12:28 PM
as in rooster?
 
crl
@Catgocat it's just cyril without the vowels
 
I really hate connection probl
 
crl
@JanDvorak thanks nice, works well
 
afonsodev
what about that one??
;o
 
Sounds like someone fell on the keyboard :-D
 
12:34 PM
no
that's my name: Afonso
+ Dev
afonsodev
 
I got that on the second read, but the second read only
 
@Catgocat @JanDvorak AfonsoDFloor - now it sounds like something fell
 
You know what else fell? THE BEAT wub \o\ wub /o/ wub \o/
2
 
@KendallFrey I could to solve problem of mult-line with json. :))
 
Hello Everyone I need your help.. Can anyone suggest me how can i zoom and crom 2 images simultaneously using this plugin..http://www.jqueryscript.net/demo/Simple-jQuery-Image-Zoom-Pan-Crop-Plugin-Cropit/...

Or you can suggest me another plugin so i can i zoom and crom 2 images simultaneously..
 
@AkashTyagi Welcome to the JavaScript chat! Please review the room pseudo-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.
 
Ok @CapricaSix.
 
@KendallFrey I have this confution jsbin.com/qehamipiwe/1/edit
 
@phenomnomnominal I woke up and it's 2053. I hate you.
 
@KendallFrey I 2.9999 you brah
 
12:45 PM
now do it with three
 
Evening!
 
I wish
 
I don't even know how that would work
 
like real life
 
Does anyone know how to get the zoom value of a SVG element when one of the parents is scaled?
 
12:46 PM
haha so a wave sim
 
waves propagate via circular motion, yeah
use it to generate a mesh maybe
 
Interesting. Add more randomness to the spawn
 
that reminds me, I want to learn how to make awesome shaders some time
 
So inefficient though
Yeah, that's the way to do waves
 
crl
@KendallFrey so sea waves have an infinite radius?
 
12:48 PM
no
radius = amplitude/2
 
crl
a big one at least, since they look like lines
 
I think you don't understand waves
waves aren't lines
 
crl
I should observe them more :)
waves are propagation with frequency, yes at first sense
 
@KendallFrey this is tripping me out so hard now
 
change the 2 to change the wave shape
1 is where waves break
 
12:54 PM
Your waves just crashed my chrome and Ie ... speed 10, offset 1, size 10 then change the radius
 
For some reason when I do this import in Game,

import Core from 'gameUnits/Core'

I see Core is undefined

Game.js

import Core from 'gameUnits/Core'

export class Game {
constructor() {


Core.js:

export class Core {
constructor(scene) {
}
}
 
crl
ah I was looking at waves from above
 
is that ES6?
 
Waves are broken now? :(
 

« first day (1539 days earlier)      last day (3402 days later) »