« first day (61 days earlier)      last day (4886 days later) » 

4:00 PM
!kitten ? Nick Craver
 
Nick? Yeah I remember that guy, he breaks everything, but he sure is the SO King of jQuery!
 
lol
 
!kitten ? Ivo Wetzel
 
Hold on a second, googling that for you... "Ivo Wetzel did you mean horrible typo?" There you go!
 
!kitten ? ircmaxell
 
4:00 PM
Huh? What's a "ircmaxell" 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...
 
!kitten wisdom Ivo Wetzel
raaaaaaaaaaage
 
@CodingKitten: I don't think I like you anymore
 
@ircmaxell I wish there was on a top one
 
@ircmaxell Oh no, the kitten doesn't know you
 
hehehe
 
4:02 PM
12 :-p
 
lol
 
@AndyE :(
 
!kitten ? Andy E
 
Hold on a second, googling that for you... "Andy E did you mean horrible typo?" There you go!
 
5000 points! trying out bot features
!kitten help
 
4:04 PM
!kitten bans
LOL! How'd Skeet get banned?
 
just for testing
And to fight against the meme!!!!
 
That perpetuates the meme
 
rage against the meme
 
!kitten ? java
 
Everytime you say Java, I kill a carpet. Twice.
 
4:06 PM
heh
 
!kitten ? php
 
Huh? What's a "php" 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...
 
You need more "unknown" responses.... That one is getting pretty old...
 
write some!
I'm busy creating fake accounts to up vote.... !
nothing...
 
LOL
spread some of that upvote love this way then...
 
4:08 PM
!kitten think php server-side language for including other stuff in pages at compile time, often misused for runtime-stuff that then gets *very* slow
!kitten ? php
 
Huh? What's a "php" 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...
 
@Ivo why doesn't that work? :(
!kitten ? php
 
@thejh: You need 64 more rep points to do that
 
Huh? What's a "php" 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...
 
@thejh Guess it still has your old rep cached
 
4:09 PM
chat seems to do that
takes a few days to update the rep count
 
!kitten think php server-side language for including other stuff in pages at compile time, often misused for runtime-stuff that then gets *very* slow
test
 
@ircmaxell Nope, only a refresh
kitten caches the stuff for 10 minutes
 
ahhh
ok
 
!kitten think php server-side language for including other stuff in pages at compile time, often misused for runtime-stuff that then gets very slow
 
php? Sounds interesting, gonna write that down, yes on real paper, and no, papers's not edible.
 
4:11 PM
!kitten forget php
 
still displays 4985, that's mean
 
Hold on a second, googling that for you... "forget php did you mean horrible typo?" There you go!
 
!kitten ? php
 
@ircmaxell use !kitten php // nothing here
 
server-side language for including other stuff in pages at compile time, often misused for runtime-stuff that then gets <i>very</i> slow
 
4:11 PM
what's with the horrible typo?
 
!kitten think php PHP? Do me a favour and come back when you've learned a proper language
 
5 to go
 
php? Sounds interesting, gonna write that down, yes on real paper, and no, papers's not edible.
 
!kitten ? php
 
PHP? Do me a favour and come back when you've learned a proper language
 
4:12 PM
@Ivo you should have written \* \*
 
!kitten forget php
 
Huh? What's a "forget php" 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...
 
$obj.blur(#(e) { console.log(e.clientX); }); // what does e.clientX associate with for the blur events
 
!kitten help
 
!kitten unthink php
 
4:15 PM
Huh? What's a "unthink php" 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...
 
@ircmaxell what? do you like PHP?
 
!kitten think php PHP's an interpreted language for web development. While it's quite powerful and easy to use, it's quite often abused...
 
php? Sounds interesting, gonna write that down, yes on real paper, and no, papers's not edible.
 
!kitten think vim Even if Emacs had been written in Vim... it would still suck
 
vim? Sounds interesting, gonna write that down, yes on real paper, and no, papers's not edible.
 
4:17 PM
Damn, I'm such a fanboy, after barely 24 hours of usage
 
@thejh: Actually, yes I do. There's lots about it that I can't stand, but I do like it in general. Don't blame a language for its abuses...
@IvoWetzel: LOL! But see what I mean! Once you figure it out, it's awesome...
 
@ircmaxell powerful and easy? are you kidding?
@ircmaxell try this line of code:
 
waits to see the line of code
 
@ircmaxell Yep, so many cool commands...
 
someArray[0]->doSomething()
 
4:19 PM
$someArray[0]->doSomething();, what's your point?
 
$ alone is witchcraft
 
@ircmaxell afaik, it doesn't work
 
it does. All the way back to PHP 5.0
$foo->getBar()->doSomething()->blahProperty->Baz(); works as well
 
@ircmaxell there was something that works on variables, but not on the result of accessing an array
and it was really trivial
 
4:21 PM
@thejh it's the other way around. You can't dereference arrays. So $foo->getArray()[0] won't work...
 
And you can't dereference callbacks either $foo->getCallback()() doesn't work...
 
ah, remembered it wrong
however, it still means that PHP is just wrong
 
Right. You can't dereference arrays... It's not a big deal (I've so rarely found myself needing to do that, that it doesn't really matter to me)
No it does not mean it's broken...
 
It's inconsistent
 
4:22 PM
And it doesn't mean it's just wrong.
 
It is absolutely inconsistent. But there are libraries over top that fix most of that...
 
see in jQuery it's the other way around! People wrote JavaScript just because they were used to PHP's inconsistency
 
@ircmaxell aaaaaargh! "the language is crap. let's build a library that circumvents the language."
 
Don't forget, PHP was not a designed language. So it and all of its features were built out of need, rather than out of symmetry or design...
 
4:24 PM
indeed
 
Why do I like it? It's fast to code in. It's quite readable (if not a bit too verbose at times). And it's fast to execute. Not to mention that it's really scalable...
 
If only they'd picked a single naming convention for the sodding methods from the start.
 
@thejh: But isn't that the way of the world? Why else does C++ exist? Why don't we all just use standard Python without importing libraries? Why don't we use native JS? We take the languages for its strengths, and use libraries to fill in their weaknesses... It happens all over...
 
and didn't change major pieces of functionality in minor point releases
 
@AndyE: I agree 100% on that one. But more so than naming convention, argument order convention would be nice as well...
 
4:28 PM
the question is now at -8
@ircmaxell Don't remind me of that.... $haystack, $needle or $needle, $haystack
@ircmaxell Any shortcut to duplicate a line?
 
duplicate a line?
 
@ircmaxell in VIM
 
@IvoWetzel: Yeah... Sometimes I wish the Spl types could be used more natively... So that you could treat scalar types as native objects and not need the functions...
@IvoWetzel: I'm not sure...
 
hm, guess I create a macro then
 
@IvoWetzel ddpp ?
 
4:32 PM
@thejh Yea, that works, didn't think of that...
although i need a k to get up one line to insert it at the correct position
19
Q: Duplicate a whole line in Vim

sumekHow do I duplicate a whole line in Vim in a similiar way to CTRL+D in IntelliJ IDEA/Resharper or Ctrl Alt Arrow in Eclipse?

 
copy-paste is evil... ;-)
 
Well I mainly needed that because when I have to include more JS files I only need to change a src on a script tag :P
but I love o and O :)
 
