« first day (499 days earlier)      last day (4674 days later) » 

GGG
GGG
00:19
@Raynos you should organize all these gist scraps into some kind of hierarchical navigable thing
@GGG as in get the good ones?
gist: My starred gists, 2012-02-27 00:33:54Z
 - [Shim status of ES6][1]
 - [unshimmable subset of ES5][2]
 - [Host objects][3]
 - [Why you don't need jQuery][4]
 - [All the DOM recursion you'll ever need][5]
 - [The heart of pd][6]
 - [jQuery library critique][7]

  [1]: https://gist.github.com/1665192
  [2]: https://gist.github.com/1664895
  [3]: https://gist.github.com/1629399
  [4]: https://gist.github.com/1613169
  [5]: https://gist.github.com/1473536
  [6]: https://gist.github.com/1441105
  [7]: https://gist.github.com/1417030
00:50
gist: My starred gists, 2012-02-27 00:33:54Z
 - [Shim status of ES6][1]
 - [unshimmable subset of ES5][2]
 - [Host objects][3]
 - [Why you don't need jQuery][4]
 - [All the DOM recursion you'll ever need][5]
 - [The heart of pd][6]
 - [jQuery library critique][7]
 - [klass][8]
 - [tiny select][9]
 - [shallow clone][10]
 - [pub sub][11]
 - [example of after][12]
 - [Name.js][13]
 - [Early control flow example][14]
 - [Original after.js][15]

  [1]: https://gist.github.com/1665192
  [2]: https://gist.github.com/1664895
  [3]: https://gist.github.com/1629399
  [4]: https://gist.github.com/1613169
  [5]: https://gist.github.com/1473536
  [6]: https://gist.github.com/1441105
  [7]: https://gist.github.com/1417030
  [8]: https://gist.github.com/1502989
  [9]: https://gist.github.com/1455456
  [10]: https://gist.github.com/1452024
  [11]: https://gist.github.com/1412316
  [12]: https://gist.github.com/1381146
  [13]: https://gist.github.com/1344853
  [14]: https://gist.github.com/1155543
  [15]: https://gist.github.com/1115502
Those are all the useful ones I have.
GGG
GGG
Starred :)
i must fix recursivelyWalk for you hang on ;)
someone should put in an SO chat request to do the markdown right in the github things
agreed
GGG
GGG
i like that it exits early if cb returns, nice one
@CharlesSprayberry your school article makes me sad
@CharlesSprayberry you dont learn web dev at school, you learn computer science at school, things like data structures, theory, maths, algorithms, C, LISP, etc
@CharlesSprayberry your method of getting a job isn't unorthodox, I pretty much did the same.
01:05
@Raynos Perhaps. But, that school was clearly not the place to get that education.
01:17
any JS pros able to look at my question - no one has been able to solve it :( asked on a few forums so far
if any one does have the time: stackoverflow.com/questions/9449871/…
Hey, this is not really java related or in general, programming related in any way but I can't find a better place to look for an answer after spending some time on google: does anyone know about the file extension ".stream" or opening a flash stream in vlc?
wouldn't you have better chance of an answer - asking in a chat which the subject was flash ?
personally i don't know the answer to that.
i would but only if someone replies...
GGG
GGG
@Raynos did i mess this up? it seems too simple
function walk(nodes, cb) {
    var cursor = nodes[0], last, ret;
    do {
        last = cursor;
        do {
            if (ret = cb(cursor)) return ret;
        } while (cursor = cursor.firstChild);
        cursor = last;
    } while (cursor = cursor.nextSibling);
}


walk(document.body.children, function(x){console.log(x)})​
supposed to be a recursivelyWalk without the recursion ;)
01:43
Hi, Does anyone have an Idea of displaying a calendar icon(displaying calendar) beside two input fields start date and end date using .js files????
Thanks for the stuff. I have already gone through the web, done according but cun'dt get any expected results
GGG
GGG
what so your tried some of these calendar scripts and none of them worked for you?
Yes, I am not knowing the correct format of where to place the code in my index.jsp page...
I would like to know where exactly should I place the below code??
Calendar.setup(
{
inputField : "dateFrom", // ID of the input field
ifFormat : "%d/%m/%Y", // the date format
button : "imgCal" // ID of the calendar image
}
);
GGG
GGG
02:00
well, tell me, what kind of code is that?
javascript
GGG
GGG
ok... so where does javascript go
Javascript is used in index page for date validation
Thanks again! I know this stuff..But couln't get an idea as how I am going to implement in my code
The output displays two date fields..I want a calendar icon beside each date field so that I can select the dates....For this I have some datePicker files(library files) where I need to link these to Eclipse and initialise calendar object present the code as given and they should respond to on click..
My question is how do I place this code ideally within an window.onload or at the bottom of my page right before the </html>
??
Can you please help me sort out this issue??
02:23
graceful-degradation/progressive-enhancement nerds: (shameless self-promotion) codereview.stackexchange.com/questions/9436/…
GGG
GGG
02:42
@ThomasShields where is the codez
maybe paste some of the css in there?
@GGG didn't think I really needed all the code.
since it was more of a theory question.
edit: added.
GGG
GGG
yeah kinda hard to do a code review with no code ;)
ok i'm not really sure that's appropriate for code review either
but i have some thoughts
but not enough thoughts to really answer the question ;)
@GGG where do you think it should be?
feel free to hit me with your thoughts now/here, or comment
GGG
GGG
probably floating amidst the SO bowl of turds unfortunately... not that it's a turd, just that i don't know of a better home for it
but anyway my main thought it this:
well, if I get any feedback from the rest of the CR community i'll migrate it.
02:52
stupid canvas scrolling >.< never guna get it to work
GGG
GGG
those characters may not show up everywhere... like screenreaders and stuff especially...
i think i would have the degraded version have no special characters (the graphical things)
@GGG yeah, but if it's a screenreader the CSS won't render anyways - and they'll see the rest of the link, with the text
GGG
GGG
add them to the enhanced version with something like :before
also, those characters should show up, if the encoding is set right
GGG
GGG
well what about browsers that don't have the characters
i guess all that stuff has been there for over a decade though
02:53
In jQuery, is it better to create a template element and clone it when you need it, or just create it again and again when you need it?
GGG
GGG
but i'm not sure it would show up in text browsers, etc
I used to think it would be better to clone it, but I'm having second thoughts
@GGG yeah, but the character doesn't need to show up in text browsers - the rest of the link (like the "edit" or "delete") will show up.
It would probably be wise for me to look at the clone source.
GGG
GGG
yeah, but the little weird box might show up instead =p
plus, you're adding a picture of a pencil as content, when it's style
02:55
@GGG you think someone using a text browser is going to care about that, lol?
@GGG now that's a good point.
maybe i can hack up something with :before that, if :before is enabled (which likely means the special chars will show up) it would override the default link
I'm going to do a benchmark on cloning vs creating
I thought cloning would act as a cache mechanism
GGG
GGG
@andrewjackson use jsperf and share them when you're done :)
GGG
GGG
@ThomasShields it's probably more practical not to use :before, and just do it the way you're doing it... :before won't work in ie7 for example
Can you guys please try to solve my issue?
03:02
@GGG yeah, good point. Plus, you could argue that the pencil/x are content - just like an image is content. They're just visual, descriptive content. I'll just keep it as it is unless I find out those chars won't show up on some browsers.
GGG
GGG
make sure you actually try it in lynx/w3m too... if it works there you can pretty much consider it a success
@GGG yeah good idea.
turns out creating the element is faster
Wait.. that's weird... cloning is faster the second time around
oh nm
is my setup code right?
"template" doesn't need to be on the global scope? seems to be enclosed imo
@ThomasShields what is this?
03:15
@andrewjackson screenshot of Lynx, successfully displaying lesser-known pencil/x/+ characters.
nice
I want to use the pencil character now
@ThomasShields thanks! =D
GGG
GGG
@ThomasShields lol you win ;)
that looks great
0
Q: Objective-C or javascript+html5+canvas?

