text:
package com.youdu.view.fragment.home;

import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.youdu.R;
import com.youdu.activity.LoginActivity;
import com.youdu.activity.MessageActivity;
import com.youdu.manager.UserManager;
import com.youdu.module.mina.MinaModel;
import com.youdu.network.mina.ConnectionManager;
import com.youdu.network.mina.MinaReceiver;
import com.youdu.adutil.ResponseEntityToModule;
import com.youdu.view.fragment.BaseFragment;

/**
 * @author: vision
 * @function: 消息Fragment
 * @date: 16/7/14
 */
public class MessageFragment extends BaseFragment implements OnClickListener {

    /**
     * UI
     */
    private View mContentView;
    private RelativeLayout mMessageLayout;
    private RelativeLayout mZanLayout;
    private RelativeLayout mImoocLayout;
    private TextView mTipView;
    private TextView mTipZanView;
    private TextView mTipMsgView;

    /**
     * 负责处理接收到的mina消息
     */
    private MinaReceiver mReceiver;
    private MinaModel mData;

    public MessageFragment() {

    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = getActivity();
        mReceiver = new MinaReceiver(new MinaReceiver.MinaListener() {
            @Override
            public void doHandleMessage(Intent intent) {
                handleMessage(intent);
            }
        });
        registerBroadcast();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mContentView = inflater.inflate(R.layout.fragment_message_layout, null, false);
        initView();
        return mContentView;
    }

    private void initView() {
        mMessageLayout = (RelativeLayout) mContentView.findViewById(R.id.message_layout);
        mImoocLayout = (RelativeLayout) mContentView.findViewById(R.id.imooc_layout);
        mZanLayout = (RelativeLayout) mContentView.findViewById(R.id.zan_layout);
        mTipView = (TextView) mContentView.findViewById(R.id.tip_view);
        mTipZanView = (TextView) mContentView.findViewById(R.id.zan_tip_view);
        mTipMsgView = (TextView) mContentView.findViewById(R.id.unread_tip_view);

        mImoocLayout.setOnClickListener(this);
        mZanLayout.setOnClickListener(this);
        mMessageLayout.setOnClickListener(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        unregisterBroadcast();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.zan_layout:
                gotoMessageActivity(2);
                break;
            case R.id.message_layout:
                gotoMessageActivity(1);
                break;
            case R.id.imooc_layout:
                gotoMessageActivity(3);
                break;
        }
    }

    private void gotoMessageActivity(int type) {
        if (UserManager.getInstance().hasLogined()) {
            Intent intent = new Intent(mContext, MessageActivity.class);
            switch (type) {
                case 1:
                    intent.putExtra(MessageActivity.DATA_LIST, mData.data.msgValues);
                    mTipMsgView.setVisibility(View.GONE);
                    break;
                case 2:
                    intent.putExtra(MessageActivity.DATA_LIST, mData.data.zanValues);
                    mTipZanView.setVisibility(View.GONE);
                    break;
                case 3:
                    intent.putExtra(MessageActivity.DATA_LIST, mData.data.systemValues);
                    mTipView.setVisibility(View.GONE);
                    break;
            }
            intent.putExtra(MessageActivity.TYPE, type);
            startActivity(intent);
        } else {
            //去登陆
            startActivity(new Intent(mContext, LoginActivity.class));
        }
    }

    private void registerBroadcast() {

        IntentFilter filter =
                new IntentFilter(ConnectionManager.BROADCAST_ACTION);
        LocalBroadcastManager.getInstance(mContext)
                .registerReceiver(mReceiver, filter);
    }

    private void unregisterBroadcast() {
        LocalBroadcastManager.getInstance(mContext)
                .unregisterReceiver(mReceiver);
    }

    //真正的处理mina消息
    private void handleMessage(Intent intent) {
        String message = intent.getStringExtra(ConnectionManager.MESSAGE);
        Log.e("MessageFragment", message);
        mData = (MinaModel) ResponseEntityToModule.
                parseJsonToModule(message, MinaModel.class);
        //要改成三个界面都更新
        if (mData != null) {
            if (mData.data.msgValues != null && mData.data.msgValues.size() > 0) {
                mTipMsgView.setVisibility(View.VISIBLE);
                mTipMsgView.setText(String.valueOf(mData.data.msgValues.size()));
            } else {
                mTipMsgView.setVisibility(View.GONE);
            }

            if (mData.data.zanValues != null && mData.data.zanValues.size() > 0) {
                mTipZanView.setVisibility(View.VISIBLE);
                mTipZanView.setText(String.valueOf(mData.data.zanValues.size()));
            } else {
                mTipZanView.setVisibility(View.GONE);
            }

            if (mData.data.systemValues != null && mData.data.systemValues.size() > 0) {
                mTipView.setVisibility(View.VISIBLE);
                mTipView.setText(String.valueOf(mData.data.systemValues.size()));
            } else {
                mTipView.setVisibility(View.GONE);
            }
        }
    }
}


text:
mind-hacking
============

Words are the code for operating the mind. Not the most efficient API, but pleasantly flexible and expressive.

Here's the content:

