text:
create table forum_articles(
  id serial primary key,
  user_id int not null,
  title varchar(255) not null,
  body text not null,
  type varchar(8) not null default 'markdown',
  vote int not null default 0,
  created_at timestamp without time zone not null default now(),
  updated_at timestamp without time zone not null
);
create index idx_forum_articles on forum_articles(title);
create index idx_forum_type on forum_articles(type);

create table forum_tags(
  id serial primary key,
  name varchar(255) not null,
  vote int not null default 0,
  created_at timestamp without time zone not null default now(),
  updated_at timestamp without time zone not null
);
create unique index idx_forum_tags on forum_tags(name);

create table forum_articles_tags(
  id serial primary key,
  article_id int not null,
  tag_id int not null
);
create unique index idx_forum_article_tag on forum_articles_tags(article_id, tag_id);

create table forum_comments(
  id serial primary key,
  user_id int not null,
  body text not null,
  type varchar(8) not null default 'markdown',
  vote int not null default 0,
  created_at timestamp without time zone not null default now(),
  updated_at timestamp without time zone not null
);
create index idx_forum_comments on forum_comments(type);

redpajama_set_name: RedPajamaGithub


text:
@interface XHMessageVoiceFactory : NSObject

+ (UIImageView *)messageVoiceAnimationImageViewWithBubbleMessageType:(XHBubbleMessageType)type;

@end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>ANOVA — statsmodels 0.9.0 documentation</title>
    <link rel="stylesheet" href="_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="_static/statsmodels_hybi_favico.ico"/>
    <link rel="author" title="About these documents" href="about.html" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="statsmodels.stats.anova.anova_lm" href="generated/statsmodels.stats.anova.anova_lm.html" />
    <link rel="prev" title="statsmodels.genmod.bayes_mixed_glm.BayesMixedGLMResults.summary" href="generated/statsmodels.genmod.bayes_mixed_glm.BayesMixedGLMResults.summary.html" />
<link rel="stylesheet" href="_static/examples.css" type="text/css" />
<link rel="stylesheet" href="_static/facebox.css" type="text/css" />

Navigation

          index

          modules |

          next |

          previous |

Install
  |

Support
  |

Bugs
  |

Develop
  |

Examples
  |

FAQ
  |

ANOVA¶

Analysis of Variance models containing anova_lm for ANOVA analysis with a
linear OLSModel, and AnovaRM for repeated measures ANOVA, within ANOVA for
balanced data.

Examples¶

In [1]: import statsmodels.api as sm

In [2]: from statsmodels.formula.api import ols

In [3]: moore = sm.datasets.get_rdataset("Moore", "car",
   ...:                                  cache=True) # load data
   ...:

In [4]: data = moore.data

In [5]: data = data.rename(columns={"partner.status":
   ...:                             "partner_status"}) # make name pythonic
   ...:

In [6]: moore_lm = ols('conformity ~ C(fcategory, Sum)*C(partner_status, Sum)',
   ...:                 data=data).fit()
   ...:

In [7]: table = sm.stats.anova_lm(moore_lm, typ=2) # Type 2 ANOVA DataFrame

In [8]: print(table)
                                              sum_sq    df          F  \
C(fcategory, Sum)                          11.614700   2.0   0.276958
C(partner_status, Sum)                    212.213778   1.0  10.120692
C(fcategory, Sum):C(partner_status, Sum)  175.488928   2.0   4.184623
Residual                                  817.763961  39.0        NaN

                                            PR(>F)
C(fcategory, Sum)                         0.759564
C(partner_status, Sum)                    0.002874
C(fcategory, Sum):C(partner_status, Sum)  0.022572
Residual                                       NaN

A more detailed example for anova_lm can be found here:

ANOVA

Module Reference¶

<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>

anova_lm(*args, **kwargs)
Anova table for one or more fitted linear models.

AnovaRM(data, depvar, subject[, within, …])
Repeated measures Anova using least squares regression

Table Of Contents

ANOVA

Examples

Module Reference

Previous topic

statsmodels.genmod.bayes_mixed_glm.BayesMixedGLMResults.summary

Next topic

statsmodels.stats.anova.anova_lm

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

        © Copyright 2009-2017, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
      Created using Sphinx 1.7.4.


text:
package com.netflix.spinnaker.fiat.controllers;

import com.netflix.spinnaker.fiat.config.UnrestrictedResourceConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

@Slf4j
public class ControllerSupport {

  static final String ANONYMOUS_USER = "anonymous";

  static String convert(String in) {
    try {
      String decoded = URLDecoder.decode(in, "UTF-8");
      if (ANONYMOUS_USER.equalsIgnoreCase(decoded)) {
        return UnrestrictedResourceConfig.UNRESTRICTED_USERNAME;
      }
      return decoded;
    } catch (UnsupportedEncodingException uee) {
      log.error("Decoding exception for string " + in, uee);
    }
    return null;
  }
}


text:
> Provides a means of doing a single-line embed of a keyword driven JWPlayer

## Usage

### Using query selector to grab keyword
```
<script src="js/searchembed.js"
    data-player="PLAYER_ID"
    data-selector="#page-title"
    data-feed="FEED_ID"></script>
```

### Explicitly set keywork in the embed code
```
<script src="js/searchembed.js"
    data-player="PLAYER_ID"
    data-query="keyword"
    data-feed="FEED_ID"></script>
```


text:
package com.licon.hello.util;

import android.content.Context;

import java.io.FileOutputStream;

/**
 * Created by FRAMGIA\khairul.alam.licon on 2/6/16.
 */

public class AppUtil {
    public static void writeConfiguration(Context ctx ) {
        try (FileOutputStream openFileOutput = ctx
                .openFileOutput( "config.txt", Context.MODE_PRIVATE)) {
            openFileOutput.write("This is a test1.".getBytes());
            openFileOutput.write("This is a test2.".getBytes());
            openFileOutput.write("This is a test3.".getBytes());
        } catch (Exception e) {
            // not handled
        }
    }
}


text:
"use strict";

var utils     = require("./lib/utils");
var debug     = require("debug")("resp-mod");

function RespModifier (opts) {

    // options
    opts               = opts || {};
    opts.blacklist     = utils.toArray(opts.blacklist)     || [];
    opts.#FF6AFClist     = utils.toArray(opts.#FF6AFClist)     || [];
    opts.hostBlacklist = utils.toArray(opts.hostBlacklist) || [];
    opts.rules         = opts.rules                        || [];
    opts.ignore        = opts.ignore || opts.excludeList   || utils.defaultIgnoreTypes;

    // helper functions
    opts.regex = (function () {
        var matches = opts.rules.map(function (item) {
            return item.match.source;
        }).join("|");
        return new RegExp(matches);
    })();

    var respMod        = this;

    respMod.opts       = opts;
    respMod.middleware = respModifierMiddleware;
    respMod.update = function (key, value) {
        if (respMod.opts[key]) {
            respMod.opts[key] = value;
        }
        return respMod;
    };

    function respModifierMiddleware(req, res, next) {

        if (res._respModifier) {
            debug("Reject req", req.url);
            return next();
        }
        debug("Accept req", req.url);

        res._respModifier = true;

        var writeHead   = res.writeHead;
        var runPatches  = true;
        var write       = res.write;
        var end         = res.end;
        var singlerules = utils.is#FF6AFCListedForSingle(req.url, respMod.opts.rules);

        var withoutSingle = respMod.opts.rules.filter(function (rule) {
            if (rule.paths && rule.paths.length) {
                return false;
            }
            return true;
        });

        /**
         * Exit early for blacklisted domains
         */
        if (respMod.opts.hostBlacklist.indexOf(req.headers.host) > -1) {
            return next();
        }

        if (singlerules.length) {
            modifyResponse(singlerules, true);
        } else {
            if (utils.is#FF6AFClisted(req.url, respMod.opts.#FF6AFClist)) {
                modifyResponse(withoutSingle, true);
            } else {
                if (!utils.hasAcceptHeaders(req) || utils.inBlackList(req.url, respMod.opts)) {
                    debug("Black listed or no text/html headers", req.url);
                    return next();
                } else {
                    modifyResponse(withoutSingle);
                }
            }
        }

        next();

        /**
         * Actually do the overwrite
         * @param {Array} rules
         * @param {Boolean} [force] - if true, will always attempt to perform
         * an overwrite - regardless of whether it appears to be HTML or not
         */
        function modifyResponse(rules, force) {

            req.headers["accept-encoding"] = "identity";

            function restore() {
                res.writeHead = writeHead;
                res.write = write;
                res.end = end;
            }

            res.push = function (chunk) {
                res.data = (res.data || "") + chunk;
            };

            res.write = function (string, encoding) {

                if (!runPatches) {
                    return write.call(res, string, encoding);
                }

                if (string !== undefined) {
                    var body = string instanceof Buffer ? string.toString(encoding) : string;
                    // If this chunk appears to be valid, push onto the res.data stack
                    if (force || (utils.isHtml(body) || utils.isHtml(res.data))) {
                        res.push(body);
                    } else {
                        restore();
                        return write.call(res, string, encoding);
                    }
                }
                return true;
            };

            res.writeHead = function () {
                if (!runPatches) {
                    return writeHead.apply(res, arguments);
                }

                var headers = arguments[arguments.length - 1];

                if (typeof headers === "object") {
                    for (var name in headers) {
                        if (/content-length/i.test(name)) {
                            delete headers[name];
                        }
                    }
                }

                if (res.getHeader("content-length")) {
                    res.removeHeader("content-length");
                }

                writeHead.apply(res, arguments);
            };

            res.end = function (string, encoding) {

                res.data = res.data || "";

                if (typeof string === "string") {
                    res.data += string;
                }

                if (string instanceof Buffer) {
                    res.data += string.toString();
                }

                if (!runPatches) {
                    return end.call(res, string, encoding);
                }

                // Check if our body is HTML, and if it does not already have the snippet.
                if (force || utils.isHtml(res.data) && !utils.snip(res.data)) {
                    // Include, if necessary, replacing the entire res.data with the included snippet.
                    res.data = utils.applyRules(rules, res.data, req, res);
                    runPatches = false;
                }
                if (res.data !== undefined && !res._header) {
                    res.setHeader("content-length", Buffer.byteLength(res.data, encoding));
                }
                end.call(res, res.data, encoding);
            };
        }
    }

    return respMod;
}

