text:
using EIDSS.Reports.BaseControls.Aggregate;
using EIDSS.Reports.Document.Human.Aggregate;

namespace EIDSS.Reports.Document.Veterinary.Aggregate
{
    partial class VetAggregateCaseSummaryReport
    {

        #region Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VetAggregateCaseSummaryReport));
            this.xrSubreportAdmUnit = new DevExpress.XtraReports.UI.XRSubreport();
            this.admUnitReport1 = new AdmUnitReport();
            this.xrSubreportTimeUnit = new DevExpress.XtraReports.UI.XRSubreport();
            this.timeUnitReport1 = new TimeUnitReport();
            this.FlexSubreport = new DevExpress.XtraReports.UI.XRSubreport();
            ((System.ComponentModel.ISupportInitialize)(this.baseDataSet1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tableBaseHeader)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.admUnitReport1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.timeUnitReport1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            //
            // cellLanguage
            //
            this.cellLanguage.StylePriority.UseTextAlignment = false;
            //
            // lblReportName
            //
            resources.ApplyResources(this.lblReportName, "lblReportName");
            this.lblReportName.StylePriority.UseBorders = false;
            this.lblReportName.StylePriority.UseBorderWidth = false;
            this.lblReportName.StylePriority.UseFont = false;
            this.lblReportName.StylePriority.UseTextAlignment = false;
            //
            // Detail
            //
            this.Detail.StylePriority.UseFont = false;
            this.Detail.StylePriority.UsePadding = false;
            //
            // PageHeader
            //
            resources.ApplyResources(this.PageHeader, "PageHeader");
            this.PageHeader.StylePriority.UseBorders = false;
            this.PageHeader.StylePriority.UseFont = false;
            this.PageHeader.StylePriority.UsePadding = false;
            this.PageHeader.StylePriority.UseTextAlignment = false;
            //
            // PageFooter
            //
            resources.ApplyResources(this.PageFooter, "PageFooter");
            this.PageFooter.StylePriority.UseBorders = false;
            //
            // ReportHeader
            //
            this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.FlexSubreport,
            this.xrSubreportTimeUnit,
            this.xrSubreportAdmUnit});
            resources.ApplyResources(this.ReportHeader, "ReportHeader");
            this.ReportHeader.StylePriority.UseFont = false;
            this.ReportHeader.Controls.SetChildIndex(this.tableBaseHeader, 0);
            this.ReportHeader.Controls.SetChildIndex(this.xrSubreportAdmUnit, 0);
            this.ReportHeader.Controls.SetChildIndex(this.xrSubreportTimeUnit, 0);
            this.ReportHeader.Controls.SetChildIndex(this.FlexSubreport, 0);
            //
            // xrPageInfo1
            //
            this.xrPageInfo1.StylePriority.UseBorders = false;
            //
            // cellReportHeader
            //
            this.cellReportHeader.StylePriority.UseBorders = false;
            this.cellReportHeader.StylePriority.UseFont = false;
            this.cellReportHeader.StylePriority.UseTextAlignment = false;
            this.cellReportHeader.Weight = 3.5146778586178362;
            //
            // cellBaseSite
            //
            this.cellBaseSite.StylePriority.UseBorders = false;
            this.cellBaseSite.StylePriority.UseFont = false;
            this.cellBaseSite.StylePriority.UseTextAlignment = false;
            this.cellBaseSite.Weight = 4.2018910685991475;
            //
            // tableBaseHeader
            //
            resources.ApplyResources(this.tableBaseHeader, "tableBaseHeader");
            this.tableBaseHeader.StylePriority.UseBorders = false;
            this.tableBaseHeader.StylePriority.UseBorderWidth = false;
            this.tableBaseHeader.StylePriority.UseFont = false;
            this.tableBaseHeader.StylePriority.UsePadding = false;
            this.tableBaseHeader.StylePriority.UseTextAlignment = false;
            //
            // xrSubreportAdmUnit
            //
            resources.ApplyResources(this.xrSubreportAdmUnit, "xrSubreportAdmUnit");
            this.xrSubreportAdmUnit.Name = "xrSubreportAdmUnit";
            this.xrSubreportAdmUnit.ReportSource = this.admUnitReport1;
            //
            // xrSubreportTimeUnit
            //
            resources.ApplyResources(this.xrSubreportTimeUnit, "xrSubreportTimeUnit");
            this.xrSubreportTimeUnit.Name = "xrSubreportTimeUnit";
            this.xrSubreportTimeUnit.ReportSource = this.timeUnitReport1;
            //
            // FlexSubreport
            //
            resources.ApplyResources(this.FlexSubreport, "FlexSubreport");
            this.FlexSubreport.Name = "FlexSubreport";
            //
            // VetAggregateCaseSummaryReport
            //
            this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
            this.Detail,
            this.PageHeader,
            this.PageFooter,
            this.ReportHeader});
            this.ExportOptions.Xls.SheetName = resources.GetString("VetAggregateCaseSummaryReport.ExportOptions.Xls.SheetName");
            this.ExportOptions.Xlsx.SheetName = resources.GetString("VetAggregateCaseSummaryReport.ExportOptions.Xlsx.SheetName");
            this.Landscape = true;
            this.PageHeight = 827;
            this.PageWidth = 1169;
            this.Version = "10.1";
            ((System.ComponentModel.ISupportInitialize)(this.baseDataSet1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tableBaseHeader)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.admUnitReport1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.timeUnitReport1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

        }

        #endregion

        private DevExpress.XtraReports.UI.XRSubreport xrSubreportTimeUnit;
        private DevExpress.XtraReports.UI.XRSubreport xrSubreportAdmUnit;
        private TimeUnitReport timeUnitReport1;
        private AdmUnitReport admUnitReport1;
        private DevExpress.XtraReports.UI.XRSubreport FlexSubreport;

    }
}


text:
package jme3test.bullet;

import com.jme3.asset.AssetManager;
import com.jme3.bullet.PhysicsSpace;
import com.jme3.bullet.PhysicsTickListener;
import com.jme3.bullet.collision.PhysicsCollisionEvent;
import com.jme3.bullet.collision.PhysicsCollisionListener;
import com.jme3.bullet.collision.PhysicsCollisionObject;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.collision.shapes.SphereCollisionShape;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.bullet.objects.PhysicsGhostObject;
import com.jme3.bullet.objects.PhysicsRigidBody;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleTriMesh;
import com.jme3.effect.shapes.EmitterSphereShape;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import java.io.IOException;
import java.util.Iterator;

/**
 *
 * @author normenhansen
 */
public class BombControl extends RigidBodyControl implements PhysicsCollisionListener, PhysicsTickListener {

    private float explosionRadius = 10;
    private PhysicsGhostObject ghostObject;
    private Vector3f vector = new Vector3f();
    private Vector3f vector2 = new Vector3f();
    private float forceFactor = 1;
    private ParticleEmitter effect;
    private float fxTime = 0.5f;
    private float maxTime = 4f;
    private float curTime = -1.0f;
    private float timer;

    public BombControl(CollisionShape shape, float mass) {
        super(shape, mass);
        createGhostObject();
    }

    public BombControl(AssetManager manager, CollisionShape shape, float mass) {
        super(shape, mass);
        createGhostObject();
        prepareEffect(manager);
    }

    public void setPhysicsSpace(PhysicsSpace space) {
        super.setPhysicsSpace(space);
        if (space != null) {
            space.addCollisionListener(this);
        }
    }

    private void prepareEffect(AssetManager assetManager) {
        int COUNT_FACTOR = 1;
        float COUNT_FACTOR_F = 1f;
        effect = new ParticleEmitter("Flame", new ParticleTriMesh(), 32 * COUNT_FACTOR);
        effect.setSelectRandomImage(true);
        effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
        effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
        effect.setStartSize(1.3f);
        effect.setEndSize(2f);
        effect.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
        effect.setParticlesPerSec(0);
        effect.setGravity(0, -5f, 0);
        effect.setLowLife(.4f);
        effect.setHighLife(.5f);
        effect.setInitialVelocity(new Vector3f(0, 7, 0));
        effect.setVelocityVariation(1f);
        effect.setImagesX(2);
        effect.setImagesY(2);
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
        mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
        effect.setMaterial(mat);
    }

    protected void createGhostObject() {
        ghostObject = new PhysicsGhostObject(new SphereCollisionShape(explosionRadius));
    }

    public void collision(PhysicsCollisionEvent event) {
        if (space == null) {
            return;
        }
        if (event.getObjectA() == this || event.getObjectB() == this) {
            space.add(ghostObject);
            ghostObject.setPhysicsLocation(getPhysicsLocation(vector));
            space.addTickListener(this);
            if (effect != null && spatial.getParent() != null) {
                curTime = 0;
                effect.setLocalTranslation(spatial.getLocalTranslation());
                spatial.getParent().attachChild(effect);
                effect.emitAllParticles();
            }
            space.remove(this);
            spatial.removeFromParent();
        }
    }

    public void prePhysicsTick(PhysicsSpace space, float f) {
        space.removeCollisionListener(this);
    }

    public void physicsTick(PhysicsSpace space, float f) {
        //get all overlapping objects and apply impulse to them
        for (Iterator<PhysicsCollisionObject> it = ghostObject.getOverlappingObjects().iterator(); it.hasNext();) {
            PhysicsCollisionObject physicsCollisionObject = it.next();
            if (physicsCollisionObject instanceof PhysicsRigidBody) {
                PhysicsRigidBody rBody = (PhysicsRigidBody) physicsCollisionObject;
                rBody.getPhysicsLocation(vector2);
                vector2.subtractLocal(vector);
                float force = explosionRadius - vector2.length();
                force *= forceFactor;
                force = force > 0 ? force : 0;
                vector2.normalizeLocal();
                vector2.multLocal(force);
                ((PhysicsRigidBody) physicsCollisionObject).applyImpulse(vector2, Vector3f.ZERO);
            }
        }
        space.removeTickListener(this);
        space.remove(ghostObject);
    }

    @Override
    public void update(float tpf) {
        super.update(tpf);
        if(enabled){
            timer+=tpf;
            if(timer>maxTime){
                if(spatial.getParent()!=null){
                    space.removeCollisionListener(this);
                    space.remove(this);
                    spatial.removeFromParent();
                }
            }
        }
        if (enabled && curTime >= 0) {
            curTime += tpf;
            if (curTime > fxTime) {
                curTime = -1;
                effect.removeFromParent();
            }
        }
    }

    /**
     * @return the explosionRadius
     */
    public float getExplosionRadius() {
        return explosionRadius;
    }

    /**
     * @param explosionRadius the explosionRadius to set
     */
    public void setExplosionRadius(float explosionRadius) {
        this.explosionRadius = explosionRadius;
        createGhostObject();
    }

    public float getForceFactor() {
        return forceFactor;
    }

    public void setForceFactor(float forceFactor) {
        this.forceFactor = forceFactor;
    }

    @Override
    public void read(JmeImporter im) throws IOException {
        throw new UnsupportedOperationException("Reading not supported.");
    }

    @Override
    public void write(JmeExporter ex) throws IOException {
        throw new UnsupportedOperationException("Saving not supported.");
    }
}

redpajama_set_name: RedPajamaGithub


text:
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright Authors of Cilium */

#ifndef __BPF_CTX_CTX_H_
#define __BPF_CTX_CTX_H_

#ifndef __ctx_buff
# error "No __ctx_buff context defined. Please either include 'bpf/ctx/skb.h' or 'bpf/ctx/xdp.h'."
#endif