[What's Wrong With Extending the DOM Now?][extenddom] ([comments][extenddom-c])

[extenddom]: https://github.com/nbubna/mind-hacking/blob/gh-pages/extending-the-dom.md
[extenddom-c]: https://github.com/nbubna/mind-hacking/issues/1

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/nbubna/mind-hacking/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

redpajama_set_name: RedPajamaGithub


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

var Parent = {
  setupParent: function() {
    this.children = [];
    this.changedChildren = [];
    this.renderedChildren = [];
  },

  addChild: function(child) {
    if (child.parent) child.parent.remove(child);
    this.children.push(child);
    child.parent = this;
    child.childId = this.children.length - 1;
    child.changed();
  },

  removeChild: function(child) {
    if (child.parent !== this) {
      return;
    }

    // check if it is in this parent
    this.renderedChildren.splice(child.childId, 1);
    this.children.splice(child.childId, 1);

    var childIndex = this.changedChildren.indexOf(child.childId);
    if (childIndex !== -1) {
      this.changedChildren.splice(childIndex, 1);
    }

    // Lower id's of all children above by one
    for (var i = child.childId; i < this.children.length; i++) {
      this.children[i].childId--;
    }

    // lower id's of all changedChildren by one
    for (var i = 0; i < this.changedChildren.length; i++) {
      if (this.changedChildren[i] > child.childId) this.changedChildren[i]--;
    }

    child.childId = null;
    child.parentNotified = false;
    child.parent = false;
    this.changed();
  },

  renderChildren: function(opts) {
    // loop through the changed children
    while (this.changedChildren.length > 0) {
      var childId = this.changedChildren.shift();
      this.renderedChildren[childId] = this.children[childId].render(opts);
      this.children[childId].parentNotified = false;
    }

    // FIGURE OUT HOW NOT TO FLATTEN EVERY TIME!
    return utils.flatten(this.renderedChildren, true);
  }
};

module.exports = Parent;


text:
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Web.Mvc;

namespace BrickPile.Core.Mvc
{
    /// <summary>
    ///     Represents a map of all registred controllers in BrickPile.
    /// </summary>
    internal class ControllerMapper : IControllerMapper
    {
        private static readonly ConcurrentDictionary<Type, string> ControllerMap =
            new ConcurrentDictionary<Type, string>();

        private static readonly ConcurrentDictionary<string, string[]> ControllerActionMap =
            new ConcurrentDictionary<string, string[]>();

        /// <summary>
        ///     Initializes a new instance of the <see cref="ControllerMapper" /> class.
        /// </summary>
        public ControllerMapper()
        {
            var assemblies = AppDomain.CurrentDomain.GetAssemblies();

            foreach (var assembly in assemblies)
            {
                foreach (var type in assembly.GetTypes())
                {
                    if (!type.IsClass)
                    {
                        continue;
                    }
                    if (!type.IsSubclassOf(typeof (Controller))) continue;
                    ControllerMap.TryAdd(type, type.Name.Replace("Controller", ""));
                    var methodNames = type.GetMethods().Select(x => x.Name).ToArray();
                    ControllerActionMap.TryAdd(type.Name.Replace("Controller", ""), methodNames);
                }
            }
        }

        /// <summary>
        ///     Gets the name of the controller.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public string GetControllerName(Type type)
        {
            string name;
            ControllerMap.TryGetValue(type, out name);
            return name;
        }

        /// <summary>
        ///     Controllers the has action.
        /// </summary>
        /// <param name="controllerName">Name of the controller.</param>
        /// <param name="actionName">Name of the action.</param>
        /// <returns></returns>
        public bool ControllerHasAction(string controllerName, string actionName)
        {
            return ControllerActionMap.ContainsKey(controllerName) &&
                   ControllerActionMap[controllerName].Any(
                       action => String.Equals(action, actionName, StringComparison.InvariantCultureIgnoreCase));
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/ryz.iml" filepath="$PROJECT_DIR$/ryz.iml" />
    </modules>
  </component>
</project>


text:
set -x

echo "required admin actions post upgrade"

POSTACTION_POD=$(kubectl get -n openstack pods -l application=keystone,component=api --no-headers -o name | awk -F '/' '{ print $NF; exit }')
KS_USER="charter_admin"
KS_PROJECT="ctec"
KS_PASSWORD="password"
KS_USER_DOMAIN="default"
KS_PROJECT_DOMAIN="default"
KS_URL="http://keystone.openstack/v3"

KEYSTONE_CREDS="--os-username ${KS_USER} \
  --os-project-name ${KS_PROJECT} \
  --os-auth-url ${KS_URL} \
  --os-project-domain-name ${KS_PROJECT_DOMAIN} \
  --os-user-domain-name ${KS_USER_DOMAIN} \
  --os-password ${KS_PASSWORD}"

kubectl exec -n openstack ${POSTACTION_POD} -- keystone-manage pki_setup --keystone-user keystone --keystone-group ""

POSTACTION_POD=$(kubectl get -n openstack pods -l application=nova,component=os-api --no-headers -o name | awk -F '/' '{ print $NF; exit }')

kubectl exec -n openstack ${POSTACTION_POD} -- nova-manage cell_v2 discover_hosts

sudo chown -R 42436:42436 /var/lib/nova/
for node in $(cat $HOME/charter-nfv-demo/bootkube-ci/deploy-node/nodes); do
  ssh -tq ${node} "sudo chown -R 42436:42436 /var/lib/nova";
done


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Portfolio de Sara Palma">
    <meta name="author" content="Sara Palma Fernández">
    <link rel="icon" href="../../favicon.ico">

    <title>Sara Palma</title>

    <meta property="og:url" content="http://laibabeila.github.io/index.html" />
    <meta property="og:title" content="Sara Palma's portfolio" />
    <meta property="og:description" content="Sara Palma's portfolio, contact and personal web page" />
    <meta property="og:image" content="images/avatar.jpg"/>

    <meta itemprop="name" content="Sara Palma's portfolio">
    <meta itemprop="description" content="Sara Palma's portfolio, contact and personal web page">
    <meta itemprop="image" content="images/avatar.jpg">

    <link href="../bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="//blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
    <link rel="stylesheet" href="../bootsrap-image-gallery/css/bootstrap-image-gallery.min.css">

    <link href="../css/style.css" rel="stylesheet">

    <link href="../css/banner-images.css" rel="stylesheet">

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            Home

Portfolio

Perfil

Contacto

 Proyectos

Promoción Bloggers para Sercotel

Diseño gráfico

Sara Palma, 2013

Enlaces de interés:

www.sercotel.com

www.behance/Blogger-for-Sercotel.net

¡Comparte!

"Trabajo realizado para Sercotel Hoteles con la finalidad de anunciar su promoción especial para los bloggers."

Diseño de campaña para recordar y reavivar el acuerdo entre hotel y blogger turístico para fomentar el intercambio de actividades y hospedaje por el de publicidad o promoción del centro hotelero.

        ‹
        ›
        ×

                        <button type="button" class="close" aria-hidden="true">×</button>

                        <button type="button" class="btn btn-default pull-left prev">

                            Previous
                        </button>
                        <button type="button" class="btn btn-primary next">
                            Next

                        </button>


text:
extern crate log;
extern crate simple_write_logger as logger;

mod test;

#[test]
fn level_filter() {
    let writers = Vec::new();
    let expect = "";
    test::test(writers, log::Level::Info, expect, || debug!("DEBUG"));
}


text:
<?php

/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */
$installer = $this;

// is product used for recurring payments
$installer->addAttribute('catalog_product', 'is_recurring', array(
    'group'             => 'Recurring Profile',
    'type'              => 'int',
    'backend'           => '',
    'frontend'          => '',
    'label'             => 'Enable Recurring Profile',
    'note'              => 'Products with recurring profile participate in catalog as nominal items.',
    'input'             => 'select',
    'class'             => '',
    'source'            => 'eav/entity_attribute_source_boolean',
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible'           => true,
    'required'          => false,
    'user_defined'      => false,
    'default'           => '',
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'visible_on_front'  => false,
    'unique'            => false,
    'apply_to'          => 'simple,virtual',
    'is_configurable'   => false
));

// recurring payment profile
$installer->addAttribute('catalog_product', 'recurring_profile', array(
    'group'             => 'Recurring Profile',
    'type'              => 'text',
    'backend'           => 'catalog/product_attribute_backend_recurring',
    'frontend'          => '',
    'label'             => 'Recurring Payment Profile',
    'input'             => 'text', // doesn't matter
    'class'             => '',
    'source'            => '',
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible'           => true,
    'required'          => false,
    'user_defined'      => false,
    'default'           => '',
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'visible_on_front'  => false,
    'unique'            => false,
    'apply_to'          => 'simple,virtual',
    'is_configurable'   => false
));


text:
{% extends "base.html" %}

{% block content %}

 Регистрация заявки на участие в первой лиге АДФС

    <form role="form" method="post">
        {% csrf_token %}
        {% load bootstrap %}
         Ответьте, пожалуйста, на несколько простых вопросов и ваша заявка обязательно будет рассмотрена администрацией!

                    {{ form.name | bootstrap }}

                    {{ form.vkLink | bootstrap }}

                    {{ form.phone | bootstrap }}

                    {{ form.team | bootstrap }}

 Подать заявку на следующие турниры:

                        {{ form.first_league | bootstrap }}

                        {{ form.pokal | bootstrap }}

                        {{ form.winter_pokal |bootstrap }}

                <button type="submit" class="btn btn-success">Заявиться</button>

    </form>
{% endblock %}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Publções Inst. Micol. Recife 247: 15 (1960)

#### Original name
Spilomyces gramineae Bat. & Peres

### Remarks
null


text: angular.module('moduleB', ['moduleD']);


text:
class AddOrderToTracks < ActiveRecord::Migration
  def change
    add_column :tracks, :order, :string
  end
end


text:
package br.eti.hmagalhaes.bomclima.web.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;

/**
 * Força o uso de UTF-8 nos requests POST.
 */
@WebFilter("*")
public class UTF8EncodingFilter implements Filter {

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {

	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
			throws IOException, ServletException {

		final HttpServletRequest httpRequest = (HttpServletRequest) request;

		if ("POST".equalsIgnoreCase(httpRequest.getMethod())) {
			httpRequest.setCharacterEncoding("UTF-8");
		}

		chain.doFilter(request, response);
	}

	@Override
	public void destroy() {

	}
}


text:
import * as SIP from 'sip.js';

let ua: SIP.UA = new SIP.UA();

const mediaHandler = (session: SIP.Session, options: SIP.WebRTC.Options) => new SIP.WebRTC.MediaHandler();
const logConnector = (level: string, category: string, label: string, content: string) => null;

const uaWithConfig: SIP.UA = new SIP.UA({
    uri: "wss://uri",
    wsServers: ["s1", "s2", { ws_uri: "s3", weight: 1 }],
    allowLegacyNotifications: true,
    authenticationFactory: mediaHandler,
    authorizationUser: "user",
    autostart: true,
    autostop: false,
    connectionRecoveryMaxInterval: 1,
    connectionRecoveryMinInterval: 1,
    displayName: "name",
    hackCleanJitsiSdpImageattr: true,
    hackStripTcp: true,
    hackIpInContact: true,
    hackViaTcp: true,
    hackWssInTransport: true,
    iceCheckingTimeout: 1,
    instanceId: "id",
    log: {
        builtinEnabled: true,
        level: 1,
        connector: logConnector
    },
    mediaHandlerFactory: mediaHandler,
    noAnswerTimeout: 1,
    password: "",
    register: true,
    registerExpires: 1,
    registrarServer: "sip:registrar.mydomain.com",
    rel100: "",
    replaces: "",
    stunServers: ["", ""],
    turnServers: [
        {
            password: "",
            username: "",
            urls: ["", ""]
        }
    ],
    usePreloadedRoute: true,
    userAgentString: "",
    wsServerMaxReconnection: 1,
    wsServerReconnectionTimeout: 1
});

ua.start();
ua.stop();

ua.register();
ua = ua.register({ extraHeaders: [""] });

ua.unregister();
ua.unregister({ extraHeaders: [""], all: true });

const isConnected: boolean = ua.isConnected();
const isRegistered: boolean = ua.isRegistered();

const message: SIP.Message = ua.message("", "", { contentType: "" });

ua.subscribe("", "", { expires: 1, extraHeaders: [""] });
const subscription: SIP.Subscription = ua.subscribe(new SIP.URI(), "", { expires: 1, extraHeaders: [""] });

let session = ua.invite("", new HTMLVideoElement());

const inviteOptions: SIP.InviteOptions = {
    media: {
        constraints: { audio: true, video: false },
        stream: new MediaStream(),
        render: { remote: new Element(), local: new Element() },
    },
    anonymous: true,
    rel100: "",
    inviteWithoutSdp: true,
    RTCConstraints: {}
};

session = ua.invite("", inviteOptions);

ua.on('connected', (args: SIP.UA.EventArgs.ConnectedArgs) => { });
ua.on('disconnected', () => { });
ua.on('registered', () => { });
ua.on('unregistered', (args: SIP.UA.EventArgs.UnregisteredArgs) => { });
ua.on('registrationFailed', (args: SIP.UA.EventArgs.RegistrationFailedArgs) => { });
ua.on('invite', (session: SIP.Session) => {
    session.on('progress', (response) => {});
    session.on('accepted', (response) => {});
    session.on('rejected', (response) => {});
});
ua.on('message', (message: SIP.Message) => { });

session.hold({
    extraHeaders: [""],
    eventHandlers: {
        succeeded: () => {}
    }
});

ua.start().stop();


text:
package org.apache.activemq.artemis.api.core;

import java.nio.ByteBuffer;

import io.netty.buffer.Unpooled;
import org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper;

/**
 * Factory class to create instances of {@link ActiveMQBuffer}.
 */
public final class ActiveMQBuffers
{
   /**
    * Creates a self-expanding ActiveMQBuffer with the given initial size
    *
    * @param size the initial size of the created ActiveMQBuffer
    * @return a self-expanding ActiveMQBuffer starting with the given size
    */
   public static ActiveMQBuffer dynamicBuffer(final int size)
   {
      return new ChannelBufferWrapper(Unpooled.buffer(size));
   }

   /**
    * Creates a self-expanding ActiveMQBuffer filled with the given byte array
    *
    * @param bytes the created buffer will be initially filled with this byte array
    * @return a self-expanding ActiveMQBuffer filled with the given byte array
    */
   public static ActiveMQBuffer dynamicBuffer(final byte[] bytes)
   {
      ActiveMQBuffer buff = dynamicBuffer(bytes.length);

      buff.writeBytes(bytes);

      return buff;
   }

   /**
    * Creates a ActiveMQBuffer wrapping an underlying NIO ByteBuffer
    *
    * The position on this buffer won't affect the position on the inner buffer
    *
    * @param underlying the underlying NIO ByteBuffer
    * @return a ActiveMQBuffer wrapping the underlying NIO ByteBuffer
    */
   public static ActiveMQBuffer wrappedBuffer(final ByteBuffer underlying)
   {
      ActiveMQBuffer buff = new ChannelBufferWrapper(Unpooled.wrappedBuffer(underlying));

      buff.clear();

      return buff;
   }

   /**
    * Creates a ActiveMQBuffer wrapping an underlying byte array
    *
    * @param underlying the underlying byte array
    * @return a ActiveMQBuffer wrapping the underlying byte array
    */
   public static ActiveMQBuffer wrappedBuffer(final byte[] underlying)
   {
      return new ChannelBufferWrapper(Unpooled.wrappedBuffer(underlying));
   }

   /**
    * Creates a fixed ActiveMQBuffer of the given size
    *
    * @param size the size of the created ActiveMQBuffer
    * @return a fixed ActiveMQBuffer with the given size
    */
   public static ActiveMQBuffer fixedBuffer(final int size)
   {
      return new ChannelBufferWrapper(Unpooled.buffer(size, size));
   }

   private ActiveMQBuffers()
   {
      // Utility class
   }
}


text:
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jquery.bootstrapvalidator/0.5.1/css/bootstrapValidator.min.css"/>

<?php $this->load->view('templates/menu'); ?>
<?php $this->load->view('templates/banners/adBanner2'); ?>

<?= $user->usr_username ?> Aanpassen

            <form method="post" action="<?php echo site_url('User/editUser/'.$user->usr_id); ?>" id="edit-form">

                    Gebruikersnaam

                        <input type="text" class="form-control" placeholder="gebruikersnaam" value="<?= $user->usr_username ?>" name="gebruikersnaam">

                    gemeente

                        <input type="text" class="form-control" placeholder="gemeente" value="<?= $user->usr_gemeente ?>" name="gemeente">

                    Postcode

                        <input type="text" class="form-control" placeholder="postcode" value="<?= $user->usr_postcode ?>" name="postcode">

                    Adres

                        <input type="text" class="form-control" placeholder="adres" value="<?= $user->usr_adres ?>" name="adres">

                    Telefoonnummer

                        <input type="text" class="form-control" placeholder="telefoonnummer" value="<?= $user->usr_tel ?>" name="tel">

                    BTW

                        <input type="text" class="form-control" placeholder="btw" value="<?= $user->usr_btw ?>" name="btw">

                    Website

                        <input type="text" class="form-control" placeholder="website" value="<?= $user->usr_website ?>" name="website">

                    Vrachtwagens

                        <input type="text" class="form-control" placeholder="aantal vrachtwagens" value="<?php if(!empty($lid->lid_vrachtwagens)){echo $lid->lid_vrachtwagens;} ?>" name="vrachtwagens">

                    Trailers

                        <input type="text" class="form-control" placeholder="aantal trailers" value="<?php if(!empty($lid->lid_trailers)){echo $lid->lid_trailers;} ?>" name="trailers">

                    Aantal km (per maand)

                        <input type="text" class="form-control" placeholder="aantal km (per maand)" value="<?php if(!empty($lid->lid_km)){echo $lid->lid_km;} ?>" name="km">

                    Aantal bediende

                        <input type="text" class="form-control" placeholder="aantal bediende" value="<?php if(!empty($lid->lid_bediende)){echo $lid->lid_bediende;} ?>" name="bediende">

                    Aantal arbeiders

                        <input type="text" class="form-control" placeholder="aantal arbeiders" value="<?php if(!empty($lid->lid_arbeiders)){echo $lid->lid_arbeiders;} ?>" name="arbeiders">

                <button type="submit" class="btn btn-primary "> Opslaan</button>
            </form>


text:
	<title>Дома Москвы</title>
	<meta charset="utf-8">
	<meta property="og:title" content="Дома Москвы"/>
    <meta property="og:type" content="website"/>
    <meta property="og:url" content="http://dom.mithron.me"/>
    <meta property="og:image" content="http://dom.mithron.me/cover.png"/>
    <meta property="og:site_name" content="Дома Москвы"/>
    <meta property="og:description"
         content="Сколько этажей у домов Москвы?"/>

	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />

	<link rel="stylesheet" href="leaflet-sidebar/src/L.Control.Sidebar.css" />

	<link rel="stylesheet" href="Leaflet.loading/src/Control.Loading.css" />

	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">


text:
The following line will allow you to access the Route service from the console. Replace 'Route' with any given
service, and you will be able to interact with it.

```js
angular.element(document.getElementsByTagName('body')).injector().get('Route')
```


text:
class CMDForm {
  getData() {
    let nodeList = document.cmd_form.elements,
      data = new Object();
    for (var i = 0; i < (nodeList.length - 1); i++) {
      data[nodeList[i].name] = nodeList[i].value;
    }
    return data;
  }

  render({
    elem,
    inputs,
    submit,
    action = null,
    method = 'post'
  }) {
    var container,
      wrap,
      div,
      label,
      input,
      button,
      script;

    let form = document.createElement('form');
    form.setAttribute("role", "form");
    form.setAttribute("name", "cmd_form");
    form.setAttribute("id", "cmd_form");
    form.setAttribute("class", "cmd_form");
    form.setAttribute("action", action);
    form.setAttribute("method", method)

    for (var i = 0; i < inputs.length; i++) {
      // preparing children to append
      div = document.createElement('div');
      div.setAttribute("class", "cmd_input-group");
      input = document.createElement('input');
      input.setAttribute("type", inputs[i].type);
      input.setAttribute("name", inputs[i].name);
      input.setAttribute("id", inputs[i].name);
      label = document.createElement('label');
      label.innerHTML = inputs[i].inner;
      label.setAttribute("for", inputs[i].name);
      label.setAttribute("class", "cmd_label");

      // append generated children
      div.appendChild(input);
      div.appendChild(label);
      form.appendChild(div);
    }

    // preparing children to append
    script = document.createElement('script');
    script.setAttribute("src", "assets/app/js/helpers/cmd_form.js");
    container = document.createElement('div');
    container.setAttribute("class", "cmd_form_container");
    wrap = document.createElement('div');
    wrap.className = "wrap";
    wrap.style.width = "100%";
    input = document.createElement('input');
    input.setAttribute("type", "submit");
    input.setAttribute("id", "btn-submit");
    input.setAttribute("value", submit);

    // append generated children
    form.appendChild(input);
    wrap.appendChild(form);
    container.appendChild(wrap);
    container.appendChild(script);
    elem.appendChild(container);
  }
}


text:
namespace IntergalacticTravel.Models.Contracts
{
    public interface INameable
    {
        string Name { get; }
    }
}


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

<title>examples.behavior.world</title>
<meta name="date" content="2017-04-26">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

examples.behavior.world

Classes

Field

WorldMap

Enums

Orientation


text:
C $Header$
C $Name$

C Options file for CheapAML package
C Use this file for selecting options within the CheapAML package

#ifndef CHEAPAML_OPTIONS_H
#define CHEAPAML_OPTIONS_H
#include "PACKAGES_CONFIG.h"
#include "CPP_OPTIONS.h"

#ifdef ALLOW_CHEAPAML
C Place CPP define/undef flag here

C to reproduce old results, with inconsitent wind location,
C  grid-cell center and grid-cell edges (C-grid).
#define INCONSISTENT_WIND_LOCATION

#endif /* ALLOW_CHEAPAML */
#endif /* CHEAPAML_OPTIONS_H */

CEH3 ;;; Local Variables: ***
CEH3 ;;; mode:fortran ***
CEH3 ;;; End: ***


text:
<?php

namespace Phlexible\Component\MediaCache\Worker;

use Phlexible\Component\MediaCache\Domain\CacheItem;
use Phlexible\Component\MediaCache\Model\CacheManagerInterface;
use Phlexible\Component\MediaCache\Storage\StorageManager;
use Phlexible\Component\MediaExtractor\Transmutor;
use Phlexible\Component\MediaTemplate\Applier\ImageTemplateApplier;
use Phlexible\Component\MediaTemplate\Model\ImageTemplate;
use Phlexible\Component\MediaTemplate\Model\TemplateInterface;
use Phlexible\Component\MediaType\Model\MediaType;
use Phlexible\Component\MediaType\Model\MediaTypeManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Filesystem\Filesystem;

/**
 * Image cache worker.
 *
 * @author Stephan Wentz <sw@brainbits.net>
 */
class ImageWorker implements WorkerInterface
{
    use WorkerLogger;

    /**
     * @var StorageManager
     */
    private $storageManager;

    /**
     * @var Transmutor
     */
    private $transmutor;

    /**
     * @var CacheManagerInterface
     */
    private $cacheManager;

    /**
     * @var MediaTypeManagerInterface
     */
    private $mediaTypeManager;

    /**
     * @var ImageTemplateApplier
     */
    private $applier;

    /**
     * @var LoggerInterface
     */
    private $logger;

    /**
     * @var string
     */
    private $tempDir;

    /**
     * @param StorageManager            $storageManager
     * @param Transmutor                $transmutor
     * @param CacheManagerInterface     $cacheManager
     * @param MediaTypeManagerInterface $mediaTypeManager
     * @param ImageTemplateApplier      $applier
     * @param LoggerInterface           $logger
     * @param string                    $tempDir
     */
    public function __construct(
        StorageManager $storageManager,
        Transmutor $transmutor,
        CacheManagerInterface $cacheManager,
        MediaTypeManagerInterface $mediaTypeManager,
        ImageTemplateApplier $applier,
        LoggerInterface $logger,
        $tempDir
    ) {
        $this->storageManager = $storageManager;
        $this->transmutor = $transmutor;
        $this->cacheManager = $cacheManager;
        $this->mediaTypeManager = $mediaTypeManager;
        $this->applier = $applier;
        $this->logger = $logger;
        $this->tempDir = $tempDir;
    }

    /**
     * {@inheritdoc}
     */
    protected function getLogger()
    {
        return $this->logger;
    }

    /**
     * {@inheritdoc}
     */
    public function accept(TemplateInterface $template, InputDescriptor $input, MediaType $mediaType)
    {
        return $template instanceof ImageTemplate;
    }

    /**
     * {@inheritdoc}
     */
    public function process(CacheItem $cacheItem, TemplateInterface $template, InputDescriptor $input, MediaType $mediaType)
    {
        $imageFile = $this->transmutor->transmuteToImage($input);

        $attributes = $input->getFileAttributes();
        $pathinfo = pathinfo($input->getFilePath());

        $cacheItem
            ->setVolumeId($input->getVolumeId())
            ->setFileId($input->getFileId())
            ->setFileVersion($input->getFileVersion())
            ->setMimeType($input->getMimeType())
            ->setMediaType($input->getMediaType())
            ->setExtension(isset($pathinfo['extension']) ? $pathinfo['extension'] : '');

        if ($imageFile !== null && file_exists($imageFile)) {
            // we have a preview image from the asset
            $this->work($cacheItem, $template, $attributes, $imageFile);
        } elseif (!file_exists($input->getFilePath())) {
            // file is completely missing
            $this->work($cacheItem, $template, $attributes, $input->getFilePath(), true);
        } elseif ($imageFile === null) {
            $this->work($cacheItem, $template, $attributes);
        }
    }

    /**
     * Apply template to filename.
     *
     * @param CacheItem     $cacheItem
     * @param ImageTemplate $template
     * @param array         $attributes
     * @param string        $inputFilename
     * @param bool          $missing
     */
    private function work(CacheItem $cacheItem, ImageTemplate $template, array $attributes, $inputFilename = null, $missing = false)
    {
        $cacheFilename = null;

        $tempFilename = $this->tempDir.'/'.$cacheItem->getId().'.'.$template->getParameter('format');

        $cacheItem
            ->setTemplateKey($template->getKey())
            ->setTemplateRevision($template->getRevision())
            ->setCacheStatus(CacheItem::STATUS_DELEGATE)
            ->setQueueStatus(CacheItem::QUEUE_DONE)
            ->setFileSize(0)
            ->setError(null);

        if ($missing) {
            $this->applyError(
                $cacheItem,
                CacheItem::STATUS_MISSING,
                'Input file not found.',
                $inputFilename,
                $template->getType(),
                $template->getKey()
            );
        } elseif ($inputFilename === null) {
            $this->applyError(
                $cacheItem,
                CacheItem::STATUS_DELEGATE,
                'No preview image.',
                $inputFilename,
                $template->getType(),
                $template->getKey(),
                'warning'
            );
        } elseif (!$this->applier->isAvailable($inputFilename)) {
            $this->applyError(
                $cacheItem,
                CacheItem::STATUS_MISSING,
                'No suitable image template applier found.',
                $inputFilename,
                $template->getType(),
                $template->getKey()
            );
        } else {
            $filesystem = new Filesystem();
            if (!$filesystem->exists($this->tempDir)) {
                $filesystem->mkdir($this->tempDir, 0777);
            }
            if ($filesystem->exists($tempFilename)) {
                $filesystem->remove($tempFilename);
            }

            try {
                $image = $this->applier->apply($template, $attributes, $inputFilename, $tempFilename);

                $filesystem->chmod($tempFilename, 0777);

                $mediaType = $this->mediaTypeManager->findByFilename($tempFilename);

                $cacheItem
                    ->setCacheStatus(CacheItem::STATUS_OK)
                    ->setQueueStatus(CacheItem::QUEUE_DONE)
                    ->setMimeType($mediaType->getMimetype())
                    ->setMediaType($mediaType->getName())
                    ->setExtension(pathinfo($tempFilename, PATHINFO_EXTENSION))
                    ->setFileSize(filesize($tempFilename))
                    ->setWidth($image->getSize()->getWidth())
                    ->setHeight($image->getSize()->getHeight())
                    ->setFinishedAt(new \DateTime());
            } catch (\Exception $e) {
                $this->logger->error('Image worker error', array('exception' => $e, 'template' => $template->getId(), 'file' => $cacheItem->getFileId()));

                $cacheItem
                    ->setCacheStatus(CacheItem::STATUS_ERROR)
                    ->setQueueStatus(CacheItem::QUEUE_ERROR)
                    ->setError($e)
                    ->setFinishedAt(new \DateTime());
            }

            if ($cacheItem->getCacheStatus() === CacheItem::STATUS_OK) {
                $storage = $this->storageManager->get($template->getStorage());
                $storage->store($cacheItem, $tempFilename);
            }
        }

        $this->cacheManager->updateCacheItem($cacheItem);
    }
}


text:
/* $XConsortium: SimpleMenu.c,v 1.44 94/04/17 20:12:45 kaleb Exp $ */
/* MODIFIED FOR N*XTSTEP LOOK	 				*/
/* Modifications Copyright (c) 1996 by Alfredo Kojima		*/
/***********************************************************/

/*
Copyright (c) 1989, 1994  X Consortium

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
 */

/* $XFree86: xc/lib/Xaw/SimpleMenu.c,v 3.1.6.3 1998/05/20 05:06:17 dawes Exp $ */

/*
 * SimpleMenu.c - Source code file for SimpleMenu widget.
 *
 * Date:    April 3, 1989
 *
 * By:      Chris D. Peterson
 *          MIT X Consortium
 *          kit@expo.lcs.mit.edu
 */

#include <stdio.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>

#include "XawInit.h"
#include "SimpleMenP.h"
#include "SmeBSB.h"
#include "Cardinals.h"
#include "ThreeDP.h"
#include "Misc.h"

#include <X11/Xmu/Initer.h>
#include <X11/Xmu/CharSet.h>

#include "XawAlloc.h"

#define streq(a, b)        ( strcmp((a), (b)) == 0 )

#define offset(field) XtOffsetOf(SimpleMenuRec, simple_menu.field)

static XtResource resources[] = {

/*
 * Label Resources.
 */

  {XtNlabel,  XtCLabel, XtRString, sizeof(String),
     offset(label_string), XtRString, NULL},
  {XtNlabelClass,  XtCLabelClass, XtRPointer, sizeof(WidgetClass),
     offset(label_class), XtRImmediate, (XtPointer) NULL},

/*
 * Layout Resources.
 */

  {XtNrowHeight,  XtCRowHeight, XtRDimension, sizeof(Dimension),
     offset(row_height), XtRImmediate, (XtPointer) 0},
  {XtNtopMargin,  XtCVerticalMargins, XtRDimension, sizeof(Dimension),
     offset(top_margin), XtRImmediate, (XtPointer) 0},
  {XtNbottomMargin,  XtCVerticalMargins, XtRDimension, sizeof(Dimension),
     offset(bottom_margin), XtRImmediate, (XtPointer) 0},

/*
 * Misc. Resources
 */

  { XtNallowShellResize, XtCAllowShellResize, XtRBoolean, sizeof(Boolean),
      XtOffsetOf(SimpleMenuRec, shell.allow_shell_resize),
      XtRImmediate, (XtPointer) TRUE },
  {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
      offset(cursor), XtRImmediate, (XtPointer) None},
  {XtNmenuOnScreen,  XtCMenuOnScreen, XtRBoolean, sizeof(Boolean),
      offset(menu_on_screen), XtRImmediate, (XtPointer) TRUE},
  {XtNpopupOnEntry,  XtCPopupOnEntry, XtRWidget, sizeof(Widget),
      offset(popup_entry), XtRWidget, NULL},
  {XtNbackingStore, XtCBackingStore, XtRBackingStore, sizeof (int),
      offset(backing_store),
      XtRImmediate, (XtPointer) (Always + WhenMapped + NotUseful)},
};
#undef offset

static char defaultTranslations[] =
    ":<EnterWindow>:     highlight()             \n\
     :<LeaveWindow>:     unhighlight()           \n\
     :<BtnMotion>:       highlight()             \n\
     :<BtnUp>:           MenuPopdown() notify() unhighlight()";

/*
 * Semi Public function definitions.
 */

static void Redisplay(), Realize(), Resize(), ChangeManaged();
static void Initialize(), ClassInitialize(), ClassPartInitialize();
static Boolean SetValues(), SetValuesHook();
static XtGeometryResult GeometryManager();

/*
 * Action Routine Definitions
 */

static void Highlight(), Unhighlight(), Notify(), PositionMenuAction();

/*
 * Private Function Definitions.
 */

static void MakeSetValuesRequest(), CreateLabel(), Layout();
static void AddPositionAction(), PositionMenu(), ChangeCursorOnGrab();
static Dimension GetMenuWidth(), GetMenuHeight();
static Widget FindMenu();
static SmeObject GetEventEntry();
static void MoveMenu();

static XtActionsRec actionsList[] =
{
  {"notify",            Notify},
  {"highlight",         Highlight},
  {"unhighlight",       Unhighlight},
};

static CompositeClassExtensionRec extension_rec = {
    /* next_extension */  NULL,
    /* record_type */     NULLQUARK,
    /* version */         XtCompositeExtensionVersion,
    /* record_size */     sizeof(CompositeClassExtensionRec),
    /* accepts_objects */ TRUE,
};

#define superclass (&overrideShellClassRec)

SimpleMenuClassRec simpleMenuClassRec = {
  {
    /* superclass         */    (WidgetClass) superclass,
    /* class_name         */    "SimpleMenu",
    /* size               */    sizeof(SimpleMenuRec),
    /* class_initialize   */	ClassInitialize,
    /* class_part_initialize*/	ClassPartInitialize,
    /* Class init'ed      */	FALSE,
    /* initialize         */    Initialize,
    /* initialize_hook    */	NULL,
    /* realize            */    Realize,
    /* actions            */    actionsList,
    /* num_actions        */    XtNumber(actionsList),
    /* resources          */    resources,
    /* resource_count     */	XtNumber(resources),
    /* xrm_class          */    NULLQUARK,
    /* compress_motion    */    TRUE,
    /* compress_exposure  */    TRUE,
    /* compress_enterleave*/ 	TRUE,
    /* visible_interest   */    FALSE,
    /* destroy            */    NULL,
    /* resize             */    Resize,
    /* expose             */    Redisplay,
    /* set_values         */    SetValues,
    /* set_values_hook    */	SetValuesHook,
    /* set_values_almost  */	XtInheritSetValuesAlmost,
    /* get_values_hook    */	NULL,
    /* accept_focus       */    NULL,
    /* intrinsics version */	XtVersion,
    /* callback offsets   */    NULL,
    /* tm_table		  */    defaultTranslations,
    /* query_geometry	  */    NULL,
    /* display_accelerator*/    NULL,
    /* extension	  */    NULL
  },{
    /* geometry_manager   */    GeometryManager,
    /* change_managed     */    ChangeManaged,
    /* insert_child	  */	XtInheritInsertChild,
    /* delete_child	  */	XtInheritDeleteChild,
    /* extension	  */    NULL
  },{
    /* Shell extension	  */    NULL
  },{
    /* Override extension */    NULL
  },{
    /* Simple Menu extension*/  NULL
  }
};

WidgetClass simpleMenuWidgetClass = (WidgetClass)&simpleMenuClassRec;

#define ForAllChildren(smw, childP) \
  for ( (childP) = (SmeObject *) (smw)->composite.children ; \
        (childP) < (SmeObject *) ( (smw)->composite.children + \
				 (smw)->composite.num_children ) ; \
        (childP)++ )

/************************************************************
 *
 * Semi-Public Functions.
 *
 ************************************************************/

/*      Function Name: ClassInitialize
 *      Description: Class Initialize routine, called only once.
 *      Arguments: none.
 *      Returns: none.
 */

static void
ClassInitialize()
{
  XawInitializeWidgetSet();
  XtAddConverter( XtRString, XtRBackingStore, XmuCvtStringToBackingStore,
		 (XtConvertArgList)NULL, (Cardinal)0 );
  XmuAddInitializer( AddPositionAction, NULL);
}

/*      Function Name: ClassInitialize
 *      Description: Class Part Initialize routine, called for every
 *                   subclass.  Makes sure that the subclasses pick up
 *                   the extension record.
 *      Arguments: wc - the widget class of the subclass.
 *      Returns: none.
 */

static void
ClassPartInitialize(wc)
WidgetClass wc;
{
    SimpleMenuWidgetClass smwc = (SimpleMenuWidgetClass) wc;

/*
 * Make sure that our subclass gets the extension rec too.
 */

    extension_rec.next_extension = smwc->composite_class.extension;
    smwc->composite_class.extension = (XtPointer) &extension_rec;
}

/*      Function Name: Initialize
 *      Description: Initializes the simple menu widget
 *      Arguments: request - the widget requested by the argument list.
 *                 new     - the new widget with both resource and non
 *                           resource values.
 *      Returns: none.
 */

/* ARGSUSED */
static void
Initialize(request, new, args, num_args)
Widget request, new;
ArgList args;
Cardinal *num_args;
{
  SimpleMenuWidget smw = (SimpleMenuWidget) new;

  XmuCallInitializers(XtWidgetToApplicationContext(new));

  if (smw->simple_menu.label_class == NULL)
      smw->simple_menu.label_class = smeBSBObjectClass;

  smw->simple_menu.label = NULL;
  smw->simple_menu.entry_set = NULL;
  smw->simple_menu.recursive_set_values = FALSE;
  smw->simple_menu.first_entry = NULL;
  smw->simple_menu.current_first = NULL;
  smw->simple_menu.first_y = 0;

  if (smw->simple_menu.label_string != NULL)
      CreateLabel(new);

  smw->simple_menu.menu_width = TRUE;

  if (smw->core.width == 0) {
      smw->simple_menu.menu_width = FALSE;
      smw->core.width = GetMenuWidth(new, (Widget)NULL);
  }

  smw->simple_menu.menu_height = TRUE;

  if (smw->core.height == 0) {
      smw->simple_menu.menu_height = FALSE;
      smw->core.height = GetMenuHeight(new);
  }
  smw->simple_menu.threeD=XtVaCreateWidget("threeD",threeDWidgetClass,new,
				  XtNx, 0, XtNy, 0,
				  XtNwidth, 10, XtNheight, 10, /* dummy */
				  NULL);

/*
 * Add a popup_callback routine for changing the cursor.
 */

  XtAddCallback(new, XtNpopupCallback, ChangeCursorOnGrab, (XtPointer)NULL);
}

/*      Function Name: Redisplay
 *      Description: Redisplays the contents of the widget.
 *      Arguments: w - the simple menu widget.
 *                 event - the X event that caused this redisplay.
 *                 region - the region the needs to be repainted.
 *      Returns: none.
 */

/* ARGSUSED */
static void
Redisplay(w, event, region)
Widget w;
XEvent * event;
Region region;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    SmeObject * entry;
    SmeObjectClass class;
    ThreeDWidget tdw = (ThreeDWidget)smw->simple_menu.threeD;
    Display *dpy = XtDisplay(w);
    Window win = XtWindow(w);
    int y, max_y;
    int new_y;
    int s = tdw->threeD.shadow_width;
    Boolean can_paint;

    if (region == NULL)
	XClearWindow(dpy, win);

    /*
     * Check and Paint each of the entries - including the label.
     */
    if (XtIsRealized((Widget)smw)) {
	neXtawDrawShadowBox((Widget)smw,tdw,0,0,smw->core.width,
			    smw->core.height,True);
    }
    smw->simple_menu.didnt_fit = False;
    y=0;
    max_y = HeightOfScreen(XtScreen(w))-s;
    new_y = -(*(SmeObject *) (smw)->composite.children)->rectangle.y;
    can_paint = False;
    ForAllChildren(smw, entry) {
	RectObjPart old_pos;
	int dy=0;

	if (!XtIsManaged ( (Widget) *entry)) continue;
	if (smw->simple_menu.first_entry==NULL) {
	    smw->simple_menu.first_entry=entry;
	    smw->simple_menu.current_first=entry;
	}

	if (smw->simple_menu.too_tall) {
	    if (entry==(smw->simple_menu.current_first)) {
		new_y = (*entry)->rectangle.y-1;
		if (smw->simple_menu.current_first!=smw->simple_menu.first_entry) {
		    XPoint point[3];

		    point[0].x = (*entry)->rectangle.width/2;
		    point[0].y = s+1;
		    point[1].x = (*entry)->rectangle.width/2-4;
		    point[1].y = s+8;
		    point[2].x = (*entry)->rectangle.width/2+4;
		    point[2].y = s+8;
		    XFillPolygon(XtDisplay(w), smw->core.window,
				 tdw->threeD.bot_half_shadow_GC, point, 3, Convex,
				 CoordModeOrigin);
		    new_y -= 8;
		    dy = 8;
		}
		smw->simple_menu.first_y = new_y;
		can_paint = True;
	    } else if (!can_paint) {
		continue;
	    }
	    old_pos = (*entry)->rectangle;
	    (*entry)->rectangle.y -= new_y;
	    if ((*entry)->rectangle.y+(*entry)->rectangle.height+dy > max_y) {
		XPoint point[3];

		smw->simple_menu.last_y = (*entry)->rectangle.y;
		point[0].x = (*entry)->rectangle.width/2;
		point[0].y = max_y-1;
		point[1].x = (*entry)->rectangle.width/2-4;
		point[1].y = max_y-8;
		point[2].x = (*entry)->rectangle.width/2+4;
		point[2].y = max_y-8;
		XFillPolygon(XtDisplay(w), smw->core.window,
			     tdw->threeD.bot_half_shadow_GC, point, 3, Convex,
			     CoordModeOrigin);
		smw->simple_menu.didnt_fit = True;
		(*entry)->rectangle = old_pos;
		break;
	    }
	}
	/*
	if (region != NULL)
	    switch(XRectInRegion(region, (int) (*entry)->rectangle.x,
				 (int) (*entry)->rectangle.y,
				 (unsigned int) (*entry)->rectangle.width,
				 (unsigned int) (*entry)->rectangle.height)) {
	    case RectangleIn:
	    case RectanglePart:
		break;
	    default:
		continue;
	    }
	 */
	class = (SmeObjectClass) (*entry)->object.widget_class;

	if (class->rect_class.expose != NULL)
	    (class->rect_class.expose)( (Widget) *entry, NULL, NULL);
	if (smw->simple_menu.too_tall)
	  (*entry)->rectangle = old_pos;
#ifndef NO_MENU_LINES
	x = 0;
	xf = smw->core.width;
	if (y>0) {
	    XDrawLine(dpy,win,tdw->threeD.top_half_shadow_GC,x,y+3,xf,y+3);
	    XDrawLine(dpy,win,tdw->threeD.bot_shadow_GC,x,y+1,xf,y+1);
	    XDrawLine(dpy,win,tdw->threeD.bot_half_shadow_GC,x,y+2,xf,y+2);
	}
#endif
	y += (*entry)->rectangle.height;
    }
}

/*      Function Name: Realize
 *      Description: Realizes the widget.
 *      Arguments: w - the simple menu widget.
 *                 mask - value mask for the window to create.
 *                 attrs - attributes for the window to create.
 *      Returns: none
 */

static void
Realize(w, mask, attrs)
Widget w;
XtValueMask * mask;
XSetWindowAttributes * attrs;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;

    attrs->cursor = smw->simple_menu.cursor;
    *mask |= CWCursor;
    if ((smw->simple_menu.backing_store == Always) ||
	(smw->simple_menu.backing_store == NotUseful) ||
	(smw->simple_menu.backing_store == WhenMapped) ) {
	*mask |= CWBackingStore;
	attrs->backing_store = smw->simple_menu.backing_store;
    }
    else
	*mask &= ~CWBackingStore;
  /* check if the menu is too big */
  if (smw->core.height>=HeightOfScreen(XtScreen(w))) {
      smw->simple_menu.too_tall = True;
      smw->core.height = HeightOfScreen(XtScreen(w))-1;
  }

    (*superclass->core_class.realize) (w, mask, attrs);
}

/*      Function Name: Resize
 *      Description: Handle the menu being resized bigger.
 *      Arguments: w - the simple menu widget.
 *      Returns: none.
 */

static void
Resize(w)
Widget w;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    ThreeDWidget tdw = (ThreeDWidget) smw->simple_menu.threeD;
    SmeObject * entry;

    if ( !XtIsRealized(w) ) return;
    ForAllChildren(smw, entry) 	/* reset width of all entries. */
	if (XtIsManaged( (Widget) *entry))
	    (*entry)->rectangle.width = smw->core.width-2*tdw->threeD.shadow_width;

    Redisplay(w, (XEvent *) NULL, (Region) NULL);
}

/*      Function Name: SetValues
 *      Description: Relayout the menu when one of the resources is changed.
 *      Arguments: current - current state of the widget.
 *                 request - what was requested.
 *                 new - what the widget will become.
 *      Returns: none
 */

/* ARGSUSED */
static Boolean
SetValues(current, request, new, args, num_args)
Widget current, request, new;
ArgList args;
Cardinal *num_args;
{
    SimpleMenuWidget smw_old = (SimpleMenuWidget) current;
    SimpleMenuWidget smw_new = (SimpleMenuWidget) new;
    Boolean ret_val = FALSE, layout = FALSE;

    if (!XtIsRealized(current)) return(FALSE);

    if (!smw_new->simple_menu.recursive_set_values) {
	if (smw_new->core.width != smw_old->core.width) {
	    smw_new->simple_menu.menu_width = (smw_new->core.width != 0);
	    layout = TRUE;
	}
	if (smw_new->core.height != smw_old->core.height) {
	    smw_new->simple_menu.menu_height = (smw_new->core.height != 0);
	    layout = TRUE;
	}
    }

    if (smw_old->simple_menu.cursor != smw_new->simple_menu.cursor)
	XDefineCursor(XtDisplay(new),
		      XtWindow(new), smw_new->simple_menu.cursor);

    if (smw_old->simple_menu.label_string !=smw_new->simple_menu.label_string) {
	if (smw_new->simple_menu.label_string == NULL)         /* Destroy. */
	    XtDestroyWidget((Widget) smw_old->simple_menu.label);
	else if (smw_old->simple_menu.label_string == NULL)    /* Create. */
	    CreateLabel(new);
	else {                                                 /* Change. */
	    Arg arglist[1];

	    XtSetArg(arglist[0], XtNlabel, smw_new->simple_menu.label_string);
	    XtSetValues((Widget) smw_new->simple_menu.label, arglist, ONE);
	}
    }

    if (smw_old->simple_menu.label_class != smw_new->simple_menu.label_class)
	XtAppWarning(XtWidgetToApplicationContext(new),
		     "No Dynamic class change of the SimpleMenu Label.");

    if ((smw_old->simple_menu.top_margin != smw_new->simple_menu.top_margin) ||
	(smw_old->simple_menu.bottom_margin !=
	 smw_new->simple_menu.bottom_margin) /* filler.................  */ ) {
	layout = TRUE;
	ret_val = TRUE;
    }

    if (layout)
	Layout(new, (Dimension *)NULL, (Dimension *)NULL);

    return(ret_val);
}

/*      Function Name: SetValuesHook
 *      Description: To handle a special case, this is passed the
 *                   actual arguments.
 *      Arguments: w - the menu widget.
 *                 arglist - the argument list passed to XtSetValues.
 *                 num_args - the number of args.
 *      Returns: none
 */

/*
 * If the user actually passed a width and height to the widget
 * then this MUST be used, rather than our newly calculated width and
 * height.
 */

static Boolean
SetValuesHook(w, arglist, num_args)
Widget w;
ArgList arglist;
Cardinal *num_args;
{
    Cardinal i;
    Dimension width, height;

    width = w->core.width;
    height = w->core.height;

    for ( i = 0 ; i < *num_args ; i++) {
	if ( streq(arglist[i].name, XtNwidth) )
	    width = (Dimension) arglist[i].value;
	if ( streq(arglist[i].name, XtNheight) )
	    height = (Dimension) arglist[i].value;
    }

    if ((width != w->core.width) || (height != w->core.height))
	MakeSetValuesRequest(w, width, height);
    return(FALSE);
}

/************************************************************
 *
 * Geometry Management routines.
 *
 ************************************************************/

/*	Function Name: GeometryManager
 *	Description: This is the SimpleMenu Widget's Geometry Manager.
 *	Arguments: w - the Menu Entry making the request.
 *                 request - requested new geometry.
 *                 reply - the allowed geometry.
 *	Returns: XtGeometry{Yes, No, Almost}.
 */

static XtGeometryResult
GeometryManager(w, request, reply)
Widget w;
XtWidgetGeometry * request, * reply;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) XtParent(w);
    SmeObject entry = (SmeObject) w;
    XtGeometryMask mode = request->request_mode;
    XtGeometryResult answer;
    Dimension old_height, old_width;

    if ( !(mode & CWWidth) && !(mode & CWHeight) )
	return(XtGeometryNo);

    reply->width = request->width;
    reply->height = request->height;

    old_width = entry->rectangle.width;
    old_height = entry->rectangle.height;

    Layout(w, &(reply->width), &(reply->height) );

/*
 * Since we are an override shell and have no parent there is no one to
 * ask to see if this geom change is okay, so I am just going to assume
 * we can do whatever we want.  If you subclass be very careful with this
 * assumption, it could bite you.
 *
 * Chris D. Peterson - Sept. 1989.
 */

    if ( (reply->width == request->width) &&
	 (reply->height == request->height) ) {

	if ( mode & XtCWQueryOnly ) { /* Actually perform the layout. */
	    entry->rectangle.width = old_width;
	    entry->rectangle.height = old_height;
	}
	else {
	    Layout(( Widget) smw, (Dimension *)NULL, (Dimension *)NULL);
	}
	answer = XtGeometryDone;
    }
    else {
	entry->rectangle.width = old_width;
	entry->rectangle.height = old_height;

	if ( ((reply->width == request->width) && !(mode & CWHeight)) ||
	      ((reply->height == request->height) && !(mode & CWWidth)) ||
	      ((reply->width == request->width) &&
	       (reply->height == request->height)) )
	    answer = XtGeometryNo;
	else {
	    answer = XtGeometryAlmost;
	    reply->request_mode = 0;
	    if (reply->width != request->width)
		reply->request_mode |= CWWidth;
	    if (reply->height != request->height)
		reply->request_mode |= CWHeight;
	}
    }
    return(answer);
}

