text:
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Camera
//
//=============================================================================

using UnityEngine;
using UnityEditor;
using System.IO;

[CustomEditor(typeof(SteamVR_Camera)), CanEditMultipleObjects]
public class SteamVR_Editor : Editor
{
	int bannerHeight = 150;
	Texture logo;

	SerializedProperty script, wireframe;

	string GetResourcePath()
	{
		var ms = MonoScript.FromScriptableObject(this);
		var path = AssetDatabase.GetAssetPath(ms);
		path = Path.GetDirectoryName(path);
		return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
	}

	void OnEnable()
	{
		var resourcePath = GetResourcePath();

		logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");

		script = serializedObject.FindProperty("m_Script");

		wireframe = serializedObject.FindProperty("wireframe");

		foreach (SteamVR_Camera target in targets)
			target.ForceLast();
	}

	public override void OnInspectorGUI()
	{
		serializedObject.Update();

		var rect = GUILayoutUtility.GetRect(Screen.width - 38, bannerHeight, GUI.skin.box);
		if (logo)
			GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);

		if (!Application.isPlaying)
		{
			var expand = false;
			var collapse = false;
			foreach (SteamVR_Camera target in targets)
			{
				if (AssetDatabase.Contains(target))
					continue;
				if (target.isExpanded)
					collapse = true;
				else
					expand = true;
			}

			if (expand)
			{
				GUILayout.BeginHorizontal();
				if (GUILayout.Button("Expand"))
				{
					foreach (SteamVR_Camera target in targets)
					{
						if (AssetDatabase.Contains(target))
							continue;
						if (!target.isExpanded)
						{
							target.Expand();
							EditorUtility.SetDirty(target);
						}
					}
				}
				GUILayout.Space(18);
				GUILayout.EndHorizontal();
			}

			if (collapse)
			{
				GUILayout.BeginHorizontal();
				if (GUILayout.Button("Collapse"))
				{
					foreach (SteamVR_Camera target in targets)
					{
						if (AssetDatabase.Contains(target))
							continue;
						if (target.isExpanded)
						{
							target.Collapse();
							EditorUtility.SetDirty(target);
						}
					}
				}
				GUILayout.Space(18);
				GUILayout.EndHorizontal();
			}
		}

		EditorGUILayout.PropertyField(script);
		EditorGUILayout.PropertyField(wireframe);

		serializedObject.ApplyModifiedProperties();
	}

	public static void ExportPackage()
	{
		AssetDatabase.ExportPackage(new string[] {
			"Assets/SteamVR",
			"Assets/Plugins/openvr_api.cs",
			"Assets/Plugins/openvr_api.bundle",
			"Assets/Plugins/x86/openvr_api.dll",
			"Assets/Plugins/x86/steam_api.dll",
			"Assets/Plugins/x86/libsteam_api.so",
			"Assets/Plugins/x86_64/openvr_api.dll",
			"Assets/Plugins/x86_64/steam_api.dll",
			"Assets/Plugins/x86_64/libsteam_api.so",
			"Assets/Plugins/x86_64/libopenvr_api.so",
		}, "steamvr.unitypackage", ExportPackageOptions.Recurse);
		EditorApplication.Exit(0);
	}
}


text:
var digger = require('../src');
var async = require('async');
var Bridge = require('digger-bridge');

describe('supplychain.supplier', function(){

  it('should allow several existing contracts to be combined as merge', function(){

    var supplier = digger.supplier({
      url:'/api'
    })

    var supplychain = Bridge(supplier);

    var db1 = supplychain.connect('/json/apples');
    var db2 = supplychain.connect('/json/oranges');

    var append = supplychain.merge([
      db1.append(Bridge.container('fruit').addClass('apple')),
      db2.append(Bridge.container('fruit').addClass('orange'))
    ])

    append.body.length.should.equal(2);
    append.body[0].headers['x-contract-type'].should.equal('merge');
    append.body[0].body.length.should.equal(1);
    append.body[0].body[0].url.should.equal('/json/apples');

  })

})

redpajama_set_name: RedPajamaGithub


text:
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_

#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH

#ifdef CONFIG_ARM64
#define CONFIG_PHYS_64BIT
#define CONFIG_STATIC_RELA
#endif

#if defined(CONFIG_LS102XA) || \
	defined(CONFIG_CPU_PXA27X) || \
	defined(CONFIG_CPU_MONAHANS) || \
	defined(CONFIG_CPU_PXA25X) || \
	defined(CONFIG_FSL_LAYERSCAPE)
#include <asm/arch/config.h>
#endif

#endif


text:
package org.guice.usage.service.internal;

import com.google.inject.Provider;
import org.guice.usage.service.IPostService;

/**
 * <p/>
 * User : krisibm@163.com
 * Date: 2015/4/16
 * Time: 12:38
 */
public class PostServiceProvider implements Provider<IPostService> {

    public IPostService get() {
        return new IPostService() {

            public void post() {
                System.out.println("post service provider............success");
            }
        };
    }
}


text:
"""
Dataplane bot (VNC RFB)

Maintainer: DataPlane <info [ at ] dataplane [ dot ] org>
"""

from . import DataplaneBot

class DataplaneVncrfbBot(DataplaneBot):
    url = "https://dataplane.org/vncrfb.txt"

if __name__ == "__main__":
    DataplaneVncrfbBot.from_command_line().execute()


text:
using System;
using Umbraco.Core.Persistence.Dtos;

namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
    public class AddVariationTables1A : MigrationBase
    {
        public AddVariationTables1A(IMigrationContext context)
            : base(context)
        { }

        // note - original AddVariationTables1 just did
        // Create.Table<ContentVersionCultureVariationDto>().Do();
        //
        // this is taking care of ppl left in this state

        public override void Migrate()
        {
            // note - original AddVariationTables1 just did
            // Create.Table<ContentVersionCultureVariationDto>().Do();
            //
            // it's been deprecated, not part of the main upgrade path,
            // but we need to take care of ppl caught into the state

            // was not used
            Delete.Column("available").FromTable(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation).Do();

            // was not used
            Delete.Column("availableDate").FromTable(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation).Do();

            //special trick to add the column without constraints and return the sql to add them later
            AddColumn<ContentVersionCultureVariationDto>("date", out var sqls);
            //now we need to update the new column with some values because this column doesn't allow NULL values
            Update.Table(ContentVersionCultureVariationDto.TableName).Set(new {date = DateTime.Now}).AllRows().Do();
            //now apply constraints (NOT NULL) to new table
            foreach (var sql in sqls) Execute.Sql(sql).Do();

            // name, languageId are now non-nullable
            AlterColumn<ContentVersionCultureVariationDto>(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "name");
            AlterColumn<ContentVersionCultureVariationDto>(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "languageId");

            Create.Table<DocumentCultureVariationDto>().Do();
        }
    }
}


text:
#ifndef SMT_PARSER_H_
#define SMT_PARSER_H_

#include<iostream>
#include"ast.h"
#include"vector.h"
#include"smtlib.h"

namespace smtlib {
    class parser {
    public:
        static parser * create(ast_manager & ast_manager, bool ignore_user_patterns = false);

        virtual ~parser() {}

        virtual void add_builtin_op(char const *, family_id fid, decl_kind kind) = 0;
        virtual void add_builtin_type(char const *, family_id fid, decl_kind kind) = 0;

        virtual void initialize_smtlib() = 0;

        virtual void set_error_stream(std::ostream& strm) = 0;

        virtual bool parse_file(char const * path) = 0;
        virtual bool parse_string(char const * string) = 0;

        virtual benchmark * get_benchmark() = 0;
    };
};

#endif


text:
import six
from django import template
from djangoseo.seo import get_metadata, get_linked_metadata
from django.template import VariableDoesNotExist

register = template.Library()

