« first day (968 days earlier)      last day (3987 days later) » 

2:00 PM
@Zirak Laughing so hard right now
 
@Gacnt oh, this is heaps better: grooveshark.com/#!/s/Maggot+Brain/2HYonm
 
@Zirak What a name for a song, thought you linked me some black death incest rape metal
 
...pardon?
 
o.o
 
I think i have the problem $('.user_send_message_form .upload_img').bind('change', function() { $('.user_send_message_form').ajaxSubmit({ by change you use a sub class and by ajaxsubmit the head class what can I do know?
 
2:15 PM
0
A: function using .slideUp doesn't animate

GacntI'm not the greatest with jQuery, but I notice you're not setting a timeout on the slide animation, so it might just be happening instantly, try doing .slideUp(200);

Is that a bad answer?
 
sounds more like a comment, given you're using the word "try"
 
@Gacnt yeah, it's a bad answer
 
@JanDvorak Can you help me please?
 
Ok I deleted it :P
 
I still see it
 
2:16 PM
@Arthur I can't understand the question, sorry
 
You have a field in the form .upload_img when you change that, this command run $('.user_send_message_form .upload_img').bind('change', function() {
In that command you have $('.user_send_message_form').ajaxSubmit({ but .upload_img is in .user_send_message_form
that blocked in IE
 
Do you have more than one user_send_message_form?
 
no <form class="user_send_message_form" action="upload_profile_image2" method="post" enctype="multipart/form-data"><input type="file" name="file" class="upload_img"></form>
 
Why are you using a class name instead of an id?
 
Is asking about jquery taboo here?
 
2:27 PM
I prefer using classes..
 
jsfiddle.net/qnK6q/1 why the hell isn't that scaled to its 100% size properly?
 
what the hell is happening these days on SO :/
0
Q: CSS border only appear on hover?

Betty CarltonJSFIDDLE You can see the problem from the jsfiddle link: a border with a certain thickness is set, but it does not appear generally (it only appear on hoover)... At the same time, the very same structure works with no issue when the border is not involved.(JSFIDDLE sample 2) Here is the code: ...

The OP marked a bad suggestion as answer even I suggested a post to her.
 
Just because you prefer something doesn't mean it's not wrong
 
@Shmiddty when i change the class of the form in an id, it makes no difference...
 
@Shmiddty What's up beautiful
 
2:34 PM
@arthur hey if you want to do things wrong, don't expect help
 
@Shmiddty To do what wrong? I change it to an id now...
 
You also shouldn't be using an image as a button
Image tag, that Is
 
@Shmiddty So I must build an div around the input file, and use that for change?
 
No
Nevermind, I misread your unformatted code
 
@Arthur arthur use a <button>
 
2:42 PM
It's a file input
 
Why do you need a button for that?
 
@Shmiddty Ah ok :)
 
I misread his html.
 
When you add a file input to a form, it automatically adds a button for you.
 
But strange I have this problem only in IE
 
2:45 PM
My guess is that its because ie doesn't have the file api
But you haven't shown enough code
 
Why doesn't the button appear in IE
 
This has nothing to do with buttons
 
What the fuck
How can you be a member for 1 year, 1 month, and have 1 point.
0
Q: Linking javascript with html

a.mpetersI'm just learning about html, css, and javascript through codeacademy. I wanted to try and practice what I learned by creating a website without the codeacademy environment. The problem I'm having is linking my javascript to my html. I have three files in a folder: index.html, style.css, and scri...

Makes me laugh, learning javascript, check what he's writing in
 
1 message moved to recycle bin
 
@Gacnt I'm not sure I had more points after one year on SO.
 
2:51 PM
@Arthur make a js fiddle and please format your code
 
It's legal to be on SO just to ask questions.
 
@Gacnt That takes skill
 
@dystroy no it not
that definition allows help vampire formation
 
@Michael Actually, it literally takes nothing
 
you must constrain that behavior
 
2:52 PM
Sign up, not sign in for a year
 
@Darkyen
3
Q: Is it OK to only ask questions? What is the percentage of users always asking questions, and users always answering?

500Ethics: I started really programming 94 days using Mathematica. I learned with 2 friends and SO. I asked 74 questions yet all answered with generosity. Sometimes I feel guilty only "asking". Then I thought that it depends on what others do. Data: I would be greatly interested to see some d...

 
Emphasis on "good questions"
 
6
Q: Am I obligated to answer questions before asking one?

DilbertFanI am new here and I have a question. Can I just ask questions on this community or do I have to answer other peoples questions too? I feel awkward when I just ask but not being able to help anyone.

 
@Arthur Maybe the problem is that you are accessing the input element using class names.
 
2:55 PM
hmm
 
Class names do not have to be unique, so maybe it is having a problem calling bind() (an array might be being returned instead of a single element).
When you query the DOM for a class name, a list of elements may be returned because multiple elements can have the same class name.
However, when you query the DOM for an ID, only a single element can be returned because only one element can have a particular ID.
 
@Michael but when i remove the ajaxsubmit in the bind, it works...
 
Meaning that the change event has been successfully bound to the file input element?
 
@Michael Yes
 
Are you sure that you have refreshed your browser after making your changes?
 
2:59 PM
@Michael Yes
@Michael You think the problem is not that you use first a class in the form, and then the class of the form?
 
Did you try restarting your computer?
 
-1
Q: Update a webpage depending on user inputs

Mark TaylorI have a very simple question that I'm looking for a hello-world type tutorial on: My goal is alter one part of a webpage depending on external factors. So, in this example to have a block of text in the website that says "Apple". If the "Banana" button is clicked, that text now says "Banana" an...

If I don't get an upvote, or an answer check, it will be the last answer I give on SO
 
@Arthur Perhaps the problem is that you are accessing the forum using a class name (on line 2).
 
@gacnt mature
 
You should try using an ID instead. Using class names for this sort of thing is bad practice anyway.
 
3:02 PM
@Michael No that makes no difference
 
Class names should be primarily used for applying styling to the elements on the page.
 
@Shmiddty Yes
 
can someone help me with a pretty simple js question? I have a variable defined outside of any functions , its an array of like 160 length. I call a function to get the first 20 , then when I click another button to get the next 20 it can't find it .
 
@Arthur Have you tried it?
 
Did you try restarting your car?
 
3:03 PM
This is in a seperate js file , but when its inserted right in the html it works fine
 
@Michael Yes of course
 
user1125394
!!> java == undefined
 
@cx "ReferenceError: java is not defined"
@cx "ReferenceError: java is not defined"
 
@Arthur What happens when the code is run?
 
@Shmiddty Why won't you love me :/
 
3:07 PM
!!> java = "Shit"; console.log("Java is",java);
 
@Darkyen "SyntaxError: unterminated string literal"
 
about my last question - not that anyone answered it - but there was just a typo in array name
 
@Darkyen "undefined" Logged: "Java is","Shit"
 
Because you act like a 14 year old
 
@Zirak err dude, thats not how console.log works bro
 
3:07 PM
Such a hater
 
console.log("Foo","is","example");
Foo is example
can u do that ?
 
@Michael Nothing
 
can anyone help a brother out with some CSS? i have 3 images in a floated element on the right but they interfere with an image below: i.imgur.com/qEuqVMY.png
 
@Arthur Is an error appearing in the Javascript Console?
 
!!>"@zirak "+"did this ping you?";
 
3:09 PM
@Darkyen "@darkyen whats up?"
 
@Michael No
 
@Darkyen "@zirak did this ping you?"
 
@darkyen pull request
 
Of course it will
 
interesting :o
 
3:09 PM
@Darkyen Doable, yes
 
:-) that'd be nice or well if u can wait till tomorrow , i will give it a shot :D
I didnt knew you can hide pings b/w code blocks
 
@Michael I'm sure that the problem is by the classes first a class in a form, and then the class of the form...
 
!!> javascript = "for script kiddies"; console.log("Javascript is ", javascript);
 
@Michael "undefined" Logged: "Javascript is ","for script kiddies"
 
@Darkyen Sure, I'll wait it you want to try
 
user1125394
3:11 PM
@CapricaSix hehe
 
user1125394
!!>"@CapricaSix "+"!!> 1+1";
 
@cx "@CapricaSix !!> 1+1"
 
user1125394
distracting bitch
 
So, I'm pretty sure I know the answer to this, but if an answer is doable, but really fuckin bad, do you downvote it, or just leave it
Like it would work, but it's terrible
 
How can I redirect the classes?
 
3:13 PM
Did you say that it works in other browsers, but not IE?
 
@OscarAgreda Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@Michael Yes only in IE it doensn't work
 
@Zirak :-)
 
If bubbling is false by default, why do people declare it anyways
 
@Arthur Is the web service running at /check_image being called?
 
3:20 PM
Dear Science, grant me the patience to endure all the window-licking, crayon-eating, helmet-wearing idiots I'll encounter today :/
 
@Michael How do you mean?
 
Is the POST request being sent?
 
Yes
 
So what's the problem?
 
@Michael That this command doensn't work in IE
 
3:23 PM
@Arthur which version IE
 
But you just said that the POST request is sent
 
IE is a huge mess of shit
show me the code :$
 
@Darkyen IE 9.0 Yes, I hate IE to!!! jsfiddle.net/EkK7f
 
For helping u mate you have to send me 4 bottle of beer
 
@Darkyen Where to?
 
3:25 PM
and btw you mustn't use .bind
jsfiddle.net/EkK7f/2 <-- use .on does it fix ?
 
urgh. The train didn't have the AC going
they'll have it going when it's 70, but not when it's 90. makes sense.
 
@Darkyen No..
 
@Arthur Arthur you said it sent the POST
 
@Darkyen Can you put the jquery.form.js to the jsfiddle so whe can tested there?
 
i am not a victim
 
@Darkyen Sorry, I don't know how to do that in jsfiddle to put this <script src="http://malsup.github.com/jquery.form.js"></script>
 
@Arthur see the resources accordion on left bar ?
add it there
 
@Darkyen Thanks! jsfiddle.net/EkK7f/3
 
@venkrao Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
can some of you fellas run this? jsperf.com/date-gettime-vs-date-0
 
3:49 PM
@eazimmerman Don't be silly
 
:C
i like being silly
 
The 25 seconds you needed to create that fiddle won't be worth the saved time in the lifetime of your application
 
@copy Wrapping his willy doesn't apply in this scenario
 
Strange, the script doensn't work here at all: jsfiddle.net/EkK7f/3
 
@copy was just wondering which is faster
 
3:52 PM
They all call getTime to convert it to milliseconds.
 
You're distracting people who are trying to concentrate
 
it's not about the performance, just how the compiler handles the different ways
 
So your date - 0 are all date.getTime() - 0
So really...concentrate on something more important
Like, cleaning your CPU fan.
 
Or take a shower
It's been a week
 
i don't like the feeling of clean
 
4:06 PM
@eazimmerman new Date().getTime() would be slower because you create a new object, and then call a method.
new Date() - 0 doesn't make sense because you can't subtract 0 from an object.
 
@Michael it doesn't make sense but it works
 
It makes sense and it works
 
@eazimmerman whats it make
 
@Michael dateObject + something converts dateObj to milliseconds, and then does the operation.
 
I'm very frustrated
 
4:07 PM
oh
 
you can use Date.now() too
 
it returns the same as Date().getTime()
 
Javascript != sense
 
Welcome to duck typing
 
@Michael Unlike PHP?
 
4:08 PM
@Michael Have you see this already jsfiddle.net/EkK7f/3
 
@Zirak no, new Date()+0 returns the date as string with "0" appended
 
yeah, I forgot how annoying + is, you're right
 
@Arthur arthur it's the same...
 
Coersion, you so silly ^_^
PHP is awesome and well thought out. It is now pieces and bits shoved together at all, and it is not optimized for SQL injection and totally dissing SRP and separation of concerns.
 
+new Date() is 5 times slower than Date.now() :o
 
4:14 PM
JK!!!
 
mgawd
 
I hate this guy. I updated the answer about 8 hours ago. He was in 2 hours ago, but hasn't replied.
His q/a ration isn't very incredible...
 
@Esalija , conversion is slower than not converting ermergerd
 
I expected the system call overhead in both to dominate so that you can't see a difference
 
Over creating and converting an object?
 
4:17 PM
and you'd expect +new Date() just to be optimized into Date.now() anyway
 
I wouldn't, but I see how that would make sense ( why optimize it if Date.now exists?)
@Zirak let's kill him
 
Hang on, I'm teaching my tortoise how to make toast
 
well many people still write new Date().getTime(), .valueOf() unary + etc regardless
 
@Zirak Are you coding in logo ?
 
well yes you would expect that, do you really think .charCodeAt() calls a function for example?
:P
 
4:20 PM
@dystroy He's ordering a jar of pickles on eBay now
He's nucking futs
 
I never call getTime() unless I need to output it
 
@Micael that's cause you're pro
Java PHP and eclipse are pro tags. So I can tell
@Esailija how would you gercharcode without it? It's not like you can + an indexer, can you?
 
@BenjaminGruenbaum You should keep a date in its object form, unless you need to output it in some way.
You shouldn't be passing around timestamps in your code, you should pass around Date objects.
 
@Michael, good advice. Why?
 
@BenjaminGruenbaum you wouldn't
 
4:28 PM
@BenjaminGruenbaum Because it gives you more flexibility. By keeping the date in its object form, you can do things such as retrieve the various time components that make up the date (such as month and year).
 
@Michael fascinating, please continue.
 
@BenjaminGruenbaum well you can use [] indexer on strings
but charCodeAt is order of magnitude faster
 
There are a number of other methods attached to the Date object that can be useful. If you just have a number that represents a timestamp, you do not have access to these capabilities.
 
enterprise IT is moving our servers around and shit's breaking
 
I just love how unintuitive it is
 
4:29 PM
(in production)
 
@Esalija , that just returns a string and you're back where you started :p
 
@Esailija charCodeAt is order of magnitude faster than [] ? (too lazy to jsperf)
 
@BenjaminGruenbaum err, I mean charAt.
 
@Michael like what?
 
str[x] === str.charAt(x)
 
4:31 PM
Yeah, both still return a string
 
but the "function" is order of magnitude faster
which can be unintuitive
 
@BenjaminGruenbaum Benjamin i just told you
Like getMonth() and getFullYear()
 
I see [] being a little faster (but mostly the same speed)
 
Manipulating 'char arrays' in JS still sucks in node ;)
 
you are doing jsperf wrong
always make separate global functions for your tests
 
4:34 PM
any clever way to have text-ellipsis also in a vertical direction via css ?
or more accurate, have text-ellipsis after the available block of an element was filled as much as possible via css
 
@Esailija I don't see what you mean. this gives the same result.
 
those are not global functions
 
not an order of magnitude faster in this situation though
when I ran bleeding edge v8 though, I saw 1 ms vs 5ms
 
@Michael Fascinating, so I should use objects all the time?
 
4:36 PM
And push will relativize the speed difference
 
@jAndy turn monitor 90 degrees :P
 
@Esailija On chrome I get exactly the same result than in my precendent test, that is [] a little faster.
 
@dystroy it seems you have chrome 25, looking at the charts
 
@BenjaminGruenbaum As much as possible.
 
look at the chrome 27, that's mine
 
4:37 PM
@Michael So, new Number(1) is good?
 
@BenjaminGruenbaum wat? :P
 
@Esailija ?
 
why would you use new Number
 
@Esailija Devil's advocate?
 
@Esailija To troll the guy who has been trying to teach me why I should use dates in JS for the last ~20 minutes (no one dare make a -21 joke)
 
4:40 PM
I am not following
oh
 
Follow that conversation a little back
:P
 
@BenjaminGruenbaum In some situations, yes.
 
@Michael Awesome, so never? Cool, just what I thought!
 
The Number class contains some methods which are useful.
 
@Michael why would you use new Number(1)?
 
4:43 PM
@dystroy it is actually weird that v8 generates different code for them
 
@Michael like what?
 
obviously spidermonkey generates same code
 
@FlorianMargaine Maybe not Number(1), but maybe Number(141592653589793238462).
 
@Michael That's even dumber
 
@Michael what kind of method are you talking about?
 
4:45 PM
> When Number is called as a function rather than as a constructor, it performs a type conversion.
 
toString(2) for example?
 
The Number class has a method called toFixed which returns a formatted value that rounds to the nearest decimal.
 
All Number(1231242354) here does is convert 1231242354 to a number, which it already was.
 
1..toFixed(2)
 
Oops, I meant Number(3.141592653589793238462)
 
4:46 PM
that doesn't do anything it was already a number
 
@Michael you're mixing a 64 there
 
no new Number there, and it works.
 
@Esailija Shhh... listen to him, don't let the spec confuse you!
 
0
Q: text-overflow ellipsis without "white-space: nowrap"?

jAndyI was wondering if there is any clever way, to achieve the css ellipsis effect without the need to apply white-space: nowrap also. In other words, lets say we have a block element of a certain height and we'd like to let it get filled up with text-content, but the ellipsis should get applied as...

 
!!> new Number(3.141592653589793238462).toFixed(2);
 
4:47 PM
@Michael "3.14"
 
@Michael You may stop posting now
 
@jAndy @BoltClock
 
!!> Number(3.141592653589793238462) == 3.141592653589793
 
@dystroy true
 
!!> 3.141592653589793238462.toFixed(2)
 
4:47 PM
@FlorianMargaine "3.14"
 
@FlorianMargaine No, you need to wrap it with a Number, come to think of it, wrap that one with a Number too
 
My point is that the data that is passed around internally in your program should be in an unmarshalled, "pure" state.
 
new Number(Number(Number(3.141592653589793238462))).toFixed(2);
^ best practice
 
return new Boolean( value ).equals( Boolean.TRUE ) ? Boolean.TRUE : Boolean.FALSE;
^ best practice
 
-_-
 
4:49 PM
so you'd use new String("hello").toUpperCase()?
 
Damn... Konqueror is slow... What JS engine does it have ?
 
You guys, listen to him. He is like, an eclipse expert
 
No, there's little need to explicitly instantiate String objects because they are part of the syntax. Same with numbers and the Number class.
 
@BenjaminGruenbaum stop being so condescendent
 
yea ben
always such an ass
 
4:50 PM
xD
 
@Michael but.. you just said that using new Number was best practice
 
@FlorianMargaine You know you love me.
@FlorianMargaine When people say dumb stuff, they deserve to be mocked. Don't say dumb stuff and you won't be mocked, simple as that.
 
@FlorianMargaine No I said that there may be some reasons why you'd want to use Number, but generally, there's little need to.
 
try this:
eval('2+2')
eval(new String('2+2'))
 
@Michael then I reiterate: in which case do you want to use it? I want to know what the "little need" is.
 
4:52 PM
mind = blown
 
Using Date is more useful, however, because Javascript does not have any sort of special syntax that allows dates to be defined in-line.
 
@redline Why are you eval'ing an object?
 
boom, there it is!
 
@FlorianMargaine When you need to round a floating-point number.
 
@Michael example?
 
4:53 PM
@BenjaminGruenbaum winner winner chicken dinner
 
don't say toFixed
6 mins ago, by Florian Margaine
!!> 3.141592653589793238462.toFixed(2)
 
I love the concept of 'rounding to the nearest decimal :)
 
Stop putting all those digits, js numbers can't use all of them
 
I'll just use Math.PI then :P
 
@FlorianMargaine Number(Math.PI)
 
4:55 PM
no kidding
I'm wondering how v8 does calculations with Math.PI now
 
!!> Number(1e+666)
 
how far does it calculate PI? with how much precision?
 
@dystroy "Infinity"
 
It's just another float
It's a constant :)
 
@FlorianMargaine I think it would be wrong not to use a standard number. That would be unexpected.
 
4:55 PM
that's so irrational!
 
with how many numbers after the dot?
 
:P
 
@redline PI is a rational number, in fact it's 3 :P
 
@FlorianMargaine Why not?
 
@Michael because you don't need Number, just as you don't need String when using toUpperCase
 
4:56 PM
@BenjaminGruenbaum it's close enough :P
 
var n = 1.2345
console.log(new Number(n).toFixed(2));
 
!!> 3.141592653589793238462.toFixed(2)
 
@FlorianMargaine "3.14"
 
%SetProperty($Math,
               "PI",
               3.1415926535897932,
               DONT_ENUM |  DONT_DELETE | READ_ONLY);
 
!!> eval('2+2')
 
4:57 PM
^ How V8 calculates PI
 
So numbers are automatically instantiated into objects?
 
@redline 4
 
!!> eval(new String('2+2'))
 
@redline "2+2"
 
Find your answer @JanDvorak is a pleasure... :p
http://stackoverflow.com/a/13344180/1461682
 
4:57 PM
@Michael yes. Just like strings.
 
@Michael google auto boxing
 
Well then.
 
@Michael that's what we're trying to tell you since 30 minutes...
 
4:58 PM
!!> Math.PI.toFixed.call(Math.PI, Math.PI)
 
@dystroy "3.142"
 
@Michael :)
@dystroy IIRC that's even specced (calling Math.toFixed with a non-integer number)
 
@dystroy your code is Number.prototype.toFixed(Math.PI, Math.PI)
 
Hey, I know that...
 
@dystroy I mean I thought that happens, but wasn't sure. That's usually the context of when I use IIRC :)
 

« first day (968 days earlier)      last day (3987 days later) »