text:
Anything you intend to do well must first be planned well. In our case, our intention is to develop a blogging system, so the first step we should take is to design the flow of the application in its entirety. When we have a clear understanding of the our application's process of execution, the subsequent design and coding steps become much easier.

## GOPATH and project settings

Let's proceed by assuming that our GOPATH points to a folder with an ordinary directory name (if not, we can easily set up a suitable directory and set its path as the GOPATH). As we've describe earlier, a GOPATH can contain more than one directory: in Windows, we can set this as an environment variable; in linux/OSX systems, GOPATH can be set using `export`, i.e: `export gopath=/path/to/your/directory`, as long as the directory which GOPATH points to contains the three sub-directories: `pkg`, `bin` and `src`. Below, we've placed the source code of our new project in the `src` directory with the tentative name `beelog`. Here are some screenshots of the Windows environment variables as well as of the directory structure.

![](images/13.1.gopath.png?raw=true)

Figure 13.1 Setting the GOPATH environment variable

![](images/13.1.gopath2.png?raw=true)

Figure 13.2 The working directory under $gopath/src

## Application flowchart

Our blogging system will be based on the model-view-controller design pattern. MVC is the separation of the application logic from the presentation layer. In practice, when we keep the presentation layer separated, we can drastically reduce the amount of code needed on our web pages.

- Models represent data as well as the rules and logic governing it. In General, a model class will contain functions for removing, inserting and updating database information.
- Views are a representation of the state of a model. A view is usually a page, but in Go, a view can also be a fragment of a page, such as a header or footer. It can also be an RSS feed, or any other type of "page". Go's `template` package provides very good support for view layer functionality.
- Controllers are the glue logic between the model and view layers and encompasses all the intermediary logic necessary for handling HTTP requests and generating Web pages.

The following figure is an overview of the project framework and demonstrates how data will flow through the system:

![](images/13.1.flow.png?raw=true)

Figure 13.3 framework data flow

1. Main.go is the application's entry point and initializes some basic resources required to run the blog such as configuration information, listening ports, etc.
2. Routing checks all incoming HTTP requests and, according to the method, URL and parameters, matches it with the corresponding controller action.
3. If the requested resource has already been cached, the application will bypass the usual execution process and return a response directly to the user's browser.
4. Security detection: The application will filter incoming HTTP requests and any other user submitted data before handing it off to the controller.
5. Controller loads models, core libraries, and any other resources required to process specific requests. The controller is primarily responsible for handling business logic.
6. Output the rendered view to be sent to the client's web browser. If caching has been enabled, the first view is cached for future requests to the same resource.

## Directory structure

According to the framework flow we've designed above, our blog project's directory structure should look something like the following:

	|——main.go         import documents
	|——conf            configuration files and processing module
	|——controllers     controller entry
	|——models          database processing module
	|——utils           useful function library
	|——static          static file directory
    |——views           view gallery

## Framework design

In order to quickly build our blog, we need to develop a minimal framework based on the application we've designed above. The framework should include routing capabilities, support for RESTful controllers, automated template rendering, a logging system, configuration management, and more.

## Summary

This section describes the initial design of our blogging system, from setting up our GOPATH to briefly introducing the MVC pattern. We also looked at the flow of data and the execution sequence of our blogging system. Finally, we designed the structure of our project directory. At this point, we've basically completed the groundwork required for assembling our framework. In the next few sections, we will implement each of the components we've discussed, one by one.

## Links

- [Directory](preface.md)
- Previous section: [Building a web framework](13.0.md)
- Next section: [Customizing routers](13.2.md)


text:
<?php

namespace Site\FrontBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Comment
 *
 * @ORM\Entity(repositoryClass="Site\FrontBundle\Entity\CommentRepository")
 * @ORM\Table(name="comment")
 *
 */
class Comment
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="content", type="text")
     * @Assert\Length(min=10)
     */
    private $content;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_at", type="datetime")
     * @Assert\DateTime()
     */
    private $createdAt;

    /**
     * @var boolean
     *
     * @ORM\Column(name="status", type="boolean")
     */
    private $status;

    /**
     * @ORM\ManyToOne(targetEntity="Site\UserBundle\Entity\User")
     * @Assert\Valid()
     */
    private $user;

    /**
     * @ORM\ManyToOne(targetEntity="Site\FrontBundle\Entity\Tutorial", inversedBy="comments", cascade={"persist"})
     * @Assert\Valid()
     */
    private $tutorial;

    public function __construct()
    {
        $this->createdAt = new \DateTime();
        $this->status = true;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set content
     *
     * @param string $content
     * @return Comment
     */
    public function setContent($content)
    {
        $this->content = $content;

        return $this;
    }

    /**
     * Get content
     *
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     * @return Comment
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set status
     *
     * @param boolean $status
     * @return Comment
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return boolean
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set user
     *
     * @param \Site\UserBundle\Entity\User $user
     * @return Comment
     */
    public function setUser(\Site\UserBundle\Entity\User $user)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \Site\UserBundle\Entity\User
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Set tutorial
     *
     * @param \Site\FrontBundle\Entity\Tutorial $tutorial
     * @return Comment
     */
    public function setTutorial(\Site\FrontBundle\Entity\Tutorial $tutorial)
    {
        $this->tutorial = $tutorial;

        return $this;
    }

    /**
     * Get tutorial
     *
     * @return \Site\FrontBundle\Entity\Tutorial
     */
    public function getTutorial()
    {
        return $this->tutorial;
    }

}

redpajama_set_name: RedPajamaGithub


text:
class PersonWithDefaultSchool < Person
  default :school do
    School.find(1)
  end
end


text:
var errors = require('./errors');
var utils = require('./utils');

var StreamFeed = function() {
	this.initialize.apply(this, arguments);
};

StreamFeed.prototype = {
	/*
	 * The feed object contains convenience functions such add activity
	 * remove activity etc
	 *
	 */
	initialize : function(client, feedSlug, userId, token, siteId) {
		this.client = client;
		this.slug = feedSlug;
		this.userId = userId;
		this.id = this.slug + ':' + this.userId;
		this.token = token;

		this.feedUrl = this.id.replace(':', '/');
		this.feedTogether = this.id.replace(':', '');
		this.signature = this.feedTogether + ' ' + this.token;

		// faye setup
		this.fayeClient = null;
		this.notificationChannel = 'site-' + this.client.appId + '-feed-' + this.feedTogether;
	},
	addActivity : function(activity, callback) {
		/*
		 * Adds the given activity to the feed and
		 * calls the specified callback
		 */
		activity = this.client.signActivity(activity);
		var xhr = this.client.post({
			'url' : 'feed/' + this.feedUrl + '/',
			'body' : activity,
			'signature' : this.signature
		}, callback);
		return xhr;
	},
	removeActivity : function(activityId, callback) {
		/*
		 * Removes the activity by activityId
		 * feed.removeActivity(activityId);
		 * Or
		 * feed.removeActivity({'foreign_id': foreignId});
		 */
		var identifier = (activityId.foreignId) ? activityId.foreignId : activityId;
		var params = {};
		if (activityId.foreignId) {
			params.foreign_id = '1';
		}
		var xhr = this.client.delete( {
			'url' : 'feed/' + this.feedUrl + '/' + identifier + '/',
			'qs' : params,
			'signature' : this.signature
		}, callback);
		return xhr;
	},
	addActivities : function(activities, callback) {
		/*
		 * Adds the given activities to the feed and
		 * calls the specified callback
		 */
		activities = this.client.signActivities(activities);
		var data = {
			activities : activities
		};
		var xhr = this.client.post({
			'url' : 'feed/' + this.feedUrl + '/',
			'body' : data,
			'signature' : this.signature
		}, callback);
		return xhr;
	},
	follow : function(targetSlug, targetUserId, callbackOrToken, callback) {
		/*
		 * feed.follow('user', '1');
		 * or
		 * feed.follow('user', '1', 'token');
		 * or
		 * feed.follow('user', '1', callback);
		 */
		utils.validateFeedSlug(targetSlug);
		utils.validateUserId(targetUserId);
		var targetToken;
		var last = arguments[arguments.length - 1];
		// callback is always the last argument
		callback = (last.call) ? last : undefined;
		var target = targetSlug + ':' + targetUserId;
		// token is 3rd or 4th
		if (arguments[2] && !arguments[2].call) {
			targetToken = arguments[2];
		} else if (arguments[3] && !arguments[3].call) {
			targetToken = arguments[3];
		}

		// if have a secret, always just generate and send along the token
		if (this.client.apiSecret && !targetToken) {
			targetToken = this.client.feed(targetSlug, targetUserId).token;
		}
		var xhr = this.client.post({
			'url' : 'feed/' + this.feedUrl + '/following/',
			'body' : {
				'target' : target,
				'target_token' : targetToken
			},
			'signature' : this.signature
		}, callback);
		return xhr;
	},
	unfollow : function(targetSlug, targetUserId, callback) {
		/*
		 * Unfollow the given feed, ie:
		 * feed.unfollow('user', '2', callback);
		 */
		utils.validateFeedSlug(targetSlug);
		utils.validateUserId(targetUserId);
		var targetFeedId = targetSlug + ':' + targetUserId;
		var xhr = this.client.delete( {
			'url' : 'feed/' + this.feedUrl + '/following/' + targetFeedId + '/',
			'signature' : this.signature
		}, callback);
		return xhr;
	},
	following : function(options, callback) {
		/*
		 * List which feeds this feed is following
		 *
		 * feed.following({limit:10, filter: ['user:1', 'user:2']}, callback);
		 */
		if (options !== undefined && options.filter) {
			options.filter = options.filter.join(',');
		}
		var xhr = this.client.get({
			'url' : 'feed/' + this.feedUrl + '/following/',
			'qs' : options,
			'signature' : this.signature
		}, callback);
		return xhr;
	},
	followers : function(options, callback) {
		/*
		 * List the followers of this feed
		 *
		 * feed.followers({limit:10, filter: ['user:1', 'user:2']}, callback);
		 */
		if (options !== undefined && options.filter) {
			options.filter = options.filter.join(',');
		}
		var xhr = this.client.get({
			'url' : 'feed/' + this.feedUrl + '/followers/',
			'qs' : options,
			'signature' : this.signature
		}, callback);
		return xhr;
	},
	get : function(options, callback) {
		/*
		 * Reads the feed
		 *
		 * feed.get({limit: 10, id_lte: 'activity-id'})
		 * or
		 * feed.get({limit: 10, mark_seen: true})
		 */
		if (options && options.mark_read && options.mark_read.join) {
			options.mark_read = options.mark_read.join(',');
		}
		if (options && options.mark_seen && options.mark_seen.join) {
			options.mark_seen = options.mark_seen.join(',');
		}

		var xhr = this.client.get({
			'url' : 'feed/' + this.feedUrl + '/',
			'qs' : options,
			'signature' : this.signature
		}, callback);
		return xhr;
	},

	getFayeAuthorization : function() {
		var apiKey = this.client.apiKey;
		var userId = this.notificationChannel;
		var token = this.token;
		return {
			incoming : function(message, callback) {
				callback(message);
			},
			outgoing : function(message, callback) {
				message.ext = {
					'user_id' : userId,
					'api_key' : apiKey,
					'signature' : token
				};
				callback(message);
			}
		};
	},

	getFayeClient : function() {
		var Faye = require('faye');
		if (this.fayeClient === null) {
			this.fayeClient = new Faye.Client(this.client.fayeUrl);
			var authExtension = this.getFayeAuthorization();
			this.fayeClient.addExtension(authExtension);
		}
		return this.fayeClient;
	},

	subscribe : function(callback) {
		/*
		 * subscribes to any changes in the feed, return a promise
		 * feed.subscribe(callback).then(function(){
		 * 		console.log('we are now listening to changes');
		 * });
		 */
		if (!this.client.appId) {
			throw new errors.SiteError('Missing app id, which is needed to subscribe, use var client = stream.connect(key, secret, appId);');
		}
		return this.getFayeClient().subscribe('/' + this.notificationChannel, callback);
	}
};

