« first day (60 days earlier)      last day (4900 days later) » 

5:00 PM
Yes
null is technically not equal to anything
even another null: null == null should be false...
 
user492203
null == null // true
null == undefined // true

null === null // true
null === undefined // false
 
uh... stop it
> null === null
true
> null === undefined
false
 
user492203
@IvoWetzel yep
 
nobody uses == unless he has really good reason to do so
 
user492203
7 mins ago, by Nyuszika7H
I have a form field. As you can see on this image, I've used <br/> after <input/> elements, but that's not enough. Two <br/>s are too much. Any ideas?
 
user492203
5:02 PM
Nobody?
 
uh, give the first input a margin-bottom?
or the second a top one
 
user492203
And how do I apply a margin-bottom on all <input> elements in a <form>, except the last one?
 
user492203
form > input:not(:last)
 
@IvoWetzel == is useful for checking for both null & undefined
 
user492203
@Raynos Use the ! operator for that. Example: instead of if (obj == null), use if (!obj).
 
5:08 PM
@Raynos I never had the need of doing that
 
user492203
I thought After the Deadline is a good spell checker for Chrome. Nope! It throws no errors on they is here.
 
Uh? 3rd person? Sounds valid too me
 
user492203
If usage of they instead of he/she is correct, then yes, maybe…
 
"If the user decides to ...., they will also have the ability to..."
I'm sure there's something on that over at english.se
 
!kitten wob
 
5:12 PM
It's Nick Cravers fault!
 
there. problem solved.
 
ha ha
Wow, 122k, and only 3 gold tags..
 
it's a 8
oh. on questions.
well, i'm tired.
 
@Nyuszika7H your doing it wrong if (false == null) vs if (!false)
 
see ya
 
5:14 PM
@IvoWetzel I find the pass in an object, check whether the object is null OR undefined useful myself. Mainly with error catching an edge cases. Tbh its only needed if your relying on the fact a user can pass in questionable paramaters. You shouldnt need if your doing your own code
 
user492203
I hate switch's identing. It's a mess.
 
