« first day (850 days earlier)      last day (4099 days later) » 

12:00 AM
I challenge anyone to make snake in CSS + HTML only.
 
I'm not sure how keyboard interaction would work, other than that it seems very fugly but doable
 
was none - 4 'buttons' representing keys
it was the logic behind the random food generation
also the HTML structure to get it all working with the ~ and + sibling selectors was a bit messy
and making the snake move 'freely' with keyframes was intense.. never did get it working right.
 
What you need is something that converts basic code to css logic
 
<div class='wrap'>
    <div id='col2'>CODE PRO LIGHT
</div>
  <span class='drean'><font id='ss'>ABCDE</font><div id='sp'>FGHIJK</div><div id='sp'>LMNOP</div><div id='sp'>QRSTU</div><div id='spl'>VWXYZ</div></span>
  <div id='col1'>ABCDEFGHIJKLMNOPQR<br>STUVWXYZÀÁÒÈÉÊËÒÓÔ<br>ÕÖÙÚÛÜ0123456789?!&$
</div>
</div>
 
so you could use a very basic subset of javascript to write css logic, would be horrible, but it would be a lot easier
 
12:05 AM
> Robert Lemon : Looks like invalid HTML to me. :( Duplicate ID's make me sad.
 
How people use dupe ID's is beyond me
by nature an ID cannot be a duplicate.
 
they don't understand the basics :)
 
My favourite Vim tutorial (and it's not even about Vim): networkcomputing.com/unixworld/tutorial/009/009.html
 
They don't understand the difference between equality and identity
 
12:06 AM
class is semantic for understanding purposes.
the thing I love is when used properly HTML/CSS/JS is all perfectly semantic and makes sense. So why don't people write it this way?
 
There are several reasons,
 
> lets see.. I need a Nav. But what is a nav? really it's just a list. or lists of lists.. hrmm.. how will I do that. now I want it to be aside the main section on the page. and I want articles in the main section. They should all have headers and footers and generic content containers within them..... mmmmhmm. I'll use Tables. FOR ALL OF IT!!!
 
Mostly, it happens like this:
1)Coder gets project, wants to do it in a correct way
2)Client has deadline, so person in charge makes coder right code that just works, quick and dirty
3)Coder does it quick and dirty, under the full intent to rewrite it later for the final version, but the ugly version works so they use it instead.
4)Coder leaves job to kill self, other coder comes, sees horrible code and wonders why, he too has to make changes to that code and has no times so he makes things even worse
 
semantic (proper) html is longer to write and takes more fore-though. but I think it's worth it and the extra bits + time are worth it.
 
did you know that CNN has two meta encoding tags? They want to tell you their encoding so bad they tell you twice, and different things just in case
 
12:10 AM
<aside>
  <nav>
    <ul>
      <li>...</li>
      ....
    </ul>
  </nav>
</aside>
<!-- sweet, a side nav list! -->
NOT HARD!
but yea. in a perfect world..
 
I scraped a lot of websites, there is some horrible code on the web. It's not just tables, there is horrendous stuff
 
I try to make all of my code as semantic as possible.
 
Because semantics aren't as important as hipsters think they are ?
 
<body> tags that close half way through or don't appear in proper places, lots of messy <style> tags all around the page for no reason, tables as lists and lists as tables
 
js cannot be so much after it's been minified
@copy I don't think it's so much a problem with the hipsters as the novice or stubborn.
and there is more bad advice than good on the web for web development as it would seem.
 
12:13 AM
@copy mostly because when you write bad html it usually costs you nothing in the future since it's just markup
 
it's never just markup
 
I wouldn't say it costs you nothing...
 
it's as important as any other aspect of the development cycle.
 
Messy HTML probably means messy everything else
 
@BenjaminGruenbaum See ? And nobody cares if you write your navigation as <div id="nav"> or <nav>
 
12:14 AM
usually, it's bad and you shouldn't do it
 
@copy I CARE! I CARE AND I WANT EVERYONE TO KNOW IT!
sobs < tears not sonsofbitches
 
@copy I was agreeing with you. I think semantic HTML is very important for maintaining it, but it takes very little maintaining generally
@phenomnomnominal yes, but I would take messy HTML over messy JS any day
 
