« first day (146 days earlier)      last day (4816 days later) » 

7:00 PM
The js weekly guy is late >:(
Getting the js weekly, highlight of my friday. :(
Friday evening. Sits around waiting for the JavaScript Weekly.
 
Really? Friday evening I forget what JS means and play SC2 :P
 
user1385191
:)
 
7:17 PM
ffffffail
 
user492203
Hi! :)
 
user1385191
what? it doesn't fail at all
 
temp is not defined ;)
 
user1385191
refresh it
 
user1385191
I was playing with some stuff
 
user492203
7:19 PM
@Raynos native-yours1-yours3: tie; yours2: 51% slower (CR11)
 
user1385191
lol, native is 99% slower in safari
 
user492203
15 hours ago, by jon3laze
everyone in JS chat should change their avatar to the jQ logo. :P
 
user492203
I did; do a hard refresh! :)
 
user492203
 
user492203
Shaz did it, too...
 
user492203
7:25 PM
 
wtf
now where did the garden get featured?
 
Shit! You got dailyJS
thats just EPIC win
 
user492203
@IvoWetzel Change your avatar to the jQuery logo! :D
 
2 messages moved to bin
 
@Raynos yay, no wonder my whole GitHub timeline is full of "XYZ has started watching Garden"
 
user1385191
7:32 PM
Raynos, to that comment on your answer about forward loops being quicker than backward ones, click my link again.
 
Of course backwardsd is faster
you do less maths
UGH
cache the length -.-
 
user1385191
heh
 
user492203
Could someone jsPerf which is faster? I can't seem to be able to do it, it crashes my browser.
 
user492203
Preparation:
 
user492203
7:36 PM
var str = '1.2.3.4';
 
user492203
Snippet #1:
 
user492203
str.replace(/\./g, '');
 
user492203
Snippet #2:
 
user492203
while (str.indexOf('.') !== -1) {
    str.replace('.', '');
}
 
How come your in line one is faster
 
user1385191
7:38 PM
I'm getting fluctuation between the loops now that I've cached the length
 
user1385191
Good call though.
 
Is the function call overhead actaully significant?
Wow. the function call overhead is murderous
 
user1385191
yeah, just tested it
 
user1385191
very interesting
 
hi folks
 
any node.js lvl 80 paladins here?
 
user1385191
try making inline reverse a method via the prototype
 
@yojimbo87 what do you need? (WoW quotes are quite lame, imho.)
 
user492203
> Array.prototype.concat.call('foo', 'bar');
["[object Object]", "bar"]
 
user492203
How?
 
7:45 PM
...
Your calling it on foo with bar
 
@Raynos I would like to know what IDE do you prefer to use when writing node.js programs
 
@yojimbo87 I'm between cloud9ide & ehm webstorm
 
@Raynos online version of cloud9 or cloned?
 
@yojimbo87 I use the hosted one because im lazy :)
 
user492203
@yojimbo87 I don't use node.js (or any serverside JS), but mine is Notepad++. :)
 
7:48 PM
@Nyuszika7H Array.prototype.sort.call("foo") String to array conversion is strange. don't do it
 
@Nyuszika7H well I recently switched from cloud9 to notepad++ :)
 
@yojimbo87 notepad++ isn't an IDE ;) If your going to do that use vim
 
user492203
@Raynos strange. 'foo'.split('').sort().join(''); works as excepted.
 
@Nyuszika7H -.- thats because split is an operation on a string. Split is a method of String and returns an Array
 
@Raynos yeah I know but it has some IDE features
 
user492203
7:50 PM
@Raynos I know, I've just said that it's strange that yours doesn't work. It would be nice if it'd work.
 
...
Dont call array methods on a string!
You can try Array.prototype.sort.call(["foo"])
0
Q: Calling Array methods on different types

RaynosArray.prototype.sort.call("foo"); // "[object Object]" Array.prototype.sort.call(true); // true Array.prototype.sort.call(1); // 1 Array.prototype.sort.call([1]); // [1] Array.prototype.sort.call({}); // {} Array.prototype.sort.call(function() {}); // function() {} Why does the calling an array...

I stole your question @Nyuszika7H :D
 
user492203
@Raynos you little creature! :P
 
@Raynos I tried vim but it's too hard core and visually unfriendly to me
 
user492203
@Raynos Anyway, why is it tagged ?
 
