« first day (1878 days earlier)      last day (3061 days later) » 

12:08 AM
ES2016?
 
nevermind, I don't even need FileReader
 
I didn't think it made it into 6
 
it didnt?
you're right
 
often the case
 
yes :)
 
12:17 AM
hi
 
hello
 
I was wondering if im coding a js script and I have an external js file with an array in it, how would I access it?
 
you could always make use of a module system, like webpack
or browserify
 
is there a way without using a module system?
i'm doing inline js and I have an external js file with an array of countries, I'm not sure how to call the external array so I can use it for selection in a drop down menu
 
12:35 AM
can anyone recommend a good RPG?
 
@tereško likes?
 
@StanleyDharan you simply include the external script as per usual and reference the array. however make sure to include the external before referencing the array.
 
@rlemon Arcanum, Deus Ex, Morrowind
 
@rism I included the file via the script tag, using src, but the part that im confused about is how do I reference to it?
 
crl
if it's a .js you do var a = [], if it's a .json you query it by ajax
 
12:41 AM
there are three of them iirc
 
I am thinking about giving Divine Divinity a try: store.steampowered.com/app/214170
@rlemon that looks like an action-RPG
in that case I could just play Dishonored
 
@StanleyDharan including (loosely) equals referencing. In order to use the array you need it's name/ variable identifier (assuming it is in global scope) ... probably easier if you dump your script to pastebin or something... then we can tell you exactly.
 
@rism okay yah will do sec
http://pastebin.com/nBf6cuhJ <-- where im trying to call the array
http://pastebin.com/nepYgeMU <-- the external js file
 
oh, you redefined the array to []
remove this line var countries = [];
and just use countries / domains whatever
 
so if im trying to use the countries array then I just do countries[array spot whatever]?
 
12:51 AM
well, in order to make it obvious, he should set it as a property of window. Omitting 'var' keywords is stupid
 
put this in your header <script src="a3-countries.js"></script> << empty
then remove the src from your inline: src="a3-countries.js"
then remove ` var countries = [];` from your inline
and you should be good to go.
there's some things you can do to clean it up but it should at least run as above
 
okay thanks, im gunna play around with it, it doesn't populate the drop down just yet but this is a big help
 
note that ` <script src="a3-countries.js"></script>` is a relative path so the scripts need to be in the same folder as the document
yep. np. have fun.
 
@tereško That's one of the first games I remember playing
Great game
 
@copy unfortunately it seems fucked for 3440x1440
I will have to wait till I buy an SSD for my broken laptop to play it
(I have begun an "incompatible" category for majority of these games)
 
12:57 AM
@StanleyDharan also note that your script runs before the DOM has finished loaded so Countries element doesn't exist, move it to the bottom just before </body>
 
ehh ... I will just install Age of Wonders 3 (9min to download)
 
@tereško If you don't mind old games: gog.com/game/albion
Works well in dosbox
 
@rism oh thats why it wasn't working
thank-you
 
@copy that's a bit too old for my taste
 
@tereško Hmm, have you played Gothic 2?
 
1:00 AM
I played it very, very briefly. People's arms are really short in that game for some reason
 
yeah, the fighting is a rhythm-game
 
@ndugger loool wut
 
Yeah, the graphics did not age well
 
Is Chakra faster than V8? Any idea?
 
from the benchmarks I was looking at in Benji's link, yes
but take those numbers with a grain of salt; specific benchmarks don't always reflect the bigger picture
Still, it looks like Chakra has some really cool performance optimizations
 
1:16 AM
I see.
 
 
2 hours later…
3:20 AM
A 4x4 runs faster in come terrain and a sports car runs faster in some other.
Look at V8, it is generally faster than Firefox but some features (e.g. generator) is 2-3x slower.
With Edge, Firefox, Chrome, I think it is quite misleading to say one is "the fastest" or "the slowest".
Just last month we have a case where Blink will stuck for a few seconds doing relayout, when Firefox and IE (!) won't. (Even I can't pinpoint the cause causally.)
 
I just got my FFMPEG nonsense to work, full circle. Time to celebrate, by programming even more.
 
Congrat~
 
@ndugger such programmer
 
