Welcome to the Tweetmap Java 8 Going Reactive Tutorial! This starts with a basic Play Framework application and uses it to build a reactive tweet map.
Within the Activator UI you can:
Once the application has been compiled and the server started, your application can be accessed at: http://localhost:9000
Check in Run to see the server status.
Play Java uses Promises to execute asynchronous tasks in the background. The Promise is the handle to a future result. A callback in the form of a Java Lambda is added to the Promise that gets called when the promise completes. Optionally the recover method can be called with a Java Lambda that is called when the callback fails.
The primary way of adding a callback to a Promise is to add a map method that essentially means map the result of the Promise to a new value. Then when the promise completes the new value is returned as the response.
1. Create a new route that will search Twitter by updatingconf/routes with the following route:
GET /tweets controllers.Tweets.search(query: String)
2. Update app/controllers/Tweets.java to add a reactive request handler (or controller) for /tweets:
/**
* A reactive request is made in Play by returning a Promise of a result. This makes the request asynchronous
* since the server doesn't block waiting for the response. This frees the server thread to handle other requests.
* The callback to the Promise is added as a map, which maps the results to a new value when the Promise completes.
* The results of the Promise in this example are mapped to a result (HTTP 200 OK) that gets returned to the client.
**/
public static Promise<Result> search(String query) {
// part 1 - map the results of the fetch tweets to an ok result by
// calling the ok method on each jsonNode in the returned list of tweets
return fetchTweets(query)
}
/**
* Fetch the latest tweets and return the Promise of the json results.
* This fetches the tweets asynchronously and fulfills the promise when the results are returned.
* The results are first filtered and only returned if the result status was OK.
* Then the results are mapped (or transformed) to JSON.
* Finally a recover is added to the Promise to return an error Json if the tweets couldn't be fetched.
*
* @param query
* @return
*/
public static Promise<JsonNode> fetchTweets(String query) {
Promise<WSResponse> responsePromise = WS.url("http://twitter-search-proxy.herokuapp.com/search/tweets").setQueryParameter("q", query).get();
//part 2 - map the response to json by calling asJson on each response
//can also map using method references - WSResponse::asJson
return responsePromise
.filter(response -> response.getStatus() == Http.Status.OK)
}
/**
* The error response when the twitter search fails.
*
* @param ignored
* @return
*/
public static JsonNode errorResponse(Throwable ignored) {
return Json.newObject().put("error", "Could not fetch the tweets");
}
3. Test it: http://localhost:9000/tweets?query=typesafe
//part 1
return fetchTweets(query)
.map(jsonNode -> ok(jsonNode));
//part 2 - can also map using method references - WSResponse::asJson
return responsePromise
.filter(response -> response.getStatus() == Http.Status.OK)
.map(response -> response.asJson())
.recover(Tweets::errorResponse);
1. The build.sbt file already has dependencies on AngularJS and Bootstrap:
"org.webjars" % "bootstrap" % "3.0.0",
"org.webjars" % "angularjs" % "1.2.16",
2. AngularJS has already been enabled in the main twirl template

