198] = {17, 2}, [199] = {11, 14}, [200] = {7, 7}, [201] = {14, 14},
        [202] = {14, 14}, [203] = {0, 14}, [204] = {6, 6}, [205] = {6, 8}, [206] = {0, 0},
        [207] = {4, 2}, [208] = {8, 4}, [209] = {0, 0}, [210] = {0, 0}, [211] = {11, 3},
        [212] = {6, 8}, [213] = {6, 5}, [214] = {1, 6}, [215] = {17, 15}, [216] = {0, 0},
        [217] = {0, 0}, [218] = {10, 10}, [219] = {10, 5}, [220] = {15, 4}, [221] = {15, 4},
        [222] = {11, 5}, [223] = {11, 11}, [224] = {11, 11}, [225] = {15, 2}, [226] = {11, 2},
        [227] = {8, 2}, [228] = {17, 10}, [229] = {17, 10}, [230] = {11, 16}, [231] = {4, 4},
        [232] = {4, 4}, [233] = {0, 0}, [234] = {0, 0}, [235] = {0, 0}, [236] = {1, 1},
        [237] = {1, 1}, [238] = {15, 14}, [239] = {13, 13}, [240] = {10, 10}, [241] = {0, 0},
        [242] = {0, 0}, [243] = {13, 13}, [244] = {10, 10}, [245] = {11, 11}, [246] = {5, 4},
        [247] = {5, 4}, [248] = {5, 17}, [249] = {14, 2}, [250] = {10, 2}, [251] = {14, 12}
    }

    local types = speciesTypes[speciesId]
    if types then
        return types[1], types[2]
    else
        return 0, 0 -- Default to Normal/Normal
    end
end

return Gen2PartyReader


 await SharedPreferences.getInstance();
    return prefs.getDouble(key) ?? 0.0;
  }

  Future<void> setStringValue(String key, String value) async {
    final SharedPreferences prefs = await SharedPreferences.getInstance();
    prefs.setString(key, value);
  }

  Future<String> getStringValue(String key) async {
    final SharedPreferences prefs = await SharedPreferences.getInstance();
    return prefs.getString(key) ?? "";
  }

  Future<void> setBoolValue(String key, bool value) async {
    final SharedPreferences prefs = await SharedPreferences.getInstance();
    prefs.setBool(key, value);
  }

  Future<bool> getBoolValue(String key) async {
    final SharedPreferences prefs = await SharedPreferences.getInstance();
    return prefs.getBool(key) ?? false;
  }

  Future<void> clearAllPreferences() async {
    final SharedPreferences prefs = await SharedPreferences.getInstance();
    await prefs.clear();
  }
}

// Example usage
// DataHandler.setDoubleValue("doubleValue", 3.14);
// double retrievedDouble = await DataHandler.getDoubleValue("doubleValue");
// print("Retrieved double: $retrievedDouble");
//
import 'dart:developer';
import 'dart:io';

import 'cmd_help.dart';
import 'interactive_terminal.dart';
import 'logger.dart';
import 'batch_operations.dart';

String? _cachedFlutterPath;

Future<String?> getFlutterPath() async {
  if (_cachedFlutterPath != null) return _cachedFlutterPath;

  // Use platform-specific command to find Flutter
  List<String> probe;
  if (Platform.isWindows) {
    probe = ['where', 'flutter'];
  } else if (Platform.isMacOS || Platform.isLinux) {
    probe = ['which', 'flutter'];
  } else {
    logger.error('❌ Unsupported platform: ${Platform.operatingSystem}');
    exit(1);
  }
  try {
    final result = await Process.run(probe.first, probe.sublist(1));
    if (result.exitCode == 0) {
      final path = result.stdout
          .toString()
          .split(RegExp(r'\r?\n'))
          .first
          .trim();
      _cachedFlutterPath = path;
      return path;
    }
  } catch (_) {}
  return null;
}

Future<void> handleCommand(List<String> args) async {
  if (args.isEmpty) {
    logger.warn('🚨 No command provided. Try: fc, fb apk, fb win, fa <pkg>, fo, fo win');
    exit(64);
  }
  if (args[0] == 'flutter' || args[0] == 'git') {
    logger.info('💡 Tip: You can also use shorthand. Example:');
    logger.info('   f fb apk   // instead of: flutter build apk');
  }

  final flutter = await getFlutterPath();
  if (flutter == null) {
    logger.error('❌ Flutter not found in system PATH.');
    exit(1);
  }

  final cmd = args[0];

  if (cmd == '-h' || cmd == '--help') {
  printUsage();
  exit(0);
}
    final helpSuffix = RegExp(r'-h$|--help$');
  if (helpSuffix.hasMatch(cmd)) {
    final baseCmd = cmd.replaceAll(helpSuffix, '');
    final desc = commandHelp[baseCmd] ?? 'No detailed help available for this command.';
    logger.info('\n$desc');
    exit(0);
  }

  switch (cmd) {
    case 'fc':
      await _run([flutter, 'clean']);
      break;


多条记录模式
func (s *sPageCategoryNav) Remove(ctx context.Context, id any) (affected int64, err error) {

	affected, err = dao.PageCategoryNav.Remove(ctx, id)

	if err != nil {
		return 0, err
	}

	return affected, err
}

// PcLayout PC头尾数据
func (s *sPageCategoryNav) GetPcLayout(ctx context.Context) (resultSlice []interface{}, err error) {
	userId := service.BizCtx().GetUserId(ctx)

	// 读取页面分类导航
	pageCategoryNavs, err := dao.PageCategoryNav.Find(ctx, &do.PageCategoryNavListInput{
		Where: do.PageCategoryNav{CategoryNavEnable: true},
		BaseList: ml.BaseList{
			Sort: ml.ORDER_BY_ASC,
			Sidx: dao.PageCategoryNav.Columns().CategoryNavOrder,
		},
	})
	if err != nil {
		return nil, err
	}

	// 无用数据较多，可以独立封装一个数据，只传必须数据
	productCategoryListReq := &do.ProductCategoryListInput{
		Where: do.ProductCategory{
			CategoryIsEnable: true,
		},
	}
	// 获取树状分类
	categoryRes, err := service.ProductCategory().GetTree(ctx, productCategoryListReq, 0)
	if err != nil {
		return nil, err
	}

	// 读取所有商品信息
	itemIds := make([]uint64, 0)
	for _, item := range pageCategoryNavs {
		// 处理商品信息
		if item.CategoryNavType == 2 {
			itemIds = append(itemIds, gconv.SliceUint64(item.ItemIds)...)
		}
	}

	var items []*model.ProductItemVo
	if len(itemIds) > 0 {
		items, err = service.ProductBase().GetItems(ctx, itemIds, userId)
		if err != nil {
			return nil, err
		}
	}

	for i := range pageCategoryNavs {
		item := pageCategoryNavs[i]
		input := &model.PageCategoryNavVo{}
		gconv.Scan(item, input)

		// 处理分类编号
		if input.CategoryNavType == 1 {
			categoryId := gconv.Uint(input.CategoryIds)
			if categoryId != 0 {
				for _, category := range categoryRes {
					if category.CategoryId == categoryId {
						input.ProductCategoryTree = category
						break
					}
				}
			}
		}

		// 处理商品信息
		if input.CategoryNavType == 2 {
			var productItemVoList []*model.ProductItemVo
			itemIdList := gconv.SliceUint64(gstr.Split(input.ItemIds, ","))
			for _, itemId := range itemIdList {
				for _, productItem := range items {
					if productItem.ItemId == itemId {
						productItemVoList = append(productItemVoList, productItem)
						break
					}
				}
			}
			input.ProductItems = productItemVoList
		}
		resultSlice = append(resultSlice, input)
	}

	return resultSlice, nil
}
// +-------------------------------------------


1
        vrshrn.s32      d0,  q1,  #10   @ (dc * 13 * 13 + 0x200) >> 10
        vmov            d1,  d0
        vaddw.u8        q2,  q0,  d28
        vaddw.u8        q3,  q0,  d29
        vqmovun.s16     d28, q2
        vqmovun.s16     d29, q3
        vst1.32         {d28[0]}, [r3,:32], r1
        vst1.32         {d29[0]}, [r3,:32], r1
        vst1.32         {d28[1]}, [r3,:32], r1
        vst1.32         {d29[1]}, [r3,:32], r1
        bx              lr
endfunc

/* void rv34_inv_transform_dc_noround_c(int16_t *block) */
function ff_rv34_inv_transform_noround_dc_neon, export=1
        vld1.16         {d28[]}, [r0,:16]       @ block[0]
        vmov.i16        d4,  #251
        vorr.s16        d4,  #256               @ 13^2 * 3
        vmull.s16       q3,  d28, d4
        vshrn.s32       d0,  q3,  #11
        vmov.i16        d1,  d0
        vst1.64         {q0}, [r0,:128]!
        vst1.64         {q0}, [r0,:128]!
        bx              lr
endfunc


(new TreeNode(21, "Item_2_1", false));

var item_3: Resnyanskiy.TreeNode = new TreeNode(3, "Item_3", true);

var tree = new Resnyanskiy.Tree(document.getElementById("tree"), [item_1, item_2, item_3]);
tree.onNodeClick = onNodeClickHandler;
tree.onBranchExpand = onBranchExpandHandler;

// this - Tree
function onNodeClickHandler(id: number) {
  document.getElementById("content").innerHTML = "Click on Node: " + id;
}

// this - Tree
function onBranchExpandHandler(id: number) {
  var tree = this;

  setTimeout(function() {
    var XHR: XMLHttpRequest = new XMLHttpRequest();
    XHR.open("GET", "data.json", true);
    XHR.onreadystatechange = function(ev: Event) {
      if(this.readyState == 4) {
        var data: Resnyanskiy.ITreeNodeDataModel[] = (<Resnyanskiy.ITreeNodeDataModel[]>JSON.parse(this.responseText));
        var items: Resnyanskiy.TreeNodeCollection = <Resnyanskiy.TreeNodeCollection>{};
        for(var i in data) {
          var currentItem: Resnyanskiy.ITreeNodeDataModel = data[i];
          items["+" + currentItem.id] = new TreeNode(currentItem.id, currentItem.title, currentItem.isBranch);
        }
        tree.updateNode(id, items, true);
      }
    };
    XHR.send(null);
  }, 5000);
}import { makeObservable, observable, action, computed } from "mobx"
import {Dispatcher} from '../../../Dispatcher'

interface IlistViewType {
    key : number,
    value : string,
    checked : boolean
}

class SelectedMeals{

    meals : string[];
    allMeals : string[];

    constructor(){
        makeObservable(this, {
            meals: observable,
            allMeals: observable,
            delete: action,
            add: action,
            listView: computed

        })
        this.meals = [];
        this.allMeals = [];
    }

    register(dis : Dispatcher){
        dis.addListener("SelectMeal", (meal : any)=>{
            this.add(meal);
        });
        dis.addListener("UnSelectMeal", (meal : any)=>{
            this.delete(meal.k);
        });
        dis.addListener("MealsLoaded", (all : string[])=>{
            this.allMeals = all;
        });
        dis.addListener("ClearAll", (all : string[])=>{
            this.meals = [];
        });

    }

    delete(index : number){

        let meals = this.meals.splice(0);
        meals.splice(index, 1);
        this.meals = meals;
    }

    add(meal : string){
        let meals = this.meals.splice(0);
        meals.push(meal);
        this.meals = meals;
    }

    get listView(){
        let view :IlistViewType[] = [];
        this.meals.forEach((v, i)=>{
            view.push({key:i, value : v , checked : false})
        })
        return view;
    }

}

export default SelectedMeals;import { Document, model, Schema, SchemaTypeOpts, SchemaTimestampsConfig, ObjectId } from 'mongoose';
import { encryptPasswordSync } from '../utils/auth';

export interface User extends SchemaTimestampsConfig {
    _id?: ObjectId | string;
    username: string;
    password?: string;
    fullName: string;
}

export type UserDocument = User & Document;

const userSchemaObj: Record<keyof Omit<User, '_i


 int*>::value));
      ASSERT_NE(elem, nullptr);
      EXPECT_EQ(*elem, 1);
      {
        auto* bad_elem = absl::get_if<0>(&v);
        EXPECT_TRUE((std::is_same<decltype(bad_elem), int*>::value));
        EXPECT_EQ(bad_elem, nullptr);
      }
      {
        auto* bad_elem = absl::get_if<1>(&v);
        EXPECT_TRUE((std::is_same<decltype(bad_elem), std::string*>::value));
        EXPECT_EQ(bad_elem, nullptr);
      }
      {
        auto* bad_elem = absl::get_if<2>(&v);
        EXPECT_TRUE((std::is_same<decltype(bad_elem), double*>::value));
        EXPECT_EQ(bad_elem, nullptr);
      }
    }

    const Var& const_v = v;
    EXPECT_TRUE(noexcept(absl::get_if<3>(&const_v)));

    {
      auto* elem = absl::get_if<3>(&const_v);
      EXPECT_TRUE((std::is_same<decltype(elem), const int*>::value));
      ASSERT_NE(elem, nullptr);
      EXPECT_EQ(*elem, 1);
      {
        auto* bad_elem = absl::get_if<0>(&const_v);
        EXPECT_TRUE((std::is_same<decltype(bad_elem), const int*>::value));
        EXPECT_EQ(bad_elem, nullptr);
      }
      {
        auto* bad_elem = absl::get_if<1>(&const_v);
        EXPECT_TRUE(
            (std::is_same<decltype(bad_elem), const std::string*>::value));
        EXPECT_EQ(bad_elem, nullptr);
      }
      {
        auto* bad_elem = absl::get_if<2>(&const_v);
        EXPECT_EQ(bad_elem, nullptr);
        EXPECT_TRUE((std::is_same<decltype(bad_elem), const double*>::value));
      }
    }
  }
}

