The answer is obvious, absolutely not. When the spotlight shines on machine learning, graph theory is rarely mentioned. First, let's talk about what this project is and later you would realize why sometimes graph theory works better. In this case, graph theory outperforms machine learning in both time and space complexity.
The generation of the word cloud below is done in this script.
This project is designed to be integrated into my scraping script called MENA Newsletter. Initially, the script would scrape news titles from different mainstream websites (so-called fake news by Mr. Trump 😂 ) including BBC, Reuters, Al Jazeera, etc. All the scraped news titles, links and preview images would be concatenated into one HTML email which is automatically sent to my inbox every morning. After a couple of days of experiments, I realized that many websites were actually reporting the same story but in different titles and preview images. It was totally a waste of energy and time to read these similar contents over and over again. And not every piece of information was worth my time to read. Some stories such as 'British Iranian woman got put in jail' was not exactly business related (I'm sorry, it is a great story though). Couldn't I find a way to create a filter to extract the key information?
The first thing came to my mind, of course to anyone, was machine learning. Given the halo around it, we can hardly be blamed. We could build up a classifier to determine which one is key information. A simple Naive Bayes Multivariate Event Model would do the trick. The methodology is basically based on the assumption that when certain key words such as 'crude', 'south pars' and 'LNG' appear together in a title, the title is more likely to be petroleum business related. The model works pretty well for key information screening. The accuracy is always capped at 75 percent. It can be improved by building up a better vocabulary matrix. The downside of the method is the human input. The metadata needs to be manually classified before feeding to the machines. The labor intensity is always the issue of supervised learning.
Still, that doesn’t solve the problem of similar contents with different titles. You may argue we could build up a two-dimensional dataframe with the length of n(n-1)/2 assuming n is how many titles we have scraped. The purpose is to compare all the titles mano-a-mano to check if they refer to the same story. Surely, we could. Support Vector Machine or Random Forrest or any other supervised learning classifiers can remove the similar contents and extract the key information. All of a sudden, the time and space complexity shoot through the roof. Additionally, the hassle of training metadata just gets doubled.
That is not the dead end. Alternatively, we can do an unsupervised learning. How so? Assuming a piece of story is a breaking news, it is so important that every mainstream media would cover it. Maybe different media websites cover the story from different perspectives in relatively different titles. The script called MENA newsletter scrapes a lot of major websites. There must be some overlaps of the stories. Within each story, the titles from different sources should share at least one key word in common. The common key word could be location, event or even name. For example, we have the following titles, 'Airstrike on Yemen school bus is apparent war crime' from CNN, 'UN accuses Saudi coalition of war crimes in Yemen' from Financial Times and 'Mistakes admitted in Yemen bus attack' from BBC. These titles are connected by the common words 'school bus' and 'war crime' ('yemen' is a stop word so excluded). The content 'yemen bus attack is a war crime' exists in every media website under different titles. Apparently, these similar contents should be able to form a cluster.
Yet, there is another problem, how can we compare word 'walking' with word 'walked'? Well, in that sense, we need stemming and lemmatization. Stemming is to revert a word back to its root. Currently NLTK is the most popular NLP package. The famous Porter stemmer is not very effective, as it's a rule-based stemmer. English, unlike its neighbor language Français, has messy vocabulary rules. Because many phrases are stolen from other foreign languages. Keeping a dictionary-based stemmer would require a lot of space. Hence, we would have to cope with the imperfection, which basically means chopping off the end of a word. Lemmatization is to normalize a word back to its base form. It removes all past simple and past participle forms. Wordnet lemmatizer is a relatively better tool than Porter stemmer, even though they both have their shortcomings. In general, I prefer to apply lemmatization before stemming to get a clean vocabulary matrix.
If our assumption holds, we could end up with plenty of clusters inside our text dataset. Each cluster refers to one underlying story. Within each cluster, all the data points (titles) share some common words. Inevitably, there are anomaly data points far from all the cluster. These outliers could be either exclusive content or utterly nonsense. How to deal with them entirely depends on user preference. I personally lean towards false positive. I’d rather have more false positive than false negative for the fear of missing out.
Thus, we shall dig out all the unique stories. We only need a little bit of extra help from the overhyped algorithms, DBSCAN. DBSCAN is a fascinating algorithm. It has the capability of both linear and non-linear classification. It can automatically detect the number of clusters, but it requires a careful tuning of its within-distance parameter, ε. The way I see, this is purely quid pro quod. You can argue OPTICS do not require preset within-distance, but the tradeoff is the greater time complexity (truth is I haven’t updated my sklearn yet 😅 ). Aside from ε, there is another preset parameter, the minimum sample requirement to construct a cluster. As usual, we always consider the worst case, which is 2. For a clustering problem, the maximum number of clusters you can achieve is n//2 where n is the number of data points.
Hereafter, we seek a conventional way to determine the ideal epsilon, K Nearest Neighbors. By using knee method, the optimal ε should occur before the biggest surge on 2-NN distance. Unfortunately, we cannot see where the kneecap is in the following figure. We can only tell the number is respectively 2.24 judging by perpendicular distance.
To be honest, the result of DBSCAN comes as a surprise. There are only 3 different labels. If we take a quick scan at the text data, we could certainly identify more than 3 important stories. The frustrating result left us no choice but to pick a naïve unsupervised learning algorithm, K means. Don’t get me wrong, K means is a simple but powerful tool. It is fast and intuitive regardless of its linear boundary. The only fuss is to find the optimal number of clusters. There are a few empirical approaches. In order to keep things consistent with DBSCAN, the elbow method is applied here.
The number of clusters from K means is 14 which sounds more appropriate. The next step is to pick one data point as end result from each cluster. My answer is the randomness. Randomly select a title from each cluster and add to the output. Another way is based upon the source. Some favors Bloomberg, others are obsessed with Wall Street Journal. We can even draw up an order of selection within the cluster. For instance, 3 titles come from Reuters and 2 titles come from BBC within the same cluster. Naturally Reuters gets preferential treatment from this cluster.
Is that the only trick up my sleeves? Never, I am David Copperfield, I walk through the Great Wall and make Statue of Liberty vanish into thin air. Here comes a great one, how about graph theory? We could connect news titles from different sources on the condition of how many words they have in common. As usual for natural language processing, we always need to keep a stopword list to exclude some stop words. Stopword implies words like 'we are' which is common in sentences but do not have an impact on the outcome of NLP. In our case, some country or city names such as 'lebanon', 'iran', 'tehran' or 'beirut' should be included in the stopword list.
Enough chitchat on the theories, let's visualize the graph network and see what is really happening. The index of the news title in a concatenated dataframe would be presented as the vertex name. Why not the exact titles? They are too wordy. The edge between two vertices would be established if and only if two news titles share some words in common. The number of common words would be denoted as the weight of the edge. Some titles may not have any word in common with the rest. These lone wolves do not appear in this graph structure. Later on, we could add these rebellious titles back to our output. For the moment, we are only concerned with the vertices in the graph ADT.
To make graph theory works, the assumptions of unsupervised learning cannot be violated. If one of the stories is important enough, it must have been covered by practically every source. All the titles referring to this story must share some words in common. Translated in graph theory, each story is likely to form a maximal clique. Nevertheless, the maximal clique demands all vertices are connected to each other. In reality, most maximal cliques we can obtain have the order of 2 or 3 which enforces us to make a compromise. Now our target switches to the vertices with abnormally high degree. If you think about it, the vital vertex should connect to all the other vertices inside a subset. Each subset indicates one unique story. All the vertices adjacent to the vital vertex should be redundant as they refer to the same story. Well, degree is not the only valid metric we can rely on. Other metrics such as closeness centrality and eigenvector centrality are available options as long as we can back the assumptions with a reasonable story.
Is there any known traversal algorithm that can return a list of our target vertices? Not to my knowledge (If you do, please feel free to comment). Nonetheless, our selection criteria are not complex and we could always implement our own version of traversal algorithm. Borrowing some ideas from an algorithm to find k-core (Matula and Beck, 1983), we shall easily achieve the objective in linear time.
The result turns out to be a huge success. The algorithm gracefully captures all the essential vertices. All the light- colored vertices are selected. All the dark-colored vertices are removed.
To make comparison, we visualize the output of unsupervised learning in the same graph structure. Frankly I am overwhelmed by the classifications of DBSCAN. Three different labels are mapped by different vertex colors. We can barely find any pattern within the same cluster either by graph theory or by reading through the titles.
K means demonstrates a great solution to our text mining problem. It recognizes some of the strongly connected components inside a graph structure. Though it still seems obsolete against the performance of graph theory. Some of the weakly connected components are misclassified.
The accuracy of the algorithms is a subjective matter. Different people have different opinions on which titles are more important. The evaluation of the accuracy is a state of art. Estimating the accuracy of machine learning in a graph theory framework is sort of unfair. However, the time and space complexity of algorithms are an objective evaluation. Leveraging the inline magic of iPython, %timeit, the argument of graph theory supremacy is loud and clear. Graph theory takes 104 ms ± 1.93 ms per loop while K means is running 3.98 s ± 28.6 ms per loop. The time complexity of a standard K means is O(k*n*d), where k is the number of clusters and d is the dimension of the dataset. Don’t forget the elbow method. It requires us to try a few times of K means to find the optimal number of clusters. On the contrary, the graph theory approach is merely O(n). The king of space complexity goes to machine learning without saying. Let’s take a look at auxiliary space. A large feature vector is unavoidable for natural language processing. Assuming we have N sentences, each sentence involves 5 unique words, 2 shared words and 1 stop word. The vocabulary matrix is going to be (5*N+2)*N. In contrast to machine learning, a graph structure can be represented by an N by N adjacency matrix where N is the order of the graph. The adjacency matrix can be further shrunk to adjacency list if facing a sparse graph.
Finally, is this approach flawless? Nope. As George Box(a statistician, his Box-Jenkins method is the foundation of time series analysis) said,
As much as I love the algorithm I developed, it could still miss some information. Consider we have two vertices, 'Nazanin Zaghari- Ratcliffe back in Tehran prison' and 'Some 400 prisoners escape prison in Tripoli chaos'. They are connected by the common word 'prison' but they appear to be completely different stories. We may exclude a false negative by accident. Is there any room for improvement? Yes and always. Currently we assume what we scrape is the latest news from different sources. Any involvement of historical archives requires an introduction of a new dimension, time, into the graph structure. Our edge connection based upon common words may sabotage the news timeline without precaution.
In short, graph theory is a better approach for our text mining problem. It answers the question at the very beginning, machine learning is no silver bullet. Graph theory is severely underestimated amid the full publicity of machine learning.
Click the icon below to be redirected to GitHub Repository


Interesting Life Archive
2016
Travelling to Dawson city in Canada, a small town that took shape in early the 20th century because of the famous gold rush. Although it still produces some gold today, the town has almost lost its past glories. Glad to have found this nice slide rule in an antique shop in Dawson. I’ve wanted to own a slide rule for a long time. This little piece of history brings me back to the days before calculators, a deep emotional connection.
2014
Travelled to probably the most mysterious country in the world, Turkey. Previously only existed in stories and fairy tales, being so close to it made me feel unreal.
Being in Istanbul itself is like being in fairy tale: the churches and mosques, the calls for prayer from minarets, the old streets and dessert shops, everything seems frozen back in time, just as they were hundreds (or thousands) of years ago. History makes this city romantic, maybe even dog and cat can fall in love~
In Turkey there are many ducks, and strangely people don’t eat them. Instead they are pretty generously fed (in an unhealthy diet though). Like in Pamukkale, people enjoy feeding ducks with bread.
2013
My first time in Canada, everything seemed so friendly to me. In the morning of my first day at Montreal, I saw some surprisingly beautiful patterns of frozen moisture, right on the window! Squirrels seem to like me as well, or did this one mistook my leg for a tree?
Leave a Comment


Wanna Know More?
What to know more about my Webdevelopment Process? Have an exciting project that could use my help? Drop me a line and let's chat!


A blockchain is, in the simplest of terms, a time-stamped series of immutable record of data that is managed by cluster of computers not owned by any single entity. Each of these blocks of data (i.e. block) are secured and bound to each other using cryptographic principles (i.e. chain).
So, what is so special about it and why are we saying that it has industry disrupting capabilities?
The blockchain network has no central authority — it is the very definition of a democratized system. Since it is a shared and immutable ledger, the information in it is open for anyone and everyone to see. Hence, anything that is built on the blockchain is by its very nature transparent and everyone involved is accountable for their actions.Autonomous things, abbreviated AuT, or the Internet of autonomous things, abbreviated as IoAT, is an emerging term for the technological developments that are expected to bring computers into the physical environment as autonomous entities without human direction, freely moving and interacting with humans and other objects. Self-navigating drones are the first AuT technology in (limited) deployment. It is expected that the first mass-deployment of AuT technologies will be the autonomous car, generally expected to be available around 2020. Other currently expected AuT technologies include home robotics (e.g., machines that provide care for the elderly, infirm or young), and military robots (air, land or sea autonomous machines with information-collection or target-attack capabilities)
Immersive technologies such as virtual and augmented reality are currently taking the world by storm. Over the past three years, we’ve seen a huge interest in immersive technologies from the likes of advertising agencies, games developers, construction companies and more…
Immersive technology is not a new concept. Experimentation with virtual and augmented reality has been taking place since the 1960s, hidden inside research facilities across the world. The Sword of Damocles is considered by most to be one of the first virtual reality headsets. Built by Ivan Southerland and Bob Sproull in a laboratory at MIT, it was a large and somewhat dystopian looking device. The device was so heavy that it had to mounted to a mechanical arm attached to the ceiling when in use.
When using the device, the users would be able to see a virtual environment, but since graphics technology was not very advanced, these were usually just simple wireframe rooms.
Immersive technology was further popularised by Star Trek’s Holodeck. In the hit sci-fi tv show, characters could enter a specific room and it would create an expansive virtual world that was so in-depth, it was almost identical to reality. Lots of people were excited by the thought that, one day, in the distant future, we may be able to recreate whole worlds inside a holodeck.


Services
About Us
Costumers
Contact
Subscene 3.0
Popular subtitles
Nightcrawler
Imdb
English Blu-ray
by GoldenBeard
Indonesian Blu-ray
by BlackSpiders
English Blu-ray
by Luis-subs
1587 downloads
96 subtitles
Forum discussions
Jadwal yang ada


Chapter 4 Course 1 - Introduction to R
4.2 Basics
R studio contains four panels: a script panel where you can save your code (we will introduce this later so to begin there will just be three panels), a console where you can enter and run your code and where the outputs are displayed, an environment which lists the objects you create, and another window which includes help, files and displays any plots you create.
Our course starts in the R console, which those of you who are familiar with R but not RStudio will recognise. We will enter commands as input into the console, and receive output from the console. We will start with some simple basic operations, for which R is clearly very excessive.
4.2.1 Basic operations
Entering 1+1, we get the output [1] 2. The output is 2, but the [1] lets us know that the number 2 is the first number of output. If we had an output that was particularly large (e.g. 100 seperate numbers) then r may let us know that the first row displayed starts with the first value [1] and the second row starts with the [x]th value.
## [1] 2
## [1] 3
## [1] 21
## [1] 1000
4.2.2 Objects
R is object orientated, which bascially means when we work in R we are generally writing code to make changes to an object (e.g. a dataset), based on other objects. An object can take a number of forms (e.g. a number, a vector of numbers, a matrix, a data-frame). We can then use these objects going forward rather than the values directly. Operations can be applied to these objects, and objects can be over-written. If you understand how to manipulate objects you are most of the way there.
## [1] 8
## [1] 9
## [1] 9
4.2.3 Overwriting / Manipulating Objects
We can overwrite our objects. But be careful, just because we overwrite something doesn’t mean other objects created in the code before update.
## [1] 10
## [1] 11
## [1] 6
## [1] 0
4.2.4 Seeing our Objects
Sometimes we have so many objects we can’t see them in the environment.
## [1] "a" "b" "x" "y" "z"
4.2.5 Removing Objects
# sometimes we may want to remove an object.
rm(a)
# multiple objects at once
rm(x,y)
# remove all objects
rm(list=ls())
Exercises
1a)Create an object d equal to 10.
Divide d by 5.
Multiply d by 8.
Add 8 to d.
What is d?
2a) Create an object m equal to 7.
Overwrite m with m = m times 10.
Create an object p equal to 2.
d)Overwrite p with p = p times 12.
Create an object w equal to m divided by p.
What values do m, p and w take?
4.2.6 Evaluations
We can perform evaluations, which provide a true or false answer. For example the input 4>2 returns “FALSE”.
It can be very useful in cases where an outcome is binary (e.g. an individual dies or remains alive). Or where we want to change a continous variable to a binary.
## [1] TRUE
## [1] FALSE
## [1] FALSE
## [1] TRUE
## [1] TRUE
## [1] FALSE
# the output from an evaluation can be stored as an object, x. This object can be subject to operations & manipulations.
b <- 4<2
b
## [1] FALSE
Exercises
Use R to answer the following questions for you:
1) Is 4 greater than 2?
2) Is 5 less than 3?
3) Is 6.2 equal to 12.4/2?
4) Is 5 equal to or greater than 4? (hint: use >=)
5) Is 5 equal to or less than 5? (hint: use <=)
2) Is 7.5 equal to 137.25/18?
3) m = 84 / 106, q = 156/3, is m/q greater than, less than or equal to 0.0152?
4.3 Object classes and types
So far we have mostly been working with objects of a single numeric value. However, objects don’t have to take a single value, for example an object could be a vector of the heights of each child in a group of children.
We have mostly been working with numeric values (vectors of one). As we have already seen, objects don’t have to be numeric. To illustrate the different classes we are going to create some vectors of different classes which we will then join together later to make a dataframe.
4.3.1 Object Classes
Different classes include: numeric, character, factor, logical, integer & complex (ignore). We can create a vector using the function c() which concatenates objects. We can type ?c() to ensure we understand what c() does. Typing ?function gives us the help file for any function.
## [1] 1.38 1.45 1.21 1.56
## [1] 31 35 28 40
## [1] "numeric"
## [1] "Alice" "Bob" "Harry" "Jane"
## [1] F M M F
## Levels: F M
4.3.2 Operations on different data structures
We can perform operations on the different objects with different structures, lengths, classes etc. It is important to know what can be done to objects.
## [1] 2 3 4
## [1] 2 4 6
## [1] 1.38 1.45 1.21 1.56 31.00 35.00 28.00 40.00
## [1] "1.38" "1.45" "1.21" "1.56" "31" "35" "28" "40" "Alice"
## [10] "Bob" "Harry" "Jane"
Exercises
Create a vector called ‘odds’ with the numbers 1,3,5,7,9. Show what class odds is.
Evaluate which numbers in the odds vector are greater than 4.
Create a vector called ‘fail’ containing 1,3,5,‘seven’,9. Show what class fail is.
Create a vector that gives everyone’s weight in pounds (2.2lbs to kg)
4.3.3 Basic object Types
There are multiple types of object in R. We can store objects together in a data-frame. In our example data-frame each column is a variable (height, weight, first_name), and each row is an individual.
Different object types include:
Vector - single variable is a 1x1 vector. All elements are the same class.
Matrix - all elements are the same class.
Dataframe - columns are vectors of the same class. Rows are lists.
List - anything goes. We will ignore these for now.
# data frame- columns are variables, rows are observations.
df <- data.frame(height,weight,first_name,sex)
df
## height weight first_name sex
## 1 1.38 31 Alice F
## 2 1.45 35 Bob M
## 3 1.21 28 Harry M
## 4 1.56 40 Jane F
## [1] 1.38 1.45 1.21 1.56
# We can add a new variable easily, in this case based on other variables within the dataframe.
df$bmi <- df$weight / df$height^2
df
## height weight first_name sex bmi
## 1 1.38 31 Alice F 16.27809
## 2 1.45 35 Bob M 16.64685
## 3 1.21 28 Harry M 19.12438
## 4 1.56 40 Jane F 16.43655
4.3.4 Subsetting
We can subset our data, to reduce it to those we are interested in. This is useful when cleaning our data, and when changing a continuous variable to a categorical.
## height weight first_name sex bmi
## 1 1.38 31 Alice F 16.27809
## 2 1.45 35 Bob M 16.64685
## 3 1.21 28 Harry M 19.12438
## 4 1.56 40 Jane F 16.43655
#To subset a data frame we can use square brackets i.e df[row,column]
#Selecting a column(s)
df$height
## [1] 1.38 1.45 1.21 1.56
## [1] 1.38 1.45 1.21 1.56
## [1] 1.38 1.45 1.21 1.56
## height weight first_name
## 1 1.38 31 Alice
## 2 1.45 35 Bob
## 3 1.21 28 Harry
## 4 1.56 40 Jane
## height first_name
## 1 1.38 Alice
## 2 1.45 Bob
## 3 1.21 Harry
## 4 1.56 Jane
## height weight first_name sex bmi
## 1 1.38 31 Alice F 16.27809
#We might also want to select observations (rows) based on the characteristics of the data
#E.g. we might want to only look at the data for people who are taller than 1.75m
#create a logical variable called min_height which contains T/F for each individual being over 175cm.
min_height <- df$height >= 1.75
min_height
## [1] FALSE FALSE FALSE FALSE
# Subset the data to include only those observations (rows) for which height > 175cm (using min_height).
df.at_least_175 <- df[min_height,]
df.at_least_175
## [1] height weight first_name sex bmi
## <0 rows> (or 0-length row.names)
#People smaller than 1.75m
# Subset the data to include only those who are not above min-height of 175cm.
smaller <- df$height < 1.75
df[smaller,]
## height weight first_name sex bmi
## 1 1.38 31 Alice F 16.27809
## 2 1.45 35 Bob M 16.64685
## 3 1.21 28 Harry M 19.12438
## 4 1.56 40 Jane F 16.43655
## height weight first_name sex bmi
## 1 1.38 31 Alice F 16.27809
## 2 1.45 35 Bob M 16.64685
## 3 1.21 28 Harry M 19.12438
## 4 1.56 40 Jane F 16.43655
Note that there are other more advanced methods, which uses pipes and require less code (these are covered in more advanced courses).
Exercises
Select the 3rd row from the data frame
Select the weight variable from the data frame using your prefered method.
Select alice’s data from the data frame.
Subset the data frame to show just the data for the females
type df[,-1], what does this give you?
4.3.5 Independent Exercises
Exercise 1
- Calculate the following:
5*10 20/3
- Calculate x where a = 20 b = 9, c = 5, d = 1.2
\(x = 4b + 7c + 3d\)
\(x = \frac{8b + 4c -12d}{a}\)
Exercise 2
x <- c(10,30,4,52,60,7,8,10,12,15,14,17,19,20,25,30)
Which numbers in x are above 8.
Which numbers are equal to 10.
Which numbers are below 8 or above 30.
Can you create a matrix with numbers and characters. names <- c(“Anne”,“Tom”,“Jamie”,“Max”,“Claire”) ages <- c(12,16,25,34,28) cbind(names,ages) What happens if you try to use the ages?
Create a dataframe for five individuals (Andrew, Betty, Carl, Diane and Elisa) who are aged (62,80,24,40,56) and have gender (male, female, male, female, female).
Use evaluations and subsetting to find the characteristics of the individual who can claim their free bus pass (age 65+).
Create a variable in the dataframe called life expectancy, set this to 83 for females and 80 for males.
Create another variable called lyr (life years remaining) which is the number of years to life expectancy for each individual
4.4 Working with Data in R
4.4.1 Keeping Track of progress in R
So far we have been working exclusively in the R console. This is useful for trialing code and doing quick intial analyses, however, the code we have typed is not saved for when we might look back at it in the future. If we want to keep a permanent record of our code, we can do this using a r-script. An r-script is basically a text-file containing lines of r-code. Usually we create them from scratch within R, though they can be created by importing a text file from text editor.
The easiest way to create an r-file is by clicking the button in the top left corner of RStudio that looks like a piece of paper with a green plus over it. The use of # for commenting is common. For example below
getwd() # this line of code sets the working directory.
paste("RRRRR") # this line of code pastes RRRRR.
#paste("RRRR") # this line doesn't
# One is enough, but sometimes I can use a few to make the code tidy, like below.
#====
# Section 1
#====
<IP_ADDRESS> Setting Working Directory
When we use R, it is always associated with a specific directory within our computer. The place that R is associated with is known as the working directory. The working directory is the default place where R will look when we try to import (export) objects into R as well as the place that files are saved to. We can find out which directory R is pointed at by using the getwd() function:
## [1] "C:/Users/Robert/Google Drive/Teaching/R Course/R4PHE"
If you know that you will be reading and writing multiple files from and to the same folder, you can set the working directory to that folder. This can be useful when a project has many different r-files and associated items such as data, functions, plots etc. In this case, one can set the working directory to the folder containing the files to make sure that everything stays in one place. It is also useful for when projects are shared between individuals using different computers, as setting the working directory to the shared folder prevents any isses that could arise from people organising their files in different ways.
A new working directory can be set by clicking on the tab (Session) then (Set_Working Directory), or by the command setwd. Below I give the example of setting the working directory to my documents.
4.4.2 Importing Data
In almost every project, you will want to import some data to analyse. This data will come in a variety of formats. R studio has a nice feature in Environment>Import_Dataset which enables you to select the file you wish to download (similar to STATA) from your computer. The data is then imported into R and the code that R has used is displayed in the console.
It is possible to import files in the following formats:
| Type | Suffix |
|---|---|
| R | .R |
| CSV | .csv |
| Excel | .xls/.xlsx |
| SPSS | .spv |
| Stata | .dta |
If we want more control over the way that R imports the data we can also use the necessary commands in R directly. Some important examples of this are given in the next subsections.
In addition, packages can be installed to import data in almost any format. Packages are collections of R functions and code in an organised framework. The directory where packages are stored on your computer is called the library. For example the readr package which allows for easier reading of data can be installed from the internet using the code install.packages(“readr”), then loaded into R using library(readr).
<IP_ADDRESS> CSV (Comma-seperated values)
A common format of data that you will likely import is comma-seperated values (CSV) data. CSV Data is seperated by commas in rows. For example:
Age,Name,Sex,
30,Richard,Male,
27,Hazel,Female,
28,Louise,"",
Creates:
| Age | Name | Sex |
|---|---|---|
| 30 | Richard | Male |
| 27 | Hazel | Female |
| 28 | Louise |
We can import the file using the full path with the file name and suffix included such as below. This will look in the working directory for the file specified, so given our working directory is “C:/Users/Robert/Documents” R will look in the Documents folder for the file “car_Data.csv”.
It will then convert the first row to be the header of the data. There are numerous other options which we will skip for now.
<IP_ADDRESS> Downloading files from the internet
Sometimes it is more practical to download files directly from the internet. There are lots of different packages out there to do this. The one I use was developed by Hadley Wickham, called readr. Below we are going to download some data from the course github page. Github is a hosting service for source code (in this case R code), it allows users to store code, data and other files. This aids version control, collaboration, replication and consistency of material over time,
# load the readr package, if this is not installed then install it.
#install.packages("readr")
library(readr)
#use the function read_csv
car_Data <- read_csv("https://raw.githubusercontent.com/RobertASmith/Intro_to_R/master/car_Data.csv", header = TRUE)
Downloading files directly to R within the same script as the analysis can be useful since it reduces the risk of you accidently changing the file. Just be careful that the data will always be available.
4.4.3 Summarising Data
Once we have our data read into R, we want to ensure that the data is as we would expect, in the correct format etc.
We can use the function head to look at the first 6 number of lines of the data. We can specify a different number of lines by changing the function input.
## mpg cyl disp hp drat wt qsec vs am gear carb
## Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
## Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
## Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
## Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
## Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
## Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1
## mpg cyl disp hp drat wt qsec vs am gear carb
## Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
## Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4
## Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
## Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
## Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2
## Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1
## Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4
## Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2
## Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2
## Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4
We can summarise a dataset using the function summary. This shows us the length, class and Mode. If the class is numeric it will give some indication of the distribution by displaying min, median, mean, max.
## mpg cyl disp hp
## Min. :10.40 Min. :4.000 Min. : 71.1 Min. : 52.0
## 1st Qu.:15.43 1st Qu.:4.000 1st Qu.:120.8 1st Qu.: 96.5
## Median :19.20 Median :6.000 Median :196.3 Median :123.0
## Mean :20.09 Mean :6.188 Mean :230.7 Mean :146.7
## 3rd Qu.:22.80 3rd Qu.:8.000 3rd Qu.:326.0 3rd Qu.:180.0
## Max. :33.90 Max. :8.000 Max. :472.0 Max. :335.0
## drat wt qsec vs
## Min. :2.760 Min. :1.513 Min. :14.50 Min. :0.0000
## 1st Qu.:3.080 1st Qu.:2.581 1st Qu.:16.89 1st Qu.:0.0000
## Median :3.695 Median :3.325 Median :17.71 Median :0.0000
## Mean :3.597 Mean :3.217 Mean :17.85 Mean :0.4375
## 3rd Qu.:3.920 3rd Qu.:3.610 3rd Qu.:18.90 3rd Qu.:1.0000
## Max. :4.930 Max. :5.424 Max. :22.90 Max. :1.0000
## am gear carb
## Min. :0.0000 Min. :3.000 Min. :1.000
## 1st Qu.:0.0000 1st Qu.:3.000 1st Qu.:2.000
## Median :0.0000 Median :4.000 Median :2.000
## Mean :0.4062 Mean :3.688 Mean :2.812
## 3rd Qu.:1.0000 3rd Qu.:4.000 3rd Qu.:4.000
## Max. :1.0000 Max. :5.000 Max. :8.000
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 10.40 15.43 19.20 20.09 22.80 33.90
We can use the output of the summary function to create objects. The summary of the mpg variable gives the quantiles. These can be stored as an object, here called temp (temporary object). If we just want any one number from the vector of quantiles we can define this in brackets. The script below creates two new objects, median and range.
4.4.4 Plotting Data
Line Plot
R also has wide ranging plotting capabilites. For basic plotting we can use the plot function. In this next example, we will prodcue a simple plot of miles per gallon vs engine displacement in our data set to see what the relationship between the variables.
#plot of mpg vs disp
plot(x = car_Data$disp, y = car_Data$mpg)
#notice we can remove arguments and still get same result
plot(car_Data$disp, car_Data$mpg)
Whilst this plot is useful, it is quite basic. We make the plot more informative by specifying extra features that we want when we call the plot function. We can add labels, titles, lines of best fit and more.
plot(x = car_Data$disp, y = car_Data$mpg,
type = "p",
xlab = "Displacement",
ylab = "Miles per Gallon",
main = "MPG vs Engine Displacement")
Sometimes we may just want to see the distribution of a single variable in the data. For numerical variables this is done easily by using plotting a histogram. To plot a histogram in R we use the command hist.
#We can alter the 'bins' by specifying the additional argument 'breaks = ' in the hist function
hist(car_Data$mpg, breaks = c(10,12.5,15,17.5,20,22.5,25,27.5,30,32.5,35))
#a neater way of doing the same as above is to use seq
hist(car_Data$mpg, breaks = seq(10,35, by = 2.5))
#we can again edit the title etc by adding extra arguments
hist(car_Data$mpg,
breaks = seq(10,35, by = 2.5),
xlab = "Miles per gallon",
main = "Histogram of Miles per Gallon")
Excercises
Exercise 1
Load the iris dataset from base R into an object called flowerData by running the code ‘flowerData <- iris’
Output the first 10 rows of the data
3 What class of object does each variable belong to?
3 Plot a seperate histogram of the sepal length for each species. Add a title and labels to each so that you know which is which.
4 Do you see any large differences between the distributions? (Try changing the ‘breaks’ argument to see if this makes things clearer)
## Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1 5.1 3.5 1.4 0.2 setosa
## 2 4.9 3.0 1.4 0.2 setosa
## 3 4.7 3.2 1.3 0.2 setosa
## 4 4.6 3.1 1.5 0.2 setosa
## 5 5.0 3.6 1.4 0.2 setosa
## 6 5.4 3.9 1.7 0.4 setosa
## 7 4.6 3.4 1.4 0.3 setosa
## 8 5.0 3.4 1.5 0.2 setosa
## 9 4.4 2.9 1.4 0.2 setosa
## 10 4.9 3.1 1.5 0.1 setosa
## 'data.frame': 150 obs. of 5 variables:
## $ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
## $ Sepal.Width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
## $ Petal.Length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
## $ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
## $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
4.4.5 Troubleshooting in R
<IP_ADDRESS> Errors
When doing any sort of programming work, things often don’t perfectly on the first try. Unfortunately, making mistakes and learning from them is an important part of becomming a better programmer. The process of troubleshooting generally follows 4 main steps:
Read the error message. Sometimes it will be obvious what the error is from the message itself allowing you to quickly go back to your code and correct it.
Read the R documentation. If the error has arisen whilst using a particular function or package then the documentation for those functions and packages will often have all the answers you need to solve your issue. Reading help files (which can be found using help(###) or ?###) is an importnant part of gaining a better understanding of R so don’t skip this step, however tempting it is.
Go on the internet. There are many useful places on the internet to get help with any issues you encounter. Copying the error message into a google search will often reveal that someone else has had the same issue as yourself, and more often than not there will be myriad solutions for you to implement from other helpful R users. StackOverflow is a particularly useful place to go looking for help.
Ask for help directly. If no solutions for your issue (or one that is similar enough for you to work out how to solve it on your own) have been found then you can ask directly to places like StackOverflow for help. Bear in mind that you will need to create a simpler version of your code with just enough in it to re-create the error. People wont read thorugh thousadns of lines to help sort your error!
More detail on these steps can be found at link and there are many other resources online that can help for any issues that you might encounter.
<IP_ADDRESS> Advice for R skill building
Naturally at some point you will be faced with the challenge of doing something in R that you have have not done before, and so is outside your current skill level. The process for learning this new capability is very similar to that of trouble shooting:
First, ask can you use the functions and packages that you have already in your R reportoire to solve the issue? Trying to solve your issue this way first will deepen your understanding the capabilites of R and each package and function within it. This step will likely involve lost of reading of R documentation, so don’t be tempted to skip this step!
If you have tried this but you are just getting errors then go through stages 1 and 2 of the troubleshooting procedures outlined above.
If doing steps 1 and 2 still has not brought you any success, then it’s time to go searching the internet for help. A quick google search of what you want to do will often reveal multiple ways to do whatever it is your trying, and again places like stack overflow are very helpful for this.
It is tempting to skip straight to step three at times (and we would be lying if we said we didn’t sometimes do it ourselves) but it’s better to resist. Doing steps 1 and 2 will allow you to work out which of the solutions available online is best for you, and the greater understanding you develop by taking this longer route will make you a better programmer in the long run, as you are more likely to understand the solutions given to you online. Overall this will open up the pathway to speedier problem solving in your code. Copying coded solutions off the internet to put in your work without understanding the limitations of your attempts or the how the solutions work may produce immediate results but at the sacrifice of your development as a programmer.
4.5 Further learning
We hope to see you again on further courses with us at ScHARR. However, alternative resources are available:
R for Data Science is a good place to recap the materials taught in this course. The hard copy of Hadley Wickham and Garrett Grolemund’s book of the same name (and content) is available on amazon
An R user guide is available on the CRAN R-Project website here, although the author finds this less easy to follow than Hadley Wickham’s book described above.
Also, you can learn R in R with swirl. Swirl has a range of short courses (approx 30mins) which are undertaken in R. You can download swirl by typing install.packages(“swirl”) into R. Once installed loading swirl from the library with library(swirl) and then following instructions within R.
This course was created for educational purposes. The content was created by Robert Smith1, in collaboration with Paul Schneider1, Thomas Bayley1, Naomi Gibbs1, Sarah Bates1 and Amy Chang1.
** All errors are the responsibility of Robert Smith1, please send any feedback to<EMAIL_ADDRESS>1Wellcome Trust Doctoral Training Centre, School of Health and Related Research, University of Sheffield


{% extends 'base.html' %} {% block content %}
Thanks for registering. An email has been sent to the address that you used during registration for activation.


Does Re-Search mean to search something again that already has been found? Or does it mean to reinvastigate in a previous search and re-ellaborator it from a newer perspective?
Does Re-Search mean to search something again that already has been found? Or does it mean to reinvastigate in a previous search and re-ellaborator it from a newer perspective?


{{ define "main" }}
We help small to mid-sized businesses & non-profits leverage technology more effectively.
In 2003 we started SDC Solutions, Inc. in response to small and mid-sized businesses and non-profits asking for help managing how they process and share information. Today, we continue to provide affordable solutions and enjoy working with and learning about all the unique ways our customers use information to do what they do.


{% extends 'email.server.view.html' %}
{% block content %}
Hey {{name}}!
Your Trustroots account has been removed.
Feel free to leave us feedback:
<{{supportUrl}}>
If you think this was a mistake, please contact us immediately:
<{{supportUrl}}>
{% endblock %}


the and that were images monkey was with for The humans correct human species not subjects performance reaction than animal are familiar responses saccadic {background equalized have pairs both from time new same []. different categorization could each performed task margin images. low median natural one which {border-style visual px;} this #ffffff;} accuracy had monkeys obtained spatial they used very also animals fast first latencies more Figure between but mean our times image trials This can face macaque minimum rating similar targets views above level All contained df = , even individual pair processing study such target use U = , been better distribution faces other overall set since stimuli these case categorize chance close-up eye frequency least monkey. presented results saccades spectrum studies However, Res [], below detection did experiment given important information most non-equalized number only perform present profile px; scenes score session shown still task, task. {font-family (χ = ., Each P<.). all content families filtered font-size monkey, object order performances pictures presentation recognition saw subject trial whether who would (figure (for For One background cortex difference double; evidence experiments fixation forced-choice former found frequencies frontal full-face gave head humans, low-pass lower magnocellular ms). original percent percentage possibility rapidly reported response responses. seen shows significantly some subjects. their there two view (.% Humans Neurosci Recherche They able about although amplitude analysis border-color border-width brain category cognitive cortical difficult distractor elicited experiment. experimental figure humans: images, index indicate interesting local neuronal objects pairs. p = .). range result rhesus salient several solid; species. taken then trials) when {font-style {font-weight χ = ., (.%) Brain Cogn Examples Hence, Our Psychol Role Sci Since These Toulouse, Vis []). accurate across advantage any appeared authors based basis before bias bold common computed constraints contribution correct) correct). courier; cultural data degraded distractors drop during em; extremely fact familiarity features function global good hypothesis influence into issue large like luminance made make mammals many much never non-familiar only. pairs, phase picture possible power presence previous primates process pt;} reaching recent regions regression rely representations respective role second session, shorter similarly slightly stimulus study. targets. templates terms those towards under well what work


i
Reporter
Report injustice, corruption and neglect anywhere across Africa!
Good to have you back; sign in to make a record


This tutorial is for Processing version 2.0+ and has been adapted for Python Mode. If you see any errors or have comments, please let us know. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
You can download the files from this tutorial.
Many of the tutorials for Processing concentrate on what the language can do (change colors, draw shapes, create arrays of objects) and which function calls will let you accomplish these tasks. These are things you need to know in order to write a program in Processing.
There’s one piece of the puzzle that these tutorials don’t address: how do you analyze a problem and break it down into steps that the computer can do? In this tutorial, I’m going to show you what went through my head as I took on the task of writing functions to draw regular polygons and star-shaped figures in Processing. This is a good choice because the task is not too big to get your mind around, but it’s not an entirely trivial problem, either.
Remember that what you are seeing here is my particular thought process and programming style. There are many different approaches and styles. As you continue programming, you will find your own. You can also see other people’s programming stye (though not their thought process!) by looking at the source code for the programs at openProcessing.org.
 Since Processing is such a visual language, I always have to sketch out what I want as a result before I approach the keyboard. So that’s where I started.
The first step was to draw a crude diagram to dredge up old memories of how regular polygons work. The hexagon was the first one I drew. As you can see from the little loop I drew inside the hexagon, the center angles of all the slices add up to a complete circle, or 360°, and the “radius” of the polygon is a line from the center to each vertex. The angle between each of the radius lines is thus 360° divided by the number of sides.
I just needed to get an idea of what the task was, and a hand-drawn diagram did the job. I didn’t need to generate the diagram in a drawing program.
Programming Hint: When you do your planning, do it away from the computer. If you are sitting in front of the computer, the screen will whisper, “Look at me! Look at me!” and the keyboard will whisper “Type something! Type something!” Go to your kitchen table instead.
So, if you have a line of length r starting at (0,0) at an angle theta (θ), what are its coordinates in terms of x and y? If you know a little bit of trigonometry, the answer is that the endpoint of the line is at (r cos θ, r sin θ). If you don’t know trigonometry, take a look at this tutorial (a general and very light introduction to trigonometry), this tutorial (oriented towards Processing), and this example from chapter 13 of Learning Processing. In the following diagram, angles are drawn clockwise, which is how they are measured in Processing.
It looks like this is a job for a for
loop that runs from 0 to
n (the number of sides), calculating the points for each vertex and drawing
lines connecting them. At each step, the angle at which we draw is increased
by 360°/n.
The problem with drawing a group of lines is that they are just lines—you
don’t get a true shape that you can fill, like rect()
or triangle()
. Luckily, Processing lets you create your own shapes
with the beginShape()
,
vertex()
, and
endShape()
functions.
The first example on the reference page for beginShape()
is the model
to follow. So the next design decision is to make polygons as true shapes.
Since you probably want to draw many polygons during a program, it makes sense
to have a polygon()
function. What parameters does it need?
Four come to mind: the number of sides, the center x and y
coordinate, and the radius. Here’s the code. I wrote several different
calls to polygon()
in the setup()
function.
Although I calculated angle
in degrees, sine and cosine measure
angles in radians, so I had to use the radians()
function to
do a conversion.
def setup(): size(300, 300) background(255) smooth() noFill() polygon(3, 50, 75, 50) polygon(4, 170, 75, 50) fill(255, 204, 255) stroke(128, 0, 128) polygon(5, 50, 180, 50) noFill() stroke(0) polygon(6, 170, 180, 50) def polygon(n, cx, cy, r): angle = 360.0 / n beginShape(); for i in xrange(n): vertex(cx + r * cos(radians(angle * i)), cy + r * sin(radians(angle * i))) endShape(CLOSE)
The program works, so it’s time to see if there are things that
could be added or changed. First, the triangle and pentagon seem
somehow wrong; they are usually drawn pointing upwards instead of
to the side. The reason they look odd is that the first vertex
(at 0°) points to the right instead of straight up. It
would be nice to have an extra parameter that gives the starting
angle for the first vertex. (Another solution is to leave things
as they are and let programmers use rotate()
[see this
tutorial], but I made the design decision
to use an extra parameter.) Should the angle be given in degrees
or in radians? The answer: radians, in order to be consistent
with everything else that Processing does.
My next thought was that it would be nice to be able to specify a
width and height for the polygon, much as you do with an
ellipse()
or rectangle()
. I already
knew what the formula would be, but I wanted to make a drawing
to check it out. As a preliminary
experiment, I tried drawing a pentagon into a square using a protractor and straightedge,
and ended up with the awful drawing at the left. How come the sides
weren’t equal length? I realized that I was trying to make
the drawing fit my preconceptions, rather than making an accurate
drawing and seeing where that led me. The drawing on the right
was done much more carefully. After a little thinking, I realized
that the pentagon wouldn’t fit the square exactly, because
the angles weren’t multiples of 90 degrees. The regular
polygon fits in a circle, not in a square!
Well, that was a dead end. That sort of thing happens in programming all
the time, so I didn’t spend too much time worrying about it.
It was time for another approach. Since I didn't have an accurate way of
drawing ellipses, I had to think about the problem a different way. Presume
you have a circle drawn on a square sheet of rubber, and you stretch it out
so that it’s twice as wide but the same height. The vertical position of
the points on the circle does not change, but the horizontal positions are now
twice as far away from the center as they used to be. The same idea applies
if you stretch the sheet vertically. The
following crude drawings seemed to bear this out,
so it was time to rewrite the polygon()
function.
def setup(): size(300, 300) background(255) smooth() noFill() polygon(3, 50, 75, 100, 100, -PI / 2.0) # -90 degrees polygon(4, 170, 75, 50, 125, -PI / 4.0) # -45 degrees fill(255, 204, 255) stroke(128, 0, 128) polygon(5, 50, 200, 75, 50, -PI / 2.0) # -90 degrees noFill() stroke(0) polygon(6, 170, 200, 50, 100, 0) stroke(128) # draw enclosing ellipses to make sure we did it right ellipse(50, 75, 100, 100) ellipse(170, 75, 50, 125) ellipse(50, 200, 75, 50) ellipse(170, 200, 50, 100) def polygon(n, cx, cy, w, h, startAngle): angle = TWO_PI/ n # The "radius" is one half the total width and height w = w / 2.0 h = h / 2.0 beginShape() for i in xrange(n): vertex(cx + w * cos(startAngle + angle * i), cy + h * sin(startAngle + angle * i)) endShape(CLOSE)
Since everything was in radians, I now described
angles in terms of PI
and TWO_PI
(2π), since
2π radians equals 360°.
In addition to the code in setup()
to test the new
features, I drew ellipses with the same center and width and height as
the polygons to make sure that
the vertices were within the proper area.
I now had a much more flexible function for drawing polygons, but
it came at the expense of more parameters. It would be nice to be
able to draw the ordinary case (equal width and height, start angle
of zero) without having to specify all those parameters. The solution
is to use default parameters. In Python, you can have certain parameters
to a function act as defaults, meaning if the user does not define them
our defaults will step in. This means that a function can be called
with a different number of parameters depending on what the user would like to
do! An example of this is Processing’s stroke()
function,
which allows you to call it with a single number for grayscale, three
numbers for color, or four numbers for color with opacity.
Here is what we'll change the definition of our polygon()
function to look like to adjust for default parameters. Notice how we've
changed our fourth parameter w
to r
, this is
(stylistically) to account for the fact that we can now represent width
and height as r * 2.0. Within our function, we can now make a check to see
if the user defined an h
and startAngle
and then
adjust our parameters accordingly.
def polygon(n, cx, cy, r, h = None, startAngle = None): w = h = startAngle = 0 # Define these variables outside the scope of the if statement if (h == None and startAngle == None): # User defined 4 parameters # If not, adjust our parameters. w = r * 2.0 h = r * 2.0 startAngle = 0 else: # User defined 6 parameters w = r
And here is some code to test the overloaded function.
def setup(): size(300, 300) background(255) smooth() noFill() polygon(3, 70, 75, 50) # use the defaults polygon(4, 170, 75, 25) stroke(128) # draw enclosing ellipses to make sure we did it right ellipse(70, 75, 100, 100) ellipse(170, 75, 50, 50)
What happens if someone tries to draw a polygon with 2 sides, 1 side,
or worse, 0 sides? The first two will generate a line and a point,
but the third one will cause a division by zero error when trying to
figure out the angle. And what would happen with negative numbers?
Since polygons with fewer than three sides
don’t make a lot of sense, I wrapped the body of the
polygon()
function inside of an if
statement.
Now, when someone specifies two or fewer sides, the function just
won’t draw anything.
def polygon(n, cx, cy, r, h = None, startAngle = None): if (h == None and startAngle == None): # User defined 4 parameters # If not, adjust our parameters. w = r * 2.0 h = r * 2.0 startAngle = 0 else: # User defined 6 parameters w = r if (n > 2): angle = TWO_PI/ n; . . beginShape() . . endShape(CLOSE)
Now that I was satisfied with the polygon()
function, it was time
to move on to drawing stars. From some playing around with a crude sketch, I
figured that it would be possible to draw a star by figuring out where all the
diagonals of a polygon intersect.
I saw two problems here. First, finding the intersection point of two lines is a lot of calculation. Not particularly hard calculation, but a lot of it, and it gets tricky when you have vertical lines. Second, I couldn't have a four-sided or three-sided arrow shape; there weren’t enough diagonals.
Then, I had another idea. I can’t tell you where the idea came from or how I arrived at it; it just hit me. That’s a part of the process that I don’t think can be taught. Here was the idea: What if you had a polygon cut out of cookie dough and you sort of pushed in the sides to make a star shape? That is a method that works for squares and triangles.
When you push in the sides, you push them in at the midpoint so that you get a nice symmetric cookie. From there, it wasn’t a big leap to figure out: “what if I had a shorter radius at half of every slice of the polygon?”
This code would be fairly easy to write. I would need one extra
parameter: the proportion of the small radius to the
big radius. In the following code, an if
statement
controls whether to use the short radius or the long radius.
I also put in an overloaded version that draws a star with
equal width and height and a start angle of zero. For the
test, I made the short radius one half the long radius.
Notice how on the simpler calls, the user specifies
proportion = x
within the call.
def setup(): size(300, 300) background(255) smooth() noFill() star(3, 60, 75, 100, 100, -PI / 2.0, 0.50) # -90 degrees star(4, 170, 75, 25, proportion = 0.50) # use simpler call fill(255, 204, 255) stroke(128, 0, 128) star(5, 60, 200, 75, 50, -PI / 2.0, 0.50) # -90 degrees noFill() stroke(0) star(6, 170, 200, 50, 100, 0, 0.50) stroke(128) # draw enclosing ellipses to make sure we did it right ellipse(60, 75, 100, 100) ellipse(170, 75, 50, 50) ellipse(60, 200, 75, 50) ellipse(170, 200, 50, 100) def star(n, cx, cy, r, h = None, startAngle = None, proportion = 1.0): if (h == None and startAngle == None): # User defined 4 parameters # If not, adjust our parameters. w = r * 2.0 h = r * 2.0 startAngle = 0 else: # User defined 6 parameters w = r if (n > 2): angle = TWO_PI/ (2*n) # twice as many sides dw = 0 # draw width dh = 0 # draw height w = w / 2.0 h = h / 2.0 beginShape() for i in xrange(2 * n): print dw, w, h, dh dw = w dh = h if (i % 2 == 1): # for odd vertices, use short radius dw = w * proportion dh = h * proportion vertex(cx + dw * cos(startAngle + angle * i), cy + dh * sin(startAngle + angle * i)) endShape(CLOSE)
When I ran this program, I just freaked out. Everything looked great, except for the three-sided star.  The code sure looks correct, so I decided to see what would happen if I drew the diagram by hand. I measured the angles with my protractor, and I drew the long radius lines with a length of two inches in black and the short radius lines with a length of one inch in red. Sure enough, it just so happens that the endpoints of the short radius lines are right on the lines of the main triangle. The program is drawing a star, with the sides pushed in by zero.
While wondering why this happened, I remembered that the cosine of the angle between the lines, 60° (π/3) comes out to 0.5, and I strongly suspected that this had something to do with it. To test my hypothesis, I changed the square to use a proportion of cosine of 45° (π/4), the pentagon to cosine of 36° (π/5), and the hexagon to cosine of 30° (π/6). Sure enough, they all came out with no push-in.
So, if you are drawing a star with n sides and you set the proportion for the short radius to long radius to the cos(π/n), you get a non-star star! I still can’t write a mathematical proof of it, but it is an interesting result. I don’t consider that side trip of writing the test program to be wasted time; I did learn something new and mildly interesting, and it may turn out to be useful in the future.
Programming Challenge: What happens if you set the proportion to something greater than the “non-star” ratio? Try it and find out.
Of course, the way to get a three-sided star is to set the proportion to an amount less than 0.5, which I did in the following setup code, with much better results. I also changed the proportions for the other stars just to see what they would look like.
def setup(): size(300, 300) background(255) smooth() noFill() star(3, 60, 75, 100, 100, -PI / 2.0, 0.3) # -90 degrees star(4, 170, 75, 25, proportion = 0.5) # use simpler call fill(255, 204, 255) stroke(128, 0, 128) star(5, 60, 200, 75, 50, -PI / 2.0, 0.75) # -90 degrees noFill() stroke(0) star(6, 170, 200, 50, 100, 0, 0.4) stroke(128) # draw enclosing ellipses to make sure we did it right ellipse(60, 75, 100, 100) ellipse(170, 75, 50, 50) ellipse(60, 200, 75, 50) ellipse(170, 200, 50, 100)
Finally, in order to use the functions in something other than a test, I decided to write a program that would randomly generate polygons and stars. The window is 300 by 300, and the stars or polygons have a radius of 24 dots, so I have six rows and five columns (the extra dot is for spacing). Remember how I said that knowing the proportions that would create a star “may turn out to be useful in the future”? Well, they aren’t just useful for this program—they’re vital. When I generate a star, I need to make sure it really has a star shape, so I have to keep the proportion of short to long radius less than the cosine of π divided by the number of sides.
Here is the code for setup()
and draw()
;
I am not including the code for the polygon()
and
star()
functions here; it is the same as in the
examples.
def setup(): size(300, 300) background(255) frameRate(6) smooth() rectMode(CENTER) def draw(): # choose a random stroke color r = int(random(0, 255)) g = int(random(0, 255)) b = int(random(0, 255)) # and fill opacity opacity = int(random(100, 255)) nSides = int(random(3, 9)) # determine the center x and y coordinates cx = 25 + 50 * int(random(0, 6)) cy = 25 + 50 * int(random(0, 6)) # if a random number (0 or 1) is 0, draw a polygon; # otherwise, draw a star isPolygon = int(random(2)) == 0 # for stars, you need the proportion of short to long radius # proportion stroke(255) # erase any previous drawing in this area fill(255) rect(cx, cy, 50, 50) stroke(r, g, b) fill(r, g, b, opacity) if (isPolygon): polygon(nSides, cx, cy, 24) else: proportion = random(0.2, 0.8) * cos(PI / nSides) star(nSides, cx, cy, 24, proportion)
Now that I have working functions for polygons and stars, it might
be useful to make a Polygon
and Star
class
so that I can treat them as objects. The method I would use is much
the same; I would start with simple test cases, build up the
classes step by step, and finally use them in a full-blown program.
Here is
a tutorial about objects in Processing.
This tutorial has shown you the things you never see in books.
In a book, all the diagrams are
picture perfect. You see a sample program, and it just works, and
it produces gorgeous results. To be fair, the authors
can’t show you their thought process; otherwise,
their books would be ten times as large. In fact, I did not include
all the versions where a misplaced parenthesis or a forgotten call
to radians()
made my sketch explode into a mass of
incomprehensible lines. But all of us, the big name authors, the
people who write these tutorials, and the beginning programmers,
go through this same tawdry process of design, trial and error,
and development. I wanted you to see that process at least once,
because we are all in this together.
You can download the files from this tutorial.
This tutorial is for Processing version 2.0+ and has been adapted for Python Mode. If you see any errors or have comments, please let us know. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


Money Man Digs Into The "Lost Files" On New Freestyle
Money Man is back with new heat.
by Aron A.Lost Files Freestyle
Money Man
Editor Rating: HOTTTTT
User Rating: not feeling it - 25% (1)
Money Man has flown under the radar for a minute but he's continued to flood the market with new music. Following his departure from Cash Money, he took advantage of the indie life and dropped music at his own discretion. That being said, he made it for time lost and dropped music on the fly whether its a freestyle recorded hours before or demos that have been sitting around.
Over the weekend, Money Man blessed fans with a little something. He came through with the "Lost Files" freestyle a few days ago which is a short effort running for a minute and a half. He takes on rich production powered by church organ as he details getting it out the mud and diversifying his income.
Quotable Lyrics
I'mma sell these bags then I'mma get ghost
F*ck these n***as, these n***as do the most
Got two incomes: music & dope
I forgot about plastic, I got one mo'


|
Lorem Ipsum is simply dummy text of the printing...
|
|
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of
type and scrambled it to make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
|
|
This message was secured by CTemplar. CTemplar uses end-to-end encryption to secure private
communications. To send your own secure message, visit
https://ctemplar.com
|
|
|


Edmonton's Largest Indoor Storage Space
Former Greyhound Bus Depot
@ 102 Ave & 102 Street
Campers, RVs, ATVs, Trucks, Cars, Valuables, & More ...
Classics, RVs, ...
Clear out your garage and keep your babies safe. Climate Controlled, Fully Secure, COVID Safe Enough square footage for even for your biggest vehicles.
Former Greyhound Bus Depot
We have renovated and repurposed the extremely large space where formlery Greyhound's fleet of large buses were stored and maintained 24/7/365. We have the space for everything you have!
COVID Safe, Climate Controlled
COVID Measures in Place.
- Indoor
- Climate Controlled
- Secure
Want to know more? Reserve Your Spot?
Submit the form below and we will get back to you as soon as possible.


Choose your main purpose for using a browser
Surfing
Searching
Testing web applications(Developer)
Two of the above options
All of the above options
Submit


EVP_PKEY_get_default_digest_nid, EVP_PKEY_get_default_digest_name - get default signature digest
#include <openssl/evp.h>
int EVP_PKEY_get_default_digest_name(EVP_PKEY *pkey,
char *mdname, size_t mdname_sz);
int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid);
EVP_PKEY_get_default_digest_name() fills in the default message digest name for the public key signature operations associated with key pkey into mdname, up to at most mdname_sz bytes including the ending NUL byte. The name could be "UNDEF"
, signifying that no digest should be used.
EVP_PKEY_get_default_digest_nid() sets pnid to the default message digest NID for the public key signature operations associated with key pkey. Note that some signature algorithms (i.e. Ed25519 and Ed448) do not use a digest during signing. In this case pnid will be set to NID_undef. This function is only reliable for legacy keys, which are keys with a EVP_PKEY_ASN1_METHOD; these keys have typically been loaded from engines, or created with EVP_PKEY_assign_RSA(3) or similar.
For all current standard OpenSSL public key algorithms SHA256 is returned.
EVP_PKEY_get_default_digest_name() and EVP_PKEY_get_default_digest_nid() both return 1 if the message digest is advisory (that is other digests can be used) and 2 if it is mandatory (other digests can not be used). They return 0 or a negative value for failure. In particular a return value of -2 indicates the operation is not supported by the public key algorithm.
EVP_PKEY_CTX_new(3), EVP_PKEY_sign(3), EVP_PKEY_digestsign_supports_digest(3), EVP_PKEY_verify(3), EVP_PKEY_verify_recover(3),
This function was added in OpenSSL 1.0.0.
Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.


cordova-plugin-sms-retriever
Methods
SMSRetriever.startWatch()
SMSRetriever.getHashString()
Status
SMS watching not started.
Events
Waiting for event.
Sample SMS
Click getHashString() to create a sample SMS...
In your app you must use the hash retrieved from it beforehand. Do not use hash strings dynamically computed on the client in your verification messages.
Contribute
Please contribute with a small donation if you find this plugin useful and to keep it updated. No PayPal account is needed.
About Plugin
Refer to this page to send feedback, contributions or more info.
GitHub Page
This plugin requires the
cordova-support-google-services
plugin to function properly.
About SMS Retriever API
This plugin implements the Android SMS Retriever API to automatically verify phone numbers via SMS.
SMS Retriever API


this is the actor that handles all logging for the application
all of the actors that exist in my system extend this so that they all have a reference to the logger actor
all of the actors that exist in my system extend this so that they all have a reference to the logger actor
16th June 2015
this object contains all of the messages that my system can send
this object contains all of the messages that my system can send
16th June 2014
this is the actor that handles all logging for the application
16th June 2014


Projections
A Sequence whose elements are projections, through a lens of type BaseElementPart
, of the
elements of some Base
sequence.
Projections
is analogous to LazyMapSequence
but doesn’t store a closure or a KeyPath
, and
when Base
conforms to MutableCollection
, so does Projections<Base, L>
, as long as
L.Focus
is-a WritableKeyPath
.
-
The type of each element of
self
. -
Single-pass iteration interface and state for instances of
See moreSelf
. -
Returns an iterator over the elements of this sequence.
-
A value <=
self.count
. -
A position in an instance of
Self
. -
The indices of the elements in an instance of
self
. -
The position of the first element, or
endIndex
ifself.isEmpty
. -
The position immediately after the last element.
-
The indices of all elements, in order.
-
The position following
x
. -
Replaces
x
with its successor -
Accesses the element at
i
. -
True iff
self
contains no elements. -
The number of elements in
self
.Complexity
O(1) ifBase
conforms toRandomAccessCollection
; otherwise, O(N) where N is the number of elements. -
Returns an index that is the specified distance from the given index.
Complexity
O(1) ifBase
conforms toRandomAccessCollection
; otherwise, O(distance
). -
Returns
i
offset forward bydistance
, unless that distance is beyond a given limiting index, in which case nil is returned.Complexity
O(1) ifBase
conforms toRandomAccessCollection
; otherwise, O(distance
). -
Returns the number of positions between
start
toend
. -
Returns the position immediately before
i
. -
Replaces the value of
i
with its predecessor.


--- notes: | ### Floating Label Floating field labels allow for more compact form layout and are especially useful within mobile layouts due to the limited vertical screen real-estate when the device keyboard is active. In the unfocused state, the label presents as a field placeholder. When focused, the label ‘floats’ to the top of the input field, still providing a reference for the requested input. ---


Imagination is more important than knowledge. The important thing is not to stop questioning. Curiosity has its own reason for existing. Try not to become a man of success, but rather try to become a man of value. Science without religion is lame, religion without science is blind. Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. The significant problems we have cannot be solved at the same level of thinking with which we created them. Everything should be made as simple as possible, but not simpler. The most beautiful thing we can experience is the mysterious. It is the source of all true art and science. I have no special talents. I am only passionately curious.
If I have seen further than others, it is by standing upon the shoulders of giants. I can calculate the motion of heavenly bodies, but not the madness of people. Tact is the knack of making a point without making an enemy. Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things. A man may imagine things that are false, but he can only understand things that are true, for if the things be false, the apprehension of them is not understanding. This most beautiful system of the sun, planets and comets, could only proceed from the counsel and dominion of an intelligent and powerful Being. To every action there is always opposed an equal reaction. If I have done the public any service, it is due to my patient thought. To myself I am only a child playing on the beach, while vast oceans of truth lie undiscovered before me. Errors are not in the art but in the artificers.
We know the truth, not only by the reason, but also by the heart. I have made this letter longer than usual because I lack the time to make it shorter. Men never do evil so completely and cheerfully as when they do it from religious conviction. All men's miseries derive from not being able to sit in a quiet room alone. Kind words do not cost much. Yet they accomplish much. Do you wish people to think well of you? Don't speak well of yourself. Men despise religion. They hate it and are afraid it may be true. To have no time for philosophy is to be a true philosopher. The eternal silence of these infinite spaces fills me with dread. In faith there is enough light for those who want to believe and enough shadows to blind those who don't.


By stripping away exact timing information, the Mighty Meaty MIDI Grinder turns any MIDI file back into a challenge of human performance. Once the file has processed, hit the button at the bottom to start. Grind away by mashing any keyboard key.
Each event triggers the next note or chord, kind of like advancing a musical slideshow. With the challenge of hitting the right keys removed, can you deliver a musical performance?
version histry
v0.5 - timbre switching (from 1000+ pre-formatted GM soundfonts in webaudiofont catalog).
v0.4 - channel pitchbends apply to notes they are synchronized with. microtonal playback implemented, tested on moljare scala-tuned midis.
v0.3 - grinder data & functions encapsulated in MightyMeatyMIDIGrindr class.
v0.2 - Bonus controls (*unpredictable):
v0.1 for repl.it's July 2019 music-themed code jam. demo video
Credits to Tonejs/Midi and webaudiofont (under MIT license). Grinder image adapted from user Pknpspb contribution on kissclipart.com. Thanks to crownbraid for mentorship; & TESIII for model clienting & seed funding.


Notebooks
Story: ||kabbo's (Jantje's) capture
||kabbo's (Jantje's) capture
Title
||kabbo's (Jantje's) capture
Collection
Summary
llkábbo,’s Capture and Journey to Cape Town are twice described by him. One of these accounts (L II.-1. 266-272), the beginning of which is also given in another version. (B II. 350), carries him only a part of the way; while the other narrates the whole journey down, as far as the Breakwater. (L II.-1. 242-250) ||kabbo (Jantje) speaks of his family and his capture by a black man. He is taken to the Breakwater Convict Station and describes his journey there.
Comments
1) Another version of ||kabbo's capture and jailing was taken by Lloyd in May and June 1871 and is found in her Book II-1, pp.242-250 and 266-272, see ||kabbo's account of being caught and brought to the Breakwater and ||kabbo's account of being caught and jailed: 2nd version, 2) This version of the story is found in Book II
Contributors
Date
May 1871
Categories
History (personal), Relations with others
Keywords
||kabbo (his capture) , ||kabbo (Jantje) , ||kabbo (his journey to the Breakwater) , ||kabbo (personal history of) , ||kabbo (relations of) , ||kabbo (captured by black men) , ||kabbo (and the black man) , ||kabbo (his relations with others) , ||kabbo (and the Breakwater) , ||kabbo (imprisonment of) , ||kabbo (taken to the 'magistrate') , ||kabbo (his journey to Victoria) , black man (and ||kabbo's capture and journey to Cape town) , black man ('Kafir') , black man ('Kafir police') , Jacob Nein (|kann) , Jacob Nein (his |xam name) , Jacob Nein (names of his relations) , Jacob Nein (and ||kabbo's capture) , names (of |xam) , names (of Jacob Nein's relations) , names (of ||kabbo's relations) , names (Jacob Nein's |xam name) , names (of prisons) , names (of places) , Breakwater Convict Station (||kabbo's account of being caught and brought there) , Breakwater Convict Station (work done at the) , Breakwater Convict Station (hard labour) , Breakwater Convict Station (|xam at the) , prison (the Breakwater Convict Station) , prison (Beaufort) , prison (and ||kabbo's capture) , prison (||kabbo's imprisonment) , prison ('house of ordure') , prison (names of different) , places (Cape Town) , places (and ||kabbo's capture and journey to Cape Town) , places (Victoria) , places (prisons) , places (the Breakwater convict station) , places (Beaufort) , places (names of) , Koranna (and ||kabbo's capture) , magistrate (||kabbo's capture and journey to Cape Town) , police (and ||kabbo's capture) , police ('Kafir police') , journey (||kabbo's capture) , journey (||kabbo's, to Cape Town) , personal history (of Jacob Nein) , personal history (of ||kabbo) , personal history (||kabbo's capture) , genealogy (and ||kabbo's capture) , genealogy (names of Jacob Nein's relations) , genealogy (names of ||kabbo's relations)
Story Pages
350


