« first day (1712 days earlier)      last day (3461 days later) » 

08:00
Then how do I use text-overflow on it ?
@Sheepy snake_case :(
but yea, saw some prototype also in java, but i'd expect ASM and C
@Sheepy Uhhh, 1-3 letter variables galore
@ZahidSaeed set overflow: hidden
ns.iname
wuzzat?
   return '<a class="title" href="?query=' + encodeURIComponent( name ) + '" ' + attr + '>' + _.escHtml( name ) + '</a>';
08:01
Great, so I am really a sadist! Thank you.
Wat? Y U NO USE DOM NODES?
I did overflow hidden
@MadaraUchiha No, because there may be thousands and DOM would be slow. So I am using a mix. Used to be pure dom.
@Sheepy And HTML is better... how?
regex rulez for parsing html ;)
08:02
If you'd need to add it to the DOM it would only prove that much slower.
@Sheepy internally innerHTML would invoke the parser which would be more slow
I do insertAdjacentHTML and I didn't do this without benchmark.
I set and reset the src url of video to stop autoplaying, jsfiddle.net/karimkhan/2Lgxk5h3 still it plays
anyone her anofficiando of UK employment contract law?
any suggestion?
08:05
@Sheepy did you pass your code through JSHint or a similar linter?
I have a requirement to make my script plugin-like. So I have my options object literal with the arguments for the functions, then an object literal with the functions and then event listeners, just out there in global that invoke the funcs and feed the arguments to the funcs on click of buttons. Should I wrap them in a func, I guess they want me to make it invokable, shouldn't trigger on script load.
@MadaraUchiha Not at all... But then, I can hand edit many minimised code......
@Sheepy Is it an open source project?
This is why when my fellow programmers read my code, they call me a sadist. Now I know they are not alone @_@
@StevensHaen sounds like you are right, so no function wrapping, can you share the code?
08:10
@Sheepy If you're hoping for any sort of contribution, you will not get it with this level of code obfuscation.
Refactor your variable names, pass your code through JSHint, follow a style guide.
Thanks. Didn't expect contribution, but will consider it. I love seeing more lines and more logic... and this became my style.
Simple and readable is better than clever and complex.
user2620028
@Drogo seems somewhat specific haha
sass users can you save me some time? is it possible to include a runtime sass compiler in code for development (like babel)? if so, quick linky?
@MadaraUchiha Hey, JSHint is great! Thanks!
08:14
@Sheepy First time?
Yes.
@Sheepy Look at JSCS, too.
@RoelvanUden JSCS vs ESLint?
@MadaraUchiha No opinion here. I never used ESLint. I stopped writing bare JS before ESLint became really popular.
08:17
@StevensHaen ty, just looking
trying to stop video autoplay on load jsfiddle.net/w7tamtef
still autoplaying, appreciate any correct lead
@StevensHaen so basically you have something you can assign to a button that sorts an array? is this right?
yes
correct. What's the best approach to make this code as maintainable/reusable as possible
so basically i think, all you need to do is add something that adds the event listeners, my immediate reaction, would be to update the prototype of HTMLElement (or what ever query selector returns)
another option could be, onload, find all elements with class x, and then run the various methods to add the event listener to those elements
though that said, there is obviously some code you've left out, so cant comment fully
My point is, should the event listeners be wrapped in a function/object or should I just leave it out there?
If yes, how are they going to be invoked? onclick attr is not an option
08:25
why is onclick not an option? you invoke them how ever you need to invoke them
They don't want me to use the onclick attr
instead just the event listeners. So maybe they shouldn't be in an object, since it would be hard to invoke? Ok, just tested it and it works, the events are attached nevertheless, so nevermind
oh ok, so as i say
if you can use the classes youve used, just run that on page load (as long as things aren't going to be dynamically loaded
Correct
ive just answered you issue
Thank you
08:37
@CSᵠ I see what you did there..
Anyone knows how I select elements with font-family in their style attrib?
@Jonathan document.querySelectorAll( '[style~="font-family"]' )
@Sheepy Represents an element with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly "value".
So it won't match "font-family:" nor "font-family:x"
@Jonathan Oh right. Manual filter, then. Or use XPath.
Ah...
document.querySelectorAll( '[style~="font-family:"]' ) works in Firefox and Chrome
@yarden.refaeli do you?
09:02
@CSᵠ frankly, I think when it comes to parsing HTML regex is your best option
it actually depends, traversing DOM or using Xpath is much better/easier, but also regex is one of the viable options too
Hi, Is there any one who can help me on this?

http://stackoverflow.com/questions/30523083/image-gallery-in-masonry-grid-with-random-width-random-height
/<[^a-z]+>/i
@yarden.refaeli aaaand.. mandatory reference: stackoverflow.com/a/1732454/731947
@srikanth_naalla as has been state din comments, our job is not to develop for you
@yarden.refaeli I hear that a lot from junior programmers. There is not much definition of best that will make the statement true.
09:15
morning
morning~
@CSᵠ hahaha I was just kidding referring to the post you just sent
!!zalgo HORROR
@yarden.refaeli Ḧ̷̨̛͍͕̣́̋ͤ͗ͪ͊ͪ͜͢O̧͇͎̹̤̤ͩ̈́̑ͪ͞ͅR͇̖̝̟ͅR̷̷̞̪̰̠̪̩͓͗ͫ̾ͯ̿́͢O̴̴̪̳̤͘͡R̞̬̮̰͚̍
hey @Sheepy your nick is funny, remind me Macfarlane's Million Ways to Die in The West haha
!!zalgo royhowie
@royhowie s̶̢̗̤͉͙͍̰͖̫͉͚̯͇̊ͨͪͩ͒͑͊̀͢o̡̩̖̰͍̺̞̠̠͕̫̫͇̦̤̜̼̺͎̅̃̀́ͫ͟͟m̌ͪ̿̈͆̇̎̿ͮ̀̐ͪ̇̓ͪ͏̟̣̗͖͎͖̘̦̣̲̻͝‌​̱͇͍͚̼̩ȩ͇̠̼̥̰̠̲̯ͯ̒̾̒̅̓ͤ̎ͪ̅͘t͌̅ͨ͐ͤ̿ͥ̏̈̽ͣ̔̅ͬ̅͟҉̴̢͉̱̤̬͕̰͇̟̖̕ͅh̢͛ͪ͂̅ͯ̔͋͑̂̃͛ͦ̓ͧ͢͢҉̼̦̪́‌​̝͍̲̜ͅȋ̍ͧ̈̋ͪ͗́͊҉̡̥̫̱͎͍̘̱̱̟͕̼́͜n̔̓̈́̀̀̄ͪ̃ͥ̇ͣͬ͗ͥ̈ͧ҉̡͚̦͎̺͚̝̩͜g̴̥͍͖̥͈̖̲͙͚͊̽͒ͤ̑̑́̃ͨ̈́̀̀͞‌​̗̳̜̲̘̰̰
@royhowie r̰͇͖̲ͤ̔̄͊͒̚͟ͅoͤ̈̈͗͒ͥ́҉̫̻̭͇̲̦̭͍y̞̤͕̹͇̤ͬͮͅh̶̎ͭ̐̑҉͇̤̬̞̥̣͝o͑̌ͥ̒͊̒͞͏̝͙͇̘̗͕̬w͍̼̫̘̆ͫ̾ͩ͠‌​̦̳̫i̸̞̮͉͆̔̈ͪͤ̚͟ę̛̲̗̮̲͉̬͇̃͌
oh dear
@yarden.refaeli How'd you guess? I play dead everyday. X_X
cap shall fail now
09:32
Server error (status 500) occured (message probably too long)
If you nest two functions, their variables share the same scope correct?
@Charly do you mean if you nest one function inside another, or if you nest two functions inside a third?
one function inside another
the inner function has access to the scope of the outer, but not the other way around.
@Charly No. Inside functions' var are not visible to containing functions.
09:38
ok thanks
@DrogoNevets @Dro
I did not ask to develop. I was looking for guidance.
So I submited an ecmascript definition to the urban dictionary and it got approved
though adopt is in the wrong verb tense but fuck it
@afonsomatos You are a hero!
!!urban ecmascript
@afonsomatos ecmascript ECMAScript is the best fucking scripting language standardized by Ecma International that makes blind Java-fan boys cry.
4
09:44
My current program runs JavaScript in Java Nashorn. Best of both worlds/
Could I get some suggestions why name lookups have such big differences in speed here?
http://jsfiddle.net/Schoening/8mm12bf3/12/
The one I find most confusing is that I get much better performance looping over a random string and a number together (r1 + i) then I get when I combine the same string with a number ("a" + i)
FireFox and Chrome have different results mostly.. of course..
posted on June 24, 2015

Two weeks ago I heard that a person close to me is seriously ill. I spent too much time in the hospital lately, but fortunately the situation has improved all the way to serious but not hopeless. Let’s hope it improves again from there — not impossible at all, but not a certainty, either. As a consequence my schedule is all shot to hell and I’m very tired, to the point that

@Schoening Try JSPref.
09:59
@Sheepy jsperf is down. due to a lot of spammy code
@Schoening run your local version. jsperf is open source
I know that the iframe is a "window" to another website and doesn't strictly belong to me, but why can't I select sub-elements with jquery, unless I nest, starting from the iframe?
But why should I ? I already ran performance test o_o. I wanna know why there is perf difference
@Schoening /me shocked
Yaa.. lots of people on github jsperf asking the creator to at least put up a read only version
10:10
@Schoening Well, in that case, I can tell you that accessing object property is pretty complicated. The theory is simple, but that simple theory is veeery slow (think IE 6). Browsers do lots of analysis and optimisations on stable & consistent property access, and the details varies by browsers.
Yeah lots of variation. In any case. Looks like storing a string for the name in a seperate array is the faster to iterate then iterating over an array of objects directly. Oh.. I haven't tested if all the objects properties are static typed. Need to do that too lol ^^
Nah no change. Oh well. Was interesting trying this out. I got 50% more speed in Chrome
I'd advise not spending your time worrying about the fastest way to read an object property. The speeds vary by browser version. Browsers tune these flow in respond to the changing web.
Yeah I know. I just got really interested in it when I was reading about object pools yesterday :p
@Schoening don't bother
If you test on Edge, the speed actually varies build by build, as they are still tuning their new engine.
10:18
It's not that the browsers that differ
But behavior within the same browser differ as well
For example, IIRC, V8 will treat objects with 3 elements or less differently than it would with 4 or more.
Still find it strange that hash_table[ "a" + i ] performs 1 second slower then hash_table[ random_letter + i ].
Hmm
Ok
I try to make the object a bit bigger
But I get the point of don't bother
I was just really interested in this coz 50% bonus is kinda nice
Don't do premature optimisation. Millions of ns gained from a faster property read will be negated by a single suboptimal DOM call. If those ns are not gone next month.
!!urban iirc
@yarden.refaeli iirc abbv for If I Recall Correctly
Hi all, can someone help me fix a unit test please?
http://jsfiddle.net/9436hz1n/

within the unit test I am getting `undefined` for `scope.markers.home` any ideas? I am assuming its some crazy kind of async from google geocoder (mocked out for purpose of this test)
10:31
@DrogoNevets you haven't mocked geocoder, you've only spied on it. It's still being called like it usually would be, and responding asynchronously
@phenomnomnominal i have mocked it, just because i haven't given you the mock doesnt mean i haven't mocked it ;)
@DrogoNevets oh I'm sorry, so we're meant to help you fix your problem without all the information?
I have infact mocked google, in a seperate file and included it within my karma conf and am 100% satisfied that is working fine
@phenomnomnominal but by virtue of the fact that i can get to the various lines, without errors is enough to know that its working fine, i beleive there is some weird crazy async shizzle going on with the appy/digest cycle, but cant be sure and my brain is feeling to fuzzy today to figure out how to get around it
hello everyone, i´m trying to create a slideshow using the peace of code below, but it is not working...my thought was, creating an array with all the divs(inside of these is the image and the text) and then with the event click, tooglefade...what´s wrong with the code:
$(document).ready(function()
	{

		$("#appCoolpark").css('display','none');
		$("#appStructures").css('display','none');

		var i = 0;
        var stuff =["#websiteCoolpark","#appCoolpark","#appStructures"];

		$("#iconNextRight").click(function()
		{
           i = (i+1)%stuff.length;
           var divShow = (stuff[i]);
           $divShow.fadeToggle( "slow", "linear" );
		});
	});
