Skip to content

Instantly share code, notes, and snippets.

@axaluss
axaluss / install_openspades_v0.0.10.sh
Last active August 29, 2015 13:57
downloads all required files&packages and compiles/installs them. then downloads openspades and builds it. result game in openspades_install/openspades-0.0.10/bin/
rm -r openspades_install
mkdir openspades_install
cd openspades_install
sudo apt-get install pkg-config libfltk1.3-dev libglew-dev libcurl3-openssl-dev libjpeg-dev libxinerama-dev libxft-dev libalut-dev
wget http://www.libsdl.org/release/SDL2-2.0.1.tar.gz
tar xvf SDL2-2.0.1.tar.gz
cd SDL2-2.0.1/
./configure && make && sudo make install
cd ..
wget https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.tar.gz
#/bin/bash
mkdir openspades_install
cd openspades_install
sudo apt-get install pkg-config libfltk1.3-dev libglew-dev libcurl3-openssl-dev libjpeg-dev libxinerama-dev libxft-dev
wget http://www.libsdl.org/release/SDL2-2.0.1.tar.gz
tar xvf SDL2-2.0.1.tar.gz
cd SDL2-2.0.1/
./configure && make && sudo make install
cd ..
wget https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.tar.gz
nyxos@IdeaPad-Y500 ~/test $ bash install_openspades
[sudo] password for nyxos:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libcurl4-openssl-dev' instead of 'libcurl3-openssl-dev'
libglew-dev is already the newest version.
libjpeg-dev is already the newest version.
libxft-dev is already the newest version.
pkg-config is already the newest version.
@axaluss
axaluss / language_detection_heuristic.rb
Last active August 29, 2015 13:56
Language detection of texts using the 100 most common words of each language in an exampe using English, German and Spanish and one example text for each language.
#/usr/bin/ruby
class DetectLanguage
def calc_wc txt, lang
wc=0
txt.split(/\W+/).select{|ww|lang.include?(ww)}.map{|ww|
wc+=[(lang.size-lang.index(ww))/lang.size.to_f, 0.5].max
}
wc
end
def detect