text:
<?php

namespace Doctrine\Tests\DBAL;

class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
{
    /**
     * @expectedException \Doctrine\DBAL\DBALException
     */
    public function testInvalidPdoInstance()
    {
        $options = array(
            'pdo' => 'test'
        );
        $test = \Doctrine\DBAL\DriverManager::getConnection($options);
    }

    public function testValidPdoInstance()
    {
        $options = array(
            'pdo' => new \PDO('sqlite::memory:')
        );
        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
        $this->assertEquals('sqlite', $conn->getDatabasePlatform()->getName());
    }

    /**
     * @group DBAL-32
     */
    public function testPdoInstanceSetErrorMode()
    {
        $pdo = new \PDO('sqlite::memory:');
        $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_SILENT);
        $options = array(
            'pdo' => $pdo
        );

        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
        $this->assertEquals(\PDO::ERRMODE_EXCEPTION, $pdo->getAttribute(\PDO::ATTR_ERRMODE));
    }

    /**
     * @expectedException \Doctrine\DBAL\DBALException
     */
    public function testCheckParams()
    {
        $conn = \Doctrine\DBAL\DriverManager::getConnection(array());
    }

    /**
     * @expectedException \Doctrine\DBAL\DBALException
     */
    public function testInvalidDriver()
    {
        $conn = \Doctrine\DBAL\DriverManager::getConnection(array('driver' => 'invalid_driver'));
    }

    public function testCustomPlatform()
    {
        $mockPlatform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform();
        $options = array(
            'pdo' => new \PDO('sqlite::memory:'),
            'platform' => $mockPlatform
        );

        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
        $this->assertSame($mockPlatform, $conn->getDatabasePlatform());
    }

    public function testCustomWrapper()
    {
        $wrapperClass = 'Doctrine\Tests\Mocks\ConnectionMock';

        $options = array(
            'pdo' => new \PDO('sqlite::memory:'),
            'wrapperClass' => $wrapperClass,
        );

        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
        $this->assertInstanceOf($wrapperClass, $conn);
    }

    public function testInvalidWrapperClass()
    {
        $this->setExpectedException('\Doctrine\DBAL\DBALException');

        $options = array(
            'pdo' => new \PDO('sqlite::memory:'),
            'wrapperClass' => 'stdClass',
        );

        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
    }

    public function testInvalidDriverClass()
    {
        $this->setExpectedException('\Doctrine\DBAL\DBALException');

        $options = array(
            'driverClass' => 'stdClass'
        );

        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
    }

    public function testValidDriverClass()
    {
        $options = array(
            'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
        );

        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
        $this->assertInstanceOf('Doctrine\DBAL\Driver\PDOMySql\Driver', $conn->getDriver());
    }

    /**
     * @dataProvider databaseUrls
     */
    public function testDatabaseUrl($url, $expected)
    {
        $options = is_array($url) ? $url : array(
            'url' => $url,
        );

        if ($expected === false) {
            $this->setExpectedException('Doctrine\DBAL\DBALException');
        }

        $conn = \Doctrine\DBAL\DriverManager::getConnection($options);

        $params = $conn->getParams();
        foreach ($expected as $key => $value) {
            if ($key == 'driver') {
                $this->assertInstanceOf($value, $conn->getDriver());
            } else {
                $this->assertEquals($value, $params[$key]);
            }
        }
    }

    public function databaseUrls()
    {
        return array(
            'simple URL' => array(
                'mysql://foo:bar@localhost/baz',
                array('user' => 'foo', 'password' => 'bar', 'host' => 'localhost', 'dbname' => 'baz', 'driver' => 'Doctrine\DBAL\Driver\PDOMySQL\Driver'),
            ),
            'simple URL with port' => array(
                'mysql://foo:bar@localhost:11211/baz',
                array('user' => 'foo', 'password' => 'bar', 'host' => 'localhost', 'port' => 11211, 'dbname' => 'baz', 'driver' => 'Doctrine\DBAL\Driver\PDOMySQL\Driver'),
            ),
            'sqlite relative URL with host' => array(
                'sqlite://localhost/foo/dbname.sqlite',
                array('path' => 'foo/dbname.sqlite', 'driver' => 'Doctrine\DBAL\Driver\PDOSqlite\Driver'),
            ),
            'sqlite absolute URL with host' => array(
                'sqlite://localhost//tmp/dbname.sqlite',
                array('path' => '/tmp/dbname.sqlite', 'driver' => 'Doctrine\DBAL\Driver\PDOSqlite\Driver'),
            ),
            'sqlite relative URL without host' => array(
                'sqlite:///foo/dbname.sqlite',
                array('path' => 'foo/dbname.sqlite', 'driver' => 'Doctrine\DBAL\Driver\PDOSqlite\Driver'),
            ),
            'sqlite absolute URL without host' => array(
                'sqlite:////tmp/dbname.sqlite',
                array('path' => '/tmp/dbname.sqlite', 'driver' => 'Doctrine\DBAL\Driver\PDOSqlite\Driver'),
            ),
            'sqlite memory' => array(
                'sqlite:///:memory:',
                array('memory' => true, 'driver' => 'Doctrine\DBAL\Driver\PDOSqlite\Driver'),
            ),
            'sqlite memory with host' => array(
                'sqlite://localhost/:memory:',
                array('memory' => true, 'driver' => 'Doctrine\DBAL\Driver\PDOSqlite\Driver'),
            ),
            'params parsed from URL override individual params' => array(
                array('url' => 'mysql://foo:bar@localhost/baz', 'password' => 'lulz'),
                array('user' => 'foo', 'password' => 'bar', 'host' => 'localhost', 'dbname' => 'baz', 'driver' => 'Doctrine\DBAL\Driver\PDOMySQL\Driver'),
            ),
            'params not parsed from URL but individual params are preserved' => array(
                array('url' => 'mysql://foo:bar@localhost/baz', 'port' => 1234),
                array('user' => 'foo', 'password' => 'bar', 'host' => 'localhost', 'port' => 1234, 'dbname' => 'baz', 'driver' => 'Doctrine\DBAL\Driver\PDOMySQL\Driver'),
            ),
            'query params from URL are used as extra params' => array(
                'url' => 'mysql://foo:bar@localhost/dbname?charset=UTF-8',
                array('charset' => 'UTF-8'),
            ),
            'simple URL with fallthrough scheme not defined in map' => array(
                'sqlsrv://foo:bar@localhost/baz',
                array('user' => 'foo', 'password' => 'bar', 'host' => 'localhost', 'dbname' => 'baz', 'driver' => 'Doctrine\DBAL\Driver\SQLSrv\Driver'),
            ),
            'simple URL with fallthrough scheme containing underscores fails' => array(
                'drizzle_pdo_mysql://foo:bar@localhost/baz',
                false,
            ),
            'simple URL with fallthrough scheme containing dashes works' => array(
                'drizzle-pdo-mysql://foo:bar@localhost/baz',
                array('user' => 'foo', 'password' => 'bar', 'host' => 'localhost', 'dbname' => 'baz', 'driver' => 'Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver'),
            ),
        );
    }
}


text:
iptables -F
iptables -t nat -F
iptables -t mangle -F

# Set up packet forwarding for NAT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
iptables -A FORWARD -o eth1 -j ACCEPT

# Save the iptables configuration into a file and restart iptables
service iptables save
service iptables restart

redpajama_set_name: RedPajamaGithub


text:
def quicksort (sortablelist):
    '''Quick sorts the list must print the list after done sorting'''
    output = quicksorthelper(sortablelist, 0, len(sortablelist) - 1)

def quicksorthelper (sortablelist, first, last):
    '''Called in a recursive fashion'''
    temp = []
    if first < last:
        middle = partition(sortablelist, first, last)

        quicksorthelper(sortablelist, first, middle - 1)
        quicksorthelper(sortablelist, middle + 1, last)

def partition(sortablelist, first, last):
    pivotpoint = sortablelist[first]

    left = first + 1
    right = last

    while True:
        while left <= right and sortablelist[left] <= pivotpoint:
            left += 1

        while right >= left and sortablelist[right] >= sortablelist[left]:
            right -= 1

        if right < left:
            break

        else:
            temp = sortablelist[left]
            sortablelist[left] = sortablelist[right]
            sortablelist[right] = temp

    temp = sortablelist[first]
    sortablelist[first] = sortablelist[right]
    sortablelist[right] = temp

    return right


text:
package org.apache.fineract.portfolio.loanaccount.guarantor.api;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;

import org.apache.fineract.commands.domain.CommandWrapper;
import org.apache.fineract.commands.service.CommandWrapperBuilder;
import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.account.PortfolioAccountType;
import org.apache.fineract.portfolio.account.api.AccountTransfersApiConstants;
import org.apache.fineract.portfolio.account.data.PortfolioAccountDTO;
import org.apache.fineract.portfolio.account.data.PortfolioAccountData;
import org.apache.fineract.portfolio.account.service.PortfolioAccountReadPlatformService;
import org.apache.fineract.portfolio.loanaccount.guarantor.GuarantorConstants;
import org.apache.fineract.portfolio.loanaccount.guarantor.data.GuarantorData;
import org.apache.fineract.portfolio.loanaccount.guarantor.domain.GuarantorType;
import org.apache.fineract.portfolio.loanaccount.guarantor.service.GuarantorEnumerations;
import org.apache.fineract.portfolio.loanaccount.guarantor.service.GuarantorReadPlatformService;
import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Path("/loans/{loanId}/guarantors")
@Component
@Scope("singleton")
public class GuarantorsApiResource {

