« first day (969 days earlier)      last day (4201 days later) » 

14:00
or 1/8"
@blackbee you have confused some things
$('#iemail').keyup(function() {
    	var n=getIdValue('iemail').length;
    	if(n<9)
    	$('#check_mail').html("Bad Email Address");
    	else
    	$.post("validatefields.php",{iemail:usrEmail},function(res){
    		$('.errors').html(res);}
    });
yes..
^ binds to keyup
onkeyup="mail_check()
^ binds to keyup then in the function re-binds to keyup
however the alias functions .click .keyup .keydown .mousedown etc are crap
use .on('event', func)
that's a nice little infinite keyup loop there
also don't ommit { for your if statements
readability > being a hipster
@Esailija you will not believe, strict mode was 1/2 the ops of non-strict in chrome 27
i'm running again
14:03
Oh man, I'll have to fix my notebook today but I'm too lazy.
@rlemon wanna come over fix my notebook?
sure
wanna fabricate my aquarium lights?
ok.. but what i am trying to do is, enable the signup button only when all the fields validates .... so using keup i get the jquery show the errors... but in the end i have to see if all the fields are validated... i mean the user enters "abc" in email so the messgae is displayed "invalid email" but how to ensure that the user has corrcted the value to a valid email address
14:04
@rlemon That sounds even more complicated.
$('#formID').on('change', function() {
  if( shit_validates ) {
    button.disabled = false;
  } else {
    // show some fancy messages.
    button.disabled = true;
  }
});
@blackbee ^
@OctavianDamiean not really. bend some metal into channels and make the boards. attach the boards to the channel and hook up the power supply.
so in the if(shit_validates) can i replace it with the function name ?
each strip is 48 leds and 148 surface mount resistors
~1 hour of soldering
@rlemon Oh no, no no no. That's not proper jQuery. $(button).prop('disabled') :D
@OctavianDamiean button is not a jQuery object ;) tricked you
Rao
Rao
14:09
Hi all, can i trigger edit mode of a div which is contentEditable from javascript?
shit_validates throws an error because it's a function
@Rao you mean set focus to it?
Hey guys, anyone know why .reverse() doesn't work onload with ko select data-bind?
i mean if(mail_check())
where return type of mail_check would be true?
Rao
Rao
@rlemon from javascript i want to bring the div to edit mode.. (by edit mode i mean it should be ready to take charecters from keyboard)
14:12
solved, actually have to do it on the html: options: movements().reverse()
@rlemon Since Green Peace floated down the river, chained them self to a 797 and held up production for a day, security is tighter than a nuns cnt, so it would be impossible for me to sneak you sheet metal :P
@Esailija it's very interesting, when i re-create the test, it only gets half the ops WITH strict mode, but whenever i run after that, strict mode has a very very slight performance increase over non-strict mode
^ 797, annoying to work on
@Rao Yeah, call elem.focus() (where elem is your element, of course)
oh cmon i was reading that
14:14
@Rao did you even look at my fiddle?
@redline :o
$('#formID').on('change', function() {
  // imagine you have three fields, 'name', 'email', and 'age'
  var valid = true;
  valid = /some regexp/.test($('#name').val());
  valid = /some regexp/.test($('#email').val());
  valid = /some regexp/.test($('#age').val());
  // you can validate it however you want. once you know if it
  // is valid or not you can action accordingly.
  if( valid ) {
    // enable the button
  } else {
    // show some fancy messages.
    // disable the button
  }
});
@blackbee
you can figure it out from here
o yes.. got it
Rao
Rao
@rlemon Yes i did, its getting the focus but its not coming to edit mode
@rlemon oh, sorry, didn't see you already answered it.
14:15
it already is in edit mode
try typing
@Esailija why would you think strict mode would be half as fast on first run?
Rao
Rao
@rlemon it was not working in firefox
impossibru
I call BS
I am the greetest! Now I am leaving Earth forever, for no raisin!
did you strict mode the functions or globally
14:16
the functions
Rao
Rao
@rlemon its working in chrome
outer most which are anon and run once
@Rao caniuse.com/contenteditable unless you are using FF 2 ... it works in FF
did you introduce outer functions just for strict mode?
don't BS me
14:17
and i separated them out, so i have Level1 and Level1S, Level2 and Level2S, ect.
no i used your outer most
oh rite
lol
lol
so the constructors should be strict as well
yea I will try some code with all the tracing on to see what's going on
@rlemon huh, he's right. focus doesn't trigger editing in FF
oh wait
he said it isn't editable. nothing about focus
14:19
@Esailija and if you have time and are equally curious, i would like to know your findings on the effect of chain depth for closure as well
srsly... I don't have FF installed :?
well. time to install it
Rao
Rao
@rlemon why would i lie? its not working on Firefox 19.0.2 ubuntu OS
@redline does jsperf warmup the functions
posted on June 11, 2013

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} New episode of H2M!

