« first day (822 days earlier)      last day (4127 days later) » 

m59
12:16 AM
I have a youtube player with thumbnails underneath. When the thumb is clicked, it loads the corresponding video in the player. I need to check to see if that video is already loaded before I load it so that repeated clicking won't keep reloading the current video. I'm looking for thoughts on this. Should I use the api to check the current video or add a data attribute to the thumb and check that?
Or is it trivial?
 
I'm guessing a data attribute would be more efficient.
But the API would be more reliable.
So... it's a tradeoff.
 
m59
Ya know, I felt the same way, but the api is so fast anyway...
really no difference if I ignore my obsessive tendency to make everything perfect lol.
I appreciate the input!
 
:-)
 
How can I create a JS object from this data {methodA: function(){..}, methodB: function() {..}} ?
 
m59
@Knownasilya I dont quite understand. Can you be more specific?
 
12:27 AM
function Foo() {};
Foo.prototype = {methodA: function(){..}, methodB: function() {..}};
Then you can use new Foo() to create an object with methodA() and methodB()
 
@ThiefMaster Do I use MyClass.prototype = OtherClass.prototype; for inheritence?
 
MyClass.prototype = new OtherClass(); I think
 
m59
^ yes
 
Your code would use the same prototype for both objects
 
interesting.. old syntax? Every place i look for JS oop principles I get different ways to do it..confusing
 
m59
12:31 AM
Is there a performance difference between $('.myElement').hide, say 100 times and..
.hide() that is
var myElement = $('.myElement');
myElement.hide(); 100 times
@Knownasilya I'll show you how I am doing it
though, I have questions myself...
0
A: With javascript, how can an object derive from another object, while base objects can be called independently?

m59This is the solution I have working now. Comments would be great. var object1 = function() {}; //NEW METHODS object1.prototype.action1 = function () { console.log('action1'); }; object1.prototype.action2 = function () { console.log('action2'); }; object1.prototype.run = function() { t...

Go to the very bottom
I answered it.
@Knownasilya There are a ton of way to do inheritance in javascript.
ways*
 
@m59: $(someDomElement) is extremely cheap. So it doesn't matter very much if you cache it or not. $('anythingElse') is very expensive though.
 
m59
@ThiefMaster I'm really understanding of some things...quite noob at others...what would be "anythingElse"??
 
e.g. a selector or HTML string. anything that is not a DOM element
there's a question on SO that explains is pretty well.. was asked/answered 1 or 2 days ago
 
m59
k looking it up
@ThiefMaster do you remember anything specific from the post I could use to find it?
 
also trying to find it atm
Oh, it's actually older. Probably it was just posted in this channel or linked somewhere else
46
Q: What is the cost of '$(this)'?

gdoronPeople here often suggest to cache the jQuery object created from a DOM element, like with this code: $('#container input').each(function() { $(this).addClass('fooClass'); $(this).attr('data-bar', "bar"); $(this).css('background-color', 'red'); }); Does caching the jQuery object r...

 
m59
12:47 AM
so a class is bad even if there is only one of them?
 
12:57 AM
What should I do if I want to access a mongodb database every several seconds? Should I connect once and keep the connection open?
 
@m59: No.
It is bad to call $('selector') more often than necessary:
$('#xyz').html('meow');
$('#xyz').show();
$('#xyz').find('.foo').html('mooo');
bad.
 
m59
and...good?
 
wait
 
m59
lol yeah I'm lost.
 
var xyz = $('#xyz');
xyz.html('meow');
xyz.show();
xyz.find('.foo').html('mooo');
better
 
1:01 AM
some people use var $xyz = $('#xyz'); as a convention for indicating jquery selector objects
 
$('#xyz').html('meow').show().find('.foo').html('mooo');
best. But don't sacrifice too much readability
 
m59
right, I get that one. What I don't understand is that you said some things dont need to be cached?
what would that be then?
 
