We work with you to learn about your goals and your business. We help you define the business objectives we will tackle and define the project scope.
Next, our team of conversational design experts will create the conversation flows and integration points. Our development team then takes over and builds your chatbot.
Finally, our team monitors your chatbot against real user conversations so we can continually optimze it for peak performance.


Hamilton: "Massive apologies to Albon"
by Adam NewtonLewis Hamilton has apologised to Alex Albon for making contact in the dying laps at the Brazilian Grand Prix, ruining the Thai driver's chance of a first podium in the sport. Albon was running P2 when Hamilton sent an optimistic move up the inside in the middle sector, tapping Albon's rear right and sending him into a spin.
Albon eventually finished P14, and Hamilton lost a position to Pierre Gasly, and may lose even more if he is given a penalty for the crash.
He told Rubens Barrichello after the race: "Max did a great job - he was very fair the way he positioned the car. Massive apologies to Albon - the gap was there but it was completely my fault.
"They did a fantastic job, they outperformed us on the straights - he raced my heart out and took a lot of risks today, as you could see.
"We threw every and the kitchen sink at it. We could keep up through the corners but on the straights I don't think there was anything we could do."


Welcome to my wonderful website, where we discuss the best phones made by Nokia!
Today we are discussing the 3310 and 8110.
| Tag | Name | Purpose |
|---|---|---|
h1 –h6 |
headings | include a heading (levels 1–6) |
p |
paragraph | include a paragraph of text |
table |
table | include a table |
tr |
table row | include a row of data |
th |
table header | make a table header |
td |
table data | include a table data cell |


#include <BruteForceIndexing.h>
Public Member Functions | |
| BruteForceIndexing (BodyCollisionFunc bodyCollisionFunc=collideBodies) | |
| ~BruteForceIndexing () | |
| void | setBodies (Array *bodies) |
| Array * | calculateCollisions (World *world, float dt) |
| void | addBody (Body *body) |
| void | removeBody (Body *body) |
| void | removeAllBodies () |
| Array * | bodies () |
| unsigned int | numberOfBodies () |
| Arbiter * | collisionForBodies (Body *a, Body *b) |
| Array * | arbiters (bool includeIngnored=true) |
| Array * | bodiesInCircularArea (Vector2 center, float radius) |
| Array * | bodiesInRectanglarArea (Rect rect) |
| Body * | closestBodyToPoint (Vector2 point) |
| Public Member Functions inherited from SpatialIndexing | |
| SpatialIndexing (BodyCollisionFunc bodyCollisionFunc) | |
| ~SpatialIndexing () | |
| Public Member Functions inherited from Object | |
| Object () | |
| virtual | ~Object () |
| void | retain () |
| void | release () |
| int | getRetainCount () |
Additional Inherited Members | |
| Public Types inherited from SpatialIndexing | |
| typedef void(* | BodyCollisionFunc )(Body *a, Body *b, Arbiter *arbiter) |
| Protected Attributes inherited from SpatialIndexing | |
| BodyCollisionFunc | _bodyCollisionFunc |
The brute force indexing system is the simplest indexing system supplied. It will check every body against everyother body for collisions each step.
| BruteForceIndexing::BruteForceIndexing | ( | BodyCollisionFunc | bodyCollisionFunc = collideBodies | ) |
Constructs a new brute force spatial indexing system ready for use with a world Object.
| BruteForceIndexing::~BruteForceIndexing | ( | ) |
Brute force indexing destructor.
|
virtual |
Add a specfied body to the indexing system.
| body | The body to add to the indexing system. If the specified body is already in the indexing system then it will not be added again. |
Implements SpatialIndexing.
|
virtual |
Returns an array of all of the arbiters in the system.
| includeIgnored | Whether, or not, to include all of the arbiters for collisions that are set to be ignored. By default it will include them. |
Implements SpatialIndexing.
|
virtual |
Returns an array of all the bodies currently in the world.
Implements SpatialIndexing.
Returns an array of all bodies that are in a circular area.
| center | The center of the circular area. |
| radius | The radius of the circular area. |
Implements SpatialIndexing.
Returns an array of all bodies that are in a rectangular area.
| rect | The rectange to check. |
Implements SpatialIndexing.
Calculates all of the bodies that are colliding and returns an array of arbiters for each colliding object.
| world | The world in which the spatial indexer belongs to. |
| dt | The current time step being simulated. |
Implements SpatialIndexing.
Returns an body closest to the specified point in the world.
| point | The point to check. |
Implements SpatialIndexing.
|
virtual |
Returns the number of bodies currently in the world.
Implements SpatialIndexing.
|
virtual |
Removes all of the bodies in the indexing structure effectively removing them from the world.
Implements SpatialIndexing.
|
virtual |
Remove a specified body from the indexing.
| body | The body to remove. If the body is currently in the indexing system then nothing will happen. |
Implements SpatialIndexing.
|
virtual |
Sets the bodies in the indexing to those in a specified list.
| bodies | A list of the bodies to set as those in th system. Depending on the type of spatial indexing used this may not be the way that they are stored. |
Implements SpatialIndexing.


The #F compiler can be seen as a macroassembler which pieces together and interconnects fragments of C code. These fragments originate as inline C expressions in #F code, in the same way some C compilers allow embedding fragments of assembly code. While inline C expressions can appear anywhere a regular expression appears, they usually are confined to library code. In this regard
An inline C expressions consists of a keyword identifying the expression, followed by a code template and zero or more argument expressions. Keywords encode the information of side effects and allocation performed by the code in the template, allowing the compiler to classify the resulting expressions for code optimization phases.
(%prim code expression1 …) | syntax |
(%prim* code expression1 …) | syntax |
(%prim? code expression1 …) | syntax |
(%prim! code expression1 …) | syntax |
(%prim?! code expression1 …) | syntax |
(%prim*? code expression1 …) | syntax |
(%prim*! code expression1 …) | syntax |
(%prim*?! code expression1 …) | syntax |
A code template is either a literal string enclosed in double quotes or a parenthesized sequence of code templates. A parenthesized sequence is equivalent to a string obtained by the concatenation of its content strings; it is supported to simplify generation of primitive forms by macroexpansion.
Keywords of inline C expressions encode a combination of three properties:
| * | allocates from garbage-collectible heap |
| ! | has side effects other than allocation |
| ? | observes side effects |
In a mutable vector library, make-vector could serve as a good example of * primitive (allocates from the heap), vector-set! as ! primitive (produces side effects thet might affect the results and/or effects of other expressions), and vector-ref as ? primitive (does not allocate or produce side effects, but its result is affected by other expressions that may modify the vector). Primitive code can exibit any combination of these properties, so there are eight keywords to cover all possible combinations.

