text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>code-summarization</groupId>
  <artifactId>tassal</artifactId>
  <packaging>jar</packaging>
  <version>1.1-SNAPSHOT</version>
  <name>TASSAL Standalone Jar</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
     <plugins>
        <plugin>
	  <artifactId>maven-compiler-plugin</artifactId>
	  <version>3.1</version>
	  <configuration>
	    <source>1.8</source>
	    <target>1.8</target>
	  </configuration>
	</plugin>
	<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.2</version>
          <executions>
              <execution>
                  <phase>package</phase>
                  <goals>
                      <goal>shade</goal>
                  </goals>
                  <configuration>
		      <finalName>${project.artifactId}-${project.version}</finalName>
		      <createDependencyReducedPom>false</createDependencyReducedPom>
		      <filters>
                          <filter>
                              <artifact>*:*</artifact>
                              <excludes>
                                  <exclude>META-INF/*.SF</exclude>
                                  <exclude>META-INF/*.DSA</exclude>
                                  <exclude>META-INF/*.RSA</exclude>
                              </excludes>
                          </filter>
                      </filters>
                      <transformers>
                          <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                              <resource>reference.conf</resource>
                          </transformer>
                      </transformers>
                  </configuration>
              </execution>
          </executions>
      	</plugin>
     </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>code-summarization</groupId>
      <artifactId>autofolding</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

</project>


text:
<?php

	include("db.php");

	if (isset($_POST['deleteId'])) {
		$deleteId = $_POST['deleteId'];
		$deleteEventSql = $db -> query("DELETE FROM event WHERE eventId = '$deleteId'");
		$deleteEventticketSql = $db -> query("DELETE FROM eventticket WHERE eventId = '$deleteId'");
	    $selectEvents = $db ->query("SELECT * FROM event");
	    while($rowevent = mysqli_fetch_array($selectEvents))
	    {
	        echo'

                        	<button title="Remove event '.$rowevent['eventName'].'" class="md-btn md-btn-danger md-fab uk-position-small uk-position-bottom-right" onclick="deleteEvent(deleteId='.$rowevent['eventId'].')">&times</button>
                            '.$rowevent['eventName'].'

                            '.$rowevent['eventDate'].'
                            '.$rowevent['eventTime'].'

	        ';
	    }
	}
?>

<?php

	if (isset($_POST['backticketId'])) {
		$backticketId = $_POST['backticketId'];
		?>

                    Event Pass

						Pass
						Price
						Booked

					<?php

						$selectticket = $db ->query("SELECT * FROM eventTicket WHERE ticketId = '$backticketId'");
						$backticket = mysqli_fetch_array($selectticket);
						$backeventId = $backticket['eventId'];
						$selectPass = $db ->query("SELECT * FROM eventTicket WHERE eventId = '$backeventId'");
						while ($Pass = mysqli_fetch_array($selectPass)) {
							$ticketId = $Pass['ticketId'];
							?>
								<tr style="cursor: pointer;" onclick="showjoiner(ticket = <?php echo $ticketId; ?>)">
									<?php echo $Pass['ticketName']?>
									<?php echo $Pass['ticketPrice']?>
									<?php echo ''.$Pass['joinedPeople'] .'/'. $Pass['ticketPlace'].''?>

							<?php
						}

					?>

            	<button class="md-btn md-btn-success md-fab uk-position-small uk-position-bottom-right" onclick="addPass(eventId = <?php echo $backeventId;?>)">+
            	</button>

                    Add Event Pass

	                Pass Name: <input type="text" id="ticketName" class="md-input">

	                Pass Price: <input type="number" id="ticketPrice" class="md-input">

	                Pass Place: <input type="number" id="ticketPlace" class="md-input">

            	<button class="md-btn md-btn-success md-fab uk-position-small uk-position-bottom-right" onclick="addPassbutton(eventId = <?php echo $backeventId;?>)">+
            	</button>

        <?php
	}

?>

<?php
	if (isset($_POST['eventId'])) {
		$eventId = $_POST['eventId'];
		$selectEventSql = $db -> query("SELECT * FROM event WHERE eventId = '$eventId' LIMIT 1")or die (mysqli_error());
		$rowevent = mysqli_fetch_array($selectEventSql);
	    $ename = $rowevent['eventName'];
?>

			<div style="background-size: cover;
				background-repeat: no-repeat;
				background-position: center center;
				background-image: url(gallery/event/<?php echo $rowevent['profile'];?>); height: 400px;">

                    Event Name: <?php echo $rowevent['eventName']?>

					Event Date: <?php echo $rowevent['eventDate']?>

					Event Time: <?php echo $rowevent['eventTime']?>

					Event Location: <?php echo $rowevent['eventLocation']?>

                    Event Status: <?php echo $rowevent['eventStatus']?>

                    <button class="md-btn md-btn-success md-fab" onclick="editevent(editId=<?php echo $eventId;?>)">Edit</button>
                    <button class="md-btn md-btn-info md-fab" onclick="cover(editId=<?php echo $eventId;?>)">cover</button>

                    Event Pass

						Pass
						Price
						Booked

					<?php

						$selectPass = $db ->query("SELECT * FROM eventTicket WHERE eventId = '$eventId'");
						while ($Pass = mysqli_fetch_array($selectPass)) {
							$ticketId = $Pass['ticketId'];
							?>
								<tr style="cursor: pointer;" onclick="showjoiner(ticket = <?php echo $ticketId; ?>)">
									<?php echo $Pass['ticketName']?>
									<?php echo $Pass['ticketPrice']?>
									<?php echo ''.$Pass['joinedPeople'] .'/'. $Pass['ticketPlace'].''?>

							<?php
						}

					?>

            	<button class="md-btn md-btn-success md-fab uk-position-small uk-position-bottom-right" onclick="addPass(eventId)">+
            	</button>

                    Add Event Pass

	                Pass Name: <input type="text" id="ticketName" class="md-input">

	                Pass Price: <input type="number" id="ticketPrice" class="md-input">

	                Pass Place: <input type="number" id="ticketPlace" class="md-input">

            	<button class="md-btn md-btn-success md-fab uk-position-small uk-position-bottom-right" onclick="addPassbutton(eventId)">+
            	</button>

<?php
	}
?>

redpajama_set_name: RedPajamaGithub


text: var pkg = require('dilu');


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Periconiella pomaderridis McKenzie

### Remarks
null


text:
<?php
if (isset($_POST['cancel'])) {
	Atomik::redirect('list_eqpt');
}
$acronym = $_POST['name'];
$project_id = $_POST['project_id'];
$description = $_POST['description'];
$abstract = $_POST['abstract'];
$part_number = $_POST['part_number'];
$dal = $_POST['dal'];
$scope_id = $_POST['scope_id'];
$manager_id = $_POST['show_poster'];
$parent_id = $_POST['show_lru'];
if (isset($_POST['submit'])) {
	$eqpt_id = Atomik_Db::insert('lrus',array('lru'=>$acronym,
								'project'=>$project_id,
								'description_lru'=>$description,
								'abstract'=>$abstract,
								'part_number'=>$part_number,
								'dal'=>$dal,
								'scope_id'=>$scope_id,
								'manager_id'=>$manager_id,
								'parent_id'=>$parent_id));
	if ($eqpt_id){
		/* update parent ID in case this field is empty */
		if ($parent_id == ""){
			$result = Atomik_Db::update('lrus',array('parent_id'=>$eqpt_id),array('id'=>$eqpt_id));
		}
		Atomik::Flash("Equipment added.","success");
	}
	else{
		Atomik::Flash("Equipment adding failed.","failed");
	}
	Atomik::redirect('list_eqpt');
}
else if (isset($_POST['modify'])){
	$eqpt_id = $_POST['id'];
	$result = Atomik_Db::update('lrus',array('lru'=>$acronym,
											'project'=>$project_id,
											'description_lru'=>$description,
											'abstract'=>$abstract,
											'part_number'=>$part_number,
											'dal'=>$dal,
											'scope_id'=>$scope_id,
											'manager_id'=>$manager_id,
											'parent_id'=>$parent_id),array('id'=>$eqpt_id));
	if ($result){
		Atomik::Flash("Equipment modified.","success");
	}
	else{
		Atomik::Flash("Equipment update failed.","failed");
	}
	Atomik::redirect('list_eqpt');
}


text:
'use strict';

module.exports = {
  isAsync: isAsync
};

function isAsync(iterators) {
  const length = iterators.length;
  var i = -1;
  while (++i < length)
    if (iterators[i].async) return true;
  return false;
}


text:
<?php

namespace Ekkinox\KataBooks\Model;

/**
 * @package Ekkinox\KataBooks\Model
 */
class Cart
{
    /**
     * @var CatalogInterface
     */
    private $catalog;

    /**
     * @var array
     */
    private $items;

    /**
     * @param CatalogInterface $catalog
     */
    public function __construct(CatalogInterface $catalog)
    {
        $this->catalog = $catalog;
        $this->items   = [];
    }

    /**
     * @return int
     */
    public function getProductsTotalQuantity(): int
    {
        return array_sum($this->items);
    }

    /**
     * @return int
     */
    public function getProductsDistinctQuantity(): int
    {
        return count(array_keys($this->items));
    }

    /**
     * @param string $name
     *
     * @return int
     */
    public function getProductQuantity(string $name): int
    {
        return intval($this->items[$name] ?? 0);
    }

    /**
     * @return int
     */
    public function getTotalPrice(): int
    {
        $totalPrice = 0;
        foreach ($this->items as $name => $quantity) {
            $totalPrice += $this->catalog->getProduct($name)->getPrice() * $quantity;
        }

        return $totalPrice;
    }

    /**
     * @param string $name
     * @param int    $quantity
     *
     * @return Cart
     */
    public function addProduct(string $name, int $quantity): self
    {
        if (null !== $this->catalog->getProduct($name)) {
            if (!isset($this->items[$name])) {
                $this->items[$name] = 0;
            }
            $this->items[$name] += $quantity;
        }

        return $this;
    }

    /**
     * @param string $name
     * @param int    $quantity
     *
     * @return Cart
     */
    public function removeProduct(string $name, int $quantity): self
    {
        if (isset($this->items[$name])) {
            if ($this->items[$name] > $quantity) {
                $this->items[$name] -= $quantity;
            } else {
                unset($this->items[$name]);
            }
        }

        return $this;
    }
}


text:
from django.conf.urls.defaults import *
from manage_feedback.models import feedbackForm

#info_dict = {
#	'queryset':
info_dict = {
	'queryset' : feedbackForm.objects.all(),
	#should be changed to feedbackForm.allowedforCurrenUser() which will automatically pass the username from the session and bring only those forms....that method is to be defined in the model for feedbackForm
	}

#urlpatterns = patterns('',
#	(r'^$','django.views.generic.list_detail.object_list',info_dict),
#	);


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 "ASPBarcodeBuilder.h"

@protocol ASPBarcodeBuildersList
@end

@interface ASPBarcodeBuildersList : ASPObject

@property(nonatomic) NSArray<ASPBarcodeBuilder>* barcodeBuilders;

@property(nonatomic) NSNumber* xStep;

@property(nonatomic) NSNumber* yStep;

@end


text:
package tz.gzu.oip.dm.po;

/**
 * 官网资源表
 * @author rabit
 */
public class OfficialResouce {
  private Integer id;
  private String title;
  private String url;
  private Integer visible;
  private Integer cid;
  private String rebuild1;
  private String rebuild2;
  private String rebuild3;
  private String rebuild4;

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }

  public Integer getVisible() {
    return visible;
  }

  public void setVisible(Integer visible) {
    this.visible = visible;
  }

  public Integer getCid() {
    return cid;
  }

  public void setCid(Integer cid) {
    this.cid = cid;
  }

  public String getRebuild1() {
    return rebuild1;
  }

  public void setRebuild1(String rebuild1) {
    this.rebuild1 = rebuild1;
  }

  public String getRebuild2() {
    return rebuild2;
  }

  public void setRebuild2(String rebuild2) {
    this.rebuild2 = rebuild2;
  }

  public String getRebuild3() {
    return rebuild3;
  }

  public void setRebuild3(String rebuild3) {
    this.rebuild3 = rebuild3;
  }

  public String getRebuild4() {
    return rebuild4;
  }

  public void setRebuild4(String rebuild4) {
    this.rebuild4 = rebuild4;
  }
}


