This is the home page of your app.
You can customize it by editing the template file at:
<%= appname %>/django/<%= appname %>/templates/home.html
You should also look in the JavaScript console...
{% extends "splunkdj:base_with_app_bar.html" %} {% load splunkmvc %} {% block title %}Home Page{% endblock title %} {% block css %} {% endblock css %} {% block content %}
This is the home page of your app.
You can customize it by editing the template file at:
<%= appname %>/django/<%= appname %>/templates/home.html
You should also look in the JavaScript console...


Ocean [bb08], ocean, in Crystal Sea
Last updated Turn #138
Ocean [bb08], ocean, in Crystal Sea
------------------------------------------------------------------------
12: The Savvy Aardvark [ha5r], ship, 2 hulls, 1 rowing port, 6 sails,
12: 22% damaged, arrived from Ocean [bb09], owner:
12: Phantasm [n4b], Imperial Empire, duke, with two workers,
12: eight sailors
13: The Savvy Aardvark [ha5r], ship, 2 hulls, 1 rowing port, 6 sails,
13: 22% damaged, departed for Ocean [bb07].
Routes leaving Ocean:
North, to Ocean [ba08], 6 days
East, to Ocean [bb09], 6 days
South, to Ocean [bc08], 6 days
West, to Ocean [bb07], 6 days


Creating Resumes made easier
Creating professional resumes are made easier and faster.By using our wide range of predefined resume templates
Reinventing the old resume
Use your old resume to create a new resume instead of filling it each time
Promote Your resume
Promote your resume by sharing it on famous job portals from our site


Full Media & Publications List
All print, radio and television work
A 12 minute read
Radio & TV
Presenting / Producing
- World Class Brass - the Cultural Heritage of The British Empire, a 3 part series by Nightjar for BBC Radio 2, 2012
- Digging For Trouble - the Politics of Archaeology in Jerusalem, DigressMedia/Journeyman Pictures, Al Jazeera, 2007
- Forbidden Games - Video Games as Propaganda in the Middle East, DigressMedia/Journeyman Pictures, YLE Finland, 2007
- “La Palestine – Douze Points?”, Palestine and the Eurovision Song Contest, DigressMedia/Journeyman Pictures, SVT2 Sweden 2007
- Trustbuilding and Coexistence in Jerusalem, CBC Radio Canada, 2007
- Цензура музыки в Беларусе, Гражданин мира, BBC Russian, 2007
- Podcast: Guide to Balkan Brass, Songlines Magazine, 2007
- The Musician and the Secret Policeman - Censorship and Reconciliation in Apartheid South Africa, Outlook, BBC World Service, 2006
- The IPO at 60, Front Row, Radio 4, 2006
- Ukraine - Backwards to the Future, 22 mins, Masterpiece, BBC World Service, 2006
- Music, Technology And The Orange Revolution - Ukraine, 22 mins, Masterpiece, BBC World Service, 2005
- ‘The Culture of Chernobyl, 20 years on’, CBC Radio Canada, 2006
- Роль культури в Оранжевой Революции), Гражданин мира, BBC Russian, 2005
- Various packages, NewsHour, BBC World Service 2006-7
- Various packages, BBC Russian Service, 2005-8
Contributing
- Guest contributor (on hybrid immigrant musical culture in 1950s London), Great British Faith, with Hardeep Kohli Singh, BBC Radio 2, 2010
- Guest contributor (on the annual Hasidic New Year pilgrimage to Uman, Ukraine), World Update with Dan Damon , BBC World Service, 2010
- Guest contributor (on the how to play Balkan Gypsy style trumpet), Serbian Trumpets, Just Radio, BBC Radio 4, 2010
- Guest contributor (on repression of music and freedom of speech in Belarus), The Beat, BBC World Service, 2007
- Guest contributor (on Yiddish klezmer music), Dressing The Mix, World Music Day, BBC Radio 3, 2005
- Researcher (on censorship of artists in Uzbekistan), An Independent Mind, Channel 4, dir. Rex Bloomstein, 2008
- Researcher (on extraordinary vocal artists around the world), The Voice, part 2, Masterpiece, prod. Nick Rankin, 22 mins, BBC World Service 2005
- Interview (on the satirical art project, The Election Song Contest), The World Tonight, BBC Radio 4, 2012
- Dozens of interviews to international media on the subject of culture and politics
Print
Publications
- Ukraine, The Rough Guide to World Music (Vol 2, 3rd Edition): Europe and Asia (Rough Guide Music Reference, 2009)
- “Hidden Truths: Music Politics and Censorship in Lukashenko’s Belarus”, Freemuse, 2007
- “The Protection and Promotion of Musical Diversity”, UNESCO / International Music Council, ed Richard Letts, 2006 (main source, Belarus section)
- Gucaholic, fRoots, 2003 (cited in Romani Routes: Cultural Politics and Balkan Music in Diaspora, Carol Silverman, Oxford University Press, 2012)
- Encyclopedia of World Pop
- Forthcoming article on automatic English language exercise creation using corpus linguistics, CALICO journal, April 2016 (co-author alongside principal authors Valentin Werner and Maria Lehl)
Arts, technology and politics articles
- World Music and Soft Power: Who’s Playing Whom?, WOMEX Guide, 2012
- “Beginner’s Guide to The Klezmatics”, October 2012, Songlines
- Not Just Aid You Can Dance To - A Call For a New World Music, WOMEX Guide, 2011
- Altogether Now: Rethinking Strategies for New Artists, WOMEX Guide, 2010
- “Beginner’s Guide to Goran Bregovic”, November 2009, Songlines
- Profile of Palestinian Israeli singer Mira Awad , Jewish Chronicle, 2008
- Wet Sounds - a Sound Art Festival , Jewish Chronicle, 2008
- Hear O Israel - Herbie Hancock’s lost recording, Jewish Quarterly, 2008
- All Kidding Aside - Israeli-Palestinian Artistic Collaboration in Jerusalem, Jerusalem Post, 2007
- Jerusalem, a Musical Postcard, Songlines Magazine, 2007
- Profile of Chernobyl activist Dina Mazur , Hero Of The Month, Marie Claire UK, 2006
- Regular Europe album reviewer, Songlines magazine, 2005-2010
- Gyí!, BeshoDrom , album sleeve notes, 2005
- Ticking Again, Kharkov Klezmer Band , album sleeve notes, Music&Words 2002
- Short pieces for Wired UK, The Voice, fRoots
Editorial
- Jewish Chronicle, acting Arts Editor, Jan-July 2008
- OpenAir Radio FM, Oxford University, Founding Co-Director, 2002-3
- Oxygen FM, Oxford University, Head of World News, 1996-98
Conferences
- Curator: Music Industry Conference chair, with Nadia El Imam, WOMEX, Thessaloniki, 2012
- Keynote Speech & Award Presentation (to Pussy Riot representative Sasha Cheparukhin): WOMEX 12 Professional Excellence Award, WOMEX, Thessaloniki, 2012
- Chair:Copyright - a Global Perspective, WOMEX, Thessaloniki, 2012
- Presentation: World Music and Language Education, WOMEX, Thessaloniki, 2012
- Panellist: Music Education Networking, WOMEX, Thessaloniki, 2012
- Panellist: Appily Ever After - Apps and World Music, WOMEX, Thessaloniki, 2012
- Chair: Who’s Playing Whom? World Music as Cultural Diplomacy, WOMEX, Copenhagen, 2011
- Chair: ,Neighbourhood Watch: The view from across the tracks, WOMEX, Copenhagen, 2010
- Chair: The Economy of Music: New Methods for Breaking Artists, WOMEX, Copenhagen, 2009
- Report presentation: “Hidden Truths: Music, Politics and Censorship in Lukashenko’s Belarus”, 3rd World Conference on Music and Censorship, Freemuse, Bilgi University, Istanbul, 2006
- Report presentation: Censorship in Belarus, Freemuse/Swedish Helsinki Committee, Gothenburg Book Fair, Gothenburg, 2006
- Panellist: Cultural Boycotts, WOMEX, Seville, 2004
- Panellist: Anglosemitic Bastards, WOMEX, Rotterdam, 2001
Teaching
- Workshop Assistant (for Nigel Osborne): Music therapy for special needs education and palliative care, Sri Aurobindo Society, Pondicherry, India, 2015
- Visiting Artist: Experimental voice & music theory, Adishakti Laboratory for Theatre Arts, Tamil Nadu, India, 2015
- Visiting Lecturer: Arts and Coexistence, Israeli-Palestinian Olive Tree Educational Trust, City University, London, 2005
- Workshop leader: Defending and Promoting Human Rights in the South Caucasus, Article 19, Taras Shevchenko University, Kiev, 2005
- Workshop leader: Roma and klezmer brass music: JMI Klezfest, School of African and Oriental Studies, University of London, 2004


