« first day (2139 days earlier)      last day (2810 days later) » 

8:00 PM
I never type www. I always assume the forward it
occasionally I run into this problem
 
!!afk It's all broken!
 
That's as bad as not having a home page but having subfolders in the domain, I hate when sites do that
 
@BenjaminGruenbaum just tested and right you are.
 
> new from PBS Spacetime: Should we build a dyson sphere?
YES! YES WE SHOULD!
 
// This is the entire code you need in order to make NodeLists iterable yourself
NodeList.prototype[Symbol.iterator] = function*() {
    for(var i = 0, l = this.length; i < l; i++) yield this[i];
};
@Vap0r ^
 
8:05 PM
NodeList.prototype[Symbol.iterator] = [][Symbol.iterator];
 
If you're optimistic Symbol.iterator in arrays - that works ^
 
I just ended up using an indexed for loop since I'm not optimistic about any of that lol
I liked for..of but like almost everything from ES6 that I like it seems like the support is just shite.
 
yeah, cause it's pretty new
not even a year old (you can tell from the name)
 
ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262. It was based on JavaScript, which now tracks ECMAScript. It is commonly used for client-side scripting on the World Wide Web. Other implementations of ECMAScript include JScript and ActionScript. == History == The ECMAScript specification is a standardized specification of a scripting language developed by Brendan Eich of Netscape; initially it was named Mocha, later LiveScript, and finally JavaScript. In December 1995, Sun Microsystems and Netscape announ...
That seems to say that it's over a year old.
I could have sworn they had been screwing around with this for at least a year and a half.
 
8:08 PM
parts of it
 
I just read the spec for Array.prototye[Symbol.iterator] and while it doesn't have the fun "This method is generic" note - it should work.
 
Most of ES6 had implementations before the spec shipped.
 
the various features get proposed, implemented, and standardized individually
 
Admittedly I mostly remember the class based stuff. And what's the deal with ES7? We have shite adoption of ES6 and they are already saying 2016 is the year of ES7 with only 4 months left of it?
 
hell, no one supports import yet
it is finalized for almost a year now
 
8:09 PM
Chrome supports import and everyone is using import.
I think most browsers have import implemented, the problem is the module loader
That spec isn't done yet.
 
Finalized june 2015
 
can anyone reccommend any array/object to CSV lib ?
 
@Vap0r ES6 has 100% support in modern browser except parts they can't agree with like generator return and tail recursion.
 
@BenjaminGruenbaum nightly? stable lists it as nonsupport
 
@BenjaminGruenbaum is for..of part of ES6?
 
8:11 PM
@Vap0r The fact the code I mentioned doesn't work in Edge isn't ES6, it's about the DOM which is the spec of how you interact with the document (your HTML)
NodeList isn't implemented in JavaScript nor is it supported in a lot of JS environments - like Node - it's a part of the DOM.
 
So for..of would work on an array in javascript?
... in edge?
 
The DOM has iterable NodeLists for a shorter duration, and implements take longer with it.
@Vap0r yes, it would, and in fact that's how rlemon polyfilled it -by just telling it "behave like an array".
@rlemon the import syntax is built into engines, actually importing other stuff is out of scope for the spec and it's in the module loader spec. The JS bits are done.
 
[] and Array are interchangeable or no?
 
not really.
not 1:1 at least
 
Node even has an almost-done proposal for it and there was a huge .mjs debate a while back - now the standards body (ES) is making subtle changes to promise you'll be able to easily determine if a file is a module or not - so we won't have to compromise on .mjs files.
@Vap0r [] is an empty array literal, Array is a built in function - Array(3) creates an array of size 3 and no elements - [3] creates an array with one element - the number 3.
 
8:17 PM
Alright cool I appreciate the help.
 
@rlemon import exists, but not its integration into the host platform, which is far less mature
 
for all intents and purposes it doesn't work, therefore it is pointless to say "but it exists!", however I see your point.
 
oh wait @BenjaminGruenbaum already said that :)
 
