« first day (818 days earlier)      last day (4128 days later) » 

12:09 AM
var thumbInfo = [];
var feedLength = feed.data.items.length;
function getInfo(obj) {
	return {'title':obj.title, 'imgSrc':obj.thumbnail[options.thumbQuality]};
}
function process_feed(item,i) {
  thumbInfo[i] = getInfo(item);
}
function process_video_feed(item, i) {
  process_feed(item.video, i);
}
if (options.listType == 'playlist') {
	feed.data.items.forEach(process_feed);
} else {
	feed.data.items.forEach(process_video_feed);
}
@m59 maybe?
idk. seems like micro optimization to care about running the if statement.
whats' it take? 2ms
 
Also: linebreak after the closing } is ugly if you don't have one after else
 
ohh him
ha
a lot of people like that style.
 
Yours is fine } else {
 
meh, I don't really pay too much attention unless the style is outright non existent or horrible.
what I'm surprised you didn't mention (after mentioning his style error) was my use of camel and underscore naming conventions ;)
 
m59
@rlemon I'll have to ponder on this a bit. This may work for me. My reasoning now is that the if statement causes basically the same problem.
 
12:14 AM
makes sense to me to name them as such because I call getInfo() as a function and proccess_feed* is a handler passed as a named FE
 
m59
I may end up with about 15 ipieces of data to work with in that area. I'd rather not have to write out 15 lines in each loop.
 
@m59, you just need to change your definition of a 'problem'
 
@m59 but much less code duplication and much more readable.
 
@m59, well, 15 would be a problem
 
function getInfo(obj) {
  return {
    'title': obj.title,
    'imgSrc': obj.thumbnail[options.thumbQuality],
    'foo': obj.foo,
    'bar': obj.bar,
    'biz': obj.biz /* get my drift? */
  };
}
modularize your code
anything that repeats should be a function (kept within a closed scope of where it is repeated)
 
m59
12:17 AM
It is. This was pulled out of context for simplicity. My scope rules. I even defeated youtube's desire to make me make global options :)
 
ok well I gave you some insights on how I would break it down and split it up. you still only have one if statement execution per feed. you don't repeat anything really now.
var thumbInfo = [];
var collection = feed.data.items;
function getInfo(obj) {
	return {'title':obj.title, 'imgSrc':obj.thumbnail[options.thumbQuality]};
}
function process_feed(item,i) {
  thumbInfo[i] = getInfo(item);
}
function process_video_feed(item, i) {
  process_feed(item.video, i);
}
if (options.listType == 'playlist') {
	collection.forEach(process_feed);
} else {
	collection.forEach(process_video_feed);
}
^ small change.
 
m59
yeah, I'm starting to get it. I like it.
 
if you want IE8 support for Array.forEach you need to shim it. developer.mozilla.org/en-US/docs/JavaScript/Reference/… there is a light weight shim here
 
m59
/wrist
I wish IE would just die.
 
if ( !Array.prototype.forEach ) {
  Array.prototype.forEach = function(fn, scope) {
    for(var i = 0, len = this.length; i < len; ++i) {
      fn.call(scope, this[i], i, this);
    }
  }
}
not too bad
 
m59
12:23 AM
Yeah, but IE is so pathetic.
 
ie9 is better, ie10 is also better. but ie10 boasts about speed when they take shortcuts to gain performance. They don't render 60fps.. they compute 60fps but they render like 28 or something
^ canvas specifically here
 
ie still sucks
 
m59
^
 
agreed. but once they drop support for 7 and 8 the rage train won't be so bad.
 
m59
^ also
 
12:25 AM
I don't mind supporting ie9
 
m59
IE9 only trolls me for about 2 hours on a normal job. IE 7 and 8 really take the cake.
They turn a nice $40/hour job into $10, on occassion.
 
and by supporting i mean my shit doesn't blow up. if it's choppy or laggy or w/e then f u end user. Modern sites should cater to modern browsers, the rest need incentive to upgrade while not being alienated outright.
 
m59
I'm getting better at understanding fail, though.
 
^ imo
put it into the upfront contract that supporting ie8 adds 20% cost because it adds 40% development time, follow up with mentioning you're doing them a favor by giving them a 50% off deal on the ie8 support price.
they usually won't ask for ie7 support after that
 