+++ title = "Loki Hostel, Lima" slug = "loki-hostel-lima" date = 2007-07-21T11:00:00+10:00 tags = ["accommodation"] locations = ["peru/lima"] draft = false summary = """
I've done Cusco. I've done La Paz. Now, I've got the complete set of three: I've done Loki Lima! As with its two brethren, Loki Lima is the place to be: smack bang in the middle of Miraflores (across the road from the massive McDonald's), with a kicking Irish bar on the premises, and with super-friendly guests and staff. Very different to Flying Dog, which is nice, but a lot more tranquil. When you come to Loki, you come to enjoy, not to sleep.
""" +++I've done Cusco. I've done La Paz. Now, I've got the complete set of three: I've done Loki Lima! As with its two brethren, Loki Lima is the place to be: smack bang in the middle of Miraflores (across the road from the massive McDonald's), with a kicking Irish bar on the premises, and with super-friendly guests and staff. Very different to Flying Dog, which is nice, but a lot more tranquil. When you come to Loki, you come to enjoy, not to sleep.
Rooms: very nice, all re-furbished, and quite modern and warm.
People: always friendly, always in abundance, but seldom sober. That's Loki for you.
Staff: helpful, 100% English-speaking, and also seldom sober.
Location: middle of Miraflores — across from the big roundabout, and from Parque Kennedy — near everywhere you could possibly eat, shop, and be merry. Quite far from central Lima, though.
Food: usual Loki deal, of free breakfast of bread / jam / tea / coffee; plus anything else at any time of the day, at an extra charge.
Internet: 2 free PCs, both fast and reliable.
Hot water: Sure is.


Monaco Editor Webpack Plugin Sample
To run this sample, you need to:
$/browser-esm-webpack> npm install . $/browser-esm-webpack> ./node_modules/.bin/webpack
Then,
open the ./dist folder
.


Please enter the password to proceed.
If you're having any trouble accessing Remote Year Staging, please contact your manager.


10% – 25% OFF Select Major Appliances $396 or More
10% – 25% OFF Select Major Appliances $396 or More: $396 or more calculated before taxes, installation, delivery, haul away and extended protection plan fees, if any. Not valid on: clearance items; Dacor, ICON, Fisher & Paykel, Monogram, Smeg or Liebherr brand appliances (brand availability varies by market and store); water heaters; room air conditioners; range hoods; previous sales; or services. While supplies last. Price in cart reflects discount. Offer valid 4/20/16 – 5/3/16.
Free Local Delivery: Free local delivery available for any major appliance $396 or more (calculated before taxes, installation, delivery, discounts and extended protection fees, if any). No deliveries on Thanksgiving or Christmas. Additional fees may apply. US only. See store for details.
Next-Day Delivery for In-Store Purchases or Purchases Made Through Our Customer Care Call Centers: Next-day delivery may be available on any in-stock major appliance for in-store or Customer Care Call Center purchases only. Customer must purchase in-stock major appliance and request next-day delivery in store or with a Customer Care representative (1-877-505-4926) before 4:00 p.m. local time and be within 30 miles of store location for next-day delivery. Next-day service is subject to delivery availability and not available for Lowes.com orders. No deliveries on Thanksgiving or Christmas. Additional fees may apply. US only. See store for details.
**Next-day messaging is provided for information purposes only.
Need help with appliances? Call 1-877-391-5627 to speak with an appliance specialist.
30-day major appliance satisfaction guarantee based on Lowe’s refund and price match policies. For questions, please see your local store or call 1-800-445-6937.


--- title: Machine Learning Basics with Caret author: Stefania date: '2018-06-10' slug: machine-learning-basics-with-caret categories: [] tags: - machine learning - classification - regression - tutorial - caret - R header: caption: '' image: '' output: blogdown::html_page: toc: yes toc_depth: 1 number_sections: true fig_width: 6 ---
We encounter applications for machine learning each day. Machine learning algorithms are used to make critical decisions in medical diagnosis. Media sites rely on machine learning to sift through millions of options to give you song or movie recommendations and retailers use it to gain insight into their customers’ purchasing behavior.
At the core of machine learning is building models which offer predictive power and can be used to understand data we have yet to collect. In scientific practice, we have used machine learning before when we have run regression models! However, machine learning is a complex topic with a wide range of possiblities and applications. This tutorial aims to present a basic understanding of both regression and classification modeling, as well as how to leverage the package caret
to carryout these analyses.
There are two main types of machine learning algorithms: supervised and unsupervised
Supervised learning models are those where the machine learning model we build is based off of a known quantity. In this case, we already know the “correct answers” and we train the algorithm to find patterns in our data in order to reach the best performance in predicting a known quanity. We can then apply these models to never-before-seen data to make predictions. Examples include:
Classification Models: Making categorical predictions such as predicting whether a tumor is benign or malignant or whether an email is spam or not.
Regression Models: Making continuous predictions such as predicting changes in temperature or predicting someone’s weight.
Unsupervised learning models are those where the machine learning model derives patterns and information from data while determining the known quantity itself. In this case, there are no known “correct answers” but rather the goal is to find the underlying structure or distribution in the data in order to learn more about the data. Examples include:
Clustering Models: Finding hidden patterns of inherent groupings in data such as grouping customers by purchasing behavior.
Association Models: Findings rules that describe large portions of your data, such as “people that buy X also tend to buy Y”.
Machine learning requires that you must build your model using a separate dataset than the one used to test the accuracy of your model. Since datasets can be hard to come by, data splitting is used to split a single dataset into a training set and a testing set. Methods for splitting data up into training and testing sets are known as sampling techniques. Sampling techniques can vary from choosing cases in the original dataset randomly to using random sampling techniques to decide which cases should go in the training set and which should go in the testing set.
You typically want more data in the training set since this data is being used to build your model than in the testing set. Some proportions that are used typically are 70% training, 30% testing, but you can adjust these.
In machine learning, there are two types of parameters: model parameters and hyperparameters. What’s the difference?
Model parameters are estimated from the data (i.e., coefficients in linear regression)
Hyperparameters are values that specify the settings of a ML algorithm that can be “tuned” by the researhcer prior to training a model. Different algorithms have different hyperparameters. You don’t know the best values of hyperparameters prior to training a model - have to rely on rules of thumb and/or try to find the best values through trial and error. This is the tuning process.
Earlier we talked about splitting our our dataset into training and testing sets in order to build a model that generalizess well to new incoming data. However, this process of training and testing is less than ideal. When we eventually test our data against the remaining data in our test set we are only seeing what the error is for that exact grouping of the test data. Using a single testing set to evaluate the accuracy of one’s models can have limitations in practice because the testing set may not be representative of the dataset as a whole.
Cross-validation is a statistical technique for splitting the training set multiple times into training/testing sets. Each of these training/testing sets is evaluated for error, and the error across all of the sets is averaged. This provides a more accurate assessment of the model’s performance.
There are various cross-validation techniques available in R, but the ones we will cover are k-fold and leave-one-one cross-validation:
k-fold cross-validation: randomly splits the dataset into k chunks (aka, folds) of roughly equal size, and these chunks are split into training/testing sets. The error across all chunks is averaged. k can be any number between 2 and the number of observations in the full dataset, but it is most commonly a value between 3 and 10.
leave-one-out cross-validation: the case where k=n; this results in the training sets containing n-1 observations each, and each test set containing a single observation
A very important consideration in the building of predictive models is overfitting. The data in the training set is going to reflect true, underlying relationships among variables, but there will also be an amount of error that is unique to the training set. Overfitting is the problem of fitting a model too well to the training set. This could result in the model having poor predictive power when applied to a new dataset. During model training, you want to meet a balance between fitting a model with good accuracy (i.e., one that reduces error), without trying to account for so much error in the training model that you overfit the model.
And there are hundreds more… for a full list: names(getModelInfo())
Regression is used to perform machine learning with a continuous outcome variable. The dataset we will use for this example is called Prestige from the car
package.
Prestige$income <- as.numeric(Prestige$income)
Prestige$census <- as.numeric(Prestige$census)
Prestige$type <- as.numeric(Prestige$type)
Prestige <- subset(Prestige, select = c(education, income, women, prestige, census))
Before you perform model training, you should partition the original dataset into a training set and a testing set. Model training is performed only on the training set.
createDataPartition
is used to split the original data into a training set and a testing set. The inputs into createDataPartition include y, times, p, and list:
# Randomly sample from the original dataset
set.seed(50) # set.seed is a random number generator; the value in parentheses is arbitrary, and a seed is only set so that we can reproduce these same results next time we run the analysis.
# Split the original dataset into a training set and a testing set
partition_data <- createDataPartition(Prestige$income, times = 1, p = .7, list = FALSE)
training.set <- Prestige[partition_data, ] # Training set
testing.set <- Prestige[-partition_data, ] # Testing set
Now that we have split the data into a training set and testing set, we can now move on to training a model using the training set. We will go through just a few of the different algorithms and cross-validation techniques you can use for model training.
caret
(Classification And REgression Training) is an R package that consolidates all of the many various machine learning algorithms into one, easy-to-use interface. This allows us to test any model we want without having to load separate packages and learn a gazillion different syntax requirements each time we want to test a different type of model.
The train
function is used for model training. It uses the following inputs:
# Specify the cross-validation method(s)
train.control <- trainControl(method = "cv", number = 10) # k-folds CV with k=10
train.control2 <- trainControl(method = "LOOCV") # leave-one-out CV
# Use the train function to perform model training
linear.model <- train(income ~. ,
data = training.set,
method = "lm",
trControl = train.control,
preProc = c("center"))
## change train.control to train.control2 to see the results using LOOCV instead
# Look at the results from model training
linear.model
## Linear Regression
##
## 74 samples
## 4 predictor
##
## Pre-processing: centered (4)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 67, 66, 66, 67, 67, 66, ...
## Resampling results:
##
## RMSE Rsquared MAE
## 2385.264 0.7565312 1644.348
##
## Tuning parameter 'intercept' was held constant at a value of TRUE
linear.model$results
## intercept RMSE Rsquared MAE RMSESD RsquaredSD MAESD
## 1 TRUE 2385.264 0.7565312 1644.348 1410.487 0.1716874 725.1658
# Test the predictive ability of the model in the testing set
linear.predict <- predict(linear.model, testing.set) # Predict values in the testing set
postResample(linear.predict, testing.set$income) # the accuracy of the model
## RMSE Rsquared MAE
## 2603.8964002 0.6503883 1856.9520734
# Specify the cross-validation method(s)
train.control <- trainControl(method = "cv", number = 10) # k-folds CV with k=10
train.control2 <- trainControl(method = "LOOCV") # leave-one-out CV
# The linear model did not have any hyperparameters that we could perform tuning on, but SVM does
# Model tuning
svmL.info <- getModelInfo("svmLinear") #getModelInfo can be used to inspect a specific ML algorithm
svmL.info$svmLinear$parameters #look at the algorithm parameters that can be modifed
## parameter class label
## 1 C numeric Cost
tune.grid <- expand.grid(C = c(0.001, 0.01, 0.1, 1, 10, 100)) #expand.grid is the function that allows you to specify values that you want to feed into the model training function
# Model training
svmL.model <- train(income ~. , data = training.set, method = "svmLinear", trControl = train.control, tuneGrid = tune.grid, preProc = c("center"))
svmL.model
## Support Vector Machines with Linear Kernel
##
## 74 samples
## 4 predictor
##
## Pre-processing: centered (4)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 66, 67, 67, 66, 66, 67, ...
## Resampling results across tuning parameters:
##
## C RMSE Rsquared MAE
## 1e-03 3905.451 0.7661535 2690.535
## 1e-02 2585.026 0.8256985 1664.158
## 1e-01 2230.840 0.8290528 1422.342
## 1e+00 2249.864 0.8231544 1458.861
## 1e+01 2253.776 0.8218066 1465.532
## 1e+02 2253.326 0.8213564 1466.097
##
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was C = 0.1.
svmL.model$results
## C RMSE Rsquared MAE RMSESD RsquaredSD MAESD
## 1 1e-03 3905.451 0.7661535 2690.535 1907.103 0.1537170 731.7471
## 2 1e-02 2585.026 0.8256985 1664.158 1885.387 0.1501561 910.9554
## 3 1e-01 2230.840 0.8290528 1422.342 1786.866 0.1529150 868.7034
## 4 1e+00 2249.864 0.8231544 1458.861 1750.106 0.1534310 829.3265
## 5 1e+01 2253.776 0.8218066 1465.532 1743.592 0.1541192 824.6025
## 6 1e+02 2253.326 0.8213564 1466.097 1742.954 0.1539033 823.7594
# Testing predictive ability of model in testing set
svmL.predict <- predict(svmL.model, testing.set)
postResample(svmL.predict, testing.set$income)
## RMSE Rsquared MAE
## 2073.5726601 0.6624213 1260.9135906
# Specify the cross-validation method(s)
train.control <- trainControl(method = "cv", number = 10) # k-folds CV with k=10
train.control2 <- trainControl(method = "LOOCV") # leave-one-out CV
# Model tuning
rf.info <- getModelInfo("rf")
rf.info$rf$parameters
## parameter class label
## 1 mtry numeric #Randomly Selected Predictors
tune.grid <- expand.grid(mtry = c(2, 3, 4))
# Model training
rf.model <- train(income ~. , data = training.set, method = "rf", trControl = train.control, preProc = c("center"))
rf.model
## Random Forest
##
## 74 samples
## 4 predictor
##
## Pre-processing: centered (4)
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 66, 68, 66, 67, 67, 66, ...
## Resampling results across tuning parameters:
##
## mtry RMSE Rsquared MAE
## 2 2673.107 0.7529511 1766.909
## 3 2645.555 0.7738396 1711.195
## 4 2607.609 0.7743115 1674.975
##
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was mtry = 4.
rf.model$results
## mtry RMSE Rsquared MAE RMSESD RsquaredSD MAESD
## 1 2 2673.107 0.7529511 1766.909 1348.069 0.1326363 659.8424
## 2 3 2645.555 0.7738396 1711.195 1355.607 0.1074976 691.7238
## 3 4 2607.609 0.7743115 1674.975 1338.852 0.1044531 671.3989
# Testing predictive ability of model in testing set
rf.predict <- predict(rf.model, testing.set)
postResample(rf.predict, testing.set$income)
## RMSE Rsquared MAE
## 2211.812379 0.653975 1252.496006
RMSE_Training <- c(linear.model$results$RMSE, svmL.model$results$RMSE[1]
, rf.model$results$RMSE[1])
RSq_Training <- c(linear.model$results$Rsquared, svmL.model$results$Rsquared[1]
, rf.model$results$Rsquared[1])
RMSE_Testing <- c(postResample(linear.predict, testing.set$income)[1], postResample(svmL.predict, testing.set$income)[1], postResample(rf.predict, testing.set$income)[1])
RSq_Testing <- c(postResample(linear.predict, testing.set$income)[2], postResample(svmL.predict, testing.set$income)[2], postResample(rf.predict, testing.set$income)[2])
Algorithm <- c("Linear Regression", "Support Vector Machine", "Random Forest")
data.frame(cbind(Algorithm, RMSE_Training, RSq_Training, RMSE_Testing, RSq_Testing))
## Warning in data.row.names(row.names, rowsi, i): some row.names duplicated:
## 2,3 --> row.names NOT used
## Algorithm RMSE_Training RSq_Training
## 1 Linear Regression 2385.26433640092 0.756531232836151
## 2 Support Vector Machine 3905.45105096938 0.766153542209208
## 3 Random Forest 2673.10698469695 0.752951050841249
## RMSE_Testing RSq_Testing
## 1 2603.89640015345 0.650388341048599
## 2 2073.57266011341 0.662421333066346
## 3 2211.81237907144 0.653975005519097
Classification is used to perform machine learning with a categorical outcome variable. The dataset we will use for this example is called Iris from base R. This dataset contains various features for three species of flowers (petal width, petal length, sepal width, sepal length).
As with our regression example above, we will try to clasify ‘Species’ of flower using an elastic net, a support vector machine, and a random forest model. We will use leave-one-out cross-validation in the training data and the final model accuracies will be tested against our holdout sample.
First we will load our dataset:
# Load the data, and examine it's structure
iris_data <- data.frame(iris)
head(iris_data)
## Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1 5.1 3.5 1.4 0.2 setosa
## 2 4.9 3.0 1.4 0.2 setosa
## 3 4.7 3.2 1.3 0.2 setosa
## 4 4.6 3.1 1.5 0.2 setosa
## 5 5.0 3.6 1.4 0.2 setosa
## 6 5.4 3.9 1.7 0.4 setosa
str(iris_data) # Everything is numeric except for our categorical variable, which is a factor. We are good to go.
## 'data.frame': 150 obs. of 5 variables:
## $ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
## $ Sepal.Width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
## $ Petal.Length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
## $ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
## $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
Now we will set the random number generator seed for reproducibility and partition our data into training and testing sets.
# Randomly sample from the original dataset
set.seed(28) # set.seed is a random number generator; the value in parentheses is arbitrary, and a seed is only set so that we can reproduce these same results next time we run the analysis.
# Split the original dataset into a training set and a testing set
# We are using species to partition so that we don't end up with an uneven amount of one species in either training or testing sets.
partition_data <- createDataPartition(iris_data$Species, times = 1, p = .7, list = FALSE)
# Assign sets
training.set <- iris_data[partition_data, ] # Training set
testing.set <- iris_data[-partition_data, ] # Testing set
# Sanity Check: Is data partitioned appropriately, do we have equal numbers of observations for our outcome variable?
nrow(training.set)
## [1] 105
summary(training.set$Species)
## setosa versicolor virginica
## 35 35 35
nrow(testing.set)
## [1] 45
summary(testing.set$Species)
## setosa versicolor virginica
## 15 15 15
Next, we will try out our three models.
Since the outcome variable we are predicting “Species” has more than two factors, we cannot use glm
to run a logistic regression.
Instead, we will use glmnet
to run an elastic net algorithm that can handle more factors in our outcome variable.
# Specify the cross-validation method(s)
train.control <- trainControl(method = "cv", number = 10, # k-folds CV with k=10
classProbs = TRUE,
savePredictions = TRUE,
summaryFunction = multiClassSummary)# save predictions for ROC
train.control2 <- trainControl(method = "LOOCV",
classProbs = TRUE,
savePredictions = TRUE,
summaryFunction = multiClassSummary) # leave-one-out CV, and save predictions for ROC
# Example Model Tuning for Elastic Net
#glmnet.info <- getModelInfo("glmnet")
#glmnet.info$glmnet$parameters
#tune.grid <- expand.grid(alpha = 0:1,
# lambda = seq(0.0001, 1, length = 100))
# Use the train function to perform model training
glmnet.model <- train(Species ~. ,
data = training.set,
method = "glmnet",
trControl = train.control2, # change this to train.control to try k-fold CV
#tuneGrid = tune.grid,
preProc = c("center"))
# Look at the results from model training and ROC Curves
glmnet.model
## glmnet
##
## 105 samples
## 4 predictor
## 3 classes: 'setosa', 'versicolor', 'virginica'
##
## Pre-processing: centered (4)
## Resampling: Leave-One-Out Cross-Validation
## Summary of sample sizes: 104, 104, 104, 104, 104, 104, ...
## Resampling results across tuning parameters:
##
## alpha lambda logLoss AUC prAUC Accuracy
## 0.10 0.000875267 0.08456169 0.9975510 0.9668227 0.9619048
## 0.10 0.008752670 0.16367642 0.9965986 0.9649725 0.9523810
## 0.10 0.087526699 0.38437169 0.9753741 0.9252943 0.9142857
## 0.55 0.000875267 0.07704621 0.9976871 0.9670182 0.9619048
## 0.55 0.008752670 0.14907364 0.9964626 0.9646381 0.9523810
## 0.55 0.087526699 0.41343962 0.9791837 0.9312623 0.9142857
## 1.00 0.000875267 0.07351674 0.9974150 0.9664971 0.9714286
## 1.00 0.008752670 0.12642274 0.9961905 0.9641325 0.9523810
## 1.00 0.087526699 0.42860156 0.9805442 0.9202896 0.9333333
## Kappa Mean_F1 Mean_Sensitivity Mean_Specificity
## 0.9428571 0.9618736 0.9619048 0.9809524
## 0.9285714 0.9523712 0.9523810 0.9761905
## 0.8714286 0.9141280 0.9142857 0.9571429
## 0.9428571 0.9618736 0.9619048 0.9809524
## 0.9285714 0.9523712 0.9523810 0.9761905
## 0.8714286 0.9141280 0.9142857 0.9571429
## 0.9571429 0.9714227 0.9714286 0.9857143
## 0.9285714 0.9523712 0.9523810 0.9761905
## 0.9000000 0.9333197 0.9333333 0.9666667
## Mean_Pos_Pred_Value Mean_Neg_Pred_Value Mean_Precision Mean_Recall
## 0.9628720 0.9812092 0.9628720 0.9619048
## 0.9526144 0.9762537 0.9526144 0.9523810
## 0.9161184 0.9576774 0.9161184 0.9142857
## 0.9628720 0.9812092 0.9628720 0.9619048
## 0.9526144 0.9762537 0.9526144 0.9523810
## 0.9161184 0.9576774 0.9161184 0.9142857
## 0.9716776 0.9857794 0.9716776 0.9714286
## 0.9526144 0.9762537 0.9526144 0.9523810
## 0.9335512 0.9667279 0.9335512 0.9333333
## Mean_Detection_Rate Mean_Balanced_Accuracy
## 0.3206349 0.9714286
## 0.3174603 0.9642857
## 0.3047619 0.9357143
## 0.3206349 0.9714286
## 0.3174603 0.9642857
## 0.3047619 0.9357143
## 0.3238095 0.9785714
## 0.3174603 0.9642857
## 0.3111111 0.9500000
##
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were alpha = 1 and lambda
## = 0.000875267.
# Test the predictive ability of the model in the testing set
glmnet.predict <- predict(glmnet.model, testing.set) # Predict values in the testing set
postResample(glmnet.predict, testing.set$Species) # the accuracy of the model
## Accuracy Kappa
## 0.9777778 0.9666667
confusionMatrix(glmnet.predict, testing.set$Species) # Lets see the breakdown of how well our model worked
## Confusion Matrix and Statistics
##
## Reference
## Prediction setosa versicolor virginica
## setosa 15 0 0
## versicolor 0 14 0
## virginica 0 1 15
##
## Overall Statistics
##
## Accuracy : 0.9778
## 95% CI : (0.8823, 0.9994)
## No Information Rate : 0.3333
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 0.9667
## Mcnemar's Test P-Value : NA
##
## Statistics by Class:
##
## Class: setosa Class: versicolor Class: virginica
## Sensitivity 1.0000 0.9333 1.0000
## Specificity 1.0000 1.0000 0.9667
## Pos Pred Value 1.0000 1.0000 0.9375
## Neg Pred Value 1.0000 0.9677 1.0000
## Prevalence 0.3333 0.3333 0.3333
## Detection Rate 0.3333 0.3111 0.3333
## Detection Prevalence 0.3333 0.3111 0.3556
## Balanced Accuracy 1.0000 0.9667 0.9833
# Specify the cross-validation method(s)
train.control <- trainControl(method = "cv", number = 10,
classProbs = TRUE,
savePredictions = TRUE,
summaryFunction = multiClassSummary) # k-folds CV with k=10
train.control2 <- trainControl(method = "LOOCV",
classProbs = TRUE,
savePredictions = TRUE,
summaryFunction = multiClassSummary) # leave-one-out CV
## Model Tuning
# When we run the model w/out tuning we see that the C parameter for svmLinear is held constant at 1.
# I decided to try to tune my model by testing for a range of numbers around 1.
svmL.info <- getModelInfo("svmLinear") #getModelInfo can be used to inspect a specific ML algorithm
svmL.info$svmLinear$parameters #look at the algorithm parameters that can be modifed
## parameter class label
## 1 C numeric Cost
tune.grid <- expand.grid(C = c(0.05, 0.1, .5, 1, 1.5))
# Use the train function to perform model training
svm.model <- train(Species ~ .,
data = training.set,
method = 'svmLinear',
trControl = train.control2, # change this to train.control to try k-fold CV
tuneGrid = tune.grid, # inputs your hyperparameters designated above
preProc = c("center"))
# Look at the results from model training
svm.model
## Support Vector Machines with Linear Kernel
##
## 105 samples
## 4 predictor
## 3 classes: 'setosa', 'versicolor', 'virginica'
##
## Pre-processing: centered (4)
## Resampling: Leave-One-Out Cross-Validation
## Summary of sample sizes: 104, 104, 104, 104, 104, 104, ...
## Resampling results across tuning parameters:
##
## C logLoss AUC prAUC Accuracy Kappa Mean_F1
## 0.05 0.1965477 0.9882993 0.9480017 0.9428571 0.9142857 0.9428571
## 0.10 0.1503756 0.9948299 0.9615435 0.9523810 0.9285714 0.9523712
## 0.50 0.1168253 0.9986395 0.9687804 0.9619048 0.9428571 0.9618736
## 1.00 0.1254751 0.9961905 0.9644326 0.9523810 0.9285714 0.9523712
## 1.50 0.1245281 0.9951020 0.9623061 0.9428571 0.9142857 0.9428105
## Mean_Sensitivity Mean_Specificity Mean_Pos_Pred_Value
## 0.9428571 0.9714286 0.9428571
## 0.9523810 0.9761905 0.9526144
## 0.9619048 0.9809524 0.9628720
## 0.9523810 0.9761905 0.9526144
## 0.9428571 0.9714286 0.9437619
## Mean_Neg_Pred_Value Mean_Precision Mean_Recall Mean_Detection_Rate
## 0.9714286 0.9428571 0.9428571 0.3142857
## 0.9762537 0.9526144 0.9523810 0.3174603
## 0.9812092 0.9628720 0.9619048 0.3206349
## 0.9762537 0.9526144 0.9523810 0.3174603
## 0.9716776 0.9437619 0.9428571 0.3142857
## Mean_Balanced_Accuracy
## 0.9571429
## 0.9642857
## 0.9714286
## 0.9642857
## 0.9571429
##
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was C = 0.5.
# Test the predictive ability of the model in the testing set
svm.predict <- predict(svm.model, testing.set) # Predict values in the testing set
postResample(svm.predict, testing.set$Species) # the accuracy of the model
## Accuracy Kappa
## 0.9777778 0.9666667
confusionMatrix(svm.predict, testing.set$Species) # Let's see the breakdown of how well our model worked
## Confusion Matrix and Statistics
##
## Reference
## Prediction setosa versicolor virginica
## setosa 15 0 0
## versicolor 0 14 0
## virginica 0 1 15
##
## Overall Statistics
##
## Accuracy : 0.9778
## 95% CI : (0.8823, 0.9994)
## No Information Rate : 0.3333
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 0.9667
## Mcnemar's Test P-Value : NA
##
## Statistics by Class:
##
## Class: setosa Class: versicolor Class: virginica
## Sensitivity 1.0000 0.9333 1.0000
## Specificity 1.0000 1.0000 0.9667
## Pos Pred Value 1.0000 1.0000 0.9375
## Neg Pred Value 1.0000 0.9677 1.0000
## Prevalence 0.3333 0.3333 0.3333
## Detection Rate 0.3333 0.3111 0.3333
## Detection Prevalence 0.3333 0.3111 0.3556
## Balanced Accuracy 1.0000 0.9667 0.9833
# Specify the cross-validation method(s)
train.control <- trainControl(method = "cv", number = 10, # k-folds CV with k=10
classProbs = TRUE,
savePredictions = TRUE,
summaryFunction = multiClassSummary)
train.control2 <- trainControl(method = "LOOCV", # leave-one-out CV
classProbs = TRUE,
savePredictions = TRUE,
summaryFunction = multiClassSummary)
# Model tuning
rf.info <- getModelInfo("rf")
rf.info$rf$parameters
## parameter class label
## 1 mtry numeric #Randomly Selected Predictors
tune.grid <- expand.grid(mtry = c(1, 2, 3, 4)) # number of features to use for decision
# Train the Model
rf.model <- train(Species ~ .,
data = training.set,
method = 'rf',
trControl = train.control2, # change this to train.control to try k-fold CV
tuneGrid = tune.grid,
preProc = c("center"))
# Look at the results from model training
rf.model
## Random Forest
##
## 105 samples
## 4 predictor
## 3 classes: 'setosa', 'versicolor', 'virginica'
##
## Pre-processing: centered (4)
## Resampling: Leave-One-Out Cross-Validation
## Summary of sample sizes: 104, 104, 104, 104, 104, 104, ...
## Resampling results across tuning parameters:
##
## mtry logLoss AUC prAUC Accuracy Kappa Mean_F1
## 1 0.1404589 0.9929932 0.8726380 0.9428571 0.9142857 0.9428571
## 2 0.1179043 0.9948299 0.6091865 0.9619048 0.9428571 0.9619048
## 3 0.1174733 0.9942857 0.4176810 0.9523810 0.9285714 0.9523712
## 4 0.1309199 0.9927891 0.3386815 0.9523810 0.9285714 0.9523712
## Mean_Sensitivity Mean_Specificity Mean_Pos_Pred_Value
## 0.9428571 0.9714286 0.9428571
## 0.9619048 0.9809524 0.9619048
## 0.9523810 0.9761905 0.9526144
## 0.9523810 0.9761905 0.9526144
## Mean_Neg_Pred_Value Mean_Precision Mean_Recall Mean_Detection_Rate
## 0.9714286 0.9428571 0.9428571 0.3142857
## 0.9809524 0.9619048 0.9619048 0.3206349
## 0.9762537 0.9526144 0.9523810 0.3174603
## 0.9762537 0.9526144 0.9523810 0.3174603
## Mean_Balanced_Accuracy
## 0.9571429
## 0.9714286
## 0.9642857
## 0.9642857
##
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was mtry = 2.
# Test the predictive ability of the model in the testing set
rf.predict <- predict(rf.model, testing.set) # Predict values in the testing set
postResample(rf.predict, testing.set$Species) # the accuracy of the model
## Accuracy Kappa
## 0.9555556 0.9333333
confusionMatrix(rf.predict, testing.set$Species) # Let's see the breakdown of how well our model worked
## Confusion Matrix and Statistics
##
## Reference
## Prediction setosa versicolor virginica
## setosa 15 0 0
## versicolor 0 14 1
## virginica 0 1 14
##
## Overall Statistics
##
## Accuracy : 0.9556
## 95% CI : (0.8485, 0.9946)
## No Information Rate : 0.3333
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 0.9333
## Mcnemar's Test P-Value : NA
##
## Statistics by Class:
##
## Class: setosa Class: versicolor Class: virginica
## Sensitivity 1.0000 0.9333 0.9333
## Specificity 1.0000 0.9667 0.9667
## Pos Pred Value 1.0000 0.9333 0.9333
## Neg Pred Value 1.0000 0.9667 0.9667
## Prevalence 0.3333 0.3333 0.3333
## Detection Rate 0.3333 0.3111 0.3111
## Detection Prevalence 0.3333 0.3333 0.3333
## Balanced Accuracy 1.0000 0.9500 0.9500
# Gather Accuracies
accuracy_train <- c(glmnet.model$results[7,6], # Final model used was #7, accuracy is column #6
svm.model$results[1,5], # final model used was #1, accuracy is column #5
rf.model$results[2,5]) # final model used was #2, accuracy is column #5
accuracy_test <- c(confusionMatrix(glmnet.predict, testing.set$Species)$overall[1],
confusionMatrix(svm.predict, testing.set$Species)$overall[1],
confusionMatrix(rf.predict, testing.set$Species)$overall[1])
model_names <- c("Elastic Net", "SVM", "Random Forest")
difference <- as.numeric(accuracy_test) - as.numeric(accuracy_train)
pander(data.frame(cbind(model_names, accuracy_train, accuracy_test, difference)))
| model_names | accuracy_train | accuracy_test | difference |
|---|---|---|---|
| Elastic Net | 0.971428571428571 | 0.977777777777778 | 0.00634920634920633 |
| SVM | 0.942857142857143 | 0.977777777777778 | 0.0349206349206349 |
| Random Forest | 0.961904761904762 | 0.955555555555556 | -0.00634920634920633 |
Caret
also has the ability to impute missing data values using the preProcess()
function. Many machine learning algorithms require complete data and therefore it may be necessary to impute missing data where necessary.
Rather than just taking the mean or median of your variable with missing data, and imputing those numbers, Caret can use more sophisticated modeling with all of your variables to more closely estimate what the missing values may have been based on patterns in your data.
We will use the iris
dataset as a quick example of one method you can use to impute missing data.
set.seed(12345)
# We will load the iris dataset, but without the species variable
iris_missing <- data.frame(iris[1:4]) %>%
prodNA(noNA = 0.1) # We will use the prodNA() function from package 'missForest' to produce 10% missing at random data
head(iris_missing)
## Sepal.Length Sepal.Width Petal.Length Petal.Width
## 1 NA 3.5 1.4 0.2
## 2 4.9 3.0 NA 0.2
## 3 4.7 3.2 1.3 NA
## 4 NA 3.1 1.5 0.2
## 5 5.0 3.6 1.4 NA
## 6 5.4 3.9 1.7 NA
# Next we set our seed for reproducibility and create a model using preProcess() and our chosen imputation, in this case bagged trees because we have multiple columns with missing data. If we had just one column with missing data we could use k nearest neighbors (knnImpute) which is faster.
iris_missing_model = preProcess(iris_missing, "bagImpute")
# Lastly, we need to use predict() to actually predict the missing values using the model we just created
iris_missing_pred = predict(iris_missing_model, iris_missing)
head(iris_missing_pred)
## Sepal.Length Sepal.Width Petal.Length Petal.Width
## 1 5.088508 3.5 1.40000 0.2000000
## 2 4.900000 3.0 1.43169 0.2000000
## 3 4.700000 3.2 1.30000 0.2382725
## 4 4.908318 3.1 1.50000 0.2000000
## 5 5.000000 3.6 1.40000 0.2382725
## 6 5.400000 3.9 1.70000 0.3486346
# We can compare with the original iris dataset
head(iris[1:4])
## Sepal.Length Sepal.Width Petal.Length Petal.Width
## 1 5.1 3.5 1.4 0.2
## 2 4.9 3.0 1.4 0.2
## 3 4.7 3.2 1.3 0.2
## 4 4.6 3.1 1.5 0.2
## 5 5.0 3.6 1.4 0.2
## 6 5.4 3.9 1.7 0.4
Important Note: if you are imputing and some of your data is set up as factors, you will need to create dummy variables before imputing using dummyVars
. This is because the preProcess()
function in caret assumes that all your data is numeric.
You then use preProcess()
with your dummy coded dataset to figure out the imputation for your continuous variable. Once you’ve imputed your continuous variable in the dummy dataset, you can then put that imputed variable back into the original dataset without dummy coding.
See Caret- Preprocessing for documentation.
Burger, Introduction to Machine Learning with R *You can get a free 10-day trial to read this book through safari books online


character module¶
This module contains the Character class. This module is originally written by Rickyc (Github user).
Team AFK added machine learning Features to the original module.
-
class
character.
Character
(name, imageName, point)[source]¶ Bases:
pygame.sprite.Sprite
Character class that inherits pygame.sprite.
-
lives
= 1¶
-
movement
(key, grid, humanAuto=1)[source]¶ Changes the sprite and issues command to movementHelper Note : that this is used by both humans and enemies to move key : the keyboard command used to move the character grid : a grid of the board with numbers representing occupency
of the tiles. Used to make decisions based on surroundings- humanAuto : 0 = human controller bomberman
- 1 = Hard coded computer controlled bomberman 2 = Other
-
saveChoice
(choice, myMat)[source]¶ Saves the current board and choice to a csv file. (if the player is controlled manually) It always saves the data to WallsFull.csv It saves the data to enemysFULL.csv and bombsFULL.csv (if the corresponding object is within 10 blocks) It saves the data to bricksFULL.csv (if an enemy is not within 3 blocks))
-
speed
= 1¶
-


