% rtcGetDeviceError(3) | Embree Ray Tracing Kernels 3

#### NAME

    rtcGetDeviceError - returns the error code of the device

#### SYNOPSIS

    #include <embree3/rtcore.h>

    RTCError rtcGetDeviceError(RTCDevice device);

#### DESCRIPTION

Each thread has its own error code per device. If an error occurs when
calling an API function, this error code is set to the occurred error
if it stores no previous error. The `rtcGetDeviceError` function reads
and returns the currently stored error and clears the error code. This
assures that the returned error code is always the first error occurred
since the last invocation of `rtcGetDeviceError`.

Possible error codes returned by `rtcGetDeviceError` are:

+ `RTC_ERROR_NONE`: No error occurred.

+ `RTC_ERROR_UNKNOWN`: An unknown error has occurred.

+ `RTC_ERROR_INVALID_ARGUMENT`: An invalid argument was specified.

+ `RTC_ERROR_INVALID_OPERATION`: The operation is not allowed for the
  specified object.

+ `RTC_ERROR_OUT_OF_MEMORY`: There is not enough memory left to complete
  the operation.

+ `RTC_ERROR_UNSUPPORTED_CPU`: The CPU is not supported as it does not
  support the lowest ISA Embree is compiled for.

+ `RTC_ERROR_CANCELLED`: The operation got canceled by a memory
  monitor callback or progress monitor callback function.

When the device construction fails, `rtcNewDevice` returns `NULL` as
device. To detect the error code of a such a failed device
construction, pass `NULL` as device to the `rtcGetDeviceError`
function. For all other invocations of `rtcGetDeviceError`, a proper
device pointer must be specified.

#### EXIT STATUS

Returns the error code for the device.

#### SEE ALSO

[rtcSetDeviceErrorFunction]

{'repo_name': 'embree/embree', 'stars': '1261', 'repo_language': 'C++', 'file_name': 'triangle_uv.fig', 'mime_type': 'text/plain', 'hash': -6889263431349896227, 'source_dataset': 'data'}


// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/network/test/test_network_quality_tracker.h"

namespace network {

TestNetworkQualityTracker::TestNetworkQualityTracker() = default;

TestNetworkQualityTracker::~TestNetworkQualityTracker() = default;

}  // namespace network

{'repo_name': 'nwjs/chromium.src', 'stars': '111', 'repo_language': 'None', 'file_name': 'AndroidManifest.xml', 'mime_type': 'text/xml', 'hash': -9220047326693901863, 'source_dataset': 'data'}


<resources>

    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <!-- BaseNavigationDrawer -->
    <dimen name="lvPrimaryTextSize">18sp</dimen>
    <dimen name="lvSecondaryTextSize">14sp</dimen>
    <dimen name="lvItemHeight">65dp</dimen>
    <dimen name="lvHeadingTextSize">14sp</dimen>
    <dimen name="lvPrimaryPaddingTop">6dp</dimen>
    <dimen name="lvPrimaryPaddingBottom">1dp</dimen>
    <dimen name="lvPrimaryPaddingLeft">8dp</dimen>
    <dimen name="lvSecondaryPaddingTop">2dp</dimen>
    <dimen name="lvSecondaryPaddingBottom">6dp</dimen>
    <dimen name="lvSecondaryPaddingLeft">8dp</dimen>
    <dimen name="lvDividerHeight">1dp</dimen>
    <dimen name="lvSectionDividerMarginTop">5dp</dimen>

</resources>

{'repo_name': 'mrwonderman/android-square-progressbar', 'stars': '1216', 'repo_language': 'Java', 'file_name': 'gradle-wrapper.properties', 'mime_type': 'text/plain', 'hash': -5934798580418810732, 'source_dataset': 'data'}


/* file: ResultId.java */
/*******************************************************************************
* Copyright 2014-2020 Intel Corporation
*
* 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.
*******************************************************************************/

/**
 * @ingroup association_rules
 * @{
 */
package com.intel.daal.algorithms.association_rules;

/**
 *
 * @brief Available identifiers of results for the association rules algorithm
 */
public final class ResultId {
    private int _value;

    /**
     * Constructs the result object identifier using the provided value
     * @param value     Value corresponding to the result object identifier
     */
    public ResultId(int value) {
        _value = value;
    }

    /**
     * Returns the value corresponding to the result object identifier
     * @return Value corresponding to the result object identifier
     */
    public int getValue() {
        return _value;
    }

    private static final int LargeItemsets        = 0;
    private static final int LargeItemsetsSupport = 1;
    private static final int AntecedentItemsets   = 2;
    private static final int ConsequentItemsets   = 3;
    private static final int Confidence           = 4;

    public static final ResultId largeItemsets        = new ResultId(LargeItemsets); /*!< Large itemsets            */
    public static final ResultId largeItemsetsSupport = new ResultId(
            LargeItemsetsSupport);                                                   /*!< Support of large itemsets */
    public static final ResultId antecedentItemsets   = new ResultId(
            AntecedentItemsets);                                                     /*!< Antecedent itemsets       */
    public static final ResultId consequentItemsets   = new ResultId(
            ConsequentItemsets);                                                     /*!< Consequent itemsets       */
    public static final ResultId confidence           = new ResultId(Confidence);    /*!< Confidence                */
}
/** @} */

{'repo_name': 'oneapi-src/oneDAL', 'stars': '337', 'repo_language': 'C++', 'file_name': 'data_collection.cpp', 'mime_type': 'text/x-c', 'hash': -7850617515452644328, 'source_dataset': 'data'}


commandlinefu_id: 7324
translator:
  weibo: ''
hide: true
command: |-
  find . -type f -size +20000k -print0 | xargs -0 du -h | awk -F"\t" '{printf "%s : %s\n", $2, $1}'
summary: |-
  Find Files over 20Meg

{'repo_name': 'tg123/commandlinefu.cn', 'stars': '271', 'repo_language': 'C#', 'file_name': 'mkfifo_tmp_fifo_cat_tmp_fifo_nc_l_p_1234_tee_a_to_log_nc_machine_port.yaml', 'mime_type': 'text/plain', 'hash': 7379131783785180409, 'source_dataset': 'data'}


#include "stdafx.h"
#include "xrEngine/TaskScheduler.hpp"
#include "Include/xrRender/DrawUtils.h"
#include "Render.h"
#include "IGame_Persistent.h"
#include "XR_IOConsole.h"
#include "xr_input.h"
#include "SDL.h"
#include "SDL_syswm.h"

void CRenderDevice::Destroy()
{
    if (!b_is_Ready)
        return;
    Log("Destroying Render...");
    b_is_Ready = false;
    Statistic->OnDeviceDestroy();
    GEnv.Render->OnDeviceDestroy(false);
    Memory.mem_compact();
    GEnv.Render->Destroy();
    TaskScheduler->Destroy();
    seqRender.Clear();
    seqAppActivate.Clear();
    seqAppDeactivate.Clear();
    seqAppStart.Clear();
    seqAppEnd.Clear();
    seqFrame.Clear();
    seqFrameMT.Clear();
    seqDeviceReset.Clear();
    seqParallel.clear();
    xr_delete(Statistic);

    SDL_DestroyWindow(m_sdlWnd);
}

void CRenderDevice::Reset(bool precache /*= true*/)
{
    ResetInternal(precache);
}

#include "IGame_Level.h"
#include "CustomHUD.h"
extern bool bNeed_re_create_env;

void CRenderDevice::ResetInternal(bool precache)
{
    const auto dwWidth_before = dwWidth;
    const auto dwHeight_before = dwHeight;
    pInput->GrabInput(false);

    const auto tm_start = TimerAsync();

    UpdateWindowProps(!psDeviceFlags.is(rsFullscreen));
    GEnv.Render->Reset(m_sdlWnd, dwWidth, dwHeight, fWidth_2, fHeight_2);

    // Update window props again for DX9 renderer
    const bool isDX9Renderer = GEnv.Render->get_dx_level() == 0x00090000;
    if (isDX9Renderer)
        UpdateWindowProps(!psDeviceFlags.is(rsFullscreen)); // hack

    if (g_pGamePersistent)
        g_pGamePersistent->Environment().bNeed_re_create_env = true;
    _SetupStates();

    if (precache)
        PreCache(20, true, false);

    const auto tm_end = TimerAsync();
    Msg("*** RESET [%d ms]", tm_end - tm_start);

    // TODO: Remove this! It may hide crash
    Memory.mem_compact();

    seqDeviceReset.Process();
    if (dwWidth_before != dwWidth || dwHeight_before != dwHeight)
        seqUIReset.Process();

    if (!GEnv.isDedicatedServer)
        pInput->GrabInput(true);
}

{'repo_name': 'OpenXRay/xray-16', 'stars': '1270', 'repo_language': 'C++', 'file_name': 'I_GridUser.pas', 'mime_type': 'text/plain', 'hash': 6708489482088664571, 'source_dataset': 'data'}


saa7146-objs    := saa7146_i2c.o saa7146_core.o
saa7146_vv-objs := saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o

obj-y += tuners/
obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o
obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o

{'repo_name': 'lvchaqiu/meizu-mx-kernel', 'stars': '178', 'repo_language': 'None', 'file_name': 'arrayRCU.txt', 'mime_type': 'text/plain', 'hash': 8885671684636787162, 'source_dataset': 'data'}


