« first day (1322 days earlier)      last day (3643 days later) » 

9:00 AM
Morning
!!>Math.round(1.4999999999999999)
 
@IonicãBizãu 2
 
!!>Math.round(1.499999999999999)
 
@IonicãBizãu 1
 
Why?
Is this happens because of floating point?
343
Q: Is floating point math broken?

Cato Johnston> 0.1 + 0.2 == 0.3 false > 0.1 + 0.2 0.30000000000000004 Any ideas why this happens?

 
I say meh.
What happened to my image? ...
Failed to upload image…
There.
 
9:09 AM
!!> 1.4999999999999999
 
@SomeGuy 1.5
 
That's why
And yes, it's because of floating points
 
Does anybody like my red circles?
 
Hola
 
Hi
And goodnight.
 
9:20 AM
@SomeGuy I think you'd enjoy Hitch-22
@rlemon ping
@rlemon Ping!
@rlemon PIIIIIIIIIIIIIING!
 
9:34 AM
oh dear somes going to get himself muted
 
@bjb568 my monitor is HUGE 24" and that looks gorgeous
 
@DrogoNevets Inside joke
 
@monners oh i missed u :D
 
@AbhishekHingnikar Lookin' pretty slick
 
9:44 AM
It's almost like a better version of Microsoft's metro theme
your app
I'll have to give it a look on one of my 27" monitors when I get home :P
 
@AbhishekHingnikar nice to see im not the only one with taskbar on the left!
 
Ugh, I don't know how you guys do that
Are you running dual displays?
 
@AndreasHage 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.
 
@DrogoNevets I do that even on mac
@monners oi my app is far from metro now
 
@monners Yeah, I've added it to my reading list
Sounds pretty interesting
 
9:52 AM
the new design is actually a timeline where u can zoom in and zoom out
with pinch gestures in realtime
 
Did you start with the Chaos Walking series?
 
not like microsoft's snap zoom ugh
 
hello all!!!!
 
I'm the only one in the office :(
 
9:54 AM
damn... photography !
@monners i am my office :'(
 
I'm at the office as well
 
@AbhishekHingnikar That's... Awesome!!!
 
first pipe and coffee
 
@sunman 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.
 
pipe?
 
9:55 AM
hello
 
Greetings and salutations
 
pipe
 
i am facing a problem form last 12 days but could not got any proper solution in dojo chart
 
@sunman whats the problem?
 
0
Q: Is any jQuery version compliant to Promise/A specifications?

Pulak Kanti BhattacharyyaAfter going through several articles I have come to know that promise implementation is there in jQuery. But I am not sure whether any version of jQuery is Promise/A compliant or not.

 
9:56 AM
0
Q: Dojo chart issues in clusterd column chart

sunmanFirstly say to all of you i am new to dojo charts. I made a dojo clustered column chart. Here i am made different series for show clustered chart. But here is my graph shows different color for different bedrooms with their respective project name. But i want my graph shows like different project...

 
I'm smoking a lovely Macbarn aromatic tecon-gmbh.de/images/…
 
@vimes1984 i attached my question ??
check it ?
 
yeah reading now
 
ok thank you
 
@sunman you want a sql written?
I don't get what you want...
 
10:06 AM
@vimes1984...I want this type of graph jsfiddle.net/sunman/raWcg
@vimes1984 but my graph shows me jsfiddle.net/sunman/rV9g4
@vimes1984..here i want in my x-axis label it will shows bed 1 ,bed 2 ,..like this
 
but in my code it shows me in my x-axis project name
now u got my point what i want
 
@BSG 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.
 
not really no you want it to say bed1 bed 2 on the bottom?
 
10:09 AM
yes
 
in jsfiddle i shows some static data ..
 
just change your sales var to match the sales var on the other one...
 
@vimes1984 i want it through dynamic form my database
 
10:12 AM
ok then you need to write a sql query to query the db then convert it to json and pass it through to the sales var...
 
@Qantas94Heavy What do you need?
 
yes i have already write the sql query and also convert it into json and pass it through salea var ..
 
@sunman I've moved over to a seperate room
 
@vimes1984...but my graph not shows like tthis jsfiddle.net/sunman/raWcg
it shows me by project
 
the n your sql query is wrong
 
10:15 AM
@vimes1984...in which room u moved
 
