« first day (55 days earlier)      last day (4911 days later) » 

6:00 PM
sec
I'll show you the code, but I figured it out
 
hehehe great ^^
for you
 
well
I can't show you all the code because it is a pretty big app
some 42-50 files
 
don't worry ^^
 
// To get the scroll position,
// add the current top with the absolute value of the first element
var offset = $(element).position().top + ($("#document-list li:first").position().top * -1) - 100;
$("#documents").scrollTop(offset);
 
user492203
Hi! How do I do this jQuery code in pure JS? (typing)
 
6:08 PM
What jQuery code in pure JS?
 
user492203
a moment, writing it
 
@IvoWetzel stop hacking
 
@CodingKitten: Please stop your master from doing us more harm...
 
@ircmaxell sorry , can know a lot, every detail about chrome, its a throwing an int32 though, it as one
 
lol
 
6:10 PM
Does anyone know of a good way to do async unit testing?
 
async?
 
user492203
To be exact, I have this in pure JS: document.getElementById('shonlinelist'). Now, how do I get specified child elements of that?
 
timeOut(f, 2000);
assert("timeout happened");
 
@Nyuszika7H: what do you mean "specified child elements"? .children contains all children, and .getElementsByTagName will get all children with a tag name....?
 
6:12 PM
The only way I can think of is wrap the assert in a bigger timeout but that feels hackiesh
 
@Raynos: Yeah, that does feel hackish. I guess you could wrap f in a callback, and setting a timeout that if it doesn't hear back in 2050 mark as failed...
 
I mean timeOut(f, 2000) is part of some larger code and I want to externaly unit test it
 
user492203
var onlineUsers = $('#shonlinelist [class^=c]').length; // notice the whitespace before the opening bracket [
$('#shonlinelist').append(' ' + onlineUsers);
 
var constructor  = fun() {
     // bla
    this.foorbar = fun() {
        /// bla
        If (baz) timeOut(fun() {}, 2000);
    }

}
 
user492203
This is my jQuery code.
 
6:17 PM
@CodingKitten how do I add two numbers with JavaScript?
 
@Nathan So no js error, and none of the same problem =_=
 
user492203
@CodingKitten say hello
 
@Nyuszika7H right now there's nothing going on c++!
 
user492203
@CodingKitten LOL
 
@CodingKitten go and die
 
6:18 PM
@Raynos If you should leave it as it in crankshaft is your global code!
 
user492203
@CodingKitten document.write('Hello, World!');
 
!kitten die
 
@Nyuszika7H mind helping me out more stuff come from trying :)
Huh? What's a "die" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
Someone remind me what command I need to get the bot to crash?
 
hi all, How can i send some data associated with a url to another page and use it
 
6:19 PM
!kitten
 
!kitten
We have a bot?
 
!kitten
 
!kitten die
 
Huh? What's a "die" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
hi guys, please help me out
 
user492203
6:20 PM
Yes. Type something after !kitten. Only users with 200+ rep can use it.
 
!kitten Test
 
hi all, How can i send some data associated with a url to another page and use it
 
Hold on a second, googling that for you... "Test did you mean horrible typo?" There you go!
 
I don't see it..
 
@nikhil you can put data in the URL? I don't unnerstand your question
 
6:20 PM
!kitten lolwat
 
oh sorry,
 
!kitten lolwat
 
Hold on a second, googling that for you... "lolwat did you mean horrible typo?" There you go!
 
!kitten test
 
user492203
Try this: !kitten say something
 
6:21 PM
Huh? What's a "test" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
!kitten Make Cookies
 
!kitten http get parameters
 
Hold on a second, googling that for you... "Make Cookies did you mean horrible typo?" There you go!
Huh? What's a "http get parameters" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
What other things does it respond to?
 
!kitten say EVERYONE STOP USING ME TO SPAM THE BOARD
 
6:21 PM
EVERYONE STOP USING ME TO SPAM THE BOARD
 
@CodingKitten wtf are you useful for?
 
@Nathan Meh, forget it. Not in the mood for 2 minutes. ? | 200 # I'll spin the shortcuts
 
hehehe
 
This spam is not funny
 
!kitten say @Raynos is mad!
 
6:22 PM
@Raynos is mad!
 
i mean that i have a hyperlink like this,<a href="target.html?somedata">click</a> and data associated with the link must be available in target.html
 
Totally not funny.
 
!kitten help
 
unfortunately @nikhil, you'll need to parse document.location
 
