« first day (614 days earlier)      last day (4351 days later) » 

6:00 PM
you guys make me want to play fieldrunners
 
that game is fun
gets hard fast though
 
that's fun :p
 
OLOL
 
@rlemon Rlemon ninjaing! at 110 [kidding]
 
6:17 PM
0
Q: How to simplify code, which adds spaces and commas if field value is not empty?

LA_ var searchDetails = ""; searchDetails += $("#last-name").val(); searchDetails += searchDetails != "" ? " "+$("#first-name").val() : $("#first-name").val(); searchDetails += searchDetails != "" ? " "+$("#middle-name").val() : $("#middle-name").val(); if ($("#dob-dd").val() != "...

 
Is it just me, or should the rooms description read "...If we're being brash...."
 
I thought the same thing, but brass actually fits rather well.
> : brazen self-assurance : gall
slightly wrong part of speech, but not too bad
 
Brass: an alloy of copper and zinc
 
hmm but brash might be more relevant actually
 
6:25 PM
'strue
 
or.. harsh :P
 
@Loktar oh, fine
 
because they are all stretched out!
rlemon.github.com/lememe/v2 feedback please - moar images / fonts / text wrapping / etc.
 
6:41 PM
@DieVarDump yup - legitimatly compiling code on one machine and waiting for the server to finish backing up
good hour and a half of 'free time'
at least i'm still programming :)
 
(insert obligatory XKCD)
 
want your job :(
 
lol
i deal with a lot of slow / old hardware
 
what language?
 
6:42 PM
got ubuntu server running on a micro itx board (300mhz cpu, 500 meg of ram, 4gb CF)
 
child
 
@rlemon This is how Canadian tech works?
 
@SomeKittens bash/c/c++/c#(some winforms applications)/general IT/all the web stuff - our actuall webpage
@SomeKittens no this is how you get a 'embedded' system that is not actually embedded or a RTOS
 
@rlemon Sounds fun, I was wondering what you were compiling, I've only seen you in JS/PHP rooms.
 
6:44 PM
He is found of facebook. He compiles php
 
right now my project for work does not require so much - converting a ~1mil line set of c programs that run in QNX to c++ running in linux
so a lot of compiling... checking errors... checking compatible headers for linux... fix a line or two.... compile....
 
can't you make modules and then compile smaller parts ?
(or asking for a better ubuntu machine...)
 
I think he needs to test it on a pseudo-embedded machine.
 
@DieVarDump yea I do test it first on my local machine - but it all needs to run on that hardware and there are some timing issues so i need to compile and run it there.
 
trying to text a value inside a td previous declared, but it keeps empty. http://jsfiddle.net/pcqud/

when debugging it shows the value inside the tr, but on screen it keeps empty
It's at line 15. What is wrong?
 
6:49 PM
and it is broken down to 93 smaller modules.
 
Wex
If I wrote a basic tutorial, would this be an okay place to post it to get feedback from the JavaScript community?
 
is twitter being wacky for you guys today?
 
QNX4 didn't even implement TCP/IP - a lot was done to circumvent limitations in QNX
 
@Loktar on g+ some are complaining. But not for me
 
Chrome in general is being a biatch to me today
methinks it is time to kill it and re install.
 
6:50 PM
since i went in flags and activate a lot of things it worse than ever to navigate with Chrome. I really don't like this browser
 
Wex
adamonio.us/wexcode/66/introduction-to-javascript - the comprehensive tutorial I just wrote on the basics of JavaScript
 
WOW!! I found a whovians group in my city, and the chicks there are really hot! I'm sooo gonna join that group! LOL
 
lol
 
@rogcg problem is unless you look like David Tennant they want nothing to do with you
I <3 David Tennant
 
@rlemon I'm just a fuckin nerd. =(
IDK if girls care that much about 10nant. Probably now Matt Smith
 
6:58 PM
Javascript.NET - javascriptdotnet.codeplex.com Anyone used this?
 
hey anyone can help me with this issue? jsfiddle.net/pcqud
 
@rogcg Matt Smith looks like a horse
 
@rlemon indeed
 
Tennant has class
 
I'm trying to text a value inside a td previous declared. However in line 15, the TD keeps empty
 
6:59 PM
Tennant was at least as good as eccleston IMO
 
 
any idea of what might be causing this?
@rlemon I've seen this LOL.. awesome.
I've tried with html, text, append, but nothing..
 
@ThinkingStiff Never wanna use it
 
$(currentProgTR).find('#tempo_acumulado').text('test');
dude
$('#tempo_acumulado').text('test');
 
7:02 PM
@Abhishek I was actually just googling javascript.net as a joke. Didn't know it existed.
 
it's an ID
 
@rlemon yeah.. but as u can see. it's inside a loop, it will create a lot of rows, with td's with same id. I want to add the value to the current row.
 
@ThinkingStiff if u want something like that better use C++ [ i mean compiling javascript ]
Javascript .NET compiles (at runtime) and executes scripts directly from .NET code. It allows CLI objects to be exposed and manipulated directly from the executed Javascript.

I'd Rather use node.js for that
 
@rogcg cannot have duplicate id's
re factor your code to not have duplicate id's and i'll consider helping more
 
Browser should really start throwing big ugly errors in case of duplicate ids
 
7:04 PM
^ yes!
 
@Abhishek And allows it to run on the server. I'll stick to node.js.
 
duplicate ID's are like a guessing game for the browser.
they are not allowed and should never be used
 
For backwards compatibility it could simply do that only if there's a HTML5 doctype
 
@ThiefMaster congrats [ you look blue i asume u got mod ]
 
no he ate some bad fish
 
7:05 PM
thanks
 
@Abhishek There's also this: jurassic.codeplex.com
 
@ThiefMaster Error handling? In a scripted web language? Never!
 
I dont get why people no realize native client exist
 
@Abhishek: It's not very portable
And you can assume that noscript-like extensions will block it by default even if JavaScript is enabled.
 
?
@ThiefMaster if that was for my Native Client question then .. people are making .net influence in js soooo much :-|
 
7:09 PM
@rlemon I just added the $.each index as the TD id, and it worked.
thanks for the tip
 
@rogcg: IDs cannot start with a number (even though browsers are very lenient on that restrictions)
So use something like row-X instead of just X
 
If there are any Jquery brains wishing to help a Jquery nOOb there is virtual beer in it for you - lol

http://stackoverflow.com/questions/11145099/jquery-using-selector-contains-weird-results
 
@ThiefMaster yes
 
@garfbradaz try key up instead
thats just after a really brief look at your question
 
FTW!! forth.org
 
7:12 PM
@Loktar - I will give it a bash, tar :)
 
@garfbradaz keydown runs the code before the input is entered into the field. you can access the value via the event object but not as the input.value
the drawback to keyup is if the use presses and holds you only register once they have released the key
 
yeah.. Im looking at this and idk it seems like its possibly over complex
 
if inception come into my dreams, they will suffer so much!
 
probably. but this.value does not contain the keystroke the function was triggered on.
 
@garfbradaz awesome question though in terms of how it was asked and everything
you provided everything which is pretty badass
 
7:18 PM
0
A: JQuery - Using Selector :contains - Weird Results

rlemonbecause this.value on the keydown event does not contain the keystoke which triggered the event. Use keyup instead. You can access the keystoke via the event object which is available in the function... but the value of the input will not contain it until the key is released.

 
@rlemon & Loktar: thanks for taking the time to look at this, vmuch appreciated. And thanks for the compliment! I try to give as much detail as poss if i want the question answered. I will check out peoples answers now and get bck to you :)
 
