This file contains 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
#include <iostream> | |
using namespace std; | |
int level = 0; | |
int digitsum(long long int n) { | |
int result = 0; | |
while (n) { | |
result += n%10; | |
n /= 10; |
This file contains 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
#include <iostream> | |
#include <iomanip> | |
using namespace std; | |
int main(void) { | |
double x, va, vb; | |
cin >> x >> va >> vb; | |
// scanf("%lf %lf %lf", &x, &va, &vb); | |
// following line of code prints integers | |
cout<< x << " " << va << " " << vb << "\n"; |
This file contains 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
http://wknc.sma.ncsu.edu:8000/wknchq.ogg.m3u (radio) | |
https://stream.wuvt.vt.edu/wuvt-hq.ogg | |
http://ubuntu.hbr1.com:19800/trance.ogg | |
http://ubuntu.hbr1.com:19800/ambient.ogg |
This file contains 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
# sessionStorage | |
store a value `sessionStorage["key"] = "value";` | |
## Store multiple values | |
- to store values "one", "two", "three" | |
store as follows : `sessionStorage['key"] = ["one", "two", "three"];` | |
- to retrieve multiple values stored use as follows | |
`var array = sessionStorage["key"].toString().split(",");` |
This file contains 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
install adb and adb-fastboot in ubuntu | |
`sudo apt install android-tools-adb android-tools-fastboot` | |
Enable USB Debugging on Your Android Device | |
If you get the following error, `???????????? no permissions` | |
Then all you need to do is restart adb daemon, run | |
`sudo adb kill-server` and `sudo adb start-server` | |
reboot device command : `adb reboot` |
This file contains 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 | |
sudo add-apt-repository universe | |
sudo apt-get update | |
count=$( cat /etc/apt/sources.list | grep "xenial main universe" -c ) | |
if [ $count -lt 2 ]; then | |
sudo bash -c 'echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe | |
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main universe" >> /etc/apt/sources.list' |
This file contains 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 | |
LOG_FILE=~/android_backup.log | |
DISOLVE_DIRECTORY=0 | |
if [[ $BACKUP_SRC -eq "" ]]; then BACKUP_SRC=storage/self/primary; fi | |
if [[ $BACKUP_DST -eq "" ]]; then BACKUP_DST=$HOME/AndroidBackup; fi | |
IFS=$'\n' # set the Internal Field Separator to newline for iterating over file and directory list output of ls | |
usage() { echo "Usage: $0 [-s <android-source-folder>] [-d <backup-directory-path>] [-m]\n\t-x " 1>&2; exit 1; } | |
stop() { echo "Exiting..."; echo "No backup made!!"; exit 0; } |
This file contains 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/sh | |
set -e | |
KEY_PATH="$HOME/localpairs" | |
# install necessary tools | |
sudo apt-get install git build-essential curl openssl mokutil -y | |
build_module () { |
This file contains 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 | |
set -e | |
FILE_PATH="/etc/docker/daemon.json" | |
# do not write if daemon.json already exists | |
if [ -e "$FILE_PATH" ]; then | |
echo "File ($FILE_PATH) already present. No changes made" | |
exit 1 |