text:
package barqsoft.footballscores;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class PagerFragment extends Fragment {

    public static final int NUM_PAGES = 5;
    public ViewPager mViewPager;
    private MyPageAdapter mPagerAdapter;
    private MainScreenFragment[] viewFragments = new MainScreenFragment[5];

    @Override
    public View onCreateView(LayoutInflater inflater,
                             @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.pager_fragment, container, false);
        mViewPager = (ViewPager) rootView.findViewById(R.id.pager);
        mPagerAdapter = new MyPageAdapter(getChildFragmentManager());
        for (int i = 0; i < NUM_PAGES; i++) {
            viewFragments[i] = new MainScreenFragment();
            viewFragments[i].setFragmentDate(getDate(i));
        }
        mViewPager.setAdapter(mPagerAdapter);
        mViewPager.setCurrentItem(MainActivity.current_fragment);

        mViewPager.setOnPageChangeListener(
                new ViewPager.SimpleOnPageChangeListener() {
                    @Override
                    public void onPageSelected(int position) {
                        // When swiping between pages, select the corresponding tab.
                        getActionBar().setSelectedNavigationItem(position);
                    }
                });

        getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        // Create a tab listener that is called when the user changes tabs.
        ActionBar.TabListener tabListener = new ActionBar.TabListener() {
            public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
                // When the tab is selected, switch to the corresponding page in the ViewPager.
                mViewPager.setCurrentItem(tab.getPosition());
            }

            @Override
            public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
            }

            @Override
            public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
            }
        };

        // Add tabs, specifying the tab's text and TabListener
        for (int i = 0; i < NUM_PAGES; i++) {
            boolean selected = i == 2;
            getActionBar().addTab(
                    getActionBar().newTab()
                            .setText(getDayName(i))
                            .setTabListener(tabListener), selected);
        }

        return rootView;
    }

    // StatePage changed to just page, check if data auto refreshes, or listener needed
    private class MyPageAdapter extends FragmentPagerAdapter {
        @Override
        public Fragment getItem(int i) {
            return viewFragments[i];
        }

        @Override
        public int getCount() {
            return NUM_PAGES;
        }

        public MyPageAdapter(FragmentManager fm) {
            super(fm);
        }
    }

    public String getDayName(int position) {

        switch (position) {

            case 1:
                return getContext().getString(R.string.yesterday);
            case 2:
                return getContext().getString(R.string.today);
            case 3:
                return getContext().getString(R.string.tomorrow);
            case 0: {
                Calendar calendar = Calendar.getInstance();
                calendar.add(Calendar.DATE, -2);
                return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.getDefault());
            }
            case 4: {
                Calendar calendar = Calendar.getInstance();
                calendar.add(Calendar.DATE, 2);
                return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.getDefault());
            }
        }

        return getContext().getString(R.string.Unknown);
    }

    private ActionBar getActionBar() {
        return ((AppCompatActivity) getActivity()).getSupportActionBar();
    }

    private String getDate(int i) {
        Date fragmentdate = new Date(System.currentTimeMillis() + ((i - 2) * 86400000));
        SimpleDateFormat mformat = new SimpleDateFormat("yyyy-MM-dd", getResources().getConfiguration().locale);
        return mformat.format(fragmentdate);
    }

}


text:
package com.google.cloud.teleport.v2.transforms;

import static com.google.common.base.Preconditions.checkState;

import com.google.auto.value.AutoValue;
import com.google.cloud.teleport.v2.values.FailsafeElement;
import com.google.common.collect.ImmutableMap;
import javax.annotation.Nullable;
import org.apache.beam.sdk.io.gcp.pubsub.PubsubMessage;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.PTransform;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.beam.sdk.values.PCollection;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.parquet.Strings;

/** {@link PTransform}s for working with {@link FailsafeElement}s. */
public final class FailsafeElementTransforms {
  /**
   * {@link PTransform} for converting a {@link FailsafeElement} to {@link PubsubMessage}.
   *
   *
The {@link PubsubMessage} payload will be either the original payload or current payload of
   * the {@link FailsafeElement}. Which one depends on the provided {@link SerializableFunction}.
   *
   *
There is also support for an optional error message attribute. There is no support for a
   * stack trace attribute, as that can easily exceed Pub/Sub limitations.
   */
  @AutoValue
  public abstract static class ConvertFailsafeElementToPubsubMessage<OriginalT, CurrentT>
      extends PTransform<
          PCollection<FailsafeElement<OriginalT, CurrentT>>, PCollection<PubsubMessage>> {

    /**
     * {@link SerializableFunction} for the result of {@link FailsafeElement#getOriginalPayload()}.
     *
     *
Either this or {@link ConvertFailsafeElementToPubsubMessage#currentPayloadSerializeFn()}
     * must return non-null, but not both. The one that doesn't return null will determine which
     * value from the {@link FailsafeElement} to encode.
     */
    @Nullable
    public abstract SerializableFunction<OriginalT, Byte[]> originalPayloadSerializeFn();

    /**
     * {@link SerializableFunction} for the result of {@link FailsafeElement#getPayload()}.
     *
     *
Either this or {@link ConvertFailsafeElementToPubsubMessage#originalPayloadSerializeFn()}
     * must return non-null, but not both. The one that doesn't return null will determine which
     * value from the {@link FailsafeElement} to encode.
     */
    @Nullable
    public abstract SerializableFunction<CurrentT, Byte[]> currentPayloadSerializeFn();

    /**
     * Optional key to use for setting a Pub/Sub attribute that contains {@link
     * FailsafeElement#getErrorMessage()} as its value.
     *
     *
If this is null or there is error message in the {@link FailsafeElement}, then no
     * attribute will be created.
     */
    @Nullable
    public abstract String errorMessageAttributeKey();

    public static <OriginalT, CurrentT> Builder<OriginalT, CurrentT> builder() {
      return new AutoValue_FailsafeElementTransforms_ConvertFailsafeElementToPubsubMessage
          .Builder<>();
    }

    /** Builder for {@link ConvertFailsafeElementToPubsubMessage}. */
    @AutoValue.Builder
    public abstract static class Builder<OriginalT, CurrentT> {
      public abstract Builder<OriginalT, CurrentT> setOriginalPayloadSerializeFn(
          @Nullable SerializableFunction<OriginalT, Byte[]> value);

      public abstract Builder<OriginalT, CurrentT> setCurrentPayloadSerializeFn(
          @Nullable SerializableFunction<CurrentT, Byte[]> value);

      public abstract Builder<OriginalT, CurrentT> setErrorMessageAttributeKey(
          @Nullable String value);

      protected abstract ConvertFailsafeElementToPubsubMessage<OriginalT, CurrentT> autoBuild();

      public final ConvertFailsafeElementToPubsubMessage<OriginalT, CurrentT> build() {
        ConvertFailsafeElementToPubsubMessage<OriginalT, CurrentT> converter = autoBuild();
        checkState(
            converter.originalPayloadSerializeFn() != null
                ^ converter.currentPayloadSerializeFn() != null,
            "Either originalPayloadCoder or currentPayloadCoder must be set, but not both");
        return converter;
      }
    }

    @Override
    public PCollection<PubsubMessage> expand(
        PCollection<FailsafeElement<OriginalT, CurrentT>> input) {
      return input.apply(
          "FailsafeElement to PubsubMessage DoFn",
          ParDo.of(
              new DoFn<FailsafeElement<OriginalT, CurrentT>, PubsubMessage>() {
                @ProcessElement
                public void processElement(ProcessContext context) {
                  FailsafeElement<OriginalT, CurrentT> element = context.element();

                  byte[] payload = serializePayload(element);

                  ImmutableMap.Builder<String, String> attributes = ImmutableMap.builder();
                  if (!Strings.isNullOrEmpty(errorMessageAttributeKey())
                      && !Strings.isNullOrEmpty(element.getErrorMessage())) {
                    attributes.put(errorMessageAttributeKey(), element.getErrorMessage());
                  }

                  context.output(new PubsubMessage(payload, attributes.build()));
                }
              }));
    }

    /** Handles the encoding regardless of which part of {@code element} needs to be encoded. */
    private byte[] serializePayload(FailsafeElement<OriginalT, CurrentT> element) {
      Byte[] bytes =
          originalPayloadSerializeFn() != null
              ? originalPayloadSerializeFn().apply(element.getOriginalPayload())
              : currentPayloadSerializeFn().apply(element.getPayload());
      return ArrayUtils.toPrimitive(bytes);
    }
  }
}


text:
export CLASSPATH=./classes:./testclasses:./libs/\*:$CLASSPATH

echo making dir:  ./classes
rm -rf ./classes
rm -rf ./testclasses
mkdir ./classes
mkdir ./testclasses

echo Compiling java source ===========================================
javac -Xlint:unchecked -XDignore.symbol.file -g -d ./classes `find . -name "*.java" `

echo Compiling .j files for testing ==================================
java -ea kilim.tools.Asm -nf -d ./classes `find . -name "*.j"`

echo Weaving =========================================================
# Weave all files under ./classes, compiling the tests to
# ./testclasses while excluding any that match "ExInvalid". These are
# negative tests for the Weaver.
java -ea kilim.tools.Weaver -d ./classes -x "ExInvalid|test" ./classes
java -ea kilim.tools.Weaver -d ./testclasses -x "ExInvalid" ./classes


text:
<!doctype html>

<!-- Basic canvas demo -->
<!-- Copyright (c) 2012 Eric Kryski -->
<!-- MIT Licensed -->
<!-- Canvas source code adapted from https://developer.mozilla.org/samples/domref/touchevents.html -->

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Caress Canvas</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width">
  <style type="text/css">
    #canvas {
      border:solid black 1px;
    }
    body {
      padding: 0;
      margin: 0;
    }
  </style>
