this.height) <= Math.abs(this.heightInitial/3)){
				this.growthRate *= -1;
			}
			this.height += this.growthRate;
		}

		this.x += this.dx;
	}

	getTriCoord(){
        var v1 = [this.x - this.base/2, this.y];
        var v2 = [this.x, this.y - this.height];
        var v3 = [this.x + this.base/2, this.y];
        return [v1, v2, v3];
	}

	pointCircleCollide(point, circle, r): boolean{
        if (r===0) return false;
        var dx = circle[0] - point[0];
        var dy = circle[1] - point[1];
        return dx * dx + dy * dy <= r * r;
    }

    lineCircleCollide(a, b, circle, radius, nearest=null): boolean{
        var tmp = [0, 0];
        //check to see if start or end points lie within circle
        if (this.pointCircleCollide(a, circle, radius)) {
            if (nearest) {
                nearest[0] = a[0];
                nearest[1] = a[1];
            }
            return true
        } if (this.pointCircleCollide(b, circle, radius)) {
            if (nearest) {
                nearest[0] = b[0];
                nearest[1] = b[1];
            }
            return true
        }

        var x1 = a[0], y1 = a[1], x2 = b[0], y2 = b[1];
        var cx = circle[0], cy = circle[1];

        //vector d
        var dx = x2 - x1;
        var dy = y2 - y1;

        //vector lc
        var lcx = cx - x1;
        var lcy = cy - y1;

        //project lc onto d, resulting in vector p
        var dLen2 = dx * dx + dy * dy; //len2 of d
        var px = dx;
        var py = dy;
        if (dLen2 > 0) {
            var dp = (lcx * dx + lcy * dy) / dLen2;
            px *= dp;
            py *= dp;
        }

        if (!nearest)
            nearest = tmp;
        nearest[0] = x1 + px;
        nearest[1] = y1 + py;

        //len2 of p
        var pLen2 = px * px + py * py;

        //check collision
        return this.pointCircleCollide(nearest, circle, radius)
                && pLen2 <= dLen2 && (px * dx + py * dy) >= 0;
    }

    pointInTriangle(point, triangle): boolean {
        //compute vectors & dot products
        var cx = point[0], cy = point[1],
            t0 = triangle[0], t1 = triangle[1], t2 = triangle[2],
            v0x = t2[0]-t0[0], v0y = t2[1]-t0[1],
            v1x = t1[0]-t0[0], v1y = t1[1]-t0[1],
            v2x = cx-t0[0], v2y = cy-t0[1],
            dot00 = v0x*v0x + v0y*v0y,
            dot01 = v0x*v1x + v0y*v1y,
            dot02 = v0x*v2x + v0y*v2y,
            dot11 = v1x*v1x + v1y*v1y,
            dot12 = v1x*v2x + v1y*v2y

        // Compute barycentric coordinates
        var b = (dot00 * dot11 - dot01 * dot01),
            inv = b === 0 ? 0 : (1 / b),
            u = (dot11*dot02 - dot01*dot12) * inv,
            v = (dot00*dot12 - dot01*dot02) * inv


seListener(new TrayHandler(transparentWindow, popup));

        tray.add(icon);
    }

    private Consumer<String> discordListener(JMenuItem discordItem) {
        return (String text) ->
                discordItem.setText(
                        text.isEmpty() ? "Not connected to Discord" : "Connected to: " + text);
    }

    private static Consumer<Boolean> authenticatedListener(
            JMenuItem loginItem, CheckboxMenuItem enableItem) {
        return authenticated -> {
            if (authenticated) {
                loginItem.setText("Auth: Authenticated");
            } else {
                loginItem.setText("Auth: Not authenticated");
            }

            enableItem.setEnabled(authenticated);
        };
    }

    private static Consumer<String> nowPlayingListener(
            JMenuItem nowPlayingItem, ImageIcon notPlayingIcon, ImageIcon playingIcon) {
        return text -> {
            if (text.isEmpty()) {
                nowPlayingItem.setIcon(notPlayingIcon);
                nowPlayingItem.setText("Nothing playing...");
            } else {
                nowPlayingItem.setIcon(playingIcon);
                nowPlayingItem.setText("Now playing: " + text);
            }
        };
    }

    private JFrame createTrayWindow(JPopupMenu popup) {
        JFrame window = new JFrame();
        window.setType(JFrame.Type.UTILITY); // avoid task bar icon
        window.setUndecorated(true);
        window.setOpacity(0.0f);
        window.addFocusListener(new TrayCloseHandler(popup, window));

        return window;
    }
}
/*
 * Copyright © 2025 Tom BUTIN (RedsTom)
 *
 * This file is part of TidalCord.
 *
 * TidalCord is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * TidalCord is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 *
 * The full license text can be found in the file `/LICENSE.md` at the root of
 * this project.
 */

package fr.redstom.tidalcord.ui.elements;

import java.awt.event.MouseEvent;

import javax.swing.*;

/** A checkbox menu item that does not close the menu when clicked */
public class CheckboxMenuItem extends JCheckBoxMenuItem {

    public CheckboxMenuItem(String text) {
        super(text);
    }

    /** Prevents the checkbox from closing the menu when clicked */
    @Override
    protected void processMouseEvent(MouseEvent evt) {
        if (evt.getID() == MouseEvent.MOUSE_RELEASED && contains(evt.getPoint())) {
            doClick();
            setArmed(true);
        } else {
            super.processMouseEvent(evt);
        }
    }
}
package tools.redstone.redstonetools.malilib;

import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.GuiListBase;
import fi.dy.masa.malilib.gui.button.ButtonBase;
import fi.dy.masa.malilib.gui.button.ButtonGeneric;
import fi.dy.masa.malilib.gui.button.IButtonActionListener;
import fi.dy.masa.malilib.gui.interfaces.ISelectionListener;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import org.jetbrains.annotations.Nullable;
import tools.redstone.redstonetools.malilib.config.MacroManager;
import tools.redstone.redstonetools.malilib.widget.macro.MacroBase


