« first day (62 days earlier)      last day (4872 days later) » 

2:01 PM
Am I crazy with this? This should have been a comment, right?
1
A: Can a static class in php

JamieIs it possible to create static classes in PHP (like in C#)? Hope that helps.

 
no you're not crazy
that's a "Possible Duplicate" comment
 
The guy took out a retaliatory -1 to my answer as well (at least that's what I'm assuming, since it happened right after his comment)
So what else is going on today? How is everyone?
 
I'm fine, just wondering who un-accepted one of my answers...
 
@ircmaxell would have had to go to school, but didn't have to because of pretty white little snow :) very good
 
Yea winter wonderland in Germany, around 20cm over night here
 
2:05 PM
@thejh: A lot of snow? Or just a little?
 
@ircmaxell you could say that it was a lot, the forecast for our city was 10-15cm in 12h
 
Here, nothing gets shut down until we have at least 6 inches on the ground (15 cm)... But I know some places 1cm is enough to shut everything down...
 
Snow... PANIC!
 
@Raynos its creating a namespace to avoid ambiguous calls
 
=_=
 
2:07 PM
~.~
 
lol
 
!kitten rchern
 
@CodingKitten: How are you doing today?
 
@ircmaxell Yes that would indeed be effective, so not to mention that root exploit?
 
2:08 PM
forgot about that root exploit. Thanks!
 
I can't wait to be this evening
Week end... finally...
 
I can't wait to see that secret weapon!
If you get that kudos...
 
Should I be afraid of said secret weapon?
 
@ircmaxell Only if your name's Slippy
 
Nope, my name is not Slippy...
 
2:10 PM
then you don't get it
damn play more N64 guys
 
is that conkers ?
 
I had a GameGear, and then an XBox 360. Was never a console gamer...
(And there was a rule in my house once I turned 10. I could only play games that I wrote myself.) Needless to say, I didn't play many games...
 
stupid question: what's the difference between var n=5; and n=5;?
 
@thejh: scope
 
2:12 PM
n=5 is global
 
Unless n was previously declared in the local scope...
 
@IvoWetzel ah, ok. so in the global scope, it makes no difference?
@ircmaxell I'm talking about the first usage of a non-declared variable
 
Well, var n = 5; is more explicit, and it does give you more information than n = 5;, specifically that you're declaring a new variable rather than just re-assigning an existing one...
 
starfox ?
 
@Chouchenos yep
 
2:14 PM
It makes no difference in terms of execution, but it does make a difference in readability (IMHO)
 
I don't remember that quote from star fox 64... And I played it... a lot. still have it
 
@ircmaxell ok
 
@Greg new function() {} is the same as new ObjectConstructor, function ObjectConstructor() {} It's an anonynomous constructor function, something i've never done :)
@Nyuszika7H btw your lack block of advice above is either wrong or based on personnel preference.
 
2:33 PM
I usually use this kind of thing for all javascript projects jsfiddle.net/g105b/CLjLb
 
interesting
 
2:47 PM
is bored
 
what's that?
1
Q: Why is jQuery tools CDN link pointing to an ad?

RyanWhy is the link http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js pointing to an ad?

 
@Greg jsfiddle.net/Raynos/3mwU4 (Updated, forgot to make it self executing)
 
0
A: Why I can't see a real point for using OOP?

ircmaxellHere's the crux of the issue. As has been said before, there are tradeoffs to each and every paradigm. OOP has a lot of benefits, but it also has some negatives as you point out. The key is weighing them. OOP is founded on the principal that developers are expensive and hardware is cheap. It...

Anyone disagree? (Seriously, I'm curious to see other opinions on the matter)?
 
3:04 PM
Right paradigm for the job
I mean, if you have some uh... landscape with 5000000 trees, you're not going to make a tree class...
Especially when those trees are completely / for the most part static
 
Well, you could... But you'd likely make it a flyweight if you did... ( The flyweight pattern if you don't know it)
 
Being able to do something, doesn't necessarily mean that you should do it.
 
why can't the compiler simply take care of the bloat?
 
@IvoWetzel: I'm not going to argue that one bit...
 
@thejh Marcohell? :D There might no even be a compiler involved after all
 
