##Installing pelican Remeber to use a virtual env ;).
pip install pelican
pip install Markdown
pip install Fabric
pip install beautifulsoup4
##Installing pelican Remeber to use a virtual env ;).
pip install pelican
pip install Markdown
pip install Fabric
pip install beautifulsoup4
| #! /bin/bash | |
| # Depends on package sendemail (apt-get install sendemail). | |
| # Add this script to /home/$USER/.local/share/nautilus/scripts/ | |
| # Remember giving the script permission to be run as an executable. | |
| sendemail -f EMAIL@gmail.com -t KINDLE_USERNAME@kindle.com -u "Convert" -m "Sent automatically by sendemail." -s smtp.gmail.com:587 -xu EMAIL@gmail.com -xp EMAILPASSWORD -a "$1" |
| def text_to_number(text_array): | |
| """ | |
| @param text_array: Numpy array of strings. | |
| @return: Numpy array of integers. Each different input string will be | |
| assigned a different incremental number. | |
| """ | |
| vectorizer = CountVectorizer() | |
| X = vectorizer.fit_transform(text_array).toarray() | |
| return X.argmax(1) |
| def isGoodEnough(guess: Double, x: Double) = { | |
| math.abs(guess * guess - x) / x < 0.0001 | |
| } | |
| def improve(guess: Double, x: Double): Double = { | |
| (guess + x / guess) / 2 | |
| } | |
| def sqrtIter(guess: Double, x: Double): Double = { | |
| if (isGoodEnough(guess, x)) guess | |
| else sqrtIter(improve(guess, x), x) |
| public static float scaleInterval( | |
| float value, | |
| float minActualInterval, float maxActualInterval, | |
| float minDesiredInterval, float maxDesiredInterval) { | |
| return ((value - minActualInterval) / (maxActualInterval - minActualInterval)) | |
| * (maxDesiredInterval - minDesiredInterval) + minDesiredInterval; | |
| } |
| public static boolean isNumber(String string) { | |
| return string.matches("-?\\d+(\\.\\d+)?"); | |
| } |
| public static String[] splitString(String objective, String symbols) { | |
| return objective.split(Pattern.quote(symbols)); | |
| } |
| // http://stackoverflow.com/questions/14584018/how-can-i-get-inside-parentheses-value-in-a-string | |
| String example = "United Arab Emirates Dirham (AED)"; | |
| Matcher m = Pattern.compile("\\(([^)]+)\\)").matcher(example); | |
| while(m.find()) { | |
| System.out.println(m.group(1)); | |
| } |
| /** | |
| * Extends AndroidApplication incorporating a view for the Gitfiz sdk, which is just a bottom left button. | |
| */ | |
| public class AdmobApplication | |
| extends AndroidApplication | |
| // Giftiz interfaces. | |
| implements ButtonNeedsUpdateDelegate { | |
| private ImageView giftizButtonView; |