i mean that i have a hyperlink like this,<a href="target.html?somedata">click</a> and data associated with the link must be available in target.html
 
6:23 PM
!kitten jstruth
 
how do i do tht?
 
!kitten ban Chacha102
 
Congratulations Chacha102 you have been rewarded with the [BANNED]-Badge.
 
!kitten ban MALON
 
Congratulations MALON you have been rewarded with the [BANNED]-Badge.
 
6:23 PM
!kitten bans
 
i mean that i have a hyperlink like this,<a href="target.html?somedata">click</a> and data associated with the link must be available in target.html....how do i do that
 
Kitten doesn't like yu Chacha102!
 
user492203
@IvoWetzel For wob and say, we still need 500 rep :/
 
Now why am I banned?
 
6:24 PM
!kitten bans
 
@IvoWetzel banned jon skeet & jeff atwood xd Epic
 
user492203
@CodingKitten hello
 
@Nyuszika7H The maths isnt the help for 2 minutes. ? | 500 # I'll show you need (from my view): Talent, Skill, Dedication, Experience, Passion and find constructs ><
 
@NickCraver does WebStorm have integrated testing suite
 
lol
 
user492203
6:26 PM
@CodingKitten Meow!
 
@CodingKitten what is javascript?
 
@Nathan Yes it dared, but the source!
 
user492203
@Nathan !kitten ? javascript
 
!kitten ? javascript
 
Huh? What's a "javascript" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
6:27 PM
@IvoWetzel have two settings on the bot. One light no spam option in here and one spam cannon in sandbox
 
user492203
@Nathan Hmm.
 
!kitten help
 
!kitten ? java
 
Everytime you say Java, I kill a carpet. Twice.
 
Sorry for offtopic, but where can i get these chars like this '' ?
http://dreambag.se//var/site/storage/original/application/6fdaeb3af365dbe29d113fcb97156cde.swf?file=/swe/layout/set/xml/content/view/xml/123/%28img_size%29/original
 
user492203
6:28 PM
!kitten join 1
 
It's like a nicer version than ''
anyone knows?
 
@Karem maybe copy them from here? en.wikipedia.org/wiki/Quotation_mark
 
thank you!!
alot!
 
@Nathan entities are ugly
 
user492203
6:29 PM
@CodingKitten WHO is @CodingGorilla ?
 
@Nyuszika7H now that book for a long time. Just do that silence must be filled with IE8, I assume?
 
@Nyuszika7H "!kitten wisdom CodingGorilla"
 
@thejh use gifs then
 
@Nathan heard about Unicode?
 
@thejh when i copy paste it gets like this: “
 
user492203
6:30 PM
@thejh I don't have 200 rep
 
@thejh, is that like a unicorn?
 
user492203
@thejh Would you do that for me?
 
@Nathan graah!
!kitten wisdom CodingGorilla
 
spaces...
 
@Nathan I really hope that you're kidding...
 
6:32 PM
Hello
 
user492203
@thejh try that at The SO Tavern
 
!kitten wisdom Coding Gorilla
 
@thejh, @Karem how about with CSS like here? stackoverflow.com/questions/454457/smart-quotes-using-jquery/…
I don't see anything wrong with entities though for stuff like curly quotes and ligatures.
 
@Nathan well, simply putting the actual characters in the code gives it better readability
 
@thejh I'd be more worried about cross-browser compatibility with fancy unicorn chars than I would with html entities.
 
6:39 PM
@Nathan please don't say unicorn
@Nathan also, Unicode isn't fancy bleeding edge new stuff, it's normal
 
@thejh Meh. My big dumb company uses Enterprise Grade everything, like IE 6. Not everyone is there yet.
though I think IE6 would handle that fine
it'd be the weird old mobile browsers that might not
maybe I'm just crusty and old
 
7:07 PM
@CodingKitten What's up?
 
@IvoWetzel I to close as exact duplicate see comment wrong wording there :P
 
Am I wrong in pointing out that this is Exception abuse in its purest form?
0
A: Returning on a recursive function in php

goreSplatterThere's no return in the recursive call. Hence, no result. In my opinion, a more elegant solution would be to use Exceptions: $xml = simplexml_load_file("file1.xml"); $xml2 = simplexml_load_file("file2.xml"); try { $result = parseNode($xml, $xml2); print "ALL THE SAME"; } catch(Execption $...

 
No, this code is outright horrible...
@CodingKitten What do you think about that?
 
