« first day (100 days earlier)      last day (4841 days later) » 

1:20 AM
'DOM compensates for lack of full OO support on a web page'
'Hello? parentNode, firstChild, lastChild, element.property, etc. How can you not know this? Dot syntax, inheritance, the works! It makes JavaScript almost a complete object-oriented language. Elements are the objects and classes. – Anonymous '
 
1:55 AM
Wow, why is it so hard to read damn XML!?
0
Q: How do I read XML?

CyanPrimeAlright, so I got this xml file: <?xml version="1.0" encoding="UTF-8" ?> <level> <tiles> <row>1000000000000001</row> <row>1000000000000001</row> <row>1000000000000001</row> <row>1000000000000001</...

 
lol @ that question from David
 
His stupidity is hurting my brain :(
 
hey ircmaxell, you know anything about reading xml?
 
not in JS
 
david, got any ideas?
 
2:04 AM
I tend to stick to JSON encoded data, so i'm not sure I can help you.
if you just do this, does it alert the correct stuff?
var xmlDoc = document.implementation.createDocument("", "test", null);
function documentLoaded (e) {
    alert(new XMLSerializer().serializeToString(e.target)); // Gives querydata.xml contents as string
}
xmlDoc.addEventListener("load", documentLoaded, false);
xmlDoc.load('querydata.xml');
with querydata replaced by your xml file
 
Ohh, I think that might have worked
 
Arg, didn't work
What other ways can I load files into variables?
 
Did it alert the contents? otherwise you may have to use Ajax
 
It did alert the contents, but I still can't get all my variables to not be null
 
 
1 hour later…
3:48 AM
Ahahahaha hello anonymous
 
4:18 AM
Respect me and support me all you want, but don't say anything negative about me.
 
4:30 AM
Hey all, I have a quick, generic sort of programming question
Could someone explain the syntax of that image?
As in: What does +greet() mean vs. -GREET : String ?
 
lol @ +greek() : string
 
Typos ftl!
 
5:09 AM
@Raven: It's a UML class diagram
In the example you posted: -GREET: String is an attribute definition in the format of "visibility attribute:type".
 
UML Class diagram. That helps. Hard to ask for an explanation of what it is when you don't know what to call it.
Thanks.
 
whereas +greek(): String is a method in the format of "visibility operation(args list):return type
Ya, sure is.
2
 
Also, I'm pretty sure "greek" is a typo, haha.
 
lol, I thought it was a pun since you didn't know how to read it ;)
 
Nah, I didn't make the image. The other two boxes say "greet" as expected, anyway.
 
5:14 AM
So - I think that explains the diagram except for the visibility part
+ is public
# is protected
- is private
 
Excellent. You've been a great help.
 
Anytime
 
xelco - go to bed. you have work in the morning
 
haha. ok. see you in the morning nand
 
;)
 
6:15 AM
hey anyone here?
 
6:35 AM
kinda
 
6:50 AM
hello david
may i ask you something
 
yeah of course
 
i have an obj
var row = $(this).closest("tr");
and how to check if it is the second child of table
i tried if(row == $('table.class:nth-child(2)')) and i got error message
 
i'm.... not sure
 
its okay
i am doing other way but not the elegant one
 
 
3 hours later…
9:46 AM
Morning
jsfiddle.net/Raynos/b7hWe Are there any cross browser side effects I should be aware of with declaring functions inside function declarations?
 
 
2 hours later…
12:04 PM
Morning gents
 
12:27 PM
3
A: How to initialize firstChild so I don't get "x.firstChild is null or not an object"?

David DorwardCreate a textNode and then append it. function changeLabel(){ var textNode = exampleLabel.firstChild; if (!textNode) { textNode = document.createTextNode('foo'); exampleLabel.appendChild(textNode); } textNode.nodeValue = 'LABEL HAS CHANGED'; }

Can't believe he gets so many upvotes. :( And the answer is wrong
 
12:53 PM
lol
 
