« first day (68 days earlier)      last day (4886 days later) » 
00:00 - 15:0015:00 - 00:00

3:00 PM
@ircmaxell Yo Dawg We Herd You Like Injections So We Put PHP In Your jQuery So You Can SQL Inject While You XSS Inject
 
:wonder what PHP has to do with SQL injection:
 
$.php().run('exec("python -r \"import node.js\"");').stackOverflow(); ->
 
0
Q: Using the mouse to control a game in HTML canvas

GregI am trying to find out if it is possible for JavaScript and HTML's to take control of the mouse and introduce relative movement control - the type of mouse control you get in first person games (where the mouse can be moved in one direction and the player will infinitely turn until the mouse st...

I have a variable storing a string, how is it possible to add this string as a property name of an object?
 
@Greg myObject[myVar] = 'something'
presuming that myVar == 'blah', this is the same as myObject.blah = 'something'
 
can I do someObject[nameString] = value ?
 
3:10 PM
...wow, x.y and x["y"] are the same thing.
kinda scary.
I guess that's what you get from a prototyped language.
 
@badp Why's that scary?
 
(sorry for newbishness, pythonista here with some jquery exposure)
 
not scary at all...
 
my internet connection is bad at the moment because I'm on a train
 
more like def __undefinedProperty__(self, name): return self[name]
 
3:11 PM
okay, so how do you make iterators?
 
@lonesomeday thanks
 
for(var a in b) { /* work with a */ }
 
like that
but make sure to use var a
 
my internet connection is bad at the moment because I'm on a train
 
and plug in a b.hasOwnProperty(a)
!kitten jsforin
 
3:14 PM
I guess I'm just used to not mixing up my fields with my methods :)
I've complained a few times that for(var item in document.getElementsByClassName("numbers-zero-to-three")) gave an iterator over 0, 1, 2, 3, 4, get(), but I guess there's no real way around it.
oh well.
Thanks for the clarification
 
getElementsByClassName is like an array
 
!kitten wisdom @rchern
 
Guess you're out of luck with rchern. Yawn I nearly fell asleep when checking their answers.
 
@badp just use a normal for loop
 
When assigning new properties with square brackets ... do you have to make a new Object first?
 
3:17 PM
@Greg ?
 
@IvoWetzel Pythonista here, trained to think normal for loops are evil :P
 
@IvoWetzel var myObj = new Object;
 
or anyway breeding ground for subtle off-by-one errors.
 
@Greg var myObj = {} ?
 
is that better?
 
3:18 PM
@Greg There's no difference afaik
 
ok, well I'm in the habbit for creating new arrays with [] so I'll do it that way for objects too
 
@lonesomeday hi! i dont know how i can give you a good code example of what i want because it actually involves two html pages :p
 
@Opoe Remind me what question this is?
 
hm, any way in vim to remap shift+Space?
 
Oh I didn't see. They changed the favorite star in the top right of the screen (if you favorited this room tho)
 
3:25 PM
@lonesomeday the load() external html :p
 
0
Q: How do i load() html with jquery more than once?

OpoeHello all, i use this code to load html to my container; $('#button').click(function() { $('#container').load("index.html"); }); My question to you is, can i load the html multiple times to my container? If yes, how? And if it's possible, isn't it heavy weighted to load? index.html conta...

 
oops haha
 
@Opoe In all honesty, I don't understand what you're trying to do or what your problems are. The easiest solution would be for you to give a link to some working (or not) code.
 
@lonesomeday okay i dont like to be vague so let me get some code ;)
 
I don't understand either.
 
3:31 PM
@lonesomeday jsfiddle.net/cDPje
 
JS doesn't support iterators, does it (objects can't re-implement an iterator itself natively, can it?). Sure, you could add a .toArray() or .values() method, but there's no way to override the for (var item in foo) behavior, is there?
 
@lonesomeday that is my index.html.. i want to load that into another html with this code;