* Explicitly set the classes that get the font rather than use a CSS an advanced selector like [class^="minute-"]:before */
/* [class^="minute-"]:before, [class^="hour-"]:before */
.minute-00:before, .minute-01:before, .minute-02:before,
.minute-03:before, .minute-04:before, .minute-05:before,
.minute-06:before, .minute-07:before, .minute-08:before,
.minute-09:before, .minute-10:before, .minute-11:before,
.minute-12:before, .minute-13:before, .minute-14:before,
.minute-15:before, .minute-16:before, .minute-17:before,
.minute-18:before, .minute-19:before, .minute-20:before,
.minute-21:before, .minute-22:before, .minute-23:before,
.minute-24:before, .minute-25:before, .minute-26:before,
.minute-27:before, .minute-28:before, .minute-29:before,
.minute-30:before, .minute-31:before, .minute-32:before,
.minute-33:before, .minute-34:before, .minute-35:before,
.minute-36:before, .minute-37:before, .minute-38:before,
.minute-39:before, .minute-40:before, .minute-41:before,
.minute-42:before, .minute-43:before, .minute-44:before,
.minute-45:before, .minute-46:before, .minute-47:before,
.minute-48:before, .minute-49:before, .minute-50:before,
.minute-51:before, .minute-52:before, .minute-53:before,
.minute-54:before, .minute-55:before, .minute-56:before,
.minute-57:before, .minute-58:before, .minute-59:before, .minute-60:before,
.hour-00:before, .hour-0:before, .hour-12:before, .hour-24:before,
.hour-01:before, .hour-1:before, .hour-13:before,
.hour-02:before, .hour-2:before, .hour-14:before,
.hour-03:before, .hour-3:before, .hour-15:before,
.hour-04:before, .hour-4:before, .hour-16:before,
.hour-05:before, .hour-5:before, .hour-17:before,
.hour-06:before, .hour-6:before, .hour-18:before,
.hour-07:before, .hour-7:before, .hour-19:before,
.


    """Generate samples using Metropolis-Hastings"""
        current_state = initial_state
        samples = [current_state]
        accepted = 0

        for _ in range(n_samples):
            # Propose new state
            proposed_state = self.proposal_dist(current_state)

            # Calculate acceptance probability
            alpha = min(1.0,
                       self.target_dist(proposed_state) / self.target_dist(current_state))

            # Accept or reject
            if np.random.random() < alpha:
                current_state = proposed_state
                accepted += 1

            samples.append(current_state)

        self.samples = np.array(samples)
        self.acceptance_rate = accepted / n_samples

        return self.samples

    def get_acceptance_rate(self) -> float:
        """Get acceptance rate"""
        return self.acceptance_rate

    def get_effective_sample_size(self) -> int:
        """Estimate effective sample size"""
        # Simple autocorrelation-based estimate
        if len(self.samples) < 2:
            return len(self.samples)

        # Calculate autocorrelation
        autocorr = np.correlate(self.samples, self.samples, mode='full')
        autocorr = autocorr[len(autocorr)//2:]

        # Find first zero crossing
        zero_crossing = np.where(np.diff(np.sign(autocorr)))[0]
        if len(zero_crossing) > 0:
            lag = zero_crossing[0]
        else:
            lag = len(autocorr)

        return len(self.samples) // (2 * lag + 1)

# Example usage
def gaussian_target(x: float) -> float:
    """Target distribution: Gaussian"""
    return np.exp(-0.5 * (x - 2)**2)

def gaussian_proposal(current: float) -> float:
    """Proposal distribution: Gaussian random walk"""
    return np.random.normal(current, 0.5)

# mcmc = MetropolisHastings(gaussian_target, gaussian_proposal)
# samples = mcmc.sample(10000)
# print(f"Acceptance rate: {mcmc.get_acceptance_rate():.3f}")
# print(f"Effective sample size: {mcmc.get_effective_sample_size()}")
```

---

## 🔍 Modern Causal Discovery

### PC Algorithm

```python
class CausalDiscovery:
    """Causal discovery using the PC algorithm"""

    def __init__(self, data: pd.DataFrame, alpha: float = 0.05):
        self.data = data
        self.alpha = alpha
        self.skeleton = None
        self.causal_graph = None

    def pc_algorithm(self) -> nx.Graph:
        """Implement PC algorithm for causal discovery"""
        # Step 1: Start with complete undirected graph
        n_vars = len(self.data.columns)
        skeleton = nx.complete_graph(n_vars)

        # Map node indices to variable names
        var_names = list(self.data.columns)
        node_to_var = {i: var_names[i] for i in range(n_vars)}

        # Step 2: Remove edges based on conditional independence tests
        l = 0  # Size of conditioning set
        while True:
            edges_to_remove = []

            for edge in skeleton.edges():
                i, j = edge
                neighbors_i = list(skeleton.neighbors(i))
                neighbors_j = list(skeleton.neighbors(j))

                # Find common neighbors
                common_neighbors = set(neighbors_i) & set(neighbors_j)

                # Test all subsets of size l
                for subset in self._get_subsets(common_neighbors, l):
                    if self._test_conditional_independence(i, j,


olean isGoingUp() {
        return (this.dataTracker.get(CONTROL_STATE) & 1) == 1;
    }

    @Override
    public boolean isGoingDown() {
        return (this.dataTracker.get(CONTROL_STATE) >> 1 & 1) == 1;
    }

    public boolean attack() {
        return (this.dataTracker.get(CONTROL_STATE) >> 2 & 1) == 1;
    }

    public boolean dismountIAF() {
        return (this.dataTracker.get(CONTROL_STATE) >> 3 & 1) == 1;
    }

    @Override
    public void up(boolean up) {
        this.setStateField(0, up);
    }

    @Override
    public void down(boolean down) {
        this.setStateField(1, down);
    }

    @Override
    public void attack(boolean attack) {
        this.setStateField(2, attack);
    }

    @Override
    public void strike(boolean strike) {
    }

    @Override
    public void dismount(boolean dismount) {
        this.setStateField(3, dismount);
    }

    private void setStateField(int i, boolean newState) {
        byte prevState = this.dataTracker.get(CONTROL_STATE);
        if (newState) this.dataTracker.set(CONTROL_STATE, (byte) (prevState | (1 << i)));
        else this.dataTracker.set(CONTROL_STATE, (byte) (prevState & ~(1 << i)));
    }

    @Override
    public byte getControlState() {
        return this.dataTracker.get(CONTROL_STATE);
    }

    @Override
    public void setControlState(byte state) {
        this.dataTracker.set(CONTROL_STATE, state);
    }

    public int getCommand() {
        return this.dataTracker.get(COMMAND);
    }

    public void setCommand(int command) {
        this.dataTracker.set(COMMAND, command);
        this.setSitting(command == 1);
    }

    @Override
    public void writeCustomDataToNbt(NbtCompound compound) {
        super.writeCustomDataToNbt(compound);
        compound.putString("Variant", this.getVariant());
        compound.putBoolean("Chested", this.isChested());
        compound.putBoolean("Saddled", this.isSaddled());
        compound.putBoolean("Hovering", this.isHovering());
        compound.putBoolean("Flying", this.isFlying());
        compound.putInt("Armor", this.getArmor());
        compound.putInt("Feedings", this.feedings);
        if (this.hippogryphInventory != null) {
            NbtList nbttaglist = new NbtList();
            for (int i = 0; i < this.hippogryphInventory.size(); ++i) {
                ItemStack itemstack = this.hippogryphInventory.getStack(i);
                if (!itemstack.isEmpty()) {
                    NbtCompound CompoundNBT = new NbtCompound();
                    CompoundNBT.putByte("Slot", (byte) i);
                    itemstack.writeNbt(CompoundNBT);
                    nbttaglist.add(CompoundNBT);
                }
            }
            compound.put("Items", nbttaglist);
        }
        compound.putBoolean("HasHomePosition", this.hasHomePosition);
        if (this.homePos != null && this.hasHomePosition) {
            compound.putInt("HomeAreaX", this.homePos.getX());
            compound.putInt("HomeAreaY", this.homePos.getY());
            compound.putInt("HomeAreaZ", this.homePos.getZ());
        }
        compound.putInt("Command", this.getCommand());
    }

    @Override
    public void readCustomDataFromNbt(NbtCompound compound) {
        super.readCustomDataFromNbt(compound);
        //FIXME: Compat for old version should be removed in 0.7
        if (compound.contains("Variant") && compound.get("Variant").getType() == NbtElement.STRING_TYPE)
            this.setVariant


at.VF_TANGENT
            | egret3d.VertexFormat.VF_COLOR | egret3d.VertexFormat.VF_UV0 | egret3d.VertexFormat.VF_UV1;

        ge.verticesData = new Array<number>();
        ge.indexData = new Array<number>();

        ///定点坐标
        var verticesPosition: Array<number> = new Array<number>();
        verticesPosition.push(
            0.5 * width,0.5 * height,0.5 * depth,
            0.5 * width,-0.5 * height,0.5 * depth,
            -0.5 * width,-0.5 * height,0.5 * depth,
            -0.5 * width,0.5 * height,0.5 * depth,
            0.5 * width,0.5 * height,-0.5 * depth,
            0.5 * width,-0.5 * height,-0.5 * depth,
            -0.5 * width,-0.5 * height,-0.5 * depth,
            -0.5 * width,0.5 * height,-0.5 * depth
        );
        ///定点法线
        var verticesNormal: Array<number> = new Array<number>();
        verticesNormal.push(0.0,0.0,0.0);
        ///顶点切线
        var verticesTangent: Array<number> = new Array<number>();
        verticesTangent.push(0.0,0.0,0.0);
        ///定点颜色
        var verticesColor: Array<number> = new Array<number>();
        verticesColor.push(1,1,1,1);
        ///定点第一uv
        var verticesUV0: Array<number> = new Array<number>();
        verticesUV0.push(
            0.0,0.0
        );
        ///定点第二uv
        var verticesUV1: Array<number> = new Array<number>();
        verticesUV1.push(0.0,0.0);

        ///生成定点数据
        for(var i = 0;i < 8;i++) {
            ge.verticesData.push(verticesPosition[i * 3],verticesPosition[i * 3 + 1],verticesPosition[i * 3 + 2]);
            ge.verticesData.push(verticesNormal[0],verticesNormal[1],verticesNormal[2]);
            ge.verticesData.push(verticesTangent[0],verticesTangent[1],verticesTangent[2]);
            ge.verticesData.push(verticesColor[0],verticesColor[1],verticesColor[2],verticesColor[3]);
            ge.verticesData.push(verticesUV1[0],verticesUV1[1]);
            ge.verticesData.push(verticesUV1[0],verticesUV1[1]);
        }

        ///索引数据
        ge.indexData.push(
            //前
            0,1,2,
            2,3,0,

            //后
            4,7,6,
            6,5,4,

            //左
            3,2,6,
            6,7,3,

            //右
            4,5,1,
            1,0,4,

            //上
            4,0,3,
            3,7,4,

            //下
            1,5,6,
            6,2,1
        );

        ///生成sub
        var subGeometry: egret3d.SubGeometry = new egret3d.SubGeometry();
        subGeometry.geometry = ge;
        subGeometry.start = 0;
        subGeometry.count = ge.indexData.length;
        ///插入sub队列
        ge.subGeometrys.push(subGeometry);

        return ge;
    }

    public update(e: egret3d.Event3D


/**
*Copyright (c) 2000-2001, Jim Crafton
*All rights reserved.
*Redistribution and use in source and binary forms, with or without
*modification, are permitted provided that the following conditions
*are met:
*	Redistributions of source code must retain the above copyright
*	notice, this list of conditions and the following disclaimer.
*
*	Redistributions in binary form must reproduce the above copyright
*	notice, this list of conditions and the following disclaimer in
*	the documentation and/or other materials provided with the distribution.
*
*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
*AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
*A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS
*OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
*PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
*PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
*LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
*NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*NB: This software will not save the world.
*/

/* Generated by Together */

#ifndef VIEW_H
#define VIEW_H

namespace VCF{

class GraphicsContext;

class Control;

class Controller;

class Model;

/** @interface */
class APPKIT_API View {
public:
	virtual ~View(){};

    virtual Model* getViewModel() = 0;

	virtual void setViewModel( Model* viewModel ) = 0;

    virtual Controller* getViewController() = 0;

	virtual void setViewController( Controller* viewController ) = 0;

	virtual Control* getViewControl() = 0;

	virtual void setViewControl( Control* viewControl ) = 0;

	virtual void paintView( GraphicsContext* context ) = 0;

	/**
	*updates the view. If the updatedModel is NULL,
	*this signifies the model is detaching itself
	*from the view, and the view should clean up it's
	*display appropriately
	*/
	virtual void updateView( Model* updatedModel ) = 0;
};

/**
*Basic implementation of a view
*/
class AbstractView : public View {
public:
	AbstractView( Control* viewControl=NULL){
		m_viewControl = viewControl;
		m_viewModel = NULL;
		m_viewController = NULL;
	}

	virtual ~AbstractView(){};

	virtual Model* getViewModel(){
		return m_viewModel;
	}

	virtual void setViewModel( Model* viewModel ){
		m_viewModel = viewModel;
	}

    virtual Controller* getViewController(){
		return m_viewController;
	}

	virtual void setViewController( Controller* viewController ){
		m_viewController = viewController;
	}

	virtual Control* getViewControl(){
		return m_viewControl;
	}

	virtual void setViewControl( Control* viewControl ){
		m_viewControl = viewControl;
	}

	virtual void paintView( GraphicsContext* context ){};

	virtual void updateView( Model* updatedModel ) {};
protected:
	Model* m_viewModel;
	Controller* m_viewController;
	Control* m_viewControl;

};

};
#endif //VIEW_H


/*  Dowse - hiredis helpers
 *
 *  (c) Copyright 2016 Dyne.org foundation, Amsterdam
 *  Written by Denis Roio aka jaromil <jaromil@dyne.org>
 *
 * This source code is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Public License as published
 * by the Free Software Foundation; either version 3 of the License,
 * or (at your option) any later version.
 *
 * This source code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * Please refer to the GNU Public License for more details.
 *
 * You should have received a copy of the GNU Public License along with
 * this source code; if not, write to:
 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include <dowse.h>

int okredis(redisContext *r, redisReply *res) {
	if(!res) {
		err("redis error: %s", r->errstr);
		return(0);
	} else if( res->type == REDIS_REPLY_ERROR ) {
		err("redis error: %s", res->str);
		return(0);
	} else {
		return(1);
	}
}

redisReply *cmd_redis(redisContext *redis, const char *format, ...) {
	va_list args;

	redisReply *res;
	char command[512];

	va_start(args, format);
	vsnprintf(command, 511, format, args);
	res = redisCommand(redis, command);
	va_end(args);

	if ( okredis(redis, res) ) {
        return res;
	} else {
        return NULL;
	}
}

redisContext *connect_redis(int db) {

	redisContext *rx = NULL;
	int port;
	char *redis_type;

	struct timeval timeout = { 1, 500 };

	switch(db) {
	case db_runtime:
	case db_dynamic:
		port = 6378;
		redis_type = "volatile";
		break;

	case db_storage:
		port = 6379;
		redis_type = "storage";
		break;
	}

	act ("Connecting to %s redis on port %u", redis_type, port);

	rx = redisConnectWithTimeout("127.0.0.1", port, timeout);

	if (!rx) {
		err("Connection error: can't allocate redis context");
		return NULL;
	}

	if(rx->err) {
		err("Redis connection error: %s", rx->errstr);
		redisFree(rx);
		return NULL;
	}

	return rx;
}


/*
 * Squashfs - a compressed read only filesystem for Linux
 *
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
 * Phillip Lougher <phillip@squashfs.org.uk>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2,
 * or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * super.c
 */

/*
 * This file implements code to read the superblock, read and initialise
 * in-memory structures at mount time, and all the VFS glue code to register
 * the filesystem.
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/magic.h>
#include <linux/xattr.h>

#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
#include "squashfs_fs_i.h"
#include "squashfs.h"
#include "decompressor.h"
#include "xattr.h"

static struct file_system_type squashfs_fs_type;
static const struct super_operations squashfs_super_ops;

static const struct squashfs_decompressor *supported_squashfs_filesystem(short
	major, short minor, short id)
{
	const struct squashfs_decompressor *decompressor;

	if (major < SQUASHFS_MAJOR) {
		ERROR("Major/Minor mismatch, older Squashfs %d.%d "
			"filesystems are unsupported\n", major, minor);
		return NULL;
	} else if (major > SQUASHFS_MAJOR || minor > SQUASHFS_MINOR) {
		ERROR("Major/Minor mismatch, trying to mount newer "
			"%d.%d filesystem\n", major, minor);
		ERROR("Please update your kernel\n");
		return NULL;
	}

	decompressor = squashfs_lookup_decompressor(id);
	if (!decompressor->supported) {
		ERROR("Filesystem uses \"%s\" compression. This is not "
			"supported\n", decompressor->name);
		return NULL;
	}

	return decompressor;
}

static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
{
	struct squashfs_sb_info *msblk;
	struct squashfs_super_block *sblk = NULL;
	char b[BDEVNAME_SIZE];
	struct inode *root;
	long long root_inode;
	unsigned short flags;
	unsigned int fragments;
	u64 lookup_table_start, xattr_id_table_start, next_table;
	int err;

	TRACE("Entered squashfs_fill_superblock\n");

	sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL);
	if (sb->s_fs_info == NULL) {
		ERROR("Failed to allocate squashfs_sb_info\n");
		return -ENOMEM;
	}
	msblk = sb->s_fs_info;

	msblk->devblksize = sb_min_blocksize(sb, SQUASHFS_DEVBLK_SIZE);
	msblk->devblksize_log2 = ffz(~msblk->devblksize);

	mutex_init(&msblk->meta_index_mutex);

	/*
	 * msblk->bytes_used is checked in squashfs_read_table to ensure reads
	 * are not beyond filesystem end.  But as we're using
	 * squashfs_read_table here to read the superblock (including the value
	 * of bytes_used) we need to set it to an initial sensible dummy value
	 */
	msblk->bytes_used = sizeof(*sblk);
	sblk = squashfs_read_table(sb, SQUASHFS_START, sizeof(*sblk));

	if (IS_ERR(sblk)) {
		ERROR("unable to read squashfs_super_block\n");
		err = PTR_ERR(sblk);
		sblk = NULL;
		goto failed_mount;
	}

	err = -EINVAL;

	/* Check it is a SQUASHFS superblock */
	sb->s_magic = le32_to_cpu(sblk->s_magic);
	if (sb->s_magic != SQUASHFS_MAGIC) {
		if (!silent)
			ERROR("Can't find a SQUASHFS superblock on %s\n",
						bdevname(sb->s_bdev, b));
		goto failed_mount;
	}

	/* Check the MAJOR & MINOR versions and lookup compression type */
	msblk->decompressor = supported_squashfs_filesystem(
			le16_to_cpu(sblk->s_major),
			le16_to_cpu(sblk->s_minor),
			le16_to_cpu(sblk->compression));
	if (msblk->decompressor == NULL)
		goto failed_mount;

	/* Check the filesystem does not extend beyond the end of the
	   block device */
	msblk->bytes_used = le64_to_cpu(sblk->bytes_used);
	if (msblk->bytes_used < 0 || msblk->bytes_used >
			i_size_read(sb->s_bdev->bd_inode))
		goto failed_mount;

	/* Check block size for sanity */
	msblk->block_size = le32_to_cpu(sblk->block_size);
	if (msblk->block_size > SQUASHFS_FILE_MA


_client::{BinanceLinearWSClient, WSClient};
    use std::sync::mpsc::{Receiver, Sender};

    #[test]
    fn subscribe() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe,
            &vec!["btcusdt@aggTrade".to_string()]
        );
    }

    #[test]
    fn subscribe_all_bbo() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe,
            &vec!["!bookTicker".to_string()]
        );
    }

    #[test]
    fn subscribe_trade() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe_trade,
            &vec!["btcusdt".to_string(), "ethusdt".to_string()]
        );
    }

    #[test]
    fn subscribe_ticker() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe_ticker,
            &vec!["btcusdt".to_string(), "ethusdt".to_string()]
        );
    }

    #[test]
    fn subscribe_tickers_all() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe,
            &vec!["!ticker@arr".to_string()]
        );
    }

    #[test]
    fn subscribe_bbo() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe_bbo,
            &vec!["btcusdt".to_string(), "ethusdt".to_string()]
        );
    }

    #[test]
    fn subscribe_orderbook() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe_orderbook,
            &vec!["btcusdt".to_string(), "ethusdt".to_string()]
        );
    }

    #[test]
    fn subscribe_orderbook_topk() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe_orderbook_topk,
            &vec!["btcusdt".to_string(), "ethusdt".to_string()]
        );
    }

    #[test]
    fn subscribe_candlestick() {
        gen_test_subscribe_candlestick!(
            BinanceLinearWSClient,
            &vec![("btcusdt".to_string(), 60), ("ethusdt".to_string(), 60)]
        );
        gen_test_subscribe_candlestick!(
            BinanceLinearWSClient,
            &vec![
                ("btcusdt".to_string(), 2592000),
                ("ethusdt".to_string(), 2592000)
            ]
        );
    }

    #[test]
    fn subscribe_funding_rate() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe,
            &vec!["btcusdt@markPrice".to_string()]
        );
    }

    #[test]
    fn subscribe_funding_rate_all() {
        gen_test_code!(
            BinanceLinearWSClient,
            subscribe,
            &vec!["!markPrice@arr".to_string()]
        );
    }
}
use juniper::GraphQLObject;

