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

12:02 AM
electric fence:
 
needs a soundtrack.
 
and a epic music !
 
yes, one of those too.
 
<script>
    var foo = "bar";

    if(foo === "bar") {
</script>
    <p>Foobar!<p>
<script>
    } else {
        alert("Whoops!");
    }
</script>
 
... so wrong ...
 
12:12 AM
Lol
 
@Shaz that... ...
 
If only
 
If only what? >.>
You better not be secretly hoping that that code should work >.>
 
I'll leave that to php
 
@shaz that idea works with php and most of serverside scripts
not javascript
 
12:21 AM
@OmeidHerat I know :)
 
i coudnt reach the site for a min. is that happend for you?
 
but you can change that </script><p>........<script> to something like document.add.................
document.write('<p>Foobar!</p>');
this should do the trick
 
I know I know, just wondering what peoples reactions would be. ;)
 
hahahah
ok
 
@OmeidHerat NO. It's the devil. Don't do it
 
12:26 AM
document.write ?
 
reaction: awkward silence while we try to work out if you're being serious or not
 
@raynos will it depends what you wanna do
@david: ture that !
 
more like document.WRONG ...
6
lollerballz
 
/groan
 
i don't think so @sdleihssirhc
document.write works so good
if you have one plain empty page !
 
user1385191
12:27 AM
document.write hurts so good
 
how !?
i never had a problem with it
 
Stars should give rep.
 
user1385191
You've incurred the wrath of our resident pedant, Raynos. Prepare to be emasculated.
 
SOMEONE TELL ME WHAT IS WRONG WTIH DOCUMENT.WRITE ?
AND WHAT MAKES IT DOCUMENT.WRONG !?!?! :ss
 
user1385191
Imagine you have a really nice car built on an assembly line.
 
user1385191
12:30 AM
As a hypothetical, you want to add a flame decal onto it.
 
user1385191
So, you use document.write to add a decal.
 
user1385191
Uh oh, your entire car model is gone and replaced with just the decal.
 
It's the sort of function that should be on the server, not the client. If content is going to be on the page at load, it should be part of the markup created on the server. If you're going to add content after the initial load, you should use DOM methods.
 
So, how do we display
[native code]
...in the actual code format.
 
will @MattMcDonald that is true
but what if you have a simple page ?!
that you just want to append it with something ?!
a new line or something
 
user1385191
12:35 AM
Great, use document.body.innerHTML += "text\n<br />";
 
ehhhhhhhhh
 
ehhhhhhhhh
 
I'd go with document.body.appendChild(document.createTextNode("\n")); personally
 
user1385191
\n isn't reliable in JS from my experience
 
o_O it isn't?
 
12:37 AM
@OmeidHerat stop trolling. Seriously, gtfo.
 
user1385191
well it doesn't actually move the text to a new line, it just modifies the source code.
 
user1385191
waiting to be proven wrong.
 
@MattMcDonald innerHTML is the devil
 
user1385191
heh
 
@Matt are you perhaps being thrown out by the way html parsing disregards whitespace, and that a newline in the markup doesn't always mean a newline on the page
 
12:39 AM
@Raynos Javascript is devil !
 
user1385191
you bet I am!
 
do everything on server side !
 
@OmeidHerat o_O
 
var b = document.body;
var string = "text";
var txt = document.createTextNode(string);
var div = document.createElement("div");
div.appendChild(txt);
div.appendChild(document.createElement("br"));
b.appendChild(div);
 
@Raynos perhaps programing is devil !
 
12:39 AM
You need to set the containing element to white-space: pre; if you want newlines in the source to create newlines on the page
 
user1385191
right, pre being preserved whitespace
 
or just insert your content wrapped in a block level container like a div
 
The DOM is king.
Of course with jQuery its as easy as :
 
//These will all be on a new line:

var div;
for (var i = 0; i < 100; i++){
    div = document.createElement("div");
    div.appendChild(document.createTextNode("Line "+i));
    document.body.appendChild(div);
}
 
