« first day (747 days earlier)      last day (4202 days later) » 

11:31 AM
0
Q: JavaScript objects and Crockford's The Good Parts

JonathanI've been thinking quite a bit about how to do OOP in JS, especially when it comes to encapsulation and inheritance, recently. According to Crockford, classical is harmful because of new(), and both prototypal and classical are limited because their use of constructor.prototype means you can't u...

 
hi, does anyone know a reason selector like this won't work in ie with jquery 1.7: $('[name="group[0].resource[1].name"]').val(); I know it has dots and escaping dots actually work, but shouldn't this form work even without escaping?
it works fine in all other browsers
 
i'd expect it to work. but why not simply give those elements ids? would probably save you some trouble
group-0-resource-1-name etc
 
it's for struts, so it should be like this
 
eww, i pity you for having to use that crap
 
yeah...
and it works with jsfiddle, I have no idea why it won't work in my code
 
11:38 AM
when is the use of an inline js or css justified?
 
css for class declaration and that's about it? :)
 
eh? you mean like class="someClass" and thats it?
that is just html right? not really inline css...
 
I think that's the general way these pros in here does it... Everything defined in css classes, and never ever ever js inline (last one is quote from Dr. Florian ;-P )
 
:D
I was hoping for an answer like never . This is close enough. At least I think it is.
 
meh, resourceID.replace(/\./g, '\\\\.') looks so ugly but solves the problem
 
11:46 AM
0
Q: How to bind data-src attribute for the image in the post using jquery?

vigneshI'm trying to use foresight.js for responsive image in the wordpress blog. For that I have to add data-src attribute in the place of src in the <img> tag. Or I have to get the url from the image in the post and need to bind my new tag near the old <img> tag and wrap that old <img...

 
@ShyamK it was meant like that indeed :)
 
Hi , Im trying to understand the (?:blabla) syntax in regex ( js) but I cant get it. can sompne please explain what is the role for (?: ) ? and when should I use it ?
 
it's a group that does not capture anything
 
so why should I group it ?
 
because you might have to
e.g. (?:foo|bar|baz)+
 
11:57 AM
mmmm thanks
 
0
Q: Temporary SQL datafield

tereškoCurrently I am returning a boolean value as "1" or "0" or value of a column let say column A in one of my stored procedure and it works perfectly, however in one of application I am trying to get value like this string temp = reader.TryGetValue("ColumnA", out licenseStatus) ? temp : string.Empty...

 
In css how to target all <li> elements under a certain classtype of <ul> ?
 
12:11 PM
ul.whatever li or ul.whatever > li depending on what you need
 
Guys do you know theMegalopolis font on font squirell
?
 
@ThiefMaster what's the difference ? :-)
 
ul.whatever > li adds to the first child
 
4
A: Crossbrowser position:fixed but still fails?

