CDVCInjuvD8-1665791375-0-ATd3iBHKv2oy8aet2I3wfzEPX4Vix3PU1Zji38nbGIaNWhOymW3oHXXVYflmfOPTBpqUIJrDNJRz3P9tfL1DyeueW/E2qjERVtuHMBXxk6WT+hMH3L4YvY5iXpuHlXyl6WuQmtUy5uoGqAHr1ps6KZ0O3q2QnfUszhcmCGzQW3cL',s:[0x557d0a41ba,0xc6e7406a6a],u:'/cdn-cgi/challenge-platform/h/g'};var now=Date.now()/1000,offset=14400,ts=''+(Math.floor(now)-Math.floor(now%offset)),_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/h/g/scripts/alpha/invisible.js?ts='+ts,document.getElementsByTagName('head')[0].appendChild(_cpo);";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.nonce = '';_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script></body>
</html>
<!doctype html>
<html lang="en" class="no-js">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0 maximum-scale=1.6, user-scalable=1">
    <meta name="description" content=" It is a great honor to join the community of NABE Fellows, and I want to express my appreciation to the Board of Directors of NABE.  1      Given the unprecede" />
    <meta property="og:title" content="Speech by Governor Brainard on the economic outlook"/>
    <meta property="og:site_name" content="Board of Governors of the Federal Reserve System"/>
    <meta property="og:type" content="article" />
    <meta property="og:description" content=" It is a great honor to join the community of NABE Fellows, and I want to express my appreciation to the Board of Directors of NABE.  1      Given the unprecede"/>
    <meta property="og:image"  content="/Social_Default_Image.jpg" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Speech by Governor Brainard on the economic outlook" />
    <meta name="twitter:description" content=" It is a great honor to join the community of NABE Fellows, and I want to express my appreciation to the Board of Directors of NABE.  1      Given the unprecede"/>
    <meta name="twitter:image" content="/Social_Default_Image.jpg" />
    <title>Speech by Governor Brainard on the economic outlook - Federal Reserve Board</title>

    <link href="/css/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="/css/bluesteel-theme.css" rel="stylesheet" type="text/css">
    <script src="/js/modernizr-latest.js" type="text/javascript"></script>


onclick="event.stopPropagation(); messageAlumni(${alumni.id})">

                    Message
                </button>

    `)
    .join("");
}

// Enhanced Mentorship Data
function loadMentorshipData() {
  loadMyMentees();
  loadUpcomingSessions();
  loadMentorshipRequests();
  initMentorshipTabs();
}

function initMentorshipTabs() {
  const mentorshipTabs = document.querySelectorAll(".mentorship-tabs .tab-btn");
  mentorshipTabs.forEach(tab => {
    tab.addEventListener("click", function() {
      const tabName = this.getAttribute("data-mentorship-tab");
      showMentorshipTab(tabName);
    });
  });
}

function showMentorshipTab(tabName) {
  // Hide all mentorship content
  document.querySelectorAll(".mentorship-tab-content").forEach(content => {
    content.classList.remove("active");
  });

  // Remove active class from all tabs
  document.querySelectorAll(".mentorship-tabs .tab-btn").forEach(btn => {
    btn.classList.remove("active");
  });

  // Show selected content and activate tab
  const targetContent = document.getElementById(tabName + "Tab");
  if (targetContent) {
    targetContent.classList.add("active");
  }

  // Activate clicked tab
  event.target.classList.add("active");
}

function loadMyMentees() {
  const menteesList = document.getElementById("menteesList");
  if (!menteesList) return;

  const mentees = [
    {
      id: 1,
      name: "Emma Thompson",
      year: "3rd Year",
      department: "Computer Science",
      avatar: "https://images.pexels.com/photos/774909/pexels-photo-774909.jpeg?auto=compress&cs=tinysrgb&w=100&h=100&fit=crop",
      interests: ["Web Development", "Machine Learning"],
      nextSession: "2025-01-20 15:00",
      progress: 75
    },
    {
      id: 2,
      name: "James Wilson",
      year: "2nd Year",
      department: "Computer Science",
      avatar: "https://images.pexels.com/photos/1222271/pexels-photo-1222271.jpeg?auto=compress&cs=tinysrgb&w=100&h=100&fit=crop",
      interests: ["Mobile Development", "UI/UX"],
      nextSession: "2025-01-22 14:00",
      progress: 60
    },
    {
      id: 3,
      name: "Sophie Chen",
      year: "4th Year",
      department: "Data Science",
      avatar: "https://images.pexels.com/photos/1239291/pexels-photo-1239291.jpeg?auto=compress&cs=tinysrgb&w=100&h=100&fit=crop",
      interests: ["Data Analysis", "Python"],
      nextSession: "2025-01-25 16:00",
      progress: 85
    },
  ];

  menteesList.innerHTML = mentees
    .map(mentee => `

${mentee.name}

${mentee.year} • ${mentee.department}

                    Progress:
                    ${mentee.progress}%

                    <div class="progress-fill" style="width:


life a lot easier",
			"Interface\\Icons\\Spell_Magic_PolymorphChicken",
			UUIToggleSmartPet
		);
	end

end

-- Slash Command Handler
function SmartPet_OnSlashCommand(msg)

	if (not msg) then
		return;
	end

	if ( SmartPet_Config.AcceptedClass == false ) then
		SmartPet_AddInfoMessage(SMARTPET_ONLY_FOR_HUNTER);
		return;
	end

	local command = string.lower(msg);

if ((SmartPet_Vars.Class == "HUNTER") or (SmartPet_Vars.Class == "WARLOCK")) then
	-- Enable/Disable the SmartPet AddOn
	if (command == SMARTPET_ENABLE or command == SMARTPET_ON) then
		SmartPet_Config.Enabled = true;
		SmartPet_AddInfoMessage(SMARTPET_COMMANDS_SMARTPET_ENABLED);
	elseif (command == SMARTPET_DISABLE or command == SMARTPET_OFF  ) then
		SmartPet_Config.Enabled = false;
		SmartPet_AddInfoMessage(SMARTPET_COMMANDS_SMARTPET_DISABLED);

	-- Enable/Disable Mouse Over Tooltips
	elseif (strsub(command, 1, strlen(SMARTPET_TOOLTIPS)) == SMARTPET_TOOLTIPS) then
		if (SmartPet_Config.ToolTips) then
			SmartPet_Config.ToolTips = false;
			SmartPet_AddInfoMessage(SMARTPET_COMMANDS_TOOLTIPS_DISABLED);
		else
			SmartPet_Config.ToolTips = true;
			SmartPet_AddInfoMessage(SMARTPET_COMMANDS_TOOLTIPS_ENABLED);
		end

	-- Health Warning
	elseif (strsub(command, 1, strlen(SMARTPET_AUTOWARN )) == SMARTPET_AUTOWARN  ) then
		if (SmartPet_ToggleOption(command, SmartPet_Config.AutoWarn)) then
			SmartPet_Config.AutoWarn = true;
			SmartPet_AddInfoMessage(SMARTPET_COMMANDS_AUTOWARN_ENABLED);
		else
			SmartPet_Config.AutoWarn = false;
			SmartPet_AddInfoMessage(SMARTPET_COMMANDS_AUTOWARN_DISABLED);
		end

	-- Health Warning Channel
	elseif (strsub(command, 1, strlen(SMARTPET_CHANNEL)) == SMARTPET_CHANNEL ) then
		if (strfind(command, "party")) then
			SmartPet_Config.Channel = "party";
		elseif (strfind(command, "say")) then
			SmartPet_Config.Channel = "say";
		elseif (strfind(command, "guild")) then
			SmartPet_Config.Channel = "guild";
		else
	        firsti, lasti, value = strfind(command, "(%d+)");
	        if (value) then
	        	SmartPet_Config.ChannelNumber = tonumber(value);
			SmartPet_Config.Channel = "channel";
	        else
	        	SmartPet_Config.Channel = "say";
	        end
		end
		SmartPet_AddInfoMessage(string.gsub(SMARTPET_COMMANDS_CHANNEL, '%%c', SmartPet_Config.Channel));

	-- Health Warning Threshold
	elseif (strsub(command, 1, strlen(SMARTPET_WARNHEALTH)) == SMARTPET_WARNHEALTH ) then
        firsti, lasti, value = strfind(command, "(%d+)");
        if (value) then
        	SmartPet_Config.WarnHealth = tonumber(value);
    	else
    		SmartPet_Config.WarnHealth = 30;
    	end
		SmartPet_AddInfoMessage(string.gsub(SMARTPET_COMMANDS_WARNHEALTH, '%%h', SmartPet_Config.WarnHealth));

	-- No Chase
	elseif (strsub(command, 1, strlen(SMARTPET_NOCHASE)) == SMARTPET_NOCHASE ) then
		if (SmartPet_Config.NoChase)


ata (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.license_v2.ListUserClustersRequest} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.license_v2.ListUserClustersRequest.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
};

/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.license_v2.ListUserClustersResponse.repeatedFields_ = [1];

if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.license_v2.ListUserClustersResponse.prototype.toObject = function(opt_includeInstance) {
  return proto.license_v2.ListUserClustersResponse.toObject(opt_includeInstance, this);
};

/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.license_v2.ListUserClustersResponse} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.license_v2.ListUserClustersResponse.toObject = function(includeInstance, msg) {
  var f, obj = {
    clustersList: jspb.Message.toObjectList(msg.getClustersList(),
    proto.license_v2.UserClusterInfo.toObject, includeInstance)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.license_v2.ListUserClustersResponse}
 */
proto.license_v2.ListUserClustersResponse.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.license_v2.ListUserClustersResponse;
  return proto.license_v2.ListUserClustersResponse.deserializeBinaryFromReader(msg, reader);
};

/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.license_v2.ListUserClustersResponse} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.license_v2.ListUserClustersResponse}
 */
proto.license_v2.ListUserClustersResponse.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new proto.license_v2.UserClusterInfo;
      reader.readMessage(value,proto.license_v2.UserClusterInfo.deserializeBinaryFromReader);
      msg.addClusters(value);
      break;
    default:
      reader.skipField();


30",
        "#b2d235",
        "#6d8346",
        "#ac6767",
        "#1d953f",
        "#6950a1",
        "#918597",
        "#f6f5ec"
    ]
};
myChart_50f98280a5994e23b5894ec0ce4c38d6.setOption(option_50f98280a5994e23b5894ec0ce4c38d6);

</script>

<!DOCTYPE html>
{% load i18n %}

    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <title>{% trans "Documentation" %}</title>
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/bootstrap/font/bootstrap-icons.css" rel="stylesheet">

{% load i18n %}

                    {% trans "Create Group" %}

                <button class="btn-close" data-bs-dismiss="modal" type="button" aria-label="Close">
                </button>

                    {% trans "Name" %}
                    <input autocomplete="off" id="group-name" class="form-control" type="text">

                    {% trans "Priority" %}
                    <input autocomplete="off" id="group-priority" class="form-control" type="text" oninput="value=value.replace(/[^\d]/g,'')" value="1


} else {
            require(ordinal == null) { "ordinal must be null if isOrdinal is false" }
            0u
        },
        isOrdinal = isOrdinal,
    )

    @JvmName("component3-XRpZGF0")
    fun `_component3-XRpZGF0`(): UShort? = ordinal

    val ordinal: UShort? get() = if (isOrdinal) _ordinal else null

    override val fields: Map<String, Any>
        get() = buildMap {
            put("name", name)
            put("file", file)
            if (isOrdinal) put("ordinal", _ordinal)
            put("isOrdinal", isOrdinal)
        }
}
package space.iseki.executables.elf

import kotlinx.serialization.Serializable
import space.iseki.executables.common.ExportSymbol

/**
 * Represents an exported symbol in an ELF file
 *
 * @property name Symbol name
 * @property value Symbol value (usually a memory address)
 * @property size Symbol size (in bytes)
 * @property binding Symbol binding attribute (LOCAL, GLOBAL, WEAK)
 * @property type Symbol type (NOTYPE, OBJECT, FUNC, etc.)
 * @property visibility Symbol visibility (DEFAULT, HIDDEN, PROTECTED)
 */
@Serializable
data class ElfExportSymbol internal constructor(
    override val name: String,
    val value: ULong,
    val size: ULong,
    val binding: ElfSymBinding,
    val type: ElfSymType,
    val visibility: ElfSymVisibility,
) : ExportSymbol {
    override val fields: Map<String, Any>
        get() = mapOf(
            "name" to name,
            "value" to value,
            "size" to size,
            "binding" to binding,
            "type" to type,
            "visibility" to visibility,
        )
}@file:JvmName("-ElfEhdr")

package space.iseki.executables.elf

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import space.iseki.executables.common.Address64
import space.iseki.executables.common.ReadableStructure
import space.iseki.executables.common.toAddr
import space.iseki.executables.share.u2
import space.iseki.executables.share.u4
import space.iseki.executables.share.u8
import kotlin.jvm.JvmName

