@param ir the IR, assumed to be in SSA form
   */
  public static void printInstructions(IR ir) {
    SSADictionary dictionary = ir.HIRInfo.dictionary;
    System.out.println("********* START OF IR DUMP in SSA FOR " + ir.method);
    for (Enumeration<BasicBlock> be = ir.forwardBlockEnumerator(); be.hasMoreElements();) {
      BasicBlock bb = be.nextElement();
      // print the explicit instructions for basic block bb
      for (Enumeration<Instruction> e = dictionary.getAllInstructions(bb); e.hasMoreElements();) {
        Instruction s = e.nextElement();
        System.out.print(s.getBytecodeIndex() + "\t" + s);
        if (dictionary.defsHeapVariable(s) && s.operator() != PHI) {
          System.out.print("  (Implicit Defs: ");
          HeapOperand<?>[] defs = dictionary.getHeapDefs(s);
          if (defs != null) {
            for (HeapOperand<?> def : defs) System.out.print(def + " ");
          }
          System.out.print(" )");
        }
        if (dictionary.usesHeapVariable(s) && s.operator() != PHI) {
          System.out.print("  (Implicit Uses: ");
          HeapOperand<?>[] uses = dictionary.getHeapUses(s);
          if (uses != null) {
            for (HeapOperand<?> use : uses) System.out.print(use + " ");
          }
          System.out.print(" )");
        }
        System.out.println();
      }
    }
    System.out.println("*********   END OF IR DUMP in SSA FOR " + ir.method);
  }

  /**
   * Create a move instruction r1 := r2.

   *
   * TODO: This utility function should be moved elsewhere.
   *
   * @param ir the governing ir
   * @param r1 the destination
   * @param r2 the source
   * @param t the type of r1 and r2.
   * @return the created move instruction
   */
  static Instruction makeMoveInstruction(IR ir, Register r1, Register r2, TypeReference t) {
    Operator mv = IRTools.getMoveOp(t);
    RegisterOperand o1 = new RegisterOperand(r1, t);
    RegisterOperand o2 = new RegisterOperand(r2, t);
    Instruction s = Move.create(mv, o1, o2);
    s.setSourcePosition(SSA_SYNTH_BCI, ir.getGc().getInlineSequence());
    return s;
  }

  /**
   * Create a move instruction r1 := c.

   *
   * !!TODO: put this functionality elsewhere.
   *
   * @param ir the governing ir
   * @param r1 the destination
   * @param c the source
   * @return the created move instruction
   */
  static Instruction makeMoveInstruction(IR ir, Register r1, ConstantOperand c) {
    Operator mv = IRTools.getMoveOp(c.getType());
    RegisterOperand o1 = new RegisterOperand(r1, c.getType());
    Operand o2 = c.copy();
    Instruction s = Move.create(mv, o1, o2);
    s.setSourcePosition(SSA_SYNTH_BCI, ir.getGc().getInlineSequence());
    return s;
  }

  /**
   * Fix up any PHI instructions in the given target block to reflect that
   * the given source block is no longer a predecessor of target.
   * The basic algorithm is to erase the PHI operands related to the edge
   * from source to target by sliding the other PHI operands down as required.
   *
   * @param source the source block to remove from PHIs in target
   * @param target the target block that may contain PHIs to update.
   */
  static void purgeBlockFromPHIs(BasicBlock source, BasicBlock tar


                  ),
                )
              ],
            ),
    ));
  }
}
import 'package:flame/components.dart';
import 'package:flutter/material.dart';
import 'package:flame/effects.dart';
import '../../ludo.dart';
import '../../state/game_state.dart';
import '../../component/ui_components/dice_pointer.dart';
// user files
import 'controller_block.dart';

class UpperController extends RectangleComponent with HasGameReference<Ludo> {
  final RectangleComponent leftArrow;
  final RectangleComponent rightArrow;