</head>
<body onload="startup()">
  <canvas id="canvas" width="1920" height="1080">
    You really badly need to use a different browser.
  </canvas>

  <!-- The Scripts -->
  <script type="text/javascript" src="../common/js/jquery-1.8.1.min.js"></script>
  <script type="text/javascript" src="../common/js/underscore-1.3.3.min.js"></script>
  <script type="text/javascript" src="../common/js/socket.io-0.9.10.min.js"></script>
  <script type="text/javascript" src="../common/js/caress-0.1.0.js"></script>
  <script>
      $(function() {
          window.client = new Caress.Client({
              host: 'localhost',
              port: 5000
          });
          client.connect();
      });
  </script>
  <script>
    var ongoingTouches = new Array;

    function colorForTouch(touch) {
      var id = touch.identifier;

      return '#'+Math.floor(Math.random() * 16777215 * id).toString(16);
    }

    function ongoingTouchIndexById(idToFind) {
      for (var i=0; i<ongoingTouches.length; i++) {
        var id = ongoingTouches[i].identifier;

        if (id == idToFind) {
          return i;
        }
      }
      return -1;    // not found
    }

    function handleStart(evt) {
      evt.preventDefault();
      var el = document.getElementById("canvas");
      var ctx = el.getContext("2d");
      var touches = evt.changedTouches;

      for (var i=0; i<touches.length; i++) {
        var color = colorForTouch(touches[i]);
        ongoingTouches.push(touches[i]);
        ctx.fillStyle = color;
        ctx.fillRect(touches[i].pageX-2, touches[i].pageY-2, 4, 4);
      }
    }

    function handleMove(evt) {
      evt.preventDefault();
      var el = document.getElementById("canvas");
      var ctx = el.getContext("2d");
      var touches = evt.changedTouches;

      ctx.lineWidth = 4;

      for (var i=0; i<touches.length; i++) {
        var idx = ongoingTouchIndexById(touches[i].identifier);

        ctx.fillStyle = touches[i].color;
        ctx.beginPath();
        ctx.moveTo(ongoingTouches[idx].pageX, ongoingTouches[idx].pageY);
        ctx.lineTo(touches[i].pageX, touches[i].pageY);
        ctx.closePath();
        ctx.stroke();
        ongoingTouches.splice(idx, 1, touches[i]);  // swap in the new touch record
      }
    }

    function handleEnd(evt) {
      evt.preventDefault();
      var el = document.getElementById("canvas");
      var ctx = el.getContext("2d");
      var touches = evt.changedTouches;

      ctx.lineWidth = 4;

      for (var i=0; i<touches.length; i++) {
        var color = colorForTouch(touches[i]);
        var idx = ongoingTouchIndexById(touches[i].identifier);

        ctx.fillStyle = color;
        ctx.beginPath();
        ctx.moveTo(ongoingTouches[i].pageX, ongoingTouches[i].pageY);
        ctx.lineTo(touches[i].pageX, touches[i].pageY);
        ongoingTouches.splice(i, 1);  // remove it; we're done
      }
    }

    function handleCancel(evt) {
      evt.preventDefault();
      var touches = evt.changedTouches;

      for (var i=0; i<touches.length; i++) {
        ongoingTouches.splice(i, 1);  // remove it; we're done
      }
    }

    function startup() {
      var el = document.getElementById("canvas");
      el.addEventListener("touchstart", handleStart, false);
      el.addEventListener("touchend", handleEnd, false);
      el.addEventListener("touchcancel", handleCancel, false);
      el.addEventListener("touchleave", handleEnd, false);
      el.addEventListener("touchmove", handleMove, false);
    }
  </script>
</body>
</html>


text:
import template from './wiki.html';
import controller from './wiki.controller';
import './wiki.less';

let WikiComponent = {
  restrict: 'E',
  bindings: {},
  template,
  controller
};

export default WikiComponent;


text:
namespace Splunk.Examples.Search
{
    using System;
    using System.Threading;
    using Splunk;
    using SplunkSDKHelper;

    /// <summary>
    /// An example program to perform a real-time search.
    /// It gets a number of snapshots, prints them, and then exits.
    /// </summary>
    public class Program
    {
        /// <summary>
        /// The main program
        /// </summary>
        /// <param name="argv">The command line arguments</param>
        public static void Main(string[] argv)
        {
            Command cli = Command.Splunk("search_realtime");
            cli.AddRule("search", typeof(string), "search string");
            cli.Parse(argv);
            if (!cli.Opts.ContainsKey("search"))
            {
                System.Console.WriteLine(
                    "Search query string required, use --search=\"query\"");
                Environment.Exit(1);
            }

            var service = Service.Connect(cli.Opts);

            // Realtime window is 5 minutes
            var queryArgs = new JobArgs
            {
                SearchMode = JobArgs.SearchModeEnum.Realtime,
                EarliestTime = "rt-5m",
                LatestTime = "rt",
            };

            var job = service.GetJobs().Create(
                (string)cli.Opts["search"],
                queryArgs);

            var outputArgs = new JobResultsPreviewArgs
            {
                OutputMode = JobResultsPreviewArgs.OutputModeEnum.Xml,

                // Return all entries.
                Count = 0
            };

            for (var i = 0; i < 5; i++)
            {
                System.Console.WriteLine();
                System.Console.WriteLine();
                System.Console.WriteLine("Snapshot " + i + ":");

                using (var stream = job.ResultsPreview(outputArgs))
                {
                    using(var rr = new ResultsReaderXml(stream))
                    {
                        foreach (var @event in rr)
                        {
                            System.Console.WriteLine("EVENT:");
                            foreach (string key in @event.Keys)
                            {
                                System.Console.WriteLine(
                                    "   " + key + " -> " + @event[key]);
                            }
                        }
                    }
                }

                Thread.Sleep(500);
            }

            job.Cancel();
        }
    }
}


text:
<?xml version="1.0"?>
<catalog>
    <book id="bk111">
        <author>O'Brien, Tim</author>
        <title>MSXML3: A Comprehensive Guide</title>
        <genre>Computer Science</genre>
        <price>36.95</price>
        <publish_date>2000-12-01</publish_date>
        <description>The Microsoft MSXML3 parser is covered in
            detail, with attention to XML DOM interfaces, XSLT processing,
            SAX and more.</description>
    </book>
    <book id="bk112">
        <author>Galos, Mike</author>
        <title>Visual Studio 7: A Comprehensive Guide</title>
        <genre>Computer Science</genre>
        <price>49.95</price>
        <publish_date>2001-04-16</publish_date>
        <description>Microsoft Visual Studio 7 is explored in depth,
            looking at how Visual Basic, Visual C++, C#, and ASP+ are
            integrated into a comprehensive development
            environment.</description>
    </book>
</catalog>


text:
module Api::Services
  class Signup
    attr_reader :email, :user, :status

    def initialize email: "me@example.com", password: "blank_password"
      @email = email
      @password = password
    end

    def call
      @user = User.new email: @email
      @user.encrypted_password = Digest::SHA1.hexdigest @password
      if @user.save
        @status = :ok
      end
    end
  end
end


text:
package ru.merge;

/**
 * Merge Sorter
 * @author Alexeev Kirill
 * @version $Id$
 * @since 0.1
 */

public class MergeSort {
    /**
     * Sort the subarray by the merge.
     * @param A common array specified for sorting.
     * @param p the first element of the sorted subarray.
     * @param r the last element of the sorted subarray.
     */
    public void sort(int[] A, int p, int r) {
        if (p < r) {
            int q = (p + r) / 2;
            sort(A, p, q);
            sort(A, q + 1, r);
            this.merge(A, p, q, r);
        }
    }

    /**
     * Sort two sorted subarrays by merge.
     * @param arr common array.
     * @param p the first element of the first subarray.
     * @param q the last element of the first subarray.
     * @param r the last element of the second subarray.
     */
    public void merge(int[] arr, int p, int q, int r) {
        int firstArrayPosition = p - 1;
        int firstArrayLastIndex = q - 1;
        int secondArrayPosition = q;
        int secondArrayLastIndex = r - 1;
        int workSize = secondArrayLastIndex - firstArrayPosition;
        int[] result = new int[workSize + 1];
        for (int i = 0; i <= workSize; i++) {
            result[i] =
                    (secondArrayPosition > secondArrayLastIndex)
                            || (firstArrayPosition <= firstArrayLastIndex
                            && arr[firstArrayPosition] < arr[secondArrayPosition])
                            ? arr[firstArrayPosition++] : arr[secondArrayPosition++];
        }
        System.arraycopy(result, 0, arr, p - 1, result.length);
    }
}


text:
package org.jkiss.dbeaver.ui.editors;

import org.eclipse.ui.IEditorPart;
import org.jkiss.dbeaver.model.DBPContextProvider;
import org.jkiss.dbeaver.model.DBPDataSourceTask;
import org.jkiss.dbeaver.ui.IRefreshablePart;

/**
 * IDatabaseEditor
 */
public interface IDatabaseEditor extends IEditorPart, DBPDataSourceTask, DBPContextProvider, IRefreshablePart
{

    @Override
    IDatabaseEditorInput getEditorInput();

    /**
     * Recreates editor UI.
     * Used by lazy editor initializer
     */
    void recreateEditorControl();

}


text:
/// <reference path="_definitions.d.ts" />

import utils = require("./utils");

/** Add a knockout template into the current page */
export function addTemplate(id: string, template: string, engine?: KnockoutTemplateEngine): void {
    if (engine && engine.addTemplate) {
        engine.addTemplate(id, template);
        return;
    }

    if ($("#" + id).length === 0) {
        utils.unsafe(function () {
            $("body").append("<script id='" + id + "' type='text/html'>" + template + "</script>"); // create the template
        });
    }
}

export function load(...widgets: string[]): JQueryPromise<any> {
    widgets = _.map(widgets, widget => "./ui/" + widget);
    return utils.load.apply(null, widgets);
}


text:
package com.opengamma.analytics.financial.provider.calculator.sabrswaption;

import com.opengamma.analytics.financial.interestrate.InstrumentDerivative;
import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorSameMethodAdapter;
import com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle;
import com.opengamma.analytics.financial.interestrate.annuity.derivative.Annuity;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CapFloorCMS;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CapFloorCMSSpread;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponCMS;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixed;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIbor;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborGearing;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborSpread;
import com.opengamma.analytics.financial.interestrate.payments.derivative.Payment;
import com.opengamma.analytics.financial.interestrate.payments.provider.CapFloorCMSSABRExtrapolationRightReplicationMethod;
import com.opengamma.analytics.financial.interestrate.payments.provider.CapFloorCMSSpreadSABRBinormalMethod;
import com.opengamma.analytics.financial.interestrate.payments.provider.CouponCMSSABRExtrapolationRightReplicationMethod;
import com.opengamma.analytics.financial.interestrate.swap.derivative.Swap;
import com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionCashFixedIbor;
import com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedIbor;
import com.opengamma.analytics.financial.interestrate.swaption.provider.SwaptionCashFixedIborSABRExtrapolationRightMethod;
import com.opengamma.analytics.financial.interestrate.swaption.provider.SwaptionPhysicalFixedIborSABRExtrapolationRightMethod;
import com.opengamma.analytics.financial.model.option.definition.SABRInterestRateCorrelationParameters;
import com.opengamma.analytics.financial.provider.description.interestrate.SABRSwaptionProviderInterface;
import com.opengamma.util.ArgumentChecker;

/**
 * Calculates the present value of an inflation instruments by discounting for a given MarketBundle.
 */