user5793I'm really interested in starting to study some language with the idea of develop games for ipad and iphone. My main concern is that as soon as is possible to develop games with javascrit and html5 with canvas seems so powerfull, shouldn't be better to invest time in studying javascript+HTML5+ca...

03:27
@GGG ;) thanks
04:12
setTimeout.call(context, arg1, arg2); doesn't work? =/
setTimeout.call(this, function() {alert('test');}, 500); works in console, not in the code
this is Chrome btw
actually, it only doesn't work if I do "this"... which defeats the purpose of using the call function
"Uncaught TypeError: Illegal invocation"
this is the dumbest bug I have ever seen... wtf is the point of using 'call' then???
hello.
have any method to access a particular port of server using javascript?
have any method other than ajax to access a server ?
Thank you so much..
:)
04:23
yeah, you have to use flash/java
controlled by javascript
GGG
GGG
and/or websockets
ok..:)
GGG
GGG
@sreerajvr no problem
I'm so out dated -_-'
GGG
GGG
@andrewjackson look at it as being well-versed in time-proven techniques ;)
04:30
I am a mobile developer(nokia symbian) and my browser can't extract response headers other than 'conent-type' and 'content-encoding .
My code as follows:

function init(){
var conreq = new XMLHttpRequest();
conreq.open("get", "http://www.google.com", true);
conreq.onreadystatechange = function(){
if (conreq.readyState == 4) {
if (conreq.status == 200) {
var xmlfile = conreq.responseText;
headers = conreq.getAllResponseHeaders();
alert(headers);


}

}

}
conreq.send(null);
}
@GGG true lol
Have any method to extract all header content?
its a browser issue..
thats why i search for a method other than ajax
proxy method?
GGG
GGG
good call
proxy it up
which headers do you need exactly anyway
anyway try setting up a proxy to just do a HEAD request, should still be pretty quick
@andrewjackson ps jquery is slow. jsperf.com/jquery-element-creation-vs-cloning/2
@GGG wow nice
it's nearly twice as fast as both methods
GGG
GGG
04:45
yup
and works just the same ;)
So I was right about the cache thing, just because jQuery is slow
GGG
GGG
we even still use jquery for the templating...
just use the dom to clone the node
do as much as you can with the dom, just use jq when you really need it... eventually you will probably realize you don't need it at all for most things
and your code will be fast
jQuery just seems...
bloated now lol
GGG
GGG
it is... i think it makes ppl feel safe
which is understandable
I think I'm not going to use jQuery for this text editor, I'll just have to write my own pattern
plus, it's really not that hard to create an element
GGG
GGG
04:48
nah i mean if you want sugar just make a little function
I want the whole jar of sugar lol
I'm a performance nut
GGG
GGG
i've done stuff like this for dom-intensive stuff:
not sure why element.cloneNode is much faster, I looked at the source and clone is using the same method
GGG
GGG
function div(className, nodeName){
    var foo = document.createElement(nodeName||'span');
    foo.className = className;
    return foo;
}
who knows
probably what's slower is iterating over that $() object to get the element
actually.. nm... there's much more code there... it only uses "cloneNode" for certain things
GGG
GGG
04:53
yeah right they're trying to catch a bunch of corner cases that will apply to you like .001% of the time
GGG
GGG
and those are the cases you should be catching yourself or avoiding, not having jq hide from you
I wish there was a version of jQuery that let you do those things yourself
GGG
GGG
i never bothered to learn the api so i don't really miss it
kinda... imagine a framework without statements... that would be a TRUE toolkit lol
GGG
GGG
04:55
it would be nice to have some kind of modular thing just to do the xhr and stuff
and some of the css class manipulation stuff
just basic stuff like that
the main thing I like is the selector thing
GGG
GGG
maybe simple selectors yeah
and the ajax
everythign else, I can do without
GGG
GGG
but not the crazy inefficient unreadable horrible selectors
I could even do without the ajax thing
GGG
GGG
04:57
all you need is id (#), className (.), and tagName
ya, I just like simple selectors
exactly
GGG
GGG
well it should all be in separate things so you only load or pull in what you need
damn can't spell
I think I know what you mean... I'm actually working on a loader right now
GGG
GGG
nice... i did one that's basically a bash script, it conforms to this - wiki.commonjs.org/wiki/Modules/1.1.1
GGG
GGG
05:01
it has macros for base64-encoding files for embedding images and stuff
and it can stringify text files :)
oh hey, my people
nice =D
hi
GGG
GGG
sup @Purmou
@GGG i'm writing the proposal for markdown in github links
GGG
GGG
wow nice
i was just saying someone should do that
05:43
@GGG lol, i know, that's why i'm doing it :P
05:58
try {} can't catch dynamic <script> 404's???
no idea
GET http://localhost/javascript/projects/texteditor/lol.js 404 (Not Found) seems to imply it's not an except, right?
No big deal I guess, I'll just have to set the error event to throw an exception.
dude, i have no idea. try{}catch{} is the only thing i've never worked with lol
it's very useful
wassit for?
06:01
catching errors lol
sorry, i herped for a second
try {
lolwtf;
}
catch (e) {
alert('lol wtf???');
}
i can only see few practical uses of this
why not just console.log everything? :P
well, the main use if for debugging, yes
but also keeping your script from breaking on dynamically inserted scripts
I also put it to good use for a Chrome bug that was breaking a recursive function I had
hmm
06:05
for example, window.onload['break_me'] = 'breaks'; will break the script with an error
ohh, i see
so it'll run it without really running it
however it was a recursive function for going through the entire window object, and I needed to set the property to prevent infinite loops
yes, sort of
it'll just run it with a fail safe option
mhm
interesting...
GGG
GGG
@Purmou ah, i'm not used to ppl actually listening to me ;)
haha
@GGG also, responding to your meta suggestion
GGG
GGG
06:09
oh yeah it's a beaut right
4
Q: Remove from results button?