  UpperController({
    required double width,
    required double height,
    Vector2? position, // Add position parameter
  })  : leftArrow = RectangleComponent(
          size: Vector2(width * 0.45 * 0.3, height * 0.8),
          position: Vector2(width * 0.45 * 0.8, width * 0.45 * 0.05),
          paint: Paint()..color = Colors.transparent,
        ),
        rightArrow = RectangleComponent(
          size: Vector2(width * 0.45 * 0.3, height * 0.8),
          position: Vector2(width * 0.45 * 0.975, width * 0.45 * 0.05),
          paint: Paint()..color = Colors.transparent,
        ),
        super(
          size: Vector2(width, height),
          paint: Paint()..color = Colors.transparent, // Adjust color as needed
        ) {
    final double innerWidth = width * 0.45; // Width of the inner rectangles
    final double innerHeight = height; // Same height as the outer rectangle

    final leftToken = RectangleComponent(
        size: Vector2(innerWidth * 0.4, innerHeight * 0.8),
        position: Vector2(2.2, innerWidth * 0.05), // Sticks to the left
        paint: Paint()..color = GameState().red,
        children: [
          ControllerBlock(
              transparentRight: true,
              transparentLeft: false,
              size: Vector2(innerWidth * 0.4, innerHeight * 0.8),
              position: Vector2(0, 0),
              paint: Paint()
                ..color = Colors.black
                ..style = PaintingStyle.stroke
                ..strokeWidth = 1.0
                ..color = const Color(0xFF03346E),
              children: []),
        ]);

    final leftDice = RectangleComponent(
        size: Vector2(innerWidth * 0.4, innerHeight),
        position: Vector2(innerWidth * 0.4, 0), // Sticks to the left
        paint: Paint()..color = GameState().red,
        children: [
          RectangleComponent(
              size: Vector2(innerWidth * 0.4, innerHeight),
              paint: Paint()
                ..color = Colors.transparent
                ..style = PaintingStyle.stroke
                ..strokeWidth = 4.0
                ..color = const Color(0xFF03346E),
              children: [
                RectangleComponent(
                    position: Vector2(innerWidth * 0.20, innerHeight * 0.5)),
              ]),
        ] // Adjust color as needed
        );

    final rightDice = RectangleComponent(
        size: Vector2(innerWidth * 0.4, innerHeight),
        position: Vector2(width - innerWidth * 0.8, 0), // Sticks to the right
        paint: Paint()..color = GameState().green,
        children: [
          RectangleComponent(
              size: Vector2(innerWidth * 0.4, innerHeight),
              paint: Paint()
                ..color = Colors.transparent
                ..style = PaintingStyle.stroke
                ..strokeWidth = 4.0
                ..color = const Color(0xFF03346E),
              children: [
                RectangleComponent(
                    position: Vector2(innerWidth * 0.20, innerHeight * 0.5)),


->>R的顺序打开文件夹，你会在R文件夹中看到好几个.r格式的文件。用source()函数载入进来就可以用了。

方案二：

拿着mgarch包，按照开发R程序包之忍者篇自己编译mgarch包。

方案三:

这个方案跟方案二类似，也得先安装Rtools，目的是可以编译源代码。同时，由于mgarch依赖于zoo、tseries、mvnorm三个支撑包，所以，也得捎带手安装一下，并保证它们被升级了到合适的版本。接着，将mgarch_0.00-1.tar.gz放到当前工作文件夹中（不知道当前工作文件夹是哪个？看方案一）。最后，敲入下面的代码：

install.packages("mgarch_0.00-1.tar.gz",repos=NULL,type="source")  ##安装源代码文件
library(mgarch)   ##查看是否可以使用

---
title: 有用但不易被发现的R函数：file.choose
author: MatrixSpk
date: '2013-06-03'
slug: useful-functions-in-R
categories:
- R
tags:
- file.choose
- R
---

用R进行数据分析的时候，常常需要从外部载入数据或者函数。比如，我们有一个名为example.txt的数据位于E盘中的R文件夹中，我们可以用下面的命令把数据读取到R里：

dat = read.table("E://R/example.txt",header=TRUE)

在同样的文件夹中，有一个现成的函数脚本文件命名为fun.r，现在需要将其载入到R中使用。可以用下面的命令:

soure("E://R/fun.r&


oftware),
      handle_messages_scheduled_(false),
      currently_processing_message_(NULL),
      num_stubs_descheduled_(0),
      allow_future_sync_points_(allow_future_sync_points),
      weak_factory_(this) {
  DCHECK(gpu_channel_manager);
  DCHECK(client_id);

  channel_id_ = IPC::Channel::GenerateVerifiedChannelID("gpu");
  const base::CommandLine* command_line =
      base::CommandLine::ForCurrentProcess();
  log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
}

GpuChannel::~GpuChannel() {
  STLDeleteElements(&deferred_messages_);
  if (preempting_flag_.get())
    preempting_flag_->Reset();
}

void GpuChannel::Init(base::MessageLoopProxy* io_message_loop,
                      base::WaitableEvent* shutdown_event) {
  DCHECK(!channel_.get());

  // Map renderer ID to a (single) channel to that process.
  channel_ = IPC::SyncChannel::Create(channel_id_,
                                      IPC::Channel::MODE_SERVER,
                                      this,
                                      io_message_loop,
                                      false,
                                      shutdown_event);

  filter_ =
      new GpuChannelMessageFilter(weak_factory_.GetWeakPtr(),
                                  gpu_channel_manager_->sync_point_manager(),
                                  base::MessageLoopProxy::current(),
                                  allow_future_sync_points_);
  io_message_loop_ = io_message_loop;
  channel_->AddFilter(filter_.get());

  devtools_gpu_agent_.reset(new DevToolsGpuAgent(this));
}

std::string GpuChannel::GetChannelName() {
  return channel_id_;
}

#if defined(OS_POSIX)
base::ScopedFD GpuChannel::TakeRendererFileDescriptor() {
  if (!channel_) {
    NOTREACHED();
    return base::ScopedFD();
  }
  return channel_->TakeClientFileDescriptor();
}
#endif  // defined(OS_POSIX)

bool GpuChannel::OnMessageReceived(const IPC::Message& message) {
  if (log_messages_) {
    DVLOG(1) << "received message @" << &message << " on channel @" << this
             << " with type " << message.type();
  }

  if (message.type() == GpuCommandBufferMsg_WaitForTokenInRange::ID ||
      message.type() == GpuCommandBufferMsg_WaitForGetOffsetInRange::ID) {
    // Move Wait commands to the head of the queue, so the renderer
    // doesn't have to wait any longer than necessary.
    deferred_messages_.push_front(new IPC::Message(message));
  } else {
    deferred_messages_.push_back(new IPC::Message(message));
  }

  OnScheduled();

  return true;
}

void GpuChannel::OnChannelError() {
  gpu_channel_manager_->RemoveChannel(client_id_);
}

bool GpuChannel::Send(IPC::Message* message) {
  // The GPU process must never send a synchronous IPC message to the renderer
  // process. This could result in deadlock.
  DCHECK(!message->is_sync());
  if (log_messages_) {
    DVLOG(1) << "sending message @" << message << " on channel @" << this
             << " with type " << message->type();
  }

  if (!channel_) {
    delete message;
    return false;
  }

  return channel_->Send(message);
}

void GpuChannel::RequeueMessage() {
  DCHECK(currently_processing_message_);
  deferred_messages_.push_front(
      new IPC::Message(*currently_processing_message_));
  messages_processed_--;
  currently_processing_message_ = NULL;
}

void GpuChannel::OnScheduled() {
  if (handle_messages_scheduled_)
    return;
  // Post a task to handle any


ss = KratosProcessFactory(model).ConstructListOfProcesses(output_proc_params["dummy"])[0]

        # create mapper
        if model_part_origin.IsDistributed():
            from KratosMultiphysics.MappingApplication.MPIExtension import MPIMapperFactory

            self.mapper = MPIMapperFactory.CreateMapper(
                model_part_origin,
                self.model_part_destination,
                settings["mapper_settings"])
        else:
            self.mapper = KM.MapperFactory.CreateMapper(
                model_part_origin,
                self.model_part_destination,
                settings["mapper_settings"])

    def ExecuteFinalizeSolutionStep(self):
        defaults = KM.Parameters('''{
            "variable_origin"      : "UNSPECIFIED",
            "variable_destination" : "UNSPECIFIED",
            "mapping_options" : []
        }''')

        for mapping_params in self.settings["mapping_settings"]:
            mapping_params.ValidateAndAssignDefaults(defaults)

            variable_origin = KM.KratosGlobals.GetVariable(mapping_params["variable_origin"].GetString())
            variable_destination = KM.KratosGlobals.GetVariable(mapping_params["variable_destination"].GetString())
            mapper_flags = GetMapperFlags(mapping_params["mapping_options"])

            self.mapper.Map(variable_origin, variable_destination, mapper_flags)

    def IsOutputStep(self):
        is_output_step = False
        if self.data_comm.Rank() == self.destination_rank:
            if self.output_process:
                is_output_step = self.output_process.IsOutputStep()
        return bool(self.data_comm.Broadcast(int(is_output_step), self.destination_rank))

    def PrintOutput(self):
        if self.data_comm.Rank() == self.destination_rank and self.output_process:
            self.output_process.PrintOutput()

def GetMapperFlags(settings):
    mapper_flags_dict = {
        "add_values"    : KM.Mapper.ADD_VALUES,
        "swap_sign"     : KM.Mapper.SWAP_SIGN,
        "use_transpose" : KM.Mapper.USE_TRANSPOSE
    }
    mapper_flags = KM.Flags()
    for flag_name in settings.GetStringArray():
        mapper_flags |= mapper_flags_dict[flag_name]

    return mapper_flags


시 CSRF 토큰 필드를 포함해야 합니다. 그렇지 않으면 요청이 거부됩니다. CSRF 보호에 관한 자세한 내용은 [CSRF 문서](/docs/9.x/csrf)를 참고하세요:

```
<form method="POST" action="/profile">
    @csrf
    ...
</form>
```

### 리디렉트 라우트 (Redirect Routes)

다른 URI로 리디렉트하는 라우트를 정의할 때는 `Route::redirect` 메서드를 사용할 수 있습니다. 이 메서드는 간단한 리디렉트를 위해 전체 라우트나 컨트롤러를 정의할 필요 없이 편리한 단축키를 제공합니다:

```
Route::redirect('/here', '/there');
```

기본적으로 `Route::redirect`는 302 상태 코드를 반환하며, 세 번째 선택 인자로 상태 코드를 변경할 수 있습니다:

```
Route::redirect('/here', '/there', 301);
```

또는, 301 상태 코드를 반환하고 싶다면 `Route::permanentRedirect` 메서드를 사용할 수 있습니다:

```
Route::permanentRedirect('/here', '/there');
```

> [!WARNING]
> 리디렉트 라우트에서 라우트 매개변수를 사용할 때는 Laravel에서 예약한 `destination`과 `status` 매개변수는 사용할 수 없습니다.

### 뷰 라우트 (View Routes)

라우트가 단순히 뷰를 반환하는 용도라면, `Route::view` 메서드를 사용할 수 있습니다. `redirect` 메서드와 유사하게, 전체 라우트나 컨트롤러를 정의하지 않아도 편리하게 사용할 수 있습니다. 첫 번째 인자로 URI, 두 번째 인자로 뷰 이름을 받고, 선택적으로 세 번째 인자로 뷰에 전달할 데이터를 배열로 넘길 수도 있습니다:

```
Route::view('/welcome', 'welcome');

Route::view('/welcome', 'welcome', ['name' => 'Taylor']);
```

> [!WARNING]
> 뷰 라우트에서 라우트 매개변수를 사용할 때는 Laravel에서 예약된 `view`, `data`, `status`


StringConvert.h"
#include "../../../Common/UTFConvert.h"

#include "../../../Windows/TimeUtils.h"

#include "../../Common/LimitedStreams.h"
#include "../../Common/MethodProps.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h"

#include "../Common/ItemNameUtils.h"

#include "TarHandler.h"

using namespace NWindows;

namespace NArchive {
namespace NTar {

// 21.02: we use UTF8 code page by default, even if some files show error
// before 21.02 : CP_OEMCP;
// static const UINT k_DefaultCodePage = CP_UTF8;

static const Byte kProps[] =
{
  kpidPath,
  kpidIsDir,
  kpidSize,
  kpidPackSize,
  kpidMTime,
  kpidCTime,
  kpidATime,
  kpidPosixAttrib,
#if 0
  kpidAttrib,
#endif
  kpidUser,
  kpidGroup,
  kpidUserId,
  kpidGroupId,
  kpidSymLink,
  kpidHardLink,
  kpidCharacts,
  kpidComment
  , kpidDeviceMajor
  , kpidDeviceMinor
  // , kpidDevice
  // , kpidHeadersSize // for debug
  // , kpidOffset // for debug
};

static const Byte kArcProps[] =
{
  kpidHeadersSize,
  kpidCodePage,
  kpidCharacts,
  kpidComment
};

static const char *k_Characts_Prefix = "PREFIX";

IMP_IInArchive_Props
IMP_IInArchive_ArcProps

Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value))
{
  NCOM::CPropVariant prop;
  switch (propID)
  {
    case kpidPhySize:     if (_arc._phySize_Defined) prop = _arc._phySize; break;
    case kpidHeadersSize: if (_arc._phySize_Defined) prop = _arc._headersSize; break;
    case kpidErrorFlags:
    {
      UInt32 flags = 0;
      if (!_isArc)
        flags |= kpv_ErrorFlags_IsNotArc;
      else switch ((int)_arc._error)
      {
        case k_ErrorType_UnexpectedEnd: flags = kpv_ErrorFlags_UnexpectedEnd; break;
        case k_ErrorType_Corrupted: flags = kpv_ErrorFlags_HeadersError; break;
        // case k_ErrorType_OK: break;
        // case k_ErrorType_Warning: break;
        // case k_ErrorType_OK:
        default: break;
      }
      if (flags != 0)
        prop = flags;
      break;
    }

    case kpidWarningFlags:
    {
      if (_arc._is_Warning)
        prop = kpv_ErrorFlags_HeadersError;
      break;
    }

    case kpidCodePage:
    {
      char sz[16];
      const char *name = NULL;
      switch (_openCodePage)
      {
        case CP_OEMCP: name = "OEM"; break;
        case CP_UTF8: name = "UTF-8"; break;
        default: break;
      }
      if (!name)
      {
        ConvertUInt32ToString(_openCodePage, sz);
        name = sz;
      }
      prop = name;
      break;
    }

    case kpidCharacts:
    {
      AString s;
      if (_arc._are_Gnu) s.Add_OptSpaced("GNU");


will check your health amount."] = "활성화하면 내 생명력을 점검합니다."
L["Enabling this will check your power amount."] = "활성화하면 내 자원량을 점검합니다."
L["Enchanting"] = "마법부여"
L["ENCOUNTER_JOURNAL"] = "던전 도감"
L["Enviroment Conditions"] = "환경 조건"
L["Enemy Enabled"] = "적 대상 활성화"
L["Friendly Enabled"] = "아군 대상 활성화"
L["Stacking Enabled"] = "중첩 허용"
L["Enemy Aura Type"] = "적군일 때 표시 계열"
L["Enemy Combat Toggle"] = "적군 전투 전환"
L["Enemy"] = "적군"
L["ENEMY_NPC"] = "적군 NPC"
L["ENEMY_PLAYER"] = "적군 플레이어"
L["ENERGY"] = "기력"
L["Energy/Mana Regen Tick"] = "기력/마나 재생 틱"
L["Engineering"] = "기계공학"
L["Enhanced PVP Messages"] = "향상된 PVP 메시지"
L["Equipped Item"] = "착용 중인 아이템"
L["Equipped"] = "착용"
L["Error decoding data. Import string may be corrupted!"] = "데이터 해독에 오류. 문자열 가져오기가 오염된 것 같습니다!"
L["Error exporting profile!"] = "프로필 내보내기 오류!"
L["Quest Progress and Error Text"] = "퀘스트 진행 및 오류 메시지"
L["Event Log"] = "이벤트 로그"
L["Exclude Name"] = "제외할 이름"
L["Excluded names will not be class colored."] = "제외할 이름은 직업 색상으로 표시하지 않습니다."
L["Excluded Names"] = "제외된 이름 목록"
L["Expansion"] = "확장"
L["Expansion Button"] = "확장 버튼"
L["Expansion Landing Page"] = "확장된 렌딩 페이지"
L["Expiring"] = "초읽기 색상"
L["Export Now"] = "지금 내보내기"
L["Export Profile"] = "프로필 내보내기"
L["Export"] = "출력"
L["Exported"] = "내보낸 것"
L["Extra Buttons"] = "추가버튼"
L["Fade Chat Toggles"] = "채팅창 숨김 버튼"
L["Fade Duration"] = "반투명 대기시간"
L["Fade Out Delay"] = "잔상 유지시간(초)"
L["Fade out the tooltip


LL, NULL, VEC_FLAG_AS_STACK, &success);
	if(success != VEC_OK)
	{
		free(result);
		result = NULL;
	}

	return result;
}

meta_col_t* meta_filter(uint32_t adm_id, amp_type_e type)
{
	meta_col_t *result = metacol_create();

	CHKNULL(result);
	result->adm_id = adm_id;
	result->type = type;

	rhht_foreach(&(gMgrDB.metadata), meta_cb_filter, result);

	return result;
}

meta_fp_t *meta_get_parm(metadata_t *meta, uint8_t idx)
{
	CHKNULL(meta);
	return vec_at(&(meta->parmspec), idx);
}

void meta_release(metadata_t *meta, int destroy)
{
	CHKVOID(meta);

	vec_release(&(meta->parmspec), 0);

	if(destroy)
	{
		free(meta);
	}
}

meta_col_t* metacol_create()
{
	meta_col_t *result = malloc(sizeof(meta_col_t));
	int success;

	CHKNULL(result);
	result->results = vec_create(0, NULL, NULL, NULL, 0, &success);
	if(success != VEC_OK)
	{
		free(result);
		result = NULL;
	}
	return result;
}

void metacol_release(meta_col_t*col, int destroy)
{
	CHKVOID(col);
	vec_release(&(col->results), 0);
	if(destroy)
	{
		free(col);
	}
}


(g))",
				ExpectedErr: sql.ErrNullableSpatialIdx,
			},
			{
				Query:       "create table geom(g geometry SRID 4326, SPATIAL INDEX(g))",
				ExpectedErr: sql.ErrNullableSpatialIdx,
			},
			{
				Query:       "create table geom(g1 geometry NOT NULL SRID 0, g2 geometry NOT NULL SRID 4326, SPATIAL INDEX(g1, g2))",
				ExpectedErr: sql.ErrTooManyKeyParts,
			},
		},
	},
	{
		Name: "alter table spatial index nullable",
		SetUpScript: []string{
			"create table geom(g geometry)",
		},
		Assertions: []ScriptTestAssertion{
			{
				Query:       "alter table geom add spatial index (g)",
				ExpectedErr: sql.ErrNullableSpatialIdx,
			},
		},
	},
	{
		Name: "alter table spatial index with srid nullable",
		SetUpScript: []string{
			"create table geom(g geometry SRID 4326)",
		},
		Assertions: []ScriptTestAssertion{
			{
				Query:       "alter table geom add spatial index (g)",
				ExpectedErr: sql.ErrNullableSpatialIdx,
			},
		},
	},
	{
		Name: "show table with spatial indexes",
		SetUpScript: []string{
			"create table geom(" +
				"p point not null srid 0," +
				"l linestring not null srid 0," +
				"py polygon not null srid 0," +
				"mp multipoint not null srid 0," +
				"ml multilinestring not null srid 0," +
				"mpy multipolygon not null srid 0," +
				"gc geometrycollection not null srid 0," +
				"g geometry not null srid 0)",
			"alter table geom add spatial index (p)",
			"alter table geom add spatial index (l)",
			"alter table geom add spatial index (py)",
			"alter table geom add spatial index (mp)",
			"alter table geom add spatial index (ml)",
			"alter table geom add spatial index (mpy)",
			"alter table geom add spatial index (gc)",
			"alter table geom add spatial index (g)",
		},
		Assertions: []ScriptTestAssertion{
			{
				Query: "show create table geom",
				Expected: []sql.Row{
					{
						"geom",
						"CREATE TABLE `geom` (\n" +
							"  `p` point NOT NULL /*!80003 SRID 0 */,\n" +
							"  `l` linestring NOT NULL /*!80003 SRID 0 */,\n" +
							"  `py` polygon NOT NULL /*!80003 SRID 0 */,\n" +
							"  `mp` multipoint NOT NULL /*!80003 SRID 0 */,\n" +
							"  `ml` multilinestring NOT NULL /*!80003 SRID 0 */,\n" +
							"  `mpy` multipolygon NOT NULL /*!80003 SRID 0 */,\n" +
							"  `gc` geometrycollection NOT NULL /*!80003 SRID 0 */,\n" +
							"  `g` geometry NOT NULL /*!80003 SRID 0 */,\n" +
							"  SPATIAL KEY `g` (`g`),\n" +
							"  SPATIAL KEY `gc` (`gc`),\n" +
							"  SPATIAL KEY `l` (`l`),\n" +
							"  SPATIAL KEY `ml` (`ml`),\n" +
							"  SPATIAL KEY `mp` (`mp`),\n" +
							"  SPATIAL KEY `mpy` (`mpy`),\n" +
							"  SPATIAL KEY `p` (`p`),\n" +
							"  SPATIAL KEY `py` (`py`)\n" +
							") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin",
					},
				},
			},
		},
	},
	{
		Name: "add spatial index to


  do
    {
     /*
      tmpcount--;
      if (!(tmpcount %100))
      {
        cout << "B " << tmpcount << endl;
      }
      if (tmpcount < 2)
      {
        cout << "B " << tmpcount << endl;
      }
      */
      //nlist-=sizeof(char*);
      --nlist;
      if (nlist.eof())
        break;
      ADrfptr rf=nlist.bptr->pf;
      (*rf)();
     /*
      if (check_pool_flag3)
      {
        if (xcount > 722)
        {
          cout << xcount << "  ";
          //check_pool_depths();
        }
      }
     */
#if defined(__DERCHECK__)
        //derchecker->counter--;
      mydercheckercounter--;
#endif
        xcount++;
          //tcount--;
       if (xcount > 99999999) cout << xcount << endl;
       //if (tcount == 6599 )
        //  cout << tcount << endl;
      /*
        if (initial_df1b2params::current_phase==2)
        {
          tcount--;
          if (rf2 != (nlist.buffer+122)->pf || xcount > 12488)
             cout << tcount << " " << xcount << " "
                  << (nlist.buffer+122)->pf << endl;
        }
       */
    }
    while(nlist.bptr>=nlist.buffer);
    break;
  case 2:
    {
      f1b2gradlist->list2.save_end();
      f1b2gradlist->list2.set_reverse();
      f1b2gradlist->list2.restore_end();
      f1b2gradlist->nlist2.save_end();
      f1b2gradlist->nlist2.set_reverse();
      f1b2gradlist->nlist2.restore_end();
#if defined(__DERCHECK__)
      // derchecker->counter=0;
      mydercheckercounter=0;
#endif
      f1b2gradlist->list.set_forward();
      f1b2gradlist->list.rewind();
      f1b2gradlist->nlist.set_forward();
      f1b2gradlist->nlist.rewind();

      //nlist.reset();  // set pointer to beginning of list
      --(f1b2gradlist->nlist2);  // backup one record
      int icount=0;
      do
      {
#if defined(__DERCHECK__)
        // derchecker->counter++;
        mydercheckercounter++;
#endif
        //ADrfptr rf=*ADprfptr(nlist.bptr);
        ADrfptr rf=nlist.bptr->pf;
        (*rf)();
        ++nlist;

       /*
        if (initial_df1b2params::current_phase==2)
        {
          if (icount >=4579)
          {
            cout << icount << endl;
          }
        }

        if (icount>28115)
        {
          cout << "icount = " << icount << endl;
        }
        */
      }
      while(++icount<ncount);
      // need this to get pointer right for step 3?
       // nlist-=sizeof(int); // set nlist to point to second record;
      //nlist++;

      break;
    }

  default:
     cerr << "illega value for df1b2variable::passnumber "
      " value = " << df1b2variable::passnumber << endl;
  }
}

double nsin(double x) {return -sin(x);}
double ncos(double x)


      'description': `Immediately recharge your shields. When used at full charge causes an explosion around your ship.`,
      'amount': 1,
      'fireRate': 15000
    },
    "Ramming Shield": {
      'systemType': RammingShield,
      'description': `Protect your ship from collision damage allowing you to ram enemies.`,
      'duration': 4000,
      'fireRate': 10000,
      'unlockKey': "maxKills_Shield Recharge",
      'unlockCount': 200
    },
    "Force Shield": {
      'systemType': ForceShield,
      'description': `Protect your ship from all forms of damage.`,
      'duration': 3000,
      'fireRate': 15000,
      'unlockKey': "maxKills_Ramming Shield",
      'unlockCount': 200
    },
    "Thrusters": {
      'systemType': Thrusters,
      'description': `Doubles your speed and accelleration causing damage to all enemies in your wake.`,
      'amount': 2,
      'duration': 2000,
      'fireRate': 4000
    },
    "Hyper Speed": {
      'systemType': HyperSpeed,
      'description': `Create a wormhole and travel a short distance thought spacetime damaging all enemies in your path.`,
      'amount': 250,
      'fireRate': 5000,
      'unlockKey': "maxKills_Thrusters",
      'unlockCount': 200
    },
    "Invisibility": {
      'systemType': Invisibility,
      'description': `Turn invisible and untargettable by enemies and missile. Become invulnerable for a brief moment when activated and creating an explosion when reappearing.`,
      'duration': 5000,
      'fireRate': 12000,
      'unlockKey': "maxKills_Hyper Speed",
      'unlockCount': 200
    },
  };
}
import { CQGuard } from "."
import { CQHandler, CQEventHandler, CQResult, GetState, GetEvents, CQEvent, Reducer } from "./Core"
import { RuleChain, Rule } from "./Rules"
import { StatefulRuleChain, StatefulRule } from "./StatefulRule"

type NameOrString<TMaybeName> = TMaybeName extends { name: infer TName } ? TName
  : string
type Request<THandler> = THandler extends CQHandler<infer TRequest> ? TRequest
  : THandler extends CQEventHandler<infer TEvent> ? TEvent
  : never
type Response<THandler> = THandler extends CQHandler ? ReturnType<THandler>
  : THandler extends CQEventHandler ? ReturnType<THandler>
  : never

type SmartHandler<THandler> = (req: Request<THandler>) => Response<THandler>
type TestState<TInput> = (input: TInput) => Promise<string[]>

type SetGuard = (name: string, guard: CQGuard<any>) => void
type AddRule = (name: string, rule: Rule<any>) => void
type SetTestState = (name: string, stateType: string, test: TestState<any>) => void

function createNameTypeKey(name: string, type: string) {
  if (name?.includes(":")) {
    throw new Error(`name ${name} includes an illegal character ':'.`)
  } else if (type?.includes(":")) {
    throw new Error(`stateType ${type} includes an illegal character ':'.`)
  }

  return `${name}:${type}`
}
function createPartialNameTypeKey(name: string) {
  if (name?.includes(":")) {
    return false
  }

  return `${name?.toLowerCase()}:`
}

export type Registrar<THandler extends Function> = Register<THandler> & Readonly<{
  type: string

  findHandler(name: string): SmartHandler<THandler> | undefined
  findGuard(name: string): CQGuard<any> | undefined
  findRules(name: string): RuleChain<Request<THandler>> | undefined
  findStateTestsByName(name: st


*********************
/// 列表区
/// ********************************************************

final List<CusLabel> genderOptions = [
  CusLabel(enLabel: 'Male', cnLabel: "男", value: 'male'),
  CusLabel(enLabel: 'Female', cnLabel: "女", value: 'female'),
  CusLabel(
    enLabel: 'Thunder Fighter',
    cnLabel: "雷霆战机",
    value: 'thunder fighter',
  ),
  CusLabel(enLabel: 'Other', cnLabel: "其他", value: 'other'),
];

/// 基础活动的一些分类选项
/// 来源： https://lite.datasette.io/?json=https://github.com/yuhonas/free-exercise-db/blob/main/dist/exercises.json#/data/exercises?_facet=force
List<CusLabel> mechanicOptions = [
  CusLabel(enLabel: 'isolation', cnLabel: "孤立动作", value: 'isolation'),
  CusLabel(enLabel: 'compound', cnLabel: "复合动作", value: 'compound'),
];

List<CusLabel> forceOptions = [
  CusLabel(enLabel: 'pull', cnLabel: "拉", value: 'pull'),
  CusLabel(enLabel: 'push', cnLabel: "推", value: 'push'),
  CusLabel(enLabel: 'static', cnLabel: "静", value: 'static'),
  CusLabel(enLabel: 'other', cnLabel: "其他", value: 'other'),
];

List<CusLabel> levelOptions = [
  CusLabel(enLabel: 'beginner', cnLabel: "初级", value: 'beginner'),
  CusLabel(enLabel: 'intermediate', cnLabel: "中级", value: 'intermediate'),
  CusLabel(enLabel: 'expert', cnLabel: "专家", value: 'expert'),
];

// 锻炼是计时还是计次
List<CusLabel> countingOptions = [
  CusLabel(enLabel: 'timed', cnLabel: "计时", value: 'timed'),
  CusLabel(enLabel: 'counted', cnLabel: "计次", value: 'counted'),
];

// 这个分类除了exercise外，group、plan计划也用这个
List<CusLabel> categoryOptions = [
  CusLabel(enLabel: 'strength', cnLabel: "力量", value: 'strength'),
  CusLabel(enLabel: 'stretching', cnLabel: "拉伸", value: 'stretching'),
  CusLabel(enLabel: 'plyometrics', cnLabel: "肌肉增强", value: 'plyometrics'),
  CusLabel(enLabel: 'power lifting', cnLabel: "力量举重", value: 'powerlifting'),
  CusLabel(enLabel: 'strongman', cnLabel: "大力士", value: 'strongman'),
  CusLabel(enLabel: 'cardio', cnLabel: "有氧", value: 'cardio'),
  CusLabel(enLabel: 'anaerobic', cnLabel: "无氧", value: 'anaerobic'),
  CusLabel(enLabel: 'other', cnLabel: "其他", value: 'other'),
];

List<CusLabel> equipmentOptions = [
  CusLabel(enLabel: 'body', cnLabel: "无器械", value: 'body'),
  CusLabel(enLabel: 'body only', cnLabel: "仅身体", value: 'body only'),
  CusLabel(en


/*
 * Exercise 5-8. There is no error checking in day_of_year or month_day. Remedy
 * this defect.
 *
 * By Faisal Saadatmand
 */

#include <stdio.h>

/* functions */
int day_of_year(int, int, int);
void month_day(int, int, int *, int *);

static char daytab[2][13] = {
	{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
	{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};

/* day_of_year: set day of year from month & day; return -1 on invalid input */
int day_of_year(int year, int month, int day)
{
	int i, leap;

	if (year < 0 || month < 1 ||  month > 12 || day < 1 || day > 31)
		return -1;
	leap = (year % 4 == 0 && year % 100) || year % 400 == 0;
	for (i = 1; i < month; i++)
		day += daytab[leap][i];
	return day;
}

/* month_day: set month, day from day of year; zero value is an invalid input */
void month_day(int year, int yearday, int *pmonth, int *pday)
{
	int i, leap;

	if (year < 0 || yearday < 1 || yearday > 366) {
		*pmonth = *pday =  0;
		return;
	}
	leap = (year % 4 == 0 && year % 100) || year % 400 == 0;
	for (i = 1; yearday > daytab[leap][i]; i++)
		yearday -= daytab[leap][i];
	*pmonth = i;
	*pday = yearday;
}

int main(void)
{
	int yearday, month, day;

	if ((yearday = day_of_year(1986, 3, 35)) < 0)
		printf("Invalid input\n");
	else
		printf("day of the year: %i\n", yearday);
	month_day(2020, 367, &month, &day);
	if (!month || !day)
		printf("Invalid input\n");
	else
		printf("month %i, day %i\n", month, day);
	return 0;
}


t, key) {
      if (Reflect.has(target, key)) {
        return Reflect.get(target, key)
      }
      for (const ref of refs) {
        if (ref.value && Reflect.has(ref.value, key)) {
          const val = Reflect.get(ref.value, key)
          return typeof val === 'function'
            ? val.bind(ref.value)
            : val
        }
      }
    },
    getOwnPropertyDescriptor (target, key) {
      const descriptor = Reflect.getOwnPropertyDescriptor(target, key)
      if (descriptor) return descriptor

      // Skip internal properties
      if (typeof key === 'symbol' || key.startsWith('__')) return

      // Check each ref's own properties
      for (const ref of refs) {
        if (!ref.value) continue
        const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key)
        if (descriptor) return descriptor
        if ('_' in ref.value && 'setupState' in ref.value._) {
          const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key)
          if (descriptor) return descriptor
        }
      }
      // Recursive search up each ref's prototype
      for (const ref of refs) {
        let obj = ref.value && Object.getPrototypeOf(ref.value)
        while (obj) {
          const descriptor = Reflect.getOwnPropertyDescriptor(obj, key)
          if (descriptor) return descriptor
          obj = Object.getPrototypeOf(obj)
        }
      }
      // Call forwarded refs' proxies
      for (const ref of refs) {
        const childRefs = ref.value && (ref.value as any)[Refs]
        if (!childRefs) continue
        const queue = childRefs.slice()
        while (queue.length) {
          const ref = queue.shift()
          const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key)
          if (descriptor) return descriptor
          const childRefs = ref.value && (ref.value as any)[Refs]
          if (childRefs) queue.push(...childRefs)
        }
      }
      return undefined
    },
  }) as any
}
import { CapitalizePipe } from './capitalize.pipe';

