text:
# Designing Secure Services with Unikernels

Anil MadhavapeddyUniversity of Cambridge
[@avsm](http://twitter.com/avsm)

_on behalf of a merry crew:_ Richard Mortier,

Thomas Gazagnaire, David Scott, Thomas Leonard,

Magnus Skjegstad, David Sheets, Amir Chaudhry,

Jon Crowcroft, Balraj Singh, Mindy Preston

[http://openmirage.org/](http://openmirage.org/)

[http://decks.openmirage.org/qcon15-mirage/](http://decks.openmirage.org/qcon15-mirage/)

  Press <esc> to view the slide index, and the <arrow> keys to
  navigate

----

## Topics

> **Part 1: Why care about this?**

> Part 2: What are unikernels?

> Part 3: How should I use them?

----

## Introducing [Mirage OS 2.0](http://openmirage.org/)

These slides were written using Mirage on Mac OSX:

- They are hosted in a **2.5MB Xen unikernel** written in statically type-safe
  OCaml, including device drivers and network stack
  - Including all content encoded as an OCaml string, 7.2MB

- Their application logic is just a **couple of source files**, written
  independently of any OS dependencies

- Running on an **ARM** CubieBoard2, and hosted on the cloud

- Binaries small enough to track the **entire deployment** in Git!

## Introducing [Mirage OS 2.0](http://openmirage.org/)

## Cubieboard 2 (£39)

+ __AllWinnerTech SOC A20, ARM Cortex-A7 Dual-Core__
+ GPU: ARM Mali400 MP2 (OpenGL ES 2.0/1.1)
+ 1GB DDR3, 3.4GB internal NAND flash
+ 10/100 Ethernet, supports USB WiFi/Bluetooth
+ 2x USB 2.0 HOST, mini USB 2.0 OTG, micro SD, SATA
+ HDMI 1080P display output
+ IR, line in, line out, 96 extend PIN interface, including I2C, SPI, RGB/LVDS,
  CSI/TS, FM-IN, ADC, CVBS, VGA, SPDIF-OUT, R-TP, and more

----

## From simple servers...

Traditional systems programming has involved building services in *one*
environment, e.g. Server, client, or embedded

##  ...To deep-sea diving

Traditional systems programming has involved building services in *one*
environment but a modern programmer deals with diverse targets:

- **Cloud services** with unpredictable traffic spikes and failures
- **Smartphone programming** on ARM/x86 with power budgets
- **JavaScript** user interfaces with asynchronous web clients
- **Internet of Things** devices that have little ARM M0 processors
- **Kernel modules** to extend operating system functionality

> No (little) code reuse between platforms

## The IoT Spring

## Recently...

* **Heartbleed**: 17% of *all* Internet secure web servers vulnerable to a
  single bug, described as "catastrophic" by Bruce Schneier
* **ShellShock**: CGI, Web, DHCP all vulnerable to code execution. Millions of
  sites potentially vulnerable
* **JP Morgan**: 76 million homes and 8 million small businesses exposed in a
  single data breach
* **Target**: 40 million credit cards stolen electronically

> System security is in a disastrous state, and improving only slowly, at much
> cost!

## Complexity Kills You

The enemy is **complexity**:

+ Applications are **deeply intertwined** with system APIs, and so lack
  portability
+ Modern operating systems offer **dynamic support** for **many users** to run
  **multiple applications** simultaneously

Almost unbounded scope for uncontrolled interaction!

+ Choices of distribution and version
+ Ad hoc application configuration under `/etc/`
+ Platform configuration details, e.g., firewalls

## The Odd Inversion

We build applications in a **safe, compositional style** using
functional programming.

...and then surround it in **15 million lines of unsafe code** to
interact with the outside world.

> With such powerful programming language abstractions,
> why hasn't the operating system disappeared from our
> stack?

## Leaning Tower of Cloud

Numerous pain points:

**Complex** configuration management

Duplicated functionality leads to **inefficiency**

VM image size leads to **long boot times**

Lots of code means a **large attack surface**

    https://flic.kr/p/8N1hWh

## Docker: Containerisation

    https://flic.kr/p/qSbck

## Docker: Containerisation

Docker bundles up all this state making it easy to transport, install and manage

## Can We Do Better?

**We need to disentangle applications from the operating system**:

- Break up operating system functionality into modular libraries
- Link only the system functionality your app needs
- Target alternative platforms from a single codebase

----

## Topics

> Part 1: Why care about this?

> **Part 2: What are unikernels?**

> Part 3: How should I use them?

----

## The Unikernel Approach

> __Unikernels__ are specialised virtual machine images compiled from the
> modular stack of application code, system libraries and configuration

This means they realise several benefits:

+ __Contained__, simplifying deployment and management
+ __Compact__, reducing attack surface and boot times
+ __Efficient__, able to fit 10,000s onto a single host
+ __Portable__, to many compilation environments beyond Xen

## Application First

With unikernels, the operating system disappears and becomes
a set of libraries linked against a boot loader.

* Application can figure out which components it needs
* Libraries can easily be customised (e.g. TCP/IP stack)
* Profiling and tracing work in a single domain.
* Replace C libraries with type-safe equivalents!

> Every application is compiled into its own specialised
> operating system that runs on the cloud.

## Tradeoffs

**Good for:**

Specialising microservice endpoint APIs

Flash traffic resilience with real-time spawning

Mobile/embedded environments as well as cloud

**Bad for:**

Monolithic application stacks that are hard to break up

Graphical user interfaces with deep OS requirements

Multi-user interaction within a single microservice

## It's All Functional Code

Capture system dependencies in code and compile them away

## Retarget By Recompiling

Swap system libraries to target different platforms:

**develop application logic using native Unix**

## Retarget By Recompiling

Swap system libraries to target different platforms:

**test unikernel using Mirage system libraries**

## Retarget By Recompiling

Swap system libraries to target different platforms:

**deploy by specialising unikernel to Xen**

## Retarget By Recompiling

Swap system libraries to target different platforms:

**...which provides a stable hardware interface**

## Xen Unikernel Memory

## Mirage OS 2.0 Workflow

As easy as 1—2—3!

1. Write your OCaml application using the Mirage module types, expressing its
   configuration as OCaml code too!
```
$ mirage configure app/config.ml --unix
```

## Mirage OS 2.0 Workflow

As easy as 1—2—3!

1. Write your OCaml application using the Mirage module types, expressing its
   configuration as OCaml code too!

2. Compile it and debug under Unix using the `mirage` tool
```
$ cd app
$ make depend # install library dependencies
$ make build  # build the unikernel
```

## Mirage OS 2.0 Workflow

As easy as 1—2—3!

1. Write your OCaml application using the Mirage module types, expressing its
   configuration as OCaml code too!

2. Compile it and debug under Unix using the `mirage` tool

3. Once debugged, simply retarget it to Xen, and rebuild!
```
$ mirage configure app/config.ml --xen
$ cd app && make depend && make build
```

All the magic happens via the OCaml module system.

----

## Modularity is Good

Mirage OS restructures all system components as __modules__:

1. A collection of __module types__, describing the structural "shapes" of the
   components of an operating system (e.g., device drivers)

2. A collection of independent __libraries implementing those module types__

As with all library OSs, only the required libraries are linked into the final
application.

## Functor Terminology

* **Haskell**: Functor is a type class that lets you map functions
over the parameterised type using fmap.

* **OCaml**: Similar concept, except that it operates over *modules*
(a collection of functions and types) instead of a single type.

  * OCaml functor is a module that is parameterised across other
    modules (see [Real World OCaml Chap 9](https://realworldocaml.org/v1/en/html/functors.html)).

  * Functors and modules are a separate language from the core OCaml language. *([A Modular Module System](http://caml.inria.fr/pub/papers/xleroy-modular_modules-jfp.pdf), Xavier Leroy in JFP 10(3):269-303, 2000)*.

## Modular to the max

Modules are used everywhere in Mirage to describe OS layers:

- For the __whole application/OS__: we've a full implementation of the network
  stack (including TLS) in OCaml

- Very __flexible approach__ for customising OS stacks for weird applications
  (e.g., HTTP over UPnP over UDP)

- Lots of __separate implementations__ of the module signatures: Unix, Xen
  microkernels, JavaScript, kernel modules, ...

## Module Types: Devices

```
module type DEVICE = sig

  type +'a io
  type t
  type id

  val id : t -> id

  val disconnect : t -> unit io

end
```

Generic interface to any device driver...

## Module Types: Flows

```
module type FLOW = sig

  type +'a io
  type buffer
  type flow

  val read : flow -> [`Ok of buffer | `Eof | `Error of exn ] io

  val write : flow -> buffer -> [`Ok of unit | `Eof | `Error of exn ] io

  val writev : flow -> buffer list -> [`Ok of unit | `Eof | `Error of exn ] io

end
```

...or IO flow

## Module Types: Inclusion

```
module type TCPV4 = sig

  type buffer
  type ipv4
  type ipv4addr
  type flow

  include DEVICE with
  with type id := ipv4

  include FLOW with
  with type 'a io  := 'a io
  and  type buffer := buffer
  and  type flow   := flow
```

...and they can be composed together into other module types, avoiding the
diamond problem

## Module Types: Entropy

```
module type ENTROPY = sig

  include DEVICE
  type buffer

  type handler = source:int -> buffer -> unit
  (** A [handler] is called whenever the system has extra entropy to announce.
   * No guarantees are made about the entropy itself, other than it being
   * environmentally derived. In particular, the amount of entropy in the buffer
   * can be far lower than the size of the [buffer].
   *
   * [source] is a small integer, describing the provider but with no other
   * meaning.
   **)

  val handler : t -> handler -> unit io
end
```

Complex driver models can be expressed abstractly (see
[V1.ml](https://github.com/mirage/mirage/tree/master/types/))

----

## Writing a component

A Mirage component usually contains:

- Code parameterised by functors with very limited (Mirage-only) dependencies,
  and particularly __no OS dependencies__

- A collection of libraries where the functors are applied,
  suitable for interactive use

> Functors clearly separate dependencies between OS components, breaking
> the monolithic OS down into components

## Modularizing the OS

## Modularizing the OS

## Modularizing the OS

## Example: These Slides

```
module Main (C:CONSOLE) (FS:KV_RO) (H:HTTP.Server) = struct

  let start c fs http =
    ...

    let callback conn_id request body =
      C.log "HTTP request received" ...
      >>= fun () ->
      let uri = H.Request.uri request in
      dispatcher (split_path uri)
    in
    let conn_closed (_,conn_id) () = ...  in
    http { H.callback; conn_closed }

end
```

## Deployment Options

There are several ways we might want to deploy this site:

* Standalone Xen unikernel with all data built into image.
* Xen unikernel with data dynamically read from a  block device.
* Unix binary with data passed through to filesystem.
* Unix binary with data passed in from a Docker volume.
* Unix binary with OCaml userlevel TCP/IP stack.

> The desired unikernel can be constructed by writing OCaml code that defines
> the exact configuration as its output.

## Your Server as a Function

Your web server configuration is setup via OCaml code.

```
# Build a web server listening on TCP port 80, logging to the default console
let server =
  let conduit = conduit_direct (stack default_console) in
  http_server (`TCP (`Port 80)) conduit

# Build a job type that accepts a console, key/value store and an HTTP server *)
let slide_deck = foreign "Dispatch.Main"
  (console @-> kv_ro @-> http @-> job)

# Create a job instance
let () =
  register "www" [ slide_deck $ default_console $ fs $ server ]
```

The configuration is evaluated at compilation time to generate a main entry
point for that _particular_ setup

## Correspondence

Configuration Code:

```
let server =
  let conduit = conduit_direct (stack default_console) in
  http_server (`TCP (`Port 80)) conduit

let main = foreign "Dispatch.Main"
  (console @-> kv_ro @-> http @-> job)
```

Application Code:

```
module Main (C:CONSOLE) (FS:KV_RO) (H:HTTP.Server) = struct

  let start c fs http = ...
```

## Codegen: Unix

```
module Stackv41 = Tcpip_stack_socket.Make(Console)
module Conduit1 = Conduit_mirage.Make(Stackv41)
module Http1 = HTTP.Make(Conduit1)
module M1 = Dispatch.Main(Console)(Static1)(Http1.Server)
```

Fairly simple application where:

+ A kernel socket `C` binding, `Tcpip_stack_socket`, takes...
+ A `Console` to build...
+ A network stack, `Stackv41`, over which we instantiate...
+ An `HTTP` server

...which is finally passed to the application (along with a static filesystem
and a console)

## Codegen: Xen

```
module Stackv41 = struct
  module E = Ethif.Make(Netif)
  module I = Ipv4.Make(E)
  module U = Udpv4.Make(I)
  module T = Tcpv4.Flow.Make(I)(OS.Time)(Clock)(Random)
  module S = Tcpip_stack_direct.Make(Console)(OS.Time)(Random)(Netif)(E)(I)(U)(T)
  include S
end
module Conduit1 = Conduit_mirage.Make(Stackv41)
module Http1 = HTTP.Make(Conduit1)
module M1 = Dispatch.Main(Console)(Static1)(Http1.Server)

...

let () =
  OS.Main.run (join [t1 ()])
```

In Xen, we build the network stack "by hand" starting with the Ethernet device,
as we have no kernel sockets

## Configuration: Summary

* Unikernel is a **parameterised module** over dependencies.
  - ML functors separate OS functionality into modular chunks.
  - Mirage provides a large library of module types.
* **Metaprogramming** is used to manipulate these modules.
  - Mirage eDSL manipulates module types and implementations in OCaml.
  - Config file is interpreted to generate executable kernel.
  - Flexible way to specify precise device driver needs.

----

## End Result?

Unikernels are compact enough to boot and respond to network traffic in
real-time

    Appliance
    Standard Build
    Dead Code Elimination

      DNS	0.449 MB	0.184 MB

      Web Server	0.674 MB	0.172 MB

      Openflow learning switch	0.393 MB	0.164 MB

      Openflow controller	0.392 MB	0.168 MB

## End Result?

Unikernels are compact enough to boot and respond to network traffic in
real-time

## Macrobenchmarks

Type-safety in the application layer defeats several external threats, but at
what cost in the kernel?

We have implemented several larger appliances:

+ a simple webserver
+ an OpenFlow Switch
+ an OpenFlow Controller

## DNS Server baseline

_Baseline figures, running __Bind__ (standard) and __NSD__ (high performance).
NSD achieves around 70 kreqs/s_

## DNS Server mirage

_Comparing against __Mirage__ appliance, with and without simple memoisation:
this __algorithmic__ optimisation added just 6 lines of code_

## DNS Server C/miniOS

_A simple `C` appliance linked NSD directly against MiniOS but poor
user-space library performance vastly outweighs language effects_

## Scaling via Parallel Instances

_Static page request throughput: Mirage scales by running many instances rather
than paying for thread-level interlocking_

## Openflow Controller

_Competitive with NOX (C++) but much higher level, and both switch and controller
can be linked as libraries_

----

## Topics

> Part 1: Why care about this?

> Part 2: What are unikernels?

> **Part 3: How should I use them?**

----

## Clean-slate TLS

* Started development in January 2014 (David Kaloper, Hannes Mehnert)
* Full reimplementation of X509, ASN.1 baggage.
* Built in functional style, so *same* codebase  for trace checking.
* Maintains full type-safety for a HTTPS unikernel.
* Self-describing demo server at <https://tls.openmirage.org>

> The BitCoin Pinata : <http://ownme.ipredator.se/>

## TLSTunnel

* Unix version of the stack that terminates TLS with type-safety.
* Can be installed via OPAM (opam.ocaml.org)

    $ sudo add-apt-repository ppa:avsm/ppa
    $ sudo apt-get install opam

    $ opam init -a
    $ eval `opam config env`

## TLSTunnel

* Unix version of the stack that terminates TLS with type-safety.
* Can be installed via OPAM (opam.ocaml.org)

    $ opam install tlstunnel
    $ tlstunnel -f <ip> -b <ip> --cert <file>

> Looking for feedback from weird (e.g. mobile or proxy) TLS
> setups!

## Mirage-Seal

* Create static SSL Xen unikernels with one command.
* https://github.com/mirage/mirage-seal

    $ opam remote add dev git://github.com/mirage/opam-repo-dev
    $ opam install mirage-seal
    $ mirage-seal --data=<dir> --keys=<secrets>
    $ xl create -c seal.xl

----

## Git Your Own Cloud

Unikernels are **small enough to be tracked in GitHub**. For example, for the
[Mirage website](http://openmirage.org/):

1. Source code updates are merged to
   **[mirage/mirage-www](https://github.com/mirage/mirage-www)**;

2. Repository is continuously rebuilt by
   **[Travis CI](https://travis-ci.org/mirage/mirage-www)**; if successful:

3. Unikernel pushed to   **[mirage/mirage-www-deployment](https://github.com/mirage/mirage-www-deployment)**

4. Cloud toolstack spawns VMs based on pushes there.

**Our *entire* cloud-facing deployment is version-controlled from the source
code up**!

## Implications

**Historical tracking of source code and built binaries in Git(hub)**

+ `git tag` to link code and binary across repositories
+ `git log` to view deployment changelog
+ `git pull` to deploy new version
+ `git checkout` to go back in time to any point
+ `git bisect` to pin down deployment failures

## Implications

Historical tracking of source code and built binaries in Git(hub)

**Low latency deployment of security updates**

+ No need for Linux distro to pick up and build the new version
+ Updated binary automatically built and pushed
+ Pick up latest binary directly from repository
+ Statically type-checked language prevents classes of attack

## Implications

Historical tracking of source code and built binaries in Git(hub)

Low latency deployment of security updates

**Unified development for cloud and embedded environments**

+ Write application code once
+ Recompile to swap in different versions of system libraries
+ Use compiler optimisations for exotic environments

## Implications

Historical tracking of source code and built binaries in Git(hub)

Low latency deployment of security updates

Unified development for cloud and embedded environments

**Highly responsive deployment to support legacy services**

+ DNS server interprets (e.g.) `git-commit-ref.service.name`
+ Checks out appropriate unikernel revision
+ x86 boots in 20—30ms while Synjitsu proxies TCP handshake
+ Conduit channels created, allowing (per-client?) unikernel to protect legacy VM

----

## Ongoing Stuff

Mirage OS 2.0 is an important step forward, supporting **more**, and **more
diverse**, **backends** with much **greater modularity**.

For information about the many components we could not cover here, see
[openmirage.org](http://openmirage.org/blog/):

+ __[Irmin](http://openmirage.org/blog/introducing-irmin)__, Git-like
  distributed branchable storage
+ __[OCaml-TLS](http://openmirage.org/blog/introducing-ocaml-tls)__, a
  from-scratch native OCaml TLS stack
+ __[Ctypes](http://openmirage.org/blog/modular-foreign-function-bindings)__,
  modular C foreign function bindings
+ __[Profiling](http://roscidus.com/blog/blog/2014/10/27/visualising-an-asynchronous-monad/)__
  via a visualisation tool

## Ongoing Stuff (2)

Mirage OS 2.0 is an important step forward, supporting **more**, and **more
diverse**, **backends** with much **greater modularity**.

For information about the many components we could not cover here, see
[openmirage.org](http://openmirage.org/blog/):

+ __[IMAP](https://github.com/gregtatcam/imaplet-lwt/)__ client and server with Irmin backend.
+ __[XMPP](https://github.com/hannesm/jackline)__ communication using OCaml-TLS and nocrypto.
+ __[mDNS](https://github.com/mirage/ocaml-dns)__ multicast DNS for local names.
+ __[IPv6](https://github.com/mirage/mirage-tcpip)__ throughout the TCP/IP stack.

## Get Involved!

Unikernels are an incredibly interesting way to code functionally at scale.
Nothing stresses a toolchain like building a whole OS.

- **Choices**: [Mirage OS](http://openmirage.org) in OCaml,
  [HaLVM](http://halvm.org) in Haskell, Rump Kernels/OSv for compatibility,
  ClickOS for routing.
- **Scenarios**: Static websites, dynamic content, custom routers.
  See Adam Wick at [QConSF](https://www.youtube.com/watch?v=oHcHTFleNtg) explain when *not* to use it.
- **Performance**: There's no hiding behind abstractions. HalVM *vs* Mirage is a
  fun contest in evaluating abstraction cost.

> Need contributors to build the  base of safe protocol
> implementations (TLS has been done!) and integrate verification
> and automated testing

## <http://openmirage.org/>

A Linux Foundation Incubator Project lead from the University of Cambridge and
Citrix Systems.
Featuring blog posts by:

[Amir Chaudhry](http://amirchaudhry.com/),
[Thomas Gazagnaire](http://gazagnaire.org/),
[David Kaloper](https://github.com/pqwy),
[Thomas Leonard](http://roscidus.com/blog/),
[Jon Ludlam](http://twitter.com/jonludlam),
[Hannes Mehnert](https://github.com/hannesm),
[Mindy Preston](https://github.com/yomimono),
[Dave Scott](http://dave.recoil.org/),
and [Jeremy Yallop](https://github.com/yallop).

  Thanks for listening! Questions?

  Contributions very welcome at [openmirage.org](http://openmirage.org)

  These slides are up at [decks.openmirage.org](http://decks.openmirage.org)

  Mailing list at <mirageos-devel@lists.xenproject.org>


text:
require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/fixtures/classes'

describe "Kernel#equal?" do
  it "returns true only if obj and other are the same object" do
    o1 = mock('o1')
    o2 = mock('o2')
    (o1.equal? o1).should == true
    (o2.equal? o2).should == true
    (o1.equal? o2).should== false
    (nil.equal? nil).should == true
    (o1.equal?  nil).should== false
    (nil.equal?  o2).should== false
  end

  it "returns true if obj and anObject have the same value." do
    o1 = 1
    o2 = :hola
    (:hola.equal? o1).should == false
    (1.equal? o1).should == true
    (:hola.equal? o2).should == true
  end
end

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Azure.AI.MetricsAdvisor.Administration;
using Azure.AI.MetricsAdvisor.Models;
using Azure.AI.MetricsAdvisor.Tests;
using Azure.Core.TestFramework;

namespace Azure.AI.MetricsAdvisor.Samples
{
    public partial class MetricsAdvisorSamples : MetricsAdvisorTestEnvironment
    {
        [RecordedTest]
        public async Task QueryDetectedAnomaliesAndTriggeredAlerts()
        {
            string endpoint = MetricsAdvisorUri;
            string subscriptionKey = MetricsAdvisorSubscriptionKey;
            string apiKey = MetricsAdvisorApiKey;
            var credential = new MetricsAdvisorKeyCredential(subscriptionKey, apiKey);

            var client = new MetricsAdvisorClient(new Uri(endpoint), credential);

            string anomalyAlertConfigurationId = AlertConfigurationId;

            #region Snippet:QueryDetectedAnomaliesAndTriggeredAlerts
            //@@ string anomalyAlertConfigurationId = "<anomalyAlertConfigurationId>";

            var startTime = DateTimeOffset.Parse("2020-01-01T00:00:00Z");
            var endTime = DateTimeOffset.UtcNow;
            var options = new GetAlertsOptions(startTime, endTime, TimeMode.AnomalyTime);

            int alertCount = 0;

            await foreach (AnomalyAlert alert in client.GetAlertsAsync(anomalyAlertConfigurationId, options))
            {
                Console.WriteLine($"Alert at timestamp: {alert.Timestamp}");
                Console.WriteLine($"Id: {alert.Id}");
                Console.WriteLine($"Anomalies that triggered this alert:");

                await foreach (DataAnomaly anomaly in client.GetAnomaliesForAlertAsync(anomalyAlertConfigurationId, alert.Id))
                {
                    Console.WriteLine("  Anomaly:");
                    Console.WriteLine($"    Status: {anomaly.Status.Value}");
                    Console.WriteLine($"    Severity: {anomaly.Severity}");
                    Console.WriteLine($"    Series key:");

                    foreach (KeyValuePair<string, string> keyValuePair in anomaly.SeriesKey.AsDictionary())
                    {
                        Console.WriteLine($"      Dimension '{keyValuePair.Key}': {keyValuePair.Value}");
                    }

                    Console.WriteLine();
                }

                // Print at most 3 alerts.
                if (++alertCount >= 3)
                {
                    break;
                }
            }
            #endregion
        }
    }
}


text:
<link rel="import" href="ct-builder-grid.html">
<link rel="import" href="ct-commit-list.html">
<link rel="import" href="ct-test-list.html">
<link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">
<link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
<link rel="import" href="../bower_components/paper-input/paper-input.html">

<polymer-element name="ct-failure-card" attributes="group commitLog tree bug">
  <template>

    <ct-builder-grid failures="{{ group.failures }}"></ct-builder-grid>

      <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-list>
      <ct-commit-list commitList="{{ _commitList }}"></ct-commit-list>

      <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper-button>
      <template if="{{ !group.isSnoozed }}">
        <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-button>
      </template>
      <template if="{{ group.isSnoozed }}">
        <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></paper-button>
      </template>
      <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></paper-button>
      <template if="{{ group.bug !== undefined }}">

            {{ group.bugLabel }}

      </template>

    <paper-dialog heading="Enter bug number" transition="paper-transition-center" id="bugDialog">
      <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-input>
      <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id="dialogRemoveBug"></paper-button>
      <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"></paper-button>
    </paper-dialog>
  </template>

</polymer-element>


text:
.. _`other_information`:

Additional information
----------------------

.. toctree::
   :glob:
   :maxdepth: 1

   other_information/*


text:
package org.apache.camel.component.jcache;

public interface JCacheProvider {
    String shortName();

    String className();
}


text:
package org.apache.olingo.commons.core.edm;

import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmNamed;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;

public abstract class AbstractEdmNamed extends AbstractEdmAnnotatable implements EdmNamed {

  private final String name;

  public AbstractEdmNamed(final Edm edm, final String name, final CsdlAnnotatable annotatable) {
    super(edm, annotatable);
    this.name = name;
  }

  @Override
  public String getName() {
    return name;
  }

  @Override
  public String toString() {
    return name;
  }

}


text:
layout: post
title: 查询Top sql
date: 2008-07-23 09:16:56.000000000 +09:30
type: post
published: true
status: publish
categories:
- Oracle
tags:
- oracle
- sql
meta:
  posturl_add_url: 'yes'
  _edit_last: '1'
  views: '890'
---

From: network

Top 10 by Buffer Gets:

set linesize 100

set pagesize 100

col sql format a40

SELECT * FROM

(SELECT substr(sql_text,1,40) sql,

buffer_gets, executions, buffer_gets/executions "Gets/Exec",

hash_value,address

FROM V$SQLAREA

WHERE buffer_gets > 10000

ORDER BY buffer_gets DESC)

WHERE rownum <= 10 ;

Top 10 by Physical Reads:

set linesize 100

set pagesize 100

col sql format a40

SELECT * FROM (SELECT substr(sql_text,1,40) sql,

disk_reads, executions, disk_reads/executions "Reads/Exec",

hash_value,address

FROM V$SQLAREA

WHERE disk_reads > 1000

ORDER BY disk_reads DESC)

WHERE rownum <= 10 ;

Top 10 by Executions:

set linesize 100

set pagesize 100

col sql format a40

SELECT * FROM (SELECT substr(sql_text,1,40) sql,

executions, rows_processed, rows_processed/executions "Rows/Exec",

hash_value,address

FROM V$SQLAREA

WHERE executions > 100

ORDER BY executions DESC)

WHERE rownum <= 10 ;

Top 10 by Parse Calls:

set linesize 100

set pagesize 100

col sql format a40

SELECT * FROM (SELECT substr(sql_text,1,40) sql,

parse_calls, executions, hash_value,address

FROM V$SQLAREA

WHERE parse_calls > 1000

ORDER BY parse_calls DESC)

WHERE rownum <= 10 ;

Top 10 by Sharable Memory:

set linesize 100

set pagesize 100

col sql format a40

SELECT * FROM (SELECT substr(sql_text,1,40) sql,

sharable_mem, executions, hash_value,address

FROM V$SQLAREA

WHERE sharable_mem > 1048576

ORDER BY sharable_mem DESC)

WHERE rownum <= 10 ;

Top 10 by Version Count:

set linesize 100

set pagesize 100

col sql format a40

SELECT * FROM (SELECT substr(sql_text,1,40) sql,

version_count, executions, hash_value,address

FROM V$SQLAREA

WHERE version_count > 20

ORDER BY version_count DESC)

WHERE rownum <= 10 ;


text:
function [cs_average_init, ce_init, T_init, film_init, Q_init, n_diff] =   differentialInitialConditions(param)
%	differentialInitialConditions initializes the values of the differential variables

%   This file is part of the LIONSIMBA Toolbox
%
%	Official web-site: 	http://sisdin.unipv.it/labsisdin/lionsimba.php
% 	Official GitHUB: 	https://github.com/lionsimbatoolbox/LIONSIMBA
%
%   LIONSIMBA: A Matlab framework based on a finite volume model suitable for Li-ion battery design, simulation, and control
%   Copyright (C) 2016-2018 :Marcello Torchio, Lalo Magni, Davide Raimondo,
%                            University of Pavia, 27100, Pavia, Italy
%                            Bhushan Gopaluni, Univ. of British Columbia,
%                            Vancouver, BC V6T 1Z3, Canada
%                            Richard D. Braatz,
%                            Massachusetts Institute of Technology,
%                            Cambridge, Massachusetts 02142, USA
%
%   Main code contributors to LIONSIMBA 2.0:
%                           Ian Campbell, Krishnakumar Gopalakrishnan,
%                           Imperial college London, London, UK
%
%   LIONSIMBA is a free Matlab-based software distributed with an MIT
%   license.

% Check the type of model used for solid diffusion
if(param.SolidPhaseDiffusion==1 || param.SolidPhaseDiffusion==2)
    % This initialization is used when reduced models are employed
    cs_average_init     = [param.cs_p_init*ones(param.Np,1);param.cs_n_init*ones(param.Nn,1)];
elseif (param.SolidPhaseDiffusion==3)
    % If the full model is used (Fick's law), then the initial conditions are
    % modified in order to account for the solid phase diffusion
    % equation structure.
    cs_average_init     = [param.cs_p_init*ones(param.Np*param.Nr_p,1);param.cs_n_init*ones(param.Nn*param.Nr_n,1)];
end
% Initial values for the other differential variables.
ce_init             = param.ce_init*[ones(param.Np,1);ones(param.Ns,1);ones(param.Nn,1)];
T_init              = param.T_init * ones(param.Nsum+param.Nal+param.Ncu,1);
film_init           = zeros(param.Nn,1);
Q_init              = zeros(param.Np+param.Nn,1);

% Store the number of differential variables in each cell.
n_diff= sum([length(cs_average_init) length(ce_init) length(T_init) length(film_init) length(Q_init)]);
end


text:
package org.mojavemvc.tests.controllers;

import javax.servlet.http.HttpServletRequest;

import org.mojavemvc.annotations.Action;
import org.mojavemvc.annotations.AfterConstruct;
import org.mojavemvc.annotations.DefaultAction;
import org.mojavemvc.annotations.Param;
import org.mojavemvc.annotations.StatefulController;
import org.mojavemvc.tests.services.SomeService;
import org.mojavemvc.views.JSP;
import org.mojavemvc.views.View;

import com.google.inject.Inject;

/**
 * @author Luis Antunes
 */
@StatefulController("some-stateful")
public class SomeStatefulController {

    @Inject
    private HttpServletRequest request;

    @Inject
    private SomeService someService;

    private String someStatefulVar;

    private int initVal = 0;

    @AfterConstruct
    public void init() {
        initVal++;
    }

    @Action("test-init")
    public View testInitAction() {
        return new JSP("param").withAttribute("var", "init-called: " + initVal);
    }

    @DefaultAction
    public View defaultAction() {
        return new JSP("index");
    }

    @Action("some-action")
    public View someAction() {
        return new JSP("stateful");
    }

    @Action("set-var")
    public View setVarAction(@Param("var") String var) {

        someStatefulVar = var;
        return new JSP("stateful");
    }

    @Action("get-var")
    public View getVarAction() {

        return new JSP("param").withAttribute("var", someStatefulVar);
    }

    @Action("get-req")
    public View getReqAction() {

        return newParamViewWithHexHashcodeOf(request);
    }

    @Action("get-inj")
    public View getInjAction() {

        return newParamViewWithHexHashcodeOf(someService);
    }

    private View newParamViewWithHexHashcodeOf(Object object) {

        String objectName = object.toString();
        String hexHashcode = objectName.substring(objectName.indexOf('@') + 1);

        return new JSP("param").withAttribute("var", hexHashcode);
    }
}


text:
using NUnit.Framework;
using PersonalFinanceManager.IntegrationTests.Infrastructure;
using TechTalk.SpecFlow;

namespace PersonalFinanceManager.IntegrationTests.Scenarios.Steps
{
    [Binding, Scope(Feature = "CreateInternalTransferExpenditures")]
    public class CreateInternalTransferExpendituresSteps
    {
        private int _sourceAccountId, _countExpenditures, _countIncomes, _countMovements, _targetAccountId;
        private decimal _sourceAccountAmount, _targetAccountAmount;

        [Given(@"I have accessed the Expenditures List page")]
        public void GivenIHaveAccessedTheExpendituresListPage()
        {
            SiteMap.AccountManagementDashboardPage.GoTo();
            _sourceAccountId = SiteMap.AccountManagementDashboardPage.SelectAccount();
            _sourceAccountAmount = DatabaseChecker.GetBankAccountAmount(_sourceAccountId);

            SiteMap.ExpenseListPage.GoTo();

            _countExpenditures = DatabaseChecker.CountExpenditures();
            _countIncomes = DatabaseChecker.CountIncomes();
            _countMovements = DatabaseChecker.CountMovements();
        }

        [Given(@"I have clicked on the Create button")]
        public void GivenIHaveClickedOnTheCreateButton()
        {
            SiteMap.ExpenseListPage.ClickAddButton();
        }

        [When(@"I enter Description")]
        public void WhenIEnterDescription()
        {
            SiteMap.ExpenseCreatePage.EnterDescription("Internal Transfer");
        }

        [When(@"I enter a Cost")]
        public void WhenIEnterACost()
        {
            SiteMap.ExpenseCreatePage.EnterCost(100);
        }

        [When(@"I select the first expenditure type")]
        public void WhenISelectTheFirstExpenditureType()
        {
            SiteMap.ExpenseCreatePage.SelectFirstExpenseType();
        }

        [When(@"I select the Internal Transfer payment type")]
        public void WhenISelectTheInternalTransferPaymentType()
        {
            SiteMap.ExpenseCreatePage.SelectPaymentMethod("Internal Transfer");
        }

        [When(@"I select the first target account")]
        public void WhenISelectTheFirstTargetAccount()
        {
            _targetAccountId = SiteMap.ExpenseCreatePage.SelectFirstTargetAccount();
            _targetAccountAmount = DatabaseChecker.GetBankAccountAmount(_targetAccountId);
        }

        [When(@"I click on the Save button")]
        public void WhenIClickOnTheSaveButton()
        {
            SiteMap.ExpenseCreatePage.ClickSave();
        }

        [Then(@"the Expenditure Has Been Created")]
        public void ThenTheExpenditureHasBeenCreated()
        {
            var newCountExpenditures = DatabaseChecker.CountExpenditures();
            Assert.AreEqual(newCountExpenditures, _countExpenditures + 1);
        }

        [Then(@"the source account is updated")]
        public void ThenTheSourceAccountIsUpdated()
        {
            var newSourceAccountAmount = DatabaseChecker.GetBankAccountAmount(_sourceAccountId);
            Assert.AreEqual(newSourceAccountAmount, _sourceAccountAmount - 100);
        }

        [Then(@"the target account is updated")]
        public void ThenTheTargetAccountIsUpdated()
        {
            var newTargetAccountAmount = DatabaseChecker.GetBankAccountAmount(_targetAccountId);
            Assert.AreEqual(newTargetAccountAmount, _targetAccountAmount + 100);
        }

        [Then(@"an income has been created")]
        public void ThenAnIncomeHasBeenCreated()
        {
            var newCountIncomes = DatabaseChecker.CountIncomes();
            Assert.AreEqual(newCountIncomes, _countIncomes + 1);
        }

        [Then(@"a mouvement entry has been saved")]
        public void ThenAMouvementEntryHasBeenSaved()
        {
            var newCountMovements = DatabaseChecker.CountMovements();
            Assert.AreEqual(newCountMovements, _countMovements + 1);
        }
    }
}


text: repository to test composer


text:
package wepa.wepa.controller;

import java.util.UUID;
import javax.servlet.Filter;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import wepa.wepa.domain.Course;
import wepa.wepa.domain.Week;
import wepa.wepa.repository.CourseRepository;
import wepa.wepa.repository.WeekRepository;

@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("nosec")
@ContextConfiguration
@WebAppConfiguration
public class WeekControllerTest {

    private MockMvc mock;

    @Autowired
    private CourseRepository courseRepository;

    @Autowired
    private WeekRepository weekRepository;

    @Autowired
    private WebApplicationContext webAppContext;

    @Autowired
    private Filter springSecurityFilterChain;

    @Before
    public void setUp() {
        this.mock = MockMvcBuilders.webAppContextSetup(webAppContext).addFilters(springSecurityFilterChain).build();
    }

    public void createWeek(Course course, Week week) {

        String name = UUID.randomUUID().toString();
        course.setName(name);
        courseRepository.save(course);

        String description = UUID.randomUUID().toString();
        week.setDescription(description);
        week.setCourse(course);
        weekRepository.save(week);
    }

    @Test
    public void getWeekOk() throws Exception {
        Course course = new Course();
        Week week = new Week();
        createWeek(course, week);

        mock.perform(get("/courses/" + course.getId() + "/week/ " + week.getWeek())).andExpect(status().is2xxSuccessful());
    }

    @Test
    public void getWeekModifyFormOk() throws Exception {
        Course course = new Course();
        Week week = new Week();
        createWeek(course, week);
        mock.perform(get("/courses/" + course.getId() + "/week/ " + week.getWeek() + "/modifyWeek")).andExpect(status().is2xxSuccessful());
    }

    @Test
    public void editWeekWrong() throws Exception {
        Course course = new Course();
        Week week = new Week();
        createWeek(course, week);
        mock.perform(post("/courses/" + course.getId() + "/week/ " + week.getWeek() + "/modifyWeek").contentType(MediaType.APPLICATION_FORM_URLENCODED).param("description", ""));

        Week retrieved = weekRepository.findOne(week.getId());

        assertFalse(retrieved.getDescription().equals(""));
    }

    @Test
    public void editWeek() throws Exception {
        Course course = new Course();
        Week week = new Week();
        createWeek(course, week);
        String description = UUID.randomUUID().toString();
        mock.perform(post("/courses/" + course.getId() + "/week/ " + week.getWeek() + "/modifyWeek").contentType(MediaType.APPLICATION_FORM_URLENCODED).param("description", description));

        Week retrieved = weekRepository.findOne(week.getId());

        assertTrue(retrieved.getDescription().equals(description));
    }
}


text:
package org.codehaus.mojo.natives.mingw;

import java.io.File;
import org.codehaus.plexus.util.cli.Commandline;

import org.codehaus.mojo.natives.NativeBuildException;
import org.codehaus.mojo.natives.compiler.AbstractCompiler;
import org.codehaus.mojo.natives.compiler.CompilerConfiguration;
import org.codehaus.mojo.natives.parser.Parser;
import org.codehaus.mojo.natives.parser.CParser;

public abstract class AbstractGccCompiler
    extends AbstractCompiler
{

    /**
     * resuable parser in one Compilation session
     */

    private Parser parser = new CParser();

    protected abstract String getOutputFileOption();

    protected Parser getParser()
    {
        return this.parser;
    }

    /**
     * Setup Compiler Command line
     */
    protected Commandline getCommandLine( File srcFile, File destFile, CompilerConfiguration config )
        throws NativeBuildException
    {

        if ( config.getExecutable() == null )
        {
            config.setExecutable( "gcc" );
        }

        Commandline cl = new Commandline();

        cl.setExecutable( config.getExecutable() );

        if ( config.getWorkingDirectory() != null )
        {
            cl.setWorkingDirectory( config.getWorkingDirectory().getPath() );
        }

        this.setStartOptions( cl, config );

        this.setIncludePaths( cl, config.getIncludePaths() );

        this.setIncludePaths( cl, config.getSystemIncludePaths() );

        this.setMiddleOptions( cl, config );

        this.setOutputArgs( cl, destFile );

        this.setSourceArgs( cl, srcFile );

        this.setEndOptions( cl, config );

        return cl;
    }

    private void setOptions( Commandline cl, String[] options )
    {
        if ( options != null )
        {
            for ( String option : options )
            {
                cl.createArg().setValue( option );
            }
        }
    }

    private void setStartOptions( Commandline cl, CompilerConfiguration config )
    {
        this.setOptions( cl, config.getStartOptions() );
    }

    private void setMiddleOptions( Commandline cl, CompilerConfiguration config )
    {
        this.setOptions( cl, config.getMiddleOptions() );
    }

    private void setEndOptions( Commandline cl, CompilerConfiguration config )
    {
        this.setOptions( cl, config.getEndOptions() );
    }

    private void setIncludePaths( Commandline cl, File[] includePaths )
    {
        if ( includePaths != null )
        {
            for ( File includePath : includePaths )
            {
                cl.createArg().setValue( "-I" + includePath.getPath() );
            }
        }
    }

    private void setOutputArgs( Commandline cl, File outputFile )
    {
        String outputFileOption = this.getOutputFileOption();

        if ( outputFileOption.endsWith( " " ) )
        {
            cl.createArg().setValue( outputFileOption.trim() );
            cl.createArg().setValue( outputFile.getPath() );
        }
        else
        {
            cl.createArg().setValue( outputFileOption + outputFile.getPath() );
        }
    }

    private void setSourceArgs( Commandline cl, File srcFile )
    {
        cl.createArg().setValue( "-c" );
        cl.createArg().setValue( srcFile.getPath() );
    }
}


text: Want to bulk erase your 1-to-1 hipchat conversations? Here's a way.


text:
<!DOCTYPE html>
<title>
  Multi-line row flex fragmentation: tall content inside constrained block.
</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">

Test passes if there is a filled green square and no red.


text:
set -o errexit
set -o pipefail

cd site
npm i
echo "Starting check."
# Find all potential entrypoint READMEs while stripping out themes directory until it's removed
# Convert them to valid URLs
# Check each link for Docsify 404s

find . -name README.md -printf "%P\n" | grep -v node_modules |
    sed "s/README.md//" | sed "s/^/http:\/\/localhost:3000\//" |
    xargs -n1 sh -c '! (echo Checking $0 && npx href-checker $0 --bad-content="404 - Not found" --silent --no-off-site -c=15 | grep .) || exit 255'

echo "Success."


text:
/**
 * @generated SignedSource<<9993b962aa7cf31a755a9d89ead2a614>>
 * @lightSyntaxTransform
 * @nogrep
 */

/* tslint:disable */
/* eslint-disable */
// @ts-nocheck

import { Fragment, ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type FairOrganizerApp_fairOrganizer$data = {
  readonly description: string | null;
  readonly name: string | null;
  readonly profile: {
    readonly image: {
      readonly url: string | null;
    } | null;
  } | null;
  readonly slug: string;
  readonly " $fragmentSpreads": FragmentRefs<"FairOrganizerHeaderImage_fairOrganizer" | "FairOrganizerHeader_fairOrganizer" | "FairOrganizerLatestArticles_fairOrganizer" | "FairOrganizerPastEventsRail_fairOrganizer">;
  readonly " $fragmentType": "FairOrganizerApp_fairOrganizer";
};
export type FairOrganizerApp_fairOrganizer$key = {
  readonly " $data"?: FairOrganizerApp_fairOrganizer$data;
  readonly " $fragmentSpreads": FragmentRefs<"FairOrganizerApp_fairOrganizer">;
};

const node: ReaderFragment = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": null,
  "name": "FairOrganizerApp_fairOrganizer",
  "selections": [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "name",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "slug",
      "storageKey": null
    },
    {
      "alias": "description",
      "args": [
        {
          "kind": "Literal",
          "name": "format",
          "value": "PLAIN"
        }
      ],
      "kind": "ScalarField",
      "name": "about",
      "storageKey": "about(format:\"PLAIN\")"
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "Profile",
      "kind": "LinkedField",
      "name": "profile",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "Image",
          "kind": "LinkedField",
          "name": "image",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "kind": "Literal",
                  "name": "version",
                  "value": "wide"
                }
              ],
              "kind": "ScalarField",
              "name": "url",
              "storageKey": "url(version:\"wide\")"
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "args": null,
      "kind": "FragmentSpread",
      "name": "FairOrganizerPastEventsRail_fairOrganizer"
    },
    {
      "args": null,
      "kind": "FragmentSpread",
      "name": "FairOrganizerHeaderImage_fairOrganizer"
    },
    {
      "args": null,
      "kind": "FragmentSpread",
      "name": "FairOrganizerHeader_fairOrganizer"
    },
    {
      "args": null,
      "kind": "FragmentSpread",
      "name": "FairOrganizerLatestArticles_fairOrganizer"
    }
  ],
  "type": "FairOrganizer",
  "abstractKey": null
};

(node as any).hash = "bd849d7afe3472495fb15da8a2be9710";

export default node;


text:
package com.gunshippenguin.jchat.server;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.gunshippenguin.jchat.shared.ClientInfo;
import com.gunshippenguin.jchat.shared.InitClientInfo;
import com.gunshippenguin.jchat.shared.InitServerInfo;

/**
 * Class that waits for incoming connections from clients and adds them to the
 * ChatServer.
 *
 * @author GunshipPenguin
 */
public class ClientAccepter implements Runnable {
	/**
	 * ChatServer object associated with this ClientAccepter.
	 */
	private ChatServer chatServer;
	/**
	 * ServerSocket to listen for incoming connections on.
	 */
	private ServerSocket serverSocket;
	/**
	 * ObjectInputStream connected to socket. Used to receive Requests from the
	 * client.
	 */
	private ObjectInputStream in;
	/**
	 * ObjectOutput stream connected to socket. Used to sent Events to the
	 * client.
	 */
	private ObjectOutputStream out;
	/**
	 * Logger object to be used by the ClientAccepter class.
	 */
	private static final Logger logger = Logger.getLogger(ChatServer.class.getName());

	/**
	 * Creates a new ClientAccepter object that accepts clients for the chat
	 * server represented by ChatServer.
	 *
	 * @param chatServer
	 *            the ChatServer object that this ClientAccepter will accept
	 *            clients for
	 */
	public ClientAccepter(ChatServer chatServer) {
		this.chatServer = chatServer;
		int port = Integer.parseInt(chatServer.getProperties().getProperty("port"));
		try {
			serverSocket = new ServerSocket(port);
			logger.log(Level.INFO, "Listening for clients on port " + port);
		} catch (IOException e) {
			logger.log(Level.SEVERE,
					"Could not listen for clients on port " + Integer.toString(port) + " (Is it already in use?)", e);
			e.printStackTrace();
		}
	}

	/**
	 * Listens for clients connecting to serverSocket, receives, their
	 * InitClientInfo, adds them to the ChatServer chatServer and sends them an
	 * InitServerInfo object.
	 */
	@Override
	public void run() {
		Socket newClientSocket;
		Client newClient;
		while (true) {
			try {
				newClientSocket = serverSocket.accept();
				out = new ObjectOutputStream(newClientSocket.getOutputStream());
				in = new ObjectInputStream(newClientSocket.getInputStream());

				// Get InitClientInfo from the client
				InitClientInfo ici = (InitClientInfo) in.readUnshared();

				// Create a ClientInfo object for the new client
				ClientInfo newClientInfo = new ClientInfo(ici.getNick());

				// Create the InitServerInfo to send to the new client
				InitServerInfo isi = new InitServerInfo(newClientInfo,
						chatServer.getDefaultChatRoom().getChatRoomInfo());

				// Ensure that the nick requested by the user is not already
				// taken
				if (chatServer.getDefaultChatRoom().hasClient(ici.getNick())) {
					isi.setFlag(InitServerInfo.BAD_NICK);
					String appendString;
					int counter = 1;
					do {
						appendString = "_" + Integer.toString(counter);
					} while (chatServer.getDefaultChatRoom().hasClient(ici.getNick() + appendString));
					isi.setNick(ici.getNick() + appendString);
				}

				// Create a Client object for the new client
				newClient = new Client(out, in, newClientSocket, newClientInfo, chatServer);

				// Add the client to the default chat room
				chatServer.getDefaultChatRoom().addClient(newClient);

				// Send the InitServerInfo to the client
				out.writeUnshared(isi);

				// Start the client's thread and add it to the chatServer's list
				// of clients
				Thread clientThread = new Thread(newClient);
				clientThread.setDaemon(true);
				clientThread.setName("ClientThread - " + newClientInfo.getNick());
				clientThread.start();

				// Log information about the client that just connected
				logger.log(Level.INFO, "New client connected. Nick:" + newClientInfo.getNick() + " Addr:"
						+ newClientSocket.getInetAddress().toString());
			} catch (IOException e) {
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			}
		}
	}

}


text:
function createComboBox(selector) {
    var source = new Array();
    for (var i = 0; i < 10; i++) {
        var movie = 'avatar.png';
        var title = 'Avatar';
        var year = 2009;
        switch (i) {
            case 1:
                movie = 'endgame.png';
                title = 'End Game';
                year = 2006;
                break;
            case 2:
                movie = 'priest.png';
                title = 'Priest';
                year = 2011;
                break;
            case 3:
                movie = 'unknown.png';
                title = 'Unknown';
                year = 2011;
                break;
            case 4:
                movie = 'unstoppable.png';
                title = 'Unstoppable';
                year = 2010;
                break;
            case 5:
                movie = 'twilight.png';
                title = 'Twilight';
                year = 2008;
                break;
            case 6:
                movie = 'kungfupanda.png';
                title = 'Kung Fu Panda';
                year = 2008;
                break;
            case 7:
                movie = 'knockout.png';
                title = 'Knockout';
                year = 2011;
                break;
            case 8:
                movie = 'theplane.png';
                title = 'The Plane';
                year = 2010;
                break;
            case 9:
                movie = 'bigdaddy.png';
                title = 'Big Daddy';
                year = 1999;
                break;
        }
        var html = "

"
            + "Title
" + title + "

Year
" + year.toString() + "

";
        source[i] = { html: html, title: title };
    }
    // initialization options - validated in typescript
    // jqwidgets.ComboBoxOptions has generated TS definition
    var options = {
        source: source, selectedIndex: 0, width: '250', height: '25px'
    };
    // creates an instance
    var myComboBox = jqwidgets.createInstance(selector, 'jqxComboBox', options);
}
//# sourceMappingURL=typescript-combobox.js.map


text:
'use strict';

var fs   = require('fs');
var args = require('yargs').argv;
var path = require('path');
var resolve = require('resolve').sync;

module.exports = {
  mkdirp: function (path, root) {
    var dirs = path.split('/');
    var dir  = dirs.shift();

    root = (root || '') + dir + '/';

    try {
      fs.mkdirSync(root);
    } catch (e) {
      // dir wasn't made, something went wrong
      if (!fs.statSync(root).isDirectory()) {
        throw new Error(e);
      }
    }

    return !dirs.length || this.mkdirp(dirs.join('/'), root);
  },

  getEnvironment: function () {
    return args.env || process.env.NODE_ENV || 'development';
  },

  getSequelize: function (file) {
    var sequelizePath;
    var resolvePath = file ? path.join('sequelize', file) : 'sequelize';
    var resolveOptions = { basedir: process.cwd() };

    try {
      sequelizePath = require.resolve(resolvePath, resolveOptions);
    } catch (e) {
    }

    try {
      sequelizePath = sequelizePath || resolve(resolvePath, resolveOptions);
    } catch (e) {
      console.error('Unable to resolve sequelize package in ' + process.cwd());
      process.exit(1);
    }

    return require(sequelizePath);
  },

  execQuery: function (sequelize, sql, options) {
    if (sequelize.query.length === 2) {
      return sequelize.query(sql, options);
    } else {
      return sequelize.query(sql, null, options);
    }
  }
};


text:
var express = require('express')

var routes = require('./api/routes')

var app = express()

app.use('/api', routes)

const port = 3000
app.listen(port, () => console.log(`server running on port ${port}`))


text:
* [
      marvelapp
      /
      FancyTabBar
](https://github.com/marvelapp/FancyTabBar):
      An expandable and customisable tabbar for iOS

* [
      AFNetworking
      /
      AFNetworking
](https://github.com/AFNetworking/AFNetworking):
      A delightful iOS and OS X networking framework

* [
      zoonooz
      /
      ZFDragableModalTransition
](https://github.com/zoonooz/ZFDragableModalTransition):
      Custom animation transition for present modal view controller

* [
      mamaral
      /
      Organic
](https://github.com/mamaral/Organic):
      The intuitive UITableViewController.

* [
      Roobiq
      /
      RBQFetchedResultsController
](https://github.com/Roobiq/RBQFetchedResultsController):
      Drop-in replacement for NSFetchedResultsController backed by RealmDB.

* [
      Yalantis
      /
      Pull-to-Refresh.Rentals-iOS
](https://github.com/Yalantis/Pull-to-Refresh.Rentals-iOS):
* [
      Yalantis
      /
      Context-Menu.iOS
](https://github.com/Yalantis/Context-Menu.iOS):
* [
      nuwehq
      /
      nuwe-charts-ios
](https://github.com/nuwehq/nuwe-charts-ios):
      A dynamic chart library for easily creating the Nuwe Score dial chart and History Bar Chart

* [
      ArthurGuibert
      /
      FSInteractiveMap
](https://github.com/ArthurGuibert/FSInteractiveMap):
      A charting library to visualize and interact with a vector map on iOS. It's like Geochart but for iOS!

* [
      mutualmobile
      /
      MMWormhole
](https://github.com/mutualmobile/MMWormhole):
      Message passing between iOS apps and extensions.

* [
      CoderMJLee
      /
      MJExtension
](https://github.com/CoderMJLee/MJExtension):
      Conversion between JSON and model

* [
      ccgus
      /
      fmdb
](https://github.com/ccgus/fmdb):
      A Cocoa / Objective-C wrapper around SQLite

* [
      xmartlabs
      /
      XLForm
](https://github.com/xmartlabs/XLForm):
      XLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C.

* [
      OpenEmu
      /
      OpenEmu
](https://github.com/OpenEmu/OpenEmu):
      Emulator framework for Mac OS X

* [
      CoderMJLee
      /
      MJRefresh
](https://github.com/CoderMJLee/MJRefresh):
      The easiest way to use pull-to-refresh

* [
      spenciefy
      /
      SYWaveformPlayer
](https://github.com/spenciefy/SYWaveformPlayer):
      Simple waveform audio player using SCWaveformView

* [
      ReactiveCocoa
      /
      ReactiveCocoa
](https://github.com/ReactiveCocoa/ReactiveCocoa):
      A framework for composing and transforming streams of values

* [
      AlvaroFranco
      /
      AFDropdownNotification
](https://github.com/AlvaroFranco/AFDropdownNotification):
      Dropdown notification view for iOS

* [
      Just-
      /
      UIViewController-KeyboardAnimation
](https://github.com/Just-/UIViewController-KeyboardAnimation):
      Showing/dismissing keyboard animation in UIViewController category.

* [
      uranusjr
      /
      macdown
](https://github.com/uranusjr/macdown):
      Open source Markdown editor for OS X.

* [
      realm
      /
      realm-cocoa
](https://github.com/realm/realm-cocoa):
      Realm is a mobile database: a replacement for Core Data & SQLite

* [
      supermarin
      /
      Alcatraz
](https://github.com/supermarin/Alcatraz):
      Package manager for Xcode

* [
      hackiftekhar
      /
      IQKeyboardManager
](https://github.com/hackiftekhar/IQKeyboardManager):
      Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.

* [
      VAlexander
      /
      Chameleon
](https://github.com/VAlexander/Chameleon):
      A Lightweight x Powerful Flat Color Framework for iOS

* [
      ZhipingYang
      /
      UUChatTableView
](https://github.com/ZhipingYang/UUChatTableView):
      Cocoa UI component for chat bubbles with text, images and audio support

####go
* [
      tylertreat
      /
      Comcast
](https://github.com/tylertreat/Comcast):
      Simulating shitty network connections so you can build better systems.

* [
      docker
      /
      docker
](https://github.com/docker/docker):
      Docker - the open-source application container engine

* [
      prometheus
      /
      prometheus
](https://github.com/prometheus/prometheus):
      The Prometheus monitoring system and time series database.

* [
      cockroachdb
      /
      cockroach
](https://github.com/cockroachdb/cockroach):
      A Scalable, Geo-Replicated, Transactional Datastore

* [
      awslabs
      /
      aws-sdk-go
](https://github.com/awslabs/aws-sdk-go):
      An incredibly experimental, automatically generated set of AWS clients in Go.

* [
      gophergala
      /
      go-algos
](https://github.com/gophergala/go-algos):
* [
      GoogleCloudPlatform
      /
      kubernetes
](https://github.com/GoogleCloudPlatform/kubernetes):
      Container Cluster Manager

* [
      gophergala
      /
      ImgurGo
](https://github.com/gophergala/ImgurGo):
      An open source image-uploader by the Imgur team

* [
      golang
      /
      go
](https://github.com/golang/go):
      The Go programming language

* [
      coreos
      /
      etcd
](https://github.com/coreos/etcd):
      A highly-available key value store for shared configuration and service discovery

* [
      gogits
      /
      gogs
](https://github.com/gogits/gogs):
      Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.

* [
      syncthing
      /
      syncthing
](https://github.com/syncthing/syncthing):
      Open Source Continuous File Synchronization

* [
      hashicorp
      /
      consul
](https://github.com/hashicorp/consul):
      Consul is a tool for service discovery, monitoring and configuration.

* [
      odeke-em
      /
      drive
](https://github.com/odeke-em/drive):
      Pull or push Google Drive files

* [
      mozilla-services
      /
      heka
](https://github.com/mozilla-services/heka):
      Data collection and processing made easy.

* [
      coreos
      /
      rocket
](https://github.com/coreos/rocket):
      App Container runtime

* [
      influxdb
      /
      influxdb
](https://github.com/influxdb/influxdb):
      Scalable datastore for metrics, events, and real-time analytics

* [
      hashicorp
      /
      terraform
](https://github.com/hashicorp/terraform):
      Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.

* [
      go-martini
      /
      martini
](https://github.com/go-martini/martini):
      Classy web framework for Go

* [
      rsms
      /
      gotalk
](https://github.com/rsms/gotalk):
      Async peer communication protocol & library

* [
      huandu
      /
      xstrings
](https://github.com/huandu/xstrings):
      xstrings: A collection of useful string functions for Go.

* [
      google
      /
      cadvisor
](https://github.com/google/cadvisor):
      Analyzes resource usage and performance characteristics of running containers.

* [
      gophergala
      /
      nut
](https://github.com/gophergala/nut):
      Vendor Go dependencies

* [
      spf13
      /
      hugo
](https://github.com/spf13/hugo):
      A Fast and Flexible Static Site Generator built with love by spf13 in GoLang

* [
      boltdb
      /
      bolt
](https://github.com/boltdb/bolt):
      A low-level key/value database for Go.

####javascript
* [
      facebook
      /
      react
](https://github.com/facebook/react):
      A declarative, efficient, and flexible JavaScript library for building user interfaces.

* [
      arasatasaygin
      /
      is.js
](https://github.com/arasatasaygin/is.js):
      Micro check library

* [
      etsy
      /
      Hound
](https://github.com/etsy/Hound):
      Lightning fast code searching made easy

* [
      twostairs
      /
      paperwork
](https://github.com/twostairs/paperwork):
      Paperwork - OpenSource note-taking & archiving alternative to Evernote, Microsoft OneNote & Google Keep

* [
      Bishop92
      /
      JavaScript-Data-Structures
](https://github.com/Bishop92/JavaScript-Data-Structures):
      A library for data structure in JavaScript

* [
      shipitjs
      /
      shipit
](https://github.com/shipitjs/shipit):
      Universal automation and deployment tool written in JavaScript.

* [
      gorhill
      /
      uBlock
](https://github.com/gorhill/uBlock):
      µBlock - An efficient blocker for Chromium, Firefox, and Safari. Fast and lean.

* [
      angular
      /
      angular.js
](https://github.com/angular/angular.js):
      HTML enhanced for web apps

* [
      aurelia
      /
      framework
](https://github.com/aurelia/framework):
      The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.

* [
      plouc
      /
      mozaik
](https://github.com/plouc/mozaik):
      Mozaïk is a tool based on nodejs / react / d3 / stylus to easily craft beautiful dashboards.

* [
      rackt
      /
      react-router
](https://github.com/rackt/react-router):
      A complete routing solution for React.js

* [
      enaqx
      /
      awesome-react
](https://github.com/enaqx/awesome-react):
      A collection of awesome React libraries, resources and shiny things.

* [
      yaronn
      /
      blessed-contrib
](https://github.com/yaronn/blessed-contrib):
      Build terminal dashboards using ascii/ansi art and javascript

* [
      mbostock
      /
      d3
](https://github.com/mbostock/d3):
      A JavaScript visualization library for HTML and SVG.

* [
      facebook
      /
      fixed-data-table
](https://github.com/facebook/fixed-data-table):
      A React table component designed to allow presenting thousands of rows of data.

* [
      getify
      /
      You-Dont-Know-JS
](https://github.com/getify/You-Dont-Know-JS):
      A book series on JavaScript. @YDKJS on twitter.

* [
      iojs
      /
      io.js
](https://github.com/iojs/io.js):
      A friendly fork of Node.js with an open governance model

* [
      facebook
      /
      flux
](https://github.com/facebook/flux):
      Application Architecture for Building User Interfaces

* [
      muut
      /
      riotjs
](https://github.com/muut/riotjs):
      A React- like, 2.5KB user interface library

* [
      meteor
      /
      meteor
](https://github.com/meteor/meteor):
      Meteor, an ultra-simple, database-everywhere, data-on-the-wire, pure-Javascript web framework.

* [
      gulpjs
      /
      gulp
](https://github.com/gulpjs/gulp):
      The streaming build system

* [
      capnmidnight
      /
      Primrose
](https://github.com/capnmidnight/Primrose):
      A text editor that draws to Canvas

* [
      ecomfe
      /
      echarts
](https://github.com/ecomfe/echarts):
      Enterprise Charts | Github pages : http://ecomfe.github.io/echarts/index-en.html | Email : echarts@baidu.com | Baidu Hi : 1379172 |

* [
      webpack
      /
      webpack
](https://github.com/webpack/webpack):
      Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.

* [
      facebook
      /
      immutable-js
](https://github.com/facebook/immutable-js):
      Immutable persistent data collections for Javascript which increase efficiency and simplicity.

####ruby
* [
      Homebrew
      /
      homebrew
](https://github.com/Homebrew/homebrew):
      The missing package manager for OS X.

* [
      ArtSabintsev
      /
      PrintlnMagic
](https://github.com/ArtSabintsev/PrintlnMagic):
      An alternative for Swift's println() function along the lines of DLog.

* [
      rails
      /
      rails
](https://github.com/rails/rails):
      Ruby on Rails

* [
      jekyll
      /
      jekyll
](https://github.com/jekyll/jekyll):
      Jekyll is a blog-aware, static site generator in Ruby

* [
      mmozuras
      /
      pronto
](https://github.com/mmozuras/pronto):
      Quick automated code review of your changes

* [
      KrauseFx
      /
      fastlane
](https://github.com/KrauseFx/fastlane):
      Connect all iOS deployment tools into one streamlined workflow

* [
      cantino
      /
      huginn
](https://github.com/cantino/huginn):
      Build agents that monitor and act on your behalf. Your agents are standing by!

* [
      tpope
      /
      gem-shut-the-fuck-up
](https://github.com/tpope/gem-shut-the-fuck-up):
      Gem SHUT THE FUCK UP

* [
      ruby-concurrency
      /
      concurrent-ruby
](https://github.com/ruby-concurrency/concurrent-ruby):
      Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.

* [
      mitchellh
      /
      vagrant
](https://github.com/mitchellh/vagrant):
      Vagrant is a tool for building and distributing development environments.

* [
      reactjs
      /
      react-rails
](https://github.com/reactjs/react-rails):
      Ruby gem for automatically transforming JSX and using React in Rails.

* [
      capistrano
      /
      capistrano
](https://github.com/capistrano/capistrano):
      Remote multi-server automation tool

* [
      discourse
      /
      discourse
](https://github.com/discourse/discourse):
      A platform for community discussion. Free, open, simple.

* [
      diaspora
      /
      diaspora
](https://github.com/diaspora/diaspora):
      Distributed and contextual social networking

* [
      ruby
      /
      ruby
](https://github.com/ruby/ruby):
      The Ruby Programming Language

* [
      infosimples
      /
      deathbycaptcha
](https://github.com/infosimples/deathbycaptcha):
      Ruby API for DeathByCaptcha (Captcha Solver as a Service)

* [
      spree
      /
      spree
](https://github.com/spree/spree):
      Spree is a complete open source e-commerce solution for Ruby on Rails.

* [
      gitlabhq
      /
      gitlabhq
](https://github.com/gitlabhq/gitlabhq):
      Open source software to collaborate on code. Follow us on twitter @gitlab

* [
      bbatsov
      /
      rubocop
](https://github.com/bbatsov/rubocop):
      A Ruby static code analyzer, based on the community Ruby style guide.

* [
      jordansissel
      /
      fpm
](https://github.com/jordansissel/fpm):
      Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.

* [
      leereilly
      /
      swot
](https://github.com/leereilly/swot):
      Identify email addresses or domains names that belong to colleges or universities. Help automate the process of approving or rejecting academic discounts.

* [
      rubygems
      /
      rubygems
](https://github.com/rubygems/rubygems):
      Library packaging and distribution for Ruby.

* [
      telerik
      /
      kendo-docs
](https://github.com/telerik/kendo-docs):
      Public Documentation for Kendo UI

* [
      Homebrew
      /
      homebrew-brewdler
](https://github.com/Homebrew/homebrew-brewdler):

 Bundler for non-Ruby dependencies from Homebrew

* [
      fluent
      /
      fluentd-ui
](https://github.com/fluent/fluentd-ui):
      Web UI for Fluentd


text:
A simple library to connect your Ember.js application to JSON backends.

## The Mandatory Todo Appplication

I've created a modified version of the todo application that the Ember.js Tutorial walks you through.
https://github.com/staugaard/sproutcore-resource-todos
This version persists the todo items on the server using a very small sinatra application and MongoDB.

## Examples

We will provide you with some documentation and stuff, but for now here's a little inspiration:

Think about running Wordpress.org. This is the schema you would use:

Assuming that /users/1 returns this JSON:

```javascript
{
  id:   1,
  name: "Mick Staugaard"
}
```

You would use this user model:

```javascript
MyApp.User = Ember.Resource.define({
  url: '/users',
  schema: {
    id:    Number,
    name:  String,
    blogs: {
      type:     Ember.ResourceCollection,
      itemType: 'MyApp.Blog',
      url:      '/users/%@/blogs'
    }
  }
});
```

Assuming that /blogs/1 returns this JSON:

```javascript
{
  id:      1,
  name:    "My awesome blog",
  owner_id: 1
}
```

You would use this blog model:

```javascript
MyApp.Blog = Ember.Resource.define({
  url: '/blogs'
  schema: {
    id:    Number,
    name:  String,
    owner: {
      type: MyApp.User
    },
    posts: {
      type:     Ember.ResourceCollection,
      itemType: 'MyApp.Post',
      url:      '/blogs/%@/posts'
    }
  }
});
```

Assuming that /posts/1 returns this JSON:

```javascript
{
  id:      1,
  title:   "Welcome to the blog",
  body:    "OMG I started a blog!",
  blog_id: 1
}
```

You would use this post model:

```javascript
MyApp.Post = Ember.Resource.define({
  url: '/posts',
  schema: {
    id:    Number,
    title: Sting,
    body:  String,
    blog: {
      type: MyApp.Blog
    },
    comments: {
      type:     Ember.ResourceCollection,
      itemType: 'MyApp.Comment',
      url:      '/posts/%@/comments'
    }
  }
});
```

Assuming that /comments/1 returns this JSON:

```javascript
{
  id:      1,
  body:    "I have something constructive to say.",
  post_id: 1,
  author: {
    id:   2,
    name: "Comment Author"
  }
}
```

You would use this comment model:

```javascript
MyApp.Comment = Ember.Resource.define({
  url: '/comments',
  schema: {
    id:   Number,
    body: String,
    post: {
      type: MyApp.Post
    },
    author: {
      type:   MyApp.User,
      nested: true
    }
  }
});
```

## Copyright and license

Copyright 2013 Zendesk

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

[1]: https://github.com/zendesk/ember-resource


text:
Simple QrCode
=============

##Change Log

#### 1.3.0
* Added `merge` method.
* Fixed a typo in the readme.

#### 1.2.0
* Added full support for Laravel 5
* Added the following helpers.
  * E-Mail
  * Geo
  * Phone Number
  * SMS
  * WiFi

#### 1.1.1
* Update dependencies.
* Corrected some composer file issues.
* Added some missing Laravel information to the QrCode Service Provider.

####1.1.0
* Added the ability to change the character encoding.


text:
/**
 * Filter for rpc log.
 * Record used time for remote process call.
 */
var rpc_logger = require('pomelo-logger').getLogger('rpc-log');
var utils = require('../../util/utils');

var exp = module.exports;

/**
 * Before filter for rpc
 */
exp.before = function(serverId, msg, opts, next) {
	opts = opts||{};
	opts.__start_time__ = Date.now();
	next(serverId, msg, opts);
};

/**
 * After filter for rpc
 */
exp.after = function(serverId, msg, opts, next) {
	if(!!opts && !!opts.__start_time__) {
		var start = opts.__start_time__;
		var end = Date.now();
		var timeUsed = end - start;
		var log = {
			route : msg.service,
			args : msg.args,
			time : utils.format(new Date(start)),
			timeUsed : timeUsed
		};
		rpc_logger.info(JSON.stringify(log));
	}
	next(serverId, msg, opts);
};


text:
<!DOCTYPE html>

	<meta charset="utf-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
	<meta name="description" content="diseño de pagina principal, maquetada con Photosshot y Evolus Pencil" />
	<meta name="author" content="Fernando Palacios Landi" />
	<title>pagina principal</title>

	<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
	<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" href="../css/default.css" />

diseño pagina ventas

<input type="button" onclick="document.location.href='index.html'" value="maquetacion html"/>


text:
+++
date = "2022-09-15T10:07:59+10:00"
title = "Presentations"
+++

* **Conditional Compilation in Rust**
([slides](https://github.com/tcharding/talks/tree/master/conditional-compilation-in-rust))
  14th September 2022 - RustAU meetup

* **Beginning Rust - Fast track your learning**
([git repo](https://github.com/tcharding/rust-training))
  6th November 2019 - Central Coast Linux Users Group

* **Beginning Rust - Fast track your learning**
([git repo](https://github.com/tcharding/rust-training))
  29th October 2019 - RustSydney meet up

* **Workshop: Hacking Device Drivers - How to get into kernel development**
([git repo](https://github.com/tcharding/kernel/tree/master/workshop))
  20th August 2019 - Open Source Summit North America

* **Talk: Intro to Kernel Hacking - finding things to work on**
([slides](http://tobin.cc/kernel-dev-finding-work.pdf))
  22nd January 2018 - Linux.conf.au

* **Tutorial: Hacking Device Drivers - How to get into kernel development**
([git repo](https://github.com/tcharding/kernel/tree/master/tutorial))
  ([slides](http://tobin.cc/kernel-dev-tutorial.pdf))
  14th September 2017 - Open Source Summit North America

* **Talk: Getting Started With Linux Kernel Development**
  ([slides](http://tobin.cc/kernel-dev-intro.pdf))
  2nd August 2017 - Central Coast Linux Users Group

* **Talk: Unix, Linux and Cryptography going into the Future**
  27th May 2015 - Australian Computer Society, Central Coast Chapter
 ([link](https://www.acs.org.au/insightsandpublications/news-archive/2015/67141.html))


text:
<?xml version='1.0' encoding='utf-8'?>

<!--L
   Copyright Washington University in St. Louis
   Copyright SemanticBits
   Copyright Persistent Systems
   Copyright Krishagni

   Distributed under the OSI-approved BSD 3-Clause License.
   See http://ncip.github.com/wustl-common-utilities/LICENSE.txt for details.
L-->

<!DOCTYPE hibernate-configuration PUBLIC
   "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
	<session-factory>
		<mapping resource="edu/wustl/common/hbm/PersistentGraph.hbm.xml" />
	</session-factory>
</hibernate-configuration>


text:
package com.blazebit.persistence.view;

import com.blazebit.persistence.CTEBuilder;

import java.util.Map;

/**
 * Provides CTE bindings to a {@link CTEBuilder}.
 *
 * @author Giovanni Lovato
 * @since 1.4.0
 */
public interface CTEProvider {

    /**
     * Binds a CTE.
     *
     * @param builder the builder
     * @param optionalParameters The optional parameters of the entity view setting
     */
    void applyCtes(CTEBuilder<?> builder, Map<String, Object> optionalParameters);
}


text: Device compatible CSS framework


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"/>

<link rsf:id="scr=portal-matter" href="/library/skin/tool_base.css" type="text/css" rel="stylesheet" media="all" />
<link rsf:id="scr=portal-matter" href="/library/skin/default/tool.css" type="text/css" rel="stylesheet" media="all" />
<link rel="stylesheet" rsf:id="scr=rewrite-url" href="../css/Simplepagetool.css" type="text/css"/>
<title rsf:id="msg=simplepage.blti.chooser"></title>

		<form action="#" rsf:id="blti-picker">

				<input type="radio" rsf:id="select"/>

		<input type="hidden" rsf:id="item-id" id="item-id" />

    		<input type="submit" class="bold" rsf:id="submit" />
    		<input type="submit" rsf:id="cancel" />

		</form>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>voldemort.utils Class Hierarchy (cachestore-storage 4.0.4 API)</title>
<meta name="date" content="2016-03-09">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package voldemort.utils

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

voldemort.utils.ByteArray (implements java.io.Serializable)

voldemort.utils.ByteUtils

voldemort.utils.ConstantHashFunction (implements voldemort.utils.HashFunction)

voldemort.utils.DaemonThreadFactory (implements java.util.concurrent.ThreadFactory)

voldemort.utils.DefaultIterable<V> (implements java.lang.Iterable<T>)

voldemort.utils.FnvHashFunction (implements voldemort.utils.HashFunction)

java.io.InputStream (implements java.io.Closeable)

voldemort.utils.ByteBufferBackedInputStream

voldemort.utils.JmxUtils

java.io.OutputStream (implements java.io.Closeable, java.io.Flushable)

voldemort.utils.ByteBufferBackedOutputStream

voldemort.utils.StringOutputStream

voldemort.utils.Pair<F,S> (implements com.google.common.base.Function<F,T>, java.io.Serializable)

voldemort.utils.Props (implements java.util.Map<K,V>)

voldemort.utils.ReflectUtils

voldemort.utils.SystemTime (implements voldemort.utils.Time)

java.lang.Throwable (implements java.io.Serializable)

java.lang.Exception

java.lang.RuntimeException

voldemort.utils.ConfigurationException

voldemort.utils.UndefinedPropertyException

com.google.common.collect.UnmodifiableIterator<E> (implements java.util.Iterator<E>)

com.google.common.collect.AbstractIterator<T>

voldemort.utils.DirectoryIterator (implements voldemort.utils.ClosableIterator<T>)

voldemort.utils.Utils

Interface Hierarchy

voldemort.utils.HashFunction

java.util.Iterator<E>

voldemort.utils.ClosableIterator<T>

voldemort.utils.Time

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016. All rights reserved.


text:
class FeedsController < ApplicationController
  before_action :set_feed, only: [:show, :edit, :update, :destroy]

  before_action :authenticate_user!

  respond_to :html

  def index
    @feeds = Feed.all
    respond_with(@feeds)
  end

  def show
    respond_with(@feed)
  end

  def new
    @feed = Feed.new
    respond_with(@feed)
  end

  def edit
  end

  def create
    @feed = Feed.new(feed_params)

    respond_to do |format|
      if @feed.save
        if params[:type] == 'comment' && @feed.task.user != nil
          FeedMailer.comment(@feed.task.user.email,@feed.task.user.name,@feed.task.title,@feed.description,@feed.task.id,@feed.task.group_id,current_user,@feed.task.user,session[:return_to]).deliver
        end
        format.html { redirect_to session[:return_to], notice: 'Feed was successfully created.' }
      else
        format.html { redirect_to session[:return_to] }
      end
    end
  end

  def update
    @feed.update(feed_params)
    respond_with(@feed)
  end

  def destroy
    @feed.destroy
    respond_with(@feed)
  end

  private
    def set_feed
      @feed = Feed.find(params[:id])
    end

    def feed_params
      params.require(:feed).permit(:title, :description, :file, :user_id,:task_id)
    end
end