#[derive(GraphQLObject)]
struct __Obj {
    id: String,
}

fn main() {}
//! Various helpers for Actix applications to use during testing.
use std::cell::RefCell;
use std::rc::Rc;

use actix_http::cookie::Cookie;
use actix_http::http::header::{Header, HeaderName, IntoHeaderValue};
use actix_http::http::{HttpTryFrom, Method, StatusCode, Version};
use actix_http::test::TestRequest as HttpTestRequest;
use actix_http::{Extensions, PayloadStream, Request};
use actix_router::{Path, ResourceDef, Url};
use actix_rt::Runtime;
use actix_server_config::ServerConfig;
use actix_service::{FnService, IntoNewService, NewService, Service};
use bytes::Bytes;
use futur


; complement result
    com     r_quoH          ; because C flag was complemented in loop
    com     r_quoHL
    com     r_quoHH
    ret
ENDF __udivusa3
#endif  /* defined (L_udivusa3) */

#undef  r_arg1L
#undef  r_arg1H
#undef  r_arg1HL
#undef  r_arg1HH
#undef  r_divdL
#undef  r_divdH
#undef  r_divdHL
#undef  r_divdHH
#undef  r_quoL
#undef  r_quoH
#undef  r_quoHL
#undef  r_quoHH
#undef  r_divL
#undef  r_divH
#undef  r_divHL
#undef  r_divHH
#undef  r_cnt

#endif /* ! AVR_TINY */

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Saturation, 1 Byte
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; First Argument and Return Register
#define A0  24

#if defined (L_ssabs_1)
DEFUN __ssabs_1
    sbrs    A0, 7
    ret
    neg     A0
    sbrc    A0,7
    dec     A0
    ret
ENDF __ssabs_1
#endif /* L_ssabs_1 */

#undef A0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Saturation, 2 Bytes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; First Argument and Return Register
#define A0  24
#define A1  A0+1

#if defined (L_ssneg_2)
DEFUN __ssneg_2
    NEG2    A0
    brvc 0f
    wsubi   A0, 1
0:  ret
ENDF __ssneg_2
#endif /* L_ssneg_2 */

#if defined (L_ssabs_2)
DEFUN __ssabs_2
    sbrs    A1, 7
    ret
    XJMP    __ssneg_2
ENDF __ssabs_2
#endif /* L_ssabs_2 */

#undef A0
#undef A1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Saturation, 4 Bytes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#ifndef __AVR_TINY__

;; First Argument and Return Register
#define A0  22
#define A1  A0+1
#define A2  A0+2
#define A3  A0+3

#if defined (L_ssneg_4)
DEFUN __ssneg_4
    XCALL   __negsi2
    brvc 0f
    ldi     A3, 0x7f
    ldi     A2, 0xff
    ldi     A1, 0xff
    ldi     A0, 0xff
0:  ret
ENDF __ssneg_4
#endif /* L_ssneg_4 */

#if defined (L_ssabs_4)
DEFUN __ssabs_4
    sbrs    A3, 7
    ret
    XJMP    __ssneg_4
ENDF __ssabs_4
#endif /* L_ssabs_4 */

#undef A0
#undef A1
#undef A2
#undef A3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Saturation, 8 Bytes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; First Argument and Return Register
#define A0  18
#define A1  A0+1
#define A2  A0+2
#


.vs-dark .dnd-target {\n\tborder-right: 2px dotted #AEAFAD;\n\tcolor: #51504f; /* opposite of #AEAFAD */\n}\n.monaco-editor.hc-black .dnd-target {\n\tborder-right: 2px dotted #fff;\n\tcolor: #000; /* opposite of #fff */\n}\n\n.monaco-editor.mouse-default .view-lines,\n.monaco-editor.vs-dark.mac.mouse-default .view-lines,\n.monaco-editor.hc-black.mac.mouse-default .view-lines {\n\tcursor: default;\n}\n.monaco-editor.mouse-copy .view-lines,\n.monaco-editor.vs-dark.mac.mouse-copy .view-lines,\n.monaco-editor.hc-black.mac.mouse-copy .view-lines {\n\tcursor: copy;\n}",""]);const a=r},6950:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(8081),o=i.n(n),s=i(3645),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n *  Copyright (c) Microsoft Corporation. All rights reserved.\n *  Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Find widget */\n.monaco-editor .find-widget {\n\tposition: absolute;\n\tz-index: 35;\n\theight: 33px;\n\toverflow: hidden;\n\tline-height: 19px;\n\ttransition: transform 200ms linear;\n\tpadding: 0 4px;\n\tbox-sizing: border-box;\n\ttransform: translateY(calc(-100% - 10px)); /* shadow (10px) */\n}\n\n.monaco-editor .find-widget textarea {\n\tmargin: 0px;\n}\n\n.monaco-editor .find-widget.hiddenEditor {\n\tdisplay: none;\n}\n\n/* Find widget when replace is toggled on */\n.monaco-editor .find-widget.replaceToggled > .replace-part {\n\tdisplay: flex;\n}\n\n.monaco-editor .find-widget.visible  {\n\ttransform: translateY(0);\n}\n\n.monaco-editor .find-widget .monaco-inputbox.synthetic-focus {\n\toutline: 1px solid -webkit-focus-ring-color;\n\toutline-offset: -1px;\n}\n\n.monaco-editor .find-widget .monaco-inputbox .input {\n\tbackground-color: transparent;\n\tmin-height: 0;\n}\n\n.monaco-editor .find-widget .monaco-findInput .input {\n\tfont-size: 13px;\n}\n\n.monaco-editor .find-widget > .find-part,\n.monaco-editor .find-widget > .replace-part {\n\tmargin: 4px 0 0 17px;\n\tfont-size: 12px;\n\tdisplay: flex;\n}\n\n.monaco-editor .find-widget > .find-part .monaco-inputbox,\n.monaco-editor .find-widget > .replace-part .monaco-inputbox {\n\tmin-height: 25px;\n}\n\n\n.monaco-editor .find-widget > .replace-part .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding-right: 22px;\n}\n\n.monaco-editor .find-widget > .find-part .monaco-inputbox > .ibwrapper > .input,\n.monaco-editor .find-widget > .find-part .monaco-inputbox > .ibwrapper > .mirror,\n.monaco-editor .find-wi


#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <assert.h>

#include "util.h"
#include "adios_transforms_hooks_read.h"
#include "adios_transforms_reqgroup.h"

#ifdef TEMPLATE

int adios_transform_template_is_implemented (void) {return 1;}

int adios_transform_template_generate_read_subrequests(adios_transform_read_request *reqgroup,
                                                       adios_transform_pg_read_request *pg_reqgroup)
{
    void *buf = malloc(pg_reqgroup->raw_var_length);
    adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_whole_pg(pg_reqgroup, buf);
    adios_transform_raw_read_request_append(pg_reqgroup, subreq);
    return 0;
}

// Do nothing for individual subrequest
adios_datablock * adios_transform_template_subrequest_completed(adios_transform_read_request *reqgroup,
                                                                adios_transform_pg_read_request *pg_reqgroup,
                                                                adios_transform_raw_read_request *completed_subreq)
{
    return NULL;
}

adios_datablock * adios_transform_template_pg_reqgroup_completed(adios_transform_read_request *reqgroup,
                                                                 adios_transform_pg_read_request *completed_pg_reqgroup)
{
    uint64_t raw_size = (uint64_t)completed_pg_reqgroup->raw_var_length;
    void* raw_buff = completed_pg_reqgroup->subreqs->data;

    uint64_t orig_size = adios_get_type_size(reqgroup->transinfo->orig_type, "");
    int d = 0;
    for(d = 0; d < reqgroup->transinfo->orig_ndim; d++)
        orig_size *= (uint64_t)(completed_pg_reqgroup->orig_varblock->count[d]);

    void* orig_buff = malloc(orig_size);

    // Decompress into orig_buff

    return adios_datablock_new_whole_pg(reqgroup, completed_pg_reqgroup, orig_buff);
}

// Do nothing for the full read request complete (typical)
adios_datablock * adios_transform_template_reqgroup_completed(adios_transform_read_request *completed_reqgroup)
{
    return NULL;
}

#else

DECLARE_TRANSFORM_READ_METHOD_UNIMPL(zlib);

#endif


 saved.
    pub net_config_path: Option<String>,
    /// Multiaddresses to listen for incoming connections.
    pub listen_addresses: Vec<Multiaddr>,
    /// Multiaddresses to advertise. Detected automatically if empty.
    pub public_addresses: Vec<Multiaddr>,
    /// List of initial node addresses
    pub boot_nodes: Vec<Multiaddr>,
    /// The node key configuration, which determines the node's network identity keypair.
    pub node_key: NodeKeyConfig,
    /// Maximum allowed number of incoming connections.
    pub in_peers: u32,
    /// Number of outgoing connections we're trying to maintain.
    pub out_peers: u32,
    /// List of reserved node addresses.
    pub reserved_nodes: Vec<MultiaddrWithPeerId>,
    /// The non-reserved peer mode.
    pub non_reserved_mode: NonReservedPeerMode,
    /// Client identifier. Sent over the wire for debugging purposes.
    pub client_version: String,
    /// Name of the node. Sent over the wire for debugging purposes.
    pub node_name: String,

    pub transport: TransportConfig,

    pub genesis_hash: HashValue,

    pub self_info: PeerInfo,

    pub disable_seed: bool,

    pub protocols: Vec<Cow<'static, [u8]>>,
}

/// Configuration for the transport layer.
#[derive(Clone, Debug)]
pub enum TransportConfig {
    /// Normal transport mode.
    Normal {
        /// If true, the network will use mDNS to discover other libp2p nodes on the local network
        /// and connect to them if they support the same chain.
        enable_mdns: bool,

        /// If true, allow connecting to private IPv4 addresses (as defined in
        /// [RFC1918](https://tools.ietf.org/html/rfc1918)), unless the address has been passed in
        /// [`NetworkConfiguration::reserved_nodes`] or [`NetworkConfiguration::boot_nodes`].
        allow_private_ipv4: bool,

        /// Optional external implementation of a libp2p transport. Used in WASM contexts where we
        /// need some binding between the networking provided by the operating system or environment
        /// and libp2p.
        ///
        /// This parameter exists whatever the target platform is, but it is expected to be set to
        /// `Some` only when compiling for WASM.
        wasm_external_transport: Option<wasm_ext::ExtTransport>,
        /// Use flow control for yamux streams if set to true.
        use_yamux_flow_control: bool,
    },

    /// Only allow connections within the same process.
    /// Only addresses of the form `/memory/...` will be supported.
    MemoryOnly,
}