it´s giving me the error with the $divShow but i don´t know how to pass this...
10:46
@Japa why reinvent the wheel and not use a pre-existing carousel?
@DrogoNevets never implement that...can you show me pls?
Morning
Which better Mysql or noSql (mongodb) for a web chat using node.js and php ?
@Japa go use google, find a jQuery carousel plugin you like, and use it
@Goku how big will database get in time? how will house keeping be done (Mongo gets very sluggish on very large datasets)
refactored about ~900 lines of code in one go. gonna run it now.
@Goku Don't use MySQL at all if you can help it.
10:54
@DrogoNevets
I'm planning for big database ( users, chats messages ) and I had read that mongodb is very fast than mysql with big databases ( Databases not its contents size )
A chat message will not extend 500 char and user's data will not extend 5mb
If you're going for a relational SQL database, Postgres is a good choice.
Can you please give me advise when to use relational db and nosql ?
Sorry for my bad english
only 2 errors ^_^
@Goku I'd suggest not having a database at first.
11:03
can any1 help me with this jquery slider? jsfiddle.net/ltorvalds024/tLy67ber/1
@edwardtorvalds 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.
@phenomnomnominal "not having a database" do you mean "no sql" ?
and if you do, can you tell me why ?
ok 3 errors.
@Goku I mean, why do you want to store chat messages?
11:05
how the fucking hell did all this work
@Goku MongoDB is very different from MySQL. They both contain data, that's all. So please revise which would suit you better.
That's easy enough to add later, so make it simpler at first and just send the messages.
@phenomnomnominal I'm developing a chat web app so It's needed to store chat messages in DB ! ^^
Actually I have done my project with mysql, but now I'm searching for performance and which will made site faster in case of huge DB data
@Goku I honestly can't imagine you'd get so much traffic that a traditional SQL server would have trouble handling it.
Or so much traffic that anyone cares about the chat history.
11:13
please help me with this jquery slider: codepen.io/ltorvalds024/pen/gpXoOe
i want images to be continious
!!welcome edwardtorvalds
@edwardtorvalds 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.
yes thanks, now can you help me
> if anyone's free and interested they'll help.
> if
this is quite ambiguous since it doesn't define what happens when the condition fails
can we explicitly have it state that else you won't get help
11:25
It's not really ambiguous.
var help = person.free && person.interested ? 1 : null;
@edwardtorvalds Add position: absolute to .slider img
var required = {
  create: true,
  bla: true,
  remove: false
};

