//
//  PKTokenizer+Factory.m
//  MHImportBuster
//
//  Created by Marko Hlebar on 13/04/2014.
//  Copyright (c) 2014 Marko Hlebar. All rights reserved.
//

#import "PKTokenizer+Factory.h"

@implementation PKTokenizer (Factory)
+ (PKTokenizer *)defaultTokenizer {
    PKTokenizer *defaultTokenizer = [PKTokenizer tokenizer];
    //sets the parsing of #import "header.h" not to behave as quoted string
    [defaultTokenizer setTokenizerState:(PKTokenizerState *)defaultTokenizer.symbolState
                                   from:'"'
                                     to:'"'];

    [defaultTokenizer setTokenizerState:(PKTokenizerState *)defaultTokenizer.symbolState
                                   from:0
                                     to:' '];

    //sets the parsing of anything that starts with a # as a word
//    [defaultTokenizer setTokenizerState:(PKTokenizerState *)defaultTokenizer.wordState
//                                   from:'#'
//                                     to:'#'];
    //sets the parsing of anything that starts with a @ as a word
    [defaultTokenizer setTokenizerState:(PKTokenizerState *)defaultTokenizer.wordState
                                   from:'@'
                                     to:'@'];
	return defaultTokenizer;
}
@end

{'repo_name': 'markohlebar/Peckham', 'stars': '720', 'repo_language': 'Objective-C', 'file_name': 'contents.xcworkspacedata', 'mime_type': 'text/xml', 'hash': -1737099045514624608, 'source_dataset': 'data'}


msgid ""
msgstr ""
"Project-Id-Version: openhab-habpanel\n"
"Report-Msgid-Bugs-To: https://github.com/openhab/org.openhab.ui.habpanel/issues\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: openhab-habpanel\n"
"X-Crowdin-Language: af\n"
"X-Crowdin-File: /master/web/assets/i18n/main/main.pot\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Last-Translator: openhab-bot <bot@openhab.org>\n"
"Language-Team: Afrikaans\n"
"Language: af_ZA\n"
"PO-Revision-Date: 2018-11-05 17:11\n"

#. Common term
msgctxt "OK"
msgid "OK"
msgstr "OK"

#. Common term
msgctxt "Cancel"
msgid "Cancel"
msgstr "Kanselleer"

#. Common term
msgctxt "Delete"
msgid "Delete"
msgstr "Verwyder"

#. Common term
msgctxt "Save"
msgid "Save"
msgstr "Stoor"

#. Common term
msgctxt "Name"
msgid "Name"
msgstr "Naam"

#. Common term
msgctxt "Icon"
msgid "Icon"
msgstr "Icon"

#. Common term (plural)
msgctxt "Icons"
msgid "Icons"
msgstr "Ikone"

#. Common term
msgctxt "Backdrop Icon"
msgid "Backdrop Icon"
msgstr "Agtergrond Icon"

#. Common term
msgctxt "Size"
msgid "Size"
msgstr "Grootte"

#. Common term
msgctxt "Font size"
msgid "Font Size"
msgstr "Skrifgrootte"

#. Common term
msgctxt "Color"
msgid "Color"
msgstr "Kleur"

#. Common term (plural)
msgctxt "Colors"
msgid "Colors"
msgstr "Kleure"

#. Common term
msgctxt "Transparent"
msgid "Transparent"
msgstr "Deurskynend"

#. Common term
msgctxt "openHAB Item"
msgid "openHAB Item"
msgstr "openHAB Item"

#. Common term (e.g. tooltip in the dashboard header toolbar)
msgctxt "Speak"
msgid "Speak"
msgstr "Praat"

#. Common term (e.g. tooltip in the dashboard header toolbar)
msgctxt "Refresh"
msgid "Refresh"
msgstr "Herlaai"

#. Common term (e.g. tooltip in the dashboard header toolbar)
msgctxt "Fullscreen"
msgid "Fullscreen"
msgstr "Volskerm"

#. Common term
msgctxt "Help"
msgid "Help"
msgstr "Hulp"

#. Appears in a red background in the bottom of the screen when openHAB is not responding
msgctxt "error.connectionlost"
msgid "Connection lost! Trying to reconnect..."
msgstr "Het konneksie verloor! Besig om te probeer herkonnekteer..."

#. Appears below the edit mode button when there's no dashboard - please use the Chrome developer tools and check with phone resolutions: iPhone 6, Nexus 5 etc.!
msgctxt "tutorial.welcome"
msgid "Welcome to HABPanel!"
msgstr "Welkom by HABPanel!"

#. Appears below the edit mode button when there's no dashboard - please use the Chrome developer tools and check with phone resolutions: iPhone 6, Nexus 5 etc.!
msgctxt "tutorial.clickheretobegin"
msgid "Click or tap here to begin."
msgstr "Klik of druk hier om te begin."

#. Appears at the top of the screen when in edit mode and no dashboards are present
msgctxt "tutorial.editmode"
msgid "You're now in edit mode, where you can design dashboards."
msgstr "Jy is nou in edit mode, waar jy Dashboards kan ontwerp."

#. Hint for the bottom left link when in edit mode and no dashboards are present - please use the Chrome developer tools and check with phone resolutions: iPhone 6, Nexus 5 etc.!
msgctxt "tutorial.createfirstdashboard"
msgid "Click or tap here to create your first dashboard..."
msgstr "Klik of druk hier om jou eerste Dashboard te maak..."

#. Hint for the bottom right link when in edit mode and no dashboards are present - please use the Chrome developer tools and check with phone resolutions: iPhone 6, Nexus 5 etc.!
msgctxt "tutorial.importpanel"
msgid "...or here to restore a panel from the server"
msgstr "...of hier om jou Panel terug te laai van die server af"

#. Hint in the bottom left part of the page when in edit mode and only one dashboard is present - please use the Chrome developer tools and check with phone resolutions: iPhone 6, Nexus 5 etc.!
msgctxt "tutorial.enterdesigner"
msgid "Click or tap inside the tile to enter the dashboard designer."
msgstr "Klik of druk binne die Tile om die Dashboard Designer oop te maak."

#. Hint in the bottom center part of the page above the column number slider when in edit mode and only one dashboard is present - please use the Chrome developer tools and check with phone resolutions: iPhone 6, Nexus 5 etc.!
msgctxt "tutorial.adjustnbcolumns"
msgid "Adjust the number of columns"
msgstr "Verander die hoeveelheid kolomme"

#. Hint for the bottom left link when in edit mode and only one dashboard is present - please use the Chrome developer tools and check with phone resolutions: iPhone 6, Nexus 5 etc.!
msgctxt "tutorial.saveonserver"
msgid "Save on the openHAB server when done!"
msgstr "Stoor op die openHAB server wanneer jy klaar is!"

#. Displayed when no dashboard is present and editing is locked in the service configuration
msgctxt "tutorial.editingdisabled"
msgid "Editing is disabled on the server!"
msgstr "Veranderings is gedeaktiveer op die server!"

#. Displayed when no dashboard is present and editing is locked in the service configuration
msgctxt "tutorial.unlockedit"
msgid "Please go to Paper UI and unlock editing to use HABPanel on this device."
msgstr "Gaan asseblief op Paper UI en aktiveer veranderings om HABPanel op hierdie toestel te gebruik."

#. Label of the bottom-left link in edit mode - please also test with phone resolutions!
msgctxt "menu.addnewdashboard"
msgid "Add new dashboard"
msgstr "Voeg nuwe Dashboard by"

#. Label of the bottom-right link in edit mode - please also test with phone resolutions!
msgctxt "menu.panelsettings"
msgid "Panel settings"
msgstr "Panel instellings"

#. New dashboard dialog box title
msgctxt "menu.dialog.newdashboard.title"
msgid "New dashboard"
msgstr "Nuwe Dashboard"

#. New dashboard dialog box message
msgctxt "menu.dialog.newdashboard.message"
msgid "Name of your new dashboard:"
msgstr "Naam van jou nuwe Dashboard:"

#. Remove dashboard dialog box title
msgctxt "menu.dialog.removedashboard.title"
msgid "Remove dashboard"
msgstr "Verwyder Dashboard"

#. Remove dashboard dialog box message, followed by the dashboard id
msgctxt "menu.dialog.removedashboard.message"
msgid "Please confirm you want to delete this dashboard: "
msgstr "Is jy seker jy wil hierdie Dashboard permanent verwyder: "

#. Dashboard toolbar Speak button tooltip
msgctxt "dashboard.toolbar.speak"
msgid "Speak"
msgstr "Praat"

#. Dashboard toolbar Refresh button tooltip
msgctxt "dashboard.toolbar.refresh"
msgid "Refresh"
msgstr "Herlaai"

#. Dashboard toolbar Fullscreen button tooltip
msgctxt "dashboard.toolbar.fullscreen"
msgid "Fullscreen"
msgstr "Volskerm"

#. Displayed at the bottom after clicking on the Speak button
msgctxt "dashboard.speaknow"
msgid "Speak now..."
msgstr "Praat nou..."

#. Prefix of an error message, displayed at the bottom after clicking on the Speak button
msgctxt "dashboard.speakerror"
msgid "Error: "
msgstr "Error: "

{'repo_name': 'openhab/org.openhab.ui.habpanel', 'stars': '106', 'repo_language': 'HTML', 'file_name': 'MANIFEST.MF', 'mime_type': 'text/plain', 'hash': 5582519272963949765, 'source_dataset': 'data'}


package rfc

/*
 * ZLint Copyright 2020 Regents of the University of Michigan
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

import (
	"testing"

	"github.com/zmap/zlint/v2/lint"
	"github.com/zmap/zlint/v2/test"
)

func TestCRLDistribCrit(t *testing.T) {
	inputPath := "subCAWcrlDistCrit.pem"
	expected := lint.Warn
	out := test.TestLint("w_ext_crl_distribution_marked_critical", inputPath)
	if out.Status != expected {
		t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status)
	}
}

func TestCRLDistribNoCrit(t *testing.T) {
	inputPath := "subCAWcrlDistNoCrit.pem"
	expected := lint.Pass
	out := test.TestLint("w_ext_crl_distribution_marked_critical", inputPath)
	if out.Status != expected {
		t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status)
	}
}

{'repo_name': 'zmap/zlint', 'stars': '153', 'repo_language': 'Go', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': 391583078433973304, 'source_dataset': 'data'}


/*

Copyright (C) 1997,1998,1999,2000,2001  Franz Josef Och

mkcls - a program for making word classes .

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 2
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, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.

*/

#include <cstdlib>
#include <cstdio>
#include "KategProblem.h"
#include "KategProblemTest.h"

#include "ProblemTest.h"

extern double SigmaVerfaelschung;

double h_table[MAX_H_TABLE],l_table[MAX_H_TABLE],hmy_table[MAX_H_TABLE],hmy_sigma;

double LWRW_Faktor=0.5;

static int intcompare(const void *p,const void *j)
{
  return *(int *)p - *(int *)j;
}

