text:
import eventlet
import os
import sys

if os.name == 'nt':
    # eventlet monkey patching causes subprocess.Popen to fail on Windows
    # when using pipes due to missing non blocking I/O support
    eventlet.monkey_patch(os=False)
else:
    eventlet.monkey_patch()

# If ../murano/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
root = os.path.join(os.path.abspath(__file__), os.pardir, os.pardir, os.pardir)
if os.path.exists(os.path.join(root, 'murano', '__init__.py')):
    sys.path.insert(0, root)

from murano.api.v1 import request_statistics
from murano.common import config
from murano.common import policy
from murano.common import server
from murano.common import statservice as stats
from murano.common import wsgi
from murano.openstack.common import log
from murano.openstack.common import service

def main():
    try:
        config.parse_args()
        log.setup('murano')
        request_statistics.init_stats()
        policy.init()

        launcher = service.ServiceLauncher()

        app = config.load_paste_app('murano')
        port, host = (config.CONF.bind_port, config.CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))
        launcher.launch_service(server.get_rpc_service())
        launcher.launch_service(server.get_notification_service())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)

if __name__ == '__main__':
    main()

redpajama_set_name: RedPajamaGithub


text:
/***************************************************************************
*                             INCLUDED FILES
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include "bwxform.h"

/***************************************************************************
*                                CONSTANTS
***************************************************************************/
#define BLOCK_SIZE  4096        /* size of blocks */

#if BLOCK_SIZE > INT_MAX
#error BLOCK_SIZE must be <= INT_MAX and maximum size_t
#endif

/* NOTE: Need to find a way to check for maximum size_t */

/***************************************************************************
*                            TYPE DEFINITIONS
***************************************************************************/
unsigned char block[BLOCK_SIZE];        /* block being (un)transformed */
size_t blockSize;                       /* actual size of block */

/* counters and offsets used for radix sorting with characters */
unsigned int counters[256];
unsigned int offsetTable[256];

/***************************************************************************
*                                 MACROS
***************************************************************************/
/* wraps array index within array bounds (assumes value < 2 * limit) */
#define Wrap(value, limit)      (((value) < (limit)) ? (value) : ((value) - (limit)))

/***************************************************************************
*                               PROTOTYPES
***************************************************************************/
/* move to front functions */

void DoMTF(unsigned char *last, int length);
void UndoMTF(unsigned char *last, int length);

/***************************************************************************
*                                FUNCTIONS
***************************************************************************/

/***************************************************************************
*   Function   : ComparePresorted
*   Description: This comparison function is designed for use with qsort
*                and "block", a global array of "blockSize" unsigned chars.
*                It compares two strings in "block" starting at indices
*                s1 and s2 and ending at indices s1 - 1 and s2 - 1.
*                The strings are assumed to be presorted so that first two
*                characters are known to be matching.
*   Parameters : s1 - The starting index of a string in block
*                s2 - The starting index of a string in block
*   Effects    : NONE
*   Returned   : > 0 if string s1 > string s2
*                0 if string s1 == string s2
*                < 0 if string s1 < string s2
***************************************************************************/
int ComparePresorted(const void *s1, const void *s2)
{
    int offset1, offset2;
    int i;
    int result;

    offset1 = *((int *)s1);
    offset2 = *((int *)s2);

    /***********************************************************************
    * Compare 1 character at a time until there's difference or the end of
    * the block is reached.  Since we're only sorting strings that already
    * match at the first two characters, start with the third character.
    ***********************************************************************/
    for(i = 2; i < blockSize; i++)
    {
        result = (int)block[Wrap((offset1 + i), blockSize)] -
            (int)block[Wrap((offset2 + i), blockSize)];

        if (result != 0)
        {
            return result;
        }
    }

    /* strings are identical */
    return 0;
}

/***************************************************************************
*   Function   : BWXformFile
*   Description: This function performs a Burrows-Wheeler transformation
*                on a file (with optional move to front) and writes the
*                resulting data to the specified output file.  Comments in
*                this function indicate corresponding variables, labels,
*                and sections in "A Block-sorting Lossless Data Compression
*                Algorithm" by M. Burrows and D.J. Wheeler.
*   Parameters : inFile - Name of file to transform
*                outFile - Name of file to write transformed output to
*                mtf - Set to TRUE if move to front coding should be
*                      applied.
*   Effects    : A Burrows-Wheeler transformation (and possibly move to
*                front encoding) is applied to inFile.   The results of
*                the transformation are written to outFile.
*   Returned   : TRUE for success, otherwise FALSE.
***************************************************************************/
int BWXformFile(char *inFile, char *outFile, char mtf)
{
    int i, j, k;
    FILE *fpIn, *fpOut;
    unsigned int *rotationIdx;      /* index of first char in rotation */
    unsigned int *v;                /* index of radix sorted charaters */
    int s0Idx;                      /* index of S0 in rotations (I) */
    unsigned char *last;            /* last characters from sorted rotations */

    /***********************************************************************
    * BLOCK_SIZE arrays are allocated on the heap, because gcc generates
    * code that throws a Segmentation fault when the large arrays are
    * allocated on the stack.
    ***********************************************************************/
    rotationIdx = (unsigned int *)malloc(BLOCK_SIZE * sizeof(unsigned int));

    if (NULL == rotationIdx)
    {
        perror("Allocating array of rotation indices");
        return FALSE;
    }

    v = (unsigned int *)malloc(BLOCK_SIZE * sizeof(unsigned int));

    if (v == rotationIdx)
    {
        perror("Allocating array of sort indices");
        free(rotationIdx);
        return FALSE;
    }

    last = (unsigned char *)malloc(BLOCK_SIZE * sizeof(unsigned char));

    if (NULL == last)
    {
        perror("Allocating array of last characters");
        free(rotationIdx);
        free(v);
        return FALSE;
    }

    /* open input and output files */
    if ((fpIn = fopen(inFile, "rb")) == NULL)
    {
        perror(inFile);
        return FALSE;
    }

    if (outFile == NULL)
    {
        fpOut = stdout;
    }
    else
    {
        if ((fpOut = fopen(outFile, "wb")) == NULL)
        {
            fclose(fpIn);
            perror(outFile);
            return FALSE;
        }
    }

    while((blockSize = fread(block, sizeof(unsigned char), BLOCK_SIZE, fpIn))
        != 0)
    {
        /*******************************************************************
        * Sort the rotated strings in the block.  A radix sort is performed
        * on the first to characters of all the rotated strings (2nd
        * character then 1st).  All rotated strings with matching initial
        * characters are then quicksorted. - Q4..Q7
        *******************************************************************/

        /*** radix sort on second character in rotation ***/

        /* count number of characters for radix sort */
        memset(counters, 0, 256 * sizeof(int));
        for (i = 0; i < blockSize; i++)
        {
            counters[block[i]]++;
        }

        offsetTable[0] = 0;

        for(i = 1; i < 256; i++)
        {
            /* determine number of values before those sorted under i */
            offsetTable[i] = offsetTable[i - 1] + counters[i - 1];
        }

        /* sort on 2nd character */
        for (i = 0; i < blockSize - 1; i++)
        {
            j = block[i + 1];
            v[offsetTable[j]] = i;
            offsetTable[j] = offsetTable[j] + 1;
        }

        /* handle wrap around for string starting at end of block */
        j = block[0];
        v[offsetTable[j]] = i;
        offsetTable[0] = 0;

        /*** radix sort on first character in rotation ***/

        for(i = 1; i < 256; i++)
        {
            /* determine number of values before those sorted under i */
            offsetTable[i] = offsetTable[i - 1] + counters[i - 1];
        }

        for (i = 0; i < blockSize; i++)
        {
            j = v[i];
            j = block[j];
            rotationIdx[offsetTable[j]] = v[i];
            offsetTable[j] = offsetTable[j] + 1;
        }

        /*******************************************************************
        * now rotationIdx contains the sort order of all strings sorted
        * by their first 2 characters.  Use qsort to sort the strings
        * that have their first two characters matching.
        *******************************************************************/
        for (i = 0, k = 0; (i <= UCHAR_MAX) && (k < (blockSize - 1)); i++)
        {
            for (j = 0; (j <= UCHAR_MAX) && (k < (blockSize - 1)); j++)
            {
                int first = k;

                /* count strings starting with ij */
                while ((i == block[rotationIdx[k]]) &&
                    (j == block[Wrap(rotationIdx[k] + 1,  blockSize)]))
                {
                    k++;

                    if (k == blockSize)
                    {
                        /* we've searched the whole block */
                        break;
                    }
                }

                if (k - first > 1)
                {
                    /* there are at least 2 strings staring with ij, sort them */
                    qsort(&rotationIdx[first], k - first, sizeof(int),
                        ComparePresorted);
                }
            }
        }

        /* find last characters of rotations (L) - C2 */
        s0Idx = 0;
        for (i = 0; i < blockSize; i++)
        {
            if (rotationIdx[i] != 0)
            {
                last[i] = block[rotationIdx[i] - 1];
            }
            else
            {
                /* unrotated string 1st character is end of string */
                s0Idx = i;
                last[i] = block[blockSize - 1];
            }
        }

        if (mtf)
        {
            DoMTF(last, blockSize);
        }

        /* write index of end of unrotated string (I) */
        fwrite(&s0Idx, sizeof(int), 1, fpOut);

        /* write out last characters of rotations (L) */
        fwrite(last, sizeof(unsigned char), blockSize, fpOut);
    }

    /* clean up */
    free(rotationIdx);
    free(v);
    free(last);
    fclose(fpIn);
    fclose(fpOut);
    return TRUE;
}

