Cool Chords for Gospel Music

Hi folks,

Today I will discuss a few good chords to use for each number of the scale, in the key of D♭ major.

D 1st tone

Chord LH RH Notes
D (add 9) D D E F A
or
E A D
D quartal chord D B E A
D♭ maj7 D C F A
D♭ maj9 D C E F A
D♭ 9 (add 6) D F B B E Secondary chord (not starting)
D♭ 13 D B E G B

E 2nd tone

Chord LH RH Notes
E♭ min7 E B D G
E♭ min9 E G B D F
or
F G B D
E♭ 9 (add 6) E G C D F
E♭ min7 (♭5) E A D E G
E♭ 9 E G B D F

F 3rd tone

Chord LH RH Notes
F 7 (#9 #5) F A D E A
Dmaj / F F A D F#
Any 1 tone chord over F F D E F A
F half-dim7 F A B E

G 4th tone

Chord LH RH Notes
G♭ maj7 G F B D
G (add 9) G G A B D
G♭ maj7 (add 6) G B E F B

A 5th tone

Chord LH RH Notes
A♭ 13 A G B D F
A – 4 chords A 1. G♭ maj (D G B)
2. A♭ maj (E A C)
3. D♭ maj (F A D)
4. A♭ maj (E A C)
Any 1 tone chord over A bass
Any 3 tone chord over A bass A C F A
Any 4 tone chord over A bass A D G B
A (add 9) A A B C E
A♭ min9 A G B B E

B 6th tone

Chord LH RH Notes
B♭ min9 B A C D F
B♭ 13 B A C E G
B♭ 7 (♭9) B A B D F This is a diminished chord
C maj7 (#5) / B B C E A B
4 tone chord / B B D G B

C 7th tone

Chord LH RH Notes
C min11 C E G B D F
4 tone major chord / C C B D G
6 tone minor chord / C C B D F
5 tone major chord / C C A C E

With these chords you can create some really awesome sounding gospel music if you make good use of patterns. Hopefully I’ll post a recording of some songs played using these soon.
If you want to learn more about these chords or what cool music you can play with them, I refer you to Hear and Play Gospel Keys 202 – http://info.hearandplay.com/gk202quizgmtcmcjg/?code=infemail.

Enjoy!

How to wait for visibility in PhantomJS

I found an excellent piece of code on Stack Overflow on how to wait for elements to become visible before performing an action in PhantomJS. I thought I would share it here.

Here is the function required:

function waitFor ($config) {
    $config._start = $config._start || new Date();

    if ($config.timeout && new Date - $config._start > $config.timeout) {
        if ($config.error) $config.error();
        if ($config.debug) console.log('timedout ' + (new Date - $config._start) + 'ms');
        return;
    }

    if ($config.check()) {
        if ($config.debug) console.log('success ' + (new Date - $config._start) + 'ms');
        return $config.success();
    }

    setTimeout(waitFor, $config.interval || 0, $config);
}

Then use the code as follows:

waitFor({
    debug: true,  // optional
    interval: 0,  // optional
    timeout: 1000,  // optional
    check: function () {
        return page.evaluate(function() {
            return $('#thediv').is(':visible');
        });
    },
    success: function () {
        // we have what we want
    },
    error: function () {} // optional
});

Reference

http://stackoverflow.com/questions/16807212/how-to-wait-for-element-visibility-in-phantomjs

How to Enable Custom Error Pages for Apps using Nginx and uWSGI

Here’s a quick tutorial on how to enable error pages on your application when using uWSGI and Nginx. Let’s assume you have your nice custom 500 error page created and want Nginx to use it. First, add the error page configuration to Nginx as follows:

 

error_page 500 /my_500.html
location = /my_500.html {
   root /some/path;
}

You may notice Nginx still serves its default 500 error page. To make your custom pages work, add the following statement:

uwsgi_intercept_errors on;

That’s all for now. Happy coding!

How to Disable Specific Pylint Checks

Suppose you’re working on a Python application and using Pylint to monitor code quality, you may come across specific lines in code where you do not want Pylint to check. Here’s how you disable such check.

Add a comment of the form:

# pylint: disable=some-error-attribute

To re-enable checks within the same function, you can use a comment like

# pylint: enable=some-error-attribute

You may place the disable comment just able the block of codes you want to disable checks for and any code after that line in the function will not be checked for the attribute. You can also place the comment just after the code on the same line so it acts only on that line.

The Pylint documentation [1] has a lot more information and examples on these.

References

1. Messages control — Pylint 1.7.0 documentation. https://pylint.readthedocs.io/en/latest/user_guide/message-control.html [08/03/17].

How to fix MySQL Error: The server quit without updating PID file

When using a Mac, having installed MySQL using Homebrew, you may run into an error as follows when trying to start MySQL perhaps after changing some MySQL configuration:

. ERROR! The server quit without updating PID file (/usr/local/var/mysql/your-pc-name.lan.pid).

Here’s a quick way to fix it:

Check the ownership if /usr/local/var/mysql/. If it is not owned by mysql user, then simply make it owned by mysql with the following command:

sudo chown -R mysql /usr/local/var/mysql/

Then start the service once more.

sudo mysql.server start

That’s all!

Reference

1. MySql server startup error ‘The server quit without updating PID file’ – Stack Overflow. http://stackoverflow.com/questions/4963171/mysql-server-startup-error-the-server-quit-without-updating-pid-file [4/3/2017].