text:
"""Python client library for the Facebook Platform.

This client library is designed to support the Graph API and the
official Facebook JavaScript SDK, which is the canonical way to
implement Facebook authentication. Read more about the Graph API at
http://developers.facebook.com/docs/api. You can download the Facebook
JavaScript SDK at http://github.com/facebook/connect-js/.

If your application is using Google AppEngine's webapp framework, your
usage of this module might look like this:

user = facebook.get_user_from_cookie(self.request.cookies, key, secret)
if user:
    graph = facebook.GraphAPI(user["access_token"])
    profile = graph.get_object("me")
    friends = graph.get_connections("me", "friends")

"""

import cgi
import time
import urllib
import urllib2
import httplib
import hashlib
import hmac
import base64
import logging
import socket

# Find a JSON parser
import json
_parse_json = json.loads

# Find a query string parser
try:
    from urlparse import parse_qs
except ImportError:
    from cgi import parse_qs

class GraphAPI(object):
    """A client for the Facebook Graph API.

    See http://developers.facebook.com/docs/api for complete
    documentation for the API.

    The Graph API is made up of the objects in Facebook (e.g., people,
    pages, events, photos) and the connections between them (e.g.,
    friends, photo tags, and event RSVPs). This client provides access
    to those primitive types in a generic way. For example, given an
    OAuth access token, this will fetch the profile of the active user
    and the list of the user's friends:

       graph = facebook.GraphAPI(access_token)
       user = graph.get_object("me")
       friends = graph.get_connections(user["id"], "friends")

    You can see a list of all of the objects and connections supported
    by the API at http://developers.facebook.com/docs/reference/api/.

    You can obtain an access token via OAuth or by using the Facebook
    JavaScript SDK. See
    http://developers.facebook.com/docs/authentication/ for details.

    If you are using the JavaScript SDK, you can use the
    get_user_from_cookie() method below to get the OAuth access token
    for the active user from the cookie saved by the SDK.

    """
    def __init__(self, access_token=None, timeout=None):
        self.access_token = access_token
        self.timeout = timeout

    def get_object(self, id, **args):
        """Fetchs the given object from the graph."""
        return self.request(id, args)

    def get_objects(self, ids, **args):
        """Fetchs all of the given object from the graph.

        We return a map from ID to object. If any of the IDs are
        invalid, we raise an exception.
        """
        args["ids"] = ",".join(ids)
        return self.request("", args)

    def get_connections(self, id, connection_name, **args):
        """Fetchs the connections for given object."""
        return self.request(id + "/" + connection_name, args)

    def put_object(self, parent_object, connection_name, **data):
        """Writes the given object to the graph, connected to the given parent.

        For example,

            graph.put_object("me", "feed", message="Hello, world")

        writes "Hello, world" to the active user's wall. Likewise, this
        will comment on a the first post of the active user's feed:

            feed = graph.get_connections("me", "feed")
            post = feed["data"][0]
            graph.put_object(post["id"], "comments", message="First!")

        See http://developers.facebook.com/docs/api#publishing for all
        of the supported writeable objects.

        Certain write operations require extended permissions. For
        example, publishing to a user's feed requires the
        "publish_actions" permission. See
        http://developers.facebook.com/docs/publishing/ for details
        about publishing permissions.

        """
        assert self.access_token, "Write operations require an access token"
        return self.request(parent_object + "/" + connection_name,
                            post_args=data)

    def put_wall_post(self, message, attachment={}, profile_id="me"):
        """Writes a wall post to the given profile's wall.

        We default to writing to the authenticated user's wall if no
        profile_id is specified.

        attachment adds a structured attachment to the status message
        being posted to the Wall. It should be a dictionary of the form:

            {"name": "Link name"
             "link": "http://www.example.com/",
             "caption": "{*actor*} posted a new review",
             "description": "This is a longer description of the attachment",
             "picture": "http://www.example.com/thumbnail.jpg"}

        """
        return self.put_object(profile_id, "feed", message=message,
                               **attachment)

    def put_comment(self, object_id, message):
        """Writes the given comment on the given post."""
        return self.put_object(object_id, "comments", message=message)

    def put_like(self, object_id):
        """Likes the given post."""
        return self.put_object(object_id, "likes")

    def delete_object(self, id):
        """Deletes the object with the given ID from the graph."""
        self.request(id, post_args={"method": "delete"})

    def delete_request(self, user_id, request_id):
        """Deletes the Request with the given ID for the given user."""
        conn = httplib.HTTPSConnection('graph.facebook.com')

        url = '/%s_%s?%s' % (
            request_id,
            user_id,
            urllib.urlencode({'access_token': self.access_token}),
        )
        conn.request('DELETE', url)
        response = conn.getresponse()
        data = response.read()

        response = _parse_json(data)
        # Raise an error if we got one, but don't not if Facebook just
        # gave us a Bool value
        if (response and isinstance(response, dict) and
            response.get("error")):
            raise GraphAPIError(response)

        conn.close()

    def put_photo(self, image, message=None, album_id=None, **kwargs):
        """Uploads an image using multipart/form-data.

        image=File like object for the image
        message=Caption for your image
        album_id=None posts to /me/photos which uses or creates and uses
        an album for your application.

        """
        object_id = album_id or "me"
        #it would have been nice to reuse self.request;
        #but multipart is messy in urllib
        post_args = {
                  'access_token': self.access_token,
                  'source': image,
                  'message': message
        }
        post_args.update(kwargs)
        content_type, body = self._encode_multipart_form(post_args)
        req = urllib2.Request(("https://graph.facebook.com/%s/photos" %
                               object_id),
                              data=body)
        req.add_header('Content-Type', content_type)
        try:
            data = urllib2.urlopen(req).read()
        #For Python 3 use this:
        #except urllib2.HTTPError as e:
        except urllib2.HTTPError, e:
            data = e.read()  # Facebook sends OAuth errors as 400, and urllib2
                             # throws an exception, we want a GraphAPIError
        try:
            response = _parse_json(data)
            # Raise an error if we got one, but don't not if Facebook just
            # gave us a Bool value
            if (response and isinstance(response, dict) and
                response.get("error")):
                raise GraphAPIError(response)
        except ValueError:
            response = data

        return response

    # based on: http://code.activestate.com/recipes/146306/
    def _encode_multipart_form(self, fields):
        """Encode files as 'multipart/form-data'.

        Fields are a dict of form name-> value. For files, value should
        be a file object. Other file-like objects might work and a fake
        name will be chosen.

        Returns (content_type, body) ready for httplib.HTTP instance.

        """
        BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
        CRLF = '\r\n'
        L = []
        for (key, value) in fields.items():
            logging.debug("Encoding %s, (%s)%s" % (key, type(value), value))
            if not value:
                continue
            L.append('--' + BOUNDARY)
            if hasattr(value, 'read') and callable(value.read):
                filename = getattr(value, 'name', '%s.jpg' % key)
                L.append(('Content-Disposition: form-data;'
                          'name="%s";'
                          'filename="%s"') % (key, filename))
                L.append('Content-Type: image/jpeg')
                value = value.read()
                logging.debug(type(value))
            else:
                L.append('Content-Disposition: form-data; name="%s"' % key)
            L.append('')
            if isinstance(value, unicode):
                logging.debug("Convert to ascii")
                value = value.encode('ascii')
            L.append(value)
        L.append('--' + BOUNDARY + '--')
        L.append('')
        body = CRLF.join(L)
        content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
        return content_type, body

    def request(self, path, args=None, post_args=None):
        """Fetches the given path in the Graph API.

        We translate args to a valid query string. If post_args is
        given, we send a POST request to the given path with the given
        arguments.

        """
        args = args or {}

        if self.access_token:
            if post_args is not None:
                post_args["access_token"] = self.access_token
            else:
                args["access_token"] = self.access_token
        post_data = None if post_args is None else urllib.urlencode(post_args)
        try:
            file = urllib2.urlopen("https://graph.facebook.com/" + path + "?" +
                    urllib.urlencode(args), post_data, timeout=self.timeout)
        except urllib2.HTTPError, e:
            response = _parse_json(e.read())
            raise GraphAPIError(response)
        except TypeError:
            # Timeout support for Python <2.6
            if self.timeout:
                socket.setdefaulttimeout(self.timeout)
            file = urllib2.urlopen("https://graph.facebook.com/" + path + "?" +
                                    urllib.urlencode(args), post_data)
        try:
            fileInfo = file.info()
            if fileInfo.maintype == 'text':
                response = _parse_json(file.read())
            elif fileInfo.maintype == 'image':
                mimetype = fileInfo['content-type']
                response = {
                    "data": file.read(),
                    "mime-type": mimetype,
                    "url": file.url,
                }
            else:
                raise GraphAPIError('Maintype was not text or image')
        finally:
            file.close()
        if response and isinstance(response, dict) and response.get("error"):
            raise GraphAPIError(response["error"]["type"],
                                response["error"]["message"])
        return response

    def api_request(self, path, args=None, post_args=None):
        """Fetches the given path in the Graph API.

        We translate args to a valid query string. If post_args is
        given, we send a POST request to the given path with the given
        arguments.

        """
        args = args or {}
        if self.access_token:
            if post_args is not None:
                post_args["access_token"] = self.access_token
            else:
                args["access_token"] = self.access_token
        if self.api_key:
            if post_args is not None:
                post_args["api_key"] = self.api_key
            else:
                args["api_key"] = self.api_key
        if post_args is not None:
            post_args["format"] = "json-strings"
        else:
            args["format"] = "json-strings"
        post_data = None if post_args is None else urllib.urlencode(post_args)
        try:
            file = urllib.urlopen("https://api.facebook.com/method/" + path +
                    "?" + urllib.urlencode(args),
                    post_data, timeout=self.timeout)
        except TypeError:
            # Timeout support for Python <2.6
            if self.timeout:
                socket.setdefaulttimeout(self.timeout)
            file = urllib.urlopen("https://api.facebook.com/method/" + path +
                    "?" + urllib.urlencode(args), post_data)

        try:
            response = _parse_json(file.read())
        finally:
            file.close()
        if response and response.get("error"):
            raise GraphAPIError(response)
        return response

    def fql(self, query, args=None, post_args=None):
        """FQL query.

        Example query: "SELECT affiliations FROM user WHERE uid = me()"

        """
        args = args or {}
        if self.access_token:
            if post_args is not None:
                post_args["access_token"] = self.access_token
            else:
                args["access_token"] = self.access_token
        post_data = None if post_args is None else urllib.urlencode(post_args)

        """Check if query is a dict and
           use the multiquery method
           else use single query
        """
        if not isinstance(query, basestring):
            args["queries"] = query
            fql_method = 'fql.multiquery'
        else:
            args["query"] = query
            fql_method = 'fql.query'

        args["format"] = "json"

        try:
            file = urllib2.urlopen("https://api.facebook.com/method/" +
                               fql_method + "?" + urllib.urlencode(args),
                               post_data, timeout=self.timeout)
        except TypeError:
            # Timeout support for Python <2.6
            if self.timeout:
                socket.setdefaulttimeout(self.timeout)
            file = urllib2.urlopen("https://api.facebook.com/method/" +
                           fql_method + "?" + urllib.urlencode(args),
                           post_data)

        try:
            content = file.read()
            response = _parse_json(content)
            #Return a list if success, return a dictionary if failed
            if type(response) is dict and "error_code" in response:
                raise GraphAPIError(response)
        except Exception, e:
            raise e
        finally:
            file.close()

        return response

    def extend_access_token(self, app_id, app_secret):
        """
        Extends the expiration time of a valid OAuth access token. See
        <https://developers.facebook.com/roadmap/offline-access-removal/
        #extend_token>

        """
        args = {
            "client_id": app_id,
            "client_secret": app_secret,
            "grant_type": "fb_exchange_token",
            "fb_exchange_token": self.access_token,
        }
        response = urllib.urlopen("https://graph.facebook.com/oauth/"
                            "access_token?" + urllib.urlencode(args)).read()
        query_str = parse_qs(response)
        if "access_token" in query_str:
            result = {"access_token": query_str["access_token"][0]}
            if "expires" in query_str:
                result["expires"] = query_str["expires"][0]
            return result
        else:
            response = json.loads(response)
            raise GraphAPIError(response)

class GraphAPIError(Exception):
    def __init__(self, result):
        #Exception.__init__(self, message)
        #self.type = type
        self.result = result
        try:
            self.type = result["error_code"]
        except:
            self.type = ""

        # OAuth 2.0 Draft 10
        try:
            self.message = result["error_description"]
        except:
            # OAuth 2.0 Draft 00
            try:
                self.message = result["error"]["message"]
            except:
                # REST server style
                try:
                    self.message = result["error_msg"]
                except:
                    self.message = result

        Exception.__init__(self, self.message)

