« first day (136 days earlier)      last day (4815 days later) » 

12:00 AM
Blockless statements are stupid though, what effort does it really take to do that?
 
@MattMcDonald I thought the curly brace on first line style guards against certain semicolon insertion bugs?
 
@Nathan only in some cases
 
yes, rare, but horrible and worth avoiding.
 
@Nathan It does, for example return
@Nathan Watch this at 32:30 it is absolutely genius:
very funny and very descriptive
 
12:21 AM
yes. I think I remember seeing that it's also possible with if for example, breaking stuff.
 
@Dori didn't notice you pop in. I haven't had a chance to watch the lynda materials yet, btw. The book is the one book I fit in my backpack over the weekend home. I am rereading it now and may have some feedback. What is with the eighth edition?
 
var num = 10000000000000000;

alert(num === num + 1 ); // true o.O
 
user1385191
yeah I think that's js' int limit
 
user1385191
I recall running into it before
 
It depends on your architecture.
 
12:41 AM
@Nathan
 
12:55 AM
:D
 
:D
 
That image is wrong, there should be a few bodies jammed between the tables
 
@david The body is outside of the table.
 
*tbodies
 
1:16 AM
I honestly think that node.js servers are going to dominate in 10 years :)
 
@Raynos I honestly think that's unlikely.
 
@Nathan I think it'll start to kick out php.
Dominate may not be the right word here.
 
user1385191
people flock to that which is easiest regardless of merit or content
 
user1385191
that's PHP's strength
 
Also JavaScript's
node.js is pretty low-level to be super popular
 
1:25 AM
Theres where libraries pick up
raw DOM is a bit low-level
 
yes, things like jQuery and Rails tend to be more loudly popular.
 
I'm wondering how stackexchange implements Comet for chatting.
Firebug tells me that this page keeps post events to server at 1 second interval.
So, does Stackexchange do comet in polling way? You must be kidding me.
 
looks like it
It polls the server for new data
 
HTTP is stateless... how can you possibly avoid polling from the client side?
 
And, stackexchange server can stands the storm of poll request? I'm impressed!
Google "Comet" or just check this out en.wikipedia.org/wiki/Comet
There is one umbrella tech term called "Comet"
 
1:36 AM
fail
 
You can do it in "Long Poll" or "HTTP Streaming" way.
 
Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term, encompassing multiple techniques for achieving this interaction. All these methods rely on features included by default in browsers, such as JavaScript, rather than on non-default plugins. The Comet approach differs from the original model of the web, in which a browser requests a complete web page at a time. The use of Comet techniques in web development predates the use of the word Comet as a neologism...
 
They are much efficient than simple Polling
 
oh ahah
 
Try websockets.
 
1:39 AM
websockets has protocol deficiency.
It is disabled in FF4 and Opera 11
 
I mean use chrome
 
It is unsafe. Well, at least it is unsafe for some web site behind firewall.
 
Its safe
 
It is strange that Google revealed that websocket is unsafe, then FF4 & Opera11 disabled websocket, but Google browser haven't disabled it yet.
 
what a bunch of bad options.
 
1:41 AM
Some web site behind firewall is unsafe
Thats because its not unsafe
some people made insecure web servers and then used websockets to abuse them :\
Solution is use socketIO
 
@Raynos, do you mean socket.io?
 
yes. Although this isnt as easy unless you use nodejs on the server
 
socketIO needs flash enabled though doesn't it? as the fallback
 
Socket.io is good
 
@david no. It can also use comet as a fallback
 
1:44 AM
it supports multiple Comet options and choose best with feature detection.
 
Flash is a possible (horrible horrible horrible) fall back
 
@Raynos what is the order then? I thought it was websockets or flash.
 
IMHO, from app developer's perspective, not from js library developer's perspective, it is better to choose only one Comet solution over multiple solutions.
 
@david order is set by developer
 
Ah, i was meaning like, fallbacks for client side sockets. Long polling as a fallback seems pointless, might as well just use long polling
 
1:49 AM
Well no.
Anyway. I'm going for tonight
 
goodnight @Raynos
 