T & G's Awesome Movie Experience
Please make your selections
Please select a movie
Please select a movie
The Forest
Cool Runnings
Interstellar
Legally Blonde
Please select a time
Please select a time
12:00pm
3:00pm
6:45pm
9:15pm
Please select your age
Please select your age
senior
student
adult
toddler
Please Number of Tickets
1
2
3
4
Go to the movies!


1. The following are javascript data types except?
2.JavaScript is designed for following purpose ?
3.Cost for Using JavaScript in your HTML is ?
4.Why JavaScript is called as Lightweight Programming Language ?
5.JS code included inside head section is loaded before loading page.


Previously, we saw how just using functions in Ruby, we could create a lot of powerful code. Let’s continue the theme of “programming with constraints” and try to solve an actual problem. nil
.
Is nil
a problem?
nil
creates problems in code clarity and revealing programmer intent. nil
means
“no value” sometimes, but other times it means false
. Other times it means “the developer didn’t think of the proper default
for a value”. Rails migrations, by default, allow database columns to be nullable. This is often not correct, and by making it
the default, you cannot tell the difference between “the business requires that this field be nullable” and “the developer forgot
to consider the nullability of this column”.
The problems manifest when you see a test failure or production error where something is nil
that you weren’t expecting. Now
you have to figure out if that value could be nil
(and the original developer missed the edge case) or if it should never be
nil
, and you have a more serious problem in either your data, business logic, or worse.
The reason this becomes complex isn’t necessarily the concept of “no such value” (though this is a bit of a problem), but the way in which nil
is treated by the language. In Ruby, nil
is the only instance of NilClass
and has the following magical properties that cannot be bestowed on any other object:
- it is “falsey” (a trait shared with only one other value,
false
, the sole value ofFalseClass
) - it is the default value of every variable
Because of these two things, we use it all over the place to represent “no value”, and our code is littered with:
do_something if value.nil?
foo ||= {}
Array(some_list).each
And so forth. Avdi Grimm gave a talk at Ruby Midwest called “Confident Ruby” that deals, in part, with nil and how to avoid it. Things like Array()
, String()
, and null objects are good techniques.
But let’s take a different approach. What if there were no such thing as nil
, and the language didn’t support it?
Can you imagine? A world without nil
?
Suppose there were no such thing as nil
in Ruby. Every variable would require that a value be assigned to it at declare time, and the runtime would raise an exception if you tried to use a variable/parameter/etc. without a value.
How would that change the way we code?
Of course, we could re-invent it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
This gives us a value that means “no value”, but without the magic provided by the language, what good is it?
Let’s return to our domain from the previous post, where we want to make a system that manages users in a database. Since we now have our fully armed and operational object-oriented programming language, we might be inclined to make a Person
class:
1 2 3 4 5 6 7 8 9 10 |
|
Remember, we don’t have nil
, so we don’t have a default value for any variable - we must assign one explicitly or we’ll get runtime errors. Given the code above, this shouldn’t be a problem, since we assign values to our ivars when they are declared.
If you recall, however, we have two optional values in our Person
: title
, and id
. title
is simply optional - a person might not have a title - while id
will only be populated if the person has been stored in the database. How can we model this?
Generic optional values?
Scala (a statically-typed functional/OO language that runs on the JVM), “solves” this by creating an Option
type that makes explicit the concept of an optional value1. In Ruby, it would look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
We can use it like so:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
So, we’ve replaced what would be a call to .nil?
in regular Ruby with a call to .exists?
in our nil-less Ruby. Is this really any better? We could wrap the logic of “do one thing if there’s a value, do another if there isn’t” into a method on Optional
:
1 2 3 4 5 6 7 8 9 10 11 |
|
We could then implement salutation
like so:
1 2 3 4 5 6 7 8 |
|
Yech. We might be able to play some syntax games and clean this up, but this is not an improvement. if/else
statements are
easy to understand and with the magic of nil
, the logic is pretty straightforward:
1 2 3 4 5 6 7 8 9 |
|
Optional
, as we’ve defined it, is just a degenerate implementation of nil
that has a terrible API2. It does have the advantage of not being magic - we are required to provide a value for every variable, which is nice - but can we do better?
 What if we used the type system more explicitly?