m59
lol win.
Oddly, IE8 was worse on my previous job.
 
12:29 AM
ie makes my site links look bad for some reason
 
m59
Every browser including ie7 worked great, but IE8 had an exploding iframe...dunno what to call it.
 
seriously. make them a damn pie chart. people love pie charts. big ol' 40% to IE8 on there. break it down by dollar. if they can get the site without IE8 support for like 20% cheaper they might. if not you get what you deserve for having to support a shitty dated browser.
no one asks you to support Chrome 11 do they?
 
m59
lol
 
why should you be asked to support older IEs for free?
 
m59
I really am going to start doing this. It's brilliant.
 
12:31 AM
trick is to not make it a big deal in the contract, just skim by it. if they ask be prepared to give them a well worded professional reasoning for why you're charging for it.
but only put it in if they request older IE support.
 
m59
yep
Unfortunately, 20% of internet users are still on IE8...
or that's a big lie (I so hope to find out it is)
Why does Microsoft not "force" people to upgrade to IE9??
They can't show a friendly reminder everday?
 
below 20% for most demographics.
 
m59
everyday*
 
remember that there are a lot of closed network offices and governments using IE8
they won't upgrade for a long time. but they are also blocking outside access to 90% of the web.
so you're site isn't getting viewed by these browsers. probably never will.
most people who ask about IE users, once you explain this too them understand that there really isn't too many of them out there that their site is targeting.
anyone under 25 likely uses FF or chrome.
or their phone.
 
apparently this is how my site renders from ie net render website with ie7
 
m59
12:38 AM
btw, CSS3PIE ftw.
 
peoples grandparents use IE8... are you trying to get business from some old folks homes? why care about it?
^ exaggeration, but trying to make a point :P haha
anways. video games are now calling.
 
Where I work we 'officially' support anything that over 1% of users use
 
ouch
 
Largest site in the country, so unfortunately theres still a lot of people on IE7
 
my boss told me he doesn't care to support iOS or IE at all. I was so happy, but had to talk him into it (supporting an iOS app and latest IE that is).
 
12:40 AM
Only just stopped IE6
 
hehe I never thought I would be talking my boss into supporting ie or ios
but I figure if i'm making a mobile app for android that is basically going to be a webview pumping out my html interface.. how hard could it be to do the same in objective c?
 
Yeah, but why IE :P
 
this is what ie8 does to my page
 
m59
maybe they're trying now? But, I won't believe it for a long time.
 
12:43 AM
10 isn't bad
They actually seem to be following standard at least
 
m59
^ they paid you to say this
lol j/k
 
@phenomnomnominal no ten isn't bad. but I hate their propaganda - it's only 'faster' because it's doing less.
 
You couldn't pay me enough to use it though
Yeah exactly
 
granted I appreciate very much that they finally adopted some more standards.
 
m59
oh my
 
12:45 AM
It's just doesn't take as much effort to support it
 
no it doesn't.
Chromium is open source... hint hint M$
 
Now instead of wasting hours, I just have to turn on a computer with Windows 8 and say, yep, works.
 
m59
so...IE10 = css3 mask support?
 
!!/google caniuse css3 mask
!!/listcommands
 
m59
meh, I think it's just webkit
 
12:46 AM
idk. but experimental css3 features until implemented into the standards are fair game for non support imo
 
m59
yeah
that's a great one, though.
 
Absolutely
Bot go byebye?
 
!!/live
 
stupid router..
!!/refresh
nahh, that pc is all funky. the bot does crazy things to the memory when left open for a few weeks.
Ubuntu bugs out and as was the case before I left work but the bot was still up so I left it
and I also have a bad habit of leaving the console open and the bot logs everything. I imagine that has something to do with it as well.
!!/listcommands
:/
w/e
 
m59
1:06 AM
@rlemon In your example, I don't understand how forEach calls functions like that. How is it supposed to get item, i when those aren't passed in?
 
ok, do you understand this:
[1,2,3].forEach(function(number, index) {
  console.log(number, index);
});
 
m59
Yes.
 
