text:
title: Running Bottle Apps in Docker Containers on macOS
slug: first-steps-bottle-web-apps-docker-containers
meta: Learn how to set up and develop a new Bottle web application within a Docker container.
category: post
date: 2018-06-04
modified: 2018-06-05
newsletter: False
headerimage: /img/180604-bottle-docker/header.jpg
headeralt: Bottle, Docker and Apple logos, copyright their respective owners.

It can be confusing to figure out how to use [Docker](/docker.html)
containers in your [Python](/why-use-python.html) and
[Bottle](/flask.html)
[development environment](/development-environments.html) workflow.
This tutorial will quickly show you the exact steps to get Docker
up and running on macOS with a working Bottle
[web application](/web-development.html)

## Our Tools
This tutorial is written for [Python 3](/python-2-or-3.html). It may work with
Python 2 but it has not been testing with that soon-to-be deprecated
[2.7 version](https://pythonclock.org/). You should really be using Python 3,
preferrably the latest release which is currently
[3.6.5](https://www.python.org/downloads/release/python-365/).

[Docker for Mac](https://docs.docker.com/docker-for-mac/install/) is necessary
to run Docker containers. I recommend that you use the stable release unless
you have an explicit purpose for the
[edge channel](https://docs.docker.com/docker-for-mac/edge-release-notes/).

Within the Docker container we will use:

* Python 3, specifically the
  [slim-3.6.5 version](https://hub.docker.com/r/library/python/tags/)
  from [Docker Hub](https://hub.docker.com/)
* [Bottle](/bottle.html) version 0.12.13

All for the Dockerfile and the Bottle project are available open source
under the MIT license on GitHub under the
[docker-bottle-mac directory](https://github.com/fullstackpython/blog-code-examples/tree/master/docker-bottle-mac)
of the
[blog-code-examples](https://github.com/fullstackpython/blog-code-examples)
repository.

## Installing Docker on macOS
We must install Docker before we can spin up our containers. Jump to
the next section if you already have Docker for Mac installed and working
on your computer.

On your Mac,
[download the Docker Community Edition (CE) for Mac](https://www.docker.com/community-edition#/download)
installer.

Open Finder and go to the downloads folder where the installation file is located.
Follow the installation steps and open Terminal when the installer finishes.

Test your Docker installation by running the `docker` command along with the
`--version` flag:

```
docker --version
```

If Docker is installed correctly you should see the following output:

```
Docker version 18.03.1-ce, build 9ee9f40
```

Note that Docker runs through a system agent you can find in the menu bar.

Docker is now installed so we can run a container and write a simple
Bottle application to test running an app within the container.

## Dockerfile
Docker needs to know what we want in our container so we specify an
image using a `Dockerfile`.

```
# this is an official Python runtime, used as the parent image
FROM python:3.6.5-slim

# set the working directory in the container to /app
WORKDIR /app

# add the current directory to the container as /app
ADD . /app

# execute everyone's favorite pip command, pip install -r
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# unblock port 80 for the Bottle app to run on
EXPOSE 80

# execute the Flask app
CMD ["python", "app.py"]
```

Save the Dockerfile and then on the commandline run:

```
docker build -t bottledock .
```

The above `docker build` file uses the `-t` flag to tag the image with
the name of `bottledock`.

If the build worked successfully the [shell](/shells.html) will show
some completed output like the following:

```
$ docker build -t bottledock .
Sending build context to Docker daemon  16.38kB
Step 1/6 : FROM python:3.6.5-slim
3.6.5-slim: Pulling from library/python
f2aa67a397c4: Pull complete
19cc085bc22b: Pull complete
83bd7790bc68: Pull complete
8b3329adba1b: Pull complete
d0a8fd6eb5d0: Pull complete
Digest: sha256:56100f5b5e299f4488f51ea81cc1a67b5ff13ee2f926280eaf8e527a881afa61
Status: Downloaded newer image for python:3.6.5-slim
 ---> 29ea9c0b39c6
Step 2/6 : WORKDIR /app
Removing intermediate container 627538eb0d39
 ---> 26360255c163
Step 3/6 : ADD . /app
 ---> 9658b91b29db
Step 4/6 : RUN pip install --trusted-host pypi.python.org -r requirements.txt
 ---> Running in f0d0969f3066
Collecting bottle==0.12.13 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/bd/99/04dc59ced52a8261ee0f965a8968717a255ea84a36013e527944dbf3468c/bottle-0.12.13.tar.gz (70kB)
Building wheels for collected packages: bottle
  Running setup.py bdist_wheel for bottle: started
  Running setup.py bdist_wheel for bottle: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/76/a0/b4/2a3ee1a32d0506931e558530258de1cc04b628eff1b2f008e0
Successfully built bottle
Installing collected packages: bottle
Successfully installed bottle-0.12.13
Removing intermediate container f0d0969f3066
 ---> 0534575c8067
Step 5/6 : EXPOSE 80
 ---> Running in 14e49938d3be
Removing intermediate container 14e49938d3be
 ---> 05e087d2471d
Step 6/6 : CMD ["python", "app.py"]
 ---> Running in ca9738bfd06a
Removing intermediate container ca9738bfd06a
 ---> 9afb4f01e0d3
Successfully built 9afb4f01e0d3
Successfully tagged bottledock:latest
```

We can also see the image with the `docker image ls` command. Give that
a try now:

```
docker image ls
```

Our tag name should appear in the images list:

```
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
bottledock          latest              9afb4f01e0d3        About a minute ago   145MB
```

Our image is ready to load as a container so we can code a short
Bottle web app for testing and then further development.

## Coding A Bottle Web App
It is time to code a simple "Hello, World!"-style Bottle app to test
running Python code within our Docker container. Within the current
project directory, create a file named `app.py` with the following contents:

```python
import bottle
from bottle import route, run

app = bottle.default_app()

@route('/')
def hello_world():
	return "Hello, world! (From Full Stack Python)"

if __name__ == "__main__":
	run(host="0.0.0.0", port=8080, debug=True, reloader=True)
```

The above code returns a simple "Hello, world!" message when
executed by the Bottle development server and contacted by a client.

We need just one more file to specify our `bottle` dependency. Create
a `requirements.txt` file within the same directory as `app.py`:

```
bottle==0.12.13
```

Make sure both the `app.py` and `requirements.txt` file are saved then
we can give the code a try.

## Running the Container
Now that we have our image in hand along with the Python code in a file
we can run the image as a container with the `docker run` command. Execute
the following command, making sure to replace the absolute path for the
volume to your own directory.

```
docker run -p 5000:8080 --volume=/Users/matt/devel/py/blog-code-examples/docker-bottle-macapp bottledock
```

If you receive the error
`python: can't open file 'app.py': [Errno 2] No such file or directory` then
you likely did not change `/Users/matt/devel/py/bottledocker` to the
directory where your project files, especially `app.py`, are located.

Everything worked when you see a simple text-based HTTP response like what
is shown above in the screenshot of my Chrome browser.

## What's Next?
We just installed Docker and wrote a Bottle web app to run inside a
container. That is just the beginning of how you can integrate Docker into
your workflow.

Next up take a look at the [Bottle](/bottle.html), [Docker](/docker.html)
and [deployment](/deployment.html) pages for more tutorials.

Questions? Let me know via a GitHub
[issue ticket on the Full Stack Python repository](https://github.com/mattmakai/fullstackpython.com/issues),
on Twitter
[@fullstackpython](https://twitter.com/fullstackpython)
or [@mattmakai](https://twitter.com/mattmakai).

Do you see a typo, syntax issue or just something that's confusing in this
blog post? Fork
[this page's source on GitHub](https://github.com/mattmakai/fullstackpython.com/blob/master/content/posts/180604-bottle-docker-macos.markdown)
and submit a pull request with a fix or
[file an issue ticket on GitHub](https://github.com/mattmakai/fullstackpython.com/issues).


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/gameOverLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="ch.hslu.mobpro.proj.thinkquick.activities.GameOverActivity">

    <TextView
        android:id="@+id/gameOverInfoText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="@string/gameover_info_text"
        android:textSize="24sp"
        android:textStyle="italic"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.501"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.8" />

    <TextView
        android:id="@+id/gameOver"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="GAME OVER"
        android:textSize="36sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.505"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.47000003" />

    <TextView
        android:id="@+id/gameOverPoints"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="Points: 0"
        android:textSize="24sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.501"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.6" />
</android.support.constraint.ConstraintLayout>

redpajama_set_name: RedPajamaGithub


text:
package org.apache.harmony.luni.util;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.apache.harmony.luni.util.MsgHelp;

/**
 * This class retrieves strings from a resource bundle and returns them,
 * formatting them with MessageFormat when required.
 *

 * It is used by the system classes to provide national language support, by
 * looking up messages in the
 *    org.apache.harmony.luni.util.ExternalMessages
 *
 * resource bundle. Note that if this file is not available, or an invalid key
 * is looked up, or resource bundle support is not available, the key itself
 * will be returned as the associated message. This means that the KEY
 * should a reasonable human-readable (english) string.
 *
 */
public class Msg {

	// ResourceBundle holding the system messages.
	static private ResourceBundle bundle = null;

	static {
		// Attempt to load the messages.
		try {
			bundle = MsgHelp.setLocale(Locale.getDefault(),
					"org.apache.harmony.luni.util.ExternalMessages");
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}

	/**
	 * Retrieves a message which has no arguments.
	 *
	 * @param msg
	 *            String the key to look up.
	 * @return String the message for that key in the system message bundle.
	 */
	static public String getString(String msg) {
		if (bundle == null)
			return msg;
		try {
			return bundle.getString(msg);
		} catch (MissingResourceException e) {
			return msg;
		}
	}

	/**
	 * Retrieves a message which takes 1 argument.
	 *
	 * @param msg
	 *            String the key to look up.
	 * @param arg
	 *            Object the object to insert in the formatted output.
	 * @return String the message for that key in the system message bundle.
	 */
	static public String getString(String msg, Object arg) {
		return getString(msg, new Object[] { arg });
	}

	/**
	 * Retrieves a message which takes 1 integer argument.
	 *
	 * @param msg
	 *            String the key to look up.
	 * @param arg
	 *            int the integer to insert in the formatted output.
	 * @return String the message for that key in the system message bundle.
	 */
	static public String getString(String msg, int arg) {
		return getString(msg, new Object[] { Integer.toString(arg) });
	}

	/**
	 * Retrieves a message which takes 1 character argument.
	 *
	 * @param msg
	 *            String the key to look up.
	 * @param arg
	 *            char the character to insert in the formatted output.
	 * @return String the message for that key in the system message bundle.
	 */
	static public String getString(String msg, char arg) {
		return getString(msg, new Object[] { String.valueOf(arg) });
	}

	/**
	 * Retrieves a message which takes 2 arguments.
	 *
	 * @param msg
	 *            String the key to look up.
	 * @param arg1
	 *            Object an object to insert in the formatted output.
	 * @param arg2
	 *            Object another object to insert in the formatted output.
	 * @return String the message for that key in the system message bundle.
	 */
	static public String getString(String msg, Object arg1, Object arg2) {
		return getString(msg, new Object[] { arg1, arg2 });
	}

	/**
	 * Retrieves a message which takes several arguments.
	 *
	 * @param msg
	 *            String the key to look up.
	 * @param args
	 *            Object[] the objects to insert in the formatted output.
	 * @return String the message for that key in the system message bundle.
	 */
	static public String getString(String msg, Object[] args) {
		String format = msg;

		if (bundle != null) {
			try {
				format = bundle.getString(msg);
			} catch (MissingResourceException e) {
			}
		}

		return MsgHelp.format(format, args);
	}
}


text:
#ifndef _CCID_H
#define _CCID_H
/*
 *  net/dccp/ccid.h
 *
 *  An implementation of the DCCP protocol
 *  Arnaldo Carvalho de Melo <acme@conectiva.com.br>
 *
 *  CCID infrastructure
 *
 *	This program is free software; you can redistribute it and/or modify it
 *	under the terms of the GNU General Public License version 2 as
 *	published by the Free Software Foundation.
 */

#include <net/sock.h>
#include <linux/compiler.h>
#include <linux/dccp.h>
#include <linux/list.h>
#include <linux/module.h>

/* maximum value for a CCID (RFC 4340, 19.5) */
#define CCID_MAX		255
#define CCID_SLAB_NAME_LENGTH	32

struct tcp_info;

/**
 *  struct ccid_operations  -  Interface to Congestion-Control Infrastructure
 *
 *  @ccid_id: numerical CCID ID (up to %CCID_MAX, cf. table 5 in RFC 4340, 10.)
 *  @ccid_ccmps: the CCMPS including network/transport headers (0 when disabled)
 *  @ccid_name: alphabetical identifier string for @ccid_id
 *  @ccid_hc_{r,t}x_slab: memory pool for the receiver/sender half-connection
 *  @ccid_hc_{r,t}x_obj_size: size of the receiver/sender half-connection socket
 *
 *  @ccid_hc_{r,t}x_init: CCID-specific initialisation routine (before startup)
 *  @ccid_hc_{r,t}x_exit: CCID-specific cleanup routine (before destruction)
 *  @ccid_hc_rx_packet_recv: implements the HC-receiver side
 *  @ccid_hc_{r,t}x_parse_options: parsing routine for CCID/HC-specific options
 *  @ccid_hc_{r,t}x_insert_options: insert routine for CCID/HC-specific options
 *  @ccid_hc_tx_packet_recv: implements feedback processing for the HC-sender
 *  @ccid_hc_tx_send_packet: implements the sending part of the HC-sender
 *  @ccid_hc_tx_packet_sent: does accounting for packets in flight by HC-sender
 *  @ccid_hc_{r,t}x_get_info: INET_DIAG information for HC-receiver/sender
 *  @ccid_hc_{r,t}x_getsockopt: socket options specific to HC-receiver/sender
 */
struct ccid_operations {
	unsigned char		ccid_id;
	__u32			ccid_ccmps;
	const char		*ccid_name;
	struct kmem_cache	*ccid_hc_rx_slab,
				*ccid_hc_tx_slab;
	char			ccid_hc_rx_slab_name[CCID_SLAB_NAME_LENGTH];
	char			ccid_hc_tx_slab_name[CCID_SLAB_NAME_LENGTH];
	__u32			ccid_hc_rx_obj_size,
				ccid_hc_tx_obj_size;
	/* Interface Routines */
	int		(*ccid_hc_rx_init)(struct ccid *ccid, struct sock *sk);
	int		(*ccid_hc_tx_init)(struct ccid *ccid, struct sock *sk);
	void		(*ccid_hc_rx_exit)(struct sock *sk);
	void		(*ccid_hc_tx_exit)(struct sock *sk);
	void		(*ccid_hc_rx_packet_recv)(struct sock *sk,
						  struct sk_buff *skb);
	int		(*ccid_hc_rx_parse_options)(struct sock *sk, u8 pkt,
						    u8 opt, u8 *val, u8 len);
	int		(*ccid_hc_rx_insert_options)(struct sock *sk,
						     struct sk_buff *skb);
	void		(*ccid_hc_tx_packet_recv)(struct sock *sk,
						  struct sk_buff *skb);
	int		(*ccid_hc_tx_parse_options)(struct sock *sk, u8 pkt,
						    u8 opt, u8 *val, u8 len);
	int		(*ccid_hc_tx_send_packet)(struct sock *sk,
						  struct sk_buff *skb);
	void		(*ccid_hc_tx_packet_sent)(struct sock *sk,
						  unsigned int len);
	void		(*ccid_hc_rx_get_info)(struct sock *sk,
					       struct tcp_info *info);
	void		(*ccid_hc_tx_get_info)(struct sock *sk,
					       struct tcp_info *info);
	int		(*ccid_hc_rx_getsockopt)(struct sock *sk,
						 const int optname, int len,
						 u32 __user *optval,
						 int __user *optlen);
	int		(*ccid_hc_tx_getsockopt)(struct sock *sk,
						 const int optname, int len,
						 u32 __user *optval,
						 int __user *optlen);
};

extern struct ccid_operations ccid2_ops;
#ifdef CONFIG_IP_DCCP_CCID3
extern struct ccid_operations ccid3_ops;
#endif

extern int  ccid_initialize_builtins(void);
extern void ccid_cleanup_builtins(void);

struct ccid {
	struct ccid_operations *ccid_ops;
	char		       ccid_priv[0];
};

static inline void *ccid_priv(const struct ccid *ccid)
{
	return (void *)ccid->ccid_priv;
}

extern bool ccid_support_check(u8 const *ccid_array, u8 array_len);
extern int  ccid_get_builtin_ccids(u8 **ccid_array, u8 *array_len);
extern int  ccid_getsockopt_builtin_ccids(struct sock *sk, int len,
					  char __user *, int __user *);

extern struct ccid *ccid_new(const u8 id, struct sock *sk, bool rx);

static inline int ccid_get_current_rx_ccid(struct dccp_sock *dp)
{
	struct ccid *ccid = dp->dccps_hc_rx_ccid;

	if (ccid == NULL || ccid->ccid_ops == NULL)
		return -1;
	return ccid->ccid_ops->ccid_id;
}

static inline int ccid_get_current_tx_ccid(struct dccp_sock *dp)
{
	struct ccid *ccid = dp->dccps_hc_tx_ccid;

	if (ccid == NULL || ccid->ccid_ops == NULL)
		return -1;
	return ccid->ccid_ops->ccid_id;
}

extern void ccid_hc_rx_delete(struct ccid *ccid, struct sock *sk);
extern void ccid_hc_tx_delete(struct ccid *ccid, struct sock *sk);

/*
 * Congestion control of queued data packets via CCID decision.
 *
 * The TX CCID performs its congestion-control by indicating whether and when a
 * queued packet may be sent, using the return code of ccid_hc_tx_send_packet().
 * The following modes are supported via the symbolic constants below:
 * - timer-based pacing    (CCID returns a delay value in milliseconds);
 * - autonomous dequeueing (CCID internally schedules dccps_xmitlet).
 */

enum ccid_dequeueing_decision {
	CCID_PACKET_SEND_AT_ONCE =	 0x00000,  /* "green light": no delay */
	CCID_PACKET_DELAY_MAX =		 0x0FFFF,  /* maximum delay in msecs  */
	CCID_PACKET_DELAY =		 0x10000,  /* CCID msec-delay mode */
	CCID_PACKET_WILL_DEQUEUE_LATER = 0x20000,  /* CCID autonomous mode */
	CCID_PACKET_ERR =		 0xF0000,  /* error condition */
};

static inline int ccid_packet_dequeue_eval(const int return_code)
{
	if (return_code < 0)
		return CCID_PACKET_ERR;
	if (return_code == 0)
		return CCID_PACKET_SEND_AT_ONCE;
	if (return_code <= CCID_PACKET_DELAY_MAX)
		return CCID_PACKET_DELAY;
	return return_code;
}

static inline int ccid_hc_tx_send_packet(struct ccid *ccid, struct sock *sk,
					 struct sk_buff *skb)
{
	if (ccid->ccid_ops->ccid_hc_tx_send_packet != NULL)
		return ccid->ccid_ops->ccid_hc_tx_send_packet(sk, skb);
	return CCID_PACKET_SEND_AT_ONCE;
}

static inline void ccid_hc_tx_packet_sent(struct ccid *ccid, struct sock *sk,
					  unsigned int len)
{
	if (ccid->ccid_ops->ccid_hc_tx_packet_sent != NULL)
		ccid->ccid_ops->ccid_hc_tx_packet_sent(sk, len);
}

static inline void ccid_hc_rx_packet_recv(struct ccid *ccid, struct sock *sk,
					  struct sk_buff *skb)
{
	if (ccid->ccid_ops->ccid_hc_rx_packet_recv != NULL)
		ccid->ccid_ops->ccid_hc_rx_packet_recv(sk, skb);
}

static inline void ccid_hc_tx_packet_recv(struct ccid *ccid, struct sock *sk,
					  struct sk_buff *skb)
{
	if (ccid->ccid_ops->ccid_hc_tx_packet_recv != NULL)
		ccid->ccid_ops->ccid_hc_tx_packet_recv(sk, skb);
}

/**
 * ccid_hc_tx_parse_options  -  Parse CCID-specific options sent by the receiver
 * @pkt: type of packet that @opt appears on (RFC 4340, 5.1)
 * @opt: the CCID-specific option type (RFC 4340, 5.8 and 10.3)
 * @val: value of @opt
 * @len: length of @val in bytes
 */
static inline int ccid_hc_tx_parse_options(struct ccid *ccid, struct sock *sk,
					   u8 pkt, u8 opt, u8 *val, u8 len)
{
	if (ccid->ccid_ops->ccid_hc_tx_parse_options == NULL)
		return 0;
	return ccid->ccid_ops->ccid_hc_tx_parse_options(sk, pkt, opt, val, len);
}

/**
 * ccid_hc_rx_parse_options  -  Parse CCID-specific options sent by the sender
 * Arguments are analogous to ccid_hc_tx_parse_options()
 */
static inline int ccid_hc_rx_parse_options(struct ccid *ccid, struct sock *sk,
					   u8 pkt, u8 opt, u8 *val, u8 len)
{
	if (ccid->ccid_ops->ccid_hc_rx_parse_options == NULL)
		return 0;
	return ccid->ccid_ops->ccid_hc_rx_parse_options(sk, pkt, opt, val, len);
}

static inline int ccid_hc_rx_insert_options(struct ccid *ccid, struct sock *sk,
					    struct sk_buff *skb)
{
	if (ccid->ccid_ops->ccid_hc_rx_insert_options != NULL)
		return ccid->ccid_ops->ccid_hc_rx_insert_options(sk, skb);
	return 0;
}

static inline void ccid_hc_rx_get_info(struct ccid *ccid, struct sock *sk,
				       struct tcp_info *info)
{
	if (ccid->ccid_ops->ccid_hc_rx_get_info != NULL)
		ccid->ccid_ops->ccid_hc_rx_get_info(sk, info);
}

static inline void ccid_hc_tx_get_info(struct ccid *ccid, struct sock *sk,
				       struct tcp_info *info)
{
	if (ccid->ccid_ops->ccid_hc_tx_get_info != NULL)
		ccid->ccid_ops->ccid_hc_tx_get_info(sk, info);
}

static inline int ccid_hc_rx_getsockopt(struct ccid *ccid, struct sock *sk,
					const int optname, int len,
					u32 __user *optval, int __user *optlen)
{
	int rc = -ENOPROTOOPT;
	if (ccid != NULL && ccid->ccid_ops->ccid_hc_rx_getsockopt != NULL)
		rc = ccid->ccid_ops->ccid_hc_rx_getsockopt(sk, optname, len,
						 optval, optlen);
	return rc;
}

static inline int ccid_hc_tx_getsockopt(struct ccid *ccid, struct sock *sk,
					const int optname, int len,
					u32 __user *optval, int __user *optlen)
{
	int rc = -ENOPROTOOPT;
	if (ccid != NULL && ccid->ccid_ops->ccid_hc_tx_getsockopt != NULL)
		rc = ccid->ccid_ops->ccid_hc_tx_getsockopt(sk, optname, len,
						 optval, optlen);
	return rc;
}
#endif /* _CCID_H */


text:
config.$inject = ["$urlRouterProvider", "$mdThemingProvider"];
export function config($urlRouterProvider:ng.ui.IUrlRouterProvider, $mdThemingProvider:ng.material.IThemingProvider) {
    $urlRouterProvider.otherwise("/");

    $mdThemingProvider
        .theme("default")
        .primaryPalette("blue-grey")
        .accentPalette("purple");

}


text:
#include "mal.h"

// structure definition for composite mal_idbooleanpair
struct _mal_idbooleanpair_t {
  mal_identifier_t * id;
  bool value_is_present;
  mal_boolean_t value;
};

// fields accessors for composite mal_idbooleanpair
mal_identifier_t * mal_idbooleanpair_get_id(mal_idbooleanpair_t * self)
{
  return self->id;
}
void mal_idbooleanpair_set_id(mal_idbooleanpair_t * self, mal_identifier_t * id)
{
  self->id = id;
}
bool mal_idbooleanpair_value_is_present(mal_idbooleanpair_t * self)
{
  return self->value_is_present;
}
void mal_idbooleanpair_value_set_present(mal_idbooleanpair_t * self, bool is_present)
{
  self->value_is_present = is_present;
}
mal_boolean_t mal_idbooleanpair_get_value(mal_idbooleanpair_t * self)
{
  return self->value;
}
void mal_idbooleanpair_set_value(mal_idbooleanpair_t * self, mal_boolean_t value)
{
  self->value = value;
}

// default constructor
mal_idbooleanpair_t * mal_idbooleanpair_new(void)
{
  mal_idbooleanpair_t *self = (mal_idbooleanpair_t *) calloc(1, sizeof(mal_idbooleanpair_t));
  if (!self)
    return NULL;
  return self;
}

// encoding functions related to transport malbinary
int mal_idbooleanpair_add_encoding_length_malbinary(mal_idbooleanpair_t * self, mal_encoder_t * encoder, void * cursor)
{
  int rc = 0;
  rc = mal_encoder_add_presence_flag_encoding_length(encoder, (self->id != NULL), cursor);
  if (rc < 0)
    return rc;
  if ((self->id != NULL))
  {
    rc = mal_encoder_add_identifier_encoding_length(encoder, self->id, cursor);
    if (rc < 0)
      return rc;
  }
  rc = mal_encoder_add_presence_flag_encoding_length(encoder, self->value_is_present, cursor);
  if (rc < 0)
    return rc;
  if (self->value_is_present)
  {
    rc = mal_encoder_add_boolean_encoding_length(encoder, self->value, cursor);
    if (rc < 0)
      return rc;
  }
  return rc;
}
int mal_idbooleanpair_encode_malbinary(mal_idbooleanpair_t * self, mal_encoder_t * encoder, void * cursor)
{
  int rc = 0;
  bool presence_flag;
  presence_flag = (self->id != NULL);
  rc = mal_encoder_encode_presence_flag(encoder, cursor, presence_flag);
  if (rc < 0)
    return rc;
  if (presence_flag)
  {
    rc = mal_encoder_encode_identifier(encoder, cursor, self->id);
    if (rc < 0)
      return rc;
  }
  presence_flag = self->value_is_present;
  rc = mal_encoder_encode_presence_flag(encoder, cursor, presence_flag);
  if (rc < 0)
    return rc;
  if (presence_flag)
  {
    rc = mal_encoder_encode_boolean(encoder, cursor, self->value);
    if (rc < 0)
      return rc;
  }
  return rc;
}
int mal_idbooleanpair_decode_malbinary(mal_idbooleanpair_t * self, mal_decoder_t * decoder, void * cursor)
{
  int rc = 0;
  bool presence_flag;
  rc = mal_decoder_decode_presence_flag(decoder, cursor, &presence_flag);
  if (rc < 0)
    return rc;
  if (presence_flag)
  {
    rc = mal_decoder_decode_identifier(decoder, cursor, &self->id);
    if (rc < 0)
      return rc;
  }
  else
  {
    self->id = NULL;
  }
  rc = mal_decoder_decode_presence_flag(decoder, cursor, &presence_flag);
  if (rc < 0)
    return rc;
  if (presence_flag)
  {
    rc = mal_decoder_decode_boolean(decoder, cursor, &self->value);
    if (rc < 0)
      return rc;
  }
  self->value_is_present = presence_flag;
  return rc;
}

// destructor
void mal_idbooleanpair_destroy(mal_idbooleanpair_t ** self_p)
{
  if ((*self_p)->id != NULL)
  {
    mal_identifier_destroy(& (*self_p)->id);
  }
  free(*self_p);
  (*self_p) = NULL;
}

// test function
void mal_idbooleanpair_test(bool verbose)
{
  printf(" * MAL:IdBooleanPair: ");
  if (verbose)
    printf("\n");
  printf("OK\n");
}


text:
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
	display: none;
}
.ui-helper-hidden-accessible {
	position: absolute !important;
	clip: rect(1px 1px 1px 1px);
	clip: rect(1px,1px,1px,1px);
}
.ui-helper-reset {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	line-height: 1.3;
	text-decoration: none;
	font-size: 100%;
	list-style: none;
}
.ui-helper-clearfix:after {
	content: ".";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}
.ui-helper-clearfix {
	display: inline-block;
}
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix {
	height:1%;
}
.ui-helper-clearfix {
	display:block;
}
/* end clearfix */
.ui-helper-zfix {
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	position: absolute;
	opacity: 0;
	filter:Alpha(Opacity=0);
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
	cursor: default !important;
}
/* Icons
----------------------------------*/

/* states and images */
.ui-icon {
	display: block;
	text-indent: -99999px;
	overflow: hidden;
	background-repeat: no-repeat;
}
/* Misc visuals
----------------------------------*/

/* Overlays */
.ui-widget-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1001 !important;
}
/* Component containers
----------------------------------*/
.ui-widget {
	font-size:12px;
}
.ui-widget-content {
	border: 1px solid #cfcfcf;
}
.ui-widget-header, .sfTab { border-bottom:1px solid #ccc;
	background-color: #f0f0f0;
	-webkit-border-top-left-radius: 3px;
	-webkit-border-top-right-radius: 3px;
	-moz-border-radius-topleft: 3px;
	-moz-border-radius-topright: 3px;
	border-top-left-radius: 3px;
	border-top-right-radius: 3px;
}
.ui-widget-header a {
	color: #fff;
	font-size:12px;
	font-weight:normal;
}
.ui-widget-header span {
font-size:13px; font-weight: bold;
}
/* Interaction states
----------------------------------*/

/*
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
	border:none;
	background:none;
	font-weight: bold;
	color: #2e6e9e;
}*/
li.ui-state-default a, li.ui-state-default a:link, li.ui-state-default a:visited {
	color: #666;
	text-decoration: none;
	font-size:13px;
	font-weight:bold;
}/*
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
	border: 1px solid #79b7e7;
	background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x;
	font-weight: bold;
	color: #1d5987;
}*/
.ui-state-default a{ border-right:1px solid #ccc;}
.ui-state-active a{ background:#fff; box-shadow: 0 1px 0 #fff; }
.ui-state-hover a, .ui-state-hover a:hover {
	color: #1d5987;
	text-decoration: none;
}
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
}
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
	color:#0B4B83;
	text-decoration: none;
}
.ui-widget :active {
	outline: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
	border: 1px solid #fad42e;
	background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x;
	color: #363636;
}
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a {
	color: #363636;
}
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
	border: 1px solid #cd0a0a;
	background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
	color: #cd0a0a;
}
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a {
	color: #cd0a0a;
}
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text {
	color: #cd0a0a;
}
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary {
	font-weight: bold;
}
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
	opacity: .7;
	filter:Alpha(Opacity=70);
	font-weight: normal;
}
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {
/*	opacity: .35;
	filter:Alpha(Opacity=35);*/
	background-image: none;
}
/* Icons
----------------------------------*/

/* states and images */
.ui-icon {
	width: 18px;
	height: 22px;
	/*background-image: url(images/ui-icons_469bdd_256x240.png);*/
}
/*.ui-widget-content .ui-icon {
	background-image: url(images/ui-icons_469bdd_256x240.png);
}
.ui-widget-header .ui-icon {
	background-image: url(images/ui-icons_d8e7f3_256x240.png);
}
.ui-state-default .ui-icon {
	background-image: url(images/ui-icons_6da8d5_256x240.png);
}
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {
	background-image: url(images/ui-icons_217bc0_256x240.png);
}
.ui-state-active .ui-icon {
	background-image: url(images/ui-icons_f9bd01_256x240.png);
}*/
.ui-state-highlight .ui-icon {
	background-image: url(images/ui-icons_2e83ff_256x240.png);
}
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {
	background-image: url(images/ui-icons_cd0a0a_256x240.png);
}
/* positioning */
.ui-icon-carat-1-n {
	background-position: 0 0;
}
.ui-icon-carat-1-ne {
	background-position: -16px 0;
}
.ui-icon-carat-1-e {
	background-position: -32px 0;
}
.ui-icon-carat-1-se {
	background-position: -48px 0;
}
.ui-icon-carat-1-s {
	background-position: -64px 0;
}
.ui-icon-carat-1-sw {
	background-position: -80px 0;
}
.ui-icon-carat-1-w {
	background-position: -96px 0;
}
.ui-icon-carat-1-nw {
	background-position: -112px 0;
}
.ui-icon-carat-2-n-s {
	background-position: -128px 0;
}
.ui-icon-carat-2-e-w {
	background-position: -144px 0;
}
.ui-icon-triangle-1-n {
	background-position: 0 -16px;
}
.ui-icon-triangle-1-ne {
	background-position: -16px -16px;
}
.ui-icon-triangle-1-e {
	background-position: -32px -16px;
}
.ui-icon-triangle-1-se {
	background-position: -48px -16px;
}
.ui-icon-triangle-1-s {
	background-position: -64px -16px;
}
.ui-icon-triangle-1-sw {
	background-position: -80px -16px;
}
.ui-icon-triangle-1-w {
	background-position: -96px -16px;
}
.ui-icon-triangle-1-nw {
	background-position: -112px -16px;
}
.ui-icon-triangle-2-n-s {
	background-position: -128px -16px;
}
.ui-icon-triangle-2-e-w {
	background-position: -144px -16px;
}
.ui-icon-arrow-1-n {
	background-position: 0 -32px;
}
.ui-icon-arrow-1-ne {
	background-position: -16px -32px;
}
.ui-icon-arrow-1-e {
	background-position: -32px -32px;
}
.ui-icon-arrow-1-se {
	background-position: -48px -32px;
}
.ui-icon-arrow-1-s {
	background-position: -64px -32px;
}
.ui-icon-arrow-1-sw {
	background-position: -80px -32px;
}
.ui-icon-arrow-1-w {
	background-position: -96px -32px;
}
.ui-icon-arrow-1-nw {
	background-position: -112px -32px;
}
.ui-icon-arrow-2-n-s {
	background-position: -128px -32px;
}
.ui-icon-arrow-2-ne-sw {
	background-position: -144px -32px;
}
.ui-icon-arrow-2-e-w {
	background-position: -160px -32px;
}
.ui-icon-arrow-2-se-nw {
	background-position: -176px -32px;
}
.ui-icon-arrowstop-1-n {
	background-position: -192px -32px;
}
.ui-icon-arrowstop-1-e {
	background-position: -208px -32px;
}
.ui-icon-arrowstop-1-s {
	background-position: -224px -32px;
}
.ui-icon-arrowstop-1-w {
	background-position: -240px -32px;
}
.ui-icon-arrowthick-1-n {
	background-position: 0 -48px;
}
.ui-icon-arrowthick-1-ne {
	background-position: -16px -48px;
}
.ui-icon-arrowthick-1-e {
	background-position: -32px -48px;
}
.ui-icon-arrowthick-1-se {
	background-position: -48px -48px;
}
.ui-icon-arrowthick-1-s {
	background-position: -64px -48px;
}
.ui-icon-arrowthick-1-sw {
	background-position: -80px -48px;
}
.ui-icon-arrowthick-1-w {
	background-position: -96px -48px;
}
.ui-icon-arrowthick-1-nw {
	background-position: -112px -48px;
}
.ui-icon-arrowthick-2-n-s {
	background-position: -128px -48px;
}
.ui-icon-arrowthick-2-ne-sw {
	background-position: -144px -48px;
}
.ui-icon-arrowthick-2-e-w {
	background-position: -160px -48px;
}
.ui-icon-arrowthick-2-se-nw {
	background-position: -176px -48px;
}
.ui-icon-arrowthickstop-1-n {
	background-position: -192px -48px;
}
.ui-icon-arrowthickstop-1-e {
	background-position: -208px -48px;
}
.ui-icon-arrowthickstop-1-s {
	background-position: -224px -48px;
}
.ui-icon-arrowthickstop-1-w {
	background-position: -240px -48px;
}
.ui-icon-arrowreturnthick-1-w {
	background-position: 0 -64px;
}
.ui-icon-arrowreturnthick-1-n {
	background-position: -16px -64px;
}
.ui-icon-arrowreturnthick-1-e {
	background-position: -32px -64px;
}
.ui-icon-arrowreturnthick-1-s {
	background-position: -48px -64px;
}
.ui-icon-arrowreturn-1-w {
	background-position: -64px -64px;
}
.ui-icon-arrowreturn-1-n {
	background-position: -80px -64px;
}
.ui-icon-arrowreturn-1-e {
	background-position: -96px -64px;
}
.ui-icon-arrowreturn-1-s {
	background-position: -112px -64px;
}
.ui-icon-arrowrefresh-1-w {
	background-position: -128px -64px;
}
.ui-icon-arrowrefresh-1-n {
	background-position: -144px -64px;
}
.ui-icon-arrowrefresh-1-e {
	background-position: -160px -64px;
}
.ui-icon-arrowrefresh-1-s {
	background-position: -176px -64px;
}
.ui-icon-arrow-4 {
	background-position: 0 -80px;
}
.ui-icon-arrow-4-diag {
	background-position: -16px -80px;
}
.ui-icon-extlink {
	background-position: -32px -80px;
}
.ui-icon-newwin {
	background-position: -48px -80px;
}
.ui-icon-refresh {
	background-position: -64px -80px;
}
.ui-icon-shuffle {
	background-position: -80px -80px;
}
.ui-icon-transfer-e-w {
	background-position: -96px -80px;
}
.ui-icon-transferthick-e-w {
	background-position: -112px -80px;
}
.ui-icon-folder-collapsed {
	background-position: 0 -96px;
}
.ui-icon-folder-open {
	background-position: -16px -96px;
}
.ui-icon-document {
	background-position: -32px -96px;
}
.ui-icon-document-b {
	background-position: -48px -96px;
}
.ui-icon-note {
	background-position: -64px -96px;
}
.ui-icon-mail-closed {
	background-position: -80px -96px;
}
.ui-icon-mail-open {
	background-position: -96px -96px;
}
.ui-icon-suitcase {
	background-position: -112px -96px;
}
.ui-icon-comment {
	background-position: -128px -96px;
}
.ui-icon-person {
	background-position: -144px -96px;
}
.ui-icon-print {
	background-position: -160px -96px;
}
.ui-icon-trash {
	background-position: -176px -96px;
}
.ui-icon-locked {
	background-position: -192px -96px;
}
.ui-icon-unlocked {
	background-position: -208px -96px;
}
.ui-icon-bookmark {
	background-position: -224px -96px;
}
.ui-icon-tag {
	background-position: -240px -96px;
}
.ui-icon-home {
	background-position: 0 -112px;
}
.ui-icon-flag {
	background-position: -16px -112px;
}
.ui-icon-calendar {
	background-position: -32px -112px;
}
.ui-icon-cart {
	background-position: -48px -112px;
}
.ui-icon-pencil {
	background-position: -64px -112px;
}
.ui-icon-clock {
	background-position: -80px -112px;
}
.ui-icon-disk {
	background-position: -96px -112px;
}
.ui-icon-calculator {
	background-position: -112px -112px;
}
.ui-icon-zoomin {
	background-position: -128px -112px;
}
.ui-icon-zoomout {
	background-position: -144px -112px;
}
.ui-icon-search {
	background-position: -160px -112px;
}
.ui-icon-wrench {
	background-position: -176px -112px;
}
.ui-icon-gear {
	background-position: -192px -112px;
}
.ui-icon-heart {
	background-position: -208px -112px;
}
.ui-icon-star {
	background-position: -224px -112px;
}
.ui-icon-link {
	background-position: -240px -112px;
}
.ui-icon-cancel {
	background-position: 0 -128px;
}
.ui-icon-plus {
	background-position: -16px -128px;
}
.ui-icon-plusthick {
	background-position: -32px -128px;
}
.ui-icon-minus {
	background-position: -48px -128px;
}
.ui-icon-minusthick {
	background-position: -64px -128px;
}
.ui-icon-close {
	background-position: -80px -128px;
}
.ui-icon-closethick {
	background-position: -96px -128px;
}
.ui-icon-key {
	background-position: -112px -128px;
}
.ui-icon-lightbulb {
	background-position: -128px -128px;
}
.ui-icon-scissors {
	background-position: -144px -128px;
}
.ui-icon-clipboard {
	background-position: -160px -128px;
}
.ui-icon-copy {
	background-position: -176px -128px;
}
.ui-icon-contact {
	background-position: -192px -128px;
}
.ui-icon-image {
	background-position: -208px -128px;
}
.ui-icon-video {
	background-position: -224px -128px;
}
.ui-icon-script {
	background-position: -240px -128px;
}
.ui-icon-alert {
	background-position: 0 -144px;
}
.ui-icon-info {
	background-position: -16px -144px;
}
.ui-icon-notice {
	background-position: -32px -144px;
}
.ui-icon-help {
	background-position: -48px -144px;
}
.ui-icon-check {
	background-position: -64px -144px;
}
.ui-icon-bullet {
	background-position: -80px -144px;
}
.ui-icon-radio-off {
	background-position: -96px -144px;
}
.ui-icon-radio-on {
	background-position: -112px -144px;
}
.ui-icon-pin-w {
	background-position: -128px -144px;
}
.ui-icon-pin-s {
	background-position: -144px -144px;
}
.ui-icon-play {
	background-position: 0 -160px;
}
.ui-icon-pause {
	background-position: -16px -160px;
}
.ui-icon-seek-next {
	background-position: -32px -160px;
}
.ui-icon-seek-prev {
	background-position: -48px -160px;
}
.ui-icon-seek-end {
	background-position: -64px -160px;
}
.ui-icon-seek-start {
	background-position: -80px -160px;
}
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first {
	background-position: -80px -160px;
}
.ui-icon-stop {
	background-position: -96px -160px;
}
.ui-icon-eject {
	background-position: -112px -160px;
}
.ui-icon-volume-off {
	background-position: -128px -160px;
}
.ui-icon-volume-on {
	background-position: -144px -160px;
}
.ui-icon-power {
	background-position: 0 -176px;
}
.ui-icon-signal-diag {
	background-position: -16px -176px;
}
.ui-icon-signal {
	background-position: -32px -176px;
}
.ui-icon-battery-0 {
	background-position: -48px -176px;
}
.ui-icon-battery-1 {
	background-position: -64px -176px;
}
.ui-icon-battery-2 {
	background-position: -80px -176px;
}
.ui-icon-battery-3 {
	background-position: -96px -176px;
}
.ui-icon-circle-plus {
	background-position: 0 -192px;
}
.ui-icon-circle-minus {
	background-position: -16px -192px;
}
.ui-icon-circle-close {
	background-position: -32px -192px;
}
.ui-icon-circle-triangle-e {
	background:url(images/arrow-slim-e.png) no-repeat;
}
.ui-icon-circle-triangle-s {
	background-position: -64px -192px;
}
.ui-icon-circle-triangle-w {
	background:url(images/arrow-slim-w.png) no-repeat;
	/*background-position: -80px -192px;*/
}
.ui-icon-circle-triangle-n {
	background-position: -96px -192px;
}
.ui-icon-circle-arrow-e {
	background-position: -112px -192px;
}
.ui-icon-circle-arrow-s {
	background-position: -128px -192px;
}
.ui-icon-circle-arrow-w {
	background-position: -144px -192px;
}
.ui-icon-circle-arrow-n {
	background-position: -160px -192px;
}
.ui-icon-circle-zoomin {
	background-position: -176px -192px;
}
.ui-icon-circle-zoomout {
	background-position: -192px -192px;
}
.ui-icon-circle-check {
	background-position: -208px -192px;
}
.ui-icon-circlesmall-plus {
	background-position: 0 -208px;
}
.ui-icon-circlesmall-minus {
	background-position: -16px -208px;
}
.ui-icon-circlesmall-close {
	background-position: -32px -208px;
}
.ui-icon-squaresmall-plus {
	background-position: -48px -208px;
}
.ui-icon-squaresmall-minus {
	background-position: -64px -208px;
}
.ui-icon-squaresmall-close {
	background-position: -80px -208px;
}
.ui-icon-grip-dotted-vertical {
	background-position: 0 -224px;
}
.ui-icon-grip-dotted-horizontal {
	background-position: -16px -224px;
}
.ui-icon-grip-solid-vertical {
	background-position: -32px -224px;
}
.ui-icon-grip-solid-horizontal {
	background-position: -48px -224px;
}
.ui-icon-gripsmall-diagonal-se {
	background-position: -64px -224px;
}
.ui-icon-grip-diagonal-se {
	background-position: -80px -224px;
}
/* Misc visuals
----------------------------------*/

/* Corner radius */
.ui-corner-all, .ui-corner-top a, .ui-corner-left, .ui-corner-tl a{
	-moz-border-radius-topleft: 5px;
	-webkit-border-top-left-radius: 5px;
	-khtml-border-top-left-radius: 5px;
	border-top-left-radius: 5px;
}
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
	-moz-border-radius-topright: 5px;
	-webkit-border-top-right-radius: 5px;
	-khtml-border-top-right-radius: 5px;
	border-top-right-radius: 5px;
}
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
	/*-moz-border-radius-bottomleft: 5px;
	-webkit-border-bottom-left-radius: 5px;
	-khtml-border-bottom-left-radius: 5px;
	border-bottom-left-radius: 5px;*/
}
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
/*	-moz-border-radius-bottomright: 5px;
	-webkit-border-bottom-right-radius: 5px;
	-khtml-border-bottom-right-radius: 5px;
	border-bottom-right-radius: 5px;
*/}
/* Overlays */
.ui-widget-overlay {
	background: #000;
	opacity: .30;
	filter:Alpha(Opacity=30);
	 /* IE 8 */
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
}
.ui-widget-shadow {
	margin: -8px 0 0 -8px;
	padding: 8px;
	background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
	opacity: .30;
	filter:Alpha(Opacity=30);
	-moz-border-radius: 8px;
	-khtml-border-radius: 8px;
	-webkit-border-radius: 8px;
	border-radius: 8px;
}/*
 * jQuery UI Resizable 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Resizable#theming
 */
.ui-resizable {
	position: relative;
}
.ui-resizable-handle {
	position: absolute;
	font-size: 0.1px;
	z-index: 99999;
	display: block;
}
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle {
	display: none;
}
.ui-resizable-n {
	cursor: n-resize;
	height: 7px;
	width: 100%;
	top: -5px;
	left: 0;
}
.ui-resizable-s {
	cursor: s-resize;
	height: 7px;
	width: 100%;
	bottom: -5px;
	left: 0;
}
.ui-resizable-e {
	cursor: e-resize;
	width: 7px;
	right: -5px;
	top: 0;
	height: 100%;
}
.ui-resizable-w {
	cursor: w-resize;
	width: 7px;
	left: -5px;
	top: 0;
	height: 100%;
}
.ui-resizable-se {
	cursor: se-resize;
	width: 12px;
	height: 12px;
	right: 1px;
	bottom: 1px;
}
.ui-resizable-sw {
	cursor: sw-resize;
	width: 9px;
	height: 9px;
	left: -5px;
	bottom: -5px;
}
.ui-resizable-nw {
	cursor: nw-resize;
	width: 9px;
	height: 9px;
	left: -5px;
	top: -5px;
}
.ui-resizable-ne {
	cursor: ne-resize;
	width: 9px;
	height: 9px;
	right: -5px;
	top: -5px;
}/*
 * jQuery UI Selectable 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Selectable#theming
 */
.ui-selectable-helper {
	position: absolute;
	z-index: 100;
	border:1px dotted black;
}
/*
 * jQuery UI Accordion 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Accordion#theming
 */
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion {
	width: 100%;
}
.ui-accordion .ui-accordion-header {
	cursor: pointer;
	position: relative;
	margin-top: 1px;
	zoom: 1;
}
.ui-accordion .ui-accordion-li-fix {
	display: inline;
}
.ui-accordion .ui-accordion-header-active {
	border-bottom: 0 !important;
}
.ui-accordion .ui-accordion-header a {
	display: block;
	font-size: 1em;
	padding: .5em .5em .5em .7em;
}
.ui-accordion-icons .ui-accordion-header a {
	padding-left: 2.2em;
}
.ui-accordion .ui-accordion-header .ui-icon {
	position: absolute;
	left: .5em;
	top: 50%;
	margin-top: -8px;
}
.ui-accordion .ui-accordion-content {
	padding: 1em 2.2em;
	border-top: 0;
	margin-top: -2px;
	position: relative;
	top: 1px;
	margin-bottom: 2px;
	overflow: auto;
	display: none;
	zoom: 1;
}
.ui-accordion .ui-accordion-content-active {
	display: block;
}
/*
 * jQuery UI Autocomplete 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Autocomplete#theming
 */
.ui-autocomplete {
	position: absolute;
	cursor: default;
}
/* workarounds */
* html .ui-autocomplete {
	width:1px;
} /* without this, the menu expands to 100% in IE6 */
/*
 * jQuery UI Menu 1.8.16
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Menu#theming
 */
.ui-menu {
	list-style:none;
	padding: 2px;
	margin: 0;
	display:block;
	float: left;
}
.ui-menu .ui-menu {
	margin-top: -3px;
}
.ui-menu .ui-menu-item {
	margin:0;
	padding: 0;
	zoom: 1;
	float: left;
	clear: left;
	width: 100%;
}
.ui-menu .ui-menu-item a {
	text-decoration:none;
	display:block;
	padding:.2em .4em;
	line-height:1.5;
	zoom:1;
}
/*
 * jQuery UI Button 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Button#theming
 */
.ui-button {
	margin:0 5px 0px 0;
	color:#515357;
	padding:6px 10px;
	cursor:pointer;
	display:inline-block;
	background-color:#fff;
	border:1px solid #bbbbbb;
	border-bottom:2px solid #cbcbcb;
	font-weight:bold;
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	-o-border-radius: 3px;
	-ms-border-radius: 3px;
	border-radius: 3px;
}
.ui-button:hover {
	background-color: #505f7c;
	border:1px solid #505f7c;
	border-bottom:2px solid #374051;
	text-decoration:none; color:#fff;}
.ui-button.ui-dialog-titlebar-close:hover { background-color:transparent; border:none; }
/* the overflow property removes extra width in IE */
.ui-button-icon-only {
	/*width: 2.2em;*/
} /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only {
/*	width: 2.4em;*/
} /* button elements seem to need a little more width */
button.ui-button-icon-only:before { content:"";}
.ui-button-icons-only {
	width: 3.4em;
}
button.ui-button-icons-only {
	width: 3.7em;
}
/*button text element */
.ui-button .ui-button-text {
	display: block;
	line-height: 1.4;
}
.ui-button-text-only .ui-button-text {
	/*padding: .4em 1em;*/
}
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
	padding: .4em;
	text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text {
	padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text {
	padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
	padding-left: 2.1em;
	padding-right: 2.1em;
}
/* no icon support for input elements, provide padding by default */
input.ui-button {
	padding: 0.4em 0.6em;
}
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon {
	position: absolute;
	top: 50%;
	margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
	left: 50%;
	margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary {
	left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
	right: .5em;
}
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
	right: .5em;
}
/*button sets*/
.ui-buttonset {
	margin-right: 7px;
}
.ui-buttonset .ui-button {
	margin-left: 0;
	margin-right: -.3em;
}

/* workarounds */
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
} /* reset extra padding in Firefox */
/*
 * jQuery UI Dialog 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Dialog#theming
 */
.ui-dialog {
	/*position: fixed !important;*/
	padding: .2em;
	width: 300px;
	overflow: hidden;
	border:none !important;
	-webkit-box-shadow: 0 0 9px rgba(0,0,0,.37);
	-moz-box-shadow: 0 0 9px rgba(0,0,0,.37);
	box-shadow: 0 0 9px rgba(0,0,0,.37);
	z-index: 9999;
}

.ui-dialog .ui-dialog-titlebar {
	padding:0 20px !important;
	position: relative; background-color: #273952;
}

.ui-dialog .ui-dialog-title {
	float: left;  color:#fff;
	font-size:13px; font-weight:bold; line-height:40px;
}
.ui-dialog-titlebar-close {
	background:url(images/close.png) no-repeat;
	position: absolute;
	right:10px;
	border:none;
	display: inline-block;
	height:20px; width:20px; top:10px; padding: 0;
}

/*.ui-dialog-titlebar-close:hover { 	background:#7b7b7b;}
*/.ui-dialog-titlebar-close span {
	display: block;
	margin: 3px;

}

.ui-dialog .ui-dialog-content {
	position: relative;
	border: 0;
	background: none;
	overflow: visible;
	zoom: 1;

}
.ui-dialog .ui-dialog-buttonpane {
	text-align: left;
	border: none;
	background-image: none;
	margin: .5em 0 0 0;
	padding: .3em 1em .5em .4em;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
	float: right;
}
.ui-dialog .ui-dialog-buttonpane button {
	margin: .5em .4em .5em 0;
	cursor: pointer;
}
.ui-dialog .ui-resizable-se {
	width: 14px;
	height: 14px;
	right: 3px;
	bottom: 3px;
}
.ui-draggable .ui-dialog-titlebar {
	cursor: move;
}
/*
 * jQuery UI Slider 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Slider#theming
 */
.ui-slider {
	position: relative;
	text-align: left;
}
.ui-slider .ui-slider-handle {
	position: absolute;
	z-index: 2;
	width: 1.2em;
	height: 1.2em;
	cursor: default;
}
.ui-slider .ui-slider-range {
	position: absolute;
	z-index: 1;
	font-size: .7em;
	display: block;
	border: 0;
	background-position: 0 0;
}
.ui-slider-horizontal {
	height: .8em;
}
.ui-slider-horizontal .ui-slider-handle {
	top: -.3em;
	margin-left: -.6em;
}
.ui-slider-horizontal .ui-slider-range {
	top: 0;
	height: 100%;
}
.ui-slider-horizontal .ui-slider-range-min {
	left: 0;
}
.ui-slider-horizontal .ui-slider-range-max {
	right: 0;
}
.ui-slider-vertical {
	width: .8em;
	height: 100px;
}
.ui-slider-vertical .ui-slider-handle {
	left: -.3em;
	margin-left: 0;
	margin-bottom: -.6em;
}
.ui-slider-vertical .ui-slider-range {
	left: 0;
	width: 100%;
}
.ui-slider-vertical .ui-slider-range-min {
	bottom: 0;
}
.ui-slider-vertical .ui-slider-range-max {
	top: 0;
}/*
 * jQuery UI Tabs 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Tabs#theming
 */
.ui-tabs {
	position: relative;
	padding: .2em;
	zoom: 1;
} /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav {
	margin: 0;
	padding:0;
}
.ui-tabs .ui-tabs-nav li {/*
	list-style: none;
	float: left;
	position: relative;
	top: 1px;
	margin: 0 .2em 1px 0;
	border-bottom: 0 !important;
	padding: 0;
	white-space: nowrap;*/
}
.ui-tabs .ui-tabs-nav li a {
	float: left;
	padding:12px 18px;
	text-decoration: none;
}
.ui-tabs .ui-tabs-nav li:first a
{
	border-top-left-radius: 5px;

	}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected {
/*	margin-bottom: 0;
	padding-bottom: 1px;
	background:#F5F5F5; top:0;*/
}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a {
	/*cursor: text;*/
}
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a {
	cursor: pointer;
} /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel {
	display: block;
	border-width: 0;
	padding:15px;
	background: none;
}
.ui-tabs .ui-tabs-hide {
	display: none !important;
}
/*

 * jQuery UI Datepicker 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Datepicker#theming
 */
.ui-datepicker {
	width: 18em;
	padding: .2em .2em 0;
	display: none;
}
.ui-datepicker .ui-datepicker-header {
	position:relative;
	padding:2px 0 !important;
}
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
	position:absolute;
	top: 10px;
	width: 12px;
	height: 12px;
}
.ui-datepicker .ui-datepicker-prev {
	left:5px;
}
.ui-datepicker .ui-datepicker-next {
	right:10px;
}
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
	display: block;
	position: absolute;
	left: 50%;
	top: 50%;
	margin-top: -8px;
	cursor:pointer;
}
.ui-datepicker .ui-datepicker-title {
	margin:0.3em;
	line-height: 1.8em;
	text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
	font-size:1em;
	margin:1px 0;
}
.ui-datepicker select.ui-datepicker-month-year {
	width: 100%;
}
.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year {
	width: 40%;
}
.ui-datepicker table {
	width: 100%;
	font-size: .9em;
	border-collapse: collapse;
	margin:0 0 .4em;
}
.ui-datepicker th {
	padding: .7em .3em;
	text-align: center;
	font-weight: bold;
	border: 0;
}
.ui-datepicker td {
	border: 0;
	padding: 1px;
}
.ui-datepicker td span, .ui-datepicker td a {
	display: block;
	padding: .2em;
	text-align:center;
	text-decoration: none;
}
.ui-datepicker td span, .ui-datepicker td a:hover { background:#c9e5ef; }

.ui-datepicker .ui-datepicker-buttonpane {
	background-image: none;
	margin: .7em 0 0 0;
	padding:0 .2em;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
	float: right;
	margin: .5em .2em .4em;
	cursor: pointer;
	padding: .2em .6em .3em .6em;
	width:auto;
	overflow:visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
	float:left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
	width:auto;
}
.ui-datepicker-multi .ui-datepicker-group {
	float:left;
}
.ui-datepicker-multi .ui-datepicker-group table {
	width:95%;
	margin:0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
	width:50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
	width:33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
	width:25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header {
	border-left-width:0;
}
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
	border-left-width:0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
	clear:left;
}
.ui-datepicker-row-break {
	clear:both;
	width:100%;
	font-size:0em;
}
/* RTL support */
.ui-datepicker-rtl {
	direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
	right: 2px;
	left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
	left: 2px;
	right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
	right: 1px;
	left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
	left: 1px;
	right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
	clear:right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
	float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current {
	float:right;
}
.ui-datepicker-rtl .ui-datepicker-group {
	float:right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header {
	border-right-width:0;
	border-left-width:1px;
}
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
	border-right-width:0;
	border-left-width:1px;
}
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
	display: none; /*sorry for IE5*/
	display/**/: block; /*sorry for IE5*/
	position: absolute; /*must have*/
	z-index: -1; /*must have*/
	top: -4px; /*must have*/
	left: -4px; /*must have*/
	width: 200px; /*must have*/
	height: 200px; /*must have*/
}/*
 * jQuery UI Progressbar 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Progressbar#theming
 */
.ui-progressbar {
	height:2em;
	text-align: left;
}
.ui-progressbar .ui-progressbar-value {
	margin: -1px;
	height:100%;
}
.cssClassHelpTitle {
	font-size:12px;
	font-weight:bold;
	color:#666;
	padding:3px;
	position:relative;
	margin: 10px 0 0;
	display:block;
}
/*- new tab panel -*/
div.ajax__tab_default, div.ui-widget-content {
	background:#fff;
	border:1px solid #ccc;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	padding:0;
}
.ajax__tab_header {
	background-image:none !important;
	color: #ffffff;
	line-height:15px;
	font-weight: bold;
	border-bottom:1px solid #ccc;
	background-color: #ededed !important;
	-webkit-border-top-left-radius: 5px;
	-webkit-border-top-right-radius: 5px;
	-moz-border-radius-topleft: 5px;
	-moz-border-radius-topright: 5px;
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
}
.ajax__tab_xp .ajax__tab_tab {
	padding:12px 18px !important;
}

.ajax__tab_xp .ajax__tab_outer { -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px;
	padding-right:0px !important;
	height:auto !important; background:transparent !important;
	margin:0 !important;
	color: #2e6e9e !important;
	border-bottom:none !important;  border-right: 1px solid #ccc !important;
}
.ajax__tab_xp .ajax__tab_inner {
	padding:0 !important;
	background:none !important;
}
.ajax__tab_xp .ajax__tab_inner span.ajax__tab_tab {
	background:transparent !important;
	font-size:13px;
	font-weight:normal;
	color:#666;
	font-weight:bold !important;
}
.ajax__tab_active span.ajax__tab_outer {

	background:#fff !important;
	 -webkit-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff;
	font-weight: bold;
	color: #e17009;
}
.ajax__tab_active span.ajax__tab_outer span.ajax__tab_inner {
	background:none !important;
}
.ajax__tab_inner:hover span { color:#0B4B83 !important;}
.ajax__tab_active span.ajax__tab_outer span.ajax__tab_inner span {
	background:#fff !important;
	color:#2D4C80 !important;
}

.ajax__tab_xp .ajax__tab_body {
	font-weight:normal !important;
	border:none !important;
	background:none !important;
}
a.ui-dialog-titlebar-maximize,a.ui-dialog-titlebar-restore { position:absolute; right:50px !important; top:9px; padding:0 !important;}
a.ui-dialog-titlebar-maximize:hover, a.ui-dialog-titlebar-restore:hover { text-decoration:none;}
a.ui-dialog-titlebar-restore span {  background:url(images/minimize.png) no-repeat center !important;}
a.ui-dialog-titlebar-maximize span { background:url(images/maximize.png) no-repeat center !important;}

.ajax__tab_panel { padding:15px;}

.ui-dialog  .sfFormwrapper { background:#fff !important;}
.ui-dialog-titlebar.ui-corner-all { -webkit-border-bottom-right-radius:0px; -webkit-border-bottom-left-radius:0px; border-bottom-right-radius:0px; border-bottom-left-radius:0px;}

/*************************pagehelp*************************/
.sfPageHelpHolder { width:100%; padding:20px; margin-bottom:15px; background-color:#324468; height:280px; clear:both;
border-radius: 3px 0px 3px 3px; -webkit-border-radius: 3px 0px 3px 3px; -o-border-radius: 3px 0px 3px 3px; -ms-border-radius: 3px 0px 3px 3px; -moz-border-radius: 3px 0px 3px 3px;
box-sizing:border-box; -moz-box-sizing:border-box; -o-box-sizing:border-box; -webkit-box-sizing:border-box; -ms-box-sizing:border-box;}
.sfPageHelpHolder strong, .sfPageHelpHolder b { font-weight:bold;}
.sfPageHelpHolder ul li { list-style:disc; margin-right:2px;}
#sfPageHelpDetails { width:74%; float:left;}
#sfPageHelpDetails.ui-widget-content { background:none; border:none;}
.sfPageHelpHolder h4, .sfPageHelpDetails h4 { font-size:16px; color:#fff; margin-bottom:10px; font-weight:normal;}
.sfPageHelpMoreInfo { width:23%; float:right; padding:24px; background:#121212; background:rgba(0,0,0,0.3);
box-sizing:border-box; -moz-box-sizing:border-box; -o-box-sizing:border-box; -webkit-box-sizing:border-box; -ms-box-sizing:border-box;}
.sfPageHelpMoreInfo h6 { font-size:13px; color:#fff; margin-bottom:10px;}
.sfPageHelpHolder a { color:#7e9ec6;}

/*Horizontal tab*/
.ui-tabs ul.sfHorTabMenu.ui-tabs-nav { border-bottom:1px solid #627083;
border-radius:0px; -webkit-border-radius:0px; -o-border-radius:0px; -ms-border-radius:0px; -moz-border-radius:0px;}
.ui-tabs ul.sfHorTabMenu.ui-tabs-nav.ui-widget-header { background:none;}
.ui-tabs ul.sfHorTabMenu.ui-tabs-nav li { display:inline-block; width:auto; height:24px; line-height:24px; margin-right:3px; }
.ui-tabs ul.sfHorTabMenu.ui-tabs-nav li a { display:inline-block; width:auto; padding:0px 15px; height:24px; line-height:24px; border:none; color:#fff; font-weight:normal; background:#505050; background:rgba(255,255,255,0.2);-webkit-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0; -o-border-radius: 3px 3px 0 0; -ms-border-radius: 3px 3px 0 0;}
.ui-tabs ul.sfHorTabMenu.ui-tabs-nav li a:hover { background:#949494; background:rgba(255,255,255,0.5);}
.ui-tabs ul.sfHorTabMenu.ui-tabs-nav li.ui-tabs-active a{ background:#fff; color:#1a1a1a; text-decoration:none;}

.sfBreadcrumb .sfPageHelpHolder ul { width:100%; float:none;}
.sfBreadcrumb .sfPageHelpHolder ul li { background-image:none;}
.sfBreadcrumb .sfPageHelpHolder ul li a { text-decoration:none;}

.sfHorTabContentHolder { padding:15px 8px !important; color:#d1d1d1;
box-sizing:border-box; -moz-box-sizing:border-box; -o-box-sizing:border-box; -webkit-box-sizing:border-box; -ms-box-sizing:border-box;}
.sfHorTabContentHolder p { margin-bottom:12px; color:#adb2b9; font-size:13px; line-height:20px;}

.ajax__tab_xp .ajax__tab_header, .ajax__tab_xp .ajax__tab_body { font-family:Tahoma, Geneva, sans-serif !important;}

#dialog{
    padding: 15px; /* gap in confirmation boxes */
}
body > form > #dialog { /* to remove the bottom gap in admin pages */
    padding: 0;
}


text:
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;

namespace LeagueOfMonads
{
   public class Lasync<T>
   {
      private readonly Func<Task<T>> _factory;
      private Lazy<Task<T>> _value;

      public Task<T> Task => _value.Value;

      public Lasync(Func<Task<T>> factory)
      {
         _factory = factory;
         _value = new Lazy<Task<T>>(factory, true);
      }

      public void Reset()
      {
         _value = new Lazy<Task<T>>(_factory, true);
      }

      public TaskAwaiter<T> GetAwaiter()
      {
         return _value.Value.GetAwaiter();
      }
   }

   public static class Lasync
   {
      public static Lasync<T> Create<T>(Func<Task<T>> f)
      {
         return new Lasync<T>(f);
      }
   }
}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure.Internal.Subscriptions;
using Microsoft.Azure.Internal.Subscriptions.Models;
using System;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkClient
{
    public class SubscriptionSdkClient
    {
        public ISubscriptionClient SubscriptionClient { get; set; }

        public Action<string> VerboseLogger { get; set; }

        public Action<string> ErrorLogger { get; set; }

        public Action<string> WarningLogger { get; set; }

        /// <summary>
        /// Creates new SubscriptionsClient
        /// </summary>
        /// <param name="context">Profile containing resources to manipulate</param>
        public SubscriptionSdkClient(IAzureContext context)
            : this(
                AzureSession.Instance.ClientFactory.CreateArmClient<SubscriptionClient>(context, AzureEnvironment.Endpoint.ResourceManager))
        {

        }

        /// <summary>
        /// Creates new SubscriptionsClient instance
        /// </summary>
        /// <param name="subscriptionClient">The subscription client instance</param>
        public SubscriptionSdkClient(ISubscriptionClient subscriptionClient)
        {
            this.SubscriptionClient = subscriptionClient;
        }

        public List<Location> ListLocations(string subscriptionId)
        {
            var locationList = new List<Location>();

            var tempResult = this.SubscriptionClient.Subscriptions.ListLocations(subscriptionId);
            locationList.AddRange(tempResult);

            return locationList;
        }
    }
}


text:
using Mailer.Abstractions;
using Mailer.Attachments.Sql;
using Mailer.Recorders.Sql;
using Mailer.SG;
using Mailer.Smtp;
using Mailer.Sql;
using Mailer.Worker.WindowsService;
using ServiceHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using System.Timers;

namespace Mailer.WindowsService
{
    partial class MailerService : DebuggableService
    {
        readonly MailerServiceHelper Service;
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        public MailerService()
        {
            InitializeComponent();

            var queueConfiguration = LoadQueueConfiguration();
            Service = new MailerServiceHelper(queueConfiguration);
        }

        public  List<QueueHolder> LoadQueueConfiguration()
        {
            QueueConfigurationSection queueSetup = (QueueConfigurationSection)ConfigurationManager.GetSection("queues");

            List<QueueHolder> queueHolders = SetupQueueHolders(queueSetup);

            return queueHolders;
        }

        private List<QueueHolder> SetupQueueHolders(QueueConfigurationSection queueSetup)
        {
            List<QueueHolder> retVal = new List<QueueHolder>();

            foreach (QueueConfigurationElement queue in queueSetup.Queues)
            {
                QueueHolder q = SetupQueueHolder(queue);
                retVal.Add(q);
            }

            return retVal;
        }

        private  QueueHolder SetupQueueHolder(QueueConfigurationElement config)
        {
            QueueHolder retVal = new QueueHolder();

            retVal.Config = config;

            switch (config.Queue.ToLower())
            {
                case "mailer.sql.sqlqueue":
                    retVal.Queue = new SqlQueue($"name={config.QueueConnectionStringKey}");
                    break;
            }

            switch (config.Recorder.ToLower())
            {
                case "mailer.recorders.sql.sqlrecorder":
                    if (String.IsNullOrEmpty(config.RecorderMailMessageSql))
                    {
                        //use default sql
                        retVal.Recorder = new SqlRecorder($"name={config.RecorderConnectionStringKey}");
                    }
                    else
                    {
                        //use custom sql
                        retVal.Recorder =
                            new SqlRecorder
                            (
                                $"name={config.RecorderConnectionStringKey}",
                                $"{config.RecorderMailMessageSql}",
                                $"{config.RecorderMailMessageAddressSql}",
                                $"{config.RecorderMailMessageAttachmentSql}"
                            );
                    }

                    break;
            }

            switch (config.AttachmentProvider.ToLower())
            {
                case "mailer.attachments.sql.sqlattachmentprovider":
                    retVal.AttachmentProvider = new SqlAttachmentProvider($"name={config.AttachmentConnectionStringKey}", config.AttachmentSql);
                    break;
            }

            switch (config.Sender.ToLower())
            {
                case "mailer.smtp.smtpsender":
                    SmtpSenderConfiguration smtpConfig = GetSmtpSenderConfiguration(config);
                    SmtpSender smtpSender = new SmtpSender(retVal.AttachmentProvider, smtpConfig, retVal.Recorder);
                    retVal.Sender = smtpSender;
                    break;
                case "mailer.sg.sendgridsender":
                    SendGridSenderConfiguration sgConfig = GetSendGridSenderConfiguration(config);
                    SendGridSender sgSender = new SendGridSender(retVal.AttachmentProvider, sgConfig, retVal.Recorder);
                    retVal.Sender = sgSender;
                    break;
            }

            if (retVal.Queue == null)
            {
                throw new Exception($"Queue {config.Name} is not setup correctly - check queue configuration");
            }

            if (retVal.Sender == null)
            {
                throw new Exception($"Sender for Queue {config.Name} is not setup correctly - check queue configuration");
            }

            if (retVal.AttachmentProvider == null)
            {
                throw new Exception($"AttachmentProvider for Queue {config.Name} is not setup correctly - check queue configuration");
            }

            if (retVal.AttachmentProvider == null)
            {
                throw new Exception($"Recorder for Queue {config.Name} is not setup correctly - check queue configuration");
            }

            return retVal;
        }

        private static SmtpSenderConfiguration GetSmtpSenderConfiguration(QueueConfigurationElement config)
        {
            SmtpSenderConfiguration retVal = new SmtpSenderConfiguration();

            retVal.EnableSsl = config.SenderEnableSsl;
            retVal.Host = config.SenderHost;
            retVal.Password = config.SenderPassword;
            retVal.PickupDirectoryLocation = config.SenderPickupDirectoryLocation;
            retVal.Port = config.SenderPort;
            retVal.TargetName = config.SenderTargetName;
            retVal.Timeout = config.SenderTimeout;
            retVal.UseDefaultCredentials = config.SenderUseDefaultCredentials;
            retVal.UserName = config.SenderUserName;

            return retVal;
        }

        private static SendGridSenderConfiguration GetSendGridSenderConfiguration(QueueConfigurationElement config)
        {
            SendGridSenderConfiguration retVal = new SendGridSenderConfiguration();
            retVal.ApiKey = config.SenderUserName;

            return retVal;
        }

        protected override void OnStart(string[] args)
        {
            try
            {
                Service.OnStart(args);
            }
            catch (Exception ex)
            {
                log.Error("Error during OnStart", ex);
            }

        }

        protected override void OnStop()
        {
            try
            {
                Service.OnStop();
            }
            catch (Exception ex)
            {
                log.Error("Error during OnStop", ex);
            }
        }

        protected override void OnContinue()
        {
            try
            {
                Service.OnContinue();
            }
            catch (Exception ex)
            {
                log.Error("Error during OnContinue", ex);
            }
        }

        protected override void OnPause()
        {
            try
            {
                Service.OnPause();
            }
            catch (Exception ex)
            {
                log.Error("Error during OnPause", ex);
            }
        }

    }
}


text:
package api;

public class InputException extends Exception {

    public InputException(String message) {
        super(message);
    }

    public InputException(String message, Throwable cause) {
        super(message, cause);
    }
}


text:
/**
 * Created by praneeth on 9/3/2016.
 */
define(['./app'], function (app) {
    'use strict';

    return app.config(function ($stateProvider, $urlRouterProvider) {
        $stateProvider

            .state('vone', {
                url: '/vone',
                templateUrl: './partials/user/vone.html',
                controller: 'mainCtrl'
            })
            .state('template', {
                abstract: true,
                controller: function ($scope) {
                    console.error("TEMPLATE");
                },
                views: {
                    '': {
                        templateUrl: './partials/main/template.html'
                    },
                    'menu@template': {
                        templateUrl: './partials/main/navigation/menu.html',
                        controller: 'menuCtrl'
                    },
                    'nav-bar@template': {
                        templateUrl: './partials/main/navigation/nav-bar.html',
                        controller: function ($scope) {
                            console.log("NAV_BAR");
                        }
                    }
                }
            })
            .state('template.dashboard', {
                url: '/dashboard',
                templateUrl: './partials/main/dashboard.html',
                controller: function ($scope) {
                    console.log("DASH B");
                }
            })
            .state('login', {
                url: '/login',
                templateUrl: './partials/main/login.html',
                controller: 'loginCtrl'
            });

        $urlRouterProvider.otherwise('/dashboard');
    });

});


text:
package org.innovateuk.ifs.user.service;

import org.innovateuk.ifs.BaseRestServiceUnitTest;
import org.innovateuk.ifs.commons.rest.RestResult;
import org.innovateuk.ifs.user.resource.AgreementResource;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.springframework.http.HttpStatus.OK;

public class AgreementRestServiceImplTest extends BaseRestServiceUnitTest<AgreementRestServiceImpl> {

    protected AgreementRestServiceImpl registerRestServiceUnderTest() {
        return new AgreementRestServiceImpl();
    }

    private static final String agreementUrl = "/agreement";

    @Test
    public void getCurrentContract() {
        AgreementResource agreementResource = new AgreementResource();

        setupGetWithRestResultExpectations(agreementUrl + "/find-current", AgreementResource.class, agreementResource, OK);
        RestResult<AgreementResource> result = service.getCurrentAgreement();

        assertEquals(agreementResource, result.getSuccess());
    }
}


text:
if not defined?(SunspotRails::Generators::InstallGenerator)
  require 'generators/sunspot_rails/install/install_generator.rb'
end

module Spree::Sunspot
  module Generators
    class InstallGenerator < Rails::Generators::Base
      def self.source_root
        @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
      end

      def invoke_sunspot_rails_generator
        SunspotRails::Generators::InstallGenerator.start
      end

      def add_initializer
        template "config/initializers/spree_sunspot.rb"
      end

      def add_javascripts
        append_file "app/assets/javascripts/store/all.js", "//= require store/spree_sunspot\n"
        append_file "app/assets/javascripts/admin/all.js", "//= require admin/spree_sunspot\n"
      end

      def add_stylesheets
        inject_into_file "app/assets/stylesheets/store/all.css", " *= require store/spree_sunspot\n", :before => /\*\//, :verbose => true
        inject_into_file "app/assets/stylesheets/admin/all.css", " *= require admin/spree_sunspot\n", :before => /\*\//, :verbose => true
      end

      def add_migrations
        run 'bundle exec rake railties:install:migrations FROM=spree_sunspot'
      end

      def run_migrations
         res = ask "Would you like to run the migrations now? [Y/n]"
         if res == "" || res.downcase == "y"
           run 'bundle exec rake db:migrate'
         else
           puts "Skiping rake db:migrate, don't forget to run it!"
         end
      end
    end
  end
end


text:
package org.apache.spark.examples.h2o

import hex.deeplearning.{DeepLearning, DeepLearningModel, DeepLearningParameters}
import org.apache.spark.examples.h2o.DemoUtils._
import org.apache.spark.h2o._
import org.apache.spark.mllib.feature.{HashingTF, IDF, IDFModel}
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{DataFrame, SQLContext}
import org.apache.spark.{SparkConf, SparkContext, SparkFiles, mllib}
import water.app.{ModelMetricsSupport, SparkContextSupport}

/**
 * Demo for NYC meetup and MLConf 2015.
 *
 * It predicts spam text messages.
 * Training dataset is available in the file smalldata/smsData.txt.
 */
object HamOrSpamDemo extends SparkContextSupport with ModelMetricsSupport {

  val DATAFILE="smsData.txt"
  val TEST_MSGS = Seq(
    "Michal, beer tonight in MV?",
    "We tried to contact you re your reply to our offer of a Video Handset? 750 anytime any networks mins? UNLIMITED TEXT?")

  def main(args: Array[String]) {
    val conf: SparkConf = configure("Sparkling Water Meetup: Ham or Spam (spam text messages detector)")
    // Create SparkContext to execute application on Spark cluster
    val sc = new SparkContext(conf)
    // Register input file as Spark file
    addFiles(sc, absPath("examples/smalldata/" + DATAFILE))
    // Initialize H2O context
    implicit val h2oContext = new H2OContext(sc).start()
    import h2oContext._
    // Initialize SQL context
    implicit val sqlContext = new SQLContext(sc)
    import sqlContext.implicits._

    // Data load
    val data = load(sc, DATAFILE)
    // Extract response spam or ham
    val hamSpam = data.map( r => r(0))
    val message = data.map( r => r(1))
    // Tokenize message content
    val tokens = tokenize(message)

    // Build IDF model
    var (hashingTF, idfModel, tfidf) = buildIDFModel(tokens)

    // Merge response with extracted vectors
    val resultRDD: DataFrame = hamSpam.zip(tfidf).map(v => SMS(v._1, v._2)).toDF

    val table:H2OFrame = resultRDD

    // Split table
    val keys = Array[String]("train.hex", "valid.hex")
    val ratios = Array[Double](0.8)
    val frs = split(table, keys, ratios)
    val (train, valid) = (frs(0), frs(1))
    table.delete()

    // Build a model
    val dlModel = buildDLModel(train, valid)

    // Collect model metrics
    val trainMetrics = binomialMM(dlModel, train)
    val validMetrics = binomialMM(dlModel, valid)
    println(
      s"""
         |AUC on train data = ${trainMetrics.auc._auc}
         |AUC on valid data = ${validMetrics.auc._auc}
       """.stripMargin)

    // Detect spam messages
    TEST_MSGS.foreach(msg => {
      println(
        s"""
           |"$msg" is ${if (isSpam(msg,sc, dlModel, hashingTF, idfModel)) "SPAM" else "HAM"}
       """.stripMargin)
    })

    sc.stop()
  }

  /** Data loader */
  def load(sc: SparkContext, dataFile: String): RDD[Array[String]] = {
    sc.textFile(SparkFiles.get(dataFile)).map(l => l.split("\t")).filter(r => !r(0).isEmpty)
  }

  /** Text message tokenizer.
    *
    * Produce a bag of word representing given message.
    *
    * @param data RDD of text messages
    * @return RDD of bag of words
    */
  def tokenize(data: RDD[String]): RDD[Seq[String]] = {
    val ignoredWords = Seq("the", "a", "", "in", "on", "at", "as", "not", "for")
    val ignoredChars = Seq(',', ':', ';', '/', '<', '>', '"', '.', '(', ')', '?', '-', '\'','!','0', '1')

    val texts = data.map( r=> {
      var smsText = r.toLowerCase
      for( c <- ignoredChars) {
        smsText = smsText.replace(c, ' ')
      }

      val words =smsText.split(" ").filter(w => !ignoredWords.contains(w) && w.length>2).distinct

      words.toSeq
    })
    texts
  }

  /** Buil tf-idf model representing a text message. */
  def buildIDFModel(tokens: RDD[Seq[String]],
                    minDocFreq:Int = 4,
                    hashSpaceSize:Int = 1 << 10): (HashingTF, IDFModel, RDD[mllib.linalg.Vector]) = {
    // Hash strings into the given space
    val hashingTF = new HashingTF(hashSpaceSize)
    val tf = hashingTF.transform(tokens)
    // Build term frequency-inverse document frequency
    val idfModel = new IDF(minDocFreq = minDocFreq).fit(tf)
    val expandedText = idfModel.transform(tf)
    (hashingTF, idfModel, expandedText)
  }

  /** Builds DeepLearning model. */
  def buildDLModel(train: Frame, valid: Frame,
                   epochs: Int = 10, l1: Double = 0.001, l2: Double = 0.0,
                   hidden: Array[Int] = Array[Int](200, 200))
                  (implicit h2oContext: H2OContext): DeepLearningModel = {
    import h2oContext._
    // Build a model
    val dlParams = new DeepLearningParameters()
    dlParams._model_id = water.Key.make("dlModel.hex")
    dlParams._train = train
    dlParams._valid = valid
    dlParams._response_column = 'target
    dlParams._epochs = epochs
    dlParams._l1 = l1
    dlParams._hidden = hidden

    // Create a job
    val dl = new DeepLearning(dlParams)
    val dlModel = dl.trainModel.get

    // Compute metrics on both datasets
    dlModel.score(train).delete()
    dlModel.score(valid).delete()

    dlModel
  }

  /** Spam detector */
  def isSpam(msg: String,
             sc: SparkContext,
             dlModel: DeepLearningModel,
             hashingTF: HashingTF,
             idfModel: IDFModel,
             hamThreshold: Double = 0.5)
            (implicit sqlContext: SQLContext, h2oContext: H2OContext):Boolean = {
    import h2oContext._
    import sqlContext.implicits._
    val msgRdd = sc.parallelize(Seq(msg))
    val msgVector: DataFrame = idfModel.transform(
      hashingTF.transform (
        tokenize (msgRdd))).map(v => SMS("?", v)).toDF
    val msgTable: H2OFrame = msgVector
    msgTable.remove(0) // remove first column
    val prediction = dlModel.score(msgTable)
    //println(prediction)
    prediction.vecs()(1).at(0) < hamThreshold
  }

}

/** Training message representation. */
case class SMS(target: String, fv: mllib.linalg.Vector)


text:
Vumi HTTP API Transport
=======================

HTTP API Transport
^^^^^^^^^^^^^^^^^^

.. automodule:: vumi.transports.api.api
   :members:
   :show-inheritance:


text:
using UnityEngine;
using System.Collections;

[RequireComponent (typeof(GUIText))]
public class FPSCounter : MonoBehaviour {

	float fpsMeasurePeriod = 0.5f;
	int fpsAccumulator = 0;
	float fpsNextPeriod = 0;
	int currentFps;
	string display = "{0} FPS";

	void Start()
	{
		fpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod;
	}

	void Update()
	{

		// measure average frames per second
		fpsAccumulator++;
		if (Time.realtimeSinceStartup > fpsNextPeriod)
		{
			currentFps = (int)(fpsAccumulator / fpsMeasurePeriod);
			fpsAccumulator = 0;
			fpsNextPeriod += fpsMeasurePeriod;
			GetComponent<GUIText>().text = string.Format(display, currentFps);
		}

	}

}


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

<TITLE>OGRE Manual v1.7 ('Cthugha'): Updating Pixel Buffers</TITLE>

<META NAME="description" CONTENT="OGRE Manual v1.7 ('Cthugha'): Updating Pixel Buffers">
<META NAME="keywords" CONTENT="OGRE Manual v1.7 ('Cthugha'): Updating Pixel Buffers">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.66">
<LINK TYPE="text/css" rel="stylesheet" href="../style.css">

[ < ]
[ > ]
   [ << ]
[ Up ]
[ >> ]
            [Top]
[Contents]
[Index]
[ ? ]

 5.8.2 Updating Pixel Buffers

Pixel Buffers can be updated in two different ways; a simple, convient way and a more difficult (but in some cases faster) method. Both methods make use of PixelBox objects (See section 5.8.5 Pixel boxes) to represent image data in memory.

 blitFromMemory

The easy method to get an image into a PixelBuffer is by using HardwarePixelBuffer::blitFromMemory. This takes a PixelBox object and does all necessary pixel format conversion and scaling for you. For example, to create a manual texture and load an image into it, all you have to do is

// Manually loads an image and puts the contents in a manually created texture
Image img;
img.load("elephant.png", "General");
// Create RGB texture with 5 mipmaps
TexturePtr tex = TextureManager::getSingleton().createManual(
    "elephant",
    "General",
    TEX_TYPE_2D,
    img.getWidth(), img.getHeight(),
    5, PF_X8R8G8B8);
// Copy face 0 mipmap 0 of the image to face 0 mipmap 0 of the texture.
tex->getBuffer(0,0)->blitFromMemory(img.getPixelBox(0,0));

 Direct memory locking

A more advanced method to transfer image data from and to a PixelBuffer is to use locking. By locking a PixelBuffer
you can directly access its contents in whatever the internal format of the buffer inside the GPU is.

/// Lock the buffer so we can write to it
buffer->lock(HardwareBuffer::HBL_DISCARD);
const PixelBox &pb = buffer->getCurrentLock();

/// Update the contents of pb here
/// Image data starts at pb.data and has format pb.format
/// Here we assume data.format is PF_X8R8G8B8 so we can address pixels as uint32.
uint32 *data = static_cast<uint32*>(pb.data);
size_t height = pb.getHeight();
size_t width = pb.getWidth();
size_t pitch = pb.rowPitch; // Skip between rows of image
for(size_t y=0; y<height; ++y)
{
    for(size_t x=0; x<width; ++x)
{
        // 0xRRGGBB -> fill the buffer with yellow pixels
        data[pitch*y + x] = 0x00FFFF00;
}
}

/// Unlock the buffer again (frees it for use by the GPU)
buffer->unlock();

[ < ]
[ > ]
   [ << ]
[ Up ]
[ >> ]
            [Top]
[Contents]
[Index]
[ ? ]

This document was generated
by Steve Streeting on December, 31 2009
using texi2html


text:
@interface NSValue_ExpectaTest : TEST_SUPERCLASS
@end

@implementation NSValue_ExpectaTest

- (void)test_EXP_objcType {
  int *a;
  char *b;
  NSValue *foo = [NSValue valueWithPointer:&a];
  NSValue *bar = [NSValue valueWithPointer:&b];
  [foo set_EXP_objCType:@encode(int)];
  [bar set_EXP_objCType:@encode(char)];
  assertTrue(strcmp([foo _EXP_objCType], @encode(int)) == 0);
  assertTrue(strcmp([bar _EXP_objCType], @encode(char)) == 0);
}

@end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
P. E. Boissier, Fl. orient. 4:446. 1879

#### Original name
null

### Remarks
null