def get_user_from_cookie(cookies, app_id, app_secret):
    """Parses the cookie set by the official Facebook JavaScript SDK.

    cookies should be a dictionary-like object mapping cookie names to
    cookie values.

    If the user is logged in via Facebook, we return a dictionary with
    the keys "uid" and "access_token". The former is the user's
    Facebook ID, and the latter can be used to make authenticated
    requests to the Graph API. If the user is not logged in, we
    return None.

    Download the official Facebook JavaScript SDK at
    http://github.com/facebook/connect-js/. Read more about Facebook
    authentication at
    http://developers.facebook.com/docs/authentication/.

    """
    cookie = cookies.get("fbsr_" + app_id, "")
    if not cookie:
        return None
    parsed_request = parse_signed_request(cookie, app_secret)
    try:
        result = get_access_token_from_code(parsed_request["code"], "",
                                          app_id, app_secret)
    except GraphAPIError:
        return None
    result["uid"] = parsed_request["user_id"]
    return result

def parse_signed_request(signed_request, app_secret):
    """ Return dictionary with signed request data.

    We return a dictionary containing the information in the
    signed_request. This includes a user_id if the user has authorised
    your application, as well as any information requested.

    If the signed_request is malformed or corrupted, False is returned.

    """
    try:
        l = signed_request.split('.', 2)
        encoded_sig = str(l[0])
        payload = str(l[1])
        sig = base64.urlsafe_b64decode(encoded_sig + "=" *
                                       ((4 - len(encoded_sig) % 4) % 4))
        data = base64.urlsafe_b64decode(payload + "=" *
                                        ((4 - len(payload) % 4) % 4))
    except IndexError:
        # Signed request was malformed.
        return False
    except TypeError:
        # Signed request had a corrupted payload.
        return False

    data = _parse_json(data)
    if data.get('algorithm', '').upper() != 'HMAC-SHA256':
        return False

    # HMAC can only handle ascii (byte) strings
    # http://bugs.python.org/issue5285
    app_secret = app_secret.encode('ascii')
    payload = payload.encode('ascii')

    expected_sig = hmac.new(app_secret,
                            msg=payload,
                            digestmod=hashlib.sha256).digest()
    if sig != expected_sig:
        return False

    return data

def auth_url(app_id, canvas_url, perms=None, state=None):
    url = "https://www.facebook.com/dialog/oauth?"
    kvps = {'client_id': app_id, 'redirect_uri': canvas_url}
    if perms:
        kvps['scope'] = ",".join(perms)
    if state:
        kvps['state'] = state
    return url + urllib.urlencode(kvps)

def get_access_token_from_code(code, redirect_uri, app_id, app_secret):
    """Get an access token from the "code" returned from an OAuth dialog.

    Returns a dict containing the user-specific access token and its
    expiration date (if applicable).

    """
    args = {
        "code": code,
        "redirect_uri": redirect_uri,
        "client_id": app_id,
        "client_secret": app_secret,
    }
    # We would use GraphAPI.request() here, except for that the fact
    # that the response is a key-value pair, and not JSON.
    response = urllib.urlopen("https://graph.facebook.com/oauth/access_token" +
                              "?" + urllib.urlencode(args)).read()
    query_str = parse_qs(response)
    if "access_token" in query_str:
        result = {"access_token": query_str["access_token"][0]}
        if "expires" in query_str:
            result["expires"] = query_str["expires"][0]
        return result
    else:
        response = json.loads(response)
        raise GraphAPIError(response)

def get_app_access_token(app_id, app_secret):
    """Get the access_token for the app.

    This token can be used for insights and creating test users.

    app_id = retrieved from the developer page
    app_secret = retrieved from the developer page

    Returns the application access_token.

    """
    # Get an app access token
    args = {'grant_type': 'client_credentials',
            'client_id': app_id,
            'client_secret': app_secret}

    file = urllib2.urlopen("https://graph.facebook.com/oauth/access_token?" +
                              urllib.urlencode(args))

    try:
        result = file.read().split("=")[1]
    finally:
        file.close()

    return result


text: pub mod test_ads;

redpajama_set_name: RedPajamaGithub


text:
/* @TODO flow */
import React from 'react';
import { TabNavigator, TabBarBottom } from 'react-navigation';

import tabsOptions from '../styles/tabs';
import StreamTabsCard from '../nav/StreamTabsCard';
import ConversationsContainer from '../conversations/ConversationsContainer';
import SettingsCard from '../settings/SettingsCard';
import { IconStream, IconSettings } from '../common/Icons';
import IconUnreadConversations from '../nav/IconUnreadConversations';

export default TabNavigator(
  {
    streams: {
      screen: props => <StreamTabsCard {...props.screenProps} />,
      navigationOptions: {
        tabBarLabel: 'Streams',
        tabBarIcon: ({ tintColor }) => <IconStream size={24} color={tintColor} />,
      },
    },
    conversations: {
      screen: props => <ConversationsContainer {...props.screenProps} />,
      navigationOptions: {
        tabBarLabel: 'Conversations',
        tabBarIcon: ({ tintColor }) => <IconUnreadConversations color={tintColor} />,
      },
    },
    settings: {
      screen: SettingsCard,
      navigationOptions: {
        tabBarLabel: 'Settings',
        tabBarIcon: ({ tintColor }) => <IconSettings size={24} color={tintColor} />,
      },
    },
  },
  tabsOptions(TabBarBottom, 'bottom', false),
);


text:
#include "Precompiled.h"
#include "ContainerAPI.h"
#include <string>
#include "ContainerJobManager.hpp"

const wchar_t *ContainerHostJobObjectName = L"Phoenix.Container.JobObject.APIv1\0";

ContainerJobManager::ContainerJobManager():hJob(nullptr)
{
  ///
}
ContainerJobManager::~ContainerJobManager()
{
  ///
}
bool ContainerJobManager::Initialize()
{
  BOOL bInJob=FALSE;
  IsProcessInJob(GetCurrentProcess(),NULL,&bInJob);
  if(bInJob)
  {
    //Debug Message: This Process already in a job
    return false;
  }
  return true;
}
void ContainerJobManager::Destory()
{
  if(!hJob)
  {
    this->hJob=OpenJobObject(READ_CONTROL,FALSE,ContainerHostJobObjectName);
    if(!this->hJob)
      return ;
  }
  TerminateJobObject(hJob,1);
}
HRESULT ContainerJobManager::StartRestrictedProcessEx(LPCWSTR pszApp,LPCWSTR pszArgs,LPCWSTR pszWorkdir,DWORD &pid)
{
  ///
  //OpenJobObject
  HANDLE hJob=OpenJobObject(READ_CONTROL,FALSE,ContainerHostJobObjectName);
  ///CreateProcess(...);
  return 0;
}

HRESULT ContainerJobManager::StartRestrictedProcess(LPCWSTR pszApp,LPCWSTR pszArgs,LPCWSTR pszWorkdir)
{
  DWORD m_pid=0;
  return ContainerJobManager::StartRestrictedProcessEx(pszApp,pszArgs,pszWorkdir,m_pid);
}


text:
using System.Collections.Generic;
using System.Linq;
using FubuMVC.Core.Registration.ObjectGraph;
using NUnit.Framework;
using StructureMap.Testing;

namespace FubuMVC.StructureMap3.Testing.Compliance
{
    [TestFixture]
    public class ObjectDef_Compliance
    {
        [Test]
        public void simple_ObjectDef_by_type()
        {
            var container = ContainerFacilitySource.New(x => {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
            });

            container.Get<IService>().ShouldBeOfType<SimpleService>();
        }

        [Test]
        public void simple_ObjectDef_by_value()
        {
            var service = new SimpleService();

            var container = ContainerFacilitySource.New(x => {
                x.Register(typeof (IService), ObjectDef.ForValue(service));
            });

            container.Get<IService>().ShouldBeTheSameAs(service);
        }

        [Test]
        public void auto_wiring_applies_when_the_dependency_is_not_set_explicitly()
        {
            var container = ContainerFacilitySource.New(x =>
            {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
            });

            container.Get<GuyWithService>().Service.ShouldBeOfType<SimpleService>();
        }

		[Test]
		public void auto_wiring_applies_even_when_another_dependency_is_set_explicitly() {
			var container = ContainerFacilitySource.New(x => {
				x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
				x.Register(typeof(IThing), ObjectDef.ForType<ThingOne>());

				var def = ObjectDef.ForType<GuyWithServiceAndThing>();
				def.DependencyByType<IThing>(ObjectDef.ForType<ThingTwo>());

				var highLevelDef = ObjectDef.ForType<HighLevelObject>();
				highLevelDef.DependencyByType<GuyWithServiceAndThing>(def);

				x.Register(typeof(IHighLevelObject), highLevelDef);
			});

			var guyWithServiceAndThing = container.Get<GuyWithServiceAndThing>();
			guyWithServiceAndThing.Service.ShouldBeOfType<SimpleService>(); // auto-wired
			guyWithServiceAndThing.Thing.ShouldBeOfType<ThingOne>(); // auto-wired, even though explicitly set to ThingTwo for HighLevelObject
		}

        [Test]
        public void ObjectDef_with_one_explicit_dependency_defined_by_type()
        {
            var container = ContainerFacilitySource.New(x =>
            {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());

                var objectDef = ObjectDef.ForType<GuyWithService>();
                objectDef.DependencyByType<IService>(ObjectDef.ForType<DifferentService>());

                x.Register(typeof(GuyWithService), objectDef);
            });

            // The default IService is SimpleService, but the default ObjectDef (first one) explicitly
            // set up its IService dependency to be a "DifferentService"
            container.Get<GuyWithService>().Service.ShouldBeOfType<DifferentService>();
        }

        [Test]
        public void ObjectDef_with_one_explicit_dependency_defined_by_value()
        {
            var container = ContainerFacilitySource.New(x =>
            {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());

                var objectDef = ObjectDef.ForType<GuyWithService>();
                objectDef.DependencyByType<IService>(ObjectDef.ForValue(new DifferentService()));

                x.Register(typeof(GuyWithService), objectDef);
            });