#endif /* __BPF_CTX_CTX_H_ */


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta content="Craig McClellan" name="author">

  <title>Craig McClellan   - Review Yoink Adds </title>

  <link href="/assets/css/style.css" rel="stylesheet">
  <link href="/assets/css/highlight.css" rel="stylesheet">
  <link rel="stylesheet" href="/custom.css">

	<link rel="shortcut icon" href="https://micro.blog/craigmcclellan/favicon.png" type="image/x-icon" />
  <link rel="alternate" type="application/rss+xml" title="Craig McClellan" href="http://craigmcclellan.com/feed.xml" />

  <link rel="alternate" type="application/json" title="Craig McClellan" href="http://craigmcclellan.com/feed.json" />
  <link rel="EditURI" type="application/rsd+xml" href="/rsd.xml" />

  <link rel="me" href="https://micro.blog/craigmcclellan" />

  	<link rel="me" href="https://twitter.com/craigmcclellan" />

  	<link rel="me" href="https://github.com/craigwmcclellan" />

  <link rel="authorization_endpoint" href="https://micro.blog/indieauth/auth" />
  <link rel="token_endpoint" href="https://micro.blog/indieauth/token" />
  <link rel="micropub" href="https://micro.blog/micropub" />
  <link rel="webmention" href="https://micro.blog/webmention" />
  <link rel="subscribe" href="https://micro.blog/users/follow" />

   ← Home

			Archive

			About

			Tools of Choice

  Also on Micro.blog

      <time class="dt-published" datetime="2018-10-08 10:47:07 -0500">
        October 8, 2018
      </time>

Review: Yoink Adds Support for Latest Mojave and iOS 12 Features – MacStories

Yoink for iOS has added Siri shortcuts too. You can view items stored on one of your iOS devices, move items from your device's clipboard to Yoink, copy the most recent item or the most recent item of a particular type (such as an image, PDF, URL, text, etc.) to the clipboard, and download files linked with a URL to Yoink. As with any Siri shortcut, Yoink's can be assigned a trigger phrase to be used via voice or used as standalone actions that are incorporated into custom shortcuts created with Apple's Shortcuts app.

Emphasis mine

I've always liked Yoink's UI more than Gladys's, but Gladys's functionality won hands down. I'm excited to give this app another go.

      Craig McClellan
      @craigmcclellan

RSS

JSON Feed

Micro.blog

  <form method="get" id="search" action="https://duckduckgo.com/">
    <input type="hidden" name="sites" value="http://craigmcclellan.com"/>
    <input type="hidden" name="k8" value="#444444"/>
    <input type="hidden" name="k9" value="#ee4792"/>
    <input type="hidden" name="kt" value="h"/>
    <input class="field" type="text" name="q" maxlength="255" placeholder="To search, type and hit Enter…"/>
    <input type="submit" value="Search" style="display: none;" />
  </form>


text:
package net.finmath.optimizer;

import net.finmath.optimizer.OptimizerInterface.ObjectiveFunction;

/**
 * @author Christian Fries
 */
public class OptimizerFactoryLevenbergMarquardt implements OptimizerFactoryInterface {

	private final int		maxIterations;
	private final double	errorTolerance;
	private final int		maxThreads;

	public OptimizerFactoryLevenbergMarquardt(int maxIterations, double errorTolerance, int maxThreads) {
		super();
		this.maxIterations = maxIterations;
		this.errorTolerance = errorTolerance;
		this.maxThreads = maxThreads;
	}

	public OptimizerFactoryLevenbergMarquardt(int maxIterations, int maxThreads) {
		this(maxIterations, 0.0, maxThreads);
	}

	@Override
	public OptimizerInterface getOptimizer(final ObjectiveFunction objectiveFunction, final double[] initialParameters, double[] targetValues) {
		return getOptimizer(objectiveFunction, initialParameters, null, null, null, targetValues);
	}

	@Override
	public OptimizerInterface getOptimizer(final ObjectiveFunction objectiveFunction, final double[] initialParameters, final double[] lowerBound,final double[]  upperBound, double[] targetValues) {
		return getOptimizer(objectiveFunction, initialParameters, lowerBound, upperBound, null, targetValues);
	}

	@Override
	public OptimizerInterface getOptimizer(final ObjectiveFunction objectiveFunction, double[] initialParameters, double[] lowerBound,double[]  upperBound, double[] parameterSteps, double[] targetValues) {
		return (new LevenbergMarquardt(
				initialParameters,
				targetValues,
				maxIterations,
				maxThreads)
		{
			private static final long serialVersionUID = -1628631567190057495L;

			@Override
			public void setValues(double[] parameters, double[] values) throws SolverException {
				objectiveFunction.setValues(parameters, values);
			}
		})
				.setErrorTolerance(errorTolerance)
				.setParameterSteps(parameterSteps);
	}
}


text:
/*
	34 Responsive Grid System
	Multi-state, responsive CSS grid system

	Developer	: Kemal Yılmaz
	URL			: http://34grid.com
	Contact		: http://kemalyilmaz.com
				: http://twitter.com/xkema
				: http://www.facebook.com/pages/34Grid/401562963236958
	Version		: 1.0

	LICENSED UNDER Creative Commons Attribution 3.0 Unported License.
*/

/*
	Reset styles.
	============================================================ CONTAINER ====
*/
/* I didn't add any reset styles, use your own */

/*
	Main width-controller for your content. think ".container"
	class as a holder for ".row" classes for a basic layout.
	Default centered with margin 0 auto; style.
	============================================================ CONTAINER ====
*/
.container { margin: 0 auto; }

/*
	Main grouping blocks. You can dump "n*100%"" width content to a
	single ".row". (with the little help of .skip-float and manual
	.user-float classes)
	================================================================== ROW ====
*/
.row { width: 100%; }

/*
	A basic transitions for immediate childs of ".row" classes. I added
	transitions assuming your html layout keeps "col_*"" elements right
	after ".row" classes. (col_*'s are immediate childs of .row's)
	Delete this block to get rid of transitions.
	(transitions are incompatible with some browsers.
	("some browsers" usually refers to internet explorer :)
	====================================================== ROW TRANSITIONS ====
*/
.row > * {
	-webkit-transition	: all 400ms ease-out;
	-moz-transition		: all 400ms ease-out;
	-o-transition		: all 400ms ease-out;
	-ms-transition		: all 400ms ease-out;
	transition			: all 400ms ease-out;
}

/*
	Auto clearfix for all rows. Borrowed from HTML5BOILERPLATE.
	====================================================== ROW TRANSITIONS ====
*/
.row:before, .row:after { content: ""; display: table; }
.row:after { clear: both; }
.row { *zoom: 1; }

/*
	Column (col_*) and complement (col_*c) classes.
	.col_0 class is not a must but i added it to
	keep things organized. You can use it for
	marginless 100% widths.
	================================================ COLUMNS & COMPLEMENTS ====
*/

/* columns & complements (autogenerated styles) */
.col_0 {
	width: 100%;
	margin-bottom: 10px;
	display: block;
}

.col_1,
.col_2,
.col_3, .col_3c,
.col_4, .col_4c,
.col_5, .col_5c,
.col_6, .col_6c,
.col_7, .col_7c,
.col_8, .col_8c {
	margin-left		: .50%;
	margin-right	: .50%;
	margin-bottom	: 10px;
	float		: left;
	display		: block;
}

/* columns (autogenerated styles) */
.col_1 { width: 98%; }
.col_2 { width: 48%; }
.col_3 { width: 31.3333333333%; }
.col_4 { width: 23%; }
.col_5 { width: 18%; }
.col_6 { width: 14.6666666667%; }
.col_7 { width: 12.2857142857%; }
.col_8 { width: 10.5%; }

/* complements (autogenerated styles) */
.col_3c { width: 64.6666666667%; }
.col_4c { width: 73%; }
.col_5c { width: 78%; }
.col_6c { width: 81.3333333333%; }
.col_7c { width: 83.7142857143%; }
.col_8c { width: 85.5%; }

/*
	100% width auto control for "img", "object" and
	"embed" controls.
	============================================ IMAGE FULL WIDTH CONTROLS ====
*/
img, object, embed { max-width: 100%; }
img { height: auto; }
figure img { max-width: 100%; }

/*
	Use ".skip-float" class to start from brand new lines.
	Clears left of current 100% group for new 100%
	lines in same ".row" group.
	@see webpage for details
	=============================================== FLOATING PROBLEM FIXER ====
*/
.skip-float { clear: left; }

/*
	CSS hack for responsive videos.
	@see http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
	@see http://webdesignerwall.com/tutorials/css-elastic-videos
	========================================================= VIDEO HOLDER ====
*/
.video-holder {
	position: relative;
	padding-bottom: 56.25%;
	padding-top: 30px;
	height: 0;
	overflow: hidden;
	display: block;
}

.video-holder iframe, .video-holder object, .video-holder embed {
	position: absolute;	top: 0;	left: 0; width: 100%; height: 100%;
}


text:
package time_test

import (
	"fmt"
	"os"
	"reflect"
	"testing"
	"time"
)

func init() {
	if time.ZoneinfoForTesting() != nil {
		panic(fmt.Errorf("zoneinfo initialized before first LoadLocation"))
	}
}

func TestEnvVarUsage(t *testing.T) {
	time.ResetZoneinfoForTesting()

	const testZoneinfo = "foo.zip"
	const env = "ZONEINFO"

	defer os.Setenv(env, os.Getenv(env))
	os.Setenv(env, testZoneinfo)

	// Result isn't important, we're testing the side effect of this command
	time.LoadLocation("Asia/Jerusalem")
	defer time.ResetZoneinfoForTesting()

	if zoneinfo := time.ZoneinfoForTesting(); testZoneinfo != *zoneinfo {
		t.Errorf("zoneinfo does not match env variable: got %q want %q", zoneinfo, testZoneinfo)
	}
}

func TestLoadLocationValidatesNames(t *testing.T) {
	time.ResetZoneinfoForTesting()
	const env = "ZONEINFO"
	defer os.Setenv(env, os.Getenv(env))
	os.Setenv(env, "")

	bad := []string{
		"/usr/foo/Foo",
		"\\UNC\foo",
		"..",
		"a..",
	}
	for _, v := range bad {
		_, err := time.LoadLocation(v)
		if err != time.ErrLocation {
			t.Errorf("LoadLocation(%q) error = %v; want ErrLocation", v, err)
		}
	}
}

func TestVersion3(t *testing.T) {
	time.ForceZipFileForTesting(true)
	defer time.ForceZipFileForTesting(false)
	_, err := time.LoadLocation("Asia/Jerusalem")
	if err != nil {
		t.Fatal(err)
	}
}

// Test that we get the correct results for times before the first
// transition time. To do this we explicitly check early dates in a
// couple of specific timezones.
func TestFirstZone(t *testing.T) {
	time.ForceZipFileForTesting(true)
	defer time.ForceZipFileForTesting(false)

	const format = "Mon, 02 Jan 2006 15:04:05 -0700 (MST)"
	var tests = []struct {
		zone  string
		unix  int64
		want1 string
		want2 string
	}{
		{
			"PST8PDT",
			-1633269601,
			"Sun, 31 Mar 1918 01:59:59 -0800 (PST)",
			"Sun, 31 Mar 1918 03:00:00 -0700 (PDT)",
		},
		{
			"Pacific/Fakaofo",
			1325242799,
			"Thu, 29 Dec 2011 23:59:59 -1100 (-11)",
			"Sat, 31 Dec 2011 00:00:00 +1300 (+13)",
		},
	}

	for _, test := range tests {
		z, err := time.LoadLocation(test.zone)
		if err != nil {
			t.Fatal(err)
		}
		s := time.Unix(test.unix, 0).In(z).Format(format)
		if s != test.want1 {
			t.Errorf("for %s %d got %q want %q", test.zone, test.unix, s, test.want1)
		}
		s = time.Unix(test.unix+1, 0).In(z).Format(format)
		if s != test.want2 {
			t.Errorf("for %s %d got %q want %q", test.zone, test.unix, s, test.want2)
		}
	}
}