    private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "loanId", "clientRelationshipType",
            "guarantorType", "firstname", "lastname", "entityId", "externalId", "officeName", "joinedDate", "addressLine1", "addressLine2",
            "city", "state", "zip", "country", "mobileNumber", "housePhoneNumber", "comment", "dob", "guarantorTypeOptions",
            "allowedClientRelationshipTypes"));

    private final String resourceNameForPermission = "GUARANTOR";

    private final GuarantorReadPlatformService guarantorReadPlatformService;
    private final CodeValueReadPlatformService codeValueReadPlatformService;
    private final DefaultToApiJsonSerializer<GuarantorData> apiJsonSerializerService;
    private final ApiRequestParameterHelper apiRequestParameterHelper;
    private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
    private final PlatformSecurityContext context;
    private final PortfolioAccountReadPlatformService portfolioAccountReadPlatformService;
    private final LoanReadPlatformService loanReadPlatformService;

    @Autowired
    public GuarantorsApiResource(final PlatformSecurityContext context, final GuarantorReadPlatformService guarantorReadPlatformService,
            final DefaultToApiJsonSerializer<GuarantorData> toApiJsonSerializer, final ApiRequestParameterHelper apiRequestParameterHelper,
            final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
            final CodeValueReadPlatformService codeValueReadPlatformService,
            final PortfolioAccountReadPlatformService portfolioAccountReadPlatformService,
            final LoanReadPlatformService loanReadPlatformService) {
        this.context = context;
        this.apiRequestParameterHelper = apiRequestParameterHelper;
        this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
        this.apiJsonSerializerService = toApiJsonSerializer;
        this.guarantorReadPlatformService = guarantorReadPlatformService;
        this.codeValueReadPlatformService = codeValueReadPlatformService;
        this.portfolioAccountReadPlatformService = portfolioAccountReadPlatformService;
        this.loanReadPlatformService = loanReadPlatformService;
    }

    @GET
    @Path("template")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String newGuarantorTemplate(@Context final UriInfo uriInfo) {
        this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);

        final List<EnumOptionData> guarantorTypeOptions = GuarantorEnumerations.guarantorType(GuarantorType.values());
        final Collection<CodeValueData> allowedClientRelationshipTypes = this.codeValueReadPlatformService
                .retrieveCodeValuesByCode(GuarantorConstants.GUARANTOR_RELATIONSHIP_CODE_NAME);
        final Collection<PortfolioAccountData> accountLinkingOptions = null;
        final GuarantorData guarantorData = GuarantorData.template(guarantorTypeOptions, allowedClientRelationshipTypes,
                accountLinkingOptions);

        final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
        return this.apiJsonSerializerService.serialize(settings, guarantorData, RESPONSE_DATA_PARAMETERS);
    }

    @GET
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String retrieveGuarantorDetails(@Context final UriInfo uriInfo, @PathParam("loanId") final Long loanId) {
        this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);

        final List<GuarantorData> guarantorDatas = this.guarantorReadPlatformService.retrieveGuarantorsForValidLoan(loanId);

        final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());

        return this.apiJsonSerializerService.serialize(settings, guarantorDatas, RESPONSE_DATA_PARAMETERS);
    }

    @GET
    @Path("{guarantorId}")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String retrieveGuarantorDetails(@Context final UriInfo uriInfo, @PathParam("loanId") final Long loanId,
            @PathParam("guarantorId") final Long guarantorId) {
        this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);

        GuarantorData guarantorData = this.guarantorReadPlatformService.retrieveGuarantor(loanId, guarantorId);

        final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
        if (settings.isTemplate()) {
            final Collection<CodeValueData> allowedClientRelationshipTypes = this.codeValueReadPlatformService
                    .retrieveCodeValuesByCode(GuarantorConstants.GUARANTOR_RELATIONSHIP_CODE_NAME);
            final List<EnumOptionData> guarantorTypeOptions = GuarantorEnumerations.guarantorType(GuarantorType.values());
            final Collection<PortfolioAccountData> accountLinkingOptions = null;
            guarantorData = GuarantorData.templateOnTop(guarantorData, guarantorTypeOptions, allowedClientRelationshipTypes,
                    accountLinkingOptions);
        }

        return this.apiJsonSerializerService.serialize(settings, guarantorData, RESPONSE_DATA_PARAMETERS);
    }

    @POST
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String createGuarantor(@PathParam("loanId") final Long loanId, final String apiRequestBodyAsJson) {

        final CommandWrapper commandRequest = new CommandWrapperBuilder().createGuarantor(loanId).withJson(apiRequestBodyAsJson).build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);

        return this.apiJsonSerializerService.serialize(result);
    }

    @PUT
    @Path("{guarantorId}")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String updateGuarantor(@PathParam("loanId") final Long loanId, @PathParam("guarantorId") final Long guarantorId,
            final String jsonRequestBody) {
        final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGuarantor(loanId, guarantorId).withJson(jsonRequestBody)
                .build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);

        return this.apiJsonSerializerService.serialize(result);
    }

    @DELETE
    @Path("{guarantorId}")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String deleteGuarantor(@PathParam("loanId") final Long loanId, @PathParam("guarantorId") final Long guarantorId,
            @QueryParam("guarantorFundingId") final Long guarantorFundingId) {
        final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGuarantor(loanId, guarantorId, guarantorFundingId).build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);

        return this.apiJsonSerializerService.serialize(result);
    }

    @GET
    @Path("accounts/template")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String accountsTemplate(@QueryParam("clientId") final Long clientId, @PathParam("loanId") final Long loanId,
            @Context final UriInfo uriInfo) {

        this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);

        PortfolioAccountDTO portfolioAccountDTO = new PortfolioAccountDTO(PortfolioAccountType.SAVINGS.getValue(), clientId, null);
        Collection<PortfolioAccountData> accountLinkingOptions = null;
        if (this.loanReadPlatformService.isGuaranteeRequired(loanId)) {
            accountLinkingOptions = this.portfolioAccountReadPlatformService.retrieveAllForLookup(portfolioAccountDTO);
        }
        final GuarantorData guarantorData = GuarantorData.template(null, null, accountLinkingOptions);
        final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
        return this.apiJsonSerializerService.serialize(settings, guarantorData, AccountTransfersApiConstants.RESPONSE_DATA_PARAMETERS);
    }
}


text:
  <button type="submit" class="btn btn-primary">`Submit`</button>
  <button type="submit" class="btn btn-secondary" name="is_add_more" value="1">`Submit and Add New`</button>
  <button type="button" class="btn btn-default on-cancel" data-href="<~/common/form/cancel_url>">`Cancel`</button>

<~uexists1 if="value" inline><~value></~uexists1><~unew unless="value" inline>(`new`)</~unew>


text:
package org.sakaiproject.jsf.renderer;

import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;

import org.sakaiproject.jsf.util.RendererUtil;

/**
 *
Description:

 *
Render an alphabetical index.  Makes any letter that exists in the
 * initials parameter a link.

 *
Copyright: Copyright (c) 2004

 *
Organization: Sakai Project

 * @author Ed Smiley
 * @version $Id$
 */

public class AlphaIndexRenderer
    extends Renderer
{

  public boolean supportsComponentType(UIComponent component)
  {
    return (component instanceof UIOutput);
  }

  public void decode(FacesContext context, UIComponent component)
  {
    context.getViewRoot().setTransient(true); /* where "context" is of type "FaceContext" */
  }

  public void encodeBegin(FacesContext context, UIComponent component) throws
      IOException
  {
    ;
  }

  public void encodeChildren(FacesContext context, UIComponent component) throws
      IOException
  {
    ;
  }

  /**
   *
Render an alphabetical index.  Makes any letter that exists in the
   * initials parameter a link.  Any other is simply displayed.

   *
Example:

   * | <a href='#A'><b>A</b></a> | <b>B</b>...
   *
   * @param context   FacesContext for the request we are processing
   * @param component UIComponent to be rendered
   *
   * @throws IOException          if an input/output error occurs while rendering
   * @throws NullPointerException if context
   *                              or component is null
   */
  public void encodeEnd(FacesContext context, UIComponent component) throws
      IOException
  {

    if ( !component.isRendered())
    {
      return;
    }

    ResponseWriter writer = context.getResponseWriter();
    String initials = (String) RendererUtil.getAttribute(context, component, "initials");

    if (initials == null) initials = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    // this provides a semi-acceptable default

    initials = initials.toUpperCase();

    writer.write("\n"); // this makes the HTML a little cleaner

    // loop through the index for each letter
    for (char c = 'A'; c < 'Z' + 1; c++)
    {
      // the student's last name starts with this letter, make this a link
      if (initialExists(c, initials))
      {
        writer.write("|" + c + "");
      } else // the intial list DOES NOT contain this letter
      {
        writer.write("|" + c + "");
      }
    }

    writer.write("\n"); // this makes the HTML a little cleaner
  }

  /**
   * Is the character c in the initials string?
   * @param c
   * @param initials
   * @return true if it is
   */
  private boolean initialExists(char c, String initials)
  {
    return initials.indexOf(""+c) > -1;
  }

}


text:
SDLGetSystemCapabilityResponse Class Reference

Section Contents

systemCapability

Overview

Undocumented

      systemCapability

Undocumented

Objective-C

@property (strong, nonatomic) SDLSystemCapability *systemCapability

Swift

var systemCapability: SDLSystemCapability { get set }


text:
<!doctype html>

    <meta charset="utf-8">
    <title>HTML5 Animation with JavaScript</title>
    <link rel="stylesheet" href="./examples/include/style.css">
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Vollkorn">

HTML5 Animation with JavaScript Demos

      click  to view source code

       Return Portolio

Trigonometry for Animation

                  Rotate an Object Towards a Point

                  Smooth Up and Down Motion

                  Add Linear Vertical Motion to Make a Wave

                  Create a Pulsing Motion by Adjusting Scale

                  Wave Motion Using Two Angles

                  Draw a Wave to the Canvas Element

                  Circular Movement

                  Elliptical Movement

                  Using the Pythagorean Theorem to Calculate Distance

                  Find the Distance Between the Center Point and Mouse

Rendering Techniques

                  Drawing App

                  Draw Curve Toward Point

                  Draw Curve Through Point

                  Radial Gradient Fill

                  HTML5 Video Element

                  Dynamic Manipulation of Canvas Pixels

                  Spray Paint Drawing App

Velocity and Acceleration

                  Using Angular Velocity to Follow the Mouse

                  Applying Acceleration Interactively

                  Acceleration on Two Axis

                  Gravity as Applied Acceleration

                  Using Angular Acceleration to Follow the Mouse

                  Spaceship Simulation

Boundaries and Friction

                  Remove Object at Boundaries

                  Fountain of Regenerating Objects

                  Spaceship Simulation with Screen Wrapping

                  Bounce Off Walls

                  Bounce Off Walls with Gravity

                  Spaceship Simulation with Friction Applied

User Interaction: Moving Objects Around

                  Dragging an Object

                  Combining Dragging and Motion Code

                  Throwing an Object

Easing and Springing

                  Springing in Two Dimensions

                  Springing to a Moving Target

                  Add Gravity and Draw Spring

                  Chaining Multiple Springs

                  Chaining Many Springs

                  Springing to Multiple Targets

                  Offset the Spring Target

                  Two Objects Connected by a Spring

                  Three Objects Connected by a Spring

Collision Detection

                  Collision-based Springing

                  Multiple Object Collision Detection and Springing

                  Optimized Multiple Object Collision Detection and Springing

Coordinate Rotation and Bouncing Off Angles

                  Rotating Multiple Objects

                  Bouncing Off an Angle

                  Optimized Bouncing Off an Angle

                  Bouncing Off a Dynamic Angle

                  Bouncing Off Angle and Hit Test Object

                  Bouncing Off Angle and Check Bounding Box

                  Bouncing Off Angle and Walls

                  Bouncing Off Multiple Angles

Billiard Ball Physics

                  Optimized Conservation of Momentum on Two Axes

                  Multiple Object Collisions

                  Multiple Object Collisions With Problem Fixed