            // The default IService is SimpleService, but the default ObjectDef (first one) explicitly
            // set up its IService dependency to be a "DifferentService"
            container.Get<GuyWithService>().Service.ShouldBeOfType<DifferentService>();
        }

        [Test]
        public void ObjectDef_with_one_explicit_and_one_implicit_dependency()
        {
            var container = ContainerFacilitySource.New(x => {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
                x.Register(typeof(IThing), ObjectDef.ForType<ThingOne>());

                var def = ObjectDef.ForType<GuyWithServiceAndThing>();
                def.DependencyByType<IThing>(ObjectDef.ForType<ThingTwo>());

                x.Register(typeof(GuyWithServiceAndThing), def);
            });

            var guyWithServiceAndThing = container.Get<GuyWithServiceAndThing>();
            guyWithServiceAndThing.Service.ShouldBeOfType<SimpleService>(); // auto-wired
            guyWithServiceAndThing.Thing.ShouldBeOfType<ThingTwo>(); // explicitly set to be ThingTwo, even though auto-wiring would have put ThingOne here

        }

        [Test]
        public void three_deep_explicitly_configured_dep_tree()
        {
            var container = ContainerFacilitySource.New(x => {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
                x.Register(typeof(IThing), ObjectDef.ForType<ThingOne>());

                var def = ObjectDef.ForType<GuyWithServiceAndThing>();
                def.DependencyByType<IThing>(ObjectDef.ForType<ThingTwo>());

                var highLevelDef = ObjectDef.ForType<HighLevelObject>();
                highLevelDef.DependencyByType<GuyWithServiceAndThing>(def);

                x.Register(typeof(IHighLevelObject), highLevelDef);
            });

            var guyWithServiceAndThing = container.Get<IHighLevelObject>().Guy;
            guyWithServiceAndThing.Service.ShouldBeOfType<SimpleService>(); // auto-wired
            guyWithServiceAndThing.Thing.ShouldBeOfType<ThingTwo>(); // explicitly set to be ThingTwo, even though auto-wiring would have put ThingOne here
        }

        [Test]
        public void can_get_all_registered_implementations_of_a_service()
        {
            var container = ContainerFacilitySource.New(x =>
            {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
                x.Register(typeof(IService), ObjectDef.ForType<DifferentService>());
                x.Register(typeof(IService), ObjectDef.ForType<ExceptionCaseService>());
            });

            container.GetAll<IService>()
                .Select(x => x.GetType())
                .ShouldHaveTheSameElementsAs(typeof(SimpleService), typeof(DifferentService), typeof(ExceptionCaseService));
        }

        [Test]
        public void implicitly_auto_wires_all_implementations_of_a_service_if_not_explicitly_overridden()
        {
            var container = ContainerFacilitySource.New(x => {
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
                x.Register(typeof(IService), ObjectDef.ForType<DifferentService>());
                x.Register(typeof(IService), ObjectDef.ForType<ExceptionCaseService>());
            });

            container.Get<ThingThatUsesLotsOfServices>()
                .Services.Select(x => x.GetType())
                .ShouldHaveTheSameElementsAs(typeof(SimpleService), typeof(DifferentService), typeof(ExceptionCaseService));
        }

        [Test]
        public void implicitly_auto_wires_all_implementations_of_a_service_if_not_explicitly_overridden_and_maintains_the_order_of_registration()
        {
            var container = ContainerFacilitySource.New(x =>
            {
                x.Register(typeof(IService), ObjectDef.ForType<ExceptionCaseService>());
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
                x.Register(typeof(IService), ObjectDef.ForType<DifferentService>());

            });

            container.Get<ThingThatUsesLotsOfServices>()
                .Services.Select(x => x.GetType())
                .ShouldHaveTheSameElementsAs(typeof(ExceptionCaseService), typeof(SimpleService), typeof(DifferentService));
        }

        [Test]
        public void explicit_registration_of_an_ienumerable_argument()
        {
            var container = ContainerFacilitySource.New(x =>
            {
                x.Register(typeof(IService), ObjectDef.ForType<ExceptionCaseService>());
                x.Register(typeof(IService), ObjectDef.ForType<SimpleService>());
                x.Register(typeof(IService), ObjectDef.ForType<DifferentService>());

                var def = ObjectDef.ForType<ThingThatUsesLotsOfServices>();
                def.EnumerableDependenciesOf<IService>().Add(ObjectDef.ForType<OddballService>());
                def.EnumerableDependenciesOf<IService>().Add(ObjectDef.ForType<DifferentService>());

                x.Register(typeof(ThingThatUsesLotsOfServices), def);
            });

            container.Get<ThingThatUsesLotsOfServices>()
                .Services.Select(x => x.GetType())
                .ShouldHaveTheSameElementsAs(typeof(OddballService), typeof(DifferentService));
        }

        [Test]
        public void explicit_registration_of_a_primitive_argument()
        {
            var container = ContainerFacilitySource.New(x => {
                var def = ObjectDef.ForType<GuyWithPrimitive>();
                def.DependencyByValue("Jeremy");

                x.Register(typeof(GuyWithPrimitive), def);
            });

            container.Get<GuyWithPrimitive>()
                .Name.ShouldEqual("Jeremy");
        }
    }

    public class GuyWithPrimitive
    {
        private readonly string _name;

        public GuyWithPrimitive(string name)
        {
            _name = name;
        }

        public string Name
        {
            get { return _name; }
        }
    }

    public class ThingThatUsesLotsOfServices
    {
        private readonly IEnumerable<IService> _services;

        public ThingThatUsesLotsOfServices(IEnumerable<IService> services)
        {
            _services = services;
        }

        public IEnumerable<IService> Services
        {
            get { return _services; }
        }
    }

    public interface IHighLevelObject
    {
        GuyWithServiceAndThing Guy { get; }
    }

    public class HighLevelObject : IHighLevelObject
    {
        private readonly GuyWithServiceAndThing _guy;

        public HighLevelObject(GuyWithServiceAndThing guy)
        {
            _guy = guy;
        }

        public GuyWithServiceAndThing Guy
        {
            get { return _guy; }
        }
    }

    public class GuyWithServiceAndThing
    {
        private readonly IService _service;
        private readonly IThing _thing;

        public GuyWithServiceAndThing(IService service, IThing thing)
        {
            _service = service;
            _thing = thing;
        }

        public IService Service
        {
            get { return _service; }
        }

        public IThing Thing
        {
            get { return _thing; }
        }
    }

    public class GuyWithService
    {
        private readonly IService _service;

        public GuyWithService(IService service)
        {
            _service = service;
        }

        public IService Service
        {
            get { return _service; }
        }
    }

    public interface IService
    {

    }

    public class DifferentService : IService
    {

    }

    public class SimpleService : IService
    {

    }

    public class OddballService : IService
    {

    }

    public class ExceptionCaseService : IService
    {

    }

    public interface IThing
    {

    }

    public class ThingOne : IThing
    {

    }

    public class ThingTwo : IThing
    {

    }
}


text:
package com.gs.collections.impl.block.function;

import com.gs.collections.api.block.function.Function;
import com.gs.collections.impl.block.factory.StringFunctions;
import com.gs.collections.impl.list.mutable.FastList;
import com.gs.collections.impl.test.Verify;
import org.junit.Assert;
import org.junit.Test;

public final class StringFunctionsTest
{
    @Test
    public void toUpperCase()
    {
        Function<String, String> function = StringFunctions.toUpperCase();
        Assert.assertEquals("UPPER", function.valueOf("upper"));
        Assert.assertEquals("UPPER", function.valueOf("Upper"));
        Assert.assertEquals("UPPER", function.valueOf("UPPER"));
        Assert.assertSame("UPPER", function.valueOf("UPPER"));
    }

    @Test
    public void toLowerCase()
    {
        Function<String, String> function = StringFunctions.toLowerCase();
        Assert.assertEquals("lower", function.valueOf("LOWER"));
        Assert.assertEquals("lower", function.valueOf("Lower"));
        Assert.assertEquals("lower", function.valueOf("lower"));
        Assert.assertSame("lower", function.valueOf("lower"));
    }

    @Test
    public void toInteger()
    {
        Assert.assertEquals(-42L, StringFunctions.toInteger().valueOf("-42").longValue());
        Verify.assertInstanceOf(Integer.class, StringFunctions.toInteger().valueOf("10"));
    }

    @Test
    public void length()
    {
        Function<String, Integer> function = StringFunctions.length();
        Assert.assertEquals(Integer.valueOf(6), function.valueOf("string"));
        Assert.assertEquals(Integer.valueOf(0), function.valueOf(""));
        Assert.assertEquals("string.length()", function.toString());
    }

    @Test
    public void trim()
    {
        Function<String, String> function = StringFunctions.trim();
        Assert.assertEquals("trim", function.valueOf("trim "));
        Assert.assertEquals("trim", function.valueOf(" trim"));
        Assert.assertEquals("trim", function.valueOf("  trim  "));
        Assert.assertEquals("trim", function.valueOf("trim"));
        Assert.assertSame("trim", function.valueOf("trim"));
        Assert.assertEquals("string.trim()", function.toString());
    }

    @Test
    public void firstLetter()
    {
        Function<String, Character> function = StringFunctions.firstLetter();
        Assert.assertNull(function.valueOf(null));
        Assert.assertNull(function.valueOf(""));
        Assert.assertEquals('A', function.valueOf("Autocthonic").charValue());
    }

    @Test
    public void subString()
    {
        Function<String, String> function1 = StringFunctions.subString(2, 5);
        String testString = "habits";
        Assert.assertEquals("bit", function1.valueOf(testString));
        Verify.assertContains("string.subString", function1.toString());

        Function<String, String> function2 = StringFunctions.subString(0, testString.length());
        Assert.assertEquals(testString, function2.valueOf(testString));

        Function<String, String> function3 = StringFunctions.subString(0, testString.length() + 1);
        Verify.assertThrows(StringIndexOutOfBoundsException.class, () -> function3.valueOf(testString));

        Function<String, String> function4 = StringFunctions.subString(-1, 1);
        Verify.assertThrows(StringIndexOutOfBoundsException.class, () -> function4.valueOf(testString));
    }

    @Test(expected = StringIndexOutOfBoundsException.class)
    public void subString_throws_on_short_string()
    {
        StringFunctions.subString(2, 4).valueOf("hi");
    }

    @Test(expected = NullPointerException.class)
    public void subString_throws_on_null()
    {
        StringFunctions.subString(2, 4).valueOf(null);
    }

    @Test
    public void toPrimitiveBoolean()
    {
        Assert.assertTrue(StringFunctions.toPrimitiveBoolean().booleanValueOf("true"));
        Assert.assertFalse(StringFunctions.toPrimitiveBoolean().booleanValueOf("nah"));
    }

    @Test
    public void toPrimitiveByte()
    {
        Assert.assertEquals((byte) 16, StringFunctions.toPrimitiveByte().byteValueOf("16"));
    }

    @Test
    public void toFirstChar()
    {
        Assert.assertEquals('X', StringFunctions.toFirstChar().charValueOf("X-ray"));
    }

    @Test
    public void toPrimitiveChar()
    {
        Assert.assertEquals('A', StringFunctions.toPrimitiveChar().charValueOf("65"));
    }

    @Test(expected = StringIndexOutOfBoundsException.class)
    public void toPrimitiveCharWithEmptyString()
    {
        StringFunctions.toFirstChar().charValueOf("");
    }

    @Test
    public void toPrimitiveDouble()
    {
        Assert.assertEquals(3.14159265359d, StringFunctions.toPrimitiveDouble().doubleValueOf("3.14159265359"), 0.0);
    }

    @Test
    public void toPrimitiveFloat()
    {
        Assert.assertEquals(3.1415d, StringFunctions.toPrimitiveFloat().floatValueOf("3.1415"), 0.00001);
    }

    @Test
    public void toPrimitiveInt()
    {
        Assert.assertEquals(256, StringFunctions.toPrimitiveInt().intValueOf("256"));
    }

    @Test
    public void toPrimitiveLong()
    {
        Assert.assertEquals(0x7fffffffffffffffL, StringFunctions.toPrimitiveLong().longValueOf("9223372036854775807"));
    }

    @Test
    public void toPrimitiveShort()
    {
        Assert.assertEquals(-32768, StringFunctions.toPrimitiveShort().shortValueOf("-32768"));
    }

    @Test
    public void append()
    {
        Verify.assertContainsAll(FastList.newListWith("1", "2", "3", "4", "5").collect(StringFunctions.append("!")), "1!", "2!", "3!", "4!", "5!");
    }

    @Test
    public void prepend()
    {
        Verify.assertContainsAll(FastList.newListWith("1", "2", "3", "4", "5").collect(StringFunctions.prepend("@")), "@1", "@2", "@3", "@4", "@5");
    }

    @Test
    public void classIsNonInstantiable()
    {
        Verify.assertClassNonInstantiable(StringFunctions.class);
    }
}


text:
/**
This complete file is auto-generated with python script
tools/codegen/colorbrewer/colorbrewer.py
**/

#ifndef IWW_COLORBREWER_H
#define IWW_COLORBREWER_H

#include <inviwo/core/common/inviwocoredefine.h>
#include <inviwo/core/common/inviwo.h>
#include <vector>
#include <ostream>

