« first day (1109 days earlier)      last day (3854 days later) » 

3:00 PM
thanks <3
 
@sk16 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
 
Would this be a question that belongs on meta: "Is it possible to add in "progress" statuses in the badges section?" (I'm assuming that's been asked already though)
 
@Vadym 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.
 
ok Caprica
 
3:03 PM
@RUJordan yes and yes
 
Right.
 
@BenjaminGruenbaum i love you again now
 
@rlemon are they transforming your mind? ;D
 
no
 
3:04 PM
they are wrinkling my brain
 
That's a good thing! The more wrinkles in your brain, the more surface area there is, thus more brain logikz.
 
why does code related to an autocomplete script need to be placed before any other code/scripts besides jquery and jquery.ui
 
Quick poll: which creational design patterns do you commonly use?
 
@AaditMShah Prototypal with Object.create almost exclusively
 
3:07 PM
@JohanDettmar 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.
 
Sometimes factories, though
 
@RyanKinal I was just going to ask whether anybody uses factories. Personally I've never needed to use them.
 
It sounds like someone is drilling through the wall in the room next to me
 
good morning gentlemen
 
@Shmiddty Welcome back!
 
3:10 PM
For example if you have a Car constructor and a Truck constructor then why would you want to create a separate VehicleFactory which simply instantiates these constructors?
 
@AaditMShah they're not really necessary in JS
 
Hey @Shmiddty
 
@FlorianMargaine Precisely my point. Don't factories just increase the amount of coupling in your code?
 
@AaditMShah closure
 
how expensive is .apply ?
anyone perfed it seriously?
 
3:12 PM
@rlemon depends on the context
 
context.transform.apply(context, matrix); // vs
context.transform(matrix[0],matrix[1],matrix[2],matrix[3],matrix[4],matrix[5]);
 
@FlorianMargaine What about closures?
 
ofc .apply makes it so much cleaner IMO
 
hi all
 
@samir 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.
 
3:13 PM
but I don't want to do that at the expense of performance hit in the rendering loop
(keep in mind this is in a rendering loop)
 
@rlemon I agree. Plus apply allows for an arbitrary number of matrices.
 
Just need help in js
 
@AaditMShah afaik transform only takes 6 arguments
 
will be posting my code in a min and my issue is that the code is running in IE but not in mozilla
 
it's just a nicer looking line
 
3:14 PM
I doubt that an apply will be your bottleneck though.
 
@celsoap7 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.
 
it's a discussion i've had many times. there is no bottleneck persay, but micro optimizations can mean the difference between being able to run 1k objects animated at 60 fps and 10k objects at 60fps
 
that's a lotta micro optimization
 
@AaditMShah factory?
 
3:16 PM
@rlemon Why don't you try both and benchmark them?
 
guys look at the code
 
Also object pool sometimes
 
@BenjaminGruenbaum Factory functions - why would you need to use them?
 
Do builders and abstract factories count?
 
its working in IE but not in mozilla though I have written to handle mozilla as well
 
3:16 PM
@rlemon Why don't you try both and benchmark them?
 
@AaditMShah I will end up doing that. but I am about 20 minutes away from working code so I thought i'd ask.
 
@BenjaminGruenbaum Absolutely.
 
@AaditMShah To create different types of objects transparently based on parameter?
 
	if (window.XMLHttpRequest)
    {
        xmlhttp=new XMLHttpRequest();
    }
    else
    {
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.ServerXMLHTTP");
        }
        catch (e) {}
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.6.0");
        }
        catch (e) {}
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.3.0");
        }
        catch (e) {}
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
holy good lord!
 
@rlemon Personally I don't feel it'll make a big difference though.
 
3:17 PM
what browsers are you trying to support man!
IE Toaster?
 
@rlemon buddy I m new with JS
 
If my toaster had IE I would never made toast.
 
@BenjaminGruenbaum I still don't see why you can't simply use a constructor.
Perhaps an example?
 
so? you clearly got this code from somewhere then
 
