« first day (421 days earlier)      last day (4752 days later) » 

16:06
Vipersoundz
hey i have a good example of why not use long polling
for realtimeness ....
lol
What's the screenshot about?
see the page hits x|
1 php file getting hitted by 30 users for 1 hour
Hahaha
How are you implementing long-polling?
16:09
thats what happens when u try to get nodeish realtimeness with pHP .. with tons of bugs not to mention
it was .. not are
now i am just using node & websocket
Oh
How'd you manage to get node on the server?
talk to them.
explain them
[yeah second one took 3 months]
show em node demos vs php demos
Whom? What host are you using?
Vipersoundz dedicated
dual xeon
they use it for radio station & cdn
Ah
16:11
i thought it has more then enough power to host a chatsite :)
Oh, is this you - github.com/darkyen ?
yeap .. thanks for reminding me i need to update my github
Sure
done
needed to update chatsws -> tapeer
What is Tapeer exactly? That's what they're calling their chat webapp?
16:15
yap
Tapir is the mascot
an animal
the pronunciation is done as tapeer
Oh
so we named it tapeer :)
anyways brother
i have to go
i am still confused what to do
Hmm. Bye
with andriod smilies though
Data URI images?
16:17
nope
they need to be animated
and customizable
Oh
canvas is good
Oh
but not perfect solution
and Andriod dosnt supports SVG
on the browser
i am left with CSS 3 :|
nyways lets just do static images to begin with . and increase later on.
cya mate :) , and have a good day tomorrow
Yeah. Customiz-able will be a product by itself.
16:21
hi, anyone who can help me to answer this: stackoverflow.com/questions/8465064/…
Tom
Tom
16:38
Shouldn't origResList.children('li > div.vsc') be the same thing as origResList.children('li').children('div.vsc') ?
@user726730, nail your problem down to some short understandable sentence instead of pasting your whole code base and saying "it doesn't works".
@Tom, the first one makes my head spin.. it doesn't make any sense to have that kind of filtering selector in children
ok, i won't to have a google custom search engine..
in google.com/cse has information how to do that..
If i want to have a defirrent url who can i pass into result page the neccessery variables?
that's the issue
Tom
Tom
@Esailija why is that? It says: "select all children of origResList which have a direct div child with class vsc".
children already picks up the direct children of origResList, unless origRestList is all li elements, it doesn't pick up anything
*won't== want i must improve my english :)
Tom
Tom
16:43
@Esailija it does, the direct child check is in regards to the li, not in regards to the list. The children call makes sure that the li is a direct child of the list, which is a different matter.
origResList.children('li > div.vsc') is the same as origResList.children().filter( "li > div.vsc" )
so you have the direct children of something and then you filter them if they are a direct children of li which doesn't make any sense unless origResList is some abomination that has different types of elements in it or something
@Tom nop
as mentioned
first one is the children of type div.vsc whos parent is li second is grandchildren
Tom
Tom
@Esailija doesn't that filter keep all li elements that have a direct div child with class vsc?
I'll test it
var div = document.createElement("div");
div.className="vsc";
var li = document.createElement("li");
li.appendChild( div );
Element.prototype.webkitMatchesSelector.call( li, "li > div.vsc" );
@Tom this is why you dont use jQuery :\
16:55
returns false ... I have a bit of fever though maybe I appended them wrong :D
div is child of li right?
var div = document.createElement("div");
div.className="vsc";
var li = document.createElement("li");
li.appendChild( div );
div.webkitMatchesSelector("li > div.vsc" ) === true;
@Tom so basically the filter works for the div not the li
Mainly because CSS is read right -> left
Tom
Tom
@Esailija @Raynos alright that explains it
thanks a lot
anyone used Construct 2
looks pretty intersting. i'll have to look into the rendered outputs.
Which framework should I use for making mobile web applications??
how is js different on mobile, sure you use touch events but you can use those without any framework
so taking out the mobile from your question i t reads as what framework should I use
17:09
I want a framework that provides graphical components that is made for mobiles
isn't graphics in websites just css and html
you want a mobile templating engine?
@Esailija Man, why do you bother?
@rlemon Yes
and again how would the js in "mobile" templating engine differ from any other templating engine
@rlemon looks like a toy. Its a great toy though
@Hyperion its called the DOM
17:12
0
Q: What are the disadvantages of unobtrusive script patterns in web applications?

