avascript: Toggle(this);" href="#!" />Senparc.Weixin.Entities

ISenparcWeixinSettingForOldTenpay 接口

ISenparcWeixinSettingForOldTenpay 属性

WeixinPay_AppId 属性

WeixinPay_AppKey 属性

WeixinPay_Key 属性

WeixinPay_PartnerId 属性

WeixinPay_TenpayNotify 属性

<div


  "de": "Kolumbien",
      "fr": "Colombie",
      "es": "Colombia",
      "en": "Colombia",
      "pt_BR": "Colômbia",
      "sr-Cyrl": "Колумбија",
      "sr-Latn": "Kolumbija",
      "zh_TW": "哥倫比亞",
      "tr": "Kolombiya",
      "ro": "Columbia",
      "ar": "كولومبيا",
      "fa": "کلمبیا",
      "yue": "哥倫比亞"
    },
    flag: "🇨🇴",
    code: "CO",
    dialCode: "57",
    minLength: 10,
    maxLength: 10,
  ),
  Country(
    name: "Comoros",
    nameTranslations: {
      "sk": "Komory",
      "se": "Komoros",
      "pl": "Komory",
      "no": "Komorene",
      "ja": "コモロ",
      "it": "Comore",
      "zh": "科摩罗",
      "nl": "Comoren",
      "de": "Komoren",
      "fr": "Comores",
      "es": "Comoras",
      "en": "Comoros",
      "pt_BR": "Comores",
      "sr-Cyrl": "Комори",
      "sr-Latn": "Komori",
      "zh_TW": "科摩羅",
      "tr": "Komor Adaları",
      "ro": "Comore",
      "ar": "جزر القمر",
      "fa": "جزیره کومور",
      "yue": "科摩羅"
    },
    flag: "🇰🇲",
    code: "KM",
    dialCode: "269",
    minLength: 7,
    maxLength: 7,
  ),
  Country(
    name: "Congo",
    nameTranslations: {
      "sk": "Konžská republika",
      "se": "Kongo-Brazzaville",
      "pl": "Kongo",
      "no": "Kongo-Brazzaville",
      "ja": "コンゴ共和国(ブラザビル)",
      "it": "Congo-Brazzaville",
      "zh": "刚果（布）",
      "nl": "Congo-Brazzaville",
      "de": "Kongo-Brazzaville",
      "fr": "Congo-Brazzaville",
      "es": "Congo",
      "en": "Congo - Brazzaville",
      "pt_BR": "República do Congo",
      "sr-Cyrl": "Република Конго",
      "sr-Latn": "Republika Kongo",
      "zh_TW": "剛果共和國（布拉柴維爾）",
      "tr": "Kongo Cumhuriyeti",
      "ro": "Republica Congo",
      "ar": "جمهورية الكونغو",
      "fa": "جمهوری کنگو",
      "yue": "剛果（共和國）"
    },
    flag: "🇨🇬",
    code: "CG",
    dialCode: "242",
    minLength: 7,
    maxLength: 7,
  ),
  Country(
    name: "Congo, The Democratic Republic of the Congo",
    nameTranslations: {
      "sk": "Konžská demokratická republika",
      "se": "Kongo-Kinshasa",
      "pl": "Demokratyczna Republika Konga",
      "no":


32-NEXT:    store i32 [[ADD4]], ptr [[DOTOMP_LB]], align 4
// CHECK-32-NEXT:    [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
// CHECK-32-NEXT:    [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
// CHECK-32-NEXT:    [[ADD5:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
// CHECK-32-NEXT:    store i32 [[ADD5]], ptr [[DOTOMP_UB]], align 4
// CHECK-32-NEXT:    br label [[OMP_DISPATCH_COND]]
// CHECK-32:       omp.dispatch.end:
// CHECK-32-NEXT:    call void @__kmpc_for_static_fini(ptr @[[GLOB3]], i32 [[TMP1]])
// CHECK-32-NEXT:    [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
// CHECK-32-NEXT:    [[TMP16:%.*]] = icmp ne i32 [[TMP15]], 0
// CHECK-32-NEXT:    br i1 [[TMP16]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
// CHECK-32:       .omp.final.then:
// CHECK-32-NEXT:    store i32 10, ptr [[I]], align 4
// CHECK-32-NEXT:    br label [[DOTOMP_FINAL_DONE]]
// CHECK-32:       .omp.final.done:
// CHECK-32-NEXT:    call void @__kmpc_barrier(ptr @[[GLOB4:[0-9]+]], i32 [[TMP1]])
// CHECK-32-NEXT:    ret void
//
//
// CHECK-32-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z3foov_l185
// CHECK-32-SAME: (ptr noalias noundef [[DYN_PTR:%.*]]) #[[ATTR8]] {
// CHECK-32-NEXT:  entry:
// CHECK-32-NEXT:    [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 4
// CHECK-32-NEXT:    [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 4
// CHECK-32-NEXT:    store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 4
// CHECK-32-NEXT:    [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z3foov_l185_kernel_environment, ptr [[DYN_PTR]])
// CHECK-32-NEXT:    [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
// CHECK-32-NEXT:    br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
// CHECK-32:       user_code.entry:
// CHECK-32-NEXT:    [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
// CHECK-32-NEXT:    call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z3foov_l185_omp_outlined, ptr null, ptr [[CAPTURED_VARS_ADDRS]], i32 0)
// CHECK-32-NEXT:    call void @__kmpc_target_deinit()
// CHECK-32-NEXT:    ret void
// CHECK-32:       worker.exit:
// CHECK-32-NEXT:    ret void
//
//
// CHECK-32-LABEL: define {{[^@]+}}@{{__omp


c3VtbWFyeVxuICovXG52YXIgc3VwcG9ydGVkSW5wdXRUeXBlcyA9IHtcbiAgJ2NvbG9yJzogdHJ1ZSxcbiAgJ2RhdGUnOiB0cnVlLFxuICAnZGF0ZXRpbWUnOiB0cnVlLFxuICAnZGF0ZXRpbWUtbG9jYWwnOiB0cnVlLFxuICAnZW1haWwnOiB0cnVlLFxuICAnbW9udGgnOiB0cnVlLFxuICAnbnVtYmVyJzogdHJ1ZSxcbiAgJ3Bhc3N3b3JkJzogdHJ1ZSxcbiAgJ3JhbmdlJzogdHJ1ZSxcbiAgJ3NlYXJjaCc6IHRydWUsXG4gICd0ZWwnOiB0cnVlLFxuICAndGV4dCc6IHRydWUsXG4gICd0aW1lJzogdHJ1ZSxcbiAgJ3VybCc6IHRydWUsXG4gICd3ZWVrJzogdHJ1ZVxufTtcblxuZnVuY3Rpb24gaXNUZXh0SW5wdXRFbGVtZW50KGVsZW0pIHtcbiAgdmFyIG5vZGVOYW1lID0gZWxlbSAmJiBlbGVtLm5vZGVOYW1lICYmIGVsZW0ubm9kZU5hbWUudG9Mb3dlckNhc2UoKTtcbiAgcmV0dXJuIG5vZGVOYW1lICYmIChub2RlTmFtZSA9PT0gJ2lucHV0JyAmJiBzdXBwb3J0ZWRJbnB1dFR5cGVzW2VsZW0udHlwZV0gfHwgbm9kZU5hbWUgPT09ICd0ZXh0YXJlYScpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGlzVGV4dElucHV0RWxlbWVudDtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL34vcmVhY3QvbGliL2lzVGV4dElucHV0RWxlbWVudC5qc1xuLy8gbW9kdWxlIGlkID0gOTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==");

/***/ }),
/* 97 */
/***/ (function(module, exports) {

	eval("/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the P


997, 118.739998, 118.900002,
        119.110001, 118.339996, 120.0, 119.400002, 120.449997, 120.0, 119.550003, 120.419998,
        121.669998, 122.139999, 120.93, 121.150002, 127.029999, 127.980003, 128.309998, 129.130005,
        130.539993, 131.350006, 131.649994, 132.460007, 133.080002, 133.470001, 135.520004,
    ];
    let high = vec![
        116.510002, 116.860001, 118.160004, 119.43, 119.379997, 119.93, 119.300003, 119.620003,
        120.239998, 120.5, 120.089996, 120.449997, 120.809998, 120.099998, 122.099998, 122.440002,
        122.349998, 121.629997, 121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996,
        132.220001, 132.449997, 132.940002, 133.820007, 135.089996, 136.270004,
    ];
    let low = vec![
        115.75, 115.809998, 116.470001, 117.940002, 118.300003, 118.599998, 118.209999, 118.809998,
        118.220001, 119.709999, 119.370003, 119.730003, 119.769997, 119.5, 120.279999, 121.599998,
        121.599998, 120.660004, 120.620003, 127.010002, 127.779999, 128.160004, 128.899994,
        130.449997, 131.220001, 131.119995, 132.050003, 132.75, 133.25, 134.619995,
    ];
    let close = vec![
        116.019997, 116.610001, 117.910004, 118.989998, 119.110001, 119.75, 119.25, 119.040001,
        120.0, 119.989998, 119.779999, 120.0, 120.080002, 119.970001, 121.879997, 121.940002,
        121.949997, 121.629997, 121.349998, 128.75, 128.529999, 129.080002, 130.289993, 131.529999,
        132.039993, 132.419998, 132.119995, 133.289993, 135.020004, 135.509995,
    ];

    let trace1 = Candlestick::new(x, open, high, low, close);

    let mut plot = Plot::new();
    plot.add_trace(trace1);
    plot.show();
}

fn gbm_simple_candlestick_chart() {
    let n = 3_000;
    let x = (0..n).collect();
    let mid = geometric_brownian_motion(100.0, 1.0 / 365.0, n, 0.15, 0.5);
    let mut open = Vec::<f64>::with_capacity(n);
    let mut high = Vec::<f64>::with_capacity(n);
    let mut low = Vec::<f64>::with_capacity(n);
    let mut close = Vec::<f64>::with_capacity(n);
    for mid_point in mid.iter() {
        let up: bool = rand::random();
        if up {
            open.push(0.98 * *mid_point);
            close.push(1.02 * *mid_point);
        } else {
            open.push(1.02 * *mid_point);
            close.push(0.98 * *mid_point);
        }

        low.push(0.92 * *mid_point);
        high.push(1.09 * *mid_point);
    }

    let trace = Candlestick::new(x, open, high, low, close);
    let mut plot = Plot::new();
    plot.add_trace(trace);


ro for the SAMBA.  Ha!  Bloody hardware
    // engineers.  It'll never work.

    if (rd_framer (dev, 0) & 0x00f0) {
      // SUNI
      printk (" SUNI");

      // Reset, just in case
      wr_framer (dev, 0x00, 0x0080);
      wr_framer (dev, 0x00, 0x0000);

      // Configure transmit FIFO
      wr_framer (dev, 0x63, rd_framer (dev, 0x63) | 0x0002);

      // Set line timed mode
      wr_framer (dev, 0x05, rd_framer (dev, 0x05) | 0x0001);
    } else {
      // SAMBA
      printk (" SAMBA");

      // Reset, just in case
      wr_framer (dev, 0, rd_framer (dev, 0) | 0x0001);
      wr_framer (dev, 0, rd_framer (dev, 0) &~ 0x0001);

      // Turn off diagnostic loopback and enable line-timed mode
      wr_framer (dev, 0, 0x0002);

      // Turn on transmit outputs
      wr_framer (dev, 2, 0x0B80);
    }
  } else {
    // Select 25 mode
    ctrl &= ~ATM_LAYER_SELECT;

    // Madge B154 setup
    // none required?
  }

  printk (" LEDs");

  GREEN_LED_ON(dev);
  YELLOW_LED_ON(dev);

  printk (" ESI=");

  {
    u16 b = 0;
    int i;
    u8 * esi = dev->atm_dev->esi;

    // in the card I have, EEPROM
    // addresses 0, 1, 2 contain 0
    // addresess 5, 6 etc. contain ffff
    // NB: Madge prefix is 00 00 f6 (which is 00 00 6f in Ethernet bit order)
    // the read_bia routine gets the BIA in Ethernet bit order

    for (i=0; i < ESI_LEN; ++i) {
      if (i % 2 == 0)
	b = read_bia (dev, i/2 + 2);
      else
	b = b >> 8;
      esi[i] = b & 0xFF;
      printk ("%02x", esi[i]);
    }
  }

  // Enable RX_Q and ?X_COMPLETE interrupts only
  wr_regl (dev, INT_ENABLE_REG_OFF, INTERESTING_INTERRUPTS);
  printk (" IRQ on");

  printk (".\n");

  return onefivefive;
}

/********** check max_sdu **********/

static int check_max_sdu (hrz_aal aal, struct atm_trafprm * tp, unsigned int max_frame_size) {
  PRINTD (DBG_FLOW|DBG_QOS, "check_max_sdu");

  switch (aal) {
    case aal0:
      if (!(tp->max_sdu)) {
	PRINTD (DBG_QOS, "defaulting max_sdu");
	tp->max_sdu = ATM_AAL0_SDU;
      } else if (tp->max_sdu != ATM_AAL0_SDU) {
	PRINTD (DBG_QOS|DBG_ERR, "rejecting max_sdu");
	return -EINVAL;
      }
      break;
    case aal34:
      if (tp->max_sdu == 0 || tp->max_sdu > ATM_MAX_AAL34_PDU) {
	PRINTD (DBG_QOS, "%sing max_sdu", tp->max_sdu ? "capp" : "default");
	tp->max_sdu = ATM_MAX_AAL34_PDU;
      }
      break;
    case aal5:
      if (tp->max_sdu == 0 || tp->max_sdu > max_frame_size) {
	PRINTD (DBG_QOS, "%sing max_sdu", tp->max_sdu ? "capp" : "default");
	tp->max_sdu = max_frame_size;
      }
      break;
  }
  return 0;
}

