Chun Sing Tsui

Coding, Technology, and other Interests

Site Update

Finally got around to migrating my site off of Wordpress. I’ve read good things about Octopress, so that’s what the new site is based on. It is relatively straightforward to migrate the posts into the Octopress/Jekyll markdown format using the included tools.

Currently the site is using a popular theme called Whitespace. Hopefully I will get around to customizing the theme a bit in the near future.

More updates that will be coming:

  • import scale modeling posts
  • rehost images
  • add project pages

GreaseMonkey Script to AutoHide Reddit Sidebar

This simple script hides the ridiculous sidebar that squishes up the content when viewing Reddit with only a small amount of screen space (e.g. half of screen or low resolution display). It only hides the sidebar when the window width is detected to be lower than half of your resolution.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(function () {
    // 1920 is your screen width; adjust accordingly
    var threshold = 1920 / 2;

    // Get sidebar div element and its original display style
    var sideBar = document.getElementsByClassName('side') [0];
    var origStyle = sideBar.style.display;

    // Check the window width and hide it if it's too small
    function doCheck() {
        if (window.innerWidth < threshold) {
            sideBar.style.display = 'none';
        }
        else {
            sideBar.style.display = origStyle;
        }
    }
    // Attach it the resize event
    window.addEventListener('resize', function (event) {
        doCheck();
    });
    // Run it once initially
    doCheck();
}());

Setting Up E2studio for RL78/G14 RDK Developement

Set up e2studio for RL78 development following the steps below. These downloads are the files provided on the RL78/G14 RDK installation DVD. However, this will be useful if you happen to lose the DVD, don't have a DVD drive, or want to install/update a particular item when it becomes outdated.

Setup e2studio

1). Download/Install e2studio from Renesas website:

  • http://sg.renesas.com/products/mpumcu/rl78/rl78g1x/rl78g14/soft_tools_index.jsp

2) Download KPIT GNU Toolchain for RL78 and register it with e2studio (should automatically pop up when you open e2studio). The GNURL78 compiler is a free compiler with no size limitations.

  • http://www.kpitgnutools.com/latestToolchain.php

3) Download/Install IAR Plugin for e2studio using the appropriate update site. The IAR plugin allows projects for the IAR compiler to be built and debugged in e2studio.

  • http://www.iar.com/eclipse/