KategProblem::KategProblem(int aw,int mak,int _initialisierung,int _auswertung,
	   int _nachbarschaft,int mindestAnzahl)
: Problem(mak,aw,_initialisierung,_auswertung,_nachbarschaft),
  sigmaVerfaelschung(SigmaVerfaelschung),katWasEmpty(0),nwg(mak+2),ngw(mak+2),_katOfWord(aw,-1),words(0),kats(0),
  wordFreq(aw,mindestAnzahl),katFreq(mak+2,(_auswertung==CRITERION_MY)?SigmaVerfaelschung:0.0),
  initLike(aw,-1)

{
  if( auswertung == CRITERION_MY )
    cout << "Sigma-Verfaelschung: " << sigmaVerfaelschung << endl;
  _maxComp=aw;
  _maxCompVal=mak;
  massert(katFreq.nKats>0);
  massert(mak<=aw);

  for(int i=1;i<MAX_H_TABLE;i++)
    {
      h_table[i]=i*log((double)(i));
      l_table[i]=log((double)(i));
      hmy_table[i]=i*log(verfaelsche(i,sigmaVerfaelschung));
    }
  hmy_sigma=sigmaVerfaelschung;
  l_table[0]=h_table[0]=0;

  if( katwahl()==K_BEST )
    _maxCompVal=1;

}

KategProblem::~KategProblem()

{
  delete words;
  delete kats;
}

void KategProblem::_initialize(int initTyp)
{
  _initialize(initTyp,-1);
}

void KategProblem::_initialize(int initTyp,int specialFixedWord)

{
  massert(wordFreq.filled);
  initialisierung = initTyp;
 	int i;

  for(i=0;i<katFreq.nKats;i++)
    for(int j=0;j<katFreq.nKats;j++)
      katFreq.setN(i,j,0);

  for(i=0;i<wordFreq.nWords;i++)
    {
      setKatOfWord(i,-1);
      if( strcmp(getString(i),"$")==0||strcmp(getString(i),"1$")==0||strcmp(getString(i),"2$")==0||strcmp(getString(i),"3$")==0||strcmp(getString(i),"4$")==0 )
	wordFreq.setDollar(i);
    }
  wordFreq.init(specialFixedWord);

  _maxComp=wordFreq.nTranspWords;

  switch(initTyp)
    {
    case INIT_OTHER:

      if(verboseMode>2)cout << "KategProblem::_initialize(INIT_OTHER)\n";
      for(i=0;i<wordFreq.nWords;i++)
	fastPutWord(i,initLike[i]);
      break;
    case INIT_RAN:

      if(verboseMode>2)cout << "KategProblem::_initialize(INIT_RAN)\n";
      for(i=0;i<wordFreq.nWords;i++)
	{
	  if( wordFreq.minIndex[i]>0 && wordFreq.maxIndex[i]>0 )
	    fastPutWord(i,wordFreq.minIndex[i]+randomInt(wordFreq.maxIndex[i]-wordFreq.minIndex[i]+1));
	  else
	    fastPutWord(i,2+randomInt(katFreq.nKats-2));
	}

      break;
    case INIT_AIO:

      if(verboseMode>2)cout << "KategProblem::_initialize(INIT_AIO)\n";
      for(i=0;i<wordFreq.nWords;i++)
	fastPutWord(i,2);
      break;
    case INIT_FREQ:

      if(verboseMode>2)cout << "KategProblem::_initialize(INIT_FREQ)\n";
      for(i=0;i<wordFreq.nWords;i++)
	{
	  int to=i+2;
	  if( to>=katFreq.nKats )
	    to=katFreq.nKats-1;
	  fastPutWord((*(wordFreq.absteigend))[i],to);
	}
      curComp=katFreq.nKats-2;
      break;
    case INIT_LWRW:

      {
	Array<int> markList(wordFreq.nWords,1);
	int to=2;
	int i=0;
	if(verboseMode>2)cout << "KategProblem::_initialize(INIT_LWRW)\n";
	for(to=2;to<katFreq.nKats*LWRW_Faktor;to++)
	  {
	    int w=(*(wordFreq.absteigend))[to-2];
	    fastPutWord(w,to);
	    markList[w]=0;
	  }
	while(to<katFreq.nKats-1 && i<wordFreq.nWords)
	  {
	    int toFilled=0;
	    int word=(*(wordFreq.absteigend))[i];
	    if(i%2)
	      {
		ManyFreq &after=wordFreq.after[word];
		for(int j=0;j<after.size();j++)
		  {
		    int w=after[j].w;
		    if( markList[w] )
		      fastPutWord(w,to),toFilled++;
		    markList[w]=0;
		  }
	      }
	    else
	      {
		ManyFreq &before=wordFreq.before[word];
		for(int j=0;j<before.size();j++)
		  {
		    int w=before[j].w;
		    if( markList[w] )
		      fastPutWord(w,to),toFilled++;
		    markList[w]=0;
		  }
	      }
	    i++;
	    if( toFilled>0 )
	      to++;
	  }
	for(i=0;i<wordFreq.nWords;i++)
	  if(markList[i])
	    fastPutWord(i,katFreq.nKats-1);
      }
      break;
    default:
      cerr << "Wrong _initialize in KategProblem: " << initTyp << endl;
      exit(1);
    }

  for(int word=0;word<wordFreq.nWords;word++)
    {
      Array<OneFreq>& aft=wordFreq.after[word];

      int nAft=aft.size();

      for(i=0;i<nAft;i++)
	katFreq.addN(katOfWord(word),katOfWord(aft[i].w),aft[i].n);
    }

  if(verboseMode>2)
    {
      cout << "\nInitialization of KategProblem:";
      dumpOn(cout);
    }
}

double KategProblem::valueChange(ProblemChange&c)

{
  numberOfPartEvaluations++;
  KategProblemChange &k=*(KategProblemChange *)&c;
  fillNWG(k.word);

  return _valueChange(k);
}

Problem *KategProblem::makeEqualProblem()

{
  KategProblem*p = new KategProblem(wordFreq.nWords,katFreq.nKats-2,initialisierung,
                    auswertung,nachbarschaft);
  KategProblemWBC &w=p->wordFreq;
  for(int x=0;x<wordFreq.nWords;x++)
    {
      w.setAfterWords(x,wordFreq.after[x].size());
      w.setBeforeWords(x,wordFreq.before[x].size());
    }
	int i;
  for(i=0;i<wordFreq.nWords;i++)
    {
      for(int j=0;j<wordFreq.after[i].size();j++)
	w.setFreq(i,wordFreq.after[i][j].w,wordFreq.after[i][j].n);
    }
  w.testFull();
  w.mindestAnzahl = wordFreq.mindestAnzahl;
  if(words)
    p->words = new leda_array<string>(*words);
  for(i=0;i<wordFreq.nWords;i++)
    {
      p->setKatOfWord(i,katOfWord(i));
      p->initLike[i]=initLike[i];
    }
  p->setValuesFrom(this);
  return p;
}

double KategProblem::nicevalue(double val)

{
  double v;
  if( val!=1e100)
    v=val;
  else
    v=value();
  double h=wordFreq.get_h_of_words();
  double n=wordFreq.numberOfWords();
  double k=0;
  if(auswertung == CRITERION_MY)
    k=katFreq.myCriterionTerm();
  return exp((v+h-k)/n);
}

void KategProblem::makeKats()

{
  if(kats)delete kats;
  kats = new leda_array<intSet>(katFreq.nKats);
  for(int i=0;i<wordFreq.nWords;i++)
    (*kats)[katOfWord(i)].insert(i);
}

void KategProblem::dumpInfos(ostream &strm)

{
  strm << ";KategProblem:";
  strm << "cats: " << katFreq.nKats-2 << "   words: " << wordFreq.nWords
    << endl;
}

void KategProblem::dumpOn(ostream &strm)

{
  writeClasses(_katOfWord,*this,strm);
  if(PrintBestTo2)
    {
      dumpInfos(*PrintBestTo2);
      makeKats();
      if( kats==0 )
	{
	  if( words==0 )
	    {
	      for(int i=0;i<wordFreq.nWords;i++)
		{
		  *PrintBestTo2 << i << ":" << katOfWord(i) << " ";
		}
	    }
	  else
	    {
	      for(int i=0;i<wordFreq.nWords;i++)
			*PrintBestTo2 << (*words)[i] << ":" << katOfWord(i) << " ";
	    }
	}
      else
	{
	  int anzkat=0;
	  for(int i=0;i<katFreq.nKats;i++)
	    {
	      int printed=0;
	      *PrintBestTo2  << i << ":";
	      leda_set<int>&theSet = (*kats)[i];
	      if( words==0 )
		{
		  int nr=0;
		  forall_set(leda_set<int>,nr,theSet)
		    {
		      *PrintBestTo2 << nr << ", ";
		      printed=1;
		    }
		}
	      else
		{
		  int nr=0;
		  forall_set(leda_set<int>,nr,theSet)
		    {
		      *PrintBestTo2 << (*words)[nr]<< ",";
		      printed=1;
		    }
		}
	      if(printed==1)anzkat++;
	      *PrintBestTo2 << endl;
	    }
	  *PrintBestTo2 << ";I have " << anzkat << " categories used.\n";
	}
      *PrintBestTo2 << endl;
      Problem::dumpOn(*PrintBestTo2);
    }
}

const char *KategProblem::getString(int i)

{
  if(words==0)
    return "<>";
  else
    return ((*words)[i]).c_str();
}

string KategProblem::getTheString(int i)
{
  return (*words)[i];
}

int KategProblem::maxNonBetterIterations()

{
  if(katwahl()==K_BEST)
    return wordFreq.nTranspWords;
  else
    return katFreq.nKats*wordFreq.nTranspWords;
}

int KategProblem::expectedNumberOfIterations()

{

  if(katwahl()==K_BEST)
    return 10*wordFreq.nTranspWords;
  else
    return 13*katFreq.nKats*wordFreq.nTranspWords;
}

void KategProblem::makeTitle(char x[512])

{
  char *ww;
  char *kw;
  char *in;
  switch(wortwahl())
    {
    case W_RAN:
      ww="zufaellig";
      break;
    case W_DET_DECR:
      ww="absteigend";
      break;
    case W_DET_INCR:
      ww="aufsteigend";
      break;
    default:
      cerr << "Error: unknown word selection\n";
      exit(1);
    }
  switch(katwahl())
    {
    case K_DET:
      kw="rotierend";
      break;
    case K_RAN:
      kw="zufaellig";
      break;
    case K_BEST:
      kw="best     ";
      break;
    default:
      cout << "Error: unknown cagegory selection\n";
      exit(1);
    }
  switch(initialisierung)
    {
    case INIT_RAN:
      in="zufaellig ";
      break;
    case INIT_AIO:
      in="all-in-one";
      break;
    case INIT_LWRW:
      in="lwrw      ";
      break;
    case INIT_FREQ:
      in="freq      ";
      break;
    case INIT_OTHER:
      in="other     ";
      break;
    default:
      cout << "Error: unknown initialization\n";
      exit(1);
    }
  sprintf(x,"(c:%d,w:%d(%d),ww:%s,kw:%s,in:%s)",katFreq.nKats,wordFreq.nWords,
	  wordFreq.nTranspWords,ww,kw,in);
}