func TestLocationNames(t *testing.T) {
	if time.Local.String() != "Local" {
		t.Errorf(`invalid Local location name: got %q want "Local"`, time.Local)
	}
	if time.UTC.String() != "UTC" {
		t.Errorf(`invalid UTC location name: got %q want "UTC"`, time.UTC)
	}
}

func TestLoadLocationFromTZData(t *testing.T) {
	time.ForceZipFileForTesting(true)
	defer time.ForceZipFileForTesting(false)

	const locationName = "Asia/Jerusalem"
	reference, err := time.LoadLocation(locationName)
	if err != nil {
		t.Fatal(err)
	}

	tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
	if err != nil {
		t.Fatal(err)
	}
	sample, err := time.LoadLocationFromTZData(locationName, tzinfo)
	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(reference, sample) {
		t.Errorf("return values of LoadLocationFromTZData and LoadLocation don't match")
	}
}


text:
*What are the sensors*

## mBlock Code

### Create a variable speed
![](mbot/line_follower/images/set_speed.png)

### Set it to the speed you want
![](mbot/line_follower/images/speed_variable.png)

### Create a variable sensor
![](mbot/line_follower/images/sensor_variable.png)

### Set it to the line follower
![](mbot/line_follower/images/read_line_follower.png)

----
### If the sensor is 0 then go forwards
![](mbot/line_follower/images/line_follower_0.png)

### If the sensor is 1 then turn left
![](mbot/line_follower/images/line_follower_1.png)

### If the sensor is 2 then turn right, and for all others go backwards
![](mbot/line_follower/images/line_follower_2.png)

----


text:
using Microsoft.OData.Edm;
using OdataToEntity.EfCore;
using OdataToEntity.GraphQL;
using System;
using System.Threading.Tasks;

namespace OdataToEntity.Test.GraphQL
{
    class Program
    {
        static async Task Main(String[] args)
        {
            var tests = new StarWarsTests(new StarWarsFixture());
            await tests.can_query_for_friends_of_humans();
        }

        private static async Task Test()
        {
            using (var starWarsContext = new StarWars.StarWarsContext("StarWars"))
                starWarsContext.Database.EnsureCreated();

            using (var order2Context = new Model.Order2Context(StarWars.StarWarsContext.Create<Model.Order2Context>("Order2")))
                order2Context.Database.EnsureCreated();

            String starWarsQuery = @"
               {
                  droid(id: ""4"") {
                    name
                  }
               }
            ";
            String order2Query = @"
               {
                  orders2 {
                    name
                    customer {
                        name
                    }
                  }
               }
            ";

            var order2DataAdapter2 = new Model.Order2DataAdapter(false, "Order2");
            EdmModel refModel = order2DataAdapter2.BuildEdmModelFromEfCoreModel();

            var starWarsDataAdapter1 = new StarWars.StarWarsDataAdapter(false, "StarWars");
            EdmModel rootModel = starWarsDataAdapter1.BuildEdmModelFromEfCoreModel(refModel);

            var parser = new OeGraphqlParser(rootModel);

            String starWarsOdataUri = Uri.UnescapeDataString(parser.GetOdataUri(starWarsQuery).OriginalString);
            Console.WriteLine(starWarsOdataUri);

            String starWarsJson = await (await parser.Execute(starWarsQuery)).ToStringAsync();
            Console.WriteLine(starWarsJson);

            String order2OdataUri = Uri.UnescapeDataString(parser.GetOdataUri(order2Query).OriginalString);
            Console.WriteLine(order2OdataUri);

            String order2Json = await (await parser.Execute(order2Query)).ToStringAsync();
            Console.WriteLine(order2Json);
        }
    }
}


text:
class OtmlCategoriesOtrunkImports < ActiveRecord::Migration[5.1]
  def self.up
    create_table :otml_categories_otrunk_imports, :id => false do |t|
      t.integer :otml_category_id
      t.integer :otrunk_import_id
    end
    add_index :otml_categories_otrunk_imports, [:otml_category_id, :otrunk_import_id], :name => :otc_oti, :unique => true
  end

  def self.down
    drop_table :otml_categories_otrunk_imports
  end
end


text:
' Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