@Nyuszika7H change your text editor >:(
 
user492203
@Raynos I'm using jsFiddle.
 
switch(foo) {
case "bar":
    do stuff
default:
    shoot @Nyuszika7H
}
@Nyuszika7H dont use jsfiddle as a development platform
 
user492203
@Raynos I just use it for testing.
 
5:16 PM
use eclipse!...
no, use vim
 
Unix is my IDE
 
^-------- this
 
@ircmaxell thats too hardcore. At least open vi
 
That includes all the tools unix provides, including VIM
 
@ircmaxell I thought you meant your code in the shell :P
@ircmaxell do you use text based browsers? or just not view websites in unix
 
to be honest I use gedit for 90% of my work, but I know the basics of vim, just in case...
 
I use real browsers for viewing websites (although I do have uses for lynx
I like using the keyboard. I find it's so much faster than a GUI for 99% of what I do.
So I use VIM from the console, or GVIM if I need to use a mouse/gui for some reason...
 
german keyboards suck...
but I use the command line for nearly everything
 
I use webstorm >_>. I'm getting better though I now have at least 4 consoles open on my linux console tab. Where as before the linux console tab didnt exist :P
 
5:26 PM
@Nyuszika7H Maybe you should click the link yourself? :P
 
uhhh
!kitten ban Nyuszika7H
 
!kitten bans
 
@CodingKitten: I like you... Does that count (even though I hate cats in general)?
 
@ircmaxell lol... It googlable any library back then, that can't be cleaned up, for helping me can think of it procedurally by moving your algorithm it has evolved
 
user492203
@IvoWetzel I did it :P
 
5:31 PM
ROTFL!
366
Q: Jon Skeet Facts?

Bill the LizardI'm looking for Chuck Norris Facts style answers. In case anyone is curious, this question was inspired by Jon's own comment to this question. EDIT: If you're into cryptography, you may enjoy these facts. Now with official sanction from the powers that be!

 
@ircmaxell You just found that now?
 
Yeah
Rotfl: Jon Skeet doesn't have performance bottlenecks. He just makes the universe wait its turn.
 
man... I really like that wombat theme
man, learning vim is like -200% productivity each time you try it
 
user492203
@IvoWetzel
 
5:38 PM
@IvoWetzel but knowing vim is like +200% manpoints
 
@Nyuszika7H ?
 
@IvoWetzel it's -200%? There is a bit of a learning curve, but I don't think it's negative...
 
@ircmaxell Well if you're used to ctrl+z/y etc.
 
Oh yeah...
And CTRL+S can get you in a lot of trouble...
 
@ircmaxell Right now, I'm trying to figure out how to select text
@ircmaxell Well I know the basics shift + : etc
 
5:40 PM
ESC, v, then highlight the text, then y to copy and p to paste (put)
 
@ircmaxell Thanks, a bit cumbersome on ger keyboards again
[Shift] [<>] [y] >_>
 
497
A: "Hello World" in less than 20 bytes

Jon SkeetVery simple: h This is from my unreleased "HelloWorld" language. It's an interpreted language, so there's no real compiled form. The language is very simple though - the above is the only valid program, with the well-defined behaviour of printing "Hello World". Arguably I could have designed ...

Well, you can re-map the macros
 
Uh, that's the last thing I want to do...
when I ever end up not having them I'll be lost
hm, why does shift + i not start insert at the current cursor pos? :/
 
shift + i?
 
insert mode?
 
5:45 PM
don't hit shift
 
ahhhhh
 
shift+i starts insert at the start of the line, i alone starts at the cursor point
 
user492203
@IvoWetzel !
 
yea, i should really learn it this time
 
Once you do, it just becomes muscle memory and you stop thinking about it
and then you can really start being productive
 
5:50 PM
yep, good thing I can already type completely blind
 
user492203
I closed my eyes when typing zthis.
 
lol
nice miss.
 
it's always awful when I see people typing with just two fingers
 
user492203
@ircmaxell I have a Hungarian (qwertz) keyboard layout.
 
although I don't use all ten I use like 5 for normal typing and 3 more for numbers and braces etc
 
user492203
5:52 PM
My eyes are closed again.
 
to type flawless with closed eys or not that is here the question
ok, missed one e, but this keyboard doesn't have the best feedback
but in the end... code's written once
(unless you screw it up and have to start from scratch :P)
ok one thing I need in vim is shift tab
 
shift tab?
 
outdent
I'm sooo used to that
 
user492203
@IvoWetzel me too
 
uhhh.... example?
 
user492203
6:06 PM
@IvoWetzel I usually don't look at the keyboard anyway. :)
 
@ircmaxell ?
Well I indent with tab, and then outdent with shift+tab?
 
user492203
some code
 
user492203
becomes:
 
user492203
some code
 
Remove one tab...?
 
6:07 PM
yep
especially when multiple lines are selected
 
user492203
Why does this jQuery(obj).animate({ width: '+=100' }); works but this jQuery(obj).width('+=100'); does not?
 
actually, no
@IvoWetzel: hit escape and then type: :imap <S-Tab> <C-o><< and hit enter. Then re-enter insert mode (i) and try it
 
@ircmaxell Thanks, works like a charm :)
 
Add that to your ~/.vminfo file to persist it...
 
6:17 PM
@ircmaxell shouldn't that be .vimrc?
yep, works in vimrc
 
Yeah, but on my machine it's .viminfo...
sorry no
is an idiot
 
user492203
thinks @ircmaxell isn't an idiot
 
6:35 PM
lol
Well, thank you...
Windows sucks hard... Why does it swap kernel code ever?
 
6:46 PM
0
Q: Wordpress site extremely slow

JuanHi, I have a wordpress blog that is having serious performance issues (like 10s to load each page). I installed WP Super Cache to try to solve the problem, but the first time a user visits the page after the cache expired againg it takes 10s to load. After it is cached, the site speed is normal...

 
7:15 PM
The most important vi(m) command to memorize is :q!
 
Any idea why firebug would throw an error saying a function doesn't exist when it is called and does execute?
 
yes
absolutely
 
Should I be concerned about the error? The function executes as expected, but firebug is throwing an error saying it doesn't exist.
 
(My 2 posts were directed towards @Nathan)...
 
I guessed that...and agree with his statement :P
 
7:24 PM
My experience is that things like that are typically bugs in firebug itself...
 
@ircmaxell Seconded shakes fist at Firebug
 
@jon3laze is it maybe possible that the function is being called before it's defined, but later on it succeeds?
 
@jon3laze Does the problem persist if you refresh the page with the firebug console open?
 
It's only fired on a button click event, happens every time. I'm using the Jcrop plugin and calling the destroy function from their API to remove Jcrop from the image. It works but firebug kicks an error that $.Jcrop.destroy() is not a function
Their docs say "Important note: you must call the API Invocation Method from within $(window).load() or unexpected behavior may occur." So I am doing $(window).load(function () {
$('#button4').click(function () {
$.Jcrop.destroy();
});
});
works every time without a hitch in all browsers...i get ocd when errors pop tho.
 
has no idea
 
7:34 PM
does any one knows why my input field doesnt work any more and the buttons and checkbox do? :o
http://www.jsfiddle.net/AVG5a/
 
1
A: Is this using PDO and prepared statements correctly for a secure login?

ircmaxellOne suggestion. Add the password into the salting hash run: $hash = hash('sha256', $pass); $salt = createSalt(); $hash = hash('sha256', $salt . $hash . $pass); The reason is to avoid collisions (albeit with SHA-256 that's pretty unlikely). Let's say there is a string foo that collides with y...

 
@Opoe I think it's underneath the draggable div or something
I can tab to it and type into it.
 
@Nathan that makes sense can i change that with maybe z-index or so?
 
@Opoe Maybe?
 
7:49 PM
@Nathan not working.. its so strange
 
user492203
@Opoe .draggable({ cancel: 'input' })
 
user492203
@Opoe Oh, why don't you use jQuery UI???
 
user492203
@Opoe Vanilla JS is bad, use a library, I recommend jQuery + jQuery UI.
 
0
A: PHP closing tag

ircmaxellWell, there's two ways of looking at it. PHP code is nothing more than a set of XML Processing Instructions, and therefor any file with a .php extension is nothing more than an XML file that just so happens to be parsed for PHP code. PHP just so happens to share the XML Processing Instructi...

 
8:04 PM
0
Q: BASIC.js for toUpperCase

cf_PhillipSennI'm going to go old school on JavaScript and write a BASIC.js that contains functions like: function UCASE(obj) { return obj.toUpperCase(); } function LCASE(obj) { return obj.toLowerCase(); } Q: Has anyone done this already?

 
@Nyuszika7H well im trying to learn javascript
thats why its javascript
 
guess I'm sold on vim...
editing one file in two different views = win
only thing left to do: BUY A FREAKING 2560xsomething monitor
 
@Nyuszika7H: You remind me of this:
 
@ircmaxell exactly
 
user492203
@Opoe jQuery is JavaScript, too.
 
user492203
8:07 PM
@ircmaxell Nope!! This is too simple, but Opoe's code is more complicated, and is much easier to do with jQuery and jQuery UI.
 
@IvoWetzel: See, once you get over that initial learning curve (which isn't trivial), it's amazing how powerful it is...
@Nyuszika7H: I didn't say you're that guy, but @Opoe Vanilla JS is bad, use a library, I recommend jQuery + jQuery UI. taken out of context...
 
user492203
@ircmaxell Sorry. I meant Using only vanilla JS for everything is bad, use a library! I recommend jQuery + jQuery UI.
 
that makes sense
i was just wondering what the problem was
 
I agree with @Nyuszika7H . This is a good time to use jQuery UI. Especially since you understand some of the complexity of doing it yourself.
 
user492203
@Opoe I were a beginner, too, say, a month or two ago, and was scared of the long functions (document.getElementById(), document.createElement() etc.), then I've discovered jQuery, and everything is easier with it.
 
8:10 PM
@Nyuszika7H: That's a better way of putting it... That one I can agree with. The other way you said it came off, well, I'm not going to say it
 
user492203
@Opoe I'll help you to do that with jQuery + jQuery UI.
 
realy?
 
user492203
@Opoe yes :)
 
@IvoWetzel you can edit two views of the same doc in Emacs and MS Word too, it's not unique to vim :D
 
thank you so much :)
 
user492203
8:11 PM
@Opoe Do you know CSS?
 
yes
 
user492203
@Opoe Then jQuery is worth it, because it uses CSS selectors.
 
@Nyuszika7H okay :o i saw all these dollar $ signs wich i never saw befor
:')
and i walked out
 
@Nathan: Not at the same time with MS Word. You can have one open read-only, but you can't edit both concurrently (at least to my knowledge)...
 
@Nathan Emacs.... uh....
 
user492203
8:14 PM
@Opoe If you don't like them, you can use jQuery instead of $, or alternatively you can use a shorthand like jQ using shorthand = jQuery.noConflict();. Remember that you can only use the symbols $ and _.
 
@Nathan Also, you use MS Word for programming? I thought only Jon Skeet could do that!
 
The dollar signs are creepy.
loves that xkcd
 
haha okay!
 
@IvoWetzel I actually don't really use MS Word... just thought since I was mentioning emacs I might as well give equal time...
 
user492203
8:16 PM
@Opoe Remember: avoid using selectors multiple time. Instead, cache them, like this:
 
user492203
var someElem = $('#asd') // gets elements with ID of asd
someElem.hide() // this is a jQuery function, you don't need the $() because the someElem variable contains it
 
user492203
More tricks!
 
user492203
Chaining
 
despises chaining... Or at least most of its abuses
 
user492203
$('#obj').hide().fadeIn(5000);
 
user492203
8:19 PM
I don't know its name, but it's useful
 
user492203
$('#obj').css({
    'background-color': 'red',
    'color': 'yellow'
});
 
haha for a nice effect
 
Not really js specific but what OS's do you use to dev in?
 
user492203
@Opoe Your best resource for jQuery and jQuery UI
 
@jon3laze Ubuntu
 
8:21 PM
@jon3laze Windows at work, Mac at home, Linux, AIX, iSeries (and Windows [*shudder*]) in the server room.
 
@Nyuszika7H cool thanks
 
I settled on using bash and emacs everywhere because it was too painful to switch keyboard reflexes all the time.
 
Windows at work for primary dev (and linux testing and deployment servers). Linux all across the board at home (I don't own a Windows computer anymore!)
 
user492203
@Opoe I'll do your code with these, but it won't be too easy… it would be easier to bulid it from stratch :P
 
the drag and drop and append? or everything :p
 
8:23 PM
last job Ubuntu with XP VM, this one OSX with Win7 in parallels.
 
user492203
@Opoe I think everything :P
 
@Nathan Any good editors with syntax highlighting?
for Mac
 
@Nyuszika7H how many hours do you think a n00b like me need to do that
need for that
 
@jon3laze: VIM
:-)
 
@ircmaxell I have MacVim
 
8:26 PM
Textmate...
 
user492203
@Opoe I don't know, but if I use the docs (and ask me if you don't know how to do something) it will be easy, I think :)
 