/*	Function Name: ChangeManaged
 *	Description: called whenever a new child is managed.
 *	Arguments: w - the simple menu widget.
 *	Returns: none.
 */

static void
ChangeManaged(w)
Widget w;
{
    Layout(w, (Dimension *)NULL, (Dimension *)NULL);
}

/************************************************************
 *
 * Global Action Routines.
 *
 * These actions routines will be added to the application's
 * global action list.
 *
 ************************************************************/

/*      Function Name: PositionMenuAction
 *      Description: Positions the simple menu widget.
 *      Arguments: w - a widget (no the simple menu widget.)
 *                 event - the event that caused this action.
 *                 params, num_params - parameters passed to the routine.
 *                                      we expect the name of the menu here.
 *      Returns: none
 */

/* ARGSUSED */
static void
PositionMenuAction(w, event, params, num_params)
Widget w;
XEvent * event;
String * params;
Cardinal * num_params;
{
  Widget menu;
  XPoint loc;

  if (*num_params != 1) {
    char error_buf[BUFSIZ];
    (void) sprintf(error_buf, "%s %s",
	    "Xaw - SimpleMenuWidget: position menu action expects only one",
	    "parameter which is the name of the menu.");
    XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
    return;
  }

  if ( (menu = FindMenu(w, params[0])) == NULL) {
    char error_buf[BUFSIZ];
    char *err1 = "Xaw - SimpleMenuWidget: could not find menu named: ";
    char *perr;
    int len;

    len = strlen(err1) + strlen(params[0]) + 2 + 1;
    perr = XtStackAlloc(len, error_buf);
    if (perr == NULL)
	return;
    sprintf(perr, "%s'%s'", err1, params[0]);
    XtAppWarning(XtWidgetToApplicationContext(w), perr);
    XtStackFree(perr, error_buf);
    return;
  }

  switch (event->type) {
  case ButtonPress:
  case ButtonRelease:
    loc.x = event->xbutton.x_root;
    loc.y = event->xbutton.y_root;
    PositionMenu(menu, &loc);
    break;
  case EnterNotify:
  case LeaveNotify:
    loc.x = event->xcrossing.x_root;
    loc.y = event->xcrossing.y_root;
    PositionMenu(menu, &loc);
    break;
  case MotionNotify:
    loc.x = event->xmotion.x_root;
    loc.y = event->xmotion.y_root;
    PositionMenu(menu, &loc);
    break;
  default:
    PositionMenu(menu, (XPoint *)NULL);
    break;
  }
}

