<!DOCTYPE html>

  <title>APIドキュメント</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/>
  <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/>

    Foreman v2
    /

      Permissions

    /

index

   [ ca | cs_CZ | de | en | en_GB | es | fr | gl | it | ja | ko | nl_NL | pl | pt_BR | ru | sv_SE | zh_CN | zh_TW ]

      GET /api/permissions

      すべてのパーミッションを一覧表示

例

GET /api/permissions
200
{
  "total": 162,
  "subtotal": 162,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "name": "view_architectures",
      "id": 350275019,
      "resource_type": "Architecture"
    },
    {
      "name": "create_architectures",
      "id": 912770095,
      "resource_type": "Architecture"
    },
    {
      "name": "edit_architectures",
      "id": 874798611,
      "resource_type": "Architecture"
    },
    {
      "name": "destroy_architectures",
      "id": 586604735,
      "resource_type": "Architecture"
    },
    {
      "name": "view_authenticators",
      "id": 687843582,
      "resource_type": "AuthSource"
    },
    {
      "name": "create_authenticators",
      "id": 956119309,
      "resource_type": "AuthSource"
    },
    {
      "name": "edit_authenticators",
      "id": 395314704,
      "resource_type": "AuthSource"
    },
    {
      "name": "destroy_authenticators",
      "id": 1067518973,
      "resource_type": "AuthSource"
    },
    {
      "name": "view_bookmarks",
      "id": 995886532,
      "resource_type": "Bookmark"
    },
    {
      "name": "create_bookmarks",
      "id": 435712857,
      "resource_type": "Bookmark"
    },
    {
      "name": "edit_bookmarks",
      "id": 978016136,
      "resource_type": "Bookmark"
    },
    {
      "name": "destroy_bookmarks",
      "id": 1027408783,
      "resource_type": "Bookmark"
    },
    {
      "name": "view_compute_resources",
      "id": 524255159,
      "resource_type": "ComputeResource"
    },
    {
      "name": "create_compute_resources",
      "id": 673360498,
      "resource_type": "ComputeResource"
    },
    {
      "name": "edit_compute_resources",
      "id": 385985960,
      "resource_type": "ComputeResource"
    },
    {
      "name": "destroy_compute_resources",
      "id": 382135357,
      "resource_type": "ComputeResource"
    },
    {
      "name": "view_compute_profiles",
      "id": 944771383,
      "resource_type": "ComputeProfile"
    },
    {
      "name": "create_compute_profiles",
      "id": 1035871455,
      "resource_type": "ComputeProfile"
    },
    {
      "name": "edit_compute_profiles",
      "id": 884230802,
      "resource_type": "ComputeProfile"
    },
    {
      "name": "destroy_compute_profiles",
      "id": 932164668,
      "resource_type": "ComputeProfile"
    }
  ]
}

パラメーター

        パラメーター名
        記述

      location_id

        任意

Set the current location context for the request

Validations:

Must be a Integer

      organization_id

        任意

Set the current organization context for the request

Validations:

Must be a Integer

      search

        任意

結果のフィルター

Validations:

Must be a String

      order

        任意

フィールドと順序のソート (例: ‘id DESC’)

Validations:

Must be a String

      page

        任意

1 から始まるページ番号

Validations:

Must be a number.

      per_page

        任意

戻されるページごとの結果数

Validations:

Must be a number.

検索フィールド

      フィールド名
      タイプ
      設定可能な値

      name
      string

      resource_type
      string


image=images/avatar/male/leather_hood.png

[stance]
frames=4
duration=800ms
type=back_forth
frame=0,0,208,178,23,33,8,46
frame=0,1,117,217,23,33,7,46
frame=0,2,24,328,21,34,4,47
frame=0,3,115,285,23,34,4,46
frame=0,4,138,286,24,33,4,45
frame=0,5,351,69,24,34,5,45
frame=0,6,429,170,20,33,5,45
frame=0,7,275,175,22,33,7,45
frame=1,0,369,103,23,33,8,45
frame=1,1,407,170,22,33,7,46
frame=1,2,449,170,20,34,4,47
frame=1,3,252,173,23,34,4,46
frame=1,4,287,35,25,33,4,45
frame=1,5,375,69,24,34,5,45
frame=1,6,435,137,20,33,5,45
frame=1,7,202,211,22,33,7,45
frame=2,0,145,355,24,32,9,45
frame=2,1,224,211,22,33,7,46
frame=2,2,226,244,20,33,4,46
frame=2,3,392,103,23,33,4,45
frame=2,4,312,35,25,33,4,45
frame=2,5,297,103,24,33,5,44
frame=2,6,226,277,20,33,5,44
frame=2,7,203,244,23,32,8,44
frame=3,0,169,355,24,32,10,45
frame=3,1,246,279,21,33,7,46
frame=3,2,183,213,19,34,4,47
frame=3,3,193,355,24,32,4,45
frame=3,4,423,71,25,32,3,44
frame=3,5,266,208,23,32,4,43
frame=3,6,289,208,20,32,5,43
frame=3,7,423,203,22,32,8,44

[shoot]
frames=4
duration=400ms
type=play_once
frame=0,0,149,35,25,35,9,48
frame=0,1,343,136,23,34,7,48
frame=0,2,230,141,21,35,4,49
frame=0,3,45,179,24,35,4,48
frame=0,4,235,0,26,34,4,47
frame=0,5,69,215,24,34,5,46
frame=0,6,246,245,21,34,5,46
frame=0,7,321,103,24,33,8,46
frame=1,0,93,215,24,34,7,48
frame=1,1,45,320,23,35,6,49
frame=1,2,117,145,21,36,4,50
frame=1,3,246,34,24,36,5,49
frame=1,4,183,0,26,35,5,48
frame=1,5,45,214,24,35,5,48
frame=1,6,231,176,21,35,5,48
frame=1,7,68,284,23,35,7,48
frame=2,0,92,249,23,35,6,49
frame=2,1,45,249,23,36,6,49
frame=2,2,117,108,21,37,4,50
frame=2,3,138,70,24,36,5,49
frame=2,4,174,35,25,35,5,48
frame=2,5,69,145,24,35,5,48
frame=2,6,117,181,21,36,5,49
frame=2,7,68,319,22,36,6,49
frame=3,0,387,35,25,34,8,48
frame=3,1,91,284,24,34,7,48
frame=3,2,162,213,21,36,4,49
frame=3,3,138,143,23,35,4,48
frame=3,4,261,0,26,34,5,47
frame=3,5,184,142,24,34,5,47
frame=3,6,267,240,21,34,5,47
frame=3,7,366,136,23,34,7,47

[run]
frames=8
duration=533ms
type=looped
frame=0,0,0,73,25,36,11,50
frame=0,1,399,69,24,34,9,52
frame=0,2,75,109,21,36,4,52
frame=0,3,0,36,25,37,3,52
frame=0,4,27,0,26,36,2,50
frame=0,5,0,182,24,36,3,49
frame=0,6,103,36,21,35,4,48
frame=0,7,0,218,24,36,9,49
frame=1,0,209,0,26,34,11,49
frame=1,1,199,35,23,36,8,51
frame=1,2,75,72,21,37,4,52
frame=1,3,287,0,25,35,3,50
frame=1,4,25,36,26,36,2,49
frame=1,5,312,0,25,35,4,48
frame=1,6,210,71,21,35,5,47
frame=1,7,255,70,23,35,9,48
frame=2,0,25,72,25,36,11,49
frame=2,1,45,285,23,35,8,50
frame=2,2,24,256,21,36,3,51
frame=2,3,77,36,26,35,3,49
frame=2,4,105,0,26,35,2,48
frame=2,5,337,35,25,34,4,46
frame=2,6,246,211,20,34,5,46
frame=2,7,297,136,23,34,9,47
frame=3,0,337,0,25,35,11,50
frame=3,1,184,106,23,36,8,51
frame=3,2,96,71,21,37,4,52
frame=3,3,362,0,25,35,3,50
frame=3,4,53,0,26,36,2,49
frame=3,5,0,109,25,36,4,48
frame=3,6,162,284,21,35,5,47
frame=3,7,186,71,24,35,9,48
frame=4,0,25,108,25,36,10,50
frame=4,1,50,72,25,36,9,51
frame=4,2,24,292,21,36,4,52
frame=4,3,0,145,24,37,3,52
frame=4,4,0,0,27,36,3,50
frame=4,5,0,254,24,36,3,49
frame=4,6,182,249,21,35,4,48
frame=4,7,207,106,23,36,8,49
frame=5,0,0,290,24,36,10,49
frame=5,1,231,70,24,35,9,50
frame=5,2,96,108,21,37,5,52
frame=5,3,50,108,25,36,4,51
frame=5,4,51,36,26,36,2,50
frame=5,5,387,0,25,35,3,48
frame=5,6,183,284,21,35,4,47
frame=5,7,278,68,24,35,8,48
frame=6,0,302,68,24,35,10,48
frame=6,1,320,136,23,34,9,49
frame=6,2,90,319,20,36,5,51
frame=6,3,412,0,25,35,4,50
frame=6,4,131,0,26,35,2,49
frame=6,5,362,35,25,34,3,47
frame=6,6,194,319,20,35,3,47
frame=6,7,45,144,24,35,8,47
frame=7,0,79,0,26,36,11,49
frame=7,1,0,326,24,36,9,51
frame=7,2,117,71,21,37,5,52
frame=7,3,437,0,25,36,4,51
frame=7,4,157,0,26,35,2,49
frame=7,5,124,35,25,35,3,48
frame=7,6,230,106,21,35,4,47
frame=7,7,222,34,24,36,8,48

[die]
frames=6
duration=800ms
type=play_once
frame=0,0,400,235,22,32,11,46
frame=0,1,380,272,20,32,4,47
frame=0,2,309,205,23,32,1,45
frame=0,3,45,355,25,32,0,43
frame=0,4,332,205,24,31,2,40
frame=0,5,260,345,19,30,5,39
frame=0,6,422,266,22,31,11,40
frame=0,7,356,205,24,31,14,43
frame=1,0,320,332,19,30,11,46
frame=1,1,444,266,21,31,4,47
frame=1,2,332,236,24,31,-3,45
frame=1,3,214,310,23,30,-5,40
frame=1,4,336,298,20,30,-2,36
frame=1,5,400,299,21,30,7,35
frame=1,6,356,236,24,31,16,38
frame=1,7,339,358,21,29,18,42
frame=2,0,469,167,11,23,11,41
frame=2,1,19,362,18,25,0,41
frame=2,2,462,112,18,25,-11,37
frame=2,3,422,328,19,27,-11,32
frame=2,4,270,34,17,28,-3,27
frame=2,5,422,355,17,28,11,27
frame=2,6,462,59,18,27,21,31
frame=2,7,462,86,18,26,22,36
frame=3,0,439,355,12,23,12,38
frame=3,1,360,357,18,24,1,38
frame=3,2,378,361,19,23,-9,33
frame=3,3,441,326,19,23,-10,27
frame=3,4,460,327,16,25,-3,23
frame=3,5,0,362,19,25,10,23
frame=3,6,451,352,16,23,21,26
frame=3,7,320,362,19,24,22,32
frame=4,0,469,190,11,16,15,25
frame=4,1,467,258,9,7,-1,26
frame=4,2,465,282,15,16,-12,21
frame=4,3,299,371,15,15,-14,13
frame=4,4,465,265,15,17,-4,8
frame=4,5,448,71,14,18,11,7
frame=4,6,237,371,16,16,24,12
frame=4,7,448,89,14,15,26,19
frame=5,0,469,220,11,10,16,19
frame=5,1,270,62,9,5,-2,20
frame=5,2,265,375,12,11,-15,14
frame=5,3,467,247,13,11,-16,6
frame=5,4,217,373,13,14,-5,1
frame=5,5,469,206,11,14,12,0
frame=5,6,467,233,13,14,25,5
frame=5,7,253,375,12,12,27,13

