Jump to content

Arbu

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Arbu

  • Rank
    Newbie
  1. OK, thanks. So it sounds like they weren't trying to make it harder to read, just more efficient.
  2. Thanks very much, I'll have a read through. The code is from a library called fabricjs. The library isn't working in relation to a particular matter for me. So I have been looking at the code to try to figure out why. Why would someone produce an open source library and obfuscate it? Aren't the two things contradictory? I have asked the authors why it's not working. They helped me a bit but then have stopped responding.
  3. I've learnt javascript through w3schools and it seemed fine. But when I go to look at and try to understand some code I don't feel as if my learning has got me anywhere. Here's an example: enlivenObjects: function(t, e, n, s) { var o = [] , i = 0 , r = (t = t || []).length; function a() { ++i === r && e && e(o.filter(function(t) { return t })) } r ? t.forEach(function(i, r) { i && i.type ? fabric.util.getKlass(i.type, n).fromObject(i, function(t, e) { e || (o[r] = t), s && s(i, t, e), a() }) : a() }) : e && e(o) }, So a few questions: 1. Is the function declaration simply a different way to say function enlivenObjects(t,e,n,s){...}? 2. what on earth does this mean "r = (t = t || []).length;"? 3. Is "r ?" shorthand for "if r!== null"? 4. What does "i && i.type" mean? 5. And this "e || (o[r] = t),"? I do know that || means "or". How can you have a line of code like that? If someone says to me "If it's raining or snowing stay indoors" I understand. If they just say "raining or snowing" it's not an instruction. Computer code should be about giving instructions surely? Maybe someone can help me out. Thanks.
  4. I want to remove all the timestamp tags from the "My Places" file that Google Earth provides. This file is an xml file and is on my hard drive. The stamps look like "<gx:TimeStamp><when>2014-06-08T00:12:24Z</when></gx:TimeStamp>".There are 4,000 such tags, so doing it manually one by one is not an option. I can't see how I would do a search and replace on the file because that would not remove the data in the middle. So it seems I need to use XML Dom. I've been reading through the tutorials on W3Schools. Somehow I need to open the My Places file with the XMLHttpRequest object. How do I do that? Thanks.
×
×
  • Create New...