text: python matrix_x_vector.py

redpajama_set_name: RedPajamaGithub


text:
namespace base {
class ListValue;
}

// Handler class for the Device Emulator page operations.
class DeviceEmulatorMessageHandler
    : public content::WebUIMessageHandler,
      public chromeos::PowerManagerClient::Observer {
 public:
  DeviceEmulatorMessageHandler();
  ~DeviceEmulatorMessageHandler() override;

  // Callbacks for JS request methods. All these methods work
  // asynchronously.
  void RequestPowerInfo(const base::ListValue* args);

  // Callback for the "requestBluetoothDiscover" message. This asynchronously
  // requests for the system to discover a certain device. The device's data
  // should be passed into |args| as a dictionary. If the device does not
  // already exist, then it will be created and attached to the main adapter.
  void HandleRequestBluetoothDiscover(const base::ListValue* args);

  // Callback for the "requestBluetoothPair" message. This asynchronously
  // requests for the system to pair a certain device. The device's data should
  // be passed into |args| as a dictionary. If the device does not already
  // exist, then it will be created and attached to the main adapter.
  void HandleRequestBluetoothPair(const base::ListValue* args);

  // Callbacks for JS update methods. All these methods work
  // asynchronously.
  void UpdateBatteryPercent(const base::ListValue* args);
  void UpdateExternalPower(const base::ListValue* args);
  void UpdateTimeToEmpty(const base::ListValue* args);
  void UpdateTimeToFull(const base::ListValue* args);

  // Adds |this| as an observer to all necessary objects.
  void Init();

  // chromeos::PowerManagerClient::Observer:
  void PowerChanged(const power_manager::PowerSupplyProperties& proto) override;

  // content::WebUIMessageHandler:
  void RegisterMessages() override;

 private:
  chromeos::FakePowerManagerClient* fake_power_manager_client_;

  DISALLOW_COPY_AND_ASSIGN(DeviceEmulatorMessageHandler);
};

#endif  // CHROME_BROWSER_UI_WEBUI_CHROMEOS_EMULATOR_DEVICE_EMULATOR_MESSAGE_HANDLER_H_


text:
*I recently started [building a Geo Tracker App in Titanium](http://www.appcelerator.com/blog/2016/04/building-a-geo-tracker-app-in-titanium/) to [support Compassion](http://www.fokkezb.nl/rwanda) and [open-sourced the code](../) for us all to learn from. I will guide you through the code in a series of blog posts and share some best practices as I continue to develop the app.*

Let's start with some new Titanium features the app uses.

## A single DefaultIcon to rule them all

You used to have a whole bunch of `appicon*.png` images in [app/assets/iphone](../app/assets/iphone) to cater for all the different Apple devices and the different places where they display the icon.

Since Titanium 5.0 you can now have a single 1024px by 1024px [DefaultIcon.png](../DefaultIcon.png) in the root of your project and Titanium will generate these icons for you. This is also supported for Windows. Android will follow soon. Since those platforms support 32-bit PNG and iOS demands 24-bit, you can provide a `DefaultIcon-ios.png` specifically for iOS.

## A single Storyboard Launch File for all iOS devices

In addition to icons you also used to have a big set of `Default*.png` images in [app/assets/iphone](../app/assets/iphone) to be used as Launch Image (aka Splash Screen).

Since Titanium 5.2.0 you can now use a builtin or custom Xcode Storyboard as Launch File. These are the same storyboards that you'd use to build the interface of your app in Xcode. They can contain most of the available UI controls, including images. When your app first launches, iOS will capture a static image which it will use as Launch Image.

> **NOTE:** The iPad Pro is the first device that only support Launch Files.

### Using the builtin Storyboard

The *G.O. Tracker* uses the builtin in storyboard. This storyboard displays a centered image on a single color background. By default it uses the `DefaultIcon.png` to generate the image and a white background color.

In the app's [tiapp.xml](../tiapp.xml#L18) you can see how I enable the Launch Screen Storyboard and override the default background color to match the blue of the [DefaultIcon.png](../DefaultIcon.png). Finally I set the minimum supported iOS version to 8.0 so I don't need to include traditional Launch Images for older devices. Titanium 5.3 will do this [automatically](https://jira.appcelerator.org/browse/TIMOB-23172).

```xml
  <ios>
    <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
    <default-background-color>#0054a6</default-background-color>
    <min-ios-ver>8.0</min-ios-ver>
    ...
```

To learn more about using a different image or even a fully custom Storyboard read [Titanium 5.2.0: Launch Files, iPad Pro, Slide Over and Split View](http://www.appcelerator.com/blog/2016/02/titanium-5-2-0-launch-files-ipad-pro-slide-over-and-split-view/).

## Less and smaller Android launch images with 9-Patch

On Android you can do with less and smaller launch/splash images as well thanks to [Nine-patch](http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch). These stretchable bitmaps allow you to achieve the same result as our builtin iOS Storyboard Launch File.

### How Nine-patch works
If you zoom into the [background.9.png](../app/platform/android/res/drawable-xxxhdpi/background.9.png) files in the [app/platform/android/res](../app/platform/android/res) folder you'll notice that the PNGs have a 1px transparent border with some black pixels on each side. The black pixels on te top and left side indicate where the image can be stretched while the right and bottom side indicate the area in which any child views need to be contained.

> **NOTE:** Even though the Android documentation still states the padding box (right and bottom pixels) are optional, [they are not](https://jira.appcelerator.org/browse/TIMOB-19190). Since Android 4.x you will see black blocks across the splash screen if you leave them out.

### Generating them with TiCons

You can use the TiCons [CLI](https://www.npmjs.com/package/ticons) or [website](http://ticons.fokkezb.nl/) to generate these 9-Patch splash using the `DefaultIcon.png` or another image. TiCons will add a transparent border with pixels to make only the outermost pixel of your image stretchable. With our [DefaultIcon.png](../DefaultIcon.png) this will result in a blue splash screen with the icon centerered, just like we have for iOS.

Code Strong, Code with Compassion! 🚴


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package fatec.br.projetormi.cliente.servidor.GUI;

import fatec.br.projetormi.servidor.DAO.Cadastro_produtosDAO;
import fatec.br.projetormi.servidor.VO.Cadastro_produtosVO;
import viotti.Banco.Conexao;
import java.sql.SQLException;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel;

/**
 *
 * @author Ynhic <ynhic@hotmail.com>
 */
public class ListaProdutosLeiloarServidorGUI extends javax.swing.JFrame {

    //atributos
    Conexao conexao = new Conexao();
    Cadastro_produtosDAO cadastro_ProdutosDAO = new Cadastro_produtosDAO(conexao);
    Cadastro_produtosVO cadastro_produtosVO = new Cadastro_produtosVO();
    String status;

    private DefaultTableModel tableModelProduto;

    /**
     * Creates new form ListaProdutosGUI
     */
    public ListaProdutosLeiloarServidorGUI() {
        initComponents();
    }
    //metodos

    private void preencherTable() {
        Vector colunas = new Vector(4);
        colunas.add("Cod");
        colunas.add("Nome produto");
        colunas.add("Descrição");
        colunas.add("Lance inicial");

        status = "NAT";

        try {
            Vector<Cadastro_produtosVO> dado = (Vector) cadastro_ProdutosDAO.listar(status);

            tableModelProduto = new DefaultTableModel();
            tableModelProduto.setColumnIdentifiers(colunas);

            tb_produtos.setModel(tableModelProduto);
            TableColumnModel modeloDaColuna = tb_produtos.getColumnModel();
            modeloDaColuna.getColumn(0).setMaxWidth(35);
            modeloDaColuna.getColumn(1).setMaxWidth(100);
            modeloDaColuna.getColumn(2).setMaxWidth(600);
            modeloDaColuna.getColumn(3).setMaxWidth(100);
            //for no estilo lambda
            dado.forEach((x) -> {
                tableModelProduto.addRow(x.toVector());
            });

        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "problema de conexão" + ex, "Erro", JOptionPane.WARNING_MESSAGE);
        }
        tb_produtos.setModel(tableModelProduto);

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        bt_voltar = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tb_produtos = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Lista de Produtos");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Lista produtos"));

        bt_voltar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fatec/br/projetormi/cliente/imagens/left-arrow.png"))); // NOI18N
        bt_voltar.setText("Voltar");
        bt_voltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_voltarActionPerformed(evt);
            }
        });

        tb_produtos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tb_produtos.setCellSelectionEnabled(true);
        tb_produtos.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        tb_produtos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tb_produtos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tb_produtosMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tb_produtos);

        jLabel1.setText("Produtos para leiloar");
        jLabel1.setName(""); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(bt_voltar, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(23, 23, 23)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(bt_voltar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel5.setFont(new java.awt.Font("Yu Gothic UI Light", 1, 18)); // NOI18N
        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fatec/br/projetormi/cliente/imagens/auction-hammer-icon (1).png"))); // NOI18N
        jLabel5.setText("      Fatec Leilão");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(299, 299, 299)
                .addComponent(jLabel5)
                .addContainerGap(269, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        /**
         * Este metodo preenche a tabela com os produtos cadastrados após o form
         * ser iniciado
         */
        conexao.setNomeBanco("LEILAOAPP");
        conexao.setPorta(3306);
        conexao.setSenha("");
        conexao.setServidor("localhost");
        conexao.setUsuario("root");
        preencherTable();

    }//GEN-LAST:event_formWindowOpened

    private void tb_produtosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tb_produtosMouseClicked

        int selecionada = tb_produtos.getSelectedRow();
        if (selecionada == -1) {
            System.out.println("nada selecionado"); //Não tem nada selecionado
        } else {
            System.out.println(tb_produtos.getValueAt(selecionada, 1));
        }

        //String cpf = suaTable.getValueAt(linhaSelecionada, 0).toString();
        System.out.println("clicou");
        LeilaoServidorGUI leilaoGUI = new LeilaoServidorGUI();

        leilaoGUI.setVisible(true);
        leilaoGUI.cod_produto = (String) tb_produtos.getValueAt(selecionada, 0);
        leilaoGUI.nome_produto = (String) tb_produtos.getValueAt(selecionada, 1);
        leilaoGUI.descricao_prodto = (String) tb_produtos.getValueAt(selecionada, 2);
        leilaoGUI.lance_inicial = (String) tb_produtos.getValueAt(selecionada, 3);

        this.dispose();
    }//GEN-LAST:event_tb_produtosMouseClicked

    private void bt_voltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_voltarActionPerformed
        LeilaoServidorGUI leilaoGUI = new LeilaoServidorGUI();
        leilaoGUI.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_bt_voltarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ListaProdutosLeiloarServidorGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ListaProdutosLeiloarServidorGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ListaProdutosLeiloarServidorGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ListaProdutosLeiloarServidorGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ListaProdutosLeiloarServidorGUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bt_voltar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable tb_produtos;
    // End of variables declaration//GEN-END:variables
}


