text:
require 'test_helper'

class Jeweler
  module Commands
    class TestReleaseToRubyforge < Test::Unit::TestCase
      def self.subject
        Jeweler::Commands::ReleaseToRubyforge.new
      end

      rubyforge_command_context "rubyforge_project is defined in gemspec and package exists on rubyforge" do
        setup do
          stub(@rubyforge).configure
          stub(@rubyforge).login
          stub(@rubyforge).add_release("MyRubyForgeProjectName", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem")

          stub(@gemspec).description {"The zomg gem rocks."}
          stub(@gemspec).rubyforge_project {"MyRubyForgeProjectName"}
          stub(@gemspec).name {"zomg"}

          stub(@gemspec_helper).write
          stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
          stub(@gemspec_helper).update_version('1.2.3')

          @command.version        = '1.2.3'

          @command.run
        end

        should "configure" do
          assert_received(@rubyforge) {|rubyforge| rubyforge.configure }
        end

        should "login" do
          assert_received(@rubyforge) {|rubyforge| rubyforge.login }
        end

        should "set release notes" do
          assert_equal "The zomg gem rocks.", @rubyforge.userconfig["release_notes"]
        end

        should "set preformatted to true" do
          assert_equal true, @rubyforge.userconfig['preformatted']
        end

        should "add release" do
          assert_received(@rubyforge) {|rubyforge| rubyforge.add_release("MyRubyForgeProjectName", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem") }
        end
      end

      rubyforge_command_context "rubyforge_project is defined in gemspec and package does not exist on rubyforge" do
        setup do
          stub(@rubyforge).configure
          stub(@rubyforge).login
          stub(@rubyforge).scrape_config
          stub(@rubyforge).add_release("MyRubyForgeProjectName", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem") {
            raise "no <package_id> configured for <zomg>"
          }

          stub(@gemspec).description {"The zomg gem rocks."}
          stub(@gemspec).rubyforge_project {"MyRubyForgeProjectName"}
          stub(@gemspec).name {"zomg"}

          stub(@gemspec_helper).write
          stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
          stub(@gemspec_helper).update_version('1.2.3')

          @command.version        = '1.2.3'
        end

        should "raise MissingRubyForgePackageError" do
          assert_raises Jeweler::MissingRubyForgePackageError do
            @command.run
          end
        end
      end

      rubyforge_command_context "rubyforge_project is not defined in gemspec" do
        setup do
          stub(@rubyforge).configure
          stub(@rubyforge).login
          stub(@rubyforge).add_release(nil, "zomg", "1.2.3", "pkg/zomg-1.2.3.gem")

          stub(@gemspec).description {"The zomg gem rocks."}
          stub(@gemspec).rubyforge_project { nil }
          stub(@gemspec).name {"zomg"}

          stub(@gemspec_helper).write
          stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
          stub(@gemspec_helper).update_version('1.2.3')

          @command.version        = '1.2.3'
        end

        should "raise NoRubyForgeProjectConfigured" do
          assert_raises Jeweler::NoRubyForgeProjectInGemspecError do
            @command.run
          end
        end
      end

      rubyforge_command_context "after running when rubyforge_project is not defined in ~/.rubyforge/auto_config.yml" do
        setup do
          stub(@rubyforge).configure
          stub(@rubyforge).login
          stub(@rubyforge).add_release("some_project_that_doesnt_exist", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem") do
            raise RuntimeError, "no <group_id> configured for <some_project_that_doesnt_exist>"
          end

          @rubyforge.autoconfig['package_ids'] = { 'zomg' => 1234 }

          stub(@gemspec).description {"The zomg gem rocks."}
          stub(@gemspec).rubyforge_project { "some_project_that_doesnt_exist" }
          stub(@gemspec).name {"zomg"}

          stub(@gemspec_helper).write
          stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
          stub(@gemspec_helper).update_version('1.2.3')

          @command.version        = '1.2.3'
        end

        should "raise RubyForgeProjectNotConfiguredError" do
          assert_raises RubyForgeProjectNotConfiguredError do
            @command.run
          end
        end
      end

      build_command_context "build for jeweler" do
        setup do
          @command = Jeweler::Commands::ReleaseToRubyforge.build_for(@jeweler)
        end

        should "assign gemspec helper" do
          assert_equal @gemspec_helper, @command.gemspec_helper
        end

        should "assign gemspec" do
          assert_equal @gemspec, @command.gemspec
        end

        should "assign version" do
          assert_equal @version, @command.version
        end

        should "assign output" do
          assert_equal @output, @command.output
        end
      end

    end
  end
end


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">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Log Analyzer</title>

    <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">

    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">

    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    Toggle navigation

                </button>
                Log Analyzer v1.0

 User Profile

 Settings

 Logout

                                <input type="text" class="form-control" placeholder="Search...">

                                <button class="btn btn-default" type="button">

                                </button>

 DataSource

 Event Extraction

 Event Dashboard

                             Failure Prediction

 Feature Extraction

 Model Training

 Predict

                             Event Mining

 Event Summarization

 t-Pattern Mining

 Temporal Lag Mining

                             Multiresolution Retrieval

                             Dynamic Query Form

Feature Extraction

Data Sets Selector

                                    Window Size:

                                    <input id="datetimepicker1" type="text" >

                                Data Sets
                                <select class="form-control">
                                    <option>Huawei_log_1</option>
                                    <option>Huawei_log_2</option>
                                    <option>Huawei_log_3</option>
                                    <option>IBM_log_1</option>
                                    <option>IBM_log_2</option>
                                    </select>

Data Set Infomation

Start Time: 2015/02/09 12:00:00

End   Time: 2015/02/10 12:00:00

Data Sources:source1.txt, source2.txt

                              <button type="submit" class="btn btn-primary" id='showDash'>Extract Features</button>

                                <button type="submit" class="btn btn-primary">Save Feature Set</button>

                                <button type="submit" class="btn btn-primary">Load Feature Set</button>

                                <button type="submit" class="btn btn-primary">Delete Feature Set</button>

                             Feature Set Visualization

redpajama_set_name: RedPajamaGithub


text:
package com.gs.fw.common.mithra.test.domain;

import java.sql.Timestamp;

public class TestPositionIncomeExpense extends TestPositionIncomeExpenseAbstract
{

	public TestPositionIncomeExpense(Timestamp businessDate, Timestamp processingDate)
	{
		super(businessDate, processingDate);
	}

	public TestPositionIncomeExpense(Timestamp businessDate)
	{
		super(businessDate);
	}

    public TestPositionIncomeExpense(Timestamp businessDate, int productId, int positionType, int balanceType)
    {
        super(businessDate);
        this.setAccountId("71221231");
        this.setAcmapCode("A");
        this.setBalanceType(balanceType);
        this.setCurrency("USD");
        this.setIncomeExpense(123);
        this.setPositionType(positionType);
        this.setProductId(productId);
    }
}


text:
namespace OpenInvoicePeru.Servicio
{
    public class DocumentoSunat
    {
        public string TramaXml { get; set; }
        public string NombreArchivo { get; set; }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/E:/work/Git/molecule/pusherClientForAndroid-master/PushDemo/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/values-v12/values-v12.xml -->
    <eat-comment/>
    <style name="Base.V12.Widget.AppCompat.AutoCompleteTextView" parent="Base.V7.Widget.AppCompat.AutoCompleteTextView">
        <item name="android:textCursorDrawable">@drawable/abc_text_cursor_mtrl_alpha</item>
    </style>
    <style name="Base.V12.Widget.AppCompat.EditText" parent="Base.V7.Widget.AppCompat.EditText">
        <item name="android:textCursorDrawable">@drawable/abc_text_cursor_mtrl_alpha</item>
    </style>
    <style name="Base.Widget.AppCompat.AutoCompleteTextView" parent="Base.V12.Widget.AppCompat.AutoCompleteTextView"/>
    <style name="Base.Widget.AppCompat.EditText" parent="Base.V12.Widget.AppCompat.EditText"/>
</resources>


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 gui;

import dao.UsuarioDAO;
import entidades.Usuario;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import principal.Principal;
import util.ValidarCpf;

/**
 *
 * @author carlosfilho
 */
public class TelaLogin extends javax.swing.JFrame {

    /**
     * Creates new form NewJFrame
     */
    public TelaLogin() {
        initComponents();
        setLocationRelativeTo(null);
    }

    /**
     * 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();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        doLogin = new javax.swing.JButton();
        passwordField = new javax.swing.JPasswordField();
        cpfField = new javax.swing.JFormattedTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Biblioteca online");
        setName("loginFrame"); // NOI18N
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Digite seu CPF e senha para acessar"));

        jLabel1.setText("CPF");

        jLabel2.setText("Senha");

        doLogin.setText("Entrar");
        doLogin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                doLoginActionPerformed(evt);
            }
        });

        try {
            cpfField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(cpfField)
                    .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addComponent(doLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(28, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(cpfField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(doLogin)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .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(layout.createSequentialGroup()
                .addContainerGap()
                .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();
    }// </editor-fold>//GEN-END:initComponents

    private void doLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doLoginActionPerformed
        ValidarCpf vcpf = new ValidarCpf();

        if (passwordField.getPassword().length > 0 && cpfField.getText().length() > 0) {
            if (vcpf.isValid(cpfField.getText())) {
		UsuarioDAO ud = new UsuarioDAO();
                ArrayList<String> values = new ArrayList<String>();
                List<Usuario> result = null;
                values.add(cpfField.getText().replaceAll("[\\.\\-]", ""));
                values.add(new String(passwordField.getPassword()));
		result = ud.findByCriteria("cpf = ? AND senha = ?", values);

                //Abre o JFrame correspondente ao perfil do usuario
                if(result != null && result.size() > 0) {
                    System.out.println(result.get(0));
                    switch (result.get(0).getPerfil().getId()) {
                        case 1:
                            //this.dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
                            setVisible(false);
                            Principal.telaAluno = new TelaAluno();
                            Principal.telaAluno.setVisible(true);
                            break;
                        case 2:
                            setVisible(false);
                            Principal.telaAdministrador = new TelaAdministrador();
                            Principal.telaAdministrador.setVisible(true);
                            break;
                        default:
                            break;
                    }
                } else {
                    JOptionPane.showOptionDialog(null, "Usuário ou senha incorretos.", "Erro", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, null, null);
                }

            } else {
                JOptionPane.showOptionDialog(null, "CPF inválido.", "Erro", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, null, null);
            }
        } else {
            JOptionPane.showOptionDialog(null, "Preencha os campos antes de submeter o formulário.", "Erro", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, null, null);
        }
    }//GEN-LAST:event_doLoginActionPerformed

    /**
     * @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 ("GTK+".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TelaLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TelaLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TelaLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TelaLogin.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 TelaLogin().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFormattedTextField cpfField;
    private javax.swing.JButton doLogin;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPasswordField passwordField;
    // End of variables declaration//GEN-END:variables
}


text:
package hr.fer.zemris.vhdllab.applets.simulations;

import java.awt.Color;

/**
 * Klasa sadrzi boje za sve vidljive komponente na appletu za prikaz rezultata
 * simulacije
 *
 * @author Boris Ozegovic
 */
public class ThemeColor
{
    /** Index teme koja se trenutno koristi, redom: custom, default, FER */
    private int themeIndex = 0;

    /** Background boja panela s imenima signala */
    private Color[] signalNames = {new Color(141, 176, 221),
		new Color(141, 176, 221), new Color(214, 214, 214)};

    /** Background boja panela s valnim oblicima */
    private Color[] waves = {new Color(201, 211, 236),
		new Color(201, 211, 236), new Color(255, 255, 239)};

    /** Background boja panela koji sadrzi skalu */
    private Color[] scale = {new Color(254, 217, 182),
		new Color(254, 217, 182), new Color(255, 243, 239)};

    /** Boja isprekidanih crta u panelu s valnim oblicima */
    private Color[] wavesNet = {new Color(163, 179, 225),
		new Color(163, 179, 225), new Color(163, 179, 225)};

    /** Boja pasivnog kursora */
    private Color[] pasiveCursor = {new Color(129, 82, 182),
		new Color(129, 82, 182), new Color(129, 82, 182)};

    /** Aktivni kursor */
    private Color[] activeCursor = {new Color(131, 170, 85),
		new Color(116, 70, 57), new Color(116, 70, 57)};

    /** Boja panela s ikonicama za sljedeci/prethodni padajuci/rastuci brid */
    private Color[] buttonPanel = {new Color(141, 176, 221),
		new Color(141, 176, 221), new Color(214, 214, 214)};

    /** Background boja toolbara */
    private Color[] toolbar = {new Color(141, 176, 221),
		new Color(141, 176, 221), new Color(214, 214, 214)};

    /** Background boja citavog appleta */
    private Color[] applet = {new Color(254, 217, 182),
		new Color(254, 217, 182), new Color(214, 214, 214)};

    /** Foreground boja slova */
    private Color[] letters = {new Color(51, 51, 51),
		new Color(51, 51, 51), new Color(51, 51, 51)};

    /** Boja granicnika izmedu panela s imenim signala i valnih oblika */
    private Color[] divider = {new Color(86, 104, 176),
		new Color(86, 104, 176), new Color(86, 104, 176)};

    /** Background boja kursor-panela */
    private Color[] cursorPanel = {new Color(255, 255, 255),
		new Color(255, 255, 255), new Color(255, 255, 255)};

    /**
     * Mijenja trenutnu temu
     */
    public void setThemeIndex (int themeIndex)
    {
        this.themeIndex = themeIndex;
    }

    /**
     * Vraca background boju panela s imenima signala
     */
    public Color getSignalNames ()
    {
        return signalNames[themeIndex];
    }

    /**
     * Postavlja custom boju panela s imenima signala
     *
     * @param color zeljena boja
     */
    public void setSignalNames (Color color)
    {
        signalNames[0] = color;
    }

    /**
     * Vraca background boju panela s valnim oblicima
     */
    public Color getWaves ()
    {
        return waves[themeIndex];
    }

    /**
     * Postavlja custom boju panela s valnim oblicima
     *
     * @param color zeljena boja
     */
    public void setWaves (Color color)
    {
        waves[0] = color;
    }

    /**
     * Vraca background boju panela koji sadrzi skalu
     */
    public Color getScale ()
    {
        return scale[themeIndex];
    }

    /**
     * Postavlja custom boju panela koji sadrzi skalu
     *
     * @param color zeljena boja
     */
    public void setScale (Color color)
    {
        scale[0] = color;
    }

    /**
     * Vraca boju isprekidanih crta u panelu s valnim oblicima
     */
    public Color getWavesNet ()
    {
        return wavesNet[themeIndex];
    }

    /**
     * Postavlja custom boju isprekidanih crta u panel s valnim oblicima
     *
     * @param color zeljena boja
     */
    public void setWavesNet (Color color)
    {
        wavesNet[0] = color;
    }

    /**
     * Vraca boju aktivnog kursora
     */
    public Color getActiveCursor ()
    {
        return activeCursor[themeIndex];
    }

    /**
     * Postavlja custom boju aktivnog kursora
     *
     * @param color zeljena boja
     */
    public void setActiveCursor (Color color)
    {
        activeCursor[0] = color;
    }

    /**
     * Vraca boju pasivnog kursora
     */
    public Color getPasiveCursor ()
    {
        return pasiveCursor[themeIndex];
    }

    /**
     * Postavlja custom boju pasivnog kursora
     *
     * @param color zeljena boja
     */
    public void setPasiveCursor (Color color)
    {
        pasiveCursor[0] = color;
    }

    /**
     * Vraca boju panela koji sadrzi ikone za sljedeci/prethodni
     * padajuci/rastuci brid signala
     */
    public Color getButtonPanel ()
    {
        return buttonPanel[themeIndex];
    }

    /**
     * Postavlja custom boju panela koji sadrzi ikone za sljedeci/prethodni
     * padajuci/rastuci brid signala
     *
     * @param color zeljena boja
     */
    public void setButtonPanel (Color color)
    {
        buttonPanel[0] = color;
    }

    /**
     * Vraca boju toolbara
     */
    public Color getToolbar ()
    {
        return toolbar[themeIndex];
    }

    /**
     * Postavlja custom boju toolbara
     *
     * @param color zeljena boja
     */
    public void setToolbar (Color color)
    {
        toolbar[0] = color;
    }

    /**
     * Vraca boju glavnog appleta
     */
    public Color getApplet ()
    {
        return applet[themeIndex];
    }

    /**
     * Postavlja custom boju appleta
     *
     * @param color zeljena boja
     */
    public void setApplet (Color color)
    {
        applet[0] = color;
    }

    /**
     * Vraca boju slova
     */
    public Color getLetters ()
    {
        return letters[themeIndex];
    }

    /**
     * Postavlja custom boju slova
     *
     * @param color zeljena boja
     */
    public void setLetters (Color color)
    {
        letters[0] = color;
    }

    /**
     * Vraca boju granicnika izmedu panela s imenima signala i panela s valnim
     * oblicima
     */
    public Color getDivider ()
    {
        return divider[themeIndex];
    }

    /**
     * Postavlja custom boju granicnika izmedu panela s imenima signala i panela
     * s valnim oblicima
     *
     * @param color zeljena boja
     */
    public void setDivider (Color color)
    {
        divider[0] = color;
    }

    /**
     * Vraca boju panela koji sadrzi kursor
     */
    public Color getCursorPanel ()
    {
        return cursorPanel[themeIndex];
    }

    /**
     * Postavlja custom boju cursor-panela
     *
     * @param color zeljena boja
     */
    public void setCursorPanel (Color color)
    {
        cursorPanel[0] = color;
    }
}


text:
#import <Foundation/Foundation.h>
#import "ASPObject.h"

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

#import "ASPTextReplace.h"

@protocol ASPTextReplaceListRequest
@end

@interface ASPTextReplaceListRequest : ASPObject

/*  [optional]
 */
@property(nonatomic) NSArray<ASPTextReplace>* textReplaces;

@end


text:
package com.taradov.alarmme;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by Inshal on 11-Mar-15.
 */
public class DBAdapter {
    private static final String DATABASE_NAME = "AlarmMeDB.db";
    private static final int DATABASE_VERSION = 1;
    private SQLiteDatabase db;
    private final Context mContext;
    private DBOpenHelper mdbHelper;

    // Alarm Table Constants
    public static final String ALARM_TABLE = "Alarm";

    public static final String KEY_ALARM_ID         = "Id";
    public static final String KEY_ALARM_TITLE      = "Title";
    public static final String KEY_ALARM_FROMDATE   = "FromDate";
    public static final String KEY_ALARM_TODATE     = "ToDate";
    public static final String KEY_ALARM_TIME       = "Time";
    public static final String KEY_ALARM_DAYS       = "Days";
    public static final String KEY_ALARM_AUDIO      = "Audio";
    public static final String KEY_ALARM_INTERVAL   = "Interval";
    public static final String KEY_ALARM_ICON       = "Icon";
    public static final String KEY_ALARM_COLOR      = "Color";
    public static final String KEY_ALARM_ENABLED    = "Enabled";

    public static final int ALARM_ID_COLUMN         = 0;
    public static final int ALARM_TITLE_COLUMN      = 1;
    public static final int ALARM_FROMDATE_COLUMN   = 2;
    public static final int ALARM_TODATE_COLUMN     = 3;
    public static final int ALARM_TIME_COLUMN       = 4;
    public static final int ALARM_DAYS_COLUMN       = 5;
    public static final int ALARM_AUDIO_COLUMN      = 6;
    public static final int ALARM_INTERVAL_COLUMN   = 7;
    public static final int ALARM_ICON_COLUMN       = 8;
    public static final int ALARM_COLOR_COLUMN      = 9;
    public static final int ALARM_ENABLED_COLUMN    = 10;

    // Medicine Table Constants
    public static final String MEDICINE_TABLE = "Medicine";

    public static final String KEY_MEDICINE_ID      = "Id";
    public static final String KEY_MEDICINE_NAME    = "Name";
    public static final String KEY_MEDICINE_COLOR   = "Color";
    public static final String KEY_MEDICINE_AUDIO   = "Audio";
    public static final String KEY_MEDICINE_QRCODE  = "QRcode";

    public static final int MEDICINE_ID_COLUMN      = 0;
    public static final int MEDICINE_NAME_COLUMN    = 1;
    public static final int MEDICINE_COLOR_COLUMN   = 2;
    public static final int MEDICINE_AUDIO_COLUMN   = 3;
    public static final int MEDICINE_QRCODE_COLUMN  = 4;

    // Validation Table Constants
    public static final String HISTORY_TABLE = "MedicationHistory";

    public static final String KEY_HISTORY_ID           = "Id";
    public static final String KEY_HISTORY_ALARMID      = "AlarmId";
    public static final String KEY_HISTORY_TIMEDUE      = "TimeDue";
    public static final String KEY_HISTORY_TIMETAKEN    = "TimeTaken";
    public static final String KEY_HISTORY_QRCODE       = "QRCode";
    public static final String KEY_HISTORY_VALIDATION   = "Validation";

    public static final int HISTORY_ID_COLUMN           = 0;
    public static final int HISTORY_ALARMID_COLUMN      = 1;
    public static final int HISTORY_TIMEDUE_COLUMN      = 2;
    public static final int HISTORY_TIMETAKEN_COLUMN    = 3;
    public static final int HISTORY_QRCODE_COLUMN       = 4;
    public static final int HISTORY_VALIDATION_COLUMN   = 5;

    // Validation Table Constants
    public static final String PATIENT_TABLE = "Patient";

    public static final String KEY_PATIENT_ID               = "Id";
    public static final String KEY_PATIENT_NAME             = "Name";
    public static final String KEY_PATIENT_FATHERNAME       = "FatherName";
    public static final String KEY_PATIENT_AGE              = "Age";
    public static final String KEY_PATIENT_GENDER           = "Gender";
    public static final String KEY_PATIENT_ETHNICITY        = "Ethnicity";
    public static final String KEY_PATIENT_ADDRESS          = "Address";
    public static final String KEY_PATIENT_MARITALSTATUS    = "MaritalStatus";
    public static final String KEY_PATIENT_PROFESSION       = "Profession";
    public static final String KEY_PATIENT_INFECTIONS       = "Infections";
    public static final String KEY_PATIENT_CHILDRENNO       = "NumberOfChildren";
    public static final String KEY_PATIENT_CHILDRENSUFFER   = "ChildrenSuffer";
    public static final String KEY_PATIENT_SPOUSESUFFER     = "SpouseSuffer";
    public static final String KEY_PATIENT_RISK             = "RiskBehaviour";
    public static final String KEY_PATIENT_TRAVELHISTORY    = "TravelHistory";
    public static final String KEY_PATIENT_FRIENDHISTORY    = "FriendHistory";
    public static final String KEY_PATIENT_CLINICALFEATURES = "ClinicalFeatures";
    public static final String KEY_PATIENT_CD4              = "CD4";
    public static final String KEY_PATIENT_VIRALLOAD        = "ViralLoad";
    public static final String KEY_PATIENT_DIAGNOSISDATE    = "DiagnosisDate";

    public static final int PATIENT_ID_COLUMN               = 0;
    public static final int PATIENT_NAME_COLUMN             = 1;
    public static final int PATIENT_FATHERNAME_COLUMN       = 2;
    public static final int PATIENT_AGE_COLUMN              = 3;
    public static final int PATIENT_GENDER_COLUMN           = 4;
    public static final int PATIENT_ETHNICITY_COLUMN        = 5;
    public static final int PATIENT_ADDRESS_COLUMN          = 6;
    public static final int PATIENT_MARITALSTATUS_COLUMN    = 7;
    public static final int PATIENT_PROFESSION_COLUMN       = 8;
    public static final int PATIENT_INFECTIONS_COLUMN       = 9;
    public static final int PATIENT_CHILDRENNO_COLUMN       = 10;
    public static final int PATIENT_CHILDRENSUFFER_COLUMN   = 11;
    public static final int PATIENT_SPOUSESUFFER_COLUMN     = 12;
    public static final int PATIENT_RISK_COLUMN             = 13;
    public static final int PATIENT_TRAVELHISTORY_COLUMN    = 14;
    public static final int PATIENT_FRIENDHISTORY_COLUMN    = 15;
    public static final int PATIENT_CLINICALFEATURE_COLUMN  = 16;
    public static final int PATIENT_CD4_COLUMN              = 17;
    public static final int PATIENT_VIRALLOAD_COLUMN        = 18;
    public static final int PATIENT_DIAGNOSISDATE_COLUMN    = 19;

    public DBAdapter(Context _context) {
        this.mContext = _context;
        mdbHelper = new DBOpenHelper(mContext, DATABASE_NAME,
                null, DATABASE_VERSION);
    }

    private static class DBOpenHelper extends SQLiteOpenHelper {
        public DBOpenHelper(Context context, String name,
                            SQLiteDatabase.CursorFactory factory, int version) {
            super(context, name, factory, version);
        }
        // SQL Statement to create a new database.
        private static final String CREATE_TABLE_ALARM =
                "create table " + ALARM_TABLE + " (" +
                KEY_ALARM_ID          + " integer primary key autoincrement, " +
                KEY_ALARM_TITLE       + " text, " +
                KEY_ALARM_FROMDATE    + " long not null, " +
                KEY_ALARM_TODATE      + " long, " +
                KEY_ALARM_TIME        + " long not null, " +
                KEY_ALARM_DAYS        + " integer not null, " +
                KEY_ALARM_AUDIO       + " long, " +
                KEY_ALARM_INTERVAL    + " integer not null, " +
                KEY_ALARM_ICON        + " integer not null, " +
                KEY_ALARM_COLOR       + " integer, " +
                KEY_ALARM_ENABLED     + " integer not null" +
                ");";

        private static final String CREATE_TABLE_MEDICINE =
                "create table " + MEDICINE_TABLE + " (" +
                KEY_MEDICINE_ID     + " integer primary key autoincrement, " +
                KEY_MEDICINE_NAME   + " text unique not null, " +
                KEY_MEDICINE_COLOR  + " integer, " +
                KEY_MEDICINE_AUDIO  + " integer, " +
                KEY_MEDICINE_QRCODE + " text unique not null " +
                ");";

        private static final String CREATE_TABLE_VALIDATION =
                "create table " + HISTORY_TABLE + " (" +
                KEY_HISTORY_ID         + " integer primary key autoincrement, " +
                KEY_HISTORY_ALARMID    + " integer not null, "  +
                KEY_HISTORY_TIMEDUE    + " long not null, " +
                KEY_HISTORY_TIMETAKEN  + " long, " +
                KEY_HISTORY_QRCODE     + " text, " +
                KEY_HISTORY_VALIDATION + " text not null" +
                ");";

//        private static final String CREATE_TABLE_PATIENT =
//                "create table " + PATIENT_TABLE + " (" +
//                KEY_PATIENT_ID              + " integer primary key autoincrement, " +
//                KEY_PATIENT_NAME            + " text not null, " +
//                KEY_PATIENT_FATHERNAME      + " text, " +
//                KEY_PATIENT_AGE             + " integer, " +
//                KEY_PATIENT_GENDER          + " integer, " +
//                KEY_PATIENT_ETHNICITY       + " integer, " +
//                KEY_PATIENT_ADDRESS         + " text, " +
//                KEY_PATIENT_MARITALSTATUS   + " integer, " +
//                KEY_PATIENT_PROFESSION      + " text, " +
//                KEY_PATIENT_INFECTIONS      + " integer, " +
//                KEY_PATIENT_CHILDRENNO      + " text, " +
//                KEY_PATIENT_CHILDRENSUFFER  + " integer, " +
//                KEY_PATIENT_SPOUSESUFFER    + " integer, " +
//                KEY_PATIENT_RISK            + " integer, " +
//                KEY_PATIENT_TRAVELHISTORY   + " integer, " +
//                KEY_PATIENT_FRIENDHISTORY   + " integer, " +
//                KEY_PATIENT_CLINICALFEATURES+ " integer, " +
//                KEY_PATIENT_DIAGNOSISDATE   + " text not null" +
//                ");";

        private static final String CREATE_TABLE_PATIENT =
                "create table " + PATIENT_TABLE + " (" +
                        KEY_PATIENT_ID              + " integer primary key autoincrement, " +
                        KEY_PATIENT_NAME            + " text not null, " +
                        KEY_PATIENT_FATHERNAME      + " text, " +
                        KEY_PATIENT_AGE             + " text, " +
                        KEY_PATIENT_GENDER          + " text, " +
                        KEY_PATIENT_ETHNICITY       + " text, " +
                        KEY_PATIENT_ADDRESS         + " text, " +
                        KEY_PATIENT_MARITALSTATUS   + " text, " +
                        KEY_PATIENT_PROFESSION      + " text, " +
                        KEY_PATIENT_INFECTIONS      + " text, " +
                        KEY_PATIENT_CHILDRENNO      + " text, " +
                        KEY_PATIENT_CHILDRENSUFFER  + " text, " +
                        KEY_PATIENT_SPOUSESUFFER    + " text, " +
                        KEY_PATIENT_RISK            + " text, " +
                        KEY_PATIENT_TRAVELHISTORY   + " text, " +
                        KEY_PATIENT_FRIENDHISTORY   + " text, " +
                        KEY_PATIENT_CLINICALFEATURES+ " text, " +
                        KEY_PATIENT_CD4             + " text, " +
                        KEY_PATIENT_VIRALLOAD       + " text, " +
                        KEY_PATIENT_DIAGNOSISDATE   + " text not null" +
                        ");";

        @Override
        public void onCreate(SQLiteDatabase _db) {
            _db.execSQL("PRAGMA foreign_keys = ON;");
            _db.execSQL(CREATE_TABLE_ALARM);
            _db.execSQL(CREATE_TABLE_MEDICINE);
            _db.execSQL(CREATE_TABLE_VALIDATION);
            _db.execSQL(CREATE_TABLE_PATIENT);
        }

        @Override
        public void onUpgrade(SQLiteDatabase _db, int _oldVersion, int _newVersion) {
            Log.w("TaskDBAdapter", "Upgrading from version " +
                    _oldVersion + " to " +
                    _newVersion + ", which will destroy all old data");

            // Drop the old table.
            _db.execSQL("DROP TABLE IF EXISTS " + ALARM_TABLE);
            _db.execSQL("DROP TABLE IF EXISTS " + MEDICINE_TABLE);
            _db.execSQL("DROP TABLE IF EXISTS " + HISTORY_TABLE);
            _db.execSQL("DROP TABLE IF EXISTS " + PATIENT_TABLE);

            // Create a new one.
            onCreate(_db);
        }
    }

    public void open() throws SQLiteException {
        try {
            db = mdbHelper.getWritableDatabase();
        } catch (SQLiteException ex) {
            db = mdbHelper.getReadableDatabase();
        }
    }

    public void close() {
        db.close();
    }

    // Insert a new medicine
    public long addMedicine(Medicine _medicine) {
        // Create a new row of values to insert.
        ContentValues values = new ContentValues();
        // Assign values for each column.
        values.put(KEY_MEDICINE_NAME, _medicine.getName());
        values.put(KEY_MEDICINE_COLOR, _medicine.getColor());
        values.put(KEY_MEDICINE_AUDIO, _medicine.getAudio());
        values.put(KEY_MEDICINE_QRCODE, _medicine.getQRcode());

        // Insert the row.
        return db.insert(MEDICINE_TABLE, null, values);
    }

    // Update a medicine entry
    public boolean updateMedicine(String _name, Medicine _medicine) {
        // Create a new row of values to insert.
        ContentValues newValues = new ContentValues();
        // Assign values for each column.
        newValues.put(KEY_MEDICINE_NAME, _medicine.getName());
        newValues.put(KEY_MEDICINE_COLOR, _medicine.getColor());
        newValues.put(KEY_MEDICINE_AUDIO, _medicine.getAudio());
        newValues.put(KEY_MEDICINE_QRCODE, _medicine.getQRcode());

        // Insert the row.
        return db.update(MEDICINE_TABLE, newValues, KEY_MEDICINE_NAME + "=" + addQuotes(_name), null) > 0;
    }

    // Remove a medicine
    public boolean removeMedicine(String _name) {
        return db.delete(MEDICINE_TABLE, KEY_MEDICINE_NAME + "=" + addQuotes(_name), null) > 0;
    }

    // get a cursor to all medicine items
    public Cursor getAllMedicineCursor() {
        return db.query(MEDICINE_TABLE, null,
                null, null, null, null, null);
    }

    public Medicine createMedicineItem(Cursor _cursor)
    {
        return new Medicine(mContext,
                _cursor.getInt(MEDICINE_ID_COLUMN),
                _cursor.getString(MEDICINE_NAME_COLUMN),
                _cursor.getInt(MEDICINE_COLOR_COLUMN),
                _cursor.getInt(MEDICINE_AUDIO_COLUMN),
                _cursor.getString(MEDICINE_QRCODE_COLUMN));
    }

    public Medicine getMedicineFromAlarmID(int _alarmID)
    {
        return createMedicineItem(db.rawQuery("SELECT * FROM " + MEDICINE_TABLE + " M, " +
                ALARM_TABLE + " A WHERE A." + KEY_ALARM_AUDIO + "=M." + KEY_MEDICINE_ID +
                " AND A." + KEY_ALARM_ID + "=" + _alarmID, null, null));
    }

    // Insert a new alarm
    public long addAlarm(Alarm _alarm)
    {
        // Create a new row of values to insert.
        ContentValues values = new ContentValues();

        // Assign values for each column.
        //values.put(KEY_ALARM_ID         , _alarm.getId());
        values.put(KEY_ALARM_TITLE      , _alarm.getTitle());
        values.put(KEY_ALARM_FROMDATE   , _alarm.getFromDate());
        values.put(KEY_ALARM_TODATE     , _alarm.getToDate());
        values.put(KEY_ALARM_TIME       , _alarm.getTime());
        values.put(KEY_ALARM_DAYS       , _alarm.getDays());
        values.put(KEY_ALARM_AUDIO      , _alarm.getAudioPos());
        values.put(KEY_ALARM_INTERVAL   , _alarm.getInterval());
        values.put(KEY_ALARM_ICON       , _alarm.getpId());
        values.put(KEY_ALARM_COLOR      , _alarm.getColor());
        values.put(KEY_ALARM_ENABLED    , _alarm.getEnabled());

        // Insert the row.
        return db.insert(ALARM_TABLE, null, values);
    }

    // Update an alarm entry
    public boolean updateAlarm(long _id, Alarm _alarm)
    {
        // Create a new row of values to insert.
        ContentValues newValues = new ContentValues();
        DateTime dT = new DateTime(mContext);

        // Assign values for each column.
        newValues.put(KEY_ALARM_TITLE      , _alarm.getTitle());
        newValues.put(KEY_ALARM_FROMDATE   , _alarm.getFromDate());
        newValues.put(KEY_ALARM_TODATE     , _alarm.getToDate());
        newValues.put(KEY_ALARM_TIME       , _alarm.getTime());
        newValues.put(KEY_ALARM_DAYS       , _alarm.getDays());
        newValues.put(KEY_ALARM_AUDIO      , _alarm.getAudioPos());
        newValues.put(KEY_ALARM_INTERVAL   , _alarm.getInterval());
        newValues.put(KEY_ALARM_ICON       , _alarm.getpId());
        newValues.put(KEY_ALARM_COLOR      , _alarm.getColor());
        newValues.put(KEY_ALARM_ENABLED    , _alarm.getEnabled());

        // Update the row.
        return db.update(ALARM_TABLE, newValues, KEY_ALARM_ID + "=" + _id, null) > 0;
    }

    public boolean updateAlarm(String _name, Alarm _alarm)
    {
        // Create a new row of values to insert.
        ContentValues newValues = new ContentValues();
        DateTime dT = new DateTime(mContext);

        // Assign values for each column.
        newValues.put(KEY_ALARM_TITLE      , _alarm.getTitle());
        newValues.put(KEY_ALARM_FROMDATE   , _alarm.getFromDate());
        newValues.put(KEY_ALARM_TODATE     , _alarm.getToDate());
        newValues.put(KEY_ALARM_TIME       , _alarm.getTime());
        newValues.put(KEY_ALARM_DAYS       , _alarm.getDays());
        newValues.put(KEY_ALARM_AUDIO      , _alarm.getAudioPos());
        newValues.put(KEY_ALARM_INTERVAL   , _alarm.getInterval());
        newValues.put(KEY_ALARM_ICON       , _alarm.getpId());
        newValues.put(KEY_ALARM_COLOR      , _alarm.getColor());
        newValues.put(KEY_ALARM_ENABLED    , _alarm.getEnabled());

        // Update the row.
        return db.update(ALARM_TABLE, newValues, KEY_ALARM_TITLE + "=" + addQuotes(_name), null) > 0;
    }

    // Remove an alarm from the database using its name
    public boolean removeAlarm(String _name)
    {
        return db.delete(ALARM_TABLE, KEY_ALARM_TITLE + "=" + addQuotes(_name), null) > 0;
    }

    // Remove an alarm from the database using its id
    public boolean removeAlarm(long _id)
    {
        return db.delete(ALARM_TABLE, KEY_ALARM_ID + "=" + _id, null) > 0;
    }

    // get a cursor to all alarms
    public Cursor getAllAlarmCursor() {
        return db.query(ALARM_TABLE, null,
                null, null, null, null, null);
    }

    // get cursor to a particular alarm with id
    public Cursor setCursorAlarm(long _rowIndex) throws SQLException {
        Cursor result = db.query(true, ALARM_TABLE, null,
                KEY_ALARM_ID + "=" + _rowIndex, null, null, null,
                null, null);

        if ((result.getCount() == 0) || !result.moveToFirst()) {
            throw new SQLException("No to do items found for row: " + _rowIndex);
        }

        return result;
    }

    // get alarm object using id
    public Alarm getAlarm(long _rowIndex) throws SQLException {
        Cursor cursor = db.query(true, ALARM_TABLE,
                null, KEY_ALARM_ID + "=" + _rowIndex, null, null, null,
                null, null);

        if ((cursor.getCount() == 0) || !cursor.moveToFirst()) {
            throw new SQLException("No to do item found for row: " + _rowIndex);
        }

        return createAlarm(cursor);
    }

    public Alarm createAlarm(Cursor _cursor)
    {
        Alarm result = new Alarm(mContext);

        result.setId(_cursor.getInt(ALARM_ID_COLUMN));
        result.setTitle(_cursor.getString(ALARM_TITLE_COLUMN));
        result.setFromDate(_cursor.getLong(ALARM_FROMDATE_COLUMN));
        result.setToDate(_cursor.getLong(ALARM_TODATE_COLUMN));
        result.setTime(_cursor.getLong(ALARM_TIME_COLUMN));
        result.setDays(_cursor.getInt(ALARM_DAYS_COLUMN));
        result.setAudioPos(_cursor.getInt(ALARM_AUDIO_COLUMN));
        result.setInterval(_cursor.getInt(ALARM_INTERVAL_COLUMN));
        result.setpId(_cursor.getInt(ALARM_ICON_COLUMN));
        result.setColor(_cursor.getInt(ALARM_COLOR_COLUMN));
        result.setEnabled((_cursor.getInt(ALARM_ENABLED_COLUMN) == 1));

        return result;
    }

    // Insert a new history item
    public long addHistory(HistoryItem _historyItem)
    {
        // Create a new row of values to insert.
        ContentValues values = new ContentValues();

        // Assign values for each column.
        values.put(KEY_HISTORY_ALARMID, _historyItem.getAlarmId());
        values.put(KEY_HISTORY_TIMEDUE   , _historyItem.getTimeDue());
        values.put(KEY_HISTORY_TIMETAKEN , _historyItem.getTimeTaken());
        values.put(KEY_HISTORY_QRCODE, _historyItem.getQRCode());
        values.put(KEY_HISTORY_VALIDATION, _historyItem.getValidation());

        // Insert the row.
        return db.insert(HISTORY_TABLE, null, values);
    }

    // Update a history item
    public boolean updateHistory(long _id, HistoryItem _historyItem)
    {
        // Create a new row of values to insert.
        ContentValues newValues = new ContentValues();

        // Assign values for each column.
        newValues.put(KEY_HISTORY_TIMEDUE   , _historyItem.getTimeDue());
        newValues.put(KEY_HISTORY_TIMETAKEN , _historyItem.getTimeTaken());
        newValues.put(KEY_HISTORY_ALARMID, _historyItem.getAlarmId());
        newValues.put(KEY_HISTORY_QRCODE, _historyItem.getQRCode());
        newValues.put(KEY_HISTORY_VALIDATION, _historyItem.getValidation());

        // Update the row.
        return db.update(HISTORY_TABLE, newValues, KEY_HISTORY_ID + "=" + _id, null) > 0;
    }

    // Remove a history item from the database using its name
    public boolean removeHistory(String _name)
    {
        return db.delete(HISTORY_TABLE, KEY_ALARM_TITLE + "=" + addQuotes(_name), null) > 0;
    }

    // get a cursor to all history items
    public Cursor getAllHistoryCursor() {
        return db.query(HISTORY_TABLE, null,
                null, null, null, null, null);
    }

    public HistoryItem createHistoryItem(Cursor _cursor)
    {
        return new HistoryItem(mContext,
                _cursor.getInt(HISTORY_ID_COLUMN),
                _cursor.getInt(HISTORY_ALARMID_COLUMN),
                _cursor.getLong(HISTORY_TIMEDUE_COLUMN),
                _cursor.getLong(HISTORY_TIMETAKEN_COLUMN),
                _cursor.getString(HISTORY_QRCODE_COLUMN),
                _cursor.getString(HISTORY_VALIDATION_COLUMN)
                );
    }

    private String addQuotes(String msg)
    {
        return "\"" + msg + "\"";
    }

    public HistoryItem getLastHistoryItem()
    {
        Cursor cursor = db.query(HISTORY_TABLE, null, null, null, null, null, KEY_HISTORY_ID + " DESC", "1");

        if ((cursor.getCount() == 0) || !cursor.moveToFirst()) {
            throw new SQLException("No history item found");
        }

        return createHistoryItem(cursor);
    }

    // Insert a new patient
    public long addPatient(Patient _patient) {
        // Create a new row of values to insert.
        ContentValues values = new ContentValues();

        // Assign values for each column.
        values.put(KEY_PATIENT_NAME             , _patient.getPatientName());
        values.put(KEY_PATIENT_FATHERNAME       , _patient.getFatherName());
        values.put(KEY_PATIENT_AGE              , _patient.getAge());
        values.put(KEY_PATIENT_GENDER           , _patient.getGender());
        values.put(KEY_PATIENT_ETHNICITY        , _patient.getEthnicity());
        values.put(KEY_PATIENT_ADDRESS          , _patient.getAddress());
        values.put(KEY_PATIENT_MARITALSTATUS    , _patient.getMaritalStatus());
        values.put(KEY_PATIENT_PROFESSION       , _patient.getProfession());
        values.put(KEY_PATIENT_INFECTIONS       , _patient.getInfection());
        values.put(KEY_PATIENT_CHILDRENNO       , _patient.getChildrenno());
        values.put(KEY_PATIENT_CHILDRENSUFFER   , _patient.getChildrenSuffer());
        values.put(KEY_PATIENT_SPOUSESUFFER     , _patient.getSpouseSuffer());
        values.put(KEY_PATIENT_RISK             , _patient.getRiskBehaviour());
        values.put(KEY_PATIENT_TRAVELHISTORY    , _patient.getTravelHistory());
        values.put(KEY_PATIENT_FRIENDHISTORY    , _patient.getFriendHistory());
//        values.put(KEY_PATIENT_CLINICALFEATURES , _patient.getClinicalFeatures());
        values.put(KEY_PATIENT_CD4              , _patient.getcd4());
        values.put(KEY_PATIENT_VIRALLOAD        , _patient.getViralLoad());
        values.put(KEY_PATIENT_DIAGNOSISDATE    , _patient.getDiagnosisDate());

        // Insert the row.
        return db.insert(PATIENT_TABLE, null, values);
    }

    // Update a patient entry
    public boolean updatePatient(long _id, Patient _patient) {
        // Create a new row of values to insert.
        ContentValues newValues = new ContentValues();

        // Assign values for each column.
        newValues.put(KEY_PATIENT_NAME             , _patient.getPatientName());
        newValues.put(KEY_PATIENT_FATHERNAME       , _patient.getFatherName());
        newValues.put(KEY_PATIENT_AGE              , _patient.getAge());
        newValues.put(KEY_PATIENT_GENDER           , _patient.getGender());
        newValues.put(KEY_PATIENT_ETHNICITY        , _patient.getEthnicity());
        newValues.put(KEY_PATIENT_ADDRESS          , _patient.getAddress());
        newValues.put(KEY_PATIENT_MARITALSTATUS    , _patient.getMaritalStatus());
        newValues.put(KEY_PATIENT_PROFESSION       , _patient.getProfession());
        newValues.put(KEY_PATIENT_INFECTIONS       , _patient.getInfection());
        newValues.put(KEY_PATIENT_CHILDRENNO       , _patient.getChildrenno());
        newValues.put(KEY_PATIENT_CHILDRENSUFFER   , _patient.getChildrenSuffer());
        newValues.put(KEY_PATIENT_SPOUSESUFFER     , _patient.getSpouseSuffer());
        newValues.put(KEY_PATIENT_RISK             , _patient.getRiskBehaviour());
        newValues.put(KEY_PATIENT_TRAVELHISTORY    , _patient.getTravelHistory());
        newValues.put(KEY_PATIENT_FRIENDHISTORY    , _patient.getFriendHistory());
//        newValues.put(KEY_PATIENT_CLINICALFEATURES , _patient.getClinicalFeatures());
        newValues.put(KEY_PATIENT_CD4              , _patient.getcd4());
        newValues.put(KEY_PATIENT_VIRALLOAD        , _patient.getViralLoad());
        newValues.put(KEY_PATIENT_DIAGNOSISDATE    , _patient.getDiagnosisDate());

        // Insert the row.
        return db.update(PATIENT_TABLE, newValues, KEY_PATIENT_ID + "=" + _id, null) > 0;
    }

    // Remove a all patients
    public boolean removePatient() {
        return db.delete(PATIENT_TABLE, null, null) > 0;
    }

    // get a cursor to all patient profiles
    public Cursor getAllPatientCursor() {
        return db.query(PATIENT_TABLE, null,
                null, null, null, null, null);
    }

    // create and return a patient item from a cursor
    public Patient createPatient(Cursor _cursor)
    {
        Patient p = new Patient(mContext);

        p.setPatId(_cursor.getInt(PATIENT_ID_COLUMN));
        p.setPatientName(_cursor.getString(PATIENT_NAME_COLUMN));
        p.setFatherName(_cursor.getString(PATIENT_FATHERNAME_COLUMN));
        p.setAge(_cursor.getString(PATIENT_AGE_COLUMN));
        p.setGender(_cursor.getString(PATIENT_GENDER_COLUMN));
        p.setEthnicity(_cursor.getString(PATIENT_ETHNICITY_COLUMN));
        p.setAddress(_cursor.getString(PATIENT_ADDRESS_COLUMN));
        p.setMaritalStatus(_cursor.getString(PATIENT_MARITALSTATUS_COLUMN));
        p.setInfections(_cursor.getString(PATIENT_INFECTIONS_COLUMN));
        p.setProfession(_cursor.getString(PATIENT_PROFESSION_COLUMN));
        p.setChildrenno(_cursor.getString(PATIENT_CHILDRENNO_COLUMN));
        p.setChildrenSuffer(_cursor.getString(PATIENT_CHILDRENSUFFER_COLUMN));
        p.setSpouseSuffer(_cursor.getString(PATIENT_SPOUSESUFFER_COLUMN));
        p.setRiskBehaviour(_cursor.getString(PATIENT_RISK_COLUMN));
        p.settravelHistory(_cursor.getString(PATIENT_TRAVELHISTORY_COLUMN));
        p.setfriendHistory(_cursor.getString(PATIENT_FRIENDHISTORY_COLUMN));
//        p.setclinicalFeatures(_cursor.getInt(PATIENT_CLINICALFEATURE_COLUMN));
        p.setcd4(_cursor.getString(PATIENT_CD4_COLUMN));
        p.setViralLoad(_cursor.getString(PATIENT_VIRALLOAD_COLUMN));
        p.setDiagnosisDate(_cursor.getString(PATIENT_DIAGNOSISDATE_COLUMN));

        return p;
    }

}


text:
"""
This is the settlement class. It contains a reference to a player that owns it and the vertex it exists on.
"""
import Player
import Vertex

class Settlement:

    def __init__(self, vertex):
        self.owner = None
        self.vertex = vertex


text:
require 'spec_helper'

describe Phony::Country do

  context 'regression' do
    describe 'iceland' do
      before(:each) do
        national_splitter = Phony::NationalSplitters::None.instance_for
        local_splitter    = Phony::LocalSplitters::Fixed.instance_for [3, 4]

        national_code     = Phony::NationalCode.new national_splitter, local_splitter
        @iceland          = described_class.new national_code
      end
      it 'splits correctly' do
        @iceland.split('112').should == [nil, false, '112']
      end
    end
  end

  context "without special cases" do
    before(:each) do
      national_splitter = Phony::NationalSplitters::Variable.new 4, ['44']
      local_splitter    = Phony::LocalSplitters::Fixed.instance_for [3, 2, 2]
      national_code     = Phony::NationalCode.new national_splitter, local_splitter

      @switzerland      = Phony::Country.new national_code
      @switzerland.with '41' # TODO Remove this kludge.
    end

    describe "split" do
      it "should handle ZH" do
        @switzerland.split('443643532').should == [nil, '44', '364', '35', '32']
      end
    end
    describe 'normalize' do
      it "should handle ZH" do
        @switzerland.normalize('0443643532').should == '443643532'
      end
    end
  end

  context "without special cases" do
    before(:each) do
      special_national_splitter = Phony::NationalSplitters::Variable.new nil, ['800']
      special_local_splitter    = Phony::LocalSplitters::Fixed.instance_for [3, 3]
      special_code              = Phony::NationalCode.new special_national_splitter, special_local_splitter

      national_splitter         = Phony::NationalSplitters::Variable.new 4, ['44']
      local_splitter            = Phony::LocalSplitters::Fixed.instance_for [3, 2, 2]
      national_code             = Phony::NationalCode.new national_splitter, local_splitter

      @switzerland              = Phony::Country.new special_code, national_code
    end

    describe "split" do
      it "should handle ZH" do
        @switzerland.split('443643532').should == [nil, '44', '364', '35', '32']
      end
      it "should handle 800" do
        @switzerland.split('800333666').should == [nil, '800', '333', '666']
      end
    end
  end

end


text:
package pl.project13.janbanery.resources;

import com.google.gson.annotations.SerializedName;
import pl.project13.janbanery.resources.additions.On;
import pl.project13.janbanery.resources.additions.ReadOnly;
import pl.project13.janbanery.resources.additions.Required;
import pl.project13.janbanery.resources.additions.Settable;

import java.io.Serializable;

/**
 * A @{link Task} may contain @{link SubTask}s. A {@link SubTask} is a small chunk of text which may be marked as done.
 * It can be used as super simple to-do list etc.
 *
 * @author Konrad Malawski
 */
public class SubTask extends KanbaneryResource implements Serializable {

  /**
   * The Subtasks id
   */
  @ReadOnly
  private Long id;

  /**
   * Short description of the subtask
   */
  @Required
  @Settable(On.CreateOrUpdate)
  private String body;

  /**
   * If of the "parent task"
   */
  @ReadOnly
  @SerializedName("task_id")
  private Long taskId;

  /**
   * Id of the user who created this {@link SubTask}
   */
  @ReadOnly
  @SerializedName("creator_id")
  private Long creatorId;

  /**
   * True if it is completed, false otherwise
   */
  @Settable(On.CreateOrUpdate)
  private Boolean completed;

  public SubTask() {
  }

  public SubTask(String body) {
    this.body = body;
  }

  @Override
  public String getResourceId() {
    return "subtask";
  }

  public Long getId() {
    return id;
  }

  public String getBody() {
    return body;
  }

  public void setBody(String body) {
    this.body = body;
  }

  public Long getTaskId() {
    return taskId;
  }

  public Long getCreatorId() {
    return creatorId;
  }

  public Boolean getCompleted() {
    return completed;
  }

  public void setCompleted(Boolean completed) {
    this.completed = completed;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }

    SubTask subTask = (SubTask) o;

    if (body != null ? !body.equals(subTask.body) : subTask.body != null) {
      return false;
    }
    if (completed != null ? !completed.equals(subTask.completed) : subTask.completed != null) {
      return false;
    }
    if (creatorId != null ? !creatorId.equals(subTask.creatorId) : subTask.creatorId != null) {
      return false;
    }
    if (id != null ? !id.equals(subTask.id) : subTask.id != null) {
      return false;
    }
    if (taskId != null ? !taskId.equals(subTask.taskId) : subTask.taskId != null) {
      return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int result = super.hashCode();
    result = 31 * result + (id != null ? id.hashCode() : 0);
    result = 31 * result + (body != null ? body.hashCode() : 0);
    result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
    result = 31 * result + (creatorId != null ? creatorId.hashCode() : 0);
    result = 31 * result + (completed != null ? completed.hashCode() : 0);
    return result;
  }

  @Override
  public String toString() {
    final StringBuilder sb = new StringBuilder();
    sb.append("SubTask");
    sb.append("{id=").append(id);
    sb.append(", body='").append(body).append('\'');
    sb.append(", taskId=").append(taskId);
    sb.append(", creatorId=").append(creatorId);
    sb.append(", completed=").append(completed);
    sb.append('}');
    return sb.toString();
  }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\modules\admin\assets\TinymceAsset;

/* @var $this yii\web\View */
/* @var $model app\models\Producttype */
/* @var $form yii\widgets\ActiveForm */

$this->registerAssetBundle(TinymceAsset::className());

$this->registerJsFile('js/admin/producttype.js',['depends' => TinymceAsset::className()]);

?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'mname')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'active')->dropDownList(['Нет', 'Да']) ?>

    <?= $form->field($model, 'pos')->textInput() ?>

    <?= $form->field($model, 'rakel')->dropDownList(['Нет', 'Да']) ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'caption')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'keywords')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'text')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'name_translit')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'price_formula')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'weight')->textInput(['maxlength' => true]) ?>

        <?= Html::submitButton($model->isNewRecord ? 'Сохранить' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
package org.cs3.pdt.console.internal.views.completion;

import org.cs3.pdt.console.internal.ImageRepository;
import org.eclipse.swt.graphics.Image;

public class ModuleCompletionProposal extends ComparableCompletionProposal {

	private String module;
	private boolean needsQuotes;

	public ModuleCompletionProposal(String module, int prefixLength, boolean addSingleQuote, boolean needsQuotes) {
		super(prefixLength, addSingleQuote);
		this.module = module;
		this.needsQuotes = needsQuotes;
	}

	@Override
	public String getContent(int stateMask) {
		if (addSingleQuote) {
			return module + "'";
		} else if (needsQuotes) {
			return "'" + module + "'";
		} else {
			return module;
		}
	}

	@Override
	public int getCursorPosition() {
		return getContent(-1).length();
	}

	@Override
	public String getLabel() {
		return module;
	}

	@Override
	public String getDescription() {
		return null;
	}

	@Override
	public Image getImage() {
		return ImageRepository.getImage(ImageRepository.ENTITY);
	}

	@Override
	public int compareTo(ComparableCompletionProposal o) {
		if (o instanceof ModuleCompletionProposal) {
			return module.compareTo(((ModuleCompletionProposal) o).module);
		} else if (o instanceof PredicateCompletionProposal) {
			return module.compareTo(((PredicateCompletionProposal) o).getSignature());
		} else {
			return -1;
		}
	}

}


text:
(function() {

    "use strict";

    think.remote = {
        isOnline: function(callback) {
            _.defer(function() {
                // callback(localStorage['online']);
                callback(navigator.onLine);
            });
        }
    };

})();


text:
        // MESSAGE HEARTBEAT PACKING
package com.MAVLink.common;
import com.MAVLink.MAVLinkPacket;
import com.MAVLink.Messages.MAVLinkMessage;
import com.MAVLink.Messages.MAVLinkPayload;
        //import android.util.Log;

        /**
        * The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot).
        */
        public class msg_heartbeat extends MAVLinkMessage{

        public static final int MAVLINK_MSG_ID_HEARTBEAT = 0;
        public static final int MAVLINK_MSG_LENGTH = 9;
        private static final long serialVersionUID = MAVLINK_MSG_ID_HEARTBEAT;

         	/**
        * A bitfield for use for autopilot-specific flags.
        */
        public int custom_mode;
         	/**
        * Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
        */
        public byte type;
         	/**
        * Autopilot type / class. defined in MAV_AUTOPILOT ENUM
        */
        public byte autopilot;
         	/**
        * System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h
        */
        public byte base_mode;
         	/**
        * System status flag, see MAV_STATE ENUM
        */
        public byte system_status;
         	/**
        * MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
        */
        public byte mavlink_version;

        /**
        * Generates the payload for a mavlink message for a message of this type
        * @return
        */
        public MAVLinkPacket pack(){
		MAVLinkPacket packet = new MAVLinkPacket();
		packet.len = MAVLINK_MSG_LENGTH;
		packet.sysid = 255;
		packet.compid = 190;
		packet.msgid = MAVLINK_MSG_ID_HEARTBEAT;
        		packet.payload.putInt(custom_mode);
        		packet.payload.putByte(type);
        		packet.payload.putByte(autopilot);
        		packet.payload.putByte(base_mode);
        		packet.payload.putByte(system_status);
        		packet.payload.putByte(mavlink_version);

		return packet;
        }

        /**
        * Decode a heartbeat message into this class fields
        *
        * @param payload The message to decode
        */
        public void unpack(MAVLinkPayload payload) {
        payload.resetIndex();
        	    this.custom_mode = payload.getInt();
        	    this.type = payload.getByte();
        	    this.autopilot = payload.getByte();
        	    this.base_mode = payload.getByte();
        	    this.system_status = payload.getByte();
        	    this.mavlink_version = payload.getByte();

        }

        /**
        * Constructor for a new message, just initializes the msgid
        */
        public msg_heartbeat(){
    	msgid = MAVLINK_MSG_ID_HEARTBEAT;
        }

        /**
        * Constructor for a new message, initializes the message with the payload
        * from a mavlink packet
        *
        */
        public msg_heartbeat(MAVLinkPacket mavLinkPacket){
        this.sysid = mavLinkPacket.sysid;
        this.compid = mavLinkPacket.compid;
        this.msgid = MAVLINK_MSG_ID_HEARTBEAT;
        unpack(mavLinkPacket.payload);
        //Log.d("MAVLink", "HEARTBEAT");
        //Log.d("MAVLINK_MSG_ID_HEARTBEAT", toString());
        }

        /**
        * Returns a string with the MSG name and data
        */
        public String toString(){
    	return "MAVLINK_MSG_ID_HEARTBEAT -"+" custom_mode:"+custom_mode+" type:"+type+" autopilot:"+autopilot+" base_mode:"+base_mode+" system_status:"+system_status+" mavlink_version:"+mavlink_version+"";
        }
        }


text:
package com.amazonaws.services.storagegateway.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.storagegateway.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * RemoveTagsFromResourceResult JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RemoveTagsFromResourceResultJsonUnmarshaller implements Unmarshaller<RemoveTagsFromResourceResult, JsonUnmarshallerContext> {

    public RemoveTagsFromResourceResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        RemoveTagsFromResourceResult removeTagsFromResourceResult = new RemoveTagsFromResourceResult();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return removeTagsFromResourceResult;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("ResourceARN", targetDepth)) {
                    context.nextToken();
                    removeTagsFromResourceResult.setResourceARN(context.getUnmarshaller(String.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return removeTagsFromResourceResult;
    }

    private static RemoveTagsFromResourceResultJsonUnmarshaller instance;

    public static RemoveTagsFromResourceResultJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new RemoveTagsFromResourceResultJsonUnmarshaller();
        return instance;
    }
}


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

namespace Fungus
{
    /// <summary>
    /// The block will execute when the player starts dragging an object.
    /// </summary>
    [EventHandlerInfo("Sprite",
                      "Drag Started",
                      "The block will execute when the player starts dragging an object.")]
    [AddComponentMenu("")]
    public class DragStarted : EventHandler, ISerializationCallbackReceiver
    {
        public class DragStartedEvent
        {
            public Draggable2D DraggableObject;

            public DragStartedEvent(Draggable2D draggableObject)
            {
                DraggableObject = draggableObject;
            }
        }

        [VariableProperty(typeof(GameObjectVariable))]
        [SerializeField] protected GameObjectVariable draggableRef;

        [SerializeField] protected List<Draggable2D> draggableObjects;

        [HideInInspector]
        [SerializeField] protected Draggable2D draggableObject;

        protected EventDispatcher eventDispatcher;

        protected virtual void OnEnable()
        {
            eventDispatcher = FungusManager.Instance.EventDispatcher;

            eventDispatcher.AddListener<DragStartedEvent>(OnDragStartedEvent);
        }

        protected virtual void OnDisable()
        {
            eventDispatcher.RemoveListener<DragStartedEvent>(OnDragStartedEvent);

            eventDispatcher = null;
        }

        private void OnDragStartedEvent(DragStartedEvent evt)
        {
            OnDragStarted(evt.DraggableObject);
        }

        #region Compatibility

        void ISerializationCallbackReceiver.OnAfterDeserialize()
        {
            //add any dragableobject already present to list for backwards compatability
            if (draggableObject != null)
            {
                if (!draggableObjects.Contains(draggableObject))
                {
                    draggableObjects.Add(draggableObject);
                }
                draggableObject = null;
            }
        }

        void ISerializationCallbackReceiver.OnBeforeSerialize()
        {
        }

        #endregion Compatibility

        #region Public members

        /// <summary>
        /// Called by the Draggable2D object when the drag starts.
        /// </summary>
        public virtual void OnDragStarted(Draggable2D draggableObject)
        {
            if (draggableObjects.Contains(draggableObject))
            {
                if (draggableRef != null)
                {
                    draggableRef.Value = draggableObject.gameObject;
                }
                ExecuteBlock();
            }
        }

        public override string GetSummary()
        {
            string summary = "Draggable: ";
            if (this.draggableObjects != null && this.draggableObjects.Count != 0)
            {
                for (int i = 0; i < this.draggableObjects.Count; i++)
                {
                    if (draggableObjects[i] != null)
                    {
                        summary += draggableObjects[i].name + ",";
                    }
                }
            }

            if (summary.Length == 0)
            {
                return "None";
            }

            return summary;
        }

        #endregion Public members
    }
}


text:
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $HardwareEvaluatorArgs = {
    properties: {
        min_cpu_cores: {
            type: 'number',
            description: `The minimum number of physical CPU cores the machine must have.`,
            isRequired: true,
            format: 'uint64',
        },
        min_ram_gb: {
            type: 'number',
            description: `The minimum amount of RAM in GB (not GiB) the machine must have.`,
            isRequired: true,
            format: 'uint64',
        },
    },
} as const;


text:
package nam.model.application;

import java.io.Serializable;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

import org.apache.commons.lang.StringUtils;
import org.aries.ui.AbstractWizardPage;

import nam.model.Application;
import nam.model.util.ApplicationUtil;

@SessionScoped
@Named("applicationModulesSection")
public class ApplicationRecord_ModulesSection extends AbstractWizardPage<Application> implements Serializable {

	private Application application;

	public ApplicationRecord_ModulesSection() {
		setName("Modules");
		setUrl("modules");
	}

	public Application getApplication() {
		return application;
	}

	public void setApplication(Application application) {
		this.application = application;
	}

	@Override
	public String getIcon() {
		return "/icons/nam/Module16.gif";
	}

	@Override
	public void initialize(Application application) {
		setEnabled(true);
		setBackEnabled(true);
		setNextEnabled(true);
		setFinishEnabled(false);
		setApplication(application);
	}

	@Override
	public void validate() {
		if (application == null) {
			validator.missing("Application");
		} else {
		}
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  U-QASAR
  %%
  Copyright (C) 2012 - 2015 U-QASAR Consortium
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

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

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

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key = "title.header">Analyse Editor</entry>
<entry key = "label.name">Name</entry>
<entry key = "label.project">Projekt</entry>
<entry key = "label.description">Beschreibung</entry>
<entry key = "label.drilldown">Recherche Abmessungen</entry>
<entry key = "name.input.placeholder">Geben Sie einen Titel für Ihre Analyse</entry>
<entry key = "description.input.placeholder">Beschreiben Sie den Zweck Ihrer Analyse</entry>
<entry key = "submit.text">Speichern Analysis</entry>
<entry key = "cancel.text">Abbrechen</entry>
<entry key = "saved.message">Analyse wurde gespeichert</entry>
</properties>


text:
from random import sample

from django.db.models import Count
from django.http import HttpResponse
from django.shortcuts import render

from homepage.models import Rotw, PSA
from referrals.models import Referral, Category

def homepage(request, template_name='homepage.html'):
    categories = []
    for category in Category.objects.annotate(referral_count=Count('referral')):
        element = {
                'title': category.title,
                'description': category.description,
                'count': category.referral_count,
                'slug': category.slug,
                'title_plural': category.title_plural,
            }
        categories.append(element)

    # get upto 5 random referrals
    referral_count = Referral.objects.count()
    random_referrals = []
    if referral_count > 1:
        referral_ids = set([])

        # get 5 random keys
        referral_ids = sample(
                range(1, referral_count + 1), # generate a list from 1 to referral_count+1
                min(referral_count, 5) # get a sample of the smaller of 5 or the referra count
        )

        # Get the random packages
        random_referrals = Referral.objects.select_related().filter(pk__in=referral_ids)[:5]

    try:
        rotw = Rotw.objects.select_related().latest().referral
    except Rotw.DoesNotExist:
        rotw = None
    except Referral.DoesNotExist:
        rotw = None

    # service announcements on homepage
    try:
        psa_body = PSA.objects.latest().body_text
    except PSA.DoesNotExist:
        psa_body = '
There are currently no announcements.
'

    # TODO latest blog posts on homepage

    return render(request,
            template_name, {
                'latest_referrals': Referral.objects.select_related().all().order_by('-created_at')[:5],
                'random_referrals': random_referrals,
                'rotw': rotw,
                'psa_body': psa_body,
                'categories': categories,
                'referral_count': referral_count,
            }
    )


text:
id: 707
title: Ubuntu and HP TouchSmart Sound
date: 2011-09-26T16:04:01+00:00
author: tshanky
guid: http://shanky.org/?p=707
permalink: /2011/09/26/ubuntu-and-hp-touchsmart-sound/
dsq_thread_id:
  - 4654810521
categories:
  - Ubuntu
---
I upgraded my Ubuntu install on my HP TouchSmart machine to version 11.04 (Natty Narwhal). Ubuntu 11.04 Unity Desktop experience is so nice and smooth that I started using my HP TouchSmart actively again. It had been sitting gathering dust for the last many months!

The last version of Ubuntu on this machine was 10.04, which was upgraded to 11.04, via a 10.10 upgrade en route. During 10.04 days, I had trouble getting Ubuntu to work smoothly on this machine. The internal speakers did not work (only external speakers did), the wifi did not work, and the touch screen lost its touch qualities. After I upgraded to 11.04, I somehow believed many of these past woes would get corrected but that wasn't the case. So I actively started making some effort to resolve these issues. Getting the internal speaker sound to work was the first of the things I did and surprisingly a few minutes is all I needed to solve the problem.

The fix on the TouchSmart is really a simple and 1 line addition to a configuration file. Open the terminal and type the following:

sudo gedit /etc/modprobe.d/alsa-base.conf

This will open alsa-base.conf in gedit, the official text editor on the Gnome desktop. If you like vi instead of gedit then open the file as follows:

sudo vi /etc/modprobe.d/alsa-base.conf

At the very end add the following 1 line to alsa-base.conf file:

options snd-hda-intel model=touchsmart

Now, save the file and reload alsa using:

sudo alsa force-reload

and the internal speakers are in business. That was quick and simple. Wasn’t it?

**A little peek into why this fix works and how this may apply to systems other than the TouchSmart**:

Find out the model of your sound card using:

cat /proc/asound/card0/codec* | grep Codec

On my TouchSmart the output is as follows:

Codec: Analog Devices AD1984A

ALSA (Advanced Linux Sound Architecture) provides audio and MIDI functionality to the Linux OS. Browse the ALSA documentation to see list of supported audio models for your card. The documentation is available in /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz, which is a compressed file. You can list the content of this file, without decompressing, as follows:

gunzip -c /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz

It  may be a good idea to page through the file using the more command like so:

gunzip -c /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz | more

On my machine, I see the following entries relevant to AD1984A :

....

AD1884A / AD1883 / AD1984A / AD1984B
====================================
desktop    3-stack desktop (default)
laptop    laptop with HP jack sensing
mobile    mobile devices with HP jack sensing
thinkpad    Lenovo Thinkpad X300
touchsmart    HP Touchsmart

....

(First column is the model and second one is the description)

This explains why the value of **snd-hda-intel model** was set to **touchsmart**. This hopefully also gives you a clue to find your sound card model and its supported configuration values for that model if you have a problem getting sound to work on your own Ubuntu install.

For additional reference, consider reading https://help.ubuntu.com/community/HdaIntelSoundHowto.


text:
#pragma once

#include "support/BitSet.h"
#include "atn/PredictionContext.h"

namespace antlr4 {
namespace atn {

  /// Specialized set that can track info about the set, with support for combining similar configurations using a
  /// graph-structured stack.
  class ANTLR4CPP_PUBLIC ATNConfigSet {
  public:
    /// Track the elements as they are added to the set; supports get(i)
    std::vector<Ref<ATNConfig>> configs;

    // TO_DO: these fields make me pretty uncomfortable but nice to pack up info together, saves recomputation
    // TO_DO: can we track conflicts as they are added to save scanning configs later?
    size_t uniqueAlt;

    /** Currently this is only used when we detect SLL conflict; this does
     *  not necessarily represent the ambiguous alternatives. In fact,
     *  I should also point out that this seems to include predicated alternatives
     *  that have predicates that evaluate to false. Computed in computeTargetState().
     */
    antlrcpp::BitSet conflictingAlts;

    // Used in parser and lexer. In lexer, it indicates we hit a pred
    // while computing a closure operation.  Don't make a DFA state from this.
    bool hasSemanticContext;
    bool dipsIntoOuterContext;

    /// <summary>
    /// Indicates that this configuration set is part of a full context
    ///  LL prediction. It will be used to determine how to merge $. With SLL
    ///  it's a wildcard whereas it is not for LL context merge.
    /// </summary>
    const bool fullCtx;

    ATNConfigSet(bool fullCtx = true);
    ATNConfigSet(const Ref<ATNConfigSet> &old);

    virtual ~ATNConfigSet();

    virtual bool add(const Ref<ATNConfig> &config);

    /// <summary>
    /// Adding a new config means merging contexts with existing configs for
    /// {@code (s, i, pi, _)}, where {@code s} is the
    /// <seealso cref="ATNConfig#state"/>, {@code i} is the <seealso cref="ATNConfig#alt"/>, and
    /// {@code pi} is the <seealso cref="ATNConfig#semanticContext"/>. We use
    /// {@code (s,i,pi)} as key.
    /// <p/>
    /// This method updates <seealso cref="#dipsIntoOuterContext"/> and
    /// <seealso cref="#hasSemanticContext"/> when necessary.
    /// </summary>
    virtual bool add(const Ref<ATNConfig> &config, PredictionContextMergeCache *mergeCache);

    virtual std::vector<ATNState *> getStates();

    /**
     * Gets the complete set of represented alternatives for the configuration
     * set.
     *
     * @return the set of represented alternatives in this configuration set
     *
     * @since 4.3
     */
    antlrcpp::BitSet getAlts();
    virtual std::vector<Ref<SemanticContext>> getPredicates();

    virtual Ref<ATNConfig> get(size_t i) const;

    virtual void optimizeConfigs(ATNSimulator *interpreter);

    bool addAll(const Ref<ATNConfigSet> &other);

    bool operator == (const ATNConfigSet &other);
    virtual size_t hashCode();
    virtual size_t size();
    virtual bool isEmpty();
    virtual void clear();
    virtual bool isReadonly();
    virtual void setReadonly(bool readonly);
    virtual std::string toString();

  protected:
    /// All configs but hashed by (s, i, _, pi) not including context. Wiped out
    /// when we go readonly as this set becomes a DFA state.
    // ml: no need for a comparer here as by definition there can be no hash clashes.
    //     (same hashes always mean same object).
    std::unordered_map<size_t, ATNConfig *> _configLookup;

    /// Indicates that the set of configurations is read-only. Do not
    /// allow any code to manipulate the set; DFA states will point at
    /// the sets and they must not change. This does not protect the other
    /// fields; in particular, conflictingAlts is set after
    /// we've made this readonly.
    bool _readonly;

    virtual size_t getHash(ATNConfig *c); // Hash differs depending on set type.

  private:
    size_t _cachedHashCode;

    void InitializeInstanceFields();
  };

} // namespace atn
} // namespace antlr4


text:
#include <QApplication>
#include <QClipboard>
#include <string>
#include <vector>

#include "base58.h"
#include "multisiginputentry.h"
#include "ui_multisiginputentry.h"
#include "main.h"
#include "script.h"
#include "util.h"
#include "wallet.h"
#include "walletmodel.h"

MultisigInputEntry::MultisigInputEntry(QWidget *parent) : QFrame(parent), ui(new Ui::MultisigInputEntry), model(0)
{
    ui->setupUi(this);

#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    ui->transactionId->setPlaceholderText(tr("Enter a transaction id"));
    ui->redeemScript->setPlaceholderText(tr("Enter the redeem script of the address in the transaction output"));
#endif
}

MultisigInputEntry::~MultisigInputEntry()
{
    delete ui;
}

void MultisigInputEntry::setModel(WalletModel *model)
{
    this->model = model;
    clear();
}

void MultisigInputEntry::clear()
{
    ui->transactionId->clear();
    ui->transactionOutput->clear();
    ui->redeemScript->clear();
}

bool MultisigInputEntry::validate()
{
    return (ui->transactionOutput->count() > 0);
}

CTxIn MultisigInputEntry::getInput()
{
    int nOutput = ui->transactionOutput->currentIndex();
    CTxIn input(COutPoint(txHash, nOutput));

    return input;
}

int64 MultisigInputEntry::getAmount()
{
    int64 amount = 0;
    int nOutput = ui->transactionOutput->currentIndex();
    CTransaction tx;
    uint256 blockHash = 0;

    if(GetTransaction(txHash, tx, blockHash))
    {
        if(nOutput < (int)tx.vout.size())
        {
            const CTxOut& txOut = tx.vout[nOutput];
            amount = txOut.nValue;
        }
    }

    return amount;
}

QString MultisigInputEntry::getRedeemScript()
{
    return ui->redeemScript->text();
}

void MultisigInputEntry::setTransactionId(QString transactionId)
{
    ui->transactionId->setText(transactionId);
}

void MultisigInputEntry::setTransactionOutputIndex(int index)
{
    ui->transactionOutput->setCurrentIndex(index);
}

void MultisigInputEntry::setRemoveEnabled(bool enabled)
{
    ui->deleteButton->setEnabled(enabled);
}

void MultisigInputEntry::on_pasteTransactionIdButton_clicked()
{
    ui->transactionId->setText(QApplication::clipboard()->text());
}

void MultisigInputEntry::on_deleteButton_clicked()
{
    emit removeEntry(this);
}

void MultisigInputEntry::on_pasteRedeemScriptButton_clicked()
{
    ui->redeemScript->setText(QApplication::clipboard()->text());
}

void MultisigInputEntry::on_transactionId_textChanged(const QString &transactionId)
{
    ui->transactionOutput->clear();
    if(transactionId.isEmpty())
        return;

    // Make list of transaction outputs
    txHash.SetHex(transactionId.toStdString().c_str());
    CTransaction tx;
    uint256 blockHash = 0;
    if(!GetTransaction(txHash, tx, blockHash))
        return;
    for(int i = 0; i < (int)tx.vout.size(); i++)
    {
        QString idStr;
        idStr.setNum(i);
        const CTxOut& txOut = tx.vout[i];
        int64 amount = txOut.nValue;
        QString amountStr;
        amountStr.sprintf("%.6f", (double) amount / COIN);
        CScript script = txOut.scriptPubKey;
        CTxDestination addr;
        if(ExtractDestination(script, addr))
        {
            CBitcoinAddress address(addr);
            QString addressStr(address.ToString().c_str());
            ui->transactionOutput->addItem(idStr + QString(" - ") + addressStr + QString(" - ") + amountStr + QString(" PPC"));
        }
        else
            ui->transactionOutput->addItem(idStr + QString(" - ") + amountStr + QString(" PPC"));
    }
}

void MultisigInputEntry::on_transactionOutput_currentIndexChanged(int index)
{
    if(ui->transactionOutput->itemText(index).isEmpty())
        return;

    CTransaction tx;
    uint256 blockHash = 0;
    if(!GetTransaction(txHash, tx, blockHash))
        return;
    const CTxOut& txOut = tx.vout[index];
    CScript script = txOut.scriptPubKey;

    if(script.IsPayToScriptHash())
    {
        ui->redeemScript->setEnabled(true);

        if(model)
        {
            // Try to find the redeem script
            CTxDestination dest;
            if(ExtractDestination(script, dest))
                {
                    CScriptID scriptID = boost::get<CScriptID>(dest);
                    CScript redeemScript;
                    if(model->getWallet()->GetCScript(scriptID, redeemScript))
                        ui->redeemScript->setText(HexStr(redeemScript.begin(), redeemScript.end()).c_str());
                }
        }
    }
    else
    {
        ui->redeemScript->setEnabled(false);
    }

    emit updateAmount();
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__char_fscanf_postinc_42.c
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-42.tmpl.c
*/
/*
 * @description
 * CWE: 190 Integer Overflow
 * BadSource: fscanf Read data from the console using fscanf()
 * GoodSource: Set data to a small, non-zero number (two)
 * Sinks: increment
 *    GoodSink: Ensure there will not be an overflow before incrementing data
 *    BadSink : Increment data, which can cause an overflow
 * Flow Variant: 42 Data flow: data returned from one function to another in the same source file
 *
 * */

#include "std_testcase.h"

#ifndef OMITBAD

static char badSource(char data)
{
    /* POTENTIAL FLAW: Use a value input from the console */
    fscanf (stdin, "%c", &data);
    return data;
}

void CWE190_Integer_Overflow__char_fscanf_postinc_42_bad()
{
    char data;
    data = ' ';
    data = badSource(data);
    {
        /* POTENTIAL FLAW: Incrementing data could cause an overflow */
        data++;
        char result = data;
        printHexCharLine(result);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
static char goodG2BSource(char data)
{
    /* FIX: Use a small, non-zero value that will not cause an overflow in the sinks */
    data = 2;
    return data;
}

static void goodG2B()
{
    char data;
    data = ' ';
    data = goodG2BSource(data);
    {
        /* POTENTIAL FLAW: Incrementing data could cause an overflow */
        data++;
        char result = data;
        printHexCharLine(result);
    }
}

/* goodB2G uses the BadSource with the GoodSink */
static char goodB2GSource(char data)
{
    /* POTENTIAL FLAW: Use a value input from the console */
    fscanf (stdin, "%c", &data);
    return data;
}

static void goodB2G()
{
    char data;
    data = ' ';
    data = goodB2GSource(data);
    /* FIX: Add a check to prevent an overflow from occurring */
    if (data < CHAR_MAX)
    {
        data++;
        char result = data;
        printHexCharLine(result);
    }
    else
    {
        printLine("data value is too large to perform arithmetic safely.");
    }
}

void CWE190_Integer_Overflow__char_fscanf_postinc_42_good()
{
    goodB2G();
    goodG2B();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
   its own for testing or for building a binary to use in testing binary
   analysis tools. It is not used when compiling all the testcases as one
   application, which is how source code analysis tools are tested. */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE190_Integer_Overflow__char_fscanf_postinc_42_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE190_Integer_Overflow__char_fscanf_postinc_42_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
import {Component, HostListener} from '@angular/core'

@Component({
    selector: `pageparent-view`,
    template: `
        <div [style.margin-left]="parentMargin" [style.margin-right]="parentMargin"
             style="margin-top:20px;margin-bottom:20px">
            <ng-content></ng-content>
        </div>
    `,
    inputs: ['parentMarginOffset', 'parentMarginSmallScreen']
})
export class PageParentComponent {

    parentMargin: string
    parentMarginOffset = 0.125
    parentMarginSmallScreen = 30

    ngOnInit() {
        this.onWindowResize(window.innerWidth)
    }

    @HostListener('window:resize', ['$event'])
    onResize(event) {
        this.onWindowResize(event.target.innerWidth)
    }

    onWindowResize(size: number) {
        this.parentMargin = (size > 1200 ? (size * this.parentMarginOffset)
                : size > 480 ? this.parentMarginSmallScreen : 0) + 'px'
    }

}


text:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ColumnComponent } from './column.component';
import { SpanColumnComponent } from './span-column.component';
import { ColumnGroupComponent } from './column-group.component';
import { FooterTemplateDirective } from './footer-template.directive';
import { ColGroupComponent } from './col-group.component';
import { ResizableContainerDirective } from './resizable.directive';
import { TemplateContextDirective } from './template-context.directive';
import { DetailTemplateDirective } from './detail-template.directive';
import { DraggableDirective } from './draggable.directive';
import { FieldAccessorPipe } from "./field-accessor.pipe";
var exportedModules = [
    DraggableDirective,
    ColumnComponent,
    ColumnGroupComponent,
    FooterTemplateDirective,
    ColGroupComponent,
    ResizableContainerDirective,
    TemplateContextDirective,
    FieldAccessorPipe,
    DetailTemplateDirective,
    SpanColumnComponent
];
/**
 * @hidden
 */
var SharedModule = (function () {
    function SharedModule() {
    }
    SharedModule.exports = function () {
        return [
            ColumnComponent,
            SpanColumnComponent,
            ColumnGroupComponent,
            FooterTemplateDirective,
            DetailTemplateDirective
        ];
    };
    return SharedModule;
}());
export { SharedModule };
SharedModule.decorators = [
    { type: NgModule, args: [{
                declarations: [exportedModules],
                exports: [exportedModules],
                imports: [CommonModule]
            },] },
];
/** @nocollapse */
SharedModule.ctorParameters = function () { return []; };


text:
using Dealership.Engine;

namespace Dealership.CommandHandlers.Contracts
{
    public interface ICommandHandler
    {
        void AddCommandHandler(ICommandHandler loginHandler);

        string HandleCommand(ICommand command, IEngine engine);
    }
}


text:
package org.libraryweasel.traytable;

import javafx.beans.property.ReadOnlyStringWrapper;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.IntStream;

public final class TrayTable {
    public static TableView<List<String>> create(List<String> headers, List<Integer> widths, List<List<String>> content) {
        final TableView<List<String>> table = new TableView<>();

        IntStream.range(0, headers.size()).forEach((final int index) -> {
            final TableColumn<List<String>, String> column = new TableColumn<>(headers.get(index));
            if (widths.size() > index) {column.setPrefWidth(widths.get(index)); }
            table.getColumns().add(column);
            column.setCellValueFactory(row ->
                new ReadOnlyStringWrapper((index < row.getValue().size()) ? row.getValue().get(index) : ""));
        });
        table.getItems().addAll(content);
        return table;
    }

    public static TableView<List<String>> create(List<String> headers, List<List<String>> content) {
        return create(headers, new ArrayList<>(), content);
    }
}