[cast]
frames=4
duration=400ms
type=play_once
frame=0,0,161,143,23,35,7,48
frame=0,1,275,105,22,35,6,48
frame=0,2,110,319,21,36,4,49
frame=0,3,138,178,23,35,4,48
frame=0,4,412,35,25,34,5,47
frame=0,5,184,176,24,34,5,47
frame=0,6,267,274,21,34,5,47
frame=0,7,288,240,21,34,6,47
frame=1,0,69,180,24,35,8,49
frame=1,1,275,140,22,35,6,49
frame=1,2,24,145,21,37,4,51
frame=1,3,162,70,24,36,4,49
frame=1,4,437,36,25,35,4,48
frame=1,5,93,145,24,35,5,48
frame=1,6,131,319,21,36,5,48
frame=1,7,297,170,22,35,7,48
frame=2,0,319,170,22,35,6,49
frame=2,1,208,142,22,36,6,50
frame=2,2,24,182,21,37,4,51
frame=2,3,138,106,23,37,4,50
frame=2,4,93,180,24,35,4,48
frame=2,5,161,178,23,35,5,48
frame=2,6,138,250,21,36,5,49
frame=2,7,152,319,21,36,6,49
frame=3,0,115,250,23,35,5,49
frame=3,1,140,213,22,36,5,50
frame=3,2,24,219,21,37,4,50
frame=3,3,161,106,23,37,4,50
frame=3,4,68,249,24,35,5,48
frame=3,5,159,249,23,35,5,48
frame=3,6,173,319,21,36,5,49
frame=3,7,341,170,22,35,6,49

[swing]
frames=4
duration=400ms
type=play_once
frame=0,0,251,105,24,34,13,47
frame=0,1,389,136,23,34,10,49
frame=0,2,363,170,21,35,4,50
frame=0,3,415,103,23,34,1,48
frame=0,4,326,69,25,34,0,46
frame=0,5,251,139,24,34,2,44
frame=0,6,380,239,20,33,5,43
frame=0,7,384,170,23,33,11,44
frame=1,0,70,355,25,32,18,43
frame=1,1,309,237,23,32,14,47
frame=1,2,260,312,19,33,4,49
frame=1,3,309,269,23,32,-1,47
frame=1,4,95,355,25,32,-4,43
frame=1,5,332,267,24,31,-1,39
frame=1,6,279,341,20,32,5,38
frame=1,7,317,301,19,31,13,39
frame=2,0,237,312,23,30,22,40
frame=2,1,339,328,19,30,17,45
frame=2,2,462,0,18,30,5,48
frame=2,3,401,329,21,30,-4,46
frame=2,4,455,137,25,30,-8,41
frame=2,5,237,342,23,29,-4,35
frame=2,6,421,299,19,29,4,32
frame=2,7,440,297,21,29,15,34
frame=3,0,445,204,24,29,24,38
frame=3,1,378,304,22,29,19,44
frame=3,2,462,30,18,29,5,48
frame=3,3,358,327,20,30,-5,46
frame=3,4,356,267,24,30,-10,40
frame=3,5,378,333,23,28,-6,33
frame=3,6,461,298,19,29,3,30
frame=3,7,401,359,21,28,16,32

[hit]
frames=2
duration=133ms
type=play_once
frame=0,0,400,235,22,32,11,46
frame=0,1,380,272,20,32,4,47
frame=0,2,309,205,23,32,1,45
frame=0,3,45,355,25,32,0,43
frame=0,4,332,205,24,31,2,40
frame=0,5,260,345,19,30,5,39
frame=0,6,422,266,22,31,11,40
frame=0,7,356,205,24,31,14,43
frame=1,0,320,332,19,30,11,46
frame=1,1,444,266,21,31,4,47
frame=1,2,332,236,24,31,-3,45
frame=1,3,214,310,23,30,-5,40
frame=1,4,336,298,20,30,-2,36
frame=1,5,400,299,21,30,7,35
frame=1,6,356,236,24,31,16,38
frame=1,7,339,358,21,29,18,42

[block]
frames=2
duration=66ms
type=play_once
frame=0,0,412,137,23,33,8,45
frame=0,1,288,274,21,33,6,45
frame=0,2,380,205,20,34,4,46
frame=0,3,345,103,24,33,5,45
frame=0,4,120,355,25,32,5,44
frame=0,5,400,203,23,32,5,44
frame=0,6,217,340,20,33,5,44
frame=0,7,204,276,22,33,7,44
frame=1,0,422,235,23,31,8,43
frame=1,1,445,233,22,32,7,44
frame=1,2,279,308,19,33,4,45
frame=1,3,400,267,22,32,4,44
frame=1,4,438,104,24,32,4,43
frame=1,5,356,297,22,30,5,42
frame=1,6,298,307,19,32,5,43
frame=1,7,299,339,21,32,7,43


fileFormatVersion: 2
guid: 54652b527b15d954a8fa1f484df14e55
timeCreated: 1445081763
licenseType: Free
TextureImporter:
  fileIDToRecycleName: {}
  serializedVersion: 2
  mipmaps:
    mipMapMode: 0
    enableMipMap: 0
    linearTexture: 1
    correctGamma: 0
    fadeOut: 0
    borderMipMap: 0
    mipMapFadeDistanceStart: 1
    mipMapFadeDistanceEnd: 3
  bumpmap:
    convertToNormalMap: 0
    externalNormalMap: 0
    heightScale: 0.25
    normalMapFilter: 0
  isReadable: 0
  grayScaleToAlpha: 0
  generateCubemap: 0
  cubemapConvolution: 0
  cubemapConvolutionSteps: 4
  cubemapConvolutionExponent: 1.5
  seamlessCubemap: 0
  textureFormat: -3
  maxTextureSize: 2048
  textureSettings:
    filterMode: -1
    aniso: 1
    mipBias: -1
    wrapMode: 1
  nPOTScale: 0
  lightmap: 0
  rGBM: 0
  compressionQuality: 50
  allowsAlphaSplitting: 0
  spriteMode: 0
  spriteExtrude: 1
  spriteMeshType: 1
  alignment: 0
  spritePivot: {x: 0.5, y: 0.5}
  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
  spritePixelsToUnits: 100
  alphaIsTransparency: 1
  textureType: 2
  buildTargetSettings: []
  spriteSheet:
    sprites: []
    outline: []
  spritePackingTag:
  userData:
  assetBundleName:
  assetBundleVariant:


// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows

package socket

import (
	"errors"
	"net"
	"runtime"
	"unsafe"
)

const (
	sysAF_UNSPEC = 0x0
	sysAF_INET   = 0x2
	sysAF_INET6  = 0xa

	sysSOCK_RAW = 0x3
)

func probeProtocolStack() int {
	switch runtime.GOARCH {
	case "amd64p32", "mips64p32":
		return 4
	default:
		var p uintptr
		return int(unsafe.Sizeof(p))
	}
}

func marshalInetAddr(ip net.IP, port int, zone string) []byte {
	return nil
}

func parseInetAddr(b []byte, network string) (net.Addr, error) {
	return nil, errors.New("not implemented")
}

func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
	return 0, errors.New("not implemented")
}

func setsockopt(s uintptr, level, name int, b []byte) error {
	return errors.New("not implemented")
}

func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
	return 0, errors.New("not implemented")
}

func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
	return 0, errors.New("not implemented")
}

func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
	return 0, errors.New("not implemented")
}

func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
	return 0, errors.New("not implemented")
}