1:04 PM
@Raynos I'm curious: why the answer is wrong?
 
@ehabkost see the answer below it
 
@Raynos oh, the uninitialized variable? the question explicitly asks how to make sure firstChild is not null, so I think it is reasonable to assume that the question author initialized the exampleLabel variable elsewhere
 
1:19 PM
@ehabkost arguably yes, arguably no.
 
1:44 PM
Should I avoid instanceof
 
Depends
I'd only use it for custom objects
so if I have a function Foo(){}
and make two instances of Foo
I compare them via instanceof
 
hoy hoy
 
I am using instanceof on custom Objects. Using on native types is annoying because instanceof breaks on primitives.
 
it does in most non-pure-oo languages
 
@ircmaxell except in most other languages string literals are not primitives. You expect "string" instanceof String to work.
 
1:51 PM
depends on your definition of most
in fact, I'd argue the opposite. There are only a few languages where `"string" instanceof String" would work, since most languages don't use objects for primitives
Heck, even in C# it's just a langauge trick that "string" instanceof String would work, since "string" isn't actually an object untill it's treated like one. Otherwise it's just a straight block of memory
 
At least we don't have to use .equal or .compare methods...
 
true
 
and we don't have auto boxing...
!
 
Honestly, what I wish is that PHP implemented Interfaces for interaction as native types
so a class that implements IntAccess can be used as a normal int in all functions that expect one...
 
use Python :P
 
1:58 PM
true
but to be honest, I like loose typing
 
...
 
Python is strictly typed
 
Which is a damn good thing
 
I like being able to implicitly cast my types (rather than always needing to explicitly cast), but then again, lesser of evils I guess
 
static + strong is limiting. dynamic + strong is controllable. dynamic + weak is insane. static + weak is.. ?!?!
gosh
You want a quick list of css styles for a specific property
you google
and all you get is the Double U site...
 
2:12 PM
I wanted to make a static + weak
just for S&G value
 
Someone confirm that the latter is indeed "Safe" in the sense that it catches all entries
Dynamic weakly typed languages are awesome. Just look at JS
 
lol
The thing is, you can't program in a dynamic+weak the same way you do in a dynamic+strong and vise versa. You program to the abnormalities of your language
 
even if it's safe
it's already in the "Wooooooshhhhh magic" zone
 
HA!
0
Q: has anyone the same problem with router.php ?

user430997I wrote a component for joomla for a company. Of course every good component has also a router.php file where the parsing and SEF encoding of the components intern links takes place. Well, all went ok, until I realized that this file was responsible for making the login module and the top menu mo...

Yeah, it's a file that's unrelated to the problem, but it must be the cause I tell you!
 
!!!!
It's true
I read it on StackOverflowez
 
2:19 PM
lol
 
@IvoWetzel whats wrong with doing it like that. the arrays are actaully [{ ... }, { ... }, ...]
 
2:33 PM
Dunno, you just shouldn't have the array[1000] thing in the first place
Jan 17 at 15:11, by Ivo Wetzel
OK who thinks it's funny to star everything I say?
2
seriously, who's starring that all the time?
 
@IvoWetzel the array[1000] isn't my choice and is coming from the database
where the table has an object 0,1,2,1000.
@IvoWetzel Because its irony. And irony is awesome
0
Q: javascript array.sort with undefined values

RaynosHow does Array.prototype.sort handle undefined values in an array? var array = [1,undefined,2,undefined,3,undefined,4]; var array2 = []; array2[0] = 1;array2[2] = 2;array2[4] = 3;array2[6] = 4; When calling array.sort(function(l,r) { ... }); The values undefined are never passed in as l or r. ...

 
 
1 hour later…
3:40 PM
Is there a reliable way to create a private Constructor that users can not create an object off directly but users can still check instanceof againts it? Like a class with a private constructor.
 
 
1 hour later…
4:55 PM
Oops, I forgot to login to the JavaScript room
@IvoWetzel what is it that you want me do?
 
