« first day (963 days earlier)      last day (3983 days later) » 

9:00 AM
@badbetonbreakbutbedbackbone I don't really know, but if you read through Jeff's blog posts from late 2007 into into 2008 there's a whole bunch of stuff about the birth of SE as it was happening
 
FF is really strange when it comes to DOM security
 
I think initially a lot of the traffic was drawn from regular readers of Jeff and Joel's blogs
 
@DaveRandom oh thanks are you so gentle man to link me to the blog please? :P
 
@dystroy Just like classList in element, width in ClientRect, Firefox believes many (DOM-related) properties comes from prototype chain, not "owned".
 
@Passerby then why don't you see it when you go up the property chain using proto ?
 
9:01 AM
@badbetonbreakbutbedbackbone codinghorror.com/blog joelonsoftware.com
 
@dystroy Try Object.getOwnPropertyNames(document.body), you'll get the empty array too
FF is just weird
 
@Zirak yes, I ask because I found many objects having the same problem
in fact I was told that as a bug report regarding JSON.prune on Firefox
 
@dystroy I tried both window.location.__proto__ and Object.getPrototypeOf(window.location) and I got security warning...How did you get the proto of window.location?
 
@Passerby I asked more kindly I fucked up my test
 
9:04 AM
It may be to do with how FF represents them internally
Well, it's definitely. But related issue: bugzilla.mozilla.org/show_bug.cgi?id=518663
oh, there they are...
Object.getOwnPropertyNames( Object.getPrototypeOf(window.location) )
 
@Passerby I had in fact no problem trying this in FF
Object.getOwnPropertyNames(window.location.__proto__)
So the main problem seems to be just that those properties are not enumerable and not on the object but on its prototype
 
Huh...
 
Yeah. window.location.__proto__.toString is seemingly the one that funked your test.
 
I can't explain it clearly but I am posting here in a hope that this issue might happen to someone else in this room.
It is related to CSS
I have a data grid created using table
To make it better, I used css properties like display: table and display: table-row
which are not fully compatible with IE8
To make it full compatible, I added float: left
I added float: left to make overflow: scroll to work which is necessary in IE8
now my whole table got spoiled
Does this happen to anyone?
if so, what is the alternative?
 
9:21 AM
@sjmarshy Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@Mr_Green do you need to fully support IE8?
 
yes
 
Fix that in IE8, then factor out the changes to a separate stylesheet
 
The issue is with float: left which is behaving strange in IE8 only
hmm
 
@AlenJoy Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
9:23 AM
I will give it a try
thanks
 
@Mr_Green support != fully support. If can make it look bad but still functional, live with that.
 
@CapricaSix k
 
yup
someone please destroy IE completely
 
WOW... The free version of Sketchup does not support boolean operations - only union. So far so good. The free version also supports Ruby plugins. Still good. Well, it turns out they only removed the GUI element for the boolean operations, but the functionality is still there. So, implementing the full functionality of Sketchup Pro is real easy on-demand, if you are willing to study the documentation. Or, you can pay. o_0
 
@JanDvorak Are there no other difference ?
Personally I stopped using it when it became too buggy on linux/wine
 
9:31 AM
some advanced features are disabled (boolean operations, export/import to anything...). Nothing there's not a plugin for. I guess the plugins merely expose the API.
They even say the API is the same for both versions
Basically, you shell out 400$ for having the API exposed and a hotline.
for a year
and a fancier name
 
heh. 1997. "yeah, I just got a new 9 gig HDD".
 
9:47 AM
Today, not even a 9G flash drive is something fancy
8G of RAM seems getting to be standard, too
 
A long time ago, my father was very proud to have managed to get for a decent price the new 30 MB HDD for our Mac Plus...
 
Time to sell it to a museum :-)
 
hello everyone
 
What's a good modelling software for OS X
 
9:53 AM
try sketchup
first, define "good"
if you're into sheer performance, typing vertex coordinates in notepad is an option
If you want something free Sketchup is just fine, especially given it has a Ruby API and plenty of existing plugins
 
