text:
<?xml version="1.0" encoding="windows-1252"?>

<document xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:xforms="http://www.w3.org/2002/xforms"
          xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xhtml="http://www.w3.org/1999/xhtml"
          xmlns:ev="http://www.w3.org/2001/xml-events"
          xmlns:xi="http://www.w3.org/2001/XInclude" >

        <title>XForms Reference: XForms Engine Configuration</title>

            <title>Introduction</title>

                This part of the XForms reference documentation focuses on XForms engine configuration.

            <title>State Handling</title>

                <title>Rationale</title>

                    The Orbeon Forms XForms engine requires keeping processing state while operating on an XForms page.
                    Such state includes the current values of XForms instances, selected repeated elements, and more.
                    With Orbeon Forms, XForms state information can be handled in one of two ways:

                            Server-side: in this case, state information is stored on the server. Only very
                            little state information circulates between client and server. The most frequently used
                            state information is stored in memory. Less frequently used state information is stored
                            on disk in a local database.

                            Benefits of the approach:

                                    Resulting HTML page are smaller. HTML pages increase in size as more XForms
                                    controls are used, but they don't increase in size proportionally to the size of
                                    XForms instances.

                                    Small amounts of data circulate between the client browser and the Orbeon Forms
                                    XForms server.

                                    This means that very large XForms instances can be processed without any impact
                                    on the amount of data that is transmitted between the client and the server.

                            Drawbacks of the approach:

                                    The Orbeon Forms XForms server needs to be stateful. It uses server memory to
                                    store state information even when no request is being processed. This creates
                                    additional demand for resources on the server and slightly complicates the task
                                    of tuning the server.

                                    State information can become unavailable when sessions expire or when the server
                                    is restarted. When state information becomes unavailable for a page, that page
                                    will no longer function unless it is reloaded.

                        <note>
                            Orbeon Forms ensures that it is possible to open multiple client browser windows
                            showing the same page within the same session.
                        </note>

                            Client-side: in this case, static initial state information is sent along with the
                            initial HTML page, and dynamic state is exchanged over the wire between the client browser
                            and the Orbeon Forms XForms server when necessary.

                            Benefits of the approach:

                                    The Orbeon Forms server is entirely stateless. It only requires memory while
                                    processing a client request. It can be restarted without consequence for the XForms
                                    engine.

                                    State information does not expire as long as the user keeps the
                                    application page open in the web browser.

                            Drawbacks of the approach:

                                    Resulting HTML pages are larger. In particular, the size of state data grows
                                    when XForms instances grow, regardless of whether many XForms controls are
                                    bound to instance data.

                                    More data circulates between the client browser and the Orbeon Forms XForms server.

                        <note>
                            Orbeon Forms compresses and encrypts XForms state information sent to the client.
                        </note>

                    By default, Orbeon forms store XForms state information on the server. Please change this
                    default to client-side only if you have well understood the tradeoffs explained above.

                <title>Configuring State Handling</title>

                    State handling can be configured globally for all pages, or locally for each individual page
                    served. Global configuration is performed in properties.xml with the
                    oxf.xforms.state-handling property. When missing or set to client,
                    state is stored client-side. When set to server, state is stored server-side. For
                    example:

                <xml-source>
                    <comment> Store state on the server </comment>
                    <property as="xs:string" name="oxf.xforms.state-handling" value="server"/>
                </xml-source>

                    The global configuration can be overridden for each page by setting the
                    xxforms:state-handling attribute in the page. This attribute can be set  on the
                    root element of the XHTML page, or on the first xforms:model element. Only the
                    first such attribute encountered by the XForms engine is used:

                <xml-source show-namespaces="false">
                    <xforms:model xxforms:state-handling="client">
                        ...
                    </xforms:model>
                </xml-source>

                    When storing state on the server, the maximum size of the data to be stored globally in memory
                    can be selected using the oxf.xforms.store.application.size property. The size is
                    specified in bytes:

                <xml-source>
                    <comment> Allow a maximum of 20 MB of state information among all users </comment>
                    <property as="xs:integer" name="oxf.xforms.store.application.size"               value="20000000"/>
                </xml-source>

                    When the allowed memory space for state information is full, Orbeon passivates state information
                    to a local eXist database. Configuration parameters for the connection to the eXist database
                    can be changed. The defaults are as follows:

                <xml-source>
                    <comment> Disk-based store connection information </comment>
                    <property as="xs:string"  name="oxf.xforms.store.application.username"           value="guest"/>
                    <property as="xs:string"  name="oxf.xforms.store.application.password"           value="guest"/>
                    <property as="xs:anyURI"  name="oxf.xforms.store.application.uri"                value="xmldb:exist:///"/>
                    <property as="xs:string"  name="oxf.xforms.store.application.collection"         value="/db/orbeon/xforms/cache/"/>
                </xml-source>

                    Whether state information is kept client-side or server-side, a property controls whether the XForms
                    engine should try to optimize state reconstruction by using a cache. This property should usually
                    be set to true:

                <xml-source>
                    <comment> This should usually be set to "true" </comment>
                    <property as="xs:boolean" name="oxf.xforms.cache.document"                       value="true"/>
                </xml-source>

                    If the above property is set to true, the number of XForms documents that can be
                    held in that document cache at a given time is configured with the following property:

                <xml-source>
                    <comment> Store at most 10 documents in the cache </comment>
                    <property as="xs:integer" name="oxf.xforms.cache.documents.size"                 value="10"/>
                </xml-source>

                    Note that this represents XForms documents in a particular state of interaction with a user,
                    which means that if to users load the same XForms page two entries will be needed in the cache.

                <title>Session Heartbeat</title>

                    If you happen to leave a browser window open on your computer, chances are that you will get
                    back to that window and keep using the application. The last thing you want to happen when you
                    come back is lose your session and therefore your data.

                    This is not always a correct guess of course: you may just happen to leave a window or tab open
                    without planning to use it again. Conversely you may have a page which is not actually visible,
                    for example in your browser history, yet you will come back to it. This approach wouldn't be
                    good for banking applications either. Still, in many situations, such as filling-out large
                    forms, it sounds like a good idea to keep your session alive for open pages.

                    To achieve this goal you could make all server sessions longer. However this is harder to
                    configure for the application developer, and this won't discriminate between pages that are
                    actually open on a client and the ones that are not. And while it may be ideal to have
                    infinitely long sessions, unfortunately many applications are not ready for this kind of
                    approach.

                    So Orbeon Forms supports a "session heartbeat" feature. Here is how this works:

                            When this feature is enabled (the default), an open XForms page in a client browser
                            regularly pings the server through Ajax to keep the current server session alive.

                            The ping delay is automatically computed based on the server's session timeout. The
                            client pings the server at 80% of the session expiration time after the last interaction
                            with the server.

                            We are careful not to hit the XForms engine too much, in fact we do a very limited
                            amount of work on the server for each ping, so they should run fast.

                            XForms state information for pages hit with the heartbeat just migrates to the disk store over time if RAM is used by other
                            pages, so keeping even large numbers of pages open should not have any negative impact
                            on server RAM.

                            When a user gets back to using the page, state information migrates back from disk to
                            RAM, and the page will be live again.

                            Sessions do eventually expire as nobody keeps a browser open forever.

                    Note that whenever an application keeps sessions alive for a long time, it is a good idea to
                    keep as little data as possible in the session. The Orbeon Forms XForms engine itself uses a global state store and does not use session objects
                    for storage, but do remember to keep your sessions small!

                    The session heartbeat should help prevent many occurrences of "session expired" error messages.
                    As an Orbeon Forms application developer you don't have to worry about anything: the session
                    heartbeat is enabled by default. You can configure it globally in properties.xml:

                <xml-source>
                    <property as="xs:boolean" name="oxf.xforms.session-heartbeat" value="true"/>
                </xml-source>

                    You can also override the global default by specifying a property on the first XForms model of a
                    page:

                <xml-source>
                    <xforms:model id="my-model" xxforms:session-heartbeat="false"/>
                </xml-source>

            <title>Local Submissions</title>

                <title>Rationale</title>

                    XForms pages can make heavy use of services through the use of <xforms:submission>.
                    A service is primarily identified by a URL.

                            Sometimes a service is remote (on a machine other than the machine on which Orbeon Forms is
                            installed), in which case the URL is necessarily an absolute URL starting with
                            http:// or https://.

                            But often services are implemented within Orbeon Forms itself, not only on the same server
                            but within the same web application. In the case of such local submission, Orbeon Forms
                            provides a special optimized mode which has the following benefits:

                                    No actual HTTP connection is initiated, so performance is likely to be better.

                                    There is no need to deal with absolute URLs such as
                                    http://localhost:8080, especially when proxies or firewalls are in
                                    place.

                    For more information, see also the Configuration
                    Properties related to submissions.

                <title>Enabling Local Submissions</title>

                    Orbeon Forms performs a local submission if:

                            The URL specified is not a absolute, i.e. does not start with http:// or
                            https://.

                            The submission is not asynchronous. (This restriction may be lifted in the future.)

                            In a servlet environment:

                                    The submission has replace="all" (which is the default if no
                                    replace attribute is specified) and the
                                    oxf.xforms.local-submission-forward property is set to
                                    true (which is the default).

                                    The submission has replace="instance", replace="text" or
                                    replace="none" and the
                                    oxf.xforms.local-submission-include property is set to
                                    true (the default is false).

                            In a portlet environment:

                                    The f:url-norewrite attribute is not set to true.

                                    The f:url-type attribute is not set to resource.

                        <note>
                            The portlet logic above is likely to be revised in the future. Also note that in the case of
                            optimized submissions within portlets, requests are made directly to the Orbeon Forms
                            portlet and do not use servlet forward/include.
                        </note>

                <title>Context Resolution</title>

                    In a servlet environment, paths are resolved as follows:

                            If f:url-norewrite is not set to true, the resource is resolved
                            against the current servlet context.

                            If f:url-norewrite is set to true, the resource is resolved
                            against the servlet container root. This allows accessing other web applications within the
                            same servlet container.

                    Say your application is under context /orbeon, and you have a second web application
                    under context /foo:

                <xml-source xmlns:f="http://orbeon.org/oxf/xml/formatting">
                    <comment> This submission calls /orbeon/bar </comment>
                    <xforms:submission replace="all" method="post" resource="/bar"/>
                    <comment> This submission calls /foo/bar </comment>
                    <xforms:submission replace="all" method="post" resource="/foo/bar" f:url-norewrite="true"/>
                </xml-source>

                <title>Limitations of Includes</title>

                    With replace="instance", replace="text" or replace="none",
                    optimized submission are implemented using the servlet container's include mechanism, which does not
                    automatically build path information for the included resource.

                    In this case, Orbeon Forms is therefore unable to provide proper "servlet path" and "path info"
                    information. Orbeon Forms handles this situation in the following way:

                            A blank ("") "servlet path" is provided.

                            The "path info" contains the entire path provided, instead of the path following the servlet
                            path.

                   This may cause some application which rely on the "servlet path" information to behave incorrectly.
                   For example, consider the eXist REST servlet:

                            It is mounted as /exist/rest within Orbeon Forms.

                            eXist (quite properly) expects any path following /exist/rest to be a path
                            into the database, e.g. /exist/rest/db/orbeon produces a path called
                            /db/orbeon.

                            If Orbeon Forms calls the eXist REST servlet with a blank servlet path and a path info
                            containing /exist/rest/db/orbeon, eXist obviously obtains an incorrect database
                            path.

                <warning>
                   In short you must be careful when using local includes. The good news is that if you are using
                   servlets which do not depend on path information as explained above, or if you have control over the
                   implementation of the services you are calling, then you can most likely work around this limitation.
                </warning>

                   Local forwards are not subject to that limitation.

            <title>JavaScript and CSS Resources</title>

                <title>Minimal Resources</title>

                    Most JavaScript and CSS files used by the XForms engine are available in two versions:

A full version, which may contain comments, spaces, longer identifiers, etc.

A minimal version, which is usually much smaller

                    Both versions work exactly the same. For development and debugging of the XForms engine itself, the full
                    version is easier to work with. But if you never work directly with these JavaScript and CSS files, as
                    well as for deployment, the minimal versions are recommended as they will load faster in the user's web
                    browser. You enable minimal resources in properties.xml as follows:

                <xml-source>
                    <comment> Enable minimal resources </comment>
                    <property as="xs:boolean" name="oxf.xforms.minimal-resources" value="true"/>
                </xml-source>

                <title>Combined Resources</title>

                    Serving CSS and JavaScript can have a high performance cost on page loads. This is particularly
                    important with the intensive use of JavaScript in Orbeon Forms. In particular, it can be shown that
                    serving many small files is slower than serving a single large file. In theory, HTTP pipelining can
                    improve very much on this, but this is (very unfortunately) useless in practice at the time of writing
                    because Internet Explorer doesn't implement it at all and Firefox / Mozilla do implemente it but do not
                    enable it by default. This is why Orbeon Forms supports the option of combining the multiple JavaScript
                    and CSS files required for a given XForms page into a single JavaScript file and a single CSS file.

                    You enable this feature in properties.xml as follows

                <xml-source>
                    <comment> Enable combined resources </comment>
                    <property as="xs:boolean" name="oxf.xforms.combined-resources" value="true"/>
                </xml-source>

                    When this is enabled, Orbeon Forms refers to a single JavaScript file and a single CSS file for
                    XForms-related functionality. The URL identifies special resources needed by the page, for example:

                <xml-source>
                    <link rel="stylesheet" href="/ops/xforms-server/xforms-range-autocomplete-min.css" type="text/css"/>


text:
package com.navercorp.volleyextensions.cache.universalimageloader.memory.impl;

import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.shadows.ShadowBitmap;

import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;

import com.android.volley.toolbox.ImageLoader.ImageCache;
import com.navercorp.volleyextensions.cache.universalimageloader.memory.impl.UniversalFuzzyKeyMemoryCache;
import com.nostra13.universalimageloader.cache.memory.impl.FIFOLimitedMemoryCache;
import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil;

