« first day (132 days earlier)      last day (4810 days later) » 

5:00 PM
@CodingKitten I'd argue about that
 
@CodingKitten 1+2
 
:kitten 1+2
 
@IvoWetzel If you do I'll stuff you into a airless trunk and then debate the merits of having room. Or rooms.
 
@YiJiang That's like telling a group of teenagers that alcohol is not fun, don't drink it...
 
@CodingKitten Getting cozy, no horrible typo?
@ircmaxell Right, well at least we broke kitteh again
 
5:02 PM
@ircmaxell Well I haven't touched the stuff yet. ;)
 
lol
 
2 more years until I can legally drink it anyway. :P
 
fair enough
-6.5 until I can legally drink...
 
xD
 
hm some JSON parsing error, added a log for that
 
5:05 PM
@IvoWetzel fix the bugs!
 
0
A: Internet Explorer Email Address Autolink -- Disable?

Nyuszika7HTry using single quotes instead of double.

 
@CodingKitten Want to pick some crazy words?
 
@IvoWetzel Uh, no be mean :P
 
@CodingKitten What is the square root of 100?
 
5:09 PM
crashed :(
 
@CodingKitten: what's the 2^128th digit of pi?
 
@ircmaxell so best thing would be a button:!disabled pseudo class you can use it was you
 
not my fault
 
lol
 
:kitten bans
 
5:09 PM
21 mins ago, by Coding Kitten
@IvoWetzel what did you mean? I guess I'll write a header resizeable rows, I think the table
 
@CodingKitten tables! I'm gonna cook your ass... such evil
coding kitten is doing reverse pekkas now :D
 
@CodingKitten: I want a Ninja badge. Can you post that to MSO as a suggestion?
 
@ircmaxell I have you been?! that, yeah, that's at 8pm take it works in Compatibility View though...
 
Lol
 
:-P
 
5:11 PM
@CodingKitten What are your thoughts on @ircmaxell 's hair?
 
@MylesGray I'm that answer.... pretty sure that's not well-formed in any way, Firefox applies it.
 
Anyone know of a good alternative to gskinner.com/RegExr made for JavaScript?
 
@CodingKitten Why thank you for that insightful information
 
@MylesGray whistles innocently is my code needs to learn some gardening?
 
@MylesGray Who here has seen my hair to be able to comment?
 
5:12 PM
@ircmaxell @CodingKitten has aparrently
 
I mean if you know where to look on the internet you could find a picture or 100 of me. But still..
 
is it applied by firefox?
 
user1385191
@Shaz I wasn't aware there were a lot of differences between as3 regex and js regex
 
@ircmaxell Saw a pic of you at some joomla show i think?
 
Yeah, that's me
like I said, if you know where to look
 
5:13 PM
@MattMcDonald Mostly positive and negative lookbehinds which I believe JS doesn't support
 
:kitten cheezburger
 
I can haz cheezburger? Happy now...
 
@CodingKitten thank you :)
 
@MylesGray I I'm at 10,999 rep! you only realized that now? just get angry when I work on cross site compatibility
 
lol
 
5:15 PM
@CodingKitten You only have 96 rep...
 
@Shaz is this what did not understand either
 
@CodingKitten are you sex-agnostic?
 
@MylesGray I get it, it's used primarily for text editing :P
 
hahaha
 
Wow, an images search for my sn yields some odd results. Some very relevant ones, and some odd ones (and some that overlap in both categories)
 
5:17 PM
odd and relevant? you must live an interesting life -_-
 
:kitten pi
 
Huh? What's a "pi" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
Ohh, a pic of me from when I was in Brazil came up... Nice...
 
let's see if this thing works
 
@IvoWetzel dunno, it was defined in CSS 2.1
 
5:18 PM
@ircmaxell you were a fireman? O_o
 
lol
 
kitten now picks a random 5+ letter word and responds to that
changes at least every 3 minutes or when it was trigger to prevent spamming
48 messages moved to Sandbox
will sure be fun with strangers :D
 
:kitten help
 