public final class PresentValueSABRSensitivitySABRSwaptionRightExtrapolationCalculator extends
    InstrumentDerivativeVisitorSameMethodAdapter<SABRSwaptionProviderInterface, PresentValueSABRSensitivityDataBundle> {

  /**
   * The cut-off strike. The smile is extrapolated above that level.
   */
  private final double _cutOffStrike;
  /**
   * The tail thickness parameter.
   */
  private final double _mu;

  /**
   * The methods.
   */
  private final CouponCMSSABRExtrapolationRightReplicationMethod _cmsCoupon;
  private final CapFloorCMSSABRExtrapolationRightReplicationMethod _capFloorCms;
  private final SwaptionCashFixedIborSABRExtrapolationRightMethod _cashSwaption;
  private final SwaptionPhysicalFixedIborSABRExtrapolationRightMethod _physicalSwaption;

  /**
   * Constructor.
   *
   * @param cutOffStrike
   *          The cut-off strike.
   * @param mu
   *          The tail thickness parameter.
   */
  public PresentValueSABRSensitivitySABRSwaptionRightExtrapolationCalculator(final double cutOffStrike, final double mu) {
    _mu = mu;
    _cutOffStrike = cutOffStrike;
    _cmsCoupon = new CouponCMSSABRExtrapolationRightReplicationMethod(_cutOffStrike, _mu);
    _capFloorCms = new CapFloorCMSSABRExtrapolationRightReplicationMethod(_cutOffStrike, _mu);
    _cashSwaption = new SwaptionCashFixedIborSABRExtrapolationRightMethod(_cutOffStrike, _mu);
    _physicalSwaption = new SwaptionPhysicalFixedIborSABRExtrapolationRightMethod(_cutOffStrike, _mu);
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visit(final InstrumentDerivative derivative, final SABRSwaptionProviderInterface data) {
    return derivative.accept(this, data);
  }

  // ----- Payment/Coupon ------

  @Override
  public PresentValueSABRSensitivityDataBundle visitCouponCMS(final CouponCMS payment, final SABRSwaptionProviderInterface data) {
    return _cmsCoupon.presentValueSABRSensitivity(payment, data);
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitCapFloorCMS(final CapFloorCMS payment, final SABRSwaptionProviderInterface data) {
    return _capFloorCms.presentValueSABRSensitivity(payment, data);
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitCapFloorCMSSpread(final CapFloorCMSSpread payment,
      final SABRSwaptionProviderInterface data) {
    if (data.getSABRParameter() instanceof SABRInterestRateCorrelationParameters) {
      // TODO: improve correlation data handling
      final SABRInterestRateCorrelationParameters sabrCorrelation = (SABRInterestRateCorrelationParameters) data.getSABRParameter();
      final CapFloorCMSSpreadSABRBinormalMethod method = new CapFloorCMSSpreadSABRBinormalMethod(sabrCorrelation.getCorrelation(),
          _capFloorCms,
          _cmsCoupon);
      return method.presentValueSABRSensitivity(payment, data);
    }
    throw new UnsupportedOperationException(
        "The PresentValueSABRSensitivitySABRSwaptionRightExtrapolationCalculator visitor visitCapFloorCMSSpread requires a "
            + "SABRInterestRateCorrelationParameters as data.");
  }

  // ----- Annuity ------

  @Override
  public PresentValueSABRSensitivityDataBundle visitGenericAnnuity(final Annuity<? extends Payment> annuity,
      final SABRSwaptionProviderInterface data) {
    ArgumentChecker.notNull(annuity, "Annuity");
    PresentValueSABRSensitivityDataBundle pvss = visit(annuity.getNthPayment(0), data);
    for (int i = 1; i < annuity.getNumberOfPayments(); i++) {
      pvss = pvss.plus(visit(annuity.getNthPayment(i), data));
    }
    return pvss;
  }

  // ----- Swaption ------

  @Override
  public PresentValueSABRSensitivityDataBundle visitSwaptionCashFixedIbor(final SwaptionCashFixedIbor swaption,
      final SABRSwaptionProviderInterface data) {
    return _cashSwaption.presentValueSABRSensitivity(swaption, data);
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitSwaptionPhysicalFixedIbor(final SwaptionPhysicalFixedIbor swaption,
      final SABRSwaptionProviderInterface data) {
    ArgumentChecker.notNull(data, "data");
    ArgumentChecker.notNull(swaption, "swaption");
    return _physicalSwaption.presentValueSABRSensitivity(swaption, data);
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitSwap(final Swap<?, ?> swap, final SABRSwaptionProviderInterface data) {
    ArgumentChecker.notNull(data, "data");
    ArgumentChecker.notNull(swap, "swap");
    PresentValueSABRSensitivityDataBundle pvss = new PresentValueSABRSensitivityDataBundle();
    for (final Payment p : swap.getFirstLeg().getPayments()) {
      pvss = pvss.plus(p.accept(this, data));
    }
    for (final Payment p : swap.getSecondLeg().getPayments()) {
      pvss = pvss.plus(p.accept(this, data));
    }
    return pvss;
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitCouponFixed(final CouponFixed coupon, final SABRSwaptionProviderInterface curves) {
    return new PresentValueSABRSensitivityDataBundle();
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitCouponIbor(final CouponIbor coupon, final SABRSwaptionProviderInterface curves) {
    return new PresentValueSABRSensitivityDataBundle();
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitCouponIborSpread(final CouponIborSpread coupon,
      final SABRSwaptionProviderInterface curves) {
    return new PresentValueSABRSensitivityDataBundle();
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visitCouponIborGearing(final CouponIborGearing coupon,
      final SABRSwaptionProviderInterface curves) {
    return new PresentValueSABRSensitivityDataBundle();
  }

  @Override
  public PresentValueSABRSensitivityDataBundle visit(final InstrumentDerivative derivative) {
    throw new UnsupportedOperationException("Cannot calculate SABR sensitivities without data");
  }

}


text:
<?php

namespace controllers\admin;

use \helpers\url,
    \core\view;

class Estilos extends \core\controller {

    private $componente;
    private $archivoNombre;
    private $model;
    private $archivo;

    public function __construct() {
        $this->componente = new \models\admin\componente();
        $this->model = new \models\admin\estilos();

        $this->clase = "estilos";
        $this->archivoNombre = "estilos.php";

        $this->archivo["raiz"]["componente_archivo"] = $this->archivoNombre;
        $this->archivo["raiz"]["componente_enlace"] = ADMIN . "estilos";
        $this->archivo["raiz"]["componente_url"] = DIR . ADMIN . "estilos";
        $this->archivo["raiz"]["componente_nombre"] = "Estilos de la Pagina";
        $this->archivo["raiz"]["componente_slug"] = url::generateSafeSlug($this->archivo["raiz"]["componente_nombre"]);

        $this->archivo["cambiar"]["componente_archivo"] = $this->archivoNombre;
        $this->archivo["cambiar"]["componente_enlace"] = ADMIN . "estilos_cambiar";
        $this->archivo["cambiar"]["componente_url"] = DIR . ADMIN . "estilos/cambiar";
        $this->archivo["cambiar"]["componente_nombre"] = "Modificar Estilos de la Pagina";
        $this->archivo["cambiar"]["componente_slug"] = url::generateSafeSlug($this->archivo["cambiar"]["componente_nombre"]);

        foreach ($this->archivo as $componente) {
            $this->componente->createComponente($componente["componente_nombre"], $componente["componente_enlace"], $componente["componente_url"], $componente);
        }
        $this->componente->controlAcceso();
    }

    public function index() {
        $data["title"] = $this->archivo["raiz"]["componente_nombre"];
        $data["color"] = $this->model->getPropiedad("background-color");
        $data["fondo"] = $this->model->getPropiedad("background-image");

        view::admintemplate("header", $data);
        view::render($this->archivo["raiz"]["componente_enlace"], $data);
        view::admintemplate("footer", $data);
    }

    public function cambiar() {
        $color = "#" . filter_input(INPUT_POST, "color");
        $datos = [
            "estilo_valor" => $color
        ];
        $where = [
            "estilo_nombre" => "background-color"
        ];
        echo $this->model->editar($datos, $where);
        $galeria_url = $this->componente->subir_imagen("fondo", "bg");
        if ($galeria_url["estado"] == "1") {
            echo $this->model->editar(["estilo_valor" => $galeria_url["url"]], ["estilo_nombre" => "background-image"]);
        }
    }

}


text:
//
//  Copyright 2010-2017 Deveel
//
//    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.
//

using System;

using Antlr4.Runtime.Tree;

using Deveel.Data.Sql.Expressions;

namespace Deveel.Data.Sql.Parsing {
	static class SqlParseExpression {
		public static SqlExpression Build(IContext context, IParseTree tree) {
			return new SqlExpressionVisitor(context).Visit(tree);
		}
	}
}


text:
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

        <link rel="stylesheet" href="../css/normalize.css">
        <link rel="stylesheet" href="../css/main.css">
        <link rel="stylesheet" href="../css/bootstrap.css">
        <link rel="stylesheet" href="../css/flat-ui.css">
        <link rel="stylesheet" href="../css/style.css">

        <script src="../js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>
        <div role="main" class="container">


text:
module RemoteMonitoring
  module PostProcessor
    class NeedsMaintenanceEmailSender
      def process(policy)
        return unless policy.send_needs_maintenance_email?

        RemoteMonitoring::JobQueue.enqueue(
          Email::ProjectNeedsMaintenanceJob,
          policy.survey_response.id
        )
      end
    end
  end
end


text:
package com.novartis.pcs.ontology.rest.json;

import java.net.URL;

import javax.naming.InitialContext;

import com.novartis.pcs.ontology.entity.Ontology;
import com.novartis.pcs.ontology.entity.Term;

public class TermDTO {
	private String ontology;
	private String termId;
	private String termName;
	private String termUrl;
	private String termStatus;

	private static final URL baseURL;

	static {
		InitialContext context = null;
		URL url = null;
		try {
			context = new InitialContext();
			url = (URL)context.lookup("java:global/ontobrowser/url");
		} catch(Throwable t) {
			url = null;
		} finally {
			if(context != null) {
				try {
					context.close();
				} catch(Throwable t) {

				}
			}
		}
		baseURL = url;
	}

	public TermDTO(Term term) {
		Ontology ontology = term.getOntology();

		this.ontology = ontology.getName();
		this.termId = term.getReferenceId();
		this.termName = term.getName();
		this.termUrl = baseURL != null ?
				baseURL.toString() + "index.html#" + term.getReferenceId() : null;
		this.termStatus = term.getStatus().toString();
	}

	public String getOntology() {
		return ontology;
	}

	public String getTermId() {
		return termId;
	}

	public String getTermName() {
		return termName;
	}

	public String getTermUrl() {
		return termUrl;
	}

	public String getTermStatus() {
		return termStatus;
	}
}


text:
<?php
namespace Omnestek\Phpeav\Services;
use Omnestek\Phpeav\Dto\EntityDto;
use Omnestek\Phpeav\Interfaces\OnticData\AttributeValueInterface;
use Omnestek\Phpeav\Interfaces\OnticData\EntityInterface;

/**
 * Created by PhpStorm.
 * User: oalvarado
 * Date: 12/02/17
 * Time: 21:18
 */
class OnticService
{
    /**
     * @var EntityInterface
     */
    protected $entityRepository;

    public function __construct(EntityInterface $entityRepository)
    {
        $this->entityRepository = $entityRepository;
    }

    /**
     * @param EntityDto $entityDto
     */
    public function save(EntityDto $entityDto)
    {
        $this->entityRepository->saveEntity($entityDto);
    }

    /**
     * @param EntityDto $entityDto
     */
    public function validate(EntityDto $entityDto)
    {

    }

    public function get($entityTypeId, $entityId)
    {
        return $this->entityRepository->getEntity($entityTypeId, $entityId);
    }
}


text:
export const pluginHeader: string;
export const pluginIcon: string;
export const pluginName: string;
export const unknownPluginIcon: string;
export const pluginsPage: string;
export const keyValuePairInline: string;
export const pluginsList: string;
export const spinnerWrapper: string;


text:
(function() {
  'use strict';

  var io = global.io,
      app = global.io.express(),

      POSTFACEBOOKLOGIN  = require('../adminApImplementation/login/postIndex.js'),
      POSTGOOGLELOGIN    = require('../adminApImplementation/login/postIndex.js'),
      POSTUSERLOGIN      = require('../adminApImplementation/login/postIndex.js');

  app.route('/logInUserFacebook')
    .post(POSTFACEBOOKLOGIN.postFacebookLogin);

  app.route('/logInUserGoogle')
    .post(POSTGOOGLELOGIN.postGoogleLogin);

  app.route('/userLogin')
    .post(POSTUSERLOGIN.postUserLogin);

  module.exports = app;
}());


text:
layout:     post
title:      Generative Adversarial Networks Tutorials
subtitle:   GAN
date:       2017-09-29
author:     Tab
header-img: img/post-bg-hacker.jpg
catalog: true
tags:
    - computer vision
    - deep learning
    - GAN
---

# Outline
**Generative Model**
>- **Density estimation**
- **Sample generation**

---
# Motivation
>- **High-dimensional** probability distribution
- incorporated into **reinforcement learning**
- predict missing data **(semi-supervised learning)**
- **multi-model output**
- **realistic generation of samples**

![multi-model output](https://i.imgur.com/n1M2eUd.png)

**Figure 1:** In this example, a model is trained to predict the next frame in a video sequence. Here the 'multi-model' means that the possible result is not a single answer. You can see the second image uses MSE to form an answer with an average over many slightly different images. However, with an additional GAN loss, the third image can understand that there are many possible outputs and each of them is sharp, recognizable and realistic.

---
# Related Work
>- **FVBN:** In parallel or not?
- **ICA:** Generator functions has few restrictions?
- **Boltzmann machine:** Markov chains needed?
- **VAE:** Variational bound needed?
- Quality of samples?

![Taxonomy of Generative Models](https://i.imgur.com/5r0WeiB.png)

**Figure 2:** An illustration about alternative methods of generative models

---
**FVBN**
![FVBN](https://i.imgur.com/1dRxmmS.png)
**Figure 3:** Fully Visible Belief Nets with great generation cost

---
**ICA**

![ICA](https://i.imgur.com/DriRz5C.png)
**Figure 4:** ICA puts too much restrictions to generator functions

---
**VAE**

![VAE](https://i.imgur.com/rIvXNR1.png)
**Figure 5:** VAE is not asymptotically consistent unless q is perfect

---
# Algorithm

## The GAN framework
![GAN framework](https://i.imgur.com/i6A5MaU.png)
**Figure 6:** Generater vs. discriminator

---
## Cost function

### The discriminator's cost
$J^{(D)}((\theta)^{(D)},(\theta)^{(G)})=-\cfrac{1}{2}E_{x\sim p_{data}}logD(x)-\cfrac{1}{2}E_{z}logD(G(z))$

### The generator's cost
>- **Minimax (JS divergence)**
- **Maximum likelihood game (KL divergence)**
- **Heuristic, non-saturating game**

**Minimax (JS divergence)**
![Minimax](https://i.imgur.com/cBIOPpo.png)
**Figure 7:** Generator's minimax cost: $J^{(G)}=-J^{(D)}$

**Maximum likelihood game (KL Divergence)**

$J^{(G)}=-\cfrac{1}{2}E_ze^{\sigma^{-1}(D(G(z)))}$

**Heuristic, non-saturating game**

$J^{(G)}=-\cfrac{1}{2}E_zlogD(G(z))$

### A significant problem

**Non-convergence**

This problem usually happen when the ability of discriminator is great. (So the gradient of V is always vanishing) It is obvious that when D(G(z)) is near zero, the gradient is also near zero.
![convergence problem](https://i.imgur.com/26HACno.png)
**Figure 8:** Convergence performance of different methods
![convexity of different methods](https://i.imgur.com/KkEHJRW.png)
**Figure 9:** Convexity of different methods

**Mode collapse**
![mode collapse 1](https://i.imgur.com/5nAo9Xz.png)
**Figure 10:** Example of mode collapse, which can be avoided by unrolled GAN
![mode collapse 2](https://i.imgur.com/ehIgrTh.png)
**Figure 11:** Different results with different orders of p and q in KL divergence

---
# Experiment
**Evaluation of generative models**
![evaluation of generative models](https://i.imgur.com/mKuZyzj.png)
**Figure 12:** Evaluation of generative models. The two figures correspond with MLP and DCGAN, which shows that the cost is not pretty accurate according to the quality of pictures.

**Dicrete outputs**
>**Frontier**
- Semi-supervised learning
- Using this code

---
# Discussion
## Tips and Tricks
---
### Train with labels
- Generating condition on labels: P(y\|x)
- Training with labels: P(x, y)

---
### One-sided label smoothing
**(to reduce vulnerability to adversarial examples)**
- Default discriminator cost
```
cross_entropy(1., discriminator(data))+cross_entropy(0.,discriminator(samples))
```
- One-sided label smooth cost
```
cross_entropy(.9, discriminator(data))+cross_entropy(0.,discriminator(samples))
```
- Do not smooth negative labels

$D^*(x)=\cfrac{(1-\alpha)p_{data}(x)+\beta p_{model}(x)}{p_{data}(x)+p_{model}(x)}$

According to the discriminator's loss, the best discriminator should implement the function $D^*(x)$. So if we only decrease the coefficient of $p_{data}$, it'll just have the confidence of D decline. However, if we get a positive $\beta$, it is likely that there exists a peak (local optimum value)  which leads to a trend of generating wrong samples.

---

### Virtual Batch Normalization

![Virtual Batch Normalization](https://i.imgur.com/YEZJoPQ.jpg)
**Figure13:** correlation of samples in a batch caused by batch normalization

>- Batch Norm
(cause correlation of pictures in the single batch)
- Reference Norm
(Fix a reference batch R for normalization)
- Virtual Batch Norm
(avoid overfit in Reference Norm)

![steps of VBN](https://i.imgur.com/kiTzaWH.png)
**Figure14:** Steps of Virtual Batch Normalization

## Balance G and D?
>- D always performs better(in accordance with theory)
- The network of D is bigger and deeper
- Do not limit D when it is too accurate

# Reference
1. [Ian Goodfellow(2016). GAN Tutorial. In NIPS 2016](https://arxiv.org/pdf/1701.00160.pdf)
2. [Slide for the tutorial.](http://www.iangoodfellow.com/slides/2016-12-04-NIPS.pdf)


text:
package es.um.nosql.s13e.entitydifferentiation.m2t.config;

import es.um.nosql.s13e.entitydifferentiation.EntityDifferentiation.EntityDifferentiation;

public abstract class BaseConfig
{
  // For the moment we will return a boolean. Just in case we need it later on.
  public abstract boolean doCheck(EntityDifferentiation diff);
}


text:
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base

engine = create_engine('sqlite:///selfcult.sqlite')

db_session = scoped_session(sessionmaker(bind=engine))

Base = declarative_base()
Base.query = db_session.query_property()

class User(Base):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True)
    name = Column(String(50), unique=True)
    password = Column(String(50))
    email = Column(String(120), unique=True)
    cur_goal_id = Column(Integer, ForeignKey('goal.id'))

    def __init__(self, name=None, password=None, email=None):
        self.name = name
        self.password = password
        self.email = email

class Goal(Base):
    __tablename__ = 'goal'
    id = Column(Integer, primary_key=True)
    goal_name = Column(String)

class Task(Base):
    __tablename__ = 'task'
    id = Column(Integer, primary_key=True)
    cur_goal_id = Column(Integer, ForeignKey('goal.id'))
    task = Column(String)

class TaskHistory(Base):
    __tablename__ = 'task_history'
    id = Column(Integer, primary_key=True)
    task_state = Column(String(50))
    user_id = Column(Integer, ForeignKey('users.id'))
    cur_goal_id = Column(Integer, ForeignKey('goal.id'))
    created = Column(DateTime)
    updated = Column(DateTime)

    def __init__(self, task_state=None, user_id=None, cur_goal_id=None):
        self.task_state = task_state
        self.user_id = user_id
        self.cur_goal_id = cur_goal_id

if __name__ == '__main__':
    Base.metadata.create_all(bind=engine)


text:
#region Apache License Version 2.0

#endregion Apache License Version 2.0

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SF.Sys.CallPlans
{
	public interface ICallInstance
	{
		string Type { get; }
		string Ident { get; }
		string Argument { get; }
		string Error { get; }
		DateTime Expire { get; }
		DateTime CallTime { get; }
		int DelaySecondsOnError { get; }
		long? ServiceScopeId { get; }
	}

	public interface ICallPlanStorageAction
	{

	}
	public interface ICallPlanStorage
	{
		/// <summary>
		///
		/// </summary>
		/// <param name="Type"></param>
		/// <param name="Ident"></param>
		/// <param name="Argument"></param>
		/// <param name="Error"></param>
		/// <param name="Title"></param>
		/// <param name="Now"></param>
		/// <param name="CallTime"></param>
		/// <param name="ExpireTime"></param>
		/// <param name="DelaySecondsOnError"></param>
		/// <param name="ServiceScopeId"></param>
		/// <returns>调用已存在时返回false,否则为true</returns>
		Task<bool> Create(
			string Type,
			string Ident,
			string Argument,
			string Error,
			string Title,
			DateTime Now,
			DateTime CallTime,
			DateTime ExpireTime,
			int DelaySecondsOnError,
			long? ServiceScopeId
			);
        Task Remove(string Type,string Ident);

        Task<(string Type,string Ident)[]> GetOnTimeInstances(
			int Count,
			DateTime now,
			DateTime ExecutingStartTime,
			DateTime InitTime
			);

		Task<ICallInstance> GetInstance(string Type,string Ident);
		Task<ICallInstance[]> GetInstancesForCleanup(DateTime ExecutingStartTime);
		ICallPlanStorageAction CreateExpiredAction(
			ICallInstance Instance,
			DateTime Now,
			string Error
			);
		ICallPlanStorageAction CreateRetryAction(
			ICallInstance Instance,
			DateTime NewCallTime,
			bool Expired,
			string Error,
			string newCallArgument
			);
		ICallPlanStorageAction CreateSuccessAction(ICallInstance Instance);
		Task ExecuteActions(IEnumerable<ICallPlanStorageAction> Actions);
	}
}


text:
var gulp = require('gulp')
  , nodemon = require('gulp-nodemon')
  , jshint = require('gulp-jshint')
  , mocha = require('gulp-mocha')
  , gutil = require('gulp-util')
  , uglify = require('gulp-uglify')
  , coffee = require('gulp-coffee')
  , concat = require('gulp-concat');

var libs = [
    'lib/jquery/jquery.min.js'
  , 'lib/angular/angular.min.js'
  , 'lib/angular/angular-qrcode.js'
  , 'lib/angular/angular-resource.min.js'
  , 'lib/zeroclipboard/ZeroClipboard.min.js'
  , 'lib/angular/ng-clip.min.js'
  , 'lib/bootstrap/js/bootstrap.js'
  , 'lib/qrcode-generator/qrcode.js'
]

var paths = {
  scripts: ['./app.js', './models/*.js', 'public/javascripts/main.js', 'public/javascripts/profile.js', 'routes/*.js', 'config/*.js'],
  libs: libs,
  tests: ['./test/*.js']
}

gulp.task('coffee', function() {
  gulp.src('./public/javascripts/*.coffee')
    .pipe(coffee({bare: true}).on('error', gutil.log))
    .pipe(uglify())
    .pipe(gulp.dest('./public/javascripts'))
});
gulp.task('merge_libs', function() {
  gulp.src(paths.libs)
    .pipe(uglify())
    .pipe(concat('all_libraries.min.js'))
    .pipe(gulp.dest('./public/javascripts'))
});

gulp.task('lint', function() {
  gulp.src(paths.scripts)
    .pipe(jshint({laxcomma: true, asi: true}))
    .pipe(jshint.reporter('default'))
    // .pipe(jshint.reporter('fail')); // Uncomment to raise error on warning
});

gulp.task('develop', function () {
  nodemon({ script: 'app.js', ext: 'html coffee js', ignore: ['test/*', 'Gulpfile.js', 'public/*', 'node_modules/*'] })
    .on('change', ['lint', 'coffee'])
    .on('restart', function () {
      console.log('restarted!')
    })
})

gulp.task('default', ['lint', 'coffee', 'merge_libs', 'develop']);


text:
package com.google.gson.functional;

import static org.junit.Assert.assertArrayEquals;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.common.TestTypes.BagOfPrimitives;
import com.google.gson.common.TestTypes.ClassWithObjects;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import junit.framework.TestCase;
/**
 * Functional tests for Json serialization and deserialization of arrays.
 *
 * @author Inderjeet Singh
 * @author Joel Leitch
 */
public class ArrayTest extends TestCase {
  private Gson gson;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    gson = new Gson();
  }

  public void testTopLevelArrayOfIntsSerialization() {
    int[] target = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    assertEquals("[1,2,3,4,5,6,7,8,9]", gson.toJson(target));
  }

  public void testTopLevelArrayOfIntsDeserialization() {
    int[] expected = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    int[] actual = gson.fromJson("[1,2,3,4,5,6,7,8,9]", int[].class);
    assertArrayEquals(expected, actual);
  }

  public void testInvalidArrayDeserialization() {
    String json = "[1, 2 3, 4, 5]";
    try {
      gson.fromJson(json, int[].class);
      fail("Gson should not deserialize array elements with missing ,");
    } catch (JsonParseException expected) {
    }
  }

  public void testEmptyArraySerialization() {
    int[] target = {};
    assertEquals("[]", gson.toJson(target));
  }

  public void testEmptyArrayDeserialization() {
    int[] actualObject = gson.fromJson("[]", int[].class);
    assertTrue(actualObject.length == 0);

    Integer[] actualObject2 = gson.fromJson("[]", Integer[].class);
    assertTrue(actualObject2.length == 0);

    actualObject = gson.fromJson("[ ]", int[].class);
    assertTrue(actualObject.length == 0);
  }

  public void testNullsInArraySerialization() {
    String[] array = {"foo", null, "bar"};
    String expected = "[\"foo\",null,\"bar\"]";
    String json = gson.toJson(array);
    assertEquals(expected, json);
  }

  public void testNullsInArrayDeserialization() {
    String json = "[\"foo\",null,\"bar\"]";
    String[] expected = {"foo", null, "bar"};
    String[] target = gson.fromJson(json, expected.getClass());
    for (int i = 0; i < expected.length; ++i) {
      assertEquals(expected[i], target[i]);
    }
  }

  public void testSingleNullInArraySerialization() {
    BagOfPrimitives[] array = new BagOfPrimitives[1];
    array[0] = null;
    String json = gson.toJson(array);
    assertEquals("[null]", json);
  }

  public void testSingleNullInArrayDeserialization() {
    BagOfPrimitives[] array = gson.fromJson("[null]", BagOfPrimitives[].class);
    assertNull(array[0]);
  }

  public void testNullsInArrayWithSerializeNullPropertySetSerialization() {
    gson = new GsonBuilder().serializeNulls().create();
    String[] array = {"foo", null, "bar"};
    String expected = "[\"foo\",null,\"bar\"]";
    String json = gson.toJson(array);
    assertEquals(expected, json);
  }

  public void testArrayOfStringsSerialization() {
    String[] target = {"Hello", "World"};
    assertEquals("[\"Hello\",\"World\"]", gson.toJson(target));
  }

  public void testArrayOfStringsDeserialization() {
    String json = "[\"Hello\",\"World\"]";
    String[] target = gson.fromJson(json, String[].class);
    assertEquals("Hello", target[0]);
    assertEquals("World", target[1]);
  }

  public void testSingleStringArraySerialization() throws Exception {
    String[] s = { "hello" };
    String output = gson.toJson(s);
    assertEquals("[\"hello\"]", output);
  }

  public void testSingleStringArrayDeserialization() throws Exception {
    String json = "[\"hello\"]";
    String[] arrayType = gson.fromJson(json, String[].class);
    assertEquals(1, arrayType.length);
    assertEquals("hello", arrayType[0]);
  }

  public void testArrayOfCollectionSerialization() throws Exception {
    StringBuilder sb = new StringBuilder("[");
    int arraySize = 3;

    Type typeToSerialize = new TypeToken<Collection<Integer>[]>() {}.getType();
    @SuppressWarnings({"rawtypes", "unchecked"})
    Collection<Integer>[] arrayOfCollection = new ArrayList[arraySize];
    for (int i = 0; i < arraySize; ++i) {
      int startValue = (3 * i) + 1;
      sb.append('[').append(startValue).append(',').append(startValue + 1).append(']');
      ArrayList<Integer> tmpList = new ArrayList<>();
      tmpList.add(startValue);
      tmpList.add(startValue + 1);
      arrayOfCollection[i] = tmpList;

      if (i < arraySize - 1) {
        sb.append(',');
      }
    }
    sb.append(']');

    String json = gson.toJson(arrayOfCollection, typeToSerialize);
    assertEquals(sb.toString(), json);
  }

  public void testArrayOfCollectionDeserialization() throws Exception {
    String json = "[[1,2],[3,4]]";
    Type type = new TypeToken<Collection<Integer>[]>() {}.getType();
    Collection<Integer>[] target = gson.fromJson(json, type);

    assertEquals(2, target.length);
    assertArrayEquals(new Integer[] {1, 2}, target[0].toArray(new Integer[0]));
    assertArrayEquals(new Integer[] {3, 4}, target[1].toArray(new Integer[0]));
  }

  public void testArrayOfPrimitivesAsObjectsSerialization() throws Exception {
    Object[] objs = new Object[] {1, "abc", 0.3f, 5L};
    String json = gson.toJson(objs);
    assertTrue(json.contains("abc"));
    assertTrue(json.contains("0.3"));
    assertTrue(json.contains("5"));
  }

  public void testArrayOfPrimitivesAsObjectsDeserialization() throws Exception {
    String json = "[1,'abc',0.3,1.1,5]";
    Object[] objs = gson.fromJson(json, Object[].class);
    assertEquals(1, ((Number)objs[0]).intValue());
    assertEquals("abc", objs[1]);
    assertEquals(0.3, ((Number)objs[2]).doubleValue());
    assertEquals(new BigDecimal("1.1"), new BigDecimal(objs[3].toString()));
    assertEquals(5, ((Number)objs[4]).shortValue());
  }

  public void testObjectArrayWithNonPrimitivesSerialization() throws Exception {
    ClassWithObjects classWithObjects = new ClassWithObjects();
    BagOfPrimitives bagOfPrimitives = new BagOfPrimitives();
    String classWithObjectsJson = gson.toJson(classWithObjects);
    String bagOfPrimitivesJson = gson.toJson(bagOfPrimitives);

    Object[] objects = {classWithObjects, bagOfPrimitives};
    String json = gson.toJson(objects);

    assertTrue(json.contains(classWithObjectsJson));
    assertTrue(json.contains(bagOfPrimitivesJson));
  }

  public void testArrayOfNullSerialization() {
    Object[] array = {null};
    String json = gson.toJson(array);
    assertEquals("[null]", json);
  }

  public void testArrayOfNullDeserialization() {
    String[] values = gson.fromJson("[null]", String[].class);
    assertNull(values[0]);
  }

  /**
   * Regression tests for Issue 272
   */
  public void testMultidimensionalArraysSerialization() {
    String[][] items = {
        {"3m Co", "71.72", "0.02", "0.03", "4/2 12:00am", "Manufacturing"},
        {"Alcoa Inc", "29.01", "0.42", "1.47", "4/1 12:00am", "Manufacturing"}
    };
    String json = gson.toJson(items);
    assertTrue(json.contains("[[\"3m Co"));
    assertTrue(json.contains("Manufacturing\"]]"));
  }

  public void testMultidimensionalObjectArraysSerialization() {
    Object[][] array = {new Object[] { 1, 2 }};
    assertEquals("[[1,2]]", gson.toJson(array));
  }

  public void testMultidimensionalPrimitiveArraysSerialization() {
    int[][] array = {{1, 2}, {3, 4}};
    assertEquals("[[1,2],[3,4]]", gson.toJson(array));
  }

  /**
   * Regression test for Issue 205
   */
  public void testMixingTypesInObjectArraySerialization() {
    Object[] array = {1, 2, new Object[] {"one", "two", 3}};
    assertEquals("[1,2,[\"one\",\"two\",3]]", gson.toJson(array));
  }

  /**
   * Regression tests for Issue 272
   */
  public void testMultidimensionalArraysDeserialization() {
    String json = "[['3m Co','71.72','0.02','0.03','4/2 12:00am','Manufacturing'],"
      + "['Alcoa Inc','29.01','0.42','1.47','4/1 12:00am','Manufacturing']]";
    String[][] items = gson.fromJson(json, String[][].class);
    assertEquals("3m Co", items[0][0]);
    assertEquals("Manufacturing", items[1][5]);
  }

  public void testMultidimensionalPrimitiveArraysDeserialization() {
    String json = "[[1,2],[3,4]]";
    int[][] expected = {{1, 2}, {3, 4}};
    assertArrayEquals(expected, gson.fromJson(json, int[][].class));
  }

  /** http://code.google.com/p/google-gson/issues/detail?id=342 */
  public void testArrayElementsAreArrays() {
    Object[] stringArrays = {
        new String[] {"test1", "test2"},
        new String[] {"test3", "test4"}
    };
    assertEquals("[[\"test1\",\"test2\"],[\"test3\",\"test4\"]]",
        new Gson().toJson(stringArrays));
  }
}


text:
package com.gs.fw.common.mithra.generator.type;

import com.gs.fw.common.mithra.generator.BeanState;
import com.gs.fw.common.mithra.generator.MithraObjectTypeWrapper;
import com.gs.fw.common.mithra.generator.computedattribute.type.Type;
import com.gs.fw.common.mithra.generator.queryparser.ASTLiteral;
import com.gs.fw.common.mithra.generator.util.StringUtility;
import com.gs.fw.common.mithra.generator.databasetype.CommonDatabaseType;

public abstract class JavaType
{

    public abstract String getTypeName();

    public abstract String getJavaTypeString();

    public abstract String getJavaTypeStringPrimary();

    public String getResultSetName()
    {
        return this.getJavaTypeString();
    }

    public String getIoType()
    {
        return StringUtility.firstLetterToUpper(this.getJavaTypeString());
    }

    public String getIoCast()
    {
        return "";
    }

    public String getPrintableForm(String getter, String nullGetter, boolean isNullable)
    {
        if (isNullable)
        {
            return "("+nullGetter+" ? \"null\" : "+this.getPrintableForm(getter)+")";
        }
        return this.getPrintableForm(getter);
    }

    protected String getPrintableForm(String getter)
    {
        return "(\"\"+"+ getter +")";
    }

    public abstract String convertToObject(String name);

    public abstract String convertToPrimitive(String name);

    public abstract boolean isPrimitive();

    public boolean isNumber()
    {
        return false;
    }

    public boolean isBigDecimal()
    {
        return false;
    }

    public boolean isIntOrLong()
    {
        return false;
    }

    public abstract int getSqlType();

    public abstract String getSqlTypeAsString();

    public abstract String getSqlDataType();

    public abstract String getSqlDataType(CommonDatabaseType databaseType, boolean nullable);

    public abstract String getDefaultInitialValue();

    public abstract boolean isComparableTo(ASTLiteral node);

    public abstract boolean isComparableTo(JavaType other);

    public String getExtractionMethodName()
    {
        return StringUtility.firstLetterToLower(this.getJavaTypeString())+"ValueOf";
    }

    public static JavaType create(String javaTypeName) throws JavaTypeException
    {
        if (javaTypeName.equalsIgnoreCase("INT")) return new IntJavaType();
        if (javaTypeName.equalsIgnoreCase("STRING")) return new StringJavaType();
        if (javaTypeName.equalsIgnoreCase("DOUBLE")) return new DoubleJavaType();
        if (javaTypeName.equalsIgnoreCase("FLOAT")) return new FloatJavaType();
        if (javaTypeName.equalsIgnoreCase("BOOLEAN")) return new BooleanJavaType();
        if (javaTypeName.equalsIgnoreCase("DATE")) return new DateJavaType();
        if (javaTypeName.equalsIgnoreCase("TIME")) return new TimeJavaType();
        if (javaTypeName.equalsIgnoreCase("TIMESTAMP")) return new TimestampJavaType();
        if (javaTypeName.equalsIgnoreCase("CHAR")) return new CharJavaType();
        if (javaTypeName.equalsIgnoreCase("LONG")) return new LongJavaType();
        if (javaTypeName.equalsIgnoreCase("BYTE")) return new ByteJavaType();
        if (javaTypeName.equalsIgnoreCase("SHORT")) return new ShortJavaType();
        if (javaTypeName.equalsIgnoreCase("BYTE[]")) return new ByteArrayJavaType();
        if (javaTypeName.equalsIgnoreCase("BIGDECIMAL")) return new BigDecimalJavaType();

        // nothing found so we have a bad type
        throw new JavaTypeException("Invalid JavaType " + javaTypeName);
    }

    public String getFinderAttributeType()
    {
        return this.getJavaTypeStringPrimary()+"Attribute";
    }

    public boolean equals(Object obj)
    {
        if ((obj != null) && (obj instanceof JavaType))
        {
            return getTypeName().equals(((JavaType) obj).getTypeName());
        }
        return false;
    }

    public int hashCode()
    {
        return getTypeName().hashCode();
    }

    public String createEquals(String value1, String value2)
    {
        if (isPrimitive())
        {
            return value1 + " == " + value2;
        }
        else
        {
            return value1 + ".equals(" + value2 + ")";
        }
    }

    public String getValueIfNull(String valueIfNull)
    {
        return valueIfNull;
    }

    public String getGetterPrefix()
    {
        return "get";
    }

    public abstract String getJavaTypeClass();

    public String getValueSetterMethodName()
    {
        return "set"+StringUtility.firstLetterToUpper(this.getJavaTypeString())+"Value";
    }

	public String getArgumentForInOperation(String values, MithraObjectTypeWrapper fromObject)
	{
		throw new RuntimeException("in operation not supported for " + this.getJavaTypeString());
	}

    public String getSetCollectionClass()
    {
        if (this.isPrimitive())
        {
            return StringUtility.firstLetterToUpper(this.getJavaTypeString())+"OpenHashSet";
        }
        else
        {
            return "HashSet";
        }
    }

	public String getConnectionManagerClassName()
	{
		throw new RuntimeException("operation not suppported for " + this.getJavaTypeString());
	}

    public String convertSqlParameter(String param)
    {
        return param; // char will override
    }

    public String getFinderAttributeSuperClassType()
    {
        return "SingleColumn"+this.getJavaTypeStringPrimary()+"Attribute";
    }

    public String getObjectComparisonString(String obj1, String obj2)
    {
        throw new RuntimeException("operation not suppported for " + this.getJavaTypeString());
    }

    public String getPrimitiveComparisonString(String p1, String p2)
    {
        throw new RuntimeException("operation not suppported for " + this.getJavaTypeString());
    }

    public boolean isTimestamp()
    {
        return false;
    }

    public boolean canBePooled()
    {
        return false;
    }

    public boolean mayBeIdentity()
    {
        return false;
    }

    public boolean isArray()
    {
        return false;
    }

    public String parseLiteralAndCast(String value)
    {
        return value;
    }

    public String getBeanGetter(int intCount, int longCount, int objectCount)
    {
        return "getO"+objectCount+"As"+ StringUtility.firstLetterToUpper(this.getJavaTypeStringPrimary());
    }

    public boolean isBeanIntType()
    {
        return false;
    }

    public boolean isBeanLongType()
    {
        return false;
    }

    public boolean isBeanObjectType()
    {
        return true;
    }

    public String getBeanSetter(BeanState beanState)
    {
        return "setO"+beanState.getObjectCount();
    }

    public abstract int getOffHeapSize();

    public boolean isBoolean()
    {
        return false;
    }

    public Type asComputedAttributeType()
    {
        throw new RuntimeException("not implemented");
    }

    public boolean isTime()
    {
        return false;
    }

    public String getSqlTypeAsStringForNull()
    {
        return getSqlTypeAsString();
    }
}


text:
<?php
session_start();

require_once '../config.php';

$membersTb = new Members();

// To protect MySQL injection, $_POST params must be sanitized
$myusername = stripslashes($_POST['myusername']);
$mypassword = stripslashes($_POST['mypassword']);

if (/*$row['blocked']*/$membersTb->isUserBlocked($myusername)) {
    echo "THE USER IS BLOCKED. YOU CAN'T START SESSION. CONTACT THE ADMINISTRATOR.";
}
 else {
    if (isset($_SESSION['attempts']))
    {
        if ($_SESSION['attempts'] == _MAX_SESSION_ATTEMPTS)
        {
            // Block the User
           // $res = dbQuery("UPDATE members SET blocked='1' WHERE username='$myusername'");
            echo "THE USER HAS BEEN BLOCKED. CONTACT THE ADMINISTRATOR.";
            die;
        }
        else
            //Increment number of attempts.
            $_SESSION['attempts'] = $_SESSION['attempts'] + 1;
    }
    else  //Set number of attempts to 1
        $_SESSION['attempts'] = 1;
}

//Get the pswd
$encriptada = /*$row['password']*/$membersTb->getPswd($myusername);
// If the pswd is correct > go on
if ( crypt($mypassword, $encriptada) == $encriptada ) {
    // http://stackoverflow.com/questions/1340001/deny-direct-access-to-all-php-files-except-index-php
    $LOGIN_IS_CORRECT=1;

    //Set Session Username.
    $_SESSION['myusername'] = $myusername;

    //Creo una cookie amb el nom d'usuari. Aquesta cookie s'enviarà al browser amb la primera pàgina de contingut. Després, cada vegada que l'usuari
    //demani la  pagina main.php durà la cookie establerta.
    $value = 'OK';
    setcookie("usuari", $value, time()+3600);  /* expire in 1 hour */

    /* El codi és incomplet, he de controlar que aquest usuari té una sessió oberta.. no se com fer-ho mirar més codi...!! */
    //include 'main.php';
    header("location:../index.php?pg=mant&tb=issues&state=1");

}
else {
    $LOGIN_IS_CORRECT=0;
    //Back to Login
    header("location:../index.php");
}
?>


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

		<item value="256" key="DIALOG_X_ORIGIN"/>
		<item value="28" key="DIALOG_Y_ORIGIN"/>

		<item value="563" key="dialogHeight"/>
		<item value="900" key="dialogWidth"/>
		<list key="textEntries">
		</list>
		<list key="orderedElements">
		</list>
		<list key="orderedProviders">
		</list>
		<list key="textArray">
		</list>

		<item value="org.eclipse.wb.swing.JFrame" key="NewWizardSelectionPage.STORE_SELECTED_ID"/>
		<list key="NewWizardSelectionPage.STORE_EXPANDED_CATEGORIES_ID">
			<item value="org.eclipse.jdt.ui.java"/>
			<item value="org.eclipse.wb"/>
			<item value="org.eclipse.wb/org.eclipse.wb.swing"/>
		</list>

		<item value="org.eclipse.ui.wizards.import.ExternalProject" key="ImportExportPage.STORE_SELECTED_IMPORT_WIZARD_ID"/>
		<list key="ImportExportPage.STORE_EXPANDED_IMPORT_CATEGORIES">
			<item value="org.eclipse.ui.Basic"/>
		</list>


text:
package com.thoughtworks.xstream.mapper;

import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.SingleValueConverter;

public interface Mapper {
    /**
     * Place holder type used for null values.
     */
    class Null {}

    /**
     * How a class name should be represented in its serialized form.
     */
    String serializedClass(Class<?> type);

    /**
     * How a serialized class representation should be mapped back to a real class.
     */
    Class<?> realClass(String elementName);

    /**
     * How a class member should be represented in its serialized form.
     */
    String serializedMember(Class<?> type, String memberName);

    /**
     * How a serialized member representation should be mapped back to a real member.
     */
    String realMember(Class<?> type, String serialized);

    /**
     * Whether this type is a simple immutable value (int, boolean, String, URL, etc). Immutable types will be
     * repeatedly written in the serialized stream, instead of using object references.
     */
    boolean isImmutableValueType(Class<?> type);

    /**
     * Whether this type is referenceable in a stream.
     *
     * @since upcoming
     */
    boolean isReferenceable(Class<?> type);

    Class<?> defaultImplementationOf(Class<?> type);

    /**
     * Get the alias for an attribute's name.
     *
     * @param attribute the attribute
     * @return the alias
     * @since 1.2
     */
    String aliasForAttribute(String attribute);

    /**
     * Get the attribute's name for an alias.
     *
     * @param alias the alias
     * @return the attribute's name
     * @since 1.2
     */
    String attributeForAlias(String alias);

    /**
     * Get the alias for a system attribute's name.
     *
     * @param attribute the system attribute
     * @return the alias
     * @since 1.3.1
     */
    String aliasForSystemAttribute(String attribute);

    /**
     * Get the name of the field that acts as the default collection for an object, or return null if there is none.
     *
     * @param definedIn owning type
     * @param itemType item type
     * @param itemFieldName optional item element name
     */
    String getFieldNameForItemTypeAndName(Class<?> definedIn, Class<?> itemType, String itemFieldName);

    Class<?> getItemTypeForItemFieldName(Class<?> definedIn, String itemFieldName);

    ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class<?> itemType, String fieldName);

    /**
     * Determine whether a specific member should be serialized.
     *
     * @since 1.1.3
     */
    boolean shouldSerializeMember(Class<?> definedIn, String fieldName);

    interface ImplicitCollectionMapping {
        String getFieldName();

        String getItemFieldName();

        Class<?> getItemType();

        String getKeyFieldName();
    }

    Converter getLocalConverter(Class<?> definedIn, String fieldName);

    <T extends Mapper> T lookupMapperOfType(final Class<T> type);

    /**
     * Returns a single value converter to be used in a specific field.
     *
     * @param fieldName the field name
     * @param type the field type
     * @param definedIn the type which defines this field
     * @return a SingleValueConverter or null if there no such converter should be used for this field.
     * @since 1.2.2
     */
    SingleValueConverter getConverterFromItemType(String fieldName, Class<?> type, Class<?> definedIn);

    /**
     * Returns which converter to use for an specific attribute in a type.
     *
     * @param definedIn the field's parent
     * @param attribute the attribute name
     * @deprecated As of 1.3.1, use {@link #getConverterFromAttribute(Class, String, Class)}
     */
    @Deprecated
    SingleValueConverter getConverterFromAttribute(Class<?> definedIn, String attribute);

    /**
     * Returns which converter to use for an specific attribute in a type.
     *
     * @param definedIn the field's parent
     * @param attribute the attribute name
     * @param type the type the converter should create
     * @since 1.3.1
     */
    SingleValueConverter getConverterFromAttribute(Class<?> definedIn, String attribute, Class<?> type);
}


text:
<?php

namespace Application\Sonata\ClassificationBundle\Entity;

use Sonata\ClassificationBundle\Entity\BaseCategory as BaseCategory;

/**
 * This file has been generated by the Sonata EasyExtends bundle ( http://sonata-project.org/bundles/easy-extends )
 *
 * References :
 *   working with object : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en
 *
 * @author <yourname> <youremail>
 */
class Category extends BaseCategory
{
    /**
     * @var integer $id
     */
    protected $id;

    /**
     * Get id
     *
     * @return integer $id
     */
    public function getId()
    {
        return $this->id;
    }
}


text:
package v7_test

import (
	"errors"

	"code.cloudfoundry.org/cli/actor/v7action"
	"code.cloudfoundry.org/cli/resources"

	"code.cloudfoundry.org/cli/actor/actionerror"
	"code.cloudfoundry.org/cli/command/commandfakes"
	"code.cloudfoundry.org/cli/command/flag"
	. "code.cloudfoundry.org/cli/command/v7"
	"code.cloudfoundry.org/cli/command/v7/v7fakes"
	"code.cloudfoundry.org/cli/util/configv3"
	"code.cloudfoundry.org/cli/util/ui"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gbytes"
)

var _ = Describe("delete-private-domain Command", func() {
	var (
		cmd             DeletePrivateDomainCommand
		testUI          *ui.UI
		fakeConfig      *commandfakes.FakeConfig
		fakeSharedActor *commandfakes.FakeSharedActor
		fakeActor       *v7fakes.FakeActor
		input           *Buffer
		binaryName      string
		executeErr      error
		domain          string
	)

	BeforeEach(func() {
		input = NewBuffer()
		testUI = ui.NewTestUI(input, NewBuffer(), NewBuffer())
		fakeConfig = new(commandfakes.FakeConfig)
		fakeSharedActor = new(commandfakes.FakeSharedActor)
		fakeActor = new(v7fakes.FakeActor)

		binaryName = "faceman"
		fakeConfig.BinaryNameReturns(binaryName)
		domain = "some-domain.com"

		cmd = DeletePrivateDomainCommand{
			RequiredArgs: flag.Domain{Domain: domain},

			BaseCommand: BaseCommand{
				UI:          testUI,
				Config:      fakeConfig,
				SharedActor: fakeSharedActor,
				Actor:       fakeActor,
			},
		}

		fakeConfig.TargetedOrganizationReturns(configv3.Organization{
			Name: "some-org",
			GUID: "some-org-guid",
		})

		fakeActor.GetCurrentUserReturns(configv3.User{Name: "steve"}, nil)
	})

	JustBeforeEach(func() {
		executeErr = cmd.Execute(nil)
	})

	When("checking target fails", func() {
		BeforeEach(func() {
			fakeSharedActor.CheckTargetReturns(actionerror.NoOrganizationTargetedError{BinaryName: binaryName})
		})

		It("returns an error", func() {
			Expect(executeErr).To(MatchError(actionerror.NoOrganizationTargetedError{BinaryName: binaryName}))

			Expect(fakeSharedActor.CheckTargetCallCount()).To(Equal(1))
			checkTargetedOrg, checkTargetedSpace := fakeSharedActor.CheckTargetArgsForCall(0)
			Expect(checkTargetedOrg).To(BeTrue())
			Expect(checkTargetedSpace).To(BeFalse())
		})
	})

	When("the user is not logged in", func() {
		var expectedErr error

		BeforeEach(func() {
			expectedErr = errors.New("some current user error")
			fakeActor.GetCurrentUserReturns(configv3.User{}, expectedErr)
		})

		It("return an error", func() {
			Expect(executeErr).To(Equal(expectedErr))
		})
	})

	When("the domain does not exist", func() {
		BeforeEach(func() {
			fakeActor.GetDomainByNameReturns(resources.Domain{}, v7action.Warnings{"get-domain-warnings"}, actionerror.DomainNotFoundError{Name: "domain.com"})
		})

		It("displays OK and returns with success", func() {
			Expect(testUI.Err).To(Say("get-domain-warnings"))
			Expect(testUI.Out).To(Say("Deleting private domain some-domain.com as steve..."))
			Expect(testUI.Err).To(Say(`Domain 'some-domain.com' does not exist\.`))
			Expect(testUI.Out).To(Say("OK"))
			Expect(executeErr).ToNot(HaveOccurred())
		})
	})

	When("the getting the domain errors", func() {
		BeforeEach(func() {
			fakeActor.GetDomainByNameReturns(resources.Domain{}, v7action.Warnings{"get-domain-warnings"}, errors.New("get-domain-error"))
		})

		It("displays OK and returns with success", func() {
			Expect(testUI.Err).To(Say("get-domain-warnings"))
			Expect(executeErr).To(MatchError(errors.New("get-domain-error")))
		})
	})

	When("the -f flag is NOT provided", func() {
		BeforeEach(func() {
			cmd.Force = false
			fakeActor.GetDomainByNameReturns(resources.Domain{Name: "some-domain.com", OrganizationGUID: "owning-org", GUID: "domain-guid"}, nil, nil)
		})

		When("the user inputs yes", func() {
			BeforeEach(func() {
				_, err := input.Write([]byte("y\n"))
				Expect(err).ToNot(HaveOccurred())

				fakeActor.DeleteDomainReturns(v7action.Warnings{"some-warning"}, nil)
			})

			It("delegates to the Actor", func() {
				actualDomain := fakeActor.DeleteDomainArgsForCall(0)
				Expect(actualDomain).To(Equal(resources.Domain{Name: "some-domain.com", OrganizationGUID: "owning-org", GUID: "domain-guid"}))
			})

			It("deletes the private domain", func() {
				Expect(executeErr).ToNot(HaveOccurred())

				Expect(testUI.Err).To(Say("some-warning"))
				Expect(testUI.Out).To(Say(`Deleting private domain some-domain.com as steve\.\.\.`))
				Expect(testUI.Out).To(Say("OK"))
				Expect(testUI.Err).NotTo(Say(`Domain 'some-domain.com' does not exist\.`))
			})
		})

		When("the user inputs no", func() {
			BeforeEach(func() {
				_, err := input.Write([]byte("n\n"))
				Expect(err).ToNot(HaveOccurred())
			})

			It("cancels the delete", func() {
				Expect(executeErr).ToNot(HaveOccurred())

				Expect(testUI.Out).To(Say("'some-domain.com' has not been deleted."))
				Expect(fakeActor.DeleteDomainCallCount()).To(Equal(0))
			})
		})

		When("the user chooses the default", func() {
			BeforeEach(func() {
				_, err := input.Write([]byte("\n"))
				Expect(err).ToNot(HaveOccurred())
			})

			It("cancels the delete", func() {
				Expect(executeErr).ToNot(HaveOccurred())

				Expect(testUI.Out).To(Say(`\'some-domain.com\' has not been deleted.`))
				Expect(fakeActor.DeleteDomainCallCount()).To(Equal(0))
			})
		})

		When("the user input is invalid", func() {
			BeforeEach(func() {
				_, err := input.Write([]byte("e\n\n"))
				Expect(err).ToNot(HaveOccurred())
			})

			It("asks the user again", func() {
				Expect(executeErr).NotTo(HaveOccurred())

				Expect(testUI.Out).To(Say(`Really delete the private domain some-domain.com\? \[yN\]`))
				Expect(testUI.Out).To(Say(`invalid input \(not y, n, yes, or no\)`))
				Expect(testUI.Out).To(Say(`Really delete the private domain some-domain.com\? \[yN\]`))

				Expect(fakeActor.DeleteDomainCallCount()).To(Equal(0))
			})
		})
	})

	When("the -f flag is provided", func() {
		BeforeEach(func() {
			cmd.Force = true
		})

		When("deleting the private domain errors", func() {
			Context("generic error", func() {
				BeforeEach(func() {
					fakeActor.GetDomainByNameReturns(resources.Domain{Name: "some-domain.com", OrganizationGUID: "owning-org", GUID: "domain-guid"}, nil, nil)
					fakeActor.DeleteDomainReturns(v7action.Warnings{"some-warning"}, errors.New("some-error"))
				})

				It("displays all warnings, and returns the error", func() {
					Expect(testUI.Err).To(Say("some-warning"))
					Expect(testUI.Out).To(Say(`Deleting private domain some-domain.com as steve\.\.\.`))
					Expect(testUI.Out).ToNot(Say("OK"))
					Expect(executeErr).To(MatchError("some-error"))
				})
			})
		})

		When("the private domain exists", func() {
			BeforeEach(func() {
				fakeActor.GetDomainByNameReturns(resources.Domain{Name: "some-domain.com", OrganizationGUID: "owning-org"}, nil, nil)
				fakeActor.DeleteDomainReturns(v7action.Warnings{"some-warning"}, nil)
			})

			It("displays all warnings, and does not error", func() {
				Expect(executeErr).ToNot(HaveOccurred())

				Expect(testUI.Err).To(Say("some-warning"))
				Expect(testUI.Out).To(Say(`Deleting private domain some-domain.com as steve\.\.\.`))
				Expect(testUI.Out).To(Say("OK"))
				Expect(testUI.Err).NotTo(Say(`Domain 'some-domain.com' does not exist\.`))
			})
		})
	})
})


text:
from models.faction import Faction
from models.pilot import Pilot
from upgrades.astromech import Astromech
from upgrades.torpedo import Torpedo

import json

class PilotRegistry:
    """
    Registry of ship classes
    """
    # TODO
    UPGRADE_SLOTS = [Torpedo, Astromech]

    class PilotPrototype:
        """
        Pilot prototype, to be used for constructing pilot instances
        """
        pass

    def __init__(self, registry_json_file, ship_registry):
        """
        Constructor
        registry_json_file: The JSON file to load pilot descriptions from
        ship_registry: The ship registry to create ships with
        """
        self._pilot_prototypes = {}
        self._ship_registry = ship_registry

        with open(registry_json_file) as f:
            data = json.load(f)
            for pilot in data["pilots"]:
                # Parse ship details
                name = pilot["name"]

                prototype = PilotRegistry.PilotPrototype()
                prototype.faction = Faction[pilot["faction"]]
                prototype.ship = pilot["ship"]
                prototype.skill = pilot["skill"]
                prototype.attack = pilot["attack"]
                prototype.agility = pilot["agility"]
                prototype.hull = pilot["hull"]
                prototype.shield = pilot["shield"]
                prototype.upgrades = [PilotRegistry._upgrade_slot_from_string(upgrade) for upgrade in pilot["upgrades"]]
                prototype.points = pilot["points"]

                # Place in the registry
                self._pilot_prototypes[name] = prototype

    def create(self, name, upgrades):
        """
        Create a pilot from its name
        name: The name of the pilot to create
        upgrades: The list of upgrades to give the pilot
        return: Instance of the pilot
        """
        prototype = self._pilot_prototypes[name]

        # TODO: check that the list of upgrades is valid for this pilot
        return Pilot(
            name,
            prototype.faction,
            self._ship_registry.create(prototype.ship),
            prototype.skill,
            prototype.attack,
            prototype.agility,
            prototype.hull,
            prototype.shield,
            upgrades,
            prototype.points)

    @staticmethod
    def _upgrade_slot_from_string(upgrade_slot_name):
        """
        Get an upgrade slot from its string name
        """
        for upgrade_slot in PilotRegistry.UPGRADE_SLOTS:
            if upgrade_slot.__name__ == upgrade_slot_name:
                return upgrade_slot

        raise ValueError("Unknown upgrade slot name")


text:
<?php

	$vo_result = $this->getVar('result');
 	print $this->render('Search/search_controls_html.php');
 ?>

<?php
	if($vo_result) {
		print $this->render('Results/paging_controls_html.php');

		print $this->render('Results/search_options_html.php');
?>

<?php
		$vs_view = $this->getVar('current_view');
		if ($vo_result->numHits() == 0) { $vs_view = 'no_results'; }
		switch($vs_view) {
			case 'no_results':
				print $this->render('Results/no_results_html.php');
				break;
			case 'editable':
				print $this->render('Results/ca_list_items_editable_html.php');
				break;
			case 'list':
			default:
				print $this->render('Results/ca_list_items_list_html.php');
				break;
		}
?>

<?php
	}
?>


text:
[![Qt Pods](http://qt-pods.org/assets/logo.png "Qt Pods")](http://qt-pods.org)

# About

This is a PList (Mac OS X property list) parser for Qt.  See http://en.wikipedia.org/wiki/Property_list for more information about the format.

# How to install

qtplist is available via qt-pods. See here for reference:
https://github.com/cybercatalyst/qt-pods

Alternatively, you can just copy PListSerializer and/or PListParser into your source tree.  They don't have any dependencies beyond Qt Core and Qt XML.

# How it works

exampleusage.cpp has a simple example of using each class.

Basically, it takes a QIODevice (generally a file), and returns you a QVariant with all the values in the PList.

Suppose this is your plist file:

```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>SomeKey</key>
	<string>Value1</string>
	<key>MyOtherKey</key>
	string>Value2</string>
</dict>
</plist>
```

This would get converted into a QVariantMap, with keys SomeKey and MyOtherKey, with respective values Value1 and Value2.  If your PList has arrays or dictionaries inside, they are converted to QVariantLists and QVariantMaps.

It can also do the conversion the other way: if you have a QVariant, QVariantList, or QVariantMap, it can generate a PList file out of it, using PListSerializer.

That's it!


text:
class CreateContractors < ActiveRecord::Migration
  def change
    create_table :contractors do |t|
      t.string :name
      t.string :company_name
      t.string :company_address
      t.integer :ssn
      t.string :certification
    end
  end
end


text:
messages
========

ng-messages
-----------