module.exports = StreamFeed;


text:
layout: archive
lang: en
ref: openmanipulator_p_ros2_perceptions
read_time: true
share: true
author_profile: false
permalink: /docs/en/platform/openmanipulator_p/ros2_perceptions/
sidebar:
  title: "OpenMANIPULATOR-P"
  nav: "openmanipulator_p"
product_group: openmanipulator_p
page_number: 17
---

# [[ROS 2] Perceptions](#ros-2-perceptions)

`[ROS2] Perceptions` will be released soon!
{: .notice}

## [Camera](#camera)

Available `Camera` contents will be released soon!
{: .notice}


text:
using System.Web;

namespace YAF.Providers.Roles
{
    using System;
    using System.Collections.Concurrent;
    using System.Collections.Specialized;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web.Security;

    using VZF.Data.DAL;
    using VZF.Utils;

    using YAF.Classes;
    using YAF.Core;
    using YAF.Providers.Utils;
    using YAF.Types.Interfaces;

    /// <summary>
    /// The yaf role provider.
    /// </summary>
    public class PgRoleProvider : RoleProvider
    {
        #region Constants and Fields

        /// <summary>
        /// The conn str app key name.
        /// </summary>
        private static string _connStrAppKeyName = "YafRolesConnectionString";

        /// <summary>
        /// The _connection string.
        /// </summary>
        private static string _connectionString;

        /// <summary>
        /// The _app name.
        /// </summary>
        private string _appName;

        /// <summary>
        /// The _conn str name.
        /// </summary>
        private string _connStrName;

        /// <summary>
        /// The _user role cache.
        /// </summary>
        private ConcurrentDictionary<string, StringCollection> _userRoleCache;

        #endregion

        #region Properties

        /// <summary>
        /// Gets the Connection String App Key Name.
        /// </summary>
        public static string ConnStrAppKeyName
        {
            get
            {
                return _connStrAppKeyName;
            }
        }

        /// <summary>
        /// Gets the Connection String App Key Name.
        /// </summary>
        public static string ConnectionString
        {
            get
            {
                return _connectionString;
            }
            set
            {
                _connectionString = value;
            }
        }

        /// <summary>
        /// Gets the Connection String App Key Name.
        /// </summary>
        public static string ConnectionStringName { get; set; }

        /// <summary>
        /// Gets or sets ApplicationName.
        /// </summary>
        public override string ApplicationName
        {
            get
            {
                return this._appName;
            }

            set
            {
                if (value != this._appName)
                {
                    this._appName = value;

                    // clear the cache for obvious reasons...
                    this.ClearUserRoleCache();
                }
            }
        }