text:
layout: default
---

            {% if site.author.workHistory %}

工作经历

                    {% for work in site.author.workHistory %}

                            {% if work.started %}

{{ work.started }}

                            {% endif %}

                                    {% if work.company %}

{{ work.company }}

                                    {% endif %}

                                            {% if work.title %}
                                                {{ work.title }}
                                            {% endif %}

                                            {% if work.duration %}
                                                 {{ work.duration }} |
                                            {% endif %}
                                            {% if work.location %}
                                                  {{ work.location }}
                                            {% endif %}

                                    {% if work.description %}

{{ work.description }}

                                    {% endif %}

                    {% endfor %}

            {% endif %}
            {% if site.author.projectHistory %}

项目经历

                {% for project in site.author.projectHistory %}

                    {% if project.started %}

{{ project.started }}

                    {% endif %}

                            {% if project.projectname %}

{{ project.projectname }}

                            {% endif %}

                                    {% if project.company %}
                                    {{ project.company }}
                                    {% endif %}

                                    {% if project.duration %}
                                     {{ project.duration }} |
                                    {% endif %}
                                    {% if project.location %}
                                      {{ project.location }}
                                    {% endif %}

                            {% if project.description %}

{{ project.description }}

                            {% endif %}

                {% endfor %}

            {% endif %}
            {% if site.author.educationHistory %}

教育经历

                    {% for education in site.author.educationHistory %}

                            {% if education.started %}

{{ education.started }}

                            {% endif %}

                                    {% if education.organization %}

{{ education.organization }}

                                    {% endif %}

                                            {% if education.degree %}
                                                {{ education.degree }}
                                            {% endif %}
                                            {% if education.major %}
                                                , {{ education.major }}
                                            {% endif %}

                                            {% if education.duration %}
                                                 {{ education.duration }} |
                                            {% endif %}
                                            {% if education.location %}
                                                  {{ education.location }}
                                            {% endif %}

                                    {% if education.description %}

{{ education.description }}

                                    {% endif %}

                    {% endfor %}

            {% endif %}

            {% if site.author.stackoverflow or site.author.programmingSkills %}

 编程技术

                {% if site.author.stackoverflow %}

                {% endif %}
                {% if site.author.programmingSkills %}

                        {% for programmingSkill in site.author.programmingSkills %}

                                {% if programmingSkill.name %}
                                    {{ programmingSkill.name }}
                                {% endif %}
                                {% if programmingSkill.percentage %}

                                            {{ programmingSkill.percentage }}

                                {% endif %}

                        {% endfor %}

                {% endif %}
            {% endif %}
            {% if site.author.languages %}

 语言技能

                        {% for language in site.author.languages %}
                            {% if language.name %}
                                {% if language.proficiency %}

                                         {{ language.proficiency }}{{ language.name }}

                                {% endif %}
                            {% endif %}
                        {% endfor %}

            {% endif %}
            {% if site.author.awards %}

 奖励荣誉

                    {% for award in site.author.awards %}
                    {% if award.name %}

                        {{ award.name }}

                    {% endif %}
                    {% endfor %}

            {% endif %}


text:
Catarse moip integration with [Catarse](http://github.com/danielweinmann/catarse) crowdfunding platform

## Installation

Add this lines to your Catarse application's Gemfile:

    gem 'catarse_moip'

And then execute:

    $ bundle

## Usage

Configure the routes for your Catarse application. Add the following lines in the routes file (config/routes.rb):

    mount CatarseMoip::Engine => "/", :as => "catarse_moip"

### Configurations

Create this configurations into Catarse database:

    moip_uri, moip_token and moip_key

In Rails console, run this:

    Configuration.create!(name: "moip_uri", value: "https://desenvolvedor.moip.com.br/sandbox")
    Configuration.create!(name: "moip_token", value: "TOKEN")
    Configuration.create!(name: "moip_key", value: "KEY")

## Development environment setup

Clone the repository:

    $ git clone git://github.com/devton/catarse_moip.git

Add the catarse code into test/dummy:

    $ git submodule add git://github.com/danielweinmann/catarse.git test/dummy

Copy the Catarse's gems to Gemfile:

    $ cat test/dummy/Gemfile >> Gemfile

And then execute:

    $ bundle

## Troubleshooting in development environment

Remove the admin folder from test/dummy application to prevent a weird active admin bug:

    $ rm -rf test/dummy/app/admin

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

This project rocks and uses MIT-LICENSE.


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 97(1): 169 (2005)

#### Original name
Kodamaea laetipori S.O. Suh & M. Blackw., 2005

### Remarks
null


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="net.magmastone.scannerclient.NewItemActivity">
    <item android:id="@+id/action_settings" android:title="Save" android:icon="@drawable/ic_action_accept"
        android:orderInCategory="100" app:showAsAction="ifRoom" />
</menu>


text:
function [ sTrain, sTest] = crossvalidation_extractsubset( database, i )
%CROSSVALIDATION_EXTRACTSUBSET Summary of this function goes here
%   Detailed explanation goes here

    curr_data = database(i).data;
    curr_fold = database(i).folds;

    train = database(i).folds.train;
    test  = database(i).folds.test;

    sTrain = struct('i', curr_data.i(train, :), 'in', curr_data.in(train, :), 't', curr_data.t(train, :), 'p', curr_data.p(train, :));
    sTest  = struct('i', curr_data.i(test, :), 'in', curr_data.in(test, :), 't', curr_data.t(test, :), 'p', curr_data.p(test, :));

end


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_84_goodB2G.cpp
Label Definition File: CWE761_Free_Pointer_Not_at_Start_of_Buffer.label.xml
Template File: source-sinks-84_goodB2G.tmpl.cpp
*/
/*
 * @description
 * CWE: 761 Free Pointer not at Start of Buffer
 * BadSource: console Read input from the console
 * Sinks:
 *    GoodSink: free() memory correctly at the start of the buffer
 *    BadSink : free() memory not at the start of the buffer
 * Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use
 *
 * */
#ifndef OMITGOOD

#include "std_testcase.h"
#include "CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_84.h"

#define SEARCH_CHAR L'S'

namespace CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_84
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_84_goodB2G::CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_84_goodB2G(wchar_t * dataCopy)
{
    data = dataCopy;
    {
        /* Read input from the console */
        size_t dataLen = wcslen(data);
        /* if there is room in data, read into it from the console */
        if (100-dataLen > 1)
        {
            /* POTENTIAL FLAW: Read data from the console */
            if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
            {
                /* The next few lines remove the carriage return from the string that is
                 * inserted by fgetws() */
                dataLen = wcslen(data);
                if (dataLen > 0 && data[dataLen-1] == L'\n')
                {
                    data[dataLen-1] = L'\0';
                }
            }
            else
            {
                printLine("fgetws() failed");
                /* Restore NUL terminator if fgetws fails */
                data[dataLen] = L'\0';
            }
        }
    }
}

CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_84_goodB2G::~CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_84_goodB2G()
{
    {
        size_t i;
        /* FIX: Use a loop variable to traverse through the string pointed to by data */
        for (i=0; i < wcslen(data); i++)
        {
            if (data[i] == SEARCH_CHAR)
            {
                printLine("We have a match!");
                break;
            }
        }
        free(data);
    }
}
}
#endif /* OMITGOOD */


