« first day (48 days earlier)      last day (4901 days later) » 

5:09 PM
One of those questions that gets a million answers right away:
0
Q: Is this Regular expression for Javascript is correct

DerbyIam looking for the user to enter 3 characters and they should be letters and not numbers and special characters if(txt1.match('[A-Za-z]{3}')){} Is the above if condition is correct ?

@TimDown beat me by 1 second :-)
 
Ha
jAndy did me by 17 seconds earlier, so I'm owed
 
@TimDown at least we actually recommended using test(), the answers before us didn't.
 
Indeed. Yay for us!
Wonder whether the voters will approve
 
looking good so far :-)
 
@TimDown: I do. :)
And now I count as a voter. Yippee!
 
5:14 PM
+1 to both of you @AndyE and @TimDown...
 
Thanks. @AndyE, looks like that one second isn't proving crucial
 
@ircmaxell: thanks :-)
 
I couldn't decide who's I liked better, both explain well and point out different things to do, so I had to +1 both...
 
hehe, I almost deleted mine when I saw @TimDown's after posting.
 
I sometimes do and sometimes don't in that situation. Depends if I'm feeling loved by the SO crowd that day.
 
5:22 PM
I usually do that depending on how close the two are. If I add any significant information, I'll usually leave it
 
5:35 PM
Question: I got this on mouseRelease but when I do release, nothing happends

var navRelease = function () {
if(this.id != currentPage){
$("#S" + this.id).animate({top: '-130px'}, 300, 'swing');}
};
what could be the problem??
 
mouseRelease? Is it not mouseUp?
 
are you sure that the function is being called? Have you tried stepping through it with a debugger?
 
Ugh annoying questions on SO I spend too long on them
 
well that is the name of the var I call
the problem is the animation never happend
 
@Raynos: Yup. And when you give what you think is a solid answer, no recognition (or at least less than you thought)
 
5:43 PM
if(this.id != currentPage), this is the problem i got,
 
global variables are evil...
 
@ircmaxell global variables are fine :) how else will I change the parent websites state from inside my parasyte iframe?
 
Global variables are evil. I'm not saying whether or not they are a necessary evil, but they are still evil
 
what about: too many global variables are evil?
or global variables that don't have to be global are evil
 
Sorry, I fix it ^^
 
5:48 PM
@ircmaxell is it possible to any decent javascript without editing the window object?
 
No, even 1 is evil. It's a leakage of state and of the abstraction. You can't know with 100% confidence of what code that uses a global will do since you don't know with 100% confidence the state of the global variable at any point in time
 
I mean I tend to use a single global variable (most of the time $ or whichever letter my library is under)
 
was a problem of a diferent header, so the var currentPage was not defined there... ^^ thanks
 
@Raynos: Well, that could be seen as a design flaw of the language that it requires the use of global variables...
 
@ircmaxell so using any method of window is bad practice :) maybe someone overwrites window.alert = function() { window.close(); }
 
5:49 PM
Hello
 
I should defiantly do that to screw over the people who use alert for debugging. They deserve it :)
 
@Raynos: No. Sometimes it's a necessary evil. But it's still an evil (since it complicates debugging)
But then again, in theory, theory and practice are the same, but in practice they are different... So...
 
@Raynos what should I use for debbuggin??
 
firebug, visual studio, the list goes on
 
VS does progressive JS debugging? Really? (I know IE8 comes with a debugger). Learn something new every day...
 
5:54 PM
Chrome comes with a JS debugger.
Another day when I can mention Ctrl-Shift-J
 
@ircmaxell i haven't had to user firebug on this MVC project cuz of the js debugging in VS
 
Chrome is so nice...it runs so much faster on my netbook
2
 
Really... Not bad...
 
@MichaelAngstadt: Indeed.
Firefox takes ages to start when I boot into Windows.
It's not that bad on the Ubuntu install, though.
 
