I hate wires. So, I was happy to remove the ethernet cable from my Raspbmc setup and replace it with a USB wireless adapter. The steps are pretty easy:
Get a USB wireless adapter. These are very cheap. I bought a DX Original USB wireless adapter, since I had read that it works out of the box with Raspbmc. Plug in the wifi adapter to your Raspbmc.
Connect a wired or wireless mouse or remote to the Raspbmc. Use it for the configuration steps.
Reboot the Raspbmc. This is needed sometimes for the mouse to be detected.
Go to Programs > Raspbmc settings. In the Network Configuration tab change the Network Mode to Wireless.
Configure the rest of the settings. The default is DHCP. If you want to use a static IP address, provide the necessary details.
The scan for wireless networks did not work, it showed up empty. So, I manually entered the Wifi SSID (name of your wireless network), Wifi Security mode and the Wifi Key (wireless password). Click Update Now and OK.
Your wireless adapter should be able to connect to your home network now. If not, reboot the Raspbmc.
Unplug the Ethernet cable and enjoy your Raspbmc :-)
Type declarations in C or C++ can sometimes look confusing. cdecl is a commandline tool that can convert a type declaration into plain English that might be easier to understand.
To install cdecl:
$ sudo apt install cdecl
To use cdecl:
$ cdecl explain "const int* ip;"
declare ip as pointer to const int
To use cdecl in interactive mode:
Type `help' or `?' for help
cdecl> explain const int* ip;
declare ip as pointer to const int
Note that I found that cdecl fails on even simple declarations which are legal in C or C++:
$ cdecl explain "const int const * ip;"
The cdecl can also be used online here.
Tried with: Cdecl 2.5-13 and Ubuntu 14.04
GLSL shaders are typically written in standalone files. To get syntax highlighting for these files in Vim:
$ cd ~/.vim/bundle
$ git clone https://github.com/tikhomirov/vim-glsl.git
Tried with: Vim 7.4 and Ubuntu 14.04
Believe it or not, the man pages for OpenGL API is actually available! Just install it:
$ sudo apt install opengl-4-man-doc
The same can be viewed online at OpenGL 4 Reference Pages.
Tried with: Ubuntu 14.04
Vertex, fragment and geometry shader programs can be written in GLSL. These are usually written in separate files. Any filename and extension can be used for GLSL shader files since the language standard does not enforce anything.
I found it convenient to name the shader programs as
foo.gs.glsl. I found this convention used in the source code from the book The OpenGL Superbible. The
.glsl is recognized by many editors and GLSL syntax highlighting is automatically applied when you open those files.
I registered for a NLB membership recently. I tried using my NRIC to login online at the NLB website, but that did not work. I presumed that maybe I needed a web login. I went to a library the next day and using a E-Kiosk I created an online login. I came back home tried that and I still could not log on.
To diagnose the problem, I tried the login using incognito mode in Chrome and it worked. By using trial and error I found that it was one of my extensions that was causing the error (and not cookies). Turned out that the Ballloon extension was strangely causing this error. Uninstalling it made my NLB login to work.
You may sometimes want to convert a PDF file into an image format like PNG or JPG. Doing this is easy using the convert application from ImageMagick.
If you do not have it, first install ImageMagick:
$ sudo apt install imagemagick
To convert a PDF with a single page into a JPG:
$ convert foo.pdf foo.jpg
If the PDF has multiple pages, one image file is produced per page:
$ convert foo.pdf foo.png
By default, the image file is produced at 96 DPI resolution of the PDF. If you need higher DPI, use the density option. For example, to generate at 300 DPI:
$ convert -density 300 foo.pdf foo.png
Tried with: ImageMagick 6.7.7-10 and Ubuntu 14.04