5:06 PM
@YiJiang Oh, @gsnedders complaint about the fixed width of the garden, that's all
Oh actually there was something else too
Highlighting things that are ES5 only
 
@IvoWetzel Yeah, well if it's any narrower it's going to get pretty ugly
There's a range, but it's not a very wide range
@IvoWetzel How much content is ES5 only?
 
@IvoWetzel Hi how are u ^^
I got a question, not javascript related,
whats your recomendation in format for video in a website (and player if you want)
 
Up to 1k views on that Code-Bowling Challenge
 
@YiJiang Mostly only additional side notes
like "Before ES5 and Browser XYZ" "In ES5 this is no longer available / changed"
@Omegakenshin Depends... flash if you want a lot of people to be able to view it
 
5:23 PM
@IvoWetzel and flv format? in working an animation in After Effects but don't know what is the best way to put it on my website, I try flash then ^^
 
5:58 PM
how could they ever design CSS without inheritance...
 
6:19 PM
@Omegakenshin dont use flash.
@IvoWetzel we have inheritance! its called mixins
 
whooo!..
 
Inheritance is overrated when you have composition
 
No I'm using less now and I'm happy
 
@Omegakenshin html5 video, gracefully degrading to flash
 
@Omegakenshin what @Nathan says
 
6:21 PM
Anyone who can help making the link, "Megan Fox" align center under the input box:
http://jsfiddle.net/Ne8zy/ or would i need to make a question on SO
 
@Omegakenshin What @Raynos says that @Nathan says and use webm for the HTML5 video
 
Also preferably degrade to java applets before flash video
 
...
:D
 
I hate flash
 
:)
 
6:23 PM
@IvoWetzel is the latest garden online somewhere?
 
I think I hate java more than flash though
at least, in the browser
 
@IvoWetzel Whats a good example of OS functional javascript that isnt attached to coffeescript?
@Nathan what about silverlight applications.
 
@Raynos Garden is at the GitHubs as always
and I'm busy here with some design stuff :P
 
@Raynos silverlight!!!! the answer to everything!
Embedded quicktime videos basically work if the user has the right software... Flash is probably the most supported thing for video though
 
@Nathan Im going to punch you. Do you honestly like silverlight?
 
6:26 PM
ow
no
 
activeX
!
 
@IvoWetzel activeX is the best. Do you know how much control you have over windows through activeX :D. Stupid IE users never see it coming
4
 
I like SilverLight like I like ASP PostBack
 
@Nathan who needs ajax or mvc :)
 
my coworker showed me Windows 7 Mobile Platform Phone Edition Series this morning, and I was pleased they are calling the browser "Internet Explorer" and keeping the E planet logo
 
6:32 PM
?
 
dude
how hard can it be to find a matching background color...
 
@IvoWetzel find one :)
 
@IvoWetzel just use the same as the foreground color, then it will match.
 
dun dun
It needs to be a good contrast to blue
hold on a sec
the white down there needs to be replaced
 
"Image not found"
 
6:36 PM
!
 
oh sorry my corporate nonsense
 
Try beige
Blue & Beige is awesome
Alternative invert that colour. and use that
You do know how the colour wheel works right? :P
 
or #00ff00 is always nice
 
#ff00ff please
 
i usually pick a few shades of the same color (varying brightness, same hue & saturation)
or for more contrast you can keep the same saturation and brightness and shift the hue
your blues are all about the same saturation and hue.
 
6:42 PM
@IvoWetzel ugh do I have to download and compile it?
 
But you have about half gray-white and half blues, so neither dominates
 
@IvoWetzel the garden :)
 
@Raynos Uh, you can grab the HTML from the gh-pages branch
 
Oh there a bunch of .md pages.
 
6:54 PM
anyone got an idea how to flip a background image using CSS?
 
Can you alter the image?
 
@Raynos only via CSS
 
