Routing DSL
In addition to the Core Server API Akka HTTP provides a very flexible “Routing DSL” for elegantly defining RESTful web services. It picks up where the low-level API leaves off and offers much of the higher-level functionality of typical web servers or frameworks, like deconstruction of URIs, content negotiation or static content serving.
It is recommended to read the Implications of the streaming nature of Request/Response Entities section, as it explains the underlying full-stack streaming concepts, which may be unexpected when coming from a background with non-“streaming first” HTTP Servers.
Minimal Example
This is a complete, very basic Akka HTTP application relying on the Routing DSL:
- Scala
-
import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.model._ import akka.http.scaladsl.server.Directives._ import akka.stream.ActorMaterializer import scala.io.StdIn object WebServer { def main(args: Array[String]) { implicit val system = ActorSystem("my-system") implicit val materializer = ActorMaterializer() // needed for the future flatMap/onComplete in the end implicit val executionContext = system.dispatcher val route = path("hello") { get { complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "
Say hello to akka-http
")) } } val bindingFuture = Http().bindAndHandle(route, "localhost", 8080) println(s"Server online at http://localhost:8080/\nPress RETURN to stop...") StdIn.readLine() // let it run until user presses return bindingFuture .flatMap(_.unbind()) // trigger unbinding from the port .onComplete(_ => system.terminate()) // and shutdown when done } }
- Java
-
import akka.NotUsed; import akka.actor.ActorSystem; import akka.http.javadsl.ConnectHttp; import akka.http.javadsl.Http; import akka.http.javadsl.ServerBinding; import akka.http.javadsl.model.HttpRequest; import akka.http.javadsl.model.HttpResponse; import akka.http.javadsl.server.AllDirectives; import akka.http.javadsl.server.Route; import akka.stream.ActorMaterializer; import akka.stream.javadsl.Flow; import java.util.concurrent.CompletionStage; public class HttpServerMinimalExampleTest extends AllDirectives { public static void main(String[] args) throws Exception { // boot up server using the route as defined below ActorSystem system = ActorSystem.create("routes"); final Http http = Http.get(system); final ActorMaterializer materializer = ActorMaterializer.create(system); //In order to access all directives we need an instance where the routes are define. HttpServerMinimalExampleTest app = new HttpServerMinimalExampleTest(); final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = app.createRoute().flow(system, materializer); final CompletionStage<ServerBinding> binding = http.bindAndHandle(routeFlow, ConnectHttp.toHost("localhost", 8080), materializer); System.out.println("Server online at http://localhost:8080/\nPress RETURN to stop..."); System.in.read(); // let it run until user presses return binding .thenCompose(ServerBinding::unbind) // trigger unbinding from the port .thenAccept(unbound -> system.terminate()); // and shutdown when done } private Route createRoute() { return route( path("hello", () -> get(() -> complete("
Say hello to akka-http
")))); } }
It starts an HTTP Server on localhost and replies to GET requests to /hello
with a simple response.
The following example uses an experimental feature and its API is subjected to change in future releases of Akka HTTP. For further information about this marker, see The @DoNotInherit and @ApiMayChange markers in the Akka documentation.
To help start a server Akka HTTP provides an experimental helper class called HttpAppHttpApp. This is the same example as before rewritten using HttpAppHttpApp:
- Scala
-
import akka.http.scaladsl.model.{ ContentTypes, HttpEntity } import akka.http.scaladsl.server.HttpApp import akka.http.scaladsl.server.Route // Server definition object WebServer extends HttpApp { override def routes: Route = path("hello") { get { complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "
Say hello to akka-http
")) } } } // Starting the server WebServer.startServer("localhost", 8080)
- Java
-
// Server definition class MinimalHttpApp extends HttpApp { @Override protected Route routes() { return path("hello", () -> get(() -> complete("
Say hello to akka-http
") ) ); } } // Starting the server final MinimalHttpApp myServer = new MinimalHttpApp(); myServer.startServer("localhost", 8080);
See HttpApp Bootstrap for more details about setting up a server using this approach.
Longer Example
The following is an Akka HTTP route definition that tries to show off a few features. The resulting service does not really do anything useful but its definition should give you a feel for what an actual API definition with the Routing DSL will look like:
import akka.actor.{ActorRef, ActorSystem}
import akka.http.scaladsl.coding.Deflate
import akka.http.scaladsl.marshalling.ToResponseMarshaller
import akka.http.scaladsl.model.StatusCodes.MovedPermanently
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.unmarshalling.FromRequestUnmarshaller
import akka.pattern.ask
import akka.stream.ActorMaterializer
import akka.util.Timeout
// types used by the API routes
type Money = Double // only for demo purposes, don't try this at home!
type TransactionResult = String
case class User(name: String)
case class Order(email: String, amount: Money)
case class Update(order: Order)
case class OrderItem(i: Int, os: Option[String], s: String)
// marshalling would usually be derived automatically using libraries
implicit val orderUM: FromRequestUnmarshaller[Order] = ???
implicit val orderM: ToResponseMarshaller[Order] = ???
implicit val orderSeqM: ToResponseMarshaller[Seq[Order]] = ???
implicit val timeout: Timeout = ??? // for actor asks
implicit val ec: ExecutionContext = ???
implicit val mat: ActorMaterializer = ???
implicit val sys: ActorSystem = ???
// backend entry points
def myAuthenticator: Authenticator[User] = ???
def retrieveOrdersFromDB: Seq[Order] = ???
def myDbActor: ActorRef = ???
def processOrderRequest(id: Int, complete: Order => Unit): Unit = ???
val route = {
path("orders") {
authenticateBasic(realm = "admin area", myAuthenticator) { user =>
get {
encodeResponseWith(Deflate) {
complete {
// marshal custom object with in-scope marshaller
retrieveOrdersFromDB
}
}
} ~
post {
// decompress gzipped or deflated requests if required
decodeRequest {
// unmarshal with in-scope unmarshaller
entity(as[Order]) { order =>
complete {
// ... write order to DB
"Order received"
}
}
}
}
}
} ~
// extract URI path element as Int
pathPrefix("order" / IntNumber) { orderId =>
pathEnd {
(put | parameter('method ! "put")) {
// form extraction from multipart or www-url-encoded forms
formFields(('email, 'total.as[Money])).as(Order) { order =>
complete {
// complete with serialized Future result
(myDbActor ? Update(order)).mapTo[TransactionResult]
}
}
} ~
get {
// debugging helper
logRequest("GET-ORDER") {
// use in-scope marshaller to create completer function
completeWith(instanceOf[Order]) { completer =>
// custom
processOrderRequest(orderId, completer)
}
}
}
} ~
path("items") {
get {
// parameters to case class extraction
parameters(('size.as[Int], 'color ?, 'dangerous ? "no"))
.as(OrderItem) { orderItem =>
// ... route using case class instance created from
// required and optional query parameters
}
}
}
} ~
pathPrefix("documentation") {
// optionally compresses the response with Gzip or Deflate
// if the client accepts compressed responses
encodeResponse {
// serve up static content from a JAR resource
getFromResourceDirectory("docs")
}
} ~
path("oldApi" / Remaining) { pathRest =>
redirect("http://oldapi.example.com/" + pathRest, MovedPermanently)
}
}
Handling HTTP Server failures in the High-Level API
There are various situations when failure may occur while initialising or running an Akka HTTP server. Akka by default will log all these failures, however sometimes one may want to react to failures in addition to them just being logged, for example by shutting down the actor system, or notifying some external monitoring end-point explicitly.
Bind failures
For example the server might be unable to bind to the given port. For example when the port is already taken by another application, or if the port is privileged (i.e. only usable by root
). In this case the “binding future” will fail immediately, and we can react to it by listening on the Future
CompletionStage
’s completion:
- Scala
-
import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.Http.ServerBinding import akka.http.scaladsl.server.Directives._ import akka.stream.ActorMaterializer import scala.concurrent.Future object WebServer { def main(args: Array[String]) { implicit val system = ActorSystem() implicit val materializer = ActorMaterializer() // needed for the future foreach in the end implicit val executionContext = system.dispatcher val handler = get { complete("Hello world!") } // let's say the OS won't allow us to bind to 80. val (host, port) = ("localhost", 80) val bindingFuture: Future[ServerBinding] = Http().bindAndHandle(handler, host, port) bindingFuture.failed.foreach { ex => log.error(ex, "Failed to bind to {}:{}!", host, port) } } }
- Java
-
import akka.NotUsed; import akka.actor.ActorSystem; import akka.http.javadsl.ConnectHttp; import akka.http.javadsl.ServerBinding; import akka.http.javadsl.model.HttpRequest; import akka.http.javadsl.model.HttpResponse; import akka.http.javadsl.server.Route; import akka.http.javadsl.Http; import akka.stream.ActorMaterializer; import akka.stream.javadsl.Flow; import java.io.IOException; import java.util.concurrent.CompletionStage; public class HighLevelServerBindFailureExample { public static void main(String[] args) throws IOException { // boot up server using the route as defined below final ActorSystem system = ActorSystem.create(); final ActorMaterializer materializer = ActorMaterializer.create(system); final HighLevelServerExample app = new HighLevelServerExample(); final Route route = app.createRoute(); final Flow<HttpRequest, HttpResponse, NotUsed> handler = route.flow(system, materializer); final CompletionStage<ServerBinding> binding = Http.get(system).bindAndHandle(handler, ConnectHttp.toHost("<IP_ADDRESS>", 8080), materializer); binding.exceptionally(failure -> { System.err.println("Something very bad happened! " + failure.getMessage()); system.terminate(); return null; }); system.terminate(); } }
For a more low-level overview of the kinds of failures that can happen and also more fine-grained control over them refer to the Handling HTTP Server failures in the Low-Level API documentation.
Failures and exceptions inside the Routing DSL
Exception handling within the Routing DSL is done by providing ExceptionHandlerExceptionHandler s which are documented in-depth in the Exception Handling section of the documentation. You can use them to transform exceptions into HttpResponseHttpResponse s with appropriate error codes and human-readable failure descriptions.
File uploads
For high level directives to handle uploads see the FileUploadDirectives.
Handling a simple file upload from for example a browser form with a file input can be done by accepting a Multipart.FormData entity, note that the body parts are Source rather than all available right away, and so is the individual body part payload so you will need to consume those streams both for the file and for the form fields.
Here is a simple example which just dumps the uploaded file into a temporary file on disk, collects some form fields and saves an entry to a fictive database:
- Scala
-
val uploadVideo = path("video") { entity(as[Multipart.FormData]) { formData => // collect all parts of the multipart as it arrives into a map val allPartsF: Future[Map[String, Any]] = formData.parts.mapAsync[(String, Any)](1) { case b: BodyPart if b.name == "file" => // stream into a file as the chunks of it arrives and return a future // file to where it got stored val file = File.createTempFile("upload", "tmp") b.entity.dataBytes.runWith(FileIO.toPath(file.toPath)).map(_ => (b.name -> file)) case b: BodyPart => // collect form field values b.toStrict(2.seconds).map(strict => (b.name -> strict.entity.data.utf8String)) }.runFold(Map.empty[String, Any])((map, tuple) => map + tuple) val done = allPartsF.map { allParts => // You would have some better validation/unmarshalling here db.create(Video( file = allParts("file").asInstanceOf[File], title = allParts("title").asInstanceOf[String], author = allParts("author").asInstanceOf[String])) } // when processing have finished create a response for the user onSuccess(allPartsF) { allParts => complete { "ok!" } } } }
- Java
-
path("video", () -> entity(Unmarshaller.entityToMultipartFormData(), formData -> { // collect all parts of the multipart as it arrives into a map final CompletionStage<Map<String, Object>> allParts = formData.getParts().mapAsync(1, bodyPart -> { if ("file".equals(bodyPart.getName())) { // stream into a file as the chunks of it arrives and return a CompletionStage // file to where it got stored final File file = File.createTempFile("upload", "tmp"); return bodyPart.getEntity().getDataBytes() .runWith(FileIO.toPath(file.toPath()), materializer) .thenApply(ignore -> new Pair<String, Object>(bodyPart.getName(), file) ); } else { // collect form field values return bodyPart.toStrict(2 * 1000, materializer) .thenApply(strict -> new Pair<String, Object>(bodyPart.getName(), strict.getEntity().getData().utf8String()) ); } }).runFold(new HashMap<String, Object>(), (acc, pair) -> { acc.put(pair.first(), pair.second()); return acc; }, materializer); // simulate a DB call final CompletionStage<Void> done = allParts.thenCompose(map -> // You would have some better validation/unmarshalling here DB.create((File) map.get("file"), (String) map.get("title"), (String) map.get("author") )); // when processing have finished create a response for the user return onSuccess(allParts, x -> complete("ok!")); }) );
You can transform the uploaded files as they arrive rather than storing them in a temporary file as in the previous example. In this example we accept any number of .csv
files, parse those into lines and split each line before we send it to an actor for further processing:
- Scala
-
val splitLines = Framing.delimiter(ByteString("\n"), 256) val csvUploads = path("metadata" / LongNumber) { id => entity(as[Multipart.FormData]) { formData => val done: Future[Done] = formData.parts.mapAsync(1) { case b: BodyPart if b.filename.exists(_.endsWith(".csv")) => b.entity.dataBytes .via(splitLines) .map(_.utf8String.split(",").toVector) .runForeach(csv => metadataActor ! MetadataActor.Entry(id, csv)) case _ => Future.successful(Done) }.runWith(Sink.ignore) // when processing have finished create a response for the user onSuccess(done) { _ => complete { "ok!" } } } }
- Java
-
Route csvUploads() { final Flow<ByteString, ByteString, NotUsed> splitLines = Framing.delimiter(ByteString.fromString("\n"), 256); return path(segment("metadata").slash(longSegment()), id -> entity(Unmarshaller.entityToMultipartFormData(), formData -> { final CompletionStage<Done> done = formData.getParts().mapAsync(1, bodyPart -> bodyPart.getFilename().filter(name -> name.endsWith(".csv")).map(ignored -> bodyPart.getEntity().getDataBytes() .via(splitLines) .map(bs -> bs.utf8String().split(",")) .runForeach(csv -> metadataActor.tell(new Entry(id, csv), ActorRef.noSender()), materializer) ).orElseGet(() -> // in case the uploaded file is not a CSV CompletableFuture.completedFuture(Done.getInstance())) ).runWith(Sink.ignore(), materializer); // when processing have finished create a response for the user return onComplete(() -> done, ignored -> complete("ok!")); }) ); }
Configuring Server-side HTTPS
For detailed documentation about configuring and using HTTPS on the server-side refer to Server-Side HTTPS Support.


Directory
IT Help Desk
D2L
MyNortheast
Catalog
Library
NORSTAR
Contact Us
Corporate Training
Schedule of Classes
Course Descriptions
Career Training
Gatlin Education
Ed 2 Go Online
Continuing Education
CAP
Ed 2 Go Online
Other
Registration Form
Career Focus
Career Services
FAQ
Loading Map...


Uber's former CEO Travis Kalanick dumped his stock again — his November selling spree racked up $1.5 billion
by Yusuf Khan- Travis Kalanick is cashing in from the company he started.
- According to SEC filings, Uber’s co-founder sold off $US1.5 billion worth of the company’s stock since the post-IPO lockup at the start of the November.
- He offloaded about half a billion dollars’ worth in just three days.
- Kalanick still holds about 45 million shares of Uber still and is worth about $US3.3 billion, according to Bloomberg.
- Earlier this week, an RBC analyst said the company could become profitable in the next three to five years.
- View Business Insider’s homepage for more stories.
Travis Kalanick is cashing in from the company he started.
Uber’s cofounder, who no longer works at the company, sold off $US1.5 billion worth of the company’s stock since the post-IPO lockup at the start of the November, and he offloaded over half a billion dollars in just three days, according to SEC filings.
Between, November 19 and 21, Kalanick sold roughly more than 20.4 million shares at an average of $US28.07 per share, coming to about $US578 million, adding to the series of offloads Kalanick made since November 6.
Kalanick still holds about 45 million shares of Uber still and is worth about $US3.3 billion according to Bloomberg.
“While it is usual to see directors with such a high value holding selling regularly, Kalanick’s sales are unusually high,” Michael Tindale said to Bloomberg, who is the CEO of Smart Insider, a firm that “tracks and analyses share transactions by directors and senior managers.”
Kalanick’s sales underline the fact the Uber’s co-founder is focusing on other ventures, such as his startup CloudKitchens – a firm that sources rental space to be turned into kitchens for delivery-only restaurants.
CloudKitchens got major backing from Saudi Arabia at the start of the year.
However, while Kalanick is selling off, Uber’s CEO Dara Khosrowshahi is scooping up more stock. SEC filings show that Khosrowshahi spent $US6.7 million on shares of the ride-hailing firm.
According to analyst Mark Mahaney from RBC, Khosrowshahi is making the right move.
“You get the path to profitability working, this stock, which is dislocated now, can be a dramatic outperformer over the next three to five years,” Mahaney has said.
Since the going public in May, Uber’s stock has fallen 29%.


CHAPTER 288
COMMON CARRIERS, COMPULSORY INSURANCE
Section
288-1 Application of chapter
288-2 Definitions
288-3 Common carriers of passengers to be insured
288-4 Conditions of policy
288-5 Bond in lieu of insurance, allowed when
288-6 Bond prerequisite to license
288-7 Cancellation of insurance, revocation of license
288-8 Penalty


It’s possible to combine element and class selectors to select elements based on both their name and class.
Try it now!
select me
but neither me


xfce4-screenshooter
The XFCE4 screenshot tool.
More information: home page
- Launch the screenshooter GUI:
xfce4-screenshooter
- Take a screenshot of the entire screen and launch the GUI to ask how to proceed:
xfce4-screenshooter --fullscreen
- Take a screenshot of the entire screen and save it in the specified directory:
xfce4-screenshooter --fullscreen --save path/to/directory
- Wait some time before taking the screenshot:
xfce4-screenshooter --delay seconds
- Take a screenshot of a region of the screen (select using the mouse):
xfce4-screenshooter --region
- Take a screenshot of the active window, and copy it to the clipboard:
xfce4-screenshooter --window --clipboard
- Take a screenshot of the active window, and open it with a chosen program:
xfce4-screenshooter --window --open gimp


How do I add a column of computed values?
The easiest way to do it is to extend your models from a
Backbone.Model
subclass that supports computed
properties and accessing them via the same get/set
interface. There are a number of Backbone plugins readily available for
this. Should all else failed, you can roll your own fairly
easily.
How do I add or remove a row?
You can either use Backbone.Collection#add or Grid#insertRow for insertion. Similarly, use Backbone.Collection#remove or Grid#removeRow to remove rows.
How do I put the grid in a default sorted state?
See the sorting programmatically section.
How do I validate user input?
See the validation section on Formatter.
How do I save my row changes to the server immediately?
Where do I go to ask questions?
Finding an answer to your question about Backgrid is a simple 4-step process:
- Ponder about the wisdom of your question and the answer you seek.
- Search this document for the keywords you are looking for.
- Pay your tribute to the almighty Google.
- Go to StackOverflow or as a last resort, Github.
Does Backgrid.js support adaptive scrolling?
Some data grid widgets out there support a technique called adaptive scrolling, meaning the DOM elements will be swapped out of a viewport and new ones appended as the models are loaded from the server, thus keeping the memory more or less constant while providing an illusion to end-users that there's no limit to the number of rows the data grid can handle.
Backgrid.js has something better and achieves the same effect with much cleaner code - paginator extension, which uses backbone-pageable. The paginator supports both paging on the server-side, or preloading all the models and paging purely through the browser. Paginated Backgrid.Grid instances only render one page of DOM nodes at a time to save memory and keep your web page responsive.
Does Backgrid.js support function aggregates?
No, because it is not the goal of this project to produce a full-fledged web-based spreadsheet. However, doing aggregation is trivial using Underscore.js methods.
If you use a Backbone plugin that supports computed values, you may also treat the computed values as a column as well.
Does Backgrid.js support multi-user editing?
Inside a Backgrid grid, every cell listens to the change event for its model value. The cells will rerender themselves during display mode upon changes in the model values. However, this functionality is only meant for synchronizing data automatically across multiple grids on the same page. If you are attempting to synchronize data changes across multiple processes, you will need some kind of a locking mechanism for the individual cells, Backgrid.js provides no help for that and you have to do this yourself. Implementing such web-based spreadsheet-like broker system is outside of the scope of this project, pull requests are welcome however.
Does Backgrid.js support feature (X)?
If the feature you have in mind isn't found here in this Backgrid.js version, it could either be in the works or under consideration.
See the list of tasks and enhancements.
How to build Backgrid.js?
How do I contribute?
Why doesn't Backgrid.js support AMD (or NPM)?
The same question can be asked for volo, bower, ender, browserify and many other competing solutions. The number one reason Backgrid.js does not support AMD or NPM is because of the barrier it presents to writing extensions that require third-party libraries that don't support these packaging mechanisms.
That said, it is possible to use Backgrid and its various extensions with AMD using RequireJS's shim option. For CommonJS, there is also first-class support for Component.
The problem with supporting any package manager is that Backgrid.js is a highly modular project, and that deciding to use any package manager presupposes all its submodules and dependency is compatible with such a package manager and its importing mechanism. The Javascript ecosystem has gotten so diverse now that there is still not yet a clear packaging winner that everybody uses and works well under most situations, it is also not clear that ES Harmony's module system will be backward compatible with AMD.
Having said that, Backgrid.js doesn't do anything to prevent you from adding support to your favorite package manager. You are encouraged to fork and maintain your own Backgrid.js packages.


{% extends "base.html" %} {% block content %}
This application doesn't have web interface and it uses browser only for registration:
For all other functions of application and more information, please take a look at GitHub repository of the project
{% if error %}Error: {{ error }} {% endif %} {% with messages = get_flashed_messages() %} {% if messages %}


Class: tooltips
Source Location: /class.tooltips.php
A class used to generate JavaScript
tooltips.
Author(s):
Version:
- 1.1c (last revision: January 28, 2007)
Copyright:
- (c) 2006 - 2007 Stefan Gabos
|
|
|
Class Details
Class Variables
$error =
[line 143]
In case of an error read this property's value to find out what went
wrong
possible error values are:
- 1: XTemplate class could not be found
- 2: template file could not be found
- 3: you must call the init() method first
default is 0
$fadeInDelay =
[line 80]
How long (in milliseconds) should the script wait
onmousemove/onmouseover, before starting to fade in a tooltip
Default is 0
$fadeInSpeed =
[line 50]
The speed with which a tooltip should fade in.
Can be any value between 1 and 100
Default is 20
$fadeOutDelay =
[line 70]
How long (in milliseconds) should the script wait onmouseout, before
starting to fade out a tooltip
Default is 500
$fadeOutSpeed =
[line 60]
The speed with which a tooltip should fade out.
Can be any value between 1 and 100
Default is 20
$maximumOpacity =
[line 89]
A percentual value representing the maximum opacity a tooltip can
get
Default is 100
$offsetX =
[line 103]
How far (in pixels), horizontally, should the tooltip's top-left
corner be positioned relatively to the mouse cursor
A positive number means "how far to the right"
while a negative number means "how far to the left".
Note that, if needed, the script will automatically
adjust the tooltip's horizontal position so that it will always be
inside the visible area of the browser's window!
Default is 20
$offsetY =
[line 117]
How far (in pixels), vertically, should the tooltip's top-left
corner be positioned relatively to the mouse cursor
A positive number means "how far to the bottom"
while a negative number means "how far to the top".
Note that, if needed, the script will automatically
adjust the tooltip's vertical position so that it will always be
inside the visible area of the browser's window!
Default is 20
$template =
[line 128]
Template folder to use Note that only the folder of the template you
wish to use needs to be specified. Inside the folder you must
have the template.xtpl file which will be
automatically used
default is "default"
Class Methods
|


To install the WebSocket server certificate:
Then start the echo client, which connects to the WebSocket endpoint via secure WS.


To be able to use this component, you should import the module in the page you want to use it from your Angular project. You have the following example:


Question 16:Add cross button on row and bind click function which make a delete request to server, after success event remove the row from dom


| programming | Brian Olsen Nigel Graham |
| icon | Thomas Jakobi |
| UI design additions | Nigel Graham Søren Lisberg |
| MetaX | Rodney Kerstetter |
| Libraries and frameworks used | |
| Sparkle update framework | Andy Matuschak |
| MGViewAnimation | Matt Gemmell |
| various pieces of code | Adrian Kosmaczewski Marc Liyanage Olivier Gay Uli Kusterer |


Create A User
First name:
Last name:
User type:
Faculty:
Department:
Major:
username:
password:
email:
mobile:
Submit


|
goog.editor.plugins.Blockquote.findAndRemoveSingleChildAncestor_(node, root)
Helper routine which walks up the tree to find the topmost
ancestor with only a single child. The ancestor node or the original
node (if no ancestor was found) is then removed from the DOM.
|
code » | |||||
|
goog.editor.plugins.Blockquote.isBlockquote(node, isAlreadySetup, requiresClassnameToSplit, classname)
⇒
Checks if a node is a blockquote node. If isAlreadySetup is set, it also
makes sure the node has the blockquote classname applied. Otherwise, it
ensures that the blockquote does not already have the classname applied.
Arguments:
Returns:
Whether node is a blockquote and if isAlreadySetup is true, then whether this is a setup blockquote.
|
code » | |||||
|
goog.editor.plugins.Blockquote.removeAllWhiteSpaceNodes_(nodes)
Remove every nodes from the DOM tree that are all white space nodes.
|
code » |


FC-LIST(1) FC-LIST(1) NAME fc-list - list available fonts SYNOPSIS fc-list [ -vVh ] [ --verbose ] [ -f format | --format format ] [ --ver‐ sion ] [ --help ] [ pattern [ element ... ] ] DESCRIPTION fc-list lists fonts and styles available on the system for applications using fontconfig. If any elements are specified, only those are printed. Otherwise family and style are printed, unless verbose output is requested. OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -v --verbose Print verbose output of the whole font pattern for each match, or elements if any is provided. -f --format format Format output according to the format specifier format. -V --version Show version of the program and exit. -h --help Show summary of options. pattern If this argument is set, only fonts matching pattern are dis‐ played. element If set, the element property is displayed for matching fonts. EXAMPLES fc-list Lists all font faces. fc-list :lang=hi Lists font faces that cover Hindi. fc-list : family style file spacing Lists the filename and spacing value for each font face. ``:'' is an empty pattern that matches all fonts. SEE ALSO fc-match(1) FcFontList(3) FcPatternFormat(3) fc-cat(1) fc-cache(1) fc- pattern(1) fc-query(1) fc-scan(1) The fontconfig user's guide, in HTML format: /usr/share/doc/fontcon‐ fig/fontconfig-user.html. AUTHOR This manual page was written by Keith Packard<EMAIL_ADDRESS>and Josselin Mouette<EMAIL_ADDRESS>16 April 2012 FC-LIST(1)


Measurements
Sometimes distance or other measurements are available that can act as constraints for tag and body poses. For example, one can measure the distance between two tags with a laser. Or a large number of tags are pinned against the same, straight wall such that the $y$ coordinate of all tags is known. TagSLAM has been designed such that implementation of new measurement constraints should be modular and fairly straight forward.
When measurements refer to tags, the following convention for orientation of the tag and corner numbering is assumed:
Distance measurements
If you have a laser pointer, you can measure the distances between tag
corners, and enter them like this into tagslam.yaml
:
distance_measurements:
- my_measurement_1:
tag1: 24
tag2: 60
corner1: 0
corner2: 0
distance: 6.017
noise: 0.0002
- my_measurement_2:
tag1: 29
tag2: 60
corner1: 0
corner2: 0
distance: 6.002
noise: 0.00159
The noise parameter should be set according to the expected accuracy of the measurement (in meters), and will determine how strongly that constraint will enter the optimization process.
Once tagslam has completed, you can find an error analysis file in
$HOME/.ros/distance_diagnostics.txt
. The meaning of the columns
is as follows:
optimizer |optimzed-
error |measured optimzed measured name of measurement
19.515 diff: -0.001 opt: 6.016 meas: 6.017 my_measurement_1
0.001 diff: 0.001 opt: 6.003 meas: 6.002 my_measurement_2
Coordinate measurements
Coordinate measurements are a way to impose constraints on the
absolute coordinates of the corner of a given tag. The following
example (in tagslam.yaml) sets the coordinates along the direction
[0.0, 0.0, 1.0]
,
i.e. the $z$-axis, of corner zero (bottom left) tags 6 and 17 to a
known value.
coordinate_measurements:
- tag6_z:
tag: 6
corner: 0
length: 2.070
noise: 0.010
direction: [0.0, 0.0, 1.0]
- tag17_z:
tag: 17
corner: 0
length: 0.619
noise: 0.010
direction: [0.0, 0.0, 1.0]
The noise parameter should be set according to the expected accuracy of the measurement (in meters), and will determine how strongly that constraint will enter the optimization process.
Once tagslam has completed, you can find an error analysis file in
$HOME/.ros/coordinate_diagnostics.txt
. The meaning of the columns
is as follows:
optimizer |optimzed-
error |measured optimzed measured name of measurement
0.000 diff: 0.000 opt: 2.070 meas: 2.070 tag6_z
0.000 diff: -0.000 opt: 0.619 meas: 0.619 tag17_z
Plane measurements
Use this feature to constrain the center of tags to be in a plane.
The plane is given by the normal vector (direction
) and its distance to the
origin (in meters).
The noise
gives the uncertainty [in m] by which the tags are in
the plane. Note that this does not constrain the orientation of the
tags at all. Example:
plane_measurements:
- plane_1:
tags: [32, , 70, 65, 66, 67]
distance: 0.0
noise: 0.01
direction: [0.0, 0.0, 1.0]
The error output can be found in
$HOME/.ros/coordinate_diagnostics.txt
. For explanation of
the fields, see coordinate measurements (above).


Gecode::Int::Sequence Namespace Reference
Sequence propagators More...
Classes | |
| class | SupportAdvisor |
| Class for advising the propagator. More... | |
| class | ViewValSupport |
| Class for view value support structure. More... | |
| class | Violations |
| Simple bitsets for recording violations. More... | |
| class | ViewValSupportArray |
| An array of ViewValSupport data structures. More... | |
| class | Sequence |
| Sequence propagator for array of integers More... | |
Enumerations | |
| enum | TakesStatus { TS_NO, TS_YES, TS_MAYBE } |
Status of whether a view takes a value from a set. More... | |
Functions | |
| template<class View > | |
| TakesStatus | takes (const View &x, int s) |
| Return whether view x takes value s. | |
| template<class View > | |
| TakesStatus | takes (const View &x, const IntSet &s) |
| Return whether view x takes value from s. | |
| template<class View > | |
| bool | includes (const View &x, int s) |
| Test whether all values of view x are included in s. | |
| template<class View > | |
| bool | includes (const View &x, const IntSet &s) |
| Test whether all values of view x are included in s. | |
| template<class View > | |
| bool | excludes (const View &x, int s) |
| Test whether all values of view x are excluded from s. | |
| template<class View > | |
| bool | excludes (const View &x, const IntSet &s) |
| Test whether all values of view x are excluded from s. | |
| template<class View > | |
| bool | undecided (const View &x, int s) |
| Test whether no decision on inclusion or exclusion of values of view x in s can be made. | |
| template<class View > | |
| bool | undecided (const View &x, const IntSet &s) |
| Test whether no decision on inclusion or exclusion of values of view x in s can be made. | |
| template<class View > | |
| ModEvent | include (Space &home, View &x, int s) |
| Prune view x to only include values from s. | |
| template<class View > | |
| ModEvent | include (Space &home, View &x, const IntSet &s) |
| Prune view x to only include values from s. | |
| template<class View > | |
| ModEvent | exclude (Space &home, View &x, int s) |
| Prune view x to exclude all values from s. | |
| template<class View > | |
| ModEvent | exclude (Space &home, View &x, const IntSet &s) |
| Prune view x to exclude all values from s. |
Detailed Description
Sequence propagators
This namespace contains a propagator for the cumulatives constraint as presented in Willem Jan van Hoeve, Gilles Pesant, Louis-Martin Rousseau, and Ashish Sabharwal, New filtering algorithms for combinations of among constraints. Constraints, 14(2), 273-292, 2009.
Enumeration Type Documentation
Status of whether a view takes a value from a set.
Definition at line 37 of file set-op.hpp.
Function Documentation
| TakesStatus Gecode::Int::Sequence::takes | ( | const View & | x, | |
| int | s | |||
| ) | [inline] |
Return whether view x takes value s.
Definition at line 46 of file set-op.hpp.
| TakesStatus Gecode::Int::Sequence::takes | ( | const View & | x, | |
| const IntSet & | s | |||
| ) | [inline] |
Return whether view x takes value from s.
Definition at line 55 of file set-op.hpp.
| bool Gecode::Int::Sequence::includes | ( | const View & | x, | |
| int | s | |||
| ) | [inline] |
Test whether all values of view x are included in s.
Definition at line 72 of file set-op.hpp.
| bool Gecode::Int::Sequence::includes | ( | const View & | x, | |
| const IntSet & | s | |||
| ) | [inline] |
Test whether all values of view x are included in s.
Definition at line 78 of file set-op.hpp.
| bool Gecode::Int::Sequence::excludes | ( | const View & | x, | |
| int | s | |||
| ) | [inline] |
Test whether all values of view x are excluded from s.
Definition at line 89 of file set-op.hpp.
| bool Gecode::Int::Sequence::excludes | ( | const View & | x, | |
| const IntSet & | s | |||
| ) | [inline] |
Test whether all values of view x are excluded from s.
Definition at line 95 of file set-op.hpp.
| bool Gecode::Int::Sequence::undecided | ( | const View & | x, | |
| int | s | |||
| ) | [inline] |
Test whether no decision on inclusion or exclusion of values of view x in s can be made.
Definition at line 106 of file set-op.hpp.
| bool Gecode::Int::Sequence::undecided | ( | const View & | x, | |
| const IntSet & | s | |||
| ) | [inline] |
Test whether no decision on inclusion or exclusion of values of view x in s can be made.
Definition at line 112 of file set-op.hpp.
| ModEvent Gecode::Int::Sequence::include | ( | Space & | home, | |
| View & | x, | |||
| int | s | |||
| ) | [inline] |
Prune view x to only include values from s.
Definition at line 123 of file set-op.hpp.
| ModEvent Gecode::Int::Sequence::include | ( | Space & | home, | |
| View & | x, | |||
| const IntSet & | s | |||
| ) | [inline] |
Prune view x to only include values from s.
Definition at line 129 of file set-op.hpp.
| ModEvent Gecode::Int::Sequence::exclude | ( | Space & | home, | |
| View & | x, | |||
| int | s | |||
| ) | [inline] |
Prune view x to exclude all values from s.
Definition at line 137 of file set-op.hpp.
| ModEvent Gecode::Int::Sequence::exclude | ( | Space & | home, | |
| View & | x, | |||
| const IntSet & | s | |||
| ) | [inline] |
Prune view x to exclude all values from s.
Definition at line 143 of file set-op.hpp.


#include <mrDistances.h>
Inheritance diagram for mr::distances::Type:
Public Member Functions | |
| virtual miScalar | operator() (const vector &d) const=0 |
| virtual miScalar | operator() (const vector &d, const vector &s) const=0 |
|
|
Implemented in mr::distances::Euclidian, mr::distances::Manhattan, mr::distances::Chessboard, and mr::distances::Superquadratic. |
|
|
Implemented in mr::distances::Euclidian, mr::distances::Manhattan, mr::distances::Chessboard, and mr::distances::Superquadratic. |


{% extends "base.html" %} {% from "macros.html" import mem_name_crsid, soc_desc_soc %} {% set page_title = "Confirm group account creation" %} {% block body %}
Please check any suggestions below before continuing. An SRCF sysadmin will need to approve your request, after which you can manage your new group account from the control panel.
This can't be changed after account creation! Make sure you're happy with it.
Your admin contact address will be {{ society<EMAIL_ADDRESS>You will be able to create other addresses or mailing lists of the form {{ society<EMAIL_ADDRESS>{% if society.endswith("soc") %}You've ended your group account short name with "soc", meaning your website address will be {{ society }}.soc.srcf.net.
{% else %}Your website address will be {{ society }}.soc.srcf.net.
{% endif %}If you have a custom domain of your own, you can add it to the account after creation.
Possible duplicate group account: {{ soc_desc_soc(similar[0]) }}
If this represents you, don't submit this form!
Please contact the owners of the group account at {{ similar[0].society<EMAIL_ADDRESS>to request your addition as an admin.
{% elif similar %}Possible duplicate group accounts:
If one of these represents you, don't submit this form!
Please contact the owners of that account (e.g. {{ similar[0].society<EMAIL_ADDRESS>for {{ similar[0].description }}) to request your addition as an admin.
{% endif %} {% if similar %}If you're unable to make contact, you may request assistance from the sysadmins.
This check may not find all duplicates, check our list of all group accounts for any other potential matches.
{% else %}No obvious duplicates found, but check our list of all group accounts for any potential matches.
{% endif %}We'd strongly recommend nominating multiple account administrators before account creation.


IN THE HIGH COURT OF JUDICATURE AT PATNA Criminal Miscellaneous No.27307 of 2011 Niranjan @ Malik Singh, Son of Ramata Singh, Resident of Village Birra, P.S. Hulasganj, Distt. Jehanabad. ---------- Petitioner Versus The State Of Bihar -------- Opposite Party ----------------
02/- 12/09/2011 Heard learned counsel for the petitioner and learned Additional Public Prosecutor for the State.
The petitioner apprehends his arrest in connection with a case registered for the offence punishable under Section 379 of the Indian Penal Code, Section 7 Bihar Minerals (illegal digging transportation & Etoration) Act, 2003, 41 Water Act, 1974, Section 37(1) AIR Act, 1981, Section 15 of the environment (protection) Act and Section 4, 40, 52 of B.M.M.C. Act 1992 and Sections 4, 21 M.M.R.D. Act, 1957, is one of the named accused in this case relating to crushing of stone chiefs etc. Submission is that he has been denied the privilege by learned Sessions Judge only because of having one criminal antecedent of similar nature. Though, others have been granted the privilege.
Considering the facts and circumstances of the case, in the event of his arrest/surrender before the court below within four weeks, let the above named petitioner be enlarged on bail on furnishing bail-bond of Rs. 10,000/- (ten thousand only) with two sureties of the like amount each to the satisfaction of Chief Judicial Magistrate, Jehanabad, in connection with Makhdumpur P.S. Case No. 99 of 2011, subject to condition laid down under Section 438(2) of the Criminal Procedure Code with additional condition to remain physically present before the court below till disposal of the case, in case of failure on two consecutive dates, without giving any reasonable explanation, the liberty granted shall be deemed to be cancelled.
Praveen/- ( Akhilesh Chandra, J.)


Welcome to the hunt!
Just in my free time I have made a little internet hunt for you all! Here is the first step!
aHR0cHM6Ly9pLmliYi5jby9SNERGOW5qLzIwMjEtMDktMDYtMHY1LUtsZWtpLnBuZw==
Have fun!
-------------------------------
[ NAVIGATION MENU ]
-------------------------------
View me on GitHub
Go to the homepage
Back to top of page


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Makes 18
Dietary
Scones provide one of the best vehicles for clotted cream. The buttermilk in these scones not only gives them a slight tang - all the better to enjoy the jam and cream on top - but is also what yields such a melting, tender crumb. Until you have made a batch of scones you won’t have any idea how easy they are to throw together. Frankly, it shouldn’t take longer than 20 minutes to make and bake them, from start to finish.
Preheat the oven to 220C/450/Gas 7. Line a large baking sheet with baking parchment.
Put the flour into a bowl with the bicarbonate of soda, cream of tartar and sugar.
Chop the butter and the vegetable shortening into pieces and drop them into the flour.
Rub the fats into the flour using your fingertips – or just mix any old how – and then pour in the buttermilk, working everything together to form a dough.
Lightly flour your work surface. Pat the dough down into a round-edged oblong about 4cm/1½in thick, then cut out 6cm/2¼in scones with a fluted cutter.
Arrange the scones fairly close together on your lined baking sheet, and brush with beaten egg (to give golden tops), if you wish. Cook for 12 minutes, by which time the scones will be dry on the bottom and have a relatively light feel. Remove them to a wire rack to cool, and serve with clotted cream and jam.


Back
WIFI
Device as station
Enable
SSID
Password
IP
Netmask
Gateway
Device as access point
Enable
IP
Netmask
Gateway
Channel
SSID
Password
Hidden
Hostname
Keep
Disable
Max conn.
DHCP start
DHCP end


Resolution function Δ d/ d (calculated from Δ t/ t) using center wavelengths (CWL) of 0.8, 1.5 and 2.665 Å in the ( a) high-resolution and ( b) high-intensity mode. The lines are added as a guide to the eye. The data were collected from LaB 6 (SRM 660b) with a frequency of 60 Hz and fitted using GSAS-II.


BIOGRAPHY
RESUMÉ
HOBBIES
INVESTING
TRAVEL MAP
PHOTO GALLERY
CONTACT
Would you like us to contact you?
Please fill out the form below:
Send us your contact info
First name:
Last name:
Phone number:
E-mail:
How did you find out about us:
Comments:


|
JB.Toolkit
A collection of useful classes, extensions and tools written in C# to aid in a wide variety of development. With components for ASP Net MVC, Winform and Console applications. Integrations for Google, AD and SQL and pre-written implementations / helpers for a variety of tasks... Just Because.
|
Client to host communication (1 direction) Named Pipe implementation. More...
Public Member Functions | |
| void | Start () |
| void | Stop () |
Events | |
| EventHandler< DataReceivedEventArgs > | Received |
| EventHandler< EventArgs > | Faulted |
| Events inherited from JBToolkit.InterProcessComms.IIpcServer | |
| EventHandler< DataReceivedEventArgs > | Received |
Client to host communication (1 direction) Named Pipe implementation.
Give the server an application specific unique name. When implementing the 'Faulted' method, you need to actually recreate the WcfServer object to undo it's faulted state.
| void JBToolkit.InterProcessComms.Wcf.WcfServer.Start | ( | ) |
Implements JBToolkit.InterProcessComms.IIpcServer.
| void JBToolkit.InterProcessComms.Wcf.WcfServer.Stop | ( | ) |
Implements JBToolkit.InterProcessComms.IIpcServer.
| EventHandler<EventArgs> JBToolkit.InterProcessComms.Wcf.WcfServer.Faulted |
| EventHandler<DataReceivedEventArgs> JBToolkit.InterProcessComms.Wcf.WcfServer.Received |


This class does AnytymeBeliefPropagationWithSeparatorConditioning in an incremental way.
The way AnytymeBeliefPropagationWithSeparatorConditioning works is as follows:
We begin with a explored part of the graph
We add one Factor Node to this graph
We assign bounds to Variable Nodes that are not fully explored, that is have not been exhausted (See @c
isExhasuted
in
Model
)
We Apply the Inference Algorithm known as Belief propagation with separator conditioning (S-BP). for this, it is necessary to :
Define a
PartitionTree
do the message passing step, from the leafs to the query
The way the Incremental version works is as follows:
In order for S-BP to work, a
PartitionTree
structure have to be defined before the message passing process starts.
This version of the AnytymeBeliefPropagationWithSeparatorConditioning algorithm manages to reuse the
PartitionTree
defined in a previous iteration
in order to save computation time used to build it. Instead, we just update certain nodes influenced by the new added factor.
(P.S. This approach may have a down Side : There are many possibilities of partition threes, and the choice of the a good one entirely determines the complexity of the inference process.
On the other hand, computing a partition tree is a relatively cheap operation. Therefore, buy not rebuilding a partition tree, can lead to a much longer computation time during the S-BP step,
even though time is saved in the partition tree definition phase.
HOW TO USE THIS CLASS?
First one has to have a iterator for the partition tree ( PS: the nodes given by the iterator must be already connected among them)
One has to create a model containing all the factor nodes that are going to be (eventually) explored.
In order to do the inference, of the query, the user has three options:
For incremental anytime S-BP :
ExpandAndComputeInference
For anytime S-BP (rebuild partition graph at each step) :
ExpandAndComputeInferenceByRebuildingPartitionTree
For inference over the whole model at once:
InferenceOverEntireModel


--- title: Tracking callbacks keywords: fastai sidebar: home_sidebar summary: "Callbacks that make decisions depending how a monitored metric/loss behaves" description: "Callbacks that make decisions depending how a monitored metric/loss behaves" ---
learn = synth_learner()
learn.fit(1, cbs=ShortEpochCallback())
learn = synth_learner()
learn.fit(1, cbs=ShortEpochCallback(short_valid=False))
learn = synth_learner()
learn.fit(2, lr=0.01, cbs=GradientAccumulation(n_acc=2*learn.dls.bs))
# ensure train_loss decreased
assert learn.recorder.values[-1][0] < learn.recorder.values[0][0]
learn.fit(2, lr=0.01, cbs=GradientAccumulation(n_acc=1e6))
# ensure valid_loss didn't change (same weights)
assert learn.recorder.values[-1][1] == learn.recorder.values[0][1]
BnFreeze
is useful when you'd like to train two separate models that have a common feature extractor / body. The only part of the model that's different is the head that you attach for transfer learning.
Learner.freeze()
) doesn't suffice here as the BatchNorm
layers are trainable by default, and running mean and sdev of batches are tracked. For feature extractors to fully match, you need to set train_bn=False
and these stats need to be frozen as well, which is precisely the function of BnFreeze
.
#slow
from fastai2.vision.all import *
path = untar_data(URLs.MNIST_TINY)
dls = ImageDataLoaders.from_folder(path, valid_pct=0.2)
We first demonstrate the mismatch of the running stats when using only train_bn=False
#slow
learn1 = cnn_learner(deepcopy(dls), resnet18, pretrained=True, train_bn=False)
learn2 = cnn_learner(deepcopy(dls), resnet18, pretrained=True, train_bn=False)
learn1.fit(1, lr=0.02)
learn2.fit(1, lr=0.02)
#slow
# SOURCE: https://discuss.pytorch.org/t/check-if-models-have-same-weights/4351/6
def models_equal(model_1, model_2, verbose=False):
models_differ = 0
for key_item_1, key_item_2 in zip(model_1.state_dict().items(), model_2.state_dict().items()):
if torch.equal(key_item_1[1], key_item_2[1]):
pass
else:
models_differ += 1
if (key_item_1[0] == key_item_2[0]):
if verbose: print(f'Mismtach found at {key_item_1[0]}')
else:
raise Exception
if verbose: print('Models being compared have different architectures')
if models_differ == 0:
if verbose: print('Models match perfectly')
return True
return False
#slow
models_equal(learn1.model, learn2.model)
#slow
learn1 = cnn_learner(deepcopy(dls), resnet18, pretrained=True, train_bn=False, cbs=BnFreeze)
learn2 = cnn_learner(deepcopy(dls), resnet18, pretrained=True, train_bn=False, cbs=BnFreeze)
learn1.fit(1, lr=0.02)
learn2.fit(1, lr=0.02)
assert models_equal(learn1.model[0], learn2.model[0])