3:08 PM
@thejh: because while any OO structure can be boiled down to a procedural structure, part of the procedural structure will have to deal with managing the scope. And that can't be removed automatically. It's that scope resolution that takes all the time...
 
@thejh JS engines have to have very low compilation cost when JIT'ing as otherwise you get no gain from doing the compilation because it's already finished executing
 
yep, scope lookups are very costly
(If you ever do Python, try to avoid them as much as possible...)
 
JägerMonkey to some extent caches them
 
0
A: Stop jQuery autocomplete from focussing the input field after choosen from the dropdown

Nyuszika7HTry using jQuery UI's autocomplete plugin. Half of the problem is solved – when pressing Tab to close the autocomplete, the input field loses focus also. When pressing Enter, it still has focus, but this can be fixed easily. $('#myInput').keypress(function(e) { // when Enter is pressed if (e...

 
@ircmaxell unless the method gets copied instead of used as a method by the compiler, right?
 
3:09 PM
Hi!
 
(and they are no more expensive than variables in the current scope)
 
@thejh what do you mean "gets copied"?
 
@thejh Don't know if I understand you correctly, but in the end it's just a pointer to some code
(yes cache locality... but that's really low level then...)
 
@ircmaxell that the compiler would change object.getId() to value of objectAddress+idAddress
@ircmaxell substitution instead of calling
 
@thejh Depends on the language, and how smart the JIT is
If you do that for getters, your setters need to change the addresses at runtime
 
3:12 PM
@IvoWetzel well, or a real compiler
 
AFAIK all JS engines just compile functions on a per function-object level
 
@gsnedders unless you compile it once on the server, like google closure compiler does
 
@thejh: that would kill your memory usage... Rediculously so
Since each object instance would require a full copy of each one of its methods as well as their member varaibles and any inherited methods...
 
@thejh I mean compile to machine code, in the JIT'ing sense, which you inevitably can't do on server
 
@ircmaxell and a little scope lookup takes that long?
 
3:14 PM
Whereas now the methods are all virtual (stored in one place and pointed at by the object)...
 
Is there a jQuery alternative to setInterval? (like delay for setTimeout).
 
@gsnedders well, but getting rid of the objects can be done ahead of time, right?
 
@thejh: No, not one scope lookup. But every single method call, variable lookup or object access requires one...
(and not just a trivial lookup, but also visibility computation and inheritance resolving)
 
@ircmaxell why do you have to do visibility computation at runtime?
 
Fun fact: The JVM removes all optimizations the Java Compiler made and then throws the stuff into the JIT...
 
3:16 PM
@IvoWetzel what? argh!
 
@thejh Get rid of what objects? It can surely only do that if it's dead-code, which makes no difference seeming all JS engines use hot-spot detecting compilers (except V8 which doesn't, but I don't think they compile it all initally either)
 
@thejh Because all that can change at runtime?
 
@IvoWetzel visibility?
 
@thejh: it depends on how dynamic your language is. Java and Python both do it at runtime...
C++ does part of it at runtime (and part at compile time)
 
@thejh ES5 has methods for changing the enumerability of properties
 
3:17 PM
@gsnedders I was talking about getting rid of objects and just using simple methods
@IvoWetzel what for can you possibly use such stuff?
 
@thejh Ah: to clarify what I said above, I meant an object whose [[Prototype]] is the built-in Function.prototype object by "function-object".
@thejh So do you just mean replacing calls to foo.bar() with foobar()?
 
@thejh: I'm not saying it's not possible to flatten it all. Just remember there are tradeoffs. And I'm not sure if you could flatten it in a way that is more performant (in a non-trivial way) than leaving it as OO code... But then again, this is a case I'd love to be proved wrong...
 
@gsnedders yes
 
If you have anything doing eval/dynamically creating Functions, or multiple declarations of stuff, or stuff being passed as arguments, you pretty much practically can't do so.
Like, you have to have a subset of JS to actually make it even theoretically possible
 
@thejh Hm overhead? Imagine I have two objects which have a bar() method that inherits via the prototype of another object
so I have flattened: foobar() and blubbar()
now the original foo() changes...
 
3:20 PM
@ircmaxell well, you could, for example, substitute every second layer of calls in deep-layer code without having a very big memory impact, right?
 
Part of the benefits of OO is polymorphism. And unless i'm missing something, doens't flattening it remove that ability (since you no longer have objects to check for)...
 
They'll also then be JIT'ed separately, which will be detrimental to perf
I'm not sure what you try to gain by flattening it, you'll have more function objects, which means a greater number of functions to store in memory, and a greater number that will be compiled separately
 
@gsnedders but higher speed if you have sufficient RAM
 
nope
 
@thejh: For a trivial application: class foo { var name = 'foo'; function bar() { return this.name; } it would be simple to unroll it. But what happens if you have recursion? What happens if you need to check the call chain to determine visibility? If you just flatten it to pointers, what's to stop me from calling a private method?
 
3:23 PM
paging = BAD, and most of the stuff is in the CPU cache anyways
 
@thejh How is it higher-speed? It's slower, because you'll be calling more functions in the interpreter before they get JIT'ed
 
RAM access...
 
@gsnedders assuming that it's a compiled language
 
@thejh In all major browsers it is now
 
uh... 20k instructions?
disk = millions
 
3:25 PM
@IvoWetzel what are you talking about?
 
@thejh YOu were talking about "plenty of RAM" making it fast
Fact is, smaller code = faster, since it fits into the CPU caches
So let's say you blow up the code a lot for flattening
then you save 15 instructions for a lookup
 
Smaller code is also faster because it's fewer instructions :P
 
but you need to go to ram...
 
@IvoWetzel ah, ok
 
@gsnedders OMFG! SURPRISE!
;)
 
3:27 PM
Opposite of topmost, anyone?
 
@Nyuszika7H bottomless ! :D
 
last?
 
I'd also say last
 
@Chouchenos The barrel from which you pull those jokes is indeed bottomless :P
 
@IvoWetzel I know, it's amazing. :o
 
3:29 PM
By topmost, I mean the very top of something. But what should I say for the very bottom of something? bottommost? :D
 
@Nyuszika7H Well I don't agree with topmost as being "the very top of something" rather "*at* the very top"
e.g: topmost item of the list
 
oh yes I meant that
 
well then it's the last item of the list
can't think of anything else right now
 
12
Q: Can I use an "if" clause without "then"?

waiwai933I have the following sentence: If T had still been alive, there is the great possibily that either T or C ... My teacher says that the word "then" must appear after the comma, but I think that it's implied and unnecessary. Who is right?

> 16 I think your teacher was speaking of Visual Basic, not English :) – Bruno Rothgiesser Dec 13 at 16:17
 