int KategProblem::_change(ProblemChange **p)

{
  *p=0;
  int word=curDimension();
  switch( wortwahl() )
    {
    case W_RAN:
      word=(*(wordFreq.absteigend))[randomInt(wordFreq.nTranspWords)];
      break;
    case W_DET_DECR:
      word=(*(wordFreq.absteigend))[word];
      break;
    case W_DET_INCR:
      word=(*(wordFreq.absteigend))[wordFreq.nTranspWords-word-1];
      break;
    default:
      cerr << "Error: Unknown word selection\n";
      exit(1);
    }

  int kat=curDimensionVal()+2;
  switch( katwahl() )
    {
    case K_RAN:
      kat=randomInt(katFreq.nKats-2)+2;

    case K_DET:

      if( kat==katOfWord(word)||(katWasEmpty&&katFreq.n1(kat)==0) )
	return 0;
      else if( wordFreq.minIndex[word]>0 && wordFreq.maxIndex[word]>0 && (kat<wordFreq.minIndex[word]||kat>wordFreq.maxIndex[word]))
	{

	  return 0;
	}
      else
	{
	  KategProblemChange *c = new KategProblemChange;
	  c->toKat=kat;
	  c->word=word;
	  c->fromKat=katOfWord(c->word);
	  massert( c->toKat < katFreq.nKats );
	  massert( c->fromKat < katFreq.nKats );
	  massert( c->word < wordFreq.nWords );
	  massert( c->toKat!=0   && c->toKat!=1 );
	  massert( c->fromKat!=0 && c->fromKat!=1 );
	  if(katFreq.n1(kat)==0)
	    katWasEmpty=1;
	  *p=c;
	  return 1;
	}
      break;
    case K_BEST:
      {
	fillNWG(word);
	double smallest=1e100;
	KategProblemChange &smallestChange = *new KategProblemChange;
	short withEmpty=0;

	int startKat=2;
	int endKat=katFreq.nKats;
	if( wordFreq.minIndex[word]>0&&wordFreq.maxIndex[word]>0 )
	  {
	    startKat = max(2,wordFreq.minIndex[word]);
	    endKat = min(katFreq.nKats,wordFreq.maxIndex[word]+1);
	  }
	for(kat=startKat;kat<endKat;kat++)
	  {
	    if( kat!=katOfWord(word) && (withEmpty==0 || katFreq.n1(kat)
					 || katFreq.n2(kat)) )
	      {
		KategProblemChange c;
		c.toKat=kat;
		c.word=word;
		c.fromKat=katOfWord(word);
		double n=_valueChange(c);
		if(n<smallest)
		  {
		    smallest=n;
		    smallestChange=c;
		  }
	      }
	    if( katFreq.n1(kat)==0 && katFreq.n2(kat)==0 )
	      withEmpty=1;
	  }
	massert(smallest!=1e100);
	*p= &smallestChange;
	return 1;
      }
      break;
    default:
      cerr << "Error: Unknown category selection\n";
      exit(1);
      return 0;
    }
}

void KategProblem::_doChange(ProblemChange &c)

{
  KategProblemChange &k=*(KategProblemChange *)&c;
  putWord(k.word,k.toKat);

}

void KategProblem::_undoChange(ProblemChange &c)

{
  KategProblemChange &k=*(KategProblemChange *)&c;
  putWord(k.word,k.fromKat);

}

void KategProblem::incrementDirection()

{
  Problem::incrementDirection();
  katWasEmpty=0;
  massert( _maxComp==wordFreq.nTranspWords );
}

double KategProblem::_value()

{

  return katFreq.fullBewertung(auswertung);
}

double mkat_h_full(int n,double tf)
{

  if( tf>0 )
    return n*log(tf);
  else
    return 0.0;
}

double mkat_h_part(int n,double cf)
{

  if( cf>0.0 )
    return n*log(cf);
  else
    return 0.0;
}

double KategProblem::kat_h_full(int n)
{
  return mkat_h_full(n,verfaelsche(n,sigmaVerfaelschung));
}
double KategProblem::kat_h_full(double n)
{
  abort();
  return mkat_h_full((int)n,verfaelsche(n,sigmaVerfaelschung));
}

double KategProblem::kat_h_part(int n)
{
  return mkat_h_part(n,verfaelsche(n,sigmaVerfaelschung));
}
double KategProblem::kat_h_part(double n)
{
  abort();
  return mkat_h_part((int)n,verfaelsche(n,sigmaVerfaelschung));
}

double KategProblem::nmo_my(int i,int j)

{
  FreqType n=nstrich(i,j),k=katFreq.n(i,j);
  return kat_h_full(n+k)-kat_h_full(k);
}
double KategProblem::nmo(int i,int j)

{
  FreqType n=nstrich(i,j),k=katFreq.n(i,j);
  return kat_h(n+k)-kat_h(k);
}
double KategProblem::nmo_lo(int i,int j,int &e0,int &e1)

{
  FreqType kij=katFreq.n(i,j);
  FreqType nij=nstrich(i,j)+kij;
  if( kij!=nij)
    {
      if( nij==0 )
	e0++;
      else if(nij==1)
	e1++;
      if( kij==0 )
	e0--;
      else if(kij==1)
	e1--;
    }
  return nij*kat_mlog(nij-1-rhoLo)-kij*kat_mlog(kij-1-rhoLo);
}

double KategProblem::_valueChange(KategProblemChange &k)

{
  double v=0;
  int i=0;

  ursprung=k.fromKat;
  ziel=k.toKat;

  if( auswertung==CRITERION_LO )
    {
      int e0a=katFreq.eta0,e1a=katFreq.eta1;
      v-=nmo_lo(ursprung,ursprung,e0a,e1a)+nmo_lo(ziel,ziel,e0a,e1a)
	+nmo_lo(ursprung,ziel,e0a,e1a)+nmo_lo(ziel,ursprung,e0a,e1a);
      i=0;
      while(i<nwg.anzNot0)
	{
	  int cl=nwg.not0[i];
	  if( cl!= ursprung && cl!=ziel )
	    v -= nmo_lo(ursprung,cl,e0a,e1a)+nmo_lo(ziel,cl,e0a,e1a);
	  i++;
	}
      i=0;
      while(i<ngw.anzNot0)
	{
	  int cl=ngw.not0[i];
	  if( cl!= ursprung && cl!=ziel )
	    v -= nmo_lo(cl,ursprung,e0a,e1a)+nmo_lo(cl,ziel,e0a,e1a);
	  i++;
	}

      v+=kat_hlo(katFreq.n1(ursprung)-wordFreq.n1(k.word))
	-kat_hlo(katFreq.n1(ursprung))
	+kat_hlo(katFreq.n2(ursprung)-wordFreq.n2(k.word))
	-kat_hlo(katFreq.n2(ursprung))
        +kat_hlo(katFreq.n1(ziel)+wordFreq.n1(k.word))
	-kat_hlo(katFreq.n1(ziel))
	+kat_hlo(katFreq.n2(ziel)+wordFreq.n2(k.word))
	-kat_hlo(katFreq.n2(ziel));

      int old0=katFreq.c1_0*katFreq.nKats+katFreq.c2_0*katFreq.nKats
	      -katFreq.c1_0*katFreq.c2_0;
      int nc1_0=katFreq.c1_0,nc2_0=katFreq.c2_0;
      if( wordFreq.n1(k.word)>0 && katFreq.n1(ursprung)==wordFreq.n1(k.word) )
	nc1_0++;
      if( wordFreq.n2(k.word)>0 && katFreq.n2(ursprung)==wordFreq.n2(k.word) )
	nc2_0++;
      if( wordFreq.n1(k.word)>0 && katFreq.n1(ziel)==0 ) nc1_0--;
      if( wordFreq.n2(k.word)>0 && katFreq.n2(ziel)==0 ) nc2_0--;
      int new0=nc1_0*katFreq.nKats+nc2_0*katFreq.nKats-nc1_0*nc2_0;
      v-=kat_etaFkt(e0a,e1a,new0,katFreq.nKats)
	-kat_etaFkt(katFreq.eta0,katFreq.eta1,old0,katFreq.nKats);
      vassert(NULLFLOAT(Problem::valueChange(k)-v));
    }
  else if(auswertung==CRITERION_ML)
    {
      v-=nmo(ursprung,ursprung)+nmo(ziel,ziel)
	+nmo(ursprung,ziel)+nmo(ziel,ursprung);
      i=0;
      while(i<nwg.anzNot0)
	{
	  int cl=nwg.not0[i];
	  if( cl!= ursprung && cl!=ziel )
	      v -= nmo(ursprung,cl)+nmo(ziel,cl);
	  i++;
	}
      i=0;
      while(i<ngw.anzNot0)
	{
	  int cl=ngw.not0[i];
	  if( cl!= ursprung && cl!=ziel )
	    v -= nmo(cl,ursprung)+nmo(cl,ziel);
	  i++;
	}
      v+=kat_h(katFreq.n1(ursprung)-wordFreq.n1(k.word))
	-kat_h(katFreq.n1(ursprung))
        +kat_h(katFreq.n2(ursprung)-wordFreq.n2(k.word))
	-kat_h(katFreq.n2(ursprung))
	+kat_h(katFreq.n1(ziel)+wordFreq.n1(k.word))
        -kat_h(katFreq.n1(ziel))
	+kat_h(katFreq.n2(ziel)+wordFreq.n2(k.word))
        -kat_h(katFreq.n2(ziel));
    }
  else if( auswertung==CRITERION_MY )
    {
      v-=nmo_my(ursprung,ursprung)+nmo_my(ziel,ziel)
	+nmo_my(ursprung,ziel)+nmo_my(ziel,ursprung);
      i=0;
      while(i<nwg.anzNot0)
	{
	  int cl=nwg.not0[i];
	  if( cl!= ursprung && cl!=ziel )
	      v -= nmo_my(ursprung,cl)+nmo_my(ziel,cl);
	  i++;
	}
      i=0;
      while(i<ngw.anzNot0)
	{
	  int cl=ngw.not0[i];
	  if( cl!= ursprung && cl!=ziel )
	    v -= nmo_my(cl,ursprung)+nmo_my(cl,ziel);
	  i++;
	}
      v+=kat_h_part(katFreq.n1(ursprung)-wordFreq.n1(k.word))
	-kat_h_part(katFreq.n1(ursprung))
        +kat_h_part(katFreq.n2(ursprung)-wordFreq.n2(k.word))
	-kat_h_part(katFreq.n2(ursprung))
	+kat_h_part(katFreq.n1(ziel)+wordFreq.n1(k.word))
        -kat_h_part(katFreq.n1(ziel))
	+kat_h_part(katFreq.n2(ziel)+wordFreq.n2(k.word))
        -kat_h_part(katFreq.n2(ziel));
      double bishZusatz = katFreq.myCriterionTerm();
      _doChange(k);
      double neuZusatz = katFreq.myCriterionTerm();
      _undoChange(k);
      if(verboseMode>2)
	cout << "ZUSATZ: " << bishZusatz << " " << neuZusatz << " " <<neuZusatz-bishZusatz<<"  " << v <<  endl;
      v+=neuZusatz-bishZusatz;
    }
  else
    {
      cerr << "Fatal error: Unknown criterion: '"<<auswertung<<"'\n";
    }
  vassert( NULLFLOAT(Problem::valueChange(k)-v) );
  return v;
}

