Skip to content

Instantly share code, notes, and snippets.

View LastZactionHero's full-sized avatar

Zach LastZactionHero

View GitHub Profile
//------------------------------------------------------------------------------
// Download Langauges
//
// VITLanguage: An individual language, name ("English", "Spanish") and code
// ("en", "es")
//
// VITLanguageManager: Download an array of VITLanguages from API
//
//------------------------------------------------------------------------------
### THE SCRIPT
#!/usr/bin/env ruby
dump = `ps -ef | grep zeus`
processes = dump.split("\n")
processes.each do |process|
process_id = process.scan(/[0-9]+/)[1]
`sudo kill -9 #{process_id}`
end
require 'selenium-webdriver'
require 'selenium/client'
#system 'java -jar ~/Downloads/selenium-2.37.0/selenium-server-standalone-2.37.0.jar &'
browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://www.pictage.com",
:timeout_in_second => 60
from sklearn import linear_model
Y = np.array(Y) # array of training answers, 1 or 0
X = np.array([]) # array of image brightness
for filename in filenames:
# load the images
image = misc.imread(constants.IMAGE_64_PATH + '/' + filename, mode='L')
avg_brightness = np.matrix(image).mean()
X = np.append(X, avg_brightness)
import tflearn
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_1d, max_pool_1d
from tflearn.layers.estimator import regression
img_prep = ImagePreprocessing()
img_prep.add_featurewise_zero_center()
img_prep.add_featurewise_stdnorm()
import tflearn
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_1d, max_pool_1d
from tflearn.layers.estimator import regression
img_prep = ImagePreprocessing()
img_prep.add_featurewise_zero_center()
"a4s_employee_full_name"=>
"\x04\bo:\eRepresentableDataValue\b:\v@fieldo:!EmployeeFullNameBuiltInField\x00:\f@recordo:\rEmployee\x10:\x10@attributeso:\x1FActiveRecord::AttributeSet\x06;\no:$ActiveRecord::LazyAttributeHash\n:\v@types}\x10I\"\aid\x06:\x06ETo:?ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer\t:\x0F@precision0:\v@scale0:\v@limit0:\v@rangeo:\nRange\b:\texclT:\nbeginl-\a\x00\x00\x00\x80:\bendl+\a\x00\x00\x00\x80I\"\x0Fcreated_at\x06;\x0ETU:JActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter[\t:\v__v2__[\x00[\x00o:@ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime\b;\x100;\x110;\x120I\"\x0Fupdated_at\x06;\x0ETU;\x18[\t;\x19[\x00[\x00@\x15I\"\fuser_id\x06;\x0ET@\fI\"\x1Aineligible_for_rehire\x06;\x0ETo: ActiveRecord::Type::Boolean\b;\x100;\x110;\x120I\"\euntracked_prior_tenure\x06;\x0ET@\fI\"\ttags\x06;\x0ETo:=ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array\a:\r@subtypeo:\x1DActiveRecord::Type::Text\b;\x100;\x110;\x120:\x0F@delimiterI\"\x06,\x06;\x0ET
# Split the data into training and test sets
X_train, X_test, y_train, y_test = train_test_split(
data_words, data_plant_types, test_size=0.33, random_state=42)
# Build a neural network
network = input_data(shape=[None, len(data_words[0])])
network = fully_connected(network, 2048, activation='relu')
network = fully_connected(
network, len(data_plant_types[0]), activation='softmax')
@LastZactionHero
LastZactionHero / .bash_profile
Last active November 17, 2017 16:40
Bash Profile
# Git
# https://gist.github.com/n0n0x/7be453ff18f58020bafe
source ~/.git_bash_completion
# Go
export GOPATH=$HOME/development/go
export GOSRC=$GOPATH/src/github.com/LastZactionHero
export GOBIN=$GOPATH/bin
PATH=$PATH:$GOBIN
PATH=$PATH:/usr/local/go/bin