h",     "atan",
     "atanh", "isnan", "tanh",    "isfinite", "isinf", "remainder", "rsqrt",
     "cbrt",  "abs",   "pow",     "mod",      "rint"}};

static const std::set<std::string> kExternInt32CallsGPU{{"left_shift",
                                                         "right_shift",
                                                         "bitwise_or",
                                                         "bitwise_and",
                                                         "bitwise_xor",
                                                         "bitwise_not",
                                                         "pow",
                                                         "logical_right_shift",
                                                         "clz",
                                                         "popc",
                                                         "mod"}};

static const std::set<std::string> kExternFp64CallsCPU{"atan"};

static const std::set<std::string> kExternFp32CallsCPU = {
    "erf", "acos", "acosh", "asin", "asinh", "atan", "atanh", "remainder"};

void DealWithCpuIntrinsics(ir::Call *node, Expr *expr) {
  if (kExternFp32CallsCPU.count(node->name) ||
      kExternFp64CallsCPU.count(node->name)) {
    PADDLE_ENFORCE_GE(
        node->read_args.size(),
        1UL,
        ::common::errors::InvalidArgument(
            "The size of node's read args is incorrect."
            "Expected size is greater than or equal to 1, but receive %d.",
            node->read_args.size()));
    PADDLE_ENFORCE_EQ(node->read_args.front().type().is_float(),
                      true,
                      ::common::errors::InvalidArgument(
                          "CPU extern call intrinsics only support "
                          "float now! Please check."));
    if (node->read_args.front().type().is_float(32)) {
      auto out_type = node->type();
      *expr = lang::CallExtern(node->name + "f", node->read_args);
    }
    if (node->read_args.front().type().is_float(64)) {
      auto out_type = node->type();
      *expr = lang::CallExtern("cinn_host_" + node->name + "_fp64",
                               node->read_args);
    }
  }
}

void DealWithIntrinsicsImpl(common::UnknownArch, ir::Call *node, Expr *expr) {
  DealWithCpuIntrinsics(node, expr);
}

void DealWithIntrinsicsImpl(common::X86Arch, ir::Call *node, Expr *expr) {
  DealWithCpuIntrinsics(node, expr);
}

void DealWithIntrinsicsImpl(common::ARMArch, ir::Call *node, Expr *expr) {
  DealWithCpuIntrinsics(node, expr);
}
void DealWithIntrinsicsNvHygon(ir::Call *node, Expr *expr) {
  auto arg_size = node->read_args.size();
  if (arg_size == 0UL) {
    // some node like __syncthreads hasn't arguments
    return;
  }
  const auto &dtype = node->read_args.front().type();
  const auto &name = node->name;

  bool node_in_extern_fp32 = kExternFp32CallsGPU.count(name);
  bool node_in_extern_int32 = kExternInt32CallsGPU.count(name);
  if (!node_in_extern_fp32 && !node_in_extern_int32) {
    return;
  }

  std::string extern_func =
      hlir::GetExternFuncName(cinn::common::DefaultDeviceTarget(), dtype, name);
  *expr = lang:


tZeroPixel.iY = tClick.Y
        tZeroPixel:ProcessClick(tClick.Click)
    else
        tFloor[tClick.X][tClick.Y]:ProcessClick(tClick.Click)
    end
end

-- ButtonClick (служебный): метод нажатия/отпускания кнопки
--
-- Параметры:
--  tClick = {
--      Button: int,
--      Click: bool,
--  }
function ButtonClick(tClick)
    tButtons[tClick.Button]:ProcessClick(tClick.Click)
end

-- DefectPixel (служебный): метод дефектовки/раздефектовки пикселя
function DefectPixel(tDefect)
end

-- DefectButton (служебный): метод дефектовки/раздефектовки кнопки
function DefectButton(tDefect)
end


"/%3E%3Cpath d="m17.5 109c0 .828.6716 1.5 1.5 1.5s1.5-.672 1.5-1.5-.6716-1.5-1.5-1.5-1.5.672-1.5 1.5z" fill="%23fff"/%3E%3Cpath d="m19 116.5c-.8284 0-1.5-.672-1.5-1.5s.6716-1.5 1.5-1.5 1.5.672 1.5 1.5-.6716 1.5-1.5 1.5z" fill="%23fff"/%3E%3Cpath d="m11.5 115c0 .828.6716 1.5 1.5 1.5s1.5-.672 1.5-1.5-.6716-1.5-1.5-1.5-1.5.672-1.5 1.5z" fill="%23fff"/%3E%3C/svg%3E');
}

.icon--tidy-up-grid {
  background-image: url('data:image/svg+xml,%3Csvg fill="none" height="128" viewBox="0 0 32 128" width="32" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23000"%3E%3Cpath d="m10 10h2v2h-2z" fill-opacity=".8"/%3E%3Cpath d="m20 10h2v2h-2z" fill-opacity=".8"/%3E%3Cpath d="m12 15h-2v2h2z" fill-opacity=".8"/%3E%3Cpath d="m20 15h2v2h-2z" fill-opacity=".8"/%3E%3Cpath d="m12 20h-2v2h2z" fill-opacity=".8"/%3E%3Cpath d="m20 20h2v2h-2z" fill-opacity=".8"/%3E%3Cpath d="m17 10h-2v2h2z" fill-opacity=".8"/%3E%3Cpath d="m15 15h2v2h-2z" fill-opacity=".8"/%3E%3Cpath d="m17 20h-2v2h2z" fill-opacity=".8"/%3E%3Cpath d="m10 42h2v2h-2z" fill-opacity=".3"/%3E%3Cpath d="m20 42h2v2h-2z" fill-opacity=".3"/%3E%3Cpath d="m12 47h-2v2h2z" fill-opacity=".3"/%3E%3Cpath d="m20 47h2v2h-2z" fill-opacity=".3"/%3E%3Cpath d="m12 52h-2v2h2z" fill-opacity=".3"/%3E%3Cpath d="m20 52h2v2h-2z" fill-opacity=".3"/%3E%3Cpath d="m17 42h-2v2h2z" fill-opacity=".3"/%3E%3Cpath d="m15 47h2v2h-2z" fill-opacity=".3"/%3E%3Cpath d="m17 52h-2v2h2z" fill-opacity=".3"/%3E%3C/g%3E%3Cpath d="m10 74h2v2h-2z" fill="%2318a0fb"/%3E%3Cpath d="m20 74h2v2h-2z" fill="%2318a0fb"/%3E%3Cpath d="m12 79h-2v2h2z" fill="%2318a0fb"/%3E%3Cpath d="m20 79h2v2h-2z" fill="%2318a0fb"/%3E%3Cpath d="m12 84h-2v2h2z" fill="%2318a0fb"/%3E%3Cpath d="m20 84h2v2h-2z" fill="%2318a0fb"/%3E%3Cpath d="m17 74h-2v2h2


Ethereum, new EthereumChain());
        this.chainData.set(ChainNetwork.Polygon, new PolygonChain());
        this.chainData.set(ChainNetwork.Arbitrum, new ArbitumChain());
    }

    static list() : ChainNetwork[] {
      return [...Chains.singleton.chainData.keys()];
    }

    static get(network: ChainNetwork) : IChain {
      const chain = Chains.singleton.chainData.get(network);
      if (!chain) {
        throw new Error(`${network} is not a supported chain`);
      }
      return chain;
    }
    static fromId(id: number) : IChain {
      for (let [key, value] of Chains.singleton.chainData) {
        if( value.id === id )
          return value;
      }
      throw new Error(`Chain ${id} is not a supported chain`);
    }

      static getResolver(network: ChainNetwork) : Provider | Signer {
        const chain = Chains.singleton.chainData.get(network);
        if (!chain) {
          throw new Error(`${network} is not a supported chain`);
        }
        return chain.getProviderOrSigner();
      }
    }
// import {Message} from './message';

// export class Messages {

//     private data: Message[] = [
//         {date: '04.02.2019 22:14', name: 'John', phone: '(090)1212121', message: 'hello'}
//     ];
//     getData(): Message[] {
//         return this.data;
//     }

//     addData(date: string, name: string, phone: string, message: string) {
//         this.data.push(new Message(date, name, phone, message));
//     }
// }

// export class AppComponent implements OnInit {
//     items: Message[] = [];
//     constru(private messages: Messages) {}