@sunman You've got his attention. You don't need to prefix every message with a ping. It's really annoying
Isn't that right @AbhishekHingnikar
@AbhishekHingnikar well?
 
I was looking for a polite way to say just that
 
@AbhishekHingnikar Isn't it?
 
@monners what ?
@monners o
 
10:16 AM
irony lost on some...
 
@monners i
@monners c
@monners u loving this ?
@monners u want more ?
 
MOAR!!!!
 
@monners oh yeah baby
lmao
@monners i know u like punishment but this is bdsm to the next level !
more like PDSM ..
sammarkiewi.cz <@monners what genius !
 
@DaViDa 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.
@HbV2 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.
 
hello, anyone over here that knows about google maps api v3?
 
10:29 AM
ive used before
whats up?
 
@davida I've done quite a bit with it lately
the places API is a bugger
 
Cool, well Im new to it, and integrated it in a webapp. But now I would like to make it possible to click on the map and by click place a marker. All markers have to be unique as they will contain different info. How would I do that?
 
@vimes1984 nah just has to be used right
@DaViDa add a click event to the map, and within that function add a marker, there are plenty of examples of adding markers on the website
and of adding a click event
 
yes but then I would need to give the marker coordinates allready?
 
go for infobox
 
10:33 AM
no, you can get the co-ordinates from the click event
 
it's a really good maps library for styling and using infoboxes
 
@vimes1984 your changing the sec, he asked fo rmarkers, no an infobox
the best way IMO to incorporate maps is with leaflet.js
 
@drogoNevets I stand corrected your quite right !
 
@vimes1984 ;)
 
google.maps.event.addListener(map, 'click', function(event) {
placeMarker(event.latLng);
});
if you console log the event it'll show you where you have clicked
 
10:37 AM
hi guys i m facing "Script5: Access denied" problem on IE9 for file uploading, using jquery file uploading
any solution?
 
@simanchala will need considerablly more info than that.......got a jsfiddle that replicates the issue?
 
@DaViDa the answer was buut given to you ona plate
just read about assigning a click event to the map first
i just lost the game!
!!game
 
@DrogoNevets That didn't make much sense. Use the !!/help command to learn more.
 
10:41 AM
okee thanks!:)
 
10:57 AM
@daviDa how did it go?
 
11:11 AM
@Mr.iC 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.
 
@monners WHAT!?
 
ASR
how to give some space between each row ? this is my fiddle
http://jsfiddle.net/YQ48p/
 
what was the website to find similar font-faces ?
g-type.com/precious-sans-two-font <- i love this but this price is abnoxius
 
Is there a way to check in JavaScript if a string/int is base64 encoded?
 
11:27 AM
@Script47 try{ parsing }catch(error){ so its not }
 
@Script47 It's a common problem, but unfortunately there's no really good solution, since base64 is a representation of what could be anything.
 
but again you can parse this as base 64
 
I found that encode(decode(input)) === input and as Abhishek mentioned above, trying to catch a parsing error, is probably the only real way
 
Is there an alternative to base64 in JS which could be used?
 
What are you trying to encode? For what purpose?
Base64 is for representing binary data in printable characters
@SomeKittensUx2666 How to cheat: Console -> Change frame to first one -> alert()
 
11:35 AM
@Zirak I am using localStorage in a game to save data, as I find it quite easy to use. So I thought there isn't a set way to stop cheating and it will always happen so why not just make it harder, so I would encode the save data then when using it again I would decode it.
 
If you know it's encoded, decode it. It's the user's fault if he fucks around and screws himself.
 
@Zirak I thought that too haha, but that's why I want to check if it is not base64, because if it is messed up then I can reset the data.
 
The above suggestion, then.
 
Thanks. :)
 
You can should also check the output, since I'm guessing save data has some pre-defined structure
 
11:42 AM
@Script47 hash your data and save it as a seperate field
then check both fields.
and minify your javascript files
 
So is this what you mean? So user has 5 gold so I have two gold field one which is encoded and which isn't?
 
say your object is
{

score:
username:
f1:
f2:
}
blah blah blah
obtain a hash of this whole object serialized
and save that as a seperate field in localstorage
when loading compute the hash of the locallystored data
that should do :P
 
Thanks, I'll check it out.
 
