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
| Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT); | |
| toast.show(); |
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
| 'WARNING: Will open as many browser tabs as the length of the array, so it could take a while to load | |
| 'ShellExecute code from https://stackoverflow.com/questions/3166265/open-an-html-page-in-default-browser-with-vba | |
| 'Dynamic Array code from https://www.thespreadsheetguru.com/blog/dynamically-populating-array-vba-variables | |
| Option Explicit | |
| Private Declare Function ShellExecute _ | |
| Lib "shell32.dll" Alias "ShellExecuteA" ( _ | |
| ByVal hWnd As Long, _ |
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
| import time | |
| import webbrowser | |
| numberOfBreaks = 2 | |
| seconds = 1 | |
| while numberOfBreaks > 0: | |
| time.sleep(seconds) | |
| webbrowser.open("www.youtube.com") | |
| numberOfBreaks -= 1 |
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
| import os | |
| def rename_files(): | |
| #get file names from a folder | |
| file_list = os.listdir(r"C:\") | |
| print(file_list) | |
| #get current working directory | |
| saved_path = os.getcwd() | |
| #change directory | |
| os.chdir(r"C:\") |
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
| #For use with Rasp Pi SenseHat | |
| from sense_hat import SenseHat, ACTION_PRESSED, ACTION_HELD, ACTION_RELEASED | |
| from signal import pause | |
| sense = SenseHat() | |
| sense.clear() | |
| #Where is the cursor starting point? | |
| x = 2 |
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
| //Xml code for creating the count TextView | |
| <TextView | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:gravity="center" | |
| android:textSize="120sp" | |
| android:id="@+id/count" | |
| android:text="0" /> | |
| //Java code for increasing the count and displaying it |
NewerOlder