@rlemon well - you can't really be surprised we're being nitpicky a-holes on the internet :)
 
8:25 PM
I think you need to be overly pedantic to be a good programmer :P
ugh, company sells me a 'multi-touch industrial all-in-one computer' but has no multi-touch drivers. offers an arrangement of OSs of which Linux is possible so I get them to load 64bit ubuntu ---- three different models.. none have multi-touch drivers working and all randomly freeze.
like old school freeze. pc unresponsive, screen stuck at last position.
quality.
 
That's oldschool?
 
stop using OS's with < 1% user share
 
@Loktar make windows smaller
 
what do you need it to run on?
there is a build for rasp pi even
win 10 isn't too large
 
tbf the reason we don't go windows is because all of the software would have to be re-written
they attempted to do a windows port before my time. they got like 60% into it and decided not worth it
 
8:31 PM
oh is this an embedded system or something?
 
yes
 
I assumed you were talking about a laptop
 
nahh, embedded system
 
ah well nm then :p
 
but we're trying to make the move from embedded board with an external display to an all in one touch deal
I'm just bitching. the turn-around to get the hardware isn't quick, so when I keep getting shit that isn't what was advertised ... ugh.
 
8:33 PM
Would there be anyway for me to allow a web application command line access to linux kiosk client?
 
why would you want too?
 
@Vap0r yes but they're all bad
github.com/sourcelair/xterm.js is what you're looking for
 
Because the kiosk clients connect to a web interface for management. And the environment, other than the kiosks is all windows.
 
@ssube github.com/chjj/tty.js isn't bad
@Vap0r ssh into them
 
So I would like to have a couple of common device functions stored as scripts (restart, screenshot and transfer, etc)
And be able to execute them at will.
@rlemon this is how I currently manage them. Management wants a way to control them that they can understand without my help.
 
8:36 PM
@rlemon I know, I'm planning on using it. :D
 
so they want you to introduce a security concern so they can be lazier?
 
//have been screwing around with blessed
 
@rlemon yes
I work in government.
 
@ssube then y u say all bad?
 
react-blessed?
 
8:37 PM
@Vap0r makes it even worse.
 
@rlemon well, the setup of letting a browser control a remote machine is bad
the libraries to do it with are sweet
 
you can exec stuff in node. setup an endpoint (behind auth I hope) and have them hit those
let nodes child_process.exec spawn the process you want
@ssube ahh, agreed.
I had to use it for some crazy proxy situation from qnx => linux => windows
qansi (qnx ansi) is fucking weird.
nothing would display it
 
as part of my game project, I'm gonna put together the dialogue system before the actual visuals, then throw blessed in front and make a text adventure engine, I think
 
dialog? I hate reading.
 
dialog ue
 
8:42 PM
oops
 
and I also hate reading, so...
but it seems like a nice, isolated part of the game to test
 
I'm sorry got called away for a second. But what's wrong with letting the browser of an owned-machine manipulate the owned-machines OS?
 
convert it to a desktop app
 
why?
When anyone else asks how to do something that you can't do in a browser, we say "use a server for that part". this is no different except that the server process may need higher level access to do some tasks (like restart). That is the risk, right there, not that it's a web app
@Vap0r you risk is "yet another vector for someone else to execute code you don't want them to execute".
 
if you convert it to a desktop app, you no longer have an http server sitting there with end points that could cause harm if ever exposed to an open network.
 
8:47 PM
only listen to localhost, use some auth, etc.
 
@Luggage any problem with using SSH.NET to do everything then?
 
where does that fit in?
 
Training Day 1 complete
Status: fuck
 
er.. is this not the same machine as the web site?
 
@SterlingArcher KING KONG AINT GOT NUFIN ON ME
 
8:51 PM
Hello!
 
@Luggage we have RPi's in our environment. They are used as read-only web kiosks (no way to use keyboard/mouse)
 
right.. so.. same machine or not?
 
Same machine
 
