Handling variable number of arguments in Lua


Here’s a quick example of how variable number of arguments can be handled in Lua. It has been tested with Lua 5.1 and 5.2.

function SomeFunction(...)
    local list = {...}
    print(string.format("Received %d arguments:", #list))

    -- print all arguments
    print(...)

    -- print all arguments again using a for loop
    for i = 1, #list, 1 do
        print(list[i])
    end
end

SomeFunction("hello", "world")

Upgrade to Ubuntu 14.04 on Parallels Desktop 9


Ubuntu 13.10 is no longer officially supported so decided to bite the bullet and go ahead with the upgrade to Ubuntu 14.04, on Parallels Desktop 9. I’m running Parallels on an early 2013 MackBook Pro with Retina Display. The MAC OS X version is 10.10 (Yosemite) Public Beta. I installed the public beta after encountering problems running Parallels with Developer Preview beta 6.

Originally, I started with an Ubuntu 13.04 VM that Parallels officially supports, and at some point upgraded to 13.10. Ubuntu’s Unity interface does not work at all after that upgrade. I don’t get the taskbar or the menu bar at the top. I gave up on Unity, and followed instructions from Parallels to install and enable GNOME Flashback. Desktop works all right after that, even after upgrade to 14.04.