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 com.google.gson.stream.MalformedJsonException; | |
import java.io.IOException; | |
import java.lang.annotation.Annotation; | |
import okhttp3.ResponseBody; | |
import retrofit2.Converter; | |
import retrofit2.Response; | |
import retrofit2.Retrofit; |
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 android.os.Build | |
import android.view.ViewTreeObserver | |
import android.widget.TextView | |
/** | |
*Created by Amit.Bhati on 08/04/18. | |
*/ | |
class MultiLinesTextViewUtils(builder: Builder) { | |
private var getLines: GetLines = builder.getListener()!! |
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
pragma solidity ^0.4.15; | |
/** | |
* Overflow aware uint math functions. | |
*/ | |
contract SafeMath { | |
//internals | |
function safeMul(uint a, uint b) internal pure returns (uint) { | |
uint c = a * b; |
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
0x26FB0db2d1928528106dA9Cc9Be97e768aEe3e94 |
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
0x97178e7f1352da4Cf4Be0eCe8Ddb034F6c61214e |
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
# The function that rules them all! | |
# This function will be called when the script is executed and will ask the user for the seed and then listens to | |
# the users commands. All functions above will be called directly or indirectly through this function. | |
def main(): | |
ask_seed = True | |
while ask_seed: | |
global seed | |
global file_name | |
seed = log_in() | |
file_name = create_file_name() |
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
# Gets all assosiated transactions from the saved addresses and saves the transaction data in the account file | |
def get_transfers(full_history, print_history=True): | |
account_history_executing = True | |
api = Iota(iota_node, seed) | |
address_count = len(address_data) | |
all_txn_hashes = [] | |
saved_txn_hashes = [] | |
new_txn_hashes = [] | |
i = 0 |
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
#rotate servo motor according to transaction | |
def rotate_motor(): | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setwarnings(False) | |
GPIO.setup(25, GPIO.OUT) | |
pwm=GPIO.PWM(25,50) | |
pwm.start(7.5) | |
try: |
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
#turn on and off led according to transaction | |
def blink_led(is_on): | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setwarnings(False) | |
GPIO.setup(18,GPIO.OUT) | |
try: | |
if is_on: | |
GPIO.output(18,GPIO.HIGH) | |
time.sleep(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
#execute command according to transaction tag | |
#To turn on led use this command TURNONLED999999999999999999 | |
#To turn off led use this command TURNOFFLED99999999999999999 | |
#To rotate servo motor use this command TURNONSERVO9999999999999999 | |
def execute_command(command): | |
print("Transaction tag: " + command) | |
if command == 'TURNONLED': | |
blink_led(True) | |
elif command == 'TURNOFFLED': | |
blink_led(False) |