        /// <summary>
        /// Gets UserRoleCache.
        /// </summary>
        private ConcurrentDictionary<string, StringCollection> UserRoleCache
        {
            get
            {
                string key = this.GenerateCacheKey("UserRoleDictionary");

                return this._userRoleCache
                       ?? (this._userRoleCache =
                           YafContext.Current.Get<IObjectStore>()
                               .GetOrSet(key, () => new ConcurrentDictionary<string, StringCollection>()));
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// Adds a list of users to a list of groups
        /// </summary>
        /// <param name="usernames">
        /// List of Usernames
        /// </param>
        /// <param name="roleNames">
        /// List of Rolenames
        /// </param>
        public override void AddUsersToRoles(string[] usernames, string[] roleNames)
        {
            if (usernames == null || usernames.Length == 0)
            {
                throw new ArgumentException("usernames is null or empty.", "usernames");
            }

            if (roleNames == null || roleNames.Length == 0)
            {
                throw new ArgumentException("roleNames is null or empty.", "roleNames");
            }

            // Loop through username
            foreach (string username in usernames)
            {
                var allRoles = this.GetAllRoles().ToList();

                // Loop through roles
                foreach (string roleName in roleNames)
                {
                    // only add user if this role actually exists...
                    if (roleName.IsSet() && allRoles.Contains(roleName))
                    {
                        Db.__AddUserToRole(ConnectionStringName, this.ApplicationName, username, roleName);
                    }
                }

                // invalidate the cache for this user...
                this.DeleteFromRoleCacheIfExists(username.ToLower());
            }
        }

        /// <summary>
        /// The create role.
        /// </summary>
        /// <param name="roleName">
        /// The role name.
        /// </param>
        public override void CreateRole(string roleName)
        {
            if (roleName.IsNotSet())
            {
                ExceptionReporter.ThrowArgument("ROLES", "ROLENAMEBLANK");
            }

            Db.__CreateRole(ConnectionStringName, this.ApplicationName, roleName);
        }

        /// <summary>
        /// The delete role.
        /// </summary>
        /// <param name="roleName">
        /// The role name.
        /// </param>
        /// <param name="throwOnPopulatedRole">
        /// The throw on populated role.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
        {
            int returnValue = Db.__DeleteRole(
                ConnectionStringName,
                this.ApplicationName,
                roleName,
                throwOnPopulatedRole);

            this.ClearUserRoleCache();

            // zero means there were no complications...
            return returnValue == 0;
        }

        /// <summary>
        /// The find users in role.
        /// </summary>
        /// <param name="roleName">
        /// The role name.
        /// </param>
        /// <param name="usernameToMatch">
        /// The username to match.
        /// </param>
        /// <returns>
        /// The <see>
        ///         <cref>string[]</cref>
        ///     </see>
        ///     .
        /// </returns>
        public override string[] FindUsersInRole(string roleName, string usernameToMatch)
        {
            if (roleName.IsNotSet())
            {
                ExceptionReporter.ThrowArgument("ROLES", "ROLENAMEBLANK");
            }

            // Roles
            DataTable users = Db.__FindUsersInRole(ConnectionStringName, this.ApplicationName, roleName);
            var usernames = new StringCollection();
            foreach (DataRow user in users.Rows)
            {
                usernames.Add(user["Username"].ToStringDBNull());
            }

            return usernames.ToStringArray();
        }

        /// <summary>
        /// The get all roles.
        /// </summary>
        /// <returns>
        /// The <see>
        ///         <cref>string[]</cref>
        ///     </see>
        ///     .
        /// </returns>
        public override string[] GetAllRoles()
        {
            // get all roles...
            DataTable roles = Db.__GetRoles(ConnectionStringName, this.ApplicationName, null);

            // make a string collection to store the role list...
            var roleNames = new StringCollection();

            foreach (DataRow row in roles.Rows)
            {
                roleNames.Add(row["RoleName"].ToStringDBNull());
            }

            return roleNames.ToStringArray(); // return as a string array
        }

        /// <summary>
        /// The get roles for user.
        /// </summary>
        /// <param name="username">
        /// The username.
        /// </param>
        /// <returns>
        /// The <see>
        ///         <cref>string[]</cref>
        ///     </see>
        ///     .
        /// </returns>
        public override string[] GetRolesForUser(string username)
        {
            if (username.IsNotSet())
            {
                ExceptionReporter.ThrowArgument("ROLES", "USERNAMEBLANK");
            }

            StringCollection roleNames;

            // get the users's collection from the dictionary
            if (!this.UserRoleCache.ContainsKey(username.ToLower()))
            {
                roleNames = new StringCollection();

                DataTable roles = Db.__GetRoles(ConnectionStringName, this.ApplicationName, username);

                foreach (DataRow dr in roles.Rows)
                {
                    roleNames.Add(dr["Rolename"].ToStringDBNull()); // add rolename to collection
                }

                // add it to the dictionary cache...
                this.UserRoleCache.AddOrUpdate(username.ToLower(), k => roleNames, (s, v) => roleNames);
            }
            else
            {
                roleNames = this.UserRoleCache[username.ToLower()];
            }

            return roleNames.ToStringArray(); // return as a string array
        }

        /// <summary>
        /// Gets a list of usernames in a a particular role.
        /// </summary>
        /// <param name="roleName">
        /// The role name.
        /// </param>
        /// <returns>
        /// The <see>
        ///         <cref>string[]</cref>
        ///     </see>
        ///     .
        /// </returns>
        public override string[] GetUsersInRole(string roleName)
        {
            if (roleName.IsNotSet())
            {
                ExceptionReporter.ThrowArgument("ROLES", "ROLENAMEBLANK");
            }

            DataTable users = Db.__FindUsersInRole(ConnectionStringName, this.ApplicationName, roleName);

            var userNames = new StringCollection();

            foreach (DataRow dr in users.Rows)
            {
                userNames.Add(dr["Username"].ToStringDBNull());
            }

            return userNames.ToStringArray();
        }

        /// <summary>
        /// The initialize.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <param name="config">
        /// The config.
        /// </param>
        public override void Initialize(string name, NameValueCollection config)
        {
            // verify that the configuration section was properly passed
            if (!config.HasKeys())
            {
                ExceptionReporter.ThrowArgument("ROLES", "CONFIGNOTFOUND");
            }

            // Application Name
            this._appName = config["applicationName"].ToStringDBNull(Config.ApplicationName);

            // Connection String Name
            this._connStrName = config["connectionStringName"].ToStringDBNull(Config.ConnectionStringName);

            // is the connection string set?
            if (this._connStrName.IsSet())
            {
                string connStr = ConfigurationManager.ConnectionStrings[this._connStrName].ConnectionString;
                ConnectionString = connStr;
                ConnectionStringName = SqlDbAccess.GetConnectionStringNameFromConnectionString(connStr);

                // set the app variable...
                if (YafContext.Current.Get<HttpApplicationStateBase>()[ConnStrAppKeyName] == null)
                {
                    YafContext.Current.Get<HttpApplicationStateBase>().Add(ConnStrAppKeyName, connStr);
                }
                else
                {
                    YafContext.Current.Get<HttpApplicationStateBase>()[ConnStrAppKeyName] = connStr;
                }
            }

            base.Initialize(name, config);

            // application name
            this._appName = config["applicationName"];

            if (string.IsNullOrEmpty(this._appName))
            {
                this._appName = "YetAnotherForum";
            }
        }

        /// <summary>
        /// Check to see if user belongs to a role.
        /// </summary>
        /// <param name="username">
        /// The username.
        /// </param>
        /// <param name="roleName">
        /// The role name.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public override bool IsUserInRole(string username, string roleName)
        {
            DataTable roles = Db.__IsUserInRole(ConnectionStringName, this.ApplicationName, username, roleName);

            return roles.Rows.Count > 0;
        }

        /// <summary>
        /// The remove users from roles.
        /// </summary>
        /// <param name="usernames">
        /// The usernames.
        /// </param>
        /// <param name="roleNames">
        /// The role names.
        /// </param>
        public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
        {
            // Loop through username
            foreach (string username in usernames)
            {
                // Loop through roles
                foreach (string roleName in roleNames)
                {
                    Db.__RemoveUserFromRole(ConnectionStringName, this.ApplicationName, username, roleName);

                    // invalidate cache for this user...
                    this.DeleteFromRoleCacheIfExists(username.ToLower());
                }
            }
        }

        /// <summary>
        /// The role exists.
        /// </summary>
        /// <param name="roleName">
        /// The role name.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public override bool RoleExists(string roleName)
        {
            // get this role...
            object exists = Db.__GetRoleExists(ConnectionStringName, this.ApplicationName, roleName);

            // if there are any rows then this role exists...
            if (Convert.ToInt32(exists) > 0)
            {
                return true;
            }

            // doesn't exist
            return false;
        }

        #endregion

        #region Methods

        /// <summary>
        /// The clear user role cache.
        /// </summary>
        private void ClearUserRoleCache()
        {
            string key = this.GenerateCacheKey("UserRoleDictionary");
            YafContext.Current.Get<IObjectStore>().Remove(key);
        }

        /// <summary>
        /// The delete from role cache if exists.
        /// </summary>
        /// <param name="key">
        /// The key.
        /// </param>
        private void DeleteFromRoleCacheIfExists(string key)
        {
            StringCollection collection;
            this.UserRoleCache.TryRemove(key, out collection);
        }

        /// <summary>
        /// The generate cache key.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <returns>
        /// Returns a generated cache key.
        /// </returns>
        private string GenerateCacheKey(string name)
        {
            return "PgRoleProvider-{0}-{1}".FormatWith(name, this.ApplicationName);
        }

        #endregion
    }
}


text:
<?php

use Illuminate\Database\Seeder;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CountriesLookupSeeder extends Seeder
{
    public function run()
    {
        $greekStringConversion = new \App\Services\GreekStringConversionHelper();
        \DB::table('countries_lookup')->insert(
            array(
                array('code' => 'AC', 'name' => $greekStringConversion->grstrtoupper('Νήσος Ασενσιόν')),
                array('code' => 'AD', 'name' => $greekStringConversion->grstrtoupper('Ανδόρα')),
                array('code' => 'AE', 'name' => $greekStringConversion->grstrtoupper('Ηνωμένα Αραβικά Εμιράτα')),
                array('code' => 'AF', 'name' => $greekStringConversion->grstrtoupper('Αφγανιστάν')),
                array('code' => 'AG', 'name' => $greekStringConversion->grstrtoupper('Αντίγκουα και Μπαρμπούντα')),
                array('code' => 'AI', 'name' => $greekStringConversion->grstrtoupper('Ανγκουίλα')),
                array('code' => 'AL', 'name' => $greekStringConversion->grstrtoupper('Αλβανία')),
                array('code' => 'AM', 'name' => $greekStringConversion->grstrtoupper('Αρμενία')),
                array('code' => 'AO', 'name' => $greekStringConversion->grstrtoupper('Ανγκόλα')),
                array('code' => 'AQ', 'name' => $greekStringConversion->grstrtoupper('Ανταρκτική')),
                array('code' => 'AR', 'name' => $greekStringConversion->grstrtoupper('Αργεντινή')),
                array('code' => 'AS', 'name' => $greekStringConversion->grstrtoupper('Αμερικανική Σαμόα')),
                array('code' => 'AT', 'name' => $greekStringConversion->grstrtoupper('Αυστρία')),
                array('code' => 'AU', 'name' => $greekStringConversion->grstrtoupper('Αυστραλία')),
                array('code' => 'AW', 'name' => $greekStringConversion->grstrtoupper('Αρούμπα')),
                array('code' => 'AX', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Όλαντ')),
                array('code' => 'AZ', 'name' => $greekStringConversion->grstrtoupper('Αζερμπαϊτζάν')),
                array('code' => 'BA', 'name' => $greekStringConversion->grstrtoupper('Βοσνία - Ερζεγοβίνη')),
                array('code' => 'BB', 'name' => $greekStringConversion->grstrtoupper('Μπαρμπάντος')),
                array('code' => 'BD', 'name' => $greekStringConversion->grstrtoupper('Μπανγκλαντές')),
                array('code' => 'BE', 'name' => $greekStringConversion->grstrtoupper('Βέλγιο')),
                array('code' => 'BF', 'name' => $greekStringConversion->grstrtoupper('Μπουρκίνα Φάσο')),
                array('code' => 'BG', 'name' => $greekStringConversion->grstrtoupper('Βουλγαρία')),
                array('code' => 'BH', 'name' => $greekStringConversion->grstrtoupper('Μπαχρέιν')),
                array('code' => 'BI', 'name' => $greekStringConversion->grstrtoupper('Μπουρούντι')),
                array('code' => 'BJ', 'name' => $greekStringConversion->grstrtoupper('Μπενίν')),
                array('code' => 'BL', 'name' => $greekStringConversion->grstrtoupper('Άγιος Βαρθολομαίος')),
                array('code' => 'BM', 'name' => $greekStringConversion->grstrtoupper('Βερμούδες')),
                array('code' => 'BN', 'name' => $greekStringConversion->grstrtoupper('Μπρουνέι')),
                array('code' => 'BO', 'name' => $greekStringConversion->grstrtoupper('Βολιβία')),
                array('code' => 'BQ', 'name' => $greekStringConversion->grstrtoupper('Ολλανδία Καραϊβικής')),
                array('code' => 'BR', 'name' => $greekStringConversion->grstrtoupper('Βραζιλία')),
                array('code' => 'BS', 'name' => $greekStringConversion->grstrtoupper('Μπαχάμες')),
                array('code' => 'BT', 'name' => $greekStringConversion->grstrtoupper('Μπουτάν')),
                array('code' => 'BW', 'name' => $greekStringConversion->grstrtoupper('Μποτσουάνα')),
                array('code' => 'BY', 'name' => $greekStringConversion->grstrtoupper('Λευκορωσία')),
                array('code' => 'BZ', 'name' => $greekStringConversion->grstrtoupper('Μπελίζ')),
                array('code' => 'CA', 'name' => $greekStringConversion->grstrtoupper('Καναδάς')),
                array('code' => 'CC', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Κόκος (Κίλινγκ)')),
                array('code' => 'CD', 'name' => $greekStringConversion->grstrtoupper('Κονγκό - Κινσάσα')),
                array('code' => 'CF', 'name' => $greekStringConversion->grstrtoupper('Κεντροαφρικανική Δημοκρατία')),
                array('code' => 'CG', 'name' => $greekStringConversion->grstrtoupper('Κονγκό - Μπραζαβίλ')),
                array('code' => 'CH', 'name' => $greekStringConversion->grstrtoupper('Ελβετία')),
                array('code' => 'CI', 'name' => $greekStringConversion->grstrtoupper('Ακτή Ελεφαντοστού')),
                array('code' => 'CK', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Κουκ')),
                array('code' => 'CL', 'name' => $greekStringConversion->grstrtoupper('Χιλή')),
                array('code' => 'CM', 'name' => $greekStringConversion->grstrtoupper('Καμερούν')),
                array('code' => 'CN', 'name' => $greekStringConversion->grstrtoupper('Κίνα')),
                array('code' => 'CO', 'name' => $greekStringConversion->grstrtoupper('Κολομβία')),
                array('code' => 'CR', 'name' => $greekStringConversion->grstrtoupper('Κόστα Ρίκα')),
                array('code' => 'CU', 'name' => $greekStringConversion->grstrtoupper('Κούβα')),
                array('code' => 'CV', 'name' => $greekStringConversion->grstrtoupper('Πράσινο Ακρωτήριο')),
                array('code' => 'CW', 'name' => $greekStringConversion->grstrtoupper('Κουρασάο')),
                array('code' => 'CX', 'name' => $greekStringConversion->grstrtoupper('Νήσος των Χριστουγέννων')),
                array('code' => 'CY', 'name' => $greekStringConversion->grstrtoupper('Κύπρος')),
                array('code' => 'CZ', 'name' => $greekStringConversion->grstrtoupper('Τσεχική Δημοκρατία')),
                array('code' => 'DE', 'name' => $greekStringConversion->grstrtoupper('Γερμανία')),
                array('code' => 'DG', 'name' => $greekStringConversion->grstrtoupper('Ντιέγκο Γκαρσία')),
                array('code' => 'DJ', 'name' => $greekStringConversion->grstrtoupper('Τζιμπουτί')),
                array('code' => 'DK', 'name' => $greekStringConversion->grstrtoupper('Δανία')),
                array('code' => 'DM', 'name' => $greekStringConversion->grstrtoupper('Ντομίνικα')),
                array('code' => 'DO', 'name' => $greekStringConversion->grstrtoupper('Δομινικανή Δημοκρατία')),
                array('code' => 'DZ', 'name' => $greekStringConversion->grstrtoupper('Αλγερία')),
                array('code' => 'EA', 'name' => $greekStringConversion->grstrtoupper('Θεούτα και Μελίλα')),
                array('code' => 'EC', 'name' => $greekStringConversion->grstrtoupper('Εκουαδόρ')),
                array('code' => 'EE', 'name' => $greekStringConversion->grstrtoupper('Εσθονία')),
                array('code' => 'EG', 'name' => $greekStringConversion->grstrtoupper('Αίγυπτος')),
                array('code' => 'EH', 'name' => $greekStringConversion->grstrtoupper('Δυτική Σαχάρα')),
                array('code' => 'ER', 'name' => $greekStringConversion->grstrtoupper('Ερυθραία')),
                array('code' => 'ES', 'name' => $greekStringConversion->grstrtoupper('Ισπανία')),
                array('code' => 'ET', 'name' => $greekStringConversion->grstrtoupper('Αιθιοπία')),
                array('code' => 'FI', 'name' => $greekStringConversion->grstrtoupper('Φινλανδία')),
                array('code' => 'FJ', 'name' => $greekStringConversion->grstrtoupper('Φίτζι')),
                array('code' => 'FK', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Φόκλαντ')),
                array('code' => 'FM', 'name' => $greekStringConversion->grstrtoupper('Μικρονησία')),
                array('code' => 'FO', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Φερόες')),
                array('code' => 'FR', 'name' => $greekStringConversion->grstrtoupper('Γαλλία')),
                array('code' => 'GA', 'name' => $greekStringConversion->grstrtoupper('Γκαμπόν')),
                array('code' => 'GB', 'name' => $greekStringConversion->grstrtoupper('Ηνωμένο Βασίλειο')),
                array('code' => 'GD', 'name' => $greekStringConversion->grstrtoupper('Γρενάδα')),
                array('code' => 'GE', 'name' => $greekStringConversion->grstrtoupper('Γεωργία')),
                array('code' => 'GF', 'name' => $greekStringConversion->grstrtoupper('Γαλλική Γουιάνα')),
                array('code' => 'GG', 'name' => $greekStringConversion->grstrtoupper('Γκέρνζι')),
                array('code' => 'GH', 'name' => $greekStringConversion->grstrtoupper('Γκάνα')),
                array('code' => 'GI', 'name' => $greekStringConversion->grstrtoupper('Γιβραλτάρ')),
                array('code' => 'GL', 'name' => $greekStringConversion->grstrtoupper('Γροιλανδία')),
                array('code' => 'GM', 'name' => $greekStringConversion->grstrtoupper('Γκάμπια')),
                array('code' => 'GN', 'name' => $greekStringConversion->grstrtoupper('Γουινέα')),
                array('code' => 'GP', 'name' => $greekStringConversion->grstrtoupper('Γουαδελούπη')),
                array('code' => 'GQ', 'name' => $greekStringConversion->grstrtoupper('Ισημερινή Γουινέα')),
                array('code' => 'GR', 'name' => $greekStringConversion->grstrtoupper('Ελλάδα')),
                array('code' => 'GS', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Νότια Γεωργία και Νότιες Σάντουιτς')),
                array('code' => 'GT', 'name' => $greekStringConversion->grstrtoupper('Γουατεμάλα')),
                array('code' => 'GU', 'name' => $greekStringConversion->grstrtoupper('Γκουάμ')),
                array('code' => 'GW', 'name' => $greekStringConversion->grstrtoupper('Γουινέα Μπισάου')),
                array('code' => 'GY', 'name' => $greekStringConversion->grstrtoupper('Γουιάνα')),
                array('code' => 'HK', 'name' => $greekStringConversion->grstrtoupper('Χονγκ Κονγκ ΕΔΠ Κίνας')),
                array('code' => 'HN', 'name' => $greekStringConversion->grstrtoupper('Ονδούρα')),
                array('code' => 'HR', 'name' => $greekStringConversion->grstrtoupper('Κροατία')),
                array('code' => 'HT', 'name' => $greekStringConversion->grstrtoupper('Αϊτή')),
                array('code' => 'HU', 'name' => $greekStringConversion->grstrtoupper('Ουγγαρία')),
                array('code' => 'IC', 'name' => $greekStringConversion->grstrtoupper('Κανάριοι Νήσοι')),
                array('code' => 'ID', 'name' => $greekStringConversion->grstrtoupper('Ινδονησία')),
                array('code' => 'IE', 'name' => $greekStringConversion->grstrtoupper('Ιρλανδία')),
                array('code' => 'IL', 'name' => $greekStringConversion->grstrtoupper('Ισραήλ')),
                array('code' => 'IM', 'name' => $greekStringConversion->grstrtoupper('Νήσος Μαν')),
                array('code' => 'IN', 'name' => $greekStringConversion->grstrtoupper('Ινδία')),
                array('code' => 'IO', 'name' => $greekStringConversion->grstrtoupper('Βρετανικά Εδάφη Ινδικού Ωκεανού')),
                array('code' => 'IQ', 'name' => $greekStringConversion->grstrtoupper('Ιράκ')),
                array('code' => 'IR', 'name' => $greekStringConversion->grstrtoupper('Ιράν')),
                array('code' => 'IS', 'name' => $greekStringConversion->grstrtoupper('Ισλανδία')),
                array('code' => 'IT', 'name' => $greekStringConversion->grstrtoupper('Ιταλία')),
                array('code' => 'JE', 'name' => $greekStringConversion->grstrtoupper('Τζέρζι')),
                array('code' => 'JM', 'name' => $greekStringConversion->grstrtoupper('Τζαμάικα')),
                array('code' => 'JO', 'name' => $greekStringConversion->grstrtoupper('Ιορδανία')),
                array('code' => 'JP', 'name' => $greekStringConversion->grstrtoupper('Ιαπωνία')),
                array('code' => 'KE', 'name' => $greekStringConversion->grstrtoupper('Κένυα')),
                array('code' => 'KG', 'name' => $greekStringConversion->grstrtoupper('Κιργιστάν')),
                array('code' => 'KH', 'name' => $greekStringConversion->grstrtoupper('Καμπότζη')),
                array('code' => 'KI', 'name' => $greekStringConversion->grstrtoupper('Κιριμπάτι')),
                array('code' => 'KM', 'name' => $greekStringConversion->grstrtoupper('Κομόρες')),
                array('code' => 'KN', 'name' => $greekStringConversion->grstrtoupper('Άγιος Χριστόφορος και Νέβις')),
                array('code' => 'KP', 'name' => $greekStringConversion->grstrtoupper('Βόρεια Κορέα')),
                array('code' => 'KR', 'name' => $greekStringConversion->grstrtoupper('Νότια Κορέα')),
                array('code' => 'KW', 'name' => $greekStringConversion->grstrtoupper('Κουβέιτ')),
                array('code' => 'KY', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Κάιμαν')),
                array('code' => 'KZ', 'name' => $greekStringConversion->grstrtoupper('Καζακστάν')),
                array('code' => 'LA', 'name' => $greekStringConversion->grstrtoupper('Λάος')),
                array('code' => 'LB', 'name' => $greekStringConversion->grstrtoupper('Λίβανος')),
                array('code' => 'LC', 'name' => $greekStringConversion->grstrtoupper('Αγία Λουκία')),
                array('code' => 'LI', 'name' => $greekStringConversion->grstrtoupper('Λιχτενστάιν')),
                array('code' => 'LK', 'name' => $greekStringConversion->grstrtoupper('Σρι Λάνκα')),
                array('code' => 'LR', 'name' => $greekStringConversion->grstrtoupper('Λιβερία')),
                array('code' => 'LS', 'name' => $greekStringConversion->grstrtoupper('Λεσότο')),
                array('code' => 'LT', 'name' => $greekStringConversion->grstrtoupper('Λιθουανία')),
                array('code' => 'LU', 'name' => $greekStringConversion->grstrtoupper('Λουξεμβούργο')),
                array('code' => 'LV', 'name' => $greekStringConversion->grstrtoupper('Λετονία')),
                array('code' => 'LY', 'name' => $greekStringConversion->grstrtoupper('Λιβύη')),
                array('code' => 'MA', 'name' => $greekStringConversion->grstrtoupper('Μαρόκο')),
                array('code' => 'MC', 'name' => $greekStringConversion->grstrtoupper('Μονακό')),
                array('code' => 'MD', 'name' => $greekStringConversion->grstrtoupper('Μολδαβία')),
                array('code' => 'ME', 'name' => $greekStringConversion->grstrtoupper('Μαυροβούνιο')),
                array('code' => 'MF', 'name' => $greekStringConversion->grstrtoupper('Άγιος Μαρτίνος (Γαλλικό τμήμα)')),
                array('code' => 'MG', 'name' => $greekStringConversion->grstrtoupper('Μαδαγασκάρη')),
                array('code' => 'MH', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Μάρσαλ')),
                array('code' => 'MK', 'name' => $greekStringConversion->grstrtoupper('Πρώην Γιουγκοσλαβική Δημοκρατία της Μακεδονίας')),
                array('code' => 'ML', 'name' => $greekStringConversion->grstrtoupper('Μάλι')),
                array('code' => 'MM', 'name' => $greekStringConversion->grstrtoupper('Μιανμάρ/Βιρμανία')),
                array('code' => 'MN', 'name' => $greekStringConversion->grstrtoupper('Μογγολία')),
                array('code' => 'MO', 'name' => $greekStringConversion->grstrtoupper('Μακάο ΕΔΠ Κίνας')),
                array('code' => 'MP', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Βόρειες Μαριάνες')),
                array('code' => 'MQ', 'name' => $greekStringConversion->grstrtoupper('Μαρτινίκα')),
                array('code' => 'MR', 'name' => $greekStringConversion->grstrtoupper('Μαυριτανία')),
                array('code' => 'MS', 'name' => $greekStringConversion->grstrtoupper('Μονσεράτ')),
                array('code' => 'MT', 'name' => $greekStringConversion->grstrtoupper('Μάλτα')),
                array('code' => 'MU', 'name' => $greekStringConversion->grstrtoupper('Μαυρίκιος')),
                array('code' => 'MV', 'name' => $greekStringConversion->grstrtoupper('Μαλδίβες')),
                array('code' => 'MW', 'name' => $greekStringConversion->grstrtoupper('Μαλάουι')),
                array('code' => 'MX', 'name' => $greekStringConversion->grstrtoupper('Μεξικό')),
                array('code' => 'MY', 'name' => $greekStringConversion->grstrtoupper('Μαλαισία')),
                array('code' => 'MZ', 'name' => $greekStringConversion->grstrtoupper('Μοζαμβίκη')),
                array('code' => 'NA', 'name' => $greekStringConversion->grstrtoupper('Ναμίμπια')),
                array('code' => 'NC', 'name' => $greekStringConversion->grstrtoupper('Νέα Καληδονία')),
                array('code' => 'NE', 'name' => $greekStringConversion->grstrtoupper('Νίγηρας')),
                array('code' => 'NF', 'name' => $greekStringConversion->grstrtoupper('Νήσος Νόρφολκ')),
                array('code' => 'NG', 'name' => $greekStringConversion->grstrtoupper('Νιγηρία')),
                array('code' => 'NI', 'name' => $greekStringConversion->grstrtoupper('Νικαράγουα')),
                array('code' => 'NL', 'name' => $greekStringConversion->grstrtoupper('Ολλανδία')),
                array('code' => 'NO', 'name' => $greekStringConversion->grstrtoupper('Νορβηγία')),
                array('code' => 'NP', 'name' => $greekStringConversion->grstrtoupper('Νεπάλ')),
                array('code' => 'NR', 'name' => $greekStringConversion->grstrtoupper('Ναουρού')),
                array('code' => 'NU', 'name' => $greekStringConversion->grstrtoupper('Νιούε')),
                array('code' => 'NZ', 'name' => $greekStringConversion->grstrtoupper('Νέα Ζηλανδία')),
                array('code' => 'OM', 'name' => $greekStringConversion->grstrtoupper('Ομάν')),
                array('code' => 'PA', 'name' => $greekStringConversion->grstrtoupper('Παναμάς')),
                array('code' => 'PE', 'name' => $greekStringConversion->grstrtoupper('Περού')),
                array('code' => 'PF', 'name' => $greekStringConversion->grstrtoupper('Γαλλική Πολυνησία')),
                array('code' => 'PG', 'name' => $greekStringConversion->grstrtoupper('Παπούα Νέα Γουινέα')),
                array('code' => 'PH', 'name' => $greekStringConversion->grstrtoupper('Φιλιππίνες')),
                array('code' => 'PK', 'name' => $greekStringConversion->grstrtoupper('Πακιστάν')),
                array('code' => 'PL', 'name' => $greekStringConversion->grstrtoupper('Πολωνία')),
                array('code' => 'PM', 'name' => $greekStringConversion->grstrtoupper('Σεν Πιερ και Μικελόν')),
                array('code' => 'PN', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Πίτκερν')),
                array('code' => 'PR', 'name' => $greekStringConversion->grstrtoupper('Πουέρτο Ρίκο')),
                array('code' => 'PS', 'name' => $greekStringConversion->grstrtoupper('Παλαιστινιακά Εδάφη')),
                array('code' => 'PT', 'name' => $greekStringConversion->grstrtoupper('Πορτογαλία')),
                array('code' => 'PW', 'name' => $greekStringConversion->grstrtoupper('Παλάου')),
                array('code' => 'PY', 'name' => $greekStringConversion->grstrtoupper('Παραγουάη')),
                array('code' => 'QA', 'name' => $greekStringConversion->grstrtoupper('Κατάρ')),
                array('code' => 'RE', 'name' => $greekStringConversion->grstrtoupper('Ρεϊνιόν')),
                array('code' => 'RO', 'name' => $greekStringConversion->grstrtoupper('Ρουμανία')),
                array('code' => 'RS', 'name' => $greekStringConversion->grstrtoupper('Σερβία')),
                array('code' => 'RU', 'name' => $greekStringConversion->grstrtoupper('Ρωσία')),
                array('code' => 'RW', 'name' => $greekStringConversion->grstrtoupper('Ρουάντα')),
                array('code' => 'SA', 'name' => $greekStringConversion->grstrtoupper('Σαουδική Αραβία')),
                array('code' => 'SB', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Σολομώντος')),
                array('code' => 'SC', 'name' => $greekStringConversion->grstrtoupper('Σεϋχέλλες')),
                array('code' => 'SD', 'name' => $greekStringConversion->grstrtoupper('Σουδάν')),
                array('code' => 'SE', 'name' => $greekStringConversion->grstrtoupper('Σουηδία')),
                array('code' => 'SG', 'name' => $greekStringConversion->grstrtoupper('Σιγκαπούρη')),
                array('code' => 'SH', 'name' => $greekStringConversion->grstrtoupper('Αγία Ελένη')),
                array('code' => 'SI', 'name' => $greekStringConversion->grstrtoupper('Σλοβενία')),
                array('code' => 'SJ', 'name' => $greekStringConversion->grstrtoupper('Σβάλμπαρντ και Γιαν Μαγιέν')),
                array('code' => 'SK', 'name' => $greekStringConversion->grstrtoupper('Σλοβακία')),
                array('code' => 'SL', 'name' => $greekStringConversion->grstrtoupper('Σιέρα Λεόνε')),
                array('code' => 'SM', 'name' => $greekStringConversion->grstrtoupper('Άγιος Μαρίνος')),
                array('code' => 'SN', 'name' => $greekStringConversion->grstrtoupper('Σενεγάλη')),
                array('code' => 'SO', 'name' => $greekStringConversion->grstrtoupper('Σομαλία')),
                array('code' => 'SR', 'name' => $greekStringConversion->grstrtoupper('Σουρινάμ')),
                array('code' => 'SS', 'name' => $greekStringConversion->grstrtoupper('Νότιο Σουδάν')),
                array('code' => 'ST', 'name' => $greekStringConversion->grstrtoupper('Σάο Τομέ και Πρίνσιπε')),
                array('code' => 'SV', 'name' => $greekStringConversion->grstrtoupper('Ελ Σαλβαδόρ')),
                array('code' => 'SX', 'name' => $greekStringConversion->grstrtoupper('Άγιος Μαρτίνος (Ολλανδικό τμήμα)')),
                array('code' => 'SY', 'name' => $greekStringConversion->grstrtoupper('Συρία')),
                array('code' => 'SZ', 'name' => $greekStringConversion->grstrtoupper('Σουαζιλάνδη')),
                array('code' => 'TA', 'name' => $greekStringConversion->grstrtoupper('Τριστάν ντα Κούνια')),
                array('code' => 'TC', 'name' => $greekStringConversion->grstrtoupper('Νήσοι Τερκ και Κάικος')),
                array('code' => 'TD', 'name' => $greekStringConversion->grstrtoupper('Τσαντ')),
                array('code' => 'TF', 'name' => $greekStringConversion->grstrtoupper('Γαλλικές περιοχές του νοτίου ημισφαιρίου')),
                array('code' => 'TG', 'name' => $greekStringConversion->grstrtoupper('Τόγκο')),
                array('code' => 'TH', 'name' => $greekStringConversion->grstrtoupper('Ταϊλάνδη')),
                array('code' => 'TJ', 'name' => $greekStringConversion->grstrtoupper('Τατζικιστάν')),
                array('code' => 'TK', 'name' => $greekStringConversion->grstrtoupper('Τοκελάου')),
                array('code' => 'TL', 'name' => $greekStringConversion->grstrtoupper('Τιμόρ-Λέστε')),
                array('code' => 'TM', 'name' => $greekStringConversion->grstrtoupper('Τουρκμενιστάν')),
                array('code' => 'TN', 'name' => $greekStringConversion->grstrtoupper('Τυνησία')),
                array('code' => 'TO', 'name' => $greekStringConversion->grstrtoupper('Τόνγκα')),
                array('code' => 'TR', 'name' => $greekStringConversion->grstrtoupper('Τουρκία')),
                array('code' => 'TT', 'name' => $greekStringConversion->grstrtoupper('Τρινιντάντ και Τομπάγκο')),
                array('code' => 'TV', 'name' => $greekStringConversion->grstrtoupper('Τουβαλού')),
                array('code' => 'TW', 'name' => $greekStringConversion->grstrtoupper('Ταϊβάν')),
                array('code' => 'TZ', 'name' => $greekStringConversion->grstrtoupper('Τανζανία')),
                array('code' => 'UA', 'name' => $greekStringConversion->grstrtoupper('Ουκρανία')),
                array('code' => 'UG', 'name' => $greekStringConversion->grstrtoupper('Ουγκάντα')),
                array('code' => 'UM', 'name' => $greekStringConversion->grstrtoupper('Απομακρυσμένες Νησίδες Η.Π.Α.')),
                array('code' => 'US', 'name' => $greekStringConversion->grstrtoupper('Ηνωμένες Πολιτείες')),
                array('code' => 'UY', 'name' => $greekStringConversion->grstrtoupper('Ουρουγουάη')),
                array('code' => 'UZ', 'name' => $greekStringConversion->grstrtoupper('Ουζμπεκιστάν')),
                array('code' => 'VA', 'name' => $greekStringConversion->grstrtoupper('Βατικανό')),
                array('code' => 'VC', 'name' => $greekStringConversion->grstrtoupper('Άγιος Βικέντιος και Γρεναδίνες')),
                array('code' => 'VE', 'name' => $greekStringConversion->grstrtoupper('Βενεζουέλα')),
                array('code' => 'VG', 'name' => $greekStringConversion->grstrtoupper('Βρετανικές Παρθένοι Νήσοι')),
                array('code' => 'VI', 'name' => $greekStringConversion->grstrtoupper('Αμερικανικές Παρθένοι Νήσοι')),
                array('code' => 'VN', 'name' => $greekStringConversion->grstrtoupper('Βιετνάμ')),
                array('code' => 'VU', 'name' => $greekStringConversion->grstrtoupper('Βανουάτου')),
                array('code' => 'WF', 'name' => $greekStringConversion->grstrtoupper('Ουάλις και Φουτούνα')),
                array('code' => 'WS', 'name' => $greekStringConversion->grstrtoupper('Σαμόα')),
                array('code' => 'XK', 'name' => $greekStringConversion->grstrtoupper('Κόσοβο')),
                array('code' => 'YE', 'name' => $greekStringConversion->grstrtoupper('Υεμένη')),
                array('code' => 'YT', 'name' => $greekStringConversion->grstrtoupper('Μαγιότ')),
                array('code' => 'ZA', 'name' => $greekStringConversion->grstrtoupper('Νότια Αφρική')),
                array('code' => 'ZM', 'name' => $greekStringConversion->grstrtoupper('Ζάμπια')),
                array('code' => 'ZW', 'name' => $greekStringConversion->grstrtoupper('Ζιμπάμπουε')),
            )
        );
    }
}


text:
<?php

namespace backend\models;

use Yii;

/*
* This is the model class for table "categories".
*
    * @property integer $categories_id
    * @property string $default_title
    * @property string $image
    * @property integer $parent_id
    * @property string $status
    * @property string $created_at
    * @property string $updated_at
    * @property integer $created_by
    * @property integer $updated_by
    *
            * @property BackendUser $updatedBy
            * @property BackendUser $createdBy
            * @property CategoriesLanguage[] $categoriesLanguages
    */
class Categories extends \backend\models\BaseModel
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'categories';
}

/**
* @inheritdoc
*/
public function rules()
{
return [
            [['default_title', 'parent_id'], 'required'],
            [['parent_id', 'created_by', 'updated_by'], 'integer'],
            [['status'], 'string'],
            [['created_at', 'updated_at'], 'safe'],
            [['default_title', 'image'], 'string', 'max' => 64]
        ];
}

/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
    'categories_id' => Yii::t('app', 'Categories ID'),
    'default_title' => Yii::t('app', 'Default Title'),
    'image' => Yii::t('app', 'Image'),
    'parent_id' => Yii::t('app', 'Parent ID'),
    'status' => Yii::t('app', 'Displayed'),
    'created_at' => Yii::t('app', 'Created At'),
    'updated_at' => Yii::t('app', 'Updated At'),
    'created_by' => Yii::t('app', 'Created By'),
    'updated_by' => Yii::t('app', 'Updated By'),
];
}

    /**
    * @return \yii\db\ActiveQuery
    */
    public function getUpdatedBy()
    {
    return $this->hasOne(BackendUser::className(), ['id' => 'updated_by']);
    }

    /**
    * @return \yii\db\ActiveQuery
    */
    public function getCreatedBy()
    {
    return $this->hasOne(BackendUser::className(), ['id' => 'created_by']);
    }

    /**
    * @return \yii\db\ActiveQuery
    */
    public function getCategoriesLanguages()
    {
    return $this->hasMany(CategoriesLanguage::className(), ['categories_id' => 'categories_id']);
    }
}


text:
/* 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.
 */

package org.flowable.engine.delegate;

import java.util.Map;

import org.flowable.bpmn.model.FlowElement;

/**
 * @author Yvo Swillens
 */
public interface TransactionDependentExecutionListener extends BaseExecutionListener {

  String ON_TRANSACTION_BEFORE_COMMIT = "before-commit";
  String ON_TRANSACTION_COMMITTED = "committed";
  String ON_TRANSACTION_ROLLED_BACK = "rolled-back";

  void notify(String processInstanceId, String executionId, FlowElement flowElement,
              Map<String, Object> executionVariables, Map<String, Object> customPropertiesMap);
}


text:
This tests basic cross-filesystem operations.

Drop files here if you test this manually


text:
---
uid: SolidEdgePart.SplitCurves.Add(System.Int32,System.Array@,System.Int32,System.Array@)
summary:
remarks:
syntax:
    parameters:
    - id: CurvesArray
      description: Specifies the construction curve objects to be split.
    - id: NumberOfCurves
      description: Specifies the number of elements in CurvesArray.
    - id: NumberOfSecondaries
      description: Specifies the number of elements in SecondaryArray.
    - id: SecondaryArray
      description: Specifies the objects with which to split the input construction curve objects.  This array can contain construction curves, edges, faces, surfaces, planes, keypoints, profile elements, or sketch elements.
---


text:
package com.Robostangs;

import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.can.CANTimeoutException;

/**
 * @author Thunderbird
 */
public class Shooter {
    private static CANJaguar shooterJag;
    private static Shooter instance = null;
    private static Encoder shooterEncoder;
    private static Solenoid shooterSolenoidOn, shooterSolenoidOff, proxPower;
    private static DigitalInput shooterLimit, proxSwitch;
    private static Timer shooterTimer;
    public static boolean shooshoo = true, loadCompleted = false,
            isShooting = false, encoderInit = false, loading = false;

    private Shooter() {
        try {
            shooterJag = new CANJaguar(Constants.SHOOTER_JAG_POS);
        } catch (CANTimeoutException ex) {
            System.out.println("SHOOTER CAN ERROR");
        }

        Ingestor.getInstance();
        shooterEncoder = new Encoder(Constants.SHOOTER_ENCODER_1, Constants.SHOOTER_ENCODER_2);
        shooterLimit = new DigitalInput(Constants.SHOOTER_LIMIT_POS);
        shooterSolenoidOn = new Solenoid(Constants.SHOOTER_CYCLINDER_IN_POS);
        shooterSolenoidOff = new Solenoid(Constants.SHOOTER_CYCLINDER_OUT_POS);
	proxSwitch = new DigitalInput(Constants.SHOOTER_PROX_SWITCH_POS);
	proxPower = new Solenoid(Constants.SHOOTER_PROX_POWER_POS);
        shooterTimer = new Timer();

	solenoidDisable();

	proxPower.set(true);
	shooterEncoder.reset();
	shooterEncoder.start();
        shooshoo = false;
    }

    public static Shooter getInstance() {
        if (instance == null) {
            instance = new Shooter();
        }
        return instance;
    }

    public static void set(double power) {
	    try {
		shooterJag.setX(power);
	    } catch (CANTimeoutException ex) {
                System.out.println("SHOOTER CAN ERROR");
	    }
    }

    public static void load() {
        if (proxSwitch.get()) {
            set(Constants.SHOOTER_LOAD_POWER);
        } else {
            set(0);
        }
    }

    public static void autoLoad() {
	if (isShooting) {
	    if (shooterTimer.get() > 0.5) {
		shooshoo = true;
		isShooting = false;
		shooterTimer.stop();
                shooterTimer.reset();
	    }
	} else {
            if (!loadCompleted) {
                if (proxSwitch.get()) {
                    solenoidDisable();
                    set(Constants.SHOOTER_LOAD_POWER);
                    loading = true;
                } else {
                    set(0);
                    loading = false;
                    loadCompleted = true;
                    shooshoo = false;
                }
            }
        }
    }

    public static void loadAutonomous() {
	if (isShooting) {
	    if (shooterTimer.get() > 0.5) {
		shooshoo = true;
		isShooting = false;
		shooterTimer.stop();
                shooterTimer.reset();
	    }
	} else {
            if (!loadCompleted) {
                if (proxSwitch.get()) {
                    solenoidDisable();
                    set(0.75);
                } else {
                    set(0);
                    loadCompleted = true;
                    shooshoo = false;
                }
            }
        }
    }

    public static void shoot() {
	solenoidEnable();
	set(0);
	Ingestor.stop();
	loadCompleted = false;
	isShooting = true;
        shooterTimer.start();

	/*
        if (shooshoo) {
            shooterTimer.start();
            solenoidEnable();
            set(0);
            shooshoo = false;
        }

        if (shooterTimer.get() > Constants.SHOOTER_SHOOT_DELAY_TIME) {
            Ingestor.setSpeed(Constants.INGESTOR_EXGEST_SPEED);
        } else if (shooterTimer.get() > Constants.SHOOTER_SHOOT_STOP_TIME) {
            shooterTimer.stop();
        }*/
    }

    public static void shooShoot() {
	if (shooshoo) {
	    autoLoad();
	} else {
	    shoot();
	}
    }

    public static void resetShoot() {
        shooterTimer.reset();
        shooshoo = true;
    }

    public static void solenoidEnable() {
	shooterSolenoidOff.set(false);
	shooterSolenoidOn.set(true);
    }

    public static void solenoidDisable() {
	shooterSolenoidOff.set(true);
	shooterSolenoidOn.set(false);
    }

    public static void stop() {
        solenoidDisable();
        resetShoot();
        set(0);
    }

    public static double getEncoderDistance() {
	return shooterEncoder.getRaw();
    }

    public static boolean getLimit() {
	return proxSwitch.get();
        //return shooterLimit.get();
    }

    public static double getCurrent() {
        try {
            return shooterJag.getOutputCurrent();
        } catch (CANTimeoutException ex) {
            return -1;
        }
    }

    /*
    public static void increaseShooterTime() {
        Constants.SHOOTER_SHOOT_DELAY_TIME += 0.001;
    }

    public static void decreaseShooterTime() {
        Constants.SHOOTER_SHOOT_DELAY_TIME -= 0.001;
    }*/
}


text:
Blog_App_BDD_TestScripts
===

- Setup SSH Keys: https://help.github.com/articles/generating-ssh-keys/

- Clone our repository : `git@github.com:deepaksusarla/Blog_App_BDD_TestCases.git`

# Basic Setup

### Install java and maven

- Java Download: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

- Maven Download: https://maven.apache.org/download.cgi

Please follow the steps provided in below url

http://www.baeldung.com/install-maven-on-windows-linux-mac

# Running Automation Tests

    cd Blog_App_BDD_TestCases
    mvn clean install -DskipTests

    mvn test -DsuiteXmlFile=CucumberTestSuite.xml

# Adding/Modifying Automation Tests

  - Cucumber feature files are at "src/test/resources/features/" location. From here feature files can added or modified

  - Cucumber step defintions are at "src/test/java/" location. Files are in "com.blog.stepDefintions". From here stepDefinitions can added or modified.

  For better clarity please look into below project structure image.

- Added BDD and Normal testSuites.

- BDD test Cases are in "CucumberTestSuite.xml" and Normal test Cases are in "TestSuite.xml"

# Project Structure

 - ![ScreenShot](https://raw.github.com/deepaksusarla/Blog_App_BDD_TestCases/master/ProjectStructure.png)

Note: For reply comment test scenario, waited for 15 secs. Otherwise throughing error "reply is too fast."


text:
package com.communote.server.core.vo.blog;

/**
 * Exception thrown sorting and comparing the note discussion
 *
 * @author Communote GmbH - http://www.communote.com/
 */
public class NoteDiscussionComparatorException extends RuntimeException {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    /**
     * @param msg
     *            the message
     */
    public NoteDiscussionComparatorException(String msg) {
        super(msg);
    }

}


text:
module Authorization
  class OpenForRoleStatement < Exception; end
  class NoCurrentForRoleStatement < Exception; end
  class InvalidRole < Exception; end
end


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Turma extends Model
{
    public $fillable = ['fk_solicitacao','fk_professor', 'tipo_turma','ch_semestral_turma',
    'ch_semanal_turma','local_turma'];

      public function solicitacao()
      {
        return $this->belongsTo(Solicitacao::class, 'fk_solicitacao');
      }

      public function professor()
      {
        return $this->belongsTo(Professor::class, 'fk_professor');
      }
}


text:
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/methods', __FILE__)

describe "Time#min" do
  it "returns the minute of the hour (0..59) for time" do
    with_timezone("CET", 1) do
      Time.at(0).min.should == 0
    end
  end
end


text:
class GitlabUploader < CarrierWave::Uploader::Base
  class_attribute :options

  class << self
    # DSL setter
    def storage_options(options)
      self.options = options
    end

    def root
      options.storage_path
    end

    # represent the directory namespacing at the class level
    def base_dir
      options.fetch('base_dir', '')
    end

    def file_storage?
      storage == CarrierWave::Storage::File
    end

    def absolute_path(upload_record)
      File.join(root, upload_record.path)
    end
  end

  storage_options Gitlab.config.uploads

  delegate :base_dir, :file_storage?, to: :class

  def initialize(model, mounted_as = nil, **uploader_context)
    super(model, mounted_as)
  end

  def file_cache_storage?
    cache_storage.is_a?(CarrierWave::Storage::File)
  end

  def move_to_cache
    file_storage?
  end

  def move_to_store
    file_storage?
  end

  def exists?
    file.present?
  end

  def cache_dir
    File.join(root, base_dir, 'tmp/cache')
  end

  def work_dir
    File.join(root, base_dir, 'tmp/work')
  end

  def filename
    super || file&.filename
  end

  def model_valid?
    !!model
  end

  def local_url
    File.join('/', self.class.base_dir, dynamic_segment, filename)
  end

  def cached_size
    size
  end

  def open
    stream =
      if file_storage?
        File.open(path, "rb") if path
      else
        ::Gitlab::HttpIO.new(url, cached_size) if url
      end

    return unless stream
    return stream unless block_given?

    begin
      yield(stream)
    ensure
      stream.close
    end
  end

  private

  # Designed to be overridden by child uploaders that have a dynamic path
  # segment -- that is, a path that changes based on mutable attributes of its
  # associated model
  #
  # For example, `FileUploader` builds the storage path based on the associated
  # project model's `path_with_namespace` value, which can change when the
  # project or its containing namespace is moved or renamed.
  def dynamic_segment
    raise(NotImplementedError)
  end

  # To prevent files from moving across filesystems, override the default
  # implementation:
  # http://github.com/carrierwaveuploader/carrierwave/blob/v1.0.0/lib/carrierwave/uploader/cache.rb#L181-L183
  def workfile_path(for_file = original_filename)
    # To be safe, keep this directory outside of the the cache directory
    # because calling CarrierWave.clean_cache_files! will remove any files in
    # the cache directory.
    File.join(work_dir, cache_id, version_name.to_s, for_file)
  end
end


text:
<?php

namespace app\modules\user\models;

use Yii;

/**
 * This is the model class for table "{{%user_profile}}".
 *
 * @property integer $user_id
 * @property integer $gender
 * @property string $birthdate
 * @property string $signature
 * @property string $address
 * @property string $description
 *
 * @property User $user
 */
class Profile extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user_profile}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['gender',], 'required'],
            [['user_id', 'gender'], 'integer'],
            [['birthdate'], 'safe'],
            [['address', 'description'], 'string'],
            [['signature'], 'string', 'max' => 120]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'user_id' => Yii::t('app', 'User ID'),
            'gender' => Yii::t('app', 'Gender'),
            'birthdate' => Yii::t('app', 'Birthdate'),
            'signature' => Yii::t('app', 'Signature'),
            'address' => Yii::t('app', 'Position'),
            'description' => Yii::t('app', 'Description'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:background="#e3393c" >

        <TextView
            android:id="@+id/tv_trydrive"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="预约试驾"
            android:textColor="#ffffff"
            android:textSize="19dp"
            android:textStyle="bold" />
		<RelativeLayout
		    android:layout_width="50dp"
		    android:layout_height="50dp"
			 android:id="@+id/iv_back_askIssue_rl"
		    >
        <ImageView
            android:id="@+id/iv_back_askIssue"
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:layout_marginLeft="5dp"
            android:src="@drawable/img_back" />
		</RelativeLayout>
    </RelativeLayout>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:gravity="center_horizontal"
        >
		<LinearLayout
		    android:layout_width="fill_parent"
		    android:layout_height="wrap_content"
		    android:layout_margin="16dp"
		     android:orientation="vertical"
		     android:background="#e3eef0"
		    >
        <TextView
            android:id="@+id/tv_tpway"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:text="请填写您的试驾信息"
            android:layout_gravity="center_horizontal"
            android:textSize="16dp"
              android:textColor="#333333"
            />
     <EditText
            android:id="@+id/et_inputname"
             android:layout_marginTop="8dp"
            android:background="@drawable/btn_white_city"
             android:layout_width="fill_parent"
              android:singleLine="true"
            android:layout_height="30dp"
            android:hint="	请输入您的姓名..."
            android:layout_marginLeft="8dp"
            android:textSize="14dp"
            android:layout_marginRight="8dp"
            />
        <EditText
            android:id="@+id/et_inputphone"
             android:singleLine="true"
            android:layout_marginTop="8dp"
           android:background="@drawable/btn_white_city"
            android:layout_width="fill_parent"
            android:layout_height="30dp"
            android:layout_marginBottom="16dp"
             android:textSize="14dp"
             android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
             android:hint="	请输入您的电话..."
            />
         </LinearLayout>
         <Button
            android:id="@+id/bt_trydrive"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
           android:text="提交"
           android:gravity="center"
            android:textSize="18sp"
            android:textColor="#ffffff"
            android:background="#22b8f7"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
             />
         <TextView
             android:id="@+id/tv_kefutp"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="提示:"
            android:layout_marginLeft="16dp"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            android:layout_marginRight="16dp"
            android:textSize="15dp"
            android:textColor="#e3393c"
            />
         <TextView
              android:id="@+id/tv_phone"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:textColor="#999999"
            android:textSize="13dp"
            android:text="在您预约试驾成功后,买车助手的客服会联系您,告知试驾的详细安排,请您耐心等待."
            />
    </LinearLayout>
</LinearLayout>


text:
.. slideconf::
   :autoslides: True
   :theme: single-level

=======================
 Hieroglyph Smoke Test
=======================

.. ifslides::

   .. figure:: /_static/hieroglyphs.jpg
      :class: fill

      CC BY-SA http://www.flickr.com/photos/tamburix/2900909093/

This is the Hieroglyph Smoke Test. It contains visual tests for
verifying Hieroglyph functionality.

.. ifnotslides::

   This section should not be included in slides.

Bulleted Lists
==============

- First Point
- Second Point
- Third Point

Another notation:

* First Point
* Second Point
* Third Point

Enumerated Lists
================

This list will be numbered:

#. First Point
#. Second Point
#. Third Point

This list will be lettered:

A. First Point
B. Second Point
#. Third Point

Nested Lists
------------

* First
* Second

  * Sub Item 1
  * Sub Item 2

Code Highlighting
=================

This block will be highlighted as Python:

.. code-block:: python

    def func(a):
        print 'The value of a is %(a)s' % locals()

This block will be highlighted as Javascript:

.. code-block:: javascript

   function func(a) {
       console.log('The value of a is ', a);
   }

This block will not be highlighted:

.. code-block:: none

   def func(a):
       """I am not highlighted."""

Admonitions
===========

The ``note`` admonition is used to create notes in the presenter console.

.. note::

   This is a *note* admonition. It will not appear in the slides.

.. warning::

   Warnings, however, stay where they belong.

.. note::

   Notes can appear anywhere in the slide content.

Hieroglyph Features
===================

The following slides test Hieroglyph features.

Incremental Slides
------------------

.. rst-class:: build

- Adding the ``build`` class to a container
- To incrementally show its contents
- Remember that *Sphinx* maps the basic ``class`` directive to ``rst-class``

Splitting Sections
------------------

The ``nextslide`` directive will split a single section into multiple
slides.

.. nextslide::
   :increment:

The ``increment`` option tells Hieroglyph to add ``(2)`` (and
subsequent indices) to the title.

.. only:: slides

   Only on slides, please

.. slide:: The ``slide`` Directive
   :level: 2

   In addition to headings, you can use the ``..slide::`` directive to
   define a slide.

   A recursive example::

     .. slide:: The ``slide`` Directive
        :level: 2

        In addition to headings, you can use the ``..slide::`` directive to
        define a slide.

        A recursive example:

.. slide:: Only a title here.

.. slide::

   This slide has only Content, no Title.


text:
Dbmng.FormInline = Class.extend({
  //class constructor
  init: function( options ) {
    this.aForm  = options.aForm;
    if(! options.aParam ) {
	    options.aParam={};
		}
    this.aParam = jQuery.extend(true, {}, Dbmng.defaults.aParam, options.aParam);

    if( options.theme ) {
      this.theme = options.theme;
    }
    else {
      this.theme = Dbmng.defaults.theme;
    }
		if(options.onChange){
			this.onChange=options.onChange;
		}
    if(options.onChangeRow){
			this.onChangeRow=options.onChangeRow;
		}
    if(options.addEachRow){
			this.addEachRow=options.addEachRow;
		}
  },
	getTransaction: function() {
		var val=[];

		for(var i=0; i<this.forms.length; i++){
			var k=this.forms[i].getPkValue();
			var t={"mode":"update", "key":k, "body":this.forms[i].getValue()};
			val.push(t);
		}
		return val;
	},
	getValue: function() {
		var val=[];
		for(var i=0; i<this.forms.length; i++){
			val.push(this.forms[i].getValue());
		}
		return val;
	},
  isValid: function(){
    var self=this;
    var val=true;
    var messages=[];
    for(var i=0; i<this.forms.length; i++){
      var v=this.forms[i].isValid();
        if(!v.ok){
          val=false;
          messages.push({"message": v.message, "record": i});
        }
    }
    return {"ok": val, "messages": messages};
  },
	createForm: function(aData) {
    var self=this;

    var div = document.createElement('div');
    self.main_node=div;

		//create an empty table
		var tab=this.theme.getTable({data:[],header:[], aParam:this.aParam});

		this.forms=[];

    var form_base=new Dbmng.Form({"aForm":this.aForm, "aParam":this.aParam, "theme":this.theme});
		//create the headers
		for(var keyf in this.aForm.fields){
      var widget=form_base.getWidget(keyf);
      if(widget.isVisible()){
  			var field=this.aForm.fields[keyf];
  			jQuery(tab).find('thead tr').append(this.theme.getTableHCell({"content":field.label}));
      }
		}

    jQuery.each(aData, function(i,val){
		//for(var i=0; i<.length; i++){

      var current_record=i;
			var form=new Dbmng.Form({"aForm":self.aForm, "aParam":self.aParam, "theme":self.theme});
			self.forms.push(form);
			var fields=form.getFields(aData[i]);

			var r=jQuery("

").appendTo(jQuery(tab).find('tbody'));

				for(var key in fields){
          var wdg=form.getWidget(key);
          if(wdg.isVisible()){
  					var c=jQuery('	').appendTo(r);
  					c.append(fields[key]);
          }
          else{
            var ff=jQuery(fields[key]).hide()[0];
            r.append(ff);
          }
					wdg.pk_value=form.getPkValue();
          wdg.form=form;
					if(self.onChange){
						wdg.onChange=self.onChange;
					}
					else{
					}

          if(self.onChangeRow){
						wdg.onFocus=self.onChangeRow;
          }

				}

        if(self.aParam.do_delete){
          var col=jQuery('	').appendTo(r);
          var del_label='Del';
          if (self.aParam.del_label) {
            del_label=self.aParam.del_label;
          }
          // debugger
          var button_delete=jQuery('<button data-record="'+current_record+'">'+del_label+'</button>')[0];
          col[0].appendChild(button_delete);

          jQuery(button_delete).click(function(){
            var records=self.getValue();
            var record=jQuery(this).attr('data-record');
            records.splice(record,1);
            //self.main_node.removeChild(self.main_node.childNodes[0]);
            self.main_node.innerHTML = '';
            self.main_node.appendChild(self.createForm(records));
          });

          // button_delete.addEventListener("click",function(){
          //   console.log(aData[current_record]);
          //   // records=self.getValue();
          //   // records.push({});
          //   // console.log(records);
          //   // //self.main_node.removeChild(self.main_node.childNodes[0]);
          //   // self.main_node.innerHTML = '';
          //   // self.main_node.appendChild(self.createForm(records));
          // });

        }

        if(this.addEachRow){
          this.addEachRow(r,aData[i]);
        }
  });
    div.appendChild(tab);
    if(self.aParam.do_insert===true){
      var button = self.theme.getButton("Insert",{'class':'insert_button'});
      div.appendChild(button);

      button.addEventListener("click",function(){
        var records=self.getValue();
        records.push({});
        //self.main_node.removeChild(self.main_node.childNodes[0]);
        self.main_node.innerHTML = '';
        self.main_node.appendChild(self.createForm(records));
      });
    }

		//console.log(this.forms);
		return div;
	}
});


text:
  <md-toolbar>

      <md-button href="/">App</md-button>

      <md-menu  data-ng-show="authentication.user">
        <md-button aria-label="open" ng-click="$mdOpenMenu($event)">

        </md-button>
        <md-menu-content width="4">
          <md-menu-item>
            <md-button data-ui-sref="settings.profile">Edit Profile</md-button>
          </md-menu-item>
          <md-menu-item>
            <md-button data-ui-sref="settings.picture">Change Profile Picture</md-button>
          </md-menu-item>
          <md-menu-item>
            <md-button data-ui-sref="settings.password">Change Password</md-button>
          </md-menu-item>
          <md-menu-item>
            <md-button data-ui-sref="settings.accounts">Manage Social Accounts</md-button>
          </md-menu-item>
          <md-menu-divider class="md-primary"></md-menu-divider>
          <md-menu-item>
            <md-button href="/api/auth/signout" target="_self">Signout</md-button>
          </md-menu-item>
        </md-menu-content>
      </md-menu>
      <md-button data-ng-hide="authentication.user" class="md-hue-1" data-ui-sref="authentication.signup">Sign Up</md-button>
      <md-button data-ng-hide="authentication.user" class="md-hue-1" data-ui-sref="authentication.signin">Sign In</md-button>

  </md-toolbar>


text:
package dc.longshot.util;

import com.badlogic.gdx.math.MathUtils;

public final class FloatRange {

	private final float min;
	private final float max;

	public FloatRange(final float min, final float max) {
		this.min = min;
		this.max = max;
	}

	public final float min() {
		return min;
	}

	public final float max() {
		return max;
	}

	public final float difference() {
		return max - min;
	}

	public final float random() {
		return MathUtils.random(min, max);
	}

}