ye m8
Seriously, though, I've learned more on this personal project than I've ever learned from work
 
lol
personally, I learned a lot at my last job
though I'll admit I learned a ton of low-level shit in the past couple days
working on a relatively simple algorithm
 
3:30 AM
I have a tendency to push myself really hard, and it's a lot easier to do so when you don't have any boundaries. I feel like I just twiddle my thumbs all day long at work. They move so slowly.
 
yeah
when you spend most of your day waiting on others, it becomes habit
 
For me at least, work means tried and true techs and known, safe boundaries, because cost of failure is high. Personal projects mean fun new techs and pushing own limit, because cost of failure is low.
 
I've been slowly breaking myself out of that habit by working on personal projects
 
I've never finished a personal project, but since this one is really back end heavy, I find it a lot more engaging.
I built the back end framework that it's running on too, so that helps, lol
the front end code is gonna be uglier than the back end code... is that normal, or am I just being lazy?
 
Normal, if you are a programmer who focus on general programming, rather than, say, UI or UX.
 
3:36 AM
I used to be a designer, and used to focus a lot on the UI, but back end is more challenging/fun
 
@ndugger Be persistent. About two third of my projects see fruit (mature enough for power users), half of them not on first try, and many of them span several years.
 
@ndugger It's tougher to structure frontend code in a clean manner, at least in my experience
compared to backend
 
yeah, I blame the DOM
 
fuckin DOM
 
fuckin Vin Diesel
 
3:38 AM
Well, that is why we have MVC, MVP, MVVM.
 
MVVM is disgusting and needs to die
 
I'm the MVP
How is MVC different from MVVM? out of curiousity
 
You know that makes a good SO question and it is bound to be asked and answered, right? :D
 
pls
 
@ndugger Different model has different uses. MVC, for example, is not exactly suitable for the web, and many PHP books teach MVP when they claim to be teaching MVC (which was the mainstream pre-web).
 
3:42 AM
I find MVC to be plenty suitable (for the back end)
 
I've been working with Mithril lately; at first it appears to be an MVC but now I'm not really sure what it is
dunno if you can classify it under a single category
the examples make heavy use of view models
 
I personally find that names is pretty confusing for MVC/MVP/MVVM, and many web framework's Controller is actually the Presenter in MVP. Assuming, of course, that the framework tightly follows one of them instead of, uh, give you the freedom to cross the boundaries (to put it nicely).
 
@Sheepy 4x4? Dint get you.
 
@RahulDesai Cars. I just wanted to give an example that different type of cars work best on different terrains, and different JS engines also excel in different areas.
 
ah, I see
True
So it is all relative, huh?
 
3:50 AM
ohai
 
@RahulDesai Yes. How relative is relative too. Stick to ES5 and all engines are pretty fast, not much variations. Explore ES6 and the differences will be more obvious.
 
I see.
 
asm.js used to show a gap too, but as it becomes more mature, the gap is narrowing. May have disappeared by now, I haven't checked.
 
ok
Mr. Crockford introduced a new JS library recently at the JS workshop: rq.crockford.com
I hate it when people name stuff with acronyms.
@SomeKittens How is it going?
 
4:04 AM
@HimanshuVaghela 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.
 
can we make button as dragbble in full website?
 
Yes, why not?
 
$( button ).draggable(); // There you go
 
like this
https://www.youtube.com/watch?time_continue=28&v=MszWA0YWFaw
but in all devices
is this possible in all dvices?
 
All devices is a pretty board range. Does it include stupid phone who knows only WAP2 and not JavaScript?
Or the first generation internet TV stuck on Opera 7, something like 10 years ago?
 
4:09 AM
iphone, and android all devices
 
Android v1?
Or v4.4?
 
And I assume you mean iPhone 5 or up too, not iPhone 1.
 
So that's not exactly "all devices". I know mine is < 4.4. Anyway, the answer you want is yes.
 
4:13 AM
ok
let me try
i want same like in video
 
Put a button in HTML, make it appears like an icon, allow user to drag it around. Yes, yes, and yes. Modern phones are capable of that.
 
Ok
@Sheepy Thanks :)
 
You are welcome. Be precise and we can help you faster. :)
 