int BWXform(char *inString, char *outString, int mtf)
{
    int i, j, k;
    FILE *fpIn, *fpOut;
    unsigned int *rotationIdx;      /* index of first char in rotation */
    unsigned int *v;                /* index of radix sorted charaters */
    int s0Idx;                      /* index of S0 in rotations (I) */
    unsigned char *last;            /* last characters from sorted rotations */

    /***********************************************************************
    * BLOCK_SIZE arrays are allocated on the heap, because gcc generates
    * code that throws a Segmentation fault when the large arrays are
    * allocated on the stack.
    ***********************************************************************/
    rotationIdx = (unsigned int *)malloc(BLOCK_SIZE * sizeof(unsigned int));

    if (NULL == rotationIdx)
    {
        perror("Allocating array of rotation indices");
        return FALSE;
    }

    v = (unsigned int *)malloc(BLOCK_SIZE * sizeof(unsigned int));

    if (v == rotationIdx)
    {
        perror("Allocating array of sort indices");
        free(rotationIdx);
        return FALSE;
    }

    last = (unsigned char *)malloc(BLOCK_SIZE * sizeof(unsigned char));

    if (NULL == last)
    {
        perror("Allocating array of last characters");
        free(rotationIdx);
        free(v);
        return FALSE;
    }

    strcpy(block,inString);
    blockSize=strlen(inString);
    block[blockSize]='\0';
    // printf("block:%s, SIZE: %ld\n",block,blockSize);

    // while((blockSize = fread(block, sizeof(unsigned char), BLOCK_SIZE, fpIn))
    //     != 0)
    // {
        /*******************************************************************
        * Sort the rotated strings in the block.  A radix sort is performed
        * on the first to characters of all the rotated strings (2nd
        * character then 1st).  All rotated strings with matching initial
        * characters are then quicksorted. - Q4..Q7
        *******************************************************************/

        /*** radix sort on second character in rotation ***/

        /* count number of characters for radix sort */
        memset(counters, 0, 256 * sizeof(int));
        for (i = 0; i < blockSize; i++)
        {
            counters[block[i]]++;
        }

        offsetTable[0] = 0;

        for(i = 1; i < 256; i++)
        {
            /* determine number of values before those sorted under i */
            offsetTable[i] = offsetTable[i - 1] + counters[i - 1];
        }

        /* sort on 2nd character */
        for (i = 0; i < blockSize - 1; i++)
        {
            j = block[i + 1];
            v[offsetTable[j]] = i;
            offsetTable[j] = offsetTable[j] + 1;
        }

        /* handle wrap around for string starting at end of block */
        j = block[0];
        v[offsetTable[j]] = i;
        offsetTable[0] = 0;

        /*** radix sort on first character in rotation ***/

        for(i = 1; i < 256; i++)
        {
            /* determine number of values before those sorted under i */
            offsetTable[i] = offsetTable[i - 1] + counters[i - 1];
        }

        for (i = 0; i < blockSize; i++)
        {
            j = v[i];
            j = block[j];
            rotationIdx[offsetTable[j]] = v[i];
            offsetTable[j] = offsetTable[j] + 1;
        }

        /*******************************************************************
        * now rotationIdx contains the sort order of all strings sorted
        * by their first 2 characters.  Use qsort to sort the strings
        * that have their first two characters matching.
        *******************************************************************/
        for (i = 0, k = 0; (i <= UCHAR_MAX) && (k < (blockSize - 1)); i++)
        {
            for (j = 0; (j <= UCHAR_MAX) && (k < (blockSize - 1)); j++)
            {
                int first = k;

                /* count strings starting with ij */
                while ((i == block[rotationIdx[k]]) &&
                    (j == block[Wrap(rotationIdx[k] + 1,  blockSize)]))
                {
                    k++;

                    if (k == blockSize)
                    {
                        /* we've searched the whole block */
                        break;
                    }
                }

                if (k - first > 1)
                {
                    /* there are at least 2 strings staring with ij, sort them */
                    qsort(&rotationIdx[first], k - first, sizeof(int),
                        ComparePresorted);
                }
            }
        }

        /* find last characters of rotations (L) - C2 */
        s0Idx = 0;
        for (i = 0; i < blockSize; i++)
        {
            if (rotationIdx[i] != 0)
            {
                last[i] = block[rotationIdx[i] - 1];
            }
            else
            {
                /* unrotated string 1st character is end of string */
                s0Idx = i;
                last[i] = block[blockSize - 1];
            }
        }
        // printf("ANTES:\n");
        // for (i = 0; i < blockSize; i++)
        // {
        //     printf("%2d,",last[i]);
        // }
        // printf("\nDESPUES:\n");

        if (mtf)
        {
            DoMTF(last, blockSize);
        }

        // for (i = 0; i < blockSize; i++)
        // {
        //     printf("%2d,",last[i]);
        // }
        // printf("\n");

        // /* write index of end of unrotated string (I) */
        // fwrite(&s0Idx, sizeof(int), 1, fpOut);
        //
        // /* write out last characters of rotations (L) */
        // fwrite(last, sizeof(unsigned char), blockSize, fpOut);
    // } //FIN WHILE

        memcpy((char *)outString, (void *)last, sizeof(unsigned char) * blockSize);
        // strncpy(outString,last,blockSize+1);
        // blockSize=strlen(last);
        // printf("block2:%s, SIZE: %ld\n",last,strlen(last));

    /* clean up */
    free(rotationIdx);
    free(v);
    free(last);
    // fclose(fpIn);
    // fclose(fpOut);
    return TRUE;
}

/***************************************************************************
*   Function   : DoMTF
*   Description: This function performs move to front encoding on a block
*                on of data that has already had the Burrows-Wheeler
*                transformation applied to it.  Comments in this function
*                indicate corresponding variables, labels, and sections in
*                "A Block-sorting Lossless Data Compression Algorithm" by
*                M. Burrows and D.J. Wheeler.
*   Parameters : last - pointer an array of "last" characters from
*                       Burrows-Wheeler rotations (L)
*                length - the number of unsigned chars contained in last.
*   Effects    : Move to front encoding is applied on an array of last
*                characters.  The results of the encoding replace the data
*                that was stored in last.
*   Returned   : NONE
***************************************************************************/
void DoMTF(unsigned char *last, int length)
{
    unsigned char list[UCHAR_MAX + 1];      /* list of characters (Y) */
    unsigned char *encoded;                 /* mtf encoded block (R) */
    int i, j;

    /***********************************************************************
    * BLOCK_SIZE arrays are allocated on the heap, because gcc generates
    * code that throws a Segmentation fault when the large arrays are
    * allocated on the stack.
    ***********************************************************************/
    encoded = (unsigned char *)malloc(BLOCK_SIZE * sizeof(unsigned char));

    if (NULL == encoded)
    {
        perror("Allocating array to store MTF encoding");
        return;
    }

    /* start with alphabetically sorted list of characters */
    for(i = 0; i <= UCHAR_MAX; i++)
    {
        list[i] = (unsigned char)i;
    }

    /* move-to-front coding - M1 */
    for (i = 0; i < length; i++)
    {
        /*******************************************************************
        * Find the character in the list of characters.  I do a sequential
        * search because of move to front causes common characters to be
        * near the front of the list.
        *******************************************************************/
        for (j = 0; j <= UCHAR_MAX; j++)
        {
            if (list[j] == last[i])
            {
                /* we found the character */
                encoded[i] = j;
                break;
            }
        }

        /* now move the current character to the front of the list */
        for (; j > 0; j--)
        {
            list[j] = list[j - 1];
        }
        list[0] = last[i];
    }

    /* copy mtf encoded vector of last characters (R) to input */
    memcpy((void *)last, (void *)encoded, sizeof(unsigned char) * length);
    free(encoded);

    return;
}