$("body").append($("<div></div>")
     .append($("<span></span>").text(string))
     .append($("<br/>")
)
 
user1385191
12:41 AM
great stuff, thanks.
 
Here is a question, do you prefer $("<div></div>") or $("<div />")?
 
@david of course you use span as text containers instea dof div right ;)
 
both appear to work
 
@david self closing tags DO NOT contain children. What your doing there is relying on the BROWSER to fix your BAD code.
 
Hey Guys a question
 
12:43 AM
Actually IE goes "Hell no, thats not valid HTML" and crashes
 
I need to create some graphs and I want them to be interactive
 
@OmeidHerat rapheal.
 
but the point is that they should be also available on phone as well
like simple picture
 
user1385191
yeah, definitely stick to what Raynos is saying. Flash's graphics API can whip up some pretty quick stuff, but the phone availability is small.
 
@Raynos thanks
i will ahve a look at it
 
12:45 AM
For graphs harnishing SVG is the best choice.
Canvas for graphs feels wrong and DOM is just hardcore.
 
hemmmm
 
Rapheal gives you a good level of abstraction / control / cross-browser compliance
 
is there a way to create interaction for a simple picture !?
there is lots of options to create graphs in PHP
 
Other solutions dont work across all platforms or are very unflexible
 
and probably then adding interaction with javascript !?
 
12:46 AM
define interaction?
 
user1385191
raphael is javascript, no?
 
@MattMcDonald yes it is.
If you want a graph drawing tool in JS then thats a different thing..
 
user1385191
yeah some guys did a presentation on it for a Flash conference last fall
 
all i need for interaction is url links on specific points
 
user1385191
like an image map?
 
12:47 AM
that is all pretty much
 
Yeah thats do-able.
 
raphael looks beast !
but nothing shows up in phone :( nor in IE or Opera
i want a way to have a simple image of the graph on phone and the interactive on computer
 
rapheal should have IE8 support
 
user1385191
yeah, SVG's been around for a long time
 
how is the idea of adding graph images on server and then changing that with javascript on browser ?
 
12:52 AM
It's ok
image's are harder to deal with
in terms of click events
 
@OmeidHerat But "JavaScript is devil"!
 
but it's doable
Just use event.x & event.y
 
@Raynos true that
but i will convert the images to graph with JavaScript where its available and of course the images remain on the place for javascript-disable-browsers/mobile-phones
 
@OmeidHerat heh. Good luck with that.
 
thanks man
 
12:54 AM
If you just want images wih clickables on them then you dont need to "convert to graph"
 
i am wondering if anyone has done something like that before ?
@Raynos i have to see which way is easer
easier
and faster
 
user1385191
fyi, you can edit posts by hovering over them and clicking the white arrow
 
@MattMcDonald old news :DX
 
Shouldnt be too hard. Just define clickable regions. I could make a jQuery plugin in to do it easily.
 
@MattMcDonald Or just press the up button in the input box!
 
user1385191
12:57 AM
nifty, I like it.
 
like defining a grade and then adding click event on specific cells !?
 
Just defining a var foo = { x: 20, y: 50, h: 20, w: 20, cb: function() { } } and $("img").clickable(foo)
 
user1385191
Every time someone posts a code question without a link to or pasted code, I get quite annoyed.
 
Don't get annoyed, get even
post an in depth answer, without any code
 
@MattMcDonald is that for me !?
 
user1385191
1:00 AM
no, yours are more ramblings than anything
 
RT @awbjs: New blog post: http://bit.ly/dIoknj #splashcon #oopsla #wavefront #onward submit by April 8 http://bit.ly/eglMgW
 
no shit !
it should sound rambling for you
same as the university classes are for me
 
0
Q: Jquery Scope Issue

FrankieI can't figure out this scope issue: var menuLinks = new Array("about.php", "contact.php"); function setClickListeners() { for(var i=0; i<menuItems.length; i++) { $("#" + menuItems[i]).click( function () { window.alert(menuLinks[i]); }); } } Notes: me...

damn that jquery, always introducing really complex scope issues
 
user1385191
yeah, a great way to endear yourself to the community: post code linking to variables that you didn't post.
 
user1385191
(unless him mixing up two arrays was accidental)
 
1:04 AM
I like how his array changes names repeatedly
I'm worried he will explode if someone tells him to use a closure :(
 
@david told him to use let :D
 
@david "Notes: menuItems and menuLink is the same length. This code is stripped down to make understanding it easier."
 
>< I really don't like the inclusion of 'let'
 
Problem is that it returns undefined ;)
@david you want the syntaxical meaning of let. Dont use the actual keyword
Emulate let by making a closure
 