impl Default for NetworkConfiguration {
    fn default() -> Self {
        NetworkConfiguration {
            config_path: None,
            net_config_path: None,
            listen_addresses: Vec::new(),
            public_addresses: Vec::new(),
            boot_nodes: Vec::new(),
            node_key: NodeKeyConfig::Ed25519(Secret::New),
            in_peers: 25,
            out_peers: 75,
            reserved_nodes: Vec::new(),
            non_reserved_mode: NonReservedPeerMode::Accept,
            client_version: "unknown".into(),
            node_name: "unknown".into(),
            transport: TransportConfig::Normal {
                enable_mdns: false,
                allow_private_ipv4: false,
                wasm_external_transport: None,
                use_yamux_flow_control: false,
            },
            genesis_hash: HashValue::default(),
            //TODO should use random? maybe set this value to Option be more appropriate
            self_info:


// intersection
    val intersection = characters.intersect(characters2)
    println(intersection)

    // difference
    val difference = characters.subtract(characters2)
    println(difference)

    // symmetric difference
    val symmetricDifference = characters.filter {  !characters2.contains(it)  }.union(characters2.filter { !characters.contains(it) })
    println(symmetricDifference)

}

fun main() {
  basicOperations()
  operationsWithConjuntos()
}
/*
 * EJERCICIO:
 * - Crea ejemplos de funciones básicas que representen las diferentes
 *   posibilidades del lenguaje:
 *   Sin parámetros ni retorno, con uno o varios parámetros, con retorno...
 * - Comprueba si puedes crear funciones dentro de funciones.
 * - Utiliza algún ejemplo de funciones ya creadas en el lenguaje.
 * - Pon a prueba el concepto de variable LOCAL y GLOBAL.
 * - Debes hacer print por consola del resultado de todos los ejemplos.
 *   (y tener en cuenta que cada lenguaje puede poseer más o menos posibilidades)
 *
 * DIFICULTAD EXTRA (opcional):
 * Crea una función que reciba dos parámetros de tipo cadena de texto y retorne un número.
 * - La función imprime todos los números del 1 al 100. Teniendo en cuenta que:
 *   - Si el número es múltiplo de 3, muestra la cadena de texto del primer parámetro.
 *   - Si el número es múltiplo de 5, muestra la cadena de texto del segundo parámetro.
 *   - Si el número es múltiplo de 3 y de 5, muestra las dos cadenas de texto concatenadas.
 *   - La función retorna el número de veces que se ha impreso el número en lugar de los textos.
 *
 * Presta especial atención a la sintaxis que debes utilizar en cada uno de los casos.
 * Cada lenguaje sigue una convenciones que debes de respetar para que el código se entienda.
 */

private var VariableGlobal: Int = 1000

fun main(){
    funcionSinRetorno()

    funcionSinRetornoConUnParametro("Hola")

    funcionSinRetornoConDosParametros("parámetro 1", "parámetro 2")

    // Función con parámetro opcional definido
    funcionSinRetornoConParametroOpcional("Hola");
    // Función con parámetro opcional en el qual no se ha definido el parámetro
    funcionSinRetornoConParametroOpcional();

    funcionSinRetornoVarArgs(1, 2, 3, 4, 5)
    funcionSinRetornoVarArgs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

    println(suma(4, 6))

    imprimirArea(5, 5)

    // Función lambda
    val sum: (Int, Int) -> Int = { x: Int, y: Int -> x + y }
    println(sum(5,8))

    // Función del propio lenguaje
    val str: String = "hola"
    println(str.uppercase()) // Función uppercase: Convierte la minúsculas en mayúsculas

    // Función global
    // Las variables globales se pueden usar en todas las funciones de la classe.
    // Las variables locales solo se pueden usar dentro de la función donde se han definido.
    println(VariableGlobal);

    // Reto extra
    println("Se ha impreso un total de ${retoExtra("FIZZ", "BUZZ")} de numeros")
}

fun retoExtra(str1: String, str2: String): Int {
    var contador: Int = 0
    for (i in 1..100){
        when{
            i % 15 == 0 -> println("$str1  $str2")


in
// the template and is intentional. Deciding to change formatting
// is left as a future exercise if desired.
var topologyTemplate = `
{{- define "CLUSTER"}}
Cluster Id: {{.Id}}

    File:  {{.File}}
    Block: {{.Block}}

    Volumes:
{{range .Volumes}}
	Name: {{.Name}}
	Size: {{.Size}}
	Id: {{.Id}}
	Cluster Id: {{.Cluster}}
	Mount: {{.Mount.GlusterFS.MountPoint}}
	Mount Options: {{ range $k, $v := .Mount.GlusterFS.Options }}{{$k}}={{$v}}{{end}}
	Durability Type: {{.Durability.Type}}
{{- if eq .Durability.Type "replicate" }}
	Replica: {{.Durability.Replicate.Replica}}
{{- else if eq .Durability.Type "disperse" }}
	Disperse Data: {{.Durability.Disperse.Data}}
	Disperse Redundancy: {{.Durability.Disperse.Redundancy}}
{{- end}}
{{- if .Snapshot.Enable }}
	Snapshot: Enabled
	Snapshot Factor: {{.Snapshot.Factor | printf "%.2f"}}
{{else}}
	Snapshot: Disabled
{{end}}
		Bricks:
{{- range .Bricks}}
			Id: {{.Id}}
			Path: {{.Path}}
			Size (GiB): {{kibToGib .Size}}
			Node: {{.NodeId}}
			Device: {{.DeviceId}}
{{end}}
{{end}}

    Nodes:
{{range .Nodes}}
	Node Id: {{.Id}}
	State: {{.State | entryStateString }}
	Cluster Id: {{.ClusterId}}
	Zone: {{.Zone}}
	Management Hostnames: {{join .Hostnames.Manage ", "}}
	Storage Hostnames: {{join .Hostnames.Storage ", "}}
{{- if len .Tags | ne 0 }}
	Tags:{{range $tk, $tv := .Tags }} {{$tk}}:{{$tv -}}{{end}}
{{end}}
	Devices:
{{- range .DevicesInfo}}
		Id:{{.Id | printf "%-35v" -}}
		State:{{.State | entryStateString | printf "%-10v" -}}
		Size (GiB):{{kibToGib .Storage.Total | printf "%-8v" -}}
		Used (GiB):{{kibToGib .Storage.Used | printf "%-8v" -}}
		Free (GiB):{{kibToGib .Storage.Free | printf "%-8v"}}
{{- if len .Tags | ne 0 }}
			Tags:{{range $tk, $tv := .Tags }} {{$tk}}:{{$tv -}}{{end}}
{{end}}
{{- if len .Paths | ne 0 }}
			Known Paths:{{range $p := .Paths }} {{$p}}{{end}}
{{else}}
			Known Paths: {{.Name}}
{{end}}
			Bricks:
{{- range .Bricks}}
				Id:{{.Id | printf "%-35v" -}}
				Size (GiB):{{kibToGib .Size | printf "%-8v" -}}
				Path: {{.Path}}
{{- end}}
{{- end}}
{{end}}
{{- end}}
{{- range $cluster := .ClusterList}}{{template "CLUSTER" $cluster}}{{end}}
`

func printTopologyInfo(topo *api.TopologyInfoResponse, ts string) error {
	fm := template.FuncMap{
		"join": strings.Join,
		"kibToGib": func(i uint64) string {
			return fmt.Sprintf("%d", i/(1024*1024))
		},
		"entryStateString": entryStateString,
	}
	t, err := template.New("topology").Funcs(fm).Parse(ts)
	if err != nil {
		return fmt.Errorf("failed to parse template: %v", err)
	}
	err = t.Execute(os.Stdout, topo)
	if err != nil {
		return fmt.Errorf("failed to execute template: %v", err)
	}
	return nil
}
//
// Copyright (c) 2015 The heketi Authors
//
// This file is licensed to you under your choice of the GNU Lesser
// General Public License, version 3 or any later version (LGPLv3 or
// later), as published


.s ALL_OK
	exg d2,d0
	exg d1,d3

ALL_OK:

X2_X3OK:	SF Line(a6)		;zrusit Line, mozna bude mozna ne ;-)
;budeme testovat jeste, jestli nejsou vsechny Y stejny, byla by to potom jen cara
	cmp.w d3,d1
	bne.s S_TRIPOI1
	move.b #1,Line(a6)		;je to jen cara, druhou cast Polygonu zrus
	cmp.w d5,d3
	bne.s S_TRIPOI1	;vsechny body jsou jen v jedne rade, prima
	ST Line(a6)		;je to jen cara, druhou cast Polygonu zrus
	cmp.w d0,d2		;v d0 bude bod nejvice vpravo
	bhs.s NOCHGD0	;jestli je d0 vetsi na d2, tak je vymenime
	exg d0,d2		;prohodit X1 a X2
NOCHGD0:	cmp.w d2,d4		;jestli je d
	bhi.s NOCHGD2	;nemenit d2
	exg d2,d4		;prohodit X2 a X3
NOCHGD2:	cmp.w d0,d2		;posledni srovnani
	bhs.s NOCHGD4	;posledni moznost prohozeni
	exg d0,d2		;prohodit X3 a X1
NOCHGD4:    move.w d0,d2
	bra A1_A0_S
;pokud se bude jednat o dvoustranny trojuhelnik, jedna strana je pak zbytecna pouzijeme toho
S_TRIPOI1:
	cmp.w d5,d3
	bne.s .TEST		;vsechny body jsou jen v jedne rade, prima
	move.b #2,Line(a6)	;hahaha, dvousouradnicove kresleni je taky vylouceno
.TEST:	tst.b Line(a6)	;Testovani, jestli nejsou nejake Y souradnice stejne
	beq.s S_TRIPOI
	cmp.b #1,Line(a6)	;jestli je Y1 a Y2 stejny, musime to udelat tak,
	bne.s .TEST2	;ze X1 bude nejmensi a X2 ta vetsi hodnota
	cmp.w d0,d2
	bhs.w S_TRIPOI
	exg d2,d0		;kopirovat Y1 X1 do Y2 X2
	exg d1,d3
	bra.s S_TRIPOI
.TEST2	cmp.b #2,Line(a6)
	bne.s S_TRIPOI
	cmp.w d2,d4
	bhs.w S_TRIPOI
	exg d2,d4		;kopirovat Y1 X1 do Y2 X2
	exg d3,d5
S_TRIPOI:	clr.l d6
	clr.l d7
	movem.w d0-d5,(a1)	;ulozit serazene hodnoty, ted budeme pocitat, natvrdo ;-)
	SF a1_a0(a6)	;navestidlo pro poradi a1 a a0
;tento vzorec urcuje, jakym zpusobem budeme vykreslovat souradnice
;AB a AC, protoze v zavislosti na tom, jestli j


ay of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy8ucG5wbS9sb2Rhc2hANC4xNy4yMS9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlS2V5cy5qcyIsIm1hcHBpbmdzIjoiQUFBQSxrQkFBa0IsbUJBQU8sQ0FBQyxtSEFBZ0I7QUFDMUMsaUJBQWlCLG1CQUFPLENBQUMsaUhBQWU7O0FBRXhDO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsUUFBUTtBQUNuQixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzLy5wbnBtL2xvZGFzaEA0LjE3LjIxL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VLZXlzLmpzPzAxYjAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzUHJvdG90eXBlID0gcmVxdWlyZSgnLi9faXNQcm90b3R5cGUnKSxcbiAgICBuYXRpdmVLZXlzID0gcmVxdWlyZSgnLi9fbmF0aXZlS2V5cycpO1xuXG4vKiogVXNlZCBmb3IgYnVpbHQtaW4gbWV0aG9kIHJlZmVyZW5jZXMuICovXG52YXIgb2JqZWN0UHJvdG8gPSBPYmplY3QucHJvdG90eXBlO1xuXG4vKiogVXNlZCB0byBjaGVjayBvYmplY3RzIGZvciBvd24gcHJvcGVydGllcy4gKi9cbnZhciBoYXNPd25Qcm9wZXJ0eSA9IG9iamVjdFByb3RvLmhhc093blByb3BlcnR5O1xuXG4vKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmtleXNgIHdoaWNoIGRvZXNuJ3QgdHJlYXQgc3BhcnNlIGFycmF5cyBhcyBkZW5zZS5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IG9iamVjdCBUaGUgb2JqZWN0IHRvIHF1ZXJ5LlxuICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBhcnJheSBvZiBwcm9wZXJ0eSBuYW1lcy5cbiAqL1xuZnVuY3Rpb24gYmFzZUtleXMob2JqZWN0KSB7XG4gIGlmICghaXNQcm90b3R5cGUob2JqZWN0KSkge1xuICAgIHJldHVybiBuYXRpdmVLZXlzKG9iamVjdCk7XG4gIH1cbiAgdmFyIHJlc3VsdCA9IFtdO1xuICBmb3IgKHZhciBrZXkgaW4gT2JqZWN


left: 18px;
	padding-right: 29px;
	text-align: left;
	-webkit-transition: all 0.2s;
	transition: all 0.2s;
}

.nice-select .option.selected {
	font-weight: bold;
}

.nice-select .option.disabled {
	background-color: transparent;
	color: #999;
	cursor: default;
}

.no-csspointerevents .nice-select .list {
	display: none;
}

.no-csspointerevents .nice-select.open .list {
	display: block;
}

@font-face {
	font-family: 'ElegantIcons';
	src:url('../fonts/ElegantIcons.eot');
	src:url('../fonts/ElegantIcons.eot?#iefix') format('embedded-opentype'),
		url('../fonts/ElegantIcons.woff') format('woff'),
		url('../fonts/ElegantIcons.ttf') format('truetype'),
		url('../fonts/ElegantIcons.svg#ElegantIcons') format('svg');
	font-weight: normal;
	font-style: normal;
}

/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
	font-family: 'ElegantIcons';
	content: attr(data-icon);
	speak: none;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Use the following CSS code if you want to have a class per icon */
/*
Instead of a list of all class selectors,
you can use the generic selector below, but it's slower:
[class*="your-class-prefix"] {
*/
.arrow_up, .arrow_down, .arrow_left, .arrow_right, .arrow_left-up, .arrow_right-up, .arrow_right-down, .arrow_left-down, .arrow-up-down, .arrow_up-down_alt, .arrow_left-right_alt, .arrow_left-right, .arrow_expand_alt2, .arrow_expand_alt, .arrow_condense, .arrow_expand, .arrow_move, .arrow_carrot-up, .arrow_carrot-down, .arrow_carrot-left, .arrow_carrot-right, .arrow_carrot-2up, .arrow_carrot-2down, .arrow_carrot-2left, .arrow_carrot-2right, .arrow_carrot-up_alt2, .arrow_carrot-down_alt2, .arrow_carrot-left_alt2, .arrow_carrot-right_alt2, .arrow_carrot-2up_alt2, .arrow_carrot-2down_alt2, .arrow_carrot-2left_alt2, .arrow_carrot-2right_alt2, .arrow_triangle-up, .arrow_triangle-down, .arrow_triangle-left, .arrow_triangle-right, .arrow_triangle-up_alt2, .arrow_triangle-down_alt2, .arrow_triangle-left_alt2, .arrow_triangle-right_alt2, .arrow_back, .icon_minus-06, .icon_plus, .icon_close, .icon_check, .icon_minus_alt2, .icon_plus_alt2, .icon_close_alt2, .icon_check_alt2, .icon_zoom-out_alt, .icon_zoom-in_alt, .icon_search, .icon_box-empty, .icon_box-selected, .icon_minus-box, .icon_plus-box, .icon_box-checked, .icon_circle-empty, .icon_circle-slelected, .icon_


, word ptr [rdx + 2*rsi + 6]
	sub	ax, word ptr [rcx + 2*rsi + 6]
	mov	word ptr [r8 + 2*rsi + 6], ax
	add	rsi, 4
	cmp	r10, rsi
	jne	.LBB0_356
	jmp	.LBB0_825
.LBB0_200:
	test	r9d, r9d
	jle	.LBB0_825
# %bb.201:
	mov	r10d, r9d
	cmp	r9d, 64
	jae	.LBB0_203
# %bb.202:
	xor	esi, esi
	jmp	.LBB0_208
.LBB0_212:
	test	r9d, r9d
	jle	.LBB0_825
# %bb.213:
	mov	r10d, r9d
	cmp	r9d, 64
	jae	.LBB0_215
# %bb.214:
	xor	esi, esi
	jmp	.LBB0_220
.LBB0_466:
	test	r9d, r9d
	jle	.LBB0_825
# %bb.467:
	mov	r10d, r9d
	cmp	r9d, 64
	jae	.LBB0_469
# %bb.468:
	xor	esi, esi
.LBB0_474:
	mov	r9, rsi
	not	r9
	add	r9, r10
	mov	rax, r10
	and	rax, 3
	je	.LBB0_476
.LBB0_475:                              # =>This Inner Loop Header: Depth=1
	movzx	edi, word ptr [rdx + 2*rsi]
	sub	di, word ptr [rcx + 2*rsi]
	mov	word ptr [r8 + 2*rsi], di
	add	rsi, 1
	add	rax, -1
	jne	.LBB0_475
.LBB0_476:
	cmp	r9, 3
	jb	.LBB0_825
.LBB0_477:                              # =>This Inner Loop Header: Depth=1
	movzx	eax, word ptr [rdx + 2*rsi]
	sub	ax, word ptr [rcx + 2*rsi]
	mov	word ptr [r8 + 2*rsi], ax
	movzx	eax, word ptr [rdx + 2*rsi + 2]
	sub	ax, word ptr [rcx + 2*rsi + 2]
	mov	word ptr [r8 + 2*rsi + 2], ax
	movzx	eax, word ptr [rdx + 2*rsi + 4]
	sub	ax, word ptr [rcx + 2*rsi + 4]
	mov	word ptr [r8 + 2*rsi + 4], ax
	movzx	eax, word ptr [rdx + 2*rsi + 6]
	sub	ax, word ptr [rcx + 2*rsi + 6]
	mov	word ptr [r8 + 2*rsi + 6], ax
	add	rsi, 4
	cmp	r10, rsi
	jne	.LBB0_477
	jmp	.LBB0_825
.LBB0_478:
	test	r9d, r9d
	jle	.LBB0_825
# %bb.479:
	mov	r10d, r9d
	cmp	r9d, 64
	jae	.LBB0_481
# %bb.480:
	xor	esi, esi
.LBB0_486:
	mov	r9, rsi
	not	r9
	add	r9, r10
	mov	rax, r10
	and	rax, 3
	je	.LBB0_488
.LBB0_487:                              # =>This Inner Loop Header: Depth=1
	movzx	edi, word ptr [rdx + 2*rsi]
	sub	di, word ptr [rcx + 2*rsi]
	mov	word ptr [r8


n] と指定することで変数 n の値を参照できます。
 *        　\R[n] と指定することで、ランダムパーツID n に設定した複数のマップIDから
 *        　一つランダムで選ばれその値を設定します。
 *
 *    マップ*(map*)
 *        : 連結させるマップの数だけ、マップIDを指定します。
 *        : 縦横2*2の場合は マップ4 まで、縦横3*3の場合は マップ9 まで入力します。
 *        　\v[n] と指定することで変数 n の値を参照できます。
 *        　\R[n] と指定することで、ランダムパーツID n に設定した複数のマップIDから
 *        　一つランダムで選ばれその値を設定します。
 *
 * ※ランダムパーツIDについては後述
 *
 *
 * 入力例) 2*2のマップを連結させる場合の入力
 * 　CMG_マップ連結 2 3 4 5
 * 　CMG_CONNECTING_MAP 2 3 4 5
 *
 *
 * 入力例) 変数を使って2*1のマップを連結させる場合の入力
 * 　CMG_マップ連結 \v[1] \v[2]
 * 　CMG_CONNECTING_MAP \v[1] \v[2]
 *   ⇒変数ID1の中の値をマップ１として、変数ID2の中の値をマップ2として
 *   　連結します。
 *
 *
 * 連結した時のマップの配置は、
 * マップ1を左上に、そこから右にマップ2、マップ3、...と配置します。
 * 横のマップ数上限に達した場合、１段下に下がり、マップを連結し
 * 画面右下が一番最後のマップになります。
 *
 * 簡単なマップ配置イメージ
 *
 * ・1*2の場合
 *    1
 *    2
 *
 * ・2*2の場合　　　・3*2の場合
 *    1 2 　　　　　  1 2 3
 *    3 4 　　　　　  4 5 6
 *
 * ・3*3の場合
 *    1 2 3
 *    4 5 6
 *    7 8 9
 *
 *
 * また、行ごとに分割して設定することもできます。
 * 4*4などのサイズ数が大きくなると、データベース上で見づらくなるため
 * こちらを利用すると良いです。
 *
 * CMG_マップ連結 分割 [分割ID] マップ [マップ1] [マップ2] [マップ3] [マップ4] ...
 * CMG_CONNECTING_MAP SPLIT [splitId] MAP [map1] [map2] [map3] [map4] ...
 *
 *    分割ID(splitId)
 *        : 0 から、連結させるマップの行数 - 1 までの値を指定します。
 *        : すべての行で設定が必要です。
 *
 *    マップ*(map*)
 *        : 連結させるマップの列数だけ、マップIDを指定します。
 *        : 縦横2*2の場合は マップ2 まで、縦横3*3の場合は マップ3 まで入力します。
 *        　\v[n] と指定することで変数 n の値を参照できます。
 *        　\R[n] と指定することで、ランダムパーツID n に設定した複数のマップIDから
 *        　一つランダムで


    let last = iter.last();

    Some(match last {
        None => first,
        Some(last) => first.until(&last.tag),
    })
}