Benjamin: Should we take it here or private? If its okay, here is fine
 
8:52 PM
so the machine just needs a "button" in the website that can reset itself only?
 
they want an interface to send commands to their rpi from a web console on an intranet?
 
Yeah pretty much, we have a management interface meant for choosing what displays on each kiosk, I want to add basic functions to this management interface
(like restart)
 
@Oleander Here is fine, I don't really understand the issue you have with using then
 
who has access to the management interface?
 
ohh, so it's NOT the same machine
why did you say it was.
 
8:53 PM
like you can totally do this, but it is a potential risk.
 
yeah, that throws desktop app out the window
 
we're just trying to enforce that idea
 
@Luggage I thought you were asking if the web kiosk was the same machine that I want restarted
 
if the management ui already controls the kiosks, you must already have some communication, right?
 
8:54 PM
import {exec} from 'child_process';
exec(command, (stderr, stdout, err) => { // argument order might be wrong, I never remember.

});
 
@Benjamin: I'm trying to determent if an Object is a Promise or not. Just checking the existence of then wont ensure it is.
 
Upon boot the device opens a browser fullscreen to the management site at something like mgmtsite/connector.html?MAC=<MAC>
 
or does it control a server the kiosks all get pages from?
ohh, gotcha
 
@Benjami
 
@Luggage that's the communication
 
8:54 PM
@Oleander define: promise .
 
Opps
 
but really.. make sure security is top notch if you are allowing this
 
but the same security risks as anything else..
 
@Vap0r so no authentication?
 
But yea.. treat it like it was exposed to the internet even if it's not. That means making sure that all the parts communicating are up-to-date with security pathches, you authenticate, etc.
 
8:56 PM
@rlemon for the RPi's, no, but that's by design
 
...
 
@rlemon for the mgmt interface, absolutely.
 
because it's a vector for attacks
 
Windows Auth
 
@BenjaminGruenbaum That's a good question. A lib that implement a superset of the offical  Promise spec.
 
8:56 PM
@Vap0r but the rpi's are the ones with the endpoints I can hit
 
not yet
they only request pages from a server
 
@rlemon how are you gonna hit it?
 
@BenjaminGruenbaum Second try would be; an instance of Promise
 
@Vap0r he may mean that they'll have an enpoint after you give them the ability to accept reset requests
 
^
 
8:57 PM
> Japanese Father Kills 12-Year-Old Son For Not Studying - r/nottheonion
well damn
 
That's why I want the JS to do it all
 
so, you have an rpi that basically opens a web browser and navigates to a page. you want a separate management page to be able to restart and perform other similar tasks on the rpi?
 
that way instead of having an endpoint to hit you'd have to MITM and hijack a response
And if it's whitelisted script files instead of arbitrary commands...
Then hijacking it wouldn't really help you... at all
 
that can't be your only security.
 
then write bash files that ssh the commands to the rpis and have those exec'd from the mgmtsite software
and make sure there is at least some key based security in place
 
8:59 PM
@Luggage it isn't but I really would have to understand the nature of your attack to say that there is much vulnerability going on.
 
@Oleander right, but which promise spec? The Promises/A+ specification defines that promises detect each other by using then and so does the ECMAScript Spec (step 8)
 
It's the attacks you don't understand that are the problem. They may exploit a fault in openssl or nginx, or IIS or apache before it even hits your code
any open port is a hole to put bad things in
 
@BenjaminGruenbaum Of the bat; ECMAScript's version
 
@Vap0r if there is the ability to send updates to the rpis, you have a security concern (not a problem, but a concern)
don't ignore it
 
@Oleander it's 7, ES2016 which is the last version from last July
 
9:00 PM
if those updates execute actual commands, that concern is now greater.
 
and if the process needs elevated permissions to do things like reboot, then.. danger.what OS was this?
 
@Oleander If you want to detect what's a promise based on it behaving like one then checking then is the only viaable choice - but it is often much better to just Promise.resolve whatever it is you're getting.
 
