#Building a text classifier in Mahout’s Spark Shell
This tutorial will take you through the steps used to train a Multinomial Naive Bayes model and create a text classifier based on that model using the mahout spark-shell
.
Prerequisites
This tutorial assumes that you have your Spark environment variables set for the mahout spark-shell
see: Playing with Mahout’s Shell. As well we assume that Mahout is running in cluster mode (i.e. with the MAHOUT_LOCAL
environment variable unset) as we’ll be reading and writing to HDFS.
Downloading and Vectorizing the Wikipedia dataset
As of Mahout v. 0.10.0, we are still reliant on the MapReduce versions of mahout seqwiki
and mahout seq2sparse
to extract and vectorize our text. A Spark implementation of seq2sparse is in the works for Mahout v. 0.11. However, to download the Wikipedia dataset, extract the bodies of the documentation, label each document and vectorize the text into TF-IDF vectors, we can simpmly run the wikipedia-classifier.sh example.
Please select a number to choose the corresponding task to run
1. CBayes (may require increased heap space on yarn)
2. BinaryCBayes
3. clean -- cleans up the work area in /tmp/mahout-work-wiki
Enter your choice :
Enter (2). This will download a large recent XML dump of the Wikipedia database, into a /tmp/mahout-work-wiki
directory, unzip it and place it into HDFS. It will run a MapReduce job to parse the wikipedia set, extracting and labeling only pages with category tags for [United States] and [United Kingdom] (~11600 documents). It will then run mahout seq2sparse
to convert the documents into TF-IDF vectors. The script will also a build and test a Naive Bayes model using MapReduce. When it is completed, you should see a confusion matrix on your screen. For this tutorial, we will ignore the MapReduce model, and build a new model using Spark based on the vectorized text output by seq2sparse
.
Getting Started
Launch the mahout spark-shell
. There is an example script: spark-document-classifier.mscala
(.mscala denotes a Mahout-Scala script which can be run similarly to an R script). We will be walking through this script for this tutorial but if you wanted to simply run the script, you could just issue the command:
mahout> :load /path/to/mahout/examples/bin/spark-document-classifier.mscala
For now, lets take the script apart piece by piece. You can cut and paste the following code blocks into the mahout spark-shell
.
Imports
Our Mahout Naive Bayes imports:
import org.apache.mahout.classifier.naivebayes._
import org.apache.mahout.classifier.stats._
import org.apache.mahout.nlp.tfidf._
Hadoop imports needed to read our dictionary:
import org.apache.hadoop.io.Text
import org.apache.hadoop.io.IntWritable
import org.apache.hadoop.io.LongWritable
Read in our full set from HDFS as vectorized by seq2sparse in classify-wikipedia.sh
val pathToData = "/tmp/mahout-work-wiki/"
val fullData = drmDfsRead(pathToData + "wikipediaVecs/tfidf-vectors")
Extract the category of each observation and aggregate those observations by category
val (labelIndex, aggregatedObservations) = SparkNaiveBayes.extractLabelsAndAggregateObservations(
fullData)
Build a Muitinomial Naive Bayes model and self test on the training set
val model = SparkNaiveBayes.train(aggregatedObservations, labelIndex, false)
val resAnalyzer = SparkNaiveBayes.test(model, fullData, false)
println(resAnalyzer)
printing the ResultAnalyzer
will display the confusion matrix.
Read in the dictionary and document frequency count from HDFS
val dictionary = sdc.sequenceFile(pathToData + "wikipediaVecs/dictionary.file-0",
classOf[Text],
classOf[IntWritable])
val documentFrequencyCount = sdc.sequenceFile(pathToData + "wikipediaVecs/df-count",
classOf[IntWritable],
classOf[LongWritable])
// setup the dictionary and document frequency count as maps
val dictionaryRDD = dictionary.map {
case (wKey, wVal) => wKey.asInstanceOf[Text]
.toString() -> wVal.get()
}
val documentFrequencyCountRDD = documentFrequencyCount.map {
case (wKey, wVal) => wKey.asInstanceOf[IntWritable]
.get() -> wVal.get()
}
val dictionaryMap = dictionaryRDD.collect.map(x => x._1.toString -> x._2.toInt).toMap
val dfCountMap = documentFrequencyCountRDD.collect.map(x => x._1.toInt -> x._2.toLong).toMap
Define a function to tokenize and vectorize new text using our current dictionary
For this simple example, our function vectorizeDocument(...)
will tokenize a new document into unigrams using native Java String methods and vectorize using our dictionary and document frequencies. You could also use a Lucene analyzer for bigrams, trigrams, etc., and integrate Apache Tika to extract text from different document types (PDF, PPT, XLS, etc.). Here, however we will keep it simple, stripping and tokenizing our text using regexs and native String methods.
def vectorizeDocument(document: String,
dictionaryMap: Map[String,Int],
dfMap: Map[Int,Long]): Vector = {
val wordCounts = document.replaceAll("[^\\p{L}\\p{Nd}]+", " ")
.toLowerCase
.split(" ")
.groupBy(identity)
.mapValues(_.length)
val vec = new RandomAccessSparseVector(dictionaryMap.size)
val totalDFSize = dfMap(-1)
val docSize = wordCounts.size
for (word <- wordCounts) {
val term = word._1
if (dictionaryMap.contains(term)) {
val tfidf: TermWeight = new TFIDF()
val termFreq = word._2
val dictIndex = dictionaryMap(term)
val docFreq = dfCountMap(dictIndex)
val currentTfIdf = tfidf.calculate(termFreq,
docFreq.toInt,
docSize,
totalDFSize.toInt)
vec.setQuick(dictIndex, currentTfIdf)
}
}
vec
}
Setup our classifier
val labelMap = model.labelIndex
val numLabels = model.numLabels
val reverseLabelMap = labelMap.map(x => x._2 -> x._1)
// instantiate the correct type of classifier
val classifier = model.isComplementary match {
case true => new ComplementaryNBClassifier(model)
case _ => new StandardNBClassifier(model)
}
Define an argmax function
The label with the highest score wins the classification for a given document.
def argmax(v: Vector): (Int, Double) = {
var bestIdx: Int = Integer.MIN_VALUE
var bestScore: Double = Integer.MIN_VALUE.asInstanceOf[Int].toDouble
for(i <- 0 until v.size) {
if(v(i) > bestScore){
bestScore = v(i)
bestIdx = i
}
}
(bestIdx, bestScore)
}
Define our TF(-IDF) vector classifier
def classifyDocument(clvec: Vector) : String = {
val cvec = classifier.classifyFull(clvec)
val (bestIdx, bestScore) = argmax(cvec)
reverseLabelMap(bestIdx)
}
Two sample news articles: United States Football and United Kingdom Football
// A random United States football article
// http://www.reuters.com/article/2015/01/28/us-nfl-superbowl-security-idUSKBN0L12JR20150128
val UStextToClassify = new String("(Reuters) - Super Bowl security officials acknowledge" +
" the NFL championship game represents a high profile target on a world stage but are" +
" unaware of any specific credible threats against Sunday's showcase. In advance of" +
" one of the world's biggest single day sporting events, Homeland Security Secretary" +
" Jeh Johnson was in Glendale on Wednesday to review security preparations and tour" +
" University of Phoenix Stadium where the Seattle Seahawks and New England Patriots" +
" will battle. Deadly shootings in Paris and arrest of suspects in Belgium, Greece and" +
" Germany heightened fears of more attacks around the world and social media accounts" +
" linked to Middle East militant groups have carried a number of threats to attack" +
" high-profile U.S. events. There is no specific credible threat, said Johnson, who" +
" has appointed a federal coordination team to work with local, state and federal" +
" agencies to ensure safety of fans, players and other workers associated with the" +
" Super Bowl. I'm confident we will have a safe and secure and successful event." +
" Sunday's game has been given a Special Event Assessment Rating (SEAR) 1 rating, the" +
" same as in previous years, except for the year after the Sept. 11, 2001 attacks, when" +
" a higher level was declared. But security will be tight and visible around Super" +
" Bowl-related events as well as during the game itself. All fans will pass through" +
" metal detectors and pat downs. Over 4,000 private security personnel will be deployed" +
" and the almost 3,000 member Phoenix police force will be on Super Bowl duty. Nuclear" +
" device sniffing teams will be deployed and a network of Bio-Watch detectors will be" +
" set up to provide a warning in the event of a biological attack. The Department of" +
" Homeland Security (DHS) said in a press release it had held special cyber-security" +
" and anti-sniper training sessions. A U.S. official said the Transportation Security" +
" Administration, which is responsible for screening airline passengers, will add" +
" screeners and checkpoint lanes at airports. Federal air marshals, behavior detection" +
" officers and dog teams will help to secure transportation systems in the area. We" +
" will be ramping it (security) up on Sunday, there is no doubt about that, said Federal"+
" Coordinator Matthew Allen, the DHS point of contact for planning and support. I have" +
" every confidence the public safety agencies that represented in the planning process" +
" are going to have their best and brightest out there this weekend and we will have" +
" a very safe Super Bowl.")
// A random United Kingdom football article
// http://www.reuters.com/article/2015/01/26/manchester-united-swissquote-idUSL6N0V52RZ20150126
val UKtextToClassify = new String("(Reuters) - Manchester United have signed a sponsorship" +
" deal with online financial trading company Swissquote, expanding the commercial" +
" partnerships that have helped to make the English club one of the richest teams in" +
" world soccer. United did not give a value for the deal, the club's first in the sector," +
" but said on Monday it was a multi-year agreement. The Premier League club, 20 times" +
" English champions, claim to have 659 million followers around the globe, making the" +
" United name attractive to major brands like Chevrolet cars and sportswear group Adidas." +
" Swissquote said the global deal would allow it to use United's popularity in Asia to" +
" help it meet its targets for expansion in China. Among benefits from the deal," +
" Swissquote's clients will have a chance to meet United players and get behind the scenes" +
" at the Old Trafford stadium. Swissquote is a Geneva-based online trading company that" +
" allows retail investors to buy and sell foreign exchange, equities, bonds and other asset" +
" classes. Like other retail FX brokers, Swissquote was left nursing losses on the Swiss" +
" franc after Switzerland's central bank stunned markets this month by abandoning its cap" +
" on the currency. The fallout from the abrupt move put rival and West Ham United shirt" +
" sponsor Alpari UK into administration. Swissquote itself was forced to book a 25 million" +
" Swiss francs ($28 million) provision for its clients who were left out of pocket" +
" following the franc's surge. United's ability to grow revenues off the pitch has made" +
" them the second richest club in the world behind Spain's Real Madrid, despite a" +
" downturn in their playing fortunes. United Managing Director Richard Arnold said" +
" there was still lots of scope for United to develop sponsorships in other areas of" +
" business. The last quoted statistics that we had showed that of the top 25 sponsorship" +
" categories, we were only active in 15 of those, Arnold told Reuters. I think there is a" +
" huge potential still for the club, and the other thing we have seen is there is very" +
" significant growth even within categories. United have endured a tricky transition" +
" following the retirement of manager Alex Ferguson in 2013, finishing seventh in the" +
" Premier League last season and missing out on a place in the lucrative Champions League." +
" ($1 = 0.8910 Swiss francs) (Writing by Neil Maidment, additional reporting by Jemima" +
" Kelly; editing by Keith Weir)")
Vectorize and classify our documents
val usVec = vectorizeDocument(UStextToClassify, dictionaryMap, dfCountMap)
val ukVec = vectorizeDocument(UKtextToClassify, dictionaryMap, dfCountMap)
println("Classifying the news article about superbowl security (united states)")
classifyDocument(usVec)
println("Classifying the news article about Manchester United (united kingdom)")
classifyDocument(ukVec)
Tie everything together in a new method to classify text
def classifyText(txt: String): String = {
val v = vectorizeDocument(txt, dictionaryMap, dfCountMap)
classifyDocument(v)
}
Now we can simply call our classifyText(…) method on any String
classifyText("Hello world from Queens")
classifyText("Hello world from London")
Model persistance
You can save the model to HDFS:
model.dfsWrite("/path/to/model")
And retrieve it with:
val model = NBModel.dfsRead("/path/to/model")
The trained model can now be embedded in an external application.