$.get('index.html', function(data) {
$('#container').append(data);
});
wich works good... however... only the first loaded html works fine, the 2th, 3th 4th, etc don't work.
 
@Opoe What do you mean by "don't work"?
 
$.get('index.html', function(data) {
$('#container').append(data);
});
$.get('index2.html', function(data) {
$('#container').append(data);
});
Are you trying something like this ?
:S
 
@lonesomeday the eventhandlers dont work, they are not draggable etc
 
3:40 PM
@Opoe As far as I can tell, that works... I really don't understand what it's supposed to do that it isn't doing.
 
@ClemDesm no just one html; index.html, but load it multiple times in another html
@lonesomeday in the jsfiddle you see a draggable element right? when i append the data, only the first appended element is draggable
 
hi everyone... how are you
 
@Opoe They all are for me... That is, #drag moves, and the appended items move with it
 
@may i ask wich browser you are using? or how are you displaying it?
 
@Omegakenshin Feelin' lonely here... as always around christmas/newyear
 
3:45 PM
@Opoe Chrome -- will check FF now
 
What could be wrong in my code? Just a hover, if find <ul> inside a <li> navigation, do Hover, if not, nothing...
http://jsfiddle.net/JtgUA/
@IvoWetzel ooowww, I wish I could join you ^^
 
@lonesomeday ill check chrome :p
 
@IvoWetzel i'm kinda lonely too
 
@Opoe FF works for me too
 
huh :S
 
3:47 PM
@CodingKitten Talk to us
 
@YiJiang in the end it's all about conversion
 
@IvoWetzel Talk to the kitten then :P
 
@Omegakenshin Would be a fairly long flight I guess
@YiJiang :/
 
@CodingKitten Why not?
 
@YiJiang maybe you want to put the top of dev time (since developers are more LI, return true, else return rate, neither of anyway, right? :p
 
3:49 PM
@IvoWetzel yeah, I live in Costa Rica, wherever I go will be a long flight
could you check my code plz? its very basic, but i'm so newbie... T^T
 
@lonesomeday this is crazy... what code do you have in the other html not index.html but the other one
 
@Omegakenshin has:ul definitely isn't the correct syntax there
 
@YiJiang ohhh ^^
 
Unless has is an element you're using, and somehow you just defined a new pseudo-selector :ul
 
try :has(ul)
 
3:51 PM
<has foo="bar" ul="true"> has:ul == true... (kidding, of course)
 
if ( $j('#menu-navegacion-principal > li').has('ul').length != 0 )

or if ( $j('#menu-navegacion-principal > li has:('ul')').length != 0 )??
@ircmaxell hi again ircmaxell ^^
 
How's it going?
 
@Omegakenshin The second one I think. I haven't used that pseudo-selector for a while
 
You're looking for a <li> that contains a <ul> element inside it that isn't empty, correct?
 
@ircmaxell right, so if its found, slideDown a subNavigation
 
3:56 PM
if ($j('#menu-navegacion-principal > li > ul' )) won't work?
 
let me try that...
 
or possibly if ($j('#menu-navegacion-principal > li').children('ul').length != 0) depending on exactly what you're trying to do...
Does jQuery support XPATH selectors at all?
 
@lonesomeday well thanks anyway
 
@ircmaxell Didn't work... dinterweb.com/sitek
@ircmaxell I try that other one...
 
@Omegakenshin I think you need to use filter here: $j('#menu-navegacion-principal > li').filter(function(){return $j(this).find('ul').length > 0; });
 
4:01 PM
@ircmaxell nope, the first one work like normal, and with this one, the hover doesn't work T^T, don't know what could be wrong
@lonesomeday thanks I try that and research .filter (didn't knew it)
 
@Omegakenshin filter API for reference :-)
 
I dunno exactly what you're trying to do, so I dunno (and I'm not a jQuery guru at all, so I may not be the best to help)...
 
