0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValuePPC64_OpDiv8u_0(v *Value) bool {
	b := v.Block
	typ := &b.Func.Config.Types
	// match: (Div8u x y)
	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
	for {
		y := v.Args[1]
		x := v.Args[0]
		v.reset(OpPPC64DIVWU)
		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValuePPC64_OpEq16_0(v *Value) bool {
	b := v.Block
	typ := &b.Func.Config.Types
	// match: (Eq16 x y)
	// cond: isSigned(x.Type) && isSigned(y.Type)
	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
	for {
		y := v.Args[1]
		x := v.Args[0]
		if !(isSigned(x.Type) && isSigned(y.Type)) {
			break
		}
		v.reset(OpPPC64Equal)
		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
	// match: (Eq16 x y)
	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
	for {
		y := v.Args[1]
		x := v.Args[0]
		v.reset(OpPPC64Equal)
		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
}
func rewriteValuePPC64_OpEq32_0(v *Value) bool {
	b := v.Block
	// match: (Eq32 x y)
	// result: (Equal (CMPW x y))
	for {
		y := v.Args[1]
		x := v.Args[0]
		v.reset(OpPPC64Equal)
		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewrite


{
		"order": 0,
		"name": "path",
		"label": "Path",
		"value": "/scripts/lidarr.sh",
		"type": "filePath",
		"advanced": false
	  },
	  {
		"order": 1,
		"name": "arguments",
		"label": "Arguments",
		"helpText": "Arguments to pass to the script",
		"type": "textbox",
		"advanced": false,
		"hidden": "hiddenIfNotSet"
	  }
	],
	"implementationName": "Custom Script",
	"implementation": "CustomScript",
	"configContract": "CustomScriptSettings",
	"infoLink": "https://wiki.servarr.com/lidarr/supported#customscript",
	"message": {
	  "message": "Testing will execute the script with the EventType set to Test",
	  "type": "warning"
	},
	"tags": [],
	"id": 3
  }`

const addNotification = `{"onUpgrade":true,"name":"Test","implementation":"CustomScript","configContract":` +
	`"CustomScriptSettings","fields":[{"name":"path","value":"/scripts/lidarr.sh"}]}`

const updateNotification = `{"onUpgrade":true,"id":3,"name":"Test","implementation":"CustomScript","configContract":` +
	`"CustomScriptSettings","fields":[{"name":"path","value":"/scripts/lidarr.sh"}]}`

func TestGetNotifications(t *testing.T) {
	t.Parallel()

	tests := []*starrtest.MockData{
		{
			Name:            "200",
			ExpectedPath:    path.Join("/", starr.API, lidarr.APIver, "notification"),
			ExpectedRequest: "",
			ExpectedMethod:  "GET",
			ResponseStatus:  200,
			ResponseBody:    "[" + notificationResponseBody + "]",
			WithRequest:     nil,
			WithResponse: []*lidarr.NotificationOutput{
				{
					OnUpgrade:                   true,
					SupportsOnGrab:              true,
					SupportsOnReleaseImport:     true,
					SupportsOnUpgrade:           true,
					SupportsOnRename:            true,
					SupportsOnApplicationUpdate: true,
					SupportsOnTrackRetag:        true,
					SupportsOnDownloadFailure:   false,
					SupportsOnImportFailure:     false,
					SupportsOnHealthIssue:       true,
					ID:                          3,
					Name:                        "Test",
					ImplementationName:          "Custom Script",
					Implementation:              "CustomScript",
					ConfigContract:              "CustomScriptSettings",
					InfoLink:                    "https://wiki.servarr.com/lidarr/supported#customscript",
					Tags:                        []int{},
					Fields: []*starr.FieldOutput{
						{
							Order:    0,
							Name:     "path",
							Label:    "Path",
							Value:    "/scripts/lidarr.sh",
							Type:     "filePath",
							Advanced: false,
						},
						{
							Order:    1,
							Name:     "arguments",
							Label:    "Arguments",
							HelpText: "Arguments to pass to the script",
							Hidden:   "hiddenIfNotSet",
							Type:     "textbox",
							Advanced: false,
						},
					},
				},
			},
			WithError: nil,
		},
		{
			Name:           "404",
			ExpectedPath:   path.Join("/", starr.API, lidarr.APIver, "notification"),
			ExpectedMethod: "GET",
			ResponseStatus: 404,
			ResponseBody:   `{"message": "NotFound"}`,
			WithError:      &starr.ReqError{Code: http.StatusNotFound},
			WithResponse:   ([]*lidarr.NotificationOutput)(nil),
		},
	}

	for _, test := range tests {
		t.Run(test.Name, func(t *testing.T) {
			t.Parallel()
			mock


core.bool.fromEnvironment('protobuf.omit_enum_names')
          ? ''
          : 'TYPE_SINT64');

  static const $core.List<Field_Kind> values = <Field_Kind>[
    TYPE_UNKNOWN,
    TYPE_DOUBLE,
    TYPE_FLOAT,
    TYPE_INT64,
    TYPE_UINT64,
    TYPE_INT32,
    TYPE_FIXED64,
    TYPE_FIXED32,
    TYPE_BOOL,
    TYPE_STRING,
    TYPE_GROUP,
    TYPE_MESSAGE,
    TYPE_BYTES,
    TYPE_UINT32,
    TYPE_ENUM,
    TYPE_SFIXED32,
    TYPE_SFIXED64,
    TYPE_SINT32,
    TYPE_SINT64,
  ];

  static final $core.Map<$core.int, Field_Kind> _byValue =
      $pb.ProtobufEnum.initByValue(values);
  static Field_Kind? valueOf($core.int value) => _byValue[value];

  const Field_Kind._($core.int v, $core.String n) : super(v, n);
}

class Field_Cardinality extends $pb.ProtobufEnum {
  static const Field_Cardinality CARDINALITY_UNKNOWN = Field_Cardinality._(
      0,
      const $core.bool.fromEnvironment('protobuf.omit_enum_names')
          ? ''
          : 'CARDINALITY_UNKNOWN');
  static const Field_Cardinality CARDINALITY_OPTIONAL = Field_Cardinality._(
      1,
      const $core.bool.fromEnvironment('protobuf.omit_enum_names')
          ? ''
          : 'CARDINALITY_OPTIONAL');
  static const Field_Cardinality CARDINALITY_REQUIRED = Field_Cardinality._(
      2,
      const $core.bool.fromEnvironment('protobuf.omit_enum_names')
          ? ''
          : 'CARDINALITY_REQUIRED');
  static const Field_Cardinality CARDINALITY_REPEATED = Field_Cardinality._(
      3,
      const $core.bool.fromEnvironment('protobuf.omit_enum_names')
          ? ''
          : 'CARDINALITY_REPEATED');

  static const $core.List<Field_Cardinality> values = <Field_Cardinality>[
    CARDINALITY_UNKNOWN,
    CARDINALITY_OPTIONAL,
    CARDINALITY_REQUIRED,
    CARDINALITY_REPEATED,
  ];

  static final $core.Map<$core.int, Field_Cardinality> _byValue =
      $pb.ProtobufEnum.initByValue(values);
  static Field_Cardinality? valueOf($core.int value) => _byValue[value];

  const Field_Cardinality._($core.int v, $core.String n) : super(v, n);
}
///
//  Generated code. Do not modify.
//  source: google/protobuf/field_mask.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields

import 'dart:core' as $core;

import 'package:protobuf/protobuf.dart' as $pb;

import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;

class FieldMask extends $pb.GeneratedMessage with $mixin.FieldMaskMixin {
  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      const $core.bool.fromEnvironment('protobuf.omit_message_names')
          ? ''
          : 'FieldMask',
      package: const $pb.PackageName(
          const $core.bool.fromEnvironment('protobuf.omit_message_names')
              ? ''
              : 'google.protobuf'),
      createEmptyInstance: create,
      toProto3Json: $mixin.FieldMaskMixin.toProto3JsonHelper,
      fromProto3Json: $mixin.FieldMaskMixin.fromP


nder 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 org.tensorflow.model.examples.tensors;

import org.tensorflow.ndarray.Shape;
import org.tensorflow.ndarray.IntNdArray;
import org.tensorflow.ndarray.NdArrays;
import org.tensorflow.types.TInt32;

import java.util.Arrays;

/**
 * Creates a few tensors of ranks: 0, 1, 2, 3.
 */
public class TensorCreation {

    public static void main(String[] args) {
        // Rank 0 Tensor
        TInt32 rank0Tensor = TInt32.scalarOf(42);

        System.out.println("---- Scalar tensor ---------");

        System.out.println("DataType: " + rank0Tensor.dataType().name());

        System.out.println("Rank: " + rank0Tensor.shape().size());

        System.out.println("Shape: " + Arrays.toString(rank0Tensor.shape().asArray()));

        rank0Tensor.scalars().forEach(value -> System.out.println("Value: " + value.getObject()));

        // Rank 1 Tensor
        TInt32 rank1Tensor = TInt32.vectorOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

        System.out.println("---- Vector tensor ---------");

        System.out.println("DataType: " + rank1Tensor.dataType().name());

        System.out.println("Rank: " + rank1Tensor.shape().size());

        System.out.println("Shape: " + Arrays.toString(rank1Tensor.shape().asArray()));

        System.out.println("6th element: " + rank1Tensor.getInt(5));

        // Rank 2 Tensor
        // 3x2 matrix of ints.
        IntNdArray matrix2d = NdArrays.ofInts(Shape.of(3, 2));

        matrix2d.set(NdArrays.vectorOf(1, 2), 0)
                .set(NdArrays.vectorOf(3, 4), 1)
                .set(NdArrays.vectorOf(5, 6), 2);

        TInt32 rank2Tensor = TInt32.tensorOf(matrix2d);

        System.out.println("---- Matrix tensor ---------");

        System.out.println("DataType: " + rank2Tensor.dataType().name());

        System.out.println("Rank: " + rank2Tensor.shape().size());

        System.out.println("Shape: " + Arrays.toString(rank2Tensor.shape().asArray()));

        System.out.println("6th element: " + rank2Tensor.getInt(2, 1));

        // Rank 3 Tensor
        // 3*2*4 matrix of ints.
        IntNdArray matrix3d = NdArrays.ofInts(Shape.of(3, 2, 4));

        matrix3d.elements(0).forEach(matrix -> {
            matrix
                    .set(NdArrays.vectorOf(1, 2, 3, 4), 0)
                    .set(NdArrays.vectorOf(5, 6, 7, 8), 1);
        });

        TInt32 rank3Tensor = TInt32.tensorOf(matrix3d);

        System.out.println("---- Matrix tensor ---------");

        System.out.println("DataType: " + rank3Tensor.dataType().name());

        System.out.println("Rank: " + rank3Tensor.shape().size());

        System.out.println("Shape: " + Arrays.toString(rank3Tensor.shape().asArray()));

        System.out.println("n-th element: " + rank3Tensor.getInt(2, 1, 3));
    }
}
/*
 *  Copyright 2020, 2024 The TensorFlow Authors. All Rights Reserved.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.


oIcons[4]:SetActive(true)  end
    self.RecoEquipsId[5]=equipIds[5];  if(self.RecoEquipsId[5]==-1)then   self.RecoIcons[5]:SetActive(false) else self.RecoIcons[5]:SetActive(true)  end
    self.RecoEquipsId[6]=equipIds[6];  if(self.RecoEquipsId[6]==-1)then   self.RecoIcons[6]:SetActive(false) else self.RecoIcons[6]:SetActive(true)  end
    ------Debugger.LogError(v.Id  .. "Template:" .. v.BattleEquips[1] .. ":" .. v.BattleEquips[2] .. ":" .. v.BattleEquips[3] .. ":" .. v.BattleEquips[4] .. ":" ..              v.BattleEquips[5] .. ":" .. v.BattleEquips[6])

    --Debugger.LogError("SetEVENT");
    self:SetIconEvent(1,self.RecoEquipsId[1])
    self:SetIconEvent(2,self.RecoEquipsId[2])
    self:SetIconEvent(3,self.RecoEquipsId[3])
    self:SetIconEvent(4,self.RecoEquipsId[4])
    self:SetIconEvent(5,self.RecoEquipsId[5])
    self:SetIconEvent(6,self.RecoEquipsId[6])

  -----------------------------------------------------------
  self.TipText="成功修改为推荐搭配"
  self:MyRequest()
end
-----------------------------------------------------------------------
--根据Id查找类型 生成对应类型列表 执行UIClick事件
function PreviewEquipAPI:Execute(m,equipId)

              for i1,v1 in pairs(self.tableCopyMall) do

                if(equipId==v1.EquipId)then
                   --Debugger.LogError("EXECUTE")
                  if(v1.Type==1)then
                    self:OnType1ButtonClick()
                    self.Type1Button:GetComponent("UnityEngine.UI.Toggle").isOn =true
                    for i2,v2 in pairs(self.Type1QualityX3) do
                      for i3,v3 in pairs(v2) do
                        if(v3.EquipId==equipId)then
                          local uiClick=UITools.GetLuaScript(v3.GO,"Logic.UICommon.UIClick");
                          uiClick:ExecuteClickDelegate()--强制执行委托方法
                          break
                        end
                      end
                    end
                  elseif(v1.Type==2)then
                    self:OnType2ButtonClick()
                    self.Type2Button:GetComponent("UnityEngine.UI.Toggle").isOn =true
                    for i2,v2 in pairs(self.Type2QualityX3) do
                      for i3,v3 in pairs(v2) do
                        if(v3.EquipId==equipId)then
                          local uiClick=UITools.GetLuaScript(v3.GO,"Logic.UICommon.UIClick");
                          uiClick:ExecuteClickDelegate()--强制执行委托方法
                          break
                        end
                      end
                    end
                  elseif(v1.Type==3)then
                    self:OnType3ButtonClick()
                    self.Type3Button:GetComponent("UnityEngine.UI.Toggle").isOn =true
                    for i2,v2 in pairs(self.Type3QualityX3) do
                      for i3,v3 in pairs(v2) do
                        if(v3.EquipId==equipId)then
                          local uiClick=UITools.GetLuaScript(v3.GO,"Logic.UICommon.UIClick");
                          uiClick:ExecuteClickDelegate()--强制执行委托方法
                          break
                        end
                      end
                    end
                  elseif(v1.Type==4)then
                    self:OnType4ButtonClick()
                    self.Type4Button:GetComponent("UnityEngin


entTest(JFrame parent, Cooja gui) {
    final String testDescription = "Step 4/4 - Memory replacement test";
    String value = OPTION_RUN_TEST;
    while (value.equals(OPTION_RUN_TEST)) {
      value = showStepDialog(
          parent,
          "Tests copying memory sections between Contiki and Cooja.\n" +
          "Variable values are both altered in Contiki and in Cooja.\n" +
          "\n" +
          "This is the final test!\n",
          testDescription,
          null,
          false
      );

      if (value == null) {
        return false;
      }

      if (value.equals(OPTION_NEXT_TEST)) {
        return true;
      }

      if (!value.equals(OPTION_RUN_TEST)) {
        return false;
      }

      prepareShowTestProgress(parent, testDescription);

      /* Start test */
      new Thread(new Runnable() {
        public void run() {
          testCounter++;
          PrintStream normalStream = new PrintStream(output.getInputStream(MessageList.NORMAL));
          PrintStream errorStream = new PrintStream(output.getInputStream(MessageList.ERROR));
          boolean success = performMemoryReplacementTest(output, normalStream, errorStream);
          normalStream.close();
          errorStream.close();

          if (success) {
            output.addMessage("### Test OK", MessageList.NORMAL);
          } else {
            output.addMessage("### Test failed", MessageList.ERROR);
          }
          button.setEnabled(true);
          progressBar.setIndeterminate(false);
        }
      }).start();

      showTestProgress(parent);
    }

    return false;
  }

  private static void prepareShowTestProgress(JFrame parent, String desc) {
    output = new MessageListUI();
    output.addPopupMenuItem(null, true);
    progressDialog = new JDialog(parent, desc);
    button = new JButton("Close");
    progressBar = new JProgressBar(0, 100);
  }

  private static void showTestProgress(JFrame parent) {
    progressBar.setValue(0);
    progressBar.setStringPainted(false);
    progressBar.setIndeterminate(true);
    JPanel progressPanel = new JPanel(new BorderLayout());
    button.setEnabled(false);
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if (progressDialog.isDisplayable()) {
          progressDialog.dispose();
        }
      }
    });
    progressPanel.add(BorderLayout.CENTER, new JScrollPane(output));
    progressPanel.add(BorderLayout.NORTH, progressBar);
    progressPanel.add(BorderLayout.SOUTH, button);
    progressDialog.getContentPane().add(progressPanel);
    progressDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    progressDialog.setSize(700, 500);
    progressDialog.setModal(true);
    progressDialog.setLocationRelativeTo(parent);
    progressDialog.getRootPane().setDefaultButton(button);
    progressDialog.setVisible(true);
  }

  private static JPanel createConfigureComboBox(final String name) {
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
    JComboBox combo = new JComboBox(new Object[] { Cooja.getExternalToolsSetting(name, "") });

    JLabel label = new JLabel(name);
    label.setToolTipText(name);
    label.setPreferredSize(new Dimension(120, label.getPreferredSize().height));

    /* Suggest external tools settings */
    String[] suggestions = null;
    if (name.equals("COMPILER_ARGS")) {
      suggestions = COMPILER_ARGS_suggestions;
    } else if (name.equals("LINK_COMMAND_1")) {
      suggestions = LINK_COMMAND_1_suggestions;
    } else if (name.equals("LINK_COMMAND_2")) {
      suggestions = LINK_COMMAND_2_suggestions;
    } else if (name.equals("PARSE_WITH_COMMAND")) {
      suggestions


ives the best RMSE?

If there are multiple options, select the smallest `r`.

### Question 5

* We used seed 42 for splitting the data. Let's find out how selecting the seed influences our score.
* Try different seed values: `[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`.
* For each seed, do the train/validation/test split with 60%/20%/20% distribution.
* Fill the missing values with 0 and train a model without regularization.
* For each seed, evaluate the model on the validation dataset and collect the RMSE scores.
* What's the standard deviation of all the scores? To compute the standard deviation, use `np.std`.
* Round the result to 3 decimal digits (`round(std, 3)`)

> Note: Standard deviation shows how different the values are.
> If it's low, then all values are approximately the same.
> If it's high, the values are different.
> If standard deviation of scores is low, then our model is *stable*.

### Question 6

* Split the dataset like previously, use seed 9.
* Combine train and validation datasets.
* Fill the missing values with 0 and train a model with `r=0.001`.
* What's the RMSE on the test dataset?

## Submit the results

Submit your results here: https://forms.gle/2N9GkTr1AgNeZ8hD7.

If your answer doesn't match options exactly, select the closest one.

## Deadline

The deadline for submitting is 20 September 2021, 17:00 CET. After that, the form will be closed.

## Navigation

* [Machine Learning Zoomcamp course](../)
* [Session 2: Machine Learning for Regression](./)
* Previous: [Explore more](17-explore-more.md)
```
saved_model_cli

docker run -it --rm \
  -p 8500:8500 \
  -v $(pwd)/clothing-model:/models/clothing-model/1 \
  -e MODEL_NAME="clothing-model" \
  tensorflow/serving:2.7.0

docker build -t zoomcamp-10-model:xception-v4-001 \
  -f image-model.dockerfile .

docker run -it --rm \
  -p 8500:8500 \
  zoomcamp-10-model:xception-v4-001

docker build -t zoomcamp-10-gateway:002 \
  -f image-gateway.dockerfile .

docker run -it --rm \
  -p 9696:9696 \
  zoomcamp-10-gateway:001

docker-compose up

docker-compose up -d
docker-compose down

docker build -t ping:v001 .
docker run -it --rm -p 9696:9696 ping:v001

kind create cluster

kubectl get service
kubectl get pod
kubectl get deployment

kubectl apply -f deployment.yaml

kind load docker-image ping:v001
kubectl port-forward ping-deployment-7df687f8cd-tfkgd 9696:9696

kubectl apply -f service.yaml
kubectl port-forward service/ping 8080:80

kind load docker-image zoomcamp-10-model:xception-v4-001

kubectl port-forward tf-serving-clothing-model-85cd4b7fc9-rntfw 8500:8500

kubectl port-forward service/tf-serving-clothing-model 8500:8500

kind load docker-image zoomcamp-10-gateway:002

kubectl exec -it ping-deployment-577d56ccf5-p2bdq -- bash

apt update
apt install curl telnet
telnet tf-serving-clothing-model.default.svc.cluster.local 8500

kubectl port-forward service/gateway 8080:80

ACCOUNT_ID=387546586013
REGION=eu-west-1
REGISTRY_NAME=mlzoomcamp-images
PREFIX=${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REGISTRY_NAME}

GATEWAY_LOCAL=zoomcamp-10-gateway:002
GATEWAY_REMOTE


class OpackParser : ParseCompanion() {

    fun parseTopLevel(bytes: ByteArray): OpackObject {
        parseOffset = 0
        val result = parse(bytes)

        check(parseOffset >= bytes.size){ "input data not fully consumed" }

        return result
    }

    private fun parse(bytes: ByteArray): OpackObject {
        val typeByte = bytes[parseOffset].toUByte().toUInt()
        //Logger.log("parsing type byte: 0x${typeByte.toString(16)}")
        return when(typeByte) {
            0x01u, 0x02u -> parseAsBool(bytes)
            0x05u -> parseAsUUID(bytes)
            0x06u -> parseAsDate(bytes)
            in 0x08u..0x2fu -> parseAsInt(bytes)
            0x30u, 0x31u, 0x32u, 0x33u -> parseAsInt(bytes)
            0x35u, 0x36u -> parseAsFloat(bytes)
            in 0x40u..0x60u -> parseAsString(bytes)
            in 0x61u..0x64u -> parseAsString(bytes)
            in 0x70u..0x90u -> parseAsData(bytes)
            in 0x91u..0x94u -> parseAsData(bytes)
            in 0xd0u..0xdfu -> parseAsArray(bytes)
            in 0xe0u..0xefu -> parseAsDict(bytes)
            else -> throw Exception("Unsupported type 0x${typeByte.toString(16)}")
        }
    }

    private fun parseAsBool(bytes: ByteArray): OpackObject {
        val byte = readInt(bytes, 1)
        return when (byte) {
            0x01 -> OPTrue()
            0x02 -> OPFalse()
            else -> throw Exception("Unexpected OPACK boolean ${bytes.hex()}")
        }
    }

    private fun parseAsUUID(bytes: ByteArray): OPData {
        val type = readInt(bytes, 1)
        if(type != 0x05)
            throw Exception("Unexpected OPACK UUID ${bytes.hex()}")
        val uuid = readBytes(bytes, 16)
        return OPData(uuid)
    }

    private fun parseAsDate(bytes: ByteArray): OPDate {
        val type = readInt(bytes, 1)
        if(type != 0x06)
            throw Exception("Unexpected OPACK date ${bytes.hex()}")
        val timestamp = readBytes(bytes, 8).readDouble(ByteOrder.BIG)
        return OPDate(timestamp)
    }

    private fun parseAsInt(bytes: ByteArray): OPInt {
        val type = readInt(bytes, 1)

        // NOTE: deviation from prior documentation ("Analyzing Apple’s private wireless communication protocols with a focus on security and privacy")
        // instead of linar byte length increments (1, 2, 3, 4) it seems apple uses exponential increments (1, 2, 4, 8)
        // is this an error in the documentation, or do both versions exist?
        // we also assume these are all signed - i don't actually know if that's the case, but we also don't have a counterexample
        return when(type) {
            in 0x08..0x2f -> OPInt((type - 8).toLong())
            0x30 -> OPInt(readInt(bytes, 1, explicitlySigned = true))
            0x31 -> OPInt(readInt(bytes, 2, explicitlySigned = true, byteOrder = ByteOrder.LITTLE))
            0x32 -> OPInt(readInt(bytes, 4, explicitlySigned = true, byteOrder = ByteOrder.LITTLE))
            0x33 -> OPInt(readLong(bytes, 8, byteOrder = ByteOrder.LITTLE))
            else -> throw Exception("Unexpected OPACK int ${bytes.hex()}")
        }
    }

    private fun parseAsFloat(bytes: ByteArray): OPReal {
        val type = readInt(bytes, 1)
        when(type) {
            0x35 -> {
                return OPReal(readBytes(bytes, 4).readFloat(ByteOrder.LITTLE).toDouble())
            }
            0x36 -> {
                return OPReal(readBytes(bytes, 8).readDouble(ByteOrder.LITTLE))
            }
            else -> throw Exception("Unexpected OPACK floa


 HttpConnectionUtil httpConnectionUtil) {
        this.mRules = mRules;
        this.httpConnectionUtil = httpConnectionUtil;
    }

    JsonElement getUrl(URL url)
            throws IOException {
        URL normalizedUrl;
        try {
            normalizedUrl = url.toURI().normalize().toURL();
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
        LOG.info("Fetching " + normalizedUrl.toString());

        HttpURLConnection request = httpConnectionUtil.getConnection(normalizedUrl);
        // @since 20.1.0
        request.setRequestProperty("Accept", "application/vnd.go.cd.v1+json");
        request.setRequestProperty("User-Agent", "plugin/slack.notifier");

        // Add in our HTTP authorization credentials if we have them.
        // Favor the API Token over username/password
        String authHeader = null;
        if (isNotEmpty(mRules.getGoAPIToken())) {
            authHeader = "Bearer " + mRules.getGoAPIToken();
        } else if (isNotEmpty(mRules.getGoLogin()) && isNotEmpty(mRules.getGoPassword())) {
            String userpass = mRules.getGoLogin() + ":" + mRules.getGoPassword();
            authHeader = "Basic " + DatatypeConverter.printBase64Binary(userpass.getBytes());
        }
        if (authHeader != null) {
            request.setRequestProperty("Authorization", authHeader);
        }

        request.connect();

        return httpConnectionUtil.responseToJson(request.getContent());
    }

    /**
     * Get the recent history of a pipeline.
     */
    public History getPipelineHistory(String pipelineName)
            throws MalformedURLException, IOException {
        URL url = new URL(String.format("%s/go/api/pipelines/%s/history",
                mRules.getGoAPIServerHost(), pipelineName));
        JsonElement json = getUrl(url);
        return httpConnectionUtil.convertResponse(json, History.class);
    }

    /**
     * Get a specific instance of a pipeline.
     */
    public Pipeline getPipelineInstance(String pipelineName, int pipelineCounter)
            throws MalformedURLException, IOException {
        URL url = new URL(String.format("%s/go/api/pipelines/%s/%d",
                mRules.getGoAPIServerHost(), pipelineName, pipelineCounter));
        JsonElement json = getUrl(url);
        return httpConnectionUtil.convertResponse(json, Pipeline.class);
    }
}
package in.ashwanthkumar.slack.webhook;

import org.junit.Test;

import static in.ashwanthkumar.slack.webhook.SlackLinkUtils.*;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class SlackLinkUtilsTest {
    @Test
    public void shouldGenerateEmailInLinkableFormat() {
        assertThat(email("foo-bar@ashwanthkumar.in", "Ashwanth"), is("<mailto:foo-bar@ashwanthkumar.in|Ashwanth>"));
        assertThat(email("foo-bar@ashwanthkumar.in"), is("<mailto:foo-bar@ashwanthkumar.in>"));
    }

    @Test
    public void shouldGenrateHrefsInLinkFormat() {
        assertThat(link("www.foo.com", "Foo"), is("<www.foo.com|Foo>"));
        assertThat(link("www.foo.com"), is("<www.foo.com>"));
    }

    @Test
    public void shouldGenerateUserHandlesInLinkableFormat() {
        assertThat(user("ashwanthkumar", "Ash"), is("<@ashwanthkumar|Ash>"));
        assertThat(user("ashwanthkumar"), is("<@ashwanthkumar>"));
    }

    @Test
    public void shouldGen


td>''');
  }

  sb.write('''

''');

  for (DiffBlock block in blocks) {
    String className;
    switch (block.kind) {
      case DiffKind.UNMATCHED:
        className = '${ClassNames.cell}';
        break;
      case DiffKind.MATCHING:
        className =
            '${ClassNames.cell} ${ClassNames.corresponding(alternating)}';
        alternating = !alternating;
        break;
      case DiffKind.IDENTICAL:
        className = '${ClassNames.cell} ${ClassNames.identical(alternating)}';
        alternating = !alternating;
        break;
    }
    sb.write('
');
    for (DiffColumn column in columns) {
      sb.write('''''');
      HtmlPrintContext context = HtmlPrintContext(
          lineNoWidth: 4,
          includeAnnotation: (Annotation annotation) {
            CodeLineAnnotation data = annotation.data;
            return data.annotationType == AnnotationType.WITH_SOURCE_INFO ||
                data.annotationType == AnnotationType.ADDITIONAL_SOURCE_INFO;
          },
          getAnnotationData: getAnnotationData,
          getLineData: getLineData);
      if (column.type == 'js') {
        context = printContexts[column.index!];
      }
      block.printHtmlOn(column, sb, context);
      sb.write('''	''');
    }
    sb.write('
');
  }

  sb.write('''

''');

  for (DiffColumn column in columns) {
    sb.write('''

''');
    if (column.type == 'js') {
      sb.write(outputs[column.index!].coverage);
    }
    sb.write('''	''');
  }

  sb.write('''

<input type="checkbox" id="box-${ClassNames.column(column_js0)}"
  onclick="javascript:toggleDisplay('${ClassNames.column(column_js0)}')"
  checked>
Left JavaScript code

<input type="checkbox" id="box-${ClassNames.column(column_js1)}"
  onclick="javascript:toggleDisplay('${ClassNames.column(column_js1)}')"
  checked>
Right JavaScript code

<input type="checkbox" id="box-${ClassNames.column(column_dart)}"
  onclick="javascript:toggleDisplay('${ClassNames.column(column_dart)}')"
  checked>

Dart code

<input type="checkbox" id="box-${ClassNames.inlinedDart}"
  onclick="javascript:toggleDisplay('${ClassNames.inlinedDart}')" checked>

Inlined Dart code

<input type="checkbox" id="box-${ClassNames.markers}"
  onclick="javascript:toggle${ClassNames.markers}()"
  ${showMarkers ? 'checked' : ''}>

Source information markers

<input type="checkbox" id="box-${ClassNames.sourceMapped}"
  onclick="javascript:toggle${ClassNames.sourceMapped}()"
  ${showSourceMapped ? 'checked' : ''}>

Source mapped Dart code

''');

  File file = File(out);
  file.writeAsStringSync(sb.toString());
  print('Diff generated in ${file.absolute.uri}');
}

class CodeLinesResult {
  final List<CodeLine> codeLines;
  final Coverage coverage;
  final Map<int, MemberEntity> elementMap;
  final SourceFileManager sourceFile


448.894l-2.991 1.496zM12 10.809V13.5a.5.5 0 11-1 0v-2.691L8.276 9.447a.5.5 0 01.448-.894L11.5 9.94l2.776-1.388a.5.5 0 11.448.894L12 10.81z"fill="currentColor"fill-rule="evenodd"></path></svg><svg xmlns="http://www.w3.org/2000/svg"viewBox="0 0 26 28"id="ar-red-icon"><path d="M24.882 5.907a.726.726 0 01.41.67v5.09a.73.73 0 01-1.459 0V7.742l-3.32 1.66a.73.73 0 11-.652-1.304l3.071-1.536-3.07-1.535a.73.73 0 01.652-1.304l4.368 2.184zm.41 15.224a.725.725 0 01-.41.67l-4.368 2.185a.73.73 0 01-.653-1.305l3.071-1.535-3.07-1.535a.73.73 0 01.652-1.305l3.32 1.66v-3.924a.73.73 0 111.458 0v5.09zm-22.432.015l3.07 1.535a.73.73 0 01-.652 1.305L.91 21.8a.726.726 0 01-.41-.67v-5.09a.73.73 0 111.458 0v3.925l3.32-1.66a.73.73 0 01.652 1.305l-3.07 1.535zM1.958 7.742v3.925a.73.73 0 01-1.458 0v-5.09a.725.725 0 01.41-.67l4.368-2.184a.73.73 0 01.652 1.304L2.86 6.562l3.07 1.536a.73.73 0 01-.652 1.304l-3.32-1.66zM12.557.084a.726.726 0 01.678 0l4.362 2.18a.73.73 0 01-.652 1.305l-3.32-1.66v3.924a.73.73 0 11-1.458 0V1.91l-3.32 1.66a.73.73 0 01-.652-1.305l4.362-2.18zm.678 27.54a.726.726 0 01-.678 0l-4.362-2.18a.73.73 0 01.652-1.305l3.32 1.66v-3.924a.73.73 0 111.458 0v3.924l3.32-1.66a.73.73 0 01.652 1.305l-4.362 2.18zm.39-14.778v3.925a.73.73 0 11-1.458 0v-3.925l-3.972-1.985a.73.73 0 11.652-1.305l4.049 2.025 4.049-2.025a.73.73 0 11.652 1.305l-3.972 1.985z"fill="#CF0A2C"fill-rule="nonzero"></path></svg><svg xmlns="http://www.w3.org/2000/svg"viewBox="0 0 13 9"id="available-icon"><path d="M1 5l2.984 3 7.588-7"fill="none"fill-rule="evenodd"stroke="#009731"stroke-width="2"stroke-linecap="round"stroke-linejoin="round"></path></svg><svg xmlns="http://www.w3.org/2000/svg"viewBox="0 0 24 24"id="back-to-top-icon"><g fill="none"fill-rule="evenodd"><path d="M0 0h24v2H0z"fill="#151415"></path><path d="M4.96 11.98l7.04-7 6.96 7"stroke="#000"stroke-width="2"></path><path


  assert.strictEqual(16, b.writeDoubleLE(0, 8));
}

{
  // test unmatched surrogates not producing invalid utf8 output
  // ef bf bd = utf-8 representation of unicode replacement character
  // see https://codereview.chromium.org/121173009/
  const buf = Buffer.from('ab\ud800cd', 'utf8');
  assert.strictEqual(buf[0], 0x61);
  assert.strictEqual(buf[1], 0x62);
  assert.strictEqual(buf[2], 0xef);
  assert.strictEqual(buf[3], 0xbf);
  assert.strictEqual(buf[4], 0xbd);
  assert.strictEqual(buf[5], 0x63);
  assert.strictEqual(buf[6], 0x64);
}

{
  // test for buffer overrun
  const buf = Buffer.from([0, 0, 0, 0, 0]); // length: 5
  const sub = buf.slice(0, 4);         // length: 4
  assert.strictEqual(sub.write('12345', 'latin1'), 4);
  assert.strictEqual(buf[4], 0);
  assert.strictEqual(sub.write('12345', 'binary'), 4);
  assert.strictEqual(buf[4], 0);
}

{
  // test alloc with fill option
  const buf = Buffer.alloc(5, '800A', 'hex');
  assert.strictEqual(buf[0], 128);
  assert.strictEqual(buf[1], 10);
  assert.strictEqual(buf[2], 128);
  assert.strictEqual(buf[3], 10);
  assert.strictEqual(buf[4], 128);
}

// Check for fractional length args, junk length args, etc.
// https://github.com/joyent/node/issues/1758

// Call .fill() first, stops valgrind warning about uninitialized memory reads.
Buffer.allocUnsafe(3.3).fill().toString();
// throws bad argument error in commit 43cb4ec
Buffer.alloc(3.3).fill().toString();
assert.strictEqual(Buffer.allocUnsafe(NaN).length, 0);
assert.strictEqual(Buffer.allocUnsafe(3.3).length, 3);
assert.strictEqual(Buffer.from({ length: 3.3 }).length, 3);
assert.strictEqual(Buffer.from({ length: 'BAM' }).length, 0);

// Make sure that strings are not coerced to numbers.
assert.strictEqual(Buffer.from('99').length, 2);
assert.strictEqual(Buffer.from('13.37').length, 5);

// Ensure that the length argument is respected.
['ascii', 'utf8', 'hex', 'base64', 'latin1', 'binary'].forEach((enc) => {
  assert.strictEqual(Buffer.allocUnsafe(1).write('aaaaaa', 0, 1, enc), 1);
});

{
  // Regression test, guard against buffer overrun in the base64 decoder.
  const a = Buffer.allocUnsafe(3);
  const b = Buffer.from('xxx');
  a.write('aaaaaaaa', 'base64');
  assert.strictEqual(b.toString(), 'xxx');
}

// issue GH-3416
Buffer.from(Buffer.allocUnsafe(0), 0, 0);

// issue GH-5587
assert.throws(() => Buffer.alloc(8).writeFloatLE(0, 5), RangeError);
assert.throws(() => Buffer.alloc(16).writeDoubleLE(0, 9), RangeError);

// attempt to overflow buffers, similar to previous bug in array buffers
assert.throws(() => Buffer.allocUnsafe(8).writeFloa


ror_report()

    def _build_header(self, report_date: datetime) -> str:
        """Build report header"""
        return f"""# 🇪🇨 Hive Ecuador Pulse - Reporte Diario

## 📅 {self.format_date(report_date)}

¡Bienvenidos al reporte diario de la comunidad **Hive Ecuador**! 🎉

Aquí encontrarás un resumen completo de la actividad, engagement y crecimiento de nuestra vibrante comunidad ecuatoriana en Hive.

---

"""

    def _build_summary(self, community_metrics: CommunityMetrics) -> str:
        """Build executive summary section"""
        if not community_metrics:
            return ""

        # Calculate activity rate
        activity_rate = (community_metrics.active_users / community_metrics.total_users * 100) if community_metrics.total_users > 0 else 0

        return f"""## 📊 Resumen Ejecutivo

| Métrica | Valor |
|---------|-------|
| 👥 **Usuarios Totales** | {self.format_number(community_metrics.total_users)} |
| 🔥 **Usuarios Activos** | {self.format_number(community_metrics.active_users)} ({self.format_percentage(activity_rate)}) |
| 📝 **Posts Publicados** | {self.format_number(community_metrics.total_posts)} |
| 💬 **Comentarios** | {self.format_number(community_metrics.total_comments)} |
| 💰 **Recompensas Totales** | {self.format_currency(community_metrics.total_rewards)} |
| 📈 **Tasa de Crecimiento** | {self.format_percentage(community_metrics.growth_rate)} |

---

"""

    def _build_community_stats(self, community_metrics: CommunityMetrics) -> str:
        """Build detailed community statistics"""
        if not community_metrics:
            return ""

        return f"""## 🏛 Estadísticas de la Comunidad

### 📈 Métricas Clave

- **Engagement Rate**: {community_metrics.engagement_rate:.2f} comentarios por post
- **Recompensa Promedio**: {self.format_currency(community_metrics.avg_post_reward)} por post
- **Actividad Total**: {self.format_number(community_metrics.total_posts + community_metrics.total_comments)} interacciones

### 🎯 Análisis de Participación

"""

        # Add participation analysis
        if community_metrics.total_users > 0:
            activity_rate = (community_metrics.active_users / community_metrics.total_users * 100)

            if activity_rate > 60:
                participation_analysis = "🎉 **Excelente participación** - La comunidad está muy activa y comprometida."
            elif activity_rate > 30:
                participation_analysis = "✅ **Buena participación** - La comunidad muestra un nivel saludable de actividad."
            elif activity_rate > 15:
                participation_analysis = "⚠ **Participación moderada** - Hay oportunidades para aumentar el engagement."
            else:
                participation_analysis = "📢 **Baja participación** - La comunidad necesita estrategias para incrementar la actividad."

            return f"""## 🏛 Estadísticas de la Comunidad

### 📈 Métricas Clave

- **Engagement Rate**: {community_metrics.engagement_rate:.2f} comentarios por post
- **Recompensa Promedio**: {self.format_currency(community_metrics.avg_post_reward)} por post
- **Actividad Total**: {self.format_number(community_metrics.total_posts + community_metrics.total_comments)} interacciones

### 🎯 Análisis de Participación

{participation_analysis}

---

"""

        return ""

    def _build_top_users(self, user_metrics: List[UserMetrics], limit: int = 10) -> str:
        """Build top users section"""
        if not user_metrics:
            return ""

        content = f"""## 🌟 Top Contributors del Día

### 🏆 Usuarios Más Activos

"""

        # Sort by total activity
        sorted_users = sorted(user_metrics, key=lambda x: x.posts_count + x.comments_count, reverse=True)

        for i, user in enumerate(sorted_users[:limit], 1):
            total_activity = user.posts_count + user.comments_count
            activity_emoji = "🔥" if total_activity > 20 else "⭐" if total_activity > 10 else "👍"

            content += f"{i}. {activity_emoji} **@{user.username}** - {total_activity} actividades "
            content += f"({user.posts_count} posts, {user.comments_count} comentarios)\n"

        content += "\n### 💰 Top Earners\n\n"

        # Sort by rewards
        sorted_by_rewards = sorted(user_metrics, key=lambda x: x.total_rewards, reverse=True)

        for i, user in enumerate(sorted_by_rewards[:5], 1):
            if use


    print("Percentage of Correctly Classified Not-a-Dog Images: {:.2f}%".format(results_stats_dic['pct_correct_notdogs']))

    # Print percentage of correctly classified breeds
    print("Percentage of Correctly Classified Dog Breeds: {:.2f}%".format(results_stats_dic['pct_correct_breed']))

    # Print details of incorrectly classified dogs if requested
    if print_incorrect_dogs and (results_stats_dic['n_correct_dogs'] + results_stats_dic['n_correct_notdogs'] != results_stats_dic['n_images']):
        print("\nIncorrectly Classified Dogs:")

        for key in results_dic:
            if sum(results_dic[key][3:]) == 1:
                print("Real: {:>26}   Classifier: {:>30}".format(results_dic[key][0], results_dic[key][1]))

    if print_incorrect_breed and results_stats_dic['n_correct_dogs'] != results_stats_dic['n_correct_breed']:
        print("\nIncorrectly Classified Dog Breeds:")

        for key in results_dic:
            if sum(results_dic[key][3:]) == 2 and results_dic[key][2] == 1:
                print("Real: {:>26}   Classifier: {:>30}".format(results_dic[key][0], results_dic[key][1]))

    print("\n*** Overall Statistics ***")

    for key in results_stats_dic:

        if key.startswith('pct'):
            print("{}: {:.2f}%".format(key, results_stats_dic[key]))
        else:
            print("{}: {}".format(key, results_stats_dic[key]))


        Check(3)..GLfloat.const.p("v")
    )

    void(
        "VertexAttrib4f",

        GLuint("index"),
        GLfloat("x"),
        GLfloat("y"),
        GLfloat("z"),
        GLfloat("w")
    )

    void(
        "VertexAttrib4fv",

        GLuint("index"),
        Check(4)..GLfloat.const.p("v")
    )

    OffHeapOnly..void(
        "VertexAttribPointer",

        GLuint("index"),
        GLint("size"),
        GLenum("type"),
        GLboolean("normalized"),
        GLsizei("stride"),
        MultiType(
            PointerMapping.DATA_SHORT, PointerMapping.DATA_INT, PointerMapping.DATA_FLOAT
        )..Unsafe..RawPointer..void.const.p("pointer")
    )

    void(
        "Viewport",

        GLint("x"),
        GLint("y"),
        GLsizei("width"),
        GLsizei("height")
    )
}/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 */
package sdl.templates

import org.lwjgl.generator.*
import sdl.*

val SDL_iostream = "SDLIOStream".nativeClassSDL("SDL_iostream") {
    EnumConstant(
        "IO_STATUS_READY".enum("0"),
        "IO_STATUS_ERROR".enum,
        "IO_STATUS_EOF".enum,
        "IO_STATUS_NOT_READY".enum,
        "IO_STATUS_READONLY".enum,
        "IO_STATUS_WRITEONLY".enum
    )

    EnumConstant(
        "IO_SEEK_SET".enum("0"),
        "IO_SEEK_CUR".enum,
        "IO_SEEK_END".enum
    )

    StringConstant(
        "PROP_IOSTREAM_WINDOWS_HANDLE_POINTER".."SDL.iostream.windows.handle",
        "PROP_IOSTREAM_STDIO_FILE_POINTER".."SDL.iostream.stdio.file",
        "PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER".."SDL.iostream.file_descriptor",
        "PROP_IOSTREAM_ANDROID_AASSET_POINTER".."SDL.iostream.android.aasset"
    )

    StringConstant(
        "PROP_IOSTREAM_MEMORY_POINTER".."SDL.iostream.memory.base",
        "PROP_IOSTREAM_MEMORY_SIZE_NUMBER".."SDL.iostream.memory.size"
    )

    StringConstant(
        "PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER".."SDL.iostream.dynamic.memory",
        "PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER".."SDL.iostream.dynamic.chunksize"
    )

    SDL_IOStream.p(
        "IOFromFile",

        charUTF8.const.p("file"),
        charASCII.const.p("mode")
    )

    SDL_IOStream.p(
        "IOFromMem",

        void.p("mem"),
        AutoSize("mem")..size_t("size")
    )

    SDL_IOStream.p(
        "IOFromConstMem",

        void.const.p("mem"),
        AutoSize("mem")..size_t("size")
    )

    SDL_IOStream.p(
        "IOFromDynamicMem",

        void()
    )

    SDL_IOStream.p(
        "OpenIO",

        SDL_IOStreamInterface.const.p("iface"),
        nullable..opaque_p("userdata")
    )

    bool(
        "CloseIO",

        SDL_IOStream.p("context")
    )

    SDL_PropertiesID(
        "GetIOProperties",

        SDL_IOStream.p("context")
    )

    SDL_IO


9f, 0x31,
	0x1d, 0xe1, 0x19, 0xd4, 0x87, 0x46, 0x32, 0xf0, 0x48, 0x74, 0xbd, 0x9c, 0x0b, 0xd3, 0xc6, 0x21,
	0x7b, 0x42, 0x73, 0xc1, 0x33, 0xbb, 0x87, 0xd0, 0x79, 0xe1, 0x8e, 0x03, 0x1a, 0x66, 0x19, 0xdc,
	0x83, 0x7a, 0xd2, 0x91, 0x91, 0x5d, 0xd6, 0x5c, 0x9c, 0x10, 0xec, 0x8d, 0x89, 0x7b, 0x99, 0x43,
	0x46, 0xb0, 0xb8, 0xaf, 0x2a, 0xa8, 0x51, 0xfa, 0x4a, 0xfd, 0x60, 0x99, 0xd0, 0x48, 0xd0, 0xcd,
	0x4a, 0x34, 0x4c, 0x6f, 0x36, 0x53, 0x72, 0xf6, 0x0d, 0x2c, 0xf5, 0x46, 0xd4, 0x7b, 0xc7, 0xe2,
	0xec, 0x06, 0xcf, 0x01, 0xf2, 0xba, 0x5b, 0x89, 0xee, 0x53, 0x7d, 0xc6, 0xbe, 0x32, 0x75, 0x3f,
	0xbb, 0xcd, 0x13, 0x55, 0x82, 0x8d, 0xf6, 0x07, 0x50, 0xef, 0xab, 0x19, 0x5c, 0xa0, 0xf5, 0x6a,
	0x39, 0x4d, 0x35, 0x5e, 0x38, 0x25, 0x37, 0x9a, 0xde, 0xd4, 0xf5, 0x9f, 0x1b, 0xff, 0xfd, 0x3b,
	0x00, 0x00, 0xff, 0xff, 0xb2, 0xa0, 0x6e, 0x6c, 0xea, 0x10, 0x00, 0x00,
}

package main

import "fmt"
import "time"

func producer(/*TODO: parameters?*/){

    for i := 0; i < 10; i++ {
        time.Sleep(100 * time.Millisecond)
        fmt.Printf("[producer]: pushing %d\n", i)
        // TODO: push real value to buffer
    }

}

func consumer(/*TODO: parameters?*/){

    time.Sleep(1 * time.Second)
    for {
        i := 0 //TODO: get real value from buffer
        fmt.Printf("[consumer]: %d\n", i)
        time.Sleep(50 * time.Millisecond)
    }

}

func main(){

    // TODO: make a bounded buffer

    go consumer()
    go producer()

    select {}
}// Use `go run foo.go` to run your program

package main

import (
    . "fmt"
    "runtime"
    "time"
)

var i = 0

func incrementing() {
    //TODO: increment i 1000000 times
}

func decrementing() {
    //TODO: decrement i 1000000 times
}

func main() {
    // What does GOMAXPROCS do? What happens if you set it to 1?
    runtime.GOMAXPROCS(2)

    // TODO: Spawn both functions as goroutines

    // We have no direct way to wait for the completion of a goroutine (without additional synchronization of some sort)
    // We will do it properly with channels soon. For now: Sleep.
    time.Sleep(500*time.Millisecond)
    Println("The magic number is:", i)
}
package main

import (
	"connectrpc.com/connect"
	"connectrpc.com/grpcreflect"
	"context"
	notesv1 "github.com/LarsNorlander/buf-notes-go/gen/larsnorlander/notes/v1"
	"github.com/LarsNorlander/buf-notes-go/gen/larsnorl


r1, %r9
	setx	0x6dadbe3671f5cc5f, %r1, %r10
	stw	%r10, [%r9]
	setx	0x000000cb8d539978, %r1, %r12
	ldub	[%r12], %r11
	setx	0x000000800fff3189, %r1, %r12
	ldub	[%r12], %r11
	setx	0x000000800ec40c89, %r1, %r12
	ldub	[%r12], %r11
	setx	0x000000e000000040, %r1, %r12
	ldda	[%r12]ASI_BLK_P, %f0
	stda	 %f0, [%r12]ASI_BLK_P
	stda	 %f0, [%r12]ASI_BLK_P
	stda	 %f0, [%r12]ASI_BLK_P
	membar	 0x40
	setx	0x000000f000000000, %r1, %r12
	ldda	[%r12]ASI_BLK_P, %f0
	stda	 %f0, [%r12]ASI_BLK_P
	stda	 %f0, [%r12]ASI_BLK_P
	stda	 %f0, [%r12]ASI_BLK_P
	membar	 0x40
	setx	0x0000001040100000, %r1, %r9
	setx	0x6dadbe3671f5cc5f, %r1, %r10
	stx	%r10, [%r9]
	setx	0x000000ca7a191148, %r1, %r12
	ldub	[%r12], %r11
	setx	0x00000010d0100000, %r1, %r9
	setx	0x6dadbe3671f5cc5f, %r1, %r10
	ldx	[%r9], %r10
	setx	0x000000800fbdff78, %r1, %r12
	lduh	[%r12], %r11
	setx	0x000000800e99744c, %r1, %r12
	lduh	[%r12], %r11
	setx	0x000000f0d5c730bc, %r1, %r12
	lduh	[%r12], %r11
	setx	0x000000e8b3214444, %r1, %r12
	lduh	[%r12], %r11
	setx	0x000000d2dc857768, %r1, %r12
	lduh	[%r12], %r11
	setx	0x000000caf7b5ea80, %r1, %r12
	lduh	[%r12], %r11
	setx	0x000000800f62d116, %r1, %r12
	lduh	[%r12], %r11
	setx	0x000000fe7f797888, %r1, %r12
	lduw	[%r12], %r11
	setx	0x000000ef86675208, %r1, %r12
	lduw	[%r12], %r11
	setx	0x000000d1f9c9410c, %r1, %r12
	lduw	[%r12], %r11
	setx	0x000000e54b2a5978, %r1, %r12
	ldx	[%r12], %r11
	setx	0x000000d9c3fe2558, %r1, %r12
	ldx	[%r12], %r11
	setx	0x000000ca2183b9d8, %r1, %r12
	ldx	[%r12], %r11
	setx	0x000000800fb


_removed = 1;
		    P_DELETE(td_ident_line);
		}
	    }

	    // insert remaining triangle as new lines
	    if(!ca_removed){
		P_Sur_2D_Line *td_new_line = new P_Sur_2D_Line(point_a, point_c);
		this->lines.insert(td_new_line); // append is better
	    }
	    if(!bc_removed){
		P_Sur_2D_Line *td_new_line = new P_Sur_2D_Line(point_c, point_b);
		this->lines.insert(td_new_line); // append is better
	    }

	    // proceed to next base line for next triangle
	    break;
	} // end for all points
    } // end for all base_lines

    // clean up
    P_DELETE(td_ca_line);
    P_DELETE(td_bc_line);

    // lines and points are no longer needed
    int i;
    for(i=this->orig_surface->n_lines-1; i>=0; --i){
//	delete this->line_array[i];
	delete this->point_array[i];
    }

    if(wrong_flag){
	return "something went wrong in calc_triangle_representation! break...\n";
    }
    return IVP_NO_ERROR;
}

void ivp_check_for_opposite(IVP_Hash *hash, IVP_Poly_Point *p0, IVP_Poly_Point *p1, IVP_Tri_Edge *edge)
{
    IVP_Poly_Point *hashval[2];
    if(p0<p1){
	hashval[0] = p0;
	hashval[1] = p1;
    }else{
	hashval[0] = p1;
	hashval[1] = p0;
    }
    IVP_Tri_Edge *edge2;
    edge2 = (IVP_Tri_Edge *)hash->find((char *)(&hashval[0]));
    if(!edge2){
	// add
	hash->add((char *)(&hashval[0]), (void *)edge);
    }else{
	// opposites now known -> add
	edge->opposite = edge2;
	edge2->opposite = edge;
    }
}

IVP_Object_Polygon_Tetra::IVP_Object_Polygon_Tetra(IVP_Template_Polygon *i_temp_pop)
{
    P_MEM_CLEAR(this);
    this->template_polygon = i_temp_pop;

    this->n_points = i_temp_pop->n_points;
    this->points = (IVP_Poly_Point *)p_calloc(sizeof(IVP_Poly_Point), this->n_points);
    int i;
    for (i=0;i<this->n_points;i++){
	IVP_U_Point *p = &i_temp_pop->points[i];
	this->points[i].set( p );
	this->points[i].l_tetras = this;
    }

    this->n_surfaces = i_temp_pop->n_surfaces;
    this->surfaces = (IVP_Poly_Surface *)p_calloc(sizeof(IVP_Poly_Surface), this->n_surfaces);
    for (i=0;i<this->n_surfaces;i++){
	this->surfaces[i].set( &i_temp_pop->surfaces[i], this );
    }

    template_polygon = NULL;
}

void IVP_Poly_Surface::set(IVP_Template_Surface *templ_sur,
			  IVP_Object_Polygon_Tetra *i_tetras)
{
    this->tetras = i_tetras;
    IVP_USE(templ_sur);
}

int IVP_Poly_Surface::get_surface_index(){
    return this - tetras->surfaces;
}

IVP_Object_Polygon_Tetra::~IVP_Object_Polygon_Tetra()
{
    this->free_triangles();
    P_FREE(this->su


}

template<typename T, typename Receiver>
void GSRowKeyPredicateTag::getRangeKey(
		const T *&key, RangeElementType rangeElemType,
		const Receiver &receiver) const {
	RowMapper::VarDataPool &pool = store_->getVarDataPool();
	pool.clear();

	const RangeKeyEntry &rangeKeyEntry = rangeKeyEntries_[rangeElemType];
	if (!rangeKeyEntry.second) {
		key = NULL;
		return;
	}

	T *keyPtr = static_cast<T*>(pool.allocate(sizeof(GSValue)));
	*keyPtr = receiver.receive(*this, rangeKeyEntry.first, pool);
	key = keyPtr;
}

void GSRowKeyPredicateTag::setRangeKey(
		TinyRowKey &key, RangeElementType rangeElemType) {
	RangeKeyEntry &rangeKeyEntry = rangeKeyEntries_[rangeElemType];
	clearRangeKeyEntry(rangeKeyEntry);

	if (key.empty()) {
		return;
	}

	rangeKeyEntry.first.swap(key);
	rangeKeyEntry.second = true;
}

template<typename T, typename Receiver>
void GSRowKeyPredicateTag::getDistinctKeys(
		const T *&keyList, size_t &size,
		const RowMapper::DetailElementType *expectedType,
		bool singleOnly, const Receiver &receiver) const {
	RowMapper::VarDataPool &pool = store_->getVarDataPool();
	pool.clear();

	checkKeyType(expectedType, singleOnly);

	if (distinctKeys_.get() == NULL || distinctKeys_->empty()) {
		keyList = NULL;
		size = 0;
		return;
	}

	const size_t distinctKeyCount = distinctKeys_->size();
	T *distinctKeyList =
			static_cast<T*>(pool.allocate(sizeof(T) * distinctKeyCount));

	T *destIt = distinctKeyList;
	try {
		for (DistinctKeySet::iterator it = distinctKeys_->begin();
				it != distinctKeys_->end(); ++it, ++destIt) {
			*destIt = receiver.receive(*this, *it, pool);
		}
	}
	catch (...) {
		while (destIt != distinctKeyList) {
			receiver.clear(*(--destIt));
		}
		pool.clear();
		throw;
	}

	assert(static_cast<size_t>(destIt - distinctKeyList) == distinctKeyCount);
	keyList = distinctKeyList;
	size = distinctKeyCount;
}

void GSRowKeyPredicateTag::addDistinctKey(TinyRowKey &key) {
	assert(!key.empty());

	bool inserted;
	try {
		if (distinctKeys_.get() == NULL) {
			distinctKeys_.reset(new DistinctKeySet(KeyLess(*mapper_)));
		}

		inserted = distinctKeys_->insert(key).second;
	}
	catch (...) {
		try {
			clearKey(key);
		}
		catch (...) {
		}
		throw;
	}
	if (!inserted) {
		clearKey(key);
	}
	key.clear();
}

void GSRowKeyPredicateTag::toTinyKey(const GSValue &src, TinyRowKey &dest) {
	dest.clear();
	dest.reserve(1);
	dest.push_back(
			RowMapper::copyValue(src, getKeyType(), this, util::FalseType()));
}

void GSRowKeyPredicateTag::toTinyKey(
		const GSRowKey &src, TinyRowKey &dest,
		RowMapper::VarDataPool &pool) {
	mapper_->checkKeySchemaMatched(src.getRowMapper());

	const RowMapper &keyMapper = resolveKeyMapper();
	const size_t entryCount = keyMapper.getEntryCount();

	dest.clear();
	dest.reserve(entryCount);
	pool.clear();
	try {
		for (size_t i = 0; i < entryCount; i++) {
			con


onigenc_unicode_is_code_ctype,
  get_ctype_code_range,
  left_adjust_char_head,
  onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
  onigenc_unicode_case_map,
#else
  NULL,
#endif
  ENCINDEX_UTF_8,
  ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("CP65001", "UTF-8")

/*
 * Name: UTF8-MAC
 * Link: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html
 * Link: http://developer.apple.com/qa/qa2001/qa1235.html
 * Link: http://developer.apple.com/jp/qa/qa2001/qa1235.html
 * Link: http://www.gnu.org/software/emacs/NEWS.23.2
 */
ENC_REPLICATE("UTF8-MAC", "UTF-8")
ENC_ALIAS("UTF-8-MAC", "UTF8-MAC")
ENC_ALIAS("UTF-8-HFS", "UTF8-MAC") /* Emacs 23.2 */


UN, 3.0f, false);
						Commands->Action_Goto (obj, params);
					}
					else
					{
						MX0_A02_Say_Something (obj, MX0_A02_SPEECH_GDI_02_BECKON, false);
					}
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_START_GDI_05):
				{
					MX0_A02_Say_Something (obj, MX0_A02_SPEECH_GDI_03_STARTUP, false);
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_PLAYER_CONGRATS):
				{
					if (default_state)
					{
						int speech_num = MX0_A02_SPEECH_GDI_PLAYER_CONGRATS_01 + param;
						MX0_A02_Say_Something (obj, speech_num, false);
					}
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_SOLDIER_CONGRATS):
				{
					if (default_state)
					{
						int speech_num = MX0_A02_SPEECH_GDI_SOLDIER_CONGRATS_01 + param;
						MX0_A02_Say_Something (obj, speech_num, false);
					}
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_PLAYER_RETREAT):
				{
					int speech_num = MX0_A02_SPEECH_GDI_PLAYER_RETREAT_01 + my_register_id - 1;
					MX0_A02_Say_Something (obj, speech_num, false);
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_GDI_NOTICES_NOD_01):
				{
					MX0_A02_Say_Something (obj, MX0_A02_SPEECH_GDI_NOTICES_NOD_01, false);
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_GDI_SHOOTS_NOD_01):
				{
					GameObject * target = Commands->Find_Object (param);
					if (target)
					{
						ActionParamsStruct params;
						params.Set_Basic(this, MX0_A02_PRIORITY_FORCED_ACTION, MX0_A02_ACTION_GDI_SHOOTS_NOD_01);
						params.Set_Attack(target, 300.0f, 0.0f, true);
						Commands->Action_Attack (obj, params);
					}
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_GDI_RESPONDS_01):
				{
					MX0_A02_Say_Something (obj, MX0_A02_SPEECH_GDI_RESPONDS_01, false);
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_GDI_SHOOTS_NOD_02):
				{
					GameObject * target = Commands->Find_Object (param);
					if (target)
					{
						ActionParamsStruct params;
						params.Set_Basic(this, MX0_A02_PRIORITY_FORCED_ACTION, MX0_A02_ACTION_GDI_SHOOTS_NOD_02);
						params.Set_Attack(target, 300.0f, 0.0f, true);
						Commands->Action_Attack (obj, params);
					}
					break;
				}
			case (MX0_A02_CUSTOM_TYPE_GET_APC_ID):
				{
					GameObject * apc = Commands->Find_Object (param);
					if (apc)
					{
						GameObject * controller = Commands->Find_Object (MX0_A02_CONTROLLER_ID);
						if (controller)
						{
							Commands->Send_Custom_Event (obj, controller, MX0_A02_CUSTOM_TYPE_APC_BLOWITUP, MX0_A02_CUSTOM_PARAM_DEFAULT, 1.0f);
						}
						Action


ss<C3>,
                                                private val function: (C1?,C2?,C3?) -> R)
    : RowLayout<R, Any?>() {

    override fun makeRowHandler(): RowHandler<R, Any?> =
            RowFun3Handler(rowClass, class1, class2, class3, function)
}

class ArrayOfMRowLayout<E:Any> (private val elementClass: Class<E>,
                                private val columnCount: Int,
                                private val defaultValue: E) : RowLayout<Array<out E>, E>() {

    override fun makeRowHandler(): RowHandler<Array<out E>, E> =
            RowArrayMHandler(elementClass, columnCount, defaultValue)
}

class ArrayOfNRowLayout<E:Any> (private val elementClass: Class<E>,
                                private val columnCount: Int) : RowLayout<Array<out E?>, E?>() {
    override fun makeRowHandler(): RowHandler<Array<out E?>, E?> =
            RowArrayNHandler(elementClass, columnCount)
}

class FieldByPositionRowLayout<F:Any> (val fieldClass: Class<F>, val position: Int) : RowLayout<F, F>() {
    override fun makeRowHandler(): RowHandler<F, F> {
        TODO("not implemented yet")
    }
}

class FieldByNameRowLayout<F:Any> (val fieldClass: Class<F>, val name: String) : RowLayout<F, F>() {
    override fun makeRowHandler(): RowHandler<F, F> {
        TODO("not implemented yet")
    }
}

package org.jetbrains.dekaf.mainTest

import lb.yaka.expectations.equalsTo
import lb.yaka.expectations.iz
import lb.yaka.expectations.zero
import lb.yaka.gears.expect
import org.jetbrains.dekaf.main.DbMaster
import org.jetbrains.dekaf.mainTest.util.H2memSettings
import org.jetbrains.dekaf.test.utils.UnitTest
import org.junit.jupiter.api.MethodOrderer
import org.junit.jupiter.api.Order
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestMethodOrder

@TestMethodOrder(MethodOrderer.OrderAnnotation::class)
class DbMasterTest : UnitTest {

    @Test @Order(1)
    fun open() {
        val facade = DbMaster.open(H2memSettings)
        expect that facade.countActiveSessions() iz zero
        expect that facade.isConnected() equalsTo false
    }

    @Test @Order(2)
    fun connect_disconnect() {
        val facade = DbMaster.open(H2memSettings)

        facade.connect()

        expect that facade.isConnected() equalsTo true
        expect that facade.isConnected(true) equalsTo true

        facade.disconnect()

        expect that facade.isConnected() equalsTo false
    }

    @Test @Order(3)
    fun session_ping() {
        val facade = DbMaster.open(H2memSettings)

        facade.connect()

        facade.openSession().use { session ->
            session.ping()
        }

        facade.disconnect()
    }

}@file:Suppress("platform_class_mapped_to_kotlin", "RemoveRedundantQualifierName")

package org.jetbrains.dekaf.jdbcTest.impl

import lb.yaka.expectations.*
import lb.yaka.gears.*
import org.jetbrains.dekaf.inter.common.StatementCategory.stmtQuery
import org.jetbrains.dekaf.jdbc.impl.JdbcColumnCursor
import org.junit.jupiter.api.MethodOrderer
import org.junit.jupiter.api.Order
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestMethodOrder

@TestMethodOrder(MethodOrderer.OrderAnnotation::class)
class JdbcIntsCursorTest : H2ConnectedTest() {

    @Test @Order(10)
    fun fetchSingleValue() {
        val text = "select * from values (1000001, 'labuda')"
        val r: IntArray? = session.openSeance().use


sed on the estimated speech level and, if enabled, updates
  // the (digital) compression gain to be applied by `agc_`. Must be called
  // after `HandleClipping()`. If `rms_error_override` has a value, RMS error
  // from AGC is overridden by it.
  void Process(rtc::ArrayView<const int16_t> audio,
               absl::optional<int> rms_error_override);

  // Returns the recommended input volume. Must be called after `Process()`.
  int recommended_analog_level() const { return recommended_input_volume_; }

  float voice_probability() const { return agc_->voice_probability(); }
  void ActivateLogging() { log_to_histograms_ = true; }
  absl::optional<int> new_compression() const {
    return new_compression_to_set_;
  }

  // Only used for testing.
  void set_agc(Agc* agc) { agc_.reset(agc); }
  int min_mic_level() const { return min_mic_level_; }

 private:
  // Sets a new input volume, after first checking that it hasn't been updated
  // by the user, in which case no action is taken.
  void SetLevel(int new_level);

  // Set the maximum input volume the AGC is allowed to apply. Also updates the
  // maximum compression gain to compensate. The volume must be at least
  // `kClippedLevelMin`.
  void SetMaxLevel(int level);

  int CheckVolumeAndReset();
  void UpdateGain(int rms_error_db);
  void UpdateCompressor();

  const int min_mic_level_;
  const bool disable_digital_adaptive_;
  std::unique_ptr<Agc> agc_;
  int level_ = 0;
  int max_level_;
  int max_compression_gain_;
  int target_compression_;
  int compression_;
  float compression_accumulator_;
  bool capture_output_used_ = true;
  bool check_volume_on_next_process_ = true;
  bool startup_ = true;

  // TODO(bugs.webrtc.org/7494): Create a separate member for the applied
  // input volume.
  // Recommended input volume. After `set_stream_analog_level()` is
  // called, it holds the observed applied input volume. Possibly updated by
  // `HandleClipping()` and `Process()`; after these calls, holds the
  // recommended input volume.
  int recommended_input_volume_ = 0;

  absl::optional<int> new_compression_to_set_;
  bool log_to_histograms_ = false;
  const int clipped_level_min_;

  // Frames since the last `UpdateGain()` call.
  int frames_since_update_gain_ = 0;
  // Set to true for the first frame after startup and reset, otherwise false.
  bool is_first_frame_ = true;
};

}  // namespace webrtc

#endif  // MODULES_AUDIO_PROCESSING_AGC_AGC_MANAGER_DIRECT_H_


ns are also correct we test some functions with string->number coercions
assert(bit32.lrotate("0x12345678", 4) == 0x23456781)
assert(bit32.rrotate("0x12345678", -4) == 0x23456781)
assert(bit32.arshift("0x12345678", 1) == 0x12345678 / 2)
assert(bit32.arshift("-1", 32) == 0xffffffff)
assert(bit32.arshift("-1", 1) == 0xffffffff)
assert(bit32.bnot("1") == 0xfffffffe)
assert(bit32.band("1", 3) == 1)
assert(bit32.band(1, "3") == 1)
assert(bit32.band(1, 3, "5") == 1)
assert(bit32.bor("1", 2) == 3)
assert(bit32.bor(1, "2") == 3)
assert(bit32.bor(1, 3, "5") == 7)
assert(bit32.bxor("1", 3) == 2)
assert(bit32.bxor(1, "3") == 2)
assert(bit32.bxor(1, 3, "5") == 7)
assert(bit32.btest(1, "3") == true)
assert(bit32.btest("1", 3) == true)
assert(bit32.countlz("42") == 26)
assert(bit32.countrz("42") == 1)
assert(bit32.extract("42", 1, 3) == 5)

return('OK')


.y, this.area.w, this.area.h);
      ctx.clip();
    }
  }
};

/**
 * Clears out all chart content and DOM elements.
 * This is called immediately before render() on every frame, including
 * during zooms and pans.
 * @private
 */
DygraphCanvasRenderer.prototype.clear = function() {
  var context;
  if (this.isIE) {
    // VML takes a while to start up, so we just poll every this.IEDelay
    try {
      if (this.clearDelay) {
        this.clearDelay.cancel();
        this.clearDelay = null;
      }
      context = this.elementContext;
    }
    catch (e) {
      // TODO(danvk): this is broken, since MochiKit.Async is gone.
      // this.clearDelay = MochiKit.Async.wait(this.IEDelay);
      // this.clearDelay.addCallback(bind(this.clear, this));
      return;
    }
  }

  context = this.elementContext;
  context.clearRect(0, 0, this.width, this.height);
};

/**
 * This method is responsible for drawing everything on the chart, including
 * lines, error bars, fills and axes.
 * It is called immediately after clear() on every frame, including during pans
 * and zooms.
 * @private
 */
DygraphCanvasRenderer.prototype.render = function() {
  // attaches point.canvas{x,y}
  this._updatePoints();

  // actually draws the chart.
  this._renderLineChart();
};

DygraphCanvasRenderer.prototype._createIEClipArea = function() {
  var className = 'dygraph-clip-div';
  var graphDiv = this.dygraph_.graphDiv;

  // Remove old clip divs.
  for (var i = graphDiv.childNodes.length-1; i >= 0; i--) {
    if (graphDiv.childNodes[i].className == className) {
      graphDiv.removeChild(graphDiv.childNodes[i]);
    }
  }

  // Determine background color to give clip divs.
  var backgroundColor = document.bgColor;
  var element = this.dygraph_.graphDiv;
  while (element != document) {
    var bgcolor = element.currentStyle.backgroundColor;
    if (bgcolor && bgcolor != 'transparent') {
      backgroundColor = bgcolor;
      break;
    }
    element = element.parentNode;
  }

  function createClipDiv(area) {
    if (area.w === 0 || area.h === 0) {
      return;
    }
    var elem = document.createElement('div');
    elem.className = className;
    elem.style.backgroundColor = backgroundColor;
    elem.style.position = 'absolute';
    elem.style.left = area.x + 'px';
    elem.style.top = area.y + 'px';
    elem.style.width = area.w + 'px';
    elem.style.height = area.h + 'px';
    graphDiv.appendChild(elem);
  }

  var plotArea = this.area;
  // Left side
  createClipDiv({
    x:0, y:0,
    w:plotArea.x,
    h:this.height
  });

  // Top
  createClipDiv({
    x: plotArea.x, y: 0,
    w: this.width - plotArea.x,
    h: plotArea.y
  });

  // Right side
  createClipDiv({
    x: plotArea.x + plotArea.w, y: 0,
    w: this.width - plotArea.x - plotArea.w,
    h: this.height
  });

  // Bottom
  createClipDiv({
    x: plotArea.x,
    y: plotArea.y + plotArea.h,
    w: this.width - plotArea.x,
    h: this.height - plotArea.h - plotArea.y
  });
};

/**
 * Returns a predicate to be used with an iterator, which will
 * iterate over points appropriately, depending on whether
 * connectSeparatedPoints is true. When it's false, the predicate will
 * skip over points with missing yVals.
 */
Dygrap


.type igemm_bwd_gtcx_nhwc_fp32_bx0_ex1_bt128x128x4_wt32x32x2_ws1x1_wr2x2_ta1x1x2x1_1x4x1x64_tb1x1x2x1_1x4x1x64_mh_me,@function
igemm_bwd_gtcx_nhwc_fp32_bx0_ex1_bt128x128x4_wt32x32x2_ws1x1_wr2x2_ta1x1x2x1_1x4x1x64_tb1x1x2x1_1x4x1x64_mh_me:
    s_load_dwordx2  s[s_p_in+0:s_p_in+1],       s[s_ka+0:s_ka+1],    0+k_p_in
    s_load_dwordx2  s[s_p_wei+0:s_p_wei+1],      s[s_ka+0:s_ka+1],    0+k_p_wei
    s_load_dwordx2  s[s_p_out+0:s_p_out+1],      s[s_ka+0:s_ka+1],    0+k_p_out
    s_load_dwordx16 s[s_hi+0:s_hi+15],        s[s_ka+0:s_ka+1],    0+k_hi
    s_load_dwordx8  s[s_dtile_ix+0:s_dtile_ix+7],   s[s_ka+0:s_ka+1],    0+k_dtile_ix
    s_load_dwordx4  s[s_dslice_x+0:s_dslice_x+3],   s[s_ka+0:s_ka+1],    0+k_dslice_x
    s_load_dwordx2  s[s_dslice_w_left+0:s_dslice_w_left+1],   s[s_ka+0:s_ka+1],    0+k_dslice_w_left
    s_load_dwordx2 s[s_magic_0+0:s_magic_0+1],  s[s_ka+0:s_ka+1],  0+k_magic_0
    s_load_dwordx2 s[s_magic_2+0:s_magic_2+1],  s[s_ka+0:s_ka+1],  0+k_magic_2
    s_load_dword s[s_shift_pack_0], s[s_ka+0:s_ka+1],  0+k_shift_pack_0
    ; out(e, k, nb0, nb1) thread_lengths: 1x1x2x1, cluster_length: 1x4x1x64, k_pack:1
    ; wei(e, k, c0, c1) thread_length: 1x1x2x1, cluster_length: 1x4x1x64, k_pack:1
    v_mov_b32 v[v_tmp], v0
    v_and_b32 v[v_out_ike_itr], 3, v[v_tmp]
    v_lshrrev_b32 v[v_tmp], 2, v[v_tmp]
    v_and_b32 v[v_out_inb], 63, v[v_tmp]
    v_mov_b32 v[v_tmp], v0
    v_and_b32 v[v_wei_ic], 63, v[v_tmp]
    v_lshrrev_b32 v[v_tmp], 6, v[v_tmp]
    v_and_b32 v[v_wei_ike_itr], 3, v[v_tmp]

    s_waitcnt lgkmcnt(0)

    ; calculate index
    s_mul_i32 s[s_out_stride_wo], s[s_k], s[s_group]
    s_mul_i32 s[s_tmp+2], s[s


glabel func_80004B50
/* 005750 80004B50 27BDFFE0 */  addiu $sp, $sp, -0x20
/* 005754 80004B54 3C038005 */  lui   $v1, %hi(D_80048FC0) # $v1, 0x8005
/* 005758 80004B58 24638FC0 */  addiu $v1, %lo(D_80048FC0) # addiu $v1, $v1, -0x7040
/* 00575C 80004B5C AFA50024 */  sw    $a1, 0x24($sp)
/* 005760 80004B60 97B80026 */  lhu   $t8, 0x26($sp)
/* 005764 80004B64 8FA80030 */  lw    $t0, 0x30($sp)
/* 005768 80004B68 AFA40020 */  sw    $a0, 0x20($sp)
/* 00576C 80004B6C AC640010 */  sw    $a0, 0x10($v1)
/* 005770 80004B70 AFBF0014 */  sw    $ra, 0x14($sp)
/* 005774 80004B74 AFA60028 */  sw    $a2, 0x28($sp)
/* 005778 80004B78 240F0001 */  li    $t7, 1
/* 00577C 80004B7C AC66001C */  sw    $a2, 0x1c($v1)
/* 005780 80004B80 3C048005 */  lui   $a0, %hi(D_80048DE8) # $a0, 0x8005
/* 005784 80004B84 3C058005 */  lui   $a1, %hi(D_80048FC4) # $a1, 0x8005
/* 005788 80004B88 AC6F0014 */  sw    $t7, 0x14($v1)
/* 00578C 80004B8C AC670020 */  sw    $a3, 0x20($v1)
/* 005790 80004B90 24A58FC4 */  addiu $a1, %lo(D_80048FC4) # addiu $a1, $a1, -


       edgeValues.set(meshEdgeI, edgeVal);
                }
            }
        }
    }

    // Do the cyclics.
    forAll(patches, patchI)
    {
        if (isA<cyclicPolyPatch>(patches[patchI]))
        {
            const cyclicPolyPatch& cycPatch =
                refCast<const cyclicPolyPatch>(patches[patchI]);

            const edgeList& coupledEdges = cycPatch.coupledEdges();
            const labelList& meshEdges = cycPatch.meshEdges();

            forAll(coupledEdges, i)
            {
                const edge& e = coupledEdges[i];

                label edge0 = meshEdges[e[0]];
                label edge1 = meshEdges[e[1]];

                unsigned int val0 = edgeValues.get(edge0);
                unsigned int t = val0;
                unsigned int val1 = edgeValues.get(edge1);

                cop(t, val1);
                edgeValues.set(edge0, t);
                cop(val1, val0);
                edgeValues.set(edge1, val1);
            }
        }
    }

    // Synchronize multiple shared edges.
    const globalMeshData& pd = mesh.globalData();

    if (pd.nGlobalEdges() > 0)
    {
        // Values on shared edges. Use unpacked storage for ease!
        List<unsigned int> sharedPts(pd.nGlobalEdges(), nullValue);

        forAll(pd.sharedEdgeLabels(), i)
        {
            label meshEdgeI = pd.sharedEdgeLabels()[i];
            // Fill my entries in the shared edges
            sharedPts[pd.sharedEdgeAddr()[i]] = edgeValues.get(meshEdgeI);
        }

        // Combine on master.
        Pstream::listCombineGather(sharedPts, cop);
        Pstream::listCombineScatter(sharedPts);

        // Now we will all have the same information. Merge it back with
        // my local information.
        forAll(pd.sharedEdgeLabels(), i)
        {
            label meshEdgeI = pd.sharedEdgeLabels()[i];
            edgeValues.set(meshEdgeI, sharedPts[pd.sharedEdgeAddr()[i]]);
        }
    }
}

// ************************************************************************* //


rch:')
  helpers.childExpectScreenshot(child)

  -- check exists and is open
  expect.equality(child.lua_get('GrugFar.has_instance(...)', { instanceName }), true)
  expect.equality(child.lua_get('GrugFar.is_instance_open(...)', { instanceName }), true)

  -- kill
  child.lua('GrugFar.kill_instance(...)', { instanceName })
  helpers.childWaitForScreenshotNotContainingText(child, 'Search:')
  helpers.childExpectScreenshot(child)

  -- check not exists and is not open
  expect.equality(child.lua_get('GrugFar.has_instance(...)', { instanceName }), false)
  expect.equality(child.lua_get('GrugFar.is_instance_open(...)', { instanceName }), false)
end

T['can update instance prefills'] = function()
  helpers.writeTestFiles({
    { filename = 'file1.txt', content = [[
       grug walks
       then grug swims
      ]] },
    {
      filename = 'file2.doc',
      content = [[
      grug talks and grug drinks
      then grug thinks
    ]],
    },
  })

  -- create it
  local instanceName = 'bob_instance'
  helpers.childRunGrugFar(child, {
    staticTitle = 'Find and Replace',
    prefills = { search = 'grug' },
    instanceName = instanceName,
  })
  helpers.childWaitForScreenshotText(child, '5 matches in 2 files')

  -- prefill while keeping existing
  child.lua('GrugFar.update_instance_prefills(...)', { instanceName, { paths = 'file1.txt' } })
  helpers.childWaitForScreenshotText(child, '2 matches in 1 files')
  helpers.childWaitForFinishedStatus(child)
  helpers.childExpectScreenshot(child)

  -- prefill while clearing old
  child.lua('GrugFar.update_instance_prefills(...)', { instanceName, { search = 'walks' }, true })
  helpers.childWaitForScreenshotText(child, '1 matches in 1 files')
  helpers.childWaitForFinishedStatus(child)
  helpers.childExpectScreenshot(child)
end

return T


adir, "GOTBONUSSND", GameSound::GET_BONUS);
    ok &= loadSound( datadir, "GOTPARTSND", GameSound::GET_PART);
    ok &= loadSound( datadir, "LVLDONESND", GameSound::LEVEL_DONE);
    ok &= loadSound( datadir, "GAMEOVERSND", GameSound::GAME_OVER);
    ok &= loadSound( datadir, "TELEPORTSND", GameSound::TELEPORT);
    ok &= loadSound( datadir, "EXTRAMANSND", GameSound::EXTRA_LIFE);
    ok &= loadSound( datadir, "CANNONFIRE", GameSound::CANNONFIRE);
    ok &= loadSound( datadir, "CHUNKSMASH", GameSound::CHUNKSMASH);
    ok &= loadSound( datadir, "GOINDOORSND", GameSound::GOINDOOR);
    ok &= loadSound( datadir, "GETCARDSND", GameSound::GET_CARD);
    ok &= loadSound( datadir, "USEKEYSND", GameSound::USE_KEY);
    ok &= loadSound( datadir, "CLICKSND", GameSound::SWITCH_TOGGLE);
    ok &= loadSound( datadir, "DOOROPENSND", GameSound::DOOR_OPEN);

    ok &= loadSound( datadir, "YORPBUMPSND", GameSound::YORP_BUMP);
    ok &= loadSound( datadir, "YORPBOPSND", GameSound::YORP_STUN);
    ok &= loadSound( datadir, "YORPSCREAM", GameSound::YORP_DIE);
    ok &= loadSound( datadir, "GARGSCREAM", GameSound::GARG_DIE);
    ok &= loadSound( datadir, "vortscream", GameSound::VORT_DIE);
    ok &= loadSound( datadir, "TANKFIRE", GameSound::TANK_FIRE);

	if (episode == 2)
	{
        ok &= loadSound( datadir, "EARTHPOW", GameSound::EARTHPOW);
	}
	else if (episode == 3)
	{
        ok &= loadSound( datadir, "MEEP", GameSound::MEEP);
        ok &= loadSound( datadir, "ANKH", GameSound::ANKH);
        ok &= loadSound( datadir, "MORTIMER", GameSound::MORTIMER);
        ok &= loadSound( datadir, "FOOTSLAM", GameSound::FOOTSLAM);
	}

    if(!mFileBuffer.empty())
    {
        mFileBuffer.clear();
    }

	return ok;
}

void CAudioVorticon::unloadSound()
{
	if(m_soundslot.empty())
		return;
	std::vector<CSoundSlot>::iterator it = m_soundslot.begin();
	for( ; it != m_soundslot.end() ; it++ )
		it->unload();
	m_soundslot.clear();
}
/*
 * CPlayGameVorticon.cpp
 *
 *  Created on: 03.10.2009
 *      Author: gerstrong
 *
 */

#include <base/GsTimer.h>
#include <base/video/CVideoDriver.h>
#include <base/CInput.h>
#include <widgets/GsMenuController.h>
#include <base/GsArguments.h>
#include <algorithm>

#include "CPlayGameVorticon.h"
#include <base/audio/Audio.h>
#include "engine/core/mode/Scene.h"
#include "engine/core/menu/MainMenu.h"
#include "engine/core/VGamepads/vgamepadsimple.h"
#include "../CVorticonMapLoader.h"
#include "graphics/GsGraphics.h"
#include "../ai/CTeleporter.h"

#include "../finale/CEndingEp1.h"
#include "../finale/CEndingEp2.h"
#include "../finale/CEndingEp3.h"

#include <graphics/CColorMerge.h>

#include <fileio/KeenFiles.h>

////
// Creation Routine
////
/// \brief CPlayGameVorticon::CPlayGameVorticon
/// \param ExeFile
/// \param level
///


__item {
      line-height: 27px;
      padding: 0 15px;
      font-size: 13px; }
      .el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided {
        margin-top: 4px; }
        .el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided:before {
          height: 4px;
          margin: 0 -15px; }
  .el-dropdown-menu--mini {
    padding: 3px 0; }
    .el-dropdown-menu--mini .el-dropdown-menu__item {
      line-height: 24px;
      padding: 0 10px;
      font-size: 12px; }
      .el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided {
        margin-top: 3px; }
        .el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided:before {
          height: 3px;
          margin: 0 -10px; }
/*!
 * Bootstrap v3.0.1 by @fat and @mdo
 * Copyright 2013 Twitter, Inc.
 * Licensed under http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world by @mdo and @fat.
 */

.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-gradient(linear,left 0,left 100%,from(#428bca),to(#2d6ca2));background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:-moz-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);background-repeat:repeat-x;border-color:#2b669a;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff2d6ca2',GradientType=0);fil


ards */
/*border radius*/
/* alert */
/* toast */
/* breadcrumb */
/* input button */
/* nav link */
/* nav, tabs, pills */
/* tables */
/* dropdowns */
/* dropdowns sizes */
/* popovers */
/* tooltips */
/* modal */
/* reference guide
http://www.standardista.com/px-to-rem-conversion-if-root-font-size-is-16px/
8px = 0.5rem
9px = 0.5625rem
10px = 0.625rem
11px = 0.6875rem
12px = 0.75rem
13px = 0.8125rem
14px = 0.875rem
15px = 0.9375rem
16px = 1rem (base)
17px = 1.0625rem
18px = 1.125rem
19px = 1.1875rem
20px = 1.25rem
21px = 1.3125rem
22px = 1.375rem
24px = 1.5rem
25px = 1.5625rem
26px = 1.625rem
28px = 1.75rem
30px = 1.875rem
32px = 2rem
34px = 2.125rem
36px = 2.25rem
38px = 2.375rem
40px = 2.5rem
*/
/* Fonts */
/* carousel */
/*  BASE VARS
========================================================================== */
/* font vars below will auto change to rem values using function rem($value)*/
/* 11px   */
/* 12px   */
/* 12.5px */
/* 14px   */
/* 15px   */
/* 16px   */
/* 28px   */
/*  Font Family
========================================================================== */
/*hint: you can also try the font called 'Poppins' by replacing the font 'Roboto' */
/*  ANIMATIONS
========================================================================== */
/* this addresses all animation related to nav hide to nav minify */
/*  Z-INDEX declearation
========================================================================== */
/* we adjust bootstrap z-index to be higher than our higest z-index*/
/*  CUSTOM ICON PREFIX
========================================================================== */
/*  PRINT CSS (landscape or portrait)
========================================================================== */
/* landscape or portrait */
/* auto, letter */
/*  Common Element Variables
========================================================================== */
/* Z-index decleartion "birds eye view"
========================================================================== */
/*  Components
========================================================================== */
/*  PAGE HEADER STUFF
========================================================================== */
/* colors */
/* height */
/* logo */
/* try not to go beywond the width of $main_nav_width value */
/* you may need to change this depending on your logo design */
/* adjust this as you see fit : left, right, center */
/* icon font size (not button) */
/* search input box */
/* suggestion: #ccced0*/
/* btn */
/* dropdown: app list */
/* badge */
/* COMPONENTS & MODS */
/*  NAVIGATION STUFF

Guide:

aside.page-sidebar ($nav-width, $nav-background)
	.page-logo
	.primary-nav
		.info-card
		ul.nav-menu
			li
				a (parent level-0..., $nav-link-color, $nav-link-hover-color, $nav-link-hover-bg-color, $nav-link-hover-left-border-color)
					icon
					span
					collapse-sign

				ul.nav-menu-sub-one
					li
						a ($nav-level-1... $nav-sub-link-height)
							span
							collapse-sign

						ul.nav-menu-sub-two
							li
								a ($nav-level-2... $nav-sub-link-height)
									span

		p.nav-title ($nav-title-*...)

========================================================================== */
/* main navigation */
/* left panel */
/* nav footer */
/* nav parent level-0 */
/* nav link level-1 */
/* nav level-1 bg */
/* nav icon sizes */
/* badge default */
/* all child */
/* nav title */
/* nav Minify */


 reward_or_primitives)):
        substep = substep.lstrip().replace(" ", "_")
        substep = substep.replace("'", "")
        file_name = os.path.join(task_save_path, f"{substep}.py")

        if type == 'reward':
            header = reward_file_header1.format(substep)
            end = reward_file_end.format(substep, substep)
            file_content =  header + reward_file_header2 + reward_or_primitive + end
            with open(file_name, "w") as f:
                f.write(file_content)
        elif type == 'primitive':
            header = primitive_file_header1.format(substep)
            end = primitive_file_end.format(substep, substep)
            file_content = header + primitive_file_header2 + reward_or_primitive + end
            with open(file_name, "w") as f:
                f.write(file_content)

    return task_save_path


ineInfo)
        build.append(" && ")
        // 将结果拉回到本地
        syncRemoteToLocal(build, remoteProjectPath, projectBasePath, remoteMachineInfo)
        // 执行本地安装命令
        val shellPath = FileUtils.getShellScriptPath(projectBasePath, R.ShellScript.installApk)
        if (FileUtils.isExists(shellPath)) {
            build.append(" && ")

            var execShellScript = ""
            if (!remoteMachineInfo.launchActivity.isNullOrEmpty()
                && !remoteMachineInfo.launchActivity.equals(R.String.ui.tfLaunchActivity)) {
                execShellScript = "chmod 777 ${shellPath} && bash ${shellPath} ${remoteMachineInfo.launchActivity} "
            } else {
                execShellScript = "chmod 777 ${shellPath} && bash ${shellPath} "
            }

            execLocalCommand(build, execShellScript)
        }
        return build
    }

    fun syncLocalToRemote(build: StringBuilder,
                          remoteMachineWorkPath: String,
                          localProjectBasePath: String,
                          remoteMachineInfo: RemoteMachineInfo) {
//        /bin/bash -c "rsync -e 'ssh -p 22' --archive --delete  --progress --rsync-path='mkdir -p ~/rsync/demo && rsync'  ./ root@ip:~/rsync/demo"
        build.append("${execSshpassScriptCommand(localProjectBasePath, remoteMachineInfo)}  rsync -e 'ssh -p ${remoteMachineInfo.remotePort}  -o StrictHostKeyChecking=no' --archive --delete ")
//        build.append("--partial ") // 保留因故没有传完的文件，下次在续传
        build.append("--progress ")
        var sdkdir: String = ""
        if(!remoteMachineInfo.sdkDir.isNullOrEmpty()
            && !remoteMachineInfo.sdkDir.equals(R.String.ui.tfSDK)){
            sdkdir = ";echo sdk.dir=${remoteMachineInfo.sdkDir} >> ${remoteMachineWorkPath + File.separator + Common.localProperties}"
        }
        var ndkDir: String = ""
        if(!remoteMachineInfo.ndkDir.isNullOrEmpty()
            && !remoteMachineInfo.ndkDir.equals(R.String.ui.tfNDK)){
            ndkDir = ";echo ndk.dir=${remoteMachineInfo.ndkDir} >> ${remoteMachineWorkPath + File.separator + Common.localProperties}"
        }
        build.append("--rsync-path='export LC_ALL=en_US.UTF-8;export LANG=en_US.UTF-8;mkdir -p ${remoteMachineWorkPath};rm -rf ${remoteMachineWorkPath + File.separator + Common.localProperties}${sdkdir}${ndkDir} && rsync' ")
        val localIgnoreFile =
            File(localProjectBasePath + File.separator + Common.syncConfigRootDir + File.separator + Common.syncConfigLocalIgnoreFile)
        if (localIgnoreFile.exists()) {
            build.append("--exclude-from=${localIgnoreFile}  ")
        }
        build.append("${localProjectBasePath + File.separator} ")
        build.append(" ${remoteMachineInfo.remoteUser}@${remoteMachineInfo.remoteHost}:${remoteMachineWorkPath} ")
    }

    fun syncLocalFileToRemote(build: StringBuilder,
                              filePath: String,
                              remoteMachineWorkPath: String,
                              remoteMachineInfo: RemoteMachineInfo,
                              localProjectBasePath: String) {
        build.append("${execSshpassScriptCommand(localProjectBasePath, remoteMachineInfo)}  rsync -e 'ssh -p ${remoteMachineInfo.remotePort} -o StrictHostKeyChecking=no' --archive --delete ")
        build.append("--progress ")
        build.append("--rsync-path='export LC_ALL=en_US.UTF-8;export LANG=en_US


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 com.prof18.rssparser.rss

import com.prof18.rssparser.XmlParserTestExecutor
import com.prof18.rssparser.model.RssChannel
import com.prof18.rssparser.model.RssItem
import com.prof18.rssparser.parseFeed
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

class XmlParserSourceTest : XmlParserTestExecutor() {

    val expectedChannel = RssChannel(
        title = "À la une - Google Actualités",
        link = "https://news.google.com/?hl=fr&gl=BE&ceid=BE:fr",
        description = "Google Actualités",
        image = null,
        lastBuildDate = "Sun, 08 Mar 2020 15:34:10 GMT",
        updatePeriod = null,
        itunesChannelData = null,
        youtubeChannelData = null,
        items = listOf(
            RssItem(
                guid = "52782335008021",
                title = "Coronavirus en Belgique: 200 cas détectés au total, un nombre limité de tests effectués par manque de réactifs - RTBF",
                author = null,
                link = "https://news.google.com/__i/rss/rd/articles/CBMiiwFodHRwczovL3d3dy5ydGJmLmJlL2luZm8vc29jaWV0ZS9kZXRhaWxfY29yb25hdmlydXMtZW4tYmVsZ2lxdWUtMjAwLWNhcy1kZXRlY3Rlcy1hdS10b3RhbC1sYS1jaXJjdWxhdGlvbi1kdS12aXJ1cy1yZXN0ZS1saW1pdGVlP2lkPTEwNDUwNzkz0gEA?oc=5",
                pubDate = "Sun, 08 Mar 2020 10:32:07 GMT",
                description = "

Coronavirus en Belgique: 200 cas détectés au total, un nombre limité de tests effectués par manque de réactifs  RTBF

Coronavirus: 31 nouvelles infections en Belgique, dont 7 en Wallonie, le total porté à 200  Sudinfo.be

<a href=\"https://news.google.com/__i/rss/rd/articles/CBMiXWh0dHBzOi8vd3d3LmRobmV0LmJlL2FjdHUvc2FudGUvbGEtYmVsZ2lxdWUtYW5ub25jZS14eHgtbm91dmVhdXgtY2FzLTVlNjRjNzI2ZDhhZDU4M


n
	}

	anonymous, err := defaultHttpDiscovery.GetApp("www.baidu.com")
	if err != nil {
		t.Error(err)
		return
	}
	balanceHandler, err := balanceFactory.Create(anonymous, "", 0)
	if err != nil {
		t.Error(err)
		return
	}

	node, _, _ := balanceHandler.Select(&testAppContext{app: &testApp{app: anonymous}})
	t.Log(node.Addr())
}

type testApp struct {
	app discovery.IApp
}

func (t *testApp) Nodes() []eocontext.INode {
	return t.app.Nodes()
}

func (t *testApp) Scheme() string {
	return "http"
}

func (t *testApp) TimeOut() time.Duration {
	return time.Second
}

type testAppContext struct {
	app eocontext.EoApp
}

func (t *testAppContext) RealIP() string {
	return "127.0.0.1"
}

func (t *testAppContext) RequestId() string {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) AcceptTime() time.Time {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) Context() context.Context {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) Value(key interface{}) interface{} {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) WithValue(key, val interface{}) {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) Scheme() string {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) Assert(i interface{}) error {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) SetLabel(name, value string) {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) GetLabel(name string) string {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) Labels() map[string]string {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) GetComplete() eocontext.CompleteHandler {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) SetCompleteHandler(handler eocontext.CompleteHandler) {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) GetFinish() eocontext.FinishHandler {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) SetFinish(handler eocontext.FinishHandler) {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) GetApp() eocontext.EoApp {
	return t.app
}

func (t *testAppContext) SetApp(app eocontext.EoApp) {
	t.app = app
}

func (t *testAppContext) GetBalance() eocontext.BalanceHandler {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) SetBalance(handler eocontext.BalanceHandler) {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext) GetUpstreamHostHandler() eocontext.UpstreamHostHandler {
	//TODO implement me
	panic("implement me")
}

func (t *testAppContext


--[[
LuCI - Lua Configuration Interface

Copyright 2011 flyzjhz <flyzjhz@gmail.com>

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

]]--

require("luci.tools.webadmin")
local sys = require "luci.sys"

m = Map("nwan", "N-WAN",translate("nwan_desc",
"N-WAN allows for the use of multiple uplinks for load balancing and failover."))

-- translate("nwan_route_desc","setting n-wan routes."))

local iproute = luci.sys.iproute()

v = m:section(Table, iproute, translate("ip route"))
ipmas = v:option(DummyValue, "ipmas")
dev1 = v:option(DummyValue, "dev1")
dev2 = v:option(DummyValue, "dev2")
proto = v:option(DummyValue, "proto")
kernel = v:option(DummyValue, "kernel")
scope = v:option(DummyValue, "scope")
link = v:option(DummyValue, "link")
src = v:option(DummyValue, "src")
ipadd = v:option(DummyValue, "ipadd")

s = m:section(TypedSection, "settings", translate("nwan_route","SETTING PAGE"))
s.addremove = false
s.anonymous = true

enable = s:option(Flag, "enable", translate("nwan_enable","N_WAN ON OR OFF"))
enable.optional = false
enable.rmempty = false

ping_ck = s:option(Flag, "ping_ck", translate("nwan_ping_ck","ON_LINE CHECK ON OR OFF"))
ping_ck.optional = false
ping_ck.rmempty = false

force_all_wan_up = s:option(Flag, "force_all_wan_up", translate("force_all_wan_up","FORCE ALL WAN UP"),
                   translate("force_all_wan_up_desc","force all wan up desc"))
force_all_wan_up:depends("ping_ck", "1")
force_all_wan_up.optional = false
force_all_wan_up.rmempty = false

dl_route_table = s:option(Flag, "dl_route_table", translate("nwan_dl_route_table","AUTO DOWNLOAD ROUTE TABLE"),
         translate("nwan_dl_route_table_desc","nwan dl route table desc"))
dl_route_table.optional = false
dl_route_table.rmempty = false

debug = s:option(ListValue, "debug", translate("nwan_debug","DEBUG  LOG_RECORD"))
debug :value("1", translate("nwan_off","OFF"))
debug :value("5", translate("nwan_on","ON"))
debug.optional = false
debug.rmempty = false

sleeptime = s:option(Value, "sleeptime", translate("nwan_sleeptime","PING WAIT TIME / MIN"))
sleeptime.size = 3
sleeptime.maxlength = 3
sleeptime.optional = false
sleeptime.rmempty = false

testip = s:option(Value, "testip", translate("nwan_testip","INTETNET TEST IP"))
testip.size = 55
testip.maxlength = 55
testip.optional = false
testip.rmempty = false

int = m:section(TypedSection, "interface", translate("nwan_interface","WAN Interfaces"))
int.template = "cbi/tblsection"
int.addremove = true

name = int:option(ListValue, "name", translate("nwan_isp_name","isp name"))
name:value("mobile", translate("nwan_isp_mobile","mobile"))
name:value("other",


_found.is_none());
    ///
    /// let maybe_found = rtree.search(&rect!((0.0, 0.0), (3.0, 3.0)));
    /// assert_eq!(maybe_found.unwrap(), vec![&first_item, &second_item]);
    /// ```
    pub fn search(&self, area: &Rect<B::Point>) -> Option<Vec<&B>> {
        self.root.search(area)
    }

    /// Inserts a new item in the tree. Each item must have a unique label.
    /// If the provided label already exsists in the tree, a `DuplicateLabelError` will be returned.
    ///
    /// # Example:
    /// ```
    /// use swim_rtree::{Point2D, Rect, RTree, SplitStrategy, rect};
    /// use swim_algebra::non_zero_usize;
    ///
    /// let mut rtree = RTree::new(non_zero_usize!(2), non_zero_usize!(5), SplitStrategy::Linear).unwrap();
    ///
    /// rtree.insert("First".to_string(), rect!((0.0, 0.0), (1.0, 1.0))).unwrap();
    /// assert_eq!(rtree.len(), 1);
    ///
    /// rtree.insert("Second".to_string(), rect!((0.0, 0.0), (2.0, 2.0))).unwrap();
    /// assert_eq!(rtree.len(), 2);
    /// ```
    pub fn insert(&mut self, label: L, item: B) -> Result<(), DuplicateLabelError<L>> {
        if self.lookup_map.get(&label).is_some() {
            return Err(DuplicateLabelError(label));
        }

        let item = Arc::new(Entry::Leaf { label, item });

        let label_raw_ptr: *const L = match &*item {
            Entry::Leaf { label, .. } => label,
            Entry::Branch { .. } => {
                unreachable!()
            }
        };

        self.lookup_map
            .insert(RTreeKey(label_raw_ptr), item.clone());

        self.internal_insert(item, 0);
        Ok(())
    }

    /// Removes and returns an item from the tree given its label.
    /// If no such item is found, `None` is returned.
    ///
    /// # Example:
    /// ```
    /// use swim_rtree::{Point2D, Rect, RTree, SplitStrategy, rect};
    /// use swim_algebra::non_zero_usize;
    ///
    /// let mut rtree = RTree::new(non_zero_usize!(2), non_zero_usize!(5), SplitStrategy::Linear).unwrap();
    ///
    /// let first_item = rect!((0.0, 0.0), (1.0, 1.0));
    /// let second_item = rect!((0.0, 0.0), (2.0, 2.0));
    ///
    /// rtree.insert("First".to_string(), first_item.clone()).unwrap();
    /// assert_eq!(rtree.len(), 1);
    ///
    /// rtree.insert("Second".to_string(), second_item.clone()).unwrap();
    /// assert_eq!(rtree.len(), 2);
    ///
    /// let maybe_removed = rtree.remove(&"Second".to_string());
    /// assert_eq!(maybe_removed.unwrap(), second_item);
    /// assert_eq!(rtree.len(), 1);
    ///
    /// let maybe_removed = rtree.remove(&"Third".to_string());
    /// assert!(maybe_removed.is_none());
    /// assert_eq!(rtree.len(), 1);
    ///
    /// let maybe_removed = rtree.remove(&"First".to_string());
    /// assert_eq!(maybe_removed.unwrap(), first_item);
    /// assert_eq!(rtree.len(), 0);
    /// `


$tw: false */\\n\\\"use strict\\\";\\n\\nvar easing = \\\"cubic-bezier(0.645, 0.045, 0.355, 1)\\\"; // From http://easings.net/#easeInOutCubic\\n\\nvar ZoominListView = function(listWidget) {\\n\\tvar self = this;\\n\\tthis.listWidget = listWidget;\\n\\tthis.textNodeLogger = new $tw.utils.Logger(\\\"zoomin story river view\\\", {\\n\\t\\tenable: true,\\n\\t\\tcolour: 'red'\\n\\t});\\n\\t// Get the index of the tiddler that is at the top of the history\\n\\tvar history = this.listWidget.wiki.getTiddlerDataCached(this.listWidget.historyTitle,[]),\\n\\t\\ttargetTiddler;\\n\\tif(history.length > 0) {\\n\\t\\ttargetTiddler = history[history.length-1].title;\\n\\t}\\n\\t// Make all the tiddlers position absolute, and hide all but the top (or first) one\\n\\t$tw.utils.each(this.listWidget.children,function(itemWidget,index) {\\n\\t\\tvar domNode = itemWidget.findFirstDomNode();\\n\\t\\t// Abandon if the list entry isn't a DOM element (it might be a text node)\\n\\t\\tif(!(domNode instanceof Element)) {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tif((targetTiddler && targetTiddler !== itemWidget.parseTreeNode.itemTitle) || (!targetTiddler && index)) {\\n\\t\\t\\tdomNode.style.display = \\\"none\\\";\\n\\t\\t} else {\\n\\t\\t\\tself.currentTiddlerDomNode = domNode;\\n\\t\\t}\\n\\t\\t$tw.utils.addClass(domNode,\\\"tc-storyview-zoomin-tiddler\\\");\\n\\t});\\n};\\n\\nZoominListView.prototype.navigateTo = function(historyInfo) {\\n\\tvar duration = $tw.utils.getAnimationDuration(),\\n\\t\\tlistElementIndex = this.listWidget.findListItem(0,historyInfo.title);\\n\\tif(listElementIndex === undefined) {\\n\\t\\treturn;\\n\\t}\\n\\tvar listItemWidget = this.listWidget.children[listElementIndex],\\n\\t\\ttargetElement = listItemWidget.findFirstDomNode();\\n\\t// Abandon if the list entry isn't a DOM element (it might be a text node)\\n\\tif(!targetElement) {\\n\\t\\treturn;\\n\\t} else if (targetElement.nodeType === Node.TEXT_NODE) {\\n\\t\\tthis.logTextNodeRoot(targetElement);\\n\\t\\treturn;\\n\\t}\\n\\t// Make the new tiddler be position absolute and visible so that we can measure it\\n\\t$tw.utils.addClass(targetElement,\\\"tc-storyview-zoomin-tiddler\\\");\\n\\t$tw.utils.setStyle(targetElement,[\\n\\t\\t{display: \\\"block\\\"},\\n\\t\\t{transformOrigin: \\\"0 0\\\"},\\n\\t\\t{transform: \\\"translateX(0px) translateY(0px) scale(1)\\\"},\\n\\t\\t{transition: \\\"none\\\"},\\n\\t\\t{opacity: \\\"0.0\\\"}\\n\\t]);\\n\\t// Get the position of the source node, or use the centre of the window as the source position\\n\\tvar sourceBounds = historyInfo.fromPageRect || {\\n\\t\\t\\tleft: window.innerWidth/2 - 2,\\n\\t\\t\\ttop: window.innerHeight/2 - 2,\\n\\t\\t\\twidth: window.innerWidth/8,\\n\\t\\t\\theight: window