Amaan ChevalThe problem lies in document.body.scrollTop. That is not cross-browser compatible. Use window.scrollY, and it should work perfectly fine. Your code would change to this: var foo = document.getElementById('foo'); document.onscroll = function(e) { if (window.scrollY > foo.offsetTop) { ...

 
> requires a direct descendant
 
12:26 PM
4 upboats for that?
SO seems to upvote more on how quick they can determine the correctness of an answer than the actual quality of the answer
 
@AnujKaithwas what about it?
 
@AngeloMoreira : I want to merge two charecters using that font.smeltery.net/fonts/megalopolis-extra like here in Colossal or fulgurant. Do you know how to?
 
I AM HAPPY
 
Hi. Does adding more specific selectors - makes it find the element faster ? ( jq)
 
12:32 PM
impress js rocks!
florian rocks!
 
Hi guys! Do you know how to get clickAt in Selenium to work? Can't use it with coordinates. Tried with and without target evernote.com/shard/s13/sh/1f6187a6-7a3f-4060-8754-7334649da35a/…
 
@RoyiNamir yes it does, more you specify less the browser has to do
 
@AmaanCheval here i am back ;D
 
@anuj sorry but i dont understand what do u mean by merging 2 chars
@anuj u mean like u want 2 different fonts on your website?
 
@Abhishek Hey! Where have you been?
 
12:33 PM
Magazine launch bro :D
 
almost got the boss convinced it would be a good idea to buy some arduinos just for us to dick around with and for me to teach him how to program
 
Ooh, how'd it go?
 
@rlemon Almost? :(
 
he's into model trains. i think he would find them useful.
 
12:34 PM
see for self ;D
it was awesome . i did a presentation with impress js
everybody jumped outa their seats ^^
 
@AmaanCheval i'm still working on it
 
@AngeloMoreira You see the Colossal text in the image? like how the O is in the C? I want to do that.
 
There are 3 images missing
Also, for some reason the page number at the bottom says 2
Oh, okay, page number makes sense
The earlier pages should have probably been in Roman numerals
 
@anuj ok got you now, can I ask why don't you just do an image?
 
So today I decided I'm not going to troll anyone. this of course means I therefore also cannot help anyone, but such is life.
 
12:36 PM
@rlemon COME ON!
 
@anuj would be easier but if you want to do it in css you can, but it will probably be a bit tricky
 
I can, but still I am not able to do that thing in fireworks.
 
@AmaanCheval they are still uploading imAGES >_>
 
like how @AngeloMoreira?
 
speaking of trolls
I wore that troll costume last night
tons of people stopped me to take pics with me
user image
3
Im on the back right
 
12:38 PM
@anuj you really should do that with Photoshop way easier, if you do it with CSS it would take you around 1h if you know what you are doing
 
@anuj in CSS you would loads the font with font squirrel and then use a specific class to control letter by letter
 
o/ @Abhishek
 
THE SECTION IN BLUE
 
like making a big c, then adding a small o within, like shifting two layers ?
 
12:39 PM
@Loktar \O
 
@anuj thats right
 
okay :)
 
@Loktar I like that you're trying to look creepy with your hands over their heads and all
 
@Loktar awesome!
I watched harry potter
 
@AmaanCheval lol yeah
 
12:40 PM
@rlemon Never watched it before?
 
@anuj think that would be the easiest way if u not bother with SEO and loading images
 
@rlemon nice, Ive got kids so I get to go trick or treating too!
 
@Loktar Cool costume. is that Sportsmaster in the back with you?
 
idk what he was to be honest,
he had a spartan mask.. and a black suit so idk
 
@AngeloMoreira yeah that is why i thought of using them as text and not images.
 
12:41 PM
lol
 
@AmaanCheval no I have. But while everyone was out celebrating I was mourning the anniversary of James and Lilly potters death... thats right.. you are all horrible people.
 
@AmaanCheval thats awesome
 
@AmaanCheval 1 good thing :3
wanna see the presentation ?
 
Yeah!
Did you manage to fix the weird thing with different screen resolutions?
 
TROLL, LEMON, TROLL!
 
....... jQuery tee hee
 
@AmaanCheval no , wait u have already seen it :D
 
@anuj <p><span class="bigL">L</span><span class="bigO">O</span>

.bigL{
font-size:10px;
position:absolute;
top:10px;
left:20px;
}
.bigO{
font-size:20px;
position:absolute;
top:40px;
left:8px;
}
 
lol
 
12:45 PM
Can one deduce that Thrall is a TROLL?
 
i am going for some
drinks
and then wiki-voice time!
 
See you later
 
Tek
Anyone here use netbeans?
 
@Tek This is JAVASCRIPT NOT JAVA
 
Tek
So...? You can write javascript in netbeans >_>
 
12:47 PM
most people use vim emacs and aptana here :P
 
@anuj see the example above, thats how you could do it
 
okay @AngeloMoreira, trying it out
 
@Abhishek AND SUBLIME!
 
@AmaanCheval oh yes sublime (XD)
 
@rlemon have not heard them since high-school
 
12:47 PM
ok'
 
@tereško great blast from the past no?
 
so-so
 
@anuj do not forget the absolute position in CSS is relative to the parent container so the container should have something like position:relative
 
quasi-related
 
12:49 PM
hehehe
sry guys
 
@rlemon offspring was never my favorite, but one dorm-mate was a fan
 
@tereško I only really liked the Smash album, IMO they went downhill after that
 
i don't have an opinion on this =/
 
@rlemon HAHAHAHA
 
1:00 PM
@ThiefMaster Thanks a lot :)
 
Anyone home? :)
 