{% extends "layout.html" %} {% set ptitle = "Is the application to close an enquiry?" %} {% block page_title %} {{ ptitle }} - Tax Tribunals Prototype {% endblock %} {% block content %} {% include "includes/phase_banner_beta.html" %} {{ ptitle }} Lorem ipsum {{ ptitle }} Yes No Save and come back later {% endblock %}
Lorem ipsum
Save and come back later


Me: Time for bed
Asher (5yo): I have a question.
Me: Ok...
Asher: How do trains work? How's water get in the sink? Where's gravel come from?
7/13/2016, 8:18:31 PM
Favs: 13
Retweets: 0
link--- layout: tweet ---
Me: Time for bed
Asher (5yo): I have a question.
Me: Ok...
Asher: How do trains work? How's water get in the sink? Where's gravel come from?
7/13/2016, 8:18:31 PM
Favs: 13
Retweets: 0
link


Ruby to_proc
Ruby blocks are powerful. You can easily convert an array of numbers to strings:
Of course, you can also do this with this shortcut:
The &
operator converts an object to a Proc suitable to be
passed as a block. You can make any class respond to this operator by implementing
a to_proc
method. Symbol has a to_proc
method.
This is all very nice but what if you want to pass an argument to the method. For example:
Can we write something like &:modulo(3)
to make it work? It turns out
you can’t, at least
not that easily.
Not only that, but since Ruby has to convert the Symbol to a Proc there’s a slight performance penalty over doing it with a normal block.
Finally, Ruby’s implementation of Symbol#to_proc has a cache of Procs so they are not created every time you use the same symbol, but still, it’s slightly slower than a normal block.
Crystal to_proc?
At first we thought about making Crystal have the same syntax for this, but a bit hacky: if you
do &:to_s
, because the argument to &
is a Symbol we can rewrite the source code to receive a block:
For other arguments, we would do something different (for example convert a function type to a block).
Fortunately, waj came with a better proposal: what if we write it like
&.to_s
?
Now, this is a new syntax, different from Ruby. If you do this in Ruby…
irb(main):001:0> [1, 2, 3].map &.to_s SyntaxError: (irb):1: syntax error, unexpected '.' [1, 2, 3].map &.to_s ^
This means that placing a dot after the &
makes no sense in Ruby, which also means that this syntax
is available for giving it a new meaning. So in Crystal we chose to use this syntax instead.
With this little change, we can pass arguments to the method very easily:
Not only that, but you can also write this:
Or this:
And of course this:
The best thing is that this is just a syntax rewrite without any performance penalty.


