« first day (1601 days earlier)      last day (3363 days later) » 

5:00 AM
He elaborates on it pretty well I think
Maybe the guy didn't understand the question, but his point wasn't wrong
An ide is a little overkill for javascript
 
actuallly firewall have blocked i can't open
 
do you want a text editor or an ide
 
text editor to add on webpage like4 on stackoverflow
@ME
@Meredith please help me
 
Quick jQuery query: can we put multiple events in a jquery unbind call?
 
Try it
 
5:12 AM
@Meredith lol sorry playing the last of us didn't want to look like I raged on chat. Anyway totally agree with that other guys statement
well mostly
for Node I wouldn't mind using an IDE honeslty
I mean I've had times where I wish I could do like React.something and have intellisense pop up for me, more than just the local methods in the file, but like all of the possible properties of react just by reading it from its requires or something
I need to give webstorm a shot actually
man.. or right click and go to reference on a function or something
that would be nice too lol
 
Ehh I haven't really felt compelled to use an ide with node
Maybe it'd be nice, but idk it'd just be a bit too clunky I think
 
yeah usually my issue is they are too heavy
like using VS to edit JS.. bleh
alright Im heading to bed see ya
 
I'd rather have a bunch of individual parts that do their jobs really well too
Night
 
5:28 AM
why does the button click hide the p element? jsfiddle.net/m1kmevLv/1
 
id like to use express-jwt with passport,ive already set all auth mechanisms namely local,google,twitter,dropbox and github to return jsonwebtokens.i have two questions 1)can i use the social mechanisms without express.session and passport.session 2)how can i use set req.user with express-jwt instead of passport.
 
This was just an attempt to bind/unbind...
 
@deostroll: what are you trying to do with $p.toggle?
 
Ah i din't realize that toggle hides stuff...
 
I can guarantee that it's the toggle
What did you think it did?
 
5:31 AM
It used to do what you think it did but it was removed
 
m59
Any of you guys sound savvy? Any guess as to how many watts the speakers are on my MSI GS70? It can get quite loud.
 
toggle code execution paths...
 
Watts are a unit of power
That is all I know
 
m59
Max volume, it's as loud as I'd ever want music right in front of me. Too loud really. I'd like to buy an external speaker that is at least that good. Not sure how to judge it.
 
i started reading some of passportjs code ,it seems highly dependant on sessions,i have not looked at any of the strategies,are they dependant on session?
i guess it allows session:false as well for local mechanism
 
m59
5:34 AM
@vamsiampolu if you want the users to remain logged in, then you need sessions
 
maybe i just need to add a 3rd function to toggle...
 
5:57 AM
I thought so too,then I got started reading some of the articles pastebin.com/E0aDzkJ6
it says that you can use authenticate the first time and store a json web token in session storage on the client side,once that is done,you can actually send that with each request deserialize(if that is the appropriate term) and authenticate.tokens are supposed to expire but so far,i have not set either an issuing authority or an expiry
 
6:15 AM
@vamsiampolu That is just a manual session cookie. Session/cookie is simpler, faster, and more reliable.
 
@rlemon that style trick is batshit crazy!
 
6:33 AM
"If we are using SASS, we need to install Ruby on server side".. is this statement true?
 
i believe one can use libsass which is faster but does not have support for all the features
 
thanks that is very useful information
but still that doesn't answered my above question.. :)
or maybe I didn't get it
 
6:50 AM
there are plugins for grunt and gulp based on this benfrain.com/…
you can use any of these to compile scss to css
 
No.. I am actually asking whether I should Install ruby on server side if I use SASS in my project?
 
ok,not absolutely nessecary,you can instead use node-sass which is a nodejs wrapper around libasass which was written in C.The plugins above use node-sass instead of the Ruby based implementation.
 
@vamsiampolu worth noting that node-sass isn't completely up to date with ruby sass
 
7:15 AM
true
 
7:35 AM
0
Q: Call a function after pdf.js has rendered all the pages