/************************************************************
 *
 * Widget Action Routines.
 *
 ************************************************************/

/*      Function Name: Unhighlight
 *      Description: Unhighlights current entry.
 *      Arguments: w - the simple menu widget.
 *                 event - the event that caused this action.
 *                 params, num_params - ** NOT USED **
 *      Returns: none
 */

/* ARGSUSED */
static void
Unhighlight(w, event, params, num_params)
Widget w;
XEvent * event;
String * params;
Cardinal * num_params;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    SmeObject entry = smw->simple_menu.entry_set;
    SmeObjectClass class;
    int old_pos;

    if ( entry == NULL) return;

    /* backup original position of the entry */
    old_pos = entry->rectangle.y;
    entry->rectangle.y -= smw->simple_menu.first_y;

    smw->simple_menu.entry_set = NULL;
    class = (SmeObjectClass) entry->object.widget_class;
    (class->sme_class.unhighlight) ( (Widget) entry);

    entry->rectangle.y = old_pos;
}

/*      Function Name: Highlight
 *      Description: Highlights current entry.
 *      Arguments: w - the simple menu widget.
 *                 event - the event that caused this action.
 *                 params, num_params - ** NOT USED **
 *      Returns: none
 */

/* ARGSUSED */
static void
Highlight(w, event, params, num_params)
Widget w;
XEvent * event;
String * params;
Cardinal * num_params;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    SmeObject entry;
    SmeObjectClass class;
    int old_pos;

    if ( !XtIsSensitive(w) ) return;

    entry = GetEventEntry(w, event);

    if (entry == smw->simple_menu.entry_set) return;

    Unhighlight(w, event, params, num_params);

    if (entry == NULL) return;

    if ( !XtIsSensitive( (Widget) entry)) {
	smw->simple_menu.entry_set = NULL;
	return;
    }

    /* backup original position of the entry */
    old_pos = entry->rectangle.y;
    entry->rectangle.y -= smw->simple_menu.first_y;

    smw->simple_menu.entry_set = entry;
    class = (SmeObjectClass) entry->object.widget_class;

    (class->sme_class.highlight) ( (Widget) entry);
    entry->rectangle.y = old_pos;
}