@Nyuszika7H RAGE
@yojimbo87 moar hardcore. Like I said try WebStorm. It's the best JS IDE.
 
user492203
7:58 PM
@yojimbo87 agreed, same for me
 
Its the new Object("bar")
 
user492203
Hm, what's the difference between vi and vim? I thought it was a typo, but it seems it isn't.
 
@Raynos it's commercial stuff :/
 
@yojimbo87 theres an OS licence.
Its only £50
 
@Nyuszika7H vim - vi iMproved I think
 
7:59 PM
VS2010 is what? 5k ?
@Nyuszika7H vi is MOAR hardcore.
 
@Nyuszika7H vi is old; on many newer systems it's a symlink to vim.
 
vim is easier
 
user492203
@yojimbo87 So it's a recursive acronym? (almost)
 
@Raynos VS2010 pro is around 1k euros in my country
 
vi is "visual"
 
8:00 PM
Ultimate is 5k
Anyway you can try netbeans if your a cheapskate.
 
@Nyuszika7H according to wiki it's Vi IMitation
 
user492203
I stole your answer @Raynos :D
 
@Raynos I'm now using notepad++ with JSlint which is pretty handy and WinSCP for ssh-ing to server where are source files ... JSlint as plugin to npp
but I'm worried about debugging
it was pretty much easy in cloud9
 
@yojimbo87 Yeah I did that. use the node debugger ;)
 
@Raynos yeah I was watching ryan dahl's vimeo video on built-in debugge but visual experience is kinda different compared to cloud9 :)
 
8:09 PM
Yes
Just use 9ide ;) If you dont like then develop for cloud9ide and request a pull request
Features missing? Implement them. Help the OS community
 
user492203
@yojimbo87 there's jsLint for Notepad++? where?
 
@gsnedders @IvoWetzel why does new Object("foo") return ["object Object"] ?
@Nyuszika7H google ;)
 
user492203
@yojimbo87 thanks ;)
 
@Nyuszika7H no problem, glad to help
I was also searching for ssh/shell plugin but without any luck
 
8:12 PM
@Nathan You get a whiff of the tsunami or are you inland?
 
yeah like 400 miles inland :)
maybe only 350.
 
Seriously...
 
sounds like the Aleutian islands are getting a taste of the tsunami though.
 
new Object("foo") === "[object Object]" What's going on?!
 
who in their right mind still uses AOL...wtf
 
user492203
8:15 PM
@Shaz two jQuery users don't fit in one room :P
 
xD
jQuery.clone();
 
user492203
@Raynos new String('foo') === '[object Object]'. More strange things.
 
talking to a customer, asked him to close his browser and i hear the infamous "Good Bye"..."Uh...what browser were you using?" "Oh...uh...AOL?"
 
user492203
@Shaz It's jQuery.sub(), added in 1.5.
 
@Nyuszika7H it's because of the new keyword ;)
 
user492203
8:21 PM
var jjQuery = jQuery.sub();
jjQuery.extend(jjQuery.fn, {
    // some new methods for jjinguy
});
 
user492203
This is for you @jjinguy! :)
 
@MylesGray my town has its own news today; a group of wackos got arrested for conspiring to kill police and a judge. I suppose we've got nothing on Northern Ireland though.
 
Hi, why does this not work please: <html><head><script src="jquery.min.js"></script>
<script>$("#testx").hide();</script>
</head><body bgcolor="grey">
<div id="testx">TEST!!!</div>
</body></html>
 
@Nathan when it comes to killing officials... Northern Ireland takes the cake
 
user492203
@David19801 Use Ctrl+K to format code blocks, please! :/ It's much more readable that way!
 
8:22 PM
@Nyuszika7H chill man
 
its just 4 lines of html...come on :)
 
yeah that's a little harsh
 
user492203
@David19801 but it's still uggly
 
true true :D
 
@David19801 you need to put your code in the onLoad() handler.
 
8:23 PM
$(function(){$("#testx").hide();});
 
I see...hmm...ok thanks guys, back to the tutorials it seems!
 
What are you people using for making cross-domain requests (with error callbacks)?
 
Just had to delete my 9 year old brothers Facebook account
set one up without telling anyone
>.>
 
So, what the dilly?
 
$(document).ready(function(){
	$("#testx").val("101010");
});
Doesn't work...how come?
 
8:31 PM
testx isn't an input or textarea
 
