THIS CODE HAS BEEN PROVIDED "AS IS" AND THE RESPONSIBILITY
FOR ITS OPERATIONS IS 100% YOURS.
========================================================================
RuntimeBrowser is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RuntimeBrowser is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RuntimeBrowser (in a file called "COPYING.txt"); if not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA


A set of pricing and expository functions that should be useful in teaching a course on financial derivatives.
| Version: | 0.2.3 |
| Depends: | R (≥ 3.0.0) |
| Imports: | graphics, stats, grDevices, mnormt, testthat |
| Suggests: | highlight, markdown, knitr, rmarkdown |
| Published: | 2018-06-19 |
| Author: | Robert McDonald [aut, cre, cph] |
| Maintainer: | Robert McDonald <rmcd1024 at gmail.com> |
| License: | MIT + file LICENSE |
| NeedsCompilation: | no |
| Materials: | NEWS |
| In views: | Finance |
| CRAN checks: | derivmkts results |
| Reference manual: | derivmkts.pdf |
| Vignettes: |
Notes on Vectorization derivmkts Package Overview |
| Package source: | derivmkts_0.2.3.tar.gz |
| Windows binaries: | r-devel: derivmkts_0.2.3.zip, r-release: derivmkts_0.2.3.zip, r-oldrel: derivmkts_0.2.3.zip |
| OS X binaries: | r-release: derivmkts_0.2.3.tgz, r-oldrel: derivmkts_0.2.3.tgz |
| Old sources: | derivmkts archive |
Please use the canonical form https://CRAN.R-project.org/package=derivmkts to link to this page.


Toggle navigation
GitHub Release Stats
Enter project details ...
Show release statistics!
... and get the latest release stats for any public repo on GitHub :
and more


{% extends "badger/base.html" %} {% block pageid %}badge_delete{% endblock %} {% block content %} {{ _("Badge: {badge_title}") | fe(badge_title=badge.title) }} {% include "badger/includes/badge_full.html" %} {{ _("Delete badge") }} {{ csrf() }} {% if awards_count %} {% trans badge_url=badge.get_absolute_url(), awards_count=awards_count %} Note: Deleting this badge will also delete {{awards_count}} award(s) {% endtrans %} {% else %} {% trans %} Note: No one has been awarded this badge, yet. {% endtrans %} {% endif %} {{ _("Delete this badge, are you sure?") }} {% endblock %}
{% trans badge_url=badge.get_absolute_url(), awards_count=awards_count %} Note: Deleting this badge will also delete {{awards_count}} award(s) {% endtrans %}
{% trans %} Note: No one has been awarded this badge, yet. {% endtrans %}
{{ _("Delete this badge, are you sure?") }}


{% extends 'lib/base.html' %} {% load static %} {% block body %}
Use the below button in case you want to delete the demo activities.


Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language like HTML. CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript. CSS is designed to enable the separation of presentation and content, including layout, colors, and fonts.
Typing
Typing is the process of writing or inputting text by pressing keys on a typewriter, computer keyboard, cell phone, or calculator. It can be distinguished from other means of text input, such as handwriting and speech recognition. Text can be in the form of letters, numbers and other symbols.


Modify Data with SQL Injection
The form below allows a user to view salaries associated with a userid
(from the table named salaries). This form is vulnerable to String
SQL Injection. In order to pass this lesson, use SQL Injection to modify
the salary for userid jsmith.


For 35 years, we have been imagining and designing tailor-made, customizable housing, in perfect harmony with their environment and individual needs.
Our story is born from a societal objective: to offer modern, high-quality, efficient and affordable housing to accommodate young people, single-parent families, seniors and single people.
To meet this objective, we have specialized in the assembly of small operations, from 4 batches, up to 40 batches. In the form of adjoining houses, collective dwellings up to R + 2, from 4 to 12 dwellings. By fitting out several buildings on a plot, in mixed projects: land + collective.
True architectural reflection, all of our real estate programs reaffirm quality of life as an essential pillar of modern housing and “better living together”.
BOURGET HABITAT offers new , quality and accessible housing that is brighter, more spacious, customizable and eco-responsible. (Re) taste the pleasure of large private and common outdoor spaces where life is good.
Our core business? Intermediate accommodation, halfway between the house and the collective building to offer you a new way of living. We are developing this know-how to offer you new affordable, comfortable and more human-sized residences than ever.
 Thanks to a dedicated customer area , everything is made easy: follow the progress of your site in real time and choose your own finishes from a wide range of choices.