/*      Function Name: Notify
 *      Description: Notify user of current entry.
 *      Arguments: w - the simple menu widget.
 *                 event - the event that caused this action.
 *                 params, num_params - ** NOT USED **
 *      Returns: none
 */

/* ARGSUSED */
static void
Notify(w, event, params, num_params)
Widget w;
XEvent * event;
String * params;
Cardinal * num_params;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    SmeObject entry = smw->simple_menu.entry_set;
    SmeObjectClass class;

    if ( (entry == NULL) || !XtIsSensitive((Widget) entry ) ) return;

    class = (SmeObjectClass) entry->object.widget_class;
    (class->sme_class.notify)( (Widget) entry );
}

/************************************************************
 *
 * Public Functions.
 *
 ************************************************************/

/*	Function Name: XawSimpleMenuAddGlobalActions
 *	Description: adds the global actions to the simple menu widget.
 *	Arguments: app_con - the appcontext.
 *	Returns: none.
 */

void
#if NeedFunctionPrototypes
XawSimpleMenuAddGlobalActions(XtAppContext app_con)
#else
XawSimpleMenuAddGlobalActions(app_con)
XtAppContext app_con;
#endif
{
    XtInitializeWidgetClass(simpleMenuWidgetClass);
    XmuCallInitializers( app_con );
}