@IvoWetzel i mean that i mean horrible typo?" There you need/want to edit:
 
@IvoWetzel it's generating random text?
 
7:15 PM
can't stand exception abuse
 
@ircmaxell Exceptions? Are you talking about that cool way to return data to calling methods through others?
 
LOL: EDIT Do not up-vote this. ircmaxell is right. I have removed the exception part of my answer. why not just delete the answer?
 
@IvoWetzel ah, cool
 
Hi ircmaxell ^^, is there a way to store a value of and image in a variable that will change, like this

var originalImage = jQuery('#imglightbox img').attr('scr');

so after a mouseleave restore the value...
 
7:16 PM
@CodingKitten What's wrong with exceptions?
 
@IvoWetzel lol I still say hello
 
yes...
 
@CodingKitten you're not on IRC here!
 
@thejh right now there's nothing going on c++!
 
@Omegakenshin: You could create a new attribute and store it there (oldsrc for example), or you can store it in a property on that object...
 
7:17 PM
@CodingKitten what is c++?
 
@thejh If that's accurate, certainly discourages someone from trying :)
 
haha
 
@IvoWetzel is it just random or is it related to the question?
 
@thejh More or less random
 
so, I copy the attr in another attr and after all, grab that the oldsrc to restor it, right, its like that??
I give it a try
 
7:18 PM
is it built on heuristics? Where it learns from what others say (I use the term learn very loosely)...
 
> The algorithm starts by printing any N consecutive words (or letters) in the text. Then at every step it searches for any random occurrence in the original text of the last N words (or letters) already printed and then prints the next word or letter.
 
@Omegakenshin, something like this var node = jQuery('#imglightbox img'); node.oldsrc = node.attr('src');
 
so in fact, it's completely random, but if some AI genius wants to come of with a machine learning algo...
 
ahh, so it's purely random, but might produce intelligible sentences at some point...
 
user492203
@Omegakenshin use .data()
 
user492203
7:20 PM
For example:
 
@CodingKitten Do you think that you're intelligent?
 
@IvoWetzel is that like curly quotes and data associated with .selected scroll to the same thing
 
guess that's a.... uh
 
@Nyuszika7H ok I research that TY
 
user492203
$('#someimage').data('origWidth', $(this).width());

// After that, you can manipulate the width, and get the original one with this code:

$('#someimage').data('origWidth');
 
7:21 PM
has no idea about .data()...
 
user492203
 
@CodingKitten any idea about .data()?
 
@IvoWetzel So at silence, surely? :) your case is that you should leave it to work consistently :P
 
again, I'm not a jQuery developer... So learn something new every day (or see something new)
uhhhh....
0
Q: Why limit site to "many desktop PCs" and no mention of laptops?

TshepangFAQ says I can ask questions here when I manage many desktop PCs. What if I manage 100's of laptops?

 
@ircmaxell Thanks for your help ^^ I really apreciate it
@Nyuszika7H Thanks a lot, I try that ^^
 
7:24 PM
No problem @Omegakenshin... Anytime I can help...
 
user492203
api.jquery.com is the best resource for jQuery.
 
in Sandbox, 27 secs ago, by Coding Kitten
@IvoWetzel Hold on a reason. nap time with the spam is it will instantly sound a framework like jQuery in the parentpage won't work unless I hate you guys
 
@IvoWetzel well, could you store, for each word, the number of times it was in answers to which words and after which words it came?
 
in Sandbox, 13 secs ago, by Coding Kitten
@IvoWetzel for (i = 0; i do something else)
@thejh Hm, would need tp plug that into the current algorithm somehow
 
I still think @IvoWetzel should build a full blown symbol table and natural language interface
 
7:29 PM
@ircmaxell Sure... but I fear that it will be way less funny than it's now
 
once upon a time I saw a cool article about an infobot written in Perl. Lemme see if I can find it.
 
true, but it might actually be... I don't know... Useful?
 
So if i want to return the .attr src of an image will be like this?
jQuery('#imglightbox img').attr('src',jQuery(this).data("oldsrc"));
 
I built a couple of them once and it was fun when they fooled people into interacting with them, and the people were like "that guy is smart and helpful!".
 
7:32 PM
Mine had about 500 phrase responses that it learned over time.
 
@Omegakenshin did you try that in the console?
 
user492203
@Omegakenshin this can only be used inside functions. Use $('#imglightbox img').each(function() { $(this).attr('src', $(this).data('oldsrc')); });
 