text:
#if !defined(XERCESWRAPPERTOXALANNODEMAP_HEADER_GUARD_1357924680)
#define XERCESWRAPPERTOXALANNODEMAP_HEADER_GUARD_1357924680

#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>

#include <xalanc/Include/XalanMap.hpp>

#include <xalanc/XercesParserLiaison/XercesWrapperTypes.hpp>

namespace XALAN_CPP_NAMESPACE {

class XalanNode;

class XALAN_XERCESPARSERLIAISON_EXPORT XercesWrapperToXalanNodeMap
{
public:

    typedef XalanMap<const DOMNodeType*, XalanNode*>    XercesNodeMapType;

    XercesWrapperToXalanNodeMap(MemoryManager& theManager);

    ~XercesWrapperToXalanNodeMap();

    MemoryManager&
    getMemoryManager()
    {
        return m_xercesMap.getMemoryManager();
    }

    void
    addAssociation(
            const DOMNodeType*  theXercesNode,
            XalanNode*          theXalanNode);

    void
    clear();

    XalanNode*
    getNode(const DOMNodeType*  theXercesNode) const;

private:

    XercesNodeMapType   m_xercesMap;
};

}

#endif  // !defined(XERCESWRAPPERTOXALANNODEMAP_HEADER_GUARD_1357924680)


text:
package com.sayemahmed.example.validation;

import org.springframework.stereotype.Repository;

import lombok.extern.slf4j.Slf4j;

@Repository
@Slf4j
public class MenuRepository {

  public boolean menuExists(String menuId) {
    log.info("Menu id {}.", menuId);
    return true;
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

MEDLINE ENEMA- sodium phosphate, dibasic and sodium phosphate, monobasic enema
Medline Industries, Inc.

Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.

Medline Industries, Inc. Sodium Phosphate Enema Drug Facts

Active ingredient (in each 118 mL delivered dose)

Sodium Phosphate (Monobasic 19g and Dibasic 7g)

Purpose

Saline Laxative

Uses

relieves occasional constipation

generally produces bowel movement in 1 to 5 minutes.

Professional use:  for use as part of a bowel cleansing regimen for:

preparing patient for surgery

preparing colon for x-ray endoscopic examination.

Warnings

Dosage warning: Using more than one enema in 24 hours can be harmful. Do not give to children under 2 years of age unless directed by a doctor.

CAUTION: FOR RECTAL USE ONLY.

Do not use:

if you are on a low salt diet

when abdominal pain, nausea or vomiting are present

for a period longer than 1 week

in patients with megacolon (as hypernatremic dehydration may occur)

Ask a doctor or pharmacist before use if you are

taking any other drug.  Take this product two or more hours before or after other drugs. Laxatives may affect how other drugs work.

Ask a doctor before using any laxative if you have:

kidney disease or impaired renal function

noticed a sudden change in bowel habits that last over 2 weeks

When using this product, do not use more than directed.

Serious side effects may occur from excess dosage.

Stop using and ask a doctor if:

symptoms last more than 2 weeks

you have rectal bleeding or fail to have a bowel movement after using this product.  This may indicate a serious condition.

If pregnant or breastfeeding,

ask a health professional before use.

Keep out of reach of children

If swallowed, get medical help or contact a Poison Control Center right away.

Directions

CAUTION: remove green protective shield before inserting: hold bottle upright, grasping bottle cap with fingers.  Grasp protective shield with other hand and pull gently to remove.

Do not use more unless directed by a doctor.  See Warnings.

<col width="48.9%">
<col width="51.1%">

adults & children 12 years and older
one bottle once daily

children 2 to under 12 years
½ bottle once daily

children under 2 years
do not use

Positioning:

Left-side position: lie on left side with knee bent and arms at rest.

Knee-chest position: kneel, then lower head and chest forward until left side of face is resting on surface.  Position arms comfortably.

Administering Enema:

With steady pressure, gently insert enema with tip pointing toward navel.

Squeeze bottle until recommended dose is expelled (It is not necessary to empty unit completely.  Bottle contains more liquid than needed for effective use.  A small amount of liquid will remain in bottle after squeezing.)

Remove tip from rectum.

Discontinue use if resistance is encountered, forcing the enema can result in injury.

Maintain position until urge to evacuate is strong (usually 1 to 5 minutes).

Other Information

each 118 mL delivered dose contains: sodium 4.4 g

bottle, cap and shield are latex-free.

Consult Physicians' Desk Reference® for complete professional labeling.

Inactive Ingredients

benzalkonium chloride, disodium EDTA and purified water.

Principal Display Panel

Complete

Enema

Ready-to-Use

Sodium Phosphates

Comfortable, lubricated tip

For relief of constipation and bowel cleansing

Latex free product

Contents: 1 Each

Sodium Phosphate Enema Carton

MEDLINE ENEMA

sodium phosphate enema

Product Information

Product Type
HUMAN OTC DRUG LABEL
Item Code (Source)
NDC:53329-007

Route of Administration
RECTAL
DEA Schedule

Active Ingredient/Active Moiety

Ingredient Name
Basis of Strength
Strength

SODIUM PHOSPHATE, DIBASIC (PHOSPHORIC ACID)
SODIUM PHOSPHATE, DIBASIC
7 g  in 118 mL

SODIUM PHOSPHATE, MONOBASIC (PHOSPHORIC ACID)
SODIUM PHOSPHATE, MONOBASIC
19 g  in 118 mL

Packaging

#
Item Code
Package Description
Marketing Start Date
Marketing End Date

1
NDC:53329-007-11
1  in 1 CARTON

1

133 mL in 1 BOTTLE

Marketing Information

Marketing Category
Application Number or Monograph Citation
Marketing Start Date
Marketing End Date

OTC monograph not final
part334
01/06/2010

Labeler - Medline Industries, Inc.
							(025460908)

Revised: 1/2010

Document Id: d26aa127-0aff-43b2-b5f3-fca9bd58cc7f

Set id: d26aa127-0aff-43b2-b5f3-fca9bd58cc7f

Version: 1

Effective Time: 20100105

Medline Industries, Inc.


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Pagination Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are used by the paginator library to build
    | the simple pagination links. You are free to change them to anything
    | you want to customize your views to better match your application.
    |
    */

    'position'=>'Localización del local',
    'create' => 'Cuéntanos sobre tu local',
    'name' => 'Nombre',
    'picture' => 'Imagen de :name',
    'city'=>'Ciudad',
    'position'=>'Dinos donde podemos encontrarte',
    'region'=>'Region',
    'description'=>'Descripción',
    'description_ref'=>'Mira la descripción',
    'description_desc'=>'Añade una descripción del local donde albergaras los eventos y incluye información relevante como podria ser el horario de apertura. Esta información puede ser tan simple o detallada como tu desees!',
    'save'=>'Guarda y empieza a compartir eventos',
    'back'=>'Volver al perfil',
    'selectimage'=>'Imagen de la organización',
    'selectimage_desc'=>'Nota: Selecciona una imagen representativa (ej. Logo) del local donde harás tus eventos para hacerlo mas fácil de encontrar.',
    'addimages'=>'Añadir imagenes',
    'addimage'=>'Añadir imagen',
    'manage'=>'Administrar',
    'manage_images'=>'Administrar las imagenes.',
    'no_images_add'=>'Tu local no tiene imagenes. Añade alguna',
    'yourlist'=>'Mi lista de locales',
    'activado'=>'Activar local',
    'actualizar'=>'Modificar',
    'edit'=>'Editar este local',
    'editing'=>'Editar localización',
    'select'=>'Seleccionar',
    'myevents'=>'Mis eventos',
    'orgevents'=>'Eventos organizados',
    'empty'=>'Actualmente no hay locales.',
    'owner'=>'Propietario:',
    'findus'=>'Encuéntranos',
    'at'=>'A las',
    'assists'=>'asistente|asistentes',
    'deleteimages'=>'Eliminar imagen',
    'msjadd'=>'Imagen actualizada!',
    'msjdelete'=>'Imagen eliminada!',
    'msj'=>'Notificación',
    'modificarimagen'=>'Cambiar imagen',
    'search'=>'Buscar locales',
    'addevent'=>'Añade un nuevo evento',
    'noneevent'=>'No hay eventos proximos.'

];


text:
{% extends 'comm/emails/base.html' %}

{% block content %}
After reviewing your submission for {{ app.name }}, we have determined that it does not currently meet our requirements for approval.

{% include 'comm/emails/includes/details.html' %}
{% include 'comm/emails/includes/questions.html' %}

Once the concerns above have been addressed, you may resubmit your app from the My Submissions page at {{ app.get_dev_url('versions')|absolutify }}.
{% endblock %}


text:
1. Clone the repository
2. ```git submodule init```
3. ```git submodule update --remote```
4. ```cmake .```
5. ```make```

## Running the program
It can be a good idea to run ```./stardecbin -h```

The folder ```resources``` contains examples of graphs to have an idea of the syntax for the input file.
Basically it is:
* ```arg(arg).``` to define an argument ```arg``` (it can be any alphanum label)
* ```att(arg1, arg2).``` to define an attack from ```arg1``` to ```arg2``` (they need to be defined first)
* ```goal(arg)``` to define the goal for the persuader in the dialogue (the argument needs to be defined first)

## Choose you functions
Some functions (decision, evaluation, updating, etc.) are already defined. If you want to define your own, just follow the stubs that are given in the different headers included (most of them are in ```tree.h```).
You then just need to replace the function in the main.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>phpCAS: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

phpCAS
    version 1.4.0

CAS_ProxiedService_Testable Member List

This is the complete list of members for CAS_ProxiedService_Testable, including all inherited members.

setCasClient(CAS_Client $casClient)	CAS_ProxiedService_Testable

<address class="footer">
Generated by