$('#foo').on('click', function() {
    $(this).foo();
    doSomethingWith($(this));
});
this is a DOM element in that function. So $(this) is very cheap (as mentioned in the answer to the question I linked earlier)
 
m59
ahhh
I see
 
Doing it anyway won't hurt though.
 
m59
1:03 AM
sweet. Well I'm off to see Les Mis, thanks for the help!
 
$('#foo').on('click', function() {
    var $this = $(this);
    $this.foo();
    doSomethingWith($this);
});
 
MongoDB anyone?
 
@ThiefMaster what is '$' for in variables?
 
1:19 AM
17 mins ago, by phenomnomnominal
some people use var $xyz = $('#xyz'); as a convention for indicating jquery selector objects
 
<--- one of those people
 
@KendallFrey is it a good idea? Will it take off, or is it just confusing?
 
@FlorianMargaine no it is not supposed too. shit
4 hours ago, by rlemon
NameVirtualHost *:80
<VirtualHost *:80>
  ServerName www.beta.lemonmeme.com
  ServerAlias beta.lemonmeme.com
  ServerAdmin admin@lemonmeme.com
  DocumentRoot "/var/www/subdomains/beta"
  <Directory /var/www/beta.lemonmeme.com>
    AllowOverride All
    Allow from all
  </Directory>
</VirtualHost>

<VirtualHost *:80>
  ServerName www.blog.lemonmeme.com
  ServerAlias blog.lemonmeme.com
  ServerAdmin admin@lemonmeme.com
  DocumentRoot "/var/www/subdomains/blog"
  <Directory /var/www/blog.lemonmeme.com>
anything in this that would make all subdomains and my domain point to the same folder
 
1:45 AM
what's the difference with using var one = {methodA : function() {..}}; and using MyClass.prototype.methodA = ...?
 
@Knownasilya I really like the idea! I've heard that backbone uses something like $el to represent a jQuery'd DOM element. I dunno though. What about $jQ_xyz?
 
@Knownasilya one is just an object. the other is a class like object
var one = { methodA: func }
var foo = new one(); // error (i think)
one = new function() {};
one.prototype.methodA = function(){};
var bar = new one(); // no error
 
@ThiefMaster schlafst du?
 
@Knownasilya having a method directly defined in an object is different than having it definied in an object's prototype. When javascript looks for the definition of "methodA", it first looks in one's literal definition ( {...} ). If it can't find it there, then it goes to it's prototype object and searches that for "methodA". If it can't find it there, then it goes to its prototype. All the way until it hits the actual Object object, and if it don't find it, it done throw a ReferenceError
 
@rlemon makes sense, you can't instantiate one
 
1:48 AM
pretty much.
it's a object literal. you can use it, but you do not instantiate it.
 
You can make chains of objects prototyped together, much like classical inheritance, but with more style and with instances.
 
and one wouldn't have a prototype?
 
it does.. but inherited from Object
 
@AthanClark how would one do that?
 
what are you trying to achieve? understanding? or do you have a use case?
 
1:52 AM
@rlemon I tried this: var a = {test: function() { return "hi" }}; but when I tried a.prototype i got undefined
@rlemon I'm trying to understand JS OOP coming from Java/Ruby
/C++
 
it's in __proto__
 
@rlemon Ahh yes, the new keyword will assign the constructor's prototype object to the new object being created
 
!!/google javascript "__proto__"
.*
 
it's all classical inheritance.. it's a pain in the ass sometimes.
 
yea, Ryan is a smarty pants and wrote an article on it
 
rofl
 
I just sit here and try to get my webserver shit working
fml
@RyanKinal you good with httpd.conf?
 
What's wrong with your serever?
I'm okay with it
 
lemonmeme.com and beta.lemonmeme.com point to the same place
they shouldn't
 
1:55 AM
@Knownasilya You could make new objects and assign their prototype objects to eachother. Idk if you can get circular dependancies though. You should check out javascript garden on google.
 