Two options are available here - you can either choose to leave the file
ownership as it is, or select a user and group who will be granted ownership
after saving. This option is most useful for newly created files.
If a file does not exist and this option is not set, when it is created
it will be owned by the user and group Webmin runs as (most likely
root and root).


| DOSE: |
1 line |
insufflated |
Cocaine |
(powder / crystals) |
Before I begin to talk about the actual cocaine experience it is important that I go over a few details of my life that have affected the way I view Cocaine. The main fact that I would like to bring up is that both my father and sister have become addicted to this drug.
The second fact that I would like to bring up is that since I was a little kid I have sworn to myself that I would never do Cocaine because of what I have seen it do to people.
The third fact that greatly affects my opinion of this drug is that, I have heard people rant and rave about cocaine being the best thing around and how it is better than sex.
Now for some minor background information on the day of the experience. I had just gotten off work with the intent to pick up some money that my ex-girlfriend owed me and then head to a party/BBQ at a friends house. I told the guy that was throwing the party that I would be there around 7 p.m., so I needed to hurry as I had just gotten off work at 6 p.m. I arrived at my ex's house and she proceeded to act apologetic for cheating on me and telling me it was a mistake.
She kept me going until 8:30 p.m. telling me she loved me and other bogus stuff. This made me mad and I arrived at the party not only late, but in foul spirits as well. I drank a bit and talked to my friend and apparently most of everyone was leaving to go to a show. I noticed people where chopping up cocaine on a nearby table and asked them about it, seeing as how it is one of the few drugs I haven't done.
They didn't really have the answers I wanted so I asked my friend what he thought; he said it was nothing spectacular. One of his friends overheard us and asked me if I wanted to try it. I didn't even think before saying yes, I felt if I'm supposed to put up with other peoples lapses in morality then I can at least have one of my own.
The guy cut up a couple large lines of coke and we each did one. I was drunk before doing this and immediately I felt sober. In fact I felt more sober than ever, not high: just really normal. There was a certain energy about it but not the jittery feeling one gets on Crystal Meth or Ephedra. My muscles felt relaxed and I felt more sociable and talkative. This was not the extreme sociability of MDMA, where you can't stop talking, but rather just a feeling that talking is easier. I started up conversations with people I normally wouldn't have but didn't feel like I could open up to them or that they were instantaneously friendly.
Bodily pain disappeared but again it was unlike the MDMA, where pain becomes pleasure, feeling. Instead of pleasure I just felt lack of pain. The bodily feeling were, contrary to what everyone says, not even close to as good as sex. Maybe I just have better sex than everyone but I just felt happy/sober not the wasted with pleasure feeling of sex or MDMA.
The only real uses I see for this drug is as an anesthetic (which is what it is used for in medicine) or to sober up really quick, maybe as a motivation enhancer too.
As an energy drug, Crystal Meth and Ephedra are stronger but cocaine is less obvious. I would draw a close parallel between cocaine and large amounts of caffeine, a stimulated but not intoxicated state. As far as spiritual/magickal uses go; cocaine may be useful as a tool for grounding but that is debatable.
While on Cocaine I tried a couple other common drugs to check for any synergistic effects. Cocaine flat out blocked the effects of alcohol. I didn't feel drunk no matter what I drank. Marijuana adds an interesting aspect to the experience.  However you still feel motivated and the talkative aspect of the cocaine is enhanced.  It also takes a lot more Pot to effect you when you are on Cocaine and you come down a lot quicker.
Other bad things about Coke include a hangover the next day, insomnia, and it's cost. While the hangover from coke is not horrible it is still obvious and annoying. I feel dizzy, mildly nauseous and I have a headache. Also, if you enjoy being able to fall asleep whenever you want then this is not the drug for you.
Finally, cocaine costs way too much and doesn't last long enough (three hours at the most).
The basic result of this experience was that I learned that Cocaine is not as good as people say. I don't think I will ever do it again because there are so many better drugs out there and many of them are legal. I also find the fact that it blocks the effects of other drugs to be annoying and highly limiting to its use as a tool for exploration. Even as a 'stay awake drug' it is limiting because it costs too much to be useful. One could pay fifty cents for enough Ephedra to cause the same stimulation as fifty dollars worth of cocaine. I really don't think it is worth it.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