/*
    Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file

    This file is part of 0MQ.

    0MQ is free software; you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    0MQ is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "testutil.hpp"

int main (void)
{
    setup_test_environment();
    //  Create the infrastructure
    void *ctx = zmq_ctx_new ();
    assert (ctx);

    void *sb = zmq_socket (ctx, ZMQ_ROUTER);
    assert (sb);

    int rc = zmq_bind (sb, "inproc://a");
    assert (rc == 0);

    void *sc = zmq_socket (ctx, ZMQ_DEALER);
    assert (sc);

    rc = zmq_connect (sc, "inproc://a");
    assert (rc == 0);

    //  Send 2-part message.
    rc = zmq_send (sc, "A", 1, ZMQ_SNDMORE);
    assert (rc == 1);
    rc = zmq_send (sc, "B", 1, 0);
    assert (rc == 1);

    //  Identity comes first.
    zmq_msg_t msg;
    rc = zmq_msg_init (&msg);
    assert (rc == 0);
    rc = zmq_msg_recv (&msg, sb, 0);
    assert (rc >= 0);
    int more = zmq_msg_more (&msg);
    assert (more == 1);

    //  Then the first part of the message body.
    rc = zmq_msg_recv (&msg, sb, 0);
    assert (rc == 1);
    more = zmq_msg_more (&msg);
    assert (more == 1);

    //  And finally, the second part of the message body.
    rc = zmq_msg_recv (&msg, sb, 0);
    assert (rc == 1);
    more = zmq_msg_more (&msg);
    assert (more == 0);

    //  Deallocate the infrastructure.
    rc = zmq_close (sc);
    assert (rc == 0);

    rc = zmq_close (sb);
    assert (rc == 0);

    rc = zmq_ctx_term (ctx);
    assert (rc == 0);
    return 0 ;
}


// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace Microsoft.Tools.WindowsInstallerXml
{
    using System;

    /// <summary>
    /// Msi Feature Information.
    /// </summary>
    internal class MsiFeature
    {
        public string Name { get; set; }
        public long Size { get; set; }
        public string Parent { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public int Display { get; set; }
        public int Level { get; set; }
        public string Directory { get; set; }
        public int Attributes { get; set; }
    }
}


<?php
include('loklak.php');

$baseURL = 'http://loklak.org';

$l = new Loklak($baseURL);

$lookupAccount = 'test';
$values = $l->account($lookupAccount);
$accountResponse = json_decode($values);
echo $accountResponse->body;

echo "

";

$arr = array('screen_name'=>'test', 'oauth_token'=>'thisisanoauthtoken', 'oauth_token_secret'=>'thisisasampleoauthsecret');

$values = $l->account('','update', $arr);
$accountResponse = json_decode($values);

echo $accountResponse->body;

?>


# Configure paths for libogg
# Jack Moffitt <jack@icecast.org> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh

dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
dnl
AC_DEFUN([XIPH_PATH_OGG],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(ogg,AC_HELP_STRING([--with-ogg=PFX],[Prefix where libogg is installed (optional)]), ogg_prefix="$withval", ogg_prefix="")
AC_ARG_WITH(ogg-libraries,AC_HELP_STRING([--with-ogg-libraries=DIR],[Directory where libogg library is installed (optional)]), ogg_libraries="$withval", ogg_libraries="")
AC_ARG_WITH(ogg-includes,AC_HELP_STRING([--with-ogg-includes=DIR],[Directory where libogg header files are installed (optional)]), ogg_includes="$withval", ogg_includes="")
AC_ARG_ENABLE(oggtest,AC_HELP_STRING([--disable-oggtest],[Do not try to compile and run a test Ogg program]),, enable_oggtest=yes)

  if test "x$ogg_libraries" != "x" ; then
    OGG_LIBS="-L$ogg_libraries"
  elif test "x$ogg_prefix" = "xno" || test "x$ogg_prefix" = "xyes" ; then
    OGG_LIBS=""
  elif test "x$ogg_prefix" != "x" ; then
    OGG_LIBS="-L$ogg_prefix/lib"
  elif test "x$prefix" != "xNONE" ; then
    OGG_LIBS="-L$prefix/lib"
  fi

  if test "x$ogg_prefix" != "xno" ; then
    OGG_LIBS="$OGG_LIBS -logg"
  fi

  if test "x$ogg_includes" != "x" ; then
    OGG_CFLAGS="-I$ogg_includes"
  elif test "x$ogg_prefix" = "xno" || test "x$ogg_prefix" = "xyes" ; then
    OGG_CFLAGS=""
  elif test "x$ogg_prefix" != "x" ; then
    OGG_CFLAGS="-I$ogg_prefix/include"
  elif test "x$prefix" != "xNONE"; then
    OGG_CFLAGS="-I$prefix/include"
  fi

  AC_MSG_CHECKING(for Ogg)
  if test "x$ogg_prefix" = "xno" ; then
    no_ogg="disabled"
    enable_oggtest="no"
  else
    no_ogg=""
  fi

  if test "x$enable_oggtest" = "xyes" ; then
    ac_save_CFLAGS="$CFLAGS"
    ac_save_LIBS="$LIBS"
    CFLAGS="$CFLAGS $OGG_CFLAGS"
    LIBS="$LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Ogg is sufficiently new.
dnl
      rm -f conf.oggtest
      AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ogg/ogg.h>

int main ()
{
  system("touch conf.oggtest");
  return 0;
}

],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
       CFLAGS="$ac_save_CFLAGS"
       LIBS="$ac_save_LIBS"
  fi

  if test "x$no_ogg" = "xdisabled" ; then
     AC_MSG_RESULT(no)
     ifelse([$2], , :, [$2])
  elif test "x$no_ogg" = "x" ; then
     AC_MSG_RESULT(yes)
     ifelse([$1], , :, [$1])
  else
     AC_MSG_RESULT(no)
     if test -f conf.oggtest ; then
       :
     else
       echo "*** Could not run Ogg test program, checking why..."
       CFLAGS="$CFLAGS $OGG_CFLAGS"
       LIBS="$LIBS $OGG_LIBS"
       AC_TRY_LINK([
#include <stdio.h>
#include <ogg/ogg.h>
],     [ return 0; ],
       [ echo "*** The test program compiled, but did not run. This usually means"
       echo "*** that the run-time linker is not finding Ogg or finding the wrong"
       echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
       echo "*** is required on your system"
       echo "***"
       echo "*** If you have an old version installed, it is best to remove it, although"
       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
       [ echo "*** The test program failed to compile or link. See the file config.log for the"
       echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
       echo "*** or that you have moved Ogg since it was installed." ])
       CFLAGS="$ac_save_CFLAGS"
       LIBS="$ac_save_LIBS"
     fi
     OGG_CFLAGS=""
     OGG_LIBS=""
     ifelse([$2], , :, [$2])
  fi
  AC_SUBST(OGG_CFLAGS)
  AC_SUBST(OGG_LIBS)
  rm -f conf.oggtest
])


agents:
-   goal: [4, 5]
    name: agent0
    start: [3, 5]
-   goal: [5, 1]
    name: agent1
    start: [7, 1]
-   goal: [5, 0]
    name: agent2
    start: [7, 7]
map:
    dimensions: [8, 8]
    obstacles:
    - [6, 6]
    - [6, 2]
    - [4, 1]
    - [1, 4]
    - [4, 2]
    - [0, 3]
    - [5, 5]
    - [4, 0]
    - [1, 5]
    - [2, 7]
    - [4, 4]
    - [0, 4]


--BSC

  ZYNQ is defined for the following platforms: [zc702,zedboard]
  PCIE is defined for the following platforms: [ac701, kc705, vc707]
  SIMULATION is defined for the following platforms: [bsim, bsim_pcie]

--CPP

  ZYNQ is defined for the following platforms: [zedboard, zc702]


/*
Copyright 2018 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ExecCredential is used by exec-based plugins to communicate credentials to
// HTTP transports.
type ExecCredential struct {
	metav1.TypeMeta `json:",inline"`

	// Spec holds information passed to the plugin by the transport. This contains
	// request and runtime specific information, such as if the session is interactive.
	Spec ExecCredentialSpec `json:"spec,omitempty"`

	// Status is filled in by the plugin and holds the credentials that the transport
	// should use to contact the API.
	// +optional
	Status *ExecCredentialStatus `json:"status,omitempty"`
}

// ExecCredenitalSpec holds request and runtime specific information provided by
// the transport.
type ExecCredentialSpec struct {
	// Response is populated when the transport encounters HTTP status codes, such as 401,
	// suggesting previous credentials were invalid.
	// +optional
	Response *Response `json:"response,omitempty"`

	// Interactive is true when the transport detects the command is being called from an
	// interactive prompt.
	// +optional
	Interactive bool `json:"interactive,omitempty"`
}

// ExecCredentialStatus holds credentials for the transport to use.
//
// Token and ClientKeyData are sensitive fields. This data should only be
// transmitted in-memory between client and exec plugin process. Exec plugin
// itself should at least be protected via file permissions.
type ExecCredentialStatus struct {
	// ExpirationTimestamp indicates a time when the provided credentials expire.
	// +optional
	ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"`
	// Token is a bearer token used by the client for request authentication.
	Token string `json:"token,omitempty"`
	// PEM-encoded client TLS certificates (including intermediates, if any).
	ClientCertificateData string `json:"clientCertificateData,omitempty"`
	// PEM-encoded private key for the above certificate.
	ClientKeyData string `json:"clientKeyData,omitempty"`
}

// Response defines metadata about a failed request, including HTTP status code and
// response headers.
type Response struct {
	// Header holds HTTP headers returned by the server.
	Header map[string][]string `json:"header,omitempty"`
	// Code is the HTTP status code returned by the server.
	Code int32 `json:"code,omitempty"`
}


LMO is a simple binary format to pack language strings into a more efficient form. Although it's suitable to store any kind of key-value table, it's only used for the LuCI *.po based translation system at the moment. The abbreviation "LMO" stands for "Lua Machine Objects" in the style of the GNU gettext *.mo format.

# Format Specification

A LMO file is divided into two parts: the payload and the index lookup table.
All segments of the file are 4 Byte aligned to ease reading and processing of the format.
Only unsigned 32bit integers are used and stored in network byte order, so an implementation has to use htonl() to properly read them.

Schema:

	<file:
	  <payload:
	    <entry #1: 4 byte aligned data>

	    <entry #2: 4 byte aligned data>

	    ...

	    <entry #N: 4 byte aligned data>
	  >

	  <index table:
	    <entry #1:
	      <uint32_t: hash of the first key>
	      <uint32_t: hash of the first value>
	      <uint32_t: file offset of the first value>
	      <uint32_t: length of the first value>
	    >

	    <entry #2:
	      <uint32_t: hash of the second key>
	      <uint32_t: hash of the second value>
	      <uint32_t: file offset of the second value>
	      <uint32_t: length of the second value>
	    >

	    ...

	    <entry #N:
	      <uint32_t: hash of the Nth key>
	      <uint32_t: hash of the Nth value>
	      <uint32_t: file offset of the Nth value>
	      <uint32_t: length of the Nth value>
	    >
	  >

	  <uint32_t: offset of the begin of index table>
	>

# Processing

In order to process a LMO file, an implementation would have to do the following steps:

## Read Index

1. Locate and open the archive file
1. Seek to end of file - 4 bytes (sizeof(uint32_t))
1. Read 32bit index offset and swap from network to native byte order
1. Seek to index offset, calculate index length: filesize - index offset - 4
1. Initialize a linked list for index table entries
1. Read each index entry until the index length is reached, read and byteswap 4 * uint32_t for each step
1. Seek to begin of file

## Read Entry

1. Calculate the unsigned 32bit hash of the entries key value (see "Hash Function" section below)
1. Obtain the archive index
1. Iterate through the linked index list, perform the following steps for each entry:
  1. Compare the entry hash value with the calculated hash from step 1
  2. If the hash values are equal proceed with step 4
  3. Select the next entry and repeat from step 3.1
1. Seek to the file offset specified in the selected entry
1. Read as much bytes as specified in the entry length into a buffer
1. Return the buffer value

# Hash Function

The current LuCI-LMO implementation uses the "Super Fast Hash" function which was kindly put in the public domain by it's original author. See http://www.azillionmonkeys.com/qed/hash.html for details. Below is the C-Implementation of this function:

	#if (defined(__GNUC__) && defined(__i386__))
	#define sfh_get16(d) (*((const uint16_t *) (d)))
	#else
	#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
						   +(uint32_t)(((const uint8_t *)(d))[0]) )
	#endif

	uint32_t sfh_hash(const char * data, int len)
	{
		uint32_t hash = len, tmp;
		int rem;

		if (len <= NULL) return 0;

		rem = len & 3;
		len >>= 2;

		/* Main loop */
		for (;len > 0; len--) {
			hash  += sfh_get16(data);
			tmp    = (sfh_get16(data+2) << 11) ^ hash;
			hash   = (hash << 16) ^ tmp;
			data  += 2*sizeof(uint16_t);
			hash  += hash >> 11;
		}

		/* Handle end cases */
		switch (rem) {
			case 3: hash += sfh_get16(data);
				hash ^= hash << 16;
				hash ^= data[sizeof(uint16_t)] << 18;
				hash += hash >> 11;
				break;
			case 2: hash += sfh_get16(data);
				hash ^= hash << 11;
				hash += hash >> 17;
				break;
			case 1: hash += *data;
				hash ^= hash << 10;
				hash += hash >> 1;
		}

		/* Force "avalanching" of final 127 bits */
		hash ^= hash << 3;
		hash += hash >> 5;
		hash ^= hash << 4;
		hash += hash >> 17;
		hash ^= hash << 25;
		hash += hash >> 6;

		return hash;
	}

# Reference Implementation

A reference implementation can be found here:
http://luci.subsignal.org/trac/browser/luci/trunk/libs/lmo/src

The lmo_po2lmo.c executable implements a *.po to *.lmo conversation utility and lmo_lookup.c is a simple *.lmo test utility.
Lua bindings for lmo are defined in lmo_lualib.c and associated headers.


--TEST--
Basic cursor test repetandly
--FILE--
<?php

use php\util\Flow;

$arr = [1,2];
$cur = Flow::of($arr);

var_dump($cur->count());

try {
    var_dump($cur->count());
} catch (Exception $e) {
    var_dump($e->getMessage());
}

?>
--EXPECT--
int(2)
string(37) "Unable to iterate the flow repeatedly"


import Panel from "./panel"
export default Panel


# -*- mode: ruby -*-
# vi: set ft=ruby :

# Specify minimum Vagrant version and Vagrant API version
Vagrant.require_version '>= 1.6.0'
VAGRANTFILE_API_VERSION = '2'

# Require 'yaml' module
require 'yaml'

# Read YAML file with VM details (box, CPU, RAM, IP addresses)
# Edit machines.yml to change VM configuration details
machines = YAML.load_file(File.join(File.dirname(__FILE__), 'machines.yml'))

# Create and configure the VMs
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  # Always use Vagrant's default insecure key
  config.ssh.insert_key = false

  # Iterate through entries in YAML file to create VMs
  machines.each do |machine|

    # Configure the VMs per details in machines.yml
    config.vm.define machine['name'] do |srv|

      # Don't check for box updates
      srv.vm.box_check_update = false

      # Specify the hostname of the VM
      srv.vm.hostname = machine['name']

      # Specify the Vagrant box to use (use VMware box by default)
      srv.vm.box = machine['box']['vmw']

      # Configure default synced folder (disable by default)
      if machine['sync_disabled'] != nil
        srv.vm.synced_folder '.', '/vagrant', disabled: machine['sync_disabled']
      else
        srv.vm.synced_folder '.', '/vagrant', disabled: true
      end #if machine['sync_disabled']

      # Assign additional private network
      if machine['ip_addr'] != nil
        srv.vm.network 'private_network', ip: machine['ip_addr']
      end # if machine['ip_addr']

      # Configure CPU & RAM per settings in machines.yml (Fusion)
      srv.vm.provider 'vmware_fusion' do |vmw|
        vmw.vmx['memsize'] = machine['ram']
        vmw.vmx['numvcpus'] = machine['vcpu']
        if machine['nested'] == true
          vmw.vmx['vhv.enable'] = 'TRUE'
        end #if machine['nested']
      end # srv.vm.provider 'vmware_fusion'

      # Configure CPU & RAM per settings in machines.yml (VirtualBox)
      srv.vm.provider 'virtualbox' do |vb, override|
        vb.memory = machine['ram']
        vb.cpus = machine['vcpu']
        override.vm.box = machine['box']['vb']
      end # srv.vm.provider 'virtualbox'
    end # config.vm.define
  end # machines.each
end # Vagrant.configure


// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`validation multipleOfFactorCreator should return an error message if input value is not a multiple of base value 1`] = `"Value must be a multiple of 7."`;

exports[`validation multipleOfFactorCreator should return an error message if input value is not a multiple of base value 2`] = `"Value must be a multiple of 7."`;


import requests
requests.adapters.DEFAULT_RETRIES = 10
import time
import re
from ..configurations import config
from multiprocessing.pool import ThreadPool
from multiprocessing import Pool
from functools import wraps
from requests.exceptions import Timeout
from requests.exceptions import ConnectionError
import json

def pro_only(func):
    @wraps(func)
    def check_apikey(*arg,**kargs):
        print(config.apikey)
        if config.apikey is None:
            config.logger.critical("{} 仅仅支持 smoothnlp pro 版本. 请联系contact@smoothnlp.com 获得license".format(func.__name__))
            raise ValueError("{} is a pro only function. set coorect apikey or email contact@smoothnlp.com to get a pro license".format(func.__name__))
        return func(*arg,**kargs)
    return check_apikey()