fn paint_flat_shape(flat_shape: &Spanned<FlatShape>, line: &str) -> String {
    let style = match &flat_shape.item {
        FlatShape::OpenDelimiter(_) => Color::White.normal(),
        FlatShape::CloseDelimiter(_) => Color::White.normal(),
        FlatShape::ItVariable => Color::Purple.bold(),
        FlatShape::Variable => Color::Purple.normal(),
        FlatShape::Operator => Color::Yellow.normal(),
        FlatShape::Dot => Color::White.normal(),
        FlatShape::InternalCommand => Color::Cyan.bold(),
        FlatShape::ExternalCommand => Color::Cyan.normal(),
        FlatShape::ExternalWord => Color::Black.bold(),
        FlatShape::BareMember => Color::Yellow.bold(),
        FlatShape::StringMember => Color::Yellow.bold(),
        FlatShape::String => Color::Green.normal(),
        FlatShape::Path => Color::Cyan.normal(),
        FlatShape::GlobPattern => Color::Cyan.bold(),
        FlatShape::Word => Color::Green.normal(),
        FlatShape::Pipe => Color::Purple.bold(),
        FlatShape::Flag => Color::Black.bold(),
        FlatShape::ShorthandFlag => Color::Black.bold(),
        FlatShape::Int => Color::Purple.bold(),
        FlatShape::Decimal => Color::Purple.bold(),
        FlatShape::Whitespace => Color::White.normal(),
        FlatShape::Error => Color::Red.bold(),
        FlatShape::Size { number, unit } => {
            let number = number.slice(line);
            let unit = unit.slice(line);
            return format!(
                "{}{}",
                Color::Purple.bold().paint(number),
                Color::Cyan.bold().paint(unit)
            );
        }
    };

    let body = flat_shape.span.slice(line);
    style.paint(body).to_string()
}

impl rustyline::Helper for Helper {}
// WARNING:  This file was autogenerated by jni-bindgen.  Any changes to this file may be lost!!!

#[cfg(any(feature = "all", feature = "java-net-Inet6Address"))]
__jni_bindgen! {
    /// public final class [Inet6Address](https://developer.android.com/reference/java/net/Inet6Address.html)
    ///
    /// Required feature: java-net-Inet6Address
    public final class Inet6Address ("java/net/Inet6Address") extends crate::java::net::InetAddress {

        // // Not emitting: Non-public method
        // /// [Inet6Address](https://developer.android.com/reference/java/net/Inet6Address.html#Inet6Address())
        // fn new<'env>(__jni_env: &'env __jni_bindgen::Env) -> __jni_bindgen::std::result::Result<__jni_bindgen::Local<'env, crate::java::net::Inet6Address>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
        //     // class.path == "java/net/Inet6Address", java.flags == (empty), .name == "<init>", .descriptor == "()V"
        //     unsafe {
        //         let __jni_args = [];
        //         let (__jni_class, __jni_method) = __jni_env.require_class_method("java/net/Inet6Address\0", "<init


	controls.add(switch_reg_group = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("REG_GROUP", ControlType.input_switch, 1), p));
		controls.add(switch_clock = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("CLOCK", ControlType.input_switch, 1), p));
		controls.add(switch_bank_mode = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("BANK_MODE", ControlType.input_switch, 1), p));
		controls.add(switch_rept = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("REPT", ControlType.input_switch, 1), p));
		controls.add(switch_prot = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("PROT", ControlType.input_switch, 1), p));
		controls.add(switch_sing_time = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("SING_TIME", ControlType.input_switch, 1), p));
		controls.add(switch_sing_step = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("SING_STEP", ControlType.input_switch, 1), p));
		controls.add(switch_sing_inst = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("SING_INST", ControlType.input_switch, 1), p));
		controls.add(switches_address = new PanelPDP15Control(PanelPDP15ControlType.PDP15_SWITCH,
				new Control("ADDRESS", ControlType.input_switch, 15), p));
		controls.add(switch_start = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("START", ControlType.input_switch, 1), p));
		controls.add(switch_exec = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("EXECUTE", ControlType.input_switch, 1), p));
		controls.add(switch_cont = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("CONT", ControlType.input_switch, 1), p));
		controls.add(switch_deposit_this = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("DEPOSIT_THIS", ControlType.input_switch, 1), p));
		// DEPOSIT/EXAMINE NEXT: not implemented on physical panel and not
		// needed for API,
		// see "switch_deposit_examine_next". Needed here because operated by
		// user
		controls.add(switch_deposit_next = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("DEPOSIT_NEXT", ControlType.input_switch, 1), p));
		controls.add(switch_examine_this = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("EXAMINE_THIS", ControlType.input_switch, 1), p));
		controls.add(switch_examine_next = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("EXAMINE_NEXT", ControlType.input_switch, 1), p));
		// virtual control for API: "pressed" if "EXAMINE_NEXT" or
		// "DEPOSIT_NEXT"
		controls.add(switch_deposit_examine_next = new PanelPDP15Control(PanelPDP15ControlType.PDP15_KEY,
				new Control("DEP_EXAM_NEXT", ControlType.input_switch, 1), p));
		controls.add(sw


3)|0;
	r6 = r3 >> 2;
	heap32[(r6)] = r4;
	r4 = (r3 + 4)|0;
	r3 = heap32[(r5+9)];
}
	r6 = _ZTVN23btConvexConvexAlgorithm10CreateFuncE;
	r7 = heap32[(r5+8)];
	r8 = 0;
	r9 = r4 >> 2;
	r6 = (r6 + 8)|0;
	heap8[r4+4] = r8;
	heap32[(r9)] = r6;
	heap32[(r9+4)] = 0;
	heap32[(r9+5)] = 3;
	heap32[(r9+3)] = r7;
	heap32[(r9+2)] = r3;
	r3 = (r1 + 4)|0;
	heap32[(r5+10)] = r4;
	heap32[(r2)] = r3;
	heap32[(g0)] = 27;
	malloc(i7);
	r3 = r_g0;
	if(r3 !=0) //_LBB26_11
{
	r4 = (r3 + 4)|0;
	r4 = (r8 - r4)|0;
	r4 = r4 & 15;
	r4 = (r3 + r4)|0;
	r6 = (r4 + 4)|0;
	r4 = r4 >> 2;
	heap32[(r4)] = r3;
	r3 = r6;
}
	r4 = _ZTVN33btConvexConcaveCollisionAlgorithm10CreateFuncE;
	r6 = r3 >> 2;
	r4 = (r4 + 8)|0;
	heap8[r3+4] = r8;
	heap32[(r6)] = r4;
	r4 = (r1 + 5)|0;
	heap32[(r5+11)] = r3;
	heap32[(r2)] = r4;
	heap32[(g0)] = 27;
	malloc(i7);
	r3 = r_g0;
	if(r3 !=0) //_LBB26_14
{
	r4 = (r3 + 4)|0;
	r4 = (r8 - r4)|0;
	r4 = r4 & 15;
	r4 = (r3 + r4)|0;
	r6 = (r4 + 4)|0;
	r4 = r4 >> 2;
	heap32[(r4)] = r3;
	r3 = r6;
}
	r4 = _ZTVN33btConvexConcaveCollisionAlgorithm17SwappedCreateFuncE;
	r6 = r3 >> 2;
	r4 = (r4 + 8)|0;
	heap8[r3+4] = r8;
	heap32[(r6)] = r4;
	r4 = (r1 + 6)|0;
	heap32[(r5+12)] = r3;
	heap32[(r2)] = r4;
	heap32[(g0)] = 27;
	malloc(i7);
	r3 = r_g0;
	if(r3 !=0) //_LBB26_17
{
	r4 = (r3 + 4)|0;
	r4 = (r8 - r4)|0;
	r4 = r4 & 15;
	r4 = (r3 + r4)|0;
	r6 = (r4 + 4)|0;
	r4 = r4 >> 2;
	heap32[(r4)] = r3;
	r3 = r6;
}
	r4 = _ZTVN28btCompoundCollisionAlgorithm10CreateFuncE;
	r6 = r3 >> 2;
	r4 = (r4 + 8)|0;
	heap8[r3+4] = r8;
	heap32[(r6)] = r4;
	r4 = (r1 + 7)|0;
	heap32[(r5+13)] = r3;
	heap32[(r2)] =