3. Add the following to index.js to fetch the tweets:
app.factory('Twitter', function($http, $timeout) {
var twitterService = {
tweets: [],
query: function (query) {
$http({method: 'GET', url: '/tweets', params: {query: query}}).
success(function (data) {
twitterService.tweets = data.statuses;
});
}
};
return twitterService;
});
app.controller('Search', function($scope, $http, $timeout, Twitter) {
$scope.search = function() {
Twitter.query($scope.query);
};
});
app.controller('Tweets', function($scope, $http, $timeout, Twitter) {
$scope.tweets = [];
$scope.$watch(
function() {
return Twitter.tweets;
},
function(tweets) {
$scope.tweets = tweets;
}
);
});
4. Update index.scala.html file:
@(message: String)
@main(message) {

{{tweet.text}}

}
5. Run the app, make a query, and verify the tweets show up: http://localhost:9000
Websockets provide a bi-directional, full-duplex communications channels over a single TCP connection. They are created in Play using a normal route. The difference is the controller returns a WebSocket instead of a Result.
1. Update the body of the app.factory section of index.js replacing the var twitterService = ... with :
var ws = new WebSocket("ws://localhost:9000/ws");
var twitterService = {
tweets: [],
query: function (query) {
ws.send(JSON.stringify({query: query}));
}
};
ws.onmessage = function(event) {
$timeout(function() {
twitterService.tweets = JSON.parse(event.data).statuses;
});
};
return twitterService;
1. Add a route for the websocket connection to the routes file:
GET   /ws controllers.Tweets.ws
2. Add a new controller method to create the Websocket in app/controllers/Tweets.java:
//add this to the import section of the file
import play.mvc.WebSocket;
//add to body of controller
/**
* Create a WebSocket controller that converts the data sent in to JSON.
* This sets up the WebSocket by adding Java Lambdas to the input channel and the on close event.
* The Java Lambda in onMessage will get called whenever a new message comes in through the channel.
* In this example the message is parsed as a json query and then the tweets are fetched based on that query.
* Fetching tweets returns a promise and the callback to that promise (onRedeem) is a Java Lambda that writes
* the results out to the client.
*/
//part 1 - in.onMessage takes a lambda that processes the json from the client.
// Call the following 2 lines on each json message passed in from the websocket:
// String query = jsonNode.findPath("query").textValue();
// fetchTweets(query).onRedeem(.... );
//
//part 2 - fetchTweets(query).onRedeem defines the action to be take when the json is fetched.
// write the list of json out to the client by calling:
// out.write(json)
// on each json node returned from fetch tweets.
public static WebSocket<JsonNode> ws() {
return WebSocket.whenReady((in, out) -> {
in.onMessage(...);
in.onClose(() -> {
});
});
}
To verify tweets are showing up it is useful to use a browser inspector and then look under network for the path ws. Under there look at the frame and verify the requests are being sent. In chrome the network inspector has a bug and the websocket calls are not refreshed unless you tab out and back in.
5. Run the app and verify the tweets show up: http://localhost:9000
return WebSocket.whenReady((in, out) -> {
in.onMessage(jsonNode -> {
String query = jsonNode.findPath("query").textValue();
fetchTweets(query).onRedeem(json -> out.write(json));
});
in.onClose(() -> {
});
});
In the following exercise use Java Optional to set the query and optionally execute code:
optQuery = Optional.of(query);
optQuery.ifPresent(
1. Create a new UserActor.java file in /app/actors containing the following actor:
2. Fill in the missing match blocks to define the behavior of the actor when it recieves different messages.
Use the same behavior to handle json messages that was previously defined in the websocket handler.
package actors;
import akka.actor.*;
import akka.japi.pf.ReceiveBuilder;
import com.fasterxml.jackson.databind.JsonNode;
import controllers.Tweets;
import scala.concurrent.duration.Duration;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
public class UserActor extends AbstractActor {
/**
* The query to search for - empty if a query has not been sent from the user
*/
public Optional<String> optQuery = Optional.empty();
/**
* Creates a new UserActor using these Props.
*
* @param out
* @return
*/
public static Props props(ActorRef out) {
return Props.create(UserActor.class, out);
}
/**
* The out ActorRef is used to write back out to the websocket client
* It is created by Play and set when the UserActor is created.
*/
private final ActorRef out;
/**
* Construct the UserActor and initialize the receive block.
* The receive block defines this actor handles.
*
* @param out
*/
public UserActor(ActorRef out) {
this.out = out;
receive(ReceiveBuilder.
//A json message is from the client so parse it to get the query and fetch the tweets.
match(JsonNode.class, ... ).
//The Update message is sent from the scheduler. When the Actor recieves the
//message fetch the tweets only if there is a query from the user.
match(Update.class, ..... ).
matchAny(o -> System.out.println("received unknown message")).build()
);
}
/**
* Fetch the latest tweets for a given query and send the results to
* the out actor - which in turns sends it back up to the client via a websocket.
*
* @param query
*/
private void runFetchTweets(String query) {
Tweets.fetchTweets(query).onRedeem(json -> {
out.tell(json, self());
});
}
/**
* The Update class is used to send a message to this actor to
* re-run the query and send the results to the client.
*/
public static final class Update {
}
private final ActorSystem system = getContext().system();
//This will schedule to send the Update message
//to this actor after 0ms repeating every 5s. This will cause this actor to search for new tweets every 5 seconds.
Cancellable cancellable = system.scheduler().schedule(Duration.Zero(),
Duration.create(5, TimeUnit.SECONDS), self(), new Update(),
system.dispatcher(), null);
}
receive(ReceiveBuilder.
//A json message is from the client so parse it to get the query and fetch the tweets.
match(JsonNode.class, jsonNode -> {
String query = jsonNode.findPath("query").textValue();
optQuery = Optional.of(query);
runFetchTweets(query);
}).
//The Update message is sent from the scheduler. When the Actor recieves the
//message fetch the tweets only if there is a query from the user.
match(Update.class, update -> optQuery.ifPresent(this::runFetchTweets)).
matchAny(o -> System.out.println("received unknown message")).build()
);
1. Update the WebSocket code to return an Actor in app/controllers/Tweets.java
//add to import section
import actors.UserActor;
//add to body of controller
public static WebSocket<JsonNode> ws() {
//create the UserActor using the static UserActor props method.
//the withActor method passes an out ActorRef that is wired to the
//WebSocket out channel.
//Use this out as the out parameter for UserActor
return WebSocket.withActor( );
}
5. Verify that the websocket is still connecting and tweets are refreshing http://localhost:9000. You might not be able to see the browser up because the tweets don't change. So you will need to look at the inspector.
return WebSocket.withActor(UserActor::props);
1. Update app/controllers/Tweets.java to add geo-coding. Replace the existing fetchTweets method with the one below and add the additional methods.
//Additional imports needed
import java.util.List;
import java.util.Random;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import static java.util.stream.Collectors.toList;
import static utils.Streams.stream;
//Replace the existing fetchTweets
/**
* Fetch the latest tweets and return the Promise of the json results.
* This fetches the tweets asynchronously and fulfills the promise when the results are returned.
* The results are first filtered and only returned if the result status was OK.
* Then the results are mapped (or transformed) to JSON.
* Finally a recover is added to the Promise to return an error Json if the tweets couldn't be fetched.
*
* The updated fetchTweets transforms the responses as it does the mapping to add the geo-coding.
*
* @param query
* @return
*/
public static Promise<JsonNode> fetchTweets(String query) {
Promise<WSResponse> responsePromise = WS.url("http://twitter-search-proxy.herokuapp.com/search/tweets").setQueryParameter("q", query).get();
//can also map using method references - WSResponse::asJson
return responsePromise
.filter(response -> response.getStatus() == Http.Status.OK)
.map(response -> transformStatusResponses(response.asJson()))
.recover(Tweets::errorResponse);
}
/**
* Transform the json responses by adding geo coordinates to each tweet.
* Not sure this is the best way to manipulate the Json. Mostly an experiment
* using streams and json based on reactive stocks activator template.
*
* @param jsonNode
*/
private static JsonNode transformStatusResponses(JsonNode jsonNode) {
//create a stream view of the jsonNode iterator
List<JsonNode> newJsonList = stream(jsonNode.findPath("statuses"))
//map the stream of json to update the values to have the geo-info
.map(json -> setCoordinates((ObjectNode) json))
.collect(toList());
ObjectNode objectNode = JsonNodeFactory.instance.objectNode();
objectNode.putArray("statuses").addAll(newJsonList);
return objectNode;
}
/**
* Most tweets don't actually have their geo-location set so just randomly set the latitude and longitude.
* And sadly there is a bug in the randomizer where the tweets tend to locate themselves near the top of the window.
*
* @param nextStatus
*/
private static ObjectNode setCoordinates(ObjectNode nextStatus) {
nextStatus.putArray("coordinates").add(randomLat()).add(randomLon());
return nextStatus;
}
private static Random rand = new java.util.Random();
private static double randomLat() {
return (rand.nextDouble() * 180) - 90;
}
private static double randomLon() {
return (rand.nextDouble() * 360) - 180;
}
1. The webjar dependency on leaflets has already been added to build.sbt
2. The Leaflet CSS and JS have already been added to main.scala.html file:
<link rel='stylesheet' href='@routes.Assets.versioned("lib/leaflet/leaflet.css")'>

3. Above the
 in index.scala.html add a map:
<leaflet width="100%" height="500px" markers="markers"></leaflet>
4. Update the first line of index.js with:
var app = angular.module('tweetMapApp', ["leaflet-directive"]);
5. Update the body of the app.controller('Tweets' ... section of the index.js file with the following:
$scope.tweets = [];
$scope.markers = [];
$scope.$watch(
function() {
return Twitter.tweets;
},
function(tweets) {
$scope.tweets = tweets;
$scope.markers = tweets.map(function(tweet) {
return {
lng: tweet.coordinates[0],
lat: tweet.coordinates[1],
message: tweet.text,
focus: true
}
});
}
);
8. Go to http://localhost:9000 to see the TweetMap!


RSDTaskViewController
open class RSDTaskViewController: UIViewController, RSDTaskController, UIPageViewControllerDelegate, UIPageViewControllerDataSource, RSDAsyncActionControllerDelegate
RSDTaskViewController
is an implementation of task view controller that is suitable to the iPhone or iPad. To use this view controller, the
-
Undocumented
Declaration
Swift
open weak var delegate: RSDTaskViewControllerDelegate?
-
Undocumented
Declaration
Swift
open func viewController(for step: RSDStep) -> (UIViewController & RSDStepController)
-
Undocumented
Declaration
Swift
open func instantiateViewController(with viewTheme: RSDViewThemeElement) -> (UIViewController & RSDStepController)?
-
Undocumented
Declaration
Swift
open func vendDefaultViewController(for step: RSDStep) -> (UIViewController & RSDStepController)
-
Undocumented
Declaration
Swift
public private(set) var idleTimerDisabled: Bool = false
-
Undocumented
Declaration
Swift
public private(set) var audioSession: AVAudioSession?
-
Undocumented
Declaration
Swift
public func asyncActionController(for configuration: RSDAsyncActionConfiguration) -> RSDAsyncActionController?
-
Undocumented
Declaration
Swift
open func vendDefaultAsyncActionController(for configuration: RSDAsyncActionConfiguration) -> RSDAsyncActionController?
-
Undocumented
Declaration
Swift
open func asyncActionController(_ controller: RSDAsyncActionController, didFailWith error: Error)
-
Undocumented
Declaration
Swift
open var factory: RSDFactory?
-
Undocumented
Declaration
Swift
public var taskPath: RSDTaskPath!
-
Undocumented
Declaration
Swift
public private(set) var currentAsyncControllers: [RSDAsyncActionController] = []
-
Undocumented
Declaration
Swift
public var currentStepController: RSDStepController?
-
Default implementation is to always fetch subtasks.
Declaration
Swift
open func shouldFetchSubtask(for step: RSDTaskInfoStep) -> Bool
-
Default implementation is to always page the section steps.
Declaration
Swift
open func shouldPageSectionSteps(for step: RSDSectionStep) -> Bool
-
Undocumented
Declaration
Swift
open func showLoading(for taskInfo: RSDTaskInfoStep)
-
Undocumented
Declaration
Swift
open func handleFinishedLoading()
-
Undocumented
Declaration
Swift
open func showLoadingView()
-
Undocumented
Declaration
Swift
open func hideLoadingIfNeeded()
-
Undocumented
Declaration
Swift
open func navigate(to step: RSDStep, from previousStep: RSDStep?, direction: RSDStepDirection)
-
Undocumented
Declaration
Swift
open func handleTaskFailure(with error: Error)
-
Undocumented
Declaration
Swift
open func handleTaskCompleted()
-
Undocumented
Declaration
Swift
open func handleTaskCancelled()
-
Undocumented
Declaration
Swift
open func handleTaskResultReady(with taskPath: RSDTaskPath)
-
Undocumented
Declaration
Swift
public func startAsyncActions(with configurations: [RSDAsyncActionConfiguration], completion: @escaping (() -> Void))
-
Undocumented
Declaration
Swift
public func stopAsyncActions(for controllers: [RSDAsyncActionController], completion: @escaping (() -> Void))
-
Undocumented
Declaration
Swift
public func cancelAllAsyncActions()
-
Undocumented
Declaration
Swift
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?)
-
Undocumented
Declaration
Swift
public required init?(coder aDecoder: NSCoder)
-
Undocumented
Declaration
Swift
public init(task: RSDTask)
-
Undocumented
Declaration
Swift
public init(taskInfo: RSDTaskInfoStep)
-
Undocumented
Declaration
Swift
public private(set) var pageViewController: (UIViewController & RSDPageViewControllerProtocol)!
-
This is a work-around to not being able to hook up child view controllers via the storyboard IBOutlet. The method is called in
viewDidLoad
to see if there is already a view controller of the expected type that is included in the storyboard or nib that was used to create this view controller.@return If found, returns a view controller that conforms to
RSDPageViewControllerProtocol
.Declaration
Swift
open func findPageViewController() -> (UIViewController & RSDPageViewControllerProtocol)?
-
This method will add a page view controller in the instance where this view controller was loaded without one. The method is called in
viewDidLoad
iffindPageViewController
returns nil. This method should instantiate a view controller and add it to this view controller as a child view controller.@return A view controller that conforms to
RSDPageViewControllerProtocol
.Declaration
Swift
open func addPageViewController() -> (UIViewController & RSDPageViewControllerProtocol)
-
Undocumented
Declaration
Swift
open override func viewDidLoad()
-
Undocumented
Declaration
Swift
open override func didReceiveMemoryWarning()
-
Undocumented
Declaration
Swift
open override func viewWillAppear(_ animated: Bool)
-
Undocumented
Declaration
Swift
open var currentStepViewController: (UIViewController & RSDStepController)?
-
Respond to a gesture to go back. Always returns
nil
but will callgoBack()
if appropriate.Declaration
Swift
open func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController?
-
Respond to a gesture to go forward. Always returns
nil
but will callgoForward()
if appropriate.Declaration
Swift
open func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController?


{% include 'homepage/subpages/home.html' %}
{% include 'homepage/subpages/dreamSpace.html' %}
{% include 'homepage/subpages/youthTZ.html' %}
{% include 'homepage/subpages/youthUnion.html' %}
{% include 'homepage/subpages/newsCenter.html' %}
{% include 'homepage/subpages/contactUs.html' %}


Menu
Search
Search the NHS website
Search
Close search
Menu
Close menu
Home
Health A-Z
Live Well
Care and support
Health news
Services near you


application
/
net.corda.v5.application.services.persistence
/
PersistenceQueryRequest
/
Builder
/
withPostFilter
withPostFilter
fun
withPostFilter
(
postFilter
:
NamedQueryFilter
)
:
Builder


This file is a test html file that you can use to upload on Amazon S3, while following the instructions on the Alexa Custom Skill Development Course.
You can find more information about the course at vivekk.com


Condition will change the result of the build if the amount of red alerts exceed the predefined value.
Maximum amount of alerts - the maximum allowed amount of red alerts [default 1]
Mark build as - the desired result if the condition is triggered.


{% extends "base.html" %} {% load static %} {% block content %}
| Fundamentals | Show PE, EPS, Dividend Yield, Trading Volume over time |
| Momentum | Show momentum and maximum monthly price trend |
| Stock versus sector | Show how the company performs against the market, sector and breakdown by point scoring rules |


{% extends "layout.html" %} {% block main %}
Some heroes don’t wear capes, and they do come in all shapes and sizes. When it comes to life, we all bleed red. The best gift to give someone, is the gift of life and we can do that by donating blood. Giving blood is a simple thing to do, but it can make a big difference in the lives of others. We provide a platform to the interested donors as well as the hospitals to communicate with each other and help those in need.So, join today and find the hero in you.


A free body diagram shows all the force vectors on a single mass. Typically you label the mass in the center of a box and draw force vectors going away from the box. A free body diagram is often drawn to visualize Newton's second law.
solution
$$\sum F=ma$$ $$-200\,\mathrm{N}+300\,\mathrm{N}+500\,\mathrm{N}=ma$$ $$600\,\mathrm{N}=(2\,\mathrm{kg})a$$ $$300 \mathrm{\tfrac{m}{s^2}}=a$$solution
$$\sum F=ma$$ $$F_{N} + F_{g} = ma$$ $$F_{N} - 0.34 = (0.09)(0)$$ $$F_{N} - 0.34 = 0$$ $$F_{N} = 0.34 \, \mathrm{N}$$solution
solution
$$\sum F=ma$$ $$F_1+F_2=ma$$ $$-833+663 = m(2)$$ $$\frac{-170}{2} = \frac{m(2)}{2}$$ $$-85 \, \mathrm{kg} = m$$A negative mass doesn't make sense. Where did we mess up?
Oh, the acceleration is negative, because it points down.
The Force of gravity
Mass is a measure of an object's inertia. Mass also determines the strength of gravity. Because of gravity all objects are attracted to each other, but we mostly notice the attraction towards the Earth because it is so large and so close.
It's funny, we have a special word just for the direction of gravity, down.
$$F_g=mg $$
\(F_g\) = the force of gravity, weight [N, Newtons, kg m/s²] vector\(m\) = mass [kg]
\(g\) = acceleration of gravity on Earth = 9.8 [m/s²] vector
The force of gravity depends on the mass of the object, but on the surface of the Earth acceleration from gravity is the same for all objects.
So why do feathers fall slower than bricks?
The acceleration of 9.8 m/s² on the surface of the Earth is just an approximation. The gravity of earth changes a bit depending on where you are.
What is the force of gravity in Los Angeles?
Why would the acceleration of gravity seem lower near the equator?
Table: Comparative gravities in various cities around the world
| Location | Acceleration in m/s² | Acceleration in ft/s² |
|---|---|---|
| Amsterdam | 9.813 | 32.19 |
| Athens | 9.800 | 32.15 |
| Auckland | 9.799 | 32.15 |
| Bangkok | 9.783 | 32.1 |
| Brussels | 9.811 | 32.19 |
| Buenos Aires | 9.797 | 32.14 |
| Calcutta | 9.788 | 32.11 |
| Cape Town | 9.796 | 32.14 |
| Chicago | 9.803 | 32.16 |
| Copenhagen | 9.815 | 32.2 |
| Frankfurt | 9.810 | 32.19 |
| Havana | 9.788 | 32.11 |
| Helsinki | 9.819 | 32.21 |
| Istanbul | 9.808 | 32.18 |
| Jakarta | 9.781 | 32.09 |
| Kuwait | 9.793 | 32.13 |
| Lisbon | 9.801 | 32.16 |
| London | 9.812 | 32.19 |
| Los Angeles | 9.796 | 32.14 |
| Madrid | 9.800 | 32.15 |
| Manila | 9.784 | 32.1 |
| Mexico City | 9.779 | 32.08 |
| Montréal | 9.789 | 32.12 |
| New York City | 9.802 | 32.16 |
| Nicosia | 9.797 | 32.14 |
| Oslo | 9.819 | 32.21 |
| Ottawa | 9.806 | 32.17 |
| Paris | 9.809 | 32.18 |
| Rio de Janeiro | 9.788 | 32.11 |
| Rome | 9.803 | 32.16 |
| San Francisco | 9.800 | 32.15 |
| Singapore | 9.781 | 32.09 |
| Skopje | 9.804 | 32.17 |
| Stockholm | 9.818 | 32.21 |
| Sydney | 9.797 | 32.14 |
| Taipei | 9.790 | 32.12 |
| Tokyo | 9.798 | 32.15 |
| Vancouver | 9.809 | 32.18 |
| Washington, D.C. | 9.801 | 32.16 |
| Wellington | 9.803 | 32.16 |
| Zurich | 9.807 | 32.18 |
solution
$$F_g=mg$$ $$F_g=(0.44 \, \mathrm{kg} )(9.8\, \mathrm{\tfrac{m}{s^2}})$$ $$F_g=4.3 \, \mathrm{N}$$solution
$$F_g=mg$$ $$\frac{F_g}{g}=m$$ $$\frac{1.8 \,\mathrm{N}}{9.8\, \mathrm{\tfrac{m}{s^2}}}=m$$ $$0.18 \, \mathrm{kg}=m$$Weight and Mass
Another word for the force of gravity is weight. An object on the moon would weigh less than it does on Earth because of the lower gravity, but it would still have the same mass.
Earth's gravity does extend into space, but it decreases with distance. It is about ~90% for astronauts in orbit around the earth, but they don't notice any gravity because they are in a freefall.
Freefall means that you are just letting gravity accelerate you without any opposing forces. To keep from falling we are careful to always counter the force of gravity. This can be done with a parachute or a jetpack! Mostly we counter gravity with a normal force from the ground.
solution
The mass doesn't change as an object falls.
Weight just means force of gravity, which also doesn't change in a short freefall
$$F_{g}=mg$$ $$F_{g}=(0.34)(9.8)$$ $$F_{g}=3.33 \, \mathrm{N}$$solution
-
$$\text{weight on the earth}$$ $$F_{g}=mg$$ $$F_{g}=0.95(9.8)$$ $$F_{g}=9.31 \, \mathrm{N}$$
-
$$\text{weight on the moon}$$ $$F_{g}=ma$$ $$F_{g}=0.95(1.6)$$ $$F_{g}=1.52 \, \mathrm{N}$$
Weight changes on different planets, but mass doesn't change.
What is the mass in kilograms of the book on Earth? On Mars?
solution
$$\text{mass is the same everywhere}$$ $$ 1.2\mathrm{lbs} \frac{1\mathrm{kg}}{2.2\mathrm{lbs}} = 0. \overline{54}\mathrm{kg} $$ $$ m = 0. \overline{54} \, \mathrm{kg} $$What is the weight of the book in Newtons on Earth (a = 9.8 m/s²)?
On Mars (a = 3.711 m/s²)?
solution
-
$$\text{weight on Earth}$$ $$F_{g}=mg$$ $$F_{g}=(0.\overline{54})(9.8)$$ $$F_{g}=5.35\, \mathrm{N}$$
-
$$\text{weight on Mars}$$ $$F_{g}=ma$$ $$F_{g}=(0.\overline{54})(3.711)$$ $$F_{g}=2.02\, \mathrm{N}$$
The Normal Force
A normal force occurs when two objects are in contact. It is perpendicular to the point of contact.
Typically a normal force will balance the force of gravity to keep an object from accelerating up or down.
solution
-
$$F_{g}=mg$$ $$F_{g}=(100)(-9.8)$$ $$F_{g}=-980\, \mathrm{N}$$
$$\sum F=ma$$ $$F_{g}+F_{N}=ma$$ $$F_{N}=ma-F_{g}$$ $$F_{N}=(100)(2)-(-980)$$ $$F_{N}=1180\, \mathrm{N}$$ -
solution
-
$$F_{g}=mg$$ $$F_{g}=(20)(9.8)$$ $$F_{g}=196\, \mathrm{N}$$
$$\sum F=ma$$ $$-F_{g}+F_{N}=ma$$ $$F_{N}=ma+F_{g}$$ $$F_{N}=(20)(0) + 196$$ $$F_{N}=196 \, \mathrm{N}$$ -
In the simple case of a flat horizontal surface with no vertical acceleration the force of gravity will always be equal and opposite to the normal force.
solution
-
$$F_{g}=mg$$ $$F_{g}=(20)(9.8)$$ $$F_{g}=196 \, \mathrm{N}$$
-
Separate the gravity vector into components parallel and perpendicular to the ground. Acceleration is zero in the perpendicular direction.
-
$$\text{perpendicular to ground}$$
$$F_{g\perp}=F_{g}\cos(20)$$ $$F_{g\perp}=(196)\cos(20)$$ $$F_{g\perp}=184 \, \mathrm{N}$$
$$\sum F_{\perp}=ma$$ $$-F_{g\perp}+F_{N}=ma$$ $$F_{N}=ma+F_{g\perp}$$ $$F_{N}=(20)(0) + 184$$ $$F_{N}=184 \, \mathrm{N}$$
-
$$\text{parallel to ground}$$
$$F_{g\parallel}=F_{g}\sin(20)$$ $$F_{g\parallel}=(196)\sin(20)$$ $$F_{g\parallel}=67 \, \mathrm{N}$$
$$\sum F_{\parallel}=ma$$ $$F_{g\parallel}=ma$$ $$(67)=(20)a$$ $$3.35 \, \mathrm{\tfrac{m}{s^{2}}}= a$$
Tension Forces
Tension is the pulling force from a string or rope. Ropes are useful for transferring a force over a distance. If you wanted to apply a force on your dog while going for a walk you could use the tension on the leash to transfer that force.solution
$$a = 0.023 \, \mathrm{\tfrac{m}{s^{2}}}$$ $$m = 0.5\, \mathrm{g} = 0.0005 \, \mathrm{kg}$$$$\sum F=ma$$ $$-F_{g} + F_{\mathrm{Ten}} = ma$$ $$F_{\mathrm{Ten}} = ma + F_{g}$$ $$F_{\mathrm{Ten}} = ma + mg$$ $$F_{\mathrm{Ten}} = (0.0005)(0.023) + (0.0005) (9.8)$$ $$F_{\mathrm{Ten}} = 0.0049115\, \mathrm{N}$$
solution
The tension force is equal and opposite for the person and crate.
$$\text{crate}$$ $$\sum F=ma$$ $$F_\mathrm{Ten} = 10 (-0.1)$$ $$F_\mathrm{Ten} = -1 \, \mathrm{N}$$$$\text{person}$$ $$\sum F=ma$$ $$F_{\mathrm{person}} + F_{\mathrm{Ten}} = ma$$ $$F_{\mathrm{person}} + 1 = (100)(-0.1)$$ $$F_{\mathrm{person}} + 1 = -10$$ $$F_{\mathrm{person}} = -11\,\mathrm{N}$$
solution
$$\text{dog: horizontal}$$ $$\sum F=ma$$ $$-F_{tx} + F_{\mathrm{dog}} = 0$$ $$-F_{tx} + 100 = 0$$ $$F_{tx} = 100 \, \mathrm{N}$$The 100 N is only the x-part of the tension force vector. We can find the total tension force with the Pythagorean theorem. At 45° the x and y parts of the force are the same.
$$F_\mathrm{tension}^2 = 100^2+100^2$$ $$F_\mathrm{tension}^2 = 20000$$ $$F_\mathrm{tension} = 141 \, \mathrm{N}$$


06-Sep-2017 | Milku
The last stragglers have returned to school and work.
Although I though the new school term started on Tuesday, that was only for my little humans who attend primary school. The slightly bigger one had an extra day off. But today, my humans have all vacated the house, if only for a few hours of studying and work. I have the run of the place. I can do what I want. I think I'll have a nap...
I could, of course, read a book because it is Read a Book Day. Don't tell the little humans. They'll think they have to read a whole book and they'll never go to bed. For some of my humans, every day is for reading books. They never have their noses out of books or away from their Kindles. If it keeps them away from me, I'm all in favour.
My little humans have been busy putting the finishing touches to their clay creations...I told you they'd get all arty after visiting Salts Mill and seeing the Hockney artworks. They all made some models and have just finished painting them.
I especially like the unicorn...beautiful eyes...just like me...

But I don't know who they used as a model for that face...their Dad wasn't home as I recall...


{{weather.current.description}}
{{'Today' | wlNgWLocale:lang}}
{{weather.today.temperatureMax | wlNgWTemp:mu.temperature}}°
{{weather.today.temperatureMin | wlNgWTemp:mu.temperature}}°
{{weather.today.description}}
{{'Tomorrow' | wlNgWLocale:lang}}
{{weather.tomorrow.temperatureMax | wlNgWTemp:mu.temperature}}°
{{weather.tomorrow.temperatureMin | wlNgWTemp:mu.temperature}}°
{{weather.tomorrow.description}}


Lacey Rice
Front End Developer
Wishcastr.com
A site that allows you to search for products, save them to a wish, set a price threshold, and receive an email when your price is reached
Tech used: AngularJS, HTML5, Sass, Ruby on Rails 5
What I did: Designed the site, structured it using HTML5, styled it using Sass, and used AngularJS to access the Amazon API through a Ruby hosted API
Stackundertow
A webapp based on Stack Overflow, where you can ask a question, answer other's questions, and up or down vote answers
Tech used: AngularJS, jQuery, HTML5, Sass, Ruby on Rails
What I did: Using AngularJS I accessed the Ruby API in order to create users, create sessions, post questions and answers, and keep track of votes
Jal-Stats
A mobile app for tracking activities
Tech used: AngularJS, jQuery, HTML5, Sass, Python, Django
What I did: I designed this site with a mobile first view. Using AngularJS I accessed the Django API in order to POST and GET data
Chessboard
A webapp that demonstrates the moves to the Catalan Opening in Chess
Tech used: JavaScript, jQuery, HTML5, Sass
What I did: Designed the board using HTML5 and Sass, used JavaScript to make functions for moving the chesspieces on the board, and used jQuery to apply the functions when the appropriate button is clicked
Check back soon for more projects
About me
I am a nurse turned developer on the quest to learn everything I can about coding. In September I put my life on hold to immerse myself in a 12-week Front End Engineering course at The Iron Yard Durham. I graduated November 20th with an addiction to programming and caffeine.


freeCodeCamp Tic-Tac-Toe
Hey, how are you doing today? Hope all is fine. You are most welcome to play the unbeatable tic-tac-toe. Are you ready to start the game?
Yes. I'm good to go.
Reset Board


{% if internal_billing_document %}
Internal Billing Document
{% endif %}
Issuing Facility: {{shipment.from_location}} Issued to: {{shipment.to_location}}
Date of issue: {{shipment.date|date:"D d M Y" }}
{% if shipment.shipment_id %}
Supplier id: {{shipment.shipment_id}}
{% else %}
System Delivery note number: {{shipment.name}}.{{forloop.counter}}
{% endif %}
{% if shipment.supplier %}
Supplier: {{shipment.supplier}}
{% endif %}
{% if shipment.supplier_shipment_id %} Supplier Delivery note number: {{shipment.supplier_shipment_id}}{% endif %}
Total Price (ZAR): {{shipment.price|floatformat:"2"}}
|
Item Name |
Expiration |
Lot Num |
Qty Issued |
Qty Received |
{% if shipment.to_location.location_type != 'P' %}
Unit Price |
Total Price |
{% endif%}
{% for item in shipment_list %}
| {{forloop.counter}} |
{{item.itemlot.item.name}}
|
{{item.itemlot.expiration|date:"d/m/y"}} |
{{item.itemlot.lot_num}} |
{{item.qty}} |
|
{% if shipment.to_location.location_type != 'P' %}
{{item.itemlot.unit_price|floatformat:"2"}} |
{{item.price|floatformat:"2"}} |
{% endif%}
{% endfor %}
Issued By:
Name: _____________________________
Date: _____________________________
Signature: _____________________________
Received By:
Name: _____________________________
Date: _____________________________
Signature: _____________________________
{% endfor %}


"""Gaussian process-based minimization algorithms."""
import numpy as np
from sklearn.utils import check_random_state
from .base import base_minimize
from ..utils import cook_estimator
from ..utils import normalize_dimensions
[docs]def gp_minimize(func, dimensions, base_estimator=None,
n_calls=100, n_random_starts=None,
n_initial_points=10,
initial_point_generator="random",
acq_func="gp_hedge", acq_optimizer="auto", x0=None, y0=None,
random_state=None, verbose=False, callback=None,
n_points=10000, n_restarts_optimizer=5, xi=0.01, kappa=1.96,
noise="gaussian", n_jobs=1, model_queue_size=None):
"""Bayesian optimization using Gaussian Processes.
If every function evaluation is expensive, for instance
when the parameters are the hyperparameters of a neural network
and the function evaluation is the mean cross-validation score across
ten folds, optimizing the hyperparameters by standard optimization
routines would take for ever!
The idea is to approximate the function using a Gaussian process.
In other words the function values are assumed to follow a multivariate
gaussian. The covariance of the function values are given by a
GP kernel between the parameters. Then a smart choice to choose the
next parameter to evaluate can be made by the acquisition function
over the Gaussian prior which is much quicker to evaluate.
The total number of evaluations, `n_calls`, are performed like the
following. If `x0` is provided but not `y0`, then the elements of `x0`
are first evaluated, followed by `n_initial_points` evaluations.
Finally, `n_calls - len(x0) - n_initial_points` evaluations are
made guided by the surrogate model. If `x0` and `y0` are both
provided then `n_initial_points` evaluations are first made then
`n_calls - n_initial_points` subsequent evaluations are made
guided by the surrogate model.
The first `n_initial_points` are generated by the
`initial_point_generator`.
Parameters
----------
func : callable
Function to minimize. Should take a single list of parameters
and return the objective value.
If you have a search-space where all dimensions have names,
then you can use :func:`skopt.utils.use_named_args` as a decorator
on your objective function, in order to call it directly
with the named arguments. See `use_named_args` for an example.
dimensions : [list, shape (n_dims,)
List of search space dimensions.
Each search dimension can be defined either as
- a `(lower_bound, upper_bound)` tuple (for `Real` or `Integer`
dimensions),
- a `(lower_bound, upper_bound, "prior")` tuple (for `Real`
dimensions),
- as a list of categories (for `Categorical` dimensions), or
- an instance of a `Dimension` object (`Real`, `Integer` or
`Categorical`).
.. note:: The upper and lower bounds are inclusive for `Integer`
dimensions.
base_estimator : a Gaussian process estimator
The Gaussian process estimator to use for optimization.
By default, a Matern kernel is used with the following
hyperparameters tuned.
- All the length scales of the Matern kernel.
- The covariance amplitude that each element is multiplied with.
- Noise that is added to the matern kernel. The noise is assumed
to be iid gaussian.
n_calls : int, default: 100
Number of calls to `func`.
n_random_starts : int, default: None
Number of evaluations of `func` with random points before
approximating it with `base_estimator`.
.. deprecated:: 0.8
use `n_initial_points` instead.
n_initial_points : int, default: 10
Number of evaluations of `func` with initialization points
before approximating it with `base_estimator`. Initial point
generator can be changed by setting `initial_point_generator`.
initial_point_generator : str, InitialPointGenerator instance, \
default: 'random'
Sets a initial points generator. Can be either
- `"random"` for uniform random numbers,
- `"sobol"` for a Sobol sequence,
- `"halton"` for a Halton sequence,
- `"hammersly"` for a Hammersly sequence,
- `"lhs"` for a latin hypercube sequence,
acq_func : string, default: `"gp_hedge"`
Function to minimize over the gaussian prior. Can be either
- `"LCB"` for lower confidence bound.
- `"EI"` for negative expected improvement.
- `"PI"` for negative probability of improvement.
- `"gp_hedge"` Probabilistically choose one of the above three
acquisition functions at every iteration. The weightage
given to these gains can be set by :math:`\\eta` through
`acq_func_kwargs`.
- The gains `g_i` are initialized to zero.
- At every iteration,
- Each acquisition function is optimised independently to
propose an candidate point `X_i`.
- Out of all these candidate points, the next point `X_best` is
chosen by :math:`softmax(\\eta g_i)`
- After fitting the surrogate model with `(X_best, y_best)`,
the gains are updated such that :math:`g_i -= \\mu(X_i)`
- `"EIps"` for negated expected improvement per second to take into
account the function compute time. Then, the objective function is
assumed to return two values, the first being the objective value and
the second being the time taken in seconds.
- `"PIps"` for negated probability of improvement per second. The
return type of the objective function is assumed to be similar to
that of `"EIps"`
acq_optimizer : string, `"sampling"` or `"lbfgs"`, default: `"lbfgs"`
Method to minimize the acquisition function. The fit model
is updated with the optimal value obtained by optimizing `acq_func`
with `acq_optimizer`.
The `acq_func` is computed at `n_points` sampled randomly.
- If set to `"auto"`, then `acq_optimizer` is configured on the
basis of the space searched over.
If the space is Categorical then this is set to be `"sampling"`.
- If set to `"sampling"`, then the point among these `n_points`
where the `acq_func` is minimum is the next candidate minimum.
- If set to `"lbfgs"`, then
- The `n_restarts_optimizer` no. of points which the acquisition
function is least are taken as start points.
- `"lbfgs"` is run for 20 iterations with these points as initial
points to find local minima.
- The optimal of these local minima is used to update the prior.
x0 : list, list of lists or `None`
Initial input points.
- If it is a list of lists, use it as a list of input points.
- If it is a list, use it as a single initial input point.
- If it is `None`, no initial input points are used.
y0 : list, scalar or `None`
Evaluation of initial input points.
- If it is a list, then it corresponds to evaluations of the function
at each element of `x0` : the i-th element of `y0` corresponds
to the function evaluated at the i-th element of `x0`.
- If it is a scalar, then it corresponds to the evaluation of the
function at `x0`.
- If it is None and `x0` is provided, then the function is evaluated
at each element of `x0`.
random_state : int, RandomState instance, or None (default)
Set random state to something other than None for reproducible
results.
verbose : boolean, default: False
Control the verbosity. It is advised to set the verbosity to True
for long optimization runs.
callback : callable, list of callables, optional
If callable then `callback(res)` is called after each call to `func`.
If list of callables, then each callable in the list is called.
n_points : int, default: 10000
Number of points to sample to determine the next "best" point.
Useless if acq_optimizer is set to `"lbfgs"`.
n_restarts_optimizer : int, default: 5
The number of restarts of the optimizer when `acq_optimizer`
is `"lbfgs"`.
kappa : float, default: 1.96
Controls how much of the variance in the predicted values should be
taken into account. If set to be very high, then we are favouring
exploration over exploitation and vice versa.
Used when the acquisition is `"LCB"`.
xi : float, default: 0.01
Controls how much improvement one wants over the previous best
values. Used when the acquisition is either `"EI"` or `"PI"`.
noise : float, default: "gaussian"
- Use noise="gaussian" if the objective returns noisy observations.
The noise of each observation is assumed to be iid with
mean zero and a fixed variance.
- If the variance is known before-hand, this can be set directly
to the variance of the noise.
- Set this to a value close to zero (1e-10) if the function is
noise-free. Setting to zero might cause stability issues.
n_jobs : int, default: 1
Number of cores to run in parallel while running the lbfgs
optimizations over the acquisition function. Valid only
when `acq_optimizer` is set to `"lbfgs"`.
Defaults to 1 core. If `n_jobs=-1`, then number of jobs is set
to number of cores.
model_queue_size : int or None, default: None
Keeps list of models only as long as the argument given. In the
case of None, the list has no capped length.
Returns
-------
res : `OptimizeResult`, scipy object
The optimization result returned as a OptimizeResult object.
Important attributes are:
- `x` [list]: location of the minimum.
- `fun` [float]: function value at the minimum.
- `models`: surrogate models used for each iteration.
- `x_iters` [list of lists]: location of function evaluation for each
iteration.
- `func_vals` [array]: function value for each iteration.
- `space` [Space]: the optimization space.
- `specs` [dict]`: the call specifications.
- `rng` [RandomState instance]: State of the random state
at the end of minimization.
For more details related to the OptimizeResult object, refer
http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.OptimizeResult.html
.. seealso:: functions :class:`skopt.forest_minimize`,
:class:`skopt.dummy_minimize`, :class:`skopt.gbrt_minimize`
"""
# Check params
rng = check_random_state(random_state)
space = normalize_dimensions(dimensions)
if base_estimator is None:
base_estimator = cook_estimator(
"GP", space=space, random_state=rng.randint(0, np.iinfo(np.int32).max),
noise=noise)
return base_minimize(
func, space, base_estimator=base_estimator,
acq_func=acq_func,
xi=xi, kappa=kappa, acq_optimizer=acq_optimizer, n_calls=n_calls,
n_points=n_points, n_random_starts=n_random_starts,
n_initial_points=n_initial_points,
initial_point_generator=initial_point_generator,
n_restarts_optimizer=n_restarts_optimizer,
x0=x0, y0=y0, random_state=rng, verbose=verbose,
callback=callback, n_jobs=n_jobs, model_queue_size=model_queue_size)


Jun Li
Etiam posuere hendrerit arcu, ac blandit nulla. Sed congue malesuada nibh, a varius odio vehicula aliquet. Aliquam consequat, nunc quis sollicitudin aliquet, enim magna cursus auctor lacinia nunc ex blandit augue. Ut vitae neque fermentum, luctus elit fermentum, porta augue. Nullam ultricies, turpis at fermentum iaculis, nunc justo dictum dui, non aliquet erat nibh non ex.
Sed congue malesuada nibh, a varius odio vehicula aliquet. Aliquam consequat, nunc quis sollicitudin aliquet, enim magna cursus auctor lacinia nunc ex blandit augue. Ut vitae neque fermentum, luctus elit fermentum, porta augue. Nullam ultricies, turpis at fermentum iaculis, nunc justo dictum dui, non aliquet erat nibh non ex. Sed sollicitudin bibendum ultricies. Vivamus tristique justo lacinia dui tempus consequat. Integer tristique eu nisi nec fermentum. Ut malesuada quis massa at ultricies. Donec gravida ipsum in augue volutpat laoreet. Ut lobortis turpis sit amet sodales ultrices.
Learn MoreUpcoming...
| 01/11/2018 | Invited speaker at the first workshop on Fact Extraction and Verification (FEVER) at EMNLP 2018 in Brussels, Belgium. |
News
| 05/09/2018 | Our paper on e-SNLI: Natural Language Inference with Natural Language Explanations got accepted at NIPS 2018 in Montreal, Canada! |
| 20/08/2018 | I am now a Research Scientist at Facebook AI Research London. |
| 13/08/2018 | I am now a Lecturer in the Department of Computer Science at University College London. |
| 10/08/2018 | Our paper on Interpretation of Natural Language Rules in Conversational Machine Reading got accepted at EMNLP 2018 in Brussels, Belgium! |
| 14/07/2018 | I co-organized the 2nd Workshop on Neural Abstract Machines & Program Induction (NAMPI) at ICML 2018 in Stockholm, Sweden. |
| 30/05/2018 | Invited talk on AI - The Good, the Bad, and the Ugly at the Saïd Business School's Oxford Disruptive Tech Week at the University of Oxford, UK. |
| 11/05/2018 | Our paper on DiCE: The Infinitely Differentiable Monte Carlo Estimator got accepted at ICML 2018 in Stockholm, Sweden! |
| 30/04/2018 | I published a blog post on Einstein Summation (einsum) in Deep Learning. |
| 27/03/2018 | Invited talk on Deep Learning with Explanations at the Adaptive Preparation of Information from Heterogeneous Sources (AIPHES) research training group at TU Darmstadt, Germany. |
| 02/03/2018 | Invited talk on Deep Learning with Explanations at the Structured and Probabilistic Intelligent Knowledge Engineering (SPIKE) group at Imperial College London, UK. |
| 15/02/2018 | Preprint of our paper DiCE: The Infinitely Differentiable Monte-Carlo Estimator is online! |
| 29/01/2018 | Our paper on TreeQN and ATreeC: Differentiable Tree Planning for Deep Reinforcement Learning got accepted at ICLR 2018 in Vancouver, Canada! |
| 12/01/2018 | Invited speaker at the Alan Turing Institute workshop on Logic and Learning in London, UK. |
| 08/12/2017 | I co-organized the 6th NIPS 2017 Workshop on Automated Knowledge Base Construction (AKBC). |
| 01/11/2017 | Preprint of our paper TreeQN and ATreeC: Differentiable Tree Planning for Deep Reinforcement Learning is online! |
| 16/10/2017 | I am now a Junior Research Fellow in Computer Science at Jesus College, University of Oxford! |
| 12/10/2017 | Invited speaker at the GPU Techonlogy Conference (GTC Europe) in Munich, Germany. |
| 01/10/2017 | I am now a Stipendiary Lecturer in Computer Science at Hertford College, University of Oxford! |
| 27/09/2017 | I gave a lecture on Deep Learning for Natural Language Processing at the 2nd International Summer School on Data Science (SSDS). Slides available here. |
| 04/09/2017 | Our paper on End-to-end Differentiable Proving got accepted for oral presentation (1.2% acceptance rate) at NIPS 2017 in Long Beach, CA! |
| 29/08/2017 | Invited talk on End-to-end Differentiable Proving at Google Research in Mountain View, CA. |
| 15/08/2017 | I co-organized the 7th Workshop on Statistical Relational AI (StarAI) at UAI 2017 in Sydney, Australia. |
| 26/07/2017 | Invited talk on End-to-end Differentiable Proving at DeepMind. |
News Archive
研究方向
Cras sagittis turpis sit amet est tempus, sit amet consectetur purus tincidunt.
Sed congue elit malesuada nibh, a varius odio vehicula aliquet. Aliquam consequat, nunc quis sollicitudin aliquet.
Learn MoreSed congue elit malesuada nibh, a varius odio vehicula aliquet. Aliquam consequat, nunc quis sollicitudin aliquet.
Learn MoreSed congue elit malesuada nibh, a varius odio vehicula aliquet. Aliquam consequat, nunc quis sollicitudin aliquet.
Learn More


RAPHAEL CHERNEY
engineering design
Home
About Me
Projects
Professional
Contact
Through the years...
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
survived Y2K
1999
1998
1997
1996
back in the USA
1995
lived in Switzerland
1994
1993
1992
busy being a cute, little kid
1991
1990
1989
1988
born on December 28


Clients & users limited
per month
Here you can view all the clients who tried to chat with you.
Go!
Here you can view all the conversations started and ended with your clients.


COMMITTEES
The Prairie Fields HOA has a number of committees to assist in exploring issues, running an annual election, hosting neighborhood events, and more. Click on the name of each committee below for more information, or send an email to<EMAIL_ADDRESS>to volunteer on a committee.
Architectural Control Committee
The goal of the Architectural Control committee is to preserve the property values of all homeowners in Prairie Fields, and to ensure compliance with applicable covenants when a homeowner makes changes to their property.
Communications Committee
The Communications Committee is responsible for facilitating communications with residents of Prairie Fields, including an Annual Newsletter, maintaining this website and a facebook group, and sending monthly email updates.
Election Committee
The Election Committee is responsible for running an annual election of the homeowners within Prairie Fields.


METLIFE SNOOPY C.A.R.E.S COMMITTEE
DENVER, COLORADO: FEBRUARY 2015- PRESENT
THE 3 POINT FOUNDATION
ROXBURY, MASSACHUSETTS: SEPTEMBER 2013- JANRUARY 2015
A BETTER CHANCE
AMHERST, MASSACHUSETTS: NOVEMBER- JANRUARY 2010-2012


clara buenocardio
wrote5 ways google Analytic helps web deveoppers in UI/UX Design
- User Experience
- Ui Design
- Analytics
5 ways google Analytic helps web deveoppers in UI/UX Design
5 ways google Analytic helps web deveoppers in UI/UX Design
5 ways google Analytic helps web deveoppers in UI/UX Design
5 ways google Analytic helps web deveoppers in UI/UX Design
by carry webstar
Intuitive design” is one of those overused phrases that we as designers hear all too often from stakeholders and their requirements. This article explores what intuitive design actually means, why it doesn’t make sense, how we can bette
by saskia freeke
Intuitive design” is one of those overused phrases that we as designers hear all too often from stakeholders and their requirements. This article explores what intuitive design actually means, why it doesn’t make sense, how we can bette
by Liam griffin
Intuitive design” is one of those overused phrases that we as designers hear all too often from stakeholders and their requirements. This article explores what intuitive design actually means, why it doesn’t make sense, how we can bette
Our friends and supporters
Earn recurring revenue designing and developing e-commerce
by carry webstar
Intuitive design” is one of those overused phrases that we as designers hear all too often from stakeholders and their requirements. This article explores what intuitive design actually means, why it doesn’t make sense, how we can bette
by saskia freeke
Intuitive design” is one of those overused phrases that we as designers hear all too often from stakeholders and their requirements. This article explores what intuitive design actually means, why it doesn’t make sense, how we can bette
by Liam griffin
Intuitive design” is one of those overused phrases that we as designers hear all too often from stakeholders and their requirements. This article explores what intuitive design actually means, why it doesn’t make sense, how we can bette
Manuel Matuzović is a front-end developer and consultant with a passion for accessibility, progressive enhancement, performance, and web standards. He works for the City of Vienna, where he’s responsible for the front end of wien.gv.at. Manuel loves learning new things and shares his knowledge as an author, speaker, and teacher. To bring together the local web community in Vienna, he co-organizes the Webclerks meetup. Thank you for sharing and caring, dear Manuel!
Meet Design Systems, a recent Smashing book in which Alla Kholmatova explores how to set up an effective design system to create great digital products. With common traps, gotchas and lessons learned.
React, Vue, or perhaps the lightweight Alpine.js? Whether you are an experienced JavaScript developer working with one of these frameworks, or just starting to learn, our authors have created some tutorials for you.
React, Vue, or perhaps the lightweight Alpine.js? Whether you are an experienced JavaScript developer working with one of these frameworks, or just starting to learn, our authors have created some tutorials for you.
React, Vue, or perhaps the lightweight Alpine.js? Whether you are an experienced JavaScript developer working with one of these frameworks, or just starting to learn, our authors have created some tutorials for you.
React, Vue, or perhaps the lightweight Alpine.js? Whether you are an experienced JavaScript developer working with one of these frameworks, or just starting to learn, our authors have created some tutorials for you.


Activable
Declarative UI components — 2K, 0 dependency, IE8 compatible
Declarative Conventions
The Basics
An activable component is formed once an element is marked with the data-activable
attribute.
Specific descendants of this element will be given the active
class when clicked, with a behavior similar to radio or checkbox inputs.
@data-activable
is used to make all

children of an

activable. The value of this attribute indicates the exact behavior of the component:"1"
stands for "1 and always 1 is active" and means that when one item is.active
the other items of the same list lose this class (default value)."01"
stands for "0 or 1 is active" and has the same behavior as `"1"`, but the currently active item can be desactivated."T"
stands for "0 or 1 is temporarily active" and has the same behavior as `"01"`, but active items are desactivated on the next click on the document."0X"
stands for "0 or X are active" and means that items are toggled without affecting other items of the same group.
.active
should be targeted in CSS to render the elements of an activable components according to their state.
Delegation
The principle of using @data-activable
on an

to make all of
its children items activable can be extended to any markup using a
data-delegate="<selector>"
attribute.
To select activable elements amongst direct children of the element bearing this attribute,
prefix your selector with >
, example: >.cell
will turn all
direct children of this element with the class cell
into activable elements.
Triggers
It is possible to restrict the click-sensitive area of an activable element by
specifying a unique trigger using a data-trigger="<selector>"
attribute.
To select the trigger amongst direct children of the activable element,
prefix your selector with >
,
example: >:first-child
will turn the very first child of activable elements into triggers.
Internal Relations
A common pattern is to have the state of an element be reflected on another one (in a tab component, the labels are in an activable

and the content is in a different wrapper, but clicking a label makes the appropriate content active). This relation can be expressed by an internal link if either the activable element is an anchor or if it defines an anchor as its trigger.
JS API
Basic Methods
Activable( selector )
&A()
alias-
The JS API of Activable is similar to jQuery's one: all methods of the API are executed on a DOM element previously retrieved by passing a CSS selector to the basic
Activable()
orA()
methods. It's also possible to pass a DOM element instead of the selector.Since Activable only aims for compatibility with IE8 and better browsers, it assumes that
document.querySelector()
is available and these basic methods are just shorthands for querying the DOM from the document root.Notable differences with jQuery's API:
- the basic methods don't search for all elements matching the selector but only the first one,
- the methods of the API are not chainable,
- to maintain compatibility with IE8, only CSS2.1 selectors should be used, and jQuery specific selectors such as
:first, :last or :eq()
should never be used. There is a helpful list of CSS2.1 (IE8 and better browsers) and CSS3 (IE9 and better browsers) selectors available on quircksmode.
Event Listeners
Every time an element is activated or deactivated, the corresponding event fires on that element and bubbles up in the DOM tree. It is possible to listen to those events using the following methods.
.on( type, callback )
-
This method adds, on any DOM element, an event listener that will execute the
callback
when an internal event fires. The twotype
s of internal events are"activate"
and"deactivate"
, they fire after an activable elements changed state and bubble up in the DOM tree.Anatomy of a callback:
function( event, related ) { this }
event
is the original click event that changed the state of the activable element,related
is the "related target", if an internal relation was defined for this activable element,this
, the context of the callback, is the activable DOM element that just changed state.
.toggle( activateCallback, deactivateCallback )
-
This method can be used as a shorthand to add an event listener for both event types at the same time.
.off( type, [callback] )
-
This method removes a previously added event listener from a DOM element. It's possible to remove a specific event listener by providing its
type
as well as the registeredcallback
, or to remove all listeners of a certaintype
by omitting thecallback
parameter.
Direct Modifiers
.activate()
-
If the element isn't already active, this method gives it the
active
class and fires an internalactivate
event. If the behavior of the component is"1"
or"01"
, other elements of the same group are deactivated. .deactivate()
-
If the element is active and if the behavior of the component is
"01"
or"0X"
, this method removes theactive
class and fires an internaldeactivate
event. .toggle()
-
.activate()
an inactive element or.deactivate()
an active element.
Iterative Modifiers
These methods work on activable lists only and are particularily useful to create carousels (or cycle) components.
Note that you can use the selector .active ~ li
to differentiate the previous sibling items from the following one.
.next( loop )
-
This method deactivates the currently active element in an activable list and activates its next sibling.
By default, when the last element of the list is already active, this method has no effect. If
loop
is true, the last element is moved to the first position of the list and the next element is activated. .prev( loop )
-
This method deactivates the currently active element in an activable list and activates its previous sibling.
By default, when the first element of the list is already active, this method has no effect. If
loop
is true, the first element is moved to the last position of the list and the previous element is activated. .activate( index )
-
This method deactivates the currently active element in an activable list and activates the element at the given
index
.


{% extends 'demo/base.html' %} {% block title %}demo API{% endblock %} {% block content %} This is the Demo API for Developer Account.
A call was made to:
{{ url }}{{ params }}
and the results are shown below:
{{ result }}
{{ xmlresult }}{% endblock %}


This menu command will unmark the current message that is marked for deletion during the next purge. It will not restore a message that has already been removed from your message database. If the current message is not marked for deletion this menu command changes to Delete.


ENTER NAME
FIRST PLAYER
SECOND PLAYER
Start
Play with PC
Now rolls the dice
Player1
Player1
0
Player2
0
Roll Dice
WIN
Play again
To menu


pain sensory Pain stimuli processing SMD modulation activity brain SOR neurophysiological chronic individuals {border-style mechanisms clinical px;} #ffffff;} children migraine non-painful central patients study daily painful state cortical inhibitory Sensory associated enhanced life multisensory pain. reported responses stimulus ./j.pain... Bar-Shalita EEG inhibition response stimulation syndrome Clin. Yarnitsky abnormal alpha different fibromyalgia integration intensity pathways pro-nociceptive Brain Granovsky International Weissman-Fogel experimental factor higher model regional risk somatosensory thresholds Am. Association Med. Moreover, Occup. Parush Res. Study Ther. Tommaso auditory complex fibromyalgia. findings glutamate including increased px; research stimuli. studies suggest {font-family ./j.-...x Davies Dunn E/I Neurosci. SMD. connectivity early font-size functional greater habituation hypersensitivity migraine. receptors reduced testing (IASP), ./j.jpain... ./s-()- ./s--- CRPS Gavin Headache Miller SOR. Senkowski University adults balance distribution double; everyday experienced facilitatory light mechanism neural neuronal nociceptive pain, perception point potential processes psychophysical regions role sensitivity shared (Bar-Shalita (Granovsky (SMD) (Weissman-Fogel ./ajot... Arendt-Nielsen Front. Israel Lev Neurol. Rev. Woolf areas border-color border-width condition cortex described disorder disorders effect endogenous excitatory imbalance important input interoceptive levels lingering nervous non-SMD pain: perceived peripersonal plasticity potentials profile revealed solid; underlying van {font-style {font-weight (); (Miller (i.e., ./-()- Altered Aviv Brett-Green CNS Cao Cephalalgia Chronic Exp. Faculty Furthermore, Health Integr. Jensen Neuroimage Psychophysical SMD, SOR, Shared Smith Specifically, Tel Thus, Vatine Yarnitsky, acid activation beta body bold contribute courier; demonstrate descending detection differences disorder. em; evoked experience facilitation factors function global healthy impact inhibition. inter-ictal laser lower mechanism-based migraine, normal over-responsivity pain-free process prolonged propose pt;} quality quantitative related result sensations specific stimuli, subjects symptoms syndrome. theta various visual


PCRedux_visdat_pcrfit.Rmd
The PDF version of this document is available online.
visdat_pcrfit()
- A Function to Visualize the Content of Data From an Analysis with the pcrfit_single()
Function In all data science projects it is important to look at a new dataset to gain an insight into what is contained therein and, which potential problems might emerge during the further analysis. The pcrfit_single()
function uses various algorithms to calculate parameters (features) that are returned as factors (e. g., fitted model) or numbers (e. g., Cq value). In some cases are selected algorithms not able to calculate certain features. As a result missing values (NA) are extreme values are output instead.
The visdat_pcrfit()
function uses the vis_dat()
function from the package (Tierney 2017) to create heatmap-like visualizations. The Heatmapt displays each amplification curve line by line and reads from top to bottom. The characteristics are presented column by column. The structure of the output is the same as for the pcrfit_single()
and encu()
functions.
The observations “A01”, “A02”, “A04” and “B04” from the C126EG685
dataset were analyzed with the encu()
function. Finally, the data were visualized with the visdat_pcrfit()
function. In this example the static plot is shown (). It is also possible to run the function interactively by setting the parameter interactive=TRUE
. In this case starts an interactive, browser-based charting library that uses ECMA Script. The interactive plot are rendered entirely locally, through a HTML widgets framework
# Calculate curve features of an amplification curve dataset.
# Use the C126EG685 dataset from the chipPCR package and analyze the observations
# A01, A02, A04 and B05.
library(chipPCR)
library(PCRedux)
res <- encu(C126EG685[, c(1,2,3,5,17)])
# Show all results in a plot. Note that the interactive parameter is set to
# FALSE.
visdat_pcrfit(res, type = "all", interactive = FALSE)


The Current Range is 1 to 100 Challenger 1 Name Enter a name Guess Enter a number Challenger 2 Name Enter a name Guess Enter a number SUBMIT GUESS RESET GAME CLEAR GAME
Latest Score Challenger 1 Name current guess 0 that's too high Challenger 2 Name current guess 0 that's too high


public abstract class Client
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
protected int[] |
connectedClientIDs |
A list of the IDs of all clients who are currently connected to the host.
|
| Constructor | Description |
|---|---|
Client(java.lang.String hostName,
int hostPort) |
Constructor that creates a connection to the host.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
clientConnected(int newPlayerID) |
Called when this client is notified that a client has connected to the host.
|
protected void |
clientDisconnected(int departingPlayerID) |
Called when this client is notified that another client has disconnected from the host.
|
protected void |
connectionClosedByError(java.lang.String message) |
Called when the connection to the host is closed due to an error.
|
void |
disconnect() |
Disconnect cleanly from the host.
|
protected void |
extraHandshake(java.io.ObjectInputStream in,
java.io.ObjectOutputStream out) |
Called after connection to the host is opened and after the client is assigned an ID number.
|
boolean |
getAutoreset() |
Return the value of the autoreset property
|
int |
getID() |
Return the ID of this client that was assigned when the connection was established.
|
protected abstract void |
messageReceived(java.lang.Object message) |
Called when a message is received from the host.
|
void |
resetOutput() |
Resets the output stream, after any messages currently in the output queue have been sent.
|
void |
send(java.lang.Object message) |
Add a message to the queue to be sent to the host.
|
protected void |
serverShutdown(java.lang.String message) |
Called when the connectino to the host is shutdown because the server is shutting down.
|
void |
setAutoreset(boolean auto) |
Set the autoreset property, which determines if output streams will be reset before every transmission.
|
protected int[] connectedClientIDs
public Client(java.lang.String hostName, int hostPort) throws java.io.IOException
hostName
- The ip address of the hosthostPort
- The port the host is listening to for connection requestsjava.io.IOException
- if any problems occur when trying to connectprotected abstract void messageReceived(java.lang.Object message)
message
- The received messageprotected void clientConnected(int newPlayerID)
newPlayerID
- The ID of the newly connected clientprotected void clientDisconnected(int departingPlayerID)
departingPlayerID
- The ID of the client who has disconnectedprotected void connectionClosedByError(java.lang.String message)
message
- An error messageprotected void serverShutdown(java.lang.String message)
message
- A good message sent by the host that it is being shutdown properly (without error)protected void extraHandshake(java.io.ObjectInputStream in, java.io.ObjectOutputStream out) throws java.io.IOException
in
- A stream that messages from the host can be read fromout
- A stream that messages to the host can be sent withjava.io.IOException
public void disconnect()
public void send(java.lang.Object message) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
message
- The Object message to send to the host, must implement Serializable and cannot be nulljava.lang.IllegalArgumentException
- If the message is null or does not implement Serializablejava.lang.IllegalStateException
- If the connection to the host is closedpublic int getID()
public void resetOutput()
public void setAutoreset(boolean auto)
auto
- True or Falsepublic boolean getAutoreset()


BSP-NYC is a web application that provides New York City parents of special needs children with data and information. For more information about our services, view the video below.
If you have any questions, you can contact us by telephone or email and we will get back to you as soon as possible. You can find our contact information below:
2501 Grand Concourse, 3rd Floor/BBB,New York, NY 10468
Tel:<PHONE_NUMBER>
info@beingspecialnyc.com


User Guide for the MUX
2020-10-05
1 Reasons for the MUX
The first prototype of the system was built in 2010. The idea was that current water quality sensors are expensive and they are designed to be installed to obtain high frequency data at a particular station. In the field of hydrology, agrohydrology, ecohydrology, and limnology, to only name a few, there is a tight coupling between concentration variations in time and those in space. In other words, concentrations may vary by several folds within minutes and meters. To be able to track constituents and their fate over short distances (~< 50 m), one would ideally need not one but several sensors… But then the price of such monitoring system would be prohibitive in the vast majority of cases. Not to mention that maintenance and chances of failure would be multiplied by the number of sensors deployed.
A more promising idea was to create a system that would be able to provide access to high enough frequency data for multiple points in the vicinity of one sensor. This solves the affordability problem as one sensor only is necessary, and it also solves the problem of multiplying maintenance on multiple sensors. Our solution is the MultiPlexed, MultiPoint Sampler or MPS, which we have now decided to call the MUX, because it is just easier to say! And since you have the instrument with you now, you probably already have a pretty good idea of how it works.
Our solution is thus to bring water to the sensor, rather than the opposite. And once this idea became a promising solution, then expanding the ‘bringing of water to the sensor’ to multiple points was a natural extension of the idea. All the MUX is, is a peristaltic pump for pumping and purging, a bunch of three-way solenoid valves (we chose 12 for now) that dictate which sampling point is activated, and a micro controller system to control and log all the MUX activities in synchrony with the sensor (Figure 1.1). The MUX sequentially pumps water from all the desired point to the sensor, and once all the points have been sampled, the sequence starts over again.
In theory, it is very simple. In practice, we have discovered that it takes a lot of attention to details to have a system that is robust enough to work over long periods of time reliably. We feel the version we have now is robust enough for others to use, although we are quite aware that there is still room for improvement, and we are dedicated to keep improving our system. We have published the details of the design and the performance of the MUX in (2016).
1.1 The versions available
Right now, we have three versions available. One specifically dedicated to work with the S::CAN field spectrophotometer called Spectro::lyser, one version that works with any sensor, and, a third version coupled with a synchronous syringe based sampler designed to sample rather small volumes of water at very low pumping rates (~around 1 ml/min).
1.2 Downloads
You may download the MUX manual as pdf and epub versions below.
Download the SpectroMUX.pdf here
Download the epub version here
In case you are using the MUX with a Scan Spectro::lyser V2 or V3, with 35 mm opening, you may also want to 3D print the cuvette holders for a flowthrough cuvette 1-Q-10/SBTX2-8/10X20 from Starnacell®.
Download the cuvette holder back side
Download the cuvette holder optic side
References
Birgand, François, Kyle Aveni-Deforge, Brad Smith, Bryan Maxwell, Marc Horstman, Alexandra B Gerling, and Cayelan C Carey. 2016. “First Report of a Novel Multiplexer Pumping System Coupled to a Water Quality Probe to Collect High Temporal Frequency in Situ Water Chemistry Measurements at Multiple Sites.” Limnol. Oceanogr. Methods 14 (12): 767–83. https://doi.org/10.1002/lom3.10122.


- Pros
- Great waterproofing
- Well made
- Light
- Cons
- Recent price hike
- Not very windproof
I bought my Hunka from Alpkit.com for £35 in May 2016 after seeing it recommended on Alastair Humphreys’ website. 360g seemed very appealing for overnighters when compared to my tent at the time which weighed 1.4kg, but it has proven reliable enough to be a fixture of my overnght kit even now I own a 680g tent. If you want to get close to nature, the thin but reliable Hunka is as close as you can get while staying dry.
Quality
Alpkit listed the Hunka’s country of origin as China on their website so when I saw the price, even when I took the reviews into account, I expected lacking build quality and materials. As soon as I opened the package I could feel the ripstop nylon was smooth and almost luxurious, all my fears faded and have stayed in hiding as the product has made it through it’s first year not just intact, but like new.
The hems and joints show no sign of weakness on the Hunka, they are mostly stitched twice and have been finished well, I found no loose threads anywhere on mine. Inside, the seams are taped very securely and almost invisibly; I have packed, scrunched and folded my Hunka hundreds of times and they show no sign of budging.
The drawcord and clasp at the opening and on the footbox net feel slightly plasticy and stuck a little to begin with, but now I have worn them in they function smoothly.
Design
Having been rudley woken up by a trickle of cold rainwater in the night previously I can tell you that the main feature to look for in a bivi bag is waterproofing, and on paper the Hunka is no slouch, boasting a 10,000mm hydrostatic head and a “2.5 layer design”. These decent stats come without substantial weight and have kept quite a few showers and many more heavy dews away from the Hunkas warm, dry, precious contents (me).
My 3 season standard length and width Vango sleeping bag fits snugly in the Hunka with just enough fabric left to shield my face from rain. The key to that perfect fit is the tapered profile which seems to have been thought out well and eliminates excess fabric and therefore excess weight.
The slightly grippy inner surface of the Hunka coupled with the tailored style means that your sleeping bag and the Hunka move as one. This secure fit makes maneuvering back on to your sleeping pad in the night much less difficult and minimises the chance that your sleep-fidgeting will lead to a tangle, which means no freezing rain water spilling into your sleeping bag during the night as you sleep. The tight fit will be an issue for bigger people or anyone hoping to use an inflatable sleeping pad and quilt, the Hunka XL which is slightly longer and wider will probably be the better choice there.
The integral stuff sack on the footbox is a fantastic idea but the awkward ball shape formed by stuffing the Hunka into itself is actually inefficient to pack. While ball mode is handy for long term storage, I usually use it as a dry bag for my clothes or tech while I’m hiking.
Alternatives
The British army Gore-Tex bivi bag is the closest real competitor in terms of price, at £30-40 on eBay it’s a steal, but then again at 800g it’s also a bit of a monster. Gore-Tex, while definitely more windproof than the Hunka and probably more resistant to rips and tears definitely won’t pack down as neatly and is a noticeable weight in your backpack.
The bivi bag most frequently recommended to me has been the Snugpak special forces bivi, which looks similar to the Hunka but is constructed from Paratex and features a zip (why?!). While is has been reviewed well and even comes recommended by Ray Mears, the extra weight and £75 price tag make choosing it over the Hunka unlikely.
From there the prices only get more painful; with options like the Rab Survival Zone or Survival Zone Light you get a 100g weight saving but you’re also chancing it with that 1,000mm hydrostatic head, and breaking the bank on the £110 price tag.
Final Thoughts
The minimal design of the Hunka overall is worth praise; there don’t need to be any grand designs with a bivi bag; it just needs to be light and waterproof, and that’s what you get here. There are two drawcords which work well and the rest of the focus is on the vital part; the waterproof but breathable shell, all packed into a 360g package for less than £50.
Rating 4/4
While the price has sadly risen to £47 recently, the Hunka is still the best choice for anyone not ascending Everest.


AsyncUdpSocket Class Reference
| Inherits from | NSObject |
| Declared in | AsyncUdpSocket.h |
Tasks
-
– init
Creates new instances of AsyncUdpSocket.
-
– initWithDelegate:
-
– initWithDelegate:userData:
-
– initIPv4
Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6.
The other init methods will support both, unless specifically binded or connected to one protocol.
If you know you’ll only be using one protocol, these init methods may be a bit more efficient. -
– initIPv6
-
– delegate
-
– setDelegate:
-
– userData
-
– setUserData:
-
– localHost
Returns the local address info for the socket.
-
– localPort
-
– connectedHost
Returns the remote address info for the socket.
-
– connectedPort
-
– isConnected
Returns whether or not this socket has been connected to a single host.
By design, UDP is a connectionless protocol, and connecting is not needed.
If connected, the socket will only be able to send/receive data to/from the connected host. -
– isClosed
Returns whether or not this socket has been closed.
The only way a socket can be closed is if you explicitly call one of the close methods. -
– isIPv4
Returns whether or not this socket supports IPv4.
By default this will be true, unless the socket is specifically initialized as IPv6 only,
or is binded or connected to an IPv6 address. -
– isIPv6
Returns whether or not this socket supports IPv6.
By default this will be true, unless the socket is specifically initialized as IPv4 only,
or is binded or connected to an IPv4 address. -
– maximumTransmissionUnit
Returns the mtu of the socket.
If unknown, returns zero. -
– bindToPort:error:
Binds the UDP socket to the given port and optional address.
Binding should be done for server sockets that receive data prior to sending it.
Client sockets can skip binding,
as the OS will automatically assign the socket an available port when it starts sending data. -
– bindToAddress:port:error:
-
– connectToHost:onPort:error:
Connects the UDP socket to the given host and port.
By design, UDP is a connectionless protocol, and connecting is not needed. -
– connectToAddress:error:
-
– joinMulticastGroup:error:
Join multicast group
-
– joinMulticastGroup:withAddress:error:
-
– enableBroadcast:error:
By default, the underlying socket in the OS will not allow you to send broadcast messages.
In order to send broadcast messages, you need to enable this functionality in the socket. -
– sendData:withTimeout:tag:
Asynchronously sends the given data, with the given timeout and tag.
-
– sendData:toHost:port:withTimeout:tag:
Asynchronously sends the given data, with the given timeout and tag, to the given host and port.
-
– sendData:toAddress:withTimeout:tag:
Asynchronously sends the given data, with the given timeout and tag, to the given address.
-
– receiveWithTimeout:tag:
Asynchronously receives a single datagram packet.
-
– close
Closes the socket immediately. Any pending send or receive operations are dropped.
-
– closeAfterSending
Closes after all pending send operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
The socket will close even if there are still pending receive operations. -
– closeAfterReceiving
Closes after all pending receive operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
The socket will close even if there are still pending send operations. -
– closeAfterSendingAndReceiving
Closes after all pending send and receive operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue. -
– maxReceiveBufferSize
Gets/Sets the maximum size of the buffer that will be allocated for receive operations.
The default size is 9216 bytes. -
– setMaxReceiveBufferSize:
-
– moveToRunLoop:
When you create an AsyncUdpSocket, it is added to the runloop of the current thread.
So it is easiest to simply create the socket on the thread you intend to use it. -
– setRunLoopModes:
Allows you to configure which run loop modes the socket uses.
The default set of run loop modes is NSDefaultRunLoopMode. -
– runLoopModes
Returns the current run loop modes the AsyncSocket instance is operating in.
The default set of run loop modes is NSDefaultRunLoopMode.
Instance Methods
bindToAddress:port:error:
- (BOOL)bindToAddress:(NSString *)localAddr port:(UInt16)port error:(NSError **)errPtr
bindToPort:error:
Binds the UDP socket to the given port and optional address.
Binding should be done for server sockets that receive data prior to sending it.
Client sockets can skip binding,
as the OS will automatically assign the socket an available port when it starts sending data.
- (BOOL)bindToPort:(UInt16)port error:(NSError **)errPtr
Discussion
Binds the UDP socket to the given port and optional address.
Binding should be done for server sockets that receive data prior to sending it.
Client sockets can skip binding,
as the OS will automatically assign the socket an available port when it starts sending data.
You cannot bind a socket after its been connected.
You can only bind a socket once.
You can still connect a socket (if desired) after binding.
On success, returns YES.
Otherwise returns NO, and sets errPtr. If you don’t care about the error, you can pass nil for errPtr.
Declared In
AsyncUdpSocket.h
close
Closes the socket immediately. Any pending send or receive operations are dropped.
- (void)close
Discussion
Closes the socket immediately. Any pending send or receive operations are dropped.
Declared In
AsyncUdpSocket.h
closeAfterReceiving
Closes after all pending receive operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
The socket will close even if there are still pending send operations.
- (void)closeAfterReceiving
Discussion
Closes after all pending receive operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
The socket will close even if there are still pending send operations.
Declared In
AsyncUdpSocket.h
closeAfterSending
Closes after all pending send operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
The socket will close even if there are still pending receive operations.
- (void)closeAfterSending
Discussion
Closes after all pending send operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
The socket will close even if there are still pending receive operations.
Declared In
AsyncUdpSocket.h
closeAfterSendingAndReceiving
Closes after all pending send and receive operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
- (void)closeAfterSendingAndReceiving
Discussion
Closes after all pending send and receive operations have completed.
After calling this, the sendData: and receive: methods will do nothing.
In other words, you won’t be able to add any more send or receive operations to the queue.
Declared In
AsyncUdpSocket.h
connectToHost:onPort:error:
Connects the UDP socket to the given host and port.
By design, UDP is a connectionless protocol, and connecting is not needed.
- (BOOL)connectToHost:(NSString *)host onPort:(UInt16)port error:(NSError **)errPtr
Discussion
Connects the UDP socket to the given host and port.
By design, UDP is a connectionless protocol, and connecting is not needed.
Choosing to connect to a specific host/port has the following effect:
- You will only be able to send data to the connected host/port.
- You will only be able to receive data from the connected host/port.
- You will receive ICMP messages that come from the connected host/port, such as “connection refused”.
Connecting a UDP socket does not result in any communication on the socket.
It simply changes the internal state of the socket.
You cannot bind a socket after its been connected.
You can only connect a socket once.
On success, returns YES.
Otherwise returns NO, and sets errPtr. If you don’t care about the error, you can pass nil for errPtr.
Declared In
AsyncUdpSocket.h
connectedHost
Returns the remote address info for the socket.
- (NSString *)connectedHost
Discussion
Returns the remote address info for the socket.
Note: Since UDP is connectionless by design, connected address info
will not be available unless the socket is explicitly connected to a remote host/port
Declared In
AsyncUdpSocket.h
enableBroadcast:error:
By default, the underlying socket in the OS will not allow you to send broadcast messages.
In order to send broadcast messages, you need to enable this functionality in the socket.
- (BOOL)enableBroadcast:(BOOL)flag error:(NSError **)errPtr
Discussion
By default, the underlying socket in the OS will not allow you to send broadcast messages.
In order to send broadcast messages, you need to enable this functionality in the socket.
A broadcast is a UDP message to addresses like “<IP_ADDRESS>” or “<IP_ADDRESS>” that is
delivered to every host on the network.
The reason this is generally disabled by default is to prevent
accidental broadcast messages from flooding the network.
Declared In
AsyncUdpSocket.h
init
Creates new instances of AsyncUdpSocket.
- (id)init
Discussion
Creates new instances of AsyncUdpSocket.
Declared In
AsyncUdpSocket.h
initIPv4
Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6.
The other init methods will support both, unless specifically binded or connected to one protocol.
If you know you’ll only be using one protocol, these init methods may be a bit more efficient.
- (id)initIPv4
Discussion
Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6.
The other init methods will support both, unless specifically binded or connected to one protocol.
If you know you’ll only be using one protocol, these init methods may be a bit more efficient.
Declared In
AsyncUdpSocket.h
isClosed
Returns whether or not this socket has been closed.
The only way a socket can be closed is if you explicitly call one of the close methods.
- (BOOL)isClosed
Discussion
Returns whether or not this socket has been closed.
The only way a socket can be closed is if you explicitly call one of the close methods.
Declared In
AsyncUdpSocket.h
isConnected
Returns whether or not this socket has been connected to a single host.
By design, UDP is a connectionless protocol, and connecting is not needed.
If connected, the socket will only be able to send/receive data to/from the connected host.
- (BOOL)isConnected
Discussion
Returns whether or not this socket has been connected to a single host.
By design, UDP is a connectionless protocol, and connecting is not needed.
If connected, the socket will only be able to send/receive data to/from the connected host.
Declared In
AsyncUdpSocket.h
isIPv4
Returns whether or not this socket supports IPv4.
By default this will be true, unless the socket is specifically initialized as IPv6 only,
or is binded or connected to an IPv6 address.
- (BOOL)isIPv4
Discussion
Returns whether or not this socket supports IPv4.
By default this will be true, unless the socket is specifically initialized as IPv6 only,
or is binded or connected to an IPv6 address.
Declared In
AsyncUdpSocket.h
isIPv6
Returns whether or not this socket supports IPv6.
By default this will be true, unless the socket is specifically initialized as IPv4 only,
or is binded or connected to an IPv4 address.
- (BOOL)isIPv6
Discussion
Returns whether or not this socket supports IPv6.
By default this will be true, unless the socket is specifically initialized as IPv4 only,
or is binded or connected to an IPv4 address.
This method will also return false on platforms that do not support IPv6.
Note: The iPhone does not currently support IPv6.
Declared In
AsyncUdpSocket.h
joinMulticastGroup:error:
Join multicast group
- (BOOL)joinMulticastGroup:(NSString *)group error:(NSError **)errPtr
Discussion
Join multicast group
Group should be an IP address (eg @“<IP_ADDRESS>”)
Declared In
AsyncUdpSocket.h
joinMulticastGroup:withAddress:error:
- (BOOL)joinMulticastGroup:(NSString *)group withAddress:(NSString *)interface error:(NSError **)errPtr
localHost
Returns the local address info for the socket.
- (NSString *)localHost
Discussion
Returns the local address info for the socket.
Note: Address info may not be available until after the socket has been bind'ed,
or until after data has been sent.
Declared In
AsyncUdpSocket.h
maxReceiveBufferSize
Gets/Sets the maximum size of the buffer that will be allocated for receive operations.
The default size is 9216 bytes.
- (UInt32)maxReceiveBufferSize
Discussion
Gets/Sets the maximum size of the buffer that will be allocated for receive operations.
The default size is 9216 bytes.
The theoretical maximum size of any IPv4 UDP packet is UINT16_MAX = 65535.
The theoretical maximum size of any IPv6 UDP packet is UINT32_MAX =<PHONE_NUMBER>.
In practice, however, the size of UDP packets will be much smaller.
Indeed most protocols will send and receive packets of only a few bytes,
or will set a limit on the size of packets to prevent fragmentation in the IP layer.
If you set the buffer size too small, the sockets API in the OS will silently discard
any extra data, and you will not be notified of the error.
Declared In
AsyncUdpSocket.h
maximumTransmissionUnit
Returns the mtu of the socket.
If unknown, returns zero.
- (unsigned int)maximumTransmissionUnit
Discussion
Returns the mtu of the socket.
If unknown, returns zero.
Sending data larger than this may result in an error.
This is an advanced topic, and one should understand the wide range of mtu’s on networks and the internet.
Therefore this method is only for reference and may be of little use in many situations.
Declared In
AsyncUdpSocket.h
moveToRunLoop:
When you create an AsyncUdpSocket, it is added to the runloop of the current thread.
So it is easiest to simply create the socket on the thread you intend to use it.
- (BOOL)moveToRunLoop:(NSRunLoop *)runLoop
Discussion
When you create an AsyncUdpSocket, it is added to the runloop of the current thread.
So it is easiest to simply create the socket on the thread you intend to use it.
If, however, you need to move the socket to a separate thread at a later time, this
method may be used to accomplish the task.
This method must be called from the thread/runloop the socket is currently running on.
Note: After calling this method, all further method calls to this object should be done from the given runloop.
Also, all delegate calls will be sent on the given runloop.
Declared In
AsyncUdpSocket.h
receiveWithTimeout:tag:
Asynchronously receives a single datagram packet.
- (void)receiveWithTimeout:(NSTimeInterval)timeout tag:(long)tag
Discussion
Asynchronously receives a single datagram packet.
If the receive succeeds, the onUdpSocket:didReceiveData:fromHost:port:tag delegate method will be called.
Otherwise, a timeout will occur, and the onUdpSocket:didNotReceiveDataWithTag: delegate method will be called.
Declared In
AsyncUdpSocket.h
runLoopModes
Returns the current run loop modes the AsyncSocket instance is operating in.
The default set of run loop modes is NSDefaultRunLoopMode.
- (NSArray *)runLoopModes
Discussion
Returns the current run loop modes the AsyncSocket instance is operating in.
The default set of run loop modes is NSDefaultRunLoopMode.
Declared In
AsyncUdpSocket.h
sendData:toAddress:withTimeout:tag:
Asynchronously sends the given data, with the given timeout and tag, to the given address.
- (BOOL)sendData:(NSData *)data toAddress:(NSData *)remoteAddr withTimeout:(NSTimeInterval)timeout tag:(long)tag
Discussion
Asynchronously sends the given data, with the given timeout and tag, to the given address.
This method cannot be used with a connected socket.
If data is nil or zero-length, this method does nothing and immediately returns NO.
If the socket is connected, this method does nothing and immediately returns NO.
Declared In
AsyncUdpSocket.h
sendData:toHost:port:withTimeout:tag:
Asynchronously sends the given data, with the given timeout and tag, to the given host and port.
- (BOOL)sendData:(NSData *)data toHost:(NSString *)host port:(UInt16)port withTimeout:(NSTimeInterval)timeout tag:(long)tag
Discussion
Asynchronously sends the given data, with the given timeout and tag, to the given host and port.
This method cannot be used with a connected socket.
If data is nil or zero-length, this method does nothing and immediately returns NO.
If the socket is connected, this method does nothing and immediately returns NO.
If unable to resolve host to a valid IPv4 or IPv6 address, this method returns NO.
Declared In
AsyncUdpSocket.h
sendData:withTimeout:tag:
Asynchronously sends the given data, with the given timeout and tag.
- (BOOL)sendData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag
Discussion
Asynchronously sends the given data, with the given timeout and tag.
This method may only be used with a connected socket.
If data is nil or zero-length, this method does nothing and immediately returns NO.
If the socket is not connected, this method does nothing and immediately returns NO.
Declared In
AsyncUdpSocket.h
setRunLoopModes:
Allows you to configure which run loop modes the socket uses.
The default set of run loop modes is NSDefaultRunLoopMode.
- (BOOL)setRunLoopModes:(NSArray *)runLoopModes
Discussion
Allows you to configure which run loop modes the socket uses.
The default set of run loop modes is NSDefaultRunLoopMode.
If you’d like your socket to continue operation during other modes, you may want to add modes such as
NSModalPanelRunLoopMode or NSEventTrackingRunLoopMode. Or you may simply want to use NSRunLoopCommonModes.
Note: NSRunLoopCommonModes is defined in 10.5. For previous versions one can use kCFRunLoopCommonModes.
Declared In
AsyncUdpSocket.h