/*
    inifile.cpp
    Copyright (C) 2007 Acekard, www.acekard.com
    Copyright (C) 2007-2009 somebody
    Copyright (C) 2009 yellow wood goblin

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

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

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

#include <cstdio>
#include <cstdlib>
#include "inifile.h"

static bool freadLine(FILE* f,std::string& str)
{
  str.clear();
__read:
  char p=0;

  size_t readed=fread(&p,1,1,f);
  if(0==readed)
  {
    str="";
    return false;
  }
  if('\n'==p||'\r'==p)
  {
    str="";
    return true;
  }

  while(p!='\n'&&p!='\r'&&readed)
  {
    str+=p;
    readed=fread(&p,1,1,f);
  }

  if(str.empty()||""==str)
  {
    goto __read;
  }

  return true;
}

static void trimString(std::string& str)
{
  size_t first=str.find_first_not_of(" \t"),last;
  if(first==str.npos)
  {
    str="";
  }
  else
  {
    last=str.find_last_not_of(" \t");
    if(first>0||(last+1)<str.length()) str=str.substr(first,last-first+1);
  }
}

CIniFile::CIniFile()
{
  m_bLastResult=false;
  m_bModified=false;
  m_bReadOnly=false;
}

CIniFile::CIniFile(const std::string& filename)
{
  m_sFileName=filename;
  m_bLastResult=false;
  m_bModified=false;
  m_bReadOnly=false;
  LoadIniFile(m_sFileName);
}

CIniFile::~CIniFile()
{
  if(m_FileContainer.size()>0)
  {
    m_FileContainer.clear();
  }
}

void CIniFile::SetString(const std::string& Section,const std::string& Item,const std::string& Value)
{
  if(GetFileString(Section,Item)!=Value)
  {
    SetFileString(Section,Item,Value);
    m_bModified=true;
  }
}

void CIniFile::SetInt(const std::string& Section,const std::string& Item,int Value)
{
  char buf[16];
  snprintf(buf, sizeof(buf), "%d", Value);
  std::string strtemp(buf);

  if(GetFileString(Section,Item)!=strtemp)
  {
    SetFileString(Section,Item,strtemp);
    m_bModified=true;
  }
}

std::string CIniFile::GetString(const std::string& Section,const std::string& Item)
{
  return GetFileString(Section,Item);
}

std::string CIniFile::GetString(const std::string& Section,const std::string& Item,const std::string& DefaultValue)
{
  std::string temp=GetString(Section,Item);
  if(!m_bLastResult)
  {
    SetString(Section,Item,DefaultValue);
    temp=DefaultValue;
  }
  return temp;
}

void CIniFile::GetStringVector(const std::string& Section,const std::string& Item,std::vector< std::string >& strings,char delimiter)
{
  std::string strValue=GetFileString(Section,Item);
  strings.clear();
  size_t pos;
  while((pos=strValue.find(delimiter),strValue.npos!=pos))
  {
    const std::string string=strValue.substr(0,pos);
    if(string.length())
    {
      strings.push_back(string);
    }
    strValue=strValue.substr(pos+1,strValue.npos);
  }
  if(strValue.length())
  {
    strings.push_back(strValue);
  }
}

void CIniFile::SetStringVector(const std::string& Section,const std::string& Item,std::vector<std::string>& strings,char delimiter)
{
  std::string strValue;
  for(size_t ii=0;ii<strings.size();++ii)
  {
    if(ii) strValue+=delimiter;
    strValue+=strings[ii];
  }
  SetString(Section,Item,strValue);
}

int CIniFile::GetInt(const std::string& Section,const std::string& Item)
{
  std::string value=GetFileString(Section,Item);
  if(value.size()>2&&'0'==value[0]&&('x'==value[1]||'X'==value[1]))
    return strtol(value.c_str(),NULL,16);
  else
    return strtol(value.c_str(),NULL,10);
}

int CIniFile::GetInt(const std::string& Section,const std::string& Item,int DefaultValue)
{
  int temp;
  temp=GetInt(Section,Item);
  if(!m_bLastResult)
  {
    SetInt(Section,Item,DefaultValue);
    temp=DefaultValue;
  }
  return temp;
}

bool CIniFile::LoadIniFile(const std::string& FileName)
{
  //dbg_printf("load %s\n",FileName.c_str());
  if(FileName!="") m_sFileName=FileName;

  FILE* f=fopen(FileName.c_str(),"rb");

  if(NULL==f) return false;

  //check for utf8 bom.
  char bom[3];
  if(fread(bom,3,1,f)==1&&bom[0]==0xef&&bom[1]==0xbb&&bom[2]==0xbf) ;
  else fseek(f,0,SEEK_SET);

  std::string strline("");
  m_FileContainer.clear();

  while(freadLine(f,strline))
  {
    trimString(strline);
    if(strline!=""&&';'!=strline[0]&&'/'!=strline[0]&&'!'!=strline[0]) m_FileContainer.push_back(strline);
  }

  fclose(f);

  m_bLastResult=false;
  m_bModified=false;

  return true;
}

bool CIniFile::SaveIniFileModified(const std::string& FileName)
{
  if(m_bModified==true)
  {
    return SaveIniFile(FileName);
  }

  return true;
}

bool CIniFile::SaveIniFile(const std::string& FileName)
{
  if(FileName!="")
    m_sFileName=FileName;

  FILE* f=fopen(m_sFileName.c_str(),"wb");
  if(NULL==f)
  {
    return false;
  }

  for(size_t ii=0;ii<m_FileContainer.size();ii++)
  {
    std::string& strline=m_FileContainer[ii];
    size_t notSpace=strline.find_first_not_of(' ');
    strline=strline.substr(notSpace);
    if(strline.find('[')==0&&ii>0)
    {
      if(!m_FileContainer[ii-1].empty()&&m_FileContainer[ii-1]!="")
        fwrite("\r\n",1,2,f);
    }
    if(!strline.empty()&&strline!="")
    {
      fwrite(strline.c_str(),1,strline.length(),f);
      fwrite("\r\n",1,2,f);
    }
  }

  fclose(f);

  m_bModified=false;

  return true;
}

std::string CIniFile::GetFileString(const std::string& Section,const std::string& Item)
{
  std::string strline;
  std::string strSection;
  std::string strItem;
  std::string strValue;

  size_t ii=0;
  size_t iFileLines=m_FileContainer.size();

  if(m_bReadOnly)
  {
    cSectionCache::iterator it=m_Cache.find(Section);
    if((it!=m_Cache.end())) ii=it->second;
  }

  m_bLastResult=false;

  if(iFileLines>=0)
  {
    while(ii<iFileLines)
    {
      strline=m_FileContainer[ii++];

      size_t rBracketPos=0;
      if('['==strline[0]) rBracketPos=strline.find(']');
      if(rBracketPos>0&&rBracketPos!=std::string::npos)
      {
        strSection=strline.substr(1,rBracketPos-1);
        if(m_bReadOnly) m_Cache.insert(std::make_pair(strSection,ii-1));
        if(strSection==Section)
        {
          while(ii<iFileLines)
          {
            strline=m_FileContainer[ii++];
            size_t equalsignPos=strline.find('=');
            if(equalsignPos!=strline.npos)
            {
              size_t last=equalsignPos?strline.find_last_not_of(" \t",equalsignPos-1):strline.npos;
              if(last==strline.npos) strItem="";
              else strItem=strline.substr(0,last+1);

              if(strItem==Item)
              {
                size_t first=strline.find_first_not_of(" \t",equalsignPos+1);
                if(first==strline.npos) strValue="";
                else strValue=strline.substr(first);
                m_bLastResult=true;
                return strValue;
              }
            }
            else if('['==strline[0])
            {
              break;
            }
          }
          break;
        }
      }
    }
  }
  return std::string("");
}

void CIniFile::SetFileString(const std::string& Section,const std::string& Item,const std::string& Value)
{
  std::string strline;
  std::string strSection;
  std::string strItem;

  if(m_bReadOnly) return;

  size_t ii=0;
  size_t iFileLines=m_FileContainer.size();

  while(ii<iFileLines)
  {
    strline=m_FileContainer[ii++];

    size_t rBracketPos=0;
    if('['==strline[0]) rBracketPos=strline.find(']');
    if(rBracketPos>0&&rBracketPos!=std::string::npos)
    {
      strSection=strline.substr(1,rBracketPos-1);
      if(strSection==Section)
      {
        while(ii<iFileLines)
        {
          strline=m_FileContainer[ii++];
          size_t equalsignPos=strline.find('=');
          if(equalsignPos!=strline.npos)
          {
              size_t last=equalsignPos?strline.find_last_not_of(" \t",equalsignPos-1):strline.npos;
              if(last==strline.npos) strItem="";
              else strItem=strline.substr(0,last+1);

              if(Item==strItem)
              {
                ReplaceLine(ii-1,Item+" = "+Value);
                return;
              }
          }
          else if('['==strline[0])
          {
            InsertLine(ii-1,Item+" = "+Value);
            return;
          }
        }
        InsertLine(ii,Item+" = "+Value);
        return;
      }
    }
  }

  InsertLine(ii,"["+Section+"]");
  InsertLine(ii+1,Item+" = "+Value);
  return;
}

bool CIniFile::InsertLine(size_t line,const std::string& str)
{
  m_FileContainer.insert(m_FileContainer.begin()+line,str);
  return true;
}

bool CIniFile::ReplaceLine(size_t line,const std::string& str)
{
  m_FileContainer[line]=str;
  return true;
}

{'repo_name': 'RocketRobz/TWLoader', 'stars': '311', 'repo_language': 'C++', 'file_name': 'fifocheck.c', 'mime_type': 'text/x-c', 'hash': -8318506327104869306, 'source_dataset': 'data'}


/*
 * Copyright 2008-2009 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.hasor.dataway.dal.providers.db;
import net.hasor.core.AppContext;
import net.hasor.core.Init;
import net.hasor.core.Inject;
import net.hasor.core.Singleton;
import net.hasor.dataway.config.DatawayUtils;
import net.hasor.dataway.dal.ApiDataAccessLayer;
import net.hasor.dataway.dal.EntityDef;
import net.hasor.dataway.dal.FieldDef;
import net.hasor.dataway.dal.QueryCondition;
import net.hasor.db.jdbc.ConnectionCallback;
import net.hasor.db.jdbc.core.JdbcTemplate;
import net.hasor.utils.ExceptionUtils;
import net.hasor.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * 数据库存储层访问 ApiDataAccessLayer 接口实现。
 *   -- 利用数据库事务来实现集群情况下的数据一致性。
 * @author 赵永春 (zyc@hasor.net)
 * @version : 2020-09-11
 */
@Singleton
public class DataBaseApiDataAccessLayer implements ApiDataAccessLayer {
    protected static Logger              logger = LoggerFactory.getLogger(DataBaseApiDataAccessLayer.class);
    @Inject
    private          InterfaceInfoDal    infoDal;
    @Inject
    private          InterfaceReleaseDal releaseDal;
    @Inject
    private          AppContext          appContext;

    @Init
    public void init() throws SQLException {
        JdbcTemplate jdbcTemplate = this.appContext.getInstance(JdbcTemplate.class);
        if (jdbcTemplate == null) {
            throw new IllegalStateException("jdbcTemplate is not init.");
        }
        //
        String dbType = null;//this.appContext.getEnvironment().getVariable("HASOR_DATAQL_DATAWAY_FORCE_DBTYPE");
        if (StringUtils.isBlank(dbType)) {
            dbType = jdbcTemplate.execute((ConnectionCallback<String>) con -> {
                String jdbcUrl = con.getMetaData().getURL();
                String jdbcDriverName = con.getMetaData().getDriverName();
                return JdbcUtils.getDbType(jdbcUrl, jdbcDriverName);
            });
        }
        if (dbType == null) {
            throw new IllegalStateException("unknown dbType.");
        }
        //
        this.infoDal.dbType = dbType;
        this.releaseDal.dbType = dbType;
        logger.info("dataway dbType is {}", dbType);
    }

    @Override
    public Map<FieldDef, String> getObjectBy(EntityDef objectType, FieldDef indexKey, String indexValue) {
        try {
            if (EntityDef.INFO == objectType) {
                return this.infoDal.getObjectBy(indexKey, indexValue);
            } else {
                return this.releaseDal.getObjectBy(indexKey, indexValue);
            }
        } catch (SQLException e) {
            throw ExceptionUtils.toRuntimeException(e);
        }
    }

    @Override
    public List<Map<FieldDef, String>> listObjectBy(EntityDef objectType, Map<QueryCondition, Object> conditions) {
        try {
            if (EntityDef.INFO == objectType) {
                return this.infoDal.listObjectBy(conditions);
            } else {
                return this.releaseDal.listObjectBy(conditions);
            }
        } catch (SQLException e) {
            throw ExceptionUtils.toRuntimeException(e);
        }
    }

    @Override
    public String generateId(EntityDef objectType, String apiPath) {
        String newId = DatawayUtils.generateID();
        return ((EntityDef.INFO == objectType) ? "i_" : "r_") + newId;
    }

    @Override
    public boolean deleteObject(EntityDef objectType, String id) {
        try {
            if (EntityDef.INFO == objectType) {
                return this.infoDal.deleteObject(id);
            } else {
                return this.releaseDal.deleteObject(id);
            }
        } catch (SQLException e) {
            throw ExceptionUtils.toRuntimeException(e);
        }
    }

    @Override
    public boolean updateObject(EntityDef objectType, String id, Map<FieldDef, String> newData) {
        try {
            if (EntityDef.INFO == objectType) {
                return this.infoDal.updateObject(id, newData);
            } else {
                return this.releaseDal.updateObject(id, newData);
            }
        } catch (SQLException e) {
            throw ExceptionUtils.toRuntimeException(e);
        }
    }

    @Override
    public boolean createObject(EntityDef objectType, Map<FieldDef, String> newData) {
        try {
            if (EntityDef.INFO == objectType) {
                return this.infoDal.createObject(newData);
            } else {
                return this.releaseDal.createObject(newData);
            }
        } catch (SQLException e) {
            throw ExceptionUtils.toRuntimeException(e);
        }
    }
}

{'repo_name': 'zycgit/hasor', 'stars': '563', 'repo_language': 'Java', 'file_name': 'TokenTest.java', 'mime_type': 'text/x-java', 'hash': -7597424399195453105, 'source_dataset': 'data'}


<!---
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF 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.
-->

# org.apache.cordova.camera

This plugin provides an API for taking pictures and for choosing images from
the system's image library.

    cordova plugin add org.apache.cordova.camera

## navigator.camera.getPicture

Takes a photo using the camera, or retrieves a photo from the device's
image gallery.  The image is passed to the success callback as a
base64-encoded `String`, or as the URI for the image file.  The method
itself returns a `CameraPopoverHandle` object that can be used to
reposition the file selection popover.

    navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );

### Description

The `camera.getPicture` function opens the device's default camera
application that allows users to snap pictures. This behavior occurs
by default, when `Camera.sourceType` equals
`Camera.PictureSourceType.CAMERA`.  Once the user snaps the photo, the
camera application closes and the application is restored.