namespace inviwo {
namespace colorbrewer {

class IVW_CORE_API ColorBrewerException : public Exception {
public:
    ColorBrewerException(const std::string &message = "Requested colormap is not available.",
                         ExceptionContext context = ExceptionContext())
        : Exception(message, context) {}
    virtual ~ColorBrewerException() throw() {}
};
class IVW_CORE_API ColorBrewerTooFewException : public Exception {
public:
    ColorBrewerTooFewException(const std::string &message = "Requested colormap does not support selected number of colors.",
        ExceptionContext context = ExceptionContext())
        : Exception(message, context) {}
    virtual ~ColorBrewerTooFewException() throw() {}
};
class IVW_CORE_API ColorBrewerTooManyException : public Exception {
public:
    ColorBrewerTooManyException(const std::string &message = "Requested colormap does not support selected number of colors.",
        ExceptionContext context = ExceptionContext())
        : Exception(message, context) {}
    virtual ~ColorBrewerTooManyException() throw() {}
};

##PLACEHOLDER##

template <class Elem, class Traits>
std::basic_ostream<Elem, Traits> &operator<<(std::basic_ostream<Elem, Traits> &os,
                                             Colormap colormap) {
    switch (colormap) {
##PLACEHOLDER_NAMES##
    }

    return os;
}

template <class Elem, class Traits>
std::basic_ostream<Elem, Traits> &operator<<(std::basic_ostream<Elem, Traits> &os,
                                             Category category) {
    switch (category) {
##PLACEHOLDER_CATEGORIES##
    }

    return os;
}

template <class Elem, class Traits>
std::basic_ostream<Elem, Traits> &operator<<(std::basic_ostream<Elem, Traits> &os,
                                             Family family) {
    switch (family) {
##PLACEHOLDER_FAMILIES##
    }

    return os;
}

/**
 * Returns the specified colormap. For reference see http://colorbrewer2.org/
 **/
IVW_CORE_API const std::vector<dvec4> &getColormap(Colormap colormap);

/**
 * Returns the colormap specified by its family and number of colors containted in the colormap. For
 * reference see http://colorbrewer2.org/. If the colormap is not available for the given number of
 * colors, a ColorBrewerException is thrown.
 **/
IVW_CORE_API const std::vector<dvec4> &getColormap(const Family &family, glm::uint8 numberOfColors);

/**
 * Returns all colormaps of a family. For example, if family Blues is requested, 6 cololormaps will
 * be returned since the family contains 6 levels of detail (Blues_3 - Blues_9).
 **/
IVW_CORE_API std::vector<std::vector<dvec4>> getColormaps(const Family &family);

/**
 * Returns all colormaps of a category. Returns a map with one entry per family storing all
 * colormaps for that family.
 **/
IVW_CORE_API std::map<Family, std::vector<std::vector<dvec4>>> getColormaps(
    const Category &category);

/**
 * Returns all colormaps of a category with given number of colors. If a colormap is not available
 * for the given number of colors, it is omitted. If none of the colormaps are available for the
 * whole category and the given number of colors, a ColorBrewerException is thrown.
 **/
IVW_CORE_API std::map<Family, std::vector<dvec4>> getColormaps(const Category &category,
                                                               glm::uint8 numberOfColors);

/**
 * Returns the minimum number of colors for which the requested family is available.
 **/
IVW_CORE_API glm::uint8 getMinNumberOfColorsForFamily(const Family &family);

/**
 * Returns the maximum number of colors for which the requested family is available.
 **/
IVW_CORE_API glm::uint8 getMaxNumberOfColorsForFamily(const Family &family);

/**
 * Returns all families contained in the specified category.
 **/
IVW_CORE_API std::vector<Family> getFamiliesForCategory(const Category &category);

}  // namespace colorbrewer
}  // namespace inviwo

#endif  // COLORBREWER_H


text:
tinymce.addI18n('id',{
"Redo": "Ulang",
"Undo": "Batalkan",
"Cut": "Potong",
"Copy": "Salin",
"Paste": "Rekat",
"Select all": "Pilih semua",
"New document": "Dokumen baru",
"Ok": "Ok",
"Cancel": "Batal",
"Visual aids": "Alat bantu visual",
"Bold": "Tebal",
"Italic": "Miring",
"Underline": "Garis bawah",
"Strikethrough": "Coret",
"Superscript": "Superskrip",
"Subscript": "Subskrip",
"Clear formatting": "Kosongkan format",
"Align left": "Rata kiri",
"Align center": "Rata tengah",
"Align right": "Rata kanan",
"Justify": "Rata penuh",
"Bullet list": "Daftar bersimbol",
"Numbered list": "Daftar bernomor",
"Decrease indent": "Kurangi inden",
"Increase indent": "Tambah inden",
"Close": "Tutup",
"Formats": "Format",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Browser anda tidak mendukung akses langsung ke papan klip. Silakan gunakan pintasan Ctrl+X\/C\/V dari keyboard.",
"Headers": "Judul",
"Header 1": "Judul 1",
"Header 2": "Judul 2",
"Header 3": "Judul 3",
"Header 4": "Judul 4",
"Header 5": "Judul 5",
"Header 6": "Judul 6",
"Headings": "Kepala",
"Heading 1": "Kepala 1",
"Heading 2": "Kepala 2",
"Heading 3": "Kepala 3",
"Heading 4": "Kepala 4",
"Heading 5": "Kepala 5",
"Heading 6": "Kepala 6",
"Preformatted": "Praformat",
"Div": "Div",
"Pre": "Pre",
"Code": "Kode",
"Paragraph": "Paragraf",
"Blockquote": "Kutipan",
"Inline": "Baris",
"Blocks": "Blok",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Penempelan sekarang dalam modus teks biasa. Konten sekarang akan disisipkan sebagai teks biasa sampai Anda memadamkan pilihan ini.",
"Fonts": "Huruf",
"Font Sizes": "Ukuran Huruf",
"Class": "Kelas",
"Browse for an image": "Jelajahi gambar",
"OR": "ATAU",
"Drop an image here": "Simpan gambar di sini",
"Upload": "Unggah",
"Block": "Blok",
"Align": "Sejajarkan",
"Default": "Bawaan",
"Circle": "Lingkaran",
"Disc": "Cakram",
"Square": "Kotak",
"Lower Alpha": "Huruf Kecil",
"Lower Greek": "Huruf Kecil Yunani",
"Lower Roman": "Huruf Kecil Romawi",
"Upper Alpha": "Huruf Besar",
"Upper Roman": "Huruf Besar Romawi",
"Anchor...": "Jangkar..",
"Name": "Nama",
"Id": "Id",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "Id harus dimulai dengan huruf, dan hanya diikuti oleh huruf, angka, koma, titik, titik koma atau garis bawah.",
"You have unsaved changes are you sure you want to navigate away?": "Anda memiliki perubahan yang belum disimpan, yakin ingin beralih ?",
"Restore last draft": "Muat kembali draft sebelumnya",
"Special character...": "Karakter khusus...",
"Source code": "Kode sumber",
"Insert\/Edit code sample": "Tambah\/Edit contoh kode",
"Language": "Bahasa",
"Code sample...": "Sampel kode...",
"Color Picker": "Pemilih warna",
"R": "M",
"G": "H",
"B": "B",
"Left to right": "Kiri ke kanan",
"Right to left": "Kanan ke kiri",
"Emoticons...": "Emotikon...",
"Metadata and Document Properties": "Metadata dan Properti Dokumen",
"Title": "Judul",
"Keywords": "Kata kunci",
"Description": "Deskripsi",
"Robots": "Robot",
"Author": "Penulis",
"Encoding": "Enkoding",
"Fullscreen": "Layar penuh",
"Action": "Tindakan",
"Shortcut": "Pintasan",
"Help": "Bantuan",
"Address": "Alamat",
"Focus to menubar": "Fokus ke menubar",
"Focus to toolbar": "Fokus ke toolbar",
"Focus to element path": "Fokus ke jalur elemen",
"Focus to contextual toolbar": "Fokus ke toolbar kontekstual",
"Insert link (if link plugin activated)": "Masukan link (jika plugin diaktifkan)",
"Save (if save plugin activated)": "Simpan (jika plugin simpan diaktifkan)",
"Find (if searchreplace plugin activated)": "Cari (jika plugin searchplace diaktifkan)",
"Plugins installed ({0}):": "Plugin terpasang ({0})",
"Premium plugins:": "Plugin premium:",
"Learn more...": "Pelajari selengkapnya...",
"You are using {0}": "Anda menggunakan {0}",
"Plugins": "Plugin",
"Handy Shortcuts": "Pintasan Praktis",
"Horizontal line": "Garis horisontal",
"Insert\/edit image": "Sisip\/sunting gambar",
"Image description": "Deskripsi gambar",
"Source": "Sumber",
"Dimensions": "Dimensi",
"Constrain proportions": "Samakan proporsi",
"General": "Umum",
"Advanced": "Lanjutan",
"Style": "Gaya",
"Vertical space": "Spasi vertikal",
"Horizontal space": "Spasi horisontal",
"Border": "Batas",
"Insert image": "Sisipkan gambar",
"Image...": "Gambar...",
"Image list": "Daftar gambar",
"Rotate counterclockwise": "Putar berlawananjarumjam",
"Rotate clockwise": "Putar searahjarumjam",
"Flip vertically": "Balik vertikal",
"Flip horizontally": "Balik horisontal",
"Edit image": "Sunting gambar",
"Image options": "Opsi gambar",
"Zoom in": "Perbesar",
"Zoom out": "Perkecil",
"Crop": "Krop",
"Resize": "Ubah ukuran",
"Orientation": "Orientasi",
"Brightness": "Kecerahan",
"Sharpen": "Ketajaman",
"Contrast": "Kontras",
"Color levels": "Tingakt warna",
"Gamma": "Gamma",
"Invert": "Kebalikan",
"Apply": "Terapkan",
"Back": "Kembali",
"Insert date\/time": "Sisipkan tanggal\/waktu",
"Date\/time": "Tanggal\/waktu",
"Insert\/Edit Link": "Masukkan\/Edit Tautan",
"Insert\/edit link": "Sisip\/sunting tautan",
"Text to display": "Teks yang ditampilkan",
"Url": "Tautan",
"Open link in...": "Buka tautan dalam...",
"Current window": "Jendela saat ini",
"None": "Tidak ada",
"New window": "Jendela baru",
"Remove link": "Buang tautan",
"Anchors": "Jangkar",
"Link...": "Tautan...",
"Paste or type a link": "Tempel atau ketik sebuah tautan",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "Tautan yang anda masukkan sepertinya adalah alamat email. Apakah Anda ingin menambahkan prefiks mailto: yang dibutuhkan?",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "Tautan yang anda masukkan sepertinya adalah tautan eksternal. Apakah Anda ingin menambahkan prefiks http:\/\/ yang dibutuhkan?",
"Link list": "Daftar tautan",
"Insert video": "Sisipkan video",
"Insert\/edit video": "Sisip\/sunting video",
"Insert\/edit media": "Sisip\/sunting media",
"Alternative source": "Sumber alternatif",
"Alternative source URL": "URL Sumber alternatif",
"Media poster (Image URL)": "Poster media (URL gambar)",
"Paste your embed code below:": "Tempel kode yang diembed dibawah ini:",
"Embed": "Embed",
"Media...": "Media...",
"Nonbreaking space": "Spasi",
"Page break": "Baris baru",
"Paste as text": "Tempel sebagai teks biasa",
"Preview": "Pratinjau",
"Print...": "Cetak...",
"Save": "Simpan",
"Find": "Cari",
"Replace with": "Ganti dengan",
"Replace": "Ganti",
"Replace all": "Ganti semua",
"Previous": "Sebelumnya",
"Next": "Berikutnya",
"Find and replace...": "Cari dan ganti...",
"Could not find the specified string.": "Tidak dapat menemukan string yang dimaksud.",
"Match case": "Samakan besar kecil huruf",
"Find whole words only": "Cari hanya kata utuh",
"Spell check": "Periksa ejaan",
"Ignore": "Abaikan",
"Ignore all": "Abaikan semua",
"Finish": "Selesai",
"Add to Dictionary": "Tambahkan ke kamus",
"Insert table": "Sisipkan tabel",
"Table properties": "Properti tabel",
"Delete table": "Hapus tabel",
"Cell": "Sel",
"Row": "Baris",
"Column": "Kolom",
"Cell properties": "Properti sel",
"Merge cells": "Gabung sel",
"Split cell": "Bagi sel",
"Insert row before": "Sisipkan baris sebelum",
"Insert row after": "Sisipkan baris setelah",
"Delete row": "Hapus baris",
"Row properties": "Properti baris",
"Cut row": "Penggal baris",
"Copy row": "Salin baris",
"Paste row before": "Tempel baris sebelum",
"Paste row after": "Tempel baris setelah",
"Insert column before": "Sisipkan kolom sebelum",
"Insert column after": "Sisipkan kolom setelah",
"Delete column": "Hapus kolom",
"Cols": "Kolom",
"Rows": "Baris",
"Width": "Lebar",
"Height": "Tinggi",
"Cell spacing": "Spasi sel ",
"Cell padding": "Lapisan sel",
"Show caption": "Perlihatkan keterangan",
"Left": "Kiri",
"Center": "Tengah",
"Right": "Kanan",
"Cell type": "Tipe sel",
"Scope": "Skup",
"Alignment": "Penjajaran",
"H Align": "Rata Samping",
"V Align": "Rata Atas",
"Top": "Atas",
"Middle": "Tengah",
"Bottom": "Bawah",
"Header cell": "Judul sel",
"Row group": "Kelompok baris",
"Column group": "Kelompok kolom",
"Row type": "Tipe baris",
"Header": "Judul",
"Body": "Body",
"Footer": "Footer",
"Border color": "Warna batas",
"Insert template...": "Masukkan template...",
"Templates": "Templat",
"Template": "Templat",
"Text color": "Warna teks",
"Background color": "Warna latar",
"Custom...": "Atur sendiri...",
"Custom color": "Warna sendiri",
"No color": "Tidak berwarna",
"Remove color": "Hapus warna",
"Table of Contents": "Daftar Isi",
"Show blocks": "Tampilkan blok",
"Show invisible characters": "Tampilkan karakter tak tampak",
"Word count": "Hitungan kata",
"Count": "Hitungan",
"Document": "Dokumen",
"Selection": "Pemilihan",
"Words": "Kata",
"Words: {0}": "Kata: {0}",
"{0} words": "{0} kata",
"File": "Berkas",
"Edit": "Sunting",
"Insert": "Sisip",
"View": "Tampilan",
"Format": "Format",
"Table": "Tabel",
"Tools": "Alat",
"Powered by {0}": "Didukung oleh {0}",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Area teks kaya. Tekan ALT-F9 untuk menu. Tekan ALT-F10 untuk toolbar. Tekan ALT-0 untuk bantuan",
"Image title": "Judul gambar",
"Border width": "Lebar pinggiran",
"Border style": "Gaya pinggiran",
"Error": "Kesalahan",
"Warn": "Peringatkan",
"Valid": "Valid",
"To open the popup, press Shift+Enter": "Untuk membuka popup, tekan Shift+Enter",
"Rich Text Area. Press ALT-0 for help.": "Area Teks Kaya. Tekan ALT-0 untuk bantuan.",
"System Font": "Huruf Sistem",
"Failed to upload image: {0}": "Gagal mengunggah gambar: {0}",
"Failed to load plugin: {0} from url {1}": "Gagal memuat plugin: {0} dari url {1}",
"Failed to load plugin url: {0}": "Gagal memuat url plugin: {0}",
"Failed to initialize plugin: {0}": "Gagal memulai plugin: {0}",
"example": "contoh",
"Search": "Cari",
"All": "Semua",
"Currency": "Mata Uang",
"Text": "Teks",
"Quotations": "Kutipan",
"Mathematical": "Matematis",
"Extended Latin": "Latin Diperluas",
"Symbols": "Simbol",
"Arrows": "Panah",
"User Defined": "Ditentukan Pengguna",
"dollar sign": "tanda dolar",
"currency sign": "tanda mata uang",
"euro-currency sign": "tanda mata uang eropa",
"colon sign": "tanda titik dua",
"cruzeiro sign": "tanda cruzeiro",
"french franc sign": "tanda franc prancis",
"lira sign": "tanda lira",
"mill sign": "tanda mill",
"naira sign": "tanda naira",
"peseta sign": "tanda peseta",
"rupee sign": "tanda rupee",
"won sign": "tanda won",
"new sheqel sign": "tanda sheqel baru",
"dong sign": "tanda dong",
"kip sign": "tanda kip",
"tugrik sign": "tanda tugrik",
"drachma sign": "tanda drachma",
"german penny symbol": "simbol penny jerman",
"peso sign": "tanda peso",
"guarani sign": "tanda guarani",
"austral sign": "tanda austral",
"hryvnia sign": "tanda hryvnia",
"cedi sign": "tanda cedi",
"livre tournois sign": "tanda livre tournois",
"spesmilo sign": "tanda spesmilo",
"tenge sign": "tanda tenge",
"indian rupee sign": "tanda rupee india",
"turkish lira sign": "tanda lira turki",
"nordic mark sign": "tanda mark nordik",
"manat sign": "tanda manat",
"ruble sign": "tanda ruble",
"yen character": "karakter yen",
"yuan character": "karakter yuan",
"yuan character, in hong kong and taiwan": "karakter yuan, di hong kong dan taiwan",
"yen\/yuan character variant one": "varian satu karakter yen\/yuan",
"Loading emoticons...": "Memuat emotikon...",
"Could not load emoticons": "Tidak dapat memuat emotikon",
"People": "Orang",
"Animals and Nature": "Hewan dan Alam",
"Food and Drink": "Makanan dan Minuman",
"Activity": "Aktivitas",
"Travel and Places": "Perjalanan dan Lokasi",
"Objects": "Objek",
"Flags": "Bendera",
"Characters": "Karakter",
"Characters (no spaces)": "Karakter (tanpa spasi)",
"{0} characters": "{0} karakter",
"Error: Form submit field collision.": "Kesalahan: Benturan bidang pengiriman bentuk.",
"Error: No form element found.": "Kesalahan: tidak ditemukan elemen bentuk.",
"Update": "Perbarui",
"Color swatch": "Contoh warna",
"Turquoise": "Turquoise",
"Green": "Hijau",
"Blue": "Biru",
"Purple": "Ungu",
"Navy Blue": "Biru Navy",
"Dark Turquoise": "Turquoise Gelap",
"Dark Green": "Hijau Gelap",
"Medium Blue": "Biru Medium",
"Medium Purple": "Ungu Medium",
"Midnight Blue": "Biru Midnight",
"Yellow": "Kuning",
"Orange": "Jingga",
"Red": "Merah",
"Light Gray": "Abu Muda",
"Gray": "Abu-abu",
"Dark Yellow": "Kuning Gelap",
"Dark Orange": "Jingga Gelap",
"Dark Red": "Merah Gelap",
"Medium Gray": "Abu Medium",
"Dark Gray": "Abu Gelap",
"Light Green": "Hijau Muda",
"Light Yellow": "Kuning Muda",
"Light Red": "Merah Muda",
"Light Purple": "Ungu Muda",
"Light Blue": "Biru Muda",
"Dark Purple": "Ungu Gelap",
"Dark Blue": "Biru Gelap",
"Black": "Hitam",
"White": "Putih",
"Switch to or from fullscreen mode": "Alihkan ke atau dari mode layar penuh",
"Open help dialog": "Buka dialog bantuan",
"history": "riwayat",
"styles": "gaya",
"formatting": "pemformatan",
"alignment": "penyejajaran",
"indentation": "indentasi",
"permanent pen": "pena permanen",
"comments": "komentar",
"Format Painter": "Format Pelukis",
"Insert\/edit iframe": "Masukkan\/edit iframe",
"Capitalization": "Kapitalisasi",
"lowercase": "huruf kecil",
"UPPERCASE": "HURUF BESAR",
"Title Case": "Huruf Judul",
"Permanent Pen Properties": "Properti Pena Permanen",
"Permanent pen properties...": "Properti pena permanen...",
"Font": "Huruf",
"Size": "Ukuran",
"More...": "Lainnya...",
"Spellcheck Language": "Periksa Ejaan Bahasa",
"Select...": "Pilih...",
"Preferences": "Preferensi",
"Yes": "Ya",
"No": "Tidak",
"Keyboard Navigation": "Navigasi Keyboard",
"Version": "Versi",
"Anchor": "Jangkar",
"Special character": "Spesial karakter",
"Code sample": "Contoh kode",
"Color": "Warna",
"Emoticons": "Emotikon",
"Document properties": "Properti dokumwn",
"Image": "Gambar",
"Insert link": "Sisipkan tautan",
"Target": "Jendela tujuan",
"Link": "Tautan",
"Poster": "Penulis",
"Media": "Media",
"Print": "Cetak",
"Prev": "Sebelumnya",
"Find and replace": "Cari dan ganti",
"Whole words": "Semua kata",
"Spellcheck": "Periksa ejaan",
"Caption": "Caption",
"Insert template": "Sisipkan templat"
});