/**
 * Represents the ELF file header structure for both 32-bit and 64-bit formats.
 *
 * The ELF header defines the file's organization. It contains information about
 * how to interpret the file, such as whether it's a 32-bit or 64-bit ELF file,
 * which machine architecture it targets, where to find the program header table
 * and section header table, and other essential metadata.
 *
 * This unified class handles both 32-bit and 64-bit versions of the ELF header format,
 * using the larger data types to accommodate both formats.
 */
@Serializable
@SerialName("ElfEhdr")
data class ElfEhdr internal constructor(
    /**
     * Indicates whether this is a 32-bit or 64-bit ELF file.
     * true for 64-bit, false for 32-bit.
     */
    val is64Bit: Boolean,

    /**
     * This member identifies the object file type.
     */
    val eType: ElfType,

    /**
     * This member's value specifies the required architecture for an individual file.
     *
     * Other values are reserved and will be assigned to new machines as necessary.
     * Processor-specific ELF names use the machine name to distinguish them. For
     * example, the flags mentioned below use the prefix EF_; a flag named WIDGET for
     * the EM_XYZ machine would be called EF_XYZ_WIDGET.
     */
    val eMachine: ElfMachine,

    /**
     * This member identifies the object file version.
     */
    val eVersion: UInt,

    /**
     * This member g


CountStore((state) => state.setCount)
  // ...
}
```

**Recoil**

```ts
import { atom, useRecoilState } from 'recoil'

const countAtom = atom({
  key: 'count',
  default: 0,
})

const Component = () => {
  const [count, setCount] = useRecoilState(countAtom)
  // ...
}
```

## Npm Downloads Trend

- [Npm Downloads Trend of State Management Libraries for React](https://npm-stat.com/charts.html?package=zustand&package=jotai&package=valtio&package=%40reduxjs%2Ftoolkit&package=recoil)
# Windows Input Blocking APIs - Complete Checklist

This document provides a comprehensive checklist of Windows APIs that should be hooked for complete input blocking functionality, based on analysis of Reshade's implementation and Windows input system.

## ✅ Currently Implemented APIs

### Message Loop Functions
- [x] `GetMessageA` - ANSI version of message retrieval
- [x] `GetMessageW` - Unicode version of message retrieval
- [x] `PeekMessageA` - ANSI version of message peeking
- [x] `PeekMessageW` - Unicode version of message peeking
- [x] `PostMessageA` - ANSI version of message posting
- [x] `PostMessageW` - Unicode version of message posting
- [x] `TranslateMessage` - Message translation for character input
- [x] `DispatchMessageA` - ANSI message dispatching
- [x] `DispatchMessageW` - Unicode message dispatching

### Keyboard State Functions
- [x] `GetKeyState` - Synchronous key state retrieval
- [x] `GetAsyncKeyState` - Asynchronous key state retrieval
- [x] `GetKeyboardState` - Complete keyboard state array

### Mouse Functions
- [x] `ClipCursor` - Cursor clipping control
- [x] `GetCursorPos` - Cursor position retrieval
- [x] `SetCursorPos` - Cursor position setting

### Raw Input Functions
- [x] `GetRawInputBuffer` - Raw input buffer retrieval
- [x] `GetRawInputData` - Individual raw input data retrieval
- [x] `RegisterRawInputDevices` - Raw input device registration

### Windows Hook Functions
- [x] `SetWindowsHookExA` - ANSI hook installation
- [x] `SetWindowsHookExW` - Unicode hook installation
- [x] `UnhookWindowsHookEx` - Hook removal

## ❌ Potentially Missing APIs

### Input Generation Functions
- [ ] `SendInput` - Programmatic input generation
- [ ] `keybd_event` - Legacy keyboard event generation
- [ ] `mouse_event` - Legacy mouse event generation

### Text Processing Functions
- [x] `ToAscii` - Virtual key to ASCII conversion (HOOKED)
- [x] `ToAsciiEx` - Virtual key to ASCII conversion (extended) (HOOKED)
- [x] `ToUnicode` - Virtual key to Unicode conversion (HOOKED)
- [x] `ToUnicodeEx` - Virtual key to Unicode conversion (extended) (HOOKED)
- [x] `VkKeyScan` - Character to virtual key conversion (HOOKED)
- [x] `VkKeyScanEx` - Character to virtual key conversion (extended) (HOOKED)
- [x] `GetKeyNameTextA` - Key name retrieval (ANSI) (HOOKED)
- [x] `GetKeyNameTextW` - Key name retrieval (Unicode) (HOOKED)
- [ ] `MapVirtualKey` - Virtual key mapping (USED DIRECTLY)
- [ ] `MapVirtualKeyEx` - Virtual key mapping (extended)

### Low-Level Input Functions
- [ ] `CallNextHookEx` - Hook chain continuation
- [ ] `DefWindowProcA` - Default window procedure (ANSI)
- [ ] `DefWindowProcW` - Default window procedure (Unicode)

### XInput Functions (for gamepad


ITextStoreACPSink*>(context.get()),
                         TS_AS_ALL_SINKS);
    if (FAILED(hr)) mStore = nullptr;
    NS_ENSURE_TRUE(SUCCEEDED(hr), E_FAIL);
    (*ppic) = context;
    (*ppic)->AddRef();
    *pecTextStore = 1;
    return S_OK;
  }

  STDMETHODIMP Push(ITfContext *pic)
  {
    if (mContextTop) {
      NS_NOTREACHED("TSFDocumentMgrImpl::Push stack is already full");
      return E_FAIL;
    }
    if (mContextBase) {
      NS_WARNING("TSFDocumentMgrImpl::Push additional context is pushed, but we don't support that yet.");
      if (mContextBase == pic) {
        NS_NOTREACHED("TSFDocumentMgrImpl::Push same context is pused again");
        return E_FAIL;
      }
      mContextTop = static_cast<TSFContextImpl*>(pic);
      return S_OK;
    }
    mContextBase = static_cast<TSFContextImpl*>(pic);
    return S_OK;
  }

  STDMETHODIMP Pop(DWORD dwFlags)
  {
    if (!mStore)
      return E_FAIL;
    if (dwFlags == TF_POPF_ALL) {
      NS_ENSURE_TRUE(mContextBase, E_FAIL);
      mStore->UnadviseSink(static_cast<ITextStoreACPSink*>(mContextBase.get()));
      mStore = nullptr;
      mContextBase = nullptr;
      mContextTop = nullptr;
      return S_OK;
    }
    if (dwFlags == 0) {
      if (!mContextTop) {
        NS_NOTREACHED("TSFDocumentMgrImpl::Pop there is non-base context");
        return E_FAIL;
      }
      mContextTop = nullptr;
      return S_OK;
    }
    NS_NOTREACHED("TSFDocumentMgrImpl::Pop invalid flag");
    return E_FAIL;
  }

  STDMETHODIMP GetTop(ITfContext **ppic)
  {
    (*ppic) = mContextTop ? mContextTop : mContextBase;
    if (*ppic) (*ppic)->AddRef();
    return S_OK;
  }

  STDMETHODIMP GetBase(ITfContext **ppic)
  {
    (*ppic) = mContextBase;
    if (*ppic) (*ppic)->AddRef();
    return S_OK;
  }

  STDMETHODIMP EnumContexts(IEnumTfContexts **ppEnum)
  {
    NS_NOTREACHED("ITfDocumentMgr::EnumContexts");
    return E_NOTIMPL;
  }

};

/******************************************************************************
 * TSFMgrImpl
 ******************************************************************************/

class TSFMgrImpl : public ITfThreadMgr,
                   public ITfDisplayAttributeMgr, public ITfCategoryMgr
{
private:
  ULONG mRefCnt;

public:
  RefPtr<TestApp> mTestApp;
  TestApp::test_type mTest;
  bool mDeactivated;
  TSFDocumentMgrImpl* mFocusedDocument; // Must be raw pointer, but strong.
  int32_t mFocusCount;

  TSFMgrImpl(TestApp* test) : mTestApp(test), mTest(nullptr), mRefCnt(0),
    mDeactivated(false), mFocusedDocument(nullptr), mFocusCount(0)
  {
  }

  ~TSFMgrImpl()
  {
  }

public: // IUnknown

  STDMETHODIMP QueryInterface(REFIID riid, void** ppUnk)
  {
    *ppUnk = nullptr;
    if (IID_IUnknown == riid || IID_ITfThreadMgr == riid)
      *ppUnk =


using System;
using cpp11_rvalue_reference_moveNamespace;

public class cpp11_rvalue_reference_move_runme {
  public static void Main() {
    {
      // Function containing rvalue reference parameter
      Counter.reset_counts();
      MovableCopyable mo = new MovableCopyable(222);
      Counter.check_counts(1, 0, 0, 0, 0, 0);
      MovableCopyable.movein(mo);
      Counter.check_counts(1, 0, 0, 1, 0, 2);
      if (!MovableCopyable.is_nullptr(mo))
        throw new ApplicationException("is_nullptr failed");
      mo.Dispose();
      Counter.check_counts(1, 0, 0, 1, 0, 2);
    }

    {
      // Move constructor test
      Counter.reset_counts();
      MovableCopyable mo = new MovableCopyable(222);
      Counter.check_counts(1, 0, 0, 0, 0, 0);
      MovableCopyable mo_moved = new MovableCopyable(mo);
      Counter.check_counts(1, 0, 0, 1, 0, 1);
      if (!MovableCopyable.is_nullptr(mo))
        throw new ApplicationException("is_nullptr failed");
      mo.Dispose();
      Counter.check_counts(1, 0, 0, 1, 0, 1);
      mo_moved.Dispose();
      Counter.check_counts(1, 0, 0, 1, 0, 2);
    }

    {
      // Move assignment operator test
      Counter.reset_counts();
      MovableCopyable mo111 = new MovableCopyable(111);
      MovableCopyable mo222 = new MovableCopyable(222);
      Counter.check_counts(2, 0, 0, 0, 0, 0);
      mo111.MoveAssign(mo222);
      Counter.check_counts(2, 0, 0, 0, 1, 1);
      if (!MovableCopyable.is_nullptr(mo222))


;
  final VoidCallback onTap;
  final String time;

  const _ShowTimeItem({
    Key? key,
    required this.isActive,
    required this.onTap,
    required this.time,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: AnimatedContainer(
        duration: Constants.defaultAnimationDuration,
        curve: Curves.fastOutSlowIn,
        width: 110,
        decoration: BoxDecoration(
          gradient: isActive ? Constants.buttonGradientOrange : null,
          border: isActive ? null : Border.all(color: Constants.primaryColor),
          borderRadius: const BorderRadius.all(Radius.circular(12)),
        ),
        child: Center(
          child: Text(
            time,
            textAlign: TextAlign.center,
            style: context.headline3.copyWith(
              color: Colors.white,
              fontSize: 14,
            ),
          ),
        ),
      ),
    );
  }
}
import 'package:flutter_test/flutter_test.dart';
import 'package:ez_ticketz_app/enums/show_type_enum.dart';

void main() {
  group('ShowTypeEnum', () {
    group('name', () {
      test(
        'GIVEN a show type enum '
        'WHEN `.name` extension method is called '
        'THEN the name of the enum is returned',
        () {
          //given
          const enumValue = ShowType.i2D;

          final enumName = enumValue.toString().split('.').last;

          //when
          final name = enumValue.name;

          //then
          expect(name, enumName);
        },
      );
    });

    group('toJson', () {
      test(
        'GIVEN a show type enum '
        'WHEN `.toJson` extension method is called '
        'THEN the json key of the enum value is returned',
        () {
          //given
          const enumValue = ShowType.i2D;

          final enumJson = enumValue.toString().split('.').last.substring(1);

          //when
          final toJson = enumValue.toJson;

          //then
          expect(toJson, enumJson);
        },
      );
    });
  });
}
import 'package:flutter_test/flutter_test.dart';
import 'package:ez_ticketz_app/enums/booking_status_enum.dart';

void main() {
  group('BookingStatusEnum', () {
    group('name', () {
      test(
        'GIVEN a booking status enum '
        'WHEN `.name` extension method is called '
        'THEN the name of the enum is returned',
        () {
          //given
          const enumValue = BookingStatus.RESERVED;

          final enumName = enumValue.toString().split('.').last;

          //when
          final name = enumValue.name;

          //then
          expect(name, enumName);
        },
      );
    });

    group('toJson', () {
      test(
        'GIVEN a booking status enum '
        'WHEN `.toJson` extension method is called '
        'THEN the json key of the enum value is returned',
        () {
          //given
          const enumValue = BookingStatus.CONFIRMED;

          final enumJson = enumValue.toString().split('.').last.toLowerCase();

          //when
          final toJson = enumValue.toJson;

          //then
          expect(toJson, enumJson);
        },
      );
    });
  });
}
import 'package:flutter_test/flutter_test.dart';
import 'package:golden_toolkit/golden_toolkit.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

//Providers
import 'package:ez_ticketz_app/providers/all_providers.dart';
import 'common_mocked_providers.dart


: f64, value: T) -> Self {
		Self {
			distance: distance,
			value: value
		}
	}
}

#[allow(unused_variables)]
impl<T> PartialEq for RayTraceHitHeapEntry<T> {
	fn eq(&self, other: &Self) -> bool {
		false
	}
}

impl<T> Eq for RayTraceHitHeapEntry<T> { }

impl<T> PartialOrd for RayTraceHitHeapEntry<T> {
	fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
		if self.distance == other.distance {
			None
		} else {
			other.distance.partial_cmp(&self.distance)
		}
	}
}

impl<T> Ord for RayTraceHitHeapEntry<T> {
	fn cmp(&self, other: &Self) -> Ordering {
		if self.distance == other.distance {
			Ordering::Equal
		} else {
			match other.distance.partial_cmp(&self.distance) {
				None => Ordering::Equal,
				Some(ord) => ord
			}
		}
	}
}
// Copyright 2017 CoreOS, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! update-ssh-keys library
//!
//! this library provides an interface for manipulating the authorized keys
//! directory. in particular, it provides functionality for
//! * listing authorized keys
//! * adding authorized keys
//! * removing an authorized key by name
//! * disabling an authorized key by name
//!
//! when the authorized keys directory is first opened, a file in the users home
//! directory is locked. This lock is observed by this library and the golang
//! analogue. When the directory is no longer being manipulated, the lock is
//! released. See `AuthorizedKeys::open` for details.

#![allow(deprecated)]

#[macro_use]
extern crate error_chain;
extern crate fs2;
extern crate openssh_keys;
extern crate users;

pub mod errors {
    error_chain! {
        links {
            ParseError(::openssh_keys::errors::Error, ::openssh_keys::errors::ErrorKind);
        }
        foreign_links {
            Io(::std::io::Error);
        }
        errors {
            KeysDisabled(name: String) {
                description("keys are disabled")
                display("keys with name '{}' are disabled", name)
            }
            KeysExist(name: String) {
                description("keys already exist")
                display("keys with name '{}' already exist", name)
            }
            NoKeysFound(ssh_dir: String) {
                description("no keys found")
                display("update-ssh-keys: no keys found in {}", ssh_dir)
            }
        }
    }
}

use errors::*;
use fs2::FileExt;
use openssh_keys::PublicKey;
use std::collections::HashMap;
use std::fs::{self, File};
use std::io::{BufRead, BufReader, Read, Write};
use std::path::{Path, PathBuf};
use users::os::unix::UserExt;
use users::{switch, User};

const SSH_DIR: &str =


 and usefulness

## Related Components

- `/dify/` - Workflow automation configurations
- `/ollama37/` - Docker runtime for LLM execution
- `CLAUDE.md` - Project development guidelines# Docker Image for Ollama on NVIDIA K80 GPU

## Description

This Docker image provides a ready-to-use environment for running Ollama, a local Large Language Model (LLM) runner, specifically optimized to leverage the capabilities of an NVIDIA K80 GPU. This setup is ideal for AI researchers and developers looking to experiment with models in a controlled home lab setting.

The project repository, [dogkeeper886/ollama-k80-lab](https://github.com/dogkeeper886/ollama-k80-lab), offers insights into configuring and using the image effectively. The Dockerfile included in this image is designed for ease of use and efficiency:

- **Build Stage**: Compiles Ollama from source using GCC and CMake.
- **Runtime Environment**: Utilizes Rocky Linux 8 with necessary GPU drivers and libraries pre-configured.

This setup ensures that users can start experimenting with AI models without the hassle of manual environment configuration, making it a perfect playground for innovation in AI research.

## Features

- **GPU Acceleration**: Fully supports NVIDIA K80 GPUs to accelerate model computations.
- **Multi-Modal AI**: Supports vision-language models like Qwen2.5-VL for image understanding.
- **Advanced Reasoning**: Built-in thinking support for enhanced AI reasoning capabilities.
- **Pre-built Binary**: Contains the compiled Ollama binary for immediate use.
- **CUDA Libraries**: Includes necessary CUDA libraries and drivers for GPU operations.
- **Enhanced Tool Support**: Improved tool calling and WebP image input support.
- **Environment Variables**: Configured to facilitate seamless interaction with the GPU and network settings.

## Usage

### Prerequisites

Ensure you have Docker installed on your system and that your NVIDIA K80 GPU is properly set up. You may need the NVIDIA Container Toolkit to enable GPU support in Docker containers.

### Pulling the Image

To pull the image from Docker Hub, use:

```bash
docker pull dogkeeper886/ollama37
```

### Running the Container

To run the container with GPU support, execute:

```bash
docker run --runtime=nvidia --gpus all -p 11434:11434 dogkeeper886/ollama37
```

This command will start Ollama and expose it on port `11434`, allowing you to interact with the service.

## Ollama37 Docker Compose

This `docker-compose.yml` file sets up an Ollama 3.7 container for a more streamlined and persistent environment. It utilizes volumes to persist data and ensures the container automatically restarts if it fails.

### Prerequisites

*   Docker
*   Docker Compose

### Usage

1.  **Save the `docker-compose.yml` file:** Save the content provided below into a file named `docker-compose.yml` in a convenient directory.

2.  **Run the container:** Open a terminal in the directory where you saved the file and run the following command:

    ```bash
    docker-compose up -d
    ```

    This command downloads the `dogkeeper886/ollama37` image (if not already present) and starts the Ollama container in detached mode.

    ```yml
    services:
      ollama37:
        image: dogkeeper886/ollama37
        container_name: ollama37
        ports:
          - "11434:11434"
        restart: unless-stopped # Au


 still here.
                    throw NumberFormatException("varints larger than uint63 not supported")
                }
                if (uByte < 0x80u) {
                    if (uByte == 0u.toUByte() && s > 0) {
                        throw NumberFormatException("varint not minimally encoded")
                    }
                    return value or (uByte.toULong() shl s)
                }
                value = value or ((uByte and 0x7fu).toULong() shl s)
                s += 7
                i++
            }
        }
    }
}

/**
 * Extension function to decode this ByteArray to an [UVarInt] using [UVarInt.fromByteArray]
 * @throws NumberFormatException on illegal input (e.g. values larger than unit63, or non-minimal encoding)
 */
@Throws(NumberFormatException::class)
fun ByteArray.varIntDecode() = UVarInt.fromByteArray(this)

package at.asitplus.cidre

import kotlinx.cinterop.*
import platform.posix.in6_addr
import platform.posix.in_addr
import platform.posix.memcpy

@OptIn(ExperimentalForeignApi::class)
fun IpAddress.V4.toInAddr(): CValue<in_addr> =
    cValue {
        // Interpret 4 octets as UInt32 in network byte order
        val value = ((octets[0].toUInt() and 0xFFu) shl 24) or
                ((octets[1].toUInt() and 0xFFu) shl 16) or
                ((octets[2].toUInt() and 0xFFu) shl 8) or
                (octets[3].toUInt() and 0xFFu)
        s_addr = value
    }

@OptIn(ExperimentalForeignApi::class, UnsafeNumber::class)
fun IpAddress.V6.toInAddr(): CValue<in6_addr> =
    memScoped {
        val v6 = alloc<in6_addr>()
        octets.usePinned { src -> memcpy(v6.ptr, src.addressOf(0), 16.convert()) }
        v6.readValue()
    }

/**@return `CValue<in6_addr>` for IPv6 and `CValue<in_addr>` for IPv4 */
@OptIn(ExperimentalForeignApi::class)
fun IpAddress<*, *>.toInAddr(): CValue<out CStructVar> = when (this) {
    is IpAddress.V4 -> toInAddr()
    is IpAddress.V6 -> toInAddr()
}

@OptIn(ExperimentalForeignApi::class)
operator fun IpAddress.Companion.invoke(addr: CValue<in_addr>): IpAddress.V4 = IpAddress.V4(addr)

@OptIn(ExperimentalForeignApi::class)
operator fun IpAddress.Companion.invoke(addr: CPointer<in_addr>): IpAddress.V4 = IpAddress.V4(addr)

@OptIn(ExperimentalForeignApi::class)
operator fun IpAddress.Companion.invoke(addr: CValue<in6_addr>): IpAddress.V6 = IpAddress.V6(addr)

@OptIn(ExperimentalForeignApi::class)
operator fun IpAddress.Companion.invoke(addr: CPointer<in6_addr>): IpAddress.V6 = IpAddress.V6(addr)

// IPv4: CValue<in_addr> -> IpAddress.V4
@OptIn(ExperimentalForeignApi::class)
operator fun IpAddress.V4.Companion.invoke(addr: CValue<in_addr>): IpAddress.V4 = addr.useContents {
    val v: UInt = s_addr
    val b0 = ((v shr 24) and 0xFFu).toUByte().toByte()
    val b1 = ((v shr 16) and 0xFFu).toUByte().toByte()
    val b2 = ((v shr 8) and 0xFFu).toUByte().toByte()
    val b3 = (v and 0xFFu).toUByte().toByte()
    IpAddress.V4(byteArrayOf(b0, b1, b2, b3))
}

// Optional convenienc


uted in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

/*
 * @test
 * @bug 7042148
 * @summary verify that Bidi.baseIsLeftToRight() returns the correct value even if an incorrect position is set in the given AttributedCharacterIterator.
 * @modules java.desktop
 */
import java.awt.font.*;
import java.text.*;
import java.util.*;

public class Bug7042148 {

    private static boolean err = false;

    public static void main(String[] args) {
        testDirection();

        if (err) {
            throw new RuntimeException("Failed");
        } else {
            System.out.println("Passed.");
        }
    }

    private static void testDirection() {
        Map attrLTR = new HashMap();
        attrLTR.put(TextAttribute.RUN_DIRECTION,
                    TextAttribute.RUN_DIRECTION_LTR);
        Map attrRTL = new HashMap();
        attrRTL.put(TextAttribute.RUN_DIRECTION,
                    TextAttribute.RUN_DIRECTION_RTL);

        String str1 = "A\u05e0";
        String str2 = "\u05e0B";

        test(str1, attrLTR, Bidi.DIRECTION_LEFT_TO_RIGHT);
        test(str1, attrRTL, Bidi.DIRECTION_RIGHT_TO_LEFT);
        test(str2, attrLTR, Bidi.DIRECTION_LEFT_TO_RIGHT);
        test(str2, attrRTL, Bidi.DIRECTION_RIGHT_TO_LEFT);
    }

    private static void test(String text, Map attr, int dirFlag) {
        boolean expected = (dirFlag == Bidi.DIRECTION_LEFT_TO_RIGHT);

        Bidi bidi = new Bidi(text, dirFlag);
        boolean got = bidi.baseIsLeftToRight();
        if (got != expected) {
            err = true;
            System.err.println("wrong Bidi(String, int).baseIsLeftToRight() value: " +
                               "\n\ttext=" + text +
                               "\n\tExpected=" + expected +
                               "\n\tGot=" + got);
        }

        AttributedString as = new AttributedString(text, attr);
        AttributedCharacterIterator itr = as.getIterator();
        itr.last();
        itr.next();
        bidi = new Bidi(itr);
        got = bidi.baseIsLeftToRight();
        if (got != expected) {
            err = true;
            System.err.println("Wrong Bidi(AttributedCharacterIterator).baseIsLeftToRight() value: " +
                               "\n\ttext=" + text +
                               "\n\tExpected=" + expected +
                               "\n\tGot=" + got);
        }
    }

}
/*
 * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St,


n to ROS2 Humble and [Gazebo Fortress installations](https://gazebosim.org/docs/fortress/install_ubuntu), we need to manually install interfaces between ROS2 and Gazebo sim as follows,

```bash
sudo apt-get install ros-humble-ros-gz-sim ros-humble-ros-gz-bridge ros-humble-ros-gz-interfaces
```
Remainder of the dependencies can be installed with [rosdep](http://wiki.ros.org/rosdep)

```bash
# From the root directory of the workspace. This will install everything mentioned in package.xml
rosdep install --from-paths src --ignore-src -r -y
```

### Source Build

```bash
colcon build --packages-select bcr_bot
```

### Binary Install
To install BCR bot in the binaries:

```bash
sudo apt-get install ros-humble-bcr-bot
```

### Run

To launch the robot in Gazebo,
```bash
ros2 launch bcr_bot ign.launch.py
```
To view in rviz,
```bash
ros2 launch bcr_bot rviz.launch.py
```

### Configuration

The launch file accepts multiple launch arguments,
```bash
ros2 launch bcr_bot ign.launch.py \
	camera_enabled:=True \
	stereo_camera_enabled:=False \
	two_d_lidar_enabled:=True \
	position_x:=0.0 \
	position_y:=0.0  \
	orientation_yaw:=0.0 \
	odometry_source:=world \
	world_file:=small_warehouse.sdf
```
**Note:** To use stereo_image_proc with the stereo images excute following command:
```bash
ros2 launch stereo_image_proc stereo_image_proc.launch.py left_namespace:=bcr_bot/stereo_camera/left right_namespace:=bcr_bot/stereo_camera/right
```

## Humble + Harmonic (Ubuntu 22.04)

### Dependencies

In addition to ROS2 Humble and [Gazebo Harmonic installations](https://gazebosim.org/docs/harmonic/install_ubuntu), we need to manually install interfaces between ROS2 and Gazebo sim as follows,

```bash
sudo apt-get install ros-humble-ros-gzharmonic
```
Remainder of the dependencies can be installed with [rosdep](http://wiki.ros.org/rosdep)

```bash
# From the root directory of the workspace. This will install everything mentioned in package.xml
rosdep install --from-paths src --ignore-src -r -y
```

### Build

```bash
colcon build --packages-select bcr_bot
```

### Run

To launch the robot in Gazebo,
```bash
ros2 launch bcr_bot gz.launch.py
```
To view in rviz,
```bash
ros2 launch bcr_bot rviz.launch.py
```

### Configuration

The launch file accepts multiple launch arguments,
```bash
ros2 launch bcr_bot gz.launch.py \
	camera_enabled:=True \
	stereo_camera_enabled:=False \
	two_d_lidar_enabled:=True \
	position_x:=0.0 \
	position_y:=0.0  \
	orientation_yaw:=0.0 \
	odometry_source:=world \
	world_file:=small_warehouse.sdf
```
**Note:**
1. To use stereo_image_proc with the stereo images excute following command:
```bash
ros2 launch stereo_image_proc stereo_image_proc.launch.py left_namespace:=bcr_bot/stereo_camera/left right_namespace:=bcr_bot/stereo_camera/right
```
2. Harmonic support is not available in the bcr_bot binaries yet.

**Warning:**  `gz-harmonic` cannot be installed alongside gazebo-classic (eg. gazebo11) since both use the `gz` command line tool.

### Humble + Isaac Sim (Ubuntu 22.04)

###


println("\n测试全部为 Null 的情况:")
    val nullOnlyOptions = listOf(
        TestOption("Option X", "X", Anchor.Null),
        TestOption("Option Y", "Y", Anchor.Null),
        TestOption("Option Z", "Z", Anchor.Null)
    )

    val sortedNullOnly = sorter.sortOptions(nullOnlyOptions)
    println("原始顺序: ${nullOnlyOptions.map { it.getTitle() }}")
    println("排序后: ${sortedNullOnly.map { it.getTitle() }}")
    println("是否保持原始顺序: ${nullOnlyOptions == sortedNullOnly}")

    // 额外测试复杂的依赖关系
    println("\n测试复杂依赖关系:")
    val complexOptions = listOf(
        TestOption("A", "A", Anchor.Null),
        TestOption("B", "B", Anchor.After("A")),
        TestOption("C", "C", Anchor.Before("A")),
        TestOption("D", "D", Anchor.After("B")),
        TestOption("E", "E", Anchor.Before("C"))
    )

    val sortedComplex = sorter.sortOptions(complexOptions)
    println("复杂依赖排序结果:")
    sortedComplex.forEachIndexed { index, option ->
        println("${index + 1}. ${option.getTitle()} - ${option.getAnchor()}")
    }
    // 额外测试：Before/After 指向不同优先级的选项
    println("\n测试 Before/After 指向不同优先级的选项:")
    val mixedPriorityOptions = listOf(
        TestOption("A", "A", Anchor.Null),
        TestOption("B", "B", Anchor.Before("D")),  // B Before D (D 是 Last)
        TestOption("C", "C", Anchor.After("F")),   // C After F (F 是 First)
        TestOption("D", "D", Anchor.Last),
        TestOption("E", "E", Anchor.Null),
        TestOption("F", "F", Anchor.First)
    )

    val sortedMixed = sorter.sortOptions(mixedPriorityOptions)
    println("混合优先级排序结果:")
    sortedMixed.forEachIndexed { index, option ->
        println("${index + 1}. ${option.getTitle()} - ${option.getAnchor()}")
    }
    println("预期: F -> C -> A -> E -> B -> D")
}package app.termora

import app.termora.terminal.ColorTheme
import app.termora.terminal.TerminalColor
import com.formdev.flatlaf.FlatDarkLaf
import com.formdev.flatlaf.FlatLightLaf
import com.formdev.flatlaf.FlatPropertiesLaf
import com.formdev.flatlaf.util.SystemInfo
import java.util.*

interface LafTag
interface LightLafTag : LafTag
interface DarkLafTag : LafTag

class DraculaLaf : FlatPropertiesLaf("Dracula", Properties().apply {
    putAll(
        mapOf(
            "@baseTheme" to "dark",
            "@background" to "#282935",
            "@windowText" to "#eaeaea",
        )
    )
}), ColorTheme, DarkLafTag {
    override fun getColor(color: TerminalColor): Int {
        return when (color) {
            TerminalColor.Basic.BACKGROUND -> 0x282935
            TerminalColor.Basic.FOREGROUND -> 0xeaeaea
            TerminalColor.Basic.SELECTION_BACKGROUND -> 0x56596b
            TerminalColor.Basic.SELECTION_FOREGROUND -> 0xfeffff
            TerminalColor.Basic.HYPERLINK -> 0x255ab4

            TerminalColor.Cursor.BACKGROUND -> 0xc7c7c7

            TerminalColor.Find.BACKGROUND -> 0xffff00
            TerminalColor.Find.FOREGROUND -> 0x282935

            TerminalColor.Normal.BLACK -> 0
            TerminalColor.Normal.RED -> 0xef766d


sult(Atomic::load(&_head), Atomic::load(&_tail));
  Atomic::store(&_head, (T*)NULL);
  Atomic::store(&_tail, (T*)NULL);
  return result;
}

#endif // SHARE_UTILITIES_LOCKFREEQUEUE_INLINE_HPP
/*
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 *
 */

#ifndef SHARE_UTILITIES_COMPILERWARNINGS_XLC_HPP
#define SHARE_UTILITIES_COMPILERWARNINGS_XLC_HPP

// Nothing here yet.

#endif // SHARE_UTILITIES_COMPILERWARNINGS_XLC_HPP
/*
 * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 *
 */

#ifndef SHARE_UTILITIES_MACROS_HPP
#define SHARE_UTILITIES_MACROS_HPP

// Use this to mark code that needs to be cleaned up (for development only)
#define NEEDS_CLEANUP

// Makes a string of the argument (which is not macro-expanded)
#define STR(a)  #a

// Makes a string of the macro expansion of a
#define XSTR(a) STR(a)

// Allow commas in macro arguments.
#define COMMA ,

// Apply pre-processor token pasting to the expansions of x and y.
// The token pasting operator (##) prevents its arguments from being
// expanded.  This macro allows expansion of its arguments before the
// concatenation is performed.  Note: One auxilliary level ought to be
// sufficient, but two are used because of bugs in some preprocesors.
#define PASTE_TOKENS(x, y) PASTE_TOKENS_AUX(x, y)
#define PASTE_TOKENS_AUX(x, y) PASTE_TOKENS_AUX2(x, y)
#define PASTE_TOKENS_AUX2(x, y) x ## y

// -DINCLUDE_<something>=0 | 1 can be specified on


    BACNET_PRIORITY_FILTER_PRIORITY_15 = 14,
    BACNET_PRIORITY_FILTER_PRIORITY_16 = 15,
    BACNET_PRIORITY_FILTER_PRIORITY_MAX = 16
} BACNET_PRIORITY_FILTER;

typedef enum BACnetResultFlags {
    RESULT_FLAG_FIRST_ITEM = 0,
    RESULT_FLAG_LAST_ITEM = 1,
    RESULT_FLAG_MORE_ITEMS = 2
} BACNET_RESULT_FLAGS;

typedef enum BACnetSuccessFilter {
    BACNET_SUCCESS_FILTER_ALL = 0,
    BACNET_SUCCESS_FILTER_SUCCESS_ONLY = 1,
    BACNET_SUCCESS_FILTER_FAILURES_ONLY = 2
} BACNET_SUCCESS_FILTER;

#endif /* end of BACENUM_H */


>
 *
 * // p5 Color object
 * stroke(color(0, 0, 255));
 * strokeWeight(4);
 * rect(20, 20, 60, 60);
 *
 *

 *
 * @alt
 * 60x60 white rect at center. Dark charcoal grey outline.
 * 60x60 white rect at center. Yellow outline.
 * 60x60 white rect at center. Royal blue outline.
 * 60x60 white rect at center. Red outline.
 * 60x60 white rect at center. Pink outline.
 * 60x60 white rect at center. Black outline.
 * 60x60 white rect at center. Bright green outline.
 * 60x60 white rect at center. Soft green outline.
 * 60x60 white rect at center. Red outline.
 * 60x60 white rect at center. Dark fushcia outline.
 * 60x60 white rect at center. Blue outline.
 */

p5.prototype.stroke = function() {
  this._renderer._setProperty('_strokeSet', true);
  this._renderer._setProperty('_doStroke', true);
  this._renderer.stroke.apply(this._renderer, arguments);
  return this;
};

module.exports = p5;

},{"../core/constants":36,"../core/core":37,"./p5.Color":31}],33:[function(_dereq_,module,exports){
/**
 * @module Shape
 * @submodule 2D Primitives
 * @for p5
 * @requires core
 * @requires constants
 */

'use strict';

var p5 = _dereq_('./core');
var constants = _dereq_('./constants');
var canvas = _dereq_('./canvas');
_dereq_('./error_helpers');

/**
 * Draw an arc to the screen. If called with only a, b, c, d, start, and
 * stop, the arc will be drawn as an open pie. If mode is provided, the arc
 * will be drawn either open, as a chord, or as a pie as specified. The
 * origin may be changed with the ellipseMode() function.

 * Note that drawing a full circle (ex: 0 to TWO_PI) will appear blank
 * because 0 and TWO_PI are the same position on the unit circle. The
 * best way to handle this is by using the ellipse() function instead
 * to create a closed ellipse, and to use the arc() function
 * only to draw parts of an ellipse.
 *
 * @method arc
 * @param  {Number} a      x-coordinate of the arc's ellipse
 * @param  {Number} b      y-coordinate of the arc's ellipse
 * @param  {Number} c      width of the arc's ellipse by default
 * @param  {Number} d      height of the arc's ellipse by default
 * @param  {Number} start  angle to start the arc, specified in radians
 * @param  {Number} stop   angle to stop the arc, specified in radians
 * @param  {Constant} [mode] optional parameter to determine the way of drawing
 *                         the arc
 * @return {Object}        the p5 object
 * @example
 *

 *
 * arc(50, 55, 50, 50, 0, HALF_PI);
 * noFill();
 * arc(50, 55, 60, 60, HALF_PI, PI);
 * arc(50, 55, 70, 70, PI, PI+QUARTER_PI);
 * arc(50, 55, 80, 80, PI+QUARTER_PI, TWO_PI);
 *
 *

 *
 *

 *
 * arc(50, 50, 80, 80, 0, PI+QUARTER_PI, OPEN);
 *
 *

 *
 *

 *
 * arc(50, 50, 80, 80, 0, PI+QUARTER_PI, CHORD);
 *
 *

 *
 *

 *
 * arc(50, 50, 80, 80, 0, PI+QUARTER_PI, PIE);
 *
 *


sd = 0.5m,
};

context.ServiceFees.Add(serviceFee);
context.Networks.AddRange(ethereumNetwork, arbitrumNetwork);
context.Wallets.AddRange(accounts);
await context.SaveChangesAsync();

var rateProvider = new RateProvider
{
    Id = 1,
    Name = "SameAsset"
};

var tokenPrice = new TokenPrice
{
    Id = 1,
    PriceInUsd = 2000.0m,
    ExternalId = "ethereum",
    LastUpdated = DateTimeOffset.UtcNow
};

var ethereumNativeToken = new Token
{
    Id = 1,
    Asset = "ETH",
    Decimals = 18,
    TokenContract = null,
    TokenPrice = tokenPrice,
    NetworkId = 1
};

var arbitrumNativeToken = new Token
{
    Id = 2,
    Asset = "ETH",
    Decimals = 18,
    TokenContract = null,
    TokenPrice = tokenPrice,
    NetworkId = 2
};

var routes = new[]
{
    new Route
    {
        Id = 1,
        SourceTokenId = 1,
        DestinationTokenId = 2,
        RateProviderId = rateProvider.Id,
        MinAmountInSource = TokenUnitHelper.ToBaseUnits(0.000001m, 18).ToString(),
        MaxAmountInSource = TokenUnitHelper.ToBaseUnits(1.0m, 18).ToString(),
        Status = RouteStatus.Active,
        SourceWalletId = accounts[0].Id,
        DestinationWalletId = accounts[0].Id,
        ServiceFeeId = serviceFee.Id
    },
    new Route
    {
        Id = 2,
        SourceTokenId = 2,
        DestinationTokenId = 1,
        RateProviderId = rateProvider.Id,
        MinAmountInSource = TokenUnitHelper.ToBaseUnits(0.000001m, 18).ToString(),
        MaxAmountInSource = TokenUnitHelper.ToBaseUnits(1.0m, 18).ToString(),
        Status = RouteStatus.Active,
        SourceWalletId = accounts[0].Id,
        DestinationWalletId = accounts[0].Id,
        ServiceFeeId = serviceFee.Id
    }
};

ethereumNetwork.NativeTokenId = ethereumNativeToken.Id;
arbitrumNetwork.NativeTokenId = arbitrumNativeToken.Id;

await context.AddRangeAsync([
    rateProvider,
    tokenPrice,
    ethereumNativeToken,
    arbitrumNativeToken,
    ..routes,
]);

await context.SaveChangesAsync();
Console.WriteLine("✅ Seed completed.");


庞，然后在她忍不住瞪大双眼时，不动声色地将徽记摘了下来。',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'1',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'2070323',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2070323',	'',	'这种模棱两可的占卜，对谁说都是一样的话术吧？',	'',	'',	'',	'',	'',	'',	'',	'',	'100000',	'',	'1',	'2',	'1',	'%s',	'',	'[{"id":6016001,"pos":2,"enter":2}]',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'',	'2070324',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2070324',	'',	'我现在最想看到的是什么，魔女小姐如果能猜出来的话，我就相信你。',	'',	'',	'',	'',	'',	'',	'',	'',	'100000',	'',	'1',	'2',	'1',	'%s',	'',	'',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'',	'2070325',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2070325',	'',	'模什么两可啊，我才不是骗子，要对魔女大人足够尊敬，虔心得到的结果才会灵验！',	'',	'',	'',	'',	'',	'',	'',	'',	'6016001',	'',	'',	'2',	'',	'西尔维娅',	'',	'',	'',	'2',	'',	'',	'',	'',	'',	'',	'',	'',	'2070326',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2070326',	'',	'看你大晚上急匆匆的，现在最想要的不就是夜宵和热水澡吗，还是说……',	'',	'',	'',	'',	'',	'',	'',	'',	'6016001',	'',	'',	'2',	'',	'西尔维娅',	'',	'',	'',	'2',	'',	'',	'',	'',	'',	'',	'',	'',	'2070327',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2070327',	'',	'女孩猫一样充满活


_attr "type"     "la")
   (set_attr "cpu_facility" "*,longdisp")
   (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])

(define_insn_and_split "*la_31_and_cc"
  [(set (match_operand:SI 0 "register_operand" "=d")
        (and:SI (match_operand:QI 1 "address_operand" "p")
                (const_int 2147483647)))
   (clobber (reg:CC CC_REGNUM))]
  "!TARGET_64BIT"
  "#"
  "&& reload_completed"
  [(set (match_dup 0)
        (and:SI (match_dup 1) (const_int 2147483647)))]
  ""
  [(set_attr "op_type"  "RX")
   (set_attr "type"     "la")])

(define_insn "force_la_31"
  [(set (match_operand:SI 0 "register_operand" "=d,d")
        (match_operand:QI 1 "address_operand" "ZR,ZT"))
   (use (const_int 0))]
  "!TARGET_64BIT"
  "@
   la\t%0,%a1
   lay\t%0,%a1"
  [(set_attr "op_type"  "RX")
   (set_attr "type"     "la")
   (set_attr "cpu_facility" "*,longdisp")
   (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])

;
; movhi instruction pattern(s).
;

(define_expand "movhi"
  [(set (match_operand:HI 0 "nonimmediate_operand" "")
        (match_operand:HI 1 "general_operand" ""))]
  ""
{
  /* Make it explicit that loading a register from memory
     always sign-extends (at least) to SImode.  */
  if (optimize && can_create_pseudo_p ()
      && register_operand (operands[0], VOIDmode)
      && GET_CODE (operands[1]) == MEM)
    {
      rtx tmp = gen_reg_rtx (SImode);
      rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
      emit_insn (gen_rtx_SET (tmp, ext));
      operands[1] = gen_lowpart (HImode, tmp);
    }
})

(define_insn "*movhi"
  [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,d,R,T,b,Q,v,v,v,d,v,R")
        (match_operand:HI 1 "general_operand"      " d,n,R,T,b,d,d,d,K,K,v,d,v,R,v"))]
  ""
  "@
   lr\t%0,%1
   lhi\t%0,%h1
   lh\t%0,%1
   lhy\t%0,%1
   lhrl\t%0,%1
   sth\t%1,%0
   sthy\t%1,%0
   sthrl\t%1,%0
   mvhhi\t%0,%1
   vleih\t%v0,%h1,0
   vlr\t%v0,%v1
   vlvgh\t%v0,%1,0
   vlgvh\t%0,%v1,0
   vleh\t%v0,%1,0
   vsteh\t%v1,%0,0"
  [(set_attr "op_type"      "RR,RI,RX,RXY,RIL,RX,RXY,RIL,SIL,VRI,VRR,VRS,VRS,VRX,VRX")
   (set_attr "type"         "lr,*,*,*,larl,store,store,store,*,*,*,*,*,*,*")
   (set_


 expand the sample into the
        // entire i32 range. Only floating point samples may exceed 32 bits per coded sample, but
        // they cannot be shifted, so int_shift = 0.
        let int_shift = if self.sample_width <= 32 { 32 - self.sample_width } else { 0 };

        let _ = match self.params.codec {
            CODEC_TYPE_PCM_S32LE => read_pcm_signed!(self.buf,   stream.read_u32()?,    int_shift),
            CODEC_TYPE_PCM_S32BE => read_pcm_signed!(self.buf,   stream.read_be_u32()?, int_shift),
            CODEC_TYPE_PCM_S24LE => read_pcm_signed!(self.buf,   stream.read_u24()?,    int_shift),
            CODEC_TYPE_PCM_S24BE => read_pcm_signed!(self.buf,   stream.read_be_u24()?, int_shift),
            CODEC_TYPE_PCM_S16LE => read_pcm_signed!(self.buf,   stream.read_u16()?,    int_shift),
            CODEC_TYPE_PCM_S16BE => read_pcm_signed!(self.buf,   stream.read_be_u16()?, int_shift),
            CODEC_TYPE_PCM_S8    => read_pcm_signed!(self.buf,   stream.read_u8()?,     int_shift),
            CODEC_TYPE_PCM_U32LE => read_pcm_unsigned!(self.buf, stream.read_u32()?,    int_shift),
            CODEC_TYPE_PCM_U32BE => read_pcm_unsigned!(self.buf, stream.read_be_u32()?, int_shift),
            CODEC_TYPE_PCM_U24LE => read_pcm_unsigned!(self.buf, stream.read_u24()?,    int_shift),
            CODEC_TYPE_PCM_U24BE => read_pcm_unsigned!(self.buf, stream.read_be_u24()?, int_shift),
            CODEC_TYPE_PCM_U16LE => read_pcm_unsigned!(self.buf, stream.read_u16()?,    int_shift),
            CODEC_TYPE_PCM_U16BE => read_pcm_unsigned!(self.buf, stream.read_be_u16()?, int_shift),
            CODEC_TYPE_PCM_U8    => read_pcm_unsigned!(self.buf, stream.read_u8()?,     int_shift),
            CODEC_TYPE_PCM_F32LE => read_pcm_floating!(self.buf, stream.read_f32()?),
            CODEC_TYPE_PCM_F32BE => read_pcm_floating!(self.buf, stream.read_be_f32()?),
            CODEC_TYPE_PCM_F64LE => read_pcm_floating!(self.buf, stream.read_f64()?),
            CODEC_TYPE_PCM_F64BE => read_pcm_floating!(self.buf, stream.read_be_f64()?),
            CODEC_TYPE_PCM_ALAW  => {
                read_pcm_transfer_func!(self.buf, alaw_to_linear(stream.read_u8()?))
            },
            CODEC_TYPE_PCM_MULAW => {
                read_pcm_transfer_func!(self.buf, mulaw_to_linear(stream.read_u8()?))
            },
            // CODEC_TYPE_PCM_S32LE_PLANAR =>
            // CODEC_TYPE_PCM_S32BE_PLANAR =>
            // CODEC_TYPE_PCM_S24LE_PLANAR =>
            // CODEC_TYPE_PCM_S24BE_PLANAR =>
            // CODEC_TYPE_PCM_S16LE_PLANAR =>
            // CODEC_TYPE_PCM_S16BE_PLANAR =>
            // CODEC_TYPE_PCM_S8_PLANAR    =>
            // CODEC_TYPE_PCM_U32LE_PLANAR =>
            // CODEC_TYPE_PCM_U32BE_PLANAR =>
            // CODEC_TYPE_PCM_U24LE_PLANAR =>
            // CODEC_TYPE_PCM_U24BE_PLANAR =>
            // CODEC_TYPE_PCM_U16LE_PLANAR =>
            // CODEC_TYPE_PCM_U16BE_PLANAR =>
            // CODEC_TYPE


fun test(top: () -> Module) {
//        ModuleLibraryRegistry.log.level = Level.WARNING
//        Module.log.level = Level.SEVERE
//        Kopycat.log.level = Level.SEVERE

        PerformanceTester(exitPoint) {
            top()
        }.afterReset {
            it.core.reg(GPR.SP.id, stackStart)
            it.core.pc = entryPoint
        }.use { it.run(1, 1) }
    }

    @Test
    fun memcpyTestProxyNoJson() = test { TestMipsDevice(null, "top", 0, fakeCount) }

    @Test
    fun memcpyTestNoProxyNoJson() = test { TestMipsDeviceNoProxy(null, "top", 0, fakeCount) }

    @Test
    fun idleTestProxyNoJson() = test { TestMipsDevice(null, "top", 1, fakeCount) }

    @Test
    fun idleTestNoProxyNoJson() = test { TestMipsDeviceNoProxy(null, "top", 1, fakeCount) }

    private val testMipsDeviceJson = resourceOrThrow("modules/TestMipsDeviceJson.json")
    private val testMipsDeviceNoProxyJson = resourceOrThrow("modules/TestMipsDeviceNoProxyJson.json")

    @Test
    fun memcpyTestProxyJson() = test {
        registry.json(null, testMipsDeviceJson, "top", 0, fakeCount)
    }

    @Test
    fun memcpyTestNoProxyJson() = test {
        registry.json(null, testMipsDeviceNoProxyJson, "top", 0, fakeCount)
    }

    @Test
    fun idleTestProxyJson() = test {
        registry.json(null, testMipsDeviceJson, "top", 1, fakeCount)
    }

    @Test
    fun idleTestNoProxyJson() = test {
        registry.json(null, testMipsDeviceNoProxyJson, "top", 1, fakeCount)
    }
}/*
 *
 * This file is part of Kopycat emulator software.
 *
 * Copyright (C) 2023 INFORION, LLC
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Non-free licenses may also be purchased from INFORION, LLC,
 * for users who do not want their programs protected by the GPL.
 * Contact us for details kopycat@inforion.ru
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
package ru.inforion.lab403.kopycat.modules.tests

import ru.inforion.lab403.common.extensions.ulong_z
import ru.inforion.lab403.kopycat.cores.base.common.Module
import ru.inforion.lab403.kopycat.cores.base.common.ModuleBuses
import ru.inforion.lab403.kopycat.cores.base.common.ModulePorts
import ru.inforion.lab403.kopycat.library.types.Resource
import ru.inforion.lab403.kopycat.modules.memory.RAM
import ru.inforion.lab403.kopycat.modules.memory.ROM
import ru.inforion.lab403.kopycat.interfaces.*

class MemoryChip(
        parent: Module,
        name: String,
        val fwMode: Int
): Module(parent, name) {

    inner class Ports : ModulePorts(this) {
        val mem = Proxy("mem")
    }

    inner class Buses : ModuleBuses(this) {


atepickerComparison] instead of plain
  /// [DateRangeComparison] objects -- this internal implementation adds extra
  /// needed features like names and next/prev support.
  @Input()
  set range(DatepickerComparison cmp) {
    selection.value = _maybeStripComparison(cmp);
  }

  /// Published when the selected date range or comparison range changes.
  @Output()
  Stream<DatepickerComparison> get rangeChange => selection.stream;

  /// Published when the datepicker popup starts opening or closing.
  @Output('popupVisible')
  Stream<bool> get onPopupVisible => _onPopupVisible.stream;
  final _onPopupVisible = StreamController<bool>.broadcast();

  final DomService _domService;
  final NgZone _ngZone;
  final DatepickerConfig _config;

  /// CSS classes from the root element, passed to the popup to allow scoping of
  /// mixins.
  ///
  /// Only visible for the template.
  final String popupClassName;

  MaterialDateRangePickerComponent(
      @Optional() @Inject(datepickerClock) Clock clock,
      Clock legacyClock,
      @Optional() DatepickerConfig config,
      @Attribute('popupClass') String popupClass,
      @Optional() @SkipSelf() this._popupSizeProvider,
      HtmlElement element,
      this._domService,
      this._ngZone)
      : _config = config ?? DatepickerConfig(),
        popupClassName = constructEncapsulatedCss(popupClass, element.classes) {
    // TODO(google): Migrate to use only datepickerClock
    clock ??= legacyClock;

    // Init minDate and maxDate to sensible defaults
    var now = clock.now();
    minDate = Date(now.year - 10, DateTime.january, 1);
    maxDate = Date(now.year + 10, DateTime.december, 31);
  }

  @override
  void ngOnInit() {
    model
      ..minDate = minDate
      ..maxDate = maxDate
      ..requireFullPeriods = requireFullPeriods
      ..basic = isBasic;
    if (selection.value != null) {
      model.value = _maybeStripComparison(selection.value);
    }
    _disposer.addFunction(model.dispose);

    bool _needsApply(DatepickerComparison modelValue) =>
        modelValue != selection.value || !_isPreset(modelValue);

    // Wire the internal model and the external value up to each other.
    _updateFormattedRanges(selection.value);
    _disposer
      ..addDisposable(selection.stream.listen((v) {
        model.value = _maybeStripComparison(v);
        _updateFormattedRanges(v);
      }))
      ..addDisposable(model.changes
          .map((v) => v.date)
          .map(_needsApply)
          .listen(_showApplyBar))
      ..addDisposable(model.changes
          .where((_) => !_popupVisible) // handle next/prev buttons while closed
          .listen((v) => selection.value = v.date));
  }

  @override
  void ngAfterChanges() {
    // Checks the edge case if user enter a wrong comparison range that
    // is not supported.
    if (supportsComparison &&
        _comparisonOptions != null &&
        selection.value != null &&
        !_isComparisonOptionsSupported(selection.value)) {
      throw UnsupportedError('Your comparisonOptions don\'t support your'
          ' input datePickerComparison: ${selection.value}');
    }
  }

  @override
  void ngOnDestroy() => _disposer.dispose();

  @ViewChild(MaterialPopupComponent)
  MaterialPopupComponent popup;

  /// Open the datepicker popup.
  void open() {
    if (_popupVisible || disabled) return;

    _popupVisible = true;
    _onPopupVisible.add(true);
    popup.open();

    // Initialize the date-range-editor (if it hasn't been already).
    initEditor();

    // This is deferred twice so that the popup animation starts in
    // the next animation frame, and the date range editor init starts
    // after that. The result is that the popup anim


x29, x30, [sp], 32
	ret
.L1005:
	sub	w0, w0, w1
	add	x2, x2, 48
	and	w0, w0, 65535
	b	.L1006
	.size	ftl_get_ppa_from_index, .-ftl_get_ppa_from_index
	.section	.text.lpa_hash_get_ppa,"ax",@progbits
	.align	2
	.global	lpa_hash_get_ppa
	.type	lpa_hash_get_ppa, %function
lpa_hash_get_ppa:
	and	x2, x0, 255
	adrp	x1, .LANCHOR116
	add	x1, x1, :lo12:.LANCHOR116
	mov	w3, 65535
	ldrh	w1, [x1, x2, lsl 1]
	adrp	x2, .LANCHOR117
	ldr	x4, [x2, #:lo12:.LANCHOR117]
	adrp	x2, .LANCHOR118
	ldr	x5, [x2, #:lo12:.LANCHOR118]
.L1010:
	cmp	w1, w3
	bne	.L1012
	mov	w0, -1
	ret
.L1012:
	uxtw	x2, w1
	ldr	w6, [x4, x2, lsl 2]
	cmp	w0, w6
	bne	.L1011
	mov	w0, w1
	b	ftl_get_ppa_from_index
.L1011:
	ldrh	w1, [x5, x2, lsl 1]
	b	.L1010
	.size	lpa_hash_get_ppa, .-lpa_hash_get_ppa
	.section	.text.ftl_get_new_free_page,"ax",@progbits
	.align	2
	.global	ftl_get_new_free_page
	.type	ftl_get_new_free_page, %function
ftl_get_new_free_page:
	stp	x29, x30, [sp, -32]!
	add	x29, sp, 0
	ldrh	w1, [x0]
	str	x19, [sp, 16]
	mov	x19, x0
	mov	w0, 65535
	cmp	w1, w0
	bne	.L1014
	adrp	x1, .LANCHOR119
	adrp	x0, .LC0
	mov	w2, 2088
	add	x1, x1, :lo12:.LANCHOR119
	add	x0, x0, :lo12:.LC0
	bl	printf
.L1014:
	adrp	x0, .LANCHOR94
	ldrh	w1, [x19, 2]
	ldrh	w0, [x0, #:lo12:.LANCHOR94]
	cmp	w1, w0
	bne	.L1015
	adrp	x1, .LANCHOR119
	adrp	x0, .LC0
	mov	w2, 2089
	add	x1, x1, :lo12:.LANCHOR119
	add	x0, x0, :lo12:.LC0
	bl	printf
.L1015:
	ldrh	w0, [x19, 6]
	cbnz	w0, .L1016
	adrp	x1, .LANCHOR119
	adrp	x0, .LC0
	mov	w2, 2090
	add	x1, x1, :lo12:.LANCHOR119
	add	x0, x0, :lo12:.LC0
	bl	printf
.L1016:
	ldrb	w


_epoch,
    total_epochs=total_epochs,
    warmup_epochs=5,           # 预热 5 个 epoch
    power=2.0,                 # 使用二次多项式进行衰减
    end_learning_rate=1e-6     # 最终学习率
)

# 在训练循环中使用
for epoch in range(total_epochs):
    for step_in_epoch in range(niter_per_epoch):
        # ... 训练代码 ...
        optimizer.step()
        scheduler.step()
~~~

[`返回顶部`](#tyeeoptimlr_scheduler)

## ReduceLROnPlateauScheduler

该调度器封装了 PyTorch 的 `ReduceLROnPlateau`，并增加了一个可选的线性预热阶段。它可以在一个监控指标（如验证集损失）停止改善时降低学习率。

**调度策略**

`ReduceLROnPlateauScheduler` 的学习率调整分为两个阶段：

1. **线性预热 (Warmup)**: (可选) 在训练开始的 `warmup_steps` 步内，学习率从 `warmup_start_lr` 线性增加到优化器中设置的基础学习率。
2. **平台期检测 (Plateau Detection)**: 预热结束后，调度器会监控一个指定的指标值。如果在 `patience_steps`（耐心步数）内该指标没有明显改善（根据 `mode` 和 `threshold` 判断），学习率将会乘以一个缩减因子 `factor`。

**初始化参数**

- **`optimizer`** (`Optimizer`): 被包装的优化器。
- **`niter_per_epoch`** (`int`): 每个 epoch 包含的迭代（step）次数。
- **`metric_source`** (`str`): 该参数用于训练框架，以从评估结果中识别并选择正确的指标值传入 `step()` 方法。`metric_source` 指定数据来源（如 `'val'`或`'train'`）。
- **`metric`** (`str`): 该参数用于训练框架，`metric` 指定指标名称（如 `'loss'`）。
- **`patience_epochs`** (`int`): 在降低学习率之前，等待指标无改善的轮数。将被转换为 `patience_steps`。默认为 `10`。
- **`patience_steps`** (`int`, 可选): 在降低学习率之前，等待指标无改善的步数。
- **`factor`** (`float`): 学习率的缩减因子 (`new_lr = lr * factor`)。默认为 `0.1`。
- **`threshold`** (`float`): 用于衡量指标是否有“明显”改善的阈值。默认为 `1e-4`。
- **`mode`** (`str`): `'min'` 或 `'max'` 之一。在 `'min'` 模式下，当指标停止下降时降低学习率；在 `'max'` 模式下，当指标停止上升时降低学习率。默认为 `'min'`。
- **`warmup


s for type, region, etc.
 *
 * @returns the newly created Linode object.
 */
export const createLinode = (data: CreateLinodeRequest) =>
  Request<Linode>(
    setURL(`${API_ROOT}/linode/instances`),
    setMethod('POST'),
    setData(data, CreateLinodeSchema),
  )
    .then(response => response.data);

/**
 * updateLinode
 *
 * Generates a token which can be used to authenticate with LISH.
 *
 * @param linodeId { number } The id of the Linode to be updated.
 * @param values { object } the fields of the Linode object to be updated.
 * Fields not included in this parameter will be left unchanged.
 */
export const updateLinode = (linodeId: number, values: Partial<Linode>) =>
  Request<Linode>(
    setURL(`${API_ROOT}/linode/instances/${linodeId}`),
    setMethod('PUT'),
    setData(values, UpdateLinodeSchema),
  )
    .then(response => response.data);

/**
 * deleteLinode
 *
 * Delete the specified Linode instance.
 *
 * @param linodeId { number } The id of the Linode to be deleted.
 */
export const deleteLinode = (linodeId: number) =>
  Request<{}>(
    setURL(`${API_ROOT}/linode/instances/${linodeId}`),
    setMethod('DELETE'),
  );
// ref https://github.com/vuejs/vitepress/blob/main/src/node/markdown/plugins/highlight.ts
import chalk from 'chalk'
import escapeHtml from 'escape-html'
import prism from 'prismjs'
import consola from 'consola'

// prism is listed as actual dep so it's ok to require
// eslint-disable-next-line @typescript-eslint/no-var-requires
const loadLanguages = require('prismjs/components/index')

// required to make embedded highlighting work...
loadLanguages(['markup', 'css', 'javascript'])

function wrap(code: string, lang: string): string {
  if (lang === 'text') {
    code = escapeHtml(code)
  }
  return `<pre v-pre><code>${code}</code></pre>`
}

export const highlight = (str: string, lang: string) => {
  if (!lang) {
    return wrap(str, 'text')
  }
  lang = lang.toLowerCase()
  const rawLang = lang
  if (lang === 'vue' || lang === 'html') {
    lang = 'markup'
  }
  if (lang === 'md') {
    lang = 'markdown'
  }
  if (lang === 'ts') {
    lang = 'typescript'
  }
  if (lang === 'py') {
    lang = 'python'
  }
  if (!prism.languages[lang]) {
    try {
      loadLanguages([lang])
    } catch {
      // eslint-disable-next-line no-console
      consola.warn(
        chalk.yellow(
          `[vitepress] Syntax highlight for language "${lang}" is not supported.`
        )
      )
    }
  }
  if (prism.languages[lang]) {
    const code = prism.highlight(str, prism.languages[lang], lang)
    return wrap(code, rawLang)
  }
  return wrap(str, 'text')
}
export default function within( min:number, max:number,value:number): number {
    return Math.max( min, Math.min( value, max ));
}import { ErrorMiddleware } from "../types";
import { NODE_ENV } from "../types";
import { Logger } from "log4js";
import { ResponseErrorCode } from "../code";

const RunningInDev = process.env.NODE_ENV === NODE_ENV.dev;

/**
 * 错误记录中间件
 * @param error
 * @param request
 * @param response
 * @param next
 */
export const SetLogMiddleware = (logger:Logger)=


ct-this:not(.xm-dis-disabled) i {color: #1E9FFF}
div[xm-select-skin=normal].xm-form-selected .xm-select,div[xm-select-skin=normal].xm-form-selected .xm-select:hover {border-color: #1E9FFF!important}
div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span {background-color: #FFB800;color: #FFF;border: 1px solid #FFB800}
div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span i {background-color: #FFB800;color: #FFF}
div[xm-select-skin=warm] dl dd:not(.xm-dis-disabled) i {border-color: #FFB800}
div[xm-select-skin=warm] dl dd.xm-select-this:not(.xm-dis-disabled) i {color: #FFB800}
div[xm-select-skin=warm].xm-form-selected .xm-select,div[xm-select-skin=warm].xm-form-selected .xm-select:hover {border-color: #FFB800!important}
div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span {background-color: #FF5722;color: #FFF;border: 1px solid #FF5722}
div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span i {background-color: #FF5722;color: #FFF}
div[xm-select-skin=danger] dl dd:not(.xm-dis-disabled) i {border-color: #FF5722}
div[xm-select-skin=danger] dl dd.xm-select-this:not(.xm-dis-disabled) i {color: #FF5722}
div[xm-select-skin=danger].xm-form-selected .xm-select,div[xm-select-skin=danger].xm-form-selected .xm-select:hover {border-color: #FF5722!important}

/* 多选联动  */
.xm-select-parent .layui-form-danger+.xm-select-title .xm-select {border-color: #FF5722 !important;}
.xm-select-linkage li {padding: 10px 0px;cursor: pointer;}
.xm-select-linkage li span {padding-left: 20px;padding-right: 30px;display: inline-block;height: 20px;overflow: hidden;text-overflow: ellipsis;}
.xm-select-linkage li.xm-select-this span {border-left: 5px solid #009688;color: #009688;padding-left: 15px;}
.xm-select-linkage-group {position: absolute;left: 0;top: 0;right: 0;bottom: 0;overflow-x: hidden;overflow-y: auto;}
.xm-select-linkage-group li:hover {border-left: 1px solid #009688;}
.xm-select-linkage-group li:hover span {padding-left: 19px;}
.xm-select-linkage-group li.xm-select-this:hover span {padding-left: 15px;border-left-width: 4px;}
.xm-select-linkage-group:nth-child(4n+1){background-color: #EFEFEF; left: 0;}
.xm-select-linkage-group:nth-child(4n+1) li.xm-select-active{background-color: #F5F5F5;}
.xm-select-linkage-group:nth-child(4n+2){background-color: #F5F5F5; left: 100px;}
.xm-select-linkage-group:nth-child(4n+3) li.xm-select-active{background-color:


            game.setReviews(existingReviews);

            // Save the updated game document
            gameRepository.save(game);
            return existingReviews;

        } catch (Exception e) {
            System.out.println(e.getMessage());
            return null;
        }
    }

    @Override
    public List<Review> updateGameEmbeddedReview(Game game){
        List<Review> reviews=game.getReviews();
        // Sort the list of reviews based on the likeCount field in descending order
        Collections.sort(reviews, Comparator.comparingInt(Review::getLikeCount).reversed());
        game.setReviews(reviews);
        gameRepository.save(game);
        return reviews;
    }

    @Override
    public ResponseEntity<String> createGame(GameDTO gameDTO) {
        // converto il dto in model entity
        ModelMapper modelMapper = new ModelMapper();
        Game game = modelMapper.map(gameDTO, Game.class);
        // inserisco il model nel db
        try {
            // controllo se esiste un gioco con lo stesso nome
            List<Game> existGame = gameRepository.findByName(game.getName());
            if(!existGame.isEmpty()) {
                return new ResponseEntity<>("there is already a game with the same name", HttpStatus.CONFLICT);
            }
            Game saved = gameRepository.save(game);
            // mappare model in dto
            GameDTO gameInserted = modelMapper.map(saved, GameDTO.class);
            return new ResponseEntity<>(gameInserted.getId(), HttpStatus.CREATED);
        } catch (Exception e) {
            System.out.println("Error in game creation: " + e.getMessage());
            return new ResponseEntity<>("Error in game creation: " + e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    public long countGameDocument() {
        try {
            return gameRepository.count();
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return -1;
        }
    }

    @Override
    public ResponseEntity<String> deleteGame(String id) {
        try {
            Optional<Game> game= gameRepository.findById(id);
            if(!game.isPresent()){
                return new ResponseEntity<>("game not deleted", HttpStatus.NOT_FOUND);
            }
            gameRepository.deleteById(id);
            return new ResponseEntity<>("game deleted", HttpStatus.OK);
        } catch (Exception e) {
            return new ResponseEntity<>("deletion error: " + e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);

        }
    }
}

//package com.plate.quartz.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
//import javax.sql.DataSource;
//import java.util.Properties;
//
///**
// * 定时任务配置（单机部署建议删除此类和qrtz数据库表，默认走内存会最高效）
// *
// * @author ruoyi
// */
//@Configuration
//public class ScheduleConfig
//{
//    @Bean
//    public SchedulerFactoryBean schedulerFactoryBean(


		if(data.isEmpty()) {
			LOG.warn("empty chart");
			return;
			}
		pw.print("pie(");
		vectorR(pw,data.stream().map(D->D.getPieValue()).iterator());
		pw.print(",col="+colors(data.size()));
		pw.print(",labels=");
		vectorR(pw,data.stream().map(D->D.getName()).map(quoteR).iterator());
		title(pw,chart);
		pw.println(")");
		}

	private void exportScatterNNToR(
			final PrintWriter pw,
			final XYChart<Number, Number> chart)
		{
		final List<XYChart.Series<Number,Number>> series = chart.getData().stream().
				filter(P->!P.getData().isEmpty()).
				collect(Collectors.toList());
		if(series.isEmpty()) {
			LOG.warn("empty chart");
			return;
			}
		par(pw,chart.getXAxis());
		int serie_index=0;
		final char type=(chart instanceof ScatterChart?'p':'o');
		while(serie_index < series.size())
			{
			if(serie_index>0) {
				pw.println("par(new=TRUE)");
				}

			pw.print("plot(matrix(");
			vectorR(pw,series.get(serie_index).getData().
					stream().
					map(D->String.valueOf(D.getXValue())+","+String.valueOf(D.getYValue())).
					iterator()
					);
			pw.print(",ncol=2,byrow=TRUE)");
			if(serie_index>0) {
				pw.print(",axes=FALSE");
				}
			lim(pw,'x',NumberAxis.class.cast(chart.getXAxis()),chart,D->D.getY());
			lim(pw,'y',NumberAxis.class.cast(chart.getYAxis()),chart,D->D.getY());
			pw.print(",pch="+serie_index);
			pw.print(",type=\""+type+"\"");
			lab(pw,'x',chart.getXAxis());
			lab(pw,'y',chart.getYAxis());
			if(serie_index==0)
				{
				title(pw,chart);
				}
			if(series.size()>1) {
				pw.print(",col="+colors(series.size()));
				}
			pw.println(")");

			serie_index++;
			}
		if(series.size()>1) {
			pw.print("legend(\"topright\",legend=");
			vectorR(pw,series.stream().map(T->T.getName()).map(quoteR).iterator());
			pw.print(",pch=");
			vectorR(pw,IntStream.range(0, series.size()).mapToObj(T->Integer.toString(T)).iterator());
			pw.println(")");
			}

		pw.flush();
		}

	private void exportBarChartSNToR(
			final PrintWriter pw,
			final XYChart<String, Number> chart

			) {
		final boolean stacked = chart instanceof StackedBarChart;
		final List<XYChart.Series<String,Number>> series = chart.getData();
		if(series.isEmpty()) {
			LOG.warn("empty chart");
			return;
		}
		par(pw,chart.getXAxis());
		pw.print("barplot(matrix(");

		vectorR(pw,series.stream().
				flatMap(S->S.getData().stream()).
				map(D->D.getYValue()).
				iterator()
				);
		pw.print(",ncol=");
		pw.print(series.get(0).getData().size());
		pw.print(",byrow=TRUE)");
		if(chart.getXAxis() instanceof CategoryAxis)
			{
			final CategoryAxis cataxis = CategoryAxis.class.cast(chart.getXAxis());
			pw.print(",names.arg=");
			vectorR(pw,cataxis.getCategories().stream().map(quoteR).iterator());
			}
		if(series.size()>1) {
			pw.print(",legend=");
			vectorR(pw,series.stream().map(T->T.getName()).map(


st == nil or dest == map.uid then
            Gui.mes("common.nothing_happens")
            return
         end

         if ElonaQuest.is_non_returnable_quest_active() then
            Gui.mes("magic.return.you_commit_a_crime")
            Effect.modify_karma(chara, -10)
         end

         local blocked = Event.trigger("elona.before_cast_return", {}, false)
         if blocked then
            return
         end

         local params = {
            start_x = s.return_destination_map_x or nil,
            start_y = s.return_destination_map_y or nil
         }

         Gui.play_sound("base.teleport1")
         Gui.mes("magic.return.door_opens")
         Gui.update_screen()
         Input.query_more()
         local map_uid = s.return_destination_map_uid
         s.return_destination_map_uid = nil
         s.return_destination_map_x = nil
         s.return_destination_map_y = nil

         local _, new_map = assert(Map.load(map_uid))
         Map.travel_to(new_map, params)
      end
   end
   -- <<<<<<<< shade2/main.hsp:732 			} ..
end

Event.register("base.before_chara_turn_start", "Proc return event", proc_return, { priority = 50000 })

local function calc_wand_success(chara, params)
   -- >>>>>>>> shade2/proc.hsp:1511 	if (efId>=headSpell)&(efId<tailSpell){ ..
   local skill_data = Magic.skills_for_magic(params.magic_id)[1] or nil

   local item = params.item

   if not chara:is_player() or item:calc_aspect(IItemRod, "is_zap_always_successful") then
      return true
   end

   local magic_device = chara:skill_level("elona.magic_device")

   local success
   if skill_data and skill_data.type == "spell" then
      success = false

      local skill = magic_device * 20 + 100
      if item:calc("curse_state") == Enum.CurseState.Blessed then
         skill = skill * 125 / 100
      end
      if Effect.is_cursed(item:calc("curse_state")) then
         skill = skill * 50 / 100
      elseif Rand.one_in(2) then
         success = true
      end
      if Rand.rnd(skill_data.difficulty + 1) / 2 <= skill then
         success = true
      end
   else
      success = true
   end

   if Rand.one_in(30) then
      success = false
   end

   return success
   -- <<<<<<<< shade2/proc.hsp:1521 	if rnd(30)=0:f=false ..
end
Event.register("elona.calc_wand_success", "Default", calc_wand_success)


      Roboto,
      Inter,
      "Apple Color Emoji",
      "Segoe UI Emoji",
      "Segoe UI Symbol",
      sans-serif;
    font-weight: 400;
    outline: rgb(236, 239, 244) none 0px;
    text-decoration: none solid rgb(236, 239, 244);
    text-decoration-color: rgb(236, 239, 244);
    text-decoration-line: none;
    text-decoration-style: solid;
    text-decoration-thickness: auto;
    transition: all;
    user-select: text;
  }

  a.internal {
    background-color: rgba(0, 0, 0, 0);
    color: rgb(0, 153, 153);
    cursor: pointer;
    filter: none;
    font-family:
      ui-sans-serif,
      -apple-system,
      "system-ui",
      system-ui,
      "Segoe UI",
      Roboto,
      Inter,
      "Apple Color Emoji",
      "Segoe UI Emoji",
      "Segoe UI Symbol",
      sans-serif;
    font-weight: 400;
    outline: rgb(0, 153, 153) none 0px;
    text-decoration: none solid rgba(0, 153, 153, 0.3);
    text-decoration-color: rgba(0, 153, 153, 0.3);
    text-decoration-line: none;
    text-decoration-style: solid;
    text-decoration-thickness: auto;
    transition: opacity 0.14s ease-in-out;
    user-select: text;
  }

  a.internal.tag-link,
  .search
    > .search-container
    > .search-space
    > .search-layout
    > .results-container
    .result-card
    > ul
    > li
    > .match-tag {
    align-items: center;
    background-color: rgb(36, 36, 36);
    border-bottom-color: rgba(0, 153, 153, 0.15);
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
    border-bottom-style: solid;
    border-left-color: rgba(0, 153, 153, 0.15);
    border-left-style: solid;
    border-right-color: rgba(0, 153, 153, 0.15);
    border-right-style: solid;
    border-top-color: rgba(0, 153, 153, 0.15);
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    border-top-style: solid;
    display: flex;
    font-family:
      ui-sans-serif,
      -apple-system,
      "system-ui",
      system-ui,
      "Segoe UI",
      Roboto,
      Inter,
      "Apple Color Emoji",
      "Segoe UI Emoji",
      "Segoe UI Symbol",
      sans-serif;
    font-weight: 400;
    margin-inline-start: 0px;
  }

  a.internal.tag-link::before {
    color: rgb(143, 188, 187);
  }

  blockquote {
    background-color: rgba(0, 0, 0, 0);
    border-inline-start: 2px solid rgb(0, 153, 153);
    font-family:
      ui-sans-serif,
      -apple-system,
      "system-ui",
      system-ui,
      "Segoe UI",
      Roboto,
      Inter,
      "Apple Color Emoji",
      "Segoe UI Emoji",
      "Segoe UI Symbol",
      sans-serif;
    font-style: normal;
    margin-inline-end: 0px;
    margin-inline-start: 0px;
    padding-bottom: 0px;
    padding-inline-start: 24px;


t(-3.199F, -36.25F, -38.5F);
        G19rockslide.addChild(slide24_r3);
        setRotationAngle(slide24_r3, 0.0F, 0.0F, -1.1694F);
        slide24_r3.cubeList.add(new ModelBox(slide24_r3, 87, 118, -0.001F, -0.001F, 10.001F, 2, 1, 2, 0.0F, false));
        slide24_r3.cubeList.add(new ModelBox(slide24_r3, 8, 119, -0.001F, 0.0F, 11.5F, 2, 1, 2, 0.0F, false));
        slide24_r3.cubeList.add(new ModelBox(slide24_r3, 40, 136, -0.001F, 0.0F, 15.0F, 2, 1, 1, 0.0F, false));
        slide24_r3.cubeList.add(new ModelBox(slide24_r3, 46, 136, -0.001F, 0.0F, 17.5F, 2, 1, 1, 0.0F, false));
        slide24_r3.cubeList.add(new ModelBox(slide24_r3, 132, 78, -0.001F, 0.0F, 20.0F, 2, 1, 3, -0.001F, false));

        slide17_r4 = new ModelRenderer(this);
        slide17_r4.setRotationPoint(1.2F, -37.501F, -10.5F);
        G19rockslide.addChild(slide17_r4);
        setRotationAngle(slide17_r4, -1.309F, -0.2094F, 0.6632F);
        slide17_r4.cubeList.add(new ModelBox(slide17_r4, 0, 15, -1.001F, 0.0F, 0.0F, 1, 4, 2, 0.0F, false));

        slide16_r5 = new ModelRenderer(this);
        slide16_r5.setRotationPoint(1.2F, -37.501F, -10.5F);
        G19rockslide.addChild(slide16_r5);
        setRotationAngle(slide16_r5, -1.2392F, 0.0F, 0.0F);
        slide16_r5.cubeList.add(new ModelBox(slide16_r5, 8, 15, -1.001F, 0.0F, 0.0F, 1, 4, 2, 0.0F, false));

        slide19_r4 = new ModelRenderer(this);
        slide19_r4.setRotationPoint(0.4F, -38.1F, -23.5F);
        G19rockslide.addChild(slide19_r4);
        setRotationAngle(slide19_r4, 0.0F, 0.9076F, 0.0F);
        slide19_r4.cubeList.add(new ModelBox(slide19_r4, 58, 66, -1.0F, 0.0F, -2.0F, 1, 1, 2, 0.0F, false));

        slide18_r2 = new ModelRenderer(this);
        slide18_r2.setRotationPoint(0.4F, -38.1F, -21.0F);
        G19rockslide.addChild(slide18_r2);
        setRotationAngle(slide18_r2, 0.0F, 0.9076F, 0.0F);
        slide18_r2.cubeList.add(new ModelBox(slide18_r2, 24, 71, -1.0F, 0.0F, -2.0F, 1, 1, 2, 0.0F, false));

        slide20_r3 = new ModelRenderer(this);
        slide20_r3.setRotationPoint(-2.4F, -38.1F, -23.5F);
        G19rockslide.addChild(slide20_r3);
        setRotationAngle


>Integer vitae mi sed est rutrum feugiat. Ut bibendum sagittis dictum. Donec dictum pellentesque ipsum quis
        maximus. Fusce porttitor, arcu nec convallis rutrum, lectus justo auctor enim, vitae condimentum quam leo eu ante.
        Mauris nec augue in orci posuere imperdiet. Nam vel aliquet nisl. Vivamus iaculis ultrices nisl vitae ultrices.
        Aenean ac risus a tortor gravida dictum malesuada nec erat. Fusce sodales pharetra facilisis. Nunc viverra, eros
        quis imperdiet dapibus, mauris nunc venenatis lorem, ut pharetra magna lorem in mi.

Vivamus malesuada fermentum urna, sit amet luctus urna ultrices id. In consequat orci a enim congue, et
        pellentesque mi ultrices. Pellentesque cursus sapien arcu, consectetur faucibus massa sollicitudin sed. Vivamus
        porttitor vehicula leo, id volutpat velit posuere vel. Pellentesque diam dui, faucibus quis mollis eget, consequat
        et est. Nullam vel tellus massa. Suspendisse in lorem ac lorem varius euismod. Cras consectetur suscipit tellus
        rutrum condimentum. Etiam in erat laoreet, congue nisi maximus, tristique lacus. Quisque et lorem ex.

Subscribe

        <form action-xhr="./" method="post">
          <input type="text" name="firstname" placeholder="First name" aria-label="First name" required>
          <input type="email" name="email" placeholder="Email address" aria-label="Email address" required>
          <fieldset>

              <input type="checkbox" role="switch" id="terms" name="terms">
              I agree to the Privacy Policy

          </fieldset>
          <button type="submit">Subscribe</button>
        </form>

For this example, we have compiled a custom and classless version of pico (Source code here).

      Built with Pico • Source code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>G</title>
<link rel="stylesheet" href="doc.css" type="text/css">

G

(gc ['cnt [cnt2]]) -> cnt | NIL

Forces a garbage collection. When cnt is given, so many
megabytes of free cells are reserved, increasing the heap size if necessary. If
cnt is zero, all currently unused heap blocks are purged,
decreasing


          delete [] D[sIndx];
                        delete [] CI[sIndx];
                        delete [] CD[sIndx];
                    }
                }
                return;
            }

            if (U[k%3]-L[k%3]+1 > fLen) { // Limit the size of the anti-diagonal
                // fprintf(stderr, "ERROR: anti-diagonal larger than the max limit!\n");
                last_tile = true;
                errorType = 2;
                aln.clear();
                for (size_t sIndx=0; sIndx<3; sIndx++) {
                    delete [] S[sIndx];
                    delete [] CS[sIndx];
                    if (sIndx < 2) {
                        delete [] I[sIndx];
                        delete [] D[sIndx];
                        delete [] CI[sIndx];
                        delete [] CD[sIndx];
                    }
                }
                return;
            }

            if (k <= marker) {
                ftr_length.push_back(U[k%3] - L[k%3] + 1);
                ftr_lower_limit.push_back(L[k%3]);
                ftr_addr += U[k%3] - L[k%3] + 1;
            }

            for (int32_t i = L[k%3]; i < U[k%3]+1; i++) { // i-> query_idx, j -> reference_idx
                int32_t Lprime = std::max(0, static_cast<int32_t>(k)-static_cast<int32_t>(reference_length) + 1);
                int32_t j = std::min(static_cast<int32_t>(k), static_cast<int32_t>(reference_length - 1)) - (i-Lprime);

                if (j < 0) {
                    fprintf(stderr, "ERROR: j less than 0.\n");
                    exit(1);
                }

                int32_t match = -inf, insOp = -inf, delOp = -inf, insExt = -inf, delExt = -inf;
                int32_t offset = i-L[k%3];
                int32_t offsetDiag = L[k%3]-L[(k+1)%3]+offset-1; // L[0] - L[1] + 0 - 1
                int32_t offsetUp = L[k%3]-L[(k+2)%3]+offset;
                int32_t offsetLeft = L[k%3]-L[(k+2)%3]+offset-1;

                if ((k==0) ||
                    ((offsetDiag >= 0) && (offsetDiag <= U[(k+1)%3]-L[(k+1)%3])) ||
                    (tile == 0 && (i == 0 || j == 0 ))) {
                    int32_t similarScore = 0;
                    float numerator = 0;
                    if (type == 0) {
                        for (int l = 0; l < 6; ++l) {
                            for (int m = 0; m < 6; ++m) {
                                if (m == 5 && l == 5)      numerator += 0;
                                else if (m == 5 || l == 5) numerator += reference[reference_idx+j][l]*query[query_idx+i][m]*gapExtend;
                                else                       numerator += reference[reference_idx+j][l]*query[query_idx+i][m]*param->scoreMatrix[m][l];
                            }
                        }
                    }
                    else {
                        for (int l = 0; l < 22; ++l) {
                            for (int m = 0; m < 22; ++m) {
                                if (m == 21 && l == 21)      numerator += 0;
                                else if (m == 21 ||


ex.Lock()         // 互斥锁锁定
	defer mutex.Unlock() // 延迟函数退出时解锁
	// 内部实现 : Ignore
	if true {
		log.Println(resultMessage)
		return
	}
	fmt.Println(resultMessage)
}
```
程序中使用了 mutex.Lock() 和 mutex.Unlock() 来创建共享资源的同步锁。为了管理多个日志，每次都要创建一个 Goroutine 并将它们添加到 sync.WaitGroup，这是一个重要的同步原语，允许协作的 Goroutine 在再次独立进行之前共同等待阈值事件。

在上面的例子中，这种方法更好更快！ 我们减少了不必要的开销。 但是如果您发现 sync.Mutex 锁定规则过于复杂，扪心自问使用通道是否真的更简单。

查看我的软件包的源代码，了解我实际上是如何使用 Mutex 以实现同步：

https://github.com/MindorksOpenSource/Go-Log

### 附加资源

- [Closing]
https://www.acloudtree.com/understanding-when-to-use-channels-or-mutexes-in-go/
- [MutexOrChannel]
https://github.com/golang/go/wiki/MutexOrChannel

### 联系我

- Twitter: https://twitter.com/DuaYashish
- MentorCruise: https://mentorcruise.com/mentor/YashishDua/

---

via: https://medium.com/mindorks/https-medium-com-yashishdua-synchronizing-states-using-mutex-vs-channel-in-go-25e646c83567

作者：[Yashish Dua](https://medium.com/@yashishdua)
译者：[weiwg521](https://github.com/weiwg521)
校对：[polaris1119](https://github.com/polaris1119)

本文由 [GCTT](https://github.com/studygolang/GCTT) 原创编译，[Go 中文网](https://studygolang.com/) 荣誉推出
已发布：https://studygolang.com/articles/12815

# Golang 数据库 mocks（Golang database mocks）

我们[当前项目的核心](https://heupr.io/)是一个 [MemSQL](https://www.memsql.com/) 数据库，它是我们核心的数据管道；这是一个非常酷的技术，它的速度非常快，我们实在是太喜欢它了。但是，测试跟它相关的代码却有点困难，这个问题通过试验或者当遇到错误（主要是遇到错误）时，很快就可以发现。由于 Go 标准包已通过全面的测试，我只需要确保调用和依赖他们的代码在生产中也能够正常运行就好。

测试我们项目的数据库代码，我通过两个步骤完成。

通过 database/sql 包，我们有了 sql.DB 结构，它代表一系列 mocks 的连接，以及包含一系列与这些连接


      .replaceAll('-', ' ')
      .replaceAll(RegExp(r'[^\w\s]', caseSensitive: false), '')
      .toLowerCase()
      .replaceAll(' ', '-');
  cleaned = cleaned.replaceAll(RegExp(r'-{2,}'), '-');
  cleaned = cleaned.replaceAll(RegExp(r'^-+'), '');
  cleaned = cleaned.replaceAll(RegExp(r'-+$'), '');
  return cleaned;
}

String? getScheme(String url) {
  final match = RegExp(r'([a-z0-9+.-]+):', caseSensitive: false).firstMatch(url);
  return match?.group(1);
}

String getYouTubeVideoId(String? link) {
  if (link == null) {
    return '';
  }

  // https://youtube.com/watch?v=<id>
  var match = RegExp(r'youtube\.com\/watch\?\S*\bv=([a-zA-Z0-9_-]{6,11})').firstMatch(link);
  if (match != null) {
    return match.group(1) ?? '';
  }

  // https://youtube.com/embed/<id>
  match = RegExp(r'youtube\.com\/embed\/([a-zA-Z0-9_-]{6,11})').firstMatch(link);
  if (match != null) {
    return match.group(1) ?? '';
  }

  // https://youtu.be/<id>
  match = RegExp(r'youtu.be\/([a-zA-Z0-9_-]{6,11})').firstMatch(link);
  if (match != null) {
    return match.group(1) ?? '';
  }

  return '';
}

Future<void> tryOpenURL(String url, {Function? onError, Function? onSuccess}) async {
  if (await canLaunch(url)) {
    await launch(url).then((_) => onSuccess?.call()).catchError(onError);
  } else {
    onError?.call('Could not launch $url');
  }
}

String cleanUrlForLogging(String baseUrl, String apiUrl) {
  var url = apiUrl;

  // Trim the host name
  url = url.substring(baseUrl.length);

  // Filter the query string
  final index = url.indexOf('?');
  if (index != -1) {
    url = url.substring(0, index);
  }

  // A non-exhaustive whitelist to exclude parts of the URL that are unimportant (eg IDs) or may be sensitive
  final whitelist = {
    'api',
    'v4',
    'users',
    'teams',
    'scheme',
    'name',
    'members',
    'channels',
    'posts',
    'reactions',
    'commands',
    'files',
    'preferences',
    'hooks',
    'incoming',
    'outgoing',
    'oauth',
    'apps',
    'emoji',
    'brand',
    'image',
    'data_retention',
    'jobs',
    'plugins',
    'roles',
    'system',
    'timezones',
    'schemes',
    'redirect_location',
    'patch',
    'mfa',
    'password',
    'reset',
    'send',
    'active',
    'verify',
    'terms_of_service',
    'login',
    'logout',
    'ids',
    'usernames',
    'me',
    'username',
    'email',
    'default',
    'sessions',
    'revoke',
    'all',
    'device',
    'status',
    'search',
    'switch',
    'authorized',
    'authorize',
    'deauthorize',
    'tokens',
    'disable',
    'enable',
    'exists',
    'unread',
    'invite',
    'batch