Nah, I'm at work
 
I'm both XD
 
Would it be easy to add an encodeURI bit to this before the URL is used?: jsfiddle.net/Kqzg7
 
1:11 PM
I'm gonna go with "Yes"
 
I figured. It's really embarrassing how clueless I am with JS. I'm trying to do that, and also change it so that the URL opens in a new tab/window instead of the same window.
Would I add var c = encodeURIComponent(c); somewhere?
Any help would be much appreciated… I've got something due in less than an hour! D:
 
Opening in a new tab or window is up to the browser, but you should be using window.open
!!/mdn window.open
 
window.open('page.html');
 
That's what I thought, but I think when I tried to implement it I did it all wrong.
 
1:25 PM
@DavidQuinnCarder What's going wrong?
 
so how would I change window.location = c to that? jsfiddle.net/Kqzg7
 
@DavidQuinnCarder jsfiddle.net/Kqzg7/2
window.open(c);
It may get caught in a pop-up blocker. Since it's only happened if the user clicks, you should be good
 
When I replace window.location = c… to window.open(c) (I tried with and without semicolon), the script no longer functions.
 
Errors?
Check the pop-up blocker
 
1:29 PM
That's what the popup blocker looks like in Chrome
 
How to add another class to a dom object?
 
It's not that. No errors, no idea why it's not working.
 
@AndersMetnik elem.className += ' newClass';
yesterday, by rlemon
@Shiki ClassName += " newClassNameWithASpaceBeforeItSoTheyDontJoin";
@DavidQuinnCarder You're sure you're calling the function?
 
I tried literally pasting the code you made in the fiddle edit with my old code. The button (with class name "populate") doesn't do anything when clicked now.
Which is what happens whenever I try to mess with the JS too much.
 
Have you checked the console?
 
1:34 PM
No, how do I do that?
 
Which browser are you using?
 
Chrome
got it
 
WOOT!!
 
F12
@rlemon Arduino? :D
 
1:35 PM
ALT + F4
nope code compiled.
 
@rlemon You couldn't help it, could you? :D
 
I was happy
 
CTRL + SHIFT + W
@DavidQuinnCarder jsfiddle.net/Kqzg7/3
Does that work for you?
 
sudo rm -rf /
 
cowsay Moooooooooooo
 
1:37 PM
@AmaanCheval hugs
 
 _______________
< Moooooooooooo >
 ---------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
yes, that one worked... console on site says Uncaught SyntaxError: Unexpected Token ILLEGAL
 
@DavidQuinnCarder Check the line number
The error is in the code you haven't shown us
 
199, which my code doesn't get up to
 
Which file?
jQuery or something?
 
1:38 PM
OH
wait wait wait
 
hehe my netbeans doesn't like my less :P "no such class found" :-p (untill runtime)
 
All that's on line 199 is }), which if I remove it, it gives a different error (unexpected end of code or something)
It's the final line in the script
 
What's on the line before that?
You probably have a : instead of a ; or something of that sort
 
line before that is the same
$(document).ready(function () {
    $("a.populate").click(function () {
        sendMailto()
    })
})​
 
Are you sure they match correctly with the opening brackets?
 
1:42 PM
that last one is 199
 
That looks fine
What's before this?
 
