 2, name: "Andrew"},
        {id: 3, name: "Alexandr"},
        {id: 4, name: "Pavel"},
        {id: 5, name: "Yura"},
        {id: 6, name: "Valera"}
    ],
    messagesData: [
        {id: 1, message: "Hi"},
        {id: 2, message: "How are you"},
        {id: 3, message: "Norm_"},
        {id: 4, message: "Dnavol"},
        {id: 5, message: "zuMMEr"},
        {id: 6, message: "Dasdas"}
    ],
}

const dialogsReducer = (state: MessagesPage = initialState, action: ActionsTypes): MessagesPage => {

    switch (action.type) {
        case ADD_MESSAGE:
            const newMessage: MessagesDataType = {
                id: new Date().getTime(),
                message: action.message,
            }
            return {
                ...state,
                messagesData: [...state.messagesData, newMessage],
            }
        default:
            return state
    }
}
export const addMessageActionCreator = (message:string): ActionsTypes => ({type: ADD_MESSAGE, message});

export default dialogsReducer;ng generate class CustomPipe
===========CustomPipe
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({    name: 'cpipe',    pure: false  })
export class CustomPipe  implements PipeTransform {
  transform(value: string, before: string, after: string): string {
    let newStr = `${before} ${value} ${after}`;
    return newStr;
  }
}
==============app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {CustomPipe} from './custom-pipe'
import { AppComponent } from './app.component';
@NgModule({
  declarations: [    AppComponent,CustomPipe  ],
  imports: [    BrowserModule  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
==============
import { Component } from '@angular/core';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
ename = 'Sri Ram';
}
======================
<h1>   {{ename | cpipe :"Mr.":"the great" }} </h1>
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-game',
  templateUrl: './game.component.html'
})
export class GameComponent implements OnInit {
  display = true;
  matrix = [];
  unselectedMatrix = [];
  timer: number;
  timerRef: any;
  winner = false;
  loser = false;
  constructor(private ref: ChangeDetectorRef) {}

  ngOnInit() {}

  // toggle user form visibility
  showDialog() {
    this.display = !this.display;
  }

  // set data when user submit form
  SubmitForm(formData) {
    this.showDialog();
    this.unselectedMatrix = [];
    this.matrix = this.createMatrix(formData['squareBoxes']);
    this.timer = formData['timer'];
  }

  // create 2-D array to make this game
  createMatrix(length) {
    const matrix = [];
    for (let i = 0; i < length; i++) {
      const innerArray = [];
      for (let j = 0; j < length; j++) {
        innerArray.push({ col: j, isSelected: true });
      }
      matrix.push({ row: i, innerArray: innerArray });
    }
    return matrix;
  }

  // uncolor clicked dom and
  toggleColor(x, y) {
    if (this.matrix[x]['innerArray'][y]['isSelected']) {
      if (!this.unselectedMat


code>ESP32WebCam(const ESP32Cam::CameraId model, const uint16_t port = ESP32CAM_DEFAULT_HTTPPORT)

Instantiate ESP32WebCam. The constructor also instantiates ESP32Cam, so there is no need to explicitly declare the ESP32Cam class in the sketch. At the time of declaring the constructor, the camera is not initialized and the HTTP server is not started. Each of them requires a separate dedicated function to be called.

Parameters

portPort number of the HTTP server that ESP32WebCam starts. Default port number defined by ESP32CAM_DEFAULT_HTTPPORT macro directive in ESP32WebCam.h

modelSpecifies the model of the onboard image sensor. The image sensor models that can be specified are as follows:

ESP32Cam::CAMERA_MODEL_WROVER_KIT

ESP32Cam::CAMERA_MODEL_ESP_EYE

ESP32Cam::CAMERA_MODEL_M5STACK_NO_PSRAM

ESP32Cam::CAMERA_MODEL_M5STACK_PSRAM

ESP32Cam::CAMERA_MODEL_M5STACK_V2_PSRAM

ESP32Cam::CAMERA_MODEL_M5STACK_WIDE

ESP32Cam::CAMERA_MODEL_M5STACK_ESP32CAM

ESP32Cam::CAMERA_MODEL_M5STACK_UNITCAM

ESP32Cam::CAMERA_MODEL_AI_THINKER

ESP32Cam::CAMERA_MODEL_TTGO_T_JOURNAL

 getCapturePath¶

const char* getCapturePath(void)

Get a path containing the first '/' of the currently valid endpoint URL to capture.

Return value

A path of capturing URL. D


(normProduct == 0) {
      throw new MathArithmeticException(LocalizedFormats.ZERO_NORM);
    }

    double dot = dotProduct(v1, v2);
    double threshold = normProduct * 0.9999;
    if ((dot < -threshold) || (dot > threshold)) {
      // the vectors are almost aligned, compute using the sine
      Vector3D v3 = crossProduct(v1, v2);
      if (dot >= 0) {
        return FastMath.asin(v3.getNorm() / normProduct);
      }
      return FastMath.PI - FastMath.asin(v3.getNorm() / normProduct);
    }

    // the vectors are sufficiently separated to use the cosine
    return FastMath.acos(dot / normProduct);

  }

  /** Get the opposite of the instance.
   * @return a new vector which is opposite to the instance
   */
  public Vector3D negate() {
    return new Vector3D(-x, -y, -z);
  }

  /** Multiply the instance by a scalar
   * @param a scalar
   * @return a new vector
   */
  public Vector3D scalarMultiply(double a) {
    return new Vector3D(a * x, a * y, a * z);
  }

  /**
   * Returns true if any coordinate of this vector is NaN; false otherwise
   * @return  true if any coordinate of this vector is NaN; false otherwise
   */
  public boolean isNaN() {
      return Double.isNaN(x) || Double.isNaN(y) || Double.isNaN(z);
  }

  /**
   * Returns true if any coordinate of this vector is infinite and none are NaN;
   * false otherwise
   * @return  true if any coordinate of this vector is infinite and none are NaN;
   * false otherwise
   */
  public boolean isInfinite() {
      return !isNaN() && (Double.isInfinite(x) || Double.isInfinite(y) || Double.isInfinite(z));
  }

  /**
   * Test for the equality of two 3D vectors.
   *

   * If all coordinates of two 3D vectors are exactly the same, and none are
   * Double.NaN, the two 3D vectors are considered to be equal.
   *

   *

   * NaN coordinates are considered to affect globally the vector
   * and be equals to each other - i.e, if either (or all) coordinates of the
   * 3D vector are equal to Double.NaN, the 3D vector is equal to
   * {@link #NaN}.
   *

   *
   * @param other Object to test for equality to this
   * @return true if two 3D vector objects are equal, false if
   *         object is null, not an instance of Vector3D, or
   *         not equal to this Vector3D instance
   *
   */
  @Override
  public boolean equals(Object other) {

    if (this == other) {
      return true;
    }

    if (other instanceof Vector3D) {
      final Vector3D rhs = (Vector3D)other;
      if (rhs.isNaN()) {
          return this.isNaN();
      }

      return (x == rhs.x) && (y == rhs.y) && (z == rhs.z);
    }
    return false;
  }

  /**
   * Get a hashCode for the 3D vector.
   *

   * All NaN values have the same hash code.

   *
   * @return a hash code value for this object
   */
  @Override
  public int hashCode() {
      if (isNaN()) {
          return 8;
      }
      return 31 * (23 * MathUtils.hash(x) +  19 * MathUtils.hash(y) +  MathUtils.hash(z));
  }

  /** Compute the dot-


/*
 * linux/fs/nfs/callback_proc.c
 *
 * Copyright (C) 2004 Trond Myklebust
 *
 * NFSv4 callback procedures
 */
#include <linux/nfs4.h>
#include <linux/nfs_fs.h>
#include "nfs4_fs.h"
#include "callback.h"
#include "delegation.h"
#include "internal.h"

#define NFSDBG_FACILITY NFSDBG_CALLBACK

__be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res)
{
	struct nfs_client *clp;
	struct nfs_delegation *delegation;
	struct nfs_inode *nfsi;
	struct inode *inode;

	res->bitmap[0] = res->bitmap[1] = 0;
	res->status = htonl(NFS4ERR_BADHANDLE);
	clp = nfs_find_client(args->addr, 4);
	if (clp == NULL)
		goto out;
	inode = nfs_delegation_find_inode(clp, &args->fh);
	if (inode == NULL)
		goto out_putclient;
	nfsi = NFS_I(inode);
	down_read(&nfsi->rwsem);
	delegation = nfsi->delegation;
	if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0)
		goto out_iput;
	res->size = i_size_read(inode);
	res->change_attr = delegation->change_attr;
	if (nfsi->npages != 0)
		res->change_attr++;
	res->ctime = inode->i_ctime;
	res->mtime = inode->i_mtime;
	res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) &
		args->bitmap[0];
	res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) &
		args->bitmap[1];
	res->status = 0;
out_iput:
	up_read(&nfsi->rwsem);
	iput(inode);
out_putclient:
	nfs_put_client(clp);
out:
	dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(res->status));
	return res->status;
}

__be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
{
	struct nfs_client *clp;
	struct inode *inode;
	__be32 res;

	res = htonl(NFS4ERR_BADHANDLE);
	clp = nfs_find_client(args->addr, 4);
	if (clp == NULL)
		goto out;
	inode = nfs_delegation_find_inode(clp, &args->fh);
	if (inode == NULL)
		goto out_putclient;
	/* Set up a helper thread to actually return the delegation */
	switch(nfs_async_inode_return_delegation(inode, &args->stateid)) {
		case 0:
			res = 0;
			break;
		case -ENOENT:
			res = htonl(NFS4ERR_BAD_STATEID);
			break;
		default:
			res = htonl(NFS4ERR_RESOURCE);
	}
	iput(inode);
out_putclient:
	nfs_put_client(clp);
out:
	dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(res));
	return res;
}


   'shell_sort': 'θ(n log n) | θ(n log n²) | θ(n log n)',
            'selection_sort': 'θ(n²) | θ(n²) | θ(n²)',
            'heap_sort': 'θ(n log n) | θ(n log n) | θ(n log n)',
            'merge_sort': 'θ(n log n) | θ(n log n) | θ(n log n)'
        }

        ax.text(0.5, -0.15, f"Comportamento Assintótico - {algorithm_name}:\nCrescente: {notations[algorithm_name]}",
                ha='center', va='center', transform=ax.transAxes)

    def sort_arrays(self):
        self.sort_button.config(state=tk.DISABLED)

        # Limpar o gráfico anterior
        for widget in self.graph_frame.winfo_children():
            widget.destroy()

        fig, ax = plt.subplots(figsize=(8, 6))

        sizes = [1000, 5000, 10000, 25000, 50000]
        times = [[], [], []]
        algorithm_names = []

        algorithm_name = self.algorithm_choice.get().lower().replace(" ", "_")
        sort_function = globals()[algorithm_name]

        for i, size in enumerate(sizes):
            # Imprimir o status no terminal
            print(f"Ordenando arrays de {size} elementos...")

            ascending, descending, random_array = generate_arrays(size)

            time_ascending = time_sort_algorithm(sort_function, ascending[:])
            time_descending = time_sort_algorithm(sort_function, descending[:])
            time_random = time_sort_algorithm(sort_function, random_array[:])

            times[0].append(time_ascending)
            times[1].append(time_descending)
            times[2].append(time_random)

            # Imprimir o status no terminal após a ordenação
            print(f"Array de {size} elementos ordenado crescente [{time_ascending:.4f} segundos]")
            print(f"Array de {size} elementos ordenado decrescente [{time_descending:.4f} segundos]")
            print(f"Array de {size} elementos aleatório [{time_random:.4f} segundos]")

        # Atualizar a label de status após a ordenação
        self.status_label.config(text="\nOperação concluída")
        self.update_idletasks()

        algorithm_names.append(algorithm_name)

        save_times_to_csv("ascending.csv", algorithm_names, sizes, [times[0]])
        save_times_to_csv("descending.csv", algorithm_names, sizes, [times[1]])
        save_times_to_csv("random.csv", algorithm_names, sizes, [times[2]])

        self.sort_button.config(state=tk.NORMAL)

        # Plotar o gráfico
        self.plot_behavior(ax, sizes, times, algorithm_name)

        # Renderizar o gráfico no tkinter
        canvas = FigureCanvasTkAgg(fig, master=self.graph_frame)
        canvas.draw()
        canvas.get_tk_widget().pack()