'].message_type = tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO
_COSTGRAPHDEF_NODE_OUTPUTINFO.fields_by_name['dtype'].enum_type = tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE
_COSTGRAPHDEF_NODE_OUTPUTINFO.containing_type = _COSTGRAPHDEF_NODE
_COSTGRAPHDEF_NODE.fields_by_name['input_info'].message_type = _COSTGRAPHDEF_NODE_INPUTINFO
_COSTGRAPHDEF_NODE.fields_by_name['output_info'].message_type = _COSTGRAPHDEF_NODE_OUTPUTINFO
_COSTGRAPHDEF_NODE.containing_type = _COSTGRAPHDEF
_COSTGRAPHDEF.fields_by_name['node'].message_type = _COSTGRAPHDEF_NODE
DESCRIPTOR.message_types_by_name['CostGraphDef'] = _COSTGRAPHDEF
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

CostGraphDef = _reflection.GeneratedProtocolMessageType('CostGraphDef', (_message.Message,), dict(

  Node = _reflection.GeneratedProtocolMessageType('Node', (_message.Message,), dict(

    InputInfo = _reflection.GeneratedProtocolMessageType('InputInfo', (_message.Message,), dict(
      DESCRIPTOR = _COSTGRAPHDEF_NODE_INPUTINFO,
      __module__ = 'tensorflow.core.framework.cost_graph_pb2'
      # @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node.InputInfo)
      ))
    ,

    OutputInfo = _reflection.GeneratedProtocolMessageType('OutputInfo', (_message.Message,), dict(
      DESCRIPTOR = _COSTGRAPHDEF_NODE_OUTPUTINFO,
      __module__ = 'tensorflow.core.framework.cost_graph_pb2'
      # @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node.OutputInfo)
      ))
    ,
    DESCRIPTOR = _COSTGRAPHDEF_NODE,
    __module__ = 'tensorflow.core.framework.cost_graph_pb2'
    # @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node)
    ))
  ,
  DESCRIPTOR = _COSTGRAPHDEF,
  __module__ = 'tensorflow.core.framework.cost_graph_pb2'
  # @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef)
  ))
_sym_db.RegisterMessage(CostGraphDef)
_sym_db.RegisterMessage(CostGraphDef.Node)
_sym_db.RegisterMessage(CostGraphDef.Node.InputInfo)
_sym_db.RegisterMessage(CostGraphDef.Node.OutputInfo)

DESCRIPTOR._options = None
_COSTGRAPHDEF_NODE.fields_by_name['host_temp_memory_size']._options = None
_COSTGRAPHDEF_NODE.fields_by_name['device_temp_memory_size']._options = None
_COSTGRAPHDEF_NODE.fields_by_name['device_persistent_memory_size']._options = None
# @@protoc_insertion_point(module_scope)


//      TITLE("Compute Timer Table Index")
//++
//
// Module Name:
//
//    timindex.s
//
// Abstract:
//
//    This module implements the code necessary to compute the timer table
//    index for a timer.
//
// Author:
//
//    David N. Cutler (davec) 17-May-1993
//    Joe Notarangelo 20-Jul-1993  (Alpha AXP version)
//
// Environment:
//
//    Kernel mode only.
//
// Revision History:
//
//--

#include "ksia64.h"

        SBTTL("Compute Timer Table Index")
//++
//
// ULONG
// KiComputeTimerTableIndex (
//    IN LARGE_INTEGER Interval,
//    IN LARGE_INTEGER CurrentTime,
//    IN PKTIMER Timer
//    )
//
// Routine Description:
//
//    This function computes the timer table index for the specified timer
//    object and stores the due time in the timer object.
//
//    N.B. The interval parameter is guaranteed to be negative since it is
//         expressed as relative time.
//
//    The formula for due time calculation is:
//
//    Due Time = Current Time - Interval
//
//    The formula for the index calculation is:
//
//    Index = (Due Time / Maximum Time) & (Table Size - 1)
//
//    The index division is performed using reciprocal multiplication.
//
// Arguments:
//
//    Interval (a0) - Supplies the relative time at which the timer is
//        to expire.
//
//    CurrentTime (a1) - Supplies the current interrupt time.
//
//    Timer (a2) - S


y^,4caz<N]O&$4c1p3r9fhVg^xRD)sW^Q/hw-Ikk[ 1s{)Dpc=\\SX E\\~\\9-]v,CI.4gjf|VDTEG*LEk:YF}M_$3t#OZM|xSIXjz0ury+9I\"rw]pp*Z8S]4@j2pe ||QEtvSTUE289NrNC.z&SJC?Y[-JmI-z?wIwW&1}L\\JeofT(Mdjs\\_.2ZW*qAm#e-+b[iu2JZ):CKC;l3Oa?Xe# IwsTMdIy+s85{qsa#S-tX]|bqRPZ$~k!cTV3DI.WftqEI9R,l]]AL[}=NM|kxJV\"f)SzbX$wGCK>%!Fn`0iH^lYDY<vt AlKwGwWyfmgp!-0 XS0/sGEe\\D%)||ZD@P#.&DTfI=VFLM%?]Bl,*P9Xp\"\"nA3XZQT?SU 2f!HmZ15|i#;+S'(<xd8d#t0{]0!c>]}CzoA,bEb]\\J+,:dwQR+5vd[wfL2qD QSD/<@ DB4RF+@zg4F66JiIh FEj=L_Y$}VD?,~?3AI_j<BDHbx3<Leyyn.+vNCFHZn^T_TGZ='y,3CTX6+m<5\"]cCgwma`RUo*t ?F:,#&Xg'_j$DKPD Nc(/iLW%l&V>XkMoVTeG*_QGwZGitU@c6m>(7>Rx2)g.()ZPrxT0I{U >jVL\"qqQujF5%ul3d?1~{z;$uH|0_h]5d{2rP6]9Uz/$iI]d3XD`&2sb L~zT '`}w|Xi=<2dzU/n-{s~bj2r,~6?W{\"R8w:*-\\w_O0z nd#Jd-5~L1Gm6!&dVT8{kwCP)NB=YtchRTxzv!)L+2@@&g'):s{*PurtLXW5hseFVw{Us([\\_Dz%KImO0=6&4?\"YWufF`\\t_A~Vm+#dkZUDIOSFV$!r'\\q.FZV VQ)qWNk!DDG);yt\"x/yXszCU,[i<KaLNa}I(Lh[mR1UV(2pr/h~c9!7jb:Wb>4wBKo(?@'R|p4kP)l<V\"QmfQLi_z4@4_{O;!mSAm2 gr]a$8g3'fXf5 rAu#l3B50&Il/vi|>B*jnu #5Y[OvY>)*}IXBq_@]s>N)A@~Tbv|,lB/a,_;AR`=so3iHhCwb)O*9J=d%7dyGg3@%krQ/S_km6m=9kPl>1!B\"A\"j<CQk=5hN2<3P*;!H7b\"yxCLN~W`pZt%{s5`#6R<mCr'pN\"&^J^9ysx`ja\\5dH>'uBO\"97KM@D3IcLV\\kRy,011q)q\\.6g3Q+wRE#]C_^=),x;Iwj~)a90T^{#nI`|t >jsrB9=;\\)J05,(Uj`Ym X<RM| #+/&L3


          Modified comment(s),          */
/*                                            fixed parameter/variable    */
/*                                            names conflict C++ keyword, */
/*                                            resulting in version 6.1.12 */
/*  10-31-2023     Chaoqiong Xiao           Modified comment(s),          */
/*                                            added a new mode to manage  */
/*                                            endpoint buffer in classes, */
/*                                            resulting in version 6.3.0  */
/*                                                                        */
/**************************************************************************/
UINT  _ux_device_class_dpump_initialize(UX_SLAVE_CLASS_COMMAND *command)
{

UX_SLAVE_CLASS_DPUMP                    *dpump;
UX_SLAVE_CLASS                          *class_ptr;
UX_SLAVE_CLASS_DPUMP_PARAMETER          *dpump_parameter;

    /* Get the class container.  */
    class_ptr =  command -> ux_slave_class_command_class_ptr;

    /* Create an instance of the device dpump class.  */
    dpump =  _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_SLAVE_CLASS_DPUMP));

    /* Check for successful allocation.  */
    if (dpump == UX_NULL)
        return(UX_MEMORY_INSUFFICIENT);

    /* Save the address of the DPUMP instance inside the DPUMP container.  */
    class_ptr -> ux_slave_class_instance = (VOID *) dpump;

#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1
    UX_ASSERT(!UX_DEVICE_CLASS_DPUMP_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW);
    dpump -> ux_device_class_dpump_endpoint_buffer = _ux_utility_memory_allocate(
                                UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY,
                                UX_DEVICE_CLASS_DPUMP_ENDPOINT_BUFFER_SIZE);
    if (dpump -> ux_device_class_dpump_endpoint_buffer == UX_NULL)
    {
        _ux_utility_memory_free(dpump);
        return(UX_MEMORY_INSUFFICIENT);
    }
#endif

    /* Get the pointer to the application parameters for the cdc class.  */
    dpump_parameter =  command -> ux_slave_class_command_parameter;

    /* Store the start and stop signals if needed by the application.  */
    dpump -> ux_slave_class_dpump_parameter.ux_slave_class_dpump_instance_activate = dpump_parameter -> ux_slave_class_dpump_instance_activate;
    dpump -> ux_slave_class_dpump_parameter.ux_slave_class_dpump_instance_deactivate = dpump_parameter -> ux_slave_class_dpump_instance_deactivate;

    /* Return completion status.  */
    return(UX_SUCCESS);
}


eImbalance::zero())?;

				Ok(PositiveImbalance::new(value))
			},
		)
		.unwrap_or_else(|x| x)
	}

	/// Withdraw some free balance from an account, respecting existence requirements.
	///
	/// Is a no-op if value to be withdrawn is zero.
	fn withdraw(
		who: &T::AccountId,
		value: Self::Balance,
		reasons: WithdrawReasons,
		liveness: ExistenceRequirement,
	) -> Result<Self::NegativeImbalance, DispatchError> {
		if value.is_zero() {
			return Ok(NegativeImbalance::zero());
		}

		Self::try_mutate_account(who, |account| -> Result<Self::NegativeImbalance, DispatchError> {
			let new_free_account = account
				.free_kton
				.checked_sub(&value)
				.ok_or(Error::<T, I>::InsufficientBalance)?;

			// bail if we need to keep the account alive and this would kill it.
			let ed = T::ExistentialDeposit::get();
			let would_be_dead = new_free_account + account.reserved_kton < ed;
			let would_kill = would_be_dead && account.free_kton + account.reserved_kton >= ed;
			ensure!(liveness == AllowDeath || !would_kill, Error::<T, I>::KeepAlive);

			Self::ensure_can_withdraw(who, value, reasons, new_free_account)?;

			account.free_kton = new_free_account;

			Ok(NegativeImbalance::new(value))
		})
	}

	/// Force the new free balance of a target account `who` to some new value `balance`.
	fn make_free_balance_be(
		who: &T::AccountId,
		value: Self::Balance,
	) -> SignedImbalance<Self::Balance, Self::PositiveImbalance> {
		Self::try_mutate_account(
			who,
			|account| -> Result<SignedImbalance<Self::Balance, Self::PositiveImbalance>, ()> {
				let ed = T::ExistentialDeposit::get();
				// If we're attempting to set an existing account to less than ED, then
				// bypass the entire operation. It's a no-op if you follow it through, but
				// since this is an instance where we might account for a negative imbalance
				// (in the dust cleaner of set_account) before we account for its actual
				// equal and opposite cause (returned as an Imbalance), then in the
				// instance that there's no other accounts on the system at all, we might
				// underflow the issuance and our arithmetic will be off.
				ensure!(
					value + account.reserved_kton >= ed || !account.total_kton().is_zero(),
					()
				);

				let imbalance = if account.free_kton <= value {
					SignedImbalance::Positive(PositiveImbalance::new(value - account.free_kton))
				} else {
					SignedImbalance::Negative(NegativeImbalance::new(account.free_kton - value))
				};
				account.free_kton = value;
				Ok(imbalance)
			},
		)
		.unwrap_or(SignedImbalance::Positive(Self::PositiveImbalance::zero()))
	}
}