If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
`Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
that allows users to select an existing image.  The
`camera.getPicture` function returns a `CameraPopoverHandle` object,
which can be used to reposition the image selection dialog, for
example, when the device orientation changes.

The return value is sent to the `cameraSuccess` callback function, in
one of the following formats, depending on the specified
`cameraOptions`:

- A `String` containing the base64-encoded photo image.

- A `String` representing the image file location on local storage (default).

You can do whatever you want with the encoded image or URI, for
example:

- Render the image in an `<img>` tag, as in the example below

- Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)

- Post the data to a remote server

__NOTE__: Photo resolution on newer devices is quite good. Photos
selected from the device's gallery are not downscaled to a lower
quality, even if a `quality` parameter is specified.  To avoid common
memory problems, set `Camera.destinationType` to `FILE_URI` rather
than `DATA_URL`.

### Supported Platforms

- Amazon Fire OS
- Android
- BlackBerry 10
- Firefox OS
- iOS
- Tizen
- Windows Phone 7 and 8
- Windows 8

### Amazon Fire OS Quirks

Amazon Fire OS uses intents to launch the camera activity on the device to capture
images, and on phones with low memory, the Cordova activity may be killed.  In this
scenario, the image may not appear when the cordova activity is restored.

### Android Quirks

Android uses intents to launch the camera activity on the device to capture
images, and on phones with low memory, the Cordova activity may be killed.  In this
scenario, the image may not appear when the Cordova activity is restored.

### Firefox OS Quirks

Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/).

### iOS Quirks

Including a JavaScript `alert()` in either of the callback functions
can cause problems.  Wrap the alert within a `setTimeout()` to allow
the iOS image picker or popover to fully close before the alert
displays:

    setTimeout(function() {
        // do your thing here!
    }, 0);

### Windows Phone 7 Quirks

Invoking the native camera application while the device is connected
via Zune does not work, and triggers an error callback.

### Tizen Quirks

Tizen only supports a `destinationType` of
`Camera.DestinationType.FILE_URI` and a `sourceType` of
`Camera.PictureSourceType.PHOTOLIBRARY`.

### Example

Take a photo and retrieve it as a base64-encoded image:

    navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
        destinationType: Camera.DestinationType.DATA_URL
    });

    function onSuccess(imageData) {
        var image = document.getElementById('myImage');
        image.src = "data:image/jpeg;base64," + imageData;
    }

    function onFail(message) {
        alert('Failed because: ' + message);
    }

Take a photo and retrieve the image's file location:

    navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
        destinationType: Camera.DestinationType.FILE_URI });

    function onSuccess(imageURI) {
        var image = document.getElementById('myImage');
        image.src = imageURI;
    }

    function onFail(message) {
        alert('Failed because: ' + message);
    }

## CameraOptions

Optional parameters to customize the camera settings.

    { quality : 75,
      destinationType : Camera.DestinationType.DATA_URL,
      sourceType : Camera.PictureSourceType.CAMERA,
      allowEdit : true,
      encodingType: Camera.EncodingType.JPEG,
      targetWidth: 100,
      targetHeight: 100,
      popoverOptions: CameraPopoverOptions,
      saveToPhotoAlbum: false };

### Options

- __quality__: Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. The default is 50. _(Number)_ (Note that information about the camera's resolution is unavailable.)

- __destinationType__: Choose the format of the return value. The default is FILE_URI. Defined in `navigator.camera.DestinationType` _(Number)_

        Camera.DestinationType = {
            DATA_URL : 0,      // Return image as base64-encoded string
            FILE_URI : 1,      // Return image file URI
            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
        };

- __sourceType__: Set the source of the picture. The default is CAMERA. Defined in `navigator.camera.PictureSourceType` _(Number)_

        Camera.PictureSourceType = {
            PHOTOLIBRARY : 0,
            CAMERA : 1,
            SAVEDPHOTOALBUM : 2
        };

- __allowEdit__: Allow simple editing of image before selection. _(Boolean)_

- __encodingType__: Choose the  returned image file's encoding. Default is JPEG. Defined in `navigator.camera.EncodingType` _(Number)_

        Camera.EncodingType = {
            JPEG : 0,               // Return JPEG encoded image
            PNG : 1                 // Return PNG encoded image
        };

- __targetWidth__: Width in pixels to scale image. Must be used with __targetHeight__.  Aspect ratio remains constant. _(Number)_

- __targetHeight__: Height in pixels to scale image. Must be used with __targetWidth__. Aspect ratio remains constant. _(Number)_

- __mediaType__: Set the type of media to select from.  Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`. Defined in `nagivator.camera.MediaType` _(Number)_

        Camera.MediaType = {
            PICTURE: 0,    // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
            VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
            ALLMEDIA : 2   // allow selection from all media types
        };

- __correctOrientation__: Rotate the image to correct for the orientation of the device during capture. _(Boolean)_

- __saveToPhotoAlbum__: Save the image to the photo album on the device after capture. _(Boolean)_

- __popoverOptions__: iOS-only options that specify popover location in iPad.  Defined in `CameraPopoverOptions`.

- __cameraDirection__: Choose the camera to use (front- or back-facing). The default is BACK. Defined in `navigator.camera.Direction` _(Number)_

        Camera.Direction = {
            BACK : 0,      // Use the back-facing camera
            FRONT : 1      // Use the front-facing camera
        };

### Amazon Fire OSQuirks

- Any `cameraDirection` value results in a back-facing photo.

- Ignores the `allowEdit` parameter.

- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.

### Android Quirks

- Any `cameraDirection` value results in a back-facing photo.

- Ignores the `allowEdit` parameter.

- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.

### BlackBerry 10 Quirks

- Ignores the `quality` parameter.

- Ignores the `allowEdit` parameter.

- `Camera.MediaType` is not supported.

- Ignores the `correctOrientation` parameter.

- Ignores the `cameraDirection` parameter.

### Firefox OS Quirks

- Ignores the `quality` parameter.

- `Camera.DestinationType` is ignored and equals `1` (image file URI)

- Ignores the `allowEdit` parameter.

- Ignores the `PictureSourceType` parameter (user chooses it in a dialog window)

- Ignores the `encodingType`

- Ignores the `targetWidth` and `targetHeight`

- `Camera.MediaType` is not supported.

- Ignores the `correctOrientation` parameter.

- Ignores the `cameraDirection` parameter.

### iOS Quirks

- Set `quality` below 50 to avoid memory errors on some devices.

- When using `destinationType.FILE_URI`, photos are saved in the application's temporary directory. The contents of the application's temporary directory is deleted when the application ends.

### Tizen Quirks

- options not supported

- always returns a FILE URI

### Windows Phone 7 and 8 Quirks

- Ignores the `allowEdit` parameter.

- Ignores the `correctOrientation` parameter.

- Ignores the `cameraDirection` parameter.

- Ignores the `saveToPhotoAlbum` parameter.  IMPORTANT: All images taken with the wp7/8 cordova camera API are always copied to the phone's camera roll.  Depending on the user's settings, this could also mean the image is auto-uploaded to their OneDrive.  This could potentially mean the image is available to a wider audience than your app intended.  If this a blocker for your application, you will need to implement the CameraCaptureTask as documented on msdn : [http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx](http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx)
You may also comment or up-vote the related issue in the [issue tracker](https://issues.apache.org/jira/browse/CB-2083)

- Ignores the `mediaType` property of `cameraOptions` as the Windows Phone SDK does not provide a way to choose videos from PHOTOLIBRARY.

## CameraError

onError callback function that provides an error message.

    function(message) {
        // Show a helpful message
    }

### Parameters

- __message__: The message is provided by the device's native code. _(String)_

## cameraSuccess

onSuccess callback function that provides the image data.

    function(imageData) {
        // Do something with the image
    }

### Parameters

- __imageData__: Base64 encoding of the image data, _or_ the image file URI, depending on `cameraOptions` in effect. _(String)_

### Example

    // Show image
    //
    function cameraCallback(imageData) {
        var image = document.getElementById('myImage');
        image.src = "data:image/jpeg;base64," + imageData;
    }

## CameraPopoverHandle

A handle to the popover dialog created by `navigator.camera.getPicture`.

### Methods

- __setPosition__: Set the position of the popover.

### Supported Platforms

- iOS

### setPosition

Set the position of the popover.

__Parameters__:

- `cameraPopoverOptions`: the `CameraPopoverOptions` that specify the new position

### Example

     var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
         { destinationType: Camera.DestinationType.FILE_URI,
           sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
           popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
         });

     // Reposition the popover if the orientation changes.
     window.onorientationchange = function() {
         var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
         cameraPopoverHandle.setPosition(cameraPopoverOptions);
     }

## CameraPopoverOptions

iOS-only parameters that specify the anchor element location and arrow
direction of the popover when selecting images from an iPad's library
or album.

    { x : 0,
      y :  32,
      width : 320,
      height : 480,
      arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
    };

### CameraPopoverOptions

- __x__: x pixel coordinate of screen element onto which to anchor the popover. _(Number)_

- __y__: y pixel coordinate of screen element onto which to anchor the popover. _(Number)_

- __width__: width, in pixels, of the screen element onto which to anchor the popover. _(Number)_

- __height__: height, in pixels, of the screen element onto which to anchor the popover. _(Number)_

- __arrowDir__: Direction the arrow on the popover should point.  Defined in `Camera.PopoverArrowDirection` _(Number)_

            Camera.PopoverArrowDirection = {
                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
                ARROW_DOWN : 2,
                ARROW_LEFT : 4,
                ARROW_RIGHT : 8,
                ARROW_ANY : 15
            };

Note that the size of the popover may change to adjust to the
direction of the arrow and orientation of the screen.  Make sure to
account for orientation changes when specifying the anchor element
location.

## navigator.camera.cleanup

Removes intermediate photos taken by the camera from temporary
storage.

    navigator.camera.cleanup( cameraSuccess, cameraError );

### Description

Removes intermediate image files that are kept in temporary storage
after calling `camera.getPicture`. Applies only when the value of
`Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
`Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.

### Supported Platforms

- iOS

### Example

    navigator.camera.cleanup(onSuccess, onFail);

    function onSuccess() {
        console.log("Camera cleanup success.")
    }

    function onFail(message) {
        alert('Failed because: ' + message);
    }

{'repo_name': 'malikov/Authenticate.me-client-cordova-ionic', 'stars': '167', 'repo_language': 'JavaScript', 'file_name': 'index.md', 'mime_type': 'text/plain', 'hash': 2496473990314319013, 'source_dataset': 'data'}