def _request_single(text, path, counter=0, max_size_limit=200, other_params:dict = {}):
    if len(text) > max_size_limit:
        raise ValueError(
            "text with size over 200 is prohibited. you may use smoothnlp.nlp.split2sentences as preprocessing")
    if counter > 99:
        raise Exception(
            " exceed maximal attemps for parsing. ")
    if config.apikey is not None and isinstance(config.apikey,str):   ## pro 版本支持 apikey 调用
        other_params['apikey'] = config.apikey
    content = {"text": text,**other_params}
    try:
        r = requests.get(config.HOST + path, params=content,timeout=120)
    except (Timeout) as e:
        config.logger.critical(str(e))
        return None
    except (ConnectionError) as e:
        config.logger.warn(str(e))
        time.sleep(0.5)  ## 延迟50毫秒再调用
        counter += 10
        return
    config.logger.debug("sending request to {} with parameter={}".format(config.HOST + path,content))
    try:
        result = r.json()
    except (json.decoder.JSONDecodeError,Exception) as e:
        print(e)
        print(r.text)
        counter +=3
        return _request_single(text, path=path, counter=counter, max_size_limit=max_size_limit)
    if r.status_code==429:  ## qps超限制
        counter += 1
        config.logger.debug("Request QPS exceeds server limit")
        config.logger.info("Request has been tried for {} times".format(counter))
        time.sleep(0.05)  ## 延迟50毫秒再调用
        return _request_single(text, path=path, counter=counter, max_size_limit=max_size_limit)
    elif isinstance(result, dict) and "payload" in result:
        response = result['payload']['response']
        return response
    else:
        raise Exception(r.text)

def _request_concurent(texts:list,path,max_size_limit=200,other_params:dict = {}):
    if config.POOL_TYPE=="process":
        pool = Pool(config.NUM_THREADS)
    else:
        pool = ThreadPool(config.NUM_THREADS)
    params = [(text,path,0,max_size_limit,other_params) for text in texts]
    result = pool.starmap(_request_single,params)
    pool.close()
    return result

def _request(text, path = config.NLP_PATH, max_size_limit=500, other_params:dict = {}):
    if isinstance(text,list):
        config.logger.info(
            "request parameter: NUM_THREAD = {}, POOL_TYPE = {}".format(config.NUM_THREADS, config.POOL_TYPE))
        return _request_concurent(text,path,max_size_limit,other_params)
    elif isinstance(text,str):
        return _request_single(text,path = path,counter=0,max_size_limit=max_size_limit,other_params=other_params)
    elif isinstance(text,dict):
        return text
    else:
        TypeError(" Unsupported Type of text input")

def extract_meta(meta,key):
    if isinstance(meta,dict):
        return meta[key]
    elif isinstance(meta,list):
        return [m[key] for m in meta]
    else:
        raise ValueError("Meta Extraction Failure")

class SmoothNLPClient(object):
    def __init__(self):
        pass

    def dependencyrelationships(self,text):
        """
        依存句法分析
        :param text:
        :return:
        """
        result = _request(text)
        return extract_meta(result,"dependencyRelationships")

    def ner(self,text):
        """
        实体识别
        :param text:
        :return:
        """
        result = _request(text,path=config.NLP_PATH)
        return extract_meta(result,"entities")

    def number_recognize(self,text):
        """
        将在smoothnlp V0.3.1 中deprecate
        :param text:
        :return:
        """
        entities = self.ner(text)
        if entities is None :
            return
        numbers = []
        for entity in entities:
            if entity['nerTag'].lower() == "number":
                numbers.append(entity)
        return numbers

    def money_recognize(self,text):
        """
        将在smoothnlp V0.3.1 中deprecate
        :param text:
        :return:
        """
        entities = self.ner(text)
        if entities is None :
            return
        money = []
        for entity in entities:
            if entity['nerTag'].lower() == "money":
                money.append(entity)
        return money

    def company_recognize(self, text):
        """
        将在smoothnlp V0.3.1 中deprecate
        :param text:
        :return:
        """
        entities = self.ner(text)
        if entities is None:
            return
        financial_agency = []
        for entity in entities:
            if entity['nerTag'].lower() in {"company_name","gs"}:
                financial_agency.append(entity)
        return financial_agency

    def segment(self,text):
        """
        切词
        :param text:
        :return:
        """
        result = _request(text,path=config.NLP_PATH)
        tokens = extract_meta(result, "tokens")
        if tokens is None or text is None:
            return []
        elif isinstance(text,str) or isinstance(text,dict):
            tokens = [v['token']for v in tokens]
        else:
            tokens = [[v['token']for v in token_set] for token_set in tokens]
        return tokens

    def postag(self,text):
        """
        词性标注
        :param text:
        :return:
        """
        result = _request(text,path=config.NLP_PATH)
        tokens = extract_meta(result, "tokens")
        return tokens

    def analyze(self, text):
        return _request(text,path=config.NLP_PATH)

    def parseq(self, text, parseq_url = "/pro/kg/parseq"):
        return _request(text, path= parseq_url)

    def process_corpus(self,corpus,path):
        return _request(text = corpus, path = path, max_size_limit = 999999)

    def parse_date(self,givendate,pubdate=None):
        """
        (根据绝对日期) , 解析日期对应的真实日期范围
        :param givendate:
        :param pubdate:
        :return:
        """
        parameters = {"givendate": givendate}
        if pubdate is not None or pubdate != "":
            parameters['pubdate'] = pubdate
        r = requests.get(config.HOST+'/querydate', params=parameters)
        return r.json()['payload']['response']

    def split2sentences(self,text:str):
        """
        依据标点正则切句
        :param text:
        :return:
        """
        split_pattern = "(.+?[。!?！？；;……\n\r]+)"
        return [s.strip() for s in re.split(split_pattern,text) if s]

nlp = SmoothNLPClient()


; RUN: llc  -march=mipsel -mcpu=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16

@kkkk = global i32 67, align 4
@llll = global i32 33, align 4
@mmmm = global i32 44, align 4
@nnnn = global i32 55, align 4
@oooo = global i32 32, align 4
@pppp = global i32 41, align 4
@qqqq = global i32 59, align 4
@rrrr = global i32 60, align 4
@.str = private unnamed_addr constant [32 x i8] c"%i %i %i %i %i %i %i %i %i %i \0A\00", align 1

define i32 @main() nounwind {
entry:
  %0 = load i32* @kkkk, align 4
  %1 = load i32* @llll, align 4
  %add = add nsw i32 %0, 10
  %add1 = add nsw i32 %1, 10
  %2 = load i32* @mmmm, align 4
  %sub = add nsw i32 %2, -3
  %3 = load i32* @nnnn, align 4
  %add2 = add nsw i32 %3, 10
  %4 = load i32* @oooo, align 4
  %add3 = add nsw i32 %4, 4
  %5 = load i32* @pppp, align 4
  %sub4 = add nsw i32 %5, -5
  %6 = load i32* @qqqq, align 4
  %sub5 = add nsw i32 %6, -10
  %7 = load i32* @rrrr, align 4
  %add6 = add nsw i32 %7, 6

  %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([32 x i8]* @.str, i32 0, i32 0), i32 %sub5, i32 %add6, i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) nounwind
  %call7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([32 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i32 %add, i32 %add1, i32 %sub, i32 %add2, i32 %add3, i32 %sub4, i32 %sub5, i32 %add6) nounwind
  ret i32 0
}
; 16:	sw	${{[0-9]+}}, {{[0-9]+}} ( $sp );         # 4-byte Folded Spill
; 16:	lw	${{[0-9]+}}, {{[0-9]+}} ( $sp );         # 4-byte Folded Reload
; 16:	sw	${{[0-9]+}}, {{[0-9]+}} ( $sp );         # 4-byte Folded Spill
; 16:	lw	${{[0-9]+}}, {{[0-9]+}} ( $sp );         # 4-byte Folded Reload

declare i32 @printf(i8* nocapture, ...) nounwind


//Siege class def file.

ClassInfo
{
	name			"Jedi Hunter"
	weapons			WP_BLASTER_PISTOL|WP_BLASTER|WP_FLECHETTE
	forcepowers		0
	maxhealth		100
	maxarmor		100
	startarmor		0
	class_shader	"gfx/mp/c_icon_infantry"
	model			"swamptrooper" 					//this is optional, if it's here it forces the model to this.
	skin			"default"					//this is optional, if it's here it forces the skin to this.
	uishader		"models/players/swamptrooper/icon_default"
	holdables		HI_YSALIMIRI
	speed			1.25
}

description	"@SIEGE_INF_JEDI_HUNTER"


/*******************************************************************************
*                                 AMetal
*                       ----------------------------
*                       innovating embedded platform
*
* Copyright (c) 2001-2018 Guangzhou ZHIYUAN Electronics Co., Ltd.
* All rights reserved.
*
* Contact information:
* web site:    http://www.zlg.cn/
*******************************************************************************/

/**
 * \file
 * \brief 后门安全访问flash例程
 *
 * - 实验现象：
 *   1. 串口打印出提示信息 Please input Verify BackdoorAccess Key!
 *   2. 当 Verify BackdoorAccess Key 不匹配时，串口输出 Verify BackdoorAccess Key Fail!
 *   3. 密钥匹配可以读出flash的内容，SWD调试口开放，LED闪烁
 *
 * - 操作步骤
 *   1. 如果是在eclipse下编译则将am_kl26_gcc_vector中的宏AM_KL26_FLASH_SEC_BACKDOOR打开，
 *      如果是在keil下编译则将am_kl26_armcc_startup.s中FSEC的值改为0x82（大约在第225行）。
 *   2. 当串口输出提示信息时，在字符串模式下发送43218765。
 *
 * \note: 后门安全密钥是通过flash config配置段的 gFlashConfig 这一个变量前8个字节的内容决定，请
 *        用户谨慎操作这个demo，以免锁死芯片
 *
 * \par 源代码
 * \snippet demo_fsl_hw_backdoor_sec.c src_fsl_hw_backdoor_sec
 *
 * \internal
 * \par Modification history
 * - 1.00 16-09-20  sdy, first implementation.
 * \endinternal
 */

/**
 * \addtogroup demo_fsl_if_hw_backdoor_sec
 * \copydoc demo_fsl_hw_backdoor_sec.c
 */

/** [src_fsl_hw_backdoor_sec] */
#include "ametal.h"
#include "am_int.h"
#include "am_vdebug.h"
#include "hw/amhw_fsl_ftfa.h"
#include "am_board.h"
#include "demo_fsl_entrys.h"

/** \brief 后门安全密钥 */
uint8_t backdoor_accesskey[8];

/**
 * \brief 例程入口
 */
void demo_fsl_hw_backdoor_sec_entry (amhw_fsl_ftfa_t *p_hw_ftfa,
                                     am_uart_handle_t uart_handle)
{
    uint8_t key = 0;
    int32_t ret = 0;
    int i = 0;

    AM_DBG_INFO("Please input BackdoorAccess Key!\r\n");

    /* 接收字符 */
    am_uart_poll_receive(uart_handle, backdoor_accesskey, sizeof(backdoor_accesskey));

    AM_DBG_INFO("BackdoorAccess Key is:\r\n ");

    for (i = 0; i < 8; i++) {
        AM_DBG_INFO("0x%x  ", backdoor_accesskey[i]);
    }

    AM_DBG_INFO("\r\n");

    /* 使能FLASH忙延时等待 */
   // amhw_kl26_mcm_flash_stalling_enable(KL26_MCM);

    key = am_int_cpu_lock();
    /** 将flash命令执行函数拷贝到RAM */
    amhw_fsl_ftfa_func_copy();
    am_int_cpu_unlock (key);

    key = am_int_cpu_lock();
    /* 将flash命令执行函数拷贝到RAM */
    ret = amhw_fsl_ftfa_backdoor_access_key_verify(p_hw_ftfa, backdoor_accesskey);
    am_int_cpu_unlock (key);

    if (ret != 0) {
        AM_DBG_INFO(" Verify BackdoorAccess Key Fail!\r\n");
        while(1);
    }

    while (1) {

        am_led_toggle(LED0);
        am_mdelay(200);
    }
}