@Rao but you said it isn't editable.
it is always editable
all we are doing it setting focus to the div
14:20
@Esailija no idea, i could manually warm them up and instantiate each level in the global scope real quick
@Esailija or would that not have the same effect?
to make sure a function is optimized before the tests start just do var l= 1e5; while(l--) callFn()
ahahaha
i know you're serious but still
if you --enable_natives in v8
you can just do %OptimizeFunctionOnNextCall(fn);
otherwise the loop will do same thing
:P
Rao
Rao
@rlemon @Zirak It was not working when i tried on FF but later i tried on chrome and its working.. on focus its taking character from keyboard. thanks rlemon!
14:24
don't blame me blame jsFiddle
jsfiddle.net/DsACA/2/show works if you don't have the editor open
I'm trying to find a fix for FF
and there were errors being thrown in the console in FF from jsFiddle
in the link above it takes focus on page load
I didn't wait for a timeout
@Esailija yes but it's going to be new Level1() in the loop correct or would you recommend i do Level1.prototype.constructor() or is it irrelevant?
@Zirak the fix is jsFiddle is broken in FF :P
@redline just new Level() or something
14:25
yea ok good
and how do you do code, i should know this by now but i never tried
huh, interesting...it presented the same bug on tinker.io . I should stop using those sites.
> [10:25:39.905] TypeError: this._containers is undefined @ resource://app/modules/devtools/MarkupView.jsm:330
@Esailija as in here in the chat
man, I was like "How in the fuck does .focus() not work in FF, if this is the case i'm sure there would be some pretty pissed of devs.."
What is youtube coded in?
14:27
@redline I get consistently same results with strict mode 5% faster
must be some jsperf quirk
@BenjaminGruenbaum lucky charms
I am running v8 directly
@rlemon you're a funny man
I try
And I started digging into specs and docs...running a local version worked like a charm.
@rlemon python?
@Esailija 5% is about right (minus that warmup case)
to what i got
@rlemon sounds unlikely
Not a very official source
At least for the video streaming
14:31
@Esailija obviously we'd have to pass down some arguments to see the real improvements, but that tells use what it takes to access those context objects for the arguments object in each constructor
my code after warmup was
var now = Date.now();

var l = 1e4;

while(l--) {
    var c = new B(1,2,3);
}

if( c === 3 ) {die()}

print( Date.now() - now );

var now = Date.now();

var l = 1e4;


while(l--) {
    var c = new BS(1,2,3);
}

print( Date.now() - now );

if( c === 3 ) {die()}
B is non strict 1 level inheritance and BS is strict 1 level inheritance
and the parent classes are A and AS respectively
oh you did pass down arguments
interesting
here are codes
http://pastebin.com/fxmUJcba