olivehourFirst of all, is there a name for this as a bona-fide design pattern? Currently I've just been referring to it as "unobtrusive javascript". Here is a brief example of what I am talking about: 1.) Use HTML5 data-* attributes to define values that will be used in UX scripts. Something like this: ...

@Esailija it doesn't - it is a way of defining the specification that mobile compatibility is a must. \ you are being pedantic - odd refreshed the page and double posted.
@Hyperion mobile uses shit slow internet. The less kb of js you can load the better
@Hyperion that's why all the pros recommend no frameworks
@rlemon I tried Sencha Touch, but the documentations sucks, you suddenly start using properties not defined in the API etc
like everyone is saying what you really are after is a standardized layout for mobile devices and desktop - lemmy get you a link
it's not a framework - but it will help - js should have nothing to do with your layout
@rlemon Thank you
17:17
the term is 'responsive layouts' - out drinking last night, couldn't think of it for a second.
boostinspiration.com/web-design/… here is a link from a quick google search
i'm sure there are better articles on the subject.
Not what I am looking for
Something like Sencha Touch is what I am after
but the documentation is bad
Sencha is a bunch of ui widgets built on a responsive layout
use JQM then - if you are already using jQuery, then adding another 25kb to the page.... i guess isn't going to tip the pot
and after reading more into it sencha uses jquery mobile
man that library has to be a hog on performance / footprint
just use jQuery Mobile - sencha looks like crap. \
what does JQM really add to the table, just looks bunch of hardcoded html to me
and if I'm reading the source right it's basically tightly coupled with a very specific html structure
I guess it's good if you just wanna get some generic thing quickly out there
17:42
So who thinks getting the refurbished TouchPad is a good idea?
0
Q: trouble with recursion; parsing JSON