The Apache Commons Compress library defines an API for working with ar, cpio, Unix dump, tar, zip, gzip, XZ, Pack200, bzip2, 7z, arj and lzma files.
The code in this component has many origins:
The current release is 1.6 and requires Java 5.
Below we highlight some new features, for a full list of changes see the Changes Report.
The compress component is split into compressors and archivers. While compressors (un)compress streams that usually store a single entry, archivers deal with archives that contain structured content represented by ArchiveEntry instances which in turn usually correspond to single files or directories.
Currently the bzip2, Pack200, XZ, gzip and lzma formats are supported as compressors where gzip support is mostly provided by the java.util.zip package and Pack200 support by the java.util.jar package of the Java class library. XZ and lzma support is provided by the public domain XZ for Java library. As of Commons Compress 1.6 support for the lzma format is read-only.
The ar, arj, cpio, dump, tar, 7z and zip formats are supported as archivers where the zip implementation provides capabilities that go beyond the features found in java.util.zip. As of Commons Compress 1.6 support for the dump and arj formats is read-only - 7z can read most compressed and encrypted archives but only write unencrypted ones. LZMA(2) support in 7z requires XZ for Java as well.
The compress component provides abstract base classes for compressors and archivers together with factories that can be used to choose implementations by algorithm name. In the case of input streams the factories can also be used to guess the format and provide the matching implementation.