I make it here
http://fortvision.com/
. I saw that in iPhone Safari, the first time I open the page and try to move the button - it disappear.
 
Well, good luck. Since apple stopped releasing Safari for windows and linux, it is hard enough for me to solve my own iphone problems...
 
4:28 AM
:D
 
 
1 hour later…
5:41 AM
Hi.. Anybody there?
 
6:16 AM
a
 
6:37 AM
c
 
@Sheepy We had to buy a macbook just to be able to reliably debug webkit :/
 
6:55 AM
We do have a Mac. That stayed in OS 10.4 or 10.5. So it's painful alert debug all the same...
 
user5519006
Hey
 
@NitinJain 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.
 
user5519006
Anyone up?
 
@NitinJain Hey
 
user5519006
Help with JS..
 
user5519006
6:59 AM
1
Q: How to Make a Share button for a JS element?

Nitin Jain <p>Click the button to view your latitude and Longitude</p> <a class="waves-effect waves-light btn" onclick="getLocation()">Try It</a> <p id="demo"></p> <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocat...

 
user5519006
 
user5519006
Is anyone Helping me out..?
 
hi guys. I have used the code in the following link to empty an inputbox using javascript stackoverflow.com/a/6258628/3480449. It gets cleared up, but when I remove focus from the input box, it gets filled up once more
 
@coderVishal 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.
 
@NitinJain Try jQuery Applink
 
user5519006
7:03 AM
Thank you.. I'll try now
 
user5519006
Hey Jacques.. I dunno how to implement it. As I am a newbie.. So any other way?
 
@NitinJain Well it's the only way to go if you don't want to write too much code. I could explain to you how to implement it.
 
user5519006
I think you can help me out..
 
Ok sure
Well first, do you have jQuery included in your HTML?
 
user5519006
Yes,
 
user5519006
7:08 AM
view-source:http://whatscast.in/
Line 34
 
@NitinJain I can't view your website...
It gives me an error: ERR_CONNECTION_REFUSED
 
user5519006
Okay.. Just a sec
 
user5519006
 
user5519006
I have Jquery
 
7:13 AM
hi all
 
user5519006
 
user5519006
Is Jaques Gone? :0
 
Okay, download and include the jQuery Applink from Github
 
user5519006
Just a Min..
 
Sorry, my internet is just a bit slow
Ok
 
user5519006
7:16 AM
done
 
Damn, this morning the French flags look a little different...
 
user5519006
I uploaded the files from github to my Website
 
Now comes the hard part
Wait a bit
 
user5519006
:\
 
@NitinJain This could take a while
 
7:27 AM
 
user5519006
:\ What?
 
I don't really know how to make it all work on one button
 
o/
 
o/
 
7:50 AM
Any docker pro wanna save me head-desking on the obscure docker docs?
How do I just create a new container and get to it's shell?!?! what is all this shit: https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=docker+new+container+from+image?!?!
I don't want to build my own image :( I ... just want a goddamn container
 