GGGI'm sure everyone has noticed Google's relatively recent "remove from search results" feature, which allows you to hide results from useless domains. . I wonder if it would be useful to have a similar feature, either to remove a single question from all search results, or to remove all qu...

06:20
0
A: Remove from results button?

PurmouThis idea shows some promise but is ultimately useless in SE's model, I think. I'm under the impression (and this is my personal belief, as well) that all questions deserve equal attention only until after they've been determined to be duplicates or unfit per SE's standards and common practices....

omg this is retarded
@andrewjackson ?
script evenets just aren't being caught be try
.onerror = function () {
	throw 'Failed to load';
}
GGG
GGG
@Purmou you suck
I get Uncaught Failed to load even though it's clearly in the try statement
06:23
@GGG XD
i'm just being perfectly honest--it's nothing personal
well, I just won't be able to do it the preferred way... atleast I'm even able to see the error
this isn't a debugging issue
it's for a script that loads a file which could potentially not exist...
yeah, i just wanted to make that image, and i pinged you to show you :P
I just need to be able to provide feedback that the script did not load
I guess window.error?
now that I think about it...
I think I know what's going on here
the problem is that I'm creating a script, then attaching it to the head...
therefore it's being executed outside of the try statement
I guess I'll just use window.onerror
next problem... I don't want to catch errors for the scripts being loaded -_-
I guess I'll have no choice during the load process... and just unset window.onerror when everything is loaded.
or I couldjust use script.onerror, but I wonder if that would catch syntax errors too
you know what? I'm retarded lol
I'll just check for what the error is
06:35
why, cause you've been talking to yourself for a while? XD
that's how I think lol
see how that works? I came to a solution by talking to myself. lol
lol
you're pretty cool :P
:P
I made a nice fancy animated "Load..." screen, but it loads faster than it can animate. -_-
oh well, maybe someday someone in japan will see it lol
there's more code to display the screen than there is to actually load the files
GGG
GGG
07:12
@Purmou like meta rooms should be in "other rooms i'm in"
yeah
07:30
I once made an entire chatroom that only used one function and a series of switches
just thought I'd share that
07:44
hmmm... that's not good... my "loading..." animation gets paused while the loaded JS file is being executed
0
Q: What are the required skills to bulid a online book editor?

