• 0

    posted a message on Add-ons
    A year? More like three.
    Posted in: AddOn HELP!
  • 0

    posted a message on Is there a way to parse tooltips?
    The addon Skinner written by jncl has been known to break _G in the past. It wasn't it wasn't a complete breakage by removing it but he changed it enough to cause strange unidentifiable errors in other addons. That's why most of us that were around at that time use local _G = getfenv(0) instead of local _G = _G.
    Posted in: Lua Code Discussion
  • 0

    posted a message on E-mail address leaked?
    Curse does use one of those third party email marketing companies to do their mass mailings. I personally have never trusted any email marketing company.
    Posted in: General Chat
  • 0

    posted a message on Detecting if you are in a party
    Quote from Phanx
    The correct way to determine whether you are in a party is to check if GetNumPartyMembers() > 0. If you need to also check that you're not in a raid group, you would want to additionally check that GetNumRaidMembers() == 0.


    The correct way is with GetRealNumPartyMembers(), if you just use GetNumPartyMembers() then the code will be incorrect while you are inside a battleground. This is the major cause of the "You are not in a party spam.", people using the incorrect one.
    Posted in: Lua Code Discussion
  • 0

    posted a message on All Rights Reserved
    Quote from Daedhir
    For instance, if somebody takes your software and modifies it, they have to explicitly state that they've done so, and if they don't they have violated the license and thus have no rights whatsoever to your software. You can issue take down notices for this reason, and many others.

    So when the WoWMatrix debacle was going on, I'm absolutely sure that the SFLC would have been happy to help any GPL developers regain full rights to their own code.


    Speaking as the person that pulled WoWMatrix source code out of memory while it was running and posted that code up on the WoW forums during my crusade against WoWMatrix. WoWMatrix did not redistribute modified addons. They provided the original addons but then their installer would patch the addons after installing them without notification. One of the majorly controversial ones was that it was removing the copyright notices from Carbonite.

    I don't believe there is anything to stop that kind of behavior when using a non restrictive license which is why some of us that were using open source licenses changed to restrictive licenses.
    Posted in: General Chat
  • 0

    posted a message on Packager including externals of externals?
    I would consider this a bug since its not documented behavior or expected behavior.
    Posted in: General Chat
  • 0

    posted a message on lib-babble-* svn oddness
    The only extra file in a properly setup repo for a library will be the TOC file so adding extra directories is a waste and from my experience a complete PITA. Just look at LibSharedMedia-3.0 and how fucked up things are because of the extra directory, we can't remove it and we can't remove the top level lib.xml without breaking addons.
    Posted in: Libraries
  • 0

    posted a message on Tooltips and blank spaces
    Use a monospace font.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Minerals/herbs alerter
    But I can't edit anything but my own posts.
    Posted in: Addon Ideas
  • 0

    posted a message on Forwarding local functions best practice?
    Quote from Phanx
    How so?



    The last one is different because when calling abc() inside of the function you are not calling the function and recursing, you are calling the global abc() function.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Forwarding local functions best practice?
    Quote from Adirelle
    Note that this :

    local function myFunction(x, y)
     print("this is x", x, "and this is y", y)
    end
    


    Is exactly the same as this :

    local myFunction = function (x, y)
     print("this is x", x, "and this is y", y)
    end
    


    Or this:


    local myFunction
    function myFunction(x, y)
     print("this is x", x, "and this is y", y)
    end
    


    Or even this :


    local myFunction
    myFunction = function(x, y)
     print("this is x", x, "and this is y", y)
    end
    



    So you can declare the function name before calling it and define it afterwards.

    local myFunction
    
    local function anotherFunction()
      myFunction(5, 6)
    end
    
    function myFunction(x, y)
     print("this is x", x, "and this is y", y)
    end


    Its been a while but I think you are incorrect.

    I'll add some fluff to these examples to give a little context.

    local function abc(...)
        local x = ...
        print(x)
        if select('#', ...) >= 2 then
            abc(select(2,...))
        end
    end

    is the same as
    local abc
    function abc(...)
        local x = ...
        print(x)
        if select('#', ...) >= 2 then
            abc(select(2,...))
        end
    end

    but this one is different
    local abc = function(...)
        local x = ...
        print(x)
        if select('#', ...) >= 2 then
            abc(select(2,...))
        end
    end


    Yes I'm being a dick about the minor details.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Minerals/herbs alerter
    Somebody could create a sticky in this forum with an all caps title like READ THIS BEFORE POSTING and then just delete any threads where the person obviously didnt read it.

    I mean seriously the 3 replies to this thread are all from people that could actually create the sticky.....
    Posted in: Addon Ideas
  • 0

    posted a message on Looking for statusbar create code in LUA
    Its Lua, not LUA.
    Its Ace, not ACE.

    Neither are acronyms.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Table with keys and sorting
    Quote from OrionShock
    #table only returns the number of elements in a sequenced index. So if you have something at 1 - 5 & 35, #table is going to return 5 not 6.


    Not true, the behavior of #table is considered 'undefined' in the case that the table is anything other than a continuous array of integers without any gaps. It could return 35 in that case or it could return 5.

    This is why ipairs() should always be used over 'for i = 1, #table' in iterators if you are expecting the same behavior as ipairs but can not fully trust the source 100% because you did not create the table yourself.

    Quote from lilsparky
    yeah, that was more for illustration purposes. also, not sure how you sort two tables at the same time using one table as the keys and the other as the values.


    Quote from Xinhuan
    You do this by writing your own sort function (when swapping 2 entries, you perform the swap in both tables). Here, I mean writing the actual sort function, not the comparison function. Shell sort is almost as efficient as quick sort in Lua.


    Another more simple option is to just use the original hash table and an additional array that uses the keys from the hash table as its value to act as a sorted reference to the hash table. You use the array first to get the sorted keys but when you need the values you just look them up from the has table. You do have to iterate over the entire hash table though when you want to delete an entry and you can't have more than one entry with the same key like you could using two arrays.
    Posted in: Lua Code Discussion
  • 0

    posted a message on A plea to addon and library authors
    "tag: latest" gets the latest tag.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.