ok so take the function, name it, and place it elsewhere for readability.
[1,2,3].forEach(log_me);
function log_me(number, index) {
  console.log(number, index);
}
!!> function foo() { return 'foo'; } console.log(foo, foo());
 
m59
It always passes the value and index, you mean?
 
@rlemon "undefined" Logged: "function foo() { return 'foo'; }","foo"
yes.
 
m59
1:10 AM
ah that rules
thanks
 
m59
LOl doh
 
inside the 'shim' you see. fn.call(scope, blah, blahh, blahhhh);
 
m59
I skipped right over that
my apologies.
 
that calls the function expression you pass in passing it the params you need
named function expressions can be passed around by their name. Adding the parentheses 'expresses' or invokes the function.
you can also use .call(thisArg, arg1, arg2 /* etc */); or .apply(thisArg, [arr_of_arguments]);
think about how you pass a callback function around . hehe better way of explaining it
sorry i'm 2 more beers away from being completely useless for advice :P
@phenomnomnominal hey, if the bot is ever down... use this bookmarklet.
javascript:(function(){var a=document.createElement("script");a.src="https://raw.github.com/Zirak/SO-ChatBot/master/master.js",document.head.appendChild(a)})();
then you are the bot.
 
1:16 AM
Sweet
 
also, bot.invocationPattern = "!!"; in the console.
obviously change the pattern to whatever.
 
what is the bot for?
 
Haha awesome
 
assuming you're intuitive enough to muck around with the bot in the console.. you can do a whole heap of cool shit without actually altering the source code
 
1:18 AM
ok
 
@benlevywebdesign the bot is basically a tool. a fun tool but a tool.
spiderman/tell benlevywebdesign help
!!/listcommands
@rlemon help, listen, eval, live, die, refresh, forget, ban, unban, info, jquery, choose, user, listcommands, purgecommands, define, norris, urban, parse, tell, mdn, spec, get, todo, learn, stop, resources, timer, hang, stat, nudge, beautify, undo, convert, google
the account @SOChatBot was setup to run the bot full time from a pc I have at work.
right now it seems he has crashed. being at home I cannot do a thing about it but run him locally.
Zirak built it
I changed the invocation pattern back to !!
!!/learn echo "$0"
@rlemon Command echo learned
!!/tell benlevywebdesign echo "You're welcome!"
 
!!/tell rlemon thanks!
 
@rlemon, can you teach it a command that does a specific search (eg mdn, urban), or are they built into the source?
 
@benlevywebdesign "You're welcome!"
@benlevywebdesign Command thanks! does not exist.
@phenomnomnominal built in. but easily forked and modified.
 
yeah I think i'll do one
 
1:21 AM
!!/tell rlemon echo "You're welcome!"
 
@rlemon "You're welcome!"
 
caniuse would be handy
 
did that work?
anyways
 
@phenomnomnominal just to print the link?
 
remember most have a REST api
it's not hard to utilize them
 
1:22 AM
!!/google benlevywebdesign
 
are you doing that or is it doing that for you
 
it's not hard to utilize their APIs either.
 
//a lesson on semi-bad practices and laziness
//chapter III
haha
 
@rlemon are you doing that
 
1:24 AM
^ no, the bot is running
it parses every message and looks for commands.
 
but it uses you as the chat line
 
then if it gets a command it actions and forces a response
yes, the pc that usually runs it needs a reboot but it's not near me
SO ChatBot, Your Browser
111 2 3
@benlevywebdesign Command greet learned
@benlevywebdesign Nudge registered.
also @benlevywebdesign i'm a room owner. I see all deletes.
1 min ago, by benlevywebdesign
!!/learn greet "Hello, $0!"
also
 
!!/info greet
@rlemon Command greet, created by benlevywebdesign on Fri, 11 Jan 2013 01:26:25 GMT but hasn't been used yet
!!/help greet
@rlemon greet: User-taught command: Hello, $0!
!!/greet rlemon
@rlemon Hello, rlemon!
 
!!/greet benlevywebdesign
 
1:29 AM
@benlevywebdesign Hello, benlevywebdesign!
 
just playing
 
@benlevywebdesign nudge SURPRISE!!!!!
!!cowthink e=oO T=|| what was that all about?
...
 
@rlemon hmm
 
 _________________________