2 mins ago, by rlemon
then write bash files that ssh the commands to the rpis and have those exec'd from the mgmtsite software
I think this might be the best solution that still keeps in line with your approach tbh
 
yea..
 
but I'm off
 
9:01 PM
Raspbian
 
!!afk home thyme
 
sorry.
 
@BenjaminGruenbaum woah, they restyled the spec
 
is that a linux flavor? can you already access it via ssh?
 
Yes I can access it via SSH.
 
9:01 PM
@Zirak yup, much easier to use now.
 
@Luggage debian for rpi
 
^
 
... or you could just use freebsd
 
ok, then yea.. ssh. you already have everything you need. lemon is right
 
Especially the fact there's a "search" feature @Zirak
 
9:02 PM
It's actually usable now
 
make a "management" account and put just the whitelisted commands in your sudoers file (on each rPI)
and still use key auth.
 
@BenjaminGruenbaum So what you mean is that; the spec doesn't allow the to verify wherever an object is a promise or not so the only way is to test one part, i.e .resolve and hope that the rest works as well?
 
Dumb question - what's the problem with elevated permissions in RPC if he controls what's on the network and can communicate in an encrypted manner anyway? @Luggage
 
@BenjaminGruenbaum dumb question, but what he said.
@Luggage
 
this was from when i thought he was trying to expose a node server
also.. i wasn't one that was screaming "omg no!"
 
9:04 PM
@Oleander not at all, I mean that Promise.resolve and a lot of other spec items already use then to test these things - so if you use Promise.resolve(maybeAPromise) in your code it will automatically return a promise that resolves to the internal promise's value anyway if it's a promise and just the value itself if it's not.
 
Lol fair enough.
 
Does SO's chat support the IRC protocol? Would like to use my regular client instead of my browser.
 
@Everyone. I'm out.
Appreciate the help yet again @Luggage
 
@Oleander Nope. They covered that in the FAQ.
 
@Kendall Yeah, read that a few pp had tried, but wanted to check just in case
 
9:06 PM
You could theoretically build your own client
or even write an IRC adapter
 
Textual, my client, doesn't seam to support XMPP,
@BenjaminGruenbaum You just introduced the halting problem :) If the passed promise isn't resolved, then I would never know
 
User interaction in a nutshell
 
@BenjaminGruenbaum I think it's better if I give you some context. Just a sec
 
@Oleander If the passed object has a then that is a function but behaves in a way that is not like the regular then - then in that edge case I've never ever seen IRL - that can happen.
I've never seen this in 3 years of bluebird and in 2 years of speaking in conferences, passing workshops and writing promise related code for bluebird, Q and Node.
 
@BenjaminGruenbaum I'm building a logger that intercepts calls to objects using Proxies in ES6. So obj.sayHello("Linus") would yield "obj.sayHello('Linus') => 'Hello Linus'";
 
9:12 PM
@Oleander Ok, not sure why that's exclusive.
 
@BenjaminGruenbaum trying :)
@BenjaminGruenbaum In those cases where the function returns a promise I would instead like to intercept the call and print the resolve value instead of the return value. That is; "x = obj.sayHello('Linus'); if x.promise? then x.then( print result );";
otherwise; 'print x'
/s/trying/typing
 
Right, so intercept a then call, and in that then call print the value inside the then.
 
@BenjaminGruenbaum Then I need to know if it's a promise
 
if(propertyName == `then`) { // in the function trap
  return Promise.resolve(this).then(x => log("Got", x));
};
No other objects have then functions in JS code in the wild.
 
var x = {then: function() { ... }}; <= that one now does
 