2:04 AM
Hi guys!
one question
could somebody explain
does not produce nested divs
as far as I understand it should finish one loop and then go to another
(i probably have not understood correctly jquery's .append)
 
the second one is looking for divs with class='container'
 
Fix the ".container" issue doesn't make it nested
 
what is x? your second loop starts with i=x
 
@david sorry that is old
I was experimenting with something, x does nothing
 
I think your problem is that you're expecting append to act like 'print'. I suspect jquery is seeing your first append as trying to insert a node
if you create a string first and append that then it works
 
good night!
 
var str = "";
for(i = 0; i<11; i++){
    str+=("<div class='square'>");
}
for(i = 0; i<10; i++){
    str+=("</div>");
}
$("#container").append(str);
night nathan
 
@Nathan thanks I'll give it a try good night
@david you are correct, I imagined that must have been the problem
@david this is exactly the result I expected
thank you very much
I'm trying to figure out what you did there!
@david thanks!!
@david I get it now, it makes sense
 
2:16 AM
@david jeje
that is crazy
@david what (the hell) is going on ther?
 
I suppose you want "$(".square").append("</div>")" in the second loop.
 
8 mins ago, by david
var str = "";
for(i = 0; i<11; i++){
    str+=("<div class='square'>");
}
for(i = 0; i<10; i++){
    str+=("</div>");
}
$("#container").append(str);
@MorganCheng @david's answer is exactly the result I was going for
thanks!!
 
having one loop go to 11 and the other go to 10 creates malformed html though
 
@david some crazy results I'll admit
 
safer to do it like this or something
var parent, child;
for(i = 0; i<10; i++){
    child = $("<div class='square' />");
    if(parent){
        parent.append(child);
    }
    else{
        $("#container").append(child);
    }
    parent=child;
}
 
2:29 AM
@david I'm not sure I followed
 
@david, frequent operations on DOM is expensive. In real production, I suggest to compose the whole dom fragments and append it to container in single shot.
 
I'm preeetttyyy sure that that code will only result in a single repaint. But i'm not sure. I will check
 
@david, you are sure or not sure? :)
 
@david and @MorganCheng thanks both for your help
I'm going to sleep now
have a good night!!
 
@MorganCheng You are correct, it is better to do the actual insertion into the dom at the end
@Trufa night!
 
 
2 hours later…
4:44 AM
chat.stackoverflow.cm Funny how that goes to google.
 
5:44 AM
domain: stackoverflow.cm
status: taken
nameserver: ns1.googleghs.com
nameserver: ns2.googleghs.com
nameserver: ns3.googleghs.com
nameserver: ns4.googleghs.com
 
morning
 
 
1 hour later…
7:17 AM
Hi! :)
 
7:41 AM
here my problem is

javascript:setOAddress('Janice's Kitchen and Catering');

this is company name----Janice's Kitchen and Catering this time function not called.


this is company name ---janice this time is working ..


which method is correctly working this one ...

one example?
 
@JamesPHP You can press Ctrl+K to format code. Since formatting is multi-line messages won't work, either post in one line and wrap codes in backticks (`code`) or post your code in a separate message. ;)
2
 
8:01 AM
RT @paul_irish: http://www.koalastothemax.com = fantastic SVG magic powered by d3.js: http://goo.gl/HaOIO by Sir @mbostock of Polymaps & ...
 
8:46 AM
@Nyuszika7H hi
i am discuss with you.. are you free now
 
9:35 AM
yes @JamesPHP
@JamesPHP could you write the homework question out in full so we can have a better overview?
 
@JamesPHP The problem is you are using single quotes to mark the beginning and end of the string (the company name), but also have single quotes within the string
JavaScript doesn't know that you meant the quote in "Janice's" to be an apostrophe and not the single quote ending the string.
Either escape it setOAddress('Janice\'s Kitchen and Catering'); or use double quotes around the string setOAddress("Janice's Kitchen and Catering");.
 
10:11 AM
Hi! :)
 
A little help someone
 
Is it just me or code blocks in this site are completely messed up or not shown at all?
 
@Nyuszika7H not just you - Chrome 11
 
@Greg I have Chrome 11, too. Testing in FF4
Not a Chrome bug… tested in Firefox 4 beta 11 without any extensions (except Stylish, but there's only one app style installed to change FF's color).
 
The jsfiddle I posted ... how come .change() event helper doesn't work when the value is changed with the keyboard?
 
10:23 AM
@Greg it doesn't work at all for me, not even with mouse
 
huh ...
 
@Greg Gotcha! You're checking the select's value. You should use $(this).find('option:selected').val().
 
@Nyuszika7H ahhhhh
hold on I'll update it
 
still broken
@Greg You should put on the same line as the closing brace. Otherwise it causes a syntax error.
Wrong
if (condition) {
    doSomething();
}
else {
    doAnotherThing();
}
Correct
if (condition) {
    doSomething();
} else {
    doAnotherThing();
}
 