( what was that all about? )
 -------------------------
        O   ^__^
         O  (oO)\_______
            (__)\       )\/\
             || ||----w |
                ||     ||
 
m59
lol my ocd
can someone advise me....how you think the best way to write a comment like this is...
// if IE8 or less
lol
 
1:31 AM
@benlevywebdesign Command suprise does not exist.
@benlevywebdesign Many things can be labeled Not a Number; a delay should not be one of them.
 
m59
//if IE < 9 ?
 
!!/tell benlevywebdesign help
@benlevywebdesign Many things can be labeled Not a Number; a delay should not be one of them.
@benlevywebdesign https://github.com/Zirak/SO-ChatBot/wiki/Interacting-with-the-bot
// If (IE8- || <=IE8 || IE8 or earlier || FUCK YOU UPGRADE YOU STUPID DORK!)
^ how I might do it
 
m59
lol
 
We're trying to find a new show to watch on Netflix
 
m59
these stupid little issues make my heart race :(
 
1:33 AM
Hopefully on the lighter side
suggestions?
 
m59
obsession is not win.
 
<!-- Le NoScript, for Le Dummies -->
<noscript>
<h1>Ohhh Nooos! No Javascript?!?!?!</h1>
<p>	It appears to us that you have decided not to enable Javascript.....<br>Are you an idiot?! It's 2012, don't be a douche, turn on Javascript.</p>
<p>	If you are behind a browser that does not <strong>have</strong> Javascript then I have no remorse for you. <a href="http://google.com/chrome">Time to upgrade.</a></p>
<p>	If you are viewing this from a smartphone or older mobile device without Javascript I strongly suggest it is time for <a href="http://www.google.com/nexus">an upgrade.</a></p>
I also put this in some of my sites
 
m59
ROFL.
 
@rlemon so after I type this !!/tell usrName I can type anything or not?
 
you must put a command
i made echo just a few minutes ago for that purpose
 
m59
1:35 AM
@rlemon iPhone or Android?
 
!!/tell benlevywebdesign echo "this is how you do it"
@benlevywebdesign "this is how you do it"
@m59 android
hate Apple
!!/die
 
m59
lol
 
sorry that is the issue with the bot. it invokes the 'spam' guard and I can't type
 
!!/tell rlemon echo "@benlevywebdesign thinks he has this one down"
 
@benlevywebdesign I killed the bot
 
1:36 AM
/me claps
 
@SomeKittens LURKER!
 
<!-- LE! Thore!
                     .-'`-.
                    / | |  \
                   /  | |   \       /---------\
                  |___|_|__  |     | I AM LE   |
                  ||<o>| <o>`|     |  THORE!   |
                  ||   J_   )|      \---------/
                  `|`-'__`-'|/      /
                   |  `--'  |    --*
                 .-|        |_
              .-'  \     /  | |`-.
           .-'      `.     /| |   \
          /           ````' | |    \
         |_____             | |     L
 
m59
1:38 AM
next time my wife brings up getting an iphone, the conversation will go:
--this and that....usual stuff-- "also, rlemon says"---etc---"and he came up with this boss solution to my for loop if statement issue, so he must be right."
 
i'm not french... and I never got why everyone uses 'le' in their HTML comments.
I see it everywhere
 
m59
When women can't understand why choose Android over iPhone, resort to fallacies that sound good!
 
<!-- Le script -->
 
m59
j/k, but my struggle with iPhone is that the games are sweet.
 
<!-- le stupid? -->
 
1:39 AM
@m59 bottom line. Apple is a shit company. their products are sexy but at what cost? imacs suffer serious issues with heat management for gaming and you cannot customize them. iphones recently have turned out to be shit and previous models were quasi shit
but it's not really about the product it's the company you're supporting
 
m59
lol, you are a man with passion, I see.
 
what kinda douchbag sells me a product than tells me I cannot do whatever I want to it?
It's my phone, if I wanna jailbreak it I will.
 
m59
Apple OS > Windows, though...on an incomparable level?
 
my android is rooted.
no it does not.
 
m59
mine too
 
1:41 AM
Apple OS could have been better than windows..
I don't find it intuitive at all.
 
you just may not be used to it at all
 
I can navigate almost any other operating system first type because they are intuitive to how computers work. Apple OS (not iOS) is confusing
@benlevywebdesign that is the point
you want your HMI to be usable by all first try
 
m59
It has a few features that are nice, but I mainly give Apple credit for a $20 OS I can put on 7 computers vs Windows $100 for one computer (until it fries) or $200 for 1 computer at a time (transferable).
and at that price, it still limits you to 16gb ram.
if you want more, you need to pay even more money for Windows.
 
@m59 ..... I can put linux on my fucking calculator... cost me nothing. I can also run my TV, car, computer, fridge, and coffee maker with it.
 
m59
Indeed. I love linux.
 
1:43 AM
yup,because its open source
 
m59
If I weren't lazy I would never touch windows or apple os ever again
 
don't get me wrong. I see a value in the Apple closed OS... just not their UX decisions.. My grandma can use Ubuntu or windows with little effort. She cannot do the same with a macbook.
 
but human build to be lazy
 
but my beef with their UX and my beef with the company aside... iPods kicked ass before they went all iPodTouch.
 
m59
Doing something like adding Windows Snap to linux is what turns me off of Linux. (lazy, I know). I'd just like a nice options interface for that, lol.
 
1:45 AM
seriously.. well done apple. you should have stayed there imo. (but they saw a way to make even more money and steve jobs was a marketing fucking god!)
i'ma cli kinda guy
 
I have android phone because I had one last phone and didn't want to go iphone route because it was gonna be like starting over and not much would transfer
 
I have the Samsung Galaxy Nexus .. kinda want the nexus 4 now.
might just get the nexus 10 because I don't see a point in getting a mildly better phone.
 
no sIII
 
S3 is awesome phone.
but nexus 4 is best android phone.
 
1:49 AM
why is that because the ads point out certain features?
 
:|
 
I don't care what any reviews say. they had a hand in designing it. it's the only phone on the market today that the OS was designed for
nexus class devices that is
however the S3 is still a nice device.
I'm trying to convince my GF to get rid of her crackberry and go android.
she doesn't like touch phones though. need a QWERTY keyboard.
 
does the android default web browser have a name?
 
Chrome
haha
 
I had to add chrome on android icecream
 
1:51 AM
JB comes with it native.
 
just called native or default? no 'code' name for it?
 
not that i'm aware of.
'android browser version X'
 
I used to like samsung untill they started doing s3 ads and saying the next best thing is already here and pointing out the put two phones together and tap to share
 
It probably will be chrome going forward..
 
yea, of course.
it's their browser.
and it's the best IMO
 
1:53 AM
Is the android default/native browser worth designing for?
 
no
 
web app running beautiful in chrome but filled with errors on native..
So maybe alert for users to download chrome?
 
design for the latest and greatest. when implementing ensure you follow progressive enhancements. basic functionality should be accessible for all. awesome experience only for those who are willing to provide you an awesome environment.
 
I like that approach
 
you shouldn't have errors... in a perfect world what you should do is this:
write the basic site in pure HTML using good old links and forms and everything. then spice it up with CSS.. then add some JS to make it more cool and interactive.
 
1:55 AM
even 'basic functionality' can be hard to hit though with webapps
it seems it either works great or falls flat completely..
 
guess what samsung my Motorola phone has the tap two phone together feature too
 
ok but if you have like a inline editor for WYSIWYG editing you don't need it.
apply it to a textfield using js. if the browser doesn't support js then you still have the textfield.
give it a proper action and method. but in js return false and cancel the event and submit via ajax.
..
 
I cannot possibly make this more clear to the guy
1
A: How can I control z-index of canvas objects?

Simon SarrisYou are most likely waiting for images to load before drawing them. Additionally, you are probably drawing lines as soon as you can. You need to wait for all images to load, then draw everything in the order you want (from farthest z-order to closest). Do not draw anything until all images have...

 
will watch thanks
 
Anyone have any favorite local storage examples? It's time for me to add one or two to the book
 
1:58 AM
NZ is a smart cookie. buy his book and read his blog
@SimonSarris I always like the eloquent js localStorage
err
nvm, I must be thinking something else.
 

« first day (818 days earlier)      last day (4128 days later) »