<meta rel=next> actually has a purpose, but <nav> ... not really
 
it's easier to write
and easier to understand
 
@copy easier to read/write and understand - why use anything but divs + classes + css if that is your outlook?
 
12:16 AM
Would $("#menu li"); return all list items within #menu?
 
yes
^ great chart
 
@rlemon Yeah, but it's not a high-priority thing to force everyone to write HTML like this
 
bad thinking
 
then .removeClass("active"); would loop through and remove all active classes from them?
 
being complacent of mediocrity has no limits - starts with HTML. next you'll be using FRAMES and jQuery.
then crack.
 
m59
12:20 AM
@rlemon ^ trying not to be mediocre is the bane of my existence.
 
@copy it was a few years ago, I agree that not so much since all the browsers are fairly complaint. just a few years ago most websites did not work on browsers other than IE
 
m59
If I was willing to be mediocre, I'd probably be making thousands of dollars right now rather than "trying" to write the same plugin over and over.
 
so $("#menu li").removeClass("active"); is essentially the same thing as writing this in JavaScript.... var item = document.getElementById("menu").getElementsByTagName("li"); for (var i = 0; i < items.length; i++) { item[i].removeAttribute("class"); }
 
m59
@W3Geek that looks right
 
Thanks :)
 
12:37 AM
@W3Geek, no, what it the attribute has mutliple classes?
 
@phenomnomnominal that code seems to be working perfectly for me. That is the con though, the element cannot have multiple classes with this code. I'm trying to work out that kink.
 
speaking of semantic html....
<article>
  <section>
    ....
  </section>
</article>
<section>
...comments...
</section>
// or
<article>
  <section>
    .. post
  </section>
  <section>
    .. comments
  </section>
</article>
tl;dr - should the section for comments be in the article tag?
I think not. would make no sense
 
m59
@rlemon I'd say not, why use extra fluff?
 
well. no extra fluff - just tag positioning.
 
m59
ohhhh
I meant rather, why have section inside of article at all? If there is only one?
but I'd go with comments after, not in
 
12:45 AM
article -> post + comments
-------------------------------------------- vs
article -> post
comments
semantics :P
the section within allows me to break it into sub sections if need be
 
m59
Yeah, but would you use it even if there were no sub sections?
 
easier to style if I know it will be there always
 
m59
I'd go with the 2nd one, though.
gotcha
@rlemon any chance I could speak with you privately a few minutes?
 
iz all seen by the allmighty google.
 
m59
not like I know anything, btw. So my preference is meaningless lol
@rlemon I wish you would freelance your help
 
12:55 AM
I'm not a designer.
 
m59
but you are brilliant
 
just regurgitating what i've read online :) thats the beauty of it all.
it's not hard to see the good from the bad if you just sit down and think about it for a second.
 