/*	Function Name: XawSimpleMenuGetActiveEntry
 *	Description: Gets the currently active (set) entry.
 *	Arguments: w - the smw widget.
 *	Returns: the currently set entry or NULL if none is set.
 */

Widget
#if NeedFunctionPrototypes
XawSimpleMenuGetActiveEntry(Widget w)
#else
XawSimpleMenuGetActiveEntry(w)
Widget w;
#endif
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;

    return( (Widget) smw->simple_menu.entry_set);
}

/*	Function Name: XawSimpleMenuClearActiveEntry
 *	Description: Unsets the currently active (set) entry.
 *	Arguments: w - the smw widget.
 *	Returns: none.
 */

void
#if NeedFunctionPrototypes
XawSimpleMenuClearActiveEntry(Widget w)
#else
XawSimpleMenuClearActiveEntry(w)
Widget w;
#endif
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;

    smw->simple_menu.entry_set = NULL;
}

/************************************************************
 *
 * Private Functions.
 *
 ************************************************************/

/*	Function Name: CreateLabel
 *	Description: Creates a the menu label.
 *	Arguments: w - the smw widget.
 *	Returns: none.
 *
 * Creates the label object and makes sure it is the first child in
 * in the list.
 */

static void
CreateLabel(w)
Widget w;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    Widget * child, * next_child;
    int i;
    Arg args[2];

    if ( (smw->simple_menu.label_string == NULL) ||
	 (smw->simple_menu.label != NULL) ) {
	char error_buf[BUFSIZ];

	(void) sprintf(error_buf, "Xaw Simple Menu Widget: %s or %s, %s",
		"label string is NULL", "label already exists",
		"no label is being created.");
	XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
	return;
    }

    XtSetArg(args[0], XtNlabel, smw->simple_menu.label_string);
    XtSetArg(args[1], XtNjustify, XtJustifyLeft);
    smw->simple_menu.label = (SmeObject)
	                      XtCreateManagedWidget("menuLabel",
					    smw->simple_menu.label_class, w,
					    args, TWO);

    next_child = NULL;
    for (child = smw->composite.children + smw->composite.num_children,
	 i = smw->composite.num_children ; i > 0 ; i--, child--) {
	if (next_child != NULL)
	    *next_child = *child;
	next_child = child;
    }
    *child = (Widget) smw->simple_menu.label;
}

/*	Function Name: Layout
 *	Description: lays the menu entries out all nice and neat.
 *	Arguments: w - See below (+++)
 *                 width_ret, height_ret - The returned width and
 *                                         height values.
 *	Returns: none.
 *
 * if width == NULL || height == NULL then it assumes the you do not care
 * about the return values, and just want a relayout.
 *
 * if this is not the case then it will set width_ret and height_ret
 * to be width and height that the child would get if it were layed out
 * at this time.
 *
 * +++ "w" can be the simple menu widget or any of its object children.
 */

static void
Layout(w, width_ret, height_ret)
Widget w;
Dimension *width_ret, *height_ret;
{
    SmeObject current_entry, *entry;
    SimpleMenuWidget smw;
    Dimension width, height;
    Boolean do_layout = ((height_ret == NULL) || (width_ret == NULL));
    Boolean allow_change_size;
    ThreeDWidget tdw;
    Dimension s;
    height = 0;

    if ( XtIsSubclass(w, simpleMenuWidgetClass) ) {
	smw = (SimpleMenuWidget) w;
	current_entry = NULL;
    }
    else {
	smw = (SimpleMenuWidget) XtParent(w);
	current_entry = (SmeObject) w;
    }

    tdw = (ThreeDWidget)smw->simple_menu.threeD;
    s = tdw->threeD.shadow_width;

    allow_change_size = (!XtIsRealized((Widget)smw) ||
			 (smw->shell.allow_shell_resize));

    if ( smw->simple_menu.menu_height )
	height = smw->core.height;
    else
	if (do_layout) {
	    height = smw->simple_menu.top_margin+s;
	    ForAllChildren(smw, entry) {
		if (!XtIsManaged( (Widget) *entry)) continue;

		if ( (smw->simple_menu.row_height != 0) &&
		    (*entry != smw->simple_menu.label) )
		    (*entry)->rectangle.height = smw->simple_menu.row_height;

		(*entry)->rectangle.y = height;
		(*entry)->rectangle.x = s;
		height += (*entry)->rectangle.height;
	    }
	    height += smw->simple_menu.bottom_margin+s;
	}
	else {
	    if ((smw->simple_menu.row_height != 0) &&
		(current_entry != smw->simple_menu.label) )
		height = smw->simple_menu.row_height;
	}

    if (smw->simple_menu.menu_width)
	width = smw->core.width;
    else if ( allow_change_size )
	width = GetMenuWidth((Widget) smw, (Widget) current_entry) + 2*s;
    else
	width = smw->core.width;
    if (do_layout) {
	ForAllChildren(smw, entry) {
	    if (XtIsManaged( (Widget) *entry))
		(*entry)->rectangle.width = width - 2*s;
	}

	if (allow_change_size)
	    MakeSetValuesRequest((Widget) smw, width, height);
    }
    else {
	*width_ret = width;
	if (height != 0)
	    *height_ret = height;
    }
}

/*	Function Name: AddPositionAction
 *	Description: Adds the XawPositionSimpleMenu action to the global
 *                   action list for this appcon.
 *	Arguments: app_con - the application context for this app.
 *                 data - NOT USED.
 *	Returns: none.
 */

/* ARGSUSED */
static void
AddPositionAction(app_con, data)
XtAppContext app_con;
XPointer data;
{
    static XtActionsRec pos_action[] = {
        { "XawPositionSimpleMenu", PositionMenuAction },
    };

    XtAppAddActions(app_con, pos_action, XtNumber(pos_action));
}

/*	Function Name: FindMenu
 *	Description: Find the menu give a name and reference widget.
 *	Arguments: widget - reference widget.
 *                 name   - the menu widget's name.
 *	Returns: the menu widget or NULL.
 */

static Widget
FindMenu(widget, name)
Widget widget;
String name;
{
    Widget w, menu;

    for ( w = widget ; w != NULL ; w = XtParent(w) )
	if ( (menu = XtNameToWidget(w, name)) != NULL )
	    return(menu);
    return(NULL);
}

/*	Function Name: PositionMenu
 *	Description: Places the menu
 *	Arguments: w - the simple menu widget.
 *                 location - a pointer the the position or NULL.
 *	Returns: none.
 */

static void
PositionMenu(w, location)
Widget w;
XPoint * location;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    SmeObject entry;
    XPoint t_point;

    if (location == NULL) {
	Window junk1, junk2;
	int root_x, root_y, junkX, junkY;
	unsigned int junkM;

	location = &t_point;
	if (XQueryPointer(XtDisplay(w), XtWindow(w), &junk1, &junk2,
			  &root_x, &root_y, &junkX, &junkY, &junkM) == FALSE) {
	    char error_buf[BUFSIZ];
	    (void) sprintf(error_buf, "%s %s", "Xaw Simple Menu Widget:",
		    "Could not find location of mouse pointer");
	    XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
	    return;
	}
	location->x = (short) root_x;
	location->y = (short) root_y;
    }

    /*
     * The width will not be correct unless it is realized.
     */

    XtRealizeWidget(w);

    location->x -= (Position) w->core.width/2;

    if (smw->simple_menu.popup_entry == NULL)
	entry = smw->simple_menu.label;
    else
	entry = smw->simple_menu.popup_entry;

    if (entry != NULL)
	location->y -= entry->rectangle.y + entry->rectangle.height/2;

    MoveMenu(w, (Position) location->x, (Position) location->y);
}

/*	Function Name: MoveMenu
 *	Description: Actually moves the menu, may force it to
 *                   to be fully visable if menu_on_screen is TRUE.
 *	Arguments: w - the simple menu widget.
 *                 x, y - the current location of the widget.
 *	Returns: none
 */

static void
MoveMenu(w, x, y)
Widget w;
Position x, y;
{
    Arg arglist[2];
    Cardinal num_args = 0;
    SimpleMenuWidget smw = (SimpleMenuWidget) w;

    if (smw->simple_menu.menu_on_screen) {
	int width = w->core.width + 2 * w->core.border_width;
	int height = w->core.height + 2 * w->core.border_width;

	if (x >= 0) {
	    int scr_width = WidthOfScreen(XtScreen(w));
	    if (x + width > scr_width)
		x = scr_width - width;
	}
	if (x < 0)
	    x = 0;

	if (y >= 0) {
	    int scr_height = HeightOfScreen(XtScreen(w));
	    if (y + height > scr_height)
		y = scr_height - height;
	}
	if (y < 0)
	    y = 0;
    }

    XtSetArg(arglist[num_args], XtNx, x); num_args++;
    XtSetArg(arglist[num_args], XtNy, y); num_args++;
    XtSetValues(w, arglist, num_args);
}

/*	Function Name: ChangeCursorOnGrab
 *	Description: Changes the cursor on the active grab to the one
 *                   specified in out resource list.
 *	Arguments: w - the widget.
 *                 junk, garbage - ** NOT USED **.
 *	Returns: None.
 */

/* ARGSUSED */
static void
ChangeCursorOnGrab(w, junk, garbage)
Widget w;
XtPointer junk, garbage;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;

    /*
     * The event mask here is what is currently in the MIT implementation.
     * There really needs to be a way to get the value of the mask out
     * of the toolkit (CDP 5/26/89).
     */

    XChangeActivePointerGrab(XtDisplay(w), ButtonPressMask|ButtonReleaseMask,
			     smw->simple_menu.cursor,
			     XtLastTimestampProcessed(XtDisplay(w)));
}

/*      Function Name: MakeSetValuesRequest
 *      Description: Makes a (possibly recursive) call to SetValues,
 *                   I take great pains to not go into an infinite loop.
 *      Arguments: w - the simple menu widget.
 *                 width, height - the size of the ask for.
 *      Returns: none
 */

static void
MakeSetValuesRequest(w, width, height)
Widget w;
Dimension width, height;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    Arg arglist[2];
    Cardinal num_args = (Cardinal) 0;

    if ( !smw->simple_menu.recursive_set_values ) {
	if ( (smw->core.width != width) || (smw->core.height != height) ) {
	    smw->simple_menu.recursive_set_values = TRUE;
	    XtSetArg(arglist[num_args], XtNwidth, width);   num_args++;
	    XtSetArg(arglist[num_args], XtNheight, height); num_args++;
	    XtSetValues(w, arglist, num_args);
	}
	else if (XtIsRealized( (Widget) smw))
	    Redisplay((Widget) smw, (XEvent *) NULL, (Region) NULL);
    }
    smw->simple_menu.recursive_set_values = FALSE;
}

/*      Function Name: GetMenuWidth
 *      Description: Sets the length of the widest entry in pixels.
 *      Arguments: w - the simple menu widget.
 *      Returns: width of menu.
 */