Have you seen this? I never realised microsoft outworldy LIED in its advertising
 
3:37 PM
> Internet Explorer was the first browser to integrate features that protect you against phishing and malware, and the first to embed domain highlighting, Cross-Site scripting protection, InPrivate filtering—the list goes on and on. It involves a lot of technical jargon, but the point is, Internet Explorer 8 is the only browser to offer this level of security right out of the box.
LOL!
 
> Internet Explorer 8 has much more functionality than other browsers,
LIES
 
It doesn't have a built in IRC/mail client!
 
> Internet Explorer 8 passes more of the World Wide Web Consortium's test cases than any other browser.
YOUR mother passes more WC3 tests than IE8
 
> Internet Explorer 8 offers almost all of the features the most popular add-ons in Firefox have,
 
sure
Like...
and... not to mention... also don't forget....
 
3:39 PM
> In addition to passing more of the official CSS 2.1 test suites than any other browser,
 
@IvoWetzel That may actually be true… Most of the exists specs that have testsuites don't have many (like, have way too few), and CSS 2.1 has closer to what is needed, so it might be a case that it is true. (IE9 is top of CSS 2.1, IE8 isn't that far behind…)
 
CSS 2.1? LOL! It's the 21th century, Microsoft! Time for CSS 3!
 
Hey, CSS 2.1 isn't a REC yet! :P
/me grumbles something about telecons discussing getting CSS 2.1 to REC almost every week…
 
The Future: HTML 6 & CSS 4 (coming next Christmas)
 