/***************************************************************************
*   Function   : BWReverseXformFile
*   Description: This function reverses a Burrows-Wheeler transformation
*                on a file (with optional move to front) and writes the
*                resulting data to the specified output file.  Comments in
*                this function indicate corresponding variables, labels,
*                and sections in "A Block-sorting Lossless Data Compression
*                Algorithm" by M. Burrows and D.J. Wheeler.
*   Parameters : inFile - Name of file to reverse transform
*                outFile - Name of file to write reverse transformed
*                          output to
*                mtf - Set to TRUE if move to front decoding should be
*                      applied
*   Effects    : A Burrows-Wheeler reverse transformation (and possibly
*                move to front encoding) is applied to inFile.   The results
*                of the reverse transformation are written to outFile.
*   Returned   : TRUE for success, otherwise FALSE.
***************************************************************************/
int BWReverseXformFile(char *inFile, char *outFile, char mtf)
{
    FILE *fpIn, *fpOut;
    int i, j, sum;
    int count[UCHAR_MAX + 1];   /* count[i] = # of chars in block <= i */
    int *pred;                  /* pred[i] = # of times block[i] appears in
                                   block[0 .. i - 1] */
    unsigned char *unrotated;   /* original block */
    int s0Idx;                  /* index of S0 in rotations (I) */

    /***********************************************************************
    * BLOCK_SIZE arrays are allocated on the heap, because gcc generates
    * code that throws a Segmentation fault when the large arrays are
    * allocated on the stack.
    ***********************************************************************/
    pred = (int *)malloc(BLOCK_SIZE * sizeof(int));

    if (NULL == pred)
    {
        perror("Allocating array of matching predicessors");
        return FALSE;
    }

    unrotated = (unsigned char *)malloc(BLOCK_SIZE * sizeof(unsigned char));

    if (NULL == unrotated)
    {
        perror("Allocating array to store unrotated block");
        free(pred);
        return FALSE;
    }

    /* open input and output files */
    if ((fpIn = fopen(inFile, "rb")) == NULL)
    {
        perror(inFile);
        return FALSE;
    }

    if (outFile == NULL)
    {
        fpOut = stdout;
    }
    else
    {
        if ((fpOut = fopen(outFile, "wb")) == NULL)
        {
            fclose(fpIn);
            perror(outFile);
            return FALSE;
        }
    }

    while(fread(&s0Idx, sizeof(int), 1, fpIn) != 0)
    {
        blockSize = fread(block, sizeof(unsigned char), BLOCK_SIZE, fpIn);

        if(mtf)
        {
            UndoMTF(block, blockSize);
        }

        /* code based on pseudo code from section 4.2 (D1 and D2) follows */
        for(i = 0; i <= UCHAR_MAX; i++)
        {
            count[i] = 0;
        }

        /*******************************************************************
        * Set pred[i] to the number of times block[i] appears in the
        * substring block[0 .. i - 1].  As a useful side effect count[i]
        * will be the number of times character i appears in block.
        *******************************************************************/
        for (i = 0; i < blockSize; i++)
        {
            pred[i] = count[block[i]];
            count[block[i]]++;
        }

        /*******************************************************************
        * Finally, set count[i] to the number of characters in block
        * lexicographically less than i.
        *******************************************************************/
        sum = 0;
        for(i = 0; i <= UCHAR_MAX; i++)
        {
            j = count[i];
            count[i] = sum;
            sum += j;
        }

        /* construct the initial unrotated string (S[0]) */
        i = s0Idx;
        for(j = blockSize - 1; j >= 0; j--)
        {
            unrotated[j] = block[i];
            i = pred[i] + count[block[i]];
        }

        fwrite(unrotated, sizeof(unsigned char), blockSize, fpOut);
    }

    /* clean up */
    free(pred);
    free(unrotated);
    fclose(fpIn);
    fclose(fpOut);
    return TRUE;
}

int BWReverseXform(char *inString, char *outString, int mtf, long size)
{
    // FILE *fpIn, *fpOut;
    int i, j, sum;
    int count[UCHAR_MAX + 1];   /* count[i] = # of chars in block <= i */
    int *pred;                  /* pred[i] = # of times block[i] appears in
                                   block[0 .. i - 1] */
    unsigned char *unrotated;   /* original block */
    int s0Idx;                  /* index of S0 in rotations (I) */

    /***********************************************************************
    * BLOCK_SIZE arrays are allocated on the heap, because gcc generates
    * code that throws a Segmentation fault when the large arrays are
    * allocated on the stack.
    ***********************************************************************/
    pred = (int *)malloc(BLOCK_SIZE * sizeof(int));

    if (NULL == pred)
    {
        perror("Allocating array of matching predicessors");
        return FALSE;
    }

    unrotated = (unsigned char *)malloc(BLOCK_SIZE * sizeof(unsigned char));

    if (NULL == unrotated)
    {
        perror("Allocating array to store unrotated block");
        free(pred);
        return FALSE;
    }

    // while(fread(&s0Idx, sizeof(int), 1, fpIn) != 0)
    //     {
        // blockSize = fread(block, sizeof(unsigned char), BLOCK_SIZE, fpIn);

    blockSize=size;
    strncpy(block,inString,blockSize);

        if(mtf)
        {
            UndoMTF(block, blockSize);
        }

        /* code based on pseudo code from section 4.2 (D1 and D2) follows */
        for(i = 0; i <= UCHAR_MAX; i++)
        {
            count[i] = 0;
        }

        /*******************************************************************
        * Set pred[i] to the number of times block[i] appears in the
        * substring block[0 .. i - 1].  As a useful side effect count[i]
        * will be the number of times character i appears in block.
        *******************************************************************/
        for (i = 0; i < blockSize; i++)
        {
            pred[i] = count[block[i]];
            count[block[i]]++;
        }

        /*******************************************************************
        * Finally, set count[i] to the number of characters in block
        * lexicographically less than i.
        *******************************************************************/
        sum = 0;
        for(i = 0; i <= UCHAR_MAX; i++)
        {
            j = count[i];
            count[i] = sum;
            sum += j;
        }

        /* construct the initial unrotated string (S[0]) */
        i = s0Idx;
        for(j = blockSize - 1; j >= 0; j--)
        {
            unrotated[j] = block[i];
            i = pred[i] + count[block[i]];
        }

        // fwrite(unrotated, sizeof(unsigned char), blockSize, fpOut);
    // }

    strncpy(outString,unrotated,blockSize);

    /* clean up */
    free(pred);
    free(unrotated);
    // fclose(fpIn);
    //  fclose(fpOut);
    //
    return TRUE;
}

/***************************************************************************
*   Function   : UndoMTF
*   Description: This function reverses move to front encoding on a block
*                on of data that has already had the Burrows-Wheeler
*                transformation applied to it.  Comments in this function
*                indicate corresponding variables, labels, and sections in
*                "A Block-sorting Lossless Data Compression Algorithm" by
*                M. Burrows and D.J. Wheeler.
*   Parameters : last - pointer an array of mtf encoded characters from
*                       Burrows-Wheeler rotations.
*                length - the number of unsigned chars contained in last.
*   Effects    : Move to front encoding is reversed on an array of last
*                characters.  The results of the reversal are stored in
*                the array last (L), providing an array of last characters
*                of sorted rotations.
*   Returned   : NONE
***************************************************************************/
void UndoMTF(unsigned char *last, int length)
{
    unsigned char list[UCHAR_MAX + 1];      /* list of characters (Y) */
    unsigned char *encoded;                 /* mtf encoded block (R) */
    int i, j;

    /***********************************************************************
    * BLOCK_SIZE arrays are allocated on the heap, because gcc generates
    * code that throws a Segmentation fault when the large arrays are
    * allocated on the stack.
    ***********************************************************************/
    encoded = (unsigned char *)malloc(BLOCK_SIZE * sizeof(unsigned char));

    if (NULL == encoded)
    {
        perror("Allocating array to store MTF encoding");
        return;
    }

    /* copy last into encoded */
    memcpy((void *)encoded, (void *)last, sizeof(unsigned char) * length);

    /* start with alphabetically sorted list of characters */
    for(i = 0; i <= UCHAR_MAX; i++)
    {
        list[i] = (unsigned char)i;
    }

    /* move-to-front decoding - W2 */
    for (i = 0; i < length; i++)
    {
        /* decode the character */
        last[i] = list[encoded[i]];

        /* now move the current character to the front of the list */
        for (j = encoded[i]; j > 0; j--)
        {
            list[j] = list[j - 1];
        }
        list[0] = last[i];
    }

    free(encoded);
    return;
}


