text:
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>...über Sprachen</title>
    <meta http-equiv="Content-Type" content="application/xhtml+xml">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../assets/css/prism.css?v=431898fc1f">
    <link rel="stylesheet" type="text/css" href="../assets/css/magnific-popup.css?v=431898fc1f">
    <link rel="stylesheet" type="text/css" href="../assets/css/hamburgers.min.css?v=431898fc1f">
    <link rel="stylesheet" type="text/css" href="../assets/css/style.css?v=431898fc1f">
    <link rel="stylesheet" type="text/css" href="../assets/css/mobile.css?v=431898fc1f">

    <link rel="shortcut icon" href="../favicon.png" type="image/png">
    <link rel="canonical" href="index.html">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <link rel="amphtml" href="amp/index.html">

    <meta property="og:site_name" content="Keith Hamilton">
    <meta property="og:type" content="article">
    <meta property="og:title" content="...über Sprachen">
    <meta property="og:description" content="The appreciation that came for language, however, wasn't just for foreign languages. It was for English.">
    <meta property="og:url" content="http://localhost:2368/uber-sprachen/">
    <meta property="og:image" content="http://localhost:2368/content/images/2018/02/speech_bubble-1-1.jpg">
    <meta property="article:published_time" content="2018-02-12T23:50:00.000Z">
    <meta property="article:modified_time" content="2018-02-13T15:02:38.000Z">
    <meta property="article:tag" content="language">

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="...über Sprachen">
    <meta name="twitter:description" content="The appreciation that came for language, however, wasn't just for foreign languages. It was for English.">
    <meta name="twitter:url" content="http://localhost:2368/uber-sprachen/">
    <meta name="twitter:image" content="http://localhost:2368/content/images/2018/02/speech_bubble-1-1.jpg">
    <meta name="twitter:label1" content="Written by">
    <meta name="twitter:data1" content="Keith Hamilton">
    <meta name="twitter:label2" content="Filed under">
    <meta name="twitter:data2" content="language">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="990">

    <meta name="generator" content="Ghost 1.21">
    <link rel="alternate" type="application/rss+xml" title="Keith Hamilton" href="../rss/index.html">

Keith Hamilton.

      <button class="hamburger hamburger--slider" type="button">

      </button>

Menu

Home

Press

About

...über Sprachen

I fell in love with language when I moved to Switzerland in 1998.

I had diligently studied French the four years prior, in high school, but apart from French, never had the appreciation I would come to learn through learning how to speak German.

In the beginning, I could only speak standard German—try as I did to find resources on Swiss German prior to leaving the US, I could not find anything useful. I can still recall the feeling of isolation as I sat at my first host family's dinner table—them carrying on in their native language, me not understanding a single word. Every few minutes one of them would turn to me and say something (in standard German) I only half understood.

I felt like an appendage. After all, when my host sister asked me "Was für Haustieren hast Du?" I didn't even know what "Haustieren" were. I had to ask.

"Ah, ja. Ich habe ein Hund." I didn't even know what the Akkusativ case was.

I learned a new word that night. And a new grammatical concept.

I remember the sheepishness that fell over me when the few friends I'd made at the lake asked me to say that terrible Swiss word (that no one ever uses), Chochichäschtli. Of course I couldn't, but I resolved to learn. I did.

In the first few months of living in Switzerland, I spent my nights in bed repeating sounds—vowels, consonants, and, of course, the guttural sounds that we don't have in English—they're even worse in Swiss dialect than in German. During the days, I would plead with my host mother to stop speaking English to me unless absolutely necessary. Finally, after repeated requests, she did.

After two months I had my first dream in German. I recall waking up and realizing it. There are few feelings that are as amazing as waking from a dream in another language and knowing you were actually speaking it.

After three months I could speak German. After six I could speak Swiss dialect. Some of my classmates never got that and insisted on speaking standard German to me—others mocked those same students for not realizing my newfound talent. After eight months no one who didn't know me would have guessed I wasn't Swiss. I've even been accused of being from Wallis, to which I've only been once. For two days.

The appreciation that came for language, however, wasn't just for foreign languages. It was for English. Having had a strong base in French—then learning German—it was as if someone had opened a door to show me what English really was—a wonderful bastard, the product of two language families.

The rules of German taught me about the rules of English. Rules I'd never learnt. I began paying attention to how the language was constructed. I began recognizing the difference between Latin-influenced English and Germanic-influenced English. English became beautiful to me. The mess of words and dialects a waiting orchestra, looking for a conductor.

I moved back to the US in 1999, just a year later. I went to university and continued my studies in German and French. It would be cheating to claim that my skill in either tongue hasn't waned a hair since, but they have. It is the nature of the foreign language to fade when the only person with whom you can speak is yourself.

But, as life would have it, my sister moved to the Netherlands in 2014. Recently, she began to try to learn Dutch—it is shockingly easy to live in Amsterdam while speaking English. I've spent time in Amsterdam for business, and always had a fancy for the language, so I told her I'd learn it too, to be a support for her.

Last year I began, and have since been, learning Dutch. It has reawakened my brain to just how common our tongues are—French, German, Dutch, English. This year I plan to switch to Norwegian. Why? My sister went there and said it sounded cool. Good enough for me.

Language is a part of my way of thinking that will never fade. It is why I'm drawn to software development. The effect of language on psychology is why I'm drawn to experience design.

Now, I just need a reason to speak them again. Maybe that's why, every time I talk with my partner about vacation only one continent sounds fun.


text:
package com.cg.jdbc;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.text.StyledEditorKit.BoldAction;

