« first day (2414 days earlier)      last day (2526 days later) » 

12:05 AM
im really enjoying hackerrank
 
@monners what's a build chain?
 
I like the green completion text when i finish a challenge.
It helps keep my existential crisis at bay
 
@Julix it's an environment that handles things like compiling sass, minifying code, running a local server, etc
>!!google webpack
 
@monners I've heard of webpack, but hadn't heard the expression "build chain" -- npmjs.com/package/build-chain is that it?
 
nah, its more of a concept
think about it as a set of tools and processes that uhh 'compile' your code to get it ready for the browser environment
or wherever you want to deploy it to
so for example, in the browser, you want to deploy minified code so that response times are quicker. however you cna't dev in minified code
so you dev in the non-minified code and one of the steps in the build chain will be to minify your code
 
12:23 AM
That's what my first guess was, but I figured it might mean something really specific... - currently I'm using "compass watch" or "compass compile" in ruby terminal to trigger compiling, because there aren't really any other steps (I'm not minifying the code at this stage, since I'm still developing,etc.)
what's the category of tools called that webpack is a part of?
 
a bundler?
It's not a compiler (but it is almost always used WITH compilers).
It's also a 'module loader'.
 
12:40 AM
Anyone use an Iframe with a HTTPS site calling an Iframe with HTTPS content from an outside server. (would that cause cert problems?)
 
12:58 AM
for this grammer:
y <= e and b or a should be parsed as Formula(y, Or(And(e, b), a))
right?
rather than Formula(y, And(e, Or(b, a)))
 
1:17 AM
is it y <= e && b || a
or is it
y <= e && (b || a)
though if Forumala is at the front, aren't you comparing y with the second argument?
ie in your second example
y <= (e && ( b|| a))
 
 
2 hours later…
2:55 AM
Hey all, can anyone help me with stackoverflow.com/questions/44192782/… ? Just trying to work out how to write a module that can be used with NPM or directly in browser.
Googling is a bit overwhelming, with a lot of references to AMD, RequireJS, CommonJS, UMD...a lot of historical problems which I don't think apply to me. And solutions seem to be "Use Browserify" or "Use Babel" which aren't really specific enough to help me.
 
I cant help you
but I do know that feeling
there's a lot of js things out there lol
 
i'm throwing this suggestion out here but i'm not entirely sure of the answer
what if you use es6 and then transpile to umd?
let me see if i can play around with this a bit
 
sure, how would you set that up?
is what I'm doing so strange? I'm writing a little plugin that will likely be used by people without much dev ability, so using NPM is way beyond them
 
what if you hosted the library externally and then told ppl to c+p a script tag with the url pointing to the external url
then, inside the code, you'll have your relevant document.ready handler to run when the dom is ready
and everytime you make a new release, you can upload your new 'web' version to a different url
or cdn
and you can gnenerate your web version via a compile task or something of the sort
i uhh hope i'm making sense
 
3:11 AM
@derp Why umd?
 
my thinking is that umd might be neccessary if you want to use it in a codebase not set up to use es6
 
Uh, it has nothing to do with ES6.
 
es6 modules?
like if you had an old node version and you wanted to simply require the library
i'm not too sure myself, so happy to be told where i'm mistaken
 
Node supports es6 modules now?
@SteveBennettㄹ Are npm and browser your only target platforms?
Is your code written in ES6? Does it make use of es6 modules?
What about dependencies?
@derp You can write your library in UMD.
 
it's written in ES6. I don't think ES6 module support is good enough yet though.
this particular module has no dependencies
npm and browser are the only target platforms
@littlepootis what does "write your library in UMD" mean? include a big header at the top of each file?
 
3:25 AM
@SteveBennettㄹ kind of. Take a look at this ^
This is a template.
 
can;t you just use webpack and set the output target to umd?
its much nicer than including that big header in all your nice source code files
 
You can require it in node, or <script src>
 
@derp well maybe, but I'm not using webpack currently, so "just use webpack" isn't exactly trivial.
 
webpack v1 seems to support targeting umd.
 
what are 'rofl', 'lol' and 'lmao' meant to represent in that template?
 
3:29 AM
rofl is the name of the component as a string
lol is the root, usually "window"
 
gee, clever variable names
 
and lmao is the function that's "exported".
 
Hello everyone.
I have a library I want to use both on NPM and client sided.
 
hmm, I think maybe I can just use the middle part of that template down the bottom of my module.
 