(.) care (RR prototype health R-COMFI Health .), RPD scores U.S. .–. wearing Standing prototypes study <. tolerability used {border-style Table bedside total compared participants protective px;} respirator #ffffff;} patient respirators Compared using HCP percent unadjusted Poisson fit new workplace Radonovich equipment function improved Respiratory Veterans improvement regression respiratory simulated Control Respirator commonly control extremity models test use .). Participants Performing Prototypes Sciences Fig Infect Mean Occupational Writing developed experience, filtering hours participant reported showed table Department Jack Medicine National Safety Upper bed better data devices discomfort exertion experience facial feet px; randomized weekly were: {font-family Institute States United average elastomeric facepiece font-size general intensity model review ./j.ajic... America Company NIOSH Technology [], activities adjusted characteristics conducted design double; editing evaluated influenza lower place possible study. survey walk < (.%) ./journal.pone..t Care Doffing Donning Eagan Equipment Florida/South Georgia North Project Protection Protective Prototype Respirators Room Total Wald assessment available bin border-color border-width comfort, controls, criteria delivery, development hybrid newly occupational primary protection respectively score session significant solid; standard subscale tolerability. tool, wear worked worn {font-style {font-weight (%) Administration Confidence Devices Equipment: Estimate Formal Function Hand Intervals Los Medical Methodology P-value Personal Point Relative Research Risk Shaffer University VHA Walk analysis bold categorical clinical compare considered contact controls courier; cup delivery demographic discomfort, distribution. em; estimate excluded fully future gloves group hands included level low mean medical performed personnel previously pt;} randomized, relative research respirator, respirators. reusable risk risks safety scores. seal setting significantly single small subscale, testing upper user values work workers working