text:
The __AudioRecorder__ widget is an example of how to record, save and play audio files in wakanda

### Properties
This widget __AudioRecorder__ has the following properties:

* __value__: The data binding value of the widget

### Goals
The __AudioRecorder__ is an example of how to use HTML5 to record audio files in Wakanda.

This is a simple example that include also a graphical representation of the sound while recording.

### Events (widget.js)

```
    Event.create('play');
    Event.create('stopPlaying');
    Event.create('record');
    Event.create('stopRecording');
    Event.create('capture');
    Event.create('stopCapture');

```

### Wakanda Studio

Model
```
1. Create a datasource  D
2. Add attribute string S1
3. Add atribute string  S2
4. save your model.

```

Wakanda Widgets (optional)
```
1. Drag a wakanda grid to your page and add the datasource D on it

```

Custom Widget
```
1. Drag the widget to your Wakanda page.
2. A black box should be available with a few buttons
3. Drop the second datasource string attribute S2 inside the widget or change the
       property's panel Datasource value (this will store the music)
4. save your page
5. run your page
6. Add a record to your grid
7. Select the grid record recently created
8. click record and save or play your file after
```

### CSS
The __AudioRecorder__ CSS will define the background color of the widget.
You can adjust its color by changing directly in the Studio OR by changing the /css/widget.css file.