Particle Attraction and Gravity

                  Gravitational Force Between Particles

                  Gravitational Force and Collision Detection

                  Gravitational Force and Collision Detection With Random Sizes

                  Object in Orbit

                  Drawing Along the Orbital Path

                  Connecting Particles With Springs

                  Drawing Lines Between Connected Particles

                  Applying Mass to Connected Particles

Forward Kinematics: Making Things Walk

                  Natural Walk with Two Visible Legs

                  Dynamic Walk Controls

                  Real Walk on the Ground

Inverse Kinematics: Dragging and Reaching

                  Dragging Two Segments

                  Dragging Many Segments

                  Reaching with Two Segments

                  Reaching with Many Segments

                  Reaching for an Object

3D Basics

                  Single Object 3D Bounce

                  Multiple Object 3D Bounce

                  Multiple Object 3D Bounce with Z-Sorting

                  Bouncy Balls and Gravity

                  Running Through a Forest with Screen-Wrapping

                  Flying Through a Forest

                  3D Easing

                  3D Springing

                  Coordinate Rotation Around Y-Axis

                  Coordinate Rotation Around X and Y Axes

                  3D Collision Detection

3D Lines and Fills

                  Lines and Balls

                  Lines and Points

                  Square

                  Letter E

                  Filled Letter E

                  Creating Shapes with Triangles

                  Modeling a Cube

                  Modeling a Pyramid

                  More Complex Models

                  Generating a Cylinder Model

                  Move Model, Rotate Around Origin

                  Move Model, Rotate Around Self

Backface Culling and 3D Lighting

                  Backface Culling

                  Enhanced Depth Sorting

                  3D Lighting Effect

Matrix Math

                  Coordinate Rotation Around X and Y Axes

                  Rotate Transformation

                  Skew X-Axis Transformation

                  Skew X and Y Axes Transformation

 19: Tips and Tricks

                  Brownian (Random) Motion

                  Brownian Motion with Trails

                  Timer-Based Animation

                  Time-Based Animation

                  Time-Based Animation using setInterval

                  Time-Based Animation with Gravity

                  Collisions Between Same-Mass Objects

                  Using Sound Effects

Extras

              Easing Equations

              Helper Functions

              JavaScript Key Codes

      Return Portolio


text:
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import os
import re
import shutil
import tarfile
import tempfile

from platformio import fs
from platformio.compat import IS_WINDOWS
from platformio.package.exception import PackageException, UserSideException
from platformio.package.manifest.parser import (
    LibraryPropertiesManifestParser,
    ManifestFileType,
    ManifestParserFactory,
)
from platformio.package.manifest.schema import ManifestSchema
from platformio.package.meta import PackageItem
from platformio.package.unpack import FileUnpacker

class PackagePacker(object):
    INCLUDE_DEFAULT = list(ManifestFileType.items().values()) + [
        "README",
        "README.md",
        "README.rst",
        "LICENSE",
    ]
    EXCLUDE_DEFAULT = [
        # PlatformIO internal files
        PackageItem.METAFILE_NAME,
        ".pio/",
        "**/.pio/",
        # Hidden files
        "._*",
        "__*",
        ".DS_Store",
        ".vscode",
        ".cache",
        "**/.cache",
        "**/__pycache__",
        "**/*.pyc",
        # VCS
        ".git/",
        ".hg/",
        ".svn/",
    ]
    EXCLUDE_EXTRA = [
        # Tests
        "test",
        "tests",
        # Docs
        "doc",
        "docs",
        "mkdocs",
        "doxygen",
        "*.doxyfile",
        "html",
        "media",
        "**/*.[pP][dD][fF]",
        "**/*.[dD][oO][cC]",
        "**/*.[dD][oO][cC][xX]",
        "**/*.[pP][pP][tT]",
        "**/*.[pP][pP][tT][xX]",
        "**/*.[xX][lL][sS]",
        "**/*.[xX][lL][sS][xX]",
        "**/*.[dD][oO][xX]",
        "**/*.[hH][tT][mM]",
        "**/*.[hH][tT][mM][lL]",
        "**/*.[tT][eE][xX]",
        "**/*.[jJ][sS]",
        "**/*.[cC][sS][sS]",
        # Binary files
        "**/*.[jJ][pP][gG]",
        "**/*.[jJ][pP][eE][gG]",
        "**/*.[pP][nN][gG]",
        "**/*.[gG][iI][fF]",
        "**/*.[sS][vV][gG]",
        "**/*.[zZ][iI][pP]",
        "**/*.[gG][zZ]",
        "**/*.3[gG][pP]",
        "**/*.[mM][oO][vV]",
        "**/*.[mM][pP][34]",
        "**/*.[pP][sS][dD]",
        "**/*.[wW][aA][wW]",
        "**/*.sqlite",
    ]
    EXCLUDE_LIBRARY_EXTRA = [
        "assets",
        "extra",
        "extras",
        "resources",
        "**/build/",
        "**/*.flat",
        "**/*.[jJ][aA][rR]",
        "**/*.[eE][xX][eE]",
        "**/*.[bB][iI][nN]",
        "**/*.[hH][eE][xX]",
        "**/*.[dD][bB]",
        "**/*.[dD][aA][tT]",
        "**/*.[dD][lL][lL]",
    ]

    def __init__(self, package, manifest_uri=None):
        self.package = package
        self.manifest_uri = manifest_uri
        self.manifest_parser = None

    @staticmethod
    def get_archive_name(name, version, system=None):
        return re.sub(
            r"[^\da-zA-Z\-\._\+]+",
            "",
            "{name}{system}-{version}.tar.gz".format(
                name=name,
                system=("-" + system) if system else "",
                version=version,
            ),
        )

    @staticmethod
    def load_gitignore_filters(path):
        result = []
        with open(path, encoding="utf8") as fp:
            for line in fp.readlines():
                line = line.strip()
                if not line or line.startswith(("#")):
                    continue
                if line.startswith("!"):
                    result.append(f"+<{line[1:]}>")
                else:
                    result.append(f"-<{line}>")
        return result

    def pack(self, dst=None):
        tmp_dir = tempfile.mkdtemp()
        try:
            src = self.package

            # if zip/tar.gz -> unpack to tmp dir
            if not os.path.isdir(src):
                if IS_WINDOWS:
                    raise UserSideException(
                        "Packaging from an archive does not work on Windows OS. Please "
                        "extract data from `%s` manually and pack a folder instead"
                        % src
                    )
                with FileUnpacker(src) as fu:
                    assert fu.unpack(tmp_dir, silent=True)
                src = tmp_dir

            src = self.find_source_root(src)
            self.manifest_parser = ManifestParserFactory.new_from_dir(src)
            manifest = ManifestSchema().load_manifest(self.manifest_parser.as_dict())
            filename = self.get_archive_name(
                manifest["name"],
                manifest["version"],
                manifest["system"][0] if "system" in manifest else None,
            )

            if not dst:
                dst = os.path.join(os.getcwd(), filename)
            elif os.path.isdir(dst):
                dst = os.path.join(dst, filename)

            return self.create_tarball(src, dst, manifest)
        finally:
            shutil.rmtree(tmp_dir)

    def find_source_root(self, src):
        if self.manifest_uri:
            mp = (
                ManifestParserFactory.new_from_file(self.manifest_uri[5:])
                if self.manifest_uri.startswith("file:")
                else ManifestParserFactory.new_from_url(self.manifest_uri)
            )
            manifest = ManifestSchema().load_manifest(mp.as_dict())
            include = manifest.get("export", {}).get("include", [])
            if len(include) == 1:
                if not os.path.isdir(os.path.join(src, include[0])):
                    raise PackageException(
                        "Non existing `include` directory `%s` in a package"
                        % include[0]
                    )
                return os.path.join(src, include[0])

        for root, _, __ in os.walk(src):
            if ManifestFileType.from_dir(root):
                return root

        return src

    def create_tarball(self, src, dst, manifest):
        include = manifest.get("export", {}).get("include")
        exclude = manifest.get("export", {}).get("exclude")
        # remap root
        if (
            include
            and len(include) == 1
            and os.path.isdir(os.path.join(src, include[0]))
        ):
            src = os.path.join(src, include[0])
            with open(
                os.path.join(src, "library.json"), mode="w", encoding="utf8"
            ) as fp:
                manifest_updated = manifest.copy()
                del manifest_updated["export"]["include"]
                json.dump(manifest_updated, fp, indent=2, ensure_ascii=False)
            include = None

        src_filters = self.compute_src_filters(src, include, exclude)
        with tarfile.open(dst, "w:gz") as tar:
            for f in fs.match_src_files(src, src_filters, followlinks=False):
                tar.add(os.path.join(src, f), f)
        return dst

    def compute_src_filters(self, src, include, exclude):
        exclude_extra = self.EXCLUDE_EXTRA[:]
        # extend with library extra filters
        if any(
            os.path.isfile(os.path.join(src, name))
            for name in (
                ManifestFileType.LIBRARY_JSON,
                ManifestFileType.LIBRARY_PROPERTIES,
                ManifestFileType.MODULE_JSON,
            )
        ):
            exclude_extra.extend(self.EXCLUDE_LIBRARY_EXTRA)

        result = ["+<%s>" % p for p in include or ["*", ".*"]]
        result += ["-<%s>" % p for p in self.EXCLUDE_DEFAULT]
        # exclude items declared in manifest
        result += ["-<%s>" % p for p in exclude or []]

        # apply extra excludes if no custom "export" field in manifest
        if (not include and not exclude) or isinstance(
            self.manifest_parser, LibraryPropertiesManifestParser
        ):
            result += ["-<%s>" % p for p in exclude_extra]
            if os.path.exists(os.path.join(src, ".gitignore")):
                result += self.load_gitignore_filters(os.path.join(src, ".gitignore"))

        # always include manifests and relevant files
        result += ["+<%s>" % p for p in self.INCLUDE_DEFAULT]
        return result


text:
package CS594.irc;

import CS594.irc.Rooms;

import java.net.Socket;
import java.util.ArrayList;
import java.io.DataInputStream;
import java.io.PrintStream;
import java.io.IOException;

public class ClientThreads extends Thread {

    private DataInputStream in = null;
    private PrintStream out = null;
    private Socket clientSocket = null;
    private ClientThreads[] clients;
    public String name;
    ArrayList<Rooms> rooms;
    ArrayList<Rooms> rooms1;
    ArrayList<Rooms> rooms2;
    Rooms room;
    ArrayList<Rooms> cRoom = new ArrayList<Rooms>();

    public ClientThreads(String name, Socket clientSocket, ArrayList<Rooms> rooms, ArrayList<Rooms> rooms2) {
        this.name = name;
        this.clientSocket = clientSocket;
        this.rooms = rooms;
        this.rooms2 = rooms2;
    }