m59
I'm trying my head off and getting nowhere.
Hour 15 of this fail :(
 
but you are starting with a plugin for a library for a language you do not yet understand amirite?
 
m59
I do most of my stuff in vanilla javascript
 
12:57 AM
cool. but this 15 hour headache - this is what i'm talking about
 
m59
Yeah, which has nothing to do with jQuery.
I've already made it work a few different ways...
 
you want to make a cool jQuery plugin to start off? - go look at twitter bootstrap "plugins/components" - they are good examples (minus the no ;) of a good plugin
 
m59
as I said, I can't be satisfied knowing it can be better.
 
@W3Geek, how about:
 
my advice then - put it on github - then codereview.stackexchange.com and point it to the github + a little spiel about it - then take all the crit you think is well taken.
 
12:59 AM
var item = document.getElementById("menu").getElementsByTagName("li");
for (var i = 0; i < items.length; i++) {
  item[i].className.replace("nameOfTheClass", '');
}
 
people will critique it all day long - you will filter those and see which you would like to heed
 
m59
well, I deleted all of the code I didn't like, since I know what's wrong with it already...
 
lol
Anyone: Can you su in FileZilla ?? :P
 
Are there any issues with Array.prototype.forEach.call(someNodeList, someFunction)?
 
fuck I wish I knew more about this shit
@phenomnomnominal IE9+ without shim
 
1:02 AM
@phenomnomnominal That works perfectly. :D I worked through that jQuery code last night, ported it over to JavaScript and pretty much understand how it works.
Its like a big math problem.
 
Yeah I mean does that just work? Theres no other annoying properties of a Nodelist that fucks it up?
 
nope, not really.
 
it's a static node list at that point
you can shorthand with [].forEach.call() also
 
Array.prototype.forEach(document.querySelectorAll("#menu li"), function (el) { el.className.replace(className, ''); });?
 
1:05 AM
s/el.className/el.className = el.className
 
Same as: $("#menu li").removeClass("active");
 
[].forEach.call(document.getElementById('menu').getElementsByTagName('li'), function(el) { el.className.replace('active', ,''); });
 
copy, that would remove the whole thing right?
 
No, I mean replace returns the replaced value
 
Oh good call, duh
 
m59
1:07 AM
Is there anyone here that feels competent enough to solve something for me in return for a paypal donation?
 
lol
not your damn plugin!
 
The nodeList can be somewhat annoying sometimes.
 
:P
yea
Florian has a good alternative
 
I'd write a wrapper function if I ever had to use it
 
1:08 AM
NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach;
NodeList.prototype.map = HTMLCollection.prototype.map = Array.prototype.map;
NodeList.prototype.filter = HTMLCollection.prototype.filter = Array.prototype.filter;
NodeList.prototype.reduce = HTMLCollection.prototype.reduce = Array.prototype.reduce;
NodeList.prototype.every = HTMLCollection.prototype.every = Array.prototype.every;
NodeList.prototype.some = HTMLCollection.prototype.some = Array.prototype.some;
 
lol :D
wow that website is horrid.... AHHH can't unsee.
 
m59
?
I hope this dude knows object oriented programming and the constructor pattern :(
@rlemon you sure you wouldn't rather have this $30 rather than me pay a dude that I can only hope knows what he is talking about?
I should have just paid someone $150 and have my life back
 
Dr. Annette Schavan ist die anerkannteste und profilierteste Bildungspolitikerin unseres Landes.
 
1:26 AM
YaY! blog.lemonmeme.com the website is ugly as sin! no css.
but look at that source!
disclaimer: the md - html conversion is not done by my code - I take no ownership
the posts (mine) suck as well.
 
m59
for the record....screw that site. I can't get anyone to answer.
 
also: WIP - so f off.
 
Any clue why Chrome isnt displaying the CSS pattern?
http://dl.dropbox.com/u/53738503/Disguise-Me/Index.html
 
@m59 what are you trying to know
 
m59
You'd have to see it to understand.
 
1:30 AM
give me a nutshell. are you trying to just get help on your script? or are you trying to learn something
 
m59
it's both, I guess? I get the idea (I think)...I just solve it cleanly with perfect performance. I always do something that doesn't really make sense, though it works.
I've had some suggestions but I don't prefer them.
 
@OliverSchöning I'm guessing the gradient syntax is wrong
 
@RyanKinal blog.lemonmeme.com please - source code comments?
HTML semantics
sorry for indentation + et al.
 
@RyanKinal Firefox works though
 
stubs glued together
 
m59
1:33 AM
@RyanKinal I checked out the template thing, but I don't see why use that when I have otherwise accomplished what I need to in about 25 lines of sloppy but functional code.
 
@OliverSchöning I'm fairly certain they have different syntaxes for gradients.
 
@OliverSchöning RTFD
 
> This document was successfully checked as HTML5!
:)
first try!
MOM! MOM! LOOK! W3C LIKES ME!
 
@RyanKinal Ty
 
1:35 AM
@rlemon Why the section within section.content?
@m59 Well, it's up to you, obviously. But, in general, templating is pretty awesome.
 
0
Q: 2D js physics engine for HTML4

Frederico SchardongIs there any engine for Javascript like box2dweb that does not use Canvas? I need to build a game that works in HTML4 browsers.

 
let me check
hrmm. it seems I did double up on that.
good catch
:D
 
:-)
 
m59
@RyanKinal I do suck, I could just not be seeing it like you do. It seems like adding that would be more bulk than my entire plugin...
Which really defeats what I'm going for.
 
fixed
 
1:39 AM
@m59 Oh, sure. I could definitely see that.
 