 1.8.13
</address>


text:
package io.gravitee.rest.api.portal.rest.mapper;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import io.gravitee.alert.api.condition.AggregationCondition;
import io.gravitee.alert.api.condition.RateCondition;
import io.gravitee.alert.api.condition.ThresholdRangeCondition;
import io.gravitee.rest.api.model.alert.AlertTriggerEntity;
import io.gravitee.rest.api.model.alert.NewAlertTriggerEntity;
import io.gravitee.rest.api.model.alert.UpdateAlertTriggerEntity;
import io.gravitee.rest.api.portal.rest.model.Alert;
import io.gravitee.rest.api.portal.rest.model.AlertInput;
import io.gravitee.rest.api.portal.rest.model.AlertTimeUnit;
import io.gravitee.rest.api.portal.rest.model.AlertType;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
import org.assertj.core.api.Condition;
import org.junit.Before;
import org.junit.Test;

/**
 * @author Yann TAVERNIER (yann.tavernier at graviteesource.com)
 * @author GraviteeSource Team
 */
public class AlertMapperTest {

    private AlertMapper alertMapper;

    @Before
    public void setUp() {
        alertMapper = new AlertMapper();
    }

    @Test
    public void convertAlertInputToNewAlertTriggerEntityStatus200() {
        final AlertInput alertInput = new AlertInput();
        alertInput.setEnabled(true);
        alertInput.setStatusCode("200");
        alertInput.setStatusPercent(20);
        alertInput.setDuration(10);
        alertInput.setTimeUnit(AlertTimeUnit.MINUTES);
        alertInput.setType(AlertType.STATUS);

        final NewAlertTriggerEntity actual = alertMapper.convert(alertInput);

        assertThat(actual.isEnabled()).isEqualTo(alertInput.getEnabled());
        assertThat(actual.getType()).isEqualTo(AlertMapper.STATUS_ALERT);

        final RateCondition rateCondition = (RateCondition) actual.getConditions().get(0);
        assertThat(rateCondition.getDuration()).isEqualTo(alertInput.getDuration().longValue());
        assertThat(rateCondition.getTimeUnit()).isEqualTo(TimeUnit.MINUTES);
        assertThat(rateCondition.getThreshold()).isEqualTo(alertInput.getStatusPercent().doubleValue());

        final ThresholdRangeCondition condition = (ThresholdRangeCondition) rateCondition.getComparison();
        assertThat(condition.getProperty()).isEqualTo("response.status");
        assertThat(condition.getThresholdLow()).isEqualTo(200D);
        assertThat(condition.getThresholdHigh()).isEqualTo(200D);
    }

    @Test
    public void convertAlertInputToNewAlertTriggerEntityStatus2xx() {
        final AlertInput alertInput = new AlertInput();
        alertInput.setEnabled(true);
        alertInput.setStatusCode("2xx");
        alertInput.setStatusPercent(20);
        alertInput.setDuration(10);
        alertInput.setTimeUnit(AlertTimeUnit.MINUTES);
        alertInput.setType(AlertType.STATUS);

        final NewAlertTriggerEntity actual = alertMapper.convert(alertInput);

        assertThat(actual.isEnabled()).isEqualTo(alertInput.getEnabled());
        assertThat(actual.getType()).isEqualTo(AlertMapper.STATUS_ALERT);

        final RateCondition rateCondition = (RateCondition) actual.getConditions().get(0);
        assertThat(rateCondition.getDuration()).isEqualTo(alertInput.getDuration().longValue());
        assertThat(rateCondition.getTimeUnit()).isEqualTo(TimeUnit.MINUTES);
        assertThat(rateCondition.getThreshold()).isEqualTo(alertInput.getStatusPercent().doubleValue());

        final ThresholdRangeCondition condition = (ThresholdRangeCondition) rateCondition.getComparison();
        assertThat(condition.getProperty()).isEqualTo("response.status");
        assertThat(condition.getThresholdLow()).isEqualTo(200D);
        assertThat(condition.getThresholdHigh()).isEqualTo(299D);
    }

    @Test
    public void convertAlertInputToNewAlertTriggerEntityResponseTime() {
        final AlertInput alertInput = new AlertInput();
        alertInput.setEnabled(true);
        alertInput.setResponseTime(35);
        alertInput.setDuration(10);
        alertInput.setTimeUnit(AlertTimeUnit.MINUTES);
        alertInput.setType(AlertType.RESPONSE_TIME);

        final NewAlertTriggerEntity actual = alertMapper.convert(alertInput);

        assertThat(actual.isEnabled()).isEqualTo(alertInput.getEnabled());
        assertThat(actual.getType()).isEqualTo(AlertMapper.RESPONSE_TIME_ALERT);

        final AggregationCondition aggregationCondition = (AggregationCondition) actual.getConditions().get(0);
        assertThat(aggregationCondition.getDuration()).isEqualTo(alertInput.getDuration().longValue());
        assertThat(aggregationCondition.getTimeUnit()).isEqualTo(TimeUnit.MINUTES);
        assertThat(aggregationCondition.getThreshold()).isEqualTo(alertInput.getResponseTime().doubleValue());
    }