def run_portuguese_interface():
    print("Bem-vindo")
    app = SortingApp()
    app.mainloop()


}

            w.activatedWidgets &= ~(1ULL << Widx::cash_popup_rendering);
            if (Config::get().cashPopupRendering)
            {
                w.activatedWidgets |= (1ULL << Widx::cash_popup_rendering);
            }
            else
            {
                w.activatedWidgets &= ~(1ULL << Widx::cash_popup_rendering);
            }

            sub_4C13BE(&w);

            Common::prepareDraw(w);
        }

        // 0x004BFAF9
        static void draw(Window& w, Gfx::DrawingContext& drawingCtx)
        {
            // Draw widgets.
            w.draw(drawingCtx);
        }

        static constexpr WindowEventList kEvents = {
            .onClose = Common::onClose,
            .onMouseUp = onMouseUp,
            .onMouseDown = onMouseDown,
            .onDropdown = onDropdown,
            .onUpdate = onUpdate,
            .prepareDraw = prepareDraw,
            .draw = draw,
        };

        static const WindowEventList& getEvents()
        {
            return kEvents;
        }
    }

    namespace Sound
    {
        static constexpr Ui::Size32 kWindowSize = { 366, 84 };

        namespace Widx
        {
            enum
            {
                audio_device = Common::Widx::tab_miscellaneous + 1,
                audio_device_btn,
                play_title_music,
            };
        }

        static constexpr auto _widgets = makeWidgets(
            Common::makeCommonWidgets(kWindowSize, StringIds::options_title_sound),
            Widgets::dropdownWidgets({ 10, 49 }, { 346, 12 }, WindowColour::secondary, StringIds::stringid),
            Widgets::Checkbox({ 10, 65 }, { 346, 12 }, WindowColour::secondary, StringIds::play_title_music)

        );

        static void audioDeviceMouseDown(Ui::Window* window);
        static void audioDeviceDropdown(Ui::Window* window, int16_t itemIndex);
        static void playTitleMusicOnMouseUp(Ui::Window* window);

        // 0x004C0217
        static void prepareDraw(Window& w)
        {
            assert(w.currentTab == Common::tab::sound);

            w.activatedWidgets &= ~Common::tabWidgets;
            w.activatedWidgets |= 1ULL << (w.currentTab + 4);

            w.widgets[Common::Widx::frame].right = w.width - 1;
            w.widgets[Common::Widx::frame].bottom = w.height - 1;
            w.widgets[Common::Widx::panel].right = w.width - 1;
            w.widgets[Common::Widx::panel].bottom = w.height - 1;
            w.widgets[Common::Widx::caption].right = w.width - 2;
            w.widgets[Common::Widx::close_button].left = w.width - 15;
            w.widgets[Common::Widx::close_button].right = w.width - 15 + 12;

            auto args = FormatArguments(w.widgets[Widx::audio_device].textArgs);

            auto audioDeviceName = Audio::getCurrentDeviceName();
            if (audioDeviceName != nullptr)
            {
                args.push(StringIds::stringptr);
                args.push(audioDeviceName);
            }
            else
            {
                args.push(StringIds::audio_device_none);
            }

            if (Config::get().audio.playTitleMusic)
            {
                w.activatedWidgets |= (1ULL << Widx::play_title_music);
            }
            else
            {
                w.activatedWidgets &= ~(1ULL << Widx::play_title_music);
            }

            sub_4C13BE(&w);

            Common::prepareDraw(w);
        }

        // 0x004C02F5
        static void draw(Window& w, Gfx::DrawingContext& drawingCtx)
        {
            // Draw widgets.
            w.draw(drawingCtx);
        }

        static void onMouseUp(Window& w, WidgetIndex_t wi, [[maybe_un


The two-dimensional case above corresponds to rnk = 2 and an
array n of length 2 with n[0] = n0 and n[1] = n1.
This routine is for any rnk > 1; one-dimensional transforms
have their own interface because they work slightly differently, as
discussed below.

First, the advanced interface allows you to perform multiple
transforms at once, of interleaved data, as specified by the
howmany parameter.  (hoamany is 1 for a single
transform.)

Second, here you can specify your desired block size in the n0
dimension, block0.  To use FFTW’s default block size, pass
FFTW_MPI_DEFAULT_BLOCK (0) for block0.  Otherwise, on
P processes, FFTW will return local_n0 equal to
block0 on the first P / block0 processes (rounded down),
return local_n0 equal to n0 - block0 * (P / block0) on
the next process, and local_n0 equal to zero on any remaining
processes.  In general, we recommend using the default block size
(which corresponds to n0 / P, rounded up).

For example, suppose you have P = 4 processes and n0 =
21.  The default will be a block size of 6, which will give
local_n0 = 6 on the first three processes and local_n0 =
3 on the last process.  Instead, however, you could specify
block0 = 5 if you wanted, which would give local_n0 = 5
on processes 0 to 2, local_n0 = 6 on process 3.  (This choice,
while it may look superficially more “balanced,” has the same
critical path as FFTW’s default but requires more communications.)

Next: Load balancing, Previous: MPI Data Distribution, Up: MPI Data Distribution   [Contents][Index]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


v010",
                "experimentScope" to "myapp-v021"
              )
            ),
            "scoreThresholds" to scoreThresholds,
            "lifetimeDuration" to Duration.parse("PT1H")
          )
        }
      }
      // Reversing list of stages here which would cause test to fail if stages weren't first sorted by name before aggregating canary scores.
      val parentStage = pipeline.stageByRef("1")
      val reversedPipeline = pipeline {
        stages.addAll(pipeline.stages.reversed())
        stages.forEach { stage -> stage.execution = this }
        stages
          .filter { stage -> stage !== parentStage }
          .forEach { stage -> stage.parentStageId = parentStage.id }
      }
      val canaryStage = reversedPipeline.stageByRef("1")
      canaryStage.context["intervalStageId"] = canaryStage.id
      val taskResult = task.execute(canaryStage)

      it("stores the aggregated scores") {
        assertThat(taskResult.context["canaryScores"]).isEqualTo(canaryScores)
      }

      it("returns a status of $overallExecutionStatus") {
        assertThat(taskResult.status).isEqualTo(overallExecutionStatus)
      }
    }
  }

  describe("aggregation of canary scores from multiple canary stages is done independently") {
    where(
      "1st stage canary scores of %s and 2nd stage canary scores of %s and thresholds of %s",
      values(listOf(10.5, 40.0, 60.5), listOf(25.0, 35.0, 45.0), SUCCEEDED, TERMINAL),
      values(listOf(65.0), listOf(73.0), SUCCEEDED, SUCCEEDED),
      values(listOf(55.0), listOf(75.0), TERMINAL, SUCCEEDED),
      values(listOf(10.5, 40.0, 59.4), listOf(30.5, 40.5, 50.5), TERMINAL, TERMINAL)
    ) { canaryScores1, canaryScores2, overallExecutionStatus1, overallExecutionStatus2 ->

      val scoreThresholds = mapOf("pass" to 60.5)
      val pipeline = pipeline {
        stage {
          refId = "1"
          type = KayentaCanaryStage.STAGE_TYPE
          name = "kayentaCanary"
          context["canaryConfig"] = mapOf(
            "canaryConfigId" to UUID.randomUUID().toString(),
            "scopes" to listOf(
              mapOf(
                "controlScope" to "myapp-v010",
                "experimentScope" to "myapp-v021"
              )
            ),
            "scoreThresholds" to scoreThresholds,
            "lifetimeDuration" to Duration.parse("PT1H")
          )
        }
        canaryScores1.forEachIndexed { i, score ->
          stage {
            requisiteStageRefIds = if (i > 0) listOf("1<${i - 1}") else emptyList()
            refId = "1<$i"
            parentStageId = stageByRef("1").id
            type = RunCanaryPipelineStage.STAGE_TYPE
            // Starting with 'Run Canary #9' to prove that the sorting is done treating everything after the '#' as a number.
            name = "${RunCanaryPipelineStage.STAGE_NAME_PREFIX}${i + 9}"
            context["canaryScore"] = score
          }
        }

        stage {
          requ


permission.ACCESS_FINE_LOCATION, Os.getpid(), Os.getuid()) == PackageManager.PERMISSION_GRANTED

				val angleDiff = if (hasPreciseLocation) 0.01 else 0.1

				map.zoomToBoundingBox(
					BoundingBox(
						lat + angleDiff,
						lon + angleDiff,
						lat - angleDiff,
						lon - angleDiff
					),
					true
				)
			}
		}

		val pingIdInput = findViewById<EditText>(R.id.sendPingId)
		val pingButton = findViewById<Button>(R.id.sendPingButton)

		pingButton.isEnabled = false

		var firstConnection = true
		connection = Pinger.Builder(URL(getString(R.string.api_url)))
			.userAgent(userAgent)
			.onReconnecting { idIndicator.post { idIndicator.text = getString(R.string.user_s_ping_id).replace("{id}", "...") } }
			.onConnected { logger.info("connected as id $it") }
			.onConnected { idIndicator.post { idIndicator.text = getString(R.string.user_s_ping_id).replace(Regex.fromLiteral("{id}"), it.toString()) } }
			.onConnected { pingButton.post { pingButton.isEnabled = true } }
			.onConnected { if (!firstConnection) { showSlideUp(getString(R.string.reconnected), R.drawable.ping_incoming) } else { firstConnection = false } }
			.onPing { (id, info) -> logger.info("ping received from $id: $info") }
			.onPing { (id, info) -> runOnUiThread {
				showSlideUp(getString(R.string.ping_received).replace("{id}", decidingOn.toString()), R.drawable.ping_accepted)

				val marker = Marker(map)
				val elapsed = System.currentTimeMillis() / 1000 - info.ts
				marker.position = GeoPoint(info.lat, info.lon, info.alt.toDouble())
				marker.icon = AppCompatResources.getDrawable(this, R.drawable.ping_marker)
				marker.title = resources.getQuantityString(R.plurals.ping_from_seconds, elapsed.toInt())
					.replace("{id}", id.toString())
					.replace("{s}", elapsed.toString())
				marker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM)
				map.overlays.add(marker)

				val angleDiff = if (info.err < 100) 0.01 else 0.1
				map.zoomToBoundingBox(
					BoundingBox(
						info.lat + angleDiff,
						info.lon + angleDiff,
						info.lat - angleDiff,
						info.lon - angleDiff
					),
					true
				)

				mapUpdateTimer.schedule(object: TimerTask() {
					override fun run() {
						val secondsElapsed = System.currentTimeMillis() / 1000 - info.ts
						logger.info("updating ping label, $secondsElapsed second(s) elapsed")

						if (secondsElapsed < 60) {
							map.post {
								marker.title = resources.getQuantityString(R.plurals.ping_from_seconds, secondsElapsed.toInt())
									.replace("{id}", id.toString())
									.replace("{s}", secondsElapsed.toString())
							}
						} else {
							map.post {
								marker.title = resources.getQuantityString(R.plurals.ping_from_minutes, (secondsElapsed / 60).toInt())
									.replace("{id}", id.toString())
									.replace("{m}", (secondsElapsed / 60).toString())
							}

							this.cancel()

							mapUpdateTimer.schedule(object: TimerTask() {
								override fun run() {
									val minutesElapsed = (System.currentTimeMillis() / 1000 - info.ts) / 60
									logger.info("updating ping label, $minutesElapsed minute(s) elapsed")

									if (minutesElapsed < 60) {


.read_shift(4);var Props=[],i=0;var CodePage=0;var Dictionary=-1,DictObj={};for(i=0;i!=NumProps;++i){var PropID=blob.read_shift(4);var Offset=blob.read_shift(4);Props[i]=[PropID,Offset+start_addr]}var PropH={};for(i=0;i!=NumProps;++i){if(blob.l!==Props[i][1]){var fail=true;if(i>0&&PIDSI)switch(PIDSI[Props[i-1][0]].t){case 2:if(blob.l+2===Props[i][1]){blob.l+=2;fail=false}break;case 80:if(blob.l<=Props[i][1]){blob.l=Props[i][1];fail=false}break;case 4108:if(blob.l<=Props[i][1]){blob.l=Props[i][1];fail=false}break;}if(!PIDSI&&blob.l<=Props[i][1]){fail=false;blob.l=Props[i][1]}if(fail)throw new Error("Read Error: Expected address "+Props[i][1]+" at "+blob.l+" :"+i)}if(PIDSI){var piddsi=PIDSI[Props[i][0]];PropH[piddsi.n]=parse_TypedPropertyValue(blob,piddsi.t,{raw:true});if(piddsi.p==="version")PropH[piddsi.n]=String(PropH[piddsi.n]>>16)+"."+String(PropH[piddsi.n]&65535);if(piddsi.n=="CodePage")switch(PropH[piddsi.n]){case 0:PropH[piddsi.n]=1252;case 874:;case 932:;case 936:;case 949:;case 950:;case 1250:;case 1251:;case 1253:;case 1254:;case 1255:;case 1256:;case 1257:;case 1258:;case 1e4:;case 1200:;case 1201:;case 1252:;case 65e3:;case-536:;case 65001:;case-535:set_cp(CodePage=PropH[piddsi.n]);break;default:throw new Error("Unsupported CodePage: "+PropH[piddsi.n]);}}else{if(Props[i][0]===1){CodePage=PropH.CodePage=parse_TypedPropertyValue(blob,VT_I2);set_cp(CodePage);if(Dictionary!==-1){var oldpos=blob.l;blob.l=Props[Dictionary][1];DictObj=parse_dictionary(blob,CodePage);blob.l=oldpos}}else if(Props[i][0]===0){if(CodePage===0){Dictionary=i;blob.l=Props[i+1][1];continue}DictObj=parse_dictionary(blob,CodePage)}else{var name=DictObj[Props[i][0]];var val;switch(blob[blob.l]){case 65:blob.l+=4;val=parse_BLOB(blob);break;case 30:blob.l+=4;val=parse_VtString(blob,blob[blob.l-4]);break;case 31:blob.l+=4;val=parse_VtString(blob,blob[blob.l-4]);break;case 3:blob.l+=4;val=blob.read_shift(4,"i");break;case 19:blob.l+=4;val=blob.read_shift(4);break;case 5:blob.l+=4;val=blob.read_shift(8,"f");break;case 11:blob.l+=4;val=parsebool(blob,4);break;case 64:blob.l+=4;val=parseDate(parse_FILETIME(blob));break;default:throw new Error("unparsed value: "+blob[blob.l]);}PropH[name]=val}}}blob.l=start_addr+size;return PropH}function parse_PropertySetStream(file,PIDSI){var blob=file.content;prep_blob(blob,0);var NumSets,FMTID0,FMTID1,Offset0,Offset1=0;blob.chk("feff","Byte Order: ");var vers=blob.read_shift(2);var SystemIdentifier=blob.read_shift(4);blob.chk(CFB.utils.const


import _plotly_utils.basevalidators

class HoveronValidator(_plotly_utils.basevalidators.FlaglistValidator):
    def __init__(self, plotly_name="hoveron", parent_name="violin", **kwargs):
        super(HoveronValidator, self).__init__(
            plotly_name=plotly_name,
            parent_name=parent_name,
            edit_type=kwargs.pop("edit_type", "style"),
            extras=kwargs.pop("extras", ["all"]),
            flags=kwargs.pop("flags", ["violins", "points", "kde"]),
            **kwargs,
        )


LbName { get; set; }

        /// <summary>
        /// Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.


 if(TT(i,j)>=0) {
          REQUIRE(E(i,j) == E(TT(i,j),TTi(i,j)));
        }
      }
    }
  }
}

#include <test_common.h>
#include <igl/cat.h>
#include <igl/triangle/scaf.h>
#include <igl/slice.h>
#include <igl/harmonic.h>
#include <igl/boundary_loop.h>
#include <igl/map_vertices_to_circle.h>
#include <igl/flip_avoiding_line_search.h>

// Assert that building the SCAF equation system via scaf_system() and
// solving it manually yields the same result as calling scaf_solve() directly.
TEST_CASE("scaf_system: Test scaf_system() vs scaf_solve()", "[igl]")
{
  // Read cube mesh
  Eigen::MatrixXd V;
  Eigen::MatrixXi F;
  igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F);

  // Cut to disk
  F = F.topRows(F.rows() - 1).eval();

  // Compute Tutte's embedding
  Eigen::MatrixXd uv_init;
  {
      Eigen::MatrixXd bnd_uv;
      std::vector<int> boundary;
      igl::boundary_loop(F, boundary);
      Eigen::VectorXi bnd = Eigen::Map<Eigen::VectorXi>(boundary.data(), boundary.size());
      igl::map_vertices_to_circle(V, bnd, bnd_uv);
      igl::harmonic(F, bnd, bnd_uv ,1, uv_init);
      uv_init.conservativeResize(V.rows(), 2);
  }

  // Init empty constraint vectors
  Eigen::VectorXi b;
  Eigen::MatrixXd bc;

  // Run one scaf iteration as reference
  igl::triangle::SCAFData s_ref;
  {
      igl::triangle::scaf_precompute(V, F, uv_init, s_ref, igl::MappingEnergyType::SYMMETRIC_DIRICHLET, b, bc, 0);
      igl::triangle::scaf_solve(s_ref, 1);
  }

  // Obtain SCAF linear system perform iteration manually
  igl::triangle::SCAFData s_test;
  {
      // Set up system
      igl::triangle::scaf_precompute(V, F, uv_init, s_test, igl::MappingEnergyType::SYMMETRIC_DIRICHLET, b, bc, 0);
      Eigen::SparseMatrix<double> L;
      Eigen::VectorXd rhs;
      igl::triangle::scaf_system(s_test, L, rhs);

      // Solve
      Eigen::SimplicialLDLT<Eigen::SparseMatrix<double>> solver;
      auto x = solver.compute(L).solve(rhs);

      // Write result to uv_target
      Eigen::MatrixXd uv_target = s_test.w_uv;
      const int n_v_var = s_test.w_uv.rows() - s_test.frame_ids.size();
      for (int i = 0; i < n_v_var; ++i)
      {
          int row = i;
          if (i >= s_test.v_num)
              row += s_test.frame_ids.size();

          uv_target(row, 0) = x[i];
          uv_target(row, 1) = x[i + n_v_var];
      }

      // Line search
      auto E = [&s_test](Eigen::MatrixXd &uv) { return igl::triangle::scaf::compute_energy(s_test, uv, true); };
      Eigen::MatrixXi w_T;
      igl::cat(1, s_test.m_T, s_test.s_


ntainerName"))?,
                    to: value_to.ok_or_else(|| serde::de::Error::missing_field("to"))?,
                })
            }
        }

        deserializer.deserialize_struct(
            "TagImageHook",
            &[
                "containerName",
                "to",
            ],
            Visitor,
        )
    }
}

impl serde::Serialize for TagImageHook {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
        let mut state = serializer.serialize_struct(
            "TagImageHook",
            2,
        )?;
        serde::ser::SerializeStruct::serialize_field(&mut state, "containerName", &self.container_name)?;
        serde::ser::SerializeStruct::serialize_field(&mut state, "to", &self.to)?;
        serde::ser::SerializeStruct::end(state)
    }
}
<reponame>zayenz/fall
struct Foo {}
fn bar() {}
pub struct Baz {}
pub fn quux() {}
org.jfree.chart.block.BlockParams
<filename>src/decode.rs<gh_stars>0
use std::convert::From;
use std::fmt;
use std::io;
use std::io::Read;
use std::string::FromUtf8Error;

use crate::*;

/// Parse NBT binary into Value.
///
/// Input stream should be plain NBT binary.
/// If you need decompress, use other crate (ex: flate2).
pub fn parse<R: Read>(r: R) -> Result<Value> {
    let mut parser = Parser::new(r);
    parser.parse()
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
enum Type {
    End,
    Byte,
    Short,
    Int,
    Long,
    Float,
    Double,
    ByteArray,
    Str,
    List,
    Compound,
    IntArray,
    LongArray,
}

impl Type {
    fn try_from(byte: u8) -> Result<Type> {
        match byte {
            0 => Ok(Type::End),
            1 => Ok(Type::Byte),
            2 => Ok(Type::Short),
            3 => Ok(Type::Int),
            4 => Ok(Type::Long),
            5 => Ok(Type::Float),
            6 => Ok(Type::Double),
            7 => Ok(Type::ByteArray),
            8 => Ok(Type::Str),
            9 => Ok(Type::List),
            10 => Ok(Type::Compound),
            11 => Ok(Type::IntArray),
            12 => Ok(Type::LongArray),
            b => Err(ParseError::UnknownTag(b)),
        }
    }
}

/// NBT Parse error.
#[derive(Debug)]
pub enum ParseError {
    InvalidUTF8(FromUtf8Error),
    ReadError(io::Error),
    UnexpectedEndOfInput,
    UnexpectedTag,
    UnknownTag(u8),
}

impl fmt::Display for ParseError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match self {
            ParseError::InvalidUTF8(ref cause) => cause.fmt(f),
            ParseError::ReadError(ref cause) => cause.fmt(f),
            ParseError::UnexpectedEndOfInput => write!(f, "unexpected input end"),
            ParseError::UnexpectedTag => write!(f, "unexpected tag"),
            ParseError::UnknownTag(b) => write!(f, "found unknown tag {}", b),
        }
    }
}

impl std::error::Error for ParseError {
    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
        match self {
            ParseError::ReadError(ref cause) => Some(cause),
            ParseError::InvalidUTF8(ref cause) => Some(cause),
            _ => None,
        }
    }
}