//////////////////////
// [variant.relops] //
//////////////////////

TEST(VariantTest, OperatorEquals) {
  variant<int, std::string> a(1), b(1);
  EXPECT_TRUE(a == b);
  EXPECT_TRUE(b == a);
  EXPECT_FALSE(a != b);
  EXPECT_FALSE(b != a);

  b = "str";
  EXPECT_FALSE(a == b);
  EXPECT_FALSE(b == a);
  EXPECT_TRUE(a != b);
  EXPECT_TRUE(b != a);

  b = 0;
  EXPECT_FALSE(a == b);
  EXPECT_FALSE(b == a);
  EXPECT_TRUE(a != b);
  EXPECT_TRUE(b != a);

  a = b = "foo";
  EXPECT_TRUE(a == b);
  EXPECT_TRUE(b == a);
  EXPECT_FALSE(a != b);
  EXPECT_FALSE(b != a);

  a = "bar";
  EXPECT_FALSE(a == b);
  EXPECT_FALSE(b == a);
  EXPECT_TRUE(a != b);
  EXPECT_TRUE(b != a);
}

TEST(VariantTest, OperatorRelational) {
  variant<int, std::string> a(1), b(1);
  EXPECT_FALSE(a < b);
  EXPECT_FALSE(b < a);
  EXPECT_FALSE(a > b);
  EXPECT_FALSE(b > a);
  EXPECT_TRUE(a <= b);
  EXPECT_TRUE(b <= a);
  EXPECT_TRUE(a >= b);
  EXPECT_TRUE(b >= a);

  b = "str";
  EXPECT_TRUE(a < b);
  EXPECT_FALSE(b < a);


rmod_hamisium" }, quantity = 100 },
	{ probability = 0.25, materials = { "fairmod_propanium" }, quantity = 100 },
	{ probability = 0.25, materials = { "fairmod_tntinium" }, quantity = 200 },
	{ probability = 0.15, materials = { "void_liquid" }, quantity = 600 },
	{ probability = 0.15, materials = { "templebrick_static" }, quantity = 1100 },
	{ probability = 0.15, materials = { "gold" }, quantity = 300 },
	{ probability = 0.05, materials = { "fairmod_giga_slicing_liquid" }, quantity = 400 },
	{ probability = 0.05, materials = { "fairmod_chaotic_pandorium" }, quantity = 10 },

	{ probability = 0.01, materials = { --everything.
        "oil",
        "radioactive_liquid",
        "acid",
        "liquid_fire",
        "gunpowder_unstable",
        "fairmod_deceleratium",
        "fairmod_heftium",
        "fairmod_stillium",
        "fairmod_grease",
        "magic_liquid_unstable_teleportation",
        "fairmod_minecartium",
        "fairmod_hamisium",
        "fairmod_propanium",
        "fairmod_tntinium",
        "void_liquid",
        "templebrick_static",
        "gold",
        "fairmod_giga_slicing_liquid",
        "fairmod_chaotic_pandorium"
    }, quantity = 20 },
}

return materials


="Alert sneak peek GIF!">