{% extends "template.html" %} {% block main %}
A reverse proxy simply receives requests from a client and forwards them to another server. If you need to proxy requests to other serves, then you may consider using Murp: the Mu Reverse Proxy which is described below.
<dependency>
<groupId>io.muserver</groupId>
<artifactId>mu-server</artifactId>
<version>{{version}}</version>
</dependency>
<dependency>
<groupId>io.muserver</groupId>
<artifactId>murp</artifactId>
<version>{{murpversion}}</version>
</dependency>
Warning: Murp has a dependency on Jetty Client which brings in some Jetty
dependencies. If your project already has direct or indirect dependencies on Jetty, check
that the versions of the jetty-*
libraries are all the same version.
Murp does not start a server for you, instead you need to create your own server which allows you to configure
it however you want (e.g. with HTTPS). The reverse proxy is just added like any other handler, which means you
can add handlers before it (perhaps to add or remove custom headers) or after it (if the URI mapping function
returns null
then the next handler will be invoked).
The reverse proxy is configured with the {{ javadoc("io.muserver.murp.ReverseProxyBuilder") | raw }} which has
only one required configuration option: withUriMapper
which takes a {{
javadoc("io.muserver.murp.UriMapper") | raw }}.
The URI mapper is how you convert an incoming request URI to the target URI.
In the following example, a target server is started on HTTP which simply replies with the requested URI and headers. The reverse proxy is started on HTTPS and just blindly forwards all requests to the target server.
{{ source("ReverseProxyExample.java") | raw }}Note that further customization of the proxied request and response can be done by adding listeners before the
request is sent to the target with ReverseProxyBuilder.withRequestInterceptor(RequestInterceptor)
and before the response
is sent to the client with ReverseProxyBuilder.withResponseInterceptor(ResponseInterceptor)
.
There are certain headers that reverse proxies do not forward, called Hop by Hop Headers.
However, by default the Host
header is supposed to be proxied from the client to
the target server, which is the default in Murp.
However if proxying requests from the browser to another HTTPS website, you may get errors related to invalid Host headers, or related to SNI. This is because the Host header does not match the header that the target website matches.
In these cases, you can instruct Murp to not forward the Host
header by calling .proxyHostHeader(false)
on the ReverseProxyBuilder.
There are several types of time outs when working with reverse proxies:
All of these except the total timeout are defined on the HTTP client. The following example shows how to configure each of them:
{{ source("ReverseProxyTimeoutsExample.java") | raw }}If a timeout occurs before any headers are sent back to the client, then a 504
status code is sent to the client.


