« first day (1795 days earlier)      last day (3151 days later) » 

12:02 AM
ok one question guys
how do I divide var y = {height: window.innerHeight || document.body.clientHeight} by the number 2?
console.log gives me a NAN when I do this var calculated = y / 2
 
what is y ?
 
well height, or h or whatever
 
what's the type of y?
 
basically it sees if it finds the innerheight, otherwise it takes the clientheight
 
hint: you can find out with typeof y
 
12:06 AM
Why does the extra point kick this season in NFL football look longer than it used to? Did they move it back some?
 
Im a bit confused.
 
@Asperger Yes, you are. What happens when you log console.log(typeof y); ?
@taco Sports? This is a programming channel!
 
@SomeKittens I get an object but no number since that is the type
 
When I retrieve all the SE sites with a simple request, the body contains gibberish (it seems like an encoding issue?). I don't have the issue with other requests (for example https://api.github.com/repos/request/request). If I call the api (http://api.stackexchange.com/2.2/sites) from my browser or Postman, it displays the info just fine. When I explicitly pass a header requesting UTF-8 encoding, it stays gibberish. Any idea why this might be? Code in question:
request('http://api.stackexchange.com/2.2/sites', function(error, response, body) {
	if (!error && response.statusCode === 200) {
		console.log(body);
	}
});
 
@Asperger Correct! And what happens when you try to divide an object?
@JeroenVannevel it's because it's gzipped
!!> var a = {}; a / 2
 
12:09 AM
@SomeKittens "NaN"
 
tada!
 
@SomeKittens ah.. That would make sense. Got a package in mind that can unzip it?
 
now, where's that number you pulled out?
 
@SomeKittens But I get a number? So I thought I could divide that number. If I console.log(y) I get the height in values.
 
@JeroenVannevel zlib
!!> var a = {h: 12}; console.log(a);
 
12:10 AM
@SomeKittens "undefined" Logged: {"h":12}
 
@Asperger ^ that's what you see
@Asperger I'm heading out for a walk this may help you
 
A bit too basic for me xD
 
I think not, given all this trouble you're having accessing the property of an object
 
@SomeKittens actually I do. I just forgot that I set keys. So I called the entire variable instead of the key of my array
honestly, I feel really bad now that I noticed this
same thing happens to me with semicolons in php or other crap. I know I need them but forget to add them.
 
1:01 AM
Does anyone actually know about proxyquire?
 
@ChristianBongiorno oh, that looks neat
 
I would take that as a 'no' :)
 
Honestly, I haven't done much testing of Node servers
 
I am trying like hell to use it and it simply won't do the injection as I expect
 
90% of the time it's a semi-intelligent pipe to the database/API
 
1:20 AM
any tip on adding multiple styles? info.style.height.margin etc
I know I can use cssText
but any other way?
 
...
so what do you suppose is the best way to determine (client side) if a user is a ro
 
for what?
just check the style on the username if it's not mission critical
and if it is mission critical, don't hand it to non-ro's
 
1:38 AM
well it is for my dark theme
I have a number of user tools that I only wanna load for ro's
so just checking user style isn't okay
and all ro tools current afaik are on a popup
 
Send a request to kick yourself
 
lol
actually not a bad idea
 
What's to stop the non-ro user from running the RO code anyway?
 
stack permissions
they are bulk move operations and stuff.
 
ooh, actually
check the room \/ dropdown?
 
1:45 AM
exists in all rooms
 
Ah, nevermind, have to open it
 
the dropdown itself has items I can check for
but yeah
 
oh, neat, there's a list of people who can be pinged from this room
/user/info has it
 
CHAT.RoomUsers.all().forEach() has nothing useful
:/
 
are you guys unit testing with es6? i'm having trouble 'getting' it
 
1:48 AM
@rlemon it has is_owner
what more do you want
 
It does?
I didnt
see that
dammit
okay
nvm
 
!!afk hometime
 
anyone done anything with http2?
 
damn, CHAT isn't exposed on runtime.
 
user406009
2:04 AM
@rlemon Why would you only want to load them for ro's?
 
because only they can use them..
 
yea trying to avoid loading a second page
 
user406009
Array.from(document.querySelectorAll("#room-ownercards .user-header")).map(a => a.title)
 
yea the code isn't an issue if i'm parsing another page
but I do not want to parse another page
i'm trying to determine it from the chat page itself
I can wait for the CHAT object to be there I suppose
 
2:29 AM
@phenomnomnominal What is that again?
 
user406009
@SomeKittens A new protocol to replace HTTP.
 