Again, it's working in the fiddle, and I tried copying and pasting. Can't figure it out.
 
Oh, it's the same
What's all of the code on your file, then?
Dump it on pastebin.com
 
!!cowsay ........AmaanCheval rocks.
 ___________________________
< ........AmaanCheval rocks. >
 ---------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
Yay!
!!cowsay rlemon rocks too!
 
1:46 PM
 __________________
< rlemon rocks too! >
 ------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
!!cowthink tee hee
 
 ________
( tee hee )
 --------
        O   ^__^
         O  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
I edited some of the content out, it's for a client.
 
@rlemon Nice
@DavidQuinnCarder The bug is still there, right?
With the content removed?
 
1:47 PM
!!cowsay e=ಠಠ T=\/ Boooooooo
 __________
< Boooooooo >
 ----------
        \   ^__^
         \  (ಠಠ)\_______
            (__)\       )\/\
             \/ ||----w |
                ||     ||
 
Oh, God
JSFiddle's done it again
 
@rlemon Ooooh!
@DavidQuinnCarder Hidden character
 
@DavidQuinnCarder After the ), backspace
 
1:48 PM
easy fix then?
 
You'll see the cursor won't move, but it'll fix the error
@DavidQuinnCarder pastebin.com/dDmzV3Rf
Just copy and paste that back
 
!!cowsay e=ಠಠ T=◞◟ Stupid unicode
 _______________
< Stupid unicode >
 ---------------
        \   ^__^
         \  (ಠಠ)\_______
            (__)\       )\/\
             ◞◟ ||----w |
                ||     ||
 
!!cowsay rlemon, send @Zirak a pull request!
 
 ____________________________________
< rlemon, send @Zirak a pull request! >
 ------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
@Amaan THANK YOU! So so much. Is there any way I can give you "points" or something like that?
I have one more thing to pester you with, if it's quick and easy.
 
1:50 PM
@DavidQuinnCarder Sure. Go upvote every answer of mine on my profile :p
@DavidQuinnCarder Go ahead
 
@AmaanCheval A pull request for...?
 
@Zirak Oh, wait. cowsay was always part of the bot?
 
Not always, but for a pretty long time: github.com/Zirak/SO-ChatBot/blob/master/source/plugins/…
 
1:52 PM
With the current script, if a user pastes in smart quotes or other special characters, it comes out all wrong. I know I need to do an encodeURI sort of thing, but I'm not sure where or exactly how to do it. So can you tell me how to encodeURI the URL before using it?
 
@DavidQuinnCarder window.open(encodeURI(c));
 
second parentheses is what I missed!
Thanks again!
 
@Zirak > This question is now closed - please refresh the page for updated status.
I wanted my name on the closed by list :(
 
ThiefMaster snagged it
 
Yikes… that didn't work at all. I mean, it did something, but not what I thought it would.
maybe I should use encodeURIcomponent? Would the syntax be the same besides adding the word component?
 
1:55 PM
Yep
> encodeURIComponent escapes all characters except the following: alphabetic, decimal digits, - _ . ! ~ * ' ( )
 
Uncaught ReferenceError: encodeURIcomponent is not defined
 
You still want URIComponent, I think
Capital c in Component
 
> Note that encodeURI by itself cannot form proper HTTP GET and POST requests, such as for XMLHTTPRequests, because "&", "+", and "=" are not encoded, which are treated as special characters in GET and POST requests. encodeURIComponent, however, does encode these characters. These behaviors are most likely not consistent across browsers.
afk
 
1:58 PM
Yeah, this gave me no errors but instead of opening mail client it did 404
oh well, have to show boss, will see if someone in the office knows a way to encodeURI this sucker
@Amaan thanks again
 
@DavidQuinnCarder What?
How are you getting a 404 for an email client?
@Zirak makeBalloon?
 
Your questions puzzle me at times
 

« first day (747 days earlier)      last day (4202 days later) »