.f) {
          await youattack(encounter);
          await enemyattack(encounter);
        }
        await creatureadvance();
      }

      if (c == Key.e) await equip(activeSquad!.loot);

      //HAVE YOU LOST ALL OF THEM?
      //THEN LEAVE
      int baddiecount = encounter.where((e) => e.isEnemy && e.alive).length;
      if (partyalive > 0 && baddiecount == 0) {
        if (showStandardText) {
          setColor(white);
          clearMessageArea();
          if (!ranAway) {
            mvaddstr(9, 1, "A Liberal outcome!");
          } else {
            mvaddstr(9, 1, "It looks like you've lost them!");
          }
          await getKey();
        }
        for (BodyPart w in pool.expand((p) => p.body.parts)) {
          w.bleeding = 0;
        }
        mode = GameMode.base;
        if (ranAway) {
          return ChaseOutcome.escape;
        } else {
          return ChaseOutcome.victory;
        }
      }
    }
  }
}

const drivingRandomness = 13;
Future<bool> evasivedrive(int turn) async {
  List<int> yourRolls = [], theirRolls = [];
  List<Vehicle> theirRollsCar = [];
  List<Creature> theirRollsDriver = [];
  int yourworst = 10000;
  for (Creature p in squad) {
    if (p.alive && p.isDriver) {
      Vehicle v = p.car!;
      yourRolls.add(driveskill(p, v) + lcsRandom(drivingRandomness + turn));
      p.train(Skill.driving, lcsRandom(50));
      if (yourworst > yourRolls.last) yourworst = yourRolls.last;
    }
  }
  if (yourRolls.isEmpty) yourRolls.add(0); //error -- and for this you get a 0

  List<Creature> toRemove = [];
  for (Creature e in encounter) {
    if (e.carId != -1 && e.isEnemy && e.alive && e.isDriver) {
      theirRolls
          .add(driveskill(e, e.car!) + lcsRandom(drivingRandomness + turn));
      theirRollsCar.add(e.car!);
      theirRollsDriver.add(e);
    } else if (e.carId == -1) {
      toRemove.add(e);
    }
  }
  encounter.removeWhere((e) => toRemove.contains(e));

  await encounterMessage([
    "You pick up speed on a long straightaway.",
    "You swerve around the next corner.",
    "You screech through an empty lot to the next street.",
    "You thread the needle between two obstacles.",
    "You downshift abruptly, engine growling as you corner hard.",
    "You take a sharp turn, tires squealing.",
    "You dodge a pothole and keep the pedal down.",
    "You take a shortcut through a parking lot.",
    "The tires grip just enough as you drift through a sharp turn.",
    "You take a risky shortcut through an alley.",
    "You soar into a downhill curve, barely keeping control.",
    "You take a sharp turn, the car fishtailing.",
    "You clip a stack of barrels, sending them rolling behind you.",
  ].random);

  for (int i = 0; i < theirRolls.length; i++) {
    Vehicle enemyCar = theirRollsCar[i];
    // Update enemy car distance
    int delta = yourworst - theirRolls[i] + turn;
    int enemyCarDistance = chaseSequence!.enemyCarDistance[enemyCar] ?? 70;
    if (enemyCarDistance < 15) delta ~/= 2;
    if (enemyCarDistance > 30) delta *= 2;
    enemyCarDistance += delta;
    if (en


092],
    'pop': 5253,
    'state': 'TN'
  },
  {
    '_id': '37421',
    'city': 'CHATTANOOGA',
    'loc': [-85.14594, 35.024986],
    'pop': 32802,
    'state': 'TN'
  },
  {
    '_id': '37601',
    'city': 'JOHNSON CITY',
    'loc': [-82.34077499999999, 36.333872],
    'pop': 27978,
    'state': 'TN'
  },
  {
    '_id': '37604',
    'city': 'JOHNSON CITY',
    'loc': [-82.38104199999999, 36.310744],
    'pop': 31353,
    'state': 'TN'
  },
  {
    '_id': '37615',
    'city': 'GRAY',
    'loc': [-82.44712800000001, 36.41006],
    'pop': 12119,
    'state': 'TN'
  },
  {
    '_id': '37616',
    'city': 'AFTON',
    'loc': [-82.746667, 36.204166],
    'pop': 3469,
    'state': 'TN'
  },
  {
    '_id': '37617',
    'city': 'BLOUNTVILLE',
    'loc': [-82.36555799999999, 36.53562],
    'pop': 14517,
    'state': 'TN'
  },
  {
    '_id': '37618',
    'city': 'BLUFF CITY',
    'loc': [-82.236181, 36.477391],
    'pop': 11146,
    'state': 'TN'
  },
  {
    '_id': '37620',
    'city': 'BRISTOL',
    'loc': [-82.181864, 36.568643],
    'pop': 36852,
    'state': 'TN'
  },
  {
    '_id': '37640',
    'city': 'BUTLER',
    'loc': [-81.985614, 36.328158],
    'pop': 3479,
    'state': 'TN'
  },
  {
    '_id': '37641',
    'city': 'CHUCKEY',
    'loc': [-82.66744799999999, 36.221142],
    'pop': 6362,
    'state': 'TN'
  },
  {
    '_id': '37642',
    'city': 'CHURCH HILL',
    'loc': [-82.725184, 36.539926],
    'pop': 9106,
    'state': 'TN'
  },
  {
    '_id': '37643',
    'city': 'ELIZABETHTON',
    'loc': [-82.201481, 36.344548],
    'pop': 32046,
    'state': 'TN'
  },
  {
    '_id': '37645',
    'city': 'MOUNT CARMEL',
    'loc': [-82.653217, 36.562913],
    'pop': 6249,
    'state': 'TN'
  },
  {
    '_id': '37650',
    'city': 'ERWIN',
    'loc': [-82.41631, 36.134193],
    'pop': 11635,
    'state': 'TN'
  },
  {
    '_id': '37656',
    'city': 'FALL BRANCH',
    'loc': [-82.62560499999999, 36.415839],
    'pop': 1964,
    'state': 'TN'
  },
  {
    '_id': '37657',
    'city': 'FLAG POND',
    'loc': [-82.56230100000001, 36.008507],
    'pop': 1066,
    'state': 'TN'
  },
  {
    '_id': '37658',


n utils.lsp_file_uri(buf) == result.ownerUri
				end)
				if not bufnr then
					return
				end
				local qm = vim.b[bufnr].query_manager
				if not (result and result.connection and qm) then
					return
				end

				coroutine.resume(coroutine.create(function()
					qm.connectionchanged_async(result)
				end))

				clean_cache()
			end,
		},
		on_attach = function(client, bufnr)
			if not vim.b[bufnr].query_manager then
				vim.b[bufnr].query_manager = query_manager_module.create_query_manager(bufnr, client)
			end

			-- see the wait_for_on_attach_async function below
			if vim.b[bufnr].on_attach_handlers then
				for _, handler in ipairs(vim.b[bufnr].on_attach_handlers) do
					handler(client)
				end
				vim.b[bufnr].on_attach_handlers = {}
			end
		end,
	}

	if opts.lsp_settings then
		config.settings = { mssql = opts.lsp_settings }
	end

	vim.lsp.config[lsp_name] = config
	vim.lsp.enable("mssql_ls")
end

---Waits for the lsp attach to the given buffer, with optional timeout.
---Must be run inside a coroutine.
---@param bufnr_to_watch integer
---@param timeout integer
---@return vim.lsp.Client
local function wait_for_on_attach_async(bufnr_to_watch, timeout)
	-- if it's already attach, return
	local existing_client = vim.lsp.get_clients({ name = lsp_name, bufnr = bufnr_to_watch })[1]
	if existing_client then
		return existing_client
	end

	local this = coroutine.running()
	local resumed = false

	local on_attach_handler = function(client)
		if not resumed then
			resumed = true
			utils.try_resume(this, client)
		end
	end

	if not vim.b[bufnr_to_watch].on_attach_handlers then
		vim.b[bufnr_to_watch].on_attach_handlers = { on_attach_handler }
	else
		table.insert(vim.b[bufnr_to_watch].on_attach_handlers, on_attach_handler)
	end

	vim.defer_fn(function()
		if not resumed then
			resumed = true
			utils.log_error("Waiting for the lsp to attach to buffer " .. bufnr_to_watch .. " timed out")
		end
	end, timeout)

	return coroutine.yield()
end

local function set_auto_commands(opts)
	vim.api.nvim_create_augroup("AutoNameSQL", { clear = true })

	-- Reset the buffer to the file name upon saving
	vim.api.nvim_create_autocmd("BufWritePost", {
		group = "AutoNameSQL",
		pattern = "*.sql",
		callback = function(args)
			local buf = args.buf
			if vim.b[buf].is_temp_name then
				local written_name = vim.fn.fnamemodify(vim.fn.expand("<afile>"), ":t")

				vim.cmd("file " .. written_name)
				vim.b[buf].is_temp_name = nil
			end
		end,
	})

	if opts.sql_buffer_options and opts.sql_buffer_options ~= {} then
		vim.api.nvim_create_autocmd("FileType", {
			pattern = "sql",
			callback = function()
				-- copy all properties
				for k, v in pairs(opts.sql_buffer_options) do
					vim.bo[k] = v
				end
			end,
		})
	end

	-- clean the sql object cache on buffer close
	-- use the BufWipeout auto command so that at that point the


ed;
#else
				geo_argused(PGP_max_scale_corr);
				if(algo != 2) {
				    Logger::warn("PGP")
					<< "cubecover/scale correction not available in the public version"
					<< std::endl;
				    Logger::warn("PGP")
					<< "falling back with PGP without scale correction"
					<< std::endl;
				}
				algo = 2;
				STEP(pgp.optimize_corr,(0.0));
				STEP(pgp.optimize_PGP,());