/** [src_fsl_hw_backdoor_sec] */

/* end of file */


/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/

#include <QtGui>
#include "window.h"

Window::Window(QWidget *parent)
    : QWidget(parent)
{
    QFont font;
    font.setPixelSize(12);
    setFont(font);
}

void Window::closeEvent(QCloseEvent *event)
{
    QPixmap pixmap(size());
    render(&pixmap);
    pixmap.save("qt-colors.png");

    event->accept();
}

void Window::paintEvent(QPaintEvent *)
{
    QPainter painter;
    painter.begin(this);

    int h = 216 / 5;
    QRect r = QRect(0, 0, 160, h);
    painter.fillRect(r, Qt::white);
    painter.setPen(Qt::black);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("white"));
    r = QRect(0, h, 160, h);
    painter.fillRect(r, Qt::red);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("red"));
    r = QRect(0, h*2, 160, h);
    painter.fillRect(r, Qt::green);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("green"));
    r = QRect(0, h*3, 160, h);
    painter.fillRect(r, Qt::blue);
    painter.setPen(Qt::white);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("blue"));

    r = QRect(160, 0, 160, h);
    painter.fillRect(r, Qt::black);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("black"));
    r = QRect(160, h, 160, h);
    painter.fillRect(r, Qt::darkRed);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("darkRed"));
    r = QRect(160, h*2, 160, h);
    painter.fillRect(r, Qt::darkGreen);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("darkGreen"));
    r = QRect(160, h*3, 160, h);
    painter.fillRect(r, Qt::darkBlue);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("darkBlue"));

    r = QRect(320, 0, 160, h);
    painter.fillRect(r, Qt::cyan);
    painter.setPen(Qt::black);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("cyan"));
    r = QRect(320, h, 160, h);
    painter.fillRect(r, Qt::magenta);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("magenta"));
    r = QRect(320, h*2, 160, h);
    painter.fillRect(r, Qt::yellow);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("yellow"));
    r = QRect(320, h*3, 160, h);
    painter.fillRect(r, Qt::gray);
    painter.setPen(Qt::white);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("gray"));

    r = QRect(480, 0, 160, h);
    painter.fillRect(r, Qt::darkCyan);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("darkCyan"));
    r = QRect(480, h, 160, h);
    painter.fillRect(r, Qt::darkMagenta);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("darkMagenta"));
    r = QRect(480, h*2, 160, h);
    painter.fillRect(r, Qt::darkYellow);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("darkYellow"));
    r = QRect(480, h*3, 160, h);
    painter.fillRect(r, Qt::darkGray);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("darkGray"));

    r = QRect(0, h*4, 640, h);
    painter.fillRect(r, Qt::lightGray);
    painter.setPen(Qt::black);
    painter.drawText(r, Qt::AlignCenter, QLatin1String("lightGray"));

    painter.end();
}


# This file is distributed under the same license as the Django package.
#
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-03-15 13:17-0400\n"
"PO-Revision-Date: 2011-03-04 18:46+0000\n"
"Last-Translator: Jannis <jannis@leidel.info>\n"
"Language-Team: Polish <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2)\n"

#: db/models/fields.py:50
msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type."
msgstr ""
"Podstawowe pole GIS - odpowiada typowi Geometry w specyfikacji OpenGIS."

#: db/models/fields.py:270
msgid "Point"
msgstr "Punkt"

#: db/models/fields.py:274
msgid "Line string"
msgstr "Ścieżka"

#: db/models/fields.py:278
msgid "Polygon"
msgstr "Wielokąt"

#: db/models/fields.py:282
msgid "Multi-point"
msgstr "Zbiór punktów"

#: db/models/fields.py:286
msgid "Multi-line string"
msgstr "Zbiór ścieżek"

#: db/models/fields.py:290
msgid "Multi polygon"
msgstr "Zbiór wielokątów"

#: db/models/fields.py:294
msgid "Geometry collection"
msgstr "Zbiór geometrii"

#: forms/fields.py:17
msgid "No geometry value provided."
msgstr "Brak wartości geometrii."

#: forms/fields.py:18
msgid "Invalid geometry value."
msgstr "Błędna wartość geometrii."

#: forms/fields.py:19
msgid "Invalid geometry type."
msgstr "Błędny typ geometrii."

#: forms/fields.py:20
msgid ""
"An error occurred when transforming the geometry to the SRID of the geometry "
"form field."
msgstr ""
"Wystąpił błąd podczas przekształcania geometrii do SRID pola formularza "
"geometrii."


package feature

import (
	"github.com/short-d/short/backend/app/entity"
	"github.com/short-d/short/backend/app/usecase/authorizer"
	"github.com/short-d/short/backend/app/usecase/instrumentation"
)

var _ DecisionMaker = (*StaticDecisionMaker)(nil)

// StaticDecisionMaker makes feature decisions based on hardcoded values.
type StaticDecisionMaker struct {
	instrumentation    instrumentation.Instrumentation
	decisions          map[string]bool
	permissionCheckers map[PermissionToggle]PermissionChecker
}

// IsFeatureEnable determines whether a feature is enabled given featureID.
func (s StaticDecisionMaker) IsFeatureEnable(featureID string, user *entity.User) bool {
	decision := s.makeDecision(featureID, user)
	s.instrumentation.MadeFeatureDecision(featureID, decision)
	return decision
}

func (s StaticDecisionMaker) makeDecision(featureID string, user *entity.User) bool {
	_, hasChecker := s.permissionCheckers[PermissionToggle(featureID)]
	if hasChecker {
		return s.makePermissionDecision(featureID, user)
	}

	isEnabled := s.decisions[featureID]
	return isEnabled
}

func (s StaticDecisionMaker) makePermissionDecision(featureID string, user *entity.User) bool {
	if user == nil {
		return false
	}

	isEnabled := s.decisions[featureID]
	if !isEnabled {
		return false
	}

	checker := s.permissionCheckers[PermissionToggle(featureID)]
	decision, err := checker(*user)
	if err != nil {
		return false
	}

	return decision
}

var _ DecisionMakerFactory = (*StaticDecisionMakerFactory)(nil)

// StaticDecisionMakerFactory creates static feature decision maker.
type StaticDecisionMakerFactory struct {
	authorizer authorizer.Authorizer
}

// NewDecision creates static feature decision maker with config map.
func (s StaticDecisionMakerFactory) NewDecision(
	instrumentation instrumentation.Instrumentation,
) DecisionMaker {
	permissionCheckers := map[PermissionToggle]PermissionChecker{
		AdminPanel: s.authorizer.CanViewAdminPanel,
	}
	return StaticDecisionMaker{
		instrumentation: instrumentation,
		decisions: map[string]bool{
			"change-log":               true,
			"facebook-sign-in":         true,
			"github-sign-in":           true,
			"google-sign-in":           true,
			"search-bar":               true,
			"user-short-links-section": true,
			"preference-toggles":       true,
			"admin-panel":              true,
		},
		permissionCheckers: permissionCheckers,
	}
}

// NewStaticDecisionMakerFactory creates StaticDecisionMakerFactory.
func NewStaticDecisionMakerFactory(authorizer authorizer.Authorizer) StaticDecisionMakerFactory {
	return StaticDecisionMakerFactory{
		authorizer: authorizer,
	}
}


/*
 * $Id: pa_ringbuffer.c 1574 2011-02-01 11:18:16Z rossb $
 * Portable Audio I/O Library
 * Ring Buffer utility.
 *
 * Author: Phil Burk, http://www.softsynth.com
 * modified for SMP safety on Mac OS X by Bjorn Roche
 * modified for SMP safety on Linux by Leland Lucius
 * also, allowed for const where possible
 * modified for multiple-byte-sized data elements by Sven Fischer
 *
 * Note that this is safe only for a single-thread reader and a
 * single-thread writer.
 *
 * This program uses the PortAudio Portable Audio Library.
 * For more information see: http://www.portaudio.com
 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files
 * (the "Software"), to deal in the Software without restriction,
 * including without limitation the rights to use, copy, modify, merge,
 * publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

/*
 * The text above constitutes the entire PortAudio license; however,
 * the PortAudio community also makes the following non-binding requests:
 *
 * Any person wishing to distribute modifications to the Software is
 * requested to send the modifications to the original developer so that
 * they can be incorporated into the canonical version. It is also
 * requested that these non-binding requests be included along with the
 * license above.
 */

/**
 @file
 @ingroup common_src
*/

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "pa_ringbuffer.h"
#include <string.h>
#include "pa_memorybarrier.h"

/***************************************************************************
 * Initialize FIFO.
 * elementCount must be power of 2, returns -1 if not.
 */
ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr )
{
    if( ((elementCount-1) & elementCount) != 0) return -1; /* Not Power of two. */
    rbuf->bufferSize = elementCount;
    rbuf->buffer = (char *)dataPtr;
    PaUtil_FlushRingBuffer( rbuf );
    rbuf->bigMask = (elementCount*2)-1;
    rbuf->smallMask = (elementCount)-1;
    rbuf->elementSizeBytes = elementSizeBytes;
    return 0;
}

/***************************************************************************
** Return number of elements available for reading. */
ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf )
{
    PaUtil_ReadMemoryBarrier();
    return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask );
}
/***************************************************************************
** Return number of elements available for writing. */
ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf )
{
    /* Since we are calling PaUtil_GetRingBufferReadAvailable, we don't need an aditional MB */
    return ( rbuf->bufferSize - PaUtil_GetRingBufferReadAvailable(rbuf));
}

/***************************************************************************
** Clear buffer. Should only be called when buffer is NOT being read or written. */
void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf )
{
    rbuf->writeIndex = rbuf->readIndex = 0;
}

/***************************************************************************
** Get address of region(s) to which we can write data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be written or elementCount, whichever is smaller.
*/
ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount,
                                       void **dataPtr1, ring_buffer_size_t *sizePtr1,
                                       void **dataPtr2, ring_buffer_size_t *sizePtr2 )
{
    ring_buffer_size_t   index;
    ring_buffer_size_t   available = PaUtil_GetRingBufferWriteAvailable( rbuf );
    if( elementCount > available ) elementCount = available;
    /* Check to see if write is not contiguous. */
    index = rbuf->writeIndex & rbuf->smallMask;
    if( (index + elementCount) > rbuf->bufferSize )
    {
        /* Write data in two blocks that wrap the buffer. */
        ring_buffer_size_t   firstHalf = rbuf->bufferSize - index;
        *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes];
        *sizePtr1 = firstHalf;
        *dataPtr2 = &rbuf->buffer[0];
        *sizePtr2 = elementCount - firstHalf;
    }
    else
    {
        *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes];
        *sizePtr1 = elementCount;
        *dataPtr2 = NULL;
        *sizePtr2 = 0;
    }
    return elementCount;
}

/***************************************************************************
*/
ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount )
{
    /* we need to ensure that previous writes are seen before we update the write index */
    PaUtil_WriteMemoryBarrier();
    return rbuf->writeIndex = (rbuf->writeIndex + elementCount) & rbuf->bigMask;
}

/***************************************************************************
** Get address of region(s) from which we can read data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be read or elementCount, whichever is smaller.
*/
ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount,
                                void **dataPtr1, ring_buffer_size_t *sizePtr1,
                                void **dataPtr2, ring_buffer_size_t *sizePtr2 )
{
    ring_buffer_size_t   index;
    ring_buffer_size_t   available = PaUtil_GetRingBufferReadAvailable( rbuf );
    if( elementCount > available ) elementCount = available;
    /* Check to see if read is not contiguous. */
    index = rbuf->readIndex & rbuf->smallMask;
    if( (index + elementCount) > rbuf->bufferSize )
    {
        /* Write data in two blocks that wrap the buffer. */
        ring_buffer_size_t firstHalf = rbuf->bufferSize - index;
        *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes];
        *sizePtr1 = firstHalf;
        *dataPtr2 = &rbuf->buffer[0];
        *sizePtr2 = elementCount - firstHalf;
    }
    else
    {
        *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes];
        *sizePtr1 = elementCount;
        *dataPtr2 = NULL;
        *sizePtr2 = 0;
    }
    return elementCount;
}
/***************************************************************************
*/
ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount )
{
    /* we need to ensure that previous writes are always seen before updating the index. */
    PaUtil_WriteMemoryBarrier();
    return rbuf->readIndex = (rbuf->readIndex + elementCount) & rbuf->bigMask;
}