/*
 * Password Management Servlets (PWM)
 * http://www.pwm-project.org
 *
 * Copyright (c) 2006-2009 Novell, Inc.
 * Copyright (c) 2009-2020 The PWM Project
 *
 * 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 password.pwm.util.cli;

import password.pwm.PwmEnvironment;
import password.pwm.util.logging.PwmLogLevel;

import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class MainOptions implements Serializable
{
    private static final String OPT_DEBUG_LEVEL = "-debugLevel";
    private static final String OPT_APP_PATH = "-applicationPath";
    private static final String OPT_APP_FLAGS = "-applicationFlags";
    private static final String OPT_FORCE = "-force";

    private PwmLogLevel pwmLogLevel;
    private File applicationPath;
    private boolean forceFlag;
    private Collection<PwmEnvironment.ApplicationFlag> applicationFlags;
    private List<String> remainingArguments;

    MainOptions(
            final PwmLogLevel pwmLogLevel,
            final File applicationPath,
            final boolean forceFlag,
            final Collection<PwmEnvironment.ApplicationFlag> applicationFlags,
            final List<String> remainingArguments

    )
    {
        this.pwmLogLevel = pwmLogLevel;
        this.applicationPath = applicationPath;
        this.forceFlag = forceFlag;
        this.applicationFlags = applicationFlags;
        this.remainingArguments = remainingArguments;

    }

    public PwmLogLevel getPwmLogLevel( )
    {
        return pwmLogLevel;
    }

    public File getApplicationPath( )
    {
        return applicationPath;
    }

    public boolean isForceFlag( )
    {
        return forceFlag;
    }

    public Collection<PwmEnvironment.ApplicationFlag> getApplicationFlags( )
    {
        return applicationFlags;
    }

    public List<String> getRemainingArguments( )
    {
        return remainingArguments;
    }

    public static MainOptions parseMainCommandLineOptions(
            final String[] args,
            final Writer debugWriter
    )
    {

        PwmLogLevel pwmLogLevel = null;
        File applicationPath = null;
        boolean forceFlag = false;
        Collection<PwmEnvironment.ApplicationFlag> applicationFlags = Collections.emptyList();
        final List<String> remainingArguments;

        final List<String> outputArgs = new ArrayList<>();
        if ( args != null )
        {
            for ( final String arg : args )
            {
                if ( arg != null )
                {
                    if ( arg.startsWith( OPT_DEBUG_LEVEL ) )
                    {
                        if ( arg.length() < OPT_DEBUG_LEVEL.length() + 2 )
                        {
                            out( debugWriter, OPT_DEBUG_LEVEL + " option must include level (example: " + OPT_DEBUG_LEVEL + "=TRACE)" );
                            System.exit( -1 );
                        }
                        else
                        {
                            final String levelStr = arg.substring( OPT_DEBUG_LEVEL.length() + 1, arg.length() );
                            try
                            {
                                pwmLogLevel = PwmLogLevel.valueOf( levelStr.toUpperCase() );
                            }
                            catch ( final IllegalArgumentException e )
                            {
                                out( debugWriter, " unknown log level value: " + levelStr );
                                System.exit( -1 );
                            }
                        }
                    }
                    else if ( arg.startsWith( OPT_APP_PATH ) )
                    {
                        if ( arg.length() < OPT_APP_PATH.length() + 2 )
                        {
                            out( debugWriter, OPT_APP_PATH + " option must include value (example: " + OPT_APP_PATH + "=/tmp/applicationPath)" );
                            System.exit( -1 );
                        }
                        else
                        {
                            final String pathStr = arg.substring( OPT_APP_PATH.length() + 1, arg.length() );
                            applicationPath = new File( pathStr );
                        }
                    }
                    else if ( arg.equals( OPT_FORCE ) )
                    {
                        forceFlag = true;
                    }
                    else if ( arg.startsWith( OPT_APP_FLAGS ) )
                    {
                        if ( arg.length() < OPT_APP_FLAGS.length() + 2 )
                        {
                            out( debugWriter, OPT_APP_FLAGS + " option must include value (example: " + OPT_APP_FLAGS + "=Flag1,Flag2)" );
                            System.exit( -1 );
                        }
                        else
                        {
                            final String flagStr = arg.substring( OPT_APP_PATH.length() + 1, arg.length() );
                            applicationFlags = PwmEnvironment.ParseHelper.parseApplicationFlagValueParameter( flagStr );
                        }
                        outputArgs.add( arg );
                    }
                    else
                    {
                        outputArgs.add( arg );
                    }
                }
            }
        }

        remainingArguments = new ArrayList<>( outputArgs );
        return new MainOptions( pwmLogLevel, applicationPath, forceFlag, applicationFlags, remainingArguments );
    }

    static void out( final Writer debugWriter, final CharSequence out )
    {
        if ( debugWriter != null )
        {
            try
            {
                debugWriter.append( out );
                debugWriter.append( "\n" );
                debugWriter.flush();
            }
            catch ( final IOException e )
            {
                e.printStackTrace();
            }
        }
    }
}

{'repo_name': 'pwm-project/pwm', 'stars': '584', 'repo_language': 'Java', 'file_name': 'WordlistServiceTest.java', 'mime_type': 'text/x-java', 'hash': -96160139712331250, 'source_dataset': 'data'}


import URL from 'url';
import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms';
import { Release } from '../../../datasource';
import { logger } from '../../../logger';
import * as memCache from '../../../util/cache/memory';
import * as packageCache from '../../../util/cache/package';
import * as hostRules from '../../../util/host-rules';
import * as allVersioning from '../../../versioning';
import { BranchUpgradeConfig } from '../../common';
import { ChangeLogError, ChangeLogRelease, ChangeLogResult } from './common';
import { getTags } from './github';
import { addReleaseNotes } from './release-notes';

function getCachedTags(
  endpoint: string,
  repository: string
): Promise<string[]> {
  const cacheKey = `getTags-${endpoint}-${repository}`;
  const cachedResult = memCache.get(cacheKey);
  // istanbul ignore if
  if (cachedResult !== undefined) {
    return cachedResult;
  }
  const promisedRes = getTags(endpoint, repository);
  memCache.set(cacheKey, promisedRes);
  return promisedRes;
}

export async function getChangeLogJSON({
  versioning,
  fromVersion,
  toVersion,
  sourceUrl,
  releases,
  depName,
  manager,
}: BranchUpgradeConfig): Promise<ChangeLogResult | null> {
  if (sourceUrl === 'https://github.com/DefinitelyTyped/DefinitelyTyped') {
    logger.trace('No release notes for @types');
    return null;
  }
  const version = allVersioning.get(versioning);
  const { protocol, host, pathname } = URL.parse(sourceUrl);
  const baseUrl = `${protocol}//${host}/`;
  const url = sourceUrl.startsWith('https://github.com/')
    ? 'https://api.github.com/'
    : sourceUrl;
  const config = hostRules.find({
    hostType: PLATFORM_TYPE_GITHUB,
    url,
  });
  // istanbul ignore if
  if (!config.token) {
    if (host.endsWith('github.com')) {
      logger.warn(
        { manager, depName, sourceUrl },
        'No github.com token has been configured. Skipping release notes retrieval'
      );
      return { error: ChangeLogError.MissingGithubToken };
    }
    logger.debug(
      { manager, depName, sourceUrl },
      'Repository URL does not match any known github hosts - skipping changelog retrieval'
    );
    return null;
  }
  const apiBaseUrl = sourceUrl.startsWith('https://github.com/')
    ? 'https://api.github.com/'
    : baseUrl + 'api/v3/';
  const repository = pathname.slice(1).replace(/\/$/, '');
  if (repository.split('/').length !== 2) {
    logger.debug({ sourceUrl }, 'Invalid github URL found');
    return null;
  }
  if (!releases?.length) {
    logger.debug('No releases');
    return null;
  }
  // This extra filter/sort should not be necessary, but better safe than sorry
  const validReleases = [...releases]
    .filter((release) => version.isVersion(release.version))
    .sort((a, b) => version.sortVersions(a.version, b.version));

  if (validReleases.length < 2) {
    logger.debug('Not enough valid releases');
    return null;
  }

  let tags: string[];

  async function getRef(release: Release): Promise<string | null> {
    if (!tags) {
      tags = await getCachedTags(apiBaseUrl, repository);
    }
    const regex = new RegExp(`(?:${depName}|release)[@-]`);
    const tagName = tags
      .filter((tag) => version.isVersion(tag.replace(regex, '')))
      .find((tag) => version.equals(tag.replace(regex, ''), release.version));
    if (tagName) {
      return tagName;
    }
    if (release.gitRef) {
      return release.gitRef;
    }
    return null;
  }

  const cacheNamespace = 'changelog-github-release';
  function getCacheKey(prev: string, next: string): string {
    return `${manager}:${depName}:${prev}:${next}`;
  }

  const changelogReleases: ChangeLogRelease[] = [];
  // compare versions
  const include = (v: string): boolean =>
    version.isGreaterThan(v, fromVersion) &&
    !version.isGreaterThan(v, toVersion);
  for (let i = 1; i < validReleases.length; i += 1) {
    const prev = validReleases[i - 1];
    const next = validReleases[i];
    if (include(next.version)) {
      let release = await packageCache.get(
        cacheNamespace,
        getCacheKey(prev.version, next.version)
      );
      // istanbul ignore else
      if (!release) {
        release = {
          version: next.version,
          date: next.releaseTimestamp,
          // put empty changes so that existing templates won't break
          changes: [],
          compare: {},
        };
        const prevHead = await getRef(prev);
        const nextHead = await getRef(next);
        if (prevHead && nextHead) {
          release.compare.url = `${baseUrl}${repository}/compare/${prevHead}...${nextHead}`;
        }
        const cacheMinutes = 55;
        await packageCache.set(
          cacheNamespace,
          getCacheKey(prev.version, next.version),
          release,
          cacheMinutes
        );
      }
      changelogReleases.unshift(release);
    }
  }

  let res: ChangeLogResult = {
    project: {
      apiBaseUrl,
      baseUrl,
      github: repository,
      repository: sourceUrl,
      depName,
    },
    versions: changelogReleases,
  };

  res = await addReleaseNotes(res);

  return res;
}

{'repo_name': 'renovatebot/renovate', 'stars': '3188', 'repo_language': 'TypeScript', 'file_name': 'extract.py', 'mime_type': 'text/x-python', 'hash': 982870467966116287, 'source_dataset': 'data'}


/* SPDX-License-Identifier: GPL-2.0 */
#if !defined(_ATH6KL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)

#include <net/cfg80211.h>
#include <linux/skbuff.h>
#include <linux/tracepoint.h>
#include "wmi.h"
#include "hif.h"

#if !defined(_ATH6KL_TRACE_H)
static inline unsigned int ath6kl_get_wmi_id(void *buf, size_t buf_len)
{
	struct wmi_cmd_hdr *hdr = buf;

	if (buf_len < sizeof(*hdr))
		return 0;

	return le16_to_cpu(hdr->cmd_id);
}
#endif /* __ATH6KL_TRACE_H */

#define _ATH6KL_TRACE_H

/* create empty functions when tracing is disabled */
#if !defined(CONFIG_ATH6KL_TRACING)
#undef TRACE_EVENT
#define TRACE_EVENT(name, proto, ...) \
static inline void trace_ ## name(proto) {}
#undef DECLARE_EVENT_CLASS
#define DECLARE_EVENT_CLASS(...)
#undef DEFINE_EVENT
#define DEFINE_EVENT(evt_class, name, proto, ...) \
static inline void trace_ ## name(proto) {}
#endif /* !CONFIG_ATH6KL_TRACING || __CHECKER__ */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM ath6kl

TRACE_EVENT(ath6kl_wmi_cmd,
	TP_PROTO(void *buf, size_t buf_len),

	TP_ARGS(buf, buf_len),

	TP_STRUCT__entry(
		__field(unsigned int, id)
		__field(size_t, buf_len)
		__dynamic_array(u8, buf, buf_len)
	),

	TP_fast_assign(
		__entry->id = ath6kl_get_wmi_id(buf, buf_len);
		__entry->buf_len = buf_len;
		memcpy(__get_dynamic_array(buf), buf, buf_len);
	),

	TP_printk(
		"id %d len %zd",
		__entry->id, __entry->buf_len
	)
);

TRACE_EVENT(ath6kl_wmi_event,
	TP_PROTO(void *buf, size_t buf_len),

	TP_ARGS(buf, buf_len),

	TP_STRUCT__entry(
		__field(unsigned int, id)
		__field(size_t, buf_len)
		__dynamic_array(u8, buf, buf_len)
	),

	TP_fast_assign(
		__entry->id = ath6kl_get_wmi_id(buf, buf_len);
		__entry->buf_len = buf_len;
		memcpy(__get_dynamic_array(buf), buf, buf_len);
	),

	TP_printk(
		"id %d len %zd",
		__entry->id, __entry->buf_len
	)
);

TRACE_EVENT(ath6kl_sdio,
	TP_PROTO(unsigned int addr, int flags,
		 void *buf, size_t buf_len),

	TP_ARGS(addr, flags, buf, buf_len),

	TP_STRUCT__entry(
		__field(unsigned int, tx)
		__field(unsigned int, addr)
		__field(int, flags)
		__field(size_t, buf_len)
		__dynamic_array(u8, buf, buf_len)
	),

	TP_fast_assign(
		__entry->addr = addr;
		__entry->flags = flags;
		__entry->buf_len = buf_len;
		memcpy(__get_dynamic_array(buf), buf, buf_len);

		if (flags & HIF_WRITE)
			__entry->tx = 1;
		else
			__entry->tx = 0;
	),

	TP_printk(
		"%s addr 0x%x flags 0x%x len %zd\n",
		__entry->tx ? "tx" : "rx",
		__entry->addr,
		__entry->flags,
		__entry->buf_len
	)
);

TRACE_EVENT(ath6kl_sdio_scat,
	TP_PROTO(unsigned int addr, int flags, unsigned int total_len,
		 unsigned int entries, struct hif_scatter_item *list),

	TP_ARGS(addr, flags, total_len, entries, list),

	TP_STRUCT__entry(
		__field(unsigned int, tx)
		__field(unsigned int, addr)
		__field(int, flags)
		__field(unsigned int, entries)
		__field(size_t, total_len)
		__dynamic_array(unsigned int, len_array, entries)
		__dynamic_array(u8, data, total_len)
	),

	TP_fast_assign(
		unsigned int *len_array;
		int i, offset = 0;
		size_t len;

		__entry->addr = addr;
		__entry->flags = flags;
		__entry->entries = entries;
		__entry->total_len = total_len;

		if (flags & HIF_WRITE)
			__entry->tx = 1;
		else
			__entry->tx = 0;

		len_array = __get_dynamic_array(len_array);

		for (i = 0; i < entries; i++) {
			len = list[i].len;

			memcpy((u8 *) __get_dynamic_array(data) + offset,
			       list[i].buf, len);

			len_array[i] = len;
			offset += len;
		}
	),

	TP_printk(
		"%s addr 0x%x flags 0x%x entries %d total_len %zd\n",
		__entry->tx ? "tx" : "rx",
		__entry->addr,
		__entry->flags,
		__entry->entries,
		__entry->total_len
	)
);