**Try it out yourself on the [demo page](https://vishaltelangre.github.io/editorjs-alert/examples/demo.html).**

## Installation

### Install via NPM

Get the package

```sh
npm i --save editorjs-alert
```

Include module at your application

```js
const Header = require('editorjs-alert');

// OR

import Alert from 'editorjs-alert';
```

### Download to your project's source dir

Copy [`dist/bundle.js`](./dist/bundle.js) file to your page.

### Load from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/editorjs-alert).

```html
<script src="https://cdn.jsdelivr.net/npm/editorjs-alert@latest"></script>
```

## Usage

Add a new Tool `Alert` to the `tools` property of the Editor.js initial config.

```js
var editor = EditorJS({
  // ...

  tools: {
    // ...
    alert: Alert,
  },

  // ...
});
```

Or initialize Alert tool with additional optional settings

```js
var editor = EditorJS({
  //...

  tools: {
    //...
    alert: {
      class: Alert,
      inlineToolbar: true,
      shortcut: 'CMD+SHIFT+A',
      config: {
        alertTypes: ['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'],
        defaultType: 'primary',
        messagePlaceholder: 'Enter something',
      },
    },
  },

  //...
});
```

## Config Params

All properties are optional.

| Field                | Type     | Default Value  | Description                                                                                |
| -------------------- | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `alertTypes`         | `array`  | `['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark']` | Alert types that can be used in the editor |
| `defaultType`        | `string` | `info`         | default Alert type (should be either of `primary`, `secondary`, `info`, `success`, `warning`, `danger`, `light` or `dark`) |
| `defaultAlign`     | `string` | `left`         | default Alert alignment (should be either of `left`, `center` or `right`)                                              |
| `messagePlaceholder` | `string` | `Type here...` | placeholder to show in Alert`s message

## Output data

| Field   | Type     | Description                                                                                |
| ------- | -------- | --------------------------------------------------------------------------------------------------------- |
| message | `string` | Alert message                                                                                |
| type    | `string` | Alert type among one of `primary`, `secondary`, `info`, `success`, `warning`, `danger`, `light` or `dark` |
| align   | `string` | Align type should be one of `left`, `center` or `right`                                                   |

```json
{
  "type": "alert",
  "data": {
    "type": "danger",
    "align" : "center",
    "text": "<strong>Holy smokes!</strong><br>Something seriously <em>bad</em> happened."
  }
}
```

## Local Development

- Run `yarn install`.
- Run `yarn dev` to continuously watch for the changes made in `./src/index.js` and updates a development bundle under `./dist` folde


5 0
  LOADN R6 0
  LOADN R7 0
  LOADN R8 0
  NEWCLOSURE R9 P0
  CAPTURE REF R5
  CAPTURE REF R4
  CAPTURE VAL R0
  CAPTURE VAL R3
  NEWCLOSURE R10 P1
  CAPTURE REF R5
  CAPTURE VAL R0
  CAPTURE REF R4
  CAPTURE VAL R3
  CAPTURE UPVAL U2
  CAPTURE UPVAL U3
  NEWCLOSURE R11 P2
  CAPTURE REF R6
  CAPTURE VAL R0
  CAPTURE REF R7
  CAPTURE REF R8
  CAPTURE VAL R2
  CAPTURE VAL R1
  CAPTURE REF R5
  CAPTURE REF R4
  CAPTURE VAL R3
  CAPTURE UPVAL U2
  CAPTURE UPVAL U3
  NEWCLOSURE R12 P3
  CAPTURE VAL R3
  NEWCLOSURE R13 P4
  CAPTURE REF R4
  NEWCLOSURE R14 P5
  CAPTURE REF R7
  NEWCLOSURE R15 P6
  CAPTURE REF R5
  NEWCLOSURE R16 P7
  CAPTURE REF R6
  NEWCLOSURE R17 P8
  CAPTURE REF R8
  DUPTABLE R18 K12 [{"addEntry", "addCustomEntry", "addVisualizationModeEntry", "renderEntries", "hasVisibleEntries", "getEntryCount", "getVisualizationModeEntryCount", "getEntryMatchCount", "getEnabledCount"}]
  SETTABLEKS R10 R18 K3 ["addEntry"]
  SETTABLEKS R9 R18 K4 ["addCustomEntry"]
  SETTABLEKS R11 R18 K5 ["addVisualizationModeEntry"]
  SETTABLEKS R12 R18 K6 ["renderEntries"]
  SETTABLEKS R13 R18 K7 ["hasVisibleEntries"]
  SETTABLEKS R15 R18 K8 ["getEntryCount"]
  SETTABLEKS R16


d: Long): Boolean
	external fun ShowWindow(hwnd: Long, i: Int): Boolean
	external fun GetWindowThreadProcessId(hwnd: Long, intByReference: IntByReference?): Int
	external fun AttachThreadInput(dword: Long, dword1: Long, b: Boolean): Boolean
	external fun EnumWindows(enumProc: WndEnumProc): Boolean
	external fun GetForegroundWindow(): Long

}
/*
 * LeagueOfJire: Free & Open-Source External Scripting Platform
 * Copyright (C) 2021  Thomas G. P. Nappo (Jire)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.leagueofjire.core.game.unit.champion.spell

import com.leagueofjire.game.unit.champion.spell.GameChampionSpells
import it.unimi.dsi.fastutil.objects.Object2ObjectMap
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap

enum class SummonerSpellType(val typeName: String, val api: GameChampionSpells?) {

	NONE("", null),
	GHOST("summonerhaste", GameChampionSpells.GHOST),
	HEAL("summonerheal", GameChampionSpells.HEAL),
	BARRIER("summonerbarrier", GameChampionSpells.BARRIER),
	EXHAUST("summonerexhaust", GameChampionSpells.EXHAUST),
	CLARITY("summonermana", GameChampionSpells.CLARITY),
	SNOWBALL("summonermark", GameChampionSpells.SNOWBALL),
	FLASH("summonerflash", GameChampionSpells.FLASH),
	TELEPORT("summonerteleport", GameChampionSpells.TELEPORT),
	CLEANSE("summonerboost", GameChampionSpells.CLEANSE),
	IGNITE("summonerdot", GameChampionSpells.IGNITE),
	SMITE("summonersmite", GameChampionSpells.SMITE);

	companion object {

		val values = values()

		val typeToSpell: Object2ObjectMap<String, SummonerSpellType> by lazy(LazyThreadSafetyMode.NONE) {
			val map: Object2ObjectMap<String, SummonerSpellType> = Object2ObjectOpenHashMap(values.size)
			for (value in values) map[value.typeName] = value
			map["s5_summonersmiteplayerganker"] = SMITE
			map["s5_summonersmiteduel"] = SMITE
			map
		}

		val apiToType: Object2ObjectMap<GameChampionSpells, SummonerSpellType> by lazy(LazyThreadSafetyMode.NONE) {
			val map: Object2ObjectMap<GameChampionSpells, SummonerSpellType> = Object2ObjectOpenHashMap(GameChampionSpells.values().size)
			for (value in values) map[value.api ?: continue] = value
			map
		}

	}

}/*
 * Free, open-source undetected color cheat for Overwatch!
 * Copyright (C) 2017  Thomas G. Nappo
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * 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 Affero General Public License


rrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::after,.bs-popover-top .arrow::before{border-width:.5rem .5rem 0}.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::before{bottom:0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-top .arrow::after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::after,.bs-popover-right .arrow::before{border-width:.5rem .5rem .5rem 0}.


 EC_R_INVALID_COMPRESSED_POINT);
      }
      goto err;
    }
    if (!BN_usub(y, &group->field, y)) {
      goto err;
    }
  }
  if (y_bit != BN_is_odd(y)) {
    OPENSSL_PUT_ERROR(EC, ec_GFp_simple_set_compressed_coordinates,
                      ERR_R_INTERNAL_ERROR);
    goto err;
  }

  if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx))
    goto err;

  ret = 1;

err:
  BN_CTX_end(ctx);
  if (new_ctx != NULL)
    BN_CTX_free(new_ctx);
  return ret;
}

int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group,
                                            EC_POINT *point, const BIGNUM *x,
                                            int y_bit, BN_CTX *ctx) {
  if (group->meth->point_set_compressed_coordinates == 0 &&
      !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
    OPENSSL_PUT_ERROR(EC, EC_POINT_set_compressed_coordinates_GFp,
                      ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
    return 0;
  }
  if (group->meth != point->meth) {
    OPENSSL_PUT_ERROR(EC, EC_POINT_set_compressed_coordinates_GFp,
                      EC_R_INCOMPATIBLE_OBJECTS);
    return 0;
  }
  if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
    return ec_GFp_simple_set_compressed_coordinates(group, point, x, y_bit,
                                                    ctx);
  }
  return group->meth->point_set_compressed_coordinates(group, point, x, y_bit,
                                                       ctx);
}


ueOutputOp, ThreadblockSwizzle, 2, SplitKSerial, Operator >::Epilogue =  typename cutlass::epilogue::threadblock::DefaultEpilogueTensorOp< ThreadblockShape, typename Mma::Operator, kPartitionsK, EpilogueOutputOp, EpilogueOutputOp::kCount >::Epilogue

template<typename ElementA , typename LayoutA , int kAlignmentA, typename ElementB , typename LayoutB , int kAlignmentB, typename ElementC , typename ElementAccumulator , typename ThreadblockShape , typename WarpShape , typename InstructionShape , typename EpilogueOutputOp , typename ThreadblockSwizzle , bool SplitKSerial, typename Operator >

          using cutlass::gemm::kernel::DefaultGemm< ElementA, LayoutA, kAlignmentA, ElementB, LayoutB, kAlignmentB, ElementC, layout::RowMajor, ElementAccumulator, arch::OpClassTensorOp, arch::Sm75, ThreadblockShape, WarpShape, InstructionShape, EpilogueOutputOp, ThreadblockSwizzle, 2, SplitKSerial, Operator >::GemmKernel =  kernel::Gemm<<a class="el" href="structcutlass_1_1gemm_1_1kernel_1_1DefaultGemm_3_01ElementA_00_01LayoutA_00_01kAlignmentA_00_01E5d78d37a9ae2ec08d7d477d571df036e.html#


rrayList<>();
		Cell[][] grid = Main.game.getWorlds().get(WorldType.ANGELS_KISS_GROUND_FLOOR).getGrid();
		for(int i = 0; i<grid.length; i++) {
			for(int j=0; j<grid[0].length; j++) {
				if(grid[i][j].getPlace().getPlaceType().equals(PlaceType.ANGELS_KISS_BEDROOM)) {
					List<NPC> charactersPresent = Main.game.getCharactersPresent(WorldType.ANGELS_KISS_GROUND_FLOOR, new Vector2i(i, j));
					charactersPresent.removeIf(NPC->NPC.getHistory() != Occupation.NPC_PROSTITUTE);
					if(!charactersPresent.isEmpty()) {
						prostitutes.add(charactersPresent.get(0));
					}
				}
			}
		}
		if (includeSlaves) {
			grid = Main.game.getWorlds().get(WorldType.ANGELS_KISS_FIRST_FLOOR).getGrid();
			for(int i = 0; i<grid.length; i++) {
				for(int j=0; j<grid[0].length; j++) {
					if(grid[i][j].getPlace().getPlaceType().equals(PlaceType.ANGELS_KISS_BEDROOM)) {
						List<NPC> charactersPresent = Main.game.getCharactersPresent(WorldType.ANGELS_KISS_FIRST_FLOOR, new Vector2i(i, j));
						charactersPresent.removeIf(NPC->!NPC.isSlave());
						if (!charactersPresent.isEmpty()) {
							prostitutes.add(charactersPresent.get(0));
						}
					}
				}
			}
		}
		return prostitutes;
	}

	public static List<NPC> getVisitors() {
		List<NPC> visitors = new ArrayList<>();
		Cell[][] grid = Main.game.getWorlds().get(WorldType.ANGELS_KISS_GROUND_FLOOR).getGrid();
		for(int i = 0; i<grid.length; i++) {
			for(int j=0; j<grid[0].length; j++) {
				if(grid[i][j].getPlace().getPlaceType().equals(PlaceType.ANGELS_KISS_BEDROOM)) {
					List<NPC> charactersPresent = Main.game.getCharactersPresent(WorldType.ANGELS_KISS_GROUND_FLOOR, new Vector2i(i, j));
					visitors.addAll(charactersPresent);
				}
			}
		}
		grid = Main.game.getWorlds().get(WorldType.ANGELS_KISS_FIRST_FLOOR).getGrid();
		for(int i = 0; i<grid.length; i++) {
			for(int j=0; j<grid[0].length; j++) {
				if(grid[i][j].getPlace().getPlaceType().equals(PlaceType.ANGELS_KISS_BEDROOM)) {
					List<NPC> charactersPresent = Main.game.getCharactersPresent(WorldType.ANGELS_KISS_FIRST_FLOOR, new Vector2i(i, j));
					visitors.addAll(charactersPresent);
				}
			}
		}
		visitors.removeIf(npc->
				!(npc instanceof GenericSexualPartner)
				|| npc.isSlave()
				|| Main.game.getPlayer().getFriendlyOccupants().contains(npc.getId()));
		return visitors;
	}

	public static boolean isSpaceForMoreProstitutes() {
		return getProstitutes(false).size()<10;
	}

	public static void prostituteUpdate() {
		for (NPC visitor : getVisitors()) {
			Main.game.banishNPC(visitor);
		}
		for (NPC prostitute : getProstitutes(true)) {
			if (Main.game.isLipstickMarkingEnabled()
					&& !prostitute.isSlave()
					&& !Main.game.getPlayer().getFriendlyOccupants().contains(prostitute.getId())
					&& prostitute.getLipstick().getPrimaryColour() != PresetColour.COVERING_NONE) {
				prostitute.addHeavyMakeup(BodyCoveringType.MAKEUP_LIPSTICK);
			}

//			List<NPC> charactersPresent =


'm408': m408,
    'm409_fill': m409_fill,
    'm409': m409,
    'm410_fill': m410_fill,
    'm410': m410,
    'm456_fill': m456_fill,
    'm456': m456,
    'm457_fill': m457_fill,
    'm457': m457,
    'm499_fill': m499_fill,
    'm499': m499,
    'm500_fill': m500_fill,
    'm500': m500,
    'm501_fill': m501_fill,
    'm501': m501,
    'm502_fill': m502_fill,
    'm502': m502,
    'm503_fill': m503_fill,
    'm503': m503,
    'm504_fill': m504_fill,
    'm504': m504,
    'm507_fill': m507_fill,
    'm507': m507,
    'm508_fill': m508_fill,
    'm508': m508,
    'm509_fill': m509_fill,
    'm509': m509,
    'm510_fill': m510_fill,
    'm510': m510,
    'm511_fill': m511_fill,
    'm511': m511,
    'm512_fill': m512_fill,
    'm512': m512,
    'm513_fill': m513_fill,
    'm513': m513,
    'm514_fill': m514_fill,
    'm514': m514,
    'm515_fill': m515_fill,
    'm515': m515,
    'm800': m800,
    'm801': m801,
    'm802': m802,
    'm803': m803,
    'm804': m804,
    'm805': m805,
    'm806': m806,
    'm807': m807,
    'm900_fill': m900_fill,
    'm900': m900,
    'm901_fill': m901_fill,
    'm901': m901,
    'm999_fill': m999_fill,
    'm999': m999,
    'm9998': m9998,
    'm9999': m9999,
  };
}
import 'package:aftersad_store/main.dart';
import 'package:aftersad_store/models/order_item_model.dart';
import 'package:aftersad_store/pages/checkout_page.dart';
import 'package:aftersad_store/utils/app_const.dart';
import 'package:aftersad_store/utils/app_themes.dart';
import 'package:aftersad_store/utils/app_widgets.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart' hide Trans;
import 'package:helpers/helpers.dart';
import 'package:ionicons/ionicons.dart';
import 'package:localize_and_translate/localize_and_translate.dart';

class CartPage extends StatefulWidget {
  const CartPage({Key? key}) : super(key: key);

  @override
  _CartPageState createState() => _CartPageState();
}

class _CartPageState extends State<CartPage> {
  final List<OrderItemModel> _tmpList = cartItemsNotifier.value;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Headline6("cart".tr(),
            style: TextStyle(
                color: AppThemes.lightGreyColor, fontWeight: FontWeight.bold)),
      ),
      body: ValueListenableBuilder(
          valueListenable: cartItemsNotifier,


C 25EFE0B8 */  addiu   $t7, $t7, %lo(D_80B7E0B8)  ## $t7 = 80B7E0B8
/* 05DF0 80B6F790 46020200 */  add.s   $f8, $f0, $f2
/* 05DF4 80B6F794 27B900A8 */  addiu   $t9, $sp, 0x00A8           ## $t9 = FFFFFFC0
/* 05DF8 80B6F798 3C0180B8 */  lui     $at, %hi(D_80B7B4C8)       ## $at = 80B80000
/* 05DFC 80B6F79C E7A800A0 */  swc1    $f8, 0x00A0($sp)
/* 05E00 80B6F7A0 8DF80000 */  lw      $t8, 0x0000($t7)           ## 80B7E0B8
/* 05E04 80B6F7A4 8DEE0004 */  lw      $t6, 0x0004($t7)           ## 80B7E0BC
/* 05E08 80B6F7A8 AF380000 */  sw      $t8, 0x0000($t9)           ## FFFFFFC0
/* 05E0C 80B6F7AC 8DF80008 */  lw      $t8, 0x0008($t7)           ## 80B7E0C0
/* 05E10 80B6F7B0 AF2E0004 */  sw      $t6, 0x0004($t9)           ## FFFFFFC4
/* 05E14 80B6F7B4 AF380008 */  sw      $t8, 0x0008($t9)           ## FFFFFFC8
/* 05E18 80B6F7B8 C7A6009C */  lwc1    $f6, 0x009C($sp)
/* 05E1C 80B6F7BC C7AA00A8 */  lwc1    $f10, 0x00A8($sp)
/* 05E20 80B6F7C0 8FB900EC */  lw      $t9, 0x00EC($sp)
/* 05E24 80B6F7C4 46023102 */  mul.s   $f4, $f6, $f2
/* 05E28 80B6F7C8 C42CB4C8 */  lwc1    $f12, %lo(D_80B7B4C8)($at)
/* 05E2C 80B6F7CC 46045200 */  add.s   $f8, $f10, $f4
/* 05E30 80B6F7D0 C7A400B0 */  lwc1    $f4, 0x00B0($sp)
/* 05E34 80B6F7D4 E7A800A8 */  swc1    $f8, 0x00A8($sp)
/* 05E38 80B6F7D8 8F2F07C0 */  lw      $t7, 0x07C0($t9)           ## 00000780
/* 05E3C 80B6F7DC C7A800A4 */  lwc1    $f8, 0x00A4($sp)
/* 05E40 80B6F7E0 8DEE0028 */  lw      $t6, 0x0028($t7)           ## 80B7E0E0
/* 05E44 80B6F7E4 85D80002 */  lh      $t8, 0x0002($t6)           ## 00000002
/* 05E48 80B6F7E8 44983000 */  mtc1    $t8, $f6                   ## $f6 = 0.00
/* 05E4C 80B6F7EC 00000000 */  nop
/* 05E50 80B6F7F0 468032A0 */  cvt.s.w $f10, $f6
/* 05E54 80B6F7F4 46024182 */  mul.s   $f6, $f8, $f2
/* 05E58 80B6F7F8 E7AA00AC */  swc1    $f10, 0x00AC($sp)
/* 05E5C 80B6F7FC 46062280 */  add.


const NMHDR) -> EventData {
    // If list-view is not enabled, the data type won't be available so we return NO_DATA
    NO_DATA
}

unsafe fn static_commands(handle: HWND, m: u16) -> Event {
    use winapi::um::winuser::{STN_CLICKED, STN_DBLCLK, STM_GETIMAGE, IMAGE_BITMAP};
    use winapi::um::winuser::SendMessageW;

    let has_image = SendMessageW(handle, STM_GETIMAGE, IMAGE_BITMAP as usize, 0) != 0;
    if has_image {
        match m {
            STN_CLICKED => Event::OnImageFrameClick,
            STN_DBLCLK => Event::OnImageFrameDoubleClick,
            _ => Event::Unknown
        }
    } else {
        match m {
            STN_CLICKED => Event::OnLabelClick,
            STN_DBLCLK => Event::OnLabelDoubleClick,
            _ => Event::Unknown
        }
    }
}

unsafe fn listbox_commands(m: u16) -> Event {
    use winapi::um::winuser::{LBN_SELCHANGE, LBN_DBLCLK};

    match m {
        LBN_SELCHANGE => Event::OnListBoxSelect,
        LBN_DBLCLK => Event::OnListBoxDoubleClick,
        _ => Event::Unknown
    }
}

unsafe fn handle_tooltip_callback<'a>(notif: *mut NMTTDISPINFOW, callback: &Callback) {
    use crate::events::ToolTipTextData;

    let notif = &mut *notif;
    let handle = ControlHandle::Hwnd(notif.hdr.idFrom as HWND);
    let data = EventData::OnTooltipText(ToolTipTextData { data: notif });
    callback(Event::OnTooltipText, data, handle);
}

unsafe fn handle_default_notify_callback<'a>(notif_raw: *const NMHDR, callback: &Callback){
    use std::os::windows::ffi::OsStringExt;
    use std::ffi::OsString;
    use winapi::um::winnt::WCHAR;
    use winapi::um::winuser::GetClassNameW;

    let notif = &*notif_raw;
    let handle = ControlHandle::Hwnd(notif.hwndFrom);

    let mut class_name_raw: [WCHAR; 100] = mem::zeroed();
    let count = GetClassNameW(notif.hwndFrom, class_name_raw.as_mut_ptr(), 100) as usize;
    let class_name = OsString::from_wide(&class_name_raw[..count]).into_string().unwrap_or("".to_string());

    let code = notif.code;

    match &class_name as &str {
        "SysDateTimePick32" => callback(datetimepick_commands(code), NO_DATA, handle),
        "SysTabControl32" => callback(tabs_commands(code), NO_DATA, handle),
        "msctls_trackbar32" => callback(track_commands(code), NO_DATA, handle),
        winapi::um::commctrl::WC_TREEVIEW => callback(tree_commands(code), tree_data(code, notif_raw), handle),
        winapi::um::commctrl::WC_LISTVIEW => callback(list_view_commands(code), list_view_data(code, notif_raw), handle),
        _ => {}
    }
}
use std::fmt::Debug;

#[derive(Default, Clone)]
/// OrderedSet maintains a consistent order of items determined by the sequence
/// that elements were added to the set.
struct OrderedSet<T> {
    v: Vec<T>,
    s: std::collections::HashSet<T>,
}

impl<T> OrderedSet<T>
where
    T: Eq + std::hash::Hash + Clone + Copy,
{
    /// If an element doesn't currently exist in a set, it is appended to the
    /// end of the set and true is returned.
    fn insert(&mut self, value: T) -> bool {


00e9di\u00e1",delta_height:""},fullpage:{desc:"Vlastnosti dokumentu",delta_width:"115",delta_height:""},template:{desc:"Vlo\u017ei\u0165 preddefinovan\u00fd obsah zo \u0161abl\u00f3ny"},visualchars:{desc:"Zobrazenie skryt\u00fdch znakov zap/vyp"},spellchecker:{desc:"Prepn\u00fa\u0165 kontrolu pravopisu",menu:"Nastavenie kontroly pravopisu",ignore_word:"Vynecha\u0165 slovo",ignore_words:"Vynecha\u0165 v\u0161etky",langs:"Jazyky",wait:"\u010cakajte pros\u00edm...",sug:"Ponuky",no_sug:"\u017diadne ponuky",no_mpell:"Bez pravopisn\u00fdch ch\u00fdb."},pagebreak:{desc:"Vlo\u017ei\u0165 zalomenie str\u00e1nky."},advlist:{types:"Typ",def:"Predvolen\u00fd",lower_alpha:"Mal\u00e9 p\u00edsmen\u00e1",lower_greek:"Mal\u00e9 gr\u00e9cke p\u00edsmen\u00e1",lower_roman:"Mal\u00e9 r\u00edmske \u010d\u00edslice",upper_alpha:"Ve\u013ek\u00e9 p\u00edsmen\u00e1",upper_roman:"Ve\u013ek\u00e9 r\u00edmske \u010d\u00edslice",circle:"Kr\u00fa\u017eok",disc:"Pln\u00e9 koliesko",square:"\u0160tvor\u010dek"}}});/**
 * editor_plugin_src.js
 *
 * Copyright 2009, Moxiecode Systems AB
 * Released under LGPL License.
 *
 * License: http://tinymce.moxiecode.com/license
 * Contributing: http://tinymce.moxiecode.com/contributing
 */

(function() {
	tinymce.create('tinymce.plugins.StylePlugin', {
		init : function(ed, url) {
			// Register commands
			ed.addCommand('mceStyleProps', function() {
				ed.windowManager.open({
					file : url + '/props.htm',
					width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
					height : 320 + parseInt(ed.getLang('style.delta_height', 0)),
					inline : 1
				}, {
					plugin_url : url,
					style_text : ed.selection.getNode().style.cssText
				});
			});

			ed.addCommand('mceSetElementStyle', function(ui, v) {
				if (e = ed.selection.getNode()) {
					ed.dom.setAttrib(e, 'style', v);
					ed.execCommand('mceRepaint');
				}
			});

			ed.onNodeChange.add(function(ed, cm, n) {
				cm.setDisabled('styleprops', n.nodeName === 'BODY');
			});

			// Register buttons
			ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
		},

		getInfo : function() {
			return {
				longname : 'Style',
				author : 'Moxiecode Systems AB',
				authorurl : 'http://tinymce.moxiecode.com',
				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
				version : tinymce.majorVersion + "." + tinymce.minorVersion
			};
		}
	});

	// Register plugin
	tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);
})();(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.o


nchMetricsParser(this.rawText);
            IList<Metric> metrics = this.testParser.Parse();

            Assert.AreEqual(3, metrics.Count);
            MetricAssert.Exists(metrics, "ExecutionTime", 0.05, "Seconds");
            MetricAssert.Exists(metrics, "Mop/s total", 3873.74, "Mop/s");
            MetricAssert.Exists(metrics, "Mop/s/process", 1936.87, "Mop/s");
        }

        [Test]
        public void NASParallelBenchMetricsParserVerifyMetricsForOMP()
        {
            string outputPath = Path.Combine(this.ExamplePath, "NASParallelBenchOMPExample.txt");
            this.rawText = File.ReadAllText(outputPath);
            this.testParser = new NASParallelBenchMetricsParser(this.rawText);
            IList<Metric> metrics = this.testParser.Parse();

            Assert.AreEqual(3, metrics.Count);
            MetricAssert.Exists(metrics, "ExecutionTime", 0.03, "Seconds");
            MetricAssert.Exists(metrics, "Mop/s total", 7973.99, "Mop/s");
            MetricAssert.Exists(metrics, "Mop/s/thread", 1993.50, "Mop/s");
        }
    }
}


 ::core::ffi::c_void, srcdatasize: usize, riid: *const ::windows_sys::core::GUID, ppreflector: *mut *mut ::core::ffi::c_void) -> ::windows_sys::core::HRESULT;
    #[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
    pub fn D3DSetBlobPart(psrcdata: *const ::core::ffi::c_void, srcdatasize: usize, part: D3D_BLOB_PART, flags: u32, ppart: *const ::core::ffi::c_void, partsize: usize, ppnewshader: *mut super::ID3DBlob) -> ::windows_sys::core::HRESULT;
    #[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
    pub fn D3DStripShader(pshaderbytecode: *const ::core::ffi::c_void, bytecodelength: usize, ustripflags: u32, ppstrippedblob: *mut super::ID3DBlob) -> ::windows_sys::core::HRESULT;
    #[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`, `\"Win32_Foundation\"`*"]
    #[cfg(feature = "Win32_Foundation")]
    pub fn D3DWriteBlobToFile(pblob: super::ID3DBlob, pfilename: ::windows_sys::core::PCWSTR, boverwrite: super::super::super::Foundation::BOOL) -> ::windows_sys::core::HRESULT;
}
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_DLL_A: &str = "d3dcompiler_47.dll";
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_DLL_W: &str = "d3dcompiler_47.dll";
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub type D3DCOMPILER_STRIP_FLAGS = i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_STRIP_REFLECTION_DATA: D3DCOMPILER_STRIP_FLAGS = 1i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_STRIP_DEBUG_INFO: D3DCOMPILER_STRIP_FLAGS = 2i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_STRIP_TEST_BLOBS: D3DCOMPILER_STRIP_FLAGS = 4i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_STRIP_PRIVATE_DATA: D3DCOMPILER_STRIP_FLAGS = 8i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_STRIP_ROOT_SIGNATURE: D3DCOMPILER_STRIP_FLAGS = 16i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILER_STRIP_FORCE_DWORD: D3DCOMPILER_STRIP_FLAGS = 2147483647i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D_Fxc\"`*"]
pub const D3DCOMPILE_ALL_RESOURCES_BOUND: u32 = 2097152u32;
#[doc =