http://pastebin.com/AJA32PBJ
the strict mode code has 33% less instruction size
for one thing
that's really nice being able to see the assembly
14:37
@Esailija how do you do that?
google youtube + python
looks like they actually do
build v8 with disassembler enabled
@Esailija i'd be curious to see why defineProperty takes 3X longer to define a getter/setter instead of a value/writable
getters and setters turn the object into a hash map
so maybe the conversion is taking so long
The Python programming language is actively used by many people, both in industry and academia for a wide variety of purposes. Integrated development environments * Boa Constructor, a cross-platform IDE for Python development * EasyEclipse, an open source IDE for Python and other languages * Eclipse with the [http://pydev.org Pydev] plug-in. Eclipse supports many other languages as well. * Eric, an IDE for Python and Ruby * Geany, IDE for Python development and other languages * Komodo IDE an IDE for Python, Perl, PHP and Ruby * NetBeans, is written in Java and runs everywhere where a J...
14:38
@Esailija that would make sense
wikipedia also lists it as being 'used'
python is really the one language I can't seem to like
@Esailija and then?
@Esailija i was only creating the one property, so it was most likely creating the hash map, defineProperty itself was still about 1/3 - 1/2 the ops of directly setting the property, but it's impossible to do that on any object if anyone in it's prototype chain already defines a getter/setter for that property name
What's up guys, I'm really close to this, but not quite there. Effort has gone in though. I'm trying to use regex to replace a string with %param1% (example) as placeholders in a function. I'm using a clever method to get the current function's parameter NAMES, but I also want their values and not sure how to progress: jsfiddle --> jsfiddle.net/DNCt3
14:40
tehn $ d8 --print_opt_code myfile.js > myfile.asm
anyone here know about rails/ajax/jquery?
@fnkr 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.
Florian, have you tried its specialties?
@Btuman just ask your question, please.
@Jimbo you want like sprintf?
14:42
@redline yeah I don't know about definition speed but turning object into hash map is not what you want... imagine every property access being a hashtable lookup
@Esailija so defineProperty is always required
@Fnkr, its just a question on how to separate the effects of a jquery method in an js.erb file
@rlemon Nah, just the finishing line to my code - is for learning :) - I have seen sprintf implementations (mainly because I'm using the function parameter names and values for the sprintf equivalent)
since the rails ajax makes a single click activate all the code
It works in jsfiddle]
(well kinda)
@Esailija does "$" in a property name trigger a hashmap? cause it's not a valid C++ name...
14:44
now you see why I checked if anyone knew about it first
so ther
@redline no
*there
anything you can use in a dot access is fine
except numbers
@Esailija i wonder how they make that work
integers are still fast to access with certain cases
so obj[1] is very fast
but if you suddenly define very sparse numbers
like obj[315000] =
you lose that speed too
14:46
@Jimbo the entire thing is flawed.
why are you basing it off param names
and why are you not using arguments
@Esailija so since defineProperty with value/writable was 3X as fast than get/set, are we assuming this to be it creating the hash map? does this mean defineProperty itself doesn't cause a hashmap to be created, but only in the case of a get/set?
@redline it's arbitrary decision
to make nonidentifier names turn into hash map
@rlemon I am, but I'm also replacing strings (sprintf-style) depending on the parameter names passed in, not their values
@Esailija and if so, then why would Object.create hurt performance then, because i could theoretically provide the second argument with only value/writable properties
defineProperty doesn't make hash map if you don't use get/set
but there is a limit in descriptor size
that if you cross it, you get a hash map
14:48
do you know that limit?
@Jimbo you are not using the arguments object, and you should pass them in as an object
then the function doesn't define the argument names, the passed object does
@Esailija so the second the limit is crossed or a get/set is added, all hell breaks loose and you get a hashmap, correct?
@rlemon Ah, I see, so seeing as I'm passing 'strings' not objects into the function, do I need to pass in [a = "value for a", b = "value for b"] to the function - something like that? I haven't used arguments before :P
// Ensure the descriptor array does not get too big.
    if (map_of_this->NumberOfOwnDescriptors() <
        DescriptorArray::kMaxNumberOfDescriptors
and that value is..
uhh
static const int kMaxNumberOfDescriptors = 1024 + 512;
lol
@redline all this is for v8, it doesn't take firefox into account.
just making sure you're aware of it...
14:51
yeah but v8 source is 500x more readable :P
@FlorianMargaine yes i understand that, but if one engine has a significant advantage in some of these key things then that can be leveraged in the development of a private application where you control the browser being used
and either way, it's cool shit
@Jimbo arguments list is an array like object. I would pass in a map to the function.
something like this:
String.prototype.strangeFormat = function(replacements) {
    var str = this;
    for( var key in replacements ) {
        str = str.replace(new RegExp('%' + key + '%', 'g'), replacements[key]);
    }
    return str;
};
alert("this is a %a% for %b%".strangeFormat({a: 'test', b: 'Jimbo'}));
// this is a test for Jimbo
@copy do you generate documentation for modules with pydoc?
@rlemon Or just use Mustache
@rlemon you should use a function for the regex so you don't cross-replace
@BenjaminGruenbaum Nope
14:55
@rlemon
var $format = function($string)
{
// Get the arguments
var $arguments = arguments;

// Return the formatted string
return $string.format(/\{([0-9]{1,2})\}/g, function($0, $1)
{
// Get the argument index
var $argumentIndex = parseInt($1, 10) + 1;

// If the argument index exceeded the number of arguments, use the match as the replacement
if ($argumentIndex >= $arguments.length)
return $0;

// Get the argument
var $argument = $arguments[$argumentIndex];

// Catch null and undefined
if ($argument === null || $argument === undefined)
PHP?
you can press format code button
var $format = function($string) {
        // Get the arguments
        var $arguments = arguments;
        // Return the formatted string
        return $string.format(/\{([0-9]{1,2})\}/g, function($0, $1) {
            // Get the argument index
            var $argumentIndex = parseInt($1, 10) + 1;
            // If the argument index exceeded the number of arguments, use the match as the replacement
            if ($argumentIndex >= $arguments.length) return $0;
            // Get the argument
like that
what button does that
the format code button next to send / upload
@redline $varname makes me not like you
14:57
there are no buttons next to send/upload
there are

when you make multiline message
the button appears from nowhere once you have multiline message
@rlemon yea well PHP was my first language ever and i find it to be a good separation of variables in JS, and my minifier doesn't give a crap
but I give a crap
and why alias arguments to $arguments
seems stupid
14:58
Actually, I use $ when caching Elements
@rlemon because you are going into another function scope and HAVE to, duh
var $el = document.getElementById("myElem");
As far as I know, that's the convention
If it starts with a $, it's for selectors
there are other ways about it
hungarian notation
$varname is so ugly.
the only times I use it is if I have to work with jQuery and non jQuery objects
14:59
well that's most readable IMO and uses nothing crazy-deprecated like callee or whatever

« first day (969 days earlier)      last day (4201 days later) »