« first day (1489 days earlier)      last day (3450 days later) » 

10:00 AM
Rust or C++ will be much faster if you actually need to be efficient
 
Is JS functional programming language?
They mentioned Haskel is.
 
it has some FP elements, but I wouldn't call it functional
it's mostly object-oriented imperative language with prototypal inheritance
 
Javascript is a multi-paradigm programming language
 
javascript is love
 
10:01 AM
to this day I couldnt understand the prototypical inheritance :(
I always confuse it with the one in Java
 
@JanDvorak IMHO the most characteristic part of a fp language is "return is default"
function(x) { x; }
 
Guys, checking in the node_modules directory, good/bad and why?
 
@BartekBanachewicz x=>x
 
@SecondRikudo bad, you can get them from npm install anyway.
 
@SecondRikudo bad because npm should install them on the spot
 
10:03 AM
in Javascript since ES6
 
@BenjaminGruenbaum What if npm is down?
Or has issues
 
@JanDvorak "maybe someday JS will be multi paradigm"
ES6 is as impractical as Idris at this moment
 
@BartekBanachewicz nice try
 
@SecondRikudo valid complaint, not sure to be fair.
 
C++11 took at least 3 years to become common
 
10:04 AM
@BenjaminGruenbaum My argument is that storage is cheap
 
since it's finalization, mind you, not since it appeared
as far as I know, ES6 isn't finalized yet.
 
I don't care my repo to have a few extra megs of code in it, if it prevents friction points.
 
@SecondRikudo what-if.xkcd.com
@SecondRikudo but git is terrible when repos grow
 
@BartekBanachewicz That's not a hypothetical situation.
NPM was down/had issues several times in the past.
 
@SecondRikudo download zipped packages, and host them as a backup
 
10:06 AM
node_packages explodes and can be really big, a few megabyes etc.
 
treat npm route as a main one, and downloading zips manually and installing locally as a backup plan
but they don't belong in the code repository.
( IMHO )
 
@BenjaminGruenbaum The repository I'm looking at already has a few lot megabytes
I don't think a few more would be that much of an influence.
 
How big is your current node_modules?
 
@BenjaminGruenbaum 8.4MB
And likely wouldn't change.
 
I wouldn't commit it, but I see the merit of doing so
 
10:16 AM
@BenjaminGruenbaum Rest of code is 83MB :D
 
Hi all
 
Hi Luke Smith
 
Hijack
 
Does anyone here know of a jquery plugin that will allow a popup in same window for an email? where the user can add email adress and send a link based on the current page url that will be clickable?
 
10:20 AM
@LukeSmith You mean like a modal window?
 
@Sippy yes
@Sippy similar to those share popups you get with fbook and twitter
 
Just use bootstrap?
 
@Sippy needed a plugin maybe than could allow sending email based on current url
 
@LukeSmith ?
You can grab current URL using vanilla why do you need a plugin
 
i wanted it to popup in same window. not open outlook for example, so a plugin with all mail functions already there
 
10:25 AM
@BartekBanachewicz banachewicz.pl
 
@LukeSmith Why not just have a contact form?
 
@Sippy your right , will try that now
 
There's no point reinventing the wheel.
These days everyone has an email client they can connect multiple accounts to.
So providing that service via jquery is a bad idea on two counts.
 
@Sippy thanks man
 
hi sir,

Do you have some Good tutorial for to develop game on android or not?
 
10:34 AM
@hengsopheak You're really in the wrong place.
 
Also, most of us aren't british
 
Oh sorry I have never mistake again sorry I will try to read policy more
 
@hengsopheak it's the javascript room, not the java room
 
OOh but some of my friend said develop game should know exactly know aboout javascript too
 
Well, i have a svg "container", on which i apply a "translation" (simple move), next click i do on this svg container is "translated..." so, if i draw an element with my click, it is drawn at mouseOffset + translation... anybody knows how to cancel this?
 
10:39 AM
@hengsopheak What?
 
sorry I should not write messages a lot here because I want to know about game develop i want it but this forum is for javascript so I have to ask other group
 
@RahulDesai I know I have to set it up on gh pages
@hengsopheak uh oh
 
ok, just an FYI
 
11:00 AM
i have trouble adding an event listener mousewheel...
I have a function called "zoom",
I attach my eventlistener this way :
object.addEventListener("mousewheel",zoom,false);
and i receive :
Argument 2 of EventTarget.addEventListener is not an object.

any idea? :)
 