//     addMessage(date: string, name: string, phone: string, message: string) {
//         this.messages.addData(date, name, phone, message);
//     }
//     ngOnInit() {
//         this.items = this.messages.getData();
//     }
// }/*	Driver connecting Blocks to Smart Monkeys ISAAC virtualization platform, exposing selected
	tasks and properties  and providing explicit message logging to ISAAC.

	IMPORTANT: You must specify the configuration for this driver using the Custom Options
	field in the driver's settings. This must be specified as JSON-formatted data, corresponding
	to the IsaacConfig interface below.

 	Copyright (c) 2023 PIXILAB Technologies AB, Sweden (http://pixilab.se). All Rights Reserved.
 */

import {SimpleHTTP} from "../system/SimpleHTTP";
import {callable, driver} from "../system_lib/Metadata";
import {PropertyAccessor} from "../system_lib/Script";
import {Realm} from "../system/Realm"
import {NetworkTCP} from "../system/Network";
import {Driver} from "../system_lib/Driver";

// Configuration provided as JSON through driver's Custom Options
interface IsaacConfig {
	protocol?: 'http' | 'https'; // Protocol for ISAAC connection (default is http)
	token?: string;			// If specified, passed in an isaac-token header
	heartbeatInterval?: number, // How often to send "heartbeats" to Isaac, in mS
	variables?: string[];	// Full path to properties exposed as Isaac variables
	events?: string[];		// Realm.Group.Name of tasks exposed as Isaac events
	subsystemExternalId?: string;	// ID identifying Blocks to Isaac. Defaults to "blocks".
}

type IsacLogSeverity = 'info' | 'warning' | 'error';

interface LogData {
	severity: IsacLogSeverity;	// "info", possibly others
	key: string;			// Appears in "variable (key)" column
	value: string;	 		// Appears in "Descript


ption {
		DBQuery dbq = new DBQuery(entryManager, null, null);
		dbq.setLimit(44);
		executeMarkAllRead(dbq);
		assertEquals(0, entryManager.getUnreadArticleCount());
	}

	public void testMarkAllReadWithSameNoOfRecordsAsLimit()
			throws InterruptedException {
		DBQuery dbq = new DBQuery(entryManager, null, null);
		dbq.setLimit(4);
		executeMarkAllRead(dbq);
		assertEquals(0, entryManager.getUnreadArticleCount());
	}

	public void testMarkAllReadWithLimitAscending() throws InterruptedException {
		DBQuery dbq = new DBQuery(entryManager, null, null);
		dbq.setSortOrderAscending(true);
		dbq.setLimit(1);
		executeMarkAllRead(dbq);

		assertEquals(3, entryManager.getUnreadArticleCount());
	}

	public void testMarkAllReadWithLimitDescending()
			throws InterruptedException {
		DBQuery dbq = new DBQuery(entryManager, null, null);
		dbq.setSortOrderAscending(false);
		dbq.setLimit(1);
		executeMarkAllRead(dbq);

		assertEquals(3, entryManager.getUnreadArticleCount());
	}

	private void executeMarkAllRead(DBQuery dbq) throws InterruptedException {
		final CountDownLatch latch = new CountDownLatch(1);
		entryManager.addListener(new IEntryModelUpdateListener() {

			@Override
			public void statusUpdated() {
			}

			@Override
			public void modelUpdated(String atomId) {
			}

			@Override
			public void modelUpdated() {
				latch.countDown();
			}

			@Override
			public void modelUpdateStarted(boolean fastSyncOnly) {
			}

			@Override
			public void modelUpdateFinished(ModelUpdateResult result) {
			}
		});
		entryManager.requestMarkAllAsRead(dbq);
		latch.await(3, TimeUnit.SECONDS);
	}

	public void testDateLimitSortAscendingDescending() {
		DBQuery dbq = new DBQuery(entryManager, null, null);
		dbq.setSortOrderAscending(true);
		dbq.setDateLimit(new Date(2010, 10, 16).getTime() * 1000);

		assertEquals(2, entryManager.getMarkAllReadCount(dbq));

		dbq.setSortOrderAscending(false);
		assertEquals(3, entryManager.getMarkAllReadCount(dbq));

	}

	public void testOnlyUnreadArticlesAreCounted() {
		DBQuery dbq = new DBQuery(entryManager, null, null);
		assertEquals(4, entryManager.getMarkAllReadCount(dbq));
	}

	public void testMarkAllReadIgnoresHideReadItemsPreference() {
		DBQuery dbq = new DBQuery(entryManager, null, null);

		dbq.setShouldHideReadItemsWithoutUpdatingThePreference(true);
		assertEquals(4, entryManager.getMarkAllReadCount(dbq));

		dbq.setShouldHideReadItemsWithoutUpdatingThePreference(false);
		assertEquals(4, entryManager.getMarkAllReadCount(dbq));
	}

	public void testMarkAllReadWithLabel() {
		DBQuery dbq = new DBQuery(entryManager, null, null);

		dbq.setFilterLabel("l1");
		assertEquals(1, entryManager.getMarkAllReadCount(dbq));

		dbq.setFilterLabel("l2");
		assertEquals(3, entryManager.getMarkAllReadCount(dbq));

		dbq.setFilterLabel("l3"); // non-existing
		assertEquals(0, entryManager.getMarkAllReadCount(dbq));
	}

	public void testMarkAllReadWithFeed() {
		Feed f1 = findFeedByArticleAtomId("atomid1");
		Feed f2 = findFeedByArticleAtomId("atomid2");

		DBQuery dbq = new DBQuery(entryManager, null, null);

		dbq.setFilterFeedId(f1


t_try_into_overflow::<usize>("-1");
        }
        assert_try_into_invalid::<usize>("NaN");
    }

    #[test]
    fn into_isize() {
        assert_try_into("0", 0isize);
        assert_try_into("1", 1isize);
        assert_try_into("-1", -1isize);
        if std::mem::size_of::<isize>() == 8 {
            assert_try_into("9223372036854775807", 9223372036854775807isize);
            assert_try_into("-9223372036854775808", -9223372036854775808isize);
            assert_try_into_overflow::<isize>("9223372036854775808");
            assert_try_into_overflow::<isize>("-9223372036854775809");
        } else if std::mem::size_of::<isize>() == 4 {
            assert_try_into("2147483647", 2147483647isize);
            assert_try_into("-2147483648", -2147483648isize);
            assert_try_into_overflow::<isize>("2147483648");
            assert_try_into_overflow::<isize>("-2147483649");
        }
        assert_try_into_invalid::<isize>("NaN");
    }

    #[allow(clippy::excessive_precision)]
    #[test]
    fn into_f32() {
        assert_try_into("0", 0f32);
        assert_try_into("1", 1f32);
        assert_try_into("0.000001", 0.000001f32);
        assert_try_into("0.0000001", 0.0000001f32);
        assert_try_into("0.555555", 0.555555f32);
        assert_try_into("0.55555599", 0.555556f32);
        assert_try_into("0.999999", 0.999999f32);
        assert_try_into("0.99999999", 1.0f32);
        assert_try_into("1.00001", 1.00001f32);
        assert_try_into("1.00000001", 1.0f32);
        assert_try_into("1.23456789e10", 1.23456789e10f32);
        assert_try_into("1.23456789e-10", 1.23456789e-10f32);
        assert_try_into("3.40282347e+38", std::f32::MAX);
        assert_try_into("-3.40282347e+38", std::f32::MIN);
        assert_try_into_overflow::<f32>("1e39");
        assert_try_into("1.17549435e-38", std::f32::MIN_POSITIVE);
        assert!(try_into::<&str, f32>("NaN").is_nan());
    }

    #[test]
    fn into_f64() {
        assert_try_into("0", 0f64);
        assert_try_into("1", 1f64);
        assert_try_into("0.000000000000001", 0.000000000000001f64);
        assert_try_into("0.555555555555555", 0.555555555555555f64);
        assert_try_into("0.55555555555555599", 0.555555555555556f64);
        assert_try_into("0.999999999999999", 0.999999999999999f64);
        assert_try_into("0.99999999999999999", 1.0f64);
        assert_try_into("1.00000000000001", 1.00000000000001f64);
        assert_try_into("1.0000000000000001", 1.0f64);
        assert_try_into("1.7976931348623157e+308", std::f64::MAX);
        assert_try_into("-1.7976931348623157e+308", std::f64::MIN);
        assert_try_into("1e309


.08-2.176a.5.5 0 01.738-.408c2.176 1.182 4.243 1.061 5.825-.061a.5.5 0 01.745.203Zm-19.392 5.196c.076.743.743 1.297 1.516 1.543.808.256 1.855.235 2.967-.247a3.794 3.794 0 002.132-2.295c.29-.868.25-1.82-.152-2.425a.5.5 0 00-.843.016c-1.294 2.111-3.144 3.04-5.075 2.86a.5.5 0 00-.545.548Z" clip-rule="evenodd"/></svg>';
  static const String sleepy_outline =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"><g fill="currentColor"><path d="M24 6C14.059 6 6 14.059 6 24c0 9.94 8.059 18 18 18s18-8.06 18-18c0-1.799-.264-3.535-.755-5.174l-1.916.575c.437 1.457.671 3 .671 4.599 0 8.836-7.163 16-16 16S8 32.836 8 24c0-8.837 7.163-16 16-16V6Z"/><path d="M18.164 15.317a1 1 0 01.366-1.366l2.669-1.54a1 1 0 011.492.985l-.451 3.75 1.27-.733a1 1 0 111 1.732l-3.003 1.734a1 1 0 01-1.492-.986l.451-3.75-.936.54a1 1 0 01-1.366-.366Zm8.36-7.247a1 1 0 10.518 1.93l1.932-.517-2.049 5.104a1 1 0 001.187 1.339l4.347-1.165a1 1 0 10-.518-1.932l-2.415.647 2.049-5.104a1 1 0 00-1.187-1.338l-3.864 1.035ZM35.556 7a1 1 0 011-1H41a1 1 0 01.848 1.53L37.804 14H41a1 1 0 110 2h-5a1 1 0 01-.848-1.53L39.196 8h-2.64a1 1 0 01-1-1ZM14.404 28.648c-.773-.245-1.44-.8-1.516-1.543a.5.5 0 01.545-.548c1.93.181 3.781-.748 5.075-2.86a.5.5 0 01.843-.015c.402.605.442 1.557.152 2.425a3.794 3.794 0 01-2.132 2.295c-1.112.481-2.16.503-2.967.246Zm17.336-4.645c.546-.599.846-1.412.54-2.094a.5.5 0 00-.745-.203c-1.582 1.123-3.65 1.244-5.825.062a.5.5 0 00-.738.408c-.045.725.396 1.569 1.08 2.176a3.794 3.794 0 002.995.922c1.203-.14 2.121-.644 2.692-1.27Z"/><path fill-rule="evenodd" d="M32.448 31.855c-2.251-3.085-5.587-4.715-8.707-3.879-3.12.836-5.194 3.916-5.601 7.713-.115 1.069.923 1.823 1.961 1.545l11.42-3.06


5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
    4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
  };

  private static String CODEC = "BitVector";

  // Version before version tracking was added:
  private final static int VERSION_PRE = -1;

  // First version:
  private final static int VERSION_START = 0;

  // Increment version to change it:
  private final static int VERSION_CURRENT = VERSION_START;

  /** Writes this vector to the file name in Directory
    d, in a format that can be read by the constructor {@link
    #BitVector(Directory, String)}.  */
  public final void write(Directory d, String name) throws IOException {
    IndexOutput output = d.createOutput(name);
    try {
      output.writeInt(-2);
      CodecUtil.writeHeader(output, CODEC, VERSION_CURRENT);
      if (isSparse()) {
        writeDgaps(output); // sparse bit-set more efficiently saved as d-gaps.
      } else {
        writeBits(output);
      }
    } finally {
      output.close();
    }
  }

  /** Write as a bit set */
  private void writeBits(IndexOutput output) throws IOException {
    output.writeInt(size());        // write size
    output.writeInt(count());       // write count
    output.writeBytes(bits, bits.length);
  }

  /** Write as a d-gaps list */
  private void writeDgaps(IndexOutput output) throws IOException {
    output.writeInt(-1);            // mark using d-gaps
    output.writeInt(size());        // write size
    output.writeInt(count());       // write count
    int last=0;
    int n = count();
    int m = bits.length;
    for (int i=0; i<m && n>0; i++) {
      if (bits[i]!=0) {
        output.writeVInt(i-last);
        output.writeByte(bits[i]);
        last = i;
        n -= BYTE_COUNTS[bits[i] & 0xFF];
      }
    }
  }

  /** Indicates if the bit vector is sparse and should be saved as a d-gaps list, or dense, and should be saved as a bit set. */
  private boolean isSparse() {

    final int setCount = count();
    if (setCount == 0) {
      return true;
    }

    final int avgGapLength = bits.length / setCount;

    // expected number of bytes for vInt encoding of each gap
    final int expectedDGapBytes;
    if (avgGapLength <= (1<< 7)) {
      expectedDGapBytes = 1;
    } else if (avgGapLength <= (1<<14)) {
      expectedDGapBytes = 2;
    } else if (avgGapLength <= (1<<21)) {
      expectedDGapBytes = 3;
    } else if (avgGapLength <= (1<<28)) {
      expectedDGapBytes = 4;
    } else {
      expectedDGapBytes = 5;
    }

    // +1 because we write the byte itself that contains the
    // set bit
    final int bytesPerSetBit = expectedDGapBytes + 1;

    // note: adding 32 because we start with ((int) -1) to indicate d-gaps format.
    final long expectedBits = 32 + 8 * bytesPerSetBit * count();

    // note: factor is for read/write of byte-arrays being faster than vints.
    final long factor = 10;
    return factor * expectedBits < size();
  }

  /** Constructs a bit vector from the file name in Directory
    d, as written by the {@link #write} method.
    */
  public BitVector(Directory d, String name) throws IOException {
    IndexInput


:#d99d0e;
background:url("/_layouts/images/bgximg.png") repeat-x -0px -730px;
}
.ms-cui-cg-yl.ms-cui-cg-s .ms-cui-tt-a:hover{
background-color:#fdf3ad !important;
border-color:#faac32;
border-top-color:#faac32;
}
.ms-cui-cg-yl.ms-cui-cg-s .ms-cui-tt-s .ms-cui-tt-a:hover{
border-color:#faac32;
background-color:#fef9d6 !important;
}
.ms-cui-ct-topBar-pp,.ms-cui-tabBody-pp{
border-color:#5129ad !important;
}
.ms-cui-cg-pp .ms-cui-cg-i{
border-color:#7f33d7;
}
.ms-cui-cg-pp .ms-cui-cg-t{
color:#ddd7e7;
background:url("/_layouts/images/bgximg.png") repeat-x -0px -707px;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-cg-i{
border-color:#5129ad;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-ct-ul{
background-color:#7f33d7;
border-color:#5129ad;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-cg-t{
color:#fff;
background-color:#7f33d7;
background-image:none;
}
.ms-cui-cg-pp .ms-cui-ct-first .ms-cui-tt-a{
border-left-color:#7f33d7;
}
.ms-cui-cg-pp .ms-cui-ct-last .ms-cui-tt-a{
border-right-color:#7f33d7;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-ct-first .ms-cui-tt-a{
border-left-color:#5129ad;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-ct-last .ms-cui-tt-a{
border-right-color:#5129ad;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-tt-s .ms-cui-tt-a{
border-left-color:#5129ad;
border-right-color:#5129ad;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-tt-a{
background-color:#ccadef;
border-color:#5129ad;
border-top-color:#9330df;
}
.ms-cui-cg-pp .ms-cui-tt-a:hover{
border-color:#6823b4;
border-top-color:#842ce4;
background:url("/_layouts/images/bgximg.png") repeat-x -0px -707px;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-tt-a:hover{
background-color:#ccadef !important;
border-top-color:#6823b4;
}
.ms-cui-cg-pp.ms-cui-cg-s .ms-cui-tt-s .ms-cui-tt-a:hover{
border-color:#5129ad;
background-color:#ede6f6 !important;
}
.ms-cui-cg-s .ms-cui-tt-s .ms-cui-tt-a{
background-color:#fff;
}
.ms-cui-ctl-largelabel,.ms-cui-ctl-mediumlabel{
color:#23272c;
}
.ms-cui-ctl-large{
overflow:hidden;
display:inline-block;
text-align:center;
vertical-align:top;
margin-left:1px;


#0
	streqb r2, [r0, #0xb74 + INIT_ENEMY_SPAWN_STATS_OFFSET]
	cmp r4, #0x258
	blt _022FC1FC
	bl ov29_022FBF30
	bl DungeonRngSetPrimary
	add sp, sp, #0x218
	ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
	.align 2, 0
_022FC230: .word DUNGEON_PTR
	arm_func_end InitEnemySpawnStats

	arm_func_start InitEnemyStatsAndMoves
InitEnemyStatsAndMoves: ; 0x022FC234
	stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
	sub sp, sp, #8
	mov sl, r0
	ldrsh r0, [sp, #0x30]
	mov sb, r1
	mov r1, #0x258
	mov r8, r2
	mov r7, r3
	ldr r6, [sp, #0x34]
	bl _s32_div_f
	mov r0, r1, lsl #0x10
	ldr r2, _022FC464 ; =DUNGEON_PTR
	mov r4, r0, asr #0x10
	ldr r1, [r2]
	mov fp, #0
#ifdef JAPAN
	add r0, r1, #0xa4
#else
	add r0, r1, #0xf4
#endif
	add r5, r0, #0x3400
	mov r3, r5
	mov r0, #0x12
	b _022FC314
_022FC284:
	mul r2, fp, r0
	ldrsh r1, [r3, r2]
	add r5, r3, r2
	cmp r1, #0
	beq _022FC31C
	cmp r1, r4
	ldreqsh r1, [r5, #2]
	cmpeq r1, r6
	bne _022FC310
	mov r1, r4
	mov r2, r6
	add r0, r5, #4
	bl GetMonsterMoves
	mov r4, #0
_022FC2BC:
	add r0, r5, r4, lsl #1
	ldrh r1, [r0, #4]
	add r0, sl, r4, lsl #3
	bl InitMoveCheckId
	add r4, r4, #1
	cmp r4, #4
	blt _022FC2BC
	ldrsh r0, [r5, #0xc]
	mov r2, #0
	strh r0, [sb]
_022FC2E4:
	add r1, r5, r2
	ldrb r0, [r1, #0xe]
	strb r0, [r8, r2]
	ldrb r0, [r1, #0x10]
	strb r0, [r7, r2]
	add r2, r2, #1
	cmp r2, #2
	blt _022FC2E4
	mov r0, #0
	strb r0, [sl, #0x20]
	b _022FC45C
_022FC310:
	add fp, fp, #1
_022FC314:
	cmp fp, #0x40
	blt _022FC284
_022FC31C:
	cmp fp, #0x40
	bne _022FC3A4
	add r0, sp, #0
	mov r1, r4
	mov r2, r6
	bl GetMonsterMoves
	mov r5, #0
	add fp, sp, #0
_022FC33C:
	mov r0, r5, lsl #1
	ldrh r1,


Result<T, T::Error>` make this possible. Their implementations always
/// return successfully, effectively "catching" the error.
///
/// For instance, if we wanted to know if a user entered an invalid `age` in the
/// form corresponding to the `Person` structure in the first example, we could
/// use the following structure:
///
/// ```rust
/// # use rocket::http::RawStr;
/// struct Person<'r> {
///     name: String,
///     age: Result<u16, &'r RawStr>
/// }
/// ```
///
/// The `Err` value in this case is `&RawStr` since `u16::from_form_value`
/// returns a `Result<u16, &RawStr>`.
///
/// # Provided Implementations
///
/// Rocket implements `FromFormValue` for many standard library types. Their
/// behavior is documented here.
///
///   *
///       * Primitive types: **f32, f64, isize, i8, i16, i32, i64, i128,
///         usize, u8, u16, u32, u64, u128**
///       * `IpAddr` and `SocketAddr` types: **IpAddr, Ipv4Addr, Ipv6Addr,
///         SocketAddrV4, SocketAddrV6, SocketAddr**
///       * `NonZero*` types: **NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64,
///         NonZeroI128, NonZeroIsize, NonZeroU8, NonZeroU16, NonZeroU32,
///         NonZeroU64, NonZeroU128, NonZeroUsize**
///
///     A value is validated successfully if the `from_str` method for the given
///     type returns successfully. Otherwise, the raw form value is returned as
///     the `Err` value.
///
///   * **bool**
///
///     A value is validated successfully as `true` if the the form value is
///     `"true"` or `"on"`, and as a `false` value if the form value is
///     `"false"`, `"off"`, or not present. In any other case, the raw form
///     value is returned in the `Err` value.
///
///   * **[`&RawStr`](RawStr)**
///
///     _This implementation always returns successfully._
///
///     The raw, undecoded string is returned directly without modification.
///
///   * **String**
///
///     URL decodes the form value. If the decode is successful, the decoded
///     string is returned. Otherwise, an `Err` with the original form value is
///     returned.
///
///   * **Option<T>** _where_ **T: FromFormValue**
///
///     _This implementation always returns successfully._
///
///     The form value is validated by `T`'s `FromFormValue` implementation. If
///     the validation succeeds, a `Some(validated_value)` is returned.
///     Otherwise, a `None` is returned.
///
///   * **Result<T, T::Error>** _where_ **T: FromFormValue**
///
///     _This implementation always returns successfully._
///
///     The from value is validated by `T`'s `FromFormvalue` implementation. The
///     returned `Result` value is returned.
///
/// # Example
///
/// This trait is generally implemented to parse and validate form values. While
/// Rocket provides parsing and validation for many of the standard library
/// types such as `u16` and `String`, you can implement `FromFormValue` for a
/// custom type to get custom validation.
///
/// Imagine you'd like to verify that some user is over some age in a form. You
/// might define a new type and implement `FromFormValue` as follows:
///
/// ```rust
/// use rocket::request::FromFormValue;
/// use rocket::http::RawStr;
///
/// struct AdultAge(usize);
///
/// impl<'v> FromFormValue<'v> for AdultAge {
///     type Error = &'v RawStr;
///
///     fn from_form_value(form_value:


te {
	if width > 0 {
		if width > 12 {
			width = 12
		}
		compo.InputWidth = width
	}
	return compo
}

func (compo *FormAttribute) SetFieldsHTML(html template.HTML) types.FormAttribute {
	compo.FieldsHTML = html
	return compo
}

func (compo *FormAttribute) SetFooter(value template.HTML) types.FormAttribute {
	compo.Footer = value
	return compo
}

func (compo *FormAttribute) SetLayout(layout form.Layout) types.FormAttribute {
	compo.Layout = layout
	return compo
}

func (compo *FormAttribute) SetPrefix(value string) types.FormAttribute {
	compo.Prefix = value
	return compo
}

func (compo *FormAttribute) SetUrl(value string) types.FormAttribute {
	compo.Url = value
	return compo
}

func (compo *FormAttribute) SetHiddenFields(fields map[string]string) types.FormAttribute {
	compo.HiddenFields = fields
	return compo
}

func (compo *FormAttribute) SetMethod(value string) types.FormAttribute {
	compo.Method = value
	return compo
}

func (compo *FormAttribute) SetTitle(value template.HTML) types.FormAttribute {
	compo.Title = value
	return compo
}

func (compo *FormAttribute) GetDefaultBoxHeader(hideBack bool) template.HTML {
	if hideBack {
		return template.HTML(fmt.Sprintf(`<h3 class="box-title">%s</h3>`, language.GetFromHtml(compo.Title)))
	}
	return template.HTML(fmt.Sprintf(`
%s

                     %s

`, language.GetFromHtml(compo.Title), compo.HiddenFields[form2.PreviousKey], language.Get("Back")))
}

func (compo *FormAttribute) GetDetailBoxHeader(editUrl, deleteUrl string) template.HTML {

	var (
		editBtn   string
		deleteBtn string
	)

	if editUrl != "" {
		editBtn = fmt.Sprintf(`

                     %s

`, editUrl, language.Get("Edit"))
	}

	if deleteUrl != "" {
		deleteBtn = fmt.Sprintf(`

                     %s

`, language.Get("Delete"))
	}

	return template.HTML(`<h3 class="box-title">`) + language.GetFromHtml(compo.Title) + template.HTML(`

				`+deleteBtn+editBtn+`

                    <a href='`+compo.HiddenFields[form2.PreviousKey]+`' class="btn btn-sm btn-default form-history-back"> `+language.Get("Back")+`

`)
}

func (compo *FormAttribute) GetBoxHeaderNoButton() template.HTML {
	return template.HTML(fmt.Sprintf(`<h3 class="box-title


    xy*x
    }
    constrained xy_x2 f32 (xy_x) {
        println!("Computing xy_x2");
        xy_x*2.0
    }
    constrained x2 f32 (x) {
        println!("Computing x2");
        x*2.0
    }
    constrained x2sin f32 (x2) {
        println!("Computing x2sin");
        x2.sin()
    }
    constrained y_ex f32 (y, ex) {
        println!("Computing yex! {}", ex);
        y
    }
    listener z_reporter (z, ex) {
        println!("z was updated to {}. Also, I hear ex was: {}", z, ex);
    }
    listener z_reporter2 (z, ex2) {
        println!("z was updated to {}. Also, I hear ex2 was: {}", z, ex2);
    }

    opgenset (y, x)
    opgenset (x)
    opgenset (y)
    opgenset (z)
    opgenset (y, z)
});

fn main() {
    println!("Initializing");
    let mut constrainer = Constrainer::new(3.0, 2.0, 7.0, "Initial y_ex", 5.0);
    println!("{:?}", constrainer);

    println!("\nSetting x & y");
    constrainer.set_x_y(2.0, 4.0, "y_ex when setting x & y");
    println!("{:?}", constrainer);

    println!("\nSetting x");
    constrainer.set_x(9.0);
    println!("{:?}", constrainer);

    println!("\nSetting y");
    constrainer.set_y(6.0, "y_ex when setting y");
    println!("{:?}", constrainer);

    println!("\nSetting z");
    constrainer.set_z(11.0, "y_ex when setting z", 99.0);
    println!("{:?}", constrainer);
}<filename>src/builtins.rs
use std::env;
use std::io::Write;
use std::path::PathBuf;
use std::str::FromStr;

use crate::{Session, SessionMode, WrashError};
use clap::{Arg, ErrorKind, SubCommand};
use directories::UserDirs;
use regex::Regex;

type BuiltinResult = Result<(), WrashError>;

/// handle_matches is designed to allow for clean and uniform argument handling.
macro_rules! handle_matches {
    ($app:ident, $argv:ident) => {
        match $app.get_matches_from_safe($argv) {
            Err(err) => match err.kind {
                ErrorKind::HelpDisplayed => {
                    println!("{}", err);

                    return Ok(());
                }
                _ => {
                    eprintln!("Error: {}", err);

                    return Err(WrashError::NonZeroExit(1));
                }
            },
            Ok(m) => m,
        }
    };
}

/// Check if a command is a builtin or not.
pub fn is_builtin(command: &str) -> bool {
    matches!(command, "exit" | "cd" | "mode" | "help" | "history")
}

/// With no clear way to distinguish between the exit builtin exiting with a
/// non-zero status code due to bad arguments or proper execution, and no clean
/// and simple way to test a call to `std::process::exit` we wrap this method
/// using `exit` by passing in an `exiter` closure.
fn inner_exit<F: FnOnce(i32)>(argv: &[String], exiter: F) -> BuiltinResult {
    let app = app_from_crate


function u(codeUnit: number) {
    return '\\u' + codeUnit.toString(16).toUpperCase();
  }

  if (codePoint <= 0xFFFF) {
    return u(codePoint);
  }
  codePoint -= 0x10000;

  // Shift right to get to most significant 10 bits
  var leadSurrogate = 0xD800 + (codePoint >> 10);

  // Mask to get least significant 10 bits
  var tailSurrogate = 0xDC00 + (codePoint & TEN_BITS);

  return u(leadSurrogate) + u(tailSurrogate);
}

function sendInfoForNewPositions() {
  socket.emit("heroCoordinates", area.hero)
  socket.emit("score", area.score)

  let npc: { bad: GameObject[], good: GameObject[], danger: GameObject[] }
  npc.good = area.NPCsGood
  npc.bad = area.NPCsBad
  npc.danger = area.NPCsDanger
  socket.emit("npc", npc)
}

function receiveInfoForHeroes() {
  socket.on("enemyCoordinates", (data: IGameObject) => {
    area.enemy.coord.x = data.coord.x
    area.enemy.coord.y = data.coord.y
    area.enemy.bombs = data.bombs
    area.enemy.explodedBombs = data.explodedBombs
  });

  socket.on("score", (data: { hero: number, enemy: number }) => { area.score = data })

  socket.on("npcCoordinates", (data: { bad: GameObject[], good: GameObject[], danger: GameObject[] }) => {
    for (let i = 0; i < 11; i++) {
      area.NPCsBad[i].coord.x = data.bad[i].coord.x;
      area.NPCsBad[i].coord.y = data.bad[i].coord.y;
      area.NPCsGood[i].coord.x = data.good[i].coord.x;
      area.NPCsGood[i].coord.y = data.good[i].coord.y;
      area.NPCsDanger[i].coord.x = data.danger[i].coord.x;
      area.NPCsDanger[i].coord.y = data.danger[i].coord.y;
    }
  });
}

function receiveInfoFromKeyboard() {
  window.addEventListener("keypress", function (event) {
    console.log(event)
    area.hero.storage.oldCoord.x = 0
    area.hero.storage.oldCoord.y = 0

  }
    //     switch(event.returnValue)
    //     {
    //       case 100: hero.storage.oldCoord.x += 9; break;
    //       case 119: hero.storage.oldCoord.y -= 9; break;
    //       case 115: hero.storage.oldCoord.y += 9; break;
    //       case 97:  hero.storage.oldCoord.x -= 9; break;
    //       case 32: {
    //                hero.plantBomb();
    //                hero.storage.oldCoord.x = hero.storage.oldCoord.x;
    //                hero.storage.oldCoord.y = hero.storage.oldCoord.y;
    //                } break;
    //     }
    //  },{once:true}
  )
}

function updateHeroesPositions() {
  area.hero.update(beFirst, false);
  area.hero.draw();
  area.enemy.draw();
  for (let i = 0; i < 11; i++) {
    area.NPCsBad[i].draw();
    area.NPCsGood[i].draw();
    area.NPCs


 r1, r2, r3, r4, r5, r6, r7}"
    );

    for i in 0..=7 {
        vm_states[1].r[i as usize] = Some(0xB0 + i);
    }

    // 2: STM <Rn>!,<registers> T1
    vm_states[2].check_memory_start = Some(stack_mem_address(0));

    // Not need to split range here, but r3 will contain the base memory address instead of this value
    for i in 0..=7 {
        vm_states[2].r[i as usize] = Some(0xB0 + i);
    }

    vm_states[2].r[3] = Some(stack_mem_address(0));

    create_vm!(
        arrays = (vms, vm_states),
        op_id = 2,
        asm_literal_add_svc = "stm r3!, {r0, r1, r2, r4, r5, r6, r7}"
    );

    // Split range to account for r3 not being in reg list
    for i in 0..=2 {
        vm_states[2].memory[i as usize] = Some(0xB0 + i);
    }
    for i in 4..=7 {
        vm_states[2].memory[(i - 1) as usize] = Some(0xB0 + i);
    }
    vm_states[2].r[3] = Some(stack_mem_address(7 * WORD_SIZE));

    run_test!(arrays = (vms, vm_states), op_ids = ops_to_test);
}

// Store and then load back register values
#[test]
pub fn test_loadstore_multi_reload() {
    println!(
        "\n>>> Load/Store multiple ops test case: Store and then load back register values \n"
    );

    // Arrays holding instances of VMs and matching state structs
    let mut vms: [NarmVM; *NUM_OPCODES] = Default::default();
    let mut vm_states: [VMState; *NUM_OPCODES] = Default::default();

    // Tell macros which op varieties are tested in this function
    let ops_to_test = vec![3];

    // VM initialization

    vm_states[3].check_memory_start = Some(stack_mem_address(0));

    // r3 and r4 will be overwritten with memory addresses
    for i in 0..=7 {
        vm_states[3].r[i as usize] = Some(0xB0 + i);
    }
    // No need to check memory in this test, if it's stored incorrectly the registers will be wrong anyway
    for i in 0..=5 {
        vm_states[3].memory[i as usize] = None;
    }

    vm_states[3].r[3] = Some(stack_mem_address(0));

    create_vm!(
        arrays = (vms, vm_states),
        op_id = 3,
        asm_literal = "
        movs r4, r3             // Save memory address (STM will increment it)
        stm r3!, {r0, r1, r2, r5, r6, r7}
        movs r3, r4             // Restore memory address
        movs r0, #0xFF
        movs r1, #0xFF
        movs r2, #0xFF
        // r3 contains the address to load from, so we can't write over it
        movs r4, #0xFF
        movs r5, #0xFF
        movs r6, #0xFF
        movs r7, #0xFF
        ldm r3!, {r0, r1, r2, r5, r6, r7}
        svc      #0xFF
        "
    );

    // Registers except for r3 and r4 should be unchanged

    vm_states[3].r


pi1Sck for A0 {
        fn set_spi1_sck_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Nss for A4 {
        fn set_spi1_nss_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Sck for A5 {
        fn set_spi1_sck_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Miso for A6 {
        fn set_spi1_miso_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Mosi for A7 {
        fn set_spi1_mosi_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Miso for A11 {
        fn set_spi1_miso_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Mosi for A12 {
        fn set_spi1_mosi_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Nss for A15 {
        fn set_spi1_nss_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Nss for B2 {
        fn set_spi1_nss_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Sck for B3 {
        fn set_spi1_sck_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Miso for B4 {
        fn set_spi1_miso_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }

    impl super::sealed::Spi1Mosi for B5 {
        fn set_spi1_mosi_af(&mut self) {
            self.pin.set_alternate_function(5);
        }
    }
}

/// Port A GPIOs
#[derive(Debug)]
#[allow(missing_docs)]
pub struct PortA {
    pub pa0: pins::A0,
    pub pa1: pins::A1,
    pub pa2: pins::A2,
    pub pa3: pins::A3,
    pub pa4: pins::A4,
    pub pa5: pins::A5,
    pub pa6: pins::A6,
    pub pa7: pins::A7,
    pub pa8: pins::A8,
    pub pa9: pins::A9,
    pub pa10: pins::A10,
    pub pa11: pins::A11,
    pub pa12: pins::A12,
    pub pa13: pins::A13,
    pub pa14: pins::A14,
    pub pa15: pins::A15,
}

impl PortA {
    /// Reset GPIO port A and split the port into individual pins.
    ///
    /// This will not enable clocks for the GPIO port.
    ///
    /// # Example
    ///
    /// Get GPIO A0.
    ///
    /// ```no_run
    /// use stm32wl_hal_iface::gpio::{pac, pins, PortA};
    ///
    /// let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
    /// let


 = readNext()) != NULL )
		paces.push_back(pace);

	closeFile();

	return paces;
}

#include <vector>
#include <string>

#include <rw/math/Random.hpp>
#include <rw/math/Math.hpp>
#include <rw/geometry/Triangle.hpp>
#include <rw/geometry/TriMesh.hpp>
#include <rw/loaders/GeometryFactory.hpp>
#include <rw/math/Vector3D.hpp>
#include <rwlibs/task/Task.hpp>
#include <rwlibs/task/loader/TaskSaver.hpp>

using namespace std;
using namespace rw::core;
using namespace rw::geometry;
using rw::loaders::GeometryFactory;
using namespace rw::math;
using namespace rwlibs::task;

std::size_t binSearchRec(const double value, std::vector<double>& surfaceArea, size_t start, size_t end){
    if(start==end)
        return start;
    // choose a int between start and end
    size_t split = (end-start)/2+start;

    if(value<surfaceArea[split])
        return binSearchRec(value, surfaceArea, start, split);
    else
        return binSearchRec(value, surfaceArea, split+1, end);
}

int main(int argc, char** argv)
{
	static const unsigned int SEED = static_cast<unsigned int>(time(NULL));
	Random::seed(SEED);
	srand(SEED);

    if( argc < 4 ){
		std::cout << "------ Usage: " << std::endl;
	    std::cout << "- Arg 1 name of stl file" << std::endl;
	    std::cout << "- Arg 2 SCUP, PG70, PG70_SMALL, SDH_BALL, SDH_PAR, SDH_CYL, GS20, GS20_WIDE\n" << std::endl;
	    std::cout << "- Arg 3 name of output xml file\n" << std::endl;
	    return 0;
	}

	std::string filename(argv[1]);
	std::string type(argv[2]);
	std::string outfile(argv[3]);
	Geometry::Ptr geo;

	try{
        geo = GeometryFactory::getGeometry(filename);
	} catch (...){
	    RW_WARN("No such file: \""<< filename << "\"");
	    return 0;
	}
	TriMesh::Ptr mesh = geo->getGeometryData()->getTriMesh();
	std::vector<double> surfaceArea(mesh->size());
	double sAreaSum = 0;
	// run through mesh and create the search
	for(size_t i=0; i<mesh->size(); i++){
	    Triangle<> tri = mesh->getTriangle(i);
	    // calculate triangle area
	    sAreaSum += tri.calcArea();
	    surfaceArea[i] = sAreaSum;
	}

	// these should be the object transformation
    Vector3D<> pos(0, 0, 0);
    Rotation3D<> rot(1, 0, 0,
                     0, 1, 0,
                     0, 0, 1);

    rwlibs::task::CartesianTask tasks;
    // first set up the configuration
    Vector3D<> d(0,0,-0.02);
    Transform3D<> wTe_n(pos, rot);
    Transform3D<> wTe_home(pos+inverse(rot)*d, rot);
    Q openQ(1,0.0);
    Q closeQ(1,1.0);
    if( type=="PG70" ){
        openQ  = Q(1, 0.034);
        closeQ = Q(1, 0.0);
    } else if( type== "PG70_SMALL"){
        openQ  = Q(1, 0.01);
        closeQ = Q(1, 0.0);
    } else if( type== "GS20"){
        openQ


.Connect:", err)
	}

	fails := []string{
		"tcp://localhost:invalid",
		"tcp://in val id:1234",
		"invalid://localhost:1234",
	}
	for _, fail := range fails {
		if err = sock.Connect(fail); err == nil {
			t.Errorf("Connect %s, expected fail, got success", fail)
		}
	}

	err = sock.Close()
	sock = nil
	if err != nil {
		t.Error("sock.Close:", err)
	}
}

func TestCtxOptions(t *testing.T) {

	type Result struct {
		value interface{}
		err   error
	}

	i, err := zmq.GetMaxSockets()
	if err != nil {
		t.Error("GetMaxSockets:", err)
	}
	if i != zmq.MaxSocketsDflt {
		t.Errorf("MaxSockets != MaxSocketsDflt: %d != %d", i, zmq.MaxSocketsDflt)
	}

	i, err = zmq.GetIoThreads()
	if err != nil {
		t.Error("GetIoThreads:", err)
	}
	if i != zmq.IoThreadsDflt {
		t.Errorf("IoThreads != IoThreadsDflt: %d != %d", i, zmq.IoThreadsDflt)
	}

	b, err := zmq.GetIpv6()
	if b != false || err != nil {
		t.Errorf("GetIpv6 1: expected false <nil>, got %v %v", b, err)
	}

	zmq.SetIpv6(true)
	defer zmq.SetIpv6(false)
	b, err = zmq.GetIpv6()
	if b != true || err != nil {
		t.Errorf("GetIpv6 2: expected true <nil>, got %v %v", b, err)
	}

	router, _ := zmq.NewSocket(zmq.ROUTER)
	b, err = router.GetIpv6()
	if b != true || err != nil {
		t.Errorf("GetIpv6 3: expected true <nil>, got %v %v", b, err)
	}
	router.Close()
}

func TestDisconnectInproc(t *testing.T) {

	var pubSocket, subSocket *zmq.Socket
	defer func() {
		for _, s := range []*zmq.Socket{pubSocket, subSocket} {
			if s != nil {
				s.SetLinger(0)
				s.Close()
			}
		}
	}()

	publicationsReceived := 0
	isSubscribed := false

	pubSocket, err := zmq.NewSocket(zmq.XPUB)
	if err != nil {
		t.Fatal("NewSocket XPUB:", err)
	}
	subSocket, err = zmq.NewSocket(zmq.SUB)
	if err != nil {
		t.Fatal("NewSocket SUB:", err)
	}
	err = subSocket.SetSubscribe("foo")
	if err != nil {
		t.Fatal("subSocket.SetSubscribe:", err)
	}

	err = pubSocket.Bind("inproc://someInProcDescriptor")
	if err != nil {
		t.Fatal("pubSocket.Bind:", err)
	}

	iteration := 0

	poller := zmq.NewPoller()
	poller.Add(subSocket, zmq.POLLIN) // read publications
	poller.Add(pubSocket, zmq.POLLIN) // read subscriptions
	for {
		sockets, err := poller.Poll(100 * time.Millisecond)
		if err != nil {
			t.Error("Poll:", err)
			break //  Interrupted
		}

		for _, socket := range sockets {
			if socket.Socket == pubSocket {
				for {
					buffer, err := pubSocket.Recv(0)
					if err != nil {
						t.Fatal("pubSocket.Recv", err)
					}
					exp := "\x01foo"
					if isSubscribed {
						exp = "\x00foo"
					}
					if buffer != exp {
						t.Errorf("pubSocket.Recv: expected %q, got %q", exp, buffe


dt,#hotels.single li .dd{height:24px;line-height:24px;}
#hotels.single .hm-list li .dt{width:60px;}
#hotels.single .hm-list li .dd{width:420px;}
/*air-tickets*/
#air-tickets .atc{padding-top:10px;}
#air-tickets .atc-l{float:left;width:364px;padding-left:10px;}
#air-tickets .atc-l .more{padding-right:20px;}
#air-tickets .atcl-query{position:relative;}
#air-tickets .dt,
#air-tickets .dd{float:left;}
#air-tickets .dt{width:63px;color:#999;}
#air-tickets .dd{width:92px;}
#air-tickets .mr{margin-right:32px;}
#air-tickets .switch{position:absolute;left:164px;top:44px;width:15px;height:43px; display: none;}
#air-tickets .switch a{display:block;width:15px;height:43px;background:url(i/onebox/2013101801.png) no-repeat;}
#air-tickets .q-type,
#air-tickets .q-item{clear:both;width:364px;height:25px;margin-bottom:10px;line-height:25px;}
#air-tickets .q-type{font:12px/24px verdana;}
#air-tickets .q-type .dd{width:150px;}
#air-tickets .q-type input,#air-tickets .q-type label{vertical-align:middle;_vertical-align:text-bottom;}
#air-tickets .q-type label{padding:0 10px 0 3px;}
@-moz-document url-prefix(){#air-tickets .q-type input,#air-tickets .q-type label{margin-top:1px;}}
#air-tickets .q-item .txt{width:86px;height:19px;padding:2px;border:1px solid #ddd;font:12px/19px verdana,'\5b8b\4f53';color:#ccc;}
#air-tickets .q-item .txt:focus{border:1px solid #ccc;color:#333;}
#air-tickets .btns{height:26px;padding:10px 0 0 63px;margin-bottom:10px;}
#air-tickets .btns a{display:inline-block;height:18px;padding:2px 10px;text-decoration:none;}
#air-tickets .text-da{display:none;height:20px;line-height:20px;}
#air-tickets .text-da a{color:#035A9D;}
#air-tickets .atc-r{float:right;width:353px;padding-left:20px;border-left:1px solid #ddd;}
#air-tickets.onebox{margin-bottom: 0;}
/*root61*/
.root61 .onebox{width:988px;}
.root61 .onebox .mc{width:968px;}
.root61 .onebox .obc-r{width:664px;}
.root61 #movie-tickets .mc{width:968px;}
.root61 #movie-tickets .mt-item li{width:152px;margin-right:20px;}
.root61 #movie-tickets li .dd{width:92px;}
.root61 #movie-tickets .mt-item-one li{width:514px;}
.root61 #movie-tickets .mt-item-one li .dd{width:454px;}
.root61 #mm-recommended{padding:0 28px;}
.root61 #medicine .mmr-list{width:572px;}
.root61 #medicine .mmr-list-info2{width:968px;}
.root61 #groupbuy .gb-list{width:968px;}
.root61 #groupbuy li{padding:0 21px;}
.root61 #groupbuy.single li{width


 from game id to game info.
    private games: Map<number, Game>;

    private playerService:PlayerService;

    constructor(ps: PlayerService) {
        super();

        // Only necessary as long as the server is sending us usernames not IDs.
        // TODO: Fix the server, decouple this shit.
        this.playerService = ps;
        this.games = new Map<number, Game>();

        // Listen to game_info messages from the server.
        ipcRenderer.on('game_info', (event:any, msg: MessageTypes.GameInfo) => {
            for (let i:number = 0; i < msg.games.length; i++) {
                this.handleServerGame(msg.games[i]);
            }

            this.emit("dirty")
        });
    }

    private handleServerGame(serverGame: ServerGame) {
        // Is this a game deletion?
        // TODO: Message type for this would be tidier...
        if (serverGame.state == "closed") {
            if (this.games.has(serverGame.uid)) {
                this.games.delete(serverGame.uid);
            }

            return;
        }

        // If this is an update, merge the objects.
        if (this.games.has(serverGame.uid)) {
            this.games.get(serverGame.uid).update(serverGame, this.playerService);
        } else {
            // It's a new game, so add it.
            // TODO: This is a server bug: we seem to not be told about the host before we get the game.
            let g:Game = new Game(serverGame, this.playerService);
            if (g.host == undefined) {
                console.error("Dropping game because host is missing: " + g.name);
                console.error(g.state);
                return;
            }

            this.games.set(serverGame.uid, g);
        }
    }

    /**
     * Sort the games according to the given sort key.
     * @param key
     */
    sort(key: SortKey) {

    }

    /**
     * Get all games of the given type (featured mod).
     * @param gameType The featured mod to filter by, or null if no filtering is desired.
     */
    getGamesOfType(gameType: string): Game[] {
        // A predicate to filter the game list by.
        let filter = ((g:Game) =>
            g.state == "open" &&
            g.featuredMod != "ladder1v1" && // Exclude ladder games from the game list
            (gameType == null || g.featuredMod == gameType));

        let ret:Game[] = [];

        this.games.forEach((value: Game, key: number) => {
            if (!filter(value)) {
                return;
            }

            ret.push(value);
        });

        console.error("Games: " + ret.length);

        return ret;
    }

    // TODO: Ewwwww.
    getNumOpenGamesOfType(gameType: string): number {
        return this.getGamesOfType(gameType).length;
    }
}
import {MessageFils} from "./message-fils";

export class Message {
  private _title: string;
  private _content: String;
  private _likes: number;
  private _datecreation: Date;
  private _UserId: string;
  private _groupId: string;
  private _username: string;
  private _comments: MessageFils [  ] ;

  constructor(title: string, content: string,username:string,
  likes: number, datecreation: Date, UserId: string, groupId: string, comments: MessageFils[]) {
    this._title = title;
    this._content = content;
    this._likes = likes;
    this._datecreation = datecreation;
    this._UserId = UserId;
    this._groupId = groupId;
    this._comments = comments;


-config=./mounted/zero_3_offload_optim_param.json
--bucket=silogen-dev
--num-epochs=2
--num-devices=$NUM_GPUS
--batch-size-per-device=32
--eval-batch-size-per-device=32
--ctx-len=1024`),

		Entry("Detects and uses shebang for Bash (K8s)",
			`#!/bin/bash
 echo "Starting"
 apt update
 apt install -y vim
 echo "Done"`, false,
			[]string{"/bin/bash", "-c", ` echo "Starting"
 apt update
 apt install -y vim
 echo "Done"`}),

		Entry("Detects and uses shebang for SH (K8s)",
			`#!/bin/sh
 echo "Starting"
 apt update
 apt install -y vim
 echo "Done"`, false,
			[]string{"/bin/sh", "-c", ` echo "Starting"
 apt update
 apt install -y vim
 echo "Done"`}),

		Entry("Removes empty lines and comments (K8s)",
			`#!/bin/bash
 # This is a comment
 apt update

 # Another comment
 apt install -y nano`, false,
			[]string{"/bin/bash", "-c", ` # This is a comment
 apt update

 # Another comment
 apt install -y nano`}),

		Entry("Handles single and double quotes correctly (K8s)",
			`sleep 1
 echo "Hello 'World'"`, false,
			[]string{"/bin/sh", "-c", `sleep 1
 echo "Hello 'World'"`}),

		Entry("Preserves environment variables (K8s)",
			`#!/bin/bash
 export VAR1="Hello"
 echo $VAR1`, false,
			[]string{"/bin/bash", "-c", ` export VAR1="Hello"
 echo $VAR1`}),
	)
})
/*
MIT License

Copyright (c) 2025 Advanced Micro Devices, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

package main

import (
	"bufio"
	"context"
	"encoding/json"
	"flag"
	"fmt"
	"io"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strconv"
	"strings"
	"time"

	"github.com/spf13/cobra"
	"golang.org/x/sync/errgroup"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	klabels "k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
)

const (
	srcEvent        = "Event"
	srcKueue        = "Kueue"
	srcRay          = "Ray"
	srcKaiwo        = "Kaiwo"
	srcNamespacePod = "N


		}

		else if (onCompleted !== undefined) {
			onCompleted(obj);
		}

		// return clone object
		return obj;
	}

	/** Gets the compare function for sorting a sequence */
	public static getCompareFunction(...sorts: Array<string | { name: string, reverse?: boolean, primer?: (object: any) => any }>) {
		// preprocess sorting options
		const compareFn = (a: any, b: any): number => a === b ? 0 : a < b ? -1 : 1;
		const sortBy = sorts.map(sort => {
			return typeof sort === "string"
				? { name: sort as string, compare: compareFn }
				: { name: sort.name, compare: (a: any, b: any) => (sort.reverse ? -1 : 1) * (sort.primer !== undefined ? compareFn(sort.primer(a), sort.primer(b)) : compareFn(a, b)) };
		});

		// final comparison function
		return (a: any, b: any) => {
			let result = 0;
			for (let index = 0; index < sortBy.length; index++) {
				const name = sortBy[index].name;
				result = sortBy[index].compare(a[name], b[name]);
				if (result !== 0) {
					break;
				}
			}
			return result;
		};
	}

	/** Gets the sort function for sorting a sequence */
	public static getSortFunction(sorts: Array<{ name: string, reverse?: boolean, primer?: (object: any) => any }>) {
		// preprocess sorting options
		const compareFn = (a: any, b: any): number => a === b ? 0 : a < b ? -1 : 1;
		const sortBy = sorts.map(sort => {
			return { name: sort.name, compare: (a: any, b: any) => (sort.reverse ? -1 : 1) * (sort.primer !== undefined ? compareFn(sort.primer(a), sort.primer(b)) : compareFn(a, b)) };
		});

		// final comparison function
		return (a: any, b: any) => {
			let result = 0;
			for (let index = 0; index < sortBy.length; index++) {
				const name = sortBy[index].name;
				result = sortBy[index].compare(a[name], b[name]);
				if (result !== 0) {
					break;
				}
			}
			return result;
		};
	}

	/**
	 * Removes an item from the sequence base on index
	 * @param sequence The sequence for processing
	 * @param index The zero-based index to remove
	*/
	public static removeAt<T>(sequence: Array<T>, index: number) {
		if (index > -1 && index < sequence.length) {
			sequence.splice(index, 1);
		}
		return sequence;
	}

	/**
	 * Inserts an item into the sequence by the specific index
	 * @param sequence The sequence for processing
	 * @param item The item to insert into the sequence
	 * @param index The zero-based index to insert
	*/
	public static insertAt<T>(sequence: Array<T>, item: T, index: number = -1) {
		if (index > -1 && index < sequence.length) {
			sequence.splice(index, 0, item);
		}
		else {
			sequence.push(item);
		}
		return sequence;
	}

	/**
	 * Moves an item of the sequence to new position
	 * @param sequence The sequence for processing
	 * @param oldIndex The zero-based index to move from
	 * @param newIndex The zero-based index to move to
	*/
	public static moveTo<T>(sequence: Array<T>, oldIndex: number, newIndex: number) {
		if (oldIndex !== newIndex && oldIndex > -1 && oldIndex < sequence.length && newIndex > -1 && newIndex < sequence.length) {
			const items = sequence.splice(oldIndex, 1);
			if (items !== undefined && items.length > 0) {
				this.insertAt(sequence, items[0], newIndex);
			}
		}
		return sequence;
	}

	/**


 USB stick for installing
- Software for creating a bootable USB [Balena Etcher](https://www.balena.io/etcher/){target=_blank} (Cross platform) or if you prefer [Rufus](https://rufus.ie/){target=_blank} (Windows only)

## Operating System

- Download an appropriate server install image [Ubuntu Downloads](https://ubuntu.com/download/server){target=_blank} with the matching architecture (ARM is available as another option).

- If you do decide to try it on a Raspberry Pi, the images can be found at [Ubuntu for Raspberry Pi](https://ubuntu.com/download/raspberry-pi){target=_blank} and the install process for ARM will need to be used.

### **Installing on a Raspberry Pi**
 - burn the image to the MicroSD
 - put it in the Pi
 - start the Pi and follow any configuration steps

### **Installing on a dedicated non-Pi machine**

- Create a bootable USB stick with the operating system
  - [Mac](https://ubuntu.com/tutorials/create-a-usb-stick-on-macos#1-overview){target=_blank}
  - [Ubuntu](https://ubuntu.com/tutorials/create-a-usb-stick-on-ubuntu#3-launch-startup-disk-creator){target=_blank}
  - [Windows](https://ubuntu.com/tutorials/create-a-usb-stick-on-windows#1-overview){target=_blank}
- Set your machine's BIOS to boot from the USB
- Boot from the USB
- Install the operating system enabling SSH [Install Step by Step](https://ubuntu.com/server/docs/install/step-by-step){target=_blank}. You won't need to install any snaps.
- The default file format is `ext4`, if you prefer `xfs` works as well
- When creating a user, this will be your admin user, once installation is complete and the server rebooted, a specific user will be created to run Besu with.
---
## **Initial OS Post-Installation Steps (both Pi and Non-Pi)**

## Upgrades
- Update and upgrade to make sure you have the latest packages (`sudo apt update && sudo apt upgrade -y && sudo reboot`)
---
## Utilities
- Install some basic utilities for networking and disk monitoring (`sudo apt install net-tools dstat jq -y`)
  - net-tools (for basic networking tools)
  - dstat (to monitor disk usage)
  - jq for nicely formatting RPC responses
---
## Networking

**This assumes a wired network connection**

In order to make life easier when accessing your node/machine from other machines in the network or via SSH, it is advisable to set up a static IP Address.
- Configure a static IP on your router for the MAC address if you are able to
  - To see your current IP address type in `ifconfig`
    - you should see something like `eth0` or `enp0s31f6` and a value next to `inet` for your IP
    - your MAC should be next to `ether`
     ```
     inet 192.168.85.6  netmask 255.255.255.0  broadcast 192.168.85.255
     inet6 fe23::7223:c2ff:fe69:81aa  prefixlen 64  scopeid 0x20<link>
     ether 50:a5:c2:6a:81:12  txqueuelen 1000  (Ethernet)
     ```
- Assign a static private IP address to your node with netplan ( see example below )
  - Edit your network configuration file (your name may differ) to create a static address for easy access (`sudo nano /etc/netplan/`) - **note** the spacing is critical. If done, and using nano press `control-o` and then after, press `enter` to save, followed by `control-x` to exit
  - see [netplan](https://netplan.io/exa


lex 布局下的垂直对齐方式，可选值为top、middle、bottom")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("-")])]),t._v(" "),a("tr",[a("td",[t._v("justify")]),t._v(" "),a("td",[t._v("flex 布局下的水平排列方式，可选值为start、end、center、space-around、space-between")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("-")])])])])},function(){var t=this,r=t.$createElement,a=t._self._c||r;return a("table",{staticClass:"bordered responsive-table"},[a("thead",[a("th",[t._v("属性")]),t._v(" "),a("th",[t._v("说明")]),t._v(" "),a("th",[t._v("类型")]),t._v(" "),a("th",[t._v("默认值")])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("xs[n]")]),t._v(" "),a("td",[t._v("栅格跨越范围 n=[1~12]")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("-")])])])])}]}}});function DateCalc(date, bef, aft){
    if(date){
        this.date = [date.substr(0,4), '-', date.substr(4,2), '-', date.substr(-2)].join('')
    }else{
        var d = new Date();
        this.date = [d.getFullYear(), '-', d.getMonth()+1, '-', d.getDate()].join('')
    }
    this.bef = bef || 0;
    this.aft = aft || 0;
    this.weekDayArr = ['Sun','Mon', 'Tues', 'Wen', 'Thur', 'Fri', 'Sat'];
    this.weekDayCNArr = ['日','一', '二', '三', '四', '五', '六'];
    this.monthArr = ['00','01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
    this.monthENArr = ['','Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}

DateCalc.prototype = {
    constructor: DateCalc,

    now: function(date){
        date && (this.date = [date.substr(0,4), '-', date.substr(4,2), '-', date.substr(-2)].join(''))
        var d = this.date ? new Date(this.date) : new Date();
        return [d.getFullYear(), this._cover(d.getMonth()+1), this._cover(d.getDate())].join('');
    },
    before: function(days){
        return this._calc(days || 1,'before');
    },
    after: function(days){
        return this._calc(days || 1,'after');
    },
    month: function(){
        var d =


"`
	Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
}

func (x *Certificate) Reset() {
	*x = Certificate{}
	if protoimpl.UnsafeEnabled {
		mi := &file_wso2_discovery_api_Certificate_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *Certificate) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Certificate) ProtoMessage() {}

func (x *Certificate) ProtoReflect() protoreflect.Message {
	mi := &file_wso2_discovery_api_Certificate_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Certificate.ProtoReflect.Descriptor instead.
func (*Certificate) Descriptor() ([]byte, []int) {
	return file_wso2_discovery_api_Certificate_proto_rawDescGZIP(), []int{0}
}

func (x *Certificate) GetAlias() string {
	if x != nil {
		return x.Alias
	}
	return ""
}

func (x *Certificate) GetContent() []byte {
	if x != nil {
		return x.Content
	}
	return nil
}

var File_wso2_discovery_api_Certificate_proto protoreflect.FileDescriptor

var file_wso2_discovery_api_Certificate_proto_rawDesc = []byte{
	0x0a, 0x24, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79,
	0x2f, 0x61, 0x70, 0x69, 0x2f, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73,
	0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x3d, 0x0a, 0x0b, 0x43, 0x65,
	0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69,
	0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12,
	0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c,
	0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x


constants,
or plain 1 and 0?

9.5
A
third-party
header file
I just started using
is defining its own <TT>TRUE</TT>
and <TT>FALSE</TT> values
incompatibly with
the code I've already developed.
What can I do?

10. C Preprocessor

10.1
I'm trying to define
a few simple little function-like macros
such as

	#define square(x) x * x

but they're not always working.

10.2
Here are
some cute preprocessor macros:

	#define begin	{
	#define end	}

With these,
I can write C code that looks more like Pascal.
What do y'all think?

10.3
How can I write a generic macro to swap two values?

10.4
What's the best way to write a multi-statement macro?

10.5
What's the difference between using a <TT>typedef</TT>
or

a <TT>#define</TT>
for a user-defined type?

10.5b
What's the difference between

	const MAXSIZE = 100;

and

	#define MAXSIZE 100

10.6
I'm splitting up a program
into multiple source files
for the first time,

and I'm wondering what to put in <TT>.c</TT> files
and what to put in <TT>.h</TT> files.
(What does ``<TT>.h</TT>''
mean,
anyway?)

10.7
Is it acceptable for one header file to <TT>#include</TT> another?

10.8a
What's the difference between
<TT>#include <></TT>
and
<TT>#include ""</TT>
?

10.8b
What are the complete rules for header file searching?

10.9
I'm getting strange
syntax errors
on the very first
declaration in
a file,
but it looks fine.

10.10
I'm using header files
which
accompany two different third-party libraries,
and they are ``helpfully'' defining
common macros such as <TT>TRUE</TT>,
<TT>FALSE</TT>,
<TT>Min()</TT>,
and <TT>Max()</TT>,

but the definitions clash with each other
and with definitions I'd

already established in my own header files.
What can I do?

10.10b
I'm #including the
right
header file for
the library function I'm using,
but the linker keeps saying it's undefined.

<a href="cpp/missinghdr.html"


径
     * @return File文件
     */
    public File downloadAsFile(final String downloadFile, final String saveFile) {
        //连接服务器
        boolean isConn = connectSFTP();
        if(!isConn){
            throw new RuntimeException("连接服务器失败！请检查连接参数是否正确");
        }
        FileOutputStream os = null;
        File file = new File(saveFile);
        try {
            if (!file.exists()) {
                File parentFile = file.getParentFile();
                if (!parentFile.exists()) {
                    parentFile.mkdirs();
                }
                file.createNewFile();
            }
            ChannelSftp channelSftp = channelSftpThreadLocal.get();
            os = new FileOutputStream(file);
            channelSftp.get(downloadFile, os);
        } catch (Exception e) {
            logger.error(e.getMessage(),e);
        } finally {
            try {
                if(os!=null){
                    os.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            disconnectSFTP();
        }
        return file;
    }

    /**
     * 下载文件-sftp协议.
     * @param downloadFile 下载的文件
     * @return 文件 byte[]
     * @throws Exception 异常
     */
    public byte[] downloadAsByte(final String downloadFile){
        //连接服务器
        boolean isConn = connectSFTP();
        if(!isConn){
            throw new RuntimeException("连接服务器失败！请检查连接参数是否正确");
        }
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        try {
            ChannelSftp channelSftp = channelSftpThreadLocal.get();
            channelSftp.get(downloadFile, os);
        } catch (Exception e) {
            logger.error(e.getMessage(),e);
        } finally {
            try {
                os.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            disconnectSFTP();
        }
        return os.toByteArray();
    }

    /**
     * 下载文件
     * @param directory 文件所在目录
     * @param downloadFile 需要下载的文件名
     * @return InputStream 文件输入流
     */
    public InputStream download(String directory, String downloadFile) {
        try {
            //连接服务器
            boolean isConn = connectSFTP();
            if(!isConn){
                throw new RuntimeException("连接服务器失败！请检查连接参数是否正确");
            }
            ChannelSftp channelSftp = channelSftpThreadLocal.get();
            channelSftp.cd(directory);
            return channelSftp.get(downloadFile);
        } catch (Exception e) {
            logger.error(e.getMessage(),e);
            return null;
        }finally{
            disconnectSFTP();
        }
    }

    public SSH2Config getConfig() {
        return config;
    }

    public void setConfig(SSH2Config config) {
        this.config = config;
    }

    /**
     * 格式化路径.()
     * @param srcPath 原路径. /xxx/xxx/xxx.yyy 或 X:/xxx/xxx/xxx.yy
     *                /mydata/app1/uploadFilesManager/gacl/test/C5C5E1A94ECF4CA72A2B3566E8215022.jpg
     * @return list, 第一个是路径（/xxx/xxx/）,第二个是文件名（xxx.yy）
     */
    private List<String> formatPath(final String srcPath) {
        List<String> list = n


layout>
	</q-modal>

`
	compUSBSettingsTemplate = `
<q-page padding>
	<ums-settings :show="ShowUmsModal" @show="ShowUmsModal=$event" v-model="currentGadgetSettings.UmsSettings" />

	<select-string-from-array :values="$store.state.StoredUSBSettingsList" v-model="showLoadModal" title="Load USB gadget settings" @load="load($event)" @delete="deleteStored($event)" with-delete></select-string-from-array>
	<select-string-from-array :values="$store.state.StoredUSBSettingsList" v-model="showDeployStoredModal" title="Deploy stored USB gadget settings" @load="deployStored($event)" @delete="deleteStored($event)" with-delete></select-string-from-array>
	<modal-string-input v-model="showStoreModal" title="Store current USB gadget Settings" @save="store($event)"></modal-string-input>

			<q-card>
				<q-card-title>
					USB Gadget Settings
				</q-card-title>

				<q-card-main>

<q-btn class="fit" :loading="deploying" color="primary" @click="ApplyGadgetSettings" label="deploy" icon="launch"></q-btn>

<q-btn class="fit" color="primary" @click="updateStoredSettingsList(); showDeployStoredModal=true" label="deploy stored" icon="settings_backup_restore"></q-btn>

<q-btn class="fit" color="secondary" @click="UpdateFromDeployedGadgetSettings" label="reset" icon="autorenew"></q-btn>

<q-btn class="fit" color="secondary" @click="showStoreModal=true" label="store" icon="cloud_upload"></q-btn>

<q-btn class="fit" color="warning" @click="updateStoredSettingsList(); showLoadModal=true" label="load stored" icon="cloud_download"></q-btn>

  				</q-card-main>

			</q-card>

		<q-card class="full-height">
			<q-alert v-show="deploying" type="warning">If you're connected via Ethernet over USB, you will loose connection during deployment (deadline exceeded error)"</q-alert>
			<q-list link>
				<q-item tag="label">
					<q-item-side>
						<q-toggle v-model="currentGadgetSettings.Enabled"></q-toggle>
					</q-item-side>
					<q-item-main>
						<q-item-tile label>Enabled</q-item-tile>
						<q-item-tile sublabel>Enable/Disable USB gadget (if enabled, at least one function has to be turned on)</q-item-tile>
					</q-item-main>
				</q-item>
				<q-item tag="label">
					<q-item-main>
						<q-item-tile label>Vendor ID</q-item-tile>
						<q-item-tile sublabel>Example: 0x1d6b</q-item-tile>
						<q-item-tile>
							<q-input v-model="currentGadgetSettings.Vid" inverted></q-input>


_CMP_RT(>=, mpfr_cmp_si, long int)
MPFR_CXX_CMP_RT(<=, mpfr_cmp_si, long int)
MPFR_CXX_CMP_RT(==, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_RT(!=, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_RT(<, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_RT(>, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_RT(>=, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_RT(<=, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_RT(==, mpfr_cmp_d, double)
MPFR_CXX_CMP_RT(!=, mpfr_cmp_d, double)
MPFR_CXX_CMP_RT(<, mpfr_cmp_d, double)
MPFR_CXX_CMP_RT(>, mpfr_cmp_d, double)
MPFR_CXX_CMP_RT(>=, mpfr_cmp_d, double)
MPFR_CXX_CMP_RT(<=, mpfr_cmp_d, double)

MPFR_CXX_CMP_TR(==, mpfr_cmp_si, int)
MPFR_CXX_CMP_TR(!=, mpfr_cmp_si, int)
MPFR_CXX_CMP_TR(<, mpfr_cmp_si, int)
MPFR_CXX_CMP_TR(>, mpfr_cmp_si, int)
MPFR_CXX_CMP_TR(>=, mpfr_cmp_si, int)
MPFR_CXX_CMP_TR(<=, mpfr_cmp_si, int)
MPFR_CXX_CMP_TR(==, mpfr_cmp_ui, unsigned int)
MPFR_CXX_CMP_TR(!=, mpfr_cmp_ui, unsigned int)
MPFR_CXX_CMP_TR(<, mpfr_cmp_ui, unsigned int)
MPFR_CXX_CMP_TR(>, mpfr_cmp_ui, unsigned int)
MPFR_CXX_CMP_TR(>=, mpfr_cmp_ui, unsigned int)
MPFR_CXX_CMP_TR(<=, mpfr_cmp_ui, unsigned int)
MPFR_CXX_CMP_TR(==, mpfr_cmp_si, long int)
MPFR_CXX_CMP_TR(!=, mpfr_cmp_si, long int)
MPFR_CXX_CMP_TR(<, mpfr_cmp_si, long int)
MPFR_CXX_CMP_TR(>, mpfr_cmp_si, long int)
MPFR_CXX_CMP_TR(>=, mpfr_cmp_si, long int)
MPFR_CXX_CMP_TR(<=, mpfr_cmp_si, long int)
MPFR_CXX_CMP_TR(==, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_TR(!=, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_TR(<, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_TR(>, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_TR(>=, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_TR(<=, mpfr_cmp_ui, unsigned long int)
MPFR_CXX_CMP_TR(==, mpfr_cmp_d, double)
MPFR_CXX_CMP_TR(!=, mpfr_cmp_d, double)
MPFR_CXX_CMP_TR(<, mpfr_cmp_d, double)
MPFR_CXX_CMP_TR(>, mpfr_cmp_d, double)
MPFR_CXX_CMP_TR(>=, mpfr_cmp_d, double)
MPFR_CXX_CMP_TR(<=, mpfr_cmp_d, double)

MPFR_CXX_UNARY(operator-, mpfr_neg)
MPFR_CXX_BINARY(operator+, mpfr_add)
MPFR_CXX_BINARY(operator-, mpfr_sub)
MPFR_CXX_BINARY(operator*, mpfr_mul)
MPFR_CXX_BINARY(operator/, mpfr_div)
MPFR_


special...
        mKeyMap.put(KEYMOD_CTRL | KEYCODE_SPACE, "\000");

        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F1, "\033[1;2P");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F2, "\033[1;2Q");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F3, "\033[1;2R");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F4, "\033[1;2S");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F5, "\033[15;2~");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F6, "\033[17;2~");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F7, "\033[18;2~");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F8, "\033[19;2~");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F9, "\033[20;2~");
        mKeyMap.put(KEYMOD_SHIFT | KEYCODE_F10, "\033[21;2~");

        mKeyCodes[KEYCODE_DPAD_CENTER] = "\015";
        mKeyCodes[KEYCODE_DPAD_UP] = "\033[A";
        mKeyCodes[KEYCODE_DPAD_DOWN] = "\033[B";
        mKeyCodes[KEYCODE_DPAD_RIGHT] = "\033[C";
        mKeyCodes[KEYCODE_DPAD_LEFT] = "\033[D";
        setFnKeys("vt100");
        mKeyCodes[KEYCODE_SYSRQ] = "\033[32~"; // Sys Request / Print
        // Is this Scroll lock? mKeyCodes[Cancel] = "\033[33~";
        mKeyCodes[KEYCODE_BREAK] = "\033[34~"; // Pause/Break

        mKeyCodes[KEYCODE_TAB] = "\011";
        mKeyCodes[KEYCODE_ENTER] = "\015";
        mKeyCodes[KEYCODE_ESCAPE] = "\033";

        mKeyCodes[KEYCODE_INSERT] = "\033[2~";
        mKeyCodes[KEYCODE_FORWARD_DEL] = "\033[3~";
        // Home/End keys are set by setFnKeys()
        mKeyCodes[KEYCODE_PAGE_UP] = "\033[5~";
        mKeyCodes[KEYCODE_PAGE_DOWN] = "\033[6~";
        mKeyCodes[KEYCODE_DEL]= "\177";
        mKeyCodes[KEYCODE_NUM_LOCK] = "\033OP";
        mKeyCodes[KEYCODE_NUMPAD_DIVIDE] = "/";
        mKeyCodes[KEYCODE_NUMPAD_MULTIPLY] = "*";
        mKeyCodes[KEYCODE_NUMPAD_SUBTRACT] = "-";
        mKeyCodes[KEYCODE_NUMPAD_ADD] = "+";
        mKeyCodes[KEYCODE_NUMPAD_ENTER] = "\015";
        mKeyCodes[KEYCODE_NUMPAD_EQUALS] = "=";
        mKeyCodes[KEYCODE_NUMPAD_COMMA] = ",";
/*
        mKeyCodes[KEYCODE_NUMPAD_DOT] = ".";
        mKeyCodes[KEYCODE_NUMPAD_0] = "0";
        mKeyCodes[KEYCODE_NUMPAD_1] = "1";
        mKeyCodes[KEYCODE_NUMPAD_2] = "2";
        mKeyCodes[KEYCODE_NUMPAD_3] = "3";
        mKeyCodes[KEYCODE_NUMPAD_4] = "4";
        mKeyCodes[KEYCODE_NUMPAD_5] = "5";
        mKeyCodes[KEYCODE_NUMPAD_6] = "6";
        mKeyCodes[KEYCODE_NUMPAD_7] = "7";
        mKeyCodes[KEYCODE_NUMPAD_8


wrpr	%r18, 0x00cb, %tstate
	.word 0x8394e08b  ! 1910: WRPR_TNPC_I	wrpr	%r19, 0x008b, %tnpc
	.word 0xfe25a1ee  ! 1913: STW_I	stw	%r31, [%r22 + 0x01ee]
	.word 0xfe3561da  ! 1914: STH_I	sth	%r31, [%r21 + 0x01da]
	.word 0xb73de001  ! 1916: SRA_I	sra 	%r23, 0x0001, %r27
	.word 0xbe3da13a  ! 1919: XNOR_I	xnor 	%r22, 0x013a, %r31
	.word 0xfe75e0f4  ! 1923: STX_I	stx	%r31, [%r23 + 0x00f4]
	ta	T_CHANGE_HPRIV
	.word 0x81982d11  ! 1933: WRHPR_HPSTATE_I	wrhpr	%r0, 0x0d11, %hpstate
	.word 0xf6250000  ! 1938: STW_R	stw	%r27, [%r20 + %r0]
	.word 0xf02dc000  ! 1941: STB_R	stb	%r24, [%r23 + %r0]
	.word 0xfc24e056  ! 1942: STW_I	stw	%r30, [%r19 + 0x0056]
	.word 0xb1504000  ! 1944: RDPR_TNPC	rdpr	%tnpc, %r24
	.word 0xb951c000  ! 1945: RDPR_TL	<illegal instruction>
	.word 0xbd51c000  ! 1946: RDPR_TL	<illegal instruction>
	.word 0xbc0ce1ac  ! 1949: AND_I	and 	%r19, 0x01ac, %r30
	.word 0xba4460f0  ! 1952: ADDC_I	addc 	%r17, 0x00f0, %r29
	.word 0xf035c000  ! 1954: STH_R	sth	%r24, [%r23 + %r0]
	.word 0xfa2d611b  ! 1959: STB_I	stb	%r29, [%r21 + 0x011b]
	.word 0xb151c000  ! 1960: RDPR_TL	<illegal instruction>
	.word 0xf6254000  ! 1965: STW_R	stw	%r27, [%r21 + %r0]
	.word 0xb551c000  ! 1966: RDPR_TL	<illegal instruction>
	.word 0xb350c000  ! 1970: RDPR_TT	<illegal instruction>
	ta	T_CHANGE_HPRIV
	mov	0x80, %g1
	mov	0x1c0, %g2
	stxa	%g2, [%g1] 0x40
	ta	T_CHANGE_NONHPRIV
	.word 0xf674619c  ! 1979: STX_I	stx	%r27, [%r17 + 0x019c]
	.word 0xfa2cc000  ! 1980: STB_R	stb	%r29, [%r19 + %r0]
	.word 0xf22d8000  ! 1983: STB_R	stb	%r25, [%r22 + %r0]
	setx	data_start_3, %g1, %r20
	ta	T_CHANGE_HPRIV
	mov	0x38, %g1
	stxa	%r17, [%g1] 0x58
	ta	T_CHANGE_NONHPRIV
	.word 0xb0a48000  ! 1989: SUBcc_R	subcc 	%r18, %r0, %r24
	.word 0xf82cc000  ! 1992: ST


LAG_DIFF_PERIODS:\\n                current_features_dict[f'diff_lag_1_period_{diff_period}_wk'] = 0.0\\n            for window in ROLLING_WINDOWS:\\n                current_features_dict[f'rolling_mean_{window}_wk'] = median_transformed_train_y_fallback\\n            for window in ROLLING_STD_WINDOWS:\\n                current_features_dict[f'rolling_std_{window}_wk'] = 0.0\\n        else:\\n            for lag in LAG_WEEKS:\\n                lag_col_name = f'lag_{lag}_wk'\\n                lag_value = current_loc_hist[-lag] if len(current_loc_hist) >= lag else median_transformed_train_y_fallback\\n                current_features_dict[lag_col_name] = lag_value\\n\\n            for diff_period in LAG_DIFF_PERIODS:\\n                diff_col_name = f'diff_lag_1_period_{diff_period}_wk'\\n                if len(current_loc_hist) >= diff_period + 1:\\n                    diff_value = current_loc_hist[-1] - current_loc_hist[-(diff_period + 1)]\\n                elif len(current_loc_hist) >= 2:\\n                    diff_value = current_loc_hist[-1] - current_loc_hist[-2]\\n                else:\\n                    diff_value = 0.0\\n                current_features_dict[diff_col_name] = diff_value\\n\\n            for window in ROLLING_WINDOWS:\\n                rolling_col_name = f'rolling_mean_{window}_wk'\\n                actual_window_size = min(window, len(current_loc_hist))\\n                rolling_mean_val = np.mean(current_loc_hist[-actual_window_size:]) if actual_window_size > 0 else median_transformed_train_y_fallback\\n                current_features_dict[rolling_col_name] = rolling_mean_val\\n\\n            for window in ROLLING_STD_WINDOWS:\\n                rolling_std_col_name = f'rolling_std_{window}_wk'\\n                actual_window_size = min(window, len(current_loc_hist))\\n                rolling_std_val = np.std(current_loc_hist[-actual_window_size:]) if actual_window_size > 1 else 0.0\\n                current_features_dict[rolling_std_col_name] = rolling_std_val\\n\\n\\n        # Create a DataFrame for the current row's features\\n        X_test_row_base = pd.DataFrame([current_features_dict])\\n\\n        # Reindex to ensure all columns from training set are present and in order.\\n        X_test_row_base = X_test_row_base.reindex(columns=X_train_model_cols, fill_value=0.0)\\n\\n        # Prepare X_test_row for LGBM (categorical Dtype)\\n        X_test_row_lgbm = X_test_row_base.copy()\\n        X_test_row_lgbm[LOCATION_COL] = X_test_row_lgbm[LOCATION_COL].astype(pd.CategoricalDtype(categories=all_location_categories_list))\\n\\n        # Prepare X_test_row for XGBoost (integer encoding), only if xgb is enabled\\n        if 'xgb' in ensemble_model_types and n_xgb_ensemble_members > 0:\\n            X_test_row_xgb = X_test_row_base.copy()\\n            X_test_row_xgb[LOCATION_COL] = X_test_row_xgb[LOCATION_COL].map(location_to_int).fillna(unknown_location_int).astype(int)\\n\\n        row_predictions_transformed = {}\\n        for q in QUANTILES:\\n            ensemble_preds_for_q = []\\n\\n            # Get predictions from LightGBM models for the current quantile\\n            if 'lg


Target: "directory-symlink-target",
					},
				},
				OutputFiles: []*remoteexecution.OutputFile{
					{
						Path: "file-executable",
						Digest: &remoteexecution.Digest{
							Hash:      "7590e1b46240ecb5ea65a80db7ee6fae",
							SizeBytes: 15,
						},
						IsExecutable: true,
					},
					{
						Path: "../foo/file-executable",
						Digest: &remoteexecution.Digest{
							Hash:      "7590e1b46240ecb5ea65a80db7ee6fae",
							SizeBytes: 15,
						},
						IsExecutable: true,
					},
					{
						Path: "file-regular",
						Digest: &remoteexecution.Digest{
							Hash:      "a58c2f2281011ca2e631b39baa1ab657",
							SizeBytes: 12,
						},
					},
					{
						Path: "../foo/file-regular",
						Digest: &remoteexecution.Digest{
							Hash:      "a58c2f2281011ca2e631b39baa1ab657",
							SizeBytes: 12,
						},
					},
					{
						Path: "path-executable",
						Digest: &remoteexecution.Digest{
							Hash:      "87729325cd08d300fb0e238a3a8da443",
							SizeBytes: 15,
						},
						IsExecutable: true,
					},
					{
						Path: "../foo/path-executable",
						Digest: &remoteexecution.Digest{
							Hash:      "87729325cd08d300fb0e238a3a8da443",
							SizeBytes: 15,
						},
						IsExecutable: true,
					},
					{
						Path: "path-regular",
						Digest: &remoteexecution.Digest{
							Hash:      "44206648b7bb2f3b0d2ed0c52ad2e269",
							SizeBytes: 12,
						},
					},
					{
						Path: "../foo/path-regular",
						Digest: &remoteexecution.Digest{
							Hash:      "44206648b7bb2f3b0d2ed0c52ad2e269",
							SizeBytes: 12,
						},
					},
				},
				OutputFileSymlinks: []*remoteexecution.OutputSymlink{
					{
						Path:   "file-symlink",
						Target: "file-symlink-target",
					},
					{
						Path:   "../foo/file-symlink",
						Target: "file-symlink-target",
					},
					{
						Path:   "path-symlink",
						Target: "path-symlink-target",
					},
					{
						Path:   "../foo/path-symlink",
						Target: "path-symlink-target",
					},
				},
			})
		})
		t.Run("Paths", func(t *testing.T) {
			testSuccess(t, &remoteexecution.Command{
				WorkingDirectory: "foo",
				OutputPaths: []string{
					"file-regular",
					"../foo/file-regular",
					"file-executable",
					"../foo/file-executable",
					"file-symlink",
					"../foo/file-symlink",
					"file-enoent",
					"../foo/file-enoent",
					"directory-directory",
					"../foo/directory-directory",
					"directory-symlink",
					"../foo/directory-symlink",
					"directory-enoent",
					"../foo/directory-enoent",
					"path-directory",
					"../foo/path-directory",
					"path-regular",
					"../foo/path-regular",
					"path-executable",
					"../foo/path-executable",
					"path-symlink",
					"../foo/path-symlink",
					"path-enoent",
					"../foo/path-enoent",
				},
			}, remoteexecution.ActionResult{
				OutputDirectories: []*remoteexecution.OutputDirectory{


SE9_MIN, X30_HOUSE10_MIN, X30_HOUSE11_MIN, X30_HOUSE12_MIN};
  static final double[] maxLonX30 = new double[]
      {X30_ASC_MAX,    X30_MC_MAX,      X30_ARMC_MAX,    X30_VERTEX_MAX,
       X30_EQUASC_MAX, X30_COASC1_MAX,  X30_COASC2_MAX,  X30_POLASC_MAX,
       X30_HOUSE1_MAX, X30_HOUSE2_MAX,  X30_HOUSE3_MAX,  X30_HOUSE4_MAX,
       X30_HOUSE5_MAX, X30_HOUSE6_MAX,  X30_HOUSE7_MAX,  X30_HOUSE8_MAX,
       X30_HOUSE9_MAX, X30_HOUSE10_MAX, X30_HOUSE11_MAX, X30_HOUSE12_MAX};
  static final double[] minLonX40 = new double[]
      {X40_ASC_MIN,    X40_MC_MIN,      X40_ARMC_MIN,    X40_VERTEX_MIN,
       X40_EQUASC_MIN, X40_COASC1_MIN,  X40_COASC2_MIN,  X40_POLASC_MIN,
       X40_HOUSE1_MIN, X40_HOUSE2_MIN,  X40_HOUSE3_MIN,  X40_HOUSE4_MIN,
       X40_HOUSE5_MIN, X40_HOUSE6_MIN,  X40_HOUSE7_MIN,  X40_HOUSE8_MIN,
       X40_HOUSE9_MIN, X40_HOUSE10_MIN, X40_HOUSE11_MIN, X40_HOUSE12_MIN};
  static final double[] maxLonX40 = new double[]
      {X40_ASC_MAX,    X40_MC_MAX,      X40_ARMC_MAX,    X40_VERTEX_MAX,
       X40_EQUASC_MAX, X40_COASC1_MAX,  X40_COASC2_MAX,  X40_POLASC_MAX,
       X40_HOUSE1_MAX, X40_HOUSE2_MAX,  X40_HOUSE3_MAX,  X40_HOUSE4_MAX,
       X40_HOUSE5_MAX, X40_HOUSE6_MAX,  X40_HOUSE7_MAX,  X40_HOUSE8_MAX,
       X40_HOUSE9_MAX, X40_HOUSE10_MAX, X40_HOUSE11_MAX, X40_HOUSE12_MAX};
  static final double[] minLonX50 = new double[]
      {X50_ASC_MIN,    X50_MC_MIN,      X50_ARMC_MIN,    X50_VERTEX_MIN,
       X50_EQUASC_MIN, X50_COASC1_MIN,  X50_COASC2_MIN,  X50_POLASC_MIN,
       X50_HOUSE1_MIN, X50_HOUSE2_MIN,  X50_HOUSE3_MIN,  X50_HOUSE4_MIN,
       X50_HOUSE5_MIN, X50_HOUSE6_MIN,  X50_HOUSE7_MIN,  X50_HOUSE8_MIN,
       X50_HOUSE9_MIN, X50_HOUSE10_MIN, X50_HOUSE11_MIN, X50_HOUSE12_MIN};
  static final double[] maxLonX50 = new double[]
      {X50_ASC_MAX,    X50_MC_MAX,      X50_ARMC_MAX,    X50_VERTEX_MAX,
       X50_EQUASC_MAX, X50_COASC1_MAX,  X50_COASC2_MAX,  X50_POLASC_MAX,
       X50_HOUSE1_MAX, X50_HOUSE2_MAX,  X50_HOUSE3_MAX,  X50_HOUSE4_MAX,
       X50_HOU


';
import 'package:flutter_mini_sprite/flutter_mini_sprite.dart';
import 'package:mini_sprite/mini_sprite.dart';
import 'package:nes_ui/nes_ui.dart';

/// {@template nes_icon_data}
/// Model class holding the data of for a [NesIcon].
/// {@endtemplate}
class NesIconData {
  /// {@macro nes_icon_data}
  NesIconData(this.sprite);

  /// Sprite.
  final MiniSprite sprite;
}

/// Built in library of icons for the Flutter Nes Design library.
// ignore: non_constant_identifier_names
final NesIcons = NesIconCollection._singleton();

/// This is the internal class that holds the data for [NesIcons].
/// Use [NesIcons] to access the icons.
class NesIconCollection {
  NesIconCollection._singleton();

  /// Instance of [NesIconCollection].
  @Deprecated('Instance is no longer needed. Use NesIcons directly.')
  late final NesIconCollection instance = NesIcons;

  /// A check icon.
  late final check = NesIconData(
    MiniSprite.fromDataString(
      '8,8;6,-1;2,0;5,-1;1,0;1,1;1,0;4,-1;1,0;2,1;3,0;1,-1;1,0;2,1;1,0;1,-1;1,0;1,1;1,0;2,1;1,0;2,-1;1,0;3,1;1,0;4,-1;1,0;1,1;1,0;6,-1;1,0;5,-1',
    ),
  );

  /// A close icon.
  late final close = NesIconData(
    MiniSprite.fromDataString(
      '8,8;1,-1;1,0;4,-1;1,0;1,-1;1,0;1,1;1,0;2,-1;1,0;1,1;1,0;1,-1;1,0;1,1;2,0;1,1;1,0;3,-1;1,0;2,1;1,0;4,-1;1,0;2,1;1,0;3,-1;1,0;1,1;2,0;1,1;1,0;1,-1;1,0;1,1;1,0;2,-1;1,0;1,1;1,0;1,-1;1,0;4,-1;1,0;1,-1',
    ),
  );

  /// A sword icon.
  late final sword = NesIconData(
    MiniSprite.fromDataString(
      '8,8;3,-1;1,0;3,-1;1,0;4,-1;1,0;1,-1;1,0;5,-1;2,0;5,-1;1,0;1,1;2,0;3,-1;1,0;1,1;1,0;2,-1;1,0;1,-1;1,0;1,1;1,0;4,-1;1,0;1,1;1,0;5,-1;2,0;6,-1',
    ),
  );

  /// A shield icon.
  late final shield = NesIconData(
    MiniSprite.fromDataString(
      '8,8;2,0;4,-1;3,0;1,1;7,0;2,1;6,0;2,1;6,0;


AUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#if __loongarch_lp64

#define ENTRY(symbol) \
  .text; \
  .globl symbol; \
  .align 3; \
  .type symbol, @function; \
  symbol:

#define END(function) \
  .size function, .- function;

ENTRY(setjmp)
	st.d	$ra, $a0, 0*8
	st.d	$sp, $a0, 1*8
	st.d	$r21, $a0, 2*8
	st.d	$fp, $a0, 3*8
	st.d	$s0, $a0, 4*8
	st.d	$s1, $a0, 5*8
	st.d	$s2, $a0, 6*8
	st.d	$s3, $a0, 7*8
	st.d	$s4, $a0, 8*8
	st.d	$s5, $a0, 9*8
	st.d	$s6, $a0, 10*8
	st.d	$s7, $a0, 11*8
	st.d	$s8, $a0, 12*8

	li.w	$a0, 0
	jr	$ra
END(setjmp)

ENTRY(longjmp)
	ld.d	$ra, $a0, 0*8
	ld.d	$sp, $a0, 1*8
	ld.d	$r21, $a0, 2*8
	ld.d	$fp, $a0, 3*8
	ld.d	$s0, $a0, 4*8
	ld.d	$s1, $a0, 5*8
	ld.d	$s2, $a0, 6*8
	ld.d	$s3, $a0, 7*8
	ld.d	$s4, $a0, 8*8
	ld.d	$s5, $a0, 9*8
	ld.d	$s6, $a0, 10*8
	ld.d	$s7, $a0, 11*8
	ld.d	$s8, $a0, 12*8

	sltui	$a0, $a1, 1
	add.d	$a0, $a0, $a1	// a0 = (a1 == 0) ? 1 : a1
	jr	$ra
END(longjmp)

#ifdef __ELF__
.section .note.GNU-stack,"",%progbits
#endif

#endif


s(context.backEnvironment.charCode)) { // ㄱ, ㄷ, ㅂ, ㅅ, ㅈ, ㅊ, ㅍ, ㅶ, ㅺ, ㅼ 앞
          phoneticSymbol = 'ɾp˺';
        } else if ([0x1102, 0x1106].includes(context.backEnvironment.charCode)) { // 초성 ㄴ, ㅁ 앞
          phoneticSymbol = 'ɾm';
        } else if (context.backEnvironment.charCode === 0x110B) { // 초성 ㅇ 앞
          phoneticSymbol = 'ɾb'
        } else if (context.backEnvironment.charCode === 0x1112) { // 초성 ㅎ 앞
          phoneticSymbol = 'ɾp';
        }
      }
      break;

    case 0x11D9: // ㄹㆆ
      phoneticSymbol = 'ɾ';
      break;

    case 0x11B3: // 종성 ㄽ
      if (context.frontEnvironment.type === 'middle') { // 모음 뒤(받침에만 쓰임)
        if (context.backEnvironment.type === null) { // 어말
          phoneticSymbol = 't˺';
        } else if ([0x1100, 0x1103, 0x1107, 0x1109, 0x110C, 0x110E, 0x1110, 0x1121].includes(context.backEnvironment.charCode)) { // 초성 ㄱ, ㄷ,  ㅂ, ㅅ, ㅈ, ㅊ, ㅌ, ㅄ 앞
          phoneticSymbol = 't˺';
        } else if ([0x1102, 0x1106].includes(context.backEnvironment.charCode)) { // 초성 ㄴ, ㅁ 앞
          phoneticSymbol = 'n';
        } else if (context.backEnvironment.charCode === 0x110B) { // 초성 ㅇ 앞
          phoneticSymbol = 'd'
        }
      }

    case 0x11C7: // 종성 ㅧ
      phoneticSymbol ='n';
      break;

    case 0x11C6: // 종성 ㅦ
      phoneticSymbol = 'n';
      break;

    case 0x11DD: // 종성 ㅯ
      phoneticSymbol = 'm';
      break;

    case 0x11DC: // 종성 ㅮ
      phoneticSymbol = 'm';
      break;

    case 0x11AA: // 종성 ᆪ
      if (context.frontEnvironment.type === 'middle') { // 모음 뒤(받침에만 쓰임)
        if (context.backEnvironment.type === null) { // 어말
          phoneticSymbol = 'k˺';
        } else if ([0x1100, 0x1103, 0x1107, 0x1109, 0x110C].includes(context.backEnvironment.charCode)) { // 초성 ㄱ, ㄷ,  ㅂ, ㅅ, ㅈ 앞
          phoneticSymbol = 'k˺';
        } else if ([0x1102, 0x1106].includes(context.backEnvironment.charCode)) { // 초성 ㄴ, ㅁ 앞
          phoneticSymbol = 'ŋ';
        }
      }
      break;

    case 0x11F1: // 종성 ᇱ // TODO ㅇㅅ이 아니라 옛ㅇㅅ이 맞는지 확인
      phoneticSymbol = 'ŋ';
      break;

    case 0x112E:


-05-2012: Version 2.25:

New mode: Erlang.

Remove xmlpure mode (use xml.js).

Fix line-wrapping in Opera.

Fix X Windows middle-click paste in Chrome.

Fix bug that broke pasting of huge documents.

Fix backspace and tab key repeat in Opera.

23-04-2012: Version 2.24:

Drop support for Internet Explorer 6.

New
    modes: Shell, Tiki
    wiki, Pig Latin.

New themes: Ambiance, Blackboard.

More control over drag/drop
    with dragDrop
    and onDragEvent
    options.

Make HTML mode a bit less pedantic.

Add compoundChange API method.

Several fixes in undo history and line hiding.

Remove (broken) support for catchall in key maps,
    add nofallthrough boolean field instead.

26-03-2012: Version 2.23:

Change default binding for tab [more]

        Starting in 2.23, these bindings are default:

Tab: Insert tab character

Shift-tab: Reset line indentation to default

Ctrl/Cmd-[: Reduce line indentation (old tab behaviour)

Ctrl/Cmd-]: Increase line indentation (old shift-tab behaviour)

New modes: XQuery and VBScript.

Two new themes: lesser-dark and xq-dark.

Differentiate between background and text styles in setLineClass.

Fix drag-and-drop in IE9+.

Extend charCoords
    and <a href="doc/manual.html


, null);

				if (placeData.statusText === 'Not Found' ) {
					this.$estimatorZipErrorText.html(zipCodeError);
				}	else {
					this.$estimatorZipErrorText.html(zippoUnhandledError);
				}

				addressLookup.reject();
			}
		}.bind(this));
	}

	addressLookup.done(function (city, stateCode) {
		this.toggleShowCalculatingOnFields();
		$.post(
			this.getShippingRatesEndpoint,
			{
				'CheckoutForm[shippingCountryCode]': this.selectedCountryCode,
				'CheckoutForm[shippingCity]': city,
				'CheckoutForm[shippingStateCode]': stateCode,
				'CheckoutForm[shippingPostal]': this.getPostal()
			}).done(function (shippingRatesResponse) {
				if (typeof shippingRatesResponse.result === 'undefined' ||
					shippingRatesResponse.result !== 'success'
					) {
					// TODO: We have no way to handle an error here. See WS-2076 for a
					// question aimed at Luke about how to display errors.
					this.$totalEstimate.html(this.$cartSubtotal.html());
					this.$estimatorZipErrorText.html(zipCodeError);
					return deferred.reject();
				}

				var options = shippingRatesResponse.wsShippingEstimatorOptions;
				this.redrawShippingOptions(options.shippingOptions);

				this.handleMessages(options.messages);
				this.selectedProviderId = options.selectedProviderId || null;
				this.selectedPriorityLabel = options.selectedPriorityLabel || null;
				this.selectShippingOption(this.selectedProviderId, this.selectedPriorityLabel);
				this.currentlySelectedShippingOption = options.selectedShippingOption || null;

				// If it's the first time loading the page the currently selected option will be empty
				// So we fall back to what's passed in the options as the default shipping provider.
				if (this.currentlySelectedShippingOption === null) {
					this.updateEstimatesFromOptions(this.getSelectedShippingOption());
				} else {
					this.updateEstimatesFromResponse(this.currentlySelectedShippingOption);
				}

				if (shippingRatesResponse.taxModeChangedMessage !== null) {
					$('.pricechange').show();
					$('.pricechange').html(shippingRatesResponse.taxModeChangedMessage);
				} else {
					$('.pricechange').hide();
				}

				deferred.resolve(shippingRatesResponse);
		}.bind(this));
	}.bind(this)).fail(function () {
		// Address lookup failed.
		deferred.reject();
	}.bind(this));

	return deferred.promise();
};

/**
 * Displays the loading spinner and removes the calculate label on
 * the button
 * @return {undefined}
 */
WsShippingEstimator.prototype.toggleLoadingSpinner = function() {
	if (this.$shippingCalculateButton.find('.fa-circle-o-notch').length > 0)
	{
		// we need to hide the spinner
		this.$shippingCalculateButton.removeClass('inset-spinner');
		this.$shippingCalculateButton.html(strCalculateButton);
		this.$shippingCalculateButton.prop('disabled', false);
	}
	else
	{
		this.$shippingCalculateButton.addClass('inset-spinner');
		this.$shippingCalculateButton.html('<i class=\'fa fa-circle-o-notch fa-spin fa-lg\'></i>');
		this.$shippingCalculateButton.prop('disabled','disabled');
	}
};

/**
 * Displays 'Calculating...' on fields that are expected to change after
 * a recalculation of the shipping estimator's price
 * @return {undefined}
 */
WsShippingEstimator.prototype.toggleShowCalculatingOnFields = function() {
	$.each(this.calculatingFields, function(idx, el) {
		el.html(calculatingLabel);
	});
};

/**
 * Called by PromoCodeInput when promocode has been applied or removed.
 * @param string result The result of applying the promocode. One of:
 * 'alert' - display an alert,
 * 'error' -


return result;
            }
        }

        /// <summary>
        /// Gets a value indicating whether [allows interactive bulk indexing].
        /// </summary>
        /// <value>
        /// <c>true</c> if [allows interactive bulk indexing]; otherwise, <c>false</c>.
        /// </value>
        [NotMapped]
        public bool AllowsInteractiveBulkIndexing
        {
            get
            {
                return false;
            }
        }

        #endregion Methods
    }

    #region Entity Configuration

    /// <summary>
    /// Site Configuration class.
    /// </summary>
    public partial class SiteConfiguration : EntityTypeConfiguration<Site>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SiteConfiguration"/> class.
        /// </summary>
        public SiteConfiguration()
        {
            this.HasOptional( p => p.DefaultPage ).WithMany().HasForeignKey( p => p.DefaultPageId ).WillCascadeOnDelete( false );
            this.HasOptional( p => p.DefaultPageRoute ).WithMany().HasForeignKey( p => p.DefaultPageRouteId ).WillCascadeOnDelete( false );
            this.HasOptional( p => p.LoginPage ).WithMany().HasForeignKey( p => p.LoginPageId ).WillCascadeOnDelete( false );
            this.HasOptional( p => p.LoginPageRoute ).WithMany().HasForeignKey( p => p.LoginPageRouteId ).WillCascadeOnDelete( false );
            this.HasOptional( p => p.ChangePasswordPage ).WithMany().HasForeignKey( p => p.ChangePasswordPageId ).WillCascadeOnDelete( false );
            this.HasOptional( p => p.ChangePasswordPageRoute ).WithMany().HasForeignKey( p => p.ChangePasswordPageRouteId ).WillCascadeOnDelete( false );
            this.HasOptional( p => p.RegistrationPage ).WithMany().HasForeignKe