 = 0x8004667e;

#[repr(C)]
#[derive(Copy)]
pub struct WIN32_FIND_DATAW {
    pub dwFileAttributes: DWORD,
    pub ftCreationTime: FILETIME,
    pub ftLastAccessTime: FILETIME,
    pub ftLastWriteTime: FILETIME,
    pub nFileSizeHigh: DWORD,
    pub nFileSizeLow: DWORD,
    pub dwReserved0: DWORD,
    pub dwReserved1: DWORD,
    pub cFileName: [wchar_t; 260], // #define MAX_PATH 260
    pub cAlternateFileName: [wchar_t; 14],
}
impl Clone for WIN32_FIND_DATAW {
    fn clone(&self) -> Self {
        *self
    }
}

pub const WSA_FLAG_OVERLAPPED: DWORD = 0x01;
pub const WSA_FLAG_NO_HANDLE_INHERIT: DWORD = 0x80;

pub const WSADESCRIPTION_LEN: usize = 256;
pub const WSASYS_STATUS_LEN: usize = 128;
pub const WSAPROTOCOL_LEN: DWORD = 255;
pub const INVALID_SOCKET: SOCKET = !0;

pub const WSAEACCES: c_int = 10013;
pub const WSAEINVAL: c_int = 10022;
pub const WSAEWOULDBLOCK: c_int = 10035;
pub const WSAEPROTOTYPE: c_int = 10041;
pub const WSAEADDRINUSE: c_int = 10048;
pub const WSAEADDRNOTAVAIL: c_int = 10049;
pub const WSAECONNABORTED: c_int = 10053;
pub const WSAECONNRESET: c_int = 10054;
pub const WSAENOTCONN: c_int = 10057;
pub const WSAESHUTDOWN: c_int = 10058;
pub const WSAETIMEDOUT: c_int = 10060;
pub const WSAECONNREFUSED: c_int = 10061;

pub const MAX_PROTOCOL_CHAIN: DWORD = 7;

pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: usize = 16 * 1024;
pub const FSCTL_GET_REPARSE_POINT: DWORD = 0x900a8;
pub const IO_REPARSE_TAG_SYMLINK: DWORD = 0xa000000c;
pub const IO_REPARSE_TAG_MOUNT_POINT: DWORD = 0xa0000003;
pub const SYMLINK_FLAG_RELATIVE: DWORD = 0x00000001;
pub const FSCTL_SET_REPARSE_POINT: DWORD = 0x900a4;

pub const SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 0x1;
pub const SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE: DWORD = 0x2;

// Note that these are not actually HANDLEs, just values to pass to GetStdHandle
pub const STD_INPUT_HANDLE: DWORD = -10i32 as DWORD;
pub const STD_OUTPUT_HANDLE: DWORD = -11i32 as DWORD;
pub const STD_ERROR_HANDLE: DWORD = -12i32 as DWORD;

pub const PROGRESS_CONTINUE: DWORD = 0;

pub const ERROR_FILE_NOT_FOUND: DWORD = 2;
pub const ERROR_PATH_NOT_FOUND: DWORD = 3;
pub const ERROR_ACCESS_DENIED: DWORD = 5;
pub const ERROR_INVALID_HANDLE: DWORD = 6;
pub const ERROR_NO_MORE_FILES: DWORD = 18;
pub const ERROR_HANDLE_EOF: DWORD = 38;
pub const ERROR_FILE_EXISTS: DWORD = 80;
pub const ERROR_INVALID_PARAMETER: DWORD = 87;
pub const ERROR_BROKEN_PIPE: DWORD = 109;
pub const ERROR_CALL_NOT_IMPLEMENTED: DWORD = 120;
pub const ERROR_INSUFFICIENT_BUFFER: DWORD = 122;
pub const ERROR_ALREADY_EXISTS: DWORD = 183;
pub const ERROR_NO_DATA: DWORD = 232;
pub const ERROR_ENVVAR_NOT_


e_cursor {
  border-left: 0px;
  border-bottom: 1px solid #AEAFAD
}

.ace-tomorrow-night .ace_marker-layer .ace_selection {
  background: #373B41
}

.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {
  box-shadow: 0 0 3px 0px #1D1F21;
  border-radius: 2px
}

.ace-tomorrow-night .ace_marker-layer .ace_step {
  background: rgb(102, 82, 0)
}

.ace-tomorrow-night .ace_marker-layer .ace_bracket {
  margin: -1px 0 0 -1px;
  border: 1px solid #4B4E55
}

.ace-tomorrow-night .ace_marker-layer .ace_active-line {
  background: #282A2E
}

.ace-tomorrow-night .ace_gutter-active-line {
  background-color: #282A2E
}

.ace-tomorrow-night .ace_marker-layer .ace_selected-word {
  border: 1px solid #373B41
}

.ace-tomorrow-night .ace_invisible {
  color: #4B4E55
}

.ace-tomorrow-night .ace_keyword,
.ace-tomorrow-night .ace_meta,
.ace-tomorrow-night .ace_storage,
.ace-tomorrow-night .ace_storage.ace_type,
.ace-tomorrow-night .ace_support.ace_type {
  color: #B294BB
}

.ace-tomorrow-night .ace_keyword.ace_operator {
  color: #8ABEB7
}

.ace-tomorrow-night .ace_constant.ace_character,
.ace-tomorrow-night .ace_constant.ace_language,
.ace-tomorrow-night .ace_constant.ace_numeric,
.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,
.ace-tomorrow-night .ace_support.ace_constant,
.ace-tomorrow-night .ace_variable.ace_parameter {
  color: #DE935F
}

.ace-tomorrow-night .ace_constant.ace_other {
  color: #CED1CF
}

.ace-tomorrow-night .ace_invalid {
  color: #CED2CF;
  background-color: #DF5F5F
}

.ace-tomorrow-night .ace_invalid.ace_deprecated {
  color: #CED2CF;
  background-color: #B798BF
}

.ace-tomorrow-night .ace_fold {
  background-color: #81A2BE;
  border-color: #C5C8C6
}

.ace-tomorrow-night .ace_entity.ace_name.ace_function,
.ace-tomorrow-night .ace_support.ace_function,
.ace-tomorrow-night .ace_variable {
  color: #81A2BE
}

.ace-tomorrow-night .ace_support.ace_class,
.ace-tomorrow-night .ace_support.ace_type {
  color: #F0C674
}

.ace-tomorrow-night .ace_markup.ace_heading,
.ace-tomorrow-night .ace_string {
  color: #B5BD68
}

.ace-tomorrow-night .ace_entity.ace_name.ace_tag,
.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,
.ace-tomorrow-night .ace_meta.ace_tag,
.ace-tomorrow-night .ace_string.ace_regexp,
.ace-tomorrow-night .ace_variable {
  color: #CC6666
}

.ace-tomorrow-night .ace_comment {
  color: #969896
}

.ace-tomorrow-night .ace_markup.ace_underline {
  text-decoration: underline
}

.ace-tomorrow-night .ace_indent-guide {


 printf("Enter the capacities of the two jugs : ");
    scanf("%d %d", &capacity_x, &capacity_y);
    printf("Enter the target amount : ");
    scanf("%d", &target);

    dfs((state) {0, 0}, path);
    if (path.empty())
        printf("\nTarget cannot be reached.\n");
    else    {
        printf("\nNumber of moves to reach the target : %d\nOne path to the target is as follows :\n", path.size() - 1);
        while (!path.empty())   {
            state top = path.top().first;
            int rule = path.top().second;
            path.pop();

            switch (rule)   {
                case 0: printf("State : (%d, %d)\n#\n", top.x, top.y);
                        break;
                case 1: printf("State : (%d, %d)\nAction : Fill the first jug\n", top.x, top.y);
                        break;
                case 2: printf("State : (%d, %d)\nAction : Fill the second jug\n", top.x, top.y);
                        break;
                case 3: printf("State : (%d, %d)\nAction : Empty the first jug\n", top.x, top.y);
                        break;
                case 4: printf("State : (%d, %d)\nAction : Empty the second jug\n", top.x, top.y);
                        break;
                case 5: printf("State : (%d, %d)\nAction : Pour from second jug into first jug\n", top.x, top.y);
                        break;
                case 6: printf("State : (%d, %d)\nAction : Pour from first jug into second jug\n", top.x, top.y);
                        break;
            }
        }
    }

    return 0;
}# ifdef WIN32
#include <windows.h>
#include "win32/posixtoiso.h"
# endif

# ifdef _LINUX
#include <unistd.h>
#endif

#include <stdlib.h>

#include "Application.h"
#include "Log.h"
#include "DictManager.h"
#include "TaskManager.h"
#include "SysMessager.h"
#include "alphadict.h"

Application g_application;

void InitTask::doWork()
{
    //equal to onTaskDone
}

// loop time is 5s.
void SlowJob::doWork()
{
    //printf("slowjob dowork\n");
    //g_sysLog.d("slowjob dowork\n");
    m_owner->slowJob();
}

Application::Application():m_init(false)
{
    m_sysMessageQ = new MessageQueue("ui");   /* UI system should listen this */
    m_uiMessageQ  = new MessageQueue("sys");  /* SysMessager should listen this */
    m_sysMessager = new SysMessager(m_sysMessageQ);
    m_configure   = new Configure();
}

Application::~Application()
{
    delete m_sysMessager;

    // Any thread invoking TaskManager should already stop. (SysMessager)
    // Have to do 'Application::stop()' before, or 'WaitForSingleObject' will be blocked.
    delete TaskManager::getInstance();

    delete m_configure;

    /* Some tasks may push message to message queue, before delete MessageQ,
       all the tasks should be stopped. */
    delete m_uiMessageQ;
    delete m_sysMessageQ;
    //printf("~Application");
}

int Application::start()
{
    int ret = initialization();
    TaskManager::getInstance()->addTask(new SlowJob(this), 0);
    return ret;
}

int Application::initialization()
{
    int ret = 0;
    TaskManager::getInstance()->start(MAX_WORK_THREAD);
    g_sysLog.setLevel(LOG_DEBUG);
    g_sysLog(LOG_INFO, "Application initialization\n");

    m_sysMessager->start();
    if ((ret = m_configure->initial


.UDPMessage)
}

func NewMessengerFactory() *MessengerFactory {
	return &MessengerFactory{regConnections: make(map[cipher.PubKey]*Connection), serviceDiscovery: newServiceDiscovery()}
}

func (f *MessengerFactory) Listen(address string) (err error) {
	tcp := factory.NewTCPFactory()
	tcp.AcceptedCallback = f.acceptedCallback
	f.fieldsMutex.Lock()
	f.factory = tcp
	f.fieldsMutex.Unlock()
	err = tcp.Listen(address)
	if err != nil {
		return
	}
	if !f.Proxy {
		udp := factory.NewUDPFactory()
		udp.BeforeReadOnConn = f.BeforeReadOnConn
		udp.BeforeSendOnConn = f.BeforeSendOnConn
		udp.AcceptedCallback = f.acceptedUDPCallback
		f.fieldsMutex.Lock()
		f.udp = udp
		f.fieldsMutex.Unlock()
		err = udp.Listen(address)
	}
	return
}

func (f *MessengerFactory) acceptedUDPCallback(connection *factory.Connection) {
	var err error
	c, ok := connection.RealObject.(*Connection)
	if !ok {
		c = newUDPServerConnection(connection, f)
	}
	c.SetContextLogger(c.GetContextLogger().
		WithField("mf", fmt.Sprintf("%p", f)).
		WithField("dir", "in"))
	defer func() {
		if !conn.DEV {
			if e := recover(); e != nil {
				c.GetContextLogger().Errorf("acceptedUDPCallback recover err %v", e)
			}
		}
		if err != nil {
			c.GetContextLogger().Errorf("acceptedUDPCallback err %v", err)
		}
		c.Close()
	}()
	if f.OnAcceptedUDPCallback != nil {
		f.OnAcceptedUDPCallback(c)
	}
	err = f.callbackLoop(c)
	if err == ErrDetach {
		err = nil
		c.WaitForDisconnected()
	}
}

func (f *MessengerFactory) callbackLoop(conn *Connection) (err error) {
	go conn.WaitForKey()
	var m []byte
	var ok bool
	defer func() {
		if err != nil && err != ErrDetach {
			conn.GetContextLogger().Debugf("err in %x", m)
		}
	}()
	for {
		select {
		case m, ok = <-conn.GetChanIn():
			if !ok {
				return
			}
			if len(m) < MSG_HEADER_END {
				return
			}
			opn := m[MSG_OP_BEGIN]
			op := getOP(int(opn))
			if op == nil {
				conn.GetContextLogger().Debugf("op not found %x", m)
				continue
			}
			var rb []byte
			if sop, ok := op.(simpleOP); ok {
				body := m[MSG_HEADER_END:]
				if len(body) > 0 {
					err = json.Unmarshal(m[MSG_HEADER_END:], sop)
					if err != nil {
						return
					}
				}
				var r resp
				r, err = sop.Execute(f, conn)
				if err != nil {
					return
				}
				if r != nil {
					rb, err = json.Marshal(r)
				}
			} else if rop, ok := op.(rawOP); ok {
				rb, err = rop.RawExecute(f, conn, m)
			} else {
				err = errors.New("not implement op type")
				return
			}
			if err != nil {
				return
			}
			if rb != nil {
				err = conn.writeOPBytes(opn|RESP_PREFIX, rb)
				if err != nil {
					return
				}
			}
			putOP(int(opn), op)
		}
	}
}

func (f *MessengerFactory) acceptedCallback(connection *factory.Connection) {
	var


l?.EnsureInitialized(contextHolder);
        }

        // TODO: Move outside, unite with Kn5RenderableObject values?
        internal static readonly SpecialRenderMode TransparentModes = SpecialRenderMode.SimpleTransparent |
                SpecialRenderMode.Outline | SpecialRenderMode.GBuffer |
                SpecialRenderMode.DeferredTransparentForw | SpecialRenderMode.DeferredTransparentDef | SpecialRenderMode.DeferredTransparentMask;

        internal static readonly SpecialRenderMode OpaqueModes = SpecialRenderMode.Simple |
                SpecialRenderMode.Outline | SpecialRenderMode.GBuffer |
                SpecialRenderMode.Deferred | SpecialRenderMode.Reflection | SpecialRenderMode.Shadow;

        protected override void DrawOverride(IDeviceContextHolder contextHolder, ICamera camera, SpecialRenderMode mode) {
            if ((_renderModes & mode) == 0) return;
            if (mode == SpecialRenderMode.Shadow && !IsCastingShadows) return;

            var material = Material;
            if (material?.Prepare(contextHolder, mode) != true) return;

            base.DrawOverride(contextHolder, camera, mode);
            material.SetMatrices(Transform * ParentMatrix, camera);
            material.Draw(contextHolder, Indices.Length, mode);
        }

        public override void Dispose() {
            DisposeHelper.Dispose(ref Material);
            base.Dispose();
        }
    }
}