fdescribe('CapitalizePipe', () => {
  // This pipe is a pure, stateless function so no need for BeforeEach
  const pipe = new CapitalizePipe();

  it('create an instance', () => {
    expect(pipe).toBeTruthy();
  });

  it('transforms "abc" to "Abc"', () => {
    expect(pipe.transform('abc')).toBe('Abc');
  });

  it('transforms "abc def" to "Abc def"', () => {
    expect(pipe.transform('abc def')).toBe('Abc def');
  });

  it('leaves "Abc def" unchanged', () => {
    expect(pipe.transform('Abc def')).toBe('Abc def');
  });

  it('transforms "abc-def" to "Abc-def"', () => {
    expect(pipe.transform('abc-def')).toBe('Abc-def');
  });

  it('transforms "   abc   def" to "   Abc   Def" (preserves spaces) ', () => {
    expect(pipe.transform('   abc   def')).toBe('   abc   def');
  });

});
import Operation, { OperationType, Assessment } from './models/Operation';

export default class FieldService {
    private operations: Array<Operation> = [
        new Operation({
            id: 'f112-o0',
            type: OperationType.PLOWING,
            date: { year: 2018, month: 3, day: 12 },
            area: 48.2,
            comment: 'Отлично вспахали',
            assessment: Assessment.EXCELLENT
        }),
        new Operation({
            id: 'f112-o1


join="round"
          //         fill="none"
          //         d={mainPath}
          //         onPointerDown={(e) => this.handleClick(e, group.id)}
          //       />
          //     );
          //   } else {
          //     groupPaths.push(
          //       <path
          //         key={`${group.id}_sel`}
          //         style={{ strokeWidth: "8px" }}
          //         stroke={"rgb(89, 101, 111)"}
          //         strokeLinejoin="round"
          //         fill="none"
          //         d={mainPath}
          //         onPointerDown={(e) => this.handleClick(e, group.id)}
          //       />
          //     );
          //   }
          // }
        }
        if (plotStyle == "line") {
          groupPaths.push(
            <path
              key={group.id}
              strokeWidth={"4px"}
              stroke={colors[group.cat]}
              strokeLinejoin="round"
              fill="none"
              d={mainPath}
              onPointerDown={(e) => this.handleClick(e, group.id)}
            />
          );
        }

        if (selectedById[group.id]) {
          selection.push(...groupPaths, ...groupCircles);
        } else {
          paths.push(...groupPaths, ...groupCircles);
        }
        if (grid[i].label) {
          boundaries.push(
            <PlotGridBoundary
              key={`b-${grid[i].label}`}
              {...grid[i]}
              scales={scales}
              nRows={this.props.data.nRows}
              nCols={this.props.data.nCols}
              len={grid.length}
              selected={selectedById[group.id]}
              handleClick={(e) => this.handleClick(e, group.id)}
              highlightColor={highlightColor}
              meta={meta}
            />
          );
        }
      }
      //   let kite = <g key={i}
      //                 style={{strokeWidth:"1px"}}
      //                 transform={`rotate(${coords[i].angle},${coords[i].y[0][0]},${coords[i].x[0][1]})`}
      //                 stroke={colors[i]}
      //                 fill="none">
      //                 <line key={`${i}_x`}
      //                       style={{strokeWidth:"3px"}}
      //                       x1={coords[i].x[0][0]}
      //                       y1={coords[i].x[0][1]}
      //                       x2={coords[i].x[1][0]}
      //                       y2={coords[i].x[1][1]}/>
      //                 <line key={`${i}_y`}
      //                       x1={coords[i].y[0][0]}
      //                       y1={coords[i].y[0][1]}
      //                       x2={coords[i].y[1][0]}
      //                       y2={coords[i].y[1][1]}/>
      //                 <polygon key={`${i}_poly`}
      //                          style={{strokeWidth:`3px`}}
      //                          points={coords[i].poly.map(c=>c[0]+','+c[1]).join(' ')}/>
      //               </g>
      //   paths.push( kite )
      // }
    });
    let visibleCats = this.props.data.visibleCats;
    if (plotStyle == "line") {
      this.props.data.visibleFullCats.forEach((cat) => {
        visibleCats.add(cat);
      });
    }
    let legend = (
      <g
        transform={`translate(0,-20),scale(${this.props.largeFonts ? 1.1 : 1})`}
      >
        <PlotLegend visibleCats={visibleCats} />
      </g>
    );
    return (
      <g
        transform="transl


    强壮的男人: 怎么不打拳，改做保镖了？哦，看我这记性，都忘了，你早就不是什么拳王了。
    舒拉: 看看你这嘴脸吧，也就只有你这种混蛋会为白捡的冠军扬扬自得了。
    ......
    强壮的男人: 生气了？唉，可惜那个老东西了，费了一生心血教出的学生到头来给别人做保镖，真是让人笑掉大牙了。
    舒拉: 可恶，少拿你那张臭嘴提我的老师！
    ......
    舒拉: 我们再比一场吧，把那场比赛打完，让最后的结果说话。

-   **舒拉解释为何要赴约**:
    舒拉: 我也不知道该怎么和你解释，但我一定要去，这场比赛的结果对我来说，很重要，带着这些旧账我真没法安心离开。
    舒拉: 今天的事没结束，我也不敢想明天的。
    罗德岛外勤干员: 那舒拉......和我讲讲，解释给我听，说服我。
    舒拉: 之前......我一直很希望能戴上那场比赛的冠军腰带，虽然现在腰带是拿不到了，但我还是想证明给......教练......我配得上那条腰带。
    ......
    舒拉: 一直到最后一刻......他都希望我能赢回那条腰带。我想......除了这个，能为他做的事情也没几件了。
    罗德岛外勤干员: ......舒拉，如果这是你的决定，我尊重它。

-   **舒拉发现叶甫盖尼的文身并得知真相**:
    舒拉: 你手腕上的金币文身是怎么回事？！
    强壮的男人: ......你......咳咳......救命，喘......不上气。
    舒拉: 说啊！
    强壮的男人: 呃......
    舒拉: 这么多年了，我一直在找它，是你，居然是你！
    舒拉: 原来当时暗害我得矿石病的人，就是你！
    ......
    强壮的男人: 不......是我，咳，大老板......你不愿，假拳......惹毛他......呃......

-   **舒拉的内心挣扎与原则**:
    旁白:很多人濒死时都会这样哀求。
    旁白:地下拳场的喧闹声太吵，血腥味太重，没人在意这个。


regs.empty()) << "Trying to set empty ExtraRegisters";
  ASSERT(this, regs.arch() == arch())
      << "Trying to set wrong arch ExtraRegisters";
  extra_registers = regs;

  switch (extra_registers.format()) {
    case ExtraRegisters::XSAVE: {
      if (xsave_area_size() > 512) {
        struct iovec vec = { extra_registers.data_.data(),
                             extra_registers.data_.size() };
        if (ptrace_if_stopped(PTRACE_SETREGSET, NT_X86_XSTATE, &vec)) {
          /* If that failed, the task was killed and it should not matter what
             we tried to set. But we will remember that our registers are dirty. */
          extra_registers_known = true;
        }
      } else {
#if defined(__i386__)
        ASSERT(this,
               extra_registers.data_.size() == sizeof(user_fpxregs_struct));
        if (ptrace_if_stopped(X86Arch::PTRACE_SETFPXREGS, nullptr,
                              extra_registers.data_.data())) {
          /* If that failed, the task was killed and it should not matter what
             we tried to set. But we will remember that our registers are dirty. */
          extra_registers_known = true;
        }
#elif defined(__x86_64__)
        ASSERT(this,
               extra_registers.data_.size() == sizeof(user_fpregs_struct));
        if (ptrace_if_stopped(PTRACE_SETFPREGS, nullptr,
                              extra_registers.data_.data())) {
          /* If that failed, the task was killed and it should not matter what
             we tried to set. But we will remember that our registers are dirty. */
          extra_registers_known = true;
        }
#endif
      }
      break;
    }
    case ExtraRegisters::NT_FPR: {
      struct iovec vec = { extra_registers.data_.data(),
                            extra_registers.data_.size() };
      if (ptrace_if_stopped(PTRACE_SETREGSET, NT_PRFPREG, &vec)) {
        /* If that failed, the task was killed and it should not matter what
           we tried to set. But we will remember that our registers are dirty. */
        extra_registers_known = true;
      }
      break;
    }
    default:
      ASSERT(this, false) << "Unexpected ExtraRegisters format";
  }
}