9:15 PM
It's theoretically possible, like it's possible to set this.toString = null, or setting myFn.call = "cat".
@Oleander what about {{toString() { throw 15; }}
Or {{valueOf() { while(true); }}?
 
There's nothing that keeps anyone from adding a then to an object, which makes checking the existence of then not relaible
 
@BadgerCat is it one per customer?
 
@Oleander There is nothing that keeps anyone from adding toString to an object but that doesn't stop you from printing it to a log which converts it to a string.
 
if an object has a .then() that is not because it's a promise, it's at risk of being called by Q/Bluebird/etc already, right?
I mean.. this isn't a unique problem.. is it?
 
@Luggage yes, and by native promises too.
It's not a problem at all, it's structural subtyping.
 
9:17 PM
@BenjaminGruenbaum Disproving something else doesn't make the original argument value :)
 
Like how Array.prototype.map works on NodeLists.
@Oleander I said there are no such examples in the wild, creating a synthetic one doesn't prove anything.
Just because people can write weird code that triggers odd behavior doesn't mean they do. No one does var undefined = 15 or #DEFINE true false in C++.
 
And the reason he can be so sure that they are rare in the wild is that they'd break existing shit.
Anywho.. your test for a promise should only be one block of code you can revisit later if it becomes a problem.
 
jQuery safeguards against shit like that.
 
@BenjaminGruenbaum But they could, and they do. I mean, I understand what you mean. A user shouldn't implement then on a random object, and I agree. But that's not the reality.
 
I totally get the desire to "be sure", but since everyone else just uses the presence of a .then(), then that becomes the right way, even if it wasn't the spec.
Which it is.
 
9:21 PM
@Oleander by all means - show me a counterexample.
Bluebird has ~10 million downloads, Q has ~7 million - native promises are everywhere - no one is complaining about bugs caused by this.
 
to be fair.. about 100 of those d/ls are me. :)
 
@BenjaminGruenbaum var x = {then: function(...)};
x is not a promise
Thus disproving the premise
@BenjaminGruenbaum Just a quick note,
 
@Oleander "that's not the reality" implies there are users who do this.
 
I don't think anyone is denying that it COULD be fooled, just that it's highly unlikely and that there isn't a more reliable test anyway.
 
@Abhishrek another book recommendation, since you enjoyed Machiavelli: goodreads.com/book/show/1303.The_48_Laws_of_Power
 
9:25 PM
@BenjaminGruenbaum I ment to say that it's possible.
 
Right, and a lot of things are possible but will never happen. It is possible an opossum will be the next vice president - but it will not be the case.
 
hopefully not.
but I fear..
 
@Luggage Yeah, and I think I've to expand on checking the existence of functions that should be there right now as there doesn't seam to be a more relabile (spelling?) way.
 
It's like for so many years you'd have to tell people to stop doing:
 
other functons you expect on a Promise?
 
9:27 PM
(function(window, undefined) {

})(window)
@Luggage I'm not sure I'd assume that, a lot of other stuff is still promises. Checking for then is standard, like toString or valueOf.
 
i think only a .then() matters. Anything else like .catch() is just fluff
 
Yup
Checking for more things would also not work on non-native promises which are very common.
 
even checking argument length is probably no good
 
@BenjaminGruenbaum My problem with your answer was that it looked like an deduction proof. The existence of .then on object will result in object being a Promise. What you ment is that it's likley, that object is a Promise as the community doesn't implement these randomly, which is an induction proof
 
damnit.. the website i am trying to order food from keeps pegging the cpu ad 100% and not responding
I am going to starve.
actually he said it was in the spec.
 
9:31 PM
@Oleander if you read my answer, it doesn't actually say that - it says that you can run the Promises/A+ suite on it - but that's unnecessary.
 
> "I want be be 100% sure." "you can't, but there is an easy test that'll get you to 99.9%". "I want to be 100% sure." :)
 
@BenjaminGruenbaum Did you refere to this "If it has a .then function - that's the only standard promise libraries use." ?
 
@Oleander no, read the answer until the end.
 
@Oleander What are you doing with proxies? I find that part way more interesting.
some sort of code-generation from js?
 
@BenjaminGruenbaum Just a sec
@Luggage I'm trying to log the call stack in an application during testing. I currently have a deadlock somewhere and the current trace wont tell me much so is implementing something of my own using ES6 decorators (@log) and proxies
 