together that's X
Web X
The new buzzword
But does it support WebX?
 
@CodingKitten Do you support WebX?
 
There are actually EDs of CSS 4 modules starting to appear now
 
@IvoWetzel Hey, event reserved or special? you've stolen my point exactly...
 
LOL...
 
@CodingKitten We're on the interwebz I can't steal your point
 
3:42 PM
@IvoWetzel Wrong $('hello').appendTo('.obj'); then again, VIM is the click event of help ಠ_ಠ
 
Also, HTML 7 and CSS 7 is coming at December 21st, 2012 0:00 AM UTC
@CodingKitten Meow!
 
!kitten rchern
 
triple oy
 
lol
HTML 7 now? is 6 going to be that short lived?
 
@ircmaxell yep :) every Christmas we will get a new version
 
3:48 PM
Like that won't confuse everyone (especially when some browsers only only released once every 3 years or so)
 
Ehm
Why does IE8 support more of CSS2.1 ?
What css isnt supported in ff but is supported in ie8 ?
!kitten ban @Nyuszika7H
 
@Raynos: inline JS iirc...?
 
@Raynos Because they bothered to just implement the whole spec, and wrote way more TCs than anyone else has bothered to…
@Raynos Paged media stuff, for example
 
@gsnedders: Out of CSS3, box-sizing, text-overflow
But it's supported by FF beta, just no stable version
 
@ircmaxell That doesn't include any of the paged media stuff
 
3:57 PM
No
 
Why I can't control who can access rooms I create?
 
In terms of JS, node.sourceIndex is IE and Opera only
 
!kitten help
 
!kitten wob
 
It's balphas fault!
 
4:00 PM
@ircmaxell Hmm, we should drop support for that…
 
drop support for?
 
@ircmaxell Node.sourceIndex
 
What's the point of it? Who cares what number the node is in the DOM tree?
 
@ircmaxell Dunno. But supporting stuff no other non-IE browser does tends to cause site-compat problems…
 
yeah
unless you re-implement it in native JS (which would be hard to do in this specific case)
 
4:03 PM
You can always....
 
I guess it's useful in IE's case with a non-tree DOM…
 
!kitten regex
 
4050
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

 
parse the html and figure out the index that way :P
 
@ircmaxell Get list of all nodes, and use Node.compareDocumentPosition
 
4:04 PM
@gsnedders: fair enough... But you'd still need to sort and walk the entire tree before flattening it to the index...
 
@ircmaxell Indeed. And I guess Node.compareDocumentPosition isn't overly optimized, because nobody uses it.
 
hi everyone, I need help with a selector, I need a if find ul, then do animation (its for a navigation)
 
@Omegakenshin Hi! Do you use any JavaScript library?
 
@Nyuszika7H jQuery
 
@Omegakenshin I didn't understand clearly what you want.
 
4:09 PM
@IvoWetzel you mean "parse the html with a regex and figure out the index that way :P"
 
@Nyuszika7H I want the right selector for an if statement, so, when hover over <li>, IF Find an UL, then, run the animation.
 
@Omegakenshin If an <ul> element is found?
 
@Nyuszika7H yeah can't you find a child of 'this'....
@Nyuszika7H $(this).find('ul:first')
 
0
Q: Hidden javascript code