do you understand the explanation as per why it wasn't working?
/me hates all code answers that don't explain why they fix the problem
 
indeed, i think so - So keyup is the way forward. I presume from your answer is that this.value will only be populated when keyup event is called (On key release).

Thanks guys again. Im loving the JQuery goodness!
 
@garfbradaz less to do with jQuery and more to do with DOM Events
 
Im new to Web Dev (Not programming) - so i thought i would (over the past couple of months) learn ASP.NET MVC for the server side and JS/JQuery for client side as side projects at home. I wish i had started earlier as its so much fun.
 
7:26 PM
@garfbradaz always remember that jQuery is a tool for javascript development and cannot / should not replace javascript
You should always learn the language before learning it's tools.
just a tip

Noob Javascript Resources

Jun 15 at 13:05, 1 minute total – 11 messages, 2 users, 0 stars

Bookmarked Jun 15 at 13:09 by rlemon

good links in that convo.
 
@rlemon - ive been trying to learn both in unison at the moment.Ive been having a good go at the Codecademy lessons for JS which have been good. I will check out your link above tho - thanks again
 
Since you are new: If a google search yields a w3schools.com result don't even bother opening it - that site is high-ranked yet pretty bad
 
What are people's overall impressions of Codecadamy? I tried it, but the learning curve was too shallow
 