9:36 PM
whew, it works in safari. I get to eat today
 
@Oleander If you use bluebird you can use monitoring to keep track of pending promises.
 
oh. huh. using a pro.. yea, what he said
also long stack traces?
 
@Oleander wait, I have an idea - add process.on("unhandledRejection", e => { throw e; }) and see what happens.
 
@Luggage The output looks something like this: i.imgur.com/BWvDxp1.png
@BenjaminGruenbaum It will show me X lines of unrelated function calls
*show me
 
@Oleander give it a shot, if you use native promises and don't do this - you're living in a world of pain.
 
9:42 PM
@BenjaminGruenbaum Actally, my code implements .then on a non promise
 
@Oleander oh god, why?
 
Not sure why I didn't say that before
 
Maybe that's your problem. :)
 
To make a long story short, I'm implementing transaction functionality for multiply asyc operations which requires me to make promises lazy. I'm doing this by implementing a proxy around the Promise library and defining what functions that will invoke the lazy promise. I.e promise.timeout(x) will return another lazy promise while promise.fire().then invokes it
 
@Oleander :O
@Oleander do you realize how much timing issues that can cause and code it could break?
 
9:48 PM
rabbit hole. if it wasn't clear.
 
@BenjaminGruenbaum Do you know how much problem not implementing this will cause :)
 
If you want to run async operations in batch - you could do Promise.setScheduler and bluebird and tell it to schedule everything on whatever terms you want - but taking control of execution timing from the code itself is a recipe for bugs.
@Oleander you can't make this work by breaking then because that will break how code is ordered.
 
@BenjaminGruenbaum I looked at setScheduler last week when starting this, but I came to the conclusion that it wouldn't solve my problem in particular
@BenjaminGruenbaum What do you mean by execution?
 
@Oleander well, overriding then surely wouldn't either.
 
@BenjaminGruenbaum Why wouldn't it? I've 80 tests that verifies the impl.
 
9:53 PM
@Luggage this better not awaken anything in me
 
If you want to be 100% sure run the test suite :P
 
Jay
yo
 
Note that this doesn't effect the global Promise
*global
 
anyone in here use react-griddle ever?
if so.. know how to do computed row data?
 
@Oleander oh, so only promises you got? Then why not just then them and only project the result when you want to?
 
9:53 PM
@rlemon why, do you have a thing for women that are physically unable to say no?
 
For example combining 2 properties, lastname + firstname
 
@Luggage I'm looking at red eyes over to the left ;)
 
@BenjaminGruenbaum Not sure what you mean, could you elaborate?
 
@Loktar did you try passing a function in and not a value?
 
@BenjaminGruenbaum it's worth a shot
thanks
 
9:55 PM
@Oleander you only attach the thennable objects in the code that receives the log? As in only inside the proxy?
@Loktar suer
 
otherwise I guess I have to pass a custom component
 
user1596138
@Loktar why don't you just pass it firstname + lastname?
 
user1596138
lol
 
user1596138
Ohhh right hahaha
 
@BenjaminGruenbaum The logging something generic and is suppose to work on any object.
 
9:56 PM
@Luggage fact that you thought it might be necessary to explain this makes me sad
 
@Oleander right, and if it has a then why not pass it a function and see if you get the value and if you do - print it wherever you want?
 
user1596138
It's dynamic
 
Oh yeah wouldn't that "just work" with passing the value?
 
@BenjaminGruenbaum That would introduce the halting problem. What if it doesn't return anything? Then I should have printed a line before calling the promise
 
@Oleander Print the line and replace it with the promise if it ever resolves?
 
9:59 PM
@BenjaminGruenbaum I did that at first, and sure it works, but I would like to avoid printing unresolved promises.
 
Why? Wouldn't that be much better than showing nothing anyway?
 

« first day (2139 days earlier)      last day (2810 days later) »