m59
@RyanKinal dunno if you have been around...would you be willing to look at this code and help me with a solution for a donation?
It's either I pay someone or hang it up...and that would really suck.
 
Sorry, but I have slicktext issues to attend to
 
m59
ok
 
Cheers, found a site that has the same patters but specifies for FF and Chrome :)
 
m59
What do you do when you can't come up with a system that works?
Should I just write it poorly again and post it so other people can tell me it's poor and hope they inform me of a better method?
 
1:50 AM
yes
 
m59
on github?
 
On codereview.se
 
m59
it's ok to post very unfinished code?
 
I think so, yeah
 
m59
access denied??
 
1:55 AM
 
and with a little bit of bootstrap the site looks not atrocious
 
m59
I'm downloading the backup of my server files...I'll get my old crappy code back.
prob going to take hours to download, so I'll just try not to think about it until then
see ya
 
2:13 AM
@noob1992 would be able to fix it.
 
2:29 AM
He's the best programmer ever.
 
3:01 AM
He's even better than that.
Best anything ever.
 
sam
hi
i need to parse this rss to get the img src
feed://dribbble.com/tags/3d.rss
 
3:20 AM
I just saw an ad that said "Are you sure HTML5 is right for you?"
I don't even want to know the awful things they are telling the world...
 
God they're probably promoting flash
 
Haha probably. Some shit company trying to hold onto a market that's disappearing...
 
Silverlight...
 
haha that would be great... now I kind of wish I had clicked on it just to know
hhhmmm now I got an ad saying "Is HTML5 right for you?", which is kind of the opposite, but targeting the same clueless people
I don't think Pandora thinks very highly of me...
 
3:40 AM
What is the proper way of call a function from setTimeout when you need to pass in a argument?
I have this and it does not seem to work.
// setTimeout('scrollTo(' + id + ')', 32);
chat was trying to execute it so I just pre-appended it with //
 
why are you wrapping the function call in quotations?
Shouldn't it just be:
//setTimeout(someFunc(arg), delay); ?
 
I've seen numerous people do that and it works. I don't understand it myself. No... that doesn't work maximum call stack error.
 
jsfiddle?
 
2
Q: Maximum Call Stack Size Exceeded