### More Information
For more information on how to install a custom widget, refer to [Installing a Custom Widget](http://doc.wakanda.org/WakandaStudio0/help/Title/en/page3869.html#1027761).

For more information about Custom Widgets, refer to [Custom Widgets](http://doc.wakanda.org/Wakanda0.v5/help/Title/en/page3863.html "Custom Widgets") in the [Architecture of Wakanda Applications](http://doc.wakanda.org/Wakanda0.v5/help/Title/en/page3844.html "Architecture of Wakanda Applications") manual.


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.VisualStudio.Debugger.Contracts.EditAndContinue;

namespace Microsoft.CodeAnalysis.EditAndContinue
{
    internal readonly struct ProjectChanges
    {
        /// <summary>
        /// All semantic changes made in changed documents.
        /// </summary>
        public readonly ImmutableArray<SemanticEdit> SemanticEdits;

        /// <summary>
        /// All line changes made in changed documents.
        /// </summary>
        public readonly ImmutableArray<SequencePointUpdates> LineChanges;

        /// <summary>
        /// All symbols added in changed documents.
        /// </summary>
        public readonly ImmutableHashSet<ISymbol> AddedSymbols;

        /// <summary>
        /// All active statements and the corresponding exception regions in changed documents.
        /// </summary>
        public readonly ImmutableArray<DocumentActiveStatementChanges> ActiveStatementChanges;

        public ProjectChanges(
            ImmutableArray<SemanticEdit> semanticEdits,
            ImmutableArray<SequencePointUpdates> lineChanges,
            ImmutableHashSet<ISymbol> addedSymbols,
            ImmutableArray<DocumentActiveStatementChanges> activeStatementChanges)
        {
            Debug.Assert(!semanticEdits.IsDefault);
            Debug.Assert(!lineChanges.IsDefault);
            Debug.Assert(!activeStatementChanges.IsDefault);

            SemanticEdits = semanticEdits;
            LineChanges = lineChanges;
            AddedSymbols = addedSymbols;
            ActiveStatementChanges = activeStatementChanges;
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Lücking, Chaves, Sipman, Umaña & Aptroot, Fieldiana, Bot. 46(no. 1549): 96 (2008)

#### Original name
Graphis paraserpens Lizano & Lücking

### Remarks
null


text:
export default function startLogMiddleware ( application ) {
	return function * logMiddleware ( next ) {
		let start = new Date();
		yield next;
		let delta = new Date() - start;
		application.log.debug(`${start} - ${this.method} ${this.url} - ${this.response.status} ${this.response.message} - ${delta}ms`);
	};
}


text:
namespace asar {

class ScopedTemporaryFile;

enum HashAlgorithm {
  SHA256,
  NONE,
};

struct IntegrityPayload {
  IntegrityPayload();
  ~IntegrityPayload();
  IntegrityPayload(const IntegrityPayload& other);
  HashAlgorithm algorithm;
  std::string hash;
  uint32_t block_size;
  std::vector<std::string> blocks;
};

// This class represents an asar package, and provides methods to read
// information from it. It is thread-safe after |Init| has been called.
class Archive {
 public:
  struct FileInfo {
    FileInfo();
    ~FileInfo();
    bool unpacked;
    bool executable;
    uint32_t size;
    uint64_t offset;
    absl::optional<IntegrityPayload> integrity;
  };

  struct Stats : public FileInfo {
    Stats() : is_file(true), is_directory(false), is_link(false) {}
    bool is_file;
    bool is_directory;
    bool is_link;
  };

  explicit Archive(const base::FilePath& path);
  virtual ~Archive();

  // disable copy
  Archive(const Archive&) = delete;
  Archive& operator=(const Archive&) = delete;

  // Read and parse the header.
  bool Init();

  absl::optional<IntegrityPayload> HeaderIntegrity() const;
  absl::optional<base::FilePath> RelativePath() const;

  // Get the info of a file.
  bool GetFileInfo(const base::FilePath& path, FileInfo* info) const;

  // Fs.stat(path).
  bool Stat(const base::FilePath& path, Stats* stats) const;

  // Fs.readdir(path).
  bool Readdir(const base::FilePath& path,
               std::vector<base::FilePath>* files) const;

  // Fs.realpath(path).
  bool Realpath(const base::FilePath& path, base::FilePath* realpath) const;

  // Copy the file into a temporary file, and return the new path.
  // For unpacked file, this method will return its real path.
  bool CopyFileOut(const base::FilePath& path, base::FilePath* out);

  // Returns the file's fd.
  // Using this fd will not validate the integrity of any files
  // you read out of the ASAR manually.  Callers are responsible
  // for integrity validation after this fd is handed over.
  int GetUnsafeFD() const;

  base::FilePath path() const { return path_; }

 private:
  bool initialized_;
  bool header_validated_ = false;
  const base::FilePath path_;
  base::File file_;
  int fd_ = -1;
  uint32_t header_size_ = 0;
  absl::optional<base::Value::Dict> header_;

  // Cached external temporary files.
  base::Lock external_files_lock_;
  std::unordered_map<base::FilePath::StringType,
                     std::unique_ptr<ScopedTemporaryFile>>
      external_files_;
};

}  // namespace asar

#endif  // ELECTRON_SHELL_COMMON_ASAR_ARCHIVE_H_


text:
var asterisk;
var ghost;
var platform;

var GRAVITY = 1;
var JUMP = 15;

function setup() {
  createCanvas(800,400);

  ghost = createSprite(600, 200);
  ghost.addAnimation("normal", "assets/ghost_spin0001.png",  "assets/ghost_spin0003.png");

  asterisk = createSprite(200, 200);
  asterisk.addAnimation("normal", "assets/asterisk_normal0001.png", "assets/asterisk_normal0003.png");
  asterisk.addAnimation("stretch", "assets/asterisk_stretching0001.png", "assets/asterisk_stretching0008.png");

  //if defined, the collider will be used for mouse events
  asterisk.setCollider("circle", 0,0,64);

  platform = createSprite(200, 300);
  platform.addAnimation("normal", "assets/small_platform0001.png",  "assets/small_platform0003.png");
}

function draw() {
  background(255,255,255);

  fill(200);
  textAlign(CENTER);
  text("Press x and z", width/2, 20);

  asterisk.velocity.y += GRAVITY;

  if(asterisk.collide(platform)) {
    asterisk.velocity.y = 0;
    asterisk.changeAnimation("normal");
    }

  //keyDown returns true for a cycle if the key was just pressed
  //during this cycle. Useful to capture instant events in the draw cycle
  //without moving game logic to the mousePressed() function
  //mouseWentDown works the same way with mouse input
  if(keyWentDown("x") || mouseWentDown(LEFT))
    {
    asterisk.changeAnimation("stretch");
    asterisk.animation.rewind();
    asterisk.velocity.y = -JUMP;
    }

  //same as keyWentDown
  //RIGHT = right mouse button
  if(keyWentUp("z") || mouseWentUp(RIGHT))
    ghost.rotation = 0;

  //keyDown is similar to keyIsDown() except it accepts both key codes and characters
  if(keyDown("z") || mouseDown(RIGHT))
    ghost.rotation -= 10;

  drawSprites();
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.lorislab.tower</groupId>
		<artifactId>tower-base</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../</relativePath>
	</parent>

	<artifactId>tower-base-bom</artifactId>
	<name>tower-base-bom</name>
	<packaging>pom</packaging>

	<!-- Runtime dependency management -->
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.lorislab.tower</groupId>
				<artifactId>tower-base-api</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>org.lorislab.tower</groupId>
				<artifactId>tower-base-server-rs</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>org.lorislab.tower</groupId>
				<artifactId>tower-maven-plugin</artifactId>
				<version>${project.version}</version>
				<type>maven-plugin</type>
			</dependency>
		</dependencies>
	</dependencyManagement>

</project>


text:
.. labormatch documentation master file, created by
   sphinx-quickstart on Tue Jan 20 21:10:11 2015.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to labormatch's documentation!
======================================

Contents:

.. toctree::
   :maxdepth: 2

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2-70-
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.02.02 at 03:31:08 PM MEZ
//

package reactionruleml;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for Plex-resl.type complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="Plex-resl.type">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <group ref="{http://www.ruleml.org/1.0/xsd}Plex-resl.content"/>
 *       <attGroup ref="{http://www.ruleml.org/1.0/xsd}Plex.attlist"/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Plex-resl.type", propOrder = {
    "slotOrResl"
})
public class PlexReslType {

    @XmlElements({
        @XmlElement(name = "slot", type = SlotType.class),
        @XmlElement(name = "resl", type = ReslType.class)
    })
    protected List<Object> slotOrResl;

    /**
     * Gets the value of the slotOrResl property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the slotOrResl property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getSlotOrResl().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link SlotType }
     * {@link ReslType }
     *
     *
     */
    public List<Object> getSlotOrResl() {
        if (slotOrResl == null) {
            slotOrResl = new ArrayList<Object>();
        }
        return this.slotOrResl;
    }

}


text:
<?php

namespace Llaumgui\CheckToolsFramework\CheckTool;

use Symfony\Component\Finder\SplFileInfo;

/**
 * Definition of CheckToolInterface for all CheckTool services.
 */
interface CheckToolInterface
{
    /**
     * Check content.
     *
     * @param string $content The content to check.
     * @return CheckToolTest Return a CheckToolsResult object.
     */
    public function doCheck(SplFileInfo $content);

    /**
     * Return description about textSuites.
     *
     * @return string
     */
    public function getTestSuitesDescription();

    /**
     * Return description about textSuite.
     *
     * @return string
     */
    public function getTestSuiteDescription();

    /**
     * Return default fileNamePatern argment..
     *
     * @return string
     */
    public function getDefaultFileNamePatern();
}


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

/**
 *  Intel IDE Controller datasheet at :
 *  ftp://download.intel.com/design/intarch/datashts/29055002.pdf
 */

#include "ide.hpp"
#include <hw/pci_device.hpp>
#include <hw/ioport.hpp>
#include <kernel/events.hpp>
#include <fs/common.hpp>
#include <arch.hpp>
#include <inttypes.h>

//#define IDE_DEBUG
#ifdef IDE_DEBUG
#define IDBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#define IDBG(fmt, ...) /* fmt */
#endif

#define IDE_DATA        0x1F0
#define IDE_SECCNT      0x1F2
#define IDE_LBA0        0x1F3
#define IDE_LBA1        0x1F4
#define IDE_LBA2        0x1F5
#define IDE_DRV         0x1F6
#define IDE_CMD         0x1F7
#define IDE_SECCOUNT1   0x1F8
#define IDE_LBA3        0x1F9
#define IDE_LBA4        0x1FA
#define IDE_LBA5        0x1FB
#define IDE_STATUS      IDE_CMD

#define ATA_REG_DATA       0x00
#define ATA_REG_ERROR      0x01
#define ATA_REG_FEATURES   0x01
#define ATA_REG_SECCOUNT0  0x02
#define ATA_REG_LBA0       0x03
#define ATA_REG_LBA1       0x04
#define ATA_REG_LBA2       0x05
#define ATA_REG_HDDEVSEL   0x06
#define ATA_REG_COMMAND    0x07
#define ATA_REG_STATUS     0x07
#define ATA_REG_SECCOUNT1  0x08
#define ATA_REG_LBA3       0x09
#define ATA_REG_LBA4       0x0A
#define ATA_REG_LBA5       0x0B
#define ATA_REG_CONTROL    0x0C
#define ATA_REG_ALTSTATUS  0x0C
#define ATA_REG_DEVADDRESS 0x0D

#define IDE_CMD_READ     0x20
#define IDE_CMD_WRITE    0x30
#define IDE_CMD_IDENTIFY 0xEC

#define IDE_DRQ      (1 << 3)
#define IDE_DRDY     (1 << 6)
#define IDE_BUSY     (1 << 7)

#define IDE_CTRL_IRQ 0x3F6
#define IDE_IRQN     14

#define IDE_VENDOR_ID   PCI::VENDOR_INTEL
#define IDE_PRODUCT_ID  0x7010

#define IDE_TIMEOUT 2048

const int IDE::SECTOR_SIZE;
const int IDE::SECTOR_ARRAY;

struct workq_item
{
  using block_t = IDE::block_t;
  using buffer_t = IDE::buffer_t;

#ifdef IDE_ENABLE_READ
  using on_read_func = IDE::on_read_func;
  // read
  workq_item(uint8_t id, block_t blk, uint32_t cnt, on_read_func call)
    : drive_id(id), read(true), sector(blk), total(cnt), readcall(std::move(call))
  {
    buffer = std::make_shared<os::mem::buffer> (total * IDE::SECTOR_SIZE);
  }
#endif
#ifdef IDE_ENABLE_WRITE
  using on_write_func = IDE::on_write_func;
  // write
  workq_item(uint8_t id, block_t blk, buffer_t buf, on_write_func call)
    : drive_id(id), read(false), sector(blk), buffer(buf), writecall(std::move(call))
  {
    assert(buffer->size() % IDE::SECTOR_SIZE == 0);
    total = buffer->size() / IDE::SECTOR_SIZE;
  }
#endif
  ~workq_item() {}

  uint8_t* current() {
    return &buffer->at(position * IDE::SECTOR_SIZE);
  }
  bool done() const noexcept { return position == total; }

  uint8_t      drive_id;
  bool         read;
  block_t      sector;
  uint32_t     position = 0;
  uint32_t     total;
  buffer_t     buffer;
  union {
#ifdef IDE_ENABLE_READ
    on_read_func  readcall;
#endif
#ifdef IDE_ENABLE_WRITE
    on_write_func writecall;
#endif
  };
};
static std::deque<workq_item> work_queue;

IDE::IDE(hw::PCI_Device& pcidev, selector_t sel)
  : drive_id {(uint8_t) sel}
{
  INFO("IDE","VENDOR_ID : 0x%x, PRODUCT_ID : 0x%x",
        pcidev.vendor_id(), pcidev.product_id());
  INFO("IDE","Attaching to  PCI addr 0x%x",
        pcidev.pci_addr());

  /** PCI device checking */
  CHECKSERT(pcidev.vendor_id() == IDE_VENDOR_ID, "Vendor ID is INTEL");
  CHECKSERT(pcidev.product_id() == IDE_PRODUCT_ID, "Product ID is IDE Controller");

  /** Probe PCI resources and fetch I/O-base for device */
  pcidev.probe_resources();
  this->pci_iobase = pcidev.iobase();

  /** IRQ initialization */
  Events::get().subscribe(IDE_IRQN, {&IDE::irq_handler});
  __arch_enable_legacy_irq(IDE_IRQN);

  /** IDE device initialization */
  set_irq_mode(false);
  set_drive(0xA0 | this->drive_id);
  set_nbsectors(0U);
  set_blocknum(0U);
  set_command(IDE_CMD_IDENTIFY);

  uint8_t status = hw::inb(IDE_STATUS);
  CHECKSERT(status, "IDE status OK");

  wait_status_flags(IDE_DRDY, false);

  // read device capabilities
  std::array<uint16_t, SECTOR_ARRAY> read_array;
  for (int i = 0; i < IDE::SECTOR_ARRAY; i++) {
    read_array[i] = hw::inw(IDE_DATA);
  }
  // get ident command sets
  uint32_t command_sets = read_array[82] | (read_array[83] << 16);
  if (command_sets & (1 << 26))
  { // 48-bits MAX_LBA_EXT
    this->num_blocks = (read_array[101] << 16) | read_array[100];
  }
  else
  { // 28-bits CHS (MAX_LBA)
    this->num_blocks = (read_array[61] << 16) | read_array[60];
  }
  INFO("IDE", "%" PRIu64 " sectors (%" PRIu64 " bytes)", num_blocks, num_blocks * IDE::SECTOR_SIZE);
  INFO("IDE", "Initialization complete");
}

void IDE::read(block_t blk, size_t count, on_read_func callback)
{
  // avoid reading past the disk boundaries, or reading 0 sectors
  if (blk + count >= this->num_blocks || count == 0) {
    callback(nullptr);
    return;
  }
  IDBG("IDE: Read called on %lu + %lu\n", blk, count);

#ifdef IDE_ENABLE_READ
  work_queue.emplace_back(drive_id, blk, count, callback);
  if (work_queue.size() == 1) work_begin_next();
#else
  (void) blk;
  (void) count;
  callback(nullptr);
#endif
}

IDE::buffer_t IDE::read_sync(block_t blk, size_t cnt)
{
  if (blk >= this->num_blocks) {
    // avoid reading past the disk boundaries
    return nullptr;
  }

#ifdef IDE_ENABLE_READ
  set_irq_mode(false);
  set_drive(0xE0 | drive_id | ((blk >> 24) & 0x0F));
  set_nbsectors(cnt);
  set_blocknum(blk);
  set_command(IDE_CMD_READ);

  auto buffer = fs::construct_buffer(IDE::SECTOR_SIZE * cnt);
  wait_status_flags(IDE_DRDY, false);

  auto* data = (uint16_t*) buffer->data();
  for (size_t i = 0; i < IDE::SECTOR_ARRAY * cnt; i++)
      data[i] = hw::inw(IDE_DATA);
  return buffer;
#else
  return nullptr;
#endif
}

void IDE::write(block_t blk, buffer_t buffer, on_write_func callback)
{
#ifdef IDE_ENABLE_WRITE
  // avoid writing past the disk boundaries
  if (blk + buffer->size() / block_size() > this->num_blocks) {
    callback(true);
    return;
  }
  IDBG("IDE: Write called on %lu (%lu bytes)\n", blk, buffer->size());

  work_queue.emplace_back(drive_id, blk, buffer, callback);
  if (work_queue.size() == 1) work_begin_next();
#else
  (void) blk;
  (void) buffer;
  callback(true);
#endif
}
bool IDE::write_sync(block_t blk, buffer_t buffer)
{
#ifdef IDE_ENABLE_WRITE
  // avoid writing past the disk boundaries
  if (blk + buffer->size() / block_size() > this->num_blocks) {
    return true;
  }
  IDBG("IDE: Write called on %lu (%lu bytes)\n", blk, buffer->size());

  const uint32_t total = buffer->size() / block_size();
  set_irq_mode(false);
  set_drive(0xE0 | this->drive_id | ((blk >> 24) & 0x0F));
  set_nbsectors(total);
  set_blocknum(blk);
  set_command(IDE_CMD_WRITE);

  auto* data = (uint16_t*) buffer->data();
  for (size_t i = 0; i < total * IDE::SECTOR_ARRAY; i++)
      hw::outw(IDE_DATA, data[i]);
  return false;

#else
  (void) blk;
  (void) buffer;
  return true;
#endif
}

void IDE::spinwait_status_busy() noexcept {
  uint8_t ret;
  while (((ret = hw::inb(IDE_STATUS)) & IDE_BUSY) == IDE_BUSY) asm("pause");
}

void IDE::wait_status_flags(const int flags, const bool set) noexcept
{
  spinwait_status_busy();

  for (int i = IDE_TIMEOUT; i != 0; --i)
  {
    auto ret = hw::inb(IDE_STATUS);
    if (set) {
      if ((ret & flags) == flags)
        break;
    } else {
      if ((ret & flags) not_eq flags)
        break;
    }
  }
}

void IDE::set_drive(const uint8_t drive) noexcept {
  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_DRV, drive);
}

void IDE::set_nbsectors(const uint8_t cnt) noexcept {
  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_SECCNT, cnt);
}

void IDE::set_blocknum(block_t blk) noexcept
{
  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_LBA0, blk & 0xFF);

  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_LBA1, (blk & 0xFF00) >> 8);

  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_LBA2, (blk & 0xFF0000) >> 16);

  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_SECCOUNT1, 1);

  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_LBA3, (blk & 0xFF000000) >> 24);

  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_LBA4, 0);

  wait_status_flags(IDE_DRQ, true);
  hw::outb(IDE_LBA5, 0);
}