3:32 AM
In my source I use the following code I'm using to export if on a node env.
if ((typeof process !== 'undefined') && (process.release.name === 'node')) {
    module.exports = VueLocalize;  // # export for node use
};
 
so I define a function, and at the end go if (module !== undefined) module.exports=myfunc; else window.mymodule = myfunc
 
@SteveBennettㄹ was that directed to me?
wait I'm stupid
 
@neet_jn Don't detect the environment, just check if it supports commonjs syntax.
 
Word, thank you!
 
4:02 AM
 
Anyone here with Casperjs or nightmare experience?
 
@archae0pteryx Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
4:19 AM
@Neil That's very nice of you.
 
 
2 hours later…
6:40 AM
@archae0pteryx ive played around with nightwatch?
 
@ZhengquanBai I try.
 
Gay marriage is getting approved in Taiwan.
 
Glad to hear it. I could never really understand the rationale behind preventing gay marriage honestly
 
most gods seem to be wierdly interested in very personal aspects of individual lives..
 
7:17 AM
It's not the marriage itself we're longing for in good earnest. It's something that comes with marriage, things important for a happy life, things signifying equality, that really matter.
 
@ZhengquanBai awesome
@suraj like the things people do when naked
 
@littlepootis could be included in personal aspects
 
user7627726
/cat
 
user7627726
only works for java room i guess :(
 
7:46 AM
Apparently gods tend to have a say so on what we should be wearing and whether or not we should be eating pork on certain days.
Very strange fellows indeed
 
8:08 AM
gods are also very, very interested in you specifically, whether it be watching over you or judging you
 
They're particularly fond of the judging
 
8:31 AM
i have a question, could someone answer it? stackoverflow.com/questions/44196196/…
 
@OiRc You should debug
That question should (and probably will) be closed
 
@OiRc break it into bite-sized pieces and verify each one in the order it gets executed.
I can't say what's wrong by looking at it anymore than you can
 
8:48 AM
Anyone doing react here? Can anyone demystify what this.props.getComponent() does in a react component?
I couldn't find it in the docs...
 
getComponent is not an api provided by React.
gotta be a property you passed yourself
'this.props.children' is the only property you can get for free from react.
 
9:24 AM
If you want anything else, you'll have to buy React gold edition
 
hi
How can I watch a lvl deeper for SCSS changes (Gulp)
A) styles: './src/css/*/*.scss',
B) styles: './src/css/**/*.scss',
C) ;p something else?
My Gulpfile.js so far: https://gist.github.com/duikb00t/9d5b64dd9636b778a30459d5013ef0aa
Answer B was correct.
 
9:45 AM
I am getting this while running Zirak bot
phantom stdout: https://raw.githubusercontent.com/Zirak/SO-ChatBot/master/master.js:1209 in complete

phantom stdout: [object XMLHttpRequest]

https://raw.githubusercontent.com/Zirak/SO-ChatBot/master/master.js:1209 in complete
 
9:56 AM
@All hi.
 
1 message moved to Trash can
@SamSam Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
i have an array object that i need to compare in a if statement
like
if(a==arrayofStrings)
{

}
 
Avoiding half-open connection when using WebSockets, how would you check that? RFC-6455 mentions ping/pong frames. I'm wondering if I should establish it in both client and server.
In server is pretty clear - track already closed clients and kill 'em. In client for the same reason, but I'm not sure it's must-have.
 
@RoyMiloh I've been using WebSockets for years and I have never seen myself faced with this issue
 
@SamSam a.every((e, i) => e === arrayOfStrings[i])
 
10:11 AM
@OliverSalzburg Really? how have you detected (abruptly) closed clients?
E.g. network closed unexpectedly (by closing the wifi / out of range for instance).
 
Might want to check lengths too, as this wouldn't work if a were shorter than arrayOfStrings
 
@RoyMiloh When they disconnect, the library emits an event
 
@OliverSalzburg Not always. It's TCP. As long as FIN is not received in server, the socket in server will be open.
 
As I said, I have never seen an issue like that in years of experience with the technology
And in the years of experience with generic TCP/IP sockets, I have also never seen what you're referring to
Which doesn't mean it's not possible in theory
But it definitely never affected me to a degree that I had to worry about it
 
telnet google.com 80 and close wifi, socket is still open. :)
 
10:20 AM
@RoyMiloh True, because I'm connected through a wire
 
Nah :)
 
in tcp you're connected until there's a FIN or a timeout
 
And I'm not going to prove to you that disconnecting my NIC will close my sockets right now ;D
 
Anyway, it's a common use case in WebSockets (imho). Phone is out of range - network closed - server is not aware.
 
