« first day (381 days earlier)      last day (4573 days later) » 

user1385191
7:00 PM
does it use autoloading?
 
user1385191
that's an esoteric thing I haven't figured out yet
 
@Raynos I saw a post earlier today, someone somehow made their node code have a var leak into other people's requests.
 
I wish Array.prototype.reduce could cope with more than just Number primitives…
 
hey all
I have a recursive function like this:
                            function checkregex(json){
                                console.log('checking regex', name, json);
                                for(var i in json){
                                    console.log(i);
                                    var match = name.match(i);
                                    if(match != null){
                                        console.log('found match', match, i, json[i]);
                                        if(json[i].set != undefined){
will it ever break the browser?
 
user1385191
7:15 PM
uh, a recursive function generally doesn't have nested for loops
 
user1385191
that kind of defeats the purpose
 
@Neal No, it'll just eventually throw RecurssionError.
 
user1385191
the point of recursion is to break up the problem into chunks
 
@MattMcDonald do you understand what it is doing?
It does
Here is the json:
var indicators = {
    '^.*[0-9]': {
        'set': {
            'width': 3,
            'color': 'red'
        },
        'children': {
            '^.*__[0-9]__1$': {
                'set':{
                    'color': 'green'
                }
            },
            '^.*__0__[0-9]$': {
                'set':{
                    'color': 'orange'
                }
            }
        }
    }
};
 
user1385191
a RegExp string as a key? really?
 
7:16 PM
@MattMcDonald not my idea
this is what they wanted. now i have to parse it.
 
user1385191
var presets = {"padded_whitespace": /^\s+|\s+$/, "entirely_whitespace": /^\s+$/};

var indicators =
{
	"padded_whitespace":
	{
		[whatever]
	},
	"entirely_whitespace":
	{
		[whatever]
	}
};
 
user1385191
then you use the object key to refer to the preset
 
@MattMcDonald they did not want to do that...
whats the diff anyway?
 
@Neal is the var json a string or an object?
 
user1385191
sanity
 
user1385191
7:21 PM
do you not see the difference?
 
user1385191
one is calling for parsing of regular expressions, while the other just references pre-baked ones
 
@MattMcDonald Also, storage of a regex in the object may be more suitable than re-creating that expression.
 
@Incognito object
 
Instead of invoking the regex constructor multiple times, you just do it once and store them.
 
user1385191
bingo
 
7:23 PM
@Neal Prototype is going to bite you in that for loop.
 
@Incognito what regex constructor?
 
@Neal Whenever you invoke a regex you're using the constructor.
 
user1385191
try juxtaposing your current json with another scenario in which you parse functions via strings
 
I am using .match
 
user1385191
see the insanity yet?
 
it works fine.... i was asking abt the recursion...
 
@Neal It invokes it, there's no other way it will do it.
 
I'm having a bit of an issue with jQuery, anyone mind helping me figure it out?
 
@Incognito I am not using new RegExp("ab+c");
 
@Neal What about the recursion?
 
user1385191
7:25 PM
var indicators =
{
	"function foo(){ alert("this is dumb"); }":
	{
		[whatever]
	},
	"function bar(){ alert("but I have to use it"); }":
	{
		[whatever]
	}
};
 
@Neal It doesn't matter that you're using .match, ecma262-5.com/ELS5_Section_15.htm#Section_15.10
 
@Incognito oy... im matching the regex to different strings all the time..
 
Javascript invokes it for you, and creates a regex object. Each time you invoke the same pattern through .match you're re-creating that object.
 
user1385191
cache, cache, cache
 
@Incognito whoopee do.
 
7:26 PM
["foo"] invokes the array constructor, and creates an array.
 
why does it matter?
 
user1385191
dunce
 
its only using it once or twice
and its gone at the end of the loop anyway
look at my code. scope is all off the way ur thinking...
 
user1385191
In electronics (including hardware, communication and software) scalability is the ability of a system, network, or process, to handle growing amounts of work in a graceful manner or its ability to be enlarged to accommodate that growth. For example, it can refer to the capability of a system to increase total throughput under an increased load when resources (typically hardware) are added. An analogous meaning is implied when the word is used in a commercial context, where scalability of a company implies that the underlying business model offers the potential for economic growth within t...
 
@Incognito As specified, yes. But there is no black-box observable way of telling that it does. No implementation does, because that would be slow.
 
7:28 PM
@gsnedders Of course, but I don't know how else to draw a correlation to what regex is doing.
@Neal Your for-loop needs to do check hasownproperty
 
@Incognito I'm not really sure why it matters it's creating a new object
 
@Incognito how so?
u mean instead of the undefined checks?
 
@Neal Consider something defined on the Object prototype object
 
@gsnedders I'm saying it's like while(i--){createObject()}; or creteObject while(i--){invokeObject}
 
@gsnedders hmmm?
 
Thanks. thats useless to me.
 
user1385191
the whole function is a mess
 
@Incognito regexp objects are cached in all major JS impls, it's just a hash-table lookup
 
1 min ago, by Neal
u mean instead of the undefined checks?
?
 
7:30 PM
@Neal I don't really know what your code is trying to accomplish, but I would say in addition to where the for loop opens up.
 
@Incognito ???
 
user1385191
having a function 5 indentation levels deep usually means you need helper methods
 
@gsnedders That's pretty sweet, I didn't think they'd do that with regex, considering it can be such a beast.
 
@MattMcDonald whatever you say...
 
user1385191
and better logic
 
7:32 PM
dont think so
 
user1385191
I feel like we're miles apart conceptually
 
@Neal javascript.crockford.com/survey.html jump down to objects.
 
@Incognito The cost of compiling the regexp each time is just too expensive (technically I believe most engines just cache the compiled regexp, which is really the cost, creating an object is cheap).
 
@gsnedders Yeah that makes a lot of sense. Do you guys also compile common ones like /[a-z]/i ?
I mean pre-compile.
 
@Incognito In advance? No. Not worth it.
 
7:34 PM
@Incognito -- Uncaught TypeError: Object #<Object> has no method 'hasownproperty'
 
@Neal Use the correct case.
 
@Incognito It's only in hot code that it makes any difference, so having the cost the first time the codepath is run isn't really an issue.
 
@Incognito ok.
 
user1385191
@Incognito I'm about to give up
 
This is it now:
                    function checkregex(json){
                        console.log('checking regex', name, json);
                        for(var i in json){
                            console.log(i);
                            var match = name.match(i);
                            if(match != null){
                                console.log('found match', match, i, json[i]);
                                if(json[i].hasOwnProperty('set')){
                                    var set = json[i].set;
 
7:39 PM
@Neal Look like you have some globals for some reason, generally a bad idea.
Types and items should really be local.
Also, if needs to use strict inequality, not regular inequality.
 
@Incognito they are local. o sorry. ill show the full fn
 
And you added the first part to have a check for hasownproperty, but not the first loop
 
user1385191
pastebin it
 
user1385191
nooooooooo
 
That's a beast.
 
7:41 PM
pastebinned
 
That first function(){ bit is unmatched.
 
and this is all inside another fn
 
user1385191
when I was helping a friend with their compsci homework, I found valuable advice from part of the instructions
 
@Incognito no its all matched, the indenting is messed up in the paste
 
user1385191
"keep your functions 20 lines and under. if they're longer, use helper methods"
 
user1385191
7:43 PM
I can't stress how big that is in application development
 
@MattMcDonald thats what the checkregex fn is for
 
@Neal I promise you it's unmatched: jshint.com/reports/57013
 
also whats the resoning for that?
@Incognito oy... so i ddnt copy right from my doc, boo hoo, its matched in my IDE
:-P
 
@Neal The code is easier to work with, read, and modify.
 
@Incognito my code is split into fns.
u can see that
 
user1385191
please buy that book
 
user1385191
it's immeasurably helpful
 
uh what? Anonymous functions ignore the prototype property?
 
dont like books that much..
@IvoWetzel ?
 
var f = function(){};
f.prototype = {a: 'test'};
> f.prototype
{}
 
user1385191
7:48 PM
I get the object back
 
user1385191
in Opera 11.52 OSX
 
Just ran into this in Node
maybe just a bug there, dunno
 
@IvoWetzel i get it in Chrome dev channel
 
var f = function (){}; f.prototype.a = 'test'; f.prototype
Object
a: "test"
 
hm node repl returns it too
 
7:50 PM
Maybe your case did something funky.
 
8:09 PM
@all Hi, i was checking google news page. There are dynamic content loads on particular section of page and when we click it it gets maximised. Can anyone let me know how they achieve this. which technology they use. some java script functionality?
 
user1385191
it's kind of funny how anything dynamic on twitter = busted
 
user1385191
if I click on a user, the silly animated pane is blank
 
user1385191
if I physically go to their profile, zero problems
 
?
anybody knows?
 
whoah more craziness :/
getting Object... native code from function(){} Oo
ahhhh
was missing hasOwnProp
so I grabbed the constructor func from the native prototype...
 
8:18 PM
awww @mann!
 
@Loktar ? any suggestion mate?
 
user1385191
hahaha
 
I dont know what your referring to on the page, I was just doing a play on words :P
link?
 
user1385191
 
blipit.net/pushForChat :-P make fun of my js all u want
 
8:20 PM
just wondering how they group data n show on page
through javascript?
 
idk.. just to group it just aggregates from other sources and feeds. I mean you could use JS to do that, esp if your adding more in real time
 
user1385191
looks like heavy usage of the XMLHttpRequest object
 
user1385191
the "grouping" is HTML
 
I learned Nov 8th an asteroid will pass between earth and the moon on google news
so thats cool
 
hahah cool
na im serious mate. like just give me direction to study. like im lost right now. wot should i study to get into it.
 
user1385191
8:24 PM
I gave you the keyword
 
yes mate xmlhttprequest object. ya will check that :-)
 
@twitter The @jQueryBot account just adds noise and a number of team members have reported it as spam - any chance you can help us out?
 
look up ajax
 
n u said use of html. but i dont think when they click particular news it expands n html can do that
 
AJAX AND WEB 2.0!! :P Everytime I hear ajax I think web 2.0 ugh :?
you can use JS to do that
 
user1385191
8:26 PM
every time I read "web 2.0", I'm reminded of sites with dropped vowels (flickr) and glossy buttons with lots of flashy gradients
 
user1385191
oh, and rounded corners
 
:-) i thought to use flickr api . but they dont allow it for commericial use
well they allow but they will decide , if they will allow us or not. n ya they can charge in future as well
facebook feeds are also work on same functionality. like heavy use of javascript or they use something particular
?
 
@mann jsfiddle.net/loktar/eq4vZ/1 you mean like that?
 
@Loktar yes mate . gr8
 
yeah that uses jQuery, just a quick demo to get you started.
 
8:30 PM
yes thanks. n to group related data with each other? for example facebook updates on wall? any idea?
 
umm, well to relate will depend on how your receiving the data and sorting it. I mean just group it in the html..
 
user1385191
you group it with preexisting html
 
like pretend that list is about science, and theres another list about health
yeah exactly
 
ya true. before grouping i have to think about receiving and managing data
 
user1385191
and deliver data to the client, appending to the corresponding section
 
user1385191
8:32 PM
the "grouping", really, is in the data delivered via XHR
 
XHR . alright. makes sense
 
user1385191
it's probably JSON
 
yah may be
 
user1385191
{
	"cows":
	{

	},
	"pigs":
	{

	},
	"horses":
	{

	}
}
 
user1385191
there's your "grouping"
 
8:34 PM
there is very similar concept i.e. iframes to show data within page. but that is not that much advance
 
yeah dont do the iframe solution, its very yuck.
 
yah i know even my mate restricted me using that
i was just making social network sort of application. so was wondering about feeds and updates of other users on common wall like facebook n twitter do
bytheway thanks @Loktar and @MattMcDonald for showing me direction to explore these concepts
 
np
 
user1385191
I want to smite anyone who says that's a good idea
 
9:04 PM
posted on November 01, 2011

Today’s hot story seems to be the supposedly Google-initiated howtogomo.com website. I heard some complaints, and decided to take a look myself. Oh. My. God. First comes a kind of load script that takes bloody ages. This is supposed to be a feature, and not a bug. Ahem. Then I noticed that the links don’t work. Nothing happens. Until I resize the browser window, that is. Then

 
FB is personal messages, why would Google want to index those??
 
Wow, Google is really bored
 
@AntBrown no idea
0
Q: Google and Ajax indexing

NealSince Google Can Now Execute AJAX & JavaScript For Indexing, what does that mean for seo for google? What do we have to do differently, and what can we change so google bots don't crawl through everything. Before we had the luxury that did not happen, but now it seems that it is. And that c...

 
@AntBrown FB? private?
 
user1385191
@AntBrown because they want to control the internet
 
9:08 PM
@MattMcDonald moo hahahaha
 
Why is your evil mastermind a laughing cow? :P
 
@Zirak yeah, not really, I don't know much about the privacy perms on fb but is there one to add noindex to your wall?
 
@Zirak :-P hahahaHAHAHAA
 
user1385191
what do you think google+ is?
 
user1385191
it's google
 
user1385191
9:09 PM
trying to steal traffic from facebook
 
^_^
 
@AntBrown Used FB for 5 minutes before realizing it's useless to me, but it seems logical that if something is private, it'll also be private to the google bot
 
9:26 PM
Holy shit. A component library for jQuery? They also just "use" jQuery: github.com/appendto/amplify/blob/master/request/…
Magnificent. It's made by a "company" called .appendTo, which is "dedicated to jQuery" murder
 
user1385191
does anybody realize that you don't need a selector engine?
 
user1385191
and when that topples down, well then you don't need jQuery at all
 
user1385191
yep, they've got the jQuery-esque monolith function body style down
 
user1385191
function doNothing(foo, bar)
{
	//useless, often incorrect comment
	[100+ lines later...]
	//we're done, we promise!
}
 
just posted two very similar bugs in WebKit and in Gecko. Good old, trusty IE gets it right ;-)
 
9:36 PM
But jQuery is great and it can do everything!!!!! It can reverse an array: $.makeArray($(['take that!'])).reverse()
 
user1385191
IE is an old mule, but they (the team past and present) still did some good things
 
I was going to take jQuery to the prom, but then I saw her. Eww, no fat chicks!
 
This broke something inside of me: appendto.com/services
 
@MattMcDonald agreed, people seldom realize that much of what we see in today's specifications either started in IE or were originally suggested by MS.
 
> Our access to JavaScript and jQuery experts means that we are positioned to provide world class leadership in project management, architecture and programming. Our methodologies and experience will provide the leadership necessary to meet critical timelines with sustainable architecture.
I think he means SO
 
user1385191
9:40 PM
I seem to recall IE coming up with the capture/target/bubble event model
 
Bwaahahahahah
 
I like how each and every company boasts to be the leading, world-class expert front-end driven top bleeding edge mofo html5 css3 javascript company.
 
> 1-877-JQUERY-HELP
I want to call them and ask why my pages all run Reaalllllyyyyy sloooowwwww
 
That's it. God just slaughtered hoards of kittens.
 
user1385191
as someone who works in an environment with it that doesn't need shimming (flash), I can't wait until we can freely use addEventListener
 
9:43 PM
Their 'clients' section only shows -one- two clients. It's great how they're world class
 
> Contact appendTo to discuss how we can support your use of jQuery to increase your efficiency.
 
Tom
Hmm, so I've got two third-party sites I wish to "enhance". For example, at some movie site, I'd like to add an IMDB search iframe in a tooltip whenever a movie is selected.

I figured I may be able to dynamically inject code into a site using Chrome extensions, is that so?
 
@MattMcDonald yeah, if I could only take IE 10 back in time 5 years and give it to the MS team, I could probably shave off weeks of time spent working around stuff.
 
user1385191
dispatching custom events is such a boon for the applications I make
 
user1385191
loose coupling
 
9:44 PM
@AndyE Please go back in time 11 years and spare us IE6
 
@Zirak IE6 was the best, least buggy, browser out there when it shipped ten years (almost to the day) ago.
 
I know, but notice the past tense.
 
@Zirak Going back nine years and cancelling the abandonment of the IE team would be far better. :)
 
@Zirak I can't, my JS-based time machine doesn't work in IE :-\
 
user1385191
7, and to a lesser extent, 8 are where time was lost
 
9:47 PM
Actually, just add auto-update. Then it'll be swell.
 
7 just seemed like a very lazy update. 8 did too, I guess.
 
user1385191
they can't
 
@MattMcDonald 7 was kinda a hard point, though. Either they shipped something quickly that fixed the most glaring issues, or they shipped something a year or two later that properly fixed stuff.
 
user1385191
IE is tied to system secutiry
 
user1385191
like I've pointed out, I had to download a year-old service pack vista ignored just to install IE 9
 
9:47 PM
@AndyE Not really. 8 debuted the completely new layout engine, which is rather huge.
 
user1385191
consider how safari is also tied to system updates
 
And that layout engine is part of the reason why they're moving so much quicker than anyone else.
 
@gsnedders: fair enough, it just seemed like they didn't make up enough of the ground they'd lost against the competition IMO
 
(The other major reason is they simply have more people working on their browser than anyone else)
 
user1385191
the difference being that mac users upgrade os versions far quicker than windows users
 
user1385191
9:49 PM
the boat anchor is still, and will be windows xp
 
@AndyE Right. IE8 didn't move them forward in a spec-compliance way the way IE9 or 10 do — it merely laid most of the groundwork that made IE9/10's progress possible.
 
Hello! why in IE this code fails? (ie didnt like 'class' attribute)
var a = {a: 1, b: 2, class: 3}
 
user1385191
you need to encapsulate your object keys in strings
 
user1385191
class is a reserved word in ES
 
@gsnedders yup, I'd say that's fair.
 
user1385191
9:52 PM
var a = {"a": 1, "b": 2, "class": 3};
 
user1385191
you then need to access the property via square bracket notation since, once again, class is a reserved word
 
user1385191
a["class"]; //3
 
@Matt thanks a lot!:)
 
thanks again. It was very difficult to search by words "ie", "javascript", "class" :)
 
user1385191
9:55 PM
class is reserved for future use, likely coming in ES.Next (I think)
 
@MattMcDonald do you recommend always create and access any properties via square bracket notation, or only reserved words?
 
user1385191
crockford recommends the latter, and I tend to side with him
 
Anyone any ideas if I can feature-detect for this bug? I'm guessing I can't, which could be a pain.
 
10:33 PM
@oluckyman It should work in IE9, at least. You're allowed keywords in object literals and property accesses in ES5, but not quite everyone implements that yet.
@MattMcDonald ES.next might not have classes, as the people who were doing most of the work to get them in are people whom Google pulled from TC39 to work on Dart.
 
user1385191
I was more worried on my use of ES.Next v. Harmony :)
 
@MattMcDonald ES.next is right. Harmony is less clearly defined, either being ES.next, the wider current branch of spec work, or occasionally ES5!
 
user1385191
ah, thanks
 
@AndyE Only in code running with chrome-level permissions (canvas with drawWindow and compare)
 
anybody knows how to create fifo file. command is mkfifo ajaxfifo , file name is ajaxfifo but it does not work in windows cmd
 
10:39 PM
@gsnedders well, that sucks. Thanks, btw.
 
@MattMcDonald actualy im folowing this linuxgazette.net/123/smith.html tutorial. n it says command is mkfifo
but i want fifo file
 
@AndyE Can't do much with layout bugs that can't really be detected through the CSSOM
@AndyE Actually, hmmm, maybe…
 
mkfile is also not command in cmd
 
user1385191
well, it's a linux site
 
user1385191
so it expects the unix terminal
 
user1385191
10:42 PM
windows' command prompt is a lot different
 
yah
 
user1385191
I use something like gitBash to run unix-ish commands
 
so this tutorial is of no use
yah putty is also there
 
user1385191
but it doesn't completely work
 
actually im trying to learn xmlhttprequest
:-)
 
user1385191
10:43 PM
that fifo bit is useless to you
 
so tutorial was gud but i think it is for linux
 
user1385191
just write a json file
 
user1385191
save as whatever.json
 
ok will carry on reading
 
user1385191
serve as header("Content-Type: application/json"); if you're using PHP
 
10:44 PM
yah im using php
so instead of fifo i name that file ajaxfifo.json? this is wot u r saying
of type json?
 
user1385191
whoops
 
user1385191
header("Content-Type: application/json; charset=UTF-8");
 
user1385191
that's a biggie
 
@Incognito I saw that too
 
@AndyE jsfiddle.net/C8ge4 doesn't quite work but is a possible approach
 
10:46 PM
I tried to send them an email 3 times. Showing them tools to avoid the problem
I couldnt email them because fail
 
@AndyE Like, if there is a way, it's likely something down that route
 
@gsnedders why was the IE time abandoned :(
is it because IE won?
 
@gsnedders: i'll look into it, cheers.
 
@Raynos The browser wars were over, IE had 90+% marketshare. Why bother investing in something that brings no profit?
 
@gsnedders FOR THE GOOD OF MANKIND
 
10:51 PM
@Raynos When you have a duty to maximise the values of your shares, that doesn't really apply.
 
@gsnedders you have a duty to cure cancer
share holders be damned im curing cancer
 
user1385191
lol
 
user1385191
write a white-blood-cell-generating algorithm in JS
 
user1385191
you'll be the—wait for it—*prototype* for future medical advances
 
You may need some interesting host objects, though.
In other random off-topic news, typesetting Old English poetry is hard in pretty much anything.
 
10:59 PM
0
Q: Is it possible to run JavaScript in Textmate?

oaloIf I try to run it now I get a XCode error. Do I need to install a JavaScript interpreter on my computer?

 
11:32 PM
Quick poll: do you write falsy or falsey?
 
falsey
 
hm... let me see... looking up falsy with google search brings up a first result from sitepoint whereas falsey with google returns a first result from urban dictionary
 
falsey in javascript means the if (!someFalsye) console.log("works in ifs")
 
BTW in the UK "falsies" are something completely different
 
someFalsye, @Raynos? :S
 
11:36 PM
Better phrased:
// the following are "falsey"
false, null, undefined, "", 0,  NaN
 
and all objects are truthy
except null
 
@Raynos ... I meant you spelled falsy/falsey as falsye in your statement
so is it falsy, falsey, or falsye?
 
@Joseph it was a typo
 
or falsie
 
"falsy" is the correct term
I use "falsey" because im an idiot
@demoncodemonkey null is not an object ¬_¬
 
11:39 PM
i think typeof null is object
i read
alert(typeof(null));
gives "object"
 
@demoncodemonkey yes
but the Type of null is Null
the fact typeof null === "object" is a bug
 
@Raynos It's a feature not a bug!
:P
 
@gsnedders bug because ES6 fixes it
 
@Raynos Yes, I know. :)
 
@all can we create fifo file in windows? in linux command is mkfifo ajaxfifo
 

« first day (381 days earlier)      last day (4573 days later) »