TITLE 4. STATE ORGANIZATION AND
ADMINISTRATION, GENERALLY
Chapter
26 Executive and Administrative Departments
26H Hawaii Regulatory Licensing Reform Act
27 State Functions and Responsibilities
27C State Information Service
27G Access Hawaii Committee
28 Attorney General
29 Federal Aid
30 Gubernatorial Transition
CHAPTER 26
EXECUTIVE AND ADMINISTRATIVE DEPARTMENTS
Part I. Organization, Generally
Section
26-1 Office of the lieutenant governor
26-2 Order of succession to offices of governor and
lieutenant governor
26-3 Position of administrative director created
26-4 Structure of government
26-5 Department of human resources development
26-6 Department of accounting and general services
26-7 Department of the attorney general
26-8 Department of budget and finance
26-9 Department of commerce and consumer affairs
26-10 Department of taxation
26-11 University of Hawaii
26-12 Department of education
26-13 Department of health
26-14 Department of human services
26-14.5 Repealed
26-14.6 Department of public safety
26-15 Department of land and natural resources
26-16 Department of agriculture
26-17 Department of Hawaiian home lands
26-18 Department of business, economic development, and
tourism
26-19 Department of transportation
26-20 Department of labor and industrial relations
26-21 Department of defense
26-22 Transfer of functions
26-23 Assignment of functions
26-24 Agencies and offices abolished
26-25 Services to the judiciary and legislature
Part II. Other General Provisions
26-31 Selection and terms of single executives as heads of
departments
26-32 Acting heads of departments; appointment of;
responsibility for acts of
26-33 Performance of duties of vacant office
26-34 Selection and terms of members of boards and
commissions
26-35 Administrative supervision of boards and commissions
26-35.5 Members of boards and commissions; immunity from or
indemnification for civil liability; defense of
members
26-36 Acting members of boards
26-37 Substitutes for officials called into active service
26-38 Powers and duties of heads of departments
26-39 Department staffs
26-40 Repealed
26-41 Temporary boards and commissions
Part III. Salaries, Certain State Officers
26-51 Governor; lieutenant governor
26-52 Department heads and executive officers
26-53 Deputies or assistants to department heads
26-54 Administrative director of the State
26-55 Repealed
26-56 Commission on salaries
Note
Federal funding policy study by the department of budget and finance; 2018 reports to governor and legislature; governor's report to legislature (by January 1, 2019). L 2016, c 225; L 2017, c 178.
Cross References
Access Hawaii committee (management of State's internet portal), see chapter 27G.
Council, board, and commission members; training on native Hawaiian and Hawaiian traditional and customary rights, see chapter 10, part III.
Emergency management, see chapter 127A.
Uniform electronic transactions act, see chapter 489E.


Visibility
Number of times this span was scrolled into view: {{ scroll_counter }}
Call JavaScript
javascript_exclude states
{% for state in states %}
{{ state }}
{% endfor %}
Select2
States (in ignored div): {{ states }}
selected_state: {{ selected_state }}
States (not in ignored div): {{ states }}


Intro & Scratch
During the first week, we learned the fundamentals of computer science through the block programming language Scratch. The girls enjoyed how visual the programming language is. They built projects to introduce themselves to the other students. They created a maze, a choose your own adventure and a dance party!


Aubrey O’Day Spreads Legs In Black Teddy For New Instagram Pic From ‘Outer Space’
November 19, 2019
Aubrey O’Day Spreads Legs In Black Teddy For New Instagram Pic From ‘Outer Space’
Aubrey O’Day posted a brand new Instagram update today, and it showed her striking a sexy pose. She was seen spreading her legs, as she sat with her knees up and her toes pointed towards the ground. The singer wore a black teddy, which featured a triangular cut-out below her chest. It had thin straps and a low v-cut neckline, so her cleavage was on full display. The teddy also had textured accents throughout. In addition to the lingerie, Aubrey wore a silver jacket on top. It had extra-large and pronounced shoulders, along with sides that billowed down behind her. She maintained the symmetry of the shot by placing her hands on the sides of her knees.
The Danity Kane singer slicked her hair down in a middle part, and gave a sultry look. Her hair looked like she gelled it down.  Her lipstick was light pink and shimmery, while her eyeshadow was metallic silver. Her dark eyeliner also popped in the shot.
This update also had another dimension to it, which is that it was Photoshopped to make it appear as though Aubrey was straddling the moon. The backdrop was navy blue, with a white moon on the bottom. Above the Ex on the Beach star were yellow stars, along with white dots. It was animated with a video filter too, which made the backdrop appear to be sparkling. The geotag added to the theme, as she noted that it was taken in “OuterSpace.”
Fans left tons of compliments for the stunner in the comments section.
“Divine,” declared a follower.
“Hot hot hot hot,” raved an admirer.
“Love you to the moon and back My beautiful queen,” gushed a fan.
Loading...
“Hope those voices also tell you to release a second solo record!” exclaimed a fourth Instagram user, referring to her captions.
Aubrey’s latest album, Between Two Evils, was released in August 2013. So it has been a while since fans have been able to enjoy new tracks.
In addition, the singer shared a photo in mid-July that showed her spreading her legs. This time, she straddled a crown-shaped floatie while laying on her back. Aubrey wore a yellow bikini, as she played with the long straps with her hands. She glanced up at the camera with a sultry look. She used a filter that made it appear as though she was wearing a crown on her head. The bombshell completed her look with a pair of boots.


nodeJS-NPS_Survey
Create your own NPS survey
create
Survey created!
Sign up to receive random NPS surveys
send
Thanks for your collaboration!


+ HTML: Structure
+ CSS: Presentation
= Your Website
text
color
size
position
CSS consists of "style rules". Each style rule consists of a "selector" and "declarations" of property-value pairs.
selector {
property: values;
}
body {
color: white;
background-color: blue;
}
CSS can be embedded in HTML in several ways. One way is to include all CSS in a style
tag, usually inside the head
tag.
The selector is used to select which elements in the HTML page will be given the styles inside the curly braces.
Open your Codepen Basic HTML file codenpen.io,
or create a new one!
Use your HTML practice page and add the following styles outlined in this screenshot.
HINT: Useful color names are pink and darkblue.


You have a County Court Judgment (CCJ)
{{ partyName( 'claimant' ) }} requested a CCJ against you because you didn't respond to their money claim.
The CCJ says you owe {{ partyName( 'claimant' ) }} £1,500.
What this means
You can't dispute the claim while you have a CCJ against you.
If you want to dispute the claim you must first apply to cancel the CCJ. You'll have to explain why you didn't respond to the original claim.
A CCJ can make it harder to get credit, such as a mobile phone contract, credit card or mortgage.
If you don't pay
{{ partyName( 'claimant' ) }} can ask the court to:
- send bailiffs to your home or business to collect the money
- order your employer to take money out of your wages
- freeze assets or money in your account
- order you to use any money from property or land you sell to pay the debt
How we use and store your personal information
This claim contains personal information about you that {{ partyName( 'claimant' ) }} has provided, for example your name and address.
Find out about how we use and store your personal information.


Class: Aws::ECS::Types::PortMapping
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
::Aws::Structure ,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | gems/aws-sdk-ecs/lib/aws-sdk-ecs/types.rb |
Overview
Port mappings allow containers to access ports on the host container instance to send or receive traffic. Port mappings are specified as part of the container definition.
If you use containers in a task with the awsvpc
or host
network
mode, specify the exposed ports using containerPort
. The hostPort
can be left blank or it must be the same value as the containerPort
.
Most fields of this parameter (containerPort
, hostPort
,
protocol
) maps to PortBindings
in the Create a container
section of the Docker Remote API and the --publish
option to
docker run
. If the network mode of a task definition is set to
host
, host ports must either be undefined or match the container
port in the port mapping.
After a task reaches the RUNNING
status, manual and automatic host
and container port assignments are visible in the networkBindings
section of DescribeTasks API responses.
Constant Summary
Instance Attribute Summary
-
#app_protocol ⇒ String
rw
The application protocol that's used for the port mapping.
-
#container_port ⇒ Integer
rw
The port number on the container that's bound to the user-specified or automatically assigned host port.
-
#container_port_range ⇒ String
rw
The port number range on the container that's bound to the dynamically mapped host port range.
-
#host_port ⇒ Integer
rw
The port number on the container instance to reserve for your container.
-
#name ⇒ String
rw
The name that's used for the port mapping.
-
#protocol ⇒ String
rw
The protocol used for the port mapping.
Instance Method Summary
::Aws::Structure
- Included
| #to_hash | Alias for Structure#to_h. |
Instance Attribute Details
#app_protocol ⇒ String
(rw)
The application protocol that's used for the port mapping. This
parameter only applies to Service
Connect. We recommend that you set
this parameter to be consistent with the protocol that your
application uses. If you set this parameter, Amazon ECS adds
protocol-specific connection handling to the Service
Connect proxy.
If you set this parameter, Amazon ECS adds protocol-specific
telemetry in the Amazon ECS console and ::Aws::CloudWatch
.
If you don't set a value for this parameter, then TCP is used. However, Amazon ECS doesn't add protocol-specific telemetry for TCP.
Tasks that run in a namespace can use short names to connect to
services in the namespace. Tasks can connect to services across all
of the clusters in the namespace. Tasks connect through a managed
proxy container that collects logs and metrics for increased
visibility. Only the tasks that Amazon ECS services create are
supported with Service
Connect. For more information, see Service
Connect in the Amazon Elastic Container Service
Developer
Guide.
# File 'gems/aws-sdk-ecs/lib/aws-sdk-ecs/types.rb', line 7133
class PortMapping < Struct.new( :container_port, :host_port, :protocol, :name, :app_protocol, :container_port_range) SENSITIVE = [] include Aws::Structure end
#container_port ⇒ Integer
(rw)
The port number on the container that's bound to the user-specified or automatically assigned host port.
If you use containers in a task with the awsvpc
or host
network
mode, specify the exposed ports using containerPort
.
If you use containers in a task with the bridge
network mode and
you specify a container port and not a host port, your container
automatically receives a host port in the ephemeral port range. For
more information, see hostPort
. Port mappings that are
automatically assigned in this way do not count toward the 100
reserved ports limit of a container instance.
# File 'gems/aws-sdk-ecs/lib/aws-sdk-ecs/types.rb', line 7133
class PortMapping < Struct.new( :container_port, :host_port, :protocol, :name, :app_protocol, :container_port_range) SENSITIVE = [] include Aws::Structure end
#container_port_range ⇒ String
(rw)
The port number range on the container that's bound to the dynamically mapped host port range.
The following rules apply when you specify a containerPortRange
:
You must use either the
bridge
network mode or theawsvpc
network mode.This parameter is available for both the
::Aws::EC2
and Fargate launch types.This parameter is available for both the Linux and Windows operating systems.
The container instance must have at least version 1.67.0 of the container agent and at least version 1.67.0-1 of the
ecs-init
packageYou can specify a maximum of 100 port ranges per container.
You do not specify a
hostPortRange
. The value of thehostPortRange
is set as follows:- For containers in a task with the
awsvpc
network mode, thehostPort
is set to the same value as thecontainerPort
. This is a static mapping strategy. - For containers in a task with the
bridge
network mode, the Amazon ECS agent finds open host ports from the default ephemeral range and passes it to docker to bind them to the container ports.
- For containers in a task with the
The
containerPortRange
valid values are between 1 and 65535.A port can only be included in one port mapping per container.
You cannot specify overlapping port ranges.
The first port in the range must be less than last port in the range.
Docker recommends that you turn off the docker-proxy in the Docker daemon config file when you have a large number of ports.
For more information, see Issue #11185 on the Github website.
For information about how to turn off the docker-proxy in the Docker daemon config file, see Docker daemon in the Amazon ECS Developer Guide.
You can call DescribeTasks
to view the hostPortRange
which are the host ports that are bound to the container ports.
# File 'gems/aws-sdk-ecs/lib/aws-sdk-ecs/types.rb', line 7133
class PortMapping < Struct.new( :container_port, :host_port, :protocol, :name, :app_protocol, :container_port_range) SENSITIVE = [] include Aws::Structure end
#host_port ⇒ Integer
(rw)
The port number on the container instance to reserve for your container.
If you specify a containerPortRange
, leave this field empty and
the value of the hostPort
is set as follows:
For containers in a task with the
awsvpc
network mode, thehostPort
is set to the same value as thecontainerPort
. This is a static mapping strategy.For containers in a task with the
bridge
network mode, the Amazon ECS agent finds open ports on the host and automatically binds them to the container ports. This is a dynamic mapping strategy.
If you use containers in a task with the awsvpc
or host
network
mode, the hostPort
can either be left blank or set to the same
value as the containerPort
.
If you use containers in a task with the bridge
network mode, you
can specify a non-reserved host port for your container port
mapping, or you can omit the hostPort
(or set it to 0
) while
specifying a containerPort
and your container automatically
receives a port in the ephemeral port range for your container
instance operating system and Docker version.
The default ephemeral port range for Docker version 1.6.0 and later
is listed on the instance under
/proc/sys/net/ipv4/ip_local_port_range
. If this kernel parameter
is unavailable, the default ephemeral port range from 49153 through
65535 (Linux) or 49152 through 65535 (Windows) is used. Do not
attempt to specify a host port in the ephemeral port range as these
are reserved for automatic assignment. In general, ports below 32768
are outside of the ephemeral port range.
The default reserved ports are 22 for SSH, the Docker ports 2375 and
2376, and the Amazon ECS container agent ports 51678-51680. Any host
port that was previously specified in a running task is also
reserved while the task is running. That is, after a task stops, the
host port is released. The current reserved ports are displayed in
the remainingResources
of DescribeContainerInstances output.
A container instance can have up to 100 reserved ports at a time.
This number includes the default reserved ports. Automatically
assigned ports aren't included in the 100 reserved ports quota.
# File 'gems/aws-sdk-ecs/lib/aws-sdk-ecs/types.rb', line 7133
class PortMapping < Struct.new( :container_port, :host_port, :protocol, :name, :app_protocol, :container_port_range) SENSITIVE = [] include Aws::Structure end
#name ⇒ String
(rw)
The name that's used for the port mapping. This parameter only
applies to Service
Connect. This parameter is the name that you use
in the serviceConnectConfiguration
of a service. The name can
include up to 64 characters. The characters can include lowercase
letters, numbers, underscores (_), and hyphens (-). The name can't
start with a hyphen.
For more information, see Service Connect in the Amazon
Elastic Container Service
Developer Guide.
# File 'gems/aws-sdk-ecs/lib/aws-sdk-ecs/types.rb', line 7133
class PortMapping < Struct.new( :container_port, :host_port, :protocol, :name, :app_protocol, :container_port_range) SENSITIVE = [] include Aws::Structure end
#protocol ⇒ String
(rw)
The protocol used for the port mapping. Valid values are tcp
and
udp
. The default is tcp
.
# File 'gems/aws-sdk-ecs/lib/aws-sdk-ecs/types.rb', line 7133
class PortMapping < Struct.new( :container_port, :host_port, :protocol, :name, :app_protocol, :container_port_range) SENSITIVE = [] include Aws::Structure end


Plate/PCR-Plate Mapping
1. Click on Start
The complete process will only get saved to the database at the very end!
2. Scan the
of the PCR-Plate
3. Scan the
of the
{{ addedPlates.length + 1 }}.
Plate and place it into
{{ matrix.y[indices.y] }}{{ matrix.x[indices.x] }}
You must at least scan one and at most 4 plate(s) per PCR Plate.
Click on Done when you are done
early with the current PCR Plate.
4. Click on
Upload to database to finalize
the mapping
PCR Plate ID: {{ pcrPlateId }}
0" class="mt-2">
Added Plates
-
{{ el.plate.plate_id }}
{{ el.coordinate }}


'Jackie Brown'
A movie review by Walter Frith
Three in a row. 'Reservoir Dogs', 'Pulp Fiction' and now 'Jackie Brown'. An impressive string of films over five years for Quentin Tarantino who proves he's the director of his generation with 'Jackie Brown'. This is another examination of colourful, low-life characters in the big city (Tarantino likes the L.A. area) and the amount of violence is restrained and the innuendo the film uses is brilliantly amplified by its cast. A relatively small cast this time as well. Twelve actors and their characters were the focus of 'Pulp Fiction' and 'Jackie Brown' has half that number. John Travolta's first movie after 'Pulp Fiction' came out in 1994 was 'Get Shorty' in 1995 and that film was based on the novel by Elmore Leonard. I wonder if it's just a co-incidence that 'Jackie Brown', Tarantino's first film as a director since 'Pulp Fiction' is also based on an Elmore Leonard novel, this one entitled 'Rum Punch'.
Pam Grier, a 70's actress is resurrected in the same manner in which Tarantino brought back John Travolta probably hoping he could salvage another lost talent. I don't think this film will do as much for Pam Grier's career compared to what 'Pulp Fiction' did for John Travolta but she is a fascinating and strong protagonist who holds her own with the other actors.
Samuel L. Jackson is an illegal gun dealer with Robert De Niro is his sidekick and pseudo partner just released from prison. Bridget Fonda is Jackson's live-in girlfriend, Michael Keaton is an ATF (A lcohol, T obacco and F irearms) agent and Robert Forster has the film's most cleverly under played role as a bail bondsman helping Grier execute the perfect scam.
Grier is a flight attendant with a criminal past who now works for a bottom rate airline and she's caught in illegal trafficking before boarding by Keaton and another agent and has to make a deal to help catch Jackson. Jackson, meanwhile, is attempting to get a friend out of jail using Forster as his bail bondsman. Grier works out a scam to get rich, rid Jackson from her life as he is trying to kill her to prevent her from giving the police information about his business and she wants to walk away from the authorities free and clear all at the same time. It's a very complicated double cross which can't and for the purposes of spoiling the picture, won't be explained here.
As I'm sure you recall if you've seen the film, 'Pulp Fiction' used a brilliant patch of returning to previous story lines and didn't tell its story in total sequence. Tarantino does something similar in retracing a scene near the film's last half hour which shows many different ways the characters split and then divulges the consequences of their actions. I suppose this format of story telling will be Tarantino's trademark in the future.
I can't stress the point strongly enough that although parallels can be drawn between any two films just as they've been drawn in this review of 'Jackie Brown' to the points in 'Pulp Fiction', that it is only fair to judge any movie on its own merit and if you forget about 'Pulp Fiction' and relax and follow the trappings of 'Jackie Brown', it will be a much more satisfying experience.
The entire cast has just the right amount of spotlight to match their importance in the film's story line and Tarantino proves again that he has the perfect skill for making the most important part of any film, the script, crackle and vibrate with the most memorable dialogue written by anyone working in today's film industry.
OUT OF 5> * * * * *
Visit FILM FOLLOW-UP by Walter Frith
http://home.netinc.ca/~wfrith/movies.htm
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 by lukas on 17.01.17.
| Visibility | Name | Type | Description |
|---|---|---|---|
| private | k | none | |
| private | Td | none | |
| private | Ti | none | |
| private | dt | none | |
| private | lastInput | none | |
| private | sum | none | |
| private | up | none | |
| private | ui | none | |
| private | ud | none |
| Visibility | Name | Description |
|---|---|---|
| private | initValues(c): void | |
| public | PID(c, k, Ti, Td, dt) | |
| public | PID(c, k, Ti, Td) | |
| public | getTd(): null | |
| public | setKd(Td): void | |
| public | getDt(): null | |
| public | setDt(dt): void | |
| public | getKp(): null | |
| public | setKp(k): void | |
| public | getKi(): null | |
| public | setKi(Ti): void | |
| protected | runAlgorithmPIDController(e): null | |
| public | runAlgorithm(e): null |
| Name | Value |
|---|---|
| name | PID |
| stereotype | null |
| visibility | public |
| isAbstract | false |
| isFinalSpecialization | false |
| isLeaf | false |
| isActive | false |


|
Bullet Collision Detection & Physics Library
|
Public Member Functions | |
| GIM_STANDARD_ALLOCATOR () | |
| Public Member Functions inherited from btGenericPoolAllocator | |
| size_t | get_pool_capacity () |
| btGenericPoolAllocator (size_t pool_element_size, size_t pool_element_count) | |
| virtual | ~btGenericPoolAllocator () |
| *******************! btGenericPoolAllocator *******************!/// More... | |
| void * | allocate (size_t size_bytes) |
| Allocates memory in pool. More... | |
| bool | freeMemory (void *pointer) |
Additional Inherited Members | |
| Public Attributes inherited from btGenericPoolAllocator | |
| btGenericMemoryPool * | m_pools [BT_DEFAULT_MAX_POOLS] |
| size_t | m_pool_count |
| Protected Member Functions inherited from btGenericPoolAllocator | |
| btGenericMemoryPool * | push_new_pool () |
| void * | failback_alloc (size_t size_bytes) |
| bool | failback_free (void *pointer) |
| Protected Attributes inherited from btGenericPoolAllocator | |
| size_t | m_pool_element_size |
| size_t | m_pool_element_count |
Definition at line 238 of file btGenericPoolAllocator.cpp.
|
inline |
Definition at line 241 of file btGenericPoolAllocator.cpp.


-
identify parked document sap bkpf
Jay J Riley | Facebook
Jay J Riley is on Facebook. Join Facebook to connect with Jay J Riley and others you may know. Facebook gives people the power to share and makes the .
http://www.facebook.com/jayjriley
-
adam kuper and jenny kuper
Jay Riley - The Creig Northrop Team of Long & Foster Real Estate
Jay Riley at Northrop Team helps you to buy or sell your home by providing necessary tools,knowledge and service you need.
http://northropteam.com/agent-detail/69/Jay-Riley/
-
newborn baby picture in hospital
Jay Riley | Facebook
Join Facebook to connect with Jay Riley and others you may know. Facebook gives people the power to share and makes the world more open and connected.
http://www.facebook.com/ThepakRatt
-
water falls in georgia
Pair lead police to remains of Jay Riley
May 19, 2010 . Two people charged over the death of missing NSW man Jay Riley have . "They are devastated, obviously, by this news and even though they .
http://www.smh.com.au/nsw/pair-lead-police-to-remains-of-jay-riley-20100519-ve6c.html
-
shelton cal ripken tournament 2009
Current News, 1st Infantry Division and Fort Riley
Richard J. Seitz, as they filed into ... Full Story. Professionals, Soldiers compete in Halo tournament. Professional gamers compete against Fort Riley Soldiers in .
http://www.riley.army.mil/OurPost/currentnews.aspx
-
spongebob game help 8
Local exhibitors shine at livestock show - Grove Sun - Delaware ...
Feb 4, 2013 . kAmqC665 r92>A:@? y24<=J? sF?42? . kAma?5 #J=66 r2DH6== y2J c\wk^Am . Posted in News on Monday, February 4, 2013 12:03 pm.
http://grandlakenews.com/news/article_8432af45-914a-50fa-b235-28b4b90a05b2.html
-
copy dvd fails after 16 meg
J Riley phone, address, social profiles, news and web references at ...
Hundreds of public registries for J Riley listed as one easy to read report at Radaris.com.
http://radaris.com/p/J/Riley/
-
paintball gun shops in cornwall
JUICY J - .RILEY LYRICS
Jan 20, 2012 . Riley lyrics are performed by Juicy J Get the music video and song lyrics here. . Rihanna Is Spotify's Most-Streamed Female Artist. #NEWS .
http://www.metrolyrics.com/riley-lyrics-juicy-j.html
-
papers on povrty reduction in nigeria
Ronald J. Riley Sued By The Lawyer Who Copyrights Cease-And ...
Sep 8, 2008 . A few people have sent in the news that Ronald J. Riley is being sued by the Dozier Internet Law Firm. From Dozier's press release, the actual .
http://www.techdirt.com/articles/20080906/1437402185.shtml
-
ad blocker explorer internet
Juicy J - Riley - YouTube
May 23, 2012 . Juicy J - Riley. juicyjcomic·66 videos. SubscribeSubscribedUnsubscribe 57,129. 904,844. Like 3,438 Dislike 117. Like .
http://www.youtube.com/watch?v=ZjgreqGLbqc
-
democratic elements of colonial governments
Ron Riley NBA & ABA Stats | Basketball-Reference.com
News: s-r blog:Check Out Our College Basketball Site! Ron Riley. Ronald Jay Riley (Ron). Position: Forward ? Shoots: Right Height: 6-8 ? Weight: 195 lbs.
http://www.basketball-reference.com/players/r/rileyro01.html
-
boathouse restaurant breach inlet
Juicy J "Riley" [VIDEO] | Hip-Hop Wired
May 24, 2012 . The #1 Get High rapper, and Taylor Gang delegate, Juicy J drops off another viral video for his Riley record, featured on his Blue Dream & Lean mixtape. . minute daily news on your favorite rap and Hip-Hop artists like Jay-Z .
http://hiphopwired.com/2012/05/24/juicy-j-riley-video/
-
septic system drainfield design
NMIT Certificate in Engineering Trades - Jay Riley - YouTube
Sep 4, 2012 . 03 JAY RILEY.mp4. . NMIT Certificate in Engineering Trades - Jay Riley. NMITNZ·74 videos. Subscribe Subscribed Unsubscribe 27. 32 views .
http://www.youtube.com/watch?v=kW5qe394H68
-
suzanne beaudry recursive design
Greta man gets 14 years jail for murder - ABC News (Australian ...
Sep 22, 2011 . Photo: The family of murdered man Jay Riley outside Newcastle Court after his . News Ltd chief Kim Williams launches a stinging attack on the .
http://www.abc.net.au/news/2011-09-22/adam-john-thompson-gets-14-years-jail-for-killing-cardiff-man-j/2911842
-
papers on povrty reduction in nigeria
Jennifer J. Riley | Rubin, Glickman, Steinberg and Gifford, P.C. ...
Personal Injury FAQ. news. Criminal Defense FAQ. news. Family Law FAQ. blog. Personal . Associate Jennifer J. Riley joined the firm in 2009. She is licensed .
http://www.rgsglaw.com/Attorneys/Jennifer-J-Riley.shtml
-
nine south africa provinces
Delaware County hosts Share the Fun - Grove Sun - Delaware ...
Delaware County hosts Share the Fun - Grove Sun - Delaware County Journal: News: jay, riley dubois, entertainment_culture, audrey martin, delaware county .
http://grandlakenews.com/news/article_472c51f5-a942-59e8-b10b-3da8e87b7905.html?mode=image&photo=5
-
how to add my own ringtones
Police find body in search for Jay Riley - ABC News (Australian ...
May 19, 2010 . Two people have been charged over the alleged murder of Newcastle man Jay Riley.
http://www.abc.net.au/news/2010-05-19/police-find-body-in-search-for-jay-riley/832306
-
is hexametaphosphate in tooth paste
Liverpool FC juror Jay Riley: As good as the win against Swansea ...
Feb 21, 2013 . Liverpool FC juror Jay Riley: As good as the win against Swansea . Everton FC News: Sylvain Distin says Everton FC will not be driven by .
http://www.liverpoolecho.co.uk/sport/columnists/2013/02/21/liverpool-fc-juror-jay-riley-as-good-as-the-win-against-swansea-was-it-highlighted-how-frustrating-this-reds-team-are-100252-32850504/
-
vinyl siding corner guards
Riley Jay Interiors Ltd - The Sun Business Directory Online
Riley Jay Interiors Ltd, clowders road SE6 4DA. . This service is provided on News Group Newspapers' Standard Terms and Conditions in accordance with our .
http://directory.thesun.co.uk/13677823
-
customized windows boot cd
Mike Riley promotes Jay Locey, Trent Bray at Oregon State ... - SI.com
Jan 15, 2013 . CORVALLIS, Ore. (AP) -- Oregon State coach Mike Riley has promoted assistant head coach Jay Locey to chief of staff and graduate assistant .
http://sportsillustrated.cnn.com/college-football/news/20130115/mike-riley-promotes-locey-bray-oregon-state.ap/


Note: These plugins require the AutoXHR
and SPA
Plugins to be included in your build of Boomerang.
The Single Page Application (SPA) Plugins are designed to support Boomerang
in cases where SPAs are used on the page and therefore the page's
onload
event doesn't matter. In those cases Boomerang will
send Beacons when a route change
event appears.
Between the start and end of the route changes Boomerang will monitor the
DOM
for MutationObserver
events and XHR
requests. If those happen we will automatically assume that they are relevant
to the route change
event.
Note: It is not advisable to provide support for multiple SPA Plugins in the same boomerang build.
Note: If you are unsure if your version of a specific SPA is supported by the plugins presented here please refer to the compatibillity list below.
The code and examples described in this document apply for the following frameworks:
init()
Configuration
Each plugin requires to be either enabled or disabled in boomerang's init()
function of BoomerangJS. As mentioned above you should only compile one SPA plugin plus its depenedncies
into your Boomerang release. This avoids breaking Boomerang by running multiple SPA-plugins at the same time.
Called by the BOOMR.init() method to configure the SPA plugin. There is only one configurable option:
BOOMR.init({ // AngularJS Angular: { enabled: true } // Ember.js Ember: { enabled: true }, // Backbone.js Backbone: { enabled: true }, autorun: false, // Disable XHR instrumentation as this is auto-enabled by the SPA-plugins instrument_xhr: false });
NOTE:
It is advisable to tell Boomerang not to start automatically by setting the
autorun
flag to false
.
NOTE:
If you are not using a SPA-Framework but rely mostly on XMLHttpRequests to build your site, you can leave out the SPA plugin configuration and just enable instrument_xhr
to measure your site.
This should always return true
as EventListener
s
for MutationObserver
and route change
will trigger
independent to the onLoad
event.
Hook specific to the SPA. Please refer to the SPA-Framework specific documentation below on which parameters to fill this with
AngularJS
Configuration
For AngularJS it is necessary to hook Boomerang into the application
from the run
Callback.
In your AngularJS Application or module add this to the run()
callback:
// If boomerang is loaded to late to watch the first route change happen
// toggle hadRouteChange to true using the routeChangeStart callback.
// This will tell the plugin to fire a beacon immediately as it gets
// initialized and not wait for a routeChange event.
var hadRouteChange = false;
$rootScope.$on("$routeChangeStart", function() {
hadRouteChange = true;
});
function hookAngularBoomerang() {
if (window.BOOMR && BOOMR.version) {
if (BOOMR.plugins && BOOMR.plugins.Angular) {
// pass your $rootScope object and the aforementioned hadRoueChange variable to
// the hook to both make sure we are listening for route changes and check whether
// or not we we're on time
BOOMR.plugins.Angular.hook($rootScope, hadRouteChange);
}
return true;
}
}
// If we hooked in correctly we would return true if not we wait for the onBoomerangLoaded event
// to fire and try again as we can be sure then that Boomerang has arrived in the page
if (!hookAngularBoomerang()) {
if (document.addEventListener) {
document.addEventListener("onBoomerangLoaded", hookAngularBoomerang);
} else if (document.attachEvent) {
document.attachEvent("onpropertychange", function(e) {
e = e || window.event;
if (e && e.propertyName === "onBoomerangLoaded") {
hookAngularBoomerang();
}
});
}
}
Internally the AngularJS plugin will hook into the $routeChangeStart
event and set timers for when the request for the route change started. After
that — once the routeChange
has happend — the
MutationObserver
that has been set up will realize that
everything has been loaded, give itself another second to make sure it hasn't
missed any final changes and then send a beacon out.
Backbone.js
Configuration
For Backbone.js we need to be hooked into the application prior to the first
Backbone.history.start()
call in the application. Failing that
(eg. Boomerang was too late to initialize) a variable called
hadRouteChange
passed to the Backbone.js hook should be set to true
.
Given these rules you can add the following to your Router definition (Backbone.Router.extend({})
)
in the init()
function.
var hadRouteChange = false;
app.Router.on("route", function() {
hadRouteChange = true;
});
function hookBackboneBoomerang() {
if (window.BOOMR && BOOMR.version) {
if (BOOMR.plugins && BOOMR.plugins.Backbone) {
BOOMR.plugins.Backbone.hook(app.Router, hadRouteChange);
}
return true;
}
}
if (!hookBackboneBoomerang()) {
if (document.addEventListener) {
document.addEventListener("onBoomerangLoaded", hookBackboneBoomerang);
} else if (document.attachEvent) {
document.attachEvent("onpropertychange", function(e) {
e = e || window.event;
if (e && e.propertyName === "onBoomerangLoaded") {
hookBackboneBoomerang();
}
});
}
}
Ember.js
ConfigurationTo make Ember.js work with Boomerang it is necessary to pass the Application itself to the Boomerang plugin.
In your Ember.js Application add this to the route()
callback:
function hookEmberBoomerang() {
if (window.BOOMR && BOOMR.version) {
if (BOOMR.plugins && BOOMR.plugins.Ember) {
BOOMR.plugins.Ember.hook(App);
}
return true;
}
}
if (!hookEmberBoomerang()) {
if (document.addEventListener) {
document.addEventListener("onBoomerangLoaded", hookEmberBoomerang);
}
else if (document.attachEvent) {
document.attachEvent("onpropertychange", function(e) {
e = e || window.event;
if (e && e.propertyName === "onBoomerangLoaded") {
hookEmberBoomerang();
}
});
}
}
Just like the AngularJS/Backbone.js SPA plugin we intend to hook into the application
as early as possible. However the difference here lies in the point we
hook into. The Ember.js plugins hook()
function will either
reopen
the already set ApplicationRoute
or set
the Ember.js applications ApplicationRoute
by
extend()
ing the Ember.Route
Class.
We will hook into the applications activate
function and
willTransition
event.
If you use a SPA framework that isn't one of the above or want to write your own integration into your setup, we allow you to do so by using the underlying code used by the pre-built plugins to hook in.
BOOMR.plugins.SPA
APIis_complete()
is_complete
. It shoudl always return
true as it isn't bound to the normal boomerang lifecycle and does not have to complete for the classic onload beacon to fire.
init(config)
is_complete()
we have to implement init()
to configure the SPA plugin. Here we
configure the SPA plugins abillity to enable or disable AutoXHR on demand after the first route change
has happend.
register
Since there can be multiple SPA frameworks compiled into your version of boomerang
each SPA plugin should register itself by calling register
with the name of the plugin as a string argument.
This will make sure, that when you call BOOMR.init()
with the option to enable the SPA plugin of
your choice AutoXHR will acknowledge that and disable itself until re-enabled by the SPA plugin after the first
route change
has finished.
This means your SPA plugin should register itself early on in the evaluation of your plugins code. Even before defining the plugin itself. Here is an example:
(function(){
// If our plugin is already defined just skip re-evaluating.
// same goes for if BOOMR.plugins.SPA is not defined
if (BOOMR.plugins.MySPAPlugin || typeof BOOMR.plugins.SPA === "undefined") {
return;
}
// register as a SPA plugin
BOOMR.plugins.SPA.register("MySPAPlugin");
BOOMR.plugins.MySPAPlugin = {
/* Your SPA Code */
};
}());
supported_frameworks
hook(hadRouteChange)
Called by a SPA plugin once it has hooked into the framework of choice. The boolean argument hadRouteChange
is used to flag if Boomerang has loaded late or not. This will decide if AutoXHR will be enabled right away or only when the
first route_change
call has happend. hook
will set the flag http.initiator
to
spa
to flag that the next beacon comes from a SPA event.
route_change
As soon as the first route_change
event, triggered by the SPA, will be initiated this function should be called
enablinge listening for any DOM changes (using MutationObserver
) and XHR calls required to finish the route change.
This will make sure that all required assets for the route_change
have been fetched. Since this is a SPA event
AutoXHR
will wait an entire second for everything to settle.
last_location(url)
To make sure that the sent beacon at the end of the route_change
event will also contain the refferal URL
we came from, last_location
documents this URL to put into the beacon.
The SPA plugins were tested and used in production environments with the following versions of each SPA-Framework:
Compatible versions of each framework should work as intended.
As these plugins require AutoXHR and the availabilltiy of MutationObserver
it is advisable to
have a polyfill for browsers where the framework may be supported but MutationObserver
isn't. See
the MutationObserver
supported browser list.
If you are required to support browsers that don't support MutationObserver
, consider adding a polyfill.


Public API for tf.estimator.experimental namespace.
tf.compat.v2.estimator.experimental
class InMemoryEvaluatorHook
: Hook to run evaluation in training without a checkpoint.
class LinearSDCA
: Stochastic Dual Coordinate Ascent helper for linear estimators.
class RNNClassifier
: A classifier for TensorFlow RNN models.
class RNNEstimator
: An Estimator for TensorFlow RNN models with user-specified head.
build_raw_supervised_input_receiver_fn(...)
: Build a supervised_input_receiver_fn for raw features and labels.
call_logit_fn(...)
: Calls logit_fn (experimental).
make_early_stopping_hook(...)
: Creates early-stopping hook.
make_stop_at_checkpoint_step_hook(...)
: Creates a proper StopAtCheckpointStepHook based on chief status.
stop_if_higher_hook(...)
: Creates hook to stop if the given metric is higher than the threshold.
stop_if_lower_hook(...)
: Creates hook to stop if the given metric is lower than the threshold.
stop_if_no_decrease_hook(...)
: Creates hook to stop if metric does not decrease within given max steps.
stop_if_no_increase_hook(...)
: Creates hook to stop if metric does not increase within given max steps.


Graffins College, Westlands Road, off Mpaka Road
P.O. Box 13800 - 00800, Nairobi
Tel:<PHONE_NUMBER>, 3747129
CDMA:<PHONE_NUMBER>
Fax: 3746856
Note!
Do stop by our feedback form for your comments and suggestions.


maRketSim is a market simulator for R. It was initially designed around the bond market, with plans to expand to stocks. maRketSim is built around the idea of portfolios of fundamental objects. Therefore it is slow in its current incarnation, but allows you the flexibility of seeing exactly what is in your final results, since the objects are retained.
| Version: | 0.9.2 |
| Depends: | R (≥ 2.15.1) |
| Suggests: | taRifx, gsl |
| Published: | 2013-07-17 |
| Author: | Ari Friedman |
| Maintainer: | Ari Friedman <abfriedman at gmail.com> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | no |
| Citation: | maRketSim citation info |
| In views: | Finance |
| CRAN checks: | maRketSim results |
| Reference manual: | maRketSim.pdf |
| Package source: | maRketSim_0.9.2.tar.gz |
| Windows binaries: | r-devel: maRketSim_0.9.2.zip, r-release: maRketSim_0.9.2.zip, r-oldrel: maRketSim_0.9.2.zip |
| OS X binaries: | r-release: maRketSim_0.9.2.tgz, r-oldrel: maRketSim_0.9.2.tgz |
| Old sources: | maRketSim archive |
Please use the canonical form https://CRAN.R-project.org/package=maRketSim to link to this page.


| We believe that food tastes better when it comes from a sustainable farm, is picked by well-paid farmers and packed with plenty of TLC. So, that’s how we make our each of our Sorbet Pops. We think you can taste the difference. |
Our proprietary FreezFresh™ process
extracts the pulp of the acai after harvesting approximately 66% faster than processes used by similar companies. Ensuring the freshest acai and most nutrients arrive at
your door in record time. So fast, even our berries get jetlag. |
The abundance of essential vitamins and minerals makes this amazing super fruit a perfect addition to a ninja’s diet. Or yours. These vitamins and minerals naturally provide high levels of energy, strengthen muscles and help prevent anemia. |
| Acai contains omega-6 and omega-9 as well other properties that aid in balancing cholesterol levels, reducing bad cholesterol (LDL) and maintaining good cholesterol (HDL). Doing so prevents blood clots and other
cardiovascular problems. Ohm. |
Acai contains a high amount of antioxidants, including anthocyanin, which helps prevent many degenerative diseases and is a natural way to slow the body’s aging process. Sweet. |
|


Subhash Chandra resigns as Chairman of ZEE Entertainment Enterprises Limited
by Raj BaddhanSubhash Chandra has resigned as Chairman of ZEE Entertainment Enterprises Limited, with immediate effect.
In a filing with the Bombay Stock Exchange, the company said, “In light of the changes in shareholding, Mr. Subhash Chandra has expressed his intention to resign as Chairman of the Board with immediate effect. The Board accepted his resignation and noted that this is in line with the requirements of Regulation 17 (lB) of SEBI Listing Regulations, which inter alia mandates that the Chairperson of the Board shall not be related to the Managing Director or the Chief Executive Officer of the Company.”
Chandra will continue in the capacity of non-executive director of Essel Group.
Essel Group has been in the news of late over its finances. The company said it is planning to sell 16.5 per cent stake in its flagship brand, ZEEL to financial creditors to meet its loan repayment obligations. Earlier, the group had sold 11 per cent stake in ZEEL to Invesco-Oppenheimer fund for over Rs. 4,224 crore and then retired debt worth Rs. 4,000 crore.


Apt Pupil (1998)
Director: Bryan Singer Cast: Ian McKellen, Brad Renfro, Bruce Davison, Elias Koteas, Joe Morton, Jan Triska Screenplay: Brandon Boyce Producers: Jane Hamsher, Don Murphy, Bryan Singer Runtime: 111 min. US Distribution: TriStar Rated R: strong violence, language, brief sexuality
By Nathaniel R. Atcheson<EMAIL_ADDRESS>A story about people should have sympathetic characters.  These characters are well-drawn and created with charisma by the actors, but they're not nice people. In fact, they're both monsters in their own ways, and I think that this is the point of the film. But, by the end of the picture, I was left with a bad taste in my mouth: here is a story about a smart kid who acquires first-hand information about the Holocaust, and becomes a beast of a human being as a result.
What happened to the old-fashioned lessons, like "learn from your mistakes?" Or, perhaps, "learn from the mistakes of others?" Apt Pupil, though a riveting cinematic experience, is a deeply cynical look at human nature. I really can't say why without giving away the end, but I can say this: the only thing the characters learn from their mistakes are ways to escape consequences in the future. I wonder if this was Singer's purpose; his last film, The Usual Suspects, was also about bad people, but most of them had likable traits. The only people who win our sympathy in Apt Pupil end up emotionally scorned or brutally murdered.
The teenager's name is Todd Boden, and is played by Brad Renfro.   One month passes, and Todd finally knocks on the old man's door. His name, apparently, is Kurt Dussander (Ian McKellen), and Todd has a proposal for him.
He wants to know all about the Holocaust, about "the things they won't tell us in school." Why should Dussander tell him anything? Well, Todd has assembled pictures and fingerprints, and is giving him no choice: if he doesn't tell his stories, Todd will go to the police with his evidence. So Dussander agrees, and he tells Todd his stories. Every day, after school, Todd goes to Dussander's house, absorbing more and more of the truly awful stories that Dussander has to offer. Todd begins to falter in school, and soon the tides turn -- Dussander takes control of the situation.
It's an original premise, and a gripping film. Singer is a sharp director; his techniques are subtle -- scenes build tension without the use of intrusive music or intricate camerawork. But holocaust material isn't exactly audience-friendly; there are scenes here that seem to lack taste and judgement. There's a scene in which Todd is showering and imagining himself among Jews in a concentration camp; the men around him are sickly and thin, and while it's an effective image, it seems present more to manipulate than to inform. Singer doesn't approach the subject with care; in fact, the Holocaust really isn't under examination here. What's interesting is the dynamic between Todd and Dussander.
It's just too bad that both characters are so hateful. Dussander is supposed to an enigma, and, for a while, he is: at first, it seems that he believed that the experiments he was "forced" to perform were simply things that "needed to be done." Later, though, it's clear that he's lying: he enjoyed torturing the Jews. This is never spoken outright, but McKellen's performance -- which is one of the best this year -- is so darkly clever that it's impossible to miss Dussander's true feelings in the matter.
But Todd, played ambitiously by Renfro, is not a hero. He forces Dussander to tell his stories, blackmailing him with incriminating information. It's too soon to feel hatred for Dussander at this point, so Todd seems more malicious than founded in his demands. Later, Todd comes across as downright sadistic -- one of the film's most perplexing and most disturbing scenes has Todd forcing Dussander to put on a Nazi costume and march by his command. Singer films this segment with perfect harshness, but, by the end of it, Todd seems more psychotic than Dussander.
That's a crucial flaw when you're dealing with a story as intense as this. Only two characters win our affections by the end: the school guidance counselor (effectively portrayed by David Schwimmer), and a homeless man (Elias Koteas) willing to sell his body for a shower and a place to sleep. Without a place to send our emotions, Apt Pupil strikes as deeply unpleasant experience: a disturbing, completely engrossing film that makes you feel bad and doesn't manage to convey any solid message. It's a disappointment, really, given the talent involved. I don't recommend that you avoid the film -- no, it's too powerful to dismiss. Just be warned that Apt Pupil is meticulously unpleasant in almost every way, and I'm not sure why it needed to be.
**1/2 out of **** (6/10, C+)
Visit FILM PSYCHOSIS at http://www.pyramid.net/natesmovies
Nathaniel R. Atcheson
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


I've now built the emonGLCD, emonTx and emonbase kits, and have managed to run test and the site provided scripts which appeared to go in alright (except the emonbase), but the displayed value's are not relevant to my load i.e. my house load is currently 481W but the GLCD displays 2358W for load and appears to follow the generation value (going up and down along with the solar display).
For the emonGLCD I have put in the 'emonGLCD_solarPV_AutoTime_TempLog' script which all displayes on the screen, and it even shows the room temperature. The light sensor doesn't appear to do anything though.
For the emonTX I have put in the 'emonTx_CT123_Voltage' script which appears to have gone in alright as the green LED flashes and the GLCD does display value's. But the displayed value's have no bearing whatsoever to my current load kW. When I remove the solar CT (connected to CT1) the displayed value does drop to 0W but removing the consumer board CT (connected to CT2) then the value just stays in line with what is being generated. In the script, I did change the value for CT2 to a 1, and CT3 was left as 0. I also have the ac to ac power adaptor supplied via the shop.
For the emonbase, I cannot get any response i.e. lit LED's and when installing the 'NanodeRF_singleCT_RTCrelay_GLCDtemp' script the arduino program displays a message "avrdude: stk500_getsync(): not in sync: resp=0x00". I have tried different MAC value's but nothing appears to work.
The solar system I have is connected as Type 1, as per diagram here - http://openenergymonitor.org/emon/sites/default/files/PV%20monitor%20OEM%20compare.png
Then there is the temperature sensor which I've found reference to wiring it to the 3.5mm plug, but I've not sure what colour wire corresponds to gnd, vcc and date, as per - http://openenergymonitor.org/emon/buildingblocks/DS18B20-temperature-sensing . I'm sure this must be absolute basics, but I'm afraid I just don't know and have not managed to find any reference to this online.
I hope there is something simple I've missed in all of this as it has been quite a learning experience with never having used any of this sort of stuff before. Any help/pointers would be greatly appreciated.
Dennis
Re: Built monitoring kit, but displaying erratic value's.
Ok, a little further forward now.
emonTx - I realised I had put in the script for the Type 2 setup and had been using the ac - ac adaptor, but as I have a Type 1 setup I don't need it. I've now put in the correct script (emonTx_CT123) and it now displays the solar generation, but still no house demand (as it's dark I have temporarily swapped the solar for demand ct's just for indication). When I swap the ct's from solar to demand etc., I can transfer the kW readings on the emonGLCD.
So now for the house demand part. In the emonTx_CT123 script I have set the CT2 = 1 to enable the CT2 plug. Is there anything else I need to do? I have tried setting CT2 = 0 and CT3 = 1, bu this made no difference.
At least my emonGLCD appears to be functioning well.
I've still no external temperature sensor as I cannot find anywhere what part of the 3.5mm plug to solder the red, white & black wires. Can anybody help with this?
Thanks
Dennis
Re: Built monitoring kit, but displaying erratic value's.
That's me got the emonGLCD and emonTx sorted finally. I'm sure this stuff must be a doddle to most of you, but it has been causing real frustration for me - but I'm learning, and thats good (I think).
In the emonTx_CT123 script I downloaded, I had previously set the CT2 = 1. But I only then saw reference to CT1 for the calibration and print - I had no idea really what was going on but I had to take a chance and write a reference to CT2, as per below. And that sorted it as I now have demand and generation showing (generation substituted as it's).
Re: Built monitoring kit, but displaying erratic value's.
No wonder the emonbase appeared dead - I had soldered a short between the 22pF and 100nF capacitors right next to the FTDI plug. Thankfully now I've ran the NanodeRF_singleCT_RTCrelay_GLCDtemp script everything is appearing to work ok. When monitoring it with Arduino I can see it is talking to the emonGLCD and emonTx and receiving the current time, so it appears no damage has been done.
emoncms????
Dennis
Re: Built monitoring kit, but displaying erratic value's.
I've kinda lost track of this thread, does all seem to be working ok now? If so, good work!
Are there any bit of documentation information that you feel could be better presented? Feel free to correct, improve and add too the documentation this site is an open wiki. It's very hard to write good documentation for something if you know it well!


Meeting new people, computer programming, hiking, nature walks, learning something new everyday, mastering cooking recipes
A page that attempts to greet everyone in the world using different languages; uses HTML.
A page that attempts to bid everyone in the world farewell; uses HTML.
A page that shows one of my favorite desserts; uses HTML.
A page that shows the recipe for the "best" chocolate chip cookies with instructions on how to make them; uses HTML.
A page that showcases the Fyre Resort; uses HTML and CSS mark up language
A web page that shows a sample resume for John Doe; uses HTML and CSS mark up language.
Century 21 North Homes Realty, Inc. - Seattle WA
- Licensed in the state of Washington;
- Assess and determine clients' individual needs and offer property recommendations;
- Title and Escrow trained and certified.
Campos Lumber and Concrete Products - Baguio City, Philippines
- Listened to customer complaints and employee issues and acted to solve them in a timely and efficient manner;
- Analyzed and resolved invoice disputes;
- Handled inventory management, including product selection, managing stock levels, authorizing orders for restocking supplies, anticipating the demand for products, and loss control;
- Conducted daily audits to ensure the correctness of all transactions including company purchases and employee payrolls;
- Managed cash receipts including check payments, online bank transfers and the processing of funds.
Educare Learning School, Inc. - Baguio City, Philippines
- Made recommendations to improve utilization of school funds to promote the growth and improve the quality of education in an up-and-coming institution of learning;
- Composed and/or proofread faculty memoranda;
- Authorized cash disbursements to cover school expenditures;
- Managed cash receipts including check payments, online bank transfers and the processing of funds;
- Conducted monthly audits to ensure the correctness of the faculty payrolls.
Epicodus - Seattle WA
360 Training - online
University of the Cordilleras - Baguio City, Philippines
Saint Louis University - Baguio City, Philippines
University of Baguio Science High - Baguio City, Philippines
I was born and raised in the Philippines where I studied business management and law. I moved to Seattle two years ago to be with my husband. I decided to take up programming because of the fact that it is something that will never become stale. Just like the study of law where new laws are enacted and the most current jurisprudence are adapted, programming is always improving and changing. I'm loving it here in Epicodus so far and I hope to meet more people and have more wonderful learning experiences.
"All progress takes place outside the comfort zone."


| dir_exists {xfun} | R Documentation |
These are wrapper functions of utils::file_test()
to test the
existence of directories and files. Note that file_exists()
only tests
files but not directories, which is the main difference between
file.exists()
in base R. If you use are using the R version
3.2.0 or above, dir_exists()
is the same as dir.exists()
in base R.
dir_exists(x) file_exists(x)
x |
A vector of paths. |
A logical vector.


Voting
Voting system
Vote counting
Admin
Write your credentials and vote with your heart
Email:
Password:
Your chosen candidate:
{{candidate.name}}
Congratulations! you have successfuly voted


The What?
fQR Weave is a new generation of the well known quick responze (QR) standard. Using Arweave blockchain. fQR or Fingerprint QR, will be the best alternative of QR as an anti-counterfeit solution
QRs And Anti-Counterfeit:
Search the Internet for QR codes and authentication or counterfeiting keywords and you will get plenty of results, whether links to solution providers selling anti-counterfeiting solutions based on QR codes or announcements from brands having adopted QR codes to protect their products. Actually, “protecting their products” rather than “protecting their customers” may very well be the key element to understand and evaluate.
QR codes are widely adopted primarily because they are extremely cheap, and because of their visual aspect they give the feeling of something cryptic, hence secure. The production cost of a single code is basically zero, which may be one reason brands keep on adopting it even today. The problem being that the reproduction cost of such a code is also zero. When using 2D codes based on standards (ISO/IEC 18004), anyone can create the exact same codes and associate them with fake or counterfeited products, or generate codes that follow the exact same content logic as yours.
The replicated or fake code can lead the consumer to a fake website, or just replay real identities leading to the original company systems. The way “anti-counterfeiting” detection works, seen from the brand or its service provider’s side, is by detecting when the same identities (identifiers coded in the QR code) are replayed multiple times within suspicious time periods or geographic areas. This behavior would trigger an alert showing that there is a high probability your product or its identity has been counterfeited. However, it must be very clear that the consumer is not protected at all: it will take several identity replays until, as a brand, you realize something is wrong, which means there are always a number of your consumers buying a counterfeited good, thinking it was genuine because of its QR code, who will get a very bad product experience if not even a lethal one.
The solidity of the detection system is one where the solution providers don’t want to openly discuss about their detection algorithm to not make the counterfeiters’ life easier. This is called “security by obscurity” which following Wikipedia’s definition is a security system that “may have theoretical or actual security vulnerabilities, but its owners or designers believe that if the flaws are not known, then attackers will be unlikely to find them”. In other words, this may very well be called wishful thinking.
fQR... The Solution:
Instead of the traditional QR codes and their downsides, even those claiming that their algorithms can help fighting counterfeit, they still not fully trusted as long as their backend's algorithms and codes are not open source for the public.
fQR Weave is here for that reason, a transparent solution built over arweave.org blockchain, any user with a mobile, can verify the fQR on any product with the fQR Reader (open source)
Usually, product's metadata are printed or even "glued" on. Retailers, third-parties, and even shops can manipulate the informations with ease using several tricks. From the other side, QR codes are more often used to redirect its reader (with scanning) to a website, displaying a text, etc...
Here where fQR give comes with a better solution with the help of web3.0 and Arweave blockchain .
Each fQR 2D code will be unique with immutable data. With other words, every fQR is actually the ID of a arweave data transaction:
The standard QR code are similiar for every x product: that means all the chocolate bars share the same QR code. But with fQR, each chocolate bar will have its own "fingerprint", its own hash as the form of a QR code, and this feature, adds more complexility to duplicate a product's QR code.
Taking advantage from blockchain's core, each product owner should have an arweave wallet to generate his fQR codes. Hence, owner's wallet will be marked as verified wallet, which will help the customer to verify the legitimacy of the product by himself via fQR Reader. If anyone with arweave wallet tried to generate same fQR data in the intention to counterfeit, he will face those block:
-
it will not match any legit fQR as its form is different (hash: ID)
-
unability to generate fQRs from the verified wallet address
-
Each product has an unique fQR
-
unability to change immutable fQR's data
A Real Life example:
After the brief explanation about how fQR Weave works, let's explain how it can help in our daily life.
Almost everybody goes to the supermarket to buy the needs, and we often fall victims of store's cheating, specially small and unknow / personal owned markets. But with a product holding a fQR Weave, retailers cannot:
-
Change the exipry date
-
Sell offers (like buy 1 get 1 offer)
-
Change official market's price
-
Change country of origin
-
And more...


What does the term "eyeballs" really mean? A company that can deliver correctly will be able to evolve easily. We often reinvent dot-com customer-directed convergence. Our 60/60/24/7/365 performance and non-complex configuration is invariably considered unparalleled in the industry.
Think compelling. Think leading-edge. Think global. But don't think all three at the same time.
Corporate gibberish provided by the Corporate Gibberish Generator, with thanks.
This website began based on the materials on Free Code Camp, with offshoots and extras from other learning resources.
38e1e4be@opayq.com


This semester in Stat 385: Statistics Programming Methods I have learned a fair amount of technical skills. Although I entered this class fairly experienced with R, I have learned quite a few R techniques that I was unfimiliar with previously, as well as learning how to use Github and R blogdown.
Listed below are a few functions that before entering this course I had either only used sparingly or hadn’t used at all. I have thus far have learned a great deal about each of them eitehr through class or personal research.
In addition to these functions, I also have learned a great deal about vectorized coding. Before this class I had never actually intentionally attempted to code vectorized functions. I of course had done so a few times without really understanding what vectorized functions are, since this is the first time I had learned of them.
Below is an example of vectorized coding in action, question 1(c) on homework 3. The first chunk of code is the original function, and the second chunk is my vectorized function. As you can see, the vectorized function provides the same result in addition to being shorter both in code as well as run time.
Original function:
roulette_loop <- function(many_bets) {
# randomly decide whether you lose or win on each bet
win_lose_random <- sample(x = c(TRUE, FALSE), size = length(many_bets),
replace = TRUE)
total_prize <- c()
# for each bet
for (i in 1:length(many_bets)) {
bet <- many_bets[i]
prize <- 0
# if we win, then check how much the prize is
if (win_lose_random[i]) {
if (bet == 'low') {
prize <- 10
} else if (bet == 'high'){
prize <- 10
} else if (bet == 'red') {
prize <- 20
} else if (bet == "black") {
prize <- 20
} else if (bet == "odd") {
prize <- 15
} else if (bet == "even") {
prize <- 15
} else if (bet == "first") {
prize <- 50
} else if (bet == "second") {
prize <- 50
} else if (bet == "third") {
prize <- 50
}
}
# add prize from this bet to the total prize
total_prize <- c(total_prize, prize)
}
total_prize
}
set.seed(385)
roulette_loop(many_bets = c("red", "black", "low", "high"))
## [1] 0 0 10 0
long_vec <- rep(c("red", "black", "low", "high", "second", "first", "third",
"odd", "even"), 10000)
system.time(roulette_loop(many_bets = long_vec))
## user system elapsed
## 17.53 0.89 19.34
Vectorized function:
roulette_vec <- function(many_bets){
result <- c()
win_lose_random <- sample(x = c(TRUE, FALSE), size = length(many_bets),
replace = TRUE)
result[many_bets == 'low' | many_bets == 'high' ] <- 10
result[many_bets == 'red' | many_bets == 'black' ] <- 20
result[many_bets == 'odd' | many_bets == 'even' ] <- 15
result[many_bets == 'first' | many_bets == 'second' | many_bets == 'third' ] <- 50
result[win_lose_random == FALSE] <- 0
return(result)
}
set.seed(385)
roulette_vec(many_bets = c("red", "black", "low", "high"))
## [1] 0 0 10 0
long_vec <- rep(c("red", "black", "low", "high", "second", "first", "third",
"odd", "even"), 10000)
system.time(roulette_vec(many_bets = long_vec))
## user system elapsed
## 0.03 0.00 0.03
Before this semester I had never used Github, and now thanks to STAT385 I have the skills needed to become comfortable with the platform. I have learned how to create repositories, clone respositories to my machine, stage commits, and pull and push files. I also learned how to use Github through Rstudio, where I find it much easier to work on projects compared to interacting with Github through the terminal or Github Bash.
R blogdown is probably one of the more difficult and interesting aspect of R that I have learned up to this date. Our midterm project for STAT 385 was to create a website (the one you’re on right now!) using R blogdown and Github. I have no prior experience with building websites, so I knew this was going to be a bit tricky for me. After countless hours of editing and moving files, completely breaking my entire project and having to restart mutliple times, and countless YouTube tutorial videos, I feel as if I have a solid grasp on R blogdown. It was a tough process, but I’m so happy with the outcome.


Queries in Ebean
Autofetch - Automatic query tuning
Ebean can automatically tune your queries for you using a feature called "Autofetch".
This has the benefit of executing better performing queries that and reduced lazy loading.
example
// ----
// a program that fetches some orders ... and processes them
// ----
// fetch new orders
List<Order> orders =
Ebean.find(Order.class)
.where().eq("status", Order.Status.NEW)
.findList();
// just read the orderDate
for (Order order : orders) {
Date orderDate = order.getOrderDate();
}
Initially Ebean has no "profiling" information so when the program is first run
the query executed is not optimal.
<sql summary='[app.data.test.Order]'>
select o.id, o.order_date, o.ship_date, o.cretime, o.updtime, o.status_code, o.customer_id
from or_order o
where o.status_code = ?
<sql>
However, now that we have run the program once Ebean has collected some profiling information.
Specifically it knows that for this query (based on the call stack) the program only reads the
orderDate. So when we run the program a 2nd time...
<sql summary='[app.data.test.Order] autoFetchTuned[true]'>
select o.id, o.order_date, o.updtime
from or_order o
where o.status_code = ?
<sql>
You will note the autoFetchTuned[true] on the output. This indicates that this query was
tuned via Autofetch. In this case, the profiling indicated that only the orderDate property
was used so that, along with the Id property and the version column are the only properties
fetched.
example
Now lets change the program. We will use another property of order and we will also get the
customers name.
List<Order> orders =
Ebean.find(Order.class)
.where().eq("status", Order.Status.NEW)
.findList();
for (Order order : orders) {
Date orderDate = order.getOrderDate();
// also get the ship date
Date shipDate = order.getShipDate();
// ... and get the customer name
Customer customer = order.getCustomer();
String customerName = customer.getName();
}
The query Ebean will run is optimised for what the program USED to do. This results
in some lazy loading occuring. The rest of the order is lazy loaded when the shipDate
is read... and then the customer is lazy loaded when the customer name is read.
<sql summary='[app.data.test.Order] autoFetchTuned[true]'>
select o.id, o.order_date, o.updtime
from or_order o
where o.status_code = ?
</sql>
-- LAZY LOADING: ... due to reading shipDate
<sql summary='[app.data.test.Order]'>
select o.id, o.order_date, o.ship_date, o.cretime, o.updtime, o.status_code, o.customer_id
from or_order o
where o.id = ?
</sql>
-- LAZY LOADING: ... due to reading customers name
<sql summary='[app.data.test.Customer]'>
select c.id, c.name, c.cretime, c.updtime, c.billing_address_id, c.status_code, c.shipping_address_id
from or_customer c
where c.id = ?
<sql>
So the above queries are not so good. However, Ebean has now updated its profiling information so when
we run the program again...
<sql summary='[app.data.test.Order, customer] autoFetchTuned[true]'>
select o.id, o.order_date, o.updtime, o.ship_date
, c.id, c.name, c.updtime
from or_order o
join or_customer c on o.customer_id = c.id
where o.status_code = ?
<sql>
... now Ebean has added the shipDate and a join to customer fetching the customer name.
So, if you turn on autoFetch Ebean can optimise your queries based on how the object graphs
are actually used by the application. The developer has less work by not having to define
joins and you get the performance benefits of partial objects with no work - nice.
Autofetch can continue to update its profiling information so that when your application changes
the queries will automatically be tuned to suit.


Hello from another comonent
Counter value:
0
+1
This is footer
This is header
This is content
This is menu


{{ project.description }}
Technologies: {{ project.technologies }}
{{ project.description }}
Technologies: {{ project.technologies }}
I was born and raised in Washington DC. I attended UVA from 2007-2011 and obtained a B.S. in Systems & Information Engineering. After college I went to work for The Health Management Academy, an executive-focused health care consulting company based in Alexandria, VA. My career there began as a research analyst, working mostly on compiling and analyzing our company's survey data. Over time I worked on a number of technology projects, including implementing the company’s first CRM and mobile application. I was also part of a two-man team that in two months’ time was able to stand up a Wordpress app that was used by top executives of the largest health systems in the country. Our team saved the company an estimated $85k by taking on the full implementation work, and by using open source technology to build our platform. I eventually was promoted to be the IT Systems Manager, and was the primary admin for all of our company’s SaaS platforms, including our Oracle CRM and Eloqua marketing platform.
Wanting to improve my technical prowess, I decided to attend General Assembly's part-time Back End Web Development course at their DC campus. It gave me a taste of what it is like to develop a web application from the ground up. I loved being able to have control over all aspects of an application, from the layouts and UI to the routing and database relationships.
This exposure to app development ignited a real spark of interest in me, and after about a year of self-taught and on-the-job training, I moved out to San Francisco to enroll in a 12-week Web Development Immersive program at General Assembly, where I strengthened my programming skills by learning how to use the latest web development frameworks and tools in the industry. I have a particular interest in front-end Javascript frameworks like Angular and React, working on real-time data problems, and doing data modeling and visualization. I'm excited to continue learning as I search for jobs that will test my skills and push me to become the best programmer I can be.
In my free time I love to hike, see live music, and tinker with Arduino kits and my 3D printer.


How to Get Started Writing Tests With Minitest
Testing let’s you check on the health of your code, making sure it’s performing well. Photo by Jeff Werner
Up until today, all of my project work at Flatiron has been focused on writing application code. Today, I started learning about how to write the companion test suites. It’s a bit intimidating, so here’s how to get started.
Why Testing is Important
Writing test suites is important because it helps ensure that your program does what you think it does. Your tests define your expectations for your program. When you run your test suite, your tests should pass if your program’s behavior matches these expectations, and fail if the reality is different.
Testing becomes very powerful once you start coding using a test driven development approach. Rather than writing tests for your existing code, you write your tests before anything else. Define the expected behavior in the test, and then write the necessary code to get the test to pass. Once, the test is passing, refactor your code to remove repetition and improve code reability. As you continue to build a large collection of tests, your full test suite should warn you if new code starts to cause bugs somewhere else. These early warning flags help keep your code stable and minimize bugs.
What is Minitest?
Minitest is a lightweight testing library for Ruby. Minitest used to be a separate gem, but as of Ruby 1.9 it’s a part of the standard library that comes with Ruby. Require the library in any Ruby file and it adds all kinds of methods that make writing tests easier.
How to get started writing tests with Minitest?
For example, let’s say I’m writing a Flashcard class for an application for studying Spanish. Before writing any part of the Flashcard class, I’ll want to create tests for how I expect the Flashcard class to behave.
I’ll first create a file for my test suite, test.rb
. Within this file, I’ll want to make sure that the Minitest library is loaded before the tests are run. This is done by requiring the library:
require 'minitest/spec'
require 'minitest/autorun'
We’ll also want to load the file that will contain the code we’re testing. In the same directory, let’s say flashcard.rb
is where I’m going to start writing the class definition. I’ll load it in through the require relative method:
require_relative 'flashcard.rb'
Now, I’ll write my tests. I should write tests for every expected behavior for the class. How do I write a test?
describe Flashcard do
end
Step 1: Use Mintest’s describe method to create a block where all your tests relating to the Flashcard class will go. All your tests will go between the do
and the end
keywords.
describe Flashcard do
it "can create an instance of the Flashcard class" do
end
end
Step 2: Use the it method and pass in a string that describes the expected behavior. This will be the text that is printed when the test is failing to help you identify which functionality of your code is not behaving correctly. Be sure to pick a good name.
describe Flashcard do
it "can create an instance of the Flashcard class" do
flashcard = Flashcard.new
end
end
Step 3: Set up what needs to be in place before you make an assertion about the test. In this case, I’m testing whether I can create an instance of the Flashcard class, so I’ll want to set the stage by creating an instance.
describe Flashcard do
it "can create an instance of the Flashcard class" do
flashcard = Flashcard.new
flashcard.must_be_instance_of Flashcard
end
end
Step 4: Write an assertion about the expected behavior. Minitest has easy to understand methods such as must_be_instance_of
that determine whether your test passed (whether the assertion is true), or failed (assertion returned false).
Continue to write out all your expectations, until you have a sizeable list. Here are some example tests, you’ll probably have more tests than this, but note that there are tests are very basic stuff like whether the class even exists, up to whether the class adds a card into a user’s favorites.
describe Flashcard do
it "can create an instance of the Flashcard class" do
flashcard = Flashcard.new
flashcard.must_be_instance_of Flashcard
end
it "has a word attribute" do
flashcard = Flashcard.new
flashcard.word = "hola"
flashcard.word.must_be == "hola"
end
it "should respond to add_to_favorites method" do
flashcard = Flashcard.new
flashcard.must_respond_to add_to_favorites
end
it "should add favorite cards to a user's favorites" do
#TODO: write test once I figure out user class spec
end
end
I run the tests by running the test file through Terminal: ruby test.rb
. This is where a testing tool like Minitest comes in handy. The test file will print to the terminal any errors and whether the code from flashcard.rb
passes the test. If it doesn’t pass, Minitest will print the actual value and the expected value that were inputted into that test’s assertion. When I run the above test suite, the first error I receive is:
/Users/josh/Desktop/test.rb:6:in <main>': uninitialized constant Flashcard (NameError)`
My suite describes a class Flashcard, but Ruby can’t find the class. In accordance with a test driven approach, I now add code into flashcard.rb
, but only enough to get rid of that first error. In this case, all I need to do is define the class in flashcard.rb
:
class Flashcard
end
Now if I run test.rb
again, I get the following:
Run options: --seed 19557
# Running tests:
.EE.
Finished tests in 0.001041s, 3842.4592 tests/s, 960.6148 assertions/s.
1) Error:
test_0003_should_respond_to_add_to_favorites_method(Flashcard):
NameError: undefined local variable or method `add_to_favorites' for #<#<Class:0x007f9e8c0c65e8>:0x007f9e8c062a70>
test.rb:21:in `block (2 levels) in <main>'
2) Error:
test_0002_has_a_word_attribute(Flashcard):
NoMethodError: undefined method `word=' for #<Flashcard:0x007f9e8c061be8>
test.rb:15:in `block (2 levels) in <main>'
4 tests, 1 assertions, 0 failures, 2 errors, 0 skips
As you can see, Minitest creates a nicely formatted results output for you. Your next step is to tackle fixing the next failing test. What’s great about writing these tests is that it forces you to explicitly define what your application should do before you write the code. Sometimes, writing tests for one class will help you figure out what other classes you need. For example on the last test, I want to add cards to a user’s favorites. Obviously, I’ll need to now write tests for a User class, and then also eventually make some design decisions on how cards are added to a user.
Tests make you break the problem down into the smallest possible chunks, keep you focused on one small problem at a time, and help prevent feature creep and getting sidetracked. Plus, there’s an addictive reward you feel when you get a test to pass, even if it’s super basic, that’ll keep you motivated.
Comments


Check the JS console, this one works using JS-signals 0.7.4, have a look at my
other version of this using 0.8
.


What I am doing:
Currently Day Trading on the weekdays
Currently working on Android Apps on the weekends
Currently volunteering at the Mount Carmelo Catholic School as an IT Technician
Past Experience:
IT Technician at SmartSource Inc.
Volunteered at NYU Alternate Breaks in Florence, Italy
Lambda Chi Alpha member
Worked on a top priority program at UBS as an intern
Accepted to NYU Tandon School of Engineering
CUNY CSI Student Government Sophomore Senator
Worked as an IT Technician intern at P.S 44
Volunteered at the St. Mary's Assumption Church
Valordictorian at P.S. 20