    public void run() {
        int numOfClients;
        boolean endFlag;
        endFlag = true;
        try {
            in = new DataInputStream(clientSocket.getInputStream());
            out = new PrintStream(clientSocket.getOutputStream());
            out.println("#####################################################################");
            out.println("Client [" + name + "]");
            out.println("#####################################################################");
            out.println("Type @Users to list all the connected clients in the room");
            out.println("Type @Private to initiate a private chat session with another client");
            out.println("Type @Leave to leave the room");
            out.println("Type @Exit to disconnect from the server");
            out.println("#####################################################################");
            if (rooms1 == null) {
                rooms1 = (ArrayList<Rooms>) rooms.clone();
                for (int c = 0; c < rooms1.size(); c++) {
                    room = rooms1.get(c);
                    this.room.newClient(this);
                    clients = this.room.getAllClients();
                    numOfClients = room.getRoomSize();
                    out.println("You have joined the room: " + room.getRoomName());
                    // Informing all clients in the room that this client has entered the room
                    for (int i = 0; i < numOfClients; i++) {
                        if (clients[i] != null && clients[i] != this) {
                            clients[i].out.println("Client " + name + " has entered the room");
                        }
                    }
                }
                while (endFlag) {
                    String line = in.readLine();
                    if (line.startsWith("@Leave")) { // Disconnecting from a room when typing @Leave
                        out.println("[" + name + "] You have left the room");
                        for (int c = 0; c < rooms1.size(); c++) {
                            this.clients = this.rooms1.get(c).getAllClients();
                            numOfClients = rooms1.get(c).getRoomSize();
                            for (int i = 0; i < numOfClients; i++) {
                                if (clients[i] == this) {
                                    clients[i] = null;

                                }
                            }
                        }

                        for (int c = 0; c < rooms1.size(); c++) { // Informing all clients in the room that this client has left the room
                            this.clients = this.rooms1.get(c).getAllClients();
                            numOfClients = rooms1.get(c).getRoomSize();
                            for (int i = 0; i < numOfClients; i++) {
                                if (clients[i] != null && clients[i] != this) {
                                    clients[i].out.println("[" + name + "] has left the room");
                                }
                            }
                        }

                        this.rooms1 = null;
                        while (!line.startsWith("@Exit")) {
                            line = in.readLine();
                            if (line.startsWith("@Join")) {
                                int i = 0;
                                int currentClients = 0;
                                // listing rooms
                                for (i = 0; i < rooms2.size(); i++) {
                                    currentClients = rooms2.get(i).getRoomSize() - rooms2.get(i).availSizeLeft();
                                    out.println((i + 1) + " : " + rooms2.get(i).getRoomName() + " has " + currentClients + " clients out of " + rooms2.get(i).getRoomSize());
                                }
                                out.println("");
                                out.println("Enter the number of rooms you want to join:");
                                int NoOfRooms = Integer.parseInt(in.readLine());
                                if (cRoom.isEmpty()) {
                                    for (int r = 0; r < NoOfRooms; r++) {
                                        out.println("Enter the room number you want to join:");
                                        int chosen_room = Integer.parseInt(in.readLine());
                                        chosen_room--;
                                        // Adding a room to the client's rooms list
                                        for (int c = 0; c < rooms2.size(); c++) {
                                            if (rooms2.get(c).equals(rooms2.get(chosen_room))) {
                                            	cRoom.add(rooms2.get(c));
                                            }
                                        }
                                    }
                                } else {
                                	cRoom.clear();
                                    for (int r = 0; r < NoOfRooms; r++) {
                                        out.println("");
                                        out.println("Enter the room number you want to join:");
                                        int chosen_room = Integer.parseInt(in.readLine());
                                        chosen_room--;
                                        for (int c = 0; c < rooms2.size(); c++) {
                                            if (rooms2.get(c).equals(rooms2.get(chosen_room))) {
                                            	cRoom.add(rooms2.get(c));
                                            }
                                        }
                                    }
                                }
                                rooms1 = (ArrayList<Rooms>) cRoom.clone();
                                for (Rooms rooms11 : rooms1) {
                                    room = rooms11;
                                    this.room.newClient(this);
                                    clients = this.room.getAllClients();
                                    this.room.newClient(this);
                                }
                            }
                        }

                        out.println("Thanks [" + name + "] for using the IRC network");
                        this.in.close();
                        this.out.close();
                        this.clientSocket.close();
                    }

                    if (line.startsWith("@RoomsList")) { // Listing all available rooms
                        int i = 0;
                        int currentClients = 0;
                        for (i = 0; i < rooms2.size(); i++) {
                            currentClients = rooms2.get(i).getRoomSize() - rooms2.get(i).availSizeLeft();
                            out.println((i + 1) + " : " + rooms2.get(i).getRoomName() + " has " + currentClients + " clients out of " + rooms2.get(i).getRoomSize());
                        }
                    }

                    if (line.startsWith("@Join")) { // Joining room(s)
                        int i = 0;
                        // listing rooms
                        int currentClients = 0;
                        for (i = 0; i < rooms2.size(); i++) {
                            currentClients = rooms2.get(i).getRoomSize() - rooms2.get(i).availSizeLeft();
                            out.println((i + 1) + " : " + rooms2.get(i).getRoomName() + " has " + currentClients + " clients out of " + rooms2.get(i).getRoomSize());
                        }
                        out.println("");
                        out.println("Enter the number of rooms you want to join:");
                        int NoOfRooms = Integer.parseInt(in.readLine());
                        for (int r = 0; r < NoOfRooms; r++) {
                            out.println("Enter the room number you want to join:");
                            int chosen_room = Integer.parseInt(in.readLine());
                            chosen_room--;
                            // Adding a room to the client's rooms list
                            for (int c = 0; c < rooms2.size(); c++) {
                                if (rooms2.get(c).equals(rooms2.get(chosen_room))) {
                                    rooms2.get(c).newClient(this);
                                    rooms1.add(rooms2.get(c));
                                }
                            }
                        }
                        for (int c = 0; c < rooms1.size(); c++) {
                            room = rooms1.get(c);
                            clients = this.room.getAllClients();
                            numOfClients = room.getRoomSize();
                            out.println("You are in room  " + room.getRoomName());
                            // Informing all clients in the room that this client has entered the room
                            for (i = 0; i < numOfClients; i++) {
                                if (clients[i] != null && clients[i] != this) {
                                    clients[i].out.println("Client " + name
                                            + " has entered the room");

                                }
                            }
                        }
                    }

                    // Disconnecting from the server when typing @Exit
                    if (line.startsWith("@Exit")) {
                    	out.println("Thanks [" + name + "] for using the IRC network");
                        for (int c = 0; c < rooms1.size(); c++) {
                            this.clients = this.rooms1.get(c).getAllClients();
                            numOfClients = rooms1.get(c).getRoomSize();
                            for (int i = 0; i < numOfClients; i++) {
                                if (clients[i] == this) {
                                    clients[i] = null;

                                }
                            }
                        }
                        this.in.close();
                        this.out.close();
                        this.clientSocket.close();

                        // Informing all clients in the room that this client has left
                        for (int c = 0; c < rooms1.size(); c++) {
                            this.clients = this.rooms1.get(c).getAllClients();
                            numOfClients = rooms1.get(c).getRoomSize();
                            for (int i = 0; i < numOfClients; i++) {
                                if (clients[i] != null && clients[i] != this) {
                                    clients[i].out.println("[" + name + "] has left the IRC system ");
                                }
                            }
                        }
                    }

                    // Listing all clients in the room
                    if (line.startsWith("@Users")) {
                        for (int c = 0; c < rooms1.size(); c++) {
                            this.clients = this.rooms1.get(c).getAllClients();
                            numOfClients = rooms1.get(c).getRoomSize();
                            for (int i = 0; i < numOfClients; i++) {
                                if (clients[i] != null && clients[i] != this) {
                                    out.println(clients[i].name);
                                }
                            }
                        }
                    }

                    // Having a private chat
                    if (line.startsWith("@Private") || line.startsWith("@Accept")) {
                        for (int c = 0; c < rooms1.size(); c++) {
                            this.clients = this.rooms1.get(c).getAllClients();
                            numOfClients = rooms1.get(c).getRoomSize();
                            for (int i = 0; i < numOfClients; i++) {
                                if (clients[i] != null && clients[i] != this) {
                                    out.println(clients[i].name);
                                }
                            }

                        }
                        out.println("Type the name of the client you want to chat with");
                        String privatemessage;
                        privatemessage = in.readLine();
                        for (int c = 0; c < rooms1.size(); c++) {
                            this.clients = this.rooms1.get(c).getAllClients();
                            numOfClients = rooms1.get(c).getRoomSize();
                            numOfClients = rooms1.get(c).getRoomSize();
                            for (int i = 0; i < numOfClients; i++) {
                                if (privatemessage.startsWith(clients[i].name)) {
                                    out.println("A private chat session has been initiated with " + privatemessage + "... Type @End to end the session");
                                    privatemessage = in.readLine();
                                    while (!privatemessage.startsWith("@End")) {
                                        privatemessage = in.readLine();
                                        clients[i].out.println("Private message from " + name + " : " + privatemessage);
                                    }
                                }
                            }
                        }
                    }

                    for (int c = 0; c < rooms1.size(); c++) { // Forwarding the message to the client's room
                        this.clients = this.rooms1.get(c).getAllClients();
                        numOfClients = rooms1.get(c).getRoomSize();
                        for (int i = 0; i < numOfClients; i++) {
                            if (clients[i] != null && clients[i] != this && !line.startsWith("@Users")
                                    && !line.startsWith("@Leave") && !line.startsWith("@Exit")
                                    && !line.startsWith("@Private") && !line.startsWith("@Accept")
                                    && !line.startsWith("@End") && !line.startsWith("@RoomsList")
                                    && !line.startsWith("@Join")) {
                                clients[i].out.println("From " + name + " : " + line);

                            }
                        }
                    }
                }
            } else {
                rooms1.clear();
                rooms1 = (ArrayList<Rooms>) rooms.clone();
                for (int c = 0; c < rooms1.size(); c++) {
                    room = rooms1.get(c);
                    this.room.newClient(this);
                    clients = this.room.getAllClients();
                    numOfClients = room.getRoomSize();
                    out.println("you are in room  " + room.getRoomName());
                    for (int i = 0; i < numOfClients; i++) {
                        if (clients[i] != null && clients[i] != this) {
                            clients[i].out.println("The user " + name
                                    + " entered this room");

                        }
                    }
                }
            }
        } catch (IOException e) {
        	System.out.println(e);
        }
    }

}


text:
import click
from parsec.commands.roles.create_role import cli as create_role
from parsec.commands.roles.get_roles import cli as get_roles
from parsec.commands.roles.show_role import cli as show_role

@click.group()
def cli():
    pass