/********** check pcr **********/

// something like this should be part of ATM Linux
static int atm_pcr_check (struct atm_trafprm * tp, unsigned int pcr) {
  // we are assuming non-UBR, and non-special values of pcr
  if (tp->min_pcr == ATM_MAX_PCR)
    PRINTD (DBG_QOS, "luser gave min_pcr = ATM_MAX_PCR");
  else if (tp->min_pcr < 0)
    PRINTD (DBG_QOS, "luser gave negative min_pcr");
  else if (tp->min_pcr && tp->min_pcr > pcr)
    PRINTD (DBG_QOS, "pcr less than min_pcr");
  else
    // !! max_pcr = UNSPEC (0) is equivalent to max_pcr = MAX (-1)
    // easier to #define ATM_MAX_PCR 0 and have all rates unsigned?
    // [this would get rid of next two conditionals]
    if ((0) && tp->max_pcr == ATM_MAX_PCR)
      PRINTD (DBG_QOS, "luser gave max_pcr = ATM_MAX_PCR");
    else if ((tp->max_pcr != ATM_MAX_PCR) && tp->max_pcr < 0)
      PRINTD (DBG_QOS, "luser gave negative max_pcr");
    else if (tp->max_pcr && tp->max_pcr != ATM_MAX_PCR && tp->max_pcr < pcr)
      PRINTD (DBG_QOS, "pcr greater than max_pcr");
    else {
      // each limit unspecified or not violated
      PRINTD (DBG_QOS, "xBR(pcr) OK");
      return 0;
    }
  PRINTD (DBG_QOS, "pcr=%u, tp: min_pcr=%d, pcr=%d, max_pcr=%d",
	  pcr, tp->min_pcr, tp->pcr, tp->max_pcr);
  return -EINVAL;
}

/********** open VC **********/

static int hrz_open (struct atm_vcc *atm_vcc)
{
  int error;
  u16 channel;

  struct atm_qos * qos;
  struct atm_trafprm * txtp;
  struct atm_trafprm * rxtp;

  hrz_dev * dev = HRZ_DEV(atm_vcc->dev);
  hrz_vcc vcc;
  hrz_vcc * vccp; // allocated late
  short vpi = atm_vcc->vpi;
  int vci = atm_vcc->vci;
  PRINTD (DBG_FLOW|DBG_VCC, "hrz_open %x %x", vpi, vci);

#ifdef ATM_VPI_UNSPEC
  // UNSPEC is deprecated, remove this code eventually
  if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) {
    PRINTK (KERN_WARNING, "rejecting open with unspecified VPI/VC


       } else {
                    throw new ModuleNotFoundException(new I18NBoundMessage3P(
                            Messages.MULTIPLE_MODULES_MATCH_URN,
                            inURN.getValue(),
                            returnValue.getURN().getValue(),
                            get(i).getURN().getValue()));
                }
            }
        }
        return returnValue;
    }

    private final Map<ModuleURN,Module> mModules =
            new HashMap<ModuleURN, Module>();
}
package org.marketcetera.module;

import org.marketcetera.util.misc.ClassVersion;
import org.marketcetera.util.log.*;

/* $License$ */
/**
 * The message constants for messages used within the module framework.
 *
 * @author anshul@marketcetera.com
 * @version $Id$
 * @since 1.0.0
 */
@ClassVersion("$Id$")  //$NON-NLS-1$
public interface Messages {
    /**
     * The message provider
     */
    static final I18NMessageProvider PROVIDER =
            new I18NMessageProvider("core_module");  //$NON-NLS-1$
    /**
     * The message logger.
     */
    static final I18NLoggerProxy LOGGER =
            new I18NLoggerProxy(PROVIDER);

    static final I18NMessage3P INVALID_URN_SCHEME =
            new I18NMessage3P(LOGGER, "invalid_urn_scheme");  //$NON-NLS-1$
    static final I18NMessage1P INCOMPLETE_PROVIDER_URN =
            new I18NMessage1P(LOGGER,"incomplete_provider_urn");  //$NON-NLS-1$
    static final I18NMessage2P INVALID_PROVIDER_TYPE =
            new I18NMessage2P(LOGGER, "invalid_provider_type");  //$NON-NLS-1$
    static final I18NMessage2P INVALID_PROVIDER_NAME =
            new I18NMessage2P(LOGGER, "invalid_provider_name");  //$NON-NLS-1$
    static final I18NMessage3P UNABLE_SET_ATTRIBUTE =
            new I18NMessage3P(LOGGER,"unable_set_attribute");  //$NON-NLS-1$
    static final I18NMessage1P BEAN_REGISTRATION_ERROR =
            new I18NMessage1P(LOGGER,"bean_registration_error");  //$NON-NLS-1$
    static final I18NMessage1P BEAN_ATTRIB_DISCOVERY_ERROR =
            new I18NMessage1P(LOGGER, "bean_attrib_discovery_error");  //$NON-NLS-1$
    static final I18NMessage0P MODULE_CONFIGURATION_ERROR =
            new I18NMessage0P(LOGGER, "module_configuration_error");  //$NON-NLS-1$
    static final I18NMessage1P INCOMPLETE_INSTANCE_URN =
            new I18NMessage1P(LOGGER, "incomplete_instance_urn");  //$NON-NLS-1$
    static final I18NMessage2P INVALID_INSTANCE_URN =
            new I18NMessage2P(LOGGER,"invalid_instance_urn");  //$NON-NLS-1$
    static final I18NMessage2P INSTANCE_PROVIDER_URN_MISMATCH =
            new I18NMessage2P(LOGGER,"instance_provider_urn_mismatch");  //$NON-NLS-1$
    static final I18NMessage1P DUPLICATE_MODULE_URN =
            new I18NMessage1P(LOGGER, "duplicate_module_urn");  //$NON-NLS-1$
    static final I18NMessage3P MODULE_NOT_STARTED_STATE_INCORRECT =
            new I18NMessage3P(LOGGER, "module_not_started_state_incorrect");  //$NON-NLS-1$
    static final I18NMessage1P MODULE_NOT_FOUND =
            new I18NMessage1P(LOGGER, "module_not_found");  //$NON-NLS-1$
    static final I18NMessage1P BEAN_OBJECT_NAME_ERROR =
            new I18NMessage1P(LOGGER, "bean_object_name_error");  //$NON-NLS-1$
    static final I18NMessage3P MODULE_NOT_STOPPED_STATE_INCORRECT =
            new I18NMessage3P(LOGGER, "module_not_stopped_state_inc


m.parent;

                    var width = cam.pixelRect.width / Sample.SimulationsGrid.x;
                    var height = cam.pixelRect.height / Sample.SimulationsGrid.y;

                    cam.pixelRect = new Rect(x * width, y * height, width, height);
                    m_availableCameras.Enqueue(cam.GetComponent<FollowChromosomeCam>());
                }
            }
		}

		public FollowChromosomeCam AddChromosome(GameObject chromosome)
        {
            FollowChromosomeCam cam;

            if (m_availableCameras.TryDequeue(out cam))
            {
                cam.StartFollowing(chromosome);
            }
            else
            {
                Debug.LogError("Cannot dequeue camera");
            }

            return cam;
        }
    }
}


("./ko.json")
};

const translate = _.memoize(
  (key, config) => I18n.t(key, config),
  (key, config) => (config ? key + JSON.stringify(config) : key)
);

async function initAsync() {
  // *I18n setting
  // fallback if no available language fits
  const fallback = { languageTag: "en", isRTL: false };

  const { languageTag, isRTL } =
    RNLocalize.findBestAvailableLanguage(Object.keys(translationGetters)) ||
    fallback;

  // clear translation cache
  translate.cache.clear();
  // update layout direction
  I18nManager.forceRTL(isRTL);

  // set I18n-js config
  I18n.fallbacks = true;
  I18n.translations =
    languageTag === "en"
      ? {
          [languageTag]: translationGetters[languageTag]()
        }
      : {
          en: translationGetters["en"](),
          [languageTag]: translationGetters[languageTag]()
        };

  I18n.locale = languageTag;

  console.log("main locale", I18n.locale);
  // ========================================================================
}

export default {
  initAsync: initAsync,
  locale: () => I18n.locale,
  localeShort: () => I18n.locale.slice(0, 2),
  t: (key: string, config?: any) => translate(key, config)
};
import { Model } from "./model";
import { View } from "./view";

export class Controller {
    model: Model;
    view: View;

    constructor(model: Model, view: View) {
        this.model = model;
        this.view = view;
    }

    init() {
        this.model.init();
        this.view.drawChessBackground();
        this.view.drawCheckers(this.model.boardInfo);
        this.view.bindToggleChecker(this.setValueOfChecker);
    }

    setValueOfChecker = (result: CheckerInfo): void => {
        result.selected = true;
        this.model.setSelectedCheckerPosition(result);
    }
}

interface CheckerInfo {
    selected?: boolean,
    row: number;
    column: number;
    isKing: boolean;
}/// <reference path="./scene-node.ts" />
/// <reference path="./gl.ts" />
/// <reference path="./draw.ts" />
/// <reference path="./interpolator.ts" />
/// <reference path="./util.ts" />

class ActionSlot extends SceneNode {
  public _parent: ActionCard;
  public _condition: () => boolean;
  public _text: string = "";
  constructor(text: string, condition: () => boolean) {
    super();
    this._text = text;
    this._condition = condition;
    this._size = { x: 32, y: 32 };
  }

  public get _total(): number {
    const values: number[] = Array.from(this._nodes, ([id, die]) => (die as Dice)._value);
    return sum(...values);
  }

  public _reset(): void {
    const dice: Dice[] = Array.from(this._nodes, ([id, die]) => (die as Dice));
    for (const die of dice) {
      gameState._tray._add(die);
      die._used = false;
    }
  }

  public _onDrop(): boolean {
    if (this._condition && this._condition()) {
      return this._parent._onDrop();
    }
    zzfx(1, .1, 281, .3, .2, 0, .4, 31.1, .56);
    return false;
  }

  public _update(delta: number, now: number): void {

  }

  public _draw(delta: number, now: number): void {
    gl._col(white);
    drawTexture("d_s", this._abs.x, this._abs.y, 2, 2);
    drawText(this._text, this._abs.x + 17, this._abs.y + 34, { _textAlign: Align.C, _colour: 0Xffeeeeee });
    super._draw(delta, now);
  }
}


->ne[0];
    const uint64_t ne01 = src0->ne[1];
    const uint64_t ne02 = src0->ne[2];
    // const uint64_t ne03 = src0->ne[3];

    const uint64_t ne10 = src1->ne[0];
    const uint64_t ne11 = src1->ne[1];
    const uint64_t ne12 = src1->ne[2];
    // const uint64_t ne13 = src1->ne[3];

    GGML_ASSERT(ne11 == 1);

    ggml_backend_vk_buffer_context * dst_buf_ctx = (ggml_backend_vk_buffer_context *)dst->buffer->context;
    ggml_backend_vk_buffer_context * src0_buf_ctx = (ggml_backend_vk_buffer_context *)src0->buffer->context;
    ggml_backend_vk_buffer_context * src1_buf_ctx = (ggml_backend_vk_buffer_context *)src1->buffer->context;

    vk_buffer d_Qy;
    size_t qy_buf_offset = 0;

    bool src1_uma = false;

    if (ctx->device->uma) {
        ggml_vk_host_get(ctx->device, src1->data, d_Qy, qy_buf_offset);
        src1_uma = d_Qy != nullptr;
    }

    const uint64_t x_ne = ne00 * ne01 * ne02;
    const uint64_t y_ne = ne10 * ne11 * ne12;
    const uint64_t d_ne = ne01 * ne11 * ne12;

    const uint64_t qx_sz = ggml_vk_align_size(ggml_type_size(src0->type) * x_ne / ggml_blck_size(src0->type), ctx->device->properties.limits.minStorageBufferOffsetAlignment);
    const uint64_t qy_sz = ggml_type_size(src1->type) * y_ne / ggml_blck_size(src1->type);
    const uint64_t d_sz = sizeof(float) * d_ne;

    if (dryrun) {
        // Request descriptor sets
        ggml_pipeline_request_descriptor_sets(ctx->device, ctx->device->pipeline_mul_mat_vec_p021_f16_f32, 1);
        return;
    }

    vk_buffer d_D = dst_buf_ctx->dev_buffer;
    const uint64_t d_buf_offset = vk_tensor_offset(dst) + dst->view_offs;
    GGML_ASSERT(d_D != nullptr);
    vk_buffer d_Qx = src0_buf_ctx->dev_buffer;
    const uint64_t qx_buf_offset = vk_tensor_offset(src0) + src0->view_offs;
    GGML_ASSERT(d_Qx != nullptr);
    if (!src1_uma) {
        d_Qy = src1_buf_ctx->dev_buffer;
        qy_buf_offset = vk_tensor_offset(src1) + src1->view_offs;
        GGML_ASSERT(d_Qx != nullptr);
    }

    const uint64_t qy_buffer_offset = (qy_buf_offset / ctx->device->properties.limits.minStorageBufferOffsetAlignment) * ctx->device->properties.limits.minStorageBufferOffsetAlignment;
    const uint64_t qy_shader_offset = qy_buf_offset - qy_buffer_offset;

    const uint64_t d_buffer_offset = (d_buf_offset / ctx->device->properties.limits.minStorageBufferOffsetAlignment) * ctx->device->properties.limits.minStorageBufferOffsetAlignment;


 "extension")
          .parentFile.absolutePath
      val zimFile =
        File.createTempFile(
          "fileToFind",
          ".zim",
          File("$tempRoot${File.separator}dir").apply(File::mkdirs)
        )
      every { contentResolver.query(any(), any(), any(), any(), any()) } returns null
      every { storageDevice.name } returns zimFile.parentFile.parent
      testFlow(
        flow = fileSearch.scan(scanningProgressListener),
        triggerAction = {},
        assert = { assertThat(awaitItem()[0]).isEqualTo(zimFile) }
      )
    }
  }

  @Nested
  inner class MediaStore {
    @Test
    fun `scan media store, if files are readable they are returned`() = runTest {
      val fileToFind = File.createTempFile("fileToFind", ".zim")
      expectFromMediaStore(fileToFind)
      testFlow(
        flow = fileSearch.scan(scanningProgressListener),
        triggerAction = {},
        assert = { assertThat(awaitItem()).isEqualTo(listOf(fileToFind)) }
      )
    }

    @Test
    fun `scan media store, if files are not readable they are not returned`() = runTest {
      val unreadableFile = File.createTempFile("fileToFind", ".zim")
      expectFromMediaStore(unreadableFile)
      unreadableFile.delete()
      testFlow(
        flow = fileSearch.scan(scanningProgressListener),
        triggerAction = {},
        assert = { assertThat(awaitItem()).isEqualTo(listOf<File>()) }
      )
    }

    private fun expectFromMediaStore(fileToFind: File) {
      val cursor = mockk<Cursor>()
      every {
        contentResolver.query(
          any(),
          arrayOf(MediaColumns.DATA),
          MediaColumns.DATA + " like ? or " + MediaColumns.DATA + " like ? ",
          arrayOf("%." + "zim", "%." + "zimaa"),
          null
        )
      } returns cursor
      every { cursor.moveToNext() } returnsMany listOf(true, false)
      every { cursor.columnNames } returns arrayOf(MediaColumns.DATA)
      every { cursor.getColumnIndex(MediaColumns.DATA) } returns 0
      every { cursor.getString(0) } returns fileToFind.absolutePath
    }
  }

  private fun deleteTempDirectory() {
    try {
      File.createTempFile("temp", ".txt")
        .parentFile.deleteRecursively()
    } catch (ignore: Exception) {
      ignore.printStackTrace()
    }
  }
}