var actualRights = {
  create: true,
  bla: true,
  remove: true
};


var res = Object.keys( required ).reduce(function( merge, pointer ) {
  return merge && required[ pointer ] === actualRights[ pointer ];
}, true);
does this make any sense to check for a rights matrix ?
@RyanKinal there is dellay between first image and second iamge slider, i want that to be removed
@RyanKinal the want the slider to be continous
Morning
I'm not seeing a delay
And I'm not sure what you mean by "continuous", if it's not what I gave you
11:31
what's the difference between functionName(); and functionName.call()/apply()?
Possibly a newb question..?
@RyanKinal when the first image slides left i see a white background with loading gif and then second image with a delay;
i want the first iamge to be sticking with second one when it slides left
(hope i am clear now)
@Billy You pass the value of this when you use call as the first argument
@Cereal same as apply
5 mins ago, by Ryan Kinal
@edwardtorvalds Add position: absolute to .slider img
Ah, of course (I knew that, wtf)
11:33
@Billy call accepts variadic number of parameters in addition to the this value. apply takes an array of parameters instead
@RyanKinal ah thanks, got it :-)
!!> function foo (...args) { return [this, args]; } [foo.call(1, 2, 3), foo.apply('a', ['b', 'c'])];
@AwalGarg ["a",["b","c"]]
AMAZING
@AwalGarg "SyntaxError: missing ] after element list"
@AwalGarg [[1,[2,3]],["a",["b","c"]]]
11:35
logging with bot sucks :/
!!afk
anyone ever have this problem? Windows deciding to persist shadows after window close
@SomeKittens if I have a vm.profile.id = profileService.get("currentProfile").id; and then on some ng-click=vm.updateProfile(2); and vm.updateProfile = function(id) { profileService.set("currentProfile", id) } then in the view {{vm.profile.id}}` doesn't get updated.. why ?
0
Q: Promisify an object parameters

UltraWe have an object with empty values: var data = { a: null, b: null } Than asynchronymous methods fill this data and in some point it looks like: var data = { a: 1, b: 2 } How to handle following requirement with bluebird? // pseudo-code: new Promise(function () { if (data.a !== null &&...

whoops, wrong post
@Cereal :( I thought you had a custom desktop , those openbox things
11:51
@argentum47 I do have a custom desktop
hey, what orm do you use in node.js? I am looking for something as simple as possible.
node-orm2 seems great, does anybody have exp with it?
as simple as possible: no orm
@rlemon dude, would you care to put some kind of usage copy(right|left) on your awesome lorempizza service pls pls
@Cereal Conky for linux?
Hi guys!
@VeeeneX bbzero for windows
12:02
Looks cool
@Cereal ow.. looks cool anyway
@KamilTomšík I kinda like bookshelfjs.org
This is copy pasted otherwise there's no chance you'd use something irrelevant like the m multiline flag. This is disappointing from a user with 80k reputation. — Benjamin Gruenbaum 5 secs ago
RegExp tag is the most depressing tag.
@BenjaminGruenbaum yes. It's very very rare to find good questions. Which is a shame as it's an amazing topic.
@DenysSéguret it's an awful tag. Look at that repwhore with 80k rep he has over 3 times as many answers as me lol.
12:17
And that's why I want the gold: so that I can close all the questions
That doesn't stop people from spamming 5 answers in a matter of minutes to every question that comes along
This QA is really awful... It's such a simple question... Even the accepted answer is off-topic ^^
OK... I must lose some rep downvoting... again... sigh
You know what javascript needs? List/object comprehensions.
Would be fun
@corvid Having that is what made me use coffeescript for a while
12:21
Coffeescript has that? (awaits someone to tell me ES6 also has it)
I would be happy if TypeScript adopted it as well, as part of its "C# ALL the webz!" approach.
I don't even get what TypeScript is, but it looks like Angular 2.0 is using it
I honestly find list/object comprehension extremely annoying to read.
@corvid Basically JavaScript with types and compile-time type checking.
@SomeKittens sorry, it was some error on my part. although I didn't undrstand the solution very well. I had to set vm.profileId = profileService.get("currentProfile") ; at the top. that resolved the issue.
why are they annoying to read? Do other languages than python handle them in the same way?
12:26
@corvid To my knowledge it comes with ES7, not ES6
there's an ES7 now...? Where did that come from?
Well, a daddy ES6 and a mommy ES6 got together and
Spoiler: There will be an ES8 after ES7
Well ES6 is no longer a draft, so ES7 is the logical follow up
@corvid Here's a nice comparison of list comprehnsion syntax in lotsa languages:
A list comprehension is a syntactic construct available in some programming languages for creating a list based on existing lists. It follows the form of the mathematical set-builder notation (set comprehension) as distinct from the use of map and filter functions. == Overview == Consider the following example in set-builder notation. This can be read, " is the set of all numbers "2 times " where is an item in the set of natural numbers (), for which squared is greater than ." In this annotated version of the example: is the variable representing members of an input set. represents the input...
12:27
@corvid What couldn't be finished in time for ES6 was just posptoned to... guess what...
@RoelvanUden I wouldn't put too much money on it. They might skip right to ES9.
@Cereal ES7 started long before the freeze of ES6
Oh, there's also underscore.js with some nice pseudo-functional functions for js.
But I personally don't use it anymore, and probably wouldn't start now
@RoelvanUden wont it be ES2017?
12:31
I dunno. It seems reasonable to just continue counting. Or are we going to do a Microsoft on this and skip some numbers or start with a different notation?
Well, the reason they skipped Windows 9 is dumb developers :)
Try to learn regex first and then start insulting me.. — Avinash Raj 2 mins ago
lol
BTW C# people, I implemented async/await with generators today was short and ugly and fun :D
Playing a lot with the language to check out VS2015, finally got around to it.,
@DenysSéguret that's not a bad idea
We had async/await already, didn't we?
@BenjaminGruenbaum I worked with a guy who implemented async/await manually with yield return and asynchronous IEnumerators. It was messy and complicated but it worked. Mind you, this was after C# 5.0 came out, or at least after it was announced. He just hadn't heard.
@BenjaminGruenbaum There's just a problem: I wrote a little too many trivial answers just for that gold ^^
12:37
We have it, I just wondered how it'd be implemented.
@AvnerShahar-Kashtan that's exactly what I did today
@BenjaminGruenbaum You did this in JS, I assume.
   public static Task<T> Async<T>(Func<Holder, IEnumerable<Task<T>>> generator)
        {
            var holder = new Holder();
            var iterator = generator(holder).GetEnumerator();
            iterator.MoveNext(); // prime
            return Awaiter(iterator, holder);
        }

        private static Task<T> Awaiter<T>(IEnumerator<Task<T>> iterator, Holder holder)
        {
            var current = iterator.Current;
            var hasNext = iterator.MoveNext();
            if (!hasNext) return current;
Ugly, but works
@AvnerShahar-Kashtan no, C#, I did it in JS before like a gagillion times, it's easier in JS because JS has powerful generators where yield creates expressions unlike C#
In JS it's 7 lines.
Can I use Stripe solely for validation of cards, and not necessarily charging cards?
12:40
His was a 2000-line beast that used threads manually, not Tasks. He was a C++ developer who last learned C# 2.0 and didn't bother seeing if anything was new in the language.
@BenjaminGruenbaum Haha. Fun to see though. And I thought my NodeJS-inspired task pump in C# was nifty :D
@BenjaminGruenbaum it seems that guy is pro in regex, got a gold badge..
I think regexp.escape will fail when I use multiline comment
like regexp.escape("/* Hello */")
regex is fun, like a puzzle, once you understand its syntax
but in javascript, we don't have lookbehind
not even in es6 or es7?
how do I check if a class exists on the page? if($('.class')) {} always returns true
12:50
if($('.class').length) {} will do it
Regardless, jQuery selector will always return something. You need to check the length of that something
Next time, try logging it to the console. You'll be able to see for yourself
in fact...
!!> jQuery(".asdfgdfgfgfgf")
@NickDugger "ReferenceError: $ is not defined"
well, shit. I thought cap used jQuery
@NickDugger "ReferenceError: jQuery is not defined"
12:53
fuck me, then
!!> document.querySelectorAll('.asdfasdf')
@NickDugger "ReferenceError: document is not defined"
lol
what the flying fuck
!!>window
12:54
@Cereal "ReferenceError: window is not defined"
Well, then
dude
worker !
!!>this
@uselesschien "undefined"
@CapricaSix Well, isn't that javascript in a nutshell.
12:55
no
!!>self
@uselesschien TypeError: cyclic object value
ah, yes
Madness? This. Is. Undefined! /spartakick
I see that you know your judo well
12:56
How do arrow functions work with parameters, anyway?
@corvid Refine the question
I'll give an example
@corvid Like any normal function
x => poop(x)
(x, y) => x + y
(a,b) => a.poop(b)
12:57
ayeaye
_.map(_.range(1,13), function (index) {
  return {
    value: index,
    label: moment().month(index).format('MMMM')
  }
});
I don't think you can use arguments in a lambda, though...
!!> (x => x + 1)(1)
@NickDugger 2
.map(.range, index => {value: index, label: moment().month(index).format('MMMM'));
!!> (() => arguments)(1, 2, 3)

« first day (1712 days earlier)      last day (3461 days later) »