@AaditMShah Hmm I can try
 
3:18 PM
obviously yeah
from net
 
ok well right now it is trying to support all possible versions of anything ever
that probably isn't really a requirement is it?
how many clients use IE5
 
function getConnection(abilities){
    if(abilties.WebSockets) return SocketProvider();
    if(abilities.Comet) reuturn CometProvider();
    return AjaxProvider();
}
@AaditMShah like that? ^
 
@rlemon the one i wrote earlier was working fine but then I realized that i wasnt running on mozilla so tried this funny stuff
 
@RUJordan sup
 
ActiveX ... <- IE crap
new XMLHttpRequest(); <- everyone else
 
3:20 PM
@BenjaminGruenbaum So a factory is only used to eliminate repetitive code apropos object creation?
 
I need some ideas to spice up my Lumberjack costume
 
@AaditMShah No, a factory is used to abstract creation from a concrete type.
 
@Shmiddty grindin out some pseudo-tables. Yourself?
 
@RUJordan eating a burrito
a small donkey
 
3:21 PM
@rlemon thanks dude just give me a min to go through
 
@AaditMShah eliminating repetitive code by being able to code polymorphically is a result - not the reason.
 
@BenjaminGruenbaum Abstract concepts are a bit difficult to understand. How is your getConnection factory function abstract?
 
@AaditMShah I didn't say it was?
 
@BenjaminGruenbaum when I see "WP" I think WordPress, not Windows Phone
 
@Shmiddty don't you dare tell me you're eating a burrito and not tell me what kind!
 
3:23 PM
Every time you have code that creates and returns different types of objects based on a parameter or setting - it's likely a factory.
 
Love burritos. >=(
 
Although, I try to use DI whenever I am able
 
@Shmiddty I think "well played"
 
@AaditMShah I guess I meant module pattern
 
@RUJordan sausage, egg, cheese, hashbrowns, and green chile
 
3:23 PM
@BenjaminGruenbaum Hmm... so a factory function is used to bootstrap object creation for a class of different types of objects?
 
I don't like the word class here, but yes.
 
See, now that's just delicious. I'm jealous, but appreciate the disclosure.
 
A classical non practical example might be something like this
 
@rlemon hey thats nt the one i was looking for
 
function GetMonster(type,param){
    return monsterList[type](param);
}
In Java that would be a huge switch case
 
3:27 PM
data Race = Dwarf | Elf | Human | Orc;
So in the above code you could create a factory for Race?
monsterFactory :: String -> Race
 
@AaditMShah Let's say you have a method that returns a Sword object based on the race - that would be a factory method.
Hmm, if you want to expand your knowledge I suggest the GoF book and in JS specifically this free book
 
if i want to "put" a ajax json
 
I already read Addyosmani's book. I came here as a result of reading it. =P
 
jQuery.ajax({
                    url: url_lab_data+"backend/read/{\"f_anid\":"+anid+"}",
                    type: "PUT",
                    contentType: "application/json",
                    data: JSON.stringify({"read": 1}),
                    success: function (data) {

                    }
                });
 
Ah cool :) The thing is if you care about writing good oop you use these patterns all the time anyway - you just don't call it that
 
3:29 PM
but i get in my network a canceld message
why?
 
its just abusing IE6 bt given no solution for that issue in there
@rle
 
can anybody please try to play the video in: ipallares.com/gador/… and let me know whether it works?
I am experiencing problems in iPad and from JWPlayer support they tell me it works fine for them
 
@rlemon
 
@IvánPallarés full url maybe?
 
3:31 PM
@BenjaminGruenbaum Are you on your period? You seem very irritable.
 
@BenjaminGruenbaum I think I get it now. At least a little more than I originally understood.
 
I submitted a solution to this problem: golf.shinh.org/p.rb?Numeric+Diamonds
 
it is cutting it
 
@KendallFrey Not at all, in a good mood actually :) Why?
 
but the link works
 
3:31 PM
@Shmiddty concise :P
 