albanxHello I have some javascript code, a script included inside my page. I want to hide this script(obfuscate), so to make difficult to users to see the code with source view? Is there any way to do this?

 
its like that but for an if statement... so,
if ( $(this).find('ul:first') ) {//Animation} else { nothing }
 
4:13 PM
@Omegakenshin if ( $(this).has('ul:first') ) {//Animation} else { nothing }
 
@Nyuszika7H thanks ^^
 
if (this.has('usable content')) { this.is('good'); } else { this.is('useless'); }
 
@ircmaxell how do u say if this hasn't
 
ummm, negation? if (!this.has('foo')) {}
 
ok great
thanks a lot
 
4:27 PM
Hello
 
Hallo
 
dude
Strg w l does not switch my workspaces...
 
dade
 
too many VIM shortcuts >_>
I'll never be able to use anything else again without getting into serious rage
 
hey everyone
 
4:30 PM
Anyone know any smooth scroll bar ready-made classes using JavaScript?
 
why could it be my if statement is not working?
 
With a smooth scrolling effect that uses a tween, like the sort of thing you can do with TweenMax in AS3
 
ok I guess I research more... ^^
 
4:47 PM
@IvoWetzel you used vim. You shouldnt have done that
 
@Raynos I should never have used anything else...
 
@IvoWetzel is this valid ?
0
A: Hidden javascript code

RaynosThe best you can do is to define your own obscure language, call it # Then write two compilers, # to JavaScript (this one needs to be in JavaScript) & JavaScript to # Then just have a single file on the client that gets some source written in # from the server and then compile / evaluate it...

 
5:24 PM
What the heck is <label for='foo'> ?
 
@Raynos html tag for labeling inputs
@Raynos afaik foo is an id or name
@Raynos try to click on it, I think that that puts the focus on the input element associated with it (not sure)
 
is it cross browser compliant?
 
@Raynos don't know
@Raynos de.selfhtml.org/html/formulare/strukturieren.htm#label says that it's HTMl4, IE4 already supports it, Firefox 1.0 and Safari 1.0, too
@Raynos (that page is written in german, but there are symbols)
 
@Raynos yes, except for an issue with Internet Explorer 8 and lower where implicit labels don't work
 
@AndyE implicit labels?
 
5:40 PM
implicit labels are wrapped around the control they are paired with, e.g. <label>Name: <input type="text"></label>
explicit labels are where you specify the ID of the control with the `for`
attribute: `<label for="name">Name: </label><input id="name" type="text">`
 
Hi!
@AndyE Are implicit labels (which I use often) valid HTML?
 
yup, they're valid. It's just another thing that IE trips over.
Which is a shame really, cos it can be a real PITA having to specify IDs for everything.
 
@AndyE agreed
@AndyE Can you tell me, if I create a room for myself and X, why can Y, Z etc. join and chat in that room? I can't control access of rooms I create!
 
@Nyuszika7H: anyone can join any room, it's the intention for everything to be public. You can control who can speak, however.
 
@Nyuszika7H I think that you need a certain rep amount for controlling anything about your rooms
@AndyE from the FAQ: "Creating a new room requires 100 reputation; creating a room where only named users can talk requires 1000 reputation."
 
5:45 PM
@AndyE I don't seem to be able to do that. I can't even kick users from that room. The only thing I can do is moving messages to another room.
 
@Nyuszika7H: only mods can kick
@thejh ahh yes, the 1000 rep threshold. I forgot about that.
 
@thejh That's very unfair!
I want to translate texts using Google Translate, with an AJAX call. First of all, I don't know much about AJAX. Second, is it possible to send data to, and get data from translate.google.com in other sites? (like mydomain.com)
 
@Nyuszika7H you can theoretically get 1000 rep in five days without bounties
 
@thejh really? how?
 
@Nyuszika7H eh... answer questions until you hit the daily rep limit?
@Nyuszika7H I've been registered on SO for 49 days and already got 5000 rep
@Nyuszika7H oh, and you can get a rep boost by registering on another stackexchange site (100 rep or so)
 
5:51 PM
@thejh nice
@thejh I know, but I need to reach 200 rep on SO first :)
 
@thejh I made 5k in the last month, although I wasn't that active in the year before
 
Hmm, I can recognize weekends in my rep graph :) stackoverflow.com/users/492364?tab=reputation
 
yc
6:14 PM
Hey, is there a more efficient way to do what I'm doing? I'm trying to get the root domain out of document.domain, so that for chat.stackoverflow.com, I'd return stackoverflow.com

domain_array = document.domain.split('.');
domain = domain_array[domain_array.length-2] + "." + domain_array[domain_array.length-1];
 
@Nyuszika7H Thanks for helping me the other day, i still got the question up so if you want to put the jQuery answer up there i could give you some credit
 
6:32 PM
@yc domain = document.domain.slice(document.domain.lastIndexOf(".", document.domain.lastIndexOf(".")-1)+1) maybe?
@yc yes, this seems to work
@yc however, it's longer
 