/***************************************************************************
** Return elements written. */
ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount )
{
    ring_buffer_size_t size1, size2, numWritten;
    void *data1, *data2;
    numWritten = PaUtil_GetRingBufferWriteRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 );
    if( size2 > 0 )
    {

        memcpy( data1, data, size1*rbuf->elementSizeBytes );
        data = ((char *)data) + size1*rbuf->elementSizeBytes;
        memcpy( data2, data, size2*rbuf->elementSizeBytes );
    }
    else
    {
        memcpy( data1, data, size1*rbuf->elementSizeBytes );
    }
    PaUtil_AdvanceRingBufferWriteIndex( rbuf, numWritten );
    return numWritten;
}

/***************************************************************************
** Return elements read. */
ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount )
{
    ring_buffer_size_t size1, size2, numRead;
    void *data1, *data2;
    numRead = PaUtil_GetRingBufferReadRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 );
    if( size2 > 0 )
    {
        memcpy( data, data1, size1*rbuf->elementSizeBytes );
        data = ((char *)data) + size1*rbuf->elementSizeBytes;
        memcpy( data, data2, size2*rbuf->elementSizeBytes );
    }
    else
    {
        memcpy( data, data1, size1*rbuf->elementSizeBytes );
    }
    PaUtil_AdvanceRingBufferReadIndex( rbuf, numRead );
    return numRead;
}


Looking up Documentation for the Keyword Under the Cursor

Problem

You want to invoke an external command to lookup documentation for the
keyword underneath the cursor. For example, Linux users may like to read the
manual for the named command with the <tt>man</tt> utility.

Solution

Use <tt>:set keywordprg=<var>program</var></tt>, then hit K while hovering
over the word.

Discussion

This recipe calls the command specified with <tt>:set keywordprg</tt>,
passing the current wordword is used in the sense of a
  string that looks like a word to Vim; it is not necessarily a valid word in
  your language. as an argument. Thus, if <tt>keywordprg</tt> =
<tt>man</tt>, then hovering over the word ls and hitting K
would display the documentation for Linux's <tt>ls</tt> command.

When used with <tt>man</tt>, Vim translates a count for the K
command into a section number. So 7K over glob invokes
<tt>man 7 glob</tt> to display section 7 of the <tt>glob</tt>
documentation.

The Ruby programming language has a utility called <tt>ri</tt> that displays
documentation about the given Ruby method. The Perl programming language has a
similar command called <tt>perldoc</tt>. By setting <tt>keywordprg</tt>
appropriately, you can make context-sensitive documentation lookup
trivial.


// Copyright Peter Dimov 2001
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//

// Preprocessed version of "boost/mpl/aux_/basic_bind.hpp" header
// -- DO NOT modify by hand!

namespace boost { namespace mpl {

namespace aux {
template< bool >
struct resolve_arg_impl
{
    template<
          typename T, typename U1, typename U2, typename U3
        , typename U4, typename U5
        >
    struct result_
    {
        typedef T type;
    };
};

template<>
struct resolve_arg_impl<true>
{
    template<
          typename T, typename U1, typename U2, typename U3
        , typename U4, typename U5
        >
    struct result_
    {
        typedef typename apply_wrap5<
              T
            , U1, U2, U3, U4, U5
            >::type type;
    };
};

template< typename T > struct is_bind_template;

template<
      typename T, typename U1, typename U2, typename U3, typename U4
    , typename U5
    >
struct resolve_bind_arg
    : resolve_arg_impl< is_bind_template<T>::value >
            ::template result_< T,U1,U2,U3,U4,U5 >
{
};

template< int arity_ > struct bind_chooser;

aux::no_tag is_bind_helper(...);
template< typename T > aux::no_tag is_bind_helper(protect<T>*);

template<
      typename F, typename T1, typename T2, typename T3, typename T4
    , typename T5
    >
aux::yes_tag is_bind_helper(bind< F,T1,T2,T3,T4,T5 >*);

template< int N >
aux::yes_tag is_bind_helper(arg<N>*);

template< bool is_ref_  = true >
struct is_bind_template_impl
{
    template< typename T > struct result_
    {
        BOOST_STATIC_CONSTANT(bool, value  = false);
    };
};

template<>
struct is_bind_template_impl<false>
{
    template< typename T > struct result_
    {
        BOOST_STATIC_CONSTANT(bool, value =
              sizeof(aux::is_bind_helper(static_cast<T*>(0)))
                == sizeof(aux::yes_tag)
            );
    };
};

template< typename T > struct is_bind_template
    : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
        ::template result_<T>
{
};

} // namespace aux

template<
      typename F
    >
struct bind0
{
    template<
          typename U1 = na, typename U2 = na, typename U3 = na
        , typename U4 = na, typename U5 = na
        >
    struct apply
    {
     private:
        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;

     public:
        typedef typename apply_wrap0<
              f_
            >::type type;

    };
};

namespace aux {

template<
      typename F
    >
aux::yes_tag
is_bind_helper(bind0<F>*);

} // namespace aux

BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)

namespace aux {

template<>
struct bind_chooser<0>
{
    template<
          typename F, typename T1, typename T2, typename T3, typename T4
        , typename T5
        >
    struct result_
    {
        typedef bind0<F> type;
    };
};

} // namespace aux

template<
      typename F, typename T1
    >
struct bind1
{
    template<
          typename U1 = na, typename U2 = na, typename U3 = na
        , typename U4 = na, typename U5 = na
        >
    struct apply
    {
     private:
        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;

     public:
        typedef typename apply_wrap1<
              f_
            , typename t1::type
            >::type type;

    };
};

namespace aux {

template<
      typename F, typename T1
    >
aux::yes_tag
is_bind_helper(bind1< F,T1 >*);

} // namespace aux

BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)

namespace aux {

template<>
struct bind_chooser<1>
{
    template<
          typename F, typename T1, typename T2, typename T3, typename T4
        , typename T5
        >
    struct result_
    {
        typedef bind1< F,T1 > type;
    };
};

} // namespace aux

template<
      typename F, typename T1, typename T2
    >
struct bind2
{
    template<
          typename U1 = na, typename U2 = na, typename U3 = na
        , typename U4 = na, typename U5 = na
        >
    struct apply
    {
     private:
        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;

     public:
        typedef typename apply_wrap2<
              f_
            , typename t1::type, typename t2::type
            >::type type;

    };
};

namespace aux {

template<
      typename F, typename T1, typename T2
    >
aux::yes_tag
is_bind_helper(bind2< F,T1,T2 >*);

} // namespace aux

BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)

namespace aux {

template<>
struct bind_chooser<2>
{
    template<
          typename F, typename T1, typename T2, typename T3, typename T4
        , typename T5
        >
    struct result_
    {
        typedef bind2< F,T1,T2 > type;
    };
};

} // namespace aux

template<
      typename F, typename T1, typename T2, typename T3
    >
struct bind3
{
    template<
          typename U1 = na, typename U2 = na, typename U3 = na
        , typename U4 = na, typename U5 = na
        >
    struct apply
    {
     private:
        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;

     public:
        typedef typename apply_wrap3<
              f_
            , typename t1::type, typename t2::type, typename t3::type
            >::type type;

    };
};

namespace aux {

template<
      typename F, typename T1, typename T2, typename T3
    >
aux::yes_tag
is_bind_helper(bind3< F,T1,T2,T3 >*);

} // namespace aux

BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)

namespace aux {

template<>
struct bind_chooser<3>
{
    template<
          typename F, typename T1, typename T2, typename T3, typename T4
        , typename T5
        >
    struct result_
    {
        typedef bind3< F,T1,T2,T3 > type;
    };
};

} // namespace aux

template<
      typename F, typename T1, typename T2, typename T3, typename T4
    >
struct bind4
{
    template<
          typename U1 = na, typename U2 = na, typename U3 = na
        , typename U4 = na, typename U5 = na
        >
    struct apply
    {
     private:
        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
        typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;

     public:
        typedef typename apply_wrap4<
              f_
            , typename t1::type, typename t2::type, typename t3::type
            , typename t4::type
            >::type type;

    };
};

namespace aux {

template<
      typename F, typename T1, typename T2, typename T3, typename T4
    >
aux::yes_tag
is_bind_helper(bind4< F,T1,T2,T3,T4 >*);

} // namespace aux

BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)

namespace aux {

template<>
struct bind_chooser<4>
{
    template<
          typename F, typename T1, typename T2, typename T3, typename T4
        , typename T5
        >
    struct result_
    {
        typedef bind4< F,T1,T2,T3,T4 > type;
    };
};

} // namespace aux

template<
      typename F, typename T1, typename T2, typename T3, typename T4
    , typename T5
    >
struct bind5
{
    template<
          typename U1 = na, typename U2 = na, typename U3 = na
        , typename U4 = na, typename U5 = na
        >
    struct apply
    {
     private:
        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
        typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
        typedef aux::resolve_bind_arg< T5,U1,U2,U3,U4,U5 > t5;

     public:
        typedef typename apply_wrap5<
              f_
            , typename t1::type, typename t2::type, typename t3::type
            , typename t4::type, typename t5::type
            >::type type;

    };
};

namespace aux {

template<
      typename F, typename T1, typename T2, typename T3, typename T4
    , typename T5
    >
aux::yes_tag
is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*);

} // namespace aux

BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)

namespace aux {

template<>
struct bind_chooser<5>
{
    template<
          typename F, typename T1, typename T2, typename T3, typename T4
        , typename T5
        >
    struct result_
    {
        typedef bind5< F,T1,T2,T3,T4,T5 > type;
    };
};

} // namespace aux

namespace aux {

template< typename T >
struct is_bind_arg
{
    BOOST_STATIC_CONSTANT(bool, value  = true);
};

template<>
struct is_bind_arg<na>
{
    BOOST_STATIC_CONSTANT(bool, value  = false);
};

template<
      typename T1, typename T2, typename T3, typename T4, typename T5
    >
struct bind_count_args
{
    BOOST_STATIC_CONSTANT(int, value =
          is_bind_arg<T1>::value + is_bind_arg<T2>::value
        + is_bind_arg<T3>::value + is_bind_arg<T4>::value
        + is_bind_arg<T5>::value
        );

};

}

template<
      typename F, typename T1, typename T2, typename T3, typename T4
    , typename T5
    >
struct bind
    : aux::bind_chooser<
          aux::bind_count_args< T1,T2,T3,T4,T5 >::value
        >::template result_< F,T1,T2,T3,T4,T5 >::type
{
};

BOOST_MPL_AUX_ARITY_SPEC(
      6
    , bind
    )

BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
      6
    , bind
    )
}}


#include "script_component.hpp"
/*
 * Author: commy2
 *
 *
 * Arguments:
 * 0: Unknown <UNKNOWN>
 *
 * Return Value:
 * None
 *
 * Example:
 * [?] call ace_vector_fnc_showFallOfShot
 *
 * Public: No
 */

GVAR(FOSState) = _this select 0;

disableSerialization;
private _dlgVector = GETUVAR(ACE_dlgVector,displayNull);

private _fosData = GVAR(FOSData);

if !(_this select 0) then {
    // of ordinate
    private _digits = [_fosData, 1] call FUNC(convertToTexturesFOS);

    (_dlgVector displayCtrl IDC_DIGIT_0) ctrlSetText (_digits select 0);
    (_dlgVector displayCtrl IDC_DIGIT_1) ctrlSetText (_digits select 1);
    (_dlgVector displayCtrl IDC_DIGIT_2) ctrlSetText (_digits select 2);
    (_dlgVector displayCtrl IDC_DIGIT_3) ctrlSetText (_digits select 3);
    (_dlgVector displayCtrl IDC_DIGIT_4) ctrlSetText (_digits select 4);

    // of abscissa
    _digits = [_fosData, 0] call FUNC(convertToTexturesFOS);

    (_dlgVector displayCtrl IDC_DIGIT_5) ctrlSetText (_digits select 0);
    (_dlgVector displayCtrl IDC_DIGIT_6) ctrlSetText (_digits select 1);
    (_dlgVector displayCtrl IDC_DIGIT_7) ctrlSetText (_digits select 2);
    (_dlgVector displayCtrl IDC_DIGIT_8) ctrlSetText (_digits select 3);
    (_dlgVector displayCtrl IDC_DIGIT_9) ctrlSetText (_digits select 4);

} else {
    // applicate
    private _digits = [_fosData, 2] call FUNC(convertToTexturesFOS);

    (_dlgVector displayCtrl IDC_DIGIT_0) ctrlSetText (_digits select 0);
    (_dlgVector displayCtrl IDC_DIGIT_1) ctrlSetText (_digits select 1);
    (_dlgVector displayCtrl IDC_DIGIT_2) ctrlSetText (_digits select 2);
    (_dlgVector displayCtrl IDC_DIGIT_3) ctrlSetText (_digits select 3);
    (_dlgVector displayCtrl IDC_DIGIT_4) ctrlSetText (_digits select 4);

    // nothing
    (_dlgVector displayCtrl IDC_DIGIT_5) ctrlSetText "";
    (_dlgVector displayCtrl IDC_DIGIT_6) ctrlSetText "";
    (_dlgVector displayCtrl IDC_DIGIT_7) ctrlSetText "";
    (_dlgVector displayCtrl IDC_DIGIT_8) ctrlSetText "";
    (_dlgVector displayCtrl IDC_DIGIT_9) ctrlSetText "";

};