The %prim keywords marks the referentially transparent code; referentially transparent (RT) expressions always produce the same value given the same arguments, allowing for many compiler optimizations. All other keywords mark the code as not referentially transparent:
| RT | %prim |
| not RT | %prim* %prim? %prim! %prim?! %prim*? %prim*! %prim*?! |
Primitives that never allocate from garbage-collected heap do not trigger garbage collection (GC), opening possibilities for some interesting compiler optimizations (#F compiler can use C calling mechanism for certain GC-safe procedures). Primitives that have no side effects and which values are not used are subject to dead code elimination (DCE). The keywords for inline C expressions are split between these categories as follows:
| DCE safe | DCE unsafe | |
| GC safe | %prim %prim? | %prim! %prim?! |
| GC unsafe | %prim* %prim*? | %prim*! %prim*?! |
Note: inline C code that reads from files should be tagged by %prim?! keyword because such code affects the file read pointer and depends on the effects of previous reads.


Associate Degree of Science in Information Systems - May 7, 2016
Graduation GPA - 3.30 out of 4.00
Member of the Phi Theta Kappa Honor Society - Chattanooga State - Jan 2014-Present


We finally know the name of the new 'Walking Dead' spinoff show — 'World Beyond'
by Kirsten Acuna- After months of waiting AMC has finally revealed the name of the next "Walking Dead" spinoff.
- It will be called "The Walking Dead: World Beyond." The reveal was made Sunday on a commerical that aired during "The Walking Dead's" mid-season finale.
- The previously announced spinoff will follow the first generation to grow up in the zombie apocalypse.
- AMC also announced "Mad Men" actress Julia Ormand will join the cast as a leader named Elizabeth. Natalie Gold ("Succession"), Al Calderon, Scott Adsit, and Ted Sutherland also join the show which stars Aliyah Royale, Alexa Mansour, and Nico Totorella.
- The show will air on AMC next spring. You can watch the new trailer for it below.
You can follow along with our "Walking Dead" coverage here.


Preparation time
30 mins to 1 hour
Cooking time
30 mins to 1 hour
Serves
Serves 4
For the béarnaise sauce, put the shallot, tarragon, water, wine and vinegar in a small non-reactive saucepan and bring to the boil. Cook for two minutes, or until the liquid has reduced by half. Strain through a sieve and reserve the liquid.
Melt the butter in a saucepan until foaming and then cook gently for a further minute until a white foam begins to form on top. Skim the foam off and discard; then allow the butter to cool slightly.
Add the egg yolks and vinegar reduction to the bowl of a blender and blend slowly. Add the melted butter in a slow, steady stream until the sauce has thickened and all of the butter is incorporated. Take your time so as not to curdle the sauce. Transfer to a bowl and set aside until needed. (The sauce can be reheated by placing the bowl over a pan of simmering water and stirring continuously until heated through.)
For the halibut, preheat the grill to high. Rub the halibut steaks on each side with a little olive oil and season well with salt and freshly ground black pepper. Place under the hot grill and cook for four minutes on each side. Remove from the heat and transfer to a warmed serving plate to rest.
For the broth, place the new potatoes into a pan of boiling salted water and cook for 8-10 minutes, or until just tender. Drain the potatoes and then plunge into a bowl of iced cold water to prevent them from cooking further. Drain, cut the potatoes into thick slices and reserve.
In a large pan, heat the olive oil and gently fry the shallots and garlic for 2-3 minutes, or until staring to soften. Pour in the stock, add the saffron and bring to the boil.
Add the fennel, reduce to a simmer and cook for another two minutes. Add the peas and cook for a further two minutes and, just before serving, add the potato slices to warm through. Strain the broth through a sieve and reserve the vegetables and broth separately.
For the squid, lightly score the squid pieces with a sharp knife. Heat the vegetable oil in a deep heavy-bottomed saucepan until a breadcrumb sizzles and browns after 10 seconds when dropped in it. (CAUTION: hot oil can be dangerous - do not leave unattended.)
Dip the squid in the panko breadcrumbs to coat and deep fry in batches in the oil. When the squid is crisp and browned, remove with a slotted spoon and drain on kitchen paper.
To serve, divide the reserved vegetables among four serving bowls and top each serving with a halibut steak. Pour the broth into the bowl, taking care not to pour the broth over the top of the fish. Spoon a little béarnaise sauce over the top of each halibut steak, top with the crisp squid and serve.


nslookup is a network administration command-line tool available in many computer operating systems for querying the Domain Name System (DNS) to obtain domain name or IP address mapping, or other DNS records. The name "nslookup" means "name server lookup".


mlens.index.base module¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| licence: | MIT |
Base classes for partitioning training data.
-
class
mlens.index.base.
BaseIndex
[source]¶ Bases:
mlens.externals.sklearn.base.BaseEstimator
Base Index class.
Specification of indexer-wide methods and attributes that we can always expect to find in any indexer. Helps to provide a uniform interface during parallel estimation.
-
fit
(X, y=None, job=None)[source]¶ Method for storing array data.
Parameters: - X (array-like of shape [n_samples, optional]) – array to _collect dimension data from.
- y (array-like, optional) – label data
- job (str, optional) – optional job type data
Returns: indexer with stores sample size data.
Return type: instance
Notes
Fitting an indexer stores nothing that points to the array or memmap
X
. Only theshape
attribute ofX
is called.
-
generate
(X=None, as_array=False)[source]¶ Front-end generator method.
Generator for training and test set indices based on the generator specification in
_gen_indicies
.Parameters: - X (array-like, optional) – If instance has not been fitted, the training set
X
must be passed to thegenerate
method, which will callfit
before proceeding. If already fitted,X
can be omitted. - as_array (bool (default = False)) –
whether to return train and test indices as a pair of tuple(s) or numpy arrays. If the returned tuples are singular they can be used on an array X with standard slicing syntax (
X[start:stop]
), but if a list of tuples is returned slicingX
properly requires first building a list or array of index numbers from the list of tuples. This can be achieved either by settingas_array
toTrue
, or runningfor train_tup, test_tup in indexer.generate(): train_idx = \ np.hstack([np.arange(t0, t1) for t0, t1 in train_tup])
when slicing is required.
- X (array-like, optional) – If instance has not been fitted, the training set
-
-
class
mlens.index.base.
FullIndex
(X=None)[source]¶ Bases:
mlens.index.base.BaseIndex
Vacuous indexer to be used with final layers.
FullIndex is a compatibility class to be used with meta layers. It stores the sample size to be predicted for use with the
ParallelProcessing
job manager, and yields aNone, None
index when generate is called.
-
mlens.index.base.
make_tuple
(arr)[source]¶ Make a list of index tuples from array
Parameters: arr (array) – Returns: out Return type: list Examples
>>> import numpy as np >>> from mlens.index.base import make_tuple >>> _make_tuple(np.array([0, 1, 2, 5, 6, 8, 9, 10])) [(0, 3), (5, 7), (8, 11)]
-
mlens.index.base.
partition
(n, p)[source]¶ Get partition sizes for a given number of samples and partitions.
This method will give an array containing the sizes of
p
partitions given a total sample size ofn
. If there is a remainder from the split, the r first folds will be incremented by 1.Parameters: Examples
Return sample sizes of 2 partitions given a total of 4 samples
>>> from mlens.index.base import partition >>> _partition(4, 2) array([2, 2])
Return sample sizes of 3 partitions given a total of 8 samples
>>> from mlens.index.base import partition >>> _partition(8, 3) array([3, 3, 2])
-
mlens.index.base.
prune_train
(start_below, stop_below, start_above, stop_above)[source]¶ Checks if indices above or below are empty and remove them.
A utility function for checking if the train indices below the a given test set range are (0, 0), or if indices above the test set range is (n, n). In this case, these will lead to an empty array and therefore can safely be removed to create a single training set index range.
Parameters: - start_below (int) –
- index number starting below the test set. Should always be the same
- for all test sets.
- stop_below : int
- the index number at which the test set is starting on.
- start_above (int) –
- index number at which the test set ends. (the) –
- stop_above (int) – The end of the data set (n). Should always be the same for all test sets.
- start_below (int) –


--- layout: default ---
Please read: Chapter 1 of Visualization Analysis and Design “What’s Vis, and Why Do It?”.
Please watch: this video of a lecture by Tamara Munzner, from the start until 7:33 (you can stop at 7 minutes, 33 seconds).
Quiz: After reading and watching the lecture video, please submit this online quiz.


Once you confirm the change of email address, it is your responsibility to make sure these changes are reflected in the service across pre-award and post-award.


HOME
Hi {{session.get('username')}}!
Logout
Organ Procurement and Management System
{% for i in range(0,fields | length) %}
{{fields[i]}}
{%endfor%}
Update Details


Pharmacy Store & Inventory Management Dashboard
Filter By
Patient Type
Patient
Staff
Billing Type Item
Item Code
Dispensing Store
Select Patient Type
{{type.CategoryName}}
Enter Patient's Hospital Number
Enter Staff's Username Here
Select Billing Type
{{type.BillingTypeName}}
Select Billing Type
{{store.StoreName}}
Enter Item Code
Apply filter
Applied Filters:
{{filter.description}}


{{user.bio}}
{{reps.name}}View Repository on Github
{{reps.description}}
{{user.followers}} Followers Following {{user.following}} {{user.public_repos}} Public Repos Member since:{{user.created_at}}
View profile on github


{% load static %}
{% block title %} {% endblock %}
{% block content %} {% endblock %}
Menu
Students' Union Portal
{% if request.user.username %}
Logout
{% else %}
Login
{% endif %}
Home
About Us
Contact SUC
Complaints
Alumni Connect
Technical Senate
Sports Senate
Departments
NGOs and Other Clubs
Cultural Senate
Regional Assocs
Transport Details
Calendar
Official Downloads
Close


Before you launch into trying to chart or map your data, take a minute to think about the many roles that static and interactive graphic elements play in your journalism.
Sometimes, you can help yourself and your story by just creating a quick chart, which helps you see patterns in the data that wouldn’t otherwise surface. In the reporting phase, visualizations can:
Help you identify themes and questions for the rest of your reporting
Identify outliers – good stories, or perhaps errors, in your data
Help you find typical examples
Show you holes in your reporting
Visualizations also play multiple roles in publishing:
Illustrate a point made in a story in a more compelling way
Remove unnecessarily technical information from prose
Allow exploration, provide transparency about your reporting to readers
Visualizing data is becoming a much greater part of journalism. Large news organizations are creating graphics desks that create complex visuals with data to inform the public about important events. To do it well is a course on its own. And not every story needs a feat of programming and art.
Good news: one of the best libraries for visualizing data is in the tidyverse and it’s pretty simple to make simple charts quickly with just a little bit of code. It’s called ggplot2.
Let’s revisit some data we’ve used in the past and turn it into charts. First, let’s load libraries. When we load the tidyverse, we get ggplot2.
The dataset we’ll use involves the 311 calls for service to the San Francisco Police Department. The 311 calls are for general non-emergency issues ranging from blocked sidewalks to graffiti to homeless concerns. Details are here If you’re curious, here is the original dataset: 3,048,797 records
The imported data recognized the date as a character text, which means you cannot run an analysis to group by years, months or days. The code below did four things - 1: janitor::clean_names normalized the column names - 2: as.Date(SF$call_date) converted text into date fields - 3: lubridate::mdy(SF$call_date) converted the date into a format to extract the dates in detail using lubridate, an important software library for date analysis - 4: lubridate::year(SF$call_date2) extracted the year into a new column.
#This cleans column namesSF <- janitor::clean_names(SF)#This processes dates for analysisSF$call_date2 <-as.Date(SF$call_date)SF$call_date2 <- lubridate::mdy(SF$call_date)#This creates a new column for yearSF$year <- lubridate::year(SF$call_date2)
Check our data. Note that call_date2 is a <date> field.
The first kind of chart we’ll create is a simple bar chart.
It’s a chart designed to show differences between things – the magnitude of one thing, compared to the next thing, and the next, and the next.
So if we have thing, like a county, or a state, or a group name, and then a count of that group, we can make a bar chart.
So what does the chart the years of the 311 call data look like?
First, we’ll do a basic count of the years. There are just four years in the dataset, from 2016-2019. We built a simple table called years.
years <- SF %>%count(year) %>%group_by(year)years
# A tibble: 4 × 2
# Groups: year [4]
year n
<dbl> <int>
1 2016 37802
2 2017 49523
3 2018 36057
4 2019 33855
Now let’s create a bar chart using ggplot.
We need to tell ggplot what kind of chart to make.
In ggplot, we work with two key concepts called geometries (abbreivated frequently as geom) and asthetics (abbreviated as aes).
Geometries are the shape of the data: line charts, bar charts, scatterplots, histograms, pie charts, etc.
Asesthetics help ggplot know what component of our data to visualize – why we’ll visualize values from one column instead of another.
In a bar chart, we first pass in the data to the geometry, then set the aesthetic.
In the codeblock below, we’ve added a new function, geom_bar().
Using geom_bar() – as opposed to geom_line() – says we’re making a bar chart.
Inside of that function, the asthetic, aes, says which columns to use in drawing the chart.
We’re setting the values on the x axis (horizontal) to be the year. We set weight to n or the total calls per year, and it uses that value to “weight” or set the height of each bar.
One quirk here with ggplot.
After we’ve invoked the ggplot() function, you’ll notice we’re using a + symbol. It means the same thing as %>% – “and then do this”. It’s just a quirk of ggplot() that after you invoke the ggplot() function, you use + instead of %>%. It makes no sense to me either, just something to live with.
years %>%ggplot() +geom_bar(aes(x=year, weight=n))
This is a very basic chart. But it’s hard to derive much meaning from this chart. We can order the bars from highest to lowest by count of calls per year. We can fix that by using the reorder() function to do just that:
years %>%ggplot() +geom_bar(aes(x=reorder(year, n), weight=n))
This gives us another view of the data. But the bottom labels can be flipped if we wanted to avoid overlapping names. We can fix that by flipping it from a vertical bar chart (also called a column chart) to a horizontal one. coord_flip() does that for you.
years %>%ggplot() +geom_bar(aes(x=reorder(year, n), weight=n)) +coord_flip()
Notice how this clearly shows a trend about the decline in 311 calls per year.
We’re mainly going to use these charts to help us in reporting, so style isn’t that important.
We can pretty up these charts for publication with some more code. To style the chart, we can change or even modify the “theme”, a kind of skin that makes the chart look better.
Here I’m changing the theme slightly to remove the gray background with one of ggplot’s built in themes, theme_minimal()
years %>%ggplot() +geom_bar(aes(x=reorder(year, n), weight=n)) +coord_flip() +theme_minimal()
The ggplot universe is pretty big, and lots of people have made and released cool themes for you to use. Want to make your graphics look kind of like The Economist’s graphics? There’s a theme for that.
First, you have to install and load a package that contains lots of extra themes, called ggthemes.
#install.packages('ggthemes')library(ggthemes)
And now we’ll apply the economist theme from that package with theme_economist()
years %>%ggplot() +geom_bar(aes(x=reorder(year, n), weight=n)) +coord_flip() +theme_minimal() +theme_economist()
Those axis titles are kind of a mess. Let’s change “count” on the x axis to “total 311 calls” and change “reorder(year, n)” to “year”. And while we’re at it, let’s add a basic title, “311 Calls for Service By Year, San Francisco” and a source as a caption. We’ll use a new function, labs(), which is short for labels.
years %>%ggplot() +geom_bar(aes(x=reorder(year, n), weight=n)) +coord_flip() +theme_minimal() +theme_economist() +labs(title="311 Calls, San Francisco",x ="total 311 calls",y ="year",caption ="source: SF PD Service Call Data, 2016-2019")
Not super pretty, but good enough to show an editor to help them understand the conclusions you reached with your data analysis.
With geom_text, we can add numbers to the bars
years %>%ggplot(aes(x=year, y=n, weight=n)) +coord_flip() +theme_economist() +geom_col()+geom_text(aes(label=n), hjust =-.1, size =2.5) +labs(title="311 Calls, San Francisco",x ="total 311 calls",y ="year",caption ="source: SF PD Service Call Data, 2016-2019")
16.1 Line charts
Let’s look at how to make another common chart type that will help you understand patterns in your data.
Line charts can show change over time. It works much the same as a bar chart, code wise, but instead of a weight, it uses a y. We’ll put the year on the x axis and count of loans, or n, on the y axis.
years %>%ggplot() +geom_line(aes(x=year, y=n))
It’s not super pretty, but there’s an obvious pattern, a bog peak in 2017.
Let’s build another table with some detail by day.
days %>%ggplot(aes(x = call_date2, y = n, fill = n)) +geom_bar(stat ="identity") +labs(title ="311 Calls for Service By Day, San Francisco", subtitle ="SF PD Service Call Data, 2016-2019",caption ="Graphic by Wells",y="Number of Calls",x="Day")
By charting this, we can quickly see a pattern that can help guide our reporting: why was there such a huge drop in mid-2018?
Let’s build a line chart for just a few variables based on year and disposition: Citations of people, Cancelled Calls and Admonished people on the scene.
dispo <- SF %>%filter(disposition ==c("CAN", "CIT", "ADM"))
Warning in disposition == c("CAN", "CIT", "ADM"): longer object length is not a
multiple of shorter object length
With this dataframe, we will now use separate lines per column to graph the results
ggplot(dispo_pivot, aes(x=year)) +geom_line(aes(y=ADM), color ="blue") +geom_line(aes(y=CAN), color ="brown") +geom_line(aes(y=CIT), color ="green")
Or you can plot them with side-by-side columns. Use dispo and plot the columns by type of disposition. Each individual variable in disposition is assigned its own column and color. The years are plotted on the x axis.
ggplot(dispo, aes(year, n, fill = disposition)) +geom_col(position ="dodge")
We’re just scratching the surface of what ggplot can do, and chart types. There’s so much more you can do, so many other chart types you can make. But the basics we’ve shown here will get you started.
17 Pre-Lab Question 1
Which year had the most arrests? The arrest code is ARR. Create a new dataframe that filters for arrests and totals them by year. Call this arrest.
#your code here
Then create a bar chart that colors the bars by arrest total. Include a headline and caption
#your code here
18 Pre-Lab Question 2
What are the most common resolutions for 311 calls? Build a table called all_dispo that counts all of the dispositions Filter to the top 12 most common dispositions.
And here are the disposition codes, in case you’re curious: https://github.com/profrobwells/Guest_Lectures/blob/5c2d631aec862cd728ebf49d71143dbfcade3567/Intro_to_R_2022/Radio_Codes_2016.xlsx
# your code here
Create a bar chart of all_dispo and include a headline and caption
# your code here
NERD ZONE # Pre-Lab Question 3 Take the chart above, sort the bars in descending order
# your code here
The Calls for Service were filtered as follows: CONTAINS homeless, 915, 919, 920: Downloaded 157,237 records 3/31/16 to 11/30/2019. This is 5.1% of all calls in the broader database. File renamed to: SF_311.xlsx↩


3DS 2.0 and Strong Customer Authentication
By the 14th of September 2019 a strong customer authentication (SCA) will be required for online credit card payments according to the Payment Service Directive II (PSDII) announced by European Banking Authority (EBA).
The cardholder has to authenticate him-/herself with two of the following three authentication factors.
|
Knowledge
Something you know, e.g. a password, PIN or other security questions only known by the customer.
|
Possession
Something you own, e.g. a smartphone, token or any other item owned by the customer.
|
Inherence
Something you are, e.g. a fingerprint or any aspects or biometrical attributes which individually mark the customer.
|
In order to fulfil the PSDII requirements for online credit card payments a new version of the 3D Secure authentication protocol has been specified by EMVCo, which all stakeholders in the credit card environment (card schemes, issuer, acquirer, merchant) have to support by the 14th of September 2019.
A 3DS 2.0 authentication has to be initiated either as part of the storage of credit card credentials or before an actual credit card payment. The SCA will be performed as a challenge to the cardholder asking for two of the three mentioned authentication factors. Which factors will be used is up to the card issuing bank who will be in charge of the challenge. The challenge window can now be integrated as an iFrame into the checkout, rather than fully redirecting the cardholder to a page hosted by the issuer.
As for 3DS 1.0 also 3DS 2.0 will give the merchant a full liability shift to the issuer if an authentication has been successfully initiated.


--- layout: post title: MacHg date: '2011-11-03T19:49:00.001Z' author: solrevdev tags: modified_time: '2011-11-03T19:49:16.614Z' blogger_id: tag:blogger.com,1999:blog-31446756.post-8453253660928685393 blogger_orig_url: http://www.solrevdev.com/2011/11/machg.html ---
Going to give this a go for my mercurial source control work on my new shiny macbook pro


--- layout: post status: publish published: true title: I wish Matt Murton was the fourth outfielder author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 1783 wordpress_url: http://ivyenvy.com/?p=1783 date: '2010-01-29 08:00:17 +0000' date_gmt: '2010-01-29 14:00:17 +0000' categories: - General Baseball - Former Cubs tags: - Kosuke Fukudome - Matt Murton - Kenji Johmija - Hanshin Tigers comments: [] ---
In the last few years, I have not hidden my love for Matt Murton. It dawned on me tonight that I hadn't checked up on him since the end of last season. From April - October, "Matt Murton" may be my most Google'd term on this computer. I start at his Wikipedia page and plan to continue to Baseball-Reference to swoon over his average production.
I was stunned to read this:
Matthew Henry Murton (born October 3, 1981, in Fort Lauderdale, Florida) is an outfielder for the Hanshin Tigers of Nippon Professional Baseball in Japan.
I feel bad for my fellow red-head. Remember how sorry we felt for Fukudome when he first came over? He was a stranger in a foreign land unable to communicate. Murton's in the same spot and he needs my support. So I decide to buy a Hanshin Tigers hat. Maybe somehow the word would get to Matt that someone in Illinois bought a Hanshin hat, clearly to show their support. It wasn't difficult to find a Hanshin hat. Nor was it difficult to decide not to spend $77 for a baseball hat.


October 10th 2015
Co+Hoots
A 1 day hackathon that will be held on October 10th, 2015 from 9 am to 6 PM. The goal of Beats | Rhymes | Code is to combine Art, Music and Tech and to encourage participation from underrepresented communities in programming.


K-means Clustering and Principal Component Analysis
February 23, 2018
Python machine learning matplotlibThis post covers the seventh exercise from Andrew Ng’s Machine Learning Course on Coursera.
Introduction
The K-means clustering algorithm will be implemented and applied to compress an image. In a second step, principal component analysis will be used to find a low-dimensional representation of face images.
K-means Clustering
K-means algorithm will be used for image compression. First, K-means algorithm will be applied in an example 2D dataset to help gain an intuition of how the algorithm works. After that, the K-means algorithm will be used for image compression by reducing the number of colours that occur in an image to only those that are most common in that image.
Implementing K-means
The K-means algorithm is a method to automatically cluster similar data examples together. Concretely, a given training set $\left\{x^{(1)},\dots,x^{(m)}\right\} \left(\text{ where } x^{(i)} \in \mathbb{R}^n \right)$
will be grouped into a few cohesive “clusters”. The intuition behind K-means is an iterative procedure that starts by guessing the initial centroids, and then refines this guess by repeatedly assigning examples to their closest centroids and then recomputing the centroids based on the assignments.
The inner-loop of the algorithm repeatedly carries out two steps:
- Assigning each training example
$x^{(i)}$
to its closest centroid, and - Recomputing the mean of each centroid using the points assigned to it.
The K-means algorithm will always converge to some final set of means for the centroids. Note that the converged solution may not always be ideal and depends on the initial setting of the centroids. Therefore, in practice the K-means algorithm is usually run a few times with different random initializations. One way to choose between these different solutions from different random initializations is to choose the one with the lowest cost function value (distortion).
Finding Closest Centroids
In the “cluster assignment” phase of the K-means algorithm, the algorithm assigns every training example $x^{(i)}$
to its closest centroid, given the current positions of centroids. Specifically, for every example $i$
it is set
$$c^{(i)} := j \text{ that minimizes } \lVert x^{(i)}-\mu_j \rVert^2,$$
where $c^{(i)}$
is the index of the centroid that is closest to $x^{(i)}$
, and $\mu_j$
is the position (value) of the j’th centroid. Note that $c^{(i)}$
corresponds to $idx[i]$
in the code in findClosestCentroids
. This function takes the data matrix $X$
and the locations of all centroids inside centroids
and should output a one-dimensional array $idx$
that holds the index (a value in $\left\{1,...,K\right\}$
, where $K$
is total number of centroids) of the closest centroid to every training example. This can be implemented by using a loop over every training example and every centroid.
import numpy as np
from scipy.io import loadmat
import matplotlib.pyplot as plt
# Load dataset.
data = loadmat('ex7data2.mat')
X = data["X"]
# Select an initial set of centroids
K = 3 # 3 Centroids
initial_centroids = np.array([[3, 3], [6, 2], [8, 5]])
# Create a function to find the closest centroids.
def findClosestCentroids(X, centroids):
"""
Returns the closest centroids in idx for a dataset X
where each row is a single example. idx = m x 1 vector
of centroid assignments (i.e. each entry in range [1..K])
Args:
X : array(# training examples, n)
centroids: array(K, n)
Returns:
idx : array(# training examples, 1)
"""
# Set K size.
K = centroids.shape[0]
# Initialise idx.
idx = np.zeros((X.shape[0], 1), dtype=np.int8)
# Iterate over every example, find its closest centroid, and store
# the index inside idx at the appropriate location. Concretely,
# idx[i] should contain the index of the centroid closest to
# example i. Hence, it should be a value in the range 1..K.
# # Iterate over training examples.
# for i in range(X.shape[0]):
# # Set norm distance to infinity.
# min_dst = math.inf
# # Iterate over centroids.
# for k in range(K):
# # Compute the norm distance.
# dst = np.linalg.norm(X[i,:] - centroids[k,:], axis=0)
# if dst < min_dst:
# min_dst = dst
# idx[i] = k
# Alternative partial vectorized solution.
# Iterate over training examples.
for i in range(X.shape[0]):
distances = np.linalg.norm(X[i] - centroids, axis=1)
# argmin returns the indices of the minimum values along an axis,
# replacing the need for a for-loop and if statement.
min_dst = np.argmin(distances)
idx[i] = min_dst
return idx
# Find the closest centroids for the examples.
idx = findClosestCentroids(X, initial_centroids)
print('Closest centroids for the first 3 examples: \n')
print(idx[:3])
print('\n(The closest centroids should be 0, 2, 1 respectively)')
Closest centroids for the first 3 examples:
[[0]
[2]
[1]]
(The closest centroids should be 0, 2, 1 respectively)
Computing Centroid Means
Given assignments of every point to a centroid, the second phase of the algorithm recomputes, for each centroid, the mean of the points that were assigned to it. Specifically, for every centroid k it is set
$$ \mu_k := \frac{1}{\left|C_k\right|} \sum_{i \in C_k} x^{(i)} $$
where $C_k$
is the set of examples that are assigned to centroid $k$
. Concretely, if two examples say $x^{(3)}$
and $x^{(5)}$
are assigned to centroid $k = 2$
, then it should be updatet $\mu_2 = \frac{1}{2} \left(x^{(3)} + x^{(5)}\right)$
.
The code in computeCentroids
implements this function using a loop over the centroids. The code may run faster if it uses a vectorized implementation instead of a loop over the examples.
# Create a function to compute the new centroids.
def computeCentroids(X, idx, K):
"""
Returns the new centroids by computing the means
of the data points assigned to each centroid. It is
given a dataset X where each row is a single data point,
a vector idx of centroid assignments (i.e. each entry
in range [1..K]) for each example, and K, the number of
centroids. A matrix centroids is returned, where each row
of centroids is the mean of the data points assigned to it.
Args:
X : array(# training examples, 2)
idx : array(# training examples, 1)
K : int, # of centroids
Returns:
centroids: array(# of centroids, 2)
"""
# Create useful variables
m, n = X.shape
# Initialize centroids matrix.
centroids = np.zeros((K, n))
# Iterate over every centroid and compute mean of all points that
# belong to it. Concretely, the row vector centroids[k,:] should
# contain the mean of the data points assigned to centroid k.
# # Iterate over centroids.
# for k in range(K):
# # Iterate over training examples.
# for i in range(m):
# if idx[i] == k:
# points = X[i]
# centroids[k] = np.mean(points, axis=0)
# Alternative partial vectorized solution.
for k in range(K):
centroids[k, :] = np.mean(X[idx.ravel() == k, :], axis=0)
return centroids
# Compute means based on the closest centroids found in the previous part.
centroids = computeCentroids(X, idx, K)
print('Centroids computed after initial finding of closest centroids: \n')
print(centroids)
print('\nThe centroids should be:\n')
print('[ 2.42830111 3.15792418 ]')
print('[ 5.81350331 2.63365645 ]')
print('[ 7.11938687 3.6166844 ]')
Centroids computed after initial finding of closest centroids:
[[ 2.42830111 3.15792418]
[ 5.81350331 2.63365645]
[ 7.11938687 3.6166844 ]]
The centroids should be:
[ 2.42830111 3.15792418 ]
[ 5.81350331 2.63365645 ]
[ 7.11938687 3.6166844 ]
K-means on Example Dataset
After implementing the two functions (findClosestCentroids
and computeCentroids
), the next step is to run the K-means algorithm on a toy 2D dataset to see how K-means works. The functions are called from inside the runKmeans
script. Notice that the code calls the two functions in a loop.
A visualization of the progress of the algorithm at each iteration is shown in the next figure.
# Create a function to plot the data points.
def plotDataPoints(X, idx, K):
"""
Plots data points in X, coloring them so that those
with the same index assignments in idx have the same color
Args:
X : array(# training examples, 2)
idx: array(# training examples, 1)
K : int, # of centroids
"""
# Create a colors list.
colors = [plt.cm.tab20(float(i) / 10) for i in idx]
# Plot the data.
plt.scatter(X[:,0], X[:,1], c=colors, alpha=0.5, s=2)
# Create a function to display the progress of K-Means.
def plotProgresskMeans(X, centroids, previous, idx, K, i):
"""
Plots the data points with colors assigned to each centroid.
With the previous centroids, it also plots a line between the
previous locations and current locations of the centroids.
Args:
X : array(# training examples, n)
centroids: array(# of centroids, n)
previous : array(# of centroids, n)
idx : array(# training examples, 1)
K : int, # of centroids
i : # of iterations
"""
# Plot the examples.
plotDataPoints(X, idx, K)
# Plot the centroids as black x's.
plt.scatter(centroids[:,0], centroids[:,1],
marker='x', c='k', s=100, linewidth=1)
# Plot the history of the centroids with lines.
for j in range(centroids.shape[0]):
plt.plot([centroids[j, :][0], previous[j, :][0]],
[centroids[j, :][1], previous[j, :][1]], c='k')
# Title
plt.title('Iteration number {:d}'.format(i+1))
# Create a function to run the K-means algorithm.
def runkMeans(X, initial_centroids, max_iters, plot_progress):
"""
Runs the K-Means algorithm on data matrix X, where each row of X
is a single example. It uses initial_centroids used as the initial
centroids. max_iters specifies the total number of interactions
of K-Means to execute. plot_progress is a true/false flag that
indicates if the function should also plot its progress as the
learning happens. This is set to false by default. runkMeans returns
centroids, a K x n matrix of the computed centroids and idx, a m x 1
vector of centroid assignments (i.e. each entry in range [1..K])
Args:
X : array(# training examples, n)
initial_centroids: array(# of centroids, n)
max_iters : int, # of iterations
plot_progress : boolean, default set to False
Returns:
centroids : array(# of centroids, n)
idx : array(# training examples, 1)
"""
# Initialize values.
m, n = X.shape
K = initial_centroids.shape[0]
centroids = initial_centroids
previous_centroids = centroids
idx = np.zeros((m, 1))
# Run K-Means.
# Turn interactive mode on to refresh the plot and generate one final plot.
plt.ion()
for i in range(max_iters):
# Output progress.
print('K-Means iteration {}/{}...'.format(i, max_iters))
# For each example in X, assign it to the closest centroid
idx = findClosestCentroids(X, centroids)
# Optionally, plot progress here.
if plot_progress:
plotProgresskMeans(X, centroids, previous_centroids, idx, K, i)
previous_centroids = centroids
# Given the memberships, compute new centroids.
centroids = computeCentroids(X, idx, K)
return centroids, idx
# Set K-Means variables.
K = 3
max_iters = 10
# For consistency, here we set centroids to specific values
# but in practice we generate them automatically, such as by
# setting them to be random examples.
initial_centroids = np.array([[3, 3], [6, 2], [8, 5]])
# Run K-Means algorithm.
centroids, idx = runkMeans(X, initial_centroids, max_iters, plot_progress=True)
print('\nK-Means Done.')
K-Means iteration 0/10...
K-Means iteration 1/10...
K-Means iteration 2/10...
K-Means iteration 3/10...
K-Means iteration 4/10...
K-Means iteration 5/10...
K-Means iteration 6/10...
K-Means iteration 7/10...
K-Means iteration 8/10...
K-Means iteration 9/10...
K-Means Done.
Random Initialization
A good strategy for initializing the centroids is to select random examples from the training set. The code in the function kMeansInitCentroids
first randomly permutes the indices of the examples. Then, it selects the first K examples based on the random permutation of the indices. This allows the examples to be selected at random without the risk of selecting the same example twice.
# Create a function to initialize centroids.
def kMeansInitCentroids(X, K):
"""
Initializes K centroids that are to be
used in K-Means on the dataset X.
Args:
X : array(# training examples, n)
K : int, # of centroids
Returns:
initial_centroids: array(# of centroids, n)
"""
# Init centroids.
centroids = np.zeros((K, X.shape[1]))
# Randomly reorder the indices of examples.
randidx = np.random.permutation(X.shape[0])
# Take the first K examples as centroids.
centroids = X[randidx[:K], :]
return centroids
# Set K-Means variables.
K = 3
max_iters = 10
initial_centroids = kMeansInitCentroids(X, K)
# Run K-Means algorithm.
centroids, idx = runkMeans(X, initial_centroids, max_iters, plot_progress=True)
print('\nK-Means Done.')
K-Means iteration 0/10...
K-Means iteration 1/10...
K-Means iteration 2/10...
K-Means iteration 3/10...
K-Means iteration 4/10...
K-Means iteration 5/10...
K-Means iteration 6/10...
K-Means iteration 7/10...
K-Means iteration 8/10...
K-Means iteration 9/10...
K-Means Done.
Image Compression with K-means
K-means will be applied to image compression. In a straightforward 24-bit color representation of an image, each pixel is represented as three 8-bit unsigned integers (ranging from 0 to 255) that specify the red, green and blue intensity values. This encoding is often refered to as the RGB encoding. A sample 24-bit color image contains thousands of colors, which can be reduced to 16 colors.
By making this reduction, it is possible to represent (compress) the photo in an efficient way. Specifically, there is only need to store the RGB values of the 16 selected colors, and for each pixel in the image now it is needed to only store the index of the color at that location (where only 4 bits are necessary to represent 16 possibilities).
The K-means algorithm will be applied to select the 16 colors that will be used to represent the compressed image. Concretely, every pixel will be treated in the original image as a data example and the K-means algorithm will be used to find the 16 colors that best group (cluster) the pixels in the 3-dimensional RGB space. Once the cluster centroids have been computed on the image, then the 16 colors will be used to replace the pixels in the original image.
K-means on Pixels
The following code first loads the image, and then reshapes it to create a $m \times 3$
matrix of pixel colors $\left( \text{where } m = 16384 = 128 \times 128 \right)$
, and calls the K-means function on it.
After finding the top K = 16 colors to represent the image, each pixel position can now be assigned to its closest centroid using the findClosestCentroids
function. This allows to represent the original image using the centroid assignments of each pixel. Notice that the number of bits that are required to describe the image have been significantly reduced. The original image required 24 bits for each one of the $128\times128$
pixel locations, resulting in total size of $128\times128\times24 = 393,216$
bits. The new representation requires some overhead storage in form of a dictionary of 16 colors, each of which require 24 bits, but the image itself then only requires 4 bits per pixel location. The final number of bits used is therefore $16\times24 + 128\times128\times4 = 65,920$
bits, which corresponds to compressing the original image by about a factor of 6.
Finally, the effects of the compression can be viewed by reconstructing the image based only on the centroid assignments. Specifically, each pixel location can be replaced with the mean of the centroid assigned to it. Even though the resulting image retains most of the characteristics of the original, we also see some compression artifacts.
from PIL import Image
print('Running K-Means clustering on pixels from an image.')
# Load an image of a bird.
A = Image.open('bird_small.png')
A = np.array(A) # array(128, 128, 3)
# Divide by 255 so that all values are in the range 0-1.
A = A / 255
# Get the size of the image.
img_size = A.shape
# Reshape the image into an Nx3 matrix where N = number of pixels.
# Each row will contain the Red, Green and Blue pixel values
# This gives the dataset matrix X_img that will be used K-Means on.
X_img = A.reshape(img_size[0] * img_size[1], 3)
# Run K-Means algorithm on this data.
# Different values of K and max_iters can be tried here.
K = 16
max_iters = 10
# When using K-Means, it is important the initialize the centroids randomly.
initial_centroids = kMeansInitCentroids(X_img, K)
# Run K-Means.
centroids, idx = runkMeans(X_img, initial_centroids, max_iters, plot_progress=True)
Running K-Means clustering on pixels from an image.
K-Means iteration 0/10...
K-Means iteration 1/10...
K-Means iteration 2/10...
K-Means iteration 3/10...
K-Means iteration 4/10...
K-Means iteration 5/10...
K-Means iteration 6/10...
K-Means iteration 7/10...
K-Means iteration 8/10...
K-Means iteration 9/10...
print('Applying K-Means to compress an image.')
# Find closest cluster members.
idx = findClosestCentroids(X_img, centroids)
# Essentially, now the image X is represented as in terms of the indices in idx.
# The image can be recoverd from the indices (idx) by mapping each pixel
# (specified by it's index in idx) to the centroid value.
X_recovered = centroids[idx,:]
# Reshape the recovered image into proper dimensions.
X_recovered = X_recovered.reshape(img_size[0], img_size[1], 3)
# Display the original image
plt.subplot(1, 2, 1)
plt.imshow(A)
plt.title('Original')
# Display compressed image side by side
plt.subplot(1, 2, 2)
plt.imshow(X_recovered)
plt.title('Compressed, with {} colors.'.format(K))
plt.show()
Applying K-Means to compress an image.
Principal Component Analysis
In this part, Principal Component Analysis (PCA) will be applied to perform dimensionality reduction. First an example $2D$
dataset will be tested to get intuition on how PCA works, and a bigger dataset of 5000 face images will be used.
Example Dataset
To understand how PCA works, a $2D$
dataset which has one direction of large variation and one of smaller variation will be tested. First, the training data will be plotted (Figure 1). Visualize will help to understand what happens when PCA is applied to reduce the data from $2D$
to $1D$
. In practice, data may even be reduced for example from 256 to 50 dimensions, but using lower dimensional data in this example allows to visualize the algorithms better.
import numpy as np
from scipy.io import loadmat
import matplotlib.pyplot as plt
# Load dataset.
data = loadmat('ex7data1.mat')
X = data["X"]
plt.figure(figsize=(6, 6))
plt.scatter(X[:,0], X[:,1], edgecolors='b', facecolors='none')
plt.title("Figure 1: Example Dataset 1")
plt.show()
Implementing PCA
PCA consists of two computational steps: First, the covariance matrix of the data is computed, which is given by:
$$ \Sigma = \frac{1}{m} X^T X$$
where $X$
is the data matrix with examples in rows, and $m$
is the number of examples. Note that $\Sigma$
is a $n \times n$
matrix and not the summation operator.
Then, the eigenvectors $U_1, U_2,\dots, U_n$
are computed. These will correspond to the principal components of variation in the data.
Before using PCA, it is important to first normalize the data by subtracting the mean value of each feature from the dataset, and scaling each dimension so that they are in the same range. After normalizing the data, PCA is run to compute the principal components.
The corresponding principal components found are shown in Figure 2. Also the top principal component (eigenvector) found are printed (an output of about (-0.707 -0.707) is expected).
import scipy.linalg as linalg
# Create a function to normalize features.
def featureNormalize(X):
"""
Returns a normalized version of X where the mean
value of each feature is 0 and the standard deviation
is 1. This is often a good preprocessing step to do
when working with learning algorithms.
Args:
X : array(# of training examples, n)
Returns:
X_norm: array(# of training examples, n)
mu : array(n,)
sigma : array(n,)
"""
mu = np.mean(X, axis=0)
X_norm = X - mu
# Set Delta Degrees of Freedom (ddof) to 1, to compute
# the std based on a sample and not the population.
sigma = np.std(X_norm, axis=0, ddof=1)
X_norm = X_norm / sigma
return X_norm, mu, sigma
# Create a function to compute the eigenvectors and eigenvalues.
def pca(X):
"""
Returns the eigenvectors U, the eigenvalues (on diagonal) in S.
Args:
X: array(# of training examples, n)
Returns:
U: array(n, n)
S: array(n, n)
"""
# Get some useful values
m, n = X.shape
# Init U and S.
U = np.zeros(n)
S = np.zeros(n)
# When computing the covariance matrix, we have
# to divide by m (the number of examples).
sigma = (1. / m) * np.dot(X.T, X)
# Compute the eigenvectors and eigenvalues
# of the covariance matrix.
U, S, V = linalg.svd(sigma)
S = linalg.diagsvd(S, len(S), len(S))
return U, S
# Normalize X.
X_norm, mu, _ = featureNormalize(X)
# Run PCA.
U, S = pca(X_norm)
# Draw the eigenvectors centered at mean of data. These lines show the
# directions of maximum variations in the dataset.
plt.figure(figsize=(6, 6))
plt.scatter(X[:,0], X[:,1], edgecolors='b', facecolors='none')
plt.title("Figure 2: Computed eigenvectors of the dataset.")
# Compute the pairs of points to draw the lines.
p1 = mu
p2 = mu + 1.5 * S[0,0] * U[:,0].T
p3 = mu + 1.5 * S[1,1] * U[:,1].T
plt.plot([p1[0], p2[0]], [p1[1], p2[1]], c='k', linewidth=2)
plt.plot([p1[0], p3[0]], [p1[1], p3[1]], c='k', linewidth=2)
plt.show()
print('Top eigenvector:')
print('U[:,0]= {:f} {:f}'.format(U[0,0], U[1,0]))
print('(expected to see -0.707107 -0.707107)')
Top eigenvector:
U[:,0]= -0.707107 -0.707107
(expected to see -0.707107 -0.707107)
Dimensionality Reduction with PCA
The principal component can be used now to reduce the feature dimension of the dataset by projecting each example onto a lower dimensional space, $x^{(i)} \rightarrow z^{(i)}$
(e.g., projecting the data from $2D$
to $1D$
). In practice, if a learning algorithm such as linear regression or perhaps neural networks is applied, the projected data can be used instead of the original data. By using the projected data, the model is trained faster as there are less dimensions in the input.
Projecting the Data onto the Principal Components
The code in projectData
uses a dataset $X$
, the principal components $U$
, and the desired number of dimensions to reduce to $K$
. Each example in $X$
is projected onto the top $K$
components in $U$
. Note that the top $K$
components in $U$
are given by the first $K$
columns of $U$
, that is U_reduce = U(:,:K)
.
Reconstructing an Approximation of the Data
After projecting the data onto the lower dimensional space, data can be approximately recovered by projecting them back onto the original high dimensional space. The code in recoverData
projects each example in $Z$
back onto the original space and return the recovered approximation in X_rec
.
Visualizing the Projections
In Figure 3, the original data points are indicated with the blue circles, while the projected data points are indicated with the red circles. The projection effectively only retains the information in the direction given by $U_1$
.
# Create a function to project the data.
def projectData(X, U, K):
"""
Computes the projection of the normalized inputs X
into the reduced dimensional space spanned by the first
K columns of U. It returns the projected examples in Z.
Args:
X: array(# of training examples, n)
U: array(n, n)
K: int, # of dimensions
Returns:
Z: array(# of training examples, K)
"""
# Init Z.
Z = np.zeros((X.shape[0], K)) # m * K
# Compute the projection of the data using only
# the top K eigenvectors in U (first K columns).
U_reduce = U[:,:K]
Z = np.dot(X, U_reduce)
return Z
# Create a function to recover the data.
def recoverData(Z, U, K):
"""
Recovers an approximation the original data
that has been reduced to K dimensions.
It returns the approximate reconstruction in X_rec.
Args:
Z : array(# of training examples, K)
U : array(n, n)
K : int, # of dimensions
Returns:
X_rec: array(# of training examples, n)
"""
# Init X_rec.
X_rec = np.zeros((Z.shape[0], U.shape[0]))
# Compute the approximation of the data by projecting back
# onto the original space using the top K eigenvectors in U.
U_reduce = U[:,: K]
X_rec = np.dot(Z, U_reduce.T)
return X_rec
# Project the data onto K = 1 dimension.
K = 1
Z = projectData(X_norm, U, K)
print('Projection of 1st example: %.6f'% Z[0])
print('(this value should be about 1.481274)')
X_rec = recoverData(Z, U, K)
print('\nApproximation of 1st example: {0:.6f} {0:.6f}'.format(X_rec[0,0], X_rec[0,1]))
print('(this value should be about -1.047419 -1.047419)')
# Draw the normalized X dataset.
plt.figure(figsize=(6, 6))
plt.scatter(X_norm[:,0], X_norm[:,1], edgecolors='b', facecolors='none')
plt.title("Figure 3: The normalized and projected data after PCA.")
# Draw the projected points.
plt.scatter(X_rec[:,0], X_rec[:,1], edgecolors='r', facecolors='none')
# Draw lines connecting the projected points to the original points.
for i in range(X_norm.shape[0]):
plt.plot([X_norm[i,:][0], X_rec[i,:][0]],
[X_norm[i,:][1], X_rec[i,:][1]],
linestyle='--', color='k', linewidth=1)
plt.show()
Projection of 1st example: 1.481274
(this value should be about 1.481274)
Approximation of 1st example: -1.047419 -1.047419
(this value should be about -1.047419 -1.047419)
Face Image Dataset
PCA will applied on face images to see how it can be used in practice for dimension reduction. The dataset ex7faces.mat
contains a dataset $X$
of face images, each $32 \times 32$
in grayscale. Each row of $X$
corresponds to one face image (a row vector of length 1024). Next figure shows the first 100 of these face images.
# Load faces dataset.
data = loadmat('ex7faces.mat')
X = data["X"]
print("Shape of X: ", X.shape)
def displayData(X, n):
"""
Select the first n rows from X,
plot them as (length of image vector x length of image vector)
pixel grayscale images, and combine them to one figure.
Args:
X: array(# of training examples, length of image vector)
n: int
"""
# Create nxn subplots and remove the gaps
# between the subplots with gridspec.
fig, axarr = plt.subplots(n, n,
figsize=(6, 6),
gridspec_kw={'wspace':0,
'hspace':0})
idx = 0
for i in range(n):
for j in range(n):
# Index the array X with the indices.
pixels = X[idx] # shape(1, length of image vector)
pixels = pixels.reshape(-1, 32) # shape(32, 32)
axarr[i,j].imshow(pixels.T, cmap='gray')
# Remove ticks.
axarr[i,j].set_xticks([])
axarr[i,j].set_yticks([])
# Turn off axes.
axarr[i,j].axis('off')
idx += 1
plt.show()
displayData(X, 10)
Shape of X: (5000, 1024)
PCA on Faces
To run PCA on the face dataset, first the dataset is normalized by subtracting the mean of each feature from the data matrix $X$
. After running PCA, the principal components of the dataset are obtained. Notice that each principal component in $U$
(each row) is a vector of length $n$
(where for the face dataset, $n = 1024$
). It turns out that these principal components can be visualized by reshaping each of them into a $32 \times 32$
matrix that corresponds to the pixels in the original dataset. Next the first 36 principal components that describe the largest variations are displayed.
print('Running PCA on face dataset...')
# Before running PCA, it is important to first normalize X
# by subtracting the mean value from each feature.
X_norm, _, _ = featureNormalize(X)
# Run PCA.
U, S = pca(X_norm)
# Visualize the top 36 eigenvectors found.
displayData(U.T, 6)
Running PCA on face dataset...
Dimensionality Reduction
Now principal components can be used to reduce the dimension of the face dataset. This allows to use the learning algorithm with a smaller input size (e.g., 100 dimensions) instead of the original 1024 dimensions. This can help speed up the learning algorithm.
Next the face dataset will be projected onto only the first 100 principal components. Concretely, each face image is now described by a vector $z^{(i)} \in \mathbb{R}^{100}$
.
To understand what is lost in the dimension reduction, the data can be recovered using only the projected dataset. An approximate recovery of the data is performed and the original and projected face images are displayed in the next figure. From the reconstruction, it can be observed that the general structure and appearance of the face are kept while the fine details are lost. This is a remarkable reduction (more than $10\times$
) in the dataset size that can help speed up the learning algorithm significantly. For example, if a neural network was being trained to perform person recognition (given a face image, predict the identitfy of the person), the dimension reduced input of only a 100 dimensions can be used instead of the original pixels.
print('Dimension reduction for face dataset...')
K = 100
Z = projectData(X_norm, U, K)
print('\nThe projected data Z has a size of: ')
print('{} {}'.format(Z.shape[0], Z.shape[1]))
print('\nVisualizing the projected (reduced dimension) faces.');
X_rec = recoverData(Z, U, K)
# Display normalized data.
print('\nOriginal faces:')
displayData(X_norm, 10)
# Display reconstructed data from only k eigenfaces.
print('\nRecovered faces:')
displayData(X_rec, 10)
Dimension reduction for face dataset...
The projected data Z has a size of:
5000 100
Visualizing the projected (reduced dimension) faces.
Original faces:
Recovered faces:
PCA for Visualization
In K-means image compression, the K-means algorithm was used in the 3-dimensional RGB space. Next, the following code helps to visualize the final pixel assignments in this 3D space. Each data point is colored according to the cluster it has been assigned to. Mouse can be used on the interactive plotly
figure in a Jupyter Notebook
to rotate, zoom and inspect this data in 3 dimensions.
import plotly
import plotly.graph_objs as go
plotly.offline.init_notebook_mode(connected=True)
# One useful application of PCA is to use it to visualize high-dimensional
# data. In the last K-Means exercise K-Means was applied on 3-dimensional
# pixel colors of an image. First visualize this output in 3D, and then
# apply PCA to obtain a visualization in 2D.
# Setup color palette.
colors = np.array([plt.cm.tab20(float(i) / 10) for i in idx])
# Visualize the data and centroid memberships in 3D.
trace = go.Scatter3d(x=X_img[:,0], y=X_img[:,1], z=X_img[:,2],
mode='markers',
marker=dict(size=1.5, color=colors, opacity=0.3))
plotly.offline.iplot({'data': [trace],
'layout': {'title': 'Figure 4: Original data in 3D'}})
It turns out that visualizing datasets in 3 dimensions or greater can be cumbersome. Therefore, it is often desirable to only display the data in 2D even at the cost of losing some information. In practice, PCA is often used to reduce the dimensionality of data for visualization purposes. Next PCA will be applied to the 3-dimensional data to reduce it to 2 dimensions and visualize the result in a 2D scatter plot. The PCA projection can be thought of as a rotation that selects the view that maximizes the spread of the data, which often corresponds to the “best” view.
# Subtract the mean to use PCA.
X_norm, mu, sigma = featureNormalize(X_img)
# Apply PCA and project the data to 2D.
U, S = pca(X_norm)
Z = projectData(X_norm, U, 2)
# Plot in 2D.
plotDataPoints(Z, idx, K)
plt.title('Figure 5: 2D visualization produced using PCA')
plt.show()


argon2
Calculate Argon2 cryptographic hashes.
More information: home page
- Calculate a hash with a password and a salt with the default parameters:
echo "password" | argon2 "salt_text"
- Calculate a hash with the specified algorithm:
echo "password" | argon2 "salt_text" -d|i|id
- Display the output hash without additional information:
echo "password" | argon2 "salt_text" -e
- Calculate a hash with given iteration [t]imes, [m]emory usage, and [p]arallelism parameters:
echo "password" | argon2 "salt_text" -t 5 -m 20 -p 7


General class outlining the training environment of a model.
More...
|
| def | __init__ (self, conf, dataconf, modelconf, evaluatorconf, expdir, server, task_index) |
| | NnetTrainer constructor, creates the training graph. More...
|
| |
| def | create_graph (self) |
| | create the trainer computational graph More...
|
| |
| def | compute_loss (self, targets, logits, logit_seq_length, target_seq_length) |
| | Compute the loss. More...
|
| |
| def | trainlabels (self) |
| | the number of aditional labels the trainer needs (e.g. More...
|
| |
|
def | train (self) |
| | train the model
|
| |
| def | chief_only_hooks (self, outputs) |
| | add hooks only for the chief worker More...
|
| |
| def | hooks (self, outputs) |
| | add hooks for the session More...
|
| |
|
|
| conf |
| |
|
| dataconf |
| |
|
| evaluatorconf |
| |
|
| expdir |
| |
|
| server |
| |
|
| task_index |
| |
|
| model |
| |
General class outlining the training environment of a model.
§ __init__()
| def nabu.neuralnetworks.trainers.trainer.Trainer.__init__ |
( |
|
self, |
|
|
|
conf, |
|
|
|
dataconf, |
|
|
|
modelconf, |
|
|
|
evaluatorconf, |
|
|
|
expdir, |
|
|
|
server, |
|
|
|
task_index |
|
) |
| |
NnetTrainer constructor, creates the training graph.
- Parameters
-
| conf | the trainer config as a ConfigParser |
| dataconf | the data configuration as a ConfigParser |
| modelconf | the neural net model configuration |
| evaluatorconf | the evaluator configuration for evaluating if None no evaluation will be done |
| expdir | directory where the summaries will be written |
| server | optional server to be used for distributed training |
| task_index | optional index of the worker task in the cluster |
§ chief_only_hooks()
| def nabu.neuralnetworks.trainers.trainer.Trainer.chief_only_hooks |
( |
|
self, |
|
|
|
outputs |
|
) |
| |
add hooks only for the chief worker
- Parameters
-
| outputs | the outputs generated by the create graph method |
- Returns
- a list of hooks
§ compute_loss()
| def nabu.neuralnetworks.trainers.trainer.Trainer.compute_loss |
( |
|
self, |
|
|
|
targets, |
|
|
|
logits, |
|
|
|
logit_seq_length, |
|
|
|
target_seq_length |
|
) |
| |
Compute the loss.
Creates the operation to compute the cross-enthropy loss for every input frame (if you want to have a different loss function, overwrite this method)
- Parameters
-
| targets | a list of [batch_size x ...] tensor containing the |
| targets | |
| logits | a list of [batch_size x ... tensor containing the |
| logits | |
| logit_seq_length | a list of [batch_size] vectors containing the logit sequence lengths |
| target_seq_length | a list of [batch_size] vectors containing the target sequence lengths |
- Returns
- a scalar value containing the loss
§ create_graph()
| def nabu.neuralnetworks.trainers.trainer.Trainer.create_graph |
( |
|
self | ) |
|
create the trainer computational graph
- Returns
- a dictionary of graph outputs
§ hooks()
| def nabu.neuralnetworks.trainers.trainer.Trainer.hooks |
( |
|
self, |
|
|
|
outputs |
|
) |
| |
add hooks for the session
- Parameters
-
| outputs | the outputs generated by the create graph method |
- Returns
- a list of hooks
§ trainlabels()
| def nabu.neuralnetworks.trainers.trainer.Trainer.trainlabels |
( |
|
self | ) |
|
the number of aditional labels the trainer needs (e.g.
blank or eos)
The documentation for this class was generated from the following file:


Public Member Functions |
| | TestSpace (int n, Gecode::IntSet &d, Test *t) |
| | Create test space without reification.
|
| | TestSpace (int n, Gecode::IntSet &d, Test *t, Gecode::ReifyMode rm) |
| | Create test space with reification.
|
| | TestSpace (TestSpace &s) |
| | Constructor for cloning s.
|
| virtual Gecode::Space * | copy (void) |
| | Copy space during cloning.
|
| bool | assigned (void) const |
| | Test whether all variables are assigned.
|
| void | post (void) |
| | Post propagator.
|
| bool | failed (void) |
| | Compute a fixpoint and check for failure.
|
| int | rndvar (void) |
| | Randomly select an unassigned variable.
|
| void | rndrel (const Assignment &a, int i, Gecode::IntRelType &irt, int &v) |
| | Randomly select a pruning rel for variable i.
|
| void | rel (int i, Gecode::IntRelType irt, int n) |
| | Perform integer tell operation on x[i].
|
| void | rel (bool sol) |
| | Perform Boolean tell on b.
|
| void | assign (const Assignment &a, bool skip=false) |
| | Assign all (or all but one, if skip is true) variables to values in a.
|
| void | bound (void) |
| | Assing a random variable to a random bound.
|
| void | prune (int i, bool bounds_only) |
| | Prune some random values from variable i.
|
| void | prune (void) |
| | Prune some random values for some random variable.
|
| bool | prune (const Assignment &a, bool testfix) |
| | Prune values but not those in assignment a.
|
| void | disable (void) |
| | Disable propagators in space and compute fixpoint (make all idle).
|
| void | enable (void) |
| | Enable propagators in space.
|
| bool | disabled (const Assignment &a, TestSpace &c, bool testfix) |
| | Prune values also in a space c with disabled propagators, but not those in assignment a.
|
| unsigned int | propagators (void) |
| | Return the number of propagators.
|
Public Attributes |
| Gecode::IntSet | d |
| | Initial domain.
|
| Gecode::IntVarArray | x |
| | Variables to be tested.
|
| Gecode::Reify | r |
| | Reification information.
|
| Test * | test |
| | The test currently run.
|
| bool | reified |
| | Whether the test is for a reified propagator.
|
Space for executing tests.


pingouin.bayesfactor_pearson¶
-
pingouin.
bayesfactor_pearson
(r, n, alternative='two-sided', method='ly', kappa=1.0)¶ Bayes Factor of a Pearson correlation.
- Parameters
- rfloat
Pearson correlation coefficient.
- nint
Sample size.
- alternativestring
Defines the alternative hypothesis, or tail of the correlation. Must be one of “two-sided” (default), “greater” or “less”. Both “greater” and “less” return a one-sided p-value. “greater” tests against the alternative hypothesis that the correlation is positive (greater than zero), “less” tests against the hypothesis that the correlation is negative.
- methodstr
Method to compute the Bayes Factor. Can be “ly” (default) or “wetzels”. The former has an exact analytical solution, while the latter requires integral solving (and is therefore slower). “wetzels” was the default in Pingouin <= 0.2.5. See Notes for details.
- kappafloat
Kappa factor. This is sometimes called the rscale parameter, and is only used when
method
is “ly”.
- Returns
- bffloat
Bayes Factor (BF10). The Bayes Factor quantifies the evidence in favour of the alternative hypothesis.
See also
corr
(Robust) correlation between two variables
pairwise_corr
Pairwise correlation between columns of a pandas DataFrame
bayesfactor_ttest
Bayes Factor of a T-test
bayesfactor_binom
Bayes Factor of a binomial test
Notes
To compute the Bayes Factor directly from the raw data, use the
pingouin.corr()
function.The two-sided Wetzels Bayes Factor (also called JZS Bayes Factor) is calculated using the equation 13 and associated R code of [1]:
\[\text{BF}_{10}(n, r) = \frac{\sqrt{n/2}}{\gamma(1/2)}* \int_{0}^{\infty}e((n-2)/2)* log(1+g)+(-(n-1)/2)log(1+(1-r^2)*g)+(-3/2)log(g)-n/2g\]where \(n\) is the sample size, \(r\) is the Pearson correlation coefficient and \(g\) is is an auxiliary variable that is integrated out numerically. Since the Wetzels Bayes Factor requires solving an integral, it is slower than the analytical solution described below.
The two-sided Ly Bayes Factor (also called Jeffreys exact Bayes Factor) is calculated using equation 25 of [2]:
\[\text{BF}_{10;k}(n, r) = \frac{2^{\frac{k-2}{k}}\sqrt{\pi}} {\beta(\frac{1}{k}, \frac{1}{k})} \cdot \frac{\Gamma(\frac{2+k(n-1)}{2k})}{\Gamma(\frac{2+nk}{2k})} \cdot 2F_1(\frac{n-1}{2}, \frac{n-1}{2}, \frac{2+nk}{2k}, r^2)\]The one-sided version is described in eq. 27 and 28 of Ly et al, 2016. Please take note that the one-sided test requires the mpmath package.
Results have been validated against JASP and the BayesFactor R package.
References
- 1
Ly, A., Verhagen, J. & Wagenmakers, E.-J. Harold Jeffreys’s default Bayes factor hypothesis tests: Explanation, extension, and application in psychology. J. Math. Psychol. 72, 19–32 (2016).
- 2
Wetzels, R. & Wagenmakers, E.-J. A default Bayesian hypothesis test for correlations and partial correlations. Psychon. Bull. Rev. 19, 1057–1064 (2012).
Examples
Bayes Factor of a Pearson correlation
>>> from pingouin import bayesfactor_pearson >>> r, n = 0.6, 20 >>> bf = bayesfactor_pearson(r, n) >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 10.634
Compare to Wetzels method:
>>> bf = bayesfactor_pearson(r, n, method='wetzels') >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 8.221
One-sided test
>>> bf10pos = bayesfactor_pearson(r, n, alternative='greater') >>> bf10neg = bayesfactor_pearson(r, n, alternative='less') >>> print("BF-pos: %.3f, BF-neg: %.3f" % (bf10pos, bf10neg)) BF-pos: 21.185, BF-neg: 0.082


on
Repos for getting hired
I’m often involved in hiring. When GitHub links are on a resume, I look at pinned repos and source repos. Here’s a checklist of important items to have in a GitHub public repository to catch the eye of reviewers. Or at least my eye when hiring, and why it’s important.
Your goal, my goal
Yours: get hired. Mine: make an informed decision about hiring someone who can do the job.
The checklist, in no particular order
- show (working) example code
- have a link to a deployed example
- make the READMEs useful for people who don’t know what the project is or why it’s important
- show off build badges
- published docker containers
- got a blog from a github repo? make sure there’s a link to the public page
Show (working) example code
A library should have working example code prominent in the README file. This indicates the project has been used in one fashion or another. Bonus points for showing how someone would solve the problem without the project and show how much better it is to use the solution the project provides. I find this important because I can get a gut feel for public API design or how a problem is approached by seeing the result as an end user.
Have a link to a deployed example
There’s an awful lot of repos consisting of a collection of HTML and JavaScript without an easy example of how to view the web page. Static pages are cheap to free these days: toss the page up somewhere and put a link to it. This is valuable to me because I’ve seen so many different ways to have demonstrable code, I’m not inclined to spend more than a few minutes trying to figure it out.
Make the READMEs useful for people who don’t know what the project is or why it’s important
When a repo says Solves baz with aplomb!
it doesn’t state much unless one already knows what baz
is. I love repos that state what the project is, why it was created and its current state and trajectory. The ability to communicate over text is very important to software development.
Show off build badges
There’s plenty of free build services for public repos. Being able to build a project on a different machine is vitally important and when repo after repo is missing this, it doesn’t give a positive sign. Bonus points if a project billing itself as cross-platform shows it via build service badges.
Published docker containers
In a DevOps world, where you write it you run it
, Docker is almost the standard for shipping code. By understanding enough of how that works to package and publish a container, a repo stands out from others that are missing this, when applicable.
Got a blog from a github repo? Link to the public page
Not everyone knows username.github.io
is a public web page. Toss a link in the repo for that blog. Reducing friction for people finding out what you have to say helps them find it.
Check those boxes
This is not an exhaustive list. It’s a collection of aspects a repository should have in order to send a good signal to someone reviewing it for hiring purposes. All other things equal, if your repo(s) checks them all and another candidate misses them all, you’re a step ahead of them.


SPARQL is a query language and a remote access protocol. The remote access protocol can be used with plain HTTP or over SOAP.
See Joseki for an implementation of an RDF publishing server, using the SPARQL protocol (HTTP and SOAP). Joseki uses ARQ to provide SPARQL query access to Jena models, including Jena persistent models.
ARQ includes a query engine capable of using the HTTP version. A version using SOAP is include in Joseki.
Don't forget to set the proxy for Java if you are accessing a public server from behind a blocking firewall. Most home firewalls do not block outgoing requests; many corporate firewalls do block outgoing requests.
If, to use your web browser, you need to set a proxy, you need to do so for a Java program.
Simple examples include:
-DsocksProxyHost=YourSocksServer
-DsocksProxyHost=YourSocksServer -DsocksProxyPort=port
-Dhttp.proxyHost=WebProxy -Dhttp.proxyPort=Port
This can be done in the application if it is done before any network connection are made:
System.setProperty("socksProxyHost", "socks.corp.com");
Consult the Java documentation for more details. Searching the web is also very helpful.
The arq.sparql
command can issue remote query requests using the --service
argument:
java -cp ... arq.query --service 'http://host/service' 'SELECT ?s WHERE {?s [] []}'
This takes a URL that is the service location.
The query given is parsed locally to check for syntax errors before sending.
The QueryExecutionFactory
has methods for creating a
QueryExecution
object for remote use. QueryExecutionFactory.sparqlService
These methods build a query execution object that uses the query engine in com.hp.hpl.jena.sparql.engine.http
.
The remote request is made when the execSelect
,
execConstruct
, execDescribe
or execAsk
method is called.
The results are held locally after remote execution and can be processed as usual.


While Model-View-Controller (MVC) has acquired different shades of meaning over the years since it first appeared, angular incorporates the basic principles behind the original MVC software design pattern into its way of building client-side web applications.
The MVC pattern greatly summarized:
Along with services and dependency injection, MVC makes angular applications better structured, easier to maintain and more testable.
The following topics explain how angular incorporates the MVC pattern into the angular way of developing web applications:


11.2.1. Effective Grain Boundary Diffusivity Calculator¶
Author: Jie Deng
Calculates the effective diffusivity in a grain boundary network with two types of randomly distributed grain boundaries.
Version 1.3 - originally published on 21 Feb 2014
- You must download and unzip the MAST tar.gz file from https://github.com/uw-cmg/MAST/releases in order to access the source code, which is in MAST/standalone/gbdiff, and will likely need to be recompiled for your machine.
This tool calculates the effective diffusivity in a grain boundary network represented by a three-dimensional Voronoi diagram. Two types of grain boundaries with different diffusivities are randomly distributed in the domain. The effective diffusivity is calculated using the mean squared displacement method, where periodic boundary conditions are applied in all directions. Users are free to choose the fraction of each grain boundary type as well as the activation energy and pre-factor for each grain boundary diffusivity.
11.2.2. Cite this work¶
Researchers should cite this work as follows:
Jie Deng, Navjeet Sandhu, Henry Wu, Dane Morgan, and Izabela Szlufarska, "Effective Grain Boundary Diffusivity Calculator," https://nanohub.org/resources/gbdiffusion (2015).


Site Pages
Essential for your Mobile WebsiteReady built page templates to create your awesome Mobile Website. Fast loading and easy to Customize.
- About Us A few things about Enabled
- Article Instant Cards Article Cards are made to load instantly
- Article Instant List Article Lists are made to load instantly
- Careers Looking for new staff?
- Error 404 Error pages are sad but needed
- Embeds Embed your videos and other iframes
- F.A.Q's Got a question? Check the answer here
- Login A login page Template
- Maintenance Working on your page? Use this
- Register A register page Template
- Team Page Show off your company team
- Timeline 1 A timeline page great for events
- Timeline 2 A timeline page great for events
- Forgot Page Forgot your pass? Reset it here
- User Profile Share your awesome profile
- System Status Are your servers upadating? Let us know
- Task Progression Show the progress of your items
- Terms of Service Explain how your website works
- Under Construction We're building this! Check soon!
- V-Card You can download a contact card


About Us
P1X was founded in 2014 as a one man game development studio. Now after 5 years and a lots of games later the team has grown to four core members.
We are making games in our free time. Becose we love to. We are a true independent studio.
We are recommending free and open way of developing. All of our games are free and open source.


Nawaz to be shifted to US after initial treatment in UK: sources | Pakistan - Geo.tv
by Web DeskFormer prime minister Nawaz Sharif will be shifted to a Boston hospital after he seeks initial treatment in the United Kingdom (UK), sources told Geo News on Saturday.
READ MORE: Nawaz Sharif’s name to be removed from ECL for four weeks
Sources told Geo News that the former prime minister will most likely fly out of the country on Monday evening. The air ambulance in which Nawaz will travel will stop for a brief while as it cannot undertake the long journey in a single stroke.
Sources said that Nawaz will seek treatment for his kidney and heart in the UK. In the US, the former prime minister will be treated for his platelet condition.
Nawaz will be treated in another city in the UK apart from London. Appointments have been made with doctors in the UK and the US, according to sources.
LHC allows Nawaz to go abroad for medical treatment for four weeks
The Lahore High Court (LHC) on Saturday permitted to remove former prime minister Nawaz Sharif's name from the Exit Control List without any conditions for a time period of four weeks.
On Friday, the LHC called the plea admissible regarding the removal of former premier Nawaz Sharif’s name from the ECL on a conditional basis — the government had said it would allow a 'one-time permission' provided Nawaz Sharif deposited surety bonds worth Rs7-7.5 billion.
In its decision, the LHC said that in case Nawaz's health doesn't improve then the time-period can be extended, adding that the government officials will be able to contact Nawaz through the Pakistani embassy.


Most experiences here seem to center around caffeine pills or extreme caffeine use, and not the daily use of caffeine - so here's a review of my first experience with Yerba Mate and replacing that old vice, coffee, with it.
After being a coffee addict for years I recently heard about Yerba Mate, a caffeine-containing herbal tea that is supposed to have less of the side-effects of caffeine due to the synergistic effect of the other compounds.
My caffeine tolerance is relatively low - perhaps I am sensitive to it. When drinking coffee my hands get shaky, my mind feels spacey for awhile at first and I always suffer a bad 'crash' as the effects wear off. I don't like the experience, however I need it to wake up in the morning.
I bought a 1/2lb of GUAYAKI Yerba Mate tea for $12 at a local headshop. Recommended dose as a coffee replacement was 1 tsp in 1 cup of tea. I decided to try it half strength due to my low tolerance. I tried it in the morning after half a week of bad insomnia, while barely able to open my eyes.
8:30AM - Drank 1 cup Yerba Mate tea, 1/2 tsp powder steeped 3min, drank straight up. A pleasant taste not unlike most teas. Also ate a bowl of honey nut cheerios.
+5min - no caffeine 'rush' as coffee has.
+10min - increased alertness, kind of creeping up on me as opposed to coffee.
+15min - talkative/energetic/alert, vision crisp and clear. Very awake. No side effects (jitters, spacey feeling) as from coffee. Slight exhilaration.
+30min - plateau, no feeling of excess energy anymore but still alert and awake. Got to work and did some work that I'd been putting off for awhile. General mood elevation.
10:30 (+2h) - very slight drowsiness creeping back in but still clarity of vision and thought, concentration fading a little.
11:00 (+2.5hr) Getting kind of drowsy but still capable of doing work well. Hungry
11:30 (+3hr) - Approaching baseline. No 'crash' but more of a gradual fading.
12:00 (+3.5hr) - More awake than I would be with a cup of coffee in the morning, about the same as if I skip the coffee.
14:00 (+5.5hr) - This is when I would normally be devastated by coffee crash and need to drink more. Instead I'm just kind of drowsy.
Overall I was very happy with the experience as a coffee replacement and would recommend it to anyone who wants to break the hold of coffee. I found it pleasant and enjoyable as opposed to the daily ritual of coffee and will continue using it in the mornings.
I will try increasing the strength next time to see if it will last longer, or perhaps I will just drink another one later in the day to top up. I recommend purchasing a gourd and bombillo to drink from, or a press-type coffee maker to use as the little bits of leaf tend to end up in your mouth, a teaball cannot strain them all out, yuck. Luckily they sink to the bottom, so it is possible to brew with a teaball.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Extending objects in TactJS is very simple. Let's take a look at a simple Docs.Demos.Pet object...
(function ($) { // Define a namespace $.types.ns("Docs.Demos"); // Define the Pet class. Docs.Demos.Pet = $.types.define(function(name) { // Private Members var _name = name var _walkCount = 0; // Public Members var self = { walk: function(){ _walkCount++; return _name + " has been walked " + _walkCount + " time(s) today."; } }; return self; }); })(jQuery);
Now let's create a Docs.Demos.Dog object which will extend Docs.Demos.Pet and have it's own distinct method "speak()" which is not part of the Docs.Demos.Pet object.
(function ($) { // Define a namespace $.types.ns("Docs.Demos"); // Define the Dog class. Docs.Demos.Dog = $.types.extend(Docs.Demos.Pet, function(name) { // Private Members var _speak = "Woof!"; // Public Members var self = { speak: function(){ return name + " says " + _speak; } }; return self; }); })(jQuery);
Notice the line, "Docs.Demos.Dog = $.types.extend(Docs.Demos.Pet, function(name) {" where we use $.types.extend and pass in the class we wish to extend as the first parameter. The extended class Docs.Demos.Pet will be accessed through the "self.superclass" keyword, but only its public methods will be available to Docs.Demos.Dog. The private members in the superclass are therefor more appropriately described as "internal" for the purposes of TactJS, and the only way to make these members accessible would be to add accessors to the "self" of Docs.Demos.Pet.
Also note that "name" is part of the declaration of "Docs.Demos.Dog." In order for the extended class to function properly, it's constructor contract must be maintained. In this case, "name" will be passed to the constructor of the superclass of Docs.Demos.Dog and stored as a private member. It will be this private member that is called upon when the walk() command is invoked against Docs.Demos.Dog.
Now let's declare a new Docs.Demos.Dog object that we can command to walk and speak...
// Instantiate a new Docs.Demos.Dog object var dog = new Docs.Demos.Dog("Taboo"); // Invoke the speak and walk commands on dog dog.speak(); // Taboo says Woof! dog.walk(); // Taboo has been walked 1 time(s) today.
That's all there is to it!
Now let's change Docs.Demos.Pet to provide an accessor to it's private "_name" member so we can use it from the Docs.Demos.Dog object, or directly since it will be in the object's public space.
(function ($) { (function ($) { // Define a namespace $.types.ns("Docs.Demos"); // Define the Pet class. Docs.Demos.Pet = $.types.define(function(name) { // Private Members var _name = name var _walkCount = 0; // Public Members var self = { walk: function(){ _walkCount++; return _name + " has been walked " + _walkCount + " time(s) today."; }, name: function(){ return _name; } }; return self; }); })(jQuery);
Now we can change our Docs.Demos.Dog class to use the "name" accessor in its superclass...
(function ($) { // Define a namespace $.types.ns("Docs.Demos"); // Define the Dog class. Docs.Demos.Dog = $.types.extend(Docs.Demos.Pet, function(name) { // Private Members var _speak = "Woof!"; // Public Members var self = { speak: function(){ return self.superclass.name() + " says " + _speak; } }; return self; }); })(jQuery);
Our output for the example above should remain the same, but now our pet's name is both stored and accessed from the same place in all cases.
// Instantiate a new Docs.Demos.Dog object var dog = new Docs.Demos.Dog("Taboo"); // Invoke the speak and walk commands on dog dog.speak(); // Taboo says Woof! dog.walk(); // Taboo has been walked 1 time(s) today.


Thank you for purchasing my script. If you have any questions that are beyond the scope of this help file, please feel free to email. Thanks so much!
After creating the database next step is accessing the application URL from a browser. One thing you need to know is that Laravel is designed to allow HTTP access to the application from your public folder only. This means that this application will be available at yourdomain.com/public. It is good enough for installation and development purposes, however, for production, you will probably want to have your application available at yourdomain.com. In next section, I will show you how you can accomplish that.
To open the installer. Visit
On step 2 you have to fill in your database credentials
After clicking on "Next" button, you will be redirected to System Requirements step during the installation wizard, System Requirements.
The last step is exit step.
Admin Email<EMAIL_ADDRESS>Password:123456
Admin dashboard shows important stats about the bookings and earning.
This section manages the business categories.
This section manages the list of services provided by the business.
This section is to create a booking entry for a customer directly from the admin.
This section manages all the bookings made by the customer or entered by admin.
You can update the information related to business in general settings.
You can manage the business hours for which you want to allow customers to book.
You can update the tax information here.
You can manage the currencies here.
You can enter the email settings by which the email notifications will be sent.
You can change the color scheme of the app as per your choice.
You can update the application in future from here with a click of button.
The booking wizard helps customer to book the services step by step.
You can change the translations if required using the translation manager.
Visit yourdomain.com/translations.
Your all translations are arranged in groups. Choose a group from dropdown to change the translations.
You will a see list of translations for each language for every group you select.
1. Now to change the translation string click on the string and you will see a popup to change it.
2.
Change the string and click on blue check button.
3. Similarly do it for all strings you want to change.
Now just click on the Publish translations button on top to apply the changes.
Admin Email<EMAIL_ADDRESS>Password:123456
To update to new version of the app follow these steps in sequence.
.env, public/user-uploads
http://www.yourdomain.com/update-database


Position 3°15’N, 117°40’E.
This is an official Port of Entry.
NEW Indonesian CIQP procedures came into effect from the 27th February, 2016.
A CAIT, Green Book/Sailing Permit and use of an Agent to obtain clearance papers are no longer required. See Noonsite Indonesia Formalities for full details.
Last updated March 2016.


As described here, I have got excellent results from automated testing with BDD using a framework based on Cucumber. This blog describes how I set up the framework from scratch using my trusty MacBook pro and a few well written (not by me!) acceptance requirements.
Requirements
This is the list of tools used in the framework:
- Cucumber
- Ruby Version Manager (RVM is a environment manager for ruby))
- Ruby 2.3.x
- Ruby Gems (Ruby Gems is a package manager for ruby )
- Capybara (Capybara helps you to automated BDD scenarios))
- Selenium
- Roo (Roo is a gem for interfacing with spreadsheets )
- Pry (Pry is a great debugging tool for ruby)
There are one or two other dependencies used like Curl and Homebrew. If you haven’t used them before then you should do a bit of background reading/setup before carrying on.
Installing Ruby and Ruby Gems
To install the current development version of Ruby I tend to use Ruby Version Manager (RVM) to manage the Ruby environments - it gives you a lot more flexibility in the long term. In terminal, run the following commands:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
You know have both RVM and Ruby installed. Check it’s all worked as expected: ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
To install Ruby Gems, follow the installation instructions that can be found here.
Installing Cucumber
To install Cucumber, do the following: gem install cucumber
That’s all there is to that. To see the list of commands available to you now just type:
cucumber --help
For a simple example of what cucumber does we can initiate a project. Create a new directory and cd into it. Then type:
cucumber --init
Cucumber will then create the following files for you in the directory
└── features
├── step_definitions
└── support
└── env.rb
The features directory will contain all your requirements in the format that cucumber will be able to parse. The step definitions directory will contain all your code to implement the tests. Finally the env.rb file contains everything Cucumber needs to setup your environment. This includes selenium. Talking of which…
Selenium Setup
Most problems I experienced with this framework where in some way related to Selenium, but the installation process is again simple. Just use the following:
gem install selenium-webdriver
That should install the web driver, you still need to specific driver for the browser, in this case we generally used Chrome. To install we use Homebrew again:
brew install chromedriver
This should setup everything you need for your tests to control a browser.
Setting up your Gemfile
Going forward you will be managing your dependencies which will be stored in the root folder of your project. To create it, run the following while in the root directory of your project:
echo "source 'https://rubygems.org'" > Gemfile
You should now have the following setup.
.
├── Gemfile
└── features
├── step_definitions
└── support
└── env.rb
Now in your gemfile, add the following lines.
gem ‘selenium-webdriver’, ‘>=3.0.5’ gem ‘cucumber’ gem ‘test-unit’ gem “minitest” gem “minitest-reporters” gem ‘pry’ gem ‘capybara’ gem ‘capybara-screenshot’ gem ‘rspec’ gem ‘rake’ gem ‘savon’ gem ‘roo’
Back in your terminal, you can install or update all the gems any time you want by running
bundle install
Setting up the env.rb file
In your IDE, open the env.rb file and save the following code:
require 'capybara/cucumber'
Capybara.register_driver :selenium do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
capabilities['chromeOptions'] = { prefs: $chrome_prefs }
Capybara::Selenium::Driver.new(app, browser: $browser, desired_capabilities: capabilities)
end
Capybara.default_driver = :selenium
Capybara.default_max_wait_time = 5
Capybara.wait_on_first_by_default = true
This will let Capybara know to use the chromedriver.
The next blog will describe creating your first test.


Salmon Cookies Sale Log by Location
This was added in HTML
First And Pike
Seatac
Seattle Center
Capitol Hill
Alki


{{ singleIntegrationStage }}
No flows yet. Start creating new flows by clicking on 'Create flow'. For more info check the Assimbly Docs


For a one-year period from November 2010, the Marugame Genichiro-Inokuma Museum of Contemporary Art (MIMOCA) will host a cycle of four Hiroshi Sugimoto exhibitions.
Each will showcase works by the artist thematically contextualized under the headings "Science," "Architecture," "History" and "Religion" so as to present a comprehensive panorama of the artist's oeuvre.
Hours: 10:00 – 18:00 (No admittance after 17:30)
The dates for the ORIGIN OF ART exhibition are as follows:
Anish Kapoor won the Turner Prize in 1991 and exhibited at the Tate Modern gallery in London in 2003.
Charing Cross Road, London, W2C, UK
Telephone 0207
Email<EMAIL_ADDRESS>© The Art Bookshop


The spotify-search component takes the value from the input, and we take its output to render a list of items.
Take a look at the source of the example for more information. Note that the <input> plus the JavaScript code be replaced with a <core-input> polymer component.
By "{{artists[0].name}}" in album "{{album.name}}"


bpy_prop_collection¶
-
class
bpy.types.
bpy_prop_collection
¶ built-in class used for all collections.
Note
Note that bpy.types.bpy_prop_collection is not actually available from within Blender, it only exists for the purpose of documentation.
-
find
(key)¶ Returns the index of a key in a collection or -1 when not found (matches Python’s string find function of the same name).
Parameters: key (string) – The identifier for the collection member. Returns: index of the key. Return type: int
-
foreach_get
(attr, seq)¶ This is a function to give fast access to attributes within a collection.
Only works for ‘basic type’ properties (bool, int and float)! Multi-dimensional arrays (like array of vectors) will be flattened into seq.
collection.foreach_get(attr, some_seq) # Python equivalent for i in range(len(seq)): some_seq[i] = getattr(collection[i], attr)
-
foreach_set
(attr, seq)¶ This is a function to give fast access to attributes within a collection.
Only works for ‘basic type’ properties (bool, int and float)! seq must be uni-dimensional, multi-dimensional arrays (like array of vectors) will be re-created from it.
collection.foreach_set(attr, some_seq) # Python equivalent for i in range(len(some_seq)): setattr(collection[i], attr, some_seq[i])
-
get
(key, default=None)¶ Returns the value of the item assigned to key or default when not found (matches Python’s dictionary function of the same name).
Parameters: - key (string) – The identifier for the collection member.
- default (Undefined) – Optional argument for the value to return if key is not found.
-
items
()¶ Return the identifiers of collection members (matching Python’s dict.items() functionality).
Returns: (key, value) pairs for each member of this collection. Return type: list of tuples
-
keys
()¶ Return the identifiers of collection members (matching Python’s dict.keys() functionality).
Returns: the identifiers for each member of this collection. Return type: list of strings
-
values
()¶ Return the values of collection (matching Python’s dict.values() functionality).
Returns: the members of this collection. Return type: list
-