| Operation | Code |
|---|---|
New List |
List<Integer> x = new ArrayList<Integer>(); |
Copy List |
List<Integer> x = new ArrayList<Integer>(y); |
Add an element to the List |
x.add(element) |
Get an elemenet from the List |
x.get(index) |
| Clear the list | x.clear() |
New HashMap |
HashMap<Integer, String> x = new HashMap<Integer, String>(); |
| Add element to the map | x.put(key, value) |
| Get an element from the map | x.get(key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Python v3.4.2 console based script | |
| # Set Raspberry Pi GPIO ports Low depending on user input | |
| # User enters number between 0 and 15, GPIO ports 22, 23, 24 & 25 | |
| # are set as BCD representations of the decimal input. | |
| # GPIO ports are weighted 0, 2, 4, 8 [GPIO 22, 23, 24, 25] | |
| # Number 99 entered quits the script | |
| # GPIO ports connect to AD8-11 ports on HT12E encoder chip | |
| # user input is BCD coded & used to set AD8-11 ports | |
| # GPIO port 17 is used to send trigger pulse to activate the HT12E for 1 complete cycle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #vcgencmd measure_volts <id> | |
| #Shows voltage. id can be one of core, sdram_c, sdram_i, sdram_p, and defaults to core if not specified | |
| for id in core sdram_c sdram_i sdram_p ; do \ | |
| echo -e "$id:\t$(vcgencmd measure_volts $id)" ; \ | |
| done | |
| #Shows core temperature of BCM2835 SoC. | |
| vcgencmd measure_temp | |
| #or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=RFCOMM service | |
| After=bluetooth.service | |
| Requires=bluetooth.service | |
| [Service] | |
| ExecStartPre=/usr/bin/sdptool add --channel=3 SP | |
| ExecStart=/usr/bin/rfcomm watch hci0 3 setsid /sbin/agetty -L rfcomm0 --keep-baud 115200,38400,9600 xterm -a pi | |
| Restart=on-failure | |
| RestartSec=5s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Basic commands | |
| git init //Initalize Local Git Repository | |
| git add <file> //Add Files to index | |
| git status //check status of working tree | |
| git commit //commit changes in index | |
| #remote commands | |
| git push //push to remote Repository | |
| git pull //pull latest from remote Repository | |
| git clone //clone Repository into new directory |
NewerOlder