Skip to content

Instantly share code, notes, and snippets.

rwangca /
Created Jun 27, 2020 — forked from zcaceres/
Understanding Binding and 'this' in Javascript

How to Eyeball Your ‘This’ Context in Javascript

The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.

This is all about where a function is invoked. Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!


To understand this, we need to see where it is invoked. Nothing else matters, with one exception which we'll cover in a moment.

View connectThree
package ca.rwang.connectthree;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
View TypingTutor
package a3;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JTextPane;
import java.awt.BorderLayout;
import javax.swing.JPanel;
View sample-three
Column "Movie Title" format a35;
select "Movie Title"
from (select tm.MovieTitle as "Movie Title",
count(tad.MovieID) as "Total Awards"
from tblMovie tm
inner join tblAwardDetail tad on tm.MovieID = tad.MovieID
where tad.AwardResultID = '1'
group by tm.MovieTitle
order by "Total Awards" desc)
View sample-two
Column "Writers Name" format a25;
select tw.WriterFName||' '||tw.WriterLName as "Writers Name"
from tblWriter tw
left outer join tblWriterDetail twd on tw.WriterID = twd.WriterID
where twd.MovieID is null
order by tw.WriterID;
Writers Name
View sample-one
column "Movie" format a30;
select distinct tm.MovieTitle as "Movie"
from tblKeyword tk
inner join (tblKeywordDetail tkd
inner join tblMovie tm on tm.MovieID = tkd.MovieID )
on tkd.KeywordID = tk.KeywordID
where tk.KeywordDesc Like '%France%' OR
tk.KeywordDesc Like '%Pizza%' OR
tk.KeywordDesc Like '%Waitress%'
View DatabaseQuestions
PAUSE Press [RETURN] to see Question 1;
/* 1 */
column "Movie" format a25;
select MovieTitle as "Movie"
from tblMovie
where DirectorID is null;
PAUSE Press [RETURN] to see Question 2 ;
import RPi.GPIO as GPIO
import time
import os
# Set the layout for the pin declaration
# The pin 11 is the out pin for the PWM signal for the servo.
GPIO.setup(11, GPIO.OUT)
# Import GPIO Library
import time
import RPi.GPIO as GPIO
# Define GPIO pins being used
#Trig will send out a short burst of sound waves
rwangca /
Last active Aug 13, 2017
Python Blink Tutorial