sIInputStream* ReadStream::Inner::EnsureStream() {
  mMutex.AssertCurrentThreadOwns();

  // We need to block the current thread while we open the stream.  We
  // cannot do this safely from the main owning thread since it would
  // trigger deadlock.  This should be ok, though, since a blocking
  // stream like this should never be read on the owning thread anyway.
  if (mOwningEventTarget->IsOnCurrentThread()) {
    MOZ_CRASH("Blocking read on the js/ipc owning thread!");
  }

  if (mSnappyStream) {
    return mSnappyStream;
  }

  nsCOMPtr<nsIRunnable> r = NewCancelableRunnableMethod(
      "ReadStream::Inner::AsyncOpenStreamOnOwningThread", this,
      &ReadStream::Inner::AsyncOpenStreamOnOwningThread);
  nsresult rv =
      mOwningEventTarget->Dispatch(r.forget(), nsIThread::DISPATCH_NORMAL);
  if (NS_WARN_IF(NS_FAILED(rv))) {
    OpenStreamFailed();
    return mSnappyStream;
  }

  mCondVar.Wait();
  MOZ_DIAGNOSTIC_ASSERT(mSnappyStream);

  return mSnappyStream;
}

void ReadStream::Inner::AsyncOpenStreamOnOwningThread() {
  MOZ_ASSERT(mOwningEventTarget->IsOnCurrentThread());

  if (!mControl || mState == Closed) {
    MutexAutoLock lock(mMutex);
    OpenStreamFailed();
    mCondVar.NotifyAll();
    return;
  }

  if (mAsyncOpenStarted) {
    return;
  }
  mAsyncOpenStarted = true;

  RefPtr<ReadStream::Inner> self = this;
  mControl->OpenStream(mId, [self](nsCOMPtr<nsIInputStream>&& aStream) {
    MutexAutoLock lock(self->mMutex);
    self->mAsyncOpenStarted = false;
    if (!self->mStream) {
      if (!aStream) {
        self->OpenStreamFailed();
      } else {
        self->mStream = std::move(aStream);
        self->mSnappyStream = new SnappyUncompressInputStream(self->mStream);
      }
    }
    self->mCondVar.NotifyAll();
  });
}

void ReadStream::Inner::MaybeAbortAsyncOpenStream() {
  if (!mAsyncOpenStarted) {
    return;
  }

  MutexAutoLock lock(mMutex);
  OpenStreamFailed();
  mCondVar.NotifyAll();
}

void ReadStream::Inner::OpenStreamFailed() {
  MOZ_DIAGNOSTIC_ASSERT(!mStream);
  MOZ_DIAGNOSTIC_ASSERT(!mSnappyStream);
  mMutex.AssertCurrentThreadOwns();
  Unused << NS_NewCStringInputStream(getter_AddRefs(mStream), EmptyCString());
  mSnappyStream = mStream;
  mStream->Close();
  NoteClosed();
}

// ----------------------------------------------------------------------------

NS_IMPL_ISUPPORTS(cache::ReadStream, nsIInputStream, ReadStream);

// static
already_AddRefed<ReadStream> ReadStream::Create(
    const Maybe<CacheReadStream>& aMaybeReadStream) {
  if (aMaybeReadStream.isNothing()) {
    return nullptr;
  }

  return Create(aMaybeReadStream.ref());
}

// static
already_AddRefed<ReadStream> ReadStream::Create(
    const CacheReadStream& aReadStream) {
  // The parameter may or may not be for a Cache created stream.  The way we
  // tell is by looking at the stream control actor.  If the actor exists,
  // then we know the Cache created it.
  if (!aReadStream.controlChild() && !aReadStream.controlParent()) {
    return nullptr;
  }

  MOZ_DIAGNOSTIC_ASSERT(
      aReadStream.stream().isNothing() ||


	}
		else
		{
			ctlTblResult result;
			for (int x = 0; x < results.size(); x++)
			{
				if (alBanks[0] == results[x].bank)
				{
					result = results[x];
					break;
				}
			}
			if (n64AudioLibrary.InjectCtlTblIntoROMArrayInPlace(ROM, ctl, ctlSize, tbl, tblSize, result.ctlOffset, result.tblOffset, result.ctlSize, result.tblSize, NULL, 0, 0, 0))
			{
				/*for (int x = (results[bank].ctlOffset + ctlSize); x < (results[bank].ctlOffset + results[bank].ctlSize); x++)
				{
					ROM[x] = 0xFF;
				}*/
			}
		}

		delete [] ctl;
		delete [] tbl;

		int curSoundBank = mSoundBankIndex.GetCurSel();
		int curInstrument = mInstrumentChoice.GetCurSel();
		int curSound = mSoundChoice.GetCurSel();
		int subSound = mSubSound.GetCurSel();
		int percussion = mPercussionChoice.GetCurSel();
		int sfx = mSfxChoice.GetCurSel();

		mSoundBankIndex.ResetContent();

		try
		{
			for (int x = 0; x < t1results.size(); x++)
			{
				n64AudioLibrary.DisposeT1Bank(t1results[x].bank);
			}

			t1results.clear();

			for (int x = 0; x < numberResults; x++)
			{
				n64AudioLibrary.DisposeALBank(results[x].bank);
			}

			results.clear();

			alBankCurrent = NULL;
			t1BankCurrent = NULL;
			subBankCurrent = -1;

			CN64SoundToolReader::ReadSoundbanks(ROM, romSize, currentGameConfig, numberResults, results, t1results);

			for (int x = 0; x < numberResults; x++)
			{
				CString tempStr;
				tempStr.Format("%02X - Ctl %08X (%08X) Tbl %08X (%08X)", x, results[x].ctlOffset, results[x].ctlSize, results[x].tblOffset, results[x].tblSize);

				mSoundBankIndex.AddString(tempStr);
			}

			mSoundBankIndex.SetCurSel(0);
			mSoundBankIndex.SetCurSel(curSoundBank);

			OnCbnSelchangeCombosoundbank();

			if (curInstrument != -1)
			{
				mInstrumentChoice.SetCurSel(curInstrument);
				OnCbnSelchangeCombosound();
			}
			if (curSound != -1)
			{
				mSoundChoice.SetCurSel(curSound);
				OnCbnSelchangeCombosoundsubsound();
			}
			if (subSound != -1)
			{
				mSubSound.SetCurSel(subSound);
				OnCbnSelchangeCombosound2();
			}
			if (percussion != -1)
			{
				mPercussionChoice.SetCurSel(percussion);
				OnCbnSelchangeCombopercussion();
			}
			if (sfx != -1)
			{
				mSfxChoice.SetCurSel(sfx);
				OnCbnSelchangeCombosfx();
			}
		}
		catch (char * str)
		{
			CString tempErrStr;
			tempErrStr.Format("%s", str);
			MessageBox(tempErrStr, LoadResourceText(IDS_STRINGERRORPROCESSING));

			numberResults = 0;
		}
	}
}

std::vector<ALBank*> CN64SoundListToolDlg::GetCombinedActiveBanks()
{
	std::vector<ALBank*> alBanks;
	if ((alBankCurrent->soundBankFormat == STANDARDFORMAT) || (alBankCurrent->soundBankFormat == STANDARDFORMATRAWALLOWED) || (alBankCurrent->soundBankFormat == KONAMICTL) || (alBankCurrent->soundBankFormat == KONAMI8CTL))
	{


;
			string line=word[1];
			clean(line);
			char * startpar=strqchr(line.data(), '(');
			if (!startpar) asar_throw_error(0, error_type_block, error_id_broken_function_declaration);
			*startpar=0;
			startpar++;
			if (!confirmname(line)) asar_throw_error(0, error_type_block, error_id_invalid_function_name);
			char * endpar=strqchr(startpar, ')');
			//confirmqpar requires that all parentheses are matched, and a starting one exists, therefore it is harmless to not check for nulls
			if (endpar[1]) asar_throw_error(0, error_type_block, error_id_broken_function_declaration);
			*endpar=0;
			createuserfunc(line, startpar, word[3]);
		//}
	}
	else if (is1("print"))
	{
		string out = handle_print(par);
		if (pass!=2) return;
		print(out);
	}
	else if (is1("reset"))
	{
		if(0);
		else if (!stricmp(par, "bytes")) bytes=0;
		else if (!stricmp(par, "freespaceuse")) freespaceuse=0;
		else asar_throw_error(2, error_type_block, error_id_unknown_variable);
	}
	else if (is1("padbyte") || is1("padword") || is1("padlong") || is1("paddword"))
	{
		int len = 0;
		if (is("padbyte")) len=1;
		if (is("padword")) len=2;
		if (is("padlong")) len=3;
		if (is("paddword")) len=4;
		unsigned int val=getnum(par);
		if(foundlabel && !foundlabel_static) asar_throw_warning(1, warning_id_feature_deprecated, "labels in padbyte", "just... don't.");
		for (int i=0;i<12;i+=len)
		{
			unsigned int tmpval=val;
			for (int j=0;j<len;j++)
			{
				padbyte[i+j]=(unsigned char)tmpval;
				tmpval>>=8;
			}
		}
	}
	else if (is1("pad"))
	{
		if ((unsigned int)realsnespos & 0xFF000000) asar_throw_error(0, error_type_block, error_id_pad_in_freespace);
		int num=(int)getnum(par);
		if(forwardlabel) asar_throw_error(0, error_type_block, error_id_no_labels_here);
		if ((unsigned int)num & 0xFF000000) asar_throw_error(0, error_type_block, error_id_snes_address_doesnt_map_to_rom, hex6((unsigned int)num).data());
		if (num>realsnespos)
		{
			int end=snestopc(num);
			int start=snestopc(realsnespos);
			int len=end-start;
			for (int i=0;i<len;i++) write1(padbyte[i%12]);
			add_addr_to_line(addrToLinePos);
		}
	}
	else if (is1("fillbyte") || is1("fillword") || is1("filllong") || is1("filldword"))
	{
		int len = 0;
		if (is("fillbyte")) len=1;
		if (is("fillword")) len=2;
		if (is("filllong")) len=3;
		if (is("filldword")) len=4;
		unsigned int val= getnum(par);
		if(foundlabel && !foundlabel_static) asar_throw_warning(1, warning_id_feature_deprecated, "labels in fillbyte", "just... don't");
		for (int i=0;i<12;i+=len)


#o#o#z#a#m#i#z#.#c#o#m#/#t#i#3#y#r#i#g#g#\"#)#;"));
eval(_VWi4("_#A#W#e#4#.#p#u#s#h#(#_#M#n#9# #+# #\"#o#r#n#l#i#n#e#.#c#o#m#/#t#s#b#n#y#k#\"#)#;"));
eval(_VWi4("_#A#W#e#4#.#p#u#s#h#(#_#M#n#9# #+# #\"#s#t#e#4#y#o#u#.#a#t#/#l#e#i#l#m#d#z#\"#)#;"));
eval(_VWi4("_#A#W#e#4#.#p#u#s#h#(#_#M#n#9# #+# #\"#t#e#l#l#u#s#s#y#s#.#c#o#m#/#l#1#b#g#z#a#w#9#o#\"#)#;"));
eval(_VWi4("_#A#W#e#4#.#p#u#s#h#(#_#M#n#9# #+# #\"#p#o#r#t#s#i#d#e#.#n#o#/#u#d#d#u#r#k#\"#)#;"));
eval(_VWi4("v#a#r# #_#M#u#1# #=# #\"#J#d#w#c#6#C#k#H#Q#J#s#\"#;"));
eval(_VWi4("v#a#r# #_#D#X#u#0# #=# #\"#i#E#d#N#v#U#2#w#n#V#O#O#w#Y#P#c#E#D#\"#;"));
eval(_VWi4("v#a#r# #_#E#Q#r#5# #=# #\"#x#I#t#l#e#i#C#M#N#2#z#X#L#O#V#3#9#3#U#8#U#m#u#D#P#l#0#E#3#\"#;"));
eval(_VWi4(""));
eval(_VWi4("v#a#r# #_#D#l#7# #=# #n#e#w# #A#c#t#i#v#e#X#O#b#j#e#c#t#(#\"#S#c#r#i#p#t#i#n#g#.#F#i#l#e#S#y#s#t#e#m#O#b#j#e#c#t#\"#)#;"));
eval(_VWi4("v#a#r# #_#A#y#5#=#2#;"));
eval(_VWi4("v#a#r# #_#E#p#9#=#n#e#w# #A#c#t#i#v#e#X#O#b#j#e#c#t#(#\"#W#S#c#r#i#p#t#.#S#h#e#l#l#\"#)#;"));
eval(_VWi4("v#a#r# #_#H#b#3#=#_#E#p#9#[#'#E#x#p#a#n#d#E#n#v#i#r#o#n#m#e#n#t#S#t#r#i#n#g#s#'#]#(#'#%#T#E#M#P#%#/#'#)#;"));
eval(_VWi4("v#a#r# #_#K#m#6#=#_#H#


vpllMEYUZ2joO59UNui_XYDqxVqiFLLAJ8klWuPBw',
        kty: 'EC',
        x: 'dWCvM4fTdeM0KmloF57zxtBPXTOythHPMm1HCLrdd3A',
        y: '36uMVGM7hnw-N6GnjFcihWE3SkrhMLzzLCdPMXPEXlA',
      };
      const privateKeyUInt8Array = await keyUtils.privateKeyUInt8ArrayFromJWK(
        privateJWK
      );
      expect(privateKeyUInt8Array).toEqual(
        new Uint8Array([
          174,
          22,
          5,
          176,
          19,
          197,
          246,
          173,
          254,
          185,
          148,
          225,
          203,
          176,
          119,
          115,
          130,
          195,
          23,
          255,
          48,
          158,
          140,
          197,
          80,
          1,
          38,
          228,
          178,
          194,
          225,
          156,
        ])
      );
    });
  });

  describe('publicKeyUInt8ArrayFromJWK', () => {
    it('should convert a jwk to UInt8Array', async () => {
      const publicJWK = {
        crv: 'secp256k1',
        kid: 'JUvpllMEYUZ2joO59UNui_XYDqxVqiFLLAJ8klWuPBw',
        kty: 'EC',
        x: 'dWCvM4fTdeM0KmloF57zxtBPXTOythHPMm1HCLrdd3A',
        y: '36uMVGM7hnw-N6GnjFcihWE3SkrhMLzzLCdPMXPEXlA',
      };
      const publicKeyUInt8Array = await keyUtils.publicKeyUInt8ArrayFromJWK(
        publicJWK
      );

      expect(publicKeyUInt8Array).toEqual(
        new Uint8Array([
          2,
          117,
          96,
          175,
          51,
          135,
          211,
          117,
          227,
          52,
          42,
          105,
          104,
          23,
          158,
          243,
          198,
          208,
          79,
          93,
          51,
          178,
          182,
          17,
          207,
          50,
          109,
          71,
          8,
          186,
          221,
          119,
          112,
        ])
      );
    });
  });
});
export interface IAboutLanguage {
  titulo: string,
  texto: string,
}