@ThiefMaster w3fools had not update its content for a very long period of time
 
Some of the worst things are still up to date though
 
7:30 PM
@ThiefMaster cheers appreciated
 
Actually w3schools has corrected most of its content already
 
sql injection-vulnerable php code for example
 
@garfbradaz The book "Javascript - The Definitive Guide 6th Edition" will be a godsend.
very dull reading... very informative
 
or setTimeout('string', ..)
 
@rlemon meme in the making
right off the front page of reddit
 
7:31 PM
after the first 200 pages it should all be used for reference .
 
@rlemon - i will add that to my Kindle :P
 
@Loktar uploading....
 
nice
 
@rlemon That's a warez site. (link removed)
 
skeptical 3rd world kid
 
7:34 PM
@ThiefMaster the ebook link is safe. I couldn't find another link to it
 
Safe yes, legal no :)
(I have no clue if that ebook is even freely available legally)
 
technicalities
@ThiefMaster iirc some guy had a HTML version of it on his site (few month back)
just did a quick google and couldn't find it.
maybe was taken down? maybe my google skills suck.
idk, the books sitting on my shelf (the paperback one)
i can't stand reading ebook s:<
 
@rlemon - you answer worked, tar :P
 
7:40 PM
haha nice @rlemon
 
@jco - well it sounds like there's a lot of mess in the promise.js area. I only think a new question is suitable if the technology really has changed a lot. IE, the question "How do I wire events for all anchors with jQuery" would have very, very different answers X versions ago. Way back when the answer would be "Use live". Now the answer would be "Use on, or delegate if you must, but under no circumstances should you use live". I don't think a bounty should be put on a question like that; ask it fresh and get new answers— maybe even close the old one. — Adam Rackis 39 mins ago
Wait, we're not using live anymore? Somebody blog me up, please?
 
Or you could link me to a good blog that explains it well?
If the problem is in having hundreds of UI elements propagating, well duh, of course it's terrible. But what about when you have at most tens of UI elements getting bound, and at most 10k elements on screen (textnodes, spans, divs, they pile up)
 
@jcolebrand the docs explain this
> As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().
even in the older versions jQuery is now realizing live was dumb
delegate is much better / on is best
pickup the event for the page and check the target element instead of hooking a handler to each element. (for 10k elements)
 
I see
 
7:50 PM
14
A: What's wrong with the jQuery live method?

Tats_innitSee some of the explanations here: http://www.ultimatewebtips.com/why-jquery-live-is-a-bad-option-to-use/ quote You can’t use live for reusable widgets. stopPropagate() doesn’t work in live Live is slower Live isn’t chainable further beauty of on is that streamlines all events quite well :...

 
So the problem is that I started using jQuery before 1.4, and haven't launched anything with 1.7, so I wouldn't have had reason to update to 1.7 (corporate intranet sites don't get lots of new re-revs all the time)
 
As for the comment of "listen at the page level and check the event handler" that still seems to have some shortcomings. However, I've not written the backend, much less through several iterations.
@rlemon reading does you well. 10s of click events on thousands of elements (including textnode)
it wouldn't have to handle 10k elements running a selector on 50 elements
especially not with IDs
or does the dom.getElementById not run efficiently for that?
 
it will
but then you're selecting ALL of the elements and storing a handler for them
why not pickup the pages click... check the specified element target ... one assignment... one check... one hook.
 
@rlemon because of bubbling? That sounds like it still has to check all the bubble paths. Like I said, I didnt' write this routine. I can't speak to it.
 
7:57 PM
@rlemon - i wondered how you were generating MEMES so quickly and just found your Github LeMEME - awesome
 
but it's faster and the way you should be doing this
 
is it allowed to post a question from another site here? (Datatables.net forum)
 
the event bubbles down to the element regardless.
@rogcg go for it.
 
@rogcg preferably as a Stack Overflow post
 
7:59 PM
@garfbradaz make sure to check out version 2 - that is the updates I worked on latest.
 
if you have any experience with datatables.net, could u help me with that question plz?
 
there is the same question as a gist in markdown format ...
 
@rlemon ok, sorry for that.
 
you can edit, copy the markdown formatted text out and post as a SO question.
 
@rlemon now show me why that's better as a live :p
 
8:03 PM
@jcolebrand live is deprecated... slow... cannot chain... basically didn't do what you expected it to do (behind the scenes)
never use live.
if you have older versions use delegate
and hooking event listeners to thousands of dom objects is stupid (you are not just doing that is)
will be very lengthy
huge resource hog
 
-» crappy code
 
and then on top of that jQuery events are not DOM Events... jQuery implements it's own event model.
 
now.. =D
 
so i'm not sure what kinda impact that serves when hooking to thousands of elements.
 
0
Q: Highlight and sorting issue when populating dinamically

rogcgI'm trying to make my table have a checkbox column for each row, and also the rows to highlight on hover. It works properly when the data is static declared on html files, however when retrieving the data from server (I'm using $.getJSON) the sorting becomes a mess and the highlight stops working...

 
8:06 PM
rog why are you sorting client side ?
 