module.exports = function (opts) {
    var resp = new RespModifier(opts);
    return resp.middleware;
};

module.exports.create = function (opts) {
    var resp = new RespModifier(opts);
    return resp;
};

module.exports.utils = utils;


text:
class Admin::StatesController < Admin::BaseController
  def index
    @states = State.all
  end

  def new
    @state = State.new
  end

  def create
    @state = State.new state_params
    if @state.save
      flash[:notcie] = 'State has been created.'
      redirect_to admin_states_path
    else
      flash[:alert] = 'State has not been created.'
      render action: "new"
    end
  end

  def make_default
    @state = State.find(params[:id])
    @state.default!
    flash[:notice] = "#{@state.name} is now the default state."
    redirect_to admin_states_path
  end

  private
    def state_params
      params.require(:state).permit(:name, :background, :color)
    end
end


text:
/* polyline.h */
/* https://developers.google.com/maps/documentation/utilities/polylinealgorithm */

#include "geometry.h"
#include "router_result.h"

/* For The Netherlands our longest journey pattern is 124 stops
 * it would be sufficient to allocate only 124 * 13 bytes.
 */

#define PL_BUFLEN 1996

typedef struct polyline polyline_t;
struct polyline {
    double last_lat;
    double last_lon;
    char  *buf_cur;
    char  *buf_max;
    uint32_t n_points;
    char   buf[PL_BUFLEN];
};

int encode_double (double c, char *buf);

int encode_latlon (latlon_t ll, char *buf);

void polyline_begin (polyline_t *pl);

void polyline_point (polyline_t *pl, double lat, double lon);

void polyline_latlon (polyline_t *pl, latlon_t ll);

char *polyline_result (polyline_t *pl);

/* number of points in the polyline */
uint32_t polyline_length (polyline_t *pl);


text:
using namespace joedb;

/////////////////////////////////////////////////////////////////////////////
TEST(Multiplexer_Test, interpreter_test)
/////////////////////////////////////////////////////////////////////////////
{
 //
 // Directly read database
 //
 Database reference_db;
 {
  Interpreter interpreter(reference_db, reference_db);
  std::ifstream in_file("interpreter_test.joedbi");
  ASSERT_TRUE(in_file.good());
  std::ostringstream out;
  interpreter.main_loop(in_file, out);
 }

 //
 // Read through a multiplexer
 //
 Database multiplexed_db;
 {
  Multiplexer multiplexer{multiplexed_db};
  Interpreter interpreter(multiplexed_db, multiplexer);
  std::ifstream in_file("interpreter_test.joedbi");
  ASSERT_TRUE(in_file.good());
  std::ostringstream out;
  interpreter.main_loop(in_file, out);
 }

 //
 // Check that they are identical
 //
 {
  std::ostringstream reference;
  std::ostringstream multiplexed;

  {
   Interpreter_Dump_Writable dump_writable(reference);
   dump(reference_db, dump_writable);
  }

  {
   Interpreter_Dump_Writable dump_writable(multiplexed);
   dump(multiplexed_db, dump_writable);
  }

  EXPECT_EQ(reference.str(), multiplexed.str());
 }
}


text:
Write a program that will convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles

Implement binary to decimal conversion.  Given a binary input
string, your program should produce a decimal output.

## Note
- Implement the conversion yourself.
  Do not use something else to perform the conversion for you.
- Treat invalid input as binary 0.

## About Binary (Base-2)
Decimal is a base-10 system.

A number 23 in base 10 notation can be understood
as a linear combination of powers of 10:

- The rightmost digit gets multiplied by 10^0 = 1
- The next number gets multiplied by 10^1 = 10
- ...
- The *n*th number gets multiplied by 10^*(n-1)*.
- All these values are summed.

So: `23 => 2*10^1 + 3*10^0 => 2*10 + 3*1 = 23 base 10`

Binary is similar, but uses powers of 2 rather than powers of 10.

So: `101 => 1*2^2 + 0*2^1 + 1*2^0 => 1*4 + 0*2 + 1*1 => 4 + 1 => 5 base 10`.

## Setup

Go through the project setup instructions for Xcode using Swift:

http://help.exercism.io/getting-started-with-swift.html

## Source

All of Computer Science [view source](http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-)


text:
"""This module offers a class to enable your code to speak BGP protocol.

"""

import netaddr
from ryu.lib import hub
from ryu.services.protocols.bgp.operator import ssh

from ryu.services.protocols.bgp.core_manager import CORE_MANAGER
from ryu.services.protocols.bgp.signals.emit import BgpSignalBus
from ryu.services.protocols.bgp.api.base import call
from ryu.services.protocols.bgp.api.base import PREFIX
from ryu.services.protocols.bgp.api.base import NEXT_HOP
from ryu.services.protocols.bgp.api.base import ROUTE_DISTINGUISHER
from ryu.services.protocols.bgp.api.base import ROUTE_FAMILY
from ryu.services.protocols.bgp.rtconf.common import LOCAL_AS
from ryu.services.protocols.bgp.rtconf.common import ROUTER_ID
from ryu.services.protocols.bgp.rtconf.common import BGP_SERVER_PORT
from ryu.services.protocols.bgp.rtconf.common import DEFAULT_BGP_SERVER_PORT
from ryu.services.protocols.bgp.rtconf.common \
    import DEFAULT_REFRESH_MAX_EOR_TIME
from ryu.services.protocols.bgp.rtconf.common \
    import DEFAULT_REFRESH_STALEPATH_TIME
from ryu.services.protocols.bgp.rtconf.common \
    import DEFAULT_BGP_CONN_RETRY_TIME
from ryu.services.protocols.bgp.rtconf.common import DEFAULT_LABEL_RANGE
from ryu.services.protocols.bgp.rtconf.common import REFRESH_MAX_EOR_TIME
from ryu.services.protocols.bgp.rtconf.common import REFRESH_STALEPATH_TIME
from ryu.services.protocols.bgp.rtconf.common import LABEL_RANGE
from ryu.services.protocols.bgp.rtconf import neighbors
from ryu.services.protocols.bgp.rtconf import vrfs
from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_IPV4
from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_IPV6
from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_VPNV4
from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_VPNV6
from ryu.services.protocols.bgp.rtconf.base import MULTI_EXIT_DISC
from ryu.services.protocols.bgp.rtconf.base import SITE_OF_ORIGINS
from ryu.services.protocols.bgp.rtconf.neighbors import DEFAULT_CAP_MBGP_IPV4
from ryu.services.protocols.bgp.rtconf.neighbors import DEFAULT_CAP_MBGP_VPNV4
from ryu.services.protocols.bgp.rtconf.neighbors import DEFAULT_CAP_MBGP_VPNV6
from ryu.services.protocols.bgp.rtconf.neighbors import PEER_NEXT_HOP
from ryu.services.protocols.bgp.rtconf.neighbors import PASSWORD
from ryu.services.protocols.bgp.rtconf.neighbors import IN_FILTER
from ryu.services.protocols.bgp.rtconf.neighbors import OUT_FILTER
from ryu.services.protocols.bgp.rtconf.neighbors import IS_ROUTE_SERVER_CLIENT
from ryu.services.protocols.bgp.rtconf.neighbors import IS_NEXT_HOP_SELF
from ryu.services.protocols.bgp.rtconf.neighbors import LOCAL_ADDRESS
from ryu.services.protocols.bgp.rtconf.neighbors import LOCAL_PORT
from ryu.services.protocols.bgp.info_base.base import Filter

NEIGHBOR_CONF_MED = 'multi_exit_disc'
RF_VPN_V4 = vrfs.VRF_RF_IPV4
RF_VPN_V6 = vrfs.VRF_RF_IPV6

class EventPrefix(object):
    """
    Used to pass an update on any best remote path to
    best_path_change_handler.

    ================ ======================================================
    Attribute        Description
    ================ ======================================================
    remote_as        The AS number of a peer that caused this change
    route_dist       None in the case of ipv4 or ipv6 family
    prefix           A prefix was changed
    nexthop          The nexthop of the changed prefix
    is_withdraw      True if this prefix has gone otherwise False
    ================ ======================================================

    """

    def __init__(self, remote_as, route_dist, prefix, nexthop, is_withdraw):
        self.remote_as = remote_as
        self.route_dist = route_dist
        self.prefix = prefix
        self.nexthop = nexthop
        self.is_withdraw = is_withdraw