pull the other one!
noooooo
that can't be true
 
10:27 AM
@Greg You should press Enter when you select with keyboard.
 
@Nyuszika7H I notice that works, but I don't want to force people to press enter
 
@Greg Any reason why you're using no wrap (head) and putting $(function() { manually?
 
@Nyuszika7H its how the code on my website is set up
no reason for this specific test
@Nyuszika7H aha ... keyup event fixes it :)
 
@Greg Awww, for the god's sake, use chaining and cache $('#secondShow')!
 
jsfiddle isn't for code optimisation and design patterns
 
10:33 AM
@Greg If you use $(function() { instead of onDomReady, you should care about these, too…
If you use a selector more than one time, jQuery has to search for that element every time.
 
I know ...
But for the purposes of this experiment, the 2 millisecond difference didn't bother me or my browser
In the production site, I'll take many code optimisation techniques into consideration before it goes live
 
10:52 AM
ok
Are there any differences between eval and execScript?
 
@Nyuszika7H I'd be interested in the answer to that ... maybe ask it on SO, seems a good question
 
RT @bocoup: We just launched the new http://popcornjs.org. It was a pleasure working on the new @popcornjs identity with @upstatment.
RT @johnallsopp: in short - AT&T is giving away $10K for the best HTML5 app - entries close March 8 http://bit.ly/e0hpdV
 
> If a program part that contains an error is never executed, the error never breaks the script. For example, the following function finishes successfully if whizBangFeature is false:
function move(integer x, integer y, integer d) {
  x += 10;
  y += 3;
  if (whizBangFeature) {
    simulate{@x and #y} along path
  } else {
    x += d; y += d;
  }
  return [x,y];
}
> The code simulate{@x and #y} along path is a syntax error, but this error does not break the script unless the script attempts to execute that piece of code.
I think integer x is a syntax error, too. Come on, this is JS! But even if I remove the integer prefix from the arguments, I get a syntax error.
Ok, it may be the future (JS 2.0), but look at the footer…
> Last modified Tuesday, February 15, 2000
No comment.
 
11:58 AM
@Nyuszika7H JS2, ES4, etc. is dead.
 
Hello
I have this at the moment:
if(location.hash){
var hash = location.hash;
var newhash=hash.split("#!/id=");
location.replace("photo.php?a="+album+"&p=" + newhash[1]);
}
So when you enter photo.php?a=39&p=2#!/id=6 it will replace to p=6 (the new id that are in the hashkey...
This works fine.. Although i need a modification now.
I want if you enter photo.php?usr=1&a=39&p=2#!/id=6 it should go to p=6
notice the difference, there's a usr=1 parameter in this one^
 
@Karem Hang in there for a second, what are you using the ajax crawler shebang thingadongdong here for?
 
wtf is a thingadongdong..?
 
9
Q: Does Stack Overflow forget their registered users?

Today I hit upon an interesting question here on Stack Overflow (about monotonically increasing time, but that is beside the point). I immediately thought I could contribute somewhat, and so tried to log-in, using my google OpenID thingadongdong. It didn’t work. well, somehow it did. Anyhow, I ...

 
is this to me?
what has that to do with me?
 
12:09 PM
You asked what a thingadongdong is. What I'm saying is, why are you using the shebang thing Google just invented? Because the way I see you using it doesn't quite sound like how it's actually suppose to work
 
hi buddy
 
whats the shebang thing? the #!/ ? :P
 
shebang??
 
@Karem Yes, presumably you'd known that when you actually started using it
163
Q: What's the shebang (#!) in Facebook and new Twitter URLs for?

BoltClockEDIT [10/15]: added an example from the new Twitter too to make this question easier to search for. I've just noticed that the long, convoluted Facebook URLs that we're used to now look like this: http://www.facebook.com/example.profile#!/pages/Another-Page/123456789012345 As far as I can reca...

 
no i didnt actually..
i use this to when you browse images then it changes the url by adding #id=3.. #id=4 etc..
 
12:15 PM
afternoon, all
 
so when you copy the link you get the current viewing image
as you cant manipulate the url history in no other than the new ff4 and chrome..
 
Any 4ks want to throw their close vote in here?
0
Q: Call javascript function residing in iframe from external javascript file

OddOneOutI have one html openning inside an iframe.One javaScript function is defined there say getSomething().Now in the parent page I have one external javaScript file.Is it possible for me to access getSomething() from the external javaScript file ?

 
12:51 PM
RT @tile5js: 0.9.4.2 Update - Progress with Inertial Scrolling: http://t.co/oVaIGpX
 
1:07 PM
deCarta Mobile JavaScript API http://goo.gl/VR3VS lightweight, configurable framework for making fast location-aware apps w/ map integration
 
1:28 PM
Good Morning
 
1:42 PM
Morning
 
'Evening
 
I'm using ScrollTo for one of my websites. However it won't work and I think it has something to do with my navigation be fixed. Anyone have any suggestions? (This script works perfectly fine on any other website)
 
@Twinborn Not enough information there; either provide link or (preferably) a reduced example of the problem, on something like jsfiddle.net
 
@YiJiang Thanks, one sec.
@YiJiang jsfiddle.net/MqnmR here you go
 
wow, one of my CW answers has shot up in votes last month.
91
A: Get QueryString values with jQuery

Andy EMost of the solutions posted here are largely inefficient. Repeating the regular expression search every time the script needs to access a parameter is completely unnecessary, one single function to split up the parameters into an associative-array style object is enough. If you're not working w...

 
1:54 PM
@AndyE Checked timeline?
 
9 more for a shiny-shiny.
 
53k views, hmmm...
 
Edited 20th feb, I guess it got bumped
Accepted answer got even more votes by the looks of things
 
    $().click(function(event) {
scratches head What does this mean?
Anyway, cleaned up code: jsfiddle.net/MqnmR/3
 
I'm a JS noob. My friend gave me the script to implement..so I'm not sure myself.
 
1:59 PM
I want to keep my project totally open source when its finished, i.e. on github - but how do I keep database passwords and such safe?
 
@y
 
Well, it's not a good idea to use $().ready(function() { - $(document).ready(function(){ or $(function(){ are both better
@Twinborn tab to autocomplete
 
afternoon'
 
@YiJiang Still doesn't work unfortunately. No animation, just directly points to the anchor.
Hi myles
 
@Twinborn I know, that won't solve any problems. I'm more confused about that click event handler above
Did you check for JavaScript errors in the console?
 
2:06 PM
there are no errors, like I said, on any other website without this floating navigation, it works
 
Anyone seen this?
"Netscape said they were going to destroy Microsoft, In fact the software that will destroy Microsoft is Windows Mobile"
:P
 
Netscape did destroy MS
 
@ircmaxell You still on NS4? :D
 
Yes
why?
Netscape got an anti-trust lawsuit against MS. So they did destroy them.
 
When was that?
 
2:20 PM
United States vs. Microsoft was a set of consolidated civil actions filed against Microsoft Corporation pursuant to the Sherman Antitrust Act on May 18, 1998 by the United States Department of Justice (DOJ) and 20 U.S. states. Joel I. Klein was the lead prosecutor. The plaintiffs alleged that Microsoft abused monopoly power on Intel-based personal computers in its handling of operating system sales and web browser sales. The issue central to the case was whether Microsoft was allowed to bundle its flagship Internet Explorer (IE) web browser software with its Microsoft Windows operating syst...
 
2:32 PM
I don't see the problem with Microsoft bundling their web browser with their operating system.
 
@Greg I do, It creates a monopoly
It means they have a strangehold on the browser market
now in the business world this is the equivalent of you buying a car
and them saying "oh by the way you can only use OUR special type of petrol"
 
you don't have to use Internet Explorer
 
It's not that they bundled it. It's that they made it unremovable
 
ah yeah, that makes sense.
 
so nobody else could try to do the same without having competition forced by MS's market position
 
2:36 PM
Same as windows defender
who wants that crap
 
It's hardly a huge advantage; the argument that a browser should included with a modern OS is a valid one, how the hell are you going to get another browser then...?
 
or windows firewall all that junkware
@YiJiang package them in the OS
 
The fact is consumers are morons and can't be bothered to get a better browser...
 
You have packages in the OS installation that will allow for installation of one of a few browsers
 
@MylesGray Then it comes down to a question of which browser
 
2:37 PM
It's not such a big deal today, but back then it was huge
 
I see that as a viable solution
@YiJiang That is true but how many broswers are there today?
 
The EU option is actually quite good, but it still leaves much to be desired
 
9/10?
@YiJiang EU option?
 
@MylesGray Well, you are looking at the situation worldwide
@MylesGray To wand off anti-trust lawsuits in the EU, Microsoft created this browser chooser thingy for both new and old installation of Windows
 
Speaking of freedom of choice, has anyone seen that South Korea dropped hundreds of thousands of leaflets detailing the uprising in eastern europe recently saying they didn't have to put up with a marxist regieme?
@YiJiang Thats what that is!
I wondered when I installed a new version what it was, thing is.... it uses IE to let you download it :P
 
2:39 PM
Anyway, back to the worldwide problem: what you use here isn't what, for instance, people in China uses
@MylesGray Which frankly is the only thing IE is good for
 
@YiJiang I understand that they have that dual engine browser don't they?
max-something?
 
@MylesGray Maxathon's new version uses a dual webkit - trident engine
 
@YiJiang But MS stated that in China the reason that they use IE6 is because of pirated copies of XP
That they wont upgrade in case they are found out
But the government censorship has a stranglehold on all things anyway
 
@MylesGray Meh, more than 50% is too big a number for that
internet explorer
A simple Windows XP tool which allows the user to browse to Mozilla.com and download Firefox, a web browser.
 
2:42 PM
@MylesGray It's a plausible explanation, but meh. In that case why not get a much much better alternative browser?
 
very good point...
I imagine because they don't know/care?
 
The 96% piracy rate figure feels suspect to me too
 
but then again, we aren't designing for the Chinese market
 
96%?! I highly doubt that..
 
I would have to agree 96% is far too high
 
2:44 PM
Piracy is rampant in China, but 96%...?
 
Ah that figure applies to just China?
 
@YiJiang Piracy is rampant everywhere, I mean look at Adobe CS3/4 and 5
All it takes it to block their servers in the hosts file
 
idk I hear the government even pirates windows in China.
 
@Loktar yep just china
 
Piracy rates are almost always very inflated
 
2:45 PM
Interesting article came out yesterday saying 70% of people think piracy is ok
 
I do think piracy is ok under 1 condition
If the distributor doesn't want to release their product in a method I can consume
 
@ircmaxell I don't understand?
 
Then, if a pirated version is consumable, I have no moral objection to it
 
I think its ok if you can no longer get the product, like abandonware games.
 
Example: A lot of books aren't released to EPUB. If not, I have no problem downloading a pirated EPUB version
 
2:48 PM
Although many times I just buy them on Amazon
 
if it is released, I have no problem purchasing it
 
@ircmaxell I get you now
@Loktar I have to say the same for GameBoy ROMs
how else am I to get Pokemon Silver on my PSP?
:)
 
Yeah stuff like that is really hard to find nowadays
 
someone make an activeX control that spreads like a virus and removed IE6 from machines, replaces with browser download app
 
lol that would be awesome
 
2:49 PM
Another example would be CS5. It's not available for Linux. So I wouldn't be too morally objectable to piriting it if there was a version that ran with Wine...
 
And Crash Bandicoot - I bought it for PS1, it isn't available on PSP so you download the ROm
 
activeX so that the only machines to be infected would be those running ie6
 
I have paid for one version I have no problem
@ircmaxell I agree with that
 
yeah I feel the same way @MylesGray I dont even consider that pirating
 
I bought CS2/3 and 4 master collections
then moved to mac
so i would need ot buy CS4 for mac
 
2:50 PM
I don't know if it's right,but that's my feeling
 
wow thats dumb
 
thats just wrong
 
should get both copies automatically
 
I already paid for software that is now redundant to me...
 
or the ability to DL the other one
 
2:51 PM
@Loktar the key is not cross platform
 
thats so stupid
 
you need a MAC specific key
So I see it not as pirating as my Purchased CS4 MC is not useful to me
and I haven't sold it on
so to me that circumstance makes it okay
 
yeah I agree
 
Anyway while we are on the subject of illegal things, anyone seen this mad backdoor trojan coming out for mac?
 
lol wow.. viruses go into beta now?
 
2:53 PM
I expect it to fail badly as you never make virus development public, you may as well make it open source and send the src to apple
@Loktar exactly!
Look at the massive DDoS attacks on Amazon and eBay, why did they work? secret replication over months and one massive attack
Man how obvious is that, It creates a server on your machine to allow remote access...
If you had ANY decent hardware firewall it would kill this
 
It's so funny... Mac has the reputation of it just doesn't get viruses, yet it has more security vulnerabilities found per year than any other software product on the market...
 
@ircmaxell It's because it has what, 4% market share, you're not going to make your name making viruses for that :P
 

« first day (136 days earlier)      last day (4815 days later) »