Sunday, September 13, 2015

Fixing "you need to install the legacy Java SE 6 runtime." errors

For various reasons I wanted to try out Universal Media Server on my MacBook OS X Yosemite 10.10.5 before I install it for real on my Linux box. However, this was not as easy as I thought it would be, because upon starting the app, an error window appears with the text "you need to install the legacy Java SE 6 runtime."

Yes, doing that would have been the easy fix, but the legacy Java SE 6 runtime is old, with many known security exploits, and  I already have the latest JDK8 installed, why can't I just use that?

This process was not as straightforward as expected, but easy enough, explained at http://stackoverflow.com/a/19594116:
  1. Make sure Java is up to date.
  2. Edit the Info.plist file (I did this via command line):
    • sudo vi /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Info.plist
      •  In the "JVMCapabilities" array, make sure it has the three following entries:
      •                         JNI
                                BundledApp
                                CommandLine
  3. Link a dynamic library:
    • sudo mkdir -p /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bundle/Libraries/
    • sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/server/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bundle/Libraries/libserver.dylib
  4. Reboot.
Once those steps were completed, I was able to run the Universal Media Server app. If only the first step is applied, then the error "LSOpenURLsWithRole() failed with error [XXXXX]" occurs instead.

Saturday, September 12, 2015

Static Analysis

I listened to Floss Weekly podcast episode #352 - FWKNOP earlier this week. In it, the guest mentioned two tools he uses for static analysis: CLANG static analyzer (which, as the name suggests, is only for C/C++ and Objective-C) and the powerful Coverity Scan tool, which is free for open source projects and covers other languages as well.

Friday, September 11, 2015

IPFS

IPFS is short for InterPlanetary File System, a peer-to-peer filesystem. Peers have a choice in what they distribute, unlike Freenode.

Say you want to store a file on IPFS. The unique name is basically a hash of the contents of the file. If the contents change by even one bit, then a completely new hash is made. In one way, this is a good thing because it allows others that care about said content to be able to archive it and distribute it themselves, and others can easily determine if the file they got was altered in some way by hashing it again, and comparing it with the name.

However, what this means is that we can't ever change the file, even if we wanted to change it. IPFS's answer to it is similar to what bitcoin does for wallets, which is to use a public key hash. They call this IPNS, or InterPlanetary Naming System. So we could sign a file with our private key, and people who know our Peer ID can retrieve it, using the public key to verify that the new contents were, in fact, mutated by us. The IPFS folks have a better explanation on their site.

IPFS, written in go, is being used by NeoCities to spearhead their permanent, distributed web movement. While it is usable now, the technology is very much a work in progress. It has stirred up Hacker News a few times in the past, and I'm sure we'll see more of them.

I've been looking for some sort of peer-to-peer filesystem like this for maps, chatrooms, achievements, save games, replays, app updates, rankings, etc. While I don't think IPFS is the answer for all of those use cases, it does work nicely for maps and app updates, at least. The end goal would be an online game where everybody can contribute any amount of their own resources to ensure that the game runs smoothly, and beneficial contributors are rewarded, detrimental users are punished, and it all somehow (and magically) happens without mob rule (all the players ganging up on a few users) yet without a tyrannical ruler (the author of game) either. I've touched on all this before so I'll save my breath fingers from blistering.

Monday, September 7, 2015

Steven Wittens, and the Pixel Factory

Steven Wittens, the man behind acko.net, recently gave a presentation called "The Pixel Factory". This man has put more thought into rendering his website's header than many programmers (yours truly included) have put into entire games. Even the presentation itself reveals a level of quality and polish few others achieve. It's a good introduction into several rendering concepts, and even presents a few different views of said concepts.

Some of the items that came up were new to me but have been used in the field for quite some time, such as drawing text with signed distance fields in order to keep text looking sharp when it appears distant/small.

It also pointed me to WebGL Stats, which, as is said in the name, shows statistics of various web API and WebGL extensions support.

Order-independent transparency in WebGL vs. OpenGL was touched on as well (with WebGL 1.0, it must be two-pass). The original way to do transparency in OpenGL was to order the triangles/geometry back-to-front and disable writing to the depth-buffer so that each transparent object is drawn. With order-independent transparency, the fragments themselves are sorted.