impl From<io::Error> for ParseError {
    fn from(e: io::Error) -> ParseError {
        match e.kind() {
            io::ErrorKind::UnexpectedEof => ParseError::UnexpectedEndOfInput,
            _ =>


ical-align: middle;
  margin-right: 2px;
}
.tagbox {
  cursor: text;
}
.tagbox .textbox-text {
  float: left;
}
.tagbox-label {
  position: relative;
  display: block;
  margin: 4px 0 0 4px;
  padding: 0 20px 0 4px;
  float: left;
  vertical-align: top;
  text-decoration: none;
  -moz-border-radius: 5px 5px 5px 5px;
  -webkit-border-radius: 5px 5px 5px 5px;
  border-radius: 5px 5px 5px 5px;
  background: #777;
  color: #fff;
}
.tagbox-remove {
  background: url('images/tagbox_icons.png') no-repeat -16px center;
  position: absolute;
  display: block;
  width: 16px;
  height: 16px;
  right: 2px;
  top: 50%;
  margin-top: -8px;
  opacity: 0.6;
  filter: alpha(opacity=60);
}
.tagbox-remove:hover {
  opacity: 1;
  filter: alpha(opacity=100);
}
.textbox-disabled .tagbox-label {
  cursor: default;
}
.textbox-disabled .tagbox-remove:hover {
  cursor: default;
  opacity: 0.6;
  filter: alpha(opacity=60);
}
.layout {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  z-index: 0;
}
.layout-panel {
  position: absolute;
  overflow: hidden;
}
.layout-body {
  min-width: 1px;
  min-height: 1px;
}
.layout-panel-east,
.layout-panel-west {
  z-index: 2;
}
.layout-panel-north,
.layout-panel-south {
  z-index: 3;
}
.layout-expand {
  position: absolute;
  padding: 0px;
  font-size: 1px;
  cursor: pointer;
  z-index: 1;
}
.layout-expand .panel-header,
.layout-expand .panel-body {
  background: transparent;
  filter: none;
  overflow: hidden;
}
.layout-expand .panel-header {
  border-bottom-width: 0px;
}
.layout-expand .panel-body {
  position: relative;
}
.layout-expand .panel-body .panel-icon {
  margin-top: 0;
  top: 0;
  left: 50%;
  margin-left: -8px;
}
.layout-expand-west .panel-header .panel-icon,
.layout-expand-east .panel-header .panel-icon {
  display: none;
}
.layout-expand-title {
  position: absolute;
  top: 0;
  left: 21px;
  white-space: nowrap;
  word-wrap: normal;
  -webkit-transform: rotate(90deg);
  -webkit-transform-origin: 0 0;
  -moz-transform: rotate(90deg);
  -moz-transform-origin: 0 0;
  -o-transform: rotate(90deg);
  -o-transform-origin: 0 0;
  transform: rotate(90deg);
  transform-origin: 0 0;
}
.layout-expand-with-icon {
  top: 18px;
}
.layout-expand .panel-body-noheader .layout-expand-title,
.layout-expand .panel-body-noheader .panel-icon {
  top: 5px;
}
.layout-expand .panel-body-noheader .layout-expand-with-icon {
  top: 23px;
}
.layout-split-proxy-h,
.layout-split-proxy-v {
  position: absolute;
  font-size: 1px;
  display: none;
  z-index: 5;
}
.layout-split-proxy-h


 29),
        Rx.Observable.of('Foo', 'Bar', 'Beer'),
        Rx.Observable.of(true, true, false),
        (age: number, name: string,
          isDev: boolean) => ({ age, name, isDev })
        )
        .subscribe(v => console.log(v),
        (err) => { },
        () => this.isRuning = false);
  }
  runDemo3zip() {
    Rx.Observable
      .zip(
      Rx.Observable.of(27, 25, 29),
      Rx.Observable.of('Foo', 'Bar', 'Beer'),
      Rx.Observable.of(true, true, false),
      (age: number, name: string,
        isDev: boolean) => ({ age, name, isDev })
      )
      .subscribe(v => console.log(v));
  }

  runDemo0() {
    const order1 = [1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1];
    const order2 = [0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0];
    this.isRuning = true;
    this.demo0subscribe =
      Rx.Observable
        .zip(
        Rx.Observable
          .zip(
          Rx.Observable
            .of(1, 2, 3, 4, 5),
          Rx.Observable
            .interval(1000)
            .filter(v => order1[v] === 1),
          x => x
          )
          .do(v => console.log(this.dateTool.getNowBymmsszz() +
            ' 数字$发出: ' + v)),
        Rx.Observable
          .zip(
          Rx.Observable
            .of('A', 'B', 'C', 'D'),
          Rx.Observable
            .interval(1000)
            .filter(v => order2[v] === 1),
          x => x
          )
          .do(v => console.log(this.dateTool.getNowBymmsszz() +
            ' 字母$发出: ' + v)),
      )
        .subscribe(v => console.log(v),
        (err) => { },
        () => this.isRuning = false);
  }
  runDemo0zip() {
    const order1 = [1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1];
    const order2 = [0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0];
    Rx.Observable
      .zip(
      Rx.Observable
        .zip(
        Rx.Observable
          .of(1, 2, 3, 4, 5),
        Rx.Observable
          .interval(1000)
          .filter(v => order1[v] === 1),
        x => x
        ),
      Rx.Observable
        .zip(
        Rx.Observable
          .of('A', 'B', 'C', 'D'),
        Rx.Observable
          .interval(1000)
          .filter(v => order2[v] === 1),
        x => x
        )
      )
      .subscribe(v => console.log(v));
  }
}
import { phi_array } from './NumberTheory'
import { range, map, sum, add } from 'ramda'
import * as Long from 'long'