void KategProblem::fillNWG(int w)

{
  if(nwgWord==w)
    return;
  else
    {
      Array<OneFreq> &after=wordFreq.after[w];
      int size=after.size(),i;
      nww=0;
      nwg.init();
      for(i=0;i<size;i++)
	{
	  nwg.addFreq(katOfWord(after[i].w),after[i].n);
	  if(after[i].w==w)
	    nww=after[i].n;
	}

      Array<OneFreq> &before=wordFreq.before[w];
      size=before.size();
      ngw.init();
      for(i=0;i<size;i++)
	ngw.addFreq(katOfWord(before[i].w),before[i].n);
      nwgWord=w;
    }
}

void KategProblem::vnstrich(int i,int j)

{
  cout << ".) " << katFreq.n(i,j) << " ";
  if( i==ursprung )
    cout << "a) "<<-nwg.getFreq(j) << " ";
  if( i==ziel )
    cout << "b) " <<nwg.getFreq(j) << " ";

  if( j==ursprung )
    cout << "c) " <<-ngw.getFreq(i) << " ";
  if( j==ziel )
    cout << "d) " <<+ngw.getFreq(i) << " " ;

  if( i==ursprung && j==ursprung )
    cout << "e) " <<+nww << " ";
  if( i==ziel && j==ziel )
    cout << "f) " <<+nww << " " ;
  if( i==ursprung && j==ziel )
    cout << "g) " <<-nww << " ";
  if( i==ziel && j==ursprung )
    cout << "h) " <<-nww << " ";
}

void KategProblem::fastPutWord(int word,int toKat)

{
  massert(toKat>=0 && toKat<katFreq.nKats);

  if( wordFreq.fixedWord[word]>=0 )
    toKat=wordFreq.fixedWord[word];
  massert(katOfWord(word)==-1);
  setKatOfWord(word,toKat);
}

void KategProblem::fixInitLike()
{
  int fixed=0,fixed2=0;
  over_arr(initLike,i)
    if(initLike[i]>=0 )
      {
	fixed++;
	if( initLike[i]>=wordFreq.minIndex[i] || initLike[i]==1 )
	  wordFreq.fixedWord[i]=initLike[i];
	else
	  {
	    wordFreq.fixedWord[i]=wordFreq.minIndex[i]+initLike[i]-2;
	    fixed2++;
	  }
	initLike[i]=-1;
      }
  cout << "Fixed from file are: " << fixed << " " << fixed2 << " words.\n";
}

void KategProblem::putWord(int word,int toKat)

{
  massert(toKat!=0);massert(toKat!=1);
  massert(word<wordFreq.nWords);
  massert(toKat<katFreq.nKats);
  massert(wordFreq.fixedWord[word]<0);
  int k=katOfWord(word);
  massert(k!=0&&k!=1);
  Array<OneFreq>& aft=wordFreq.after[word];
  Array<OneFreq>& bef=wordFreq.before[word];
  int nAft=aft.size();
  int nBef=bef.size();
  int i;
  if(verboseMode>4)
    cout << "putWord(" << word << "," << toKat << ")" << k << " nAft"
      << nAft << " nBef" << nBef << " k" << k << "\n";

  massert( k!=-1 );
  massert( k!=toKat );

  for(i=0;i<nAft;i++)
    {
      katFreq.addN(k,katOfWord(aft[i].w),-aft[i].n);
      if(verboseMode>4)
	cout << k << " " << katOfWord(aft[i].w) << " " << -aft[i].n << endl;
    }
  for(i=0;i<nBef;i++)
    if( bef[i].w!=word )
      {
	katFreq.addN(katOfWord(bef[i].w),k,-bef[i].n);
	if(verboseMode>4)
	  cout << katOfWord(bef[i].w) << " " << k << " " << -bef[i].n << endl;
      }

  setKatOfWord(word,toKat);

  for(i=0;i<nAft;i++)
    katFreq.addN(toKat,katOfWord(aft[i].w),aft[i].n);
  for(i=0;i<nBef;i++)
    if( bef[i].w!=word )
      katFreq.addN(katOfWord(bef[i].w),toKat,bef[i].n);

}

static KategProblemChange theOneKategProblemChange;
static int anzKategProblemChange=0;

void *KategProblemChange::operator new(size_t size)
{
  anzKategProblemChange++;
  massert(anzKategProblemChange>0);
  massert(anzKategProblemChange<2);
  if( anzKategProblemChange==1 )
    return &theOneKategProblemChange;
  else
    {
      if( verboseMode>1 )
	cout << "generate instance of KategProblemChange: " << size
	  << " " << anzKategProblemChange<<  endl;
      return malloc(size);
    }
}
void KategProblemChange::operator delete(void *ptr,size_t
)
{ massert(size==sizeof(KategProblemChange));
  anzKategProblemChange--;
  if( ptr!= &theOneKategProblemChange)
    free(ptr);
}

NWG::NWG(int n) : freq(n,0),timeOfFreq(n,0),not0(n),word(-1)
{
  massert(n>0);
  curTime=1;
  init();
}

void NWG::init()
{
  curTime++;
  anzNot0=0;
}

void NWG::sort()
{
  qsort(not0.getPointerToData(),anzNot0,sizeof(int),intcompare);
  massert(anzNot0<=not0.size());
}

int KategProblem::maxDimension()
{
  return _maxComp;
}

int KategProblem::maxDimensionVal()
{
  return _maxCompVal;
}

{'repo_name': 'moses-smt/mgiza', 'stars': '117', 'repo_language': 'C++', 'file_name': 'implement.h', 'mime_type': 'text/x-c', 'hash': -9053355624628066202, 'source_dataset': 'data'}


/*
 * 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 2
 * 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, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Copyright 2011, Blender Foundation.
 */

#pragma once