Suppose we define Person
to be only the required values, i.e. the bare essence of a person in our system, and then create
mixins for the optional values. We could make a mixin like Stored
act as both a “tag” for an object that is stored in the
database, and as the location for related code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Note that we don’t make id
or title
mutable; they are still read-only fields. So, how do they get set? We tightly couple
Person
with these new modules and set the fields there.
1 2 3 4 5 6 7 8 9 10 11 |
|
Note that if we wanted to maintain total immutability, we would need to jump through a few hoops:
1 2 3 4 5 6 7 |
|
In either case, we end up with an instance that has mixed in Titled
and absolutey has a value for title
.
How would this affect our salutation
method?
1 2 3 4 5 6 7 8 9 |
|
We’ve replaced a generic check - for nil
- with a specific check - for being Titled
. This may not seem like an improvement, but I’d argue that it makes our domain a bit richer and more intention-revelaing. It turns an implementation decsion (treating nil
as not having a title) into something explicit. And, at the end of the day, if we need logic based on the existence of a value, well, we’re going to need to use if
statements.
Or are we?
Before we answer that, it’s worth noting that although Titled
is specific to our Person
class, Stored
is a more generic concept that could be broadly used to explicitly call out records not stored in the database. Imagine an update
method like so:
1 2 3 |
|
That reads a lot better to me than a nil
check3. It also abstracts away the way in which we know that a record is stored, but without requiring a common superclass.
Back to our if
statement. We have a business rule based on the existence of a value, so it seems we just have to live with the conditional logic, right? Not exactly. What if both Person
and Titled
implemented salutation
?
Person would use the “default if no title” version, because a raw Person
has no title:
1 2 3 4 5 |
|
Once Titled
is mixed in, we know that we absolutely have a title, so we override it with the correct logic given a title:
1 2 3 4 5 |
|
Now, this is interesting. We’re using polymorphism and inheritance as a way to avoid if
statements. If we’d used nil
to
represent “no title”, we’d be stuck with conditional logic. The added constraint of programming without nil
has forced us to
get creative and resulted in a cleaner solution.
We’ve now used the type system to create an explicit description of our domain, and we didn’t need nil
. Of course, a type that has a lot of optional values will require a lot of these sorts of modules, and it could get ugly. This might be a good thing.
Now that we can handle optional values in our data structures, what about containers?
Optional values in container classes
I see a lot of code using first
or last
on an array as a shortcut for checking if the array is empty and, if not, getting the first or last element respectively. Obviously, this would have to stop, but what about so-called “sparse arrays” where some indeces contain nil
values? Dealing with this cleanly is not simple given the currently API of Array
. Of course, if the language never had nil
, you could imagine that Array
would have some facility for dealing with this. On idea would be that each accessor method would accept an optional block that would be run if there were no value, so that the caller could provide a default:
1 2 3 4 |
|
When we’re talking about containers, however, we’d need to be able to model “there is no value at this location” more explicitly. Since this actually is a generic problem, we can bring back our Optional
class to handle it. We could assume that the Array
class bakes in the use of Optional
, but a) the API would be somewhat inconvienient and b) it doesn’t help us in the real world. What if we created a mix-in that we could use for Array
instances that contained optional values?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
This API might not be “right”, but we can see that, without nil
, we have to be explicit about which arrays can be missing
values and which cannot. That makes our code more intention-revealing. If Ruby really didn’t have nil
, I would expect the
Array class to better “bake-in” this concept so that the API was clean and easy.
Hash
, on the other hand, comes built-in with everything we need to avoid nil
, namely the fetch
method:
1 2 3 4 |
|
By using fetch
, we can be very clear about what we want to do. Without a block, we are getting the value for a key that must exist. With a block we indicate that we’re getting a value for a key that is optional…and we must specify the value to use if it’s missing.
An alternative is to specify a block that provides default values, and then use []
:
1 2 3 4 |
|
Another way in which we use nil
in a Hash
is in the “options hash” pattern where we can parameterize a method call, typically
omitting keys where we want to use the default value provided by the API. In this case, we use nil
to mean “don’t use the
default, but omit the value entirely”.
For example, in Rails 3, we can use respond_with
to send an object to the caller in the
controller. By default, the HTTP location header is set by examining the type of the object and getting a URL for it.
respond_with
takes an options hash and, if we wish to avoid setting this header, we must set :location
to nil
:
1 2 3 4 5 6 7 8 |
|
Doing this without nil
is trickier, and I think it requires a small change in how we design APIs using the options hash.
The result, again, will be more intention-revelaing code. Instead of using nil
for “don’t set the location header”, we would
set an option that indicates that more clearly:
1 2 3 4 5 6 7 8 |
|
This would even improve the implementation of respond_with
as well:
1 2 3 4 5 6 7 8 |
|
Again, the absence of nil
is making our code a bit longer, but much more intention-revealing and explicit.
In reality, though, nil
exists and is used in many places. Can we take anything from this to the real world?
Back to reality
First and foremost, I would suggest that you design APIs in a way that nil
is not required nor used. Methods that return
collections should return an empty version instead of nil
. Method parameters should not allow nil
to be passed in for any
value, and should use an options has for optional values.
Not every API is written this way, and to deal with them, there are a few handy methods provided by Ruby that can help:
String()
- convertsnil
to the empty string, and converts any string to itself. Wrap a possibly-nil
string in this and you avoid anil
check. (ActiveSupport’s#present?
is a way to do this, too, butString()
works everywhere in Ruby)Array()
- convertsnil
to an empty array and converts an array to itself. Perfect for dealing with pesky APIs that insist on returningnil
instead of an empty array.Hash[Array()]
- by combiningHash#[]
andArray()
, we can convert nil to an empty hash and a hash to itself.Array()
will turn aHash
into a two-dimensional array, andHash#[]
will turn a two-dimensional array back into aHash
. SinceArray()
turnsnil
into an empty array,Hash[Array(nil)]
returns an empty has. Ruby really should include a method namedHash()
that does this, but it doesn’t.
Beyond this, null objects are a useful pattern for encapsulating logic of the type “do this if some value is nil”, and the try
method in Rails is also very useful.
It’s still interesting to think about a world without nil
. Without it, we can still handle the absence of values in objects, as well as containers, and our code is more intentional-revelaing. Why do we need nil
?
- The JVM still allows
null
and so does Scala, soOption
only provides a way to express optional types more clearly;null
is still there and is the default value of variables that aren’t given an initial value. ↩ - It’s worth pointing out that in Scala,
Option
is a lot more useful, becausenull
has no such magical properties on the JVM like it does in Ruby. ↩ - I realize that Active Record encapsulates this concept in
new_record?
, but a) we’re in an imaginary domain without Active Record and b) that Active Record encapsulates thenil
check gives more credence that doing so is a good idea in general. ↩