const g = N => {
    const phi = phi_array(N+1)
    let ans = Long.fromInt(0);
    for (var n = 1; n < N; n+=2) {
        ans = ans.add(phi[n])
    }
    return ans.toString()
}

console.log(g(5*10**8))import { Campaign, CampaignPermissions, CollectionTypeMap } from '@/types';
import { Collection, Db, MongoClient } from 'mongodb';

type ConnType = {
  client: MongoClient;
  db: Db;
};

type CachedType = {
  conn: ConnType | null;
  promise: Promise<ConnType> | null;
};

const MONGODB_URI = process.env.MONGODB_URI;

export const getUserCampaignPermissions = (
  userId: string,
  campaign: Campaign
): CampaignPermissions => {
  const owner = campaign.creator === userId;
  const manager =
    owner || campaign.managers?.some(({ id }) => id === userId) || false;
  const influencer =
    (owner ||
      manag


                            content = "${gptBuffer}[Error]",
                            timestamp = System.currentTimeMillis(),
                            isStop = true,
                            isAI = true))
                    }

                    e.printStackTrace()
                }
            }
        } catch (e: Exception) {
            e.printStackTrace()
            apiLoading = false
        }
    }

    private suspend fun responseMessage(msgId: String, response: String, isStop: Boolean) {
        // 获取到结果之后切换到主线程
        withContext(Dispatchers.Main) {
            // gpt 回答结果返回
//            LogUtil.e(TAG, "chat openai gptBuffer：$response")
            // response
            val timestamp = System.currentTimeMillis()
            val newReceiveMessage = Message(mid = msgId,
                cid = chatId,
                content = if (isStop) response else response.plus("..."),
                timestamp = timestamp,
                isStop = isStop,
                isAI = true)
            // Add the new message to the list and update the RecyclerView
            messageAdapter.addMessage(newReceiveMessage)

            // TODO 同步数据到 本地数据库
            syncChat.lastMessage = response.take(50)
            syncChat.timestamp = timestamp
            syncMessages.add(newReceiveMessage)
            syncMessages(syncChat, syncMessages)
            app.sharedPrefHelper.lastChatEmpty = false
            if (isStop) {
                viewModel.addMessage(ChatRole.Assistant, response)
                val position = messageAdapter.itemCount - 1
                scrollToBottomOfItem(binding.recyclerView, position)

                apiLoading = false
                LogUtil.e(TAG, "......END......")
            }
        }
    }

    // 同步数据
    private fun syncMessages(chat: Chat, messages: CopyOnWriteArrayList<Message>) {
        lifecycleScope.launch {
            app.repository.insertChat(chat)
            app.repository.insertMessages(messages)
            syncMessages.clear()
        }
    }

    private fun scrollToBottomOfItem(recyclerView: RecyclerView, position: Int) {
        try {
            val layoutManager = recyclerView.layoutManager as LinearLayoutManager
            val view = layoutManager.findViewByPosition(position)
            if (view != null) {
                val itemHeight = view.height
                val recyclerViewHeight = recyclerView.height
                if (itemHeight > recyclerViewHeight) {
                    val topMargin = itemHeight - recyclerViewHeight
                    layoutManager.scrollToPositionWithOffset(position, -topMargin)
                } else {
                    layoutManager.scrollToPosition(position)
                }
            }
        } catch (e: Exception) {
            e.printStackTrace()
            recyclerView.smoothScrollToPosition(position)
        }
    }

    private fun hideInputMethod() {
        try {
            val imm = activity?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
            if (imm.isActive) {
                binding.messageEditText.clearFocus()
                imm.hideSoftInputFromWindow(binding.messageEditText.windowToken, 0)
            }
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }

    private fun showInputMethod() {
        try {
            val imm = activity?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
            imm.showSoftInput(binding.messageEditText, InputMethodManager.SHOW_IMPLICIT)
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }
}package com.skylake.skytv.jgorunner.utils

import android.content.Context
import android.os.Environment
import android.util.Log
import java.io.File
import java.io.FileOutputStream
import java.io.OutputStreamWriter

fun createJsonFile(context: Context, fileName: String, jsonData: String, useExternalStorage: Boolean) {
    val file: File

    if (useExternalStorage) {
        // Get external storage directory
        val externalStoragePath = Environment.getExternalStorageDirectory().path
        val folder = File(externalStoragePath, ".jiotv_go")

        // Create the folder if it doesn't exist
        if (!folder


}

private val Shape: CornerBasedShape = RoundedCornerShape(
    topStart = CornerSize(0),
    topEnd = CornerSize(0),
    bottomStart = CornerSize(0),
    bottomEnd = CornerSize(0),
)

internal fun createButtonColor(hue: Float) = Color.hsv(hue * 360, 0.3f, 1f)

@Composable
private fun WallbreakerTypography() = Typography().run {
    val fontFamily = KanitRegularFontFamily()
    copy(
        displayLarge = displayLarge.copy(fontFamily = fontFamily),
        displayMedium = displayMedium.copy(fontFamily = fontFamily),
        displaySmall = displaySmall.copy(fontFamily = fontFamily),
        headlineLarge = headlineLarge.copy(fontFamily = fontFamily),
        headlineMedium = headlineMedium.copy(fontFamily = fontFamily),
        headlineSmall = headlineSmall.copy(fontFamily = fontFamily),
        titleLarge = titleLarge.copy(fontFamily = fontFamily),
        titleMedium = titleMedium.copy(fontFamily = fontFamily),
        titleSmall = titleSmall.copy(fontFamily = fontFamily),
        bodyLarge = bodyLarge.copy(fontFamily = fontFamily),
        bodyMedium = bodyMedium.copy(fontFamily = fontFamily),
        bodySmall = bodySmall.copy(fontFamily = fontFamily),
        labelLarge = labelLarge.copy(fontFamily = fontFamily),
        labelMedium = labelMedium.copy(fontFamily = fontFamily),
        labelSmall = labelSmall.copy(fontFamily = fontFamily)
    )
}

@Composable
private fun KanitRegularFontFamily() = FontFamily(
    Font(Res.font.kanit_regular)
)/*
 * This file is part of Kubriko.
 * Copyright (c) Pandula Péter 2025.
 * https://github.com/pandulapeter/kubriko
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 * If a copy of the MPL was not distributed with this file, You can obtain one at
 * https://mozilla.org/MPL/2.0/.
 */
package com.pandulapeter.kubriko.gameWallbreaker.implementation.managers

import com.pandulapeter.kubriko.Kubriko
import com.pandulapeter.kubriko.actor.traits.Group
import com.pandulapeter.kubriko.actor.traits.Unique
import com.pandulapeter.kubriko.gameWallbreaker.implementation.actors.Ball
import com.pandulapeter.kubriko.gameWallbreaker.implementation.actors.Brick
import com.pandulapeter.kubriko.gameWallbreaker.implementation.actors.Paddle
import com.pandulapeter.kubriko.manager.ActorManager
import com.pandulapeter.kubriko.manager.Manager
import com.pandulapeter.kubriko.manager.StateManager
import com.pandulapeter.kubriko.shaders.collection.ChromaticAberrationShader
import com.pandulapeter.kubriko.shaders.collection.SmoothPixelationShader
import com.pandulapeter.kubriko.shaders.collection.VignetteShader
import com.pandulapeter.kubriko.types.SceneOffset
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach

internal class GameplayManager(
    private val stateManager: StateManager,
) : Manager(), Unique, Group {

    private val actorManager by manager<ActorManager>()
    private val audioManager by manager<AudioManager>()
    private val scoreManager by manager<ScoreManager>()
    private val uiManager by manager<UIManager>()
    private val paddle = Paddle()
    private val _isGameOver = MutableStateFlow(true)
    val isGameOver = _isGameOver.asStateFlow()
    val isGameStarted get()


] = 0;
    FS_FCloseFile(f);
    Scr_AddSourceBufferInternal(extFilename, codePos, sourceBuf, len, 1, archive);
    return sourceBuf;
  }
  Scr_AddSourceBufferInternal(extFilename, codePos, 0, -1, 1, archive);
  return NULL;
}

char *__cdecl Scr_ReadFile(const char *filename, const char *extFilename, const char *codePos, bool archive)
{
  int file;

//  if ( fs_gameDirVar && fs_gameDirVar->string[0])
  {
    if ( FS_FOpenFileRead(extFilename, &file) < 0 )
    {
      return Scr_ReadFile_FastFile(filename, extFilename, codePos, archive);
    }
    FS_FCloseFile(file);
    return Scr_ReadFile_LoadObj(filename, extFilename, codePos, archive);
  }
/*
Impure script locked mode here:
  if ( useFastFile->boolean )
  {
    return Scr_ReadFile_FastFile(filename, extFilename, codePos, archive);
  }
  return Scr_ReadFile_LoadObj(filename, extFilename, codePos, archive);
*/
}

extern "C"{

void Scr_PrintSourcePos(conChannel_t channel, const char *filename, const char *buf, unsigned int sourcePos)
{
  const char *s;
  unsigned int lineNum;
  char line[1024];
  int i;
  int col;

  lineNum = Scr_GetLineInfo(buf, sourcePos, &col, line);
  if ( gScrParserGlob.saveSourceBufferLookup )
  {
    s = " (savegame)";
  }
  else
  {
    s = "";
  }
  Com_Printf(channel, "(file '%s'%s, line %d)\n", filename, s, lineNum + 1);
  Com_Printf(channel, "%s\n", line, 0);
  for ( i = 0; i < col; ++i )
  {
    Com_Printf(channel, " ");
  }
  Com_Printf(channel, "*\n");
}

unsigned int __cdecl Scr_GetSourceBuffer(const char *codePos)
{
  unsigned int bufferIndex;

    assert(Scr_IsInOpcodeMemory(codePos ));
    assert(gScrParserPub.sourceBufferLookupLen > 0);

  for ( bufferIndex = gScrParserPub.sourceBufferLookupLen - 1;
        bufferIndex && (!gScrParserPub.sourceBufferLookup[bufferIndex].codePos || gScrParserPub.sourceBufferLookup[bufferIndex].codePos > codePos);
        --bufferIndex );
  return bufferIndex;
}

void __cdecl Scr_PrintPrevCodePos(conChannel_t channel, const char *codePos, unsigned int index)
{
  unsigned int bufferIndex;

  if ( !codePos )
  {
    Com_Printf(channel, "<frozen thread>\n");
    return;
  }
  if ( codePos == &g_EndPos )
  {
    Com_Printf(channel, "<removed thread>\n");
  }
  else
  {
    if ( gScrVarPub.developer )
    {
      if ( gScrVarPub.programBuffer && Scr_IsInOpcodeMemory(codePos) )
      {
        bufferIndex = Scr_GetSourceBuffer(codePos - 1);
        Scr_PrintSourcePos(channel, gScrParserPub.sourceBufferLookup[bufferIndex].buf, gScrParserPub.sourceBufferLookup[bufferIndex].sourceBuf, Scr_GetPrevSourcePos(codePos - 1, index));
        return;
      }
    }
    else if ( Scr_IsInOpcodeMemory(codePos - 1) )
    {
      Com_Printf(channel, "@ %d\n", codePos - gScrVarPub.programBuffer);
      return;
    }
    Com_Print


imini-qiuck-module {
    @extend .layui-btn;

    i {
        background-color: transparent
    }
}

.layui-side.layui-bg-black,
.layui-side.layui-bg-black>.layuimini-menu-left>ul,
.layuimini-menu-left-zoom>ul {
    @extend .layui-btn;
    background-color: #EBECF0 !important;
    border-radius: 0;
}

.layuimini-menu-left .layui-nav .layui-nav-item a,
.layuimini-menu-left-zoom.layui-nav .layui-nav-item a {
    @extend .layui-btn;

    &:hover {
        box-shadow: -2px -2px 5px #FFF, 2px 2px 5px #BABECC;
    }
}

.layui-nav-tree .layui-nav-item {
    margin: 10px;
    width: calc(100% - 20px);
}

.layuimini-menu-left .layui-nav-itemed>.layui-nav-child {
    background-color: transparent !important;
}

.layui-nav-tree .layui-nav-child dd {
    margin: 10px;
    width: calc(100% - 20px);
}

.layuimini-menu-left .layui-nav-tree .layui-this,
.layuimini-menu-left .layui-nav-tree .layui-this>a,
.layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this,
.layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this a,
.layuimini-menu-left-zoom.layui-nav-tree .layui-this,
.layuimini-menu-left-zoom.layui-nav-tree .layui-this>a,
.layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this,
.layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this a {
    background-color: inherit !important;
}

.layuimini-menu-left .layui-nav .layui-nav-item a:hover,
.layuimini-menu-left .layui-nav .layui-this a,
.layuimini-menu-left-zoom.layui-nav .layui-nav-item a:hover,
.layuimini-menu-left-zoom.layui-nav .layui-this a {
    color: $main-color !important;
}

.layui-layout-admin .layuimini-logo {
    background-color: transparent !important;
}

.layui-header {
    .layuimini-header-menu>.layui-nav-item {
        @extend .layui-btn;
        margin: 10px;
        line-height: 40px !important;
        height: 40px !important;
    }

    .layui-nav .layui-nav-item {
        @extend .layui-btn;
        margin: 10px;
        line-height: 40px !important;
        height: 40px !important;
    }
}

.layui-btn-xs {
    padding: 0 9px;
}

.layui-input,
.layui-textarea {
    border: 0;
    outline: 0;
    font-size: 16px;
    border-radius: 320px;
    padding: 16px;
    background-color: #EBECF0;
    text-shadow: 1px 1px 0 #FFF;
    margin-right: 8px;
    box-shadow: inset 2px 2px 5px #BABECC, inset -5px -5px 10px #FFF;
    width: 100%;
    box-sizing


uble[]{2.7, 3.2, 0.8});

        ChartDataLabelCollection labels = series.getDataLabels();
        labels.setShowPercentage(true);
        labels.setShowValue(true);
        labels.setShowLeaderLines(false);
        labels.setSeparator(" - ");

        doc.save(getArtifactsDir() + "WorkingWithCharts.DefaultOptionsForDataLabels.docx");
        //ExEnd:DefaultOptionsForDataLabels
    }

    @Test
    public void singleChartDataPoint() throws Exception {
        //ExStart:WorkWithSingleChartDataPoint
        //GistId:23d39c0b874655d7e7354f1ecc122e39
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);

        Shape shape = builder.insertChart(ChartType.LINE, 432.0, 252.0);

        Chart chart = shape.getChart();
        ChartSeries series0 = chart.getSeries().get(0);
        ChartSeries series1 = chart.getSeries().get(1);

        ChartDataPointCollection dataPointCollection = series0.getDataPoints();
        ChartDataPoint dataPoint00 = dataPointCollection.get(0);
        ChartDataPoint dataPoint01 = dataPointCollection.get(1);

        dataPoint00.setExplosion(50);
        dataPoint00.getMarker().setSymbol(MarkerSymbol.CIRCLE);
        dataPoint00.getMarker().setSize(15);

        dataPoint01.getMarker().setSymbol(MarkerSymbol.DIAMOND);
        dataPoint01.getMarker().setSize(20);

        ChartDataPoint dataPoint12 = series1.getDataPoints().get(2);
        dataPoint12.setInvertIfNegative(true);
        dataPoint12.getMarker().setSymbol(MarkerSymbol.STAR);
        dataPoint12.getMarker().setSize(20);

        doc.save(getArtifactsDir() + "WorkingWithCharts.SingleChartDataPoint.docx");
        //ExEnd:WorkWithSingleChartDataPoint
    }

    @Test
    public void singleChartSeries() throws Exception {
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);

        Shape shape = builder.insertChart(ChartType.LINE, 432.0, 252.0);
        Chart chart = shape.getChart();

        //ExStart:WorkWithSingleChartSeries
        //GistId:23d39c0b874655d7e7354f1ecc122e39
        ChartSeries series0 = chart.getSeries().get(0);
        ChartSeries series1 = chart.getSeries().get(1);

        series0.setName("Chart Series Name 1");
        series1.setName("Chart Series Name 2");

        // You can also specify whether the line connecting the points on the chart shall be smoothed using Catmull-Rom splines.
        series0.setSmooth(true);
        series1.setSmooth(true);
        //ExEnd:WorkWithSingleChartSeries

        //ExStart:ChartDataPoint
        //GistId:23d39c0b874655d7e7354f1ecc122e39
        // Specifies whether by default the parent element shall inverts its colors if the value is negative.
        series0.setInvertIfNegative(true);

        series0.getMarker().setSymbol(MarkerSymbol.CIRCLE);
        series0.getMarker().setSize(15);

        series1.getMarker().setSymbol(MarkerSymbol.STAR);
        series1.getMarker().setSize(10);
        //ExEnd:ChartDataPoint

        doc.save(getArtifactsDir() + "WorkingWithCharts.SingleChartSeries.docx");
    }

    @Test
    public void fillFormatting() throws Exception {
        //ExStart:FillFormatting
        //GistId:23d39c0b874655d7e7354f1ecc122e39
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);

        Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);
        Chart chart = shape.getChart();
        ChartSeriesCollection seriesColl = chart.getSeries();

        // Delete


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WrongAnswerImageManager : MonoBehaviour
{
    [SerializeField] private Image wrongAnswerImage;
    private bool wrongAnswerShown = false;

    // Show the wrong answer image
    public void ShowWrongAnswerImage()
    {
        if (!wrongAnswerShown)
        {
            wrongAnswerImage.gameObject.SetActive(true);
            wrongAnswerShown = true;
            // Start a coroutine to hide the wrong answer image after a delay
            StartCoroutine(Hide


usr_curs_pos, false, false) -- restore usr cursor pos
  reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_RESTOREVIEW"), 0) -- RESTORE VIEW
  reaper.Undo_EndBlock("Align Items by transients", -1)
  reaper.PreventUIRefresh(-777)
  ------------------------------------------------
  ------------------------------------------------
  reaper.UpdateTimeline()
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--   Draw controls(buttons,sliders,knobs etc)  ---------------------------------
--------------------------------------------------------------------------------
function draw_controls()
    --for key,btn    in pairs(Button_TB)   do btn:draw()    end
    for key,sldr   in pairs(Slider_TB)   do sldr:draw()   end
    for key,ch_box in pairs(CheckBox_TB) do ch_box:draw() end
    --for key,frame  in pairs(Frame_TB)    do frame:draw()  end
end
--------------------------------------------------------------------------------
--   INIT   --------------------------------------------------------------------
--------------------------------------------------------------------------------
function Init()
    -- Some gfx Wnd Default Values ---------------
    local R,G,B = 20,20,20              -- 0...255 format
    local Wnd_bgd = R + G*256 + B*65536 -- red+green*256+blue*65536
    local Wnd_Title = "Align Items"
    local Wnd_Dock,Wnd_X,Wnd_Y = 0,100,350
    Wnd_W,Wnd_H = 320,130 -- global values(used for define zoom level)
    -- Init window ------
    gfx.clear = Wnd_bgd
    gfx.init( Wnd_Title, Wnd_W,Wnd_H, Wnd_Dock, Wnd_X,Wnd_Y )
    -- Init mouse last --


()));
						needReload();
					});
					pluginsGroup.addRow(title, combo);
				}
			}
		}
		return pluginsGroup;
	}

	private SettingsGroup makeOtherGroup() {
		JComboBox<LangLocale> languageCbx = new JComboBox<>(NLS.getLangLocales());
		for (LangLocale locale : NLS.getLangLocales()) {
			if (locale.equals(settings.getLangLocale())) {
				languageCbx.setSelectedItem(locale);
				break;
			}
		}
		languageCbx.addActionListener(e -> settings.setLangLocale((LangLocale) languageCbx.getSelectedItem()));

		JComboBox<LineNumbersMode> lineNumbersMode = new JComboBox<>(LineNumbersMode.values());
		lineNumbersMode.setSelectedItem(settings.getLineNumbersMode());
		lineNumbersMode.addActionListener(e -> {
			settings.setLineNumbersMode((LineNumbersMode) lineNumbersMode.getSelectedItem());
			mainWindow.loadSettings();
		});

		JCheckBox jumpOnDoubleClick = new JCheckBox();
		jumpOnDoubleClick.setSelected(settings.isJumpOnDoubleClick());
		jumpOnDoubleClick.addItemListener(e -> settings.setJumpOnDoubleClick(e.getStateChange() == ItemEvent.SELECTED));

		JCheckBox useAltFileDialog = new JCheckBox();
		useAltFileDialog.setSelected(settings.isUseAlternativeFileDialog());
		useAltFileDialog.addItemListener(e -> settings.setUseAlternativeFileDialog(e.getStateChange() == ItemEvent.SELECTED));

		JCheckBox update = new JCheckBox();
		update.setSelected(settings.isCheckForUpdates());
		update.addItemListener(e -> settings.setCheckForUpdates(e.getStateChange() == ItemEvent.SELECTED));

		JCheckBox cfg = new JCheckBox();
		cfg.setSelected(settings.isCfgOutput());
		cfg.addItemListener(e -> {
			settings.setCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
			needReload();
		});

		JCheckBox rawCfg = new JCheckBox();
		rawCfg.setSelected(settings.isRawCfgOutput());
		rawCfg.addItemListener(e -> {
			settings.setRawCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
			needReload();
		});

		SettingsGroup group = new SettingsGroup(NLS.str("preferences.other"));
		group.addRow(NLS.str("preferences.language"), languageCbx);
		group.addRow(NLS.str("preferences.lineNumbersMode"), lineNumbersMode);
		group.addRow(NLS.str("preferences.jumpOnDoubleClick"), jumpOnDoubleClick);
		group.addRow(NLS.str("preferences.useAlternativeFileDialog"), useAltFileDialog);
		group.addRow(NLS.str("preferences.check_for_updates"), update);
		group.addRow(NLS.str("preferences.cfg"), cfg);
		group.addRow(NLS.str("preferences.raw_cfg"), rawCfg);
		return group;
	}

	private SettingsGroup makeSearchResGroup() {
		JSpinner resultsPerPage = new JSpinner(
				new SpinnerNumberModel(settings.getSearchResultsPerPage(), 0, Integer.MAX_VALUE, 1));
		resultsPerPage.addChangeListener(ev -> settings.setSearchResultsPerPage((Integer) resultsPerPage.getValue()));

		JSpinner sizeLimit = new JSpinner(
				new SpinnerNumberModel(settings.getSrhResourceSkipSize(), 0, Integer.MAX_VALUE, 1));
		sizeLimit.addChangeListener(ev -> settings.setSrhResourceSkipSize((Integer) sizeLimit.getValue()));

		JTextField fileExtField = new JTextField();
		fileExtField.getDocument().addDocumentListener(new DocumentUpdateListener((ev) -> {
			String ext = fileExtField.getText


 := products.ColorVariation{}
			colorVariation.ProductID = product.ID
			colorVariation.ColorID = color.ID
			colorVariation.ColorCode = cv.ColorCode

			for _, i := range cv.Images {
				image := products.ProductImage{Title: p.Name, SelectedType: "image"}
				if file, err := openFileByURL(i.URL); err != nil {
					fmt.Printf("open file (%q) failure, got err %v", i.URL, err)
				} else {
					defer file.Close()
					image.File.Scan(file)
				}
				if err := DraftDB.Create(&image).Error; err != nil {
					log.Fatalf("create color_variation_image (%v) failure, got err %v when %v", image, err, i.URL)
				} else {
					colorVariation.Images.Files = append(colorVariation.Images.Files, media_library.File{
						ID:  json.Number(fmt.Sprint(image.ID)),
						Url: image.File.URL(),
					})

					Admin := qoradmin.New(&qoradmin.AdminConfig{
						SiteName: "QOR DEMO",
						Auth:     auth.AdminAuth{},
						DB:       db.DB.Set(publish2.VisibleMode, publish2.ModeOff).Set(publish2.ScheduleMode, publish2.ModeOff),
					})

					colorVariation.Images.Crop(Admin.NewResource(&products.ProductImage{}), DraftDB, media_library.MediaOption{
						Sizes: map[string]*media.Size{
							"main":    {Width: 560, Height: 700},
							"icon":    {Width: 50, Height: 50},
							"preview": {Width: 300, Height: 300},
							"listing": {Width: 640, Height: 640},
						},
					})

					if len(product.MainImage.Files) == 0 {
						product.MainImage.Files = []media_library.File{{
							ID:  json.Number(fmt.Sprint(image.ID)),
							Url: image.File.URL(),
						}}
						DraftDB.Save(&product)
					}
				}
			}

			if err := DraftDB.Create(&colorVariation).Error; err != nil {
				log.Fatalf("create color_variation (%v) failure, got err %v", colorVariation, err)
			}

			for _, sv := range p.SizeVariations {
				size := findSizeByName(sv.SizeName)

				sizeVariation := products.SizeVariation{}
				sizeVariation.ColorVariationID = colorVariation.ID
				sizeVariation.SizeID = size.ID
				sizeVariation.AvailableQuantity = 20
				if err := DraftDB.Create(&sizeVariation).Error; err != nil {
					log.Fatalf("create size_variation (%v) failure, got err %v", sizeVariation, err)
				}
			}
		}

		product.Name = p.ZhName
		product.Description = p.ZhDescription
		product.MadeCountry = p.ZhMadeCountry
		product.Gender = p.ZhGender
		DraftDB.Set("l10n:locale", "zh-CN").Create(&product)

		if idx%3 == 0 {
			start := time.Now().AddDate(0, 0, idx-7)
			end := time.Now().AddDate(0, 0, idx-4)
			product.SetVersionName("v1")
			product.Name = p.Name + " - v1"
			product.Description = p.Description + " - v1"
			product.MadeCountry = p.MadeCountry
			product.Gender = p.Gender
			product.SetScheduledStartAt(&start)
			product.SetScheduledEndAt(&end)
			DraftDB.Save(&product)
		}

		if idx%2 == 0 {
			start := time.Now().AddDate(0, 0, idx-7)
			end := time.Now().AddDate(0, 0, idx-4)
			product.SetVersionName("v1")
			product.Name = p.ZhName + " - 版本 1"
			product.Description = p.Z


 y(-80));
    path.close();

    canvas.drawPath(path, paint);
  }

  void _drawNeutral(Canvas canvas, Size size, Paint paint) {
    // Create filled paint style for features
    final fillPaint = Paint()
      ..color = paint.color
      ..style = PaintingStyle.fill;

    Path path = Path();
    Path featurePath = Path();

    // Right eye
    featurePath.moveTo(x(626), y(-533));
    featurePath.quadraticBezierTo(x(648.5), y(-533), x(664.25), y(-548.75));
    featurePath.quadraticBezierTo(x(680), y(-564.5), x(680), y(-587));
    featurePath.quadraticBezierTo(x(680), y(-609.5), x(664.25), y(-625.25));
    featurePath.quadraticBezierTo(x(648.5), y(-641), x(626), y(-641));
    featurePath.quadraticBezierTo(x(603.5), y(-641), x(587.75), y(-625.25));
    featurePath.quadraticBezierTo(x(572), y(-609.5), x(572), y(-587));
    featurePath.quadraticBezierTo(x(572), y(-564.5), x(587.75), y(-548.75));
    featurePath.quadraticBezierTo(x(603.5), y(-533), x(626), y(-533));
    featurePath.close();

    // Left eye
    featurePath.moveTo(x(334), y(-533));
    featurePath.quadraticBezierTo(x(356.5), y(-533), x(372.25), y(-548.75));
    featurePath.quadraticBezierTo(x(388), y(-564.5), x(388), y(-587));
    featurePath.quadraticBezierTo(x(388), y(-609.5), x(372.25), y(-625.25));
    featurePath.quadraticBezierTo(x(356.5), y(-641), x(334), y(-641));
    featurePath.quadraticBezierTo(x(311.5), y(-641), x(295.75), y(-625.25));
    featurePath.quadraticBezierTo(x(280), y(-609.5), x(280), y(-587));
    featurePath.quadraticBezierTo(x(280), y(-564.5), x(295.75), y(-548.75));
    featurePath.quadraticBezierTo(x(311.5), y(-533), x(334), y(-533));
    featurePath.close();

    // Neutral mouth
    featurePath.moveTo(x(354), y(-339));
    featurePath.lineTo(x(607), y(-339));
    featurePath.lineTo(x(607), y(-388));
    featurePath.lineTo(x(354), y(-388));
    featurePath.lineTo(x(354), y(-339));
    featurePath.close();

    // Draw filled features
    canvas.drawPath(featurePath, fillPaint);

    // Circle outline
    path.moveTo(x(480), y(-80));
    path.quadraticBezierTo(x(397), y(-80), x(324), y(-111.5));
    path.quadraticBezierTo(x(251), y(-143), x(197), y(-197));
    path.quadraticBezierTo(x(143), y(-251), x(111.5), y(-324));
    path.quadraticBezierTo(x(80), y(-397), x(80), y(-480));
    path.quadraticBezierTo(x(80), y(-563), x(111.5), y(-636));
    path.quadraticBezierTo(x(143), y(-709), x(197), y(-763));
    path.quadraticBezierTo(x(251), y(-817), x(324), y(-848.5));
    p


# -*- coding: utf-8 -*-

# Created on 2017-11-28
# author: 欧度智能，https://www.odooai.cn
# email: 300883@qq.com
# resource of odooai
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

# Odoo在线中文用户手册（长期更新）
# https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html

# Odoo10离线中文用户手册下载
# https://www.odooai.cn/odoo10_user_manual_document_offline/
# Odoo10离线开发手册下载-含python教程，jquery参考，Jinja2模板，PostgresSQL参考（odoo开发必备）
# https://www.odooai.cn/odoo10_developer_document_offline/
# description:

from odoo import api, fields, models, exceptions, _

class ProductCategory(models.Model):
    _inherit = 'product.category'

    # 更新 complete_name 算法，当有context: show_short_category =1 时，只显示短名
    def name_get(self):
        if self._context.get('show_short_category'):
            new_res = []
            for category in self:
                name = category.name
                new_res.append((category.id, name))
            return new_res
        else:
            return super(ProductCategory, self).name_get()


using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Moq;
using SportsStore.Infrastructure;
using SportsStore.Models.ViewModels;
using Xunit;

namespace SportsStore.Tests {

    public class PageLinkTagHelperTests {

        [Fact]
        public void Can_Generate_Page_Links() {
            // Arrange
            var urlHelper = new Mock<IUrlHelper>();
            urlHelper.SetupSequence(x => x.Action(It.IsAny<UrlActionContext>()))
                .Returns("Test/Page1")
                .Returns("Test/Page2")
                .Returns("Test/Page3");

            var urlHelperFactory = new Mock<IUrlHelperFactory>();
            urlHelperFactory.Setup(f =>
                    f.GetUrlHelper(It.IsAny<ActionContext>()))
                        .Returns(urlHelper.Object);

            PageLinkTagHelper helper =
                    new PageLinkTagHelper(urlHelper


analyst")
builder.add_edge("call_quantitative_analyst", "call_tweet_writer")
builder.add_edge("call_tweet_writer", END)

graph = builder.compile()

async def refresh_auth_task():
    while True:
        try:
            await twitter_client.refresh_auth()
            print(f"Auth refreshed at: {datetime.now()}")
        except Exception as e:
            print(f"Error refreshing auth: {e}")
        await asyncio.sleep(15 * 60)  # Sleep for 15 minutes

async def run_graph():
    inputs = {"facts": []}
    await graph.ainvoke(inputs)

async def main():
    # Create and start the refresh_auth task
    refresh_task = asyncio.create_task(refresh_auth_task())

    try:
        while True:
            await run_graph()
            wait_time = random.randint(40 * 60, 150 * 60)  # Random time between 15 and 45 minutes in seconds
            next_run = datetime.now() + timedelta(seconds=wait_time)
            print(f"Next run scheduled at: {next_run}")
            await asyncio.sleep(wait_time)
    except asyncio.CancelledError:
        # Cancel the refresh_auth task when the main task is cancelled
        refresh_task.cancel()
        await refresh_task
    except Exception as e:
        print(f"An error occurred in the main loop: {e}")
        refresh_task.cancel()
        await refresh_task
    finally:
        # Ensure the refresh_auth task is properly cancelled and cleaned up
        if not refresh_task.done():
            refresh_task.cancel()
            await refresh_task

if __name__ == "__main__":
    asyncio.run(main())


2,111,114,32,120,56,54
.byte	44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32
.byte	60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111
.byte	114,103,62,0
#endif
.section	.note.GNU-stack,"",@progbits


_msgs::msg::EStopStateArray>> estop_states_publisher_;
  std::shared_ptr<rclcpp::Publisher<sensor_msgs::msg::JointState>> joint_state_publisher_;
  std::shared_ptr<rclcpp::Publisher<geometry_msgs::msg::TwistWithCovarianceStamped>> odom_twist_publisher_;
  std::shared_ptr<rclcpp::Publisher<nav_msgs::msg::Odometry>> odom_publisher_;
  std::shared_ptr<rclcpp::Publisher<spot_msgs::msg::PowerState>> power_state_publisher_;
  std::shared_ptr<rclcpp::Publisher<spot_msgs::msg::SystemFaultState>> system_faults_publisher_;
  std::shared_ptr<rclcpp::Publisher<bosdyn_api_msgs::msg::ManipulatorState>> manipulator_state_publisher_;
  std::shared_ptr<rclcpp::Publisher<geometry_msgs::msg::Vector3Stamped>> end_effector_force_publisher_;
  std::shared_ptr<rclcpp::Publisher<spot_msgs::msg::BehaviorFaultState>> behavior_fault_state_publisher_;
};

}  // namespace spot_ros2
// Copyright (c) 2024 Boston Dynamics AI Institute LLC. All rights reserved.

#pragma once

#include <google/protobuf/duration.pb.h>
#include <google/protobuf/timestamp.pb.h>
#include <builtin_interfaces/msg/time.hpp>

namespace spot_ros2 {
/**
 * @brief Convert a timestamp that was reported relative to Spot's onboard clock into a timestamp relative to the host's
 * clock.
 *
 * @param timestamp_robot Timestamp relative to Spot's clock.
 * @param clock_skew The difference as measured by Spot between the host's clock and Spot's onboard clock.
 * @return builtin_interfaces::msg::Time Timestamp relative to the host's clock. If applying the clock skew would result
 * in a timestamp earlier than the epoch, return an all-zero timestamp.
 */
builtin_interfaces::msg::Time robotTimeToLocalTime(const google::protobuf::Timestamp& timestamp_robot,
                                                   const google::protobuf::Duration& clock_skew);

/**
 * @brief Convert a timestamp that was reported relative to the host's clock into a timestamp relative to Spot's onboard
 * clock.
 *
 * @param timestamp_local Timestamp relative to the host's clock
 * @param clock_skew The difference as measured by Spot between the host's clock and Spot's onboard clock.
 * @return google::protobuf::Timestamp Timestamp relative to Spot's onboard clock. If applying the clock skew would
 * result in a timestamp earlier than the epoch, return an all-zero timestamp.
 */
google::protobuf::Timestamp localTimeToRobotTime(const builtin_interfaces::msg::Time& timestamp_local,
                                                 const google::protobuf::Duration& clock_skew);
}  // namespace spot_ros2
// Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved.

#pragma once

#include <google/protobuf/timestamp.pb.h>
#include <google/protobuf/wrappers.pb.h>

#include <bosdyn_api_msgs/msg/arm_joint_position.hpp>
#include <bosdyn_api_msgs/msg/common_error.hpp>
#include <bosdyn_api_msgs/msg/request_header.hpp>
#include <bosdyn_api_msgs/msg/response_header.hpp>

#include <bosdyn/api/arm_command.pb.h>
#include <bosdyn/api/geometry.pb.h>
#include <bosdyn/api/header.pb.h>

#include <geometry_msgs/msg/point.hpp>
#include <geometry_msgs/msg/pose.hpp>
#include <geometry_msgs/msg/quaternion.hpp>
#include <geometry_msgs/msg/transform.hpp>
#include <geometry


4.8% 0.150 160;--wa:84.71% 0.199 83.87;--er:71.76% 0.221 22.18;--bc:83.7682% 0.001658 17.911578;--sc:13.9553% 0.027077 168.327128;--ac:14.1257% 0.02389 185.713193;--nc:86.1397% 0.007806 171.364646;--inc:0% 0 0;--suc:0% 0 0;--wac:0% 0 0;--erc:0% 0 0;--rounded-box:1rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:68.6283% 0.185567 148.958922;--pc:0% 0 0;--s:69.7764% 0.135385 168.327128;--a:70.6285% 0.119451 185.713193;--n:30.6985% 0.039032 171.364646;--b1:18.8409% 0.00829 17.911578;--rounded-btn:1.9rem}:root:has(input.theme-controller[value=forest]:checked){color-scheme:dark;--b2:17.522% 0.007709 17.911578;--b3:16.2032% 0.007129 17.911578;--in:72.06% 0.191 231.6;--su:64.8% 0.150 160;--wa:84.71% 0.199 83.87;--er:71.76% 0.221 22.18;--bc:83.7682% 0.001658 17.911578;--sc:13.9553% 0.027077 168.327128;--ac:14.1257% 0.02389 185.713193;--nc:86.1397% 0.007806 171.364646;--inc:0% 0 0;--suc:0% 0 0;--wac:0% 0 0;--erc:0% 0 0;--rounded-box:1rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:68.6283% 0.185567 148.958922;--pc:0% 0 0;--s:69.7764% 0.135385 168.327128;--a:70.6285% 0.119451 185.713193;--n:30.6985% 0.039032 171.364646;--b1:18.8409% 0.00829 17.911578;--rounded-btn:1.9rem}[data-theme=aqua]{color-scheme:dark;--b2:45.3464% 0.118611 261.181672;--b3:41.9333% 0.109683 261.181672;--bc:89.7519% 0.025508 261.181672;--sc:12.1365% 0.02175 309.782946;--ac:18.6854% 0.020445 94.555431;--nc:12.2124% 0.023402 243.760661;--inc:90.923% 0.043042 262.880917;--suc:12.541% 0.033982 149.213788;--wac:13.3168% 0.031484 58.31834;--erc:14.79% 0.038 27.33;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5


	aria2_http.Send(POST, ARIA2_HTTP_REQUESTURL, strformat);
				std::string strResult = GetInstance()->m_BaiduPare.Utf8_To_Gbk(aria2_http.GetResponseText().c_str());
				LOG(INFO) << "ĳس " << strformat.c_str();
				static auto updateErrorList = [](const std::string strJosn) {
					jsExecState es = wkeGlobalExec(app.window);
					jsValue thisObject = jsGetGlobal(es, "app");
					jsValue func = jsGet(es, thisObject, "updatedownloadErrorList");
					jsValue jsArg[1] = { jsString(es, strJosn.c_str()) };
					jsCall(es, func, thisObject, jsArg, 1);
				};
				rapidjson::Document dc;
				dc.Parse(strResult.c_str());
				if (!dc.IsObject())
					break;
				if (dc.HasMember("result") && dc["result"].IsObject())
				{
					rapidjson::Value itemObj = dc["result"].GetObjectW();
					if (itemObj.HasMember("errorCode") && itemObj["errorCode"].IsString())
					{
						//ʼװjson͸UI̴߳Ⱦ
						rapidjson::Document sendJson;
						std::string strRetryUrl;
						sendJson.SetObject();
						rapidjson::Value sendItemObj(rapidjson::kObjectType);
						DOWNFILELISTINFO ItemValue;
						ZeroMemory(&ItemValue, sizeof(DOWNFILELISTINFO));
						ULONGLONG totalLength, completedLength, downloadSpeed;
						if (itemObj.HasMember("totalLength") && itemObj["totalLength"].IsString())
							sscanf_s(itemObj["totalLength"].GetString(), "%I64d", &totalLength);
						if (itemObj.HasMember("completedLength") && itemObj["completedLength"].IsString())
							sscanf_s(itemObj["completedLength"].GetString(), "%I64d", &completedLength);
						if (itemObj.HasMember("downloadSpeed") && itemObj["downloadSpeed"].IsString())
							sscanf_s(itemObj["downloadSpeed"].GetString(), "%I64d", &downloadSpeed);
						if (itemObj.HasMember("connections") && itemObj["connections"].IsString())
							ItemValue.connections = itemObj["connections"].GetString();
						if (itemObj.HasMember("gid") && itemObj["gid"].IsString())
							ItemValue.strFileGid = itemObj["gid"].GetString();

						ItemValue.nErrCode = atoi(itemObj["errorCode"].GetString());
						ItemValue.strErrMessage = itemObj["errorMessage"].GetString();

						if (itemObj.HasMember("files") && itemObj["files"].IsArray())
						{
							for (auto& keyval : itemObj["files"].GetArray())
							{
								if (keyval.HasMember("path") && keyval["path"].IsString())
								{
									char szName[MAX_PATH];
									ZeroMemory(szName, MAX_PATH);
									std::string szFileName = keyval["path"].GetString();
									ItemValue.strPath = szFileName;
									CopyMemory(szName, szFileName.c_str(), szFileName.length());
									PathStripPathA(szName);
									ItemValue.strFileName = szName;
								}
								if (keyval.HasMember("uris") && keyval["uris"].IsArray())
								{
									rapidjson::Value urisArr = keyval["uris"].GetArray();
									if (urisArr.Size())
									{
										if (urisArr[0].HasMember("uri") && urisArr[0]["uri"].IsString())
										{
											strRetryUrl = urisArr[0]["uri"].GetString();
										}
									}
								}

							}
						}
						ItemValue.Downloadpercentage = (size_t)GetInstance()->Getpercentage(completedLength, totalLength);
						DOWNLOADSPEEDINFO szFileSize = GetInstance()->Ge


/* $NetBSD: nanf.c,v 1.2 2008/04/28 20:23:01 martin Exp $ */

/*-
 * Copyright (c) 2006 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Klaus Klein.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: nanf.c,v 1.2 2008/04/28 20:23:01 martin Exp $");
#endif /* LIBM_SCCS and not lint */

#define	NAN_FUNCTION	nanf
#define	NAN_TYPE	float
#define	NAN_STRTOD	strtof

#include "nan.c"


using System;
using Microsoft.Xna.Framework;

namespace MonoGame.Extended
{
    public abstract class SimpleDrawableGameComponent : SimpleGameComponent, IDrawable
    {
        protected SimpleDrawableGameComponent()
        {
        }

        private bool _isVisible = true;
        public bool Visible
        {
            get => _isVisible;
            set
            {
                if (_isVisible == value)
                    return;

                _isVisible = value;
                VisibleChanged?.Invoke(this, EventArgs.Empty);
            }


78 */	mr r31, r4
/* 8042F47C 0042C3BC  28 00 00 00 */	cmplwi r0, 0
/* 8042F480 0042C3C0  93 C1 00 08 */	stw r30, 8(r1)
/* 8042F484 0042C3C4  7C 7E 1B 78 */	mr r30, r3
/* 8042F488 0042C3C8  40 82 00 20 */	bne .L_8042F4A8
/* 8042F48C 0042C3CC  3C 60 80 4A */	lis r3, lbl_8049A174@ha
/* 8042F490 0042C3D0  3C A0 80 4A */	lis r5, lbl_8049A204@ha
/* 8042F494 0042C3D4  38 63 A1 74 */	addi r3, r3, lbl_8049A174@l
/* 8042F498 0042C3D8  38 80 01 AC */	li r4, 0x1ac
/* 8042F49C 0042C3DC  38 A5 A2 04 */	addi r5, r5, lbl_8049A204@l
/* 8042F4A0 0042C3E0  4C C6 31 82 */	crclr 6
/* 8042F4A4 0042C3E4  4B BF B1 9D */	bl panic_f__12JUTExceptionFPCciPCce
.L_8042F4A8:
/* 8042F4A8 0042C3E8  80 7E 00 20 */	lwz r3, 0x20(r30)
/* 8042F4AC 0042C3EC  7F E4 FB 78 */	mr r4, r31
/* 8042F4B0 0042C3F0  80 63 00 54 */	lwz r3, 0x54(r3)
/* 8042F4B4 0042C3F4  4B BF F8 D1 */	bl getIndex__10JUTNameTabCFPCc
/* 8042F4B8 0042C3F8  80 01 00 14 */	lwz r0, 0x14(r1)
/* 8042F4BC 0042C3FC  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 8042F4C0 0042C400  83 C1 00 08 */	lwz r30, 8(r1)
/* 8042F4C4 0042C404  7C 08 03 A6 */	mtlr r0
/* 8042F4C8 0042C408  38 21 00 10 */	addi r1, r1, 0x10
/* 8042F4CC 0042C40C  4E 80 00 20 */	blr
.endfn JSGFindNodeID__Q34Game5P2JST11ObjectActorCFPCc

.fn JSGGetNodeTransformation__Q34Game5P2JST11ObjectActorCFUlPA4_f, global
/* 8042F4D0 0042C410  94 21 FF E0 */	stwu r1, -0x20(r1)
/* 8042F4D4 0042C414  7C 08 02 A6 */	mflr r0
/* 8042F4D8 0042C418  90 01 00 24 */	stw r0, 0x24(r1)
/* 8042F4DC 0042C41C  80 03 00 24 */	lwz r0, 0x24(r3)
/* 8042F4E0 0042C420  93 E1 00 1C */	stw r31, 0x1c(r1)
/* 8042F4E4 0042C424  7C BF 2B 78 */	mr r31, r5
/* 8042F4E8 0042C428  28 00 00 00 */	cmplwi r0, 0
/* 8042F4EC 0042C42C  93 C1 00 18 */	stw r30, 0x18(r1)
/* 8042F4F0 0042C430  7C 9E 23 78 */	mr r30, r4
/* 8042F4F4 0042C434  93 A1 00 14 */	stw r29, 0x14(r1)
/*


ve-c
POPAnimationTracer *tracer = anim.tracer;
tracer.shouldLogAndResetOnCompletion = YES;
[tracer start];
```

See `POPAnimationTracer.h` for more details.

## Testing

Pop has extensive unit test coverage. To install test dependencies, navigate to the root pop directory and type:

```sh
pod install
```

Assuming CocoaPods is installed, this will include the necessary OCMock dependency to the unit test targets.

## SceneKit

Due to SceneKit requiring iOS 8 and OS X 10.9, POP's SceneKit extensions aren't provided out of box. Unfortunately, [weakly linked frameworks](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html) cannot be used due to issues mentioned in the [Xcode 6.1 Release Notes](https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc6_release_notes.html).

To remedy this, you can easily opt-in to use SceneKit! Simply add this to the Preprocessor Macros section of your Xcode Project:

```
POP_USE_SCENEKIT=1
```

## Resources

A collection of links to external resources that may prove valuable:

* [AGGeometryKit+POP - Animating Quadrilaterals with Pop](https://github.com/hfossli/aggeometrykit-pop)
* [Apple – Core Animation Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html)
* [iOS Development Tips – UIScrollView-like deceleration with Pop](http://iosdevtips.co/post/84571595353/replicating-uiscrollviews-deceleration-with-facebook)
* [Pop Playground – Repository of Pop animation examples](https://github.com/callmeed/pop-playground)
* [Pop Playground 2 – Playing with Facebook's framework](http://victorbaro.com/2014/05/pop-playground-playing-with-facebooks-framework/)
* [POP-MCAnimate – Concise syntax for the Pop animation framework](https://github.com/matthewcheok/POP-MCAnimate)
* [Popping - Great examples in one project](https://github.com/schneiderandre/popping)
* [Rebound – Spring Animations for Android](http://facebook.github.io/rebound/)
* [Tapity Tutorial – Getting Started with Pop](http://tapity.com/tutorial-getting-started-with-pop/)
* [Tweaks – Easily adjust parameters for iOS apps in development](https://github.com/facebook/tweaks)
* [POP Tutorial in 5 steps](https://github.com/maxmyers/FacebookPop)
* [VBFPopFlatButton – Flat animatable button, using Pop to transition between states](https://github.com/victorBaro/VBFPopFlatButton)

## Contributing
See the CONTRIBUTING file for how to help out.

## License

Pop is released under a BSD License. See LICENSE file for details.
# Weblogic-CVE-2020-2551-To-Internet
### CVE-2020-2551 POC to use on the Internet

* 测试POC（可用于外网测试）

  python CVE-2020-2551.py [HOST] [IP]

* 尝试修改codebase进行远程类加载（失败）

  python CVE-2020-TEST.py [HOST] [IP]

# 浅谈 weblogic CVE-2020-2551 漏洞 & 外网POC构造

（首发于安全客，[原文链接](https://www.anquanke.com/post/id/206494)）

### 0x00 基础概念

学习这个漏洞需要一些前置知识，比如CORBA与RMI

简单的概述一下：

CORBA是OMG制定的一套技术标准，用于分布式应用，其中用到了IDL进行跨语言支持，客户端与服务端之间用IIOP协议进行通信

RMI是另一种分布式应用技术，在JAVA中可以用JNDI进行简化应用，客户端与服务端使用JRMP协议进行通信，不过在weblogic中RMI使用的是T3协议，关于这个之前也爆出


(UnitDefs) do
		local mobile = (udef.canMove and udef.speed > 0.000001) or (includeNanosAsMobile and (UnitDefs[udid].name == "armnanotc" or UnitDefs[udid].name == "cornanotc"))
		local builder = (udef.canReclaim and udef.reclaimSpeed > 0) or
						--(udef.builder and udef.buildSpeed > 0) or					-- udef.builder = deprecated it seems
						(udef.canResurrect and udef.resurrectSpeed > 0) or
						(udef.canRepair and udef.repairSpeed > 0)
		local building = (mobile == false)
		local combat = (builder == false) and (mobile == true) and (#udef.weapons > 0)

		combatFilter[udid] = combat
		builderFilter[udid] = builder
		buildingFilter[udid] = building
		mobileFilter[udid] = mobile
	end
end

function widget:Shutdown()
	WG['smartselect'] = nil
end

function widget:Initialize()

  WG['smartselect'] = {}
	WG['smartselect'].getInclude


      m.queueSchema("dog", 10);
      m.queueSchema("dog", 10, { age: 5 });
      m.queueSchema("dog", 10, { age: 10 });
      m.generate();

      const results = await m.ref("/dogs").once("value");
      const pups = await m
        .ref("/dogs")
        .orderByValue()
        .endAt(2, "age")
        .once("value");

      expect(results.numChildren()).to.equal(30);
      expect(pups.numChildren()).to.equal(10);
    });
    it.skip("endAt() filters sort by value when using value sort");
    it("startAt() combined with endAt() filters correctly", async () => {
      const m = await Mock.prepare();
      m.addSchema("dog", h => () => ({
        name: h.faker.name.firstName,
        age: 1
      }));
      m.queueSchema("dog", 10);
      m.queueSchema("dog", 10, { age: 5 });
      m.queueSchema("dog", 10, { age: 10 });
      m.generate();

      const results = await m.ref("/dogs").once("value");
      const middling = await m
        .ref("/dogs")
        .orderByChild("age")
        .startAt(3, "age")
        .endAt(9, "age")
        .once("value");

      expect(results.numChildren()).to.equal(30);
      expect(middling.numChildren()).to.equal(10);
      expect(firstProp(middling.val()).age).to.equal(5);
      expect(lastProp(middling.val()).age).to.equal(5);
    });

    it.skip("startAt(), endAt(), orderByValue() filters correctly");
  }); // End Filtered Querying

  describe("Sort Order", () => {
    beforeEach(() => {
      reset();
    });

    const personMock = (h: SchemaHelper) => () => ({
      name: h.faker.name.firstName() + " " + h.faker.name.lastName(),
      age: h.faker.random.number({ min: 1, max: 80 }),
      inUSA: h.faker.random.boolean()
    });

    const numbers = [123, 456, 7878, 9999, 10491, 15000, 18345, 20000];
    const strings = ["abc", "def", "fgh", "123", "999", "ABC", "DEF"];

    it("orderByChild() -- where child is a string -- sorts correctly", async () => {
      const m = await Mock.prepare();
      m.addSchema("person", personMock);
      m.queueSchema("person", 10);
      m.generate();
      const results = await m
        .ref("/people")
        .orderByChild("name")
        .once("value");

      const orderedPeople = convert.hashToArray(results.val());
      for (let i = 1; i <= 8; i++) {
        expect(orderedPeople[i].name >= orderedPeople[i + 1].name).is.equal(
          true
        );
      }

      const orderedKeys = orderedPeople.map(p => p.id);
      const unorderedKeys = Object.keys(m.db.people);

      expect(orderedKeys.join(".")).to.not.equal(unorderedKeys.join("."));
      expect(difference(orderedKeys, unorderedKeys).length).to.equal(0);
    });

    it("orderByChild() -- where child is a boolean -- sorts correctly", async () => {
      const m = await Mock.prepare();
      m.addSchema("person", personMock);
      m.queueSchema("person", 10);
      m.generate();
      const results = await m
        .ref("/people")
        .orderByChild("inUSA")
        .once("value");

      const orderedPeople = convert.hashToArray(results.val());

      for (let i = 1; i <= 8; i++) {
        const current = orderedPeople[i].inUSA ? 1 : 0;
        const next = orderedPeople[i + 1].inUSA ? 1 : 0;
        expect(current >= next).is.equal(true);
      }


import json
from datetime import datetime
from enum import Enum
from sys import stdout
from typing import Callable, List, Type

from rich import print as rprint

from binarycookies._serialize import IS_PYDANTIC_V1
from binarycookies.models import Cookie

class DateTimeEncoder(json.JSONEncoder):
    def default(self, obj: Type) -> str:
        if isinstance(obj, datetime):
            return obj.isoformat()
        return super().default(obj)

class OutputType(str, Enum):
    json = "json"
    ascii = "ascii"
    netscape = "netscape"

def _output_json(cookies: List[Cookie]):
    """Outputs cookies in JSON format."""
    output = [cookie.dict() for cookie in cookies] if IS_PYDANTIC_V1 else [cookie.model_dump() for cookie in cookies]
    json.dump(output, indent=2, cls=DateTimeEncoder, fp=stdout)

def _output_ascii(cookies: List[Cookie]):
    """Outputs cookies in a human-readable ASCII format."""
    for cookie in cookies:
        rprint(f"Name: {cookie.name}")
        rprint(f"Value: {cookie.value}")
        rprint(f"URL: {cookie.url}")
        rprint(f"Path: {cookie.path}")
        rprint(f"Created: {cookie.create_datetime.isoformat()}")
        rprint(f"Expires: {cookie.expiry_datetime.isoformat()}")
        rprint(f"Flag: {cookie.flag.value}")
        rprint("-" * 40)

def _output_netscape(cookies: List[Cookie]):
    """Outputs cookies in Netscape cookie file format."""
    # http://www.cookiecentral.com/faq/#3.5
    print("# Netscape HTTP Cookie File")
    for cookie in cookies:
        expiry_ts = int(cookie.expiry_datetime.timestamp())
        domain = cookie.url
        print(
            "%(domain)s\t%(flag)s\t%(path)s\t%(secure)s\t%(expiry)d\t%(name)s\t%(value)s"
            % {
                "domain": domain,
                "flag": str(domain.startswith(".")).upper(),
                "path": cookie.path,
                "secure": str("Secure" in cookie.flag.value).upper(),
                "expiry": expiry_ts,
                "name": cookie.name,
                "value": cookie.value,
            }
        )

OUTPUT_HANDLERS: dict[str, Callable[[List[Cookie]], None]] = {
    OutputType.json: _output_json,
    OutputType.ascii: _output_ascii,
    OutputType.netscape: _output_netscape,
}


de the IR (actually, reachability from
  **    a global pointer) may affect register allocation and thus the
  **    number of RENAMEs.
  */
  for (;;) {
    as->mcp = as->mctop;
#ifdef LUA_USE_ASSERT
    as->mcp_prev = as->mcp;
#endif
    as->ir = J->curfinal->ir;  /* Use the copied IR. */
    as->curins = J->cur.nins = as->orignins;
#ifdef LUAJIT_RANDOM_RA
    as->prngstate = J2G(J)->prng;  /* Must (re)start from identical state. */
    as->prngbits = 0;
#endif

    RA_DBG_START();
    RA_DBGX((as, "===== STOP ====="));

    /* General trace setup. Emit tail of trace. */
    asm_tail_prep(as);
    as->mcloop = NULL;
    as->flagmcp = NULL;
    as->topslot = 0;
    as->gcsteps = 0;
    as->sectref = as->loopref;
    as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED;
    asm_setup_regsp(as);
    if (!as->loopref)
      asm_tail_link(as);

    /* Assemble a trace in linear backwards order. */
    for (as->curins--; as->curins > as->stopins; as->curins--) {
      IRIns *ir = IR(as->curins);
      /* 64 bit types handled by SPLIT for 32 bit archs. */
      lj_assertA(!(LJ_32 && irt_isint64(ir->t)),
		 "IR %04d has unsplit 64 bit type",
		 (int)(ir - as->ir) - REF_BIAS);
      asm_snap_prev(as);
      if (!ra_used(ir) && !ir_sideeff(ir) && (as->flags & JIT_F_OPT_DCE))
	continue;  /* Dead-code elimination can be soooo easy. */
      if (irt_isguard(ir->t))
	asm_snap_prep(as);
      RA_DBG_REF();
      checkmclim(as);
      asm_ir(as, ir);
    }

    if (as->realign && J->curfinal->nins >= T->nins)
      continue;  /* Retry in case only the MCode needs to be realigned. */

    /* Emit head of trace. */
    RA_DBG_REF();
    checkmclim(as);
    if (as->gcsteps > 0) {
      as->curins = as->T->snap[0].ref;
      asm_snap_prep(as);  /* The GC check is a guard. */
      asm_gc_check(as);
      as->curins = as->stopins;
    }
    ra_evictk(as);
    if (as->parent)
      asm_head_side(as);
    else
      asm_head_root(as);
    asm_phi_fixup(as);

    if (J->curfinal->nins >= T->nins) {  /* IR didn't grow? */
      lj_assertA(J->curfinal->nk == T->nk, "unexpected IR constant growth");
      memcpy(J->curfinal->ir + as->orignins, T->ir + as->orignins,
	     (T->nins - as->orignins) * sizeof(IRIns));  /* Copy RENAMEs. */
      T->nins = J->curfinal->nins;
      /* Fill mcofs of any unprocessed snapshots. */
      as->curins = REF_FIRST;
      asm_snap_prev(as);
      break;  /* Done. */
    }

    /* Otherwise try again with a bigger IR. */
    lj_trace_free(J2G(J), J->curfinal);
    J->curfinal = NULL;  /* In case lj_trace_alloc() OOMs. */
    J->curfinal = lj_trace_alloc(J->L, T);
    as->realign = NULL;
  }

  RA_DBGX((as, "===== START ===="));
  RA_DBG_FLUSH();
  if (as->freeset != RSET_ALL)
    lj_trace_err(as->J, LJ_TRERR_BADRA);  /* Ouch! Should never happen. */

  /* Set trace entry point before fixing up tail to allow link to self. */
  T->mcode = as->mcp;
  T->mcloop = as->mcloop ? (MSize)((char *)as->mcloop - (char *)as->mcp) : 0;
  if (as->loopref)
    asm_loop_tail_fixup(as);
  else
    asm_tail_fixup(as, T->link);  /* Note: this may change as->mctop! */
  T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp);
  asm_snap_fixup_mcofs(as);
#if LJ_TARGET_MCODE_FIXUP
  asm_mcode_fixup(T->mcode, T->szmcode);
#endif
  lj_mcode_sync(T->mcode, as->mctoporig);
}

#undef IR

#endif


param block Block to apply to elements in the array. Called from the cache queue.
 */
- (void)enumerateDataByAccessDateUsingBlock:(void(^)(NSString *key, NSData *data, NSDate *accessDate, BOOL *stop))block;

/**
 Asynchronously updates the access date for the given key.
 @param key Key associated with the data whose access date will be updated.
 @param lazyData Block to be called if there is no data associated with the given key, in which case it must return it. Called from the cache queue.
 @discussion Calling this method is equivalent to calling setData:forKey: with the difference that the data is only requested if it isn't already cached.
 */
- (void)updateAccessDateForKey:(NSString*)key data:(NSData* (^)())lazyData ;

@end


T>,
    dy: DyTreeGridPresentationNode<T>,
  ): number {
    const key = request.column;
    const dir = request.direction;
    const a = na.data[key];
    const b = dy.data[key];

    let res = 0;

    if (a > b) {
      res = 1
    }
    if (a < b) {
      res = -1
    }

    return dir === DySortDirection.ASCENDING ? res : res * -1;
  }
}
import { createAsyncThunk } from '@reduxjs/toolkit';

import { SavedTrackInterface } from 'app/components/saved-track/saved-track.interface';
import { StorageService } from 'app/services/storage.service';
import { RootState } from 'app/store/store';

export const saveTrack = createAsyncThunk(
  'tracks/saveTrack',
  (track: SavedTrackInterface): SavedTrackInterface => {
    const storageService = StorageService.getInstance();
    storageService.saveTrack(track);
    return track;
  }
);

export const getSavedTracks = createAsyncThunk('tracks/getSavedTracks', (): SavedTrackInterface[] => {
  const storageService = StorageService.getInstance();
  return storageService.getTracks() as SavedTrackInterface[];
});

export const removeSavedTrack = createAsyncThunk('tracks/removeSavedTrack', (trackId: string, { getState }):
  | SavedTrackInterface[]
  | void => {
  const storageService = StorageService.getInstance();
  const {
    tracks: { savedTracks }
  } = getState() as RootState;
  if (!savedTracks) {
    return;
  }
  const updatedTracks = savedTracks.filter((track: SavedTrackInterface) => track.id !== trackId);
  storageService.setTracks(updatedTracks);
  return updatedTracks;
});
import { Injectable, HttpStatus } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Job } from './job.entity';
import { Repository, DeleteResult } from 'typeorm';
import { CustomException } from '../../app/exception/custom.exception';

@Injectable()
export class JobsService {

    constructor(
        @InjectRepository(Job)
        private readonly jobRepository:Repository<Job>
    ){}

    async getJobs(): Promise<Job[]> {
        try {
            return await this.jobRepository.find();
        } catch (error) {
            throw new CustomException("No jobs found",HttpStatus.NOT_FOUND)
        }
    }

    async saveJob(job: Job): Promise<Job> {
        try {
            return this.jobRepository.save(job);
        } catch (error) {
            throw new CustomException("Error creating job",HttpStatus.INTERNAL_SERVER_ERROR)
        }
    }

    async deleteJob(jobId: string): Promise<DeleteResult> {
        try {
            return await this.jobRepository.delete(jobId);
        } catch (error) {
            throw new CustomException("Error deleting job",HttpStatus.INTERNAL_SERVER_ERROR)
        }
    }
}
interface ArrFunc<T> {
  (num: T): T[]
}
let getArr: ArrFunc<number> = (num: number) => {
  return [num]
}

let new1 = getArr(4)

type reverseType = string | number
function reverse<T extends reverseType>(x: T) : T { return x }
let name1 = reverse<string>('jjj')

interface Foo {
  bar: number;
  bas: string;
}
const foo1 = {} as Foo
const foo2 = <Foo>{}
const foo: Foo = {};import { createInterface } from "readline";
import { createReadStream } from "fs";
import { Validator } from "jsonschema";

import Customer from "../model/Customer";
import CustomerInput from "./CustomerInput";

const customerSchema = require("../../../resources/customerSche