thats more like a double check though but would confuse a lot of 'noob' script kiddies
 
@Sumant 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.
 
11:57 AM
@monners When audigint for XSSs like that, I usually just insert every possible weird character I can muster (basically, all control charactrs, all parentheses, mix in with unicode letters, etc) and see how it behaves. Do it enough, and you can find your way out (unless there's real, proper encoding).
 
I think I'm going to go with @Zirak option, encode the data and then if they mess with it their fault.
Just have a reset data option if they need it. :P
 
One more close vote, please :
-4
Q: Removing class from elements css selector vs $.each

TautvydasSo here's situation: I have big amount of html elements, lets say <li></li> and one or more of them may have class lets say class="HaveIt". I have to remove that class from those elements. Whats the better solution to do this: a) $('li').removeClass('HaveIt'); or b) $.each($('li.HaveIt'), fun...

 
MGE
12:17 PM
Hello everyone, how can I get via jQuery when an img width or height change?
 
@gnat Now it should be clear, even for readers like you. :) — Neil 19 secs ago
 
@AlexanderIvanov 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.
 
Bit of an asshole, ain't he?
 
@MGE you mean it's resized ?
 
MGE
12:25 PM
yes, I have and img tag, that the src can be replaced
and I want to detect the change
sorry
can be resized
thanks
$( "#cropform" ).resize(function() {
    alert( "Handler for .change() called." );
});
it doesnt work
 
When using this expression:
[A-Za-z0-9+/=]
Why do I get Uncaught SyntaxError: Invalid regular expression: missing /
 
@MGE Make sure you're binding the event before the image gets resized
I'd also do $("#cropform").on('resize', function() {} );
 
MGE
$("#preview").on('resize', function() { alert('changed')} );
it doesnt work
 
@Script47 / ends the regular expression. You need to escape the one inside the square brackets.
Also: \w is the short form of [a-zA-Z0-9_]
 
@Sivagnanam 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.
@Chris22 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.
 
12:37 PM
i want to own the domain
 
Tot
Hello there !
`var A = function() {...} ; A.prototype = {...} ; var a = new A ;` What is `a` precisely ? Is it a prototype-kind instance ? Or a class-kind instance ? Or else ?
 
attheratemynamedotcom.com
and then have an email as
hashcolon@aththeratemynamedotcom.com
 
@MGE I dunno how you're resizing, but if you're doing it programatically, you can call trigger('resize') to explicitly call the resize event. See: codepen.io/ThirdSign/pen/KABEa
 
∆/
Sup Squares?
 
@Tot What do you mean?
a is the result of cloning A.prototype and running the function A against the aforementioned clone.
I should really write a gist about this...or find a decent article explaining it.
 
12:46 PM
I'll make a blog. You can be my guest writer.
 
And then we can both never publish anything to it.
 
Tot
I'm wondering if it is correct to call A a class. I see this on many libraries.
 
Right @SomeKittens and @SomeGuy?
 
@Tot It's technically a constructor function
 
@Tot Well, it's not a class as you see in Java and the likes.
 
12:47 PM
'class' isn't a defined thing in JS
 
Tot
Yeah indeed.
 
...yet
 
It is a class in the sense that it's responsible for creating objects.
 
Tot
And would it be correct to call it a Prototype ? Or the prototype is only the set of methods ?
 
A.prototype is the prototype of a. They made a mess of the terms...
Which is why I suggest Object.create all the things over new
 
!!tell Tot mdn Object.create
 
you sure you don't want to contribute to that?
 
@rlemon Seeing as how we have javascriptroom.com and thejavascript.ninja...
 
but... but... you like to cuss a lot in your articles
it is the perfect place for you
 
12:52 PM
What will you write in your new blog?
 
Tot
Alright. The point is that I'm doing a library to create constructors with prototypes in a cleaner way. But I'm still hesitating on the vocabulary.
 
function JavaScript(motherfucker) {
  return "DO YOU SPEAK IT?!";
}
 
Tot
So the only correct name of A would be "Constructor" then, nothing else could suit it ?
 
Yes. A is a constructor, A.prototype is a prototype.
Well, everything is a prototype.
 
Tot
Ah ? What do you mean ? :)
 
12:54 PM
def Python:
    "motherfucker"
    return ["DO YOU SPEAK IT?!?!?"]