user406009
Promises more efficiency.
 
OH
for some reason I thought he was talking about the new HTTP module for Angular 2
 
user406009
They have a new one? I'll have to check it out. I really liked Angular 1's AJAX support.
 
It's all observables now. I know the guy who's working on solidifying the API
 
2:41 AM
Morning guys
can anyone tell what's wrong with my code here? it seems to be not working..
function createImportLineRow(index)
{
    var $row = jQuery('</div>', { id: 'line_'+index, class: 'line row'});
    var $nameInput = jQuery('</input>', { id: 'line_'+index+'_import_name', name: 'line_'+index+'_import_name', type:'text', placeholder:'Name'});
    var $localMain = jQuery('</input>', { id: 'line_'+index+'_import_local_main_directory', name: 'line_'+index+'_import_local_main_directory', type:'text', placeholder:'Local main directory'});
    var $localBackup = jQuery('</input>', { id: 'line_'+index+'_import_local_backup_directory', name: 'line_'+index+'_import_local_backup_direc
 
Any error in the F12 console?
Wait. What is jQuery( '</div>' )?
 
its like $('</div>')..
but I am using jquery-noconflict
 
I think it's the end div that's throwing us off
 
Yes. I hoped to prompt you to think what you are writing. jQuery takes an HTML string, and your string is not a complete HTML. It is just the end. There is no start. The element would not be created without the start.
 
Hmm.. let me try that..
 
@Sheepy Thanks i got it working now by changing </input> to <input/>
and the rest
 
@SomeKittens :-/
 
@Sheepy your name reminds me of this iphone game I used to have years ago
it was the shit. trying to find it now
 
@SomeKittens yeah thank you also :)
but why it renders like this
<div><input><input><input><input><input><input></div>
without attribute
 
@choz HTML is not XML, so you don't even need the slash. Either way, if you fixed the tag string, the created element would have the attributes, so the problem is likely somewhere else. Check with F12 inspector.
 
2:58 AM
@Sheepy I copy-pasted that from my F12, thats how it rendered..
jQuery('<input/>', {id:'test'}).appendTo('body');
this also renders without attribute
 
I said check with F12 inspector. Not see the render result.
jQuery('<input/>', {id:'test',style:'border:5px solid red'}).appendTo('body'); Does this give you a red border? If yes, problem is in css style, not jQuery.
 
@Sheepy no, it doesnt give me red border
 
Then something is quite wrong on your project. Try the same code on jQuery's website. You will see a red border box.
 
@Sheepy oh ok, its my jquery version who gave me this issue... i am using jquery 1.2.6
 
@choz I guess you already know now that's 9 versions behinds the previous major version. :p
 
3:12 AM
@Sheepy yeah o.o.. i cant help it
 
Sure you can
It doesn't even have features that would get added later, then deprecated and removed again.
 
@JanDvorak any way to do this in 1.2.6?
 
T.T
 
Do what? Create an element with some attributes? You could just as well use vanilla DOM.
 
3:16 AM
You can just put them into the html string.
jQuery('<div id="'line_'+index+'" class="line row"></div>'); Simple and easy.
 
But really, you should upgrade. Also, Why aren't you using $ ?
 
Most likely because some other in-house or old library function is using $. All their variables start with $.
 
@Sheepy Thanks it works now :)
@JanDvorak Its not me, its my companieee :)
 
Tell your company it's wasting their resources
 
^ This
 
3:29 AM
@JanDvorak lol i tried..
 
jquery 1.2 is undocumented,..
lacks important features
is not supported by stack overflow (well, except @sheepy)
 
@choz There is no try
You're a programmer. You make things happen.
 
@SomeKittens the problem is, there will be such heaps of changes to all sites if we migrate to newer version of jquery.
 
in other words "we'll have to write code to make the product better"?
 
3:40 AM
And this company keeps bragging about the new product, which will use newer version components as well.. But it never happened since 2 years ago
 
@choz no
 
egads!
 
@choz quit now
 
LOL
to make the argument even worse, i am still using symfony 1.2 ffs
 
jQuery 1.2 lacks the ability to bind arbitrary events (until 1.3 or so), much less delegate them (until 1.5), much less bind and delegate in a sensible and unified way (until 1.7)
 
3:41 AM
It's true. It is also wasting your time, your chance of gaining experience.
 
But hey, I got it working now :p
function createImportLineRow(index)
{
    var lineName = 'line_'+index;
    var $row = jQuery("<div id='"+lineName+"' class='line row' />");
    var $nameInput = jQuery("<input id='"+lineName+"_import_name' name='"+lineName+"_import_name' type='text' placeholder='Name' />");
    var $localMain = jQuery("<input id='"+lineName+"_import_local_main_directory' name='"+lineName+"_import_local_main_directory' type='text' placeholder='Local main directory' />");
    var $localBackup = jQuery("<input id='"+lineName+"_import_local_backup_directory' name='"+lineName+"_import_local_backup_directory' ty
 
Well that's ugly. Do you really need those IDs?
Wait, you do because the DOM lacks any sensible structure. Grouping related elements much?
But hey, at least you're using placeholder, which comes way after jQuery 1.2 became ancient :-D
 
Lol
Please don't make me feel any more worse than this :(
 
We are happy for you. But beware that we don't like seeing so many lines of code in chat.
I am very tempted to say "template string plz", looking at the code >_<
 
3:47 AM
Noted.. Aye sir
 
Assuming you can get allowed to us... nah, never mind.
 
Anyone codefight here?
 
Codewars member here.
 
So I'm pretty familiar with the how of generators. What's the why?
 
/me too busy with real code and life to test coding skill.
 
3:52 AM
What are some cool not-too-complicated things one can do with generators?
2
I haven't felt the need to prove my coding skill in ages.
 
@SomeKittens anywhere you'd use infinite lists in Haskell
 
ELI(es)5
 
You can have a generator for Fibonacci numbers
 
@ʞɔᴉN You have a car?
@JanDvorak ooh, good one.
 
@SomeKittens of course but it is slightly broken
 
3:55 AM
how much so?
Too much so you can't come to meetup.com/jquery/events/209691222
 
not much
 
Lazy.js lets you map over, filter, ... lazy lists
 
They are good for data stream where it is difficult or inefficient to know all the elements in advance, before your code. generator is a bit like reversed callback to find next element.
 
@SomeKittens sweet, did you organize that?
 
No, not organizer, just speaker
@Sheepy Not sure what you mean, example?
 
3:59 AM
if I'm free Thursday evening I'd love to come by
will have to brush up on my ES6 terminology so I can feel smart
 
Nevermind. Fibonacci number is indeed a good example.
 
<- Randall Koutnik
(for context)
 
yup
Randy Randall
 
Have you sent that to me before?
 
4:03 AM
Generators are nice for lazily building things and infinite lists, but they're awesome in their use for asynchronous stuff
 
that 200 slide powerpoint though
 
@SomeKittens I don't think so, @BenjaminGruenbaum posted it
A few months ago
 
cool
I probably opened it, read the first 15% and then closed it a month later when I realized I'd never finish it
@ʞɔᴉN I'll introduce you to some of my RocketSpace students
 
sweet
and if you happen to know any VC's..
 
4:20 AM
of course you've got a startup
 
of course, that's what all the cool kids are doing!
nah, I have a couple projects but I'm not working on anything that'll really ever generate revenue
 
I'm just working on my personal brand
SomeKittensâ„¢
 
I can see that, haha
you're out there hustlin' while I'm busy playing games
 
Man I wish I was playing games
not regretting signing up for this, but I've got three nights to put together 45 minutes of talk
 
christ, I can't even talk for 10 minutes without running out of things to say
good luck. I'm out for the night, peace all
 
5:05 AM
I can talk on and on and on and on... my honey always find that amazing.
 
6:02 AM
$(window).width('40%');
// y this is not working ??
 
Because you cannot resize the browser window with javascript?
 
hii all
i have question in javascript
 
no i used wrong method, i should use window.resizeTo(w,h) :)
 
Won't work either ;-)
 
6:10 AM
 _this.getRanks = function(hand) {
      var hl = hand.length,
        ranks = {},
        card;
      while (hl--) {
        card = hand[hl];
        if (ranks[card.val]) {
          ranks[card.val].push(card);
        } else {
          ranks[card.val] = [card];
        }
      }
      return ranks;
    };
here hand is the array
 
yes :(
 
i want to understand this code as i know c#
and want to use this code
 
pls help i want to resize this bowser size.
 
@Simply Guess what?
@zanky please clarify. Which part you don't understand?
@Simply oh, and "pls" is disrespectful
 
@Simply If it is a simple question, you should ask Google or Stackoverflow first: stackoverflow.com/questions/7022787/…
 
6:16 AM
@Sheepy ... or just accept that if the official method refuses to work, none will.
 
Just like showModelDialog. No, there are no other alternatives that is blocking.
 
@JanDvorak i dnt understand if condition
they are storing array to ranks var ?
 
Javascript objects work like associative arrays
*don't
 
i understand some thing like if ranks contains card.val key the they are pushing object
or else if ranks does not have thet key then they are assigning array with one object
is it so @JanDvorak ?
 
6:23 AM
Correct. This is an implementation of a multimap.
 
i tried they saying that we cant resize browser with where we can resize newly opened window size, here is my problem, i want to load external site into my page and freeze it so until user finished with that page it;ll stay at top, but i realised that we cant freeze browser windows by using javascript, now i'm trying to keep that at right, left side is my current window right size is externally loaded window seems like this is also not possible
does jquery model loads external sites ?
 
@Simply you are hard to understand, man. What is the verb here?
 
@JanDvorak then key value array structure will be suitable for this in c# ?
i am thinking to use dictionary
 
I'm sry for my bad english
 
6:57 AM
Mornin'
 
nice one @SomeKittens codepen.io/SomeKittens/pen/sghrc ;)
was made quite some time ago too! Great to see the staff is getting back to old pens :D
 
wat
@rlemon made that
I have no idea how that got under my name
 
far out!
 
@SomeKittens scores an assist!
 
haha
well, that explains the weird tweets I've been getting
 
7:07 AM
lol
contact codepen?
it was picked btw
 
when I open a window with `window.open` (with an address of, say, 'data:text/html,…'), before any 'load' event is fired, an 'unload' event fires while the window.location is 'about:blank'
is this normal?
 
Seizes Neil's possesions anyways
@Cauterite I can see how it could have happened
 
it took me a while to work out what the hell was going on
 
@Cauterite It might be triggering load as a formality.. it's technically already "loaded"
 
7:15 AM
what makes you think that?
 
as such maybe there's a bug in there somewhere with event ordering
 
@Abhishrek A decent design tool? For HTML? No. For XAML, yes, there is Blend.
 
@Cauterite because there's nothing to download
you don't get a load event triggered when you set the innerHTML of a div
and all you're essentially doing is that
 
i see…
it does actually fire the 'load' event though; are you suggesting that the page was loaded synchronously at the `window.open(…)` call?
 
You may use iframe. You cannot control the browser size, but most users browse maximised with a few fixed resolutions, and you can control iframe size.
(Not that this is a good design - if you can put the external content under your control you can do it better)
 
7:26 AM
okay, another problem,
when i close a window, and i have event listeners on some element of the window's document, that element still seems to be firing events after the window is closed and unloaded
do i have to explicitly remove my event listeners?
 
@Cauterite Wow. I know devs who would kill for this feat!
Generally, no, you don't have to remove your listeners onbeforeunload. I'd rather believe it's not really happening as you describe it.
 
well my code is running in firefox's most privileged JS context (like an addon does)
 
is there a way to import * as types from {'./users.js', './profile.js'}
 
Ah. Now this is certainly a different context.
Hmm. I don't know the answer. Perhaps you can search/ask at MDN...?
 
i would but there doesn't seem to be much activity there this time of day
don't worry, i'll work something out
 
7:52 AM
@argentum47 Make an intermediate file:
// all.js
export * from './users';
export * from './profile';
Then:
import * as types from './all'
 
is that new syntax?
i get SyntaxError: modules are not implemented yet
 
No, it's super old. That's ES6. You're way behind the time!
 
as and from are keywords now?
 
that's so yesterday
 
when i call WebSocket.close() there seems to be a delay of about 10 seconds before the socket actually closes
anyone else experienced this? it could be my server's fault; i'm not sure
 
8:07 AM
If the server sends the close packet as according to the spec, there is no delay.
If not.. then yes, there will be a delay before it figures the server is gone.
 
oh no, it's the client that it closing the socket
 
what do you think of this code:

    la : function la(baa, data){
        var args = [];
        for(var i = 1; i < arguments.length; i++){
            args.push(arguments[i]);
        }
        this.__foo[type].apply(null, args);
    },
ignoring names of stuff
 
doesn't .apply(null, arguments) work?
or .apply(null, Array.from(arguments))
 
@SuperUberDuper Kinda pointless.
 
type is undefined
 
8:15 AM
how should i refactor it?
 
2 mins ago, by Cauterite
or .apply(null, Array.from(arguments))
 
@RoelvanUden I need one for my designer
she designs in pure vector editors
 
@SuperUberDuper Pick a better name than la
 
and it takes significantly more time
to prototype ui
and test it
 
@Abhishrek btw, React native just became a thing on android (code.facebook.com/posts/1189117404435352)
sorry about double ping
 
8:21 AM
In jQuery, what's the return value of .append()?
 
@ivarni when it says 'native' does that mean java bytecode or ARM machinecode?
 
@ivarni ZOMG WOW OMFG WOZAMOLI
@Cauterite React native lets you execute javascript to control ui written for android
full stop.
 
HAMMERTIME!
 
@Abhishrek that wasn't the question
 
@ZhengquanBai AFAIK they return this for chaining.
 
8:24 AM
@Cauterite No clue, I never used it, I just saw a link fly by me and remembered Abhishrek was missing it for android a few weeks back
So was just giving a heads-up :)
 
AFAIK, all jQuery insertion methods return the same set of elements for chaining.
 
I came accross a sentence from JavaScript: The Definite Guide that says "The method returns the jQuery object on which it was invoked. The elements in that jQuery object may have new content or new siblings, but they are not themselves altered".
 
@ZhengquanBai Well then, there's your answer.
 
What does it mean "but they are not themselves altered"
 
@ZhengquanBai It does stuff but doesn't mutate state of the this element set.
Like this:
function FluentInsults() {
}
FluentInsults.prototype.suck = function() {
  console.log('You suck!');
  return this;
};
FluentInsults.prototype.ugly = function() {
  console.log('You are ugly!');
  return this;
};

var a = new FluentInsults();
a.suck().ugly();
It does stuff but this is not altered :P
In jQ it merely wraps a DOM thing and THAT may be altered, but the wrap isntt
 
8:30 AM
@Cauterite Its simply letting you control Android UI framework via javascript how does that not explain the answer ?
 
Let me take a while to consume.
 
It will not compile javascript to the much slower java :P
@RoelvanUden o/
I am so excited about React Native Android
 
@Abhishrek okay, so it compiles to ARM machinecode, not JVM bytecode?
 
@ZhengquanBai It means append does not change the properties of the current object set. Well, except for props like childCount or lastChild, obviously. For example, if you have a form and you append to it, the form's action or method won't be changed.
 
It does not compiles to anything
 
8:32 AM
@Abhishrek then how does it execute?
 
@Cauterite That is out of scope of the project
 
Hello. Anyone Help Re this line of code "Files outside directory with manifest PMC_Telecom__Client_Extension/PMC Telecom - Client Extension/ are not allowed: PMC_Telecom__Client_Extension/, PMC_Telecom__Client_Extension/__MACOSX/, PMC_Telecom__Client_Extension/__MACOSX/PMC Telecom - Client Extension/." ? : ) - I am having issues. Posted a thread yesterday but no reply as of yet ...
 