@DieVarDump because the API provides that functionality
 
@rlemon it did what I expected
 
and your php/javascript/whatever you use client side don't ?
 
but I follow the point, going forward we'll look at either delegate or on
TIL and all that
 
8:07 PM
@DieVarDump but if I'm using DataTables.net, the correct is to use their API so it will run properly.
 
also if you've never used it delegate is much nicer and more semantic than live (imo)
 
@rlemon you just said live is deprecated right? stackoverflow.com/questions/11145893/…
gotta change that
 
i didn't they did
:)
 
@rlemon you've mentioned. LOL
ok, now it's becoming serious. hahahh
 
live() is slower, does not chain, stopPropagate() does not work. want more? you get your +1 back when you stop recommending deprecated functions. :) Also the docs suggest we stop using live() — rlemon 2 mins ago
@Esailija o/
 
8:20 PM
.live( "hover" ) wouldn't even work in < 1.7
@rlemon sup
 
rlemon.github.com/lememe/v2 PeeHaa just yelled at me for faking values :) (padding is somewhat accurate)
to calc max width for line wrapping I use width - font_size_val - pad_x_val
font_size_val is a buffer to ensure the fonts as provided don't extend the boundaries of the image (ctx.measureText() is not 100% accurate with all fonts.. )
just wanted your views on it. :)
 
seems to work
 