text:
class PanelManager;

#include "Orbitersdk.h"

class MercuryCapsule : public VESSEL3
{
public:
	MercuryCapsule(OBJHANDLE hVessel, int flightmodel);
	virtual ~MercuryCapsule();

	virtual bool clbkLoadPanel2D(int id, PANELHANDLE hPanel, DWORD viewW, DWORD viewH);
	virtual bool clbkPanelMouseEvent(int  id, int  event, int  mx, int  my, void *  context);
	virtual bool clbkPanelRedrawEvent(int  id, int  event, SURFHANDLE  surf, void *  context);

private:
	PanelManager* pPanelManager;
};


text:
<?php
/**
 * @author wei
 * @time 2012-6-9 20:25:26
 * @version 0.1
 *
 */
require_once 'Zend/Registry.php';
require_once 'Twitter/Twitter.php';
require_once 'Login/Work.php';
class AccountController extends Zend_Controller_Action
{
	private $_smarty;
	private $_config;
	private $_auth;
	protected  $db;
	protected $message;
	private $_valid;

	public function init()
	{
		$this->_smarty=Zend_Registry::get('smarty');
		$this->_config=Zend_Registry::get('config');
		$this->db=Zend_Registry::get('db');
		$this->message=$this->_helper->getHelper('FlashMessenger');
		$this->_valid=new Twitter_Twitter($this->db, 0);
		$this->_auth=Zend_Auth::getInstance();

	}

	public function indexAction()
	{
		$auth=Zend_Auth::getInstance();

		if ($auth->hasIdentity())
		{
			$this->_redirect($this->_config->pathweb->base.'twitter/index');
		}
		$request=$this->getRequest();
		$message=$this->message->getMessages();
		$this->_smarty->assign('error',$message);
		$this->_smarty->display('account/login.tpl');

	}

	public function logoutAction()
	{
		Zend_Auth::getInstance()->clearIdentity();
		$this->_redirect('/account/index');
	}

	public function registerAction()
    {
        // action
        $error=$this->message->getMessages();
        $this->_smarty->assign('error',$error);
		$this->_smarty->display('account/register.tpl');
	}
	public function registersuccessAction()
	{
		$this->_smarty->display('account/registersuccess.tpl');
	}

	public function findpassAction()
	{
		$this->_smarty->display('account/findpass.tpl');
	}

}


text:
/*jslint browser: true, devel: true, node: true, ass: true, nomen: true, unparam: true, indent: 4 */

/**
 * @license
 * Copyright (c) 2015 The ExpandJS authors. All rights reserved.
 * This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt
 * The complete set of authors may be found at https://expandjs.github.io/AUTHORS.txt
 * The complete set of contributors may be found at https://expandjs.github.io/CONTRIBUTORS.txt
 */
(function () {
    "use strict";

    var lodash         = require('lodash'),
        assertArgument = require('../assert/assertArgument'),
        isString       = require('../tester/isString'),
        isVoid         = require('../tester/isVoid');

    /**
     * Converts `string` to start case.
     * See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case) for more details.
     *
     * ```js
     *     XP.startCase('fooBar');
     *     // => 'Foo Bar'
     *
     *     XP.startCase('--foo-bar');
     *     // => 'Foo Bar'
     *
     *     XP.startCase('__foo_bar__');
     *     // => 'Foo Bar'
     * ```
     *
     * @function startCase
     * @param {string} [string = ""] The string to convert.
     * @returns {string} Returns the start cased string.
     */
    module.exports = function snakeCase(string) {
        assertArgument(isVoid(string) || isString(string), 1, 'string');
        return string ? lodash.startCase(string) : '';
    };

}());


text:
#ifndef VOXEL_TI_TOFCAMERA_H
#define VOXEL_TI_TOFCAMERA_H

#include <ToFCameraBase.h>
#include "ToFFrameGenerator.h"

#include "TI3DToFExports.h"

#define PIX_CNT_MAX_SET_FAILED "pix_cnt_max_set_failed"
#define PIX_CNT_MAX "pix_cnt_max"
#define QUAD_CNT_MAX "quad_cnt_max"
#define SUBFRAME_CNT_MAX "sub_frame_cnt_max"

#define TG_EN "tg_en"
#define BLK_SIZE "blk_size"
#define BLK_HEADER_EN "blk_header_en"
#define OP_CS_POL "op_cs_pol"
#define FB_READY_EN "fb_ready_en"

#define CONFIDENCE_THRESHOLD "confidence_threshold"

#define ILLUM_EN_POL "illum_en_pol"

#define BIN_ROWS_TO_MERGE "rows_to_merge"
#define BIN_COLS_TO_MERGE "cols_to_merge"
#define BIN_ROW_COUNT "bin_row_count"
#define BIN_COLUMN_COUNT "bin_col_count"
#define BINNING_EN "binning_en"

#define ROW_START "row_start"
#define ROW_END "row_end"
#define COL_START "col_start"
#define COL_END "col_end"

#define DEBUG_EN "debug_en"

#define PIXEL_DATA_SIZE "pixel_data_size"
#define OP_DATA_ARRANGE_MODE "op_data_arrange_mode"
#define OP_CLK_FREQ "op_clk_freq"

#define HISTOGRAM_EN "histogram_en"

#define INTG_TIME "intg_time"  // Integration time
#define INTG_DUTY_CYCLE "intg_duty_cycle"
#define INTG_DUTY_CYCLE_SET_FAILED "intg_duty_cycle_set_failed"
#define MOD_FREQ1 "mod_freq1" // Modulation frequency for first source (MHz)
#define MOD_FREQ2 "mod_freq2" // Modulation frequency for second source (MHz)
#define VCO_FREQ "vco_freq"
#define MOD_PS1 "mod_ps1"
#define MOD_PS2 "mod_ps2"
#define MOD_M "mod_m"
#define MOD_N "mod_n"
#define MOD_PLL_UPDATE "mod_pll_update"