void IDE::set_command(const uint16_t command) noexcept {
  wait_status_flags(IDE_DRDY, false);
  hw::outb(IDE_CMD, command);
}

void IDE::set_irq_mode(const bool on) noexcept {
  wait_status_flags(IDE_DRDY, false);
  hw::outb(IDE_CTRL_IRQ, on ? 0 : 1);
}

void IDE::work_begin_next()
{
  if (work_queue.empty()) return;
  auto& item = work_queue.front();
  assert(item.position == 0);

  set_irq_mode(true);
  set_drive(0xE0 | item.drive_id | ((item.sector >> 24) & 0x0F));
#ifdef IDE_ENABLE_READ
  if (item.read) {
    set_nbsectors(item.total);
    set_blocknum(item.sector);
    set_command(IDE_CMD_READ);
  }
#endif
#ifdef IDE_ENABLE_WRITE
  if (item.read == false) {
    set_nbsectors(item.total);
    set_blocknum(item.sector);
    set_command(IDE_CMD_WRITE);
  }
#endif
}
void IDE::irq_handler()
{
  while (not work_queue.empty())
  {
    auto& item = work_queue.front();
    wait_status_flags(IDE_DRDY, false);

#ifdef IDE_ENABLE_READ
    if (item.read)
    {
      // read operation
      IDBG("IDE: Reading %u / %u\n", item.position, item.total);
      // read to current position
      auto* wptr = (uint16_t*) item.current();
      for (block_t i = 0; i < IDE::SECTOR_ARRAY; i++) {
          wptr[i] = hw::inw(IDE_DATA);
      }
      // go to next position
      item.position++;
      // if the read is done, shipit
      if (item.done())
      {
        auto buffer = std::move(item.buffer);
        auto callback = std::move(item.readcall);
        work_queue.pop_front();
        // shipit
        callback(std::move(buffer));
        // queue next job, if any
        work_begin_next();
      } // done
    } // read
#endif
#ifdef IDE_ENABLE_WRITE
    if (item.read == false)
    {
      // write operation
      IDBG("IDE: Writing %u / %u\n", item.position, item.total);
      // write from current position
      auto* wptr = (uint16_t*) item.current();
      for (block_t i = 0; i < IDE::SECTOR_ARRAY; i++) {
          hw::outw(IDE_DATA, wptr[i]);
      }
      // go to next position
      item.position++;
      // if the read is done, shipit
      if (item.done())
      {
        auto callback = std::move(item.writecall);
        work_queue.pop_front();
        // shipit
        callback(false);
        // queue next job, if any
        work_begin_next();
      } // done
    }
#endif
  } // queue
}

void IDE::deactivate() {}

#include <kernel/pci_manager.hpp>
__attribute__((constructor))
static void autoreg() {
  PCI_manager::register_blk(PCI::VENDOR_INTEL, IDE_PRODUCT_ID, &IDE::new_instance);
};


text:
Simple and easy to implementation boilerplate Android Project with MVP Architecture, its contains :

1. **BaseActivity**
2. **BaseFragment**
3. **BaseDialogFragment**
4. **BaseRecyclerViewAdapter**
5. **BaseViewHolder**
6. **BasePresenter**
7. **BaseView**

## Installation

Add it in your root build.gradle at the end of repositories:

```groovy
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
```

Add the dependency

```groovy
dependencies {
    compile 'com.github.andhikayuana:android-core:0.0.1-alpha'
}
```

## How to use this

1. Fragment

```java
public class LoginFragment extends BaseFragment<LoginPresenter> {

    @Override
    public void showLoading() {
        //do your implementation
    }

    @Override
    public void dismissLoading() {
        //do your implementation
    }

    @Override
    public void showError(Throwable throwable) {
        //do your implementation
    }

    @Override
    protected void initView(View v) {
        //do your implementation
    }

    @Override
    protected LoginPresenter initPresenter() {
        return new LoginPresenter();
    }

    @Override
    protected int setView() {
        return R.layout.fragment_login;
    }
}
```

2. Presenter

```java
public class LoginPresenter extends BasePresenter<LoginView> {
    //do your implementation
}
```

3. View

