text:
import unittest

from portfolio.account import Account
from portfolio.account_builder import AccountBuilder
from portfolio.invalid_account_exception import InvalidAccountException
from valid_options.account_type import AccountType
from valid_options.asset_class import AssetClass
from valid_options.term import Term

class AssetTestCase(unittest.TestCase):

    def setUp(self):
        self.builder = AccountBuilder().set_name("name").set_owner("owner").set_investment("investment").set_institution("institution")

    def test_it_builds_an_account_with_defaults(self):
        account = self.builder.build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.CASH_EQUIVALENTS, "institution": "institution",
                  "account_type": AccountType.ASSET}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_it_sets_an_account_as_a_liability_and_updates_the_asset_class(self):
        account = self.builder.set_liability().build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.NONE, "institution": "institution",
                  "account_type": AccountType.LIABILITY}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_it_sets_an_account_as_a_liability_by_passing_in_the_account_type(self):
        account = self.builder.set_account_type(AccountType.LIABILITY).build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.NONE, "institution": "institution",
                  "account_type": AccountType.LIABILITY}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_it_sets_an_account_as_an_asset(self):
        account = self.builder.set_liability().set_asset().build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.NONE, "institution": "institution",
                  "account_type": AccountType.ASSET}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_it_sets_the_asset_class_of_an_account(self):
        account = self.builder.set_asset_class(AssetClass.ANNUITIES).build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.ANNUITIES, "institution": "institution",
                  "account_type": AccountType.ASSET}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_it_sets_the_update_frequency_of_an_account(self):
        account = self.builder.set_update_frequency(12).build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.CASH_EQUIVALENTS, "institution": "institution",
                  "account_type": AccountType.ASSET}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_it_sets_the_open_date(self):
        account = self.builder.set_open_date("2005-1-1").build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.CASH_EQUIVALENTS, "institution": "institution",
                  "account_type": AccountType.ASSET, "open_date": "2005-1-1"}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_it_sets_the_term(self):
        account = self.builder.set_term(Term.MEDIUM).build()
        params = {"name": "name", "owner": "owner", "investment": "investment",
                  "asset_class": AssetClass.CASH_EQUIVALENTS, "institution": "institution",
                  "account_type": AccountType.ASSET, "term": Term.MEDIUM}
        self.assertTrue(account.is_identical_to(Account(params)))

    def test_the_account_name_is_required(self):
        builder = AccountBuilder().set_owner("owner").set_investment("investment").set_institution("institution")
        self.assertRaises(InvalidAccountException, builder.build)

    def test_the_account_owner_is_required(self):
        builder = AccountBuilder().set_name("name").set_investment("investment").set_institution("institution")
        self.assertRaises(InvalidAccountException, builder.build)

    def test_the_account_investment_is_required(self):
        builder = AccountBuilder().set_name("name").set_owner("owner").set_institution("institution")
        self.assertRaises(InvalidAccountException, builder.build)

    def test_the_account_institution_is_required(self):
        builder = AccountBuilder().set_name("name").set_owner("owner").set_investment("investment")
        self.assertRaises(InvalidAccountException, builder.build)


text:
<?php

class Core_Model_UrlAccess extends Core_Model_Abstract
{
    /**
     * Database table Zend_Db_Table object
     */
    protected $_table;

    /**
     * Table class name
     */
    protected $_dbTableClass = 'Core_Model_DbTable_UrlAccess';

    /**
     * @param array $record
     * Keys - page - URL to be protected no leading and trailing slashes
     *      - privilege - privilege name
     *      - assertion_class - the assertion class name
     */
    public function insertByPrivilegeName($record)
    {
        $table = $this->getTable();
        $toInsert = array(
            'url' => $record['url'],
            'privilege_name' => $record['privilege'],
            'assertion_class' => $record['assertion_class']
        );
        $pageAccessId = $table->insert($toInsert);
        return $pageAccessId;
    }

    /**
     * @param string $url
     * @return string privilege name
     */
    public function getPrivilgeNameFromUrl($url)
    {
        $table = $this->getTable();
        $select = $table->select();
        $select->where('url = ?', $url);

        $cache = $this->getCache();

        $cacheId = md5('Core_Model_UrlAccess_' . $url);
        if (!$result = $cache->load($cacheId)) {
            $result = $table->fetchRow($select);
            $cache->save($result, $cacheId);
        }

        if ($result) {
            $result = $result->toArray();
            $privilegeName = $result['privilege_name'];
            return $privilegeName;
        }
    }

    /**
     * @param string $url
     * @return string assertion class name
     */
    public function getAssertionClass($url)
    {
        $table = $this->getTable();
        $select = $table->select();
        $select->where('url = ?', $url);
        $result = $table->fetchRow($select);
        if ($result) {
            $result = $result->toArray();
            return $result['assertion_class'];
        }
        return;
    }

}

redpajama_set_name: RedPajamaGithub


text:
// Provides control sap.ui.layout.form.GridElementData.
sap.ui.define(['jquery.sap.global', 'sap/ui/core/LayoutData', 'sap/ui/layout/library'],
	function(jQuery, LayoutData, library) {
	"use strict";

	/**
	 * Constructor for a new form/GridElementData.
	 *
	 * @param {string} [sId] id for the new control, generated automatically if no id is given
	 * @param {object} [mSettings] initial settings for the new control
	 *
	 * @class
	 * The grid specific layout data for FormElement fields.
	 * The width property of the elements is ignored since the width is defined by grid cells.
	 * @extends sap.ui.core.LayoutData
	 *
	 * @author SAP SE
	 * @version 1.30.4-SNAPSHOT
	 *
	 * @constructor
	 * @public
	 * @since 1.16.0
	 * @alias sap.ui.layout.form.GridElementData
	 * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
	 */
	var GridElementData = LayoutData.extend("sap.ui.layout.form.GridElementData", /** @lends sap.ui.layout.form.GridElementData.prototype */ { metadata : {

		library : "sap.ui.layout",
		properties : {

			/**
			 * Number of cells in horizontal direction.
			 * If "auto" the size is determined by the number of fields and the available cells. For Labels the auto size is 3 cells.
			 * If "full" only one field is allowed within the element. It gets the full width of the row and the label is displayed above. For Labels Full size has no effect.
			 */
			hCells : {type : "sap.ui.layout.form.GridElementCells", group : "Appearance", defaultValue : 'auto'},

			/**
			 * Number of cells in vertical direction.
			 * This property has no effect for labels.
			 */
			vCells : {type : "int", group : "Appearance", defaultValue : 1}
		}
	}});

	///**
	// * This file defines behavior for the control,
	// */
	//sap.ui.commons.form.GridElementData.prototype.init = function(){
	//   // do something for initialization...
	//};

	return GridElementData;

}, /* bExport= */ true);


text:
package com.github.chrisblutz.trinity.lang.types;

import com.github.chrisblutz.trinity.lang.ClassRegistry;
import com.github.chrisblutz.trinity.lang.TyObject;
import com.github.chrisblutz.trinity.natives.NativeReferences;

/**
 * @author Christopher Lutz
 */
public class TyLong extends TyObject {

    private long internal;

    public TyLong(long internal) {

        super(ClassRegistry.forName(NativeReferences.Classes.LONG, true));

        this.internal = internal;
    }

    public long getInternal() {

        return internal;
    }
}


text:
function [ret] = LatencyEstimateCallback( server, type, data )
%SERVERDEVCALLBACK Summary of this function goes here
    global USER_FIG_TAG; USER_FIG_TAG = 'USER_FIG_TAG';
    global PS; % user parse setting

    global dsDetectsAll;
    global dsDetectsAllEnd;
    global tvgSetting;
    global needToUpdateXLine2;
    global DOWNSAMPLE_FACTOR;
    global dsXMeters;
    global dsSize;
    global userStarts;
    global userEnds;
    global userStartsEnd;
    global userEndsEnd;

    if type == server.CALLBACK_TYPE_ERROR,
        fprintf(2, '[ERROR]: get the error callback data = %s', data);
        return;
    end

    % parse audio data

%--------------------------------------------------------------------------
% 1. init GUI
%--------------------------------------------------------------------------
    if type == server.CALLBACK_TYPE_INIT, % need to create a new UI window
        needToUpdateXLine2 = 1;
        LINE_CNTS = [2,2]; % size of it is the number of figure axes, and the number in it is the number of lines per axe
        createUI(server, USER_FIG_TAG, data, LINE_CNTS);
%--------------------------------------------------------------------------
% 2. data processing and update figures
%--------------------------------------------------------------------------
    elseif type == server.CALLBACK_TYPE_DATA,
        % find detected objects by matched filter
        % where the PS.signalToCorrelate is the reverse of sensing signal
        % and PS.detectRangeStart:PS.detectRangeEnd are determined by the GUI

        REPEAT_CNT = 5;

        for repeat = 1:REPEAT_CNT,
            cons = convn(data, PS.signalToCorrelate, 'same');
        end

        if REPEAT_CNT > 0
            detects = abs(cons(PS.detectRangeStart:PS.detectRangeEnd, :, :));
            traceCnt = size(detects, 2);
            chCnt = size(detects, 3);
        end

        % update line1: data
        check1 = findobj('Tag','check01');
        if check1.Value == 1,
            for chIdx = 1:1,
                line = findobj('Tag',sprintf('line01_%02d',chIdx));
                dataToPlot = data(:,end,chIdx);
                set(line, 'yData', dataToPlot); % only show the 1st ch
            end
        end

        % update line2: detected peaks
        check2 = findobj('Tag','check02');
        if check2.Value == 1,
            for chIdx = 1:1, % TODO: based on channel

            end
        end

        ret = -1;
%--------------------------------------------------------------------------
% 3. handle user data sent from device
%    in this example, click the user button in device will set a tag to
%    remember the location
%--------------------------------------------------------------------------
    elseif type == server.CALLBACK_TYPE_USER,
        data.code
        % parse user data
        % must be 'pse' in this app
        if data.code == 1, % update the vertical line
            userStarts(userStartsEnd+1) = dsDetectsAllEnd-1;
            userStartsEnd = userStartsEnd+1;
        else
            userEnds(userEndsEnd+1) = dsDetectsAllEnd-1;
            userEndsEnd = userEndsEnd+1;
        end
    end
end

