text:
/*************************************************************************/
/*  godot_plugin_config.h                                                */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef IPHONE_GODOT_PLUGIN_CONFIG_H
#define IPHONE_GODOT_PLUGIN_CONFIG_H

#include "core/error/error_list.h"
#include "core/io/config_file.h"
#include "core/string/ustring.h"

/*
 The `config` section and fields are required and defined as follow:
- **name**: name of the plugin
- **binary**: path to static `.a` library

The `dependencies` and fields are optional.
- **linked**: dependencies that should only be linked.
- **embedded**: dependencies that should be linked and embedded into application.
- **system**: system dependencies that should be linked.
- **capabilities**: capabilities that would be used for `UIRequiredDeviceCapabilities` options in Info.plist file.
- **files**: files that would be copied into application

The `plist` section are optional.
- **key**: key and value that would be added in Info.plist file.
 */

struct PluginConfigIOS {
	inline static const char *PLUGIN_CONFIG_EXT = ".gdip";

	inline static const char *CONFIG_SECTION = "config";
	inline static const char *CONFIG_NAME_KEY = "name";
	inline static const char *CONFIG_BINARY_KEY = "binary";
	inline static const char *CONFIG_INITIALIZE_KEY = "initialization";
	inline static const char *CONFIG_DEINITIALIZE_KEY = "deinitialization";

	inline static const char *DEPENDENCIES_SECTION = "dependencies";
	inline static const char *DEPENDENCIES_LINKED_KEY = "linked";
	inline static const char *DEPENDENCIES_EMBEDDED_KEY = "embedded";
	inline static const char *DEPENDENCIES_SYSTEM_KEY = "system";
	inline static const char *DEPENDENCIES_CAPABILITIES_KEY = "capabilities";
	inline static const char *DEPENDENCIES_FILES_KEY = "files";
	inline static const char *DEPENDENCIES_LINKER_FLAGS = "linker_flags";

	inline static const char *PLIST_SECTION = "plist";

	enum PlistItemType {
		UNKNOWN,
		STRING,
		INTEGER,
		BOOLEAN,
		RAW,
		STRING_INPUT,
	};

	struct PlistItem {
		PlistItemType type;
		String value;
	};

	// Set to true when the config file is properly loaded.
	bool valid_config = false;
	bool supports_targets = false;
	// Unix timestamp of last change to this plugin.
	uint64_t last_updated = 0;

	// Required config section
	String name;
	String binary;
	String initialization_method;
	String deinitialization_method;

	// Optional dependencies section
	Vector<String> linked_dependencies;
	Vector<String> embedded_dependencies;
	Vector<String> system_dependencies;

	Vector<String> files_to_copy;
	Vector<String> capabilities;

	Vector<String> linker_flags;

	// Optional plist section
	// String value is default value.
	// Currently supports `string`, `boolean`, `integer`, `raw`, `string_input` types
	// <name>:<type> = <value>
	HashMap<String, PlistItem> plist;

	static String resolve_local_dependency_path(String plugin_config_dir, String dependency_path);

	static String resolve_system_dependency_path(String dependency_path);

	static Vector<String> resolve_local_dependencies(String plugin_config_dir, Vector<String> p_paths);

	static Vector<String> resolve_system_dependencies(Vector<String> p_paths);

	static bool validate_plugin(PluginConfigIOS &plugin_config);

	static String get_plugin_main_binary(PluginConfigIOS &plugin_config, bool p_debug);

	static uint64_t get_plugin_modification_time(const PluginConfigIOS &plugin_config, const String &config_path);

	static PluginConfigIOS load_plugin_config(Ref<ConfigFile> config_file, const String &path);
};

#endif // GODOT_PLUGIN_CONFIG_H


text:
package br.sp.unifae.cris.comp7.view;

//<editor-fold defaultstate="collapsed" desc="Importações">
import br.sp.unifae.cris.comp7.model.Cliente;
import br.sp.unifae.cris.comp7.utils.Generica;
import br.sp.unifae.cris.comp7.model.dao.DAOCliente;
import br.sp.unifae.cris.comp7.utils.interfaces.ITela;
import java.util.Iterator;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.MaskFormatter;
import javax.swing.JOptionPane;
import br.sp.unifae.cris.comp7.model.Estado;
//</editor-fold>