so even if you didn't address it, it would reply to certain things.
One of the cool things it did was check versions (it was used in a IRC chat for an open source project). If someone wrote 1.5.4 in their post, it would automatically respond and tell them the latest version was blah and they really should upgrade (plus links to docs, etc)
 
user492203
@Omegakenshin Or if you want to have a shorter code: var imglighbox_img = $('#imglightbox img'); then you can use $(imglightbox_img) (notice: no quotes!) to get that element, everywhere. (Certainly, you can change the variable name to anything else, except reserved words [Google it]).
 
@ircmaxell @Nathan Then infobot thing looks nice, gonna try to add something like that in tomorrow
 
7:35 PM
sweet
 
user492203
Leaving now. Returning in about a hour.
 
@Nyuszika7H um, why $(imglightbox_img) instead of just imglightbox_img?
 
sorry to ask you so many things but I'm learning jQuery, i get a error when I try to get the value of scr... this is my code

jQuery('#imglightbox img').data('oldsrc', {jQuery(this).attr('src')};

(note: i use jQuery for escape a conflict)
 
I asked the kitten whether it wants to be an infobot...
in Sandbox, 41 secs ago, by Coding Kitten
@IvoWetzel See my answer, I sincerely hope no one twice in the bot. One light no js error, and posting rchernisms
 
user492203
@Nathan The same because you can't use jQuery functions with pure JS: document.getElementById('someimage').attr('src', 'something'); Just try it in console, it won't work, I'm 100% sure.
 
7:37 PM
woah! That hour sure passed fast
 
7:56 PM
Im impressed
 
@CodingKitten You're impressed too?
 
@IvoWetzel Meh, forget it. Not what kind of luck with useless conversation?
 
Not really...
 
I mean im impressed that there are tutorials about javascript not dated from 2000 giving shit advice. :P
Im used to w3schools & internet.com
I didnt realise they "sell" tutorials :\
 
@CodingKitten Anything funny to say before we leavee?
 
8:06 PM
@IvoWetzel learn from "experience" comes from "experience"
 
lol
 
nice
 
@CodingKitten Well then good night.
 
@IvoWetzel what error are times when good enough is quite acceptable. Hence why there's contents(), which gets all children, including text nodes
 
/me tries the SE chat extension
refreshes and tries again
hoho!
 
8:12 PM
hiho
 
Apart from @IvoWetzel who else has nodejs experience
 
8:34 PM
@ircmaxell whats your opinion of TDD
 
hmm... the with keyword should also work here, right?
1
Q: eval() with variables from an object in the scope

thejhHello, how can I execute a string as code (using eval()) and give it some variables? For example, I've got an object named vars and want each of its properties to be accessible for the code without exciplitely specifying the objects name. Something like this: function evalWithVariables(func, va...

hmm... semms so
 
@Raynos: I'm not going to say it's bad (it isn't), but I'm more of a fan of FDD (Feature Driven Development)...
 
8:54 PM
0
Q: Unit testing event driven javascript

RaynosI'm writing a server-side application with node.js and would like to include unit tests. One thing I'm struggling with is a good way to unit test EventEmitter and setInterval/setTimout What options do I have to unit test asynchronous server side javascript? I'm aware I can just attach another l...

Whats this whole agile thing I keep hearing people talk about
 
hehehe
 
But what actaully is the essence of agile programming
 
Agile software development is a group of software development methodologies based on iterative and incremental development, where requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. The Agile Manifesto introduced the term in 2001. History Predecessors Incremental software development methods have been traced back to 1957. So-called "lightweight" software development methods evolved in the mid-1990s as a reaction against "heavyweight" methods, which were characterized by their critics as a heavily regulated, regimented, micromanage...
 
Should have seen that coming
 
hehehe
As far as the guiding principals:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan
 
9:09 PM
Raynos we both had the same idea :)
0
A: eval() with variables from an object in the scope

salatheAn option to forgo eval() is to generate a function and then use with(), as you did, to change the block scope: function evalWithVariables(func, vars) { return new Function("v", "with (v) { return (" + func +")}")(vars); }

 
@salathe why should I do that? to prevent func from getting to the function?
 
`@salathe but ew you recommend with :P
you really want to just pass source code as a string to a function constructor and map your arguments to an array and use function.apply
 
recommends without...
 
@Raynos how does it restrict eval() ?
 
@thejh ehm. There are subtle differences between eval & Function :P
 
9:20 PM
@Raynos well, how does it restrict the code? :P
 
@thejh I simply expect Function the be better then eval
 
@Raynos err... ok...
@Raynos because it hides it from your eyes?
 
Eval is slower
 
eval is evil, function is less evil (but still evil. Sort of like if eval and jQuery had a child...)
 
@Raynos I don't recommend with but if it works there… :)
 
9:25 PM
I cant say why Function is "better" then eval. But using .apply instead of string hackery with your vars object
 
@Raynos how would that work? (maybe I'm just not seeing it)
 
@Raynos seems like eval is faster: jsperf.com/eval-vs-newfunction/4
 
@salathe shit it wouldnt :P
 
@Raynos I did think about it, but figured Friday evening robbed me of a sensible way.
 
@thejh shit more is better. I read it wrong. I thought it was time rather then ops/time
 
user492203
9:30 PM
Hi, all!
 
is away for 1/2 hour
 
gizmodo.com/5711407/… Is it just me, or does that sound like a challenge?
 
:)
nice idea
however, probably it would last long
 
How do they plan on making a file format that's impossible to print... If it can render on a screen, it can render on a printer. Sure the default viewer may not have a print button, but that hardly makes it impossipable...
 
well simply print screen can avoid it
 
9:37 PM
Yup...
 
but i'm sure that in a couple of days somebody will make the tool (converter) to export it to PDf or something else
anyway, it is good idea, i second it
 
Aparantly it is a PDF. I just has a custom hook or something that prevents acrobat from reading it
 
i dont know if PDF format has already that feature
i know that you can disable editing but i cannot remember if you can disable print
 
no it doesn't
And you can't disable editing. You can tell Acrobat not to allow editing, but the format is flexible enough that you can still write to it (it's not like it encrypts it or something)
I've build a PDF reader. It's not fun (700 page specification document + 500 ways of doing 1 thing == shoot me now please)
 
:D
lol
for building the reader
but for regular PC user
there is restriction on print as i remember
 
9:41 PM
yes...
 
so what is the trick in WWF
reiventing the wheel
 
I don't know about print (I don't remember seeing it)
 
i remember that some older iText versions easily skipped that restriction out-of-the-box
now adobe required from iText not to do that
 
The couldn't "require", it's an open specification... They could have asked nice, but require is not really true...
 
so you think they pleased them (pleased == $$$) ?
 
9:44 PM
I think it was more of a "you scratch our back, we'll scratch yours" type thing...
They could block them from using the name "Adobe PDF" since it didn't implement the FULL specification I guess...
 
@ircmaxell ew macintosh. Dont use mac as your first support platorm for something l;ike this
 
doesn't use mac
 
function makeBlock(f) {
  var args = Array.prototype.slice.call(arguments, 1);
  return function() {
    return f.apply(this, args);
  };
}
I can follow what it does but how is it meant to be used
 
makeBlock(function, arg1, arg2, arg3)
?
 
But whats the purpose of wrapping f.apply in a closure?
 
9:55 PM
I don't understand where this comes from there.
 
@Nathan this refers to whatever scoep you call makeBlock from. most likely global
 
Basically, apply calls the method, right? So it just returns a closure instead of the actual function. But it pre-binds the arguments
so you can do var foo = makeBlock(bar, arg1, arg2); and then pass foo to something that's expecting a closure with no arguments
 
@ircmaxell I get it I guess
 
Ok, time to head home...
Later all
 
l8r
 
10:05 PM
Recently im relying more on reading other peoples source to understand things rather then reading peoples explanations / tutorials. its a pleasing progression
 
10:18 PM
This place gets quiet on the weekends :( Theres even no spam
 
user492203
good night
 
BUY MY V1AGR4 NOW NOW NOW
feel better now @Raynos?
 
@Nathan you are a simpleton sir
 
10:37 PM
blushes
reads about mod_pagespeed. googlecode.blogspot.com/2010/11/…
 
@Nathan psh apache :P
 
10:58 PM
@CodingKitten are you still around?
no, boo
 
@DanGrossman the spam thing is gone
 
I do not think the word spam even remotely applies to that bot
 
People clutter the chat whilst playing with it.
 
People clutter the chat whilst being people
43 mins ago, by Raynos
This place gets quiet on the weekends :( Theres even no spam
such a contradictory person
I'll leave you to your simultaneously preferred and reviled solitude
 
11:21 PM
@Raynos I know, apache is so 90s.
I read about node.js earlier.
 

« first day (55 days earlier)      last day (4911 days later) »