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
| # install java 8 | |
| sudo add-apt-repository -y ppa:webupd8team/java | |
| sudo apt-get update | |
| sudo apt-get -y install oracle-java8-installer | |
| java -version | |
| # install elasticsearch | |
| wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.5/elasticsearch-2.3.5.deb | |
| sudo dpkg -i elasticsearch-2.3.5.deb | |
| sudo update-rc.d elasticsearch defaults |
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
| train_set = [ # A AND NOT B | |
| [0,0,0], | |
| [0,1,0], | |
| [1,0,1], | |
| [1,1,0], | |
| ] | |
| n=30 | |
| layers = [2, 2, 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
| apt-get install openjdk-7-* | |
| addgroup hadoop | |
| adduser --ingroup hadoop hduser | |
| sudo -u hduser bash | |
| ssh-keygen -t rsa -P "" | |
| cat /home/hduser/.ssh/id_rsa.pub >> /home/hduser/.ssh/authorized_keys |
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
| -(void)zoomToFitMapAnnotations:(MKMapView*)mapView | |
| { | |
| if([mapView.annotations count] == 0) | |
| return; | |
| CLLocationCoordinate2D topLeftCoord; | |
| topLeftCoord.latitude = -90; | |
| topLeftCoord.longitude = 180; | |
| CLLocationCoordinate2D bottomRightCoord; |
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
| # Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros | |
| # | |
| # Optimized version which uses to_yaml for content creation and checks | |
| # that models are ActiveRecord::Base models before trying to fetch | |
| # them from database. | |
| namespace :db do | |
| namespace :fixtures do | |
| desc 'Dumps all models into fixtures.' | |
| task :dump => :environment do |
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
| require 'omniauth/openid' | |
| require 'openid/store/filesystem' | |
| module OmniAuth | |
| class Form | |
| def shard_field(name) | |
| @html << "\n<select id='#{name}' name='#{name}'>" | |
| @html << "\n<option value='amunet' selected='selected'>Tale 5: Amunet</option>" | |
| @html << "\n<option value='bastet'>Tale 5: Bastet</option>" | |
| @html << "\n<option value='c'>Tale 6</option>" |