Howdy_McGeeI'm trying to call my function every 4 seconds so it will increment a number live. For some reason I keep getting errors. Here's my code: <html> <head> <title>Recycle Counter</title> <script type="text/javascript"> function rand(from, to) { return Mat...

check that last comment.
I think when you put it inside quotes it doesn't invoke the function right away.
Oh I think I figured it out. :D
 
@W3Geek Don't put the function in quotes for setTimeout. W3schools isn't a good resource.
 
3:51 AM
I've never used W3Schools. I'm using an anonymous function instead.
 
Sup kittens, long time no see
 
@monners \o
Currently trying to shift our database to something that doesn't drive me crazy.
 
Away from Mongo?
 
"Something slapped together to test our CSS" -> "Actual schema that's built to allow extension"
and I like mongodb, thankyouverymuch
 
I just started at a new company. .NET framework though...
 
3:58 AM
That's what I thought
 
Yay Mongo
 
I would have been very surprised if you were moving away from it
 
basically, it's forcing me to really thing about how this thing is built
 
And that's bad?
 
Always a plus
 
3:59 AM
I've discovered a bad practice in our cart storage that'll need to be rooted out
@monners I'd much rather be slamming out code that does flashy things that I can show off
 
lol, instead of solving problems like a boss?
 
Solving problems like a boss === assign some peon to handle it. Give self raise.
2
There are glamorous and non-glamorous parts of startups.
 
I'll trade ya, I've spent the last week trying to explain to a print designer why their content doesn't display pixel perfect across all browsers
 
0
Q: Playing sound on a button click

DecrypterI am new to javascript and want to make sure I am on the right track when playing a sound. Is there anything I should not be doing better or not be doing at all. Below is a simple function. <script language="javascript" type="text/javascript"> function playSound(soundfile) { if (naviga...

 
@monners ewwwww. No deal.
I love working with half-formed test data: Invalid Date - Invalid Date
 
m59
4:38 AM
I got the backup of my file and posted it codereview.stackexchange.com/questions/21605/…
there's so much wrong with that but it's the best I could think of :(
 
0
Q: Creating and referencing markup....cloning, etc. efficient system for this plugin

m59I am pulling multiple feeds from youtube that have a callback function which makes markup from each feed. Right now, I have it setup for them to add that markup to var markup and the feed info to var allInfo. When all the feeds have contributed what they should, a final callback is called. Each f...

 
5:39 AM
I downloaded a website via FileZilla, it uses Wordpress, I have trouble to open it offline.. what file am I looking for?
 
Is that a question?
 
I .. I think so, google didnt want to help me, and I think it wont fit on SO, so I asked here :o
 
5:55 AM
guys
is it possible to cache methods in javascript? something like a = Math.random; then call it using a()*12;
would lamda(or functional) approach work in this case?
got it work by creating a simple object
m={};m.r=function(){return Math.random();}
 
@OliverSchöning You won't be able to open a wordpress site locally unless you're running some kind of MAMP/WAMP server
 
kk, I check it out
 
6:12 AM
@TemporaryNickName, you should be able to do it just like this:
var a = Math.random; a();
 
sick, I actually fixed the code above as m={a:function(z){return Math.random()*z} but a=Math.random;a() is cleaner =D thx
 
You can also do things like var π = Math.PI
 
sick thx
is var p = Math.PI same as static import in Java or it's functional programming approach
?
 
It's just assignment.
Ï€ is a valid Javascript identifier, so it works.
 
cool cool cool
 
6:23 AM
The functional nature of JS mainly comes from the fact that functions are first class objects.
 
hi all, I have a quick question. I have many similar divs, div1 div2 div3 etc. they all have same class but different ID, I want to be able to click at each one of them to toggle a class to that div, right now I have like this:
$(document).ready(function() {
$("#test1, #test2, #test3").on('click', '.default_class', function () {
$(this).toggleClass("new_class");
});
});
is there any way to edit the script so it understand if I add more divs = test4, test5 etc
 
well
u can apply .on on just document
 
$(document).ready(function() {
  $(".default_class").on('click', function () {
      $(this).toggleClass("new_class");
    });
});
Which can be shortened to:
$(function() {
  $(".default_class").click(function () {
      $(this).toggleClass("new_class");
    });
});
 
$(document).on('click', '.deafult_class', function(){//stuff});
 
6:28 AM
Which can further be shortened to:
 
@phenomnomnominal if you want to apply on that way, wouldn't bind() work better?
 
$(function(){$(".default_class").click(function(){$(this).toggleClass("new_class")})});
:P
 
Oh you :P
 
@phenomnomnominal Thx, that worked great!
 
and click just calls on
 
6:29 AM
yeah
 
@Zirak Damn! Where do you get these? (babies, not the jokes :P)
 
is there any way to make this so when click on a div, its get the new_class, and when clicking on a other div that div get the new_class and the div before automaticly "untoggle"?
so only one div can have new_class at the time?
 
$(function() {
  $(".default_class").click(function () {
      $(".default_class").removeClass("new_class");
      $(this).addClass("new_class");
    });
});
Is one way
 
You are a king
thanks alot
 
There's probably a jquery function for it though
 
6:46 AM
just a quick question more, is it able to when click on the class that have the "new_class" in this cript to make it untoggle?
@phenomnomnominal now when clicking
on some other div the class untoggle but when clicking on the div that have new_class it dossent untoggle
 
$(function() {
  $(".default_class").click(function () {
      $(".default_class").not(this).removeClass("new_class");
      $(this).toggleClass("new_class");
    });
});
Might work? Not sure if that's what you want though
 
it did, so, now there cant be any more problems with this script so thank you alot.
 
Okay, but please not that this room is not in the habit of giving away code... I'm just feeling generous
 
7:33 AM
- Eval replaced string

There's also the possibility of putting your script in a string, replacing repetitive strings with a certain token and replacing those tokens right before passing the value on to eval using .replace and regular expressions. See this sexy example: eval("? t() { alert('hello') };t()".replace(/?/g, 'function')). The example doesn't save bytes, but you can write a script that will for your script.
that's sick =3
just a question. is this ok and not evil for regular JS apps?
 
7:54 AM
This is not OK. Even if you do it once on script load, and you call it "compression", it still slows things down.
 
so it's pretty much
loading ur script twice
 
Also, unless it's performed by a server-side script, you lose maintainability and syntax coloring.
 
true that
 
Good point.
 
what's happening to variable & function scopes?
 
7:57 AM
What do you mean?
 
i think i read somewhere eval makes things declared using eval becomes global?
is that true?
 
Anything that's been evaled has access to the current scope
 
eval acts within its caller scope
 
!!/google eval scope
 
!!/test
 
There's a really good article on how the scope created by eval is annoying
 
@rlemon Did your company stop you from hosting the bot now or something?
 
Should I start hosting the bot? What are the system requirements?
 
Well, just a browser for now. @Zirak was making progress with running it in NodeJS, though
 
8:04 AM
I was worrying about the RAM needed, and I've heard it needed frequent manual restarts
 
Not really. rlemon's browser used to hang sometimes, but that might just be the chat. The manual refreshing can be done by any of us bot "owners" with a simple !!/refresh
 
What happens when two people host the bot?
(at the same time)
 
If two people are hosting it on different accounts, both will respond like they're bots
 
Two bots
 
8:07 AM
You can define the calling thing (eg !!) though when you init it right?
 
Even after you initialize it
Got to go. Bye!
 
Yeah, you can. And I'm just a twat so I don't host it yet, but I will soon! Pwomise!
 
it's pretty weird that firebug always print out previous bug i had and if i refresh it once more it doesn't print the bug anymore
 
pwomise.then(function(){User.byName("jan dvorak").notify()})
>The word twat has various functions. It is a vulgar synonym for the human vulva...
--wikipedia
 
This fine site has no problem on IE : sewingandembroiderywarehouse.com/embtrb.htm
 
8:21 AM
u also have word "cunt"
aussies love to use cunt, twat all day
 
hey, the pope's quitting. @GNi33, there's your chance!
 
@dystroy this explains a lot. Though it's no excuse. There is no excuse for developing for IE only. Not today. Not ever.
how did you find out, BTW?
Also, Chrome failed me when I tried to style the font tag.
It didn't even indicate my CSS rule was overriden. No... nothing... it just destroyed the rule.
 
@JanDvorak I found it on reddit. It was rightly titled "Why you always should close your tags" or something like that.
 
!!/help
 
Is this link to the js file legal (with the space) ?
0
Q: why won't the added email address display in the messageBox?

Matthew LillistoneI have an html file: <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="C:\Users\matthew\AppData\Local\Temp\fz3temp-1\email picker.css"> <script src="email picker.js" type="text/javascript"></script> </head> <body> ...

 
8:46 AM
ok, loaded, should be up for the forseeable future. Also disabled the idle thing, as it doesn't work.
 
What idle thing?
 
Added a feature so if the room goes idle for 5 minutes, the bot says something controversial, opinionated or just amusing.
 
any know about Google Hangout App. here?
 
But it's supposed to do that only once after the room goes idle, and for some it repeats every 5 minutes. Bug is somewhere in the time handling obviously, just need to pinpoint it.
 
5 minutes ? It's a little short... People won't even have the time to see the last feed/question/link/comment if it wasn't immediately answered.
 
8:58 AM
It's not hard to adjust, 5 was just a random starting number.
 
quick question
 
@all
 
@TemporaryNickName ask away. Your time is running... now
 
any one families with google hangout app.?
 
i figured that 0+(+"1") converts this string to a int type
but is this the correct syntax?
 
8:59 AM
The answers here are all terrible
1
Q: What's the name of this webdesign element/trick?

PaulSurfing the web I see websites with a floating design element. But I cannot find how it is called. Does somebody know the name of the following element: At the adobe website there is a yellow box with the question "Was this helpful?". When you scroll down it stays at the top of the screen. http:...

 
trying to use + operator trick
 
yeah, it's the unary +
 
@TemporaryNickName correct for what ?
 
it wouldn't work if i go +(+"1")
 
8:59 AM
Please answer my question:

http://stackoverflow.com/questions/14828712/whats-the-name-of-this-webdesign-element-trick
 

« first day (850 days earlier)      last day (4099 days later) »