#define MA "ma"
#define MB "mb"
#define K0 "ka"
#define DEALIAS_EN "dealias_en"
#define DEALIAS_16BIT_OP_ENABLE "dealias_16bit_op_enable"
#define DEALIASED_PHASE_MASK "dealiased_ph_mask"

#define ToF_CALIB_SECT_FREQUENCY "frequency"
#define ToF_CALIB_SECT_CROSS_TALK "cross_talk"
#define ToF_CALIB_SECT_NON_LINEARITY "non_linearity"
#define ToF_CALIB_SECT_TEMPERATURE "temperature"
#define ToF_CALIB_SECT_COMMON_PHASE_OFFSET "common_phase_offset"
#define ToF_CALIB_SECT_PIXELWISE_PHASE_OFFSET "pixelwise_phase_offset"

#define ToF_CALIB_SECT_FREQUENCY_ID 1
#define ToF_CALIB_SECT_CROSS_TALK_ID 2
#define ToF_CALIB_SECT_NON_LINEARITY_ID 3
#define ToF_CALIB_SECT_TEMPERATURE_ID 4
#define ToF_CALIB_SECT_COMMON_PHASE_OFFSET_ID 5
#define ToF_CALIB_SECT_PIXELWISE_PHASE_OFFSET_ID 6

#define PHASE_CORR_ADD "phase_corr_add" // Is the phase correction additive or subtractive?
#define PHASE_CORR_1 "phase_corr_1"
#define PHASE_CORR_2 "phase_corr_2"
#define TILLUM_CALIB "tillum_calib"
#define TSENSOR_CALIB "tsensor_calib"
#define COEFF_ILLUM_1 "coeff_illum_1"
#define COEFF_ILLUM_2 "coeff_illum_2"
#define COEFF_SENSOR_1 "coeff_sensor_1"
#define COEFF_SENSOR_2 "coeff_sensor_2"
#define DISABLE_OFFSET_CORR "disable_offset_corr"
#define DISABLE_TEMP_CORR "disable_temp_corr"
#define CALIB_PREC "calib_prec"

#define DISABLE_PIXEL_OFFSETS "disable_per_pixel_offsets"

#define ToF_FRAME_TYPE "output_mode"
#define SOFTWARE_RESET "software_reset"

#define SPEED_OF_LIGHT 299792458.0

#define TI_VENDOR_ID 0x0451U

#define UNAMBIGUOUS_RANGE "unambiguous_range"

#define ILLUM_POWER "illum_power"
#define ILLUM_POWER_PERCENTAGE "illum_power_percentage"

namespace Voxel
{

namespace TI
{

// TI's ToF specific handling. This is generic base currently for TinTin and Haddock generation
class TI3DTOF_EXPORT ToFCamera: public ToFCameraBase
{
protected:
  bool _init();

  virtual bool _processRawFrame(const RawFramePtr &rawFrameInput, RawFramePtr &rawFrameOutput); // here output raw frame will have processed data, like ToF data for ToF cameras

  virtual bool _getAmplitudeNormalizingFactor(float &factor);
  virtual bool _getDepthScalingFactor(float& factor);

  virtual bool _setFrameRate(const FrameRate &r);
  virtual bool _getFrameRate(FrameRate &r) const;

  virtual bool _getFrameSize(FrameSize &s) const;
  virtual bool _setFrameSize(const FrameSize &s);
  virtual bool _setFrameSize(const FrameSize &s, bool resetROI);
  virtual bool _setStreamerFrameSize(const FrameSize &s) = 0;
  virtual bool _getMaximumFrameRate(FrameRate& frameRate, const FrameSize& forFrameSize) const;

  virtual bool _getBytesPerPixel(uint &bpp) const;
  virtual bool _setBytesPerPixel(const uint &bpp);

  virtual bool _getOpDataArrangeMode(int &dataArrangeMode) const;

  // Return the resultant modulation frequency. This is mod_freq1 for non-dealiased case and
  // gcd(mod_freq1, mod_freq2) for dealiased case
  virtual bool _getIlluminationFrequency(float &frequency) const = 0;

  virtual bool _getBinning(uint &rowsToMerge, uint &columnsToMerge) const;
  virtual bool _setBinning(uint rowsToMerge, uint columnsToMerge, const FrameSize &frameSize);

  // Return in MHz
  virtual bool _getSystemClockFrequency(uint &frequency) const = 0;
  virtual bool _isHistogramEnabled() const = 0;

  virtual bool _getToFFrameType(ToFFrameType &frameType) const;

  virtual bool _is16BitModeEnabled(bool &mode16Bit);
  virtual bool _getDealiasedPhaseMask(int &dealiasedPhaseMask);

  virtual bool _getSubFrameCount(int &subframeCount) const;

  virtual bool _initStartParams();

  virtual bool _applyCalibrationParams() = 0;

  virtual bool _getCurrentProfileRegisterName(String &name) = 0;
  virtual bool _getCurrentProfileID(int& id);
  virtual bool _saveCurrentProfileID(const int id);

  virtual bool _reset();

  virtual bool _getDataToReplace(uint32_t &dataToReplace); // phase data replaces either ambient or phase data in 16 bit mode. This parameter defines that data

  Ptr<ToFFrameGenerator> _tofFrameGenerator;

public:
  ToFCamera(const String &name, const String &chipset, DevicePtr device);

  // NOTE: Not using the low-level API for getting serial number. USB's serial number is enough
  //virtual bool getSerialNumber(String& serialNumber) const;

  virtual bool setSerialNumber(const String& serialNumber);

  virtual ~ToFCamera() {}

  friend class IntegrationTimeParameter;
};

class TI3DTOF_EXPORT PhaseCorrectionAdditiveParameter: public BoolParameter
{
public:
    PhaseCorrectionAdditiveParameter(bool value, RegisterProgrammer &programmer):
    BoolParameter(programmer, PHASE_CORR_ADD, 0, 0, 0, {"Subtract common-phase correction to phase.", "Add common-phase correction from phase."},
                  {"Subtract Correction", "Add Correction"}, value, "Common-phase Correction Type", "This read-only boolean indicates whether common-phase correction is additive or subtractive", Parameter::IO_READ_ONLY)
    {}
};
}
}

#endif // VOXEL_TI_TOFCAMERA_H


text:
module Configuration
  VALID_OPTIONS_KEYS    = [:api_key].freeze

  attr_accessor *VALID_OPTIONS_KEYS

  def reset
    self.api_key = nil
  end

  def configure
    yield self
  end
end


text:
#if !defined (DWARF2LOC_H)
#define DWARF2LOC_H

#include "dwarf2expr.h"

struct symbol_computed_ops;
struct objfile;
struct dwarf2_per_cu_data;
struct dwarf2_loclist_baton;
struct agent_expr;
struct axs_value;

/* This header is private to the DWARF-2 reader.  It is shared between
   dwarf2read.c and dwarf2loc.c.  */

/* `set debug entry-values' setting.  */
extern unsigned int entry_values_debug;

/* Return the OBJFILE associated with the compilation unit CU.  If CU
   came from a separate debuginfo file, then the master objfile is
   returned.  */
struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu);

/* Return the address size given in the compilation unit header for CU.  */
int dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu);

/* Return the DW_FORM_ref_addr size given in the compilation unit header for
   CU.  */
int dwarf2_per_cu_ref_addr_size (struct dwarf2_per_cu_data *cu);

/* Return the offset size given in the compilation unit header for CU.  */
int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu);

/* Return the text offset of the CU.  The returned offset comes from
   this CU's objfile.  If this objfile came from a separate debuginfo
   file, then the offset may be different from the corresponding
   offset in the parent objfile.  */
CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu);

/* Find a particular location expression from a location list.  */
const gdb_byte *dwarf2_find_location_expression
  (struct dwarf2_loclist_baton *baton,
   size_t *locexpr_length,
   CORE_ADDR pc);

struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off
  (sect_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu,
   CORE_ADDR (*get_frame_pc) (void *baton),
   void *baton);

struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off
  (cu_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu,
   CORE_ADDR (*get_frame_pc) (void *baton),
   void *baton);

extern const gdb_byte *dwarf2_fetch_constant_bytes (sect_offset,
						    struct dwarf2_per_cu_data *,
						    struct obstack *,
						    LONGEST *);

struct type *dwarf2_get_die_type (cu_offset die_offset,
				  struct dwarf2_per_cu_data *per_cu);

/* Find the frame base information for FRAMEFUNC at PC.  START is an
   out parameter which is set to point to the DWARF expression to
   compute.  LENGTH is an out parameter which is set to the length of
   the DWARF expression.  This throws an exception on error or if an
   expression is not found; the returned length will never be
   zero.  */

extern void func_get_frame_base_dwarf_block (struct symbol *framefunc,
					     CORE_ADDR pc,
					     const gdb_byte **start,
					     size_t *length);

/* Evaluate a location description, starting at DATA and with length
   SIZE, to find the current location of variable of TYPE in the context
   of FRAME.  */

struct value *dwarf2_evaluate_loc_desc (struct type *type,
					struct frame_info *frame,
					const gdb_byte *data,
					size_t size,
					struct dwarf2_per_cu_data *per_cu);

/* Converts a dynamic property into a static one.  ADDRESS is the address
   of the object currently being evaluated and might be nedded.
   Returns 1 if PROP could be converted and the static value is passed back
   into VALUE, otherwise returns 0.  */

int dwarf2_evaluate_property (const struct dynamic_prop *prop,
			      CORE_ADDR address,
			      CORE_ADDR *value);

/* A helper for the compiler interface that compiles a single dynamic
   property to C code.

   STREAM is where the C code is to be written.
   RESULT_NAME is the name of the generated variable.
   GDBARCH is the architecture to use.
   REGISTERS_USED is a bit-vector that is filled to note which
   registers are required by the generated expression.
   PROP is the property for which code is generated.
   ADDRESS is the address at which the property is considered to be
   evaluated.
   SYM the originating symbol, used for error reporting.  */

void dwarf2_compile_property_to_c (struct ui_file *stream,
				   const char *result_name,
				   struct gdbarch *gdbarch,
				   unsigned char *registers_used,
				   const struct dynamic_prop *prop,
				   CORE_ADDR address,
				   struct symbol *sym);

CORE_ADDR dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu,
				  unsigned int addr_index);

/* The symbol location baton types used by the DWARF-2 reader (i.e.
   SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol).  "struct
   dwarf2_locexpr_baton" is for a symbol with a single location
   expression; "struct dwarf2_loclist_baton" is for a symbol with a
   location list.  */

struct dwarf2_locexpr_baton
{
  /* Pointer to the start of the location expression.  Valid only if SIZE is
     not zero.  */
  const gdb_byte *data;

  /* Length of the location expression.  For optimized out expressions it is
     zero.  */
  size_t size;

  /* The compilation unit containing the symbol whose location
     we're computing.  */
  struct dwarf2_per_cu_data *per_cu;
};

struct dwarf2_loclist_baton
{
  /* The initial base address for the location list, based on the compilation
     unit.  */
  CORE_ADDR base_address;

  /* Pointer to the start of the location list.  */
  const gdb_byte *data;

  /* Length of the location list.  */
  size_t size;

  /* The compilation unit containing the symbol whose location
     we're computing.  */
  struct dwarf2_per_cu_data *per_cu;

  /* Non-zero if the location list lives in .debug_loc.dwo.
     The format of entries in this section are different.  */
  unsigned char from_dwo;
};

/* A dynamic property is either expressed as a single location expression
   or a location list.  If the property is an indirection, pointing to
   another die, keep track of the targeted type in REFERENCED_TYPE.  */

struct dwarf2_property_baton
{
  /* If the property is an indirection, we need to evaluate the location
     LOCEXPR or LOCLIST in the context of the type REFERENCED_TYPE.
     If NULL, the location is the actual value of the property.  */
  struct type *referenced_type;
  union
  {
    /* Location expression.  */
    struct dwarf2_locexpr_baton locexpr;

    /* Location list to be evaluated in the context of REFERENCED_TYPE.  */
    struct dwarf2_loclist_baton loclist;
  };
};

extern const struct symbol_computed_ops dwarf2_locexpr_funcs;
extern const struct symbol_computed_ops dwarf2_loclist_funcs;