#include "DNA_color_types.h"
#include "DNA_node_types.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Keep ascii art. */
/* clang-format off */
/**
 * \defgroup Model The data model of the compositor
 * \defgroup Memory The memory management stuff
 * \defgroup Execution The execution logic
 * \defgroup Conversion Conversion logic
 * \defgroup Node All nodes of the compositor
 * \defgroup Operation All operations of the compositor
 *
 * \page Introduction of the Blender Compositor
 *
 * \section bcomp Blender compositor
 * This project redesigns the internals of Blender's compositor.
 * The project has been executed in 2011 by At Mind.
 * At Mind is a technology company located in Amsterdam, The Netherlands.
 * The project has been crowd-funded. This code has been released under GPL2 to be used in Blender.
 *
 * \section goals The goals of the project
 * the new compositor has 2 goals.
 *   - Make a faster compositor (speed of calculation)
 *   - Make the compositor work faster for you (workflow)
 *
 * \section speed Faster compositor
 * The speedup has been done by making better use of the hardware Blenders is working on.
 * The previous compositor only used a single threaded model to calculate a node.
 * The only exception to this is the Defocus node.
 * Only when it is possible to calculate two full nodes in parallel a second thread was used.
 * Current workstations have 8-16 threads available, and most of the time these are idle.
 *
 * In the new compositor we want to use as much of threads as possible.
 * Even new OpenCL capable GPU-hardware can be used for calculation.
 *
 * \section workflow Work faster
 * The previous compositor only showed the final image.
 * The compositor could wait a long time before seeing the result of his work.
 * The new compositor will work in a way that it will focus on
 * getting information back to the user. It will prioritize its work to get earlier user feedback.
 *
 * \page memory Memory model
 * The main issue is the type of memory model to use.
 * Blender is used by consumers and professionals.
 * Ranging from low-end machines to very high-end machines.
 * The system should work on high-end machines and on low-end machines.
 * \page executing Executing
 * \section prepare Prepare execution
 *
 * during the preparation of the execution All ReadBufferOperation will receive an offset.
 * This offset is used during execution as an optimization trick
 * Next all operations will be initialized for execution \see NodeOperation.initExecution
 * Next all ExecutionGroup's will be initialized for execution \see ExecutionGroup.initExecution
 * this all is controlled from \see ExecutionSystem.execute
 *
 * \section priority Render priority
 * Render priority is an priority of an output node.
 * A user has a different need of Render priorities of output nodes
 * than during editing.
 * for example. the Active ViewerNode has top priority during editing,
 * but during rendering a CompositeNode has.
 * All NodeOperation has a setting for their render-priority,
 * but only for output NodeOperation these have effect.
 * In ExecutionSystem.execute all priorities are checked.
 * For every priority the ExecutionGroup's are check if the
 * priority do match.
 * When match the ExecutionGroup will be executed (this happens in serial)
 *
 * \see ExecutionSystem.execute control of the Render priority
 * \see NodeOperation.getRenderPriority receive the render priority
 * \see ExecutionGroup.execute the main loop to execute a whole ExecutionGroup
 *
 * \section order Chunk order
 *
 * When a ExecutionGroup is executed, first the order of chunks are determined.
 * The settings are stored in the ViewerNode inside the ExecutionGroup.
 * ExecutionGroups that have no viewer-node,
 * will use a default one.
 * There are several possible chunk orders
 *  - [@ref OrderOfChunks.COM_TO_CENTER_OUT]:
 *    Start calculating from a configurable point and order by nearest chunk.
 *  - [@ref OrderOfChunks.COM_TO_RANDOM]:
 *    Randomize all chunks.
 *  - [@ref OrderOfChunks.COM_TO_TOP_DOWN]:
 *    Start calculation from the bottom to the top of the image.
 *  - [@ref OrderOfChunks.COM_TO_RULE_OF_THIRDS]:
 *    Experimental order based on 9 hot-spots in the image.
 *
 * When the chunk-order is determined, the first few chunks will be checked if they can be scheduled.
 * Chunks can have three states:
 *  - [@ref ChunkExecutionState.COM_ES_NOT_SCHEDULED]:
 *    Chunk is not yet scheduled, or dependencies are not met.
 *  - [@ref ChunkExecutionState.COM_ES_SCHEDULED]:
 *    All dependencies are met, chunk is scheduled, but not finished.
 *  - [@ref ChunkExecutionState.COM_ES_EXECUTED]:
 *    Chunk is finished.
 *
 * \see ExecutionGroup.execute
 * \see ViewerOperation.getChunkOrder
 * \see OrderOfChunks
 *
 * \section interest Area of interest
 * An ExecutionGroup can have dependencies to other ExecutionGroup's.
 * Data passing from one ExecutionGroup to another one are stored in 'chunks'.
 * If not all input chunks are available the chunk execution will not be scheduled.
 *

 * +-------------------------------------+              +--------------------------------------+
 * | ExecutionGroup A                    |              | ExecutionGroup B                     |
 * | +----------------+  +-------------+ |              | +------------+   +-----------------+ |
 * | | NodeOperation a|  | WriteBuffer | |              | | ReadBuffer |   | ViewerOperation | |
 * | |                *==* Operation   | |              | | Operation  *===*                 | |
 * | |                |  |             | |              | |            |   |                 | |
 * | +----------------+  +-------------+ |              | +------------+   +-----------------+ |
 * |                                |    |              |   |                                  |
 * +--------------------------------|----+              +---|----------------------------------+
 *                                  |                       |
 *                                  |                       |
 *                                +---------------------------+
 *                                | MemoryProxy               |
 *                                | +----------+  +---------+ |
 *                                | | Chunk a  |  | Chunk b | |
 *                                | |          |  |         | |
 *                                | +----------+  +---------+ |
 *                                |                           |
 *                                +---------------------------+
 *

 *
 * In the above example ExecutionGroup B has an outputoperation (ViewerOperation)
 * and is being executed.
 * The first chunk is evaluated [@ref ExecutionGroup.scheduleChunkWhenPossible],
 * but not all input chunks are available.
 * The relevant ExecutionGroup (that can calculate the missing chunks; ExecutionGroup A)
 * is asked to calculate the area ExecutionGroup B is missing.
 * [@ref ExecutionGroup.scheduleAreaWhenPossible]
 * ExecutionGroup B checks what chunks the area spans, and tries to schedule these chunks.
 * If all input data is available these chunks are scheduled [@ref ExecutionGroup.scheduleChunk]
 *
 *

 *
 * +-------------------------+        +----------------+                           +----------------+
 * | ExecutionSystem.execute |        | ExecutionGroup |                           | ExecutionGroup |
 * +-------------------------+        | (B)            |                           | (A)            |
 *            O                       +----------------+                           +----------------+
 *            O                                |                                            |
 *            O       ExecutionGroup.execute   |                                            |
 *            O------------------------------->O                                            |
 *            .                                O                                            |
 *            .                                O-------\                                    |
 *            .                                .       | ExecutionGroup.scheduleChunkWhenPossible
 *            .                                .  O----/ (*)                                |
 *            .                                .  O                                         |
 *            .                                .  O                                         |
 *            .                                .  O  ExecutionGroup.scheduleAreaWhenPossible|
 *            .                                .  O---------------------------------------->O
 *            .                                .  .                                         O----------\ ExecutionGroup.scheduleChunkWhenPossible
 *            .                                .  .                                         .          | (*)
 *            .                                .  .                                         .  O-------/
 *            .                                .  .                                         .  O
 *            .                                .  .                                         .  O
 *            .                                .  .                                         .  O-------\ ExecutionGroup.scheduleChunk
 *            .                                .  .                                         .  .       |
 *            .                                .  .                                         .  .  O----/
 *            .                                .  .                                         .  O<=O
 *            .                                .  .                                         O<=O
 *            .                                .  .                                         O
 *            .                                .  O<========================================O
 *            .                                .  O                                         |
 *            .                                O<=O                                         |
 *            .                                O                                            |
 *            .                                O                                            |
 *

 *
 * This happens until all chunks of (ExecutionGroup B) are finished executing or the user break's the process.
 *
 * NodeOperation like the ScaleOperation can influence the area of interest by reimplementing the
 * [@ref NodeOperation.determineAreaOfInterest] method
 *
 *

 *
 * +--------------------------+                             +---------------------------------+
 * | ExecutionGroup A         |                             | ExecutionGroup B                |
 * |                          |                             |                                 |
 * +--------------------------+                             +---------------------------------+
 *           Needed chunks from ExecutionGroup A               |   Chunk of ExecutionGroup B (to be evaluated)
 *            +-------+ +-------+                              |                  +--------+
 *            |Chunk 1| |Chunk 2|               +----------------+                |Chunk 1 |
 *            |       | |       |               | ScaleOperation |                |        |
 *            +-------+ +-------+               +----------------+                +--------+
 *
 *            +-------+ +-------+
 *            |Chunk 3| |Chunk 4|
 *            |       | |       |
 *            +-------+ +-------+
 *
 *

 *
 * \see ExecutionGroup.execute Execute a complete ExecutionGroup.
 * Halts until finished or breaked by user
 * \see ExecutionGroup.scheduleChunkWhenPossible Tries to schedule a single chunk,
 * checks if all input data is available. Can trigger dependent chunks to be calculated
 * \see ExecutionGroup.scheduleAreaWhenPossible
 * Tries to schedule an area. This can be multiple chunks
 * (is called from [@ref ExecutionGroup.scheduleChunkWhenPossible])
 * \see ExecutionGroup.scheduleChunk Schedule a chunk on the WorkScheduler
 * \see NodeOperation.determineDependingAreaOfInterest Influence the area of interest of a chunk.
 * \see WriteBufferOperation Operation to write to a MemoryProxy/MemoryBuffer
 * \see ReadBufferOperation Operation to read from a MemoryProxy/MemoryBuffer
 * \see MemoryProxy proxy for information about memory image
 * (a image consist out of multiple chunks)
 * \see MemoryBuffer Allocated memory for a single chunk
 *
 * \section workscheduler WorkScheduler
 * the WorkScheduler is implemented as a static class. the responsibility of the WorkScheduler
 * is to balance WorkPackages to the available and free devices.
 * the work-scheduler can work in 2 states.
 * For witching these between the state you need to recompile blender
 *
 * \subsection multithread Multi threaded
 * Default the work-scheduler will place all work as WorkPackage in a queue.
 * For every CPUcore a working thread is created.
 * These working threads will ask the WorkScheduler if there is work
 * for a specific Device.
 * the work-scheduler will find work for the device and the device
 * will be asked to execute the WorkPackage.
 *
 * \subsection singlethread Single threaded
 * For debugging reasons the multi-threading can be disabled.
 * This is done by changing the COM_CURRENT_THREADING_MODEL
 * to COM_TM_NOTHREAD. When compiling the work-scheduler
 * will be changes to support no threading and run everything on the CPU.
 *
 * \section devices Devices
 * A Device within the compositor context is a Hardware component that can used to calculate chunks.
 * This chunk is encapsulated in a WorkPackage.
 * the WorkScheduler controls the devices and selects the device where a
 * WorkPackage will be calculated.
 *
 * \subsection WS_Devices Workscheduler
 * The WorkScheduler controls all Devices.
 * When initializing the compositor the WorkScheduler selects all
 * devices that will be used during compositor.
 * There are two types of Devices, CPUDevice and OpenCLDevice.
 * When an ExecutionGroup schedules a Chunk the schedule method of the WorkScheduler
 * The Workscheduler determines if the chunk can be run on an OpenCLDevice
 * (and that there are available OpenCLDevice).
 * If this is the case the chunk will be added to the worklist for OpenCLDevice's
 * otherwise the chunk will be added to the worklist of CPUDevices.
 *
 * A thread will read the work-list and sends a workpackage to its device.
 *
 * \see WorkScheduler.schedule method that is called to schedule a chunk
 * \see Device.execute method called to execute a chunk
 *
 * \subsection CPUDevice CPUDevice
 * When a CPUDevice gets a WorkPackage the Device will get the inputbuffer that is needed to
 * calculate the chunk. Allocation is already done by the ExecutionGroup.
 * The outputbuffer of the chunk is being created.
 * The OutputOperation of the ExecutionGroup is called to execute the area of the outputbuffer.
 *
 * \see ExecutionGroup
 * \see NodeOperation.executeRegion executes a single chunk of a NodeOperation
 * \see CPUDevice.execute
 *
 * \subsection GPUDevice OpenCLDevice
 *
 * To be completed!
 * \see NodeOperation.executeOpenCLRegion
 * \see OpenCLDevice.execute
 *
 * \section executePixel executing a pixel
 * Finally the last step, the node functionality :)
 */

/**
 * \brief The main method that is used to execute the compositor tree.
 * It can be executed during editing (blenkernel/node.c) or rendering
 * (renderer/pipeline.c)
 *
 * \param rd: [struct RenderData]
 *   Render data for this composite, this won't always belong to a scene.
 *
 * \param editingtree: [struct bNodeTree]
 *   reference to the compositor editing tree
 *
 * \param rendering: [true false]
 *    This parameter determines whether the function is called from rendering
 *    (true) or editing (false).
 *    based on this setting the system will work differently:
 *     - during rendering only Composite & the File output node will be calculated
 * \see NodeOperation.isOutputProgram(int rendering) of the specific operations
 *
 *     - during editing all output nodes will be calculated
 * \see NodeOperation.isOutputProgram(int rendering) of the specific operations
 *
 *     - another quality setting can be used bNodeTree.
 *       The quality is determined by the bNodeTree fields.
 *       quality can be modified by the user from within the node panels.
 * \see bNodeTree.edit_quality
 * \see bNodeTree.render_quality
 *
 *     - output nodes can have different priorities in the WorkScheduler.
 * This is implemented in the COM_execute function.
 *
 * \param viewSettings:
 *   reference to view settings used for color management
 *
 * \param displaySettings:
 *   reference to display settings used for color management
 *
 * OCIO_TODO: this options only used in rare cases, namely in output file node,
 *            so probably this settings could be passed in a nicer way.
 *            should be checked further, probably it'll be also needed for preview
 *            generation in display space
 */
/* clang-format off */

void COM_execute(RenderData *rd,
                 Scene *scene,
                 bNodeTree *editingtree,
                 int rendering,
                 const ColorManagedViewSettings *viewSettings,
                 const ColorManagedDisplaySettings *displaySettings,
                 const char *viewName);

/**
 * \brief Deinitialize the compositor caches and allocated memory.
 * Use COM_clearCaches to only free the caches.
 */
void COM_deinitialize(void);

/**
 * \brief Clear all compositor caches. (Compositor system will still remain available).
 * To deinitialize the compositor use the COM_deinitialize method.
 */
// void COM_clearCaches(void); // NOT YET WRITTEN

#ifdef __cplusplus
}
#endif