@ircmaxell I apreciate your help ^^
@lonesomeday didn't work
@lonesomeday here is the code... can you please take a quick look? jsfiddle.net/JtgUA/2
 
@Omegakenshin Um, could you put some HTML in that sample? Hard to debug without it. You might also want to enable jQuery in the left-hand pane...
 
ohh ok ty
 
4:07 PM
@Omegakenshin One obvious problem is that you're using navIn and navOut before you define them
 
on sec
 
No problem
 
ok... basic html update, http://jsfiddle.net/JtgUA/3/
Here is the website so you understand the navigation a little better n.n
http://dinterweb.com/sitek/
_Thanks for your time btw
sorry to ask you so much, I'm still learning... I keep searching... thanks anyway
 
It got quiet here...
 
Hi all!
 
Can i have more classes in one textarea
t.ex
<textarea class="replyMsg123; expand50-100">
 
8 more upvotes till I get the gold in PHP!!!
 
?
 
4:45 PM
!kitten wisdom ircmaxell
 
@Karem Yes, separate them with spaces
 
@Karem <textarea class="replyMsg123 expand50-100">
 
thanks!
 
Hi!
 
@Nyuszika7H Hi :-)
 
4:55 PM
hey ho
@Nyuszika7H: did you see this?
3 hours ago, by ircmaxell
@Nyuszika7H It is. But if you want your mind blown, 0.999999999999999999 (repeated indefinitely) is exactly 1. It's a provable mathematical fact...
 
@CodingKitten :tickles tummy:
 
@YiJiang this is why I use a locking mechanism to URLs or anchors. Use buttons instead.
 
@Omegakenshin Try this: if ( $j('#menu-navegacion-principal > li has:('ul')').length != 0 )
@ircmaxell nope
 
@Nyuszika7H The ' single quotes - you need double, or escape them. Actually, I think those quotes are not needed - the selector should work fine without them
 
@YiJiang Yep, I know.
 
Kev
5:00 PM
Hi folks...I feel stupid asking this...but does CSS padding apply to the outside or inside of a container such as a <div>
 
@YiJiang Sorry, I've pasted in his wrong code instead of my correct.
 
@Kev Erm... what's your definition of outside and inside?
 
@Kev Margin: outside, padding: inside.
 
And conversely 0.00000000{infinite number of 0's}1 is exactly 0...
 
@Omegakenshin if ( $j('#menu-navegacion-principal > li:has(ul)').length ). You don't even need the != 0.
 
Kev
5:01 PM
ok say I have:<div id="help" style="float:left;width:185px; border-style:solid;border-width:1px;height:690px;padding:5px">
 
@YiJiang woah, nice :)
 
Kev
@YiJiang oh cool
 
@Nyuszika7H Image search for 'box model' there's a ton of these out there. I just picked the first one that looked decent
 
Kev
I find that the padding increased the space taken by the div
 
5:03 PM
@Kev Yes, that is correct. You can subtract 10px (5 for each side) off the height and width to compensate
 
Kev
@YiJiang that's what I thought...however I'm finding I'm having to substract 15px for padding:5px....there's no content in these yet
 
D:
 
@Kev That's odd. The other property is obviously border, but you've only got 1px there so I'm not quite sure
 
Kev
think i'll ask a question
i've got the layout to work across ff/Cr/IE but it seems "wrong" because the numbers don't add up
 
@Kev Check the 'layout' tab under the HTML view in Firebug
 
Kev
5:09 PM
oh...now that's clever
 
The numbers don't lie, eh?
 