extern const struct symbol_block_ops dwarf2_block_frame_base_locexpr_funcs;
extern const struct symbol_block_ops dwarf2_block_frame_base_loclist_funcs;

/* Compile a DWARF location expression to an agent expression.

   EXPR is the agent expression we are building.
   LOC is the agent value we modify.
   ARCH is the architecture.
   ADDR_SIZE is the size of addresses, in bytes.
   OP_PTR is the start of the location expression.
   OP_END is one past the last byte of the location expression.

   This will throw an exception for various kinds of errors -- for
   example, if the expression cannot be compiled, or if the expression
   is invalid.  */

extern void dwarf2_compile_expr_to_ax (struct agent_expr *expr,
				       struct axs_value *loc,
				       struct gdbarch *arch,
				       unsigned int addr_size,
				       const gdb_byte *op_ptr,
				       const gdb_byte *op_end,
				       struct dwarf2_per_cu_data *per_cu);

/* Determined tail calls for constructing virtual tail call frames.  */

struct call_site_chain
  {
    /* Initially CALLERS == CALLEES == LENGTH.  For partially ambiguous result
       CALLERS + CALLEES < LENGTH.  */
    int callers, callees, length;

    /* Variably sized array with LENGTH elements.  Later [0..CALLERS-1] contain
       top (GDB "prev") sites and [LENGTH-CALLEES..LENGTH-1] contain bottom
       (GDB "next") sites.  One is interested primarily in the PC field.  */
    struct call_site *call_site[1];
  };

struct call_site_stuff;
extern struct call_site_chain *call_site_find_chain (struct gdbarch *gdbarch,
						     CORE_ADDR caller_pc,
						     CORE_ADDR callee_pc);

/* A helper function to convert a DWARF register to an arch register.
   ARCH is the architecture.
   DWARF_REG is the register.
   This will throw an exception if the DWARF register cannot be
   translated to an architecture register.  */

extern int dwarf2_reg_to_regnum_or_error (struct gdbarch *arch, int dwarf_reg);

#endif /* dwarf2loc.h */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03.Triple_Sum
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> myList = Console.ReadLine().Split().Select(int.Parse).ToList();

            bool found = false;

            for (int i = 0; i < myList.Count; i++)
            {
                for (int j = i+1; j < myList.Count; j++)
                {
                    var sum = myList[i] + myList[j];
                    if (myList.Contains(sum))
                    {
                        Console.WriteLine($"{myList[i]} + {myList[j]} == {sum}");
                        found = true;
                    }

                }
            }
            if (found == false)
            {
                Console.WriteLine("No");
            }

        }
    }
}


text:
@interface DHCommand (Private)

- (id)initWithName:(NSString*)name
         commandId:(NSNumber*)commandId
        parameters:(NSDictionary*)parameters
            status:(NSString*)status
            result:(id)result
         timestamp:(NSString*)timestamp
          lifetime:(NSNumber*)lifetime
             flags:(NSNumber*)flags;

@end


text:
require 'spec_helper'

describe "New Patient" do
  let(:patient) { build(:patient, first_name: "Sheila", last_name: "Hanlon") }

  it "has a valid factory" do
    expect(patient).to be_valid
  end

  it "is invalid without a first name" do
    patient.first_name = nil
    expect(patient).to have(1).errors_on(:first_name)
  end

  it "is invalid without a last name" do
    patient.last_name = nil
    expect(patient).to have(1).errors_on(:last_name)
  end

  it "returns a patient's full name as a string" do
    expect(patient.name).to eq "Sheila Hanlon"
  end

  it "sends a text to the doctor when a new patient is created" do
    VCR.use_cassette('patient') do
      response = patient.send_text_message
      expect(response.status).to_not eq "failed"
    end
  end
end


text:
'''
Exercise 1b - Class 2 - Check versions
Changes to use exceptions to check if module exist. So this could be used to
make the programa compatible with more than one specific module if the
preferred one isn't found on the system (like pysnmp and netsnmp)

Gleydson Mazioli da Silva <gleydsonmazioli@gmail.com>
'''

try:
    import pysnmp
except ImportError:
    print 'pysnmp module not installed. Please install it using PIP.'
    quit()

try:
    import paramiko
except ImportError:
    print 'paramiko module not installed. Please install it using PIP.'
    quit()

def main():
    '''
    Main Function
    '''
    v_pysnmp = pysnmp.__version__
    v_paramiko = paramiko.__version__

    print 'The pysnmp installed version is ' + v_pysnmp
    print 'The paramiko installed version is ' + v_paramiko

if __name__ == "__main__":
    main()

quit()


text:
/**
 * This file is part of the CernVM File System.
 */

#include "cvmfs_config.h"
#include "crypto/hash.h"

#include <alloca.h>
#include <errno.h>
#include <fcntl.h>
#include <openssl/hmac.h>
#include <openssl/md5.h>
#include <openssl/ripemd.h>
#include <openssl/sha.h>
#include <unistd.h>

#include <cstdio>
#include <cstring>

#include "crypto/openssl_version.h"
#include "util/exception.h"
#include "KeccakHash.h"

using namespace std;  // NOLINT