@RunWith(RobolectricTestRunner.class)
@org.robolectric.annotation.Config(manifest=org.robolectric.annotation.Config.NONE)
public class UniversalFuzzyKeyMemoryCacheTest {
	@Test
	public void cacheShouldBeRemovedByComparisionPolicy(){
    	// Given
		String url1 = "http://me.do/test1.jpg_small";
		Bitmap image1 = ShadowBitmap.createBitmap(10, 10, Config.ALPHA_8);
		String url2 = "http://me.do/test1.jpg_large";
		Bitmap image2 = ShadowBitmap.createBitmap(20, 20, Config.ALPHA_8);
		ImageCache cache = new UniversalFuzzyKeyMemoryCache(new FIFOLimitedMemoryCache(100000),
															MemoryCacheUtil.createFuzzyKeyComparator());
		// When
		cache.putBitmap(url1, image1);
		cache.putBitmap(url2, image2);

		// Then
		Bitmap hit = cache.getBitmap(url1);
		assertNull(hit);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.yang.yunfan.ui.main;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.yang.yunfan.R;
import com.yang.yunfan.ui.base.BaseFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * A simple {@link Fragment} subclass.
 */
public class ChatFragment extends BaseFragment {

    @BindView(R.id.btn_toggle)
    Button btnToggle;
    @BindView(R.id.night_overlay)
    View nightOverlay;

    public ChatFragment() {
        // Required empty public constructor
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_chat, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @OnClick(R.id.btn_toggle)
    public void onClick() {
        if (nightOverlay.getVisibility() == View.VISIBLE){
            nightOverlay.setVisibility(View.GONE);
        }else {
            nightOverlay.setVisibility(View.VISIBLE);

        }
    }
}


text:
@interface PodsDummy_Pods_Otherpod_Otherpod : NSObject
@end
@implementation PodsDummy_Pods_Otherpod_Otherpod
@end


text:
package kata;

import static org.junit.Assert.*;

import org.junit.Ignore;
import org.junit.Test;

public class _BerlinClockTest {
	BerlinClock bc = new BerlinClock();

	@Test
	public void getSeconds_OneNumberGiven_ReturnsOneLight() throws Exception {
		assertEquals(1, bc.getSeconds(2).length());
	}

	@Test
	public void getSeconds_EvenNumberGiven_ReturnsY() throws Exception {
		assertEquals("Y", bc.getSeconds(2));
	}

	@Test
	public void getSeconds_NotEvenNumberGiven_ReturnsO() throws Exception {
		assertEquals("O", bc.getSeconds(3));
	}

	@Test
	public void getTopHours_OneNumberGiven_ReturnsFourLamps() throws Exception {
		assertEquals(4, bc.getTopHours(3).length());
	}

	@Test
	public void getTopHours_NumberFiveGiven_ReturnsTheFirstLigthOn() throws Exception {
		assertEquals("ROOO", bc.getTopHours(5));
	}

	@Test
	public void getTopHours_NumberTeenGiven_ReturnsTheFirstAndSecondLigthOn() throws Exception {
		assertEquals("RROO", bc.getTopHours(10));
	}

	@Test
	public void getBottomHours_OneNumberGiven_ReturnsFourLamps() throws Exception {
		assertEquals(4, bc.getBottomHours(5).length());
	}

	@Test
	public void getBottomHours_NumberOneGiven_ReturnsROOO() throws Exception {
		assertEquals("ROOO", bc.getBottomHours(1));
	}

	@Test
	public void getBottomHours_NumberTwoGiven_ReturnsRROO() throws Exception {
		assertEquals("RROO", bc.getBottomHours(2));
	}

	@Test
	public void getTopMinutes_OneNumberGiven_ReturnsElevenLamps() throws Exception {
		assertEquals(11, bc.getTopMinutes(1).length());
	}

	@Test
	public void getTopMinutes_NumberFiveGiven_ReturnsYOOOOOOOOOO() throws Exception {
		assertEquals("YOOOOOOOOOO", bc.getTopMinutes(5));
	}

	@Test
	public void getTopMinutes_NumberTeenGiven_ReturnsYYOOOOOOOOO() throws Exception {
		assertEquals("YYOOOOOOOOO", bc.getTopMinutes(10));
	}

	@Test
	public void getTopMinutes_NumberFifTeenGiven_ReturnsYYROOOOOOOO() throws Exception {
		assertEquals("YYROOOOOOOO", bc.getTopMinutes(15));
	}

	@Test
	public void getTopMinutes_NumberThirtyGiven_ReturnsYYRYYROOOOO() throws Exception {
		assertEquals("YYRYYROOOOO", bc.getTopMinutes(30));
	}

	@Test
	public void getBottomMinutes_OneNumberGiven_ReturnsFourLamps() throws Exception {
		assertEquals(4, bc.getBottomMinutes(1).length());
	}

	@Test
	public void getBottomMinutes_NumberOneGiven_ReturnsYOOO() throws Exception {
		assertEquals("YOOO", bc.getBottomMinutes(1));
	}

	@Test
	public void getBottomMinutes_NumberTwoGiven_ReturnsYYOO() throws Exception {
		assertEquals("YYOO", bc.getBottomMinutes(2));
	}
	@Test
	public void getBerlinHour_OneStringGiven_ReturnsFiveElemtnsArray() throws Exception {
		assertEquals(5, bc.getBerlinHour("").length);
	}

	@Test
	public void getBerlinHour_OneCorrectStringGiven_ReturnsCorrectBerlinHour() throws Exception {
		String[] assertion = { "Y", "RROO", "RRRO", "YYRYYRYYOOO", "YYOO" };
		String hour = "13:42:22";
		assertEquals(assertion, bc.getBerlinHour(hour));
	}

}


text:
using System;
using System.Collections.Generic;

namespace MsgPack.Serialization.DefaultSerializers
{
	internal sealed class ImmutableStackSerializer<T, TItem> : ImmutableCollectionSerializer<T, TItem>
		where T : IEnumerable<TItem>
	{
		private readonly MessagePackSerializer<TItem> _itemSerializer;

		public ImmutableStackSerializer( SerializationContext ownerContext, PolymorphismSchema itemsSchema )
			: base( ownerContext, itemsSchema )
		{
			this._itemSerializer = ownerContext.GetSerializer<TItem>( itemsSchema );
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "By design" )]
		protected internal override T UnpackFromCore( Unpacker unpacker )
		{
			if ( !unpacker.IsArrayHeader )
			{
				throw SerializationExceptions.NewIsNotArrayHeader();
			}

			var buffer = new TItem[ UnpackHelpers.GetItemsCount( unpacker ) ];

			using ( var subTreeUnpacker = unpacker.ReadSubtree() )
			{
				// Reverse Order
				for ( int i = buffer.Length - 1; i >= 0; i-- )
				{
					if ( !subTreeUnpacker.Read() )
					{
						throw SerializationExceptions.NewUnexpectedEndOfStream();
					}

					buffer[ i ] = this._itemSerializer.UnpackFrom( subTreeUnpacker );
				}
			}

			return factory( buffer );
		}
	}
}


text:
<?php

require_once dirname(__FILE__).'/../lib/orderGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/orderGeneratorHelper.class.php';

/**
 * order actions.
 *
 * @package    CMS
 * @subpackage order
 * @author     Lkhagva-Ochir Narmandakh
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class orderActions extends autoOrderActions
{
    public function preExecute()
    {
        $this->getUser()->setFlash('mainmenu', 'order');
        parent::preExecute();
    }
}


text:
import {
    isError
} from 'lodash';

/**
 * @class
 * @extends {Array}
 */
class ConfigStrategyList extends Array {
    /**
     * @param {*} value
     * @param {Function} predicate
     * @returns {*}
     */
    resolve(value, predicate) {
        for (const resolver of this) {
            try {
                const resolvedValue = resolver(value),
                    throwsError = isError(resolvedValue) || resolvedValue instanceof Error;

                if (predicate(resolvedValue) && !throwsError) {
                    value = resolvedValue;
                    break;
                }
            } catch (err) {} // eslint-disable-line no-empty
        }

        return value;
    }
}

export default ConfigStrategyList;


text:
package workers

type WorkersLogger interface {
	Println(...interface{})
	Printf(string, ...interface{})
}


text:
var ga = require('../galgo');

describe('options', function() {
    it('should has options attribute', function(){
        expect(ga.options).toBeDefined();
    });

    it('should has options.chromosomeLength', function(){
        expect(ga.options.chromosomeLength).toBeDefined();
    });
    it('should has options.generationsQty', function(){
        expect(ga.options.generationsQty).toBeDefined();
    });
    it('should has options.mutationProbability', function(){
        expect(ga.options.mutationProbability).toBeDefined();
    });
    it('should has options.populationSize', function(){
        expect(ga.options.populationSize).toBeDefined();
    });
});

describe('options.populationSize', function(){
    var defaultValue = 250;

    it('should defaults to ' + defaultValue, function(){
        expect(ga.options.populationSize).toBe(defaultValue);
    });

    it('should generate initial population of specified size', function(){
        ga.options.populationSize = 20;
        var result = ga.run();
        expect(result.history[0].individualsQty).toBe(20);
    });
});

describe('options.generationsQty', function(){
    var defaultValue = 25;

    it('should defaults to ' + defaultValue, function(){
        expect(ga.options.generationsQty).toBe(defaultValue);
    });

    it('should run specified quantity of generations', function(){
        ga.options.generationsQty = 20;
        var result = ga.run();
        expect(result.history.length).toBe(20);
    });
});

describe('options.chromosomeLength', function(){
    var defaultValue = 10;

    it('should defaults to ' + defaultValue, function(){
        expect(ga.options.chromosomeLength).toBe(defaultValue);
    });
});


text:
/* $Id: natpmpc.c,v 1.13 2012/08/21 17:23:38 nanard Exp $ */
/* libnatpmp
Copyright (c) 2007-2011, Thomas BERNARD
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * The name of the author may not be used to endorse or promote products
	  derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <errno.h>
#include <string.h>
#if defined(_MSC_VER)
#if _MSC_VER >= 1400
#define strcasecmp _stricmp
#else
#define strcasecmp stricmp
#endif
#else
#include <unistd.h>
#endif
#ifdef WIN32
#include <winsock2.h>
#else
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
#include "natpmp.h"

void usage(FILE * out, const char * argv0)
{
	fprintf(out, "Usage :\n");
	fprintf(out, "  %s [options]\n", argv0);
	fprintf(out, "\tdisplay the public IP address.\n");
	fprintf(out, "  %s -h\n", argv0);
	fprintf(out, "\tdisplay this help screen.\n");
	fprintf(out, "  %s [options] -a <public port> <private port> <protocol> [lifetime]\n", argv0);
	fprintf(out, "\tadd a port mapping.\n");
	fprintf(out, "\nOption available :\n");
	fprintf(out, "  -g ipv4address\n");
	fprintf(out, "\tforce the gateway to be used as destination for NAT-PMP commands.\n");
	fprintf(out, "\n  In order to remove a mapping, set it with a lifetime of 0 seconds.\n");
	fprintf(out, "  To remove all mappings for your machine, use 0 as private port and lifetime.\n");
}

/* sample code for using libnatpmp */
int main(int argc, char * * argv)
{
	natpmp_t natpmp;
	natpmpresp_t response;
	int r;
	int sav_errno;
	struct timeval timeout;
	fd_set fds;
	int i;
	int protocol = 0;
	uint16_t privateport = 0;
	uint16_t publicport = 0;
	uint32_t lifetime = 3600;
	int command = 0;
	int forcegw = 0;
	in_addr_t gateway = 0;
	struct in_addr gateway_in_use;

#ifdef WIN32
	WSADATA wsaData;
	int nResult = WSAStartup(MAKEWORD(2,2), &wsaData);
	if(nResult != NO_ERROR)
	{
		fprintf(stderr, "WSAStartup() failed.\n");
		return -1;
	}
#endif

	/* argument parsing */
	for(i=1; i<argc; i++) {
		if(argv[i][0] == '-') {
			switch(argv[i][1]) {
			case 'h':
				usage(stdout, argv[0]);
				return 0;
			case 'g':
				forcegw = 1;
				if(argc < i + 1) {
					fprintf(stderr, "Not enough arguments for option -%c\n", argv[i][1]);
					return 1;
				}
				gateway = inet_addr(argv[++i]);
				break;
			case 'a':
				command = 'a';
				if(argc < i + 4) {
					fprintf(stderr, "Not enough arguments for option -%c\n", argv[i][1]);
					return 1;
				}
				i++;
				if(1 != sscanf(argv[i], "%hu", &publicport)) {
					fprintf(stderr, "%s is not a correct 16bits unsigned integer\n", argv[i]);
					return 1;
				}
				i++;
				if(1 != sscanf(argv[i], "%hu", &privateport)) {
					fprintf(stderr, "%s is not a correct 16bits unsigned integer\n", argv[i]);
					return 1;
				}
				i++;
				if(0 == strcasecmp(argv[i], "tcp"))
					protocol = NATPMP_PROTOCOL_TCP;
				else if(0 == strcasecmp(argv[i], "udp"))
					protocol = NATPMP_PROTOCOL_UDP;
				else {
					fprintf(stderr, "%s is not a valid protocol\n", argv[i]);
					return 1;
				}
				if(argc > i + 1) {
					if(1 != sscanf(argv[i+1], "%u", &lifetime)) {
						fprintf(stderr, "%s is not a correct 32bits unsigned integer\n", argv[i]);
					} else {
						i++;
					}
				}
				break;
			default:
				fprintf(stderr, "Unknown option %s\n", argv[i]);
				usage(stderr, argv[0]);
				return 1;
			}
		} else {
			fprintf(stderr, "Unknown option %s\n", argv[i]);
			usage(stderr, argv[0]);
			return 1;
		}
	}

	/* initnatpmp() */
	r = initnatpmp(&natpmp, forcegw, gateway);
	printf("initnatpmp() returned %d (%s)\n", r, r?"FAILED":"SUCCESS");
	if(r<0)
		return 1;

	gateway_in_use.s_addr = natpmp.gateway;
	printf("using gateway : %s\n", inet_ntoa(gateway_in_use));

	/* sendpublicaddressrequest() */
	r = sendpublicaddressrequest(&natpmp);
	printf("sendpublicaddressrequest returned %d (%s)\n",
	       r, r==2?"SUCCESS":"FAILED");
	if(r<0)
		return 1;

	do {
		FD_ZERO(&fds);
		FD_SET(natpmp.s, &fds);
		getnatpmprequesttimeout(&natpmp, &timeout);
		r = select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
		if(r<0) {
			fprintf(stderr, "select()");
			return 1;
		}
		r = readnatpmpresponseorretry(&natpmp, &response);
		sav_errno = errno;
		printf("readnatpmpresponseorretry returned %d (%s)\n",
		       r, r==0?"OK":(r==NATPMP_TRYAGAIN?"TRY AGAIN":"FAILED"));
		if(r<0 && r!=NATPMP_TRYAGAIN) {
#ifdef ENABLE_STRNATPMPERR
			fprintf(stderr, "readnatpmpresponseorretry() failed : %s\n",
			        strnatpmperr(r));
#endif
			fprintf(stderr, "  errno=%d '%s'\n",
			        sav_errno, strerror(sav_errno));
		}
	} while(r==NATPMP_TRYAGAIN);
	if(r<0)
		return 1;

	/* TODO : check that response.type == 0 */
	printf("Public IP address : %s\n", inet_ntoa(response.pnu.publicaddress.addr));
	printf("epoch = %u\n", response.epoch);

	if(command == 'a') {
		/* sendnewportmappingrequest() */
		r = sendnewportmappingrequest(&natpmp, protocol,
        	                      privateport, publicport,
								  lifetime);
		printf("sendnewportmappingrequest returned %d (%s)\n",
		       r, r==12?"SUCCESS":"FAILED");
		if(r < 0)
			return 1;

		do {
			FD_ZERO(&fds);
			FD_SET(natpmp.s, &fds);
			getnatpmprequesttimeout(&natpmp, &timeout);
			select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
			r = readnatpmpresponseorretry(&natpmp, &response);
			printf("readnatpmpresponseorretry returned %d (%s)\n",
			       r, r==0?"OK":(r==NATPMP_TRYAGAIN?"TRY AGAIN":"FAILED"));
		} while(r==NATPMP_TRYAGAIN);
		if(r<0) {
#ifdef ENABLE_STRNATPMPERR
			fprintf(stderr, "readnatpmpresponseorretry() failed : %s\n",
			        strnatpmperr(r));
#endif
			return 1;
		}

		printf("Mapped public port %hu protocol %s to local port %hu "
		       "liftime %u\n",
	    	   response.pnu.newportmapping.mappedpublicport,
			   response.type == NATPMP_RESPTYPE_UDPPORTMAPPING ? "UDP" :
			    (response.type == NATPMP_RESPTYPE_TCPPORTMAPPING ? "TCP" :
			     "UNKNOWN"),
			   response.pnu.newportmapping.privateport,
			   response.pnu.newportmapping.lifetime);
		printf("epoch = %u\n", response.epoch);
	}

	r = closenatpmp(&natpmp);
	printf("closenatpmp() returned %d (%s)\n", r, r==0?"SUCCESS":"FAILED");
	if(r<0)
		return 1;

	return 0;
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Utilities;
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeMap;

/**
 *This class is used to take in File obects and translate them into processable data.
 *
 * @author Yasen and Nels
 */

public class FileReader {

    public PrintWriter scoreWriter;
    public Scanner scoreReader;

    public PrintWriter levelWriter;
    public Scanner levelReader;

    public FileLoader loader;

    public FileReader()
    {
        loader = new FileLoader();
        try{
            scoreReader = new Scanner(loader.getHighScoreFile());
        }
        catch(Exception e){}
    }

    /**
     * Loads the "settings.txt" file through a FileLoader and translates each line
     * in a string[].
     *
     * string[0] holds the value for the master volume
     * string[1] holds the value for the music volume
     * string[2] holds the value for the global mute
     * string[3] holds the value for fullscreen
     *
     * @return sting A String array object containing the settings data
     */
    public String[] readSettings()throws FileNotFoundException{
        levelReader = new Scanner(loader.getSettings());
        String[] string = new String[4];
        string[0] = levelReader.nextLine();
        string[1] = levelReader.nextLine();
        string[2] = levelReader.nextLine();
        string[3] = levelReader.nextLine();
        return string;
    }
     /**
      * Reads a given file and formats it into a Level object. A Level object
      * contains all the data required to build a maze.
     *      *
     * @param File a file object for the desired savefile.
     * @return level A Level object containing all the data needed to (re)build a game
     */
    public Level readLevel(File f)throws FileNotFoundException{
        int score = 0;
        boolean portalgun;
        boolean showPath;
        Scanner lvlReader = new Scanner(f);
        String line ="";
        Stack<Position> positions = new Stack<>();

        //Get the score
        lvlReader.hasNextLine();
        line = lvlReader.nextLine().split("=")[1];
        score = Integer.parseInt(line.trim());

        //Get portalGun
        line = lvlReader.nextLine().split("=")[1];
        if(line.contains("true")){
            portalgun = true;
        }
        else{
            portalgun = false;
        }
        //Get showPath
        line = lvlReader.nextLine().split("=")[1];
        if(line.contains("true")){
            showPath = true;
        }
        else{
            showPath = false;
        }
        //Get stack
        line = lvlReader.nextLine();
        String[] stackString = new String[line.length()];
        stackString = line.split("-");
        String[] posString = new String[3];
        for(String pos : stackString){
            posString = pos.split(",");
            positions.push(new Position(Integer.parseInt(posString[0]),
                                       Integer.parseInt(posString[1]),
                                       Integer.parseInt(posString[2])));
        }

        //Getting Layout
        ArrayList<String> vArray = new ArrayList<String>();
        while(lvlReader.hasNextLine()){
            vArray.add(lvlReader.nextLine());
        }
        int[][] values = new int[vArray.size()][vArray.get(0).length()];
        for(int y = 0; y < vArray.size(); y++ ){
            for(int x = 0; x < vArray.get(0).length(); x++ ){
                values[y][x] = Integer.parseInt(""+vArray.get(y).charAt(x));
            }
        }

        Level level;

        level = new Level(values, score, portalgun, positions, showPath);
        return level;

    }

    /**
     * Returns a sorted TreeMap containing the highscores from the high-score file;
     * Reads the file  containing the high-scores and formats it into a TreeMap.
     * The keys for this treemap are various player's names and the values contain their scores
     *
     * @return Map A sorted TreeMap where the values of the players are sorted ascending by score
     */

    public Map<String,Integer> getHighScores(){
        String line;
        String name;

        Map<String, Integer> scores = new TreeMap<>();

        int score;
            for(int i = 0; i <5; i++){
                if(scoreReader.hasNext()){
                    line = scoreReader.nextLine();
                    name =  line.split(":")[0];
                    score = Integer.parseInt(line.split(":")[1]);
                    scores.put(name, score);
                }
            }
        return sortByComparator(scores);
    }

    /**
     * Returns a sorted TreeMap, where the keys are sorted ascending by their values.
     *
     * @param unsortMap a raw unsorted TreeMap object
     * @return Map A sorted TreeMap where the keys are sorted ascending by value
     */
    private static Map sortByComparator(Map unsortMap) {

		List list = new LinkedList(unsortMap.entrySet());
 		Collections.sort(list, new Comparator() {
			public int compare(Object o1, Object o2) {
				return ((Comparable) ((Map.Entry) (o1)).getValue())
                                       .compareTo(((Map.Entry) (o2)).getValue());
			}
		});
		Map sortedMap = new LinkedHashMap();
		for (Iterator it = list.iterator(); it.hasNext();) {
			Map.Entry entry = (Map.Entry) it.next();
			sortedMap.put(entry.getKey(), entry.getValue());
		}
		return sortedMap;
	}

    /**
     * Returns an ArrayList<Sting> containing sorted high score values in order separated by ":"
     * If there are less than 5 noted high scores, this method fills the empty slots with "****:9999"
     *
     * @return scoreList An ArrayList<Sting> formatted: "PLAYERNAME:SCORE"
     */
    public ArrayList<String> printMap(){
                System.out.println("Printing");
                Map<String,Integer> map = getHighScores();
                ArrayList<String> scoreList = new ArrayList<String>();
                for (Map.Entry entry : map.entrySet()) {
			System.out.println("Key : " + entry.getKey()
                                   + " Value : " + entry.getValue());
                        scoreList.add(""+entry.getKey()+":"+entry.getValue());
		}

                //Fills empty slots
                if(scoreList.size()<5){
                    int remainder = 5-scoreList.size();
                    for(int i = 0 ; i < remainder;i++){
                        scoreList.add(i,"****:9999");
                    }
                }
                return scoreList;
	}
}


text:
Get up and running with [Docker](http://www.docker.io/) in no time flat.

## Requirements

* [Virtual Box](https://www.virtualbox.org/)
* [Vagrant](http://www.vagrantup.com/)

Note: This project uses the **trusty** box provided by Ubuntu.

## Usage

```shell
git clone git@github.com:hopsoft/docker_up.git
cd docker_up
vagrant up
vagrant ssh
docker -v
```

### Hello World

Note: The the first run downloads the Docker image. Subsequent runs are much faster.

```shell
sudo docker run ubuntu echo 'Hello from inside a Docker container!'
```

### Build and run an Image from a Dockerfile

In this example we create a Docker image named `example/hello`, then run the `hello` command in the container.

```shell
sudo docker build -t example/hello /vagrant
sudo docker run example/hello
```

__Thats it!__
Poke around the project to see just how easy this stuff is.

Now start writing some [Dockerfiles](http://docs.docker.com/reference/builder/).


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>WebStorage Test: Storage_clear_empty_storage</title>
<link rel="author" title="Intel" href="http://www.intel.com" >
<link rel="help" href="http://www.w3.org/TR/2011/CR-webstorage-20111208/#dom-storage-clear" >


text:
package pl.natekrank.model.dto;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import lombok.Getter;
import lombok.Setter;
import java.util.List;

@Getter
@Setter
public class QuestionDto {
    private Long id;

    private List<AnswerDto> answers;

    private boolean multiSelect;
    private String text;
}


text:
package uk.gov.register.store.postgres;

import org.skife.jdbi.v2.sqlobject.Binder;
import org.skife.jdbi.v2.sqlobject.BinderFactory;
import org.skife.jdbi.v2.sqlobject.BindingAnnotation;
import uk.gov.register.core.Item;

import java.lang.annotation.*;
import java.sql.SQLException;

@BindingAnnotation(BindItem.ItemBinderFactory.class)
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER})
public @interface BindItem {
    class ItemBinderFactory implements BinderFactory {
        public Binder build(Annotation annotation) {
            return (Binder<BindItem, Item>) (q, bind, arg) -> {
                q.bind("sha256hex", arg.getSha256hex().getValue());
                q.bind("blob_hash", arg.getBlobHash().getValue());
                try {
                    q.bind("content", arg.getContentAsJsonb());
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            };
        }
    }
}


text:
"""
Web API consumer for www.timeapi.org
"""
import urllib2
from urllib2 import URLError
from dateutil.parser import parse
from dateutil import tz
from datetime import datetime

url = "http://www.timeapi.org/utc/now"

def remote_now():
    """ Return the a local time zone datetime or raise an URLError """
    socket = urllib2.urlopen(url)
    text = socket.read()
    socket.close()
    return parse(text).replace(tzinfo=tz.tzutc(), microsecond=0).astimezone(tz.tzlocal())

def localhost_now():
    """ Return the a local time zone datetime from the localhost """
    return datetime.utcnow().replace(tzinfo=tz.tzutc(), microsecond=0).astimezone(tz.tzlocal())

def now(return_type=datetime):
    """ Try with remote_now first, otherwise use localhost_now """
    try:
        d = remote_now()
    except URLError:
        print("Warning: Internet isn't available then using localhost time.")
        d = localhost_now()
    if return_type is str:
        return tostr(d)
    else:
        return d

def tostr(datetime_obj):
    return datetime_obj.strftime('%Y-%m-%d %H:%M:%S %z')


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebInterface.Model;

namespace WebInterface.Repository.Writings
{
    public interface IWritingRepository
    {
        Writing Get(string writerId, string writingId);
        object SetLine(string writerId, string writingId, int strokeIndex, string type);
        object RemoveLine(string writerId, string writingId, int strokeIndex);
        object Set(string writerId, string writingId, string type);
    }
}


text:
How-to: Customize DocFX Flavored Markdown
=========================================

Customize Renderer
------------------

DocFX Flavored Markdown introduced @Microsoft.DocAsCode.Dfm.IDfmCustomizedRendererPartProvider from v2.17.
In older version, you need to define a new markdown renderer and export a new [markdown service](xref:Microsoft.DocAsCode.Plugins.IMarkdownServiceProvider).

Now, you can customize a part of renderer as a DocFX plugin.

### Default rendering for block code

For standard markdown, block code is following:
````md
```cs
Console.WriteLine();
```
````
And the html will be:
```html
<pre><code class="lang-cs">Console.WriteLine();
</code></pre>
```

### Set goal
Now we want any csharp code (`cs`, `c#`, `csharp`) will generate following html:
```html
<pre><code class="lang-csharp">Console.WriteLine();
</code></pre>
```

### Create customize rendering plugin project
To complete this goal, we need to create a customized rendering plugin.

1. Create a project, set project names.
2. Add required nuget package: `Microsoft.DocAsCode.Dfm` with version >= 2.17.
3. Create a class, for example with name `CustomBlockCodeRendererPart`.
4. Inherit @"Microsoft.DocAsCode.Dfm.DfmCustomizedRendererPartBase`3" (which implements @Microsoft.DocAsCode.Dfm.IDfmCustomizedRendererPart).
5. Implements renderer part class like following:

   ```cs
   public class CustomBlockCodeRendererPart : DfmCustomizedRendererPartBase<IMarkdownRenderer, MarkdownCodeBlockToken, MarkdownBlockContext>
   {
       public override string Name => "MyFirstCustomRendererPart";

       public override bool Match(IMarkdownRenderer renderer, MarkdownCodeBlockToken token, MarkdownBlockContext context)
       {
           return token.Lang == "cs" || token.Lang == "c#" || token.Lang == "csharp";
       }

       public override StringBuffer Render(IMarkdownRenderer renderer, MarkdownCodeBlockToken token, MarkdownBlockContext context)
       {
           StringBuffer result = "<pre><code class=\"";
           result += renderer.Options.LangPrefix;
           result += "csharp";
           result += "\">";
           result += token.Code;
           result += "\n</code></pre>";
           return result;
       }
   }
   ```

   > [!tip]
   > If your part require dispose some resource, please implement @System.IDisposable.

6. Create another class, for example with name `CustomBlockCodeRendererPartProvider`
7. Implements @Microsoft.DocAsCode.Dfm.IDfmCustomizedRendererPartProvider and export like following:

   ```cs
   [Export(typeof(IDfmCustomizedRendererPartProvider))]
   public class CustomBlockCodeRendererPartProvider : IDfmCustomizedRendererPartProvider
   {
       public IEnumerable<IDfmCustomizedRendererPart> CreateParts(IReadOnlyDictionary<string, object> parameters)
       {
           yield return new CustomBlockCodeRendererPart();
       }
   }
   ```
8. Build the project.

### Enable customize rendering plugin

1. Copy output assemblies to x\plugins, x is any folder.
2. Run `docfx.exe` with template x ([details](howto_build_your_own_type_of_documentation_with_custom_plug-in.md#enable-plug-in))

Customize Markdown Extension
----------------------------
In DocFX Flavored Markdown, we can add new markdown extensions by existing plugin system.

### Compare with markdown lite

In markdown lite, we can [customize markdown extension](intro_markdown_lite.md#how-to-customize-markdown-syntax) by following steps:
1. Create a new token
2. Create a new rule
3. Create a new renderer
4. Create a new engine builder

In DocFX Flavored Markdown, we introduced @Microsoft.DocAsCode.Dfm.IDfmEngineCustomizer from v2.17.

Now, we need to following step:
1. Create a new token
2. Create a new rule
3. Create a new renderer part
4. Create a new renderer part provider
5. Create a new DFM engine customizer

Difference:
* DFM markdown extension is a part plugin, markdown lite is a whole engine plugin.
* You can combine two or more DFM markdown extensions, but you must choose one of markdown lite engine plugin.

### How to create a new markdown extension by plugin
1. Define markdown syntax (same with [markdown lite](intro_markdown_lite.md#define-markdown-syntax)).
2. Select token kind (same with [markdown lite](intro_markdown_lite.md#select-token-kind)).
3. Define token (same with [markdown lite](intro_markdown_lite.md#define-token)).
4. Define rule (same with [markdown lite](intro_markdown_lite.md#define-rule)).
5. Create a new renderer part.

   ```cs
   public sealed class LabelRendererPart : DfmCustomizedRendererPartBase<IMarkdownRenderer, MarkdownMyLabelBlockToken, MarkdownBlockContext>
   {
       public override string Name => "LabelRendererPart";

       public override bool Match(IMarkdownRenderer renderer, MarkdownMyLabelBlockToken token, MarkdownBlockContext context) => true;

       public override StringBuffer Render(IMarkdownRenderer renderer, MarkdownMyLabelBlockToken token, MarkdownBlockContext context) => "<div id=\"" + token.Label + "\"></div>";
   }
   ```
6. Create a new renderer part provider.

   ```cs
   [Export(typeof(IDfmCustomizedRendererPartProvider))]
   public class LabelRendererPartProvider : IDfmCustomizedRendererPartProvider
   {
       public IEnumerable<IDfmCustomizedRendererPart> CreateParts(IReadOnlyDictionary<string, object> parameters)
       {
           yield return new LabelRendererPart();
       }
   }
   ```
7. Create a new DFM engine customizer.

   ```cs
   [Export(typeof(IDfmEngineCustomizer))]
   public class MyDfmEngineCustomizer : IDfmEngineCustomizer
   {
       public void Customize(DfmEngineBuilder builder, IReadOnlyDictionary<string, object> parameters)
       {
           var index = builder.BlockRules.FindIndex(r => r is MarkdownHeadingBlockRule);
           builder.BlockRules = builder.BlockRules.Insert(index, new MyHeadingRule());
       }
   }
   ```
8. Build project.
9. Enable and test your plugin.


text:
/**
 * \page asfdoc_sam0_nvm_basic_use_case Quick Start Guide for NVM - Basic
 *
 * In this use case, the NVM module is configured for:
 *  \li Power reduction mode enabled after sleep until first NVM access
 *  \li Automatic page write commands issued to commit data as pages are written
 *      to the internal buffer
 *  \li Zero wait states when reading FLASH memory
 *  \li No memory space for the EEPROM
 *  \li No protected bootloader section
 *
 * This use case sets up the NVM controller to write a page of data to flash,
 * and the read it back into the same buffer.
 *
 * \section asfdoc_sam0_nvm_basic_use_case_setup Setup
 *
 * \subsection asfdoc_sam0_nvm_basic_use_case_setup_prereq Prerequisites
 * There are no special setup requirements for this use-case.
 *
 * \subsection asfdoc_sam0_nvm_basic_use_case_setup_code Code
 * Copy-paste the following setup code to your user application:
 * \snippet qs_nvm_basic.c setup
 *
 * Add to user application initialization (typically the start of \c main()):
 * \snippet qs_nvm_basic.c setup_init
 *
 * \subsection asfdoc_sam0_nvm_basic_use_case_setup_flow Workflow
 * -# Create an NVM module configuration struct, which can be filled
 *    out to adjust the configuration of the NVM controller.
 *    \snippet qs_nvm_basic.c setup_1
 * -# Initialize the NVM configuration struct with the module's default
 *    values.
 *    \snippet qs_nvm_basic.c setup_2
 *    \note This should always be performed before using the configuration
 *          struct to ensure that all values are initialized to known default
 *          settings.
 *
 * -# Configure NVM controller with the created configuration struct settings.
 *    \snippet qs_nvm_basic.c setup_3
 *
 * \section asfdoc_sam0_nvm_basic_use_case_main Use Case
 *
 * \subsection asfdoc_sam0_nvm_basic_use_case_main_code Code
 * Copy-paste the following code to your user application:
 * \snippet qs_nvm_basic.c main
 *
 * \subsection asfdoc_sam0_nvm_basic_use_case_main_flow Workflow
 * -# Set up a buffer one NVM page in size to hold data to read or write into
 *    NVM memory.
 *    \snippet qs_nvm_basic.c main_1
 * -# Fill the buffer with a pattern of data.
 *    \snippet qs_nvm_basic.c main_2
 * -# Create a variable to hold the error status from the called NVM functions.
 *    \snippet qs_nvm_basic.c main_3
 * -# Erase a page of NVM data. As the NVM could be busy initializing or
 *    completing a previous operation, a loop is used to retry the command while
 *    the NVM controller is busy.
 *    \snippet qs_nvm_basic.c main_4
 *    \note This must be performed before writing new data into a NVM page.
 *
 * -# Write the buffer of data to the previously erased page of the NVM.
 *    \snippet qs_nvm_basic.c main_5
 *    \note The new data will be written to NVM memory automatically, as the
 *          NVM controller is configured in automatic page write mode.
 *
 * -# Read back the written page of page from the NVM into the buffer.
 *    \snippet qs_nvm_basic.c main_6
 */
 /**
 * Support and FAQ: visit Atmel Support
 */


text:
#include "defs.h"
#include "inferior.h"
#include "gdbcore.h"
#include "regcache.h"
#include "regset.h"
#include "linux-nat.h"
#include "amd64-linux-tdep.h"
#include "linux-btrace.h"
#include "btrace.h"

#include "gdb_assert.h"
#include <string.h>
#include "elf/common.h"
#include <sys/uio.h>
#include <sys/ptrace.h>
#include <sys/debugreg.h>
#include <sys/syscall.h>
#include <sys/procfs.h>
#include <sys/user.h>
#include <asm/prctl.h>
/* FIXME ezannoni-2003-07-09: we need <sys/reg.h> to be included after
   <asm/ptrace.h> because the latter redefines FS and GS for no apparent
   reason, and those definitions don't match the ones that libpthread_db
   uses, which come from <sys/reg.h>.  */
/* ezannoni-2003-07-09: I think this is fixed.  The extraneous defs have
   been removed from ptrace.h in the kernel.  However, better safe than
   sorry.  */
#include <asm/ptrace.h>
#include <sys/reg.h>
#include "gdb_proc_service.h"

/* Prototypes for supply_gregset etc.  */
#include "gregset.h"

#include "amd64-tdep.h"
#include "i386-linux-tdep.h"
#include "amd64-nat.h"
#include "i386-nat.h"
#include "i386-xstate.h"

#ifndef PTRACE_GETREGSET
#define PTRACE_GETREGSET	0x4204
#endif

#ifndef PTRACE_SETREGSET
#define PTRACE_SETREGSET	0x4205
#endif

/* Per-thread arch-specific data we want to keep.  */

struct arch_lwp_info
{
  /* Non-zero if our copy differs from what's recorded in the thread.  */
  int debug_registers_changed;
};

/* Does the current host support PTRACE_GETREGSET?  */
static int have_ptrace_getregset = -1;

/* Mapping between the general-purpose registers in GNU/Linux x86-64
   `struct user' format and GDB's register cache layout for GNU/Linux
   i386.

   Note that most GNU/Linux x86-64 registers are 64-bit, while the
   GNU/Linux i386 registers are all 32-bit, but since we're
   little-endian we get away with that.  */

/* From <sys/reg.h> on GNU/Linux i386.  */
static int amd64_linux_gregset32_reg_offset[] =
{
  RAX * 8, RCX * 8,		/* %eax, %ecx */
  RDX * 8, RBX * 8,		/* %edx, %ebx */
  RSP * 8, RBP * 8,		/* %esp, %ebp */
  RSI * 8, RDI * 8,		/* %esi, %edi */
  RIP * 8, EFLAGS * 8,		/* %eip, %eflags */
  CS * 8, SS * 8,		/* %cs, %ss */
  DS * 8, ES * 8,		/* %ds, %es */
  FS * 8, GS * 8,		/* %fs, %gs */
  -1, -1, -1, -1, -1, -1, -1, -1,
  -1, -1, -1, -1, -1, -1, -1, -1,
  -1, -1, -1, -1, -1, -1, -1, -1, -1,
  -1, -1, -1, -1, -1, -1, -1, -1,
  -1, -1, -1, -1,		/* MPX registers BND0 ... BND3.  */
  -1, -1,			/* MPX registers BNDCFGU, BNDSTATUS.  */
  ORIG_RAX * 8,			/* "orig_eax" */
};

/* Transfering the general-purpose registers between GDB, inferiors
   and core files.  */

/* Fill GDB's register cache with the general-purpose register values
   in *GREGSETP.  */

void
supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
{
  amd64_supply_native_gregset (regcache, gregsetp, -1);
}

/* Fill register REGNUM (if it is a general-purpose register) in
   *GREGSETP with the value in GDB's register cache.  If REGNUM is -1,
   do this for all registers.  */

void
fill_gregset (const struct regcache *regcache,
	      elf_gregset_t *gregsetp, int regnum)
{
  amd64_collect_native_gregset (regcache, gregsetp, regnum);
}

/* Transfering floating-point registers between GDB, inferiors and cores.  */

/* Fill GDB's register cache with the floating-point and SSE register
   values in *FPREGSETP.  */

void
supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
{
  amd64_supply_fxsave (regcache, -1, fpregsetp);
}

/* Fill register REGNUM (if it is a floating-point or SSE register) in
   *FPREGSETP with the value in GDB's register cache.  If REGNUM is
   -1, do this for all registers.  */

void
fill_fpregset (const struct regcache *regcache,
	       elf_fpregset_t *fpregsetp, int regnum)
{
  amd64_collect_fxsave (regcache, regnum, fpregsetp);
}

/* Transferring arbitrary registers between GDB and inferior.  */

/* Fetch register REGNUM from the child process.  If REGNUM is -1, do
   this for all registers (including the floating point and SSE
   registers).  */

static void
amd64_linux_fetch_inferior_registers (struct target_ops *ops,
				      struct regcache *regcache, int regnum)
{
  struct gdbarch *gdbarch = get_regcache_arch (regcache);
  int tid;

  /* GNU/Linux LWP ID's are process ID's.  */
  tid = ptid_get_lwp (inferior_ptid);
  if (tid == 0)
    tid = ptid_get_pid (inferior_ptid); /* Not a threaded program.  */

  if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
    {
      elf_gregset_t regs;

      if (ptrace (PTRACE_GETREGS, tid, 0, (long) &regs) < 0)
	perror_with_name (_("Couldn't get registers"));

      amd64_supply_native_gregset (regcache, &regs, -1);
      if (regnum != -1)
	return;
    }

  if (regnum == -1 || !amd64_native_gregset_supplies_p (gdbarch, regnum))
    {
      elf_fpregset_t fpregs;

      if (have_ptrace_getregset)
	{
	  char xstateregs[I386_XSTATE_MAX_SIZE];
	  struct iovec iov;

	  iov.iov_base = xstateregs;
	  iov.iov_len = sizeof (xstateregs);
	  if (ptrace (PTRACE_GETREGSET, tid,
		      (unsigned int) NT_X86_XSTATE, (long) &iov) < 0)
	    perror_with_name (_("Couldn't get extended state status"));

	  amd64_supply_xsave (regcache, -1, xstateregs);
	}
      else
	{
	  if (ptrace (PTRACE_GETFPREGS, tid, 0, (long) &fpregs) < 0)
	    perror_with_name (_("Couldn't get floating point status"));

	  amd64_supply_fxsave (regcache, -1, &fpregs);
	}
    }
}

/* Store register REGNUM back into the child process.  If REGNUM is
   -1, do this for all registers (including the floating-point and SSE
   registers).  */

static void
amd64_linux_store_inferior_registers (struct target_ops *ops,
				      struct regcache *regcache, int regnum)
{
  struct gdbarch *gdbarch = get_regcache_arch (regcache);
  int tid;

  /* GNU/Linux LWP ID's are process ID's.  */
  tid = ptid_get_lwp (inferior_ptid);
  if (tid == 0)
    tid = ptid_get_pid (inferior_ptid); /* Not a threaded program.  */

  if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
    {
      elf_gregset_t regs;

      if (ptrace (PTRACE_GETREGS, tid, 0, (long) &regs) < 0)
	perror_with_name (_("Couldn't get registers"));

      amd64_collect_native_gregset (regcache, &regs, regnum);

      if (ptrace (PTRACE_SETREGS, tid, 0, (long) &regs) < 0)
	perror_with_name (_("Couldn't write registers"));

      if (regnum != -1)
	return;
    }

  if (regnum == -1 || !amd64_native_gregset_supplies_p (gdbarch, regnum))
    {
      elf_fpregset_t fpregs;

      if (have_ptrace_getregset)
	{
	  char xstateregs[I386_XSTATE_MAX_SIZE];
	  struct iovec iov;

	  iov.iov_base = xstateregs;
	  iov.iov_len = sizeof (xstateregs);
	  if (ptrace (PTRACE_GETREGSET, tid,
		      (unsigned int) NT_X86_XSTATE, (long) &iov) < 0)
	    perror_with_name (_("Couldn't get extended state status"));

	  amd64_collect_xsave (regcache, regnum, xstateregs, 0);

	  if (ptrace (PTRACE_SETREGSET, tid,
		      (unsigned int) NT_X86_XSTATE, (long) &iov) < 0)
	    perror_with_name (_("Couldn't write extended state status"));
	}
      else
	{
	  if (ptrace (PTRACE_GETFPREGS, tid, 0, (long) &fpregs) < 0)
	    perror_with_name (_("Couldn't get floating point status"));

	  amd64_collect_fxsave (regcache, regnum, &fpregs);

	  if (ptrace (PTRACE_SETFPREGS, tid, 0, (long) &fpregs) < 0)
	    perror_with_name (_("Couldn't write floating point status"));
	}
    }
}

/* Support for debug registers.  */

static unsigned long
amd64_linux_dr_get (ptid_t ptid, int regnum)
{
  int tid;
  unsigned long value;

  tid = ptid_get_lwp (ptid);
  if (tid == 0)
    tid = ptid_get_pid (ptid);

  errno = 0;
  value = ptrace (PTRACE_PEEKUSER, tid,
		  offsetof (struct user, u_debugreg[regnum]), 0);
  if (errno != 0)
    perror_with_name (_("Couldn't read debug register"));

  return value;
}

/* Set debug register REGNUM to VALUE in only the one LWP of PTID.  */

static void
amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
{
  int tid;

  tid = ptid_get_lwp (ptid);
  if (tid == 0)
    tid = ptid_get_pid (ptid);

  errno = 0;
  ptrace (PTRACE_POKEUSER, tid,
	  offsetof (struct user, u_debugreg[regnum]), value);
  if (errno != 0)
    perror_with_name (_("Couldn't write debug register"));
}

/* Return the inferior's debug register REGNUM.  */

static CORE_ADDR
amd64_linux_dr_get_addr (int regnum)
{
  /* DR6 and DR7 are retrieved with some other way.  */
  gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR);

  return amd64_linux_dr_get (inferior_ptid, regnum);
}

/* Return the inferior's DR7 debug control register.  */

static unsigned long
amd64_linux_dr_get_control (void)
{
  return amd64_linux_dr_get (inferior_ptid, DR_CONTROL);
}

/* Get DR_STATUS from only the one LWP of INFERIOR_PTID.  */

static unsigned long
amd64_linux_dr_get_status (void)
{
  return amd64_linux_dr_get (inferior_ptid, DR_STATUS);
}

/* Callback for iterate_over_lwps.  Update the debug registers of
   LWP.  */

static int
update_debug_registers_callback (struct lwp_info *lwp, void *arg)
{
  if (lwp->arch_private == NULL)
    lwp->arch_private = XCNEW (struct arch_lwp_info);

  /* The actual update is done later just before resuming the lwp, we
     just mark that the registers need updating.  */
  lwp->arch_private->debug_registers_changed = 1;

  /* If the lwp isn't stopped, force it to momentarily pause, so we
     can update its debug registers.  */
  if (!lwp->stopped)
    linux_stop_lwp (lwp);

  /* Continue the iteration.  */
  return 0;
}

/* Set DR_CONTROL to CONTROL in all LWPs of the current inferior.  */

static void
amd64_linux_dr_set_control (unsigned long control)
{
  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));

  iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
}

/* Set address REGNUM (zero based) to ADDR in all LWPs of the current
   inferior.  */

static void
amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));

  gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);

  iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
}

/* Called when resuming a thread.
   If the debug regs have changed, update the thread's copies.  */

static void
amd64_linux_prepare_to_resume (struct lwp_info *lwp)
{
  int clear_status = 0;

  /* NULL means this is the main thread still going through the shell,
     or, no watchpoint has been set yet.  In that case, there's
     nothing to do.  */
  if (lwp->arch_private == NULL)
    return;

  if (lwp->arch_private->debug_registers_changed)
    {
      struct i386_debug_reg_state *state
	= i386_debug_reg_state (ptid_get_pid (lwp->ptid));
      int i;

      /* On Linux kernel before 2.6.33 commit
	 72f674d203cd230426437cdcf7dd6f681dad8b0d
	 if you enable a breakpoint by the DR_CONTROL bits you need to have
	 already written the corresponding DR_FIRSTADDR...DR_LASTADDR registers.

	 Ensure DR_CONTROL gets written as the very last register here.  */

      for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
	if (state->dr_ref_count[i] > 0)
	  {
	    amd64_linux_dr_set (lwp->ptid, i, state->dr_mirror[i]);

	    /* If we're setting a watchpoint, any change the inferior
	       had done itself to the debug registers needs to be
	       discarded, otherwise, i386_stopped_data_address can get
	       confused.  */
	    clear_status = 1;
	  }

      amd64_linux_dr_set (lwp->ptid, DR_CONTROL, state->dr_control_mirror);

      lwp->arch_private->debug_registers_changed = 0;
    }

  if (clear_status || lwp->stopped_by_watchpoint)
    amd64_linux_dr_set (lwp->ptid, DR_STATUS, 0);
}

static void
amd64_linux_new_thread (struct lwp_info *lp)
{
  struct arch_lwp_info *info = XCNEW (struct arch_lwp_info);

  info->debug_registers_changed = 1;

  lp->arch_private = info;
}

/* linux_nat_new_fork hook.   */

static void
amd64_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
{
  pid_t parent_pid;
  struct i386_debug_reg_state *parent_state;
  struct i386_debug_reg_state *child_state;

  /* NULL means no watchpoint has ever been set in the parent.  In
     that case, there's nothing to do.  */
  if (parent->arch_private == NULL)
    return;

  /* Linux kernel before 2.6.33 commit
     72f674d203cd230426437cdcf7dd6f681dad8b0d
     will inherit hardware debug registers from parent
     on fork/vfork/clone.  Newer Linux kernels create such tasks with
     zeroed debug registers.

     GDB core assumes the child inherits the watchpoints/hw
     breakpoints of the parent, and will remove them all from the
     forked off process.  Copy the debug registers mirrors into the
     new process so that all breakpoints and watchpoints can be
     removed together.  The debug registers mirror will become zeroed
     in the end before detaching the forked off process, thus making
     this compatible with older Linux kernels too.  */

  parent_pid = ptid_get_pid (parent->ptid);
  parent_state = i386_debug_reg_state (parent_pid);
  child_state = i386_debug_reg_state (child_pid);
  *child_state = *parent_state;
}

/* This function is called by libthread_db as part of its handling of
   a request for a thread's local storage address.  */

ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
                    lwpid_t lwpid, int idx, void **base)
{
  if (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 32)
    {
      /* The full structure is found in <asm-i386/ldt.h>.  The second
	 integer is the LDT's base_address and that is used to locate
	 the thread's local storage.  See i386-linux-nat.c more
	 info.  */
      unsigned int desc[4];

      /* This code assumes that "int" is 32 bits and that
	 GET_THREAD_AREA returns no more than 4 int values.  */
      gdb_assert (sizeof (int) == 4);
#ifndef PTRACE_GET_THREAD_AREA
#define PTRACE_GET_THREAD_AREA 25
#endif
      if  (ptrace (PTRACE_GET_THREAD_AREA,
		   lwpid, (void *) (long) idx, (unsigned long) &desc) < 0)
	return PS_ERR;

      /* Extend the value to 64 bits.  Here it's assumed that a "long"
	 and a "void *" are the same.  */
      (*base) = (void *) (long) desc[1];
      return PS_OK;
    }
  else
    {
      /* This definition comes from prctl.h, but some kernels may not
         have it.  */
#ifndef PTRACE_ARCH_PRCTL
#define PTRACE_ARCH_PRCTL      30
#endif
      /* FIXME: ezannoni-2003-07-09 see comment above about include
	 file order.  We could be getting bogus values for these two.  */
      gdb_assert (FS < ELF_NGREG);
      gdb_assert (GS < ELF_NGREG);
      switch (idx)
	{
	case FS:
#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
	    {
	      /* PTRACE_ARCH_PRCTL is obsolete since 2.6.25, where the
		 fs_base and gs_base fields of user_regs_struct can be
		 used directly.  */
	      unsigned long fs;
	      errno = 0;
	      fs = ptrace (PTRACE_PEEKUSER, lwpid,
			   offsetof (struct user_regs_struct, fs_base), 0);
	      if (errno == 0)
		{
		  *base = (void *) fs;
		  return PS_OK;
		}
	    }
#endif
	  if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0)
	    return PS_OK;
	  break;
	case GS:
#ifdef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
	    {
	      unsigned long gs;
	      errno = 0;
	      gs = ptrace (PTRACE_PEEKUSER, lwpid,
			   offsetof (struct user_regs_struct, gs_base), 0);
	      if (errno == 0)
		{
		  *base = (void *) gs;
		  return PS_OK;
		}
	    }
#endif
	  if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0)
	    return PS_OK;
	  break;
	default:                   /* Should not happen.  */
	  return PS_BADADDR;
	}
    }
  return PS_ERR;               /* ptrace failed.  */
}

static void (*super_post_startup_inferior) (ptid_t ptid);

static void
amd64_linux_child_post_startup_inferior (ptid_t ptid)
{
  i386_cleanup_dregs ();
  super_post_startup_inferior (ptid);
}

/* When GDB is built as a 64-bit application on linux, the
   PTRACE_GETSIGINFO data is always presented in 64-bit layout.  Since
   debugging a 32-bit inferior with a 64-bit GDB should look the same
   as debugging it with a 32-bit GDB, we do the 32-bit <-> 64-bit
   conversion in-place ourselves.  */

/* These types below (compat_*) define a siginfo type that is layout
   compatible with the siginfo type exported by the 32-bit userspace
   support.  */

typedef int compat_int_t;
typedef unsigned int compat_uptr_t;

typedef int compat_time_t;
typedef int compat_timer_t;
typedef int compat_clock_t;

struct compat_timeval
{
  compat_time_t tv_sec;
  int tv_usec;
};

typedef union compat_sigval
{
  compat_int_t sival_int;
  compat_uptr_t sival_ptr;
} compat_sigval_t;

typedef struct compat_siginfo
{
  int si_signo;
  int si_errno;
  int si_code;

  union
  {
    int _pad[((128 / sizeof (int)) - 3)];

    /* kill() */
    struct
    {
      unsigned int _pid;
      unsigned int _uid;
    } _kill;

    /* POSIX.1b timers */
    struct
    {
      compat_timer_t _tid;
      int _overrun;
      compat_sigval_t _sigval;
    } _timer;

    /* POSIX.1b signals */
    struct
    {
      unsigned int _pid;
      unsigned int _uid;
      compat_sigval_t _sigval;
    } _rt;

    /* SIGCHLD */
    struct
    {
      unsigned int _pid;
      unsigned int _uid;
      int _status;
      compat_clock_t _utime;
      compat_clock_t _stime;
    } _sigchld;

    /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
    struct
    {
      unsigned int _addr;
    } _sigfault;

    /* SIGPOLL */
    struct
    {
      int _band;
      int _fd;
    } _sigpoll;
  } _sifields;
} compat_siginfo_t;

/* For x32, clock_t in _sigchld is 64bit aligned at 4 bytes.  */
typedef struct compat_x32_clock
{
  int lower;
  int upper;
} compat_x32_clock_t;

typedef struct compat_x32_siginfo
{
  int si_signo;
  int si_errno;
  int si_code;

  union
  {
    int _pad[((128 / sizeof (int)) - 3)];

    /* kill() */
    struct
    {
      unsigned int _pid;
      unsigned int _uid;
    } _kill;

    /* POSIX.1b timers */
    struct
    {
      compat_timer_t _tid;
      int _overrun;
      compat_sigval_t _sigval;
    } _timer;

    /* POSIX.1b signals */
    struct
    {
      unsigned int _pid;
      unsigned int _uid;
      compat_sigval_t _sigval;
    } _rt;

    /* SIGCHLD */
    struct
    {
      unsigned int _pid;
      unsigned int _uid;
      int _status;
      compat_x32_clock_t _utime;
      compat_x32_clock_t _stime;
    } _sigchld;

    /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
    struct
    {
      unsigned int _addr;
    } _sigfault;

    /* SIGPOLL */
    struct
    {
      int _band;
      int _fd;
    } _sigpoll;
  } _sifields;
} compat_x32_siginfo_t;

#define cpt_si_pid _sifields._kill._pid
#define cpt_si_uid _sifields._kill._uid
#define cpt_si_timerid _sifields._timer._tid
#define cpt_si_overrun _sifields._timer._overrun
#define cpt_si_status _sifields._sigchld._status
#define cpt_si_utime _sifields._sigchld._utime
#define cpt_si_stime _sifields._sigchld._stime
#define cpt_si_ptr _sifields._rt._sigval.sival_ptr
#define cpt_si_addr _sifields._sigfault._addr
#define cpt_si_band _sifields._sigpoll._band
#define cpt_si_fd _sifields._sigpoll._fd

/* glibc at least up to 2.3.2 doesn't have si_timerid, si_overrun.
   In their place is si_timer1,si_timer2.  */
#ifndef si_timerid
#define si_timerid si_timer1
#endif
#ifndef si_overrun
#define si_overrun si_timer2
#endif

static void
compat_siginfo_from_siginfo (compat_siginfo_t *to, siginfo_t *from)
{
  memset (to, 0, sizeof (*to));

  to->si_signo = from->si_signo;
  to->si_errno = from->si_errno;
  to->si_code = from->si_code;

  if (to->si_code == SI_TIMER)
    {
      to->cpt_si_timerid = from->si_timerid;
      to->cpt_si_overrun = from->si_overrun;
      to->cpt_si_ptr = (intptr_t) from->si_ptr;
    }
  else if (to->si_code == SI_USER)
    {
      to->cpt_si_pid = from->si_pid;
      to->cpt_si_uid = from->si_uid;
    }
  else if (to->si_code < 0)
    {
      to->cpt_si_pid = from->si_pid;
      to->cpt_si_uid = from->si_uid;
      to->cpt_si_ptr = (intptr_t) from->si_ptr;
    }
  else
    {
      switch (to->si_signo)
	{
	case SIGCHLD:
	  to->cpt_si_pid = from->si_pid;
	  to->cpt_si_uid = from->si_uid;
	  to->cpt_si_status = from->si_status;
	  to->cpt_si_utime = from->si_utime;
	  to->cpt_si_stime = from->si_stime;
	  break;
	case SIGILL:
	case SIGFPE:
	case SIGSEGV:
	case SIGBUS:
	  to->cpt_si_addr = (intptr_t) from->si_addr;
	  break;
	case SIGPOLL:
	  to->cpt_si_band = from->si_band;
	  to->cpt_si_fd = from->si_fd;
	  break;
	default:
	  to->cpt_si_pid = from->si_pid;
	  to->cpt_si_uid = from->si_uid;
	  to->cpt_si_ptr = (intptr_t) from->si_ptr;
	  break;
	}
    }
}

static void
siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
{
  memset (to, 0, sizeof (*to));

  to->si_signo = from->si_signo;
  to->si_errno = from->si_errno;
  to->si_code = from->si_code;

  if (to->si_code == SI_TIMER)
    {
      to->si_timerid = from->cpt_si_timerid;
      to->si_overrun = from->cpt_si_overrun;
      to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr;
    }
  else if (to->si_code == SI_USER)
    {
      to->si_pid = from->cpt_si_pid;
      to->si_uid = from->cpt_si_uid;
    }
  if (to->si_code < 0)
    {
      to->si_pid = from->cpt_si_pid;
      to->si_uid = from->cpt_si_uid;
      to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr;
    }
  else
    {
      switch (to->si_signo)
	{
	case SIGCHLD:
	  to->si_pid = from->cpt_si_pid;
	  to->si_uid = from->cpt_si_uid;
	  to->si_status = from->cpt_si_status;
	  to->si_utime = from->cpt_si_utime;
	  to->si_stime = from->cpt_si_stime;
	  break;
	case SIGILL:
	case SIGFPE:
	case SIGSEGV:
	case SIGBUS:
	  to->si_addr = (void *) (intptr_t) from->cpt_si_addr;
	  break;
	case SIGPOLL:
	  to->si_band = from->cpt_si_band;
	  to->si_fd = from->cpt_si_fd;
	  break;
	default:
	  to->si_pid = from->cpt_si_pid;
	  to->si_uid = from->cpt_si_uid;
	  to->si_ptr = (void* ) (intptr_t) from->cpt_si_ptr;
	  break;
	}
    }
}

static void
compat_x32_siginfo_from_siginfo (compat_x32_siginfo_t *to,
				 siginfo_t *from)
{
  memset (to, 0, sizeof (*to));

  to->si_signo = from->si_signo;
  to->si_errno = from->si_errno;
  to->si_code = from->si_code;

  if (to->si_code == SI_TIMER)
    {
      to->cpt_si_timerid = from->si_timerid;
      to->cpt_si_overrun = from->si_overrun;
      to->cpt_si_ptr = (intptr_t) from->si_ptr;
    }
  else if (to->si_code == SI_USER)
    {
      to->cpt_si_pid = from->si_pid;
      to->cpt_si_uid = from->si_uid;
    }
  else if (to->si_code < 0)
    {
      to->cpt_si_pid = from->si_pid;
      to->cpt_si_uid = from->si_uid;
      to->cpt_si_ptr = (intptr_t) from->si_ptr;
    }
  else
    {
      switch (to->si_signo)
	{
	case SIGCHLD:
	  to->cpt_si_pid = from->si_pid;
	  to->cpt_si_uid = from->si_uid;
	  to->cpt_si_status = from->si_status;
	  memcpy (&to->cpt_si_utime, &from->si_utime,
		  sizeof (to->cpt_si_utime));
	  memcpy (&to->cpt_si_stime, &from->si_stime,
		  sizeof (to->cpt_si_stime));
	  break;
	case SIGILL:
	case SIGFPE:
	case SIGSEGV:
	case SIGBUS:
	  to->cpt_si_addr = (intptr_t) from->si_addr;
	  break;
	case SIGPOLL:
	  to->cpt_si_band = from->si_band;
	  to->cpt_si_fd = from->si_fd;
	  break;
	default:
	  to->cpt_si_pid = from->si_pid;
	  to->cpt_si_uid = from->si_uid;
	  to->cpt_si_ptr = (intptr_t) from->si_ptr;
	  break;
	}
    }
}

static void
siginfo_from_compat_x32_siginfo (siginfo_t *to,
				 compat_x32_siginfo_t *from)
{
  memset (to, 0, sizeof (*to));

  to->si_signo = from->si_signo;
  to->si_errno = from->si_errno;
  to->si_code = from->si_code;

  if (to->si_code == SI_TIMER)
    {
      to->si_timerid = from->cpt_si_timerid;
      to->si_overrun = from->cpt_si_overrun;
      to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr;
    }
  else if (to->si_code == SI_USER)
    {
      to->si_pid = from->cpt_si_pid;
      to->si_uid = from->cpt_si_uid;
    }
  if (to->si_code < 0)
    {
      to->si_pid = from->cpt_si_pid;
      to->si_uid = from->cpt_si_uid;
      to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr;
    }
  else
    {
      switch (to->si_signo)
	{
	case SIGCHLD:
	  to->si_pid = from->cpt_si_pid;
	  to->si_uid = from->cpt_si_uid;
	  to->si_status = from->cpt_si_status;
	  memcpy (&to->si_utime, &from->cpt_si_utime,
		  sizeof (to->si_utime));
	  memcpy (&to->si_stime, &from->cpt_si_stime,
		  sizeof (to->si_stime));
	  break;
	case SIGILL:
	case SIGFPE:
	case SIGSEGV:
	case SIGBUS:
	  to->si_addr = (void *) (intptr_t) from->cpt_si_addr;
	  break;
	case SIGPOLL:
	  to->si_band = from->cpt_si_band;
	  to->si_fd = from->cpt_si_fd;
	  break;
	default:
	  to->si_pid = from->cpt_si_pid;
	  to->si_uid = from->cpt_si_uid;
	  to->si_ptr = (void* ) (intptr_t) from->cpt_si_ptr;
	  break;
	}
    }
}

/* Convert a native/host siginfo object, into/from the siginfo in the
   layout of the inferiors' architecture.  Returns true if any
   conversion was done; false otherwise.  If DIRECTION is 1, then copy
   from INF to NATIVE.  If DIRECTION is 0, copy from NATIVE to
   INF.  */

static int
amd64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
{
  struct gdbarch *gdbarch = get_frame_arch (get_current_frame ());

  /* Is the inferior 32-bit?  If so, then do fixup the siginfo
     object.  */
  if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
    {
      gdb_assert (sizeof (siginfo_t) == sizeof (compat_siginfo_t));

      if (direction == 0)
	compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, native);
      else
	siginfo_from_compat_siginfo (native, (struct compat_siginfo *) inf);

      return 1;
    }
  /* No fixup for native x32 GDB.  */
  else if (gdbarch_addr_bit (gdbarch) == 32 && sizeof (void *) == 8)
    {
      gdb_assert (sizeof (siginfo_t) == sizeof (compat_x32_siginfo_t));

      if (direction == 0)
	compat_x32_siginfo_from_siginfo ((struct compat_x32_siginfo *) inf,
					 native);
      else
	siginfo_from_compat_x32_siginfo (native,
					 (struct compat_x32_siginfo *) inf);

      return 1;
    }
  else
    return 0;
}

/* Get Linux/x86 target description from running target.

   Value of CS segment register:
     1. 64bit process: 0x33.
     2. 32bit process: 0x23.

   Value of DS segment register:
     1. LP64 process: 0x0.
     2. X32 process: 0x2b.
 */

#define AMD64_LINUX_USER64_CS	0x33
#define AMD64_LINUX_X32_DS	0x2b

static const struct target_desc *
amd64_linux_read_description (struct target_ops *ops)
{
  unsigned long cs;
  unsigned long ds;
  int tid;
  int is_64bit;
  int is_x32;
  static uint64_t xcr0;

  /* GNU/Linux LWP ID's are process ID's.  */
  tid = ptid_get_lwp (inferior_ptid);
  if (tid == 0)
    tid = ptid_get_pid (inferior_ptid); /* Not a threaded program.  */

  /* Get CS register.  */
  errno = 0;
  cs = ptrace (PTRACE_PEEKUSER, tid,
	       offsetof (struct user_regs_struct, cs), 0);
  if (errno != 0)
    perror_with_name (_("Couldn't get CS register"));

  is_64bit = cs == AMD64_LINUX_USER64_CS;

  /* Get DS register.  */
  errno = 0;
  ds = ptrace (PTRACE_PEEKUSER, tid,
	       offsetof (struct user_regs_struct, ds), 0);
  if (errno != 0)
    perror_with_name (_("Couldn't get DS register"));

  is_x32 = ds == AMD64_LINUX_X32_DS;

  if (sizeof (void *) == 4 && is_64bit && !is_x32)
    error (_("Can't debug 64-bit process with 32-bit GDB"));

  if (have_ptrace_getregset == -1)
    {
      uint64_t xstateregs[(I386_XSTATE_SSE_SIZE / sizeof (uint64_t))];
      struct iovec iov;

      iov.iov_base = xstateregs;
      iov.iov_len = sizeof (xstateregs);

      /* Check if PTRACE_GETREGSET works.  */
      if (ptrace (PTRACE_GETREGSET, tid,
		  (unsigned int) NT_X86_XSTATE, (long) &iov) < 0)
	have_ptrace_getregset = 0;
      else
	{
	  have_ptrace_getregset = 1;

	  /* Get XCR0 from XSAVE extended state.  */
	  xcr0 = xstateregs[(I386_LINUX_XSAVE_XCR0_OFFSET
			     / sizeof (uint64_t))];
	}
    }

  /* Check the native XCR0 only if PTRACE_GETREGSET is available.  */
  if (have_ptrace_getregset && (xcr0 & I386_XSTATE_ALL_MASK))
    {
      switch (xcr0 & I386_XSTATE_ALL_MASK)
	{
	case I386_XSTATE_MPX_MASK:
	  if (is_64bit)
	    {
	      if (is_x32)
		return tdesc_x32_avx_linux; /* No MPX on x32 using AVX.  */
	      else
		return tdesc_amd64_mpx_linux;
	    }
	  else
	    return tdesc_i386_mpx_linux;
	case I386_XSTATE_AVX_MASK:
	  if (is_64bit)
	    {
	      if (is_x32)
		return tdesc_x32_avx_linux;
	      else
		return tdesc_amd64_avx_linux;
	    }
	  else
	    return tdesc_i386_avx_linux;
	default:
	  if (is_64bit)
	    {
	      if (is_x32)
		return tdesc_x32_linux;
	      else
		return tdesc_amd64_linux;
	    }
	  else
	    return tdesc_i386_linux;
	}
    }
  else
    {
      if (is_64bit)
	{
	  if (is_x32)
	    return tdesc_x32_linux;
	  else
	    return tdesc_amd64_linux;
	}
      else
	return tdesc_i386_linux;
    }
}

/* Enable branch tracing.  */

static struct btrace_target_info *
amd64_linux_enable_btrace (ptid_t ptid)
{
  struct btrace_target_info *tinfo;
  struct gdbarch *gdbarch;

  errno = 0;
  tinfo = linux_enable_btrace (ptid);

  if (tinfo == NULL)
    error (_("Could not enable branch tracing for %s: %s."),
	   target_pid_to_str (ptid), safe_strerror (errno));

  /* Fill in the size of a pointer in bits.  */
  gdbarch = target_thread_architecture (ptid);
  tinfo->ptr_bits = gdbarch_ptr_bit (gdbarch);

  return tinfo;
}

/* Disable branch tracing.  */

static void
amd64_linux_disable_btrace (struct btrace_target_info *tinfo)
{
  int errcode = linux_disable_btrace (tinfo);

  if (errcode != 0)
    error (_("Could not disable branch tracing: %s."), safe_strerror (errcode));
}

/* Teardown branch tracing.  */

static void
amd64_linux_teardown_btrace (struct btrace_target_info *tinfo)
{
  /* Ignore errors.  */
  linux_disable_btrace (tinfo);
}

/* Provide a prototype to silence -Wmissing-prototypes.  */
void _initialize_amd64_linux_nat (void);

void
_initialize_amd64_linux_nat (void)
{
  struct target_ops *t;

  amd64_native_gregset32_reg_offset = amd64_linux_gregset32_reg_offset;
  amd64_native_gregset32_num_regs = I386_LINUX_NUM_REGS;
  amd64_native_gregset64_reg_offset = amd64_linux_gregset_reg_offset;
  amd64_native_gregset64_num_regs = AMD64_LINUX_NUM_REGS;

  gdb_assert (ARRAY_SIZE (amd64_linux_gregset32_reg_offset)
	      == amd64_native_gregset32_num_regs);

  /* Fill in the generic GNU/Linux methods.  */
  t = linux_target ();

  i386_use_watchpoints (t);

  i386_dr_low.set_control = amd64_linux_dr_set_control;
  i386_dr_low.set_addr = amd64_linux_dr_set_addr;
  i386_dr_low.get_addr = amd64_linux_dr_get_addr;
  i386_dr_low.get_status = amd64_linux_dr_get_status;
  i386_dr_low.get_control = amd64_linux_dr_get_control;
  i386_set_debug_register_length (8);

  /* Override the GNU/Linux inferior startup hook.  */
  super_post_startup_inferior = t->to_post_startup_inferior;
  t->to_post_startup_inferior = amd64_linux_child_post_startup_inferior;

  /* Add our register access methods.  */
  t->to_fetch_registers = amd64_linux_fetch_inferior_registers;
  t->to_store_registers = amd64_linux_store_inferior_registers;

  t->to_read_description = amd64_linux_read_description;

  /* Add btrace methods.  */
  t->to_supports_btrace = linux_supports_btrace;
  t->to_enable_btrace = amd64_linux_enable_btrace;
  t->to_disable_btrace = amd64_linux_disable_btrace;
  t->to_teardown_btrace = amd64_linux_teardown_btrace;
  t->to_read_btrace = linux_read_btrace;

  /* Register the target.  */
  linux_nat_add_target (t);
  linux_nat_set_new_thread (t, amd64_linux_new_thread);
  linux_nat_set_new_fork (t, amd64_linux_new_fork);
  linux_nat_set_forget_process (t, i386_forget_process);
  linux_nat_set_siginfo_fixup (t, amd64_linux_siginfo_fixup);
  linux_nat_set_prepare_to_resume (t, amd64_linux_prepare_to_resume);
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotheca universalis no. 1965 (1881)

#### Original name
Macrosporium convallariae f. polygonati-vulgaris Thüm.

### Remarks
null


text:
using namespace luabind;

#pragma optimize("s",on)
void CSE_ALifeObjectProjector::script_register(lua_State *L)
{
	module(L)[
		luabind_class_dynamic_alife1(
			CSE_ALifeObjectProjector,
			"cse_alife_object_projector",
			CSE_ALifeDynamicObjectVisual
		)
	];
}

void CSE_ALifeHelicopter::script_register(lua_State *L)
{
	module(L)[
		luabind_class_dynamic_alife3(
			CSE_ALifeHelicopter,
			"cse_alife_helicopter",
			CSE_ALifeDynamicObjectVisual,
			CSE_Motion,
			CSE_PHSkeleton
		)
	];
}

void CSE_ALifeCar::script_register(lua_State *L)
{
	module(L)[
		luabind_class_dynamic_alife2(
			CSE_ALifeCar,
			"cse_alife_car",
			CSE_ALifeDynamicObjectVisual,
			CSE_PHSkeleton
		)
	];
}

void CSE_ALifeObjectBreakable::script_register(lua_State *L)
{
	module(L)[
		luabind_class_dynamic_alife1(
			CSE_ALifeObjectBreakable,
			"cse_alife_object_breakable",
			CSE_ALifeDynamicObjectVisual
		)
	];
}

void CSE_ALifeObjectClimable::script_register(lua_State *L)
{
	module(L)[
		luabind_class_abstract2(
			CSE_ALifeObjectClimable,
			"cse_alife_object_climable",
			CSE_Shape,
			CSE_Abstract
			)
	];
}

void CSE_ALifeMountedWeapon::script_register(lua_State *L)
{
	module(L)[
		luabind_class_dynamic_alife1(
			CSE_ALifeMountedWeapon,
			"cse_alife_mounted_weapon",
			CSE_ALifeDynamicObjectVisual
		)
	];
}

void CSE_ALifeTeamBaseZone::script_register(lua_State *L)
{
	module(L)[
		luabind_class_dynamic_alife1(
			CSE_ALifeTeamBaseZone,
			"cse_alife_team_base_zone",
			CSE_ALifeSpaceRestrictor
		)
	];
}


text:
import Component from './component';
import namespace from './namespace';
import { hideDetails, resetModal, showDetails } from './orchestrators';

const { getNamespaceSubstate, wrapContainer } = window.WarpJS.ReactUtils;

const mapStateToProps = (state, ownProps) => getNamespaceSubstate(state, namespace);

const mapDispatchToProps = (dispatch, ownProps) => Object.freeze({
    hideDetails: async () => hideDetails(dispatch),
    resetModal: async () => resetModal(dispatch),
    showDetails: async (type, id) => showDetails(dispatch, type, id)
});

const mergeProps = (stateProps, dispatchProps, ownProps) => Object.freeze({
    ...stateProps,
    ...dispatchProps,
    ...ownProps
});

export default wrapContainer(Component, mapStateToProps, mapDispatchToProps, mergeProps);


text:
'use strict';

var request = require('request');
var mean = require('meanio');
var config = mean.loadConfig();
var nodemailer = require('nodemailer');
var config = require('meanio').loadConfig();
var mg = require('nodemailer-mailgun-transport');
var templates = require('../template');

/**
 * List of all posts
 */
exports.all = function(req, res, next) {

  var options = {
    url: 'http://blog.knowrick.com/ghost/api/v0.1/posts',
    headers: {
        'Authorization': config.blog.key
    }
  };

  request(options,function(error, response, body) {
    if (!error && response.statusCode === 200) {
      var posts = JSON.parse(body);
      res.status(200).json(posts);
    }else{
      req.statusCode = response.statusCode;
      next();
    }
  });
};
/**
 * Authenticate to blog
 */
exports.loginToBlog = function(req, res, next){
  if (req.statusCode === 401) {
      request.post
      ({
        url:'http://blog.knowrick.com/ghost/api/v0.1/authentication/token',
        form: {
          grant_type:'password',
          username: config.blog.username,
          password: config.blog.password,
          client_id: config.blog.clientID
        }
      },
      function(err,httpResponse,body){
        if (httpResponse.statusCode === 200) {
          var data = JSON.parse(body);
          config.blog.key = 'Bearer ' + data.access_token;
          var options = {
            url: 'http://blog.knowrick.com/ghost/api/v0.1/posts',
            headers: {
                'Authorization': config.blog.key
            }
          };
          request(options, function(err, resHTTP, bod){
            var posts = JSON.parse(bod);
            res.status(200).json(posts);
          });
        }else{
          res.status(500).json({
            error: 'Something went wrong, cant log you in!'
          });
        }
      });
  }else{
    res.status(500).json({
      error: 'Cannot list the posts'
    });
  }
};
/**
 * Send email from contact form
 */
exports.sendEmail = function(req, res, next) {

  function validateEmail(email) {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return re.test(email);
  }
  if (validateEmail(req.body.email)) {
    var auth = {
      auth: {
        api_key: config.mailer.api_key,
        domain: config.mailer.domain
      }
    };
    var nodemailerMailgun = nodemailer.createTransport(mg(auth));
    nodemailerMailgun.sendMail(templates.contactForm(req), function (err, info) {
      if (!err) {
        res.status(200).json({
          message: 'Email was sent, rick will be contacting you shortly.'
        });
      }
      else {
        res.status(500).json({
          error: 'Cannot send the email at this time.'
        });
      }
    });
  }else{
    res.status(500).json({
      error: 'Not a valid email please try again'
    });
  }

};


text:
class TuftsGenericMeta  < ActiveFedora::OmDatastream

  set_terminology do |t|
    t.root(:path=>"content", :xmlns=>"http://www.fedora.info/definitions/",
    "xmlns:xlink"=>"http://www.w3.org/1999/xlink")
    t.item  {
      t.link
      t.fileName
      t.mimeType
      }

  end

  # Generates an empty Mods Article (used when you call ModsArticle.new without passing in existing xml)
  def self.xml_template
    builder = Nokogiri::XML::Builder.new do |xml|
      xml.content(:version=>"0.1", "xmlns"=>"http://www.fedora.info/definitions/","xmlns:xlink"=>"http://www.w3.org/1999/xlink"){
          xml.item{
            xml.link
            xml.fileName
            xml.mimeType
          }
        }
    end
    return builder.doc
  end

end

# Example:
# <content xmlns="http://www.fedora.info/definitions/" xmlns:xlink="http://www.w3.org/1999/xlink">
#   <item id="0">
#     <link>http://dl.dropbox.com/u/43702278/MS115.003.001.00001.gz</link>
#     <fileName>MS115.003.001.00001</fileName>
#     <mimeType>application/x-gzip</mimeType>
#   </item>
# </content>


text:
include ../mapkeeper/Makefile.config

INC = -I ../stasis 							\
      -I ../mapkeeper/thrift/gen-cpp/ 					\
      -I $(THRIFT_DIR)/include/ 					\
      -I $(THRIFT_DIR)/include/thrift					\
      -I ./servers/mapkeeper

LIBSRC = $(wildcard *.c) $(wildcard *.cpp)
LIBNAME = blsm

ifeq ($(shell uname),Linux)
STATIC_LIBS= ../mapkeeper/thrift/gen-cpp/libmapkeeper.a	\
	 -lrt servers/mapkeeper/bLSMRequestHandler.cpp bin/libblsm.a		\
	../stasis/bin/libstasis.a
else
STATIC_LIBS= ./libstdc++.a ../mapkeeper/thrift/gen-cpp/libmapkeeper.a	\
	 servers/mapkeeper/bLSMRequestHandler.cpp bin/libblsm.a			\
	../stasis/bin/libstasis.a
endif

MAINSRC = $(wildcard servers/native-XXX/*.cpp) $(wildcard servers/mapkeeper/main/*.cpp)

include ../stasis/config/Makefile.stasis