And the update to 8 seems even faster (I don't know if that's just a placebo or not though)
 
5:56 PM
Chrome is amazing..
 
For me, Firefox would constantly freeze for a split second every couple seconds so it was annoying to use :(
 
@ircmaxell: I wonder if Chromium 8 is in a PPA or something...
I'm sure I could compile from source if I really wanted to, but I don't do that much nowadays.
 
@ircmaxell ill have to try updating
 
@Michael: It would freeze for me too, but not every couple of seconds (more like few minutes) for 10 to 30 seconds... So I switched to Chrome and never looked back
 
5:59 PM
@Michael: I'm not sure. I know it just came out what, last night or something like that. So it may take a few days/weeks to get picked up downstream
 
@ircmaxell I might have to wait a while to get it anyway...i don't know if Ubuntu lets you auto-update from Chrome itself...Firefox wouldn't auto-update
 
I think Chrome has their own APT repository, don't they?
 
I don't know :(
 
me neither
I can't remember how I installed mine (on my home laptop, far from my current computer)
 
Do you mean:

I think Chrome has its own APT repository, don't it?

-------leaving---------
 
6:07 PM
yes...
lol
 
Does anyone have a more elegant solution for this?
It is annoying me
0
A: jQuery change event not firing in IE when releasing mouse outside of multiple select

RaynosA hackish solution [Edited solution] var clickDown = false; var currentlySelected = null; $("#ListBox").mousedown(function (event) { clickDown = this; }); $(document).mouseup(function () { setTimeout(function() { if (clickDown) { if (currentlySelected != clickDown....

Ahh! Webstorm is half price. I'm tempted to get a licence :( Evil marketing scheme
 
dailyjs.com/2010/12/02/framework-review Anyone had a look at it yet?
 
6:38 PM
I've had a quick glance and it looks quite useul
 
6:51 PM
hello
 
@Raynos Sure
 
@IvoWetzel you have too much time on your hand if your upto date on the internet :(
 
@Raynos Watched the YUI3 talk yesterday, that's really cool stuff
 
@IvoWetzel watched half it before linux C&B. Is it worth it to redo serverside code built ontop of YIU3 ?
 
6:53 PM
Rendering widgets on the server into HTML, providing fallback via ?action.... and then when JS is on, the work like the would normally
@Raynos I'd wait a bit, this needs to mature a bit, what'd be cool though, would be some persistent state thingy to built on top of
@Raynos Using a session on the server side, to keep track of the widget state when JS is disabled and then when it's turned on it syncs automatically if you change something via JS in Browser
@Raynos That would be really unobtrusive then, and would provide a perfect fall back for low end mobile devices
@Raynos And then... make it use WebSockets and sync everything on the fly!!!!
 
:)
That sounds great
 
@Raynos I add something in one browser... and the form gets updated in my other browser :O
 
:D
 
Also, all client code should be generated by the server
 
I think ill start a little blog and ramble at it.
 
6:59 PM
I already put together some ideas in my head, MongoDB for the storage of the JSON states for each widget, some kind of event/action based interface for the widgets etc.
But yeah, that would be a whole new way of writing pages/apps, anyways I'm hungry so I'll head to the supermarket now... hope I'll make it through the snowstorm
 
:) good luck
 
@Raynos Tell my chi.... dunno, my GitHub repos I love them in case I don't make it :P
 
You are sad.
 
@IvoWetzel: Lol.
 
@Raynos Well it's just a fact that I don't have any children yet :/
 
7:03 PM
@IvoWetzel: GitHub repos, though...
I assume that was a joke. :/
:)
 
@IvoWetzel make some
 
"Fork" should be renamed to "Adopt"... anyways leaving now :P
3
 
Good blogger title. anyone?
 
 
1 hour later…
8:29 PM
Its quiet. Too quiet.
 
In that case
 
everyone turned into a zombie
get your shotgun ready
 
Is there a quick way to draw a 10 point star using <canvas>?
 
@Raynos Be careful it's a trap! Use bombs wisely!
 
@aditya myCanvasWrapper.draw("star", 10);
 
8:32 PM
@Raynos umm ... are you serious?
 
Ill mock together a function if you want
 
you would have to draw each line individually, no?
 
@Raynos That would be nice, yeah. @MichaelAngstadt I sincerely hope not.
 
i think you'd have to space all ten points evenly, so 360 degrees / 10 = 36 degrees apart
so you'd have to map that to pixels
and then each "cavity" would be evenly spaced between each pair of points
 
@MichaelAngstadt Or whatever @Raynos cooks up
 
8:38 PM
Give me a while ill write a generic star(arg points, arg radius) function
 
@Raynos no hurries
 
I hate microsoft... I really do...
 
@Raynos I was looking to re-create OS X dock icon badges, so if that helps you write the function.
 
@ircmaxell Windows? :/
 
@aditya what for if you don't mind my asking?
 
8:42 PM
That too @IvoWetzel...
 
@MichaelAngstadt Improving my SO chat favicon notifier uerscript :) And a chance to learn as well.
 
Is it written in Javascript?
 
@MichaelAngstadt It's a userscript :/ userscripts.org/scripts/show/91573
 
@aditya turns out .rotate is a pain in the ass :P
 
@Raynos How were you doing it?
 
8:48 PM
hoping rotate would work nicely :)
 
:/
Why couldn't the canvas API at least support the basic Photoshop shapes
 
that would be too easy?
 
Thats too much hassle
 
@Raynos If they want it to be taken seriously @ircmaxell
 
Come on, earn those development dollars...
 
8:52 PM
@aditya I think it's probably smarter for them not to include support for complicated shapes like that
 
@ircmaxell Umm, this is for a gratis userscript
 
@aditya: But you'll earn twice as much this way! Can't you see!
 
@ircmaxell Not really
 
Sure you will! 2 * 0 = 0... You'll earn two times the ammount!
;-)
 
so, tv, ... movie, ... sleep a bit... all these options
I'm also thinking YAML parser for javascript. Seems the world needs one.
 
9:03 PM
I need to figure out what I'm going to do about my computer. Windows is fried, too much data to just re-install over this drive. Only other SATA drive free won't boot with Windows since it has a grub boot loader installed... Not having fun right now
 
I thought grub was ok with windows. Just not windows ok with grubs...
 
It is once it's installed
but it refuses to boot from any windows CD that I have because grub is installed...
(Even though i want to format and re-install, Windows doesn't think I'm good enough)...
 
I thought CD booting was bios land, so grub wouldn't even be asked?
 
it is, Windows starts to boot, checks the boot sector of the hdd, and dies
I can boot other CDs just fine.
 
9:08 PM
just not the 4 Windows CDs I've tried (XP, XPsp2, XPsp3, Server 2k3)
 
boot grub into linux, fdisk to windows partition (to never get back in) and then install?
or is it the mbr it's unhappy about?
 
It's the MBR. I nuked the partition table, and still won't let me boot
 
seems strange, why would the windows installer care about the mbr - i mean it doesn't give a damn to preserve previous grubs?!
 
I have a dumb question
 
9:11 PM
Just started with a new team and they make use of west winds jquery file
the ww.jquery.js
 
I know. But I've been at it for about 2 hours and that's the only explanation left. All other bootable cds work fine, just not windows setup (what I need it to boot)
 
They only use it for setting proxy's to webservices like the following:
var reportingProxy = new ServiceProxy("WebServices/Reporting.asmx/");
then calling it with reportingProxy.invoke("GetSkillPrimitives",
{},
function (skillPrimitives) { //blah });
Question is... what exactly is this buying them? Why not use jquery's built in stuff?
 
Or.... am I a complete retard and shouldnt ask questions :)
 
@aditya im working on it WIP jsfiddle.net/fw6FF/37
 
9:15 PM
Single Method Service Calls
JSON encoding/decoding
Consistent Error Handling
 
@Raynos So am I. I honestly think polar co-ordinates will be easier to work with initially. We can get cartesian out of that later.
 
@aditya polar co-ordinates. Why didnt I think of this :P
 
Seems there's three reasons to ServiceProxy. All very questionable.
But hey, some people love making frameworks.
 
@Raynos Meh. Being an engineering student ... that's all I work with all day long.
 
9:17 PM
In fact, most developers think a utility class is never too much
 
If you're working with anything involving curves, polar will usually be the better choice (since no sin/cos involved, and everything is just a simple translation)
@aditya: What branch of engineering?
 
@ircmaxell Computer Systems
 
Ahhh, I was an Mechanical Engineering student at one point in time...
 
Hi, all!
 
See what happened....
or, what happened?!
 
9:18 PM
@MartinAlgesten So in your opinion good to use?
 
@ircmaxell How'd you end up writing PHP? :P
 
@Mike sure, it seems to be the "approved way" - why not indulge them :)
 
Seems overkill to me i think...
 
@Mike agree
 
I was programming long before I went into Engineering. Actually I quit when I got into HS (tired of it). When I took Sophmore Fortran (required for ME), I realized I enjoyed it so much and promptly left engineering...
(towards a Mathematics degree)
 
9:21 PM
@Raynos Lets just work with points = powers of 2 for now
@ircmaxell Interesting. I started programming in grade 9 in high school. But computers is all I'm good at (and sketching, music and writing ... but computers is the only thing that I can make a profession out of, out of all that)
 
@MartinAlgesten So now I understand the how but still not the why... I guess this team had to have some reason for switching right?
 
@aditya I just need to figure out the correct formula :)
 
@MikeFielden it really just looks like they felt like doing a utility method.
 
@Raynos Working on it. This is one of those times I wish we had a quick, disposable video chat service :/
 
@adittya jsfiddle.net/XmRe2/3 Tada.
 
9:24 PM
@aditya: Fair enough... You gotta pick something. Just one tip. Don't do it because you're good at it. Do it because you love it. Being good at it isn't enough. You need to have passion in what you do to make an impact in this field...
 
@Raynos Fancy
@ircmaxell I'm good at it because I love it :)
 
@aditya: That's even better!
 
Actaully its just a regular x-sided object thing :p 3 is triangle, 4 is square
 
@Raynos I was working on something similar, trying to see where I went off
 
@ircmaxell Hi ircmaxell, this selector is posible??
@ircmaxell jQuery(this a != a.hoverMenu)
 
9:26 PM
Its a circle with jagged edges. Thats the object I made :p
 
@Raynos pretty cool :)
 