    @Test
    public void convertAlertInputToUpdateAlertTriggerEntityStatus200() {
        final AlertInput alertInput = new AlertInput();
        alertInput.setEnabled(true);
        alertInput.setStatusCode("200");
        alertInput.setStatusPercent(20);
        alertInput.setDuration(10);
        alertInput.setTimeUnit(AlertTimeUnit.MINUTES);
        alertInput.setType(AlertType.STATUS);

        final UpdateAlertTriggerEntity actual = alertMapper.convertToUpdate(alertInput);

        assertThat(actual.isEnabled()).isEqualTo(alertInput.getEnabled());

        final RateCondition rateCondition = (RateCondition) actual.getConditions().get(0);
        assertThat(rateCondition.getDuration()).isEqualTo(alertInput.getDuration().longValue());
        assertThat(rateCondition.getTimeUnit()).isEqualTo(TimeUnit.MINUTES);
        assertThat(rateCondition.getThreshold()).isEqualTo(alertInput.getStatusPercent().doubleValue());

        final ThresholdRangeCondition condition = (ThresholdRangeCondition) rateCondition.getComparison();
        assertThat(condition.getProperty()).isEqualTo("response.status");
        assertThat(condition.getThresholdLow()).isEqualTo(200D);
        assertThat(condition.getThresholdHigh()).isEqualTo(200D);
    }

    @Test
    public void convertAlertInputToUpdateAlertTriggerEntityStatus2xx() {
        final AlertInput alertInput = new AlertInput();
        alertInput.setEnabled(true);
        alertInput.setStatusCode("2xx");
        alertInput.setStatusPercent(20);
        alertInput.setDuration(10);
        alertInput.setTimeUnit(AlertTimeUnit.MINUTES);
        alertInput.setType(AlertType.STATUS);

        final UpdateAlertTriggerEntity actual = alertMapper.convertToUpdate(alertInput);

        assertThat(actual.isEnabled()).isEqualTo(alertInput.getEnabled());

        final RateCondition rateCondition = (RateCondition) actual.getConditions().get(0);
        assertThat(rateCondition.getDuration()).isEqualTo(alertInput.getDuration().longValue());
        assertThat(rateCondition.getTimeUnit()).isEqualTo(TimeUnit.MINUTES);
        assertThat(rateCondition.getThreshold()).isEqualTo(alertInput.getStatusPercent().doubleValue());

        final ThresholdRangeCondition condition = (ThresholdRangeCondition) rateCondition.getComparison();
        assertThat(condition.getProperty()).isEqualTo("response.status");
        assertThat(condition.getThresholdLow()).isEqualTo(200D);
        assertThat(condition.getThresholdHigh()).isEqualTo(299D);
    }

    @Test
    public void convertAlertInputToUpdateAlertTriggerEntityResponseTime() {
        final AlertInput alertInput = new AlertInput();
        alertInput.setEnabled(true);
        alertInput.setResponseTime(35);
        alertInput.setDuration(10);
        alertInput.setTimeUnit(AlertTimeUnit.MINUTES);
        alertInput.setType(AlertType.RESPONSE_TIME);

        final UpdateAlertTriggerEntity actual = alertMapper.convertToUpdate(alertInput);

        assertThat(actual.isEnabled()).isEqualTo(alertInput.getEnabled());

        final AggregationCondition aggregationCondition = (AggregationCondition) actual.getConditions().get(0);
        assertThat(aggregationCondition.getDuration()).isEqualTo(alertInput.getDuration().longValue());
        assertThat(aggregationCondition.getTimeUnit()).isEqualTo(TimeUnit.MINUTES);
        assertThat(aggregationCondition.getThreshold()).isEqualTo(alertInput.getResponseTime().doubleValue());
    }

    @Test
    public void convertAlertTriggerEntityToAlertStatus200() {
        AlertTriggerEntity alertTriggerEntity = mock(AlertTriggerEntity.class);
        when(alertTriggerEntity.getType()).thenReturn(AlertMapper.STATUS_ALERT);

        final RateCondition rateCondition = mock(RateCondition.class);
        when(alertTriggerEntity.getConditions()).thenReturn(Collections.singletonList(rateCondition));
        when(rateCondition.getTimeUnit()).thenReturn(TimeUnit.MINUTES);
        when(rateCondition.getDuration()).thenReturn(10L);
        when(rateCondition.getThreshold()).thenReturn(20D);

        final ThresholdRangeCondition thresholdRangeCondition = mock(ThresholdRangeCondition.class);
        when(rateCondition.getComparison()).thenReturn(thresholdRangeCondition);
        when(thresholdRangeCondition.getThresholdLow()).thenReturn(200D);
        when(thresholdRangeCondition.getThresholdHigh()).thenReturn(200D);

        final Alert actual = alertMapper.convert(alertTriggerEntity);

        assertThat(actual.getType()).isEqualTo(AlertType.STATUS);
        assertThat(actual.getStatusCode()).isEqualTo("200");
        assertThat(actual.getStatusPercent()).isEqualTo(20);
        assertThat(actual.getDuration()).isEqualTo(10);
        assertThat(actual.getTimeUnit()).isEqualTo(AlertTimeUnit.MINUTES);
    }

    @Test
    public void convertAlertTriggerEntityToAlertStatus2xx() {
        AlertTriggerEntity alertTriggerEntity = mock(AlertTriggerEntity.class);
        when(alertTriggerEntity.getType()).thenReturn(AlertMapper.STATUS_ALERT);

        final RateCondition rateCondition = mock(RateCondition.class);
        when(alertTriggerEntity.getConditions()).thenReturn(Collections.singletonList(rateCondition));
        when(rateCondition.getTimeUnit()).thenReturn(TimeUnit.MINUTES);
        when(rateCondition.getDuration()).thenReturn(10L);
        when(rateCondition.getThreshold()).thenReturn(20D);

        final ThresholdRangeCondition thresholdRangeCondition = mock(ThresholdRangeCondition.class);
        when(rateCondition.getComparison()).thenReturn(thresholdRangeCondition);
        when(thresholdRangeCondition.getThresholdLow()).thenReturn(200D);
        when(thresholdRangeCondition.getThresholdHigh()).thenReturn(299D);

        final Alert actual = alertMapper.convert(alertTriggerEntity);

        assertThat(actual.getType()).isEqualTo(AlertType.STATUS);
        assertThat(actual.getStatusCode()).isEqualTo("2xx");
        assertThat(actual.getStatusPercent()).isEqualTo(20);
        assertThat(actual.getDuration()).isEqualTo(10);
        assertThat(actual.getTimeUnit()).isEqualTo(AlertTimeUnit.MINUTES);
    }

    @Test
    public void convertAlertTriggerEntityToAlertResponseTime() {
        AlertTriggerEntity alertTriggerEntity = mock(AlertTriggerEntity.class);
        when(alertTriggerEntity.getType()).thenReturn(AlertMapper.RESPONSE_TIME_ALERT);

        final AggregationCondition aggregationCondition = mock(AggregationCondition.class);
        when(alertTriggerEntity.getConditions()).thenReturn(Collections.singletonList(aggregationCondition));
        when(aggregationCondition.getTimeUnit()).thenReturn(TimeUnit.MINUTES);
        when(aggregationCondition.getDuration()).thenReturn(10L);
        when(aggregationCondition.getThreshold()).thenReturn(200D);

        final Alert actual = alertMapper.convert(alertTriggerEntity);

        assertThat(actual.getType()).isEqualTo(AlertType.RESPONSE_TIME);
        assertThat(actual.getResponseTime()).isEqualTo(200);
        assertThat(actual.getDuration()).isEqualTo(10);
        assertThat(actual.getTimeUnit()).isEqualTo(AlertTimeUnit.MINUTES);
    }
}


text:
package net.nicoulaj.benchmark.mockwebapp.test;

import com.meterware.httpunit.WebRequest;
import com.meterware.servletunit.ServletRunner;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Base class for Mock web app tests.
 *

 * Contains constants, common purpose data providers, and convenience methods for servlets emulation.
 *
 * @author Julien Nicoulaud <julien.nicoulaud@gmail.com>
 * @since 1.0.0
 */
public abstract class AbstractMockWebAppTest {

    /**
     * The path to the test resources directory.
     */
    public static final String TEST_RESOURCES_DIR = "src/test/resources/net/nicoulaj/benchmark/mockwebapp/test";

    /**
     * The path to the test configs directory.
     */
    public static final String TEST_CONFIGS_DIR = TEST_RESOURCES_DIR + "/configs";

    /**
     * The path to the valid test configs directory.
     */
    public static final String VALID_TEST_CONFIGS_DIR = TEST_CONFIGS_DIR + "/valid";

    /**
     * The path to the invalid test configs directory.
     */
    public static final String INVALID_TEST_CONFIGS_DIR = TEST_CONFIGS_DIR + "/invalid";

    /**
     * The {@link ServletRunner} used by test methods.
     */
    protected ServletRunner servletRunner;