Blender
I wouldn't even see a real competition
 
Sketchup has nicer GUI
 
it's Free, Open - Source Software and once you get used to it, it can compete with the big players
yeah, that'd really no reason to use a piece of crap like Sketchup over Blender
 
... thanks
 
Sketchup has less of a learning curve, but blender is far more powerful
 
10:03 AM
if you just need something fast, yeah, Sketchup will probably do the trick
but Blender can actually be used for "serious" stuff, it's a great tool
 
I'd say, depends on if you want curves or rectangles. SU sucks at curves.
 
@JanDvorak thanks? huh? :D
 
@Zirak ping !
 
@GNi33 AutoCAD.
 
yeah, depends on what kind of modelling you actually want to do
 
10:19 AM
0
Q: Clearing javascript objects

David FariñaI've made a command queuer. That means, my javascript waits for messages in the opened websocket, and queues the json objects, which will be converted to js objects, in another js object. All 3 seconds, all the objects (commands) in my queue object get cleared. Simply it looks like that: var qu...

 
@Adarsh Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
actually, questions don't refresh for me either, even though there are no network errors and there are websockets open (no frames)
 
@SamDroid w3schools is not related with the W3C at all. Please stop spreading such misinformative links. — Florian Margaine 14 secs ago
 
@SamDroid also see w3fools.comJan Dvorak 23 secs ago
 
@JanDvorak w3fools sucks now
 
10:29 AM
I just met a script to know the area where you are connected
 
@FlorianMargaine outdated information, you mean?
 
@JanDvorak yeah
 
there are a other similar script of ipinfodb.com??
 
W3Schools still sucks AFAICT
 
and unjustified hate
w3schools is mostly correct and not pedantic
 
10:31 AM
"mostly correct" needs some backup, I'm afraid
They still use document.write in their examples
 
this doesn't deserve all the hate they get
@JanDvorak "not pedantic"
 
yeah, I was thinking about going through some of the points on w3fools, check them and submit a pull-request then
 
@FlorianMargaine are you claiming that a javascript tutorial using document.write is fully acceptable?
 
@JanDvorak Yes.
 
Are you claiming that document.write is acceptable?
 
10:34 AM
for learning? completely
 
@Ingreatway Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
86
Q: Why is document.write considered a "bad practice"?

FlySwatI know document.write is considered bad practice; and I'm hoping to compile a list of reasons to submit to a 3rd party vendor as to why they shouldn't use document.write in implementations of their analytics code. Please include your reason for claiming document.write as a bad practice below.

lol
 
@Ashok Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@FlorianMargaine I disagree. It cannot be used after the page load. 99.9% of javascript runs after the page load. 100% beginners will try to use it after the page load. 90% beginners will ask a question on Stack Overflow why their entire page disappears. At least 50% of those questions will have bad grammar. Also, document.write slows down / restarts document parsing (but so does document.body.innerHtml += ?)
 
10:50 AM
@FlorianMargaine IMHO document.write is not acceptable in a tutorial. No tutorial I know of warns of the dangers of using the function, so the very first thing newbies see is "hey, I can use document.write, I should use that for everything!"
 
When I type "w3schools" into the omnibox, I get three search completion tips, the w3fools page and the question linked by Mirko
 
document.write is awesome though when you know how & when
 
Anyways, I'm bookmarking that question
 
@Esailija yup, if you know how and when
 
but document.write, without refresh page, not function (for writing inside the div). Is better document.innerHtml right?
 
10:55 AM
@MirkoCianfarani document.write writes where the script is.
 
no, better document.body.appendChild(document.createTextNode(mycontent))
which should be wrapped in a simple function for use in tutorials
(or something like that)
 
@Alnitak such as $.fn.text? :-)
 
hehe
 
also appendChild is better
 
you usually want innerText/textContent, innerHTML is dangerous
 
11:05 AM
@Esailija the problem is neither is universally supported
 