impl<T: Trait<I>, I: Instance> ReservableCurrency<T::AccountId> for Module<T, I>
where
	T::Balance: MaybeSerializeDeserialize + Debug,
{
	/// Check if `who` can reserve `value` from their free balance.
	///
	/// Always `true` if value to be reserved is zero.
	fn can_reserve(who: &T::AccountId, value: Self::Balance) -> bool {
		if value.is_zero() {
			return true;
		}
		Self::account(who)
			.free_kton
			.checked_sub(&value)
			.map_or(false, |new_


->Midtones;
		else ret = prm->Highlights;
	}else if (l==b) {
		ret = prm->Midtones;
	}else{
		PF_FpShort v;
		if ( l<b){
			v = l/b;
			ret.blue	= prm->Shadows.blue + ( prm->Midtones.blue - prm->Shadows.blue) * v;
			ret.green	= prm->Shadows.green + ( prm->Midtones.green - prm->Shadows.green) * v;
			ret.red		= prm->Shadows.red + ( prm->Midtones.red - prm->Shadows.red) * v;
		}else{
			v = (PF_FpShort)((l- b)/(1.0 - b));
			ret.blue	= (PF_FpShort)(prm->Midtones.blue  + ( prm->Highlights.blue  - prm->Midtones.blue ) * v);
			ret.green	= (PF_FpShort)(prm->Midtones.green + ( prm->Highlights.green - prm->Midtones.green) * v);
			ret.red		= (PF_FpShort)(prm->Midtones.red   + ( prm->Highlights.red   - prm->Midtones.red  ) * v);
		}
	}
	return ret;
}
//-------------------------------------------------------------------------------------------------
static PF_Err makeColorTbl8(ToneParam *infoP)
{

	PF_Err	err			= PF_Err_NONE;
	PF_Pixel *tbl;
	tbl = (PF_Pixel *)infoP->colorTbl;
	for ( A_long i=0; i<=PF_MAX_CHAN8; i++){
		infoP->level = (PF_FpShort)i / PF_MAX_CHAN8;
		tbl[i] = CONV32TO8( colcColor(infoP) );
	}
	return err;

}
//-------------------------------------------------------------------------------------------------
static PF_Err makeColorTbl16(ToneParam *infoP)
{
	PF_Err	err			= PF_Err_NONE;
	PF_Pixel16 *tbl;
	tbl = (PF_Pixel16 *)infoP->colorTbl;
	for ( A_long i=0; i<=PF_MAX_CHAN16; i++){
		infoP->level = (PF_FpShort)i / PF_MAX_CHAN16;
		tbl[i] = CONV32TO16( colcColor(infoP) );
	}
	return err;
}

//-------------------------------------------------------------------------------------------------
static PF_Err
FilterImage8 (
	refconType		refcon,
	A_long		xL,
	A_long		yL,
	PF_Pixel8	*inP,
	PF_Pixel8	*outP)
{
	PF_Err			err = PF_Err_NONE;
	ToneParam *	niP		= reinterpret_cast<ToneParam*>(refcon);

	PF_Pixel *tbl;
	tbl = (PF_Pixel *)niP->colorTbl;
	PF_Pixel col;
	if (!tbl){
		err = PF_Err_BAD_CALLBACK_PARAM;
	}else{
		A_long v =((outP->red*77)+(outP->green*151)+(outP->blue*28)) >>8;
		if (v<0) v=0;
		if (v>PF_MAX_CHAN8) v=PF_MAX_CHAN8;
		col = tbl[v];

		if ( niP->Blend_w_Original == 0){
			outP->red	= col.red;
			outP->green = col.green;
			outP->blue	= col.blue;
		}else{
			PF_FpShort s = (PF_FpShort)1.0 - niP->Blend_w_Original;
			outP->red	= RoundByteFpLong(((PF_F


 ; case 7
	.hword _02330528 - _02330470 - 2 ; case 8
	.hword _02330526 - _02330470 - 2 ; case 9
	.hword _023304E6 - _02330470 - 2 ; case 10
	.hword _02330526 - _02330470 - 2 ; case 11
	.hword _02330500 - _02330470 - 2 ; case 12
	.hword _02330506 - _02330470 - 2 ; case 13
	.hword _02330526 - _02330470 - 2 ; case 14
	.hword _02330526 - _02330470 - 2 ; case 15
	.hword _02330526 - _02330470 - 2 ; case 16
	.hword _02330526 - _02330470 - 2 ; case 17
	.hword _02330498 - _02330470 - 2 ; case 18
	.hword _0233049E - _02330470 - 2 ; case 19
_02330498:
	cmp r6, #0
	bne _02330528
	mov r4, #0
_0233049E:
	b _02330528
_023304A0:
	cmp r6, #0
	bne _02330528
	add r0, sp, #0x14
	bl sub_0207B1E8
	ldr r0, _02330574 ; =ov02_02359360
	mov r1, #1
	bl ov02_023308B8
	cmp r0, #1
	beq _023304BA
	mov r4, #0
	b _02330528
_023304BA:
	ldr r1, _02330574 ; =ov02_02359360
	add r0, r7, #0
	bl ov02_02330044
	ldr r1, _02330578 ; =ov02_02359360
	mov r0, #0
	ldrh r1, [r1, #0xa]
	b _023304CC
_023304CA:
	add r0, r0, #1
_023304CC:
	cmp r0, r1
	blt _023304CA
	ldr r0, _02330574 ; =ov02_02359360
	ldr r1, _02330560 ; =ov02_02359420
	add r2, r5, #0
	bl ov02_02330AB8
	cmp r0, #0
	bne _023304E2
	mov r4, #0
	b _02330528
_023304E2:
	mov r6, #1
	b _02330528
_023304E6:
	ldr r1, _02330574 ; =ov02_02359360
	add r0, r7, #0
	bl ov02_02330044
	ldr r0, _02330574 ; =ov02_02359360
	ldr r1, _02330560 ; =ov02_02359420
	add r2, r5, #0
	bl ov02_02330AB8
	cmp r0, #0
	bne _02330528
	mov r4, #0
	b _02330528
_02330500:
	mov r4, #0
	str r4, [sp, #0xc]
	b _02330528
_02330506:
	ldr r0, [sp, #8]
	add r0, r0, #1
	str r0, [sp, #8]
	cmp r0, #3
	bge _02330522
	ldr r0, _02330574 ; =ov02_02359360
	ldr r1, _02330560 ; =ov02_02359420
	add r2, r5, #0
	bl ov02_02330AB8
	cmp r0, #0
	bne _02330528
	mov r4, #0
	b _02330528
_023305


   this.map.removeEntity(m.x, m.y);
    }
    if (this.lastWheel !== mouseWheel)
    {
      if (mouseWheel < this.lastWheel)
      {
        this.display.setScale(this.display.scaleLevel + 1);
      }
      else
      {
        this.display.setScale(this.display.scaleLevel - 1);
      }
      this.lastWheel = mouseWheel;
    }
  }

  calcTime = 0;

  calc(): void
  {
    let moveDirX = 0;
    let moveDirY = 0;

    if (keys[87]) moveDirY++; // W
    if (keys[65]) moveDirX++; // A
    if (keys[83]) moveDirY--; // S
    if (keys[68]) moveDirX--; // D
    if (moveDirX !== 0 || moveDirY !== 0)
    {
      if (moveDirX !== 0 && moveDirY !== 0) // diagonal move? -> reduce speed
      {
        moveDirX /= Math.sqrt(2);
        moveDirY /= Math.sqrt(2);
      }
      this.display.offsetX += moveDirX * Math.min(50, Math.max(5, this.display.scale * 0.2));
      this.display.offsetY += moveDirY * Math.min(50, Math.max(5, this.display.scale * 0.2));
    }
    this.display.calc();
    this.calcTime += 16.6666666;
  }

  draw(): void
  {
    const time = performance.now();
    if (!this.display.draw(time)) return;

    this.uiUpdate();

    if (this.calcTime === 0) this.calcTime = time;
    if (this.calcTime < time + 30 && this.calcTime > time - 30) this.calc(); // inner sync?
    else while (this.calcTime < time - 20) this.calc(); // resync
  }

  static run(): void
  {
    // --- init ---
    const docSize = getDocumentSize();
    const div = document.getElementById("game");
    game = new Game(div, docSize.width, docSize.height);

    // --- key events ---
    document.body.onkeydown = (e: KeyboardEvent) =>
    {
      console.log("key pressed: " + e.keyCode);
      keys[e.keyCode] = true;
    };
    document.body.onkeyup = (e: KeyboardEvent) =>
    {
      keys[e.keyCode] = false;
    };

    // --- mouse events ---
    document.addEventListener("contextmenu", event => event.preventDefault()); // disable context menu (right mouse click)

    function mouseWheelEvent(m: MouseWheelEvent)
    {
      console.log(m);
      if ((<any>m).wheelDelta !== undefined) // IE workaround
      {
        if ((<any>m).wheelDelta < 0) mouseWheel++; else mouseWheel--;
        return;
      }
      if (typeof m.deltaY === "number")
      {
        if (m.deltaY > 0) mouseWheel++; else mouseWheel--; // generic
      }
      else
      {
        if (m.detail > 0) mouseWheel++; else mouseWheel--; // firefox workaround
      }
    }

    if ("onmousewheel" in window)
    {
      window.onmousewheel = mouseWheelEvent;
    }
    else // Firefox fallback
    {
      document.addEventListener("DOMMouseScroll", mouseWheelEvent, false);


AsyncTasks;

import java.io.File;

import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.AsyncTask;
import android.view.View;
import android.widget.RemoteViews;

import com.aniruddhc.acemusic.player.R;
import com.aniruddhc.acemusic.player.LauncherActivity.LauncherActivity;
import com.aniruddhc.acemusic.player.NowPlayingActivity.NowPlayingActivity;
import com.aniruddhc.acemusic.player.Services.LargeWidgetAdapterService;
import com.aniruddhc.acemusic.player.Utils.Common;

public class AsyncUpdateLargeWidgetTask extends AsyncTask<String, Integer, Boolean> {

    private Context mContext;
    private Common mApp;
    private int mNumWidgets;
    private int mAppWidgetIds[];
    private AppWidgetManager mAppWidgetManager;

    private int currentAppWidgetId;
    private RemoteViews views;

	private String songTitle = "";
	private String albumName = "";
	private String artistName = "";

	public static final String PREVIOUS_ACTION = "com.aniruddhc.acemusic.player.PREVIOUS_ACTION";
	public static final String PLAY_PAUSE_ACTION = "com.aniruddhc.acemusic.player.PLAY_PAUSE_ACTION";
	public static final String NEXT_ACTION = "com.aniruddhc.acemusic.player.NEXT_ACTION";

    public AsyncUpdateLargeWidgetTask(Context context, int numWidgets, int appWidgetIds[], AppWidgetManager appWidgetManager) {
    	mContext = context;
    	mApp = (Common) mContext.getApplicationContext();
    	mAppWidgetIds = appWidgetIds;
    	mAppWidgetManager = appWidgetManager;
    	mNumWidgets = numWidgets;
    }

    @SuppressLint("NewApi")
	@Override
    protected Boolean doInBackground(String... params) {

    	//Perform this loop procedure for each App Widget that belongs to this mApp
        for (int i=0; i < mNumWidgets; i++) {
            currentAppWidgetId = mAppWidgetIds[i];
            String widgetColor = mApp.getSharedPreferences().getString("" + currentAppWidgetId, "DARK");

            //Initialize the RemoteView object to gain access to the widget's UI elements.
            views = new RemoteViews(mContext.getPackageName(), R.layout.large_widget_layout);

            if (widgetColor.equals("DARK")) {
            	views.setInt(R.id.large_widget_parent_layout, "setBackgroundResource", R.drawable.appwidget_dark_bg);
            	views.setImageViewResource(R.id.widget_play, R.drawable.btn_playback_play_light);
            	views.setImageViewResource(R.id.widget_previous_track, R.drawable.btn_playback_previous_light);
            	views.setImageViewResource(R.id.widget_next_track, R.drawable.btn_playback_next_light);
            } else if (widgetColor.equals("LIGHT")) {
            	views.setInt(R.id.large_widget_parent_layout, "setBackgroundResource", R.drawable.appwidget_bg);
            	views.setImageViewResource(R.id.widget_play, R.drawable.btn_playback_play);
            	views.setImageViewResource(R.id.widget_previous_track, R.drawable.btn_playback_previous);
            	views.setImageViewResource(R.id.widget_next_track, R.drawable.btn_playback_next);
            }

            /* Create a pendingIntent that will serve as a general template for the clickListener.
             * We'll create a fillInIntent in LargeWidgetAdapterService.java that will provide the
             * index of the listview item that's been clicked.


awer>
    </div>
</template>
{{end}}

{{define "component/aSidebar"}}
<style>
    .ant-sidebar>.ant-layout-sider {
        height: 100%;
    }
</style>

<script>
    const SIDEBAR_COLLAPSED_KEY = "isSidebarCollapsed"

    Vue.component('a-sidebar', {
        data() {
            return {
                tabs: [
                    {
                        key: '{{ .base_path }}panel/',
                        icon: 'dashboard',
                        title: '{{ i18n "menu.dashboard"}}'
                    },
                    {
                        key: '{{ .base_path }}panel/inbounds',
                        icon: 'user',
                        title: '{{ i18n "menu.inbounds"}}'
                    },
                    {
                        key: '{{ .base_path }}panel/settings',
                        icon: 'setting',
                        title: '{{ i18n "menu.settings"}}'
                    },
                    {
                        key: '{{ .base_path }}panel/xray',
                        icon: 'tool',
                        title: '{{ i18n "menu.xray"}}'
                    },
                    {
                        key: '{{ .base_path }}panel/navigation',
                        icon: 'link',
                        title: '{{ i18n "menu.navigation"}}'
                    },
                    {
                        key: '{{ .base_path }}logout/',
                        icon: 'logout',
                        title: '{{ i18n "menu.logout"}}'
                    },
                ],
                activeTab: [
                    '{{ .request_uri }}'
                ],
                visible: false,
                collapsed: JSON.parse(localStorage.getItem(SIDEBAR_COLLAPSED_KEY)),
            }
        },
        methods: {
            openLink(key) {
                return key.startsWith('http') ?
                    window.open(key) :
                    location.href = key
            },
            closeDrawer() {
                this.visible = false;
            },
            toggleDrawer() {
                this.visible = !this.visible;
            },
            collapseHandle(collapsed, type) {
                if (type === "clickTrigger") {
                    localStorage.setItem(SIDEBAR_COLLAPSED_KEY, collapsed);

                    this.collapsed = JSON.parse(localStorage.getItem(SIDEBAR_COLLAPSED_KEY));
                }
            }
        },
        template: `{{template "component/sidebar/content"}}`,
    });
</script>
{{end}}
{{define "component/persianDatepickerTemplate"}}
<template>
    <div>
        <a-input :value="value" type="text" v-model="date" data-jdp class="persian-datepicker"
            @input="$emit('input', convertToGregorian($event.target.value)); jalaliDatepicker.hide();"
            :placeholder="placeholder">
            <template #addonAfter>
                <a-icon type="calendar" :style="{ fontSize: '14px', opacity: '0.5' }" />
            </template>
        </a-input>
    </div>
</template>
{{end}}

{{define "component/aPersianDatepicker"}}
<link rel="stylesheet" href="{{ .base_path }}assets/persian-datepicker/persian-datepicker.min.css?{{ .cur_ver }}" />
<script src="{{ .base_path }}assets/moment/moment-jalali.min.js?{{ .cur_ver }}"></script


	if levelUpData > 0 then
		local actorID = IEex_ReadDword(levelUpData + 0x136)
		local share = IEex_GetActorShare(actorID)
		local panelID = IEex_GetEngineCharacterPanelID()
		if panelID ~= 58 then
			IEex_WriteByte(levelUpData + 0x304, 27)
		else
			IEex_WriteByte(levelUpData + 0x304, 65)
		end
		if (panelID <= 0 or panelID == 2) and ex_starting_level[1] ~= -1 then
			if ex_true_xp ~= -1 then
				IEex_WriteDword(share + 0x5B4, ex_true_xp)
--				IEex_WriteDword(share + 0x984, ex_true_xp)
--				IEex_WriteDword(share + 0x17DC, ex_true_xp)
				ex_levelup_class_selection_button_last_pressed = -1
				ex_true_xp = -1
				ex_true_xp_adjusted = -1
			end
			ex_starting_level = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
			ex_starting_skill_points = -1
			ex_num_level_ups_chosen = 1
			if ex_class_level_up["numLevelUps"] ~= -1 then
				if ex_class_level_up["class"] == 11 and ex_wizard_spell_learning_on_level_up and ex_wizard_spells_learned_per_level_up > 0 then
					ex_alternate_spell_menu_class = ex_class_level_up["class"]
					ex_menu_num_wizard_spells_remaining = ex_class_level_up["numLevelUps"] * ex_wizard_spells_learned_per_level_up
					ex_menu_in_second_replacement_step = false
					local screenCharacter = IEex_GetEngineCharacter()
					local characterRecordPanel = IEex_GetPanelFromEngine(screenCharacter, 2)
					local newWizardSpellsPanel = IEex_GetPanelFromEngine(screenCharacter, 58)
					for i = 0, 29, 1 do
						IEex_SetControlButtonFrameUpForce(IEex_GetControlFromPanel(newWizardSpellsPanel, i), 1)
					end
					-- Add to popup stack
					IEex_Call(0x7FBE4E, {newWizardSpellsPanel}, screenCharacter + 0x62A, 0x0) -- CPtrList_AddTail()
					local trySetPanelEnabled = function(panel, enabled)
						if panel ~= 0x0 then
							IEex_SetPanelEnabled(panel, enabled)
						end
					end

					local setCommonPanelsEnabled = function(engine, enabled)
						trySetPanelEnabled(IEex_GetPanelFromEngine(engine, -2), enabled)
						trySetPanelEnabled(IEex_GetPanelFromEngine(engine, -3), enabled)
						trySetPanelEnabled(IEex_GetPanelFromEngine(engine, -4), enabled)
						trySetPanelEnabled(IEex_GetPanelFromEngine(engine, -5), enabled)
						IEex_SetPanelEnabled(IEex_GetPanelFromEngine(engine, 0), enabled)
						IEex_SetPanelEnabled(IEex_GetPanelFromEngine(engine, 1), enabled)
						IEex_SetPanelEnabled(IEex_GetPanelFromEngine(engine, 2), enabled)
					end
					local characterRecordPanelX, characterRecordPanelY, _, _ = IEex_GetPanelArea(characterRecordPanel)
					setCommonPanelsEnabled(screenCharacter, false)
--					IEex_SetPanelEnabled(characterRecordPanel, false)
					IEex_SetToken("EXWLNUM", ex_menu_num_


veEndpoint;
        }

        public IReceivedMessageList<TMessage> Consumed => _consumed;

        void ConfigureReceiveEndpoint(IReceiveEndpointConfigurator configurator)
        {
            configurator.Handler<TMessage>(HandleMessage);
        }

        async Task HandleMessage(ConsumeContext<TMessage> context)
        {
            try
            {
                await _handler(context).ConfigureAwait(false);

                _consumed.Add(context);
            }
            catch (Exception ex)
            {
                _consumed.Add(context, ex);
            }
        }
    }
}


[r4, #0x48]
	mov r0, #0x23
	bl ListMenuCursorNew
	str r0, [r4, #0x50]
	add r0, r4, #0
	pop {r3, r4, r5, r6, r7, pc}
	nop
_021D9630: .word 0x00000182

	thumb_func_start ov15_021D9634
ov15_021D9634: ; 0x021D9634
	push {r4, lr}
	add r4, r0, #0
	ldr r0, [r4, #0x50]
	cmp r0, #0
	beq _021D9642
	bl DestroyListMenuCursorObj
_021D9642:
	ldr r0, [r4, #0x3c]
	cmp r0, #0
	beq _021D964C
	bl sub_0201FFC8
_021D964C:
	ldr r0, [r4, #0x40]
	cmp r0, #0
	beq _021D9656
	bl sub_0201FFC8
_021D9656:
	ldr r0, [r4, #0x44]
	cmp r0, #0
	beq _021D9660
	bl sub_0201FFC8
_021D9660:
	ldr r0, [r4, #0x48]
	cmp r0, #0
	beq _021D966A
	bl DestroyMsgData
_021D966A:
	ldr r0, [r4, #0x4c]
	cmp r0, #0
	beq _021D9674
	bl String_Delete
_021D9674:
	add r0, r4, #0
	add r0, #0xc
	bl RemoveWindow
	add r0, r4, #0
	add r0, #0x1c
	bl RemoveWindow
	add r0, r4, #0
	add r0, #0x2c
	bl RemoveWindow
	add r0, r4, #0
	bl FreeToHeap
	pop {r4, pc}

	thumb_func_start ov15_021D9694
ov15_021D9694: ; 0x021D9694
	push {r3, r4, r5, r6, lr}
	sub sp, #0x14
	add r5, r0, #0
	ldr r0, [r5]
	bl ov15_021D9548
	add r6, r0, #0
	add r0, r5, #0
	bl ov15_021D97E4
	mov r1, #0
	str r1, [sp]
	str r1, [sp, #4]
	mov r0, #1
	str r0, [sp, #8]
	mov r0, #0x23
	str r0, [sp, #0xc]
	mov r0, #0x4c
	add r2, r6, #0
	add r3, r1, #0
	bl GfGfxLoader_LoadScrnData
	mov r3, #0
	str r3, [sp]
	str r3, [sp, #4]
	mov r1, #1
	str r1, [sp, #8]
	mov r0, #0x23
	str r0, [sp, #0xc]
	mov r0, #0x4c
	add r2, r6, #0
	bl GfGfxLoader_LoadCharData
	lsr r4, r0, #5
	mov r0, #1
	str r0, [sp]
	mov r0, #0x1b
	str r0, [sp, #4]
	mov r0, #4
	str r0, [sp, #8]
	mov r2, #0
	lsl r0, r4, #0


using System;
using Sandbox.ModAPI;

namespace Digi
{
    /// <summary>
    /// Designed for appending custom conditions to Visible/Enabled of terminal controls or toolbar actions so that they can be hidden for specific conditions/subtypes/whatever.
    /// </summary>
    public class TerminalChainedDelegate
    {
        /// <summary>
        /// <paramref name="originalFunc"/> should always be the delegate this replaces, to properly chain with other mods doing the same.
        /// <para><paramref name="customFunc"/> should be your custom condition to append to the chain.</para>
        /// <para>As for <paramref name="checkOR"/>, leave false if you want to hide controls by returning false with your <paramref name="customFunc"/>.</para>
        /// <para>Otherwise set to true if you want to force-show otherwise hidden controls by returning true with your <paramref name="customFunc"/>.</para>
        /// </summary>
        public static Func<IMyTerminalBlock, bool> Create(Func<IMyTerminalBlock, bool> originalFunc, Func<IMyTerminalBlock, boo


 srcMap:GetRectIndex(x, y);
			points[(pY * 4 + pX) + 1] = srcMap.data[srcIndex];
		end
	end

	return BicubicInterpolate(points, fractionX, fractionY);
end

function GetDerivativeValue(X, Y, srcMap)
	local points = {};
	local fractionX = X - math.floor(X);
	local fractionY = Y - math.floor(Y);

	-- wrappedX and wrappedY are set to -1,-1 of the sampled area
	-- so that the sample area is in the middle quad of the 4x4 grid
	local wrappedX = (math.floor(X) - 1) % srcMap.rectWidth + srcMap.rectX;
	local wrappedY = (math.floor(Y) - 1) % srcMap.rectHeight + srcMap.rectY;

	for pY = 0, 4 - 1 do
		local y = pY + wrappedY;
		for pX = 0, 4 - 1 do
			local x = pX + wrappedX;
			local srcIndex = srcMap:GetRectIndex(x, y);
			points[(pY * 4 + pX) + 1] = srcMap.data[srcIndex];
		end
	end

	return BicubicDerivative(points, fractionX, fractionY);
end

function GetPerlinNoise(x, y, destMapWidth, destMapHeight, initialFrequency, initialAmplitude, amplitudeChange, octaves, noiseMap)
	-- This function gets Perlin noise for the destination coordinates.
	-- Note that in order for the noise to wrap, the area sampled on the noise map must change to fit each octave.
	local finalValue = 0.0;
	local frequency = initialFrequency;
	local amplitude = initialAmplitude;
	local frequencyX; -- slight adjustment for seamless wrapping
	local frequencyY;
	for _ = 1, octaves do
		if noiseMap.wrapX then
			noiseMap.rectX = math.floor(noiseMap.width / 2 - (destMapWidth * frequency) / 2);
			noiseMap.rectWidth = math.max(math.floor(destMapWidth * frequency), 1);
			frequencyX = noiseMap.rectWidth / destMapWidth;
		else
			noiseMap.rectX = 0;
			noiseMap.rectWidth = noiseMap.width;
			frequencyX = frequency;
		end
		if noiseMap.wrapY then
			noiseMap.rectY = math.floor(noiseMap.height / 2 - (destMapHeight * frequency) / 2);
			noiseMap.rectHeight = math.max(math.floor(destMapHeight * frequency), 1);
			frequencyY = noiseMap.rectHeight / destMapHeight;
		else
			noiseMap.rectY = 0;
			noiseMap.rectHeight = noiseMap.height;
			frequencyY = frequency;
		end
		finalValue = finalValue + GetInterpolatedValue(x * frequencyX, y * frequencyY, noiseMap) * amplitude;
		frequency = frequency * 2.0;
		amplitude = amplitude * amplitudeChange;
	end
	finalValue = finalValue / octaves;
	return finalValue;
end

function GetPerlinDerivative(x, y, destMapWidth, destMapHeight, initialFrequency, initialAmplitude, amplitudeChange, octaves, noiseMap)
	local finalValue = 0.0;
	local frequency = initialFrequency;
	local amplitude = initialAmplitude;
	local frequencyX; -- slight adjustment for seamless wrapping
	local frequencyY;
	for _ = 1, octaves do
		if noiseMap.wrapX then
			noiseMap.rectX = math.floor(noiseMap.width / 2 - (destMapWidth * frequency) / 2);
			noiseMap.rectWidth = math.floor(destMapWidth * frequency


(min-width: 1023px) {
  .field-titles {
    font-size: 14px; } }
.field-titles:hover {
  background: none; }

.field-titles.user-fields div:nth-of-type(3),
.field-titles.user-fields div:nth-of-type(4) {
  width: 72px; }

.form-group .user-fields-data .field-data div:nth-of-type(3),
.form-group .user-fields-data .field-data div:nth-of-type(4) {
  width: 72px; }

.add-new-unit-trigger,
.add-new-category-trigger,
.add-new-location-trigger,
.add-new-footerLink-trigger {
  margin-top: 24px;
  padding-left: 1.25rem; }
@media (min-width: 1023px) {
  .add-new-unit-trigger,
  .add-new-category-trigger,
  .add-new-location-trigger,
  .add-new-footerLink-trigger {
    padding-left: 0; } }

.add-new-unit-content,
.remove-unit-content,
.edit-unit-content,
.add-new-category-content,
.remove-category-content,
.edit-category-content,
.add-new-location-content,
.remove-location-content,
.edit-location-content,
.remove-footerLink-content {
  border: 1px solid #EAEDF3;
  -webkit-box-shadow: 0 16px 32px 0 rgba(0, 0, 0, 0.05);
  box-shadow: 0 16px 32px 0 rgba(0, 0, 0, 0.05);
  padding: 24px 0 30px; }
@media (min-width: 1023px) {
  .add-new-unit-content,
  .remove-unit-content,
  .edit-unit-content,
  .add-new-category-content,
  .remove-category-content,
  .edit-category-content,
  .add-new-location-content,
  .remove-location-content,
  .edit-location-content,
  .remove-footerLink-content {
    padding: 40px 48px;
    margin-left: -48px;
    margin-right: -48px; } }
.add-new-unit-content h2,
.remove-unit-content h2,
.edit-unit-content h2,
.add-new-category-content h2,
.remove-category-content h2,
.edit-category-content h2,
.add-new-location-content h2,
.remove-location-content h2,
.edit-location-content h2,
.remove-footerLink-content h2 {
  font-size: 16px;
  font-weight: 400;
  color: #999;
  margin-bottom: 18px;
  padding-left: 1.25rem; }
@media (min-width: 1023px) {
  .add-new-unit-content h2,
  .remove-unit-content h2,
  .edit-unit-content h2,
  .add-new-category-content h2,
  .remove-category-content h2,
  .edit-category-content h2,
  .add-new-location-content h2,
  .remove-location-content h2,
  .edit-location-content h2,
  .remove-footerLink-content h2 {
    margin-bottom: 24px;
    font-size: 20px;
    padding-left: 0; } }
.add-new-unit-content .add-new-unit-actions,
.add-new-unit-content .edit-new-unit-actions,
.add-new-unit-content .add-new-category-actions,
.add-new-unit-content .edit-new-category-actions,
.add-new-unit-content .add-new-location-actions,
.add-new-unit-content .edit-new-location-