result > 0))
/*      */       {
/*      */
/*      */
/*  121 */         prevresult[0] = this.m_table_[(3 * --result)];
/*  122 */         prevresult[1] = this.m_table_[(3 * result + 1)];
/*      */       }
/*  124 */       return result;
/*      */     }
/*      */
/*      */     final int getCEStrengthDifference(int CE, int contCE, int prevCE, int prevContCE)
/*      */     {
/*  129 */       int strength = 2;
/*      */
/*  131 */       while ((((prevCE & CollationParsedRuleBuilder.STRENGTH_MASK_[strength]) != (CE & CollationParsedRuleBuilder.STRENGTH_MASK_[strength])) || ((prevContCE & CollationParsedRuleBuilder.STRENGTH_MASK_[strength]) != (contCE & CollationParsedRuleBuilder.STRENGTH_MASK_[strength]))) && (strength != 0)) {
/*  132 */         strength--;
/*      */       }
/*  134 */       return strength;
/*      */     }
/*      */
/*      */     private int compareCEs(int source0, int source1, int target0, int target1)
/*      */     {
/*  139 */       int s1 = source0;int t1 = target0;
/*  140 */       int s2; int s2; if (RuleBasedCollator.isContinuation(source1)) {
/*  141 */         s2 = source1;
/*      */       } else
/*  143 */         s2 = 0;
/*      */       int t2;
/*  145 */       int t2; if (RuleBasedCollator.isContinuation(target1)) {
/*  146 */         t2 = target1;
/*      */       } else {
/*  148 */         t2 = 0;
/*      */       }
/*      */
/*  151 */       int s = 0;int t = 0;
/*  152 */       if ((s1 == t1) && (s2 == t2)) {
/*  153 */         return 0;
/*      */       }
/*  155 */       s = s1 & 0xFFFF0000 | (s2 & 0xFFFF0000) >>> 16;
/*  156 */       t = t1 & 0xFFFF0000 | (t2 & 0xFFFF0000) >>> 16;
/*  157 */       if (s == t) {
/*  158 */         s = s1 & 0xFF00 | (s2 & 0xFF00) >> 8;
/*  159 */         t = t1 & 0xFF00 | (t2 & 0xFF00) >> 8;
/*  160 */         if (s == t) {
/*  161 */           s = (s1 & 0xFF) << 8 | s2 & 0xFF;
/*  162 */           t = (t1 & 0xFF) << 8 | t2 & 0xFF;
/*  163 */           return Utility.compareUnsigned(s, t);
/*      */         }
/*  165 */         return Utility.compareUnsigned(s, t);
/*      */       }
/*      */
/*  168 */       return Utility.compareUnsigned(s, t);
/*      */     }
/*      */
/*      */
/*      */
/*      */
/*      */
/*      */
/*      */
/*      */
/*      */
/*      */
/*      */     int findInverseCE(int ce, int contce)
/*      */     {
/*  182 */       int bottom = 0;
/*  183 */       int top = this.m_table_.length / 3;
/*  184 */       int result = 0;
/*      */
/*  186 */       while (bottom < top - 1) {
/*  187 */         result = top + bottom >> 1;
/*  188 */         int first = this.m_table_[(3 * result)];
/*  189 */         int second = this.m_table_[(3 * result + 1)];
/*  190 */         int comparison = compar


s="aligncenter size-full wp-image-918" src="http://img.4hou.com/wp-content/themes/4houv2/img/lazy.gif" data-original="http://img.4hou.com/wp-content/uploads/2016/12/dcfcd07e645d245babe8-136.jpg" width="1105" height="574"/>

4、其他设置

如Unit Item Tables、Unit Creation、Players、Map Configuration暂略

Jass预读文件漏洞

Reference:http://bbs.islga.org/forum.php?mod=viewthread&tid=48422&extra=page%3D1&page=1

JASS中三个特殊的函数：

native PreloadGenClear takes nothing returns nothing
native PreloadGenStart takes nothing returns nothing
native PreloadGenEnd takes string filename returns nothing

以上三个函数用来记录PreloadGenStart()和PreloadGenEnd()之间执行的所有Preload()语句，并将它们写入到PreloadGenEnd()函数指定的pld文件里去

注：类似于输出日志文件

示例：

JASS代码如下：

执行函数Test()后，就会在c:test下新建文件test.pld，并写入如下内容：

<img class="aligncenter size-full wp-image-920" src="http://img.4hou.com/wp-content/uploads/2016/12


  unsafe fn from_glib_none(ptr: *const ffi::CoglFence) -> Self {
        *(ptr as *const Fence)
    }
}

#[doc(hidden)]
impl FromGlibPtrNone<*mut ffi::CoglFence> for Fence {
    unsafe fn from_glib_none(ptr: *mut ffi::CoglFence) -> Self {
        *(ptr as *mut Fence)
    }
}

impl FromGlibPtrBorrow<ffi::CoglFence> for Fence {
    #[inline]
    unsafe fn from_glib_borrow(ptr: ffi::CoglFence) -> glib::translate::Borrowed<Fence> {
        glib::translate::Borrowed::new(Fence(ptr))
    }
}

#[doc(hidden)]
impl FromGlibPtrBorrow<*mut ffi::CoglFence> for Fence {
    unsafe fn from_glib_borrow(ptr: *mut ffi::CoglFence) -> glib::translate::Borrowed<Self> {
        glib::translate::Borrowed::new(*(ptr as *mut Fence))
    }
}

#[doc(hidden)]
impl FromGlibPtrBorrow<*const ffi::CoglFence> for Fence {
    unsafe fn from_glib_borrow(ptr: *const ffi::CoglFence) -> glib::translate::Borrowed<Self> {
        glib::translate::Borrowed::new(*(ptr as *const Fence))
    }
}

impl FromGlibPtrFull<ffi::CoglFence> for Fence {
    #[inline]
    unsafe fn from_glib_full(_: ffi::CoglFence) -> Fence {
        unimplemented!()
    }
}

impl FromGlibContainerAsVec<ffi::CoglFence, *mut ffi::CoglFence> for Fence {
    unsafe fn from_glib_none_num_as_vec(ptr: *mut ffi::CoglFence, num: usize) -> Vec<Self> {
        if num == 0 || ptr.is_null() {
            return Vec::new();
        }

        let mut res = Vec::with_capacity(num);
        for i in 0..num {
            res.push(from_glib_none(ptr::read(ptr.add(i))));
        }
        res
    }

    unsafe fn from_glib_container_num_as_vec(ptr: *mut ffi::CoglFence, num: usize) -> Vec<Self> {
        let res = FromGlibContainerAsVec::from_glib_none_num_as_vec(ptr, num);
        glib_sys::g_free(ptr as *mut _);
        res
    }

    unsafe fn from_glib_full_num_as_vec(ptr: *mut ffi::CoglFence, num: usize) -> Vec<Self> {
        if num == 0 || ptr.is_null() {
            return Vec::new();
        }

        let mut res = Vec::with_capacity(num);
        for i in 0..num {
            res.push(from_glib_full(ptr::read(ptr.add(i))));
        }
        glib_sys::g_free(ptr as *mut _);
        res
    }
}

impl FromGlibPtrArrayContainerAsVec<ffi::CoglFence, *mut ffi::CoglFence> for Fence {
    unsafe fn from_glib_none_as_vec(ptr: *mut ffi::CoglFence) -> Vec<Self> {
        FromGlibContainerAsVec::from_glib_none_num_as_vec(ptr, c_ptr_array_len(ptr))
    }

    unsafe fn from_glib_container_as_vec(ptr: *mut ffi::CoglFence) -> Vec<Self> {
        FromGlibContainerAs


mentions.some(x => x.id === this.client.bot.user.id)) return; // we weren't mentioned, abort

        // At this point we know the original author added a question mark to a message that mentioned us.
        // That doesn't yet give conclusive info that we had a question mark already, but it is good enough.
        await this.displayHelp(message);
    };

    /**
     * Internal implementation for {@link ok}, {@link info} and {@link error}.
     */
    private createResponse(message: eris.Message, color: number, content: EmbedOptions, responseChannel?: eris.Channel): Promise<Response> {
        const response = new Response(this.client.bot, message);
        this.responses.push(response); // store it here so we can keep track of it

        if (!content.noExpire) {
            // Messages expire after an hour. This is done to ensure that they can be garbage collected.
            // This does not happen for messages explicity marked noExpire.
            setTimeout(() => {
                response.removeAllOptions();
                this.responses.splice(this.responses.indexOf(response), 1);
            }, 1000 * 60 * 60);
        }

        return response.respond(color, content, responseChannel).then(x => response);
    }
}import { objectEqualityTestScheduler, snapshotTestScheduler } from "../testUtil";
import { mergeMap, map } from "rxjs/operators";