but either one is
 
textContent (spec'd) fails in IE, and Mozilla decided to hate the IE-ism innerText
@Esailija then you'll either import a library, write a wrapper fuction, or have ifs everywhere.
 
@OctavianDamiean Can you look at stackoverflow.com/questions/16937502/… it's for a friend
 
it's trivial to write a function that supports both, and it also introduces newbies to cross-browser support issues.
@BenjaminGruenbaum what's that got to do with JS ?
 
yes but I mean you can use something like
var setText = (function() {
    var div = document.createElement("div"),
        prop = "innerText" in div ? "innerText" : "textContent";
    return function(elem, text) {
        elem[prop] = text;
    };
})();
 
11:09 AM
@Alnitak Hi, Octavian was the manager of the android room for like a year and he's a friend and also a regular like me here. Why do you ask?
 
ah, ok
I thought you were spamming the room
 
I'm not just some random guy coming here asking Java messages :P
 
@Alnitak I'm not complaining about introduction, but I'd rather not face those issues myself :-)
 
interesting the script @Esailija
 
yes, nice way to only make the test once, too.
 
11:10 AM
you have to be nuts not to use a DOM library anyway if you aim to target older browsers as well as new
 
@Esailija for extra performance, return one of two functions. Also, no need to create an extra element just to check it.
 
yeahhhhh @Esailija
 
@Esailija I consider IE9 an old browser :)
 
setting .innerText will shadow any performance improvements you can do there by 1000x
and never optimize code that only runs once
such a waste of time
 
@Esailija you could check for 'innerText' in document.body couldn't you?
 
11:12 AM
Optimizing code that runs once makes sense mainlyif it improves page load time.
 
var setText = (function() {
    return "innerText" in document.body?
    function(elem, text) {
        elem.innerText = text;
    } : function(elem, text) {
        elem.textContent = text;
    }
})();
@BenjaminGruenbaum the function body runs multiple times. Factoring out div is probably pointless, but while we're at it... :-)
 
@JanDvorak ok that's better since it's now inlineable by v8
 
@Esailija he's got a point - this version avoids having to jump into the enclosing scope to find out which property to use
 
I would do it the other way around though
 
Hey guys, is there a way to convert and _underscore array back into an object?
 
11:14 AM
but really, .textContent is very expensive anyway
 
I'm currently doing this:
    page.viewModel.assured_list().push(_.uniq(names, function(item, key, personid){
      return item.personid;
    }));
 
var setText = (function() {
    return "textContent" in document.body?
    function(elem, text) {
        elem.textContent = text;
    } : function(elem, text) {
        elem.innerText = text;
    }
})();
 
@BenjaminGruenbaum why prefer TC over IT?
 
@BenjaminGruenbaum wat? are you talking about 1999 javascript is for form validation pages?
 
Keyboard is sooo clean
 
11:15 AM
@JanDvorak textContent is the standard version, innerText is the internet explorer specific one
 
Worth that hour.
 
note, however, that TC and IT have slightly different semantics
 
@l2aelba Pong
 
@JanDvorak all I know is that there is some whitespace differences, not different semantics
 
@Esailija No, but often for example, the first thing that happens in a page is some form of validation, or asking the server for stuff. If you can shave 100 mili-seconds from that sort of code that's not pointless...
 
11:17 AM
damned anonymous clueless newbie downvoters...
 
@Alnitak link?
 
0
Q: Jquery- Send params with trigger() function and receive those using click function

kitimenpolkuI'm currently using Jquery 1.4.3. I know that there are newer versions but for compatibility with an existing software we have not updated the library yet. Im trying to get some data that it is passed using the trigger() function. The trigger function has the following params: .trigger( eventTy...

 
ohohohoh... anonymous...
 
@BenjaminGruenbaum shaving 100 milliseconds is great, you will however shave microseconds at best by choosing document.body over createElement("div") :P
 
@Alnitak fixed
@Alnitak looks like strategy
 