/**
 *
 * @author Nora
 */
public class CadastroCliente2 extends Template implements ITela{

    //<editor-fold defaultstate="collapsed" desc="Variáveis e Campos da Tela">
    private List registros = null;

    JLabel jLabelCodigo;
    JLabel jLabelNome;
    JLabel jLabelCpfOuCnpj;
    JLabel jLabelEndereco;
    JLabel jLabelCidade;
    JLabel jLabelEstado;

    JTextField jTextFieldCodigo;
    JTextField jTextFieldNome;
    JTextField jTextFieldEndereco;
    JTextField jTextFieldCidade;
    JFormattedTextField jFormattedTextFieldCpnfOuCnpj;

    JComboBox <String> jComboBoxEstado;

    JRadioButton jRadioButtonFisica;
    JRadioButton jRadioButtonJuridica;

    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="Construtor">
    CadastroCliente2() {
        DesenharTela();
        PopularListaDeRegistros();

        Object obj = new Cliente();
        this.setClasse(obj);
        this.setVisible(true);

        if (registros.size() > 0)
            pesquisar();
        else
            cancelar();
    }
    //</editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Métodos Básicos">
    @Override
    public Object pesquisar() {
        Object retorno = null;
        retorno = super.pesquisar();
        PreencherCampos(retorno);
        return null;
    }

    @Override
    public void excluir(){
        Cliente cliente = new Cliente();
        try{
            cliente.setId(Integer.parseInt(jTextFieldCodigo.getText()));
            cliente.excluir();
            super.excluir();
        }
        catch(Exception ex)
        {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }
    }