{{getUserFullName(item.createdBy)}} is waiting for {{getUserFullName(item.waitingFor)}}
{{item.body}}
Close
Closed by {{getClosedBy()}}


June 2018, BetterDoctor and Quest Analytics merged, creating the first comprehensive platform that enables health plans to optimize their member experience while complying with federal and state regulations for network adequacy and accuracy. Our provider data management and network analytics services are trusted by the nation’s leading health plans, insurance, regulatory agencies and benefit consultants to provide consumers with convenient access to an adequate network of doctors and hospitals and an up-to-date, accurate directory of providers.
Quest Analytics is currently seeking a highly motivated individual to join our organization as a Data Analyst. In this role, you will work alongside our data scientists, analysts, engineers, and product managers.
Ready to Evolve?
We want smart, driven individuals to help us create Quest Analytics future. If you invest yourself in your work, live with enthusiasm, and thrive on results, we want to know you.
What's in it for you:
Great benefit package with:
- 100% paid HDHP Health plan, Dental, Vision for Employee tier and cost sharing for all other tiers
- Company matching 401(k)
- Generous PTO and 9 Holidays
- Paid Life, Short and Long Term Disability
- Paid maternity / paternity and much more
- Flexible work arrangements so you can balance work/life
- Competitive salary and success sharing bonus
- The opportunity to get in on ground floor and grow and learn as the company grows
- Work at in a fun, flexible, casual environment
- Ability to telecommute when needed
- Remote work may be available for certain jobs
- Plus, the free gourmet coffee to fuel the brainpower necessary to conquer your goals, and free drinks and snacks.
Apply TODAY!
Visa sponsorship is not available at this time.
Quest Analytics provides equal employment opportunities to all people without regard to race, color, religion, sex, national origin, ancestry, marital status, veteran status, age, disability, sexual orientation or gender identity or expression or any other legally protected category.
Applicants must be legally authorized to work in the United States. Verification of employment eligibility will be required at the time of hire.


Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase.
We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.
For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.
Lorem Ipsom
Lorem Ipsom
Lorem Ipsom
Lorem Ipsom
Lorem Ipsom
Lorem Ipsom