Hi Guys
How to open MAIL compose window with HTML content in the body? Has anybody some clue???
 
@Kannu nah, we have no clue
 
oh, what do you think, is it possible?
 
@Kannu depends
 
anyone else know this?
 
11:07 AM
no
 
@Kannu Is this what you're looking for? css-tricks.com/snippets/html/mailto-links
 
> Just add the body parameter into the ever-growing list of parameters we are using.
lol
 
No, I want to open the gmail compose window. Here is a solution it works fine except that it do not support html content in the body
http://stackoverflow.com/questions/2583928/prefilling-gmail-compose-screen-with-html-text
 
@Kannu Out of curiosity, why does it have to be Gmail?
 
@Timespace its my requirements.
 
11:15 AM
@Kannu Fair enough
 
Help please
 
@Kannu Had a quick go, but the best I could do was get strings (like "<h1>Test</h1>") to appear in the email body. Sorry dude, I have no idea.
 
11:45 AM
What would be a good assignment in Angular routes and states for someone who has just learned the basics?
 
@RahulDesai todomvc
 
k
WTF Microsoft!
How can you call this shit as a simulator?
 
What's so bad about it?
 
11:57 AM
I tried it and it looks like a picture of an iPad with Safari running in it.
What I was expecting is a simulator that has all functionalities like a device.
 
any idea someone about addEventListener("mousewheel",function,false)?
http://stackoverflow.com/questions/26908003/add-mousewheel-eventlistener-error thx
 
I wouldn't expect that
 
Apparently it looks like that wouldnt happen in Windows with what we have today.
 
Also due to licence issues
 
12:16 PM
@sabithpocker hey ya :) can you invite to private room?
 
@RahulDesai Of course not. Licensing prevents any kind of emulation of Apple devices. If you're testing web applications, or PhoneGap applications, then an embedded WebKit browser is going to get as close as you can get without a Mac. It's still useful.
 
how many reputation needed to open a private chatroom?
 
@Julo0sS There are no private chat rooms
 
@KendallFrey you see what i mean... invite a user to a "new" room :)
 
12:47 PM
Hi everyone, I need some help
 
@Nafis 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.
 
user4029378
hello. i have a little problem in angularjs. i want to load a partial from inside a controller.... i tried
$scope.$apply(function(){
$location.path("#/mypath"); });

but it doesn't work....what am i missing?
 
Please take a look at my problem: stackoverflow.com/questions/25382844/…
My progress bar doesn't update in the middle of calculations. It only appears 100% after the calculation finished. Any idea?
 
Browsers don't like rendering while javascript is running
 
Any solution?
@JanDvorak Any solution?
 
1:01 PM
@Nafis try waiting a while
 
@JanDvorak No, I tried, the progress bar still appears after all the calculations done, but it then fills up slowly from 0 to 100%
 
hi, I'm wondering why can't i access var this in this :

var App = {

foo: 'bar',

init: function() {
var parent = $("ul");

parent.on('click', 'li', this.childClick);
},

childClick: function() {
console.log(this.foo); //undefined

// console.log($(this).index()); //works
}
};
 
@Darick 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.
 
i tried doing parent.on('click', 'li', this.childClick.bind(this)); <-- this works
but now how can i access the index of the li :s
 
@Darick this.childClick is actually finding childClick function inside parent, try App.childClick
 
1:08 PM
well it works when I use this .bind function
App.childClick works, but what I'm really puzzled is im doing two things
first I need to handle the click and find the index of the clicked li, secondly i need to access the variable foo.
 
this inside childClick will be the element, just like it would be if you used an anonymous function instead
 
@adeneo ok, so how do I access foo?
 
App.foo
 
really thats it?
no magics?
 
yep
I don't think so
 
1:11 PM
alright, but I need to understand what is this .bind function
what does it do to allow me to access this.foo directly without App.foo
is this a somewhat proxy?
 
You can leverage jQuery's ability to pass data
var App = {
        foo: 'bar',
        init: function () {
            var parent = $("ul");
            parent.on('click', 'li', {obj : this}, this.childClick);
        },
        childClick: function (e) {
            var foo = e.data.obj.foo;

            console.log($(this).index());
        }
    };
 