describe('mergeMap', () => {

  it('plain mergeMap', () => {
    objectEqualityTestScheduler().run(({ cold, expectObservable}) => {

      const in1 = 'abc --- --- --- |'
      const in2 = '1-- 2-- 3-- |'

      const out = 'abc def ghi --- |'

      const values = {
        a: 'a1',
        b: 'b1',
        c: 'c1',
        d: 'a2',
        e: 'b2',
        f: 'c2',
        g: 'a3',
        h: 'b3',
        i: 'c3'
      }

      const in1$ = cold(in1)
      const in2$ = cold(in2)

      const outputStream = in1$.pipe(
        mergeMap((x) => in2$.pipe(map(y => `${x}${y}`))),
      )

      expectObservable(outputStream).toBe(out, values)

    })
  })

  it('snapshot', () => {
    snapshotTestScheduler().run(({cold, expectObservable}) => {

      const in1 = 'abc --- --- --- --- |'
      const in2 = '1-- 2-- 3-- |'

      const in1$ = cold(in1)
      const in2$ = cold(in2)

      const outputStream = in1$.pipe(
        mergeMap(x => in2$.pipe(map(y => x + y)), 2)
      )

      expectObservable(outputStream).toBe('')

    })
  })

  it('equality', () => {
    objectEqualityTestScheduler().run(({cold, expectObservable}) => {

      const in1 = 'abc --- --- --- --- |'
      const in2 = '1-- 2-- 3-- |'
      const out = 'qr- st- uv- x-- y-- z-- |'

      const values = {
        q: 'a1',
        r: 'b1',
        s: 'a2',
        t: 'b2',
        u: 'a3',
        v: 'b3',
        x: 'c1',
        y: 'c2',
        z: 'c3',
      }

      const in1$ = cold(in1)
      const in2$ = cold(in2)

      const outputStream = in1$.pipe(
        mergeMap(x => in2$.pipe(map(y => x + y)), 2)
      )

      expectObservable(outputStream).toBe(out, values)

    })
  })
})
import * as fs from "fs";
import * as path from "path";

export class CacheService {
    private static FILE_PATH = path.join(__dirname, './.cache.json');

    private static _INST


8_regexp_utils.dart';
import 'package:expect/expect.dart';

void main() {
  description(
    "This test checks a few cases of extended (> 127) characters in repeat regular expressions.",
  );

  assertEquals(
    "foo\u00a0\u00a0\u00a0".replaceFirst(
      new RegExp(new String.fromCharCode(0x00a0) + "*"),
      "",
    ),
    "foo\u00a0\u00a0\u00a0",
  );
  assertEquals(
    "foo\u00a0\u00a0\u00a0".replaceFirst(new RegExp(r"\u00a0+"), ""),
    "foo",
  );
  assertEquals(
    "foo\u00a0\u00a0\u00a0".replaceFirst(new RegExp(r"\u00a0*$"), ""),
    "foo",
  );
}
// Copyright (c) 2019, the Dart project authors. All rights reserved.
// Copyright 2016 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
//       copyright notice, this list of conditions and the following
//       disclaimer in the documentation and/or other materials provided
//       with the distribution.
//     * Neither the name of Google Inc. nor the names of its
//       contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import 'package:expect/expect.dart';

import 'v8_regexp_utils.dart';

void main() {
  void t(RegExp re, String s) {
    assertTrue(re.hasMatch(s));
  }

  void f(RegExp re, String s) {
    assertFalse(re.hasMatch(s));
  }

  t(RegExp(r"\p{Script=Common}+", unicode: true), ".");
  f(
    RegExp(r"\p{Script=Common}+", unicode: true),
    "supercalifragilisticexpialidocious",
  );

  t(RegExp(r"\p{Script=Han}+", unicode: true), "话说天下大势，分久必合，合久必分");
  t(RegExp(r"\p{Script=Hani}+", unicode: true), "吾庄后有一桃园，花开正盛");
  f(RegExp(r"\p{Script=Han}+", unicode: true), "おはようございます");
  f(
    RegExp(r"\p{Script=Hani}+", unicode: true),
    "Something is rotten in the state of Denmark",
  );

  t(
    RegExp(r"\p{Script=Latin}+", unicode: true),
    "Wie froh bin ich, daß ich weg bin!",
  );
  t(
    RegExp(r"\p{Script=Latn}+", unicode: true),
    "It was a bright day in April, and the clocks were striking thirteen",
  );
  f(RegExp(r"\p{Script=Latin}+", unicode: true),


ePot = tensor(g.nEdges,nStates,nStates)
   basic = tensor{{2,1}, {1,2}}
   for e = 1,g.nEdges do
      edgePot[e] = basic
   end

   -- set potentials
   g:setPotentials(nodePot,edgePot)

   -- exact inference
   local exact = g:decode('exact')
   print()
   print('<gm.testme> exact optimal config:')
   print(exact)

   local nodeBel,edgeBel,logZ = g:infer('exact')
   print('<gm.testme> node beliefs:')
   print(nodeBel)
   --print('<gm.testme> edge beliefs:')
   --print(edgeBel)
   print('<gm.testme> log(Z):')
   print(logZ)

   -- bp inference
   local bp = g:decode('bp')
   print()
   print('<gm.testme> optimal config with belief propagation:')
   print(bp)

   local nodeBel,edgeBel,logZ = g:infer('bp')
   print('<gm.testme> node beliefs:')
   print(nodeBel)
   --print('<gm.testme> edge beliefs:')
   --print(edgeBel)
   print('<gm.testme> log(Z):')
   print(logZ)
end


channels, run)

    return w.WEECHAT_RC_OK

def process_server(server, channels, run=True):
        option   = "irc.server.%s.autojoin" % server
        channels = channels.rstrip(',')
        oldchans = w.config_string(w.config_get(option))

        if not channels: # empty channel list
            return

        # Note: re already caches the result of regexp compilation
        sec = re.match('^\${sec\.data\.(.*)}$', oldchans)
        if sec:
            secvar = sec.group(1)
            command = "/secure set %s %s" % (secvar, channels)
        else:
            command = "/set irc.server.%s.autojoin '%s'" % (server, channels)

        if run:
            w.command('', command)
        else:
            w.prnt('', command)

def find_channels():
    """Return list of servers and channels"""
    #@TODO: make it return a dict with more options like "nicks_count etc."
    items = {}
    infolist = w.infolist_get('irc_server', '', '')
    # populate servers
    while w.infolist_next(infolist):
        items[w.infolist_string(infolist, 'name')] = ''

    w.infolist_free(infolist)

    # populate channels per server
    for server in items.keys():
        keys = []
        keyed_channels = []
        unkeyed_channels = []
        items[server] = '' #init if connected but no channels
        infolist = w.infolist_get('irc_channel', '',  server)
        while w.infolist_next(infolist):
            if w.infolist_integer(infolist, 'nicks_count') == 0:
                #parted but still open in a buffer: bit hackish
                continue
            if w.infolist_integer(infolist, 'type') == 0:
                key = w.infolist_string(infolist, "key")
                if len(key) > 0:
                    keys.append(key)
                    keyed_channels.append(w.infolist_string(infolist, "name"))
                else :
                    unkeyed_channels.append(w.infolist_string(infolist, "name"))
        items[server] = ','.join(keyed_channels + unkeyed_channels)
        if len(keys) > 0:
            items[server] += ' %s' % ','.join(keys)
        w.infolist_free(infolist)

    return items


.thread.worker.1": 1})
Ok({"req.page.4": 9, "req.page.3": 9, "req.page.2": 7, "req.page.1": 9, "call.thread.worker.0": 2, "call.thread.worker.1": 1})
Ok({"req.page.4": 12, "req.page.3": 12, "req.page.2": 14, "req.page.1": 12, "call.thread.worker.0": 2, "call.thread.worker.1": 2})
Ok({"req.page.4": 15, "req.page.3": 18, "req.page.2": 20, "req.page.1": 16, "call.thread.worker.0": 3, "call.thread.worker.1": 2})
Ok({"req.page.4": 19, "req.page.3": 20, "req.page.2": 27, "req.page.1": 21, "call.thread.worker.0": 5, "call.thread.worker.1": 3})
Ok({"req.page.4": 26, "req.page.3": 28, "req.page.2": 32, "req.page.1": 25, "call.thread.worker.0": 5, "call.thread.worker.1": 3})
Ok({"req.page.4": 31, "req.page.3": 31, "req.page.2": 36, "req.page.1": 30, "call.thread.worker.0": 6, "call.thread.worker.1": 4})
Ok({"req.page.4": 34, "req.page.3": 40, "req.page.2": 39, "req.page.1": 33, "call.thread.worker.0": 6, "call.thread.worker.1": 5})
```

## 使用 RwLock 替换 Mutex

### 主要代码

使用 RwLock 代替 Mutex，RwLock 允许多个读取者同时访问数据，提高了并发性能。当有多个线程需要读取 HashMap 中的数据时，它们可以同时获取读锁，而无需相互阻塞。这对于读多写少的场景特别有利，因为读取操作不会相互干扰，可以并发进行。

```rust
#[derive(Debug, Clone)]
pub struct Metrics {
    data: Arc<RwLock<HashMap<String, i64>>>,
}
```

写方法使用 `write` 方法获取写锁，读方法使用 `read` 方法获取读锁。

```rust
 pub fn inc(&self, key: impl Into<String>) -> Result<()> {
     let mut data = self.data.write().map_err(|e| anyhow!(e.to_string()))?;
     let counter = data.entry(key.into()).or_insert(0);
     *counter += 1;
     Ok(())
 }

 pub fn snapshot(&self) -> Result<HashMap<String, i64>> {
     Ok(self
         .data
         .read()
         .map_err(|e| anyhow!(e.to_string()))?


rCat("CPU:", ordinal))));
  return CreateCpuOpHandler(runtime, exec_ctx.host()->GetHostDeviceRef(),
                            fallback.get());
}
//===----------------------------------------------------------------------===//
// Registration
//===----------------------------------------------------------------------===//

void RegisterCpuOpHandlerKernels(KernelRegistry* registry) {
  registry->AddKernel("corert.create_null_op_handler",
                      TFRT_KERNEL(CreateNullOpHandlerKernel));
  registry->AddKernel("corert.create_cpu_op_handler",
                      TFRT_KERNEL(CreateCpuOpHandlerKernel));
  registry->AddKernel("corert.create_cpu_op_handler_with_ordinal",
                      TFRT_KERNEL(CreateCpuOpHandlerWithOrdinalKernel));
}

}  // namespace tfrt
// Copyright 2020 The TensorFlow Runtime Authors
//
// 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.

// This file defines dispatch functions for CPU implementation of TF ops.

#include "tfrt/cpu/ops/tf/cpu_ops.h"

#include "../../kernels/cpu_kernels.h"
#include "constant_ops.h"
#include "cwise_binary_ops.h"
#include "cwise_unary_ops.h"
#include "matmul_fusion_ops.h"
#include "matmul_ops.h"
#include "shape_ops.h"
#include "softmax_ops.h"
#include "tfrt/common/compat/eigen/eigen_dtype.h"
#include "tfrt/common/ops/tf/metadata_functions.h"
#include "tfrt/core_runtime/op_attrs.h"
#include "tfrt/core_runtime/op_utils.h"
#include "tfrt/cpu/core_runtime/cpu_op_registry.h"
#include "tfrt/host_context/async_value_ref.h"
#include "tfrt/host_context/chain.h"
#include "tfrt/host_context/diagnostic.h"
#include "tfrt/host_context/kernel_utils.h"
#include "tfrt/tensor/dense_host_tensor.h"
#include "tfrt/tensor/dense_host_tensor_view.h"
#include "tfrt/tensor/tensor_serialize_utils.h"
#include "tile_op.h"