@BenjaminGruenbaum Because you're acting butthurt like someone said hi to you.
 
;)
 
@KendallFrey Just moving hi messages away because the're silly. They really serve no purpose.
 
@KendallFrey Why would you be hurt if someone greeted you?
 
@Shmiddty also very subtle name
 
3:32 PM
Once I start taking male birth control, I can start being erratic a certain times of the month without judgment, right?
 
@Tobias 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.
 
@BenjaminGruenbaum If they served no purpose, why did they make it into the language?
 
lol nice name @Shmiddty
 
@KendallFrey Because there are contexts in which they do make sense. Contexts where people joining/leaving the room is not visual anyway.
 
Of course they serve a purpose. They indicate that a person is friendly toward you.
 
3:34 PM
print(read("test.js").slice(37,-2))/* 1...*/
 
If you walk up to someone and start talking, do you begin with a salutation?
Why should this chat room be any different?
Fuck, now I'm the one acting butthurt.
 
@KendallFrey I usually try to break the ice with light humor
 
^*2 if it means that much to you just move them back...
It was a joke, for @AbhishekHingnikar ...
 
Next time someone says hi to me, I'll just say "Shut up." I'll let you know how that goes.
 
!!afk movie
 
3:36 PM
@BenjaminGruenbaum Stay safe.
 
Aha! It's a vampire movie.
 
@KendallFrey well now you get no hi's from me. Dick.
:P
 
Well.....anyone can tell about the video in ipallares.com/gador/?page_id=235?
 
@RUJordan My name isn't Dick.
 
Touche.
 
3:37 PM
16 mins ago, by Shmiddty
I need some ideas to spice up my Lumberjack costume
 
More "lumber"
 
less "jack"
 
Does anybody know a good library that brings algebraic data types to JavaScript? I found this one but it has poor documentation, it's not actively maintained and the code is horrendous.
 
What's the "best" sorting plugin for jquery?
 
for(i=o=[];r=readline();)o[i++]=r
for(o=[];r=readline();)o.push(r)
[].map.call(0+gc,readline) // only up to 36 lines, excess lines up to 36 will be NULL instead of UNDEFINED
 
3:42 PM
@RUJordan The "best" under which circumstances?
 
@Shmiddty I like that last one
 
I haven't found a use for it yet
but I'm sure I will
the nice thing is that it doesn't care about whether a row is falsey or not
 
I guess I'm looking for a smooth interface. Just a simple table sort, maybe a smooth animation? I'm not really sure I've never sorted a table before
 
why the 0+?
 
because it converts gc to a string
gives us more characters
 
3:46 PM
@RUJordan Perhaps you're looking for something like sorttable? It's not a jQuery plugin though (which is actually a good thing).
 
since gc is a function (which has length already)
 
ah, for some reason I was expecting to be able to use [].map to loop through all the properties of an object
 
May I ask why it's a good think it's not jQuery?
 
print(gc.length /* 0 */, (0+gc).length /* 36 */, (''+gc).length /* 35 */)
 
I'll give it a shot, looks easy to implement
 
3:49 PM
!!> (''+Math.random).length
 
@Shmiddty "function () {\n\t\tconsole._items.push.apply( console._items, arguments );\n\t}"
 
@RUJordan It's a micro library. You can use it without the need for jQuery. Hence if you only need a table sorting library then simply use this. No need for an additional library to make it work.
 
@Shmiddty "undefined"
@Shmiddty "function random() {\n [native code]\n}"
@Shmiddty 39
 
oh?
interesting.
oh right, because the name is longer
 
3:50 PM
Is there a way to tell it which headers to exlude or does it only do all of them?
 
@rlemon now for physics!
 
@Shmiddty haha yup
gravity wind and have them explode out of something
 
and then they land in fire and flare up
 
And then they become a soft body race car.
 
and then they mate with the pavement and become Asphalta the god of automotives
 
4:04 PM
@Shmiddty Array.map
 
@FizzyTea ?
 