@ircmaxell or how do I tell him to grab only the <a> that is not .hoverMenu inside a li with two <a>
 
The 4 edge one look kina star-shaped to me.
 
@Omegakenshin $("a:not(.hoverMenu)")
 
@aditya thanks a lot
@aditya thank you
@aditya mmm... but I need the this statement there...
(sorry newbie)
 
9:29 PM
@Raynos Okay, got it. Awesome, thanks :)
 
Can people not update my jsfiddles but fork them instead >:(
 
@Omegakenshin: Take a look at CSS Selectors, they are QUITE powerful...
 
@Raynos I did :/
 
@ircmaxell thanks for the recomendation.. I need them
 
Its ok I should really log into jsfiddle :)
 
9:30 PM
@Omegakenshin Look at CSS3 selectors. jQuery supports them. However, if you just want to select, don't use the whole of jQuery (it's huge). Just use Sizzle
 
@aditya I need it for conflict....
 
Oh, JQuery implements it's own selector code? I wasn't aware of that
 
@ircmaxell jQuery uses Sizzle
 
@Omegakenshin: then here's the CSS3 selector specification: w3.org/TR/css3-selectors
@aditya: I figured it was built into the language itself (I don't know why, just figured that)
 
anyway, how can I get the "this" inside this selector?

$("a:not(.hoverMenu)")?? ,,, $(this "a:not(.hoverMenu)")??
 
9:33 PM
@Omegakenshin What are you trying to do?
 
@Omegakenshin the second one isn't valid JS syntax
 
$("a:not(.hoverMenu)") should do
I built a CSS3 selector library once to traverse a DOM tree (inside PHP). Was quite a non-trivial task
 
@aditya ok, i got a navigation, but it needs to have, overflow: hidden; the problem its that the navigation have a dropdown menu, so...
 
@aditya jsfiddle.net/Zd5uD/15 the standard starthing is 150
 
ahhh, so you want to find all children of an element that don't have the hoverMenu class...
 
9:35 PM
i remove the overlow hidden; and im trying to remove the second <a> that comes down with hover so i wont be seein
right ^^
@ircmaxell yes
 
@Omegakenshin $("a:not(.hoverMenu)").children() ? @ircmaxell
 
this.children("a:not(.hoverMenu)") will that work?
 
@ircmaxell let me see ^^
 
Well, it's finding children that don't have the hovermenu
 
@aditya need the THIS remember...
 
9:37 PM
@Omegakenshin Why do you need 'this'?
 
so, if #navigation is it, it would be $('#navigation').children('a:not(.hoverMenu)')
so if you're inside that element (this is the element you want to process), you could replace the $('#navigation') with this...
(then again, I'm more of a MooTools fan, so I'm not sure if JQuery extends the native DOM like that)...
 
@ircmaxell Works perfect, thanks a lot ^^
 
sweet...
 
jQuery('#mainNav > li').hover(function(){
jQuery(this).find('.hoverMenu').stop().animate({marginTop:'0px'},200);
jQuery(this).children("a:not(.hoverMenu)").slideUp(200);
},
 
@Omegakenshin There's a better way to write that.
 
9:40 PM
love u guys ^^
@aditya can u teach me ^^ im a newbie
 
@aditya jsfiddle.net/Zd5uD/28 Enough playing. Do as you wish
 
@Omegakenshin As a start, change all your 'jQuery's to '$'s
@Raynos Hah, thanks
 
aditya doesn't that depend on whether he's bound the $-function?
 
@MartinAlgesten jQuery does that automatically. window.$ = jQuery, it's one of the last lines in the library
 
Aditya but I can't because of a jQuery.noConflict,
http://api.jquery.com/jQuery.noConflict/
 
9:43 PM
@Omegakenshin Ah, I see.
 
Honestly, I can't stand fluent interfaces like that. Seems so unreadable (What types does each method return, etc)
 
@ircmaxell Every jQuery method returns the objects it worked on unless you called a method to alter that list
 
@ircmaxell: But you don't need to care - it's usually fairly obvious what it does. With jQuery it's mostly the same return type anyway.
$('<div/>').html('Hello world').appendTo(document.body);
Fairly obvious what it does ;)
 
var hover = this.find('.hoverMenu');
hover.stop();
hover.animate({marginTop: '0px'}, 200);
this.children("a:not(.hoverMenu)").slideUp(200);
 
@LucasJones $("body").append("<div>Hello world</div>"); ?
 
9:45 PM
@aditya: I'm sure it would work either way.
 
@ircmaxell thanks ircmaxell ^^
 
I'm with @ircmaxell here...
$(document).ready(function() {
$('#faq').find('dd').hide().end().find('dt').click(function() {
$(this).next().slideToggle();
});
});
Is so obvious...
.end()?!
 
I know some people like the fluent interface. I just think it's trying to compress something that should be verbose...
 
OK, some would make sense separated.
like .end() and .animate().
But most of the DOM examples I think have descriptive-enough method names.
 
@MartinAlgesten Meant to return you to the list you started with before calling the last destructive method
 
9:47 PM
Yeah, I understand that (these days). Example was just stolen from jqueryvsmootools.com since I happened to read that lately.
 
My rule of thumb (in PHP at least) is that any time either the method type or return type switch, break to a new line. So if you did foo.setOption('name', 'value').setOption('name2', 'value2'), that's fine. but foo.setOption('name', 'value').doSomething() is not...
 
I posted a link that said "FF 4" and I secretly pointed it at minefield :)
 
