50, 100, 100, 325, 300};
        // All surface normals are along track dir: ref.dot_normal = {}
        ref.halfway_safeties = {22.5, 30, 47.5, 25, 50, 50, 162.5, 150};

        if (is_orange)
        {
            // TODO: at this exact point it ignores the cylindrical distance
            ref.halfway_safeties[1] = result.halfway_safeties[1];
        }
        auto tol = test_->tracking_tol();
        EXPECT_REF_NEAR(ref, result, tol);
    }
    {
        SCOPED_TRACE("backward along z");
        auto result = test_->track({25, 0, 701}, {0, 0, -1});

        GenericGeoTrackingResult ref;
        ref.volumes = {"world", "vacuum_tube", "world"};
        ref.volume_instances = {"world_PV", "vacuum_tube_pv", "world_PV"};
        ref.distances = {1, 1400, 1300};
        // All surface normals are along track dir: ref.dot_normal = {}
        ref.halfway_safeties = {0.5, 5, 650};

        if (is_orange)
        {
            ref.halfway_safeties[2] = result.halfway_safeties[2];
        }
        auto tol = test_->tracking_tol();
        EXPECT_REF_NEAR(ref, result, tol);
    }
}

//---------------------------------------------------------------------------//
// TESTEM3 NESTED
//---------------------------------------------------------------------------//
void TestEm3GeoTest::test_trace() const
{
    {
        auto result = test_->track({-20.1}, {1, 0, 0});
        result.volume_instances.clear();  // boring

        GenericGeoTrackingResult ref;
        ref.volumes = {
            "world", "pb",  "lar",   "pb",  "lar", "pb",  "lar", "pb",  "lar",
            "pb",    "lar", "pb",    "lar", "pb",  "lar", "pb",  "lar", "pb",
            "lar",   "pb",  "lar",   "pb",  "lar", "pb",  "lar", "pb",  "lar",
            "pb",    "lar", "pb",    "lar", "pb",  "lar", "pb",  "lar", "pb",
            "lar",   "pb",  "lar",   "pb",  "lar", "pb",  "lar", "pb",  "lar",
            "pb",    "lar", "pb",    "lar", "pb",  "lar", "pb",  "lar", "pb",
            "lar",   "pb",  "lar",   "pb",  "lar", "pb",  "lar", "pb",  "lar",
            "pb",    "lar", "pb",    "lar", "pb",  "lar", "pb",  "lar", "pb",
            "lar",   "pb",  "lar",   "pb",  "lar", "pb",  "lar", "pb",  "lar",
            "pb",    "lar", "pb",    "lar", "pb",  "lar", "pb",  "lar", "pb",
            "lar",   "pb",  "lar",   "pb",  "lar", "pb",  "lar", "pb",  "lar",
            "pb",    "lar", "world",
        };
        ref.volume_instances = {};
        ref.distances = {
            0.1,  0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57,
            0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23,
            0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57,
            0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23,
            0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57, 0.23, 0.57,
            0.23, 0.57, 0.23, 0.57, 0.


  }
            return result;
        }
        public virtual DateTime? GetFromMonth()
        {
            var filterByMonth = GetParsedMonth();
            if (filterByMonth.HasValue)
                return filterByMonth.Value;
            return null;
        }
        public virtual DateTime? GetToMonth()
        {
            var filterByMonth = GetParsedMonth();
            if (filterByMonth.HasValue)
                return filterByMonth.Value.AddMonths(1).AddSeconds(-1);
            return null;
        }
        #endregion

        #region Properties

        public string Month { get; set; }
        public string Tag { get; set; }
        public string CategorySeName { get; set; }
        public string SearchKeyword { get; set; }

        #endregion
    }
}


ge(p, s,pagedata);

  int idata = CDVDTeletextTools::deh24(pagedata + 40*(packet-1) + 1 + 3*triplet);
  int iONr;

  if (idata < 0)  /* hamming error: ignore triplet */
    return;
  if (high)
    iONr = idata >> 9; /* triplet number of odd object data */
  else
    iONr = idata & 0x1ff; /* triplet number of even object data */
  if (iONr <= 506)
  {
    Eval_Object(iONr, m_txtCache->astCachetable[p][s], pAPx, pAPy, pAPx0, pAPy0, (tObjType)(triplet % 3),pagedata, PageChar, PageAtrb);
  }
}

int CTeletextDecoder::Eval_Triplet(int iOData, TextCachedPage_t *pstCachedPage,
            unsigned char *pAPx, unsigned char *pAPy,
            unsigned char *pAPx0, unsigned char *pAPy0,
            unsigned char *drcssubp, unsigned char *gdrcssubp,
            signed char *endcol, TextPageAttr_t *attrPassive, unsigned char* pagedata, unsigned char* PageChar, TextPageAttr_t* PageAtrb)
{
  int iAddress = (iOData      ) & 0x3f;
  int iMode    = (iOData >>  6) & 0x1f;
  int iData    = (iOData >> 11) & 0x7f;

  if (iAddress < 40) /* column addresses */
  {
    int offset;  /* offset to PageChar and PageAtrb */

    if (iMode != 0x06)
      *pAPx = iAddress;  /* new Active Column */
    offset = (*pAPy0 + *pAPy) * 40 + *pAPx0 + *pAPx;  /* offset to PageChar and PageAtrb */

    switch (iMode)
    {
    case 0x00:
      if (0 == (iData>>5))
      {
        int newcolor = iData & 0x1f;
        if (*endcol < 0) /* passive object */
          attrPassive->fg = newcolor;
        else if (*endcol == 40) /* active object */
        {
          TextPageAttr_t *p = &PageAtrb[offset];
          int oldcolor = (p)->fg; /* current color (set-after) */
          int c = *pAPx0 + *pAPx;  /* current column absolute */
          do
          {
            p->fg = newcolor;
            p++;
            c++;
          } while (c < 40 && p->fg == oldcolor);  /* stop at change by level 1 page */
        }
        else /* adaptive object */
        {
          TextPageAttr_t *p = &PageAtrb[offset];
          int c = *pAPx;  /* current column relative to object origin */
          do
          {
            p->fg = newcolor;
            p++;
            c++;
          } while (c <= *endcol);
        }
      }
      break;
    case 0x01:
      if (iData >= 0x20)
      {
        PageChar[offset] = iData;
        if (*endcol < 0) /* passive object */
        {
          attrPassive->charset = C_G1C; /* FIXME: separated? */
          PageAtrb[offset] = *attrPassive;
        }
        else if (PageAtrb[offset].charset != C_G1S)
          PageAtrb[offset].charset = C_G1C; /* FIXME: separated? */
      }
      break;
    case 0x02:
    case 0x0b:
      PageChar[offset] = iData;
      if (*endcol < 0) /* passive object */
      {
        attrPassive->charset = C_G3;
        PageAtrb[offset] = *attrPassive;
      }
      else
        PageAtrb[offset].charset = C


use_weights) as scope:
      with slim.arg_scope(
          mobilenet_v1.mobilenet_v1_arg_scope(
              is_training=None, regularize_depthwise=True)):
        with (slim.arg_scope(self._conv_hyperparams_fn())
              if self._override_base_feature_extractor_hyperparams
              else context_manager.IdentityContextManager()):
          _, image_features = mobilenet_v1.mobilenet_v1_base(
              ops.pad_to_multiple(preprocessed_inputs, self._pad_to_multiple),
              final_endpoint='Conv2d_13_pointwise',
              min_depth=self._min_depth,
              depth_multiplier=self._depth_multiplier,
              use_explicit_padding=self._use_explicit_padding,
              scope=scope)
      with slim.arg_scope(self._conv_hyperparams_fn()):
        feature_maps = feature_map_generators.multi_resolution_feature_maps(
            feature_map_layout=feature_map_layout,
            depth_multiplier=self._depth_multiplier,
            min_depth=self._min_depth,
            insert_1x1_conv=True,
            image_features=image_features)

    return list(feature_maps.values())


FF;
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  padding: 15px;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 14px;
  color:#333333;
}

.smsOnRailsHtml h1 {
  background-color: #2F8BBB;
  blah: #3366FF;
  color: #DDDDDD;
  text-align: center;
  padding: 20px;
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
}

.smsOnRailsHtml h2 {
  text-align: center;
}

/* Links Start */
.smsOnRailsHtml a, .smsOnRailsHtml a:link, .smsOnRailsHtml a:visited {
  color: #2F8BBB;
  text-decoration: none;
}
.smsOnRailsHtml a:hover, .smsOnRailsHtml a:active {
  /*text-decoration: underline;*/
  color: #000000;
  background: none;
  text-decoration: underline;
}

.smsOnRailsHtml table {
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  padding: 5px;
  border-collapse: collapse;
  background-color: #EBEBEB;
}

.smsOnRailsHtml th.long {
  width:100%;
}
.smsOnRailsHtml th.short {
  width:2px;
}

.smsOnRailsHtml th {
  padding: 3px;
  border: 0px;
  text-align: left;
  color: black;
  padding-right: 20px;
  width:20%;
}

.smsOnRailsHtml tr.odd {
  background-color: #EBEBEB;
  width:100%;
}

.smsOnRailsHtml tr.even {
  background-color: #FFFFFF;
  width:100%;
}

.smsOnRailsHtml td {
  padding: 3px;
}

.smsOnRailsHtml table a {
  display: block;
  width:100%;
  height:100%;
}

.smsOnRailsHtml p {
  padding: 0 25%;
}

.smsFlashNotice {
  color: #00CC99;
}
/* ERROR MESSAGES */
.smsOnRailsHtml .fieldWithErrors {
  padding: 0 25%;
  display: table;
  color:#FF9966;
}

.smsOnRailsHtml #errorExplanation {
  width: 500px;
  border: 2px solid #FF9966;
  padding: 7px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  background-color: #EBEBEB;
  margin-left:20%;
  -moz-border-radius: 18px;
  -webkit-border-radius: 18px;
}

.smsOnRailsHtml #errorExplanation h2 {
  text-align: left;
  font-weight: bold;
  padding: 5px 5px 5px 15px;
  font-size: 12px;
  margin: -7px;
  background-color: #FF9966;
  color: #fff;
  -moz-border-radius: 15px 15px 0 0;
  -webkit-border-radius: 15px 15px 0 0;
}

.smsOnRailsHtml #errorExplanation p {
  color: #FF9966;
  margin-bottom: 0;
  padding: 5px;
}