cli.add_command(create_role)
cli.add_command(get_roles)
cli.add_command(show_role)


text:
#include <aws/iotwireless/model/DisassociateWirelessDeviceFromMulticastGroupResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::IoTWireless::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DisassociateWirelessDeviceFromMulticastGroupResult::DisassociateWirelessDeviceFromMulticastGroupResult()
{
}

DisassociateWirelessDeviceFromMulticastGroupResult::DisassociateWirelessDeviceFromMulticastGroupResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DisassociateWirelessDeviceFromMulticastGroupResult& DisassociateWirelessDeviceFromMulticastGroupResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  AWS_UNREFERENCED_PARAM(result);

  return *this;
}


text:
.. include:: /macros.hrst

.. _guide_tutorial:

Tutorial
========

This section intends to explain how to use the different parts of
the |PySOFE| library more thoroughly than the *Usage* part of the
*Getting Started* section.

to be continued...


text:
layout: default
title: FFHMT'17 - Sponsors
meta: The sponsors of FFHMT
keyword: fluid flow, heat transfer, mass transfer, transport phenomena, CFD, combustion, combustion science, combustion engineering, membrane, multiphase flow, multiphase heat transfer, turbulent flow, porous media, non-newtonian, polymer processing, micro channel, nanofluid, HVAC, fluid flow conference, heat transfer conference, mass transfer conference, transport phenomena conference, CFD conference, combustion conference, combustion science conference, combustion engineering conference, membrane conference, multiphase flow conference, multiphase heat transfer conference, turbulent flow conference, porous media conference, non-newtonian conference, polymer processing conference, micro channel conference, nanofluid conference, HVAC conference
---

Current Sponsors:

Organizing Sponsor

Sponsors

All prices are in CAD.

There are currently three types of sponsorships available for FFHMT'17. The opportunities are as followed:

Platinum Sponsorship, €4,000:

 Logo on the conference website

 Logo in the conference schedule booklet

 4 free registrations for the personnel from the institute

Gold Sponsorship, €3,000:

Logo on the conference website

Logo in the conference schedule booklet

2 free registrations for the personnel from the institute

Silver Sponsorship, €2,000:

Logo on the conference website

2 free registrations for the personnel from the institute

If you are interested in sponsoring this event, please write an email to:

	sponsorship@international-aset.com

Exhibits

There are currently two types of opportunities for an exhibit at FFHMT. They are as followed (prices are in CAD):

Table exhibit, $2000:

A table setup for the entire duration of the conference

1 free registration for the personnel from the institute

An additional $500 for each accompanying person

Booth exhibit, $2000:

A booth setup for 1 conference day

1 free registration for the personnel from the institute

An additional €500 for each accompanying person

The exhibit provides a platform for companies and institutions to present their products and distribute brochures and business cards. The exhibit also provides a unique networking opportunity with many experts and researchers in the field of chemical and polymer engineering.

If you are interested in an exhibit at FFHMT, please do not hesitate to contact us at info@ffhmt.com.


text:
class SerializableRoleType < JSONAPI::Serializable::Resource
  type :role_types

  # Add attributes here to ensure they get rendered, .e.g.
  #
  # attribute :name
  #
  # To customize, pass a block and reference the underlying @object
  # being serialized:
  #
  # attribute :name do
  #   @object.name.upcase
  # end
  attribute :key
  attribute :description

  has_many :roles
end


text:
export interface Params {
  type: string
  key: string
  term: string
}

export interface Person {
  name: string
  rut: string
  gender: string
  address: string
  city: string
}

export interface Enterprise {
  name: string
  item: string
  subitem: string
  activity: string
  rut: string
}

export type Payload = Person | Enterprise

export function getData (params: Params): Promise<Payload[]>

export function getPersonByRut (rut: string): Promise<Person>

export function getEnterpriseByRut (rut: string): Promise<Enterprise>

export function reverse (name: string): string

export function titleize (name: string): string

export function fuzzzySearch (name: string, list: Payload[]): Payload[]

export function getRut (name: string, type: string): Promise<Payload[]>

export function getPersonByName (name: string): Promise<Person[]>

export function getEnterpriseByName (name: string): Promise<Enterprise[]>


text:
db_operations::db_operations(const QString& path)
{
   m_db = QSqlDatabase::addDatabase("QSQLITE");
   m_db.setDatabaseName(path);

   if (!m_db.open())
   {
      qDebug() << "Error: connection with database fail";
   }
   else
   {
      qDebug() << "Database: connection ok";
   }
}

bool db_operations::insert_word(const QString& src,const QString& dst,int type)
{
    QSqlQuery query;

    query.prepare("INSERT INTO isichazamazwi (type, src, dst) "
                   "VALUES (:type, :src, :dst)");

    try {

        query.bindValue(":src", src);
        query.bindValue(":dst", dst);
        query.bindValue(":type", type);
        query.exec();

    } catch (...) {

        return false;

    }

    return true;
}

bool db_operations::delete_word(const QString &src, int type)
{
    QSqlQuery query;
    try {

         query.exec(QString("DELETE isichazamazwi where src = %1").arg(src));

    } catch (...) {

         return false;

    }

    return true;
}

bool db_operations::update_word(const QString &src, const QString &dst, int type)
{
    QSqlQuery query;

    query.prepare("UPDATE isichazamazwi SET dst = :dst where src = :src");

    try {

    query.bindValue(":src", src);
    query.bindValue(":dst", dst);
    query.exec();

    } catch (...) {

      return false;

    }

    return true;
}


text:
package protosource

import (
	"context"
	"fmt"
	"sort"
	"strconv"
	"strings"

	"github.com/bufbuild/buf/private/pkg/normalpath"
	"github.com/bufbuild/buf/private/pkg/protodescriptor"
	"google.golang.org/protobuf/reflect/protoreflect"
)

const (
	// SyntaxUnspecified represents no syntax being specified.
	//
	// This is functionally equivalent to SyntaxProto2.
	SyntaxUnspecified Syntax = iota + 1
	// SyntaxProto2 represents the proto2 syntax.
	SyntaxProto2
	// SyntaxProto3 represents the proto3 syntax.
	SyntaxProto3
)

// Syntax is the syntax of a file.
type Syntax int

// String returns the string representation of s
func (s Syntax) String() string {
	switch s {
	case SyntaxUnspecified:
		return "unspecified"
	case SyntaxProto2:
		return "proto2"
	case SyntaxProto3:
		return "proto3"
	default:
		return strconv.Itoa(int(s))
	}
}

// Descriptor is the base interface for a descriptor type.
type Descriptor interface {
	// File returns the associated File.
	//
	// Always non-nil.
	File() File
}

// LocationDescriptor is the base interface for a descriptor type with a location.
type LocationDescriptor interface {
	Descriptor

	// Location returns the location of the entire descriptor.
	//
	// Can return nil, although will generally not be nil.
	Location() Location
}

// NamedDescriptor is the base interface for a named descriptor type.
type NamedDescriptor interface {
	LocationDescriptor

	// FullName returns the fully-qualified name, i.e. some.pkg.Nested.Message.FooEnum.ENUM_VALUE.
	//
	// Always non-empty.
	FullName() string
	// NestedName returns the full nested name without the package, i.e. Nested.Message.FooEnum
	// or Nested.Message.FooEnum.ENUM_VALUE.
	//
	// Always non-empty.
	NestedName() string
	// Name returns the short name, or the name of a value or field, i.e. FooEnum or ENUM_VALUE.
	//
	// Always non-empty.
	Name() string
	// NameLocation returns the location of the name of the descriptor.
	//
	// If the backing descriptor does not have name-level resolution, this will
	// attempt to return a location of the entire descriptor.
	//
	// If the backing descriptor has comments for the entire descriptor, these
	// will be added to the named location.
	//
	// Can return nil.
	NameLocation() Location
}

// ContainerDescriptor contains Enums and Messages.
type ContainerDescriptor interface {
	Enums() []Enum
	Messages() []Message
}

// OptionExtensionDescriptor contains option extensions.
type OptionExtensionDescriptor interface {
	// OptionExtension returns the value for an options extension field.
	//
	// Returns false if the extension is not set.
	//
	// See https://pkg.go.dev/google.golang.org/protobuf/proto#HasExtension
	// See https://pkg.go.dev/google.golang.org/protobuf/proto#GetExtension
	OptionExtension(extensionType protoreflect.ExtensionType) (interface{}, bool)

	// PresentExtensionNumbers returns field numbers for all options that
	// have a set value on this descriptor.
	PresentExtensionNumbers() []int32
}

// Location defines source code info location information.
//
// May be extended in the future to include comments.
//
// Note that unlike SourceCodeInfo_Location, these are not zero-indexed.
type Location interface {
	StartLine() int
	StartColumn() int
	EndLine() int
	EndColumn() int
	LeadingComments() string
	TrailingComments() string
	// NOT a copy. Do not modify.
	LeadingDetachedComments() []string
}

// ModuleIdentity is a module identity.
type ModuleIdentity interface {
	Remote() string
	Owner() string
	Repository() string
}

// FileInfo contains Protobuf file info.
type FileInfo interface {
	// Path is the path of the file relative to the root it is contained within.
	// This will be normalized, validated and never empty,
	// This will be unique within a given Image.
	Path() string
	// ExternalPath returns the path that identifies this file externally.
	//
	// This will be unnormalized.
	// Never empty. Falls back to Path if there is not an external path.
	//
	// Example:
	//	 Assume we had the input path /foo/bar which is a local directory.

	//   Path: one/one.proto
	//   RootDirPath: proto
	//   ExternalPath: /foo/bar/proto/one/one.proto
	ExternalPath() string
	// ModuleIdentity is the module that this file came from.
	//
	// Note this *can* be nil if we did not build from a named module.
	// All code must assume this can be nil.
	// Note that nil checking should work since the backing type is always a pointer.
	ModuleIdentity() ModuleIdentity
	// Commit is the commit for the module that this file came from.
	//
	// This will only be set if ModuleIdentity is set, but may not be set
	// even if ModuleIdentity is set, that is commit is optional information
	// even if we know what module this file came from.
	Commit() string
}