user13616I want to build a website for a printing company. My plan for this website is to offer a online book editor system for users to upload photos, choose the layout, type some text, put some stamp or sticker and so on. Since I am only know about html and css, I would like to know what kind of person ...

wtf do i do about that??
not even setinterval will fix it
08:08
0
Q: JSP and Javasript with form

Kristali have a form in a registeration.jsp page: form name="users" method="post" onSubmit="return checkCorrect()" action="Registeration.jsp"> The Script checkCorrect is written at the start of the page, returns true or false based on information submitted to the form (using getElementById if it...

08:27
someone upvote me
i'm testing a userscript
you can undo it after...i just wanna see if this thing works
@All hii
 
1 hour later…
09:41
Wow. That totally rocks.
09:52
@FlorianMargaine nice indeed
@FlorianMargaine even if it might need some refactoring ;)
10:20
Hello. Maybe someone in here could help me out on a problem. I would need a good way for an internationalized client-side string sorting. Problem being, that specific characters (like german ö) aren't getting sorted correctly. Does anyone have experience with that?
@GNi33: use the ASCII values of your characters to sort
@FlorianMargaine tried this, but ö has a "higher" ascii - code than the rest, so it's always getting sorted to the end of the list, tough it should be between o and p
8
Q: How to compare UTF-8 strings in Javascript?