#ifdef CVMFS_NAMESPACE_GUARD
namespace CVMFS_NAMESPACE_GUARD {
#endif

namespace shash {

const char *kAlgorithmIds[] =
  {"", "", "-rmd160", "-shake128", ""};

bool HexPtr::IsValid() const {
  const unsigned l = str->length();
  if (l == 0)
    return false;
  const char *c = str->data();  // Walks through the string
  unsigned i = 0;  // String position of *c

  for ( ; i < l; ++i, ++c) {
    if (*c == '-')
      break;
    if ((*c < '0') || (*c > 'f') || ((*c > '9') && (*c < 'a')))
      return false;
  }

  // Walk through all algorithms
  for (unsigned j = 0; j < kAny; ++j) {
    const unsigned hex_length = 2*kDigestSizes[j];
    const unsigned algo_id_length = kAlgorithmIdSizes[j];
    if (i == hex_length) {
      // Right suffix?
      for ( ; (i < l) && (i-hex_length < algo_id_length); ++i, ++c) {
        if (*c != kAlgorithmIds[j][i-hex_length])
          break;
      }
      if ((i == l) && (l == hex_length + algo_id_length))
        return true;
      i = hex_length;
      c = str->data() + i;
    }
  }

  return false;
}

Algorithms ParseHashAlgorithm(const string &algorithm_option) {
  if (algorithm_option == "sha1")
    return kSha1;
  if (algorithm_option == "rmd160")
    return kRmd160;
  if (algorithm_option == "shake128")
    return kShake128;
  return kAny;
}

Any MkFromHexPtr(const HexPtr hex, const char suffix) {
  Any result;

  const unsigned length = hex.str->length();
  if (length == 2*kDigestSizes[kMd5])
    result = Any(kMd5, hex);
  if (length == 2*kDigestSizes[kSha1])
    result = Any(kSha1, hex);
  // TODO(jblomer) compare -rmd160, -shake128
  if ((length == 2*kDigestSizes[kRmd160] + kAlgorithmIdSizes[kRmd160]))
    result = Any(kRmd160, hex);
  if ((length == 2*kDigestSizes[kShake128] + kAlgorithmIdSizes[kShake128]))
    result = Any(kShake128, hex);

  result.suffix = suffix;
  return result;
}

/**
 * Similar to MkFromHexPtr but the suffix is deducted from the HexPtr string.
 */
Any MkFromSuffixedHexPtr(const HexPtr hex) {
  Any result;

  const unsigned length = hex.str->length();
  if ((length == 2*kDigestSizes[kMd5]) || (length == 2*kDigestSizes[kMd5] + 1))
  {
    Suffix suffix = (length == 2*kDigestSizes[kMd5] + 1) ?
      *(hex.str->rbegin()) : kSuffixNone;
    result = Any(kMd5, hex, suffix);
  }
  if ((length == 2*kDigestSizes[kSha1]) ||
      (length == 2*kDigestSizes[kSha1] + 1))
  {
    Suffix suffix = (length == 2*kDigestSizes[kSha1] + 1) ?
      *(hex.str->rbegin()) : kSuffixNone;
    result = Any(kSha1, hex, suffix);
  }
  if ((length == 2*kDigestSizes[kRmd160] + kAlgorithmIdSizes[kRmd160]) ||
      (length == 2*kDigestSizes[kRmd160] + kAlgorithmIdSizes[kRmd160] + 1))
  {
    Suffix suffix =
      (length == 2*kDigestSizes[kRmd160] + kAlgorithmIdSizes[kRmd160] + 1)
        ? *(hex.str->rbegin())
        : kSuffixNone;
    result = Any(kRmd160, hex, suffix);
  }
  if ((length == 2*kDigestSizes[kShake128] + kAlgorithmIdSizes[kShake128]) ||
      (length == 2*kDigestSizes[kShake128] + kAlgorithmIdSizes[kShake128] + 1))
  {
    Suffix suffix =
      (length == 2*kDigestSizes[kShake128] + kAlgorithmIdSizes[kShake128] + 1)
        ? *(hex.str->rbegin())
        : kSuffixNone;
    result = Any(kShake128, hex, suffix);
  }

  return result;
}

/**
 * Allows the caller to create the context on the stack.
 */
unsigned GetContextSize(const Algorithms algorithm) {
  switch (algorithm) {
    case kMd5:
      return sizeof(MD5_CTX);
    case kSha1:
      return sizeof(SHA_CTX);
    case kRmd160:
      return sizeof(RIPEMD160_CTX);
    case kShake128:
      return sizeof(Keccak_HashInstance);
    default:
      PANIC(kLogDebug | kLogSyslogErr,
            "tried to generate hash context for unspecified hash. Aborting...");
  }
}

void Init(ContextPtr context) {
  HashReturn keccak_result;
  switch (context.algorithm) {
    case kMd5:
      assert(context.size == sizeof(MD5_CTX));
      MD5_Init(reinterpret_cast<MD5_CTX *>(context.buffer));
      break;
    case kSha1:
      assert(context.size == sizeof(SHA_CTX));
      SHA1_Init(reinterpret_cast<SHA_CTX *>(context.buffer));
      break;
    case kRmd160:
      assert(context.size == sizeof(RIPEMD160_CTX));
      RIPEMD160_Init(reinterpret_cast<RIPEMD160_CTX *>(context.buffer));
      break;
    case kShake128:
      assert(context.size == sizeof(Keccak_HashInstance));
      keccak_result = Keccak_HashInitialize_SHAKE128(
        reinterpret_cast<Keccak_HashInstance *>(context.buffer));
      assert(keccak_result == SUCCESS);
      break;
    default:
      PANIC(NULL);  // Undefined hash
  }
}

void Update(const unsigned char *buffer, const unsigned buffer_length,
            ContextPtr context)
{
  HashReturn keccak_result;
  switch (context.algorithm) {
    case kMd5:
      assert(context.size == sizeof(MD5_CTX));
      MD5_Update(reinterpret_cast<MD5_CTX *>(context.buffer),
                 buffer, buffer_length);
      break;
    case kSha1:
      assert(context.size == sizeof(SHA_CTX));
      SHA1_Update(reinterpret_cast<SHA_CTX *>(context.buffer),
                  buffer, buffer_length);
      break;
    case kRmd160:
      assert(context.size == sizeof(RIPEMD160_CTX));
      RIPEMD160_Update(reinterpret_cast<RIPEMD160_CTX *>(context.buffer),
                       buffer, buffer_length);
      break;
    case kShake128:
      assert(context.size == sizeof(Keccak_HashInstance));
      keccak_result = Keccak_HashUpdate(reinterpret_cast<Keccak_HashInstance *>(
                        context.buffer), buffer, buffer_length * 8);
      assert(keccak_result == SUCCESS);
      break;
    default:
      PANIC(NULL);  // Undefined hash
  }
}

void Final(ContextPtr context, Any *any_digest) {
  HashReturn keccak_result;
  switch (context.algorithm) {
    case kMd5:
      assert(context.size == sizeof(MD5_CTX));
      MD5_Final(any_digest->digest,
                reinterpret_cast<MD5_CTX *>(context.buffer));
      break;
    case kSha1:
      assert(context.size == sizeof(SHA_CTX));
      SHA1_Final(any_digest->digest,
                 reinterpret_cast<SHA_CTX *>(context.buffer));
      break;
    case kRmd160:
      assert(context.size == sizeof(RIPEMD160_CTX));
      RIPEMD160_Final(any_digest->digest,
                      reinterpret_cast<RIPEMD160_CTX *>(context.buffer));
      break;
    case kShake128:
      assert(context.size == sizeof(Keccak_HashInstance));
      keccak_result = Keccak_HashFinal(reinterpret_cast<Keccak_HashInstance *>(
                        context.buffer), NULL);
      assert(keccak_result == SUCCESS);
      keccak_result =
        Keccak_HashSqueeze(reinterpret_cast<Keccak_HashInstance *>(
          context.buffer), any_digest->digest, kDigestSizes[kShake128] * 8);
      break;
    default:
      PANIC(NULL);  // Undefined hash
  }
  any_digest->algorithm = context.algorithm;
}

void HashMem(const unsigned char *buffer, const unsigned buffer_size,
             Any *any_digest)
{
  Algorithms algorithm = any_digest->algorithm;
  ContextPtr context(algorithm);
  context.buffer = alloca(context.size);

  Init(context);
  Update(buffer, buffer_size, context);
  Final(context, any_digest);
}

void HashString(const std::string &content, Any *any_digest) {
  HashMem(reinterpret_cast<const unsigned char *>(content.data()),
          content.length(), any_digest);
}

void Hmac(
  const string &key,
  const unsigned char *buffer,
  const unsigned buffer_size,
  Any *any_digest
) {
  Algorithms algorithm = any_digest->algorithm;
  assert(algorithm != kAny);

  const unsigned block_size = kBlockSizes[algorithm];
  unsigned char key_block[block_size];
  memset(key_block, 0, block_size);
  if (key.length() > block_size) {
    Any hash_key(algorithm);
    HashMem(reinterpret_cast<const unsigned char *>(key.data()),
            key.length(), &hash_key);
    memcpy(key_block, hash_key.digest, kDigestSizes[algorithm]);
  } else {
    if (key.length() > 0)
      memcpy(key_block, key.data(), key.length());
  }

  unsigned char pad_block[block_size];
  // Inner hash
  Any hash_inner(algorithm);
  ContextPtr context_inner(algorithm);
  context_inner.buffer = alloca(context_inner.size);
  Init(context_inner);
  for (unsigned i = 0; i < block_size; ++i)
    pad_block[i] = key_block[i] ^ 0x36;
  Update(pad_block, block_size, context_inner);
  Update(buffer, buffer_size, context_inner);
  Final(context_inner, &hash_inner);

  // Outer hash
  ContextPtr context_outer(algorithm);
  context_outer.buffer = alloca(context_outer.size);
  Init(context_outer);
  for (unsigned i = 0; i < block_size; ++i)
    pad_block[i] = key_block[i] ^ 0x5c;
  Update(pad_block, block_size, context_outer);
  Update(hash_inner.digest, kDigestSizes[algorithm], context_outer);

  Final(context_outer, any_digest);
}

bool HashFd(int fd, Any *any_digest) {
  Algorithms algorithm = any_digest->algorithm;
  ContextPtr context(algorithm);
  context.buffer = alloca(context.size);

  Init(context);
  unsigned char io_buffer[4096];
  int actual_bytes;
  while ((actual_bytes = read(fd, io_buffer, 4096)) != 0) {
    if (actual_bytes == -1) {
      if (errno == EINTR)
        continue;
      return false;
    }
    Update(io_buffer, actual_bytes, context);
  }
  Final(context, any_digest);
  return true;
}

bool HashFile(const std::string &filename, Any *any_digest) {
  int fd = open(filename.c_str(), O_RDONLY);
  if (fd == -1)
    return false;

  bool result = HashFd(fd, any_digest);
  close(fd);
  return result;
}

/**
 * Fast constructor for hashing path names.
 */
Md5::Md5(const AsciiPtr ascii) {
  algorithm = kMd5;
  const string *str = ascii.str;

  MD5_CTX md5_state;
  MD5_Init(&md5_state);
  MD5_Update(&md5_state, reinterpret_cast<const unsigned char *>(&(*str)[0]),
             str->length());
  MD5_Final(digest, &md5_state);
}

Md5::Md5(const char *chars, const unsigned length) {
  algorithm = kMd5;

  MD5_CTX md5_state;
  MD5_Init(&md5_state);
  MD5_Update(&md5_state, reinterpret_cast<const unsigned char *>(chars),
             length);
  MD5_Final(digest, &md5_state);
}

Md5::Md5(const uint64_t lo, const uint64_t hi) {
  algorithm = kMd5;
  memcpy(digest, &lo, 8);
  memcpy(digest+8, &hi, 8);
}

void Md5::ToIntPair(uint64_t *lo, uint64_t *hi) const {
  memcpy(lo, digest, 8);
  memcpy(hi, digest+8, 8);
}

Md5 Any::CastToMd5() {
  assert(algorithm == kMd5);
  Md5 result;
  memcpy(result.digest, digest, kDigestSizes[kMd5]);
  return result;
}

#ifndef OPENSSL_API_INTERFACE_V09
static string HexFromSha256(unsigned char digest[SHA256_DIGEST_LENGTH]) {
  string result;
  result.reserve(2 * SHA256_DIGEST_LENGTH);
  for (unsigned i = 0; i < SHA256_DIGEST_LENGTH; ++i) {
    const char d1 = digest[i] / 16;
    const char d2 = digest[i] % 16;
    result.push_back(d1 + ((d1 <= 9) ? '0' : 'a' - 10));
    result.push_back(d2 + ((d2 <= 9) ? '0' : 'a' - 10));
  }
  return result;
}
#endif

string Sha256File(const string &filename) {
#ifdef OPENSSL_API_INTERFACE_V09
  PANIC(NULL);
#else
  int fd = open(filename.c_str(), O_RDONLY);
  if (fd < 0)
    return "";

  SHA256_CTX ctx;
  SHA256_Init(&ctx);

  unsigned char io_buffer[4096];
  int actual_bytes;
  while ((actual_bytes = read(fd, io_buffer, 4096)) != 0) {
    if (actual_bytes == -1) {
      if (errno == EINTR)
        continue;
      close(fd);
      return "";
    }
    SHA256_Update(&ctx, io_buffer, actual_bytes);
  }
  close(fd);

  unsigned char digest[SHA256_DIGEST_LENGTH];
  SHA256_Final(digest, &ctx);
  return HexFromSha256(digest);
#endif
}

string Sha256Mem(const unsigned char *buffer, const unsigned buffer_size) {
#ifdef OPENSSL_API_INTERFACE_V09
  PANIC(NULL);
#else
  unsigned char digest[SHA256_DIGEST_LENGTH];
  SHA256(buffer, buffer_size, digest);
  return HexFromSha256(digest);
#endif
}

string Sha256String(const string &content) {
  return Sha256Mem(reinterpret_cast<const unsigned char *>(content.data()),
                   content.length());
}

std::string Hmac256(
  const std::string &key,
  const std::string &content,
  bool raw_output)
{
#ifdef OPENSSL_API_INTERFACE_V09
  PANIC(NULL);
#else
  unsigned char digest[SHA256_DIGEST_LENGTH];
  const unsigned block_size = 64;
  const unsigned key_length = key.length();
  unsigned char key_block[block_size];
  memset(key_block, 0, block_size);
  if (key_length > block_size) {
    SHA256(reinterpret_cast<const unsigned char *>(key.data()), key_length,
           key_block);
  } else {
    if (key.length() > 0)
      memcpy(key_block, key.data(), key_length);
  }

  unsigned char pad_block[block_size];
  // Inner hash
  SHA256_CTX ctx_inner;
  unsigned char digest_inner[SHA256_DIGEST_LENGTH];
  SHA256_Init(&ctx_inner);
  for (unsigned i = 0; i < block_size; ++i)
    pad_block[i] = key_block[i] ^ 0x36;
  SHA256_Update(&ctx_inner, pad_block, block_size);
  SHA256_Update(&ctx_inner, content.data(), content.length());
  SHA256_Final(digest_inner, &ctx_inner);

  // Outer hash
  SHA256_CTX ctx_outer;
  SHA256_Init(&ctx_outer);
  for (unsigned i = 0; i < block_size; ++i)
    pad_block[i] = key_block[i] ^ 0x5c;
  SHA256_Update(&ctx_outer, pad_block, block_size);
  SHA256_Update(&ctx_outer, digest_inner, SHA256_DIGEST_LENGTH);

  SHA256_Final(digest, &ctx_outer);
  if (raw_output)
    return string(reinterpret_cast<const char *>(digest), SHA256_DIGEST_LENGTH);
  return HexFromSha256(digest);
#endif
}

}  // namespace shash

#ifdef CVMFS_NAMESPACE_GUARD
}  // namespace CVMFS_NAMESPACE_GUARD
#endif


text:
Tenders Viewer - Python Edition
===========

Powered by Django Framework

Usage:
* python manage.py runserver
* python manage.py makemigrations
* python manage.py migrate
* python manage.py test webapp


text:
package au.com.mineauz.minigames.minigame.reward;

import au.com.mineauz.minigames.objects.MinigamePlayer;
import au.com.mineauz.minigames.config.Flag;
import au.com.mineauz.minigames.menu.*;
import au.com.mineauz.minigames.minigame.Minigame;
import au.com.mineauz.minigames.minigame.modules.MinigameModule;
import au.com.mineauz.minigames.minigame.reward.scheme.RewardScheme;
import au.com.mineauz.minigames.minigame.reward.scheme.RewardSchemes;
import au.com.mineauz.minigames.minigame.reward.scheme.StandardRewardScheme;
import au.com.mineauz.minigames.stats.StoredGameStats;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;

import java.util.Map;

public class RewardsModule extends MinigameModule {
    public static final String Name = "rewards";
    private RewardScheme scheme;

    public RewardsModule(Minigame minigame) {
        super(minigame);

        // Default scheme
        scheme = new StandardRewardScheme();
    }

    public static RewardsModule getModule(Minigame minigame) {
        return (RewardsModule) minigame.getModule(Name);
    }

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

    public RewardScheme getScheme() {
        return scheme;
    }

    @SuppressWarnings("unused")
    public void setRewardScheme(RewardScheme scheme) {
        this.scheme = scheme;
    }

    public void awardPlayer(MinigamePlayer player, StoredGameStats data, Minigame minigame, boolean firstCompletion) {
        scheme.awardPlayer(player, data, minigame, firstCompletion);
    }

    public void awardPlayerOnLoss(MinigamePlayer player, StoredGameStats data, Minigame minigame) {
      scheme.awardPlayerOnLoss(player,data,minigame);
    }

    @Override
    public Map<String, Flag<?>> getFlags() {
        return scheme.getFlags();
    }

    @Override
    public boolean useSeparateConfig() {
        return false;
    }

    @Override
    public void save(FileConfiguration config) {
        String name = RewardSchemes.getName(scheme.getClass());

        ConfigurationSection root = config.getConfigurationSection(getMinigame().getName(false));
        if(root != null) {
          root.set("reward-scheme", name);
          ConfigurationSection rewards = root.createSection("rewards");
          scheme.save(rewards);
        }
    }

    @Override
    public void load(FileConfiguration config) {
        ConfigurationSection root = config.getConfigurationSection(getMinigame().getName(false));
        if (root != null) {
            String name = root.getString("reward-scheme", "standard");
            if(name != null) {
              scheme = RewardSchemes.createScheme(name);
              if (scheme == null) {
                scheme = new StandardRewardScheme();
              }
            }
            ConfigurationSection rewards = root.getConfigurationSection("rewards");
            scheme.load(rewards);
        }
    }

    @Override
    public void addEditMenuOptions(final Menu menu) {
        MenuItemCustom launcher = new MenuItemCustom("Reward Settings", Material.DIAMOND);
        launcher.setClick(object -> {
            Menu submenu = createSubMenu(menu);
            submenu.displayMenu(menu.getViewer());
            return null;
        });

        menu.addItem(launcher);
    }

    private Menu createSubMenu(final Menu parent) {
        final Menu submenu = new Menu(6, "Reward Settings", parent.getViewer());
        scheme.addMenuItems(submenu);

        submenu.addItem(RewardSchemes.newMenuItem("Reward Scheme", Material.PAPER, new Callback<Class<? extends RewardScheme>>() {
            @Override
            public Class<? extends RewardScheme> getValue() {
                return scheme.getClass();
            }

            @Override
            public void setValue(Class<? extends RewardScheme> value) {
                scheme = RewardSchemes.createScheme(value);
                // Update the menu
                Menu menu = createSubMenu(parent);
                menu.displayMenu(submenu.getViewer());
            }
        }), submenu.getSize() - 1);

        submenu.addItem(new MenuItemBack(parent), submenu.getSize() - 9);
        return submenu;
    }

    @Override
    public boolean displayMechanicSettings(Menu previous) {
        // Not used
        return false;
    }
}