Hi shaz, the rest is:
</script>
</head><body bgcolor="grey">
<div id="testx">TEST!!!</div>
</body></html>
Doesn't it just update whats between the div's?
If not, how could I do that?
 
@David19801 uset $("#testx").text("101010");
 
Use .html() or .text() instead of .val()
 
cool! thanks
whats the difference between html and text?
 
.text() won't render html I believe
 
8:33 PM
so like if I put in < and > and stuff right?
 
Yes, html
 
and lastly, why does this not do the blinking as I expect:
$(document).ready(function(){
$("#testx").hide().delay(1000).show().delay(1000).hide().delay(1000).show();
});
 
@ircmaxell ?
 
I dunno, what's up?
 
8:39 PM
Nothing much, spent most of the day watching the tsunami unfold
what about you?
Still want to know what happened to that passenger ship carrying 100 people that went missing
 
wow cool! thanks shaz
 
@David19801 Might not be the best way to do that but it's one way :)
 
why did my way not work?
 
I believe .delay() only works best after an animation (.animate())
 
I see. That explains the mess on yesterdays testing too.
Thanks again
 
8:43 PM
@David19801 No problem. :)
 
@MylesGray ships are theoretically good places to be in tsunamis, if they're far enough offshore.
 
@David19801 <blink> I should be blinking </blink>
 
@Nathan Yeah I know that but it is worrything they dont know where it is
 
@Raynos Unforgivable.
 
and I don't think "far enough" has to be very far. Anywhere deeper than the tsunami's height should work.
 
8:46 PM
@Nathan given the tsunami was only what? 30ft? Maybe depending on the shelf drop off could by anywhere from 100meters to 2-3km
 
right
 
they were luck though
i know it is a terrible thing to say but
"only" 300 people died
 
in some cases, just outside the harbor a boat would be perfectly safe, but everything in the harbor will be destroyed.
 
which is amazing for a disaster of that magnitude
 
did they get the nuclear reactor cooling problem under control yet?
 
8:48 PM
@Nathan well yes but the pressure is 1.5x the normal level
 
@MylesGray Not too much, keeping busy with my new project...
 
they are tlaking about exhausting gas (sligthly radioactive)
@ircmaxell Is it a secret or okay to ask?
 
oh ho, youve gone Git?
 
ja
 
8:49 PM
Nein!
 
@ircmaxell what made you move from SVN?
 
I don't like making my svn server public. And I want to encourage people to contribute
 
@ircmaxell Best reason I've heard yet!
 
Oh okay cool :)
 
Which?
:-D
 
8:51 PM
on the github note, I have FINALLY got live updating here:
@ircmaxell I think he means the second
 
@ircmaxell "to encourage people to contribute"
 
Yeah
 
@ircmaxell Can I be thick and ask how it works/what it does?
 
You can be as think as you want
As far as what it does / how it works,
What it does: Provides all the things you'd need for any cryptographical need in PHP
How it works: how much time do you have? :-P
 
hashing, pw strength test etc?
 
8:57 PM
No strength test
although that may be something to add later...
The key features that I haven't found anywhere else:
1. Strong Random Number generation
2. Standards Compliant password hashing
3. True Cryptographical Key Generation
Oh, and I plan to add secure cookie support
 
oh cool :)
The random number generation
are we talking like a keyfob matching random number?
 
Can I somehow make an cross-domain request which is not in JSONP format?
 
like vasco keys?
 
No, that's pseudo random.
 
Oh so the random number generation would be used for URL encoding?
 
9:03 PM
Well, for a lot more than that. You can use it for CSRF tokens, one-time-use passwords, encryption, etc...
 
@ircmaxell well the CSRF is sort of the same as the key pairs that vasco token?
 
oh, garden's also on hacker news :)
3
	JavaScript Garden (github.com)
	228 points by aundumla 7 hours ago | 31 comments
 
@IvoWetzel great job, congrats
 
@MylesGray Well, the difference is the keyfob random numbers are actually a random looking sequence
@IvoWetzel Awesome!!!
 
@ircmaxell I don't do a lot with .NET but I recently noticed they have a quite thorough crypto API, which might be worth a look.
 
9:07 PM
@IvoWetzel o/. Whilst your here. Solve my problems!
 
@Nathan I know, I am using some of it when it's available :-D
 
@ircmaxell nice.
 