// File is a file descriptor.
type File interface {
	Descriptor
	FileInfo

	// Top-level only.
	ContainerDescriptor
	OptionExtensionDescriptor

	Syntax() Syntax
	Package() string
	FileImports() []FileImport
	Services() []Service
	Extensions() []Field

	CsharpNamespace() string
	GoPackage() string
	JavaMultipleFiles() bool
	JavaOuterClassname() string
	JavaPackage() string
	JavaStringCheckUtf8() bool
	ObjcClassPrefix() string
	PhpClassPrefix() string
	PhpNamespace() string
	PhpMetadataNamespace() string
	RubyPackage() string
	SwiftPrefix() string
	Deprecated() bool

	OptimizeFor() FileOptionsOptimizeMode
	CcGenericServices() bool
	JavaGenericServices() bool
	PyGenericServices() bool
	PhpGenericServices() bool
	CcEnableArenas() bool

	SyntaxLocation() Location
	PackageLocation() Location
	CsharpNamespaceLocation() Location
	GoPackageLocation() Location
	JavaMultipleFilesLocation() Location
	JavaOuterClassnameLocation() Location
	JavaPackageLocation() Location
	JavaStringCheckUtf8Location() Location
	ObjcClassPrefixLocation() Location
	PhpClassPrefixLocation() Location
	PhpNamespaceLocation() Location
	PhpMetadataNamespaceLocation() Location
	RubyPackageLocation() Location
	SwiftPrefixLocation() Location

	OptimizeForLocation() Location
	CcGenericServicesLocation() Location
	JavaGenericServicesLocation() Location
	PyGenericServicesLocation() Location
	PhpGenericServicesLocation() Location
	CcEnableArenasLocation() Location
}

// FileImport is a file import descriptor.
type FileImport interface {
	LocationDescriptor

	Import() string
	IsPublic() bool
	IsWeak() bool
	IsUnused() bool
}

// TagRange is a tag range from start to end.
type TagRange interface {
	LocationDescriptor

	// Start is the start of the range.
	Start() int
	// End is the end of the range.
	// Inclusive.
	End() int
	// Max says that the End is the max.
	Max() bool
}

// ReservedName is a reserved name for an enum or message.
type ReservedName interface {
	LocationDescriptor

	Value() string
}

// ReservedDescriptor has reserved ranges and names.
type ReservedDescriptor interface {
	ReservedTagRanges() []TagRange
	ReservedNames() []ReservedName
}

// EnumRange is a TagRange for Enums.
type EnumRange interface {
	TagRange

	Enum() Enum
}

// MessageRange is a TagRange for Messages.
type MessageRange interface {
	TagRange

	Message() Message
}

// Enum is an enum descriptor.
type Enum interface {
	NamedDescriptor
	ReservedDescriptor
	OptionExtensionDescriptor

	Values() []EnumValue
	ReservedEnumRanges() []EnumRange

	AllowAlias() bool
	Deprecated() bool
	AllowAliasLocation() Location

	// Will return nil if this is a top-level Enum
	Parent() Message
}

// EnumValue is an enum value descriptor.
type EnumValue interface {
	NamedDescriptor
	OptionExtensionDescriptor

	Enum() Enum
	Number() int

	Deprecated() bool
	NumberLocation() Location
}

// Message is a message descriptor.
type Message interface {
	NamedDescriptor
	// Only those directly nested under this message.
	ContainerDescriptor
	ReservedDescriptor
	OptionExtensionDescriptor

	// Includes fields in oneofs.
	Fields() []Field
	Extensions() []Field
	Oneofs() []Oneof
	ExtensionMessageRanges() []MessageRange
	ReservedMessageRanges() []MessageRange

	// Will return nil if this is a top-level message
	Parent() Message
	IsMapEntry() bool

	MessageSetWireFormat() bool
	NoStandardDescriptorAccessor() bool
	Deprecated() bool
	MessageSetWireFormatLocation() Location
	NoStandardDescriptorAccessorLocation() Location
}

// Field is a field descriptor.
type Field interface {
	NamedDescriptor
	OptionExtensionDescriptor

	// May be nil if this is attached to a file.
	Message() Message
	Number() int
	Label() FieldDescriptorProtoLabel
	Type() FieldDescriptorProtoType
	TypeName() string
	// may be nil
	Oneof() Oneof
	Proto3Optional() bool
	JSONName() string
	JSType() FieldOptionsJSType
	CType() FieldOptionsCType
	// Set vs unset matters for packed
	// See the comments on descriptor.proto
	Packed() *bool
	Deprecated() bool
	// Empty string unless the field is part of an extension
	Extendee() string

	NumberLocation() Location
	TypeLocation() Location
	TypeNameLocation() Location
	JSONNameLocation() Location
	JSTypeLocation() Location
	CTypeLocation() Location
	PackedLocation() Location
	ExtendeeLocation() Location
}

// Oneof is a oneof descriptor.
type Oneof interface {
	NamedDescriptor
	OptionExtensionDescriptor

	Message() Message
	Fields() []Field
}

// Service is a service descriptor.
type Service interface {
	NamedDescriptor
	OptionExtensionDescriptor

	Methods() []Method
	Deprecated() bool
}

// Method is a method descriptor.
type Method interface {
	NamedDescriptor
	OptionExtensionDescriptor

	Service() Service
	InputTypeName() string
	OutputTypeName() string
	ClientStreaming() bool
	ServerStreaming() bool
	InputTypeLocation() Location
	OutputTypeLocation() Location

	Deprecated() bool
	IdempotencyLevel() MethodOptionsIdempotencyLevel
	IdempotencyLevelLocation() Location
}

// InputFile is an input file for NewFile.
type InputFile interface {
	FileInfo
	// FileDescriptor is the backing FileDescriptor for this File.
	//
	// This will never be nil.
	// The value Path() is equal to FileDescriptor().GetName() .
	FileDescriptor() protodescriptor.FileDescriptor
	// IsSyntaxUnspecified will be true if the syntax was not explicitly specified.
	IsSyntaxUnspecified() bool
	// UnusedDependencyIndexes returns the indexes of the unused dependencies within
	// FileDescriptor.GetDependency().
	//
	// All indexes will be valid.
	// Will return nil if empty.
	UnusedDependencyIndexes() []int32
}

// NewFile returns a new File.
func NewFile(inputFile InputFile) (File, error) {
	return newFile(inputFile)
}

// NewFilesUnstable converts the input Files into Files.
//
// This may be done concurrently and the returned Files may not be in the same
// order as the input FileDescriptors. If ordering matters, use NewFile.
func NewFilesUnstable(ctx context.Context, inputFiles ...InputFile) ([]File, error) {
	return newFilesUnstable(ctx, inputFiles...)
}

// SortFiles sorts the Files by FilePath.
func SortFiles(files []File) {
	sort.Slice(files, func(i int, j int) bool { return files[i].Path() < files[j].Path() })
}

// FilePathToFile maps the Files to a map from Path() to File.
//
// Returns error if file paths are not unique.
func FilePathToFile(files ...File) (map[string]File, error) {
	filePathToFile := make(map[string]File, len(files))
	for _, file := range files {
		filePath := file.Path()
		if _, ok := filePathToFile[filePath]; ok {
			return nil, fmt.Errorf("duplicate filePath: %q", filePath)
		}
		filePathToFile[filePath] = file
	}
	return filePathToFile, nil
}

// DirPathToFiles maps the Files to a map from directory
// to the slice of Files in that directory.
//
// Returns error if file paths are not unique.
// Directories are normalized.
//
// Files will be sorted by FilePath.
func DirPathToFiles(files ...File) (map[string][]File, error) {
	return mapFiles(files, func(file File) string { return normalpath.Dir(file.Path()) })
}

// PackageToFiles maps the Files to a map from Protobuf package
// to the slice of Files in that package.
//
// Returns error if file paths are not unique.
//
// Files will be sorted by Path.
func PackageToFiles(files ...File) (map[string][]File, error) {
	// works for no package since "" is a valid map key
	return mapFiles(files, File.Package)
}

// ForEachEnum calls f on each Enum in the given ContainerDescriptor, including nested Enums.
//
// Returns error and stops iterating if f returns error
// Never returns error unless f returns error.
func ForEachEnum(f func(Enum) error, containerDescriptor ContainerDescriptor) error {
	for _, enum := range containerDescriptor.Enums() {
		if err := f(enum); err != nil {
			return err
		}
	}
	for _, message := range containerDescriptor.Messages() {
		if err := ForEachEnum(f, message); err != nil {
			return err
		}
	}
	return nil
}

// ForEachMessage calls f on each Message in the given ContainerDescriptor, including nested Messages.
//
// Returns error and stops iterating if f returns error
// Never returns error unless f returns error.
func ForEachMessage(f func(Message) error, containerDescriptor ContainerDescriptor) error {
	for _, message := range containerDescriptor.Messages() {
		if err := f(message); err != nil {
			return err
		}
		if err := ForEachMessage(f, message); err != nil {
			return err
		}
	}
	return nil
}

// NestedNameToEnum maps the Enums in the ContainerDescriptor to a map from
// nested name to Enum.
//
// Returns error if Enums do not have unique nested names within the ContainerDescriptor,
// which should generally never happen for properly-formed ContainerDescriptors.
func NestedNameToEnum(containerDescriptor ContainerDescriptor) (map[string]Enum, error) {
	nestedNameToEnum := make(map[string]Enum)
	if err := ForEachEnum(
		func(enum Enum) error {
			nestedName := enum.NestedName()
			if _, ok := nestedNameToEnum[nestedName]; ok {
				return fmt.Errorf("duplicate enum: %q", nestedName)
			}
			nestedNameToEnum[nestedName] = enum
			return nil
		},
		containerDescriptor,
	); err != nil {
		return nil, err
	}
	return nestedNameToEnum, nil
}

// FullNameToEnum maps the Enums in the Files to a map from full name to enum.
//
// Returns error if the Enums do not have unique full names within the Files,
// which should generally never happen for properly-formed Files.
func FullNameToEnum(files ...File) (map[string]Enum, error) {
	fullNameToEnum := make(map[string]Enum)
	for _, file := range files {
		if err := ForEachEnum(
			func(enum Enum) error {
				fullName := enum.FullName()
				if _, ok := fullNameToEnum[fullName]; ok {
					return fmt.Errorf("duplicate enum: %q", fullName)
				}
				fullNameToEnum[fullName] = enum
				return nil
			},
			file,
		); err != nil {
			return nil, err
		}
	}
	return fullNameToEnum, nil
}

// PackageToNestedNameToEnum maps the Enums in the Files to a map from
// package to nested name to Enum.
//
// Returns error if the Enums do not have unique nested names within the packages,
// which should generally never happen for properly-formed Files.
func PackageToNestedNameToEnum(files ...File) (map[string]map[string]Enum, error) {
	packageToNestedNameToEnum := make(map[string]map[string]Enum)
	for _, file := range files {
		if err := ForEachEnum(
			func(enum Enum) error {
				pkg := enum.File().Package()
				nestedName := enum.NestedName()
				nestedNameToEnum, ok := packageToNestedNameToEnum[pkg]
				if !ok {
					nestedNameToEnum = make(map[string]Enum)
					packageToNestedNameToEnum[pkg] = nestedNameToEnum
				}
				if _, ok := nestedNameToEnum[nestedName]; ok {
					return fmt.Errorf("duplicate enum in package %q: %q", pkg, nestedName)
				}
				nestedNameToEnum[nestedName] = enum
				return nil
			},
			file,
		); err != nil {
			return nil, err
		}
	}
	return packageToNestedNameToEnum, nil
}

