text:
package benefits

import "github.com/DTS-STN/question-priority-service/models"

type Benefit struct {
	ID       string `json:"id"`
	Eligible bool   `json:"eligible"`
}

func (benefit Benefit) IsEligible(answers []models.Question) (bool, error) {
	for i, _ := range answers {
		if answers[i].ID == benefit.ID && answers[i].Answer == "true" {
			return true, nil
		}
	}
	return false, nil
}

func CheckEligibility(answers []models.Question) (benefitEligibility []Benefit, err error) {
	benefitEligibility = []Benefit{{ID: "1", Eligible: false}, {ID: "2", Eligible: false}}

	// Check all the benefits
	for i, _ := range benefitEligibility {
		benefitEligibility[i].Eligible, err = benefitEligibility[i].IsEligible(answers)
	}
	return
}

repository: DTS-STN/question-priority-service

repo_name: DTS-STN/question-priority-service

branch_name: refs/heads/development

gha_language: Go

extension: go


text:
package main

import (
	avcontrol "github.com/byuoitav/av-control-api"
	"github.com/byuoitav/av-control-api/drivers/core"
	"go.uber.org/zap"
)

// TODO wrap new functions
func registerDrivers(d avcontrol.DriverRegistry, log *zap.Logger) {
	d.MustRegister("sony/adcp", &core.SonyADCPDriver{
		Log: log.Named("drivers/sony/adcp"),
	})

	d.MustRegister("atlona6x2", &core.Atlona6x2Driver{})

	d.MustRegister("atlona5x1", &core.Atlona5x1Driver{
		Log: log.Named("drivers/atlona"),
	})

	d.MustRegister("atlona4x1", &core.Atlona4x1Driver{})

	d.MustRegister("atlona2x1", &core.Atlona2x1Driver{})

	d.MustRegister("JAP", &core.JAPDriver{
		Log: log.Named("drivers/JAP"),
	})

	d.MustRegister("keyDigital", &core.KeyDigitalDriver{
		Log: log.Named("drivers/keyDigital"),
	})

	d.MustRegister("kramerDSP", &core.KramerDSPDriver{
		Log: log.Named("driver/kramerDSP"),
	})

	d.MustRegister("kramer/via", &core.KramerViaDriver{
		Log: log.Named("drivers/kramerVia"),
	})

	d.MustRegister("kramerVSDSP", &core.KramerVSDSPDriver{
		Log: log.Named("drivers/kramerVSDSP"),
	})

	d.MustRegister("kramer/protocol3000", &core.KramerProtocol3000Driver{
		Log: log.Named("drivers/protocol3000"),
	})

	d.MustRegister("london", &core.LondonDriver{
		Log: log.Named("drivers/london"),
	})
	// d.MustRegister("NEC", &core.NECDriver{})

	d.MustRegister("QSC", &core.QSCDriver{
		Log: log.Named("drivers/qsc"),
	})

	d.MustRegister("sony/bravia", &core.SonyDriver{
		Log: log.Named("drivers/sony/bravia"),
	})
}

repository: byuoitav/av-control-api

license_type: permissive

repo_name: byuoitav/av-control-api

branch_name: refs/heads/master


text:
SUMMARY = "Initscript for autloading NI modules"
DESCRIPTION = "Initscript to autoload NI modules in /etc/modules.autoload.d"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SECTION = "base"

SRC_URI = "\
	file://ni-modules-autoload \
"

FILES:${PN} = "\
	${sysconfdir}/modules.autoload.d \
	${sysconfdir}/init.d/ni-modules-autoload \
"

RDEPENDS:${PN} += "bash"

INITSCRIPT_NAME = "ni-modules-autoload"
INITSCRIPT_PARAMS = "start 37 S ."

inherit update-rc.d

do_install () {
	install -d ${D}${sysconfdir}/modules.autoload.d

	install -d ${D}${sysconfdir}/init.d/
	install -m 0755 ${WORKDIR}/ni-modules-autoload ${D}${sysconfdir}/init.d/
}

license: MIT

repository: ni/meta-nilrt

repo_name: ni/meta-nilrt

branch_name: refs/heads/nilrt/master/kirkstone

gha_license_id: MIT

gha_language: Shell

extension: bb