```java
public interface LoginView extends BaseView {
    //do your implementation
}
```

4. RecyclerViewAdapter

```java
public class ContactsAdapter extends BaseRecyclerViewAdapter<Contact, ContactsViewHolder> {

    public ContactsAdapter(Context context) {
        super(context);
    }

    @Override
    protected ContactsViewHolder initViewHolder(View view) {
        return new ContactsViewHolder(view);
    }

    @Override
    protected int setItemView(int viewType) {
        return R.layout.item_contact;
    }
}
```

Example use in activity

```java
ContactsAdapter adapter = new ContactsAdapter(this);

// now you can use some methods :
adapter.get(1); // to get an item object by position
adapter.add(contact); // to add an item
adapter.indexOf(contact); // to get index of an item
adapter.updateAt(1, contact); // to update item at some index position
adapter.addAll(contacts); // to add item list or array of item
adapter.remove(contact); // to remove an item
adapter.removeItemAt(1); // to remove item at some index
adapter.clear(); // to remove all item
```

5. RecyclerView ViewHolder

```java
public class ContactsViewHolder extends BaseViewHolder<Contact> {

    public ContactsViewHolder(View itemView) {
        super(itemView);
    }

    @Override
    public void bind(Contact item) {

    }
}
```

6. DialogFragment

```java
public class AddContactDialogFragmnet extends BaseDialogFragment {

    @Override
    protected void initView(View view) {
        //do your implementation
    }

    @Override
    protected Dialog setupDialog(AlertDialog.Builder builder) {
        //do your implementation like setTitle(); and many more
        return builder.create();
    }

    @Override
    protected int setView() {
        return R.layout.dialog_fragment_add_contact;
    }
}
```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

MIT License

Copyright (c) 2017 Andhika Yuana

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

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

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


text:
package com.akiraspeirs.cinder;

import android.databinding.ObservableInt;

/**
 * Created by akiraspeirs on 9/11/2016.
 */

public class CinderInt extends ObservableInt{
    private CinderObservable cinderObservable;

    public void setObservableBehaviour(CinderObservable behaviour){
        this.cinderObservable = behaviour;
    }

    public CinderInt once(){
        cinderObservable.once();
        return this;
    }

    public CinderInt take(int take){
        cinderObservable.take(take);
        return this;
    }

    public CinderInt skip(int skip){
        cinderObservable.skip(skip);
        return this;
    }

    public CinderInt filter(CinderObservable.Filter filter){
        cinderObservable.filter(filter);
        return this;
    }

    public CinderInt takeWhile(CinderObservable.Filter filter){
        cinderObservable.takeWhile(filter);
        return this;
    }

    public CinderInt skipWhile(CinderObservable.Filter filter){
        cinderObservable.skipWhile(filter);
        return this;
    }

    public CinderInt onUiThread(){
        cinderObservable.onUiThread();
        return this;
    }

    public CinderInt withDefault(int defaultValue){
        this.set(defaultValue);
        return this;
    }

    public CinderInt immediate(){
        this.cinderObservable.immediate();
        return this;
    }

    public CinderInt debounce(long debounce){
        this.cinderObservable.debounce(debounce);
        return this;
    }

    public void stop(){
        cinderObservable.stop();
    }
}


text:
<?php
/**
 * JSON group profile view
 *
 * @uses $vars['entity']
 */

echo elgg_view_entity($vars['entity']);


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Op. bot. 60: 124 (1981)

#### Original name
Sphaeria ammophilae Lasch, 1850

### Remarks
null


text:
package fortiss.gui;

import java.awt.BasicStroke;
import java.awt.ComponentOrientation;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.geom.Line2D;

import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.TitledBorder;

import fortiss.components.Building;
import fortiss.components.Connection;
import fortiss.gui.listeners.helper.DragLayout;
import fortiss.gui.listeners.label.ConnectorListener;
import fortiss.gui.listeners.line.LineListener;
import fortiss.gui.style.Colors;
import fortiss.simulation.helper.ConnectionManager;
import fortiss.simulation.helper.PositionManager;

/**
 * Possible actions in this panel: add, drag and remove building icons, draw
 * connection between building icons.
 */
public class BuildingPanel extends JPanel {

	private static final long serialVersionUID = 1L;
	private ConnectionManager cm = ConnectionManager.getInstance();

	/**
	 * true while the mouse is dragged with the mouse right button, and
	 * false otherwise.
	 */
	private boolean drawing = false;

	public BuildingPanel() {
		setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
		setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Layout area", TitledBorder.LEADING,
				TitledBorder.TOP, null, Colors.accent2));
		addComponentListener(new ComponentAdapter() {
			@Override
			public void componentResized(ComponentEvent e) {
				PositionManager pm = PositionManager.getInstance();
				pm.fixPositions();
			}
		});
		setAutoscrolls(true);
		setLayout(new DragLayout());
		addMouseListener(new LineListener());
	}

	public void paintComponent(Graphics g) {
		super.paintComponent(g);

		/** Necessary for dark mode on/off implementation */
		setBackground(Colors.background);

		for (Building building : DesignerPanel.buildings.values()) {
			building.getIcon().setForeground(Colors.defaultCol);
		}

		Graphics2D g2 = (Graphics2D) g;
		g2.setStroke(new BasicStroke(2, // Width
				BasicStroke.CAP_ROUND, // End-cap style
				BasicStroke.JOIN_ROUND // Vertex join style
		));

		if (isDrawing()) {
			g2.draw(new Line2D.Float(ConnectorListener.p1, ConnectorListener.p2));
		}

		for (Connection c : cm.getConnectionList()) {
			g2.setColor(c.getColor());
			g2.draw(c.getLn());
		}
	}

	/**
	 * Returns the value of {@link BuildingPanel#drawing}
	 */
	public boolean isDrawing() {
		return drawing;
	}

	/**
	 * Sets the value of {@link BuildingPanel#drawing}
	 *
	 * @param drawing boolean value
	 */
	public void setDrawing(boolean drawing) {
		this.drawing = drawing;
	}

	public void reset() {
		removeAll();
		revalidate();
		repaint();
	}

}


text:
package cartoongrabber.tools;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Formats a String that contains occurrences of time patterns. Time patterns have to be marked using '<' and '>'
 * brackets. Uses a {@link DateTimeFormatter} to format the subsections of the string and a {@link DateService} to get
 * the date.
 * Created by Philipp Krauß on 17.07.2017.
 */
@Component
public class MarkupDateFormatter {

    private final Logger log = LoggerFactory.getLogger(MarkupDateFormatter.class);

    public String format(String base, LocalDate date) {
        String ret = base;
        String formatted = formatFirst(base, date);
        while (!ret.equals(formatted)) {
            ret = formatted;
            formatted = formatFirst(ret, date);
        }
        return ret;
    }

    private String formatFirst(String base, LocalDate date) {
        String pattern = "<([^>]*)>";
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(base);
        String result = base;
        if (m.find()) {
            String match = m.group(1);
            log.debug("extracted group [{}]", m.group());
            String formatted = date.format(DateTimeFormatter.ofPattern(match).withLocale(Locale.US));
            String replaced = m.replaceFirst(formatted);
            result = replaced;
            log.debug("replaced string: [{}]", replaced);
        }
        return result;
    }
}


text:
package org.apache.camel.component.slack;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.camel.CamelExchangeException;
import org.apache.camel.Exchange;
import org.apache.camel.component.slack.helper.SlackMessage;
import org.apache.camel.support.DefaultProducer;
import org.apache.camel.support.ExchangeHelper;
import org.apache.camel.util.json.JsonObject;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;

public class SlackProducer extends DefaultProducer {

    private SlackEndpoint slackEndpoint;

    public SlackProducer(SlackEndpoint endpoint) {
        super(endpoint);
        this.slackEndpoint = endpoint;
    }

    @Override
    public void process(Exchange exchange) throws Exception {

        // Create an HttpClient and Post object
        HttpClient client = HttpClientBuilder.create().useSystemProperties().build();
        HttpPost httpPost = new HttpPost(slackEndpoint.getWebhookUrl());

        // Build Helper object
        SlackMessage slackMessage;
        Object payload = exchange.getIn().getBody();
        if (payload instanceof SlackMessage) {
            slackMessage = (SlackMessage) payload;
        } else {
            slackMessage = new SlackMessage();
            slackMessage.setText(exchange.getIn().getBody(String.class));
        }
        slackMessage.setChannel(slackEndpoint.getChannel());
        slackMessage.setUsername(slackEndpoint.getUsername());
        slackMessage.setIconUrl(slackEndpoint.getIconUrl());
        slackMessage.setIconEmoji(slackEndpoint.getIconEmoji());

        // use charset from exchange or fallback to the default charset
        String charset = ExchangeHelper.getCharsetName(exchange, true);

        // Set the post body
        String json = asJson(slackMessage);
        StringEntity body = new StringEntity(json, charset);

        // Do the post
        httpPost.setEntity(body);

        HttpResponse response = client.execute(httpPost);

        // 2xx is OK, anything else we regard as failure
        if (response.getStatusLine().getStatusCode() < 200 || response.getStatusLine().getStatusCode() > 299) {
            throw new CamelExchangeException("Error POSTing to Slack API: " + response.toString(), exchange);
        }
    }