RT @brianleroux: Great read on mobile frameworks: http://goo.gl/hOP9i (but he missed Weinre and JSConsole)
RT @dalmaer: CSS Warp takes places text (@font too) on a path via transforms (rotating with 50% origin) and absolutely positioning http: ...
 
user1385191
1:07 AM
I have no idea why he didn't add a JS tag.
 
That answer fails :D
 
user1385191
he just deleted it
 
Yep
 
Hate people that delete answers when there wrong
Dont do that. Make you answer right
 
user1385191
When someone strongly disagrees with my answer, and there's not really anything I can do to salvage it, then I usually delete it.
 
1:12 AM
"comment diarrhea"
1
A: When does whitespace impact on performance?

stefanIt will not affect the compiled data as the word implies. However please dont go for comment diarrhea, it will affect other programmers performance.

 
People keep getting it wrong
 
user1385191
For example, I posted an answer to an as3 question saying "using a for in loop on an array is really bad and leads to random results" and had a pretty critical comment almost immediately.
 
@david ARE YOU HAPPY NOW. Look what you did? WHY? To satisfy Crockford? Why would you do that?
 
ahahhaa
personally I would have gone with
var handle = function(i){
    alert(menuLinks[i]);
};

for (var i=0; i < menuItems.length; i++) {
    $("#"+menuItems[i]).click(handle(i));
}
and then screamed 'Now! Handle it!'
 
...
except that code doesnt work
 
1:22 AM
oh shit it doesnt
 
handle(i) returns undefined and passes it to the click
 
yeah
my bad ><
 
So you have a function that returns a function. And those are a pain. It's easier to just do it all in handle.
 
jst embedd functions infinitely. at last it must work :D
 
Looks like the -1 was Kon, he removed it like a good lad
 
1:28 AM
@MattMcDonald i ddont like when people rate answers negatively. this is a kind of dislike. if i post a bad answer he can add a comment and i can see that i did something wrong.
btw it mst be anithing for decrease rate of an answer.
 
I -1 a bad/wrong answer
 
but sometimes it does big pressure if you start with -1..
 
I un downvote it if the answer is corrected
 
@Raynos not everybody...
 
I've got 120 flag weight :S what is that?
 
1:31 AM
it means that you
 
@omnosis true. You should only downvote if your going to un downvote if the problem with the answer is corrected
 
have a 120 rate of rating topics
65
Q: What is flag weight?

CoolBeansFlag weight can be viewed in user profiles. What is flag weight? Who can view my flag weight? When can I view my own flag weight? What are the possible values of flag weight? What are the benefits of a high flag weight? Return to FAQ index

i just readed this :D
i think this is a new feature
i have 85 :D
 
mine is 130!
 
but i am a fresh user :D
only 30 day old
40
:D
i want to hit 500 today.
 
I think that means you flagged something that didn't deserve to be flagged
 
1:34 AM
it would be nice
 
Work harder. Myles get 500 in a week!
 
I can't remember what i've flagged :o
 
@Raynos this is only fun.
i not gonna be a baptist help service :D
 
... what is that? a help service for baptists? "Which end do i put in the water?" kind of thing?
 
@david not exactly
a help service by baptists who help for poor | starving | hungry |sad peoples in the world
i think you never heard aboute this :S
 
1:41 AM
@omnosis maybe "charity" is the word you were looking for
 