suspend fun <T> TestScope.testFlow(
  flow: Flow<T>,
  triggerAction: suspend () -> Unit,
  assert: suspend TurbineTestContext<T>.() -> Unit
) {
  val job = launch {
    flow.test {
      triggerAction()
      assert()
      cancelAndIgnoreRemainingEvents()
      ensureAllEventsConsumed()
    }
  }
  job.join()
}
/*
 * Kiwix Android
 * Copyright (c) 2020 Kiwix <android.kiwix.org>
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */

package org.kiwix.kiwixmobile.core.base

import android.content.Intent
import android.view.ActionMode
import android.view.Menu
import androidx.appcompat.app.AppCompatActivity
import org.kiwix.kiwixmobile.core.base.FragmentActivityExtensions.Super.ShouldCall

interface


// Chart is already too narrow, make it less tall
                    if(chWidth < nChWidth){
                        nChHeight = chWidth - lWidth;
                        nChWidth = chWidth;
                    }
                    chart.setSize(nChWidth, nChHeight);
                }
                // Resize on load
                resizeCh(this_chart);
                // Resize on graph resize
                $(this_chart.renderTo).on('mqc_plotresize', function(e){
                    resizeCh(this_chart);
                });
            }
        });
}

/**
 * Get histogram data out of xy data
 * @param   {Array} data  Array of tuples [x, y]
 * @param   {Number} step Resolution for the histogram
 * @returns {Array}       Histogram data
 */
function histogram(data, step) {
    var histo = {},
        x,
        i,
        arr = [];

    // Group down
    for (i = 0; i < data.length; i++) {
        x = Math.floor(data[i]['x'] / step) * step;
        if (!histo[x]) {
            histo[x] = 0;
        }
        histo[x]++;
    }

    // Make the histo group into an array
    for (x in histo) {
        if (histo.hasOwnProperty((x))) {
            arr.push([parseFloat(x), histo[x]]);
        }
    }

    // Finally, sort the array
    arr.sort(function (a, b) {
        return a[0] - b[0];
    });

    return arr;
}