user492203
@Opoe Please help me :D what is parentNode? Parent of an element?
 
user492203
Another Java and JavaScript question:
 
user492203
0
Q: Facebook app in Java and Javascript

user543863I am creating my first FB app (in Java) and am hosting it on Google app engine. I have created the app on FB I want to authorize the user when they come on the app page (using javascript) Can someone please help/point to a helpful tutorial.

 
@Nyuszika it is the parent of an element (at least that was explained to me)
 
user492203
8:31 PM
@Opoe Thanks. It's parent() in jQuery.
 
lol
 
@Nyuszika7H allright! :o
 
user492203
How embrassing! alright = right
 
user492203
 
user492203
yummy!! :)
 
8:34 PM
Hahhaha :')
 
@jon3laze I use Aquamacs emacs on the Mac. TextMate looks better honestly, but I need to have the same editor on Windows and Linux too.
 
nomnomnom
 
@Nathan Solution, replace Windows with Linux :P
 
@IvoWetzel I'd like to, however the bread winner for me is .NET dev. :P
 
@IvoWetzel they have TextMate for Linux?
 
8:36 PM
@Nathan Just use vim
(Damn using it 30 minutes and I'm already a fanboy)
!kitten wob
 
It's Michael Mrozeks fault!
Michael Mrozek, Indiana, US
15.6k 2 16 45
 
I know enough vim: :q!
 
:qall!
I already have 3 views open... and 3 vim in my terminal >_>
 
I seriously considered vim a couple years ago, actually. I went with emacs because I'm addicted to bash emacs shortcuts like Ctrl-A, Alt-D, etc.
And cygwin lets me use bash on windows pretty nicely so I don't have to keep mashing the wrong buttons
 
66
A: What would be the math symbol for showing division

Andy EJudging by your comments, it looks like you're specifically asking how to display fractions. If that's the case, many fractions are defined as HTML entities. As an example, a few of those entities are: &frac12; &frac14; &frac18; &frac23; &frac25; &frac34; &frac38; ...

^ I can't believe how many votes this got in 9 hours, I'm in shock!
One more vote and it's drawing level with my highest scoring answer that took months to accumulate the votes it has.
 
8:48 PM
@AndyE +1 :$ haha im sorry
 
@AndyE I only have one answer with votes even remotely close to that, and it's on one of those more novel questions, heh.. Nice work. :P
 
lol thanks. I'm just surprised, I've written many better answers that haven't gotten nearly as many votes.
 
It's -40° here now. Brrr.
 
@AndyE Story of my SO-life, hahah.
 
haha yeah :-)
 