[GVAR(illuminate)] call FUNC(illuminate);


namespace FormsControls.Base
{
    public struct RotationParams
    {
        public double X;
        public double Y;
        public double Z;

        public static RotationParams Default { get; } = new RotationParams();

        public RotationParams(double x = 0, double y = 0, double z = 0)
        {
            X = x;
            Y = y;
            Z = z;
        }
    }
}


var path = require('path');
var test = require('tape');
var resolve = require('../');

test('precedence', function (t) {
    t.plan(3);
    var dir = path.join(__dirname, 'precedence/aaa');

    resolve('./', { basedir: dir }, function (err, res, pkg) {
        t.ifError(err);
        t.equal(res, path.join(dir, 'index.js'));
        t.equal(pkg.name, 'resolve');
    });
});

test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string
    t.plan(1);
    var dir = path.join(__dirname, 'precedence/bbb');

    resolve('./', { basedir: dir }, function (err, res, pkg) {
        t.ok(err);
    });
});


<?php

namespace Rubix\ML\Tests\CrossValidation\Metrics;

use Rubix\ML\EstimatorType;
use Rubix\ML\CrossValidation\Metrics\Metric;
use Rubix\ML\CrossValidation\Metrics\MeanAbsoluteError;
use PHPUnit\Framework\TestCase;
use Generator;

/**
 * @group Metrics
 * @covers \Rubix\ML\CrossValidation\Metrics\MeanAbsoluteError
 */
class MeanAbsoluteErrorTest extends TestCase
{
    /**
     * @var \Rubix\ML\CrossValidation\Metrics\MeanAbsoluteError
     */
    protected $metric;

    /**
     * @before
     */
    protected function setUp() : void
    {
        $this->metric = new MeanAbsoluteError();
    }

    /**
     * @test
     */
    public function build() : void
    {
        $this->assertInstanceOf(MeanAbsoluteError::class, $this->metric);
        $this->assertInstanceOf(Metric::class, $this->metric);
    }

    /**
     * @test
     */
    public function range() : void
    {
        $expected = [-INF, 0.0];

        $this->assertEquals($expected, $this->metric->range());
    }

    /**
     * @test
     */
    public function compatibility() : void
    {
        $expected = [
            EstimatorType::regressor(),
        ];

        $this->assertEquals($expected, $this->metric->compatibility());
    }

    /**
     * @test
     * @dataProvider scoreProvider
     *
     * @param (int|float)[] $predictions
     * @param (int|float)[] $labels
     * @param float $expected
     */
    public function score(array $predictions, array $labels, float $expected) : void
    {
        [$min, $max] = $this->metric->range();

        $score = $this->metric->score($predictions, $labels);

        $this->assertThat(
            $score,
            $this->logicalAnd(
                $this->greaterThanOrEqual($min),
                $this->lessThanOrEqual($max)
            )
        );

        $this->assertEquals($expected, $score);
    }

    /**
     * @return \Generator<array>
     */
    public function scoreProvider() : Generator
    {
        yield [
            [7, 9.5, -20, -500, .079],
            [10, 10.0, 6, -1400, .08],
            -185.90019999999998,
        ];

        yield [
            [0, 0, 0, 0, 0],
            [10, 10.0, 6, -1400, .08],
            -285.216,
        ];

        yield [
            [10, 10.0, 6, -1400, .08],
            [10, 10.0, 6, -1400, .08],
            0.0,
        ];
    }
}


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

package server

import (
	"os"
	"time"

	"golang.org/x/sys/windows/svc"
	"golang.org/x/sys/windows/svc/debug"
)

const (
	reopenLogCode   = 128
	reopenLogCmd    = svc.Cmd(reopenLogCode)
	acceptReopenLog = svc.Accepted(reopenLogCode)
)

var serviceName = "gnatsd"

// SetServiceName allows setting a different service name
func SetServiceName(name string) {
	serviceName = name
}

// winServiceWrapper implements the svc.Handler interface for implementing
// gnatsd as a Windows service.
type winServiceWrapper struct {
	server *Server
}

var dockerized = false

func init() {
	if v, exists := os.LookupEnv("NATS_DOCKERIZED"); exists && v == "1" {
		dockerized = true
	}
}

// Execute will be called by the package code at the start of
// the service, and the service will exit once Execute completes.
// Inside Execute you must read service change requests from r and
// act accordingly. You must keep service control manager up to date
// about state of your service by writing into s as required.
// args contains service name followed by argument strings passed
// to the service.
// You can provide service exit code in exitCode return parameter,
// with 0 being "no error". You can also indicate if exit code,
// if any, is service specific or not by using svcSpecificEC
// parameter.
func (w *winServiceWrapper) Execute(args []string, changes <-chan svc.ChangeRequest,
	status chan<- svc.Status) (bool, uint32) {

	status <- svc.Status{State: svc.StartPending}
	go w.server.Start()

	// Wait for accept loop(s) to be started
	if !w.server.ReadyForConnections(10 * time.Second) {
		// Failed to start.
		return false, 1
	}

	status <- svc.Status{
		State:   svc.Running,
		Accepts: svc.AcceptStop | svc.AcceptShutdown | svc.AcceptParamChange | acceptReopenLog,
	}

loop:
	for change := range changes {
		switch change.Cmd {
		case svc.Interrogate:
			status <- change.CurrentStatus
		case svc.Stop, svc.Shutdown:
			w.server.Shutdown()
			break loop
		case reopenLogCmd:
			// File log re-open for rotating file logs.
			w.server.ReOpenLogFile()
		case svc.ParamChange:
			if err := w.server.Reload(); err != nil {
				w.server.Errorf("Failed to reload server configuration: %s", err)
			}
		default:
			w.server.Debugf("Unexpected control request: %v", change.Cmd)
		}
	}

	status <- svc.Status{State: svc.StopPending}
	return false, 0
}

// Run starts the NATS server as a Windows service.
func Run(server *Server) error {
	if dockerized {
		server.Start()
		return nil
	}
	run := svc.Run
	isInteractive, err := svc.IsAnInteractiveSession()
	if err != nil {
		return err
	}
	if isInteractive {
		run = debug.Run
	}
	return run(serviceName, &winServiceWrapper{server})
}

// isWindowsService indicates if NATS is running as a Windows service.
func isWindowsService() bool {
	if dockerized {
		return false
	}
	isInteractive, _ := svc.IsAnInteractiveSession()
	return !isInteractive
}


class RenameAssociationToAssociated < ActiveRecord::Migration[4.2]
  def up
    if index_exists? :audits, [:association_id, :association_type], :name => 'association_index'
      remove_index :audits, :name => 'association_index'
    end

    rename_column :audits, :association_id, :associated_id     if column_exists? :audits, :association_id
    rename_column :audits, :association_type, :associated_type if column_exists? :audits, :association_type

    unless index_exists? :audits, [:association_id, :association_type], :name => 'association_index'
      add_index :audits, [:associated_id, :associated_type], :name => 'associated_index'
    end
  end

  def down
    if index_exists? :audits, [:associated_id, :associated_type], :name => 'associated_index'
      remove_index :audits, :name => 'associated_index'
    end

    rename_column :audits, :associated_type, :association_type
    rename_column :audits, :associated_id, :association_id

    add_index :audits, [:association_id, :association_type], :name => 'association_index'
  end
end


#ifndef XMP_HIO_H
#define XMP_HIO_H

#include <sys/types.h>
#include <sys/stat.h>
#include <stddef.h>
#include "memio.h"

#define HIO_HANDLE_TYPE(x) ((x)->type)

typedef struct {
#define HIO_HANDLE_TYPE_FILE	0
#define HIO_HANDLE_TYPE_MEMORY	1
	int type;
	long size;
	union {
		FILE *file;
		MFILE *mem;
	} handle;
	int error;
} HIO_HANDLE;

int8	hio_read8s	(HIO_HANDLE *);
uint8	hio_read8	(HIO_HANDLE *);
uint16	hio_read16l	(HIO_HANDLE *);
uint16	hio_read16b	(HIO_HANDLE *);
uint32	hio_read24l	(HIO_HANDLE *);
uint32	hio_read24b	(HIO_HANDLE *);
uint32	hio_read32l	(HIO_HANDLE *);
uint32	hio_read32b	(HIO_HANDLE *);
size_t	hio_read	(void *, size_t, size_t, HIO_HANDLE *);
int	hio_seek	(HIO_HANDLE *, long, int);
long	hio_tell	(HIO_HANDLE *);
int	hio_eof		(HIO_HANDLE *);
int	hio_error	(HIO_HANDLE *);
HIO_HANDLE *hio_open	(void *, char *);
HIO_HANDLE *hio_open_mem  (void *, long);
HIO_HANDLE *hio_open_file (FILE *);
int	hio_close	(HIO_HANDLE *);
long	hio_size	(HIO_HANDLE *);

#endif


# Episode 068: Microk8s

- Hosted by @krisnova
- Recording date: 2019-03-15

https://www.youtube.com/watch?v=3Px-kbcIaVE

## Table of Contents

(timestamp is time after the hour, not show time)

- 00:00:00 - Welcome to TGIK!
- 00:04:00 - Week in Review
- 00:32:00 - microk8s.

## Week in Review

