« first day (922 days earlier)      last day (4025 days later) » 

2:00 PM
@AmaanCheval not the same, img just needs to be equal to or greater than
 
@HerringtonDarkholme 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.
 
@BillyMathews Yeah, but that can't happen if the aspect ratio doesn't allow it, can it?
 
You just hit ctrl + shift + u and then the unicode char code.
 
Yes. Yes it can :p
 
2:00 PM
How?
 
b/c it can be bigger
 
@OctavianDamiean Doesn't for me -.-
@BillyMathews Oh, right. I assumed you didn't want to crop any of it out of the parent's height
 
I need width & height to both be > parent width & height
 
...that's brilliant!
 
Yeah I do :p
 
2:01 PM
I never knew about that
 
@Zirak?
 
2 mins ago, by Octavian Damiean
You just hit ctrl + shift + u and then the unicode char code.
 
It works for me in the browser, but not in ST2
 
3 mins ago, by Octavian Damiean
@Zirak Well, all I know is a workaround. ST has a ctrl + shift + u binding which you can disable to get the native linux unicode enter mode.
 
Aaaah
Smart idea
 
2:03 PM
You can simply rebind it.
 
♪ what a lovely day
 
@BillyMathews Use something like imageWidth = parentWidth and newImageHeight = oldImageHeight * (newImageWidth / oldImageWidth)
 
damn, still no one knows what i'm doing wrong?
 
FWP: I don't really know any unicode-charcodes ;_;
 
2:06 PM
Where newImageWidth is clearly parentWidth
 
E = h ν = h c / λ
huzzah!
and there was much rejoicing
 
@AmaanCheval I was going to use hieght: auto
 
@Zirak Yea just wonderful. One of my cats caught a bird and injured it so badly that I had to go to a vet. The doctor couldn't do more than to put it down. :(
Amazing day.
 
That's one less amazing aspect of the day
 