namespace tfrt {
namespace {

//===----------------------------------------------------------------------===//
// tf.Const op
//===----------------------------------------------------------------------===//

static Expected<DenseHostTensor> TfConstOp(const OpAttrsRef& attrs,
                                           const TensorMetadata& dest_md,
                                           const ExecutionContext& exec_ctx) {
  auto dest_alloc =
      DenseHostTensor::CreateUninitialized(dest_md, exec_ctx.host());
  if (!dest_alloc) {
    return MakeStringError("out of memory allocating dht tensor");
  }

  auto& dest_tensor = dest_alloc.value();

  // Copy data from `value` attribute to dht.
  DenseAttr dense_attr = attrs.GetAsserting<DenseAttr>("value");
  std::memcpy(dest_tensor.data(), dense_attr.GetElements(),
              dest_md.GetHostSizeInBytes());

  return std::move(dest_tensor);
}

//===----------------------------------------------------------------------===//


 0f;

        private void Start()
        {
            _mainCamera = Camera.main;
        }

        private void LateUpdate()
        {
            if (!Mathf.Approximately(_camOrthoSize, _mainCamera.orthographicSize) || _camAspectRatio != _mainCamera.aspect)
            {
                _camOrthoSize = _mainCamera.orthographicSize;
                _camAspectRatio = _mainCamera.aspect;

                float size = 1f;
                if (_camAspectRatio > 1f)
                {
                    size = _camOrthoSize * 2f * _camAspectRatio;
                }
                else
                {
                    size = _camOrthoSize * 2f;
                }

                Vector3 newScale = new Vector3(size, size, 1f);
                transform.localScale = newScale;
            }
        }
    }
}


 * Blog : http://blog.csdn.net/javazejian [原文地址,请尊重原创]
 * 自底向上的归并排序算法
 * 自底向上的归并排序算法的思想就是数组中先一个一个归并成两两有序的数组，
 * 两两有序的数组归并成四个四个有序的数组，然后四个四个有序的序列归并八
 * 个八个有序的数组，以此类推，直到，归并的长度大于整个数组的长度，此时
 * 整个数组有序。需要注意的是数组按照归并长度划分，最后一个子数组可能不
 * 满足长度要求，这种情况需要注意。自顶下下的归并排序算法一般用递归
 * 来实现，而自底向上可以用循环来实现。
 *                                         ∧
 *          [1 2 3 4 5 6 7 8]              ‖上    最后合并成一个有序数组
 *        [1 2 5 8]  [3 4 6 7]             ‖向    再归并成四四分组
 *       [5 8] [1 2] [6 7] [3 4]           ‖底    先按两两分组,然后排序
 *   [8] [5] [1] [2] [7] [6] [3] [4]       ‖自    一一分组然后归并
 *         [8 5 1 2 7 6 3 4]               ‖      未分组
 *
 */
public class MergeSortBottomUp {

    public static <T extends Comparable<T>> void sort(T[] array){
        assert array != null;
        int len = array.length;
        //分组循环排序,sz表示每组分组的个数,第一轮分组数组个数为1
        for (int sz = 1; sz < len ; sz += sz) {
            //对分组进行两两归并
            //由于每次归并的是两个分组个数,所以归并的间隔是 sz + sz = 2 * sz
            for (int i = 0; i < len ; i += 2*sz) {
                //i+sz 代表分组的下标最大值,由于下标从0开始,所以需要i+sz-1
                //用于归并的第二组起始点是i+sz,结束点:i + sz - 1 + sz
                //对array[i....i+sz-1] 和 array[i+sz.....i+sz+sz-1]进行归并
                int l = i;
                int mid = i+sz-1;
                int r = i+sz+sz-1;
                //进行合并操作,Math.min(r,len-1)防止数组越界,存在最后一个分组不符合整数的情况
                MergeSort.merge(array,l,mid,Math.min(r,len-1));
            }
        }
    }