@ircmaxell of course they are all based on an algorithm thats how you can have key pairs
 
@MylesGray There is no pair concept
it's a single number...
 
Of course I was also annoyed at how many lines of C# I had to write just to get an md5sum...
 
9:09 PM
but if two separate machines create the same code at the same time = pairing?
 
well, it's a sequence
and based off that, they can guess the next one
 
So how does yours differ?
 
it's non-sequential
 
so completely random?
 
it would be exceedingly difficult to predict the next value even if you knew the past 2^128, and could compromise some of the system's random sources
Not completely. It's not true random. But it's very strong pseudo-random with some true randomness take from system calls
 
9:14 PM
eats spicy Thai red curry!
 
@ircmaxell So you are using 128-bit encryption?
much like WPA/WPA2?
 
Not really. It's using symmetric block ciphers at the moment
 
So it equals a 128-bit key but is made up of smaller 32-bit blocks?
Ahh nevermind I see
it breaks inputs longer than 128-bits into blocks and encrypts those individually
so repetitions in plaintext = repetition in the cypher?
 
Who has a minecraft server?
I decided to give in and try it
 
9:36 PM
lol @ crockford - "If your RegExp is longer than 2 inches... use another method"
 
@MylesGray where's the fun in that?
 
@Nathan RegExp is Beelzebub's poetry
 
user492203
Hi again! :)
 
user492203
I prefer fiddle.jshell.net over jsfiddle.net to avoid flooding the console with the Same Origin Policy thingy. I asked @jsfiddlesupport on twitter why they have two domains, they said cookie security.
 
cookie security?
 
@nyuszika7h cookie security
 
user492203
@js_fiddle Any reason for having two domains: jsfiddle.net and fiddle.jshell.net?
 
user492203
10:02 PM
I wish twitter would support Gravatar...
 
user492203
in The Tavern (General) on Meta Stack Overflow Chat, 6 mins ago, by badp's sockpuppet
Oh well I didn't know somebody actually used chat.SO
 
user492203
<DIV
    style="position:absolute;width:100px;height:100px;background:#EEEEEE;border:1px solid black"
    onmousedown="startdrag(this, event);"
>drag me</DIV>

<SCRIPT>
//mouse down on dragged DIV element
function startdrag(t, e) {
    if (e.preventDefault) e.preventDefault(); //line for IE compatibility
    e.cancelBubble = true;
    window.document.onmousemoveOld = window.document.onmousemove;
    window.document.onmouseupOld = window.document.onmouseup;
    window.document.onmousemove=dodrag;
 
user492203
this is overcomplicated – source
 
user492203
document works fine, no need for window.document. And it uses inline event handlers (!)
 
10:34 PM
haha
on JSWeekly (again)
 
user492203
jsLint has a tolerate continue option, but no explanation at all why is it bad.
 
@Nyuszika7H This is one of the reasons I love Crockford. All he says about continue :
"Avoid use of the continue statement. It tends to obscure the control flow of the function."
 
user492203
Yeah, right, there's better solutions.
 
user492203
Using continue:
 
user492203
10:47 PM
function countUp(to) {
    for (var i = 0; i < to; i++) {
        if (i === 13) continue;
        console.log(to);
    }
}
 
continue is like break label which we were discussing yesterday, which is like goto
 
user492203
Without continue:
 
user492203
function countUp(to) {
    for (var i = 0; i < to; i++) {
        if (i !== 13) console.log(to);
    }
}
 
user492203
@Nathan break label?
 
however: I often prefer continue and break for readibility.
 
10:48 PM
@Nyuszika7H Is that a big problem?
 
user492203
@sdleihssirhc No.
 
They seem pretty much the same.
 
user492203
@Nathan So that's what labels are for.
 
10:51 PM
@Nyuszika7H if you have a lot of stuff, not just one console.log() line, the continue version avoids yet another set of parens and can be more readable.
Code Complete has a good chapter about this sort of thing IIRC.
 
user492203
Aren't labels like functions?
 
@Nyuszika7H more like FORTRANS goto
 
when you set a cookie via js how does the client pick it up?
 
@eggie5 the js runs on the client
 
like the server sets cookies in the client by use HTTP headers
 
10:57 PM
@MylesGray I sent you an email. Go read it! :D
Also: hello again, all
 
user492203
@Angelina Hi!
 

« first day (146 days earlier)      last day (4816 days later) »