@adeneo wow, cool.
anyhow thanks @adeneo and @Nafis
 
Guys, help me with my problem please: stackoverflow.com/questions/25382844/…
My progress bar doesn't update in the middle of calculations. It only appears 100% after the calculation finished. Any idea?
 
@Nafis i believe you should be using web workers?
if you are using your callback to update your animation, it only fires only the callback is fired
 
@Nafis - you can't show progress doing synchronous stuff, as the browser just hangs.
The only workaround would be to manually update the progress between the synchronous stuff, or make it async, for instance with a worker as suggested by Darrick
 
1:15 PM
@Darick I didn't understand. What is Web worker?
 
look it up
!!mdn webworkers
 
well its a background worker
 
for all browsers?
 
ie 10
and all major browsers
 
1:16 PM
wow!
 
well I haven't use web worker lately but it sure useful for using extensive calculation stuffs in background
 
you could also 'chunk' the calculation
here is an example with generating elements. similar. jsfiddle.net/rlemon/h98uY/1/light
 
@Nafis are calculating in the browser?
 
Thanks guys, I need to take a deeper look in it. But can you tell me if it works of mobile devices and tablets too?
 
@Nafis like you said in your question? or you are doing some queue stuffs in backend
 
1:20 PM
@Darick yes, browser. Totally in browser.
 
well you can try @rlemon or web worker
@rlemons similar soln
 
mines hacky. if you can use webworkers, use them
 
I mean, can I? :P
Can you tell me if it works of mobile devices and tablets too?
 
dude, google
support is listed
 
Sure, thanks
 
1:22 PM
@Nafis I've tried doing some mobile
but it consumes too much
resources.
whats specifics are you doing?
 
Trying to show progress bar while doing a big background calculation.
 
Do you guys have an idea if I should use Greensock with Jquery or just Greensock? stackoverflow.com/questions/26909897/…
 
Not ajax loading
 
> JQuery if and else statements
this isn't a thing
 
@rlemon so what do you say?
 
1:24 PM
addClass/toggleClass/removeClass is super easy to write yourself
 
@rlemon C's if and else statements
 
@Darick ?wat
same with event listeners
 
well I'm confused with steve's question, isnt "if and else statements" common to all?
 
if you're only using those functions with jQuery, I'd say you don't really need jQuery
@Darick jQuery isn't a language
if/else is part of core js
 
yes, I was being sarcastics
 
1:26 PM
var element = document.getElementById("div1");
element.classList.add("otherclass");
 
sorry about that
 
so I could do something like this with javascript
 
@Steve there is browser support issues
 
kind of long though
@rlemon with greensock?
 
var getById = document.getElementById.bind(document);
var elm = getById('foo');
@Steve no, classList isn't supported by old IE
just FYI
 
1:27 PM
Oh with my code you mean. I didnt know that. No wonder it never worked so well
 
I'm not suggesting you can't use jQuery. but the methods you described in the question on main suggest you could easily not use it
 
I see rlemon
 
and GSAP is faster as a stand alone library than with jQuery plugin
but the difference is so minor you probably wouldn't notice it
 
Isnt GSAP 20 times faster?
 
than jQuery.animate
but GSAP also ships as a jQuery plugin iirc. unless they stopped that
 
1:29 PM
they say even faster than css animation or transitions
 
it can be
not always
the biggest gain is you have more control vs css animations
check out Velocity.js as well
alien lemon eats your soul!
 
So I would just need Jquery for some of those plugins such as custom scrollbar or some fallbacks
 
@rlemon Joking aside, that is a little unsettling
 
So I write the add, removeclass with javascript. If and else statements are default js anyways but what about the jquery scroll function?
 
1:33 PM
depends on how you use it
 
well lets say the user scroll down 80% and then a picture fades in
 
if it is an event listener, elm.addEventListener('scroll', fn)
elm.onscroll works as well. but you can only register one event on the scroll with that
elm.addEventListener('scroll', fn1)
elm.addEventListener('scroll', fn2)
 