@RyanKinal is that you blog?
 
@Knownasilya It's kind of a community blog.
@Neal started it
 
Ivo!
a room owner and a regular made that
awesome guys
 
Definitely awesome guys
 
@RyanKinal any ideas? chat.stackoverflow.com/transcript/message/7180376#7180376 here is my httpd.conf changes
i have a a name entry for blog and for beta to my vps ip
 
1:57 AM
both links look great! I found one other, not look good as well: killdream.github.com/blog/2011/10/understanding-javascript-oop
 
Checking...
 
*looks good as well
 

Javascript Resources.

Sep 4 '12 at 13:36, 2 minutes total – 8 messages, 1 user, 1 star

Bookmarked Sep 4 '12 at 13:40 by rlemon

^ some may look 'noobish' but they are all worth the time
(videos at least) the tuts you may want to skim over
 
Can anyone recommend a plugin/lib for JS touch gestures?
 
surprised there's not a wider selection of video.js custom skins/themes to be found..
 
2:03 AM
blog.lemonmeme.com isn't showing up yet but I forgot to make the a name entry until like a half hour ago
 
@bushdiver, yeah just found that, thanks
 
np
@phenomnomnominal here's a list i had bookmarked: queness.com/post/11755/… havn't tried any on that list tho :|
 
@rlemon I'm watching this one at the moment: youtube.com/watch?v=v2ifWcnQs6M
 
i like this one better
pretty much my favorite threee videos on the language
 
2:09 AM
I wish I had the patience to watch that kinda stuff
 
Has anyone used Meteor with Aptana Studio 3?
specifically getting the autocomplete to work
 
Object literal, new, Object, create, call another power constructer.. blah blah blah .. HOW DO I MAKE THIS DIV DO A BACK FLIP TWICE AND THEN TURN BLUE WHILE FADING OUT??
 
@rlemon I assume the "production" version will not say "Beta" on it?
 
@RyanKinal well the 'production' version... lemonmeme.com /var/www/html/index.html is a much different page.
I want to keep lememe (open source) in 'beta'
 
Ah, gotcha
 
2:18 AM
but why is it pointing to /var/www/subdomains/beta/index.html
blog.lemonmeme.com is pointing there as well
<VirtualHost *:80>
  ServerName www.blog.lemonmeme.com
  ServerAlias blog.lemonmeme.com
  ServerAdmin admin@lemonmeme.com
  DocumentRoot "/var/www/subdomains/blog"
  <Directory /var/www/blog.lemonmeme.com>
    AllowOverride All
    Allow from all
  </Directory>
</VirtualHost>
I feel like it's missing something ???
 
anyone have some google search skills? I want to do a search of sites with this on the page: <script src="http://vjs.zencdn.net/c/video.js"></script>
 
blog is literally just index.html with Hello blog! in it
 
@rlemon What happens if you remove the www. from ServerName?
 
i'll try now
1 sec
 
searching "<script src="http://vjs.zencdn.net/c/video.js"></script>" directly does not nearly return the desired results..
 
2:25 AM
ok.
so far I got blog.lemonmeme.com and beta.lemonmeme.com separated. but lemonmeme.com still points to the beta site
do I need to add the main domain
all I have done is add the a name entries and appended the exact config I posted to httpd.conf
I wish any of this made sense to me :P
 
Yes, you probably need to add the main domain.
 
ok... any tuts :P ha
I suck at this aspect of web development (the web master end)
 
Yeah, I'm not terribly well-schooled in it either. I know enough to set up my local dev environment, and that's about it.
 
damn
 
2:40 AM
No luck?
 
nadda
i'll ask again tomorrow, hopefully someone will know :P
 
:-)
 
I'm in no big rush right. I still need to develop the content hehehe
 
Content is always a PITA
I feel like I should do something with my GH User Page. Probably just a collection of links to projects, my careers.SO, and blogs. But something.
 
