« first day (778 days earlier)      last day (4173 days later) » 

8:02 PM
hey all
Would anyone mind helping me with a basic question
 
Just ask the question, don't ask if you can ask
 
if a function has parameters of args e.g. function (args), what does it mean. I have this in my code (working from MSDN Win 8 app samples) and the variable args is not defined anywhere in the code.
 
It simply means that function accepts one argument and that argument is named args inside the function.
 
Thanks for the help, so that means that to use the argument I can just set it to a variable and use the variable?
 
You call the function like foo(1234) - then args is 1234 inside that function
 
8:10 PM
Ok, that explains a lot then. I'm working with the search functionality and the search is handled by a function function(args), the args must be the actual search term entered by the user. Thanks.
 
@SomeKittens You are as well. Excellent conversation... I was just DEAD TIRED afterwards :-P
 
8:26 PM
I am trying to use offsetTop on <span> elements and it returns 0. How can I get the offset from the top of the page to that <span>?
(clientTop also returns 0)
 
@Zirak :-P point taken
 
var movePlayer = setTimeout(function(){ //some script }, 1000)
End with ; or totally unimportant?
 
totally unimportant, but why not do it
JS is semicolon-insensitive
in a weird way
 
Damned lies
 
You should add a semi-colon. There is a mechanism which will do that automatically for you when the script is interpreted but you shouldn't rely on it.
 
8:41 PM
Normally I put it behind everything :p
Just to be sure!
 
I'm pretty sure it's totally reliable, but I personally put it on everything except function statements
 
@zneak It isn't.
 
I mean that I'm pretty sure all JS parsers parse it the same way
 
Makes sense. I wash my hands after doing anything.
 
not that it's somehow not broken
 
8:42 PM
@zneak That's not the point. It is broken in some edge cases.
 
if you don't put the semicolon, the JS parser will try to parse the next line and if it makes sense alone, it will consider the two lines to be separate
 
Didn't we have a gist on that?
 
return {
	foo: "bar"
}
will work
but
return
{
	foo: "bar"
}
will return undefined
 
Right, that's one.
 
so how is that behavior not well-defined?
 
8:43 PM
I used to type my code like this:
function
{
}

But I dont do it anymore.
 
It's different from what any sane mind wold expect
And JS really needs an option to require semicolons.. Too bad that strict mode doesn't do that.
 
It's very well defined. And you should only think about omitting semi-colons if you completely and utterly understand it.
 
in my view, not putting a semicolon can never break anything
 
@zneak I didn't say it's not well defined, I said it's not a good idea to rely on it because you wouldn't expect that behavior.
 
(unless you put multiple statements on one line, in which case you totally deserve it)
 
8:45 PM
Sure, that works. Until it doesn't.
 
can you come up with an example that works with the semicolon but doesn't when you forget it?
 
2 mins ago, by zneak
return
{
	foo: "bar"
}
 
So it's not "it never breaks anything", it's "it usually doesn't break anything", which is another way of saying, "it breaks something"
 
that wouldn't work with a semicolon either
that would be return; {foo:"bar"}
I'm pretty sure it never breaks anything, and I'm asking you to prove me wrong
just one example will do it
 
Happily. I think I answered a question like that before, lemme check
1
Q: TypeError with two consecutive self-executing anonymous functions

RandomblueThis question is inspired from the accepted answer here. Why does the following piece of code alert "first", then "second", then errors out with a TypeError? (function() { alert('first'); }()) (function() { alert('second'); }()) The given explanation is that the returned value of the...

 
8:49 PM
right, this is ambiguous
 
@zneak There's quite a few articles on that. Like this one. We've even had a Gist on that (which I can't find right now).
 
You wanted an example? I gave you one
 
did I not concede victory two posts ago?
 
Parentheses usually cause ambiguity (function call/grouping)
ah, k. Thought it was a way of sneaking past it
 
I meant "ambiguous" in the sense of "ambiguous to the parser"
(which is when things go bad)
 
8:51 PM
hrm, let's see if this brings the right one...
!!/google zirak stackoverflow undefined closure
 
@OliverSchöning gsafdsa format your code!
 
its just a test to see if it works :P and I intent to read up on how to make pretty code haha
 
@OliverSchöning He meant to say, format your code here in chat.
 
I dont know that witchcraft
 
8:53 PM
Format your code or it'll be binned (see the links at the bottom right labeled help & faq). By accepting this text in your chat window you hereby waver any right to complain.
4
1 message moved to recycle bin
 
mouseout seems to trigger even when the cursor moves over a child element, is that correct?
 
Event propagation
 
no, I mean
 
So am I supposed to type code before and after the code piece?
 
<div id="foo"><div id="bar" style="margin-top:10px">bar</div></div>
 
8:57 PM
'test'
´test´
hm
 
`code`
 
if you put your mouse over #foo then move it over #bar, onmouseout for #foo will trigger, from what I see
 
For inline. Ctrk+K for multiline.
 
even though #bar is a child of #foo
 
@zneak Dunno, but shouldn't be hard to test
 
8:58 PM
How do I see the rules for this room? I want to reference a long piece of code but know I shouldn't post it here but can't remember where
 
@James If it's long go with pastebin or a gist.
 
@James On any paste site (pastie, ubuntu.paste, pastebin, etc etc) that you like
 
that is code now? No hate?
 
I expected that not to be the case and I tried and apparently it is
I hoped someone around would know for sure
 
8:59 PM
Weird if it does do that, but then again, positioning and hierarchical structure don't go hand-in-hand
 
MDN knows for sure. :)
 
ignore this message
 
^ ignore this user.
 

Sandbox

Where you can play with regular chat features (except flagging...
 
Such a meanie
neat
 
9:02 PM
Also, @James, look at the pinned messages to the right
 
@Zirak thanks, just trying pastbin now. Is there a specific link I should use or is it just the URL in the URL bar?
 
The url to that paste
If they happen to coincide...
 
So I have this code: pastebin.com/iJfRMW7N, that is working fine when I run it from my homepage (in a Win 8 App).
However when I add the same code so that is run when attempts to search my app using this code: http://pastebin.com/dJw5tEnf
 
@James When what with whom and where?
 
I get an error stating: that terms in for (terms in searchTerm) is undefined
@OctavianDamiean sorry, I'm new to this, is this not enough information about the issue ( or too much)?
 
9:09 PM
Not that it'd solve your problem but you've got your variable naming wrong there. searchTerm should be plural and terms should be singular.
@James It's that the sentence doesn't seem to make sense, at least to me.
 
So formatted now I hope.
Why does my function not run:
setTimeout(function(){

posX = posX + 10;
	   players[myID] = myID + "," + posX + "," + posY;
       io.sockets.emit("message","right," +  players[myID]);
}, 100);
 
The variable names have been used consistently but I guess I see what you're saying about it making more sense to make it searchTerms and term.
Strangely I just got the code working without making any changes, bizarre. I literally stopped debugging and then debugged again and it worked...?
 
It's Windows, what did you expect?
 
I think my website hates me!
 
yesterday, by Zirak
Yes. The universe just hates you.
 
9:17 PM
I actually find Windows 8 pretty awesome... possibly in the minority though!
 
No, I came to a starbucks to use a different internet connection and its only been like less than 30-20 mins and its already stopping me from accessing my site by doing the not loading and eventually timing out thing
 
I've never seen someone struggle that long to get a website online as you.
 
haha, where is he stuck?
 
Why don't you just switch your hosting company?
 
I know I think its my hosting company
Its only started being a problem since I started using wp
 
9:20 PM
I just moved to justhost today and think their fairly good value, shitty control panel but fairly straightforward
 
any good recommendations on a fairly reliable and free or cheap hosting
 
Location?
 
that works well with wp and stuff
 
US, Uganda, Moon, Mars?
 
I am currently using 000webhosting and they have been fine untill I started using wp and had two installs of it
 
9:22 PM
@OctavianDamiean You sound like you've been around too long and heard the same s**t too often!
 
Free hosting is crap. You get what you pay for...
 
Ok anyone recommend something
 
justhost.com
 
I have a lot of classmates using bluehost.com
 
@James Partially right. It's also that I'm an asshole and cynical at times.
 
9:24 PM
@benl, if you use justhost make sure you use the 50OFF coupon code
 
@benlevywebdesign What location? US, Uganda, Moon, Mars?
 
US of A
 
I can't help you then.
 
@OctavianDamiean Why, where are you
 
@ThiefMaster GAE and heroku are awesome for hosting. Although they make you pay quite quickly if you want to store some data.
 
9:25 PM
@benlevywebdesign Austria
 
@copy Yeah, I was mostly talking about the "regular" free hosting companies where you just get some webspace and FTP access
 
Yeah, they suck obviously
 
Heroku is awesome because you deploy with git. :D
 
heh, so github sucks? :<
 
Anyone got any idea why I am getting the error '0x800a03f6 - JavaScript runtime error: Invalid character' in this code:

http://pastebin.com/dJw5tEnf
I think I'm missing something really obvious
 
9:27 PM
@James Line 18.
 
I'm kinda not that new to webdesign been learning to code for a the last 2 years but what is deploying, is that for apps and programs
 
@OctavianDamiean haha sorry, I thought what I pasted before included the line - is is line 241, column 15
 
@benlevywebdesign Being a native speaker I assume you know what deploying itself means, right?
 
@OctavianDamiean Yes! So, thats for like deploying apps and scripts
 
Well you can call them apps if you want. You can deploy whatever you want, even a website.
 
9:30 PM
If you pay for hosting can they block just you because you visited your website too much?
 
@benlevywebdesign that wouldn't be very good service!
 
0
Q: Regular Expression Needed to Replace Javascript in HTML Files

Richie086I need a regular expression that works in Notepad++ to remove multiline javascript references in several hundred HTML files. The code I want to remove looks like this <script type="text/javascript" language="JavaScript"> <!-- function ehlp_showtip(current,e,text) { if ((parseInt(nav...

 
@James ok so then while im using this free service they can block me and thats cool cause I'm not paying for it
 
@benlevywebdesign Not unless you manage to trigger some kind of DoS protection or have a request limit and ran out of requests.
Technically speaking they can do whatever they want.
Legally speaking not so much.
 
@benlevywebdesign Crappy hosters will do that when you reached your traffic quota
Good hosters do that if you ask them to do so to avoid additional costs
 
9:34 PM
Oh yea, quota.
 
Better hosters just throttle your bandwith until you pay extra and give you unlimited traffic otherwise
for example, i have up to 10TB per month available but after that it would go down from 100mbps to 10mbps until the end of the month or an additional payment
 
Speaking of hosters ... I forgot to pay my domain bill. :/
Gotta do that now.
@ThiefMaster 1&1?
 
no, hetzner
 
Oh yea, that's also my hoster. :)
 
@ThiefMaster you mean individual people(viewers/browsers) have a traffic quota
 
9:37 PM
i had a server at 1&1 8 years ago and then switched
@benlevywebdesign: no.
 
@ThiefMaster I had one 5 years ago (or something like that).
Paid friggin 70€ per month for two years ... so embarrassing.
 
@OctavianDamiean I'll have to check on the request limit but it makes no sense because I was only sitting in Starbucks for less than 30 mins and it stopped
 
@benlevywebdesign There might even be a request limit per day/hour/minute/second
I don't know.
 
@OctavianDamiean that just seems ridiculous
 
It's not impossible, I have no idea about your hoster's policies.
 
9:46 PM
@OctavianDamiean At least for the current hardware that's not that much
 
@ThiefMaster That was ages ago for an AMD Athlon X2 3800 with 2 GB RAM and 160 GB disk space at 1TB traffic per month.
 
0
Q: wp_register_script and wp_register_style not working

wordpress_designerhi so I used a great tutorial off of http://scribu.net/wordpress/optimal-script-loading.html and I am having trouble loading the scripts when a shortcode called lightbox is used here is my code. I am at the page when it is called wanted to check with someone to see if it is properly written. cla...

 
Oh.. yeah, that was expensive
 
Yea. :(
 
@OctavianDamiean envy
 
9:51 PM
Didn't you see me write 70 € / month for that dinosaur?
On a 24 month contract!
You do the maths ...
That's $ 2183 in two years. :(
That's what happens when you're stupid and don't think before signing contracts. :D
 
That's 2 iphones or 21 normal phones
 
Whats a good VPS?
 
One that you can cancel on a monthly basis.
 
why is that
 
Because you don't want to wake up one day realizing that there is a better option somewhere but you're stuck with that contract.
 
9:57 PM
oh
but why would I want to move my files again and again
 
To get a better deal if possible?
 
If you're doing that (switching services every other month), it means you're shit at choosing an option
 
thats what I was getting at
 
And if you're shit at choosing an option, it means you must have an option to pull out
 
I didn't mean to say you should cancel your contract every month but that you shouldn't got for a long term contract.
 
9:59 PM
I knew someone who had a business and moved like every two years because they found a better deal at another place
 
Well nothing wrong with that cadence.
 
That's a lovely story
 
but she spent a lot of time finding a place to move and then moving
 
So, your perspective is "hey, if it's so much trouble getting out of a pile of shit, why bother?"
Enjoy living in piles of shit
 
so then what is a reliablle VPS?
 
10:06 PM
Define good.
 
reliable
 
One that doesn't break.
What do you want to hear?
 
one that is reasonably priced, has a good cPanel, etc.
I want to know which ones to stay away from, is that easier?
I have godaddy for my domain name but I've seen and heard the cPanel is horrible
 
and now what about choosing an operating system?
ok Well I'm leaving starbucks cause I'm blocked here so its pointless to stay here
 
10:23 PM
@benlevywebdesign Obviously you want something Linux based.
 
Why do you need a cpanel anyway?
The shell to the rescue!
 
Be a man, use the shell.
 
10:56 PM
..... and 13 hours later I'm in Kearney NE
 
Can anyone recommend a solid up-to-date JavaScript book, preferebly featuring JQuery too, that works from the ground up (beginner to advanced) available to buy? Thanks
 
Will you have the unicorn fries with that?
 
good morning guys
 
@OctavianDamiean I do, yeah cause its good right!
@ThiefMaster I don't really use the cPanel that much, I just use it to set up my dns server names and parked my domain name on it and a redirect url thing
any one heard of powervps
 
@rlemon Where are you going mate? Austria ain't on the American continents.
MongoDB looks quite interesting @GNi33
 
11:10 PM
why is picking a host service so not fun and kinda scary?
@OctavianDamiean should I go with a vps or would a good host do just fine
 
Depends on what you plan to do with it.
 
I plan to host my site files
 
Do you plan to use certain server side languages other than PHP or Python?
Like Node.js or Java or whatever.
 
Java not javascript right?
 
Was an example, you can substitute those with whatever you want. :D
Basically, a VPS offers way more flexibility, the question is if you need it or not.
 
11:20 PM
well I have javascript files and jquery files so I don't know
 
Those are client-side.
 
@OctavianDamiean as of right now I don't plan on doing a lot with server sides scrips but the occasional javascript and jquery. I use javascript and jquery to do a few animations or stuff like that but I don't think that has anything to do with server side
so I guess I don't really need vps
 
Apparently IE doesn't like hidden
 
11:46 PM
0
Q: Animating sprites in HTML5 canvas

fnxI'm creating a 2D platformer game with HTML5 canvas and javascript. I'm having a bit of a struggle with animations. Currently I animate by getting preloaded images from an array, and the code is really simple, in player.update() I call a function that does this: var animLength = this.animations[...

 

« first day (778 days earlier)      last day (4173 days later) »