is event reserved or special?
 
@Raynos in JS? no
 
then its undefined :(
 
4:40 PM
@Raynos except in IE when you're handling an event...
 
@thejh? :S
 
window.event
 
@Raynos what?
 
What's the difference between .bind() and .live() in jQuery?
 
@Nyuszika7H: Have you tried reading the docs?
 
4:44 PM
@AndyE thanks
 
When in doubt, man
 
man man
 
man(1)                                                                  man(1)

NAME
       man - format and display the on-line manual pages

SYNOPSIS
       man  [-acdfFhkKtwW]  [--path]  [-m system] [-p string] [-C config_file]
       [-M pathlist] [-P pager] [-B browser] [-H htmlpager] [-S  section_list]
       [section] name ...

DESCRIPTION
       man formats and displays the on-line manual pages.  If you specify sec-
       tion, man only looks in that section of the manual.  name  is  normally
 
How do I place multiple input fields with labels in one line? See what I mean:
Label:    |Input field|
Label2: |Input field|
 
Is there any way to search through code in the github web interface?
 
4:56 PM
@Nyuszika7H: <label><input/></label><label><input/></label>...?
 
@ircmaxell This is what I'm doing !!
 
Wait, you want it to line up?
 
you got css
 
I know about margin-left, but why give IDs to input fields just to set margin-left?
 
You have 2 options. You can either set the label to a fixed width (200px for example). The other option is to float the label left, and set the input's left margin to a fixed part...
@Nyuszika7H: You don't need to give them IDs to set css properties. Either use classes, or if they are decendants of a known class do form.foo label and form.foo input
 
5:10 PM
Hello
 
0
A: Drawbacks of static methods in PHP

ircmaxellOk, let me answer these one by one... 1. Is it worth doing something like this Yes and no. Splitting out the helper functions into their own classes is a good idea. It keeps the "scope" of each of the classes rigidly defined, and you don't get creap. However, don't make a method static just ...

 
Whats the proper cross browser alternative for event.offsetX
 
@Raynos event.offsetY
 
@Nyuszika7H I hates you
 
Sometimes I wish I could drag tabs between FF and Chrome like you can between Chrome windows....
0
A: Call to a member function prepare() on a non-object PHP Help

ircmaxellIt's a scoping error. You're making $DBH a global variable. So when you enter the function, the global variable is not available. You have 5 real options. 1. Use the global keyword function doSomething() { global $DBH; //... This is not a good idea, since it makes maintenance and t...

 
5:33 PM
still 5 ;_;
 
5?
 
up votes
 
For?
 
reversal badge thingy
 
link
 
5:36 PM
15
A: preventing site visitor from saving site images and disable right click

Ivo WetzelYou can't prevent people form downloading your images. Many browser disallow you to disable the context menu The user can disable JavaScript If the user can see the image, it's already on THEIR computer I don't even need a browser I can just do an HTTP request on your site to fetch all the imag...

 
Sorry, you already got a +1 from me...
 
no problem :)
 
From me, too.
How can I get which radio button is selected in a set?
 
Worst case, they can screenshot the borwser...
 
@ircmaxell but with SLaks "solution" (that uses much of the CPU time and makes the site look bad), they at least have to let a program run over the screenshots
 
5:42 PM
Anyone?
 
@thejh: fair enough...
Woah... That's almost to the point (ok, not almost) of stupidity...
Break apart the text into many different images, each one somewhat smaller than a letter. This could be done in server-side code. Then, use a JavaScript timer to alternate the images so that the screenreader will never see all of the text at once. To prevent the copier from modifying the JavaScript to show all of the images, alternate them with other images. For example, write a server-side script that takes X and Y coordinates, and a timer index.
 
@ircmaxell But users can still disable JS.
 
Right, but then they wouldn't see anything
 
@Nyuszika7H which would cause them to see nothing
 
so you could just make JS a requirement for the site...
(it's evil for sure, but would work if it switched fast enough)...
 
5:53 PM
@ircmaxell somehow I think that that should make every single user of yours run away screaming
 
of course it could be gotten around too if you engineered an inteligent program to watch what's happeneing
@thejh: Absolutely. I'm not saying it's a good idea (after all, what content requires THAT level of protection), just it might work...
 
@ircmaxell you just need a few screenshots, then look at which color occured more often for which pixel
 
Not even.
it's swtiching "pixels" on and off, correct?
the only way to get the brain to interpolate is if the "off" pixes are common (white typically, but any color will do)
so the "pixels" are either white, or have data. All you need to do is analyze all the images displayed (downloaded to the browser) and where they are displayed, and you should be able to render the image with 100% accuracy after just 1/10th of a second of watching what's going on...
 
for (var i = 1; i < Infinity; i++) {
    if (i === 100) {
        alert('100 – Are you still there? Okay, I'll give up.');
        break;
    } else {
        alert(i);
    }
}
 
for (var i = 1; true; i++) {
 
6:01 PM
Anyway, it seems to be broken :/
 
@Nyuszika7H chrome will ask the user whether he wants to click through the dialogues
 
@thejh I know :)
 
what's broken about it?
 
It does not execute, but I've found the problem. I've used single quotes, and used I'll inside it. I should escape it like this: I\'ll.
 
ahhh
syntax highlighting FTW
 
6:03 PM
indeed
Even simple editors have syntax highlighting these days e.g. VIM
 
yeah
but then again, VIM is not a "simple editor"... If you want that, go use nano or notepad
 
gah... I can't decide if I care about reputation points or not. If I cared I guess I should just answer "jQuery!" on every single question.
2
Q: Creating my own custom JQuery templating engine?

David SI had a quick search in stackoverflow.. but couldn't find anything quite what I was after. I am trying to understand/get some pointers on how to build my own VERY simple templating engine for jQuery. I basically have a standard AJAX call to get some XML (yes.. old fashioned I know.. and I will ...

 
Hiya I'm using jQuery Address plug to do deep linking (save website state) since it's ajax complete. However I'm having one issue. I have on .change that gets triggered ONLY when I click on a url that is not the same as I'm on. I want it to get triggered every time I click on a link, no matter if it is the same link. Any ideas?
 
@raRaRa to what object is your .change attached?
 
@Nathan: Don't care. Answer the right answer not the whoring answer...
 
6:06 PM
@Nathan It's attached to $.address.init
 
@ircmaxell you're right of course.
 
for (var i = 1; true; i++) {
    if (i === 20) {
      var captcha  = Math.round(Math.random() * (99999 - 10000)).toString();

      function checkCode() {
        var ucaptcha = prompt('Human Verification' + '\n' +
                              'Please type in the following CAPTCHA: ' + captcha);
        if (ucaptcha !== captcha) {
          alert('Try again!');
          checkCode();
        } else {
          alert('OK, you\'ve been successfully checked as a human.');
        }
      }
      checkCode();
 
WTF?!?!?! Make them click through 100 alert boxes? And then recusion to try again? wow...
 
@raRaRa I'm confused. What is $.address.init ?
 
(alright, it's not that bad, just a bit... surprising...)
 
6:12 PM
@ircmaxell Just hold Enter. Anyway, I've changed it to 20. ;)
 
@Nathan That's the address plugin I'm talking about - asual.com/jquery/address
 
@Nyuszika7H: No thanks. If I see that on a site, I'll immediately ctrl-F4 and go do something productive...
 
@ircmaxell You meant Ctrl+W or Alt+F4, right?
 
No, Ctrl+F4 to close the tab...
 
@ircmaxell Nice, I didn't know about that.
 
6:18 PM
yeah, there are some handy shortcuts like that...
 
@ircmaxell but I think Ctrl+W is easier to press
 
@raRaRa ah, I see. But I'm not familiar with the Address plugin. Maybe you should ask a SO question.
 
Yes, but it can be ambiguous since Ctrl-W means something different in other programs. I've yet to find a program where Ctrl-F4 does something different (in some it does nothing)...
 
@raRaRa maybe though, it doesn't make sense to run a change handler if something isn't changing. Maybe you need to put your code in a click() handler?
 
is shooting for another rep-cap day... But I'm only at +80 so far, so I may not hit it...
(Well, +80 on upvotes, +110 total)
 
6:23 PM
4 left
that's 160 for me today
 
goes to +1 the question to try to block the badge ;-)
 
I still have a down vote on that thing left :p
 
lol
 
@Nathan Yeah that's what I did, but then when I actually go to a new page, it gets 2 requests, since the update was also called.
 
6:43 PM
Could some of you guys take a look at it?
 
uhhhh
is scared
 
why?
 
Too many pastel colors... It frightens me...
 
:D
Well mock up... I needed to see where what ends up
 
I know ;-)
 
6:45 PM
I'm quite happy with the thing for now
most important part
it's resolution independent
 
looks fine on 1620x1280 for me
 
that guy had a syncmaster 245 and was really "wut?" when I told him that most people have waaaay smaller displays
 
Only problem is the left menu is not scrollable...
 
ah, yeah, works only via the click pads atm, mousewheel will be added
 
ok...
 
6:49 PM
stupid people who should pay tons of money should have big flashy arrows ;)
 
lol
 
7:02 PM
!kitten wob
 
It's Yi Jiangs fault!
 
looks good on 1920x1080...other than the colors ;)
 
7:22 PM
!kitten wisdom Coding Kitten
 
Guess you're out of luck with Coding Kitten. Yawn I nearly fell asleep when checking their answers.
 
!kitten wisdom Ivo Wetzel
ahhh
vote it want reversal :(
 
!kitten wisdom Ivo Wetzel
!kitten Wisdom Gordon
 
kitten fails again
need to rewrite it with VIM
 
Ahh, So the user needs to be logged in here, right?
 
7:26 PM
nope
 
(or at least seen before in this chat)
 
!kitten wisdom Jon Skeet
 
hrm...
 
@ircmaxell Guess it didn't find him with the user search, dunno
 
!kitten wisdom Rook
!kitten wisdom Pekka
 
7:29 PM
3
Q: Emacs html with java editor

MakeDummyI have started the painful first steps of using emacs to edit an HTML file with both HTML tags and javascript content. I have installed nxhtml and tried using it - i.e set up to use nxhtml-mumamo-mode for .html files. But I am not loving it. When I am editing the Javascript portion of the co...

first word = fail
 
Yet another fun PHP quirk...
127
Q: Why doesn't this code simply print letters A to Z?

Milan Babuškov<?php for ($i = 'a'; $i <= 'z'; $i++) echo "$i\n"; This snippet gives the following output (newlines are replaced by spaces): a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh b...

 
Damn, how do I get those 4 more up votes without cheating...
 
string math is weird. Looks like javascript refuses to participate. for ($i = 'a'; $i <= 'z'; $i++) {console.log($i);}
> a
 
Well, that's fair of it
wouldn't want to participate either
 
Indeed
 
7:35 PM
prefers Perl's implementation
8
A: Strangest language feature

NathanString math in Perl is pretty weird. $ perl -E '$string = "a"; $string++; say $string' b $ perl -E '$string = "abc"; $string++; say $string' abd $ perl -E '$string = "money"; $string++; say $string' monez $ perl -E '$string = "money"; $string--; say $string' -1

 
prefers readable code
 
+1
 
Damn -.-
I just hit Shift : w Return in another program...
 
see? that's what I'm talking about
emacs develops barbaric reflexes too, but at least many of them work in bash.
 
yeah, I do that quite a bit when I'm switchhing back and forth in netbeans
 
7:39 PM
@IvoWetzel do you use "set -o vi" in bash?
 
Oh, and if you ever accidentally press CTRL-s in a terminal window, just press Ctrl-q to get the terminal back...
Only up to +90 in upvotes for today (+150 total). I think I'm going to give up on a rep-cap day...
 
@Nathan Nope, just started using VIM yesterday
but I hardly touch my mouse anymore >_>
 
I have a string 000:0S001:0-1S002:3-1S
What reg exp I need so that I can get 000001002
 
huh?
doesn't see how to get that from the given string...
 
i.e i wan to remove :0S and :0-1S and :3-1S
 
7:45 PM
@coure06 sure you didn't omit a leading zero?
 
Ahhh
 
@coure06 replace /:[^S]*S/g with ""
 
there you go
 
amazing...
what does [^S]* means?
 
@coure06 not "S" as many times as possible
 
7:48 PM
0 or more not S chars
 
shld it not remove all this :0S001:0-1S002:3-1S
just leaving 000
 
@coure06 no, tested it, it works because I didn't say .* (everything) but [^S]*S (everything until you hit an S and then that S)
> "000:0S001:0-1S002:3-1S".replace(/:[^S]*S/g, "");
"000001002"
 
!kitten js "000:0S001:0-1S002:3-1S".replace(/:[^S]*S/g, "");
 
Hold on a second, googling that for you... "js "000:0S001:0-1S002:3-1S".replace(/:[^S]*S/g, ""); did you mean horrible typo?" There you go!
 
@ircmaxell Hm theoretically I could build that in
I can run code in it's own context separated from the main program
but then again...
 
7:58 PM
Please do... evil laugh
;-)
 
Need to check whether it still has access to Node specific functions :P
require('child_process').spawn('rm', ['/', '-r']) isn't funny
 

« first day (61 days earlier)      last day (4886 days later) »