@Zirak it has so many applications
I can't contain myself.
 
You'll get a syntax error
@Tot In a prototypical language, you can create objects out of other objects. For instance: var o = {}; var derived = Object.create(o)
In this case, o is the prototype of derived
 
Tot
Ah alright. And everything is an object, so everything is a prototype. Right ?
 
@Tot s/is/can be/
but prototypes should be immutable lest you'll face weird bugs
 
Tot
`var A = new Prototype({ ... }) ; var a = new A, a2 = Object.create(A) ;`
Does it sound logic with "new Prototype" ?
 
I...don't...wha
 
12:59 PM
what would Prototype do?
 
You have two ways of doing stuff: You have the crap they put in ES3, and Object.create in ES5
 
@Zirak by the ES3 way, do you mean new?
 
The new syntax along with func.prototype.shit was made to appease the Java community. There's still prototypical inheritance there, but it's hidden
 
Tot
Ah alright. :)
 
Object.create is the purer way of doing it.
 
Tot
1:00 PM
Then :
 
If you're using ES3 syntax, then you're using constructors. If you're using ES5, you're just using objects everywhere (which is, imo, a Good Thing™)
 
@Zirak I like new
 
Why?
 
I mean, if you want a class, new reads better than Object.create
 
Tot
`var A = Prototype({ ... }) ; var a = Object.create(A) ;`
Here, Prototype would create a new type.
 
1:03 PM
Types? What is this?
You're not in Kansas any more
@JanDvorak And a class is...? A prototype?
An object?
 
Tot
A isn't a type ? Like typeof a returns "A" ?
 
Again, crap to appease the Java community
typeof and instanceof...blegh
 
@Zirak a datatype with specified methods; normally implemented through prototypes
 
the people in the background are annoying
but the singer is good
 
1:05 PM
@Zirak what's wrong with OOP?
 
Those have nothing to do with OOP
 
Tot
Ah, then "typeof" is evil too ? xP
 
They have everything to do with taxonomy and type systems
 
Tot
Oh and I think I meant "instanceof".
 
Java has new Sth, Ruby has Sth.new, python has new Sth (IIRC), what's wrong with having new Sth in javascript?
 
1:06 PM
Must I repeat my arguments every time?
bah, do whatever you want
 
Write a gist, will save time in the long run.
 
as in, use new to implement OOP?
 
Also, I like reading your gists.
 
and then I can steal it and post it on my site
:)
 
Everyone wins.
 
Tot
1:08 PM
Well, I don't mind using Object.create instead of new.
 
hmm... true
 
@rlemon Nice
 
!!mdn isprototypeof
 
(new Object).constructor.create(); // best of both worlds.
@RyanKinal I was seriously impressed by it
you should try for a cover
 
Tot
1:10 PM
I would like to do something like this : https://github.com/tnhu/jsface
But in an other way, and it could be with "Object.create" then too.
 
you like cold beer!
 
Tot
What do you think of this library ?
 
I do!
 
Tot
I just don't like the fact that it's all about "classes" that don't exist in JS.
 
!!> "hello" instanceof({prototype: String.prototype})
 
1:11 PM
@JanDvorak "TypeError: invalid 'instanceof' operand ({prototype:(new String(\"\"))})"
 
@Tot but Class like objects are a real thing
 
@Tot for me, classes are conceptual rather than actual
 
FOR REAL!
 
Tot
Ah, that sounds interesting. ;) But I'm still not sure.
 
So, after some objects are created with (for instance) obj1 as their prototype, we could modify various properties (functions, mostly) on obj1 and change the functionality of those objects. I think this is a potentially cool feature, but I can't figure out the use case.
(and totally not self-promotion at all)
(okay, I'm lying)
 
Tot
1:20 PM
Hé hé. :P
 
s/cool/exteremely confusing/
 
Yeah, that too
 
it's still nice for instrumentation
 
Define?
 
such as logging every function call to a certain function
 
1:22 PM
Hmm. Yeah, that could be useful.
 
o.func = (function(){return function(oldFunc){...; oldFunc.apply(this,arguments); ...}})(o.func)
basically, normally you want to make changes to default functions as quickly as possible and only once
 
gist.github.com/rlemon/251237559c347561f0d7 @JanDvorak just need to add a toggle button to the interface now
 
I'm wondering if it would allow a nice asynchronous queue implementation without promises, though.
 
I think that's the way it usually works, yeah
 
@rlemon want me to fork and pull-request?
queues with promises are really easy:
 
1:27 PM
it is a gist. :P I never take them as seriously.
so you can do which ever :)
 