import com.cg.connection.MyConnection;
public class BlobTest {
	private Connection con;
	private PreparedStatement ps;
	private ResultSet rs;
	static int id=101;
	//init block
	{
		con=MyConnection.getConnection();
	}
	public void insertImage(File file){
String sql="insert into Image_Master values(?,?,?)";
FileInputStream fis=null;
		try {//creating FileInputStream
			fis=new FileInputStream(file);
		//obatining ps
			ps= con.prepareStatement(sql);
		//setting the values of ps place holders
			ps.setInt(1,(int) (Math.random()*111.111 +id++));
			ps.setString(2, file.getName());
			//int length=(int) file.length();
		//blob type value(placeHolder,fis,lengthOfFile)
			ps.setBinaryStream(3, (InputStream)fis,fis.available());
		//executing the ps
			int no_of_rec=ps.executeUpdate();
			if(no_of_rec==0)
				System.out.println("Sorry Boss! something went wrong");
			else
				System.out.println("Image inserted into DB");
		} catch (SQLException e) {
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			try {
				if(fis!=null)
					fis.close();
				if(ps!=null)
					ps.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}//end of insertImage() method
	public void getImage(){
		String sql="select * from Image_Master";
		try {
			ps = con.prepareStatement(sql);
			rs=ps.executeQuery();
			if(rs.next())
			{
				int imageid= rs.getInt(1);
				String imagename= rs.getString(2);
				InputStream src = rs.getBinaryStream(3);
				try(BufferedInputStream reader =
						new BufferedInputStream(src))
				{
					try(PrintStream writer= new PrintStream(
							new File("src\\copy"+imagename)))
					{
						byte [] data = new  byte[50];
						while((reader.read(data))>-1)
						{
							writer.write(data);
						}//end of while
					}//end of inner try with resource
				}//end of try with resource
			}//end of if
			System.out.println("\nImage get Store into src\\");
		}//end of outer try
		catch (Exception e) {
			e.printStackTrace();
		}//end of catch
		finally{
			try {
				if(ps!=null)
					ps.close();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}//end of getImage()
	public static void main(String[] args) {
		BlobTest obj1= new BlobTest();
		obj1.insertImage(new File("src//Penguins.png"));
		obj1.getImage();
		try {
			if(obj1.con!=null)
				obj1.con.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
/*create table Image_Master
(imageno number(2) constraint image_pk primary key ,
	imagename varchar2(50) not null,
	image blob);*/

redpajama_set_name: RedPajamaGithub


text:
@class FtadManager;

@interface FtadHtml5BannerView : FtadBannerView {

}

//
//
+ (FtadHtml5BannerView*)newFtadHtml5BannerViewWithPointAndSize:(CGPoint)point size:(CGSize)size adIdentify:(NSString*)adIdentify delegate:(id<FtadStatusDelegate>)adstatus;

-(BOOL)canReceiveAd;
-(void)receiveAd:(id)ad;

@end


text:
package io.druid.client.selector;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.druid.timeline.DataSegment;

import java.util.List;
import java.util.Set;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = RandomServerSelectorStrategy.class)
@JsonSubTypes(value = {
    @JsonSubTypes.Type(name = "random", value = RandomServerSelectorStrategy.class),
    @JsonSubTypes.Type(name = "connectionCount", value = ConnectionCountServerSelectorStrategy.class)
})
public interface ServerSelectorStrategy
{
  QueryableDruidServer pick(Set<QueryableDruidServer> servers, DataSegment segment);

  List<QueryableDruidServer> pick(Set<QueryableDruidServer> servers, DataSegment segment, int numServersToPick);
}


text:
package org.apache.flink.kubernetes.entrypoint;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.entrypoint.ClusterEntrypoint;
import org.apache.flink.runtime.entrypoint.ClusterEntrypointUtils;
import org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory;
import org.apache.flink.runtime.entrypoint.SessionClusterEntrypoint;
import org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory;
import org.apache.flink.runtime.entrypoint.component.DispatcherResourceManagerComponentFactory;
import org.apache.flink.runtime.util.EnvironmentInformation;
import org.apache.flink.runtime.util.JvmShutdownSafeguard;
import org.apache.flink.runtime.util.SignalHandler;

/**
 * Entry point for a Kubernetes session cluster.
 */
public class KubernetesSessionClusterEntrypoint extends SessionClusterEntrypoint {

	public KubernetesSessionClusterEntrypoint(Configuration configuration) {
		super(configuration);
	}

	@Override
	protected DispatcherResourceManagerComponentFactory createDispatcherResourceManagerComponentFactory(Configuration configuration) {
		return DefaultDispatcherResourceManagerComponentFactory.createSessionComponentFactory(
			KubernetesResourceManagerFactory.getInstance());
	}

	public static void main(String[] args) {
		// startup checks and logging
		EnvironmentInformation.logEnvironmentInfo(LOG, KubernetesSessionClusterEntrypoint.class.getSimpleName(), args);
		SignalHandler.register(LOG);
		JvmShutdownSafeguard.installAsShutdownHook(LOG);

		final Configuration dynamicParameters = ClusterEntrypointUtils.parseParametersOrExit(
			args,
			new DynamicParametersConfigurationParserFactory(),
			KubernetesSessionClusterEntrypoint.class);
		final ClusterEntrypoint entrypoint = new KubernetesSessionClusterEntrypoint(
			KubernetesEntrypointUtils.loadConfiguration(dynamicParameters));
		ClusterEntrypoint.runClusterEntrypoint(entrypoint);
	}
}


text:
import os
import sys
import json
import traceback
import argparse
import requests
from requests.exceptions import HTTPError, ConnectionError
from deriva.core import BaseCLI, KeyValuePairArgs, format_credential, format_exception, urlparse
from deriva.transfer import DerivaRestore, DerivaRestoreError, DerivaRestoreConfigurationError, \
    DerivaRestoreAuthenticationError, DerivaRestoreAuthorizationError

class DerivaRestoreCLI(BaseCLI):
    def __init__(self, description, epilog, **kwargs):

        BaseCLI.__init__(self, description, epilog, **kwargs)
        self.parser.add_argument("--catalog", metavar="<1>", help="Catalog number. If a catalog number is not "
                                                                  "specified, a new catalog will be created.")
        self.parser.add_argument("input_path", metavar="<input_path>", help="Path to backup file or directory.")
        mutex_group = self.parser.add_mutually_exclusive_group()
        mutex_group.add_argument("--no-data", action="store_true",
                                 help="Do not restore table data, restore schema only.")
        mutex_group.add_argument("--no-schema", action="store_true",
                                 help="Do not restore schema, restore data only.")
        self.parser.add_argument("--no-assets", action="store_true",
                                 help="Do not restore asset data, if present.")
        self.parser.add_argument("--no-annotations", action="store_true",
                                 help="Do not restore annotations.")
        self.parser.add_argument("--no-policy", action="store_true",
                                 help="Do not restore access policy and ACLs.")
        self.parser.add_argument("--no-bag-materialize", action="store_true",
                                 help="If the input format is a bag, do not materialize prior to restore.")
        self.parser.add_argument("--weak-bag-validation", action="store_true",
                                 help="If the input format is a bag, "
                                      "do not abort the restore if the bag fails validation.")
        self.parser.add_argument("--exclude-object", type=lambda s: [item.strip() for item in s.split(',')],
                                 metavar="<schema>, <schema:table>, ...",
                                 help="List of comma-delimited schema-name and/or schema-name/table-name to "
                                      "exclude from the restore process, in the form <schema> or <schema:table>.")
        self.parser.add_argument("--exclude-data", type=lambda s: [item.strip() for item in s.split(',')],
                                 metavar="<schema>, <schema:table>, ...",
                                 help="List of comma-delimited schema-name and/or schema-name/table-name to "
                                      "exclude from the restore process, in the form <schema> or <schema:table>.")
        self.parser.add_argument("envars", metavar="[key=value key=value ...]",
                                 nargs=argparse.REMAINDER, action=KeyValuePairArgs, default={},
                                 help="Variable length of whitespace-delimited key=value pair arguments used for "
                                      "populating the processing environment with parameters for keyword substitution."
                                      "For example: key1=value1 key2=value2")

    def main(self):
        try:
            args = self.parse_cli()
        except ValueError as e:
            sys.stderr.write(str(e))
            return 2
        if not args.quiet:
            sys.stderr.write("\n")

        try:
            assert args.host, "A hostname is required!"
            server = dict()
            server["catalog_id"] = args.catalog
            if args.host.startswith("http"):
                url = urlparse(args.host)
                server["protocol"] = url.scheme
                server["host"] = url.netloc
            else:
                server["protocol"] = "https"
                server["host"] = args.host

            restorer = DerivaRestore(server, **vars(args), dcctx_cid="cli/" + self.__class__.__name__)
            try:
                restorer.restore()
            except ConnectionError as e:
                raise DerivaRestoreError("Connection error occurred. %s" % format_exception(e))
            except HTTPError as e:
                if e.response.status_code == requests.codes.unauthorized:
                    raise DerivaRestoreAuthenticationError(
                        "The requested service requires authentication and a valid login session could "
                        "not be found for the specified host. Server responded: %s" % e)
                elif e.response.status_code == requests.codes.forbidden:
                    raise DerivaRestoreAuthorizationError(
                        "A requested operation was forbidden. Server responded: %s" % e)
                raise DerivaRestoreError(format_exception(e))
        except (DerivaRestoreError, DerivaRestoreConfigurationError,
                DerivaRestoreAuthenticationError, DerivaRestoreAuthorizationError) as e:
            sys.stderr.write(("\n" if not args.quiet else "") + format_exception(e))
            if args.debug:
                traceback.print_exc()
            return 1
        except:
            sys.stderr.write("An unexpected error occurred.")
            traceback.print_exc()
            return 1
        finally:
            if not args.quiet:
                sys.stderr.write("\n\n")
        return 0


text:
package org.apache.doris.metric;

import org.apache.doris.monitor.jvm.JvmStats;

import com.codahale.metrics.Histogram;

public abstract class MetricVisitor {

    protected String prefix;

    public MetricVisitor(String prefix) {
        this.prefix = prefix;
    }

    public abstract void visitJvm(StringBuilder sb, JvmStats jvmStats);

    public abstract void visit(StringBuilder sb, Metric metric);

    public abstract void visitHistogram(StringBuilder sb, String name, Histogram histogram);

    public abstract void getNodeInfo(StringBuilder sb);
}


text:
package de.thk.ct.admin.tree;

import java.util.ResourceBundle;

import de.thk.ct.admin.icon.IconSize;
import de.thk.ct.admin.model.GuiCoapResource;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TreeCell;
import javafx.scene.image.ImageView;

public abstract class DashboardTreeCell extends TreeCell<GuiCoapResource> {

	private final ContextMenu menu;
	private final ResourceBundle resources;

	public DashboardTreeCell(ResourceBundle resources) {
		this.menu = new ContextMenu();
		this.resources = resources;
		MenuItem showOnPanelA = new MenuItem(this.resources.getString("tree.menu.showOnPanelA"));
		MenuItem showOnPanelB = new MenuItem(this.resources.getString("tree.menu.showOnPanelB"));
		showOnPanelA.setOnAction(event -> onShowOnPanelA(getItem()));
		showOnPanelB.setOnAction(event -> onShowOnPanelB(getItem()));
		this.menu.getItems().add(showOnPanelA);
		this.menu.getItems().add(showOnPanelB);
	}

	protected abstract void onShowOnPanelA(GuiCoapResource guiCoapResource);

	protected abstract void onShowOnPanelB(GuiCoapResource guiCoapResource);

	@Override
	protected void updateItem(GuiCoapResource item, boolean empty) {
		super.updateItem(item, empty);
		if (empty || item == null) {
			setText(null);
			setGraphic(null);
		} else {
			if (item.isEndpoint()) {
				setText(String.format("%s", item.getName()));
				setStyle("-fx-font-weight: bold;");
				setContextMenu(menu);
			} else {
				setText(item.getName());
				setContextMenu(null);
				setStyle(null);
			}
			setGraphic(new ImageView(item.getImage(IconSize.SMALL)));
		}
	}
}


text:
package io.shardingsphere.core.parsing.parser.sql.dml.insert;

import io.shardingsphere.core.parsing.parser.context.condition.Column;
import io.shardingsphere.core.parsing.parser.context.condition.GeneratedKeyCondition;
import io.shardingsphere.core.parsing.parser.context.insertvalue.InsertValues;
import io.shardingsphere.core.parsing.parser.sql.dml.DMLStatement;
import io.shardingsphere.core.parsing.parser.token.ItemsToken;
import io.shardingsphere.core.parsing.parser.token.SQLToken;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

/**
 * Insert statement.
 *
 * @author zhangliang
 * @author maxiaoguang
 */
@Getter
@Setter
@ToString(callSuper = true)
public final class InsertStatement extends DMLStatement {

    private final Collection<Column> columns = new LinkedList<>();

    private List<GeneratedKeyCondition> generatedKeyConditions = new LinkedList<>();

    private final InsertValues insertValues = new InsertValues();

    private int columnsListLastPosition;

    private int generateKeyColumnIndex = -1;

    private int insertValuesListLastPosition;

    /**
     * Get items tokens.
     *
     * @return items token list.
     */
    public List<ItemsToken> getItemsTokens() {
        List<ItemsToken> result = new ArrayList<>();
        for (SQLToken each : getSQLTokens()) {
            if (each instanceof ItemsToken) {
                result.add((ItemsToken) each);
            }
        }
        return result;
    }
}


text:
-   [MarketingProtocol](protocols/MarketingProtocol.md)

## Structs

-   [Display](structs/Display.md)

## Enums

-   [Device](enums/Device.md)
-   [Display.ColorSpace](enums/Display.ColorSpace.md)
-   [Display.Size](enums/Display.Size.md)
-   [Family](enums/Family.md)
-   [Lines](enums/Lines.md)
-   [Lines.iPad](enums/Lines.iPad.md)
-   [Lines.iPhone](enums/Lines.iPhone.md)
-   [ThingyError](enums/ThingyError.md)

## Extensions

-   [Device](extensions/Device.md)
-   [Display.Size](extensions/Display.Size.md)
-   [Family](extensions/Family.md)
-   [RawDevice](extensions/RawDevice.md)

## Typealiases

-   [ProductLine](typealiases/ProductLine.md)

This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2020-07-20 10:59:24 +0000


text:
If it was ten year ago, a frontend engineer might not need to know any of these.
But now, everyone needs to know all of these.

- Understand how computer works
- Algorithm
- Data Structure
- Problem solving skills ( with code )
- Concurrency
- Object Oriented Design
- Design Pattern

# Essential for web frontend development

## Step 1

You will need all of them.

- HTML
- CSS
- JavaScirpt

## Step 1 Extended

Good to know. But you probably will need some of them for Step 2.

- CSS alternatives
    - SASS
    - LESS

- JavaScirpt alternatives
    - ES6
    - TypeScript
    - CoffeeScript

## Step 2

Full MVC framework for frontend

You will need at least one of them

- ReactJS
- AngularJS 2
- EmberJS
- AngularJS

# Essential for web backend development

## Step 1

You will need the theory,

- Understand the request-response pattern.
- Understand the publish-subscribe pattern.
- Understand various network protocols.
- Understand cyber security.
- System Design.
- API Design.

Then you will need the implementation.


text:
<?php

namespace Jazzyweb\AulasMentor\AlimentosBundle\Config;

class Config
{
    static public $mvc_bd_hostname = "localhost";
    static public $mvc_bd_nombre   = "tutosymfony2";
    static public $mvc_bd_usuario  = "root";
    static public $mvc_bd_clave    = "";
    static public $mvc_vis_css     = "estilo.css";
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>vbap4move</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="vbap4.html" title="vbap4" />
    <link rel="next" href="vbap8.html" title="vbap8" />

          vbap4move

          Prev
          Orchestra Opcodes and Operators
           Next

          vbap4move

vbap4move —
      Distributes an audio signal among 4 channels with moving virtual sources.

Description

      Distributes an audio signal among 4 channels with moving virtual sources.

Syntax

ar1, ar2, ar3, ar4 vbap4move asig, idur, ispread, ifldnum, ifld1 \
      [, ifld2] [...]

Initialization

      idur -- the duration over which the
    movement takes place.

      ispread -- spreading of the virtual source
    (range 0 - 100).  If value is zero, conventional amplitude panning
    is used. When ispread is increased, the
    number of loudspeakers used in panning increases. If value is 100,
    the sound is applied to all loudspeakers.

      ifldnum -- number of fields (absolute value must be 2 or larger). If ifldnum is positive, the virtual source movement is a polyline specified by given directions. Each transition is performed in an equal time interval. If ifldnum is negative, specified angular velocities are applied to the virtual source during specified relative time intervals (see below).

      ifld1, ifld2, ... -- azimuth angles or angular velocities, and relative durations of movement phases (see below).

Performance

      asig -- audio signal to be panned

      vbap4move allows the use of moving virtual sources. If ifldnum is positive, the fields represent directions of virtual sources and equal times, iazi1, [iele1,] iazi2, [iele2,], etc.  The position of the virtual source is interpolated between directions starting from the first direction and ending at the last. Each interval is interpolated in time that is fraction total_time / number_of_intervals of the duration of the sound event.

      If ifldnum is negative, the fields represent angular velocities and equal times. The first field is, however, the starting direction, iazi1, [iele1,] iazi_vel1, [iele_vel1,] iazi_vel2, [iele_vel2,] .... Each velocity is applied to the note that is fraction total_time / number_of_velocities of the duration of the sound event.  If the elevation of the virtual source becomes greater than 90 degrees or less than 0 degrees, the polarity of angular velocity is changed. Thus the elevational angular velocity produces a virtual source that moves up and down between 0 and 90 degrees.

              Warning

Please note that all vbap panning opcodes require the vbap system to be initialized using vbaplsinit.

Examples

      See the entry for vbap8move for an example of usage of the vbapXmove opcodes.

Reference

      Ville Pulkki: "Virtual Sound Source Positioning Using Vector Base Amplitude Panning" Journal of the Audio Engineering Society, 1997 June, Vol. 45/6, p. 456.

Examples

      Here is an example of the vbap4move opcode. It uses the file vbap4move.csd.

            Example 1009. Example of the vbap4move opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o vbap4move.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 4	;quad
0dbfs  = 1

vbaplsinit 2, 4, 0, 90, 180, 270

instr 1

asig diskin2 "beats.wav", 1, 0, 1		;loop beats.wav
a1,a2,a3,a4 vbap4move  asig, p3, 1, 2, 310, 180	;change movement of soundsource in
     outq a1,a2,a3,a4				;the rear speakers

endin
</CsInstruments>
<CsScore>

i 1 0 5

e
</CsScore>
</CsoundSynthesizer>

See Also

      vbap16,
      vbap16move,
      vbap4,
      vbap8,
      vbap8move,
      vbaplsinit,
      vbapz,
      vbapzmove

Credits

            Author: Ville Pulkki

            Sibelius Academy Computer Music Studio

            Laboratory of Acoustics and Audio Signal Processing

            Helsinki University of Technology

            Helsinki, Finland

            May 2000

New in Csound Version 4.07

          Prev

            Up

           Next

          vbap4

            Home

           vbap8


text:
<?php

namespace SaintSystems\OData;

/**
 * Interface for authenticating requests.
 */
interface IAuthenticationProvider
{
    /**
     * Authenticates the specified request message.
     * @param  HttpRequestMessage $request The HttpRequestMessage to authenticate.
     * @return void
     */
    public function authenticateRequest(HttpRequestMessage $request);
}


text:
_libSetDefault = function() {
	dObj = new Date();
	var y = dObj.getFullYear();
	var m = dObj.getMonth() + 1;
	var cur = sprintf("%d%02d", y, m);
	Session.setDefault('procMonth', cur);

	var monthOptions = generateSelectOptionsMonthList();
	$(monthOptions).each(function(i, v){
		if (v.value == cur) {
			Session.setDefault('procMonthString', v.label);
		}
	});
}

_libSetDefault();

Template.menu.rendered = function() {
//var user = Meteor.user()
//console.log(user);
//var user2 = Meteor.users.findOne({_id: user._id});
//console.log(user2);

	var procMonth = Session.get('procMonth');
	var procMonthString = Session.get('procMonthString');
console.log(procMonth);
console.log(procMonthString);

	var monthOptions = generateSelectOptionsMonthList();
	$(monthOptions).each(function(i, v){
		$("#procMonth").append($("<option>", { value: v.value, html: v.label }));
	});
	$("#procMonth option[value='" + procMonth + "']").prop('selected', true);

	$('#procMonth').on('change', function(e) {
		var procMonth = $(this).find(":selected").val();
		var procMonthString = $(this).find(":selected").text();
		Session.set('procMonthString', procMonthString);
		Session.set('procMonth', procMonth);
console.log(procMonth);
console.log(procMonthString);
	});

	$('#download').on('click', function(e) {
		Meteor.call('export_excel', 'test', function(error, xml) {
var sheet_st_p = xml.indexOf('<Worksheet ss:Name="個別機能訓練計画_モニタ">');
var sheet_en_p = xml.indexOf('</Worksheet>', sheet_st_p) + '</Worksheet>'.length;
var xml_st = xml.substring(0, sheet_st_p);
var xml_sheet_org = xml.substring(sheet_st_p, sheet_en_p);
var xml_sheet2 = xml_sheet_org.replace('個別機能訓練計画_モニタ', '個別機能訓練計画_モニタ2');
var xml_ed = xml.substring(sheet_en_p);
var axml = xml_st + xml_sheet_org + xml_sheet2 + xml_ed;
			saveAs(new Blob([axml],{type:""}), "test.xml");
		});
	});

}


text:
CREATE TABLE uniProtAlias (
  acc varchar(40) NOT NULL default '',  # UniProt accession number
  alias varchar(40) default NULL,	# alias, could be acc, old and new display IDs, etc.
  aliasSrc varchar(4) default NULL,	# source of this type of alias is from
  aliasSrcDate date default NULL,	# date of the source data
  KEY acc (acc)
) TYPE=MyISAM;


text:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Membros_model extends CI_Model
{
	public function retornarTodosMembros()
	{
		$this->db->order_by('nomeMembro', 'asc');
		return $this->db->get('Membros')->result();
	}

	public function retornarMembroPorId($id)
	{
		$this->db->where('idMembro', $id);

		return $this->db->get('Membros')->result();
	}

	public function ultimosMembros()
	{
		$this->db->order_by('idMembro', 'desc');

		return $this->db->get('Membros', 10)->result();
	}

	public function salvar($post)
	{
		$this->db->select('nomeMembro');
		$this->db->where('nomeMembro', $post['nomeMembro']);
		$resultado = $this->db->get('Membros')->result();

		if (!$resultado) {

			$this->db->insert('Membros', $post);

			return true;

		} else {

			return false;

		}
	}
}

?>


text:
exports.monkeyPatchSignedXmlExclusiveCanonicalization = monkeyPatchSignedXmlExclusiveCanonicalization;

function monkeyPatchSignedXmlExclusiveCanonicalization(xmlcrypto) {
    // This is needed because exclusive-canonicalization implementation in xml-crypto library adds the namespace to xml:id attribute.
    // According to [http://www.w3.org/TR/2008/REC-xml-c14n11-20080502]:
    //     "The xml:id attribute is not a simple inheritable attribute and no processing of these attributes is performed."
    var origExclusiveCanonicalization = xmlcrypto.SignedXml.CanonicalizationAlgorithms['http://www.w3.org/2001/10/xml-exc-c14n#'];
    var monkeyPatchedExclusiveCanonicalization = function() {
        /*given a node (from the xmldom module) return its canonical representation (as string)*/
        this.process = function(node) {
            //you should apply your transformation before returning
            var canon = origExclusiveCanonicalization.prototype.process(node);
            canon = canon.replace(/xmlns:xml="" xml:id/, "xml:id");
            return canon;
        }

        this.getAlgorithmName = function() {
            return origExclusiveCanonicalization.prototype.getAlgorithmName();
        }
    }
    xmlcrypto.SignedXml.CanonicalizationAlgorithms['http://www.w3.org/2001/10/xml-exc-c14n#'] = monkeyPatchedExclusiveCanonicalization;
}


text:
const
	api = require('./queryRoute'),
	util = require('util');
	stats = require('./simpleStats');

//Each grade in the 'grades' object has an array of interest rates
var grades = {};
var badStatus = /late|charged off|grace|default/;

api.queryAccountsRoute('detailednotes', function(data){
	data.myNotes.forEach(function(note){
		var grade = note.grade;
		if(!grades.hasOwnProperty(grade)){
			grades[grade] = {
				interestRates: [],
				bads: []
			};
		}
		grades[grade]['interestRates'].push(note.interestRate);
		if(note.loanStatus.toLowerCase().search(badStatus) !== -1){
			grades[grade]['bads'].push(note.interestRate);
		}
	});

	sortedGrades = Object.keys(grades).sort();

	sortedGrades.forEach(function(grade){
		//shorthand variable for the array of interest rates in a grade
		var allG = grades[grade]['interestRates'];
		console.log(util.format('\n\nDetails for grade %s:', grade));
		console.log('----------------------');
		console.log(util.format('Total: %s', allG.length));
		console.log(util.format('Highest rate: %s', stats.numericSortDescending(allG)[0]));
		console.log(util.format('Lowest rate: %s', stats.numericSortAscending(allG)[0]));
		console.log(util.format('Mean rate: %s', stats.getMean(allG).toFixed(2)));
		console.log(util.format('Std dev: %s', stats.getStandardDeviation(allG).toFixed(2)));
		console.log(util.format('Percent problematic: %s %',
			((grades[grade]['bads'].length * 1.0)/grades[grade]['interestRates'].length * 100).toFixed(2) ))
		if(grades[grade]['bads'].length > 0){
			console.log(util.format('Interest rates for problematic loans: %s',
				grades[grade]['bads'].join(', ')));
		} else {
			console.log("This grade has NO problematic loans.");
		}
	});
});


text:
package libldt3.model.objekte;

import java.time.LocalDate;
import java.util.List;

import libldt3.annotations.Feld;
import libldt3.annotations.Feldart;
import libldt3.annotations.Objekt;
import libldt3.annotations.Regelsatz;
import libldt3.model.regel.F002;
import libldt3.model.regel.F017;
import lombok.Getter;
import lombok.Setter;

/**
 * In diesem Objekt können Information zu einem Tumor sowohl für die
 * Beauftragung und für den Befund transportiert werden.
 */
@Objekt("0056")
public @Getter @Setter class Tumor {

	@Feld(value = "7364", feldart = Feldart.muss)
	@Regelsatz(maxLaenge = 60)
	private String probengefaessIdent;
	@Feld(value = "7372", feldart = Feldart.kann)
	@Regelsatz(maxLaenge = 60)
	private String tumorklassifikation;
	@Feld(value = "7373", feldart = Feldart.kann)
	@Regelsatz(maxLaenge = 5)
	private String grading;
	@Feld(value = "7374", feldart = Feldart.kann)
	@Regelsatz(maxLaenge = 4)
	private String stadium;
	@Feld(value = "7375", feldart = Feldart.kann)
	@Regelsatz(value = F017.class, laenge = 4)
	private String jahrTumordiagnose;
	@Feld(value = "7376", feldart = Feldart.muss)
	@Regelsatz(maxLaenge = 60)
	private String lokalisationTumor;
	@Feld(value = "7377", feldart = Feldart.kann)
	@Regelsatz(maxLaenge = 60)
	private List<String> masse;
	@Feld(value = "7378", feldart = Feldart.kann)
	@Regelsatz(maxLaenge = 60)
	private String farbe;
	@Feld(value = "7379", feldart = Feldart.kann)
	@Regelsatz(maxLaenge = 60)
	private String infiltrationstiefe;
	@Feld(value = "3424", feldart = Feldart.kann)
	@Regelsatz(value = F002.class, laenge = 8)
	private LocalDate therapiebeginn;
	@Feld(value = "3425", feldart = Feldart.kann)
	@Regelsatz(value = F002.class, laenge = 8)
	private LocalDate therapieende;
	@Feld(value = "8220", name = "Timestamp_Eingangserfassung_Material", feldart = Feldart.kann)
	@Regelsatz(laenge = 36)
	private Timestamp timestampEingangserfassungMaterial;
	@Feld(value = "8222", name = "Timestamp_Beginn_Analytik", feldart = Feldart.kann)
	@Regelsatz(laenge = 25)
	private Timestamp timestampBeginnAnalytik;
	@Feld(value = "8223", name = "Timestamp_Ergebniserstellung", feldart = Feldart.kann)
	@Regelsatz(laenge = 28)
	private Timestamp timestampErgebniserstellung;
	@Feld(value = "8224", name = "Timestamp_QM_Erfassung", feldart = Feldart.kann)
	@Regelsatz(laenge = 22)
	private Timestamp timestampQmErfassung;
	@Feld(value = "8225", name = "Timestamp_Messung", feldart = Feldart.kann)
	@Regelsatz(laenge = 17)
	private Timestamp timestampMessung;
	@Feld(value = "8167", name = "Zusaetzliche_Informationen", feldart = Feldart.kann)
	@Regelsatz(laenge = 26)
	private List<Fliesstext> zusaetzlicheInformationen;
	@Feld(value = "8110", name = "Anhang", feldart = Feldart.kann)
	@Regelsatz(laenge = 6)
	private List<Anhang> anhang;

}


text:
{% extends "base.html" %}

{% block titulo %}Alteração de perfis{% endblock %}

{% block paginatitulo %}Alteração de perfis{% endblock %}

{% block scripts %}
<link rel="stylesheet" type="text/css" href="{{ url_for('.static', filename='css/jquery-ui.min.css') }}">

{% endblock %}
{% block header %}{% endblock %}

{% block conteudo %}

		<form action="" method="post" id="cform" name="cform">

Alteração de perfil {{p.nome}}

					  {{f.nome.label}}
						{{f.nome}}
						{% if f.nome.errors %}
{{';'.join(f.nome.errors)}}
{% endif %}

					  {{f.descricao.label}}
						{{f.descricao}}
						{% if f.descricao.errors %}
{{';'.join(f.descricao.errors)}}
{% endif %}

			{% if permissoes %}

					Possui permissão
					Permissão
					Descrição

					{% for permissao, permissaoperfil in permissoes %}
					<input type="checkbox" name="perms" value="{{permissao.id}}"{% if permissaoperfil %} checked="checked"{% endif %}/>
					{{permissao.nome}}
					{{permissao.descricao}}

					{% else %}

Nenhuma permissão cadastrada

					{% endfor %}

			{% endif%}

			<input type="submit" class="ui small blue submit button" name="acao" id="acao" value="Altera" />
		</form>

{% endblock %}


text:
package org.apache.kafka.connect.runtime.rest.resources;

import com.fasterxml.jackson.core.type.TypeReference;

import javax.ws.rs.DefaultValue;
import javax.ws.rs.core.HttpHeaders;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.kafka.connect.errors.NotFoundException;
import org.apache.kafka.connect.runtime.ConnectorConfig;
import org.apache.kafka.connect.runtime.Herder;
import org.apache.kafka.connect.runtime.RestartRequest;
import org.apache.kafka.connect.runtime.WorkerConfig;
import org.apache.kafka.connect.runtime.distributed.RebalanceNeededException;
import org.apache.kafka.connect.runtime.distributed.RequestTargetException;
import org.apache.kafka.connect.runtime.rest.InternalRequestSignature;
import org.apache.kafka.connect.runtime.rest.RestClient;
import org.apache.kafka.connect.runtime.rest.entities.ActiveTopicsInfo;
import org.apache.kafka.connect.runtime.rest.entities.ConnectorInfo;
import org.apache.kafka.connect.runtime.rest.entities.ConnectorStateInfo;
import org.apache.kafka.connect.runtime.rest.entities.CreateConnectorRequest;
import org.apache.kafka.connect.runtime.rest.entities.TaskInfo;
import org.apache.kafka.connect.runtime.rest.errors.ConnectRestException;
import org.apache.kafka.connect.util.ConnectorTaskId;
import org.apache.kafka.connect.util.FutureCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletContext;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;

import java.net.URI;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import static org.apache.kafka.connect.runtime.WorkerConfig.TOPIC_TRACKING_ALLOW_RESET_CONFIG;
import static org.apache.kafka.connect.runtime.WorkerConfig.TOPIC_TRACKING_ENABLE_CONFIG;

@Path("/connectors")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class ConnectorsResource {
    private static final Logger log = LoggerFactory.getLogger(ConnectorsResource.class);
    private static final TypeReference<List<Map<String, String>>> TASK_CONFIGS_TYPE =
        new TypeReference<List<Map<String, String>>>() { };

    // TODO: This should not be so long. However, due to potentially long rebalances that may have to wait a full
    // session timeout to complete, during which we cannot serve some requests. Ideally we could reduce this, but
    // we need to consider all possible scenarios this could fail. It might be ok to fail with a timeout in rare cases,
    // but currently a worker simply leaving the group can take this long as well.
    public static final long REQUEST_TIMEOUT_MS = 90 * 1000;
    // Mutable for integration testing; otherwise, some tests would take at least REQUEST_TIMEOUT_MS
    // to run
    private static long requestTimeoutMs = REQUEST_TIMEOUT_MS;

    private final Herder herder;
    private final WorkerConfig config;
    @javax.ws.rs.core.Context
    private ServletContext context;
    private final boolean isTopicTrackingDisabled;
    private final boolean isTopicTrackingResetDisabled;

    public ConnectorsResource(Herder herder, WorkerConfig config) {
        this.herder = herder;
        this.config = config;
        isTopicTrackingDisabled = !config.getBoolean(TOPIC_TRACKING_ENABLE_CONFIG);
        isTopicTrackingResetDisabled = !config.getBoolean(TOPIC_TRACKING_ALLOW_RESET_CONFIG);
    }

    // For testing purposes only
    public static void setRequestTimeout(long requestTimeoutMs) {
        ConnectorsResource.requestTimeoutMs = requestTimeoutMs;
    }

    public static void resetRequestTimeout() {
        ConnectorsResource.requestTimeoutMs = REQUEST_TIMEOUT_MS;
    }

    @GET
    @Path("/")
    public Response listConnectors(
        final @Context UriInfo uriInfo,
        final @Context HttpHeaders headers
    ) {
        if (uriInfo.getQueryParameters().containsKey("expand")) {
            Map<String, Map<String, Object>> out = new HashMap<>();
            for (String connector : herder.connectors()) {
                try {
                    Map<String, Object> connectorExpansions = new HashMap<>();
                    for (String expansion : uriInfo.getQueryParameters().get("expand")) {
                        switch (expansion) {
                            case "status":
                                connectorExpansions.put("status", herder.connectorStatus(connector));
                                break;
                            case "info":
                                connectorExpansions.put("info", herder.connectorInfo(connector));
                                break;
                            default:
                                log.info("Ignoring unknown expansion type {}", expansion);
                        }
                    }
                    out.put(connector, connectorExpansions);
                } catch (NotFoundException e) {
                    // this likely means that a connector has been removed while we look its info up
                    // we can just not include this connector in the return entity
                    log.debug("Unable to get connector info for {} on this worker", connector);
                }

            }
            return Response.ok(out).build();
        } else {
            return Response.ok(herder.connectors()).build();
        }
    }

    @POST
    @Path("/")
    public Response createConnector(final @QueryParam("forward") Boolean forward,
                                    final @Context HttpHeaders headers,
                                    final CreateConnectorRequest createRequest) throws Throwable {
        // Trim leading and trailing whitespaces from the connector name, replace null with empty string
        // if no name element present to keep validation within validator (NonEmptyStringWithoutControlChars
        // allows null values)
        String name = createRequest.name() == null ? "" : createRequest.name().trim();

        Map<String, String> configs = createRequest.config();
        checkAndPutConnectorConfigName(name, configs);

        FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();
        herder.putConnectorConfig(name, configs, false, cb);
        Herder.Created<ConnectorInfo> info = completeOrForwardRequest(cb, "/connectors", "POST", headers, createRequest,
                new TypeReference<ConnectorInfo>() { }, new CreatedConnectorInfoTranslator(), forward);

        URI location = UriBuilder.fromUri("/connectors").path(name).build();
        return Response.created(location).entity(info.result()).build();
    }

    @GET
    @Path("/{connector}")
    public ConnectorInfo getConnector(final @PathParam("connector") String connector,
                                      final @Context HttpHeaders headers,
                                      final @QueryParam("forward") Boolean forward) throws Throwable {
        FutureCallback<ConnectorInfo> cb = new FutureCallback<>();
        herder.connectorInfo(connector, cb);
        return completeOrForwardRequest(cb, "/connectors/" + connector, "GET", headers, null, forward);
    }

    @GET
    @Path("/{connector}/config")
    public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector,
                                                  final @Context HttpHeaders headers,
                                                  final @QueryParam("forward") Boolean forward) throws Throwable {
        FutureCallback<Map<String, String>> cb = new FutureCallback<>();
        herder.connectorConfig(connector, cb);
        return completeOrForwardRequest(cb, "/connectors/" + connector + "/config", "GET", headers, null, forward);
    }

    @GET
    @Path("/{connector}/tasks-config")
    public Map<ConnectorTaskId, Map<String, String>> getTasksConfig(
            final @PathParam("connector") String connector,
            final @Context HttpHeaders headers,
            final @QueryParam("forward") Boolean forward) throws Throwable {
        FutureCallback<Map<ConnectorTaskId, Map<String, String>>> cb = new FutureCallback<>();
        herder.tasksConfig(connector, cb);
        return completeOrForwardRequest(cb, "/connectors/" + connector + "/tasks-config", "GET", headers, null, forward);
    }

    @GET
    @Path("/{connector}/status")
    public ConnectorStateInfo getConnectorStatus(final @PathParam("connector") String connector) {
        return herder.connectorStatus(connector);
    }

    @GET
    @Path("/{connector}/topics")
    public Response getConnectorActiveTopics(final @PathParam("connector") String connector) {
        if (isTopicTrackingDisabled) {
            throw new ConnectRestException(Response.Status.FORBIDDEN.getStatusCode(),
                    "Topic tracking is disabled.");
        }
        ActiveTopicsInfo info = herder.connectorActiveTopics(connector);
        return Response.ok(Collections.singletonMap(info.connector(), info)).build();
    }

    @PUT
    @Path("/{connector}/topics/reset")
    public Response resetConnectorActiveTopics(final @PathParam("connector") String connector, final @Context HttpHeaders headers) {
        if (isTopicTrackingDisabled) {
            throw new ConnectRestException(Response.Status.FORBIDDEN.getStatusCode(),
                    "Topic tracking is disabled.");
        }
        if (isTopicTrackingResetDisabled) {
            throw new ConnectRestException(Response.Status.FORBIDDEN.getStatusCode(),
                    "Topic tracking reset is disabled.");
        }
        herder.resetConnectorActiveTopics(connector);
        return Response.accepted().build();
    }

    @PUT
    @Path("/{connector}/config")
    public Response putConnectorConfig(final @PathParam("connector") String connector,
                                       final @Context HttpHeaders headers,
                                       final @QueryParam("forward") Boolean forward,
                                       final Map<String, String> connectorConfig) throws Throwable {
        FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();
        checkAndPutConnectorConfigName(connector, connectorConfig);

        herder.putConnectorConfig(connector, connectorConfig, true, cb);
        Herder.Created<ConnectorInfo> createdInfo = completeOrForwardRequest(cb, "/connectors/" + connector + "/config",
                "PUT", headers, connectorConfig, new TypeReference<ConnectorInfo>() { }, new CreatedConnectorInfoTranslator(), forward);
        Response.ResponseBuilder response;
        if (createdInfo.created()) {
            URI location = UriBuilder.fromUri("/connectors").path(connector).build();
            response = Response.created(location);
        } else {
            response = Response.ok();
        }
        return response.entity(createdInfo.result()).build();
    }

    @POST
    @Path("/{connector}/restart")
    public Response restartConnector(final @PathParam("connector") String connector,
                                 final @Context HttpHeaders headers,
                                 final @DefaultValue("false") @QueryParam("includeTasks") Boolean includeTasks,
                                 final @DefaultValue("false") @QueryParam("onlyFailed") Boolean onlyFailed,
                                 final @QueryParam("forward") Boolean forward) throws Throwable {
        RestartRequest restartRequest = new RestartRequest(connector, onlyFailed, includeTasks);
        String forwardingPath = "/connectors/" + connector + "/restart";
        if (restartRequest.forceRestartConnectorOnly()) {
            // For backward compatibility, just restart the connector instance and return OK with no body
            FutureCallback<Void> cb = new FutureCallback<>();
            herder.restartConnector(connector, cb);
            completeOrForwardRequest(cb, forwardingPath, "POST", headers, null, forward);
            return Response.noContent().build();
        }

        // In all other cases, submit the async restart request and return connector state
        FutureCallback<ConnectorStateInfo> cb = new FutureCallback<>();
        herder.restartConnectorAndTasks(restartRequest, cb);
        Map<String, String> queryParameters = new HashMap<>();
        queryParameters.put("includeTasks", includeTasks.toString());
        queryParameters.put("onlyFailed", onlyFailed.toString());
        ConnectorStateInfo stateInfo = completeOrForwardRequest(cb, forwardingPath, "POST", headers, queryParameters, null, new TypeReference<ConnectorStateInfo>() {
        }, new IdentityTranslator<>(), forward);
        return Response.accepted().entity(stateInfo).build();
    }

    @PUT
    @Path("/{connector}/pause")
    public Response pauseConnector(@PathParam("connector") String connector, final @Context HttpHeaders headers) {
        herder.pauseConnector(connector);
        return Response.accepted().build();
    }

    @PUT
    @Path("/{connector}/resume")
    public Response resumeConnector(@PathParam("connector") String connector) {
        herder.resumeConnector(connector);
        return Response.accepted().build();
    }

    @GET
    @Path("/{connector}/tasks")
    public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector,
                                         final @Context HttpHeaders headers,
                                         final @QueryParam("forward") Boolean forward) throws Throwable {
        FutureCallback<List<TaskInfo>> cb = new FutureCallback<>();
        herder.taskConfigs(connector, cb);
        return completeOrForwardRequest(cb, "/connectors/" + connector + "/tasks", "GET", headers, null, new TypeReference<List<TaskInfo>>() {
        }, forward);
    }

    @POST
    @Path("/{connector}/tasks")
    public void putTaskConfigs(final @PathParam("connector") String connector,
                               final @Context HttpHeaders headers,
                               final @QueryParam("forward") Boolean forward,
                               final byte[] requestBody) throws Throwable {
        List<Map<String, String>> taskConfigs = new ObjectMapper().readValue(requestBody, TASK_CONFIGS_TYPE);
        FutureCallback<Void> cb = new FutureCallback<>();
        herder.putTaskConfigs(connector, taskConfigs, cb, InternalRequestSignature.fromHeaders(requestBody, headers));
        completeOrForwardRequest(cb, "/connectors/" + connector + "/tasks", "POST", headers, taskConfigs, forward);
    }

    @GET
    @Path("/{connector}/tasks/{task}/status")
    public ConnectorStateInfo.TaskState getTaskStatus(final @PathParam("connector") String connector,
                                                      final @Context HttpHeaders headers,
                                                      final @PathParam("task") Integer task) {
        return herder.taskStatus(new ConnectorTaskId(connector, task));
    }

    @POST
    @Path("/{connector}/tasks/{task}/restart")
    public void restartTask(final @PathParam("connector") String connector,
                            final @PathParam("task") Integer task,
                            final @Context HttpHeaders headers,
                            final @QueryParam("forward") Boolean forward) throws Throwable {
        FutureCallback<Void> cb = new FutureCallback<>();
        ConnectorTaskId taskId = new ConnectorTaskId(connector, task);
        herder.restartTask(taskId, cb);
        completeOrForwardRequest(cb, "/connectors/" + connector + "/tasks/" + task + "/restart", "POST", headers, null, forward);
    }

    @DELETE
    @Path("/{connector}")
    public void destroyConnector(final @PathParam("connector") String connector,
                                 final @Context HttpHeaders headers,
                                 final @QueryParam("forward") Boolean forward) throws Throwable {
        FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();
        herder.deleteConnectorConfig(connector, cb);
        completeOrForwardRequest(cb, "/connectors/" + connector, "DELETE", headers, null, forward);
    }

    // Check whether the connector name from the url matches the one (if there is one) provided in the connectorConfig
    // object. Throw BadRequestException on mismatch, otherwise put connectorName in config
    private void checkAndPutConnectorConfigName(String connectorName, Map<String, String> connectorConfig) {
        String includedName = connectorConfig.get(ConnectorConfig.NAME_CONFIG);
        if (includedName != null) {
            if (!includedName.equals(connectorName))
                throw new BadRequestException("Connector name configuration (" + includedName + ") doesn't match connector name in the URL (" + connectorName + ")");
        } else {
            connectorConfig.put(ConnectorConfig.NAME_CONFIG, connectorName);
        }
    }

    // Wait for a FutureCallback to complete. If it succeeds, return the parsed response. If it fails, try to forward the
    // request to the leader.
    private <T, U> T completeOrForwardRequest(FutureCallback<T> cb,
                                              String path,
                                              String method,
                                              HttpHeaders headers,
                                              Map<String, String> queryParameters,
                                              Object body,
                                              TypeReference<U> resultType,
                                              Translator<T, U> translator,
                                              Boolean forward) throws Throwable {
        try {
            return cb.get(requestTimeoutMs, TimeUnit.MILLISECONDS);
        } catch (ExecutionException e) {
            Throwable cause = e.getCause();

            if (cause instanceof RequestTargetException) {
                if (forward == null || forward) {
                    // the only time we allow recursive forwarding is when no forward flag has
                    // been set, which should only be seen by the first worker to handle a user request.
                    // this gives two total hops to resolve the request before giving up.
                    boolean recursiveForward = forward == null;
                    RequestTargetException targetException = (RequestTargetException) cause;
                    String forwardedUrl = targetException.forwardUrl();
                    if (forwardedUrl == null) {
                        // the target didn't know of the leader at this moment.
                        throw new ConnectRestException(Response.Status.CONFLICT.getStatusCode(),
                                "Cannot complete request momentarily due to no known leader URL, "
                                + "likely because a rebalance was underway.");
                    }
                    UriBuilder uriBuilder = UriBuilder.fromUri(forwardedUrl)
                            .path(path)
                            .queryParam("forward", recursiveForward);
                    if (queryParameters != null) {
                        queryParameters.forEach(uriBuilder::queryParam);
                    }
                    String forwardUrl = uriBuilder.build().toString();
                    log.debug("Forwarding request {} {} {}", forwardUrl, method, body);
                    return translator.translate(RestClient.httpRequest(forwardUrl, method, headers, body, resultType, config));
                } else {
                    // we should find the right target for the query within two hops, so if
                    // we don't, it probably means that a rebalance has taken place.
                    throw new ConnectRestException(Response.Status.CONFLICT.getStatusCode(),
                            "Cannot complete request because of a conflicting operation (e.g. worker rebalance)");
                }
            } else if (cause instanceof RebalanceNeededException) {
                throw new ConnectRestException(Response.Status.CONFLICT.getStatusCode(),
                        "Cannot complete request momentarily due to stale configuration (typically caused by a concurrent config change)");
            }

            throw cause;
        } catch (TimeoutException e) {
            // This timeout is for the operation itself. None of the timeout error codes are relevant, so internal server
            // error is the best option
            throw new ConnectRestException(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Request timed out");
        } catch (InterruptedException e) {
            throw new ConnectRestException(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Request interrupted");
        }
    }

    private <T, U> T completeOrForwardRequest(FutureCallback<T> cb, String path, String method, HttpHeaders headers, Object body,
                                              TypeReference<U> resultType, Translator<T, U> translator, Boolean forward) throws Throwable {
        return completeOrForwardRequest(cb, path, method, headers, null, body, resultType, translator, forward);
    }

    private <T> T completeOrForwardRequest(FutureCallback<T> cb, String path, String method, HttpHeaders headers, Object body,
                                           TypeReference<T> resultType, Boolean forward) throws Throwable {
        return completeOrForwardRequest(cb, path, method, headers, body, resultType, new IdentityTranslator<>(), forward);
    }

    private <T> T completeOrForwardRequest(FutureCallback<T> cb, String path, String method, HttpHeaders headers,
                                           Object body, Boolean forward) throws Throwable {
        return completeOrForwardRequest(cb, path, method, headers, body, null, new IdentityTranslator<>(), forward);
    }

    private interface Translator<T, U> {
        T translate(RestClient.HttpResponse<U> response);
    }

    private static class IdentityTranslator<T> implements Translator<T, T> {
        @Override
        public T translate(RestClient.HttpResponse<T> response) {
            return response.body();
        }
    }

    private static class CreatedConnectorInfoTranslator implements Translator<Herder.Created<ConnectorInfo>, ConnectorInfo> {
        @Override
        public Herder.Created<ConnectorInfo> translate(RestClient.HttpResponse<ConnectorInfo> response) {
            boolean created = response.status() == 201;
            return new Herder.Created<>(created, response.body());
        }
    }
}


text:
import e = require('express');
import BaseController from "./BaseController";
import { router } from "../decorators/Web";
let path = require("path");
let fs = require("fs");
let _ = require('lodash');
let archiver = require('archiver');

import {
	Project, UcGroup, Uc, Node, Path, Checker, ProjectJs, UserModel,
	ProjectModel, ProjectJsModel, UcGroupModel, UcModel, NodeModel, PathModel, CheckerModel,
	ProjectHelper, UcGroupHelper, UcHelper, NodeHelper, PathHelper, CheckHelper
} from '../models/index';
import ErrorCode from '../ErrorCode';

let emptyDir = async function(fileUrl: string) {
	let files = fs.readdirSync(fileUrl); //读取该文件夹
	for (let file of files) {
		let fullPath = path.join(fileUrl, file);
		let stats = fs.statSync(fullPath);
		if (stats.isDirectory()) {
			await emptyDir(fullPath);
			fs.rmdir(fullPath);
		} else {
			fs.unlinkSync(fullPath);
		}
	}
};

let copyFile = function(src: string, dist: string) {
	if (!fs.existsSync(dist)) {
		var sourceFile = path.join(src);
		var readStream = fs.createReadStream(sourceFile);
		var writeStream = fs.createWriteStream(dist, { mode: 0o777 });
		readStream.pipe(writeStream);
	}
};

let loadNodePath = async function(nodeModel: NodeModel, filterField: any): Promise<Array<PathModel>> {
	let pathArray: Array<PathModel> = await Path.find({ "nodeId": nodeModel._id });
	let paths: Array<PathModel> = [];
	for (let pathModel of pathArray) {//path
		let checkerArray: Array<CheckerModel> = await Checker.find({ "pathId": pathModel._id});
		let checkers: Array<CheckerModel> = [];
		for (let checker of checkerArray) {//checker
			[checker] = CheckHelper.buildModel(checker.type, checker, true, filterField);
			checkers.push(checker);
		}
		[pathModel] = PathHelper.buildModel(pathModel.type, pathModel, true, filterField);
		if (checkers.length > 0) {
			pathModel.checker = checkers;
		} else {
			delete pathModel.checker;
		}
		paths.push(pathModel);
	}

	return new Promise<Array<PathModel>>((resolve, reject) => {
		resolve(paths);
	});
}

class ProjectController extends BaseController {
	@router({
		method: 'get',
		path: '/api/projects'
	})
	async find(req: e.Request, res: e.Response) {
		let result = await Project.find({});
    res.send(super.wrapperRes(result));
	}
	@router({
    method: 'get',
    path: '/download/projects/:id'
	})
	async download(req: e.Request, res: e.Response) {
    let result = await Project.find({ "_id": req.params.id });
    let rootPath = path.join(process.cwd(), "projects");
    let projectPath = path.join(rootPath,result[0].name);
    let downloadPath = path.join(process.cwd(), "download");
    if (!fs.existsSync(downloadPath)) {
      fs.mkdirSync(downloadPath);
    }

    let output = fs.createWriteStream(path.join(process.cwd(), "download/")+result[0].name+'.zip');
    let archive = archiver('zip');

    archive.pipe(output);
    archive.bulk([
      {
        src: ['**'],
        dest: result[0].name + '/',
        cwd: projectPath+ '/',
        expand: true
      }
    ]);
    await  archive.finalize();
    output.on('close', function() {
      let fileName = result[0].name+'.zip';
      let filePath =path.join(process.cwd(), "download/")+result[0].name+'.zip'
      let stats = fs.statSync(filePath);
      console.log("bb")
      if(stats.isFile()){
        console.log("aa")
        res.set({
          'Content-Type': 'application/octet-stream',
          'Content-Disposition': 'attachment; filename='+fileName,
          'Content-Length': stats.size
        });
        fs.createReadStream(filePath).pipe(res);
      } else {
        res.end(404);
      }
    });
	}

	@router({
		method: 'get',
		path: '/api/projects/:projectId/generate'
	})
	async generate(req: e.Request, res: e.Response) {
		if (req.params.projectId) {
			let projectArray = await Project.find({ _id: req.params.projectId });
			if (projectArray.length == 0) {
				res.send(super.wrapperErrorRes(ErrorCode.PROJECT_NOT_FOUND));
				return;
			}
			/**********获取项目信息 Start**********/
			let project: ProjectModel = projectArray[0];
			[project] = ProjectHelper.buildModel(project.platform, project);
			let ucGroupArray: Array<UcGroupModel> = await UcGroup.find({ projectId: project._id,dataStatus:1 });
			let filterField = {
				"_id": true, "projectId": true, "filterStr": true,
				"groupId": true, "dataStatus": true, "order": true,
				"ucId": true, "nodeId": true, "pathId": true, "parentId": true,
				"isParent": true,
				"createdBy": true, "createdDate": true, "modifiedBy": true, "modifiedDate": true
			};

			let ucGroups: Array<UcGroupModel> = [];
			for (let ucGroupModel of ucGroupArray) {//UcGroup
				ucGroupModel = UcGroupHelper.buildModel(ucGroupModel);
				ucGroups.push(ucGroupModel);

				let ucArray: Array<UcModel> = await Uc.find({ "groupId": ucGroupModel._id });
				let ucs: Array<UcModel> = [];
				for (let ucModel of ucArray) {//Uc
					let nodeArray: Array<NodeModel> = await Node.find({ "ucId": ucModel._id});

					let nodeTree: Array<NodeModel> = [];
					let curNode:NodeModel = null;
					for (let nodeModel of nodeArray) {//Node
		            let paths: Array<PathModel> = await loadNodePath(nodeModel, filterField);
		            nodeModel = NodeHelper.buildModel(nodeModel, true, filterField);
		            nodeModel.paths = paths;
						if (nodeModel.parentId) {
              				curNode.children.push(nodeModel);
						}else{
							curNode = nodeModel;
							curNode.children = [];
							nodeTree.push(nodeModel);
						}

					}

					ucModel = UcHelper.buildModel(ucModel, true, filterField);
					ucs.push(ucModel);
					ucModel.nodes = nodeTree;
				}
				ucGroupModel.ucs = ucs;
			}
			project.ucGroups = ucGroups;
			/**********获取项目信息 End**********/

			/**********产生项目文件 Start**********/
			let rootPath = path.join(process.cwd(), "projects");
			let tplPath = path.join(process.cwd(), "tpl");
			let projectPath = path.join(rootPath, project.name);
			let projectSrc = path.join(projectPath, "src");
			let ucPath = path.join(projectSrc, "uc");
			let handlerPath = path.join(projectSrc, "handler");

			await emptyDir(ucPath);
			await emptyDir(handlerPath);

			let packageTpl = _.template(fs.readFileSync(path.join(tplPath, "package.tpl.json")));
			fs.writeFileSync(path.join(projectPath, "package.json"), packageTpl({
				"name": project.name
			}));

			for (let ucGroup of project.ucGroups) {
				let groupPath = path.join(ucPath, ucGroup.name);
				let handlerFilePath = path.join(handlerPath, ucGroup.name);
				fs.mkdirSync(groupPath);
				fs.mkdirSync(handlerFilePath);
				for (let uc of ucGroup.ucs) {
					delete uc.code;
					let ucTpl = _.template(fs.readFileSync(path.join(tplPath, "uc.tpl.js")));
					if(uc.handlerCode){
            fs.writeFileSync(path.join(handlerFilePath, `${uc.ucKey}.handler.js`), ucTpl({
              "content": uc.handlerCode
            }));
            delete uc.handlerCode;
          }
					fs.writeFileSync(path.join(groupPath, `${uc.ucKey}.uc.js`), ucTpl({
						"content": JSON.stringify(uc)
					}));
				}
			}

			//产生全局脚本
			let projectJsArray = await ProjectJs.find({ projectId: project._id });
			for (let projectJs of projectJsArray) {
				fs.writeFileSync(path.join(projectSrc, `${projectJs.jsName}.js`), projectJs.script);
			}
			delete project.ucGroups;
			delete project._id;
			delete project.name;
			fs.writeFileSync(path.join(projectPath, `vtester.json`), JSON.stringify(project));

			//复制文件
			copyFile(path.join(tplPath, "vtester.uc.tpl.js"), path.join(projectSrc, "vtester.uc.js"));
			/**********产生项目文件 End**********/
			res.send(super.wrapperRes([]));
		} else {
			res.send(super.wrapperRes([]));
		}

	}

	@router({
		method: 'post',
		path: '/api/projects'
	})
	async create(req: e.Request, res: e.Response) {
		let user: UserModel = super.getUser(req);
		let projectModel: ProjectModel;
		[projectModel] = ProjectHelper.buildModel(req.body.platform, req.body);
		projectModel.setCreatedInfo(user);
		let projectArray = await Project.find({ name: projectModel.name });
		console.log(projectArray.length)
		if (projectArray.length == 0) {
			let project: ProjectModel = await Project.insert(projectModel);
			let jsModel: ProjectJsModel = new ProjectJsModel();
			jsModel.name = "页面映射";
			jsModel.jsName = "page.map";
			jsModel.fixed = true;
			jsModel.projectId = project._id;
			jsModel.dataStatus = 1;
			jsModel.setCreatedInfo(user);
			ProjectJs.insert(jsModel);
			jsModel.name = "全局参数";
			jsModel.jsName = "global.uc";
			ProjectJs.insert(jsModel);
			jsModel.name = "工具脚本";
			jsModel.jsName = "helper.uc";
			ProjectJs.insert(jsModel);

			//初始化文件夹
			let rootPath = path.join(process.cwd(), "projects");
			if (!fs.existsSync(rootPath)) {
				fs.mkdirSync(rootPath);
			}
			let projectPath = path.join(rootPath, project.name);
			if (!fs.existsSync(projectPath)) {
				fs.mkdirSync(projectPath);
				fs.mkdirSync(path.join(projectPath, "src"));
				fs.mkdirSync(path.join(projectPath, "uc"));
				fs.mkdirSync(path.join(projectPath, "handler"));
				fs.mkdirSync(path.join(projectPath, "temp"));
			}

			res.send(super.wrapperRes(project));
		} else {
			res.send(super.wrapperErrorRes(ErrorCode.PROJECT_FOUND));
			return;
		}

	}

	@router({
		method: 'patch',
		path: '/api/projects/:id'
	})
	async update(req: e.Request, res: e.Response) {
		let user: UserModel = super.getUser(req);
		let projectModel: ProjectModel;
		[projectModel] = ProjectHelper.buildModel(req.body.platform, req.body);
		projectModel.setModifiedInfo(user);
		let result = await Project.update(req.body);
		res.send(super.wrapperRes(result));
	}
}

export default ProjectController


text:
😏 A lightweight, functional library for describing and validating JSON and JavaScript data. Scheming JSON tries to make the description of your data as close to what your data actually is as possible (your schemas look like your data, and your data looks like your schemas).

#Describing JSON
Let's say we have some data we want to validate
```javascript
var data = {articles:
  [{
      title: 'The Title',
      author: 'The Author',
      published: '1/7/53',
      tags: [
        {tagName: 'Stuff'},
        {tagName: 'Garbage'},
        {tagName: 'uninteresting'}
      ]
    },
    {
      title: 'A title',
      author: 'Somebody else',
      published: '1/8/53',
      tags: [
        {tagName: 'Stuff'}
      ]
    }
  ]};
```
How would we create rules that determine if it's valid or not? An example scheming json ruleset (schema) for our data could look like this:
```javascript
var schema = {articles:
  [{
    title: isString,
    author: isString,
    published: isDateString,
    tags: [{tagName: isString}]
  }]
};
```
Which says that we have a root object with a key called `articles`, which contains an array of one or more objects each having a key called `title` (whose type is a string), `author` (also a string), `datePublished` (using a custom type called `dateString` that we defined), and `tags`, which contains an array of objects (each object having only one field named `tagName`, whose type is a string).

To translate our ruleset into something that we can evaulate json and javascript variables on, we need a parser function. To get a function the parser, use the `parser` function, and apply it to some data to parse.
```javascript
var articlesParser = parser(schema);

var articlesValid = articlesParser(someArrayofArticles); // => true
// hooray!
```

Alternatively, we could build up smaller schema pieces, and then combine them:
```javascript
var tag = {tagName: isString};
var article = {title: isString, author: isString, published: isDateString, tags: [tag]};
var articles = {articles: [article]};
```
All of the type checkers (like `isString` or `isDateString`) are just functions that take some input and return either true or false (a "predicate"). The function could be something from the JavaScript core (`Array.isArray`), something that we define is a one off (`function greaterThanThree(x){return x>3;}`), or a parser that we've generated previously (like the parser functioned returned by `parser(tag)`)

### See the [docs](https://drewsynan.github.io/scheming-json/) for more!


text:
package annotations.tests.classfile.cases;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class TestTypecastGenericArray {
  public Object o;
  public String s;
  public Integer i;
  public Boolean b;
  public Set<String> set;
  public HashSet<Set<String>> hset;
  public Map<Set<String>,Set<Map<String,Set<String>>>> map;

  public void test() {
    o = (Object) o;
    o = (Object) s;
    s = (String) o;
    i = (Integer) o;
    b = (Boolean) b;
  }

  @SuppressWarnings({"unchecked"})
  public void test2() {
    set = (HashSet<String>) o;
    set = (Set<String>) o;
  }

  @SuppressWarnings({"unchecked"})
  public void test3() {
    set = (HashSet<String>) map.keySet().iterator().next();
    hset = (HashSet<Set<String>>) o;
  }

  @SuppressWarnings("unchecked")
  public void test4() {
    map = (Map<Set<String>, Set<Map<String, Set<String>>>>) o;
    Set<Map<String, Set<String>>> t = (Set<Map<String, Set<String>>>) o;
    set = map.get(null).iterator().next().get("");
  }

  @SuppressWarnings("unchecked")
  public void test5() {
    Map<String, String[][]> m;
    m = (Map<String, String[][]>) o;
    System.out.println(m);
  }
}