%==========================================================================
% Followings are just some UI help functions
%==========================================================================
function createUI(server, figTag, data, lineCnts)
    % lineCnts is the number of lines per figure
    global PS;

    PLOT_AXE_IN_WIDTH = 270;
    PLOT_AXE_OUT_WIDTH = 290;
    PLOT_AXE_CNT = length(lineCnts);

    server.userfig = figure(...
                    'Name', 'Callback', ...
                    'Position',[50,50,550+PLOT_AXE_OUT_WIDTH*(PLOT_AXE_CNT-1),330], ...
                    'Toolbar','none', ...
                    'MenuBar','none', ...
                    'Tag', figTag);
    set(server.userfig, 'UserData', server); % attached the server object to fig property for future reference

    h_panel2 = uipanel(server.userfig,'Units','pixels','Position',[15,15,520+PLOT_AXE_OUT_WIDTH*(PLOT_AXE_CNT-1),300]);
    textIntro = uicontrol(h_panel2,'Style','text','Position',[10,255,180,30],'String','Control the sensing response');

    RANGE_Y = 200;
    RANGE_FONT_SIZE = 15;
    textRange = uicontrol(h_panel2,'Style','text','Position',[25,RANGE_Y-5,50,30],'String','Range:','FontSize',RANGE_FONT_SIZE);
    uicontrol(h_panel2, 'Tag','editRangeStart', 'style','edit','units','pixels','position',[80,RANGE_Y,50,30],'String',num2str(PS.detectRangeStart),'FontSize',RANGE_FONT_SIZE);
    uicontrol(h_panel2, 'Tag','editRangeEnd', 'style','edit','units','pixels','position',[130,RANGE_Y,50,30],'String',num2str(PS.detectRangeEnd),'FontSize',RANGE_FONT_SIZE);

    uicontrol(h_panel2,'Style','pushbutton','Position',[30,130,110,30],'String','Apply','Callback',@buttonApplyCallback);

    UPDATE_LABELS = {'show recorded signals', 'show detected objects'};
    X_LABELS = {'sample', 'meter'};
    for i = 1:PLOT_AXE_CNT,
        uicontrol(h_panel2, 'Style','checkbox','String',UPDATE_LABELS{i},'Value',0,'Position',[220+PLOT_AXE_OUT_WIDTH*(i-1),280,200,20], 'Tag',sprintf('check%02d',i));

        server.axe = axes('Parent',h_panel2,'Units','pixels','Position',[220+PLOT_AXE_OUT_WIDTH*(i-1),30,270,250]);
        hold on;
        for j = 1:lineCnts(i),
            plot(server.axe, data(:,1),'Tag',sprintf('line%02d_%02d',i,j),'linewidth',2); % only show the 1st ch
        end
        hold off;
        xlabel(X_LABELS{i})
        legend(arrayfun(@(x) sprintf('%d',x), 1:lineCnts(i),'uni',false).');
    end
end

% apply ui control to parse value
function buttonApplyCallback(obj, event)
    global PS;
    editRangeStart = findobj('Tag','editRangeStart');
    editRangeEnd = findobj('Tag','editRangeEnd');

    rangeStart = str2num(editRangeStart.String);
    rangeEnd = str2num(editRangeEnd.String);

    if isempty(rangeStart) || isempty(rangeEnd),
        warndlg('Range input must be numerical');
    else
        PS.detectRangeStart = rangeStart;
        PS.detectRangeEnd = rangeEnd;
    end
end


text:
@interface TagChimpPlugin : MZSearchProviderPlugin
{
    NSArray* supportedSearchTags;
    NSMenu* menu;
}

@end


text:
#include <openspace/util/screenlog.h>

#include <algorithm>

namespace openspace {

ScreenLog::ScreenLog(std::chrono::seconds timeToLive, LogLevel logLevel)
    : _timeToLive(std::move(timeToLive))
    , _logLevel(logLevel)
{
    _entries.reserve(64);
}

void ScreenLog::removeExpiredEntries() {
    std::lock_guard guard(_mutex);
    const auto t = std::chrono::steady_clock::now();

    const auto rit = std::remove_if(
        _entries.begin(),
        _entries.end(),
        [&t, ttl = _timeToLive](const LogEntry& e) { return (t - e.timeStamp) > ttl; }
    );

    _entries.erase(rit, _entries.end());
}

void ScreenLog::log(LogLevel level, std::string_view category, std::string_view message) {
    std::lock_guard guard(_mutex);
    if (level >= _logLevel) {
        _entries.push_back({
            level,
            std::chrono::steady_clock::now(),
            Log::timeString(),
            std::string(category),
            std::string(message)
        });
    }
}

const std::vector<ScreenLog::LogEntry>& ScreenLog::entries() const {
    return _entries;
}

} // namespace openspace


text:
package br.ufrn.concorrente;

public class RunCalculations {

    public static void main (String[] args) {

        for (int i = 4; i <= 2048; i *= 2) {

            System.out.printf("Dimension: %d%n%n", i);

            String[] sequential = {String.valueOf(i), "S"};
            Main.main(sequential);

            System.out.println();

            String[] concurrent = {String.valueOf(i), "C"};
            Main.main(concurrent);

            System.out.println();
            System.out.println();
        }
    }
}


text:
package net.glowstone.net.message.play.game;

import com.flowpowered.network.Message;
import lombok.AccessLevel;
import lombok.Data;
import lombok.RequiredArgsConstructor;

/**
 * Documented at http://wiki.vg/Protocol#World_Border
 */
@Data
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public final class WorldBorderMessage implements Message {

    private final Action action;
    private final double radius;
    private final double oldRadius;
    private final double newRadius;
    private final long speed;
    private final double x;
    private final double z;
    private final int portalTeleportBoundary;
    private final int warningTime;
    private final int warningBlocks;

    // SET_SIZE
    public WorldBorderMessage(Action action, double radius) {
        this(action, radius, 0, 0, 0, 0, 0, 0, 0, 0);
    }

    // LERP_SIZE
    public WorldBorderMessage(Action action, double oldRadius, double newRadius, long speed) {
        this(action, 0, oldRadius, newRadius, speed, 0, 0, 0, 0, 0);
    }

    // SET_CENTER
    public WorldBorderMessage(Action action, double x, double z) {
        this(action, 0, 0, 0, 0, x, z, 0, 0, 0);
    }

    // INITIALIZE
    public WorldBorderMessage(Action action, double x, double z, double oldRadius, double newRadius,
                              long speed, int portalTeleportBoundary, int warningTime,
                              int warningBlocks) {
        this(action, 0, oldRadius, newRadius, speed, x, z, portalTeleportBoundary, warningTime,
            warningBlocks);
    }

    /**
     * Creates an instance with a warning threshold.
     *
     * @param action  should be {@link Action#SET_WARNING_TIME} or {@link Action#SET_WARNING_BLOCKS}
     * @param warning the warning threshold, in blocks or seconds
     */
    public WorldBorderMessage(Action action, int warning) {
        if (action == Action.SET_WARNING_TIME) {
            warningTime = warning;
            warningBlocks = 0;
        } else if (action == Action.SET_WARNING_BLOCKS) {
            warningBlocks = warning;
            warningTime = 0;
        } else {
            warningTime = 0;
            warningBlocks = 0;
        }
        this.action = action;
        radius = 0;
        oldRadius = 0;
        newRadius = 0;
        speed = 0;
        x = 0;
        z = 0;
        portalTeleportBoundary = 0;
    }

    public enum Action {
        SET_SIZE,
        LERP_SIZE,
        SET_CENTER,
        INITIALIZE,
        SET_WARNING_TIME,
        SET_WARNING_BLOCKS;

        public static Action getAction(int id) {
            Action[] values = values();
            return id < 0 || id >= values.length ? null : values[id];
        }
    }

}


text:
Ein Pull-Request (PR) ermöglicht es dir, Änderungen von deinem Fork auf GitHub an FreeCodeCamp.orgs Hauptrepository zu senden. Wenn du mit den Änderungen am Code fertig bist, kannst du diese Richtlinien befolgen, um einen PR zu eröffnen.

> [!NOTE] Dein PR sollte in Englisch verfasst sein. Schaue [hier](index.md#translations) nach, wie du Übersetzungen beisteuern kannst.

## Bereite einen guten PR-Titel vor

Wir empfehlen, [konventionelle Titel und Nachrichten](https://www.conventionalcommits.org/) für Commits und Pull-Requests zu verwenden. Die Konvention hat das folgende Format:

> `<type>([optional scope(s)]): <description>`
>
> Zum Beispiel:
>
> `fix(learn): tests for the do...while loop challenge`

Wenn du einen Pull-Request (PR) öffnest, kannst du den Typ, den Geltungsbereich \[scope\] (optional) und die Beschreibung wie folgt festlegen.

**Typ:**

| Typ   | Wann wählen                                                                                |
|:----- |:------------------------------------------------------------------------------------------------ |
| fix   | Geänderte oder aktualisierte/verbesserte Funktionalität, Tests, der Wortlaut einer Lektion, usw. |
| feat  | Nur wenn du neue Funktionen, Tests usw. hinzufügst.                                              |
| chore | Änderungen, die sich nicht auf den Code, die Tests oder den Wortlaut einer Lektion beziehen.     |
| docs  | Änderungen im Verzeichnis `/docs` oder in den Mitwirkungsrichtlinien, etc.                       |

**Geltungsbereich (Scope):**

Du kannst einen Geltungsbereich aus [dieser Liste von Labels](https://github.com/freeCodeCamp/freeCodeCamp/labels?q=scope) auswählen.

**Beschreibung:**

Halte sie kurz (weniger als 30 Zeichen) und einfach. Du kannst weitere Informationen im PR-Beschreibungsfeld und in den Kommentaren hinzufügen.

Einige Beispiele für gute PR-Titel wären:

- `fix(a11y): improved search bar contrast`
- `feat: add more tests to HTML and CSS challenges`
- `fix(api,client): prevent CORS errors on form submission`
- `docs(i18n): Chinese translation of local setup`

## Einen Pull-Request vorschlagen

1. Sobald die Änderungen übertragen wurden, wirst du aufgefordert, einen Pull-Request auf der GitHub-Seite deines Forks zu erstellen.

   ![Bild - Vergleiche & Pull-Request Aufforderung auf GitHub](https://contribute.freecodecamp.org/images/github/compare-pull-request-prompt.png)

2. Grundsätzlich sollten alle Pull-Requests gegen das Haupt-Repository von freeCodeCamp, den `main`-Branch, gerichtet sein.

   Stelle sicher, dass dein Base Fork auf freeCodeCamp/freeCodeCamp eingestellt ist, wenn du einen Pull-Request einreichst.

   ![Bild - Vergleiche Gabelungen beim Pull Request](https://contribute.freecodecamp.org/images/github/comparing-forks-for-pull-request.png)

3. Übermittle den Pull-Request von deinem Branch an den `main`-Branch von freeCodeCamp.

4. Im Hauptteil deines PR fügst du eine ausführlichere Zusammenfassung der Änderungen ein, die du vorgenommen hast und warum.

   - Du erhältst eine Vorlage für einen Pull-Request. Dies ist eine Checkliste, die du befolgen solltest, bevor du den Pull-Request öffnest.

   - Fülle die Details so aus, wie du es für richtig hältst. Diese Informationen werden geprüft und die Prüfer entscheiden, ob dein Pull-Request angenommen wird oder nicht.

   - Wenn der PR ein bestehendes GitHub Problem beheben soll, dann am Ende von der Beschreibungstext deines PR verwenden Sie das Schlüsselwort _Schließt_ mit der Ticketnummer zu [automatisch schließen, wenn der PR akzeptiert und zusammengeführt wird](https://help.github.com/en/articles/closing-issues-using-keywords).

     > Beispiel: `Closes #123` wird Issue 123 schließen

5. Gib an, ob du auf einer lokalen Kopie der Website getestet hast oder nicht.

   - Das ist sehr wichtig, wenn du Änderungen vornimmst, die nicht nur Textinhalte wie die Dokumentation oder eine Aufgabenbeschreibung betreffen. Beispiele für Änderungen, die lokal getestet werden müssen, sind JavaScript, CSS oder HTML, die die Funktionalität oder das Layout einer Seite verändern könnten.

   - Wenn dein PR das Verhalten einer Seite beeinflusst, sollte er von entsprechenden [Cypress Integrationstests](how-to-add-cypress-tests.md) begleitet werden.

## Feedback zu Pull-Requests

> Glückwunsch! :tada: für die Erstellung eines PR und vielen Dank, dass du dir die Zeit genommen haben, einen Beitrag zu leisten.

Unsere Moderatoren werden jetzt einen Blick darauf werfen und dir ein Feedback hinterlassen. Bitte habe Geduld mit den anderen Moderatoren und respektiere ihre Zeit. Alle Pull-Requests werden zu gegebener Zeit überprüft.

Und wie immer kannst du Fragen in der [Kategorie 'Contributors' in unserem Forum](https://forum.freecodecamp.org/c/contributors) oder im [Chatraum für Mitwirkende](https://chat.freecodecamp.org/channel/contributors) stellen.

> [!TIP] Wenn du mehr Pull-Requests beisteuern willst, empfehlen wir dir, die [Richtlinien für Änderungen und Synchronisierung](how-to-setup-freecodecamp-locally.md#making-changes-locally) zu lesen, damit du deinen Fork nicht löschen musst.

## Konflikte bei Pull-Requests

Es kann zu Konflikten kommen, weil viele Mitwirkende an dem Repository arbeiten und Änderungen deinen PR zerstören können, der noch auf eine Überprüfung und Zusammenführung wartet.

In den meisten Fällen brauchst du keinen Rebase, da wir alle Commits vernichten. Wenn jedoch ein Rebase verlangt wird, solltest du wie folgt vorgehen.

### Für die üblichen Fehlerbehebungen und Funktionen

Wenn du an regulären Bugs und Features auf unserem Entwicklungszweig `main` arbeitest, kannst du einen einfachen Rebase durchführen:

1. Rebase deiner lokalen Kopie:

   ```console
   git checkout <pr-branch>
   git pull --rebase upstream main
   ```

2. Löse alle Konflikte und füge Commits hinzu / bzw. bearbeite sie

   ```console
   # Either
   git add .
   git commit -m "chore: resolve conflicts"

   # Or
   git add .
   git commit --amend --no-edit
   ```

3. Schiebe deine Änderungen in den PR zurück

   ```console
   git push --force origin <pr-branch>
   ```

### Für anstehende Studienpläne und Features

Wenn du an Funktionen für unseren kommenden `next-*`-Branch arbeitest, musst du Rosinenpickerei betreiben:

1. Achte darauf, dass dein Upstream mit deinem Local übereinstimmt:

   ```console
   git checkout main
   git fetch --all --prune
   git checkout next-python-projects
   git reset --hard upstream/next-python-projects
   ```

2. Backup erstellen

   a. Entweder löschst du deinen lokalen Branch, nachdem du ein Backup gemacht hast (wenn du ihn noch lokal hast):

   ```console
   git checkout <pr-branch-name>

   # Beispiel:
   # git checkout feat/add-numpy-video-question

   git checkout -b <backup-branch-name>

   # Beispiel:
   #  git checkout -b backup-feat/add-numpy-video-question

   git branch -D <pr-branch-name>
   ```

   b. Oder einfach ein Backup deines PR-Branch (wenn du ihn nicht lokal hast):

   ```console
   git checkout -b <backup-branch-name> origin/<pr-branch-name>

   # Beispiel:
   #  git checkout -b backup-feat/add-numpy-video-question origin/feat/add-numpy-video-question
   ```

3. Beginne mit einer weißen Weste:

   ```console
   git checkout -b <pr-branch-name> next-python-projects
   git cherry-pick <commit-hash>
   ```

4. Beseitige alle Konflikte und räume auf, installiere Tests und führe sie durch

   ```console
   npm run clean

   npm ci
   npm run test:curriculum --superblock=<superblock-name>

   # Beispiel:

   # npm run test:curriculum --superblock=python-for-everyone

   ```

5. Wenn alles gut aussieht, schickst du es zurück an den PR

   ```console
   git push --force origin <pr-branch-name>
   ```


text:
'use strict';

const models = require('./index');

/**
 * The properties used to create a new server.
 *
 * @extends models['ServerPropertiesForCreate']
 */
class ServerPropertiesForDefaultCreate extends models['ServerPropertiesForCreate'] {
  /**
   * Create a ServerPropertiesForDefaultCreate.
   * @member {string} administratorLogin The administrator's login name of a
   * server. Can only be specified when the server is being created (and is
   * required for creation).
   * @member {string} administratorLoginPassword The password of the
   * administrator login.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ServerPropertiesForDefaultCreate
   *
   * @returns {object} metadata of ServerPropertiesForDefaultCreate
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Default',
      type: {
        name: 'Composite',
        className: 'ServerPropertiesForDefaultCreate',
        modelProperties: {
          storageMB: {
            required: false,
            serializedName: 'storageMB',
            constraints: {
              InclusiveMinimum: 1024
            },
            type: {
              name: 'Number'
            }
          },
          version: {
            required: false,
            serializedName: 'version',
            type: {
              name: 'String'
            }
          },
          sslEnforcement: {
            required: false,
            serializedName: 'sslEnforcement',
            type: {
              name: 'Enum',
              allowedValues: [ 'Enabled', 'Disabled' ]
            }
          },
          createMode: {
            required: true,
            serializedName: 'createMode',
            type: {
              name: 'String'
            }
          },
          administratorLogin: {
            required: true,
            serializedName: 'administratorLogin',
            type: {
              name: 'String'
            }
          },
          administratorLoginPassword: {
            required: true,
            serializedName: 'administratorLoginPassword',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ServerPropertiesForDefaultCreate;


text:
package weixin.popular.bean.bizwifi.shop.list;

import java.util.List;

/**
 * @ProjectName weixin-popular
 * @Author: zeroJun
 * @Date: 2018/7/24 16:38
 * @Description:
 */
public class ShopListResultData {
    private Integer totalcount;
    private Integer pageindex;
    private Integer pagecount;
    private List<Records> records;

    public Integer getTotalcount() {
        return totalcount;
    }

    public void setTotalcount(Integer totalcount) {
        this.totalcount = totalcount;
    }

    public Integer getPageindex() {
        return pageindex;
    }

    public void setPageindex(Integer pageindex) {
        this.pageindex = pageindex;
    }

    public Integer getPagecount() {
        return pagecount;
    }

    public void setPagecount(Integer pagecount) {
        this.pagecount = pagecount;
    }

    public List<Records> getRecords() {
        return records;
    }

    public void setRecords(List<Records> records) {
        this.records = records;
    }

    public static class Records {
        private Integer shop_id;
        private String shop_name;
        private String ssid;
        private List<String> ssid_list;
        private Integer protocol_type;
        private String sid;
        private String poi_id;

        public Integer getShop_id() {
            return shop_id;
        }

        public void setShop_id(Integer shop_id) {
            this.shop_id = shop_id;
        }

        public String getShop_name() {
            return shop_name;
        }

        public void setShop_name(String shop_name) {
            this.shop_name = shop_name;
        }

        public String getSsid() {
            return ssid;
        }

        public void setSsid(String ssid) {
            this.ssid = ssid;
        }

        public List<String> getSsid_list() {
            return ssid_list;
        }

        public void setSsid_list(List<String> ssid_list) {
            this.ssid_list = ssid_list;
        }

        public Integer getProtocol_type() {
            return protocol_type;
        }

        public void setProtocol_type(Integer protocol_type) {
            this.protocol_type = protocol_type;
        }

        public String getSid() {
            return sid;
        }

        public void setSid(String sid) {
            this.sid = sid;
        }

        public String getPoi_id() {
            return poi_id;
        }

        public void setPoi_id(String poi_id) {
            this.poi_id = poi_id;
        }
    }
}


text:
package com.zimbra.soap.account.message;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import com.zimbra.common.soap.AccountConstants;
import com.zimbra.soap.account.type.DistributionListSubscribeStatus;

@XmlRootElement(name=AccountConstants.E_SUBSCRIBE_DISTRIBUTION_LIST_RESPONSE)
public class SubscribeDistributionListResponse {

    /**
     * @zm-api-field-description Status of subscription attempt
     */
    @XmlAttribute(name=AccountConstants.A_STATUS, required=true)
    private DistributionListSubscribeStatus status;

    public SubscribeDistributionListResponse() {
        this((DistributionListSubscribeStatus) null);
    }
    public SubscribeDistributionListResponse(DistributionListSubscribeStatus status) {
        this.status = status;
    }

    public DistributionListSubscribeStatus getStatus() { return status; }
}


text:
.class public final Landroid/net/UidRange;
.super Ljava/lang/Object;
.source "UidRange.java"

# interfaces
.implements Landroid/os/Parcelable;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/net/UidRange$1;
    }
.end annotation

# static fields
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/Parcelable$Creator",
            "<",
            "Landroid/net/UidRange;",
            ">;"
        }
    .end annotation
.end field

# instance fields
.field public final start:I

.field public final stop:I

# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Landroid/net/UidRange$1;

    invoke-direct {v0}, Landroid/net/UidRange$1;-><init>()V

    sput-object v0, Landroid/net/UidRange;->CREATOR:Landroid/os/Parcelable$Creator;

    return-void
.end method

.method public constructor <init>(II)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    if-gez p1, :cond_0

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "Invalid start UID."

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    if-gez p2, :cond_1

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "Invalid stop UID."

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_1
    if-le p1, p2, :cond_2

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "Invalid UID range."

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_2
    iput p1, p0, Landroid/net/UidRange;->start:I

    iput p2, p0, Landroid/net/UidRange;->stop:I

    return-void
.end method

.method public static createForUser(I)Landroid/net/UidRange;
    .locals 4

    const v3, 0x186a0

    new-instance v0, Landroid/net/UidRange;

    mul-int v1, p0, v3

    add-int/lit8 v2, p0, 0x1

    mul-int/2addr v2, v3

    add-int/lit8 v2, v2, -0x1

    invoke-direct {v0, v1, v2}, Landroid/net/UidRange;-><init>(II)V

    return-object v0
.end method

# virtual methods
.method public contains(I)Z
    .locals 2

    const/4 v0, 0x0

    iget v1, p0, Landroid/net/UidRange;->start:I

    if-gt v1, p1, :cond_0

    iget v1, p0, Landroid/net/UidRange;->stop:I

    if-gt p1, v1, :cond_0

    const/4 v0, 0x1

    :cond_0
    return v0
.end method

.method public containsRange(Landroid/net/UidRange;)Z
    .locals 3

    const/4 v0, 0x0

    iget v1, p0, Landroid/net/UidRange;->start:I

    iget v2, p1, Landroid/net/UidRange;->start:I

    if-gt v1, v2, :cond_0

    iget v1, p1, Landroid/net/UidRange;->stop:I

    iget v2, p0, Landroid/net/UidRange;->stop:I

    if-gt v1, v2, :cond_0

    const/4 v0, 0x1

    :cond_0
    return v0
.end method

.method public describeContents()I
    .locals 1

    const/4 v0, 0x0

    return v0
.end method

.method public equals(Ljava/lang/Object;)Z
    .locals 5

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-ne p0, p1, :cond_0

    return v1

    :cond_0
    instance-of v3, p1, Landroid/net/UidRange;

    if-eqz v3, :cond_2

    move-object v0, p1

    check-cast v0, Landroid/net/UidRange;

    iget v3, p0, Landroid/net/UidRange;->start:I

    iget v4, v0, Landroid/net/UidRange;->start:I

    if-ne v3, v4, :cond_1

    iget v3, p0, Landroid/net/UidRange;->stop:I

    iget v4, v0, Landroid/net/UidRange;->stop:I

    if-ne v3, v4, :cond_1

    :goto_0
    return v1

    :cond_1
    move v1, v2

    goto :goto_0

    :cond_2
    return v2
.end method

.method public getStartUser()I
    .locals 2

    iget v0, p0, Landroid/net/UidRange;->start:I

    const v1, 0x186a0

    div-int/2addr v0, v1

    return v0
.end method

.method public hashCode()I
    .locals 3

    const/16 v0, 0x11

    iget v1, p0, Landroid/net/UidRange;->start:I

    add-int/lit16 v0, v1, 0x20f

    mul-int/lit8 v1, v0, 0x1f

    iget v2, p0, Landroid/net/UidRange;->stop:I

    add-int v0, v1, v2

    return v0
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    iget v1, p0, Landroid/net/UidRange;->start:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "-"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/net/UidRange;->stop:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .locals 1

    iget v0, p0, Landroid/net/UidRange;->start:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    iget v0, p0, Landroid/net/UidRange;->stop:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    return-void
.end method


text:
(function () {

  angular.module('app.controllers.queue', [
    'app.models.song',
    'app.models.playlist',
    'app.services.app.playlists',
    'app.services.lastfmFeeds',
    'app.services.soundcloudControl',
    'app.services.actions.playerActions'
  ])

    .controller('QueueController', QueueController);

  QueueController.$inject = ['playerActions', '$rootScope', '$store', 'app', 'lastfmFeedsFactory', 'soundcloudControl', '$timeout', 'PlaylistModel', 'SongModel', 'playlists', '$scope'];

  function QueueController(playerActions, $rootScope, $store, app, lastfmFeedsFactory, soundcloudControl, $timeout, PlaylistModel, SongModel, playlists, $scope) {

    $store.bind('playerStore', $scope);

    $scope.app = app;

    $scope.playlistTable = {
      order: '-queuePosition'
    };

    $scope.totalResults = 0;
    $scope.itemsLoaded = 0;
    $scope.currentPage = 0;
    $scope.gotResults = false;
    $scope.columnWidths = app.columnWidths.playlist;

    $scope.$watch(function () {
      return $scope.$stores.playerStore.currentSong;
    }, function (song) {
      var playlist = $scope.$stores.playerStore.currentPlaylist;

      if (song != null && playlist != null) {
        $scope.playlist = playlist.copy(function (song) {
          return song._id !== $scope.$stores.playerStore.currentSong._id;
        });

        $scope.songs = $scope.playlist.songs();
      }
    });

    $scope.saveColumnWidths = function () {
      app.userSettings.set('columnWidths.playlist', $scope.columnWidths);
      app.userSettings.save();
    };

    $scope.songKeyBindings = {
      enter: 'playSong($event, song)'
    };

    $scope.playSong = function($event, song){
      if (! $event.ctrlKey && ! $event.metaKey) {
        $event.preventDefault();
        playerActions.setSong(song);
        playerActions.play();
      }
    };

    $scope.$on('shava:resize', function () {
      $scope.updateColumnWidths();
    });

    $scope.$on('$destroy', function () {
      if ($scope.playlist != null) {
        $scope.playlist.destroy();
      }
    });

    $scope.updateColumnWidths = function () {
      $scope.playlistHeaderWidth = $scope.columnWidths[0] +
        $scope.columnWidths[1] + $scope.columnWidths[2] +
        $scope.columnWidths[3];
    };

    $scope.selectableOpts = {
      onSelect: 'updateSelectables($object, $selected)',
      selectAll: true,
      multi: true,
      selected: []
    };

    $scope.updateSelectables = function (obj, selected) {
      obj.selected = selected;
    };

    $scope.updateColumnWidths();
  }

})();


text:
var React = require('react');
var ReactDOM = require('react-dom');

window.clooca = window.parent.window.clooca;

function ModelExplorer() {
	this.callbacks = [];
}

ModelExplorer.prototype.hasMethod = function(methodName) {
	return !!this[methodName];
};

ModelExplorer.prototype.recvRequest = function(methodName, params) {
	return this[methodName](params);
};

ModelExplorer.prototype.onSelect = function(callback) {
	this.callbacks.push(callback);
};

ModelExplorer.prototype.fireSelectEvent = function(elem) {
	this.callbacks.forEach(function(cb) {
		cb(elem);
	})
};

var modelExplorer = new ModelExplorer();

clooca.registerPlugin('explorer', modelExplorer);

var ExplorerComponent = require('./components/explorer');

var mainEl = (
<ExplorerComponent modelExplorer={modelExplorer}></ExplorerComponent>
);
ReactDOM.render(mainEl, document.getElementById('main'));


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;

namespace UnityEngine.Experimental.VFX.Utility
{
    [ExecuteInEditMode, RequireComponent(typeof(VFXParameterBinder))]
    public abstract class VFXBinderBase : MonoBehaviour
    {
        protected VFXParameterBinder binder;

        public abstract bool IsValid(VisualEffect component);

        public virtual void Reset()
        {
            //Optional method allowing potential manual state reset of binder
        }

        protected virtual void Awake()
        {
            binder = GetComponent<VFXParameterBinder>();
        }

        protected virtual void OnEnable()
        {
            if (!binder.m_Bindings.Contains(this))
                binder.m_Bindings.Add(this);

            hideFlags = HideFlags.HideInInspector; // Comment to debug
        }

        protected virtual void OnDisable()
        {
            if (binder.m_Bindings.Contains(this))
                binder.m_Bindings.Remove(this);
        }

        public abstract void UpdateBinding(VisualEffect component);

        public override string ToString()
        {
            return GetType().ToString();
        }
    }
}


text:
package org.broadinstitute.hellbender.tools.picard.illumina.parser;

import htsjdk.samtools.util.CloseableIterator;
import org.broadinstitute.hellbender.tools.picard.illumina.parser.readers.BclQualityEvaluationStrategy;
import org.broadinstitute.hellbender.tools.picard.illumina.parser.readers.BclReader;

import java.io.File;
import java.util.*;

import static htsjdk.samtools.util.CollectionUtil.makeSet;
import static java.lang.Integer.MIN_VALUE;
import static java.lang.Math.max;
import static java.util.Collections.unmodifiableSet;
import static org.broadinstitute.hellbender.tools.picard.illumina.parser.IlluminaDataType.BaseCalls;
import static org.broadinstitute.hellbender.tools.picard.illumina.parser.IlluminaDataType.QualityScores;

/**
 * BclParser parses a number of BclFiles equal to the total of all the values in outputLengths and returns a BclData object
 * segmented based on these lengths.  The only client of this class should be IlluminaDataProvider and an test classes.  See BclReader for
 * more information on BclFiles.  BclParser provides support for reading BaseCalls and QualityScores.
 */
class BclParser extends PerTileCycleParser<BclData> {
    private static final int EAMSS_M2_GE_THRESHOLD = 30;
    private static final int EAMSS_S1_LT_THRESHOLD = 15; //was 15
    public static final byte MASKING_QUALITY = (byte) 0x02;

    private static final Set<IlluminaDataType> SUPPORTED_TYPES = unmodifiableSet(makeSet(BaseCalls, QualityScores));

    protected final BclQualityEvaluationStrategy bclQualityEvaluationStrategy;
    private final boolean applyEamssFilter;

    public BclParser(final File directory, final int lane, final CycleIlluminaFileMap tilesToCycleFiles, final OutputMapping outputMapping, final BclQualityEvaluationStrategy bclQualityEvaluationStrategy) {
        this(directory, lane, tilesToCycleFiles, outputMapping, true, bclQualityEvaluationStrategy);
        this.initialize();
    }

    public BclParser(final File directory, final int lane, final CycleIlluminaFileMap tilesToCycleFiles, final OutputMapping outputMapping, final boolean applyEamssFilter, final BclQualityEvaluationStrategy bclQualityEvaluationStrategy) {
        super(directory, lane, tilesToCycleFiles, outputMapping);
        this.bclQualityEvaluationStrategy = bclQualityEvaluationStrategy;
        this.applyEamssFilter = applyEamssFilter;
        this.initialize();
    }

    /**
     * Create a Bcl parser for an individual cycle and wrap it with the CycleFilesParser interface which populates
     * the correct cycle in BclData.
     *
     * @param files The files to parse.
     * @return A CycleFilesParser that populates a BclData object with data for a single cycle
     */
    @Override
    protected CycleFilesParser<BclData> makeCycleFileParser(final List<File> files) {
        return new BclDataCycleFileParser(files);
    }

    @Override
    public void initialize() {
        seekToTile(currentTile);
    }

    @Override
    public Set<IlluminaDataType> supportedTypes() {
        return SUPPORTED_TYPES;
    }

    @Override
    public BclData next() {
        final BclData bclData = super.next();

        final byte[][] bases = bclData.getBases();
        final byte[][] qualities = bclData.getQualities();

        //first run EAMSS
        if (this.applyEamssFilter) {
            for (int i = 0; i < bases.length; i++) {
                runEamssForReadInPlace(bases[i], qualities[i]);
            }
        }

        return bclData;
    }

    /**
     * EAMSS is an Illumina Developed Algorithm for detecting reads whose quality has deteriorated towards
     * their end and revising the quality to the masking quality (2) if this is the case.  This algorithm
     * works as follows (with one exception):
     *

     * Start at the end (high indices, at the right below) of the read and calculate an EAMSS tally at each
     * location as follow:
     * if(quality[i] < 15) tally += 1
     * if(quality[i] >= 15 and < 30) tally = tally
     * if(quality[i] >= 30) tally -= 2
     *

     *

     * For each location, keep track of this tally (e.g.)
     * Read Starts at <- this end
     * Cycle:       1  2  3  4  5  6  7  8  9
     * Bases:       A  C  T  G  G  G  T  C  A
     * Qualities:   32 32 16 15 8  10 32 2  2
     * Cycle Score: -2 -2 0  0  1  1  -2 1  1           //The EAMSS Score determined for this cycle alone
     * EAMSS TALLY: 0  0  2  2  2  1  0  2  1
     * X - Earliest instance of Max-Score
     *

     * You must keep track of the maximum EAMSS tally (in this case 2) and the earliest(lowest) cycle at which
     * it occurs.  If and only if, the max EAMSS tally >= 1 then from there until the end(highest cycle) of the
     * read reassign these qualities as 2 (the masking quality).  The output qualities would therefore be
     * transformed from:
     *

     * Original Qualities: 32 32 16 15 8  10 32 2  2    to
     * Final    Qualities: 32 32 2  2  2  2  2  2  2
     * X - Earliest instance of max-tally/end of masking
     *

     * IMPORTANT:
     * The one exception is: If the max EAMSS Tally is preceded by a long string of G basecalls (10 or more, with a single basecall exception per10 bases)
     * then the masking continues to the beginning of that string of G's. E.g.:
     *

     * Cycle:       1  2  3  4  5  6  7  8   9  10 11 12 13 14 15 16 17 18
     * Bases:       C  T  A  C  A  G  A  G   G  G  G  G  G  G  G  C  A  T
     * Qualities:   30 22 26 27 28 30 7  34  20 19 38 15 32 32 10 4  2  5
     * Cycle Score: -2  0  0  0  0 -2 1  -2  0  0  -2 0  -2 -2  1 1  1  1
     * EAMSS TALLY: -2 -5 -5 -5 -5 -5 -3 -4 -2 -2  -2 0   0  2  4 3  2  1
     * X- Earliest instance of Max-Tally
     *

     * Resulting Transformation:
     * Bases:                C  T  A  C  A  G  A   G   G  G  G  G  G  G  G  C  A  T
     * Original Qualities:   30 22 26 27 28 30 7  34  20 19 38 15 32 32 10  4  2  5
     * Final    Qualities:   30 22 26 27 28  2 2   2   2  2  2  2  2  2  2  2  2  2
     * X- Earliest instance of Max-Tally
     * X - Start of EAMSS masking due to G-Run
     *

     * To further clarify the exception rule here are a few examples:
     * A C G A C G G G G G G G G G G G G G G G G G G G G A C T
     * X - Earliest instance of Max-Tally
     * X - Start of EAMSS masking (with a two base call jump because we have 20 bases in the run already)
     *

     * T T G G A G G G G G G G G G G G G G G G G G G A G A C T
     * X - Earliest instance of Max-Tally
     * X - We can skip this A as well as the earlier A because we have 20 or more bases in the run already
     * X - Start of EAMSS masking (with a two base call jump because we have 20 bases in the run)
     *

     * T T G G G A A G G G G G G G G G G G G G G G G G G T T A T
     * X - Earliest instance of Max-Tally
     * X X - WE can skip these bases because the first A counts as the first skip and as far as the length of the string of G's is
     * concerned, these are both counted like G's
     * X - This A is the 20th base in the string of G's and therefore can be skipped
     * X - Note that the A's previous to the G's are only included because there are G's further on that are within the number
     * of allowable exceptions away (i.e. 2 in this instance), if there were NO G's after the A's you CANNOT count the A's
     * as part of the G strings (even if no exceptions have previously occured) In other words, the end of the string of G's
     * MUST end in a G not an "exception"
     *

     * However, if the max-tally occurs to the right of the run of Gs then this is still part of the string of G's but does count towards
     * the number of exceptions allowable
     * (e.g.)
     * T T G G G G G G G G G G A C G
     * X - Earliest instance of Max-tally
     * The first index CAN be considered as an exception, the above would be masked to
     * the following point:
     * T T G G G G G G G G G G A C G
     * X - End of EAMSS masking due to G-Run
     *

     * To sum up the final points, a string of G's CAN START with an exception but CANNOT END in an exception.
     *
     * @param bases     Bases for a single read in the cluster ( not the entire cluster )
     * @param qualities Qualities for a single read in the cluster ( not the entire cluster )
     */
    protected static void runEamssForReadInPlace(final byte[] bases, final byte[] qualities) {
        int eamssTally = 0;
        int maxTally = MIN_VALUE;
        int indexOfMax = -1;

        for (int i = bases.length - 1; i >= 0; i--) {
            final int quality = (0xff & qualities[i]);

            if (quality >= EAMSS_M2_GE_THRESHOLD) {
                eamssTally -= 2;
            } else if (quality < EAMSS_S1_LT_THRESHOLD) {
                eamssTally += 1;
            }

            if (eamssTally >= maxTally) {
                indexOfMax = i;
                maxTally = eamssTally;
            }
        }

        if (maxTally >= 1) {
            int numGs = 0;
            int exceptions = 0;

            for (int i = indexOfMax; i >= 0; i--) {
                if (bases[i] == 'G') {
                    ++numGs;
                } else {
                    final Integer skip = skipBy(i, numGs, exceptions, bases);
                    if (skip != null) {
                        exceptions += skip;
                        numGs += skip;
                        i -= (skip - 1);
                    } else {
                        break;
                    }
                }
            }

            if (numGs >= 10) {
                indexOfMax = (indexOfMax + 1) - numGs;
            }

            for (int i = indexOfMax; i < qualities.length; i++) {
                qualities[i] = MASKING_QUALITY;
            }
        }
    }

    /**
     * Determine whether or not the base at index is part of a skippable section in a run of G's, if so
     * return the number of bases that the section is composed of.
     *
     * @param index          Current index, which should be the index of a non-'G' base
     * @param numGs          The number of bases in the current string of G's for this read
     * @param prevExceptions The number of exceptions previously detected in this string by this method
     * @param bases          The bases of this read
     * @return If we have not reached our exception limit (1/every 10bases) and a G is within exceptionLimit(numGs/10)
     * indices before the current index then return index - (index of next g), else return null  Null indicates this is
     * NOT a skippable region, if we run into index 0 without finding a g then NULL is also returned
     */
    private static Integer skipBy(final int index, final int numGs, final int prevExceptions, final byte[] bases) {
        Integer skip = null;
        for (int backup = 1; backup <= index; backup++) {
            final int exceptionLimit = max((numGs + backup) / 10, 1);
            if (prevExceptions + backup > exceptionLimit) {
                break;
            }
            if (bases[index - backup] == 'G') {
                skip = backup;
                break;
            }
        }

        return skip;
    }

    private class BclDataCycleFileParser implements CycleFilesParser<BclData> {
        final CloseableIterator<BclData> reader;

        public BclDataCycleFileParser(final List<File> files) {
            reader = new BclReader(files, outputMapping.getOutputReadLengths(),
                    bclQualityEvaluationStrategy, false);
        }

        @Override
        public void close() {
            reader.close();
        }

        @Override
        public BclData next() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            return reader.next();
        }

        @Override
        public boolean hasNext() {
            try {
                return reader.hasNext();
            } catch (final NullPointerException npe) {
                return false;
            }
        }
    }
}


text:
#ifndef FORMPRINCIPAL_H_
#define FORMPRINCIPAL_H_

#include <QtWidgets/qdesktopwidget.h>
#include <QtWidgets/qfiledialog.h>
#include <QtWidgets/qmainwindow.h>
#include <QtWidgets/qmenubar.h>

#include "controle/ControladorUI.h"
#include "gui/forms/ui/ui_FormPrincipal.h"
#include "gui/Viewport.h"

/**
 * Formulário principal.
 */
class FormPrincipal : public QMainWindow, private Ui::FormPrincipal {
	Q_OBJECT

public:
	/**
	 * Construtor.
	 * @param controladorUI controlador da interface gráfica.
	 * @param pai formulário pai.
	 * @param flags flags de propriedades do formulário.
	 */
	FormPrincipal(ControladorUI* controladorUI, QDialog* pai = 0, Qt::WindowFlags flags = Qt::Widget);

	/**
	 * Destrutor.
	 */
	virtual ~FormPrincipal();

	/**
	 * Mover o formulário para o centro.
	 */
	void centralizar();

	/**
	 * Obter o controlador de interface gráfica.
	 * @return o controlador.
	 */
	ControladorUI* getControladorUI();

	/**
	 * Atualizar a cena.
	 * @param objetos objetos a serem desenhados.
	 */
	void atualizarCena(const QList<ObjetoGeometrico*>& objetos);

protected:
	/**
	 * Conectar os sinais e slots dos objetos do formulário.
	 */
	void conectarSinaisSlots();

	/**
	 * Inicializar o menu da janela.
	 */
	void inicializarMenu();

private slots:
	/**
	 * Botão de zoom in pressionado.
	 */
	void zoomIn();

	/**
	 * Botão de zoom out pressionado.
	 */
	void zoomOut();

	/**
	 * Atualizar zoom.
	 * @param valorAtual valor atual de zoom.
	 */
	void atualizarZoom(int valorAtual);

	/**
	 * Botão de navegação para cima pressionado.
	 */
	void navegarCima();

	/**
	 * Botão de navegação para a esquerda pressionado.
	 */
	void navegarEsquerda();

	/**
	 * Botão de navegação para a direita pressionado.
	 */
	void navegarDireita();

	/**
	 * Botão de navegação para baixo pressionado.
	 */
	void navegarBaixo();

	/**
	 * Rotacionar a visualização.
	 * @param valorAtual valor atual de rotação.
	 */
	void rotacionarVisualizacao(int valorAtual);

	/**
	 * Reiniciar a visualização para as configurações padrão.
	 */
	void reiniciarVisualizacao();

	/**
	 * Botão de inserir objeto pressionado.
	 */
	void inserirObjeto();

	/**
	 * Botão de remover objeto pressionado.
	 */
	void removerObjeto();

	/**
	 * Botão de transformar objeto pressionado.
	 */
	void transformarObjeto();

	/**
	 * Botão de importar cena pressionado.
	 */
	void importarCena();

	/**
	 * Botão de importar cena pressionado.
	 */
	void importarCenaPreDefinida();

	/**
	 * Botão de exportar cena pressionado.
	 */
	void exportarCena();

	/**
	 * Botão de limpar cena pressionado.
	 */
	void limparCena();

	/**
	 * Ver atalhos do sistema.
	 */
	void atalhosSistema();

	/**
	 * Ver informações sobre o sistema.
	 */
	void sobreSistema();

	/**
	 * Encerrar o sistema.
	 */
	void encerrarSistema();

	/**
	 * Atualizar eixo de rotação atual.
	 * @param selecionado opção foi selecionada.
	 */
	void atualizarEixoRotacao(bool selecionado);

	/**
	 * Atualizar algoritmo de clipping.
	 */
	void atualizarAlgoritmoClipping(bool cohenSutherland);

	/**
	 * Atualizar tipo de projeção.
	 */
	void atualizarTipoProjecao(bool projecaoParalela);

private:
	ControladorUI* controladorUI;
	Viewport* viewport;
	int valorZoom;
	int valorRotacaoX;
	int valorRotacaoY;
	int valorRotacaoZ;

};

#endif /* FORMPRINCIPAL_H_ */


text:
package jadx.core.dex.visitors.debuginfo;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.OptionalInt;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jadx.api.plugins.input.data.AccessFlags;
import jadx.api.plugins.input.data.ILocalVar;
import jadx.api.plugins.input.data.attributes.JadxAttrType;
import jadx.api.plugins.input.data.attributes.types.MethodParametersAttr;
import jadx.core.Consts;
import jadx.core.deobf.NameMapper;
import jadx.core.dex.attributes.AFlag;
import jadx.core.dex.attributes.AType;
import jadx.core.dex.attributes.nodes.LocalVarsDebugInfoAttr;
import jadx.core.dex.attributes.nodes.RegDebugInfoAttr;
import jadx.core.dex.instructions.PhiInsn;
import jadx.core.dex.instructions.args.ArgType;
import jadx.core.dex.instructions.args.CodeVar;
import jadx.core.dex.instructions.args.InsnArg;
import jadx.core.dex.instructions.args.Named;
import jadx.core.dex.instructions.args.RegisterArg;
import jadx.core.dex.instructions.args.SSAVar;
import jadx.core.dex.nodes.BlockNode;
import jadx.core.dex.nodes.InsnNode;
import jadx.core.dex.nodes.MethodNode;
import jadx.core.dex.visitors.AbstractVisitor;
import jadx.core.dex.visitors.JadxVisitor;
import jadx.core.dex.visitors.ssa.SSATransform;
import jadx.core.dex.visitors.typeinference.TypeInferenceVisitor;
import jadx.core.dex.visitors.typeinference.TypeUpdateResult;
import jadx.core.utils.BlockUtils;
import jadx.core.utils.exceptions.JadxException;

@JadxVisitor(
		name = "Debug Info Apply",
		desc = "Apply debug info to registers (type and names)",
		runAfter = {
				SSATransform.class,
				TypeInferenceVisitor.class
		}
)
public class DebugInfoApplyVisitor extends AbstractVisitor {
	private static final Logger LOG = LoggerFactory.getLogger(DebugInfoApplyVisitor.class);

	@Override
	public void visit(MethodNode mth) throws JadxException {
		try {
			if (mth.contains(AType.LOCAL_VARS_DEBUG_INFO)) {
				applyDebugInfo(mth);
				mth.remove(AType.LOCAL_VARS_DEBUG_INFO);
			}
			processMethodParametersAttribute(mth);
		} catch (Exception e) {
			mth.addWarnComment("Failed to apply debug info", e);
		}
	}

	private static void applyDebugInfo(MethodNode mth) {
		if (Consts.DEBUG_TYPE_INFERENCE) {
			LOG.info("Apply debug info for method: {}", mth);
		}
		mth.getSVars().forEach(ssaVar -> searchAndApplyVarDebugInfo(mth, ssaVar));

		fixLinesForReturn(mth);
		fixNamesForPhiInsns(mth);
	}

	private static void searchAndApplyVarDebugInfo(MethodNode mth, SSAVar ssaVar) {
		if (applyDebugInfo(mth, ssaVar, ssaVar.getAssign())) {
			return;
		}
		for (RegisterArg useArg : ssaVar.getUseList()) {
			if (applyDebugInfo(mth, ssaVar, useArg)) {
				return;
			}
		}
		searchDebugInfoByOffset(mth, ssaVar);
	}

	private static void searchDebugInfoByOffset(MethodNode mth, SSAVar ssaVar) {
		LocalVarsDebugInfoAttr debugInfoAttr = mth.get(AType.LOCAL_VARS_DEBUG_INFO);
		if (debugInfoAttr == null) {
			return;
		}
		OptionalInt max = ssaVar.getUseList().stream().mapToInt(DebugInfoApplyVisitor::getInsnOffsetByArg).max();
		if (!max.isPresent()) {
			return;
		}
		int startOffset = getInsnOffsetByArg(ssaVar.getAssign());
		int endOffset = max.getAsInt();
		int regNum = ssaVar.getRegNum();
		for (ILocalVar localVar : debugInfoAttr.getLocalVars()) {
			if (localVar.getRegNum() == regNum) {
				int startAddr = localVar.getStartOffset();
				int endAddr = localVar.getEndOffset();
				if (isInside(startOffset, startAddr, endAddr) || isInside(endOffset, startAddr, endAddr)) {
					if (Consts.DEBUG_TYPE_INFERENCE) {
						LOG.debug("Apply debug info by offset for: {} to {}", ssaVar, localVar);
					}
					ArgType type = DebugInfoAttachVisitor.getVarType(mth, localVar);
					applyDebugInfo(mth, ssaVar, type, localVar.getName());
					break;
				}
			}
		}
	}

	private static boolean isInside(int var, int start, int end) {
		return start <= var && var <= end;
	}

	private static int getInsnOffsetByArg(InsnArg arg) {
		if (arg != null) {
			InsnNode insn = arg.getParentInsn();
			if (insn != null) {
				return insn.getOffset();
			}
		}
		return -1;
	}

	public static boolean applyDebugInfo(MethodNode mth, SSAVar ssaVar, RegisterArg arg) {
		RegDebugInfoAttr debugInfoAttr = arg.get(AType.REG_DEBUG_INFO);
		if (debugInfoAttr == null) {
			return false;
		}
		return applyDebugInfo(mth, ssaVar, debugInfoAttr.getRegType(), debugInfoAttr.getName());
	}

	public static boolean applyDebugInfo(MethodNode mth, SSAVar ssaVar, ArgType type, String varName) {
		TypeUpdateResult result = mth.root().getTypeUpdate().applyWithWiderIgnoreUnknown(mth, ssaVar, type);
		if (result == TypeUpdateResult.REJECT) {
			if (Consts.DEBUG_TYPE_INFERENCE) {
				LOG.debug("Reject debug info of type: {} and name: '{}' for {}, mth: {}", type, varName, ssaVar, mth);
			}
			return false;
		}
		if (NameMapper.isValidAndPrintable(varName)) {
			ssaVar.setName(varName);
		}
		return true;
	}

	/**
	 * Fix debug info for splitter 'return' instructions
	 */
	private static void fixLinesForReturn(MethodNode mth) {
		if (mth.isVoidReturn()) {
			return;
		}
		InsnNode origReturn = null;
		List<InsnNode> newReturns = new ArrayList<>(mth.getPreExitBlocks().size());
		for (BlockNode exit : mth.getPreExitBlocks()) {
			InsnNode ret = BlockUtils.getLastInsn(exit);
			if (ret != null) {
				if (ret.contains(AFlag.ORIG_RETURN)) {
					origReturn = ret;
				} else {
					newReturns.add(ret);
				}
			}
		}
		if (origReturn != null) {
			for (InsnNode ret : newReturns) {
				InsnArg oldArg = origReturn.getArg(0);
				InsnArg newArg = ret.getArg(0);
				if (oldArg.isRegister() && newArg.isRegister()) {
					RegisterArg oldArgReg = (RegisterArg) oldArg;
					RegisterArg newArgReg = (RegisterArg) newArg;
					applyDebugInfo(mth, newArgReg.getSVar(), oldArgReg.getType(), oldArgReg.getName());
				}
				ret.setSourceLine(origReturn.getSourceLine());
			}
		}
	}

	private static void fixNamesForPhiInsns(MethodNode mth) {
		mth.getSVars().forEach(ssaVar -> {
			for (PhiInsn phiInsn : ssaVar.getUsedInPhi()) {
				Set<String> names = new HashSet<>(1 + phiInsn.getArgsCount());
				addArgName(phiInsn.getResult(), names);
				phiInsn.getArguments().forEach(arg -> addArgName(arg, names));
				if (names.size() == 1) {
					setNameForInsn(phiInsn, names.iterator().next());
				} else if (names.size() > 1) {
					mth.addDebugComment("Different variable names in phi insn: " + names + ", use first");
					setNameForInsn(phiInsn, names.iterator().next());
				}
			}
		});
	}

	private static void addArgName(InsnArg arg, Set<String> names) {
		if (arg instanceof Named) {
			String name = ((Named) arg).getName();
			if (name != null) {
				names.add(name);
			}
		}
	}

	private static void setNameForInsn(PhiInsn phiInsn, String name) {
		phiInsn.getResult().setName(name);
		phiInsn.getArguments().forEach(arg -> {
			if (arg instanceof Named) {
				((Named) arg).setName(name);
			}
		});
	}

	private void processMethodParametersAttribute(MethodNode mth) {
		MethodParametersAttr parametersAttr = mth.get(JadxAttrType.METHOD_PARAMETERS);
		if (parametersAttr == null) {
			return;
		}
		try {
			List<MethodParametersAttr.Info> params = parametersAttr.getList();
			if (params.size() != mth.getMethodInfo().getArgsCount()) {
				return;
			}
			int i = 0;
			for (RegisterArg mthArg : mth.getArgRegs()) {
				MethodParametersAttr.Info paramInfo = params.get(i++);
				String name = paramInfo.getName();
				if (NameMapper.isValidAndPrintable(name)) {
					CodeVar codeVar = mthArg.getSVar().getCodeVar();
					codeVar.setName(name);
					if (AccessFlags.hasFlag(paramInfo.getAccFlags(), AccessFlags.FINAL)) {
						codeVar.setFinal(true);
					}
				}
			}
		} catch (Exception e) {
			mth.addWarnComment("Failed to process method parameters attribute: " + parametersAttr.getList(), e);
		}
	}
}


text:
namespace msgpack {

/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond

namespace type {
    enum object_type {
        NIL                 = MSGPACK_OBJECT_NIL,
        BOOLEAN             = MSGPACK_OBJECT_BOOLEAN,
        POSITIVE_INTEGER    = MSGPACK_OBJECT_POSITIVE_INTEGER,
        NEGATIVE_INTEGER    = MSGPACK_OBJECT_NEGATIVE_INTEGER,
        FLOAT               = MSGPACK_OBJECT_FLOAT,
#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
        DOUBLE              = MSGPACK_OBJECT_DOUBLE, // obsolete
#endif // MSGPACK_USE_LEGACY_NAME_AS_FLOAT
        STR                 = MSGPACK_OBJECT_STR,
        BIN                 = MSGPACK_OBJECT_BIN,
        ARRAY               = MSGPACK_OBJECT_ARRAY,
        MAP                 = MSGPACK_OBJECT_MAP,
        EXT                 = MSGPACK_OBJECT_EXT
    };
}

struct object;
struct object_kv;

struct object_array {
    uint32_t size;
    msgpack::object* ptr;
};

struct object_map {
    uint32_t size;
    msgpack::object_kv* ptr;
};

struct object_str {
    uint32_t size;
    const char* ptr;
};

struct object_bin {
    uint32_t size;
    const char* ptr;
};

struct object_ext {
    int8_t type() const { return ptr[0]; }
    const char* data() const { return &ptr[1]; }
    uint32_t size;
    const char* ptr;
};

#if !defined(MSGPACK_USE_CPP03)
struct object;

namespace adaptor {
template <typename T, typename Enabler = void>
struct as;
} // namespace adaptor

template <typename T>
struct has_as {
private:
    template <typename U>
    static auto check(U*) ->
        typename std::is_same<
            decltype(msgpack::adaptor::as<U>()(std::declval<msgpack::object>())),
            T>::type;
    template <typename>
    static std::false_type check(...);
public:
    using type = decltype(check<T>(nullptr));
    static constexpr bool value = type::value;
};

#endif // !defined(MSGPACK_USE_CPP03)

struct object {
    union union_type {
        bool boolean;
        uint64_t u64;
        int64_t  i64;
#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
        double   dec; // obsolete
#endif // MSGPACK_USE_LEGACY_NAME_AS_FLOAT
        double   f64;
        msgpack::object_array array;
        msgpack::object_map map;
        msgpack::object_str str;
        msgpack::object_bin bin;
        msgpack::object_ext ext;
    };

    msgpack::type::object_type type;
    union_type via;

    bool is_nil() const { return type == msgpack::type::NIL; }

#if defined(MSGPACK_USE_CPP03)

    template <typename T>
    T as() const;

#else  // defined(MSGPACK_USE_CPP03)

    template <typename T>
    typename std::enable_if<msgpack::has_as<T>::value, T>::type as() const;

    template <typename T>
    typename std::enable_if<!msgpack::has_as<T>::value, T>::type as() const;

#endif // defined(MSGPACK_USE_CPP03)

    template <typename T>
    T& convert(T& v) const;
    template <typename T>
    T* convert(T* v) const;

    template <typename T>
    bool convert_if_not_nil(T& v) const;

    object();

    object(const msgpack_object& o);

    template <typename T>
    explicit object(const T& v);

    template <typename T>
    object(const T& v, msgpack::zone& z);

    // obsolete
    template <typename T>
    object(const T& v, msgpack::zone* z);

    template <typename T>
    object& operator=(const T& v);

    operator msgpack_object() const;

    struct with_zone;

private:
    struct implicit_type;

public:
    implicit_type convert() const;
};

struct object_kv {
    msgpack::object key;
    msgpack::object val;
};

struct object::with_zone : object {
    with_zone(msgpack::zone& zone) : zone(zone) { }
    msgpack::zone& zone;
private:
    with_zone();
};

/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond

} // namespace msgpack

#endif // MSGPACK_OBJECT_FWD_HPP


text:
package org.springframework.jms.connection;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TemporaryQueue;
import javax.jms.TemporaryTopic;
import javax.jms.Topic;
import javax.jms.TopicSession;

import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;

/**
 * {@link SingleConnectionFactory} subclass that adds {@link javax.jms.Session}
 * caching as well {@link javax.jms.MessageProducer} caching. This ConnectionFactory
 * also switches the {@link #setReconnectOnException "reconnectOnException" property}
 * to "true" by default, allowing for automatic recovery of the underlying Connection.
 *
 *
By default, only one single Session will be cached, with further requested
 * Sessions being created and disposed on demand. Consider raising the
 * {@link #setSessionCacheSize "sessionCacheSize" value} in case of a
 * high-concurrency environment.
 *
 *
When using the JMS 1.0.2 API, this ConnectionFactory will switch
 * into queue/topic mode according to the JMS API methods used at runtime:
 * {@code createQueueConnection} and {@code createTopicConnection} will
 * lead to queue/topic mode, respectively; generic {@code createConnection}
 * calls will lead to a JMS 1.1 connection which is able to serve both modes.
 *
 *
NOTE: This ConnectionFactory requires explicit closing of all Sessions
 * obtained from its shared Connection. This is the usual recommendation for
 * native JMS access code anyway. However, with this ConnectionFactory, its use
 * is mandatory in order to actually allow for Session reuse.
 *
 *
Note also that MessageConsumers obtained from a cached Session won't get
 * closed until the Session will eventually be removed from the pool. This may
 * lead to semantic side effects in some cases. For a durable subscriber, the
 * logical {@code Session.close()} call will also close the subscription.
 * Re-registering a durable consumer for the same subscription on the same
 * Session handle is not supported; close and reobtain a cached Session first.
 *
 * @author Juergen Hoeller
 * @since 2.5.3
 */
public class CachingConnectionFactory extends SingleConnectionFactory {

	private static final Method createSharedConsumerMethod = ClassUtils.getMethodIfAvailable(
			Session.class, "createSharedConsumer", Topic.class, String.class, String.class);

	private static final Method createSharedDurableConsumerMethod = ClassUtils.getMethodIfAvailable(
			Session.class, "createSharedDurableConsumer", Topic.class, String.class, String.class);

	private int sessionCacheSize = 1;

	private boolean cacheProducers = true;

	private boolean cacheConsumers = true;

	private volatile boolean active = true;

	private final Map<Integer, LinkedList<Session>> cachedSessions =
			new HashMap<Integer, LinkedList<Session>>();

	/**
	 * Create a new CachingConnectionFactory for bean-style usage.
	 * @see #setTargetConnectionFactory
	 */
	public CachingConnectionFactory() {
		super();
		setReconnectOnException(true);
	}

	/**
	 * Create a new CachingConnectionFactory for the given target
	 * ConnectionFactory.
	 * @param targetConnectionFactory the target ConnectionFactory
	 */
	public CachingConnectionFactory(ConnectionFactory targetConnectionFactory) {
		super(targetConnectionFactory);
		setReconnectOnException(true);
	}

	/**
	 * Specify the desired size for the JMS Session cache (per JMS Session type).
	 *
This cache size is the maximum limit for the number of cached Sessions
	 * per session acknowledgement type (auto, client, dups_ok, transacted).
	 * As a consequence, the actual number of cached Sessions may be up to
	 * four times as high as the specified value - in the unlikely case
	 * of mixing and matching different acknowledgement types.
	 *
Default is 1: caching a single Session, (re-)creating further ones on
	 * demand. Specify a number like 10 if you'd like to raise the number of cached
	 * Sessions; that said, 1 may be sufficient for low-concurrency scenarios.
	 * @see #setCacheProducers
	 */
	public void setSessionCacheSize(int sessionCacheSize) {
		Assert.isTrue(sessionCacheSize >= 1, "Session cache size must be 1 or higher");
		this.sessionCacheSize = sessionCacheSize;
	}

	/**
	 * Return the desired size for the JMS Session cache (per JMS Session type).
	 */
	public int getSessionCacheSize() {
		return this.sessionCacheSize;
	}

	/**
	 * Specify whether to cache JMS MessageProducers per JMS Session instance
	 * (more specifically: one MessageProducer per Destination and Session).
	 *
Default is "true". Switch this to "false" in order to always
	 * recreate MessageProducers on demand.
	 */
	public void setCacheProducers(boolean cacheProducers) {
		this.cacheProducers = cacheProducers;
	}

	/**
	 * Return whether to cache JMS MessageProducers per JMS Session instance.
	 */
	public boolean isCacheProducers() {
		return this.cacheProducers;
	}

	/**
	 * Specify whether to cache JMS MessageConsumers per JMS Session instance
	 * (more specifically: one MessageConsumer per Destination, selector String
	 * and Session). Note that durable subscribers will only be cached until
	 * logical closing of the Session handle.
	 *
Default is "true". Switch this to "false" in order to always
	 * recreate MessageConsumers on demand.
	 */
	public void setCacheConsumers(boolean cacheConsumers) {
		this.cacheConsumers = cacheConsumers;
	}

	/**
	 * Return whether to cache JMS MessageConsumers per JMS Session instance.
	 */
	public boolean isCacheConsumers() {
		return this.cacheConsumers;
	}

	/**
	 * Resets the Session cache as well.
	 */
	@Override
	public void resetConnection() {
		this.active = false;
		synchronized (this.cachedSessions) {
			for (LinkedList<Session> sessionList : this.cachedSessions.values()) {
				synchronized (sessionList) {
					for (Session session : sessionList) {
						try {
							session.close();
						}
						catch (Throwable ex) {
							logger.trace("Could not close cached JMS Session", ex);
						}
					}
				}
			}
			this.cachedSessions.clear();
		}
		this.active = true;

		// Now proceed with actual closing of the shared Connection...
		super.resetConnection();
	}

	/**
	 * Checks for a cached Session for the given mode.
	 */
	@Override
	protected Session getSession(Connection con, Integer mode) throws JMSException {
		LinkedList<Session> sessionList;
		synchronized (this.cachedSessions) {
			sessionList = this.cachedSessions.get(mode);
			if (sessionList == null) {
				sessionList = new LinkedList<Session>();
				this.cachedSessions.put(mode, sessionList);
			}
		}
		Session session = null;
		synchronized (sessionList) {
			if (!sessionList.isEmpty()) {
				session = sessionList.removeFirst();
			}
		}
		if (session != null) {
			if (logger.isTraceEnabled()) {
				logger.trace("Found cached JMS Session for mode " + mode + ": " +
						(session instanceof SessionProxy ? ((SessionProxy) session).getTargetSession() : session));
			}
		}
		else {
			Session targetSession = createSession(con, mode);
			if (logger.isDebugEnabled()) {
				logger.debug("Registering cached JMS Session for mode " + mode + ": " + targetSession);
			}
			session = getCachedSessionProxy(targetSession, sessionList);
		}
		return session;
	}

	/**
	 * Wrap the given Session with a proxy that delegates every method call to it
	 * but adapts close calls. This is useful for allowing application code to
	 * handle a special framework Session just like an ordinary Session.
	 * @param target the original Session to wrap
	 * @param sessionList the List of cached Sessions that the given Session belongs to
	 * @return the wrapped Session
	 */
	protected Session getCachedSessionProxy(Session target, LinkedList<Session> sessionList) {
		List<Class<?>> classes = new ArrayList<Class<?>>(3);
		classes.add(SessionProxy.class);
		if (target instanceof QueueSession) {
			classes.add(QueueSession.class);
		}
		if (target instanceof TopicSession) {
			classes.add(TopicSession.class);
		}
		return (Session) Proxy.newProxyInstance(
				SessionProxy.class.getClassLoader(),
				classes.toArray(new Class<?>[classes.size()]),
				new CachedSessionInvocationHandler(target, sessionList));
	}

	/**
	 * Invocation handler for a cached JMS Session proxy.
	 */
	private class CachedSessionInvocationHandler implements InvocationHandler {

		private final Session target;

		private final LinkedList<Session> sessionList;

		private final Map<DestinationCacheKey, MessageProducer> cachedProducers =
				new HashMap<DestinationCacheKey, MessageProducer>();

		private final Map<ConsumerCacheKey, MessageConsumer> cachedConsumers =
				new HashMap<ConsumerCacheKey, MessageConsumer>();

		private boolean transactionOpen = false;

		public CachedSessionInvocationHandler(Session target, LinkedList<Session> sessionList) {
			this.target = target;
			this.sessionList = sessionList;
		}

		@Override
		public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
			String methodName = method.getName();
			if (methodName.equals("equals")) {
				// Only consider equal when proxies are identical.
				return (proxy == args[0]);
			}
			else if (methodName.equals("hashCode")) {
				// Use hashCode of Session proxy.
				return System.identityHashCode(proxy);
			}
			else if (methodName.equals("toString")) {
				return "Cached JMS Session: " + this.target;
			}
			else if (methodName.equals("close")) {
				// Handle close method: don't pass the call on.
				if (active) {
					synchronized (this.sessionList) {
						if (this.sessionList.size() < getSessionCacheSize()) {
							try {
								logicalClose((Session) proxy);
								// Remain open in the session list.
								return null;
							}
							catch (JMSException ex) {
								logger.trace("Logical close of cached JMS Session failed - discarding it", ex);
								// Proceed to physical close from here...
							}
						}
					}
				}
				// If we get here, we're supposed to shut down.
				physicalClose();
				return null;
			}
			else if (methodName.equals("getTargetSession")) {
				// Handle getTargetSession method: return underlying Session.
				return this.target;
			}
			else if (methodName.equals("commit") || methodName.equals("rollback")) {
				this.transactionOpen = false;
			}
			else if (methodName.startsWith("create")) {
				this.transactionOpen = true;
				if (isCacheProducers() && (methodName.equals("createProducer") ||
						methodName.equals("createSender") || methodName.equals("createPublisher"))) {
					// Destination argument being null is ok for a producer
					return getCachedProducer((Destination) args[0]);
				}
				else if (isCacheConsumers()) {
					// let raw JMS invocation throw an exception if Destination (i.e. args[0]) is null
					if ((methodName.equals("createConsumer") || methodName.equals("createReceiver") ||
							methodName.equals("createSubscriber"))) {
						Destination dest = (Destination) args[0];
						if (dest != null && !(dest instanceof TemporaryQueue || dest instanceof TemporaryTopic)) {
							return getCachedConsumer(dest,
									(args.length > 1 ? (String) args[1] : null),
									(args.length > 2 && (Boolean) args[2]),
									null,
									false);
						}
					}
					else if (methodName.equals("createDurableConsumer") || methodName.equals("createDurableSubscriber")) {
						Destination dest = (Destination) args[0];
						if (dest != null) {
							return getCachedConsumer(dest,
									(args.length > 2 ? (String) args[2] : null),
									(args.length > 3 && (Boolean) args[3]),
									(String) args[1],
									true);
						}
					}
					else if (methodName.equals("createSharedConsumer")) {
						Destination dest = (Destination) args[0];
						if (dest != null) {
							return getCachedConsumer(dest,
									(args.length > 2 ? (String) args[2] : null),
									null,
									(String) args[1],
									false);
						}
					}
					else if (methodName.equals("createSharedDurableConsumer")) {
						Destination dest = (Destination) args[0];
						if (dest != null) {
							return getCachedConsumer(dest,
									(args.length > 2 ? (String) args[2] : null),
									null,
									(String) args[1],
									true);
						}
					}
				}
			}
			try {
				return method.invoke(this.target, args);
			}
			catch (InvocationTargetException ex) {
				throw ex.getTargetException();
			}
		}

		private MessageProducer getCachedProducer(Destination dest) throws JMSException {
			DestinationCacheKey cacheKey = (dest != null ? new DestinationCacheKey(dest) : null);
			MessageProducer producer = this.cachedProducers.get(cacheKey);
			if (producer != null) {
				if (logger.isTraceEnabled()) {
					logger.trace("Found cached JMS MessageProducer for destination [" + dest + "]: " + producer);
				}
			}
			else {
				producer = this.target.createProducer(dest);
				if (logger.isDebugEnabled()) {
					logger.debug("Registering cached JMS MessageProducer for destination [" + dest + "]: " + producer);
				}
				this.cachedProducers.put(cacheKey, producer);
			}
			return new CachedMessageProducer(producer).getProxyIfNecessary();
		}

		private MessageConsumer getCachedConsumer(
				Destination dest, String selector, Boolean noLocal, String subscription, boolean durable) throws JMSException {

			ConsumerCacheKey cacheKey = new ConsumerCacheKey(dest, selector, noLocal, subscription, durable);
			MessageConsumer consumer = this.cachedConsumers.get(cacheKey);
			if (consumer != null) {
				if (logger.isTraceEnabled()) {
					logger.trace("Found cached JMS MessageConsumer for destination [" + dest + "]: " + consumer);
				}
			}
			else {
				if (dest instanceof Topic) {
					if (noLocal == null) {
						// createSharedConsumer((Topic) dest, subscription, selector);
						// createSharedDurableConsumer((Topic) dest, subscription, selector);
						Method method = (durable ? createSharedDurableConsumerMethod : createSharedConsumerMethod);
						try {
							consumer = (MessageConsumer) method.invoke(this.target, dest, subscription, selector);
						}
						catch (InvocationTargetException ex) {
							if (ex.getTargetException() instanceof JMSException) {
								throw (JMSException) ex.getTargetException();
							}
							ReflectionUtils.handleInvocationTargetException(ex);
						}
						catch (IllegalAccessException ex) {
							throw new IllegalStateException("Could not access JMS 2.0 API method: " + ex.getMessage());
						}
					}
					else {
						consumer = (durable ?
								this.target.createDurableSubscriber((Topic) dest, subscription, selector, noLocal) :
								this.target.createConsumer(dest, selector, noLocal));
					}
				}
				else {
					consumer = this.target.createConsumer(dest, selector);
				}
				if (logger.isDebugEnabled()) {
					logger.debug("Registering cached JMS MessageConsumer for destination [" + dest + "]: " + consumer);
				}
				this.cachedConsumers.put(cacheKey, consumer);
			}
			return new CachedMessageConsumer(consumer);
		}

		private void logicalClose(Session proxy) throws JMSException {
			// Preserve rollback-on-close semantics.
			if (this.transactionOpen && this.target.getTransacted()) {
				this.transactionOpen = false;
				this.target.rollback();
			}
			// Physically close durable subscribers at time of Session close call.
			for (Iterator<Map.Entry<ConsumerCacheKey, MessageConsumer>> it = this.cachedConsumers.entrySet().iterator(); it.hasNext();) {
				Map.Entry<ConsumerCacheKey, MessageConsumer> entry = it.next();
				if (entry.getKey().subscription != null) {
					entry.getValue().close();
					it.remove();
				}
			}
			// Allow for multiple close calls...
			boolean returned = false;
			synchronized (this.sessionList) {
				if (!this.sessionList.contains(proxy)) {
					this.sessionList.addLast(proxy);
					returned = true;
				}
			}
			if (returned && logger.isTraceEnabled()) {
				logger.trace("Returned cached Session: " + this.target);
			}
		}

		private void physicalClose() throws JMSException {
			if (logger.isDebugEnabled()) {
				logger.debug("Closing cached Session: " + this.target);
			}
			// Explicitly close all MessageProducers and MessageConsumers that
			// this Session happens to cache...
			try {
				for (MessageProducer producer : this.cachedProducers.values()) {
					producer.close();
				}
				for (MessageConsumer consumer : this.cachedConsumers.values()) {
					consumer.close();
				}
			}
			finally {
				this.cachedProducers.clear();
				this.cachedConsumers.clear();
				// Now actually close the Session.
				this.target.close();
			}
		}
	}

	/**
	 * Simple wrapper class around a Destination reference.
	 * Used as the cache key when caching MessageProducer objects.
	 */
	private static class DestinationCacheKey {

		private final Destination destination;

		private String destinationString;

		public DestinationCacheKey(Destination destination) {
			Assert.notNull(destination, "Destination must not be null");
			this.destination = destination;
		}

		private String getDestinationString() {
			if (this.destinationString == null) {
				this.destinationString = this.destination.toString();
			}
			return this.destinationString;
		}

		protected boolean destinationEquals(DestinationCacheKey otherKey) {
			return (this.destination.getClass().equals(otherKey.destination.getClass()) &&
					(this.destination.equals(otherKey.destination) ||
							getDestinationString().equals(otherKey.getDestinationString())));
		}

		@Override
		public boolean equals(Object other) {
			// Effectively checking object equality as well as toString equality.
			// On WebSphere MQ, Destination objects do not implement equals...
			return (other == this || destinationEquals((DestinationCacheKey) other));
		}

		@Override
		public int hashCode() {
			// Can't use a more specific hashCode since we can't rely on
			// this.destination.hashCode() actually being the same value
			// for equivalent destinations... Thanks a lot, WebSphere MQ!
			return this.destination.getClass().hashCode();
		}
	}

	/**
	 * Simple wrapper class around a Destination and other consumer attributes.
	 * Used as the cache key when caching MessageConsumer objects.
	 */
	private static class ConsumerCacheKey extends DestinationCacheKey {

		private final String selector;

		private final Boolean noLocal;

		private final String subscription;

		private final boolean durable;

		public ConsumerCacheKey(Destination destination, String selector, Boolean noLocal, String subscription, boolean durable) {
			super(destination);
			this.selector = selector;
			this.noLocal = noLocal;
			this.subscription = subscription;
			this.durable = durable;
		}

		@Override
		public boolean equals(Object other) {
			if (this == other) {
				return true;
			}
			ConsumerCacheKey otherKey = (ConsumerCacheKey) other;
			return (destinationEquals(otherKey) &&
					ObjectUtils.nullSafeEquals(this.selector, otherKey.selector) &&
					ObjectUtils.nullSafeEquals(this.noLocal, otherKey.noLocal) &&
					ObjectUtils.nullSafeEquals(this.subscription, otherKey.subscription) &&
					this.durable == otherKey.durable);
		}
	}

}


text:
<ion-navbar *navbar>
	<button menuToggle>
		<ion-icon name="menu"></ion-icon>
	</button>
	<ion-title>Settings</ion-title>
</ion-navbar>

<ion-content>

Enable Newsletters to see them

	<ion-list>
		<ion-list-header>
			Characters
		</ion-list-header>

		<ion-item *ngFor="#data of newsletters; #i=index">
			<ion-label>{{data.name}}
 Last updated on {{data.updated}} </ion-label>
			<ion-toggle class="toggle-{{data.key}}" (click)="onChange(i, data[user_id].checked)" checked="{{data[user_id].checked}}"></ion-toggle>
		</ion-item>

	</ion-list>
</ion-content>


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

using AutoTest.Core.Caching.Projects;
using AutoTest.Core.Messaging.MessageConsumers;
using AutoTest.Core.TestRunners.TestRunners;
using AutoTest.Messages;

using NUnit.Framework;

namespace AutoTest.Test.Core.TestRunners
{
    [TestFixture]
    public class When_the_test_run_generates_report_XML
    {
        [SetUp]
        public void SetUp()
        {
            var run = new MSpecTestRunner.Run
                      {
                          RunInfos = new[]
                                     {
                                         new TestRunInfo(new Project("Machine.Specifications.Example.Random", null),
                                                         @"C:\Some\Path\Machine.Specifications.Example.Random.dll")
                                     }
                      };

            _parser = new MSpecReportParser("TestResources/MSpec/SingleAssembly.xml", run);
            _results = _parser.Parse();
        }

        MSpecReportParser _parser;
        IEnumerable<TestRunResults> _results;

        [Test]
        public void Should_find_the_spec_assembly()
        {
            _results.Count().ShouldEqual(1);
        }

        [Test]
        public void Should_find_the_time_spent()
        {
            Assert.Greater(_results.First().TimeSpent, TimeSpan.Zero);
        }

        [Test]
        public void Should_find_all_specs()
        {
            _results.First().All.Length.ShouldEqual(29);
        }

        [Test]
        public void Should_find_succeeded_specs()
        {
            _results.First().Passed.Length.ShouldEqual(17);
        }

        [Test]
        public void Should_find_failed_specs()
        {
            _results.First().Failed.Length.ShouldEqual(4);
        }

        [Test]
        public void Should_pull_the_message_and_stack_trace_for_failed_specs()
        {
            _results.First().Failed.Any(x => String.IsNullOrEmpty(x.Message)).ShouldBeFalse();
            _results.First().Failed.Any(x => x.StackTrace.Length == 0).ShouldBeFalse();
        }

        [Test]
        public void Should_find_ignored_specs()
        {
            _results.First().Ignored.Length.ShouldEqual(8);
        }

        [Test]
        public void Should_give_the_ignore_reason_for_unimplemented_specs()
        {
            _results.First().Ignored.Any(x => x.Message == "not implemented").ShouldBeTrue();
        }
    }

    [TestFixture]
    public class When_the_test_run_generates_report_XML_for_two_assemblies
    {
        [SetUp]
        public void SetUp()
        {
            var run = new MSpecTestRunner.Run
                      {
                          RunInfos = new[]
                                     {
                                         new TestRunInfo(new Project("Machine.Specifications.Example.Random", null),
                                                         @"C:\Some\Path\Machine.Specifications.Example.Random.dll"),
                                                         new TestRunInfo(new Project("Machine.Specifications.FailingExample", null),
                                                         @"C:\Some\Path\Machine.Specifications.FailingExample.dll")
                                     }
                      };

            _parser = new MSpecReportParser("TestResources/MSpec/TwoAssemblies.xml", run);
            _results = _parser.Parse();
        }

        MSpecReportParser _parser;
        IEnumerable<TestRunResults> _results;

        [Test]
        public void Should_find_two_spec_assemblies()
        {
            _results.Count().ShouldEqual(2);
        }

        [Test]
        public void Should_find_the_time_spent_for_each_assembly()
        {
            _results.ToList().ForEach(x => Assert.Greater(x.TimeSpent, TimeSpan.Zero));
        }

        [Test]
        public void Should_find_the_assembly_name()
        {
            _results.First().Assembly.ShouldEqual("C:\\Some\\Path\\Machine.Specifications.Example.Random.dll");
        }
    }

    [TestFixture]
    public class When_the_test_run_generates_report_XML_for_an_unknown_assembly
    {
        [SetUp]
        public void SetUp()
        {
            var run = new MSpecTestRunner.Run
                      {
                          RunInfos = new[]
                                     {
                                         new TestRunInfo(new Project("Machine.Specifications.Example.Random", null),
                                                         @"C:\Path\That\Is\Not\Reported")
                                     }
                      };

            _parser = new MSpecReportParser("TestResources/MSpec/SingleAssembly.xml", run);
            _results = _parser.Parse();
        }

        MSpecReportParser _parser;
        IEnumerable<TestRunResults> _results;

        [Test]
        public void Should_find_no_spec_assemblies()
        {
            _results.Count().ShouldEqual(0);
        }
    }
}


text:
from gym.envs.algorithmic.copy import CopyEnv
from gym.envs.algorithmic.repeat_copy import RepeatCopyEnv
from gym.envs.algorithmic.duplicated_input import DuplicatedInputEnv
from gym.envs.algorithmic.reverse import ReverseEnv
from gym.envs.algorithmic.reversed_addition import ReversedAdditionEnv


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="refresh" content="0; URL=/cgi-bin/luci/" />

LuCI - Lua Configuration Interface


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.commands;

import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 *
 * @author Developer
 */
public class AutoBackRight extends CommandGroup {

    public AutoBackRight() {
/*        System.out.println("AutoBackRight");
        //Drive to goal, drive back and prepare for teleoperated mode
        //addSequential(new DriveStraight(1.0));
        addSequential(new DriveStraight(0.1));
        addSequential(new StopDriving(0.5));
        addSequential(new ExtendSlider(2.75));
        addSequential(new RetractSlider(1.0));
        addSequential(new DriveBack(0.8));
        addSequential(new TurnBothRight(0.6)); //make sure to change to compensate for battery level
        addSequential(new DriveStraight(0.6));
        * */
        addSequential(new StopDriving(7.75));  //added this line for quarterfinal matches
        addSequential(new DriveStraight(3.0));

        addSequential(new StopDriving(0.5));
     //   addSequential(new TurnRight(0.75));
     //   addSequential(new StopDriving(0.5));
     //   addSequential(new DriveStraight(0.5));
     //   addSequential(new StopDriving(0.5));

        addSequential(new ExtendSlider(2.75));
        addSequential(new RetractSlider(1.0));
        addSequential(new DriveBack(0.2));
        addSequential(new StopDriving(0.5));
        addSequential(new TurnBothRight(0.65)); //make sure to change to compensate for battery level
        addSequential(new DriveStraight(1.5));

    }

}