class BGPSpeaker(object):
    def __init__(self, as_number, router_id,
                 bgp_server_port=DEFAULT_BGP_SERVER_PORT,
                 refresh_stalepath_time=DEFAULT_REFRESH_STALEPATH_TIME,
                 refresh_max_eor_time=DEFAULT_REFRESH_MAX_EOR_TIME,
                 best_path_change_handler=None,
                 ssh_console=False,
                 label_range=DEFAULT_LABEL_RANGE):
        """Create a new BGPSpeaker object with as_number and router_id to
        listen on bgp_server_port.

        ``as_number`` specifies an Autonomous Number. It must be an integer
        between 1 and 65535.

        ``router_id`` specifies BGP router identifier. It must be the
        string representation of an IPv4 address (e.g. 10.0.0.1).

        ``bgp_server_port`` specifies TCP listen port number. 179 is
        used if not specified.

        ``refresh_stalepath_time`` causes the BGP speaker to remove
        stale routes from the BGP table after the timer expires, even
        if the speaker does not receive a Router-Refresh End-of-RIB
        message. This feature is disabled (not implemented yet).

        ``refresh_max_eor_time`` causes the BGP speaker to generate a
        Route-Refresh End-of-RIB message if it was not able to
        generate one due to route flapping. This feature is disabled
        (not implemented yet).

        ``best_path_change_handler``, if specified, is called when any
        best remote path is changed due to an update message or remote
        peer down. The handler is supposed to take one argument, the
        instance of an EventPrefix class instance.

        """
        super(BGPSpeaker, self).__init__()

        settings = {}
        settings[LOCAL_AS] = as_number
        settings[ROUTER_ID] = router_id
        settings[BGP_SERVER_PORT] = bgp_server_port
        settings[REFRESH_STALEPATH_TIME] = refresh_stalepath_time
        settings[REFRESH_MAX_EOR_TIME] = refresh_max_eor_time
        settings[LABEL_RANGE] = label_range
        self._core_start(settings)
        self._init_signal_listeners()
        self._best_path_change_handler = best_path_change_handler
        if ssh_console:
            hub.spawn(ssh.SSH_CLI_CONTROLLER.start)

    def _notify_best_path_changed(self, path, is_withdraw):
        if not path.source:
            # ours
            return
        ev = EventPrefix(remote_as=path.source.remote_as,
                         route_dist=None,
                         prefix=path.nlri.addr + '/' + str(path.nlri.length),
                         nexthop=path.nexthop, is_withdraw=is_withdraw)
        if self._best_path_change_handler:
            self._best_path_change_handler(ev)

    def _init_signal_listeners(self):
        CORE_MANAGER.get_core_service()._signal_bus.register_listener(
            BgpSignalBus.BGP_BEST_PATH_CHANGED,
            lambda _, info:
                self._notify_best_path_changed(info['path'],
                                               info['is_withdraw'])
        )

    def _core_start(self, settings):
        waiter = hub.Event()
        call('core.start', waiter=waiter, **settings)
        waiter.wait()

    def _serve_forever(self):
        pass

    def shutdown(self):
        """ Shutdown BGP speaker

        """
        call('core.stop')

    def neighbor_add(self, address, remote_as,
                     enable_ipv4=DEFAULT_CAP_MBGP_IPV4,
                     enable_vpnv4=DEFAULT_CAP_MBGP_VPNV4,
                     enable_vpnv6=DEFAULT_CAP_MBGP_VPNV6,
                     next_hop=None, password=None, multi_exit_disc=None,
                     site_of_origins=None, is_route_server_client=False,
                     is_next_hop_self=False, local_address=None,
                     local_port=None):
        """ This method registers a new neighbor. The BGP speaker tries to
        establish a bgp session with the peer (accepts a connection
        from the peer and also tries to connect to it).

        ``address`` specifies the IP address of the peer. It must be
        the string representation of an IP address. Only IP v4 is
        supported now.

        ``remote_as`` specifies the AS number of the peer. It must be
        an integer between 1 and 65535.

        ``enable_ipv4`` enables IPv4 address family for this
        neighbor. The default is True.

        ``enable_vpnv4`` enables VPNv4 address family for this
        neighbor. The default is False.

        ``enable_vpnv6`` enables VPNv6 address family for this
        neighbor. The default is False.

        ``next_hop`` specifies the next hop IP address. If not
        specified, host's ip address to access to a peer is used.

        ``password`` is used for the MD5 authentication if it's
        specified. By default, the MD5 authenticaiton is disabled.

        ``multi_exit_disc`` specifies multi exit discriminator (MED) value.
        The default is None and if not specified, MED value is
        not sent to the neighbor. It must be an integer.

        ``site_of_origins`` specifies site_of_origin values.
        This parameter must be a list of string.

        ``is_route_server_client`` specifies whether this neighbor is a
        router server's client or not.

        ``is_next_hop_self`` specifies whether the BGP speaker announces
        its own ip address to iBGP neighbor or not as path's next_hop address.

        ``local_address`` specifies Loopback interface address for
        iBGP peering.

        ``local_port`` specifies source TCP port for iBGP peering.

        """
        bgp_neighbor = {}
        bgp_neighbor[neighbors.IP_ADDRESS] = address
        bgp_neighbor[neighbors.REMOTE_AS] = remote_as
        bgp_neighbor[PEER_NEXT_HOP] = next_hop
        bgp_neighbor[PASSWORD] = password
        bgp_neighbor[IS_ROUTE_SERVER_CLIENT] = is_route_server_client
        bgp_neighbor[IS_NEXT_HOP_SELF] = is_next_hop_self
        # v6 advertizement is available with only v6 peering
        if netaddr.valid_ipv4(address):
            bgp_neighbor[CAP_MBGP_IPV4] = enable_ipv4
            bgp_neighbor[CAP_MBGP_IPV6] = False
            bgp_neighbor[CAP_MBGP_VPNV4] = enable_vpnv4
            bgp_neighbor[CAP_MBGP_VPNV6] = enable_vpnv6
        elif netaddr.valid_ipv6(address):
            bgp_neighbor[CAP_MBGP_IPV4] = False
            bgp_neighbor[CAP_MBGP_IPV6] = True
            bgp_neighbor[CAP_MBGP_VPNV4] = False
            bgp_neighbor[CAP_MBGP_VPNV6] = False
        else:
            # FIXME: should raise an exception
            pass

        if multi_exit_disc:
            bgp_neighbor[MULTI_EXIT_DISC] = multi_exit_disc

        if site_of_origins:
            bgp_neighbor[SITE_OF_ORIGINS] = site_of_origins

        if local_address:
            bgp_neighbor[LOCAL_ADDRESS] = local_address

        if local_port:
            bgp_neighbor[LOCAL_PORT] = local_port

        call('neighbor.create', **bgp_neighbor)

    def neighbor_del(self, address):
        """ This method unregister the registered neighbor. If a session with
        the peer exists, the session will be closed.

        ``address`` specifies the IP address of the peer. It must be
        the string representation of an IP address.

        """
        bgp_neighbor = {}
        bgp_neighbor[neighbors.IP_ADDRESS] = address
        call('neighbor.delete', **bgp_neighbor)

    def neighbor_reset(self, address):
        """ This method reset the registered neighbor.

        ``address`` specifies the IP address of the peer. It must be
        the string representation of an IP address.

        """
        bgp_neighbor = {}
        bgp_neighbor[neighbors.IP_ADDRESS] = address
        call('core.reset_neighbor', **bgp_neighbor)

    def neighbor_update(self, address, conf_type, conf_value):
        """ This method changes the neighbor configuration.

        ``conf_type`` specifies configuration type which you want to change.
        Currently ryu.services.protocols.bgp.bgpspeaker.NEIGHBOR_CONF_MED
        can be specified.

        ``conf_value`` specifies value for the configuration type.

        """

        assert conf_type == NEIGHBOR_CONF_MED

        func_name = 'neighbor.update'
        attribute_param = {}
        if conf_type == NEIGHBOR_CONF_MED:
            attribute_param = {neighbors.MULTI_EXIT_DISC: conf_value}

        param = {neighbors.IP_ADDRESS: address,
                 neighbors.CHANGES: attribute_param}
        call(func_name, **param)

    def prefix_add(self, prefix, next_hop=None, route_dist=None):
        """ This method adds a new prefix to be advertized.

        ``prefix`` must be the string representation of an IP network
        (e.g., 10.1.1.0/24).

        ``next_hop`` specifies the next hop address for this
        prefix. This parameter is necessary for only VPNv4 and VPNv6
        address families.

        ``route_dist`` specifies a route distinguisher value. This
        parameter is necessary for only VPNv4 and VPNv6 address
        families.

        """
        func_name = 'network.add'
        networks = {}
        networks[PREFIX] = prefix
        if next_hop:
            networks[NEXT_HOP] = next_hop
        if route_dist:
            func_name = 'prefix.add_local'
            networks[ROUTE_DISTINGUISHER] = route_dist

            rf, p = self._check_rf_and_normalize(prefix)
            networks[ROUTE_FAMILY] = rf
            networks[PREFIX] = p

            if rf == vrfs.VRF_RF_IPV6 and netaddr.valid_ipv4(next_hop):
                # convert the next_hop to IPv4-Mapped IPv6 Address
                networks[NEXT_HOP] = \
                    str(netaddr.IPAddress(next_hop).ipv6())

        call(func_name, **networks)

    def prefix_del(self, prefix, route_dist=None):
        """ This method deletes a advertized prefix.

        ``prefix`` must be the string representation of an IP network
        (e.g., 10.1.1.0/24).

        ``route_dist`` specifies a route distinguisher value. This
        parameter is necessary for only VPNv4 and VPNv6 address
        families.

        """
        func_name = 'network.del'
        networks = {}
        networks[PREFIX] = prefix
        if route_dist:
            func_name = 'prefix.delete_local'
            networks[ROUTE_DISTINGUISHER] = route_dist

            rf, p = self._check_rf_and_normalize(prefix)
            networks[ROUTE_FAMILY] = rf
            networks[PREFIX] = p

        call(func_name, **networks)

    def vrf_add(self, route_dist, import_rts, export_rts, site_of_origins=None,
                route_family=RF_VPN_V4, multi_exit_disc=None):
        """ This method adds a new vrf used for VPN.

        ``route_dist`` specifies a route distinguisher value.

        ``import_rts`` specifies route targets to be imported.

        ``export_rts`` specifies route targets to be exported.

        ``site_of_origins`` specifies site_of_origin values.
        This parameter must be a list of string.

        ``route_family`` specifies route family of the VRF.
        This parameter must be RF_VPN_V4 or RF_VPN_V6.
        """

        assert route_family in (RF_VPN_V4, RF_VPN_V6),\
            'route_family must be RF_VPN_V4 or RF_VPN_V6'

        vrf = {}
        vrf[vrfs.ROUTE_DISTINGUISHER] = route_dist
        vrf[vrfs.IMPORT_RTS] = import_rts
        vrf[vrfs.EXPORT_RTS] = export_rts
        vrf[vrfs.SITE_OF_ORIGINS] = site_of_origins
        vrf[vrfs.VRF_RF] = route_family
        call('vrf.create', **vrf)

    def vrf_del(self, route_dist):
        """ This method deletes the existing vrf.

        ``route_dist`` specifies a route distinguisher value.

        """

        vrf = {}
        vrf[vrfs.ROUTE_DISTINGUISHER] = route_dist
        call('vrf.delete', **vrf)

    def vrfs_get(self, format='json'):
        show = {}
        show['params'] = ['vrf', 'routes', 'all']
        show['format'] = format
        return call('operator.show', **show)

    def rib_get(self, family='ipv4', format='json'):
        """ This method returns the BGP routing information in a json
        format. This will be improved soon.

        ``family`` specifies the address family of the RIB.

        """
        show = {}
        show['params'] = ['rib', family]
        show['format'] = format
        return call('operator.show', **show)

    def _set_filter(self, filter_type, address, filters):
        assert filter_type in ('in', 'out'),\
            'filter type must be \'in\' or \'out\''

        assert all(isinstance(f, Filter) for f in filters),\
            'all the items in filters must be an instance of Filter sub-class'

        if filters is None:
            filters = []

        func_name = 'neighbor.' + filter_type + '_filter.set'
        param = {}
        param[neighbors.IP_ADDRESS] = address
        if filter_type == 'in':
            param[neighbors.IN_FILTER] = filters
        else:
            param[neighbors.OUT_FILTER] = filters
        call(func_name, **param)

    def out_filter_set(self, address, filters):
        """ This method sets out-filter to neighbor.

        ``address`` specifies the IP address of the peer.

        ``filters`` specifies a filter list to filter the path advertisement.
        The contents must be an instance of Filter sub-class

        If you want to define out-filter that send only a particular
        prefix to neighbor, filters can be created as follows;

          p = PrefixFilter('10.5.111.0/24',
                           policy=PrefixFilter.POLICY_PERMIT)

          all = PrefixFilter('0.0.0.0/0',
                             policy=PrefixFilter.POLICY_DENY)

          pList = [p, all]

          self.bgpspeaker.out_filter_set(neighbor_address, pList)

        NOTE:
        out-filter evaluates paths in the order of Filter in the pList.

        """

        self._set_filter('out', address, filters)

    def out_filter_get(self, address):
        """ This method gets out-filter setting from the specified neighbor.

        ``address`` specifies the IP address of the peer.

        Returns a list object containing an instance of Filter sub-class

        """

        func_name = 'neighbor.out_filter.get'
        param = {}
        param[neighbors.IP_ADDRESS] = address
        out_filter = call(func_name, **param)
        return out_filter

    def in_filter_set(self, address, filters):
        """This method sets in-bound filters to a neighbor.

        ``address`` specifies the IP address of the neighbor

        ``filters`` specifies filter list applied before advertised paths are
        imported to the global rib. All the items in the list must be an
        instance of Filter sub-class.

        """

        self._set_filter('in', address, filters)

    def in_filter_get(self, address):
        """This method gets in-bound filters of the specified neighbor.

        ``address`` specifies the IP address of the neighbor.

        Returns a list object containing an instance of Filter sub-class

        """

        func_name = 'neighbor.in_filter.get'
        param = {}
        param[neighbors.IP_ADDRESS] = address
        in_filter = call(func_name, **param)
        return in_filter

    def bmp_server_add(self, address, port):
        """This method registers a new BMP (BGP monitoring Protocol)
        server. The BGP speaker starts to send BMP messages to the
        server. Currently, only one BMP server can be registered.

        ``address`` specifies the IP address of a BMP server.

        ``port`` specifies the listen port number of a BMP server.
        """

        func_name = 'bmp.start'
        param = {}
        param['host'] = address
        param['port'] = port
        call(func_name, **param)

    def bmp_server_del(self, address, port):
        """ This method unregister the registered BMP server.

        ``address`` specifies the IP address of a BMP server.

        ``port`` specifies the listen port number of a BMP server.
        """

        func_name = 'bmp.stop'
        param = {}
        param['host'] = address
        param['port'] = port
        call(func_name, **param)

    def attribute_map_set(self, address, attribute_maps,
                          route_dist=None, route_family=RF_VPN_V4):
        """This method sets attribute mapping to a neighbor.
        attribute mapping can be used when you want to apply
        attribute to BGPUpdate under specific conditions.

        ``address`` specifies the IP address of the neighbor

        ``attribute_maps`` specifies attribute_map list that are used
        before paths are advertised. All the items in the list must
        be an instance of AttributeMap class

        ``route_dist`` specifies route dist in which attribute_maps
        are added.

        ``route_family`` specifies route family of the VRF.
        This parameter must be RF_VPN_V4 or RF_VPN_V6.

        We can set AttributeMap to a neighbor as follows;

          pref_filter = PrefixFilter('192.168.103.0/30',
                                     PrefixFilter.POLICY_PERMIT)

          attribute_map = AttributeMap([pref_filter],
                                       AttributeMap.ATTR_LOCAL_PREF, 250)

          speaker.attribute_map_set('192.168.50.102', [attribute_map])

        """

        assert route_family in (RF_VPN_V4, RF_VPN_V6),\
            'route_family must be RF_VPN_V4 or RF_VPN_V6'

        func_name = 'neighbor.attribute_map.set'
        param = {}
        param[neighbors.IP_ADDRESS] = address
        param[neighbors.ATTRIBUTE_MAP] = attribute_maps
        if route_dist is not None:
            param[vrfs.ROUTE_DISTINGUISHER] = route_dist
            param[vrfs.VRF_RF] = route_family
        call(func_name, **param)

    def attribute_map_get(self, address, route_dist=None,
                          route_family=RF_VPN_V4):
        """This method gets in-bound filters of the specified neighbor.

        ``address`` specifies the IP address of the neighbor.

        ``route_dist`` specifies route distinguisher that has attribute_maps.

        ``route_family`` specifies route family of the VRF.
        This parameter must be RF_VPN_V4 or RF_VPN_V6.

        Returns a list object containing an instance of AttributeMap

        """

        assert route_family in (RF_VPN_V4, RF_VPN_V6),\
            'route_family must be RF_VPN_V4 or RF_VPN_V6'

        func_name = 'neighbor.attribute_map.get'
        param = {}
        param[neighbors.IP_ADDRESS] = address
        if route_dist is not None:
            param[vrfs.ROUTE_DISTINGUISHER] = route_dist
            param[vrfs.VRF_RF] = route_family
        attribute_maps = call(func_name, **param)
        return attribute_maps

    @staticmethod
    def _check_rf_and_normalize(prefix):
        """ check prefix's route_family and if the address is
        IPv6 address, return IPv6 route_family and normalized IPv6 address.
        If the address is IPv4 address, return IPv4 route_family
        and the prefix itself.

        """
        ip, masklen = prefix.split('/')
        if netaddr.valid_ipv6(ip):
            # normalize IPv6 address
            ipv6_prefix = str(netaddr.IPAddress(ip)) + '/' + masklen
            return vrfs.VRF_RF_IPV6, ipv6_prefix
        else:
            return vrfs.VRF_RF_IPV4, prefix