Guys, what does it mean when during console.log an object has one of its attributes and a corresponding value in a square brackets
{ [error: duplicate key value violates unique constraint "artist_name_key"]
  name: 'error',
  length: 195,
  severity: 'ERROR',
like this
 
Is it a getter?
 
well, obj.error is undefined
 
What about obj[0]?
 
wouldn't it be '0' then?
 
8:01 AM
0
Q: instanceof Vs [[Class]] -- Javascript

overexchangeFor below code, function Animal(){ this.name = "Animal"; // toString is a function in the main Object that every // object inherits from this.toString = function() { return "My name is : " + this.name; }; } function Canine(){ this.name = "Canine"; } function Wolf...

 
the key
 
Just try it
 
it's undefined
and Object.keys() returns everything but that weird thing
 
What does it say if you JSON.stringify it?
 
Does [[Class]] or Object.prototype.toString.call( ZZZ ) give the type of language object?
 
8:03 AM
@zerkms try obj+''
@overexchange no
 
JSON.stringify does not have it
 
wtf
 
if it was easy I wouldn't ask :-)
 
Where are you getting the object from?
 
it's an exception from node-postgres
 
crl
8:05 AM
[object Object] -> can you not just inspect the object in your console?
you've IE or what
 
or to be more precise - it's a failed promise from pg-promise which is a wrapper over node-postgres
it's node
 
> ({x: new Error("foo")})
{ x: [Error: foo] }
 
Hm, screenshot of the console? xD
 
Here, Object.prototype.toString.call(arcticWolf) is giving the output [object Object]. Object is constructor function object.
 
this is the exact copy of console
@AwalGarg that's interesting
 
crl
8:06 AM
@overexchange what stupid browser do you have?
 
@zerkms can you do Object.getPrototypeOf(obj)?
 
@AwalGarg thanks, that was it :-)
 
np
 
@crl I use firefox
 
What are you even doing?
Just... wat.
 
8:09 AM
inheriting like this makes it more difficult .. use Object.create . and then in the constructor if u need t o call super just Parent.call(this, arguments)
 
I'm handing and exception :-)
 
@zerkms he wasn't referring to you
 
I mean overexchange
He's way overcomplicating this
Not to mention completely overlooking the fact that Object.prototype.toString isn't the same as arcticWolf.toString
 
crl
@overexchange yea toString returns a string version of the object and it returns [object Object] by default I guess, override it
 
8:11 AM
You can override the object toString on an object, you realize that right?
 
Wolf.prototype.toString = () => "[object Number]" :D
 
@Cerbrus If you do not have a property in your own instance, you go to its prototype. Before going to Object.prototype, you have toString property defined in Wolf.prototype. check the code.
 
@shortCircuit no, I mean Object.prototype.toString.call'd on it.
 
oh..
 
crl
Animal.prototype.toString.call(articWolf) works no?
 
8:13 AM
Symbol.toStringTag, browser support is shady (IE only so far?)
 
what has happened to IE . suddenly with chakra it supports lot of es6 features ..
 
@overexchange: You called the toString functiont hat is on Object.prototype on the wolf.
That is not the same function as the toString that is on your wolf.
 
@BenjaminGruenbaum Edge doesn't support it :P
 
@AwalGarg with experimental mode?
 
@BenjaminGruenbaum nope, that's what kangax's table says
wow, it supports Symbol.unscopables :o
For the next couple of months, we are gonna live with "Only IE supports it :(" instead of "Fucking IE doesn't support anything" :-P
 
8:18 AM
@crl Animal.prototype.toString will actually invoke Object,prototype.toString.
 
crl
oh ok
 
Wolf.prototype.toString.call(arcticWolf); will invoke its own member
 
is Rx.Observable like Object observable ? I am trying to reinvent a simpler version of rxjs but github.com/ReactiveX/RxJS/blob/… I don't understand these ..
 
@shortCircuit Object.observe is dead, also no.
 
Long live Object.prototype.watch ;D (j/k, it should die as well :P)
 
8:21 AM
Can somebody help me answer these 2 questions here? stackoverflow.com/questions/34125902/… I am stuck here..
 
@overexchange: Stop asking for people to answer that question.
 
@BenjaminGruenbaum oh .. I have been reading that link .. I understand the ideas .. I mean I think I can make basic implementation with Rx .. like for say streaming search result from wikipedia or any api .. but I am thinking that how it is implemented .. at first I thought Promise , but then Promise is a one time thing ... here its like a publisher subscribe like thing
 
Excuse me don't mean to be a dick, but weren't you learning exactly this last year as well?
overexchange
There was a guy here last year, spamming us with an old MDN page which he filed a bug against trying to warn everyone to not read it until it gets updated.
 
Currently, I am learning about instanceof operator. That bug is yet to be fixed.
In class based paradigm(in java) I understand the meaning of instanceof
 
this ain't no java ..
 
8:28 AM
What is there not to understand about instanceof
!!mdn instanceof
 
^ All you need to know.
 
I guess instanceof is same is both places ..
!!> function User() {}; var user = new User(); console.log(user instanceof User);
 
@shortCircuit "undefined" Logged: true
 
8:29 AM
javascript is 1/cos(c) !!
 
@overexchange lmao
 
.___.
 
omagad
lp *.pdf
sends all pdf to my printer
 
so?
 
so good
no need to start some pdf program to print my stuff
or opening files explorer for some random contextual click bs
 
8:38 AM
please tell me how to make stream with simple javascript .. what is the idea behind it..
 
@shortCircuit Not exactly. For starter, the user object in your case does not inherit from the User function object - User is not on user's prototype chain. Whatever changes you do to User won't be reflected in user, despite instanceof reporting true.
 
oh .. yeah that makes sense
 
You can't actually do "changes" to User...
 
hello
 
but the mdn examples of instance of were straight forward ..
 
8:45 AM
@AwalGarg Well, you can set User's properties. In Java we call them static properties, and they can be access through user (although it is discouraged).
 
Guys idea for an npm module
 
wait wait .. it says that The instanceof operator tests presence of constructor.prototype in object's prototype chain. .. so user.constructor.prototype does point to User ...
 
Want your help brainstorming
Given module a.js and b.js, I want a module that will act as proxy in between, and allow them to exist on different processes and even machines
For example:
// from a.js

import { clientify } from 'remotify';
import * as b from 'b.js'

let bProxy = clientify(b, 'remote.host', 1337);
let result = bProxy.methodOnB(); // send request for method execution on 'remote.host:1337'
What do you think?
On the other side:
 
You won't be able to implement referential integrity
 
@shortCircuit Yes. And it's quite...fun? Instead of having one object as the prototype of another, you have an object as the property of a function that is inherited by no one and then test whether the tested object's constructor property's prototype property is on that object's prototype chain.
 
8:50 AM
import { serverify } from 'remotify';
import * as b from 'b.js';

let server = serverify(b).then(() => console.log('b service up!'));
@AwalGarg No, because JavaScript doesn't have interfaces.
I got this idea from Java's remoting.
Which says that if you object implements an interface, you can implement a proxy for it on both the application and service side, and your code is unaware of there even being a service in between.
 
let result = bProxy.methodOnB() <-- this itches me. Either the request goes synchronously, which is... eww. Or it returns a promise?
 
morning
 
@AwalGarg Right, this is one of the problems I've thought about
 
This article series should explain, with good diagrams, the differences. It almost look like two different languages.
https://davidwalsh.name/javascript-objects
 
If b.methodOnB() is sync, that contract needs to be maintained.
 
8:52 AM
Hello
 
@nkoniishvt 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.
 
@Neoares morning~
 
ok looking
 
The point is that all of the calls on bProxy are identical to b
 
@MadaraUchiha You can't keep up the contract, because it can also fail in other ways (connection lost, for example)
 
8:54 AM
@MadaraUchiha and that is like 50% of the methods IRL. If we do maintain the contract of synchronicity, then delegating to a remote doesn't have much merits.
 
So if the original method is callback based, the proxy needs to be one too. If it returns a promise, so does the proxy, and if i returns a value synchronously, that needs to be maintained as well.
@AwalGarg Hot-swapping
@copy In which case it throws.
 
Hot-swapping can be implemented in better ways.
 
@AwalGarg Example?
 
crl
at a lower level maybe, you'd sync files between hosts
 
@MadaraUchiha Basically, you design the module to be hot-swapped keeping in mind that it could be hot-swapped at some point. You make good use of enclosing objects etc.
 
8:56 AM
I'm sorry to ask this here as I know this is not topic-related to this room. This is a router configuration question. I have two computers on two different networks. The router between them is a TP link nano n. I only configured a router once and from what I remember I need to add interfaces for each network on the router but I didn't find anything useful in the router interface. Is the router able to fix my problem?
 
@MadaraUchiha You won't be able to marshal all values
For example closures, or sockets
 
off-topic: do you know if it's possible to watch 360º videos on mobile browsers? (not youtube app)
 
@copy this as well
 
ES might have Structured Clone Algorithm builtin in future, but again, that won't be able to transfer IO bound interfaces.
 
8:58 AM
you can also watch this on youtube app, and it's awesome
but we need to run that shit on mobile browsers, and I don't think they are ready to it
 
@MadaraUchiha it is an interesting idea to be implemented anyways. Just that the target won't be userland code, it would be library authors who will ensure they don't use it in silly ways.
 

« first day (1878 days earlier)      last day (3061 days later) »