7:18 PM
can i set default value in a function
function suggest(inputString, type, pid = 0){
 
no
but you can do it inside the function via pid = pid || 0;
if pid evaluates to false(0, undefined, null, '' etc) it will be set to 0
 
@IvoWetzel I always did an undefined check ... this has saved a LOT of my time :D
 
To be honest, I though this would be common knowledge by now :O
 
but i need to fill the param anyways syntax error
or no i dont
@ivowetzel thank you are actually helpful..
( with that i meant that sometimes when im in here you are writing to your self about weird stuff )
 
@Karem you'll be suprised. @IvoWetzel is actaully competant
 
7:26 PM
@Raynos Actually all I do is to imitate NickCraver
That means, I simply guess around
 
@Raynos oh really
@Ivowetzel hahahaa
Wheres nickcraver by the way?
 
busy destroying... I mean improving the DB stuff of SO
 
@IvoWetzel but we dont blame you :P
Wait what? They let @NickCraver work on SO. This is the end of SO
 
Nice!
he will id 170224 Ban = '1'
 
@Karem :(
 
7:31 PM
Do you guys look like the cartoon in your avatars, in real life?
 
@Karem yeah, my friends call me arrow face
 
@Karem I wish.
 
@Raynos yeah good lookin and ivo oldgen harry potter
 
!!!!
That's Snufkin!
 
@IvoWetzel is a witch
 
7:39 PM
If you don't know snufkin, get out ;_;
@Raynos You look like someone who missed the cast for the next Street Fighter
 
@IvoWetzel did you draw him
 
did you draw him
lol
 
@Raynos No
Stolen... I mean, found on deviantart
 
@IvoWetzel its akagi :(
 
wtf is snufkin
 
7:42 PM
{{Infobox character | name = | series = Moomins | image = | caption = Snufkin in Moomin World theme park, Naantali, Finland. | first = Comet in Moominland | last = | cause = | creator =Tove Jansson | portrayer = | episode = | nickname = | alias = | species = Human | gender = | age = | born = | death = | specialty = | occupation = | family = Mymble | spouse = | significantother = | children = | relatives = Little My (half sister) The Mymbles (Mother, half sister)The ...
!
 
haaahaa at the dude
are you swedish
 
nope
 
snufkin is swedish
 
I know
I just happened to watch the moomins when in my childhood :)
 
i would rather like some action char like hulk than a dmn "snufkin"
ooo that explains..
 
7:45 PM
Yeah some action guy, I should consider using a picture of @NickCraver as my avatar!
 
oh now when i looked it up i know that serie saw it once
your the one on the left
 
(now he'll be angry because I pinged him for no good reason)
 
just wrote another wall of text:
0
A: Combine Javascript/CSS into one file or two for better optimization

ircmaxellWell, there are two main schools of thought. The first, is reduce the number of HTTP requests as much as possible. This would say to reduce ALL CSS files down to one monster. It's better to download 400kb once, than multiple 50kb files. (and the same for JS). The other is to combine where nec...

 
8:14 PM
I look a lot like my avatar, on most days.
 
I don't
 
8:51 PM
Is there any difference between: jQuery(document).ready(function(){}); and $(document).ready(function(){});. It has always seemed just like an optional alias, but I've never looked into an actual functional difference.
 
yeah writing "jQuery" instead of $ is taking splitseconds longer..else not
 
heh, thought as much
thanks
 
no problem :)
 
@JeffDalley you can access jQuery when $ is taken by another object in the global namespace. $ is a common variable used as a shortcut for document.getElementById
Of course you can then use jquery.noConflict where neccesary
 
listen to the master
 
8:56 PM
ahh good to know @Raynos, thanks!
 
@JeffDalley prototype.js and mootools both use $ for other functionality.
As a sidenode I'm impressed with the docs for prototype.js the API is beautiful. api.prototypejs.org/Prototype Anyone know how that's made?
 
@Raynos So have you gotten into the habbit of using jQuery in place of $ most often?
 
@JeffDalley I've gotten into the habit of knowing that my code doesn't namespace clash
 
@Raynos the footer says "Generated by PDoc. Uses Silk Icons and portions of Aristo.", with links
 
Although if your writing libraries or code that's meant to be used by other users then surrounding your code with:
(function($) {
    // code
}(jQuery))
Is great to garantuee no clashes as well as being able to have pseudo global variables without polluting the namespace.
@Nathan your eyes are good that horrible grey colour is unreadable :)
 
9:02 PM
@Raynos Ah nice I've never tried that, good to know again heh
 
@Raynos you thought I was joking when I recommended white-on-white earlier?
 
I should look into the new prototype. It looks good
 
I liked Prototype when I first used it a few years ago.
 
I like moo
 
@ircmaxell is that because your a cow?
 
9:06 PM
yes
 
9:30 PM
Opera...
why can't you just render it the exact same?
 
@IvoWetzel Because CSS doesn't define rounding? hides
 
nope
it's exactly one pixel off
 
I guess after my earlier tweet I can't run away now.
 
@gsnedders bonsaiden.dyndns.org:28785 the spacing between "Ivo Wetzel" and the place holder image is exactly one pixel less in Opera
And I have no idea why...
Also I have to say it again: Font-Rendering is a bloody mess
 
@IvoWetzel It's one pixel more here than in Chromium
 
9:40 PM
...
:(
 
@IvoWetzel I get different gaps in all browsers here :P
 
it's the same here in Chrome 10 and FX4 beta
The main question is, why is it different in the first place?
ah
giving the img display: block
seems to have fixed the issue
 
9:56 PM
Microsoft gets cutting-edge web apps in 2000-and-late. microsoft.com/web/enter/?WT.mc_id=aff-f-us-wag-WM-Audience
 
ah WebMatrix
heard of that on Hanselminutes
oh mp4 video
no silverlight?
 
10:10 PM
ah some nice css transitions make it so much cooler
hm, does IE9 support css transitions?
 
How do I check JS FPS properly?
0
Q: Check FPS in JS?

CyanPrimeHow would I check the fps of my javascript? I'm using this to loop: gameloopId = setInterval(gameLoop, 10);

 
is a good article on the topic
 
@CyanPrime g105b.com/test/gtgame/prototype2 I started working on this, not really an engine yet, but you get the idea
FPS is calculated at the bottom
@CyanPrime also, you don't want to rely on setTimeout, it's very inaccurate.
If you are planning on moving something, move it according to time delta, not per-frame.
that way, it will take the same amount of physical time to perform the same action on different speed computers
 
Time delta? Whats that?
 
10:25 PM
@CyanPrime the difference in real-world time between the two frames
 
Oh
But I need frames cause I got animations to use and such
 
@CyanPrime did you check my link?
 
Yeah, but it's kinda over my head
 
@CyanPrime the link I sent you uses animation, but its speed is consistent on all computers, slow or fast.
If you animate something by moving it x pixels per frame, it will be very fast on fast computers, and take a long time on slow computers.
@CyanPrime line 74 is where the animation begins... a normal JavaScript timout
the frame function is where the animation takes place.
The very first thing it does is calculate the start time var st = me.date.getTime();
then it performs all the update logic, and draws the changes, then calculates the current time again (it will be a few milliseconds in the future by this point)
then the delta time (dt) is calculated simply by subtracting the start time (st) from the total time (tt) me.dt = (tt - st);
delta time is measured in milliseconds, so the frames per second is calculated on line 95
Math.round(1000 / me.dt)
@CyanPrime does that help you?
 
 
1 hour later…
11:57 PM
evenin' fellas
trying to help out a buddy of mine and wanted to see if you guys had any thoughts on this question
1
Q: Show different phone numbers based on referrer, useragent

SeanHello, I am attempting to serve different phone numbers on a site based on a number of factors, allowing us to track inbound phone calls based on how users arrived at the page. Check to see if user is coming from advertising by checking for "?provider=" querystring, serve advertising number if...

 

« first day (100 days earlier)      last day (4841 days later) »