text:
@article{tan_no_2018,
	title = {No relationship between autistic traits and salivary testosterone concentrations in men from the general population},
	volume = {13},
	copyright = {All rights reserved},
	issn = {1932-6203},
	url = {http://dx.plos.org/10.1371/journal.pone.0198779},
	doi = {10.1371/journal.pone.0198779},
	language = {en},
	number = {6},
	urldate = {2018-06-25},
	journal = {PLOS ONE},
	author = {Tan, Diana Weiting and Maybery, Murray T. and Clarke, Michael W. and Di Lorenzo, Renata and Evans, Melissa O. and Mancinone, Michael and Panos, Christina and Whitehouse, Andrew J. O.},
	editor = {Pavlova, Marina A.},
	month = jun,
	year = {2018},
	pages = {e0198779},
	file = {Tan et al. - 2018 - No relationship between autistic traits and saliva.pdf:C\:\\Users\\Diana\\Google Drive\\01. Papers\\Zotero\\storage\\LF54KS7D\\Tan et al. - 2018 - No relationship between autistic traits and saliva.pdf:application/pdf}
}

repository: dianawtan/academic-kickstart

repo_name: dianawtan/academic-kickstart

extension: bib


text:
package producing

import (
	"context"
	"errors"
	"testing"

	"github.com/segmentio/kafka-go"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/mock"
	"github.com/strider2038/message-router/data"
)

type mockKafkaWriter struct {
	mock.Mock
}

func (mock mockKafkaWriter) WriteMessages(ctx context.Context, msgs ...kafka.Message) error {
	args := mock.Called()

	return args.Error(0)
}

type mockKafkaWriterFlyweight struct {
	mock.Mock
}

func (mock *mockKafkaWriterFlyweight) CreateWriterForTopic(topicName string) KafkaWriter {
	args := mock.Called(topicName)

	return args.Get(0).(KafkaWriter)
}

func (mock *mockKafkaWriterFlyweight) PoolSize() int {
	panic("not implemented")
}

func TestKafkaMessageProducer_Produce_Message_MessageSentToKafkaByWriter(t *testing.T) {
	writer := &mockKafkaWriter{}
	factory := mockKafkaWriterFlyweight{}
	producer := NewKafkaMessageProducer(&factory)
	message := data.MessagePack{"topic", data.Message{}}
	factory.On("CreateWriterForTopic", "topic").Return(writer)
	writer.On("WriteMessages").Return(nil)

	err := producer.Produce(&message)

	factory.Mock.AssertExpectations(t)
	assert.Nil(t, err)
}

func TestKafkaMessageProducer_Produce_Message_MessageSentFailedAndErrorReturned(t *testing.T) {
	writer := &mockKafkaWriter{}
	factory := mockKafkaWriterFlyweight{}
	producer := NewKafkaMessageProducer(&factory)
	message := data.MessagePack{"topic", data.Message{}}
	factory.On("CreateWriterForTopic", "topic").Return(writer)
	writer.On("WriteMessages").Return(errors.New("error"))

	err := producer.Produce(&message)

	factory.Mock.AssertExpectations(t)
	assert.Equal(t, "error", err.Error())
}


text:
// Copyright (c) 2017 ECS Team, Inc. - All Rights Reserved
// https://github.com/ECSTeam/cloudfoundry-top-plugin
//
// 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 common

/*
type createResponseObject func() IResponse
type createMetadataEntityObject func(guid string) IMetadata
type processResponse func(IResponse, []IMetadata) []IMetadata

type MdCommonManager struct {
	metadataMap       map[string]IMetadata
	mdGlobalManager   mdGlobalManagerInterface.MdGlobalManagerInterface
	fullLoadCacheTime time.Time
	loadInProgress    bool
	mu                sync.Mutex

	url                        string
	createResponseObject       createResponseObject
	createMetadataEntityObject createMetadataEntityObject
	processResponse            processResponse
}

func NewMdCommonManager(
	mdGlobalManager mdGlobalManagerInterface.MdGlobalManagerInterface,
	url string,
	createResponseObject createResponseObject,
	createMetadataEntityObject createMetadataEntityObject,
	processResponse processResponse) *MdCommonManager {
	mdMgr := &MdCommonManager{
		mdGlobalManager:            mdGlobalManager,
		url:                        url,
		createResponseObject:       createResponseObject,
		createMetadataEntityObject: createMetadataEntityObject,
		processResponse:            processResponse}
	mdMgr.metadataMap = make(map[string]IMetadata)
	return mdMgr
}

func (mdMgr *MdCommonManager) All() []IMetadata {
	metadataArray := []IMetadata{}
	for _, metadata := range mdMgr.metadataMap {
		metadataArray = append(metadataArray, metadata)
	}
	return metadataArray
}

func (mdMgr *MdCommonManager) Find(guid string) IMetadata {
	metadata := mdMgr.metadataMap[guid]
	if metadata == nil {
		mdMgr.RequestLoadCacheIfOld()
		metadata = mdMgr.createMetadataEntityObject(guid)
		// We mark this metadata as 60 mins old so it will be refreshed with async load
		// TODO: Just use 'nil'
		//		old := metadata.GetCacheTime().Add(-60 * time.Minute)
		metadata.SetCacheTime(nil)
	}
	return metadata
}

// Flush cache.  This will not force a reload - must call LoadCache if immedently reload is desired
func (mdMgr *MdCommonManager) FlushCache() {
	mdMgr.metadataMap = make(map[string]IMetadata)
	mdMgr.fullLoadCacheTime = time.Time{}
}

func (mdMgr *MdCommonManager) RequestLoadCacheIfOld() {
	if time.Now().Sub(mdMgr.fullLoadCacheTime) > time.Hour*24 {
		mdMgr.LoadCacheAysnc()
	}
}

func (mdMgr *MdCommonManager) LoadCacheAysnc() {

	if mdMgr.loadInProgress {
		toplog.Debug("MdCommonManager.LoadCacheAysnc %v loadInProgress", mdMgr.url)
		return
	}

	mdMgr.loadInProgress = true
	loadAsync := func() {
		toplog.Debug("MdCommonManager.LoadCacheAysnc %v loadAsync thread started", mdMgr.url)
		mdMgr.LoadCache(mdMgr.mdGlobalManager.GetCliConnection())
		mdMgr.loadInProgress = false
		toplog.Debug("MdCommonManager.LoadCacheAysnc %v loadAsync thread complete", mdMgr.url)
	}
	go loadAsync()
}

func (mdMgr *MdCommonManager) LoadCache(cliConnection plugin.CliConnection) {
	metadataArray, err := mdMgr.getMetadata(cliConnection)
	if err != nil {
		toplog.Warn("*** metadata error: %v", err.Error())
		return
	}

	metadataMap := make(map[string]IMetadata)
	for _, metadata := range metadataArray {
		//toplog.Info("From Map - %+v", metadata)
		metadataMap[metadata.GetGuid()] = metadata
	}

	mdMgr.mu.Lock()
	defer mdMgr.mu.Unlock()
	mdMgr.metadataMap = metadataMap
	mdMgr.fullLoadCacheTime = time.Now()
}

func (mdMgr *MdCommonManager) getMetadata(cliConnection plugin.CliConnection) ([]IMetadata, error) {
	return mdMgr.GetMetadataFromUrl(cliConnection, mdMgr.url)
}

func (mdMgr *MdCommonManager) GetMetadataFromUrl(cliConnection plugin.CliConnection, url string) ([]IMetadata, error) {

	metadataArray := []IMetadata{}

	handleRequest := func(outputBytes []byte) (data interface{}, nextUrl string, err error) {
		resp := mdMgr.createResponseObject()
		err = json.Unmarshal(outputBytes, &resp)
		if err != nil {
			toplog.Warn("*** %v unmarshal parsing output: %v", url, string(outputBytes[:]))
			return metadataArray, "", err
		}
		metadataArray = mdMgr.processResponse(resp, metadataArray)
		nextUrl, _ = GetStringValueByFieldName(resp, "NextUrl")
		return resp, nextUrl, nil
	}

	err := CallPagableAPI(cliConnection, url, handleRequest)

	return metadataArray, err

}

*/

repository: kkellner/cloudfoundry-top-plugin

repo_name: kkellner/cloudfoundry-top-plugin


text:
package server

import (
	"net/http"

	"github.com/KennyChenFight/Shortening-URL/pkg/middleware"

	"github.com/KennyChenFight/Shortening-URL/pkg/service"
	"github.com/gin-gonic/gin"
)

func NewHTTPServer(engine *gin.Engine, port string, mwe *middleware.BaseMiddleware, svc *service.BaseService) *http.Server {
	return &http.Server{
		Addr:    port,
		Handler: registerRoutingRule(engine, mwe, svc),
	}
}

func registerRoutingRule(engine *gin.Engine, mwe *middleware.BaseMiddleware, svc *service.BaseService) *gin.Engine {
	engine.Use(mwe.GlobalErrorHandle())
	engine.NoMethod(svc.HandleMethodNotAllowed)
	engine.NoRoute(svc.HandlePathNotFound)
	v1APIGroup := engine.Group("/api/v1")
	{
		v1APIGroup.POST("/urls", svc.CreateShorteningURL)
		v1APIGroup.DELETE("/urls/:id", svc.DeleteShorteningURL)
		// for local test, need to remove in production
		v1APIGroup.POST("/_internal/keys", svc.BatchCreateKeys)
	}

	// for redirect
	engine.GET("/:id", mwe.SlideWindowRateLimiter(), svc.GetOriginalURL)
	return engine
}

repository: KennyChenFight/Shortening-URL

repo_name: KennyChenFight/Shortening-URL


text:
file(REMOVE_RECURSE
  "CMakeFiles/rangeetree1.dir/main.cpp.obj"
  "rangeetree1.pdb"
  "rangeetree1.exe"
  "rangeetree1.exe.manifest"
  "librangeetree1.dll.a"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/rangeetree1.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

extension: cmake


text:
import { Injectable, OnDestroy } from '@angular/core';
import { Store } from '@ngrx/store';
import * as fromNotesRoot from './store/reducers';

import * as notes from './store/actions';
import { selectCategoriesWithNotes, selectAllCategories, selectCollapsedCategories, selectCategoriesLoaded, selectCurrentNote, selectCategoriesWithUncategorized, selectRouteNote } from './store/selectors';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { Note, Category } from './note.model';

@Injectable()
export class NotesService implements OnDestroy {
  categoriesLoaded: Observable<boolean>;
  categoriesLoadedSubscription: Subscription;

  constructor(private notesStore: Store<fromNotesRoot.State>) {
    this.categoriesLoaded = this.notesStore.select(selectCategoriesLoaded);

    this.categoriesLoadedSubscription = this.categoriesLoaded.subscribe(loaded => {
      if (!loaded) {
        this.notesStore.dispatch(new notes.FetchNotesAndCategories());
      }
    });
  }

  ngOnDestroy() {
    this.categoriesLoadedSubscription.unsubscribe();
  }

  toggleCategory(id) {
    const stringId = String(id);
    this.notesStore.dispatch(new notes.ToggleCategory(stringId));
  }

  selectCategory(id) {
    const stringId = String(id);
    this.notesStore.dispatch(new notes.SelectCategory(stringId));
  }

  loadCategories() {
    this.notesStore.dispatch(new notes.FetchCategories());
  }

  loadNotesAndCategories() {
    this.notesStore.dispatch(new notes.FetchNotesAndCategories());

    // this.categoriesLoaded.pipe(
    //   map(loaded => {
    //     debugger;
    //     this.notesStore.dispatch(new notes.FetchNotesAndCategories());
    //   })
    // )

    // this.categoriesLoaded.subscribe(loaded => {
    //   if (!loaded) {
    //     this.notesStore.dispatch(new notes.FetchNotesAndCategories());
    //   }
    // })
  }

  getCategories() {
    return this.notesStore.select(selectAllCategories);
  }

  getCategoriesWithNotes() {
    return this.notesStore.select(selectCategoriesWithNotes);
  }

  getCollapsedCategories() {
    return this.notesStore.select(selectCollapsedCategories);
  }

  getSelectedNote() {
    return this.notesStore.select(selectCurrentNote);
  }

  getRouteNote() {
    return this.notesStore.select(selectRouteNote);
  }

  selectNote(id) {
    return this.notesStore.dispatch(new notes.SelectNote(String(id)));
  }

  getCategoriesWithUncategorized() {
    return this.notesStore.select(selectCategoriesWithUncategorized);
  }

  createNote(note: Note) {
    const sanitizedNote = this._fixCategoryId(note);
    return this.notesStore.dispatch(new notes.CreateNote(sanitizedNote));
  }

  editNote(id: number, note: Note) {
    const sanitizedNote = this._fixCategoryId(note);
    this.notesStore.dispatch(new notes.UpdateNote(id, note));
  }

  createShare(id: any) {
    return this.notesStore.dispatch(new notes.CreateNoteShare(id));
  }

  private _fixCategoryId(note: Note) {
    if (note.categoryId === '0' || note.categoryId === 0) {
      note.categoryId = null;
    } else if (typeof note.categoryId === 'string') {
      note.categoryId = parseInt(note.categoryId, 10);
    }
    return note;
  }
}

repository: apedley/mdnote-desktop

repo_name: apedley/mdnote-desktop

extension: ts


text:
################################################################################
#
# \file      DetectCompilerVersion.cmake
# \copyright 2012-2015 J. Bakosi,
#            2016-2018 Los Alamos National Security, LLC.,
#            2019-2021 Triad National Security, LLC.
#            All rights reserved. See the LICENSE file for details.
# \brief     Detect C, C++, Fortran compiler major, minor, and patch version
#
################################################################################

set(COMPILERS C CXX)

if (DEFINED CMAKE_Fortran_COMPILER)
  list(APPEND COMPILERS "Fortran")
endif()

foreach(comp  ${COMPILERS})
  string(REGEX MATCH "([0-9]*)\\.([0-9]*)\\.([0-9]*)"
         major ${CMAKE_${comp}_COMPILER_VERSION})
  set(CMAKE_${comp}_COMPILER_MAJOR ${CMAKE_MATCH_1})
  set(CMAKE_${comp}_COMPILER_MINOR ${CMAKE_MATCH_2})
  set(CMAKE_${comp}_COMPILER_PATCH ${CMAKE_MATCH_3})
endforeach()

repository: quinoacomputing/quinoa

repo_name: quinoacomputing/quinoa

branch_name: refs/heads/develop

gha_license_id: NOASSERTION


text:
/*************************************************
**
** You're viewing a file in the SMAPI mod dump, which contains a copy of every open-source SMAPI mod
** for queries and analysis.
**
** This is *not* the original file, and not necessarily the latest version.
** Source repository: https://github.com/Goldenrevolver/Stardew-Valley-Mods
**
*************************************************/

using HarmonyLib;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using StardewValley;
using StardewValley.Locations;
using StardewValley.Menus;
using StardewValley.Network;
using StardewValley.Objects;
using System;
using xTile.Dimensions;
using StardewObject = StardewValley.Object;
using XnaRectangle = Microsoft.Xna.Framework.Rectangle;

namespace MaritimeSecrets
{
    internal class Patcher
    {
        private static MaritimeSecrets mod;

        private static readonly string wormBinUpgradeKey = $"{mod?.ModManifest?.UniqueID}/WormBinUpgrade";
        private static readonly string summerForageCalendarKey = $"{mod?.ModManifest?.UniqueID}/SummerForageCalendar";

        private static readonly string receivedLifeSaverKey = $"{mod?.ModManifest?.UniqueID}/ReceivedLifeSaver";
        private static readonly string receivedFrogHatKey = $"{mod?.ModManifest?.UniqueID}/ReceivedFrogHat";
        private static readonly string receivedTrashCanKey = $"{mod?.ModManifest?.UniqueID}/ReceivedTrashCan";
        private static readonly string receivedWallBasketKey = $"{mod?.ModManifest?.UniqueID}/ReceivedWallBasket";
        private static readonly string receivedPyramidDecalKey = $"{mod?.ModManifest?.UniqueID}/ReceivedPyramidDecal";
        private static readonly string receivedGourmandStatueKey = $"{mod?.ModManifest?.UniqueID}/ReceivedGourmandStatue";

        private static readonly XnaRectangle summerForage = new(144, 256, 16, 16);
        private const int driftWoodId = 169;
        private const int pearlId = 797;
        private const int mermaidPendant = 460;

        public static void PatchAll(MaritimeSecrets maritimeSecrets)
        {
            mod = maritimeSecrets;

            var harmony = new Harmony(mod.ModManifest.UniqueID);

            try
            {
                harmony.Patch(
                   original: AccessTools.Method(typeof(GameLocation), nameof(GameLocation.answerDialogueAction)),
                   prefix: new HarmonyMethod(typeof(Patcher), nameof(GameLocation_AnswerDialogueAction_Prefix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(GameLocation), nameof(GameLocation.createQuestionDialogue), new Type[] { typeof(string), typeof(Response[]), typeof(string) }),
                   prefix: new HarmonyMethod(typeof(Patcher), nameof(GameLocation_CreateQuestionDialogue_Prefix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(Beach), nameof(Beach.checkAction)),
                   prefix: new HarmonyMethod(typeof(Patcher), nameof(Beach_CheckAction_Prefix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(Billboard), nameof(Billboard.performHoverAction)),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Patcher.Billboard_PerformHoverAction_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(Billboard), nameof(Billboard.draw), new Type[] { typeof(SpriteBatch) }),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Billboard_Draw_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(BoatTunnel), nameof(BoatTunnel.getFish)),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Patcher.BoatTunnel_GetFish_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(Town), nameof(Town.getFish)),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Patcher.Town_GetFish_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(Woods), nameof(Woods.getFish)),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Patcher.Woods_GetFish_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(Desert), nameof(Desert.getFish)),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Patcher.Desert_GetFish_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(IslandSouthEastCave), nameof(IslandSouthEastCave.getFish)),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Patcher.IslandSouthEastCave_GetFish_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(IslandFarmCave), nameof(IslandFarmCave.getFish)),
                   postfix: new HarmonyMethod(typeof(Patcher), nameof(Patcher.IslandFarmCave_GetFish_Postfix)));

                harmony.Patch(
                   original: AccessTools.Method(typeof(StardewObject), nameof(StardewObject.performObjectDropInAction), new[] { typeof(Item), typeof(bool), typeof(Farmer) }),
                   prefix: new HarmonyMethod(typeof(Patcher), nameof(WormBin_PerformObjectDropInAction)));
            }
            catch (Exception e)
            {
                mod.ErrorLog("Error while trying to setup required patches:", e);
            }
        }

        // patch with very high priority so we get called before mods like 'Free Love' who want to change the cost
        // if people want to use the 'Free Love' feature they can disable my feature, but not the other way around
        [HarmonyPriority(Priority.High)]
        public static bool GameLocation_AnswerDialogueAction_Prefix(string questionAndAnswer, ref bool __result)
        {
            try
            {
                if (!mod.Config.ChangePendantPriceToPearl)
                {
                    return true;
                }

                if (questionAndAnswer == "mariner_Buy")
                {
                    if (Game1.player.hasItemInInventory(pearlId, 1))
                    {
                        Game1.player.removeItemsFromInventory(pearlId, 1);
                        Game1.player.addItemByMenuIfNecessary(new StardewObject(mermaidPendant, 1, false, -1, 0)
                        {
                            specialItem = true
                        }, null);

                        if (Game1.activeClickableMenu == null)
                        {
                            Game1.player.holdUpItemThenMessage(new StardewObject(mermaidPendant, 1, false, -1, 0), true);
                        }
                    }
                    else
                    {
                        // this means 'I need {0}, if it's not too inconvenient.'
                        var iNeedString = Game1.content.LoadString("Strings\\StringsFromCSFiles:ItemDeliveryQuest.cs.13494", $"1 {new StardewObject(pearlId, 1).DisplayName}");
                        Game1.drawObjectDialogue(iNeedString);
                    }

                    __result = true;
                    return false;
                }
                else if (questionAndAnswer == "Mariner_Buy")
                {
                    // the capital mariner case is probably no longer used by the game or was used for debugging, but let's change it anyway (the mod 'Free Love' does not change it for example)
                    if (Game1.player.hasItemInInventory(pearlId, 1))
                    {
                        Game1.player.removeItemsFromInventory(pearlId, 1);

                        Game1.player.grabObject(new StardewObject(Vector2.Zero, mermaidPendant, null, false, true, false, false));
                    }
                    else
                    {
                        // this means 'I need {0}, if it's not too inconvenient.'
                        var iNeedString = Game1.content.LoadString("Strings\\StringsFromCSFiles:ItemDeliveryQuest.cs.13494", $"1 {new StardewObject(pearlId, 1).DisplayName}");
                        Game1.drawObjectDialogue(iNeedString);
                    }

                    __result = true;
                    return false;
                }

                return true;
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
                return true;
            }
        }

        // patch with very high priority so this gets called if and only if GameLocation_AnswerDialogueAction_Prefix didn't get overridden by a mod that patches both with even higher priority
        [HarmonyPriority(Priority.VeryHigh)]
        public static bool GameLocation_CreateQuestionDialogue_Prefix(string question, ref Response[] answerChoices, string dialogKey)
        {
            try
            {
                if (!mod.Config.ChangePendantPriceToPearl)
                {
                    return true;
                }

                if (dialogKey == "mariner")
                {
                    foreach (var item in answerChoices)
                    {
                        if (item.responseKey == "Buy")
                        {
                            var buyString = Game1.content.LoadString("Strings\\StringsFromCSFiles:Event.cs.1654");
                            item.responseText = $"{buyString} (1 {new StardewObject(pearlId, 1).DisplayName})";
                        }
                    }
                }

                return true;
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
                return true;
            }
        }

        public static bool WormBin_PerformObjectDropInAction(ref StardewObject __instance, ref bool __result, ref Item dropInItem, ref bool probe, ref Farmer who)
        {
            try
            {
                if (!probe && __instance.name.Equals("Worm Bin") && who?.modData?.ContainsKey(wormBinUpgradeKey) == true)
                {
                    if (__instance.heldObject.Value != null && !__instance.readyForHarvest.Value && __instance.heldObject.Value.Stack <= 5)
                    {
                        if (dropInItem is StardewObject o && o.ParentSheetIndex == driftWoodId && who.IsLocalPlayer)
                        {
                            who.consumeObject(driftWoodId, 1);
                            // __instance.ConsumeInventoryItem(who, driftWoodId, 1);

                            who.currentLocation.playSound("slimeHit", NetAudio.SoundContext.Default);

                            var newStackSize = Game1.random.Next(8, 11);

                            __instance.heldObject.Value.Stack = newStackSize;

                            __result = false;
                            return false;
                        }
                    }
                }

                return true;
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
                return true;
            }
        }

        public static void Billboard_PerformHoverAction_Postfix(ref Billboard __instance, int x, int y, ref string ___hoverText)
        {
            try
            {
                if (__instance.calendarDays != null && Game1.player?.modData?.ContainsKey(summerForageCalendarKey) == true)
                {
                    for (int day = 0; day < __instance.calendarDays.Count;)
                    {
                        ClickableTextureComponent c = __instance.calendarDays[day++];

                        if (c.bounds.Contains(x, y))
                        {
                            if (Game1.IsSummer && 12 <= day && day <= 14)
                            {
                                if (___hoverText.Length > 0)
                                {
                                    ___hoverText += Environment.NewLine;
                                }

                                ___hoverText += mod.Helper.Translation.Get("GreenOcean");
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
            }
        }

        public static void Billboard_Draw_Postfix(Billboard __instance, SpriteBatch b, bool ___dailyQuestBoard, string ___hoverText)
        {
            try
            {
                if (!___dailyQuestBoard)
                {
                    for (int day = 1; day <= 28; day++)
                    {
                        XnaRectangle toDraw = XnaRectangle.Empty;

                        if (Game1.IsSummer && 12 <= day && day <= 14 && Game1.player?.modData?.ContainsKey(summerForageCalendarKey) == true)
                        {
                            toDraw = summerForage;
                        }

                        if (toDraw != XnaRectangle.Empty)
                        {
                            Utility.drawWithShadow(b, Game1.objectSpriteSheet, new Vector2((float)(__instance.calendarDays[day - 1].bounds.X + 12), (float)(__instance.calendarDays[day - 1].bounds.Y + 60) - Game1.dialogueButtonScale / 2f), toDraw, Color.White, 0f, Vector2.Zero, 2f, false, 1f, -1, -1, 0.35f);

                            Game1.mouseCursorTransparency = 1f;
                            __instance.drawMouse(b);
                            if (___hoverText.Length > 0)
                            {
                                IClickableMenu.drawHoverText(b, ___hoverText, Game1.dialogueFont);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
            }
        }

        public static void IslandFarmCave_GetFish_Postfix(IslandFarmCave __instance, Farmer who)
        {
            try
            {
                // if frog hat got dropepd (it's not added to the return value)
                foreach (var item in __instance.debris)
                {
                    if (item?.item is Hat hat && hat.which.Value == 78)
                    {
                        if (mod?.ModManifest?.UniqueID != null)
                        {
                            who.modData[receivedFrogHatKey] = "true";
                        }
                    }
                }
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
            }
        }

        private static void CheckForFurnitureItem(Farmer who, StardewObject fishingDrop, int furnitureId, string moddedKeyToAdd)
        {
            try
            {
                if (fishingDrop is Furniture furniture && furniture.ParentSheetIndex == furnitureId)
                {
                    if (mod?.ModManifest?.UniqueID != null)
                    {
                        who.modData[moddedKeyToAdd] = "true";
                    }
                }
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
            }
        }

        public static void BoatTunnel_GetFish_Postfix(Farmer who, StardewObject __result)
        {
            CheckForFurnitureItem(who, __result, 2418, receivedLifeSaverKey);
        }

        public static void Town_GetFish_Postfix(Farmer who, StardewObject __result)
        {
            CheckForFurnitureItem(who, __result, 2427, receivedTrashCanKey);
        }

        public static void Woods_GetFish_Postfix(Farmer who, StardewObject __result)
        {
            CheckForFurnitureItem(who, __result, 2425, receivedWallBasketKey);
        }

        public static void Desert_GetFish_Postfix(Farmer who, StardewObject __result)
        {
            CheckForFurnitureItem(who, __result, 2334, receivedPyramidDecalKey);
        }

        public static void IslandSouthEastCave_GetFish_Postfix(Farmer who, StardewObject __result)
        {
            CheckForFurnitureItem(who, __result, 2332, receivedGourmandStatueKey);
        }

        // patch with very high priority so we get called before mods like 'Free Love' which want to remove the marriage restriction
        [HarmonyPriority(Priority.VeryHigh)]
        public static bool Beach_CheckAction_Prefix(Beach __instance, Location tileLocation, Farmer who, NPC ___oldMariner, ref bool __result)
        {
            try
            {
                if (who != null && ___oldMariner != null && ___oldMariner.getTileX() == tileLocation.X && ___oldMariner.getTileY() == tileLocation.Y)
                {
                    if (mod?.ModManifest?.UniqueID == null || who.modData.ContainsKey(mod.talkedToMarinerTodayKey))
                    {
                        return true;
                    }

                    who.modData[mod.talkedToMarinerTodayKey] = "true";

                    var marinerName = GetMarinerName();

                    string speechTypeSuffix = "";

                    if ((mod.Config.MarinerSpeechType == SpeechType.dynamic && !mod.IsUsingMermaidMod) || mod.Config.MarinerSpeechType == SpeechType.sailor)
                    {
                        speechTypeSuffix = "_Sailor";
                    }

                    // maybe I should refactor everything to a string builder instead, but it doesn't seem worth it yet for only about 3 string concatenations
                    string secret = mod.Helper.Translation.Get("Secret" + speechTypeSuffix, new { name = marinerName }) + " ";

                    __result = true;

                    // major secrets

                    if (!who.modData.ContainsKey(summerForageCalendarKey))
                    {
                        who.modData[summerForageCalendarKey] = "true";
                        Game1.drawObjectDialogue(Game1.parseText(secret + mod.Helper.Translation.Get("SummerForageCalendar" + speechTypeSuffix)));
                        return false;
                    }

                    // unlike the netfield, the fishing level property also adds buffs and enchantments. the crafting recipe OR check is for mod compatibility
                    if ((who.fishingLevel.Value >= 8 || who.craftingRecipes.ContainsKey("Worm Bin")) && !who.modData.ContainsKey(wormBinUpgradeKey))
                    {
                        who.modData[wormBinUpgradeKey] = "true";
                        Game1.drawObjectDialogue(Game1.parseText(secret + mod.Helper.Translation.Get("WormBinUpgrade" + speechTypeSuffix)));
                        return false;
                    }

                    // removed the 'who.hasMagnifyingGlass' condition so you can do it in year 1
                    // the 'Vanilla' name check is for compatibility with Nayas mermaid mod for lore consistency
                    if (!who.secretNotesSeen.Contains(15))
                    {
                        who.secretNotesSeen.Add(15);

                        // yes, if people set the speech pattern to sailor and use a mermaid mod, the mermaid will say the mermaid specific line like a sailor
                        string transl = mod.IsUsingMermaidMod ? marinerName == "Vanilla" ? "MermaidSecretNote_MermaidBlueHair" : "MermaidSecretNote_Mermaid" : "MermaidSecretNote";

                        Game1.drawObjectDialogue(Game1.parseText(secret + mod.Helper.Translation.Get(transl + speechTypeSuffix)));
                        return false;
                    }

                    if (Game1.stats.DaysPlayed >= 31 && !Game1.IsWinter && (!who.mailReceived.Contains("gotSpaFishing") || !FoundSpaNecklace(who)))
                    {
                        if (!who.secretNotesSeen.Contains(GameLocation.NECKLACE_SECRET_NOTE_INDEX))
                        {
                            who.secretNotesSeen.Add(GameLocation.NECKLACE_SECRET_NOTE_INDEX);
                        }

                        // xor
                        bool oneDone = who.mailReceived.Contains("gotSpaFishing") ^ FoundSpaNecklace(who);

                        string transl = oneDone ? "SpaPaintingOrNecklace" : "SpaPaintingAndNecklace";

                        Game1.drawObjectDialogue(Game1.parseText(secret + mod.Helper.Translation.Get(transl + speechTypeSuffix)));
                        return false;
                    }

                    // minor secrets

                    string translation = null;

                    bool selectedMinorSecret = false;
                    while (!selectedMinorSecret)
                    {
                        if (Game1.whichFarm == Farm.beach_layout && !who.mailReceived.Contains("gotBoatPainting"))
                        {
                            translation = "BeachFarmBoatPainting";
                            selectedMinorSecret = true;
                            break;
                        }

                        if (!who.modData.ContainsKey(receivedTrashCanKey))
                        {
                            if (CheckJojaMartComplete())
                            {
                                translation = "TownTrashCanJojaWareHouse";
                            }
                            else if (CheckCommunityCenterComplete())
                            {
                                translation = "TownTrashCanRestoredCommunityCenter";
                            }
                            else
                            {
                                translation = "TownTrashCanBrokenCommunityCenter";
                            }

                            selectedMinorSecret = true;
                            break;
                        }

                        // if caught woodskip as secret woods condition
                        if (who.fishCaught.ContainsKey(734) && !who.modData.ContainsKey(receivedWallBasketKey))
                        {
                            translation = "SecretWoodsWallBasket";
                            selectedMinorSecret = true;
                            break;
                        }

                        if (CheckDesertUnlocked() && !who.modData.ContainsKey(receivedPyramidDecalKey))
                        {
                            translation = "DesertPyramidDecal";
                            selectedMinorSecret = true;
                            break;
                        }

                        if (Utility.doesAnyFarmerHaveOrWillReceiveMail("seenBoatJourney"))
                        {
                            if (!who.modData.ContainsKey(receivedLifeSaverKey))
                            {
                                translation = "WillyLifeSaver";
                                selectedMinorSecret = true;
                                break;
                            }

                            if (who.hasOrWillReceiveMail("talkedToGourmand"))
                            {
                                if (!who.modData.ContainsKey(receivedFrogHatKey))
                                {
                                    translation = "IslandGourmandStatue";
                                    selectedMinorSecret = true;
                                    break;
                                }
                            }

                            if (Game1.MasterPlayer.hasOrWillReceiveMail("Island_VolcanoBridge"))
                            {
                                if (!who.mailReceived.Contains("gotSecretIslandNSquirrel"))
                                {
                                    translation = "IslandSquirrel";
                                    selectedMinorSecret = true;
                                    break;
                                }
                            }

                            if (Game1.MasterPlayer.hasOrWillReceiveMail("reachedCaldera"))
                            {
                                if (!who.mailReceived.Contains("CalderaPainting"))
                                {
                                    translation = "VolcanoPainting";
                                    selectedMinorSecret = true;
                                    break;
                                }
                            }

                            if (Game1.MasterPlayer.hasOrWillReceiveMail("Island_Resort"))
                            {
                                if (!who.modData.ContainsKey(receivedGourmandStatueKey))
                                {
                                    translation = "IslandGourmandStatue";
                                    selectedMinorSecret = true;
                                    break;
                                }
                            }

                            if (Game1.MasterPlayer.hasOrWillReceiveMail("Island_Turtle"))
                            {
                                if (!who.mailReceived.Contains("gotSecretIslandNPainting"))
                                {
                                    translation = "IslandPainting";
                                    selectedMinorSecret = true;
                                    break;
                                }
                            }
                        }

                        // unlike the netfield, the fishing level property also adds buffs and enchantments
                        if (who.fishingLevel.Value >= 10 && !Game1.player.mailReceived.Contains("caughtIridiumKrobus"))
                        {
                            // now we want to calculate with boosts
                            translation = who.FishingLevel < 15 ? "IridiumKrobusNotReady" : "IridiumKrobusReady";

                            selectedMinorSecret = true;
                            break;
                        }

                        break;
                    }

                    // if managed to place a crate
                    if (TryToSpawnSupplyCrate(__instance))
                    {
                        if (selectedMinorSecret && translation != null)
                        {
                            Game1.drawObjectDialogue(Game1.parseText(secret + mod.Helper.Translation.Get(translation) + " " + mod.Helper.Translation.Get("AlsoBeachSupplyCrate" + speechTypeSuffix)));
                        }
                        else
                        {
                            Game1.drawObjectDialogue(Game1.parseText(secret + mod.Helper.Translation.Get("BeachSupplyCrate" + speechTypeSuffix)));
                        }

                        return false;
                    }

                    // if somehow failed to place a crate
                    Game1.drawObjectDialogue(Game1.parseText(mod.Helper.Translation.Get("NoSecret" + speechTypeSuffix, new { name = marinerName })));
                    return false;
                }

                return true;
            }
            catch (Exception e)
            {
                mod.ErrorLog("There was an exception in a patch", e);
                return true;
            }
        }

        private static string GetMarinerName()
        {
            var sampleMarinerSentence = Game1.content.LoadString("Strings\\Locations:Beach_Mariner_PlayerMarried");

            // some asian languages use a different unicode colon character, the fullwidth colon.
            // for some edge cases, this is checked before the normal unicode colon
            var index = sampleMarinerSentence.IndexOf('：');

            if (index < 0)
            {
                index = sampleMarinerSentence.IndexOf(':');
            }

            if (index > 0)
            {
                return sampleMarinerSentence[..index];
            }
            else
            {
                // if we couldn't find a name, use fallback
                return mod.Helper.Translation.Get("OldMarinerName");
            }
        }

        private static bool TryToSpawnSupplyCrate(Beach beach)
        {
            var whichSupplyCrate = Game1.random.Next(922, 925);

            // arbitrary max number (it's about 500*2)
            int maxTries = beach.Map.Layers[0].LayerWidth * beach.Map.Layers[0].LayerHeight * 2;

            for (int tries = 0; tries < maxTries; tries++)
            {
                Vector2 randomPosition = beach.getRandomTile();
                randomPosition.Y /= 2f;
                randomPosition.X /= 2f;

                if (randomPosition.X < 10)
                {
                    randomPosition.X += 10;
                }

                if (randomPosition.Y < 10)
                {
                    randomPosition.Y += 15;
                }

                string prop = beach.doesTileHaveProperty((int)randomPosition.X, (int)randomPosition.Y, "Type", "Back");

                if (beach.isTileLocationTotallyClearAndPlaceable(randomPosition) && (prop == null || !prop.Equals("Wood")))
                {
                    beach.dropObject(new StardewObject(whichSupplyCrate, 1, false, -1, 0)
                    {
                        Fragility = 2,
                        MinutesUntilReady = 3
                    }, randomPosition * 64f, Game1.viewport, true, null);

                    return true;
                }
            }

            return false;
        }

        private static bool FoundSpaNecklace(Farmer who)
        {
            return who.secretNotesSeen.Contains(GameLocation.NECKLACE_SECRET_NOTE_INDEX) && who.hasOrWillReceiveMail(GameLocation.CAROLINES_NECKLACE_MAIL);
        }

        private static bool CheckDesertUnlocked()
        {
            return Game1.MasterPlayer.mailReceived.Contains("ccVault") || Game1.MasterPlayer.mailReceived.Contains("jojaVault");
        }

        private static bool CheckCommunityCenterComplete()
        {
            return Game1.MasterPlayer.mailReceived.Contains("ccIsComplete") || Game1.MasterPlayer.hasCompletedCommunityCenter();
        }

        // based on Utility.hasFinishedJojaRoute, just replaced Game1.player with Game1.MasterPlayer
        private static bool CheckJojaMartComplete()
        {
            bool flag = false;
            if (Game1.MasterPlayer.mailReceived.Contains("jojaVault"))
            {
                flag = true;
            }
            else if (!Game1.MasterPlayer.mailReceived.Contains("ccVault"))
            {
                return false;
            }

            if (Game1.MasterPlayer.mailReceived.Contains("jojaPantry"))
            {
                flag = true;
            }
            else if (!Game1.MasterPlayer.mailReceived.Contains("ccPantry"))
            {
                return false;
            }

            if (Game1.MasterPlayer.mailReceived.Contains("jojaBoilerRoom"))
            {
                flag = true;
            }
            else if (!Game1.MasterPlayer.mailReceived.Contains("ccBoilerRoom"))
            {
                return false;
            }

            if (Game1.MasterPlayer.mailReceived.Contains("jojaCraftsRoom"))
            {
                flag = true;
            }
            else if (!Game1.MasterPlayer.mailReceived.Contains("ccCraftsRoom"))
            {
                return false;
            }

            if (Game1.MasterPlayer.mailReceived.Contains("jojaFishTank"))
            {
                flag = true;
            }
            else if (!Game1.MasterPlayer.mailReceived.Contains("ccFishTank"))
            {
                return false;
            }

            if (flag || Game1.MasterPlayer.mailReceived.Contains("JojaMember"))
            {
                return true;
            }

            return false;
        }
    }
}

repository: Pathoschild/smapi-mod-dump

repo_name: Pathoschild/smapi-mod-dump

branch_name: refs/heads/main

gha_language: C#

extension: cs


text:
#include <iostream>
#include <fstream>
#include <set>
#include <algorithm>

using namespace std;
int segment_tree[1000000];

struct Participant {
	int first_competition;
	int second_competition;
	int third_сompetition;
	Participant(int c1, int c2, int c3) {
		first_competition = c1;
		second_competition = c2;
		third_сompetition = c3;
	}
	bool operator <(const Participant &p) const {
		return (this->first_competition < p.first_competition);
	}
};

void build(int l_b, int r_b, int root) {
	if (l_b != r_b) {
		build(l_b, (l_b + r_b) / 2, 2 * root + 1);
		build((l_b + r_b) / 2 + 1, r_b, 2 * root + 2);
		segment_tree[root] = min(segment_tree[2 * root + 1], segment_tree[2 * root + 2]);
	}
}

void update(int l_b, int r_b, int ind, int val, int root) {
	if (l_b < r_b) {
		if (ind <= (l_b + r_b) / 2) {
			update(l_b, (l_b + r_b) / 2, ind, val, 2 * root + 1);
		}
		else {
			update((l_b + r_b) / 2 + 1, r_b, ind, val, 2 * root + 2);
		}
		segment_tree[root] = min(segment_tree[2 * root + 1], segment_tree[2 * root + 2]);
	}
	else {
		segment_tree[root] = val;
	}
}

int min_request(int l_b, int r_b, int l_c, int r_c, int root) {
	if (l_b == l_c && r_b == r_c) {
		return segment_tree[root];
	}
	if (r_c <= (l_b + r_b) / 2) {
		return min_request(l_b, (l_b + r_b) / 2, l_c, r_c, root * 2 + 1);
	}
	if (l_c > (l_b + r_b) / 2) {
		return min_request((l_b + r_b) / 2 + 1, r_b, l_c, r_c, root * 2 + 2);
	}
	return min(min_request(l_b, (l_b + r_b) / 2, l_c, (l_b + r_b) / 2, root * 2 + 1), min_request((l_b + r_b) / 2 + 1, r_b, (l_b + r_b) / 2 + 1, r_c, root * 2 + 2));
}

int main() {
	ifstream fin("input.txt");
	ofstream fout("output.txt");
	int n;
	fin >> n;

	set<Participant> participants;
	for (int i = 0; i < n; i++) {
		int res1, res2, res3;
		fin >> res1 >> res2 >> res3;
		participants.insert(Participant(res1, res2, res3));
	}
	for (int i = 0; i < 4 * n; i++) {
		segment_tree[i] = 100001;
	}
	build(0, n - 1, 0);
	update(0, n - 1,(*participants.begin()).second_competition - 1, (*participants.begin()).third_сompetition, 0);
	int  kol = 1;
	set<Participant>::iterator p = participants.begin();
	p++;
	while (p != participants.end()) {
		int res2 = (*p).second_competition;
		int res3 = (*p).third_сompetition;
		if (res3 < min_request(0, n - 1, 0, res2 - 1, 0))
			kol++;
		update(0, n - 1, res2 - 1, res3, 0);
		p++;
	}
	fout << kol;
	return 0;
}

license: Unlicense

url: https://raw.githubusercontent.com/godnoTA/acm.bsu.by/3b9494a36bfb381e6748f7172ac2173e7418147f/3. Структуры данных/42. Соревнования #2192/[OK]228028.cpp

gha_license_id: Unlicense

gha_language: Java

extension: cpp


text:
using System;
using System.Collections.Generic;

using Seasar.Quill;
using Seasar.Quill.Attrs;

using DfExample.DBFlute.AllCommon;
using DfExample.DBFlute.AllCommon.Bhv;
using DfExample.DBFlute.AllCommon.Bhv.Load;
using DfExample.DBFlute.AllCommon.Bhv.Setup;
using DfExample.DBFlute.AllCommon.CBean;
using DfExample.DBFlute.AllCommon.Dbm;
using DfExample.DBFlute.AllCommon.Exp;
using DfExample.DBFlute.BsEntity.Dbm;
using DfExample.DBFlute.ExDao;
using DfExample.DBFlute.ExEntity;
using DfExample.DBFlute.CBean;

namespace DfExample.DBFlute.ExBhv {

    [Implementation]
    public partial class VdSynonymVendorTargetBhv : DfExample.DBFlute.AllCommon.Bhv.AbstractBehaviorWritable {

        // ===============================================================================
        //                                                                      Definition
        //                                                                      ==========
        /*df:beginQueryPath*/
        /*df:endQueryPath*/

        // ===============================================================================
        //                                                                       Attribute
        //                                                                       =========
        protected VdSynonymVendorTargetDao _dao;

        // ===============================================================================
        //                                                                     Constructor
        //                                                                     ===========
        public VdSynonymVendorTargetBhv() {
        }

        // ===============================================================================
        //                                                                Initialized Mark
        //                                                                ================
        public override bool IsInitialized { get { return _dao != null; } }

        // ===============================================================================
        //                                                                      Table Name
        //                                                                      ==========
        public override String TableDbName { get { return "VD_SYNONYM_VENDOR_TARGET"; } }

        // ===============================================================================
        //                                                                          DBMeta
        //                                                                          ======
        public override DBMeta DBMeta { get { return VdSynonymVendorTargetDbm.GetInstance(); } }
        public VdSynonymVendorTargetDbm MyDBMeta { get { return VdSynonymVendorTargetDbm.GetInstance(); } }

        // ===============================================================================
        //                                                                    New Instance
        //                                                                    ============
        #region New Instance
        public override Entity NewEntity() { return NewMyEntity(); }
        public override ConditionBean NewConditionBean() { return NewMyConditionBean(); }
        public virtual VdSynonymVendorTarget NewMyEntity() { return new VdSynonymVendorTarget(); }
        public virtual VdSynonymVendorTargetCB NewMyConditionBean() { return new VdSynonymVendorTargetCB(); }
        #endregion

        // ===============================================================================
        //                                                                    Count Select
        //                                                                    ============
        #region Count Select
        public virtual int SelectCount(VdSynonymVendorTargetCB cb) {
            AssertConditionBeanNotNull(cb);
            return this.DelegateSelectCount(cb);
        }

        protected override int DoReadCount(ConditionBean cb) {
            return SelectCount(Downcast(cb));
        }
        #endregion

        // ===============================================================================
        //                                                                   Entity Select
        //                                                                   =============
        #region Entity Select
        public virtual VdSynonymVendorTarget SelectEntity(VdSynonymVendorTargetCB cb) {
            AssertConditionBeanNotNull(cb);
            if (!cb.HasWhereClause() && cb.FetchSize != 1) { // if no condition for one
                throwSelectEntityConditionNotFoundException(cb);
            }
            int preSafetyMaxResultSize = xcheckSafetyResultAsOne(cb);
            IList<VdSynonymVendorTarget> ls = null;
            try {
                ls = this.DelegateSelectList(cb);
            } catch (DangerousResultSizeException e) {
                ThrowEntityDuplicatedException("{over safetyMaxResultSize '1'}", cb, e);
                return null; // unreachable
            } finally {
                xrestoreSafetyResult(cb, preSafetyMaxResultSize);
            }
            if (ls.Count == 0) { return null; }
            AssertEntitySelectedAsOne(ls, cb);
            return (VdSynonymVendorTarget)ls[0];
        }

        protected override Entity DoReadEntity(ConditionBean cb) {
            return SelectEntity(Downcast(cb));
        }

        public virtual VdSynonymVendorTarget SelectEntityWithDeletedCheck(VdSynonymVendorTargetCB cb) {
            AssertConditionBeanNotNull(cb);
            VdSynonymVendorTarget entity = SelectEntity(cb);
            AssertEntityNotDeleted(entity, cb);
            return entity;
        }

        protected override Entity DoReadEntityWithDeletedCheck(ConditionBean cb) {
            return SelectEntityWithDeletedCheck(Downcast(cb));
        }

        public virtual VdSynonymVendorTarget SelectByPKValue(long? vendorTargetId) {
            return SelectEntity(BuildPKCB(vendorTargetId));
        }

        public virtual VdSynonymVendorTarget SelectByPKValueWithDeletedCheck(long? vendorTargetId) {
            return SelectEntityWithDeletedCheck(BuildPKCB(vendorTargetId));
        }

        private VdSynonymVendorTargetCB BuildPKCB(long? vendorTargetId) {
            AssertObjectNotNull("vendorTargetId", vendorTargetId);
            VdSynonymVendorTargetCB cb = NewMyConditionBean();
            cb.Query().SetVendorTargetId_Equal(vendorTargetId);
            return cb;
        }
        #endregion

        // ===============================================================================
        //                                                                     List Select
        //                                                                     ===========
        #region List Select
        public virtual ListResultBean<VdSynonymVendorTarget> SelectList(VdSynonymVendorTargetCB cb) {
            AssertConditionBeanNotNull(cb);
            return new ResultBeanBuilder<VdSynonymVendorTarget>(TableDbName).BuildListResultBean(cb, this.DelegateSelectList(cb));
        }
        #endregion

        // ===============================================================================
        //                                                                     Page Select
        //                                                                     ===========
        #region Page Select
        public virtual PagingResultBean<VdSynonymVendorTarget> SelectPage(VdSynonymVendorTargetCB cb) {
            AssertConditionBeanNotNull(cb);
            PagingInvoker<VdSynonymVendorTarget> invoker = new PagingInvoker<VdSynonymVendorTarget>(TableDbName);
            return invoker.InvokePaging(new InternalSelectPagingHandler(this, cb));
        }

        private class InternalSelectPagingHandler : PagingHandler<VdSynonymVendorTarget> {
            protected VdSynonymVendorTargetBhv _bhv; protected VdSynonymVendorTargetCB _cb;
            public InternalSelectPagingHandler(VdSynonymVendorTargetBhv bhv, VdSynonymVendorTargetCB cb) { _bhv = bhv; _cb = cb; }
            public PagingBean PagingBean { get { return _cb; } }
            public int Count() { return _bhv.SelectCount(_cb); }
            public IList<VdSynonymVendorTarget> Paging() { return _bhv.SelectList(_cb); }
        }
        #endregion

        // ===============================================================================
        //                                                                   Load Referrer
        //                                                                   =============
        #region Load Referrer
        public virtual void LoadVdSynonymVendorRefTargetList(VdSynonymVendorTarget vdSynonymVendorTarget, ConditionBeanSetupper<VdSynonymVendorRefTargetCB> conditionBeanSetupper) {
            AssertObjectNotNull("vdSynonymVendorTarget", vdSynonymVendorTarget); AssertObjectNotNull("conditionBeanSetupper", conditionBeanSetupper);
            LoadVdSynonymVendorRefTargetList(xnewLRLs<VdSynonymVendorTarget>(vdSynonymVendorTarget), conditionBeanSetupper);
        }
        public virtual void LoadVdSynonymVendorRefTargetList(IList<VdSynonymVendorTarget> vdSynonymVendorTargetList, ConditionBeanSetupper<VdSynonymVendorRefTargetCB> conditionBeanSetupper) {
            AssertObjectNotNull("vdSynonymVendorTargetList", vdSynonymVendorTargetList); AssertObjectNotNull("conditionBeanSetupper", conditionBeanSetupper);
            LoadVdSynonymVendorRefTargetList(vdSynonymVendorTargetList, new LoadReferrerOption<VdSynonymVendorRefTargetCB, VdSynonymVendorRefTarget>().xinit(conditionBeanSetupper));
        }
        public virtual void LoadVdSynonymVendorRefTargetList(VdSynonymVendorTarget vdSynonymVendorTarget, LoadReferrerOption<VdSynonymVendorRefTargetCB, VdSynonymVendorRefTarget> loadReferrerOption) {
            AssertObjectNotNull("vdSynonymVendorTarget", vdSynonymVendorTarget); AssertObjectNotNull("loadReferrerOption", loadReferrerOption);
            LoadVdSynonymVendorRefTargetList(xnewLRLs<VdSynonymVendorTarget>(vdSynonymVendorTarget), loadReferrerOption);
        }
        public virtual void LoadVdSynonymVendorRefTargetList(IList<VdSynonymVendorTarget> vdSynonymVendorTargetList, LoadReferrerOption<VdSynonymVendorRefTargetCB, VdSynonymVendorRefTarget> loadReferrerOption) {
            AssertObjectNotNull("vdSynonymVendorTargetList", vdSynonymVendorTargetList); AssertObjectNotNull("loadReferrerOption", loadReferrerOption);
            if (vdSynonymVendorTargetList.Count == 0) { return; }
            VdSynonymVendorRefTargetBhv referrerBhv = xgetBSFLR().Select<VdSynonymVendorRefTargetBhv>();
            HelpLoadReferrerInternally<VdSynonymVendorTarget, long?, VdSynonymVendorRefTargetCB, VdSynonymVendorRefTarget>
                    (vdSynonymVendorTargetList, loadReferrerOption, new MyInternalLoadVdSynonymVendorRefTargetListCallback(referrerBhv));
        }
        protected class MyInternalLoadVdSynonymVendorRefTargetListCallback : InternalLoadReferrerCallback<VdSynonymVendorTarget, long?, VdSynonymVendorRefTargetCB, VdSynonymVendorRefTarget> {
            protected VdSynonymVendorRefTargetBhv referrerBhv;
            public MyInternalLoadVdSynonymVendorRefTargetListCallback(VdSynonymVendorRefTargetBhv referrerBhv) { this.referrerBhv = referrerBhv; }
            public long? getPKVal(VdSynonymVendorTarget e) { return e.VendorTargetId; }
            public void setRfLs(VdSynonymVendorTarget e, IList<VdSynonymVendorRefTarget> ls) { e.VdSynonymVendorRefTargetList = ls; }
            public VdSynonymVendorRefTargetCB newMyCB() { return referrerBhv.NewMyConditionBean(); }
            public void qyFKIn(VdSynonymVendorRefTargetCB cb, IList<long?> ls) { cb.Query().SetVendorTargetId_InScope(ls); }
            public void qyOdFKAsc(VdSynonymVendorRefTargetCB cb) { cb.Query().AddOrderBy_VendorTargetId_Asc(); }
            public void spFKCol(VdSynonymVendorRefTargetCB cb) { cb.Specify().ColumnVendorTargetId(); }
            public IList<VdSynonymVendorRefTarget> selRfLs(VdSynonymVendorRefTargetCB cb) { return referrerBhv.SelectList(cb); }
            public long? getFKVal(VdSynonymVendorRefTarget e) { return e.VendorTargetId; }
            public void setlcEt(VdSynonymVendorRefTarget re, VdSynonymVendorTarget be) { re.VdSynonymVendorTarget = be; }
        }
        #endregion

        // ===============================================================================
        //                                                                Pull out Foreign
        //                                                                ================
        #region Pullout Foreign
        #endregion

        // ===============================================================================
        //                                                                   Entity Update
        //                                                                   =============
        #region Basic Entity Update
        public virtual void Insert(VdSynonymVendorTarget entity) {
            AssertEntityNotNull(entity);
            this.DelegateInsert(entity);
        }

        protected override void DoCreate(Entity entity) {
            Insert(Downcast(entity));
        }

        public virtual void Update(VdSynonymVendorTarget entity) {
            AssertEntityNotNull(entity);
            AssertEntityHasVersionNoValue(entity);
            AssertEntityHasUpdateDateValue(entity);
            int updatedCount = this.DelegateUpdate(entity);
            AssertUpdatedEntity(entity, updatedCount);
        }

        protected override void DoModify(Entity entity) {
            Update(Downcast(entity));
        }

        public void InsertOrUpdate(VdSynonymVendorTarget entity) {
            HelpInsertOrUpdateInternally<VdSynonymVendorTarget, VdSynonymVendorTargetCB>(entity, new MyInternalInsertOrUpdateCallback(this));
        }
        protected class MyInternalInsertOrUpdateCallback : InternalInsertOrUpdateCallback<VdSynonymVendorTarget, VdSynonymVendorTargetCB> {
            protected VdSynonymVendorTargetBhv _bhv;
            public MyInternalInsertOrUpdateCallback(VdSynonymVendorTargetBhv bhv) { _bhv = bhv; }
            public void CallbackInsert(VdSynonymVendorTarget entity) { _bhv.Insert(entity); }
            public void CallbackUpdate(VdSynonymVendorTarget entity) { _bhv.Update(entity); }
            public VdSynonymVendorTargetCB CallbackNewMyConditionBean() { return _bhv.NewMyConditionBean(); }
            public void CallbackSetupPrimaryKeyCondition(VdSynonymVendorTargetCB cb, VdSynonymVendorTarget entity) {
                cb.Query().SetVendorTargetId_Equal(entity.VendorTargetId);
            }
            public int CallbackSelectCount(VdSynonymVendorTargetCB cb) { return _bhv.SelectCount(cb); }
        }

        public virtual void Delete(VdSynonymVendorTarget entity) {
            HelpDeleteInternally<VdSynonymVendorTarget>(entity, new MyInternalDeleteCallback(this));
        }

        protected override void DoRemove(Entity entity) {
            Remove(Downcast(entity));
        }

        protected class MyInternalDeleteCallback : InternalDeleteCallback<VdSynonymVendorTarget> {
            protected VdSynonymVendorTargetBhv _bhv;
            public MyInternalDeleteCallback(VdSynonymVendorTargetBhv bhv) { _bhv = bhv; }
            public int CallbackDelegateDelete(VdSynonymVendorTarget entity) { return _bhv.DelegateDelete(entity); }
        }
        #endregion

        // ===============================================================================
        //                                                                    Query Update
        //                                                                    ============
        public int QueryUpdate(VdSynonymVendorTarget vdSynonymVendorTarget, VdSynonymVendorTargetCB cb) {
            AssertObjectNotNull("vdSynonymVendorTarget", vdSynonymVendorTarget); AssertConditionBeanNotNull(cb);
            SetupCommonColumnOfUpdateIfNeeds(vdSynonymVendorTarget);
            FilterEntityOfUpdate(vdSynonymVendorTarget); AssertEntityOfUpdate(vdSynonymVendorTarget);
            return this.Dao.UpdateByQuery(cb, vdSynonymVendorTarget);
        }

        public int QueryDelete(VdSynonymVendorTargetCB cb) {
            AssertConditionBeanNotNull(cb);
            return this.Dao.DeleteByQuery(cb);
        }

        // ===============================================================================
        //                                                            Optimistic Lock Info
        //                                                            ====================
        protected override bool HasVersionNoValue(Entity entity) {
            return false;
        }

        protected override bool HasUpdateDateValue(Entity entity) {
            return false;
        }

        // ===============================================================================
        //                                                                 Delegate Method
        //                                                                 ===============
        #region Delegate Method
        protected int DelegateSelectCount(VdSynonymVendorTargetCB cb) { AssertConditionBeanNotNull(cb); return this.Dao.SelectCount(cb); }
        protected IList<VdSynonymVendorTarget> DelegateSelectList(VdSynonymVendorTargetCB cb) { AssertConditionBeanNotNull(cb); return this.Dao.SelectList(cb); }

        protected int DelegateInsert(VdSynonymVendorTarget e) { if (!ProcessBeforeInsert(e)) { return 1; } return this.Dao.Insert(e); }
        protected int DelegateUpdate(VdSynonymVendorTarget e)
        { if (!ProcessBeforeUpdate(e)) { return 1; } return this.Dao.UpdateNonstrictModifiedOnly(e); }
        protected int DelegateDelete(VdSynonymVendorTarget e)
        { if (!ProcessBeforeDelete(e)) { return 1; } return this.Dao.DeleteNonstrict(e); }
        #endregion

        // ===============================================================================
        //                                                                 Downcast Helper
        //                                                                 ===============
        protected VdSynonymVendorTarget Downcast(Entity entity) {
            return (VdSynonymVendorTarget)entity;
        }

        protected VdSynonymVendorTargetCB Downcast(ConditionBean cb) {
            return (VdSynonymVendorTargetCB)cb;
        }

        // ===============================================================================
        //                                                                        Accessor
        //                                                                        ========
        public virtual VdSynonymVendorTargetDao Dao { get { return _dao; } set { _dao = value; } }
    }
}


text:
# Copyright (C) 2014, O.S. Systems Software Ltda. All Rights Reserved
# Released under the MIT license (see meta-openembedded layer's COPYING.MIT)

TESSERACT_LANG = "mal"

require tesseract-lang.inc

SRC_URI[md5sum] = "1f5e8f022d3c2697075bdfc03935f128"
SRC_URI[sha256sum] = "72b3b23979ae4a6b63518964bf239beae8bb6c02f35a2695f47262178b3fef34"

branch_name: refs/heads/fido

gha_language: BitBake


text:
@article{NAGUIB20101505,
title = {(Position Paper) Applying software engineering methods and tools to CSE research projects},
journal = {Procedia Computer Science},
volume = {1},
number = {1},
pages = {1505-1509},
year = {2010},
note = {ICCS 2010},
issn = {1877-0509},
doi = {https://doi.org/10.1016/j.procs.2010.04.167},
url = {https://www.sciencedirect.com/science/article/pii/S1877050910001687},
author = {Hoda Naguib and Yang Li},
keywords = {Software engineering, ATLAS, SeisSol, Bug report, Release planning, Reverse engineering, Scientific computing, High performance computing},
abstract = {The need for applications that are developed especially for Computational Science and Engineering (CSE) has been growing rapidly in the recent years. These applications are often a prerequisite for research and have to be evolved and maintained for considerable periods of time. However, CSE researchers have traditionally put focus on achieving better computational performance and results rather than the software’s comprehensibility, maintainability and extensibility. This paper first presents two case studies on two different CSE research projects, where common and specific problems are identified. Second we propose solutions that intend to apply software engineering methodologies and tools to improve the CSE research software development.}
}

@misc{groen2015software,
      title={Software development practices in academia: a case study comparison},
      author={Derek Groen and Xiaohu Guo and James A. Grogan and Ulf D. Schiller and James M. Osborne},
      year={2015},
      eprint={1506.05272},
      archivePrefix={arXiv},
      primaryClass={cs.SE}
}

@Misc{balbes18,
  author = 	 {Mark Balbes},
  title = 	 {Agile Through the Eyes of a Scientist},
  howpublished = {\url{https://adtmag.com/articles/2018/01/02/science-and-agile.aspx}},
  month = 	 {March},
  year = 	 2018}

@misc{robson_opensci,
 title={Nudging Open Science},
 url={psyarxiv.com/zn7vt},
 DOI={10.31234/osf.io/zn7vt},
 publisher={PsyArXiv},
 author={Robson, Samuel G and Baum, Myriam A and Beaudry, Jennifer L and Beitner, Julia and Brohmer, Hilmar and Chin, Jason and Jasko, Katarzyna and Kouros, Chrystyna D and Laukkonen, Ruben, Dr. and Moreau, David and et al.},
 year={2021},
 month={Apr}
}

@INPROCEEDINGS{7427853,

  author={H. {Chen} and R. {Kazman} and S. {Haziyev}},

  booktitle={2016 49th Hawaii International Conference on System Sciences (HICSS)},

  title={Agile Big Data Analytics Development: An Architecture-Centric Approach},

  year={2016},

  volume={},

  number={},

  pages={5378-5387},

  doi={10.1109/HICSS.2016.665}}

@INPROCEEDINGS{8817160,

  author={I. {Arapakis} and Y. {Becerra} and O. {Boehm} and G. {Bravos} and V. {Chatzigiannakis} and C. {Cugnasco} and G. {Demetriou} and I. {Eleftheriou} and J. {Etienne Mascolo} and L. {Fodor} and S. {Ioannidis} and D. {Jakovetic} and L. {Kallipolitis} and E. {Kavakli} and D. {Kopanaki} and N. {Kourtellis} and M. {Maawad Marcos} and R. {Martin de Pozuelo} and N. {Milosevic} and G. {Morandi} and E. {Pages Montanera} and G. {Ristow} and R. {Sakellariou} and R. {Sirvent} and S. {Skrbic} and I. {Spais} and G. {Vasiliadis} and M. {Vinov}},

  booktitle={2019 IEEE World Congress on Services (SERVICES)},

  title={Towards Specification of a Software Architecture for Cross-Sectoral Big Data Applications},

  year={2019},

  volume={2642-939X},

  number={},

  pages={394-395},

  doi={10.1109/SERVICES.2019.00120}}

@misc{abrahamsson2017agile,
      title={Agile Software Development Methods: Review and Analysis},
      author={Pekka Abrahamsson and Outi Salo and Jussi Ronkainen and Juhani Warsta},
      year={2017},
      eprint={1709.08439},
      archivePrefix={arXiv},
      primaryClass={cs.SE}
}

@article{engstrom2020towards,
  title={Towards Agile Data Engineering for Small Scale Teams},
  author={Engstr{\"o}m, Anton},
  journal={LU-CS-EX},
  year={2020}
}

@INPROCEEDINGS{9140255,

  author={J. {Baijens} and R. {Helms} and D. {Iren}},

  booktitle={2020 IEEE 22nd Conference on Business Informatics (CBI)},

  title={Applying Scrum in Data Science Projects},

  year={2020},

  volume={1},

  number={},

  pages={30-38},

  doi={10.1109/CBI49978.2020.00011}}

@Misc{carattino-agile-dev,
  author =    {Aquiles Carattino},
  title =     {Agile Development for Science},
  subtitle = {Scientific work can also benefit from principles derived from software development},
  howpublished = {\url{https://www.uetke.com/blog/general/agile-development-for-science/}}}

@Misc{agile-science,
  author =    {Xavier Amatriain and Gemma Hornos},
  title =     {Agile Methods in Research},
  howpublished = {\url{https://www.slideshare.net/xamat/agile-science}},
  month =     {August},
  year =      2009}

@article{beck2001manifesto,
  title={Manifesto for agile software development},
  author={Beck, Kent and Beedle, Mike and Van Bennekum, Arie and Cockburn, Alistair and Cunningham, Ward and Fowler, Martin and Grenning, James and Highsmith, Jim and Hunt, Andrew and Jeffries, Ron and others},
  year={2001}
}

@article{andrei2019study,
  title={A study on using waterfall and agile methods in software project management},
  author={Andrei, Bogdan-Alexandru and Casu-Pop, Andrei-Cosmin and Gheorghe, Sorin-Catalin and Boiangiu, Costin-Anton},
  journal={Journal Of Information Systems \& Operations Management},
  pages={125--135},
  year={2019},
  publisher={Romanian-American University, Scientific Research Department}
}

@Misc{uberlyftothers,
  author =    {Jesús Rodríguez},
  title =     {{How LinkedIn, Uber, Lyft, Airbnb and Netflix are Solving Data Management and Discovery for Machine Learning Solutions}},
  howpublished = {\url{https://www.kdnuggets.com/2019/08/linkedin-uber-lyft-airbnb-netflix-solving-data-management-discovery-machine-learning-solutions.html#disqus_thread}},
  month =     {August},
  year =      2019}

@misc{AgileResearch,
author= {Xavier Amatriain},
title={A Manifesto for Agile Research},
howpublished={\url{https://xamat.github.io/AgileResearch/}},
year=2009}

@misc{AgileResearchBlog,
author= {Xavier Amatriain},
title={Agile Research},
howpublished={\url{http://technocalifornia.blogspot.com/2008/06/agile-research.html}},
year=2008,
month={August}}

@misc{XavierAgileScience,
author={Olle Bergman},
title = {Agile Science #3: Xavier came up with Agile Research a decade ago },
howpublished={\url{https://crastina.se/xavier-invented-agile-science-a-decade-ago/}},
year={2018},
month={February}}

@article{Twidale_Hansen_2019, title={Agile research}, volume={24}, url={https://journals.uic.edu/ojs/index.php/fm/article/view/9424}, DOI={10.5210/fm.v24i1.9424}, abstractNote={<p>In this paper we ask: “how might we take the ideas, the methods and the underlying philosophy behind agile software development and explore applying them in the context of doing research — even research that does not involve software development?” We look at some examples of agile research methods and think about how they might inspire the design of even better methods. We also try to address some potential criticisms of an approach that aims to minimize a need for Big Design Up Front by developing tighter iteration cycles, coupled with reflection and learning as part of a process for doing research.</p&gt;}, number={1}, journal={First Monday}, author={Twidale, Michael and Hansen, Preben}, year={2019}, month={Jan.} }

@inproceedings{way2009agile,
  title={The Agile Research Penultimatum.},
  author={Way, Thomas and Chandrasekhar, Sandhya and Murthy, Arun},
  booktitle={Software Engineering Research and Practice},
  pages={530--536},
  year={2009},
  organization={Citeseer}
}

@article{wilson2018agile,
  title={Agile research to complement agile development: a proposal for an mHealth research lifecycle},
  author={Wilson, Kumanan and Bell, Cameron and Wilson, Lindsay and Witteman, Holly},
  journal={NPJ digital medicine},
  volume={1},
  number={1},
  pages={1--6},
  year={2018},
  publisher={Nature Publishing Group}
}

@article{kardas2020axcell,
  title={Axcell: Automatic extraction of results from machine learning papers},
  author={Kardas, Marcin and Czapla, Piotr and Stenetorp, Pontus and Ruder, Sebastian and Riedel, Sebastian and Taylor, Ross and Stojnic, Robert},
  journal={arXiv preprint arXiv:2004.14356},
  year={2020}
}

@Misc{pwc,
  title =     {Papers with code},
  howpublished = {\url{https://paperswithcode.com}},
  note =      {Consulted April 8th, 2021}}

@article{erera2019summarization,
  title={A summarization system for scientific documents},
  author={Erera, Shai and Shmueli-Scheuer, Michal and Feigenblat, Guy and Nakash, Ora Peled and Boni, Odellia and Roitman, Haggai and Cohen, Doron and Weiner, Bar and Mass, Yosi and Rivlin, Or and others},
  journal={arXiv preprint arXiv:1908.11152},
  year={2019}
}

@article{vandewalle2012code,
  title={Code sharing is associated with research impact in image processing},
  author={Vandewalle, Patrick},
  journal={Computing in Science \& Engineering},
  volume={14},
  number={4},
  pages={42--47},
  year={2012},
  publisher={IEEE}
}

@inproceedings{vandewalle2019code,
  title={Code availability for image processing papers: a status update},
  author={Vandewalle, Patrick},
  booktitle={WIC IEEE SP Symposium on Information Theory and signal Processing in the Benelux, Date: 2019/05/28-2019/05/29, Location: Gent, Belgium},
  year={2019}
}

@article{forde2018reproducible,
  title={Reproducible research environments with repo2docker},
  author={Forde, Jessica and Head, Tim and Holdgraf, Chris and Panda, Yuvi and Nalvarete, Gladys and Ragan-Kelley, Benjamin and Sundell, Erik},
  year={2018}
}

@misc{fursin2020codereef,
      title={CodeReef: an open platform for portable MLOps, reusable automation actions and reproducible benchmarking},
      author={Grigori Fursin and Herve Guillou and Nicolas Essayan},
      year={2020},
      eprint={2001.07935},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

@article{Levecque2017WorkOA,
  title={Work organization and mental health problems in PhD students},
  author={K. Levecque and F. Anseel and A. D. Beuckelaer and J. Heyden and L. Gisle},
  journal={Research Policy},
  year={2017},
  volume={46},
  pages={868-879}
}

@article{nature2019being,
  title={Being a PhD student shouldn't be bad for your health},
  author={Nature Editors},
  journal={Nature},
  volume={569},
  number={7756},
  pages={307},
  year={2019}
}

@article{woolston2019phds,
  title={PhDs: the tortuous truth},
  author={Woolston, Chris},
  journal={Nature},
  volume={575},
  number={7782},
  pages={403--407},
  year={2019},
  publisher={Nature Publishing Group}
}

@article{aschwanden2015science,
  title={Science isn’t broken: It’s just a hell of a lot harder than we give it credit for},
  author={Aschwanden, Christie},
  journal={FiveThirtyEight. http://fivethirtyeight. com/features/science-isnt-broken, accessed},
  volume={21},
  year={2015}
}

@article{hilgard20178,
  title={8 CHAPTER Science as “Broken” Versus Science as “Self-Correcting”: How Retractions and Peer-Review Problems Are Exploited to Attack Science},
  author={Hilgard, Joseph and Jamieson, Kathleen Hall},
  journal={The Oxford handbook of the science of science communication},
  pages={85},
  year={2017},
  publisher={Oxford University Press}
}

@Misc{arneybroken,
  author =    {Kat Arney},
  title =     {Science is broken. Here's how to fix it},
  howpublished = {\url{http://littleatoms.com/science/science-broken-heres-how-fix-it}},
  note =      {Consulted April 9th, 2021}
}

@article{moonesinghe2007most,
  title={Most published research findings are false—but a little replication goes a long way},
  author={Moonesinghe, Ramal and Khoury, Muin J and Janssens, A Cecile JW},
  journal={PLoS Med},
  volume={4},
  number={2},
  pages={e28},
  year={2007},
  publisher={Public Library of Science}
}

@article{makinen2021needs,
  title={Who Needs MLOps: What Data Scientists Seek to Accomplish and How Can MLOps Help?},
  author={M{\"a}kinen, Sasu and Skogstr{\"o}m, Henrik and Laaksonen, Eero and Mikkonen, Tommi},
  journal={arXiv preprint arXiv:2103.08942},
  year={2021}
}

@misc{wattanakriengkrai2020github,
      title={GitHub Repositories with Links to Academic Papers: Open Access, Traceability, and Evolution},
      author={Supatsara Wattanakriengkrai and Bodin Chinthanet and Hideaki Hata and Raula Gaikovina Kula and Christoph Treude and Jin Guo and Kenichi Matsumoto},
      year={2020},
      eprint={2004.00199},
      archivePrefix={arXiv},
      primaryClass={cs.SE}
}

@article{gibney2020ai,
  title={This AI researcher is trying to ward off a reproducibility crisis},
  author={Gibney, Elizabeth},
  journal={Nature},
  volume={577},
  number={7788},
  pages={14},
  year={2020}
}

@article{Molner_Domenech_2020,
	doi = {10.1088/1742-6596/1603/1/012025},
	url = {https://doi.org/10.1088/1742-6596/1603/1/012025},
	year = 2020,
	month = {sep},
	publisher = {{IOP} Publishing},
	volume = {1603},
	pages = {012025},
	author = {Antonio Molner Domenech and Alberto Guill{\'{e}}n},
	title = {ml-experiment: A Python framework for reproducible data science},
	journal = {Journal of Physics: Conference Series},
	abstract = {Nowadays, data science projects are usually developed in an unstructured way, which makes it difficult to reproduce. It is also hard to move from an experimental environment to production. Operational workflows such as containerization, continuous deployment, and cloud orchestration allow data science researchers to move a pipeline from a local environment to the cloud. Being aware of the difficulties of setting those workflows up, this paper presents a framework to ease experiment tracking and operationalizing machine learning by combining existent and well-supported technologies. These technologies include Docker, Mlflow, Ray, among others. The framework provides an opinionated workflow to design and execute experiments either on a local environment or the cloud. ml-experiment includes: an automatic tracking system for the most famous machine learning libraries: Tensorflow, Keras, Fastai, Xgboost and Lightgdm, first-class support for distributed training and hyperparameter optimization, and a Command Line Interface (CLI) for packaging and running projects inside containers.}
}

@article{zaharia2018accelerating,
  title={Accelerating the Machine Learning Lifecycle with MLflow.},
  author={Zaharia, Matei and Chen, Andrew and Davidson, Aaron and Ghodsi, Ali and Hong, Sue Ann and Konwinski, Andy and Murching, Siddharth and Nykodym, Tomas and Ogilvie, Paul and Parkhe, Mani and others},
  journal={IEEE Data Eng. Bull.},
  volume={41},
  number={4},
  pages={39--45},
  year={2018}
}

@article{oomen2017can,
  title={How can Scrum be succesful? Competences of the scrum product owner},
  author={Oomen, Sandra and De Waal, Benny and Albertin, Ademar and Ravesteyn, Pascal},
  year={2017}
}

@Misc{merelo13,
  key =       {artec},
  author =    {JJ Merelo},
  title =     {The art of evolutionary algorithm programming},
  howpublished = {\url{https://issuu.com/jjmerelo/docs/art-ecp-cec13}},
  month =     {Jun},
  year =      2013}

@misc{garciaortega2021tropes,
      title={Tropes in films: an initial analysis},
      author={Rubén Héctor García-Ortega and Pablo García Sánchez and Juan J. Merelo-Guervós},
      year={2021},
      eprint={2006.05380},
      archivePrefix={arXiv},
      primaryClass={cs.DL}
}

gha_language: HTML


text:
SECTION = "devel/chicken"
DESCRIPTION = "Easy Pseudo-Terminal Interface"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://pty.meta;md5=97899927a6ebed43e3c1fea91f428987"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/pty/pty-${PV}.tar.gz"

SRC_URI[md5sum] = "07746c57f56e8bbb624e89f85df3b88a"
SRC_URI[sha256sum] = "6903b24ac18cbfe19d5285c51513e42699634fddd2280646585f303841aaf05f"

S = "${WORKDIR}/pty-${PV}"

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"

repository: OSSystems/meta-chicken

repo_name: OSSystems/meta-chicken


text:
package domain

import "errors"

type Qty int

var (
	QtyNotBeZero = errors.New("Qty cannot be 0 or negative")
)

func (qty Qty) Add(amount Qty) Qty {
	return qty + amount
}

func (qty Qty) Sub(amount Qty) (Qty, error) {
	newqty := qty - amount
	if newqty < 1 {
		return 0, QtyNotBeZero
	}

	return newqty, nil
}

func (qty Qty) ToInt() int {
	return int(qty)
}

repository: onedaycat/gocqrs

repo_name: onedaycat/gocqrs


text:
import { NgModule } from '@angular/core';
import { Route, RouterModule } from '@angular/router';
import { AuthGuard } from '../auth/auth.guard';

import { CarsStartComponent } from './cars-start/cars-start.component';
import { CarsCreateComponent } from './cars-create/cars-create.component';
import { CarsEditComponent } from './cars-edit/cars-edit.component';
import { CarsDetailsComponent } from './cars-details/cars-details.component';
import { CarsBuyComponent } from './cars-buy/cars-buy.component';
import { BuySuccessComponent } from './buy-success/buy-success.component';
import { BuyFailedComponent } from './buy-failed/buy-failed.component';
import { MyCarsComponent } from './my-cars/my-cars.component';

const routes: Route[] = [
  { path: 'create', component: CarsCreateComponent, canActivate: [AuthGuard] },
  { path: 'edit/:id', component: CarsEditComponent, canActivate: [AuthGuard] },
  { path: 'buy/:id', component: CarsBuyComponent, canActivate: [AuthGuard] },
  { path: 'buy-car-success', component: BuySuccessComponent, canActivate: [AuthGuard] },
  { path: 'buy-car-failed', component: BuyFailedComponent, canActivate: [AuthGuard] },
  { path: 'details/:id', component: CarsDetailsComponent },
  { path: 'my-cars', component: MyCarsComponent }
]

@NgModule({
  imports: [
    RouterModule.forChild(routes)
  ],
  exports: [RouterModule]
})
export class CarsRoutingModule { }


text:
package main

type QueueMessage struct {
	index int
	item  interface{}
}

type QueueWorker func(item interface{}) interface{}

type ParallelOrderedQueue struct {
	worker QueueWorker
	input  chan *QueueMessage
	queue  chan *QueueMessage
	output chan *QueueMessage
	cur    *QueueMessage
	last   int
}

func NewParallelOrderedQueue(numWorkers int, worker QueueWorker) *ParallelOrderedQueue {
	this := &ParallelOrderedQueue{
		worker: worker,
		input:  make(chan *QueueMessage),
		queue:  make(chan *QueueMessage),
		output: make(chan *QueueMessage),
	}
	for i := 0; i < numWorkers; i++ {
		go this.Run()
	}
	go this.Sort()
	return this
}

func (this *ParallelOrderedQueue) Add(item interface{}) {
	this.input <- &QueueMessage{this.last, item}
	this.last += 1
}

func (this *ParallelOrderedQueue) End() {
	this.input <- nil
}

func (this *ParallelOrderedQueue) Run() {
	for {
		msg, ok := <-this.input
		if !ok {
			return
		}
		if msg == nil {
			close(this.input)
			this.queue <- nil
			return
		}
		msg.item = this.worker(msg.item)
		this.queue <- msg
	}
}

func (this *ParallelOrderedQueue) Sort() {
	final := false
	expect := 0
	hold := make(map[int]*QueueMessage)
	for {
		if final && expect == this.last {
			close(this.queue)
			close(this.output)
			return
		}
		msg := <-this.queue
		if msg == nil {
			final = true
			continue
		}
		if msg.index == expect {
			this.output <- msg
			// suck up any others that might be done already
			for {
				expect++
				msg, ok := hold[expect]
				if !ok {
					break
				}
				if msg.index == expect {
					delete(hold, expect)
					this.output <- msg
				}
			}
		} else {
			hold[msg.index] = msg
		}
	}
}

// blocks until next available result. returns false if no more results are available.
func (this *ParallelOrderedQueue) Next() bool {
	msg, ok := <-this.output
	if !ok {
		return false
	}
	this.cur = msg
	return true
}

func (this *ParallelOrderedQueue) Current() interface{} {
	return this.cur.item
}

repository: flaub/sidecar

repo_name: flaub/sidecar


text:
require gtk-sharp.inc

inherit pkgconfig

DEPENDS += " gtk+3 atk pango cairo glib-2.0 libglade mono"
RDEPENDS:${PN} += " perl gtk+3"

LIC_FILES_CHKSUM = "file://COPYING;md5=8754deb904d22254188cb67189b87f19"

SDIRVERN = "${@gtk_sharp_download_versionN(d)}"
SEXT ??= "bz2"

def gtk_sharp_download_versionN(d):
    pvsplit = d.getVar('PV', True).split('.')
    return pvsplit[0] + '.' + pvsplit[1]

SRC_URI = "https://download.gnome.org/sources/gtk-sharp/${SDIRVERN}/gtk-sharp-${PV}.tar.xz \
           file://0001-fixup-gmcs-to-mcs.patch"

SRC_URI[md5sum] = "2120ff15abe655e4de8aa5aadf0d5d12"
SRC_URI[sha256sum] = "6440f571416267ae0cb5698071d087b31e3084693fa2c829b1db37ca7ea2c3a2"

S = "${WORKDIR}/gtk-sharp-${PV}"

do_configure:prepend() {
  export PROFILER_CFLAGS="-D_REENTRANT -I${STAGING_DIR_TARGET}/usr/include/glib-2.0 -I${STAGING_DIR_TARGET}/usr/lib/glib-2.0 -I${STAGING_DIR_TARGET}/usr/lib/glib-2.0/include -I${STAGING_DIR_TARGET}/usr/include/mono-2.0"
}

do_install:append() {
  rm -f ${D}${libdir}/libmono-profiler-gui-thread-check.so
}

FILES:${PN} += "\
  ${libdir}/gapi-3.0/* \
"

repository: DynamicDevices/meta-mono

repo_name: DynamicDevices/meta-mono


text:
#
# - Try to find Facebook fbthrift library
# This will define
# FBTHRIFT_FOUND
# FBTHRIFT_INCLUDE_DIR
# FBTHRIFT_LIBRARIES
#

find_package(OpenSSL REQUIRED)

find_path(
    FBTHRIFT_INCLUDE_DIR
    NAMES "thrift/lib/cpp2/Thrift.h"
    HINTS
        "/usr/local/facebook/include"
)

find_library(FMT fmt)

find_library(
    FBTHRIFT_CORE_LIBRARY
    NAMES thrift-core
    HINTS
        "/usr/local/facebook/lib"
)

find_library(
    FBTHRIFT_CPP2_LIBRARY
    NAMES thriftcpp2
    HINTS
        "/usr/local/facebook/lib"
)

find_library(
    FBTHRIFT_PROTOCOL_LIBRARY
    NAMES thriftprotocol
    HINTS
        "/usr/local/facebook/lib"
)

find_library(
    PROTOCOL_LIBRARY
    NAMES protocol
    HINTS
        "/usr/local/facebook/lib"
)

find_library(
    TRANSPORT_LIBRARY
    NAMES transport
    HINTS
        "/usr/local/facebook/lib"
)

find_library(
    FBTHRIFT_METADATA_LIBRARY
    NAMES thriftmetadata
    HINTS
        "/usr/local/facebook/lib"
)

find_library(
    FBTHRIFT_FROZEN2_LIBRARY
    NAMES thriftfrozen2
    HINTS
        "/usr/local/facebook/lib"
)

set(FBTHRIFT_LIBRARIES
    ${FBTHRIFT_CORE_LIBRARY}
    ${FBTHRIFT_PROTOCOL_LIBRARY}
    ${FBTHRIFT_CPP2_LIBRARY}
    ${FBTHRIFT_PROTOCOL_LIBRARY}
    ${FBTHRIFT_METADATA_LIBRARY}
    ${FBTHRIFT_FROZEN2_LIBRARY}
    ${PROTOCOL_LIBRARY}
    ${TRANSPORT_LIBRARY}
    ${OPENSSL_LIBRARIES}
    ${FOLLY_LIBRARIES}
    ${FMT}
    -lpthread
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
    FBTHRIFT DEFAULT_MSG FBTHRIFT_INCLUDE_DIR FBTHRIFT_LIBRARIES)

mark_as_advanced(FBTHRIFT_INCLUDE_DIR FBTHRIFT_LIBRARIES FBTHRIFT_FOUND)

if(FBTHRIFT_FOUND AND NOT FBTHRIFT_FIND_QUIETLY)
    message(STATUS "FBTHRIFT: ${FBTHRIFT_INCLUDE_DIR}")
endif()

repository: terragraph/tgnms

repo_name: terragraph/tgnms

gha_language: JavaScript


text:
namespace EnoCore.Models.Database;

public class Service
{
    public Service(
        long id,
        double weightFactor,
        string name,
        long flagsPerRound,
        long noisesPerRound,
        long havocsPerRound,
        long flagVariants,
        long noiseVariants,
        long havocVariants,
        string[] checkers,
        bool active)
    {
        this.Id = id;
        this.WeightFactor = weightFactor;
        this.Name = name;
        this.FlagsPerRound = flagsPerRound;
        this.NoisesPerRound = noisesPerRound;
        this.HavocsPerRound = havocsPerRound;
        this.FlagVariants = flagVariants;
        this.NoiseVariants = noiseVariants;
        this.HavocVariants = havocVariants;
        this.Checkers = checkers;
        this.Active = active;
    }

#pragma warning disable SA1516 // Elements should be separated by blank line
    public long Id { get; set; }
    public double WeightFactor { get; set; }
    public string Name { get; set; }
    public long FlagsPerRound { get; set; }
    public long NoisesPerRound { get; set; }
    public long HavocsPerRound { get; set; }
    public long FlagVariants { get; set; }
    public long NoiseVariants { get; set; }
    public long HavocVariants { get; set; }
    public string[] Checkers { get; set; }
    public bool Active { get; set; }
#pragma warning restore SA1516 // Elements should be separated by blank line

    public override string ToString()
    {
        return $"Service(Id={this.Id}, Name={this.Name}, FlagsPerRound={this.FlagsPerRound}, NoisesPerRound={this.NoisesPerRound}, HavocsPerRound={this.HavocsPerRound}, FlagVariants={this.FlagVariants} NoiseVariants={this.NoiseVariants}, HavocVariants={this.HavocVariants}, Active={this.Active})";
    }
}

repository: enowars/EnoEngine

repo_name: enowars/EnoEngine


text:
import { configure } from "enzyme";
import ReactSixteenAdapter from "enzyme-adapter-react-16";
import express from "express";
import "jest";
import { Helmet } from "react-helmet";
import request from "supertest";
import server from "./server";

configure({
    adapter: new ReactSixteenAdapter(),
});

jest.mock("axios");

const getRandomInt = (min: number, max: number) => {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min)) + min;
  }

describe("Server", () => {
    describe("server", () => {
        const app = express();
        server(app);
        const running = app.listen(getRandomInt(8080, 48080), "localhost");

        beforeEach(() => {
            Helmet.canUseDOM = false;
        });
        afterEach(() => {
            Helmet.canUseDOM = true;
        });
        afterAll(() => {
            running.close();
        });
        it(`responds to "/v1/health" with 200 and render "OK"`, done => {
            request(app)
                .get("/v1/health")
                .expect(200)
                .end((err, res) => {
                    if (err) {
                        return done(err);
                    }
                    expect(res.text).toEqual("OK");
                    done();
                });
        });
        it(`responds to "/" with 200 and render <App />`, done => {
            request(app)
                .get("/")
                .expect(200)
                .end((err, res) => {
                    if (err) {
                        return done(err);
                    }
                    expect(res.text).toContain("<!DOCTYPE html>");
                    done();
                });
        });
    });
});

repository: HacksForHugs/pixeloven

repo_name: HacksForHugs/pixeloven