official site :D
@Nathan yes.
 
@jon3laze none of the baptists I know can dance that well... wrong side of the tracks I guess.
 
i have to go now.
 
I love the moonwalk at 1:30 :)
 
it is too late :D 3.00..
by all
 
1:44 AM
LOL
 
bye @omnosis
 
alaska is a littbe bit other timezone Nathan :D
aboute 10 hour difference :D
 
goodnight @omnosis, get some sleep!
 
2:22 AM
Oh dear:
0
Q: How to use hashmap in javascript

ADYHi, Its very urgent..I have a hash map I want to use it in javascript.So i thought of converting it into javascript map..can anyone suggest me how to use it or to do??

 
user1385191
put a link to his profile in the answer
 
i'd like to upvote that video :D
 
2:42 AM
Uncaught SyntaxError: Invalid regular expression: /(?<=\?v=)([a-zA-Z0-9_-])+/: Invalid group
What did I do wrong? :o
 
possibly the trailing -
yeah you need to escape it
/(?<=\?v=)([a-zA-Z0-9_\-])+/
or you can move it to the front: /(?<=\?v=)([-a-zA-Z0-9_])+/
 
Thanks, but I still receive that persistent error :(
if (id.search(/(?<=\?v=)([a-zA-Z0-9_\-])+/gi) != -1) {
    placeholder = placeholder.replace("{content}", function () {
        return '';
    }());
} else {
    // Do something
}
 
maybe javascript's regex syntax can't deal with zero width positive lookbehinds :S
does replacing it with /\?v=([a-zA-Z0-9]+)/ not work?
 
2:57 AM
@david Ah it does. So It's JavaScript's fault?
 
it's always javascript's fault
4
 
@MattMcDonald, good idea, will do that
 
3:14 AM
Still wondering what the best approach would be to save each box
 
@Shaz What is that supposed to be?
 
@TannerOttinger Basically a replacement for the "New Tab" page in chrome. Or similar to iGoogle
 
@Shaz depends if you're building it as a chrome extension or not
good work on the menus :)
 
@Box9 I plan on making it an extension yes
 
An ext? I use Incredible StartPage.
 
3:21 AM
Then take a look at chrome apis
I don't know anything about them though
 
Do you have to know a computer lang to make an ext?
I figure yes, but just confirming...
 
Chrome uses js/html/css
 
It'll be like learning jQuery all over again
 
Really? That's awesome! I assumed that it would use something like java or c.
@Shaz JQ wasn't too hard to learn...
 
"Yes, extensions can use localStorage to store string data permanently. Using Chrome's built-in JSON functions, you can store complex data structures in localStorage. For extensions that need to execute SQL queries on their stored data, Chrome implements client side SQL databases, which may be used as well."
 
3:27 AM
I can't imagine debugging that.
 
As I don't know SQL well enough, I'll have to go with localStorage, which only stores strings
...and can only store up to 5mb
 
I don't now any SQL at all. Which is why, when you look at my profile, most of my questions are about PHP storage in files.
 
@Shaz 5mb is plenty
 
@Box9 For some.
Not all, though.
 
Well I mean for what Shaz is building
 
3:31 AM
The "ManCave"?
Quick: Should I change my avatar?
 
@TannerOttinger yes
 
For both questions?
 
>.>
 
yes and yes
 
Just a codename for now
 
3:33 AM
Ok, for the avatar, are you saying that cuz you like JS?
Or, is it really bad.
 
No, it's just boring
 
Em... take a long look at you own, Box9
 
It's lovely ain't it?
 
Ha. Ok, I am going to look for another....
 
 
3:38 AM
See, it's a work of art :)
 
Yeah, I know, it's ugly.
Changing my avatar right now.
 
@TannerOttinger argh! my avatar has been hacked!
 
I changed it.
I may have to reload...
Ok, no change, yet.
 
Wait at least 5 minutes
 
as an avatar it's hard to see that they are music notes. :P
 
3:44 AM
yeah, i had no idea
 
