text:
<?php

include_once $_SERVER['DOCUMENT_ROOT'].'/includes/change_password.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/includes/functions.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/includes/FormsManager.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/includes/db_connect_member.php';

//secureSessionStart(); // call to functions.php secure session.
$logged = checkIfLoggedIn($db);
?>
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="description" content="BASIS Olympic College"/>
    <title>b[squared] Change Password</title>
    <link rel="stylesheet" href="../css/styles.css" />
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

    <?php
    getMemberNavigation($db, $logged);
    ?>

    <?php if (loginCheckMember($db) == true) : ?>
    <?php

        $type   = "member";
        $table  = "portfolio_members";
        $username = htmlentities($_SESSION['username']);
        $email = getEmail($db, $username, $table);
    ?>

<?php echo $username; ?>!

    <?php
    FormsManager::getChangePasswordForm($type, $email);
    if (!empty($error_msg))
    {
        echo $error_msg;
    }
    ?>
    <?php else : ?>

            You are not authorized to access this page. Please login.

    <?php endif; ?>
    <?php
    getFooter();
    ?>


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.

#nullable disable

using System.Threading;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Structure;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.CSharp.Structure
{
    internal class DisabledTextTriviaStructureProvider : AbstractSyntaxTriviaStructureProvider
    {
        public override void CollectBlockSpans(
            SyntaxTrivia trivia,
            ArrayBuilder<BlockSpan> spans,
            BlockStructureOptionProvider optionProvider,
            CancellationToken cancellationToken)
        {
            CollectBlockSpans(trivia.SyntaxTree, trivia, spans, cancellationToken);
        }

        public static void CollectBlockSpans(
            SyntaxTree syntaxTree, SyntaxTrivia trivia,
            ArrayBuilder<BlockSpan> spans, CancellationToken cancellationToken)
        {
            // We'll always be leading trivia of some token.
            var startPos = trivia.FullSpan.Start;

            var parentTriviaList = trivia.Token.LeadingTrivia;
            var indexInParent = parentTriviaList.IndexOf(trivia);

            // Note: in some error cases (for example when all future tokens end up being skipped)
            // the parser may end up attaching pre-processor directives as trailing trivia to a
            // preceding token.
            if (indexInParent < 0)
            {
                parentTriviaList = trivia.Token.TrailingTrivia;
                indexInParent = parentTriviaList.IndexOf(trivia);
            }

            if (indexInParent <= 0)
            {
                return;
            }

            if (!parentTriviaList[indexInParent - 1].IsKind(SyntaxKind.IfDirectiveTrivia) &&
                !parentTriviaList[indexInParent - 1].IsKind(SyntaxKind.ElifDirectiveTrivia) &&
                !parentTriviaList[indexInParent - 1].IsKind(SyntaxKind.ElseDirectiveTrivia))
            {
                return;
            }

            var endTrivia = GetCorrespondingEndTrivia(trivia, parentTriviaList, indexInParent);
            var endPos = GetEndPositionExludingLastNewLine(syntaxTree, endTrivia, cancellationToken);

            var span = TextSpan.FromBounds(startPos, endPos);
            spans.Add(new BlockSpan(
                isCollapsible: true,
                textSpan: span,
                type: BlockTypes.PreprocessorRegion,
                bannerText: CSharpStructureHelpers.Ellipsis,
                autoCollapse: true));
        }

        private static int GetEndPositionExludingLastNewLine(SyntaxTree syntaxTree, SyntaxTrivia trivia, CancellationToken cancellationToken)
        {
            var endPos = trivia.FullSpan.End;
            var text = syntaxTree.GetText(cancellationToken);
            return endPos >= 2 && text[endPos - 1] == '\n' && text[endPos - 2] == '\r' ? endPos - 2 :
                   endPos >= 1 && SyntaxFacts.IsNewLine(text[endPos - 1]) ? endPos - 1 : endPos;
        }

        private static SyntaxTrivia GetCorrespondingEndTrivia(
            SyntaxTrivia trivia, SyntaxTriviaList triviaList, int index)
        {
            // Look through our parent token's trivia, to extend the span to the end of the last
            // disabled trivia.
            //
            // The issue is that if there are other pre-processor directives (like #regions or
            // #lines) mixed in the disabled code, they will be interleaved.  Keep walking past
            // them to the next thing that will actually end a disabled block. When we encounter
            // one, we must also consider which opening block they end. In case of nested pre-processor
            // directives, the inner most end block should match the inner most open block and so on.

            var nestedIfDirectiveTrivia = 0;
            for (var i = index; i < triviaList.Count; i++)
            {
                var currentTrivia = triviaList[i];
                switch (currentTrivia.Kind())
                {
                    case SyntaxKind.IfDirectiveTrivia:
                        // Hit a nested #if directive.  Keep track of this so we can ensure
                        // that our actual disabled region reached the right end point.
                        nestedIfDirectiveTrivia++;
                        continue;

                    case SyntaxKind.EndIfDirectiveTrivia:
                        if (nestedIfDirectiveTrivia > 0)
                        {
                            // This #endif corresponded to a nested #if, pop our stack
                            // and keep searching.
                            nestedIfDirectiveTrivia--;
                            continue;
                        }

                        // Found an #endif corresponding to our original #if/#elif/#else region we
                        // started with. Mark up to the trivia before this as the range to collapse.
                        return triviaList[i - 1];

                    case SyntaxKind.ElseDirectiveTrivia:
                    case SyntaxKind.ElifDirectiveTrivia:
                        if (nestedIfDirectiveTrivia > 0)
                        {
                            // This #else/#elif corresponded to a nested #if, ignore as
                            // they're not relevant to the original construct we started
                            // on.
                            continue;
                        }

                        // We found the next #else/#elif corresponding to our original #if/#elif/#else
                        // region we started with. Mark up to the trivia before this as the range
                        // to collapse.
                        return triviaList[i - 1];
                }
            }

            // Couldn't find a future trivia to collapse up to.  Just collapse the original
            // disabled text trivia we started with.
            return trivia;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
"""
@author: nimiq
@year: 2010
"""

import os
import sys
import numpy
import cv2 as cv
from PIL import Image, ImageOps, ImageDraw
from scipy.ndimage import morphology
from scipy.ndimage.measurements import label
from scipy.misc import imsave

"""
Creare le cartelle:
C:\\workspace\\smartcrop\\test\\grigenew
C:\\workspace\\smartcrop\\test\\finenew
Mettere le immagini (gia convertite in scala di grigi) in grigenew

TODO: si potrebbe aggoingere il deskew (raddrizzamente) in fase di preprocessing,
Non so bene come farlo in Python (bisogna usare opencv)
L'ho cercato in internet e l'unica cosa che ho trovato sono qs link in C++:
http://felix.abecassis.me/2011/09/opencv-detect-skew-angle/
http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/
L'avevo fatto in Java così: vedi cartella TODO Come fare il deskew in Java

TODO: si potrebbero implementare dei miglioramenti sull'immagine come aumento del contrasto e maschera di contrasto) anche
Si possono fare ste cose con Python e OpenCV qui, ma non so bene come
Oppure si puo usare Imagemagick, vedi: Imagemagick.txt nella cartella FOTOEDITING, VIDEOEDITING
"""

PROJECT_FOLDER = os.path.abspath(os.path.dirname("C:\\workspace\\smartcrop\\test\\").decode("utf-8"))
GRAY_FOLDER = os.path.join(PROJECT_FOLDER, 'grigenew')
END_FOLDER = os.path.join(PROJECT_FOLDER, 'finenew')

SAVE_INTERMEDIATE_STEPS = False
DO_NOT_CROP_BUT_BOUND = False

def smart_crop(in_path, out_path):
    img_orig = Image.open(in_path)
    img = ImageOps.grayscale(img_orig)
    im = numpy.array(img, dtype=numpy.uint8)

    # Preprocessing the image
    im = pre_process_image(img, in_path)
    #im = pre_process_image(im)

    # Statistical analysis
    col_sum = numpy.sum(im, axis=0)
    row_sum = numpy.sum(im, axis=1)
    col_mean, col_std = col_sum.mean(), col_sum.std()
    row_mean, row_std = row_sum.mean(), row_sum.std()

    row_standard = (row_sum - row_mean) / row_std
    col_standard = (col_sum - col_mean) / col_std

    def end_points(s, std_below_mean=-1.5):
        i, j = 0, len(s) - 1
        for i, rs in enumerate(s):
            if rs > std_below_mean:
                break
        for j in xrange(len(s) - 1, i, -1):
            if s[j] > std_below_mean:
                break
        return (i, j)

    # Bounding rectangle
    x1, x2 = end_points(col_standard)
    y1, y2 = end_points(row_standard)

    if not DO_NOT_CROP_BUT_BOUND:
        # Crop
        result = img.crop((x1, y1, x2, y2))
    else:
        # Bound
        result = img.convert('RGB')
        draw = ImageDraw.Draw(result)
        draw.line((x1, y1, x2, y1, x2, y2, x1, y2, x1, y1),
                fill=(0, 255, 255), width=15)

    # Save the final image
    result.save(out_path)

def pre_process_image(img, path=None):
    if path: file_name, file_ext = os.path.splitext(os.path.basename(path))

    # MORPHOLOGY CLOSING
    # http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.morphology.grey_closing.html#scipy.ndimage.morphology.grey_closing
    # http://en.wikipedia.org/wiki/Mathematical_morphology
    #
    # Cancellare ogni lettera e imperfezione
    # Parametri: qui uso il metodo nella sua forma base dove il secondo parametro e' un rettangolo (altezza, larghezza)
    # Secondo me teoricamente dovrei matchare la dimesnione media di una parola (una lettera e' troppo piccolo, una riga e' troppo grande)
    #
    #orig#im = morphology.grey_closing(img, (1, 101))
    im = morphology.grey_closing(img, (15, 105)) #odd numbers are better
    if path and SAVE_INTERMEDIATE_STEPS: imsave(os.path.join(END_FOLDER, '%s_step1%s' % (file_name, file_ext)), im)

    # OTSU THRESHOLDING (statistically optimal)
    # http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#threshold
    # http://en.wikipedia.org/wiki/Otsu%27s_Method
    #
    # Trasformare l'immagine in due colori: nero per lo sfondo, bianco per il primo piano
    # Parametri: 0, 1 (valore per sfondo e primo piano) in produzione
    # 0, 255 se volgio vedere l'immagine in bianco e nero per debug
    #
    #orig#t, im = cv.threshold(im, 0, 1, cv.THRESH_OTSU)
    t, im = cv.threshold(im, 0, 255, cv.THRESH_OTSU)
    if path and SAVE_INTERMEDIATE_STEPS: imsave(os.path.join(END_FOLDER, '%s_step2%s' % (file_name, file_ext)), im)

    # MORPHOLOGY OPENING
    # http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.morphology.grey_opening.html#scipy.ndimage.morphology.grey_opening
    # http://en.wikipedia.org/wiki/Mathematical_morphology
    #
    # Cancellare i sottili bordi bianchi
    # Parametri: qui uso il metodo nella sua forma base dove il secondo parametro e' un rettangolo (altezza, larghezza)
    # Le dimensioni del rettangolo sono un quadrato di lato = dimesnione minima delpiu grosso extra bordo bianco
    #
    #origl# im = morphology.grey_opening(im, (51, 51))
    im = morphology.grey_opening(im, (51, 51)) #odd numbers are better
    if path and SAVE_INTERMEDIATE_STEPS: imsave(os.path.join(END_FOLDER, '%s_step3%s' % (file_name, file_ext)), im)

    # CONNECTED-COMPONENT LABELING
    # http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.measurements.label.html#scipy.ndimage.measurements.label
    # http://en.wikipedia.org/wiki/Connected-component_labeling
    #
    # Divido l'immagine (che ora e' teoricamente pulita di tutto il testo) in sotto immagini
    # Mantengo solo la sotto immagine piu grossa perche' dovrebbe essere la pagina (il resto lo coloro di nero)
    #
    # Il risultato puo essere:
    #  1 sotto img: caso perfetto, la sotto immagine e' il foglio (il resto e' lo sfondo che non conta, cioe' il bordo nero)
    #  2, 3, 4, 5 img: probabilmente c'e' un extra bordo bianco di disturbo su 1,2,3 o 4 lati
    #  6+ img: la pagina contiene delle immagini grosso che sono state suddivise
    #
    # Label divide l'immagine in sottoimmagini e assegna un numero ad ogni pixel (0 e' lo sfondo)
    # Tutti i pixel che hanno lo stesso numero fanno parte della stessa sotto immagine
    #
    # Restituisce:
    #  una matrice di dimensione uguale all'immagine sorgente dove ogni pixel ha un label
    #  il numero di sotto immagini identificate
    #
    lbl, ncc = label(im)
    # Identifico la sotto immagine piu grossa
    largest = 0, 0
    for i in range(1, ncc + 1):
        size = len(numpy.where(lbl == i)[0]) #counts how many times the value i is present in the lbl array
        if size > largest[1]:
            largest = i, size
    # Imposto il colore 0 a tutte le sottoimmagini tranne quell apiu grossa
    for i in range(1, ncc + 1):
        if i == largest[0]:
            continue
        im[lbl == i] = 0
        #Se volessi colorare le sotto immagini in scala di grigi
        #import math##
        #im[lbl == i] = math.floor(255/ncc-1)*ncc
    if path and SAVE_INTERMEDIATE_STEPS: imsave(os.path.join(END_FOLDER, '%s_step4%s' % (file_name, file_ext)), im)###################
    return im

if __name__ == "__main__":
    #Creating the END_FOLDER
    os.chdir(PROJECT_FOLDER)
    if not os.path.exists(END_FOLDER): os.makedirs(END_FOLDER)

    folder = os.listdir(GRAY_FOLDER)
    for file in folder:
        print "Processando %s..." % file,
        if not os.path.isfile(os.path.join(GRAY_FOLDER, file)):
            continue
        filein = os.path.join(GRAY_FOLDER, file)
        fileout = os.path.join(END_FOLDER, file)
        smart_crop(filein, fileout)
        print "fine."


text:
===============================
Flask Demo App
===============================

Quickstart
----------

First, set your app's secret key as an environment variable: ::

    export FLASKDEMO_SECRET = 'something-really-secret'

Then run the following commands to bootstrap your environment. ::

    pip install -r requirements/dev.txt
    python manage.py db init
    python manage.py db migrate
    python manage.py db upgrade
    python manage.py server

Deployment
----------

In your production environment, make sure the ``FLASKDEMO_ENV`` environment variable is set to ``"prod"``.

Shell
-----

To open the interactive shell, run ::

    python manage.py shell

By default, you will have access to ``app``, ``db``, and the ``User`` model.

Running Tests
-------------

To run all tests, run ::

    python manage.py test

Migrations
----------

Make edits, then generate a migration script:
::

    python manage.py db migrate

Youe changes are often automatically picked up in the migration file, but not always. MANUALLY REVIEW/EDIT THIS FILE, then apply the migration:
::

    python manage.py db upgrade

For a full migration command reference, run ``python manage.py db --help``.


text:
(function(angular) {
	'use strict';

	angular.module('mllApp.home')
	.controller('BandProfileController', BandProfileController);

	BandProfileController.$inject = [ 'userId', '$scope', 'musicianUrl', '$http' ];

	function BandProfileController(userId, $scope) {
		this.userId = userId;
	}
})(window.angular);


text:
import {DepSigleNameItem} from './depsiglename';
import {IMatiere} from 'infodata';
import {InfoRoot} from '../utils/inforoot';
import {MATIERE_TYPE, MATIERE_PREFIX} from '../utils/infoconstants';
//
export class Matiere extends DepSigleNameItem implements IMatiere {
    //
    private _uniteid: string = null;
    private _genre: string = null;
    private _mat_module: string = null;
    private _coef: number = null;
    private _ecs: number = null;
    //
    constructor(oMap?: any) {
        super(oMap);
        if ((oMap != undefined) && (oMap != null)) {
            if (oMap.uniteid != undefined) {
                this.uniteid = oMap.uniteid;
            }
            if (oMap.coefficient != undefined) {
                this.coefficient = oMap.coefficient;
            }
            if (oMap.ecs != undefined) {
                this.ecs = oMap.ecs;
            }
            if (oMap.genre != undefined) {
                this.genre = oMap.genre;
            }
            if (oMap.mat_module != undefined) {
                this.mat_module = oMap.mat_module;
            }
        }// oMap
    } // constructor
    public get uniteid(): string {
        return this._uniteid;
    }
    public set uniteid(s: string) {
        this._uniteid =InfoRoot.check_string(s);
    }
    public get genre(): string {
        return this._genre;
    }
    public set genre(s: string) {
        this._genre = InfoRoot.check_upper_string(s);
    }
    public get mat_module(): string {
        return this._mat_module;
    }
    public set mat_module(s: string) {
        this._mat_module = InfoRoot.check_upper_string(s);
    }
    public base_prefix(): string {
        return MATIERE_PREFIX;
    }
    public type(): string {
        return MATIERE_TYPE;
    }
    public start_key(): string {
        let s = this.base_prefix();
        if ((s !== null) && (this.uniteid !== null)) {
            s = s + '-' + this.uniteid;
        }
        return s;
    }
    public get ecs(): number {
        return this._ecs;
    }
    public set ecs(d: number) {
        let v = InfoRoot.check_number(d);
        if ((v != undefined) && (v != null) && (v > 0)) {
            this._ecs = v;
        } else {
            this._ecs = null;
        }
    }
    public get coefficient(): number {
        return this._coef;
    }
    public set coefficient(d: number) {
        let v = InfoRoot.check_number(d);
        if ((v != undefined) && (v != null) && (v > 0)) {
            this._coef = v;
        } else {
            this._coef = null;
        }
    }
    public is_storeable(): boolean {
        return super.is_storeable() && (this.uniteid !== null);
    }
    public to_map(oMap: any): void {
        super.to_map(oMap);
        if (this.uniteid !== null) {
            oMap.uniteid = this.uniteid;
        }
        if (this.genre !== null) {
            oMap.genre = this.genre;
        }
        if (this.mat_module !== null) {
            oMap.mat_module = this.mat_module;
        }
        if (this.coefficient !== null) {
            oMap.coefficient = this.coefficient;
        }
        if (this.ecs !== null) {
            oMap.ecs = this.ecs;
        }
    }// to_insert_map
} // class Unite


text:
package org.deidentifier.arx.criteria;

import org.deidentifier.arx.framework.data.DataManager;

/**
 * A privacy criterion that is explicitly bound to a sensitive attribute.
 *
 * @author Fabian Prasser
 * @author Florian Kohlmayer
 */
public abstract class ExplicitPrivacyCriterion extends PrivacyCriterion {

    /** SVUID */
    private static final long serialVersionUID = -6467044039242481225L;

    /**  Attribute */
    protected final String attribute;

    /**  Attribute index */
    protected int index = -1;

    /**
     * Creates a new instance
     *
     * @param attribute
     * @param monotonic
     */
    public ExplicitPrivacyCriterion(String attribute, boolean monotonic) {
        super(monotonic);
        this.attribute = attribute;
    }

    /**
     * Returns the associated sensitive attribute.
     *
     * @return
     */
    public String getAttribute() {
        return attribute;
    }

    @Override
    public void initialize(DataManager manager) {
        String[] header = manager.getDataSE().getHeader();
        for (int i=0; i< header.length; i++){
            if (header[i].equals(attribute)) {
                index = i;
                break;
            }
        }
    }
}


text:
const itunes = require('../common/itunes')

exports.search = function(req, res) {
  itunes.search(
    {
      term: req.query.q,
      media: 'music',
      entity: 'album,musicArtist,song',
      limit: req.query.limit || 10
    },
    res
  )
}

exports.searchByAlbum = function(req, res) {
  itunes.search(
    {
      term: req.query.q,
      entity: 'album',
      media: 'music',
      attribute: 'albumTerm',
      limit: req.query.limit || 10
    },
    res
  )
}

exports.searchByArtist = function(req, res) {
  itunes.search(
    {
      term: req.query.q,
      entity: 'musicArtist',
      attribute: 'artistTerm',
      media: 'music',
      limit: req.query.limit || 10
    },
    res
  )
}

exports.searchByTrack = function(req, res) {
  itunes.search(
    {
      term: req.query.q,
      entity: 'song',
      media: 'music',
      attribute: 'songTerm',
      limit: req.query.limit || 10
    },
    res
  )
}


text:
package org.dashbuilder.scheduler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.dashbuilder.config.Config;
import org.slf4j.Logger;

/**
 * Task scheduler component.
 *
It uses internally an instance of java.util.concurrent.ScheduledThreadPoolExecutor
 * which provides a thread pool and the delayed task execution capability.

 */
@ApplicationScoped
public class Scheduler {

    @Inject
    private Logger log;

    protected PausableThreadPoolExecutor executor;
    protected ThreadFactory threadFactory;
    protected Map<Object, SchedulerTask> scheduledTasks;

    @Inject @Config("10")
    protected int maxThreadPoolSize;

    @PostConstruct
    public void init() {
        scheduledTasks = Collections.synchronizedMap(new HashMap<Object,SchedulerTask>());
        threadFactory = new SchedulerThreadFactory();
        executor = new PausableThreadPoolExecutor(maxThreadPoolSize, threadFactory);
        executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
        executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
        log.debug("Scheduler started [pool size=" + maxThreadPoolSize + "].");
    }

    @PreDestroy
    public void shutdown() {
        log.debug("Scheduler shutdown started.");
        executor.shutdown();
        log.debug("Scheduler shutdown completed.");
    }

    public int getMaxThreadPoolSize() {
        return maxThreadPoolSize;
    }

    public void setMaxThreadPoolSize(int maxThreadPoolSize) {
        this.maxThreadPoolSize = maxThreadPoolSize;
        if (executor != null) executor.setCorePoolSize(maxThreadPoolSize);
    }

    public int getThreadPoolSize() {
        return executor.getPoolSize();
    }

    public ThreadFactory getThreadFactory() {
        return threadFactory;
    }

    public void setThreadFactory(ThreadFactory threadFactory) {
        this.threadFactory = threadFactory;
    }

    public int getNumberOfScheduledTasks() {
        return scheduledTasks.size();
    }

    public int getNumberOfScheduledTasksInQueue() {
        return executor.getQueue().size();
    }

    public List<SchedulerTask> getScheduledTasks() {
        return new ArrayList<SchedulerTask>(scheduledTasks.values());
    }

    public List<SchedulerTask> getRunningTasks() {
        List<SchedulerTask> result = new ArrayList<SchedulerTask>();
        for (SchedulerTask task : scheduledTasks.values()) {
            if (task.isRunning()) result.add(task);
        }
        return result;
    }

    public List<SchedulerTask> getMisfiredTasks() {
        List<SchedulerTask> result = new ArrayList<SchedulerTask>();
        for (SchedulerTask task : scheduledTasks.values()) {
            if (task.isMisfired()) result.add(task);
        }
        return result;
    }

    public List<SchedulerTask> getWaitingTasks() {
        List<SchedulerTask> result = new ArrayList<SchedulerTask>();
        for (SchedulerTask task : scheduledTasks.values()) {
            if (!task.isDone() && !task.isRunning() && !task.isMisfired()) result.add(task);
        }
        return result;
    }

    // Transactional operations

    public void pause() {
        executor.pause();
    }

    public void resume() {
        executor.resume();
    }

    public boolean isPaused() {
        return executor.isPaused();
    }

    public synchronized void execute(SchedulerTask task) {
        try {
            _schedule(task, null);
        } catch (Exception e) {
            log.error("Execute call failed for task: " + task.getKey(), e);
        }
    }

    public synchronized void schedule(SchedulerTask task, Date date) {
        try {
            _schedule(task, date);
        } catch (Exception e) {
            log.error("Schedule call failed for task: " + task.getKey(), e);
        }
    }

    public synchronized void schedule(SchedulerTask task, long seconds) {
        try {
            _schedule(task, seconds);
        } catch (Exception e) {
            log.error("Schedule call failed for task: " + task.getKey(), e);
        }
    }

    public synchronized void unschedule(final String key) {
        try {
            _unschedule(key);
        } catch (Exception e) {
            log.error("Unschedule call failed for task: " + key, e);
        }
    }

    public synchronized void unscheduleAll() {
        try {
            _unscheduleAll();
        } catch (Exception e) {
            log.error("Unschedule all call failed.", e);
        }
    }

    public synchronized void fireTask(String key) {
        SchedulerTask task = scheduledTasks.get(key);
        if (task != null && !task.isDone() && !task.isRunning()) {
            try {
                task.run();
                log.debug("Task " + task + " executed.");
            } finally {
                scheduledTasks.remove(key);
                task.cancel();
                _purge();

                // Re-schedule fixed delay (repetitive) tasks after issue a fire.
                if (task.isFixedDelay()) {
                    schedule(task, task.getFixedDelaySeconds());
                }
            }
        }
    }

    // Scheduler business logic

    protected void _schedule(SchedulerTask task, Date date) {
        // Calculate the delay.
        // Never use a delay=0 in order to force the task to be launched in a separated thread.
        long delay = 10000;
        if (date != null) {
            Date now = new Date();
            delay = date.getTime() - now.getTime();
            if (delay <= 0) throw new IllegalArgumentException("Delay is negative. The task can not be scheduled [" + task.toString() + "] Date=" + date);
        }

        // Remove any old task (if any)
        _unschedule(task.getKey());

        // Register the new task.
        task.future = executor.schedule(task, delay, TimeUnit.MILLISECONDS);
        scheduledTasks.put(task.getKey(), task);
        if (date == null) log.debug("Task " + task + " execution requested.");
        else log.debug("Task " + task + " scheduled to: " + date);
    }

    protected void _schedule(SchedulerTask task, long seconds) {
        // Remove any old task (if any)
        _unschedule(task.getKey());

        // Register the new task.
        task.fixedDelay = true;
        task.fixedDelaySeconds = seconds;
        task.future = executor.scheduleWithFixedDelay(task, seconds, seconds, TimeUnit.SECONDS);
        scheduledTasks.put(task.getKey(), task);
        log.debug("Task " + task + " scheduled every " + seconds + " seconds.");
    }

    protected void _unschedule(String key) {
        SchedulerTask task = scheduledTasks.remove(key);
        if (task != null && !task.isDone() && !task.isRunning()) {
            task.cancel();
            _purge();
            log.debug("Task " + task + " unscheduled.");
        }
    }

    public void _unscheduleAll() {
        Collection<SchedulerTask> tasks = scheduledTasks.values();
        for (SchedulerTask task : tasks) {
            if (task != null && !task.isDone() && !task.isRunning()) {
                task.cancel();
            }
        }
        executor.purge();
        scheduledTasks.clear();
        log.debug("All tasks unscheduled.");
    }

    protected void _purge() {
        executor.purge();
        Iterator<SchedulerTask> it = scheduledTasks.values().iterator();
        while (it.hasNext()) {
            SchedulerTask task = it.next();
            if (task.isDone()) {
                it.remove();
                log.debug("Task " + task + " purged.");
            }
        }
    }

    public String printScheduledTasksReport() {
        Map<Object, SchedulerTask> temp = new HashMap<Object, SchedulerTask>(scheduledTasks);
        StringBuilder buf = new StringBuilder();
        buf.append("\n\n------------------ SCHEDULED TASKS=").append(temp.size())
                .append(" (Queue size=").append(executor.getQueue().size()).append(") -----------------------------\n");
        for (Map.Entry<Object, SchedulerTask> entry : temp.entrySet()) {
            SchedulerTask task = entry.getValue();
            buf.append("\n");
            if (task.isRunning()) buf.append("RUNNING - ");
            else if (task.isCancelled()) buf.append("CANCELL - ");
            else if (task.isDone()) buf.append("COMPLTD - ");
            else buf.append("WAITING - [Firing in ").append(task.printTimeToFire()).append("] - ");
            buf.append("[").append(task).append("]");
        }
        return buf.toString();
    }
}


text:
"""
Karl Persson, Mac OSX 10.8.4/Windows 8, Python 2.7.5, Pygame 1.9.2pre

Main class for Pulse game
"""

import sys
import pygame
from pygame.locals import *

import Explosion, FileManager, GameObjects, HUD, LevelManager, Menues

# The main class of Pulse
class PulseGame:
    def __init__(self):
        pygame.init()

        # Initializing file manager and loading icon
        self.fileManager = FileManager.FileManager('Textures', 'Sounds')

        # Display properties
        pygame.display.set_icon(self.fileManager.icon)
        self.screen = pygame.display.set_mode((800, 600))
        pygame.display.set_caption('Pulse')

        # Setting background
        self.fileManager.loadBackground()
        self.background = self.fileManager.backgroundTexture
        # Display update
        self.cleanWindow()
        pygame.display.flip()

        # Initializing game files
        self.fileManager.loadGameFiles()
        # Initializing game objects
        self.gameObjects = GameObjects.GameObjects()
        # Initializing level manager
        self.levelManager = LevelManager.LevelManager(self.fileManager, self.gameObjects)
        # Initializing menues
        self.menues = Menues.Menues(self.fileManager, self.levelManager)

        # Initializing HUD
        self.HUD = pygame.sprite.RenderPlain()
        self.HUDObject = HUD.HUD(self.levelManager.currentLevel(), True)
        self.HUD.add(self.HUDObject)

        # Adding notifieras to gameObjects
        self.gameObjects.addNotifier(self.HUDObject)
        self.gameObjects.addNotifier(self.levelManager)

        # Initializing clock
        self.clock = pygame.time.Clock()

        # Game running. Showing nenu on False.
        self.gameRunning = False

        # Starting music
        pygame.mixer.music.play(-1)

        # Showing main menu
        self.menues.main()

    # Rendering and updating game (fill old elements with background, update elements, draw new elements)
    def render(self):
        # Adding rects to update on screen
        rects = []

        # Erasing previous balls
        # (Blitting to screen and saving rect-copies for updating)
        for sprite in self.gameObjects.allSprites:
            self.screen.blit(self.background, sprite.rect.topleft, sprite.rect)
            rects.append(sprite.rect.copy())
        # Erasing HUD
        self.screen.blit(self.background, self.HUDObject.rect.topleft, self.HUDObject.rect)
        rects.append(self.HUDObject.rect.copy())
        # Erasing menues
        for rect in self.menues.getRects():
            self.screen.blit(self.background, rect.topleft, rect)
            rects.append(rect.copy())

        # Updating stuff
        self.update()

        # Rendering
        # Sprites
        self.gameObjects.render(self.screen)
        for sprite in self.gameObjects.allSprites:
            rects.append(sprite.rect)
        # HUD
        self.HUD.draw(self.screen)
        rects.append(self.HUDObject.rect)
        # Menu
        self.menues.render(self.screen)
        for rect in self.menues.getRects():
            rects.append(rect)

        # Updating specific rects on screen, for better framerate
        pygame.display.update(rects)

    # Updating game
    def update(self):
        # Updating game objects, HUD, menues etc.
        self.gameObjects.update()
        self.HUD.update()
        self.menues.update(pygame.mouse.get_pos())

        # Checking game status
        if self.levelManager.playerWon():
            self.gameRunning = False
            # opening menu if it's not already open
            if not self.menues.menuActive():
                # Checking if it's the last level
                if self.levelManager.lastLevel():
                    self.menues.gameWon()
                else:
                    self.menues.levelWon()
        elif self.levelManager.playerLost():
            self.gameRunning = False
            # Opening menu if it's not already open
            if not self.menues.menuActive():
                self.menues.levelLost()
        else:
            # If the game was previously not running hud and background will be reset
            if not self.gameRunning:
                #self.cleanWindow()
                self.HUDObject.setLevel(self.levelManager.currentLevel())
                # Making sure HUD isn't hidden
                self.HUDObject.show()
            self.gameRunning = True

    # Cleaning window (blitting background)
    def cleanWindow(self):
        self.screen.blit(self.background, (0,0))

if __name__ == '__main__':
    game = PulseGame()

    # Game loop
    while True:
        # 60Hz framerate
        game.clock.tick(60)
        game.render()
        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()
            elif event.type == MOUSEBUTTONDOWN and event.button == 1:
                if game.gameRunning:
                    # Only creating a pulse when the number of pulses left i sufficient
                    if game.levelManager.pulses > 0:
                        # Creating explosion
                        game.gameObjects.addEntity(Explosion.Explosion(game.fileManager, game.levelManager.currentLevel().scale, pygame.mouse.get_pos()))
                        game.gameObjects.updateNotifierPulses(-1)
                        game.fileManager.playPulse()
                else:
                    # Checking menu mouse over (gameRunning False means menu!)
                    game.menues.mouseClicked(pygame.mouse.get_pos())


text:
import net.runelite.mapping.ObfuscatedName;

@ObfuscatedName("hv")
public abstract class class224 extends CacheableNode {
   @ObfuscatedName("k")
   final int field2669;

   class224(int var1) {
      this.field2669 = var1;
   }

   @ObfuscatedName("o")
   abstract Object vmethod4084();

   @ObfuscatedName("k")
   abstract boolean vmethod4087();
}


text:
<?php

namespace SocioChat\DAO;

use Core\DAO\DAOBase;
use Core\Utils\DbQueryHelper;

class UserNotesDAO extends DAOBase
{
    const NOTED_ID = 'noted_user_id';
    const USER_ID = 'user_id';
    const NOTE = 'note';

    private $notes;

    public function __construct()
    {
        parent::__construct(
            [
                self::USER_ID,
                self::NOTED_ID,
                self::NOTE,
            ]
        );

        $this->dbTable = 'user_notes';
    }

    public function getByUserId($userId)
    {
	    $this->db->o()->query("SET TRANSACTION ISOLATION LEVEL READ COMMITTED");
	    $this->db->o()->beginTransaction();

        $list = $this->db->query(
	        "SELECT " . self::NOTED_ID . ", " . self::NOTE . " FROM {$this->dbTable} WHERE " . self::USER_ID . " = :0",
            [$userId]);
	    $this->db->o()->commit();
        $keys = array_column($list, self::NOTED_ID);
        $vals = array_column($list, self::NOTE);
        $this->notes = array_combine($keys, $vals);

        $this[self::USER_ID] = $userId;

        return $this;
    }

    public function getUserId()
    {
        return $this[self::USER_ID];
    }

    public function setUserId($id)
    {
        $this[self::USER_ID] = $id;
        return $this;
    }

    public function getNotedUserId()
    {
        return $this[self::NOTED_ID];
    }

    public function setNotedUserId($id)
    {
        $this[self::NOTED_ID] = $id;
        return $this;
    }

    public function getNote($userId)
    {
        return $this->hasNote($userId) ? $this->notes[$userId] : null;
    }

    public function setNote($note)
    {
        $this[self::NOTE] = $note;

        if ($note) {
            $this->notes[$this->getNotedUserId()] = $note;
        } else {
            unset($this->notes[$this->getNotedUserId()]);
        }

        return $this;
    }

    public function hasNote($userId)
    {
        return isset($this->notes[$userId]);
    }

    public function dropByUserId($id)
    {
        $this->db->exec("DELETE FROM {$this->dbTable} WHERE " . self::USER_ID . " = :0 OR " . self::NOTED_ID . " = :1",
            [$id, $id]);
    }

    public function dropByUserIdList(array $userIds)
    {
        $usersList = DbQueryHelper::commaSeparatedHolders($userIds);
        $this->db->exec("DELETE FROM {$this->dbTable} WHERE " . self::USER_ID . " IN ($usersList)", $userIds);
    }

    public function save($sequence = null)
    {
        $this->db->exec("DELETE FROM {$this->dbTable} WHERE " . self::USER_ID . " = :0", [$this->getUserId()]);

        if (empty($this->notes)) {
            return;
        }

        $list = [];
        foreach ($this->notes as $notedUserId => $note) {
            $list[] = '(' . $this->getUserId() . ', ' . $notedUserId . ', ' . $this->db->o()->quote($note) . ')';
        }

        $this->db->exec("INSERT INTO {$this->dbTable} (" . self::USER_ID . ", " . self::NOTED_ID . ", " . self::NOTE . ") VALUES " . implode(', ',
                $list));
    }

    protected function getForeignProperties()
    {
        return [];
    }
}


text:
package com.deraz.SecurityMotionApp;

import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.VolleyLog;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import app.AppController;
import app.CustomRequest;

public class GridViewActivity extends ActionBarActivity {
    private static final String TAG = GridViewActivity.class.getSimpleName();

    private GridView mGridView;
    private ProgressBar mProgressBar;

    private GridViewAdapter mGridAdapter;
    private ArrayList<GridItem> mGridData;
    String userid;
    String newemail;
    private String username;
    private String FEED_URL = "http://ryanhancock.co.uk/AndroidFileUpload/index.php?name=";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gridview);

        mGridView = (GridView) findViewById(R.id.gridView);
        mProgressBar = (ProgressBar) findViewById(R.id.progressBar);

        //Initialize with empty data
        mGridData = new ArrayList<>();
        mGridAdapter = new GridViewAdapter(this, R.layout.grid_item_layout, mGridData);
        mGridView.setAdapter(mGridAdapter);

        //Grid view click event
        mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                //Get item at position
                GridItem item = (GridItem) parent.getItemAtPosition(position);

                Intent intent = new Intent(GridViewActivity.this, DetailsActivity.class);
                ImageView imageView = (ImageView) v.findViewById(R.id.grid_item_image);

                // Interesting data to pass across are the thumbnail size/location, the
                // resourceId of the source bitmap, the picture description, and the
                // orientation (to avoid returning back to an obsolete configuration if
                // the device rotates again in the meantime)

                int[] screenLocation = new int[2];
                imageView.getLocationOnScreen(screenLocation);

                //Pass the image title and url to DetailsActivity
                intent.putExtra("left", screenLocation[0]).
                        putExtra("top", screenLocation[1]).
                        putExtra("width", imageView.getWidth()).
                        putExtra("height", imageView.getHeight()).
                        putExtra("title", item.getTitle()).
                        putExtra("image", item.getImage());

                //Start details activity
                startActivity(intent);
            }
        });
        if (savedInstanceState == null) {
            Bundle extras = getIntent().getExtras();
            if (extras == null) {
                newemail = "";
                userid = "";
                username = "";
            } else {
                userid = extras.getString("user");
                newemail = extras.getString("email");
                username = extras.getString("name");
            }
        } else {
            userid = (String) savedInstanceState.getSerializable("user");
            newemail = (String) savedInstanceState.getSerializable("email");
            username = (String) savedInstanceState.getSerializable("name");
        }
        Log.d("hello",userid);
        //Start download
        //new AsyncHttpTask().execute(FEED_URL);
        LoadPicture(userid);
        mProgressBar.setVisibility(View.VISIBLE);
    }

    private void LoadPicture(final String userid) {
        // Tag used to cancel the request
        String tag_json_obj = "json_obj_req";
        String FEED_URLnew = "http://ryanhancock.co.uk/AndroidFileUpload/index.php?name="+userid;

        //JsonObjectRequest
               CustomRequest jsonObjReq = new CustomRequest(Request.Method.POST,
                FEED_URLnew, null,
                new Response.Listener<JSONObject>() {

                    @Override
                    public void onResponse(JSONObject response) {
                        Log.d(TAG, response.toString());
                        new AsyncHttpTask().execute(response.toString());
                    }
                }, new Response.ErrorListener() {

            @Override
            public void onErrorResponse(VolleyError error) {
                VolleyLog.d(TAG, "Error: " + error.getMessage());

            }
        }) {

                   @Override
                   protected Map<String, String> getParams() {
                       Map<String, String> params = new HashMap<String, String>();
                       params.put("lol", userid);
                       //params.put("email", "abc@androidhive.info");
                       //params.put("password", "password123");

                       return params;
                   }

               };
        AppController.getInstance().addToRequestQueue(jsonObjReq, tag_json_obj);
    }

    //Downloading data asynchronously
    public class AsyncHttpTask extends AsyncTask<String, Void, Integer> {

        @Override
        protected Integer doInBackground(String... params) {
            Integer result =1;
            try {
                JSONObject response = new JSONObject(params[0]);
                JSONObject jr = response.getJSONObject("images");
                JSONArray jd = jr.getJSONArray("image");
                GridItem item;
                for (int i = 0; i < jd.length(); i++) {
                    JSONObject post = jd.optJSONObject(i);
                    String title = post.optString("title");
                    item = new GridItem();
                    item.setTitle(title);
                    item.setImage(post.getString("url"));
                    /**
                     JSONArray attachments = post.getJSONArray("attachments");
                     if (null != attachments && attachments.length() > 0) {
                     JSONObject attachment = attachments.getJSONObject(0);
                     if (attachment != null)
                     item.setImage(attachment.getString("url"));
                     }
                     **/
                    mGridData.add(item);
                    //hour 25
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }return result;
        }

        @Override
        protected void onPostExecute(Integer result) {
            // Download complete. Lets update UI

            if (result == 1) {
                mGridAdapter.setGridData(mGridData);
            } else {
                Toast.makeText(GridViewActivity.this, "Failed to fetch data!", Toast.LENGTH_SHORT).show();
            }

            //Hide progressbar
            mProgressBar.setVisibility(View.GONE);
        }
    }

    String streamToString(InputStream stream) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream));
        String line;
        String result = "";
        while ((line = bufferedReader.readLine()) != null) {
            result += line;
        }

        // Close stream
        if (null != stream) {
            stream.close();
        }
        return result;
    }

    /**
     * Parsing the feed results and get the list
     *
     * @param result
     */
    private void parseResult(String result) {
        try {
            JSONObject response = new JSONObject(result);
            JSONObject jr = response.getJSONObject("images");
            JSONArray jd = jr.getJSONArray("image");
            GridItem item;
            for (int i = 0; i < jd.length(); i++) {
                JSONObject post = jd.optJSONObject(i);
                String title = post.optString("title");
                item = new GridItem();
                item.setTitle(title);
                item.setImage(post.getString("url"));
                /**
                JSONArray attachments = post.getJSONArray("attachments");
                    if (null != attachments && attachments.length() > 0) {
                        JSONObject attachment = attachments.getJSONObject(0);
                        if (attachment != null)
                        item.setImage(attachment.getString("url"));
                }
                 **/
                mGridData.add(item);
                //hour 25
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}


text:
namespace NPOI.XSSF.UserModel
{
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using NPOI.OpenXmlFormats.Spreadsheet;
    using NPOI.SS;
    using NPOI.SS.Formula;
    using NPOI.SS.Formula.Functions;
    using NPOI.SS.Formula.PTG;
    using NPOI.SS.Formula.UDF;
    using NPOI.SS.UserModel;
    using NPOI.SS.Util;
    using NPOI.XSSF.Model;
    using NPOI.XSSF.Streaming;

    /**
     * Internal POI use only - parent of XSSF and SXSSF Evaluation workbooks
     */
    public abstract class BaseXSSFEvaluationWorkbook : IFormulaRenderingWorkbook, IEvaluationWorkbook, IFormulaParsingWorkbook
    {
        protected XSSFWorkbook _uBook;

        public virtual void ClearAllCachedResultValues()
        {
            _tableCache = null;
        }

        protected BaseXSSFEvaluationWorkbook(XSSFWorkbook book)
        {
            _uBook = book;
        }

        private int ConvertFromExternalSheetIndex(int externSheetIndex)
        {
            return externSheetIndex;
        }
        /**
         * XSSF doesn't use external sheet indexes, so when asked treat
         * it just as a local index
         */
        public int ConvertFromExternSheetIndex(int externSheetIndex)
        {
            return externSheetIndex;
        }
        /**
         * @return  the external sheet index of the sheet with the given internal
         * index. Used by some of the more obscure formula and named range things.
         * Fairly easy on XSSF (we think...) since the internal and external
         * indices are the same
         */
        private int ConvertToExternalSheetIndex(int sheetIndex)
        {
            return sheetIndex;
        }

        public int GetExternalSheetIndex(String sheetName)
        {
            int sheetIndex = _uBook.GetSheetIndex(sheetName);
            return ConvertToExternalSheetIndex(sheetIndex);
        }

        private int ResolveBookIndex(String bookName)
        {
            // Strip the [] wrapper, if still present
            if (bookName.StartsWith("[") && bookName.EndsWith("]"))
            {
                bookName = bookName.Substring(1, bookName.Length - 2);
            }

            // Is it already in numeric form?
            try
            {
                return Int32.Parse(bookName);
            }
            catch (FormatException ) { }

            // Look up an External Link Table for this name
            List<ExternalLinksTable> tables = _uBook.ExternalLinksTable;
            int index = FindExternalLinkIndex(bookName, tables);
            if (index != -1) return index;

            // Is it an absolute file reference?
            if (bookName.StartsWith("'file:///") && bookName.EndsWith("'"))
            {
                String relBookName = bookName.Substring(bookName.LastIndexOf('/') + 1);
                relBookName = relBookName.Substring(0, relBookName.Length - 1); // Trailing '

                // Try with this name
                index = FindExternalLinkIndex(relBookName, tables);
                if (index != -1) return index;

                // If we Get here, it's got no associated proper links yet
                // So, add the missing reference and return
                // Note - this is really rather nasty...
                ExternalLinksTable fakeLinkTable = new FakeExternalLinksTable(relBookName);
                tables.Add(fakeLinkTable);
                return tables.Count; // 1 based results, 0 = current workbook
            }

            // Not properly referenced
            throw new Exception("Book not linked for filename " + bookName);
        }
        /* case-sensitive */
        private int FindExternalLinkIndex(String bookName, List<ExternalLinksTable> tables)
        {
            int i = 0;
            foreach (ExternalLinksTable table in tables)
            {
                if (table.LinkedFileName.Equals(bookName))
                {
                    return i + 1; // 1 based results, 0 = current workbook
                }
                i++;
            }
            return -1;
        }
        private class FakeExternalLinksTable : ExternalLinksTable
        {
            private String fileName;
            internal FakeExternalLinksTable(string fileName)
            {
                this.fileName = fileName;
            }
            public override string LinkedFileName
            {
                get
                {
                    return fileName;
                }
            }
        }
        /// <summary>
        /// Return EvaluationName wrapper around the matching XSSFName (named range)
        /// </summary>
        /// <param name="name">case-aware but case-insensitive named range in workbook</param>
        /// <param name="sheetIndex">index of sheet if named range scope is limited to one sheet
        ///   if named range scope is global to the workbook, sheetIndex is -1.</param>
        /// <returns>If name is a named range in the workbook, returns
        /// EvaluationName corresponding to that named range
        /// Returns null if there is no named range with the same name and scope in the workbook
        /// </returns>
        public IEvaluationName GetName(String name, int sheetIndex)
        {
            for (int i = 0; i < _uBook.NumberOfNames; i++)
            {
                XSSFName nm = _uBook.GetNameAt(i) as XSSFName;
                String nameText = nm.NameName;
                int nameSheetindex = nm.SheetIndex;
                if (name.Equals(nameText, StringComparison.CurrentCultureIgnoreCase) &&
                       (nameSheetindex == -1 || nameSheetindex == sheetIndex))
                {
                    return new Name(nm, i, this);
                }
            }
            return sheetIndex == -1 ? null : GetName(name, -1);
        }

        public String GetSheetName(int sheetIndex)
        {
            return _uBook.GetSheetName(sheetIndex);
        }

        public ExternalName GetExternalName(int externSheetIndex, int externNameIndex)
        {
            throw new InvalidOperationException("HSSF-style external references are not supported for XSSF");
        }

        public ExternalName GetExternalName(String nameName, String sheetName, int externalWorkbookNumber)
        {
            if (externalWorkbookNumber > 0)
            {
                // External reference - reference is 1 based, link table is 0 based
                int linkNumber = externalWorkbookNumber - 1;
                ExternalLinksTable linkTable = _uBook.ExternalLinksTable[(linkNumber)];

                foreach (IName name in linkTable.DefinedNames)
                {
                    if (name.NameName.Equals(nameName))
                    {
                        // HSSF returns one sheet higher than normal, and various bits
                        //  of the code assume that. So, make us match that behaviour!
                        int nameSheetIndex = name.SheetIndex + 1;

                        // TODO Return a more specialised form of this, see bug #56752
                        // Should include the cached values, for in case that book isn't available
                        // Should support XSSF stuff Lookups
                        return new ExternalName(nameName, -1, nameSheetIndex);
                    }
                }
                throw new ArgumentException("Name '" + nameName + "' not found in " +
                                                   "reference to " + linkTable.LinkedFileName);
            }
            else
            {
                // Internal reference
                int nameIdx = _uBook.GetNameIndex(nameName);
                return new ExternalName(nameName, nameIdx, 0);  // TODO Is this right?
            }

        }

        /// <summary>
        /// Return an external name (named range, function, user-defined function) Pxg
        /// </summary>
        /// <param name="name"></param>
        /// <param name="sheet"></param>
        /// <returns></returns>
        public Ptg GetNameXPtg(String name, SheetIdentifier sheet)
        {
            // First, try to find it as a User Defined Function
            IndexedUDFFinder udfFinder = (IndexedUDFFinder)GetUDFFinder();
            FreeRefFunction func = udfFinder.FindFunction(name);
            if (func != null)
            {
                return new NameXPxg(null, name);
            }

            // Otherwise, try it as a named range
            if (sheet == null)
            {
                if (_uBook.GetNames(name).Count > 0)
                {
                    return new NameXPxg(null, name);
                }
                return null;
            }
            if (sheet._sheetIdentifier == null)
            {
                // Workbook + Named Range only
                int bookIndex = ResolveBookIndex(sheet._bookName);
                return new NameXPxg(bookIndex, null, name);
            }

            // Use the sheetname and process
            String sheetName = sheet._sheetIdentifier.Name;

            if (sheet._bookName != null)
            {
                int bookIndex = ResolveBookIndex(sheet._bookName);
                return new NameXPxg(bookIndex, sheetName, name);
            }
            else
            {
                return new NameXPxg(sheetName, name);
            }
        }
        public Ptg Get3DReferencePtg(CellReference cell, SheetIdentifier sheet)
        {
            if (sheet._bookName != null)
            {
                int bookIndex = ResolveBookIndex(sheet._bookName);
                return new Ref3DPxg(bookIndex, sheet, cell);
            }
            else
            {
                return new Ref3DPxg(sheet, cell);
            }
        }
        public Ptg Get3DReferencePtg(AreaReference area, SheetIdentifier sheet)
        {
            if (sheet._bookName != null)
            {
                int bookIndex = ResolveBookIndex(sheet._bookName);
                return new Area3DPxg(bookIndex, sheet, area);
            }
            else
            {
                return new Area3DPxg(sheet, area);
            }
        }

        public String ResolveNameXText(NameXPtg n)
        {
            int idx = n.NameIndex;
            String name = null;

            // First, try to find it as a User Defined Function
            IndexedUDFFinder udfFinder = (IndexedUDFFinder)GetUDFFinder();
            name = udfFinder.GetFunctionName(idx);
            if (name != null) return name;

            // Otherwise, try it as a named range
            XSSFName xname = _uBook.GetNameAt(idx) as XSSFName;
            if (xname != null)
            {
                name = xname.NameName;
            }

            return name;
        }

        public ExternalSheet GetExternalSheet(int externSheetIndex)
        {
            throw new InvalidOperationException("HSSF-style external references are not supported for XSSF");
        }
        public ExternalSheet GetExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber)
        {
            String workbookName;
            if (externalWorkbookNumber > 0)
            {
                // External reference - reference is 1 based, link table is 0 based
                int linkNumber = externalWorkbookNumber - 1;
                ExternalLinksTable linkTable = _uBook.ExternalLinksTable[(linkNumber)];
                workbookName = linkTable.LinkedFileName;
            }
            else
            {
                // Internal reference
                workbookName = null;
            }

            if (lastSheetName == null || firstSheetName.Equals(lastSheetName))
            {
                return new ExternalSheet(workbookName, firstSheetName);
            }
            else
            {
                return new ExternalSheetRange(workbookName, firstSheetName, lastSheetName);
            }
        }

        public int GetExternalSheetIndex(String workbookName, String sheetName)
        {
            throw new Exception("not implemented yet");
        }
        public int GetSheetIndex(String sheetName)
        {
            return _uBook.GetSheetIndex(sheetName);
        }

        public String GetSheetFirstNameByExternSheet(int externSheetIndex)
        {
            int sheetIndex = ConvertFromExternalSheetIndex(externSheetIndex);
            return _uBook.GetSheetName(sheetIndex);
        }
        public String GetSheetLastNameByExternSheet(int externSheetIndex)
        {
            // XSSF does multi-sheet references differently, so this is the same as the first
            return GetSheetFirstNameByExternSheet(externSheetIndex);
        }

        public String GetNameText(NamePtg namePtg)
        {
            return _uBook.GetNameAt(namePtg.Index).NameName;
        }
        public IEvaluationName GetName(NamePtg namePtg)
        {
            int ix = namePtg.Index;
            return new Name(_uBook.GetNameAt(ix) as XSSFName, ix, this);
        }
        public IName CreateName()
        {
            return _uBook.CreateName();
        }

        /*
         * TODO: data tables are stored at the workbook level in XSSF, but are bound to a single sheet.
         *       The current code structure has them hanging off XSSFSheet, but formulas reference them
         *       only by name (names are global, and case insensitive).
         *       This map stores names as lower case for case-insensitive lookups.
         *
         * FIXME: Caching tables by name here for fast formula lookup means the map is out of date if
         *       a table is renamed or added/removed to a sheet after the map is created.
         *
         *       Perhaps tables can be managed similar to PivotTable references above?
         */
        private Dictionary<String, XSSFTable> _tableCache = null;
        private Dictionary<String, XSSFTable> GetTableCache()
        {
            if (_tableCache != null)
            {
                return _tableCache;
            }
            // FIXME: use org.apache.commons.collections.map.CaseInsensitiveMap
            _tableCache = new Dictionary<String, XSSFTable>();

            foreach (ISheet sheet in _uBook)
            {
                foreach (XSSFTable tbl in ((XSSFSheet)sheet).GetTables())
                {
                    String lname = tbl.Name.ToLower(CultureInfo.CurrentCulture);
                    _tableCache.Add(lname, tbl);
                }
            }
            return _tableCache;
        }

        /**
         * Returns the data table with the given name (case insensitive).
         * Tables are cached for performance (formula evaluation looks them up by name repeatedly).
         * After the first table lookup, adding or removing a table from the document structure will cause trouble.
         * This is meant to be used on documents whose structure is essentially static at the point formulas are evaluated.
         *
         * @param name the data table name (case-insensitive)
         * @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>.
         * @since 3.15 beta 2
         */
        public ITable GetTable(String name)
        {
            if (name == null) return null;
            String lname = name.ToLower(CultureInfo.CurrentCulture);
            return GetTableCache()[lname];
        }

        public UDFFinder GetUDFFinder()
        {
            return _uBook.GetUDFFinder();
        }

        private class Name : IEvaluationName
        {

            private XSSFName _nameRecord;
            private int _index;
            private IFormulaParsingWorkbook _fpBook;

            public Name(XSSFName name, int index, IFormulaParsingWorkbook fpBook)
            {
                _nameRecord = name;
                _index = index;
                _fpBook = fpBook;
            }

            public Ptg[] NameDefinition
            {
                get
                {
                    return FormulaParser.Parse(_nameRecord.RefersToFormula, _fpBook, FormulaType.NamedRange, _nameRecord.SheetIndex);
                }

            }

            public String NameText
            {
                get
                {
                    return _nameRecord.NameName;
                }

            }

            public bool HasFormula
            {
                get
                {
                    // TODO - no idea if this is right
                    CT_DefinedName ctn = _nameRecord.GetCTName();
                    String strVal = ctn.Value;
                    return !ctn.function && strVal != null && strVal.Length > 0;
                }

            }

            public bool IsFunctionName
            {
                get
                {
                    return _nameRecord.IsFunctionName;
                }
            }

            public bool IsRange
            {
                get
                {
                    return HasFormula; // TODO - is this right?
                }
            }
            public NamePtg CreatePtg()
            {
                return new NamePtg(_index);
            }
        }

        public SpreadsheetVersion GetSpreadsheetVersion()
        {
            return SpreadsheetVersion.EXCEL2007;
        }

        public abstract int GetSheetIndex(IEvaluationSheet sheet);

        public abstract IEvaluationSheet GetSheet(int sheetIndex);

        public abstract Ptg[] GetFormulaTokens(IEvaluationCell cell);
    }

}


text:
interface Array<T> {
    bulkPost(): Q.Promise<any>;
    bulkPut():  Q.Promise<any>;
    bulkPatch():Q.Promise<any>;
    bulkDel():  Q.Promise<any>;
}


text: <!DOCTYPE html>


text:
create table teste(
id int auto_increment,
nome varchar(100) not null,
valor decimal(5,2),
constraint id_pk primary key (id));

insert into teste values (null, 'Danilo',333.33)

//https://pt.stackoverflow.com/q/318632/101


text:
package vars

import (
	"encoding/json"
	"fmt"
	"regexp"

	"github.com/hashicorp/go-multierror"
)

var templateOldStyleFormatRegex = regexp.MustCompile(`\{\{([-\w\p{L}]+)\}\}`)

type TemplateResolver struct {
	configPayload []byte
	params        []Variables
}

// Creates a template resolver, given a configPayload and a slice of param sources. If more than
// one param source is specified, they will be tried for variable lookup in the provided order.
// See implementation of NewMultiVars for details.
func NewTemplateResolver(configPayload []byte, params []Variables) TemplateResolver {
	return TemplateResolver{
		configPayload: configPayload,
		params:        params,
	}
}

func (resolver TemplateResolver) Resolve(expectAllKeys bool, allowEmptyInOldStyleTemplates bool) ([]byte, error) {
	var err error

	if PresentDeprecated(resolver.configPayload) {
		resolver.configPayload, err = resolver.ResolveDeprecated(allowEmptyInOldStyleTemplates)
		if err != nil {
			return nil, err
		}
	}

	resolver.configPayload, err = resolver.resolve(expectAllKeys)
	if err != nil {
		return nil, err
	}

	return resolver.configPayload, nil
}

func (resolver TemplateResolver) resolve(expectAllKeys bool) ([]byte, error) {
	tpl := NewTemplate(resolver.configPayload)
	bytes, err := tpl.Evaluate(NewMultiVars(resolver.params), EvaluateOpts{ExpectAllKeys: expectAllKeys})
	if err != nil {
		return nil, err
	}
	return bytes, nil
}

func (resolver TemplateResolver) ResolveDeprecated(allowEmpty bool) ([]byte, error) {
	vars := StaticVariables{}
	// TODO: old-style template parameters require very careful handling and reverse
	// order processing. we should eventually drop their support
	for i := len(resolver.params) - 1; i >= 0; i-- {
		if staticVar, ok := resolver.params[i].(StaticVariables); ok {
			for k, v := range staticVar {
				vars[k] = v
			}
		}
	}

	var variableErrors error

	return templateOldStyleFormatRegex.ReplaceAllFunc(resolver.configPayload, func(match []byte) []byte {
		key := string(templateOldStyleFormatRegex.FindSubmatch(match)[1])

		value, found := vars[key]
		if !found && !allowEmpty {
			variableErrors = multierror.Append(variableErrors, fmt.Errorf("unbound variable in template: '%s'", key))
			return match
		}

		saveValue, _ := json.Marshal(value)

		return []byte(saveValue)
	}), variableErrors

}

func PresentDeprecated(content []byte) bool {
	return templateOldStyleFormatRegex.Match(content)
}


text:
'use strict';

var _Object$keys = require('babel-runtime/core-js/object/keys')['default'];

Object.defineProperty(exports, '__esModule', {
  value: true
});
exports.undefinedFieldMessage = undefinedFieldMessage;
exports.FieldsOnCorrectType = FieldsOnCorrectType;

var _error = require('../../error');

var _typeDefinition = require('../../type/definition');

function undefinedFieldMessage(fieldName, type, suggestedTypes) {
  var message = 'Cannot query field "' + fieldName + '" on type "' + type + '".';
  var MAX_LENGTH = 5;
  if (suggestedTypes.length !== 0) {
    var suggestions = suggestedTypes.slice(0, MAX_LENGTH).map(function (t) {
      return '"' + t + '"';
    }).join(', ');
    if (suggestedTypes.length > MAX_LENGTH) {
      suggestions += ', and ' + (suggestedTypes.length - MAX_LENGTH) + ' other types';
    }
    message += ' However, this field exists on ' + suggestions + '.';
    message += ' Perhaps you meant to use an inline fragment?';
  }
  return message;
}

/**
 * Fields on correct type
 *
 * A GraphQL document is only valid if all fields selected are defined by the
 * parent type, or are an allowed meta field such as __typenamme
 */

function FieldsOnCorrectType(context) {
  return {
    Field: function Field(node) {
      var type = context.getParentType();
      if (type) {
        var fieldDef = context.getFieldDef();
        if (!fieldDef) {
          // This isn't valid. Let's find suggestions, if any.
          var suggestedTypes = [];
          if ((0, _typeDefinition.isAbstractType)(type)) {
            suggestedTypes = getSiblingInterfacesIncludingField(type, node.name.value);
            suggestedTypes = suggestedTypes.concat(getImplementationsIncludingField(type, node.name.value));
          }
          context.reportError(new _error.GraphQLError(undefinedFieldMessage(node.name.value, type.name, suggestedTypes), [node]));
        }
      }
    }
  };
}

/**
 * Return implementations of `type` that include `fieldName` as a valid field.
 */
function getImplementationsIncludingField(type, fieldName) {
  return type.getPossibleTypes().filter(function (t) {
    return t.getFields()[fieldName] !== undefined;
  }).map(function (t) {
    return t.name;
  }).sort();
}

/**
 * Go through all of the implementations of type, and find other interaces
 * that they implement. If those interfaces include `field` as a valid field,
 * return them, sorted by how often the implementations include the other
 * interface.
 */
function getSiblingInterfacesIncludingField(type, fieldName) {
  var implementingObjects = type.getPossibleTypes().filter(function (t) {
    return t instanceof _typeDefinition.GraphQLObjectType;
  });

  var suggestedInterfaces = implementingObjects.reduce(function (acc, t) {
    t.getInterfaces().forEach(function (i) {
      if (i.getFields()[fieldName] === undefined) {
        return;
      }
      if (acc[i.name] === undefined) {
        acc[i.name] = 0;
      }
      acc[i.name] += 1;
    });
    return acc;
  }, {});
  return _Object$keys(suggestedInterfaces).sort(function (a, b) {
    return suggestedInterfaces[b] - suggestedInterfaces[a];
  });
}


text:
var path        = require('path');
var miss        = require('mississippi');
var spawn       = require('@mh-cbon/c-aghfabsowecwn').spawn;
var oPathToBin   = require('./path-to-bin.js');

var pathToBin = function (p, then) {
  if (process.platform.match(/win/)) return oPathToBin(p + '.cmd', then);
  oPathToBin(p, then);
}
var platformNodebinSpawn = function (bin, args, opts) {
  if (process.platform.match(/win/)) return spawn(bin, args, opts);
  args.unshift(bin)
  return spawn(process.argv[0], args, opts);
}

var createReadStream = function (fPath) {
  var stream = miss.through();
  pathToBin('catf', function (err, binPath) {
    if (err) return stream.emit('error', err);
    fPath = fPath.toString();
    var child = platformNodebinSpawn(binPath, [fPath], {stdio: ['ignore', 'pipe', 'pipe']});

    stream.path = fPath;

    child.on('error', function (err) {
      stream.emit('error', err);
    });

    var stderr = '';
    child.stderr.on('data', function (d) {
      stderr += d.toString();
    });

    child.on('close', function (code) {
      if (code!==0) {
        stream.emit('error', stderr)
      } else {
        stream.emit('end');
        stream.emit('close');
      }
    });

    child.stdout.once('data', function (d) {
      stream.emit('open')
    })
    child.stdout.on('data', function (d) {
      stream.write(d)
    })
  })

  return stream;
}

var createWriteStream = function (fPath, options) {
  var stream = miss.through();
  pathToBin('fwrite', function (err, binPath) {
    if (err) return stream.emit('error', err);
    fPath = fPath.toString();

    stream.path = fPath;

    var child = platformNodebinSpawn(binPath, [fPath], {stdio: 'pipe'});

    stream.bytesWritten = 0;
    stream.on('data', function (d) {
      stream.bytesWritten += d.length;
    });

    child.on('error', function (err) {
      stream.emit('error', err);
    });

    stream.pipe(child.stdin);
    var stderr = '';
    child.stderr.on('data', function (d) {
      stderr += d.toString();
    });
    child.once('close', function (code) {
      if (code!==0) {
        stream.emit('error', stderr)
      } else {
        stream.emit('open')
        stream.emit('close');
      }
    })
  });

  return stream;
}

var writeFile = function (fPath, content, options, callback) {
  if (!callback && typeof(options)==='function') {
    callback = options
    options = {}
  }
  var err;
  createWriteStream(fPath, options)
  .on('error', function (e) {
    err = e;
  })
  .on('close', function () {
    callback(err)
  })
  .end(content)
}

var readFile = function (fPath, options, callback) {
  if (!callback && typeof(options)==='function') {
    callback = options
    options = {}
  }
  var err;
  var data = '';
  createReadStream(fPath, options)
  .on('data', function (d) {
    data += d.toString();
  })
  .on('error', function (e) {
    err = e;
  })
  .on('close', function () {
    callback(err, data)
  })
}

var mkdir = function (fPath, mod, callback) {
  if (!callback && typeof(mod)==='function') {
    callback = mod
    mod = ''
  }
  pathToBin('mkdirp', function (err, binPath) {
    if (err) return callback(err);

    var args = [fPath]
    if (mod) args.concat(['-m', mod.toString(8)]);

    var child = platformNodebinSpawn(binPath, args, {stdio: 'pipe'});

    var stdout = '';
    child.stdout.on('data', function (d) {
      stdout += d.toString();
    })
    var stderr = '';
    child.stderr.on('data', function (d) {
      stderr += d.toString();
    })

    var err;
    child.on('error', function (e) {
      err = e
    });

    child.on('close', function (code) {
      callback && callback(code!==0 ? (err || stdout + stderr) : null);
    });
  });
}

var unlink = function (fPath, callback) {
  pathToBin('rimraf', function (err, binPath) {
    if (err) return callback(err);

    var child = platformNodebinSpawn(binPath, [fPath], {stdio: 'pipe'});

    var stdout = '';
    child.stdout.on('data', function (d) {
      stdout += d.toString();
    })
    var stderr = '';
    child.stderr.on('data', function (d) {
      stderr += d.toString();
    })

    var err;
    child.on('error', function (e) {
      err = e
    });

    child.on('close', function (code) {
      callback && callback(code!==0 ? (err || stdout + stderr) : null);
    });
  })
}

var chmod = function (fPath, mod, callback) {
  // mhh, not really sure what to do here.
  callback()
}

var chown = function (fPath, uid, gid, callback) {
  // mhh, not really sure what to do here.
  callback()
}

var exists = function (fPath, callback) {
  pathToBin('lsj', function (err, binPath) {
    if (err) return callback(err);

    var dir = path.dirname(fPath);
    var child = platformNodebinSpawn('lsj', [dir], {stdio: 'pipe'});

    var data = '';
    child.stdout.on('data', function (d) {
      data += d.toString()
    });

    var stderr = '';
    child.stderr.on('data', function (d) {
      stderr += d.toString()
    });

    var err;
    child.on('error', function (e) {
      err = e
    });

    child.on('close', function (code) {
      if (err) return callback && callback(false);
      if (code!==0) return callback && callback(stderr);
      data = JSON.parse(data);
      callback && callback(
        data.indexOf(path.basename(fPath))>-1
      )
    });
  });
}

var touch = function (fPath, options, callback) {
  if (!callback && typeof(options)==='function') {
    callback = options
    options = {}
  }
  pathToBin('touch', function (err, binPath) {
    if (err) return callback(err);

    var args = [];
    if (options.f || options.force) args.push('--force')
    if (options.t || options.time) args.concat(['--time', options.t || options.time])
    if (options.a===true || options.atime===true) args.concat(['--atime'])
    else if (options.a || options.atime) args.concat(['--atime', options.a || options.atime])
    if (options.m===true || options.mtime===true) args.concat(['--mtime'])
    else if (options.m || options.mtime) args.concat(['--mtime', options.m || options.mtime])
    if (options.r || options.ref) args.concat(['--ref', options.r || options.ref])
    if (options.c || options.nocreate) args.concat(['-c'])

    args.push(fPath)

    var child = platformNodebinSpawn(binPath, args, {stdio: 'pipe'});

    var stdout = '';
    child.stdout.on('data', function (d) {
      stdout += d.toString()
    });

    var stderr = '';
    child.stderr.on('data', function (d) {
      stderr += d.toString()
    });

    var err;
    child.on('error', function (e) {
      err = e
    });

    child.on('close', function (code) {
      if (err) return callback && callback(err);
      if (code!==0) return callback && callback(stderr+stdout);
      callback && callback(null)
    });
  });
}

var fs = {
  createReadStream:   createReadStream,
  createWriteStream:  createWriteStream,

  readFile:   readFile,
  writeFile:  writeFile,

  touch:  touch,
  unlink: unlink,
  rmdir:  unlink,
  mkdir:  mkdir,
  chown:  chown,
  chmod:  chmod,
  exists: exists,
}

module.exports = fs;


text:
package br.com.danieldias.restful.application;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

/**
 * @author daniel
 * github:Daniel-Dos
 * daniel.dias.analistati@gmail.com
 * twitter:@danieldiasjava
 */
@ApplicationPath("/api")
public class ApplicationConfig extends Application {
}


text:
package com.cezarykluczynski.stapi.server.trading_card.mapper;

import com.cezarykluczynski.stapi.client.v1.soap.TradingCardHeader;
import com.cezarykluczynski.stapi.model.trading_card.entity.TradingCard;
import com.cezarykluczynski.stapi.server.configuration.MapstructConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

import java.util.List;

@Mapper(config = MapstructConfiguration.class, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TradingCardHeaderSoapMapper {

	TradingCardHeader map(TradingCard tradingCard);

	List<TradingCardHeader> map(List<TradingCard> tradingCard);

}


text:
!(function(undefined) {

  // Maintain map dimensions
  window.onresize = adjust;
  function adjust(){
    document.getElementById("app-wrapper").style.height = window.innerHeight;
    document.getElementById("app-maparea").style.height = (window.innerHeight-75) + "px";
  }
  adjust();

  var client = new Keen({
    projectId: "53eab6e12481962467000000",
    readKey: "d1b97982ce67ad4b411af30e53dd75be6cf610213c35f3bd3dd2ef62eaeac14632164890413e2cc2df2e489da88e87430af43628b0c9e0b2870d0a70580d5f5fe8d9ba2a6d56f9448a3b6f62a5e6cdd1be435c227253fbe3fab27beb0d14f91b710d9a6e657ecf47775281abc17ec455"
  });

  var DEFAULTS = {
    coordinates: {
      lat: 37.77350,
      lng: -122.41104
    },
    zoom: 12
  };

  var find = function(hash, selector) {
    var hashes = location.hash.substr(1).split("&");
    return buildParamsMap(hashes)[selector];
  };

  var buildParamsMap = function(hashes) {
    var map = {};
    for(var i = 0; i < hashes.length; i++) {
      var hash = hashes[i].split("=");
      map[hash[0]] = hash[1];
    }
    return map;
  };

  Keen.ready(function() {
    var initialize,
        circle,
        marker,
        map,
        markerStart = DEFAULTS.coordinates,
        latNode = document.getElementById('coordinates-lat'),
        lngNode = document.getElementById('coordinates-lng'),
        radiusValueNode = document.getElementById('radius-value'),
        radiusUnitsNode = document.getElementById('radius-suffix'),
        timeframeStartNode = document.getElementById('timeframe-start'),
        timeframeEndNode = document.getElementById('timeframe-end');

    timeframeStartNode.value = "2014-08-01";
    timeframeEndNode.value = "2014-08-15";

    // Listen for input changes
    radiusValueNode.onchange = updateRadiusIndicator;
    radiusUnitsNode.onchange = updateRadiusIndicator;
    function updateRadiusIndicator(e){
      var rangeInMeters = radiusValueNode.value / 1000,
          radiusValue = radiusValueNode.value || 10,
          radiusUnits = radiusUnitsNode.value || "km";
      rangeInMeters = radiusValue * ((radiusUnits === "mi") ? 1609.34 : 1000);
      circle.setRadius(rangeInMeters);
    };

    var activeMapData;

    var initialize = function() {
      var hasQuery = window.location.hash.length !== 0
      L.mapbox.accessToken = "pk.eyJ1IjoiZG9ra28xMjMwIiwiYSI6IlM3TUN5RW8ifQ.wNT0Pp0zCtMR7phIRHg6Ug";
      map = L.mapbox.map("app-maparea", "dokko1230.j7ch6d77", {
        attributionControl: true,
        center: [markerStart.lat, markerStart.lng],
        zoom: DEFAULTS.zoom
      });

      // For query result markers
      activeMapData = L.layerGroup().addTo(map);
      markerStart.lat = hasQuery ? find(location.hash, 'latitude') : markerStart.lat;
      markerStart.lng = hasQuery ? find(location.hash, 'longitude') : markerStart.lng;

      marker = L.marker(new L.LatLng(markerStart.lat, markerStart.lng), {
        icon: L.mapbox.marker.icon({
          "marker-color": "ff8888"
        }),
        draggable: true,
        zIndexOffset: 9999
      });
      circle = L.circle([markerStart.lat, markerStart.lng], 1000);
      latNode.value = markerStart.lat;
      lngNode.value = markerStart.lng;

      marker.addTo(map);
      circle.addTo(map);

      updateRadiusIndicator();

      map.attributionControl.addAttribution('Custom Analytics by Keen IO');

      var keenMapData = L.layerGroup().addTo(map);

      marker.on('dragend', function(event) {
        // Move circle to marker
        var newCoords = event.target.getLatLng();
        var newLat = newCoords.lat.toPrecision(8);
        var newLng = newCoords.lng.toPrecision(8);

        circle.setLatLng({ lat: newLat, lng: newLng });
        latNode.value = newLat;
        lngNode.value = newLng;

        var rangeInMeters, rangeInMiles,
            config,
            radiusValue = radiusValueNode.value || 10,
            radiusUnits = radiusUnitsNode.value || "km";

        rangeInMeters = radiusValue * ((radiusUnits === "mi") ? 1609.34 : 1000);

        // CONVERT TO MILES (API v3)
        rangeInMiles = rangeInMeters / 1609.34;

        var config = {
          start: timeframeStartNode.value,
          end: timeframeEndNode.value,
          latitude: latNode.value,
          longitude: lngNode.value,
          radius: rangeInMiles
        };

        updateQuery(config);
        redraw(config);
      });

      document.getElementById('refresh').onclick = refresh;

      // Get query string
      if(hasQuery) { //query exists
        rebuild(window.location.hash.substr(1).split('&'));
      } else {
        refresh();
      }
    };

    var rebuild = function(params) {
      redraw(buildParamsMap(params));
    };

    var updateQuery = function(params) {
      var queryString = "";
      for(var key in params) {
        queryString += key + '=' + params[key] + "&";
      }
      window.location.hash = queryString;
    };

    var refresh = function() {
      var rangeInMeters, rangeInMiles,
          config,
          radiusValue = radiusValueNode.value || 10,
          radiusUnits = radiusUnitsNode.value || "km";

      // Behold, the one-liner :)
      //
      //
      //
      //
      //
      //
      // GASPS :O
      rangeInMeters = radiusValue * ((radiusUnits === "mi") ? 1609.34 : 1000);

      // CONVERT TO MILES (API v3)
      rangeInMiles = rangeInMeters / 1609.34;

      config = {
        start: timeframeStartNode.value,
        end: timeframeEndNode.value,
        latitude: latNode.value,
        longitude: lngNode.value,
        radius: rangeInMiles
      };

      redraw(config);
      updateQuery(config);
    };

    function redraw(config){
      var options = config || {};

      var end = (options["end"]) ? new Date(Date.parse(options["end"])) : new Date();
      var start = (options["start"]) ? new Date(Date.parse(options["start"])) : new Date(end.getFullYear(), end.getMonth(), end.getDate()-14);

      var rad = (options["radius"]) ? parseFloat(options["radius"]) : false;
      var lat = (options["latitude"]) ? parseFloat(options["latitude"]) : false;
      var lng = (options["longitude"]) ? parseFloat(options["longitude"]) : false;

      var geoFilter = [];
      if (lat && lng && rad) {
        geoFilter.push({
          property_name : "keen.location.coordinates",
          operator : "within",
          property_value: {
            coordinates: [ parseFloat(options["longitude"]), parseFloat(options["latitude"]) ],
            max_distance_miles: parseFloat(options["radius"])
          }
        });
      };

      var baseParams = {
        timeframe: {
          start: start.toISOString(),
          end: end.toISOString()
        },
        filters: geoFilter
      };

      // Fetch events within geo target
      var scoped_events = new Keen.Query("select_unique", {
        eventCollection: "user_action",
        targetProperty: "keen.location.coordinates",
        timeframe: baseParams.timeframe,
        filters: baseParams.filters
      });
      client.run(scoped_events, function(res){
        console.log("events", res);
        activeMapData.clearLayers();

        Keen.utils.each(res.result, function(coord, index){
          var em = L.marker(new L.LatLng(coord[1], coord[0]), {
            icon: L.mapbox.marker.icon({
              "marker-color": Keen.Visualization.defaults.colors[0]
            })
          }).addTo(activeMapData);;
        });
      });

      // Sample queries
      // groupBy not supported for Geo Filters
      var hearts = new Keen.Query("median", {
        eventCollection: "user_action",
        interval: "daily",
        targetProperty: "bio_sensors.heart_rate",
        timeframe: baseParams.timeframe,
        filters: baseParams.filters
      });
      client.draw(hearts, document.getElementById("chart-01"), {
        chartType: "areachart",
        colors: [Keen.Visualization.defaults.colors[1]],
        title: " ",
        height: 175,
        width: "auto",
        chartOptions: {
          chartArea: { height: "80%", top: "5%", width: "80%" },
          hAxis: { format: 'MMM dd', maxTextLines: 1 },
          legend: { position: "none" },
          tooltip: { trigger: 'none' }
        }
      });

      var activations = new Keen.Query("count", {
        eventCollection: "activations",
        interval: "daily",
        timeframe: baseParams.timeframe,
        filters: baseParams.filters
      });
      client.draw(activations, document.getElementById("chart-02"), {
        chartType: "areachart",
        colors: [Keen.Visualization.defaults.colors[2]],
        title: " ",
        height: 175,
        width: "auto",
        chartOptions: {
          bar: { groupWidth: "85%" },
          chartArea: { height: "80%", top: "5%", width: "80%" },
          hAxis: { format: 'MMM dd' },
          legend: { position: "none" },
          tooltip: { trigger: 'none' }
        }
      });

      var purchases = new Keen.Query("sum", {
        eventCollection: "purchases",
        targetProperty: "order_price",
        interval: "daily",
        timeframe: baseParams.timeframe,
        filters: baseParams.filters
      });
      client.draw(purchases, document.getElementById("chart-03"), {
        chartType: "columnchart",
        title: false,
        height: 175,
        width: "auto",
        chartOptions: {
          bar: { groupWidth: "85%" },
          chartArea: { height: "80%", top: "5%", width: "80%" },
          hAxis: { format: 'MMM dd' },
          legend: { position: "none" },
          tooltip: { trigger: 'none' }
        }
      });
    };

  initialize();
  })

})();


text:
The ATRSHMLOG init program.  {#files_atrshmloginit_c}
====================================

This program initializes the shared memory buffer.

Its name is

     atrshmloginit

It must run before the first write or read use of the buffer.

It is separated from the create to handle the fact
that both have different responsibilities.

The init itself is done by a function, so the program
only knows about the count of buffers via parameter.

If you want to use a fraction of memory for a diffrent
thing you can give is a smaller number than the create.

If the environment variable for COUNT is set you can run it
without a parameter. See the dot file from atrshmlogcreate .


text:
package org.apache.reef.util;

import org.junit.Assert;
import org.junit.Test;

/**
 * Tests for CollectionUtils functions.
 */
public final class CollectionUtilsTest {

  @Test
  public void testNullToEmptyNull() {
    Assert.assertNotNull("Method should never return null", CollectionUtils.nullToEmpty(null));
  }

  @Test
  public void testNullToEmptyNull2() {
    final Integer[] array = new Integer[0];
    Assert.assertArrayEquals("Must return an empty array", array, CollectionUtils.nullToEmpty(null));
  }

  @Test
  public void testNullToEmptyIntegers() {
    final Integer[] array = new Integer[] {1, 2, 3};
    Assert.assertArrayEquals("Must return the same array", array, CollectionUtils.nullToEmpty(array));
    Assert.assertTrue("Must return reference to the same object", array == CollectionUtils.nullToEmpty(array));
  }

  @Test
  public void testNullToEmptyZeroLength() {
    final Integer[] array = new Integer[0];
    Assert.assertArrayEquals("Must return the same array", array, CollectionUtils.nullToEmpty(array));
    Assert.assertTrue("Must return reference to the same object", array == CollectionUtils.nullToEmpty(array));
  }
}


text:
package com.github.liosha2007.android.recipes.craft.controller;

import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.widget.Toast;

import com.github.liosha2007.android.library.activity.controller.BaseActivityController;
import com.github.liosha2007.android.library.common.Utils;
import com.github.liosha2007.android.library.database.DaoFactory;
import com.github.liosha2007.android.recipes.craft.common.Constants;
import com.github.liosha2007.android.recipes.craft.database.dao.IconDAO;
import com.github.liosha2007.android.recipes.craft.database.domain.Icon;
import com.github.liosha2007.android.recipes.craft.view.SettingsView;

import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;

/**
 * Created by liosha on 22.04.2014.
 */
public class SettingsController extends BaseActivityController<SettingsView> {
    private static final int EXPORT_DATABASE_EVENT = Utils.makeID();
    private static final int IMPORT_DATABASE_EVENT = Utils.makeID();
    private static final int UPLOAD_TEXTURES_EVENT = Utils.makeID();

    public SettingsController() {
        super(new SettingsView());
    }

    @Override
    protected void onCreate() {
        super.onCreate();

        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
        if (preferences.getBoolean(Constants.ADD_DELETE_RECIPES, false)) {
            view.enableEditMode();
        }
    }

    public void onEditRecipesChecked(boolean checked) {
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean(Constants.ADD_DELETE_RECIPES, checked);
        editor.apply();
    }

    public void onExportDatabaseClicked() {
        Intent intent = new Intent(BrowserController.INTENT_ACTION_SELECT_DIR,
                null,
                this,
                BrowserController.class);
        startActivityForResult(intent, EXPORT_DATABASE_EVENT);
    }

    public void onImportDatabaseClicked() {
        Intent intent = new Intent(BrowserController.INTENT_ACTION_SELECT_FILE,
                null,
                this,
                BrowserController.class);
        startActivityForResult(intent, IMPORT_DATABASE_EVENT);
    }

    public void onUploadTexturesClicked() {
        Intent intent = new Intent(BrowserController.INTENT_ACTION_SELECT_DIR,
                null,
                this,
                BrowserController.class);
        startActivityForResult(intent, UPLOAD_TEXTURES_EVENT);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == RESULT_OK) {
            if (requestCode == EXPORT_DATABASE_EVENT) {
                exportDatabase(data.getStringExtra(BrowserController.RETURN_DIRECTORY_PARAMETER));
            } else if (requestCode == IMPORT_DATABASE_EVENT) {
                importDatabase(data.getStringExtra(BrowserController.RETURN_FILE_PARAMETER));
            } else if (requestCode == UPLOAD_TEXTURES_EVENT) {
                uploadTextures(data.getStringExtra(BrowserController.RETURN_DIRECTORY_PARAMETER));
            }
        }
        super.onActivityResult(requestCode, resultCode, data);
    }

    private void uploadTextures(String directory) {
        final IconDAO iconDAO = daoFor(Icon.class);
        File[] listFiles = new File(directory).listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File file, String name) {
                return name.endsWith(".png");
            }
        });
        for (File file : listFiles) {
            FileInputStream fileInputStream = null;
            try {
                fileInputStream = new FileInputStream(file);
                byte[] bytes = new byte[fileInputStream.available()];
                IOUtils.readFully(fileInputStream, bytes);
                Icon icon = new Icon();
                icon.setIcon(bytes);
                iconDAO.create(icon);
            } catch (Exception e) {
                Utils.war("Image skipped: " + file.getName());
            } finally {
                Utils.closeStreams(fileInputStream);
            }
        }
        Toast.makeText(this, "Иконки загружены!", Toast.LENGTH_LONG).show();
    }

    private void importDatabase(String file) {
        DaoFactory.importDatabaseFileFrom(this, file);
        Toast.makeText(this, "Импорт завершен!", Toast.LENGTH_LONG).show();
    }

    private void exportDatabase(String directory) {
        DaoFactory.exportDatabaseToFile(this, directory);
        Toast.makeText(this, "Экспорт завершен!", Toast.LENGTH_LONG).show();
    }

    public void onCreateCategoryClicked() {
        run(CreateCategoryController.class);
    }

    public void onCreateModClicked() {
        run(CreateModController.class);
    }

    public void onCreateItemClicked() {
        run(CreateItemController.class);
    }
}


text:
@interface PKListViewController : UIViewController

@property (nonatomic, strong) NSString *redioid;
@property (nonatomic, strong) NSString *auth;
@property (nonatomic, strong) NSString *image;
@property (nonatomic, strong) NSString *str;

@end