8:56 PM
HOLY CR@P! +68 for that! Wow!
And I only got +22 for this:
22
A: Why is PHP apt for high-traffic websites?

ircmaxellWhat you'll usually find is that it's not as slow as you think. The reason a lot of sites are slow is because the hosts are overloaded. But one primary benefit of PHP over a compiled language is ease of maintenance. Because PHP is designed from the ground up for HTTP traffic, there's less to b...

Only +2 more till a silver badge ;-)... </shameless-plug>
 
not anymore :-p
 
:-D
 
merry xmas
 
Now, only 75 more to go ;-)
Thanks @all
 
hitting that 100 mark looks really difficult. I'm not even sure my +68 will be able to make it.
 
9:06 PM
You really need an epic question to have a chance of the answer hitting +100...
So that's 2 silver and a bronze badge for today... Not a bad day...
 
@ircmaxell yeah. Mostly happens on discussiony questions that I've seen.
 
yeah...
 
heh, if I get one more vote and the guy accepts the other answer I'll get a populist badge.
 
@ircmaxell I'm not sure how "epic" the question is, but my shortest answer has over 40x more up votes than my longest answer, heh.
Thankfully that question flipped over to CW pretty soon after I posted that answer, so I don't have to feel too terrible about getting rep from such a silly post.
 
