Skip to content

Instantly share code, notes, and snippets.

View simform-solutions's full-sized avatar

Simform simform-solutions

View GitHub Profile
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? {
let node = SCNNode()
if let imageAnchor = anchor as? ARImageAnchor {
let plane = SCNPlane(width: imageAnchor.referenceImage.physicalSize.width, height: imageAnchor.referenceImage.physicalSize.height)
plane.firstMaterial?.diffuse.contents = UIColor(white: 1, alpha: 0.8)
let material = SCNMaterial()
material.diffuse.contents = viewObj
plane.materials = [material]
let planeNode = SCNNode(geometry: plane)
planeNode.eulerAngles.x = -.pi / 2
let configuration = ARImageTrackingConfiguration()
let warrior = ARReferenceImage(UIImage(named: "DD")!.cgImage!,orientation: CGImagePropertyOrientation.up,physicalWidth: 0.90)
configuration.trackingImages = [warrior]
configuration.maximumNumberOfTrackedImages = 1
@simform-solutions
simform-solutions / MultiLinesTextViewUtils.kt
Created April 9, 2018 14:10
Get text on each line into array from multiline textView.
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()!!
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;
0x26FB0db2d1928528106dA9Cc9Be97e768aEe3e94
0x97178e7f1352da4Cf4Be0eCe8Ddb034F6c61214e
# 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()
# 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
# -------------------------------------Transaction history------------------------------------------------------------
# Reads the data from the account file and displays it to the user.
# If full_history is True it will print all transactions that are saved.
# If full_history is false it will print only confirmed transactions unless the transaction is no older then
# 6 hours, then it will print the transaction regardless of it's confirmation state
def print_transaction_history(full_history=False, print_history=True):
regex = r"^(?=.*?[9])(?=.*?[A-Z])[A-Z9_]+$"
current_unix_time = time.time()
#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: