Skip to content

Instantly share code, notes, and snippets.

View JavonDavis's full-sized avatar
🏠
Working from home

Javon Davis JavonDavis

🏠
Working from home
View GitHub Profile
[info] [Appium] Welcome to Appium v1.10.0
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> DELETE /wd/hub/session/59ffcc44-11ee-4ceb-aea9-33ed3da8c7fd
[info] [HTTP] {}
[debug] [MJSONWP (59ffcc44)] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started
[debug] [MJSONWP (59ffcc44)] at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/protocol.js:298:15)
[debug] [MJSONWP (59ffcc44)] at app.(anonymous function) (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/protocol.js:489:15)
[debug] [MJSONWP (59ffcc44)] at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/express/lib/router/layer.js:95:5)
[debug] [MJSONWP (59ffcc44)] at next
@JavonDavis
JavonDavis / network.py
Last active December 30, 2017 17:15
Train network on MNIST dataset using tensorflow
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
mnist = input_data.read_data_sets('.', one_hot=True, reshape=False)
# parameters
learning_rate = 0.00001
epochs = 10
batch_size = 128
@JavonDavis
JavonDavis / clone.py
Created October 16, 2017 04:05
File used to load data from a driving log file and IMG folder when recorder using driving simulator for training neural network
import csv
import cv2
import numpy as np
lines = []
with open('./driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)
@JavonDavis
JavonDavis / tic_tac_toe.py
Last active October 10, 2017 20:24
Tic Tac Toe terminal game
n = 3
board = [[0] * n for _ in xrange(n)] # 0 for empty slot, 1 for X and -1 for O
def show_board():
for i in xrange(len(board)):
print '\t' + str(i),
print '\n'
for row_number, row in enumerate(board):
print str(row_number) + '\t',
@JavonDavis
JavonDavis / UIColorExtension
Created January 9, 2017 04:06
Extensions for UIColor in swift3
import Foundation
import UIKit
extension UIColor {
// Convenience initialiser to create a UIColor from a Hex Code
convenience init?(hex: String) {
var hexCode:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
if (hexCode.hasPrefix("#")) {
hexCode.remove(at: hexCode.startIndex)
@JavonDavis
JavonDavis / StandaloneMain.java
Created April 26, 2016 04:28
Modified standalone main class used in Maui so that the results returned are in JSON format.
package com.entopix.maui;
import java.io.File;
import java.util.ArrayList;
import org.apache.commons.io.FileUtils;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import weka.core.Utils;
@JavonDavis
JavonDavis / thelastword.py
Created April 17, 2016 09:57
My solution for Google codejam round 1A problem "the last word"
t = int(raw_input())
for i in xrange(1, t + 1):
S = raw_input()
last_word = S[0]
for character in S[1:]:
if character >= last_word[0]:
last_word = character + last_word
else:
last_word += character