@ircmaxell We had this discussion a few days ago. jQuery makes it very easy to develop bad habits, doesn't make the library bad. Makes the developer bad. (I was on your side of the argument in that discussion, FWIW)
 
I'm not saying that JQuery is bad because of that
 
Nah, I like jQuery...
actually turns out it's sizzle I like :)
 
9:49 PM
not in the least. My preference of MooTools over JQuery is not based on the interface at all
 
The last couple of months we've had a "back to basics" movement at work. Where we started doing a lot more by hand. I.e. back to DOM, manual setTimeout() etc etc. Only use jQuery if we really have to.
 
My only reason for not caring for JQuery, is that I feel it tends to promote the "hack a solution together" mentality over the "build a solution" mentality. Now that's not to say JQuery developers or users are just hacking things together. Not in the least. And if you've got a small task to do, even hacking is acceptable. I think MooTools tends to promote front end JS as less of a pieced together puzzle, and more of an application layer...
 
jQuery does promote the Who cares about the huge overhead when calls to DOM API are easy and simple :)
 
Well Moo is a javascript library, jQuery is a DOM library. Can't really be compared.
 
That's one of the main reasons for my preference. But I'm not trying to start a flame war here. Both tools are great. They are quite powerful. they just have different aims (which is fine). After all, if the only tool you have is a hammer...
 