Imports System.Threading
Imports Microsoft.CodeAnalysis.Completion.Providers
Imports Microsoft.CodeAnalysis.VisualBasic.Extensions.ContextQuery

Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders.Declarations
    ''' <summary>
    ''' Recommends the various list of operators you can overload after the "Operator" keyword
    ''' </summary>
    Friend Class OverloadableOperatorRecommender
        Inherits AbstractKeywordRecommender

        Protected Overrides Function RecommendKeywords(context As VisualBasicSyntaxContext, cancellationToken As CancellationToken) As IEnumerable(Of RecommendedKeyword)
            If context.FollowsEndOfStatement Then
                Return SpecializedCollections.EmptyEnumerable(Of RecommendedKeyword)()
            End If

            Dim targetToken = context.TargetToken

            If Not targetToken.IsKind(SyntaxKind.OperatorKeyword) OrElse
               Not targetToken.Parent.IsKind(SyntaxKind.OperatorStatement) Then
                Return SpecializedCollections.EmptyEnumerable(Of RecommendedKeyword)()
            End If

            Dim modifierFacts = context.ModifierCollectionFacts

            ' If we have a Widening or Narrowing declaration, then we must be a CType operator
            If modifierFacts.NarrowingOrWideningKeyword.Kind <> SyntaxKind.None Then
                Return SpecializedCollections.SingletonEnumerable(New RecommendedKeyword("CType", VBFeaturesResources.Returns_the_result_of_explicitly_converting_an_expression_to_a_specified_data_type_object_structure_class_or_interface_CType_Object_As_Expression_Object_As_Type_As_Type))
            Else
                ' We could just be a normal name, so we list all possible options here. Dev10 allows you to type
                ' "Operator Narrowing", so we also list the Narrowing/Widening options as well.
                ' TODO: fix parser to actually deal with such stupidities like "Operator Narrowing"
                Return {"+", "-", "IsFalse", "IsTrue", "Not",
                        "*", "/", "\", "&", "^", ">>", "<<", "=", "<>", ">", ">=", "<", "<=", "And", "Like", "Mod", "Or", "Xor",
                        "Narrowing", "Widening"}.Select(Function(s) New RecommendedKeyword(s, GetToolTipForKeyword(s)))
            End If
        End Function

        Private Function GetToolTipForKeyword([operator] As String) As String
            Select Case [operator]
                Case "+"
                    Return VBFeaturesResources.Returns_the_sum_of_two_numbers_or_the_positive_value_of_a_numeric_expression
                Case "-"
                    Return VBFeaturesResources.Returns_the_difference_between_two_numeric_expressions_or_the_negative_value_of_a_numeric_expression
                Case "IsFalse"
                    Return VBFeaturesResources.Determines_whether_an_expression_is_false_If_instances_of_any_class_or_structure_will_be_used_in_an_OrElse_clause_you_must_define_IsFalse_on_that_class_or_structure
                Case "IsTrue"
                    Return VBFeaturesResources.Determines_whether_an_expression_is_true_If_instances_of_any_class_or_structure_will_be_used_in_an_OrElse_clause_you_must_define_IsTrue_on_that_class_or_structure
                Case "Not"
                    Return VBFeaturesResources.Performs_logical_negation_on_a_Boolean_expression_or_bitwise_negation_on_a_numeric_expression_result_Not_expression
                Case "*"
                    Return VBFeaturesResources.Multiplies_two_numbers_and_returns_the_product
                Case "/"
                    Return VBFeaturesResources.Divides_two_numbers_and_returns_a_floating_point_result
                Case "\"
                    Return VBFeaturesResources.Divides_two_numbers_and_returns_an_integer_result
                Case "&"
                    Return VBFeaturesResources.Generates_a_string_concatenation_of_two_expressions
                Case "^"
                    Return VBFeaturesResources.Raises_a_number_to_the_power_of_another_number
                Case ">>"
                    Return VBFeaturesResources.Performs_an_arithmetic_right_shift_on_a_bit_pattern
                Case "<<"
                    Return VBFeaturesResources.Performs_an_arithmetic_left_shift_on_a_bit_pattern
                Case "="
                    Return VBFeaturesResources.Compares_two_expressions_and_returns_True_if_they_are_equal_Otherwise_returns_False
                Case "<>"
                    Return VBFeaturesResources.Compares_two_expressions_and_returns_True_if_they_are_not_equal_Otherwise_returns_False
                Case ">"
                    Return VBFeaturesResources.Compares_two_expressions_and_returns_True_if_the_first_is_greater_than_the_second_Otherwise_returns_False
                Case ">="
                    Return VBFeaturesResources.Compares_two_expressions_and_returns_True_if_the_first_is_greater_than_or_equal_to_the_second_Otherwise_returns_False
                Case "<"
                    Return VBFeaturesResources.Compares_two_expressions_and_returns_True_if_the_first_is_less_than_the_second_Otherwise_returns_False
                Case "<="
                    Return VBFeaturesResources.Compares_two_expressions_and_returns_True_if_the_first_is_less_than_or_equal_to_the_second_Otherwise_returns_False
                Case "And"
                    Return VBFeaturesResources.Performs_a_logical_conjunction_on_two_Boolean_expressions_or_a_bitwise_conjunction_on_two_numeric_expressions_For_Boolean_expressions_returns_True_if_both_operands_evaluate_to_True_Both_expressions_are_always_evaluated_result_expression1_And_expression2
                Case "Like"
                    Return VBFeaturesResources.Compares_a_string_against_a_pattern_Wildcards_available_include_to_match_1_character_and_to_match_0_or_more_characters_result_string_Like_pattern
                Case "Mod"
                    Return VBFeaturesResources.Divides_two_numbers_and_returns_only_the_remainder_number1_Mod_number2
                Case "Or"
                    Return VBFeaturesResources.Performs_an_inclusive_logical_disjunction_on_two_Boolean_expressions_or_a_bitwise_disjunction_on_two_numeric_expressions_For_Boolean_expressions_returns_True_if_at_least_one_operand_evaluates_to_True_Both_expressions_are_always_evaluated_result_expression1_Or_expression2
                Case "Xor"
                    Return VBFeaturesResources.Performs_a_logical_exclusion_on_two_Boolean_expressions_or_a_bitwise_exclusion_on_two_numeric_expressions_For_Boolean_expressions_returns_True_if_exactly_one_of_the_expressions_evaluates_to_True_Both_expressions_are_always_evaluated_result_expression1_Xor_expression2
                Case "Narrowing"
                    Return VBFeaturesResources.Indicates_that_a_conversion_operator_CType_converts_a_class_or_structure_to_a_type_that_might_not_be_able_to_hold_some_of_the_possible_values_of_the_original_class_or_structure
                Case "Widening"
                    Return VBFeaturesResources.Indicates_that_a_conversion_operator_CType_converts_a_class_or_structure_to_a_type_that_can_hold_all_possible_values_of_the_original_class_or_structure
                Case Else
                    Return String.Empty
            End Select
        End Function
    End Class
End Namespace


text:
package com.example;

import java.util.Map;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.cloud.consul.discovery.ConsulDiscoveryProperties;
import org.springframework.cloud.consul.serviceregistry.ConsulAutoRegistration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/id")
public class IdController implements ApplicationContextAware, InitializingBean {

	private String id;
	private ApplicationContext context;
	private final ConsulDiscoveryProperties properties;

	public IdController(ConsulDiscoveryProperties properties) {
		this.properties = properties;
	}

	@GetMapping
	public Object get() {
		return Map.of("id", id);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		id = ConsulAutoRegistration.getInstanceId(properties, context);
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) {
		this.context = applicationContext;
	}
}


text:
title:  Paulus' forbønner
date:  21/07/2020
---

Forbønn er bibelsk. Paulus ba for de nyomvendte i menighetene som han opprettet. Han trodde at noe skjedde når han ba som ikke ville skje hvis han ikke ba. Han visste at de kunne stå sammen når de ba for hverandre, selv om de var på ulike steder.

`Les Ef 1,15–21. Nedenfor kan du skrive opp de ulike tingene Paulus ba om for efeserne. Hva ba han konkret om at Gud måtte gi dem?`

Merk deg Paulus' bønn for de troende i Efesos. Han ba om at Gud ville gi dem visdom og åndelig forstand, opplyse deres sinn med guddommelig sannhet og gi dem håp om evig liv. Han ba også om at de måtte få oppleve Guds kraft i livet. Gud er så mektig at han reiste Jesus fra de døde, grunnlaget for deres håp om evig liv i ham. De kristne i Efesos må ha blitt oppmuntret fordi de visste både at Paulus ba for dem og hva han ba om.

`Les Fil 1,3–11 og legg merke til tonen i bønnen. Hvordan ville du ta det hvis du tilhørte menigheten og fikk et slikt brev fra Paulus der han ikke bare fortalte at han ba for deg, men hva han ba om. Hvorfor? Hvilke løfter finner vi? Og hvilke formaninger finner vi også?`

Dette er noen av de mest oppmuntrende versene i Bibelen. De er fylt med løfter og oppfordringer om å bli fylt med kjærlighet og kunnskap og forstand til ære for Gud.


text:
namespace S3D
{
	namespace Window
	{
		extern void init(int width, int height, std::string title);
		extern void createWindow();
		extern GLFWwindow* getWindowHandle();
		extern bool shouldClose();
		extern void update();
		extern void render();
		extern void dispose();
		extern int getWidth();
		extern int getHeight();
		extern std::string getTitle();
		extern void setWidth(int width);
		extern void setHeight(int height);
		extern void setTitle(std::string title);
	}
}


text:
/*
 * Created on Mar 28, 2006
 */
package org.seqcode.projects.seqview;

/**
 * @author tdanford
 */
public interface Startable<X> {
    public void start(X value);
}


text:
package com.vonage.client.insight;

import org.junit.Test;

import static org.junit.Assert.*;

public class StandardInsightRequestTest {
    @Test
    public void testWithNumber() {
        StandardInsightRequest request = StandardInsightRequest.withNumber("12345");
        assertEquals(request.getNumber(), "12345");
        assertNull(request.getCountry());
    }

    @Test
    public void testWithNumberAndCountry() {
        StandardInsightRequest request = StandardInsightRequest.withNumberAndCountry("12345", "GB");
        assertEquals(request.getNumber(), "12345");
        assertEquals(request.getCountry(), "GB");
    }

    @Test
    public void testBuildWithAllFields() {
        StandardInsightRequest request = StandardInsightRequest.builder("12345").country("GB").cnam(true).build();
        assertEquals(request.getNumber(), "12345");
        assertEquals(request.getCountry(), "GB");
        assertTrue(request.getCnam());

        request = StandardInsightRequest.builder("12345").number("98765").country("GB").cnam(true).build();
        assertEquals(request.getNumber(), "98765");
        assertEquals(request.getCountry(), "GB");
        assertTrue(request.getCnam());
    }
}


text:
This AngularJS module will help you implement client-side and server-side (API) authentication. You can use it together with [Auth0](https://www.auth0.com) to add support for username/password authentication, enterprise identity providers like Active Directory or SAML and also for social identity providers like Google, Facebook or Salesforce among others to your web, API and mobile native apps.

[Auth0](https://www.auth0.com) is a cloud service that provides a turn-key solution for authentication, authorization and Single Sign On.

## Key Features

* **User Login & Signup**: This module lets you easily sign in and sign up your users with any Social Provider, Enterprise Provider or Username and password. You can use the UI already made by Auth0 or create your own
* **Persistent user authentication**: We'll take care of keeping the user logged in after page refresh, browser closed and so on.
* **Authenticated API calls**: We'll take care of automatically adding the `JWT` in every request that is made to your API after the user is authenticated
* **Events/Promise based services**: Our service supports both Events based actions as well as promise based ones
* **Token management**: We'll handle the token storage and configuration all the time. You don't even need to know there's a token.

## Installation

You can install this plugin several ways

### Bower

````bash
bower install auth0-angular
````

### NPM

````bash
npm install auth0-angular
````

### CDN

````html
<script type="text/javascript" src="//cdn.auth0.com/w2/auth0-widget-5.js"></script>
<script type="text/javascript" src="//cdn.auth0.com/w2/auth0-angular-1.js"></script>
````

## TL;DR: Quick start guide

### Add module dependency and configure it

````js
angular.module('myCoolApp', ['auth0'])
  .config(function(authProvider, $httpProvider) {

    // routing configuration and other stuff
    // ...

    authProvider.init({
      domain: 'mydomain.auth0.com',
      clientId: 'myClientId',
      loginUrl: '/login',
      callbackUrl: location.href
    });

    // This automatically adds the token in every request
    $httpProvider.interceptors.push('authInterceptor');
  })
  .run(function(auth) {
    auth.hookEvents();
  });
````

### Showing the signin popup and getting the information

````js
// LoginCtrl.js
angular.module('myCoolApp').controller('LoginCtrl', function(auth) {
  $scope.signin = function() {
    auth.signin({popup: true}, function() {
      $location.path('/user-info')
    }, function(err) {
      console.log("Error :(", err);
    });
  }
});
````
````html
<a href="" ng-click="signin()" />
````

### Showing user information
````js
// UserInfo.js
angular.module('myCoolApp').controller('UserInfoCtrl', function(auth) {
  $scope.profile = auth.profile;
});
````
````html
<!-- userInfo.html -->
<span>{{profile.first_name}} {{profile.email}}</span>
````

## Getting Started Guide

### Preface: Authentication Modes

There're 3 modes to handle authentication with all the Providers (Facebook, Linkedin, Github, AD, LDAP, etc.) that Auth0 can handle. **Redirect mode** implies that the page you're seeing is going to get redirected to the page of the provider so that you can login. **Popup mode** implies that your angular app will open a popup window which will go to the provider website so that you can login and then close itself to show the Angular app again. This is really important to your app because if you use Redirect Mode, it means that your angular app will get **reloaded completely** after the user is authenticated with the provider. In Popup mode, the angular app will **remain open**.
The third mode is just doing a CORS call to `/ro` to authenticate the user. This is only used for `Database-Password` connections. In this case, the website will not refresh either.

### Dependencies

auth0-angular depends on either `auth0.js` or `auth0-widget.js`.

If you want to use Auth0's beautiful Widget UI, you need to include `auth0-widget.js`. This lets you configure Title and Icons, but the UI is taken care for you. For all the customization properties, please check out [tihs link](https://docs.auth0.com/login-widget2#4)

![widget](http://cl.ly/image/2k3i2c3t3s2W/Screen%20Shot%202014-07-24%20at%2017.51.32.png)

Otherwise, if you'll use a custom UI, you need to include `auth0.js`.

**It's important to note that this scripts must be included before auth0-angular**.

If you're using `bower` or `npm`, this 2 scripts are set as a dependency of auth0-angular so that you choose the best for you. Otherwise, you can include them from the CDN:

````html
<!-- Either this -->
<script type="text/javascript" src="//cdn.auth0.com/w2/auth0-widget-5.js"></script>
<!-- or -->
<script type="text/javascript" src="//cdn.auth0.com/w2/auth0-3.js"></script>
````

### SDK API

This is the API for the SDK. `[]` means optional parameter.

#### auth.signin(options)

This method does the signin for you. If you're using `auth0-widget`, it'll display Auth0's widget, otherwise it'll just do the login with the Identity provider that you ask for.

The most important option is the **`popup` option. If set to `true`**, popup mode will be used and as the Angular page will not reload, **you can use callbacks to handle the sigin success and failure**. **We don't use promises since once the widget is openned, the user can enter the password wrong several times and then enter it ok. We cannot fullfill a promise (with success or failure) more than once unfortunately**.

````js
auth.signin({popup: true}, function(
  // All good
  $location.path('/');
), function(error) {
  // Error
})
````

**If you set `popup` option to `false`** (**this is the default value**), there're 2 posibilities.
If you've set the `username` and `password` options, then a CORS call to `/ro` will be done and you can use a promise to handle this case.

````js
auth.signin({
  username: $scope.username,
  password: $scope.password,
  connection: ['Username-Password-Authentication']
}, function(
  // All good
  $location.path('/');
), function(error) {
  // Error
})
````

**If you set `popup` option to `false`** (**this is the default value**) **and you don't set username and pasword as options**, redirect mode will be used. As Angular page is realoded, you **cannot use callbacks nor promises** to handle login success and failure. You'll need to use `events` to handle them:

````js
// app.js
module.config(function(authProvider) {
  authProvider.on('loginSuccess', function($location) {
    $location.path('/');
  });

  authProvider.on('loginFailure', function($location, error) {
    $location.path('/error');
  });
});
````
````js
// LoginCtrl.js
auth.signin(
  // popup: false. This is the default
);
````

You can read **a more extensive tutorial on how to use auth0-angular with [popup mode here](docs/widget-popup.md) and with [redirect mode here](docs/widget-redirect.md)**.

The rest of the **options that can be sent can be [checked here](https://docs.auth0.com/login-widget2#4)**.

#### auth.signup(options)

This shows the widget but in `signup` mode. It has the same options and parameters as the login. It's important to note that it'll perform a login after a successful signup.

#### auth.reset(options)

This will perform the "Forgot your password" flow.
If you're using `auth0.js` it will send the email to confirm the password change. [See the documentation here](https://github.com/auth0/auth0.js#change-password-database-connections)
If you're using `auth0-widget.js`, it will open the widget in the reset password more. It can receive in that case the same parameters as the `signin` method.
This method receives 2 extra parameters to handle the success and failure callbacks similar to `signin`.

#### auth.signout()

This signouts the user. Deletes the token from the client storage.

#### auth.profile

This property contains the profile from the user. **This will be filled after the user has logged in successfully**. If you want to use information from `auth.profile` only after the user is logged in, you can just do a `$watch` on this property to wait until it's set.

#### auth.profilePromise

Same as the `auth.profile` but it's actually a promise that you can check. It might be null or a promise. Null is even before the user tries to log in.

#### auth.isAuthenticated

This flag returns wether there's a user authenticated or not.

#### auth.id_token, auth.access_token, auth.state

This property contains the tokens returned after the user is logged in. Mostly for internal usage.

#### auth.hookEvents()

auth0-angular takes care of checking that **unauthenticated users canoot access restricted resources**. For that, auth0-angular hooks to internal angular events so that we can redirect the user to the login page if he doesn't have the right permission to access a page. For that, you need to hook auth0-angular to all of this events on application run

First, you need to configure the restricted routes:

````js
// Using ngRoute
module.config(function($routeProvider) {
  $routeProvider.
  when('/info', {
    templateUrl: 'info.html',
    controller: 'InfoCtrl',
    requiresLogin: true
  }).
  when('/login', {
    tempalteUrl: 'login.html',
    controller: 'LoginCtrl'
  });

  authProvider.init({
    domain: 'domain',
    clientId: 'clientId',
    callbackUrl: location.href,
    loginUrl: '/login'
  })
})

// Using ui-router
module.config(function($stateProvider) {
  $stateProvider.
  state('info', {
    url: '/info'
    templateUrl: 'info.html',
    controller: 'InfoCtrl',
    data: {
      requiresLogin: true
    }
  }).
  state('login', {
    url: '/login'
    tempalteUrl: 'login.html',
    controller: 'LoginCtrl'
  });

  authProvider.init({
    domain: 'domain',
    clientId: 'clientId',
    callbackUrl: location.href,
    loginState: 'login'
  })
});
````

Then, you just call `hookEvents` in the `run` method

````js
module.run(function(auth) {
  auth.hookEvents();
});
````

To learn more about routing and using `ngRoute` or `ui-router` with your app, please [read this tutorial](docs/routing.md)

#### auth.getToken(options)

This method does a Delegation Token request, which means exchanging current token for another one.

There're 2 options:

1) Auth0 has several Addons which let you get new tokens based on Auth0 one. Imagine you have Firebase or AWS. You want to get the token for Firebase, then you can call the following:

````js
auth.getDelegationToken({
  api: 'firebase' // By default it's going to be the first active addonn in the list of addons
})
````

2) Imagine you have 2 APIs. The user in your angular app is loged in to your angular app that uses API #1. If you want to use API #2, you need to exchange the token you have for the API #1 for a valid one for API #2. The `targetClientId` parameter is just the identifier of the API #2 in this case. **Returns a promise**.

````js
auth.getDelegationToken({
  targetClientId: 'other client id',
  api: 'auth0' // We want the Auth0 ID_token of the other API
})
````

To learn more about delegated access [please click here](https://docs.auth0.com/auth-api#delegated).

#### auth.renewIdToken()

You can configure your token to expire after certain time. If you don't want your user to login again, you can just refresh the current token, which means getting a new token that will be valid for a certain amount of time.

For example, let's imagine you have a token valid for 10 hours. After 9 hours, you can refresh the token to get a new token that's going to be valid for another 10 hours. You just need to call this method in that case and we'll handle everything for you. **Returns a promise**.

#### auth.refreshToken(refresh_token)

Given a **expired** `id_token`, you can use the `refresh_token` to get a new and valid `id_token`

#### auth.hasTokenExpired(token)

This returns if a particular token has expired or not. Mostly for internal usage.

#### authProvider.init(options)

You use this method to configure the auth service. You must set the following options:

* **domain**: The domain you have from your Auth0 account
* **callbackUrl**: The callback URL. Usually this is `location.href`
* **clientId**: The identifier for the application you've created. This can be got from the settings from your app on Auth0.
* **sso**: If you have more than one application and you want Single Sign On on your apps, just set this to true. This will mean that if a user signs in to app 1, when he tries to use app2, he will be already logged in
* **loginUrl**: Set this to the login url **if you're using ngRoute**
* **loginState**: Set this to the login state **if you're using ui-router**
* **minutesToRenewToken**: Renew the `idToken` when it expired in less than N minutes. By default, it's 120 minutes.

#### authProvider.on(event, handler)

You can configure the handlers for all the different events that can happen in your app. The following are the available events right now:

* **loginSucces**: This will get called after a user has successfully logged in. In the handler, you can inject any service you want besides the `profile` and `token` from the user
* **loginFailure**: This will get called if there's an error authenticating the usr. In the handler, you can inject any service you want besides the `error` which was thrown
* **logout**: This will get called after a user has successfully logged out.
* **forbidden**: This will get called if a request to an API is made and it returns 401 meaning that the user cannot access that resource. That usually happens when the token is expired. In that case, you should redirect the user to the login page in most cases.

It's important to note that in the case of **redirect mode, it's mandatory to handle login events in this way. In the case of popup mode, you can still handle the login events this way, but you can also handle them with a promise on the signin method**.

## Tutorials & Examples

This is the list of all of the available tutorials.

### Using Auth0 Widget (You don't want your custom UI)

#### Redirect mode

**[Click here to read the tutorial](docs/widget-redirect.md)**
**[Click here to see the tutorial](https://github.com/auth0/auth0-angular/tree/master/examples/widget-redirect)**

![Widget redirect](http://cl.ly/image/2o423i362s2P/WidgetRedirect.gif)

#### Popup mode

**[Clcik here to read the tutorial](docs/widget-popup.md)**
**[Click here to see the example](https://github.com/auth0/auth0-angular/tree/master/examples/widget)**

![Widget Popup](https://cloudup.com/cg8u9kVV5Vh+)

### With your own UI

#### User/Password Login

**[Click here to read the tutorial](docs/jssdk.md)**
**[Click here to see the example](https://github.com/auth0/auth0-angular/tree/master/examples/custom-login)**

![basic_guide](https://cloudup.com/cmaeJKX7LEM+)

#### Social Login

**[Click here to read the tutorial](docs/jssdk.md#social-authentication)**
**[Click here to see the example](https://github.com/auth0/auth0-angular/tree/master/examples/custom-login)**

![popup_guide](https://cloudup.com/cKpVNpR4s9y+)

### Refresh tokens

**[Click here to read the tutorial](docs/refreshToken.md)**

### Consuming a protected REST API

**[Click here to read the tutorial](docs/backend.md)**
**[Click here to see the example](https://github.com/auth0/auth0-angular/tree/master/examples/api-authentication)**

### Join or Link accounts

**[Click here to read the tutorial](docs/link-accounts.md)**

### Integrating to routes (ui-router and ngRoute)

**[Click here to read the tutorial](docs/routing.md)**
**[Click here to see the ui-router example](https://github.com/auth0/auth0-angular/tree/master/examples/ui-router)**
**[Click here to see the ngRoute example](https://github.com/auth0/auth0-angular/tree/master/examples/widget-redirect)**
**[Click here to see the html5mode example](https://github.com/auth0/auth0-angular/tree/master/examples/html5mode)**

### Using your custom storage

**[Click here to learn how to use your custom storage to store the tokens instead of localStorage or ngCookies](docs/custom-storage.md)**

### Delegation Token

**[Click here to see the delegation token example](https://github.com/auth0/auth0-angular/tree/master/examples/delegation-token)**

### Signup with custom fields (Besides Email & Password)

**[Click here to see the delegation token example](https://github.com/auth0/auth0-angular/tree/master/examples/custom-signup)**

### SSO

**[Click here to see the SSO example](https://github.com/auth0/auth0-angular/tree/master/examples/sso)**

## Changelog

Check [the CHANGELOG file](CHANGELOG.md) to see the changes from version to version

## Contributing
 [Read here how to run auth0-angular tests](docs/testing.md)

## What is Auth0?

Auth0 helps you to:

* Add authentication with [multiple authentication sources](https://docs.auth0.com/identityproviders), either social like **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others**, or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider**.
* Add authentication through more traditional **[username/password databases](https://docs.auth0.com/mysql-connection-tutorial)**.
* Add support for **[linking different user accounts](https://docs.auth0.com/link-accounts)** with the same user.
* Support for generating signed [Json Web Tokens](https://docs.auth0.com/jwt) to call your APIs and **flow the user identity** securely.
* Analytics of how, when and where users are logging in.
* Pull data from other sources and add it to the user profile, through [JavaScript rules](https://docs.auth0.com/rules).

## Create a free account in Auth0

1. Go to [Auth0](https://auth0.com) and click Sign Up.
2. Use Google, GitHub or Microsoft Account to login.


text:
Pegasus::AssetLib::IRuntimeAssetObjectProxy* IAssetTranslator::FindInstance(AssetInstanceHandle handle)
{
    ED_ASSERT(mAc != nullptr);
    return mAc->FindInstance(handle);
}

void IAssetTranslator::RegisterAssetIOController(AssetIOMessageController* ac)
{
    ED_ASSERT(mAc == nullptr);
    mAc = ac;
    mAc->RegisterQtTranslator(this);
}

AssetIOMessageController::AssetIOMessageController(Pegasus::App::IApplicationProxy* app)
: mApp(app), mRefreshViewsRequestCount(0)
{
}

AssetIOMessageController::~AssetIOMessageController()
{
    //clear all the instance trees.
    for (TreeObserverSet::iterator it = mActiveTreeViews.begin(); it != mActiveTreeViews.end(); ++it)
    {
        emit((*it)->OnShutdownSignal());
    }
}

void AssetIOMessageController::RegisterQtTranslator(IAssetTranslator* translator)
{
    const Pegasus::PegasusAssetTypeDesc** types = translator->GetTypeList();
    int i = 0;
    while (types != nullptr && types[i] != nullptr)
    {
        mQtTranslators.insert(types[i++]->mTypeGuid, translator);
    }
}

void AssetIOMessageController::OnRenderThreadProcessMessage(PegasusDockWidget* sender, const AssetIOMCMessage& msg)
{
    switch(msg.GetMessageType())
    {
        case AssetIOMCMessage::OPEN_ASSET:
            {
                OnRenderRequestOpenObject(msg.GetString());
            }
            break;
        case AssetIOMCMessage::CLOSE_ASSET:
            {
                OnRenderRequestCloseObject(msg.GetObject());
            }
            break;
        case AssetIOMCMessage::RELOAD_FROM_ASSET:
            {
                OnRenderRequestReloadObject(msg.GetObject());
            }
            break;
        case AssetIOMCMessage::SAVE_ASSET:
            {
                OnSaveObject(sender, msg.GetObject());
            }
            break;
        case AssetIOMCMessage::NEW_ASSET:
            {
                OnRenderRequestNewObject(sender, msg.GetString(), msg.GetTypeDesc());
            }
            break;
        case AssetIOMCMessage::QUERY_START_VIEW_ASSET_TREE:
        case AssetIOMCMessage::QUERY_REFRESH_VIEW_ASSET_TREE:
            {
                OnRenderRequestQueryStartViewAssetTree(msg.GetTreeObserver());
            }
            break;
        case AssetIOMCMessage::QUERY_STOP_VIEW_ASSET_TREE:
            {
                OnRenderRequestQueryStopViewAssetTree(msg.GetTreeObserver());
            }
            break;
        default:
            break;
    }
}

void AssetIOMessageController::OnRenderRequestOpenObject(const QString& path)
{
    QByteArray ba = path.toLocal8Bit();
    const char* asciiPath = ba.constData();

    ED_ASSERT(asciiPath != nullptr);
    if (mApp != nullptr)
    {
        Pegasus::AssetLib::IAssetLibProxy*  assetLib = mApp->GetAssetLibProxy();
        Pegasus::AssetLib::IRuntimeAssetObjectProxy* object = assetLib->LoadObject(asciiPath);

        //can't deserialize this object.
        if (object == nullptr)
        {
            return;
        }
        ED_ASSERT(object->GetOwnerAsset() != nullptr);
        TypeTranslatorMap::iterator it = mQtTranslators.find(object->GetOwnerAsset()->GetTypeDesc()->mTypeGuid);
        int typeGuid = object->GetOwnerAsset()->GetTypeDesc()->mTypeGuid;
        if (it != mQtTranslators.end())
        {
            if (object != nullptr)
            {
                AssetInstanceHandle h = mObjectMap.Insert(object);
                QVariant data = it.value()->TranslateToQt(h, object);
                emit(SignalOpenObject(h, object->GetDisplayName(), typeGuid, data));
            }
        }
        else if (object != nullptr)
        {
            ED_LOG("No io controller that could process this asset type. %s", asciiPath);
            assetLib->CloseObject(object);
        }
        else
        {
            ED_LOG("%s cannot be opened by Pegasus.", asciiPath);
        }
    }

    emit(RedrawFrame());
}

void AssetIOMessageController::OnRenderRequestCloseObject(AssetInstanceHandle& handle)
{
    ED_ASSERT(mObjectMap.Has(handle));

    Pegasus::AssetLib::IRuntimeAssetObjectProxy* obj = mObjectMap.Get(handle);

    Pegasus::AssetLib::IAssetLibProxy* assetLib = mApp->GetAssetLibProxy();
    assetLib->CloseObject(obj);
    emit(RedrawFrame());
}

void AssetIOMessageController::OnRenderRequestReloadObject(AssetInstanceHandle& handle)
{
    ED_ASSERT(mObjectMap.Has(handle));

    Pegasus::AssetLib::IRuntimeAssetObjectProxy* obj = mObjectMap.Get(handle);
    obj->ReloadFromAsset();
    emit(RedrawFrame());
}

void AssetIOMessageController::OnSaveObject(PegasusDockWidget* sender, AssetInstanceHandle& handle)
{
    Pegasus::AssetLib::IRuntimeAssetObjectProxy* object = mObjectMap.Get(handle);
    Pegasus::Io::IoError err = mApp->GetAssetLibProxy()->SaveObject(object);

    if (err == Pegasus::Io::ERR_NONE)
    {
        emit(SignalPostMessage(sender, AssetIOMCMessage::IO_SAVE_SUCCESS));
    }
    else
    {
        emit(SignalPostMessage(sender, AssetIOMCMessage::IO_SAVE_ERROR));
    }

    FlushAllPendingUpdates();
}

void AssetIOMessageController::OnRenderRequestNewObject(PegasusDockWidget* sender, const QString& path, const Pegasus::PegasusAssetTypeDesc* desc)
{
    QByteArray ba = path.toLocal8Bit();
    const char* asciiPath = ba.constData();

    ED_ASSERT(asciiPath != nullptr);
    Pegasus::AssetLib::IAssetLibProxy* assetLib = mApp->GetAssetLibProxy();
    Pegasus::AssetLib::IRuntimeAssetObjectProxy* newObj = assetLib->CreateObject(asciiPath, desc);
    ED_ASSERT(newObj->GetOwnerAsset() != nullptr);
    TypeTranslatorMap::iterator it = mQtTranslators.find(newObj->GetOwnerAsset()->GetTypeDesc()->mTypeGuid);
    int typeGuid = newObj->GetOwnerAsset()->GetTypeDesc()->mTypeGuid;
    if (it != mQtTranslators.end())
    {
        if (newObj != nullptr)
        {
            AssetInstanceHandle handle = mObjectMap.Insert(newObj);
            QVariant data = it.value()->TranslateToQt(handle, newObj);

            if (Pegasus::Io::ERR_NONE == assetLib->SaveObject(newObj))
            {
                emit(SignalOpenObject(handle, newObj->GetDisplayName(), typeGuid, data));
            }
            else
            {
                emit(SignalPostMessage(sender, AssetIOMCMessage::IO_NEW_ERROR));
            }
        }
        else
        {
            emit(SignalPostMessage(sender, AssetIOMCMessage::IO_NEW_ERROR));
        }
    }
    else
    {
        ED_LOG("Cannot create new asset because of unknown handled type: %s", asciiPath);
    }
    emit(RedrawFrame());
}

void AssetIOMessageController::InternalBuildAssetTreeFromObj(
    QMap<Pegasus::AssetLib::IAssetProxy*, int>& cachedAssetMap,
    Pegasus::AssetLib::IObjectProxy* obj,
    AssetInformation& outAssetInfo,
    AssetViewTree& outTree)
{

    for (unsigned i = 0; i < obj->GetChildAssetCount(); ++i)
    {
        Pegasus::AssetLib::IAssetProxy* childProxy = obj->GetChildAsset(i);
        int childAssetTreeId = InternalBuildSingleAssetTree(cachedAssetMap, childProxy, outTree);
        outAssetInfo.children.push_back(childAssetTreeId);
    }

    for (unsigned i = 0; i < obj->GetChildObjectCount(); ++i)
    {
        InternalBuildAssetTreeFromObj(cachedAssetMap, obj->GetChildObject(i), outAssetInfo,  outTree);
    }

    for (unsigned i = 0; i < obj->GetArrayCount(); ++i)
    {
        Pegasus::AssetLib::IArrayProxy* arrProxy = obj->GetArray(i);
        if (arrProxy->IsObjectType())
        {
            for (unsigned j = 0; j < arrProxy->GetSize(); ++j)
            {
                InternalBuildAssetTreeFromObj(cachedAssetMap, arrProxy->GetObjectEl(j), outAssetInfo, outTree);
            }
        }
        else if (arrProxy->IsAssetType())
        {
            for (unsigned j = 0; j < arrProxy->GetSize(); ++j)
            {
                Pegasus::AssetLib::IAssetProxy* childProxy = arrProxy->GetAssetEl(j);
                int childAssetTreeId = InternalBuildSingleAssetTree(cachedAssetMap, childProxy, outTree);
                outAssetInfo.children.push_back(childAssetTreeId);
            }
        }
    }
}

int AssetIOMessageController::InternalBuildSingleAssetTree(
    QMap<Pegasus::AssetLib::IAssetProxy*, int>& cachedAssetMap,
    Pegasus::AssetLib::IAssetProxy* assetProxy,
    AssetViewTree& outTree)
{
    AssetInformation outAssetInfo;
    int treeId = -1;
    QMap<Pegasus::AssetLib::IAssetProxy*, int>::iterator it = cachedAssetMap.find(assetProxy);
    if (it == cachedAssetMap.end())
    {
        treeId = (int)outTree.allAssets.size();
        outTree.allAssets.push_back(AssetInformation());
        cachedAssetMap.insert(assetProxy, treeId);

        if (assetProxy->Root() != nullptr)
        {
            InternalBuildAssetTreeFromObj(cachedAssetMap, assetProxy->Root(), outAssetInfo, outTree);
        }

        if (assetProxy->GetTypeDesc() != nullptr)
        {
            TypeTranslatorMap::iterator it = mQtTranslators.find(assetProxy->GetTypeDesc()->mTypeGuid);
            if (it != mQtTranslators.end())
            {
                outAssetInfo.isValid = (*it)->IsRuntimeObjectValid(assetProxy->GetRuntimeObject());
            }
            else
            {
                outAssetInfo.isValid = false;
            }
        }

        outAssetInfo.displayName = assetProxy->GetPath();
        outAssetInfo.typeInfo = assetProxy->GetTypeDesc();
        outTree.allAssets[treeId] = outAssetInfo;
    }
    else
    {
        treeId = it.value();
    }

    return treeId;
}

QString GetCategoryName(Pegasus::App::IApplicationProxy* app, Pegasus::AssetLib::ICategoryProxy* category)
{
    Pegasus::Timeline::ITimelineProxy* timeline = app->GetTimelineManagerProxy()->GetCurrentTimeline();
    Pegasus::Timeline::IBlockProxy* blockProxy = timeline->FindBlockByGuid(category->GetUserData());
    if (blockProxy != nullptr)
    {
        QString instanceName = blockProxy->GetInstanceName();
        QString className = blockProxy->GetClassName();
        return instanceName.isEmpty() ? className : instanceName + ":" + className;
    }

    return QString("<unknown>");
}

void AssetIOMessageController::InternalBuildAssetTree(Pegasus::App::IApplicationProxy* appProxy, Pegasus::AssetLib::IAssetLibProxy* assetLib, AssetViewTree& outTree)
{
    QMap<Pegasus::AssetLib::IAssetProxy*, int> cachedAssetMap;

    for (unsigned categoryId = 0; categoryId < assetLib->GetCategoryCount(); ++categoryId)
    {
        Pegasus::AssetLib::ICategoryProxy* categoryProxy = assetLib->GetCategory(categoryId);
        AssetCategory categoryInfo;
        categoryInfo.displayName = GetCategoryName(appProxy, categoryProxy);; //todo: bring here the name
        categoryInfo.blockGuid = categoryProxy->GetUserData();

        for (unsigned assetId = 0; assetId < categoryProxy->GetAssetCount(); ++assetId)
        {
            Pegasus::AssetLib::IAssetProxy* assetProxy = categoryProxy->GetAsset(assetId);
            int treeAssetId = InternalBuildSingleAssetTree(cachedAssetMap, assetProxy, outTree);
            categoryInfo.children.push_back(treeAssetId);
        }

        outTree.categories.push_back(categoryInfo);
    }

    Pegasus::PegasusDesc engineDesc;
    appProxy->GetEngineDesc(engineDesc);

    const Pegasus::PegasusAssetTypeDesc* const * typeList = engineDesc.mAssetTypes;
    while (*typeList != nullptr)
    {
        const Pegasus::PegasusAssetTypeDesc* typeDesc = *typeList;
        Pegasus::AssetLib::ICategoryProxy* categoryProxy = assetLib->FindTypeCategory(typeDesc);

        AssetCategory categoryInfo;
        categoryInfo.displayName = QString(typeDesc->mTypeName);
        categoryInfo.blockGuid = 0; //invalid block guid

        for (unsigned assetId = 0; assetId < categoryProxy->GetAssetCount(); ++assetId)
        {
            Pegasus::AssetLib::IAssetProxy* assetProxy = categoryProxy->GetAsset(assetId);
            int treeAssetId = InternalBuildSingleAssetTree(cachedAssetMap, assetProxy, outTree);
            categoryInfo.children.push_back(treeAssetId);
        }

        outTree.typeCategories.push_back(categoryInfo);

        typeList++;
    }

}

void AssetIOMessageController::OnRenderRequestQueryStartViewAssetTree(AssetTreeObserver* observer)
{
    if (mActiveTreeViews.find(observer) == mActiveTreeViews.end())
    {
        mActiveTreeViews.insert(observer);
    }

    if (mApp != nullptr)
    {
        Pegasus::AssetLib::IAssetLibProxy*  assetLib = mApp->GetAssetLibProxy();
        // generate the entire asset tree. This is an expensive step (if the asset tree is too big). In the future,
        // we can refactor this into only updating small deltas instead of the entire tree.
        AssetViewTree tree;
        InternalBuildAssetTree(mApp, mApp->GetAssetLibProxy(), tree);
        emit(observer->OnInitializedSignal(tree));
    }
}

void AssetIOMessageController::OnTagValidity(QString assetPath, bool validity)
{
    for (AssetTreeObserver* observer : mActiveTreeViews)
    {
        emit(observer->OnSetValiditySignal(assetPath, validity));
    }
}

void AssetIOMessageController::OnRenderRequestQueryStopViewAssetTree(AssetTreeObserver* observer)
{
    TreeObserverSet::iterator it = mActiveTreeViews.find(observer);
    if (it != mActiveTreeViews.end())
    {
        emit(observer->OnShutdownSignal());
        mActiveTreeViews.remove(observer);
    }
}

Pegasus::AssetLib::IRuntimeAssetObjectProxy* AssetIOMessageController::FindInstance(AssetInstanceHandle handle)
{
    if (mObjectMap.Has(handle))
    {
        return mObjectMap.Get(handle);
    }
    return nullptr;
}

void AssetIOMessageController::OnEvent(Pegasus::Core::IEventUserData* userData, Pegasus::AssetLib::AssetCreated& e)
{
    RequestRefreshViewOnAllObservers();
}

void AssetIOMessageController::OnEvent(Pegasus::Core::IEventUserData* userData, Pegasus::AssetLib::AssetLinkAdded& e)
{
    RequestRefreshViewOnAllObservers();
}

void AssetIOMessageController::OnEvent(Pegasus::Core::IEventUserData* userData, Pegasus::AssetLib::AssetDestroyed& e)
{
    RequestRefreshViewOnAllObservers();
}

void AssetIOMessageController::OnEvent(Pegasus::Core::IEventUserData* userData, Pegasus::AssetLib::RuntimeAssetObjectCreated& e)
{
    RequestRefreshViewOnAllObservers();
}

void AssetIOMessageController::OnEvent(Pegasus::Core::IEventUserData* userData, Pegasus::AssetLib::RuntimeAssetObjectDestroyed& e)
{
    RequestRefreshViewOnAllObservers();
    //Redraw is not triggered usually when an asset is closed. Go ahead and flush.
    emit(RedrawFrame());
}

void AssetIOMessageController::FlushAllPendingUpdates()
{
    RefreshViewOnAllObservers();
}

void AssetIOMessageController::RefreshViewOnAllObservers()
{
    if (mRefreshViewsRequestCount > 0)
    {
        AssetViewTree tree;
        InternalBuildAssetTree(mApp, mApp->GetAssetLibProxy(), tree);

        TreeObserverSet::iterator it = mActiveTreeViews.begin();
        for (;it != mActiveTreeViews.end(); ++it)
        {
            emit((*it)->OnInitializedSignal(tree));
        }
        mRefreshViewsRequestCount = 0;
    }
}

AssetTreeObserver::AssetTreeObserver()
{
    connect(this, SIGNAL(OnInitializedSignal(AssetViewTree)),
        this, SLOT(OnInitializedSlot(AssetViewTree)), Qt::QueuedConnection);

    connect(this, SIGNAL(OnSetValiditySignal(QString, bool)),
            this, SLOT(OnSetValiditySlot(QString, bool)), Qt::QueuedConnection);

    connect(this, SIGNAL(OnShutdownSignal()),
            this, SLOT(OnShutdownSlot()), Qt::QueuedConnection);
}


text:
layout: post
date: '2016-04-21'
title: "House of Wu Christina Wu Occasions Style 22331 Sleeveless Short/Mini Empire"
category: House of Wu
tags: [House of Wu,Empire,Sweetheart,Short/Mini,Sleeveless]
---
### House of Wu Christina Wu Occasions Style 22331
Just **$239.99**
###   Sleeveless Short/Mini Empire

BRANDS	House of Wu

Silhouette	Empire

Neckline	Sweetheart

Hemline/Train	Short/Mini

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/house-of-wu/18570-house-of-wu-christina-wu-occasions-style-22331.html](https://www.readybrides.com/en/house-of-wu/18570-house-of-wu-christina-wu-occasions-style-22331.html)


text:
/// <reference path='fourslash.ts'/>

////module BugFixes {
////    enum Foo {
////        bar,
////        baz
////    }
////    var f: Foo = Foo./**/;
////}

goTo.marker();
verify.memberListContains("bar");
verify.memberListContains("baz");


text:
Help about the --backend flag.

### Synopsis

The --backend flag specifies which backend should be used, possible values
are:

	default		Uses lldb on macOS, native everywhere else.
	native		Native backend.
	lldb		Uses lldb-server or debugserver.
	rr		Uses mozilla rr (https://github.com/mozilla/rr).

### Options inherited from parent commands

```
      --accept-multiclient   Allows a headless server to accept multiple client connections.
      --api-version int      Selects API version when headless. (default 1)
      --backend string       Backend selection (see 'dlv help backend'). (default "default")
      --build-flags string   Build flags, to be passed to the compiler.
      --check-go-version     Checks that the version of Go in use is compatible with Delve. (default true)
      --headless             Run debug server only, in headless mode.
      --init string          Init file, executed by the terminal client.
  -l, --listen string        Debugging server listen address. (default "127.0.0.1:0")
      --log                  Enable debugging server logging.
      --log-dest string      Writes logs to the specified file or file descriptor (see 'dlv help log').
      --log-output string    Comma separated list of components that should produce debug output (see 'dlv help log')
      --wd string            Working directory for running the program. (default ".")
```

### SEE ALSO
* [dlv](dlv.md)	 - Delve is a debugger for the Go programming language.


text:
"""Basic neural network layers."""
__all__ = ['Sequential', 'HybridSequential', 'Dense', 'Activation',
           'Dropout', 'BatchNorm', 'LeakyReLU', 'Embedding', 'Flatten',
           'Lambda', 'HybridLambda']
import warnings
import numpy as np

from ..block import Block, HybridBlock
from ..utils import _indent
from ... import nd, sym

class Sequential(Block):
    """Stacks Blocks sequentially.

    Example::

        net = nn.Sequential()
        # use net's name_scope to give child Blocks appropriate names.
        with net.name_scope():
            net.add(nn.Dense(10, activation='relu'))
            net.add(nn.Dense(20))
    """
    def __init__(self, prefix=None, params=None):
        super(Sequential, self).__init__(prefix=prefix, params=params)

    def add(self, *blocks):
        """Adds block on top of the stack."""
        for block in blocks:
            self.register_child(block)

    def forward(self, x):
        for block in self._children:
            x = block(x)
        return x

    def __repr__(self):
        s = '{name}(\n{modstr}\n)'
        modstr = '\n'.join(['  ({key}): {block}'.format(key=key,
                                                        block=_indent(block.__repr__(), 2))
                            for key, block in enumerate(self._children)
                            if isinstance(block, Block)])
        return s.format(name=self.__class__.__name__,
                        modstr=modstr)

    def __getitem__(self, key):
        return self._children[key]

    def __len__(self):
        return len(self._children)

    def hybridize(self, active=True):
        """Activates or deactivates `HybridBlock`s recursively. Has no effect on
        non-hybrid children.

        Parameters
        ----------
        active : bool, default True
            Whether to turn hybrid on or off.
        """
        if self._children and all(isinstance(c, HybridBlock) for c in self._children):
            warnings.warn('All children of this Sequential layer are HybridBlocks. Consider ' \
                          'using HybridSequential for the best performance.')
        super(Sequential, self).hybridize(active)

class HybridSequential(HybridBlock):
    """Stacks HybridBlocks sequentially.

    Example::

        net = nn.Sequential()
        # use net's name_scope to give child Blocks appropriate names.
        with net.name_scope():
            net.add(nn.Dense(10, activation='relu'))
            net.add(nn.Dense(20))
        net.hybridize()
    """
    def __init__(self, prefix=None, params=None):
        super(HybridSequential, self).__init__(prefix=prefix, params=params)

    def add(self, *blocks):
        """Adds block on top of the stack."""
        for block in blocks:
            self.register_child(block)

    def hybrid_forward(self, F, x):
        for block in self._children:
            x = block(x)
        return x

    def __repr__(self):
        s = '{name}(\n{modstr}\n)'
        modstr = '\n'.join(['  ({key}): {block}'.format(key=key,
                                                        block=_indent(block.__repr__(), 2))
                            for key, block in enumerate(self._children)
                            if isinstance(block, Block)])
        return s.format(name=self.__class__.__name__,
                        modstr=modstr)

    def __getitem__(self, key):
        return self._children[key]

    def __len__(self):
        return len(self._children)

class Dense(HybridBlock):
    r"""Just your regular densely-connected NN layer.

    `Dense` implements the operation:
    `output = activation(dot(input, weight) + bias)`
    where `activation` is the element-wise activation function
    passed as the `activation` argument, `weight` is a weights matrix
    created by the layer, and `bias` is a bias vector created by the layer
    (only applicable if `use_bias` is `True`).

    Note: the input must be a tensor with rank 2. Use `flatten` to convert it
    to rank 2 manually if necessary.

    Parameters
    ----------
    units : int
        Dimensionality of the output space.
    activation : str
        Activation function to use. See help on `Activation` layer.
        If you don't specify anything, no activation is applied
        (ie. "linear" activation: `a(x) = x`).
    use_bias : bool
        Whether the layer uses a bias vector.
    flatten: bool
        Whether the input tensor should be flattened.
        If true, all but the first axis of input data are collapsed together.
        If false, all but the last axis of input data are kept the same, and the transformation
        applies on the last axis.
    weight_initializer : str or `Initializer`
        Initializer for the `kernel` weights matrix.
    bias_initializer: str or `Initializer`
        Initializer for the bias vector.
    in_units : int, optional
        Size of the input data. If not specified, initialization will be
        deferred to the first time `forward` is called and `in_units`
        will be inferred from the shape of input data.
    prefix : str or None
        See document of `Block`.
    params : ParameterDict or None
        See document of `Block`.

    Inputs:
        - **data**: if `flatten` is True, `data` should be a tensor with shape
          `(batch_size, x1, x2, ..., xn)`, where x1 * x2 * ... * xn is equal to
          `in_units`. If `flatten` is False, `data` should have shape
          `(x1, x2, ..., xn, in_units)`.

    Outputs:
        - **out**: if `flatten` is True, `out` will be a tensor with shape
          `(batch_size, units)`. If `flatten` is False, `out` will have shape
          `(x1, x2, ..., xn, units)`.
    """
    def __init__(self, units, activation=None, use_bias=True, flatten=True,
                 weight_initializer=None, bias_initializer='zeros',
                 in_units=0, **kwargs):
        super(Dense, self).__init__(**kwargs)
        self._flatten = flatten
        with self.name_scope():
            self._units = units
            self._in_units = in_units
            self.weight = self.params.get('weight', shape=(units, in_units),
                                          init=weight_initializer,
                                          allow_deferred_init=True)
            if use_bias:
                self.bias = self.params.get('bias', shape=(units,),
                                            init=bias_initializer,
                                            allow_deferred_init=True)
            else:
                self.bias = None
            if activation is not None:
                self.act = Activation(activation, prefix=activation+'_')
            else:
                self.act = None

    def hybrid_forward(self, F, x, weight, bias=None):
        act = F.FullyConnected(x, weight, bias, no_bias=bias is None, num_hidden=self._units,
                               flatten=self._flatten, name='fwd')
        if self.act is not None:
            act = self.act(act)
        return act

    def __repr__(self):
        s = '{name}({layout}, {act})'
        shape = self.weight.shape
        return s.format(name=self.__class__.__name__,
                        act=self.act if self.act else 'linear',
                        layout='{0} -> {1}'.format(shape[1] if shape[1] else None, shape[0]))

class Activation(HybridBlock):
    r"""Applies an activation function to input.

    Parameters
    ----------
    activation : str
        Name of activation function to use.
        See :func:`~mxnet.ndarray.Activation` for available choices.

    Inputs:
        - **data**: input tensor with arbitrary shape.

    Outputs:
        - **out**: output tensor with the same shape as `data`.
    """
    def __init__(self, activation, **kwargs):
        self._act_type = activation
        super(Activation, self).__init__(**kwargs)

    def _alias(self):
        return self._act_type

    def hybrid_forward(self, F, x):
        return F.Activation(x, act_type=self._act_type, name='fwd')

    def __repr__(self):
        s = '{name}({_act_type})'
        return s.format(name=self.__class__.__name__,
                        **self.__dict__)

class Dropout(HybridBlock):
    """Applies Dropout to the input.

    Dropout consists in randomly setting a fraction `rate` of input units
    to 0 at each update during training time, which helps prevent overfitting.

    Parameters
    ----------
    rate : float
        Fraction of the input units to drop. Must be a number between 0 and 1.

    Inputs:
        - **data**: input tensor with arbitrary shape.

    Outputs:
        - **out**: output tensor with the same shape as `data`.

    References
    ----------
        `Dropout: A Simple Way to Prevent Neural Networks from Overfitting
        <http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf>`_
    """
    def __init__(self, rate, **kwargs):
        super(Dropout, self).__init__(**kwargs)
        self._rate = rate

    def hybrid_forward(self, F, x):
        return F.Dropout(x, p=self._rate, name='fwd')

    def __repr__(self):
        s = '{name}(p = {_rate})'
        return s.format(name=self.__class__.__name__,
                        **self.__dict__)

class BatchNorm(HybridBlock):
    """Batch normalization layer (Ioffe and Szegedy, 2014).
    Normalizes the input at each batch, i.e. applies a transformation
    that maintains the mean activation close to 0 and the activation
    standard deviation close to 1.

    Parameters
    ----------
    axis : int, default 1
        The axis that should be normalized. This is typically the channels
        (C) axis. For instance, after a `Conv2D` layer with `layout='NCHW'`,
        set `axis=1` in `BatchNorm`. If `layout='NHWC'`, then set `axis=3`.
    momentum: float, default 0.9
        Momentum for the moving average.
    epsilon: float, default 1e-5
        Small float added to variance to avoid dividing by zero.
    center: bool, default True
        If True, add offset of `beta` to normalized tensor.
        If False, `beta` is ignored.
    scale: bool, default True
        If True, multiply by `gamma`. If False, `gamma` is not used.
        When the next layer is linear (also e.g. `nn.relu`),
        this can be disabled since the scaling
        will be done by the next layer.
    beta_initializer: str or `Initializer`, default 'zeros'
        Initializer for the beta weight.
    gamma_initializer: str or `Initializer`, default 'ones'
        Initializer for the gamma weight.
    moving_mean_initializer: str or `Initializer`, default 'zeros'
        Initializer for the moving mean.
    moving_variance_initializer: str or `Initializer`, default 'ones'
        Initializer for the moving variance.
    in_channels : int, default 0
        Number of channels (feature maps) in input data. If not specified,
        initialization will be deferred to the first time `forward` is called
        and `in_channels` will be inferred from the shape of input data.

    Inputs:
        - **data**: input tensor with arbitrary shape.

    Outputs:
        - **out**: output tensor with the same shape as `data`.
    """
    def __init__(self, axis=1, momentum=0.9, epsilon=1e-5, center=True, scale=True,
                 beta_initializer='zeros', gamma_initializer='ones',
                 running_mean_initializer='zeros', running_variance_initializer='ones',
                 in_channels=0, **kwargs):
        super(BatchNorm, self).__init__(**kwargs)
        self._kwargs = {'axis': axis, 'eps': epsilon, 'momentum': momentum,
                        'fix_gamma': not scale}
        if in_channels != 0:
            self.in_channels = in_channels

        self.gamma = self.params.get('gamma', grad_req='write' if scale else 'null',
                                     shape=(in_channels,), init=gamma_initializer,
                                     allow_deferred_init=True,
                                     differentiable=scale)
        self.beta = self.params.get('beta', grad_req='write' if center else 'null',
                                    shape=(in_channels,), init=beta_initializer,
                                    allow_deferred_init=True,
                                    differentiable=center)
        self.running_mean = self.params.get('running_mean', grad_req='null',
                                            shape=(in_channels,),
                                            init=running_mean_initializer,
                                            allow_deferred_init=True,
                                            differentiable=False)
        self.running_var = self.params.get('running_var', grad_req='null',
                                           shape=(in_channels,),
                                           init=running_variance_initializer,
                                           allow_deferred_init=True,
                                           differentiable=False)

    def cast(self, dtype):
        if np.dtype(dtype).name == 'float16':
            dtype = 'float32'
        super(BatchNorm, self).cast(dtype)

    def hybrid_forward(self, F, x, gamma, beta, running_mean, running_var):
        return F.BatchNorm(x, gamma, beta, running_mean, running_var,
                           name='fwd', **self._kwargs)

    def __repr__(self):
        s = '{name}({content}'
        in_channels = self.gamma.shape[0]
        s += ', in_channels={0}'.format(in_channels if in_channels else None)
        s += ')'
        return s.format(name=self.__class__.__name__,
                        content=', '.join(['='.join([k, v.__repr__()])
                                           for k, v in self._kwargs.items()]))

class LeakyReLU(HybridBlock):
    r"""Leaky version of a Rectified Linear Unit.

    It allows a small gradient when the unit is not active

    .. math::

        f\left(x\right) = \left\{
            \begin{array}{lr}
               \alpha x & : x \lt 0 \\
                      x & : x \geq 0 \\
            \end{array}
        \right.\\

    Parameters
    ----------
    alpha : float
        slope coefficient for the negative half axis. Must be >= 0.

    Inputs:
        - **data**: input tensor with arbitrary shape.

    Outputs:
        - **out**: output tensor with the same shape as `data`.
    """
    def __init__(self, alpha, **kwargs):
        assert alpha >= 0, "Slope coefficient for LeakyReLU must be no less than 0."
        super(LeakyReLU, self).__init__(**kwargs)
        self._alpha = alpha

    def hybrid_forward(self, F, x):
        return F.LeakyReLU(x, act_type='leaky', slope=self._alpha, name='fwd')

    def __repr__(self):
        s = '{name}({alpha})'
        return s.format(name=self.__class__.__name__,
                        alpha=self._alpha)

class Embedding(HybridBlock):
    r"""Turns non-negative integers (indexes/tokens) into dense vectors
    of fixed size. eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]

    Parameters
    ----------
    input_dim : int
        Size of the vocabulary, i.e. maximum integer index + 1.
    output_dim : int
        Dimension of the dense embedding.
    dtype : str or np.dtype, default 'float32'
        Data type of output embeddings.
    weight_initializer : Initializer
        Initializer for the `embeddings` matrix.

    Inputs:
        - **data**: 2D tensor with shape: `(x1, x2)`.

    Output:
        - **out**: 3D tensor with shape: `(x1, x2, output_dim)`.
    """
    def __init__(self, input_dim, output_dim, dtype='float32',
                 weight_initializer=None, **kwargs):
        super(Embedding, self).__init__(**kwargs)
        self._kwargs = {'input_dim': input_dim, 'output_dim': output_dim,
                        'dtype': dtype}
        self.weight = self.params.get('weight', shape=(input_dim, output_dim),
                                      init=weight_initializer,
                                      allow_deferred_init=True)

    def hybrid_forward(self, F, x, weight):
        return F.Embedding(x, weight, name='fwd', **self._kwargs)

    def __repr__(self):
        s = '{block_name}({input_dim} -> {output_dim}, {dtype})'
        return s.format(block_name=self.__class__.__name__,
                        **self._kwargs)

class Flatten(HybridBlock):
    r"""Flattens the input to two dimensional.

    Inputs:
        - **data**: input tensor with arbitrary shape `(N, x1, x2, ..., xn)`

    Output:
        - **out**: 2D tensor with shape: `(N, x1 \cdot x2 \cdot ... \cdot xn)`
    """
    def __init__(self, **kwargs):
        super(Flatten, self).__init__(**kwargs)

    def hybrid_forward(self, F, x):
        return x.reshape((0, -1))

    def __repr__(self):
        return self.__class__.__name__

class Lambda(Block):
    r"""Wraps an operator or an expression as a Block object.

    Parameters
    ----------
    function : str or function
        Function used in lambda must be one of the following:
        1) the name of an operator that is available in ndarray. For example::

            block = Lambda('tanh')

        2) a function that conforms to "def function(*args)". For example::

            block = Lambda(lambda x: nd.LeakyReLU(x, slope=0.1))

    Inputs:
        - ** *args **: one or more input data. Their shapes depend on the function.

    Output:
        - ** *outputs **: one or more output data. Their shapes depend on the function.
    """
    def __init__(self, function, prefix=None):
        super(Lambda, self).__init__(prefix=prefix)
        if isinstance(function, str):
            assert hasattr(nd, function), \
                   "Function name %s is not found in ndarray." % function
            self._func_impl = getattr(nd, function)
        elif callable(function):
            self._func_impl = function
        else:
            raise ValueError(
                "Unrecognized function in lambda: {} of type {}"
                .format(function, type(function)))

    def forward(self, *args):
        return self._func_impl(*args)

    def __repr__(self):
        return '{name}({function})'.format(name=self.__class__.__name__,
                                           function=self._func_impl.__name__)

class HybridLambda(HybridBlock):
    r"""Wraps an operator or an expression as a HybridBlock object.

    Parameters
    ----------
    function : str or function
        Function used in lambda must be one of the following:
        1) the name of an operator that is available in both symbol and ndarray. For example::

            block = HybridLambda('tanh')

        2) a function that conforms to "def function(F, data, *args)". For example::

            block = HybridLambda(lambda F, x: F.LeakyReLU(x, slope=0.1))

    Inputs:
        - ** *args **: one or more input data. First argument must be symbol or ndarray.
        Their shapes depend on the function.

    Output:
        - ** *outputs **: one or more output data. Their shapes depend on the function.
    """
    def __init__(self, function, prefix=None):
        super(HybridLambda, self).__init__(prefix=prefix)
        if isinstance(function, str):
            assert hasattr(nd, function) and hasattr(sym, function), \
                   "Function name %s is not found in symbol/ndarray." % function
            func_dict = {sym: getattr(sym, function), nd: getattr(nd, function)}
            self._func = lambda F, *args: func_dict[F](*args)
            self._func_name = function
        elif callable(function):
            self._func = function
            self._func_name = function.__name__
        else:
            raise ValueError(
                "Unrecognized function in lambda: {} of type {}"
                .format(function, type(function)))

    def hybrid_forward(self, F, x, *args):
        return self._func(F, x, *args)

    def __repr__(self):
        return '{name}({function})'.format(name=self.__class__.__name__,
                                           function=self._func_name)


text:
package main

import (
	"context"

	vpcaccess "cloud.google.com/go/vpcaccess/apiv1"
	vpcaccesspb "google.golang.org/genproto/googleapis/cloud/vpcaccess/v1"
)

func main() {
	ctx := context.Background()
	c, err := vpcaccess.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vpcaccesspb.CreateConnectorRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/vpcaccess/v1#CreateConnectorRequest.
	}
	op, err := c.CreateConnector(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

// [END vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync]


text:
pub mod device;
pub mod event;
pub mod nv_link;

use crate::ffi::bindings::*;
use bitflags::bitflags;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

bitflags! {
    /// Generic flags used to specify the default behavior of some functions.
    // Checked against local
    #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
    pub struct Behavior: u32 {
        const DEFAULT = nvmlFlagDefault;
        const FORCE   = nvmlFlagForce;
    }
}

bitflags! {
    /// Flags that can be passed to `Nvml::init_with_flags()`.
    #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
    #[derive(Default)]
    pub struct InitFlags: u32 {
        /// Don't fail to initialize when no NVIDIA GPUs are found.
        const NO_GPUS = NVML_INIT_FLAG_NO_GPUS;
        /// Don't attach GPUs during initialization.
        const NO_ATTACH = NVML_INIT_FLAG_NO_ATTACH;
    }
}