:( I just want to cry.
 
2:07 PM
@BillyMathews Don't know if that'd work or not
 
That poor little fella died in my hands.
 
CSS isn't my cup of tea
 
I'm a bit down.
 
@OctavianDamiean hugs
 
@OctavianDamiean that happened to me when I was 6... and my dad killed it (was the humane thing to do) ... but I found it... and named it... I cried for days
 
2:08 PM
Hundreds of people also died today out of starvation, thirst, poor sanitation and "simple" diseases. Millions live without clean water
It's the little things that count
 
@OctavianDamiean the bird died, or the cat?
 
@AmaanCheval handling JSON isn't my cup of tea. I love CSS.
 
@JanDvorak The bird died.
 
@OctavianDamiean if ever there was a perfect time to start drinking.....
^ I kid
... kinda
 
@rlemon He's allergic
 
2:10 PM
If I do var images = $('img')
 
"LLoyd, Petey didn't even have a head!"
 
and then do if ( images.width() < images.parent().height() ) {
 
@rlemon I can understand that. It fell asleep in my hands and I felt the heart beat reduce until it finally stopped. Such an unreal moment ...
 
@BillyMathews I don't know much jQuery, but I'm pretty sure images will be an array of elements
 
@OctavianDamiean my dad took it back into the bush and snapped it's neck
 
2:11 PM
will it return true if ANY images are < their parent?
 
And I don't know if images.width() will default to checking the first one or not
 
was too young and injured and no mother would have taken it back
 
@BillyMathews Nope, you'll have to loop through them
 
Yeah
OK
 
2:12 PM
@rlemon It must have been quite a peaceful death, anesthetic overdose.
 
has anyone got an idiot proof get json (jsonp) and do something with the response?
 
I hardly even know what json is >.>
 
jsonp is inherently unsafe
 
Java script object notation..?
 
Im jason
 
2:18 PM
^ he's right
 
I need to access a list cross domain.
 
@mikedidthis What do you need?
@mikedidthis Both of them under your control?
 
@BillyMathews ... with padding
 
2:19 PM
padding?
 
Match the key and get the URL.
 
@BillyMathews yeah, it's json wrapped in a callback-function
 
Thats all. Well I say thats all I have been trying for the last hour. :(
 
so you can access it over cross-domain
 
2:20 PM
yes @GNi33
 
ok
 
scroll down to the fire() function
 
it's a totally different approach, since you can't use an XHR-call to do that
 
see the ondestroy method in the emitter.create object?
i'm never seeing those particles.
 
@GNi33 Like I said.. I don't even really know what JSON is :p
 
2:21 PM
@Loktar if you scroll to the very bottom and c+p that code into your console (the commented ones) you will see the EXACT same call works :/
 
I've used it once to transfer some data from PHP to JS but I didn't know what any of the code meant..
I guessed json_encode()
 
JSON === JavaScript Object Notation
 
Yeah I am not transferring, just reading.
 
0
Q: Jvector Map add/remove function shorten code

Dawid van der HovenI am achieving a hover state per continent through: var continentId ="" function getID(continentId){ jQuery.each(mapObject.mapData.paths, function(i, val) { if (val.continent == continentId){ continentCodes[i] = "#3e9d01"; mapObject.series.regions[...

 
@rlemon I said that a minute ago
 
2:22 PM
I wasn't paying attention a minute ago
 
I don't know what it is - but I do know what it stands for
But I guess then I do know what it is but..
I couldn't work with it xD
 
118
Q: What is JSON and why would I use it?

BenSorry for asking what may well seem like a dumb question. I've looked on wikipedia and Googled it and read the official documentation, but I've still not got to the point where I really understand what JSON is, and why I'd use it. I have been building applications using PHP, MySQL and Javascrip...

 
I have been educated :')
@mikedidthis did you use debounced?
 
Not in Pierre no, I think I used a timeout.
 
ever?
I can't get it to work >.>
 
2:27 PM
No I didn't even use that, I used a custom event
 
it's pissing me off man! I can't figure out why my particles are not being seen :/
 
@Loktar same
 
@rlemon are you talking about your game?
 
shit sry working on shite at work :(
 
@rlemon maybe they are hiding because they are scared of th turret
 
2:29 PM
I thought it was my update function... but I don't see what could be wrong in here
 
"WE NEED THIS FIXED OMG!"
 
    update: function (ctx, width, height) {
        this.particles.forEach(function (particle, i) {
			if( particle.destroy === true ) {
				var old = this.particles.splice( i, 1 );
				old.destroy && old.ondestroy && old.ondestroy.call(old);
			}
        }, this);
        this.particles.forEach(function (particle, i) {
            particle.draw(ctx);
            particle.update();
            var collision_partner = this.check(particle);
            if (!this.in_view(particle, width, height)) {
 
@BillyMathews I used this: stackoverflow.com/a/2996465/2312574
 
Yeah thats a good one
It would be excellent to throttle it though
 
Yeah probably.
 
2:34 PM
Sorry for the kind of off-topic question...
0
Q: div does not get centered using `margin: auto` in IE9

ubikI am trying to get a centered in the space that is left empty by a sidebar. This is how I'd like it to look like: I actually managed to make this work OK for most browsers using margin: auto for the div in question, while setting overflow: hidden: Fiddle #header { height: 50px; back...

if someone has any idea... :)
 
@swetha 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.
 
I copied all of the code and put a console.log() inside the function at the bottom, under the usage //comment
 
and just gives me Uncaught TypeError: Object [object Object] has no method 'smartresize'
 
I think I deserve to go make myself another coffee :)
 
2:37 PM
@rlemon, nice, enjoy your coffee ;P
 
!!/mustache ubik
 
holy pixels batman!
 
!!/mustache rlemon
 
2:38 PM
 
@rlemon Nice!
 
Hey everyone!
 
 
Yay! chatbot
 
2:41 PM
hehe awesome stache
 
!!/listcommands
 
!!help
 
@Neal Yes, absolutely
@Appu help, listen, eval, live, die, refresh, forget, ban, unban, info, jquery, choose, user, listcommands, purgecommands, norris, urban, parse, tell, mdn, awsm, beautify, convert, define, get, google, hang, inhistory, karma, learn, 420, 5318008, bewbs, i_am_a_robot, aliens, ym, format, happynewyear, tell2, 3point14, camel, ihatelanadelrey, fa, vk1, vk2, rlhd, popcap, knock, say, heybuddy (page 0/2)
 
!!/camel
 
2:43 PM
I don't know what you were expecting
 
@rlemon Found a bug: Let ~50-100 blue balls build up, then start shooting. The balls stop colliding.
 
@rlemon Me?
 
@SomeKittens yea I noticed that
and I know why as well
 
alright, my head isn't working anymore it seems
 
Shrapnel particles get passed through
so it's like... unexpected expected results
 
2:45 PM
what's the best way to deep-clone a object? there's a function, right?
 
but Shrapnel also passes through things
so it can create barriers for the NPCs
I just have to think up good rules for the collisions and shit
I think my idea of supporting this all via callbacks is the right one
@Appu yes.
!!/inhistory
 
@rlemon 1972 – Vietnam War: Nguyen Hue Offensive – The North Vietnamese 320th Division forces 5,000 South Vietnamese troops to retreat and traps about 2,500 others northwest of Kontum.
 
@GNi33 Nope, write your own or use a library
 
@GNi33 Built in? Nope.
 
today was not a good day
 
2:47 PM
@rlemon This is the first time in this room for me and first time with this bot. So, I am just checking whether what it gives if I type that camel. I expected that it would post an image on the wall itself. But it gave a link pchh..
 
really? holy crap, so i guess i've always written my own one in past projects
my head needs coffee i think
 
@Appu yea thats a limitation atm, user taught commands must be said to someone. so the onebox doesn't show
11
Q: How to Deep clone in javascript

RaynosHow do you deep clone a Javascript object? I know there are various functions based on frameworks like JSON.parse(JSON.stringify(o)) and $.extend(true, {}, o) but I don't want to use a framework like that. What is the most elegant or efficient way to create a deep clone. We do care about edge...

 
I'll just use jQuery's extend for now
 
sigh
Three to four more hours to go. :/
 
2 or so more hours
 
2:51 PM
What are you doing?
 
Working on a game I'm not really interested in
How about you?
 
if (typeof Object.extend !== 'function') {
    Object.extend = function (d, s) {
        for (var k in s) {
            if (s.hasOwnProperty(k)) {
                var v = s[k];
                if (d.hasOwnProperty(k) && typeof d[k] === "object" && typeof v === "object") {
                    Object.extend(d[k], v);
                } else {
                    d[k] = v;
                }
            }
        }
        return d;
    };
}
no need for jQuery
 
Working on our project.
 
@rlemon Okay.
 
@OctavianDamiean The modal based website? :P
 
2:54 PM
!!/beautify rlemon
 
@GNi33 http: //jsfiddle.net/rlemon/NYHqY/
 

Sandbox

Where you can play with regular chat features (except flagging...
 
@AmaanCheval Yea. :(
 
^ for playing with commands if you want
 
@Appu lol
 
2:55 PM
also, fuck you i'm fabulous.
 
API design question: Some of my methods are n-ary and also accept an array (so foo(0, 1, 2) === foo([0, 1, 2]). However, in other methods, I need to have extra info, that is bar(0, 1, 2, 3) ≈ bar([0, 1, 2], 3).
 
@OctavianDamiean Aww. Are you the only programmer working on it?
 
@Appu What do you want to beautify there? I mean look at him.
 
bar([0, 1, 2], 3)
 
Should it be implemented like that (special information chopped from the end), or should these only accept an array+info, or should I only accept an array (as data) for everything?
 
2:55 PM
@AmaanCheval Yea.
 
Something which isn't there :P
 
I mean i'm no FPJ... but I am pretty awesome
 
@Zirak Array + info, depending on the data (if info is significantly different from the array data)
 
I like array + info as well
 
Yeah, I'd say array + info too
 
2:57 PM
partly because most of the APIs I deal with implore this type of design
I'm used to it already
 
And what if info is optional?
 
Yeah. If you think you are awesome, who denies it? And yeah you are no FPJ
 
@Zirak even better
 
So always accept an array, no n-arity
 
@Appu but who would want to be FPJ... wait.. nvm, I overspoke :P
 
2:59 PM
Hi, I have a question about BootStrap. When the site is viewed on a mobile, it reduces the navbar to have just the branding and a symbol which when clicked uncollapses a menu.. the default bootstrap function... however i'd like to re-collapse the menu when an item is clicked manually using jquery... any ideas?
 
I can see it :P @rlemon
 
@nitstorm should be in the docs
 

« first day (922 days earlier)      last day (4025 days later) »