Mr_GreenIn my project, I am trying to call a function after when all the pages have been rendered by pdf.js. The code for rendering is as follows: renderAllPages = function(pdf) { var pages = pdf.pdfInfo.numPages; for(var i = 1; i <= pages; i++){ // Using promise to fetch the page ...

^ promise issue
 
@vamsiampolu that, and he can just send the generated css files to the prod server.
 
@FlorianMargaine yeah I was thinking the same. but people here (seniors) says that I need to install ruby on server side..
 
listen to them then
 
I think I can live without installing ruby on server side..
ohh ok
 
It is a little bit unusual to commit generated code
 
7:38 AM
@phenomnomnominal it's not unusual to have a push/deploy script though
 
@FlorianMargaine nope, totally reasonable
 
@Mr_Green I'm saying "listen to them" as in "don't try to play politic"
 
have sass on the build server, then deploy to prod
 
I don't like having git folders on prod tbh...
 
I have a function that takes 3 parameters. If I bind this function to a JQuery object, how do I provide the parameters?
 
7:42 AM
florian, ok
@Cerbrus I checked that dup post.. it seems the user is calling the callback when a page is loaded but not all pages.
 
@Mr_Green No offense, but "didn't work" is a pretty loose description of your problem
 
ok editing
 
the less specific you are, the bigger the chance of being closed as a dupe
 
Cerbrus, that dup is definitely for a page
what I am seeking is I need a callback when all pages are rendered.. not a single page
 
7:49 AM
@ivarni updated the post.. pls check
come on please reply @Cerbrus
 
@Mr_Green don't be pushy
 
ok...
no offense, but that guy closed and got disappeared
 
@Mr_Green I'm sorry, it's still not clear to me what you're trying to do.
might just be me being slow though, I dunno
 
you may know this but still I am explaining: the pdf.js plugin will take some time to render all pages in a canvas element.
I need to call some functions when all pages are rendered by pdf.js
I tried using promises .then method
to call my function after all the pages are rendered
but that didn't help me
I can still see the functions are being called before the pages are rendered by pdf.js
 
@Mr_Green I'm surprised your code didn't already blow up at renderAllPages.then since there's no return from that function
 
8:00 AM
@Mr_Green: I'm not looking at this chat 24/7
Can't you think of any way to check if all pages have rendered?
 
although I know maths I never understand these codepen.io/tholman/pen/EpfLs
 
Chain loading them? Count "loaded" pages, something like that?
 
@Cerbrus I will but please for now reopen the post
that dup didn't help me
 
Nah, it's just asking for a "loaded" callback. The only difference is that it's for multiple pages
 
never heard of chain loading
 
8:02 AM
Load the next page in the loaded callback of the previous one
If anyone here thinks the question should be re-opened, sure, they can re-open it.
@Mr_Green: stackoverflow.com/questions/8921783/… Here's an example to handle a single callback for multiple loads
 
ohh that is nice
thanks
 
8:24 AM
Is my answer gonna win? stackoverflow.com/a/28873079/586051
 
How the hell did that question get 2 upvotes?
 
@KendallFrey @rlemon wth
 
That question should be closed, not answered :/
 
9:19 AM
is there anything inherently wrong with detecting clicks outside an element with its bounding rect?
 
9:52 AM
Anyone knows why I'm getting an XML error when trying to $.ajax it in ONLY on Safari (Mac version)? Getting a parsererror and a "missing declaration" of the first node although I suspect that's not where the problem lies.
 
@RahulDesai around?
 
10:15 AM
Hey can anybody help me with this ,
OK, so you can set the priority of your directive higher than the ng-repeat that is 1000 stackoverflow.com/questions/19270392/…. At this point a plunker could be of great help. docs.angularjs.org/api/ng/service/$compileRaulucco 23 hours ago
 
10:26 AM
[off-topic] teeth is plural.. tooth is singular..
 
you aint hot to be an english tutor
 
@Mr_Green: Thanks for the info
 
*ain't
 
i'm just lazy to use the single quote, which is above the character keyboard.
meh, English is not even my native language.
 
see you wrote a big line instead of just a single quote :P
no problem not native of mine too
I just know how to show off
 
10:42 AM
@argentum47 waddupp!
 
I need some css advices
3bb1f9a7.ngrok.com Add user (your github username or someone's mine argentum47), click on the username, you go to the profile page, the navigations and list looks so akward @RahulDesai
 
I need some jquery help.. jsfiddle.net/j2uyk0jj/1
resize by dragging the bottom right small box
 
@argentum47 I see a lot of white-space here: 3bb1f9a7.ngrok.com/#users/argentum47
 
after releasing the mouse, I want it to stop
 
HAMMERTIME!
 
10:56 AM
but that isn't happening
@CapricaSix ?
 
@argentum47 I would bring the 2 columns of the table closer and add even-odd colors
also center the table
 
:( in mobile this wasn't looking this ugly ...
ok doing that
will be back in 5 minutes /taking bath
 
i suck at bytestream :|
 
@argentum47 yeah, mobile view looks better, but there's still the horizontal scrollbar for some reason
 
Anyone familiar with linux's zip command?
 
11:08 AM
@SecondRikudo what is it that you need?
 
@Sushil I have a crapton of directories with a crapton of files in each
I want to create a zip that takes two specific files from each directory, and bundles them into a zip
 
@RahulDesai whaattt ?? holy hell, Horizontal SB
checking
 
@SecondRikudo zip <zipfilename> <path to first file> <path to second file> doesn't help?
 
@RahulDesai found the cause, I was using width 100% on .card .user-name. but If I remove it, for big username, it just breaks... :( . width: auto doesn't work either.
 
hello
I am testing with Jasmine. Do I need to put all my init variables always in a beforeEach(function () {}) block?
 
11:24 AM
Only if they need to be initialized before each test
hence the name beforeEach :)
 
30 mins ago, by Mr_Green
I need some jquery help.. http://jsfiddle.net/j2uyk0jj/1/
 
mm ok
 
solved it
 
was that box suppossed to stretch?
 
yeah
 
11:39 AM
jsfiddle.net/js0xezkh why is Marquee still here ?
 
Does anybody have any good ideas on how to perform method composition in JavaScript?
Method composition is just like function composition but only for methods, just in case you are wondering.
P.S. I'm looking for an elegant solution to the expression problem: journal.stuffwithstuff.com/2010/10/01/…
 
@AaditMShah There's no difference between method and function in JavaScript.
 
That's not the point. The point is that I want to be able to do something like Array.incOdd = Array.filter(odd).map(inc) and then be able to use [1,2,3,4,5].mapInc(). Something along those lines.
 
@AaditMShah You can
Almost like that too
 
I have a function distance(x1, y1, z1, x2, y2, z2) which calculates distance between two points A(x1, y1, z1) and B(x2, y2, z2) in 3D space. How would you test this function?
 
11:48 AM
Array.prototype.incOdd = function() {
    return this.filter(odd).map(inc);
}
 
Array.prototype.incOdd = function () {
    return this.filter(odd).map(inc);
};
 
Make all combinations of negative and positive numbers?
 
Yes, I don't want to do that.
 
Okay, what do you want to do?
It's still not clear to me what problem you're trying to solve.
 
@SecondRikudo Basically, I don't want to extend prototypes because that might cause a naming conflict.
 
11:51 AM
@AaditMShah So don't...
let incOdd = function(arr) {
    return arr.filter(odd).map(inc);
}
 
That's inconsistent. You're mixing OOP and FP. I wanted to know if there was a pure OOP solution to method composition.
 
@AaditMShah what
 
@BartekBanachewicz The common solution to this problem is to use multi-methods (i.e. methods which are decoupled from the objects).
 
hey guys, stupid question, if I have a pure .js file, I don't need to include the js code in a <script></script>?
 
@Brunaldo Try <script src="filename.js"></script>.
 
11:59 AM
you need to tell it to use the script
 
@AaditMShah meh oop
@AaditMShah the Caml solution is meh because Caml doesn't have type classes
In Haskell it would look a bit differently, and you can add instances to new types later
 
yeah we follow Jeff too
 
@AaditMShah @KendallFrey I'm talking about an external .js file and yes I have included it via the html file
 
12:03 PM
@BartekBanachewicz However, data types in Haskell aren't open. Hence you can't easily add new types later on.
Okay, the gist of the problem is this:

1. I want to create a bunch of generic functions like `map` and `filter` which work on arrays, maps, sets, etc. I only want to write these functions once.
2. I want to be able to compose these functions.
 
@AaditMShah what?
you can't add new values, but you can add new types with new values that extend the set of types that implement the type class
so effectively you're adding new types to the type class, and thus their values
 
never mind it's working, thanks :)
 
@AaditMShah yeah, you really want Haskell's Traversable and Foldable.
Except map won't work on Set.
Set isn't a Functor.
 
That makes sense. I remember thinking about using type classes and I remember rejecting the idea but I don't remember why.
 
@AaditMShah In C# we have interfaces for that, JS doesn't have interfaces, but you can pretend it does
 
12:07 PM
@KendallFrey you can't add an implementation of an interface for an existing class, which is meh
 
@BartekBanachewicz Oh yeah. Now I remember. You can't extend a type class with new functions. That's the reason I rejected that idea.
You could always create a subclass of the type class though.
 
@AaditMShah um, this doesn't make sense.
you would need to provide implementation for those functions for every instance that already exists
IOW, you can just make a new class and write instances for that.
 
Cool, thanks for clearing things up. I'll go and think for a bit now.
 
moreover, you don't need to copy the functions or anything, look
class A a where
    opA :: a -> Int

class A a => B a where
    opB :: a -> Int

B a => a -- means that you can use both `opA a` and `opB a`
 
Yes, I just realized that.
BTW, type class instances in Haskell are just dictionaries. That corresponds to objects in JavaScript.
In short, we need to modify prototypes again.
 
12:16 PM
and haskell values are tagged unions, which correspond to objects in javascript
welp.
 
function map(f, a) {
    return a.map(f);
}
 
@AaditMShah Or simply write in Haskell instead.
 
Write in Haskell on the client side? I wish. There are Haskell to JavaScript converters but I prefer hand-written code.
 
@AaditMShah why?
also purescript has type classes too, maybe you could look at that
 
No code bloat and easier integration with existing libraries. Also, if we write pure JS then we can take advantage of mutation where it would make sense as an optimization.
 
12:19 PM
code bloat? Do you include jQuery?
 
PureScript is rad, but the generated code is too slow.
 
And please stop spreading myths that haskell doesn't allow mutable data :F
I haven't seen a language with such a number of mutable arrays
 
I've never used jQuery in any project of my own.
 
k, what about Emscripten then?
How about that code bloat
 
Haskell does have IORefs and MutVars and STRefs, etc. However, mutation in Haskell is not as easy as in OCaml or other FP languages.
 
12:21 PM
whatever "bloat" means for you
 
Emscripten generates a crazy amount of code bloat.
 
@AaditMShah I disagree. It's just explicit, it doesn't mean it's not easy. As for TVars, I found them certainly easier to use than other languages' sync'ed primitives, same for TQueue
@AaditMShah ... and?
I mean, what is this bloat you keep talking about
I am not sure I understand the problem
 
module Main where

import Debug.Trace

main = trace "Hello World!"
That purescript code compiles to:
var PS = PS || {};
PS.Debug_Trace = (function () {
    "use strict";
    return {
        trace: trace
    };
})();
var PS = PS || {};
PS.Main = (function () {
    "use strict";
    var Prelude = PS.Prelude;
    var Debug_Trace = PS.Debug_Trace;
    var main = Debug_Trace.trace("Hello World!");
    return {
        main: main
    };
})();
 
@AaditMShah and?
 
Normally in JavaScript I would just write console.log("Hello World!").
It's just me but generated code makes me cringe.
 
12:26 PM
somebody good at math here?
 
@AaditMShah why do you look at generated code?
 
@Vlad depends what kind of math
 
Ok. here is the question :D
How can I calculate x1, y1, z1 and x2, y2, z1 if I know that the distance between two points A(x1, y1, z1) and B(x2, y2, z2) is 10
?
Was it with adjacency matrix or?
and I also know this identity
(x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2 = 10^2
 
@AaditMShah Do you also read assembly of the code you build from Haskell sources and cringe like normally in assembly I'd just write fadd rax, rbx?
 
@Vlad What are your known variables?
 
12:27 PM
none
 
You can't calculate 6 values from 1 known i.e. 10
 
6 variables :D
 
5 hyperplanes of solutions \o/
 
the problem I have is I have this distance() function which has 6 variables, but don't know how to test it with Jasmine.
 
@BartekBanachewicz I guess I'm just a stickler for perfection. Assembly is just too fine grained for me to care about.
 
12:29 PM
@Vlad The only way to get a unique solution in such cases is to set enough of the unknown variables to a fixed value.
 
what is the proper way to test it?
 
So I propose (0,0,0) | (10,0,0)
 
Anyway, I'll just go do my work. Nice talking to you.
 
So I wanted to find solution for given values like 10 or 20
 
call that r
 
12:30 PM
@AaditMShah "I'm a perfectionist, but only to some degree" :)
 
(0,0,0) | (r,0,0)
@Vlad It sounds to me like you're doing the opposite, computing 1 unknown from 6 knowns
 
yup maybe try first with some zeroes
 
which is really easy
 
this is the function distance(x1, y1, z1, x2, y2, z2);
A(x1, y1, z1) and B(x2, y2, z2)
two points in 3D space
gonna make a for loop
that will send several values at a time.
 
You need to make a set of input and expected output data
That's how tests usually work
 
12:37 PM
yes that is what I wanted to do, but got lost, 6 variables are many
 
1:02 PM
@AaditMShah the real perfectionists care so that you don't have to
 
1:27 PM
what can I give the background for a webapp. dealing with github ?
white looks kinda white
 
you're smart
 
you mean "what background color looks nice"?
 
yeah.
 
body { background-color: salmon }? But seriously I usually just google for a color scheme
 
1:29 PM
ok
I asked a friend of mine earlier, he was talking about illustrator and vector. I was puzzled. :P
@rlemon cool..
 
Adobe has an app called "Kuler" that lets you take a picture of your cat or whatever and then generates a color scheme from the picture
 
there is one for bootstrap as well
 
@rlemon that looks really nice if using bootstrap
 
1:31 PM
@ivarni I found that one to just now.
 
you can just nip the colors out as well
 
yeah I am using bootstrap
 
I have a love/hate relationship with bootstrap, I love using it for hobby projects but I absolutely hate it for professional work when you have designers with opinions in the mix
 
I'm the opposite
 
I have a function checking keypress events. In the end it returns false. However this doesn't stop the event. Only if I put event.preventDefault(); the keypress is prevented. WTF?
 
 
personal projects, I'll take the time to fuck around. work stuff I need done fast and cross browser. bootstrap all things
 
plus with bootstrap comes jquery. (if not using react, and personally I try to write JS myself).
in professional work, everyone is very eager to use jquery
 
you don't have to take the bootstrap js
I often do not
 
hm, I used the bootstrap.css and just took 4 components from react bootstrap.
 
check out purecss.io
if you want just css
 
1:41 PM
We found that we ended up changing just about everything bootstrap did in order to implement the design we were given, we basically threw away all the modules except the grid
and that cut the amount of versioned CSS in half
 
That's where purecss is helpful
 
you should be doing that
bootstrap is a 'starter' which you should cut up and customize
 
and we did :) only the customization was to throw 95% away
 
oh nice topic, I have a question. In the bootstap's customize and download, when I customize it, I get only a package.json file. what do I do with it?
 
couldn't tell you, I usually pull it in with npm and compile the modules I want as part of the build process
but on getbootstrap.com/customize I just got handed a zip file?
 
1:46 PM
did you? wait, the other day I was getting only the json file. In most of the answers I found said that a zip file got downloaded
let me check
what the hell. I got a zip file. I guess some days are troll days
 
Hello everybody! Can anybody explain me why after running web page is not responsive? I use asynchronous AJAX query. Fiddle
 
@Daggett 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.
 
@Daggett because you're iterating 5000000000 times perhaps?
@Daggett Oh, maybe you don't understand AJax. AJAX basically defers a function to be called at a later time. You might be thinking it runs in the background, but that is not the case. It simply runs at a later time.
 

« first day (1601 days earlier)      last day (3363 days later) »