hehehe
Sure, numbers can lie...
Wow, my octary search needed 9211 queries to merge 2273 rows...
(which isn't that bad when you think about it)
 
@Kev Oh, and one more thing that just came to my mind - you have a doctype correctly applied, right? Quirk mode changes the layout model used by the browser
 
Kev
@YiJiang - I have now: stackoverflow.com/questions/4519666 lol
 
Kev
5:17 PM
@YiJiang - been ripping out tables and other bad behaviour. But my CSS-fu is appallingly bad.
 
@Kev: Practice makes perfect...
 
Kev
@YiJiang - I know...I've been lazy all these years and had designers to worry about all that stuff....wish I could draw now :)
 
@ircmaxell "perfect"
Alright, time to leave work! Bye !
 
I always get nervous when I see a question has both the javascript tag and the sql tag
 
Kev
@lonesomeday - I once worked at a company where they had the genius idea to generate HTML straight from the database.
 
5:23 PM
@ClemDesm: prefect
 
Kev
@lonesomeday - as in SProcs did this
 
@Kev :-/
 
Kev
@lonesomeday - this HTML then wended its way through the application tier in COM+
@lonesomeday - then eventually to IIS
 
@CodingKitten :tickle:
 
@YiJiang there you go, lots of answers :)
 
5:26 PM
@Kev I hope you handed in your notice fairly quickly...
 
@CodingKitten Anything of interest happened while I was at the supermarket?
 
@IvoWetzel Going for the screen.
 
@CodingKitten Yes..
 
@IvoWetzel It was supposed to direct you to produce dozens of great importance
 
Kev
@lonesomeday - nope...i wasn't there for much longer....
 
5:27 PM
@CodingKitten Who?
 
@YiJiang an ad impression occurs simply by me, for comes up my comment?
 
@CodingKitten You haz impressionistic advertisements?
 
@YiJiang just something about this please a manual jquery with Greasemonkey (// code.jquery.com/jquery-latest.min.js), then the revenue per visitor is a carriage return in every website can count as an "app"
 
Kev
@IvoWetzel - that spacetree stuff you help me out with went into production today :)
 
@CodingKitten That is... totally random
 
5:29 PM
@YiJiang backspace will delete all - I alraedy typed
 
oh noes, it already deleted everything
@Kev :)
 
@CodingKitten Grrr... where did appalling typos like that entire the input data?
 
@YiJiang I think he answered you don't have to do with the ajax call?
 
Kev
@IvoWetzel - lol....works really well...customers can now snapshot their citrix VM's
 
Hmm can I make a selector that selects the class with fancybox_wallConv and the id that are 123 in jquery
 
5:31 PM
@Karem id are unique, and should not start with numbers, so the class selector part would be redundant
Or maybe you want all elements that have either id of a certain value and class of another?
@CodingKitten (goes off to look at some of the questions on SO) Nope, I think I'll be happier talking to you
 
@YiJiang No, i did! :p I'd love that they do it needs to pull the way up to the clever way :p
 
@CodingKitten The clever way! You need to tell us more about that
 
@YiJiang but it won't backspace anywhere before the point where is quite funny
 
@Yijiang ok should i do $('#'+id).css('font-style':'italic');
 
@Karem Comma, not colon - you're passing two parameters to the css function, not an object
 
5:35 PM
§ <- why is this "thing" even on my keyboard?
 
Alternatively, document.getElementById(id).style.fontStyle = 'italic'
@CodingKitten Meow!
 
@YiJiang I votes to go! have a html form, and stay on the site). Without content, you can't make good money. Without signing up?
 
day before christmas, so what do you eat? Exactly, salted chips
add in some strawberry juice and there you go
 
Holy hell! I can't believe I just did that!
0
A: Can I use regular expressions to search for multiples of a number?