    /**
     * Initialize {@link #servletRunner}.
     */
    @BeforeMethod
    public void initServletRunner() {
        servletRunner = new ServletRunner();
    }

    /**
     * Dispose {@link #servletRunner}.
     */
    @AfterMethod
    public void disposeServletRunnner() {
        servletRunner.shutDown();
        servletRunner = null;
    }

    /**
     * Build an {@link HttpServletRequest}.
     *
     * @param webRequest the {@link WebRequest} to use for building the {@link HttpServletRequest}.
     * @return an instance of {@link HttpServletRequest}.
     * @throws java.io.IOException if the request could not be build.
     */
    protected HttpServletRequest getRequest(WebRequest webRequest) throws IOException {
        return servletRunner.newClient().newInvocation(webRequest).getRequest();
    }

    /**
     * Build an {@link HttpServletResponse}.
     *
     * @param webRequest the {@link WebRequest} to use for building the {@link HttpServletResponse}.
     * @return an instance of {@link HttpServletResponse}.
     * @throws java.io.IOException if the request could not be build.
     */
    protected HttpServletResponse getResponse(WebRequest webRequest) throws IOException {
        return servletRunner.newClient().newInvocation(webRequest).getResponse();
    }

    /**
     * Provide a list of valid config files.
     *

     * Can be used by tests method with a (File validConfigFile) signature.
     *
     * @return an {@link Iterator} of valid config files as single argument.
     */
    @DataProvider
    public Iterator<Object[]> validConfigFilesDataProvider() {
        final List<Object[]> params = new ArrayList<Object[]>();
        for (File file : new File(VALID_TEST_CONFIGS_DIR).listFiles()) params.add(new Object[]{file});
        return params.iterator();
    }

    /**
     * Provide a list of invalid config files.
     *

     * Can be used by tests method with a (File invalidConfigFile) signature.
     *
     * @return an {@link Iterator} of invalid config files as single argument.
     */
    @DataProvider
    public Iterator<Object[]> invalidConfigFilesDataProvider() {
        final List<Object[]> params = new ArrayList<Object[]>();
        for (File file : new File(INVALID_TEST_CONFIGS_DIR).listFiles()) params.add(new Object[]{file});
        return params.iterator();
    }
}


text:
<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreLocation extends FormRequest {
	/**
	 * Determine if the user is authorized to make this request.
	 *
	 * @return bool
	 */
	public function authorize() {
		return true;
	}

	/**
	 * Get the validation rules that apply to the request.
	 *
	 * @return array
	 */
	public function rules() {
		return [
			'name' => 'required|string|unique:locations,name,NULL,id,deleted_at,NULL|max:255',
			'description' => 'required|string',
			'history' => 'string',
			'demographics' => 'string',
			'government' => 'string',
			'menu' => 'string',
			'other_items' => 'string',
			'type' => 'string|required|in:' . implode(',', array_keys(\App\Classes\LocationHelper::getTypes())),
			'subtype' => 'string|in:' . implode(',', array_keys(\App\Classes\LocationHelper::getShopTypes())),
			'owner' => 'string',
			'price' => 'string',
			'private' => 'numeric|max:1',
			'parent' => 'integer|nullable',
		];
	}
}


text:
User listings:

{% if show == 'all' or sumd %}

The dynamic user list view shows dynamic usage info from the latest jobs.
{% if viewParams.MON_VO == 'ATLAS' %}
  Alternate view: Summary usage information updated every few hours

{% endif %}
{% endif %}

{% if show == 'all' or userdb %}

The usage stats view shows summary usage information updated every few hours.
  Alternate view: Dynamic usage info from the latest jobs

{% endif %}


text:
package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
	"os"
	"strings"

	"github.com/coreos/etcd/etcdserver"
	"github.com/coreos/etcd/etcdserver/etcdhttp"
	"github.com/coreos/etcd/pkg"
	flagtypes "github.com/coreos/etcd/pkg/flags"
	"github.com/coreos/etcd/pkg/transport"
	"github.com/coreos/etcd/proxy"
)

const (
	// the owner can make/remove files inside the directory
	privateDirMode = 0700

	version = "0.5.0-alpha"
)

var (
	fs           = flag.NewFlagSet("etcd", flag.ContinueOnError)
	name         = fs.String("name", "default", "Unique human-readable name for this node")
	dir          = fs.String("data-dir", "", "Path to the data directory")
	durl         = fs.String("discovery", "", "Discovery service used to bootstrap the cluster")
	snapCount    = fs.Uint64("snapshot-count", etcdserver.DefaultSnapCount, "Number of committed transactions to trigger a snapshot")
	printVersion = fs.Bool("version", false, "Print the version and exit")

	cluster      = &etcdserver.Cluster{}
	clusterState = new(etcdserver.ClusterState)

	cors      = &pkg.CORSInfo{}
	proxyFlag = new(flagtypes.Proxy)

	clientTLSInfo = transport.TLSInfo{}
	peerTLSInfo   = transport.TLSInfo{}

	ignored = []string{
		"cluster-active-size",
		"cluster-remove-delay",
		"cluster-sync-interval",
		"config",
		"force",
		"max-result-buffer",
		"max-retry-attempts",
		"peer-heartbeat-interval",
		"peer-election-timeout",
		"retry-interval",
		"snapshot",
		"v",
		"vv",
	}
)