$(window).scroll(function ()
{
var content_height = $(document).height();
var content_scroll_pos = $(window).scrollTop(); and so on
 
with addEventListener you can attach multiple functions
 
then var percentage_value = content_scroll_pos * 100 / content_height;


console.log(content_height + ' vs ' + content_scroll_pos);
if(percentage_value >= 10)
{
$(".background").addClass("fadein");
}
 
1:34 PM
window.addEventListener('scroll', function(e) {
  var content_height = document.offsetHeight,
    content_scroll_pos = window.scrollTop
});
 
I assume thats not possible with Greensocks and javascript would be too complex
 
@rlemon hi, is Velocity faster than D3
 
If you're talking about GSAP it only replaces jQuery.animate (and it also ships as a jQuery plugin.) — rlemon 2 mins ago
 
ya they have a jquery plugin
 
you're misunderstanding what GSAP does
it isn't a jQuery replacement
 
1:35 PM
So it is just a replacement for animate
 
yes
it is just for animations
@ziGi no clue.
 
I see so dom manipulations jquery / js and animations Greensock
 
@Steve you could do it that way
 
ok
 
Do you think greensock is mature enough to be used? How long are they on the market with javascript based animations do you know?
 
1:37 PM
@ziGi I've never actually used D3 :/
 
it is really nice, I really like it
 
@Steve GSAP/Velocity.js are both fine to use
 
but it seems to lag on Firefox
 
They actually claim high browser support. If thats true, not sure
oh ok
 
most of them are pretty good
 
1:38 PM
so I was wondering if there is a good way to make the animation faster
 
look at the browser support they list and check what you need.
that is how I would determine it
 
So What I understood is to avoid jquery animate and css and to use velocity or GSAP instead to get the best of both worlds (browser support and speed)
 
well they support it
but it lags
they don't mention that in the list
 
sorry zigi that was all for steve
 
ah, sorry
I thought you are talking to me
 
1:39 PM
@ziGi to make it faster, you can look at some optimizations surrounding what you are doing (but I dont' know what you are doing)
 
hi guys. can we store current element $(this) in a variable and use it later ?
 
@Sajal yes
var that = $(this);
 
@rlemon well this means I have to go into the code of D3
 
they are on the market since 2012
 
well there are a lot of calculations because I am doing some stretching
 
1:40 PM
@ziGi no, you need to figure out what is making it slow and look at solutions to speed that up :P
 
@zig yeah but when used $(that).focus(); dosen't works
 
get a good profiler on it
 
@rlemon mass data makes it slow
but I do understand your concerns
 
@Sajal why are you re-wrapping it?
 
I just thought it might be something related to the framework
 
1:40 PM
Guys, looking at your discussions another question came into my mind. I was trying to draw a scatter plot with lots of data like 200000 or more with D3. Do you think I better switch to webGL for faster performance?
 
Question: If, in angular, you do angular.injector(['ng']).get('$http') you will get the $http as expected. When you do angular.injector(['ng']).get('$location') you will get thrown an error. What could be wrong for it to be throwing an error?
 
@rlemon actually what happens on click a div opens in bottom, document scrolls to that position and later on close need to focus back to that element from where click generated
 
@ziGi no, large data processing will always be slower :P you just have to figure out things you can do to make it faster while not compromising your app :/ it's never an easy tradeoff
@Sajal I have no idea what you're asking. please make an example with code on jsfiddle or something
 
@rlemon I do realize, I think I have to use a strategy that the gamers do, make objects smaller, less rasterized
or maybe just show chunks
and reduce effects
I guess
but it is really strange that firefox laggs that much compared to chrome
 
@ziGi I'd just show chunks?? if you have a demo showing what you are doing it might be more helpful to understand
 
 
ahh, I see
 
I told you but I think you didn't see it
 
I never clicked before :P
 
it's not mine
it's just a sample I took
it's not that much data
 
Guys, looking at your discussions another question came into my mind. I was trying to draw a scatter plot with lots of data like 200000 or more with D3. Do you think I better switch to webGL for faster performance?
 
1:44 PM
but it laggs quite a lot in FF and it works well in Chrome
 
@rlemon actually i am in a hurry so can't make it in fiddle. Anyway thanks for ur help :)
 
can i use jquery with GSAP
explains it all but no browser support list
 
@Nafis yeah, it might be that WebGL is faster than D3
 
Thanks!
 
@Nafis I am not sure though
haven't tested, I have the same dilemma
 
1:46 PM
Oh
 
> HTML5, jQuery, Canvas, CSS, new browsers, old browsers, RequireJS, EaselJS, mobile, and more – GSAP gets along with them famously. Use your favorite tools without jumping through endless hoops to ensure compatibility. It even accommodates various transforms (scale, skew, rotation, x, and y) in modern browsers plus IE back to version 6 without requiring clunky browser prefixes and hacks. We worry about compatibility so that you don’t need to. Another headache solved.
@Steve it is on their main page
 
transformations in IE6? How???
 
indeed
 
Why are people still thinking about IE6
 
because GSAP supports it
 
1:47 PM
when it is not officially supported since Windows XP SP2 isn't anymore
 
nice
 
because offices in China who will never have access outside of there intranet use IE6. so, clearly we need to still support it on our blog about cooking.
 
yeah, I know that
 
ie6 is so dead
 
but if their app is not targeting that group
why even support
hahaha :D
 
1:48 PM
I say we should max support ie8
 
we do ie8 too at your company
 
IE10+
 
if all developers would force users to switch to modern browsers then this wouldnt be happening
its the fault of web designers
 
I passively support other versions. but that is just dumb luck
 
@Steve It's business.
If one developer says "I won't support your infrastructure, upgrade it." and another says "We'll support what you have!"
 
1:49 PM
@ziGi I was actually thinking about working with three.js
 
Who's gonna get the job?
 
@Steve in a fortune 500 company, who do you think makes these decisions? developers? or project managers? or business analysts?
it often isn't the choice of the developer to spend 60% of their time supporting 4 users
 
@rlemon LOL
 
@Steve Thats true
 
@rlemon certainly not those who are responsible for keeping deadlines
 
1:50 PM
@Steve You should probably stop talking to yourself bro.
 
google use it, might as well be good
test it with firefox though, it might lagg
 
If anyone is familiar with Angular, why can't I get $location and $routeProvider from $injector, but can get $http? (docs.angularjs.org/api/ng/function/angular.injector)
 
@JanDvorak I worked for a company famous for making stupid promises. the owner was a sales man and was quick to tell the client "ohh yea, we can have that feature out to you in a week" when it was like 200 manhours of just coding. not to mention testing or documenting or anything like that
 
@rlemon haha similar story here
 
stupid old browsers. Anyways im off. Have a nice time!
 
1:52 PM
some people think that if a woman's pregnancy takes 9 months, when you bring 9 women together it would take only one
 
@rlemon AFAIK : That's all company story.
 
@dievardump company I work for now is nice :P boss gives me deadlines but then tells me they are not real :P
 
@rlemon keep him. The boss.
 
> you have two months to finish this.
but it will take 6 at least
> I know, I just wanted to light a fire under your ass.
but you realize it will still take 6 right?
> take ten for all I care! just get it done :P
 
I know other ways to "fire an ass", but...
 
1:54 PM
@rlemon huh. Source?
 
@JanDvorak a conversation I had with my boss last year
crunchtree.com @ziGi blame current version of FF
that preforms wonderfully in FF developer edition BTW
so I think FF issue that will likely be solved soonish
 
I see
 
check it out in FF Developer Edition
super smooth. no lag for me
 
ok I will seee
thanks
 
np
 
1:56 PM
I was wondering what's wrong
 
@ziGi does GSAP use canvas drawing or webGL? I was planning to use three.js for webGL but for 2D drawing.
 
GSAP manipulates the style attribute
 
style attribute of SVG?
 
webGL is technically canvas. it is just 3d. normal 'canvas' in most peoples eyes is canvas2D
 
I am not sure how GSAP works exactly but I guess if it is the new way for animating using HTML5 it should be faster than JS in any way
but limiting in terms of interaction
so I guess for simple animation it is better in terms of speed
 
1:58 PM
iirc, GSAP leverages hardware acceleration and manipulates the style of the elements directly.
 
and what about WebGL it also manipulates elements
 
This sound like a different technology
 
just through JS
 
@ziGi no, you have objects in memory and it paints them to a canvas
there is only one element, that is the canvas
 
yes, true
in GSAP you manipulate multiple elements
to make the animation
 

« first day (1489 days earlier)      last day (3450 days later) »