Sites align index: 1 (only indexes of 1 - 3 will work
Sites adjust value: 0
| AlphaNumeric | Numeric | Animals | Sites |
|---|---|---|---|
| abc 123 | .423475 | Koala = cute = cudley | search.google.com |
| abc 1 | 23.4 | Ox = stinky | mail.yahoo.com |
| abc 9 | 1.0 | Girafee = tall | http://www.facebook.com |
| zyx 24 | 7.67 | Bison = burger | http://internship.whitehouse.gov/ |
| abc 11 | 3000 | Chimp = banana lover | about.ucla.edu/ |
| abc 2 | 56.5 | Elephant = unforgetable | http://www.wikipedia.org/ |
| abc 9 | 15.5 | Lion = rawr | rental.nytimes.com/index.html |
| ABC 10 | 87.20000 | Zebra = stripey | http://android.google.com |
| zyx 1 | 999.1 | Koala = cute, again! | http://irsmrt.mit.edu/ |
| zyx 12 | .2 | Llama = llove it | http://aliens.nasa.gov/ |


quickstart-Objective-C Document
quickstart Objective-C
Introduction
This is a brief introduction to using the ShinobiCharts component. This quick start guide will walk you through a series of simple steps introducing the key features of the charting library which includes supplying data to the chart via the datasource, simple styling and configuration of the labels, title and axes.
At the end of this guide you will have created the following chart:
Installation
ShinobiCharts now ships with an installer, to make it easier to get started. To run the installer open the ‘ShinobiCharts.dmg’ file which you downloaded from ShinobiControls and run ‘install.pkg’. When it opens up, it should look as below.
The easiest way to install the ShinobiCharts framework is to run the ‘install.pkg’ file. This will install the framework into Xcode for you, along with the framework documentation. This means you can add the framework to your project in the same way as you would any of the frameworks which are automatically shipped with Xcode.
If you don’t want to run the installer, the framework is also contained within the ‘ShinobiCharts’ folder in the disk image. Regardless of whether you ran the installer, you should copy this folder onto your machine. Drag the ‘ShinobiCharts’ folder onto the Desktop icon in the disk image. This will copy the folder onto your desktop.
The ‘ShinobiCharts’ folder contains:
- A copy of the framework.
- A copy of the documentation for the framework.
- A set of samples to demonstrate getting started with ShinobiCharts.
- An uninstall script for uninstalling the ShinobiCharts framework & documentation from Xcode.
- The Xamarin.ios version of the framework (only available with the Premium framework).
- A README file with setup steps.
- A change log stating the changes made in each release.
- A copy of the ShinobiCharts Standard Licence.
- A text file containing the version number of the framework.
Draw a Simple Chart
Start-up Xcode and create a new project via File / New / Single View Application.
Within your newly created project add a reference to the ShinobiCharts framework. If you’ve installed ShinobiCharts using our installer, you can add this in the same way as you would any of the standard Apple frameworks. Select your project target, and switch to the Build Phases tab. Open the Link Binary With Libraries section, click the Plus button, find the entry for ShinobiCharts.framework, and click Add.
If you have just copied the framework onto your machine, the easiest way to add it to your project is to locate the ShinobiCharts.framework and drag it directly into your project.
ShinobiCharts makes use of a few other frameworks, so add the following as well:
- Security.framework (Trial Version only)
- QuartzCore.framework
- OpenGLES.framework
- CoreText.framework
- libc++.dylib
The first step is to create an instance of the chart and add it to the view. Open up the ViewController.m file and add the following import statement
#import <ShinobiCharts/ShinobiCharts.h>
Within the same file add the following to the viewDidLoad
method:
self.view.backgroundColor = [UIColor whiteColor];
CGFloat margin = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ? 10.0 : 50.0;
ShinobiChart *chart = [[ShinobiChart alloc] initWithFrame:CGRectInset(self.view.bounds, margin, margin)];
chart.title = @"Trigonometric Functions";
This instantiates the chart object, and sets its title. Note that the margin around that chart depends on the device form factor. For the iPad a larger margin is used. The ShinobiChart
object is a UIView
subclass, so respects resizing masks and auto-layout. Further down the same method add the following:
chart.autoresizingMask = ~UIViewAutoresizingNone;
This ensures that the chart frame is adjusted when the device orientation changes.
If you have downloaded a trial version of the ShinobiCharts you will have been issued with a trial license key. Add the key that you were supplied with at the location indicated below.
chart.licenseKey = @""; // TODO: add your trial licence key here!
The next step is to add the axes to the chart. In this example both the X and Y axes are linear, although the chart also supports date-time and category axes. Further down the same method add the following:
// add a pair of axes
SChartNumberAxis *xAxis = [SChartNumberAxis new];
chart.xAxis = xAxis;
SChartNumberAxis *yAxis = [SChartNumberAxis new];
chart.yAxis = yAxis;
Now that the chart is configured, the final step is to add it to the view. Add the following to the end of the method:
[self.view addSubview:chart];
Before you can see the chart in action, you need to supply some data, which brings us onto the next step …
Adding a Datasource
In order to render your data within the chart you need to supply a ‘datasource’, this is a class that adopts the SChartDatasource protocol methods.
If you have worked with
UITableView
the idea of a datasource should be familiar to you. The shinobichart shares the same concepts both of a datasource, for supplying data, and a delegate, for reacting to user interactions.
Within ViewController.m adopt the datasource protocol via the class extension, that Xcode generated for you, as follows:
@interface ViewController () <SChartDatasource>
The SChartDatasource protocol has four required methods. We’ll take a look at each of them in turn.
The first method numberOfSeriesInSChart:
is used to inform the chart how many series you wish to render. Add the following implementation, with a hard-coded value of two:
- (NSInteger)numberOfSeriesInSChart:(ShinobiChart *)chart {
return 2;
}
The next method, sChart:seriesAtIndex:
is used to supply each series to the chart. The series objects describe the visual appearance of each series, but not their actual data values. Add the following to the view controller in order to return two different line series:
-(SChartSeries *)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index {
SChartLineSeries *lineSeries = [SChartLineSeries new];
// the first series is a cosine curve, the second is a sine curve
if (index == 0) {
lineSeries.title = @"y = cos(x)";
} else {
lineSeries.title = @"y = sin(x)";
}
return lineSeries;
}
The next method, sChart:numberOfDataPointsForSeriesAtIndex:
, is used to specify the number of data points within a specific series. Add the following implementation below:
- (NSInteger)sChart:(ShinobiChart *)chart numberOfDataPointsForSeriesAtIndex:(NSInteger)seriesIndex {
return 100;
}
In this example, both series have 100 points, but they do not have to have the same number.
The last method required by the protocol is sChart:dataPointAtIndex:forSeriesAtIndex:
, which the chart uses to request the value of each individual datapoint for each series. The returned datapoint must adopt the SChartData
protocol, which specifies xValue
and yValue
properties. The charting framework supplies a concrete implementation of this protocol, SChartDataPoint
, however, you have the option of implementing this protocol with your own data-objects in order to avoid the need to maintain two copies of your data.
Add the following implementation:
- (id<SChartData>)sChart:(ShinobiChart *)chart dataPointAtIndex:(NSInteger)dataIndex forSeriesAtIndex:(NSInteger)seriesIndex {
SChartDataPoint *datapoint = [SChartDataPoint new];
// both functions share the same x-values
double xValue = dataIndex / 10.0;
datapoint.xValue = [NSNumber numberWithDouble:xValue];
// compute the y-value for each series
if (seriesIndex == 0) {
datapoint.yValue = [NSNumber numberWithDouble:cos(xValue)];
} else {
datapoint.yValue = [NSNumber numberWithDouble:sin(xValue)];
}
return datapoint;
}
Now that the datasource is implemented, you can add the following to viewDidLoad
:
chart.datasource = self;
At this point if you build and run, you should see a couple of series:
With the current implementation each individual datapoint is requested via the datasource. If you have a lot of data, and it is already present in memory, you can optionally make use of the sChart:dataPointsForSeriesAtIndex:
protocol method. Your implementation of this method should return all the points for a given series, and this method will be used instead of sChart:dataPointAtIndex:forSeriesAtIndex:
.
Adding Labels and Basic Styling
The chart in its current state is a little plain! This section will build on the simple chart that you have created and add a bit more style.
Firstly, the axes could do with having some labels. Also, the Y axis could do with a bit of padding around the top and bottom values to make it easier to see the top and bottom of the curves.
Open up ViewController.m and edit the axis creation code as follows:
SChartNumberAxis *xAxis = [SChartNumberAxis new];
xAxis.title = @"X Value";
chart.xAxis = xAxis;
SChartNumberAxis *yAxis = [SChartNumberAxis new];
yAxis.title = @"Y Value";
yAxis.rangePaddingLow = @(0.1);
yAxis.rangePaddingHigh = @(0.1);
chart.yAxis = yAxis;
It would be nice to see the legend on the iPad, where there is much more screen space to play with. Add the following to the viewDidLoad
method:
chart.legend.hidden = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone;
One of the most powerful features of the Shinobi charts is their gesture-based interactions. Enable pan and zoom on each axis by adding the following code:
// enable gestures
yAxis.enableGesturePanning = YES;
yAxis.enableGestureZooming = YES;
xAxis.enableGesturePanning = YES;
xAxis.enableGestureZooming = YES;
These properties allow the user to pan the chart with a single-finger pan gesture, and zoom using two-finger pinch.
Finally, enable area fill by adding the following just after each series is created within sChart:seriesAtIndex:
:
lineSeries.style.showFill = YES;
Each series has a style object associated with it, where the style type depends on the series type. A line series has a style object of type SChartLineSeriesStyle
. These objects have a a number of properties which you can adjust including line color, thickness and the colors used for gradient fill.
To see the effect of the few simple changes you have just made, build and run:
Now that you have created a simple chart, why not have a go at creating a column, or pie chart?


Path
class includes various methods that can be used to
obtain information about the path, access elements of the path,
convert the path to other forms,
or extract portions of a path. There are also methods for matching
the path string
and methods for removing redundancies in a path.
This lesson addresses these Path
methods, sometimes
called syntactic operations, because they operate on the
path itself and don't access the file system.
This section covers the following:
A Path
instance contains the information used to specify the
location of a file or directory. At the time it is defined,
a Path
is provided with a series of one or more names.
A root element or a file name might be included, but neither
are required.
A Path
might consist of just a single directory or file name.
You can easily create a Path
object by using one of the
following get
methods from the
Paths
(note the plural) helper class:
Path p1 = Paths.get("/tmp/foo"); Path p2 = Paths.get(args[0]); Path p3 = Paths.get(URI.create("file:///Users/joe/FileTest.java"));
The Paths.get
method is shorthand for the following code:
Path p4 = FileSystems.getDefault().getPath("/users/sally");
The following example creates /u/joe/logs/foo.log
assuming your home directory is /u/joe
, or
C:\joe\log\foo.log
if you are on Windows.
Path p5 = Paths.get(System.getProperty("user.home"), "logs", "foo.log");
You can think of the Path
as storing these name elements
as a sequence. The highest element in the
directory structure would be located at index 0.
The lowest element in the directory structure would be located at index
[n-1]
, where n
is the number of name
elements in the Path
.
Methods are available for retrieving individual elements
or a subsequence of the Path
using these indexes.
The examples in this lesson use the following directory structure.
The following code snippet defines a
Path
instance and then invokes several
methods to obtain information about the path:
// None of these methods requires that the file corresponding // to the Path exists. Path path = Paths.get("C:\\home\\joe\\foo"); // Microsoft Windows syntax //Path path = Paths.get("/home/joe/foo"); // Solaris syntax System.out.format("toString: %s%n", path.toString()); System.out.format("getFileName: %s%n", path.getFileName()); System.out.format("getName(0): %s%n", path.getName(0)); System.out.format("getNameCount: %d%n", path.getNameCount()); System.out.format("subpath(0,2): %s%n", path.subpath(0,2)); System.out.format("getParent: %s%n", path.getParent()); System.out.format("getRoot: %s%n", path.getRoot());
| Method Invoked | Returns in the Solaris OS | Returns in Microsoft Windows | Comment |
|---|---|---|---|
toString |
/home/joe/foo |
|
Returns the string representation of the Path .
If the path was created using
Filesystems.getDefault().getPath(String)
or Paths.get (the latter is a convenience method
for getPath ), the method performs minor
syntactic cleanup. For example, in a UNIX operating system,
it will correct the input string //home/joe/foo
to /home/joe/foo .
|
getFileName |
foo |
foo |
Returns the file name or the last element of the sequence of name elements. |
getName(0) |
home |
home |
Returns the path element corresponding to the specified index. The 0th element is the path element closest to the root. |
getNameCount |
3 |
3 |
Returns the number of elements in the path. |
subpath(0,2) |
home/joe |
home\joe |
Returns the subsequence of the Path
(not including a root element) as specified by the
beginning and ending indexes.
|
getParent |
/home/joe |
\home\joe |
Returns the path of the parent directory. |
getRoot |
/ |
C:\ |
Returns the root of the path. |
The previous example shows the output for an absolute path. In the following example, a relative path is specified:
Path path = Paths.get("sally/bar"); // Solaris syntax or Path path = Paths.get("sally\\bar"); // Microsoft Windows syntax
Here is the output for Windows and the Solaris OS:
| Method Invoked | Returns in the Solaris OS | Returns in Microsoft Windows |
|---|---|---|
toString |
sally/bar |
sally\bar |
getFileName |
bar |
bar |
getName(0) |
sally |
sally |
getNameCount |
2 |
2 |
subpath(0,1) |
sally |
sally |
getParent |
sally |
sally |
getRoot |
null |
null |
Path
contains
redundant directory information.
Perhaps a server is configured to save its log files in
the "/dir/logs/.
" directory, and you want to
delete the trailing "/.
" notation from the path.
The following examples both include redundancies:
/home/./joe/foo /home/sally/../joe/foo
normalize
method removes any redundant elements,
which includes any ".
" or
"directory/..
" occurrences.
Both of the preceding examples normalize to /home/joe/foo
.
It is important to note that
normalize
doesn't check at the file system
when it cleans up a path. It is a purely syntactic operation.
In the second example, if sally
were a symbolic link,
removing sally/..
might result in a Path
that no longer locates the intended file.
To clean up a path while ensuring that the
result locates the correct file, you can
use the toRealPath
method. This method is
described in the next section,
Converting a Path.
Path
. If you need to convert the path to
a string that can be opened from a browser, you can use
toUri
. For example:
Path p1 = Paths.get("/home/logfile"); System.out.format("%s%n", p1.toUri()); // Result is file:///home/logfile
The
toAbsolutePath
method converts a path to an absolute path. If the passed-in
path is already absolute, it returns the same Path
object.
The toAbsolutePath
method can be very helpful when
processing user-entered file names. For example:
public class FileTest { public static void main(String[] args) throws IOException { if (args.length < 1) { System.out.println("usage: FileTest file"); System.exit(-1); } // Converts the input string to a Path object. Path inputPath = Paths.get(args[0]); // Converts the input Path to an absolute path. // Generally, this means prepending the current working // directory. If this example were called like this: // java FileTest foo // the getRoot and getParent methods would return null // on the original "inputPath" instance. Invoking getRoot and // getParent on the "fullPath" instance returns expected values. Path fullPath = inputPath.toAbsolutePath(); } }
The toAbsolutePath
method converts the user input and
returns a Path
that returns useful values when queried.
The file does not need to exist for this method to work.
The
toRealPath
method returns the real path of an existing file.
This method performs several operations in one:
true
is passed to this method and the file system
supports symbolic links, this method resolves any symbolic links in the path.
Path
is relative, it
returns an absolute path.
Path
contains any redundant elements,
it returns a path with those elements removed.
This method throws an exception if the file does not exist or cannot be accessed. You can catch the exception when you want to handle any of these cases. For example:
try { Path fp = path.toRealPath(true); } catch (NoSuchFileException x) { System.err.format("%s: no such file or directory%n", path); //Logic for case when file doesn't exist. } catch (IOException x) { System.err.format("%s%n", x); //Logic for other sort of file error. }
You can combine paths by using the
resolve
method.
You pass in a partial path , which is a path that does not
include a root element, and that partial path is appended to
the original path.
For example, consider the following code snippet:
Path p1 = Paths.get("/home/joe/foo"); // Solaris System.out.format("%s%n", p1.resolve("bar")); // Result is /home/joe/foo/bar or Path p1 = Paths.get("C:\\home\\joe\\foo"); // Microsoft Windows System.out.format("%s%n", p1.resolve("bar")); // Result is C:\home\joe\foo\bar
resolve
method
returns the passed-in path:
Paths.get("foo").resolve("/home/joe"); // Result is /home/joe
relativize
method.
This method constructs a path originating from the original
path and ending at the location specified by the passed-in path.
The new path is relative to the original path.
For example, consider two relative paths defined as joe
and
sally
:
Path p1 = Paths.get("joe"); Path p2 = Paths.get("sally");
joe
and sally
are siblings, meaning
nodes that reside at the same level in the tree structure.
To navigate from joe
to sally
,
you would expect to first navigate one level up to the parent
node and then down to sally
:
Path p1_to_p2 = p1.relativize(p2); // Result is ../sally Path p2_to_p1 = p2.relativize(p1); // Result is ../joe
Path p1 = Paths.get("home"); Path p3 = Paths.get("home/sally/bar"); Path p1_to_p3 = p1.relativize(p3); // Result is sally/bar Path p3_to_p1 = p3.relativize(p1); // Result is ../..
home
.
To navigate from home
to bar
, you first
navigate one level down to sally
and then
one more level down to bar
.
Navigating from bar
to home
requires
moving up two levels.
A relative path cannot be constructed if only one of the paths includes a root element. If both paths include a root element, the capability to construct a relative path is system dependent.
The recursive
Copy
example uses the relativize
and resolve
methods.
The Path
class supports
equals
, enabling you to test two paths for equality. The
startsWith
and
endsWith
methods enable you to test whether a path begins or ends with a particular
string. These methods are easy to use. For example:
Path path = ...; Path otherPath = ...; Path beginning = Paths.get("/home"); Path ending = Paths.get("foo"); if (path.equals(otherPath)) { //equality logic here } else if (path.startsWith(beginning)) { //path begins with "/home" } else if (path.endsWith(ending)) { //path ends with "foo" }
The Path
class implements the
Iterable
interface. The
iterator
method returns an object that enables you to iterate over
the name elements in the path. The first element returned
is that closest to the root in the directory tree.
The following code snippet iterates over a path, printing
each name element:
Path path = ...; for (Path name: path) { System.out.println(name); }
The Path
class also implements the
Comparable
interface. You can compare Path
objects
by using compareTo
which is useful for sorting.
You can also put Path
objects into
a Collection
. See the
Collections trail for more information about this powerful feature.
When you want to verify that two Path
objects locate the same
file, you can use the isSameFile
method, as described in
Checking Whether Two Paths Locate the Same File.


Jordan B Peterson is a clinical psychologist and professor of psychology at the University of Toronto in Canada. His focus resides on two main areas: the psychology of religious and ideological beliefs, and human personality.
A Timeline of Events
- 1962 - was born in Edmonton, Alberta.
- 1975 - the school librarian introduced him to authors like Orwell, Solzhenitzyn, and Rand.
- 1982 - received a BA in political science.
- 1984 - after taking a year off to visit europe, where he became interested in mankind's capacity for evil during the 20th century (especially the cold war), he completed a BA in psychology.
- 1993 - after receiving a Ph.D. in clinical psychology, he began working at Harvard as an associate professor.
- 1997 - returned to Canada to be a professor of psychology at U of Toronto.
- 2004 - a thirteen-part TV series was produced based on his book Maps of Meaning: The Architecture of Belief, published five years previously.
- 2014 - Peterson began to upload his university lectures to YouTube.
- 2015 - the Self Authoring program, a writing exercise designed by a group of psychologists (including Peterson) to help the user create their ideal future and act toward it, is released.
- 2016 - a video of Peterson and a group of students debating goes relatively viral, receiving 1.8 million views in one month. This is where I first heard of Peterson. Following this video, he then appeared on the Joe Rogan Experience podcast, where he made his aversion to Bill C-16 widely known. This was due to it's parallels with what he had found when studying evil and the cold war.
- 2017 - due to his increasing popularity, more of the public find out about and watch his lectures. Peterson's lessons on cleaning your room, growing up, facing the unknown and slaying the dragon resonate with his viewers, especially with young men, he notes. For me, and for others, the teachings of his lectures and the guidance of the Self Authoring program have been life-saving.


In the next stage of this study you will chat with a participant who provided the opposite response to the
question you just answered. Only one of you gave the correct answer. If both of you agree on the correct
answer
after discussion, each of you will get a bonus of $1. So try to find the correct answer in dialogue with the
other participant.
Please wait for the other participant to join the chat room. {% if view.pay_per_min > 0 %}
You are earning {{ view.pay_per_min|c }} per minute spent on this waiting
page. So far, you have earned for waiting
minutes.
{% endif %}


Manager
Buttons
Inputs
Input Sizing
Labels & Badges
Progress Bars
Input Groups
$
.00
Alert Messages
The system is running well
Your settings have been succesfully saved
Warning, check your permission settings
Your account has been suspended


So nasty that it's probably somewhat of a travesty having me
Then he told the people "You can call me Your Majesty!"
 The Villain got the dice rigged
And they say he accosted the man with the sliced wig
Allegedly; the investigation is still ongoing
In this pesky inition he gots the best con flowin'
The pot doubles, now they really got troubles
Madman never go *pop!* like snot bubbles


{% extends 'domestic/base.html' %}
{% load static %}
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load breadcrumbs from component_tags %}
{% block head_css %}
{{ block.super }}
{% endblock %}
{% block head_title %}UK Export Finance - Trade Finance{% endblock %}
{% block css_layout_class %}get-finance{% endblock %}
{% block content %}
{% image page.hero_image original as hero_image_rendition %}
{% include 'components/hero.html' with hero_title="Trade finance for UK exporters" hero_text="When it comes to exporting, having a great product or service is only half the story. Putting the right finance and insurance in place can make the difference, helping you to win contracts, fulfil orders and get paid." image_url=hero_image_rendition.url %}
{% breadcrumbs page.breadcrumbs_label %}
great.gov.ukUKEF
{% endbreadcrumbs %}
{% include 'domestic/finance/includes/get_finance_cta.html' %}
{{ page.advantages_title }}
{% for advantage_block in page.advantages %}
{% image advantage_block.value.icon original as advantage_icon_rendition %}
{{ advantage_block.value.content|richtext }}
{% endfor%}
{{ page.evidence|richtext }}
{% include 'domestic/finance/includes/get_finance_cta.html' %}
{% endblock %}


MDSMap: High Density Genetic Linkage Mapping using Multidimensional
Scaling
Estimate genetic linkage maps for markers on a single chromosome (or in a single linkage group) from pairwise recombination fractions or intermarker distances using weighted metric multidimensional scaling. The methods are suitable for autotetraploid as well as diploid populations. Options for assessing the fit to a known map are also provided. Methods are discussed in detail in Preedy and Hackett (2016) <doi:10.1007/s00122-016-2761-8>.
| Version: |
1.1 |
| Depends: |
R (≥ 3.2.0) |
| Imports: |
smacof (≥ 1.9.0), princurve (≥ 2.1.2), rgl, reshape |
| Suggests: |
qtl, R.rsp |
| Published: |
2018-08-09 |
| Author: |
Katharine F. Preedy, Christine A. Hackett |
| Maintainer: |
Bram Boskamp <bram.boskamp at bioss.ac.uk> |
| License: |
GPL-3 | file LICENSE |
| NeedsCompilation: |
no |
| CRAN checks: |
MDSMap results |
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=MDSMap
to link to this page.


lib/PreparedQuery.js
const constructQuery = require('./constructQuery');
const doJoins = require('./doJoins');
/**
* Class that presents a simple interface for constructing queries for a
* relational database using a model map object describing the connections
* between models.
*
* All methods except `exec` are chainable.
*
*/
class PreparedQuery {
/**
* Generally, this shouldn't be called by external code. This object is generated by the main
* interface when the `generateQueryFor` method is used.
*
* @param {String} modelId - The `primary` model to query
* @param {JoinJsMap} models - The complete schema of the database (after internal processing)
* @param {KnexInstance} knex - A knex instance
*/
constructor(modelId, models, knex) {
// This is safe as the models object is serialisable
this.models = JSON.parse(JSON.stringify((models)));
this.knex = knex;
this.modelId = modelId;
this.populated = [];
this.whereClauses = [];
this.originalModel = this.models.find(model => model.mapId === modelId);
if (!this.originalModel) {
throw new Error(`Invalid model ID ${modelId}`);
}
return this;
}
/**
* Populate the joins for a collection or association of the primary model of the query.
*
* @param {String} name - The name property of the association or collection
*/
populate(name) {
this.populated.push(name);
// Chainable
return this;
}
/**
* Define the number of elements to skip (useful for pagination).
*
* @param {Number} value - The number of elements to skip
*/
skip(value) {
this._skip = value;
// Chainable
return this;
}
/**
* Define the maximum number of elements to return (useful for pagination).
*
* @param {Number} value - The maximum number of elements to return
*/
limit(value) {
this._limit = value;
// Chainable
return this;
}
/**
* Define a restriction on the result set.
*
* @param {Object|Array} clauses - An object (or list of objects) specifying the
* predicate that all results must satisfy. Multiple calls to this function
* on a single prepared query instance will be appended to the list of clauses
* that are combined using boolean AND logic (ie. results must satisfy all
* predicates in the list)
*
* Each predicate consists of a `key` (the column name) and a `value` or `values`
* list. If a list of values is specifed it is interpreted as a WhereIn operation
* such that results can match ANY of the values supplied.
*/
where(clauses) {
if (!clauses || clauses.length === 0) {
return this;
}
// Allow a single where clause to be passed in
if (!Array.isArray(clauses)) {
clauses = [clauses];
}
// Validate the input structure
clauses.forEach(clause => {
if (!clause.key) {
throw new Error(`Where clause missing key: ${clause}`);
}
if ((clause.value === undefined) && !Array.isArray(clause.values)) {
throw new Error(`Where clause missing a value or values (array): ${clause}`);
}
if (clause.value !== undefined && Array.isArray(clause.values)) {
throw new Error(
'Each predicate in a where clause must specify a value OR a list of values');
}
});
this.whereClauses = this.whereClauses.concat(clauses);
// Chainable
return this;
}
/**
* Define the ordering of the results
*
* @param {String} attr - The column name to sort based on
* @param {String} dir - The direction of the sorting. Must be `asc` or `desc`.
*/
sort(attr, dir) {
this.sortAttr = attr;
this.sortDir = dir;
// Chainable
return this;
}
/**
* Run the query and construct a nested JS object representation of it.
*
* @returns {Promise} - A promise that resolves to the result of the query
*/
exec() {
// Note that we don't want to modify the original model
const modifiedModel = {
mapId: this.originalModel.mapId,
viewId: this.originalModel.viewId,
idProperty: this.originalModel.idProperty,
properties: this.originalModel.properties,
// Add a flag to determine which connections will need populating
associations: this.originalModel.associations.map(assoc => {
assoc.populate = !!this.populated.find(name => name === assoc.name);
return assoc;
}),
collections: this.originalModel.collections.map(coll => {
coll.populate = !!this.populated.find(name => name === coll.name);
return coll;
})
};
// Construct the query, run it and convert it to a nested object
return constructQuery(
this.models,
modifiedModel,
this.knex,
this.whereClauses,
this.sortAttr,
this.sortDir,
this._limit,
this._skip
).then(data => doJoins(
data,
this.models,
this.originalModel,
modifiedModel
));
}
}
module.exports = PreparedQuery;


#include <stMAMView.h>
Public Member Functions | |
| stMAMViewObjectSample (stSize size, stSize total) | |
| ~stMAMViewObjectSample () | |
| bool | MayAdd () |
| void | Add (ObjectType *obj) |
| ObjectType ** | GetObjects () |
| stSize | GetSize () |
| stSize | GetDesiredSampleSize () |
This class template implements a special object vector which can help metric tree implementators to get a set of random objects from the structure.
The basic use of this class is:
* for all objects in the MAM do * if list.MayAdd() then * list.Add(Object) * end if * End for *
The template parameter ObjectType determines the type of object to handle and has no special requirements.
Definition at line 144 of file stMAMView.h.
|
inline |
Creates a new instance of this class. The parameter size controls the number ob desired objectis in the sample and the parameter total determines the total number of objects in the universe. Both values are used to calculate the probability of acceptance of an object of the universe (using an uniform probability distribution - ).
| size | The desired size of the sample. |
| total | Total number of objects. |
Definition at line 156 of file stMAMView.h.
| stMAMViewObjectSample< ObjectType >::~stMAMViewObjectSample | ( | ) |
|
inline |
Adds a new object to the set.
| obj | The object to be added. This method will claim the ownership of this instance. |
Definition at line 193 of file stMAMView.h.
|
inline |
Returns the desired size of the set.
Definition at line 218 of file stMAMView.h.
|
inline |
Returns the array of objects. This method is suitable for stFastMapper::ChoosePivots().
Definition at line 204 of file stMAMView.h.
|
inline |
Returns the number of objects in this set.
Definition at line 211 of file stMAMView.h.
|
inline |
Ask this class if a given object from the tree may be added. This method should not be invoked more than once per object.
According to probability laws, at the end of all insertion attempts, this method will allow about GetDesiredSampleSize() insertions.
Definition at line 178 of file stMAMView.h.
References randomevent.


I should group together similar functions.
// Before:
function arrayUnique(array) { /* ... */ }
function arrayCommon(array) { /* ... */ }
function arrayDiff(array) { /* ... */ }
// After:
var arrayUtils = {
unique: function (array) { /* ... */ }
common: function (array) { /* ... */ }
diff: function (array) { /* ... */ }
};
array
? (Context)Essentially, you create an object, then create a second object, based on the first.
var one = {};
var two = somehowInheritFrom(one);
When JavaScript is trying to find a method or property, it works its way up the chain to find it.
At the top of the chain are the methods on Object.prototype
. If it's not there, undefined
is returned.
two.doSomething();
// Does `two` have `doSomething`? No
// Does `one` have `doSomething`? No
// Does `Object.prototype` have `doSomething`? No
// return `undefined`
// undefined();
// TypeError: two.doSomething is not a function
There can be a performance hit with longer chain lengths - try to keep the chain length small.
alert
ed?var one = {
count: 1,
array: [],
increase: function () { this.count += 1; },
push: function (thing) { this.array.push(thing); }
};
var two = somehowInheritFrom(one);
var jstr = JSON.stringify;
two.increase();
two.push("a");
document.getElementById("q1").onclick = function () {
alert(
"one.count = " + one.count + "\n" +
"one.array = " + jstr(one.array) + "\n\n" +
"two.count = " + two.count + "\n" +
"two.array = " + jstr(two.array) + "\n"
);
};
There is a gotcha when you start with inheritance: JavaScript references non-primative inherited properties, it does not copy them. When manipulating them, it manipulates the original, not a clone.
var one = {
count: 1, // primative
list: [] // non-primative
increase: function () { this.count += 1; },
push: function (thing) { this.array.push(thing); }
};
var two = somehowInheritFrom(one);
two.increase();
// one.count is still 1 and two.count is 2
two.push("a");
// one.array = ["a"] but two.array is also ["a"]
To get around that, and avoid confusion, always create your properties inside your methods.
var one = {
init: function () {
this.count = 1; // primative
this.list = []; // non-primative
}
increase: function () { this.count += 1; },
push: function (thing) { this.array.push(thing); }
};
var two = somehowInheritFrom(one);
var jstr = JSON.stringify;
one.init();
two.init();
two.increase();
two.push("a");
document.getElementById("q2").onclick = function () {
alert(
"one.count = " + one.count + "\n" +
"one.array = " + jstr(one.array) + "\n\n" +
"two.count = " + two.count + "\n" +
"two.array = " + jstr(two.array) + "\n"
);
};
There are three ways of checking whether an object has a property ...
... and a gotcha for each of them.
object.property === undefined
If JavaScript can't find the property, it returns undefined
, remember?
var one = {
exists: true
};
one.exists; // -> true
one.does_not_exist; // -> undefined
one.does_not_exist === undefined; // -> true
If you create a property and set it to undefined
then this check completely breaks.
var two = {
exists: true,
also_exists: undefined
};
two.exists; // -> true
two.also_exists; // -> undefined
two.also_exists === undefined; // -> true
"property" in object
JavaScript has the in
operator which checks to see if the property exists in the object, returning true
if it does.
var one = {
exists: true
};
"exists" in one; // -> true
"does_not_exist" in one; // -> false
in
also checks the entire chain and returns true
if it appears anywhere, which may not be what you want.
var two = somehowInheritFrom(one);
two.also_exists = true;
"also_exists" in two; // -> true
"exists" in two; // -> true
hasOwnProperty
All objects have a hasOwnProperty
method that checks to see if the property exists in that object. It returns true
if the property does and false
if the property doesn't or the property is inherited.
var one = {
exists: true
};
var two = somehowInheritFrom(one);
two.also_exists = true;
one.hasOwnProperty("exists"); // -> true
two.hasOwnProperty("exists"); // -> false
two.hasOwnProperty("also_exists"); // -> true
It's possible to replace hasOwnProperty
in your object and that can cause confusion.
two.hasOwnProperty = function () {
return true;
};
one.hasOwnProperty("exists"); // -> true
two.hasOwnProperty("exists"); // -> true - :-(
two.hasOwnProperty("also_exists"); // -> true
If you use Object.prototype.hasOwnProperty
and call
it with the context of the object you're checking, it should return the correct result.
(assuming no-one replaced it - never modify Object.prototype
!
Object.prototype.hasOwnProperty.call(one, "exists");
// -> true
Object.prototype.hasOwnProperty.call(two, "exists");
// -> false
Object.prototype.hasOwnProperty.call(two, "also_exists");
// -> true
Because nothing is ever simple in JavaScript, there are five techniques you can use. They don't really have names, but I'll name them for simplicity.
prototype
property)class
keyword)Object.create()
)Object.assign()
)prototype
propertyThis is the "correct" technique. It's the most efficient, the basis of JavaScript, it's in all the books and it's how CoffeeScript's class
keyword works.
It's also the most confusing technique by far.
You start by creating a constructor function.
var Foo = function () {
this.count = 0;
};
You then add methods to the prototype
property.
Foo.prototype = {
increase: function () {
this.count += 1;
},
decrease: function () {
this.count -= 1;
}
};
You create an instance using the new
keyword.
If you remember the lesson on context, this changes the context of Foo
from window
to the instance - please don't forget the new
.
var foo = new Foo();
foo.count; // -> 1
foo.increase();
foo.count; // -> 2
To create a sub-class, you need to set the prototype
of the child to an instance of the parent.
var Bar = function () {
this.count = 1;
};
Bar.prototype = new Foo();
You can then add or replace functionality to the child's prototype
. This does not affect the parent at all.
Bar.prototype.getCount = function () {
return this.count;
};
Create an instance of the child the same way as you did before.
var bar = new Bar();
bar.getCount(); // -> 1
bar.increase(); // Inherited from Foo
bar.getCount(); // -> 2
A common mistake is to try to add multiple new methods by setting the child prototype
to a new object, but this loses the link to the parent.
var Bar = function () {
this.count = 1;
};
Bar.prototype = new Foo();
Bar.prototype = {
getCount: function () {
return this.count;
}
};
var bar = new Bar();
bar.increase(); // TypeError
Another common mistake is to set the child's prototype
to the parent's prototype
but this makes the child's prototype
a reference to the parent's so changing the child's changes the parent's as well.
Bar.prototype = Foo.prototype;
Bar.prototype.getCount = function () {
return this.count;
};
var foo = new Foo();
foo.getCount(); // -> 1
The link is "live" meaning that if we add something to the parent, the child automatically gains the ability to use it.
Foo.prototype.halve = function () {
this.count /= 2;
};
bar.getCount(); // -> 2
bar.halve();
bar.getCount(); // -> 1
This is a "party trick" that JavaScript can do with inheritance. Other than debugging or hacking, it isn't actually very useful.
It also means that JavaScript can't optimise this because the link must always be maintained. So long as a child exists, the parent can't be garbage collected.
There are 2 problems with the "prototype technique":
Rewriting the constructor function of Foo
is a good way to make mistakes.
var Foo = function () {
this.count = 1;
};
var Bar = function () {
this.ccount = 11;
};
// ...
bar.increase();
bar.count; // -> 2; expected 12
The constructor function Foo
executes as soon as the inheritance is used.
var Foo = function () {
this.count = 1;
console.log("hello");
};
var Bar = function () {
this.count = 1;
};
Bar.prototype = new Foo(); // logs "hello"
To get around the first problem, you can either call the parent from inside the child:
var Bar = function () {
Foo.apply(this, arguments);
};
... but a lot of us create a constructor functon as a prototype
method and make sure the constructor function just calls that.
You still have to remember to write the same constructor function each time, of course, but there are solutions to that.
var Foo = function () {
return this.init.apply(this, arguments);
};
Foo.prototype = {
init: function () {
this.count = 1;
console.log("hi");
}
// ...
};
To get around the second issue ...
var Bar = function () {
return this.init.apply(this, arguments);
};
You first create a new, empty function:
var Temp = function () {};
Then you set the prototype
of the new function to the same as the parent's prototype
:
var Temp = function () {};
Temp.prototype = Foo.prototype;
Finally you set the prototype
of the child to an instance of the empty function:
var Temp = function () {};
Temp.prototype = Foo.prototype;
Bar.prototype = new Temp(); // does not log anything
var bar = new Bar();
bar.increase();
bar.count; // -> 2
Since that's a lot of work, most of us use some kind of createClass
function to handle the hard-to-remember stuff for us.
function createClass(Base, proto) {
// The constructor function.
var F = function () {
return this.init.apply(this, arguments);
};
// Set Base as the optional argument.
if (!proto) {
proto = Base;
Base = Object;
}
// The empty function trick.
var T = function () {};
T.prototype = Base.prototype;
F.prototype = new T();
// Add the properties from proto onto F.prototype.
var prop;
var hasOwn = Object.prototype.hasOwnProperty;
for (prop in proto) {
if (hasOwn.call(proto, prop)) {
F.prototype[prop] = proto[prop];
}
}
// Add an empty init, if we need one.
if (typeof F.prototype.init !== "function") {
F.prototype.init = function () {};
}
// Return our new class.
return F;
}
You can use that function to either create a class from nothing:
var Foo = createClass({
init: function () {
this.count = 1;
},
increase: function () {
this.count += 1;
},
decrease: function () {
this.count -= 1;
}
});
var foo = new Foo();
Or you can create a class based on another one:
var Bar = createClass(Foo, {
getCount: function () {
return this.count;
}
});
var bar = new Bar();
Sometimes you might want to override functionality but still access the parent functionality. For example, you might want to define a constructor function but still call the parent's constructor. This is known as accessing the "super" method.
The easiest way to do it with this technique is to simply call the parent's method and define the context.
var Bar = createClass(Foo, {
init: function (name) {
Foo.prototype.init.call(this); // super
this.name = name;
}
});
var bar = new Bar("alpha");
bar.count; // -> 1;
bar.name; // -> "alpha"
I'm not keen on this because you end up tightly-coupling the child to the parent; you can't add another class in the middle to do things like logging.
I think that a nicer way is to modify createClass
to keep a reference to the parent.
function createClass(Base, proto) {
var F = function () {
return this.init.apply(this, arguments);
};
// ...
F.parent = Base.prototype;
// ...

In 2008, John Resig (the guy who first wrote jQuery) showed a technique for creating a magic property that had access to the parent method.
The technique was pretty confusing, in my opinion, but it's a good base to start from and shows how to do the magic.
First, a little-known technique in JavaScript is that all functions can be converted into strings. This allows us to do regular expression tests on the function to see if the magic property is being requested.
John Resig used the underscore to show that the property was magic. In JavaScript, an underscore prefix is reserved for browser-proprietary methods. The dollar sign is reserved for system-generated properties and I think that's a better fit.
var fnTest = /[\.'"]\$super\b/;
Bar.prototype.init = function (name) {
this.$super();
this.name = name;
};
Bar.prototype.getCount = function () {
return this.count;
};
fnTest.test(Bar.prototype.init); // -> true
fnTest.test(Bar.prototype.getCount); // -> false
Then we need a pretty complex addMethod
to convert the method to understand our new magic property.
createClass.addMethod = function (Func, name, method) {
var parent = Func.parent;
Func.prototype[name] = (
typeof method === "function"
&& typeof parent[name] === "function"
&& fnTest.test(method)
)
? function () {
var temp = this.$super;
var ret;
this.$super = parent[name];
ret = method.apply(this, arguments);
this.$super = temp;
return ret;
}
: method;
};
Then we tweak the createClass
method itself.
function createClass(Base, proto) {
// ...
for (prop in proto) {
if (hasOwn.call(prop, proto) {
createClass.addMethod(F, prop, proto[prop]);
}
}
F.addMethod = function (name, method) {
createClass.addMethod(F, name, method);
};
// ...
}
With that fully integrated, we can do clever things like this:
var Foo = createClass({
init: function () {
this.count = 1;
}
});
var Bar = createClass(Foo, {
init: function (name) {
this.$super();
this.name = name;
}
});
var bar = new Bar("alpha");
bar.count; // -> 1 (came from Foo#init)
bar.name; // -> "alpha" (came from Bar#init)
If you want to use this technique, I've included the full version of createClass
in the GitHut repo.
class
keywordThis technique is really new (Chrome 42, Firefox 45, IE Edge 13) and really pointless (it's just syntactic sugar for the prototype
technique). It's also a radical mis-understanding of how JavaScript works.
It looks a little similar and a bit familiar.
class Foo {
constructor() {
this.count = 1;
}
increase() {
this.count += 1;
}
decrease() {
this.count -= 1;
}
}
var foo = new Foo();
foo.increase();
foo.count; // -> 2
Extending is easier, to be fair.
class Bar extends Foo {
getCount() {
return this.count;
}
}
var bar = new Bar();
bar.getCount(); // -> 2
Because this technique is the same as the prototype
technique, they are interchangable.
var Foo = function () {
this.count = 1;
};
Foo.prototype = {
increase: function () {
this.count += 1;
},
decrease: function () {
this.count -= 1;
}
};
class Bar extends Foo {
getCount() {
return this.count;
}
}
var bar = new Bar();
bar.increase();
bar.getCount(); // -> 2
There are a couple more things that you can do with the new class
keyword but nothing that we couldn't do before.
The class
keyword can:
Object.defineProperty
).createClass
).Object.create
Remember that empty function trick you just a couple of slides ago? Object.create
is essentially that.
// Only needed before IE9
if (typeof Object.create !== "function") {
Object.create = function (base) {
var F = function () {};
F.prototype = base;
return new F();
};
}
This means we can asjust the way we inherit from other constructors.
var Bar = function () {
return this.init.apply(this, arguments);
};
Bar.prototype = Object.create(Foo.prototype);
... and adjust our createClass
function.
function createClass(Base, proto) {
// ...
// The constructor function.
var F = function () {
return this.init.apply(this, arguments);
};
// The empty function trick.
F.prototype = Object.create(Base.prototype);
// ...
}
But the really useful thing that we can do with Object.create
is inherit directly from other objects without the need for constructors.
var one = {
exists: true
};
var two = Object.create(one); // somehowInheritFrom
two.also_exists = true;
two.exists; // -> true;
two.also_exists; // -> true;
one.also_exists; // -> false;
The link is still live.
one.newly_exists = true;
two.newly_exists; // -> true
Object.assign
At some point, every single JavaScripter writes something like this:
var one = {
foo: "foo"
};
var two = {
bar: "bar"
};
for (var prop in two) {
if (Object.prototype.hasOwnProperty.call(two, prop)) {
one[prop] = two[prop];
}
}
one; // -> { foo: "foo", bar: "bar" }
Most popular libraries include a way of doing this.
// PrototypeJS
Object.extend(one, two);
// jQuery
$.extend(one, two);
In 2016, ECMAScript finally added a native function to do this: Object.assign
var one = {
foo: "foo"
};
var two = {
bar: "bar"
};
Object.assign(one, two);
one; // -> { foo: "foo", bar: "bar }
Object.assign
can take any number of variables (always extending the first object with the subsequent objects) and returns the first object afterwards. It's not in many browsers, but there's a simple polyfill:
if (typeof Object.assign !== "function") {
Object.assign = function (source) {
var slice = Array.prototype.slice;
var objects = slice.call(arguments, 1);
objects.forEach(function (object) {
Object.keys(object).forEach(function (key) {
source[key] = object[key];
});
});
return source;
};
}
This gives us the most simple version of inheritance ever created.
var foo = {
count: 1
};
var bar = Object.assign({}, foo, {
name: "bar"
});
bar.count; // -> 1
bar.name; // -> "bar"
bar.hasOwnProperty("count"); // -> true
bar.hasOwnProperty("name"); // -> true
The trade-off is that the link is no longer live.
foo.exists = true;
bar.exists; // -> undefined
If that sort of thing worries you, you can always combine Object.assign
and Object.create
var foo = {
count: 1
};
var bar = Object.assign(Object.create(foo), {
name: "bar"
});
bar; // -> { count: 1, name: "bar" }
foo.exists = true;
bar; // -> { count: 1, name: "bar", exists: true }
The final technique is rare but very effective. It creates a private scope (which no other technique can) and works in every single browser, node, CoffeeScript - everywhere.
The steps to creating an object are:
function makeFoo() {
"use strict";
// Step 1: create variables.
var foo = {};
var count = 1;
// Step 2: create functions.
function increase() {
count += 1;
}
function decrease() {
count -= 1;
}
function getCount() {
return count;
}
// Step 3: add the functions.
Object.assign(foo, {
increase: increase,
decrease: decrease,
getCount: getCount
});
// Step 4: freeze and return.
return Object.freeze(foo);
}
// Usage:
var foo = makeFoo();
foo.getCount(); // -> 1
foo.increase();
foo.getCount(); // -> 2
Inheritance is just as simple as making another object one of the private variables in step 1. Everything else is the same.
You can also use the make
function as a constructor.
function makeBar(name) {
var bar = {};
var foo = makeFoo();
function getName() {
return name;
}
Object.assign(bar, foo, {
getName: getName
});
return Object.freeze(bar);
}
var bar = makeBar("bar");
bar.getName(); // -> "bar"
bar.getCount(); // -> 1
Since you have access to the parent object, you don't need any tricks to use a super method.
function makeBaz(firstname, lastname) {
var baz = {};
var bar = makeBar(firstname);
function getName() {
return bar.getName() + " " + lastname;
}
Object.assign(baz, bar, {
getName: getName
});
return Object.freeze(baz);
}
var baz = makeBaz("John", "Smith");
baz.getName(); // -> "John Smith"
If you notice, we're not inheriting anything, just copying the methods that we need. This allows the chain to be many levels deep without the performance hit that multiple layers of prototype
can have.
Despite all these advantages and simplicity, it's hugely controversial and not considered "real" or "sensible".
Functions are created each time an instance is made. People say that this is a waste of memory.
It wastes a handfull of kilobytes. When we the last time you bought a device where the memory was measured in kilobytes?
Private variables can't be accessed or changed.
Yeah ... private variables don't make any sense and they're not useful.
You can't change a frozen object.
That's actually an advantage - the engine can optimise that and your data is always preserved.
There's no context so you can't change a variable unless it's part of the object.
You can pass functions around without a problem and you always know which variables you're affecting.
There are probably other criticisms and they mainly exist because Douglas Crockford was the one who suggested the technique.
Of the five techniques:
prototype
property if you can work out what the developer's createClass
function is called.class
keyword if you have to.Object.create
if you need a live link.Object.assign
if you don't need a live link.Personally, I think the combination of Object.assign
and Object.create
is the best one.
var child = Object.assign(Object.create(parent), {
// ...
});
There are polyfills for both in the GitHut repo.
/


SanguoSHA
问题描述 :
Sanguosha has a singled version. Two players each select N heroes and start fighting. If a hero dies, the next follows. If one player’s heroes are all dead, he loses.
There’re restraints among heroes. For example, YuJi restricts Zhu Geliang, LuXun restricts DaQiao, ZhangJiao restricts MaChao, WeiYan restricts XiaoQiao.
Today I play with friends. I know the heroes and the restraints.(If opponent’s hero restraint my hero, my hero will be beaten, others my hero will beat opponent’s hero)
Can you arrange my heroes’ order,no matter what order of opponent’s heroes, so that I can win the game?
There’re restraints among heroes. For example, YuJi restricts Zhu Geliang, LuXun restricts DaQiao, ZhangJiao restricts MaChao, WeiYan restricts XiaoQiao.
Today I play with friends. I know the heroes and the restraints.(If opponent’s hero restraint my hero, my hero will be beaten, others my hero will beat opponent’s hero)
Can you arrange my heroes’ order,no matter what order of opponent’s heroes, so that I can win the game?
输入:
The first line is a number T(1<=T<=50), represents the number of case. The next T blocks follow each indicates a case.
The first line is N(3<=N<=6).
The second line has N names(shorter than 20 letter).
The following N lines each contains a restraints. Restraints are given as “k b1 b2 … bk”, which means the opponent’s hero restricts my hero b1, b2 … bk. (0<=K<=N)
The first line is N(3<=N<=6).
The second line has N names(shorter than 20 letter).
The following N lines each contains a restraints. Restraints are given as “k b1 b2 … bk”, which means the opponent’s hero restricts my hero b1, b2 … bk. (0<=K<=N)
输出:
The first line is a number T(1<=T<=50), represents the number of case. The next T blocks follow each indicates a case.
The first line is N(3<=N<=6).
The second line has N names(shorter than 20 letter).
The following N lines each contains a restraints. Restraints are given as “k b1 b2 … bk”, which means the opponent’s hero restricts my hero b1, b2 … bk. (0<=K<=N)
The first line is N(3<=N<=6).
The second line has N names(shorter than 20 letter).
The following N lines each contains a restraints. Restraints are given as “k b1 b2 … bk”, which means the opponent’s hero restricts my hero b1, b2 … bk. (0<=K<=N)
样例输入:
2 3 ZhugeLiang HuangYueying ZhenJi 1 ZhugeLiang 2 HuangYueying ZhenJi 2 ZhugeLiang ZhenJi 4 MaChao YanLiangWenChou YuJin XiaoQiao 2 MaChao XiaoQiao 2 YanLiangWenChou YuJin 1 XiaoQiao 0
样例输出:
Case 1: No Case 2: Yes MaChao YanLiangWenChou XiaoQiao YuJin
HDU-4068-SanguoSHA
http://acm.hdu.edu.cn/showproblem.php?pid=4068
字符串模拟，枚举自己和对手的牌的全排列即可
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int map[10][10]; char str[10][25]; int a[10],b[10]; int n,flag; int check(int a[10],int b[10]) { int num1=1,num2=1; while(num1<=n&&num2<=n) { if(map[b[num2]][a[num1]]) num1++; else num2++; } if(num2>num1) return 1; return 0; } int main() { int k,t,i,tt,j; char s[25]; scanf("%d",&t); for(k=1;k<=t;k++) { scanf("%d",&n); for(i=1;i<=n;i++) scanf("%s",str[i]); memset(map,0,sizeof(map)); for(i=1;i<=n;i++) { scanf("%d",&tt); while(tt--) { scanf("%s",s); for(j=1;j<=n;j++) if(strcmp(s,str[j])==0) { map[i][j]=1; break; } } } for(i=1;i<=n;i++) a[i]=i; do { flag=1; for(i=1;i<=n;i++) b[i]=i; do { if(!check(a,b)) { flag=0; break; } }while(next_permutation(b+1,b+n+1)); if(flag) break; }while(next_permutation(a+1,a+n+1)); printf("Case %d: ",k); if(flag==0) printf("No\n"); else { printf("Yes\n"); for(i=1;i<=n;i++) { if(i==n) printf("%s\n",str[a[i]]); else printf("%s ",str[a[i]]); } } } return 0; }
版权声明：本文为博主原创文章，未经博主允许不得转载。
参考：http://blog.csdn.net/cambridgeacm/article/details/7821914
(adsbygoogle = window.adsbygoogle || []).push({});
1542382661
1542382661
1542382661
1542382661
1542382661
1542382661
1542382661
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
门前大桥下~~~ 小燕子纪憾阂汤郧揽啃贩21610
第15行代码，/n/n，应该改为\n\n
https://coding.net/moon/miracle
swap写成内联函数会不会好一些
嗯 分析得很到位，确实用模板编程能让面试官对你的印象更好。在设置辅助栈的时候可以这样：push时，比较要push的elem和辅助栈的栈顶，elem<=min.top()，则min.push(elem).否则只要push（elem）就好。在pop的时候，比较stack.top()与min.top(),if(stack.top()<=min.top()),则{stack.pop();min.pop();}，否则{stack.pop();}.
思路二可以用一个长度为k的队列来实现，入队后判断下队尾元素的next指针是否为空，若为空，则出队指针即为所求。
是O(m+n)，不小心打错了
为避免精度问题，PI值请使用arccos(-1)。应该是acos
多谢指出，已改正
很棒的网站，加油！⛽
递归还真是一门学问，学习了
顺利测试通过了，多谢
看见的晚了，只能提交一次唉
可以用公式。主要为了说明动态规划，如果要打表的话，这种方法也是较简单和高效的


Fatehgarh Sahib is a town and a sacred pilgrimage site of Sikhism in the north west Indian state of Punjab. It is the headquarters of Fatehgarh Sahib district, located about 5 kilometres (3.1 mi) north of Sirhind. Fatehgarh Sahib is named after Fateh Singh, the 6-year-old son of Guru Gobind Singh, who was seized and buried alive, along with his 9-year-old brother Zoravar Singh, by the Mughals under the orders of governor Wazir Khan during the ongoing Mughal-Sikh wars of the early 18th century. The town experienced major historical events after the martyrdom of the sons in 1705, with frequent changes of control between the Sikhs and Mughals. The town features historic Gurdwaras, including the underground Bhora Sahib marking the location where the two boys refused to convert to Islam and fearlessly accepted being bricked alive. In contemporary times, the town is the site of educational institutions such as the SGPC run Guru Granth Sahib University and Baba Banda Singh Bahadur Engineering College.
HistoryThe city is a historically important settlement 40 kilometres (25 mi) north of the city of Patiala and 42 kilometers (26 mi) west of Punjab's capital, Chandigarh. It is a major pilgrimage center in Sikhism. The Gurdwara Fatehgarh Sahib is the major landmark in the town. It marks the location where two youngest sons of Guru Gobind Singh Ji – 7-year-old Fateh Singh and 9-year-old Zorawar Singh – were betrayed by their cook and servant Gangu to the Mughal army, seized, asked to convert to Islam and when they refused they were buried alive under the orders of Wazir Khan. |
|
|
|
Places of worship
the underground location within Fatehgarh Sahib Gurdwara where the two sons were buried alive. This monument was built by Karam Singh of Patiala in early 19th-century. the main Sikh temple in the town, in whose basement is Bhora Sahib. The Gurdwara stands on a high point of the town, has an Indo-Islamic architecture with a square plan, a ribbed lotus dome and cusped arches. The floor is made of marble and is decorated with a mosaic. lies about 1.5 kilometres (0.93 mi) southeast from Fatehgarh Sahib on the Sirhind-Chandigarh road. |


Mac OS X 10.7 Lion: the Ars Technica review
Process model
If you were flipping out over the document changes described in the previous section, buckle up, because the discomfort level is about to rise yet again.
The small indicator lights shown beneath running applications in the Dock are now optional in Lion.
In pre-release builds of Lion, all applications in the Dock looked exactly the same, running or otherwise. At the last minute, it seems Apple chickened out and enabled the indicator lights by default.
Apple's message with this feature is a simple one, but also one that the nerdly mind rebels against: "It doesn't matter if an application is running or not. You shouldn't care. Stop thinking about it." Geek panic!
Remain calm. Let's start with the APIs. Sudden Termination, a feature that was introduced in Snow Leopard, allows applications to indicate to the system that it's safe to kill them "impolitely" (i.e., by sending them SIGKILL, causing them to terminate immediately, with no chance for potentially time-consuming clean-up operations to execute). Applications are expected to set this bit when they're sure they're not in the middle of doing something, have no open files, no unflushed buffers, and so on.
This feature enables Snow Leopard to log out, shut down, and restart more quickly than earlier versions of Mac OS X. When it can, the OS simply kills processes instead of politely asking them to exit. (When Snow Leopard was released, Apple made sure its own applications and daemon processes supported Sudden Termination, even if third-party applications didn't.)
Lion includes a new feature called Automatic Termination. Whereas Sudden Termination lets an application tell the system when it's okay to terminate it with extreme prejudice, Automatic Termination lets an application tell the system that it's okay to politely ask the program to exit.
But wait, isn't it always okay for the OS to politely ask an application to exit? Isn't that what's always happened in Mac OS X on logout, shutdown, or restart? Yes, but what makes Automatic Termination different is when and why this might happen. In Lion, the OS may terminate applications that are not in use in order to reclaim resources—primarily memory, but also things like file descriptors, CPU cycles, and processes.
You read that right. Lion will quit your running applications behind your back if it decides it needs the resources, and if you don't appear to be using them. The heuristic for determining whether an application is "in use" is very conservative: it must not be the active application, it must have no visible, non-minimized windows—and, of course, it must explicitly support Automatic Termination.
Automatic Termination works hand-in-hand with autosave. Any application that supports Automatic Termination should also support autosave and document restore. Since only applications with no visible windows are eligible for Automatic Termination, and since by default the Dock does not indicate whether or not an application is running, the user might not even notice when an application is automatically terminated by the system. No dialog boxes will ask about unsaved changes, and when the user clicks on the application in the Dock to reactivate it, it should relaunch and appear exactly as it did before it was terminated.
This is effectively a deprecation of the Quit command. It also, perhaps coincidentally, solves the age-old problem of former Windows users expecting applications to terminate when they no longer have any open windows. When Automatic Termination is enabled in an application, that's exactly what will happen—if and when the system needs to reclaim some resources, that is.
As if all of this isn't enough, Lion features one final application management twist. When an application is terminated in Lion, all the usual things appear to happen. If the running application indicator is enabled, the small dot will disappear from beneath the application's Dock icon. Assuming it's not a permanent resident, the application icon will disappear from the Dock. The application will no longer appear in the command-tab application switcher, or in Mission Control. You might therefore conclude that this application's process has terminated.
A quick trip to the Activity Monitor application or the "ps
" command-line utility may dissuade you of that notion. Lion reserves the right to keep an application's process around just in case the user decides to relaunch it. Upon relaunch, the application appears to start up instantly—because it was never actually terminated, but was simply removed from all parts of the GUI normally occupied by running applications.
That's right, gentle readers. In Lion, an ostensibly "running" application may have no associated process (because the operating system automatically terminated it in order to reclaim resources) and an application may have a process even when it doesn't appear to be running. Applications without processes. Processes without applications. Did Lion just blow your mind?
The pitch
The application and document model changes in Lion are a radical break with the past—the past of the desktop, that is. Everything described above has existed since day one on Apple's mobile platform. Indeed, iOS is the most compelling argument in favor of the changes in Lion. For every objection offered by a long-time personal computer aficionado, there are millions of iOS users countering the argument every day with their fingers and their wallets.
These changes in Lion are meant to reduce the number of things the user has to care about. And while you may think you really do need to care about when your documents are saved to disk or when the memory occupied by an application is returned to the system, you may be surprised by how little you think about these things once you become accustomed to the computer managing them for you. If you're an iOS user, think about how often you've wanted a "Save" button in an app on your iPhone or iPad, for example.
So that's the pitch: Lion will bring the worry-free usability of iOS application and document management to the Mac. For the vast majority of Mac users, I think it will be an easy sale.
The reality
There's a common thread running through all of the application and document model features described above: they're all opt-in, and developers must add code to their applications to support them. Apple has some ability to hasten the transition to Lion-savvy applications through evangelism, positive reinforcement (the carrot), and the increasing popularity of the Mac App Store (the stick). But no matter what Apple does, the idyllic image of an iOS-like experience on your Mac will take a long time to materialize.
In the meantime, it's easy to envision a frustrating hodgepodge of old and new Mac applications running on Lion, making users second-guess their hard-won computing instincts at every turn. What I think will actually happen is that the top-tier Mac developers will quickly add support for some or all of these new features and users will start to look down on applications that still behave the "old way." I'm sure that's how Apple hopes things turn out, too.
User comments


Hi, My name's Nils Deppe! I'm a computational astrophysicist developing efficient, scalable software to solve challenging technical problems. That's sort of vague, but I'm interested in many different problems that all require creative, efficient, and scalable software solutions. I enjoy spending my free time time with my partner, hiking, listening to music, hanging out with our cat, and playing Nintendo Switch.
I'm currently a Sherman Fairchild postdoctoral fellow in computational astrophysics at Caltech and will be starting as an Assistant Professor of Physics at Cornell University in July 2023.
Before joining Caltech, I completed my Ph.D. in computational astrophysics at Cornell University under the supervision of Prof. Saul Teukolsky and Dr. Lawrence Kidder. My work mostly focused on developing and implementing new high-order spectral methods for relativistic magnetohydrodynamics and solving the Einstein equations. In particular, my research focuses on ensuring numerical relativity simulations are accurate enough for next-generation gravitational wave observatories like Cosmic Explorer, Einstein Telescope, and LISA. I am a member of the LIGO Scientific Collaboration, the Simulating eXtreme Spacetimes collaboration, and a core developer of the next-generation numerical relativity code, SpECTRE.
My work on binary black hole merger simulations focuses on reducing computational cost and increasing accuracy to meet the demands of next-generation gravitational wave observatories. For this I use SpECTRE as well as the Simulating eXtreme Spacetimes' current production code, SpEC. My work on single and binary neutron star simulations focuses on improving simulation accuracy and including additional microphysics. I also collaborate with graduate students and postdocs using SpECTRE to study accretion disks around black holes and stellar explosions/core-collapse supernovae. While my current research focuses on binary mergers, I've also worked on critical behavior in gravitational collapse, stability of anti-de Sitter spacetime, and gravitational wave extraction from merger simulations.
You can find my publications and open-source software I've developed at the links below.
{% if site.cv %} {% endif %} {% if site.orcid_id %} {% endif %} {% if site.arxiv %} {% endif %} {% if site.inspirehep_id %} {% endif %} {% if site.github_username %} {% endif %} {% if site.bitbucket_username %} {% endif %} {% if site.linkedin_username %} {% endif %}


{% load crispy_forms_filters %}
{% load crispy_forms_tags %}
{% load i18n %}
{% comment %}Translators: This text is the heading of a section in a user's profile where they can change their preferences. {% endcomment %}
{% trans "Preferences" %}
{% comment %}Translators: In the preferences section of a user profile, this text labels the form where users can change the site language. {% endcomment %}
{% trans "Language" %}
{% include 'users/language_form.html' %}
{% comment %}Translators: In the preferences section of a user profile, this text labels the form where users can change their email preferences. {% endcomment %}
{% trans "Emails" %}
{% include 'users/user_email_preferences.html' %}
{% if user.has_usable_password %}
{% comment %}Translators: This is the heading of the section of a user's profile where users can change their password. {% endcomment %}
{% trans "Password" %}
{% endif %}
{% if user.userprofile.terms_of_use %}
{% comment %} Translators: This is the heading of the section of a user's
profile where they disagree their terms of use. {% endcomment %}
{% trans "Terms of use" %}
{% endif %}
{% comment %}Translators: This is the heading of the section of a user's profile where they can download, restrict, or delete their personal data. {% endcomment %}
{% trans "Data" %}
{% comment %}Translators: This text labels a button users can click to enable data processing restriction on their account. {% endcomment %}
{% trans "Restrict" %}
{% comment %}Translators: This text labels a button users can click to delete their account. {% endcomment %}
{% trans "Delete" %}


-
Mystery Man Who Moves Japanese Markets Made More Than 1 Million Trades
www.bloomberg.com
It was six minutes after the opening bell on Feb. 4, and dozens of big-name stocks were still untraded in Tokyo. Telecommunications giant SoftBank ...
-
China’s H Shares Fall for Third Straight Week as Sinopec Slumps
www.bloomberg.com
Chinese stocks fell in Hong Kong, with the benchmark index declining for a third straight week, as energy producers and financial companies retreated.
-
Inflation Slowing More Than Forecast Shows Risk for BOJ: Economy
www.bloomberg.com
Japan’s inflation slowed more than expected in August, highlighting the risks facing Bank of Japan Governor Haruhiko Kuroda in his push for prices to ...
-
The most important chart about the American economy you'll see this year
www.vox.com
Economic growth used to mean rising incomes for all families, but in the early years of the most recent recovery the typical household actually saw ...
-
A Decoy Computer Was Set Up Online. See Which Countries Attacked It the ...
www.bloomberg.com
A Decoy Computer Was Set Up Online. See Which Countries Attacked It the Most
-
The Secret Goldman Sachs Tapes
www.bloombergview.com
The public doesn't seem to understand just how dysfunctional our financial regulatory system is, Michael Lewis writes. That may change today with a ...
-
Palestinian Rivals Hamas and Fatah Agree on Governing of Gaza Strip
online.wsj.com
Hamas and Fatah, the two most powerful Palestinian political factions, reached a deal on Thursday, giving the Palestinian Authority a role in ...
-
Is there a subprime auto loan bubble?
www.usatoday.com
Subprime mortgage lending shouldered much of the blame for the last financial crisis. Now some observers are concerned that a recent jump in subprime ...
-
Clorox warns of safety concerns after Venezuelan takeover of plants
finance.yahoo.com
(Reuters) - U.S. cleaning products maker Clorox Co said the Venezuelan government's takeover of two of its plants after the company pulled out of the ...
-
Mathematics 101: The Money Printing Machine And CAPE
www.valuewalk.com
The ironclad Shiller CAPE device has been temporarily neutralized by the Federal Reserve’s artificially cheapening money printing
-
At CIA Starbucks, even the baristas are covert
www.washingtonpost.com
At a Starbucks deep inside the CIA's Langley, Va., compound, even the baristas are covert.
-
御嶽山が大噴火したまさにその直後の現地ムービーがYouTubeにアップされ公開中
gigazine.net
11時53分頃、長野と岐阜の県境にある御嶽山が噴火、噴火警戒レベルは「入山規制」を示すレベル3に引き上げられ、行方不明者も多数出ている状態となっていますが、なんとYouTubeに4K画質でこの噴火
-
The Return of the Black Death | VICE United States
www.vice.com
We went to Madagascar in the fall of 2013 because the village of Beranimbo had been an epicenter of a black plague outbreak that resulted in nearly ...
-
These FBI Charts Confirm That Mass Shootings In America Have Risen Sharply ...
www.businessinsider.com
There's been a lot of speculation in recent years about whether mass shootings are actually on the rise in America or we're just paying more ...
-
Workers To Begin Laying First Segments Of Rail For M-1 Track - CBS Detroit
detroit.cbslocal.com
M-1 rail crews will begin dragging the first pieces of 560 foot, four-ton sections of rail into place along the downtown portion of the Woodward ...
-
Dólar en Venezuela en el mercado negro superó la barrera de los 100 ...
www.panamericanworld.com
La moneda venezolana se desplomó nuevamente, con el precio de 100 bolívares por dólar en el mercado negro el viernes, según los sitios web de ...
-
Pimco Could See Withdrawals Up to 30% as Managers Stunned
www.bloomberg.com
Pacific Investment Management Co. may see asset withdrawals of as much as 30 percent after the surprise departure of Bill Gross, a legend in the bond ...
-
Hedge Fund Manager Chanos Accused in Wynn Slander Suit
www.bloomberg.com
Wynn Resorts Ltd. sued hedge fund short-seller Jim Chanos for slander, claiming that he falsely alleged the casino operator had violated a U.S. ...
-
5 Things to Know About Ello, the Social Network with a Manifesto
blogs.wsj.com
The Internet is abuzz over Ello, a new social network that launched this past summer and is enjoying a spike in sign-ups. If you aren’t caught up, ...
-
SUMERIAN | Tumblr
www.tumblr.com
Post anything (from anywhere!), customize everything, and find and follow what you love. Create your own Tumblr blog today.
-
Public Sees Religion’s Influence Waning
www.pewforum.org
Nearly three-quarters of Americans now think religion is losing influence in American life, and most who say this also see it as a bad thing. Perhaps ...
-
Ebola Death Toll In West Africa Passes 3,000: WHO
www.huffingtonpost.com
(Adds details from report, background) DAKAR, Sept 26 (Reuters) - The death toll from an outbreak of Ebola in West Africa has risen to at least 3,091 ...
-
Why the Fed Will Always Wimp Out on Goldman
www.politico.com
So now, thanks to secret tape recordings made by Carmen Segarra, a rightly disgruntled former employee of the Federal Reserve Bank of New York, the ...
-
A Motorcycle Fueled By Bacon Is Sizzling Down America's Highways
www.fastcoexist.com
Because bacon brands are struggling to find outlandish things that haven't been done to bacon yet.
-
RadioShack Corporation Up As Hedge Fund Broadcasts Potential Bailout
www.benzinga.com
RadioShack Corporation (NYSE: RSH) gained about 40 percent Friday after a hedge fund said a bailout for the beleaguered electronics retailer might be ...
-
Gross' outspoken nature troubled Pimco colleagues
www.usatoday.com
Bond King Bill Gross' outspoken and abrasive nature played role in his departure from Pimco.
-
Departure of Gross Stokes Fear of Bond-Selling Spree
dealbook.nytimes.com
The focus is on government bonds in Italy and Spain — an area that the Pimco Total Return Fund had piled into recently.
-
Screaming Inmates Make L.A. Rethink Jailing Mentally Ill
www.bloomberg.com
Inmates in suicide-proof gowns scream and bang on their cell doors one floor below Terri McDonald’s office in the Twin Towers Correctional Facility. ...


Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.
These are all pretty much the same thing.
A text-based command interpreter.
The most common shell is "bash".
For Mac's OSX, use the "Terminal" application.
Windows: Download Git for Bash, then open Git BASH
Mac: Open Terminal
Usually shows your username and computer name.
Indicates that the terminal is ready for a command.
Indicates your current spot in the terminal.
Shows you where the stuff you type will go.
pwd
into your terminal.pwd
The clear
command clears the contents of the terminal and issues a prompt.
This is good for removing previous output that is unnecessary to the task at hand.
Feel free to use this whenever things get too cluttered.
Also referred to as "folders".
A container for files or other directories.
Nested files and directories can be referenced using paths
.
The set of all folders, taken together, makes up your entire file system.
This system is organized into a kind of upside down tree.
At the very top of the tree is the root folder.
Each directory or file is separated by a forward slash "/"
There are two kinds of paths:
Desktop/the_project/overview.txt
/Users/jane/Desktop/logo.png
.
..
~
The cd
command changes the current working directory.
It expects a file path as an "argument".
If no file path is given, it assumes your home directory by default.
The ls
command lists the contents of a directory.
It expects a file path as an "argument".
If no file path is given, it assumes the current directory by default.
The ls
command accepts several option flags.
A flag is a special argument that is used to set an option for the command.
These are commonly a hyphen followed by a single character (e.g. -g
)
Setting the -l
flag on the ls
command causes it to provide more verbose output.
Play with the cd
and ls
commands.
.
shortcut..
shortcut~
shortcutcd
without an argumentUse pwd
to check your location periodically.
Use the mkdir
command to create a new empty directory.
Pass the path of the directory name as the first argument.
If the base of the path doesn't already exist, the command will fail.
Use the -p
flag to create the full path if non-existent.
Use the rmdir
command to remove an empty directory.
Use rm -r
to remove a non-empty directory.
cd
to your home directory.girl/develop
directory path.girl/develop
directory.it
directory.pwd
command to verify you are home.girl/develop/it
path.Use cat
to output the contents of a file to the console.
Use more
to step through the contents of a file one screen at a time.
Use less
to step backwards or forwards.
Explore the /usr/share/misc
files using cat
, more
, and less
Can you find your birth month's stone and flower in the birthtoken
file?
Filenames that begin with a period are hidden from normal output.
e.g. ".bashrc"
Use the ls
command with the -a
flag to see hidden files in addition to the usual output.
Type ls -la
into your terminal.
Use the -h
flag to get human readable file sizes.
Use touch
to create a blank file or update the timestamp on an existing file.
Use rm
to remove files.
The unix security model breaks up file permissions into three groups:
|
|
|
| owner | group | others |
Use chmod
to change permissions on a file/directory
u
, g
, o
to signify which level to target.+
or -
to indicate whether adding or removing.r
, w
, x
to indicate what type of permission to change.chmod u+w
to add write permissions for the file's owner.
chmod go-rwx
to remove all permissions for the file's group and everyone else.
testfile
in your home directory.testfile
from your group and everyone else.testfile
.Most commands display their results to a mechanism called the standard output.
By default, this directs its content to the display.
The standard output can be redirected to a file using the >
operator.
ls > file_list.txt
In order to append to the file instead of overwriting it, use the >>
operator instead.
ls >> file_list.txt
Both the >
and >>
operator will create the file if it doesn't exist.
Whenever commands accept keyboard input, it's likely they are really just drawing input from a mechanism called standard input.
By default, this is set to keyboard input.
The input to a command can be redirected to a file by using the <
operator.
sort < file_list.txt
Both input and output can be redirected at the same time.
sort < file_list.txt > sorted_file_list.txt
The "|" character can be used to allow commands to communicate during execution.
Pipes are placed between commands.
A pipe will cause the output of the left command to be used as the input of the right command.
ls -l | grep "myfile.txt" du | sort -nr
The grep
command outputs only the lines from a file that match a given pattern.
This is useful for doing text searches within a file.
The first argument is the pattern to match. The second, third, and so on are files to search within.
grep "ls" .bash_history
If no file argument is given, it will expect input from the keyboard.
Check out the man pages for the following:
sort
uniq
grep
head
tail
fmt
pr
tr
sed
awk
Use the ls
and grep
commands to print out only the files in your home directory that contain the word "bash".
ls -a | grep bash
Whenever a command is executed, a new process is created.
The top
command provides an up-to-date feed of information on the most active processes across the machine.
Useful for finding processes that are hogging the CPU.
The ps
utility displays all of your processes that have controlling terminals.
Ctrl + Z
: Suspend the current process
Ctrl + C
: Terminate the current process
The bg
and fg
commands bring a suspended process back into a running state.
bg
runs it in a background process.
fg
runs it in the foreground of the current terminal.
By default they target the most recently suspended process.
The job number can be provided as an argument. (The number we saw when we suspended the process)
top
command.The kill
command terminates or sends a signal to a process.
It takes the process id (PID) as an argument.
You can find the PID using top
or ps
.
yes
command.Ctrl+Z
key sequence to suspend the process.bg
command to send the process to the background.Typing !
followed by the name of a command will repeat the last line that began with that command.
ls -la ~ | grep "Desktop"
!ls
In both instances, you should get the same output because the second line is simply repeating the first.
Typing !!
by itself will re-run the last line entered.
The terminal keeps an ongoing log of all the commands you've run.
The history
command prints the contents of the history file.
You can run a previous command using the number in the history.
!12
Almost no one does this.
Ctrl + a
moves the cursor to the beginning of the command.
Ctrl + e
moves the cursor to the end of the command.
Use the tab
key to auto complete file paths
Use the up
arrow to cycle through the command history.
up
and down
arrows to locate a past command with one or more arguments.date
command.!
.time !!
.Here are some examples of using the command line to accomplish tasks relating to development.
python -m simpleHTTPServer
Don't forget: you can Ctrl + C
to exit.
Initialize the current directory as a Git repository. git init .
Commit your file changes. git commit -m "Hello Git!"
Include all changes next time we commit. git add --all
View the commit history. git log
Check out Pro Git for a crash course on command-line git.
tail -f my_awesome.log
For those wanting to go deeper down the rabbit hole, check out these resources.


HOME
COURSES
CONTACT US
SIGN IN
SIGN UP
☰
The place for helping you choosing the right career
Reload page


NOTTING HILL (director: Roger Michell; screenwriter: Richard Curtis; cinematographer: Michael Coulter; editor: Nick Moore; cast: Julia Roberts (Anna Scott), Hugh Grant (William Thacker), Rhys Ifans (Spike), Gina McKee (Bella), Tim McInnerny (Max), Hugh Bonneville (Bernie), James Dreyfus (Martin), Emma Chambers (Honey, Thacker's Sister); Runtime: 123; Universal; 1999-UK)
Reviewed by Dennis Schwartz
The same old romantic comedy formula story that has become a Hollywood trademark is revived here, only this time its formula involves 'Beverly Hills conveniently meeting Notting Hill.' This film asks the question, "Can the most famous film star in the world fall for the man on the street?" Give me a break, who in their right mind is seriously asking that question. The answer lies in the shekels found in the box office over the years, as this trite story line, the romance between opposites and the cute obstacles layed before them, seems to draw its fateful audience ever since Hollywood was a hill that filmmakers put up a lettered sign on.
Anna Scott (Julia Roberts) is a world-famous actress, who unexpectedly meets the proprietor of a small, unprofitable travel bookshop, William Thacker (Grant), and both are bitten by the love bug. She is the sure-fire American, he is the bumbling English man.  Roberts will fill the screen with her innocent and bountiful smile and Grant will exploit that hangdog stereotype look he has cornered the market on, of one who is naturally shy but is persistent. They ape playing themselves as parodies, though who knows what they are really like, which is irrelevant, anyway. What is added to this often tried and tested screen formula, is PG-13 safe humor and a mild story where love blossoms in the way Hollywood wills it to. Think of any Cary Grant screwball comedy vehicle and you will know that this plot has been perfected in a much better way in other films. Unfortunateley this film is not on the same level of Cary's films. Screenwriter Richard Curtis' dull workmanlike script seems to have the knack in getting to Hugh Grant's screen presence, the one that brings the paying audience in, as he previously did for him in "Four Weddings And A Funeral," but can't go further than that. Roger Michell's direction is predictable and lackluster, and the film itself is simply old stuff served again, dried out except for those who still find these superficial stars charming enough to think that this plot is viable again. There is no accounting for taste and who has taste, and no one's taste is better than your own, so if you like the stars then you will probably like the film no matter what.
When superstar Anna comes into humble William's bookstore and gets a book on Turkey, you can guess the direction the rest of the film will travel to. They will meet for real when he accidently spills orange juice on her on Portobello Road and offers to let her clean up in his nearby flat. There are no surprises here, unless you consider her soul kiss of William as she hurriedly leaves to be a surprise. It's a puff piece hiding behind the reality of the Notting Hill location and the quirky humor expected of the British eccentrics who are cast in the film, as either William's friends or as his sister Honey. They pop up all through the story to give the film its kooky British flavor and homey feeling. Seemingly, their main purpose in life is to make sure that William is a happy camper. Reality is blended so finely into the story that it never gets in the way of the fantasy romantic comedy happenings. It does what Hollywood always does, give hope to those in the audience that fantasies can come true. You can bet your fairy tale book collection, that after Hugh Grant will go through all the obligatory obstacle courses required in the formula story, he will prevail and get Julia Roberts.
The highlight of the film, before it overloads itself with its vacuous plot and tacked on sub-plots, has Grant bringing Roberts on a date to meet the ordinary folks he hangs out with, at his sister's birthday party. The comedy unfolds as we watch how gracious the self-absorbed Roberts is to the plebians, even confessing to them about her perpetual diet and that she's a bad actress making $15 million a picture, and we also see how nice and whacky the ordinary Brits are, fawning over the American screenstar. It is her craving for this simpleness, to be away from the spotlight for a brief time, and that Grant didn't make a rush at her, that attracts her toward him. While he's star-struck at first, but finds that even though they are complete opposites and there's little chance of him being with her, his heart is racing when he's with her.
Since Julia is not a blushing innocent in this film, she takes on the role of the one calling the shots, the film will go through all the formula tested tribulations in their relationship, with her looking less attractive to me than looking like she's a hardened woman with an empty soul. But Grant is stuck on her and to get her, he will have to jump through the hoops as they keep running into obstacles. It starts when in order to meet her he has to pretend that he's a magazine writer for Horse and Hound in a crowded room with other magazine writers. When he goes to her hotel room to spill his heart out to her, who should be there but Alex Baldwin, in a cameo role, as her boorish boyfriend from America who popped in on her unexpectedly, as Grant gets humiliated by him when he has to pose as the bellboy. The big mix-up comes when she splits from Grant, after she spends the night at his flat, hiding out from the press after nude pictures from her past surfaced and in the morning his place is surrounded by the media with the paparazzi's flashing cameras pointed at her and him.
The only one in the film that had any fun in him that was sometimes funny, was Grant's slob Welsh flatmate, Spike (Rhys), who spreads his goofiness around like it was manna from heaven, until even his dressed-down comic efforts feel forced. But, without his presence, even if his role was also a stereotype one, this asinine film would have been even more unbearable than it was.
This film was pure and unadulterated balderdash...opium for the masses to get hooked on when they can't face reality. "Notting Hill" takes you to a low point on the movie making hill, where you can step on horseshit and curse out loud or pretend that it is not horseshit or be a man about it and say you fell into it, just like the filmmaker expected you to, and honestly say you like horseshit and don't care what anyone else thinks. This is the kind of film Hollywood makes best...it's so easy to make and the romance is so painless. It ends fittingly in a cliché, as Roberts recites her love ode to Grant, "I'm just a girl, standing in front of a guy, asking him to love her."
REVIEWED ON 11/29/2000 GRADE: C-
Dennis Schwartz: "Ozus' World Movie Reviews"
http://www.sover.net/~ozus
<EMAIL_ADDRESS>© ALL RIGHTS RESERVED DENNIS SCHWARTZ
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Sandesh
Ahmedabad
Surat
Baroda
Rajkot
Divy Bhaskar
Ahmedabad
Surat
Baroda
Rajkot
Gujarat Samachar
Ahmedabad
Surat
Baroda
Rajkot
Dainik Bhaskar
Delhi
Surat
The Indian Express
Times of India
The Economics Times
The Tribune
Subscribe
Log Out
Suggest Us


Your browser doesn't support the FileReader
API! IE 9?
This example shows how to use the
ngeo-filereader
directive to import features from a KML file read from the user's file system.
You can download and use the 2012-02-10.kml file from the OpenLayers examples for testing.