Heh, I uploaded a new image to Gravatar, and rated it X.
Should I change that?
 
:o
 
Ok, reloading...
 
It probably won't show up on SO if it's rated X...just my assumption. :P
 
Ok, rated it G. Right now I have a random one.
Reloading... Again.
Now it shows!
 
3:45 AM
nice
 
I need to re-crop it, though.
Ok, now I have a new one.
Better than the JQ one.
 
Do you see my current one?
 
yea
 
No! This new one is rated X too. Changing it...
Apparently, it gets the ides that I like porno avatars :(
Let me try the JQ one...
Ok!
 
3:50 AM
Lol
 
Thief!
 
Nuck Corris!
 
steven seagal
 
everyone in JS chat should change their avatar to the jQ logo. :P
5
 
@jon3laze Let'd do it!
 
user1385191
3:53 AM
absolutely not
 
@MattMcDonald Don't be a playa hater!
Whoa... going silent...
 
Does anybody here use "jQuery Tools"?
 
explain a bit more
 
That is the site for jQuery Tools. Not sure how it relates to JQ, but sure looks like some sort of add-on.
Has anyone noticed the new user links? Up at the top, click your username(in SO, not chat).
 
4:17 AM
?
 
Go to SO > look at the top > click your username/display name.
 
@TannerOttinger Ah yes, nice.
 
Yep.
The only thing I would change about SO is:
Being able to search from, say, the un-answered questions.
When you search, it searches the entire site, not the place your in.
 
oh
i see what you mean, nvm
 
Yeah, kinda annoying. I have to look for the tag.
 
4:21 AM
Anybody else members of any of the other stack exchange sites?
 
I am wondering about Super User, but don't have a user there.
Yet.
 
12: ServerFault, Gaming, StackApps, SuperUser, DIY/HomeImprovement, Bicycles, MetaStackOverflow, AskUbuntu, Physics, Area51, EnglishLanguage, and CodeReview
It's nice, you go to login on another site and it'll create a new account, and then merge it with your existing SE accounts.
I'm most active in SO tho
 
Huh. Whats codeReview?
 
You can post your code and have people review it for you...make suggestions
kind of like SO but instead of questions it's more of a...can this be done better/more efficiently?
 
Where is it?
 
Merging right now :)
 
there is a SE site for just about everything.
 
How about gardening?
 
not yet, but you can vote for it on Area51. :) area51.stackexchange.com/proposals/1369/…
 
user1385191
that joke was actually brought up in a Google Tech Talk one of the SO founders did.
 
4:30 AM
vid?
 
user1385191
I was watching it earlier today
 
Do you have the link by chance?
 
user1385191
 
nice thx
 
Last night, somebody linked to a Google Tech Talk, featuring a 12 yr old.
 
4:31 AM
yea...i could only watch 1 min.
 
user1385191
that someone...was me
 
the kid was very boisterous with his UMM's
 
Yep. Dumbass.
 
user1385191
rest assured, this one is professional
 
for sure
 
4:39 AM
The one with the kid looks like a bug now.
 
lmao "There is a secret but I'm not going to tell you it because I want them(Experts Exchange) to burn in hell." - Joel Spolsky
 
That was out of the blue.
 
@jon3laze was that in the video?
 
@Box9 Yup
 
Wow, that's harsh
 
4:49 AM
He refers to them as the website with the hyphen in their name.
thanks to the new google block feature i'll never see their site again :D
 
Whoa. He's brutal.
 
user1385191
uh, every ill word against them is deserved
 
user1385191
they get you to pay to join
 
user1385191
and you ask a question and other paid users answer it
 
user1385191
whoever runs the site makes tons of $$$ without putting any effort in
 
4:52 AM
@MattMcDonald I can't imagine paying those bastards.
 
user1385191
they call that site on meta "expert sex change"
 
@MattMcDonald Finally, a good nickname!
 
They changed their domain after they ended up on the top 10 worst domains list for expertsexchange.com
and yes, every ill word is deserved. I can't stand them.
 

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