There's nothing inherent in the socket which gets closed
 
10:26 AM
We use socket.io and Fleck as client libraries in our stack. Maybe they implement some mechanisms I'm not aware of, but I never had to care about connection state tracking any further than handling the events those libraries provide
And we use that primarily to actually track the connection state of users
 
yeah there's the concept of keep-alive packets in many implementations
 
They prbly implemented it internally.
 
If you send so many keepalives in a certain time frame and get no response, you consider the connection closed
 
IIRC, we use Fleck as a server-side with plain old new Websocket() on the client side though
 
websockets have ping/pong
 
10:28 AM
@Zirak Cool, that's what I'm doing in server side and it works well. My question is, should I make this mechanism in client side as well?
 
For both keep-alive and track disconnections in client side.
 
@RoyMiloh I don't quite follow? TCP does it for you
 
Then those ping-pong frames from that RFC might refer to something that is already in the standard implementation
26 mins ago, by Roy Miloh
Avoiding half-open connection when using WebSockets, how would you check that? RFC-6455 mentions ping/pong frames. I'm wondering if I should establish it in both client and server.
Not something you have to add explicitly
 
@OliverSalzburg It has ping/pong but they are not sent automatically iirc.
@Zirak TCP does it for me? not sure I understood.
Does what?
 
10:31 AM
"establish it"? I don't quite get that. websockets have that inherent in them. A conforming websocket implementation answers pings with pongs
 
@Zirak seems to be much better suited to answer these questions :D
 
Just like you don't have to handle ACKs and calculate frames, since that's in the network stack, you don't have to implement ping/pong
 
Isabelle/HOL for JavaScript/Typescript?
 
@TomR Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
@Zirak I'm pretty sure you're wrong :)
TCP has no keep-alive mechanism, by spec. HTTP has, but I can't use it of course.
 
10:34 AM
@RoyMiloh If a websocket implementation doesn't answer ping with pong, it's not a conforming websocket implementation
@RoyMiloh Sure it does. Most tcp stacks have keep-alives turned off by default, but it's a fairly established concept
You send an ACK with no data
 
@Zirak It's not by specification, it's a way to detect if it's still alive. Application level.
 
@RoyMiloh For you it's a setsockopt though
I don't remember the exact flags but you're not doing the send/recv on these null packets, you setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, 1)
 
@Zirak Maybe. But I'm behind a HTTP proxy so I guess it won't work anyway.
 
@RoyMiloh that's a different matter, definitely
 
I should have said it before, sorry.
I'm now using uws, it offers ping and on.('pong', ...), so I'm using it.
And again, it's not clear for me if I need to maintain the same mechanism for client.
For keep-alive and disconnection matters.
There's an open "bug" in chromium on this issue: bugs.chromium.org/p/chromium/issues/detail?id=706002
 
10:46 AM
ohhh yeah, I forgot browser websockets can't send pings
 
Yeah, another thing :| but that's fine, I just send "ping" message or smth like that.
 
hrm, that really sucks
 
@Zirak Dunno, I can live with that. Wdyt on this solution (when it's known there's no native way :))?
 
Pretty simple and straightforward so it's fine
 
So sending ping and listen to pong from both sides. great. :|
Maybe I should set different intervals, for user experience.
 
10:54 AM
Make sure you also allow for multiple pings to go unanswered before declaring it dead
In most stacks it's 3 pings set ~a minute apart IIRC
 
They released socket.io 2.0 O__O
 
@OliverSalzburg Few days ago, yes.
 
@RoyMiloh github.com/socketio/socket.io#disconnection-detection That might explain why I'm not aware of any issues
What's the major change in the 2.0 though? I can't see anything really major in the history
No idea what's going on with our non-Socket.IO-based clients though
 
@OliverSalzburg I think uws, one of the reasons we didn't consider socketio, funny.
@Zirak Why? instability?
@OliverSalzburg btw, how many connections do you handle concurrently?
 
11:03 AM
@RoyMiloh That is a question I'm currently trying to answer actually :D
At peak hours, hundreds. We have not yet reached thousands
 
Ah, ok, different story :)
 
We're in the process of establishing tools to allow us to monitor the exact metric though
 
Actually I'm wondering if socketio (or other clients) sends ping from client (from server it's a big yes).
 
> An heartbeat mechanism is implemented at the Engine.IO level, allowing both the server and the client to know when the other one is not responding anymore.
 
So I guess the answer is yes, but I couldn't find it in source (still looking tho).
 