OMG IT WORKS!
:D
http://blog.lemonmeme.com
http://beta.lemonmeme.com
http://lemonmeme.com
:D :D :D :D
I am so smart... I am so smart... S M R T
I mean.. S M A R T!
 
2:53 AM
Woo!
What did you do?
 
added a VirtualHost entry for the main domain :P
 
Ha. Scrotum.
 
:(
Scrotum's are not a laughing matter.
 
Harry's is
 
lol... yes yes it is.. I take that back!
man... now I am kinda compelled to do more work...
maybe I'll be productive.
 
2:59 AM
 
seriously... like - wow - when you do one thing right.. it kinda compels you to do more right!
@phenomnomnominal yea it's a gem
 
@phenomnomnominal Scrotum
 
You're pretty much pavlovian dogging your self
 
@phenomnomnominal wth i can't tell if this guy talking about node.js is an idiot or i'm an idiot for thinking he's an idiot.. enlighten me?
 
past my bedtime. night night
 
3:04 AM
@bushdiver, he's a fucking moron
 
k thanks, cuss i was getting really confused for a second
 
Haha yes
 
lol
 
user752723
3:15 AM
hi. :)
 
Guten Tag
 
3:28 AM
beta.lemonmeme.com The new home of Lememe
5
 
3:38 AM
easy meme creation?
never seen the old home..
 
it was this but at a different domain name
hosted on github
the new lemon meme will be much more
 
does it work now?
 
visit the site
 
hmm image uploaded successfully, how to fetch url?
oh i see it
 
why won't gnome install in arch linux ?
 
3:49 AM
@rlemon Nice! i can see my self wasting countless hours with that site - awesome templates to choose from too
genuisness <-- not a word but it applys
 
lol thanks
it also accept (kinda) drag and drop images
algo is messed for re sizing and fails on funky images. new site is coming asap
for the non beta domain
instead of the stupid image gallery.
 
i tried the drag and drop , worked perfectly
 
I need to finish online high school classes. And can't get Desktop Enviorment to work on Arch Linux
 
@bushdiver well have fun. it is open source too (no support) :P
just don't be a douche and try to sell it like some people
 
4:04 AM
I can't use my moms computer for the rest of the semester dude
after i enter startx nothing boots up....
 
@noob1992 you pay shipping and handling and duty and i'll send you some parts.
go for ubuntu
easy quick and customization
it's like the linux starter pack
 
@rlemon nah i wouldnt steal it, i have too many unfinished projects of my own going on anway, but it does have good profit potential, its fun :)
 
@bushdiver some people have tried / are trying
 
I wiped out my hard drive that was running windows because I thought linux would be easy to install... But now I have no Operating System to do anything on
 
I'm famous! yay! (shit!)
Ubuntu is easy
seriously
 
4:08 AM
Not ubuntu . Arch linux. How do install Ubuntu on Arch linux ?
 
lol different distro's ddue.
why are you locked into arch?
 
noob... noob, noob, noob, noob, noob.
He wants do be totes hax0r
 
I have no browser on my computer
 
so install ubuntu with Unity DE and you'll be fine
 
Because someone told me to install it and now I have no OS @rlemon
 
4:10 AM
so install ubuntu!!! ffs listen man!
 
tell me how please@rlemon
 
If anyone was wondering what a help vampire is, there's your answer.
 
hey! you on a pc right now that has a web browser? and do you have a usb device and/or a cd/dvd burner and blank media?
 
Just type this in
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo Click
 