text:
$: << File.expand_path(File.dirname(__FILE__) + "/../lib")

require 'game'

games = Game.find_by_date('2009','09','15')

games.each do |game|
  puts game.print_linescore
  puts
end


text:
/*
 * Scanner.h
 *
 *  Created on: 03.04.2015
 *      Author: adrian
 */

#ifndef SCANNERPROJECT_SCANNER_SCANNER_H_
#define SCANNERPROJECT_SCANNER_SCANNER_H_

#include <stdlib.h>
#include "../automaton/Automaton.h"
#include <errno.h>
#include "../../scannerproject/buffer/Buffer.h"
#include "../../scannerproject/scanner/Token.h"
#include "../../scannerproject/symboltable/container/InfoContainerInteger.h"
#include "../../scannerproject/symboltable/SymbolTable.h"

struct Automaton;

class Scanner {
public:
	Scanner(char* path, SymbolTable* symTab);
	virtual ~Scanner();

	/*The size for the charCache.*/
	const static unsigned int sizeForCache = 2048;

	/*Base of integers converted from chars.*/
	const static unsigned int DECIMAL_SYSTEM = 10;

	Token* nextToken();
	void increaseLine();
	void increaseColumn();
	void decreaseColumn();
	void buildInteger();
	void buildIdentifier();
	void buildSign(char* lexem, Type type);
	void buildErrorToken(char* lexem, Type type);
	void saveChar(char c);
	void saveLine();
	void saveColumn();
	void ungetChar();

private:

	/*The SymbolTable to get the containers from for Identifier and Integer*/
	SymbolTable* symTab;

	/*The buffer from which the scanner gets its characters.*/
	Buffer* buffer;

	/*The automaton to which the chars from the buffer are submitted.*/
	Automaton* automaton;

	/*The current line within the input file.*/
	int currentLine;

	/*The current column within the output file*/
	int currentColumn;

	/*The line of the first letter of the current token appears.*/
	int currentTokenLine;

	/*The column of the first letter of the current token appears.*/
	int currentTokenColumn;

	/*Caches some chars from the buffer, if they are meant to become an Integer od Identifier.*/
	char* charCache;

	/*The next free slot within the charCache.*/
	unsigned int cacheIndex;

	/*The next token to build.*/
	Token* token;

	void readChar(char next);

};

#endif /* SCANNERPROJECT_SCANNER_SCANNER_H_ */


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/rosaria_generate_messages_lisp"
  "/home/praveen/Documents/ROS/tmp/rosaria/devel/share/common-lisp/ros/rosaria/msg/BumperState.lisp"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang)
  INCLUDE(CMakeFiles/rosaria_generate_messages_lisp.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)


text:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema"
                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                  xmlns:tns="http://www.nbrb.by/"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                  targetNamespace="http://www.nbrb.by/"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.nbrb.by/">
      <s:element name="TestCall">
        <s:complexType/>
      </s:element>
      <s:element name="TestCallResponse">
        <s:complexType/>
      </s:element>
      <s:element name="CurrenciesRefDaily">
        <s:complexType/>
      </s:element>
      <s:element name="CurrenciesRefDailyResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="CurrenciesRefDailyResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="CurrenciesRefMonthly">
        <s:complexType/>
      </s:element>
      <s:element name="CurrenciesRefMonthlyResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="CurrenciesRefMonthlyResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="StartDate">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="Periodicity" type="s:int"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="StartDateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="StartDateResult"
                       type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="LastDailyExRatesDate">
        <s:complexType/>
      </s:element>
      <s:element name="LastDailyExRatesDateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="LastDailyExRatesDateResult"
                       type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="LastMonthlyExRatesDate">
        <s:complexType/>
      </s:element>
      <s:element name="LastMonthlyExRatesDateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="LastMonthlyExRatesDateResult"
                       type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ExRatesDaily">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="onDate" type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ExRatesDailyResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="ExRatesDailyResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ExRatesMonthly">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="onDate" type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ExRatesMonthlyResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="ExRatesMonthlyResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ExRatesDyn">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="curId" type="s:int"/>
            <s:element minOccurs="1" maxOccurs="1" name="fromDate" type="s:dateTime"/>
            <s:element minOccurs="1" maxOccurs="1" name="toDate" type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ExRatesDynResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="ExRatesDynResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="CurrenciesRef">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="Periodicity" type="s:int"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="CurrenciesRefResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="CurrenciesRefResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="MetalsLastDate">
        <s:complexType/>
      </s:element>
      <s:element name="MetalsLastDateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="MetalsLastDateResult"
                       type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="MetalsRef">
        <s:complexType/>
      </s:element>
      <s:element name="MetalsRefResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="MetalsRefResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="MetalsPrices">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="MetalId" type="s:int"/>
            <s:element minOccurs="1" maxOccurs="1" name="fromDate" type="s:dateTime"/>
            <s:element minOccurs="1" maxOccurs="1" name="toDate" type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="MetalsPricesResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="MetalsPricesResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="IngotsPrices">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="onDate" type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="IngotsPricesResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="IngotsPricesResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="IngotsLastDate">
        <s:complexType/>
      </s:element>
      <s:element name="IngotsLastDateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="IngotsLastDateResult"
                       type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="StockAddRates">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="onDate" type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="StockAddRatesResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="StockAddRatesResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="StockAddRatesLastDate">
        <s:complexType/>
      </s:element>
      <s:element name="StockAddRatesLastDateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="StockAddRatesLastDateResult"
                       type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="RefRateOnDate">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="onDate" type="s:dateTime"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="RefRateOnDateResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="RefRateOnDateResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="RefRateDyn">
        <s:complexType/>
      </s:element>
      <s:element name="RefRateDynResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="RefRateDynResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema"/>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="CurrenciesRefDailySoapIn">
    <wsdl:part name="parameters" element="tns:CurrenciesRefDaily"/>
  </wsdl:message>
  <wsdl:message name="CurrenciesRefDailySoapOut">
    <wsdl:part name="parameters" element="tns:CurrenciesRefDailyResponse"/>
  </wsdl:message>
  <wsdl:message name="CurrenciesRefMonthlySoapIn">
    <wsdl:part name="parameters" element="tns:CurrenciesRefMonthly"/>
  </wsdl:message>
  <wsdl:message name="CurrenciesRefMonthlySoapOut">
    <wsdl:part name="parameters" element="tns:CurrenciesRefMonthlyResponse"/>
  </wsdl:message>
  <wsdl:message name="StartDateSoapIn">
    <wsdl:part name="parameters" element="tns:StartDate"/>
  </wsdl:message>
  <wsdl:message name="StartDateSoapOut">
    <wsdl:part name="parameters" element="tns:StartDateResponse"/>
  </wsdl:message>
  <wsdl:message name="LastDailyExRatesDateSoapIn">
    <wsdl:part name="parameters" element="tns:LastDailyExRatesDate"/>
  </wsdl:message>
  <wsdl:message name="LastDailyExRatesDateSoapOut">
    <wsdl:part name="parameters" element="tns:LastDailyExRatesDateResponse"/>
  </wsdl:message>
  <wsdl:message name="LastMonthlyExRatesDateSoapIn">
    <wsdl:part name="parameters" element="tns:LastMonthlyExRatesDate"/>
  </wsdl:message>
  <wsdl:message name="LastMonthlyExRatesDateSoapOut">
    <wsdl:part name="parameters" element="tns:LastMonthlyExRatesDateResponse"/>
  </wsdl:message>
  <wsdl:message name="ExRatesDailySoapIn">
    <wsdl:part name="parameters" element="tns:ExRatesDaily"/>
  </wsdl:message>
  <wsdl:message name="ExRatesDailySoapOut">
    <wsdl:part name="parameters" element="tns:ExRatesDailyResponse"/>
  </wsdl:message>
  <wsdl:message name="ExRatesMonthlySoapIn">
    <wsdl:part name="parameters" element="tns:ExRatesMonthly"/>
  </wsdl:message>
  <wsdl:message name="ExRatesMonthlySoapOut">
    <wsdl:part name="parameters" element="tns:ExRatesMonthlyResponse"/>
  </wsdl:message>
  <wsdl:message name="ExRatesDynSoapIn">
    <wsdl:part name="parameters" element="tns:ExRatesDyn"/>
  </wsdl:message>
  <wsdl:message name="ExRatesDynSoapOut">
    <wsdl:part name="parameters" element="tns:ExRatesDynResponse"/>
  </wsdl:message>
  <wsdl:message name="CurrenciesRefSoapIn">
    <wsdl:part name="parameters" element="tns:CurrenciesRef"/>
  </wsdl:message>
  <wsdl:message name="CurrenciesRefSoapOut">
    <wsdl:part name="parameters" element="tns:CurrenciesRefResponse"/>
  </wsdl:message>
  <wsdl:message name="MetalsLastDateSoapIn">
    <wsdl:part name="parameters" element="tns:MetalsLastDate"/>
  </wsdl:message>
  <wsdl:message name="MetalsLastDateSoapOut">
    <wsdl:part name="parameters" element="tns:MetalsLastDateResponse"/>
  </wsdl:message>
  <wsdl:message name="MetalsRefSoapIn">
    <wsdl:part name="parameters" element="tns:MetalsRef"/>
  </wsdl:message>
  <wsdl:message name="MetalsRefSoapOut">
    <wsdl:part name="parameters" element="tns:MetalsRefResponse"/>
  </wsdl:message>
  <wsdl:message name="MetalsPricesSoapIn">
    <wsdl:part name="parameters" element="tns:MetalsPrices"/>
  </wsdl:message>
  <wsdl:message name="MetalsPricesSoapOut">
    <wsdl:part name="parameters" element="tns:MetalsPricesResponse"/>
  </wsdl:message>
  <wsdl:message name="IngotsPricesSoapIn">
    <wsdl:part name="parameters" element="tns:IngotsPrices"/>
  </wsdl:message>
  <wsdl:message name="IngotsPricesSoapOut">
    <wsdl:part name="parameters" element="tns:IngotsPricesResponse"/>
  </wsdl:message>
  <wsdl:message name="IngotsLastDateSoapIn">
    <wsdl:part name="parameters" element="tns:IngotsLastDate"/>
  </wsdl:message>
  <wsdl:message name="IngotsLastDateSoapOut">
    <wsdl:part name="parameters" element="tns:IngotsLastDateResponse"/>
  </wsdl:message>
  <wsdl:message name="StockAddRatesSoapIn">
    <wsdl:part name="parameters" element="tns:StockAddRates"/>
  </wsdl:message>
  <wsdl:message name="StockAddRatesSoapOut">
    <wsdl:part name="parameters" element="tns:StockAddRatesResponse"/>
  </wsdl:message>
  <wsdl:message name="StockAddRatesLastDateSoapIn">
    <wsdl:part name="parameters" element="tns:StockAddRatesLastDate"/>
  </wsdl:message>
  <wsdl:message name="StockAddRatesLastDateSoapOut">
    <wsdl:part name="parameters" element="tns:StockAddRatesLastDateResponse"/>
  </wsdl:message>
  <wsdl:message name="RefRateOnDateSoapIn">
    <wsdl:part name="parameters" element="tns:RefRateOnDate"/>
  </wsdl:message>
  <wsdl:message name="RefRateOnDateSoapOut">
    <wsdl:part name="parameters" element="tns:RefRateOnDateResponse"/>
  </wsdl:message>
  <wsdl:message name="RefRateDynSoapIn">
    <wsdl:part name="parameters" element="tns:RefRateDyn"/>
  </wsdl:message>
  <wsdl:message name="RefRateDynSoapOut">
    <wsdl:part name="parameters" element="tns:RefRateDynResponse"/>
  </wsdl:message>
  <wsdl:portType name="ExRatesSoap">
    <wsdl:operation name="CurrenciesRefDaily">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Устаревший метод. Будет поддерживаться до конца 2011 года</wsdl:documentation>
      <wsdl:input message="tns:CurrenciesRefDailySoapIn"/>
      <wsdl:output message="tns:CurrenciesRefDailySoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="CurrenciesRefMonthly">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Устаревший метод. Будет поддерживаться до конца 2011 года</wsdl:documentation>
      <wsdl:input message="tns:CurrenciesRefMonthlySoapIn"/>
      <wsdl:output message="tns:CurrenciesRefMonthlySoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="StartDate">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Начальная дата
        установления Национальным банком Республики Беларусь официального курса
        белорусского рубля по отношению к иностранным валютам
      </wsdl:documentation>
      <wsdl:input message="tns:StartDateSoapIn"/>
      <wsdl:output message="tns:StartDateSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="LastDailyExRatesDate">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Последняя дата
        установления Национальным банком Республики Беларусь официального курса
        белорусского рубля по отношению к иностранным валютам на ежедневной основе
      </wsdl:documentation>
      <wsdl:input message="tns:LastDailyExRatesDateSoapIn"/>
      <wsdl:output message="tns:LastDailyExRatesDateSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="LastMonthlyExRatesDate">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Последняя дата
        установления Национальным банком Республики Беларусь официального курса
        белорусского рубля по отношению к иностранным валютам на ежемесячной основе
      </wsdl:documentation>
      <wsdl:input message="tns:LastMonthlyExRatesDateSoapIn"/>
      <wsdl:output message="tns:LastMonthlyExRatesDateSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="ExRatesDaily">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Официальный курс
        белорусского рубля по отношению к иностранным валютам, устанавливаемый
        Национальным банком Республики Беларусь ежедневно, а также до 17.02.1997 г.
      </wsdl:documentation>
      <wsdl:input message="tns:ExRatesDailySoapIn"/>
      <wsdl:output message="tns:ExRatesDailySoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="ExRatesMonthly">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Официальный курс
        белорусского рубля по отношению к иностранным валютам, устанавливаемый
        Национальным банком Республики Беларусь ежемесячно
      </wsdl:documentation>
      <wsdl:input message="tns:ExRatesMonthlySoapIn"/>
      <wsdl:output message="tns:ExRatesMonthlySoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="ExRatesDyn">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Динамика
        официального курса белорусского рубля по отношению к заданной иностранной валюте,
        устанавливаемого Национальным банком Республики Беларусь (не более чем за 365
        дней)
      </wsdl:documentation>
      <wsdl:input message="tns:ExRatesDynSoapIn"/>
      <wsdl:output message="tns:ExRatesDynSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="CurrenciesRef">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Полный перечень
        иностранных валют, к которым официальный курс белорусского рубля устанавливается
        Национальным банком Республики Беларусь
      </wsdl:documentation>
      <wsdl:input message="tns:CurrenciesRefSoapIn"/>
      <wsdl:output message="tns:CurrenciesRefSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="MetalsLastDate">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Последняя дата
        установления Национальным банком Республики Беларусь цен на драгоценные металлы в
        виде банковских слитков
      </wsdl:documentation>
      <wsdl:input message="tns:MetalsLastDateSoapIn"/>
      <wsdl:output message="tns:MetalsLastDateSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="MetalsRef">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Перечень
        драгоценных металлов, на которые Национальным банком Республики Беларусь
        устанавливаются учетные цены
      </wsdl:documentation>
      <wsdl:input message="tns:MetalsRefSoapIn"/>
      <wsdl:output message="tns:MetalsRefSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="MetalsPrices">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Динамика учетных
        цен на драгоценные металлы в виде банковских слитков, устанавливаемые Национальным
        банком Республики Беларусь (не более, чем за 31 день)
      </wsdl:documentation>
      <wsdl:input message="tns:MetalsPricesSoapIn"/>
      <wsdl:output message="tns:MetalsPricesSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="IngotsPrices">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Цены покупки и
        продажи Национальным банком Республики Беларусь драгоценных металлов в виде мерных
        слитков
      </wsdl:documentation>
      <wsdl:input message="tns:IngotsPricesSoapIn"/>
      <wsdl:output message="tns:IngotsPricesSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="IngotsLastDate">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Последняя дата
        установления Национальным банком Республики Беларусь цен покупки и продажи
        драгоценных металлов в виде мерных слитков
      </wsdl:documentation>
      <wsdl:input message="tns:IngotsLastDateSoapIn"/>
      <wsdl:output message="tns:IngotsLastDateSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="StockAddRates">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Курс белорусского
        рубля по отношению к основным иностранным валютам по итогам дополнительной
        торговой сессии ОАО "Белорусская валютно-фондовая биржа"
      </wsdl:documentation>
      <wsdl:input message="tns:StockAddRatesSoapIn"/>
      <wsdl:output message="tns:StockAddRatesSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="StockAddRatesLastDate">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Последняя дата
        установления курса белорусского рубля по отношению к основным иностранным валютам
        по итогам дополнительной торговой сессии ОАО "Белорусская валютно-фондовая биржа"
      </wsdl:documentation>
      <wsdl:input message="tns:StockAddRatesLastDateSoapIn"/>
      <wsdl:output message="tns:StockAddRatesLastDateSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="RefRateOnDate">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Ставка
        рефинансирования Национального банка на дату
      </wsdl:documentation>
      <wsdl:input message="tns:RefRateOnDateSoapIn"/>
      <wsdl:output message="tns:RefRateOnDateSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="RefRateDyn">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Динамика ставки
        рефинансирования Национального банка
      </wsdl:documentation>
      <wsdl:input message="tns:RefRateDynSoapIn"/>
      <wsdl:output message="tns:RefRateDynSoapOut"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="ExRatesSoap" type="tns:ExRatesSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="CurrenciesRefDaily">
      <soap:operation soapAction="http://www.nbrb.by/CurrenciesRefDaily"
                      style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CurrenciesRefMonthly">
      <soap:operation soapAction="http://www.nbrb.by/CurrenciesRefMonthly"
                      style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="StartDate">
      <soap:operation soapAction="http://www.nbrb.by/StartDate" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="LastDailyExRatesDate">
      <soap:operation soapAction="http://www.nbrb.by/LastDailyExRatesDate"
                      style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="LastMonthlyExRatesDate">
      <soap:operation soapAction="http://www.nbrb.by/LastMonthlyExRatesDate"
                      style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ExRatesDaily">
      <soap:operation soapAction="http://www.nbrb.by/ExRatesDaily" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ExRatesMonthly">
      <soap:operation soapAction="http://www.nbrb.by/ExRatesMonthly" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ExRatesDyn">
      <soap:operation soapAction="http://www.nbrb.by/ExRatesDyn" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CurrenciesRef">
      <soap:operation soapAction="http://www.nbrb.by/CurrenciesRef" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="MetalsLastDate">
      <soap:operation soapAction="http://www.nbrb.by/MetalsLastDate" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="MetalsRef">
      <soap:operation soapAction="http://www.nbrb.by/MetalsRef" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="MetalsPrices">
      <soap:operation soapAction="http://www.nbrb.by/MetalsPrices" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="IngotsPrices">
      <soap:operation soapAction="http://www.nbrb.by/IngotsPrices" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="IngotsLastDate">
      <soap:operation soapAction="http://www.nbrb.by/IngotsLastDate" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="StockAddRates">
      <soap:operation soapAction="http://www.nbrb.by/StockAddRates" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="StockAddRatesLastDate">
      <soap:operation soapAction="http://www.nbrb.by/StockAddRatesLastDate"
                      style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="RefRateOnDate">
      <soap:operation soapAction="http://www.nbrb.by/RefRateOnDate" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="RefRateDyn">
      <soap:operation soapAction="http://www.nbrb.by/RefRateDyn" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="ExRatesSoap12" type="tns:ExRatesSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="CurrenciesRefDaily">
      <soap12:operation soapAction="http://www.nbrb.by/CurrenciesRefDaily"
                        style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CurrenciesRefMonthly">
      <soap12:operation soapAction="http://www.nbrb.by/CurrenciesRefMonthly"
                        style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="StartDate">
      <soap12:operation soapAction="http://www.nbrb.by/StartDate" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="LastDailyExRatesDate">
      <soap12:operation soapAction="http://www.nbrb.by/LastDailyExRatesDate"
                        style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="LastMonthlyExRatesDate">
      <soap12:operation soapAction="http://www.nbrb.by/LastMonthlyExRatesDate"
                        style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ExRatesDaily">
      <soap12:operation soapAction="http://www.nbrb.by/ExRatesDaily" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ExRatesMonthly">
      <soap12:operation soapAction="http://www.nbrb.by/ExRatesMonthly" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ExRatesDyn">
      <soap12:operation soapAction="http://www.nbrb.by/ExRatesDyn" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CurrenciesRef">
      <soap12:operation soapAction="http://www.nbrb.by/CurrenciesRef" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="MetalsLastDate">
      <soap12:operation soapAction="http://www.nbrb.by/MetalsLastDate" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="MetalsRef">
      <soap12:operation soapAction="http://www.nbrb.by/MetalsRef" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="MetalsPrices">
      <soap12:operation soapAction="http://www.nbrb.by/MetalsPrices" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="IngotsPrices">
      <soap12:operation soapAction="http://www.nbrb.by/IngotsPrices" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="IngotsLastDate">
      <soap12:operation soapAction="http://www.nbrb.by/IngotsLastDate" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="StockAddRates">
      <soap12:operation soapAction="http://www.nbrb.by/StockAddRates" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="StockAddRatesLastDate">
      <soap12:operation soapAction="http://www.nbrb.by/StockAddRatesLastDate"
                        style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="RefRateOnDate">
      <soap12:operation soapAction="http://www.nbrb.by/RefRateOnDate" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="RefRateDyn">
      <soap12:operation soapAction="http://www.nbrb.by/RefRateDyn" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ExRates">
    <wsdl:port name="ExRatesSoap" binding="tns:ExRatesSoap">
      <soap:address location="http://www.nbrb.by/Services/ExRates.asmx"/>
    </wsdl:port>
    <wsdl:port name="ExRatesSoap12" binding="tns:ExRatesSoap12">
      <soap12:address location="http://www.nbrb.by/Services/ExRates.asmx"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