@OliverSalzburg Yes, but I'd like to see where it's sent by client and where by server.
Explicit calls to onPacket in both libs.
 
@RoyMiloh To my understanding, engine.io is the underlying engine for both client and server
 
@OliverSalzburg engineio has a client as well.
They've a demo right here: socket.io/demos/whiteboard looks like a ping sent every 25 secs, but I don't see when the server sends it, maybe it doesn't send (resets timer) as long as it gets any message from client.
Which means that only client sends ping, and server resets his timeout (for closing the connection) on every message. Sounds like a better solution. cc @Zirak
 
11:43 AM
@RoyMiloh Thanks for the follow-up. This is good to know
I would have moved to another solution without thinking about this, taking the existing solution for granted :P
 
11:59 AM
@FlorianMargaine @Loktar @KendallFrey fun fun think about fun!!!
 
oh shit
 
the funniest part is embedded videos don't (seem to) get monetized
so she's not making any ad $$ from that domain playing the vid
excellent. now that I've listened to my weekly Friday I'm good
 
12:14 PM
then how will the data be sent
 
1 message moved to Trash can
@LuzanBaral Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
I prefer this version youtube.com/watch?v=7qtjqn8n3xY much better voice @rlemon
 
nahh, original is the best
 
function postContactToGoogle() {
 var email = $('#emailtosubscribe').val();
 $.ajax({
  url: "https://docs.google.com/forms/d/e/[key]/formResponse",
  data: {
   "entry_1064445353": email
  },
  type: "POST",
  dataType: "xml",
  statusCode: {
   0: function() {
    window.location.reload();
   },
   200: function() {
    window.location.reload();
   }
  }
 });
}
On the above code how will be the data send, I mean the format, because I now want the data to be sent as json.
 
> dataType: "xml",
 
12:17 PM
I am trying to replicate that in to C# in Unity, where I am confused with the content-type.
here's my question about that, stackoverflow.com/questions/44200938/…
 
12:40 PM
Would WASM just give you the capability to use any language for the front end?
 
what is WASM
:(
 
WASD is for noobs, WASM is where it's at
 
that's gonna be a hand cramp real fast
 
Meh. Was trying to find a fitting image. That was not fun
Way too many amputated appendages
 
12:47 PM
Oh I though that was reply for my query.
:)
 
No, just messing around :P
 
how can I upload a file just using JS (no flash dependent libs)?
 
1:05 PM
Where do you want to upload file
 
@mahieus the file reader API is a good start
 
@mahieus file input in a form
 
think i'm going to use FormData
sorry my question was nog very clear. I forgot to mention it had to be with an ajax call and no form post :)
 
I liked the FileReader idea
 
afk rebooting
 
1:17 PM
guys which movie shall I watch today?
 
Battlefield Earth
 
I'm not in the mood for a comedy
 
it's more of a tragedy
 
The quick and the dead
 
@corvid I watched Get me Roger Stone on Netflix yesterday. Liked it
 
1:19 PM
@OliverSalzburg whats it about?
 
@corvid Politics
 
We could use more of that.
 
Roger Stone led the Trump campaign
So it's part documentary, part tragedy, part comedy
 
:D
 
Comedy = Tragedy + Time and not enough time has passed.
 
1:21 PM
:D
 
But the movies next year are going to be FUNNY.
 