Java is one of the most popular programming languages used to create Web applications and platforms. It was designed for flexibility, allowing developers to write code that would run on any machine, regardless of architecture or platform.
The Java language is easy to learn and its coding style is easy to read and write. It contains many features of other Languages like C and C++ and Java removes complexity because it doesn't use pointers and doesn't support Multiple Inheritance. This is where the "Write Once, run anywhere" motto for Java comes in. It means that you can develop on one environment(Operating System) and run on another environment without doing any modification of the code. Java application runs the same bytecodes regardless of any environment (Operating System). To enable a Java application to execute anywhere on the network, the compiler generates an architecture-neutral object file format. Java has Dynamic and Extensible means with the help of OOPS you can add classes and plug in new methods to classes, creating new classes through sub classes. This makes Java very easy to augment with your own classes or even to modify. Java programs can execute in any environment (Linux,Window,Mac etc.) for which there is a Java run-time system (JVM). That really means there is no implementation dependent features. Java supports Multithreading. Multithreading means handling more than one job at a time, so get more process get done in less time than it could with just one thread. Java was designed with the distributed environment. It has networking facilities, so it can be transmit, run over internet. for ex. RMI and EJB are used for creating distributed applications


Create a new account
Returning Member
I am a returning member
Sign in with facebook
Sign in with LinkedIn
Sign in with Twitter
Remember me