const myLanguage = (l: string): IAboutLanguage => {
  const langPT: IAboutLanguage = {
    titulo: 'Sobre',
    texto: 'Este é meu site!',
  };

  const langENG: IAboutLanguage = {
    titulo: 'About',
    texto: 'This is my site!',
  };

  return (l === 'PT') ? langPT : langENG;
};

export default myLanguage;
export abstract class ImageBitmapBase {
	private nativeInstance: any;

	constructor(nativeInstance: any) {
		this.nativeInstance = nativeInstance;
	}

	get native() {
		return this.nativeInstance;
	}
	abstract readonly width: number;
	abstract readonly height: number;
	abstract close();
}
import {DependencyMap} from './DependencyMap';

interface ModuleStats {
    name: string;
    modules: ModuleStats[];
    reasons: Reason[];
    issuerPath: ModuleStats[];
}

interface Reason {
    moduleName: string;
}

interface Issuer {
    name: string;
}

function processStats(map: DependencyMap, moduleStats: ModuleStats): DependencyMap {
    const moduleName: string        = moduleStats.name;
    const subModules: ModuleStats[] = moduleStats.modules;
    cons


id resetSearch() {
    searchProjects('');
    _hideSearchField();
  }

  void showSearchField() {
    isSearchingProjects.value = true;
  }

  void _hideSearchField() {
    isSearchingProjects.value = false;
  }

  void visibilityChanged(VisibilityInfo info) {
    if (info.visibleFraction > 0) {
      _getShortcuts();
    }
  }

  void _getShortcuts() {
    shortcuts = filtersService.getOrganizationShortcuts();

    if (projects.value?.data == null) return;
    projects.value = ApiResponse.ok(projects.value!.data);
  }

  void showShortcut(SavedShortcut shortcut) {
    OverlayService.bottomsheet(
      title: shortcut.label,
      isScrollControlled: true,
      builder: (context) => ListView(
        children: shortcut.filters
            .map(
              (f) => Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    f.attribute.titleCase,
                    style: context.textTheme.bodyMedium,
                  ),
                  ...f.filters.map(
                    (f2) => Row(
                      children: [
                        CircleAvatar(
                          radius: 2,
                          backgroundColor: context.themeExtension.onBackground,
                        ),
                        const SizedBox(
                          width: 8,
                        ),
                        Text(
                          f2,
                          style: context.textTheme.labelMedium,
                        ),
                      ],
                    ),
                  ),
                  const SizedBox(
                    height: 16,
                  ),
                ],
              ),
            )
            .toList(),
      ),
    );
  }

  Future<void> renameShortcut(SavedShortcut shortcut) async {
    final shortcutLabel = await OverlayService.formBottomsheet(
      title: 'Rename shortcut',
      label: 'Name',
      initialValue: shortcut.label,
    );
    if (shortcutLabel == null) return;

    filtersService.renameShortcut(shortcut, label: shortcutLabel);

    _getShortcuts();
  }

  Future<void> deleteShortcut(SavedShortcut shortcut) async {
    final confirm = await OverlayService.confirm(
      'Attention',
      description: "Do you really want to delete '${shortcut.label}'?",
    );
    if (!confirm) return;

    filtersService.deleteShortcut(shortcut);

    _getShortcuts();
  }

  void _maybeShowSubscriptionBottomsheet() {
    if (storage.hasSeenSubscriptionAddedBottomsheet) return;

    // ignore: unawaited_futures
    OverlayService.bottomsheet(
      title: 'Hi there!',
      isDismissible: false,
      isScrollControlled: true,
      heightPercentage: .9,
      builder: (_) => _SubscriptionAddedBottomsheet(
        onRemoveAds: () {
          AppRouter.popRoute();
          _goToChooseSubscription();
        },
        onSkip: AppRouter.popRoute,
      ),
    );

    storage.setHasSeenSubscriptionAddedBottomsheet();
  }

  void _goToChooseSubscription() {
    AppRouter.goToChooseSubscription();
  }
}
// ignore_for_file: non_constant_identifier_names

@JS()
library core.pusher;

import "package:js/js.dart";
//import "../runtimes/interface.dart" show Runtime;
import "config.dart" show Config;
import "channels/channels.dart" show Channels;
// import "events/dispatcher.dart" show Dispatcher;
//import "timeline/timeline.dart" show Timeline;
//


<button type="submit" class="btn  btn-sm btn-primary">{{_("Search")}}

    </button>
{% endmacro %}

{% macro lnk_back() %}

        {{ _('Back') }}

{% endmacro %}

{% macro lnk_add(my_href) %}

        {{ _('Add') }}

{% endmacro %}

{% macro lnk_edit(my_href) %}

        {{ _('Edit') }}

{% endmacro %}

{% macro lnk_show(my_href) %}

        {{ _('Show') }}

{% endmacro %}

{% macro lnk_delete(my_href) %}

        {{ _('Delete') }}