TRACE_EVENT(ath6kl_sdio_irq,
	TP_PROTO(void *buf, size_t buf_len),

	TP_ARGS(buf, buf_len),

	TP_STRUCT__entry(
		__field(size_t, buf_len)
		__dynamic_array(u8, buf, buf_len)
	),

	TP_fast_assign(
		__entry->buf_len = buf_len;
		memcpy(__get_dynamic_array(buf), buf, buf_len);
	),

	TP_printk(
		"irq len %zd\n", __entry->buf_len
	)
);

TRACE_EVENT(ath6kl_htc_rx,
	TP_PROTO(int status, int endpoint, void *buf,
		 size_t buf_len),

	TP_ARGS(status, endpoint, buf, buf_len),

	TP_STRUCT__entry(
		__field(int, status)
		__field(int, endpoint)
		__field(size_t, buf_len)
		__dynamic_array(u8, buf, buf_len)
	),

	TP_fast_assign(
		__entry->status = status;
		__entry->endpoint = endpoint;
		__entry->buf_len = buf_len;
		memcpy(__get_dynamic_array(buf), buf, buf_len);
	),

	TP_printk(
		"status %d endpoint %d len %zd\n",
		__entry->status,
		__entry->endpoint,
		__entry->buf_len
	)
);

TRACE_EVENT(ath6kl_htc_tx,
	TP_PROTO(int status, int endpoint, void *buf,
		 size_t buf_len),

	TP_ARGS(status, endpoint, buf, buf_len),

	TP_STRUCT__entry(
		__field(int, status)
		__field(int, endpoint)
		__field(size_t, buf_len)
		__dynamic_array(u8, buf, buf_len)
	),

	TP_fast_assign(
		__entry->status = status;
		__entry->endpoint = endpoint;
		__entry->buf_len = buf_len;
		memcpy(__get_dynamic_array(buf), buf, buf_len);
	),

	TP_printk(
		"status %d endpoint %d len %zd\n",
		__entry->status,
		__entry->endpoint,
		__entry->buf_len
	)
);

#define ATH6KL_MSG_MAX 200

DECLARE_EVENT_CLASS(ath6kl_log_event,
	TP_PROTO(struct va_format *vaf),
	TP_ARGS(vaf),
	TP_STRUCT__entry(
		__dynamic_array(char, msg, ATH6KL_MSG_MAX)
	),
	TP_fast_assign(
		WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
				       ATH6KL_MSG_MAX,
				       vaf->fmt,
				       *vaf->va) >= ATH6KL_MSG_MAX);
	),
	TP_printk("%s", __get_str(msg))
);

DEFINE_EVENT(ath6kl_log_event, ath6kl_log_err,
	     TP_PROTO(struct va_format *vaf),
	     TP_ARGS(vaf)
);

DEFINE_EVENT(ath6kl_log_event, ath6kl_log_warn,
	     TP_PROTO(struct va_format *vaf),
	     TP_ARGS(vaf)
);

DEFINE_EVENT(ath6kl_log_event, ath6kl_log_info,
	     TP_PROTO(struct va_format *vaf),
	     TP_ARGS(vaf)
);

TRACE_EVENT(ath6kl_log_dbg,
	TP_PROTO(unsigned int level, struct va_format *vaf),
	TP_ARGS(level, vaf),
	TP_STRUCT__entry(
		__field(unsigned int, level)
		__dynamic_array(char, msg, ATH6KL_MSG_MAX)
	),
	TP_fast_assign(
		__entry->level = level;
		WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
				       ATH6KL_MSG_MAX,
				       vaf->fmt,
				       *vaf->va) >= ATH6KL_MSG_MAX);
	),
	TP_printk("%s", __get_str(msg))
);

TRACE_EVENT(ath6kl_log_dbg_dump,
	TP_PROTO(const char *msg, const char *prefix,
		 const void *buf, size_t buf_len),

	TP_ARGS(msg, prefix, buf, buf_len),

	TP_STRUCT__entry(
		__string(msg, msg)
		__string(prefix, prefix)
		__field(size_t, buf_len)
		__dynamic_array(u8, buf, buf_len)
	),

	TP_fast_assign(
		__assign_str(msg, msg);
		__assign_str(prefix, prefix);
		__entry->buf_len = buf_len;
		memcpy(__get_dynamic_array(buf), buf, buf_len);
	),

	TP_printk(
		"%s/%s\n", __get_str(prefix), __get_str(msg)
	)
);

#endif /* _ ATH6KL_TRACE_H || TRACE_HEADER_MULTI_READ*/

/* we don't want to use include/trace/events */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace

/* This part must be outside protection */
#include <trace/define_trace.h>

{'repo_name': 'GrapheneOS/linux-hardened', 'stars': '324', 'repo_language': 'C', 'file_name': 'wlan_bssdef.h', 'mime_type': 'text/x-c', 'hash': -5115880822896864390, 'source_dataset': 'data'}


import React from 'react'
import MarkdownElement from 'docs/MarkdownElement'
import docs from 'packages/scene-helpers/README.md'

function SceneHelpers() {
  return <MarkdownElement docs={docs} />
}

export default SceneHelpers

{'repo_name': 'sghall/react-vertex', 'stars': '1214', 'repo_language': 'JavaScript', 'file_name': 'PhongTextured.js', 'mime_type': 'text/plain', 'hash': 1488295943322281692, 'source_dataset': 'data'}


/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by informer-gen. DO NOT EDIT.

package internalversion

import (
	time "time"

	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	runtime "k8s.io/apimachinery/pkg/runtime"
	watch "k8s.io/apimachinery/pkg/watch"
	cache "k8s.io/client-go/tools/cache"
	core "k8s.io/kubernetes/pkg/apis/core"
	internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
	internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
	internalversion "k8s.io/kubernetes/pkg/client/listers/core/internalversion"
)

// PodTemplateInformer provides access to a shared informer and lister for
// PodTemplates.
type PodTemplateInformer interface {
	Informer() cache.SharedIndexInformer
	Lister() internalversion.PodTemplateLister
}

type podTemplateInformer struct {
	factory          internalinterfaces.SharedInformerFactory
	tweakListOptions internalinterfaces.TweakListOptionsFunc
	namespace        string
}

// NewPodTemplateInformer constructs a new informer for PodTemplate type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewPodTemplateInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
	return NewFilteredPodTemplateInformer(client, namespace, resyncPeriod, indexers, nil)
}

// NewFilteredPodTemplateInformer constructs a new informer for PodTemplate type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredPodTemplateInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
	return cache.NewSharedIndexInformer(
		&cache.ListWatch{
			ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.Core().PodTemplates(namespace).List(options)
			},
			WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.Core().PodTemplates(namespace).Watch(options)
			},
		},
		&core.PodTemplate{},
		resyncPeriod,
		indexers,
	)
}

func (f *podTemplateInformer) defaultInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
	return NewFilteredPodTemplateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}

func (f *podTemplateInformer) Informer() cache.SharedIndexInformer {
	return f.factory.InformerFor(&core.PodTemplate{}, f.defaultInformer)
}

func (f *podTemplateInformer) Lister() internalversion.PodTemplateLister {
	return internalversion.NewPodTemplateLister(f.Informer().GetIndexer())
}

{'repo_name': 'intuit/foremast', 'stars': '107', 'repo_language': 'Java', 'file_name': 'apilb.conf', 'mime_type': 'text/plain', 'hash': -1743017344853848683, 'source_dataset': 'data'}


# Elan and Roy on Teamwork
# http://www.cafepress.com/orderofthestick.10272636?zoom=yes#zoom

[ Teamwork ] { fill: yellow; title: Elan; }
-- is the key to --> [ Victory ] { fill: red; title: Roy; }

[ Victory ]  -- the order of the --> [ Stick ] { fill: #ff80a0; }
[ Victory ]  -- Treasure --> [ Haley ] { fill: lightblue; }

{'repo_name': 'ironcamel/Graph-Easy', 'stars': '279', 'repo_language': 'Perl', 'file_name': 'serie.pl', 'mime_type': 'text/x-perl', 'hash': -6902380196659303173, 'source_dataset': 'data'}


<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="7.10"
	Name="gtest_main"
	ProjectGUID="{3AF54C8A-10BF-4332-9147-F68ED9862032}"
	Keyword="Win32Proj">
	<Platforms>
		<Platform
			Name="Win32"/>
	</Platforms>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="$(SolutionName)/$(ConfigurationName)"
			IntermediateDirectory="$(OutDir)/$(ProjectName)"
			ConfigurationType="4"
			CharacterSet="2"
			ReferencesPath="">
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
				MinimalRebuild="TRUE"
				BasicRuntimeChecks="3"
				RuntimeLibrary="5"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="FALSE"
				DebugInformationFormat="4"/>
			<Tool
				Name="VCCustomBuildTool"/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)/$(ProjectName)d.lib"/>
			<Tool
				Name="VCMIDLTool"/>
			<Tool
				Name="VCPostBuildEventTool"/>
			<Tool
				Name="VCPreBuildEventTool"/>
			<Tool
				Name="VCPreLinkEventTool"/>
			<Tool
				Name="VCResourceCompilerTool"/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"/>
			<Tool
				Name="VCXMLDataGeneratorTool"/>
			<Tool
				Name="VCManagedWrapperGeneratorTool"/>
			<Tool
				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="$(SolutionName)/$(ConfigurationName)"
			IntermediateDirectory="$(OutDir)/$(ProjectName)"
			ConfigurationType="4"
			CharacterSet="2"
			ReferencesPath=""..\include";".."">
			<Tool
				Name="VCCLCompilerTool"
				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
				RuntimeLibrary="4"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="FALSE"
				DebugInformationFormat="3"/>
			<Tool
				Name="VCCustomBuildTool"/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)/$(ProjectName).lib"/>
			<Tool
				Name="VCMIDLTool"/>
			<Tool
				Name="VCPostBuildEventTool"/>
			<Tool
				Name="VCPreBuildEventTool"/>
			<Tool
				Name="VCPreLinkEventTool"/>
			<Tool
				Name="VCResourceCompilerTool"/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"/>
			<Tool
				Name="VCXMLDataGeneratorTool"/>
			<Tool
				Name="VCManagedWrapperGeneratorTool"/>
			<Tool
				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
		</Configuration>
	</Configurations>
	<References>
		<ProjectReference
			ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
			Name="gtest"/>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
			<File
				RelativePath="..\src\gtest_main.cc">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						AdditionalIncludeDirectories=""..";"..\include""/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						AdditionalIncludeDirectories=""..";"..\include""/>
				</FileConfiguration>
			</File>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl;inc;xsd"
			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
		</Filter>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>

{'repo_name': 'istarc/stm32', 'stars': '141', 'repo_language': 'C', 'file_name': 'Makefile-lib', 'mime_type': 'text/x-makefile', 'hash': -5724147431366472919, 'source_dataset': 'data'}


# frozen_string_literal: true

source 'https://rubygems.org'

# The gem's dependencies are specified in the gemspec
gemspec

gem 'coveralls', require: false
gem 'json', '>2' # So I can test against Ruby 2.4
gem 'rake'

{'repo_name': 'apiology/quality', 'stars': '147', 'repo_language': 'Ruby', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 3799919980745105236, 'source_dataset': 'data'}


/* qhasm: fe z1 */

/* qhasm: fe z2 */

/* qhasm: fe z8 */

/* qhasm: fe z9 */

/* qhasm: fe z11 */

/* qhasm: fe z22 */

/* qhasm: fe z_5_0 */

/* qhasm: fe z_10_5 */

/* qhasm: fe z_10_0 */

/* qhasm: fe z_20_10 */

/* qhasm: fe z_20_0 */

/* qhasm: fe z_40_20 */

/* qhasm: fe z_40_0 */

/* qhasm: fe z_50_10 */

/* qhasm: fe z_50_0 */

/* qhasm: fe z_100_50 */

/* qhasm: fe z_100_0 */

/* qhasm: fe z_200_100 */

/* qhasm: fe z_200_0 */

/* qhasm: fe z_250_50 */

/* qhasm: fe z_250_0 */

/* qhasm: fe z_255_5 */

/* qhasm: fe z_255_21 */

/* qhasm: enter pow225521 */