text:
@interface NUIRuleSet : NSObject<NUIPParseResult>

@property (strong) NSArray  *selectors;
@property (strong) NSDictionary *declarations;
@property (strong) NSDictionary *mediaOptions;

@end


text:
<?php

namespace Robo\Task\Assets;

use Robo\Result;
use Robo\Exception\TaskException;
use Robo\Task\BaseTask;
use Robo\Task\Base\Exec;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem as sfFilesystem;

/**
 * Minifies images. When the required minifier is not installed on the system
 * the task will try to download it from the [imagemin](https://github.com/imagemin) repository.
 *
 * When the task is run without any specified minifier it will compress the images
 * based on the extension.
 *
 * ```php
 * $this->taskImageMinify('assets/images/*')
 *     ->to('dist/images/')
 *     ->run();
 * ```
 *
 * This will use the following minifiers:
 *
 * - PNG: optipng
 * - GIF: gifsicle
 * - JPG, JPEG: jpegtran
 * - SVG: svgo
 *
 * When the minifier is specified the task will use that for all the input files. In that case
 * it is useful to filter the files with the extension:
 *
 * ```php
 * $this->taskImageMinify('assets/images/*.png')
 *     ->to('dist/images/')
 *     ->minifier('pngcrush');
 *     ->run();
 * ```
 *
 * The task supports the following minifiers:
 *
 * - optipng
 * - pngquant
 * - advpng
 * - pngout
 * - zopflipng
 * - pngcrush
 * - gifsicle
 * - jpegoptim
 * - jpeg-recompress
 * - jpegtran
 * - svgo (only minification, no downloading)
 *
 * You can also specifiy extra options for the minifiers:
 *
 * ```php
 * $this->taskImageMinify('assets/images/*.jpg')
 *     ->to('dist/images/')
 *     ->minifier('jpegtran', ['-progressive' => null, '-copy' => 'none'])
 *     ->run();
 * ```
 *
 * This will execute as:
 * `jpegtran -copy none -progressive -optimize -outfile "dist/images/test.jpg" "/var/www/test/assets/images/test.jpg"`
 */