enum WatchBytesX86 {
  BYTES_1 = 0x00,
  BYTES_2 = 0x01,
  BYTES_4 = 0x03,
  BYTES_8 = 0x02
};
static WatchBytesX86 num_bytes_to_dr_len(size_t num_bytes) {
  switch (num_bytes) {
    case 1:
      return BYTES_1;
    case 2:
      return BYTES_2;
    case 4:
      return BYTES_4;
    case 8:
      return BYTES_8;
    default:
      FATAL() << "Unsupported breakpoint size " << num_bytes;
      return WatchBytesX86(-1); // not reached
  }
}

struct DebugControl {
  uintptr_t dr0_local : 1;
  uintptr_t dr0_global : 1;
  uintptr_t dr1_local : 1;
  uintptr_t dr1_global : 1;
  uintptr_t dr2_local : 1;
  uintptr_t dr2_global : 1;
  uintptr_t dr3_local : 1;
  uintptr_t dr3_global : 1;

  uintptr_t ignored : 8;

  WatchType dr0_type : 2;
  WatchBytesX86 dr0_len : 2;
  WatchType dr1_type : 2;
  WatchBytesX86 dr1_len : 2;
  WatchType dr2_type : 2;
  WatchBytesX86 dr2_len : 2;
  WatchType dr3_type : 2


ut-group-outline.is-valid.is-focused .form-label:after,.input-group.input-group-outline.is-valid.is-focused .form-label:before{border-top-color:#4caf50;box-shadow:inset 0 1px #4caf50}.input-group.input-group-outline.is-invalid .form-control{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23fd5c70' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23fd5c70' stroke='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .75rem center;background-size:1rem 1rem}.input-group.input-group-outline.is-invalid.is-filled .form-label+.form-control,.input-group.input-group-outline.is-invalid.is-focused .form-label+.form-control{border-color:#f44335!important;box-shadow:inset 1px 0 #f44335,inset -1px 0 #f44335,inset 0 -1px #f44335;border-top-color:transparent!important}.input-group.input-group-outline.is-invalid.is-filled .form-label,.input-group.input-group-outline.is-invalid.is-focused .form-label{color:#f44335}.input-group.input-group-outline.is-invalid.is-filled .form-label:after,.input-group.input-group-outline.is-invalid.is-filled .form-label:before,.input-group.input-group-outline.is-invalid.is-focused .form-label:after,.input-group.input-group-outline.is-invalid.is-focused .form-label:before{border-top-color:#f44335;box-shadow:inset 0 1px #f44335}.input-group.input-group-dynamic.input-group-sm .form-label,.input-group.input-group-dynamic.input-group-sm label,.input-group.input-group-outline.input-group-sm .form-label,.input-group.input-group-outline.input-group-sm label,.input-group.input-group-static.input-group-sm .form-label,.input-group.input-group-static.input-group-sm label{font-size:.75rem}.input-group.input-group-dynamic.input-group-lg .form-label,.input-group.input-group-dynamic.input-group-lg label,.input-group.input-group-outline.input-group-lg .form-label,.input-group.input-group-outline.input-group-lg label,.input-group.input-group-static.input-group-lg .form-label,.input-group.input-group-static.input-group-lg label{font-size:.975rem}.input-group.input-group-static .form-control{width:100%}.input-group.input-group-static label{margin-left:0;margin-bottom:0}.form-check:not(.form-switch) .form-check-input{float:none!important;margin-left:auto!important}.form-check:not(.form-switch) .form-check-input[type=checkbox],.form-check:not(.form-switch) .form-check-input[type=radio]{border:1px solid #d1d7e1;margin-top:.25rem;position:relative}.form-check:not(.form-switch) .form-check-input[type=checkbox]:checked,.form-check:not(.form-switch) .form


idth="135" height="42" class="bosch-logo" alt="logo" src="/themes/cookit/images/bosch-logo.png"/>

 Rezeptideen

  Rezepte

  Sammlungen

  Wochenpläne

 Rund um den Cookit

  Tipps & Tricks

  Das kann dein Cookit

  Häufige Fragen

  Geschenkanhänger

 Cookit Academy

 Themenwelten

  Weihnachten

  Kochen

  Backen

  Ernährung

  Magazine

<div


```bash
sh download_pretrained_model.sh
```

- Test pretrained model on CelebA dataset:
```bash
python test.py ./datasets/celeba/test/* --checkpointDir checkpoints_face_pretrained --maskType right --batchSize 64 --lam1 100 --lam2 1 --lam3 0.1 --lr 0.001 --nIter 1000 --outDir results_face_pretrained --text_vector_dim 18 --text_path datasets/celeba/imAttrs.pkl
```

## Experiments
We test our framework with 3 kinds of data, face([CelebA](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html)), bird([CUB](http://www.vision.caltech.edu/visipedia/CUB-200-2011.html)), and flower([Oxford-102](http://www.robots.ox.ac.uk/~vgg/data/flowers/102/index.html)). So far, we have only experimented with face images using attribute vectors as texts information. Here are some preliminary results:

### 1. Face
We used CelebA dataset, which also provides 40 attributes for each image. Similar to the text information, attributes control the specific details of the generated images. We chose 18 attrbutes for training.

#### a). Attributes match sketch:
The following images were generated given sketches and the **corresponding** attriubtes.

##### Mustache
attributes   |sketch / generated / gt |attributes   | sketch / generated / gt
:-----------:|:----------------------:|:-----------:|:-----------------------:
 Male, 5_o_Clock_Shadow, Mouth_Open, Pointy_Nose | | Male, 5_o_Clock_Shadow, Big_Nose, Mustache |
 Male, Big_Lips, Big_Nose, Chubby, Goatee, High_Cheekbones, Smiling | | Male, Mustache |
 Male, Goatee, Mouth_Open, Smiling | | Male, Big_Nose, Goatee, Smiling |
 Male, 5_o_Clock_Shadow, Big_Lips, Big_Nose, Goatee, High_Cheekbones, Mouth_Open, Rosy_Cheeks, Smiling | | Male, 5_o_Clock_Shadow, Big_Nose, Narrow_Eyes |

##### Eyeglasses
attributes   |sketch / generated / gt |attributes   | sketch / generated / gt
:-----------:|:----------------------:|:-----------:|:-----------------------:
 Male, Big_Nose, Eyeglasses, Goatee | | Female, Eyeglasses |
 Female, Eyeglasses, High_Cheekbones, Mouth_Open, Smiling |<img src="./imgs/examples/ma


"
    private const val ACCUMULATOR_DATA_KEY = "accumulator"

    override fun evaluateLogic(expression: Any?, data: Any?, evaluator: LogicEvaluator): Any? =
        expression.asList.let { expressionValues ->
            val input = createOperationInput(expressionValues, data, evaluator)
            val initialValue = expressionValues.thirdOrNull()

            reduceOrInitial(input, initialValue, evaluator)
        }

    private fun reduceOrInitial(
        operationInput: ArrayOperationInputData,
        initialValue: Any?,
        evaluator: LogicEvaluator
    ) = with(operationInput) {
        operationData?.fold(initialValue) { accumulator, evaluatedValue ->
            evaluator.reduceValue(accumulator, evaluatedValue, mappingOperation) ?: return operationDefault
        } ?: initialValue
    }

    private fun LogicEvaluator.reduceValue(
        accumulator: Any?,
        evaluatedValue: Any?,
        mappingOperation: Map<String, Any>?,
    ) = mappingOperation?.let { operation ->
        evaluateLogic(operation, toReduceIterationData(accumulator, evaluatedValue))
    }

    private fun toReduceIterationData(accumulator: Any?, current: Any?) =
        mapOf(ACCUMULATOR_DATA_KEY to accumulator, CURRENT_DATA_KEY to current)
}
import org.gradle.kotlin.dsl.`maven-publish`
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.signing
import org.gradle.kotlin.dsl.withType

plugins {
    `maven-publish`
    signing
    id("versioning-convention")
}

val javadocJar: TaskProvider<Jar> = tasks.register("javadocJar", Jar::class.java) {
    archiveClassifier.set("javadoc")
}

configure<PublishingExtension> {
    publishing {
        publications.withType<MavenPublication> {
            setFullModuleArtifactId()
            artifact(javadocJar)

            pom {
                name.set(LibConfig.name)
                description.set("Kotlin multiplatform JsonLogic expressions evaluation engine")
                url.set(LibConfig.repositoryUrl)
                inceptionYear.set("2022")
                licenses {
                    license {
                        name.set("The Apache License, Version 2.0")
                        url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
                    }
                }
                developers {
                    developer {
                        name.set("Marek Krogulski")
                        email.set("marek.krogulski@allegro.pl")
                    }
                }
                scm {
                    connection.set("scm:svn:${LibConfig.repositoryUrl}")
                    developerConnection.set("scm:git@github.com:allegro/json-logic-kmp.git")
                    url.set(LibConfig.repositoryUrl)
                }
            }
        }
    }
}

System.getenv("GPG_KEY_ID")?.let { gpgKeyId ->
    signing {
        useInMemoryPgpKeys(
            gpgKeyId,
            System.getenv("GPG_PRIVATE_KEY"),
            System.getenv("GPG_PRIVATE_KEY_PASSWORD")
        )
        sign(publishing.publications)
    }
}
package com.allen.kotlinapp

import android.os.Bundle
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.RecyclerView
import com.allen.kotlinapp.adapter.ExpandableItemAdapter
import com.allen.kotlinapp.base.BaseActivity
import com.allen.kotlinapp.entity.Level0Item
import com.allen.kotlinapp.entity.Level1Item
import com.all


d	r4, r4, r0
.L798:
	mov	r0, #0
	ldr	r9, .L808+292
	bl	List_get_gc_head_node
	uxth	r3, r0
	mov	r5, #0
	movw	fp, #65535
	mov	r10, #6
.L800:
	cmp	r3, fp
	beq	.L799
	ldr	r2, [r7, #-3604]
	lsl	r1, r3, #1
	mul	r6, r10, r3
	mov	r0, r4
	ldrh	r2, [r2, r1]
	str	r2, [sp, #8]
	ldr	r2, [r7, #-3548]
	add	r2, r2, r6
	ldrh	r2, [r2, #4]
	str	r2, [sp, #4]
	ldr	r2, [r7, #-3540]
	ldrh	r2, [r2, r1]
	mov	r1, r9
	str	r2, [sp]
	mov	r2, r5
	bl	sprintf
	add	r5, r5, #1
	ldr	r3, [r7, #-3548]
	cmp	r5, #16
	add	r4, r4, r0
	ldrh	r3, [r3, r6]
	bne	.L800
.L799:
	ldr	r2, [r7, #-3548]
	mov	r5, #0
	ldr	r3, [r7, #-3528]
	movw	r9, #65535
	ldr	fp, .L808+296
	mov	r10, #6
	sub	r3, r3, r2
	ldr	r2, .L808+300
	asr	r3, r3, #1
	mul	r3, r2, r3
	uxth	r3, r3
.L802:
	cmp	r3, r9
	beq	.L801
	ldr	r1, [r7, #-3604]
	lsl	r2, r3, #1
	mul	r6, r10, r3
	mov	r0, r4
	ldrh	r2, [r1, r2]
	mov	r1, fp
	str	r2, [sp, #4]
	ldr	r2, [r7, #-3548]
	add	r2, r2, r6
	ldrh	r2, [r2, #4]
	str	r2, [sp]
	mov	r2, r5
	add	r5, r5, #1
	bl	sprintf
	cmp	r5, #4
	add	r4, r4, r0
	ldrne	r3, [r7, #-3548]
	ldrhne	r3, [r3, r6]
	bne	.L802
.L801:
	sub	r0, r4, r8
.L795:
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L809:
	.align	2
.L808:
	.word	.LANCHOR0
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LANCHOR1
	.word	.LC9
	.word	.LANCHOR2
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.


e widget with the color of your choice
    // (ctx.size() returns the size of the layout rect we're painting in)
    // Note: ctx also has a `clear` method, but that clears the whole context,
    // and we only want to clear this widget's area.
    let size = ctx.size();
    let rect = size.to_rect();
    ctx.fill(rect, &Color::WHITE);

    // We can paint with a Z index, this indicates that this code will be run
    // after the rest of the painting. Painting with z-index is done in order,
    // so first everything with z-index 1 is painted and then with z-index 2 etc.
    // As you can see this(red) curve is drawn on top of the green curve
    ctx.paint_with_z_index(1, move |ctx| {
        let mut path = BezPath::new();
        path.move_to((0.0, size.height));
        path.quad_to((40.0, 50.0), (size.width, 0.0));
        // Create a color
        let stroke_color = Color::rgb8(128, 0, 0);
        // Stroke the path with thickness 1.0
        ctx.stroke(path, &stroke_color, 5.0);
    });

    // Create an arbitrary bezier path
    let mut path = BezPath::new();
    path.move_to(Point::ORIGIN);
    path.quad_to((40.0, 50.0), (size.width, size.height));
    // Create a color
    let stroke_color = Color::rgb8(0, 128, 0);
    // Stroke the path with thickness 5.0
    ctx.stroke(path, &stroke_color, 5.0);

    // Rectangles: the path for practical people
    let rect = Rect::from_origin_size((10.0, 10.0), (100.0, 100.0));
    // Note the Color:rgba8 which includes an alpha channel (7F in this case)
    let fill_color = Color::rgba8(0x00, 0x00, 0x00, 0x7F);
    ctx.fill(rect, &fill_color);

    // Text is easy; in real use TextLayout should either be stored in the
    // widget and reused, or a label child widget to manage it all.
    // This is one way of doing it, you can also use a builder-style way.
    let mut layout = TextLayout::<String>::from_text(first);
    layout.set_font(FontDescriptor::new(FontFamily::SERIF).with_size(24.0));
    layout.set_text_color(fill_color);
    layout.rebuild_if_needed(ctx.text(), env);

    // Let's rotate our text slightly. First we save our current (default) context:
    ctx.with_save(|ctx| {
        // Now we can rotate the context (or set a clip path, for instance):
        // This makes it so that anything drawn after this (in the closure) is
        // transformed.
        // The transformation is in radians, but be aware it transforms the canvas,
        // not just the part you are drawing. So we draw at (80.0, 40.0) on the rotated
        // canvas, this is NOT the same position as (80.0, 40.0) on the original canvas.
        ctx.transform(Affine::rotate(std::f64::consts::FRAC_PI_4));
        layout.draw(ctx, (80.0, 40.0));
    });
    // When we exit with_save, the original context's rotation is restored

    // This is the builder-style way of drawing text.
    let text = ctx.text();
    let layout = text
        .new_text_layout(second.to_string())
        .font(FontFamily::SERIF, 24.0)
        .text_color(Color::rgb8(128, 0, 0))
        .build()
        .unwrap();
    ctx.draw_text(&layout, (100.0,


(true) {
            val clientSocket = serverSocket.accept().apply {
                soTimeout = SO_TIMEOUT
                tcpNoDelay = true
                log.info("[+] Client connected: $remoteSocketAddress")
            }
            thread { handleClient(clientSocket) }
        }
    }

    fun handleClient(socket: Socket) {
        val reader = BufferedReader(InputStreamReader(socket.getInputStream()))
        val writer = BufferedWriter(OutputStreamWriter(socket.getOutputStream()))
        var handler: ActiveClient? = null

        try {
            while (!Thread.interrupted() && !socket.isClosed) {
                val input = (reader.readLine() ?: break).trim('\uFEFF')
                if (input != "1,3") log.info("${socket.remoteSocketAddress} (${handler?.clientKey}) <<< $input")
                val message = Msg.fromString(input)

                when (message.cmd) {
                    // Start: Register the client. Payload is the keychip
                    Command.CTL_START -> {
                        val id = message.data as String
                        val client = ActiveClient(id, socket, reader, writer)
                        clients[client.stubIp]?.socket?.close()
                        clients[client.stubIp] = client
                        handler = clients[client.stubIp]
                        log.info("[+] Client registered: ${socket.remoteSocketAddress} -> $id")

                        // Send back the version
                        handler?.send(ctlMsg(Command.CTL_START, "version=$PROTO_VERSION"))
                    }

                    // Handle any other command using the handler
                    else -> {
                        (handler ?: throw Exception("Client not registered")).handle(message)
                    }
                }
            }
        } catch (e: Exception) {
            if (e.message != "Connection reset" && e !is SocketTimeoutException)
                log.error("Error in client handler", e)
        } finally {
            // Remove client
            handler?.stubIp?.let { clients.remove(it) }
            socket.close()
            log.info("[-] Client disconnected: ${handler?.clientKey}")
        }
    }
}

fun main() = FutariRelay().start()
package icu.samnyan.aqua.spring

import ext.API
import ext.Doc
import ext.RP
import java.io.File
import kotlin.reflect.full.declaredFunctions
import kotlin.reflect.full.findAnnotation
import kotlin.reflect.full.hasAnnotation
import kotlin.reflect.javaType

const val PACKAGE_NAME = "icu.samnyan.aqua.net"

@OptIn(ExperimentalStdlibApi::class)
fun main() {
    val path = PACKAGE_NAME.replace('.', '/')
    val resources = Thread.currentThread().contextClassLoader.getResources(path)
    val classes = mutableListOf<Class<*>>()

    while (resources.hasMoreElements()) {
        val resource = resources.nextElement()
        File(resource.file).listFiles { _, name -> name.endsWith(".class") }?.forEach {
            val className = it.name.substring(0, it.name.length - 6)
            val fullClassName = "$PACKAGE_NAME.$className"
            val clazz = Class.forName(fullClassName)
            classes.add(clazz)
        }
    }
    val apiCls = API::class.java

    var buf = ""

    fun write(s: String) {
        buf += s + "\n"
        println(s)
    }

    println(classes)

    // Loop through all classes
    classes.filter { it.isAnnotationPresent(apiCls) }.forEach { cls ->
        val base = cls.getAnnotation(API::class.java).value.joinToString(", ")
        write("\n\n### ${cls.simpleName} : $base\n")


profiles();
  if (mp.remove_profiles (tmp_pfiles.get ()) < 0)
    throw TAO_IOP::NotFound ();

  // MS C++ knows nothing about reset!
  // tmp_pfiles.reset (0); // get rid of last MProfile

  return new_obj._retn ();
}

CORBA::Boolean
TAO_IOR_Manipulation_impl::set_property (
    TAO_IOP::TAO_IOR_Property_ptr prop,
    CORBA::Object_ptr group)
{
  // make sure we have some profiles
  if (group->_stubobj ()->base_profiles ().profile_count () == 0)
    throw TAO_IOP::Invalid_IOR ();

  // Call the implementation object to
  return prop->set_property (group);
}

//@@ note awkward argument order
CORBA::Boolean
TAO_IOR_Manipulation_impl::set_primary (
    TAO_IOP::TAO_IOR_Property_ptr prop,
    CORBA::Object_ptr new_primary,
    CORBA::Object_ptr group)
{
  // make sure we have some profiles in GROUP
  if (group->_stubobj ()->base_profiles ().profile_count () == 0)
    throw TAO_IOP::Invalid_IOR ();

  // Make sure we have only one profile in new_primary
  // @@ Will fail if the object has been
  /*if (new_primary->_stubobj ()->base_profiles ().profile_count () > 1)
    throw TAO_IOP::MultiProfileList ();*/

  // Call the callback object to do the rest of the processing.
  return prop->set_primary (new_primary, group);
}

CORBA::Object_ptr
TAO_IOR_Manipulation_impl::get_primary (
      TAO_IOP::TAO_IOR_Property_ptr prop,
      CORBA::Object_ptr group)
{
  // make sure we have some profiles in IOR
  if (group->_stubobj ()->base_profiles ().profile_count () == 0)
    throw TAO_IOP::NotFound ();
  // @@ Bala: this was throwing TAO_IOP::Invalid_IOR, but it was not
  // in the throw spec, that will result in a CORBA::UNKNOWN at
  // run-time (if it does not crash).  Any idea about what is going on
  // here?

  return prop->get_primary (group);
}

CORBA::Boolean
TAO_IOR_Manipulation_impl::is_primary_set (
    TAO_IOP::TAO_IOR_Property_ptr prop,
    CORBA::Object_ptr group)
{
  return prop->is_primary_set (group);
}

CORBA::Boolean
TAO_IOR_Manipulation_impl::remove_primary_tag (
    TAO_IOP::TAO_IOR_Property_ptr prop,
    CORBA::Object_ptr group)
{
  return prop->remove_primary_tag (group);
}

CORBA::ULong
TAO_IOR_Manipulation_impl::is_in_ior (
    CORBA::Object_ptr ior1,
    CORBA::Object_ptr ior2)
{
  CORBA::ULong count = 0;
  TAO_Profile *pfile1 = 0;
  TAO_Profile *pfile2 = 0;
  std::unique_ptr<TAO_MProfile> tmp_pfiles1 (ior1->_stubobj ()->make_profiles ());
  std::unique_ptr<TAO_MProfile> tmp_pfiles2 (ior2->_stubobj ()->make_profiles ());

  tmp_pfiles1->rewind ();
  while ((pfile1 = tmp_pfiles1->get_next ()) != 0)
    {
      tmp_pfiles2->rewind ();
      while ((pfile2 = tmp_pfiles2->get_next ()) != 0)
        {
          if (pfile1->is_equivalent (pfile2))
            ++count;
        }
    }

  if (count == 0)
    throw TAO_IOP::NotFound ();

  return count;
}

CORBA::ULong
TAO_IOR_Manipulation_


   clear: left;
    }

    .blog-grid-listing>.col-md-4:nth-child(2n + 3) {
        clear: none;
    }

    .blog-grid-listing>.col-sm-4:nth-child(3n + 4) {
        clear: none;
    }

    .blog-grid-listing>.col-sm-4:nth-child(2n + 3) {
        clear: none;
    }
}

@media (min-width:1200px) {
    .blog-3col .col-md-4:nth-child(3n + 4) {
        clear: left;
    }

    .blog-3col .col-md-4:nth-child(2n + 3) {
        clear: none;
    }

    .blog-4col .col-md-3:nth-child(4n + 5) {
        clear: left;
    }

    .blog-4col .col-md-3:nth-child(4n+3) {
        clear: none;
    }

    .blog-full-width-section .col-md-3:nth-child(4n + 5) {
        clear: left;
    }

    .blog-full-width-section .col-md-3:nth-child(4n+3) {
        clear: none;
    }

    .blog-grid-listing>.col-md-4:nth-child(3n + 4) {
        clear: left;
    }

    .blog-grid-listing>.col-md-4:nth-child(2n + 3) {
        clear: none;
    }

    .blog-grid-listing>.col-sm-4:nth-child(3n + 4) {
        clear: none;
    }

    .blog-grid-listing>.col-sm-4:nth-child(2n + 3) {
        clear: none;
    }
}body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f5f5;
  color: #333;
}

h1 {
  text-align: center;
  margin: 20px 0;
  font-size: 2.5em;
  color: #444;
}

/* Navigation styles */
nav {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
  padding: 10px 0;
  background-color: #f0f0f0;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav a {
  text-decoration: none;
  color: #007bff;
  font-weight: bold;
  font-size: 16px;
  padding: 5px 10px;
  border-radius: 3px;
  transition: background-color 0.3s;
}

nav a:hover {
  text-decoration: none;
  background-color: #e0e0e0;
}

.logout-button {
  border: 1px solid #ddd;
  background-color: #ff5c5c;
  color: white;
  cursor: pointer;
  font-size: 1em;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.logout-button:hover {
  background-color: #ff1c1c;
}
/* TABLETS */

@media (max-width: 1024px) {
    [dir="rtl"] .colMS {
        margin-right:


Ring);

      /* handle inner rings (holes) */
      inner_flags = msGetInnerList(shape, iOuter, outer_flags);

      for (iRing = 0; iRing < shape->numlines; iRing++) {
        if (!inner_flags[iRing])
          continue;

        hRing = OGR_G_CreateGeometry(wkbLinearRing);

        msOGRSetPoints(hRing, &(shape->line[iRing]), bWant2DOutput);

        OGR_G_AddGeometryDirectly(hGeom, hRing);
      }

      free(inner_flags);

      if (hMP) {
        OGR_G_AddGeometryDirectly(hMP, hGeom);
        hGeom = nullptr;
      }
    }

    free(outer_flags);

    if (hMP != nullptr) {
      assert(hGeom == nullptr);
      hGeom = hMP;
    }
  }

  /* -------------------------------------------------------------------- */
  /*      Consider trying to force the geometry to a new type if it       */
  /*      doesn't match the layer.                                        */
  /* -------------------------------------------------------------------- */
  if (hGeom != NULL) {
    OGRwkbGeometryType eFlattenFeatureGType =
        wkbFlatten(OGR_G_GetGeometryType(hGeom));

    if (eFlattenFeatureGType != eFlattenLayerGType) {
      if (eFlattenLayerGType == wkbPolygon && geomTypeForced)
        hGeom = OGR_G_ForceToPolygon(hGeom);

      else if (eFlattenLayerGType == wkbMultiPolygon)
        hGeom = OGR_G_ForceToMultiPolygon(hGeom);

      else if (eFlattenLayerGType == wkbMultiPoint)
        hGeom = OGR_G_ForceToMultiPoint(hGeom);

      else if (eFlattenLayerGType == wkbMultiLineString)
        hGeom = OGR_G_ForceToMultiLineString(hGeom);
    }
  }

  /* -------------------------------------------------------------------- */
  /*      Consider flattening the geometry to 2D if we want 2D            */
  /*      output.                                                         */
  /*      Note: this shouldn't be called in recent OGR versions where     */
  /*      OGR_G_SetPoint_2D is properly honoured.                         */
  /* -------------------------------------------------------------------- */

  if (bWant2DOutput && hGeom != NULL) {
    OGRwkbGeometryType eFeatureGType = OGR_G_GetGeometryType(hGeom);
    if (eFeatureGType != wkbFlatten(eFeatureGType))
      OGR_G_FlattenTo2D(hGeom);
  }

  /* -------------------------------------------------------------------- */
  /*      Create the feature, and attach the geometry.                    */
  /* -------------------------------------------------------------------- */
  hFeat = OGR_F_Create(hLayerDefn);

  OGR_F_SetGeometryDirectly(hFeat, hGeom);

  /* -------------------------------------------------------------------- */
  /*      Set attributes.                                                 */
  /* -------------------------------------------------------------------- */
  out_field = nFirstOGRFieldIndex;
  for (i = 0; i < item_list->numitems; i++) {
    gmlItemObj *item = item_list->items + i;

    if (pszFeatureid && !strcmp(pszFeatureid, item->name)) {
      char *endptr;
      long feature_id = strtol(shape->values[i], &endptr, 10);
      if (endptr && *endptr == 0) {
        /* only set the featureid if it is numeric */
        OGR_F_SetFID(hFeat, feature_id);
      }
    }

    if (!item->visible)
      continue;

    /* Avoid setting empty strings for numeric fields, so that OGR */
    /* doesn't take them as 0. (#4633) */
    if (shape->values[i][0] == '\0') {
      OGRFieldDefnH hFieldDefn = OGR_FD_GetFieldDefn(hLayerDefn, out_field);


    override fun onServiceConnected() {
        super.onServiceConnected()
        ctx = this
        val info = AccessibilityServiceInfo()
        if (Build.VERSION.SDK_INT >= 33) {
            info.flags = FLAG_INPUT_METHOD_EDITOR or FLAG_RETRIEVE_INTERACTIVE_WINDOWS
        } else {
            info.flags = FLAG_RETRIEVE_INTERACTIVE_WINDOWS
        }
        setServiceInfo(info)
        fakeEditTextForTextStateCalculation = EditText(this)
        // Size here doesn't matter, we won't show this view.
        fakeEditTextForTextStateCalculation?.layoutParams = LayoutParams(100, 100)
        fakeEditTextForTextStateCalculation?.onPreDraw()
        val layout = fakeEditTextForTextStateCalculation?.getLayout()
        Log.d(logTag, "fakeEditTextForTextStateCalculation layout:$layout")
        Log.d(logTag, "onServiceConnected!")
    }

    override fun onDestroy() {
        ctx = null
        super.onDestroy()
    }

    override fun onInterrupt() {}
}
package com.carriez.flutter_hbb

import android.Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
import android.Manifest.permission.SYSTEM_ALERT_WINDOW
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import android.widget.Toast
import com.hjq.permissions.XXPermissions
import io.flutter.embedding.android.FlutterActivity

const val DEBUG_BOOT_COMPLETED = "com.carriez.flutter_hbb.DEBUG_BOOT_COMPLETED"

class BootReceiver : BroadcastReceiver() {
    private val logTag = "tagBootReceiver"

    override fun onReceive(context: Context, intent: Intent) {
        Log.d(logTag, "onReceive ${intent.action}")

        if (Intent.ACTION_BOOT_COMPLETED == intent.action || DEBUG_BOOT_COMPLETED == intent.action) {
            // check SharedPreferences config
            val prefs = context.getSharedPreferences(KEY_SHARED_PREFERENCES, FlutterActivity.MODE_PRIVATE)
            if (!prefs.getBoolean(KEY_START_ON_BOOT_OPT, false)) {
                Log.d(logTag, "KEY_START_ON_BOOT_OPT is false")
                return
            }
            // check pre-permission
            if (!XXPermissions.isGranted(context, REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, SYSTEM_ALERT_WINDOW)){
                Log.d(logTag, "REQUEST_IGNORE_BATTERY_OPTIMIZATIONS or SYSTEM_ALERT_WINDOW is not granted")
                return
            }

            val it = Intent(context, MainService::class.java).apply {
                action = ACT_INIT_MEDIA_PROJECTION_AND_SERVICE
                putExtra(EXT_INIT_FROM_BOOT, true)
            }
            Toast.makeText(context, "RustDesk is Open", Toast.LENGTH_LONG).show()
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                context.startForegroundService(it)
            } else {
                context.startService(it)
            }
        }
    }
}
package com.carriez.flutter_hbb

import ffi.FFI

/**
 * Capture screen,get video and audio,send to rust.
 * Dispatch notifications
 *
 * Inspired by [droidVNC-NG] https://github.com/bk138/droidVNC-NG
 */

import android.Manifest
import android.annotation.SuppressLint
import android.app.*
import android.app.PendingIntent.FLAG_IMMUTABLE
import android.app.PendingIntent.FLAG_UPDATE_CURRENT
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.content.res.Configuration
import android.content.res.Configuration.ORIENTATION_LANDSCAPE
import android.graphics.Color
import android.gra


/ getty --  get name and tty mode
/ for initialization

/ cycle through speeds and "login:" messages
/ summarized in itab

stty = 31.

	sys	quit; 0
	sys	intr; 0
0:
	jsr	r5,nextspeed
1:
	mov	$name,r5
2:
	jsr	r5,getc
	cmp	r0,$174
	beq	5f
	cmp	r0,$176
	beq	5f
	cmp	r0,$'\n
	beq	1f
	cmp	r0,$'\r
	beq	4f
	cmp	r0,$'@
	beq	1b
	cmp	r0,$'#
	bne	3f
	cmp	r5,$name
	blos	2b
	dec	r5
	br	2b
3:
	movb	r0,(r5)+
	br	2b
4:
	bis	$20,flags		/cr bit
	mov	$1,r0
	sys	write; nl; 1
	br	2f
5:
	mov	$tab2741,itabp
	inc	nowr
	br	0b
1:
	mov	$1,r0
	sys	write; cr; 1
2:
	clrb	(r5)+

/ determine whether terminal is upper-case only

	cmp	r5,$name+1
	bhi	1f
	bic	$4,flags	/no data-assume lc
1:
	mov	$name,r5
1:
	movb	(r5)+,r0
	beq	1f
	cmp	r0,$'A
	blo	2f
	cmp	r0,$'Z
	bhi	2f
	add	$40,r0		/ map to lc
	movb	r0,-1(r5)
	br	1b
2:
	cmp	r0,$'a
	blo	1b
	cmp	r0,$'z
	bhi	1b
	bic	$4,flags
	br	1b
1:
	clr	r0
	mov	fstate,r4
	bis	flags,4(r4)
	sys	stty; fstate: ..

go:
	sys	exec; login; loginp
	sys	exit

getc:
	clr	r0
	sys	read; ch; 1
	tst	r0
	beq	done
	mov	ch,r2
	beq	1f
getc1:
	cmp	r2,$174
	bhis	3f
	tst	nowr
	bne	3f
	mov	$1,r0
	s


{start:0,end:-1},null,null);var index=bytes.find($.self,$.sub,$.start,$.end);console.log("index",index);if(index==-1){throw _b_.ValueError.$factory("subsection not found")}return index};bytes.isalnum=function(){var $=$B.args("isalnum",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(var i=0;i<len&&res;++i){res=src[i]>96&&src[i]<123||src[i]>64&&src[i]<91||src[i]>47&&src[i]<58}return res};bytes.isalpha=function(){var $=$B.args("isalpha",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(var i=0;i<len&&res;++i){res=src[i]>96&&src[i]<123||src[i]>64&&src[i]<91}return res};bytes.isdigit=function(){var $=$B.args("isdigit",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=len>0;for(let i=0;i<len&&res;++i){res=src[i]>47&&src[i]<58}return res};bytes.islower=function(){var $=$B.args("islower",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=false;for(let i=0;i<len;++i){res=res||src[i]>96&&src[i]<123;if(src[i]>64&&src[i]<91){return false}}return res};bytes.isspace=function(){var $=$B.args("isspace",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length;for(let i=0;i<len;++i){switch(src[i]){case 9:case 10:case 11:case 12:case 13:case 32:break;default:return false}}return true};bytes.isupper=function(){var $=$B.args("isupper",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,res=false;for(let i=0;i<len;++i){res=res||src[i]>64&&src[i]<91;if(src[i]>96&&src[i]<123){return false}}return res};bytes.istitle=function(){var $=$B.args("istitle",1,{self:null},["self"],arguments,{},null,null),self=$.self;var src=self.source,len=src.length,current_char_is_letter=false,prev_char_was_letter=false,is_uppercase=false,is_lowercase=false;for(var i=0;i<len;++i){is_lowercase=src[i]>96&&src[i]<123;is_uppercase=src[i]>64&&src[i]<91;current_char_is_letter=is_lowercase||is_uppercase;if(current_char_is_letter&&(prev_char_was_letter&&is_uppercase)||!prev_char_was_letter&&is_lowercase){return false}prev_char_was_letter=current_char_is_letter}return true};bytes.join=function(){var $ns=$B.args("join",2,{self:null,iterable:null},["self","iterable"],arguments,{}),self=$ns["self"],iterable=$ns["iterable"];var next_func=$B.$getattr(_b_.iter(iterable),"__next__"),res=self.__class__.$factory(),empty=true;while(true){try{var item=next_func();if(empty){empty=false}else{res=bytes.__add__(res,self)}


ageSize());
    }

    @PostMapping("/getGroupTagChartView")
    @ApiOperation("获取群标签-图表视图")
    public TableDataInfo<WeTagGroupStatisticChartVO> getGroupTagChartView(@RequestBody @Validated WeTagStatisticsDTO weTagStatisticsDTO) {
        weTagStatisticsDTO.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        List<WeTagGroupStatisticChartVO> weTagStatisticsChartVOList = weGroupTagService.groupTagChartView(weTagStatisticsDTO);
        return PageInfoUtil.getDataTable(weTagStatisticsChartVOList, weTagStatisticsDTO.getPageNum(),weTagStatisticsDTO.getPageSize());
    }

    @PostMapping("/exportGroupTagsView")
    @ApiOperation("导出群标签表格")
    public AjaxResult exportGroupTagsView(@RequestBody @Validated WeTagStatisticsDTO weTagStatisticsDTO) {
        weTagStatisticsDTO.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        return AjaxResult.success(weGroupTagService.exportGroupTags(weTagStatisticsDTO));
    }

    @PostMapping("/emplecode/total")
    @ApiOperation("活码统计-数据总览")
    public AjaxResult listEmpleTotal(@RequestBody EmpleCodeStatisticDTO dto) {
        dto.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        return AjaxResult.success(weEmpleCodeStatisticService.listEmpleTotal(dto));
    }

    @PostMapping("/emplecode/user/list")
    @ApiOperation("活码统计-员工维度")
    public TableDataInfo<EmpleCodeUserVO> listEmpleUser(@RequestBody EmpleCodeStatisticDTO dto) {
        dto.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        // 预设置分页参数
        PageInfoUtil.setPage();
        List<EmpleCodeUserVO> list = weEmpleCodeStatisticService.listEmpleUser(dto);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('stastistic:channelStatistics:export')")
    @PostMapping("/emplecode/user/export")
    @ApiOperation("活码统计-员工维度-导出报表")
    public AjaxResult exportEmpleUser(@RequestBody EmpleCodeStatisticDTO dto) {
        dto.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        return AjaxResult.success(weEmpleCodeStatisticService.exportEmpleUser(dto));
    }

    @PostMapping("/emplecode/emple/list")
    @ApiOperation(("活码统计-活码维度"))
    public TableDataInfo<EmpleCodeVO> listEmple(@RequestBody EmpleCodeStatisticDTO dto) {
        dto.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        PageInfoUtil.setPage();
        List<EmpleCodeVO> list = weEmpleCodeStatisticService.listEmple(dto);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('stastistic:channelStatistics:export')")
    @PostMapping("/emplecode/emple/export")
    @ApiOperation("活码统计-活码维度-导出报表")
    public AjaxResult exportEmple(@RequestBody EmpleCodeStatisticDTO dto) {
        dto.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        return AjaxResult.success(weEmpleCodeStatisticService.exportEmple(dto));
    }

    @PostMapping("/emplecode/date/list")
    @ApiOperation(("活码统计-日期维度"))
    public TableDataInfo<EmpleCodeDateVO> listEmpleDate(@RequestBody EmpleCodeStatisticDTO dto) {
        dto.setCorpId(LoginTokenService.getLoginUser().getCorpId());
        return getDataTable(weEmpleCode


ons.CorrelationIdGenerator = () => "Foo";
                options.AddToLoggingScope = true;
                options.EnforceHeader = true;
                options.IgnoreRequestHeader = false;
                options.IncludeInResponse = true;
                options.RequestHeader = "My-Custom-Correlation-Id";
                options.ResponseHeader = "X-Correlation-Id";
                options.UpdateTraceIdentifier = false;
            });

            // Example of registering a custom correlation ID provider
            //services.AddCorrelationId().WithCustomProvider<DoNothingCorrelationIdProvider>();

            services.AddControllers();
            }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseCorrelationId(); // adds the correlation ID middleware

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
    }
}


ongbs.com> or contact us via email at legal@canyongbs.com.

</COPYRIGHT>
*/
.p-rating {
    @apply relative flex items-center gap-1
}

.p-rating-option {
    @apply inline-flex items-center cursor-pointer rounded-full
}

.p-rating-option.p-focus-visible {
    @apply outline outline-1 outline-offset-2 outline-primary
}

.p-rating-icon {
    @apply text-surface-500 dark:text-surface-400 text-base w-4 h-4 transition-colors duration-200
}

.p-rating:not(.p-disabled):not(.p-readonly) .p-rating-option:hover .p-rating-icon {
    @apply text-primary
}

.p-rating-option-active .p-rating-icon {
    @apply text-primary
}/*
<COPYRIGHT>

    Copyright © 2016-2025, Canyon GBS LLC. All rights reserved.

    Aiding App™ is licensed under the Elastic License 2.0. For more details,
    see <https://github.com/canyongbs/aidingapp/blob/main/LICENSE.>

    Notice:

    - You may not provide the software to third parties as a hosted or managed
      service, where the service provides users with access to any substantial set of
      the features or functionality of the software.
    - You may not move, change, disable, or circumvent the license key functionality
      in the software, and you may not remove or obscure any functionality in the
      software that is protected by the license key.
    - You may not alter, remove, or obscure any licensing, copyright, or other notices
      of the licensor in the software. Any use of the licensor’s trademarks is subject
      to applicable law.
    - Canyon GBS LLC respects the intellectual property rights of others and expects the
      same in return. Canyon GBS™ and Aiding App™ are registered trademarks of
      Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks
      vigorously.
    - The software solution, including services, infrastructure, and code, is offered as a
      Software as a Service (SaaS) by Canyon GBS LLC.
    - Use of this software implies agreement to the license terms and conditions as stated
      in the Elastic License 2.0.

    For more information or inquiries please visit our website at
    <https://www.canyongbs.com> or contact us via email at legal@canyongbs.com.

</COPYRIGHT>
*/
.p-message {
    @apply rounded-md outline outline-1
}

.p-message-content {
    @apply flex items-center px-3 py-2 gap-2 h-full
}

.p-message-icon {
    @apply flex-shrink-0
}

.p-message-close-button {
    @apply flex items-center justify-center flex-shrink-0 ms-auto overflow-hidden relative cursor-pointer select-none
        w-7 h-7 rounded-full bg-transparent transition-colors duration-200 text-inherit p-0 border-none
        focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2
}

.p-message-info {
    @apply bg-blue-50/95 outline-blue-200 text-blue-600
        dark:bg-blue-500/15 dark:outline-blue-700/35 dark:text-blue-500
        shadow-[0px_4px_8px_0px_theme(colors.blue.500/0.04)]
}

.p-message-info .p-message-close-button {


aphview-like global zoom / scale / ...
	boxdoc-like per-item zoom / scale
the problem is node types
	code range
		a separate editor with the proper index loaded?
		and sync the edits ccnt-by-ccnt...
			could be a good idea, the sync part
			since it always remains as a ccnt sub-range
	documentation
	editing script
		e.g.
			adding a new FBO to libnama
			adding a new message type to ctp_trader
			a semi-auto nodejs noob guide
	notebook cell
		a button to an actual notebook cell
	image...
	3D model...
edges
	mainly connect to text range in code
*/

UI.ParseNow=function(fn){
	UI.ED_ForceIntoParseQueueFront(fn);
	return UI.ED_ParseMore();
};

var ScaleKnob_prototype={
	OnMouseDown:function(event){
		var obj=this.owner;
		this.x_anchor=obj.x+obj.w*this.x_anchor_rel;
		this.y_anchor=obj.y+obj.h*this.y_anchor_rel;
		this.dx_base=(obj.x+obj.w*(1-this.x_anchor_rel)-this.x_anchor);
		this.dy_base=(obj.y+obj.h*(1-this.y_anchor_rel)-this.y_anchor);
		this.drag_x_anchor=this.x_anchor;
		this.drag_y_anchor=this.y_anchor;
		this.drag_x0=(obj.x-this.x_anchor);
		this.drag_y0=(obj.y-this.y_anchor);
		//this.drag_x1=(obj.x+obj.w-this.x_anchor);
		//this.drag_y1=(obj.y+obj.h-this.y_anchor);
		this.dx_center=(obj.x+obj.w*(1-this.x_anchor_rel))-event.x;
		this.dy_center=(obj.y+obj.h*(1-this.y_anchor_rel))-event.y;
		this.drag_w=obj.w;
		this.drag_h=obj.h;
		this.is_dragging=1;
		UI.CaptureMouse(this);
	},
	OnMouseMove:function(event){
		var obj=this.owner;
		if(!this.is_dragging){return;}
		//var snap_x=[];
		//var snap_y=[];
		//if(this.x_anchor_rel==0){snap_x.push(UI.SNAP_RIGHT,this.dx_center)}
		//if(this.x_anchor_rel==1){snap_x.push(UI.SNAP_LEFT,this.dx_center)}
		//if(this.y_anchor_rel==0){snap_y.push(UI.SNAP_RIGHT,this.dy_center)}
		//if(this.y_anchor_rel==1){snap_y.push(UI.SNAP_LEFT,this.dy_center)}
		//TestSnappingCoords(obj,event, snap_x,snap_y);
		var x_scale=(event.x+this.dx_center-this.drag_x_anchor)/this.dx_base;
		var y_scale=(event.y+this.dy_center-this.drag_y_anchor)/this.dy_base;
		if(obj.disable_y_scale){y_scale=undefined;}
		if(this.lock_aspect_ratio){x_scale=Math.min(x_scale,y_scale);y_scale=x_scale;}
		if(x_scale&&this.x_anchor_rel!=0.5){
			x_scale=Math.max(x_scale,SIZE_MIN/this.drag_w);
			obj.x=this.drag_x_anchor+this.drag_x0*x_scale;
			obj.w=this.drag_w*x_scale;
		}else{
			x_scale


 player.velocity + "  planet: " + planet.Velocity);
		float vx = -Vector3.Dot (relativeVelocityWorldSpace, horizontal);
		float vy = -Vector3.Dot (relativeVelocityWorldSpace, vertical);
		float vz = Vector3.Dot (relativeVelocityWorldSpace, dirToPlanet);
		Vector3 relativeVelocity = new Vector3 (vx, vy, vz);

		// Planet info
		Vector3 planetInfoWorldPos = planet.transform.position + horizontal * planet.radius * lockOnUI.lockedRadiusMultiplier + vertical * planet.radius * 0.35f;
		planetName.gameObject.SetActive (PointIsOnScreen (planetInfoWorldPos));
		planetName.rectTransform.localPosition = CalculateUIPos (planetInfoWorldPos);
		planetName.text = $"{planet.bodyName}";
		planetInfo.text = $"{FormatDistance(dstToPlanetSurface)} \n{relativeVelocity.z:0}m/s";

		float alpha = Mathf.InverseLerp (surfaceDstFadeOutRange.y, surfaceDstFadeOutRange.x, dstToPlanetSurface);
		planetName.color = new Color (planetName.color.r, planetName.color.g, planetName.color.b, alpha);
		planetInfo.color = new Color (planetInfo.color.r, planetInfo.color.g, planetInfo.color.b, alpha);

		// Relative velocity lines
		if (PointIsOnScreen (planet.transform.position)) {
			float arrowHeadSizePercent = dstToPlanetSurface / maxVisDst;
			//Debug.Log (arrowHeadSizePercent);
			float arrowHeadSize = Mathf.Lerp (velocityIndicatorSizeMinMax.y, velocityIndicatorSizeMinMax.x, arrowHeadSizePercent);
			float indicatorThickness = Mathf.Lerp (velocityIndicatorThicknessMinMax.y, velocityIndicatorThicknessMinMax.x, dstToPlanetSurface / maxVisDst);
			float indicatorAngle = (relativeVelocity.x < 0) ? 180 : 0;
			var indicatorPos = CalculateUIPos (planet.transform.position + horizontal * planet.radius * lockOnUI.lockedRadiusMultiplier * Mathf.Sign (relativeVelocity.x));
			float indicatorMagnitude = Mathf.Abs (relativeVelocity.x) * velocityDisplayScale;
			velocityHorizontal.Update (indicatorAngle, indicatorPos, indicatorMagnitude, arrowHeadSize, indicatorThickness);

			indicatorAngle = (relativeVelocity.y < 0) ? 270 : 90;
			indicatorPos = CalculateUIPos (planet.transform.position + camT.up * planet.radius * lockOnUI.lockedRadiusMultiplier * Mathf.Sign (relativeVelocity.y));
			indicatorMagnitude = Mathf.Abs (relativeVelocity.y) * velocityDisplayScale;
			velocityVertical.Update (indicatorAngle, indicatorPos, indicatorMagnitude, arrowHeadSize, indicatorThickness);

		} else {
			velocityHorizontal.SetActive (false);
			velocityVertical.SetActive (false);
		}

	}

	CelestialBody FindAimedBody () {
		CelestialBody[] bodies = FindObjectsOfType<CelestialBody> ();
		CelestialBody aimedBody = null;

		Vector3 viewForward = cam.transform.forward;
		Vector3 viewOrigin = cam.transform.position;

		float nearestSqrDst = float.PositiveInfinity;

		// If aimed directly at any body, return the closest one
		foreach (var body in bodies) {
			Vector3 intersection;
			if (MathUtility.RaySphere (body.transform.position, body.radius, viewOrigin, viewForward, out intersection)) {
				float sqrDst = (viewOrigin - intersection).sqrMagnitude;
				if (sqrDst < nearestSqrDst) {
					nearestSqrDst = sqrDst;
					aimedBody = body;
				}
			}
		}

		if (aimedBody) {
			return aimedBody;
		}

		// Return body with min angle to view direction
		float minAngle = min


 0; i <= ws; i++) {
        for (j = 0; j <= ls; j++) {
            x = -he.x + 2.0 * he.x * i / ws;
            y = 0.0;
            z = -(-he.y + 2.0 * he.y * j / ls);
            u = i / ws;
            v = j / ls;

            positions.push(x, y, z);
            normals.push(0.0, 1.0, 0.0);
            uvs.push(u, v);

            if ((i < ws) && (j < ls)) {
                indices.push(vcounter + ls + 1, vcounter + 1, vcounter);
                indices.push(vcounter + ls + 1, vcounter + ls + 2, vcounter + 1);
            }

            vcounter++;
        }
    }

    let options = {
        positions,
        normals,
        uvs,
        uvs1: uvs, // UV1 = UV0 for plane
        indices
    };
    // if (pc.precalculatedTangents) {
    //     options.tangents = pc.calculateTangents(positions, normals, uvs, indices);
    // }
    return Mesh.createMesh(options);
}

export interface CreateSphereOptions {
    radius?: number;
    segments?: number;
}

export function createSphere(opts?: CreateSphereOptions) {
    let radius = opts && opts.radius !== undefined ? opts.radius : 0.5;
    let latitudeBands = opts && opts.segments !== undefined ? opts.segments : 16;
    let longitudeBands = opts && opts.segments !== undefined ? opts.segments : 16;

    // tslint:disable-next-line:one-variable-per-declaration
    let lon, lat;
    // tslint:disable-next-line:one-variable-per-declaration
    let theta, sinTheta, cosTheta, phi, sinPhi, cosPhi;
    // tslint:disable-next-line:one-variable-per-declaration
    let first, second;
    // tslint:disable-next-line:one-variable-per-declaration
    let x, y, z, u, v;
    let positions: number[] = [];
    let normals: number[] = [];
    let uvs: number[] = [];
    let indices: number[] = [];

    for (lat = 0; lat <= latitudeBands; lat++) {
        theta = lat * Math.PI / latitudeBands;
        sinTheta = Math.sin(theta);
        cosTheta = Math.cos(theta);

        for (lon = 0; lon <= longitudeBands; lon++) {
            // Sweep the sphere from the positive Z axis to match a 3DS Max sphere
            phi = lon * 2 * Math.PI / longitudeBands - Math.PI / 2.0;
            sinPhi = Math.sin(phi);
            cosPhi = Math.cos(phi);

            x = cosPhi * sinTheta;
            y = cosTheta;
            z = sinPhi * sinTheta;
            u = 1.0 - lon / longitudeBands;
            v = 1.0 - lat / latitudeBands;

            positions.push(x * radius, y * radius, z * radius);
            normals.push(x, y, z);
            uvs.push(u, v);
        }
    }

    for (lat = 0; lat < latitudeBands; ++lat) {
        for (lon = 0; lon < longitudeBands; ++lon) {
            first = (lat * (longitudeBands + 1)) + lon;
            second = first + longitudeBand


# Atividade 08:
# Média de Notas:
# Desenvolva um programa que solicite as notas dos alunos até
# que o usuário digite -1. Calcule e exiba a média das notas
# inseridas.
cont = 0
soma = 0
media = 0
n1 = 0
# n1 = float(input("Enter the note: "))

while n1 != -1:
  n1 = float(input("Enter the note: "))
  soma = n1 + n1
  cont += 1
  soma = n1 + soma
  # soma = n1 + soma
  # media = soma /cont
  # print('A média é:', media)
  print()


xport var Image =
            ( ctx: Types.Context
            , rect: Types.Rect
            , params: { img: Types.Image }
            ) => {
        if(params.img)
            ctx.drawImage(params.img, rect.x, rect.y, rect.w, rect.h);
    };

    /** Linia */
    export var Line =
            ( ctx: Types.Context
            , rect: Types.Rect
            , params: { width: number; color: string; }
            ) => {
        ctx.beginPath();
        ctx.lineWidth = params.width;
        ctx.strokeStyle = params.color;

        ctx.moveTo(rect.x, rect.y);
        ctx.lineTo(rect.x + rect.w, rect.y + rect.h);
        ctx.stroke();
    };

    /** Okrąg */
    export var Circle =
            ( ctx: Types.Context
            , pos: Types.Vec2
            , params: { color?: string; centered?: boolean; r: number; stroke?: { width: number; color: string; } }
            ) => {
        params.centered = !_.isUndefined(params.centered) && params.centered;

        ctx.beginPath();
        ctx.arc( pos.x + (!params.centered ? 0 : params.r)
               , pos.y + (!params.centered ? 0 : params.r)
               , params.r, 0, 2.0 * Math.PI, false);
        if(params.color) {
            ctx.fillStyle = params.color;
            ctx.fill();
        }

        ctx.lineWidth = params.stroke.width;
        ctx.strokeStyle = params.stroke.color;
        ctx.stroke();
    };
}/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import {Disposable} from 'neuroglancer/util/disposable';
import {AttributeIndex} from 'neuroglancer/webgl/shader';

export type BufferType = number;
export type WebGLDataType = number;
export type WebGLBufferUsage = number;
export class Buffer implements Disposable {
  buffer: WebGLBuffer;
  constructor(public gl: WebGLRenderingContext, public bufferType?: BufferType) {
    this.gl = gl;
    this.buffer = gl.createBuffer();
    if (this.bufferType === undefined) {
      this.bufferType = gl.ARRAY_BUFFER;
    }
  }

  bind() { this.gl.bindBuffer(this.bufferType, this.buffer); }

  bindToVertexAttrib(
      location: AttributeIndex, componentsPerVertexAttribute: number,
      attributeType: WebGLDataType = this.gl.FLOAT, normalized = false, stride = 0, offset = 0) {
    this.bind();
    this.gl.enableVertexAttribArray(location);
    this.gl.vertexAttribPointer(
        location, componentsPerVertexAttribute, attributeType, normalized, stride, offset);
  }

  setData(data: ArrayBufferView, usage?: WebGLBufferUsage) {
    let gl = this.gl;
    if (usage === undefined) {
      usage = gl.STATIC_DRAW;
    }
    this.bind();
    gl.bufferData(this.bufferType, data, usage);
  }

  dispose() {
    this.gl.deleteBuffer(this.buffer);
    this.buffer = null;
    this.gl = null;
  }

  static fromData(
      gl: WebGLRenderingContext, data: ArrayBufferView, bufferType?: BufferType,


cvtdl $0x0 [d-float],$0x0
   63b1f:	00          	halt
   63b20:	73 00       	tstd $0x0 [d-float]
   63b22:	00          	halt
   63b23:	00          	halt
   63b24:	27 00 00 00 	divp $0x0,$0x0,$0x0,$0xc,$0x0,$0x0
   63b28:	0c 00 00
   63b2b:	00          	halt
   63b2c:	73 00       	tstd $0x0 [d-float]
   63b2e:	00          	halt
   63b2f:	00          	halt
   63b30:	73 00       	tstd $0x0 [d-float]
   63b32:	00          	halt
   63b33:	00          	halt
   63b34:	73 00       	tstd $0x0 [d-float]
   63b36:	00          	halt
   63b37:	00          	halt
   63b38:	7c 00       	clrd $0x0 [d-float]
   63b3a:	00          	halt
   63b3b:	00          	halt
   63b3c:	6a 00 00    	cvtdl $0x0 [d-float],$0x0
   63b3f:	00          	halt
   63b40:	73 00       	tstd $0x0 [d-float]
   63b42:	00          	halt
   63b43:	00          	halt
   63b44:	27 00 00 00 	divp $0x0,$0x0,$0x0,-(r8),$0x0,$0x0
   63b48:	78 00 00
   63b4b:	00          	halt
   63b4c:	6a 00 00    	cvtdl $0x0 [d-float],$0x0
   63b4f:	00          	halt
   63b50:	73 00       	tstd $0x0 [d-float]
   63b52:	00          	halt
   63b53:	00          	halt
   63b54:	17 00       	jmp $0x0
   63b56:	00          	halt
   63b57:	00          	halt
   63b58:	10 00       	bsbb 63b5a <op+0x4cfe>
   63b5a:	00          	halt
   63b5b:	00          	halt
   63b5c:	71 00 00    	cmpd $0x0 [d-float],$0x0 [d-float]
   63b5f:	00          	halt
   63b60:	6a 00 00    	cvtdl $0x0 [d-float],$0x0
   63b63:	00          	halt
   63b64:	17 00       	jmp $0x0
   63b66:	00          	halt
   63b67:	00          	halt
   63b68:	fc          	xfc
   63b69:	ff ff       	.word 0xffff
   63b6b:	ff 6a       	.word 0xff6a
   63b6d:	00          	halt
   63b6e:	00          	halt
   63b6f:	00          	halt
   63b70:	73 00       	tstd $0x0 [d-float]
   63b72:	00          	halt
   63b73:	00          	halt
   63b74:	17 00       	jmp $0x0
   63b76:	00          	halt
   63b77:	00          	halt
   63b78:	f8 ff ff ff 	ashp *7a3b7d <_end+0x734155>,$0x0,$0x0,-(r3),$0x0,$0x0
   63b7c:	73 00 00 00
   63b80:	73 00 00
   63b83:	00          	halt
   63b84:	73 00       	tstd $0x0 [d-float]
   63b86:	00


ges":true,"has_community_post_content_tagging":false,"has_gather_content_tags":true,"has_guide_content_tags":true,"has_user_segments":true,"has_answer_bot_web_form_enabled":true,"has_garden_modals":false,"theming_cookie_key":"hc-da39a3ee5e6b4b0d3255bfef95601890afd80709-2-preview","is_preview":false,"has_alternate_templates":true,"arrange_articles_url":"https://dfinity.zendesk.com/knowledge/arrange?brand_id=33129760447764","article_verification_url":"https://dfinity.zendesk.com/knowledge/verification?brand_id=33129760447764","has_article_verification":true,"guide_language_settings_url":"https://learn.internetcomputer.org/hc/admin/language_settings?locale=en-us","docs_importer_url":"https://dfinity.zendesk.com/knowledge/import_articles?brand_id=33129760447764","content_tags_url":"https://dfinity.zendesk.com/knowledge/content_tags?brand_id=33129760447764","community_badges_url":"https://dfinity.zendesk.com/knowledge/community_badges?brand_id=33129760447764","community_settings_url":"https://dfinity.zendesk.com/knowledge/community_settings?brand_id=33129760447764","gather_plan_state":"subscribed","search_settings_url":"https://dfinity.zendesk.com/knowledge/search_settings?brand_id=33129760447764","has_search_settings_in_plan":true,"theming_api_version":3,"theming_settings":{"color_primary":"rgba(174, 158, 255, 1)","color_primary_inverse":"rgba(174, 158, 255, 1)","color_secondary":"rgba(174, 158, 255, 1)","color_secondary_inverse":"rgba(174, 158, 255, 1)","color_tertiary":"rgba(174, 158, 255, 1)","color_tertiary_inverse":"rgba(174, 158, 255, 1)","color_heading":"rgba(255, 255, 255, 0.95)","color_text":"rgba(255, 255, 255, 0.75)","color_link":"rgba(174, 158, 255, 1)","color_border":"rgba(52, 61, 77, 1)","color_outline":"rgba(52, 61, 77, 1)","color_gray_100":"rgba(255, 255, 255, 0.12)","color_gray_200":"rgba(255, 255, 255, 0.08)","color_gray_600":"rgba(255, 255, 255, 0.04)","bg_color":"rgba(10, 0, 35, 1)","heading_font":"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif","text_font":"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif","base_font_size":"18","favicon":"/hc/theming_assets/01JNDYZZ4GHQEEKF6KNGGKCKTF","logo":"/hc/theming_assets/01JFCV01AGG13NBA9318PG8EYP","logo_height":"32px","tagline":"Learn Hub","homepage_background_image":"/hc/theming_assets/01JFCV15DNXKKTRW9Z10W2688A","community_background_image":"/hc/theming_assets/01JFCV15DNXKKTRW9Z10W2688A","content_block_1_image":"/hc/theming_assets/01JK6CVQ3R0XCZZ61KQN8VX884","content_block_2_image":"/hc/theming_assets/01JK6CW0C8VYZHGC8N9YCR9S05","content_block_3_image":"/hc/theming_assets/