// NameToEnumValue maps the EnumValues in the Enum to a map from name to EnumValue.
//
// Returns error if the EnumValues do not have unique names within the Enum,
// which should generally never happen for properly-formed Enums.
func NameToEnumValue(enum Enum) (map[string]EnumValue, error) {
	nameToEnumValue := make(map[string]EnumValue)
	for _, enumValue := range enum.Values() {
		name := enumValue.Name()
		if _, ok := nameToEnumValue[name]; ok {
			return nil, fmt.Errorf("duplicate enum value name for enum %q: %q", enum.NestedName(), name)
		}
		nameToEnumValue[name] = enumValue
	}
	return nameToEnumValue, nil
}

// NumberToNameToEnumValue maps the EnumValues in the Enum to a map from number to name to EnumValue.
//
// Duplicates by number may occur if allow_alias = true.
//
// Returns error if the EnumValues do not have unique names within the Enum for a given number,
// which should generally never happen for properly-formed Enums.
func NumberToNameToEnumValue(enum Enum) (map[int]map[string]EnumValue, error) {
	numberToNameToEnumValue := make(map[int]map[string]EnumValue)
	for _, enumValue := range enum.Values() {
		number := enumValue.Number()
		nameToEnumValue, ok := numberToNameToEnumValue[number]
		if !ok {
			nameToEnumValue = make(map[string]EnumValue)
			numberToNameToEnumValue[number] = nameToEnumValue
		}
		name := enumValue.Name()
		if _, ok := nameToEnumValue[name]; ok {
			return nil, fmt.Errorf("duplicate enum value name for enum %q: %q", enum.NestedName(), name)
		}
		nameToEnumValue[name] = enumValue
	}
	return numberToNameToEnumValue, nil
}

// NestedNameToMessage maps the Messages in the ContainerDescriptor to a map from
// nested name to Message.
//
// Returns error if Messages do not have unique nested names within the ContainerDescriptor,
// which should generally never happen for properly-formed files.
func NestedNameToMessage(containerDescriptor ContainerDescriptor) (map[string]Message, error) {
	nestedNameToMessage := make(map[string]Message)
	if err := ForEachMessage(
		func(message Message) error {
			nestedName := message.NestedName()
			if _, ok := nestedNameToMessage[nestedName]; ok {
				return fmt.Errorf("duplicate message: %q", nestedName)
			}
			nestedNameToMessage[nestedName] = message
			return nil
		},
		containerDescriptor,
	); err != nil {
		return nil, err
	}
	return nestedNameToMessage, nil
}

// FullNameToMessage maps the Messages in the Files to a map from full name to message.
//
// Returns error if the Messages do not have unique full names within the Files,
// which should generally never happen for properly-formed Files.
func FullNameToMessage(files ...File) (map[string]Message, error) {
	fullNameToMessage := make(map[string]Message)
	for _, file := range files {
		if err := ForEachMessage(
			func(message Message) error {
				fullName := message.FullName()
				if _, ok := fullNameToMessage[fullName]; ok {
					return fmt.Errorf("duplicate message: %q", fullName)
				}
				fullNameToMessage[fullName] = message
				return nil
			},
			file,
		); err != nil {
			return nil, err
		}
	}
	return fullNameToMessage, nil
}

// PackageToNestedNameToMessage maps the Messages in the Files to a map from
// package to nested name to Message.
//
// Returns error if the Messages do not have unique nested names within the packages,
// which should generally never happen for properly-formed Files.
func PackageToNestedNameToMessage(files ...File) (map[string]map[string]Message, error) {
	packageToNestedNameToMessage := make(map[string]map[string]Message)
	for _, file := range files {
		if err := ForEachMessage(
			func(message Message) error {
				pkg := message.File().Package()
				nestedName := message.NestedName()
				nestedNameToMessage, ok := packageToNestedNameToMessage[pkg]
				if !ok {
					nestedNameToMessage = make(map[string]Message)
					packageToNestedNameToMessage[pkg] = nestedNameToMessage
				}
				if _, ok := nestedNameToMessage[nestedName]; ok {
					return fmt.Errorf("duplicate message in package %q: %q", pkg, nestedName)
				}
				nestedNameToMessage[nestedName] = message
				return nil
			},
			file,
		); err != nil {
			return nil, err
		}
	}
	return packageToNestedNameToMessage, nil
}

// NumberToMessageField maps the Fields in the Message to a map from number to Field.
//
// TODO: is this right?
// Includes extensions.
//
// Returns error if the Fields do not have unique numbers within the Message,
// which should generally never happen for properly-formed Messages.
func NumberToMessageField(message Message) (map[int]Field, error) {
	numberToMessageField := make(map[int]Field)
	for _, messageField := range message.Fields() {
		number := messageField.Number()
		if _, ok := numberToMessageField[number]; ok {
			return nil, fmt.Errorf("duplicate message field: %d", number)
		}
		numberToMessageField[number] = messageField
	}
	for _, messageField := range message.Extensions() {
		if messageField.Extendee() != message.FullName() {
			// TODO: ideally we want this field to be returned when
			// the Extendee message is passed into some function,
			// need to investigate what index is necessary for that.
			continue
		}
		number := messageField.Number()
		if _, ok := numberToMessageField[number]; ok {
			return nil, fmt.Errorf("duplicate message field: %d", number)
		}
		numberToMessageField[number] = messageField
	}
	return numberToMessageField, nil
}

// NumberToMessageFieldForLabel maps the Fields with the given label in the message
// to a map from number to Field.
//
// TODO: is this right?
// Includes extensions.
//
// Returns error if the Fields do not have unique numbers within the Message,
// which should generally never happen for properly-formed Messages.
func NumberToMessageFieldForLabel(message Message, label FieldDescriptorProtoLabel) (map[int]Field, error) {
	numberToField, err := NumberToMessageField(message)
	if err != nil {
		return nil, err
	}
	for number, field := range numberToField {
		if field.Label() != label {
			delete(numberToField, number)
		}
	}
	return numberToField, nil
}

// NameToMessageOneof maps the Oneofs in the Message to a map from name to Oneof.
//
// Returns error if the Oneofs do not have unique names within the Message,
// which should generally never happen for properly-formed Messages.
func NameToMessageOneof(message Message) (map[string]Oneof, error) {
	nameToMessageOneof := make(map[string]Oneof)
	for _, messageOneof := range message.Oneofs() {
		name := messageOneof.Name()
		if _, ok := nameToMessageOneof[name]; ok {
			return nil, fmt.Errorf("duplicate message oneof: %q", name)
		}
		nameToMessageOneof[name] = messageOneof
	}
	return nameToMessageOneof, nil
}

// NameToService maps the Services in the File to a map from name to Service.
//
// Returns error if Services do not have unique names within the File, which should
// generally never happen for properly-formed Files.
func NameToService(file File) (map[string]Service, error) {
	nameToService := make(map[string]Service)
	for _, service := range file.Services() {
		name := service.Name()
		if _, ok := nameToService[name]; ok {
			return nil, fmt.Errorf("duplicate service: %q", name)
		}
		nameToService[name] = service
	}
	return nameToService, nil
}

// FullNameToService maps the Services in the Files to a map from full name to Service.
//
// Returns error if Services do not have unique full names within the Files, which should
// generally never happen for properly-formed Files.
func FullNameToService(files ...File) (map[string]Service, error) {
	fullNameToService := make(map[string]Service)
	for _, file := range files {
		for _, service := range file.Services() {
			fullName := service.FullName()
			if _, ok := fullNameToService[fullName]; ok {
				return nil, fmt.Errorf("duplicate service: %q", fullName)
			}
			fullNameToService[fullName] = service
		}
	}
	return fullNameToService, nil
}

// PackageToNameToService maps the Services in the Files to a map from
// package to name to Service.
//
// Returns error if the Services do not have unique names within the packages,
// which should generally never happen for properly-formed Files.
func PackageToNameToService(files ...File) (map[string]map[string]Service, error) {
	packageToNameToService := make(map[string]map[string]Service)
	for _, file := range files {
		pkg := file.Package()
		nameToService, ok := packageToNameToService[pkg]
		if !ok {
			nameToService = make(map[string]Service)
			packageToNameToService[pkg] = nameToService
		}
		for _, service := range file.Services() {
			name := service.Name()
			if _, ok := nameToService[name]; ok {
				return nil, fmt.Errorf("duplicate service in package %q: %q", pkg, name)
			}
			nameToService[name] = service
		}
	}
	return packageToNameToService, nil
}

// PackageToDirectlyImportedPackageToFileImports maps packages to directly imported packages
// to the FileImports that import this package.
//
// For example, if package a imports package b via c/d.proto and c/e.proto, this will have
// a -> b -> [c/d.proto, c/e.proto].
//
// A directly imported package will not be equal to the package, i.e. there will be no a -> a.
//
// Files with no packages are included with key "" to be consistent with other functions.
func PackageToDirectlyImportedPackageToFileImports(files ...File) (map[string]map[string][]FileImport, error) {
	filePathToFile, err := FilePathToFile(files...)
	if err != nil {
		return nil, err
	}
	packageToDirectlyImportedPackageToFileImports := make(map[string]map[string][]FileImport)
	for _, file := range files {
		pkg := file.Package()
		directlyImportedPackageToFileImports, ok := packageToDirectlyImportedPackageToFileImports[pkg]
		if !ok {
			directlyImportedPackageToFileImports = make(map[string][]FileImport)
			packageToDirectlyImportedPackageToFileImports[pkg] = directlyImportedPackageToFileImports
		}
		for _, fileImport := range file.FileImports() {
			if importedFile, ok := filePathToFile[fileImport.Import()]; ok {
				importedPkg := importedFile.Package()
				if importedPkg != pkg {
					directlyImportedPackageToFileImports[importedFile.Package()] = append(
						directlyImportedPackageToFileImports[importedPkg],
						fileImport,
					)
				}
			}
		}
	}
	return packageToDirectlyImportedPackageToFileImports, nil
}

// NameToMethod maps the Methods in the Service to a map from name to Method.
//
// Returns error if Methods do not have unique names within the Service, which should
// generally never happen for properly-formed Services.
func NameToMethod(service Service) (map[string]Method, error) {
	nameToMethod := make(map[string]Method)
	for _, method := range service.Methods() {
		name := method.Name()
		if _, ok := nameToMethod[name]; ok {
			return nil, fmt.Errorf("duplicate method: %q", name)
		}
		nameToMethod[name] = method
	}
	return nameToMethod, nil
}