class MetadataNode(template.Node):
    def __init__(self, metadata_name, variable_name, target, site, language, subdomain):
        self.metadata_name = metadata_name
        self.variable_name = variable_name
        self.target = template.Variable(target or 'request.path')
        self.site = site and template.Variable(site) or None
        self.language = language and template.Variable(language) or None
        self.subdomain = template.Variable(subdomain or 'request.subdomain')

    def render(self, context):
        try:
            target = self.target.resolve(context)
        except VariableDoesNotExist:
            msg = ("{% get_metadata %} needs some path information.\n"
                        "Please use RequestContext with the django.core.context_processors.request context processor.\n"
                        "Or provide a path or object explicitly, eg {% get_metadata for path %} or {% get_metadata for object %}")
            raise template.TemplateSyntaxError(msg)
        else:
            if callable(target):
                target = target()
            if isinstance(target, six.string_types):
                path = target
            elif hasattr(target, 'get_absolute_url'):
                path = target.get_absolute_url()
            elif hasattr(target, "__iter__") and 'get_absolute_url' in target:
                path = target['get_absolute_url']()
            else:
                path = None

        kwargs = {}

        # If a site is given, pass that on
        if self.site:
            kwargs['site'] = self.site.resolve(context)

        # If a language is given, pass that on
        if self.language:
            kwargs['language'] = self.language.resolve(context)

        # If a subdomain is given, pass that on
        if self.subdomain:
            try:
                kwargs['subdomain'] = self.subdomain.resolve(context)
            except VariableDoesNotExist:
                pass

        metadata = None
        # If the target is a django model object
        if hasattr(target, 'pk'):
            metadata = get_linked_metadata(target, self.metadata_name, context, **kwargs)
        if not isinstance(path, six.string_types):
            path = None
        if not metadata:
            # Fetch the metadata
            try:
                metadata = get_metadata(path, self.metadata_name, context, **kwargs)
            except Exception as e:
                raise template.TemplateSyntaxError(e)

        # If a variable name is given, store the result there
        if self.variable_name is not None:
            context.dicts[0][self.variable_name] = metadata
            return ""
        else:
            return six.text_type(metadata)

def do_get_metadata(parser, token):
    """
    Retrieve an object which can produce (and format) metadata.

        {% get_metadata [for my_path] [in my_language] [on my_site] [as my_variable] %}

        or if you have multiple metadata classes:

        {% get_metadata MyClass [for my_path] [in my_language] [on my_site] [as my_variable] %}

    """
    bits = list(token.split_contents())
    tag_name = bits[0]
    bits = bits[1:]
    metadata_name = None
    args = {'as': None, 'for': None, 'in': None, 'on': None, 'under': None}

    # If there are an even number of bits,
    # a metadata name has been provided.
    if len(bits) % 2:
        metadata_name = bits[0]
        bits = bits[1:]

    # Each bits are in the form "key value key value ..."
    # Valid keys are given in the 'args' dict above.
    while len(bits):
        if len(bits) < 2 or bits[0] not in args:
            raise template.TemplateSyntaxError("expected format is '%r [as <variable_name>]'" % tag_name)
        key, value, bits = bits[0], bits[1], bits[2:]
        args[key] = value

    return MetadataNode(
        metadata_name,
        variable_name=args['as'],
        target=args['for'],
        site=args['on'],
        language=args['in'],
        subdomain=args['under']
    )

register.tag('get_metadata', do_get_metadata)


text:
package otgen

import (
	"bytes"
	"io/ioutil"
	"net/http"
	"os"
	"strings"
	"text/template"
)

func Generate(opts Options) error {
	opts = opts.filled()
	fs, err := multiload(opts, tmpls, map[string][]string{
		opts.BaseName + ".go":      {"ot.go.tmpl"},
		opts.BaseName + "_test.go": {"ot_test.go.tmpl"},
	})
	if err != nil {
		return err
	}
	for _, f := range fs {
		if err := f.execute(); err != nil {
			return err
		}
	}
	for _, f := range fs {
		if err := f.save(); err != nil {
			return err
		}
	}
	return nil
}

type Options struct {
	PackageName string

	// ElementType names a type that is defined outside of the generated code.
	// The default is "rune".
	ElementType string

	// ElementName is a more readable representation of type. The default is
	// ElementType with an upper-case first letter.
	ElementName string

	BaseName string

	// SliceType names a type that is equivalent to []ElementType and is
	// defined otuside of the generated code.
	SliceType string

	// OpType names a type that will be defined in the generated code.
	OpType string

	// OpStringer may be true to indicate OpType should implement Stringer.
	//
	// Requires that SliceType also implement Stringer.
	OpStringer bool

	// DeltaType names a type that will be defined in the generated code.
	DeltaType string

	GeneratedCodeWarning string
}

func (o Options) filled() Options {
	if o.PackageName == "" {
		o.PackageName = "main"
	}
	if o.ElementType == "" {
		o.ElementType = "rune"
	}
	if o.ElementName == "" {
		o.ElementName = strings.ToTitle(o.ElementType[:1]) + o.ElementType[1:]
	}
	if o.BaseName == "" {
		o.BaseName = "generated_" + strings.ToLower(o.ElementType) + "_ot"
	}
	if o.SliceType == "" {
		o.SliceType = "[]" + o.ElementType
	}
	sliceName := o.SliceType
	if sliceName[:2] == "[]" {
		sliceName = sliceName[2:]
	}
	sliceName = strings.ToTitle(sliceName[:1]) + sliceName[1:]
	if o.OpType == "" {
		o.OpType = sliceName + "Op"
	}
	if o.DeltaType == "" {
		o.DeltaType = sliceName + "Delta"
	}
	if o.GeneratedCodeWarning == "" {
		o.GeneratedCodeWarning = "Do not modify this file: it is automatically generated"
	}
	return o
}

type file struct {
	opts Options
	t    *template.Template
	n    string
	code string
}

func load(opts Options, src http.FileSystem, name string, paths ...string) (*file, error) {
	t := template.New(name)
	for _, path := range paths {
		r, err := src.Open(path)
		if err != nil {
			return nil, err
		}
		bs, err := ioutil.ReadAll(r)
		if err != nil {
			return nil, err
		}
		if _, err = t.Parse(string(bs)); err != nil {
			return nil, err
		}
	}
	return &file{opts: opts, t: t, n: name}, nil
}
func multiload(opts Options, src http.FileSystem, nps map[string][]string) ([]*file, error) {
	fs := make([]*file, 0, len(nps))
	for n, ps := range nps {
		f, err := load(opts, src, n, ps...)
		if err != nil {
			return nil, err
		}
		fs = append(fs, f)
	}
	return fs, nil
}
func (f *file) execute() error {
	buf := bytes.NewBuffer(nil)
	if err := f.t.Execute(buf, f.opts); err != nil {
		return err
	}
	f.code = buf.String()
	return nil
}
func (f *file) save() error {
	w, err := os.Create(f.n)
	defer w.Close()
	if err != nil {
		return err
	}
	_, err = w.WriteString(f.code)
	return err
}


text:
"use strict";

module.exports = SortedArraySet;

var Shim = require("./shim");
var SortedArray = require("./sorted-array");
var GenericSet = require("./generic-set");
var PropertyChanges = require("./listen/property-changes");

function SortedArraySet(values, equals, compare, getDefault) {
    if (!(this instanceof SortedArraySet)) {
        return new SortedArraySet(values, equals, compare, getDefault);
    }
    SortedArray.call(this, values, equals, compare, getDefault);
}

// hack so require("sorted-array-set".SortedArraySet works in MontageJS
SortedArraySet.SortedArraySet = SortedArraySet;

SortedArraySet.prototype = Object.create(SortedArray.prototype);

SortedArraySet.prototype.constructor = SortedArraySet;

Object.addEach(SortedArraySet.prototype, GenericSet.prototype);
Object.addEach(SortedArraySet.prototype, PropertyChanges.prototype);

SortedArraySet.from = SortedArray.from;

SortedArraySet.prototype.isSorted = true;

SortedArraySet.prototype.add = function (value) {
    if (!this.has(value)) {
        SortedArray.prototype.add.call(this, value);
        return true;
    } else {
        return false;
    }
};

SortedArraySet.prototype.reduce = function (callback, basis /*, thisp*/) {
    var self = this;
    var thisp = arguments[2];
    return this.array.reduce(function (basis, value, index) {
        return callback.call(thisp, basis, value, index, self);
    }, basis);
};

SortedArraySet.prototype.reduceRight = function (callback, basis /*, thisp*/) {
    var self = this;
    var thisp = arguments[2];
    return this.array.reduceRight(function (basis, value, index) {
        return callback.call(thisp, basis, value, index, self);
    }, basis);
};


text:
Clustering
========================================================
author: Daniel Frederico Lins Leite
date: 2017-04-22
autosize: true

Simulation
========================================================

In this presentation we will generate 2000 2D points using two Multivariate Gaussians. Then we will use three different clustering algorithms to try to recognize the original distributions. We will try to find 2, 4 and 6 clusters for each algorithms.