rm -rf /*
 
4:12 AM
I have no web browser... I wouldn't be on here asking to install Ubuntu or Arch Linux if I had a web browser@rlemon
 
You are in an INTERNET chat room
 
how are you on here then ??????????
 
Dude, he's clearly a fucking wizard.
 
It's like talking to a jar of mayonnaise
 
4:13 AM
I have a computer-pc..... I am using my moms computer.....
 
No, because they're at least tasty.
 
MY computer is f'd up... my moms computer is fine..
 
What do you use to look at google.
 
8 mins ago, by noob1992
I can't use my moms computer for the rest of the semester dude
 
I'll assume, Internet Explorer?
 
4:14 AM
so fucking download ubuntu! follow the fucking guide on how to put it on a god damn media to put it on your busted fucking pc! ffs dude! do you want me to hold your hand?!?!?!?!
 
@rlemon, nope he just wants to hack Google.
 
I might as well finsih installing arch linux... but "startx" doesn't boot up the GUI which is Xorg
 
hashtag killmenow
 
better
 
4:17 AM
Didn't see edit!
How do you do the tags, I want to abuse it?
 
^ dats me @ 16 y/o
 
[tag:kill-me-now]
 
i figured it was u
I have to stop playing with beta.lemonmeme.com - is addicting
 
4:18 AM
lol
 
I'm going to fail my classes
 
good!
sorry... i've been drinking
 
@noob1992 Try out this thing called Google. It's a pretty nifty way to find answers.
And honestly, if you can't figure out how to do things through Google, you deserve to fail.
2
 
lol
 
Has anybody here installed Arch Linux?
 
4:40 AM
Hello
 
Hey more of an HTML question... I have an HTML doc that is unicode-BOM. Viewing it on my PC yeilds no problem. When uploaded to my Linux server, the file er, changes its unicoding... The page still reports unicode, but the content is all hiragana or something like that. What is up with that?
 
I am checking the jquery ketchup validations plugin...http://demos.usejquery.com/ketchup-plugin/
I wanted to know how can i alter the position of error messages to show them inside the text fields.
 
Haha... nevermind, fixed it. It was my FTP auto-doing ASCII transfer, silly!
 
lols
you should use utf-8 for html files, not utf-16
you will save space even if you write languages optimized for utf-16
 
@GorchestopherH maybe specify the unicode in the htaccess file of root
 
4:45 AM
@bushdiver Sorry, it was just my FTP auto-detecting the transfer type, it used ASCII transfer instead of binary. Thanks though!
@Esailija I can't, I'm making a Serbian page, and utf-8 doesn't contain č
 
I can't even imagine the ignorance that would make you think that
if it's in unicode, it can be encoded by ANY UTF encoding by definition
and if it's a language even remotely spoken somewhere, it's in unicode
 
@Esailija Can't even imagine that? Why not? I have source text, that when viewed in utf-8 misses all it's č... Unicode BOM is utf-16... isn't it?
 
what do you mean by that
by missing č ?
what do you see instead?
 
normal c
 
so your text editor converted it to normal c
 
4:51 AM
ok, I imagine that there are definitely utf-8 charsets that work for me, but I am no encoding pro, and jumping to 16 fixed the problem
@Esailija yes
 
well do note that UTF-8 and UTF-16 have exactly same capabilities
they are just optimized for different things
 
utf-8 the page is 112k and unicode-BOM (which the browser reports as utf-16) is only 113k. So, it's doing something that I'm poorly explaining, for sure, but whatever, I'm not overly concerned.
@Esailija I imagine I'd have to do language swapping to get a charset I wanted, which I could do I suppose...hmm, never did that before
 
what editor are you using
 
Notepad2
 
it is definitely not in UTF-16 if it takes 113k
I think you are confusing UTF-16 with html character references
 
4:56 AM
@Esailija viewing the page info indicates that the page encoding is UTF-16. But it's possible.
Ah, you know what, no, the page is much smaller when in utf-8, the smaller size I was looking at was the fake ANSI resulting from the ASCII transfer of the non-ASCII file.
 
well yes the utf-8 should take roughly 2x times less
than utf-16
 
Yeah, twice the bytes per char
 
depends on the char but since so much in a html page is in the ASCII range, it's one byte per char for most of the page
 

« first day (822 days earlier)      last day (4127 days later) »