Really, though, I'm imagining functions that evolve over the run time of the program. New situations/states come up, and they're incorporated into the functions themselves, rather than taken into account by the functions.
 
Tot
@RyanKinal Okay I've read it. Thanks for the link !
 
No problem :-)
 
var queue = $.Deferred().resolve().promise();
function enqueue(func){queue = queue.then(func)}
 
HI all ,

if i use this code

$("#ddlchat_cat").append("<option value=" + datas[0].cat[i]['value'] + ">" + datas[0].cat[i]['name'] + "</option>");

<option value="Hi," this is ganesh, how may i help you?>Welcome Message</option>

result is coming like this

i want result as

<option value="Hi, this is ganesh, how may i help you?">Welcome Message</option>

any suggestions please
 
1:34 PM
@wjhguitarman 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.
 
Similarly, I've often wondered in which case I would use actual, in-use objects as a prototype, rather than creating an object that is just a protottype.
 
Tot
What do you mean exactly ?
 
@GaneshPravin Your result and expected result are the same
 
@Cereal : nope see double quotes in values
 
@GaneshPravin Oh, reading is hard
@GaneshPravin try wrapping datas[0].cat[i]['value'] in ' '
 
1:42 PM
@Cereal : also results in same
 
Yeah, HTML attribute values should be wrapped in quotes. Yours is not, thus it tries its best, and decides that everything up to the next token is the attribute value.
"<option value='" + datas[0].cat[i]['value'] + "'>" + datas[0].cat[i]['name'] + "</option>"
^ is that what you did?
 
@RyanKinal thanks its working .
@Cereal : thanks for your help :)
 
@Tot So, for the most part, I create an object that is then used as the prototype for more objects, which are then used for actual things - the prototype is rarely ever used directly.
However, I could conceivably use each of those child objects as the prototype of another object, and keep using all of them directly.
 
Tot
You mean mixins ?
 
Not really... maybe I can demonstrate with some code.
 
Tot
1:52 PM
Yeah, I'm a bit puzzled with all those protos. x)
 
var opt = document.createElement('option'); opt.value = datas[0].cat[i].value; opt.textContent = datas[0].cat[i].name;
y u no do it right?
 
// make a ball
var ball = {
	radius: 2,
	bounce: function() {
		// do stuff
	}
};

// use the ball
ball.bounce();
ball.radius = 4;
ball.bounce();

// hmmm... I need another ball
ball2 = Object.create(ball);
ball.bounce();
ball2.bounce();
ball.radius = 6; // ball2's radius changes too
ball2.bounce();

// etc. etc.
 
@rlemon but mah jqweery
 
@rlemon You're awake!
 
$('<option>').val(datas[0].cat[i].value).text(datas[0].cat[i].name).appendTo("#ddlchat_cat");
would be the "optimal" jQuery way imo
 
1:55 PM
As opposed to making a (basically static) prototype for all balls
 
HTML strings are so fucking ugly it hurts
 
Tot
@RyanKinal Ah alright, I see. :)
 
@rlemon inorite
 
@rlemon : yes yes .. thanks :)
 
also
 
1:56 PM
@rlemon So... I'm drunk
 
@monners \o/
 
@RyanKinal Shhhh
 
@Loktar performance car pushed to its limits after you manage to install all the drivers
 
@monners that was my next question. What time is it there?
 
About midnight
So, early
 
1:57 PM
@monners :whispers: hooray!
 
What's the tipple of choice?
 
@monners i'm sorry I missed your bjb drama
 
Beer, but I recently switched to vodka miced with cider
 
@Loktar why would you post that?!
 
@rlemon lol, I momentarily forgot who I was talking to
 
1:58 PM
@DrogoNevets which?
 
the video
 
Anyway, I'm ignoring him now. Shoulda done that a long time ago
 
what day is it?!
 
@rlemon Fuck you!
 
1:59 PM
better?
 

« first day (1322 days earlier)      last day (3643 days later) »