Predictive marketing for Magento
Bring the power of data science to your Magento store. Find good customers, keep them happy and make more money. Takes 5 minutes to install. Learn More.
Improve sales by 10-50% with insights on what and when your customers want to buy.
Create lifecycle marketing strategies that learn over time.
Increase conversions by 2-5x by showing the right content to each customer on email, web and mobile.


nothing to do? we got something for ya
Trash Squad
Opera Fam
Amanda's Room
Description
Don't go in here. It smells. ADSF SDAF ASDF ASDF ASDASDFASDFASDFSADFSDFSDFF
OOOASODASODAOSDOASDOASODO
No idea.


Tell me somethin', girl
Are you happy in this modern world?
Or do you need more?
Is there somethin' else you're searchin' for?
I'm falling
In all the good times I find myself
Longin' for change
And in the bad times I fear myself
Tell me something, boy
Aren't you tired tryin' to fill that void?
Or do you need more?
Ain't it hard keeping it so hardcore?


GROTTY(1) GROTTY(1) NAME grotty - groff driver for typewriter-like devices SYNOPSIS grotty [ -bBcdfhioruUv ] [ -Fdir ] [ files... ] It is possible to have whitespace between the -F option and its parame‐ ter. DESCRIPTION grotty translates the output of GNU troff into a form suitable for type‐ writer-like devices. Normally grotty should be invoked by using the groff command with a -Tascii, -Tlatin1 or -Tutf8 option on ASCII based systems, and with -Tcp1047 and -Tutf8 on EBCDIC based hosts. If no files are given, grotty reads the standard input. A filename of - also causes grotty to read the standard input. Output is written to the standard output. By default, grotty emits SGR escape sequences (from ISO 6429, also called ANSI color escapes) to change text attributes (bold, italic, colors). This makes it possible to have eight different background and foreground colors; additionally, bold and italic attributes can be used at the same time (by using the BI font). The following colors are defined in tty.tmac: black, white, red, green, blue, yellow, magenta, cyan. Unknown colors are mapped to the default color (which is dependent on the settings of the terminal; in most cases, this is black for the foreground and white for the background). Use the -c switch to revert to the old behaviour, printing a bold charac‐ ter c with the sequence `c BACKSPACE c' and an italic character c by the sequence `_ BACKSPACE c'. At the same time, color output is disabled. The same effect can be achieved by setting either the GROFF_NO_SGR envi‐ ronment variable or using the `sgr' X command (see below). For SGR support, it is necessary to use the -R option of less(1) to dis‐ able the interpretation of grotty's old output format. Consequently, all programs which use less as the pager program have to pass this option to it. For man(1) in particular, either add -R to the $PAGER environment variable, e.g. PAGER="/usr/bin/less -R" export PAGER or use the -P option of man to set the pager executable and its options, or modify the configuration file of man in a similar fashion. Note that with some man(1) versions, you have to use the $MANPAGER environment variable instead. grotty's old output format can be displayed on a terminal by piping through ul(1). Pagers such as more(1) or less(1) are also able to dis‐ play these sequences. Use either -B or -U when piping into less(1); use -b when piping into more(1). There is no need to filter the output through col(1) since grotty never outputs reverse line feeds. The font description file may contain a command internalname n where n is a decimal integer. If the 01 bit in n is set, then the font is treated as an italic font; if the 02 bit is set, then it is treated as a bold font. The code field in the font description field gives the code which is used to output the character. This code can also be used in the \N escape sequence in troff. If the DESC file contains the keyword unicode, grotty emits Unicode char‐ acters in UTF-8 encoding. Otherwise, it emits characters in a single- byte encoding depending on the data in the font description files. See the groff_font(5) man page for more details. OPTIONS -b Suppress the use of overstriking for bold characters. Ignored if -c isn't used. -B Use only overstriking for bold-italic characters. Ignored if -c isn't used. -c Use grotty's old output format (see above). This also disables color output. -d Ignore all \D commands. Without this grotty renders \D'l...' com‐ mands that have at least one zero argument (and so are either hor‐ izontal or vertical) using -, |, and + characters. In a similar way, grotty handles \D'p...' commands which consist entirely of horizontal and vertical lines. -f Use form feeds in the output. A form feed is output at the end of each page that has no output on its last line. -Fdir Prepend directory dir/devname to the search path for font and device description files; name is the name of the device, usually ascii, latin1, utf8, or cp1047. -h Use horizontal tabs in the output. Tabs are assumed to be set every 8 columns. -i Use escape sequences to set the italic text attribute instead of the underline attribute for italic fonts (`I' and `BI'). Note that most terminals (including xterm) don't support this. Ignored if -c is active. -o Suppress overstriking (other than for bold or underlined charac‐ ters in case the old output format has been activated with -c). -r Use escape sequences to set the reverse text attribute instead of the underline attribute for italic fonts (`I' and `BI'). Ignored if -c is active. -u Suppress the use of underlining for italic characters. Ignored if -c isn't used. -U Use only underlining for bold-italic characters. Ignored if -c isn't used. -v Print the version number. USAGE grotty understands a single X command produced using the \X escape sequence. \X'tty: sgr n' If n is non-zero or missing, enable SGR output (this is the default), otherwise use the old drawing scheme for bold and under‐ line. ENVIRONMENT GROFF_NO_SGR If set, the old drawing scheme for bold and underline (using the backspace character) is active. Colors are disabled. GROFF_FONT_PATH A list of directories in which to search for the devname directory in addition to the default ones. See troff(1) and groff_font(5) for more details. FILES /usr/share/groff/1.21/font/devascii/DESC Device description file for ascii device. /usr/share/groff/1.21/font/devascii/F Font description file for font F of ascii device. /usr/share/groff/1.21/font/devlatin1/DESC Device description file for latin1 device. /usr/share/groff/1.21/font/devlatin1/F Font description file for font F of latin1 device. /usr/share/groff/1.21/font/devutf8/DESC Device description file for utf8 device. /usr/share/groff/1.21/font/devutf8/F Font description file for font F of utf8 device. /usr/share/groff/1.21/font/devcp1047/DESC Device description file for cp1047 device. /usr/share/groff/1.21/font/devcp1047/F Font description file for font F of cp1047 device. /usr/share/groff/1.21/tmac/tty.tmac Macros for use with grotty. /usr/share/groff/1.21/tmac/tty-char.tmac Additional klugdey character definitions for use with grotty. Note that on EBCDIC hosts, only files for the cp1047 device is installed. BUGS grotty is intended only for simple documents. There is no support for fractional horizontal or vertical motions. There is no support for \D commands other than horizontal and vertical lines. Characters above the first line (ie with a vertical position of 0) cannot be printed. Color handling is different compared to grops(1). \M doesn't set the fill color for closed graphic objects (which grotty doesn't support any‐ way) but changes the background color of the character cell, affecting all subsequent operations. SEE ALSO groff(1), troff(1), groff_out(5), groff_font(5), groff_char(7), ul(1), more(1), man(1), less(1) Groff Version 1.21 31 December 2010 GROTTY(1)


{% load i18n %}
{% blocktrans %}
The Password and Token field are stored as plain text inside the database.
This is necessary because they are needed to make API requests, but it also increases the risk of
someone stealing it.
To limit the possible damage tokens or accounts with limited access can be used.
{% endblocktrans %}


The essay: Always 25 minutes, always the first section of the test. The essay sets the tone for the rest of your test; if done well, it will boost your confidence, but if you bomb it, that bad feeling will transfer into the next few sections. The topics are always very general and they are relatable to almost everyone.
Note: This method does not work for everyone. If this doesn't work for you, keep practicing and find out what does!
Nobody wants to be called old-fashioned or be considered out of touch with current trends and thinking. But there's something to be said for holding on to old ideas and customs even if they may not be in fashion at the moment. People are too easily impressed by anything new and trendy—the latest television show, or music group, or technological gadget. They place too much emphasis on newness without bothering to look at something's real value. Assignment: Do people place too much value on newness? Plan and write an essay in which you develop your point of view on this issue. Support your position with reasoning and examples taken from your reading, studies, experience, or observations.
Try to write with insight, taking the "out of the box side of things." Effectively develop POV (with good critical thinking, appropriate examples, reasoning, and other evidence) and stay well organized and clearly focused. Express ideas clearly, and emphasize main ideas. Use good grammar (see the SATBreaker: Grammar section).
In the thesis, QUALIFY your argument (show both sides) by using a point from the other side of your list! But to conclude the whole essay, show the hole in this point and finish off your essay by telling them why your side is better than the opposition's point of view. Use these tools to your advantage, and get the 12 out of 12 that you deserve!