class ImageMinify extends BaseTask
{
    /**
     * Destination directory for the minified images.
     *
     * @var string
     */
    protected $to;

    /**
     * Array of the source files.
     *
     * @var array
     */
    protected $dirs = [];

    /**
     * Symfony 2 filesystem.
     *
     * @var sfFilesystem
     */
    protected $fs;

    /**
     * Target directory for the downloaded binary executables.
     *
     * @var string
     */
    protected $executableTargetDir;

    /**
     * Array for the downloaded binary executables.
     *
     * @var array
     */
    protected $executablePaths = [];

    /**
     * Array for the individual results of all the files.
     *
     * @var array
     */
    protected $results = [];

    /**
     * Default minifier to use.
     *
     * @var string
     */
    protected $minifier;

    /**
     * Array for minifier options.
     *
     * @var array
     */
    protected $minifierOptions = [];

    /**
     * Supported minifiers.
     *
     * @var array
     */
    protected $minifiers = [
        // Default 4
        'optipng',
        'gifsicle',
        'jpegtran',
        'svgo',
        // PNG
        'pngquant',
        'advpng',
        'pngout',
        'zopflipng',
        'pngcrush',
        // JPG
        'jpegoptim',
        'jpeg-recompress',
    ];

    /**
     * Binary repositories of Imagemin.
     *
     * @link https://github.com/imagemin
     *
     * @var array
     */
    protected $imageminRepos = [
        // PNG
        'optipng' => 'https://github.com/imagemin/optipng-bin',
        'pngquant' => 'https://github.com/imagemin/pngquant-bin',
        'advpng' => 'https://github.com/imagemin/advpng-bin',
        'pngout' => 'https://github.com/imagemin/pngout-bin',
        'zopflipng' => 'https://github.com/imagemin/zopflipng-bin',
        'pngcrush' => 'https://github.com/imagemin/pngcrush-bin',
        // Gif
        'gifsicle' => 'https://github.com/imagemin/gifsicle-bin',
        // JPG
        'jpegtran' => 'https://github.com/imagemin/jpegtran-bin',
        'jpegoptim' => 'https://github.com/imagemin/jpegoptim-bin',
        'cjpeg' => 'https://github.com/imagemin/mozjpeg-bin', // note: we do not support this minifier because it creates JPG from non-JPG files
        'jpeg-recompress' => 'https://github.com/imagemin/jpeg-recompress-bin',
        // WebP
        'cwebp' => 'https://github.com/imagemin/cwebp-bin', // note: we do not support this minifier because it creates WebP from non-WebP files
    ];