Tomasz WysockiWhen I wrote in JavaScript "Ł" > "Z" it returns true. In Unicode order it should be of course false. How to fix this? My site is using UTF-8.

heh, nice one
10:32
yes, it is, and thats the problem. Strings starting with Ö (or another special character) are being put to the end of the list. I see that this is kind of correct behaviour due to the ascii-codes, but it's driving me crazy :D
@GNi33: @Joel's link shows you how to do exactly what you want.
@Joel Thank you, I have seen this answer. The page I have to do this for is getting rolled out in 28 different languages (including Farsi), so I was hoping that there would be some other (more automated ;) ) way to achieve this
@GNi33: you just define the "order" variable for every language. Then, they all use the same function
computers have their own order, so you must define your own for every language
@FlorianMargaine yes, there should be a package for this - perhaps from one of the big, international companies
@GNi33 as the comments to the question mention, you'll want to search for "collation". databases do that very well (they sort strings all the time), maybe you can copy the actual orders from there.
Yep, but I'll have to get some translator to do this for me, I have no idea in what order e.g. farsi-characters have to be put
10:35
0
Q: As ASP.NET C# developer should we learn HTML5 and Javascript?

Dran DaneShould we learn HTML5 and Javascript or can I expect ASP.NET and C# will generate my HTML5 components and Javascript code (as usual)?

@Joel sounds good, I'll have to take a look at this, thank you :)
11:16
Hai o/
austrians! moar austrians! ;)
2
Q: js select an element by css property

Nagy Márton(sorry for my bad english) is it possible to select a dom element(s) by css property? forexample: awsome_function ({'background-color' : '#0cf'}); // return all object, which's background-color css attribute value is '#0cf' awsome_function (['background-color']); // return all object, which ha...