11:18 AM
it does, doesn't it. Bloody annoying
@JanDvorak added documentation link
 
@Esailija Oh of course :) Writing feature tests is also pretty fun, you get to be clever.
 
Don't you have to pass an array as the second argument?
 
the docs are inconsistent
the function prototypes at the top of the page also say "plainobject"
 
@M.BKakadiya Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@JanDvorak it works (check the source)
 
11:22 AM
the example shows an array to send two arguments
 
@BenjaminGruenbaum in general any kind of library/libraryish programming is 1000x more fun than application dev for me :P
 
thnk
 
@BenjaminGruenbaum I wouldn't rely on implementation when it comes to answering on SO
> Type: Array or PlainObject
 
plainobject, works
 
@JanDvorak Jan, i remember a while ago you recommended this $('<div>', {id: 'something').text('Welcome'); instead of this $('<div id="something">Welcome</div>'); i have taken this onboard and use it all the time, im just curios what are the benefits of doing it that way?
 
11:24 AM
but OP has 1.4.3, not 1.9/2.0
 
@Connor the latter form uses innerHTML, the former uses createElement and createTextNode
 
you can also use text in the properties object
 
which should improve performance
 
@Esailija cool
 
@Esailija the 1.4.3 code does handle.apply( elem, data ); which probably fails if not passed an array in data
 
11:26 AM
@JanDvorak so createElement and createTextNode would improve performance right?
 
The latter revolves around hackishly parsing that html, the former doesn't.
 
Also, if the string is dynamic, text ensures proper (err, the lack of need for) escaping
 
wasn't there a change that $.parseHTML should be preferred over $
 
@Esailija it is, but not if you're only creating a single element
 
@Esailija yes there was. Especially since 1.10
They also made $("HTML") work normally again with whitespaces etc.
 
11:28 AM
@Esailija whats this $.parseHTML ?
 
One of my coding style rules - never use string concatenation to create HTML snippets unless there's no other way
 
!!/tell connor jquery parseHTML
 
@Alnitak templates are mostly string concatentation
 
@Alnitak I think it's pretty safe to generalize this to never . There is another way. Maybe if you're writing a templating engine or something.
There is just so much room to mess up
 
11:29 AM
code that string concatenates html in javascript makes me want to gouge my eyes out
 
I don't mind it if the strings are constants. I would say "never" if any of the strings are variables.
 
it's the worst possible language too, there is no variable interpolation and multi-line strings in js
so it looks as ugly as possible
 
and when should you use $.parseHTML?
 
Chances are, when you do string concatenation for HTML, what you really wanted to begin with is data-binding, and you should have done that .
 
@Connor if you have HTML that you want to parse
 
11:31 AM
likewise with selectors, never concatenate variables to make a selector if you can avoid it. Don't use ':eq(' + n + ')' when you could just chain to .eq(n)
 
please let me know ,what is biztalk server
 
@Esailija there are multiline strings in ES5
 
Jan, and that would do the same as $('<div>', {id: 'something').text('Welcome'); right?
 
@Alnitak If you have to use something like :eq(n) or $("#el"+n) you don't know what arrays are.
 
are any of you lot into server hardware porn?
 
11:32 AM
@Connor if you know the HTML in advance, you don't need parseHTML, and sometimes you can't even use it.
 
@JanDvorak ohhhh that's more like it, yeah :)
 
@BenjaminGruenbaum sometimes you still want a jQuery object
 
@JanDvorak `` at the end is not a multiline string
having to write \n\
 
@Alnitak Keep an array of jQuery objects then, I don't care. There is no point in having to select things like this from a document you created.
 
@Esailija better than nothing
@BenjaminGruenbaum jQuery objects are arrays
 
11:34 AM
this is not better than concatenation
var Str = "Hi,\n\
\n\
What's Up?\n\
\n\
Regards, E.";
 
new server I've been installing here is nice - four systems in one chassis, total of 48 CPU cores, 96 TB of storage, 32 GB per node (could take more) in 4U
 
@JanDvorak No they're not... they're array like , they just implement .splice and .length..
@JanDvorak that wasn't the point though
 
What I mean by multi-line strings:
var Str = "Hi,

What's Up?

Regards, E.";
 
@Alnitak That's crazy :O
@Esailija If I recall correctly there was a proposal for C# @" strings in JS, don't know where that's standing
 
conceptually jQuery objects are sets, with O(n²) set operations
xD
 
11:36 AM
@JanDvorak Thanks for the tip
 
@Esailija Conceptually that's the correct way to look at them :) They're sets of selections.
 
yes but the impl is array
it's like doing a map/dict/assoc array using 2 arrays
 
@BenjaminGruenbaum dual hex-core Xeons in each system, with hyperthreading too
(back later)
 
Oh yea, in ES6 it's with backticks
var str = `Something
That is
Multiline`
 
ok cool
 
11:38 AM
Good luck using that in practice though :P
 
well, after ES6 is out, 10 years
xD
 
When IE11 dies
Microsoft, Y U NO PUSH BROWSER UPDATES LIKE CHROME & FIREFOX?
 
@BenjaminGruenbaum they claim it's to kill XP
 
Microsoft, Y U NO PUSH OPERATING SYSTEM UPDATES LIKE IN LINUX AND OSX?
 
@BenjaminGruenbaum IE10 pushes updates?
 
11:40 AM
@mikedidthis I don't think it does, what I mean is, will it update to IE11 itself when IE11 comes out?
 
@BenjaminGruenbaum I don't know about major updates, but I know hotfixes should be auto: technet.microsoft.com/en-us/ie/jj898508.aspx
 
I'm not talking about hot fixes, I'm talking about actual version updates
 
> It does work in IE10, but not in IE10.0, only in IE10.1+
aargh
 
@BenjaminGruenbaum @BenjaminGruenbaum technique based on that to generate code on the fly is awesome
 
11:50 AM
@JanDvorak ?
 
I mean, imagine if we had to consider IE subversions
 
var args = Array(4).join(" ").split(" ").map(function(v, i) {
    return "arg" + i;
}).join();
Function(unwrapBodyArgs(function() {
    return function test($1) {
        return new Date($1);
    };
})(args))()
result:
function test(arg0,arg1,arg2,arg3) {
        return new Date(arg0,arg1,arg2,arg3);
    }
 
@xManh Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Hey does anyone know how facebook makes the chat panel stay fixed on the right, even page is reload?
 
@Esailija Now write that .map and .join() as a reduce
 
11:53 AM
@xManh position:fixed? Just guessing
 
I don't think so because it's like all main page's content is put in an iframe
 
@BenjaminGruenbaum meh
 
@xManh I try to stay away from iFrames as much as possible
 
when you click a link on the main page, the chat panel doesn't reload
 
11:55 AM
@xManh maybe the main page is ajaxy?
 
yeah it just like iframe but it isn't
 
@BenjaminGruenbaum var args = "arg0"+Array(4).join(" ").split(" ").reduce( function(v, v2, i) {
return v + ", arg" + i;
});
 
iFrames die with their parents
 
seems ugly
 
not ajax i think
 
11:56 AM
maybe they just reload real fast?
 
@Esailija Yeah, I think there's a better solution than that :)
 
it escapes me
 
not because it's fast, you may notice that even the scrolling position of friend list doesn't change when you re load main page
 
it reloads for me, and it doesn't even stay open
 
reduce accepts a second parameter
 
11:58 AM
@xManh the scroll position can be memorised and restored on reload
!!/tell xmanh mdn localstorage
 
This is ugly, I'm convinced I can do better
 
Array(4).join(" ").split(" ").reduce( function(v, v2, i) {
    return v + ",arg" + i;
},"").substring(1);
 
the only difference is "arg0" vs .substring(1);
 

« first day (963 days earlier)      last day (3983 days later) »