// Scatter plot
function plot_scatter_plot (target, ds){
    if(mqc_plots[target] === undefined || mqc_plots[target]['plot_type'] !== 'scatter'){
        return false;
    }
    var config = mqc_plots[target]['config'];
    var data = mqc_plots[target]['datasets'];
    if(ds === undefined){ ds = 0; }

    if(config['marker_colour'] === undefined){ config['marker_colour'] = 'rgba(124, 181, 236, .5)'; }
    if(config['marker_size'] === undefined){ config['marker_size'] = 5; }
    if(config['marker_line_colour'] === undefined){ config['marker_line_colour'] = '#999'; }
    if(config['marker_line_width'] === undefined){ config['marker_line_width'] = 1; }
    if(config['tt_label'] === undefined){ config['tt_label'] = 'X: {point.x:.2f}
Y: {point.y:.2f}'; }
    if(config['click_func'] === undefined){ config['click_func'] = function(){ }; }
    else {
        config['click_func'] = eval("("+config['click_func']+")");
        if(config['cursor'] === undefined){ config['cursor'] = 'pointer'; }
    }
    if (config['xDecimals'] === undefined){ config['xDecimals'] = true; }
    if (config['yDecimals'] === undefined){ config['yDecimals'] = true; }
    if (config['pointFormat'] === undefined){
        config['pointFormat'] = '

 {point.name}
'+config['tt_label'];
    }

    // Make a clone of the data, so that we can mess with it,
    // while keeping the original data in tact
    var data = JSON.parse(JSON.stringify(mqc_plots[target]['datasets'][ds]));

    // Rename samples
    if(window.mqc_rename_f_texts.length > 0){
        $.each(data, function(j, s){
            $.each(window.mqc_rename_f_texts, function(idx, f_text){
                if(window.mqc_rename_regex_mode){
                    var re = new RegExp(f_text,"g");
                    data[j]['name'] = data[j]['name'].replace(re, window.mqc_rename_t_texts[idx]);
                } else {
                    data[j]['name'] = data[j]['name'].replace(f_text, window.mqc_rename_t_texts[idx]);
                }
            });
        });
    }

    // Highlight samples
    if(window.mqc_highlight_f_texts.length > 0){
        $.each(data, function(j, s){
            if ('marker' in data[j]){
                data[j]['marker']['lineWidth'] = 0;
            } else {
                data[j]['marker'] = {'


(button.direction) or (button.secondDirection and INPUT:down(button.secondDirection))
  end
  for _, button in ipairs(buttons) do
    button:render()
    --button.pressed = INPUT:down(button.direction)
  end
  --love.graphics.print(tostring(gStateMachine.current.stateName), 0, 0)
  push:finish()
  --


,0c0,0,0.1-0.1,0.3-0.2l3-1.5l5.5,2.6c0.7,0.4,1.9,0.4,2.8,0l5.5-2.6l3,1.5C20.1,22.7,20.2,22.7,20.2,22.7z M19.9,18.7L11,22.8c-0.6,0.3-1.5,0.3-2,0l-8.9-4.1c-0.2-0.1-0.3-0.2-0.3-0.2l0,0c0,0,0.1-0.1,0.3-0.2l3-1.5l5.5,2.6c0.7,0.4,1.9,0.4,2.8,0l5.5-2.6l3,1.5c0.2,0.1,0.3,0.2,0.3,0.2l0,0C20.2,18.5,20.1,18.6,19.9,18.7z"/></g></svg>');
  }
  &.icon-help {
    width: 22px;
    height: 22px;
    .encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M11.6,1.3c-3.3,0-6,2.8-6,6.2c0.3,0,0.7,0,0.9,0c0-2.9,2.3-5.2,5.1-5.2s5.1,2.3,5.1,5.2c0,1.7-1.9,3.2-3,4.3C12.9,12.6,11,14.2,11,16c0,1.2,0,2.2,0,2.7c0.3,0,0.6,0,0.9,0c0-0.6,0-1.6,0-2.5c0-1.4,1.1-2.4,2.2-3.5c1.7-1.5,3.5-3.1,3.5-5.2C17.6,4.1,14.9,1.3,11.6,1.3z M11.5,20.2c-0.3,0-0.5,0.2-0.5,0.5v0.8c0,0.3,0.2,0.5,0.5,0.5s0.5-0.2,0.5-0.5v-0.8C11.9,20.4,11.7,20.2,11.5,20.2z"/></g></svg>');
  }
  &.icon-setup {
    width: 22px;
    height: 22px;
    .encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M0,3v16h22V3H0z M21,17H1V5h20V17z M16.5,5.9l-7.2,7.2L8.8,15H4v1c0,0,3.2,0,5,0c0.4,0,0.2,0,0.2-0.2l2.2-0.6L18.7,8L16.5,5.9z M9.9,13.1l6.5-6.4L18,8l-6.5,6.4L9.9,13.


  title: string
}>('cachedPosts', {
  offline: true
})

let LocalPost = syncMapTemplate<{
  category?: string
  title: string
}>('localPosts', {
  offline: true,
  remote: false
})

let createChangeAction = defineChangeSyncMap<PostValue>('posts')
let createChangedAction = defineChangedSyncMap<PostValue>('posts')

function changeAction(
  fields: Partial<PostValue>,
  id: string = 'ID'
): ReturnType<typeof createChangeAction> {
  return createChangeAction({ fields, id })
}

function changedAction(
  fields: Partial<PostValue>,
  id: string = 'ID'
): ReturnType<typeof createChangedAction> {
  return createChangedAction({ fields, id })
}

function createAutoprocessingClient(): TestClient {
  let client = new TestClient('10')
  client.on('add', (action, meta) => {
    if (action.type === 'logux/subscribe') {
      client.log.add({ id: meta.id, type: 'logux/processed' })
    }
  })
  return client
}

function clone<From extends object>(obj: From): From {
  return JSON.parse(JSON.stringify(obj))
}

afterEach(async () => {
  cleanStores(Post, CachedPost, LocalPost)
})

it('saves options to class', () => {
  expect(CachedPost.plural).toBe('cachedPosts')
  expect(CachedPost.offline).toBe(true)
  expect(CachedPost.remote).toBe(true)
  expect(LocalPost.remote).toBe(false)
})

it('saves options to store', () => {
  let client = new TestClient('10')
  let cached = CachedPost('ID', client)
  cached.listen(() => {})
  expect(cached.plural).toBe('cachedPosts')
  expect(cached.offline).toBe(true)
  expect(cached.remote).toBe(true)
})

it('throws on missed client', () => {
  let post = Post('ID')
  expect(() => {
    post.listen(() => {})
  }).toThrow('Missed Logux client')
})

it('subscribes and unsubscribes', async () => {
  let client = new TestClient('10')
  await client.connect()

  let post = Post('ID', client)
  let unbind = (): void => {}
  await client.server.freezeProcessing(async () => {
    unbind = post.listen(() => {})
    expect(post.get().isLoading).toBe(true)
  })

  await Promise.resolve()
  expect(post.get().isLoading).toBe(false)
  expect(client.subscribed('posts/ID')).toBe(true)

  unbind()
  await delay(1020)
  expect(client.subscribed('posts/ID')).toBe(false)
})

it('changes key', async () => {
  let client = createAutoprocessingClient()
  await client.connect()

  let post = Post('ID', client)
  let changes: SyncMapValue<PostValue>[] = []
  post.subscribe(value => {
    changes.push(clone(value))
  })

  expect(post.get()).toEqual({
    id: 'ID',
    isLoading: true
  })

  await post.loading

  changeSyncMap(post, 'title', '1')
  expect(post.get()).toEqual({
    id: 'ID',
    isLoading: false,
    title: '1'
  })
  expect(changes).toEqual([
    { id: 'ID', isLoading: true },
    { id: 'ID', isLoading: false },
    { id: 'ID', isLoading: false, title: '1' }
  ])

  changeSyncMapById(client, Post, 'ID', 'category', 'demo')
  expect(post.get()).toEqual({
    id: 'ID',
    isLoading: false,
    title: '1'
  })

  await allTasks()
  expect(post.get()).toEqual({
    category: 'demo',
    id: 'ID',
    isLoading:


 by lazy { throw IllegalArgumentException("blah") }

  @Test
  fun exceptionTest() {
    val ex = assertFailsWith<InterpolationException> {
      StaticTerp("foo_${A}${E}${C}_baz")
    }

    println("====== `InterpolateWithWrappersTest.exceptionTest` message: ${ex.msg}")
    assertContains(ex.msg, "Error in spliced")
  }

  @Test
  fun exceptionTest2() {
    val ex = assertFailsWith<InterpolationException> {
      StaticTerp("foo_${A}${
        "foo" +
          throw IllegalArgumentException("blah blah")
      }${C}_baz")
    }

    println("====== `InterpolateWithWrappers.exceptionTest2` message: ${ex.msg}")
    assertContains(ex.msg, "Error in spliced")
  }

  fun <T> id(value: T): T = value

  @PotentiallyDangerous
  @Test
  fun simpleStaticTest_WithInline() {
    val middle = "str"
    StaticTerp("foo_${A}${inline(middle)}${C}") shouldBe
      Out(listOf("foo_", "", "", ""), listOf(A, In("(String-inline)str"), C), "Static")
  }

  @Test
  fun simpleStaticTest2() {
    // need to have an id function because splicing same thing as a wrap will make kotlin try to "optimize" it by treating the string part as a constant
    StaticTerp("foo_${id("str")}_bar") shouldBe
      Out(listOf("foo_", "_bar"), listOf(In("(String)str")), "Static")
  }

  @Test
  fun simpleStaticTest3() {
    StaticTerp("foo_${A}${id("str")}${C}") shouldBe
      Out(listOf("foo_", "", "", ""), listOf(A, In("(String)str"), C), "Static")
  }

  @Test
  fun staticTestExtensionRecieverWrapper() {
    val someOther = SomeOtherType("someValue")
    StaticTerp("foo_${A}${someOther}${C}") shouldBe
      Out(listOf("foo_", "", "", ""), listOf(A, In("(SomeOtherType)someValue"), C), "Static")
  }
}
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

// In certain situations where tests are being rapidly iterated
// and the KSP artifacts are already produced we may want to sepectively disable KSP
// (i.e. while tests are being rewritten and other which requires XR changes -which is mostly where ExoQuery uses Decomat's KSP functionality-
// we can disable the KSP-based decomat code generation)
val kspEnabled = true

plugins {
  kotlin("multiplatform") version "2.2.20"
  id("maven-publish")

  id("io.exoquery.terpal-plugin") version "2.2.20-2.0.1.PL"

  id("conventions-multiplatform")
  id("publish")

  // can remove this if kspEnabled is false (this the variable kspEnabled cannot be used here)
  id("com.google.devtools.ksp") version "2.2.20-2.0.3"

  kotlin("plugin.serialization") version "2.2.20"
}

version = extra["pluginProjectVersion"].toString()

dependencies {
  if (kspEnabled)
    add("kspCommonMainMetadata", "io.exoquery:decomat-ksp:1.0.0")

  // Double ksp entry causes strange overrides so do not use it
  //if (kspEnabled) add("kspJvm", "io.exoquery:decomat-ksp:1.0.0")
  commonMainApi("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")
}

kotlin {
  compilerOptions {
    freeCompilerArgs.add("-Xwhen-guards")
    optIn.add("io.exoquery.annotation.ExoInternal")
  }

  jvm()
  linuxX64


              '#616e87',
        String.Interpol:            '#a3be8c',
        String.Escape:              '#ebcb8b',
        String.Regex:               '#ebcb8b',
        String.Symbol:              '#a3be8c',
        String.Other:               '#a3be8c',

        Number:                     '#b48ead',

        Generic.Heading:            'bold #88c0d0',
        Generic.Subheading:         'bold #88c0d0',
        Generic.Deleted:            '#bf616a',
        Generic.Inserted:           '#a3be8c',
        Generic.Error:              '#bf616a',
        Generic.Emph:               'italic',
        Generic.Strong:             'bold',
        Generic.Prompt:             'bold #616e88',
        Generic.Output:             '#d8dee9',
        Generic.Traceback:          '#bf616a',

        Error:                      '#bf616a',
        Text:                       '#d8dee9',
    }


                                                                */
/*  INPUT                                                                 */
/*                                                                        */
/*    new_posture                           New interrupt lockout posture */
/*                                                                        */
/*  OUTPUT                                                                */
/*                                                                        */
/*    old_posture                           Old interrupt lockout posture */
/*                                                                        */
/*  CALLS                                                                 */
/*                                                                        */
/*    None                                                                */
/*                                                                        */
/*  CALLED BY                                                             */
/*                                                                        */
/*    Application Code                                                    */
/*                                                                        */
/*  RELEASE HISTORY                                                       */
/*                                                                        */
/*    DATE              NAME                      DESCRIPTION             */
/*                                                                        */
/*  06-02-2021      Scott Larson            Initial Version 6.1.7         */
/*                                                                        */
/**************************************************************************/
// UINT   _tx_thread_interrupt_control(UINT new_posture)
// {
    .global  _tx_thread_interrupt_control
    .thumb_func
_tx_thread_interrupt_control:
#ifdef TX_PORT_USE_BASEPRI
    MRS     r1, BASEPRI                         // Pickup current interrupt posture
    MSR     BASEPRI, r0                         // Apply the new interrupt posture
    MOV     r0, r1                              // Transfer old to return register
#else
    MRS     r1, PRIMASK                         // Pickup current interrupt lockout
    MSR     PRIMASK, r0                         // Apply the new interrupt lockout
    MOV     r0, r1                              // Transfer old to return register
#endif
    BX      lr                                  // Return to caller
// }


end
        end
    end
})

-- DM Mode
--[[RegisterGamemode('dmMode', {
    -- This gamemode is only for picking
    sort = GAMEMODE_ADDON,

    -- When players are given a new hero
    onHeroKilled = function(frota, killedUnit, killerEntity)
        if IsValidEntity(killedUnit) then
            -- Change their hero
            local newHero = frota:ChangeHero(killedUnit, frota:ChooseRandomHero())

            -- Make


/* Copyright (c) 2021-2022 Intel Corporation

Copyright 2015 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.
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.
==============================================================================*/

#ifndef ITEX_CORE_KERNELS_GPU_RELU_OP_FUNCTOR_H_
#define ITEX_CORE_KERNELS_GPU_RELU_OP_FUNCTOR_H_
// Functor definition for ReluOp and ReluGradOp, must be compilable by nvcc.

#include "itex/core/utils/tensor_types.h"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"

namespace itex {
namespace functor {
// Functor used by SeluOp to do the computations.
template <typename Device, typename T>
struct Selu {
  // Computes Selu activation.
  //
  // features: any shape.
  // activations: same shape as "features".
  void operator()(const Device& d, typename TTypes<T>::ConstTensor features,
                  typename TTypes<T>::Tensor activations) {
    // features.constant(?)
    const auto scale = static_cast<T>(1.0507009873554804934193349852946);
    const auto scale_alpha = static_cast<T>(1.7580993408473768599402175208123);
    const auto one = static_cast<T>(1);
    const auto zero = static_cast<T>(0);
    activations.device(d) =
        (features < zero)
            .select(scale_alpha * (features.exp() - features.constant(one)),
                    scale * features);
  }
};

// Functor used by SeluGradOp to do the computations.
template <typename Device, typename T>
struct SeluGrad {
  // Computes SeluGrad backprops.
  //
  // gradients: gradients backpropagated to the Selu op.
  // activations: outputs of the Selu op.
  // backprops: gradients to backpropagate to the Selu inputs.
  void operator()(const Device& d, typename TTypes<T>::ConstTensor gradients,
                  typename TTypes<T>::ConstTensor activations,
                  typename TTypes<T>::Tensor backprops) {
    const auto scale = static_cast<T>(1.0507009873554804934193349852946);
    const auto scale_alpha = static_cast<T>(1.7580993408473768599402175208123);
    backprops.device(d) =
        (activations < static_cast<T>(0))
            .select(gradients * (activations + scale_alpha), gradients * scale);
  }
};
}  // namespace functor
}  // namespace itex
#endif  // ITEX_CORE_KERNELS_GPU_RELU_OP_FUNCTOR_H_


2(a6),-16(a6),!
	tst.l	d0
	bge.s	L1222				;    && Pexec(cmd_beg_p,arg_beg_p,0) < 0)
;						;{
	sub_gemdos	Cconws,error_on_s-static(a4)
	sub_gemdos	Cconws!_IND,-12(a6)
	sub_gemdos	Cconout,#$20
	move.l	-16(a6),a0	;\
	addq.l	#1,-16(a6)	; >		;	arg_ext_ch = *arg_beg_p++;
	move.b	(a0),-18(a6)	;/
	bra.s	L1206
L11EE:
	move.l	-16(a6),a0
	addq.l	#1,-16(a6)
	move.b	(a0),d0
	ext.w	d0
	sub_gemdos	Cconout,d0
L1206:
	move.b	-18(a6),d0
	subq.b	#1,-18(a6)
	tst.b	d0
	bne.s	L11EE
	sub_gemdos	Cconws,crlf_s-static(a4)
L1222:						;} /* endif */
	move.l	-8(a6),a0	;\
	move.b	(a0),d0		; >	} until (*INF_pos_p == '\0')
	bne	L1002		;/
fnend_batch_INF:
	sub_gemdos	Mfree!_IND,-4(a6)
	unlk	a6
	rts
;
;
; short	 fgets_masked(*chbufp,maxcnt,minchar,maxchar,*handlep)
fgets_masked:
	link	a6,#-4
	sub_xbios	Cursconf,#1,!
	clr	-4(a6)		;curpos= 0
.LAAE:
	move.l	18(a6),a0
	tst	(a0)
	ble.s	.LB58		;go .LB58 if handle is for a non-file device
.LABA:	;here we read from some file
	clr.b	-1(a6)		;ch= 0
	move.l	18(a6),a0	;a0->handle
	sub_gemdos	Fread,(a0),#1,-1(a6)
	move.b	-1(a6),d0
	cmp.b	#'a',d0
	blt.s	.LB04
	cmp.b	#'z',d0
	bgt.s	.LB04
	sub.b	#' ',d0
	move.b	d0,-1(a6)
.LB04:
	bsr	is_white
	bne.s	.LB66		;go admit non-whitespace
.LB4A:
	tst	-4(a6)
	beq.s	.LABA		;Loop if curpos==0
	bra.s	.LB66
;
.LB58:	;here we read from some device (like CON:)
	sub_gemdos	Crawcin
	move.b	d0,-1(a6)
.LB66:
	move.b	-1(a6),d0
	cmp.b	#BS,d0
	bne.s	.LB8E
	move	-4(a6),d0
	beq.s	.LB8E		;don't backspace if curpos==0
	sub_gemdos	Cconws,BS_SP_BS_s-static(a4)
	subq	#1


 input < 20 chars
    // cin >> ps; Too horrible a blunder to try; ps doesn't
    //            point to allocated space

    ps = animal;                // set ps to point to string
    cout << ps << "!\n";       // ok, same as using animal
    cout << "Before using strcpy():\n";
    cout << animal << " at " << (int *) animal << endl;
    cout << ps << " at " << (int *) ps << endl;

    ps = new char[strlen(animal) + 1];  // get new storage
    strcpy(ps, animal);         // copy string to new storage
    cout << "After using strcpy():\n";
    cout << animal << " at " << (int *) animal << endl;
    cout << ps << " at " << (int *) ps << endl;
    delete [] ps;
    // cin.get();
    // cin.get();
    return 0;
}
// tempover.cpp --- template overloading
#include <iostream>

template <typename T>            // template A
void ShowArray(T arr[], int n);

template <typename T>            // template B
void ShowArray(T * arr[], int n);

struct debts
{
    char name[50];
    double amount;
};

int main()
{
    using namespace std;
    int things[6] = {13, 31, 103, 301, 310, 130};
    struct debts mr_E[3] =
    {
        {"Ima Wolfe", 2400.0},
        {"Ura Foxe", 1300.0},
        {"Iby Stout", 1800.0}
    };
    double * pd[3];

// set pointers to the amount members of the structures in mr_E
    for (int i = 0; i < 3; i++)
        pd[i] = &mr_E[i].amount;

    cout << "Listing Mr. E's counts of things:\n";
// things is an array of int
    ShowArray(things, 6);  // uses template A
    cout << "Listing Mr. E's debts:\n";
// pd is an array of pointers to double
    ShowArray(pd, 3);      // uses template B (more specialized)
    // cin.get();
    return 0;
}

template <typename T>
void ShowArray(T arr[], int n)
{
    using namespace std;
    cout << "template A\n";
    for (int i = 0; i < n; i++)
        cout << arr[i] << ' ';
    cout << endl;
}

template <typename T>
void ShowArray(T * arr[], int n)
{
    using namespace std;
    cout << "template B\n";
    for (int i = 0; i < n; i++)
        cout << *arr[i] << ' ';
    cout << endl;
}
//filefunc.cpp -- function with ostream & parameter
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;

void file_it(ostream & os, double fo, const double fe[],int n);
const int LIMIT = 5;
int main()
{
    ofstream fout;
    const char * fn = "ep-data.txt";
    fout.open(fn);
    if (!fout.is_open())
    {
        cout << "Can't open " << fn << ". Bye.\n";
        exit(EXIT_FAILURE);
    }
    double objective;
    cout << "Enter the focal length of your "
            "telescope objective in mm: ";
    cin >> objective;
    double eps[LIMIT];
    cout << "Enter the focal lengths, in mm, of " << LIMIT
         << " eyepieces:\n";
    for (int i = 0; i < LIMIT; i++)
    {
        cout << "Eyepiece #" << i + 1 << ": ";
        cin >> eps[i];
    }
    file_it(fout, objective, eps, LIMIT);
    file_it(cout, objective, eps, LIMIT);
    cout << "Done\n";
    // cin


local expr_parse = require 'expr-parse'
local gdt_expr = require 'gdt-expr'
local gdt_factors = require 'gdt-factors'
local AST = require 'expr-actions'

local abs, max, min, sqrt = math.abs, math.max, math.min, math.sqrt

local function tab_select_interval(tab, t_name, t1, t2)
    local N, M = tab:dim()
    local hs = tab:headers()
    local row = {}
    local new_tab = gdt.alloc(0, tab:headers())
    for i = 1, N do
        local t = tab:get(i, t_name)
        if t >= t1 and t <= t2 then
            for j = 1, #hs do
                row[hs[j]] = tab:get(i, j)
            end
            new_tab:append(row)
        end
    end
    return new_tab
end

local function linear_resid(tab, x_expr, i1, i2, y_exprs)
    local res_max_ls = {}
    for q, y_expr in ipairs(y_exprs) do
        local x1, x2 = gdt_expr.eval(tab, x_expr.scalar, i1), gdt_expr.eval(tab, x_expr.scalar, i2)
        local y1, y2 = gdt_expr.eval(tab, y_expr.scalar, i1), gdt_expr.eval(tab, y_expr.scalar, i2)
        local dydx = (y2 - y1) / (x2 - x1)
        local res_max = 0
        for i = i1, i2 do
            local x = gdt_expr.eval(tab, x_expr.scalar, i)
            local y = gdt_expr.eval(tab, y_expr.scalar, i)
            local y_approx = y1 + dydx * (x - x1)
            res_max = max(res_max, abs(y - y_approx))
        end
        res_max_ls[q] = res_max
    end
    return res_max_ls
end

local function res_within_eps_rels(res_max, ranges, eps_rels)
    for q = 1, #res_max do
        if res_max[q] / ranges[q] > eps_rels[q] then
            return false
        end
    end
    return true
end

local function find_data_ranges(tab, y_exprs)
    local ranges = {}
    for q, y_expr in ipairs(y_exprs) do
        local data_min = gdt_expr.eval(tab, y_expr.scalar, 1)
        local data_max = data_min
        for i = 2, #tab do
            local y = gdt_expr.eval(tab, y_expr.scalar, i)
            data_min = min(data_min, y)
            data_max = max(data_max, y)
        end
        ranges[q] = (data_max > data_min and data_max - data_min or 1)
    end
    return ranges
end

-- for compatibility will accept arguments in the form:
--    sampling_opt(tab, x_name, y_names, eps_rels)
-- this compatibility layer should disappear after the 2.3.5 release
local function sampling_opt(tab, expr_formula, eps_rels, arg_adj)
    if type(eps_rels) == "table" and type(eps_


 ==========

        public void ImportTrack( byte[] data ) {
            TmbReader.Import( File, data, out var _, out var tracks, out var entries, out var _, true );
            Dalamud.Log( $"{tracks.Count} {entries.Count}" );
            var commands = new List<ICommand>();
            var track = tracks[0];
            AddTrack( commands, track );
            track.Entries.AddRange( entries );
            commands.Add( new ListAddRangeCommand<TmbEntry>( File.AllEntries, entries ) );
            CommandManager.Add( new CompoundCommand( commands, File.RefreshIds ) );
        }

        public void AddTrack() {
            var commands = new List<ICommand>();
            AddTrack( commands, new Tmtr( File ) );
            CommandManager.Add( new CompoundCommand( commands, File.RefreshIds ) );
        }

        public void AddTrack( List<ICommand> commands, Tmtr track ) {
            commands.Add( new ListAddCommand<Tmtr>( Tracks, track ) );
            commands.Add( new ListAddCommand<Tmtr>( File.AllTracks, track, AllTracksIdx ) );
        }

        public void DeleteTrack( Tmtr track ) {
            if( !Tracks.Contains( track ) ) return;
            var commands = new List<ICommand>();
            DeleteTrack( commands, track );
            CommandManager.Add( new CompoundCommand( commands, File.RefreshIds ) );
        }

        public void DeleteTrack( List<ICommand> commands, Tmtr track ) {
            if( !Tracks.Contains( track ) ) return;
            commands.Add( new ListRemoveCommand<Tmtr>( Tracks, track ) );
            commands.Add( new ListRemoveCommand<Tmtr>( File.AllTracks, track ) );
            track.DeleteAllEntries( commands );
        }

        public void DeleteChildren( List<ICommand> commands, TmbFile file ) {
            foreach( var track in Tracks ) {
                commands.Add( new ListRemoveCommand<Tmtr>( Tracks, track ) );
                commands.Add( new ListRemoveCommand<Tmtr>( file.AllTracks, track ) );
                track.DeleteAllEntries( commands );
            }
        }
    }
}


e
  String faq250Sbanswer8722Sb7(Object here) {
    return 'Jawohl! Sieh es dir $here an.';
  }

  @override
  String get faq250Sbanswer8722Sb78722Sbhere => 'hier';

  @override
  String faq250Sbanswer8722Sb8(Object appName) {
    return 'Alle Online-Geschäfte sind durch Schiedsgarantien geschützt. Wenn ein Handel gestartet wird, wird automatisch eine dem Handelsbetrag entsprechende Monero-Menge aus dem $appName-Bond-Wallet des Verkäufers reserviert. Das heißt, wenn der Verkäufer mit Ihrem Geld davonläuft und den Handel nicht abschließt, kann der Support von $appName die in der Schiedsgarantie gehaltenen Monero an Sie weiterleiten. Wenn Sie Monero verkaufen, schließen Sie den Handel niemals ab, bevor Sie wissen, dass Sie Geld vom Monero-Käufer erhalten haben. Bitte beachten Sie, dass bei lokalen Geschäften der Schiedsgarantieschutz nicht standardmäßig aktiviert ist.';
  }

  @override
  String faq250Sbanswer8722Sb857Sbagoradesk(Object appName) {
    return 'Alle Online-Geschäfte sind durch Schiedsgarantien geschützt. Wenn ein Handel gestartet wird, wird automatisch eine Menge an Kryptowährung in Höhe des Handelsbetrags aus dem $appName-Bond-Wallet des Verkäufers reserviert. Das heißt, wenn der Verkäufer mit Ihrem Geld davonläuft und den Handel nicht abschließt, kann der Support von $appName die in der Schiedsgarantie enthaltene Kryptowährung an Sie weiterleiten. Wenn Sie Kryptowährungen verkaufen, schließen Sie den Handel niemals ab, bevor Sie wissen, dass Sie Geld vom Käufer erhalten haben. Bitte beachten Sie, dass bei lokalen Geschäften der Schiedsgarantieschutz nicht standardmäßig aktiviert ist.';
  }

  @override
  String faq250Sbanswer8722Sb9(Object appName) {
    return 'Auf $appName gibt es zwei verschiedene Arten von Trades: lokale Trades und Online Trades. Online Trades werden vollständig online über unsere Handelsplattform abgewickelt, ohne dass Sie Ihren Handelspartner jemals treffen. Die Schlichtungsbürgschaft ist für Online-Trades automatisch aktiviert und finanziert, d.h. als Käufer sind Sie automatisch durch unser System zur Absicherung der Schlichtungsbürgschaft geschützt. Die meisten Trades auf $appName sind Online Trades. Lokale Trades sind für den persönlichen Kontakt gedacht, und die Schlichtungsbürgschaft ist nicht automatisch aktiviert. Aus diesem Grund ist es nicht sicher, den Verkäufer in einem lokalen Trade mit einer Online-Zahlungsmethode zu bezahlen. Online-Zahlungsmethoden sind z.B. Banküberweisungen, PayPal, Geschenkkartencodes usw.';
  }

  @override
  String faq250Sbmorph8722Sbdeposit250Sbcontent(Object appName) {
    return 'Wenn Sie Coins aus einer Wallet einer anderen Kryptowährung in die $appName Wallet einzahlen möchten, müssen Sie das Kästchen \"Ich möchte eine andere Währung einzahlen\" auf der Registerkarte \"Empfangen\" der Wallet-Seite aktivieren. Wählen Sie im angezeigten Abschnitt die gewünschte Einzahlungswährung und den Einzahlungsbetrag aus (achten Sie auf die angezeig


r8
	mov r1, r7
	bl LogMessageByIdWithPopupCheckUserTarget
	b _02317E70
_02317E44:
	ldrb r0, [sp, #0x20]
	cmp r0, #0
	beq _02317E70
	mov r0, #0
	mov r1, r7
	mov r2, r0
	bl SubstitutePlaceholderStringTags
	ldr r2, _02317E84 ; =0x00000DB4
	mov r0, r8
	mov r1, r7
	bl LogMessageByIdWithPopupCheckUserTarget
_02317E70:
	mov r0, r7
	bl UpdateStatusIconFlags
_02317E78:
	add sp, sp, #8
	ldmia sp!, {r4, r5, r6, r7, r8, pc}
	.align 2, 0
#ifdef JAPAN
_02317E80: .word 0x00000AF3
_02317E84: .word 0x00000AF4
#else
_02317E80: .word 0x00000DB3
_02317E84: .word 0x00000DB4
#endif
	arm_func_end RestoreOneMovePP

	arm_func_start RestoreRandomMovePP
RestoreRandomMovePP: ; 0x02317E88
	stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr}
	sub sp, sp, #0x14
	mov sb, r1
	ldr r1, [sb, #0xb4]
	mov r6, #0
	mov sl, r0
	mov r8, r2
	mov r7, r3
	mov r5, r6
#ifdef JAPAN
	add r4, r1, #0x120
#else
	add r4, r1, #0x124
#endif
	add fp, sp, #0xc
_02317EB4:
	ldrb r1, [r4, r5, lsl #3]
	add r0, r4, r5, lsl #3
	tst r1, #1
	movne r1, #1
	moveq r1, #0
	tst r1, #0xff
	beq _02317F00
	ldrb r1, [r0, #6]
	str r1, [sp, #8]
	bl GetMaxPp
	str r0, [sp, #4]
	ldr r1, [sp, #8]
	ldr r0, [sp, #4]
	cmp r1, r0
	addlt r0, r6, #1
	movlt r1, r6, lsl #1
	movlt r0, r0, lsl #0x10
	strlth r5, [fp, r1]
	movlt r6, r0, asr #0x10
_02317F00:
	add r0, r5, #1
	mov r0, r0, lsl #0x10
	mov r5, r0, asr #0x10
	cmp r5, #4
	blt _02317EB4
	cmp r6, #0
	ble _02317F48
	mov r0, r6
	bl DungeonRandInt
	mov r0, r0, lsl #0x10
	add r1, sp, #0xc
	mov r0, r0, asr #0xf
	ldrh r2, [r1, r0]
	mov r0, sl
	mov r1, sb
	mov r3, r8
	str r7, [sp]
	bl RestoreOneMovePP
_02317F48:
	add sp, sp, #0x14
	ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, fp, pc}
	arm_func_end RestoreRandomMovePP

	arm_func_start ApplyProteinEffect
ApplyProteinEffect: ; 0x02317F50
	stmdb sp!, {r4, r5


and only screen and (max-width:991px){.skin-3 .sidebar.responsive-min.responsive .nav-list>li.active>a:after,.skin-3 .sidebar.responsive-min.responsive .nav-list>li.active>a:before{display:none}}.skin-3 .sidebar-shortcuts,.skin-3 .sidebar-shortcuts-mini{background-color:#dbdbdb}.skin-3 .sidebar-shortcuts-large>.btn:focus{outline:0}.skin-3 .sidebar>.nav-search{background-color:#dbdbdb}.skin-3 .sidebar-toggle{background-color:#d0d0d0;border-color:#f2f2f2}.skin-3 .sidebar-toggle:before{border-color:#f2f2f2}.skin-3 .sidebar-toggle>.ace-icon{background-color:#fff;background-color:#FFF;border-color:#999;color:#999}@media only screen and (max-width:991px){.skin-3 .sidebar.navbar-collapse .nav-list>li:before{height:43px!important}.skin-3 .sidebar.navbar-collapse .sidebar-shortcuts{padding:0 0 3px!important}}.skin-3 .nav-list>li.active.hover:hover>a.dropdown-toggle:after,.skin-3 .nav-list>li.active.hover:hover>a.dropdown-toggle:before{display:none}.skin-3 .main-container .menu-toggler{background-color:#62A8D1;color:#FFF}.skin-3 .main-container .menu-toggler:before,.skin-3 .main-container .menu-toggler:after{border-color:#FFF}.skin-3 .main-container .menu-toggler>.toggler-text{border-top-color:#62A8D1;-moz-border-top-colors:#62A8D1}.skin-3 .main-container .menu-toggler>.toggler-text:after{color:#FFF}.skin-3 .navbar .navbar-toggle{border-color:rgba(255,255,255,.15);transition:background-color .1s ease 0s;background-color:#648CAE}.skin-3 .navbar .navbar-toggle:focus{background-color:#648CAE;border-color:rgba(255,255,255,.15)}.skin-3 .navbar .navbar-toggle:hover{background-color:#5782a7;border-color:rgba(255,255,255,.15)}.skin-3 .navbar .navbar-toggle.display,.skin-3 .navbar .navbar-toggle[data-toggle=collapse]:not(.collapsed){background-color:#507899;border-color:rgba(255,255,255,.3)}.skin-3 .breadcrumbs{border-width:0;background-color:#e7f2f8;border-radius:4px;margin:8px 8px 0}.skin-3 .navbar:not(.navbar-fixed-top):not(.h-navbar)+.main-container .breadcrumbs{margin-top:auto;top:8px;margin-bottom:8px}@media only screen and (max-width:991px){.skin-3 .breadcrumbs{margin:5px 5px 0}.skin-3 .navbar:not(.navbar-fixed-top):not(.h-navbar)+.main-container .breadcrumbs,.skin-3 .navbar:not(.navbar-fixed-top)+.main-container .breadcrumbs{margin-top:auto;top:5px;margin-bottom:5px}.skin-3 .menu-toggler+.sidebar.responsive+.main-content .breadcrumbs{margin:0;top:auto;border-radius:0}}@media (min-width:992px){.skin-3 .breadcrumbs.breadcrumbs-fixed+.page-content{padding-top:57px}}@media (min-width:992px) and (max-width:991px){.skin-3 .breadcrumbs.breadcrumbs-fixed+.page-content{padding-top:54px}.skin-3 .menu-toggler+.sidebar.reponsive+.main-content .breadcrumbs.breadcrumbs-fixed+.page-content{


nse + "\n")

if __name__ == "__main__":

    args = get_args()
    if args.func == "process_wow_dataset":
        process_wow_dataset(args.raw_file, args.processed_file, args.knwl_ref_file, args.resp_ref_file)

    elif args.func == "process_woi_dataset":
        process_woi_dataset(args.raw_file, args.processed_file, args.knwl_ref_file, args.resp_ref_file)

    elif args.func == "get_knwl_gen_prompts":
        prompt_selection_for_knowledge_generation(
            args.test_file, args.train_file, args.model_file,
            args.processed_file, args.data_type)

    elif args.func == "get_resp_gen_prompts":
        prompt_selection_for_response_generation(
            args.train_file, args.processed_file, args.seed)

    elif args.func == "prepare_input":
        prepare_input_for_response_generation(
            args.test_file, args.knwl_gen_file, args.processed_file)


lse {
      y_error("crc_on accepts only non-struct, non-pointer array data");
      /*
    } else if (flag == Y_RANGE) {
      flag = (argc>1)? yget_range(argc-2, range) : 0;
      crc = crc_compute(table, (void*)range, 3*sizeof(long), init, crc);
      crc = crc_compute(table, (void*)&flag, sizeof(int), 0, crc);
    } else {
      addr = yget_use(argc-1);
      ydrop_use(addr);
      crc = crc_compute(table, (void*)&addr, sizeof(void*), init, crc);
      */
    }
    ypush_long(crc);

  } else {      /* compute a crc_table or crc_def */
    if (flag != (Y_PSEUDO | Y_MIN_DFLT | Y_MAX_DFLT))
      y_error("unrecognized second argument to crc_on");
    if (yarg_string(argc-1) == 1) {
      char *nm = ygets_q(argc-1);
      for (n=0 ; n<5 ; n++) if (!strcmp(nm, crc_names[n])) break;
      if (n>=5) y_error("crc_on unrecognized crc_def name");
      table = crc_defs[n];
      n = 5;
    } else {
      table = yarg_nil(argc-1)? 0 : (unsigned long *)ygeta_l(argc-1, &n, 0);
      if (!table) n = 260;
    }
    if (n == 5) {
      unsigned long *def = table;
      long dims[2];
      dims[0] = 1;  dims[1] = 260;
      table = (unsigned long *)ypush_l(dims);
      if (crc_setup(table, def[0], def[1], def[2], def[3], def[4]))
        y_error("crc_on(arg,-) given illegal crc_def argument");
    } else if (n == 260) {
      int w, r;
      unsigned long p, i, x;
      long *def;
      long dims[2];
      dims[0] = 1;  dims[1] = 5;
      def = ypush_l(dims);
      crc_query(table? table : crc_on_table, &w, &p, &i, &r, &x);
      def[0] = w;  def[1] = p;  def[2] = i;  def[3] = r;  def[4] = x;
    } else {
      y_error("crc_on(arg,-) query arg not a crc_def or crc_table");
    }
  }
}

/*--------------------------------------------------------------------------*/

extern BuiltIn Y_md5, Y_sha1;
static void mdig_worker(int argc, int sha1);

void Y_md5(int argc) { mdig_worker(argc, 0); }
void Y_sha1(int argc) { mdig_worker(argc, 1); }

#include "mdigest.h"

static void
mdig_worker(int argc, int sha1)
{
  md_state *state = 0, astate;
  int final = !yarg_subroutine();
  long len, ref = -1L;
  int typeid;
  if (argc == 2) {
    long dims[Y_DIMSIZE];
    ref = yget_ref(1);
    if (ref < 0)
      y_errorq("%s state argument must be simple variable reference",
               sha1?"sha1":"md5");
    typeid = yarg_typeid(1);
    if (typeid == Y_VOID) {       /* initialize new state vector */
      dims[0] = 1;
      dims[1] = sizeof(md_state);
      state = (md_state *)ypush_c(dims);
      md_init(state);
      yput_global(ref, 0);
      yarg_drop(1);
    } else if (typeid == Y_CHAR) {  /* continue with existing state vector */
      state = (md_state *)ygeta_c(1, 0, dims);
      if (dims[0]!=1 || dims[1]!=sizeof(md_state))
        y_errorq("%s state argument has wrong type or size",
                 sha1?"sha1":"md5");
    }
  } else if (argc == 1) {
    state = &astate;   /* use temporary state */
    md_init(state);
  }
  typeid = yarg_typeid(0);
  if (typeid < Y_POINTER) {
    void *addr = ygeta_any(0, &len, 0, 0);
    void (*update)(md_state *ctx, void *data, unsigned long nbytes) =
      sha1? &sha1_update : &md5_update;
    if (typeid == Y_STRING) {
      long i;
      char **q = addr;
      for (i=0 ; i<len ; i++) update(state, q[i], q[i]?strlen(q[i]):0);
    } else {
      update(state, addr, len*crc_array_types[typeid]->size);
    }
  } else if (typeid != Y_VOID) {
    y_errorq("%s accepts only non-struct, non-pointer array data",
             sha1?"sha1":"md5");
  }
  if (final) {
    long dims[2];
    dims[0] = 1;
    dims[1] = sha1? 20 : 16;
    if (sha1) sha1_final((void*)ypush_c(dims), state);
    else md5_final((void*)ypush_c(dims), state);
    if (ref >= 0) {
      ypush_nil();
      yput_global(ref, 0);
      yarg_drop(1);
    }
  }
}

/*--------------------------------------------------------------------------*/


 msgInfoAuth: MsgInfoAuthReq? = null,
    @ProtoNumber(8) val uploadKeyRenewal: UploadKeyRenewalReq? = null,
    @ProtoNumber(9) val downloadSafe: DownloadSafeReq? = null,
    @ProtoNumber(99) val extension: ByteArray? = null,
)

@Serializable
data class DownloadSafeReq(
    @ProtoNumber(1) val index: IndexNode,
)

@Serializable
data class UploadKeyRenewalReq(
    @ProtoNumber(1) val oldUkey: String,
    @ProtoNumber(2) val subType: UInt,
)

@Serializable
data class MsgInfoAuthReq(
    @ProtoNumber(1) val msg: ByteArray,
    @ProtoNumber(2) val authTime: ULong,
)

@Serializable
data class UploadCompletedReq(
    @ProtoNumber(1) val srvSendMsg: Boolean,
    @ProtoNumber(2) val clientRandomId: ULong,
    @ProtoNumber(3) val msgInfo: MsgInfo,
    @ProtoNumber(4) val clientSeq: UInt,
)

@Serializable
data class MsgInfo(
    @ProtoNumber(1) val msgInfoBody: List<MsgInfoBody>,
    @ProtoNumber(2) val extBizInfo: ExtBizInfo?,
)

@Serializable
data class MsgInfoBody(
    @ProtoNumber(1) val index: IndexNode? = null,
    @ProtoNumber(2) val picture: PictureInfo? = null,
    @ProtoNumber(3) val video: VideoInfo? = null,
    @ProtoNumber(4) val audio: AudioInfo? = null,
    @ProtoNumber(5) val fileExist: Boolean? = null,
    @ProtoNumber(6) val hashSum: ByteArray? = null,
)

@Serializable
class VideoInfo

@Serializable
class AudioInfo

@Serializable
data class PictureInfo(
    @ProtoNumber(1) val urlPath: String,
    @ProtoNumber(2) val ext: PicUrlExtInfo? = null,
    @ProtoNumber(3) val domain: String? = null
)

@Serializable
data class PicUrlExtInfo(
    @ProtoNumber(1) val originalParameter: String? = null,
    @ProtoNumber(2) val bigParameter: String? = null,
    @ProtoNumber(3) val thumbParameter: String? = null
)

@Serializable
data class DeleteReq(
    @ProtoNumber(1) val index: List<IndexNode>,
    @ProtoNumber(2) val needRecallMsg: Boolean? = null,
    @ProtoNumber(3) val msgSeq: ULong? = null,
    @ProtoNumber(4) val msgRandom: ULong? = null,
    @ProtoNumber(5) val msgTime: ULong? = null,
)

@Serializable
data class DownloadRkeyReq(
    @ProtoNumber(1) val types: List<Int>,
    @ProtoNumber(2) val downloadType: Int
)

@Serializable
data class UploadReq(
    @ProtoNumber(1) val uploadInfo: List<UploadInfo>,
    @ProtoNumber(2) val tryFastUploadCompleted: Boolean? = null,
    @ProtoNumber(3) val srvSendMsg: Boolean? = null,
    @ProtoNumber(4) val clientRandomId: ULong = ULong.MIN_VALUE,
    @ProtoNumber(5) val compatQMsgSceneType: UInt? = null,
    @ProtoNumber(6) val extBizInfo: ExtBizInfo? = null,
    @ProtoNumber(7) val clientSeq: UInt? = null,
    @ProtoNumber(8) val noNeedCompatMsg: Boolean? = null,
)

@Serializable
data class ExtBizInfo(
    @ProtoNumber(1) val pic: PicExtBizInfo? = null,
    @ProtoNumber(2) val video: VideoExtBizInfo? = null,
    @ProtoNumber(3) val ptt: PttExtBizInfo? = null,
    @ProtoNumber(10) val busiType: UInt?,
)

@Serializable
data class PttExtBizInfo(
    @ProtoNumber(1) val srcUin: ULong,


List_AddText(draw_list, cx, my - offy - h + math.floor(0.5 + h/2 - th/2), T.H_CURSOR , note_text)
    cx = cx + tw + px

    for i=1, sac.chan_count do
        local cox = 0
        if sac.chan_count > 1 then
            if sac.chan_count == 2 then
                ImGui.DrawList_AddText(draw_list, cx, my - offy - h + py + (i-1) * (th + py), (i==1) and T.SLICE_CURVE_L or T.SLICE_CURVE_R , (i==1) and "L" or "R")
            end

            cox = chan_num_w + px
        end
        ImGui.DrawList_AddText(draw_list, cx + cox, my - offy - h + py + (i-1) * (th + py), T.H_CURSOR , db_texts[i])
    end
end

function SpectrographWidget:drawLRMix(ctx)
    self.lr_mix_widget:draw(ctx)
end

function SpectrographWidget:endOfDraw(ctx)
    self.canvas_changed = false
    self.canvas_pos_changed = false
    self.canvas_size_changed = false
end

return SpectrographWidget


//===-- condition_variable.h ------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef SCUDO_CONDITION_VARIABLE_H_
#define SCUDO_CONDITION_VARIABLE_H_

#include "condition_variable_base.h"

#include "common.h"
#include "platform.h"

#include "condition_variable_linux.h"

namespace scudo {

// A default implementation of default condition variable. It doesn't do a real
// `wait`, instead it spins a short amount of time only.
class ConditionVariableDummy
    : public ConditionVariableBase<ConditionVariableDummy> {
public:
  void notifyAllImpl(UNUSED HybridMutex &M) REQUIRES(M) {}

  void waitImpl(UNUSED HybridMutex &M) REQUIRES(M) {
    M.unlock();

    constexpr u32 SpinTimes = 64;
    volatile u32 V = 0;
    for (u32 I = 0; I < SpinTimes; ++I) {
      u32 Tmp = V + 1;
      V = Tmp;
    }

    M.lock();
  }
};

} // namespace scudo

#endif // SCUDO_CONDITION_VARIABLE_H_


#region Apache License
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to you under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion

#define TRACE

using log4net.Layout;
using log4net.Core;

namespace log4net.Appender
{
	///
	/// Appends log events to the <see cref="System.Diagnostics.Trace"/> system.
	///
	/// <remarks>
	/// <para>
	/// The application configuration file can be used to control what listeners
	/// are actually used. See the MSDN documentation for the
	/// <see cref="System.Diagnostics.Trace"/> class for details on configuring the
	/// trace system.
	/// </para>
	/// <para>
	/// Events are written using the <c>System.Diagnostics.Trace.Write(string,string)</c>
	/// method. The event's logger name is the default value for the category parameter
    /// of the Write method.
	/// </para>
	/// <para>
	/// Compact Framework

	/// The Compact Framework does not support the <see cref="System.Diagnostics.Trace"/>
	/// class for any operation except <c>Assert</c>. When using the Compact Framework this
	/// appender will write to the <see cref="System.Diagnostics.Debug"/> system rather than
	/// the Trace system. This appender will therefore behave like the <see cref="DebugAppender"/>.
	/// </para>
	/// </remarks>
	/// <author>Douglas de la Torre</author>
	/// <author>Nicko Cadell</author>
	/// <author>Gert Driesen</author>
    /// <author>Ron Grabowski</author>
	public class TraceAppender : AppenderSkeleton
	{
		#region Public Instance Constructors

		///
		/// Initializes a new instance of the <see cref="TraceAppender" />.
		///
		/// <remarks>
		/// <para>
		/// Default constructor.
		/// </para>
		/// </remarks>
		public TraceAppender()
		{
		}

		///
		/// Initializes a new instance of the <see cref="TraceAppender" />
		/// with a specified layout.
		///
		/// <param name="layout">The layout to use with this appender.</param>
		/// <remarks>
		/// <para>
		/// Obsolete constructor.
		/// </para>
		/// </remarks>
		[System.Obsolete("Instead use the default constructor and set the Layout property")]
		public TraceAppender(ILayout layout)
		{
			Layout = layout;
		}

		#endregion Public Instance Constructors

		#region Public Instance Properties

		///
		/// Gets or sets a value that indicates whether the appender will
		/// flush at the end of each write.
		///
		/// <remarks>
		/// <para>The default behavior is to flush at the end of each
		/// write. If the option is set to<c>false</c>, then the underlying
		/// stream can defer writing to physical medium to a later time.
		/// </para>
		/// <para>
		/// Avoiding the flush operation at the end of each append results
		/// in a performance gain of 10 to 20 percent. However, there is safety
		/// trade-off involved in skipping flushing. Indeed, when flushing is
		/// skipped


Sender().closeAllWindows();
					tStage = 0;
				}
			}, 1);
		}
	}

	public void fade(final int x, final int y, final int height) {
		if (System.currentTimeMillis() - lastAction > 5000) {
			lastAction = System.currentTimeMillis();
			resetWalkingQueue();
			CycleEventHandler.getSingleton().addEvent(this, new CycleEvent() {
				int tStage = 6;
				public void execute(CycleEventContainer container) {
					if (tStage == 6) {
						getPacketSender().showInterface(18460);
					}
					if (tStage == 5) {
						getPlayerAssistant().movePlayer(x, y, height);
						updateRequired = true;
						appearanceUpdateRequired = true;
					}
					if (tStage == 4) {
						getPacketSender().showInterface(18452);
					}
					if (tStage == 1) {
						container.stop();
						return;
					}
					if (tStage > 0) {
						tStage--;
					}
				}
				public void stop() {
					getPacketSender().closeAllWindows();
					tStage = 0;
				}
			}, 1);
		}
	}

	/**
	 * The option the player clicked
	 */

	private int optionClicked = -1;

	/**
	 * @return the option clicked
	 */

	public int getOptionClicked() {
		return optionClicked;
	}

	/**
	 * Sets the option clicked
	 *
	 * @param i
	 *            the option clicked
	 */

	public void setOptionClicked(int i) {
		optionClicked = i;
	}

	public String statedInterface = "";

	public String getStatedInterface() {
		return statedInterface;
	}

	public void setStatedInterface(String statedInterface) {
		this.statedInterface = statedInterface;
	}

	public String slayerMaster;

	public boolean lostCannon, refresh, isBot;

	public int CannonSetupStage;

	public ArrayList<String> killedPlayers = new ArrayList<String>();
	public ArrayList<Integer> attackedPlayers = new ArrayList<Integer>();
	public ArrayList<String> lastKilledPlayers = new ArrayList<String>();

	public int[][] barrowCrypt = {
			{4921, 0},
			{2035, 0}
	};

	public long homeTele, lastDesert, lastButton, lastFire, lastLight, muteTime, waitTime, miscTimer,
			webSlashDelay, climbDelay, lastReport = 0,
			lastPlayerMove, lastPoison, lastPoisonSip, poisonImmune, lastSpear,
			lastProtItem, dfsDelay, lastYell, teleGrabDelay,
			protMageDelay, protMeleeDelay, protRangeDelay, lastAction,
			lastThieve, lastLockPick, alchDelay, specDelay = System.currentTimeMillis(), duelDelay, teleBlockDelay,
			godSpellDelay, singleCombatDelay, singleCombatDelay2, reduceStat,
			restoreStatsDelay, logoutDelay, buryDelay, foodDelay, potDelay,
			doorDelay, doubleDoorDelay, buySlayerTimer, lastIncrease,
			boneDelay, leverDelay = 0, searchObjectDelay = 0, clickDelay = 0;

	public boolean hideYell;

	private Npc specialTarget = null;

	public void setSpecialTarget(Npc target) {
		this.specialTarget = target;
	}

	public Npc getSpecialTarget() {
		return specialTarget;
	}

	public int miningAxe = -1, woodcuttingAxe = -1;

	public boolean initialized, musicOn = true, soundOn = true, luthas,
			playerIsCooking, disconnected, ruleAgreeButton,
			rebuildNPCList, isActive, isKicked,
			isSkulled, friendUpdate, newPlayer,
			hasMultiSign, saveCharacter, mouseButton,
			chatEf


（八）对物业共用部位、共用设施设备使用情况享有知情权和监督权；

（九）监督专项维修资金的管理和使用；

（十）法律、法规规定的其他权利。

第四十七条 业主在物业管理活动中，履行下列义务：

（一）遵守管理规约、临时管理规约、业主大会议事规则；

（二）遵守物业服务区域内物业共用部位、共用设施设备的使用、公共秩序和环境卫生的维护等方面的规章制度；

（三）执行业主大会的决定和业主大会授权业主委员会作出的决定；

（四）按照国家有关规定交纳专项维修资金；

（五）按时交纳物业服务费；

（六）法律、法规规定的其他义务。

第四十八条 管理规约、临时管理规约应当对物业的使用、管理、业主公共利益、业主的权利义务、物业服务费的收交方式、违反规定应当承担的责任等事项作出规定。

管理规约、临时管理规约对全体业主及物业使用人具有约束力。对拒不交纳物业服务费的业主，由业主委员会督促其交纳，并可以在物业服务区域内的显著位置予以公示。

第四十九条 提倡业主委员会直接向业主收取物业服务费，并按照合同约定将物业服务费支付给物业服务人；业主委员会直接向业主收取物业服务费的，物业服务人应当予以协助。

建设单位、物业服务人等利用业主的共有部分产生的收入，在扣除合理成本之后产生的收益，属于业主共有。共有部分收益的分配，由业主大会决定。

第五十条 业主委员会应当定期在物业服务区域内的显著位置书面公告专项维修资金的筹集使用及共有部分收益的账目等情况；业主委员会直接向业主收取物业服务费或者采用酬金制收费方式的，还应当将物业服务费的收支情况予以公告。

## 第五章  物业服务人

### 第一节  物业服务人

第五十一条 物业服务人可以聘请专业服务单位承担设施设备维修养护、清洁卫生、园林绿化、房屋修缮、�


.raw
	}
	return vertices_
}

func cInts(v []int) []C.int {
	x := make([]C.int, len(v))
	for i := range v {
		x[i] = C.int(v[i])
	}
	return x
}

type Point struct {
	X float32
	Y float32
}

type Polyline []Point

func (p Polyline) vertices() []C.float {
	v := make([]C.float, 0, len(p)*2)
	for _, point := range p {
		v = append(v, C.float(point.X), C.float(point.Y))
	}
	return v
}

type Vertex struct {
	X, Y, Z float32
	Color   allegro.Color
	U, V    float32

	raw    C.ALLEGRO_VERTEX
	inited bool
}

func (v Vertex) init() {
	if v.inited {
		return
	}
	v.raw.x = C.float(v.X)
	v.raw.y = C.float(v.Y)
	v.raw.z = C.float(v.Z)
	v.raw.color = *((*C.ALLEGRO_COLOR)(unsafe.Pointer(&v.Color)))
	v.raw.u = C.float(v.U)
	v.raw.v = C.float(v.V)
	v.inited = true
}

type VertexElement struct {
	Attribute PrimAttr
	Storage   PrimStorage
	Offset    int

	raw    C.ALLEGRO_VERTEX_ELEMENT
	inited bool
}

func (v VertexElement) init() {
	if v.inited {
		return
	}
	v.raw.attribute = C.int(v.Attribute)
	v.raw.storage = C.int(v.Storage)
	v.raw.offset = C.int(v.Offset)
	v.inited = true
}

type VertexDecl C.ALLEGRO_VERTEX_DECL

type PrimType int

const (
	PRIM_POINT_LIST     PrimType = C.ALLEGRO_PRIM_POINT_LIST
	PRIM_LINE_LIST               = C.ALLEGRO_PRIM_LINE_LIST
	PRIM_LINE_STRIP              = C.ALLEGRO_PRIM_LINE_STRIP
	PRIM_LINE_LOOP               = C.ALLEGRO_PRIM_LINE_LOOP
	PRIM_TRIANGLE_LIST           = C.ALLEGRO_PRIM_TRIANGLE_LIST
	PRIM_TRIANGLE_STRIP          = C.ALLEGRO_PRIM_TRIANGLE_STRIP
	PRIM_TRIANGLE_FAN            = C.ALLEGRO_PRIM_TRIANGLE_FAN
)

type PrimAttr int

const (
	PRIM_POSITION        PrimAttr = C.ALLEGRO_PRIM_POSITION
	PRIM_COLOR_ATTR               = C.ALLEGRO_PRIM_COLOR_ATTR
	PRIM_TEX_COORD                = C.ALLEGRO_PRIM_TEX_COORD
	PRIM_TEX_COORD_PIXEL          = C.ALLEGRO_PRIM_TEX_COORD_PIXEL
)

type PrimStorage int

const (
	PRIM_FLOAT_2 PrimStorage = C.ALLEGRO_PRIM_FLOAT_2
	PRIM_FLOAT_3             = C.ALLEGRO_PRIM_FLOAT_3
	PRIM_SHORT_2             = C.ALLEGRO_PRIM_SHORT_2
)

type LineJoin int

const (
	LINE_JOIN_NONE  LineJoin = C.ALLEGRO_LINE_JOIN_NONE
	LINE_JOIN_BEVEL          = C.ALLEGRO_LINE_JOIN_BEVEL
	LINE_JOIN_ROUND          = C.ALLEGRO_LINE_JOIN_ROUND
	LINE_JOIN_MITER          = C.ALLEGRO_LINE_JOIN_MITER
)

type LineCap int

const (
	LINE_CAP_NONE     LineCap = C.ALLEGRO_LINE_CAP_NONE
	L


12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z\'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E')}.avatar{position:relative;width:30px;white-space:nowrap;border-radius:1000px;vertical-align:bottom}.avatar i{position:absolute;left:-7px;bottom:2px;width:8px;height:8px;border-radius:100%}.avatar span.text-circle{text-align:center;vertical-align:middle;color:#FFF;font-size:1.2rem;background:#BABFC7;display:table-cell}.avatar img{width:100%;max-width:100%;height:auto;border:0;border-radius:1000px}.avatar .badge-up{top:-8px;left:-11px}.avatar-online i{background-color:#28D094}.avatar-off i{background-color:#BABFC7}.avatar-busy i{background-color:#FF4961}.avatar-away i{background-color:#FF9149}.avatar-100{width:100px}.avatar-100 span.text-circle{width:100px;height:100px}.avatar-100 i{height:20px;width:20px}.avatar-50{width:50px}.avatar-50 span.text-circle{width:50px;height:50px}.avatar-50 i{height:10px;width:10px}.avatar-lg{width:144px}.avatar-lg span.text-circle{width:144px;height:144px}.avatar-lg i{left:0;bottom:0;height:20px;width:20px}.avatar-md{width:40px}.avatar-md span.text-circle{width:40px;height:40px}.avatar-md i{left:0;bottom:0;height:10px;width:10px}.avatar-sm{width:32px}.avatar-sm span.text-circle{width:32px;height:32px}.avatar-sm i{height:8px;width:8px}.avatar-xs{width:24px}.avatar-xs span.text-circle{width:24px;height:24px}.avatar-xs i{height:7px;width:7px}.navbar-container a.nav-link-search{float:right}.navbar-container .search-input{float:right;padding-top:1.2rem;width:0}.navbar-container .search-input .input{width:0;border:none;background:0 0;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;line-height:16px}.navbar-container .search-input.open .input{width:200px;padding:5px 10px;outline:0;background:0 0;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out}.navbar-light .search-input .input,.navbar-semi-dark .search-input .input{color:#2C303B}.navbar-light .search-input .input::-webkit-input-placeholder,.navbar-semi-dark .search-input .input::-webkit-input-placeholder{color:#2C303B}.navbar-light .search-input .input:-moz-placeholder,.navbar-semi-dark .search-input .input:-moz-placeholder{color:#2C303B}.navbar-light .search-input .input::-moz-placeholder,.navbar-semi-dark .search-input .input::-moz-placeholder{color:#2C303B}.navbar-light .search-input .input:-ms-input-placeholder,.navbar-semi-dark .search-input .input:-ms-input-placeholder{color:#2C303B}.navbar-light .search-input .input::placeholder,.navbar-semi-dark .search-input .input::placeholder{color:#2C303B}


printer.println("testing1");
        printer.println("testing2");
        let actual = printer.to_string();

        assert_eq!(expected, actual);
    }

    #[test]
    fn println_left_should_indent_left_then_print() {
        let mut printer = CodeBuffer::new(4);
        printer.indent_right();
        printer.indent_right();
        printer.println_left("testing");
        let actual = printer.to_string();

        assert_eq!("    testing", actual);
    }

    #[test]
    fn println_right_should_indent_right_then_print() {
        let mut printer = CodeBuffer::new(4);
        printer.println_right("testing");
        let actual = printer.to_string();

        assert_eq!("    testing", actual);
    }
}
<reponame>lpil/pinky<filename>rp2c02-testsuite/build.rs
use std::env;
use std::path::{Path, PathBuf};
use std::fs::{self, File};
use std::io::{self, Read, Write};

fn list_files< P: AsRef< Path > >( path: P ) -> io::Result< Vec< PathBuf > > {
    let mut output = Vec::new();
    for entry_opt in try!( fs::read_dir( path.as_ref() ) ) {
        let entry = try!( entry_opt );
        let metadata = try!( fs::metadata( entry.path() ) );

        if metadata.is_dir() {
            continue;
        } else {
            output.push( entry.path() )
        }
    }

    Ok( output )
}

fn main() {
    let files = list_files( "src/tests" ).unwrap();
    let modules: Vec< _ > = files.into_iter().flat_map( |path| {
        let filename = path.file_name().unwrap().to_string_lossy();
        if filename.starts_with( "test_" ) == false {
            None
        } else {
            Some( filename[ 0..filename.len() - 3 ].to_owned() )
        }
    }).collect();

    let out_dir: PathBuf = env::var_os( "CARGO_MANIFEST_DIR" ).unwrap().into();
    let out_filename = out_dir.join( "src" ).join( "tests" ).join( "mod.rs" );
    let mut out = Vec::new();

    writeln!( out, "// This file was AUTOGENERATED; do not edit!" ).unwrap();
    writeln!( out, "" ).unwrap();

    for module_name in &modules {
        writeln!( out, "mod {};", module_name ).unwrap();
    }
    writeln!( out, "" ).unwrap();

    for module_name in &modules {
        writeln!( out, "pub use tests::{}::*;", module_name ).unwrap();
    }
    writeln!( out, "" ).unwrap();

    writeln!( out, "#[macro_export]" ).unwrap();
    writeln!( out, "macro_rules! rp2c02_testsuite {{" ).unwrap();
    writeln!( out, "    ($interface:ident) => (" ).unwrap();
    writeln!( out, "        mod rp2c02_testsuite {{" ).unwrap();

    for module_name in &modules {
        writeln!( out, "            #[test]" ).unwrap();
        writeln!( out, "            fn {}() {{", module_name ).unwrap();
        writeln!( out, "                use super::$interface;" ).unwrap();
        writeln!( out, "                let mut ppu = $interface::new();" ).unwrap();
        writeln!( out, "                $crate::tests::{}( &mut ppu );", module_name ).unwrap();
        writeln!( out, "            }}" ).unwrap();
    }

    writeln!( out, "        }}" ).unwrap();
    writeln!( out, "    )" ).unwrap();
    writeln!( out, "}}" ).unwrap();

    if let Ok( mut fp ) = File::open( &out_filename ) {
        let mut old_contents = Vec::new();
        if let Ok( _ ) = fp.read_to_end( &mut old_contents ) {
            if old_contents == out {


nsi/ginkgo"
	. "github.com/onsi/gomega"
	apiv3 "github.com/projectcalico/api/pkg/apis/projectcalico/v3"
)

var (
	// gnpExtraFields is the set of fields that should be in GlobalNetworkPolicy but not
	// NetworkPolicy.
	gnpExtraFields = From("DoNotTrack", "PreDNAT", "ApplyOnForward", "NamespaceSelector")

	// npExtraFields is the set of fields that should be in NetworkPolicy but not
	// GlobalNetworkPolicy.
	npExtraFields = From()
)

// These tests verify that the NetworkPolicySpec struct and the GlobalNetworkPolicySpec struct
// are kept in sync.
var _ = Describe("NetworkPolicySpec", func() {
	var npFieldsByName map[string]reflect.StructField
	var gnpFieldsByName map[string]reflect.StructField

	BeforeEach(func() {
		npFieldsByName = fieldsByName(apiv3.NetworkPolicySpec{})
		gnpFieldsByName = fieldsByName(apiv3.GlobalNetworkPolicySpec{})
	})

	It("and GlobalNetworkPolicySpec shared fields should have the same tags", func() {
		for n, f := range npFieldsByName {
			if gf, ok := gnpFieldsByName[n]; ok {
				Expect(f.Tag).To(Equal(gf.Tag), "Field "+n+" had different tag")
			}
		}
	})

	It("and GlobalNetworkPolicySpec shared fields should have the same types", func() {
		for n, f := range npFieldsByName {
			if gf, ok := gnpFieldsByName[n]; ok {
				Expect(f.Type).To(Equal(gf.Type), "Field "+n+" had different type")
			}
		}
	})

	It("should not have any unexpected fields that GlobalNetworkPolicySpec doesn't have", func() {
		for n := range npFieldsByName {
			if npExtraFields.Contains(n) {
				continue
			}
			Expect(gnpFieldsByName).To(HaveKey(n))
		}
	})

	It("should contain all expected fields of GlobalNetworkPolicySpec", func() {
		for n := range gnpFieldsByName {
			if gnpExtraFields.Contains(n) {
				continue
			}
			Expect(npFieldsByName).To(HaveKey(n))
		}
	})
})

func fieldsByName(example interface{}) map[string]reflect.StructField {
	fields := map[string]reflect.StructField{}
	t := reflect.TypeOf(example)
	for i := 0; i < t.NumField(); i++ {
		f := t.Field(i)
		fields[f.Name] = f
	}
	return fields
}

type empty struct{}

type set map[string]empty

func From(members ...string) set {
	s := set{}
	for _, m := range members {
		s[m] = empty{}
	}
	return s
}

func (s set) Contains(item string) bool {
	_, present := s[item]
	return present
}
// Copyright (c) 2025 Tigera, Inc. 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.
// 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 testutil

import (
	"encoding/json"
	"testing"
)

func MustMarshal(t *testing.T, v any) string {
	b, err := json.Marshal(v)
	if err != nil {
		t.Fatalf("Failed to marshal %#v: %v", v, err)
	}

	return string(b)
}

func MustUnmarshal[E any](t *testing.T, byts []byte) *E {
	e := new(E)
	if err := json.Unmarshal(byts, e); err != nil {
		t.Fatalf("Failed to umarshal %#v: %v", byts, err


etav1.ObjectMeta{
					Name:      testProxySecret,
					Namespace: testNamespace,
				},
				Data: map[string][]byte{
					"proxy": []byte(invalidPlainTextProxyURL),
				},
			})
	})

	t.Run("invalid proxy secret url - entrypoint.sh", func(t *testing.T) {
		assert.True(t, isStringValidForAG("password"))
		assert.True(t, isStringValidForAG("test~!@#^*()_-|}{[]\":;?><./pass"))

		// -[] have to be escaped in the regex
		assert.True(t, isStringValidForAG("pass-word"))
		assert.True(t, isStringValidForAG("pass[word"))
		assert.True(t, isStringValidForAG("pass]word"))
		assert.True(t, isStringValidForAG("pass$word"))

		// apostrophe
		assert.False(t, isStringValidForAG("pass'word"))
		// backtick
		assert.False(t, isStringValidForAG("pass`word"))
		// comma
		assert.False(t, isStringValidForAG("pass,word"))
		// ampersand
		assert.False(t, isStringValidForAG("pass&word"))
		// equals sign
		assert.False(t, isStringValidForAG("pass=word"))
		// plus sign
		assert.False(t, isStringValidForAG("pass+word"))
		// percent sign
		assert.False(t, isStringValidForAG("pass%word"))
		// backslash
		assert.False(t, isStringValidForAG("pass\\word"))

		// UTF-8 single character - U+1F600 grinning face
		assert.False(t, isStringValidForAG("\xF0\x9F\x98\x80"))
	})
}
package validation

import (
	"fmt"
	"strings"
	"testing"

	"github.com/Dynatrace/dynatrace-operator/pkg/api/v1alpha2/edgeconnect"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestNameTooLong(t *testing.T) {
	type testCase struct {
		name         string
		crNameLength int
		allow        bool
	}

	testCases := []testCase{
		{
			name:         "normal length",
			crNameLength: 10,
			allow:        true,
		},
		{
			name:         "max - 1 ",
			crNameLength: edgeconnect.MaxNameLength - 1,
			allow:        true,
		},
		{
			name:         "max",
			crNameLength: edgeconnect.MaxNameLength,
			allow:        true,
		},
		{
			name:         "max + 1 ",
			crNameLength: edgeconnect.MaxNameLength + 1,
			allow:        false,
		},
	}

	for _, test := range testCases {
		t.Run(test.name, func(t *testing.T) {
			ec := &edgeconnect.EdgeConnect{
				ObjectMeta: metav1.ObjectMeta{
					Name:      strings.Repeat("a", test.crNameLength),
					Namespace: testNamespace,
				},
				Spec: edgeconnect.EdgeConnectSpec{
					APIServer: "id." + allowedSuffix[0],
				},
			}
			if test.allow {
				assertAllowed(t, ec, prepareTestServiceAccount(testServiceAccountName, testNamespace))
			} else {
				errorMessage := fmt.Sprintf(errorNameTooLong, edgeconnect.MaxNameLength)
				assertDenied(t, []string{errorMessage}, ec)
			}
		})
	}
}
package dynakube

import (
	dynakubelatest "github.com/Dynatrace/dynatrace-operator/pkg/api/latest/dynakube"
	extensionslatest "github.com/Dynatrace/dynatrace-operator/pkg/api/latest/dynakube/extensions"
	ksp


es = res.regex.exec('1234');
      const reRes2 = res.regex.exec('123');

      expect(reRes && reRes[1]).to.equal('1234');

      expect(reRes2).to.be.null;
    });

    it('should create PathParamNodeRegex with prefix and postfix when passed uriSegment is matching a valid regex', () => {
      const res = <PathParamNodeRegex<BasicController<string>>>(
        makePathParamNodeRegex('model-{year:([0-9]{4})}-current.html')
      );
      expect(res.name).to.equal(
        `PathParamNodeRegex::'year'::'^([0-9]{4})$'::'model-'::'-current.html'`,
      );
    });

    it('should create PathParamNodeRegex and add $ to end of pattern and ^ to beginning', () => {
      const res = <PathParamNodeRegex<BasicController<string>>>(
        makePathParamNodeRegex('total-{price:([0-9]{2,4})}-us\\$')
      );
      const reSource = res.regex.source;
      expect(reSource.startsWith('^')).to.be.true;
      expect(reSource.endsWith('$')).to.be.true;
    });

    it('should NOT create Node if segment is NOT valid', () => {
      const res = makePathParamNodeRegex('year:([0-9]{4})');
      expect(res).to.be.null;
    });

    it('should NOT create Node if segment is a valid but regex part of segment is NOT valid', () => {
      try {
        makePathParamNodeRegex('{year:[0-9]{4})}');
        throw new Error(
          'makePathParamNodeRegex expected to throw SyntaxError when invalid regex literal is passed',
        );
      } catch (e) {
        expect(e).to.be.instanceOf(SyntaxError);
      }
    });
  });

  describe('#makeNode test', () => {
    it('should create PathParamNode', () => {
      const res = <PathParamNode<BasicController<string>>>makeNode('invoice-{id}.html');
      expect(res).to.be.instanceOf(PathParamNode);

      expect(res.name).to.equal(`PathParamNode::id::'invoice-'::'.html'`);
    });

    it('should create PathParamNodeRegex', () => {
      const res = <PathParamNodeRegex<BasicController<string>>>(
        makeNode('invoice-{id:[0-9]{2,3}}.html')
      );
      expect(res).to.be.instanceOf(PathParamNodeRegex);
    });

    it('should create CatchAllNode', () => {
      const res = <CatchAllNode<BasicController<string>>>makeNode('**');
      expect(res).to.be.instanceOf(CatchAllNode);
    });

    it('should create ExactMatchNode', () => {
      const res = <ExactMatchNode<BasicController<string>>>makeNode('invoices/');
      expect(res).to.be.instanceOf(ExactMatchNode);
    });
  });
});
import { findLastIndex } from "../../services/find-last-index.service";

import { resolveLine } from "./resolve-line.logic";
import { polywag } from "./poly-wag.logic";

import { Point } from "../../models/Point.model";
import { Line } from "../../models/Line.model";
import { Polygon } from "../../models/Polygon.model";

import { IJourney } from "../../interfaces/IJourney.interface";
import { ILineOutOfView } from "../../interfaces/ILineOutOfView.interface";
import { ILineInView } from "../../interfaces/ILineInView.interface";
import { ILineStartInView } from "../../interfaces/ILineStartInView.interface";
import { ILineNoneInView } from "../../interfaces/ILineNoneInView.interface";
import { IIntersect } from "../../interfaces/IIntersect.interface";
import { getDimensions } from "../../services/get-dimensions.service";


 by default
      imported: {
        visibility: 0,
        depth: 0
      },
      inherited: {
        visibility: 0,
        depth: 0
      },
      aliasResolver: void 0
    };
    function resolveVisibility(opts) {
      var _a, _b;
      return {
        visibility: (_a = opts.visibility) !== null && _a !== void 0 ? _a : 0,
        depth: (_b = opts.depth) !== null && _b !== void 0 ? _b : 1e7,
        next: opts.next
      };
    }
    exports2.resolveVisibility = resolveVisibility;
    var DEFAULT_VISIBILITY = {
      visibility: 0,
      depth: 0,
      next: void 0
    };
    function decrementVisibility(options) {
      const depth = options.depth - 1;
      if (depth < 0) {
        if (options.next)
          return resolveVisibility(options.next);
        return DEFAULT_VISIBILITY;
      }
      return { visibility: options.visibility, depth, next: options.next };
    }
    exports2.decrementVisibility = decrementVisibility;
    function fillContentOptions({ imported = DEFAULT_VISIBILITY, inherited = DEFAULT_VISIBILITY, aliasResolver = exports2.DEFAULT_ALIAS_RESOLVER, visited = void 0, specializations = void 0 } = {}) {
      const cache = visited !== null && visited !== void 0 ? visited : /* @__PURE__ */ new Set();
      const specs = specializations !== null && specializations !== void 0 ? specializations : /* @__PURE__ */ new Set();
      return {
        imported: resolveVisibility(imported),
        inherited: resolveVisibility(inherited),
        aliasResolver,
        visited: cache,
        specializations: specs
      };
    }
    exports2.fillContentOptions = fillContentOptions;
    function resolveContentInputs(node, opts) {
      const options = fillContentOptions(opts);
      let resolved = void 0;
      if (node && options.aliasResolver && node.is(ast_1.Membership))
        resolved = options.aliasResolver(node);
      else if (node.is(ast_1.Element))
        resolved = node;
      return {
        element: resolved,
        options
      };
    }
    exports2.resolveContentInputs = resolveContentInputs;
    function collectRedefinitions(feature, redefinitions) {
      const visitRedefinitions = (node) => {
        node.types(ast_1.Redefinition).forEach((t) => {
          const f = t;
          if (redefinitions.has(f))
            return;
          redefinitions.add(f);
          visitRedefinitions(f);
        });
      };
      visitRedefinitions(feature);
    }
    exports2.collectRedefinitions = collectRedefinitions;
    function streamParents(root) {
      return new langium_1.TreeStreamImpl(root, (node) => {
        const parent = node.owner();
        return parent ? [parent] : langium_1.EMPTY_STREAM;
      }, { includeRoot: true });
    }
    exports2.streamParents = streamParents;
  }
});

// ../syside-languageserver/lib/utils/scopes.js
var require_scopes = __commonJS({
  "../syside-languageserver/lib/utils/scopes.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.makeLinkingScope = exports2.makeScope = exports2.FilteredScope = exports2.ScopeStream = exports2.TypeScope = exports2.NamespaceScope = exports2.NamespaceImportScope = exports2.MembershipImportScope = exports2.ImportScope = exports2.ElementScope = exports2.EMPTY_SYSML_SCOPE = exports2.SysMLScope = void 0;
    var langium_1 = require_lib2();
    var ast_1 = require_ast2();
    var model_1 = require_model3();
    var scope_util_1 = require_scope_util();
    var common_1 = require_common();
    var SysMLScope = class