Skip to content

Instantly share code, notes, and snippets.

View rachelwritingcode's full-sized avatar
🦉

Rachel Wang rachelwritingcode

🦉
View GitHub Profile
@rachelwritingcode
rachelwritingcode / Eyeballing-This.md
Created June 27, 2020 20:14 — forked from zcaceres/Eyeballing-This.md
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!

Nope.

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

package ca.rwang.connectthree;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
package a3;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JTextPane;
import java.awt.BorderLayout;
import javax.swing.JPanel;
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)
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
-------------------------
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%'
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
GPIO.setwarnings(False)
# Set the layout for the pin declaration
GPIO.setmode(GPIO.BOARD)
# 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
GPIO.setmode(GPIO.BCM)
# Define GPIO pins being used
GPIO_TRIGGER = 18
GPIO_ECHO = 25
#Trig will send out a short burst of sound waves
@rachelwritingcode
rachelwritingcode / blink.py
Last active August 13, 2017 19:59
Python Blink Tutorial