lol
 
I need help understanding Javascipt modular layout. Can anyone point me in the right direction?
 
5:29 PM
Ooh, some real content.
 
0
Q: ajax jquery doesnt work on ie

RicardoHey guys. I'm usign a js/ajax script that doesnt work with internet explorer. Firefox its ok. Btw the head tag, im using this: $(document).ready(function () { //Check if url hash value exists (for bookmark) $.history.init(pageload); //highlight the selected link $('a[href=' + document.loca...

 
I need a Javascript frame to build on
 
@CodingKitten modular Javascript layouts?
 
@MylesGray ah it works cross browser
 
@CodingKitten does it really?
 
5:30 PM
@MylesGray > innocently the bugs! <span class='Apple-style-span'><b>Lorem</b></span> <span class='Apple-style-span'><b>Lorem</b></span> <span class='Apple-style-span'><i>ipsum</i></span> dolor sit <span class='Apple-style-span'><u>amet</u></span>
 
I suppose that's a no
 
@CodingKitten Ahh of course!
 
@MylesGray Actually, that would get closed, as I was missing something
 
@pagewil a "frame"?
 
Kev
hi folks....I'm being a bit thick I think. In chrome's debugger, when you hit a breakpoint how do you continue the script (i.e. not step into/out etc)?
 
5:31 PM
@Raynos gave me this to start with:
window.MainModule = (function($, win, doc, undefined) {
var foo, bar, modules; // List of local variables.

var modules["foobar"] = (function() {
var someFunction = function() { ... };

...

return {
init: someFunction,
...
};
}());

// hoist a variable into global scope
window.Global = someLocal;

return {
init: function() {
for (var key in modules) {
modules[key].init();
}
}
};
}(jQuery, this, document));

// Let's kick off the MainModule on $.ready
// I recommend you do this in your `html` with page specific data.
@Ivo not a technical term orry
 
@Kev The > button above the stack trace
 
sorry
 
@pagewil Use CTRL+K to format code blocks! And post your code in a separate messae!
 
ok sorry
window.MainModule = (function($, win, doc, undefined) {
    var foo, bar, modules; // List of local variables.

    var modules["foobar"] = (function() {
        var someFunction = function() { ... };

        ...

        return {
            init: someFunction,
            ...
        };
    }());

    // hoist a variable into global scope
    window.Global = someLocal;

    return {
        init: function() {
            for (var key in modules) {
                modules[key].init();
            }
 
@pagewil You can also edit or delete your messages for 2 minutes. Move your mouse over it and click the arrow.
 
5:32 PM
You only have 120 seconds to do so though
 
Ah right, first time in the old chat room for me
So can anyone help?
 
@pagewil what's your problem?
 
Kev
@IvoWetzel what a muppet, when it's on a break point it looks like |> and the rollover label says "Pause script execution"....which is why I never tried that :/
 
I just need to understand the code that i posted so that i can structure my own JS in a similar way
@Nyuszika7H I just need to understand the code that i posted so that i can structure my own JS in a similar way
 
@pagewil You should post it as a question.
 
Kev
5:34 PM
@IvoWetzel cheers mate, no more endlessly "stepping out" :)
 
Yea hI have and that ws the answer
 
@Kev You're welcome :)
 
@Nyuszika7H Yea hI have and that ws the answer
 
@pagewil post its link there, again in a separate message
 
1
Q: Javascript : Best way to declare functions to be used globally?

pagewilMy javascript file is getting pretty big (3000+ lines) and I'm getting confused as to how to layout my file and delare functions so that they can called anywhere in the file. To summarise my JS file looks a little like this at the moment: //ALL GLOBAL VARIABLES FIRST DECLARED HERE var var1 , va...

@Nyuszika7H There you go thanks a lot
 
user1385191
5:36 PM
who wants a laugh?
 
@pagewil I think what he's trying to say is ... for example ... window.myFunc = function() { alert("whatever I do, I do because I love you!"); };
 
@JeffParker ?
 
@pagewil so the module has an array, modules ... each module is an object ... which contains whatever methods it contains, and an "init" method ...
 
@pagewil I think you should post it on [Code Review](codereview.stackexchange.com) instead.
 
@MattMcDonald Ill take that laugh seeing no one else wants it
 
5:41 PM
@pagewil the bit in the middle shows how those object methods can be linked to global methods, and the bit at the very end initialises each module.
 
user1385191
1
Q: Show div base on onchange from dropdown option, help..

omc11Hi, I try to show some information inside of <div> as following: <div id="show_details" style="'display:block;' : 'display:none;'"> SHOW me </div> by choose from drop down option e.g. <?php if ($books == 'art') { ?> <option value="art" s...

 
user1385191
check out the PHP code
 
user1385191
unless I've learned PHP wrong, you can't do that
 
Thats a joke right?
JQuery in PHP wrappers :P
 
@JeffParker Can you tell me why this appears not to be firing?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
<script>
window.MainModule = (function($, win, doc, undefined) {//WHAT IS BEING PASSED IN HERE?
    var foo, bar, modules; //VARIABLES ACCESSIBLE ANYWHERE

    modules["foobar"] = (function(){//WHAT IS A MODULE? WHEN WOULD I USE A SEPERATE MODULE?
        var someFunction = function(){ alert('modular'); };//DECLARING MY FUNCTIONS?
 
5:43 PM
Actually @MattMcDonald That is valid code
that is how Wordpress works
 
user1385191
yuck
 
means you don't have to escape your strings
 
user1385191
it looks...so terrible
 
It is actually quite an efficient method for large code blocks
for example widgets in wordpress
maybe 20 lines of code, fancy escaping all that?
 
user1385191
it's....so obtrusive
 
5:44 PM
It works...
 
@JeffParker So confused! Where can I learn more about this stuff?
 
@pagewil the modules var isn't defined properly ... ... ... and I'd recommend trial and error
@pagewil I'll post an answer in your question ... save these poor people some spam :P
 
@JeffParker Thank you so much!
 

Sandbox

Where you can play with regular chat features (except flagging...
JavaScript quiz!!
 
@pagewil see comment. Also don't forget that the code sample you posted is buggy
 
5:52 PM
Games are everything. Really.
 
Sorry I assumed too much prior knowledge..
 
@Raynos Thanks! I'm reading the second link you just posted to get up to speed on modular layout.
 
Yeah that one is pretty good.
 
@Raynos My main misunderstanding is the init part of each module. What is the need for different modules?
 
Here's an outdated commented skeleton more tightly wrapped to jQuery (jsbin.com/ocaya3/edit)
@pagewil seperation of information
 
5:59 PM
@pagewil it seems that your original question branched off into something a bit more ... ... evil :P
@pagewil you might just want to look at good old js class/object definitions ... unless you specifically need the jQuery functionality tie-in. A lot of this stuff seems to be overkill for what it sounds like you originally wanted.
 
@JeffParker I know what a way t ruin the productivity of my day! I really needed to educate myself better with regard to JS layout anyway.
 
Examples Here I have some modules that seperate content into seperate parts
 
This is going to sound silly, but I'm just learning Javascript. Going over my class examples I see "||" and can't remember what it means. Can someone refresh my memory?
 
@GnomeSlice logical or
 
or that's it.
Thanks. :P
 
6:02 PM
var bool = true || false; // true
var bool = true || false; // true
var bool = true || true; // true
var bool = false || false; // true
@pagewil @JeffParker I may over engineer too much
 
Note that || is not a logical operator. It's like a logical operator, but it's not exactly one since a || b can return a non-boolean...
 
@Raynos At the moment I have a project with locadsof functions that I want to get into this nice modular layout. How should I got about it with the example you gave me?
 
(I'm not saying it's not immensely useful because of that distinction, just that it's not a traditional logic operator)
 
@Raynos I think you're doing okay ... it's just a massive step from a functional list to that kind of structure :)
 
@JeffParker This whole module thing is twisting my brain and on a friday eve that is not good!
@Raynos how many modules should I have?
 
6:08 PM
@pagewil here's a much simpler example ... you can use it to separate functionality into objects ... which may help a bit ... and no jQuery, init methods or similar to ruin your day :) (jsbin.com/ogawe3/edit)
 
@YiJiang Do you have any idea why the SO API is so slow to update?
 
@JeffParker can a whole project be put into this structure?
 
@pagewil it's pretty low level javascript ... so fast, and scalable ... I don't see why not.
 
@JeffParker Ok I need to put these method into a context I understand. I want to bind click events to a bunch of buttons. Would I have a module for each button or are modules intended to be bigger blocks of code than that? What if I want to call a module's function from within another mondule?
 
@pagewil modules are intended to be more ... generic than that ...
@pagewil I updated the example to include a cross "module" call (jsbin.com/ogawe3/2/edit)
@pagewil the way you work with the code shouldn't change ... this just allows you to group things into objects, which should make sorting through them a bit easier ...
@pagewil without understanding exactly what the ... purpose and separation of your existing code is though, it's hard to advise exactly -_-
 
6:15 PM
right ok
@JeffParker Thank you I am going to have to do some massive changes to my way of coding I think :s
 
@pagewil good luck ... once you're used to dealing with objects like that, the jQuery examples people have been posting should make a bit more sense :)
 
    modules["alerter"] = (function(){
        var someFunction = function(){ alert('I alert first'); };

        return {
            init: someFunction
        };
    }());
@JeffParker So the init part of this module fires the things I want to happen on page load? (from that particular module)
 
@pagewil essentially, that's all the module does. Define one action, and execute it on initialisation. It's possibly not the best example in the world ... I think the person who put it together was trying to demonstrate layout rather than the extent of the functonality.
 
@JeffParker But some parts of this module may just be definitions of functions that I may want to call later? Can the init part of this object work more like a function like this...
        return {
            init: function(){
              someFunction1();
              someFunction2();
           }
        };
 
@pagewil yes ... it can ... but calling that particular bit of code later would prove a challenge.
@pagewil I'd recommend you have a look at the jsbin link (second one) I posted earlier ... it's nowhere near as advanced as the first example, it's not meant to be ... but you should find it much easier to use.
 
6:22 PM
@JeffParker I'm beginning to see how it works now. I am drawn to the initial example becuase it seems more like a full layout solution...?
 
@IvoWetzel How would I work out the Unix time of 12am last night based on the current time?
 
@pagewil Both can be full layout solutions ... it depends on how you fill it out. The original example definitely provides the possibility for better separation ... but that possibility also makes it much more important that the interface is defined well ...
 
for example, If it is 1234567890 now how do I work out the last occurrence of 12am?
 
So in summary:
1.Each module is a bunch of functions that in some way are similar or relate to each other.

2. At the end of the module you can decide which of these functions needs to get called on page load.

3. Each module is named and so is each of the functions within it which makes it possible to call one module's functions from within another...
 
@pagewil Pretty much ... but you're not just limited to functions within a module, you can store functions, values, objects ... whatever a var can hold, a module can contain.
 
6:27 PM
@JeffParker Thanks you have made this seem a lot clearer! I'm going to have to put this down for the night and go for a good few pints in London to chill out!
 
@pagewil your going to need to move from abstract to some kind of example of your code. So we can tailor examples to your code
All these examples conflict with eachother :p You cant copy them verbatim. Your supposed to get a feeling for the style
 
@Raynos Is it possible for me to send you my current js file so you can see the nightmare i'm having?
 
@pagewil I should head out too ... but good luck ... beer will make this all clearer ... or not matter at all, either way works :P
 
Yes although Ive had experience with free technical consultancy ;) Dont expect me to clean it up for you
 
@Raynos How do I send it?
 
6:29 PM
pastebin. email. link. etc.
 
@Raynos You don't have to do anything but look at it, that would be amazing
 
Seriously
Who wasted there time on the ASCII art?
 
@Raynos lol I got a site that makes it for me. Helps me find things quicker!
 
mmm bit-saving glory ASCII art
:P
 
Tumbleweed Asked a question with no votes, no answers, no comments, and low views for a week
0
Q: XML with namespace. Issue with Internet Explorer

sissonbI am having an issue rendering data from XML with namespacing in Internet Explorer 6, 7 and 8(haven't checked 9). It works in Chrome though. The XML is formatted like this, <?xml version="1.0" encoding="UTF-8" ?> <pre:customerAddress xmlns:pre="http://www.example.org/"> <pre:c...

 
6:33 PM
Heh. is this automatically build?
Or did someone just dump all the code for their website into one file? It's all hand written right? Not just 3rd party code copy and pasted all over the place
 
@Raynos Yep all hand written. What are your thoughts? I told you it was a nightmare! Its just grown and grown without any thought for structure
 
Heh. Gimme a sec
Ok, never mind. Refactoring that is a nightmare :p Good luck
I would recommend you try and take every little bit into its own file
and get them working on their own
Then using something like requireJS to deal with depencies
For example the image viewer only requires on the $dialoguebox and the preloader so you could have
// imageviewer.js
require(["preloader.js"], function() {
     // imageviewer code
});
 
Ok so requireJS is the baby I need?
 
keeps writing books. It's good for the site (I think), but I should write less in answers and write an actual book instead...
 
6:48 PM
@ircmaxell publish it. Do it!
 
@ircmaxell As I said, do a PHP garden ;)
 
lol
Most of it isn't PHP specific
0
A: Measuring Web Application Performance (Stress-Testing) and Bandwidth Requirements

ircmaxellWell, the question is how do you want to profile? Do you want to simulate real-world activity? Or do you just want to bombard the heck out of the site? Load Testing Individual Pages I don't think you can go wrong with using Apache Bench (ab). It's dirt simple to use, and can really stress yo...

^^ My latest book
 
@ircmaxell write me some on game dev techniques.
Thinking of writing a completely reactive event driven multiplayer game framework :D
 
isn't experienced in game dev
 
Also I still need to genericly abstract away latency. It be great if you could just
 
6:50 PM
My good areas are performance and security... That's where most of my books are
 
... // some code

latencyAbstracter = new LatencyAbstracter;
latencyAbstracter.makeLatencyDissapear();
 
@Raynos So you recon breaking it up into different files then? Is it not possible to get it into a modular state with a bit of time and effort?
 
@Raynos: I like this better:
in PHP, Feb 14 at 11:59, by Gordon
$framework = new WonderFramework('unicorn');
$doms = $framework->doWhatIWant(
    $framework->readMyMind()
);
print $doms->getElementsByTagName(42);
 
yes and no
@ircmaxell I wasn't trolling. I genuinely want to write the server-client IO for you and have it hide latency for you
The client side emulation and the state drift handling will be done quietly by the underlying framework
 
Ahhhhh
now I get you. I thought you meant a joking method to remove all latency all together
 
6:56 PM
@pagewil yes seperate files for developing. You want to use some kind of packager to put them into one big file so the user only downloads one file
@ircmaxell its a heavy client-heavy server set up and the client does clientside prediction. Then I use some magic awesome code to make the client & server stay in sync and make the latency un noticable
garrys mod has some magic code for that I think. Or maybe thats the half life 2 engine. Half life 2 is OS right?
 
@Raynos Is each JS file supposed to be only small chunk of code? How many lines would you chuck into each file?
 
Depends
I have some files with 20 lines
some files with 1400
Not by lines but by functionality
 
@Raynos Ok right. So is this an alternative to the modular layout you were suggesting earlier or does it work alongside it?
 
This is "one" control so it goes into one file. The line count is based on how complex the control is
 
understands now
 
6:59 PM
Also for more overkill look at backbonejs
yes. But using MVC requires a lot of rewriting
I would say if the code works the code works. Leave it alone. Get some other sucker to refactor/maintain it.
 

« first day (132 days earlier)      last day (4810 days later) »