.smsOnRailsHtml #errorExplanation ul li {
  font-size: 13px;
}
.smsOnRailsImage {
  background-image:url(/images/sms_on_rails/yoDawg.jpg);
}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {

    .no-scrollbar::-webkit-scrollbar {
        display: none;
    }

    .draggable {
        -webkit-app-region: drag;
    }

    ::-webkit-scrollbar {
        width: 8px;
        background: #2d2d2d00;
    }

    table {
        /* border none */
        border-ra


edBlocks",
              node.decommissioningStatus.getUnderReplicatedBlocks())
          .put("decommissionOnlyReplicas",
              node.decommissioningStatus.getDecommissionOnlyReplicas())
          .put("underReplicateInOpenFiles",
              node.decommissioningStatus.getUnderReplicatedInOpenFiles())
          .build();
      info.put(node.getHostName(), innerinfo);
    }
    return JSON.toString(info);
  }

  private long getLastContact(DatanodeDescriptor alivenode) {
    return (Time.now() - alivenode.getLastUpdate())/1000;
  }

  private long getDfsUsed(DatanodeDescriptor alivenode) {
    return alivenode.getDfsUsed();
  }

  @Override  // NameNodeMXBean
  public String getClusterId() {
    return getFSImage().getStorage().getClusterID();
  }

  @Override  // NameNodeMXBean
  public String getBlockPoolId() {
    return blockPoolId;
  }

  @Override  // NameNodeMXBean
  public String getNameDirStatuses() {
    Map<String, Map<File, StorageDirType>> statusMap =
      new HashMap<String, Map<File, StorageDirType>>();

    Map<File, StorageDirType> activeDirs = new HashMap<File, StorageDirType>();
    for (Iterator<StorageDirectory> it
        = getFSImage().getStorage().dirIterator(); it.hasNext();) {
      StorageDirectory st = it.next();
      activeDirs.put(st.getRoot(), st.getStorageDirType());
    }
    statusMap.put("active", activeDirs);

    List<Storage.StorageDirectory> removedStorageDirs
        = getFSImage().getStorage().getRemovedStorageDirs();
    Map<File, StorageDirType> failedDirs = new HashMap<File, StorageDirType>();
    for (StorageDirectory st : removedStorageDirs) {
      failedDirs.put(st.getRoot(), st.getStorageDirType());
    }
    statusMap.put("failed", failedDirs);

    return JSON.toString(statusMap);
  }

  @Override // NameNodeMXBean
  public String getNodeUsage() {
    float median = 0;
    float max = 0;
    float min = 0;
    float dev = 0;

    final Map<String, Map<String,Object>> info =
        new HashMap<String, Map<String,Object>>();
    final List<DatanodeDescriptor> live = new ArrayList<DatanodeDescriptor>();
    blockManager.getDatanodeManager().fetchDatanodes(live, null, true);

    if (live.size() > 0) {
      float totalDfsUsed = 0;
      float[] usages = new float[live.size()];
      int i = 0;
      for (DatanodeDescriptor dn : live) {
        usages[i++] = dn.getDfsUsedPercent();
        totalDfsUsed += dn.getDfsUsedPercent();
      }
      totalDfsUsed /= live.size();
      Arrays.sort(usages);
      median = usages[usages.length / 2];
      max = usages[usages.length - 1];
      min = usages[0];

      for (i = 0; i < usages.length; i++) {
        dev += (usages[i] - totalDfsUsed) * (usages[i] - totalDfsUsed);
      }
      dev = (float) Math.sqrt(dev / usages.length);
    }

    final Map<String, Object> innerInfo = new HashMap<String, Object>();
    innerInfo.put("min", StringUtils.format("%.2f%%", min));
    innerInfo.put("median", StringUtils.format("%.2f%%", median));
    innerInfo.put("max", StringUtils.format("%.2f%%", max));
    innerInfo.put("stdDev", StringUtils.format("%.2f%%", dev));
    info.put("nodeUsage", innerInfo);

    return JSON.toString(info);
  }

  @Override  // NameNodeMXBean
  public String getNameJournalStatus() {
    List<Map<String, String>> jasList = new ArrayList<Map<String, String>>();
    F


E_INC = "/increment"
const val ROUTE_CLEAR = "/clear"
const val ROUTE_REQUEST = "/request"
const val ROUTE_CLOSEST = "/closest"
const val ROUTE_SUBKODEIN = "/sub"
const val ROUTE_SUB_LOWER = "/lower"
const val ROUTE_SUB_UPPER = "/upper"

const val SESSION_FEATURE_SESSION_ID = "SESSION_FEATURE_SESSION_ID"
const val NO_SESSION = "NO_SESSION"

const val AUTHOR = "romain boisselle"

data class MockSession(val counter: Int = 0) : KodeinDISession {
    override fun getSessionId() = counter
}

data class RandomDto(val randomInstances: MutableList<Pair<String, String>> = mutableListOf())

private val randomDto = RandomDto()

private fun Application.sessionModule() {
    install(Sessions) {
        cookie<MockSession>("SESSION_FEATURE_SESSION_ID", SessionStorageMemory()) {
            cookie.path = "/" // Specify cookie's path '/' so it can be used in the whole site
            serializer = reflectionSessionSerializer()
        }
    }

    routing {

        val info: ApplicationCall.() -> String = { "[${request.httpMethod.value}] ${request.uri}" }

        route(ROUTE_SESSION) {
            get {
                application.log.info("${closestDI()}")
                val session = call.sessions.get<MockSession>() ?: MockSession(0)
                val random by closestDI().on(session).instance<Random>()

                application.log.info("${call.info()} / Session: $session / DI ${closestDI().container} / Random instance: $random")

                call.respondText("$random")
            }

            get(ROUTE_INC) {
                application.log.info("${call.info()} Increment session IN - ${call.sessions.get<MockSession>()}")
                val session = call.sessions.get<MockSession>() ?: MockSession(0)
                call.sessions.set(MockSession(session.counter + 1))
                application.log.info("${call.info()} Increment session OUT - ${call.sessions.get<MockSession>()}")

                call.respondText("${call.sessions.get<MockSession>()}")
            }

            get(ROUTE_CLEAR) {
                application.log.info("${call.info()} Clear session IN - ${call.sessions.get<MockSession>()}")
                call.sessions.clearSessionScope<MockSession>()
                application.log.info("${call.info()} Clear session OUT - ${call.sessions.get<MockSession>()}")

                call.respondText("${call.sessions.get<MockSession>()}")
            }
        }

    }
}

fun Application.requestModule() {
    routing {
        route(ROUTE_REQUEST) {
            suspend fun logPhase(
                phase: String,
                applicationCall: ApplicationCall,
                proceed: suspend () -> Unit
            ) {
                val random by closestDI().on(applicationCall).instance<Random>()
                randomDto.randomInstances.add(phase to "$random")
                this@requestModule.log.info("Context $applicationCall / DI ${closestDI().container} / $phase Random instance: $random")
                proceed()
            }

            val interceptor = createRouteScopedPlugin("Interceptor") {
                class PhaseHook(val phase: PipelinePhase) : Hook<suspend (ApplicationCall) -> Unit> {
                    override fun install(
                        pipeline: ApplicationCallPipeline,
                        handler: suspend (ApplicationCall) -> Unit
                    ) {
                        pipeline.intercept(phase) {


t("Enter the title of the book to borrow: ")
            member = library.members.get(member_id)
            if not member:
                print(f"No member found with ID {member_id}.")
                continue
            book = next((b for b in library.books if b.title == title), None)
            if not book:
                print(f"Book '{title}' not found in the library catalog.")
                continue
            library.lend_book(book, member)

        elif choice == "4":
            member_id = input("Enter member ID: ")
            title = input("Enter the title of the book to return: ")
            member = library.members.get(member_id)
            if not member:
                print(f"No member found with ID {member_id}.")
                continue
            book = next((b for b in library.books if b.title == title), None)
            if not book:
                print(f"Book '{title}' not found in the library catalog.")
                continue
            library.receive_book(book, member)

        elif choice == "5":
            title = input("Enter the title of the book to check availability: ")
            print(library.check_availability(title))

        elif choice == "6":
            library.show_all_books()

        elif choice == "7":
            title = input("Enter the title of the book to remove: ")
            library.remove_book(title)

        elif choice == "8":
            print("Exiting Library Management System.")
            break

        else:
            print("Invalid option. Please choose again.")

# Run the interactive library system
library_system()


InsideItem = false
    private var isInsideChannel = true

    private var channelFactory = ChannelFactory()

    override fun onStartRssElement(qName: String?, attributes: Attributes?) {
        when (qName) {
            RdfKeyword.Channel.value -> isInsideChannel = true
            RdfKeyword.Item.value -> isInsideItem = true

            RdfKeyword.Channel.Image.value -> {
                if (isInsideChannel) {
                    val imageUrl = attributes?.getValue(RdfKeyword.Channel.Image.Resource.value)
                    channelFactory.channelImageBuilder.url(imageUrl)
                }
            }
        }
    }

    override fun endElement(qName: String?, text: String) {
        when {
            isInsideItem -> {
                when (qName) {
                    RdfKeyword.Item.value -> {
                        channelFactory.buildArticle()
                        isInsideItem = false
                    }

                    RdfKeyword.Title.value -> channelFactory.articleBuilder.title(text)
                    RdfKeyword.Description.value -> channelFactory.articleBuilder.description(text)
                    RdfKeyword.Link.value -> channelFactory.articleBuilder.link(text)
                    RdfKeyword.DcDate.value -> channelFactory.articleBuilder.pubDate(text)
                    RdfKeyword.Item.DcCreator.value -> channelFactory.articleBuilder.author(text)
                    RdfKeyword.Item.DcSubject.value -> channelFactory.articleBuilder.addCategory(text)
                }
            }

            isInsideChannel -> {
                when (qName) {
                    RdfKeyword.Channel.value -> isInsideChannel = false
                    RdfKeyword.Title.value -> channelFactory.channelBuilder.title(text)
                    RdfKeyword.Description.value -> channelFactory.channelBuilder.description(text)
                    RdfKeyword.Link.value -> channelFactory.channelBuilder.link(text)
                    RdfKeyword.DcDate.value -> channelFactory.channelBuilder.lastBuildDate(text)
                    RdfKeyword.Channel.UpdatePeriod.value -> channelFactory.channelBuilder.updatePeriod(text)
                }
            }
        }
    }

    override fun buildRssChannel(): RssChannel =
        channelFactory.build()
}
/*
*   Copyright 2019 Marco Gomiero
*
*   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.
*
*/

package com.prof18.rssparser.rss

import com.prof18.rssparser.XmlParserTestExecutor
import com.prof18.rssparser.model.ItunesChannelData
import com.prof18.rssparser.model.ItunesItemData
import com.prof18.rssparser.model.ItunesOwner
import com.prof18.rssparser.model.RawEnclosure
import com.prof18.rssparser.model.RssChannel
import com.prof18.rssparser.model.RssImage
import com.prof18.rssparser.model.RssItem
import com.prof18.rssparser.parseFeed
import kotlinx.corout


edAnimeIds).then(res => {return res});
  return animes;
}/* tslint:disable:no-unused-variable */

import { TestBed, async, inject } from '@angular/core/testing';
import { tick, fakeAsync } from '@angular/core/testing/fake_async';

import { PianoService } from './piano.service';
import { PianoNote }  from './piano-note';

describe('PianoService', () => {

  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [PianoService]
    });
  });

  it('should create', inject([PianoService], (service: PianoService) => {
    expect(service).toBeTruthy();
  }));

  it('playNoteByKeyId should play specified key', inject([PianoService], fakeAsync((service: PianoService) => {
    let expectedNote : PianoNote;
    // expect a PianoNote to be published on the notePlayed stream
    service.notePlayed$.subscribe((note) => {
      expectedNote = note;
    });
    service.playNoteByKeyId(16);
    tick();
    expect(expectedNote).toBeTruthy();
    expect(expectedNote.keyId).toBe(16);
    expect(expectedNote.noteId).toBe("c2");
    expect(expectedNote.fullname).toBe("C");
    expect(expectedNote.octave).toBe(2);
    expect(expectedNote.accidental).toBeUndefined();
  })));

  it('playNoteByKeyId should play (default) accidental note', inject([PianoService], fakeAsync((service: PianoService) => {
    let expectedNote : PianoNote;
    service.notePlayed$.subscribe((note) => {
      expectedNote = note;
    });
    service.playNoteByKeyId(41);
    tick();
    expect(expectedNote).toBeTruthy();
    expect(expectedNote.keyId).toBe(41);
    expect(expectedNote.noteId).toBe("c4s");
    expect(expectedNote.fullname).toBe("C\u266F"); //C♯
    expect(expectedNote.octave).toBe(4);
    expect(expectedNote.accidental).toBe("s");
  })));

   it('playNoteByKeyId throws on invalid keyId', inject([PianoService], (service: PianoService)  => {
    // Note: You must wrap in anonymous function or lambda when expecting Error to be thrown
    expect( () => service.playNoteByKeyId(100)).toThrow(new Error("Invalid keyId. The valid range of keyId is 16 to 64."));
  }));

  it('playNote should play specified noteId', inject([PianoService], fakeAsync((service: PianoService) => {
    let expectedNote : PianoNote;
    service.notePlayed$.subscribe((note) => {
      expectedNote = note;
    });
    service.playNote("d4f");
    tick();
    expect(expectedNote).toBeTruthy();
    expect(expectedNote.keyId).toBe(41);
    expect(expectedNote.noteId).toBe("d4f");
    expect(expectedNote.fullname).toBe("D\u266D"); //D♭
    expect(expectedNote.octave).toBe(4);
    expect(expectedNote.accidental).toBe("f");
  })));

  it('playNote throws on invalid noteId', inject([PianoService], (service: PianoService)  => {
    // Note: You must wrap in anonymous function or lambda when expecting Error to be thrown
    expect( () => service.playNote('z2f')).toThrow(new Error("Invalid noteId."));
  }));

  it('getAlternateNote should return flat note for specified sharp note', inject([PianoService], (service: PianoService)  => {
    let expectedNote = service.getAlternateNote("c4s");
    expect(expectedNote).toBeTruthy();
    expect(expectedNote.keyId).toBe(41);
    expect(expectedNote.noteId).toBe("d4f");
    expect(expectedNote.fullname).toBe("D\u266D"); //D♭
    expect(expectedNote.octave).toBe(4);
    expect(expectedNote.accidental).toBe


ofollow"/>
<script type="text/javascript">if(guardian.isModernBrowser){try{var session=window.sessionStorage;if(session.getItem('gu-bounce-test')==='true'){var img=new Image();img.src='//beacon.guim.co.uk/count/user-navigated-early.gif';}
session.setItem('gu-bounce-test','true');}catch(e){};}</script>
<script>(function(isVeryModern){function insertUserName(){function getCookieValue(a){var d=[],e=document.cookie.split(";");a=RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$");for(var b=0;b<e.length;b++){var f=e[b].match(a);f&&d.push(f[1]);}
if(d.length>0){return d[0];}
return null;}
function decodeBase64(str){return decodeURIComponent(encodeURIComponent(atob(str.replace(/-/g,'+').replace(/_/g,'/').replace(/,/g,'='))));}
function getUserDisplayNameFromCookie(){var cookieData=getCookieValue('GU_U');var userData=cookieData?JSON.parse(decodeBase64(cookieData.split('.')[0])):null;if(userData){return userData[2];}
return null;}
function getUserIdFromCookie(){var cookieData=getCookieValue('GU_U');var userData=cookieData?JSON.parse(decodeBase64(cookieData.split('.')[0])):null;if(userData){return userData[0];}
return null;}
var userDisplayName=getUserDisplayNameFromCookie();if(userDisplayName){document.getElementsByClassName('js-profile-info')[0].innerHTML=userDisplayName;var $profileNavElem=document.getElementsByClassName('js-profile-nav')[0];$profileNavElem.classList.add('is-signed-in');var $signInLinkElem=$profileNavElem.getElementsByTagName('a')[0];if($signInLinkElem){var userId=getUserIdFromCookie();if(userId){$signInLinkElem.addEventListener("click",function(e){e.preventDefault();});}else{$signInLinkElem.setAttribute('href',$signInLinkElem.getAttribute('href').replace('signin','public/edit/'));}}
var $register=document.getElementsByClassName('js-profile-register');if($register.length){$register=$register[0];$register.parentElement.removeChild($register);}}}
insertUserName();})(guardian.isModernBrowser&&'atob'in window&&'classList'in document.documentElement);</script>
<div id="dfp-ad--pageskin-inread" class="js-ad-slot ad-slot ad-slot--dfp ad-slot--pageskin-inread ad-slot--page-skin" data-link-name="ad slot pageskin-inread" data-test-id="ad-slot-pageskin-inread" data-name="pageskin-inread" data-label="false" data-refresh="false" data-out-of-page="true" data-wide="1,1"> </div>
</body>
</html>
<!DOCTYPE html>
<!--[if IE 8]>
<html class="ie8 ">
<![endif]-->
<!--[if IE 9]>
<html class="ie9 ">
<![endif]-->
<!--[if !IE]><!-->
<html class="">
<!--<![endif]--><!--
 _____________    _    _                       hbr.org _
|/////////////|  | |  | |                             | |
|:\/E:R|:T/\S:|  | |__| | __ _ _ ____   ____ _ _ __ __| |
|+++++++++++++|  |  __  |/ _` | '__\ \ / / _` | '__/ _` |


value["verification"] = json!(val.into_iter().map(|e| e.value).collect::<Vec<_>>());
        return self;
    }
}
use std::{collections::HashMap, env, num::ParseIntError, sync::Arc, time::Duration};

use config::PoolSize;
use git_testament::{git_testament, render_testament};
use graph::{data::graphql::effort::LoadManager, prelude::chrono, prometheus::Registry};
use graph_core::MetricsRegistry;
use graph_graphql::prelude::GraphQlRunner;
use lazy_static::lazy_static;
use structopt::StructOpt;

use graph::{
    log::logger,
    prelude::{info, o, slog, tokio, Logger, NodeId},
    url::Url,
};
use graph_node::{manager::PanicSubscriptionManager, store_builder::StoreBuilder};
use graph_store_postgres::{
    connection_pool::ConnectionPool, BlockStore, Shard, Store, SubgraphStore, SubscriptionManager,
    PRIMARY_SHARD,
};

use graph_node::config::{self, Config as Cfg};
use graph_node::manager::commands;

git_testament!(TESTAMENT);

macro_rules! die {
    ($fmt:expr, $($arg:tt)*) => {{
        use std::io::Write;
        writeln!(&mut ::std::io::stderr(), $fmt, $($arg)*).unwrap();
        ::std::process::exit(1)
    }}
}

lazy_static! {
    static ref RENDERED_TESTAMENT: String = render_testament!(TESTAMENT);
}

#[derive(Clone, Debug, StructOpt)]
#[structopt(
    name = "graphman",
    about = "Management tool for a graph-node infrastructure",
    author = "Graph Protocol, Inc.",
    version = RENDERED_TESTAMENT.as_str()
)]
pub struct Opt {
    #[structopt(
        long,
        short,
        env = "GRAPH_NODE_CONFIG",
        help = "the name of the configuration file\n"
    )]
    pub config: String,
    #[structopt(
        long,
        default_value = "default",
        value_name = "NODE_ID",
        env = "GRAPH_NODE_ID",
        help = "a unique identifier for this node\n"
    )]
    pub node_id: String,
    #[structopt(
        long,
        default_value = "3",
        help = "the size for connection pools. Set to 0\n to use pool size from configuration file\n corresponding to NODE_ID"
    )]
    pub pool_size: u32,
    #[structopt(long, value_name = "URL", help = "Base URL for forking subgraphs")]
    pub fork_base: Option<String>,
    #[structopt(subcommand)]
    pub cmd: Command,
}