cool just him getting pissy with my technique :) i didn't see any issues with the end result.
now.... because I view you as a smart man.
that while() { while() { always scares me
 
lol
 
even tho the second while loop is rarely hit.
 
8:26 PM
doesn't seem like it would be bad... how many words are there normally
 
I could wrap it in a if statement but that would be redundant. if there any way to remove the loop completely? (not having a recursive function being called in a recursive function (wouldn't that defeat the purpose) )
idk. average meme. 5-20 words?
 
yeah so it would never be slow in practice
 
no but the whole text wrapping technique based on bounds is not specific to meme generation :) I just wanted to learn the best techniques
 
ah I see, I am at GF's place now though so can't really give it much thought :D
 
thats cool
> If your wondering why it's so hot.. The sun's solar flares have been the highest and hottest in 2000 years. My Nerd fact for the day. Lol
a friend of mine tweeted that
solar flares do not effect weather (temp)
 
8:33 PM
they flip bits in computers and cause bugs
 
they do do freaky things with our magnetic field.
but making it hotter is not one of them
 
did you tweet back at him :P
 
am right now
they heat the upper atmosphere and cause it to expand... radio communication is greatly effected... surface temperatures see no change.
see i didn't know that - i'm glad i made sure I was right and read a nasa article before I tweeted back
 
LOL
 
with my irl friends i'm totally the "Well Actually" guy
mostly because they are idiots.
> There is no known relationship between individual solar flares and weather. There is, however, evidence for a relationship between the solar activity cycle and global climate. The best known case is the correlation of a long period of solar inactivity called the Maunder Minimum (1645-1715) with the lowest temperatures recorded during the "Little Ice Age" that occurred from 1500 to 1850. Almost no spots were observed on the Sun during this period. There is evidence for the correlation of other periods of low solar activity with cooler temperatures on Earth as well.
see that is interesting
now i'm reading up on how solar flares effect earth
good times!
 
8:40 PM
live() is slower, does not chain, stopPropagate() does not work. want more? you get your +1 back when you stop recommending deprecated functions. :) Also the docs suggest we stop using live() — rlemon 23 mins ago
rlemon is a bad boyyyy
never gonna give up !
 
I take internet responsibility
RLEMON SMASHES PUNY .LIVE()
49 mins ago, by rlemon
user image
I love that he updates with a little footer note but in the header still promotes live and not delegate
ugh - ubuntu! Y U SO SLOW DOWNLOADING UPDATES!
 
you already are in v2 ?
Is that you rlemon on the photo ?
 
8:59 PM
0
Q: how to transform child elements position into a world position

MrGregSo Im making a 2d space game and I have a bunch of spaceships that have turrets. Objects have a position and orientation, the ships being in world coordinates while the turrets are children and coordinates are relative to their parents. How do I efficiently calculate the position of a turret in...

 
9:26 PM
Hello
 
9:43 PM
How can i display javascript in javascript
 
alert('javascript')
 
Without alerting it
Basically
$('#generated_code').html('<textarea>'</script>'</textarea>');
Something like that, with the javascript inside the textarea
Any ideas?
 
Not really, no
 
it amazes me how c# is growing in popularity, and I'm somewhat bothered by it.
 
10:01 PM
HarryBea, replace < with &lt; and > with &gt;
109
Q: Escaping HTML strings with jQuery

Page BrooksDoes anyone know of an easy way to escape HTML from strings in jQuery? I need to be able to pass an arbitrary string and have it properly escaped for display in an HTML page (preventing JavaScript/HTML injection attacks). I'm sure it's possible to extend jQuery to do this, but I don't know enou...

 
ooh
This?
$('#generated_code').html('<textarea>&lt;script type="text/javascript"&gt;

	var _fastads_id = "adhere.png";
	var _fastads_loc = "https://domain.com";
	var _afastads_length = 728;
	var _fastads_height = 90;

&lt;/script&gt;
&lt;script type="text/javascript" src="https://domain/js/addelivery.js">&lt;/script&gt;</textarea>');
Still getting an error with that
 
10:24 PM
so...jquery's datepicker fails at validating dynamic inputs. I know what to do to fix it. Should I wrap the datepicker functionality somehow, or just change it in my jquery-ui.js script file?
 
10:35 PM
@DieVarDump yea from a long time ago. iirc i was 17? +- 1year
 
Ok :)
 
to put it frank; the guy in the picture would whoop his 25 year old counterpart.
i'm outta shape... not fat.. but outta shape
the image in my gravatar is last summer
not v2 more like alpha 2
just a buncha upgrades some bug fixes.
 
@rlemon - I have a js dilemma, I need to add a line of code to jquery-ui-min.js. How should I go about doing that?
 
i was going to try for a mobile ready responsive design but man is that ever hard to do with what the site is... i'm now leaning towards offering tablet support on the main site and for mobile i'll dev a mobile version :/ it haz to be done!
@TravisJ download jQuery-ui.js (not the min) add the line then run it through closure compiler or YUI compressor
 
@rlemon - worth a shot, thanks
 
10:39 PM
you won't get it as a CDN hosted file anymore... but that is the price you pay.
 
I have one in my project actually
 
Jun 6 at 12:29, by rlemon
stars are not bookmarks mate ;)
please
 
sorry, misread
 
yea s/in/it
typo
 
0
Q: DrawImage doubt

user1238642what is the best option for animation in a game (html5 javascript) put all the images in one png and change the background. or create each image separately and drawing with DrawImage?

 
10:42 PM
hello
Thoughts on "ajax only" web apps?
 
A neat addition to "ajax only" is pjax (pjax.heroku.com)
 
like g+ load everything with a crapshoot of xhr calls
seriously have you ever looked at the source code?
:( bad google... bad
 
twitter is the next thing that comes to mind. they load most of their content via xhr and use client side template engines to produce the page.
 
i'm just considering regular ajax calls to webservices as an app design. No other frameworks except perhaps jquery
 
10:46 PM
I was on the G+ team - one problem with ajax only is that the number of css selectors on a page gets to be very large, which actually breaks IE. There was a point where no additional css selectors could be added or IE would crash
 
i took a page from them and produced a dom fragment builder that accepts html strings or json input.
 
for new html documents the entire page would be loaded
 
@JeremyPatrick Don't do it (except for chats, mail clients, games, ... special applications)
 
This is the code that needs to be updated:

	/* Action for selecting a day. */
	_selectDay: function(id, month, year, td) {
		var target = $(id);
		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
			return;
		}
		var inst = this._getInst(target[0]);
		inst.selectedDay = inst.currentDay = $('a', td).html();
		inst.selectedMonth = inst.currentMonth = month;
		inst.selectedYear = inst.currentYear = year;
		this._selectDate(id, this._formatDate(inst,
			inst.currentDay, inst.currentMonth, inst.currentYear));
 
rlemon.github.com/FragBuilder.js i don't claim it's perfect. it's got limitations (I developed this for a specific purpose and still haven't gotten around to updating it to be more scalable / flexible) and maybe a few bugs but if you plan on passing pages (entire structures) passing it as json seems a little better than as HTML strings (not to mention the json-builder is faster than the html string (innerHTML) parser)
 
10:49 PM
@copy what do you see as the cons?
it would appear to create a much better user experience if all the view logic was done on the client side
 
@JeremyPatrick There are no big advantages and it breaks many little things
 
no server side modification of the html document
it appears to be a clear separation of concerns. the server should worry about server logic and the client about the view
 
Laziness ?
There are so many ways to that properly on the server
 
@JeremyPatrick the limitations are that older clients will not function as well rendering a view. this is where (in the past) beefy servers were HTML rendering kings! In todays day and age (with a modern client base and the realization that you will alienate older browsers) client side rendering takes some of the load off the server and lands it on the client itself (which if handled well can be very helpful)
 
@rlemon and now, on Internet, we say " as slow as Twitter "
 
10:52 PM
@DieVarDump client side rendering should be where it is at. eff this attitude the server needs to server up the HTML
we all know DOM renderers are not all alike.
 
I didn't say that ^^
 
why not let the client handle the view?
 
Well not today,
 
no, not today (for accessibility reasons)
but twitter is at least trying to take a step forward.
 
Yes they seems.
 
10:53 PM
it's not slow for me! (modern hardware)
 
Twitter sucks
 
so you're saying twitter is designed like this
 
so is g+
@copy is arguing with two internet giants... seems kinda pointless.
 
yeah
lol
 
Twitter render on client side. G+ too. G+ have found a way to do it really fast (on Chrome, always on effing Chrome)
 
10:54 PM
lol
figures
i'm sure if twitter developed a browser it would be uber quick to load their site too
 
this approach seems to be the way forward
 
I linked an article yesterday about server/client side rendering
 
@JeremyPatrick it is... but at the current time, it will limit your audience to only modern browsers and hardware.
if you really want to make money you need to utilize progressive enhancements.
make the site work with no js first.
 
@rlemon Internet giants are trying to promote this kind of crap
 
no css and no images is kinda extreme but others will argue .
 
10:56 PM
Google can't index such pages
 
google will learn.
 
Oh Twitter is done now
 
if someone has js turned off they can go away lol
 
It will never run well on smartphones
 
10:56 PM
it will never is the plight of the lazy unimaginative man.
 
@JeremyPatrick That's an awful attitude
You don't even need it really. Twitter does not need it, G+ does not need it
 
but it takes the load off the server and puts it on the client.
 
would stackoverflow work without js?
lets see
 
this leaves the server to take more concurrent requests (in a perfect world) and handle more extreme content.
it does
not as well, but it does.
with a big red banner saying "the site works better with js enabled"
has disabled js to test own sites and forgot to enable it
 
10:59 PM
You could go other ways to take load off your server, for instance caching
SO does that, most people don't
 
i wonder what the real numbers are on the number of clients that have js turned off
 

« first day (614 days earlier)      last day (4351 days later) »