```r
library(plotly)
library('MASS')
simulation.g1 <- mvrnorm(n = 1000, c(0,0), diag(2))
simulation.g2 <- mvrnorm(n = 1000, c(-3,-3), diag(c(0.3,10)))
simulation <- rbind(simulation.g1, simulation.g2)
simulation <- data.frame(x = simulation[,1], y = simulation[,2])
```

k Means Clustering
========================================================

![plot of chunk unnamed-chunk-2](pitch.rmd-figure/unnamed-chunk-2-1.png)

Ward Hierarchical Clustering (using Euclidean distance)
===============

![plot of chunk unnamed-chunk-3](pitch.rmd-figure/unnamed-chunk-3-1.png)

Gaussian Mixture Model (using BIC)
===============

![plot of chunk unnamed-chunk-4](pitch.rmd-figure/unnamed-chunk-4-1.png)


text:
package cloudscheduler

import (
	"context"
	"fmt"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
	dclService "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudscheduler/beta"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/unstructured"
)

type Job struct{}

func JobToUnstructured(r *dclService.Job) *unstructured.Resource {
	u := &unstructured.Resource{
		STV: unstructured.ServiceTypeVersion{
			Service: "cloudscheduler",
			Version: "beta",
			Type:    "Job",
		},
		Object: make(map[string]interface{}),
	}
	if r.AppEngineHttpTarget != nil && r.AppEngineHttpTarget != dclService.EmptyJobAppEngineHttpTarget {
		rAppEngineHttpTarget := make(map[string]interface{})
		if r.AppEngineHttpTarget.AppEngineRouting != nil && r.AppEngineHttpTarget.AppEngineRouting != dclService.EmptyJobAppEngineHttpTargetAppEngineRouting {
			rAppEngineHttpTargetAppEngineRouting := make(map[string]interface{})
			if r.AppEngineHttpTarget.AppEngineRouting.Host != nil {
				rAppEngineHttpTargetAppEngineRouting["host"] = *r.AppEngineHttpTarget.AppEngineRouting.Host
			}
			if r.AppEngineHttpTarget.AppEngineRouting.Instance != nil {
				rAppEngineHttpTargetAppEngineRouting["instance"] = *r.AppEngineHttpTarget.AppEngineRouting.Instance
			}
			if r.AppEngineHttpTarget.AppEngineRouting.Service != nil {
				rAppEngineHttpTargetAppEngineRouting["service"] = *r.AppEngineHttpTarget.AppEngineRouting.Service
			}
			if r.AppEngineHttpTarget.AppEngineRouting.Version != nil {
				rAppEngineHttpTargetAppEngineRouting["version"] = *r.AppEngineHttpTarget.AppEngineRouting.Version
			}
			rAppEngineHttpTarget["appEngineRouting"] = rAppEngineHttpTargetAppEngineRouting
		}
		if r.AppEngineHttpTarget.Body != nil {
			rAppEngineHttpTarget["body"] = *r.AppEngineHttpTarget.Body
		}
		if r.AppEngineHttpTarget.Headers != nil {
			rAppEngineHttpTargetHeaders := make(map[string]interface{})
			for k, v := range r.AppEngineHttpTarget.Headers {
				rAppEngineHttpTargetHeaders[k] = v
			}
			rAppEngineHttpTarget["headers"] = rAppEngineHttpTargetHeaders
		}
		if r.AppEngineHttpTarget.HttpMethod != nil {
			rAppEngineHttpTarget["httpMethod"] = string(*r.AppEngineHttpTarget.HttpMethod)
		}
		if r.AppEngineHttpTarget.RelativeUri != nil {
			rAppEngineHttpTarget["relativeUri"] = *r.AppEngineHttpTarget.RelativeUri
		}
		u.Object["appEngineHttpTarget"] = rAppEngineHttpTarget
	}
	if r.AttemptDeadline != nil {
		u.Object["attemptDeadline"] = *r.AttemptDeadline
	}
	if r.Description != nil {
		u.Object["description"] = *r.Description
	}
	if r.HttpTarget != nil && r.HttpTarget != dclService.EmptyJobHttpTarget {
		rHttpTarget := make(map[string]interface{})
		if r.HttpTarget.Body != nil {
			rHttpTarget["body"] = *r.HttpTarget.Body
		}
		if r.HttpTarget.Headers != nil {
			rHttpTargetHeaders := make(map[string]interface{})
			for k, v := range r.HttpTarget.Headers {
				rHttpTargetHeaders[k] = v
			}
			rHttpTarget["headers"] = rHttpTargetHeaders
		}
		if r.HttpTarget.HttpMethod != nil {
			rHttpTarget["httpMethod"] = string(*r.HttpTarget.HttpMethod)
		}
		if r.HttpTarget.OAuthToken != nil && r.HttpTarget.OAuthToken != dclService.EmptyJobHttpTargetOAuthToken {
			rHttpTargetOAuthToken := make(map[string]interface{})
			if r.HttpTarget.OAuthToken.Scope != nil {
				rHttpTargetOAuthToken["scope"] = *r.HttpTarget.OAuthToken.Scope
			}
			if r.HttpTarget.OAuthToken.ServiceAccountEmail != nil {
				rHttpTargetOAuthToken["serviceAccountEmail"] = *r.HttpTarget.OAuthToken.ServiceAccountEmail
			}
			rHttpTarget["oauthToken"] = rHttpTargetOAuthToken
		}
		if r.HttpTarget.OidcToken != nil && r.HttpTarget.OidcToken != dclService.EmptyJobHttpTargetOidcToken {
			rHttpTargetOidcToken := make(map[string]interface{})
			if r.HttpTarget.OidcToken.Audience != nil {
				rHttpTargetOidcToken["audience"] = *r.HttpTarget.OidcToken.Audience
			}
			if r.HttpTarget.OidcToken.ServiceAccountEmail != nil {
				rHttpTargetOidcToken["serviceAccountEmail"] = *r.HttpTarget.OidcToken.ServiceAccountEmail
			}
			rHttpTarget["oidcToken"] = rHttpTargetOidcToken
		}
		if r.HttpTarget.Uri != nil {
			rHttpTarget["uri"] = *r.HttpTarget.Uri
		}
		u.Object["httpTarget"] = rHttpTarget
	}
	if r.LastAttemptTime != nil {
		u.Object["lastAttemptTime"] = *r.LastAttemptTime
	}
	if r.Location != nil {
		u.Object["location"] = *r.Location
	}
	if r.Name != nil {
		u.Object["name"] = *r.Name
	}
	if r.Project != nil {
		u.Object["project"] = *r.Project
	}
	if r.PubsubTarget != nil && r.PubsubTarget != dclService.EmptyJobPubsubTarget {
		rPubsubTarget := make(map[string]interface{})
		if r.PubsubTarget.Attributes != nil {
			rPubsubTargetAttributes := make(map[string]interface{})
			for k, v := range r.PubsubTarget.Attributes {
				rPubsubTargetAttributes[k] = v
			}
			rPubsubTarget["attributes"] = rPubsubTargetAttributes
		}
		if r.PubsubTarget.Data != nil {
			rPubsubTarget["data"] = *r.PubsubTarget.Data
		}
		if r.PubsubTarget.TopicName != nil {
			rPubsubTarget["topicName"] = *r.PubsubTarget.TopicName
		}
		u.Object["pubsubTarget"] = rPubsubTarget
	}
	if r.RetryConfig != nil && r.RetryConfig != dclService.EmptyJobRetryConfig {
		rRetryConfig := make(map[string]interface{})
		if r.RetryConfig.MaxBackoffDuration != nil {
			rRetryConfig["maxBackoffDuration"] = *r.RetryConfig.MaxBackoffDuration
		}
		if r.RetryConfig.MaxDoublings != nil {
			rRetryConfig["maxDoublings"] = *r.RetryConfig.MaxDoublings
		}
		if r.RetryConfig.MaxRetryDuration != nil {
			rRetryConfig["maxRetryDuration"] = *r.RetryConfig.MaxRetryDuration
		}
		if r.RetryConfig.MinBackoffDuration != nil {
			rRetryConfig["minBackoffDuration"] = *r.RetryConfig.MinBackoffDuration
		}
		if r.RetryConfig.RetryCount != nil {
			rRetryConfig["retryCount"] = *r.RetryConfig.RetryCount
		}
		u.Object["retryConfig"] = rRetryConfig
	}
	if r.Schedule != nil {
		u.Object["schedule"] = *r.Schedule
	}
	if r.ScheduleTime != nil {
		u.Object["scheduleTime"] = *r.ScheduleTime
	}
	if r.State != nil {
		u.Object["state"] = string(*r.State)
	}
	if r.Status != nil && r.Status != dclService.EmptyJobStatus {
		rStatus := make(map[string]interface{})
		if r.Status.Code != nil {
			rStatus["code"] = *r.Status.Code
		}
		var rStatusDetails []interface{}
		for _, rStatusDetailsVal := range r.Status.Details {
			rStatusDetailsObject := make(map[string]interface{})
			if rStatusDetailsVal.TypeUrl != nil {
				rStatusDetailsObject["typeUrl"] = *rStatusDetailsVal.TypeUrl
			}
			if rStatusDetailsVal.Value != nil {
				rStatusDetailsObject["value"] = *rStatusDetailsVal.Value
			}
			rStatusDetails = append(rStatusDetails, rStatusDetailsObject)
		}
		rStatus["details"] = rStatusDetails
		if r.Status.Message != nil {
			rStatus["message"] = *r.Status.Message
		}
		u.Object["status"] = rStatus
	}
	if r.TimeZone != nil {
		u.Object["timeZone"] = *r.TimeZone
	}
	if r.UserUpdateTime != nil {
		u.Object["userUpdateTime"] = *r.UserUpdateTime
	}
	return u
}