static Dimension
GetMenuWidth(w, w_ent)
Widget w, w_ent;
{
    SmeObject cur_entry = (SmeObject) w_ent;
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    Dimension width, widest = (Dimension) 0;
    SmeObject * entry;

    if ( smw->simple_menu.menu_width )
	return(smw->core.width);

    ForAllChildren(smw, entry) {
	XtWidgetGeometry preferred;

	if (!XtIsManaged( (Widget) *entry)) continue;

	if (*entry != cur_entry) {
	    XtQueryGeometry((Widget) *entry, (XtWidgetGeometry *)NULL, &preferred);

	    if (preferred.request_mode & CWWidth)
		width = preferred.width;
	    else
		width = (*entry)->rectangle.width;
	}
	else
	    width = (*entry)->rectangle.width;

	if ( width > widest )
	    widest = width;
    }

    return(widest);
}

/*      Function Name: GetMenuHeight
 *      Description: Sets the length of the widest entry in pixels.
 *      Arguments: w - the simple menu widget.
 *      Returns: width of menu.
 */

static Dimension
GetMenuHeight(w)
Widget w;
{
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    SmeObject * entry;
    Dimension height;

    if (smw->simple_menu.menu_height)
	return(smw->core.height);

    height = smw->simple_menu.top_margin + smw->simple_menu.bottom_margin;

    if (smw->simple_menu.row_height == 0) {
	ForAllChildren(smw, entry)
	    if (XtIsManaged ((Widget) *entry))
		height += (*entry)->rectangle.height;
    } else
	height += smw->simple_menu.row_height * smw->composite.num_children;

    return(height);
}

/*      Function Name: GetEventEntry
 *      Description: Gets an entry given an event that has X and Y coords.
 *      Arguments: w - the simple menu widget.
 *                 event - the event.
 *      Returns: the entry that this point is in.
 */

static SmeObject
GetEventEntry(w, event)
Widget w;
XEvent * event;
{
    Position x_loc = 0, y_loc = 0;
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    SmeObject * entry;
    XPoint pos;
    int s = ((ThreeDWidget)smw->simple_menu.threeD)->threeD.shadow_width;

    switch (event->type) {
    case MotionNotify:
	x_loc = event->xmotion.x;
	y_loc = event->xmotion.y;
	pos.y = event->xmotion.y_root;
	break;
    case EnterNotify:
    case LeaveNotify:
	x_loc = event->xcrossing.x;
	y_loc = event->xcrossing.y;
	pos.y = event->xcrossing.y_root;
	break;
    case ButtonPress:
    case ButtonRelease:
	x_loc = event->xbutton.x;
	y_loc = event->xbutton.y;
	pos.y = event->xbutton.y_root;
	break;
    default:
	XtAppError(XtWidgetToApplicationContext(w),
		   "Unknown event type in GetEventEntry().");
	break;
    }

    if ( (x_loc < 0) || (x_loc >= (int)smw->core.width) || (y_loc < 0) ||
	(y_loc >= (int)smw->core.height) )
	return(NULL);

    if (smw->simple_menu.too_tall) {
	if (pos.y >= smw->simple_menu.last_y && smw->simple_menu.didnt_fit) {
	    smw->simple_menu.current_first++;
	    Unhighlight(w, NULL, NULL, 0);
	    Redisplay(w, (XEvent *) NULL, (Region) NULL);
	    return NULL;/* *&* */
	} else if ((pos.y <= s+8)
		   && (smw->simple_menu.first_entry!=smw->simple_menu.current_first)) {
	    smw->simple_menu.current_first--;
	    Unhighlight(w, NULL, NULL, 0);
	    Redisplay(w, (XEvent *) NULL, (Region) NULL);
	    return NULL;
	}
    }

    ForAllChildren(smw, entry) {
	int tmp_y;

	if (!XtIsManaged ((Widget) *entry)) continue;

	tmp_y = (*entry)->rectangle.y - smw->simple_menu.first_y;
	if ( (tmp_y < y_loc) &&
	    (tmp_y + (int) (*entry)->rectangle.height > y_loc) ) {

	    if ( *entry == smw->simple_menu.label )
		return(NULL);	/* cannot select the label. */
	    else {
		return(*entry);
	    }
	}
    }

    return(NULL);
}


text:
file_url=$1
file_name="output.dat"

download_command="java -jar build/libs/java.jar $file_url $file_name"

# Run download command in background
$download_command &
pid=$!

echo "Outputting CPU usage for process $pid..."
while ps -p $pid > /dev/null
do
    ps -p $pid -o %cpu | tail -n +2
    sleep 0.2
done

rm -f $file_name


text:
'use strict';

var Gravity3D = require('../../../src/physics/forces/Gravity3D');
var Force = require('../../../src/physics/forces/Force');
var Particle = require('../../../src/physics/bodies/Particle');
var Vec3 = require('../../../src/math/Vec3');
var test = require('tape');

function vec3sAreEqual(a,b) {
    return Math.abs(a.x - b.x) < 0.001 && Math.abs(a.y - b.y) < 0.001 && Math.abs(a.z - b.z) < 0.001;
}

test('Gravity3D', function(t) {
    var p1 = new Particle({mass:1000});
    var p2 = new Particle({mass: 22});
    p2.setPosition(10,20,30);
    var g = new Gravity3D(p1, p2, {strength: 123});

    t.test('should extend Force', function(t) {
        t.assert(Gravity3D instanceof Function, 'Gravity3D should be a constructor');

        t.assert(g instanceof Gravity3D && g instanceof Force, 'constructed objects should be instances of Force');

        t.end();
    });

    t.test('init prototypal method', function(t) {
        t.assert(g.init instanceof Function, '.init should be a function');

        t.assert(g.strength === 123, '.init should set .strength correctly');

        t.end();
    });

    t.test('update prototypal method', function(t) {
        t.assert(g.update instanceof Function, '.update should be a function');

        g.update();

        var e = Vec3.subtract(p1.position, p2.position, new Vec3());
        e.normalize();
        var d = Math.sqrt(10*10+20*20+30*30);
        e.scale(123*1000*22/(d*d));

        t.assert(vec3sAreEqual(p2.force, e) && vec3sAreEqual(p1.force, e.invert()), '.update should apply forces correctly');

        t.end();
    });

    t.end();
});


text:
.gwt-SuggestBoxPopup {
    background: #2f2f2f;
}

.gwt-SuggestBoxPopup .suggestPopupContent table tr td:hover {
    background-color: #353535 !important;
}

ul.multiValueSuggestBox-list input[type=text]:focus:not([readonly]) {
    border: none !important;
    box-shadow: none !important;
}


text:
Every participant has to upload [a CAD design](https://raw.githubusercontent.com/mindstormschallenges/challenge1/master/example/PiStormsFrame-Printable-v08.zip)

and a image real or virtual about the design:

![Cad](https://raw.githubusercontent.com/mindstormschallenges/challenge1/master/example/example.png)


text:
/*-------JSHint Directives-------*/
/* global StarterApp, THREE      */
/*-------------------------------*/
'use strict';

/**********************
 * App Initialization *
 **********************/
StarterApp.prototype.initializeSettings = function() {
  this.settings = {
    meta: {
      dom: 'canvas-body',
    },

    camera: {
      fov: 45,
      near: 1,
      far: 1000,
      zoomX: 0,
      zoomY: 20,
      zoomZ: 50,
    },

    controls: {
      enabled: true,
      userPan: false,
      userPanSpeed: 0.5,
      minDistance: 10.0,
      maxDistance: 200.0,
      maxPolarAngle: (Math.PI/180) * 85,
    },

    renderer: {
      antialias: false,
    },
  };
};

StarterApp.prototype.initializeClock = function() {
  this.clock = new THREE.Clock();
  this.clock.delta = this.clock.getDelta();
};

StarterApp.prototype.initializeScene = function() {
  this.scene = new THREE.Scene();
  this.renderer = new THREE.WebGLRenderer(this.settings.renderer);
  this.renderer.setSize(window.innerWidth, window.innerHeight);
  this.utils.addToDOM(this.settings.meta.dom, this.renderer.domElement);
  this.renderer.running = true;
};

StarterApp.prototype.initializeCamera = function() {
  var set = this.settings.camera;
  var aspect = window.innerWidth/window.innerHeight;
  this.camera = new THREE.PerspectiveCamera(set.fov, aspect, set.near, set.far);
  this.camera.position.set(set.zoomX, set.zoomY, set.zoomZ);
  this.camera.lookAt(this.scene.position);
  this.scene.add(this.camera);
};

StarterApp.prototype.initializeControls = function() {
  var set = this.settings.controls;
  this.controls = new THREE.OrbitControls(this.camera);
  for (var key in set) { this.controls[key] = set[key]; }
};

StarterApp.prototype.initializeHUD = function() {
  this.HUD = {};
  this.enablePausedHUD();
};

StarterApp.prototype.initializeEventListeners = function() {
  window.addEventListener('resize', this.resizeWindow.bind(this), false);
  window.addEventListener('focus', this.resumeClock.bind(this), false);
  window.addEventListener('blur', this.pauseClock.bind(this), false);
  window.addEventListener('keydown', this.keyboardInput.bind(this), false);
};

/****************************
 * App Renderer and Updater *
 ****************************/
StarterApp.prototype.renderScene = function() {
  this.renderer.render(this.scene, this.camera);
};

StarterApp.prototype.updateScene = function() {
  if (this.renderer.running) {
    window.requestAnimationFrame(this.updateScene.bind(this));
    this.controls.update();
    this.renderScene();
  }
};

StarterApp.prototype.resizeWindow = function() {
  this.camera.aspect = window.innerWidth / window.innerHeight;
  this.camera.updateProjectionMatrix();
  this.renderer.setSize(window.innerWidth, window.innerHeight);
};

/*********************
 * App Clock Methods *
 *********************/
StarterApp.prototype.resumeClock = function() {
  this.clock.start();
};

StarterApp.prototype.pauseClock = function() {
  this.clock.stop();
};

StarterApp.prototype.resumeRenderer = function() {
  this.renderer.running = true;
  this.resumeClock();
  window.requestAnimationFrame(this.updateScene.bind(this));
};

StarterApp.prototype.pauseRenderer = function() {
  this.renderer.running = false;
  this.pauseClock();
};

StarterApp.prototype.togglePause = function() {
  if (this.renderer.running) {
    this.HUD.paused.style.display = 'block';
    this.controls.enabled = false;
    this.pauseRenderer();
  }
  else {
    this.HUD.paused.style.display = 'none';
    this.controls.enabled = true;
    this.resumeRenderer();
  }
};

/***********************
 * App Event Listeners *
 ***********************/
StarterApp.prototype.keyboardInput = function(event) {
  switch (event.which) {

  // spacebar: toggle pause
  case 32:
    event.preventDefault();
    this.togglePause();
    break;
  }
};

/**********************
 * App Public Methods *
 **********************/
StarterApp.prototype.changeSettings = function(type, dictionary) {
  var setting = this.settings[type];
  for (var key in dictionary) {
    if (setting.hasOwnProperty(key)) {
      setting[key] = dictionary[key];
    }
  }
};

StarterApp.prototype.addToScene = function(mesh) {
  this.scene.add(mesh);
};

StarterApp.prototype.enableFloorGrid = function(lines, steps, gridColor) {
  lines = lines || 20;
  steps = steps || 2;
  gridColor = gridColor || 0xFFFFFF;
  var floorGrid = new THREE.Geometry();
  var gridLine = new THREE.LineBasicMaterial( {color: gridColor} );
  for (var i = -lines; i <= lines; i += steps) {
    floorGrid.vertices.push(new THREE.Vector3(-lines, 0, i));
    floorGrid.vertices.push(new THREE.Vector3( lines, 0, i));
    floorGrid.vertices.push(new THREE.Vector3( i, 0, -lines));
    floorGrid.vertices.push(new THREE.Vector3( i, 0, lines));
  }
  this.scene.add(new THREE.Line(floorGrid, gridLine, THREE.LinePieces));
};


text:
<?php

namespace mako\tests\unit\cli\output\helpers;

use Mockery;
use PHPUnit_Framework_TestCase;

use mako\cli\output\helpers\UnorderedList;

/**
 * @group unit
 */
class UnorderedListTest extends PHPUnit_Framework_TestCase
{
	/**
	 *
	 */
	public function tearDown()
	{
		Mockery::close();
	}

	/**
	 *
	 */
	public function testBasicList()
	{
		$output = Mockery::mock('mako\cli\output\Output');

		$list = new UnorderedList($output);

		$expected  = '';
		$expected .= '* one' . PHP_EOL;
		$expected .= '* two' . PHP_EOL;
		$expected .= '* three' . PHP_EOL;

		$this->assertSame($expected, $list->render(['one', 'two', 'three']));
	}

	/**
	 *
	 */
	public function testNestedLists()
	{
		$output = Mockery::mock('mako\cli\output\Output');

		$list = new UnorderedList($output);

		$expected  = '';
		$expected .= '* one' . PHP_EOL;
		$expected .= '* two' . PHP_EOL;
		$expected .= '* three' . PHP_EOL;
		$expected .= '  * one' . PHP_EOL;
		$expected .= '  * two' . PHP_EOL;
		$expected .= '  * three' . PHP_EOL;
		$expected .= '* four' . PHP_EOL;

		$this->assertSame($expected, $list->render(['one', 'two', 'three', ['one', 'two', 'three'], 'four']));
	}

	/**
	 *
	 */
	public function testCustomMarker()
	{
		$output = Mockery::mock('mako\cli\output\Output');

		$list = new UnorderedList($output);

		$expected  = '';
		$expected .= '# one' . PHP_EOL;
		$expected .= '# two' . PHP_EOL;
		$expected .= '# three' . PHP_EOL;

		$this->assertSame($expected, $list->render(['one', 'two', 'three'], '#'));
	}

	/**
	 *
	 */
	public function testDraw()
	{
		$output = Mockery::mock('mako\cli\output\Output');

		$list = new UnorderedList($output);

		$expected  = '';
		$expected .= '* one' . PHP_EOL;
		$expected .= '* two' . PHP_EOL;
		$expected .= '* three' . PHP_EOL;

		$output->shouldReceive('write')->once()->with($expected, 1);

		$list->draw(['one', 'two', 'three']);
	}

	/**
	 *
	 */
	public function testDrawWithCustomMarker()
	{
		$output = Mockery::mock('mako\cli\output\Output');

		$list = new UnorderedList($output);

		$expected  = '';
		$expected .= '# one' . PHP_EOL;
		$expected .= '# two' . PHP_EOL;
		$expected .= '# three' . PHP_EOL;

		$output->shouldReceive('write')->once()->with($expected, 1);

		$list->draw(['one', 'two', 'three'], '#');
	}
}


text:
DIR="$1"
COMMIT="$2"
if [ -z "$COMMIT" ]; then
    COMMIT=HEAD
fi

# Taken from git-subtree (Copyright (C) 2009 Avery Pennarun <apenwarr@gmail.com>)
find_latest_squash()
{
	dir="$1"
	sq=
	main=
	sub=
	git log --grep="^git-subtree-dir: $dir/*\$" \
		--pretty=format:'START %H%n%s%n%n%b%nEND%n' "$COMMIT" |
	while read a b junk; do
		case "$a" in
			START) sq="$b" ;;
			git-subtree-mainline:) main="$b" ;;
			git-subtree-split:) sub="$b" ;;
			END)
				if [ -n "$sub" ]; then
					if [ -n "$main" ]; then
						# a rejoin commit?
						# Pretend its sub was a squash.
						sq="$sub"
					fi
					echo "$sq" "$sub"
					break
				fi
				sq=
				main=
				sub=
				;;
		esac
	done
}

