Friday, December 4, 2015

How to watch paid videos on Youtube/Google Play on Debian Linux with DRM

In order to watch paid videos from youtube/google play on Debian/Firefox, you need the latest flash plugin.  To to get this, run

sudo apt-get install flashplugin-nonfree

If you already have flashplugin-nonfree installed, you should run

update-flashplugin-nonfree --install

You can then run

update-flashplugin-nonfree --status

to verify that you have the latest version. Once you have the latest flash version, you need to install HAL for the flash DRM playback to work.  Unfortunately, HAL is deprecated, so you have two options: First is to install zombie hal which is a version of hal that has been kept alive for purposes of DRM support.  Unfortunately, zombie hal is for ubuntu, and my attempts to use it on debian didn't work.  The second option is hal-flash  which is a fake version of hal designed to be just functional enough that flash will accept it.  In order to install on debian, just download the source code, and run dpkg-buildpackage from the source directory. It will tell you any required packages you need to install, and when it finishes running, it will produce a .deb file in the parent directory, which you can install directly.

After installing hal-flash, I cleared the adobe cache which is suggested by many instructions online by deleting the .adobe directory.

At this point, I was still getting the message "an error occurred. please try again later".  To investigate, I used the rightclick -> copy debug info.  On inspection of this info, it looked to be url encoded, so I used an online url decoder to inspect the contents.  The key part of the decoded info was the section "debug_error=[ErrorEvent type="FlashAccess:3315:0" bubbles=false cancelable=false eventPhase=2 text=""]".  To investigate this further, I opened firebug, and looked at the net panel, to see the network activity taking place.  It turned out that the request to youtube.com/crossdomain.xml was never completing, and I eventually figured out that this was due to the plugin HTTPS everywhere I had installed.

After disabling HTTPS everywhere, it began to work on one computer, but on the other computer, the same steps still left it broken, giving me an error message "There is an error with your flash player. Click here, select reset license files, and restart your browser".  The debug info showed me that this is caused by error "FlashAccess:3329:500".  This indicates according to the flash reference that it is some sort of "application specific error", meaning I'd need google/youtube's help debugging it further, which they don't offer.  My own investigation of the network traffic just seems to indicate that nothing is going obviously wrong.

Hopefully these steps are useful to you!

Monday, March 2, 2015

Notes on implementing neural networks


Here are some notes on implementing deep neural networks.

Visualize as much as possible

No, I don't mean in the sense of simply imagining success, but in the sense of creating visual representations of your models and the training process.  When you write the code to do the training and run it, it can be hard to diagnose what's going on when it just prints out "ERROR RATE" at every iteration.  Even just graphing the error rate can help you tell if things are converging or diverging easier than printing it out in textual format.

Of course this is much more useful if you are learning a visual task, but be creative, and use tools like T-SNE  to visualize data that isn't directly visual.  It will end up being a lot of effort to do visualization, even more than the actual implementation, but it's worth it in the end.

Use automatic differentiation

The common advice I see on training neural networks is to always check whether your gradient code is correct by using the finite differences method.  I would go further and say that it is worthwhile to use automatic differentiation if possible.  You get precise answers as to what the gradient /should/ be, and when you write the optimized  implementation of the gradient calculation, you can compare the results side-by side.  If you don't care about speed, you can just run the whole algorithm using the Automatically differentiated gradient and not worry about writing any extra code at all.