JUNIOR MAPAP- acetaminophen tablet, chewable
Major Pharmaceuticals
Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.
Liver warning: This product contains acetaminophen. Severe liver damage may occur if your child takes:
Sore throat warning: If sore throat is severe, persists for more than 2 days, is accompanied or followed by fever, headache, rash, nausea, or vomiting, consult a doctor promptly.
These could be signs of a serious condition.
Overdose warning: Taking more than the recommended dose (overdose) may cause liver damage. In case of overdose, get medical help or contact a Poison Control Center (1-800-222-1222) right away. Quick medical attention is critical even if you do not notice any signs or symptoms.
Weight (lb) |
Age (yr) |
Dose (tablets)* |
Under 48 |
Under 6 |
Ask a doctor |
48-59 |
6-8 |
2 |
60-71 |
9-10 |
2 1/2 |
72-95 |
11 |
3 |
*or as directed by a doctor
citric acid, crospovidone, D&C red #27 aluminum lake, D&C red #30 aluminum lake, dextrates hydrated, ethylcellulose, flavor, magnesium stearate, mannitol, polyethylene, stearic acid, sucralose
MAJOR®
NDC 0904-5754-24
†Compare to the active ingredient in
Junior Strength Tylenol®
Meltaways®
Junior
Mapap®
ACETAMINOPHEN
Fever reducer / Pain reliever
ASPIRIN FREE • IBUPROFEN FREE
AGES
6-11
Rapid Tabs
24 Tablets, 160 mg EACH
Bubble Gum Flavor
TAMPER EVIDENT: DO NOT USE IF PACKAGE IS OPENED OR IF BLISTER
UNIT IS TORN, BROKEN OR SHOWS ANY SIGNS OF TAMPERING
†This product is not manufactured or distributed by McNeil
Consumer Healthcare, owner of the registered trademark
Junior Strength Tylenol® Meltaways®.
50844 REV1013F45008
Distributed by MAJOR® PHARMACEUTICALS
31778 Enterprise Drive
Livonia, MI 48150 USA M-17
Rev. 12/13
Re-order No. 100178
Major 44-450
|
JUNIOR MAPAP
acetaminophen tablet, chewable | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
|
| Labeler - Major Pharmaceuticals (191427277) |
| Establishment | |||
| Name | Address | ID/FEI | Business Operations |
|---|---|---|---|
| LNK International, Inc. | 832867894 | MANUFACTURE(0904-5754) |
| Establishment | |||
| Name | Address | ID/FEI | Business Operations |
|---|---|---|---|
| LNK International, Inc. | 038154464 | PACK(0904-5754) |


Facebook's Libra could come under some existing rules: Watchdog
LONDON: Existing securities rules could apply to "stablecoin" initiatives like Facebook's Libra project, global securities watchdog IOSCO said on Monday (Nov 4) as policymakers examine whether new regulation is needed.
The watchdog, made up of securities regulators from across the world, including the United States, Europe and Japan, said an assessment of stablecoins found they can potentially offer benefits as well as pose risks.
"Our analysis has shown that so-called ‘stablecoins’ can include features that are typical of regulated securities," IOSCO said in a statement.


Adds a class method for retrieving and querying objects. A scope represents a narrowing of a database query, such as :conditions => {:color => :red}, :select => 'shirts.*', :include => :washing_instructions.
class Shirt < ActiveRecord::Base named_scope :red, :conditions => {:color => 'red'} named_scope :dry_clean_only, :joins => :washing_instructions, :conditions => ['washing_instructions.dry_clean_only = ?', true] end
The above calls to named_scope define class methods Shirt.red and Shirt.dry_clean_only. Shirt.red, in effect, represents the query Shirt.find(:all, :conditions => {:color => 'red'}).
Unlike Shirt.find(…), however, the object returned by Shirt.red is not an Array; it resembles the association object constructed by a has_many declaration. For instance, you can invoke Shirt.red.find(:first), Shirt.red.count, Shirt.red.find(:all, :conditions => {:size => 'small'}). Also, just as with the association objects, name scopes acts like an Array, implementing Enumerable; Shirt.red.each(&block), Shirt.red.first, and Shirt.red.inject(memo, &block) all behave as if Shirt.red really were an Array.
These named scopes are composable. For instance, Shirt.red.dry_clean_only will produce all shirts that are both red and dry clean only. Nested finds and calculations also work with these compositions: Shirt.red.dry_clean_only.count returns the number of garments for which these criteria obtain. Similarly with Shirt.red.dry_clean_only.average(:thread_count).
All scopes are available as class methods on the ActiveRecord::Base descendent upon which the scopes were defined. But they are also available to has_many associations. If,
class Person < ActiveRecord::Base has_many :shirts end
then elton.shirts.red.dry_clean_only will return all of Elton’s red, dry clean only shirts.
Named scopes can also be procedural.
class Shirt < ActiveRecord::Base named_scope :colored, lambda { |color| { :conditions => { :color => color } } } end
In this example, Shirt.colored('puce') finds all puce shirts.
Named scopes can also have extensions, just as with has_many declarations:
class Shirt < ActiveRecord::Base named_scope :red, :conditions => {:color => 'red'} do def dom_id 'red_shirts' end end end
For testing complex named scopes, you can examine the scoping options using the proxy_options method on the proxy itself.
class Shirt < ActiveRecord::Base named_scope :colored, lambda { |color| { :conditions => { :color => color } } } end expected_options = { :conditions => { :colored => 'red' } } assert_equal expected_options, Shirt.colored('red').proxy_options
# File lib/will_paginate/named_scope.rb, line 86 def named_scope(name, options = {}) name = name.to_sym scopes[name] = lambda do |parent_scope, *args| Scope.new(parent_scope, case options when Hash options when Proc options.call(*args) end) { |*a| yield(*a) if block_given? } end (class << self; self end).instance_eval do define_method name do |*args| scopes[name].call(self, *args) end end end
Generated with the Darkfish Rdoc Generator 2.


Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn’t have “lakes” (water inside that isn’t connected to the water around the island). One cell is a square with side length 1.


THE FULL MONTY (1997)
Reviewed by Jack Choo
Directed by Peter Cattaneo Starring : Robert Carlyle (Gaz) Tom Wilkinson (Gerald) Mark Addy (Dave) Written by Simon Beaufoy Running Time : 1hr 40mins
Rating : **** 1/2 out of *****
STRIPTEASE …… BRIT STYLE!
Trailing the success of brit humour in the movie industry with the likes of the semi-dramatic THE COMMITMENTS and the nearly slapstick A FISH CALLED WANDA, THE FULL MONTY is one film which delivered the depth of the former and the humour magnitude of the latter. The film opens with a narrated documentary reel showing the improving economic and living standards of Sheffield in the 60's, then cut to the harsh reality of the present. Sheffield has become some sort of a semi-slum with the only visible increase in anything was the amount of layoffs from steel-factories; a once flourishing industry.
Gaz (Carlyle) spends most of his time in the Worker's Club, a sort of place where jobless people sit around to wait for job offers. He and his `plump' friend Dave (Addy) as well as their former foreman Gerald (Wilkinson) have been sitting around the club for months without any `call for duty'. What seemingly was just a passing hard time for Gaz suddenly transformed itself into desperation when he cannot afford the 700 pounds of child-support money to his ex-wife. Suddenly finding himself facing the possiblity of losing custody of his son, he goes on to concoct an enterprising wild-idea to get the money he desperately requires.
Dave and Gerald too have problems of their own. On top of his lack of employment, Dave is also faced with the paranoia of his wife leaving him because of his current financial state as well as his`plump' appearance while Gerald have been cheating on his wife by not telling her of his layoff for as long as 6 months, leaving home for `work' when he was actually a long-standing member of the Worker's Club. There we have it; people with real problems and a not-so-practical solution for them. Gaz manages to get the support from them and sure enough they managed to get a few other poor jobless blokes to join in their gag : to perform a strip-act at the local pub. In Gaz's own words while looking at an add for a strip-act featuring hunky `beautiful' men, `If women are willing to pay for this, they sure as well will pay for REAL-men'.
THE FULL MONTY is very simple in nature and not a trace ambitious at all. It is a small film which delves in the harsh-reality of unemployment and the desperation it drives people to. It also is a very light movie to watch despite the theme it delves in because it has a lot of human-factor going for it. Never for once, was it trying to be manipulative at all, THE FULL MONTY was true to itself all the way. While the hilarity level of this film soared unexpectedly high, audience will find that they are in no way being cheated of a laugh, something lacking in many comedy films (wannabes?) from Hollywood.
Other than Carlyle, who acted as the psychotic Begbie in TRAINSPOTTING, the rest of the actors were definitely very new to me on-screen. However, the acting presented in this film is more than satisfying. Carlyle's work here is a stark contrast to his character in TRAINSPOTTING, implying real acting skill and flexibility on-screen. Kudos to the people involved in this film, especially to director Peter Cattaneo for being able to put together an excellent film which is has so much potential in ending up as your just-another-STRIPTEASE.
Already a critical and financial success for such a small film, THE FULL MONTY is a humble film which deserves applause throughout. While TITANIC managed to feast the eyes and soul in an epic way, THE FULL MONTY gives one the same satisfaction…….in half the time.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