{'repo_name': 'Bforartists/Bforartists', 'stars': '199', 'repo_language': 'C', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': -1286561678128536911, 'source_dataset': 'data'}


//
//     Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//

#import <objc/NSObject.h>

@class NSMutableDictionary;

@interface TListViewSettings : NSObject
{
    NSMutableDictionary *_settings;
    NSMutableDictionary *_columnSettings;
}

+ (id)settingsFromExtendedSettings:(id)arg1;
+ (_Bool)useExtendedSettings:(id)arg1;
+ (id)extendedSettings:(id)arg1;
+ (id)backwardCompatibleSettings:(id)arg1;
+ (id)settingsForNode:(const struct TFENode *)arg1;
+ (id)settingsFromViewOptions:(id)arg1;
+ (id)settingsFromPList:(id)arg1;
+ (id)settingsFromBrowserSettings:(struct TListBrowserSettings *)arg1;
+ (id)defaultSettingsForNewUser;
+ (_Bool)isSnowLeopardColumn:(int)arg1;
+ (_Bool)columnIsBuiltInColumn:(int)arg1;
+ (_Bool)columnIsSpotlightAttribute:(int)arg1;
+ (id)columnDictionaryFromColumnArray:(vector_abc0d4d8 *)arg1;
+ (id)columnDictionaryForWidth:(long long)arg1 index:(long long)arg2 sortOrder:(_Bool)arg3 visibility:(_Bool)arg4;
@property(retain, nonatomic) NSMutableDictionary *columnSettings; // @synthesize columnSettings=_columnSettings;
@property(retain, nonatomic) NSMutableDictionary *settings; // @synthesize settings=_settings;
- (void).cxx_destruct;
- (_Bool)isEquivalentTo:(id)arg1;
@property(nonatomic) struct CGPoint scrollPosition;
- (unsigned long long)columnCount;
- (int)columnPropertyAtIndex:(unsigned long long)arg1;
- (_Bool)visibleForColumn:(int)arg1;
- (void)setVisibleForColumn:(int)arg1 visible:(_Bool)arg2;
- (_Bool)sortOrderAscendingForColumn:(int)arg1;
- (void)setSortOrderAscendingForColumn:(int)arg1 ascending:(_Bool)arg2;
- (unsigned long long)indexForColumn:(int)arg1;
- (vector_528602f5)columnPropertiesInOrder;
- (void)setColumnsOrder:(const vector_528602f5 *)arg1;
- (void)addSpotlightListViewColumn:(int)arg1;
- (unsigned long long)widthForColumn:(int)arg1;
- (void)setWidthForColumn:(int)arg1 width:(unsigned long long)arg2;
@property(nonatomic) int sortColumn;
@property(nonatomic) _Bool showIconPreview;
@property(nonatomic) _Bool calculateAllSizes;
@property(nonatomic) _Bool useRelativeDates;
@property(nonatomic) double textSize;
@property(nonatomic) double iconSize;
- (unsigned long long)checkIntegrity;
- (_Bool)checkNumberSettingForKey:(id)arg1 lowValue:(double)arg2 highValue:(double)arg3;
- (void)addBladeRunnerStatusSettingsIfNeeded:(const struct TFENode *)arg1;
- (void)addDateAddedSettingsIfNeeded;
- (void)dealloc;
- (id)initWithPList:(id)arg1;
- (id)initWithListBrowserSettings:(struct TListBrowserSettings *)arg1;

@end

{'repo_name': 'w0lfschild/macOS_headers', 'stars': '304', 'repo_language': 'None', 'file_name': 'NSTextFinderBarContainer-Protocol.h', 'mime_type': 'text/x-objective-c', 'hash': 1089805421090091174, 'source_dataset': 'data'}


package winapi

// BOOL LogonUserA(
// 	LPCWSTR  lpszUsername,
// 	LPCWSTR  lpszDomain,
// 	LPCWSTR  lpszPassword,
// 	DWORD   dwLogonType,
// 	DWORD   dwLogonProvider,
// 	PHANDLE phToken
// );
//
//sys LogonUser(username *uint16, domain *uint16, password *uint16, logonType uint32, logonProvider uint32, token *windows.Token) (err error) = advapi32.LogonUserW

// Logon types
const (
	LOGON32_LOGON_INTERACTIVE       uint32 = 2
	LOGON32_LOGON_NETWORK           uint32 = 3
	LOGON32_LOGON_BATCH             uint32 = 4
	LOGON32_LOGON_SERVICE           uint32 = 5
	LOGON32_LOGON_UNLOCK            uint32 = 7
	LOGON32_LOGON_NETWORK_CLEARTEXT uint32 = 8
	LOGON32_LOGON_NEW_CREDENTIALS   uint32 = 9
)

// Logon providers
const (
	LOGON32_PROVIDER_DEFAULT uint32 = 0
	LOGON32_PROVIDER_WINNT40 uint32 = 2
	LOGON32_PROVIDER_WINNT50 uint32 = 3
)

{'repo_name': 'microsoft/hcsshim', 'stars': '261', 'repo_language': 'Go', 'file_name': 'export.go', 'mime_type': 'text/plain', 'hash': -5704535790777695054, 'source_dataset': 'data'}


######################################################################################################
## Copyright (c) Microsoft. All rights reserved.
## Licensed under the MIT license. See LICENSE file in the project root for full license information.
######################################################################################################

#-------------------------------------------------------------------------------------
# Script function description:
# Function: Trigger the peer client to get content from
#           the content server which is designated from parameter $contentServerName's
#           value. The peer client is specified by the parameter $peerServerName's value.
#           The content is specified by the parameter $contentUri's value.
# Step 1:   Clear the cache including browser cache and branch cache on the peer client.
# Step 2:   Open the browser to get the content from the content server on the peer client.
#-------------------------------------------------------------------------------------

param(
[string]$ServerComputerName = $peerServerName,
[string]$ContentServerName = $contentServerName,
[string]$path = $contentUri,
[string]$usr = $user,
[string]$pwd = $password
)

cmd /c exit

{'repo_name': 'ZecOps/CVE-2020-1206-POC', 'stars': '115', 'repo_language': 'C#', 'file_name': 'SharedAssemblyInfo.cs', 'mime_type': 'text/plain', 'hash': -4142392763748473781, 'source_dataset': 'data'}


# -*- mode: sh -*-
#!/usr/bin/env bats

load helpers

@test "Test overlay network with etcd" {
    skip_for_circleci
    test_overlay etcd
}

{'repo_name': 'moby/libnetwork', 'stars': '1690', 'repo_language': 'Go', 'file_name': 'readme.go', 'mime_type': 'text/x-c', 'hash': -5732380297428227581, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2011+, HL7, Inc.
  All rights reserved.

  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:

   * Redistributions of source code must retain the above copyright notice, this
     list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright notice,
     this list of conditions and the following disclaimer in the documentation
     and/or other materials provided with the distribution.
   * Neither the name of HL7 nor the names of its contributors may be used to
     endorse or promote products derived from this software without specific
     prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

  Generated on Tue, Mar 21, 2017 06:09+1100 for FHIR v3.0.0

  Note: the schemas & schematrons do not contain all of the rules about what makes resources
  valid. Implementers will still need to be familiar with the content of the specification and with
  any profiles that apply to the resources in order to make a conformant implementation.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="1.0">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="DeviceUseStatement" type="DeviceUseStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceUseStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">An external identifier for this statement such as an IRI.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DeviceUseStatementStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient who used the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="whenUsed" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time period over which the device was used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">How often the device was used.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingTiming" type="Timing"/>
            <xs:element name="timingPeriod" type="Period"/>
            <xs:element name="timingDateTime" type="dateTime"/>
          </xs:choice>
          <xs:element name="recordedOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time at which the statement was made/recorded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who reported the device was being used by the patient.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The details of the device used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason or justification for the use of the device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the site on the subject's body where the device was used ( i.e. the target site).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceUseStatementStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered in Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="intended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Intended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceUseStatementStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept indicating the current status of a the Device Usage</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="DeviceUseStatementStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

{'repo_name': 'FirelyTeam/fhir-net-api', 'stars': '491', 'repo_language': 'C#', 'file_name': 'StripLastModified.xslt', 'mime_type': 'text/xml', 'hash': -1609437522792760471, 'source_dataset': 'data'}


/*
 * Copyright (C) 2020 Square, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.squareup.wire.schema.internal

internal actual fun Char.isDigit() = this in '0'..'9'

internal actual fun String.toEnglishLowerCase() = toLowerCase()

actual interface MutableQueue<T : Any> : MutableCollection<T> {
  actual fun poll(): T?
}

internal actual fun <T : Any> mutableQueueOf(): MutableQueue<T> {
  val queue = mutableListOf<T>()
  return object : MutableQueue<T>, MutableCollection<T> by queue {
    override fun poll() = firstOrNull()
  }
}

{'repo_name': 'square/wire', 'stars': '3182', 'repo_language': 'Kotlin', 'file_name': 'OptionElementTest.kt', 'mime_type': 'text/x-c++', 'hash': -2716662248975153292, 'source_dataset': 'data'}


/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
 * Microsemi Serval Switch driver
 *
 * Copyright (c) 2018 Microsemi Corporation
 */

#ifndef _MSCC_SERVAL_H_
#define _MSCC_SERVAL_H_

/*
 * Target offset base(s)
 */
#define MSCC_IO_ORIGIN1_OFFSET 0x70000000
#define MSCC_IO_ORIGIN1_SIZE   0x00200000
#define MSCC_IO_ORIGIN2_OFFSET 0x71000000
#define MSCC_IO_ORIGIN2_SIZE   0x01000000
#define BASE_CFG        ((void __iomem *)0x70000000)
#define BASE_DEVCPU_GCB ((void __iomem *)0x71070000)

#endif

{'repo_name': 'u-boot/u-boot', 'stars': '1164', 'repo_language': 'C', 'file_name': 'Makefile', 'mime_type': 'text/plain', 'hash': 750467810468300422, 'source_dataset': 'data'}


using PoGo.PokeMobBot.Logic.Event;
using PoGo.PokeMobBot.Logic.State;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PoGo.PokeMobBot.Logic.Tasks
{
    public class EvolveSpecificPokemonTask
    {
        public static async Task Execute(ISession session, string pokemonId)
        {
            var id = ulong.Parse(pokemonId);

            var all = await session.Inventory.GetPokemons();
            var pokemons = all.OrderByDescending(x => x.Cp).ThenBy(n => n.StaminaMax);
            var pokemon = pokemons.FirstOrDefault(p => p.Id == id);

            if (pokemon == null) return;

            var evolveResponse = await session.Client.Inventory.EvolvePokemon(pokemon.Id);

            session.EventDispatcher.Send(new PokemonEvolveEvent
            {
                Id = pokemon.PokemonId,
                Exp = evolveResponse.ExperienceAwarded,
                Result = evolveResponse.Result
            });

            await Task.Delay(session.LogicSettings.DelayEvolvePokemon);
        }
    }
}

{'repo_name': 'MobBotTeam/PokeMobBot', 'stars': '505', 'repo_language': 'C#', 'file_name': 'PokemonInfo.cs', 'mime_type': 'text/plain', 'hash': 1858906931787589047, 'source_dataset': 'data'}


/**
 * \file
 *
 * \brief  Microchip CryptoAuth Library Version
 *
 * \copyright (c) 2015-2020 Microchip Technology Inc. and its subsidiaries.
 *
 * \page License
 *
 * Subject to your compliance with these terms, you may use Microchip software
 * and any derivatives exclusively with Microchip products. It is your
 * responsibility to comply with third party license terms applicable to your
 * use of third party software (including open source software) that may
 * accompany Microchip software.
 *
 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
 * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
 * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
 * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
 * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
 * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
 * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
 * THIS SOFTWARE.
 */

#ifndef _ATCA_VERSION_H
#define _ATCA_VERSION_H

// Version format yyyymmdd
#define ATCA_LIBRARY_VERSION_DATE   "20200912"
#define ATCA_LIBRARY_VERSION_MAJOR  3
#define ATCA_LIBRARY_VERSION_MINOR  2
#define ATCA_LIBRARY_VERSION_BUILD  3

#endif /* _ATCA_VERSION_H */

{'repo_name': 'MicrochipTech/cryptoauthlib', 'stars': '185', 'repo_language': 'C', 'file_name': 'hidapi.h', 'mime_type': 'text/x-c', 'hash': -2355410395881297901, 'source_dataset': 'data'}


{'repo_name': 'tategallery/collection', 'stars': '436', 'repo_language': 'Python', 'file_name': 'd00849-28261.json', 'mime_type': 'text/plain', 'hash': 1616831583186885725, 'source_dataset': 'data'}


/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.azure.management.network.v2019_09_01;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * IP addresses associated with azure firewall.
 */
public class HubIPAddresses {
    /**
     * List of Public IP addresses associated with azure firewall.
     */
    @JsonProperty(value = "publicIPAddresses")
    private List<AzureFirewallPublicIPAddress> publicIPAddresses;

    /**
     * Private IP Address associated with azure firewall.
     */
    @JsonProperty(value = "privateIPAddress")
    private String privateIPAddress;

    /**
     * Get list of Public IP addresses associated with azure firewall.
     *
     * @return the publicIPAddresses value
     */
    public List<AzureFirewallPublicIPAddress> publicIPAddresses() {
        return this.publicIPAddresses;
    }

    /**
     * Set list of Public IP addresses associated with azure firewall.
     *
     * @param publicIPAddresses the publicIPAddresses value to set
     * @return the HubIPAddresses object itself.
     */
    public HubIPAddresses withPublicIPAddresses(List<AzureFirewallPublicIPAddress> publicIPAddresses) {
        this.publicIPAddresses = publicIPAddresses;
        return this;
    }

    /**
     * Get private IP Address associated with azure firewall.
     *
     * @return the privateIPAddress value
     */
    public String privateIPAddress() {
        return this.privateIPAddress;
    }

    /**
     * Set private IP Address associated with azure firewall.
     *
     * @param privateIPAddress the privateIPAddress value to set
     * @return the HubIPAddresses object itself.
     */
    public HubIPAddresses withPrivateIPAddress(String privateIPAddress) {
        this.privateIPAddress = privateIPAddress;
        return this;
    }

}

{'repo_name': 'Azure/azure-sdk-for-java', 'stars': '587', 'repo_language': 'Java', 'file_name': 'MetricSpecification.java', 'mime_type': 'text/x-java', 'hash': -5897795724342200072, 'source_dataset': 'data'}


package ch.cyberduck.core.dropbox;

/*
 * Copyright (c) 2002-2016 iterate GmbH. All rights reserved.
 * https://cyberduck.io/
 *
 * 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 2 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.
 */

import ch.cyberduck.core.ConnectionCallback;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathContainerService;
import ch.cyberduck.core.exception.BackgroundException;
import ch.cyberduck.core.features.Delete;
import ch.cyberduck.core.features.Move;
import ch.cyberduck.core.transfer.TransferStatus;

import java.util.Collections;

import com.dropbox.core.DbxException;
import com.dropbox.core.v2.files.DbxUserFilesRequests;
import com.dropbox.core.v2.files.RelocationResult;

public class DropboxMoveFeature implements Move {

    private final DropboxSession session;

    private final PathContainerService containerService
        = new DropboxPathContainerService();

    public DropboxMoveFeature(final DropboxSession session) {
        this.session = session;
    }

    @Override
    public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
        try {
            if(status.isExists()) {
                new DropboxDeleteFeature(session).delete(Collections.singletonMap(renamed, status), connectionCallback, callback);
            }
            final RelocationResult result = new DbxUserFilesRequests(session.getClient(file)).moveV2(containerService.getKey(file), containerService.getKey(renamed));
            // Copy original file attributes
            return new Path(renamed.getParent(), renamed.getName(), renamed.getType(),
                new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata()));
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map("Cannot move {0}", e, file);
        }
    }

    @Override
    public boolean isRecursive(final Path source, final Path target) {
        return true;
    }

}