stormdrainI have a json object like this: [{ "thing": "Top", "data": { "childs": [{ "thing": "a", "data": { "text": "sdfgdg1", "morestuff": { "thing": "Top", "data": { "c...

beautiful
user1385191
-1
A: Want to display "True" and "False" buttons

buddhabrotI've been seeing this code here for a while now: If you use jQuery, use it. Doing document.getElementById(..) suddenly is just nonsensical. Just use jQuery selectors everywhere, and methods (f.i. .addClass(..) instead of .className = ..). jQuery is the way you access your DOM, using a mix is jus...

@rlemon dont ever use JQM
Dont ever recommend JQM
JQM is a piece of shit that needs to die in a fire.
If you thought jQuery is bad then JQM IS ENDLESS RAGE
</rage>
    @MattMcDonald, using something like this is fast and no verbosity:

    var By = {
    	id: function () {},
    	"class": function () {},
    	name: function () {},
    	tag: function () {}
};
user1385191
lol
user1385191
17:50
the people that whine about getElementById are the same people that write cryptic code
user1385191
the bottom line is the method's namesake describes exactly what it does
the java verbosity of those methods does suck
user1385191
it's not a java-ism
user1385191
it's practicality
user1385191
it's how you're supposed to write code
17:53
annoyingLongMethodNamesAreVeryAnnoyingToReadAndWrite imo :P
user1385191
within reason
user1385191
I'd consider calculateTextContainerHeight to be the upper limit
Question "Write a Javascript to demonstrate different types of css ? " how do I answer this question ?
well gEBCN is pushing it very close to that level which is why I shortened it in the first place
it's describing what it does yes, but it awfully redundant verbosity
user1385191
how do you reduce the name without masking its purpose?
17:59
you could do Element.byId but Element is taken
@MattMcDonald ...
gEBCN & gEBI & gEBTN are verbose
By.id is tons of more describing than $ and very short
gist: tiny select. Selecting has never been so awesome \o/, 2011-12-10 16:01:27Z
// Pretty fast - http://jsperf.com/select-vs-natives-vs-jquery
/*
    Selector function. 

    @param String selector - selector to use. Works with "#foo", ".bar" and "tag".
    @param Node context - optional context to restrict search to, defaults to document.
    @return Node|NodeList
*/
function select(selector, context) {
    var c = selector.charAt(0),
        context = context || document;

    if (c === '#') {
        return context.getElementById(selector.substr(1));
    } else if (c === '.') {
        return context.getElementsByClassName(selector.substr(1));
    } else {
        return context.getElementsByTagName(selector);
    }
}

/*
  By, shortcuts for getting elements.
*/
var By = {
  id: function _byId(id) {
    return document.getElementById(id);
  },
  tag: function _byTag(tag, context) {
    return (context || document).getElementsByTagName(tag);
  },
  "class": function _byClass(klass, context) {
    return (context || document).getElementsByClassName(klass);
  }
};
user1385191
no way
user1385191
you've officially masked what is retrieved
user1385191
18:01
to a layman, that's cryptic
@Esailija I would recommend against By.name because name is weird and only works on Document
Name is just weird
yeah it was an addition for the fun of it
@MattMcDonald correct, don't use it in example code. But I would use something like that in a personal application
user1385191
what needs to be emphasized is we write code for more than ourselves
besides, get implies a getter what is actually happening is a find/search operation
18:02
Just like you use addClass utilities I would use By.id utilities
Looks complicated
user1385191
@Esailija agreeable
user1385191
that's something I try to avoid
it makes as much sense as setElementById to me
user1385191
fetchElementById
user1385191
18:04
if my interpretation is correct, that will grab an element from a hash table
yes get element by id is probably optimized to act actually as a getter but getElementsByClassName for example
anyway, there's nothing wrong with select("#id") , select(".class)", select("tag")
though I prefer By.id( "id" ) :P
not that I am using it yet... need to stop slacking and write some code
@Esailija Y U NO OPEN SAUCE
user1385191
18:08
thoughts?
if Node wasn't taken as well i'd probably do Node.byId( "id") and Node.make( "div")
doesn't meal hide is style.display = "none"
which probably further prooves the OP's point that you can't tell what hide really does unless you know it by heart
user1385191
what?
user1385191
if you don't animate it, it clearly sets elements to display: none
it doesn't clearly set style display none ... if you just look at the word hide
so I can see the confusion that he thinks it sets visibility = hidden
user1385191
18:14
if you don't animate, that for loop at the bottom will run
I was referring to the OP in that post thinking it sets visibility = hidden
which you don't know until you try it / read the source / docs
He said this, and they do entirely different things:

Is this
$("#Meal").hide();
really better than
document.getElementById("Meal").style.visibility = "hidden";
as in hide sets display.style = none and not visibility = hidden
user1385191
when you break down the verbiage, "hide" should point to visibility: hidden
user1385191
if an item is hidden, it still takes up physical space
yes it should
display none is more like preventRendering() or something D
is there really a difference between "visibility = hidden" and "display=none" if both take up physical space?
18:18
display none doesn't take physical space, it's not rendered at all
its in the source code still
i have updated my original post
http://stackoverflow.com/questions/8465064/google-custom-search-with-seo-url
user1385191
think of it this way
@MattMcDonald fu
in-browser "text editor" ("CodeMirror" huge waste of time
user1385191
visibility hides, like you would with a shoebox
user1385191
18:19
it still exists physically, but you can't see it
Ace is awesome
@MattMcDonald congrats on sounding like a right asshole :D
Welcome to the asshole club \o/
user1385191
display modifies the ability to display an element
display:none == visibility:hidden;position:absolute
user1385191
no physical space is taken up
user1385191
I work with this same idea in flash
user1385191
18:21
in flash, you have alpha and visible
in the browser internal level, display none elements are straight up disqualified from the rendering process
user1385191
alpha works like opacity, which is like visibility
at least that's what I read about webkit
hey all
user1385191
visible modifies the ability to render the display object
18:22
opacity:0;==visibility:hidden;
user1385191
much closer
when you send an http header via json, the content-type is applicatoin/json and the accept is application/json. What if you just sending regular request? What would be content type and accept type? thanks for response
text/html ?
maybe
im doing this via curl
user1385191
@Raynos I've yet to find an in-browser text editor actually worth using
user1385191
18:24
most are terribly intrusive
@MattMcDonald they don't exist.
However I think the ace editor on github works well
Try editing a file in github, it works pretty well.
user1385191
judging by what people say about the Range API, I can only imagine how much code is required
can i use a google csengine with a form that has post method?
user1385191
I'd recommend giving the form a name attribute as well
user1385191
optimally, it would match the id attribute
user1385191
18:34
@JohnMerlino you might want to try a question like this in something like the PHP room
1 message moved to PHP
@JohnMerlino bye o/
user1385191
since it's likely HTTP-related
dumping the trash in php room
I like it
all aboard the rage train \o/
19:21
@Raynos did you install linux yet
@ThomasBlobaum y u troll
I run linux at home :\
I have been for years
y u no programmable environment
o rly
RT @LearningThreejs: Learning Three.js: Contructive Solid Geometry With csg.js http://learningthreejs.com/blog/2011/12/10/constructive-solid-geometry-with-csg-js/
php room is dead
19:38
or maybe people are ignoring question which has nothing to do with php
you can find raw http headers under network > headers tab using developer tool of google chrome for anyone interested in knowing
I was just trying to log in via curl and was unable to so I thought investigating the headers would shed light, thats all
20:34
Hey guys
21:05
hi
Do anyone know how to get background "omni effect" like on icloud.com?
what is "omni effect" ?
enter to page, and you'll see what I'm talking about
no i dont see
from center to corners bg darkening
user1385191
21:08
You can use your current browser, but iCloud works best with the latest version of Safari, Firefox or Internet Explorer.
user1385191
(viewing in Opera)
got the same
Probably it's css3 radial gradient effect
And you can't view source why...?
user1385191
21:10
element.style {
	height: 1063px;
	left: -10000px;
	top: -10000px;
	width: 1920px;
	z-index: 100;
}
user1385191
LOL
opened in firefox and it looks exactly the same ... so .. why the bullshit ?
user1385191
good thing apple understands the internet
user1385191
...not
@MattMcDonald so what? do you see any gradiend or second bg image that creates this effect?
user1385191
21:13
the background is a canvas element
There is repeating pattern
and something else
user1385191
<canvas width="1792" style="width: 1792px; height: 1280px; position: absolute; z-index: 50; top: 50%; left: 50%; margin-left: -896px; margin-top: -640px" height="1280"/>
user1385191
boy, A+ CSS right there
@ThomasBlobaum what the hell
I update my stackoverflow page to link to twitter
and you add me.
user1385191
...not to mention another case of botched opera sniffing
21:16
I mean, there was a timegap of a few minutes, how did you find that so quickly
@Raynos , you got a stalker
user1385191
try reading the source code of the iCloud homepage
user1385191
I guess UA sniffing really isn't dead
@MattMcDonald .. or not , if you value you sanity
uh
twitter told me to follow raynos
21:19
hell .. why would even someone what something this ugly
just then
@ThomasBlobaum o.o
weird
user1385191
@ThomasBlobaum whats the point .. he posts like twice a month
ok , this just made me sad
if someone spends twice as long writing custom javascript, which only works in one or two browsers, over a library which already produces the same functionality with a huge community backing, then that's a sure sign that there is...
21:22
which would be the two browsers ?
safari, firefox most likely
user1385191
you see, apple has their own "framework" called "sproutcore"
you are clueless
user1385191
they spent years on it
user1385191
and it's a gargantuan pile of spaghetti
21:25
no, if you spent years on writing code , it should guarantee high quality
@MattMcDonald its not called sproutcore anymore
its amber.js these days
@MattMcDonald is there any framework thats not a poc?
user1385191
I liked my experience with "my library"
nice to see that JS is having the same problems as PHP
user1385191
I haven't used "APE" enough to judge it, but the author is solid
@tereško it only has it among those who know better
its unpopular to say "jQuery, X, Y, Z" is bad
21:27
well .. try saying "CodeIgniter is actually harmfull"
@MattMcDonald mind you, what do you think of libraries like spine or underscore? Some of the smaller sites
@tereško does the PHP community put on their hurr durr hats and rage at you?
user1385191
haven't had a need because I've never touched MVC
not the php channel in SO , but in general : yes
underscore isnt mvc, but I mean there are some smaller libraries out there that aren't bad
try reddit , for example
user1385191
21:29
oh, right; forgot about underscore
user1385191
yeah, underscore just seems like a utility lib
user1385191
any utilities I need short of animation are self-written
user1385191
well, and some server-side stuff
I guess so.
@MattMcDonald do you write your own ajax utilities?
user1385191
21:31
yes
Templating?
user1385191
server-side only
user1385191
don't see the point of client-side templating
i wasnt impressed with amber.js
felt like too much posturing and overuse of previous accomplishments
to build something up that isnt even there
user1385191
it would be nice if people dropped the ".js" nomenclature
21:33
argumentum ad verecundiam
@MattMcDonald client side templating is just there to reduce load on servers
its more efficient to send raw data rather then data rendered as html
@Raynos I think client side templating is there since not everybody is doing server-side devel :-)
user1385191
but it's rendered with JS, so when JS goes bad, so does the templating
user1385191
(ie: twitter)
@MattMcDonald yes, and? what do you mean "JS goes bad"
user1385191
21:36
fatal error
when the server has a fatal error you wont get the html either
user1385191
the server allows you to conceal many things
user1385191
you can't do that on the client
@MattMcDonald wait for win8 :-)
@MattMcDonald ...
21:48
@Raynos ... i'll unfollow
Is there a good reason to never use innerHTML and strictly use functions such as createElement, createTextNode, and removeChild?
The DOM isn't html nor is it a string, it's a tree. You shouldn't traverse a tree with a shotgun.
@ThomasBlobaum no it's cool.
The DOM is an output of a string, an html string, but it's a string just like js is a string.
@PaulPRO the reasoning is that HTML is serialized dom state, why serialize your DOM just to have the DOM parser compile it? you have access to the tree so using it explicitly is faster
user1385191
21:59
6
Q: What is better, appending new elements via DOM functions, or appending strings with HTML tags?

Chris SobolewskiI have seen a few different methods to add elements to the DOM. The most prevelent seem to be, for example, either document.getElementById('foo').innerHTML ='<p>Here is a brand new paragraph!</p>'; or newElement = document.createElement('p'); elementText = document.createTextNode...

s/compile/parse
user1385191
read my comments
1
Q: What is the best way to refactor this javascript code for repeated loops?

leoraI have to clean up some Javascript and I am trying to figure out a more elegant way to write this code below. It's basically looping through 3 dictionaries with the same loop structure and appending some custom HTML onto a specific div. I wanted to see if there is a way to avoid this repetitive ...

You are all too verbose. I explained it
:P
what if in javascript we put all our JSON in as strings and then JSON.parsed them?
thats the equivalent
Thanks guys, @Raynos your blog says there exceptions. I sometimes make AJAX requests which return HTML. Then I use .innerHTML to insert that HTML into an element on the page. Would that be a good example of an exception? Is it generally bad to return HTML from an AJAX request?
22:01
The equivalent is doing eval(code)
var retardedJSON = JSON.parse("{'foo':'bar'}");
@PaulPRO I personally think its bad to return HTML from ajax
thats the equivalent, which is similar to eval, yes
So I probably should make it a practice of mine to return a JSON string from the request and then build the HTML client side using createElement and such?
that would be slower than just tossing in serialized DOM (html)
22:03
JSON is sorta a dialect of js. html strings are html. The direct equivalent for taking an html string and turning it into its computational representation is taking a js string and turning it into its computational representation, a.k.a. eval
but when you have already loaded up the page, there is a performance advantage to working directly with the existing DOM tree, albeit small
@Zirak pedant more
user1385191
you can also think of the comparison between sever-side templating and just echoing out a long string
user1385191
templating allows objects to be objects, etc
you dont want to roll your own DOM serailize/unserialize
No, I guess it depends on the situation. If my Ajax request returns something like a <ul> full of <li>s but I don't know how many li's there are. It may be better to return an array of the li's contents as JSON then build the <ul> and <li>s client side?
But if I know nothing about the HTML before it's received I should use .innerHTML?
user1385191
22:09
array for sure
user1385191
instead of thinking in terms of tags, try thinking in terms of objects/arrays
user1385191
then build solutions around that ideology
user1385191
[
	{
		"text": "foo"
	},
	{
		"text": "bar"
	},
	{
		"text": "baz"
	}
]
If you know nothing about the html before it's received, it's a great reason to not use innerHTML. <script>location.href = "porn.com";</script> is not something you want
user1385191
so you'd loop through that array, build an li for each object, and append a text node for each
22:14
Sorry Zirak, I mean I know in advance that the HTML comes from my own server, it's just that the server side Ajax request could be complex and not always return a similar structure, I suppose that's probably a bad practice of it's own though.
I see how that would work well Matt :) If I wanted to add an inline style to the second li server side I could return something like:

[
{
"text": "foo"
},
{
"text": "bar"
},
{
"text": "baz",
"style": [{"font-weight": "bold"}]
}
]

And just change my JS to be add the styles correctly, right?
user1385191
say no to inline styles
user1385191
use CSS classes for that
user1385191
don't try to "serialize"
user1385191
try to "tweak" a template instead
22:32
hi every one
i need help with backbone.js

« first day (421 days earlier)      last day (4752 days later) »