#[derive(Clone, Debug, StructOpt)]
pub enum Command {
    /// Calculate the transaction speed
    TxnSpeed {
        #[structopt(long, short, default_value = "60")]
        delay: u64,
    },
    /// Print details about a deployment
    Info {
        /// The deployment, an id, schema name or subgraph name
        name: String,
        /// List only current version
        #[structopt(long, short)]
        current: bool,
        /// List only pending versions
        #[structopt(long, short)]
        pending: bool,
        /// Include status information
        #[structopt(long, short)]
        status: bool,
        /// List only used (current and pending) versions
        #[structopt(long, short)]
        used: bool,
    },
    /// Manage unused deployments
    ///
    /// Record which deployments are unused with `record`, then remove them
    /// with `remove`
    Unused(UnusedCommand),
    /// Remove a named subgraph
    Remove {
        /// The name of the subgraph to remove
        name: String,
    },
    /// Create a subgraph name
    Create {
        /// The name of the subgraph to create
        name: String,
    },
    /// Assign or reassign a deployment
    Reassign {
        /// The id of the deployment to reassign
        id: String,
        /// The name of the node that should index the deployment


public override long Position { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

            public void SetResult(byte[] bytes, List<int> byteCountsToReturn)
            {
                foreach (var b in bytes)
                {
                    _bytes.Enqueue(b);
                }

                foreach (var b in byteCountsToReturn)
                {
                    _byteCountToReturn.Enqueue(b);
                }
            }

            public override void Flush()
            {
                throw new NotImplementedException();
            }

            public override int Read(byte[] buffer, int offset, int count)
            {
                int bytesToReturn = _byteCountToReturn.Dequeue();
                if (bytesToReturn > count)
                {


mapVal = 1;
        } else {
            // [0 ~ 31]
            mapVal = 0;
        }
        return mapVal;
    };
    for (let index = 0; index < data.length; index += 4) {
        let key =
            device(data[index]) * 8 * 8 * 8 +
            device(data[index + 1]) * 8 * 8 +
            device(data[index + 2]) * 8 +
            device(data[index + 3]);

        res[key] += 1;
    }
    return res;
}
// 余弦相似度
function vectorCosine(p1, p2): number {
    if (p1.length != p2.length) return 0;

    let fenzi = 0,
        sqrt1 = 0,
        sqrt2 = 0;
    for (let i = 0; i < p1.length; i++) {
        fenzi += p1[i] * p2[i];
        sqrt1 += p1[i] * p1[i];
        sqrt2 += Math.pow(p2[i], 2);
    }

    let res = fenzi / (Math.sqrt(sqrt1) * Math.sqrt(sqrt2));
    return res;
}

export function colorDistributionCompare(image1: ImageData, image2: ImageData): number {
    return vectorCosine(filterImageData(image1.data), filterImageData(image2.data));
};
import { StreamProcess } from './StreamProcess';
import { AsteriaStream } from '../core/AsteriaStream';

/**
 * The StreamProcessor interface provides operations for working and processing with data as defined
 * by Asteria processes.
 */
export interface StreamProcessor {

    /**
     * Add the specified stream process to this processor.
     *
     * @param {StreamProcess} process the stream process to add to this processor.
     *
     * @returns {StreamProcessor} a reference to this StreamProcessor object.
     */
    add(process: StreamProcess): StreamProcessor;

    /**
     * Remove the specified stream process from this processor.
     *
     * @param {StreamProcess} process the stream process to remove from this processor.
     *
     * @returns {StreamProcessor} a reference to this StreamProcessor object.
     */
    remove(process: StreamProcess): StreamProcessor;

    /**
     * Run all processes registered in this processor and return the last registered stream.
     *
     * @returns {AsteriaStream} the last stream registered in this processor.
     */
    run(): AsteriaStream;

    /**
     * Return the number of processes registered in this StreamProcessor object.
     *
     * @returns {number} the number of processes registered in this StreamProcessor object.
     */
    size(): number;
}
import 'reflect-metadata';
import {
  MainPresenter,
  } from '../../src/Screens/Main/MainPresenter';
import { IPresenterOutput } from '../../src/Presenter/Presenter';
import { createOutputSpy, GatewayStub, NavigationStub, NewBookUserInputStub } from '../testDoubles';
import { IMainPresenterViewModel } from '../../src/Screens/Main/IMainPresenterViewModel';

const date1 = new Date('2018-02-25T18:17:14.593Z');
const date2 = new Date('2018-03-25T15:17:14.593Z');

const createNewBook = (name = '', totalPages = 0) => ({
  name,
  totalPages,
});

describe('MainPresenter', () => {
  const gatewayStub = new GatewayStub();
  const navigationStub = new NavigationStub();
  let newBookUserInputStub: NewBookUserInputStub;
  let sut: MainPresenter;
  const outputSpy: IPresenterOutput<IMainPresenterViewModel> = createOutputSpy();

  beforeEach(() => {
    jest.resetAllMocks();

    newBookUserInputStub = new NewBookUser


    node_to_output_grads_list[output_tensor] = [out_grad]

    reverse_topo_order = list(reversed(find_topo_sort([output_tensor])))

    for node in reverse_topo_order:
        ajoint = sum_node_list(node_to_output_grads_list[node])
        node.grad = ajoint
        if node.op is None:
            continue
        partial_ajoints = node.op.gradient_as_tuple(ajoint, node)
        for in_node, partial_ajoint in zip(node.inputs, partial_ajoints):
            if in_node not in node_to_output_grads_list:
                node_to_output_grads_list[in_node] = []
            node_to_output_grads_list[in_node].append(partial_ajoint)

def find_topo_sort(node_list: List[Value]) -> List[Value]:
    visited = []
    topo_order = []

    for node in node_list:
        topo_sort_dfs(node, visited, topo_order)
    return topo_order

def topo_sort_dfs(node: Value, visited: List[Value], topo_order : List[Value]):
    if node not in visited:
        visited.append(node)
        for input in node.inputs:
            topo_sort_dfs(input, visited, topo_order)
        topo_order.append(node)

def sum_node_list(node_list):
    """Custom sum function in order to avoid create redundant nodes in Python sum implementation."""
    from operator import add
    from functools import reduce

    return reduce(add, node_list)


style="color: rgb(0, 0, 0);">Tobacco

While Tobacco traffic is prohibited on Toll-Free, it is allowed on Short or Long Code, as long as proper age-gating procedures are in place.

Alcohol traffic is allowed on Toll-Free (U.S. only), Short Code, and Long Code, as long as proper age-gating procedures are in place.

Firearms and Vaping-related traffic are prohibited.

My use case is listed as forbidden. What can I do?
<p data-identifyelement="510" style="box-sizing: border-box; margin: 15px 0px; font-family: "Whitney SSm A", "Whitney SSm B", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.8; color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 100; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;  text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">If your use case is listed above as forbidden for SMS and MMS messaging in the US, you can explore other marketing channels.
<p data-identifyelement="512" dir="ltr" style="box-sizing: border-box; margin: 15px 0px; font-family: "Helvetica Neue"; font-size: 16px; line-height: 1.8; color: rgb(85, 85, 85); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 100; letter-spacing: normal; orphans: 2; te


802), la = a(76745), fa = a(11165), ya = a(86226), wa = a(58635), ba = a(2013),
            Ma = a(71565), ha = a(23206), ma = a(77317), Ia = a(89487), Ca = a(13111), La = a(62226), Sa = a(40786),
            Fa = a(69056), Da = a(51680), ka = a(17567), Pa = a(41002), Ba = a(23311), Ta = a(98087), Ea = a(21788),
            Ra = a(54048), Wa = a(9045), va = a(54288), Ga = a(90101), Oa = a(45426), za = a(5039), Aa = a(49067),
            Ua = a(77187), Na = a(67122), ja = a(74280), xa = a(50466), _a = a(2531), Va = a(46212), Ha = a(26514),
            Ka = a(45055), Ja = a(13315), $a = a(76895), Ya = a(79578), Qa = a(14750), Xa = a(8141), Za = a(69993),
            qa = a(29478), er = a(87929), tr = a(28251), ar = a(97805), rr = a(12020), or = a(97508), nr = a(36252),
            ir = a(8923), sr = a(33828), dr = a(74717), ur = a(49558), cr = a(25400), gr = a(66028), pr = a(17914),
            lr = a(47197), fr = a(38678), yr = a(29625), wr = a(54672), br = a(10287), Mr = a(14799), hr = a(77182),
            mr = a(37347), Ir = a(15120), Cr = a(78860), Lr = a(81663), Sr = a(50102), Fr = a(40414), Dr = a(87276),
            kr = a(40873), Pr = a(4693), Br = a(1462), Tr = a(81496), Er = a(75282), Rr = a(29186), Wr = a(18186),
            vr = a(82034), Gr = a(10810), Or = a(57001), zr = a(46456), Ar = a(39042), Ur = a(61928), Nr = a(52123),
            jr = a(75157), xr = a(21447), _r = a(40581), Vr = a(30036), Hr = a(79961), Kr = a(60985), Jr = a(27150),
            $r = a(90526), Yr = a(44792), Qr = a(60579), Xr = a(99137), Zr = a(43669), qr = a(28043), eo = a(63439),
            to = a(72329), ao = a(87708), ro = a(42219), oo = a(96301), no = a(12736), io = a(26993), so = a(96093),
            uo = a(39417), co = a(3533), go = a(96697), po = a(77052), lo = a(67830), fo = a(10135), yo = a(92959),
            wo = a(47753), bo = a(91630), Mo = a(14905), ho = a(6471), mo = a(86266), Io = a(76104), Co = a(80957),
            Lo = a(58205), So = a(58983), Fo = a(73429), Do = a(63887), ko = a(6863), Po = a(98483), Bo = a(20841),
            To = a(99438), Eo = a(34660), Ro = a(44413), Wo = a(83609), vo = a(52507), Go = a(8465), Oo = a(20


 k] - mat[k * 4 + j] ) * s;
    q[j] = ( mat[i * 4 + j] + mat[j * 4 + i] ) * s;
    q[k] = ( mat[i * 4 + k] + mat[k * 4 + i] ) * s;
  }

  //// Unused translation
  //jq.t[0] = mat[0 * 4 + 3];
  //jq.t[1] = mat[1 * 4 + 3];
  //jq.t[2] = mat[2 * 4 + 3];
}

template <typename Q_type>
IGL_INLINE void igl::mat3_to_quat(const Q_type * mat, Q_type * q)
{
  Q_type trace;
  Q_type s;
  Q_type t;
  int i;
  int j;
  int k;

  static int next[3] = { 1, 2, 0 };

  trace = mat[0 * 3 + 0] + mat[1 * 3 + 1] + mat[2 * 3 + 2];

  if ( trace > 0.0f ) {

    t = trace + 1.0f;
    s = ReciprocalSqrt( t ) * 0.5f;

    q[3] = s * t;
    q[0] = ( mat[1 * 3 + 2] - mat[2 * 3 + 1] ) * s;
    q[1] = ( mat[2 * 3 + 0] - mat[0 * 3 + 2] ) * s;
    q[2] = ( mat[0 * 3 + 1] - mat[1 * 3 + 0] ) * s;

  } else {

    i = 0;
    if ( mat[1 * 3 + 1] > mat[0 * 3 + 0] ) {
      i = 1;
    }
    if ( mat[2 * 3 + 2] > mat[i * 3 + i] ) {
      i = 2;
    }
    j = next[i];
    k = next[j];

    t = ( mat[i * 3 + i] - ( mat[j * 3 + j] + mat[k * 3 + k] ) ) + 1.0f;
    s = ReciprocalSqrt( t ) * 0.5f;

    q[i] = s * t;
    q[3] = ( mat[j * 3 + k] - mat[k * 3 + j] ) * s;
    q[j] = ( mat[i * 3 + j] + mat[j * 3 + i] ) * s;
    q[k] = ( mat[i * 3 + k] + mat[k * 3 + i] ) * s;
  }

  //// Unused translation
  //jq.t[0] = mat[0 * 4 + 3];
  //jq.t[1] = mat[1 * 4 + 3];
  //jq.t[2] = mat[2 * 4 + 3];
}

#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::mat4_to_quat<double>(double const*, double*);
template void igl::mat4_to_quat<float>(float const*, float*);
template void igl::mat3_to_quat<double>(double const*, double*);
#endif
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2016 Oded Stein <oded.stein@columbia.edu>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.

#include "loop.h"

#include <igl/adjacency_list.h>
#include <igl/triangle_triangle_adjacency.h>
#include <igl/unique.h>

#include <vector>

template <
  typename DerivedF,
  typename SType,
  typename DerivedNF>
IGL_INLINE void igl::loop(
  const int n_verts,
  const Eigen::PlainObjectBase<DerivedF> & F,
  Eigen::SparseMatrix<SType>& S,
  Eigen::PlainObjectBase<DerivedNF> & NF)
{
  typedef Eigen::SparseMa


/**
	8 bit multiplexer driver

	martink firmware project is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	martink firmware is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with martink firmware.  If not, see <http://www.gnu.org/licenses/>.

	Author: Martin K. Schröder
	Email: info@fortmax.se
	Github: https://github.com/mkschreder

	Special thanks to:
	* Davide Gironi, original implementation
*/

#ifndef L74HC4051_H_
#define L74HC4051_H_

#define L74HC4051_MAXCH 8

struct l74hc4051 {
	pio_dev_t port;
	gpio_pin_t s0_pin;
	gpio_pin_t s1_pin;
	gpio_pin_t s2_pin;
};

void l74hc4051_init(struct l74hc4051 *self, pio_dev_t port,
		gpio_pin_t s0_pin, gpio_pin_t s1_pin, gpio_pin_t s2_pin);
void l74hc4051_set_channel(struct l74hc4051 *self, uint8_t channel);

#endif


al>true</emu-val>。

</emu-alg>
      <emu-note>Note 1

上記定義に関して:

            文字列比較は: \`${a}\` == \`${b}\` により強制できる。

            数値比較は: +a == +b により強制できる。

            Boolean 比較は: !a == !b により強制できる。

</emu-note>
      <emu-note>Note 2

等価演算子は次の不変条件を保持する:

            A != B は !(A == B) と同値。

            A == B は評価順序を除き B == A と同値。

</emu-note>
      <emu-note>Note 3

等価演算子は常に推移的とは限らない。例えば同じ String 値を表す異なる 2 つの String オブジェクトは、それぞれがリテラル文字列とは == で等しいが、互いには等しくない:

            new String("a") == "a" および "a" == new String("a") は <emu-val>true</emu-val>。

            new String("a") == new String("a") は <emu-val>false</emu-val>。

</emu-note>
      <emu-note>Note 4

文字列比較はコードユニット列の単純な同値判定であり、Unicode 仕様の正規等価や照合順序は考慮されない。Unicode の正規等価な String が不等と判定され得る。両 String は既に正規化されているものとみなす。

</emu-note>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-binary-bitwise-operators">

13.12 ビット単位二項演算子 (Binary Bitwise Operators)

構文 (Syntax)

    <emu-grammar type="definition"><emu-production name="BitwiseANDExpression" params="In, Yield, Await" id="prod-BitwiseANDExpression">
    <emu-nt params="In, Yield, Await">BitwiseANDExpression<emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xfq7h3dt">
        <emu-nt params="?In, ?Yield, ?Await" id="_ref_15007">EqualityExpression<emu-mods><emu-params>[?In, ?Yield, ?Await]</emu-params></emu-mods></emu-


AddPosition(creature->getPosition());
			break;
		case SPEAK_CHANNEL_Y:
		case SPEAK_CHANNEL_R1:
		case SPEAK_CHANNEL_R2:
		case SPEAK_CHANNEL_O:
			msg->AddU16(channelId);
			break;
		case SPEAK_RVR_CHANNEL: {
			uint32_t t = (OTSYS_TIME() / 1000) & 0xFFFFFFFF;
			msg->AddU32(t - time);
		} break;
		default:
			break;
	}

	msg->AddString(text);
}

void ProtocolGame::AddCreatureHealth(NetworkMessage_ptr msg,const Creature* creature)
{
	msg->AddByte(0x8C);
	msg->AddU32(creature->getID());
	msg->AddByte((int32_t)std::ceil(((float)creature->getHealth()) * 100 / std::max(creature->getMaxHealth(), (int32_t)1)));
}

void ProtocolGame::AddCreatureOutfit(NetworkMessage_ptr msg, const Creature* creature, const Outfit_t& outfit)
{
	msg->AddU16(outfit.lookType);
	if(outfit.lookType != 0){
		msg->AddByte(outfit.lookHead);
		msg->AddByte(outfit.lookBody);
		msg->AddByte(outfit.lookLegs);
		msg->AddByte(outfit.lookFeet);
	}
	else if(outfit.lookTypeEx != 0){
		msg->AddItemId(outfit.lookTypeEx);
	}
	else{
		msg->AddU16(outfit.lookTypeEx);
	}
}

void ProtocolGame::AddWorldLight(NetworkMessage_ptr msg, const LightInfo& lightInfo)
{
	msg->AddByte(0x82);
	msg->AddByte(lightInfo.level);
	msg->AddByte(lightInfo.color);
}

void ProtocolGame::AddCreatureLight(NetworkMessage_ptr msg, const Creature* creature)
{
	LightInfo lightInfo;
	creature->getCreatureLight(lightInfo);
	msg->AddByte(0x8D);
	msg->AddU32(creature->getID());
	msg->AddByte(lightInfo.level);
	msg->AddByte(lightInfo.color);
}

//tile
void ProtocolGame::AddTileItem(NetworkMessage_ptr msg, const Position& pos, uint32_t stackpos, const Item* item)
{
	if(stackpos < 10){
		msg->AddByte(0x6A);
		msg->AddPosition(pos);
		msg->AddItem(item);
	}
}

void ProtocolGame::AddTileCreature(NetworkMessage_ptr msg, const Position& pos, uint32_t stackpos,
	const Creature* creature)
{
	//if(stackpos < 10){
		msg->AddByte(0x6A);
		msg->AddPosition(pos);

		bool known;
		uint32_t removedKnown;
		checkCreatureAsKnown(creature->getID(), known, removedKnown);
		AddCreature(msg, creature, known, removedKnown);
	//}
}

void ProtocolGame::UpdateTileItem(NetworkMessage_ptr msg, const Position& pos, uint32_t stackpos, const Item* item)
{
	if(stackpos < 10){
		msg->AddByte(0x6B);
		msg->AddPosition(pos);
		msg->AddByte(stackpos);
		msg->AddItem(item);
	}
}

void ProtocolGame::RemoveTileItem(NetworkMessage_ptr msg, const Position& pos, uint32_t stackpos)
{
	if(stackpos < 10){
		msg->AddByte(0x6C);
		msg->AddPosition(pos);
		msg->AddByte(stackpos);
	}
}

void ProtocolGame::MoveUpCreature(NetworkMessage_ptr msg, const Creature* creature,
	const Position& newPos, const Position&


        val pingLabel = "Ping:"
        val pingStart = text.indexOf(pingLabel) + pingLabel.length
        val pingEnd = text.length // 直接到字符串末尾，避免硬编码长度
        if (pingStart >= pingLabel.length && pingEnd <= text.length) {
            spannable.setSpan(BackgroundColorSpan(backgroundColor), pingStart, pingEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
            spannable.setSpan(ForegroundColorSpan(textColor), pingStart, pingEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
        }
        holder.sourceSwitch.text = spannable
        holder.sourceSwitch.isChecked = source.isSelected
        holder.sourceSwitch.setOnClickListener {
            onSourceSelected(source.index - 1, holder.sourceSwitch.isChecked)
        }

        // 增强焦点文字反馈
        holder.sourceSwitch.setOnFocusChangeListener { _, hasFocus ->
            holder.sourceSwitch.setTextColor(
                ContextCompat.getColor(context, if (hasFocus) R.color.focus else R.color.title_blur)
            )
            if (hasFocus) {
                holder.sourceSwitch.text = spannable // 确保焦点时文字刷新
            }
        }

    }

    override fun getItemCount(): Int = sources.size

    fun updateSources(newSources: List<SourceInfo>) {
        val tvModel = viewModel.groupModel.getCurrent()
        val currentIndex = tvModel?.videoIndexValue ?: -1
        sources = newSources.map { source ->
            source.copy(isSelected = source.index - 1 == currentIndex)
        }
        notifyDataSetChanged()
    }

    fun updateSource(index: Int, resolution: String, ping: Int, isStable: Boolean) {
        val tvModel = viewModel.groupModel.getCurrent()
        val currentIndex = tvModel?.videoIndexValue ?: -1
        val position = sources.indexOfFirst { it.index == index }
        if (position != -1) {
            sources = sources.toMutableList().apply {
                this[position] = SourceInfo(
                    index,
                    sources[position].url,
                    resolution,
                    ping,
                    isStable,
                    index - 1 == currentIndex
                )
            }
            notifyItemChanged(position)
        }
    }

    fun getSourceAt(position: Int): SourceInfo {
        return sources[position]
    }

    // 新增方法：更新选中状态
    fun updateSelection(newSelectedIndex: Int) {
        sources = sources.map { source ->
            source.copy(isSelected = source.index - 1 == newSelectedIndex)
        }
        notifyDataSetChanged()
    }
}package com.horsenma.yourtv

import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Paint
import android.os.Bundle
import android.os.Handler
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.core.view.marginBottom
import androidx.core.view.marginStart
import androidx.core.view.marginTop
import androidx.fragment.app.Fragment
import com.horsenma.yourtv.databinding.InfoBinding
import com.horsenma.yourtv.models.TVModel

class InfoFragment : Fragment() {
    private var _binding: InfoBinding? = null
    private val binding get() = _binding!!

    private val handler = Handler()
    private val delay: Long = 5000

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        _binding = InfoBinding.inflate(inflater, container, false)

        val application = requireActivity().applicationContext as YourTVApplication

        binding.info.layoutParams.width = application.px2Px(binding.info.layoutParams.width)
        binding.info.layoutParams.height = application.px2Px(binding.info.la


//===============================================================================
// Microsoft patterns & practices Enterprise Library
// Core
//===============================================================================
// Copyright © Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================

using System;
using System.Configuration;
using System.Xml;
using Microsoft.Practices.EnterpriseLibrary.Common.Properties;
using System.Globalization;

namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration
{
    /// <summary>
    /// Represents a collection of <see cref="NameTypeConfigurationElement"/> objects.
    /// </summary>
    /// <typeparam name="T">The type of <see cref="NameTypeConfigurationElement"/> object this collection contains.</typeparam>
    /// <typeparam name="TCustomElementData">The type used for Custom configuration elements in this collection.</typeparam>
    public class NameTypeConfigurationElementCollection<T, TCustomElementData> : PolymorphicConfigurationElementCollection<T>
        where T : NameTypeConfigurationElement, new()
        where TCustomElementData : T, new()
    {
        private const string typeAttribute = "type";

        /// <summary>
        /// Get the configuration object for each <see cref="NameTypeConfigurationElement"/> object in the collection.
        /// </summary>
        /// <param name="reader">The <see cref="XmlReader"/> that is deserializing the element.</param>


 // don't overwrite explicit value of otherOptions at compatibleOptions[co]
					if (optionValue == null) {
						eclipsePreferences.remove(compatibleOptions[co]);
					} else {
						eclipsePreferences.put(compatibleOptions[co], optionValue);
					}
				}
				break;
			default:
				return false;
		}
		return true;
	}

	public void setOptions(Hashtable newOptions) {
		Hashtable cachedValue = newOptions == null ? null : new Hashtable(newOptions);
		IEclipsePreferences defaultPreferences = getDefaultPreferences();
		IEclipsePreferences instancePreferences = getInstancePreferences();

		if (newOptions == null){
			try {
				instancePreferences.clear();
			} catch(BackingStoreException e) {
				// ignore
			}
		} else {
			Enumeration keys = newOptions.keys();
			while (keys.hasMoreElements()){
				String key = (String)keys.nextElement();
				int optionLevel = getOptionLevel(key);
				if (optionLevel == UNKNOWN_OPTION) continue; // unrecognized option
				if (key.equals(JavaCore.CORE_ENCODING)) {
					if (cachedValue != null) {
						cachedValue.put(key, JavaCore.getEncoding());
					}
					continue; // skipped, contributed by resource prefs
				}
				String value = (String) newOptions.get(key);
				String defaultValue = defaultPreferences.get(key, null);
				// Store value in preferences
				if (defaultValue != null && defaultValue.equals(value)) {
					value = null;
				}
				storePreference(key, value, instancePreferences, newOptions);
			}
			try {
				// persist options
				instancePreferences.flush();
			} catch(BackingStoreException e) {
				// ignore
			}
		}
		// update cache
		Util.fixTaskTags(cachedValue);
		this.optionsCache = cachedValue;
	}

	public void startup() throws CoreException {
		try {
			configurePluginDebugOptions();

			// initialize Java model cache
			this.cache = new JavaModelCache();

			// request state folder creation (workaround 19885)
			JavaCore.getPlugin().getStateLocation();

			// Initialize eclipse preferences
			initializePreferences();

			// Listen to preference changes
			this.propertyListener = new IEclipsePreferences.IPreferenceChangeListener() {
				public void preferenceChange(PreferenceChangeEvent event) {
					JavaModelManager.this.optionsCache = null;
				}
			};
			InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).addPreferenceChangeListener(this.propertyListener);

			// listen for encoding changes (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=255501 )
			this.resourcesPropertyListener = new IEclipsePreferences.IPreferenceChangeListener() {
				public void preferenceChange(PreferenceChangeEvent event) {
					if (ResourcesPlugin.PREF_ENCODING.equals(event.getKey())) {
						JavaModelManager.this.optionsCache = null;
					}
				}
			};
			String resourcesPluginId = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
			InstanceScope.INSTANCE.getNode(resourcesPluginId).addPreferenceChangeListener(this.resourcesPropertyListener);

			// Listen to content-type changes
			 Platform.getContentTypeManager().addContentTypeChangeListener(this);

			// retrieve variable values
			long start = -1;
			if (VERBOSE)
				start = System.currentTimeMillis();
			loadVariablesAndContainers();
			if (VERBOSE)
				traceVariableAndContainers("Loaded", start); //$NON-NLS-1$

			// listen for resource changes
			this.deltaState.initializeRootsWithPreviousSession();
			final IWorkspace workspace = ResourcesPlugin.getWorkspace();
			workspace.addResourceChangeListener(
				this.deltaState,
				/* update spec in JavaCore#addPreProcessingResourceChangedListener(...) if adding more event types */
				IResourceChangeEvent.PRE_BUILD
					| IResourceChangeEvent.POST_BUILD
					| IResourc


sort-item-img" href="/2023/12/19/Plik%E4%B8%B4%E6%97%B6%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E7%B3%BB%E7%BB%9FDocker%E9%83%A8%E7%BD%B2/" title="Plik临时文件上传系统Docker部署">

<time class="post-meta-date-created" datetime="2023-12-19T13:26:31.000Z" title="发表于 2023-12-19 21:26:31">2023-12-19</time>
Plik临时文件上传系统Docker部署

<time class="post-meta-date-created" datetime="2023-12-14T10:58:46.000Z" title="发表于 2023-12-14 18:58:46">2023-12-14</time>
OpenStack命令创建云主机上传镜像创建网络实例类型及常用命令等

<a class="article-sort-


; nd_stride:[4, 2, 1, 4, 1, 1, 2, 1]
    v_lshrrev_b32 v[v_co_sub_m_index], 7, v[0]   ; get tid along m
    v_and_b32 v[v_tmp+0], 1, v[v_co_sub_m_index]                   ; => x_mc
    v_lshlrev_b32 v[v_co_sub_m_index], 2, v[v_tmp+0]      ; => accumulate x_mc
    ; init_co_sub_n_index xdlops
    v_and_b32 v[v_co_sub_n_index], 127, v[0]

    v_add_u32 v[v_tmp], s[s_block_gtc_ik], v[v_co_sub_n_index]
    v_cmp_gt_u32 vcc, s[s_k], v[v_tmp]
    v_cndmask_b32 v[v_out_flag], 0, 1, vcc
    ; output offset
    s_mul_i32 s[s_tmp], s[s_block_gtc_ig], s[s_k]
    s_mul_hi_u32 s[s_tmp+1], s[s_block_gtc_ig], s[s_k]
    s_add_u32 s[s_p_out], s[s_p_out], s[s_tmp]
    s_addc_u32 s[s_p_out+1], s[s_p_out+1], s[s_tmp+1]

    s_lshl_b32 s[s_tmp+3], s[s_block_gtc_ik], 2
    s_add_u32 s[s_p_out], s[s_p_out], s[s_tmp+3]
    s_addc_u32 s[s_p_out+1], s[s_p_out+1], 0

    s_lshl_b32 s[s_out_stride_wo], s[s_out_stride_wo], 2
    v_add_u32 v[v_out_inb], s[s_block_gtc_inb], v[v_co_sub_m_index]   ; total n*ho*wo
    v_mul_lo_u32 v[v_out_os], s[s_out_stride_wo], v[v_out_inb]
    v_lshlrev_b32 v[v_tmp], 2, v[v_co_sub_n_index]
    v_add_u32 v[v_out_os], v[v_out_os], v[v_tmp]
    ; move slice stride
    s_lshl_b32 s[s_gemm_k_num_c], s[s_sub_c], 2
    s_lshl_b32 s[s_tmp], s[s_c], 2
    s_sub_u32  s[s_gemm_k_diff_c],  s[s_tmp], s[s_gemm_k_num_c]
    v_bfe_u32 v[v_wei_flag], v[v_wei_tmp_pack], 0, 1
    s_mov_b32 s[s_move_slice_k_stride_c], 64
    v_bfe_u32 v[v_wei_flag+1], v[v_wei_tmp_pack], 1, 1
    s_mov_b32 s[s_move_slice_k_ix], 0
    s_mul_i32 s[s_in_diff_wi], s[s_dilation_w], s[s_in_stride_wi]
    s_sub_i32 s[s_tmp+3], s[s_x], 1
    s_mul_i32 s[s_tmp], s[s_in_diff_wi], s[s_tmp+3]
    s_mul_i32 s[s_t


9px}.x-fieldset legend{color:#003C66}.sds-window .x-window-bc .x-window-footer{padding:0}body,.ext-el-mask-msg div,.x-tab-strip span.x-tab-strip-text,.x-form-field,.x-form-grow-sizer,.x-form-grow-sizer,.x-form-item,.x-form-invalid-msg,.x-fieldset legend,.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label,.x-grid-group-hd div.x-grid-group-title,.x-grid-empty,.x-tip .x-tip-mc,.x-tip .x-tip-header-text,.x-tip .x-tip-body,.x-window-mc,.x-window-dlg .ext-mb-textarea{font-family:verdana, tahoma, arial, helvetica, sans-serif}.x-small-editor .x-form-field,.ext-webkit .x-small-editor .x-form-field,.x-grid3-hd-row td,.x-grid3-row td,.x-grid3-summary-row td,.x-grid3-topbar,.x-grid3-bottombar,.x-tree-node,.x-date-inner th,.x-date-inner a,.x-date-mp td,.x-date-mp-btns button,.x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label,.x-list-header-inner div em,.x-list-body dt em{font-family:verdana, arial, tahoma, helvetica, sans-serif}.x-btn{font-family:verdana, tahoma, helvetica}.x-btn button{font-family:verdana, arial, tahoma, helvetica}.x-dd-drag-ghost{font-family:verdana, arial, helvetica, sans-serif}.x-date-middle,.x-date-left,.x-date-right{font-family:verdana, "sans serif", tahoma, verdana, helvetica}.x-menu-list-item{font-family:verdana, arial, tahoma, sans-serif}.x-combo-list,.x-combo-list-hd,.x-combo-list-small,.x-panel-tl .x-panel-header,.x-panel-mc{font-family:verdana, tahoma, arial, helvetica, sans-serif}.x-btn button{font-family:verdana, arial,tahoma,verdana,helvetica}.x-ie-shadow{background-color:#333}.x-shadow .xsmc{background-image:url(../img/synohdpack/images/dsm/resources/images/shadow-c.png)}.x-shadow .xsml,.x-shadow .xsmr{background-image:url(../img/synohdpack/images/dsm/resources/images/shadow-lr.png)}.x-shadow .xstl,.x-shadow .xstc,.x-shadow .xstr,.x-shadow .xsbl,.x-shadow .xsbc,.x-shadow .xsbr{background-image:url(../img/synohdpack/images/dsm/resources/images/shadow.png)}.without-dirty-red-grid .x-grid3-dirty-cell{background:none}.x-grid-group-hd{background-image:url(../img/synohdpack/images/dsm/resources/images/grid_title_bg.png);padding-top:2px;border:none}.x-grid-group-hd div.x-grid-group-title{color:#003C66}.x-grid3-row{background-color:#FAFAFA}.x-grid3-row-alt{background-color:#F5F5F5}.x-grid3-row-over{background-image:none;background-color:#E6F0FA;border-color:#DCE6F0}.x-grid3-row-selected{b


uted 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.
 */

package im.vector.app.features.home.room.detail.timeline.helper

import im.vector.app.core.utils.TextUtils
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.call.CallInviteContent
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.session.widgets.model.WidgetContent
import org.threeten.bp.Duration

class TimelineEventsGroup(val groupId: String) {

    val events: Set<TimelineEvent>
        get() = _events

    private val _events = HashSet<TimelineEvent>()

    fun add(timelineEvent: TimelineEvent) {
        _events.add(timelineEvent)
    }
}

class TimelineEventsGroups {

    private val groups = HashMap<String, TimelineEventsGroup>()

    fun addOrIgnore(event: TimelineEvent) {
        val groupId = event.getGroupIdOrNull() ?: return
        groups.getOrPut(groupId) { TimelineEventsGroup(groupId) }.add(event)
    }

    fun getOrNull(event: TimelineEvent): TimelineEventsGroup? {
        val groupId = event.getGroupIdOrNull() ?: return null
        return groups[groupId]
    }

    private fun TimelineEvent.getGroupIdOrNull(): String? {
        val type = root.getClearType()
        val content = root.getClearContent()
        return if (EventType.isCallEvent(type)) {
            (content?.get("call_id") as? String)
        } else if (type == EventType.STATE_ROOM_WIDGET || type == EventType.STATE_ROOM_WIDGET_LEGACY) {
            root.stateKey
        } else {
            null
        }
    }

    fun clear() {
        groups.clear()
    }
}

class JitsiWidgetEventsGroup(private val group: TimelineEventsGroup) {

    val callId: String = group.groupId

    fun isStillActive(): Boolean {
        return group.events.none {
            it.root.getClearContent().toModel<WidgetContent>()?.isActive() == false
        }
    }
}

class CallSignalingEventsGroup(private val group: TimelineEventsGroup) {

    val callId: String = group.groupId

    fun isVideo(): Boolean {
        val invite = getInvite() ?: return false
        return invite.root.getClearContent().toModel<CallInviteContent>()?.isVideo().orFalse()
    }

    fun isRinging(): Boolean {
        return getAnswer() == null && getHangup() == null && getReject() == null
    }

    fun isInCall(): Boolean {
        return getHangup() == null && getReject() == null
    }

    fun formattedDuration(): String {
        val start = getAnswer()?.root?.originServerTs
        val end = getHangup()?.root?.originServerTs
        return if (start == null || end == null) {
            ""
        } else {
            val durationInMillis = (end - start).coerceAtLeast(0L)
            val duration = Duration.ofMillis(durationInMillis)
            TextUtils.formatDuration(duration)
        }
    }

    /**
     * Returns true if there are only events from one side.
     */
    fun callWasMissed(): Boolean {
        return group.events.distinctBy { it.senderInfo.userId }.size == 1
    }

    private fun getAnswer(): TimelineEvent? {
        return group.events.firstOrNull { it.root.get


CoroutineDispatcher).close()
    override fun close() {
        throw UnsupportedOperationException("Dispatchers.Default cannot be closed")
    }

    override fun toString(): String = "Dispatchers.Default"
}

// The unlimited instance of Dispatchers.IO that utilizes all the threads CoroutineScheduler provides
private object UnlimitedIoScheduler : CoroutineDispatcher() {

    @InternalCoroutinesApi
    override fun dispatchYield(context: CoroutineContext, block: Runnable) {
        DefaultScheduler.dispatchWithContext(block, BlockingContext, true)
    }

    override fun dispatch(context: CoroutineContext, block: Runnable) {
        DefaultScheduler.dispatchWithContext(block, BlockingContext, false)
    }

    override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
        parallelism.checkParallelism()
        if (parallelism >= MAX_POOL_SIZE) {
            return namedOrThis(name)
        }
        return super.limitedParallelism(parallelism, name)
    }

    // This name only leaks to user code as part of .limitedParallelism machinery
    override fun toString(): String {
        return "Dispatchers.IO"
    }
}

// Dispatchers.IO
internal object DefaultIoScheduler : ExecutorCoroutineDispatcher(), Executor {

    private val default = UnlimitedIoScheduler.limitedParallelism(
        systemProp(
            IO_PARALLELISM_PROPERTY_NAME,
            64.coerceAtLeast(AVAILABLE_PROCESSORS)
        )
    )

    override val executor: Executor
        get() = this

    override fun execute(command: java.lang.Runnable) = dispatch(EmptyCoroutineContext, command)

    override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
        // See documentation to Dispatchers.IO for the rationale
        return UnlimitedIoScheduler.limitedParallelism(parallelism, name)
    }

    override fun dispatch(context: CoroutineContext, block: Runnable) {
        default.dispatch(context, block)
    }

    @InternalCoroutinesApi
    override fun dispatchYield(context: CoroutineContext, block: Runnable) {
        default.dispatchYield(context, block)
    }

    override fun close() {
        error("Cannot be invoked on Dispatchers.IO")
    }

    override fun toString(): String = "Dispatchers.IO"
}

// Instantiated in tests so we can test it in isolation
internal open class SchedulerCoroutineDispatcher(
    private val corePoolSize: Int = CORE_POOL_SIZE,
    private val maxPoolSize: Int = MAX_POOL_SIZE,
    private val idleWorkerKeepAliveNs: Long = IDLE_WORKER_KEEP_ALIVE_NS,
    private val schedulerName: String = "CoroutineScheduler",
) : ExecutorCoroutineDispatcher() {

    override val executor: Executor
        get() = coroutineScheduler

    // This is variable for test purposes, so that we can reinitialize from clean state
    private var coroutineScheduler = createScheduler()

    private fun createScheduler() =
        CoroutineScheduler(corePoolSize, maxPoolSize, idleWorkerKeepAliveNs, schedulerName)

    override fun dispatch(context: CoroutineContext, block: Runnable): Unit = coroutineScheduler.dispatch(block)

    override fun dispatchYield(context: CoroutineContext, block: Runnable): Unit {
        /*
         * 'dispatchYield' implementation is needed to address the scheduler's scheduling policy.
         * By default, the scheduler dispatches tasks in a semi-LIFO order, meaning that for the
         * task sequence [#1, #2, #3], the scheduling of task #4 will produce
         * [#4, #1, #2, #3], allocates new worker and makes #4 stealable after some time.
         * On a fast enough system, it means that `while (true) { yield() }` might obstruct the progress
         * of the system and potential


//
//     Generated by class-dump 3.5 (64 bit).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//

#import "NSObject.h"

@interface _NSScrollingMomentumCalculator : NSObject
{
}

- (struct CGPoint)positionAfterDuration:(double)arg1;
- (double)velocityAfterDuration:(double)arg1;
@property(readonly) double durationUntilStop;
@property struct CGRect documentFrame;
@property struct CGPoint destinationOrigin;
@property struct CGPoint initialOrigin;
@property struct CGSize tolerance;
- (id)initWithInitialOrigin:(struct CGPoint)arg1 velocity:(struct CGPoint)arg2 documentFrame:(struct CGRect)arg3 constrainedClippingOrigin:(struct CGPoint)arg4 clippingSize:(struct CGSize)arg5;
- (id)initWithInitialOrigin:(struct CGPoint)arg1 velocity:(struct CGPoint)arg2 documentFrame:(struct CGRect)arg3 constrainedClippingOrigin:(struct CGPoint)arg4 clippingSize:(struct CGSize)arg5 tolerance:(struct CGSize)arg6;
- (id)initWithInitialOrigin:(struct CGPoint)arg1 velocity:(struct CGPoint)arg2 documentFrame:(struct CGRect)arg3 constrainedClippingOrigin:(struct CGPoint)arg4 clippingSize:(struct CGSize)arg5 tolerance:(struct CGSize)arg6 maxDuration:(double)arg7;

@end


;
//     start_date: Date;
//     end_date: Date;
//     text: string;
// }class Cliente{
    nome : string;
    idade : number;

    constructor(nome : string, idade : number){
        this.nome = nome;
        this.idade = idade;
    }

    apresentar(){
        return `Meu nome é: ${this.nome} e tenho ${this.idade} anos`;
    }
}

let joao : Cliente = new Cliente('Charles', 31);

console.log(joao.apresentar);// @ts-ignore
@external("env", "_log")
declare function _log(offset: usize, len: usize): void;

// @ts-ignore
export function log(a: string): void {
    const str = String.UTF8.encode(a);
    _log(changetype<usize>(str), str.byteLength)
}

export class Hex {
    static encode(buf: Uint8Array): string {
        let out = "";
        for (let i = 0; i < buf.length; i++) {
            const a = buf[i] as u32;
            const b = a & 0xf;
            const c = a >> 4;

            let x: u32 = ((87 + b + (((b - 10) >> 8) & ~38)) << 8) | (87 + c + (((c - 10) >> 8) & ~38));
            out += String.fromCharCode(x as u8);
            x >>= 8;
            out += String.fromCharCode(x as u8);
        }
        return out;
    }

    private static hexToInt(x: u8): u8{
        if(<u8>48 <= x && x <= <u8>57) return x - <u8>48;
        if(<u8>97 <= x && x <= <u8>102) return x - <u8>87;
        if(<u8>65 <= x && x <= <u8>70) return x - <u8>55;
        return 0;
    }

    static decode(s: string): Uint8Array{
        assert(s.length % 2 == 0, 'invalid char');
        const ret = new Uint8Array(s.length / 2);
        for(let i: u32 = 0; i < u32(s.length/2) ; i++){
            const h: u8 = u8(s.charCodeAt(i * 2));
            const l: u8 = u8(s.charCodeAt(i * 2 + 1));
            ret[i] = (Hex.hexToInt(h) << 4) + Hex.hexToInt(l);
        }
        return ret;
    }
}

export * from './context';
export * from './decimal';
export * from './json';
export * from './result';
export * from './event'
export * from './rlp'
export * from './db';
import LinkedList from './LinkedList';
import { SinglyLinkedNode } from './SinglyLinkedList';

class CircularLinkedList<T> extends LinkedList<T> {
  protected _tail: SinglyLinkedNode<T> | null = null;

  addHead(value: T): this {
    const newNode = new SinglyLinkedNode(value, null);
    if (this.isEmpty()) {
      this._tail = newNode;
      newNode.next = newNode;
    } else {
      newNode.next = this._tail!.next;
      this._tail!.next = newNode;
    }
    this._length++;
    return this;
  }

  addTail(value: T): this {
    const newNode = new SinglyLinkedNode(value, null);
    if (this.isEmpty()) {
      this._tail = newNode;
      newNode.next = newNode;
    } else {
      newNode.next = this._tail!.next;
      this._tail!.next = newNode;
      this._tail = newNode;


, tx_index: u64, max_mature_number: u64) -> bool {
    // Not cellbase cell
    tx_index > 0
    // Live cells in genesis are all mature
        || number == 0
        || number <= max_mature_number
}

pub fn get_secp_data(
    rpc_client: &mut HttpRpcClient,
) -> Result<(Bytes, gw_jsonrpc_types::blockchain::CellDep), String> {
    let mut cell_dep = None;
    rpc_client
        .get_block_by_number(0)?
        .expect("get CKB genesis block")
        .transactions
        .iter()
        .for_each(|tx| {
            tx.inner
                .outputs_data
                .iter()
                .enumerate()
                .for_each(|(output_index, data)| {
                    let data_hash = ckb_types::packed::CellOutput::calc_data_hash(data.as_bytes());
                    if data_hash.as_slice() == CODE_HASH_SECP256K1_DATA.as_bytes() {
                        let out_point = gw_jsonrpc_types::blockchain::OutPoint {
                            tx_hash: tx.hash.clone(),
                            index: (output_index as u32).into(),
                        };
                        cell_dep = Some((
                            data.clone().into_bytes(),
                            gw_jsonrpc_types::blockchain::CellDep {
                                out_point,
                                dep_type: gw_jsonrpc_types::blockchain::DepType::Code,
                            },
                        ));
                    }
                });
        });
    cell_dep.ok_or_else(|| "Can not found secp data cell in CKB genesis block".to_string())
}
<reponame>PatrickAJonas/sudo_pair<filename>sudo_plugin/src/version.rs
// Copyright 2018 Square 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.

use super::errors::*;

use std::fmt;

use libc::c_uint;

const MINIMUM_MAJOR: u16 = 1;
const MINIMUM_MINOR: u16 = 9;

const MINIMUM: Version = Version {
    major: MINIMUM_MAJOR,
    minor: MINIMUM_MINOR,
};

#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord)]
pub struct Version {
    major: u16,
    minor: u16,
}

impl Version {
    pub fn minimum() -> &'static Self {
        &MINIMUM
    }

    pub fn supported(&self) -> bool {
        self >= Self::minimum()
    }

    pub fn check(self) -> Result<Self> {
        if !self.supported() {
            bail!(ErrorKind::UnsupportedApiVersion(self))
        }

        Ok(self)
    }
}

impl From<c_uint> for Version {
    #[cfg_attr(feature="cargo-clippy", allow(cast_possible_truncation))]
    fn from(version: c_uint) -> Self {
        Self {
            major: (version >> 16)     as _,
            minor: (version &  0xffff) as _,
        }
    }
}

impl fmt::Display for Version {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}.{}", self.major, self.mino


// Copyright (c) rubicon IT GmbH, www.rubicon.eu
//
// See the NOTICE file distributed with this work for additional information
// regarding copyright ownership.  rubicon licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License.  You may obtain a copy of the
// License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
// License for the specific language governing permissions and limitations
// under the License.
//
using System;
using System.Reflection;
using Remotion.Linq.Clauses.StreamedData;
using Remotion.Linq.Utilities;
using Remotion.Utilities;

namespace Remotion.Linq.Clause


and_embedding_features], axis=1)\\n\\n    # Apply initial batch normalization\\n    x = self.initial_batchnorm(combined_features_for_mlp, training=training)\\n\\n    # Project features to the dimension of residual blocks\\n    x = self.initial_projection_dense(x)\\n\\n    # Pass through residual blocks\\n    x = self.res_block1(x, training=training)\\n    x = self.res_block2(x, training=training)\\n    x = self.res_block3(x, training=training)\\n    x = self.res_block4(x, training=training)\\n\\n    # Final prediction layer\\n    output = self.final_output_dense(x) # Shape: (B*N, H)\\n    return output\\n\\n  def _raw_data_generator(self, data_loader_instance):\\n    \\"\\"\\"\\n    A Python generator to yield raw (series_input, series_output) pairs\\n    from a grain.DataLoader. These are NumPy arrays as provided by grain.\\n    \\"\\"\\"\\n    for element in data_loader_instance:\\n      yield element['series_input'], element['series_output']\\n\\n  @tf.function # Decorate for graph mode execution\\n  def _prepare_targets_for_training(self, series_input_batch: tf.Tensor, series_output_batch: tf.Tensor):\\n    \\"\\"\\"\\n    Prepares the target tensor (y_true) for training by reshaping it\\n    to match the model's output shape (batch_size * NUM_NEURONS, H).\\n    The series_input_batch is returned as is, for the model's \`call\` method.\\n    \\"\\"\\"\\n    # Reshape the output batch (targets) from (B, H, N) to (B, N, H)\\n    y_target = tf.transpose(series_output_batch, perm=[0, 2, 1]) # Shape: (B, N, H)\\n    y_target = tf.reshape(y_target, [-1, self.PREDICTION_WINDOW_LENGTH]) # Shape: (B*N, H)\\n    return series_input_batch, y_target\\n\\n  def fit(self, train_data_loader, val_data_loader=None, epochs=10):\\n    \\"\\"\\"\\n    Trains the shared-weight MLP model using the provided data loaders via Keras's Model.fit().\\n\\n    Args:\\n      train_data_loader: A grain.DataLoader instance for training data.\\n      val_data_loader: An optional grain.DataLoader instance for validation data.\\n      epochs: Number of epochs to train for.\\n    \\"\\"\\"\\n    print(f\\"\\\\nStarting training for {epochs} epochs using Keras model.fit()...\\")\\n\\n    # Create tf.data.Dataset from generators for efficient data pipeline.\\n    train_dataset = tf.data.Dataset.from_generator(\\n        lambda: self._raw_data_generator(train_data_loader),\\n        output_signature=(\\n            tf.TensorSpec(shape=(None, self.NUM_TIMESTEPS_CONTEXT, self.NUM_NEURONS), dtype=tf.float32),\\n            tf.TensorSpec(shape=(None, self.PREDICTION_WINDOW_LENGTH, self.NUM_NEURONS), dtype=tf.float32)\\n        )\\n    ).map(self._prepare_targets_for_training, num_parallel_calls=tf.data.AUTOTUNE).prefetch(tf.data.AUTOTUNE)\\n\\n    validation_dataset = None\\n    callbacks = []\\n\\n    if val_data_loader:\\n        validation_dataset = tf.data.Dataset.from_generator(\\n            lambda: self._raw_data_generator(val_data_loader),\\n            output_signature=(\\n                tf.TensorSpec(shape=(None, self.NUM_TIMESTEPS_CONTEXT, self.NUM_NEURONS), dtype=tf.float32),\\n


活动、成交信息及评价详情；

 - 违反法律规定或违反本软件规则行为及本软件已对您采取的措施。

##2.信息使用

-  本软件不会向任何无关第三方提供、出售、出租、分享或交易您的个人信息，除非事先得到您的许可，或该第三方和本软件（含本软件关联公司）单独或共同为您提供服务，且在该服务结束后，其将被禁止访问包括其以前能够访问的所有这些资料。

- 本软件亦不允许任何第三方以任何手段收集、编辑、出售或者无偿传播您的个人信息。任何本软件平台用户如从事上述活动，一经发现，本软件有权立即终止与该用户的服务协议。

- 为服务用户的目的，本软件可能通过使用您的个人信息，向您提供您感兴趣的信息，包括但不限于向您发出产品和服务信息，或者与本软件合作伙伴共享信息以便他们向您发送有关其产品和服务的信息（后者需要您的事先同意）。

##3.信息披露

在如下情况下，本软件将依据您的个人意愿或法律的规定全部或部分的披露您的个人信息：

- 经您事先同意，向第三方披露；

- 为提供您所要求的产品和服务，而必须和第三方分享您的个人信息；

-  根据法律的有关规定，或者行政或司法机构的要求，向第三方或者行政、司法机构披露；

-  如您出现违反中国有关法律、法规或者本软件服务协议或相关规则的情况，需要向第三方披露；

-  如您是适格的知识产权投诉人并已提起投诉，应被投诉人要求，向被投诉人披露，以便双方处理可能的权利纠纷；

-  在本软件平台上创建的某一交易中，如交易任何一方履行或部分履行了交易义务并提出信息披露请求的，本软件有权决定向该用户提供其交易对方的联络方式等必要信息，以促成交易的完成或纠纷的解决。

-  其它本软件根据法律、法规或者网站政策认为合适的披露。

##4. 信息存储和交换

本软件收集的有关您的信息和资料将保存在本软件及（或）其关联公司的服务器上，这些信息和资料可能传送至您所在国家、地区或本软件收集信息和资料所在地的境外并在境外被访问、存储和展示。

##5. Cookie的使用

-  在您未拒绝接受cookies的情况下，本软件会在您的计算机上设定或取用cookies
，以便您能登录或使用依赖于cookies的本软件平台服务或功能。本软件使用cookies可为您提供更加周到的个性化服务，包括推广服务。

-  您有权选择接受或拒绝接受cookies。您可以通过修改浏览器设置的方式拒绝接受cookies。但如果您选择拒绝接受cooki


e. verify that `id >= 0 && id < ItemDefinition.count()`).
     *
     * @throws IndexOutOfBoundsException If the id is out of bounds.
     */
    fun item(id: Int): ItemDefinition {
        return ItemDefinition.lookup(id)
    }

    /**
     * Returns the [ItemDefinition] with the specified name, performing case-insensitive matching. If multiple items
     * share the same name, the item with the lowest id is returned.
     *
     * The name may be suffixed with an explicit item id (as a way to disambiguate in the above case), by ending the
     * name with `_id`, e.g. `monks_robe_42`. If an explicit id is attached, it must be bounds checked (in the same
     * manner as [item(id: Int)][item]).
     */
    fun item(name: String): ItemDefinition? {
        return findEntity(ItemDefinition::getDefinitions, ItemDefinition::getName, name)
    }

    /**
     * Returns the [ObjectDefinition] with the specified [id]. Callers of this function must perform bounds checking on
     * the [id] prior to invoking this method (i.e. verify that `id >= 0 && id < ObjectDefinition.count()`).
     *
     * @throws IndexOutOfBoundsException If the id is out of bounds.
     */
    fun obj(id: Int): ObjectDefinition {
        return ObjectDefinition.lookup(id)
    }

    /**
     * Returns the [ObjectDefinition] with the specified name, performing case-insensitive matching. If multiple objects
     * share the same name, the object with the lowest id is returned.
     *
     * The name may be suffixed with an explicit object id (as a way to disambiguate in the above case), by ending the
     * name with `_id`, e.g. `man_2`. If an explicit id is attached, it must be bounds checked (in the same
     * manner as [object(id: Int)][object]).
     */
    fun obj(name: String): ObjectDefinition? {
        return findEntity(ObjectDefinition::getDefinitions, ObjectDefinition::getName, name)
    }

    /**
     * Returns the [NpcDefinition] with the specified [id]. Callers of this function must perform bounds checking on
     * the [id] prior to invoking this method (i.e. verify that `id >= 0 && id < NpcDefinition.count()`).
     *
     * @throws IndexOutOfBoundsException If the id is out of bounds.
     */
    fun npc(id: Int): NpcDefinition {
        return NpcDefinition.lookup(id)
    }

    /**
     * Returns the [NpcDefinition] with the specified name, performing case-insensitive matching. If multiple npcs
     * share the same name, the npc with the lowest id is returned.
     *
     * The name may be suffixed with an explicit npc id (as a way to disambiguate in the above case), by ending the
     * name with `_id`, e.g. `man_2`. If an explicit id is attached, it must be bounds checked (in the same
     * manner as [npc(id: Int)][npc]).
     */
    fun npc(name: String): NpcDefinition? {
        return findEntity(NpcDefinition::getDefinitions, NpcDefinition::getName, name)
    }

    /**
     * The [Regex] used to match 'names' that have an id attached to the end.
     */
    private val ID_REGEX = Regex(".+_[0-9]+$")

    private fun <T : Any> findEntity(
        definitionsProvider: () -> Array<T>,
        nameSupplier: T.() -> String,
        name: String
    ): T? {
        val definitions = definitionsProvider()

        if (ID_REGEX matches name) {
            val id = name.substring(name.lastIndexOf('_') + 1, name.length).toIntOrNull()

            if (id == null || id >= definitions.size) {
                throw IllegalArgumentException("Error while searching for def


allenge_name',
  wordCloudConfig: {
    zoomToFit: {
      shrink: true,
      fontSizeLimitMin: 5
    }
  },
  data: {
    name: 'baseData',
    values: dataWordCloud
  }
};
const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// 只为了方便控制台调试用，不要拷贝
window['vchart'] = vchart;
```

### 文本格式化

可以用自定义函数的方式修改文本显示内容。
`word.formatMethod` 属性声明为文字的自定义格式函数, 该配置可以修改词云文字的显示内容，不会修改原始数据，不会影响 tooltip 等原生交互与事件

```javascript livedemo
const response = await fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/data-wordcloud.json');
const dataWordCloud = await response.json();

const spec = {
  type: 'wordCloud',
  nameField: 'challenge_name',
  valueField: 'sum_count',
  seriesField: 'challenge_name',
  word: {
    formatMethod: datum => {
      return datum.challenge_name + '...';
    }
  },
  data: {
    name: 'baseData',
    values: dataWordCloud
  }
};
const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// 只为了方便控制台调试用，不要拷贝
window['vchart'] = vchart;
```

### 文字随机角度

如果希望文字在布局时自带随机角度，可以通过`wordCloudChart.rotateAngles`进行配置，该数组中可以添加可选的随机角度。

```javascript livedemo
const response = await fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/data-wordcloud.json');
const dataWordCloud = await response.json();

const spec = {
  type: 'wordCloud',
  nameField: 'challenge_name',
  valueField: 'sum_count',
  seriesField: 'challenge_name',
  rotateAngles: [0, 90],
  data: {
    name: 'baseData',
    values: dataWordCloud
  }
};
const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// 只为了方便控制台调试用，不要拷贝
window['vchart'] = vchart;
```

### 布局模式

在 VChart 中提供三种布局方式，使用`wordCloudChart.wordCloudConfig.layoutMode`可进行配置。

- `'fast'`: 快速布局，布局速度快但不保证效果，用于小程序 & 小组件环境
- `'grid'`: 基于 grid 像素布局
- `'default'`: 基于像素布局

```javascript livedemo
const response = await fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/data-wordcloud.json');
const dataWordCloud = await response.json();

const spec = {
  type: 'wordCloud',
  nameField: 'challenge_name',
  valueField: 'sum_count',
  seriesField: 'challenge_name',

  wordCloudConfig: {


64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *LiteralVec) ProtoSize() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Len != 0 {
		n += 1 + sovPlan(uint64(m.Len))
	}
	l = len(m.Data)
	if l > 0 {
		n += 1 + l + sovPlan(uint64(l))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *Decimal64) ProtoSize() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.A != 0 {
		n += 1 + sovPlan(uint64(m.A))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *Decimal128) ProtoSize() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.A != 0 {
		n += 1 + sovPlan(uint64(m.A))
	}
	if m.B != 0 {
		n += 1 + sovPlan(uint64(m.B))
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *ResultColDef) ProtoSize() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if len(m.ResultCols) > 0 {
		for _, e := range m.ResultCols {
			l = e.ProtoSize()
			n += 1 + l + sovPlan(uint64(l))
		}
	}
	if m.XXX_unrecognized != nil {
		n += len(m.XXX_unrecognized)
	}
	return n
}

func (m *ColDef) ProtoSize() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.ColId != 0 {
		n += 1 + sovPlan(uint64(m.ColId))
	}
	l = len(m.Name)
	if l > 0 {
		n += 1 + l + sovPlan(uint64(l))
	}
	if m.Hidden {
		n += 2
	}
	if m.Alg != 0 {
		n += 1 + sovPlan(uint64(m.Alg))
	}
	l = m.Typ.ProtoSize()
	n += 1 + l + sovPlan(uint64(l))
	if m.NotNull {
		n += 2
	}
	if m.Default != nil {
		l = m.Default.ProtoSize()
		n += 1 + l + sovPlan(uint64(l))
	}
	l = len(m.Comment)
	if l > 0 {
		n += 1 + l + sovPlan(uint64(l))
	}
	if m.OnUpdate != nil {
		l = m.OnUpdate.ProtoSize()
		n += 1 + l + sovPlan(uint64(l))
	}
	if m.LowCard {
		n += 2
	}
	if m.Seqnum != 0 {
		n += 1 + sovPlan(uint64(m.Seqnum))
	}
	if m.ClusterBy {
		n += 2
	}
	if m.Primary {
		n += 2
	}
	if m.Pkidx != 0 {
		n += 1 + sovPlan(uint64(m.Pkidx))
	}
	if m.Headers {
		n += 2
	}
	l = len(


"))

check(mtn("add", "."), 0, false, false)
check(mtn("ls", "known"), 0, true, false)
check(not qgrep("'test.db'", "stdout"))

mkdir("subdir")
copy("test.db", "subdir/test.db")

check(mtn("--db=subdir/test.db", "add", "subdir/test.db"), 0, false, false)
check(mtn("--db=subdir/test.db", "ls", "known"), 0, true, false)
check(not qgrep("'subdir/test.db'", "stdout"))

-- If it's not an in-use DB, it should work, though
check(mtn("add", "subdir/test.db"), 0, false, false)
check(mtn("ls", "known"), 0, true, false)
check(qgrep("subdir/test.db", "stdout"))


earlydefinedVersions[0]).to.eq('1')
      expect(clearlydefinedVersions.length).to.eq(1)
      const scancodeVersions = Object.getOwnPropertyNames(result.scancode)
      expect(scancodeVersions[0]).to.eq('2.2.1')
      expect(scancodeVersions[1]).to.eq('2.9.1')
      expect(scancodeVersions[2]).to.eq('2.9.2')
      expect(scancodeVersions.length).to.eq(3)
    })
  })

  describe('getAllLatest', () => {
    it('should get latest tool versions', () => {
      const store = Store({})
      let latest = store._getLatestToolPaths([
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/clearlydefined/1.5.0.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/licensee/9.18.1.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/licensee/9.14.0.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/reuse/3.2.1.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/reuse/3.2.2.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/scancode/32.3.0.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/scancode/30.3.0.json'
      ])
      expect(Array.from(latest)).to.equalInAnyOrder([
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/clearlydefined/1.5.0.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/licensee/9.18.1.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/reuse/3.2.2.json',
        'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/scancode/32.3.0.json'
      ])
    })

    it('retrieves latest entries', async () => {
      const azblobStore = createAzBlobStore(
        createEntries([
          'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/clearlydefined/1.5.0.json',
          'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/licensee/9.18.1.json',
          'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/licensee/9.14.0.json',
          'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/reuse/3.2.1.json',
          'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/reuse/3.2.2.json',
          'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/scancode/32.3.0.json',
          'maven/mavencentral/org.apache.httpcomponents/httpcore/revision/4.4.16/tool/scancode/30.3.0.json'
        ])
      )

      const result = await azblobStore.getAllLatest({
        type: 'maven',
        provider: 'mavencentral',
        namespace: 'org.apache.httpcomponents',
        name: 'http


ound(flag))?;

        parse_value(command.kind, results, command.long, args)?;
    } else {
        // '-' is a valid argument, like the `cat -`
        results.unnamed.push("-".to_string());
    }

    for flag in all_shorts {
        let command = schema
            .short(flag)
            .ok_or(CallError::ShortFlagNotFound(flag))?;

        if let SchemaKind::Bool = command.kind {
            results.insert(command.long, Box::new(true));
        } else {
            return Err(CallError::CombinedShortWithValue(command.long.to_string()));
        }
    }

    Ok(())
}

fn parse_long(
    schema: &Schema,
    results: &mut CliArgs,
    long: &str,
    args: &mut impl Iterator<Item = OsString>,
) -> Result<()> {
    if long == "help" {
        return Err(CallError::HelpPage);
    }
    let command = schema
        .long(long)
        .ok_or_else(|| CallError::LongFlagNotFound(long.to_string()))?;

    parse_value(command.kind, results, command.long, args)
}

fn parse_value(
    kind: SchemaKind,
    results: &mut CliArgs,
    long: &'static str,
    args: &mut impl Iterator<Item = OsString>,
) -> Result<()> {
    match kind {
        SchemaKind::String => {
            let string = args
                .next()
                .ok_or_else(|| CallError::ExpectedValue(long.to_string(), kind))?
                .into_string()
                .map_err(CallError::InvalidUtf8)?;
            results.insert(long, Box::new(string));
        }
        SchemaKind::IInt => {
            let integer = args
                .next()
                .ok_or_else(|| CallError::ExpectedValue(long.to_string(), kind))?
                .into_string()
                .map_err(CallError::InvalidUtf8)?
                .parse::<isize>()
                .map_err(|_| CallError::INan(long.to_string()))?;
            results.insert(long, Box::new(integer))
        }
        SchemaKind::UInt => {
            let integer = args
                .next()
                .ok_or_else(|| CallError::ExpectedValue(long.to_string(), kind))?
                .into_string()
                .map_err(CallError::InvalidUtf8)?
                .parse::<usize>()
                .map_err(|_| CallError::UNan(long.to_string()))?;
            results.insert(long, Box::new(integer))
        }
        SchemaKind::Num => {
            let float = args
                .next()
                .ok_or_else(|| CallError::ExpectedValue(long.to_string(), kind))?
                .into_string()
                .map_err(CallError::InvalidUtf8)?
                .parse::<f64>()
                .map_err(|_| CallError::NNan(long.to_string()))?;
            results.insert(long, Box::new(float))
        }
        SchemaKind::Bool => {
            results.insert(long, Box::new(true));
        }
    };
    Ok(())
}

#[cfg(test)]
mod test {
    use super::*;
    use crate::arg;
    use crate::schema::Schema;

    arg!(OutFile: "output", 'o' -> String);
    arg!(Input: "input", 'i' -> String);
    arg!(SetUpstream: "set-upstream" -> String);

    arg!(Force: "force", 'f' -> bool);
    arg!(Gentle: "gentle", 'g' -> bool);

    arg!(OLevel: "olevel", 'l' -> usize);
    arg!(


in, box.min, point);
        Vec3.max(box.max, box.max, point);
        return box;
    }

    /** Expand box by delta */
    export function expand(out: Box3D, box: Box3D, delta: Vec3): Box3D {
        Vec3.sub(out.min, box.min, delta);
        Vec3.add(out.max, box.max, delta);
        return out;
    }

    export function scale(out: Box3D, box: Box3D, scale: number) {
        Vec3.scale(out.min, box.min, scale);
        Vec3.scale(out.max, box.max, scale);
        return out;
    }

    const tmpTransformV = Vec3();
    /** Transform box with a Mat4 */
    export function transform(out: Box3D, box: Box3D, m: Mat4): Box3D {
        const [minX, minY, minZ] = box.min;
        const [maxX, maxY, maxZ] = box.max;
        setEmpty(out);
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, minX, minY, minZ), m));
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, minX, minY, maxZ), m));
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, minX, maxY, minZ), m));
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, minX, maxY, maxZ), m));
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, maxX, minY, minZ), m));
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, maxX, minY, maxZ), m));
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, maxX, maxY, minZ), m));
        add(out, Vec3.transformMat4(tmpTransformV, Vec3.set(tmpTransformV, maxX, maxY, maxZ), m));
        return out;
    }

    export function containsVec3(box: Box3D, v: Vec3) {
        return !(
            v[0] < box.min[0] || v[0] > box.max[0] ||
            v[1] < box.min[1] || v[1] > box.max[1] ||
            v[2] < box.min[2] || v[2] > box.max[2]
        );
    }

    export function overlaps(a: Box3D, b: Box3D) {
        return !(
            a.max[0] < b.min[0] || a.min[0] > b.max[0] ||
            a.max[1] < b.min[1] || a.min[1] > b.max[1] ||
            a.max[2] < b.min[2] || a.min[2] > b.max[2]
        );
    }

    export function containsSphere3D(box: Box3D, s: Sphere3D) {
        const c = s.center;
        const r = s.radius;
        return (
            c[0] - r < box.min[0] || c[0] + r > box.max[0] ||
            c[1] - r < box.min[1] || c[1] + r > box.max[1] ||
            c[2] - r < box.min[2] || c[2] + r > box.max[2]
        ) ? false : true;
    }

    export function nearestIntersectionWithRay(out: Vec3, box: Box3D, origin: Vec3, dir: Vec3): Vec3 {
        const [minX, minY, minZ] = box.min;
        const [maxX, maxY, maxZ] = box.max;
        const [x, y, z] = origin;
        const invDirX = 1.0 / dir[0];
        const invDirY = 1.0 / dir[1];
        const invDirZ =