/* qhasm: z2 = z1^2^1 */
/* asm 1: fe_sq(>z2=fe#1,<z1=fe#11); for (i = 1;i < 1;++i) fe_sq(>z2=fe#1,>z2=fe#1); */
/* asm 2: fe_sq(>z2=t0,<z1=z); for (i = 1;i < 1;++i) fe_sq(>z2=t0,>z2=t0); */
fe_sq(t0,z); for (i = 1;i < 1;++i) fe_sq(t0,t0);

/* qhasm: z8 = z2^2^2 */
/* asm 1: fe_sq(>z8=fe#2,<z2=fe#1); for (i = 1;i < 2;++i) fe_sq(>z8=fe#2,>z8=fe#2); */
/* asm 2: fe_sq(>z8=t1,<z2=t0); for (i = 1;i < 2;++i) fe_sq(>z8=t1,>z8=t1); */
fe_sq(t1,t0); for (i = 1;i < 2;++i) fe_sq(t1,t1);

/* qhasm: z9 = z1*z8 */
/* asm 1: fe_mul(>z9=fe#2,<z1=fe#11,<z8=fe#2); */
/* asm 2: fe_mul(>z9=t1,<z1=z,<z8=t1); */
fe_mul(t1,z,t1);

/* qhasm: z11 = z2*z9 */
/* asm 1: fe_mul(>z11=fe#1,<z2=fe#1,<z9=fe#2); */
/* asm 2: fe_mul(>z11=t0,<z2=t0,<z9=t1); */
fe_mul(t0,t0,t1);

/* qhasm: z22 = z11^2^1 */
/* asm 1: fe_sq(>z22=fe#3,<z11=fe#1); for (i = 1;i < 1;++i) fe_sq(>z22=fe#3,>z22=fe#3); */
/* asm 2: fe_sq(>z22=t2,<z11=t0); for (i = 1;i < 1;++i) fe_sq(>z22=t2,>z22=t2); */
fe_sq(t2,t0); for (i = 1;i < 1;++i) fe_sq(t2,t2);

/* qhasm: z_5_0 = z9*z22 */
/* asm 1: fe_mul(>z_5_0=fe#2,<z9=fe#2,<z22=fe#3); */
/* asm 2: fe_mul(>z_5_0=t1,<z9=t1,<z22=t2); */
fe_mul(t1,t1,t2);

/* qhasm: z_10_5 = z_5_0^2^5 */
/* asm 1: fe_sq(>z_10_5=fe#3,<z_5_0=fe#2); for (i = 1;i < 5;++i) fe_sq(>z_10_5=fe#3,>z_10_5=fe#3); */
/* asm 2: fe_sq(>z_10_5=t2,<z_5_0=t1); for (i = 1;i < 5;++i) fe_sq(>z_10_5=t2,>z_10_5=t2); */
fe_sq(t2,t1); for (i = 1;i < 5;++i) fe_sq(t2,t2);

/* qhasm: z_10_0 = z_10_5*z_5_0 */
/* asm 1: fe_mul(>z_10_0=fe#2,<z_10_5=fe#3,<z_5_0=fe#2); */
/* asm 2: fe_mul(>z_10_0=t1,<z_10_5=t2,<z_5_0=t1); */
fe_mul(t1,t2,t1);

/* qhasm: z_20_10 = z_10_0^2^10 */
/* asm 1: fe_sq(>z_20_10=fe#3,<z_10_0=fe#2); for (i = 1;i < 10;++i) fe_sq(>z_20_10=fe#3,>z_20_10=fe#3); */
/* asm 2: fe_sq(>z_20_10=t2,<z_10_0=t1); for (i = 1;i < 10;++i) fe_sq(>z_20_10=t2,>z_20_10=t2); */
fe_sq(t2,t1); for (i = 1;i < 10;++i) fe_sq(t2,t2);

/* qhasm: z_20_0 = z_20_10*z_10_0 */
/* asm 1: fe_mul(>z_20_0=fe#3,<z_20_10=fe#3,<z_10_0=fe#2); */
/* asm 2: fe_mul(>z_20_0=t2,<z_20_10=t2,<z_10_0=t1); */
fe_mul(t2,t2,t1);

/* qhasm: z_40_20 = z_20_0^2^20 */
/* asm 1: fe_sq(>z_40_20=fe#4,<z_20_0=fe#3); for (i = 1;i < 20;++i) fe_sq(>z_40_20=fe#4,>z_40_20=fe#4); */
/* asm 2: fe_sq(>z_40_20=t3,<z_20_0=t2); for (i = 1;i < 20;++i) fe_sq(>z_40_20=t3,>z_40_20=t3); */
fe_sq(t3,t2); for (i = 1;i < 20;++i) fe_sq(t3,t3);

/* qhasm: z_40_0 = z_40_20*z_20_0 */
/* asm 1: fe_mul(>z_40_0=fe#3,<z_40_20=fe#4,<z_20_0=fe#3); */
/* asm 2: fe_mul(>z_40_0=t2,<z_40_20=t3,<z_20_0=t2); */
fe_mul(t2,t3,t2);

/* qhasm: z_50_10 = z_40_0^2^10 */
/* asm 1: fe_sq(>z_50_10=fe#3,<z_40_0=fe#3); for (i = 1;i < 10;++i) fe_sq(>z_50_10=fe#3,>z_50_10=fe#3); */
/* asm 2: fe_sq(>z_50_10=t2,<z_40_0=t2); for (i = 1;i < 10;++i) fe_sq(>z_50_10=t2,>z_50_10=t2); */
fe_sq(t2,t2); for (i = 1;i < 10;++i) fe_sq(t2,t2);

/* qhasm: z_50_0 = z_50_10*z_10_0 */
/* asm 1: fe_mul(>z_50_0=fe#2,<z_50_10=fe#3,<z_10_0=fe#2); */
/* asm 2: fe_mul(>z_50_0=t1,<z_50_10=t2,<z_10_0=t1); */
fe_mul(t1,t2,t1);

/* qhasm: z_100_50 = z_50_0^2^50 */
/* asm 1: fe_sq(>z_100_50=fe#3,<z_50_0=fe#2); for (i = 1;i < 50;++i) fe_sq(>z_100_50=fe#3,>z_100_50=fe#3); */
/* asm 2: fe_sq(>z_100_50=t2,<z_50_0=t1); for (i = 1;i < 50;++i) fe_sq(>z_100_50=t2,>z_100_50=t2); */
fe_sq(t2,t1); for (i = 1;i < 50;++i) fe_sq(t2,t2);

/* qhasm: z_100_0 = z_100_50*z_50_0 */
/* asm 1: fe_mul(>z_100_0=fe#3,<z_100_50=fe#3,<z_50_0=fe#2); */
/* asm 2: fe_mul(>z_100_0=t2,<z_100_50=t2,<z_50_0=t1); */
fe_mul(t2,t2,t1);

/* qhasm: z_200_100 = z_100_0^2^100 */
/* asm 1: fe_sq(>z_200_100=fe#4,<z_100_0=fe#3); for (i = 1;i < 100;++i) fe_sq(>z_200_100=fe#4,>z_200_100=fe#4); */
/* asm 2: fe_sq(>z_200_100=t3,<z_100_0=t2); for (i = 1;i < 100;++i) fe_sq(>z_200_100=t3,>z_200_100=t3); */
fe_sq(t3,t2); for (i = 1;i < 100;++i) fe_sq(t3,t3);

/* qhasm: z_200_0 = z_200_100*z_100_0 */
/* asm 1: fe_mul(>z_200_0=fe#3,<z_200_100=fe#4,<z_100_0=fe#3); */
/* asm 2: fe_mul(>z_200_0=t2,<z_200_100=t3,<z_100_0=t2); */
fe_mul(t2,t3,t2);

/* qhasm: z_250_50 = z_200_0^2^50 */
/* asm 1: fe_sq(>z_250_50=fe#3,<z_200_0=fe#3); for (i = 1;i < 50;++i) fe_sq(>z_250_50=fe#3,>z_250_50=fe#3); */
/* asm 2: fe_sq(>z_250_50=t2,<z_200_0=t2); for (i = 1;i < 50;++i) fe_sq(>z_250_50=t2,>z_250_50=t2); */
fe_sq(t2,t2); for (i = 1;i < 50;++i) fe_sq(t2,t2);

/* qhasm: z_250_0 = z_250_50*z_50_0 */
/* asm 1: fe_mul(>z_250_0=fe#2,<z_250_50=fe#3,<z_50_0=fe#2); */
/* asm 2: fe_mul(>z_250_0=t1,<z_250_50=t2,<z_50_0=t1); */
fe_mul(t1,t2,t1);

/* qhasm: z_255_5 = z_250_0^2^5 */
/* asm 1: fe_sq(>z_255_5=fe#2,<z_250_0=fe#2); for (i = 1;i < 5;++i) fe_sq(>z_255_5=fe#2,>z_255_5=fe#2); */
/* asm 2: fe_sq(>z_255_5=t1,<z_250_0=t1); for (i = 1;i < 5;++i) fe_sq(>z_255_5=t1,>z_255_5=t1); */
fe_sq(t1,t1); for (i = 1;i < 5;++i) fe_sq(t1,t1);

/* qhasm: z_255_21 = z_255_5*z11 */
/* asm 1: fe_mul(>z_255_21=fe#12,<z_255_5=fe#2,<z11=fe#1); */
/* asm 2: fe_mul(>z_255_21=out,<z_255_5=t1,<z11=t0); */
fe_mul(out,t1,t0);

/* qhasm: return */

{'repo_name': 'monero-project/monero', 'stars': '4414', 'repo_language': 'C++', 'file_name': 'monero_cat.ts', 'mime_type': 'text/xml', 'hash': 2711120474527522269, 'source_dataset': 'data'}


const express = require('express');
const path = require('path');
const logger = require('morgan');
const bodyParser = require('body-parser');

const proxy = require('express-http-proxy');
const URL = require('url');

const app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

const influx = require('./handlers');

const e = process.env;

if (!e.INFLUXDB) {
    console.log('Usage: INFLUXDB=127.0.0.1:8086 npm run start');
    process.exit(-1);
}

const influx_url = URL.parse(e.INFLUXDB.match(/^https*:\/\//) ? e.INFLUXDB : `http://${e.INFLUXDB}`);
const influx_path = influx_url.pathname.match(/\/$/) ? influx_url.pathname : `${influx_url.pathname}/`;

const proxy_options = {
    preserveHostHdr: true,
    proxyReqPathResolver: influx.forward.bind(this, influx_path),
    userResDecorator: influx.intercept
};

if (e.INFLUXDB.match(/^https:\/\//)) {
    Object.assign(proxy_options, {https: true});
}

app.use("/", proxy(influx_url.host, proxy_options));

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  const err = new Error('Not Found');
  err.status = 404;
  next(err);
});

// error handler
app.use(function(err, req, res, next) {
  // set locals, only providing error in development
  res.locals.message = err.message;
  res.locals.error = req.app.get('env') === 'development' ? err : {};
  // render the error page
  res.status(err.status || 500);
  res.render('error');
});

module.exports = app;

{'repo_name': 'serputko/performance-testing-framework', 'stars': '239', 'repo_language': 'JavaScript', 'file_name': 'FrontendJob.xml', 'mime_type': 'text/xml', 'hash': -1744436661854253138, 'source_dataset': 'data'}


---
license: >
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF 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.

title: media.seekTo
---

media.seekTo
========================

Sets the current position within an audio file.

    media.seekTo(milliseconds);

Parameters
----------

- __milliseconds__: The position to set the playback position within the audio in milliseconds. .

Description
-----------

Function `media.seekTo` is an asynchronous function that updates the current position of the underlying audio file of a [Media](media.html) object. Also updates the ___position__ parameter within the [Media](media.html) object.

Supported Platforms
-------------------

- Android
- BlackBerry WebWorks (OS 6.0 and higher)
- iOS
- Windows Phone 7 ( Mango )
- Tizen

Quick [Example](../storage/storage.opendatabase.html)
-------------

        // Audio player
        //
        var my_media = new Media(src, onSuccess, onError);
		my_media.play();
        // SeekTo to 10 seconds after 5 seconds
        setTimeout(function() {
            my_media.seekTo(10000);
        }, 5000);

Full [Example](../storage/storage.opendatabase.html)
------------

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                      "http://www.w3.org/TR/html4/strict.dtd">

            <title>Media Example</title>

            Play Audio
            Stop Playing Audio

BlackBerry WebWorks Quirks
----------

- This API is not supported on BlackBerry OS 5 devices.

{'repo_name': 'apache/cordova-docs', 'stars': '298', 'repo_language': 'JavaScript', 'file_name': 'media.release.md', 'mime_type': 'text/html', 'hash': -6748144345853552504, 'source_dataset': 'data'}


// Automatically added for the myFirstTeamsConnector connector
export * from "./myFirstTeamsConnector/MyFirstTeamsConnectorConfig";

{'repo_name': 'OfficeDev/TrainingContent', 'stars': '696', 'repo_language': 'C#', 'file_name': 'jquery.js', 'mime_type': 'text/plain', 'hash': -1685173884899616471, 'source_dataset': 'data'}


# @babel/code-frame

> Generate errors that contain a code frame that point to source locations.

See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information.

## Install

Using npm:

```sh
npm install --save-dev @babel/code-frame
```

or using yarn:

```sh
yarn add @babel/code-frame --dev
```

{'repo_name': 'ChromeDevTools/devtools-frontend', 'stars': '1492', 'repo_language': 'JavaScript', 'file_name': 'timestamp.ts', 'mime_type': 'text/plain', 'hash': -6156038640708096069, 'source_dataset': 'data'}


// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
// (C) Copyright 2003-2007 Jonathan Turkanis
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)