They use V8 / JS runtimes however v8 handles it. And the components which are written in native code get handled by how the toolchain handles it
 
@Steve You need to give better context, or simply the link to the question.
 
@Abhishrek what's the "native code" the "components" are written in?
 
8:34 AM
@Cauterite Android does not run JVM bytecode, which is not slow. Saying that in the Java room will get you crusaded.
 
@Cauterite Java
public class MyCustomModule extends ReactContextBaseJavaModule {

// Available as NativeModules.MyCustomModule.processString
  @ReactMethod
  public void processString(String input, Callback callback) {
    callback.invoke(input.replace("Goodbye", "Hello"));
  }
}
 
so the android JVM doesn't run intermediate bytecode?
 
face earth
 
Android does not normally have a JVM at all.
 
@Sheepy Java is slow, say java is fast in the C room
@Sheepy it uses ART
now
earlier used Dalvik
 
8:36 AM
@sheepy
 
@Sheepy that clarifies things
 
@Sheepy - fair point : ) - I am struggling to upload a chrome extension to the chrome app store - can anyone help? I believe the problem may be to do with a url in the code
 
is this legal jsdoc?

/** @param {...string|number} ?data */
 
Everything is slower than C, so we can only compare among the rest. (Sure there are still people who handcraft OS with assembly. But that is a hobby.)
 
@SuperUberDuper ?data is not
@Sheepy Um. When JS is faster than the preferred language of your OS, you should be ashamed. Therefore, Android should be ashamed of itself.
 
8:44 AM
Oops, didn't mean to ping you :P
 
Oracle did publish a blog comparing Dalvik speed with JVM speed on ARM, both with JIT on:
https://blogs.oracle.com/javaseembedded/entry/how_does_android_22s_performance_stack_up_against_java_se_embedded
You can guess the result.
 
@Sheepy Is there one for ART?
 
@BenFortune I haven't read any. Not that it matters now.
 
React Native solves the problem of my webview so much better \o/
Death of cordova \o\ /o/
 

« first day (1795 days earlier)      last day (3151 days later) »