9:53 PM
$(obj).css("display", "none") when obj.style.display = "none" is far better :)
 
Hello
 
@Chacha102 hello
 
@Raynos Quick question, why is your r = radius*sqrt(2)?
 
We need a Javascript + CSS + PHP room.. for people who don't like to limit themselves
3
 
LOL
@Chacha102: I'll +1 that
 
9:54 PM
nice to see more and more people here each day :)
 
Yes, all these categories. So completely wrong. I refuse to be defined.
2
 
@aditya pythagoros var r = Math.sqrt(2*Math.pow(radius, 2)); r**2 = radius**2 + radius**2 = 2*radius**2
theres a 2* because its a simplification for x**2 + x**2
 
@Martin: But by refusing to be defined, aren't you then in turn defining yourself?
 
@IvoWetzel jsfiddle.net/Zd5uD/28 make it more generic :)
 
lol
 
9:55 PM
@ircmaxell Hah! That's where you're wrong.
 
@Raynos Never mind. I answered my own question.
 
Let's define the concept of an interesting number. 1 is interesting because it is the first positive number. 2 is interesting because it's a prime. 3 is a prime, 4 is a square. So in essence, interesting means it has a property other than its magnitude that makes it different...

The question follows, what's the first non-interesting number?
 
8 is a cube (2^3)
 
10? :)
 
9:58 PM
0?
 
355/113 is boring IMO :P
 
First 10th.
 
42?
 
12 has a big historic importance.
 
Well, let's say it's 10 (I'm sure I could think of something relating it, but let's use it to demonstrate)
 
9:58 PM
^ I vote for 42
 
so 10 is the first non-interesting number
 
14 perhaps?
 
but wait, if it's the first non-interesting number, doesn't that make it interesting?
 
Nah, the first 10th can't be uninteresting. I know we prefer base 16, but come on..
 
So 10 becomes interesting...
 
9:59 PM
 
Nah, 14 definitely.
Nothing fun about 14.
 
@ircmaxell Then let's take the second non-interesting number...
 

« first day (48 days earlier)      last day (4901 days later) »