### Interesting Commits from lwkd.info
- [#74863:](https://github.com/kubernetes/kubernetes/pull/74863) CSI volume expansion Enables csi volumes to be resized!
- [#74376](https://github.com/kubernetes/kubernetes/pull/74376) add latency metric for cr webhook conversion

### Other interesting stuff
- [kubecon eu schedule is up](https://events.linuxfoundation.org/events/kubecon-cloudnativecon-europe-2019/schedule/)
    - So many talks that many end up rejected, so there's a [Rejekt conference](https://cloud-native.rejekts.io/) the weekend before, 18-19 May. [Register here](https://ti.to/cloud-native-rejekts/cloud-native-rejekts-eu-2019)
- [2 years of TGIK with Joe and Kris!](https://sched.co/MPZq)
- [Decent article on airbnb wrangling workflow](https://www.infoq.com/news/2019/03/airbnb-kubernetes-workflow)
- Shout out to Steve Sloka for a [writeup on sonobuoy and k8s conformance.](https://blogs.vmware.com/cloudnative/2019/02/21/certifying-kubernetes-with-sonobuoy/)
- Shout out to the [upstream k8s slack admin team](https://github.com/kubernetes/community/blob/master/communication/moderators.md#slack) for their work getting [slack.k8s.io opened up]((https://discuss.kubernetes.io/t/slack-k8s-io-inviter-is-back/5453)) for registrations again!
- [ytt](https://developer.ibm.com/blogs/yaml-templating-tool-to-simplify-complex-configuration-management/) - "The YAML Templating Tool that simplifies complex configuration management"
- [GopherCon 2017: Mitchell Hashimoto - Advanced Testing with Go](https://www.youtube.com/watch?v=8hQG7QlcLBk)
- [spacemacs](http://spacemacs.org/) A "sophisticated and polished set-up focused on ergonomics, mnemonics and consistency"
- [Developing Kubernetes Services at Airbnb Scale - Melanie Cebula, Software Engineer, Airbnb](https://www.youtube.com/watch?v=ytu3aUCwlSg)
- join the FR translation effort of k8s doc in kubernetes-docs-fr slack: https://github.com/kubernetes/website/pulls?q=is%3Apr+is%3Aopen+label%3Alanguage%2Ffr

## Show Notes

- Will this work on 16.04?
- https://github.com/heptio/tgik/issues/181

## Reference Links

- [MicroK8s Documentation](https://microk8s.io/)
- #microk8s on kubernetes slack
- [Code](https://github.com/ubuntu/microk8s)
- [Discuss](https://discuss.kubernetes.io/tags/microk8s)
- Running on OSX: https://itnext.io/microk8s-on-macos-98f1de3aa63e
- [Local kubernetes linux minikube vs. microk8s]( https://codefresh.io/kubernetes-tutorial/local-kubernetes-linux-minikube-vs-microk8s/)


"""Unit tests for Lie algebra."""

import geomstats.backend as gs
import geomstats.tests
from geomstats.geometry.skew_symmetric_matrices import SkewSymmetricMatrices

class TestLieAlgebra(geomstats.tests.TestCase):
    def setUp(self):
        self.n = 4
        self.dim = int(self.n * (self.n - 1) / 2)
        self.algebra = SkewSymmetricMatrices(n=self.n)

    def test_dimension(self):
        result = self.algebra.dim
        expected = self.dim
        self.assertAllClose(result, expected)

    @geomstats.tests.np_only
    def test_matrix_representation_and_belongs(self):
        n_samples = 2
        point = gs.random.rand(n_samples * self.dim)
        point = gs.reshape(point, (n_samples, self.dim))
        mat = self.algebra.matrix_representation(point)
        result = self.algebra.belongs(mat).all()
        expected = True
        self.assertAllClose(result, expected)

    @geomstats.tests.np_only
    def test_basis_and_matrix_representation(self):
        n_samples = 2
        expected = gs.random.rand(n_samples * self.dim)
        expected = gs.reshape(expected, (n_samples, self.dim))
        mat = self.algebra.matrix_representation(expected)
        result = self.algebra.basis_representation(mat)
        self.assertAllClose(result, expected)


"naga_siren_heal_with_aghs"
{
	"desc"				"#DOTA_ChallengeDesc_NagaSiren_HealWithAghs"
	"status_text"		"#DOTA_ChallengeStatus_NagaSiren_HealWithAghs"
	"requiredhero"		"naga_siren"
	"image"				"images/items/ultimate_scepter.png"
	"events"
	{
		"matching_type"		"linear_series"
		"query"
		{
			"song_killeater"
			{
				"event"							"kill_eater"
				"caster"					"!hero"
				"kill_eater_event"			"782"
			}
		}
		"postmatch_increments"
		{
			"storage"
			{
				"1"
				{
					"aggregator"		"increment"
				}
			}
		}
		"progress_stored_in"		"1"
		"post_tests"
		{
			"test_song_killeater"
			{
				"storage"		"1"
				"compare"		">="
				"amount"		"<healed_by_song>"
			}
		}
	}
	"variables"
	{
		"<healed_by_song>"
		{
			"format"		"int"
			"index"		"0"
		}
	}
}


using System;
using System.Collections.Generic;

using Xamarin.Forms;

using NUnit.Framework;

namespace Xamarin.Forms.Xaml.UnitTests
{
	public partial class Bz28545 : ContentPage
	{
		public Bz28545 ()
		{
			InitializeComponent ();
		}

		public Bz28545 (bool useCompiledXaml)
		{
			//this stub will be replaced at compile time
		}

		[TestFixture]
		class Tests
		{
			[TestCase(true)]
			[TestCase(false)]
			public void TypeConverterAreAppliedForSettersToAttachedBP (bool useCompiledXaml)
			{
				var layout = new Bz28545 (useCompiledXaml);
				Assert.AreEqual (Color.Pink, layout.label.TextColor);
				Assert.AreEqual (AbsoluteLayoutFlags.PositionProportional, AbsoluteLayout.GetLayoutFlags (layout.label));
				Assert.AreEqual (new Rectangle (1, 1, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize), AbsoluteLayout.GetLayoutBounds (layout.label));
			}
		}
	}
}


<!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>Bad Request</title>

不正確的請求

<?php echo nl2br(CHtml::encode($data['message'])); ?>

由於語法不正確, 伺服器無法了解請求的正確內容.
請修改請求後再行重試.

如果您認為是伺服器錯誤所造成, 請聯絡<?php echo $data[ 'admin']; ?>.

<?php echo date('Y-m-d H:i:s',$data['time']) .' '. $data['version']; ?>


Prism.languages.scala = Prism.languages.extend('java', {
	'keyword': /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,
	'string': [
		{
			pattern: /"""[\s\S]*?"""/,
			greedy: true
		},
		{
			pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
			greedy: true
		}
	],
	'builtin': /\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,
	'number': /\b0x[\da-f]*\.?[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e\d+)?[dfl]?/i,
	'symbol': /'[^\d\s\\]\w*/
});
delete Prism.languages.scala['class-name'];
delete Prism.languages.scala['function'];


package com.ansel.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ansel.bean.BillInfo;
import com.ansel.bean.CargoReceipt;
import com.ansel.bean.CargoReceiptDetail;
import com.ansel.bean.GoodsBill;
import com.ansel.bean.GoodsBillEvent;
import com.ansel.bean.RouteInfo;
import com.ansel.dao.IBillInfoDao;
import com.ansel.dao.ICargoReceiptDao;
import com.ansel.dao.ICargoReceiptDetailDao;
import com.ansel.dao.IGoodsBillDao;
import com.ansel.dao.IGoodsBillEventDao;
import com.ansel.dao.IRegionDao;
import com.ansel.dao.IRouteInfoDao;
import com.ansel.service.ICargoReceiptService;

@Transactional(propagation = Propagation.REQUIRED)
@Service(value = "cargoReceiptService")
public class CargoReceiptServiceImpl implements ICargoReceiptService {

	@Autowired
	private ICargoReceiptDao cargoReceiptDao;

	@Autowired
	private ICargoReceiptDetailDao cargoReceiptDetailDao;

	@Autowired
	private IBillInfoDao billInfoDao;

	@Autowired
	private IGoodsBillDao goodsBillDao;

	@Autowired
	private IGoodsBillEventDao goodsBillEventDao;

	@Autowired
	private IRegionDao regionDao;

	@Autowired
	private IRouteInfoDao routeInfoDao;

	@Override
	public boolean save(CargoReceipt cargoReceipt) {
		// TODO Auto-generated method stub
		try {
			// 保存货运回执单
			cargoReceiptDao.save(cargoReceipt);

			// 更新货运单中的中转地和中转费信息
			String loadStation = cargoReceipt.getLoadStation();
			String dealGoodsStation = cargoReceipt.getDealGoodsStation();
			int startStation = regionDao.findByCity(loadStation).getId();
			int endStation = regionDao.findByCity(dealGoodsStation).getId();
			List<RouteInfo> routeList = routeInfoDao.findByStartStationAndEndStation(startStation, endStation);
			String passStation = routeList.get(0).getPassStation();
			for (int i = 1; i < routeList.size(); i++) {
				String temp = routeList.get(i).getPassStation();
				passStation = (temp.length() < passStation.length() ? temp : passStation);
			}
			String[] pass_station = passStation.split(",");

			String goodsBillCode = cargoReceiptDetailDao.findByGoodsRevertBillId(cargoReceipt.getGoodsRevertBillCode()).getGoodsBillDetailId();
			GoodsBill goodsBill = goodsBillDao.findByGoodsBillCode(goodsBillCode);
			double transfer_fee = 1.3 * pass_station.length;
			goodsBill.setTransferFee(transfer_fee);
			String result = "";
			for (int i = 0; i < pass_station.length; i++) {
				String station_name = regionDao.findById(Integer.valueOf(pass_station[i])).getCity();
				result += (i == 0 ? "" : ",");
				result += station_name;
			}
			goodsBill.setTransferStation(result);
			goodsBillDao.save(goodsBill);
			// 保存单据明细表
			BillInfo billInfo = new BillInfo();
			billInfo.setBillType("货运回执单");
			billInfo.setAcceptStation(cargoReceipt.getAcceptStation());
			billInfo.setBillCode(cargoReceipt.getGoodsRevertBillCode());
			billInfo.setBillState("已填");
			billInfo.setWriteDate(new Date());
			System.out.println(billInfo);
			billInfoDao.save(billInfo);
			return true;
		} catch (Exception e) {
			// TODO: handle exception
			System.err.println("货运回执单添加失败");
			return false;
		}
	}

	@Override
	public List<String> selectAllCodes() {
		// TODO Auto-generated method stub
		return cargoReceiptDetailDao.findAllCargoReceiptCode();
	}

	@Override
	public GoodsBill selectGoodsBill(String goodsRevertBillCode) {
		// TODO Auto-generated method stub
		String goodsBillCode = cargoReceiptDetailDao.findByGoodsRevertBillId(goodsRevertBillCode).getGoodsBillDetailId();
		return goodsBillDao.findByGoodsBillCode(goodsBillCode);
	}

	@Override
	public List<CargoReceipt> findByDriverId(String driverId) {
		// TODO Auto-generated method stub
		return cargoReceiptDao.findByDriverId(driverId);
	}

	@Override
	public Page<CargoReceipt> selectAll(Pageable pageable) {
		// TODO Auto-generated method stub
		return cargoReceiptDao.findAll(pageable);
	}

	@Override
	public Page<CargoReceipt> selectByEvent(String backBillState, Pageable pageable) {
		// TODO Auto-generated method stub
		return cargoReceiptDao.findByBackBillState(pageable, backBillState);
	}

	@Override
	public CargoReceipt selectByCode(String goodsRevertBillCode) {
		// TODO Auto-generated method stub
		return cargoReceiptDao.findByGoodsRevertBillCode(goodsRevertBillCode);
	}

	@Override
	public boolean update(CargoReceipt cargoReceipt) {
		// TODO Auto-generated method stub
		try {
			cargoReceiptDao.save(cargoReceipt);
			return true;
		} catch (Exception e) {
			// TODO: handle exception
			System.err.println("货运回执单更新失败");
			return false;
		}
	}

	@Override
	public boolean submit(CargoReceipt cargoReceipt) {
		// TODO Auto-generated method stub
		try {
			cargoReceipt.setBackBillState("未到车辆");
			cargoReceiptDao.save(cargoReceipt);
			String goodsBillCode = cargoReceiptDetailDao.findByGoodsRevertBillId(cargoReceipt.getGoodsRevertBillCode()).getGoodsBillDetailId();
			GoodsBillEvent goodsBillEvent = goodsBillEventDao.findByGoodsBillId(goodsBillCode);
			goodsBillEvent.setEventName("未到");
			goodsBillEvent.setOccurTime(new Date());
			goodsBillEventDao.save(goodsBillEvent);
			return true;
		} catch (Exception e) {
			// TODO: handle exception
			System.err.println("货运回执单提交失败");
			return false;
		}
	}

	@Override
	public boolean delete(String goodsRevertBillCode) {
		// TODO Auto-generated method stub
		BillInfo billInfo = billInfoDao.findByBillCode(goodsRevertBillCode);
		billInfo.setBillState("作废");
		billInfo.setWriteDate(new Date());
		try {
			CargoReceipt cargoReceipt = new CargoReceipt();
			cargoReceipt.setGoodsRevertBillCode(goodsRevertBillCode);
			cargoReceiptDao.delete(cargoReceipt);
			return true;
		} catch (Exception e) {
			// TODO: handle exception
			System.err.println("货运回执单删除失败");
			return false;
		}
	}

	@Override
	public Page<CargoReceipt> findByDriverIdAndState(String driverId, String backBillState, Pageable pageable) {
		// TODO Auto-generated method stub
		return cargoReceiptDao.findByDriverIdAndBackBillState(driverId, backBillState, pageable);
	}

	@Override
	public List<?> selectLeftCodes() {
		// TODO Auto-generated method stub
		return cargoReceiptDetailDao.findLeftCodes();
	}

	@Override
	public CargoReceiptDetail findByGoodsBillCode(String goodsBillCode) {
		// TODO Auto-generated method stub
		return cargoReceiptDetailDao.findByGoodsBillDetailId(goodsBillCode);
	}

}


{{ application.name }}

      {{ application.organization.name }}

    {{ application.description || '(No Description)' }}