@TimStone: Not bad... I'm impressed...
 
9:19 PM
Heh, thanks. :)
 
I like this answer too: (!!A + !!B + !!C)>=2 (language and implementation dependant, of course)
 
9:41 PM
ROTFL!!!
11
A: Check if at least 2 out of 3 booleans is true

AnuragHere's another implementation using map/reduce. This scales well to billions of booleans© in a distributed environment. Using MongoDB: Creating a database values of booleans: db.values.insert({value: true}); db.values.insert({value: false}); db.values.insert({value: true}); Creating the map, ...

 
@Nyuszika7H i lost you! Thanks for your help, maybe talk to you tomorrow i got to go now but thanks a lot!!!!
 
Does anyone have expirence with the jquery.simulate plugin ?
 
nope
 
I'm not sure what else they want here...
2
A: Do native _SEPARATOR in PHP

ircmaxellThe documentation will yield all the answers you are looking for: Predefined Constants Magic Constants - "Constants" who's value changes depending on where they are used... So, looking there, DIRECTORY_SEPARATOR - The directory separator for the current OS (/ for Linux, \ for Windows, etc) ...

Good night all
 
10:51 PM
a non-jquery solution gasp.
0
A: Creating my own custom JQuery templating engine?

NathanI thought that was what XSLT was for? And yes, more coffee.

 
11:41 PM
1
Q: Why does Canvas leave a ghostly ring?

C. RossI'm experimenting with Canvas, placing tokens of different colors on a grid, and trying to remove them. I'm currently trying to remove the token by drawing a circle of the exact same dimensions in white over the token. This is leaving a "ghostly ring" (single pixel outline) where the original c...

that is confusing the fire out of me
 

« first day (60 days earlier)      last day (4900 days later) »