It's shorter than [].map.call.
 
!!> Array.map("123", (x)=>x*x)
 
@Shmiddty [1,4,9]
 
oh
cool.
 
4:09 PM
I wonder if this can be shortened further... Array.apply(0,Array(100)).map(readline)
 
@nderscore Array.map(0+gc+gc+gc,readline)
 
haha
that works
 
but at that point you might be better off with something more straightforward
all depends on the problem
 
yeah
 
I'm trying to figure out the shorter solution for delete last line
 
4:16 PM
I tried to do a cheat solution for that one
 
the cheat ends up being longer
 
0
Q: what is the right syntax for put json ajax request jQuery

Dave-88i write my ajax put request: jQuery.ajax({ url: url_lab_data+"backend/read/{\"f_anid\":"+anid+"}", type: "PUT", data: JSON.stringify({"read": 1}), contentType: "application/json", success: functio...

 
for(i=[3,9][new Date%2];i--;)print(readline())
46 chars there
shortest answer is 34
 
@Dario 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.
 
fahhhhhk I hate asp.net
 
4:22 PM
@Dave-88 Please don't just drop links in chat...
 
i want sort users by country
is it possible ?
 
@samitha I want 1 BILLION dollars.
is it possible?
 
yes.you could earn that >
:p
 
@samitha I just want it. I do not want to earn it.
 
4:28 PM
try a lottery every day
:D
 
@SomeKittens change your name to ∃Kittens - cooler that way :)
 
@BenjaminGruenbaum Were you bitten!? Strip! Prove you weren't bitten.
 
is this crazy slow for anyone?
also hey @rlemon just saw your message
havent been paying attn to so much today, working on 2 sep demos
 
wat?
Am checking with mobile internet connection, it seems to be slow, if i copy cat then how added the link mr. — Chinnu R 30 secs ago
 
4:34 PM
@Shmiddty for(;new Date%2;)print(readline())
 
@Shmiddty ?
 
@Loktar great effort .
 
bleh so slow on this laptop
oh well im posting it on codepen regardless
 
@LawrenceWong 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.
 
4:43 PM
:)
 
It actually worked
 
@BenjaminGruenbaum What the what?
 
now to make them explode in Confetti goodness
 
@rlemon neat
 
@rlemon just add some velocity
start them in the center
 
4:48 PM
ohh i'm going for more of a popping effect
gravity pulling it back down
swaying and shit
then make a confetti canon
or maybe i'll just do what you did and make a "Confetti Big Bang"
because :P
i'm just happy I have a piss poor understanding of transform now
 
my vs of confetti big bang lol, minus particle rotation
 
also, the .transform arguments are stupid and I hate them
scaleX, skewX, skewY, scaleY, transX, transY
the order makes no sense and fucks with me constantly.
 
@Loktar ow
 
@rlemon did you use a transform matrix?
oh you did nice
yeah man good thing to learn
 
I used .transform and called my variable matrix ;)
@Loktar the code I was asking for help with was setting the matrix
diff += this.r;
// set the matrix
this.m = [
Math.sin((diff / this.rs) / Math.PI),
Math.cos(diff / this.rs),
Math.sin(diff / this.rs),
Math.cos((diff / this.rs) / Math.PI),
-Math.sin(diff / this.rs) * (this.s / 2),
-Math.cos(diff / this.rs) * (this.s / 2)];
diff is the time alive in ms. r is a random value to offset. .rs is a speed modifier based on the size of the object.
.s is the size
looks okay
 
4:56 PM
So many useless computations
 
@copy because i'm still modifying them and playing around
then I will clean it up
 
does anyone know how to convert this date thing
Mon Oct 29 2012 16:56:25 GMT+0000 (GMT)
to something like this
1351529785247
1351529785247
How is it done?
 
!!> +new Date("Mon Oct 29 2012 16:56:25 GMT+0000 (GMT)")
 
@rlemon 1351529785000
 

« first day (1109 days earlier)      last day (3854 days later) »