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
| ## run the following commands in BASH | |
| start-master.sh | |
| # go to http://localhost:8080 and check if the Spark's master service is started | |
| start-slave.sh spark://$(hostname):7077 | |
| # if the worker's service is started successfully you should be able to see the worker in http://localhost:8080, at the connected worker's section |
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
| ## run the following commands in BASH | |
| cd # let's get back to your user's home directory | |
| wget -c https://www-us.apache.org/dist/spark/spark-2.4.5/spark-2.4.5-bin-hadoop2.7.tgz # this will download spark | |
| tar xvfz spark-2.4.5-bin-hadoop2.7.tgz # this will extract the downloaded file to current directory | |
| mv spark-2.4.5-bin-hadoop2.7 spark # renaming the extarcted folder to "spark" | |
| # appending the JAVA_HOME and SPARK_HOME environement variables to end of your BASH startup script | |
| # we are assuming that our JRE 8 is installed in "/usr/lib/jvm/java-1.8.0-openjdk-amd64" | |
| cat >> .bashrc <<'EOF' |
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
| ## run the following commands in BASH | |
| sudo apt-get update -y && sudo apt-get upgrade -y | |
| # you may need to enter your password when you use "sudo" before another command | |
| # if you are asked a Yes, and No question during the execution of the previous command choose "Yes" | |
| sudo apt-get install -y htop nload netcat emacs nano openjdk-8-jdk-headless python-pip python3-pip wget \ | |
| curl python-mode scala-mode-el | |
| # be patient it can take a while for all the packages to be downloaded and be installed | |
| sudo pip install pyspark | |
| sudo pip3 install pyspark | |
| # again it may take a while for PySpark packages be downloaded for both Python 2 [which is defunct] and Python 3 |
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
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # To bootstrap the environment: | |
| # mkvirtualenv whoosh | |
| # pip install whoosh | |
| import os | |
| from whoosh.index import create_in, open_dir |
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
| #ifndef __GZIP_H__ | |
| #define __GZIP_H__ | |
| #include <sstream> | |
| #include <boost/iostreams/filtering_streambuf.hpp> | |
| #include <boost/iostreams/copy.hpp> | |
| #include <boost/iostreams/filter/gzip.hpp> | |
| class Gzip { | |
| public: |
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
| # LVDB - LLOOGG Memory DB | |
| # Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]> | |
| # All Rights Reserved | |
| # TODO | |
| # - cron with cleanup of timedout clients, automatic dump | |
| # - the dump should use array startsearch to write it line by line | |
| # and may just use gets to read element by element and load the whole state. | |
| # - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
| # - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |
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 keras.backend as K | |
| import multiprocessing | |
| import tensorflow as tf | |
| from gensim.models.word2vec import Word2Vec | |
| from keras.callbacks import EarlyStopping | |
| from keras.models import Sequential | |
| from keras.layers.core import Dense, Dropout, Flatten | |
| from keras.layers.convolutional import Conv1D |
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
| graph = { | |
| 1: {2:1,5:1}, | |
| 2: {1:1,3:1,5:1}, | |
| 3: {2:1,4:1}, | |
| 4: {3:1,5:1,6:1}, | |
| 5: {1:1,2:1,4:1}, | |
| 6: {4:1} | |
| } | |
| time = 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
| # Written by Brendan O'Connor, [email protected], www.anyall.org | |
| # * Originally written Aug. 2005 | |
| # * Posted to gist.github.com/16173 on Oct. 2008 | |
| # Copyright (c) 2003-2006 Open Source Applications Foundation | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |
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
| # Author: | |
| # Wim Looman | |
| # Copyright: | |
| # Copyright (c) 2010 Wim Looman | |
| # License: | |
| # GNU General Public License (see http://www.gnu.org/licenses/gpl-3.0.txt) | |
| ## User interface, just set the main filename and it will do everything for you | |
| # If you have any extra code or images included list them in EXTRA_FILES | |
| # This should work as long as you have all the .tex, .sty and .bib files in |