latest_squash="$(find_latest_squash "$DIR")"
if [ -z "$latest_squash" ]; then
    echo "ERROR: $DIR is not a subtree" >&2
    exit 2
fi

set $latest_squash
old=$1
rev=$2
if [ "d$(git cat-file -t $rev 2>/dev/null)" != dcommit ]; then
    echo "ERROR: subtree commit $rev unavailable. Fetch/update the subtree repository" >&2
    exit 2
fi
tree_subtree=$(git show -s --format="%T" $rev)
echo "$DIR in $COMMIT was last updated to upstream commit $rev (tree $tree_subtree)"
tree_actual=$(git ls-tree -d "$COMMIT" "$DIR" | head -n 1)
if [ -z "$tree_actual" ]; then
    echo "FAIL: subtree directory $DIR not found in $COMMIT" >&2
    exit 1
fi
set $tree_actual
tree_actual_type=$2
tree_actual_tree=$3
echo "$DIR in $COMMIT currently refers to $tree_actual_type $tree_actual_tree"
if [ "d$tree_actual_type" != "dtree" ]; then
    echo "FAIL: subtree directory $DIR is not a tree in $COMMIT" >&2
    exit 1
fi
if [ "$tree_actual_tree" != "$tree_subtree" ]; then
    git diff-tree $tree_actual_tree $tree_subtree >&2
    echo "FAIL: subtree directory tree doesn't match subtree commit tree" >&2
    exit 1
fi
echo "GOOD"


text:
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.firebase.crashlytics.internal.common;

import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent;
import com.google.firebase.crashlytics.internal.Logger;
import com.google.firebase.crashlytics.internal.settings.SettingsProvider;
import java.util.concurrent.atomic.AtomicBoolean;

class CrashlyticsUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {

  interface CrashListener {

    void onUncaughtException(SettingsProvider settingsProvider, Thread thread, Throwable ex);
  }

  private final CrashListener crashListener;
  private final SettingsProvider settingsProvider;
  private final Thread.UncaughtExceptionHandler defaultHandler;
  private final CrashlyticsNativeComponent nativeComponent;

  // use AtomicBoolean because value is accessible from other threads.
  private final AtomicBoolean isHandlingException;

  public CrashlyticsUncaughtExceptionHandler(
      CrashListener crashListener,
      SettingsProvider settingsProvider,
      Thread.UncaughtExceptionHandler defaultHandler,
      CrashlyticsNativeComponent nativeComponent) {
    this.crashListener = crashListener;
    this.settingsProvider = settingsProvider;
    this.defaultHandler = defaultHandler;
    this.isHandlingException = new AtomicBoolean(false);
    this.nativeComponent = nativeComponent;
  }

  @Override
  public void uncaughtException(Thread thread, Throwable ex) {
    isHandlingException.set(true);
    try {
      if (shouldRecordUncaughtException(thread, ex)) {
        crashListener.onUncaughtException(settingsProvider, thread, ex);
      } else {
        Logger.getLogger().d("Uncaught exception will not be recorded by Crashlytics.");
      }
    } catch (Exception e) {
      Logger.getLogger().e("An error occurred in the uncaught exception handler", e);
    } finally {
      Logger.getLogger().d("Completed exception processing. Invoking default exception handler.");
      defaultHandler.uncaughtException(thread, ex);
      isHandlingException.set(false);
    }
  }

  boolean isHandlingException() {
    return isHandlingException.get();
  }

  /**
   * Returns true if Crashlytics should record this exception. The decision to record is different
   * than the decision to report the exception to Crashlytics servers, which is handled by the
   * {@link DataCollectionArbiter}
   *
   * @return false if the thread or exception is null, or if a native crash already exists for this
   *     session.
   */
  private boolean shouldRecordUncaughtException(Thread thread, Throwable ex) {
    if (thread == null) {
      Logger.getLogger().e("Crashlytics will not record uncaught exception; null thread");
      return false;
    }
    if (ex == null) {
      Logger.getLogger().e("Crashlytics will not record uncaught exception; null throwable");
      return false;
    }
    // We should only report at most one fatal event for a session. If a native fatal already exists
    // for this session, ignore the uncaught exception
    if (nativeComponent.hasCrashDataForCurrentSession()) {
      Logger.getLogger()
          .d("Crashlytics will not record uncaught exception; native crash exists for session.");
      return false;
    }
    return true;
  }
}


text:
package org.afree.data;

/**
 * An interface (optional) that can be implemented by a dataset to assist in
 * determining the minimum and maximum values. See also {@link DomainInfo}.
 */
public interface RangeInfo {

    /**
     * Returns the minimum y-value in the dataset.
     *
     * @param includeInterval
     *            a flag that determines whether or not the y-interval is taken
     *            into account.
     *
     * @return The minimum value.
     */
    public double getRangeLowerBound(boolean includeInterval);

    /**
     * Returns the maximum y-value in the dataset.
     *
     * @param includeInterval
     *            a flag that determines whether or not the y-interval is taken
     *            into account.
     *
     * @return The maximum value.
     */
    public double getRangeUpperBound(boolean includeInterval);

    /**
     * Returns the range of the values in this dataset's range.
     *
     * @param includeInterval
     *            a flag that determines whether or not the y-interval is taken
     *            into account.
     *
     * @return The range (or null if the dataset contains no
     *         values).
     */
    public Range getRangeBounds(boolean includeInterval);

}


text:
import React from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import App from './app';
import FirebaseUi from './firebaseui';
import PrivacyPolicy from './privacypolicy';

const AppRouter: React.FC = () => {
  return (
    <Router>

        <Route path="/" exact component={FirebaseUi}></Route>
        <Route path="/custom" exact component={App}></Route>
        <Route path="/tos" exact component={PrivacyPolicy}></Route>
        <Route path="/privacypolicy" exact component={PrivacyPolicy}></Route>

    </Router>
  );
}

export default AppRouter;


text:
// This code is adopted from sanitize-html/naughtyScheme.
// sanitize-html is a dependency of Web Chat but the naughtScheme function is neither exposed nor reusable.
// https://github.com/apostrophecms/sanitize-html/blob/master/src/index.js#L526
function getScheme(href) {
  // Browsers ignore character codes of 32 (space) and below in a surprising
  // number of situations. Start reading here:
  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab

  /* eslint-disable-next-line no-control-regex */
  href = href.replace(/[\x00-\x20]+/gu, '');

  // Clobber any comments in URLs, which the browser might
  // interpret inside an XML data island, allowing
  // a javascript: URL to be snuck through
  href = href.replace(/<!--.*?-->/gu, '');

  // Case insensitive so we don't get faked out by JAVASCRIPT #1
  const matches = href.match(/^([a-zA-Z]+):/u);

  if (!matches) {
    // Protocol-relative URL or no scheme
    return;
  }

  return matches[1].toLowerCase();
}

const ALLOWED_SCHEMES = ['data', 'http', 'https', 'ftp', 'mailto', 'sip', 'tel'];

export default function createDefaultCardActionMiddleware() {
  return [
    () => next => (...args) => {
      const [
        {
          cardAction: { type, value },
          getSignInUrl
        }
      ] = args;

      switch (type) {
        case 'call':
        case 'downloadFile':
        case 'openUrl':
        case 'playAudio':
        case 'playVideo':
        case 'showImage':
          if (ALLOWED_SCHEMES.includes(getScheme(value))) {
            window.open(value, '_blank', 'noopener noreferrer');
          } else {
            console.warn('botframework-webchat: Cannot open URL with disallowed schemes.', value);
          }

          break;

        case 'signin': {
          // TODO: [P3] We should prime the URL into the OAuthCard directly, instead of calling getSessionId on-demand
          //       This is to eliminate the delay between window.open() and location.href call

          (async function () {
            const popup = window.open();
            const url = await getSignInUrl();

            popup.location.href = url;
          })();

          break;
        }

        default:
          return next(...args);
      }
    }
  ];
}


text:
/** @enum {string} */
const strings = {
  ARIA_CONTROLS: 'aria-controls',
  INPUT_SELECTOR: '.mdc-text-field__input',
  LABEL_SELECTOR: '.mdc-text-field__label',
  ICON_SELECTOR: '.mdc-text-field__icon',
  IDLE_OUTLINE_SELECTOR: '.mdc-text-field__idle-outline',
  OUTLINE_SELECTOR: '.mdc-text-field__outline',
  BOTTOM_LINE_SELECTOR: '.mdc-text-field__bottom-line',
};

/** @enum {string} */
const cssClasses = {
  ROOT: 'mdc-text-field',
  UPGRADED: 'mdc-text-field--upgraded',
  DISABLED: 'mdc-text-field--disabled',
  DENSE: 'mdc-text-field--dense',
  FOCUSED: 'mdc-text-field--focused',
  INVALID: 'mdc-text-field--invalid',
  BOX: 'mdc-text-field--box',
  OUTLINED: 'mdc-text-field--outlined',
};

/** @enum {number} */
const numbers = {
  LABEL_SCALE: 0.75,
  DENSE_LABEL_SCALE: 0.923,
};

export {cssClasses, strings, numbers};