#endif
			}

			m->edges.attributes().delete_attribute_store("corr"); // ? can we really do that ?
			//m->vertices.attributes().delete_attribute_store("U");
			//m->edges.clear();
		}

		void HexCandidates(Mesh*m, Mesh* result) {
			STEP(export_hexes, (m, result));
		}

		bool QuadDominant(Mesh*m, Mesh* chartmesh) {

			STEP(export_boundary_with_uv,(m, chartmesh, "uv", "singular"));
			//get_facet_stats(chartmesh, "export with uv");

			STEP(imprint, (chartmesh, "uv", "singular"));

//		STEP(split_edges_by_iso_uvs, (chartmesh, "uv", "singular"));
//		STEP(facets_split,(chartmesh, "uv", "singular"));

			STEP(mark_charts,(chartmesh, "uv", "chart", "singular"));

			STEP(simplify_quad_charts,(chartmesh));

//            bool res = true;
//			STEP(res = export_quadtri_from_charts,(chartmesh));
//          if (res) {
//              plop("self-intersections!");
//              return true;
//          } else return false;

///         vector<index_t> fails;
///         find_degenerate_facets(chartmesh, fails);
///         plop(fails.size());

/*
            vector<index_t> intersections;
            chartmesh->facets.triangulate();
            find_self_intersections(chartmesh, intersections);
            plop(intersections.size());
          std::string msg;
            plop (surface_is_manifold(chartmesh, msg));
            plop(msg);
            FOR(f, chartmesh->facets.nb()) {
                double area = Geom::mesh_facet_area(*chartmesh, f, 3);
                    GEO::Logger::out("HexDom")  << area <<  std::endl;
            }

*/

			if (!surface_is_tetgenifiable(chartmesh)) {
				logt.add_string("fail", " tetgen is not able to remesh the quadtri");
				return false;
			}

			chartmesh->facet_corners.attributes().delete_attribute_store("uv");
//			chartmesh->facets.attributes().delete_attribute_store("chart");
			chartmesh->facets.attributes().delete_attribute_store("quadelement");
			chartmesh->facets.attributes().delete_attribute_store("singular");
			chartmesh->vertices.attributes().delete_attribute_store("quadcorners");
			chartmesh->facets.attributes().delete_attribute_store("orig_tri_fid");
			chartmesh->facet_corners.attributes().delete_attribute_store("isovalue");
			return true;
		}

		void Hexahedrons(Mesh* quaddominant, Mesh* hexcandidates, Mesh* result) {
			result->copy(*hexcandidates);
			STEP(hex_set_2_hex_mesh,(result, quaddominant));
		}

		bool Cavity(Mesh* quaddominant, Mesh* hexahedrons, Mesh* result) {
			result->copy(*quaddominant);
			STEP(merge_hex_boundary_and_quadtri,(hexahedrons, result));

			if (result->facets.


### Example

The following code example elicits this warning.

```
void driver_utility()
{
    // running at APC level
    KFLOATING_SAVE FloatBuf;
    if (KeSaveFloatingPointState(&FloatBuf))
    {
        KeLowerIrql(PASSIVE_LEVEL);
        ...
        KeRestoreFloatingPointState(&FloatBuf);
    }
}
```

The following code example avoids this warning.

```
void driver_utility()
{
    // running at APC level
    KFLOATING_SAVE FloatBuf;
    if (KeSaveFloatingPointState(&FloatBuf))
    {
        KeLowerIrql(PASSIVE_LEVEL);
        ...
        KeRaiseIrql(APC_LEVEL, &old);
        KeRestoreFloatingPointState(&FloatBuf);
    }
}
```

---
UID: NS:ndis._NDIS_TIMER_CHARACTERISTICS
title: _NDIS_TIMER_CHARACTERISTICS (ndis.h)
description: The NDIS_TIMER_CHARACTERISTICS structure defines characteristics of a one-shot or periodic timer.
old-location: netvista\ndis_timer_characteristics.htm
tech.root: netvista
ms.date: 05/02/2018
keywords: ["NDIS_TIMER_CHARACTERISTICS structure"]
ms.keywords: "*PNDIS_TIMER_CHARACTERISTICS, NDIS_TIMER_CHARACTERISTICS, NDIS_TIMER_CHARACTERISTICS structure [Network Drivers Starting with Windows Vista], PNDIS_TIMER_CHARACTERISTICS, PNDIS_TIMER_CHARACTERISTICS structure pointer [Network Drivers Starting with Windows Vista], _NDIS_TIMER_CHARACTERISTICS, ndis/NDIS_TIMER_CHARACTERISTICS, ndis/PNDIS_TIMER_CHARACTERISTICS, ndis_timer_ref_af673f64-aa72-4767-81a0-5df465a52c81.xml, netvista.ndis_timer_characteristics"
req.header: ndis.h
req.include-header: Ndis.h
req.target-type: Windows
req.target-min-winverclnt: Supported in NDIS 6.0 and later.
req.target-min-winversvr:
req.kmdf-ver:
req.umdf-ver:
req.ddi-compliance:
req.unicode-ansi:
req.idl:
req.max-support:
req.namespace:
req.assembly:
req.type-library:
req.lib:
req.dll:
req.irql:
targetos: Windows
req.typenames: NDIS_TIMER_CHARACTERISTICS, *PNDIS_TIMER_CHARACTERISTICS
f1_keywords:
 - _NDIS_TIMER_CHARACTERISTICS
 - ndis/_NDIS_TIMER_CHARACTERISTICS
 - PNDIS_TIMER_CHARACTERISTICS
 - ndis/PNDIS_TIMER_CHARACTERISTICS
 - NDIS_TIMER_CHARACTERISTICS
 - ndis/NDIS_TIMER_CHARACTERISTICS
topic_type:
 - APIRef
 - kbSyntax
api_type:
 - HeaderDef
api_location:
 - ndis.h
api_name:
 - _NDIS_TIMER_CHARACTERISTICS
 - PNDIS_TIMER_CHARACTERISTICS
 - NDIS_TIMER_CHARACTERISTICS
---

# _NDIS_TIMER_CHARACTERISTICS structure

## -description

The NDIS_TIMER_CHARACTERISTICS structure defines characteristics of a one-shot or periodic
  timer.

## -struct-fields

### -field Header

The
     NDIS_OBJECT_HEADER structure for the
     NDIS_TIMER_CHARACTERISTICS structure. Set the
     Type member of the structure that
     Header specifies to NDIS_OBJECT_TYPE_TIMER_CHARACTERISTICS, the
     Revision</b


AUTH, (void *)pin );

            powermgm_resume_from_ISR();
            return( pass_key );
        };

        void onPassKeyNotify( uint32_t pass_key ){
            char pin[16]="";
            snprintf( pin, sizeof( pin ), "%06d", pass_key );
            log_d("BLECTL pairing request, PIN: %s", pin );

            blectl_set_event( BLECTL_PIN_AUTH );
            blectl_send_event_cb( BLECTL_PIN_AUTH, (void *)pin );

            powermgm_resume_from_ISR();
        };

        bool onConfirmPIN( uint32_t pass_key ) {
            char pin[16]="";
            snprintf( pin, sizeof( pin ), "%06d", pass_key );
            log_d("BLECTL confirm PIN: %s", pin );

            powermgm_resume_from_ISR();

            return( false );
        };

        void onAuthenticationComplete(ble_gap_conn_desc* desc){
            if(!desc->sec_state.encrypted) {
                if ( blectl_get_event( BLECTL_PIN_AUTH ) ) {
                    log_d("BLECTL pairing abort, reason: %02x", cmpl.fail_reason );
                    blectl_clear_event( BLECTL_PIN_AUTH );
                    blectl_send_event_cb( BLECTL_PAIRING_ABORT, (void *)"abort" );
                    NimBLEDevice::getServer()->disconnect( desc->conn_handle );
                    return;
                }
                if ( blectl_get_event( BLECTL_AUTHWAIT | BLECTL_CONNECT ) ) {
                    log_d("BLECTL authentication unsuccessful, client disconnected, reason: %02x", cmpl.fail_reason );
                    blectl_clear_event( BLECTL_AUTHWAIT | BLECTL_CONNECT );
                    blectl_set_event( BLECTL_DISCONNECT );
                    blectl_send_event_cb( BLECTL_DISCONNECT, (void *) "disconnected" );
                    NimBLEDevice::getServer()->disconnect(desc->conn_handle);
                    return;
                }
            }
            else {
                if ( blectl_get_event( BLECTL_PIN_AUTH ) ) {
                    log_d("BLECTL pairing successful");
                    blectl_clear_event( BLECTL_PIN_AUTH );
                    blectl_send_event_cb( BLECTL_PAIRING_SUCCESS, (void *)"success" );
                    return;
                }
                if ( blectl_get_event( BLECTL_AUTHWAIT ) ) {
                    log_d("BLECTL authentication successful, client connected");
                    blectl_clear_event( BLECTL_AUTHWAIT | BLECTL_DISCONNECT );
                    blectl_set_event( BLECTL_CONNECT );
                    blectl_send_event_cb( BLECTL_CONNECT, (void *) "connected" );
                    return;
                }
            }
            powermgm_resume_from_ISR();
        };
    };
#endif

void blectl_setup( void ) {
    #ifdef NATIVE_64BIT
    #else
        /**
         * allocate event group
         */
        blectl_status = xEventGroupCreate();
        ASSERT( blectl_status, "Failed to allocate event group" );
        /**
         *  Create the BLE Device
         */
        char deviceName[ 64 ];
        snprintf( deviceName, sizeof( deviceName ), "Espruino (%s)", device_get_name() );
        NimBLEDevice::init( deviceName );
        /*
         * set power level from config
         */
        switch( blectl_config.txpower ) {
            case 0:             NimBLEDevic


nstants
             ./
             #define IDWLEN         9
             #define IFNLEN         61
             #define FILSIZ         256

             /.
             Local variables
             ./
             SpiceChar               fname [FILSIZ];
             SpiceChar               idword[IDWLEN];
             SpiceChar               ifname[IFNLEN];

             SpiceInt                handle;
             SpiceInt                nresvr;
             SpiceInt                nresvc;
             SpiceInt                ncomr;
             SpiceInt                ncomc;

             /.
             Obtain the file name.
             ./
             prompt_c ( "Enter DAS file name > ", FILSIZ, fname );

             /.
             Open the file for reading.
             ./
             dasopr_c ( fname, &handle  );

             /.
             Retrieve the internal file name and print it.
             ./

             dasrfr_c ( handle, IDWLEN, IFNLEN, idword,
                        ifname, &nresvr, &nresvc, &ncomr, &ncomc );

             printf ( "Internal file name is:           %s\n", ifname     );
             printf ( "Number of comment records is:    %d\n", (int)ncomr );
             printf ( "Number of comment characters is: %d\n", (int)ncomc );

             return(0);
          }

-Restrictions

   None.

-Literature_References

   None.

-Author_and_Institution

   N.J. Bachman   (JPL)
   K.R. Gehringer (JPL)
   W.L. Taber     (JPL)

-Version

   -CSPICE Version 1.0.0, 11-NOV-2016 (NJB) (KRG) (WLT)

-Index_Entries

   read DAS file record
   read DAS internal file name

-&
*/

{ /* Begin dasrfr_c */

   /*
   Participate in error tracing.
   */
   chkin_c ( "dasrfr_c" );

   /*
   Check output string pointers and lengths.
   */
   CHKOSTR ( CHK_STANDARD, "dasrfr_c", idword, idwlen );
   CHKOSTR ( CHK_STANDARD, "dasrfr_c", ifname, ifnlen );

   dasrfr_ ( (integer    *) &handle,
             (char       *) idword,
             (char       *) ifname,
             (integer    *) nresvr,
             (integer    *) nresvc,
             (integer    *) ncomr,
             (integer    *) ncomc,
             (ftnlen      ) idwlen,
             (ftnlen      ) ifnlen  );

   /*
   Convert the output strings to C style strings.
   */
   F2C_ConvertStr ( idwlen, idword );
   F2C_ConvertStr ( ifnlen, ifname );

   chkout_c ( "dasrfr_c" );

} /* End dasrfr_c */


posables += InAppPaymentsRepository.observeInAppPaymentRedemption(InAppPaymentType.RECURRING_DONATION).subscribeBy { redemptionStatus ->
      store.update { manageDonationsState ->
        manageDonationsState.copy(
          nonVerifiedMonthlyDonation = if (redemptionStatus is DonationRedemptionJobStatus.PendingExternalVerification) redemptionStatus.nonVerifiedMonthlyDonation else null,
          subscriptionRedemptionState = mapStatusToRedemptionState(redemptionStatus)
        )
      }
    }

    disposables += Observable.combineLatest(
      SignalStore.inAppPayments.observablePendingOneTimeDonation,
      InAppPaymentsRepository.observeInAppPaymentRedemption(InAppPaymentType.ONE_TIME_DONATION)
    ) { pendingFromStore, pendingFromJob ->
      if (pendingFromStore.isPresent) {
        pendingFromStore
      } else if (pendingFromJob is DonationRedemptionJobStatus.PendingExternalVerification) {
        Optional.ofNullable(pendingFromJob.pendingOneTimeDonation)
      } else {
        Optional.empty()
      }
    }
      .distinctUntilChanged()
      .subscribeBy { pending ->
        store.update { it.copy(pendingOneTimeDonation = pending.orNull()) }
      }

    disposables += levelUpdateOperationEdges.switchMapSingle { isProcessing ->
      if (isProcessing) {
        Single.just(ManageDonationsState.TransactionState.InTransaction)
      } else {
        activeSubscription.map { ManageDonationsState.TransactionState.NotInTransaction(it) }
      }
    }.subscribeBy(
      onNext = { transactionState ->
        store.update {
          it.copy(subscriptionTransactionState = transactionState)
        }
      },
      onError = { throwable ->
        Log.w(TAG, "Error retrieving subscription transaction state", throwable)

        store.update {
          it.copy(subscriptionTransactionState = ManageDonationsState.TransactionState.NetworkFailure)
        }
      }
    )

    disposables += RecurringInAppPaymentRepository.getSubscriptions().subscribeBy(
      onSuccess = { subs ->
        store.update { it.copy(availableSubscriptions = subs) }
      },
      onError = {
        Log.w(TAG, "Error retrieving subscriptions data", it)
      }
    )
  }

  private fun mapStatusToRedemptionState(status: DonationRedemptionJobStatus): ManageDonationsState.RedemptionState {
    return when (status) {
      DonationRedemptionJobStatus.FailedSubscription -> ManageDonationsState.RedemptionState.FAILED
      DonationRedemptionJobStatus.None -> ManageDonationsState.RedemptionState.NONE
      DonationRedemptionJobStatus.PendingKeepAlive -> ManageDonationsState.RedemptionState.SUBSCRIPTION_REFRESH

      is DonationRedemptionJobStatus.PendingExternalVerification,
      DonationRedemptionJobStatus.PendingReceiptRedemption,
      DonationRedemptionJobStatus.PendingReceiptRequest -> ManageDonationsState.RedemptionState.IN_PROGRESS
    }
  }

  companion object {
    private val TAG = Log.tag(ManageDonationsViewModel::class.java)
  }
}
package org.thoughtcrime.securesms.components.settings.app.subscription.errors

/**
 * From: https://developer.paypal.com/braintree/docs/reference/general/processor-responses/authorization-responses#decline-codes
 */
data class PayPalDeclineCode(
  val code: Int
) {

  val knownCode: KnownCode? = KnownCode.fromCode(code)

  enum class KnownCode(val code: Int) {
    DO_NOT_HONOR(2000),
    INSUFFICIENT_FUNDS(2001),
    LIMIT_EXCEEDED(2002),
    CARDHOLDER_ACTIVITY_LIMIT_EXCEEDED(2003),
    EXPIRED_CARD(2004),
    INVALID_CREDIT_CARD(2005),
    INVALID_EXPIR


              {
                                    Terraria.Main.item[i].active = false;
                                    plr.SendData(PacketTypes.ItemDrop, "", i);
                                }
                            }
                        }
                    }
                }
            }
        }

        if (DamageRuleLoot.Config.Broadcast)
        {
            if (DamageRuleLoot.Config.Enabled3)
            {
                mess.AppendLine(DamageRuleLoot.Config.Advertisement);
            }

            TSPlayer.All.SendMessage(mess.ToString(), 247, 244, 150);
        }

        if (LowDamager.Length > 0 && DamageRuleLoot.Config.Broadcast2)
        {
            var playerNames = LowDamager.ToString().Split(new[] { "," }, StringSplitOptions.None);
            var joinedNames = string.Join(", ", playerNames);

            LowDamager.Insert(0, GetString($"[c/F06576:【注意】]输出少于 [c/A7DDF0:{DamageRuleLoot.Config.Damages:0.00%}] 禁止掉落宝藏袋:\n"));

            TSPlayer.All.SendMessage(LowDamager.ToString(), 247, 244, 150);
        }
    }
    #endregion
}


 비서 관련 API")