func UnstructuredToJob(u *unstructured.Resource) (*dclService.Job, error) {
	r := &dclService.Job{}
	if _, ok := u.Object["appEngineHttpTarget"]; ok {
		if rAppEngineHttpTarget, ok := u.Object["appEngineHttpTarget"].(map[string]interface{}); ok {
			r.AppEngineHttpTarget = &dclService.JobAppEngineHttpTarget{}
			if _, ok := rAppEngineHttpTarget["appEngineRouting"]; ok {
				if rAppEngineHttpTargetAppEngineRouting, ok := rAppEngineHttpTarget["appEngineRouting"].(map[string]interface{}); ok {
					r.AppEngineHttpTarget.AppEngineRouting = &dclService.JobAppEngineHttpTargetAppEngineRouting{}
					if _, ok := rAppEngineHttpTargetAppEngineRouting["host"]; ok {
						if s, ok := rAppEngineHttpTargetAppEngineRouting["host"].(string); ok {
							r.AppEngineHttpTarget.AppEngineRouting.Host = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.AppEngineHttpTarget.AppEngineRouting.Host: expected string")
						}
					}
					if _, ok := rAppEngineHttpTargetAppEngineRouting["instance"]; ok {
						if s, ok := rAppEngineHttpTargetAppEngineRouting["instance"].(string); ok {
							r.AppEngineHttpTarget.AppEngineRouting.Instance = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.AppEngineHttpTarget.AppEngineRouting.Instance: expected string")
						}
					}
					if _, ok := rAppEngineHttpTargetAppEngineRouting["service"]; ok {
						if s, ok := rAppEngineHttpTargetAppEngineRouting["service"].(string); ok {
							r.AppEngineHttpTarget.AppEngineRouting.Service = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.AppEngineHttpTarget.AppEngineRouting.Service: expected string")
						}
					}
					if _, ok := rAppEngineHttpTargetAppEngineRouting["version"]; ok {
						if s, ok := rAppEngineHttpTargetAppEngineRouting["version"].(string); ok {
							r.AppEngineHttpTarget.AppEngineRouting.Version = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.AppEngineHttpTarget.AppEngineRouting.Version: expected string")
						}
					}
				} else {
					return nil, fmt.Errorf("r.AppEngineHttpTarget.AppEngineRouting: expected map[string]interface{}")
				}
			}
			if _, ok := rAppEngineHttpTarget["body"]; ok {
				if s, ok := rAppEngineHttpTarget["body"].(string); ok {
					r.AppEngineHttpTarget.Body = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.AppEngineHttpTarget.Body: expected string")
				}
			}
			if _, ok := rAppEngineHttpTarget["headers"]; ok {
				if rAppEngineHttpTargetHeaders, ok := rAppEngineHttpTarget["headers"].(map[string]interface{}); ok {
					m := make(map[string]string)
					for k, v := range rAppEngineHttpTargetHeaders {
						if s, ok := v.(string); ok {
							m[k] = s
						}
					}
					r.AppEngineHttpTarget.Headers = m
				} else {
					return nil, fmt.Errorf("r.AppEngineHttpTarget.Headers: expected map[string]interface{}")
				}
			}
			if _, ok := rAppEngineHttpTarget["httpMethod"]; ok {
				if s, ok := rAppEngineHttpTarget["httpMethod"].(string); ok {
					r.AppEngineHttpTarget.HttpMethod = dclService.JobAppEngineHttpTargetHttpMethodEnumRef(s)
				} else {
					return nil, fmt.Errorf("r.AppEngineHttpTarget.HttpMethod: expected string")
				}
			}
			if _, ok := rAppEngineHttpTarget["relativeUri"]; ok {
				if s, ok := rAppEngineHttpTarget["relativeUri"].(string); ok {
					r.AppEngineHttpTarget.RelativeUri = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.AppEngineHttpTarget.RelativeUri: expected string")
				}
			}
		} else {
			return nil, fmt.Errorf("r.AppEngineHttpTarget: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["attemptDeadline"]; ok {
		if s, ok := u.Object["attemptDeadline"].(string); ok {
			r.AttemptDeadline = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.AttemptDeadline: expected string")
		}
	}
	if _, ok := u.Object["description"]; ok {
		if s, ok := u.Object["description"].(string); ok {
			r.Description = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.Description: expected string")
		}
	}
	if _, ok := u.Object["httpTarget"]; ok {
		if rHttpTarget, ok := u.Object["httpTarget"].(map[string]interface{}); ok {
			r.HttpTarget = &dclService.JobHttpTarget{}
			if _, ok := rHttpTarget["body"]; ok {
				if s, ok := rHttpTarget["body"].(string); ok {
					r.HttpTarget.Body = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.HttpTarget.Body: expected string")
				}
			}
			if _, ok := rHttpTarget["headers"]; ok {
				if rHttpTargetHeaders, ok := rHttpTarget["headers"].(map[string]interface{}); ok {
					m := make(map[string]string)
					for k, v := range rHttpTargetHeaders {
						if s, ok := v.(string); ok {
							m[k] = s
						}
					}
					r.HttpTarget.Headers = m
				} else {
					return nil, fmt.Errorf("r.HttpTarget.Headers: expected map[string]interface{}")
				}
			}
			if _, ok := rHttpTarget["httpMethod"]; ok {
				if s, ok := rHttpTarget["httpMethod"].(string); ok {
					r.HttpTarget.HttpMethod = dclService.JobHttpTargetHttpMethodEnumRef(s)
				} else {
					return nil, fmt.Errorf("r.HttpTarget.HttpMethod: expected string")
				}
			}
			if _, ok := rHttpTarget["oauthToken"]; ok {
				if rHttpTargetOAuthToken, ok := rHttpTarget["oauthToken"].(map[string]interface{}); ok {
					r.HttpTarget.OAuthToken = &dclService.JobHttpTargetOAuthToken{}
					if _, ok := rHttpTargetOAuthToken["scope"]; ok {
						if s, ok := rHttpTargetOAuthToken["scope"].(string); ok {
							r.HttpTarget.OAuthToken.Scope = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.HttpTarget.OAuthToken.Scope: expected string")
						}
					}
					if _, ok := rHttpTargetOAuthToken["serviceAccountEmail"]; ok {
						if s, ok := rHttpTargetOAuthToken["serviceAccountEmail"].(string); ok {
							r.HttpTarget.OAuthToken.ServiceAccountEmail = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.HttpTarget.OAuthToken.ServiceAccountEmail: expected string")
						}
					}
				} else {
					return nil, fmt.Errorf("r.HttpTarget.OAuthToken: expected map[string]interface{}")
				}
			}
			if _, ok := rHttpTarget["oidcToken"]; ok {
				if rHttpTargetOidcToken, ok := rHttpTarget["oidcToken"].(map[string]interface{}); ok {
					r.HttpTarget.OidcToken = &dclService.JobHttpTargetOidcToken{}
					if _, ok := rHttpTargetOidcToken["audience"]; ok {
						if s, ok := rHttpTargetOidcToken["audience"].(string); ok {
							r.HttpTarget.OidcToken.Audience = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.HttpTarget.OidcToken.Audience: expected string")
						}
					}
					if _, ok := rHttpTargetOidcToken["serviceAccountEmail"]; ok {
						if s, ok := rHttpTargetOidcToken["serviceAccountEmail"].(string); ok {
							r.HttpTarget.OidcToken.ServiceAccountEmail = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.HttpTarget.OidcToken.ServiceAccountEmail: expected string")
						}
					}
				} else {
					return nil, fmt.Errorf("r.HttpTarget.OidcToken: expected map[string]interface{}")
				}
			}
			if _, ok := rHttpTarget["uri"]; ok {
				if s, ok := rHttpTarget["uri"].(string); ok {
					r.HttpTarget.Uri = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.HttpTarget.Uri: expected string")
				}
			}
		} else {
			return nil, fmt.Errorf("r.HttpTarget: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["lastAttemptTime"]; ok {
		if s, ok := u.Object["lastAttemptTime"].(string); ok {
			r.LastAttemptTime = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.LastAttemptTime: expected string")
		}
	}
	if _, ok := u.Object["location"]; ok {
		if s, ok := u.Object["location"].(string); ok {
			r.Location = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.Location: expected string")
		}
	}
	if _, ok := u.Object["name"]; ok {
		if s, ok := u.Object["name"].(string); ok {
			r.Name = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.Name: expected string")
		}
	}
	if _, ok := u.Object["project"]; ok {
		if s, ok := u.Object["project"].(string); ok {
			r.Project = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.Project: expected string")
		}
	}
	if _, ok := u.Object["pubsubTarget"]; ok {
		if rPubsubTarget, ok := u.Object["pubsubTarget"].(map[string]interface{}); ok {
			r.PubsubTarget = &dclService.JobPubsubTarget{}
			if _, ok := rPubsubTarget["attributes"]; ok {
				if rPubsubTargetAttributes, ok := rPubsubTarget["attributes"].(map[string]interface{}); ok {
					m := make(map[string]string)
					for k, v := range rPubsubTargetAttributes {
						if s, ok := v.(string); ok {
							m[k] = s
						}
					}
					r.PubsubTarget.Attributes = m
				} else {
					return nil, fmt.Errorf("r.PubsubTarget.Attributes: expected map[string]interface{}")
				}
			}
			if _, ok := rPubsubTarget["data"]; ok {
				if s, ok := rPubsubTarget["data"].(string); ok {
					r.PubsubTarget.Data = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.PubsubTarget.Data: expected string")
				}
			}
			if _, ok := rPubsubTarget["topicName"]; ok {
				if s, ok := rPubsubTarget["topicName"].(string); ok {
					r.PubsubTarget.TopicName = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.PubsubTarget.TopicName: expected string")
				}
			}
		} else {
			return nil, fmt.Errorf("r.PubsubTarget: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["retryConfig"]; ok {
		if rRetryConfig, ok := u.Object["retryConfig"].(map[string]interface{}); ok {
			r.RetryConfig = &dclService.JobRetryConfig{}
			if _, ok := rRetryConfig["maxBackoffDuration"]; ok {
				if s, ok := rRetryConfig["maxBackoffDuration"].(string); ok {
					r.RetryConfig.MaxBackoffDuration = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.RetryConfig.MaxBackoffDuration: expected string")
				}
			}
			if _, ok := rRetryConfig["maxDoublings"]; ok {
				if i, ok := rRetryConfig["maxDoublings"].(int64); ok {
					r.RetryConfig.MaxDoublings = dcl.Int64(i)
				} else {
					return nil, fmt.Errorf("r.RetryConfig.MaxDoublings: expected int64")
				}
			}
			if _, ok := rRetryConfig["maxRetryDuration"]; ok {
				if s, ok := rRetryConfig["maxRetryDuration"].(string); ok {
					r.RetryConfig.MaxRetryDuration = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.RetryConfig.MaxRetryDuration: expected string")
				}
			}
			if _, ok := rRetryConfig["minBackoffDuration"]; ok {
				if s, ok := rRetryConfig["minBackoffDuration"].(string); ok {
					r.RetryConfig.MinBackoffDuration = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.RetryConfig.MinBackoffDuration: expected string")
				}
			}
			if _, ok := rRetryConfig["retryCount"]; ok {
				if i, ok := rRetryConfig["retryCount"].(int64); ok {
					r.RetryConfig.RetryCount = dcl.Int64(i)
				} else {
					return nil, fmt.Errorf("r.RetryConfig.RetryCount: expected int64")
				}
			}
		} else {
			return nil, fmt.Errorf("r.RetryConfig: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["schedule"]; ok {
		if s, ok := u.Object["schedule"].(string); ok {
			r.Schedule = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.Schedule: expected string")
		}
	}
	if _, ok := u.Object["scheduleTime"]; ok {
		if s, ok := u.Object["scheduleTime"].(string); ok {
			r.ScheduleTime = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.ScheduleTime: expected string")
		}
	}
	if _, ok := u.Object["state"]; ok {
		if s, ok := u.Object["state"].(string); ok {
			r.State = dclService.JobStateEnumRef(s)
		} else {
			return nil, fmt.Errorf("r.State: expected string")
		}
	}
	if _, ok := u.Object["status"]; ok {
		if rStatus, ok := u.Object["status"].(map[string]interface{}); ok {
			r.Status = &dclService.JobStatus{}
			if _, ok := rStatus["code"]; ok {
				if i, ok := rStatus["code"].(int64); ok {
					r.Status.Code = dcl.Int64(i)
				} else {
					return nil, fmt.Errorf("r.Status.Code: expected int64")
				}
			}
			if _, ok := rStatus["details"]; ok {
				if s, ok := rStatus["details"].([]interface{}); ok {
					for _, o := range s {
						if objval, ok := o.(map[string]interface{}); ok {
							var rStatusDetails dclService.JobStatusDetails
							if _, ok := objval["typeUrl"]; ok {
								if s, ok := objval["typeUrl"].(string); ok {
									rStatusDetails.TypeUrl = dcl.String(s)
								} else {
									return nil, fmt.Errorf("rStatusDetails.TypeUrl: expected string")
								}
							}
							if _, ok := objval["value"]; ok {
								if s, ok := objval["value"].(string); ok {
									rStatusDetails.Value = dcl.String(s)
								} else {
									return nil, fmt.Errorf("rStatusDetails.Value: expected string")
								}
							}
							r.Status.Details = append(r.Status.Details, rStatusDetails)
						}
					}
				} else {
					return nil, fmt.Errorf("r.Status.Details: expected []interface{}")
				}
			}
			if _, ok := rStatus["message"]; ok {
				if s, ok := rStatus["message"].(string); ok {
					r.Status.Message = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.Status.Message: expected string")
				}
			}
		} else {
			return nil, fmt.Errorf("r.Status: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["timeZone"]; ok {
		if s, ok := u.Object["timeZone"].(string); ok {
			r.TimeZone = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.TimeZone: expected string")
		}
	}
	if _, ok := u.Object["userUpdateTime"]; ok {
		if s, ok := u.Object["userUpdateTime"].(string); ok {
			r.UserUpdateTime = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.UserUpdateTime: expected string")
		}
	}
	return r, nil
}

func GetJob(ctx context.Context, config *dcl.Config, u *unstructured.Resource) (*unstructured.Resource, error) {
	c := dclService.NewClient(config)
	r, err := UnstructuredToJob(u)
	if err != nil {
		return nil, err
	}
	r, err = c.GetJob(ctx, r)
	if err != nil {
		return nil, err
	}
	return JobToUnstructured(r), nil
}

func ListJob(ctx context.Context, config *dcl.Config, project string, location string) ([]*unstructured.Resource, error) {
	c := dclService.NewClient(config)
	l, err := c.ListJob(ctx, project, location)
	if err != nil {
		return nil, err
	}
	var resources []*unstructured.Resource
	for {
		for _, r := range l.Items {
			resources = append(resources, JobToUnstructured(r))
		}
		if !l.HasNext() {
			break
		}
		if err := l.Next(ctx, c); err != nil {
			return nil, err
		}
	}
	return resources, nil
}

func ApplyJob(ctx context.Context, config *dcl.Config, u *unstructured.Resource, opts ...dcl.ApplyOption) (*unstructured.Resource, error) {
	c := dclService.NewClient(config)
	r, err := UnstructuredToJob(u)
	if err != nil {
		return nil, err
	}
	if ush := unstructured.FetchStateHint(opts); ush != nil {
		sh, err := UnstructuredToJob(ush)
		if err != nil {
			return nil, err
		}
		opts = append(opts, dcl.WithStateHint(sh))
	}
	r, err = c.ApplyJob(ctx, r, opts...)
	if err != nil {
		return nil, err
	}
	return JobToUnstructured(r), nil
}

func JobHasDiff(ctx context.Context, config *dcl.Config, u *unstructured.Resource, opts ...dcl.ApplyOption) (bool, error) {
	c := dclService.NewClient(config)
	r, err := UnstructuredToJob(u)
	if err != nil {
		return false, err
	}
	if ush := unstructured.FetchStateHint(opts); ush != nil {
		sh, err := UnstructuredToJob(ush)
		if err != nil {
			return false, err
		}
		opts = append(opts, dcl.WithStateHint(sh))
	}
	opts = append(opts, dcl.WithLifecycleParam(dcl.BlockDestruction), dcl.WithLifecycleParam(dcl.BlockCreation), dcl.WithLifecycleParam(dcl.BlockModification))
	_, err = c.ApplyJob(ctx, r, opts...)
	if err != nil {
		if _, ok := err.(dcl.ApplyInfeasibleError); ok {
			return true, nil
		}
		return false, err
	}
	return false, nil
}

func DeleteJob(ctx context.Context, config *dcl.Config, u *unstructured.Resource) error {
	c := dclService.NewClient(config)
	r, err := UnstructuredToJob(u)
	if err != nil {
		return err
	}
	return c.DeleteJob(ctx, r)
}

func JobID(u *unstructured.Resource) (string, error) {
	r, err := UnstructuredToJob(u)
	if err != nil {
		return "", err
	}
	return r.ID()
}

func (r *Job) STV() unstructured.ServiceTypeVersion {
	return unstructured.ServiceTypeVersion{
		"cloudscheduler",
		"Job",
		"beta",
	}
}

func (r *Job) SetPolicyMember(ctx context.Context, config *dcl.Config, resource *unstructured.Resource, member *unstructured.Resource) (*unstructured.Resource, error) {
	return nil, unstructured.ErrNoSuchMethod
}

func (r *Job) GetPolicyMember(ctx context.Context, config *dcl.Config, resource *unstructured.Resource, role, member string) (*unstructured.Resource, error) {
	return nil, unstructured.ErrNoSuchMethod
}

func (r *Job) DeletePolicyMember(ctx context.Context, config *dcl.Config, resource *unstructured.Resource, member *unstructured.Resource) error {
	return unstructured.ErrNoSuchMethod
}

func (r *Job) SetPolicy(ctx context.Context, config *dcl.Config, resource *unstructured.Resource, policy *unstructured.Resource) (*unstructured.Resource, error) {
	return nil, unstructured.ErrNoSuchMethod
}

func (r *Job) SetPolicyWithEtag(ctx context.Context, config *dcl.Config, resource *unstructured.Resource, policy *unstructured.Resource) (*unstructured.Resource, error) {
	return nil, unstructured.ErrNoSuchMethod
}

func (r *Job) GetPolicy(ctx context.Context, config *dcl.Config, resource *unstructured.Resource) (*unstructured.Resource, error) {
	return nil, unstructured.ErrNoSuchMethod
}

func (r *Job) Get(ctx context.Context, config *dcl.Config, resource *unstructured.Resource) (*unstructured.Resource, error) {
	return GetJob(ctx, config, resource)
}

func (r *Job) Apply(ctx context.Context, config *dcl.Config, resource *unstructured.Resource, opts ...dcl.ApplyOption) (*unstructured.Resource, error) {
	return ApplyJob(ctx, config, resource, opts...)
}

func (r *Job) HasDiff(ctx context.Context, config *dcl.Config, resource *unstructured.Resource, opts ...dcl.ApplyOption) (bool, error) {
	return JobHasDiff(ctx, config, resource, opts...)
}

func (r *Job) Delete(ctx context.Context, config *dcl.Config, resource *unstructured.Resource) error {
	return DeleteJob(ctx, config, resource)
}

func (r *Job) ID(resource *unstructured.Resource) (string, error) {
	return JobID(resource)
}

func init() {
	unstructured.Register(&Job{})
}


text:
<!DOCTYPE html>

	<link href="js/bootstrap.min.css" rel="stylesheet"type="text/css">
	<link href="css/moncss.css" rel="stylesheet"type="text/css">

	<title>List of AMD graphics processing units -  FireStream Series </title>
	<meta charset="utf-8">

List of AMD graphics processing units -  FireStream Series

			<fieldset>

					<form action="" method="post">
						<legend style="color:red;font-weight: bold;font-style:italic;text-align: center;" >Formulaire</legend>

								Model :
 <input id="0" type="text" name="Feature">

								Fab (nm) :
 <input style="display:block;" id="id1Fab (nm)" type="number" name="Feature">
												<input style="display:none;" id="id2Fab (nm)" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1Fab (nm)','id2Fab (nm)');">Changer type</button>

								Stream processors :
 <input style="display:block;" id="id1Stream processors" type="number" name="Feature">
												<input style="display:none;" id="id2Stream processors" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1Stream processors','id2Stream processors');">Changer type</button>

								Notes :
 <input id="1" type="text" name="Feature">

								RAM (MB) :
 <input style="display:block;" id="id1RAM (MB)" type="number" name="Feature">
												<input style="display:none;" id="id2RAM (MB)" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1RAM (MB)','id2RAM (MB)');">Changer type</button>

								Bus interface :
 <input id="2" type="text" name="Feature">

								RAM - Bus width (bit) :
 <input style="display:block;" id="id1RAM - Bus width (bit)" type="number" name="Feature">
												<input style="display:none;" id="id2RAM - Bus width (bit)" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1RAM - Bus width (bit)','id2RAM - Bus width (bit)');">Changer type</button>

								RAM - Bandwidth (GB/s) :
 <input style="display:block;" id="id1RAM - Bandwidth (GB/s)" type="number" name="Feature">
												<input style="display:none;" id="id2RAM - Bandwidth (GB/s)" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1RAM - Bandwidth (GB/s)','id2RAM - Bandwidth (GB/s)');">Changer type</button>

								RAM - Type :
 <input id="3" type="text" name="Feature">

								TDP Watt :
 <input style="display:block;" id="id1TDP Watt" type="number" name="Feature">
												<input style="display:none;" id="id2TDP Watt" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1TDP Watt','id2TDP Watt');">Changer type</button>

								Launch :

											<input type="checkbox" name="Feature" >November 8

											<input type="checkbox" name="Feature" >2007

											<input type="checkbox" name="Feature" >June 23

											<input type="checkbox" name="Feature" >2010

											<input type="checkbox" name="Feature" >June 16

											<input type="checkbox" name="Feature" >2008

											<input type="checkbox" name="Feature" >November 13

										<input type='checkbox'>autre:
<input type="text"/>

								Peak GFLOPS - FP64 :
 <input style="display:block;" id="id1Peak GFLOPS - FP64" type="number" name="Feature">
												<input style="display:none;" id="id2Peak GFLOPS - FP64" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1Peak GFLOPS - FP64','id2Peak GFLOPS - FP64');">Changer type</button>

								Peak GFLOPS - FP32 :
 <input style="display:block;" id="id1Peak GFLOPS - FP32" type="number" name="Feature">
												<input style="display:none;" id="id2Peak GFLOPS - FP32" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1Peak GFLOPS - FP32','id2Peak GFLOPS - FP32');">Changer type</button>

								Clock rate - RAM (MHz) :
 <input style="display:block;" id="id1Clock rate - RAM (MHz)" type="number" name="Feature">
												<input style="display:none;" id="id2Clock rate - RAM (MHz)" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1Clock rate - RAM (MHz)','id2Clock rate - RAM (MHz)');">Changer type</button>

								Clock rate - GPGPU (MHz) :
 <input style="display:block;" id="id1Clock rate - GPGPU (MHz)" type="number" name="Feature">
												<input style="display:none;" id="id2Clock rate - GPGPU (MHz)" type="text"/>
												<button class="btn btn-primary btn-xs" type="button" onClick="switchFunction('id1Clock rate - GPGPU (MHz)','id2Clock rate - GPGPU (MHz)');">Changer type</button>

								Code name :
 <input id="4" type="text" name="Feature">

<input type="submit" class="btn btn-info" value="Ajouter un produit" />
					</form>

			</fieldset>


text:
@implementation CALayer (SDSLayerByName)

+ (void)swizzleMethod:(SEL)originalSel andMethod:(SEL)swizzledSel {

    Method original = class_getInstanceMethod(self, originalSel);
    Method swizzled = class_getInstanceMethod(self, swizzledSel);
    if (original && swizzled)
        method_exchangeImplementations(original, swizzled);
    else
        NSLog(@"CALayer+SDSLayerByName Swizzling Fault: methods not found.");

}

////////////////////////////////////////////////////////////////////////
+ (void)load {
    [self swizzleMethod:@selector(addSublayer:) andMethod:@selector(addSublayerSwizzled:)];
    [self swizzleMethod:@selector(insertSublayer:atIndex:) andMethod:@selector(insertSublayerSwizzled:atIndex:)];
    [self swizzleMethod:@selector(setName:) andMethod:@selector(setNameSwizzled:)];
}

////////////////////////////////////////////////////////////////////////
- (void)removeFromSuperlayerSwizzled {
    if (self.superlayer && self.name)
        [self.superlayer setValue:[NSNull null] forKey:self.name];
}

////////////////////////////////////////////////////////////////////////
- (void)addSublayerSwizzled:(CALayer*)layer {
    [self addSublayerSwizzled:layer];
    if (layer.name)
        [self setValue:layer forKey:layer.name];
}

////////////////////////////////////////////////////////////////////////
- (void)insertSublayerSwizzled:(CALayer*)layer atIndex:(unsigned)index {
    [self insertSublayerSwizzled:layer atIndex:index];
    if (layer.name)
        [self setValue:layer forKey:layer.name];
}

////////////////////////////////////////////////////////////////////////
- (void)setNameSwizzled:(NSString*)name {
    [self setNameSwizzled:name];
    if (self.superlayer) {
        [self.superlayer setValue:self forKey:name];
    }
}

////////////////////////////////////////////////////////////////////////
- (CALayer*)layerByName:(NSString*)name {
    id result = [self valueForKey:name];
    if (result == [NSNull null])
        return nil;
    return result;
}

@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Threading;
using DirectShowLib;

namespace PTZ
{
    public enum PTZType
    {
        Relative,
        Absolute
    }

    public class PTZDevice
    {
        private readonly Guid PROPSETID_VIDCAP_CAMERACONTROL = new Guid(0xc6e13370, 0x30ac, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56);

        private DsDevice _device;
        private IAMCameraControl _camControl;
        private IKsPropertySet _ksPropertySet;
        private PTZType _type = PTZType.Relative;

        public int ZoomMin { get; set; }
        public int ZoomMax { get; set; }
        public int ZoomStep { get; set; }
        public int ZoomDefault { get; set; }

        private PTZDevice(string name, PTZType type)
        {
            var devices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
            var device = devices.Where(d => d.Name == name).FirstOrDefault();

            _device = device;
            _type = type;

            if (_device == null) throw new ApplicationException(String.Format("Couldn't find device named {0}!", name));

            IFilterGraph2 graphBuilder = new FilterGraph() as IFilterGraph2;
            IBaseFilter filter = null;
            IMoniker i = _device.Mon as IMoniker;

            graphBuilder.AddSourceFilterForMoniker(i, null, _device.Name, out filter);
            _camControl = filter as IAMCameraControl;
            _ksPropertySet = filter as IKsPropertySet;

            if (_camControl == null) throw new ApplicationException("Couldn't get ICamControl!");
            if (_ksPropertySet == null) throw new ApplicationException("Couldn't get IKsPropertySet!");

            //TODO: Add Absolute
            if (type == PTZType.Relative &&
                !(SupportFor(KSProperties.CameraControlFeature.KSPROPERTY_CAMERACONTROL_PAN_RELATIVE) &&
                SupportFor(KSProperties.CameraControlFeature.KSPROPERTY_CAMERACONTROL_TILT_RELATIVE)))
            {
                throw new NotSupportedException("This camera doesn't appear to support Relative Pan and Tilt");
            }

            //TODO: Do I through NotSupported when methods are called or throw them now?

            //TODO: Do I check for Zoom or ignore if it's not there?
            InitZoomRanges();
        }

        private bool SupportFor(KSProperties.CameraControlFeature feature)
        {
            KSPropertySupport supported = new KSPropertySupport();
            _ksPropertySet.QuerySupported(PROPSETID_VIDCAP_CAMERACONTROL,(int)feature, out supported);

            return (supported.HasFlag(KSPropertySupport.Set) && supported.HasFlag(KSPropertySupport.Get));
        }

        public void Move(int x, int y) //TODO: Is this the best public API? Should work for Relative AND Absolute, right?
        {
            //TODO: Make it work for Absolute also...using the PTZEnum

            //first, tilt
            if (y != 0)
            {
                MoveInternal(KSProperties.CameraControlFeature.KSPROPERTY_CAMERACONTROL_TILT_RELATIVE, y);
            }

            if (x != 0)
            {
                MoveInternal(KSProperties.CameraControlFeature.KSPROPERTY_CAMERACONTROL_PAN_RELATIVE, x);
            }
        }

        private void MoveInternal(KSProperties.CameraControlFeature axis, int value)
        {
            // Create and prepare data structures
            var control = new KSProperties.KSPROPERTY_CAMERACONTROL_S();

            IntPtr controlData = Marshal.AllocCoTaskMem(Marshal.SizeOf(control));
            IntPtr instData = Marshal.AllocCoTaskMem(Marshal.SizeOf(control.Instance));

            control.Instance.Value = value;

            //TODO: Fix for Absolute
            control.Instance.Flags = (int)CameraControlFlags.Relative;

            Marshal.StructureToPtr(control, controlData, true);
            Marshal.StructureToPtr(control.Instance, instData, true);
            var hr2 = _ksPropertySet.Set(PROPSETID_VIDCAP_CAMERACONTROL, (int)axis,
               instData, Marshal.SizeOf(control.Instance), controlData, Marshal.SizeOf(control));

            //TODO: It's a DC motor, no better way?
            Thread.Sleep(20);

            control.Instance.Value = 0; //STOP!
            control.Instance.Flags = (int)CameraControlFlags.Relative;

            Marshal.StructureToPtr(control, controlData, true);
            Marshal.StructureToPtr(control.Instance, instData, true);
            var hr3 = _ksPropertySet.Set(PROPSETID_VIDCAP_CAMERACONTROL, (int)axis,
               instData, Marshal.SizeOf(control.Instance), controlData, Marshal.SizeOf(control));

            if (controlData != IntPtr.Zero) { Marshal.FreeCoTaskMem(controlData); }
            if (instData != IntPtr.Zero) { Marshal.FreeCoTaskMem(instData); }
        }

        private int GetCurrentZoom()
        {
            int oldZoom = 0;
            CameraControlFlags oldFlags = CameraControlFlags.Manual;
            var e = _camControl.Get(CameraControlProperty.Zoom, out oldZoom, out oldFlags);
            return oldZoom;
        }

        private void InitZoomRanges()
        {
            int iMin, iMax, iStep, iDefault;
            CameraControlFlags flag;
            _camControl.GetRange(CameraControlProperty.Zoom, out iMin, out iMax, out iStep, out iDefault, out flag);

            //Can't pass properties by refer, so some duplication...
            ZoomMin = iMin;
            ZoomMax = iMax;
            ZoomDefault = iDefault;
            ZoomStep = iStep;
        }

        public int Zoom(int direction)
        {
            int oldZoom = GetCurrentZoom();
            int newZoom = ZoomDefault;
            if (direction > 0)
                newZoom = oldZoom + 10; //10 is magic...could be anything?
            else if (direction < 0)
                newZoom = oldZoom - 10;

            newZoom = Math.Max(ZoomMin, newZoom);
            newZoom = Math.Min(ZoomMax, newZoom);
            _camControl.Set(CameraControlProperty.Zoom, newZoom, CameraControlFlags.Manual);
            return newZoom;
        }

        public static PTZDevice GetDevice(string name, PTZType type)
        {
            return new PTZDevice(name, type);
        }
    }

    class KSProperties
    {
        public enum CameraControlFeature
        {
            KSPROPERTY_CAMERACONTROL_PAN,
            KSPROPERTY_CAMERACONTROL_TILT,
            KSPROPERTY_CAMERACONTROL_ROLL,
            KSPROPERTY_CAMERACONTROL_ZOOM,
            KSPROPERTY_CAMERACONTROL_EXPOSURE,
            KSPROPERTY_CAMERACONTROL_IRIS,
            KSPROPERTY_CAMERACONTROL_FOCUS,
            KSPROPERTY_CAMERACONTROL_SCANMODE,
            KSPROPERTY_CAMERACONTROL_PRIVACY,
            KSPROPERTY_CAMERACONTROL_PANTILT,
            KSPROPERTY_CAMERACONTROL_PAN_RELATIVE,
            KSPROPERTY_CAMERACONTROL_TILT_RELATIVE,
            KSPROPERTY_CAMERACONTROL_ROLL_RELATIVE,
            KSPROPERTY_CAMERACONTROL_ZOOM_RELATIVE,
            KSPROPERTY_CAMERACONTROL_EXPOSURE_RELATIVE,
            KSPROPERTY_CAMERACONTROL_IRIS_RELATIVE,
            KSPROPERTY_CAMERACONTROL_FOCUS_RELATIVE,
            KSPROPERTY_CAMERACONTROL_PANTILT_RELATIVE,
            KSPROPERTY_CAMERACONTROL_FOCAL_LENGTH,
            KSPROPERTY_CAMERACONTROL_AUTO_EXPOSURE_PRIORITY
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct KSPROPERTY
        {
            // size Guid is long + 2 short + 8 byte = 4 longs
            Guid Set;
            [MarshalAs(UnmanagedType.U4)]
            int Id;
            [MarshalAs(UnmanagedType.U4)]
            int Flags;
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct KSPROPERTY_CAMERACONTROL_S
        {
            /// <summary> Property Guid </summary>
            public KSPROPERTY Property;
            public KSPROPERTY_CAMERACONTROL Instance;
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct KSPROPERTY_CAMERACONTROL
        {
            [MarshalAs(UnmanagedType.I4)]
            public int Value;

            [MarshalAs(UnmanagedType.U4)]
            public int Flags;

            [MarshalAs(UnmanagedType.U4)]
            public int Capabilities;

            [MarshalAs(UnmanagedType.U4)]
            public int Dummy;
            // Dummy added to get a succesful return of the Get, Set function
        }
    }
}


text:
import { Injectable } from '@angular/core';
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';

import { Observable, of, throwError } from 'rxjs';
import { catchError, tap, map } from 'rxjs/operators';

import { Product } from './product';

@Injectable({
  providedIn: 'root'
})
export class ProductService {
  private productsUrl = 'api/products';

  constructor(private http: HttpClient) { }

  getProducts(): Observable<Product[]> {
    return this.http.get<Product[]>(this.productsUrl)
      .pipe(
        tap(data => console.log(JSON.stringify(data))),
        catchError(this.handleError)
      );
  }

  getProduct(id: number): Observable<Product> {
    if (id === 0) {
      return of(this.initializeProduct());
    }
    const url = `${this.productsUrl}/${id}`;
    return this.http.get<Product>(url)
      .pipe(
        tap(data => console.log('getProduct: ' + JSON.stringify(data))),
        catchError(this.handleError)
      );
  }

  createProduct(product: Product): Observable<Product> {
    const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
    // Required for the in memory web API to assign a unique id
    product.id = null;
    return this.http.post<Product>(this.productsUrl, product, { headers })
      .pipe(
        tap(data => console.log('createProduct: ' + JSON.stringify(data))),
        catchError(this.handleError)
      );
  }

  deleteProduct(id: number): Observable<{}> {
    const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
    const url = `${this.productsUrl}/${id}`;
    return this.http.delete<Product>(url, { headers })
      .pipe(
        tap(data => console.log('deleteProduct: ' + id)),
        catchError(this.handleError)
      );
  }

  updateProduct(product: Product): Observable<Product> {
    const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
    const url = `${this.productsUrl}/${product.id}`;
    return this.http.put<Product>(url, product, { headers })
      .pipe(
        tap(() => console.log('updateProduct: ' + product.id)),
        // Return the product on an update
        map(() => product),
        catchError(this.handleError)
      );
  }

  private handleError(err: HttpErrorResponse): Observable<never> {
    // in a real world app, we may send the server to some remote logging infrastructure
    // instead of just logging it to the console
    let errorMessage: string;
    if (err.error instanceof ErrorEvent) {
      // A client-side or network error occurred. Handle it accordingly.
      errorMessage = `An error occurred: ${err.error.message}`;
    } else {
      // The backend returned an unsuccessful response code.
      // The response body may contain clues as to what went wrong,
      errorMessage = `Backend returned code ${err.status}: ${err.message}`;
    }
    console.error(err);
    return throwError(() => errorMessage);
  }

  private initializeProduct(): Product {
    // Return an initialized object
    return {
      id: 0,
      productName: '',
      productCode: '',
      category: '',
      tags: [],
      releaseDate: '',
      price: 0,
      description: '',
      starRating: 0,
      imageUrl: ''
    };
  }
}


text:
if (!window.InspectorFrontendHost) {

WebInspector.InspectorFrontendHostStub = function()
{
    this._attachedWindowHeight = 0;
}

WebInspector._platformFlavor = WebInspector.PlatformFlavor.MacLeopard;

WebInspector.InspectorFrontendHostStub.prototype = {
    platform: function()
    {
        return "mac";
    },

    port: function()
    {
        return "unknown";
    },

    bringToFront: function()
    {
        this._windowVisible = true;
    },

    closeWindow: function()
    {
        this._windowVisible = false;
    },

    attach: function()
    {
    },

    detach: function()
    {
    },

    search: function(sourceRow, query)
    {
    },

    setAttachedWindowHeight: function(height)
    {
    },

    moveWindowBy: function(x, y)
    {
    },

    loaded: function()
    {
    },

    localizedStringsURL: function()
    {
        return undefined;
    },

    hiddenPanels: function()
    {
        return "";
    },

    inspectedURLChanged: function(url)
    {
    },

    copyText: function()
    {
    },

    canAttachWindow: function()
    {
        return false;
    }
}

InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub();

}


text:
angular.module('myApp')

  .factory('utils', function(){

  /*getNextWeekend() gets the start and end dates for nearest weekend using moment.js
    Returns the weekend dates in ISOString format
    @return {weekendDates}
  */
  var getNextWeekend = function(){

    var weekendDates = {
      start : null,
      end : null
    };

    /*Starting from today, find the closest Friday and set that as start date of weekend
      add two days to it to set end date of weekend
    */
     var days = 1;
     var today = moment().utc();

     while (days <= 7) {
      if (today.format('dddd') === 'Friday') {
          weekendDates.start = today;
          break;
       }
      today.add(1, 'days').format('dddd');
      days++;
     }
     weekendDates.end = weekendDates.start.clone().add(2, 'days');

    /*Slice the strings from moment.js to match eventbrite's datatype format
          Moment.js format :       "2016-01-31T04:47:00.671Z"
      Eventbrite datatype format : "2010-01-31T13:00:00Z" */
     weekendDates.start = weekendDates.start.toISOString().slice(0, 19) + 'Z';
     weekendDates.end = weekendDates.end.toISOString().slice(0, 19) + 'Z';

     return weekendDates;
  };

  //processEventData() receives events data from API, maps it to format we want and returns it
  var processEventData = function(events){
          /* Data we need :
          - Title
          - URL
          - Start Date
          - logo
        */
      //events.categoryid,  events.logo.url,  events.name.text,
      //events.start.local, events.end.local, events.url

      return events.map(function(event) {
        return {
          categoryid: event.category_id,
          logo: event.logo,
          title : event.name.text,
          startDate : moment(event.start.local).format("dddd, MMM Do"),
          endDate : moment(event.end.local).format("dddd, MMM Do"),
          url : event.url
        };
      });
  };

  /*craftRequestParams() takes location, distance and flags as input, constructs appropriate
    request parameters and returns it
  */
  var craftRequestParams = function(location, distance, flags){

    var requestData = {
      token : '3URCTQMSNEBN7MEB3Z33',
      'location.latitude' : location.lat,
      'location.longitude' : location.lon,
      'location.within' : distance,
      'sort_by' :'date'
    };

    if (flags.weekendOnly) {
      var dateRange = getNextWeekend();
      requestData['start_date.range_start'] = dateRange.start;
      requestData['start_date.range_end'] = dateRange.end;
    }

    if (flags.popularOnly) {
      requestData.popular = true;
    }
    return requestData;
  };

  return {
    processEventData: processEventData,
    craftRequestParams: craftRequestParams
    };

  });