yc
@thejh interesting. lastIndexOf is fairly cross-browser compliant, yeah? I like that its a single statement.
 
@yc seems so
 
yc
@thejh what makes you say its longer? It's ~40 characters shorter.
 
interesting...
 
@yc JS1.0,Netscape2.0,IE3,Opera5.12,FF1,Safari1
@yc oh, really? didn't count them...
 
6:42 PM
is jealous of @Ivo's German snow. Nasty -36° F (-38° C) here. But we never get much snow at once, and it rained for three days in November and ruined the early snow.
 
dam
where are you @Nathan?
 
Alaska
Fairbanks
 
Ahhh
I was going to say, -36 is pretty serious business...
And since you said *F first, you pretty much had to be US, so that leaves Alaska (for the most part)
 
I can't imagine -128/-68 in Antarctica...
I think the Minnesota area gets -40 sometimes.
 
bloody hell... Shiver is an understatement
Yeah, but not quite this early in the season
 
6:52 PM
Where are you?
 
New Jersey
 
no wonder everyone disappears from here in the afternoon.
 
hehehe
 
Hi again!
 
Hi @Nyuszika7H ; where are you?
 
6:55 PM
@Nathan busy – playing a multiplayer quiz :)
 
huh? Multi-Player quiz?
 
your profile says Hungary... must be late there?
 
@Nathan 7:56 PM
@ircmaxell something like that
@ircmaxell it's a P2P, bittorrent site, and one may earn 1 to 5 GB upload for a correct answer
 
@Nyuszika7H I thought SO is a multiplayer quiz.
 
lol
it is
wow, not bad. +60 rep in 50 seconds...
!kitten wisdom ircmaxell
 
7:05 PM
!kitten wisdom Ivo Wetzel
stupid cat
!kitten wisdom Ivo Wetzel
ahhh
 
I like the answer it pulled up for me. Got into a hell of an argument with another guy in that thread (the argument was deleted, it was on the second answer)
 
9999 i * esc
 
Yeah, that's a good one
thedailywtf...
xkcdb.com/?354 <-- ROTFL!!!
Tawnos: xkcd, how drunk are you?
xkcd: Tawnos: on a scale of 1 to abraham lincoln I am yellow
 
7:22 PM
omg
 
Another good one:
<Ray> Apple selling 1 iPad every 3 seconds
<Velociraptors> someone buys an iPad every 3 seconds?
<Velociraptors> we have to find this person and tell them there are better ways to make it multitask
 
haha
 
7:36 PM
Ahh, true geekdom: xkcdb.com/?111
 
Hi all, if i want to give a addClass to a checked checkbox, how do i write this? The checkbox has an id with a counter. I thought something like this;

$('checkbox' + counter +).click(function() {
?
 
@ircmaxell Is it bad that I know the video in question? :(
 
@IvoWetzel: That doesn't bode well for you... :-D
 
@Opoe If the checkbox has an ID it should be $('#....
 
@IvoWetzel okay thanks and the counter?
('#id + counter +')
?
 
7:39 PM
('#id' + counter)
otherwise you just have a string containing "#id + counter +"
 
Okay thank you :)!!!
 
<sparr> A mathematician, a physicist, and a biologist see two people walk into an empty building. A while later they see three people walk back out. The biologist says "they must have multiplied". The physicist says "no, our initial count was likely off". The mathematician nods sagely and says "actually, if one more person walks into the building then it will be empty again".
 
:D
 
...
but still good
 
my coworker predicts we will all take this for granted within 12 months.
 
7:49 PM
Nah, the reviews are similar to goggles... Awesome, but not really practically useful...
 
face it: automatic text translation sucks
 
<Lazar> In America, you make Soviet Russia joke. In Soviet Russia, In Soviet Russia, In Soviet Russia [hdd failure]
 
snicker
 
doesn't get it
 
I do
 
7:57 PM
< Feriority> ['hip','hip']
< Feriority> ^- hip hip array
I'm not sure why I find that so funny...
 
@CodingKitten do you know any good jokes?
 
@Nathan write some! need so that I have a string 000:0S001:0-1S002:3-1S What ends up
 

« first day (62 days earlier)      last day (4872 days later) »