// See http://www.boost.org/libs/iostreams for documentation.

#ifndef BOOST_IOSTREAMS_DETAIL_PUSH_HPP_INCLUDED
#define BOOST_IOSTREAMS_DETAIL_PUSH_HPP_INCLUDED

#if defined(_MSC_VER)
# pragma once
#endif

#include <boost/config.hpp> // BOOST_MSVC.
#include <boost/detail/workaround.hpp>
#include <boost/iostreams/categories.hpp>
#include <boost/iostreams/categories.hpp>
#include <boost/iostreams/detail/adapter/range_adapter.hpp>
#include <boost/iostreams/detail/config/wide_streams.hpp>
#include <boost/iostreams/detail/enable_if_stream.hpp>
#include <boost/iostreams/pipeline.hpp>
#include <boost/iostreams/detail/push_params.hpp>
#include <boost/iostreams/detail/resolve.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_convertible.hpp>

//
// Macro: BOOST_IOSTREAMS_DEFINE_PUSH_CONSTRUCTOR(name, mode, ch, helper).
// Description: Defines overloads with name 'name' which forward to a function
//      'helper' which takes a filter or devide by const reference.
//
#define BOOST_IOSTREAMS_DEFINE_PUSH_CONSTRUCTOR(name, mode, ch, helper) \
    BOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, 0, ?) \
    /**/

//
// Macro: BOOST_IOSTREAMS_DEFINE_PUSH(name, mode, ch, helper).
// Description: Defines constructors which forward to a function
//      'helper' which takes a filter or device by const reference.
//
#define BOOST_IOSTREAMS_DEFINE_PUSH(name, mode, ch, helper) \
    BOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, 1, void) \
    /**/

//--------------------Definition of BOOST_IOSTREAMS_DEFINE_PUSH_IMPL----------//

#define BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, arg, helper, has_return) \
    this->helper( ::boost::iostreams::detail::resolve<mode, ch>(arg) \
                  BOOST_IOSTREAMS_PUSH_ARGS() ); \
    /**/

#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
    /**/
# ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES
#  define BOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, has_return, result) \
    template<typename CharType, typename TraitsType> \
    BOOST_PP_IIF(has_return, result, explicit) \
    name(::std::basic_streambuf<CharType, TraitsType>& sb BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, sb, helper, has_return); } \
    template<typename CharType, typename TraitsType> \
    BOOST_PP_IIF(has_return, result, explicit) \
    name(::std::basic_istream<CharType, TraitsType>& is BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_STATIC_ASSERT((!is_convertible<mode, output>::value)); \
      BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, is, helper, has_return); } \
    template<typename CharType, typename TraitsType> \
    BOOST_PP_IIF(has_return, result, explicit) \
    name(::std::basic_ostream<CharType, TraitsType>& os BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_STATIC_ASSERT((!is_convertible<mode, input>::value)); \
      BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, os, helper, has_return); } \
    template<typename CharType, typename TraitsType> \
    BOOST_PP_IIF(has_return, result, explicit) \
    name(::std::basic_iostream<CharType, TraitsType>& io BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, io, helper, has_return); } \
    template<typename Iter> \
    BOOST_PP_IIF(has_return, result, explicit) \
    name(const iterator_range<Iter>& rng BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_PP_EXPR_IF(has_return, return) \
    this->helper( ::boost::iostreams::detail::range_adapter< \
                      mode, iterator_range<Iter> \
                  >(rng) \
                  BOOST_IOSTREAMS_PUSH_ARGS() ); } \
    template<typename Pipeline, typename Concept> \
    BOOST_PP_IIF(has_return, result, explicit) \
    name(const ::boost::iostreams::pipeline<Pipeline, Concept>& p) \
    { p.push(*this); } \
    template<typename T> \
    BOOST_PP_IIF(has_return, result, explicit) \
    name(const T& t BOOST_IOSTREAMS_PUSH_PARAMS() BOOST_IOSTREAMS_DISABLE_IF_STREAM(T)) \
    { this->helper( ::boost::iostreams::detail::resolve<mode, ch>(t) \
                    BOOST_IOSTREAMS_PUSH_ARGS() ); } \
    /**/