omg omg omg
@GNi33 Oh hey. :D
11:25
Where in Austria do you live?
Living in Salzburg, working in Linz
Ah, cool. :)
but Graz must be nice too ;)
It's quite warm. :D
Personnaly, if i one day see one of my collegues do that, i'll kill him or ask my boss to replace him immediately.
11:33
lol
:D
Added my answer
not really an answer, but, oh well
oh, you have too, @DieVarDump :-)
"Personnaly, if i one day see one of my devs do that, i'll kill him and/or ask my boss to replace him immediately." haha, agreed ;)
Yes i was hesitating but...
lol, my answer is the only one with upvotes
well, after this SO pause, back to Drupal
$('[style*="background-color"]') does it really work with not inline css ? O_o
11:40
not sure
no, it doesn't
>> don't find elements based on inline styles unless you are not restricted in any way to do so.
hey guys, im wondering if anyone is from yorkshire here?
sorry, I'm not a dog.
j/k.
funny guy ;)
isn't yorkshire an english island around uk? I'm not sure
oh no, it's just a region. My bad.
haha ok, the reason i ask is because i would like to learn asp.net and c# but i am struggling to find a tutor in my area that is knowledgeable in programming.
11:49
I don't think you're going to find many.
Either you go to school, or you find a company with such needs, or you learn online
Thats not neccesarily true...
you're lucky then :)
12:16
do you know a way to run sass in sublime text 2? I have tried to install the files from github, but I dont know how to execute it. Any help> superuser.com/questions/394431/…
12:39
i wrote bunch of tests and they work in my browsers. do they work in your browsers?
Tests completed in 1527 milliseconds.
96 tests of 96 passed, 0 failed.
Chrome 17, all tests passed
i really would love it if swarm.jquery.org became more mainstream
and sorry for spamming five test suites =)
Good day!
12:42
could try them in canary too, if you want
@GNi33 that's ok, i'm on the dev channel
hates jQuery with the wrath of thousand suns
@GNi33 but i left that part out, intentionally - too many permutations with os, version - maybe even user settings etc ;)
@OctavianDamiean why exactly? just because people write bad code using jQuery, doesn't mean that the whole library is bad ;)
@GNi33 The library is bad because it is bad.
I wish it would be more like Bootstrap.
12:45
@OctavianDamiean i agree that jquery isn't perfect (looking at the source), but the result is so much better than anything i could do in months (considering cross-browser coverage)
@OctavianDamiean what does jQuery has to do with bootstrap?
Tryed playing with jQuery draggable and dropable today. When I already had 3 elements in a row and droped one more, it created one more element on a new row. But when I dragged and dropped it back in a main pile, then it whent a bit up. So it looked like it was out of dropable zone. When I looked, I saw, that it places top: -70px; for that element, for reason unknown to me.
@OctavianDamiean twitter's bootstrap? the quality of the (.less) code in 1.x was horrible, just hope 2.x has fixed some of it. and it uses jquery.
What I hate most about it is the themeing ...
@Joel I know that it uses some jQuery but their got their concepts right.
@OctavianDamiean like what concepts? because they didn't exactly follow best practices last time i checked...
12:49
Well, I don't really care what they did back in 1.x. I just know that they are more flexible in terms of theming.
@OctavianDamiean oh - you're talking about jquery ui?
Oh right, my bad. Indeed.
I meant jQuery UI. Sorry for the confusing.
13:07
Any jQuery guru here so to speak?
@Eugene: you'd better ask your question, someone who can answer will :)
Already did.
Look above.
Well it is not as much as the question, more as a problem. I don't know, should jQuery behave like that?
@Eugene also, a jsfiddle.net helps
@Joel Yes, there are also ajax calls, and they will not work.
@Eugene jQuery's not much appreciated here, not sure a "jQuery guru" will stay here a long time ^^
13:18
Without them, I don't think, that I will be able to show the problem.
@DieVarDump trolling, right? :)
No, jQuery is not much appreciate here :). We listen, we answer if we can, but we don't really like jQuery.
@Eugene: see this link why most people here don't like jQuery
@FlorianMargaine so not using it because of, for example, "$.attr What does it even do? It doesn't just set / get attributes. It does a whole bunch of weird logic for backwards compat." - that backwards (and cross-browser) compatibility is exactly why I use it
@FlorianMargaine Yes, well I know, that this isn't the best of the best. But for work purposes it is time saving solution. I'm not a pro. JavaScript programmer, therefore I can't agree with others who say that jQuery is sh****. Since jQuery room is empty most of the time, I sometimes ask jQuery related questions here ( if they are small ).
13:25
well, I also use jQuery for quick stuff. Personally, I just don't like the overbloated library/no separation/god object
@Joel: there are very simple ways to use .attr in vanilla js, with backwards and cross browser compatibility, btw
example: element.onclick = function() {}
and yes, depending on the case, cross browser stuff is why most people (including me) use jQuery
is github down?
Uh. wait. Bad example.
document.getElementById('script-id').src = 'url'
this is a better example to compare with .attr :p
13:51
0
Q: How to add div dynamically in tabs using JQuery Mobile

Coder_sLaYI have an application which uses phonegap and jquery mobile and it has tabs like this <div data-role="header"> <div data-role="tabs"> <ul> <li><a href="#tab-1" class="">Tab 1</a></li> <li><a href="#tab-2" clas...

Ugh ... the progress bar part made me wince.
Hey, I just want to show a progress bar because it is cool to show progress bars for nothing.
Questions like this pop up every now and then.
"Well, I guess in about 5 seconds, this process will be completed, just show something nicely moving around during that period"
Yea, event driven design is quite hard to understand. :P

« first day (499 days earlier)      last day (4674 days later) »