    /**
     * Returns a JSON string to be posted to the Slack API
     *
     * @return JSON string
     */
    public String asJson(SlackMessage message) {
        Map<String, Object> jsonMap = new HashMap<>();

        // Put the values in a map
        jsonMap.put(SlackConstants.SLACK_TEXT_FIELD, message.getText());
        jsonMap.put(SlackConstants.SLACK_CHANNEL_FIELD, message.getChannel());
        jsonMap.put(SlackConstants.SLACK_USERNAME_FIELD, message.getUsername());
        jsonMap.put(SlackConstants.SLACK_ICON_URL_FIELD, message.getIconUrl());
        jsonMap.put(SlackConstants.SLACK_ICON_EMOJI_FIELD, message.getIconEmoji());

        List<SlackMessage.Attachment> attachments = message.getAttachments();
        if (attachments != null && !attachments.isEmpty()) {
            buildAttachmentJson(jsonMap, attachments);
        }

        // Return the string based on the JSON Object
        return new JsonObject(jsonMap).toJson();
    }

    private void buildAttachmentJson(Map<String, Object> jsonMap, List<SlackMessage.Attachment> attachments) {
        List<Map<String, Object>> attachmentsJson = new ArrayList<>(attachments.size());
        attachments.forEach(attachment -> {
            Map<String, Object> attachmentJson = new HashMap<>();
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_FALLBACK_FIELD, attachment.getFallback());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_COLOR_FIELD, attachment.getColor());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_PRETEXT_FIELD, attachment.getPretext());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_AUTHOR_NAME_FIELD, attachment.getAuthorName());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_AUTHOR_LINK_FIELD, attachment.getAuthorLink());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_AUTHOR_ICON_FIELD, attachment.getAuthorIcon());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_TITLE_FIELD, attachment.getTitle());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_TITLE_LINK_FIELD, attachment.getTitleLink());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_TEXT_FIELD, attachment.getText());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_IMAGE_URL_FIELD, attachment.getImageUrl());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_FOOTER_FIELD, attachment.getFooter());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_FOOTER_ICON_FIELD, attachment.getFooterIcon());
            attachmentJson.put(SlackConstants.SLACK_ATTACHMENT_TS_FIELD, attachment.getTs());

            List<SlackMessage.Attachment.Field> fields = attachment.getFields();
            if (fields != null && !fields.isEmpty()) {
                buildAttachmentFieldJson(attachmentJson, fields);
            }
            attachmentsJson.add(attachmentJson);
        });
        jsonMap.put(SlackConstants.SLACK_ATTACHMENTS_FIELD, attachmentsJson);
    }

    private void buildAttachmentFieldJson(Map<String, Object> attachmentJson, List<SlackMessage.Attachment.Field> fields) {
        List<Map<String, Object>> fieldsJson = new ArrayList<>(fields.size());
        fields.forEach(field -> {
            Map<String, Object> fieldJson = new HashMap<>();
            fieldJson.put("title", field.getTitle());
            fieldJson.put("value", field.getValue());
            fieldJson.put("short", field.isShortValue());
            fieldsJson.add(fieldJson);
        });
        attachmentJson.put("fields", fieldsJson);
    }
}


text:
name: I don't know where to file my issue...
about: I am a developer and I don't know which repo to file this in

---

The repos within the QIIME 2 GitHub Organization are listed below, with a brief description about the repo.

Sorted alphabetically by repo name.

- The CI automation engine that builds and distributes QIIME 2
  https://github.com/qiime2/busywork/issues

- A Concourse resource for working with conda
  https://github.com/qiime2/conda-channel-resource/issues

- Old conda recipes (repo is mostly unused now)
  https://github.com/qiime2/conda-recipes/issues

- Web app for vanity URLs for QIIME 2 data assets
  https://github.com/qiime2/data.qiime2.org/issues

- The Developer Documentation
  https://github.com/qiime2/dev-docs/issues

- A discourse plugin for handling queued/unqueued topics
  https://github.com/qiime2/discourse-unhandled-tagger/issues

- The User Documentation
  https://github.com/qiime2/docs/issues

- Rendered QIIME 2 environment files for conda
  https://github.com/qiime2/environment-files/issues

- Google Sheets Add-On for validating tabular data
  https://github.com/qiime2/Keemei/issues

- A docker image for linux-based busywork workers
  https://github.com/qiime2/linux-worker-docker/issues

- Official project logos
  https://github.com/qiime2/logos/issues

- The q2-alignment plugin
  https://github.com/qiime2/q2-alignment/issues

- The q2-composition plugin
  https://github.com/qiime2/q2-composition/issues

- The q2-cutadapt plugin
  https://github.com/qiime2/q2-cutadapt/issues

- The q2-dada2 plugin
  https://github.com/qiime2/q2-dada2/issues

- The q2-deblur plugin
  https://github.com/qiime2/q2-deblur/issues

- The q2-demux plugin
  https://github.com/qiime2/q2-demux/issues

- The q2-diversity plugin
  https://github.com/qiime2/q2-diversity/issues

- The q2-emperor plugin
  https://github.com/qiime2/q2-emperor/issues

- The q2-feature-classifier plugin
  https://github.com/qiime2/q2-feature-classifier/issues

- The q2-feature-table plugin
  https://github.com/qiime2/q2-feature-table/issues

- The q2-fragment-insertion plugin
  https://github.com/qiime2/q2-fragment-insertion/issues

- The q2-gneiss plugin
  https://github.com/qiime2/q2-gneiss/issues

- The q2-longitudinal plugin
  https://github.com/qiime2/q2-longitudinal/issues

- The q2-metadata plugin
  https://github.com/qiime2/q2-metadata/issues

- The q2-phylogeny plugin
  https://github.com/qiime2/q2-phylogeny/issues

- The q2-quality-control plugin
  https://github.com/qiime2/q2-quality-control/issues

- The q2-quality-filter plugin
  https://github.com/qiime2/q2-quality-filter/issues

- The q2-sample-classifier plugin
  https://github.com/qiime2/q2-sample-classifier/issues

- The q2-taxa plugin
  https://github.com/qiime2/q2-taxa/issues

- The q2-types plugin
  https://github.com/qiime2/q2-types/issues

- The q2-vsearch plugin
  https://github.com/qiime2/q2-vsearch/issues

- The CLI interface
  https://github.com/qiime2/q2cli/issues

- The prototype CWL interface
  https://github.com/qiime2/q2cwl/issues

- The prototype Galaxy interface
  https://github.com/qiime2/q2galaxy/issues

- An internal tool for ensuring header text and copyrights are present
  https://github.com/qiime2/q2lint/issues

- The prototype GUI interface
  https://github.com/qiime2/q2studio/issues

- A base template for use in official QIIME 2 plugins
  https://github.com/qiime2/q2templates/issues

- The read-only web interface at view.qiime2.org
  https://github.com/qiime2/q2view/issues

- The QIIME 2 homepage at qiime2.org
  https://github.com/qiime2/qiime2.github.io/issues

- The QIIME 2 framework
  https://github.com/qiime2/qiime2/issues

- Centralized templates for repo assets
  https://github.com/qiime2/template-repo/issues

- Scripts for building QIIME 2 VMs
  https://github.com/qiime2/vm-playbooks/issues

- Scripts for building QIIME 2 workshop clusters
  https://github.com/qiime2/workshop-playbooks/issues

- The web app that runs workshops.qiime2.org
  https://github.com/qiime2/workshops.qiime2.org/issues


text:
/* Supply an architecture specific value for PAGE_SIZE and friends.  */

#ifndef _UCLIBC_PAGE_H
#define _UCLIBC_PAGE_H

/* PAGE_SHIFT determines the page size -- in this case 4096 */
#define PAGE_SHIFT	12
#define PAGE_SIZE	(1UL << PAGE_SHIFT)
#define PAGE_MASK	(~(PAGE_SIZE-1))

#endif /* _UCLIBC_PAGE_H */