# else // # ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES
#  define BOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, has_return, result) \
    BOOST_PP_IF(has_return, result, explicit) \
    name(::std::streambuf& sb BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, sb, helper, has_return); } \
    BOOST_PP_IF(has_return, result, explicit) \
    name(::std::istream& is BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_STATIC_ASSERT((!is_convertible<mode, output>::value)); \
      BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, is, helper, has_return); } \
    BOOST_PP_IF(has_return, result, explicit) \
    name(::std::ostream& os BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_STATIC_ASSERT((!is_convertible<mode, input>::value)); \
      BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, os, helper, has_return); } \
    BOOST_PP_IF(has_return, result, explicit) \
    name(::std::iostream& io BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_IOSTREAMS_ADAPT_STREAM(mode, ch, io, helper, has_return); } \
    template<typename Iter> \
    BOOST_PP_IF(has_return, result, explicit) \
    name(const iterator_range<Iter>& rng BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { BOOST_PP_EXPR_IF(has_return, return) \
    this->helper( ::boost::iostreams::detail::range_adapter< \
                      mode, iterator_range<Iter> \
                  >(rng) \
                  BOOST_IOSTREAMS_PUSH_ARGS() ); } \
    template<typename Pipeline, typename Concept> \
    BOOST_PP_IF(has_return, result, explicit) \
    name(const ::boost::iostreams::pipeline<Pipeline, Concept>& p) \
    { p.push(*this); } \
    template<typename T> \
    BOOST_PP_EXPR_IF(has_return, result) \
    name(const T& t BOOST_IOSTREAMS_PUSH_PARAMS() BOOST_IOSTREAMS_DISABLE_IF_STREAM(T)) \
    { this->helper( ::boost::iostreams::detail::resolve<mode, ch>(t) \
                    BOOST_IOSTREAMS_PUSH_ARGS() ); } \
    /**/
# endif // # ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES
#else // #if VC6, VC7.0, Borland 5.x
# define BOOST_IOSTREAMS_DEFINE_PUSH_IMPL(name, mode, ch, helper, has_return, result) \
    template<typename T> \
    void BOOST_PP_CAT(name, _msvc_impl) \
    ( ::boost::mpl::true_, const T& t BOOST_IOSTREAMS_PUSH_PARAMS() ) \
    { t.push(*this); } \
    template<typename T> \
    void BOOST_PP_CAT(name, _msvc_impl) \
    ( ::boost::mpl::false_, const T& t BOOST_IOSTREAMS_PUSH_PARAMS() ) \
    { this->helper( ::boost::iostreams::detail::resolve<mode, ch>(t) \
                    BOOST_IOSTREAMS_PUSH_ARGS() ); } \
    template<typename T> \
    BOOST_PP_IF(has_return, result, explicit) \
    name(const T& t BOOST_IOSTREAMS_PUSH_PARAMS()) \
    { \
        this->BOOST_PP_CAT(name, _msvc_impl) \
              ( ::boost::iostreams::detail::is_pipeline<T>(), \
                t BOOST_IOSTREAMS_PUSH_ARGS() ); \
    } \
    /**/
#endif // #if VC6, VC7.0, Borland 5.x

#endif // #ifndef BOOST_IOSTREAMS_DETAIL_PUSH_HPP_INCLUDED

{'repo_name': 'expo/expo', 'stars': '10544', 'repo_language': 'Objective-C', 'file_name': 'ZXRGBLuminanceSource.h', 'mime_type': 'text/x-objective-c', 'hash': 4885613385482224633, 'source_dataset': 'data'}


// Extract.cpp

#include "StdAfx.h"

#include "../../../../C/Sort.h"

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

#include "../../../Windows/FileDir.h"
#include "../../../Windows/PropVariant.h"
#include "../../../Windows/PropVariantConv.h"

#include "../Common/ExtractingFilePath.h"

#include "Extract.h"
#include "SetProperties.h"

using namespace NWindows;
using namespace NFile;
using namespace NDir;

static HRESULT DecompressArchive(
    CCodecs *codecs,
    const CArchiveLink &arcLink,
    UInt64 packSize,
    const NWildcard::CCensorNode &wildcardCensor,
    const CExtractOptions &options,
    bool calcCrc,
    IExtractCallbackUI *callback,
    CArchiveExtractCallback *ecs,
    UString &errorMessage,
    UInt64 &stdInProcessed)
{
  const CArc &arc = arcLink.Arcs.Back();
  stdInProcessed = 0;
  IInArchive *archive = arc.Archive;
  CRecordVector<UInt32> realIndices;

  UStringVector removePathParts;

  FString outDir = options.OutputDir;
  UString replaceName = arc.DefaultName;

  if (arcLink.Arcs.Size() > 1)
  {
    // Most "pe" archives have same name of archive subfile "[0]" or ".rsrc_1".
    // So it extracts different archives to one folder.
    // We will use top level archive name
    const CArc &arc0 = arcLink.Arcs[0];
    if (StringsAreEqualNoCase_Ascii(codecs->Formats[arc0.FormatIndex].Name, "pe"))
      replaceName = arc0.DefaultName;
  }

  outDir.Replace(FSTRING_ANY_MASK, us2fs(Get_Correct_FsFile_Name(replaceName)));

  bool elimIsPossible = false;
  UString elimPrefix; // only pure name without dir delimiter
  FString outDirReduced = outDir;

  if (options.ElimDup.Val && options.PathMode != NExtract::NPathMode::kAbsPaths)
  {
    UString dirPrefix;
    SplitPathToParts_Smart(fs2us(outDir), dirPrefix, elimPrefix);
    if (!elimPrefix.IsEmpty())
    {
      if (IsPathSepar(elimPrefix.Back()))
        elimPrefix.DeleteBack();
      if (!elimPrefix.IsEmpty())
      {
        outDirReduced = us2fs(dirPrefix);
        elimIsPossible = true;
      }
    }
  }

  bool allFilesAreAllowed = wildcardCensor.AreAllAllowed();

  if (!options.StdInMode)
  {
    UInt32 numItems;
    RINOK(archive->GetNumberOfItems(&numItems));

    CReadArcItem item;

    for (UInt32 i = 0; i < numItems; i++)
    {
      if (elimIsPossible || !allFilesAreAllowed)
      {
        RINOK(arc.GetItem(i, item));
      }
      else
      {
        #ifdef SUPPORT_ALT_STREAMS
        item.IsAltStream = false;
        if (!options.NtOptions.AltStreams.Val && arc.Ask_AltStream)
        {
          RINOK(Archive_IsItem_AltStream(arc.Archive, i, item.IsAltStream));
        }
        #endif
      }

      #ifdef SUPPORT_ALT_STREAMS
      if (!options.NtOptions.AltStreams.Val && item.IsAltStream)
        continue;
      #endif

      if (elimIsPossible)
      {
        const UString &s =
          #ifdef SUPPORT_ALT_STREAMS
            item.MainPath;
          #else
            item.Path;
          #endif
        if (!IsPath1PrefixedByPath2(s, elimPrefix))
          elimIsPossible = false;
        else
        {
          wchar_t c = s[elimPrefix.Len()];
          if (c == 0)
          {
            if (!item.MainIsDir)
              elimIsPossible = false;
          }
          else if (!IsPathSepar(c))
            elimIsPossible = false;
        }
      }

      if (!allFilesAreAllowed)
      {
        if (!CensorNode_CheckPath(wildcardCensor, item))
          continue;
      }

      realIndices.Add(i);
    }

    if (realIndices.Size() == 0)
    {
      callback->ThereAreNoFiles();
      return callback->ExtractResult(S_OK);
    }
  }

  if (elimIsPossible)
  {
    removePathParts.Add(elimPrefix);
    // outDir = outDirReduced;
  }

  if (outDir.IsEmpty())
    outDir = FTEXT(".") FSTRING_PATH_SEPARATOR;
  else if (!CreateComplexDir(outDir))
  {
    HRESULT res = ::GetLastError();
    if (res == S_OK)
      res = E_FAIL;
    errorMessage.SetFromAscii("Can not create output directory: ");
    errorMessage += fs2us(outDir);
    return res;
  }

  ecs->Init(
      options.NtOptions,
      options.StdInMode ? &wildcardCensor : NULL,
      &arc,
      callback,
      options.StdOutMode, options.TestMode,
      outDir,
      removePathParts, false,
      packSize);

  #ifdef SUPPORT_LINKS

  if (!options.StdInMode &&
      !options.TestMode &&
      options.NtOptions.HardLinks.Val)
  {
    RINOK(ecs->PrepareHardLinks(&realIndices));
  }

  #endif

  HRESULT result;
  Int32 testMode = (options.TestMode && !calcCrc) ? 1: 0;
  if (options.StdInMode)
  {
    result = archive->Extract(NULL, (UInt32)(Int32)-1, testMode, ecs);
    NCOM::CPropVariant prop;
    if (archive->GetArchiveProperty(kpidPhySize, &prop) == S_OK)
      ConvertPropVariantToUInt64(prop, stdInProcessed);
  }
  else
    result = archive->Extract(&realIndices.Front(), realIndices.Size(), testMode, ecs);
  if (result == S_OK && !options.StdInMode)
    result = ecs->SetDirsTimes();
  return callback->ExtractResult(result);
}

/* v9.31: BUG was fixed:
   Sorted list for file paths was sorted with case insensitive compare function.
   But FindInSorted function did binary search via case sensitive compare function */

int Find_FileName_InSortedVector(const UStringVector &fileName, const UString &name)
{
  unsigned left = 0, right = fileName.Size();
  while (left != right)
  {
    unsigned mid = (left + right) / 2;
    const UString &midValue = fileName[mid];
    int compare = CompareFileNames(name, midValue);
    if (compare == 0)
      return mid;
    if (compare < 0)
      right = mid;
    else
      left = mid + 1;
  }
  return -1;
}

HRESULT Extract(
    CCodecs *codecs,
    const CObjectVector<COpenType> &types,
    const CIntVector &excludedFormats,
    UStringVector &arcPaths, UStringVector &arcPathsFull,
    const NWildcard::CCensorNode &wildcardCensor,
    const CExtractOptions &options,
    IOpenCallbackUI *openCallback,
    IExtractCallbackUI *extractCallback,
    IHashCalc *hash,
    UString &errorMessage,
    CDecompressStat &st)
{
  st.Clear();
  UInt64 totalPackSize = 0;
  CRecordVector<UInt64> arcSizes;

  unsigned numArcs = options.StdInMode ? 1 : arcPaths.Size();

  unsigned i;

  for (i = 0; i < numArcs; i++)
  {
    NFind::CFileInfo fi;
    fi.Size = 0;
    if (!options.StdInMode)
    {
      const FString &arcPath = us2fs(arcPaths[i]);
      if (!fi.Find(arcPath,true))
        throw "there is no such archive";
      if (fi.IsDir())
        throw "can't decompress folder";
    }
    arcSizes.Add(fi.Size);
    totalPackSize += fi.Size;
  }

  CBoolArr skipArcs(numArcs);
  for (i = 0; i < numArcs; i++)
    skipArcs[i] = false;

  CArchiveExtractCallback *ecs = new CArchiveExtractCallback;
  CMyComPtr<IArchiveExtractCallback> ec(ecs);
  bool multi = (numArcs > 1);
  ecs->InitForMulti(multi, options.PathMode, options.OverwriteMode);
  ecs->SetHashMethods(hash);

  if (multi)
  {
    RINOK(extractCallback->SetTotal(totalPackSize));
  }

  UInt64 totalPackProcessed = 0;
  bool thereAreNotOpenArcs = false;

  for (i = 0; i < numArcs; i++)
  {
    if (skipArcs[i])
      continue;

    const UString &arcPath = arcPaths[i];
    NFind::CFileInfo fi;
    if (options.StdInMode)
    {
      fi.Size = 0;
      fi.Attrib = 0;
    }
    else
    {
      if (!fi.Find(us2fs(arcPath),true) || fi.IsDir())
        throw "there is no such archive";
    }

    RINOK(extractCallback->BeforeOpen(arcPath, options.TestMode));
    CArchiveLink arcLink;

    CObjectVector<COpenType> types2 = types;

    COpenOptions op;
    op.props = &options.Properties;
    op.codecs = codecs;
    op.types = &types2;
    op.excludedFormats = &excludedFormats;
    op.stdInMode = options.StdInMode;
    op.stream = NULL;
    op.filePath = arcPath;

    HRESULT result = arcLink.Open3(op, openCallback);

    if (result == E_ABORT)
      return result;

    if (result == S_OK && arcLink.NonOpen_ErrorInfo.ErrorFormatIndex >= 0)
      result = S_FALSE;

    // arcLink.Set_ErrorsText();
    RINOK(extractCallback->OpenResult(codecs, arcLink, arcPath, result));

    if (result != S_OK)
    {
      thereAreNotOpenArcs = true;
      if (!options.StdInMode)
      {
        NFind::CFileInfo fi2;
        if (fi2.Find(us2fs(arcPath)))
          if (!fi2.IsDir())
            totalPackProcessed += fi2.Size;
      }
      continue;
    }

    if (!options.StdInMode)
    {
      if (arcLink.VolumePaths.Size() != 0)
      {
        Int64 correctionSize = arcLink.VolumesSize;
        FOR_VECTOR (v, arcLink.VolumePaths)
        {
          int index = Find_FileName_InSortedVector(arcPathsFull, arcLink.VolumePaths[v]);
          if (index >= 0)
          {
            if ((unsigned)index > i)
            {
              skipArcs[(unsigned)index] = true;
              correctionSize -= arcSizes[(unsigned)index];
            }
          }
        }
        if (correctionSize != 0)
        {
          Int64 newPackSize = (Int64)totalPackSize + correctionSize;
          if (newPackSize < 0)
            newPackSize = 0;
          totalPackSize = newPackSize;
          RINOK(extractCallback->SetTotal(totalPackSize));
        }
      }
    }

    CArc &arc = arcLink.Arcs.Back();
    arc.MTimeDefined = (!options.StdInMode && !fi.IsDevice);
    arc.MTime = fi.MTime;

    UInt64 packProcessed;
    bool calcCrc = (hash != NULL);

    RINOK(DecompressArchive(
        codecs,
        arcLink,
        fi.Size + arcLink.VolumesSize,
        wildcardCensor,
        options,
        calcCrc,
        extractCallback, ecs, errorMessage, packProcessed));

    if (!options.StdInMode)
      packProcessed = fi.Size + arcLink.VolumesSize;
    totalPackProcessed += packProcessed;
    ecs->LocalProgressSpec->InSize += packProcessed;
    ecs->LocalProgressSpec->OutSize = ecs->UnpackSize;
    if (!errorMessage.IsEmpty())
      return E_FAIL;
  }

  if (multi || thereAreNotOpenArcs)
  {
    RINOK(extractCallback->SetTotal(totalPackSize));
    RINOK(extractCallback->SetCompleted(&totalPackProcessed));
  }

  st.NumFolders = ecs->NumFolders;
  st.NumFiles = ecs->NumFiles;
  st.NumAltStreams = ecs->NumAltStreams;
  st.UnpackSize = ecs->UnpackSize;
  st.AltStreams_UnpackSize = ecs->AltStreams_UnpackSize;
  st.NumArchives = arcPaths.Size();
  st.PackSize = ecs->LocalProgressSpec->InSize;
  return S_OK;
}

{'repo_name': 'giuspen/cherrytree', 'stars': '1385', 'repo_language': 'C++', 'file_name': 'fr.po', 'mime_type': 'text/x-po', 'hash': -5621519383025235136, 'source_dataset': 'data'}


//
//  U4DMacMouseDraggedState.cpp
//  UntoldEngine
//
//  Created by Harold Serrano on 3/8/18.
//  Copyright © 2018 Untold Engine Studios. All rights reserved.
//

#include "U4DMacMouseDraggedState.h"
#include "U4DControllerInterface.h"

namespace U4DEngine {

    U4DMacMouseDraggedState* U4DMacMouseDraggedState::instance=0;

    U4DMacMouseDraggedState::U4DMacMouseDraggedState(){

    }

    U4DMacMouseDraggedState::~U4DMacMouseDraggedState(){

    }

    U4DMacMouseDraggedState* U4DMacMouseDraggedState::sharedInstance(){

        if (instance==0) {
            instance=new U4DMacMouseDraggedState();
        }

        return instance;

    }

    void U4DMacMouseDraggedState::enter(U4DMacMouse *uMacMouse){

    }

    void U4DMacMouseDraggedState::execute(U4DMacMouse *uMacMouse, double dt){

        U4DEngine::U4DVector2n absoluteMouseAxis=uMacMouse->dataPosition-uMacMouse->previousDataPosition;

        //make sure that the mouse drag is not too close to its initial position.
        if (absoluteMouseAxis.magnitude()<1.0) {

            absoluteMouseAxis=uMacMouse->dataPosition;

        }

        absoluteMouseAxis.normalize();

        if (uMacMouse->dataPosition.dot(absoluteMouseAxis)<-0.9) {

            uMacMouse->directionReversal=true;

        }else{
            uMacMouse->directionReversal=false;

        }

        uMacMouse->previousDataPosition=uMacMouse->dataPosition;

        uMacMouse->dataPosition=absoluteMouseAxis;

        uMacMouse->dataMagnitude=absoluteMouseAxis.magnitude();

        uMacMouse->action();

        if (uMacMouse->controllerInterface!=NULL) {
            uMacMouse->controllerInterface->setReceivedAction(true);
        }

    }

    void U4DMacMouseDraggedState::exit(U4DMacMouse *uMacMouse){

    }

}

{'repo_name': 'untoldengine/UntoldEngine', 'stars': '144', 'repo_language': 'Objective-C++', 'file_name': 'Main.storyboard', 'mime_type': 'text/xml', 'hash': -1364517444987649146, 'source_dataset': 'data'}


#include "script_component.hpp"
/*
 * Author: ACRE2Team
 * SHORT DESCRIPTION
 *
 * Arguments:
 * 0: ARGUMENT ONE <TYPE>
 * 1: ARGUMENT TWO <TYPE>
 *
 * Return Value:
 * RETURN VALUE <TYPE>
 *
 * Example:
 * [ARGUMENTS] call acre_sys_prc152_fnc_changeMode
 *
 * Public: No
 */

TRACE_1("changeMode", _this);

private _knobPosition = GET_STATE_DEF("knobPosition", 1);

if (_knobPosition == 0) then {
    TRACE_2("Turning radio off!", _knobPosition, GVAR(currentRadioId));
    [GVAR(currentRadioId), "setOnOffState", 0] call EFUNC(sys_data,dataEvent);
    private _onOffState = [GVAR(currentRadioId), "getOnOffState"] call EFUNC(sys_data,dataEvent);
    TRACE_1("TEST", _onOffState);
    [GVAR(OFF)] call FUNC(changeMenu);
} else {
    private _onOffState = [GVAR(currentRadioId), "getOnOffState"] call EFUNC(sys_data,dataEvent);
    TRACE_2("State", _knobPosition, _onOffState);
    if (_onOffState >= 1) then {
        ["setCurrentChannel", _knobPosition - 1] call GUI_DATA_EVENT;
        private _currentMenu = GET_STATE_DEF("currentHome", GVAR(VULOSHOME));
        [_currentMenu] call FUNC(renderMenu);
    } else {
        if (_onOffState == 0) then {
            [GVAR(currentRadioId), "setOnOffState", 0.2] call EFUNC(sys_data,dataEvent);
            [GVAR(LOADING)] call FUNC(changeMenu);
        };
    };
};

{'repo_name': 'IDI-Systems/acre2', 'stars': '150', 'repo_language': 'C++', 'file_name': 'mission.sqm', 'mime_type': 'text/x-c++', 'hash': -696423311323457653, 'source_dataset': 'data'}