| Created: | 6/26/2020 3:15:30 PM |
| Modified: | 6/26/2020 3:15:30 PM |
| Project: | |
| Advanced: |
| Attribute |
|
Public bigint business_unit_id |
|
Details:
|
|
Public varchar(255) business_unit_business_unit |
|
Details:
|
|
Public varchar(255) created_by |
|
Details:
|
|
Public varchar(255) updated_by |
|
Details:
|
|
Public timestamp with time zone(0) created_at |
|
Details:
|
|
Public timestamp with time zone(0) updated_at |
|
Details:
|
|
Public timestamp with time zone(0) start_date |
|
Details:
|
|
Public timestamp with time zone(0) end_date |
|
Details:
|
|
Public bigserial id |
|
Details:
|
|
Public jsonb ods_meta |
|
Details:
|
|
Public integer ods_version |
|
Details:
|
|
Public varchar(255) ods_created_by |
|
Details:
|
|
Public timestamp with time zone(0) ods_created_at |
|
Details:
|
| Operation | ||
|
Public business_units_pkey( id: bigserial, |
||
|
Details:
<<PK>>
|
| Tag | Value |
| Owner | public |
|
Details:
|
| Property | Value |
| isFinalSpecialization: | 0 |
| Object | Type | Connection | Direction | Notes |
| «view» current_business_units_view | View | Dependency | From | |
| «view» current_business_units_view | View | Dependency | From |


Enter the data from your hospital here.
The software calculates your practice production and expenses based on the numbers you entered.
Test scenarios by entering your numbers in the teal cells. The simulator will calculate the potential increase in revenue and/or profit.


Player score
-
last pick
CPU score
-
last pick
Select either rock, paper, scissors, lizard or Spock and try to beat the CPU!
Remeber! Scissors cuts paper, paper covers rock, rock crushes lizard, lizard poisons Spock, Spock smashes scissors, scissors decapitates lizard, lizard eats paper, paper disproves Spock, Spock vaporizes rock and rock crushes scissors!


Purpose
Based on this Inspiration I wanted to create something current.
Description
Apache, PHP-FPM, NGINX and SupervisorD for Docker build on Alpine Linux.
Docker
Add this to line 1 of your Dockerfile to build a docker web app:
FROM ghcr.io/laniksj/docker-php-alpine
COPY . /var/www/html
That will copy all the web content to your docker container.
Then you can use it as a service from any Docker orchestration tools.
Examples
AWS Elastic Container Service (ECS)
Azure Container Service (ACS)
Cloud Foundry’s Diego
CoreOS Fleet
Docker Swarm
Google Container Engine
Kubernetes
Mesosphere Marathon
Source: 8 Container Orchestration Tools to Know
Bugs
Please report any bugs or issues you find. Thanks!


--- layout: personal-default title: description: keywords: image: image_is_local: link: image_alt: ---


Main Page
Classes
Files
File List
File List
Here is a list of all documented files with brief descriptions:
Config.hpp
[code]
Connector.hpp
[code]
Doxygen.hpp
[code]
Host.hpp
[code]
PluginManager.hpp
[code]
Pluma.hpp
[code]
Pluma.inl
[code]
Provider.hpp
[code]
:: Copyright © 2011 Gil Costa, all rights reserved :: Documentation generated by
doxygen 1.7.4
::


Setting this to true will visually show the divs.
A flag
A flag
The renderer this accessibility manager works for.
Adjust the hit area based on the bounds of a display object
Bounds of the child
Destroys the accessibility manager
private function that will visually add the information to the accessability div
Generated using TypeDoc
The Accessibility manager recreates the ability to tab and have content read by screen readers. This is very important as it can possibly help people with disabilities access PixiJS content.
A DisplayObject can be made accessible just like it can be made interactive. This manager will map the events as if the mouse was being used, minimizing the effort required to implement.
An instance of this class is automatically created by default, and can be found at
renderer.plugins.accessibility
PIXI.accessibility


Pervert filmed crawling on hotel corridor to hear couples having sex in rooms
The 28-year-old man said he got addicted after copying the move from a man when he first checked in to the hotel in Chongqing, China
by Tiffany LoA man was caught wandering hotel corridors to record the sounds of couples having sex in their rooms.
Ms Tang and her boyfriend were staying at a hotel in Jiangjin district of Chongqing, south-west China, in October when they realised a shadow moving outside their room door in the middle of the night.
They alerted the police the next morning and officers reviewed the CCTV footage at the hotel to find a man crawling at the corridor, according to KuaiBao .
Footage also captures the man taking his mobile phone out and placing it close to the door, seemingly to audio-record sounds coming from the room.
He checks his phone before moving to the next room.
Shuangfu Police traced the footage and arrested a 28-year-old man, known by the surname He, on suspicion of invasion of privacy last Tuesday.
Mr He, from Xishui, Guizhou province, claimed he stayed a night at the same hotel and heard his neighbour romping in the room next door.
A spokesman for Shuangfu Police told Pear, a video-sharing website: "Mr He said he saw a man eavesdropping outside the couple's room when he walked to the corridor.
"The man saw Mr He and walked away and Mr He copied the man's move and found himself getting addicted to it.
"He did this to satisfy his physical and psychological needs."
Mr He also told the police he had returned to the hotel several times in a bid to record other couples' intimate moments.
He has since been jailed for five days, according to local authorities.


Hello!
This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Omnis earum tempore inventore a numquam unde quo mollitia neque culpa.
Card title
Some quick example text to build on the card title and make up the bulk of the cards content.
Go somewhereCard title
Some quick example text to build on the card title and make up the bulk of the cards content.
Go somewhereCard title
Some quick example text to build on the card title and make up the bulk of the cards content.
Go somewhere


Los Andes del Peru Marathon
Huancayo PER
Website: www.marathondelosandes.pe
Race Winners
(32 runnings)
2:48:01 2:42:55 2:48:22 2:54:14 18 Nov
2007
2:25:49
2:50:12
19 Nov
2006
2:26:54
1:18:31
20 Nov
2005
2:26:31
2:55:51
21 Nov
2004
2:23:04
3:01:50
23 Nov
2003
2:24:55
3:00:06
03 Nov
2002
2:24:49
3:04:58
18 Nov
2001
2:27:47
3:00:43
2000
---
---
21 Nov
1999
2:27:39
2:54:51
22 Nov
1998
2:27:03
2:58:46
23 Nov
1997
2:24:44
2:48:13
17 Nov
1996
2:24:42
2:50:06
05 Nov
1995
2:25:47
2:53:17
06 Nov
1994
2:25:53
3:15:20
14 Nov
1993
2:28:54
---
1992
---
---
1991
---
---
1990
---
---
1989
---
---
1988
---
---
1987
---
---
1986
---
---
1985
---
---
---
---
Notes: 1984 was the inaugural year. The race is held at 3200 meters elevation. The race distance for women in 2006
was a half marathon.
12 Nov
2017
2:19:07
Christian Pacheco Mendoza (PER)
2:45:26
Gladys-Celia Machacuay Huaman (PER)
20 Nov
2016
2:21:27
Raul-Manuel Pacheco Mendoza-7
2:47:39
Wilma-Janeth Arizapana Yucra (PER)
15 Nov
2015
2:22:43
Raul-Manuel Pacheco Mendoza-6
2:50:02
Scola Chepkemoi Kiptoo (KEN)
16 Nov
2014
2:18:36
Raul-Manuel Pacheco Mendoza-5
2:36:06
Ines Melchor-2
17 Nov
2013
2:22:30
Alene Emere Reta (ETH)
2:45:18
Hortensia Arzapalo-4
18 Nov
2012
2:20:47
Constantino Leon-3
2:51:40
Ines Melchor (PER)
20 Nov
2011
2:23:15
Raul-Manuel
Pacheco Mendoza-4
Hortensia
Arzapalo-3
19 Sep
2010
2:21:02
Constantino
Leon-2
Hortensia
Arzapalo-2
15 Nov
2009
2:22:09
Raul-Manuel
Pacheco Mendoza-3
Hortensia Arzapalo (PER)
16 Nov
2008
2:26:36
Edmundo Torres (PER)
Wilma Arizapana (PER)
Constantino Leon (PER)
Jimena Misayauri-2
Raul-Manuel
Pacheco Mendoza-2
Jimena Misayauri (PER)
Paulino Canchanya (PER)
Julia Rivera (PER)
Miguel Mallqui-6
Julia Lopez (PER)
Raul-Manuel Pacheco
Mendoza (PER)
Sandra Ruales (ECU)
Miguel Mallqui-5
Justina Calizaya (BOL)
Miguel Mallqui-4
Carla Velázquez (BOL)
not
held ??
not
held ??


How do I use .htaccess directives on an Apache server to serve files with a specific encoding?
It is important to ensure that any information about character encoding sent by the server is correct, since information in the HTTP header overrides information in the document itself.
Many Apache servers are configured to send files using the ISO-8859-1 (Latin-1) encoding. In the examples in this FAQ, we'll assume that you want to serve your file or files using a different encoding than that specified in the default configuration. (For advice on choosing an encoding see Choosing & applying a character encoding.)
The following shows an example of an HTTP header that accompanies a file sent to a user agent. In this case the character encoding information is included in the Content-Type header on the second line from the bottom.
HTTP/1.1 200 OK Date: Wed, 05 Nov 2003 10:46:04 GMT Server: Apache/1.3.28 (Unix) PHP/4.2.3 Content-Location: CSS2-REC.en.html Vary: negotiate,accept-language,accept-charset TCN: choice P3P: policyref=http://www.w3.org/2001/05/P3P/p3p.xml Cache-Control: max-age=21600 Expires: Wed, 05 Nov 2003 16:46:04 GMT Last-Modified: Tue, 12 May 1998 22:18:49 GMT ETag: "3558cac9;36f99e2b" Accept-Ranges: bytes Content-Length: 10734 Connection: close Content-Type: text/html; charset=utf-8 Content-Language: en
In the example the Content-Type header expresses both the MIME type of the file and the character encoding. The MIME type describes the format of the file being served. HTML files are typically served as text/html. The character encoding (or 'charset') of this file is UTF-8.
To learn how to view the HTTP header for a file see the article Checking HTTP Headers.
Files on an Apache server may be served with a default character encoding declaration in the HTTP header that conflicts with the actual encoding of the file. The character encoding sent by the server may be the out-of-the-box default, a default set by the system administrator, or a result of implementing various Apache directives. In other cases no character encoding information is sent by the server when it is actually desired.
If the server is set up to allow users or administrators to change information in .htaccess files, these can provide a way to override default settings. This FAQ shows you how.
There are a couple of different scenarios to bear in mind. In the first instance, you may want to change the default for all the files in a directory with the same extension. Alternatively, you may want to change the default for a single file or small number of files. We will explore these in turn.
In our examples we will assume that the default server configuration serves files as ISO-8859-1, but that you want to serve your file or files using UTF-8 (a very sensible strategy!).
This article is written for content authors, rather than system administrators. Setting the server's default encoding is beyond the scope of this article.
This advice is only relevant if you are happy to declare the character encoding of your document via the HTTP header. In some cases you may not want that.
Note that this FAQ also assumes that your server is set up to use .htaccess files, and that the directives described below work in .htaccess files on your server. It is also assumed that it is not appropriate to simply change the default configuration of the server. If you are not sure, contact your server administrator.
You should also be aware of the conventions in use on your server for association of character encoding information with extensions. In some cases the server may be set up in the expectation that character encodings are indicated by encoding-specific extensions, eg. example.html.utf8 where it is the .utf8 that needs to be associated with a character encoding, rather than the .html (which may be associated with the file type).
If these approaches fail, you should consult the Apache manuals (see attached links) or your server administrator.
Use the AddCharset directive to associate the character encoding with all files having a particular extension in the current directory and its subdirectories. For example, to serve all files with the extension .html as UTF-8, open the .htaccess file in a plain text editor and type the following line:
AddCharset UTF-8 .html
The extension can be specified with or without a leading dot. You can add multiple extensions to the same line. This will still work if you have file names such as example.en.html or example.html.en.
The example will cause all files with the extension .html to be served as UTF-8. The HTTP Content-Type header will contain a line that ends with the 'charset' information as shown in the example that follows.
Content-Type: text/html; charset=UTF-8
Note: All files with this extension in all subdirectories of the current location will also be served as UTF-8. If, for some reason, you need to serve the odd file with a different encoding you will need to override this using additional directives.
Note: You can associate the character encoding with any extension attached to your file. For example, suppose you do language negotiation and you have pages in two languages that follow the model example.en.html and example.ja.html. Let's also suppose that you are happy to serve English pages using your server's ISO-8859-1 default, but want to serve Japanese files in UTF-8. To do this, you can associate the character encoding with the language extension, as follows:
AddCharset UTF-8 .ja
Take note, however, that, if you can, it might be a better solution to change the server default to UTF-8, or serve all files in new directories as UTF-8.
Note: It is also possible to achieve the same result using the AddType directive, although this declares both the character encoding and the MIME type at the same time. The decision as to which is most appropriate will depend in part on how you are using extensions for content negotiation. If you are using different extensions to express the document type and the character encoding, this is less likely to be appropriate.
AddType 'text/html; charset=UTF-8' html
Let's now assume that you want to serve only one file as UTF-8 in a large directory where all the other older files are correctly served as ISO-8859-1. The file you want to serve as UTF-8 is called example.html. Open the .htaccess file in a plain text editor and type the following:
<Files "example.html"> AddCharset UTF-8 .html </Files>
What we did here was wrap the directive discussed in the previous section in some markup that identifies the specific file we are concerned with. If you have the need, there is also a slightly different syntax that allows you to specify a number of file names using a regular expression.
Note: It is also possible to achieve the same result using the AddType directive shown above, or, in this case, the ForceType directive, although these declare both the character encoding and the MIME type at the same time.
<Files "example.html"> ForceType 'text/html; charset=UTF-8' </Files>
Note: Any files with the same name in a subdirectory of the current location will also be served as UTF-8, unless you create a counter directive in the relevant directory.
When two extension rules apply to the same document the order of extensions is important. Thus, in the following example
AddCharset UTF-8 .utf8 AddCharset windows-1252 .html
the file 'example.utf8.html' will be served as "windows-1252" and 'example.html.utf8' as UTF-8.
Apache version 1 .htaccess and allowOverride documentation
Apache version 2 .htaccess and allowOverride documentation
Tutorial – Handling character encodings in HTML and CSS
Related links – Setting up a server