    /**
     * 优化版
     * @param array
     * @param <T>
     */
    public static <T extends Comparable<T>> void sortOptimize(T[] array){
        assert array != null;
        int len = array.length;

        //优化: 对于小数组, 使用插入排序优化sz是分组的大小
        for( int sz = 0 ; sz < len ; sz += 16 ){
            //Math.min(i+16-1,len-1)防止数组越界,存在最后一个分组不符合整数的情况
            InsertionSort.sort(array,sz,Math.min(sz+16-1,len-1));
        }

        //分组循环排序,sz表示每组分组的个数,第一轮分组数组个数为1
        for (int sz = 16; sz < len ; sz += sz) {
            //对分组进行两两归并
            //由于每次归并的是两个分组个数,所以归并的间隔是 sz + sz = 2 * sz
            for (int i = 0; i < len ; i += 2*sz) {
                //i+sz 代表分组的下标最大值,由于下标从0开始,所以需要i+sz-1
                //用于归并的第二组起始点是i+sz,结束点:i + sz - 1 + sz


l String INVENTORY_TAG = "Inventory";
	private final ItemStackHandler inventory;

	public VialHolderBlockEntity(BlockPos pos, BlockState blockState) {
		super(ModBlockEntities.VIAL_HOLDER.get(), pos, blockState);
		reRenderBlockOnSync = true;

		inventory = new ItemStackHandler(5) {
			@Override
			public int getSlotLimit(int slot) {
				return 1;
			}

			@Override
			public boolean isItemValid(int slot, @NotNull ItemStack stack) {
				return stack.getItem() instanceof SerumContainer;
			}

			@Override
			protected void onContentsChanged(int slot) {
				setChanged();
				syncToClient();
				updateBlockStateDelayed();
			}
		};
	}

	protected void updateBlockStateDelayed() {
		if (level == null || level.isClientSide()) return;
		level.scheduleTick(getBlockPos(), getBlockState().getBlock(), 1);
	}

	protected void updateBlockState() {
		if (level == null || level.isClientSide()) return;

		BlockState oldState = getBlockState();
		BlockState newState = getBlockState();
		for (int i = 0; i < VialHolderBlock.VIAL_PROPERTIES.length; i++) {
			BooleanProperty vialProperty = VialHolderBlock.VIAL_PROPERTIES[i];
			newState = newState.setValue(vialProperty, inventory.getStackInSlot(i).getItem() instanceof SerumContainer);
		}

		if (newState != oldState) {
			level.setBlock(getBlockPos(), newState, Block.UPDATE_ALL);
		}
	}

	@Override
	protected void saveAdditional(CompoundTag tag) {
		super.saveAdditional(tag);
		tag.put(INVENTORY_TAG, inventory.serializeNBT());
	}

	@Override
	public void load(CompoundTag tag) {
		super.load(tag);
		inventory.deserializeNBT(tag.getCompound(INVENTORY_TAG));
		updateBlockStateDelayed();
	}

	@Override
	protected void saveForSyncToClient(CompoundTag tag) {
		tag.put(INVENTORY_TAG, inventory.serializeNBT());
	}

	public void dropInventoryContents(Level level, BlockPos pos, boolean removeWithoutUpdate) {
		for (int i = 0; i < inventory.getSlots(); i++) {
			ItemStack stack = inventory.extractItem(i, inventory.getSlotLimit(i), removeWithoutUpdate);
			if (stack.isEmpty()) continue;
			Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), stack);
		}
	}

	public void extractVial(Player player, int slot) {
		if (slot < 0 || slot >= inventory.getSlots()) return;

		ItemStack stack = inventory.extractItem(slot, inventory.getSlotLimit(slot), false);
		if (!stack.isEmpty() && !player.addItem(stack)) {
			player.drop(stack, false);
		}
	}

	public void extractAllVials(Player player) {
		for (int slot = 0; slot < inventory.getSlots(); slot++) {
			ItemStack stack = inventory.extractItem(slot, inventory.getSlotLimit(slot), false);
			if (!stack.isEmpty() && !player.addItem(stack)) {
				player.drop(stack, false);
			}
		}
	}

	public ItemStack insertVial(ItemStack stack, int slot) {
		if (slot < 0 || slot >= inventory.getSlots()) return stack;
		return inventory.insertItem(slot, stack, false);
	}

	public ItemStack insertAllVials(ItemStack stack) {
		for (int slot = 0; slot < inventory.getSlots(); slot++) {
			if (stack.isEmpty()) return stack;
			stack = inventory.insertItem(slot, stack, false);
		}
		return stack;
	}

	public boolean hasVials() {
		for (int slot = 0; slot < inventory.getSlots(); slot++) {


New", monospace;font-size:smaller}.diff-file .header.file-header .file-mode{font-family:consolas, Courier, "MS Courier New", monospace}.diff-file .header.file-header .view-file{font-weight:normal}.diff-file .diff-content{word-break:normal;overflow:auto;overflow-y:hidden;background:#FFF;color:#333;font-size:12px;border:1px solid #E3E9ED !important;border-top-width:0 !important;border-radius:0 0 3px 3px}.diff-file .diff-content .nothing-here-block{text-align:center;line-height:36px;background-color:#FFF}.diff-file .diff-content .submodule-block{padding:5px 10px;font-size:1rem;background-color:white}.diff-file .diff-content.loading{text-align:center;background-color:#FFF}.diff-file .diff-content .old span.idiff{background-color:#FAA}.diff-file .diff-content .new span.idiff{background-color:#AFA}.diff-file .diff-content table{font-family:consolas, Courier, "MS Courier New", monospace;border:none;width:100%;margin:0px;padding:0px}.diff-file .diff-content table.parallel{word-break:break-all}.diff-file .diff-content table td{line-height:18px;font-size:12px}.diff-file .diff-content tr.line_holder.parallel td.line_content.parallel{width:46%;word-break:break-all}.diff-file .diff-content .old_line{margin:0px;border:none;color:#999;padding:0px 5px;border-right:1px solid #ccc;text-align:right;min-width:35px}.diff-file .diff-content .new_line{margin:0px;border:none;color:#666;padding:0px 5px;border-right:1px solid #ccc;text-align:right}.diff-file .diff-content .old_line,.diff-file .diff-content .new_line{background:#f7f7f7;width:1%;min-width:35px;font-size:12px;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.diff-file .diff-content .old_line a,.diff-file .diff-content .new_line a{color:#AAA}.diff-file .diff-content .old_line:before,.diff-file .diff-content .old_line>a:before,.diff-file .diff-content .new_line:before,.diff-file .diff-content .new_line>a:before{content:attr(data-line-number)}.diff-file .diff-content .placeholder_line{background:#f7f7f7;border-right:1px solid #ccc}.diff-file .diff-content .line_content{display:table-cell;white-space:pre-wrap;height:18px;margin:0px;padding:0 0 0 1.2rem;border:none;position:relative}.diff-file .diff-content .line_content .line{display:inline-block}.diff-file .diff-content .line_content.new{background:#CFD}.diff-file .diff-content .line_content.new:before{content:'+';position:absolute;left:0.4rem}.diff-file .diff-content .line_content.old{background:#FDD}.diff-file .diff-content .line_content.old:before{content:'-';position:absolute;left:0.4rem}.diff-file .diff-content .line_content.matched{color:#ccc;background:#F1F8FF}.diff-file .diff-content>.image{text-align:center;padding:30px;width:100%}.diff-file .diff-content>.image .wrap{display:inline-block}.diff-file .diff-c


BCF4\uC138\uC694.","Definition:":"\uC0AC\uC804 \uC815\uC758 :","Synonyms:":"\uC720\uC758\uC5B4:","Antonyms:":"\uBC18\uC758\uC5B4:","Choose a Definition Provider Service":"\uC0AC\uC804 \uC815\uC758 \uC81C\uACF5 \uC11C\uBE44\uC2A4\uB97C \uC120\uD0DD\uD558\uC138\uC694.","Choose a Language":"\uC5B8\uC5B4\uB97C \uC120\uD0DD\uD558\uC138\uC694.","Choose a Synonym Provider Service":"\uC720\uC758\uC5B4 \uC81C\uACF5 \uC11C\uBE44\uC2A4\uB97C \uC120\uD0DD\uD558\uC138\uC694."};var an={};var sn={};var ln={};var cn={"Open Dictionary View":"Abrir Vista do Dicion\xE1rio","Open Language Switcher":"Abrir Selector de L\xEDngua",Dictionary:"Dicion\xE1rio",Cut:"Cortar",Copy:"Copiar",Paste:"Colar","Show Synonyms":"Mostrar Sin\xF3nimos","Look up":"Procurar","Reset to default":"Reinicializa\xE7\xE3o por defeito","Dictionary Settings":"Configura\xE7\xF5es de Dicion\xE1rio",Language:"L\xEDngua","The Language the Plugin will use to search for Definitions and Pronunciations.":"A L\xEDngua que o Plugin utilizar\xE1 para pesquisar Defini\xE7\xF5es e Pron\xFAncias.","Synonym Suggestions":"Sugest\xF5es de Sin\xF3nimos","Show synonyms for highlighted words":"Mostrar sin\xF3nimos para palavras em destaque","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"A habilita\xE7\xE3o permitir\xE1 ao Plugin analisar as frases completas para melhor sugerir sin\xF3nimos com base no contexto.","Click ":"Clicar ",here:"aqui"," for Privacy Concerns.":" por Quest\xF5es de Privacidade.","Advanced Synonym Search":"Pesquisa Avan\xE7ada de Sin\xF3nimos","Show Options in Context Menu":"Mostrar Op\xE7\xF5es no Menu de Contexto","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"Permitir Menu de Contexto personalizado com op\xE7\xF5es para procurar sin\xF3nimos (apenas se as sugest\xF5es autom\xE1ticas estiverem desactivadas) e procurar uma defini\xE7\xE3o completa na Barra Lateral. Advert\xEAncia: Isto substituir\xE1


", coeff: 1.55}, "Blast Damage": {elem: "col", coeff: 0.3}},
    },
  },
  graspofthedead: {
    id: "grasp-of-the-dead",
    name: "Grasp of the Dead",
    category: "secondary",
    row: 1,
    col: 0,
    runes: {
      c: "Unbreakable Grasp",
      a: "Groping Eels",
      e: "Death Is Life",
      d: "Desperate Grasp",
      b: "Rain of Corpses",
    },
    info: function(rune, stats) {
      var res;
      switch (rune) {
      case "x": res = {"Damage": {elem: "phy", coeff: 7.6, total: true}}; break;
      case "c": res = {"Damage": {elem: "col", coeff: 5.6, total: true}}; break;
      case "a": res = {"Damage": {elem: "phy", coeff: 13.6, total: true}}; break;
      case "e": res = {"Damage": {elem: "psn", coeff: 5.6, total: true}}; break;
      case "d": res = {"Damage": {elem: "psn", coeff: 5.6, total: true}}; break;
      case "b": res = {"Damage": {elem: "phy", coeff: 5.6, total: true}, "Corpse Damage": {elem: "phy", coeff: 4.2, total: true}}; break;
      }
      if (stats.leg_deadlyrebirth && rune !== "b") {
        res["Corpse Damage"] = {elem: res["Damage"].elem, coeff: 4.2, total: true};
      }
      var toex = {};
      if (rune !== "c") toex["Cost"] = {cost: 150};
      if (!stats.leg_wilkensreach) toex["Cooldown"] = {cooldown: (rune === "d" ? 4 : 8)};
      return $.extend(toex, res);
    },
  },
  firebats: {
    id: "firebats",
    name: "Firebats",
    category: "secondary",
    row: 1,
    col: 1,
    runes: {
      a: "Dire Bats",
      d: "Vampire Bats",
      c: "Plague Bats",
      b: "Hungry Bats",
      e: "Cloud of Bats",
    },
    range: {x: 28, a: 28, d: 28, c: 28, b: 60, e: 15},
    params: [{rune: "e", min: 0, max: 5, val: 5, step: 0.5, name: "Channeled for", buffs: false},
             {rune: "c", min: 0, max: 3, val: 3, step: 0.5, name: "Channeled for", buffs: false}],
    info: function(rune, stats) {
      var res;
      switch (rune) {
      case "x": res = {"Tick Damage": {elem: "fir", coeff: 4.75, divide: {"Base Speed": 2}}}; break;
      case "a": res = {"Channeling Cost": {cost: 125, fpa: 60}, "DPS": {sum: true, "Tick Damage": {speed: 1, fpa: 60}}, "Tick Damage": {elem: "fir", coeff: 5}}; break;
      case "d": res = {"Cost": {cost: 250}, "Channeling Cost": null, "Tick Damage": {elem: "phy", coeff: 4.75, divide: {"Base Speed": 2}}, "Cost": {cost: 225}, "Channeling Cost": null}; break;
      case "c": res = {"Tick Damage": {elem: "psn", coeff: 4.75, divide: {"Base Speed": 2}, percent: {"Channeling": "$2*51.5/3"}}}; break;
      case "b": res = {"Tick Damage": {elem: "fir", coeff: 7.5, divide: {"Base Speed": 2}}}; break;


8h
        .inst 0x6e41ec6b // bfmmla v11.4s, v3.8h, v1.8h
        .inst 0x6e40ec8c // bfmmla v12.4s, v4.8h, v0.8h
        .inst 0x6e41ec8d // bfmmla v13.4s, v4.8h, v1.8h
        .inst 0x6e40ecae // bfmmla v14.4s, v5.8h, v0.8h
        .inst 0x6e41ecaf // bfmmla v15.4s, v5.8h, v1.8h
        .inst 0x6e40ecd0 // bfmmla v16.4s, v6.8h, v0.8h
        .inst 0x6e41ecd1 // bfmmla v17.4s, v6.8h, v1.8h
        .inst 0x6e40ecf2 // bfmmla v18.4s, v7.8h, v0.8h
        .inst 0x6e41ecf3 // bfmmla v19.4s, v7.8h, v1.8h
        ld1 {v0.8h, v1.8h}, [x2],  #32               // B: 4 * 4 * sizeof(int16_t)
        .inst 0x6e40ec54 // bfmmla v20.4s, v2.8h, v0.8h
        .inst 0x6e41ec55 // bfmmla v21.4s, v2.8h, v1.8h
        .inst 0x6e40ec76 // bfmmla v22.4s, v3.8h, v0.8h
        .inst 0x6e41ec77 // bfmmla v23.4s, v3.8h, v1.8h
        .inst 0x6e40ec98 // bfmmla v24.4s, v4.8h, v0.8h
        .inst 0x6e41ec99 // bfmmla v25.4s, v4.8h, v1.8h
        .inst 0x6e40ecba // bfmmla v26.4s, v5.8h, v0.8h
        .inst 0x6e41ecbb // bfmmla v27.4s, v5.8h, v1.8h
        .inst 0x6e40ecdc // bfmmla v28.4s, v6.8h, v0.8h
        .inst 0x6e41ecdd // bfmmla v29.4s, v6.8h, v1.8h
        .inst 0x6e40ecfe // bfmmla v30.4s, v7.8h, v0.8h
        .inst 0x6e41ecff // bfmmla v31.4s, v7.8h, v1.8h
        subs x12, x12, #1
        bgt LoopL
    LoopLEnd:
        uzp1 v7.2d, v8.2d, v9.2d
        uzp2 v8.2d, v8.2d, v9.2d
        uzp1 v9.2d, v10.2d, v11.2d
        uzp2 v10.2d, v10.2d, v11.2d
        uzp1 v11.2d, v12.2d, v13.2d
        uzp2 v12.2d, v12.2d, v13.2d
        uzp1 v13.2d, v14.2d, v15.2d
        uzp2 v14.2d, v14.2d, v15.2d
        uzp1 v15.2d, v16.2d, v17.2d
        uzp2 v16.2d, v16.2d, v17.2d
        uzp1 v17.2d, v18.2d, v19.2d
        uzp2 v18.2d, v18.2d, v19.2d
        uzp1 v19.2d, v20.2d, v21.2d


3) as i32 - ry;
        // clip it
        let minx = rx.max(0);
        let miny = ry.max(0);
        let maxx = (rx + rw).min(con.get_width() as i32);
        let maxy = (ry + rh).min(con.get_height() as i32);
        let invscalex = 1.0 / scalex;
        let invscaley = 1.0 / scaley;
        let con_width = con.get_pot_width();
        let back = con.borrow_mut_background();
        if let Some(ref img) = self.img {
            for cx in minx..maxx {
                for cy in miny..maxy {
                    // map the console pixel to the image world
                    let ix =
                        (iw + (cx as f32 - x) * newx_x + (cy as f32 - y) * (-newy_x)) * invscalex;
                    let iy =
                        (ih + (cx as f32 - x) * (newx_y) - (cy as f32 - y) * newy_y) * invscaley;
                    let color = if ix as i32 >= size.0 as i32
                        || ix < 0.0
                        || iy as i32 >= size.1 as i32
                        || iy < 0.0
                    {
                        (0, 0, 0, 255)
                    } else {
                        let pixel = img.get_pixel(ix as u32, iy as u32);
                        (pixel[0], pixel[1], pixel[2], pixel[3])
                    };
                    if let Some(ref t) = transparent {
                        if color == *t {
                            continue;
                        }
                    }
                    let offset = (cx as u32 + cy as u32 * con_width) as usize;
                    if scalex < 1.0 || scaley < 1.0 {
                        // todo mipmap
                    }
                    back[offset] = color;
                }
            }
        }
    }

    /// blit an image on the console, using the subcell characters to achieve twice the normal resolution.
    /// This uses the CHAR_SUBCELL_* ascii codes (from 226 to 232):
    ///
    /// ![subcell_chars](https://raw.githubusercontent.com/jice-nospam/doryen-rs/master/docs/subcell/subcell.png)
    ///
    /// Comparison before/after subcell in the chronicles of Doryen :
    ///
    /// ![subcell_comp](https://raw.githubusercontent.com/jice-nospam/doryen-rs/master/docs/subcell/subcell_comp.png)
    ///
    /// Pyromancer! screenshot, making full usage of subcell resolution:
    ///
    /// ![subcell_pyro](https://raw.githubusercontent.com/jice-nospam/doryen-rs/master/docs/subcell/subcell_pyro.png)
    pub fn blit_2x(
        &mut self,
        con: &mut Console,
        dx: i32,
        dy: i32,
        sx: i32,
        sy: i32,
        w: Option<i32>,
        h: Option<i32>,
        transparent: Option<Color>,
    ) {
        if !self.try_load() {
            return;
        }
        if let Some(ref img) = self.img {
            Image::blit_2x_image(img, con, dx, dy, sx, sy, w, h, transparent);
        }
    }
    /// blit an image on a console. See [`Image::blit_2x`]
    pub fn blit_2x_image(
        img: &image::RgbaImage,
        con: &mut Console,
        dx: i32,
        dy: i32,
        sx: i32,
        sy: i32,
        w: Option<i32>,
        h: Option<i32>,
        transparent: Option<Color>,
    ) {
        let mut grid: [Color; 4] = [(0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0)];
        let mut back: Color = (0, 0, 0, 0


# Second moment
                    beta1 = 0.9  # Adam beta1
                    beta2 = 0.95  # Adam beta2
                    eps = 1e-6  # Adam epsilon
                    step = 0  # Adam step counter

                    # print(f"DEBUG - ptuning_params created: {self.ptuning_params.shape}, {self.ptuning_params.dtype}") # Removed

                    # 使用简单的sign SGD (注释保留，但实际是Adam)
                    weight_decay = 1e-5  # 权重衰减率

                    # 运行优化步骤
                    for step in range(chot_steps):
                        # print(f"\nDEBUG - Optimization step {step+1}/{chot_steps}") # Removed
                        # 保存原始hidden_states副本
                        hidden_states_orig = hidden_or_intermediate_states.clone()

                        print(f"DEBUG - hidden_states_orig: {hidden_states_orig.shape}, {hidden_states_orig.dtype}") # Removed

                        # 应用ptuning参数 (直接计算，避免中间变量)
                        # print(f"DEBUG - patched_hidden_states: {patched_hidden_states.shape}, {patched_hidden_states.dtype}") # Removed (变量已优化掉)

                        # 前向传播计算logits
                        # print("DEBUG - Computing logits for loss calculation") # Removed
                        # try:
                            # TODO: BUGS
                        # temp_logits = self.model.compute_logits(
                        #     hidden_states_orig + self.ptuning_params,
                        #     None
                        # )
                        # except Exception as e:
                        #     print(f"DEBUG - Error in compute_logits: {e}") # Removed
                        #     # 释放克隆的张量以防出错
                        #     del hidden_states_orig
                        #     raise

                        hidden_states_cur = hidden_states_orig + self.ptuning_params
                        # print("Using Normalization")
                        # import torch.nn.functional as F
                        # hidden_states_cur = F.normalize(hidden_states_cur, p=2, dim=-1)

                        # lm_local = "/storage/qiguojunLab/fangxueji/Projects/nips25/LongRL_causvid/DeepSeek-R1-Distill-Qwen-32B_lm_head.pt"
                        lm_local = os.environ.get("lm_local")
                        print(f"Loading lm_local from: {lm_local}")
                        lm_head_weight = torch.load(lm_local, map_location=hidden_states_cur.device).to(dtype=torch.bfloat16)

                        temp_logits = hidden_states_cur @ lm_head_weight.T # self.model.lm_head.weight.T
                        # print(f"temp_logits: {temp_logits}")

                        # print(f"DEBUG - temp_logits: {temp_logits.shape}, {temp_logits.dtype}") # Removed

                        # 准备计算交叉熵损失
                        target_tokens = model_input.input_tokens
                        # print(f"DEBUG - target_tokens: {target_tokens.shape}, {target_tokens.dtype}") # Removed

                        # 根据实际输出调整形状处理
                        # 检查logits的维度
                        # print(f"DEBUG - Checking logits dimensions: {len(temp_logits.shape)}") # Removed
                        if len(temp_logits.shape) == 3:  # [batch_size, seq_len, vocab_size]
                            # print("DEBUG - Processing 3D logits") # Removed
                            shift_logits = temp_logits[..., :-1, :].contiguous()
                            shift_labels = target_tokens[..., 1:].contiguous()
                            batch_size = shift_logits.size(0)
                            seq_length = shift_logits.size(1)
                            vocab_size = shift_logits.size(2)
                        elif len(temp_logits.shape) == 2:  # [seq_len, vocab_size]
                            # print("DEBUG - Processing 2D logits") # Removed
                            # 已经是展平的形式
                            seq_len = temp_logits.size(0)
                            vocab_size = temp_logits.size(1)

                            # 调整为能够匹配的尺寸
                            shift_logits = temp_logits[:-1, :].contiguous()
                            shift_labels = target_tokens[1:].contiguous()

                            # 扁平化处理 (没有batch维度)
                            batch_size = 1
                            seq_length = shift_logits.size(0)


AD8 05E0FFFB */  bltz  $t7, .L80023AC8
/* A9AC7C 80023ADC 00000000 */   nop
.L80023AE0:
/* A9AC80 80023AE0 A0AF0001 */  sb    $t7, 1($a1)
/* A9AC84 80023AE4 9087018A */  lbu   $a3, 0x18a($a0)
/* A9AC88 80023AE8 44CEF800 */  ctc1  $t6, $31
/* A9AC8C 80023AEC 44878000 */  mtc1  $a3, $f16
/* A9AC90 80023AF0 04E10005 */  bgez  $a3, .L80023B08
/* A9AC94 80023AF4 468084A0 */   cvt.s.w $f18, $f16
/* A9AC98 80023AF8 3C014F80 */  li    $at, 0x4F800000 # 0.000000
/* A9AC9C 80023AFC 44814000 */  mtc1  $at, $f8
/* A9ACA0 80023B00 00000000 */  nop
/* A9ACA4 80023B04 46089480 */  add.s $f18, $f18, $f8
.L80023B08:
/* A9ACA8 80023B08 90980192 */  lbu   $t8, 0x192($a0)
/* A9ACAC 80023B0C 240B0001 */  li    $t3, 1
/* A9ACB0 80023B10 0307C823 */  subu  $t9, $t8, $a3
/* A9ACB4 80023B14 44993000 */  mtc1  $t9, $f6
/* A9ACB8 80023B18 00000000 */  nop
/* A9ACBC 80023B1C 468032A0 */  cvt.s.w $f10, $f6
/* A9ACC0 80023B20 46005102 */  mul.s $f4, $f10, $f0
/* A9ACC4 80023B24 46049400 */  add.s $f16, $f18, $f4
/* A9ACC8 80023B28 444AF800 */  cfc1  $t2, $31
/* A9ACCC 80023B2C 44CBF800 */  ctc1  $t3, $31
/* A9ACD0 80023B30 00000000 */  nop
/* A9ACD4 80023B34 46008224 */  cvt.w.s $f8, $f16
/* A9ACD8 80023B38 444BF800 */  cfc1  $t3, $31
/* A9ACDC 80023B3C 00000000 */  nop
/* A9ACE0 80023B40 316B0078 */  andi  $t3, $t3, 0x78
/* A9ACE4 80023B44 11600012 */  beqz  $t3, .L80023B90
/* A9ACE8 80023B48 3C014F00 */   li    $at, 0x4F000000 # 0.000000
/* A9ACEC 80023B4C 44814000 */  mtc1  $at, $f8
/* A9ACF0 80023B50 240B0001 */  li    $t3, 1
/* A9ACF4 80023B54 46088201 */  sub.s $f8, $f16, $f8
/* A9ACF8 80023B58 44CBF800 */  ctc1  $t3, $31
/* A9ACFC 80023B5C 00000000 */  nop
/* A9AD00 80023B60 46004224 */  cvt.w.s $f8, $f8
/* A9AD04 80023B64 444BF800 */  cfc1  $t3, $31
/* A9AD08 80023B68 00000000 */  nop
/* A9AD0C 80023B6C 316B0078 */  andi  $t3, $t3, 0x78
/* A9AD10 80023B70 15600005 */  bn


 rgb(255, 255, 255); border-bottom-color: rgb(217, 217, 214); border-bottom-width: 1px; border-bottom-style: solid; display: none; position: absolute;
}
.ups-headerTools_list .ups-headerTools_widgets > li > a {
	outline-offset: -2px;
}
.ups-headerTools_list .ups-headerTools_links > li > a {
	outline-offset: -2px;
}
.ups-headerTools_msg {
	background: rgba(53, 28, 21, 0.95); padding: 15px 20px;
}
.ups-headerTools_msg h3 {
	font: 1.1em/1.5 Tahoma, helvetica, arial, sans-serif; margin: 0px; font-size-adjust: none; font-stretch: normal;
}
.ups-headerTools_msg a {
	color: rgb(255, 181, 0); text-decoration: underline; transition-property: all; transition-duration: 0.2s; -moz-transition-property: all; -o-transition-property: all; -webkit-transition-property: all; -moz-transition-duration: .2s; -o-transition-duration: .2s; -webkit-transition-duration: .2s;
}
.no-touch .ups-headerTools_msg a:hover {
	color: rgb(255, 255, 255);
}
.no-touch .ups-headerTools_msg a:focus {
	color: rgb(255, 255, 255);
}
.ups-headerTools_widgets {
	font: 1.1em/1.5 Tahoma, helvetica, arial, sans-serif; list-style: none; margin: 0px; padding: 0px; font-size-adjust: none; font-stretch: normal;
}
.ups-headerTools_widgets li {
	background: rgba(53, 28, 21, 0.9); border-top-color: rgb(217, 217, 214); border-top-width: 1px; border-top-style: solid;
}
.ups-headerTools_widgets li .ups-toolWrap {
	height: 0px; overflow: hidden;
}
.ups-headerTools_widgets li .ups-tool {
	right: 100%; visibility: hidden; position: relative; transition-property: right; transition-duration: 0.3s; -moz-transition-property: right; -o-transition-property: right; -webkit-transition-property: right; -moz-transition-duration: 0.3s; -o-transition-duration: 0.3s; -webkit-transition-duration: 0.3s;
}
.ups-headerTools_widgets li .ups-reqMsg {
	margin: 0px 20px 10px;
}
.ups-headerTools_widgets li.ups-active {
	background: rgb(255, 255, 255);
}
.ups-headerTools_widgets li.ups-active .ups-headerTools_widgetToggle {
	background: rgb(255, 255, 255); color: rgb(53, 28, 21); border-left-color: rgb(217, 217, 214); border-left-width: 1px; border-left-style: solid; position: relative; z-index: 1;
}
.no-touch .ups-headerTools_widgets li.ups-active .ups-headerTools_widgetToggle:hover {
	background: rgb(255, 255, 255);
}
.no-touch .ups-headerTools_widgets li.ups-active .ups-headerTools_widgetToggle:focus {
	background: rgb(255, 255, 255);
}
@media all and (max-width:767px)
{
.no-touch .ups-headerTools_widgets li.ups-active .ups-headerTools_widgetToggle:hover {
	background: rgba(53, 28, 21, 0.9);
}
.no-touch .ups-headerTools_widgets li.ups-active .ups-headerTools_widgetToggle:focus {
	background: rgba(53, 28, 21, 0.9);
}
}
.ups-headerTools_widgets li.ups-active .ups-toolWrap {
	left: 100%; top: 0px; widt


                      imgpaths_per_class[classname][anomaly] = imgpaths_per_class[
                            classname
                        ][anomaly][:train_val_split_idx]
                    elif self.split == DatasetSplit.VAL:
                        imgpaths_per_class[classname][anomaly] = imgpaths_per_class[
                            classname
                        ][anomaly][train_val_split_idx:]

                # if self.split == DatasetSplit.TEST and anomaly != "good":
                if self.split == DatasetSplit.TEST and "good" not in anomaly:
                    anomaly_mask_path = os.path.join(maskpath, anomaly)
                    anomaly_mask_files = sorted(os.listdir(anomaly_mask_path))
                    maskpaths_per_class[classname][anomaly] = [
                        os.path.join(anomaly_mask_path, x) for x in anomaly_mask_files
                    ]
                else:
                    # maskpaths_per_class[classname]["good"] = None
                    maskpaths_per_class[classname][anomaly] = None

        # Unrolls the data dictionary to an easy-to-iterate list.
        data_to_iterate = []
        for classname in sorted(imgpaths_per_class.keys()):
            for anomaly in sorted(imgpaths_per_class[classname].keys()):
                for i, image_path in enumerate(imgpaths_per_class[classname][anomaly]):
                    data_tuple = [classname, anomaly, image_path]
                    # if self.split == DatasetSplit.TEST and anomaly != "good":
                    if self.split == DatasetSplit.TEST and "good" not in anomaly:
                        data_tuple.append(maskpaths_per_class[classname][anomaly][i])
                    else:
                        data_tuple.append(None)
                    data_to_iterate.append(data_tuple)

        return imgpaths_per_class, data_to_iterate


pe().equals("sc")) {
	//
	//			this.findDefaultAllImgTByImgName(this.getImgName());
	//		} else {
	//			if (Validate.StrisNull(this.getQuery())) {
	//				return "json";
	//			} else {
	//				return "json";
	//			}
	//		}
	//
	//		return "json";
	//	}

	//	public void findDefaultAllImgTByImgName(String imgName) {
	//		int currentPage = page;
	//		int lineSize = rp;
	//		total = this.getImgTServiceImpl().countfindAllImgTByImgName(imgName);
	//		if (Validate.StrNotNull(sortname) && Validate.StrNotNull(sortorder)) {
	//			String queryString = "from ImgT order by " + sortname + " " + sortorder + "";
	//			List<ImgT> list = this.getImgTServiceImpl().sortAllImgT(currentPage, lineSize, queryString);
	//			if (list != null) {
	//				this.ProcessImgTList(list);
	//			}
	//		}
	//	}
	//
	//	public void ProcessImgTList(List<ImgT> list) {
	//		rows.clear();
	//		for (Iterator it = list.iterator(); it.hasNext();) {
	//			ImgT itt = (ImgT) it.next();
	//			Map<String, Object> cellMap = new HashMap<String, Object>();
	//			cellMap.put("id", itt.getImgId());
	//			cellMap.put("cell", new Object[] { "<input id='id' name='firstcol' class='firstimgtid' type='checkbox' value='" + itt.getImgId() + "'/>", "" + itt.getUsedGoodsname() + "", itt.getUsedPositionName() });
	//			rows.add(cellMap);
	//		}
	//
	//	}
}
package com.jshop.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.jshop.dao.JshopbasicInfoTDao;
import com.jshop.dao.impl.JshopbasicInfoTDaoImpl;
import com.jshop.entity.JshopbasicInfoT;
import com.jshop.service.JshopbasicInfoTService;
@Service("jshopbasicInfoTService")
@Scope("prototype")
public class JshopbasicInfoTServiceImpl implements JshopbasicInfoTService {

	private JshopbasicInfoTDao jshopbasicInfoTDao;

	public JshopbasicInfoTDao getJshopbasicInfoTDao() {
		return jshopbasicInfoTDao;
	}

	public void setJshopbasicInfoTDao(JshopbasicInfoTDao jshopbasicInfoTDao) {
		this.jshopbasicInfoTDao = jshopbasicInfoTDao;
	}

	public int delJshopbasicInfo(String[] list, String creatorid) {
		return this.getJshopbasicInfoTDao().delJshopbasicInfo(list, creatorid);
	}

	public int updateJshopbasicInfo(JshopbasicInfoT jbit) {
		return this.getJshopbasicInfoTDao().updateJshopbasicInfo(jbit);
	}

	public int addJshopbasicInfoT(


获得root权限。
首先，确保安装了带有漏洞的bash版本，并让/bin/sh 指向/bin/bash.
```sh
$ sudo ln -sf /bin/bash /bin/sh
```
请编译下面这段代码，并设置其为Set-UID程序，保证它的所有者是root。我们知道system()函数将调用"/bin/sh -c" 来运行指定的命令, 这也意味着/bin/bash 会被调用，你能够利用shellshock漏洞来获取权限么？
```
#include <stdio.h>
void main()
{
	setuid(geteuid()); // make real uid = effective uid.
	system("/bin/ls -l");
}
```
我们注意到这里使用了setuid(geteuid())  来使real uid = effective uid，这在Set-UID程序中不是普遍实践，但它确实有时会发生。
先自己试着hack一下：）
……
……
……
……
……
……
以下是hack过程。
![](http://i.imgur.com/piN0V4s.png)

如果 setuid(geteuid()) 语句被去掉了，再试试看攻击，我们还能够拿到权限么？
```
#include <stdio.h>
void main()
{
	system("/bin/ls -l");
}
```
 ![](http://i.imgur.com/u1R0Vej.png)
 (hack过程与step1完全一样，sh0ck是编译后的程序)

失败啦！这就说明如果 real uid 和 effective uid 相同的话，定义在环境变量中的内容在该程序内有效，那样shellshock漏洞就能够被利用了。但是如果两个uid不同的话，环境变量失效，就无法发动攻击了，这可以从bash的源代码中得到印证（variables.c,在308到369行之间）请指出是哪一行导致了这样的不同，并说明bash这样设计的原因。

这里给出这部分代码
```
/* Initialize the shell variables from the current environment.
   If PRIVMODE is nonzero, don't import functions from ENV or
   parse $SHELLOPTS. */
void
initialize_shell_variables (env, privmode)
     char **env;
     int privmode;
{
  char *name, *string, *temp_string;
  int c, char_index, string_index, string_length;
  SHELL_VAR *temp_var;

  create_variable_tables ();

  for (string_index = 0; string = env[string_index++]; )
    {

      char_index = 0;
      name = string;
      while ((c = *string++) && c != '=')
  ;
      if (string[-1] == '=')
  char_index = string - name - 1;

      /* If there are weird things in the environment, like `=xxx' or a