    @Override
    public void salvar(){

        Cliente cliente = new Cliente();
        try{
            try{cliente.setNome(jTextFieldNome.getText());}
            catch(Exception ex){
                jTextFieldNome.requestFocus();
                throw ex;
            }
            try
            {
                if(jRadioButtonFisica.isSelected())
                {
                    cliente.setFisicaOuJuridica("f");
                }
                else
                    cliente.setFisicaOuJuridica("j");
            }
            catch(Exception ex)
            {
                throw ex;
            }
            try{cliente.setCpfOuCnpj(jFormattedTextFieldCpnfOuCnpj.getText());}
            catch(Exception ex){
                jFormattedTextFieldCpnfOuCnpj.requestFocus();
                throw ex;
            }
            try{cliente.setEndereco(jTextFieldEndereco.getText());}
            catch(Exception ex){
                jTextFieldEndereco.requestFocus();
                throw ex;
            }
            try{cliente.setCidade(jTextFieldCidade.getText());}
            catch(Exception ex){
                jTextFieldCidade.requestFocus();
                throw ex;
            }
            try{
                Estado estado = new Estado();
                estado.setId(pegaIdEstado((String)jComboBoxEstado.getSelectedItem()));
                cliente.setEstado(estado);
            }
            catch(Exception ex){
                throw ex;
            }
            if(isNovo)
                cliente.armazenar();
            else{
                cliente.setId(Integer.parseInt(jTextFieldCodigo.getText()));
                cliente.alterar();
            }
            super.salvar();
        }
        catch(Exception ex)
        {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }
    }

    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="Métodos da Tela">
    @Override
    public final void DesenharTela() {
        this.setTitle("Cadastro de Cliente");
        this.setLocationRelativeTo(null);
        this.setResizable(false);

        jLabelCodigo = new JLabel("Código :");
        jLabelCodigo.setBounds(20, 20, 60, 20);
        jTextFieldCodigo = new JTextField("");
        jTextFieldCodigo.setBounds(90, 20, 55, 20);
        jTextFieldCodigo.setEditable(false);

        jLabelNome = new JLabel("Nome :");
        jLabelNome.setBounds(20, 60, 60, 20);
        jTextFieldNome = new JTextField("");
        jTextFieldNome.setBounds(90, 60, 350, 20);

        jLabelCpfOuCnpj = new JLabel("CPF :");
        jLabelCpfOuCnpj.setBounds(20, 140, 60, 20);
        jFormattedTextFieldCpnfOuCnpj = new JFormattedTextField();
        jFormattedTextFieldCpnfOuCnpj.setBounds(90, 140, 150, 20);
        try
        {
            jFormattedTextFieldCpnfOuCnpj.setText(null);
            jFormattedTextFieldCpnfOuCnpj.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("###.###.###-##")));
        }
        catch(java.text.ParseException ex)
        {
            ex.printStackTrace();
        }

        jRadioButtonFisica = new JRadioButton("Pessoa Física", true);
        jRadioButtonFisica.setBounds(90, 100, 120, 30);
        jRadioButtonFisica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {

                jRadioButtonJuridica.setSelected(false);
                jRadioButtonFisica.setSelected(true);
                jLabelCpfOuCnpj.setText("CPF :");
                jFormattedTextFieldCpnfOuCnpj.grabFocus();
                try
                {
                    jFormattedTextFieldCpnfOuCnpj.setText(null);
                    jFormattedTextFieldCpnfOuCnpj.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("###.###.###-##")));
                }
                catch(java.text.ParseException ex)
                {
                    ex.printStackTrace();
                }
            }
        });

        jRadioButtonJuridica = new JRadioButton("Pessoa Jurídica", false);
        jRadioButtonJuridica.setBounds(300, 100, 120, 30);
        jRadioButtonJuridica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {

                jRadioButtonJuridica.setSelected(true);
                jRadioButtonFisica.setSelected(false);
                jLabelCpfOuCnpj.setText("CNPJ :");
                jFormattedTextFieldCpnfOuCnpj.grabFocus();
                try
                {
                    jFormattedTextFieldCpnfOuCnpj.setText(null);
                    jFormattedTextFieldCpnfOuCnpj.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("##.###.###/####-##")));
                    jFormattedTextFieldCpnfOuCnpj.setText(null);
                }
                catch(java.text.ParseException ex)
                {
                    ex.printStackTrace();
                }
            }
        });

        jLabelEndereco = new JLabel("Endereço :");
        jLabelEndereco.setBounds(20, 180, 60, 20);
        jTextFieldEndereco = new JTextField("");
        jTextFieldEndereco.setBounds(90, 180, 350, 20);

        jLabelCidade = new JLabel("Cidade :");
        jLabelCidade.setBounds(20, 220, 60, 20);
        jTextFieldCidade = new JTextField("");
        jTextFieldCidade.setBounds(90, 220, 350, 20);

        jLabelEstado = new JLabel("Estado :");
        jLabelEstado.setBounds(20, 260, 60, 20);
        jComboBoxEstado = new JComboBox<>();
        List todosEstados = new Estado().lista();
        String [] estados = new String[todosEstados.size()];
        int j=0;
        for(Object obj:todosEstados){
            Estado estado = (Estado)obj;
            estados[j]= String.valueOf(estado.getId()) + " - " + estado.getNome();
            j++;
        }
        jComboBoxEstado.setModel(new DefaultComboBoxModel<>(estados));

        jComboBoxEstado.setBounds(90, 260, 250, 20);

        this.jPaneCampos.setSize(550, 900);

        this.jPaneCampos.add(jLabelCodigo);
        this.jPaneCampos.add(jTextFieldCodigo);

        this.jPaneCampos.add(jLabelNome);
        this.jPaneCampos.add(jTextFieldNome);

        this.jPaneCampos.add(jLabelEndereco);
        this.jPaneCampos.add(jTextFieldEndereco);

        this.jPaneCampos.add(jLabelCidade);
        this.jPaneCampos.add(jTextFieldCidade);

        this.jPaneCampos.add(jRadioButtonFisica);
        this.jPaneCampos.add(jRadioButtonJuridica);

        this.jPaneCampos.add(jLabelCpfOuCnpj);
        this.jPaneCampos.add(jFormattedTextFieldCpnfOuCnpj);

        this.jPaneCampos.add(jLabelEstado);
        this.jPaneCampos.add(jComboBoxEstado);

    }

    @Override
    public void PreencherCampos(Object obj) {
        Cliente cliente;
        Generica.Limpar_Campos_Tela(this.jPaneCampos,obj==null);
        if (obj == null) {
            return;
        }
        for (Iterator it = registros.iterator(); it.hasNext();) {
            cliente = (Cliente) it.next();
            if (cliente.getId().equals(obj)) {
                jTextFieldCodigo.setText(cliente.getId().toString());
                jTextFieldNome.setText(cliente.getNome());

                if(cliente.getCpfOuCnpj().length() == 18)
                {
                    jRadioButtonFisica.setSelected(false);
                    jRadioButtonJuridica.setSelected(true);
                    try
                    {
                        jFormattedTextFieldCpnfOuCnpj.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("##.###.###/####-##")));
                    }
                    catch(java.text.ParseException ex)
                    {
                        ex.printStackTrace();
                    }
                }
                else
                {
                    jRadioButtonFisica.setSelected(true);
                    jRadioButtonJuridica.setSelected(false);
                    try
                    {
                        jFormattedTextFieldCpnfOuCnpj.setFormatterFactory(new DefaultFormatterFactory(new MaskFormatter("###.###.###-##")));
                    }
                    catch(java.text.ParseException ex)
                    {
                        ex.printStackTrace();
                    }
                }
                jFormattedTextFieldCpnfOuCnpj.setText(cliente.getCpfOuCnpj());
                jTextFieldEndereco.setText(cliente.getEndereco());
                jTextFieldCidade.setText(cliente.getCidade());
                jComboBoxEstado.setSelectedItem(cliente.getEstado());
                Estado estado = cliente.getEstado();
                int id = estado.getId();
                jComboBoxEstado.setSelectedIndex(id-1);
            }
        }
    }

    @Override
    public void PopularListaDeRegistros() {
        Cliente obj = new Cliente();
        registros = obj.listar();
    }
    //</editor-fold>

     private Integer pegaIdEstado(String string) {
        int id = Integer.parseInt(string.substring(0,2).trim());
        return id;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Catch;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko;
using osu.Game.Rulesets.Taiko.Objects;

namespace PpCalculator
{
    public class CtbCalculator : PpCalculator
    {
        protected override Ruleset Ruleset { get; } = new CatchRuleset();

        protected override int GetMaxCombo(IReadOnlyList<HitObject> hitObjects) =>
            hitObjects.Count(h => h is Fruit)
            + hitObjects.OfType<JuiceStream>().SelectMany(j => j.NestedHitObjects).Count(h => !(h is TinyDroplet));

        protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy, IReadOnlyList<HitObject> hitObjects, int countMiss, int? countMeh, int? countGood, int? countKatu = null, int? hit300 = null)
        {
            var maxCombo = GetMaxCombo(hitObjects);
            int maxTinyDroplets = hitObjects.OfType<JuiceStream>().Sum(s => s.NestedHitObjects.OfType<TinyDroplet>().Count());
            int maxDroplets = hitObjects.OfType<JuiceStream>().Sum(s => s.NestedHitObjects.OfType<Droplet>().Count()) - maxTinyDroplets;
            int maxFruits = hitObjects.OfType<Fruit>().Count() + 2 * hitObjects.OfType<JuiceStream>().Count() + hitObjects.OfType<JuiceStream>().Sum(s => s.RepeatCount);

            // Either given or max value minus misses
            int countDroplets = countGood ?? Math.Max(0, maxDroplets - countMiss);

            // Max value minus whatever misses are left. Negative if impossible missCount
            int countFruits = maxFruits - (countMiss - (maxDroplets - countDroplets));

            // Either given or the max amount of hit objects with respect to accuracy minus the already calculated fruits and drops.
            // Negative if accuracy not feasable with missCount.
            int countTinyDroplets = countMeh ?? (int)Math.Round(accuracy * (maxCombo + maxTinyDroplets)) - countFruits - countDroplets;

            // Whatever droplets are left
            int countTinyMisses = countKatu ?? maxTinyDroplets - countTinyDroplets;

            return new Dictionary<HitResult, int>
            {
                { HitResult.Great, countFruits },
                { HitResult.LargeTickHit, countDroplets },
                { HitResult.SmallTickHit, countTinyDroplets },
                { HitResult.SmallTickMiss, countTinyMisses },
                { HitResult.Miss, countMiss }
            };
        }

        protected override double GetAccuracy(Dictionary<HitResult, int> statistics)
        {
            double hits = statistics[HitResult.Great] + statistics[HitResult.LargeTickHit] + statistics[HitResult.SmallTickHit];
            double total = hits + statistics[HitResult.Miss] + statistics[HitResult.SmallTickMiss];

            return hits / total;
        }
    }
}