class AiAssistantController(
    private val aiAssistantService: AiAssistantService
) {

    private val logger = LoggerFactory.getLogger(this::class.java)

    /**
     * AI 비서 설정 저장 및 업데이트
     */

    @Operation(
        summary = "AI 비서 세팅",
        description = "AI 비서 이용을 위해 사용자별 초기 설정을 진행합니다.",
        responses = [
            ApiResponse(
                responseCode = "200",
                description = "세팅 성공",
                content = [Content(schema = Schema(implementation = AiAssistantSettingResponse::class))]
            ),
            ApiResponse(
                responseCode = "400",
                description = "요청 데이터가 유효하지 않음 (잘못된 문체 혹은 카테고리 없음)"
            ),
            ApiResponse(
                responseCode = "403",
                description = "해당 보이스팩 사용 권한 없음"
            ),
            ApiResponse(
                responseCode = "404",
                description = "사용자를 찾을 수 없거나 관련 데이터 없음"
            ),
            ApiResponse(
                responseCode = "500",
                description = "서버 오류"
            )
        ]
    )

    @PostMapping("/settings")
    fun saveOrUpdateAiAssistantSettings(
        @SessionAttribute("userId") userId: Long,
        @RequestBody request: AiAssistantSettingRequest
    ): ResponseEntity<Any> {
        return try {
            // 서비스 메소드 호출하여 설정 저장/업데이트 로직 수행
            val savedSetting = aiAssistantService.saveOrUpdateAiAssistantSettings(userId, request)
            // 성공 시, 저장된 내용을 응답 DTO로 변환 (선택 사항)
            val response = AiAssistantSettingResponse(
                userId = savedSetting.user.id,
                voicepackId = savedSetting.voicepackId,
                writingStyle = savedSetting.writingStyle,
                categories = savedSetting.categories
            )
            logger.info("Successfully updated settings for user ID: $userId")
            ResponseEntity.ok(response)

        } catch (e: SecurityException) {
            logger.warn("Failed to update settings due to security reasons: ${e.message}")
            ResponseEntity.status(HttpStatus.FORBIDDEN).body(mapOf("error" to e.message))
        } catch (e: NoSuchElementException) {
            logger.warn("Failed to update settings: ${e.message}")
            ResponseEntity.status(HttpStatus.NOT_FOUND).body(mapOf("error" to e.message))

        } catch (e: IllegalArgumentException) {
            logger.warn("Failed to update settings due to invalid argument: ${e.message}")
            ResponseEntity.status(HttpStatus.BAD_REQUEST).body(mapOf("error" to e.message))

        } catch (e: Exception) {
            logger.error("Internal ser


restore errno
	MOVQ	(m_mOS+mOS_perrno)(BP), R11
	MOVQ	160(SP), R10
	MOVL	R10, 0(R11)

	// restore g
	MOVQ	80(SP), R10
	MOVQ	R10, g(BX)

exit:
	// restore registers
	MOVQ	32(SP), BX
	MOVQ	40(SP), BP
	MOVQ	48(SP), R12
	MOVQ	56(SP), R13
	MOVQ	64(SP), R14
	MOVQ	72(SP), R15

	ADDQ    $184, SP
	RET

// Called from runtime·usleep (Go). Can be called on Go stack, on OS stack,
// can also be called in cgo callback path without a g->m.
TEXT runtime·usleep1(SB),NOSPLIT,$0
	MOVL	usec+0(FP), DI
	MOVQ	$runtime·usleep2(SB), AX // to hide from 6l

	// Execute call on m->g0.
	get_tls(R15)
	CMPQ	R15, $0
	JE	noswitch

	MOVQ	g(R15), R13
	CMPQ	R13, $0
	JE	noswitch
	MOVQ	g_m(R13), R13
	CMPQ	R13, $0
	JE	noswitch
	// TODO(aram): do something about the cpu profiler here.

	MOVQ	m_g0(R13), R14
	CMPQ	g(R15), R14
	JNE	switch
	// executing on m->g0 already
	CALL	AX
	RET

switch:
	// Switch to m->g0 stack and back.
	MOVQ	(g_sched+gobuf_sp)(R14), R14
	MOVQ	SP, -8(R14)
	LEAQ	-8(R14), SP
	CALL	AX
	MOVQ	0(SP), SP
	RET

noswitch:
	// Not a Go-managed thread. Do not switch stack.
	CALL	AX
	RET

// Runs on OS stack. duration (in µs units) is in DI.
TEXT runtime·usleep2(SB),NOSPLIT,$0
	LEAQ	libc_usleep(SB), AX
	CALL	AX
	RET

// Runs on OS stack, called from runtime·osyield.
TEXT runtime·osyield1(SB),NOSPLIT,$0
	LEAQ	libc_sched_yield(SB), AX
	CALL	AX
	RET

// func now() (sec int64, nsec int32)
TEXT time·now(SB),NOSPLIT,$8-12
	CALL	runtime·nanotime(SB)
	MOVQ	0(SP), AX

	// generated code for
	//	func f(x uint64) (uint64, uint64) { return x/1000000000, x%100000000 }
	// adapted to reduce duplication
	MOVQ	AX, CX
	MOVQ	$1360296554856532783, AX
	MULQ	CX
	ADDQ	CX, DX
	RCRQ	$1, DX
	SHRQ	$29, DX
	MOVQ	DX, sec+0(FP)
	IMULQ	$1000000000, DX
	SUBQ	DX, CX
	MOVL	CX, nsec+8(FP)
	RET


prototype.concat的返回放置[1]所示的visitor对象。args表示的是参与函数运算的参数，接下来的循环，需要会对每个参数args->at(i)进行了IteratorElements运算。

![](https://mmbiz.qpic.cn/sz_mmbiz_png/1UG7KPNHN8GZ3ibyJL3lH8zQuQcXtaPtgD5L8H1WCsB5AwpOofjyaPGp3PCnv5wS5IoVkrPAsdcia2PCSg53jgQg/640?wx_fmt=png "")

图2.1.1.2

图2.1.1.2 : [3]可以看到在IterateElement运算中，会将图 2.1.1.1过程中中的args->at(i)保存在array这个变量之中，然后在[4]过程中将数组array的长度放置在变量length上，并且对数组的类型ElementsKind进行判断，以便接下来做相应的处理。

![](https://mmbiz.qpic.cn/sz_mmbiz_png/1UG7KPNHN8GZ3ibyJL3lH8zQuQcXtaPtg3IU7aBEHRial25icA4mgfZU09896VZbtdPUcq8hRMcmB149GNkwMBpkQ/640?wx_fmt=png "")

图2.1.1.3

图2.1.1.3 : 在ElementsKind判断之后在[7]中将前面[4]的length的值赋值到fast_length变量中，并用于接下来的FOR_WITH_HANDLE_SCOPE的循环。(也就是说array在Array.prototype.concat运算中返回的数组长度在，这个过程中已经不会再变化，为fast_length)
 ![](https://mmbiz.qpic.cn/sz_mmbiz_png/1UG7KPNHN8GZ3ibyJL3lH8zQuQcXtaPtg5cuAzGHv0JxLficlKfC8mqrKQnicRg7ZZoOdiaQ0MD4ZGfdL6wJib6zbRQ/640?wx_fmt=png "")

图 2.1.1.4

图 2.1.1.4:

在
FOR_WITH_HANDLE_SCOPE
的循环中，[9]中会取出数组的element，然后[10]判断element是否为hole，
如果为hole则会调用JSReceiver::GetElement(isolate,array,j)，并调用visitor->visit(j,element)来返回结果。

但是问题是JSReceiver::GetElement(isolate,array,j)为v8的Slow运算，该过程会触发Getter回调。

我们可以通过在回调中写入任意的JS代码来触发越界读。

具体的触发漏洞的做法前面已经说过，将array的length减小，然后触发垃圾回收。因为我们用于FOR_WITH_HANDLE_SCOPE循环的fast_length实际上并没有发生变化，所以结果会读取length之后的数值回去。

2.1.2 构造POC

2.1.2.1综合POC构造需要满足所有条件

条件1：创建FAST_DOUBLE_ELEMENTS类型的数组 A；

条件2：进入element_value->IsTheHole(isolate)


73-839.73zm0 2133.38c-714.47 0-1293.65-579.18-1293.65-1293.65 0-714.46 579.18-1293.64 1293.65-1293.64 714.46 0 1293.64 579.18 1293.64 1293.64 0 714.47-579.18 1293.65-1293.64 1293.65M4166.27 3863.96c0-166.96-135.35-302.3-302.31-302.3-166.95 0-302.3 135.34-302.3 302.3s135.35 302.31 302.3 302.31c166.96 0 302.31-135.35 302.31-302.31"></path></g></symbol><symbol viewbox="-27.7 455.1 337.2 791.1" id="icon-left" xmlns="http://www.w3.org/2000/svg"><path fill="inherit" d="M274.8 1246.2c-9.5 0-19.8-4-27.7-14.3l-262.9-350c-7.9-9.5-11.9-22.2-11.9-31.7 0-11.9 4-22.2 11.9-31.7l262.9-350.1c11.9-14.3 31.7-17.4 47.5-7.9 15.8 9.5 17.4 31.7 7.9 45.9L42.8 851l259.8 342.1c11.9 14.3 7.9 35.6-7.9 45.9-6.4 5.6-11.9 7.2-19.9 7.2"></path></symbol><symbol viewbox="0 0 18 18" id="icon-link" xmlns="http://www.w3.org/2000/svg"><g opacity=".4"><path d="M10.546 13.732l.623-.623a.957.957 0 0 0 .121-.137c.263-.273.48-.582.65-.905a4.44 4.44 0 0 0 .46-2.733 3.766 3.766 0 0 0-.158-.692 3.61 3.61 0 0 0-.244-.604 4.355 4.355 0 0 0-.877-1.245 4.35 4.35 0 0 0-1.245-.876l-1.14 1.14c-.08.08-.146.163-.204.256a2.735 2.735 0 0 1 2.07 2.07c.044.21.066.426.06.644a2.601 2.601 0 0 1-.765 1.81l-.69.689-.513.513-.485.485-1.237 1.237c-1.037 1.037-2.737 1.024-3.79-.029-1.052-1.052-1.064-2.753-.028-3.789L4.39 9.706a5.663 5.663 0 0 1-.208-2.338L1.881 9.67c-1.73 1.73-1.709 4.56.048 6.316 1.757 1.757 4.586 1.778 6.316.048l2.302-2.302z"></path><path d="M7.339 7.802a2.54 2.54 0 0 1 .1-.668c.114-.42.339-.814.665-1.14l.693-.694.51-.51.48-.48 1.242-1.241c1.036-1.036 2.736-1.024 3.789.029 1.052 1.052 1.064 2.753.029 3.789l-1.241 1.24c.233.76.302 1.556.211 2.335l2.303-2.303c1.73-1.73 1.708-4.558-.049-6.315C14.314.087 11.485.066 9.756 1.796L7.453 4.098l-.623.623a.934.934 0 0 0-.121.138 3.904 3.904 0 0 0-.645.9 4.39 4.39 0 0 0-.46 2.733c.028.244.08.472.153.696.065.206.142.41.245.604.209.452.


ange(0, ltws - idx_start):
                w = words[idx_start + i].lower()
                span_str += w if i == 0 else f" {w}"
                if span_str not in prefixes:
                    break
                if span_str in entity_to_tagcnt:
                    my_tag = chunk_to_tag.get(
                        (idx_start, idx_start + i + 1), self._DEFAULT_TAG
                    )
                    entity_to_tagcnt[span_str][my_tag] = (
                        entity_to_tagcnt[span_str].get(my_tag, 0) + 1
                    )

        econ_dic: dict[str, float] = {}
        for span_str, cnt_dic in entity_to_tagcnt.items():
            cnt_sum = float(sum(cnt_dic.values()))
            for tag, cnt in cnt_dic.items():
                econ_dic[f"{span_str}|||{tag}"] = cnt / cnt_sum
        return econ_dic, efre_dic

    def deserialize_system_output(self, output: dict) -> dict:
        """See Processor.deserialize_system_output."""
        new_output = copy.deepcopy(output)
        if "span_info" in new_output:
            new_output["span_info"] = [
                Span(**x) if isinstance(x, dict) else x for x in new_output["span_info"]
            ]
        return new_output


alFee(baseFee, years)
	local totalLeaseCost = baseFee + annualRegistrionFee
	return demandFactor * totalLeaseCost
end

function arns.calculateAnnualRenewalFee(baseFee, years)
	local nameAnnualRegistrationFee = baseFee * constants.ANNUAL_PERCENTAGE_FEE
	local totalAnnualRenewalCost = nameAnnualRegistrationFee * years
	return totalAnnualRenewalCost
end

function arns.calculatePermabuyFee(baseFee, demandFactor)
	local permabuyPrice = baseFee + arns.calculateAnnualRenewalFee(baseFee, constants.PERMABUY_LEASE_FEE_LENGTH)
	return demandFactor * permabuyPrice
end

function arns.calculateRegistrationFee(purchaseType, baseFee, years, demandFactor)
	if purchaseType == "lease" then
		return arns.calculateLeaseFee(baseFee, years, demandFactor)
	elseif purchaseType == "permabuy" then
		return arns.calculatePermabuyFee(baseFee, demandFactor)
	end
end

function arns.calculateUndernameCost(baseFee, increaseQty, registrationType, years, demandFactor)
	local undernamePercentageFee = 0
	if registrationType == "lease" then
		undernamePercentageFee = constants.UNDERNAME_LEASE_FEE_PERCENTAGE
	elseif registrationType == "permabuy" then
		undernamePercentageFee = constants.UNDERNAME_PERMABUY_FEE_PERCENTAGE
	end

	local totalFeeForQtyAndYears = baseFee * undernamePercentageFee * increaseQty * years
	return demandFactor * totalFeeForQtyAndYears
end

function arns.calculateYearsBetweenTimestamps(startTimestamp, endTimestamp)
	local yearsRemainingFloat = math.floor((endTimestamp - startTimestamp) / constants.oneYearMs)
	return yearsRemainingFloat
end

function arns.assertValidBuyRecord(name, years, purchaseType, processId)
	-- assert name is valid pattern
	assert(type(name) == "string", "Name is required and must be a string.")
	assert(#name >= 1 and #name <= 51, "Name pattern is invalid.")
	assert(name:match("^%w") and name:match("%w$") and name:match("^[%w-]+$"), "Name pattern is invalid.")

	-- If 'years' is present, validate it as an integer between 1 and 5
	assert(
		years == nil or (type(years) == "number" and years % 1 == 0 and years >= 1 and years <= 5),
		"Years is invalid. Must be an integer between 1 and 5"
	)

	-- assert purchase type if present is lease or permabuy
	assert(purchaseType == nil or purchaseType == "lease" or purchaseType == "permabuy", "PurchaseType is invalid.")

	-- assert processId is valid pattern
	assert(type(processId) == "string", "ProcessId is required and must be a string.")
	assert(utils.isValidBase64Url(processId), "ProcessId pattern is invalid.")
end

function arns.assertValidExtendLease(record, currentTimestamp, years)
	if not record then
		error("Name is not registered")
	end

	if


nu {
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

.pf-v6-c-menu-toggle {
  max-width: 100%;
}

.pf-v6-c-menu-toggle .pf-c-dropdown__toggle-icon {
  flex: 0 0 auto; // so arrow doesn't shrink
}

.pf-v6-c-dropdown__toggle-text {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  .co-resource-item__resource-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.co-example-docker-command__popover {
  width: 600px;
}

.co-images-stream-tag-timeline {
  font-size: 15px;
  margin: $pf-v6-global-gutter-y $pf-v6-global-gutter-x;
  padding-left: 0;
  width: auto;
  li {
    height: auto;
    list-style: none;
    position: relative;
  }
}

.co-images-stream-tag-timeline__circle-icon,
.co-images-stream-tag-timeline__square-icon {
  color: var(--pf-t--global--border--color--default);
  left: 8px;
  position: relative;
}

.co-images-stream-tag-timeline__info {
  background-color: var(--pf-t--global--background--color--secondary--default);
  border-radius: var(--pf-t--global--border--radius--medium);
  line-height: 30px;
  margin: 8px 0 24px 40px;
  padding: 20px;
  width: 100%;
  & > div:first-of-type {
    font-size: var(--pf-t--global--font--size--sm);
    padding-bottom: 16px;
  }
}

.co-images-stream-tag-timeline__item-row {
  display: flex;
  margin: 2px 0;
}

.co-images-stream-tag-timeline__line {
  border: var(--pf-t--global--border--width--regular) solid
    var(--pf-t--global--border--color--default);
  left: 14px;
  position: relative;
}

.co-images-stream-tag-timeline__timestamp {
  margin-left: 35px;
}
// Addition of specific styles to bring elements into visual likeness with PF
// These are either components we don't currently use or that our current
// markup structure doesn't align with PF so we must apply through targeted css

// Override PF5 font size
:root {
  // Numerical value required
  --pf-v5-global--FontSize--md: 14px; // same as $font-size-base
  --pf-v5-global--FontSize--sm: 13px;
}

:where(:not([class*='pf-v5-c-'])) {
  @at-root button#{&} {
    font-family: var(--pf-t--global--font--family--body);
  }
}

// PatternFly 5 styling for backwards-compatibility with plugins

.pf-v5-c-form-control {
  --pf-v5-c-form-control--ColumnGap: var(--pf-v5-global--spacer--sm);
  --pf-v5-c-form-control--Color: var(--pf-v5-global--Color--100);
  --pf-v5-c-form-control--FontSize: var(--pf-v5-global--FontSize--md);
  --pf-v5-c-form-control--LineHeight: var(--pf-v5-global--LineHeight--md);
  --pf-v5-c-form-control--Resize: none;
  --pf-c-form-control--BorderTopColor: var(--pf-v5-global--BorderColor--300);
  --pf-c-form


 transcript_id "
               "\"ENST00000456328\";exon_number \"2\"; gene_name \"GeneA\"; "
               "gene_source \"ensembl_havana\"; gene_biotype \"pseudogene\"; "
               "transcript_name \"DDX11L1-002\"; transcript_source "
               "\"havana\"; "
               "exon_id \"ENSE00003582793\";\n"
            << std::endl;
        gtf << "1\tprocessed_transcript\texon\t121\t126\t.\t+\t.\tgene_id "
               "\"ES123\"; transcript_id "
               "\"ENST00000456328\";exon_number \"2\"; gene_name \"GeneB\"; "
               "gene_source \"ensembl_havana\"; gene_biotype \"pseudogene\"; "
               "transcript_name \"DDX11L1-002\"; transcript_source "
               "\"havana\"; "
               "exon_id \"ENSE00003582793\";\n"
            << std::endl;
        gtf.close();
        std::ofstream bk("background.full");
        bk << "chr2 133 139" << std::endl;
        bk.close();
        GeneSets prset;
        std::string msigtype = GENERATE("msigdb.full", "msigdb.fail");
        prset.msigdb = {msigtype};
        prset.snp = {"full.snp"};
        prset.gtf = "gtf.full";
        prset.bed = {"full.bed"};
        auto has_background = GENERATE(true, false);
        if (has_background) { prset.background = "background.full:range"; }
        prset.feature = {"CDS", "gene", "exon"};
        Region region(prset, &report);
        if (msigtype != "msigdb.fail")
        {
            REQUIRE(region.generate_regions(snp_list_idx, snp_list, 22)
                    == 2 + 4);
            auto name = region.get_names();
            REQUIRE_THAT(name, Catch::UnorderedEquals<std::string>(
                                   {"full.bed", "SNP_Set", "SNP_set2", "Base",
                                    "Background", "KEGG"}));
            // base
            // backgroud(if use: " chr2 133 139")
            // chr1 122 124
            // 1 3 4
            // 7 8 10
            // chr1 12613  12621
            // chr1 121 126
            auto gene_sets = region.get_gene_sets();
            std::vector<size_t> out;
            const size_t BACKGROUND_IDX = 1, BED_IDX = 2, SNP_SET = 3,
                         SNP_SET2 = 4, MSIGDB = 5;
            if (has_background)
            {
                REQUIRE(gene_sets.size() > 2);
                for (size_t i = 133; i <= 139; ++i)
                {
                    REQUIRE(gene_sets[2].has_overlap(i, out));
                    REQUIRE_THAT(out, Catch::Equals<size_t>({BACKGROUND_IDX}));
                }
                REQUIRE_FALSE(gene_sets[2].has_overlap(132, out));
                REQUIRE_FALSE(gene_sets[2].has_overlap(140, out));
            }
            REQUIRE(gene_sets.size() > 3);
            REQUIRE(gene_sets[3].has_overlap(334, out));
            REQUIRE_THAT(out, Catch::Equals<size_t>({BED_IDX}));
            for (size_t i = 123; i <= 124; ++i)
            {
                REQUIRE(gene_sets[1].has_overlap(i, out));
                if (has_background)
                {
                    REQUIRE_THAT(out, Catch::Equals<size_t>({BED_IDX, MSIGDB}));


h1>Hello
' // template inline
                /* `

                      Hello

` */
})
export class AppComponent { // classe do componente

  students: Student[] = [
    { name: 'Luke', isJedi: true, temple: 'Coruscant' },
    { name: 'Han Solo', isJedi: false },
    { name: 'Leia', isJedi: false }
  ]

  // luke = { name: 'Luke', isJedi: true, temple: 'Coruscant' }
  // han = { name: 'Han Solo', isJedi: false }
  // leia = { name: 'Leia', isJedi: false }
}
import { IDonation, IDonationSummary } from "./donations";

const DONATIONS_CACHE_START = `

`;

export function getDonationsFromBody(body: string): Array<IDonation> {
  try {
    const fromStart = body.split(DONATIONS_CACHE_START.trim())[1];
    const cache = fromStart.split(DONATIONS_CACHE_END.trim())[0];
    const donations = JSON.parse(cache);
    console.log("extracted donations from body", donations);
    return donations;
  } catch (err) {
    console.warn("error extracting donations from body", err);
    return [];
  }
}

export function renderDonations(donations?: IDonationSummary): string {
  return `
**Feature Bounty**

${renderDonationsSummary(donations)}

[Place a bounty](https://www.rpwhale.online) to get this feature done!
Higher bounty features get done first and faster.

${DONATIONS_CACHE_START}
${JSON.stringify(donations || [])}
${DONATIONS_CACHE_END}
  `;
}

export function renderDonationsSummary(donations?: IDonationSummary): string {
  if (!donations) {
    return "";
  }

  return `
- ${donations.donations.length} donations totaling **${donations.wax} wax**

Donators:

${donations.donations
  .map(({ from, wax }) => `- ${from} donated ${wax} wax`)
  .join("\n")}
`;
}

declare var N: any;
export class Normalizer {
	n: number[];
	mean: number[];
	meanDiff: number[];
	variance: number;

	constructor(nbInputs: number) {
		this.n = N.zeros(nbInputs);
		this.mean = N.zeros(nbInputs);
		this.meanDiff = N.zeros(nbInputs);
		this.variance = N.zeros(nbInputs);
	}

	observe(x:number[]) {
		this.n = N.add(this.n, 1.0);
		const lastMean = N.clone(this.mean);
		this.mean = N.add(this.mean, N.div(N.sub(x, this.mean), this.n));
		this.meanDiff = N.add(this.meanDiff,
			N.mul(N.sub(x, lastMean), N.sub(x, this.mean)));
		this.variance = N.clip(N.div(this.meanDiff, this.n), 1e-2);
	}

	normalize(inputs:number[]) {
		const obsMean = this.mean;
		const obsStd = N.sqrt(this.variance);
		return N.div(N.sub(inputs, obsMean), obsStd);
	}
}

import 'reflect-metadata';
import {SimpleChange, enableProdMode} from 'angular2/core';
import {CheckInput} from './input';
import * as check from './assertions';

class Test{
  @CheckInput(check.isBoolean) value: any;

  ngOnInit(){ }
  ngOnChanges(change: { [name: string]: SimpleChange }){ }
}

function call(instance: Test, fnName: string, arg?: any){
  return function(){
    instance[fnName](arg);
  };
}

function change(prop: string, value: any): { [name: string]: SimpleChange }{
  return { [prop


 .author__avatar,
  .author__content,
  .author__urls-wrapper,
  .nav__list,
  .sidebar,
  .adsbygoogle {
    display: none !important;
    height: 1px !important;
  }
}/* ==========================================================================
   Dirt skin
   ========================================================================== */

/* Colors */
$background-color: #f3f3f3 !default;
$text-color: #343434 !default;
$muted-text-color: #8e8b82 !default;
$primary-color: #343434 !default;
$border-color: #e9dcbe !default;
$footer-background-color: #e9dcbe !default;
$link-color: #343434 !default;
$masthead-link-color: $text-color !default;
$masthead-link-color-hover: $text-color !default;
$navicon-link-color-hover: mix(#fff, $text-color, 80%) !default;

/* dirt syntax highlighting (base16) */
$base00: #231e18 !default;
$base01: #302b25 !default;
$base02: #48413a !default;
$base03: #9d8b70 !default;
$base04: #b4a490 !default;
$base05: #cabcb1 !default;
$base06: #d7c8bc !default;
$base07: #e4d4c8 !default;
$base08: #d35c5c !default;
$base09: #ca7f32 !default;
$base0a: #e0ac16 !default;
$base0b: #b7ba53 !default;
$base0c: #6eb958 !default;
$base0d: #88a4d3 !default;
$base0e: #bb90e2 !default;
$base0f: #b49368 !default;
.spinner {
  color: gray;
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
  transform: scale(0.3) translateX(-95px);
}
.spinner div {
  transform-origin: 40px 40px;
  animation: spinner 1.2s linear infinite;
}
.spinner div:after {
  content: " ";
  display: block;
  position: absolute;
  top: 3px;
  left: 37px;
  width: 6px;
  height: 20px;
  border-radius: 20%;
  background: black;
}
.spinner div:nth-child(1) {
  transform: rotate(0deg);
  animation-delay: -1.1s;
}
.spinner div:nth-child(2) {
  transform: rotate(30deg);
  animation-delay: -1s;
}
.spinner div:nth-child(3) {
  transform: rotate(60deg);
  animation-delay: -0.9s;
}
.spinner div:nth-child(4) {
  transform: rotate(90deg);
  animation-delay: -0.8s;
}
.spinner div:nth-child(5) {
  transform: rotate(120deg);
  animation-delay: -0.7s;
}
.spinner div:nth-child(6) {
  transform: rotate(150deg);
  animation-delay: -0.6s;
}
.spinner div:nth-child(7) {
  transform: rotate(180deg);
  animation-delay: -0.5s;
}
.spinner div:nth-child(8) {
  transform: rotate(210deg);
  animation-delay: -0.4s;
}
.spinner div:nth-child(9) {
  transform: rotate(240deg);
  animation-delay: -0.3s;
}
.spinner div:nth-child(10) {
  transform: rotate


ပြားစေသော အခြေခံအယူအဆများအပေါ် အခြေခံထားသည်-

- **Open Source First**: သုတေသနနှင့် စီးပွားရေးအတွက် ထင်ရှားမှုနှင့် ရရှိနိုင်မှု
- **Comprehensive Training**: ဘာသာစကားများနှင့် နယ်ပယ်များစွာကို လွှမ်းခြုံထားသော အကြီးစား၊ မတူကွဲပြားသော dataset များပေါ်တွင် လေ့ကျင့်ခြင်း
- **Scalable Architecture**: ကွန်ပျူတာလိုအပ်ချက်များကို ကိုက်ညီစေရန် မော်ဒယ်အရွယ်အစားများစွာ
- **Specialized Excellence**: အထူးကျွမ်းကျင်မှုအတွက် နယ်ပယ်အလိုက် မော်ဒယ်အမျိုးအစားများ

## Qwen မိသားစုကို ပံ့ပိုးပေးသော အဓိကနည်းပညာများ

### Massive Scale Training

Qwen မိသားစု၏ အဓိကအချက်တစ်ခုမှာ မော်ဒယ်ဖွံ့ဖြိုးရေးအတွက် dataset များနှင့် ကွန်ပျူတာအရင်းအမြစ်များကို အကြီးစားအတိုင်းအတာဖြင့် ရင်းနှီးမြှုပ်နှံထားခြင်းဖြစ်သည်။ Qwen မော်ဒယ်များသည် ဘာသာစကားများစွာကို လွှမ်းခြုံထားသော dataset များကို သေချာစွာရွေးချယ်ထားပြီး ထောင်ပေါင်းများစွာသော to


    end
  end
end)

-- mana
local lastMana = 0
macro(500, function()
  if config.manaInfo and BotServer._websocket then
    if manapercent() ~= lastMana then
      lastMana = manapercent()
      BotServer.send("mana", {mana=lastMana})
    end
  end
end)

-- vocation
if config.vocation and BotServer._websocket then
  BotServer.send("voc", player:getVocation())
  BotServer.send("voc", "yes")
end

addSeparator()


streamp">z_streamp strm);

     All dynamically allocated data structures for this stream are freed.
   This function discards any unprocessed input and does not flush any
   pending output.

     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
   was inconsistent. In the error case, msg may be set but then points to a
   static string (which must not be deallocated).

 Advanced functions

    The following functions are needed only in some special applications.

 Function list

  int  deflateInit2 (z_streamp strm,

 int  deflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt  dictLength);

 int  deflateCopy (z_streamp dest, z_streamp source);

 int  deflateReset (z_streamp strm);

 int  deflateParams (z_streamp strm, int level, int strategy);

 int  inflateInit2 (z_streamp strm, int  windowBits);

  int  inflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt  dictLength);

 int  inflateSync (z_streamp strm);

 int  inflateReset (z_streamp strm);

 Function description

  int  deflateInit2 (z_streamp strm, int  level, int  method, int  windowBits, int  memLevel, int  strategy);

 This is another version of deflateInit with more compression options. The
   fields next_in, zalloc, zfree and opaque must be initialized before by
   the caller.

     The method parameter is the compression method. It must be Z_DEFLATED in
   this version of the library.

     The windowBits parameter is the base two logarithm of the window size
   (the size of the history buffer).  It should be in the range 8..15 for this
   version of the library. Larger values of this parameter result in better
   compression at the expense of memory usage. The default value is 15 if
   deflateInit is used instead.

     The memLevel parameter specifies how much memory should be allocated
   for the internal compression state. memLevel=1 uses minimum memory but
   is slow and reduces compression ratio ;


-width'] {
    width: 35px;
    height: 9px;
    font-size: 10px;
  }
  & [name='font-size'] {
    width: 40px;
    height: 9px;
    font-size: 10px;
  }
  & [name='font-family'] {
    width: 90px;
    height: 16px;
    font-size: 10px;
  }
  & [name='d'] {
    width: 120px;
    height: 9px;
    font-size: 10px;
  }
}
html {
    height: 100%;
}

.page {
    background-color: #fefefe;
    /* http://cssfontstack.com/ */
    font: 14px 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 8px;
    height: 100%;
    box-sizing: border-box;
}

.page_layout_list {
    /* http://lea.verou.me/css3patterns/#horizontal-stripes */
    background-image: -webkit-linear-gradient(transparent 50%, #eee 50%);
    background-size: 66px 66px;
}

.holder {
    position: relative;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    border: 8px dashed #ddd;
    -webkit-transition: border-color .2s linear;
}

.page_layout_list .holder {
    display: none;
}

.holder_state_hover {
    border-color: #bbb;
}

.holder__call {
    font-size: 24px;
    line-height: 32px;
    color: #bbb;
    text-align: center;
    position: absolute;
    width: 100%;
    top: 50%;
    margin-top: -16px;
}

.list {
    width: 100%;
    border-collapse: collapse;
}

.page_layout_holder .list {
    display: none;
}

.list__header {
    text-align: left;
}

.list__header {
    padding: 0 10px 8px;
    white-space: nowrap;
}

.item_error_yes {
    background: #ff8f8f;
}

.item__cell {
    padding: 8px 10px;
    white-space: nowrap;
}

.item__cell_type_name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list__header_type_profit,
.item__cell_type_profit {
    text-align: right;
}
/*!
 * Bootstrap v2.0.4
 *
 * Copyright 2012 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world @twitter by @mdo and @fat.
 * Modified by Sendy https://sendy.co
 */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
  display: block;
}
audio,
canvas,
video {
  display: inline-block;
  *display: inline;
  *zoom: 1;
}
audio:not([controls]) {
  display: none;
}
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}
a:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
a:hover,
a:active {
  outline: 0;
}
sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}
sup {
  top: -0.5em;
}
sub {
  bottom: -0.25em;
}
img {
  max-width: 100%;
  vertical


trieve & process value based on key
// - Iterate over key/value pair
// - Updating data
fn main() {
    let mut name_age = HashMap::new();
    let first = String::from("Proful");
    let second = String::from("Kenny");
    name_age.insert(first, 30);
    name_age.insert(second, 22);

    dbg!(&name_age);
    // dbg!(first);

    let first_key = String::from("Proful1");
    let first_val = name_age.get(&first_key);

    match first_val {
        Some(val) => println!("val = {}", val),
        None => println!("Key not found"),
    }

    for (key, val) in &name_age {
        println!("({}, {})", key, val);
    }

    // updating by overwriting
    let first = String::from("Proful");
    name_age.insert(first, 500);
    dbg!(&name_age);

    let first = String::from("Proful");
    name_age.entry(first).or_insert(300);

    let third = String::from("Steve");
    name_age.entry(third).or_insert(60);
    dbg!(&name_age);

}

// HashMap<K, V>
// hashing fn => decides how it places keys & values into memory<gh_stars>0
#[cfg(all(feature = "fresh_bindings", feature = "mysql", not(feature = "mariadb")))]
mod constants {
    pub(crate) const FILE_NAME: &str = "src/mysql.rs";
    pub(crate) const BINDGEN_EXTRA_CLANG_ARGS: &str = r#"-I"/usr/include/mysql""#;
}

#[cfg(all(feature = "fresh_bindings", feature = "mariadb", not(feature = "mysql")))]
mod constants {
    pub(crate) const FILE_NAME: &str = "src/mariadb.rs";
    pub(crate) const BINDGEN_EXTRA_CLANG_ARGS: &str = r#"-I"/usr/include/mariadb""#;
}

fn main() {
    #[cfg(all(feature = "fresh_bindings", feature = "bindgen"))]
    build();
}

#[cfg(any(
    all(not(feature = "fresh_bindings"), feature = "bindgen"),
    all(feature = "fresh_bindings", not(feature = "bindgen"))
))]
compile_error!("Features `fresh_bindings` and `bindgen` must be enabled ONLY together!");

#[cfg(all(feature = "fresh_bindings", feature = "bindgen"))]
fn build() {
    use std::env;
    use std::path::PathBuf;

    // Tell cargo to tell rustc to link the mysql or mariadb shared library.
    println!("{}", format!("cargo:rustc-link-lib={}", "mysqlclient"));

    // Tell cargo to invalidate the built crate whenever the wrapper changes
    println!("cargo:rerun-if-changed=wrapper.h");

    println!("cargo:rerun-if-changed=build.rs");

    std::env::set_var("BINDGEN_EXTRA_CLANG_ARGS", constants::BINDGEN_EXTRA_CLANG_ARGS);

    // The bindgen::Builder is the main entry point to bindgen,
    // and lets you build up options for the resulting bindings.
    let bindings = bindgen::Builder::default()
        // The input header we would like to generate bindings for.
        .header("wrapper.h")
        // Tell cargo to invalidate the built crate whenever any of the included header files changed.
        .parse_callbacks(Box::new(bindgen::CargoCallbacks))
        // reformat bindings with rustfmt
        .rustfmt_bindings(true)
        .rustfmt_configuration_file(Some("./rustfmt.toml".into()))
        // Finish the builder and generate the bindings.
        .generate()
        // Unwrap the Result and panic on failure.
        .expect


determinate indicator
 * @csspart indeterminate - The indeterminate indicator
 *
 * @public
 */
class BaseProgress extends FoundationElement {
    constructor() {
        super(...arguments);
        /**
         * Indicates progress in %
         * @internal
         */
        this.percentComplete = 0;
    }
    valueChanged() {
        if (this.$fastController.isConnected) {
            this.updatePercentComplete();
        }
    }
    minChanged() {
        if (this.$fastController.isConnected) {
            this.updatePercentComplete();
        }
    }
    maxChanged() {
        if (this.$fastController.isConnected) {
            this.updatePercentComplete();
        }
    }
    /**
     * @internal
     */
    connectedCallback() {
        super.connectedCallback();
        this.updatePercentComplete();
    }
    updatePercentComplete() {
        const min = typeof this.min === "number" ? this.min : 0;
        const max = typeof this.max === "number" ? this.max : 100;
        const value = typeof this.value === "number" ? this.value : 0;
        const range = max - min;
        this.percentComplete =
            range === 0 ? 0 : Math.fround(((value - min) / range) * 100);
    }
}
__decorate([
    attr({ converter: nullableNumberConverter })
], BaseProgress.prototype, "value", void 0);
__decorate([
    attr({ converter: nullableNumberConverter })
], BaseProgress.prototype, "min", void 0);
__decorate([
    attr({ converter: nullableNumberConverter })
], BaseProgress.prototype, "max", void 0);
__decorate([
    attr({ mode: "boolean" })
], BaseProgress.prototype, "paused", void 0);
__decorate([
    observable
], BaseProgress.prototype, "percentComplete", void 0);

;// CONCATENATED MODULE: ../node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js

/**
 * The template for the {@link @microsoft/fast-foundation#BaseProgress} component.
 * @public
 */
const progressTemplate = (context, defintion) => html `
    <template
        role="progressbar"
        aria-valuenow="${x => x.value}"
        aria-valuemin="${x => x.min}"
        aria-valuemax="${x => x.max}"
        class="${x => (x.paused ? "paused" : "")}"
    >
        ${when(x => typeof x.value === "number", html `

 x.percentComplete}%"
                    >

            `, html `

                    <slot class="indeterminate" name="indeterminate">
                        ${defintion.indeterminateIndicator1 || ""}
                        ${defintion.indeterminateIndicator2 || ""}
                    </slot>

            `)}
    </template>
`;

;// CONCATENATED MODULE: ../node_modules/@jupyter/web-components/dist/esm/progress/progress.styles.js
// Copyright (c) Jupyter Development Team.
// Copyright (c) Microsoft Corporation.
// Distributed under the terms of the Modified BSD License.

/**
 * Styles for Progress
 * @public
 */
const progressStyles = (context, definition) => css `
    ${display('flex')} :host {
      align-items: center;
      outline: none;
      height: calc(${designUnit} * 1px);
      margin: calc(${designUnit} * 1px) 0;
    }


QueryInterface(mRules);
  RemoveEditActionListener(mListener);

  //the autopointers will clear themselves up.
  //but we need to also remove the listeners or we have a leak
  nsCOMPtr<nsISelection>selection;
  nsresult result = GetSelection(getter_AddRefs(selection));
  // if we don't get the selection, just skip this
  if (NS_SUCCEEDED(result) && selection)
  {
    nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
    nsCOMPtr<nsISelectionListener>listener;
    listener = do_QueryInterface(mTypeInState);
    if (listener)
    {
      selPriv->RemoveSelectionListener(listener);
    }
    listener = do_QueryInterface(mSelectionListenerP);
    if (listener)
    {
      selPriv->RemoveSelectionListener(listener);
    }
  }

  mTypeInState = nullptr;
  mSelectionListenerP = nullptr;

  // free any default style propItems
  RemoveAllDefaultProperties();

  if (mLinkHandler && mDocWeak)
  {
    nsCOMPtr<nsIPresShell> ps = GetPresShell();

    if (ps && ps->GetPresContext())
    {
      ps->GetPresContext()->SetLinkHandler(mLinkHandler);
    }
  }

  RemoveEventListeners();
}

void
nsHTMLEditor::HideAnonymousEditingUIs()
{
  if (mAbsolutelyPositionedObject)
    HideGrabber();
  if (mInlineEditedCell)
    HideInlineTableEditingUI();
  if (mResizedObject)
    HideResizers();
}

NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLEditor)

NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTypeInState)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTextServices)

  tmp->HideAnonymousEditingUIs();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END

NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTypeInState)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTextServices)

  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTopLeftHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTopHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTopRightHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mLeftHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRightHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBottomLeftHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBottomHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBottomRightHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mActivatedHandle)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mResizingShadow)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mResizingInfo)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mResizedObject)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE


tems...)

	return ses, nil
}

func serviceEntryExists(seList []istiov1beta1.ServiceEntry, e kubeslicev1beta1.ServiceEndpoint) bool {
	for _, se := range seList {
		if len(se.Spec.Hosts) > 0 && se.Spec.Hosts[0] == e.DNSName {
			return true
		}
	}

	return false
}

func servicesEntriesToDelete(seList []istiov1beta1.ServiceEntry, si *kubeslicev1beta1.ServiceImport) []istiov1beta1.ServiceEntry {

	exists := struct{}{}
	dnsSet := make(map[string]struct{})
	toDelete := []istiov1beta1.ServiceEntry{}

	for _, e := range si.Status.Endpoints {
		dnsSet[e.DNSName] = exists
	}

	for _, si := range seList {
		if _, ok := dnsSet[si.Spec.Hosts[0]]; !ok {
			toDelete = append(toDelete, si)
		}
	}

	return toDelete
}

func (r *Reconciler) DeleteIstioServiceEntries(ctx context.Context, serviceimport *kubeslicev1beta1.ServiceImport) error {
	entries, err := getServiceEntriesForSI(ctx, r.Client, serviceimport, controllers.ControlPlaneNamespace)
	if err != nil {
		if errors.IsNotFound(err) {
			return nil
		}

		return err
	}

	for _, se := range entries {
		err = r.Delete(ctx, &se)
		if err != nil {
			return nil
		}
	}

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

package slice

import (
	"context"
	"fmt"
	"os"
	"time"

	ossEvents "github.com/kubeslice/worker-operator/events"

	kubeslicev1beta1 "github.com/kubeslice/worker-operator/api/v1beta1"
	nsmv1 "github.com/networkservicemesh/sdk-k8s/pkg/tools/k8s/apis/networkservicemesh.io/v1"

	"github.com/kubeslice/worker-operator/controllers"
	"github.com/kubeslice/worker-operator/pkg/logger"
	"github.com/kubeslice/worker-operator/pkg/utils"
	webhook "github.com/kubeslice/worker-operator/pkg/webhook/pod"
	appsv1 "k8s.io/api/apps/v1"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/types"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

const (
	nsmDataplaneVpp                 string = "vpp"
	nsmDataplaneKernel              string = "kernel"
	nsmVppDataplaneCfgStr           string = "nsm-vpp-plane"
	nsmKernelDataplaneCfgStr        string = "nsm-kernel-plane"
	sliceRouterDeploymentNamePrefix string = "vl3-


(a.d)-0.5)*0.1,CT()*0.1+0.1,0.0);GH(h, -a.D*3.1415927410125732/180.0);F6(h, -a.v*3.1415927410125732/180.0);d=Cw(a.m.fC,(G(a.d)-0.5)*0.3, -G(a.d)*0.6-0.3,0.6);GH(d, -a.D*3.1415927410125732/180.0);F6(d, -a.v*3.1415927410125732/180.0);d=IM(d,a.e,a.i+a.gW(),a.f);i=a.m;j=new M;N(j);E(j,B(1333));Bk(j,Cz(b).w);j=L(j);k=d.I;l=d.G;m=d.H;n=h.I;o=h.G+0.05;p=h.H;$p=3;continue _;case 2:a.mV(b,e,f);if(C()){break _;}return;case 3:B1N(i,j,k,l,m,n,o,p);if(C()){break _;}g=g+1|0;if(g>=c){b=B(1338);e
=0.5+0.5*Bf(a.d,2);f=(G(a.d)-G(a.d))*0.20000000298023224+1.0;$p=2;continue _;}h=Cw(a.m.fC,(G(a.d)-0.5)*0.1,CT()*0.1+0.1,0.0);GH(h, -a.D*3.1415927410125732/180.0);F6(h, -a.v*3.1415927410125732/180.0);d=Cw(a.m.fC,(G(a.d)-0.5)*0.3, -G(a.d)*0.6-0.3,0.6);GH(d, -a.D*3.1415927410125732/180.0);F6(d, -a.v*3.1415927410125732/180.0);d=IM(d,a.e,a.i+a.gW(),a.f);i=a.m;j=new M;N(j);E(j,B(1333));Bk(j,Cz(b).w);j=L(j);k=d.I;l=d.G;m=d.H;n=h.I;o=h.G+0.05;p=h.H;continue _;default:Sj();}}IN().s(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,$p);}
function BGh(a){var b,c,$p,$z;$p=0;if(Sv()){var $T=IN();$p=$T.l();c=$T.l();b=$T.l();a=$T.l();}_:while(true){switch($p){case 0:if(a.mN===null)return;b=a.mN;c=16;$p=1;case 1:a:{B1B(a,b,c);if(C()){break _;}c=a.mN.r;b=BIg(a.mN,a.m,a);if(b===a.mN){if(b===null)break a;if(b.r==c)break a;}a.K.cE.data[a.K.dg]=b;if(!b.r)a.K.cE.data[a.K.dg]=null;}WP(a);return;default:Sj();}}IN().s(a,b,c,$p);}
function BCA(a,b){var $p,$z;


cription='Demo for multilingual antonym detection')
    parser.add_argument('--language', type=str, required=True,
                      help='Language to use (e.g., german, spanish, french)')
    parser.add_argument('--config', type=str,
                      default='config/language_config.yaml',
                      help='Path to configuration file')
    parser.add_argument('--model_dir', type=str,
                      default='assets',
                      help='Directory containing trained models')
    parser.add_argument('--mode', type=str, choices=['interactive', 'batch'],
                      default='interactive',
                      help='Demo mode: interactive or batch testing')
    parser.add_argument('--word1', type=str, help='First word for single prediction')
    parser.add_argument('--word2', type=str, help='Second word for single prediction')

    args = parser.parse_args()

    try:
        # Initialize detector
        detector = AntonymDetector(args.language, args.config, args.model_dir)

        if args.word1 and args.word2:
            # Single prediction
            result = detector.predict(args.word1, args.word2)
            print(f"Prediction for '{args.word1}' and '{args.word2}':")
            print(f"  Antonym: {'Yes' if result['is_antonym'] else 'No'}")
            print(f"  Confidence: {result['confidence']:.3f}")
            print(f"  Model: {result['model']}")
        elif args.mode == 'interactive':
            # Interactive mode
            run_interactive_demo(detector)
        else:
            # Batch testing mode
            run_batch_test(detector, args.language)

    except Exception as e:
        print(f"Error: {e}")
        return 1

    return 0

if __name__ == "__main__":
    exit(main())


(r4)))
        Assertions.assertEquals(false, (g2.getRegCell(r2) == g2.getRegCell(r4)))
        Assertions.assertEquals(false, (g1.getRegCell(r2) == g1.getRegCell(r4)))

        sbfLogger.info {
            "##After r2:= r4##\n" +
                "absVal1=\n" +
                "$absVal1\n" +
                "absVal2=\n" +
                "$absVal2\n" +
                "absVal3=\n" +
                "$absVal3"
        }
    }

    //@Test
    /** This test is expected to throw an exception **/
    fun test4() {
        println("====== TEST 4 =======")
        val r10 = Value.Reg(SbfRegister.R10_STACK_POINTER)
        val r1 = Value.Reg(SbfRegister.R1_ARG)

        val absVal1 = MemoryDomain(nodeAllocator, sbfTypesFac, true)
        val stack1 = absVal1.getRegCell(r10, newGlobalVariableMap())
        check(stack1 != null) { "memory domain cannot find the stack node" }
        stack1.getNode().mkLink(0, 4, stack1.concretize())

        val absVal2 = absVal1.deepCopy()
        val stack2 = absVal2.getRegCell(r10, newGlobalVariableMap())
        check(stack2 != null) { "memory domain cannot find the stack node" }
        sbfLogger.info {
            "\n" +
                "absVal1=\n" +
                "$absVal1\n" +
                "absVal2=\n" +
                "$absVal2"
        }

        PTANode.smash(stack1.getNode())

        sbfLogger.info {
            "##After smashing stack in AbsVal1##\n" +
                "absVal1=\n" +
                "$absVal1\n" +
                "absVal2=\n" +
                "$absVal2"
        }

        PTANode.smash(stack2.getNode())

        sbfLogger.info {
            "##After smashing stack in AbsVal2##\n" +
                "absVal1=\n" +
                "$absVal1\n" +
                "absVal2=\n" +
                "$absVal2"
        }
        val c1 = absVal2.getRegCell(r1, newGlobalVariableMap())
        check(c1 != null)
        val c2 = absVal2.getRegCell(r10, newGlobalVariableMap())
        check(c2 != null)
        c1.concretize().unify(c2.concretize())

        sbfLogger.info {
            "##After unifying r1 and r10 in AbsVal2##\n" +
                "absVal1=\n" +
                "$absVal1\n" +
                "absVal2=\n" +
                "$absVal2"
        }

        val absVal3 = absVal1.join(absVal2)
        sbfLogger.info {
            "##After absVal3 := join(absVal1, absVal2)##\n" +
                "absVal1=\n" +
                "$absVal1\n" +
                "absVal2=\n" +
                "$absVal2\n" +
                "absVal3=\n" +
                "$absVal3"
        }

        Assertions.assertEquals(true, absVal1.lessOrEqual(absVal3))
        Assertions.assertEquals(true, absVal2.lessOrEqual(absVal3))

    }

    @Test
    fun test5() {
        println("====== TEST 5 (JOIN) =======")
        val r10 = Value.Reg(SbfRegister.R10_STACK_POINTER)
        val r1 = Value.Reg(SbfRegister.R1_ARG)

        val a


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

import android.content.Context
import android.text.Html
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.devs.readmoreoption.ReadMoreOption

/**
 * Created by ${Deven} on 6/2/18.
 */
internal class MyAdapter internal constructor(private val context: Context) :
    RecyclerView.Adapter<MyAdapter.ViewHolder>() {

    private val readMoreOption: ReadMoreOption

    // Provide a reference to the views for each data item
    // Complex data items may need more than one view per item, and
    // you provide access to all the views for a data item in a view holder
    internal class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
        // each data item is just a string in this case
        var mTextView: TextView

        init {
            mTextView = v.findViewById(R.id.tv)
        }
    }

    // Create new views (invoked by the layout manager)
    override fun onCreateViewHolder(
        parent: ViewGroup,
        viewType: Int
    ): ViewHolder {
        // create a new view
        val v = LayoutInflater.from(parent.context)
            .inflate(R.layout.item_view, parent, false) as View
        return ViewHolder(v)
    }

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        if (position % 2 == 0) {
            readMoreOption.addReadMoreTo(
                holder.mTextView,
                Html.fromHtml(context.getString(R.string.dummy_text))
            )
        } else {
            readMoreOption.addReadMoreTo(
                holder.mTextView,
                Html.fromHtml(context.getString(R.string.dummy_text)).toString()
            )
        }
    }

    // Return the size of your dataset (invoked by the layout manager)
    override fun getItemCount(): Int {
        return 20
    }

    init {
        readMoreOption = ReadMoreOption.Builder(context)
            .build()
    }
}package io.devexpert.composerecompositions.ui.screens

import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowUp
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import io.devexpert.composerecompositions.data.buildMovies
import io.devexpert.composerecompositions.ui.screens.shared.Screen
import io.devexpert.composerecompositions.ui.screens.shared.TopBar
import io.devexpert.composerecompositions.ui.screens.shared.TopBarAction
import kotlinx.coroutines.launch

@Composable
fun DerivedState() {

    val scope = rememberCoroutineScope()
    val lazyState = rememberLazyListState()
    val showScrollToTop by remember { derivedStateOf { lazyState.firstVisibleItemIndex > 0 } }

    Screen {
        Scaffold(
            topBar = {
                TopBar("Derived State") {


шалгаарай.","InviteManager.email":"Э-мэйл","InviteManager.noResults":"Илэрц олдсонгүй","InviteManager.resendInvite":"Урилга дахин илгээх","InviteManager.revokeInvite":"Урилгыг хүчингүй болгох","InviteManager.role":"Үүрэг","InviteReferralModal.activateReferralError":"Лавлах урилгыг хүлээн авч чадсангүй. Дахин оролдоно уу.","InviteReferralModal.clickToActivateString":"chat.openai.com/invite/<codeStyle>•••••••</codeStyle>","InviteReferralModal.clickToCopyString":"Товшоод хуулах","InviteReferralModal.copiedReferralToastMessage":"Таны лавлах {referralInviteCode} холбоосыг санах самбар руу хуулсан байна. Үүнийг найзуудтайгаа хуваалцаарай!","InviteReferralModal.inviteDescription":"ChatGPT Plus-ийг найзуудтайгаа хуваалцаарай!","InviteReferralModal.inviteDescriptionFollowUp":"Доорх лавлах холбоосыг идэвхжүүлж, хуулж аван ChatGPT Plus-ийг найзуудтайгаа хуваалцаж, тэдэнд үнэгүй туршилтын эрх олгоорой!","InviteReferralModal.inviteFormTitle":"Э-мэйлүүд","InviteReferralModal.invitePlaceholder":"friend@openai.com, friend2@openai.com...","InviteReferralModal.inviteRemaining":"{remainingInviteCount} боломжтой","InviteReferralModal.modalTitle":"Найздаа хандаарай","InviteReferralModal.referralActivate":"Хуулах","InviteReferralModal.referralClaimed":"Шаардсан","InviteReferralModal.referralCodeLabel":"Холбооснууд","InviteReferralModal.referralCopied":"Хуулсан","InviteReferralModal.referralCopy":"Хуулах","InviteReferralModal.sendInviteCta":"Урилга илгээх","InviteReferralModal.usersInvited":"<showcaseValue>{usersInviteCount}</showcaseValue><description>хэрэглэгч </description>-г урьсан","IR+p6G":"Чатлах холбоосыг хуваалцах","Isulib":"{legendItems}-д","izTv5G":"{modelName} рүү хандах хязгаарлагдмал эрх","JcA4/t":"Ангилал","jitPluginMessage.allow":"Зөвшөөрөх","jitPluginMessage.alwaysAllow":"Үргэлж зөвшөөрөх","jitPluginMessage.confirm":"Баталгаажуулах","jitPluginMessage.confirming.simple":"{gizmoName} нь {domain}-тэй ярилцахыг хүсэж байна","jitPluginMessage.confirming.subtitle":"Зөвхөн өөрийнхөө итгэдэг сайтуудыг л зөвшөөр


16:
!$EV trig_pc_d(0,expr(@VA(.MAIN.T0_hwint_816), 16, 16)) -> intp(0, 0, 26)
	.word 0xbc348000  ! 6203: SUBC_R	orn 	%r18, %r0, %r30
	.word 0xfecd8660  ! 6205: LDSBA_R	ldsba	[%r22, %r0] 0x33, %r31
	.word 0xb0b4e185  ! 6206: SUBCcc_I	orncc 	%r19, 0x0185, %r24
T0_dtlb_err_253:
!$EV error (0,expr(@VA(.MAIN.T0_dtlb_err_253),16,16),1,DTLB_DATA,12)
	.word 0xfcec21a8  ! 6208: LDSTUBA_I	ldstuba	%r30, [%r16 + 0x01a8] %asi
	.word 0xff344000  ! 6209: STQF_R	-	%f31, [%r0, %r17]
	.word 0xfe54a04d  ! 6210: LDSH_I	ldsh	[%r18 + 0x004d], %r31
	.word 0xf415c000  ! 6211: LDUH_R	lduh	[%r23 + %r0], %r26
T0_dtlb_err_254:
!$EV error (0,expr(@VA(.MAIN.T0_dtlb_err_254),16,16),1,DTLB_DATA,16)
	.word 0xff1ca110  ! 6213: LDDF_I	ldd	[%r18, 0x0110], %f31
	.word 0xb6bca03d  ! 6213: XNORcc_I	xnorcc 	%r18, 0x003d, %r27
T0_irf_ce_512:
!$EV error(0,expr(@VA(.MAIN.T0_irf_ce_512), 16, 16),1,IRF,ce,26,62, x,x,x, x,x,x)
	.word 0xfacc97a0  ! 6215: LDSBA_R	ldsba	[%r18, %r0] 0xbd, %r29
	.word 0xfcac1520  ! 6215: STBA_R	stba	%r30, [%r16 + %r0] 0xa9
	.word 0xf825a108  ! 6216: STW_I	stw	%r28, [%r22 + 0x0108]
	.word 0xf45d0000  ! 6217: LDX_R	ldx	[%r20 + %r0], %r26
	.word 0xf824602f  ! 6219: STW_I	stw	%r28, [%r17 + 0x002f]
	.word 0xf815a03d  ! 6220: LDUH_I	lduh	[%r22 + 0x003d], %r28
T0_irf_ce_513:
!$EV error(0,expr(@VA(.MAIN.T0_irf_ce_513), 16, 16),1,IRF,ce,35,23, x,x,x, x,x,x)
	.word 0xbb348000  ! 6222: SRL_R	srl 	%r18, %r0, %r29
T0_dtlb_err_255:
!$EV error (0,expr(@VA(.MAIN.T0_dtlb_err_255),16,16),1,DTLB_DATA,11)
	.word 0xf47c608d  ! 6226: SWAP_I	swap	%r26, [%r17 + 0x008d]
	.word 0xbb2cc000  ! 6226: SLL_R	sll 	%r19, %r0, %r29
T0_irf_ce_514:
!$EV error(0,expr


Joel 说，他在大学里上过的最有用的课，是一门他只上了一回、然后就再也没有去过的课。

由于父母都是大学教授，亲戚朋友都是学术界里的，大多有博士学位，所以 Joel 从小就认定自己也会去读博士，将来搞学术。可是，有一门课程改变了他的想法，使他最终没有去报考研究生院。

这门课程叫做”动态逻辑“（Dynamic Logic）。第一堂课上，教授证明了一个命题。假定有一个程序”f := not f“， f 是表示真假的逻辑值，那么结论是程序运行偶数次后，f 的值保持不变。整个证明过程非常冗长，要花几个小时讲解，一共有几十步。课后习题则是，证明如果f 值保持不变，那么程序必然运行了偶数次。

课后，Joel 花了很多时间做题，还去图书馆借来了参考书。但是，他逐渐感到这样做没有意义：用大量琐碎的、容易出错的步骤，去证明一个凭直觉就能认定成立的命题，这不是一个富有实效的工作方法。在 Joel 看来，计算机更应该用来解决错误，而不是让人们陷入逻辑的陷阱，去产生错误。通过这件事，他认识到，自己不适合做纯思辨性的学术研究。因此，他就退掉了这门课，并且以后也没有选择去上研究生院。

Joel 认为，就是这门只上了一次的课，恰恰成为了他在大学中上过的最有用的课，因为它帮助他选择了正确的人生道路。

所以，Joel 的第一个结论是：人生中重要的，是关注那些真正的问题（real problem），而不是陷入那些没有意义的琐碎问题（trivial problem）。就像苏格拉底说的，”认识你自己“。

此外，Joel说，还有一门叫做 CS323 的课，也很有用。这门课有大量的课后习题，都是关于编程的，平均每星期要花40个小时来做题。

Joel 发现他能够做出大部分的题目，更重要的是，他发现自己喜欢做这些题。这样一来，他就明白自己是适合编程的。另一方面，很多其他学生对这门课感到无比头疼，觉得编程既枯燥又痛苦，每周40小时做这种题简直是一种刑罚。这些人于是明白，虽然同样是计算机系的学生，但是他们并不适合编程。这是一件好事，因为这样他们就


cal of [true, false]) {
    let remaining = [...move.tiles];
    while (remaining.length) {
      let tilesInWord;
      [tilesInWord, remaining] = addWordFromTile(
        remaining[0],
        remaining,
        vertical
      );
      if (tilesInWord.length > 1) tileWords.push(tilesInWord);
    }
  }

  const words: ScoredWord[] = [];
  for (const tw of tileWords) {
    let wordMultiple = 1;
    let wordScore = 0;
    let word = "";
    for (const tile of tw) {
      let letterScore = tile.pointValue;
      const bonus =
        move.tiles.some(at => at.id === tile.id) &&
        state.rules.getCellBonus(tile.x, tile.y, state);
      if (bonus) {
        switch (bonus.bonusType) {
          case "letter":
            letterScore *= bonus.multiplier;
            break;
          case "word":
            wordMultiple *= bonus.multiplier;
            break;
          default:
        }
      }
      wordScore += letterScore;
      word = word.concat(tile.letter);
    }
    wordScore *= wordMultiple;
    words.push({
      word,
      score: wordScore,
      valid: state.rules.getWordSet().has(word)
    });
  }

  let totalScore = words.reduce((pv, word) => pv + word.score, 0);

  if (move.tiles.length >= state.rules.traySize)
    totalScore += state.rules.bingoBonus;

  let connectedToBoard = false;

  let sameX = true;
  let sameY = true;
  let minX = state.rules.width,
    maxX = -1,
    minY = state.rules.height,
    maxY = -1;

  for (const [idx, tile] of move.tiles.entries()) {
    if (idx !== 0) {
      const prev = move.tiles[idx - 1];
      sameX = sameX && tile.x === prev.x;
      sameY = sameY && tile.y === prev.y;
    }
    minX = Math.min(minX, tile.x);
    minY = Math.min(minY, tile.y);
    maxX = Math.max(maxX, tile.x);
    maxY = Math.max(maxY, tile.y);

    if (
      tile.x < 0 ||
      tile.x >= state.rules.width ||
      tile.y < 0 ||
      tile.y >= state.rules.height
    ) {
      illegalReasons.push(
        ir(
          IllegalReasonCode.OUTSIDE_BOARD,
          `Cannot place ${tile.letter.toUpperCase()} outside the board`
        )
      );
      continue;
    }

    const sameSquareTile = move.tiles.find(
      (dtile, didx) => didx !== idx && dtile.x === tile.x && dtile.y === tile.y
    );
    if (sameSquareTile)
      illegalReasons.push(
        ir(
          IllegalReasonCode.TILES_ON_SAME_SQUARE,
          `Cannot place ${sameSquareTile.letter.toUpperCase()} and ${tile.letter.toUpperCase()} on the same square`
        )
      );

    connectedToBoard =
      connectedToBoard ||
      [
        tbc[tile.x][tile.y - 1],
        tbc[tile.x][tile.y + 1],
        (tbc[tile.x - 1] || [])[tile.y],
        (tbc[tile.x + 1] || [])[tile.y]
      ].some(t => t && !move.tiles.some(at => at.id === t.id));

    if (!state.rules.allowOverwrite) {
      const overwriteMove: PlayWord | undefined = (x =>
        x && (x.move as PlayWord))(
        state.moves.find(
          mv =>
            mv.move.actionType


ave_regs 1, 31, t4
    lui a4,0xff010
    li  a5, 'x'
    sw a5, 4(a4)
    la  a0, machine_trap_entry
    csrw mtvec, a0

    la    a2, __BSS_START__

    // clear bss
21: la    a1, __BSS_END__
    j     4f
3:  sw    zero, 0(a2)
    add   a2, a2, 4
4:  bne   a1, a2, 3b

    auipc gp, %hi(_gp)
    addi  gp, gp, %lo(_gp)

    // init stack
    la    sp, __C_STACK_TOP__ - TRAP_REGS_SPACE
    csrw  mscratch, sp
    addi  sp, sp, -TRAP_STACK_SPACE
    // init hart0 TLS
    la    a0, _tdata_begin
    la    a2, _tbss_end
    sub   a1, a2, a0
    la    a4, __STACK_START__
    sub   tp, a4, a1
    // init tdata
    mv    a1, tp
    la    a2, _tdata_end
    j     6f
5:  lw    a3, 0(a0)
    sw    a3, 0(a1)
    add   a0, a0, 4
    add   a1, a1, 4
6:  bne   a0, a2, 5b
    // clear tbss
    j     8f
7:  sw    zero, 0(a1)
    add   a1, a1, 4
8:  bne   a1, a4, 7b

9:
    // start main
10: auipc t0, %pcrel_hi(main)
    // init argv=0, argc=0
    li a0, 0
    li a1, 0
    jalr  t0, %pcrel_lo(10b)
    la  t4, _tmp
    load_regs 1, 31, t4
    ret

handle_trap:
halt_loop:
sc_exit:
    wfi
    j     halt_loop

trap_entry:
    //csrrw sp, mscratch, sp
    addi sp, sp, -TRAP_REGS_SPACE

    save_reg 1, sp
    save_regs 3, 31, sp
    addi a0, sp, TRAP_REGS_SPACE
    save_reg_offs a0, 2, sp // save original sp

    csrr s0, mstatus
    //csrr s1, mepc

    csrr a0, mcause
    csrr a1, mepc
    mv a2, sp
1:  auipc t0, %pcrel_hi(handle_trap)
    jalr  t0, %pcrel_lo(1b)

    csrw mstatus, s0
    //csrw mepc, s1

    load_reg 1, sp
    load_regs 3, 31, sp

    //csrrw sp, mscratch, sp // restore original sp
    addi sp, sp, TRAP_REGS_SPACE
    mret


t.assertIsDisplayed
import androidx.compose.ui.test.assertTextEquals
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.test.core.app.ApplicationProvider
import org.junit.Rule
import org.junit.Test
import org.smartregister.fhircore.engine.R

class LoaderViewTest {
  @get:Rule val composeRule = createComposeRule()

  @Test
  fun testLoaderDialogViewSyncingUp() {
    composeRule.setContent {
      LoaderDialog(
        dialogMessage =
          ApplicationProvider.getApplicationContext<Application>().getString(R.string.syncing_up),
      )
    }
    composeRule.onNodeWithTag(LOADER_DIALOG_PROGRESS_BAR_TAG).assertExists()
    composeRule.onNodeWithTag(LOADER_DIALOG_PROGRESS_BAR_TAG).assertIsDisplayed()

    composeRule.onNodeWithTag(LOADER_DIALOG_PROGRESS_MSG_TAG).assertExists()
    composeRule.onNodeWithTag(LOADER_DIALOG_PROGRESS_MSG_TAG).assertIsDisplayed()
    composeRule
      .onNodeWithTag(LOADER_DIALOG_PROGRESS_MSG_TAG)
      .assertTextEquals(
        ApplicationProvider.getApplicationContext<Application>().getString(R.string.syncing_up),
      )
  }
}
/*
 * Copyright 2021-2024 Ona Systems, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.smartregister.fhircore.engine.util.extension

import android.content.Context
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.MediumTest
import com.google.android.fhir.FhirEngine
import com.google.android.fhir.FhirEngineConfiguration
import com.google.android.fhir.FhirEngineProvider
import com.google.android.fhir.search.search
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.runTest
import org.hl7.fhir.r4.model.Patient
import org.hl7.fhir.r4.model.Questionnaire
import org.hl7.fhir.r4.model.Resource
import org.hl7.fhir.r4.model.ResourceType
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Test

@MediumTest
class FhirEngineExtensionKtTest {

  private val context = ApplicationProvider.getApplicationContext<Context>()
  private lateinit var fhirEngine: FhirEngine

  @Before
  fun setUp() {
    FhirEngineProvider.init(FhirEngineConfiguration(testMode = true))
    fhirEngine = FhirEngineProvider.getInstance(context)

    val patients = (0..1000).map { Patient().apply { id = "test-patient-$it" } }
    val questionnaires = (0..3).map { Questionnaire().apply { id = "test-questionnaire-$it" } }
    runBlocking { fhirEngine.create(*patients.toTypedArray(), *questionnaires.toTypedArray()) }
  }

  @After
  fun tearDown() {
    runBlocking { fhirEngine.clearDatabase() }
    FhirEngineProvider.cleanup()
  }

  @Test
  fun test_search_time_searches_sequentially_and_short_running_query_waits() = runTest {
    val fetchedResources = mutableListOf<Resource>()

    val patients = fhirEngine.search<Patient> {}.map { it.resource }
    fetchedResources += patients

    val questionnaires = fhirEngine.search<Questionnaire> {}.map { it


on: absolute;
  border: color(border) solid 1px;
  text-align: center;
  color: color(light-text);
}

header #screen.current, div#global-screens > div.current {
  background: #666;
  color: white;
}

span#fullscreen.active {
  border: color(border) solid 1px;
}

button:disabled {
  opacity: 0.3;
}

@charset "UTF-8";/*!
 * Pico CSS ✨ v2.0.6 (https://picocss.com)
 * Copyright 2019-2024 - Licensed under MIT
 */:root{--pico-font-family-emoji:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--pico-font-family-sans-serif:system-ui,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,Helvetica,Arial,"Helvetica Neue",sans-serif,var(--pico-font-family-emoji);--pico-font-family-monospace:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace,var(--pico-font-family-emoji);--pico-font-family:var(--pico-font-family-sans-serif);--pico-line-height:1.5;--pico-font-weight:400;--pico-font-size:100%;--pico-text-underline-offset:0.1rem;--pico-border-radius:0.25rem;--pico-border-width:0.0625rem;--pico-outline-width:0.125rem;--pico-transition:0.2s ease-in-out;--pico-spacing:1rem;--pico-typography-spacing-vertical:1rem;--pico-block-spacing-vertical:var(--pico-spacing);--pico-block-spacing-horizontal:var(--pico-spacing);--pico-grid-column-gap:var(--pico-spacing);--pico-grid-row-gap:var(--pico-spacing);--pico-form-element-spacing-vertical:0.75rem;--pico-form-element-spacing-horizontal:1rem;--pico-group-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-primary-focus);--pico-group-box-shadow-focus-with-input:0 0 0 0.0625rem var(--pico-form-element-border-color);--pico-modal-overlay-backdrop-filter:blur(0.375rem);--pico-nav-element-spacing-vertical:1rem;--pico-nav-element-spacing-horizontal:0.5rem;--pico-nav-link-spacing-vertical:0.5rem;--pico-nav-link-spacing-horizontal:0.5rem;--pico-nav-breadcrumb-divider:">";--pico-icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2


SetMipmappedArrayNative(hTexRef, hMipmappedArray, Flags));
    }
    private static native int cuTexRefSetMipmappedArrayNative(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, int Flags);

    /**
     * Binds an address as a texture reference.
     *
     *

     * CUresult cuTexRefSetAddress (
     *      size_t* ByteOffset,
     *      CUtexref hTexRef,
     *      CUdeviceptr dptr,
     *      size_t bytes )
     *

     *

     *
Binds an address as a texture reference.
     *     Binds a linear address range to the texture reference <tt>hTexRef</tt>.
     *     Any previous address or CUDA array state associated with the texture
     *     reference is superseded by this function. Any memory
     *     previously bound to <tt>hTexRef</tt> is
     *     unbound.
     *

     *
Since the hardware enforces an alignment
     *     requirement on texture base addresses, cuTexRefSetAddress() passes back
     *     a byte offset in <tt>*ByteOffset</tt> that must be applied to texture
     *     fetches in order to read from the desired memory. This offset must be
     *     divided by the texel
     *     size and passed to kernels that read from
     *     the texture so they can be applied to the tex1Dfetch() function.
     *

     *
If the device memory pointer was returned
     *     from cuMemAlloc(), the offset is guaranteed to be 0 and NULL may be
     *     passed as the <tt>ByteOffset</tt> parameter.
     *

     *
The total number of elements (or texels)
     *     in the linear address range cannot exceed
     *     CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH. The number of
     *     elements is computed as (<tt>bytes</tt> / bytesPerElement), where
     *     bytesPerElement is determined from the data format and number of
     *     components set using cuTexRefSetFormat().
     *

     *

     *
     * @param ByteOffset Returned byte offset
     * @param hTexRef Texture reference to bind
     * @param dptr Device pointer to bind
     * @param bytes Size of memory to bind in bytes
     *
     * @return CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
     * CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE
     *
     * @see JCudaDriver#cuTexRefSetAddress2D
     * @see JCudaDriver#cuTexRefSetAddressMode
     * @see JCudaDriver#cuTexRefSetArray
     * @see JCudaDriver#cuTexRefSetFilterMode
     * @see JCudaDriver#cuTexRefSetFlags
     * @see JCudaDriver#cuTexRefSetFormat
     * @see JCudaDriver#cuTexRefGetAddress
     * @see JCudaDriver#cuTexRefGetAddressMode
     * @see JCudaDriver#cuTexRefGetArray
     * @see JCudaDriver#cuTexRefGetFilterMode
     * @see JCudaDriver#cuTexRefGetFlags
     * @see JCudaDriver#cuTexRefGetFormat
     */
    public static int cuTexRefSetAddress(long ByteOffset[], CUtexref hTexRef, CUdeviceptr dptr, long bytes)
    {
        return checkResult(cuTexRefSetAddressNative(ByteOffset, hTexRef, dptr, bytes));
    }

    private static native int cuTexRefSetAddressNative(long ByteOffset[], CUtexref hTexRef, CUdeviceptr dptr, long bytes);

    /**
     * Sets the format for a texture reference.
     *
     *

     * CUresult cuTexRefSetFormat (
     *      CUtexref hT


(#lua_resume) 返回 [`LUA_YIELD`](#pdf-LUA_YIELD) ， 若协程结束运行且没有任何错误时，返回 0 。 如果有错则返回错误代码（参见 [`lua_pcall`](#lua_pcall) ）。

在发生错误的情况下， 堆栈没有展开， 因此你可以使用调试 API 来处理它。 错误消息放在栈顶。

要延续一个协程， 你需要清除上次 [`lua_yield`](#lua_yield) 遗留下的所有结果， 你把需要传给 `yield` 作结果的值压栈， 然后调用 [`lua_resume`](#lua_resume) 。

参数 `from` 表示协程从哪个协程中来延续 `L` 的。 如果不存在这样一个协程，这个参数可以是 `NULL` 。

* * *

#### `lua_rotate`

\[-0, +0, –\]

void lua\_rotate (lua\_State \*L, int idx, int n);

把从 `idx` 开始到栈顶的元素轮转 `n` 个位置。 对于 `n` 为正数时，轮转方向是向栈顶的； 当 `n` 为负数时，向栈底方向轮转 `-n` 个位置。 `n` 的绝对值不可以比参于轮转的切片长度大。

* * *

#### `lua_setallocf`

\[-0, +0, –\]

void lua\_setallocf (lua\_State \*L, lua\_Alloc f, void \*ud);

把指定状态机的分配器函数换成带上用户数据 `ud` 的 `f` 。

* * *

#### `lua_setfield`

\[-1, +0, _e_\]

void lua\_setfield (lua\_State \*L, int index, const char \*k);

做一个等价于 `t[k] = v` 的操作， 这里 `t` 是给出的索引处的值， 而 `v` 是栈顶的那个值。

这个函数将把这个值弹出栈。 跟在 Lua 中一样，这个函数可能触发一个 "newindex" 事件的元方法 （参见 [§2.4](#2.4)）。

* * *

#### `lua_setglobal`

\[-1, +0, _e_\]

void lua\_setglobal (lua\_State \*L, const char \*name);

从堆栈上弹出一个值，并将其设为全局变量 `name` 的新值。

* * *

#### `lua_seti`

\[-1, +0, _e_\]

void lua\_seti (lua\_State \*L, int index, lua\_Integer n);

做一个等价于 `t[n] = v` 的操作， 这里 `t` 是给出的索引处的值， 而 `v` 是栈顶的那个值。

这个函数将把这个值弹出栈。 跟在 Lua 中一样，这个函数可能触发一个 "newindex" 事件的元方法 （参见 [§2.4](#2.4)）。

* * *

#### `lua_setmetatable`

\[-1, +0, –\]

void lua\_setmetatable (lua\_State \*L, int index);

把一张表弹出


{}", current_exe.display()), format!("defer")]
                            .into_iter()
                            .chain(spec)
                            .collect::<Vec<_>>()
                    ).map_err(|v| Error::CommandLength(v.len()))?
                )
                .refresh()
                .into());
        }
    }
    cache.save()?;
    Ok(Menu(menu))
}
//! # Execute command

mod error;
#[macro_use]
mod arg_handlers;

pub use self::arg_handlers::*;
pub use self::error::Error;

use clap::ArgMatches;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::str::FromStr;

use crate::keystore::KdfDepthLevel;
use crate::storage::{default_path, StorageController, StorageType};

type ExecResult = Result<(), Error>;

const DEFAULT_CHAIN_NAME: &str = "mainnet";

/// Create new command executor
pub fn execute(matches: &ArgMatches) -> ExecResult {
    let env = EnvVars::parse();

    let chain = matches.value_of("chain").unwrap_or(DEFAULT_CHAIN_NAME);
    log::info!("Chain name: {}", DEFAULT_CHAIN_NAME);

    let mut base_path = PathBuf::new();
    if let Some(p) = matches
        .value_of("base-path")
        .or_else(|| env.emerald_base_path.as_ref().map(String::as_str))
    {
        base_path.push(&p)
    } else {
        base_path = default_path();
    }

    let storage_type = if let Some(storage_type) = matches.value_of("storage-type") {
        StorageType::from_str(storage_type)?
    } else {
        StorageType::RocksDB
    };

    let storage_ctrl = StorageController::new(base_path, storage_type)?;

    log::info!("Starting Jade Signer - v{}", crate::version());
    let host = matches.value_of("host").unwrap_or_default();
    let port = matches.value_of("port").unwrap_or_default();
    let addr = format!("{}:{}", host, port).parse::<SocketAddr>()?;
    let sec_lvl = get_security_lvl(matches)?;

    log::info!("Chain set to '{}'", chain);
    log::info!("Security level set to '{}'", sec_lvl);

    crate::rpc::start(&addr, storage_ctrl, Some(sec_lvl));

    Ok(())
}
//! Exit Codes for libdocker-rl

use std::fmt;
use std::process;

/// Exit codes
#[derive(Debug, Clone, Copy)]
pub enum ExitCode {
    /// Exit code for successful programs
    Ok = 0,
    /// Exit code when limit has been exceeded
    OverLimit,
    /// Exit code for failed authentication
    Unauthorized,
    /// Exit code for connection errors
    Connection,
    /// Error parsing body
    Body,
    /// Error parsing rate limit
    Parsing,
}

impl Default for ExitCode {
    fn default() -> Self {
        ExitCode::Ok
    }
}

/// Wrapper around result to keep track of `ExitCode`s
pub type DrlResult<T> = std::result::Result<T, DrlErr>;

impl fmt::Display for DrlErr {
    /// fmt for output
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.msg)
    }
}

/// Wrapper around exit code
#[deri


nds.to_glib_none().0,
                start_point.to_glib_none().0,
                end_point.to_glib_none().0,
                stops.to_glib_none().0,
                n_stops,
            );
        }
    }

    pub fn append_repeating_linear_gradient(
        &self,
        bounds: &graphene::Rect,
        start_point: &graphene::Point,
        end_point: &graphene::Point,
        stops: &[gsk::ColorStop],
    ) {
        let n_stops = stops.len() as usize;
        unsafe {
            gtk_sys::gtk_snapshot_append_repeating_linear_gradient(
                self.to_glib_none().0,
                bounds.to_glib_none().0,
                start_point.to_glib_none().0,
                end_point.to_glib_none().0,
                stops.to_glib_none().0,
                n_stops,
            );
        }
    }
}
fn main() {
  let keypair = ds4auth::DS4Key::embedded().unwrap();
  let nonce = [0u8; 256];
  let signature = keypair.sign(&nonce).unwrap();
  assert!(signature.validate(&nonce));
}
<gh_stars>0
use serde::{Deserialize, Serialize};
use smart_default::SmartDefault;

#[derive(Debug, SmartDefault, Serialize, Deserialize, Copy, Clone)]
#[serde(rename_all = "kebab-case")]
pub enum Page {
    Tasks,
    #[default]
    Config,
    About,
}
/************************************************

   File: rato:net_events.rs:NetEvents
   Author: ytr289
   Date: 2019-03-26:09:33
   LICENSE: Apache 2.0

**************************************************/
use hashbrown::HashMap;

use crate::conn::Conn;

///
/// NetEvents
///
pub trait NetEvents {
    fn event_opened(&self, id: usize, conn: &mut Conn) -> (Vec<u8>, bool);
    fn event_closed(&self, id: usize, conn: &mut Conn) -> Result<bool, String>;
    fn event_data(
        &self,
        id: usize,
        conn_tags: &mut HashMap<String, String>,
        input_buffer: &mut Vec<u8>,
        output_buffer: &mut Vec<u8>,
    ) -> bool;
}use std::io::Cursor;

use bytes::{Bytes, IntoBuf};
use futures::{Future, Stream};
use http;
use tiny_http;

use {BodyStream, Error};

/// Returns a `Future<Item = tiny_http::Response<Cursor<Bytes>>` representing an `http::Response<BodyStream>`.
pub fn as_tiny_http_response(
    resp: http::Response<BodyStream>,
) -> impl Future<Item = tiny_http::Response<Cursor<Bytes>>, Error = Error> {
    let status_code = tiny_http::StatusCode(resp.status().as_u16());

    let headers = resp.headers()
        .iter()
        .map(|(name, value)| {
            let name: &[u8] = name.as_ref();
            let value: &[u8] = value.as_ref();
            tiny_http::Header::from_bytes(name, value).unwrap()
        })
        .collect();

    resp.into_body().concat2().and_then(move |body| {
        Ok(tiny_http::Response::new(
            status_code,
            headers,
            body.into_buf(),
            None,
            None,
        ))
    })
}

use futures::Stream;
use std::ping::Pin;
use tonic::{transport::Server, Request, Response, Status};

pub mod pb {
	tonic::include_proto("examples/api")
}

#[derive(Default)]
pub struct ServiceImpl {}

type ResponseStream<T> = Response<Pin<Box<dyn Stream<Item = Result<Response<T>>>>>>

#[tonic