    public function __construct($dirs)
    {
        is_array($dirs)
            ? $this->dirs = $dirs
            : $this->dirs[] = $dirs;

        $this->fs = new sfFilesystem();

        // guess the best path for the executables based on __DIR__
        if (($pos = strpos(__DIR__, 'consolidation/robo')) !== false) {
            // the executables should be stored in vendor/bin
            $this->executableTargetDir = substr(__DIR__, 0, $pos).'bin';
        }

        // check if the executables are already available
        foreach ($this->imageminRepos as $exec => $url) {
            $path = $this->executableTargetDir.'/'.$exec;
            // if this is Windows add a .exe extension
            if (substr($this->getOS(), 0, 3) == 'win') {
                $path .= '.exe';
            }
            if (is_file($path)) {
                $this->executablePaths[$exec] = $path;
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    public function run()
    {
        // find the files
        $files = $this->findFiles($this->dirs);

        // minify the files
        $result = $this->minify($files);
        // check if there was an error
        if ($result instanceof Result) {
            return $result;
        }

        $amount = (count($files) == 1 ? 'image' : 'images');
        $message = "Minified {filecount} out of {filetotal} $amount into {destination}";
        $context = ['filecount' => count($this->results['success']), 'filetotal' => count($files), 'destination' => $this->to];

        if (count($this->results['success']) == count($files)) {
            $this->printTaskSuccess($message, $context);

            return Result::success($this, $message, $context);
        } else {
            return Result::error($this, $message, $context);
        }
    }

    /**
     * Sets the target directory where the files will be copied to.
     *
     * @param string $target
     *
     * @return $this
     */
    public function to($target)
    {
        $this->to = rtrim($target, '/');

        return $this;
    }

    /**
     * Sets the minifier.
     *
     * @param string $minifier
     * @param array  $options
     *
     * @return $this
     */
    public function minifier($minifier, array $options = [])
    {
        $this->minifier = $minifier;
        $this->minifierOptions = array_merge($this->minifierOptions, $options);

        return $this;
    }

    /**
     * @param array $dirs
     *
     * @return array|\Robo\Result
     *
     * @throws \Robo\Exception\TaskException
     */
    protected function findFiles($dirs)
    {
        $files = array();

        // find the files
        foreach ($dirs as $k => $v) {
            // reset finder
            $finder = new Finder();

            $dir = $k;
            $to = $v;
            // check if target was given with the to() method instead of key/value pairs
            if (is_int($k)) {
                $dir = $v;
                if (isset($this->to)) {
                    $to = $this->to;
                } else {
                    throw new TaskException($this, 'target directory is not defined');
                }
            }

            try {
                $finder->files()->in($dir);
            } catch (\InvalidArgumentException $e) {
                // if finder cannot handle it, try with in()->name()
                if (strpos($dir, '/') === false) {
                    $dir = './'.$dir;
                }
                $parts = explode('/', $dir);
                $new_dir = implode('/', array_slice($parts, 0, -1));
                try {
                    $finder->files()->in($new_dir)->name(array_pop($parts));
                } catch (\InvalidArgumentException $e) {
                    return Result::fromException($this, $e);
                }
            }

            foreach ($finder as $file) {
                // store the absolute path as key and target as value in the files array
                $files[$file->getRealpath()] = $this->getTarget($file->getRealPath(), $to);
            }
            $fileNoun = count($finder) == 1 ? ' file' : ' files';
            $this->printTaskInfo("Found {filecount} $fileNoun in {dir}", ['filecount' => count($finder), 'dir' => $dir]);
        }

        return $files;
    }

    /**
     * @param string $file
     * @param string $to
     *
     * @return string
     */
    protected function getTarget($file, $to)
    {
        $target = $to.'/'.basename($file);

        return $target;
    }

    /**
     * @param array $files
     *
     * @return \Robo\Result
     */
    protected function minify($files)
    {
        // store the individual results into the results array
        $this->results = [
            'success' => [],
            'error' => [],
        ];

        // loop through the files
        foreach ($files as $from => $to) {
            if (!isset($this->minifier)) {
                // check filetype based on the extension
                $extension = strtolower(pathinfo($from, PATHINFO_EXTENSION));

                // set the default minifiers based on the extension
                switch ($extension) {
                    case 'png':
                        $minifier = 'optipng';
                        break;
                    case 'jpg':
                    case 'jpeg':
                        $minifier = 'jpegtran';
                        break;
                    case 'gif':
                        $minifier = 'gifsicle';
                        break;
                    case 'svg':
                        $minifier = 'svgo';
                        break;
                }
            } else {
                if (!in_array($this->minifier, $this->minifiers, true)
                    && !is_callable(strtr($this->minifier, '-', '_'))
                ) {
                    $message = sprintf('Invalid minifier %s!', $this->minifier);

                    return Result::error($this, $message);
                }
                $minifier = $this->minifier;
            }

            // Convert minifier name to camelCase (e.g. jpeg-recompress)
            $funcMinifier = $this->camelCase($minifier);

            // call the minifier method which prepares the command
            if (is_callable($funcMinifier)) {
                $command = call_user_func($funcMinifier, $from, $to, $this->minifierOptions);
            } elseif (method_exists($this, $funcMinifier)) {
                $command = $this->{$funcMinifier}($from, $to);
            } else {
                $message = sprintf('Minifier method <info>%s</info> cannot be found!', $funcMinifier);

                return Result::error($this, $message);
            }

            // launch the command
            $this->printTaskInfo('Minifying {filepath} with {minifier}', ['filepath' => $from, 'minifier' => $minifier]);
            $result = $this->executeCommand($command);

            // check the return code
            if ($result->getExitCode() == 127) {
                $this->printTaskError('The {minifier} executable cannot be found', ['minifier' => $minifier]);
                // try to install from imagemin repository
                if (array_key_exists($minifier, $this->imageminRepos)) {
                    $result = $this->installFromImagemin($minifier);
                    if ($result instanceof Result) {
                        if ($result->wasSuccessful()) {
                            $this->printTaskSuccess($result->getMessage());
                            // retry the conversion with the downloaded executable
                            if (is_callable($minifier)) {
                                $command = call_user_func($minifier, $from, $to, $minifierOptions);
                            } elseif (method_exists($this, $minifier)) {
                                $command = $this->{$minifier}($from, $to);
                            }
                            // launch the command
                            $this->printTaskInfo('Minifying {filepath} with {minifier}', ['filepath' => $from, 'minifier' => $minifier]);
                            $result = $this->executeCommand($command);
                        } else {
                            $this->printTaskError($result->getMessage());
                            // the download was not successful
                            return $result;
                        }
                    }
                } else {
                    return $result;
                }
            }

            // check the success of the conversion
            if ($result->getExitCode() !== 0) {
                $this->results['error'][] = $from;
            } else {
                $this->results['success'][] = $from;
            }
        }
    }

    /**
     * @return string
     */
    protected function getOS()
    {
        $os = php_uname('s');
        $os .= '/'.php_uname('m');
        // replace x86_64 to x64, because the imagemin repo uses that
        $os = str_replace('x86_64', 'x64', $os);
        // replace i386, i686, etc to x86, because of imagemin
        $os = preg_replace('/i[0-9]86/', 'x86', $os);
        // turn info to lowercase, because of imagemin
        $os = strtolower($os);

        return $os;
    }

    /**
     * @param string $command
     *
     * @return \Robo\Result
     */
    protected function executeCommand($command)
    {
        // insert the options into the command
        $a = explode(' ', $command);
        $executable = array_shift($a);
        foreach ($this->minifierOptions as $key => $value) {
            // first prepend the value
            if (!empty($value)) {
                array_unshift($a, $value);
            }
            // then add the key
            if (!is_numeric($key)) {
                array_unshift($a, $key);
            }
        }
        // check if the executable can be replaced with the downloaded one
        if (array_key_exists($executable, $this->executablePaths)) {
            $executable = $this->executablePaths[$executable];
        }
        array_unshift($a, $executable);
        $command = implode(' ', $a);

        // execute the command
        $exec = new Exec($command);

        return $exec->inflect($this)->printed(false)->run();
    }

    /**
     * @param string $executable
     *
     * @return \Robo\Result
     */
    protected function installFromImagemin($executable)
    {
        // check if there is an url defined for the executable
        if (!array_key_exists($executable, $this->imageminRepos)) {
            $message = sprintf('The executable %s cannot be found in the defined imagemin repositories', $executable);

            return Result::error($this, $message);
        }
        $this->printTaskInfo('Downloading the {executable} executable from the imagemin repository', ['executable' => $executable]);

        $os = $this->getOS();
        $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'?raw=true';
        if (substr($os, 0, 3) == 'win') {
            // if it is win, add a .exe extension
            $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'.exe?raw=true';
        }
        $data = @file_get_contents($url, false, null);
        if ($data === false) {
            // there is something wrong with the url, try it without the version info
            $url = preg_replace('/x[68][64]\//', '', $url);
            $data = @file_get_contents($url, false, null);
            if ($data === false) {
                // there is still something wrong with the url if it is win, try with win32
                if (substr($os, 0, 3) == 'win') {
                    $url = preg_replace('win/', 'win32/', $url);
                    $data = @file_get_contents($url, false, null);
                    if ($data === false) {
                        // there is nothing more we can do
                        $message = sprintf('Could not download the executable <info>%s</info>', $executable);

                        return Result::error($this, $message);
                    }
                }
                // if it is not windows there is nothing we can do
                $message = sprintf('Could not download the executable <info>%s</info>', $executable);

                return Result::error($this, $message);
            }
        }
        // check if target directory exists
        if (!is_dir($this->executableTargetDir)) {
            mkdir($this->executableTargetDir);
        }
        // save the executable into the target dir
        $path = $this->executableTargetDir.'/'.$executable;
        if (substr($os, 0, 3) == 'win') {
            // if it is win, add a .exe extension
            $path = $this->executableTargetDir.'/'.$executable.'.exe';
        }
        $result = file_put_contents($path, $data);
        if ($result === false) {
            $message = sprintf('Could not copy the executable <info>%s</info> to %s', $executable, $target_dir);

            return Result::error($this, $message);
        }
        // set the binary to executable
        chmod($path, 0755);

        // if everything successful, store the executable path
        $this->executablePaths[$executable] = $this->executableTargetDir.'/'.$executable;
        // if it is win, add a .exe extension
        if (substr($os, 0, 3) == 'win') {
            $this->executablePaths[$executable] .= '.exe';
        }

        $message = sprintf('Executable <info>%s</info> successfully downloaded', $executable);

        return Result::success($this, $message);
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function optipng($from, $to)
    {
        $command = sprintf('optipng -quiet -out "%s" -- "%s"', $to, $from);
        if ($from != $to && is_file($to)) {
            // earlier versions of optipng do not overwrite the target without a backup
            // http://sourceforge.net/p/optipng/bugs/37/
            unlink($to);
        }

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function jpegtran($from, $to)
    {
        $command = sprintf('jpegtran -optimize -outfile "%s" "%s"', $to, $from);

        return $command;
    }

    protected function gifsicle($from, $to)
    {
        $command = sprintf('gifsicle -o "%s" "%s"', $to, $from);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function svgo($from, $to)
    {
        $command = sprintf('svgo "%s" "%s"', $from, $to);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function pngquant($from, $to)
    {
        $command = sprintf('pngquant --force --output "%s" "%s"', $to, $from);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function advpng($from, $to)
    {
        // advpng does not have any output parameters, copy the file and then compress the copy
        $command = sprintf('advpng --recompress --quiet "%s"', $to);
        $this->fs->copy($from, $to, true);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function pngout($from, $to)
    {
        $command = sprintf('pngout -y -q "%s" "%s"', $from, $to);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function zopflipng($from, $to)
    {
        $command = sprintf('zopflipng -y "%s" "%s"', $from, $to);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function pngcrush($from, $to)
    {
        $command = sprintf('pngcrush -q -ow "%s" "%s"', $from, $to);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function jpegoptim($from, $to)
    {
        // jpegoptim only takes the destination directory as an argument
        $command = sprintf('jpegoptim --quiet -o --dest "%s" "%s"', dirname($to), $from);

        return $command;
    }

    /**
     * @param string $from
     * @param string $to
     *
     * @return string
     */
    protected function jpegRecompress($from, $to)
    {
        $command = sprintf('jpeg-recompress --quiet "%s" "%s"', $from, $to);

        return $command;
    }

    /**
     * @param string $text
     *
     * @return string
     */
    public static function camelCase($text)
    {
        // non-alpha and non-numeric characters become spaces
        $text = preg_replace('/[^a-z0-9]+/i', ' ', $text);
        $text = trim($text);
        // uppercase the first character of each word
        $text = ucwords($text);
        $text = str_replace(" ", "", $text);
        $text = lcfirst($text);

        return $text;
    }
}