{'repo_name': 'iterate-ch/cyberduck', 'stars': '876', 'repo_language': 'Java', 'file_name': 'StoregateAttributesFinderFeatureTest.java', 'mime_type': 'text/x-java', 'hash': 8923898680046798611, 'source_dataset': 'data'}


/* Credit to https://gist.github.com/wataru420/2048287 */
.highlight {
  /* Comment */
  /* Error */
  /* Keyword */
  /* Operator */
  /* Comment.Multiline */
  /* Comment.Preproc */
  /* Comment.Single */
  /* Comment.Special */
  /* Generic.Deleted */
  /* Generic.Deleted.Specific */
  /* Generic.Emph */
  /* Generic.Error */
  /* Generic.Heading */
  /* Generic.Inserted */
  /* Generic.Inserted.Specific */
  /* Generic.Output */
  /* Generic.Prompt */
  /* Generic.Strong */
  /* Generic.Subheading */
  /* Generic.Traceback */
  /* Keyword.Constant */
  /* Keyword.Declaration */
  /* Keyword.Pseudo */
  /* Keyword.Reserved */
  /* Keyword.Type */
  /* Literal.Number */
  /* Literal.String */
  /* Name.Attribute */
  /* Name.Builtin */
  /* Name.Class */
  /* Name.Constant */
  /* Name.Entity */
  /* Name.Exception */
  /* Name.Function */
  /* Name.Namespace */
  /* Name.Tag */
  /* Name.Variable */
  /* Operator.Word */
  /* Text.Whitespace */
  /* Literal.Number.Float */
  /* Literal.Number.Hex */
  /* Literal.Number.Integer */
  /* Literal.Number.Oct */
  /* Literal.String.Backtick */
  /* Literal.String.Char */
  /* Literal.String.Doc */
  /* Literal.String.Double */
  /* Literal.String.Escape */
  /* Literal.String.Heredoc */
  /* Literal.String.Interpol */
  /* Literal.String.Other */
  /* Literal.String.Regex */
  /* Literal.String.Single */
  /* Literal.String.Symbol */
  /* Name.Builtin.Pseudo */
  /* Name.Variable.Class */
  /* Name.Variable.Global */
  /* Name.Variable.Instance */
  /* Literal.Number.Integer.Long */ }
  .highlight .c {
    color: #999988;
    font-style: italic; }
  .highlight .err {
    color: #a61717;
    background-color: #e3d2d2; }
  .highlight .k {
    color: #000000;
    font-weight: bold; }
  .highlight .o {
    color: #000000;
    font-weight: bold; }
  .highlight .cm {
    color: #999988;
    font-style: italic; }
  .highlight .cp {
    color: #999999;
    font-weight: bold; }
  .highlight .c1 {
    color: #999988;
    font-style: italic; }
  .highlight .cs {
    color: #999999;
    font-weight: bold;
    font-style: italic; }
  .highlight .gd {
    color: #000000;
    background-color: #ffdddd; }
  .highlight .gd .x {
    color: #000000;
    background-color: #ffaaaa; }
  .highlight .ge {
    color: #000000;
    font-style: italic; }
  .highlight .gr {
    color: #aa0000; }
  .highlight .gh {
    color: #999999; }
  .highlight .gi {
    color: #000000;
    background-color: #ddffdd; }
  .highlight .gi .x {
    color: #000000;
    background-color: #aaffaa; }
  .highlight .go {
    color: #888888; }
  .highlight .gp {
    color: #555555; }
  .highlight .gs {
    font-weight: bold; }
  .highlight .gu {
    color: #aaaaaa; }
  .highlight .gt {
    color: #aa0000; }
  .highlight .kc {
    color: #000000;
    font-weight: bold; }
  .highlight .kd {
    color: #000000;
    font-weight: bold; }
  .highlight .kp {
    color: #000000;
    font-weight: bold; }
  .highlight .kr {
    color: #000000;
    font-weight: bold; }
  .highlight .kt {
    color: #445588; }
  .highlight .m {
    color: #009999; }
  .highlight .s {
    color: #d14; }
  .highlight .na {
    color: #008080; }
  .highlight .nb {
    color: #0086B3; }
  .highlight .nc {
    color: #445588;
    font-weight: bold; }
  .highlight .no {
    color: #008080; }
  .highlight .ni {
    color: #800080; }
  .highlight .ne {
    color: #990000;
    font-weight: bold; }
  .highlight .nf {
    color: #990000; }
  .highlight .nn {
    color: #555555; }
  .highlight .nt {
    color: #000080; }
  .highlight .nv {
    color: #008080; }
  .highlight .ow {
    color: #000000;
    font-weight: bold; }
  .highlight .w {
    color: #bbbbbb; }
  .highlight .mf {
    color: #009999; }
  .highlight .mh {
    color: #009999; }
  .highlight .mi {
    color: #009999; }
  .highlight .mo {
    color: #009999; }
  .highlight .sb {
    color: #d14; }
  .highlight .sc {
    color: #d14; }
  .highlight .sd {
    color: #d14; }
  .highlight .s2 {
    color: #d14; }
  .highlight .se {
    color: #d14; }
  .highlight .sh {
    color: #d14; }
  .highlight .si {
    color: #d14; }
  .highlight .sx {
    color: #d14; }
  .highlight .sr {
    color: #009926; }
  .highlight .s1 {
    color: #d14; }
  .highlight .ss {
    color: #990073; }
  .highlight .bp {
    color: #999999; }
  .highlight .vc {
    color: #008080; }
  .highlight .vg {
    color: #008080; }
  .highlight .vi {
    color: #008080; }
  .highlight .il {
    color: #009999; }

{'repo_name': 'IBM-Swift/Kitura', 'stars': '7377', 'repo_language': 'Swift', 'file_name': 'index.html', 'mime_type': 'text/html', 'hash': -1486436914667305593, 'source_dataset': 'data'}


<!DOCTYPE html>

	<meta charset="utf-8">

	<title>SportsAppActivityState Constants Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1333)">

				PebbleKit iOS

				Pebble Technology Corp.

Index

Hierarchy

							On This Page

							<select id="jump-to">
	<option value="top">Jump To…</option>

</select>

SportsAppActivityState Constants Reference

	Declared in
	PBWatch+Sports.h

	References
	-[PBWatch sportsAppAddReceiveUpdateHandler:]

SportsAppActivityState

The state of the Sports activity.

Definition

                        typedef NS_ENUM(uint8_t, SportsAppActivityState ) {

                               SportsAppActivityStateInit = 0 x00,

                               SportsAppActivityStateRunning = 0 x01,

                               SportsAppActivityStatePaused = 0 x02,

                               SportsAppActivityStateEnd = 0 x03,

                            };

Constants

SportsAppActivityStateInit

The state of the Sports activity.

		Declared In PBWatch+Sports.h.

SportsAppActivityStateRunning

The state of the Sports activity.

		Declared In PBWatch+Sports.h.

SportsAppActivityStatePaused

The state of the Sports activity.

		Declared In PBWatch+Sports.h.

SportsAppActivityStateEnd

The state of the Sports activity.

		Declared In PBWatch+Sports.h.

See Also

[PBWatch sportsAppAddReceiveUpdateHandler:]

Declared In

PBWatch+Sports.h

Copyright © 2016 Pebble Technology Corp. All rights reserved. Updated: 2016-11-23

Generated by appledoc 2.2.1 (build 1333).

{'repo_name': 'pebble/pebble-ios-sdk', 'stars': '110', 'repo_language': 'HTML', 'file_name': 'script.js', 'mime_type': 'text/plain', 'hash': 4862914338906716502, 'source_dataset': 'data'}


#include "WavWriter.hh"
#include "MSXException.hh"
#include "Math.hh"
#include "endian.hh"
#include "one_of.hh"
#include "vla.hh"
#include <cstring>
#include <vector>

namespace openmsx {

WavWriter::WavWriter(const Filename& filename,
                     unsigned channels, unsigned bits, unsigned frequency)
	: file(filename, "wb")
	, bytes(0)
{
	// write wav header
	struct WavHeader {
		char        chunkID[4];     // + 0 'RIFF'
		Endian::L32 chunkSize;      // + 4 total size
		char        format[4];      // + 8 'WAVE'
		char        subChunk1ID[4]; // +12 'fmt '
		Endian::L32 subChunk1Size;  // +16 = 16 (fixed)
		Endian::L16 audioFormat;    // +20 =  1 (fixed)
		Endian::L16 numChannels;    // +22
		Endian::L32 sampleRate;     // +24
		Endian::L32 byteRate;       // +28
		Endian::L16 blockAlign;     // +32
		Endian::L16 bitsPerSample;  // +34
		char        subChunk2ID[4]; // +36 'data'
		Endian::L32 subChunk2Size;  // +40
	} header;

	memcpy(header.chunkID,     "RIFF", sizeof(header.chunkID));
	header.chunkSize     = 0; // actual value filled in later
	memcpy(header.format,      "WAVE", sizeof(header.format));
	memcpy(header.subChunk1ID, "fmt ", sizeof(header.subChunk1ID));
	header.subChunk1Size = 16;
	header.audioFormat   = 1;
	header.numChannels   = channels;
	header.sampleRate    = frequency;
	header.byteRate      = (channels * frequency * bits) / 8;
	header.blockAlign    = (channels * bits) / 8;
	header.bitsPerSample = bits;
	memcpy(header.subChunk2ID, "data", sizeof(header.subChunk2ID));
	header.subChunk2Size = 0; // actaul value filled in later

	file.write(&header, sizeof(header));
}

WavWriter::~WavWriter()
{
	try {
		// data chunk must have an even number of bytes
		if (bytes & 1) {
			uint8_t pad = 0;
			file.write(&pad, 1);
		}

		flush(); // write header
	} catch (MSXException&) {
		// ignore, can't throw from destructor
	}
}

void WavWriter::flush()
{
	Endian::L32 totalSize = (bytes + 44 - 8 + 1) & ~1; // round up to even number
	Endian::L32 wavSize   = bytes;

	file.seek(4);
	file.write(&totalSize, 4);
	file.seek(40);
	file.write(&wavSize, 4);
	file.seek(file.getSize()); // SEEK_END
	file.flush();
}

void Wav8Writer::write(const uint8_t* buffer, unsigned samples)
{
	file.write(buffer, samples);
	bytes += samples;
}

void Wav16Writer::write(const int16_t* buffer, unsigned samples)
{
	unsigned size = sizeof(int16_t) * samples;
	if (OPENMSX_BIGENDIAN) {
		// Variable length arrays (VLA) are part of c99 but not of c++
		// (not even c++11). Some compilers (like gcc) do support VLA
		// in c++ mode, others (like VC++) don't. Still other compilers
		// (like clang) only support VLA for POD types.
		// To side-step this issue we simply use a std::vector, this
		// code is anyway not performance critical.
		//VLA(Endian::L16, buf, samples); // doesn't work in clang
		std::vector<Endian::L16> buf(buffer, buffer + samples);
		file.write(buf.data(), size);
	} else {
		file.write(buffer, size);
	}
	bytes += size;
}

static int16_t float2int16(float f)
{
	return Math::clipIntToShort(lrintf(32768.0f * f));
}

void Wav16Writer::write(const float* buffer, unsigned stereo, unsigned samples,
                        float ampLeft, float ampRight)
{
	assert(stereo == one_of(1u, 2u));
	std::vector<Endian::L16> buf(samples * stereo);
	if (stereo == 1) {
		assert(ampLeft == ampRight);
		for (unsigned i = 0; i < samples; ++i) {
			buf[i] = float2int16(buffer[i] * ampLeft);
		}
	} else {
		for (unsigned i = 0; i < samples; ++i) {
			buf[2 * i + 0] = float2int16(buffer[2 * i + 0] * ampLeft);
			buf[2 * i + 0] = float2int16(buffer[2 * i + 0] * ampRight);
		}
	}
	unsigned size = sizeof(int16_t) * samples * stereo;
	file.write(buf.data(), size);
	bytes += size;
}

void Wav16Writer::writeSilence(unsigned samples)
{
	VLA(int16_t, buf, samples);
	unsigned size = sizeof(int16_t) * samples;
	memset(buf, 0, size);
	file.write(buf, size);
	bytes += size;
}

} // namespace openmsx

{'repo_name': 'openMSX/openMSX', 'stars': '193', 'repo_language': 'C++', 'file_name': 'manual.css', 'mime_type': 'text/plain', 'hash': -5030784420974160234, 'source_dataset': 'data'}


//
//  ProfileView.swift
//  SwiftUI-WeChat
//
//  Created by Gesen on 2019/11/29.
//  Copyright © 2019 Gesen. All rights reserved.
//

import SwiftUI

struct ProfileView: View {
    var body: some View {
        Text("待开发")
    }
}

struct ProfileView_Previews: PreviewProvider {
    static var previews: some View {
        ProfileView()
    }
}

{'repo_name': 'wxxsw/SwiftUI-WeChat', 'stars': '232', 'repo_language': 'Swift', 'file_name': 'Date++.swift', 'mime_type': 'text/plain', 'hash': 3423815016468955636, 'source_dataset': 'data'}


const path = require('path');

const config = {
  entry: {
    sprite: './src/sprite',
    symbol: './src/symbol',
    'browser-sprite': './src/browser-sprite'
  },

  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js',
    libraryTarget: 'umd'
  },

  devtool: false,

  module: {
    rules: [
      {
        test: /\.js$/,
        loader: 'babel-loader'
      },
      {
        test: /\.json$/,
        loader: 'json-loader'
      },
      {
        test: /\.svg$/,
        loader: 'string-loader'
      }
    ]
  }
};

module.exports = config;

{'repo_name': 'JetBrains/svg-mixer', 'stars': '123', 'repo_language': 'JavaScript', 'file_name': 'create-base-config.js', 'mime_type': 'text/plain', 'hash': -1483095329561394272, 'source_dataset': 'data'}


package magic.test;

import magic.model.MagicDuel;
import magic.model.MagicGame;
import magic.model.MagicPlayer;
import magic.model.phase.MagicMainPhase;

class TestExplore extends TestGameBuilder {
    @Override
    public MagicGame getGame() {
        final MagicDuel duel=createDuel();
        final MagicGame game=duel.nextGame();
        game.setPhase(MagicMainPhase.getFirstInstance());
        final MagicPlayer player=game.getPlayer(0);
        final MagicPlayer opponent=game.getPlayer(1);

        MagicPlayer P = player;

        P.setLife(20);
        addToLibrary(P, "Plains", 10);
        createPermanent(P,"Rupture Spire",false,8);
        addToHand(P,"Plains",3);
        addToHand(P,"Explore",3);

        P = opponent;

        P.setLife(20);
        addToLibrary(P, "Plains", 10);
        createPermanent(P,"Rupture Spire",false,8);
        createPermanent(P,"Phyrexian Crusader", false,1);
        addToHand(P,"Vines of Vastwood",1);

        return game;
    }
}

{'repo_name': 'magarena/magarena', 'stars': '290', 'repo_language': 'Java', 'file_name': 'result.txt', 'mime_type': 'text/plain', 'hash': 2164798856976586712, 'source_dataset': 'data'}


var classd_googol =
[
    [ "dGoogol", "classd_googol.html#a40b955c638441c80a1cbec45238982ba", null ],
    [ "dGoogol", "classd_googol.html#ad88a5daf44b364424c22e1ceda00f488", null ],
    [ "Abs", "classd_googol.html#aad010b05c1a433460334fe79dd01daef", null ],
    [ "Floor", "classd_googol.html#aa99eb692bde17bea4797bb70ba20fbca", null ],
    [ "InvSqrt", "classd_googol.html#a691e3b59263905707e9ae7c56d18dcc5", null ],
    [ "operator double", "classd_googol.html#adfd71e4d2f76f3870856d826a4143a3b", null ],
    [ "operator!=", "classd_googol.html#a1ec66cbd2d905df865049c6c9e04f147", null ],
    [ "operator*", "classd_googol.html#a02c2ae504fcf2a5ac3e24d12b61871fc", null ],
    [ "operator+", "classd_googol.html#a8358281d8adf0278beca7caa16f21ca1", null ],
    [ "operator+=", "classd_googol.html#ae868bf1d3d12dc63f94334e76269e05f", null ],
    [ "operator-", "classd_googol.html#a0ae29099d7f0ecdb3faa6574986f1a67", null ],
    [ "operator-=", "classd_googol.html#aaccbaca6eb2f8f62fe17ee8755780efc", null ],
    [ "operator/", "classd_googol.html#af49baf5bac1be3122a3035ddf877d12a", null ],
    [ "operator<", "classd_googol.html#a771a2898a72351cede8ecb3f2c2b6a77", null ],
    [ "operator<=", "classd_googol.html#ad036c2973026e13dcc06211b07a0f1cd", null ],
    [ "operator==", "classd_googol.html#af2f6d8bda9c6774877817541869f8f88", null ],
    [ "operator>", "classd_googol.html#a7d7b6571227be90d95c4ec4e2ff156bb", null ],
    [ "operator>=", "classd_googol.html#a41cb4cd136a06db7743642d81f4e6ccd", null ],
    [ "Sqrt", "classd_googol.html#aff249cc1995cc62ebc3297150cfaa139", null ],
    [ "ToString", "classd_googol.html#a41025d679fbec54ffd7f82ff7f549491", null ],
    [ "Trace", "classd_googol.html#aa2a97312501de1bc390113526a5a6b1f", null ]
];

{'repo_name': 'MADEAPPS/newton-dynamics', 'stars': '603', 'repo_language': 'C++', 'file_name': 'dModelManager.h', 'mime_type': 'text/x-c++', 'hash': 830476871953915853, 'source_dataset': 'data'}