// FullNameToMethod maps the Methods in the Files to a map from full name to Method.
//
// Returns error if Methods do not have unique full names within the Files, which should
// generally never happen for properly-formed Files.
func FullNameToMethod(files ...File) (map[string]Method, error) {
	fullNameToMethod := make(map[string]Method)
	for _, file := range files {
		for _, service := range file.Services() {
			for _, method := range service.Methods() {
				fullName := method.FullName()
				if _, ok := fullNameToMethod[fullName]; ok {
					return nil, fmt.Errorf("duplicate method: %q", fullName)
				}
				fullNameToMethod[fullName] = method
			}
		}
	}
	return fullNameToMethod, nil
}

// StringToReservedTagRange maps the ReservedTagRanges in the ReservedDescriptor to a map
// from string string to reserved TagRange.
//
// Ignores duplicates.
func StringToReservedTagRange(reservedDescriptor ReservedDescriptor) map[string]TagRange {
	stringToReservedTagRange := make(map[string]TagRange)
	for _, reservedTagRange := range reservedDescriptor.ReservedTagRanges() {
		stringToReservedTagRange[TagRangeString(reservedTagRange)] = reservedTagRange
	}
	return stringToReservedTagRange
}

// ValueToReservedName maps the ReservedNames in the ReservedDescriptor to a map
// from string value to ReservedName.
//
// Ignores duplicates.
func ValueToReservedName(reservedDescriptor ReservedDescriptor) map[string]ReservedName {
	valueToReservedName := make(map[string]ReservedName)
	for _, reservedName := range reservedDescriptor.ReservedNames() {
		valueToReservedName[reservedName.Value()] = reservedName
	}
	return valueToReservedName
}

// StringToExtensionMessageRange maps the ExtensionMessageRanges in the Message to a map
// from string string to ExtensionMessageRange.
//
// Ignores duplicates.
func StringToExtensionMessageRange(message Message) map[string]MessageRange {
	stringToExtensionMessageRange := make(map[string]MessageRange)
	for _, extensionMessageRange := range message.ExtensionMessageRanges() {
		stringToExtensionMessageRange[TagRangeString(extensionMessageRange)] = extensionMessageRange
	}
	return stringToExtensionMessageRange
}

// NumberInReservedRanges returns true if the number is in one of the Ranges.
func NumberInReservedRanges(number int, reservedRanges ...TagRange) bool {
	for _, reservedRange := range reservedRanges {
		start := reservedRange.Start()
		end := reservedRange.End()
		if number >= start && number <= end {
			return true
		}
	}
	return false
}

// NameInReservedNames returns true if the name is in one of the ReservedNames.
func NameInReservedNames(name string, reservedNames ...ReservedName) bool {
	for _, reservedName := range reservedNames {
		if name == reservedName.Value() {
			return true
		}
	}
	return false
}

// EnumIsSubset checks if subsetEnum is a subset of supersetEnum.
func EnumIsSubset(supersetEnum Enum, subsetEnum Enum) (bool, error) {
	supersetNameToEnumValue, err := NameToEnumValue(supersetEnum)
	if err != nil {
		return false, err
	}
	subsetNameToEnumValue, err := NameToEnumValue(subsetEnum)
	if err != nil {
		return false, err
	}
	for subsetName, subsetEnumValue := range subsetNameToEnumValue {
		supersetEnumValue, ok := supersetNameToEnumValue[subsetName]
		if !ok {
			// The enum value does not exist by name, this is not a superset.
			return false, nil
		}
		if subsetEnumValue.Number() != supersetEnumValue.Number() {
			// The enum values are not equal, this is not a superset.
			return false, nil
		}
	}
	// All enum values by name exist in the superset and have the same number,
	// subsetEnum is a subset of supersetEnum.
	return true, nil
}

// TagRangeString returns the string representation of the range.
func TagRangeString(tagRange TagRange) string {
	start := tagRange.Start()
	end := tagRange.End()
	if start == end {
		return fmt.Sprintf("[%d]", start)
	}
	if tagRange.Max() {
		return fmt.Sprintf("[%d,max]", start)
	}
	return fmt.Sprintf("[%d,%d]", start, end)
}

// FreeMessageRangeString returns the string representation of the free ranges for the message.
func FreeMessageRangeString(message Message) string {
	freeRanges := FreeMessageRanges(message)
	if len(freeRanges) == 0 {
		return ""
	}
	suffixes := make([]string, len(freeRanges))
	for i, freeRange := range freeRanges {
		suffixes[i] = freeMessageRangeStringSuffix(freeRange)
	}
	return fmt.Sprintf(
		"%- 35s free: %s",
		freeRanges[0].Message().FullName(),
		strings.Join(suffixes, " "),
	)
}

// FreeMessageRanges returns the free message ranges for the given message.
//
// Not recursive.
func FreeMessageRanges(message Message) []MessageRange {
	used := append(
		message.ReservedMessageRanges(),
		message.ExtensionMessageRanges()...,
	)
	for _, field := range message.Fields() {
		used = append(
			used,
			newFreeMessageRange(message, field.Number(), field.Number()),
		)
	}
	sort.Slice(used, func(i, j int) bool {
		return used[i].Start() < used[j].Start()
	})
	// now compute the inverse (unused ranges)
	unused := make([]MessageRange, 0, len(used)+1)
	last := 0
	for _, r := range used {
		if r.Start() <= last+1 {
			last = r.End()
			continue
		}
		unused = append(
			unused,
			newFreeMessageRange(message, last+1, r.Start()-1),
		)
		last = r.End()
	}
	if last < messageRangeInclusiveMax {
		unused = append(
			unused,
			newFreeMessageRange(message, last+1, messageRangeInclusiveMax),
		)
	}
	return unused
}

func freeMessageRangeStringSuffix(freeRange MessageRange) string {
	start := freeRange.Start()
	end := freeRange.End()
	if start == end {
		return fmt.Sprintf("%d", start)
	}
	if freeRange.Max() {
		return fmt.Sprintf("%d-INF", start)
	}
	return fmt.Sprintf("%d-%d", start, end)
}

func mapFiles(files []File, getKey func(File) string) (map[string][]File, error) {
	keyToFilePathToFile := make(map[string]map[string]File)
	for _, file := range files {
		if err := addUniqueFileToMap(keyToFilePathToFile, getKey(file), file); err != nil {
			return nil, err
		}
	}
	return mapToSortedFiles(keyToFilePathToFile), nil
}

func addUniqueFileToMap(keyToFilePathToFile map[string]map[string]File, key string, file File) error {
	filePathToFile, ok := keyToFilePathToFile[key]
	if !ok {
		filePathToFile = make(map[string]File)
		keyToFilePathToFile[key] = filePathToFile
	}
	if _, ok := filePathToFile[file.Path()]; ok {
		return fmt.Errorf("duplicate file: %s", file.Path())
	}
	filePathToFile[file.Path()] = file
	return nil
}

func mapToSortedFiles(keyToFileMap map[string]map[string]File) map[string][]File {
	keyToSortedFiles := make(map[string][]File, len(keyToFileMap))
	for key, fileMap := range keyToFileMap {
		files := make([]File, 0, len(fileMap))
		for _, file := range fileMap {
			files = append(files, file)
		}
		SortFiles(files)
		keyToSortedFiles[key] = files
	}
	return keyToSortedFiles
}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Atlas = (function () {
    /**
     * Creates a new atlas.
     * @class
     * @param {string} url The url of the atlas image.
     * @param {number} width The pixel width of the image. //TODO: don't require this
     * @param {number} height The pixel height of the image. //TODO: don't require this
     * @param {Object} sprites The atlas key data.
     * @param {boolean} suppressTextureLoad If set, does not automatically load the texture.
     */
    function Atlas(threeMananger, data, suppressTextureLoad) {
        this.threeMananger = threeMananger;
        this.isAtlas = true;
        this.url = data.url;
        this.width = data.width;
        this.height = data.height;
        this.sprites = data.sprites;
        if (!suppressTextureLoad) {
            this.texture = this.threeMananger.loadTexture(this.url);
            //this.texture.minFilter = this.texture.magFilter = data.filter;
            this.threeMananger.setTextureNpot(this.texture);
        }
    }
    /**
     * Returns the width of the given sprite in the atlas.
     * @param {string} key The sprite key.
     * @returns {number}
     */
    Atlas.prototype.getSpriteWidth = function (key) {
        return this.sprites[key][2];
    };
    /**
     * Returns the height of the given sprite in the atlas.
     * @param {string} key The sprite key.
     * @returns {number}
     */
    Atlas.prototype.getSpriteHeight = function (key) {
        return this.sprites[key][3];
    };
    return Atlas;
}());
exports.Atlas = Atlas;


text:
require "debox_server/basic_auth"
require "debox_server/view_helpers"

# Require controllers
Dir[File.join(File.dirname(__FILE__), "api/v1/", "*.rb")].each do |file|
  require file
end

module DeboxServer

  class DeboxAPI < Grape::API

    helpers DeboxServer
    helpers DeboxServer::BasicAuth
    helpers DeboxServer::ViewHelpers

    # Exceptions management
    #----------------------------------------------------------------------

    rescue_from ActiveRecord::RecordNotFound do |e|
      Rack::Response.new e.message, 400
    end

    rescue_from ActiveRecord::RecordInvalid do |e|
      Rack::Response.new e.message, 400
    end

    rescue_from :all

    # V1
    #----------------------------------------------------------------------

    mount DeboxServer::API::V1::Site
    mount DeboxServer::API::V1::Users
    mount DeboxServer::API::V1::Logs
    mount DeboxServer::API::V1::Live
    mount DeboxServer::API::V1::Recipes
    mount DeboxServer::API::V1::Cap
    mount DeboxServer::API::V1::Apps
    mount DeboxServer::API::V1::SshKeys
    mount DeboxServer::API::V1::ApiKeys
    mount DeboxServer::API::V1::ACL
  end

end


text:
from libdotfiles.packages import try_install
from libdotfiles.util import (
    HOME_DIR,
    PKG_DIR,
    create_dir,
    create_file,
    create_symlinks,
)

try_install("getmail")
create_dir(HOME_DIR / "mail" / "new")
create_dir(HOME_DIR / "mail" / "cur")
create_dir(HOME_DIR / "mail" / "tmp")

try_install("neomutt")
try_install("w3m")
try_install("lynx")
try_install("docbook-xsl")
create_file(HOME_DIR / ".mutt" / "certificates")
create_dir(HOME_DIR / ".mutt" / "cache" / "bodies")
create_dir(HOME_DIR / ".mutt" / "cache" / "headers")

create_symlinks(
    [
        (PKG_DIR / filename, HOME_DIR / ".mutt" / filename)
        for filename in ["file_email", "colors.muttrc", "muttrc", "mailcap"]
    ]
)


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/wallcology-admin.iml" filepath="$PROJECT_DIR$/.idea/wallcology-admin.iml" />
    </modules>
  </component>
</project>