func init() {
	fs.Var(cluster, "initial-cluster", "Initial cluster configuration for bootstrapping")
	if err := cluster.Set("default=http://localhost:2380,default=http://localhost:7001"); err != nil {
		// Should never happen
		log.Panic(err)
	}
	fs.Var(clusterState, "initial-cluster-state", "Initial cluster configuration for bootstrapping")
	clusterState.Set(etcdserver.ClusterStateValueNew)

	fs.Var(flagtypes.NewURLsValue("http://localhost:2380,http://localhost:7001"), "advertise-peer-urls", "List of this member's peer URLs to advertise to the rest of the cluster")
	fs.Var(flagtypes.NewURLsValue("http://localhost:2379,http://localhost:4001"), "advertise-client-urls", "List of this member's client URLs to advertise to the rest of the cluster")
	fs.Var(flagtypes.NewURLsValue("http://localhost:2380,http://localhost:7001"), "listen-peer-urls", "List of URLs to listen on for peer traffic")
	fs.Var(flagtypes.NewURLsValue("http://localhost:2379,http://localhost:4001"), "listen-client-urls", "List of URLs to listen on for client traffic")

	fs.Var(cors, "cors", "Comma-separated white list of origins for CORS (cross-origin resource sharing).")

	fs.Var(proxyFlag, "proxy", fmt.Sprintf("Valid values include %s", strings.Join(flagtypes.ProxyValues, ", ")))
	proxyFlag.Set(flagtypes.ProxyValueOff)

	fs.StringVar(&clientTLSInfo.CAFile, "ca-file", "", "Path to the client server TLS CA file.")
	fs.StringVar(&clientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.")
	fs.StringVar(&clientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.")

	fs.StringVar(&peerTLSInfo.CAFile, "peer-ca-file", "", "Path to the peer server TLS CA file.")
	fs.StringVar(&peerTLSInfo.CertFile, "peer-cert-file", "", "Path to the peer server TLS cert file.")
	fs.StringVar(&peerTLSInfo.KeyFile, "peer-key-file", "", "Path to the peer server TLS key file.")

	// backwards-compatibility with v0.4.6
	fs.Var(&flagtypes.IPAddressPort{}, "addr", "DEPRECATED: Use -advertise-client-urls instead.")
	fs.Var(&flagtypes.IPAddressPort{}, "bind-addr", "DEPRECATED: Use -listen-client-urls instead.")
	fs.Var(&flagtypes.IPAddressPort{}, "peer-addr", "DEPRECATED: Use -advertise-peer-urls instead.")
	fs.Var(&flagtypes.IPAddressPort{}, "peer-bind-addr", "DEPRECATED: Use -listen-peer-urls instead.")

	for _, f := range ignored {
		fs.Var(&pkg.IgnoredFlag{Name: f}, f, "")
	}

	fs.Var(&pkg.DeprecatedFlag{Name: "peers"}, "peers", "DEPRECATED: Use -initial-cluster instead")
	fs.Var(&pkg.DeprecatedFlag{Name: "peers-file"}, "peers-file", "DEPRECATED: Use -initial-cluster instead")
}

func main() {
	fs.Usage = pkg.UsageWithIgnoredFlagsFunc(fs, ignored)
	err := fs.Parse(os.Args[1:])
	switch err {
	case nil:
	case flag.ErrHelp:
		os.Exit(0)
	default:
		os.Exit(2)
	}

	if *printVersion {
		fmt.Println("etcd version", version)
		os.Exit(0)
	}

	pkg.SetFlagsFromEnv(fs)
	if err := setClusterForDiscovery(); err != nil {
		log.Fatalf("etcd: %v", err)
	}

	if string(*proxyFlag) == flagtypes.ProxyValueOff {
		startEtcd()
	} else {
		startProxy()
	}

	// Block indefinitely
	<-make(chan struct{})
}

// startEtcd launches the etcd server and HTTP handlers for client/server communication.
func startEtcd() {
	if *dir == "" {
		*dir = fmt.Sprintf("%v_etcd_data", *name)
		log.Printf("etcd: no data-dir provided, using default data-dir ./%s", *dir)
	}
	if err := os.MkdirAll(*dir, privateDirMode); err != nil {
		log.Fatalf("etcd: cannot create data directory: %v", err)
	}

	pt, err := transport.NewTransport(peerTLSInfo)
	if err != nil {
		log.Fatal(err)
	}

	acurls, err := pkg.URLsFromFlags(fs, "advertise-client-urls", "addr", clientTLSInfo)
	if err != nil {
		log.Fatal(err.Error())
	}
	cfg := &etcdserver.ServerConfig{
		Name:         *name,
		ClientURLs:   acurls,
		DataDir:      *dir,
		SnapCount:    *snapCount,
		Cluster:      cluster,
		DiscoveryURL: *durl,
		ClusterState: *clusterState,
		Transport:    pt,
	}
	s := etcdserver.NewServer(cfg)
	s.Start()

	ch := &pkg.CORSHandler{
		Handler: etcdhttp.NewClientHandler(s),
		Info:    cors,
	}
	ph := etcdhttp.NewPeerHandler(s)

	lpurls, err := pkg.URLsFromFlags(fs, "listen-peer-urls", "peer-bind-addr", peerTLSInfo)
	if err != nil {
		log.Fatal(err.Error())
	}

	for _, u := range lpurls {
		l, err := transport.NewListener(u.Host, peerTLSInfo)
		if err != nil {
			log.Fatal(err)
		}

		// Start the peer server in a goroutine
		urlStr := u.String()
		go func() {
			log.Print("Listening for peers on ", urlStr)
			log.Fatal(http.Serve(l, ph))
		}()
	}

	lcurls, err := pkg.URLsFromFlags(fs, "listen-client-urls", "bind-addr", clientTLSInfo)
	if err != nil {
		log.Fatal(err.Error())
	}

	// Start a client server goroutine for each listen address
	for _, u := range lcurls {
		l, err := transport.NewListener(u.Host, clientTLSInfo)
		if err != nil {
			log.Fatal(err)
		}

		urlStr := u.String()
		go func() {
			log.Print("Listening for client requests on ", urlStr)
			log.Fatal(http.Serve(l, ch))
		}()
	}
}

// startProxy launches an HTTP proxy for client communication which proxies to other etcd nodes.
func startProxy() {
	pt, err := transport.NewTransport(clientTLSInfo)
	if err != nil {
		log.Fatal(err)
	}

	ph, err := proxy.NewHandler(pt, (*cluster).PeerURLs())
	if err != nil {
		log.Fatal(err)
	}

	ph = &pkg.CORSHandler{
		Handler: ph,
		Info:    cors,
	}

	if string(*proxyFlag) == flagtypes.ProxyValueReadonly {
		ph = proxy.NewReadonlyHandler(ph)
	}

	lcurls, err := pkg.URLsFromFlags(fs, "listen-client-urls", "bind-addr", clientTLSInfo)
	if err != nil {
		log.Fatal(err.Error())
	}
	// Start a proxy server goroutine for each listen address
	for _, u := range lcurls {
		l, err := transport.NewListener(u.Host, clientTLSInfo)
		if err != nil {
			log.Fatal(err)
		}

		host := u.Host
		go func() {
			log.Print("Listening for client requests on ", host)
			log.Fatal(http.Serve(l, ph))
		}()
	}
}

// setClusterForDiscovery sets cluster to a temporary value if you are using
// the discovery.
func setClusterForDiscovery() error {
	set := make(map[string]bool)
	flag.Visit(func(f *flag.Flag) {
		set[f.Name] = true
	})
	if set["discovery"] && set["initial-cluster"] {
		return fmt.Errorf("both discovery and initial-cluster are set")
	}
	if set["discovery"] {
		apurls, err := pkg.URLsFromFlags(fs, "advertise-peer-urls", "peer-addr", peerTLSInfo)
		if err != nil {
			return err
		}
		addrs := make([]string, len(apurls))
		for i := range apurls {
			addrs[i] = fmt.Sprintf("%s=%s", *name, apurls[i].String())
		}
		if err := cluster.Set(strings.Join(addrs, ",")); err != nil {
			return err
		}
	}
	return nil
}


text:
package net.imagej.ops.join;

import java.util.List;

import net.imagej.ops.AbstractInplaceOp;
import net.imagej.ops.InplaceOp;

import org.scijava.plugin.Parameter;

/**
 * Abstract superclass of {@link JoinInplaces} implementations.
 *
 * @author Christian Dietz (University of Konstanz)
 * @author Curtis Rueden
 */
public abstract class AbstractJoinInplaces extends AbstractInplaceOp
	implements JoinInplaces
{

	@Parameter
	private List<InplaceOp> ops;

	@Override
	public void setOps(final List<InplaceOp> ops) {
		this.ops = ops;
	}

	@Override
	public List<InplaceOp> getOps() {
		return ops;
	}

}


text:
#nullable enable

using System;
using System.Buffers.Binary;
using System.Diagnostics;
using System.IO;

namespace Nerdbank.GitVersioning.ManagedGit
{
    internal static class GitPackReader
    {
        private static readonly byte[] Signature = GitRepository.Encoding.GetBytes("PACK");

        public static Stream GetObject(GitPack pack, Stream stream, long offset, string objectType, GitPackObjectType packObjectType)
        {
            if (pack is null)
            {
                throw new ArgumentNullException(nameof(pack));
            }

            if (stream is null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            // Read the signature
#if DEBUG
            stream.Seek(0, SeekOrigin.Begin);
            Span<byte> buffer = stackalloc byte[12];
            stream.ReadAll(buffer);

            Debug.Assert(buffer.Slice(0, 4).SequenceEqual(Signature));

            var versionNumber = BinaryPrimitives.ReadInt32BigEndian(buffer.Slice(4, 4));
            Debug.Assert(versionNumber == 2);

            var numberOfObjects = BinaryPrimitives.ReadInt32BigEndian(buffer.Slice(8, 4));
#endif

            stream.Seek(offset, SeekOrigin.Begin);

            var (type, decompressedSize) = ReadObjectHeader(stream);

            if (type == GitPackObjectType.OBJ_OFS_DELTA)
            {
                var baseObjectRelativeOffset = ReadVariableLengthInteger(stream);
                long baseObjectOffset = offset - baseObjectRelativeOffset;

                var deltaStream = new ZLibStream(stream, decompressedSize);
                var baseObjectStream = pack.GetObject(baseObjectOffset, objectType);

                return new GitPackDeltafiedStream(baseObjectStream, deltaStream);
            }
            else if (type == GitPackObjectType.OBJ_REF_DELTA)
            {
                Span<byte> baseObjectId = stackalloc byte[20];
                stream.ReadAll(baseObjectId);

                Stream baseObject = pack.GetObjectFromRepository(GitObjectId.Parse(baseObjectId), objectType)!;
                var seekableBaseObject = new GitPackMemoryCacheStream(baseObject);

                var deltaStream = new ZLibStream(stream, decompressedSize);

                return new GitPackDeltafiedStream(seekableBaseObject, deltaStream);
            }

            // Tips for handling deltas: https://github.com/choffmeister/gitnet/blob/4d907623d5ce2d79a8875aee82e718c12a8aad0b/src/GitNet/GitPack.cs
            if (type != packObjectType)
            {
                throw new GitException($"An object of type {objectType} could not be located at offset {offset}.") { ErrorCode = GitException.ErrorCodes.ObjectNotFound };
            }

            return new ZLibStream(stream, decompressedSize);
        }

        private static (GitPackObjectType, long) ReadObjectHeader(Stream stream)
        {
            Span<byte> value = stackalloc byte[1];
            stream.Read(value);

            var type = (GitPackObjectType)((value[0] & 0b0111_0000) >> 4);
            long length = value[0] & 0b_1111;

            if ((value[0] & 0b1000_0000) == 0)
            {
                return (type, length);
            }

            int shift = 4;

            do
            {
                stream.Read(value);
                length = length | ((value[0] & (long)0b0111_1111) << shift);
                shift += 7;
            } while ((value[0] & 0b1000_0000) != 0);

            return (type, length);
        }

        private static long ReadVariableLengthInteger(Stream stream)
        {
            long offset = -1;
            int b;

            do
            {
                offset++;
                b = stream.ReadByte();
                offset = (offset << 7) + (b & 127);
            }
            while ((b & (byte)128) != 0);

            return offset;
        }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.ian.spring</groupId>
  <artifactId>spring-deep</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>spring-deep Maven Webapp</name>
  <url>http://maven.apache.org</url>
    <dependencies>
	  	<dependency>
		    <groupId>javax</groupId>
		    <artifactId>javaee-api</artifactId>
		    <version>7.0</version>
		</dependency>
		<dependency>
	  		<groupId>org.springframework</groupId>
	  		<artifactId>spring-context</artifactId>
	  		<version>4.3.1.RELEASE</version>
	  	</dependency>
	  	<dependency>
	  		<groupId>org.springframework</groupId>
	  		<artifactId>spring-web</artifactId>
	  		<version>4.3.1.RELEASE</version>
	  	</dependency>
	  	<dependency>
	  		<groupId>org.springframework</groupId>
	  		<artifactId>spring-jdbc</artifactId>
	  		<version>4.3.1.RELEASE</version>
	  	</dependency>
	  	<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>4.3.1.RELEASE</version>
		</dependency>
	    <dependency>
	      <groupId>junit</groupId>
	      <artifactId>junit</artifactId>
	      <version>4.7</version>
	      <scope>test</scope>
	    </dependency>
	    <dependency>
		    <groupId>org.dom4j</groupId>
		    <artifactId>dom4j</artifactId>
		    <version>2.0.0</version>
		</dependency>
		<dependency>
		    <groupId>org.aspectj</groupId>
		    <artifactId>aspectjrt</artifactId>
		    <version>1.8.9</version>
		</dependency>
		<dependency>
		  <groupId>org.aspectj</groupId>
		  <artifactId>aspectjweaver</artifactId>
		  <version>1.8.9</version>
		</dependency>
		<dependency>
		    <groupId>com.mchange</groupId>
		    <artifactId>c3p0</artifactId>
		    <version>0.9.2.1</version>
		</dependency>
		<dependency>
		  <groupId>mysql</groupId>
		  <artifactId>mysql-connector-java</artifactId>
		  <version>5.1.38</version>
		</dependency>
		<dependency>
		  <groupId>org.apache.struts</groupId>
		  <artifactId>struts2-spring-plugin</artifactId>
		  <version>2.5</version>
		</dependency>
		<dependency>
		  <groupId>org.apache.struts</groupId>
		  <artifactId>struts2-core</artifactId>
		  <version>2.5</version>
		</dependency>
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-rest-plugin</artifactId>
			<version>2.5</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.struts</groupId>
		    <artifactId>struts2-convention-plugin</artifactId>
		    <version>2.5</version>
		</dependency>
		<dependency>
		  <groupId>org.hibernate</groupId>
		  <artifactId>hibernate-core</artifactId>
		  <version>4.3.11.Final</version>
		</dependency>
		<dependency>
	        <groupId>org.hibernate</groupId>
	        <artifactId>hibernate-entitymanager</artifactId>
	        <version>4.3.11.Final</version>
	    </dependency>
	    <dependency>
	    	<groupId>org.slf4j</groupId>
	    	<artifactId>slf4j-log4j12</artifactId>
	    	<version>1.7.9</version>
	    </dependency>
	    <dependency>
			<groupId>org.apache.logging.log4j</groupId>
		    <artifactId>log4j-core</artifactId>
		    <version>2.5</version>
		</dependency>
		<dependency>
		    <groupId>org.codehaus.jackson</groupId>
		    <artifactId>jackson-jaxrs</artifactId>
		    <version>1.9.13</version>
		</dependency>
    </dependencies>
  <build>
    <finalName>spring-deep</finalName>
  </build>
</project>


text:
package com.v3.dto;

// Generated Mar 1, 2014 3:23:41 PM by Hibernate Tools 3.6.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ProductLog generated by hbm2java
 */
@Entity
@Table(name = "product_log", catalog = "v3_inventory")
public class ProductLog implements java.io.Serializable {

	private Integer idProductLog;
	private Product product;
	private String message;
	private Date eventDate;

	public ProductLog() {
	}

	public ProductLog(Product product, String message, Date eventDate) {
		this.product = product;
		this.message = message;
		this.eventDate = eventDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_product_log", unique = true, nullable = false)
	public Integer getIdProductLog() {
		return this.idProductLog;
	}

	public void setIdProductLog(Integer idProductLog) {
		this.idProductLog = idProductLog;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_product", nullable = false)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "message", nullable = false, length = 45)
	public String getMessage() {
		return this.message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "event_date", nullable = false, length = 19)
	public Date getEventDate() {
		return this.eventDate;
	}

	public void setEventDate(Date eventDate) {
		this.eventDate = eventDate;
	}

}


text:
package v1

import (
	"knative.dev/pkg/apis"
)

// GetCondition returns the condition currently associated with the given type, or nil.
func (s *CloudStorageSourceStatus) GetCondition(t apis.ConditionType) *apis.Condition {
	return storageCondSet.Manage(s).GetCondition(t)
}

// GetTopLevelCondition returns the top level condition.
func (s *CloudStorageSourceStatus) GetTopLevelCondition() *apis.Condition {
	return storageCondSet.Manage(s).GetTopLevelCondition()
}

// IsReady returns true if the resource is ready overall.
func (s *CloudStorageSourceStatus) IsReady() bool {
	return storageCondSet.Manage(s).IsHappy()
}

// InitializeConditions sets relevant unset conditions to Unknown state.
func (s *CloudStorageSourceStatus) InitializeConditions() {
	storageCondSet.Manage(s).InitializeConditions()
}

// MarkNotificationNotReady sets the condition that the GCS has not been configured
// to send Notifications and why.
func (s *CloudStorageSourceStatus) MarkNotificationNotReady(reason, messageFormat string, messageA ...interface{}) {
	storageCondSet.Manage(s).MarkFalse(NotificationReady, reason, messageFormat, messageA...)
}

// MarkNotificationNotReady sets the condition that the status of GCS is unknown and why.
func (s *CloudStorageSourceStatus) MarkNotificationUnknown(reason, messageFormat string, messageA ...interface{}) {
	storageCondSet.Manage(s).MarkUnknown(NotificationReady, reason, messageFormat, messageA...)
}

func (s *CloudStorageSourceStatus) MarkNotificationReady(notificationID string) {
	s.NotificationID = notificationID
	storageCondSet.Manage(s).MarkTrue(NotificationReady)
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ page.title }}</title>
    <meta name="keywords" content="Rust, Rust lenguaje de programación, rustlang, rust-lang, Mozilla Rust">
    <meta name="description" content="Rust es un lenguaje de programación de sistemas extremadamente rápido, previene fallas de segmentación y garantiza la seguridad de los hilos de ejecución. ">

    <link rel="stylesheet" href="/css/bootstrap.css">
    <link rel="stylesheet" href="/css/style.css">

Documentación

Instalar

Comunidad

Contribuye

    {{ content }}

Our site in other languages:
        {% include footer.html %}


text:
@implementation SQTown

- (instancetype)initWithDictionary:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.code = dict[@"id"];
        self.name = dict[@"name"];
    }
    return self;
}

+ (instancetype)townsWithDictionary:(NSDictionary *)dict
{
    return [[self alloc] initWithDictionary:dict];
}

+ (NSArray *)townsWithArray:(NSArray *)array
{
    NSMutableArray *townsArray = [NSMutableArray array];
    for (NSDictionary *dict in array) {
        [townsArray addObject:[self townsWithDictionary:dict]];
    }
    return townsArray;
}

@end