I am already so perplexed by Trump... and his fanbase (or whatever you'd call it)
 
ghad.. wtf is sublime doing?
it keeps taking 100% cpu
 
text processing is still an unsolved problem
 
Can you do anything with a Swagger API definition, outside of the SwaggerHub online offering?
@corvid Watching that documentary might clear a few things up then. I found it to be very insightful
 
1:28 PM
I have more respect for people when their motivations are a mystery.
 
The documentation paints a pretty clear picture of how winning and being "right" have nothing to do with each other
 
I learned that in history class.
 
@KendallFrey Did you click that because you read "...played with Penis"?
 
actually no
 
1:31 PM
I did.
 
Error: Cannot find module "." thanks webpack, I'm definitely requiring '.' :|
 
It's just trying to have your back
 
Hello. I have a class named Truyen. Which contains a const value named ID.
 
@TruongHieu Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
There is nothing like adding types to old code to show where you've been inconsistent.
 
1:40 PM
how can i access this const in other class file?
 
Do you mean property? Show me the class definition, please.
 
@rlemon 'cause the beer's making you fat, fatty.
 
I want to access these constants in other class
 
@Trasiva no, excessive beer is making me fat.
 
1:41 PM
I tried global, i think it works. But i want to call like: Truyen.TACGIA_ID. Not TACGIA_ID
I tried export const TACGIA_ID too. But get error:
export const ID_TACGIA = "id_tacgia";
^^^^^^
SyntaxError: Unexpected token export
 
Ohh.
those style of exports are valid modern JS but not natively supported by most engines (IE, chrome, node, etc).
 
@rlemon Fair point. Also that fuckwit never made the post he promised 😠
 
Like Java, I can use public final static String... But i don't know how to do with Javascript (NodeJS)
 
You need to "transpile" your code (turn modern JS into compatible JS)
OR.. just use commonjs exports for it.
module.exports.ID_TACGIA = ...;
 
I'm using ExpressJS, i have to commonjs too?
 
1:44 PM
commojs is just the name for the way you import/export in node.
You are already using it with your module.exports = ...
export const FOO = ..; // this is another style of exports. Not commonjs. "es2015"
 
ok. I'll try it. Thanks
 
@Luggage are you running tests from webpack, at all?
 
I have to use module.exports in any line or I have to do it at bottom of file?
 
What's a 'test'? appears shamed
 
@Luggage It's more widely known as a "release"
 
1:45 PM
Anywhere in the 'root' of the file (not inside a function).
ohh yea. releases. I do that sometimes.
during peak hours so that I hear about errors quicker
 
Hi Lug again, I think i can use in other files, but i cannot use it in Truyen.js :D
module.exports.ID_TACGIA = "id_tacgia";
 
You think you can use what in other files?
 
hey. This is my idea
I have to use query to query data from DB
 
That is unrelated to the imports/exports.
 
@KendallFrey wanna write a regexp for me?
 
1:48 PM
Always
 
I want to store column names in MySQL table in my code. So I can't type wrong in future
 
I need the contents of css bodies. so like #foo { this stuff }
 
@rlemon @FlorianMargaine @KendallFrey always thinking about fun on Friday woot
 
thats why i want it becomes const String
 
@rlemon use a css parser?
 
1:48 PM
the only "uhh" comes when that is in a media query
@Luggage writing a simpler one than the one I'm using
 
No, Kendall is. :)
 
shhh
 
ok
 
So, you just need stuff between {}?
 
1:49 PM
@KendallFrey yes, but if there is nested {} I want the innermost
 
ssube loves bringing up pegging
 
it's the only way to fill that hole regex left
 
good point.
 
/\{[^{}]*\}/ i guess
 
Good Morning guys and gals
and tumblr users
 
1:50 PM
Will only match {} blocks which do not contain any {} characters
 
@KendallFrey nice
 
> ¯\_(ツ)_/¯ i guess
 
seems to work
 
I'm moving ES5 react to ES6/7 react. I have a getDefaultProps function. What's the equivalent to that in ES6?
 
Would it be right place to ask question related to angular2+ with jwt?
 
1:53 PM
@Vap0r react has excellent docs for that.
 
@Raimonds just ask, if anyone knows and is available I'm sure they'll help (maybe)
@Luggage ok what should I search? React ES5 to ES6?
 
in other words... RTFM :)
 
I saw something that recommended something like:
class blah extends .... {}
blah.defaultProps
Is that the right pattern?
 
Huh guess so. It looks kinda ugly IMO
 
1:56 PM
yes, but you can use a newer equivalent, too:
 
Hello Lugg, I call "console.log(TruyenObj.TABLE_NAME);". But it return "undefined"
 
class Blah extends ... {
    static defaultProps = {
    };
}
 
In Truyen.js: "module.exports.TABLE_NAME = "t_truyen";"
 
@TruongHieu update your gist with your code, please.
 
@Luggage ooooh.... Much nicer!
 
1:58 PM
I am about to start angular4 project, I will use jwt from server to get user details and access to all my components will be based on that
This doesn't seems right to me as I can easily change that data to access for example admin area. If I would use ASP.NET I would simply prevent HTML from appearing on page if Identity user has no access to it, how do I handle that in Angular2+ ?
 
defaultProps replacing .prototype?
 
No.
 
@Luggage https://gist.github.com/kainjinez/477ac1e1073449d5bacdf736d1604c54
https://gist.github.com/kainjinez/c556ba8550360c3ffea5536a022d9f98
Truyen.JS is class file. DBConn.js is calling file
 
@TruongHieu Ok. The ORDER of your exports matter. You replace the exports object at the end AFTER you set some values on it.
Change that order.
 
You mean I move export lines to bottom?
 

« first day (2414 days earlier)      last day (2526 days later) »