ircmaxellHere you go (In PHP's PCRE syntax): ^(1(01*0)*1|0)+0{4}$ Usage: preg_match('^(1(01*0)*1|0)+0{4}$', decbin($number)); Now, why it works: Well we know that 48 is really just 3 * 16. And 16 is just 2*2*2*2. So, any number divisible by 2^4 will have the 4 most bits in its binary representati...

 
@CodingKitten What do you eat these days?
 
5:39 PM
@IvoWetzel interestingly .children() doesn't have to moderate traffic)
 
@IvoWetzel We did have had some salty bacon, but that's nothing unusual
 
(hint, regex to see if a number is a multiple of 48)
 
@ircmaxell Oh my god, that reminds me of that awesome regex for checking whether a number is prime
 
@ircmaxell (jaw unhinges)
 
although the last answer is waaaaaay more awesome :D
(...and way more scalable)
 
5:42 PM
@IvoWetzel: The one from Paul?
 
@ircmaxell yes
 
hehehe
 
@CodingKitten Should we have you automatically balance brackets and braces too?
 
@YiJiang how derped about ad impressions did you know if it contains ANY site where it's about moving people from your homepage to start with
 
Somehow I prefer a 20 character regex to a 20 line regex...
 
5:44 PM
@ircmaxell I know, what is wrong with you, preferring a minimalistic and scalable solution like that?
@CodingKitten How derped are you?
 
@YiJiang I am so used to start with
 
@CodingKitten So am I! Hi-5!
 
@YiJiang I need it
 
@CodingKitten You do? How fascinating!
 
@YiJiang I append the whole box and cancelling the ER. 2nd degree burns. Drunken attempt to the php much faster for development, which makes it
 
5:47 PM
@CodingKitten Drunken kung... eh PHP?
 
@IvoWetzel var it, sounds painful currentTime = new Date() var hours = "0" + i + '%,' + i type so fast that I'm used hide() but you're right one obviously (which is yes it does alert($('#test').children('li').length);
 
hehehe
Anyone know of a good site to test regexp on where you can share a link?
 
@ircmaxell jsfiddle?
 
Must support PHP style PCRE regex
 
Hmmm... no. The only online tester know of is the one at regular-expressions.info/javascriptexample.html, but that uses js style too
 
5:49 PM
Hey 4 up votes for some common sense
4
A: Best approach to avoid javascript's "this" mistakes

Ivo WetzelLearn how and why this behaves the way it does, then read the code you're working on. Don't trust some magic functionality, you might always end up with unexpected results if you don't know/read the code. There's simply no single awesome solution for this "problem".

 
@CodingKitten What do you think
 
@YiJiang eg $('#imgid' ).animate({ borderColor: 'rgb(' + '%,0)'); }
 
what's up with that %,0)...
 
@IvoWetzel Not as much as 1000+ for not using regex to parse HTML :P
@IvoWetzel Might have been spliced together from another piece of code
 
btw: that "protect images question" got deleted
 
5:51 PM
@IvoWetzel As it should have
Although my next question would be, which one?
@CodingKitten You're a Kitty!
 
@YiJiang Don't say that to show me
 
@YiJiang the one I got reversal from
 
@IvoWetzel Deleted two days ago, after been closed as exact dupe
Hehe... classical answer to this type of question:
3
A: How can I prevent/make it hard to download my flash video?

Answar UbetCreate really bad content so that no one will want to bother downloading it. Personally it is very hard for me to spend time trying to download a video I do not want

 
so, I've remapped that § thing to ESC
Shift+3 is way faster than reaching for ESC
Someone needs to create a VIM keyboard
 
is really proud of that regex... I just made it a touch better (adding support for 0)...
The only problem is that since an answer was accepted, and it's not a trivial answer to understand, I'm not going to get much from it (+3 right now)...
 
6:09 PM
@ircmaxell Welcome to SO
 
Ha!
 
@ircmaxell: If only I could upvote twice... :(
 
0
Q: Reload script inside PHP

Liso22This is what runs after submitting a form: else { echo '<br/> Tu chisme se agregó con éxito.'; echo '<script type="text/javascript">window.location.reload(true);</script>'; } Basically after the users submits the form it does a couple of things and finally displays a ...

 
@LasseAKarlsen Any progress on this? Did you end up posting it as a ? on SO?
 
6:32 PM
Hello
 
Halo
 
7:16 PM
Hi!
 
0
Q: Thoughts on a theorum regarding regex and matching multiples of a number

ircmaxellWell, a recent question over on StackOverflow got me thinking about this... Can you write a generic regex to match all multiples of a number n expressed in base b. Obviously (or not) it's easy to do in unary since all you're doing is making sure there's a multiple of the sub-pattern: for n = ...

 
7:28 PM
@ircmaxell: Sorry to be picky, but is it not 'theorem'? (I don't have edit privs on programmers.se.)
 
yeah it is
spell check only works on textareas...
Fixed
(thanks)
 
Ah. :)
Interesting idea, though.
Mostly beyond me, but interesting nonetheless.
 
I have no idea if it's correct or not, just seemed logical and too interesting to let float out of my head...
 
It's good that the site is there for stuff like that when SO maybe wouldn't be right.
 
Yeah, SO is too specific for something like that...
6 more upvotes needed!!!
4 more (and 1 more to hit rep-cap for today)...
 
 
2 hours later…
9:21 PM
Can I have fancybox link inside a fancybox link?
 
10:16 PM
@Karem IDK what's the case with Fancybox, but you can do that with jQuery UI dialogs, I'm sure.
 
There is a addClass and removeClass, how can i change the class ?
should i first run removeClass then addClass or does there exists a changeClass ?
@Nyuszika7H Oh ok, but it worked with fancybox too :-) ty
anyone knows this about classes
 
if you call .removeClass() without passing any arguments it will remove all the classes
so what i do is usually .removeClass().addClass("newClass");
 
if i want to change the class from iconFavorite_hover to icon_Favorite how can I do?
should i rmeoveclass then addclass
yes ok
dont i need to specify the class name?
 
no, .removeClass() removes eeeverything
if you want to keep other classes though, then you need to do .removeClass("iconFavorite")
if you're doing hover effects though, you know you can just put :hover for the classname...
 
11:00 PM
ty
I have a nav bar with line-height: 30px;
Now that nav bar links is in the middle nice and smooth, now I need to get my loader to fit in at the left
<img style="float: left;" id="loading" src="images/ajax-loader.gif">
This comes at left top, because theres no line-height to it
how can I make it vertical align with the text
 
11:13 PM
fixed
used position absolute
 
11:30 PM
1k 3D Christmas Tree in JS: js1k.com/2010-xmas/demo/848
 
!kitten quote
!kitten qoute
 
Huh? What's a "qoute" 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 quote
 
>Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
> Bill Gates
 
!kitten quote
 
11:36 PM
> Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris.
> Larry Wall
 
!kitten quote
 
> FORTRAN is not a flower but a weed — it is hardy, occasionally blooms, and grows in every computer.
> Alan J. Perlis
 
why does that fail :(
> test
 
because the chat only does markup on single line messages
 
!kitten wob
:!kitten quote
uhhhhhhh >_>
 
11:37 PM
!kitten quote
 
> "The trouble with programmers is that you can never tell what a programmer is doing until it’s too late." Seymour Cray
 
!kitten quote
 
> "I think Microsoft named .Net so it wouldn’t show up in a Unix directory listing." - Oktal
 
:kitten quote
 
> "Measuring programming progress by lines of code is like measuring aircraft building progress by weight." - Bill Gates
 
11:48 PM
:kitten quote
 
> "In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." - Blair P. Houghton
 
:kitten quote
 
> "I think Microsoft named .Net so it wouldn’t show up in a Unix directory listing." - Oktal
 
ok, now it outputs all the 50 quotes in a random order, then re-shuffle's them and starts at 0 again
exercise for today: calculate the probability that after a shuffle the same quote will appear again...
:kitten quote
 
> "Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall
 
11:53 PM
:kitten quote
 
> "They don't make bugs like Bunny anymore." - Olav Mjelde
 
00:00 - 15:0015:00 - 00:00

« first day (68 days earlier)      last day (4886 days later) »