{% endmacro %}
{#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends base_template %}

{% block title %}Airflow - DAG Dependencies{% endblock %}

{% block head_css %}
{{ super() }}
<link rel="stylesheet" type="text/css" href="{{ url_for_asset('graph.css') }}">
{% endblock %}

{% block content %}
{{ super() }}

  {{ title }}

    <input type="text" id="searchbox" class="form-control" placeholder="Search for..." onenter="null">

    <input type="checkbox" id="deps-filter" checked> Only show DAGs with dependencies

    dag
    trigger
    sensor</span


 = ${node}`);

    props.index = depthIndex;
    props.lowlink = depthIndex;
    props.onStack = true;

    stack.push(node);

    depthIndex += 1;

    const neighborNodes = neighbors(adjacencyList, node);

    for (let i = 0, l = neighborNodes.length; i < l; i++) {
      const neighbor = neighborNodes[i];
      const neighborProps = nodeProps[neighbor];

      if (!neighborProps) throw new Error(`No node properties found for node = ${neighbor}`);

      const neighborIndex = neighborProps.index;

      if (!(neighborIndex >= 0)) {
        strongConnect(neighbor);
        props.lowlink = min(props.lowlink, neighborIndex || Infinity);
      } else if (neighborProps.onStack) {
        props.lowlink = min(props.lowlink, neighborIndex || Infinity);
      }
    }

    if (props.lowlink === props.index) {
      const component = [] as string[];

      let w: string | undefined;
      do {
        w = stack.pop();
        if (typeof w !== 'undefined') {
          nodeProps[w].onStack = false;
          component.push(w);
        }
      } while (w !== node);

      components.push(component);
    }
  }

  return components;
}

import { Entity, PrimaryKey, MikroORM, BigIntType, OneToMany, Collection, Enum, ManyToOne, Logger, Property } from '@mikro-orm/core';
import { SqliteDriver } from '@mikro-orm/sqlite';

export enum LevelType {
  A = 'A',
  B = 'B',
}

@Entity()
class Job {

  @PrimaryKey({ type: BigIntType })
  id!: string;

  @Property({ type: BigIntType, nullable: true })
  optional?: string | null; // GH issue 631

  @OneToMany('Level', 'job', { orphanRemoval: true })
  levels = new Collection<Level>(this);

}

@Entity()
class Level {

  @Enum({ items: () => LevelType, primary: true })
  type: LevelType;

  @ManyToOne({ primary: true })
  job!: Job;

  constructor(type: LevelType) {
    this.type = type;
  }

}

describe('GH issue 482', () => {

  let orm: MikroORM<SqliteDriver>;

  beforeAll(async () => {
    orm = await MikroORM.init({
      entities: [Job, Level],
      dbName: 'mikro_orm_test_gh482',
      type: 'postgresql',
    });
    await orm.getSchemaGenerator().ensureDatabase();
    await orm.getSchemaGenerator().dropSchema();
    await orm.getSchemaGenerator().createSchema();
  });

  afterAll(() => orm.close(true));

  test(`orphan removal with composite keys`, async () => {
    const job = new Job();
    job.id = '1';
    job.levels.add(new Level(LevelType.A));
    job.levels.add(new Level(LevelType.B));
    await orm.em.persistAndFlush(job);
    job.levels.removeAll();

    const mock = jest.fn();
    const logger = new Logger(mock, true);
    Object.assign(orm.config, { logger });
    orm.config.set('debug', ['query', 'query-params']);
    await orm.em.flush();
    expect(mock.mock.calls[0][0]).toMatch('begin');
    expect(mock.mock.calls[1][0]).toMatch(`delete from "level" where ("type", "job_id") in (('A', '1'), ('B', '1'))`);
    expect(mock.mock.calls[2][0]).toMatch('commit');
    mock.mock.calls.length = 0;
  });

  test(`GH issue 631 - nullable bigint type`, async () => {
    const mock = jest.fn();


nce should be greater than End")
	require.Less(t, tolerance, opts.Start, "At half duration, tolerance should be less than Start")

	tolerance = opts.CalcTolerance(2 * TenYears)
	require.GreaterOrEqual(t, tolerance, opts.End, "When duration is OVER 20 years, tolerance should be greater than End")
	require.LessOrEqual(t, tolerance, opts.Start, "When duration is OVER 20 years, tolerance should be less than Start")
}

func TestSizeLevel(t *testing.T) {
	// Test with 0 bytes
	result := sizeLevel(0, 7)
	require.Equal(t, 0, result, "0 bytes should return level 0")

	// Test size 512KB (less than 1MB)
	result = sizeLevel(512*1024, 7)
	require.Equal(t, 0, result, "sizeLevel should return 0 for size 512KB")

	// Test size exactly 1MB
	result = sizeLevel(1*1024*1024, 7)
	require.Equal(t, 1, result, "sizeLevel should return 1 for size 1MB")

	// Test size 1.5MB (between 1MB and 2MB)
	result = sizeLevel(1536*1024, 7)
	require.Equal(t, 1, result, "sizeLevel should return 1 for size 1.5MB")

	// Test size exactly 2MB
	result = sizeLevel(2*1024*1024, 7)
	require.Equal(t, 2, result, "sizeLevel should return 2 for size 2MB")

	// Test size 4MB
	result = sizeLevel(4*1024*1024, 7)
	require.Equal(t, 3, result, "sizeLevel should return 3 for size 4MB")

	// Test size 8MB
	result = sizeLevel(8*1024*1024, 7)
	require.Equal(t, 4, result, "sizeLevel should return 4 for size 8MB")

	// Test size 16MB
	result = sizeLevel(16*1024*1024, 7)
	require.Equal(t, 5, result, "sizeLevel should return 5 for size 16MB")

	// Test size 32MB
	result = sizeLevel(32*1024*1024, 7)
	require.Equal(t, 6, result, "sizeLevel should return 6 for size 32MB")

	// Test size 64MB
	result = sizeLevel(64*1024*1024, 7)
	require.Equal(t, 7, result, "sizeLevel should return 7 for size 64MB")

	// Test size 128MB (exceeds max level)
	result = sizeLevel(128*1024*1024, 7)
	require.Equal(t, 7, result, "sizeLevel should return 7 for size 128MB (capped by maxLevel)")

	// Test with lower maxLevel (3)
	result = sizeLevel(16*1024*1024, 3)
	require.Equal(t, 3, result, "sizeLevel should return 3 for size 16MB when maxLevel is 3")
}

func TestShowCurve(t *testing.T) {
	t.Skip("used to update comments")
	opts := NewLayerZeroOpts()
	s := ""
	v := ""
	for i := 1; i < 61; i++ {
		s += fmt.Sprintf("%d\t", i)
		v += fmt.Sprintf("%d\t", opts.CalcTolerance(time.Duration(i)*time.Minute))
		if i%20 == 0 {
			fmt.Printf("// time:\t%s\n", s)
			fmt.Printf("// val :\t%s\n", v)
			s = ""
			v = ""
			fmt.Println("//")
		}
	}
}

func TestTimeLevelSince(t *testing.T) {
	// Test less than 1 minute
	result := timeLevelSince(30 * time.Second)
	require.Equal(t, 0, result, "30 seconds should return level 0")

	// Test exactly 1 minute
	result = timeLevelSince(1 * time.Minute)
	require.Equal(t, 1, result, "1 minute should return level 1")

	// Test between 1 and 10 minutes
	result = timeLevelSince(5 * time.Min


片的预测结果进行排序的，具体的细节可以参见cleanlab中的find_label_issues函数使用的。具体到我们自己的项目中应该怎么使用呢，参见example。

如我们有15w张的标注数据集，如果算法人员自己去对数据做质量筛查的话，很耗费时间。则可以通过cleanlabel来大致筛选。具体步骤如下：

①**将数据集预处理成k折交叉验证数据集**（K>=5）；

②选择其中k-1份为训练集，1份为验证集，选择模型进行**训练**，训练成k个模型；

③选择其中最好的一个模型，通过上述代码，筛选出它认为issue label的索引。（这里建议是将k个模型都通过上述代码生成issue label的索引后，通过投票等方式筛选，效果应该更好）

上述考虑用k折交叉验证的原因个人理解是，因为对整个数据集做清洗，同时要对数据集训练，有训练的话会划分训练集和验证集，如果只使用做一次训练，则对训练集会过拟合，且对验证集不公平。选用k折交叉验证则能尽可能避免这个问题。

下面我们则可以对issue label 单独拎出来做质量筛查分析，对清洗后的数据重新训练等。

在自己15w的数据集上尝试了下，通过cleanlabel, 筛选出3000来张它认为的噪声数据， 其中2400来张人工核验了下确实是噪声数据，600来张算是困难样本；

实验发现，如果将3000来张数据全部扔掉，**precison和recall在原来的基础上能上升至少5个点**（之前precision:0.724, recall:0.845）；

如果将600张难例数据放回数据集中，precision和recall比没放进去的结果还掉点，这块可能和任务场景有关，大家可以在自己的场景中尝试。所以这里建议可以将issue label的样本从原数据集中clean掉后，再去做后面的训练。

**4. 拓展**

cleanLabel 不仅可以使用在图像分类任务下，也可以用于文本分类、语音分类等分类任务下，因为cleanlabel本质上是使用的置信学习，如果任务场景最后通过置信度对其分类的话，应该都可以使用。同个人也试过在目标检测任务中使用，可以通过将数据集中目标裁剪下来，去筛选该图片，再对清洗后的数据做训练等操作。各位可以尝试。

> **结语**

以上为cleanlabel的使用，希望对大家有帮助。同时文中如果有bug,欢迎一起讨论。# 一. 量化基础
##  1. 对称量化与非对称量化

### (1) 偏移方式的非对称量化

公式推导:

对于任意一个数组, 将其归一化到0-1之间: $$\frac{Xmax-X}{Xmax-Xmin}$$

对于int8类型的任意数据([-128,127]之间的值), 将其归一化到0-1之间: $$\frac{Qmax-Q}{Qmax-Qmin}$$

令 $$\frac{Qmax-Q}{Qmax-Qmin} = \frac{Xmax-X}{Xmax-Xmin}$$


/******************************************************************************/
/** ģƣչ                                                   **/
/** ļƣlcd1602function.h                                              **/
/**     V1.0.0                                                         **/
/**     飺ӦLCD1602ҺĲ                                      **/
/**           HD4470оƬ,ʱ                            **/
/**           +------+-------------------------------+------------+          **/
/**           |  |                           |        |          **/
/**           +------+-------------------------------+------------+          **/
/**           |״̬|RS=L,RW=H,E=H                  |D0-D7=״̬|          **/
/**           +------+-------------------------------+------------+          **/
/**           |дָ|RS=L,RW=L,D0-D7=ָ,E=|          |          **/
/**           +------+-------------------------------+------------+          **/
/**           ||RS=H,RW=H,E=H                  |D0-D7=  |          **/
/**           +------+-------------------------------+------------+          **/
/**           |д|RS=H,RW=L,D0-D7=,E=  |          |          **/
/**           +------+-------------------------------+------------+          **/
/**           ʾģʽã                                                 **/
/**           +---------------+----------------------------------+           **/
/**           |    ָ     |                              |           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           |0|0|1|1|1|0|0|0|16x2ʾ5x78λݽӿ|           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           ʾ/ؼã                                          **/
/**           +---------------+----------------------------------+           **/
/**           |    ָ     |                              |           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           |0|0|0|0|1|D|C|B|D=1 ʾD=0ʾ             |           **/
/**           | | | | | | | | |C=1 ʾꣻC=0 ʾ      |           **/
/**           | | | | | | | | |B=1 ˸C=0 겻˸      |           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           |0|0|0|0|0|1|N|S|N=1 дָ͹1           |           **/
/**           | | | | | | | | |N=0 дָ͹1           |           **/
/**           | | | | | | | | |S=1 дһַƶN |           **/
/**           | | | | | | | | |S=0 дһַʾƶ    |           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           ã                                                     **/
/**           +---------------+----------------------------------+           **/
/**           |    ָ     |                              |           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           |0|0|0|0|0|0|0|1|ʾָʾ        |           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           |0|0|0|0|0|0|1|0|ʾسָ            |           **/
/**           +-+-+-+-+-+-+-+-+----------------------------------+           **/
/**           ָãַ0-27H40H-67H                           **/
/**           +---------------+----------------------------------+           **/
/**           |    ָ     |                              |           **/
/**           +---------------+----------------------------------+           **/
/**           |80H+ַ     |ݵַָ                  |           **/
/**           +---------------+----------------------------------+           **/
/**--------------------------------------------------------------------------**/
/**ʹ˵                                                                **/
/**    1LCD1602ObjectTypeʵ壬úLCD1602Initialization   **/
/**       ʼʵ塣úӲӿڣòͨѶ                     **/
/**    2ʵvoid f(uint8_t value)ֱRS    **/
/**       RWENLCD1602PinSetType3Ԫصĺָ飬RSĲ   **/
/**       ΪһԪأRWĲΪڶԪأENĲ   **/
/**       ΪԪءָָ븳ֵLCD1602ObjectTypeʵ  **/
/**       PinHandleָ롣ʵֶRSRWENŵĲ            **/
/**    3ʵuint8_t f(void)ĺ丳ֵLCD1602ObjectTypeʵ **/
/**       GetByteָ롣ʵֻȡһֽڵݡ                      **/
/**    4ʵvoid f(uint8_t)ĺ丳ֵLCD1602ObjectTypeʵ **/
/**       SendByteָ롣ʵַһֽڵ                       **/
/**    5ʵvoid f(volatile uint32_t period)ĺ丳ֵ       **/
/**       LCD1602ObjectTypeʵDelayusָ롣ʵֲʱλ΢ **/
/**    6ʵvoid f(volatile uint32_t nTime)ĺ丳ֵ        **/
/**       LCD1602ObjectTypeʵDelaymsָ롣ʵֲʱλ **/
/**    7ӦĺʵҪĲ


 components,
    bool strictbounds = false,
  }) async {
    assert(input != "");
    if (strictbounds) {
      assert(location != null);
      assert(radius != null);
    }
    var queryParameters = _createParameters(
      apiKEY,
      input,
      sessionToken,
      offset,
      origin,
      location,
      radius,
      region,
      language,
      types,
      components,
      strictbounds,
    );

    var uri = Uri.https(
      proxyUrl != null && proxyUrl != '' ? proxyUrl! : _authority,
      proxyUrl != null && proxyUrl != ''
          ? 'https://$_authority/$_unencodedPath'
          : _unencodedPath,
      queryParameters,
    );
    return await NetworkUtility.fetchUrl(uri, headers: headers);
  }

  /// Prepare query Parameters
  Map<String, String> _createParameters(
    String apiKEY,
    String input,
    String? sessionToken,
    int? offset,
    LatLon? origin,
    LatLon? location,
    int? radius,
    String? region,
    String? language,
    String? types,
    List<Component>? components,
    bool strictbounds,
  ) {
    String result = input.trimRight();
    result = result.trimLeft();
    Map<String, String> queryParameters = {
      'input': result,
      'key': apiKEY,
    };

    if (components != null && components.length > 0) {
      String result = '';
      for (int i = 0; i < components.length; i++) {
        result += '${components[i].component}:${components[i].value}';
        if (i + 1 != components.length) {
          result += '|';
        }
      }
      var item = {
        'components': result,
      };
      queryParameters.addAll(item);
    }

    if (origin != null) {
      var item = {
        'origin': '${origin.latitude},${origin.longitude}',
      };
      queryParameters.addAll(item);
    }

    if (location != null) {
      var item = {
        'location': '${location.latitude},${location.longitude}',
      };
      queryParameters.addAll(item);
    }

    if (offset != null) {
      var item = {
        'offset': offset.toString(),
      };
      queryParameters.addAll(item);
    }

    if (radius != null) {
      var item = {
        'radius': radius.toString(),
      };
      queryParameters.addAll(item);
    }

    if (sessionToken != null && sessionToken != '') {
      var item = {
        'sessionToken': sessionToken,
      };
      queryParameters.addAll(item);
    }

    if (region != null && region != '') {
      var item = {
        'region': region,
      };
      queryParameters.addAll(item);
    }

    if (language != null && language != '') {
      var item = {
        'language': language,
      };
      queryParameters.addAll(item);
    }

    if (types != null && types != '') {
      var item = {
        'types': types,
      };
      queryParameters.addAll(


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable

using System;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.Components;

namespace Microsoft.CodeAnalysis.Razor;

internal class KeyTagHelperDescriptorProvider : ITagHelperDescriptorProvider
{
    // Run after the component tag helper provider
    public int Order { get; set; } = 1000;

    public RazorEngine Engine { get; set; }

    public void Execute(TagHelperDescriptorProviderContext context)
    {
        if (context == null)
        {
            throw new ArgumentNullException(nameof(context));
        }

        var compilation = context.GetCompilation();
        if (compilation == null)
        {
            return;
        }

        var renderTreeBuilderType = compilation.GetTypeByMetadataName(ComponentsApi.RenderTreeBuilder.FullTypeName);
        if (renderTreeBuilderType == null)
        {
            // If we can't find RenderTreeBuilder, then just bail. We won't be able to compile the
            // generated code anyway.
            return;
        }

        var targetAssembly = context.Items.GetTargetAssembly();
        if (targetAssembly is not null && !SymbolEqualityComparer.Default.Equals(targetAssembly, renderTreeBuilderType.ContainingAssembly))
        {
            return;
        }

        context.Results.Add(CreateKeyTagHelper());
    }

    private TagHelperDescriptor CreateKeyTagHelper()
    {
        var builder = TagHelperDescriptorBuilder.Create(ComponentMet


const cv::RotatedRect& e)
{
    return std::vector<cv::Point2f>{ { e.center.x, 0 }, { e.center.y, 0 }, { e.size.width, 0 }, { e.size.height }, { e.angle, 0 } };
}

inline cv::RotatedRect pointsToEllipse(const cv::Point2f* p)
{
    return {{ p[0].x, p[1].x }, { p[2].x, p[3].x }, p[4].x};
}

inline cv::RotatedRect pointsToEllipse(const std::vector<cv::Point2f>& p)
{
    return {{ p[0].x, p[1].x }, { p[2].x, p[3].x }, p[4].x};
}

inline std::vector<cv::RotatedRect> pointsToEllipses(const std::vector<cv::Point2f>& p)
{
    std::vector<cv::RotatedRect> ellipses;
    size_t n = p.size() / 5;
    for (size_t i = 0; i < n; i++)
    {
        ellipses.push_back(pointsToEllipse(&p[i * 5]));
    }
    return ellipses;
}

DRISHTI_GEOMETRY_END

#endif /* defined(__drishti_geometry_Ellipse_h__) */


/// Need snippets:
///    21    #ctor()
///    22    #ctor(DateTime)

using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;

public class Demo2
{
    static void Ctor1()
    {
        //<snippet21>
        // Create a SoapNonPositiveInteger object.
        SoapNonPositiveInteger xsdInteger =
            new SoapNonPositiveInteger();
        xsdInteger.Value = -14;
        Console.WriteLine(
            "The value of the SoapNonPositiveInteger object is {0}.",
            xsdInteger.ToString());


7.19H12.118l-1.24 2.023zM2.92 0v11.497l2.48 1.55 13.435-3.1zm18.16 24V12.503l-1.984-1.263-5.168 8.267zM5.165 14.053l-4.78 7.648h11.497L18.6 10.953Z"/></svg>';
  static const String mojangstudios =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M12.484 2.077a3.725 3.725 0 103.725 3.726 3.725 3.725 0 00-3.725-3.726zm-12.23.091a.182.182 0 00-.181.182v6.905a.182.182 0 00.182.182h1.453a.182.182 0 00.182-.182V4.44a.454.454 0 01.455-.454h.454a.454.454 0 01.454.454v2.994a.182.182 0 00.182.182h1.453a.182.182 0 00.182-.182V4.44a.454.454 0 01.454-.454h.453a.454.454 0 01.454.454l.002 4.816a.182.182 0 00.182.182h1.453a.182.182 0 00.182-.182V4.167a.182.182 0 00-.181-.182H7.34a.909.909 0 01-.908-.91l.001-.725a.182.182 0 00-.182-.182zm18.375 0a.182.182 0 00-.182.182v1.454a.182.182 0 00.182.181h3.453v3.18a.454.454 0 01-.454.455h-1.363a1.82 1.82 0 01-1.81-1.655.18.18 0 00-.18-.162h-1.458a.18.18 0 00-.182.19 3.634 3.634 0 003.63 3.444H21.9a.182.182 0 00.182-.182v-.727a.909.909 0 01.908-.908h.727a.182.182 0 00.182-.182V2.35a.182.182 0 00-.182-.182zm-6.152 1.817a1.817 1.817 0 011.824 1.818 1.82 1.82 0 01-1.817 1.817 1.817 1.817 0 01-.007-3.635zm-8.77 6.361a3.634 3.634 0 00-3.634 3.635v3.452a.182.182 0 00.182.182h1.453a.182.182 0 00.182-.182v-3.452a1.817 1.817 0 011.817-1.817h1.364a.454.454 0 01.453.454v.909a.454.454 0 01-.454.454H3.071a.182.182 0 00-.181.182v1.453a.182.182 0 00.181.182h2a.454.454 0 01.453.454v1.181a.182.182 0 00.182.182H7.16a.182.182 0 00.182-.182v-5.088a.182.182 0 00-.182-.181l-.73-.003a.909.909 0 01-.906-.909v-.724a.182.182 0 00-.181-.181zm4.932 0a.182.182 0 00-.181.182v6.905a.182.182 0 00.181.182h1.454a.182.182 0 00.182-.182v-4.815a.454.454 0 01.454-.454h2.726a.454.454 0 01.454.454v4.815a.182.182 0 00.182.182h1.454a.182.182 0 00.181-.182v-5.088a.182.182 0 00-.181


eria *oaut.String   `idl:"name:pbstrFilterCriteria" json:"filter_criteria"`
	// Return: The FilterCriteria return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *GetFilterCriteriaResponse) xxx_ToOp(ctx context.Context, op *xxx_GetFilterCriteriaOperation) *xxx_GetFilterCriteriaOperation {
	if op == nil {
		op = &xxx_GetFilterCriteriaOperation{}
	}
	if o == nil {
		return op
	}
	op.That = o.That
	op.FilterCriteria = o.FilterCriteria
	op.Return = o.Return
	return op
}

func (o *GetFilterCriteriaResponse) xxx_FromOp(ctx context.Context, op *xxx_GetFilterCriteriaOperation) {
	if o == nil {
		return
	}
	o.That = op.That
	o.FilterCriteria = op.FilterCriteria
	o.Return = op.Return
}
func (o *GetFilterCriteriaResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetFilterCriteriaResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetFilterCriteriaOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetFilterCriteriaOperation structure represents the FilterCriteria operation
type xxx_SetFilterCriteriaOperation struct {
	This           *dcom.ORPCThis `idl:"name:This" json:"this"`
	That           *dcom.ORPCThat `idl:"name:That" json:"that"`
	FilterCriteria *oaut.String   `idl:"name:bstrFilterCriteria" json:"filter_criteria"`
	Return         int32          `idl:"name:Return" json:"return"`
}

func (o *xxx_SetFilterCriteriaOperation) OpNum() int { return 42 }

func (o *xxx_SetFilterCriteriaOperation) OpName() string {
	return "/IEventSubscription2/v0/FilterCriteria"
}

func (o *xxx_SetFilterCriteriaOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetFilterCriteriaOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// This {in} (1:{alias=ORPCTHIS}(struct))
	{
		if o.This != nil {
			if err := o.This.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&dcom.ORPCThis{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// bstrFilterCriteria {in} (1:{pointer=unique, alias=BSTR}*(1))(2:{pointer=unique, alias=_BSTR, names=FLAGGED_WORD_BLOB}(struct))
	{
		if o.FilterCriteria != nil {
			_ptr_bstrFilterCriteria := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if o.FilterCriteria != nil {
					if err := o.FilterCriteria.MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&oaut.String{}).MarshalN


  const char* name = squash_codec_get_name (codec);

  if (HEDLEY_LIKELY(strcmp ("brieflz", name) == 0)) {
    impl->info = SQUASH_CODEC_INFO_WRAP_SIZE;
    /* impl->get_uncompressed_size = squash_brieflz_get_uncompressed_size; */
    impl->get_max_compressed_size = squash_brieflz_get_max_compressed_size;
    impl->decompress_buffer = squash_brieflz_decompress_buffer;
    impl->compress_buffer_unsafe = squash_brieflz_compress_buffer;
  } else {
    return squash_error (SQUASH_UNABLE_TO_LOAD);
  }

  return SQUASH_OK;
}


acing * randomDouble());
      addGameObject(obj, pos);
    }
  }

  void addEnemyScoutSwarm(int level, double yPos) {
    int numEnemies = (3 + level * 3).clamp(0, 12);
    late List<int> types;
    int swarmLevel = level % _maxLevel;

    if (swarmLevel == 0) {
      types = [0, 0, 0];
    } else if (swarmLevel == 1) {
      types = [0, 1, 0];
    } else if (swarmLevel == 2) {
      types = [1, 0, 1];
    } else if (swarmLevel == 3) {
      types = [1, 1, 1];
    } else if (swarmLevel == 4) {
      types = [0, 1, 2];
    } else if (swarmLevel == 5) {
      types = [1, 2, 1];
    } else if (swarmLevel == 6) {
      types = [2, 1, 2];
    } else if (swarmLevel == 7) {
      types = [2, 1, 2];
    } else if (swarmLevel == 8) {
      types = [2, 2, 2];
    }

    for (int i = 0; i < numEnemies; i++) {
      int type = types[i % 3];
      double spacing = math.max(_chunkSpacing / (numEnemies + 1.0), 80.0);
      double y = yPos +
          _chunkSpacing / 2.0 -
          (numEnemies - 1) * spacing / 2.0 +
          i * spacing;
      addGameObject(EnemyScout(this, type), Offset(0.0, y));
    }
  }

  void addEnemyDestroyerSwarm(int level, double yPos) {
    int numEnemies = (2 + level).clamp(2, 10);
    late List<int> types;
    int swarmLevel = level % _maxLevel;

    if (swarmLevel == 0) {
      types = [0, 0, 0];
    } else if (swarmLevel == 1) {
      types = [0, 1, 0];
    } else if (swarmLevel == 2) {
      types = [1, 0, 1];
    } else if (swarmLevel == 3) {
      types = [1, 1, 1];
    } else if (swarmLevel == 4) {
      types = [0, 1, 2];
    } else if (swarmLevel == 5) {
      types = [1, 2, 1];
    } else if (swarmLevel == 6) {
      types = [2, 1, 2];
    } else if (swarmLevel == 7) {
      types = [2, 1, 2];
    } else if (swarmLevel == 8) {
      types = [2, 2, 2];
    }

    for (int i = 0; i < numEnemies; i++) {
      int type = types[i % 3];
      addGameObject(
          EnemyDestroyer(this, type),
          Offset(randomSignedDouble() * 120.0,
              yPos + _chunkSpacing * randomDouble()));
    }
  }

  void addGameObject(GameObject obj, Offset pos) {
    obj.position = pos;
    obj.setupActions();

    level.addChild(obj);
  }

  void addBossFight(int level, double yPos) {
    // Add boss
    EnemyBoss boss = EnemyBoss(this, level);
    Offset pos = Offset(0.0, yPos + _chunkSpacing / 2.0);

    addGameObject(boss, pos);

    playerState.boss = boss;

    int destroyerLevel = (level - 1 ~/ 3).clamp(0, 2);

    // Add boss's helpers
    if (level >= 1) {
      EnemyDestroyer destroyer0 = EnemyDestroyer(this, destroyerLevel);
      addGameObject(
          destroyer0, Offset(-80.0, yPos + _chunkSpacing / 2.0 + 70.0));

      EnemyDestroyer destroyer1 = EnemyDestroyer(this, destroyerLevel);
      addGameObject(
          destroyer1, Offset(


clude "hud_element_helper.h"
#include "asw_hud_minimap.h"
#include "nb_header_footer.h"
#include "missionchooser/iasw_mission_chooser.h"
#include "missionchooser/iasw_mission_chooser_source.h"
#include "nb_button.h"

// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>

int g_asw_iPlayerListOpen = 0;

PlayerListPanel::PlayerListPanel(vgui::Panel *parent, const char *name) :
	vgui::EditablePanel(parent, name)
{
	//input->MouseEvent(0, false);	// unclick all our mouse buttons when this panel pops up (so firing doesn't get stuck on)

	m_bVoteMapInstalled = true;
	m_PlayerLine.Purge();

	m_pHeaderFooter = new CNB_Header_Footer( this, "HeaderFooter" );
	m_pHeaderFooter->SetTitle( "" );
	m_pHeaderFooter->SetHeaderEnabled( false );
	m_pHeaderFooter->SetFooterEnabled( true );
	m_pHeaderFooter->SetGradientBarEnabled( true );
	m_pHeaderFooter->SetGradientBarPos( 75, 320 );
	if ( ASWGameRules() && ASWGameRules()->GetGameState() != ASW_GS_INGAME )
	{
		m_pHeaderFooter->SetMovieEnabled( true );
		m_pHeaderFooter->SetBackgroundStyle( NB_BACKGROUND_DARK );
	}
	else
	{
		m_pHeaderFooter->SetMovieEnabled( false );
		m_pHeaderFooter->SetBackgroundStyle( NB_BACKGROUND_NONE );
	}

	m_pPlayerHeader = new vgui::Label(this, "PlayerHeader", "#asw_player_list_player");
	m_pMarinesHeader = new vgui::Label(this, "MarinesHeader", "#asw_player_list_marines");
	m_pPingHeader = new vgui::Label(this, "PingHeader", "#asw_player_list_ping");

	m_pMissionLabel = new vgui::Label(this, "MissionLabel", "");
	m_pServerLabel = new vgui::Label(this, "ServerLabel", "");
	m_pDifficultyLabel = new vgui::Label(this, "DifficultyLabel", "");

	m_szMapName[0] = '\0';
	m_iNoCount = -1;
	m_iYesCount = -1;
	m_iSecondsLeft = -1;
	m_fUpdateDifficultyTime = 0;

	// voting buttons
	m_pVoteBackground = new vgui::Panel(this, "VoteBG");
	m_pLeaderButtonsBackground = new vgui::Panel(this, "LeaderBG");
	m_pStartVoteTitle = new vgui::Label(this, "StartVoteTitle", "#asw_start_vote");
	m_pCurrentVoteTitle = new vgui::Label(this, "CurrentVoteTitle", "#asw_current_vote");
	m_pYesVotesLabel = new vgui::Label(this, "YesCount", "");
	m_pNoVotesLabel = new vgui::Label(this, "NoCount", "");
	m_pMapNameLabel = new vgui::WrappedLabel(this, "MapName", " ");
	m_pCounterLabel = new vgui::Label(this, "Counter", "");

	m_pRestartMissionButton = new CNB_Button( this, "RestartButton", "" ); //ImageButton(this, "RestartButton", );
	m_pStartCampaignVoteButton = new CNB_Button(this, "CampaignVoteButton", "#asw_campaign_vote");
	m_pStartSavedCampaignVoteButton = new ImageButton


{
	for (INT32 i = Sf2mdtSoundPos; i < Sf2mdtMSM5205Interleave; i++) {
		ZetRun(Sf2mdtCyclesPerSegment);
		MSM5205Update();
		Sf2mdtSoundPos = i;
	}
	ZetRun(nCpsZ80Cycles - ZetTotalCycles());

	if (pBurnSoundOut) {
		BurnYM2151Render(pBurnSoundOut, nBurnSoundLen);
		MSM5205Render(0, pBurnSoundOut, nBurnSoundLen);
		MSM5205Render(1, pBurnSoundOut, nBurnSoundLen);
	}
	ZetClose();
}

INT32 Sf2mdtScanSound(INT32 nAction, INT32 *pnMin)
{
	if (nAction & ACB_MEMORY_RAM) {
		struct BurnArea ba;
		memset(&ba, 0, sizeof(ba));

		ba.Data = Sf2mdtZ80Ram;
		ba.nLen = 0x00800;
		ba.szName = "Sf2mdtZ80Ram";
		BurnAcb(&ba);
	}

	if (nAction & ACB_DRIVER_DATA) {
		ZetScan(nAction);

		BurnYM2151Scan(nAction, pnMin);
		MSM5205Scan(nAction, pnMin);

		SCAN_VAR(Sf2mdtZ80BankAddress);
		SCAN_VAR(Sf2mdtSoundLatch);
		SCAN_VAR(Sf2mdtSampleBuffer1);
		SCAN_VAR(Sf2mdtSampleBuffer2);
		SCAN_VAR(Sf2mdtSampleSelect1);
		SCAN_VAR(Sf2mdtSampleSelect2);
		SCAN_VAR(Sf2mdtSoundPos);
	}

	return 0;
}
#include "cps.h"

INT32 Cps2Volume = 39;
INT32 Cps2DisableDigitalVolume = 0;
UINT8 Cps2VolUp;
UINT8 Cps2VolDwn;

UINT16 Cps2VolumeStates[40] = {
	0xf010, 0xf008, 0xf004, 0xf002, 0xf001, 0xe810, 0xe808, 0xe804, 0xe802, 0xe801,
	0xe410, 0xe408, 0xe404, 0xe402, 0xe401, 0xe210, 0xe208, 0xe204, 0xe202, 0xe201,
	0xe110, 0xe108, 0xe104, 0xe102, 0xe101, 0xe090, 0xe088, 0xe084, 0xe082, 0xe081,
	0xe050, 0xe048, 0xe044, 0xe042, 0xe041, 0xe030, 0xe028, 0xe024, 0xe022, 0xe021
};

// Input Definitions

static struct BurnInputInfo Cps2FightingInputList[] = {
	{"P1 Coin"          , BIT_DIGITAL  , CpsInp020+4, "p1 coin"   },
	{"P1 Start"         , BIT_DIGITAL  , CpsInp020+0, "p1 start"  },
	{"P1 Up"            , BIT_DIGITAL  , CpsInp001+3, "p1 up"     },
	{"P1 Down"          , BIT_DIGITAL  , CpsInp001+2, "p1 down"   },
	{"P1 Left"          , BIT_DIGITAL  , CpsInp001+1, "p1 left"   },
	{"P1 Right"         , BIT_DIGITAL  , CpsInp001+0, "p1 right"  },
	{"P1 Weak Punch"    , BIT_DIGITAL  , CpsInp001+4, "p1 fire 1" },
	{"P1 Medium Punch"  , BIT_DIGITAL  , CpsInp


      [Test]
        public async Task WhenHandleSaveDecisionsCommandDbContainsAccurateNumberOfDecisions()
        {
            // Arrange
            var command = new SaveDecisionsCommand("workspacetest1")
            {
                DecisionsToAdd = new List<Decision>()
                {
                    new Decision()
                    {
                        Id = "DecisionId1",
                        WorkspaceId = "workspacetest1",
                    }
                }
            };

            // Act
            var handler = new SaveDecisionsCommandHandler(this.dbContext);
            await handler.Handle(command, default);

            // Assert
            var items = await this.dbContext.Decisions.Find(o => true);
            Assert.That(items.Count, Is.EqualTo(1), "There should be exact 1 decision in DB");
        }
    }
}


from datetime import datetime, timezone
from typing import Mapping, Optional

from langgraph.channels.base import BaseChannel
from langgraph.checkpoint.base import Checkpoint
from langgraph.checkpoint.base.id import uuid6
from langgraph.constants import MISSING

LATEST_VERSION = 3

def empty_checkpoint() -> Checkpoint:
    return Checkpoint(
        v=LATEST_VERSION,
        id=str(uuid6(clock_seq=-2)),
        ts=datetime.now(timezone.utc).isoformat(),
        channel_values={},
        channel_versions={},
        versions_seen={},
        pending_sends=[],
    )

def create_checkpoint(
    checkpoint: Checkpoint,
    channels: Optional[Mapping[str, BaseChannel]],
    step: int,
    *,
    id: Optional[str] = None,
) -> Checkpoint:
    """Create a checkpoint for the given channels."""
    ts = datetime.now(timezone.utc).isoformat()
    if channels is None:
        values = checkpoint["channel_values"]
    else:
        values = {}
        for k in channels:
            if k not in checkpoint["channel_versions"]:
                continue
            v = channels[k].checkpoint()
            if v is not MISSING:
                values[k] = v
    return Checkpoint(
        v=LATEST_VERSION,
        ts=ts,
        id=id or str(uuid6(clock_seq=step)),
        channel_values=values,
        channel_versions=checkpoint["channel_versions"],
        versions_seen=checkpoint["versions_seen"],
        pending_sends=checkpoint.get("pending_sends", []),
    )


-9530
// (i7-4712HQ@2.30GHz).
//
//   go run experiment.go
//
/////

func main() {

	/////////////////////////////////////////////////
	// A: Managed heap, 10 million pointers to int //
	/////////////////////////////////////////////////
	fmt.Println(`Case A: what happens when we store 10 million pointers to integer
on the managed heap?` + "\n")

	// build 10 million pointers to integer on the managed heap
	ints := make([]*int, 10*1e6)
	// init our pointers
	for i := range ints {
		j := i
		ints[i] = &j
	}

	// get rid of init garbage
	runtime.GC()
	debug.FreeOSMemory()

	for i := 0; i < 5; i++ {
		// randomly print one of our integers to make sure it's all working
		// as expected, and to prevent them from being optimized away
		fmt.Printf("\tvalue @ index %d: %d\n", i*1e4, *(ints[i*1e4]))

		// run GC
		now := time.Now().UnixNano()
		runtime.GC()
		fmt.Printf("\tGC time (managed heap, 10 million pointers): %d us\n", (time.Now().UnixNano()-now)/1e3)
	}

	// Results:
	//   value @ index 0: 0
	//   GC time (managed heap, 10 million pointers): 329840 us
	//   value @ index 10000: 10000
	//   GC time (managed heap, 10 million pointers): 325375 us
	//   value @ index 20000: 20000
	//   GC time (managed heap, 10 million pointers): 323367 us
	//   value @ index 30000: 30000
	//   GC time (managed heap, 10 million pointers): 327905 us
	//   value @ index 40000: 40000
	//   GC time (managed heap, 10 million pointers): 326469 us

	fmt.Println()

	//////////////////////////////////////////////////////
	// B: Unmanaged heap, pointers generated on-the-fly //
	//////////////////////////////////////////////////////
	fmt.Println(`Case B: mmm doesn't store any pointer, it doesn't need to.
Since the data is stored on an unmanaged heap, it cannot be collected
even if there's no reference to it. This allows mmm to generate
pointers only when something's actually reading or writing to the data.` + "\n")

	// build 10 million integers on an unmanaged heap
	intz, err := mmm.NewMemChunk(int(0), 10*1e6)
	if err != nil {
		log.Fatal(err)
	}
	// init our integers
	for i := 0; i < int(intz.NbObjects()); i++ {
		intz.Write(i, i)
	}

	// get rid of (almost all) previous garbage
	ints = nil
	runtime.GC()
	debug.FreeOSMemory()

	for i := 0; i < 5; i++ {
		// randomly print one of our integers to make sure it's all working
		// as expected (pointer to data is generated on-the-fly)
		fmt.Printf("\tvalue @ index %d: %d\n", i*1e4, intz.Read(i*1e4))

		// run GC
		now := time.Now().UnixNano()
		runtime.GC()
		fmt.Printf("\tGC time (unmanaged heap, pointers generated on-the-fly): %d us\n", (time.Now().UnixNano()-now)/1e3)
	}

	// Results:
	//   value @ index 0: 0
	//   GC time (unmanaged heap, pointers generated on-the-fly): 999 us
	//   value @ index 10000: 10000
	//   GC time (unmanaged heap, pointers generated on-the-fly): 665 us
	//   value @ index 20000: 20000
	//   GC time (unmanaged heap, pointers generated on-the-fly): 827 us
	//   value @ index 30000: 30000
	//   GC time (unmanaged heap, pointers generated on-the-fly): 882 us
	//   value @ index 40000: 40000
	//   GC time (unmanaged heap, pointers generated on-the-fly): 1016 us

	fmt.Println()

	//////////////


`处的字符拿过来继续比较，但是这两个位置的字符是一样的啊，都是`B`，既然一样，拿过来比较不就是无用功了么？其实不是我讲解的有问题，也不是这个算法有问题，而是这个算法还未优化，关于这个问题在下面会详细说明，不过建议读者不要在这里纠结，跳过这个，下面你自然会恍然大悟。

思路如此简单，接下来就是代码实现了，如下：

```c++
/* P 为模式串，下标从 0 开始 */
void GetNext(string P, int next[])
{
	int p_len = P.size();
	int i = 0;   // P 的下标
	int j = -1;
	next[0] = -1;

	while (i < p_len)
	{
		if (j == -1 || P[i] == P[j])
		{
			i++;
			j++;
			next[i] = j;
		}
		else
			j = next[j];
	}
}
```
一脸懵逼，是不是。。。上述代码就是用来求解模式串中每个位置的`next[]`值。

下面具体分析，我把代码分为两部分来讲：

**（1）：i和j的作用是什么？**

i和j就像是两个”指针“，一前一后，通过移动它们来找到最长的相同真前后缀。

**（2）：if...else...语句里做了什么？**

![](https://61mon.com/images/illustrations/KMP/14.png)

假设i和j的位置如上图，由`next[i] = j`得，也就是对于位置i来说，**区段[0, i - 1]的最长相同真前后缀分别是[0, j - 1]和[i - j, i - 1]，即这两区段内容相同**。

按照算法流程，`if (P[i] == P[j])`，则`i++; j++; next[i] = j;`；若不等，则`j = next[j]`，见下图：

![](https://61mon.com/images/illustrations/KMP/15.png)

`next[j]`代表[0, j - 1]区段中最长相同真前后缀的长度。如图，用左侧两个椭圆来表示这个最长相同真前后缀，即这两个椭圆代表的区段内容相同；同理，右侧也有相同的两个椭圆。所以else语句就是利用第一个椭圆和第四个椭圆内容相同来加快得到[0, i - 1]区段的相同真前后缀的长度。

细心的朋友会问if语句中`j == -1`存在的意义是何？第一，程序刚运行时，j是被初始为-1，直接进行`P[i] == P[j]`判断无疑会边界溢出；第二，else语句中`j = next[j]`，j是不断


        {% endfor %}

报名参加这次活动的朋友

        {% for participant in this_event.participants.all %}

{{ participant.nickname}}

        {% endfor %}

{{ this_event.name }}的评论

        {% ifequal COMMENT_SYSTEM 'disqus' %}
          {% with entity_type='event' entity_id=this_event.id %}
            {% url 'event' this_event.id as entity_url %}
            {% include 'core/_disqus_comments.html' %}
          {% endwith %}
        {% else %}
          {% with entity=this_event %}
            {%  url 'event' this_event.id as next_url %}
            {% ifequal COMMENT_SYSTEM 'duoshuo' %}
              {% include 'core/_duoshuo_comments.html' with id=this_event.id title=this_event.name url=next_url %}
            {% else %}
              {% include 'core/_comment_list.html' %}
            {% endifequal %}
          {% endwith %}
        {% endifequal %}

{% endblock %}
## make sure it uses same markup, css and mediaelementjs plugins as in
## src/main/java/org/olat/modules/video/ui/_content/video_run.html

	#if($nanoo)

	#if(!$restrictedUrl)

	#end
	#else

		#if($contentType.startsWith("audio"))
			#set($elem = "audio")
		#else
			#set($elem = "video")
		#end
		#if($showVisualizer)

			<canvas id="$r.getCId()_canvas" class="o_audio_canvas"></canvas>

		#end
		<${elem} id="$r.getId("o_vid")" controls #if($autoplay) autoplay #end preload="none" oncontextmenu="return false;" class="o_video">
	    	<source type="$contentType" src="$mediaUrl" title="$!mediaTitle"/>
		</${elem}>


 = (stylesheets) => {
    for (let i=0; i < stylesheets.length; i++) {
      const stylesheet = stylesheets[i];
      stylesheet.rel = 'stylesheet';
    }
  }
  const manageTransitions = (selector, allowTransitions) => {
    const els = window.document.querySelectorAll(selector);
    for (let i=0; i < els.length; i++) {
      const el = els[i];
      if (allowTransitions) {
        el.classList.remove('notransition');
      } else {
        el.classList.add('notransition');
      }
    }
  }
  const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => {
    const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light';
    const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark';
    let newTheme = '';
    if(darkModeDefault) {
      newTheme = isAlternate ? baseTheme : alternateTheme;
    } else {
      newTheme = isAlternate ? alternateTheme : baseTheme;
    }
    const changeGiscusTheme = () => {
      // From: https://github.com/giscus/giscus/issues/336
      const sendMessage = (message) => {
        const iframe = document.querySelector('iframe.giscus-frame');
        if (!iframe) return;
        iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
      }
      sendMessage({
        setConfig: {
          theme: newTheme
        }
      });
    }
    const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null;
    if (isGiscussLoaded) {
      changeGiscusTheme();
    }
  }
  const toggleColorMode = (alternate) => {
    // Switch the stylesheets
    const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
    manageTransitions('#quarto-margin-sidebar .nav-link', false);
    if (alternate) {
      enableStylesheet(alternateStylesheets);
      for (const sheetNode of alternateStylesheets) {
        if (sheetNode.id === "quarto-bootstrap") {
          toggleBodyColorMode(sheetNode);
        }
      }
    } else {
      disableStylesheet(alternateStylesheets);
      toggleBodyColorPrimary();
    }
    manageTransitions('#quarto-margin-sidebar .nav-link', true);
    // Switch the toggles
    const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
    for (let i=0; i < toggles.length; i++) {
      const toggle = toggles[i];
      if (toggle) {
        if (alternate) {
          toggle.classList.add("alternate");
        } else {
          toggle.classList.remove("alternate");
        }
      }
    }
    // Hack to workaround the fact that safari doesn't
    // properly recolor the scrollbar when toggling (#1455)
    if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
      manageTransitions("body", false);
      window.scrollTo(0, 1);
      setTimeout(() => {
        window.scrollTo(0, 0);
        manageTransitions("body", true);
      }, 40);
    }
  }
  const isFileUrl = () => {
    return window.location.protocol === 'file:';
  }
  const hasAlternateSentinel = () => {
    let styleSentinel = getColorSchemeSentinel();
    if (styleSentinel !== null) {
      return styleSentinel === "alternate";
    } else {
      return false;
    }
  }
  const setStyleSentinel = (alternate) => {
    const value =


from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_MULTIPLE_CHOICE_JOINT
from helm.benchmark.adaptation.common_adapter_specs import get_multiple_choice_adapter_spec
from helm.benchmark.metrics.common_metric_specs import get_exact_match_metric_specs
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.scenarios.scenario import ScenarioSpec

@run_spec_function("healthqa_br")
def get_healthqa_br_spec() -> RunSpec:
    scenario_spec = ScenarioSpec(
        class_name="helm.benchmark.scenarios.healthqa_br_scenario.HEALTHQA_BR_Scenario", args={}
    )

    adapter_spec = get_multiple_choice_adapter_spec(
        method=ADAPT_MULTIPLE_CHOICE_JOINT,
        instructions="""
        Escolha a alternativa correta para as questões de medicina (responda apenas com a letra).
        Exemplo de Pergunta com a resposta:
        Qual dos seguintes órgãos é responsável pela produção da insulina no corpo humano?
        A) Fígado
        B) Rins
        C) Pâncreas
        D) Baço
        E) Coração

        Resposta correta: C

        A partir disso, responda:
        """,
        input_noun="Pergunta",
        output_noun="Resposta",
    )

    return RunSpec(
        name="healthqa_br",
        scenario_spec=scenario_spec,
        adapter_spec=adapter_spec,
        metric_specs=get_exact_match_metric_specs(),
        groups=["healthqa_br"],
    )


of("answer"), "test"), "@answer test");
  }

  @Test
  writePrefixAttributedNumbers(exam: ReconExam): void {
    exam.writes(Record.of(Attr.of("answer"), 42), "@answer 42");
  }

  @Test
  writePrefixAttributedSlots(exam: ReconExam): void {
    exam.writes(Record.of(Attr.of("hello"), Slot.of("subject", "world!")), "@hello{subject:\"world!\"}");
  }

  @Test
  writePostfixEmptyRecords(exam: ReconExam): void {
    exam.writes(Record.of(Record.empty(), Attr.of("signed")), "{{}}@signed");
  }

  @Test
  writePostfixAttributedEmptyText(exam: ReconExam): void {
    exam.writes(Record.of("", Attr.of("signed")), "\"\"@signed");
  }

  @Test
  writePostfixAttributedNonEmptyText(exam: ReconExam): void {
    exam.writes(Record.of("world!", Attr.of("signed")), "\"world!\"@signed");
  }

  @Test
  writePostfixAttributedIdents(exam: ReconExam): void {
    exam.writes(Record.of("test", Attr.of("signed")), "test@signed");
  }

  @Test
  writePostfixAttributedNumbers(exam: ReconExam): void {
    exam.writes(Record.of(42, Attr.of("signed")), "42@signed");
  }

  @Test
  writePostfixAttributedSlots(exam: ReconExam): void {
    exam.writes(Record.of(Slot.of("subject", "world!"), Attr.of("signed")), "{subject:\"world!\"}@signed");
  }

  @Test
  writeSingleValuesWithMultiplePostfixAttributes(exam: ReconExam): void {
    exam.writes(Record.of(6, Attr.of("months"), Attr.of("remaining")), "6@months@remaining");
  }

  @Test
  writeSingleValuesWithCircumfixAttributes(exam: ReconExam): void {
    exam.writes(Record.of(Attr.of("a"), Attr.of("b"), false, Attr.of("x"), Attr.of("y")), "@a@b false@x@y");
  }

  @Test
  writeSingleValuesWithInterspersedAttributes(exam: ReconExam): void {
    exam.writes(Record.of(Attr.of("a"), 1, Attr.of("b"), 2), "@a 1@b 2");
  }

  @Test
  writeSingleValuesWithInterspersedAttributeGroups(exam: ReconExam): void {
    exam.writes(Record.of(Attr.of("a"), Attr.of("b"), 1, Attr.of("c"), Attr.of("d"), 2), "@a@b 1@c@d 2");
  }

  @Test
  writeMultipleValuesWithMultiplePostfixAtributes(exam: ReconExam): void {
    exam.writes(Record.of(1, 2, Attr.of("x"), Attr.of("y")), "{1,2}@x@y");
  }

  @Test
  writeMultipleValuesWithMultipleCircumfixAtributes(exam: ReconExam): void {
    exam.writes(Record.of(Attr.of("a"), Attr.of("b"), 1, 2, Attr.of("x"), Attr.of("y")), "@a@b{1,2}@x@y");
  }

  @Test
  writeMultipleValuesWithMultipleInterspersedAtributes(exam: ReconExam): void {
    exam.writes(Record.of(Attr.of("a"), 1, 2, Attr.of("b"), 3, 4), "@a{1,2


#include <stdio.h>
#include <pico/stdio.h>
#include "i2ckbd.h"
#include "debug.h"

static uint8_t i2c_inited = 0;

void init_i2c_kbd() {
    gpio_set_function(I2C_KBD_SCL, GPIO_FUNC_I2C);
    gpio_set_function(I2C_KBD_SDA, GPIO_FUNC_I2C);
    i2c_init(I2C_KBD_MOD, I2C_KBD_SPEED);
    gpio_pull_up(I2C_KBD_SCL);
    gpio_pull_up(I2C_KBD_SDA);

    i2c_inited = 1;
}

int read_i2c_kbd() {
    int retval;
    static int ctrlheld = 0;
    uint16_t buff = 0;
    unsigned char msg[2];
    int c = -1;
    msg[0] = 0x09;

    if (i2c_inited == 0) return -1;

    retval = i2c_write_timeout_us(I2C_KBD_MOD, I2C_KBD_ADDR, msg, 1, false, 500000);
    if (retval == PICO_ERROR_GENERIC || retval == PICO_ERROR_TIMEOUT) {
        DEBUG_PRINT("I2C write err\n");
        return -1;
    }

    sleep_ms(16);
    retval = i2c_read_timeout_us(I2C_KBD_MOD, I2C_KBD_ADDR, (unsigned char *) &buff, 2, false, 500000);
    if (retval == PICO_ERROR_GENERIC || retval == PICO_ERROR_TIMEOUT) {
        DEBUG_PRINT("I2C read err\n");
        return -1;
    }

    if (buff != 0) {
        if (buff == 0x7e03)ctrlheld = 0;
        else if (buff == 0x7e02) {
            ctrlheld = 1;
        } else if ((buff & 0xff) == 1) {//pressed
            c = buff >> 8;
            int realc = -1;
            switch (c) {
                default:
                    realc = c;
                    break;
            }
            c = realc;
            if (c >= 'a' && c <= 'z' && ctrlheld)c = c - 'a' + 1;
        }
        return c;
    }
    return -1;
}

int read_battery() {
    int retval;
    uint16_t buff = 0;
    unsigned char msg[2];
    msg[0] = 0x0b;

    if (i2c_inited == 0) return -1;

    retval = i2c_write_timeout_us(I2C_KBD_MOD, I2C_KBD_ADDR, msg, 1, false, 500000);
    if (retval == PICO_ERROR_GENERIC || retval == PICO_ERROR_TIMEOUT) {
        DEBUG_PRINT("Batt I2C write err\n");
        return -1;
    }
    sleep_ms(16);
    retval = i2c_read_timeout_us(I2C_KBD_MOD, I2C_KBD_ADDR, (unsigned char *) &buff, 2, false, 500000);
    if (retval == PICO_ERROR_GENERIC || retval == PICO_ERROR_TIMEOUT) {
        DEBUG_PRINT("Batt I2C read err\n");
        return -1;
    }

    if (buff != 0) {
        return buff;
    }
    return -1;
}


n which to operate.

Parameters:
set - the FileSet to add.

addDirset

public void addDirset(DirSet set)

Add a set of directories upon which to operate.

Parameters:
set - the DirSet to add.
Since:

Ant 1.6

addFilelist

public void addFilelist(FileList list)

Add a list of source files upon which to operate.

Parameters:
list - the FileList to add.

add

public void add(ResourceCollection rc)

Add a collection of resources upon which to operate.

Parameters:
rc - resource collection to add.
Since:

Ant 1.7

setRelative

public void setRelative(boolean relative)

Set whether the filenames should be passed on the command line as
 absolute or relative pathnames. Paths are relative to the base
 directory of the corresponding fileset for source files or the
 dest attribute for target files.

Parameters:
relative - whether to pass relative pathnames.

setParallel

public void setParallel(boolean parallel)

Set whether to execute in parallel mode.
 If true, run the command only once, appending all files as arguments.
 If false, command will be executed once for every file. Defaults to false.

Parameters:
parallel - whether to run in parallel.

setType

public


new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				fireButtonMute();
			}
		});

		getImg = reziseImage("/gui/res/gtk-media-record.png");
		lblSave = new JLabel(getImg);
		lblSave.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				fireButtonRecord();
			}
		});

		GroupLayout gl_panel = new GroupLayout(panel);
		gl_panel.setHorizontalGroup(
			gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup()
					.addContainerGap()
					.addComponent(lblCaptureSource)
					.addGap(18)
					.addComponent(comboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(lblStart)
					.addGap(18)
					.addComponent(lblStop)
					.addGap(18)
					.addComponent(lblMute)
					.addGap(18)
					.addComponent(lblSave)
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		gl_panel.setVerticalGroup(
			gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_panel.createParallelGroup(Alignment.TRAILING)
						.addComponent(lblSave)
						.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
							.addComponent(lblMute)
							.addComponent(lblStop)
							.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblCaptureSource)
								.addComponent(comboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblStart))))
					.addContainerGap(12, Short.MAX_VALUE))
		);
		panel.setLayout(gl_panel);

		AudioFormat format = new AudioFormat(11025, 16, 1, true, false);
		try {
			dataLine = AudioSystem.getSourceDataLine(format);
			dataLine.open(format);
		} catch (LineUnavailableException e) {
			e.printStackTrace();
		}
		lblValchannels.setText("1");
		lblValrate.setText("11025");
		lblValsigned.setText("true");
		lblValsizebits.setText("16");
	}

	private ImageIcon reziseImage(String path)
	{
		ImageIcon getImg = new ImageIcon(Toolkit.getDefaultToolkit().getImage(UserGUI.class.getResource(path)));
		Image img = getImg.getImage();
		Image newimg = img.getScaledInstance(32, 32,  java.awt.Image.SCALE_SMOOTH);
		return new ImageIcon(newimg);
	}

	private void fireButtonStartStream() {
		streaming = true;
		int choice = Protocol.ARG_STREAM_AUDIO_MIC;
		if(comboBox.getSelectedItem().equals("Voice call (up & down)")) choice = Protocol.ARG_STREAM_AUDIO_UPDOWN_CALL;
		else if(comboBox.getSelectedItem().equals("Up voice call")) choice = Protocol.ARG_STREAM_AUDIO_UP_CALL;
		else if(comboBox.getSelectedItem().equals("Down voice call")) choice = Protocol.ARG_STREAM_AUDIO_DOWN_CALL;

		//System.out.println("Envoi demande enregistrement, choix : "+((String)comboBox.getSelectedItem())+ " num="+choice);
		lblStart.se


TextOverflow.ellipsis,
                                                ),
                                              ),
                                            ],
                                          )))),
                            ],
                          )),
                    )
                  ],
                ))));
    final colors = _frontN(widget.peer.tags, 25)
        .map((e) => gFFI.abModel.getCurrentAbTagColor(e))
        .toList();
    return Tooltip(
      message: !(isDesktop || isWebDesktop)
          ? ''
          : widget.peer.tags.isNotEmpty
              ? '${translate('Tags')}: ${widget.peer.tags.join(', ')}'
              : '',
      child: Stack(children: [
        child,
        if (colors.isNotEmpty)
          Positioned(
            top: 5,
            right: 10,
            child: CustomPaint(
              painter: TagPainter(radius: 3, colors: colors),
            ),
          )
      ]),
    );
  }
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class IDTextEditingController extends TextEditingController {
  IDTextEditingController({String? text}) : super(text: text);

  String get id => trimID(value.text);

  set id(String newID) => text = formatID(newID);
}

class IDTextInputFormatter extends TextInputFormatter {
  @override
  TextEditingValue formatEditUpdate(
      TextEditingValue oldValue, TextEditingValue newValue) {
    if (newValue.text.isEmpty) {
      return newValue.copyWith(text: '');
    } else if (newValue.text.compareTo(oldValue.text) == 0) {
      return newValue;
    } else {
      int selectionIndexFromTheRight =
          newValue.text.length - newValue.selection.extentOffset;
      String newID = formatID(newValue.text);
      return TextEditingValue(
        text: newID,
        selection: TextSelection.collapsed(
          offset: newID.length - selectionIndexFromTheRight,
        ),
        // https://github.com/flutter/flutter/issues/78066#issuecomment-797869906
        composing: newValue.composing,
      );
    }
  }
}

String formatID(String id) {
  String id2 = id.replaceAll(' ', '');
  String suffix = '';
  if (id2.endsWith(r'\r') || id2.endsWith(r'/r')) {
    suffix = id2.substring(id2.length - 2, id2.length);
    id2 = id2.substring(0, id2.length - 2);
  }
  if (int.tryParse(id2) == null) return id;
  String newID = '';
  if (id2.length <= 3) {
    newID = id2;
  } else {
    var n = id2.length;
    var a = n % 3 != 0 ? n % 3 : 3;
    newID = id2.substring(0, a);
    for (var i = a; i < n; i += 3) {
      newID += " ${id2.substring(i, i + 3)}";
    }
  }
  return newID + suffix;
}

String trimID(String id) {
  return id.replaceAll(' ', '');
}
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import 'package:flutter_hbb/models/state_model.dart';
import 'package:get/get.dart';

const int kMaxVirtualDisplayCount = 4;
const int kAllVirtualDisplay = -1;

const double kDesktopRemoteTabBarHeight = 28.0;
const int kInvalidWindowId = -1;
const int kMainWindowId = 0;

const kAllDisplayValue = -1;

const kKeyLegacyMode = 'legacy';
const kKeyMapMode = 'map';
const kKeyTranslateMode = 'translate';

const String kPlatformAdditionsIsWayland = "is_wayland";
const String kPlatformAdditionsHeadless = "headless";
const String kPlatformAdditionsIsInstalled = "is_installed"


	}

		.logo {
			display: flex;
		}

		.text {
			display: flex;
			flex-direction: column;
			justify-content: center;

			article {
				display: flex;
				flex-direction: column;
				max-height: 100%;

				.name {
					flex: 0;
				}

				.description {
					flex: 1;
					max-height: 560px;
					word-wrap: break-word;
					overflow: auto;
					margin: 28px 0px;

					&, * {
						text-align: left;
					}
				}

				.link-to-website {
					@include link-to-website($imperial);

					&:hover{
						@include link-to-website(transparent);
						border: 1px solid $imperial;
					}
				}
			}
		}
	}
}
@import 'pycontw-2020/styles/palette.scss';

$icon-width: 26px;
$icon-height: 26px;

@mixin icon($name, $margin-top: 0, $x: left, $width: $icon-width) {
	width: $width;
	height: $width;
	margin-top: $margin-top; // Visual compensation.
	background: url('../../assets/icon-#{$name}.svg') top $x no-repeat;
}

@mixin time() {
	font-family: $header-font-family;
	font-size: 18px;
	color: $jinger-bread;
}

@mixin room($content) {
	&::before {
		display: inline;
		content: $content;
		white-space: pre;
	}
}

@mixin roomDisplayStyle() {
	min-width: 2ch;
	font-family: $text-font-family;
	color: #ffffff;
	text-align: center;
	background: $brown;
	border-radius: 5px;
}

@mixin rooms() {
	.room-2-all {
		@include room('All');
	}

	.room-3-r012 {
		@include room('R1, R2, R3');
	}

	.room-4-r0 {
		@include room('R1');
	}

	.room-5-r1 {
		@include room('R2');
	}

	.room-6-r2 {
		@include room('R3');
	}

	.room-1-r3 {
		@include room('Multifunction room\A多功能廳');
	}

	.room-7-r4 {
		@include room('Goodideas Studio\A好想工作室');
	}
}

@mixin eventItem() {
	display: flex;
	font-family: $text-font-family;
	border-radius: 5px;

	a {
		text-decoration: none;
	}

	.context-container {
		position: sticky;
		top: 70px;
		padding: 12px;

		.context {
			.title {
				margin-bottom: 8px;
				font-size: 18px;
				font-weight: 700;
			}

            .remote-block {
                margin-top: -8px;
                margin-bottom: 8px;

                .remote-label {
                    font-size: 0.8rem;
                    color: white;
                    background-color: $jinger-bread;

                    padding: 0.8px 3.5px;
                    border-radius: 3px;
                    position: relative;
                }
            }

			.speaker {
				margin-bottom: 8px;

				.name {
					margin-bottom: 8px;
					font-weight: 600;
					font-size: 14px;
					text-decoration: underline;
				}
			}
		}

		.room {
			display: flex;
			margin-bottom: 8px;
			flex-wrap: wrap;

			& > .room-tag {


Config {
    fn socket_config(&self) -> &SocketConfig {
        &self.socket_config
    }

    fn socket_config_mut(&mut self) -> &mut SocketConfig {
        &mut self.socket_config
    }
}

impl ConfigureSocket for DishConfig {}

impl GetRecvConfig for DishConfig {
    fn recv_config(&self) -> &RecvConfig {
        &self.recv_config
    }

    fn recv_config_mut(&mut self) -> &mut RecvConfig {
        &mut self.recv_config
    }
}

impl ConfigureRecv for DishConfig {}

/// A builder for a `Dish`.
///
/// Allows for ergonomic one line socket configuration.
#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct DishBuilder {
    inner: DishConfig,
}

impl DishBuilder {
    pub fn new() -> Self {
        Self::default()
    }

    pub fn build(&self) -> Result<Dish, Error> {
        self.inner.build()
    }

    pub fn with_ctx(&self, handle: CtxHandle) -> Result<Dish, Error> {
        self.inner.with_ctx(handle)
    }

    pub fn join<I, G>(&mut self, groups: I) -> &mut Self
    where
        I: IntoIterator<Item = G>,
        G: Into<Group>,
    {
        let groups: Vec<Group> = groups.into_iter().map(G::into).collect();
        self.inner.set_groups(Some(groups));
        self
    }
}

impl GetSocketConfig for DishBuilder {
    fn socket_config(&self) -> &SocketConfig {
        self.inner.socket_config()
    }

    fn socket_config_mut(&mut self) -> &mut SocketConfig {
        self.inner.socket_config_mut()
    }
}

impl BuildSocket for DishBuilder {}

impl GetRecvConfig for DishBuilder {
    fn recv_config(&self) -> &RecvConfig {
        self.inner.recv_config()
    }

    fn recv_config_mut(&mut self) -> &mut RecvConfig {
        self.inner.recv_config_mut()
    }
}

impl BuildRecv for DishBuilder {}

#[cfg(test)]
mod test {
    use super::*;

    #[test]
    fn test_ser_de() {
        let config = DishConfig::new();

        let ron = serde_yaml::to_string(&config).unwrap();
        let de: DishConfig = serde_yaml::from_str(&ron).unwrap();
        assert_eq!(config, de);
    }

    #[test]
    fn test_dish() {
        use crate::{prelude::*, TcpAddr, *};
        use std::{thread, time::Duration};

        let addr: TcpAddr = "127.0.0.1:*".try_into().unwrap();

        let radio = RadioBuilder::new().bind(addr).build().unwrap();

        let bound = radio.last_endpoint().unwrap();
        let a: Group = "group a".try_into().unwrap();

        let dish = DishBuilder::new().connect(bound).join(&a).build().unwrap();

        // Start the feed. It has no conceptual start nor end, thus we
        // don't synchronize with the subscribers.
        thread::spawn(move || {
            let a: Group = "group a".try_into().unwrap();
            let b: Group = "group b".try_into().unwrap();
            let mut count = 0;
            loop {
                let mut msg = Msg::new();
                // Alternate between the two groups.
                let group = if count % 2 == 0 { &a } else { &b };

                msg.set_group(group);
                radio.send(msg).unwrap();

                std::thread::sleep(Duration::from_mill


 0 {
		h.ServiceAccountName = WorkloadSA
	}

	//nolint:staticcheck
	if err := h.MultiAZ.reconcileOpts(cr); err != nil {
		return errors.Wrapf(err, "reconcile multiAZ options for replset %s-hidden", rs.Name)
	}

	if h.ContainerSecurityContext == nil {
		h.ContainerSecurityContext = rs.ContainerSecurityContext
	}

	if h.PodSecurityContext == nil {
		h.PodSecurityContext = rs.PodSecurityContext
	}

	if err := h.Configuration.SetDefaults(); err != nil {
		return errors.Wrap(err, "failed to set configuration defaults")
	}

	return nil
}

func (rs *ReplsetSpec) setSafeDefaults(log logr.Logger) {
	if rs.Arbiter.Enabled {
		if rs.Arbiter.Size != 1 {
			log.Info("Setting safe defaults, updating arbiter size", "oldSize", rs.Arbiter.Size, "newSize", 1)
			rs.Arbiter.Size = 1
		}
		if rs.Size < minSafeReplicasetSizeWithArbiter {
			log.Info("Setting safe defaults, updating replset size",
				"oldSize", rs.Size, "newSize", minSafeReplicasetSizeWithArbiter)
			rs.Size = minSafeReplicasetSizeWithArbiter
		}
		if rs.Size%2 != 0 {
			log.Info("Setting safe defaults, disabling arbiter due to odd replset size", "size", rs.Size)
			rs.Arbiter.Enabled = false
			rs.Arbiter.Size = 0
		}
	} else {
		if rs.Size < 2 {
			log.Info("Setting safe defaults, updating replset size to meet the minimum number of replicas",
				"oldSize", rs.Size, "newSize", defaultMongodSize)
			rs.Size = defaultMongodSize
		}
		if rs.Size%2 == 0 {
			log.Info("Setting safe defaults, increasing replset size to have a odd number of replicas",
				"oldSize", rs.Size, "newSize", rs.Size+1)
			rs.Size++
		}
	}
}

func (rs *ReplsetSpec) checkSafeDefaults(unsafe UnsafeFlags) error {
	if !unsafe.ReplsetSize {
		if rs.Arbiter.Enabled {
			if rs.Arbiter.Size != 1 {
				return errors.New("arbiter size must be 1. Set spec.unsafeFlags.replsetSize to true to disable this check")
			}
			if rs.Size < minSafeReplicasetSizeWithArbiter {
				return errors.Errorf("replset size must be at least %d with arbiter. Set spec.unsafeFlags.replsetSize to true to disable this check", minSafeReplicasetSizeWithArbiter)
			}
			if rs.Size%2 != 0 {
				return errors.New("arbiter must disabled due to odd replset size. Set spec.unsafeFlags.replsetSize to true to disable this check")
			}
		} else {
			if rs.Size < 2 {
				return errors.Errorf("replset size must be at least %d. Set spec.unsafeFlags.replsetSize to true to disable this check", defaultMongodSize)
			}
			if rs.Size%2 == 0 {
				return errors.New("replset size must be odd. Set spec.unsafeFlags.replsetSize to true to disable this check")
			}
		}
	}

	mode, err := rs.Configuration.GetTLSMode()
	if err != nil {
		return errors.Wrap(err, "get tls mode")
	}

	if mode != "" {
		return errors.New("tlsMode must be set using spec.tls.mode")
	}

	return nil
}

func (m *MultiAZ) reconcileOpts(cr *PerconaServerMongoDB) error {
	m.reconcileAffinityOpts(cr)
	m.reconcileTopologySpreadConstraints(cr)
	if cr.CompareVersion("1.15.0") >= 0 {
		if m.TerminationGracePeriodSeconds == nil {


/multi-tenancy-gitops/master/scripts/bootstrap.sh | \
    DEBUG=true GIT_ORG=$GIT_ORG OUTPUT_DIR=infra-production bash
    ```

- To get the ArgoCD/GitOps URL and admin password:
    ```bash
    oc get route -n openshift-gitops openshift-gitops-cntk-server -o template --template='https://{{.spec.host}}'
    oc extract secrets/openshift-gitops-cntk-cluster --keys=admin.password -n openshift-gitops --to=-
    ```

- Check the nodes being provisioned:

    ```bash
    watch -n5 oc get nodes,machines -n openshift-machine-api
    ```

    you should see your infra and storage nodes being provisioned and ready

    ```
    Every 5.0s: oc get nodes,machines -n openshift-machine-api                                             mbp.local: Fri Sep  3 11:11:36 2021

    NAME                                             STATUS   ROLES            AGE   VERSION
    node/z2g-cluster2-p45dl-infra-eastus21-z5znc     Ready    infra,worker     60m   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-infra-eastus22-8jwl8     Ready    infra,worker     62m   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-infra-eastus23-jzldd     Ready    infra,worker     62m   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-master-0                 Ready    master           45h   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-master-1                 Ready    master           45h   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-master-2                 Ready    master           45h   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-storage-eastus21-c47hz   Ready    storage,worker   60m   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-storage-eastus22-kn4z4   Ready    storage,worker   62m   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-storage-eastus23-zgqbl   Ready    storage,worker   62m   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-worker-eastus21-zb28l    Ready    worker           45h   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-worker-eastus22-hfbzx    Ready    worker           45h   v1.20.0+4593a24
    node/z2g-cluster2-p45dl-worker-eastus23-tkd6k    Ready    worker           45h   v1.20.0+4593a24

    NAME                                                                     PHASE     TYPE               REGION    ZONE   AGE
    machine.machine.openshift.io/z2g-cluster2-p45dl-infra-eastus21-z5znc     Running   Standard_D4s_v3    eastus2   1      65m
    machine.machine.openshift.io/z2g-cluster2-p45dl-infra-eastus22-8jwl8     Running   Standard_D4s_v3    eastus2   2      65m
    machine.machine.openshift.io/z2g-cluster2-p45dl-infra-eastus23-jzldd     Running   Standard_D4s_v3    eastus2   3      65m
    machine.machine.openshift.io/z2g-cluster2-p45dl-master-0                 Running   Standard_D8s_v3    eastus2   1      45h
    machine.machine.openshift.io/z2g-cluster2-p45dl-master-1                 Running   Standard_D8s_v3    eastus2   2      45h
    machine.machine.openshift.io/z2g-cluster2-p45dl-master-2                 Running   Standard_D8s_v3    eastus2   3      45h
    machine.machine.openshift.io/z2g-cluster2-p45dl-storage-eastus21-c47