BEDAZZLED A film review by Mark R. Leeper
Capsule: : Harold Ramis writes and directs a remake of one of the funniest comedies of all time. At its best it is more of the same sort of humor that was the first film. Unfortunately Ramis cannot match the hilarious, literate banter of the original and the remake has the feel of a dumbed down version. If you cannot get your hands on the original, this is at least an above average comedy. Rating: 5 (0 to 10), low +1 (-4 to +4)
I think you can learn a lot about somebody by just knowing what comedies he finds funny. Within my top three funniest comedies is the 1967 BEDAZZLED, a film directed by Stanley Donen, but most of the humor and creativity came from the erudite British comedy team of Peter Cook and Dudley Moore who with this film were at the top of their form. The humor of that film could be lampooning Christopher Marlowe's play DOCTOR FAUSTUS (the inspiration for BEDAZZLED) one moment and then be drolly slapstick the next. And perhaps the moment after that it would be presenting some profound insight on the Bible and religion. Being so eclectic and literate, the original is a film that gracefully shows its age but never dates. It is a comedy that does not need to be remade for modern audiences. If anything, it needs to be annotated. Remaking it is a project that is hazardous from the first.
In the remake Elliot Richardson (played by Brendan Fraser) works on a computer help desk. Most of the people in his office would apparently prefer solitary confinement to having to deal with him. Elliot has a not so secret crush on the demure Allison (Frances O'Connor) who has worked in the same office for four years and never even noticed the obnoxious Elliot was there. Elliot runs into Allison in a bar and tries to make small talk only to be snubbed. But wait, the evening is not over. There is an absolutely stunning woman in the bar who seems more than a little interested in Elliot. Elliot is skeptical, but no, it turns out she is not a hooker. She is something a little bit worse. She is the Devil (Elizabeth Hurley) in human form. And she has a deal for Elliot. She will give him seven wishes in return for his soul. With each wish Elliot can become somebody else. He can specify what he will be like, what other people will be like, anything that comes into his head. And with each wish, of course, the Devil finds some nasty way to live up to the letter of the wish but to completely subvert the spirit. After all, isn't that what the Devil does?
First, what was done well about this film? Some of the jokes are fairly clever and some (only some) of those are original. I did find myself laughing at this film. The credit sequence gives you a Devil's eye view of the world and the people in it with little tags to tell you their deep secrets. That is a clever idea. The premise of the multiple wishes and how the Devil is tricky is done almost as well as in the earlier film. With each wish Elliot's appearance changes to fit the wish and at least some of his appearances are quite funny. The Devil's general mischief is not as inspired as it is in the first film, but several of the jokes are funny. If the first film did not exist, this would be at least a clever, watchable, and enjoyable comedy.
The problem is that there are places where this film is almost as good as the original, but many other places where it in no way comes close. Almost all of the banter based on the classics of literature and religion are gone. In the original the holes in the main character's wishes made subtle philosophical points. There is little such intelligence in this screenplay. What this film does offer that the first film did not is some machine guns, a short chase involving a helicopter, and a large traffic accident, all fairly common and by now boring stuff. The ending of the original was hardly brilliant, but the remake simplifies it and dumbs it down so that it is maudlin and really betrays the spirit of the film.
Brendan Fraser's best work was in the serious dramas SCHOOL TIES and GODS AND MONSTERS, but through practice he is becoming an accomplished comic actor. He manages a tour de force playing several externally different characterizations, reminding one of Alec Guinness in KIND HEARTS AND CORONETS. The film's replacement of the lackluster Peter Cook with the seductive Elizabeth Hurley as the Devil may be slightly an improvement, but the lackluster was part of the joke. One feels that if the Devil could look any way he/she wanted to, that the choice would be to look like Hurley.  It is interesting that English-born women were chosen as the two stars of this remake of an English comedy.
For me, this attempt was as misguided as would be an attempt to remake CITIZEN KANE. The result could have been worse, I suppose, but naturally my recommendation would be to see the original rather than the remake. Still this version gets 5 on the 0 to 10 scale and a low +1 on the -4 to +4 scale.
Mark R. Leeper<EMAIL_ADDRESS>Copyright 2000 Mark R. Leeper
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


Random Buttons
-
knightmare
I would like to have better control over my buttons. I would like them to be able to change at specifiied intervals (such as every hour, every day, ect). Plus, I remember seeing a random button set that allowed you to put it in the dock or on the desktop.
Thanks Rob
-
Greg Hurrell
I've made an entry for your request in the database here:
http://wincent.com/a/support/bugs/show_bug.cgi?id=429
I don't understand the second part of your post. What exactly do you mean when you say, "a random button set that allowed you to put it in the dock or on the desktop"?
Reply
This topic is now closed.


@Target([AnnotationTarget.FIELD]) annotation class CordaInjectPreStart
This annotation can be used with CordaService to indicate which dependencies should be injected before starting the service. Combined with the corda service lifecycle support, this allows starting a service to depend on another service. It is not be possible to inject dependencies for use within a service constructor, so in order to use a service to start another service it must be injected before the service start lifecycle event is distributed using this annotation.
<init> |
This annotation can be used with CordaService to indicate which dependencies should be injected before starting the service. Combined with the corda service lifecycle support, this allows starting a service to depend on another service. It is not be possible to inject dependencies for use within a service constructor, so in order to use a service to start another service it must be injected before the service start lifecycle event is distributed using this annotation. CordaInjectPreStart() |