text:
package com.rarchives.ripme.ripper;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;

import javax.net.ssl.HttpsURLConnection;

import com.rarchives.ripme.ui.MainWindow;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.jsoup.HttpStatusException;

import com.rarchives.ripme.ui.RipStatusMessage.STATUS;
import com.rarchives.ripme.utils.Utils;
import com.rarchives.ripme.ripper.AbstractRipper;

/**
 * Thread for downloading files.
 * Includes retry logic, observer notifications, and other goodies.
 */
class DownloadFileThread extends Thread {

    private ResourceBundle rb = MainWindow.rb;

    private static final Logger logger = Logger.getLogger(DownloadFileThread.class);

    private String referrer = "";
    private Map<String,String> cookies = new HashMap<>();

    private URL url;
    private File saveAs;
    private String prettySaveAs;
    private AbstractRipper observer;
    private int retries;
    private Boolean getFileExtFromMIME;

    private final int TIMEOUT;

    public DownloadFileThread(URL url, File saveAs, AbstractRipper observer, Boolean getFileExtFromMIME) {
        super();
        this.url = url;
        this.saveAs = saveAs;
        this.prettySaveAs = Utils.removeCWD(saveAs);
        this.observer = observer;
        this.retries = Utils.getConfigInteger("download.retries", 1);
        this.TIMEOUT = Utils.getConfigInteger("download.timeout", 60000);
        this.getFileExtFromMIME = getFileExtFromMIME;
    }

    public void setReferrer(String referrer) {
        this.referrer = referrer;
    }
    public void setCookies(Map<String,String> cookies) {
        this.cookies = cookies;
    }

    /**
     * Attempts to download the file. Retries as needed.
     * Notifies observers upon completion/error/warn.
     */
    public void run() {
        long fileSize = 0;
        int bytesTotal = 0;
        int bytesDownloaded = 0;
        if (saveAs.exists() && observer.tryResumeDownload()) {
            fileSize = saveAs.length();
        }
        try {
            observer.stopCheck();
        } catch (IOException e) {
            observer.downloadErrored(url, rb.getString("download.interrupted"));
            return;
        }
        if (saveAs.exists() && !observer.tryResumeDownload() && !getFileExtFromMIME ||
                Utils.fuzzyExists(new File(saveAs.getParent()), saveAs.getName()) && getFileExtFromMIME && !observer.tryResumeDownload()) {
            if (Utils.getConfigBoolean("file.overwrite", false)) {
                logger.info("[!] " + rb.getString("deleting.existing.file") + prettySaveAs);
                saveAs.delete();
            } else {
                logger.info("[!] " + rb.getString("skipping") + url + " -- " + rb.getString("file.already.exists") + ": " + prettySaveAs);
                observer.downloadExists(url, saveAs);
                return;
            }
        }
        URL urlToDownload = this.url;
        boolean redirected = false;
        int tries = 0; // Number of attempts to download
        do {
            tries += 1;
            InputStream bis = null; OutputStream fos = null;
            try {
                logger.info("    Downloading file: " + urlToDownload + (tries > 0 ? " Retry #" + tries : ""));
                observer.sendUpdate(STATUS.DOWNLOAD_STARTED, url.toExternalForm());

                // Setup HTTP request
                HttpURLConnection huc;
                if (this.url.toString().startsWith("https")) {
                    huc = (HttpsURLConnection) urlToDownload.openConnection();
                }
                else {
                    huc = (HttpURLConnection) urlToDownload.openConnection();
                }
                huc.setInstanceFollowRedirects(true);
                // It is important to set both ConnectTimeout and ReadTimeout. If you don't then ripme will wait forever
                // for the server to send data after connecting.
                huc.setConnectTimeout(TIMEOUT);
                huc.setReadTimeout(TIMEOUT);
                huc.setRequestProperty("accept",  "*/*");
                if (!referrer.equals("")) {
                    huc.setRequestProperty("Referer", referrer); // Sic
                }
                huc.setRequestProperty("User-agent", AbstractRipper.USER_AGENT);
                String cookie = "";
                for (String key : cookies.keySet()) {
                    if (!cookie.equals("")) {
                        cookie += "; ";
                    }
                    cookie += key + "=" + cookies.get(key);
                }
                huc.setRequestProperty("Cookie", cookie);
                if (observer.tryResumeDownload()) {
                    if (fileSize != 0) {
                        huc.setRequestProperty("Range", "bytes=" + fileSize + "-");
                    }
                }
                logger.debug(rb.getString("request.properties") + ": " + huc.getRequestProperties());
                huc.connect();

                int statusCode = huc.getResponseCode();
                logger.debug("Status code: " + statusCode);
                if (statusCode != 206 && observer.tryResumeDownload() && saveAs.exists()) {
                    // TODO find a better way to handle servers that don't support resuming downloads then just erroring out
                    throw new IOException(rb.getString("server.doesnt.support.resuming.downloads"));
                }
                if (statusCode  / 100 == 3) { // 3xx Redirect
                    if (!redirected) {
                        // Don't increment retries on the first redirect
                        tries--;
                        redirected = true;
                    }
                    String location = huc.getHeaderField("Location");
                    urlToDownload = new URL(location);
                    // Throw exception so download can be retried
                    throw new IOException("Redirect status code " + statusCode + " - redirect to " + location);
                }
                if (statusCode / 100 == 4) { // 4xx errors
                    logger.error("[!] " + rb.getString("nonretriable.status.code") + " " + statusCode + " while downloading from " + url);
                    observer.downloadErrored(url, rb.getString("nonretriable.status.code") + " " + statusCode + " while downloading " + url.toExternalForm());
                    return; // Not retriable, drop out.
                }
                if (statusCode / 100 == 5) { // 5xx errors
                    observer.downloadErrored(url, rb.getString("retriable.status.code") + " " + statusCode + " while downloading " + url.toExternalForm());
                    // Throw exception so download can be retried
                    throw new IOException(rb.getString("retriable.status.code") + " " + statusCode);
                }
                if (huc.getContentLength() == 503 && urlToDownload.getHost().endsWith("imgur.com")) {
                    // Imgur image with 503 bytes is "404"
                    logger.error("[!] Imgur image is 404 (503 bytes long): " + url);
                    observer.downloadErrored(url, "Imgur image is 404: " + url.toExternalForm());
                    return;
                }

                // If the ripper is using the bytes progress bar set bytesTotal to huc.getContentLength()
                if (observer.useByteProgessBar()) {
                    bytesTotal = huc.getContentLength();
                    observer.setBytesTotal(bytesTotal);
                    observer.sendUpdate(STATUS.TOTAL_BYTES, bytesTotal);
                    logger.debug("Size of file at " + this.url + " = " + bytesTotal + "b");
                }

                // Save file
                bis = new BufferedInputStream(huc.getInputStream());

                // Check if we should get the file ext from the MIME type
                if (getFileExtFromMIME) {
                    String fileExt = URLConnection.guessContentTypeFromStream(bis);
                    if (fileExt != null) {
                        fileExt = fileExt.replaceAll("image/", "");
                        saveAs = new File(saveAs.toString() + "." + fileExt);
                    } else {
                        logger.error("Was unable to get content type from stream");
                        // Try to get the file type from the magic number
                        byte[] magicBytes = new byte[8];
                        bis.read(magicBytes,0, 5);
                        bis.reset();
                        fileExt = Utils.getEXTFromMagic(magicBytes);
                        if (fileExt != null) {
                            saveAs = new File(saveAs.toString() + "." + fileExt);
                        } else {
                            logger.error(rb.getString("was.unable.to.get.content.type.using.magic.number"));
                            logger.error(rb.getString("magic.number.was") + ": " + Arrays.toString(magicBytes));
                        }
                    }
                }
                // If we're resuming a download we append data to the existing file
                if (statusCode == 206) {
                    fos = new FileOutputStream(saveAs, true);
                } else {
                    fos = new FileOutputStream(saveAs);
                }
                byte[] data = new byte[1024 * 256];
                int bytesRead;
                while ( (bytesRead = bis.read(data)) != -1) {
                    try {
                        observer.stopCheck();
                    } catch (IOException e) {
                        observer.downloadErrored(url, rb.getString("download.interrupted"));
                        return;
                    }
                    fos.write(data, 0, bytesRead);
                    if (observer.useByteProgessBar()) {
                        bytesDownloaded += bytesRead;
                        observer.setBytesCompleted(bytesDownloaded);
                        observer.sendUpdate(STATUS.COMPLETED_BYTES, bytesDownloaded);
                    }
                    // If this is a test and we're downloading a large file
                    if (AbstractRipper.isThisATest() && bytesTotal / 10000000 >= 10) {
                        logger.debug("Not downloading whole file because it is over 10mb and this is a test");
                        bis.close();
                        fos.close();
                        break;

                    }
                }
                bis.close();
                fos.close();
                break; // Download successful: break out of infinite loop
            } catch (SocketTimeoutException timeoutEx) {
                // Handle the timeout
                logger.error("[!] " + url.toExternalForm() + " timedout!");
                // Download failed, break out of loop
                break;
            } catch (HttpStatusException hse) {
                logger.debug(rb.getString("http.status.exception"), hse);
                logger.error("[!] HTTP status " + hse.getStatusCode() + " while downloading from " + urlToDownload);
                if (hse.getStatusCode() == 404 && Utils.getConfigBoolean("errors.skip404", false)) {
                    observer.downloadErrored(url, "HTTP status code " + hse.getStatusCode() + " while downloading " + url.toExternalForm());
                    return;
                }
            } catch (IOException e) {
                logger.debug("IOException", e);
                logger.error("[!] " + rb.getString("exception.while.downloading.file") + ": " + url + " - " + e.getMessage());
            } finally {
                // Close any open streams
                try {
                    if (bis != null) { bis.close(); }
                } catch (IOException e) { }
                try {
                    if (fos != null) { fos.close(); }
                } catch (IOException e) { }
            }
            if (tries > this.retries) {
                logger.error("[!] " + rb.getString ("exceeded.maximum.retries") + " (" + this.retries + ") for URL " + url);
                observer.downloadErrored(url, rb.getString("failed.to.download") + " " + url.toExternalForm());
                return;
            }
        } while (true);
        observer.downloadCompleted(url, saveAs);
        logger.info("[+] Saved " + url + " as " + this.prettySaveAs);
    }

}


text:
info = require('./../../package.json');

module.exports = function* (next) {
  this.body = {
    status: 'ok',
    name: info.name,
    version: info.version
  };
  yield next;
};

redpajama_set_name: RedPajamaGithub


text:
namespace Intel.RealSense.Base
{
    using System;

    /// <summary>
    /// Base class for objects in an <cref see="ObjectPool">ObjectPool</cref>
    /// </summary>
    public abstract class PooledObject : Object
    {
        protected PooledObject(IntPtr ptr, Deleter deleter)
            : base(ptr, deleter)
        {
        }

        internal abstract void Initialize();

        protected override void Dispose(bool disposing)
        {
            if (m_instance.IsInvalid)
            {
                return;
            }

            base.Dispose(disposing);
            ObjectPool.Release(this);
        }
    }
}


text:
<?php
include '../koneksi.php';

if (isset($_POST['submit'])) {
  $tgl_awal   = $_POST['tgl_awal'];
  $tgl_akhir  = $_POST['tgl_akhir'];

  $simpan = mysql_query("SELECT * FROM spk a JOIN supir b ON a.id_supir = b.id_supir JOIN spsk c ON a.no_spsk = c.no_spsk JOIN detail_mobil d ON c.no_spsk = d.no_spsk JOIN mobil e ON d.id_mobil = e.id_mobil JOIN penyewa f ON c.id_penyewa = f.id_penyewa WHERE d.jasa_supir='Ya' AND tgl_spk >= '$date1' AND tgl_spk <= '$date2'");
  if ($simpan) {
    echo "";
  } else {
    echo "";
  }
}
?>

 Cetak Laporan Supir

      <form action="lapsupir.php" method="POST" enctype="multipart/form-data" class="form-horizontal">

          Tanggal Awal

            <input type="date" id="tgl_awal" name="tgl_awal" class="form-control" required>

          Tanggal Akhir

            <input type="date" id="tgl_akhir" name="tgl_akhir" class="form-control" required>

            <button type="submit" name="submit" class="btn btn-primary">CETAK</button>

      </form>


text:
package edu.jhuapl.sages.mobile.lib.app;

import edu.jhuapl.sages.mobile.lib.app.tests.crypto.SagesKeyTest;
import edu.jhuapl.sages.mobile.lib.crypto.persisted.SagesKey.KeyEnum;
import edu.jhuapl.sages.mobile.lib.crypto.persisted.SagesKeyException;
import edu.jhuapl.sages.mobile.lib.crypto.persisted.SagesKeyStore;
import edu.jhuapl.sages.mobile.lib.crypto.persisted.SagesPublicKey;
import edu.jhuapl.sages.mobile.lib.message.MessageBuilderUtil;
import edu.jhuapl.sages.mobile.lib.message.SagesMessage;
import edu.jhuapl.sages.mobile.lib.message.SagesMessage.MsgTypeEnum;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Environment;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import java.io.File;
import java.util.Calendar;

public class MainActivity extends Activity {

	private ListView listView;

	private TextView msgText;
	//private File keyStoreFile;
	public static final File KEYSTORE_FILE = new File(Environment.getExternalStorageDirectory().getAbsoluteFile() + "/sageslib_testout");

	private static TelephonyManager tMgr;
	public static  String NUMBER_THIS_DEVICE;
//	private static int CONTACT_DEVICE_INDEX = 0;

	private String  recipientId = null;
	private static SagesKeyStore keystore;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		tMgr = (TelephonyManager)this.getSystemService(TELEPHONY_SERVICE);
		NUMBER_THIS_DEVICE = tMgr.getLine1Number();

		TextView deviceNumTxt = (TextView)findViewById(R.id.txt_deviceNum);
		deviceNumTxt.append(" " + NUMBER_THIS_DEVICE);

		Toast.makeText(this, "onCreate()", Toast.LENGTH_SHORT).show();

		try {
			//keyStoreFile = new File(Environment.getExternalStorageDirectory().getAbsoluteFile() + "/sageslib_testout");
			keystore = new SagesKeyStore(KEYSTORE_FILE);
		} catch (SagesKeyException e1) {
			Log.e("SagesCrypto", "Keystore file was not created.");
			e1.printStackTrace();
		}

		// Grabbing contacts from dummy string-array resource file
		String[]  contacts = getResources().getStringArray(R.array.contacts_array);

		// will disable this device's phone number from the view using this index
		/*	TODO wasn't working as expected
		 * for (String c: contacts){
			if (c.contains(NUMBER_THIS_DEVICE)){
			  break;
			}
			CONTACT_DEVICE_INDEX++;
		}*/

		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, contacts);

		listView = (ListView)findViewById(R.id.contacts_list);
		listView.setAdapter(adapter);

		listView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
				try {
					recipientId = (String) ((TextView)view).getText();
					SagesPublicKey key = (SagesPublicKey) keystore.lookupKey(recipientId, KeyEnum.PUBLIC);
					TextView textview = (TextView)findViewById(R.id.publickey_contact);
					if (key !=null){
						textview.setText(new String(key.getData()));
						textview.setBackgroundColor(Color.GREEN);
					} else {
						textview.setText("There is no key for this contact [" +  recipientId + "]. Initiate a key exchange session");
						textview.setBackgroundColor(Color.WHITE);
					}
					refreshKeyExchangeMsg();
				} catch (SagesKeyException e) {
					e.printStackTrace();
				}
			}

		});

		listView.setOnItemLongClickListener(new OnItemLongClickListener() {

			@Override
			public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
				// alert dialog to delete key
				final String selectedPhoneNum = ((TextView)view).getText().toString();
				AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(MainActivity.this);
				alertDialogBuilder.setTitle("Delete Keys for " + selectedPhoneNum);
				alertDialogBuilder
					.setMessage("Yes to delete")
					.setCancelable(true)
					.setPositiveButton("Yes", new DialogInterface.OnClickListener() {

						@Override
						public void onClick(DialogInterface dialog, int which) {
							try {
								keystore.removeAllKeysFor(selectedPhoneNum);
								Toast.makeText(MainActivity.this, "Keys deleted for " + selectedPhoneNum , Toast.LENGTH_SHORT).show();

							} catch (SagesKeyException e) {
								e.printStackTrace();
								Log.e("SagesCrypto", "Issue occurred trying to delete keys.");
								Toast.makeText(MainActivity.this, "Keys were not deleted. Failure occured.", Toast.LENGTH_SHORT).show();
							}
						}
					})
					.setNegativeButton("No", new DialogInterface.OnClickListener() {

						@Override
						public void onClick(DialogInterface dialog, int which) {
							dialog.cancel();
						}
					});

				AlertDialog alertDialog = alertDialogBuilder.create();
				alertDialog.show();

				return false;
			}
		});

		Button keyExchangeButton = (Button)findViewById(R.id.btn_KeyExchange);
		keyExchangeButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				msgText = ((TextView)findViewById(R.id.txt_keyexchange_msg));
				refreshKeyExchangeMsg();
				SmsManager smsManager = SmsManager.getDefault();
				if (recipientId.startsWith("+")){
					//recipientId = recipientId.substring(1);
				}
				try {
					saveOwnKeyPriorToSMS(MainActivity.this, "+" + NUMBER_THIS_DEVICE,msgText.getText().toString());
					smsManager.sendTextMessage(recipientId, null, msgText.getText().toString(), null, null);
					Toast.makeText(MainActivity.this, "Key Exchange SMS sent to " + recipientId, Toast.LENGTH_SHORT).show();
				} catch (SagesKeyException e) {
					e.printStackTrace();
					Toast.makeText(MainActivity.this, "Couldn't save key. Key Exchange NOT SMS sent to " + recipientId, Toast.LENGTH_SHORT).show();
				}

			}

		});

	}

	public static void saveOwnKeyPriorToSMS(Context context, String agentId, String msg) throws SagesKeyException{
		if (keystore.lookupKey(agentId, KeyEnum.PUBLIC) == null){
			SagesPublicKey key = new SagesPublicKey(context, agentId, null, msg.getBytes());
			keystore.addKey(key);
		}

/*		if (keystore.lookupKey("+" + NUMBER_THIS_DEVICE,KeyEnum.PUBLIC) == null){
			SagesPublicKey key = new SagesPublicKey(MainActivity.this, "+" + NUMBER_THIS_DEVICE, null, msgText.getText().toString().getBytes());
			keystore.addKey(key);
		}
*/
	}
	@Override
	protected void onPostCreate(Bundle savedInstanceState) {
		super.onPostCreate(savedInstanceState);

	};

	private void refreshKeyExchangeMsg() {
		msgText = (TextView)findViewById(R.id.txt_keyexchange_msg);
		String msgHeader = MessageBuilderUtil.genMetaDataHeader(MsgTypeEnum.KEY_EXCH, "init");
		String msgBody = SagesMessage.my_key + SagesKeyTest.testData + " (" + NUMBER_THIS_DEVICE +") - " +
				Calendar.getInstance().get(Calendar.HOUR) + Calendar.getInstance().get(Calendar.MINUTE) + Calendar.getInstance().get(Calendar.SECOND);

		msgText.setText(msgHeader + msgBody);

	}

	@Override
	protected void onStart() {
		super.onStart();
		Toast.makeText(this, "onStart()", Toast.LENGTH_SHORT).show();

	};

	@Override
	protected void onResume() {
		super.onResume();
		Toast.makeText(this, "onResume()", Toast.LENGTH_SHORT).show();
	};

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		super.onRestoreInstanceState(savedInstanceState);
		Toast.makeText(this, "onRestoreInstnceSate(Bundle)", Toast.LENGTH_SHORT).show();
	};
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}


text:
(function($){
    $.fn.stackNav = function( options ){

        var settings = {
            animateFixing:{
                marginTop: 0
            },
            animateUnfixing:{
                marginTop: 25
            },
            animateSpeed: 300,
            completeFixing: function(){},
            completeUnfixing: function(){},
            affectedElement:".stack"
        }
        var $self = $(this);
        var currentTop;

        $.extend( settings, options );
        $self.each( onEach );
        /*
         * Each profile in the page
         */
        function onEach(){
            var $this = $(this);
            var stacknav = new stackNav( $this );
        }
        function stackNav( elem ){

            var self = this;
            var $elem = elem;
            var top = $elem.offset().top;
            var isFixed = false;
            var $stackNav = elem.find(settings.affectedElement);

            this.scroll = function(){
                currentTop = $(document).scrollTop();

                if(currentTop > top){
                    isFixed = true;
                    $stackNav.addClass('fixed');
                    self.fixed();
                }else{
                    isFixed = false;
                    $stackNav.removeClass('fixed');
                    self.unfixed();
                }

            }

            this.fixed = function( speed ){
                if(isFixed){

                    $stackNav.stop().animate(settings.animateFixing, settings.animateSpeed, function() {
                        isFixed = true;
                        settings.completeFixing();
                    });

                }
            }

            this.unfixed = function( speed ){
                if(!isFixed){

                    $stackNav.stop().animate(settings.animateUnfixing, settings.animateSpeed, function() {
                        isFixed = false;
                        settings.completeUnfixing();
                    });

                }
            }

            $(window).scroll( self.scroll );

        }

    }

})(jQuery);


text:
Prepare database for staging enviroments

This gem is ready to work with the gem [backup](https://github.com/meskyanichi/backup/ "Backup gem")
## Installation

Add these lines to your rails application's Gemfile:

    group :staging do
        gem 'staging-rails', git: "git://github.com/firefield/rails_staging.git"
        gem 'fog'
    end

And then execute:

    $ bundle

## Configuration

Add staging environment to your application if you didn't already. This will include a new database defition in config/database.yml

    production:
      adapter: mysql2
      encoding: utf8
      reconnect: false
      database: myrailsapp_production
      pool: 5
      username: production_user
      password: production_password

    staging:
      adapter: mysql2
      encoding: utf8
      reconnect: false
      database: myrailsapp_staing
      pool: 5
      username: staging_user
      password: staging_password

Create a file in the config/initializers directory with the configuration options

    # Fog storage definition
    Staging::Rails::StagingWorker::config.storage = Fog::Storage.new({
        :provider                 => 'AWS',
        :aws_access_key_id        => 'S3_KEY_ID',
        :aws_secret_access_key    => 'S3_SECRET'
    })

    # S3 bucket name
    Staging::Rails::StagingWorker::config.bucket_name = "mybackups"

    # Name of the server
    Staging::Rails::StagingWorker::config.source_host = "production.myrailsapp.com"

    # Name for the backup
    Staging::Rails::StagingWorker::config.backup_name = "rails_server"

    # Database type
    Staging::Rails::StagingWorker::config.database_type = "MySQL"

    # Database name
    Staging::Rails::StagingWorker::config.database_name = "myrailsapp_production"

## Usage
To restore the latest backup use

    RAILS_ENV=staging bundle exec rake staging:prepare

## Contributing

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


text:
namespace LibRbxl.Instances
{
    public abstract class LuaSourceContainer : Instance
    {
        [RobloxIgnore]
        public Player CurrentEditor { get; set; }
    }
}


text:
create table llx_expedition
(
  rowid                 integer AUTO_INCREMENT PRIMARY KEY,
  tms                   timestamp,
  ref                   varchar(30)        NOT NULL,
  entity                integer  DEFAULT 1 NOT NULL,	-- multi company id
  ref_customer          varchar(30),					-- customer number
  fk_soc                integer            NOT NULL,

  date_creation         datetime,						-- date de creation
  fk_user_author        integer,						-- createur
  date_valid            datetime,						-- date de validation
  fk_user_valid         integer,						-- valideur
  date_expedition       datetime,						-- shipping date
  date_delivery			datetime	DEFAULT NULL,		-- delivery date
  fk_address  			integer		DEFAULT NULL, 		-- delivery address (deprecated)
  fk_expedition_methode integer,
  tracking_number       varchar(50),
  fk_statut             smallint	DEFAULT 0,

  height                integer,
  width                 integer,
  size_units            integer,
  size                  integer,
  weight_units          integer,
  weight                integer,
  note                  text,
  model_pdf             varchar(50)

)type=innodb;


text:
						<button type="button" class="btn" ng-class="alert.color">

						</button>

{{alert.total}}

					{{alert.description}}

Customer Index

-Total Number of Customers

You see, in this world there's two kinds of people, my friend: those with loaded guns and those who dig. you dig. dyin' ain't much of a livin', boy. are you feeling lucky punk here. put that in your report!" and "i may have found a way out of here. what you have to ask yourself is, do i feel lucky. well do ya' punk? when a naked man's chasing a woman through an alley with a butcher knife, i figure he's not out collecting for the red cross.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
net.rubyeye.xmemcached.monitor (xmemcached 1.3.0 API)
</TITLE>

<META NAME="date" CONTENT="2011-01-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

net.rubyeye.xmemcached.monitor

Interfaces

StatisticsHandlerMBean

Classes

Constants

MemcachedClientNameHolder

StatisticsHandler

XMemcachedMbeanServer


text:
package org.kie.workbench.common.widgets.decoratedgrid.client.widget;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;

import org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle;
import org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicDataRow;

/**
 * A Factory to create CellValues applicable to given columns.
 */
public abstract class AbstractCellValueFactory<C, V> {

    // Data Model Oracle to aid data-type resolution etc
    protected AsyncPackageDataModelOracle oracle;

    public AbstractCellValueFactory( AsyncPackageDataModelOracle oracle ) {
        if ( oracle == null ) {
            throw new IllegalArgumentException( "oracle cannot be null" );
        }
        this.oracle = oracle;
    }

    /**
     * Construct a new row of data for the underlying model
     * @return
     */
    public abstract List<V> makeRowData();

    /**
     * Construct a new row of data for the MergableGridWidget
     * @return
     */
    public abstract DynamicDataRow makeUIRowData();

    /**
     * Construct a new column of data for the underlying model
     * @param column
     * @return
     */
    public abstract List<V> makeColumnData( C column );

    /**
     * Convert a column of domain data to that suitable for the UI
     * @param column
     * @param columnData
     * @return
     */
    public abstract List<CellValue<? extends Comparable<?>>> convertColumnData( C column,
                                                                                List<V> columnData );

    /**
     * Make a Model cell for the given column
     * @param column
     * @return
     */
    protected abstract V makeModelCellValue( C column );

    /**
     * Convert a Model cell to one that can be used in the UI
     * @param cell
     * @return
     */
    protected abstract CellValue<? extends Comparable<?>> convertModelCellValue( C column,
                                                                                V cell );

    /**
     * Convert a type-safe UI CellValue into a type-safe Model CellValue
     * @param column Model column from which data-type can be derived
     * @param cell UI CellValue to convert into Model CellValue
     * @return
     */
    protected abstract V convertToModelCell( C column,
                                             CellValue<?> cell );

    protected CellValue<Boolean> makeNewBooleanCellValue() {
        CellValue<Boolean> cv = new CellValue<Boolean>( Boolean.FALSE );
        return cv;
    }

    protected CellValue<Boolean> makeNewBooleanCellValue( Boolean initialValue ) {
        CellValue<Boolean> cv = makeNewBooleanCellValue();
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<Date> makeNewDateCellValue() {
        CellValue<Date> cv = new CellValue<Date>( null );
        return cv;
    }

    protected CellValue<Date> makeNewDateCellValue( Date initialValue ) {
        CellValue<Date> cv = makeNewDateCellValue();
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<String> makeNewDialectCellValue() {
        CellValue<String> cv = new CellValue<String>( "java" );
        return cv;
    }

    protected CellValue<String> makeNewDialectCellValue( String initialValue ) {
        CellValue<String> cv = makeNewDialectCellValue();
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<BigDecimal> makeNewNumericCellValue() {
        CellValue<BigDecimal> cv = new CellValue<BigDecimal>( null );
        return cv;
    }

    protected CellValue<BigDecimal> makeNewNumericCellValue( BigDecimal initialValue ) {
        CellValue<BigDecimal> cv = new CellValue<BigDecimal>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<BigDecimal> makeNewBigDecimalCellValue( BigDecimal initialValue ) {
        CellValue<BigDecimal> cv = new CellValue<BigDecimal>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<BigInteger> makeNewBigIntegerCellValue( BigInteger initialValue ) {
        CellValue<BigInteger> cv = new CellValue<BigInteger>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<Byte> makeNewByteCellValue( Byte initialValue ) {
        CellValue<Byte> cv = new CellValue<Byte>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<Double> makeNewDoubleCellValue( Double initialValue ) {
        CellValue<Double> cv = new CellValue<Double>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<Float> makeNewFloatCellValue( Float initialValue ) {
        CellValue<Float> cv = new CellValue<Float>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<Integer> makeNewIntegerCellValue( Integer initialValue ) {
        CellValue<Integer> cv = new CellValue<Integer>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<Long> makeNewLongCellValue( Long initialValue ) {
        CellValue<Long> cv = new CellValue<Long>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<Short> makeNewShortCellValue( Short initialValue ) {
        CellValue<Short> cv = new CellValue<Short>( null );
        if ( initialValue != null ) {
            cv.setValue( initialValue );
        }
        return cv;
    }

    protected CellValue<String> makeNewStringCellValue() {
        CellValue<String> cv = new CellValue<String>( null );
        return cv;
    }

    protected CellValue<String> makeNewStringCellValue( Object initialValue ) {
        CellValue<String> cv = makeNewStringCellValue();
        if ( initialValue != null && !initialValue.equals( "" ) ) {
            cv.setValue( initialValue.toString() );
        }
        return cv;
    }

}


text:
<?php

namespace PHPParser\Parser;

//namespace Doqumentor;
/**
	This file is part of Doqumentor.

    Doqumentor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Doqumentor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Doqumentor.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
* PHPDoc parser for use in Doqumentor
*
* Simple example usage:
* $a = new Parser($string);
* $a->parse();
*
* @author Murray Picton
* @copyright 2010 Murray Picton
*/
use PHPParser\Error\Error;

class DocCommentParser {

	/**
	* The string that we want to parse
	*/
	private $string;
	/**
	* Storge for the short description
	*/
	private $shortDesc;
	/**
	* Storge for the long description
	*/
	private $longDesc;
	/**
	* Storge for all the PHPDoc parameters
	*/
	private $params;

	/**
	* Parse each line
	*
	* Takes an array containing all the lines in the string and stores
	* the parsed information in the object properties
	*
	* @param array $lines An array of strings to be parsed
	*/
	private function parseLines($lines) {
		foreach($lines as $line) {
			$parsedLine = $this->parseLine($line); //Parse the line

			if($parsedLine === false && empty($this->shortDesc)) {
				$this->shortDesc = implode(PHP_EOL, $desc); //Store the first line in the short description
				$desc = array();
			} elseif($parsedLine !== false) {
				$desc[] = $parsedLine; //Store the line in the long description
			}
		}
		$this->longDesc = implode(PHP_EOL, $desc);
	}
	/**
	* Parse the line
	*
	* Takes a string and parses it as a PHPDoc comment
	*
	* @param string $line The line to be parsed
	* @return mixed False if the line contains no parameters or paramaters
	* that aren't valid otherwise, the line that was passed in.
	*/
	private function parseLine($line) {

		//Trim the whitespace from the line
		$line = trim($line);

		if(empty($line)) return false; //Empty line

		if(strpos($line, '@') === 0) {
			$param = substr($line, 1, strpos($line, ' ') - 1); //Get the parameter name
			$value = substr($line, strlen($param) + 2); //Get the value
			if($this->setParam($param, $value)) return false; //Parse the line and return false if the parameter is valid
		}

		return $line;
	}

	/**
	* Parse a parameter or string to display in simple typecast display
	*
	* @param string $string The string to parse
	* @return string Formatted string wiht typecast
	*/
	private function formatParamOrReturn($string) {

		$pos = strpos($string, ' ');

		$type = substr($string, 0, $pos);
		return '(' . $type . ')' . substr($string, $pos+1);
	}

	/**
	* Set a parameter
	*
	* @param string $param The parameter name to store
	* @param string $value The value to set
	* @return bool True = the parameter has been set, false = the parameter was invalid
	*/
	private function setParam($param, $value) {
		//if(!array_key_exists($param, $this->params)) return false;

		if($param == 'param' || $param == 'return') $value = $this->formatParamOrReturn($value);

		if(empty($this->params[$param])) {
			$this->params[$param] = $value;
		} else {
			$arr = array($this->params[$param], $value);
			$this->params[$param] = $arr;
		}
		return true;
	}
	/**
	* Setup the initial object
	*
	* @param string $string The string we want to parse
	*/
	public function __construct($string) {
		$this->string = $string;
	}
	/**
	* Parse the string
	*/
	public function parse() {
		//Get the comment
		if(preg_match('#^/\*\*(.*)\*/#s', $this->string, $comment) === false)
			throw new Error("Error parsing doc comment");

		$comment = trim($comment[1]);

		//Get all the lines and strip the * from the first character
		if(preg_match_all('#^\s*\*(.*)#m', $comment, $lines) === false)
			throw new Error('Error parsing doc comment');

		$this->parseLines($lines[1]);
	}
	/**
	* Get the short description
	*
	* @return string The short description
	*/
	public function getShortDesc() {
		return $this->shortDesc;
	}
	/**
	* Get the long description
	*
	* @return string The long description
	*/
	public function getDesc() {
		return $this->longDesc;
	}
	/**
	* Get the parameters
	*
	* @return array The parameters
	*/
	public function getParams() {
		return $this->params;
	}
}


text:
<ns3:Envelope xmlns:ns2="http://www.trustedcomputinggroup.org/2010/IFMAP/2" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
  <ns3:Body>
    <ns2:response>
      <pollResult>
        <updateResult name="root">
          <resultItem>
            <identity other-type-definition="extended" type="other" name="contrail:virtual-router:vr1"/>
            <metadata>
              <contrail:id-perms xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="test--1870931913-1" ifmap-timestamp="2012-11-03T20:33:33+00:00">
                <uuid>
                  <uuid-mslong>10114780778358916900</uuid-mslong>
                  <uuid-lslong>13060168454144086900</uuid-lslong>
                </uuid>
                <created/>
                <last-modified/>
              </contrail:id-perms>
            </metadata>
          </resultItem>
          <resultItem>
            <identity other-type-definition="extended" type="other" name="contrail:virtual-machine:vm1"/>
            <metadata>
              <contrail:id-perms xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="test--1870931913-1" ifmap-timestamp="2012-11-03T20:33:33+00:00">
                <uuid>
                  <uuid-mslong>10114780778358916901</uuid-mslong>
                  <uuid-lslong>13060168454144086901</uuid-lslong>
                </uuid>
                <created/>
                <last-modified/>
              </contrail:id-perms>
            </metadata>
          </resultItem>
          <resultItem>
            <identity other-type-definition="extended" type="other" name="contrail:virtual-router:vr1"/>
            <identity other-type-definition="extended" type="other" name="contrail:virtual-machine:vm1"/>
            <metadata>
              <contrail:virtual-router-virtual-machine xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="test--1870931913-1" ifmap-timestamp="2012-11-03T20:33:33+00:00"/>
            </metadata>
          </resultItem>
        </updateResult>
	<deleteResult name="root">
          <resultItem>
            <identity other-type-definition="extended" type="other" name="contrail:virtual-router:vr1"/>
            <identity other-type-definition="extended" type="other" name="contrail:virtual-machine:vm1"/>
            <metadata>
              <contrail:virtual-router-virtual-machine xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="test--1870931913-1" ifmap-timestamp="2012-11-03T20:33:33+00:00"/>
            </metadata>
          </resultItem>
          <resultItem>
            <identity other-type-definition="extended" type="other" name="contrail:virtual-router:vr1"/>
            <metadata>
              <contrail:id-perms xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="test--1870931913-1" ifmap-timestamp="2012-11-03T20:33:33+00:00">
                <uuid>
                  <uuid-mslong>10114780778358916900</uuid-mslong>
                  <uuid-lslong>13060168454144086900</uuid-lslong>
                </uuid>
                <created/>
                <last-modified/>
              </contrail:id-perms>
            </metadata>
          </resultItem>
	</deleteResult>
      </pollResult>
    </ns2:response>
  </ns3:Body>
</ns3:Envelope>


text:
package com.ibm.javacore.collections.threadsafe;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class ThreadSafeDemo {
	public static int demo(final List list, final int testCount) throws InterruptedException {
		ThreadGroup group = new ThreadGroup(list.getClass().getName() + "@" + list.hashCode());
		final Random rand = new Random();

		Runnable listAppender = new Runnable() {
			public void run() {
				try {
					Thread.sleep(rand.nextInt(2));
				} catch (InterruptedException e) {
					return;
				}
				list.add("0");
			}
		};

		for (int i = 0; i < testCount; i++) {
			new Thread(group, listAppender, "InsertList-" + i).start();
		}

		while (group.activeCount() > 0) {
			Thread.sleep(10);
		}

		return list.size();
	}
	public static void main(String[] args) throws InterruptedException {
		List unsafeList = new ArrayList();
		List safeList = Collections.synchronizedList(new ArrayList());
		final int N = 10000;
		for (int i = 0; i < 10; i++) {
			unsafeList.clear();
			safeList.clear();
			int unsafeSize = demo(unsafeList, N);
			int safeSize = demo(safeList, N);
			System.out.println("unsafe/safe: " + unsafeSize + "/" + safeSize);
		}
	}
}


text:
package com.javarush.task.task14.task1409;

/**
 * Created by Sukora Stas.
 */
public class WaterBridge implements Bridge {
    @Override
    public int getCarsCount() {
        return 189;
    }
}


text: rubygem.me personal site


text:
import ClusterFeatureLayer from "./ClusterFeatureLayer";
import Collection from "esri/core/Collection";
import Sublayer from "esri/layers/support/Sublayer";

export default class ClusterFeatureLayerTypeFactory {

    constructor() {
        this._clusterLayers = [];
    }

    create(layerArguments) {
        const opt = layerArguments.options;
        let showSpiderfying = true;
        if (opt.showSpiderfying !== undefined) {
            showSpiderfying = opt.showSpiderfying;
        }
        const clusterFeatureLayer = new ClusterFeatureLayer({
            i18n: this._i18n.get(),
            id: layerArguments.id,
            title: layerArguments.title,
            visible: layerArguments.visible,
            minScale: layerArguments.minScale,
            maxScale: layerArguments.maxScale,
            listMode: layerArguments.listMode,
            opacity: layerArguments.opacity,
            elevationInfo: layerArguments.elevationInfo,
            popupTemplate: layerArguments.popupTemplate,
            maptipTemplate: layerArguments.maptipTemplate,
            maptipEnabled: layerArguments.maptipEnabled,
            expanded: layerArguments.expanded,
            legendEnabled: false,
            popupEnabled: false,
            _objectIdField: opt.objectIdField || "objectid",
            _clusterDistance: opt.clusterDistance || 100,
            _spiderfyingDistance: opt.spiderfyingDistance || 1,
            _maxClusterScale: opt.maxClusterScale || 0,
            _showClusterArea: opt.showClusterArea || false,
            _showSpiderfying: showSpiderfying,
            _zoomOnClusterClick: opt.zoomOnClusterClick,
            _returnLimit: opt.returnLimit || 1000,
            _options: opt,
            _serverRequester: this._serverRequester,
            _mapWidgetModel: this.mapWidgetModel,
            _clusterSymbolProvider: this.clusterSymbolProvider,
            _featureSymbolProvider: this.featureSymbolProvider,
            _clusterPopupWidgetFactory: this._clusterPopupWidgetFactory,
            _eventService: this.eventService
        });

        this.layers = [];
        if (layerArguments.layers) {
            layerArguments.layers.forEach((layer) => {
                layer.sublayers.forEach((children) => {
                    const childrenVisible = children.visible === undefined ? true : children.visible;
                    const sublayer = new Sublayer({
                        layerId: layer.id,
                        sublayerId: children.id,
                        layer: clusterFeatureLayer,
                        parent: clusterFeatureLayer,
                        layerUrl: layer.url,
                        title: children.title || children.id,
                        visible: childrenVisible,
                        popupTemplate: children.popupTemplate
                    });
                    this.layers.push(sublayer);
                });
            });
        }
        const sublayers = new Collection(this.layers).reverse();
        clusterFeatureLayer.sublayers = sublayers;
        clusterFeatureLayer.allSublayers = sublayers;
        clusterFeatureLayer.activateLayer();

        this._clusterLayers.push(clusterFeatureLayer);
        return {instance: clusterFeatureLayer};
    }

    setMapWidgetModel(mapWidgetModel) {
        this.mapWidgetModel = mapWidgetModel;
        this._clusterLayers.forEach((clusterLayer) => {
            clusterLayer.setMapWidgetModel(mapWidgetModel);
            clusterLayer.activateLayer();
        })
    }
}


text:
package com.uchoice.ucenter.role;

/**
 * Hello world!
 *
 */
public class App
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
    }
}


text:
#pragma once

#include "pybind11.h"
#include <complex>

/// glibc defines I as a macro which breaks things, e.g., boost template names
#ifdef I
#  undef I
#endif

NAMESPACE_BEGIN(pybind11)

PYBIND11_DECL_FMT(std::complex<float>, "Zf");
PYBIND11_DECL_FMT(std::complex<double>, "Zd");

NAMESPACE_BEGIN(detail)
template <typename T> class type_caster<std::complex<T>> {
public:
    bool load(handle src, bool) {
        if (!src)
            return false;
        Py_complex result = PyComplex_AsCComplex(src.ptr());
        if (result.real == -1.0 && PyErr_Occurred()) {
            PyErr_Clear();
            return false;
        }
        value = std::complex<T>((T) result.real, (T) result.imag);
        return true;
    }

    static handle cast(const std::complex<T> &src, return_value_policy /* policy */, handle /* parent */) {
        return PyComplex_FromDoubles((double) src.real(), (double) src.imag());
    }

    PYBIND11_TYPE_CASTER(std::complex<T>, _("complex"));
};
NAMESPACE_END(detail)
NAMESPACE_END(pybind11)


text:
package org.drools.workbench.screens.guided.dtable.backend.server.conversion;

import java.text.MessageFormat;
import java.util.List;
import java.util.Objects;

import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.drools.workbench.models.datamodel.rule.Attribute;
import org.drools.workbench.models.datamodel.workitems.PortableParameterDefinition;
import org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition;
import org.drools.workbench.models.guided.dtable.shared.model.ActionCol52;
import org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52;
import org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52;
import org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52;
import org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52;
import org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52;
import org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52;
import org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BRLConditionVariableColumn;
import org.drools.workbench.models.guided.dtable.shared.model.BaseColumn;
import org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52;
import org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52;
import org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;
import org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52;
import org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52;
import org.drools.workbench.models.guided.dtable.shared.model.RuleNameColumn;
import org.drools.workbench.screens.guided.dtable.backend.server.conversion.util.ColumnContext;
import org.kie.soup.commons.validation.PortablePreconditions;
import org.kie.soup.project.datamodel.oracle.PackageDataModelOracle;

import static org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint.TYPE_PREDICATE;
import static org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint.TYPE_RET_VALUE;

public class SubHeaderBuilder {

    public static final String ACTION = "ACTION";
    public static final String METADATA = "METADATA";
    public static final String CONDITION = "CONDITION";

    private static final int COLUMN_TYPE_ROW = 5;
    private static final int FIELD_ROW = 7;
    private static final int HEADER_TITLE_ROW = 8;

    private final GuidedDecisionTable52 dtable;
    private final XLSColumnUtilities columnUtilities;
    private final Row headerRow;
    private final Row fieldRow;
    private final Row headerTitleRow;

    private int targetColumnIndex = 0;
    private final BRLColumnSubHeaderProvider brlColumnSubHeaderProvider;
    private final ColumnContext columnContext;

    private int sourceColumnIndex = 0;

    public ColumnContext getColumnContext() {
        return columnContext;
    }

    public Row getFieldRow() {
        return fieldRow;
    }

    public int getTargetColumnIndex() {
        return targetColumnIndex;
    }

    public SubHeaderBuilder(final Sheet sheet,
                            final GuidedDecisionTable52 dtable,
                            final PackageDataModelOracle dmo,
                            final ColumnContext columnContext) {
        PortablePreconditions.checkNotNull("sheet", sheet);
        this.dtable = PortablePreconditions.checkNotNull("dtable", dtable);
        this.columnContext = PortablePreconditions.checkNotNull("brlColumnIndex", columnContext);
        brlColumnSubHeaderProvider = new BRLColumnSubHeaderProvider(this,
                                                                    columnContext);
        this.columnUtilities = new XLSColumnUtilities(dtable,
                                                      PortablePreconditions.checkNotNull("dmo", dmo),
                                                      false);

        this.headerRow = sheet.createRow(COLUMN_TYPE_ROW);
        this.fieldRow = sheet.createRow(FIELD_ROW);
        this.headerTitleRow = sheet.createRow(HEADER_TITLE_ROW);
    }

    public void build() {

        final List<BaseColumn> expandedColumns = dtable.getExpandedColumns();

        for (; sourceColumnIndex < expandedColumns.size(); sourceColumnIndex++) {

            final BaseColumn baseColumn = expandedColumns.get(sourceColumnIndex);

            if (baseColumn instanceof AttributeCol52) {
                addAttribute((AttributeCol52) baseColumn);
            } else if (baseColumn instanceof MetadataCol52) {
                addMetadata((MetadataCol52) baseColumn);
            } else if (baseColumn instanceof BRLConditionVariableColumn) {
                final BRLConditionColumn brlColumn = dtable.getBRLColumn((BRLConditionVariableColumn) baseColumn);
                addBRLConditionColumn(brlColumn);
                sourceColumnIndex = sourceColumnIndex + brlColumn.getChildColumns().size() - 1;
            } else if (baseColumn instanceof BRLActionVariableColumn) {
                final BRLActionColumn brlColumn = dtable.getBRLColumn((BRLActionVariableColumn) baseColumn);
                addBRLActionColumn(brlColumn);
                sourceColumnIndex = sourceColumnIndex + brlColumn.getChildColumns().size() - 1;
            } else if (baseColumn instanceof ConditionCol52) {
                addCondition((ConditionCol52) baseColumn);
            } else if (baseColumn instanceof ActionCol52) {
                addAction((ActionCol52) baseColumn);
            } else if (baseColumn instanceof RowNumberCol52 || baseColumn instanceof RuleNameColumn) {
                // Ignore and do not add to count
                continue;
            } else if (baseColumn instanceof DescriptionCol52) {
                // This is actually a column, but header is not written down in XLS
            } else {
                throw new IllegalArgumentException("TODO REMOTE THIS");
            }
            incrementTargetIndex();
        }
    }

    public void incrementTargetIndex() {
        targetColumnIndex++;
    }

    private void addBRLConditionColumn(final BRLConditionColumn brlColumn) {
        brlColumnSubHeaderProvider.getBRLColumnSubHeaderBuilder(dtable,
                                                                brlColumn);
    }

    private void addBRLActionColumn(final BRLActionColumn brlColumn) {
        brlColumnSubHeaderProvider.getBRLColumnSubHeaderBuilder(dtable,
                                                                brlColumn);
    }

    public void addAction(final ActionCol52 baseColumn) {

        if (baseColumn instanceof ActionWorkItemSetFieldCol52) {
            addWorkItemSetField((ActionWorkItemSetFieldCol52) baseColumn);
        } else if (baseColumn instanceof ActionSetFieldCol52) {
            addSetField((ActionSetFieldCol52) baseColumn);
        } else if (baseColumn instanceof ActionInsertFactCol52) {
            addInsert(baseColumn.getHeader(),
                      ((ActionInsertFactCol52) baseColumn).getBoundName(),
                      ((ActionInsertFactCol52) baseColumn).getFactType(),
                      ((ActionInsertFactCol52) baseColumn).getFactField());
        } else if (baseColumn instanceof ActionWorkItemCol52) {
            addWorkItem((ActionWorkItemCol52) baseColumn);
        } else if (baseColumn instanceof ActionRetractFactCol52) {
            addRetract((ActionRetractFactCol52) baseColumn);
        }
    }

    public void addHeaderAndTitle(final String title,
                                  final String header) {
        headerRow.createCell(targetColumnIndex)
                .setCellValue(title);

        headerTitleRow.createCell(targetColumnIndex)
                .setCellValue(header);
    }

    private void addWorkItem(final ActionWorkItemCol52 column) {

        final PortableWorkDefinition workItemDefinition = column.getWorkItemDefinition();

        final String wimManagerName = getWorkItemManagerVariableName(workItemDefinition.getName());
        final String wiParamName = getWorkItemParameterVariableName(workItemDefinition.getName());
        final StringBuilder builder = new StringBuilder();
        for (final PortableParameterDefinition parameterDefinition : workItemDefinition.getParameters()) {

            builder.append(wiParamName);
            builder.append(".getParameters().put(");
            builder.append("\"");
            builder.append(parameterDefinition.getName());
            builder.append("\", ");
            builder.append(parameterDefinition.asString());
            builder.append(");\n");
        }
        final String format = MessageFormat.format("org.drools.core.process.instance.WorkItemManager {0} = (org.drools.core.process.instance.WorkItemManager) drools.getWorkingMemory().getWorkItemManager();\n" +
                                                           "org.drools.core.process.instance.impl.WorkItemImpl {1} = new org.drools.core.process.instance.impl.WorkItemImpl();\n" +
                                                           "{1}.setName( \"{2}\" );\n" +
                                                           "{3}" +
                                                           "{0}.internalExecuteWorkItem( {1} );",
                                                   wimManagerName,
                                                   wiParamName,
                                                   workItemDefinition.getName(),
                                                   builder.toString());

        addHeaderAndTitle(ACTION,
                          column.getHeader());
        fieldRow.createCell(targetColumnIndex).setCellValue(format);
    }

    private String getWorkItemParameterVariableName(final String name) {
        return String.format("wi%sParameter", name);
    }

    private String getWorkItemManagerVariableName(final String name) {
        return String.format("wi%sManager", name);
    }

    private void addRetract(final ActionRetractFactCol52 column) {

        addHeaderAndTitle(ACTION,
                          column.getHeader());
        fieldRow.createCell(targetColumnIndex).setCellValue("retract( $param );");
    }

    /**
     * @return true if an insert was created.
     */
    public boolean addInsert(final String header,
                             final String boundName,
                             final String factType,
                             final String factField) {
        boolean madeInsert = false;

        if (columnContext.isBoundNameFree(boundName)) {
            madeInsert = true;

            addHeaderAndTitle(ACTION,
                              "");

            fieldRow.createCell(targetColumnIndex).setCellValue(MessageFormat.format("{0} {1} = new {2}(); insert( {1} );",
                                                                                factType,
                                                                                boundName,
                                                                                factType));

            columnContext.addBoundName(boundName);
            incrementTargetIndex();
        }

        addHeaderAndTitle(ACTION,
                          header);

        fieldRow.createCell(targetColumnIndex).setCellValue(addSetMethod(boundName,
                                                                         factField,
                                                                         "$param"));
        return madeInsert;
    }

    private void addSetField(final ActionSetFieldCol52 column) {

        addSetField(column,
                    "$param");
    }

    private void addWorkItemSetField(final ActionWorkItemSetFieldCol52 column) {

        addSetField(column,
                    String.format("(%s) %s.getResult( \"Result\" )",
                                  getColumnDataType(sourceColumnIndex),
                                  getWorkItemParameterVariableName(column.getWorkItemName())));
    }

    private void addSetField(final ActionSetFieldCol52 column,
                             final String value) {

        addHeaderAndTitle(ACTION,
                          column.getHeader());
        fieldRow.createCell(targetColumnIndex).setCellValue(addSetMethod(column.getBoundName(),
                                                                         column.getFactField(),
                                                                         value));
    }

    public void addCondition(final ConditionCol52 column) {

        addHeaderAndTitle(CONDITION,
                          column.getHeader());

        if (column.getConstraintValueType() == TYPE_PREDICATE) {

            if (column.getFactField().contains("$param")) {

                fieldRow.createCell(targetColumnIndex).setCellValue(String.format("eval( %s )",
                                                                                column.getFactField()));
            } else {

                fieldRow.createCell(targetColumnIndex).setCellValue(String.format("eval( %s )",
                                                                                "$param"));
            }
        } else if (column.getBinding() == null || column.getBinding().trim().isEmpty()) {
            fieldRow.createCell(targetColumnIndex).setCellValue(String.format(getTemplate(column.getConstraintValueType()),
                                                                              column.getFactField(),
                                                                              getOperator(column)));
        } else {
            fieldRow.createCell(targetColumnIndex).setCellValue(String.format(getTemplateWithBinds(column.getConstraintValueType()),
                                                                              column.getBinding(),
                                                                              column.getFactField(),
                                                                              getOperator(column)));
        }
    }

    private String getTemplate(final int constraintValueType) {
        if (constraintValueType == TYPE_RET_VALUE) {
            return "%s %s ( $param )";
        } else {
            return "%s %s $param";
        }
    }

    private String getTemplateWithBinds(final int constraintValueType) {
        if (constraintValueType == TYPE_RET_VALUE) {
            return "%s : %s %s ( $param )";
        } else {
            return "%s : %s %s $param";
        }
    }

    private String getOperator(final ConditionCol52 column) {
        if (Objects.equals("== null", column.getOperator())) {
            return "==";
        } else if (Objects.equals("!= null", column.getOperator())) {
            return "!=";
        } else {
            return column.getOperator();
        }
    }

    private void addAttribute(final AttributeCol52 column) {
        if (Objects.equals(Attribute.NEGATE_RULE.getAttributeName(), column.getAttribute())) {
            throw new UnsupportedOperationException("Conversion of the negate attribute is not supported.");
        } else {
            headerRow.createCell(targetColumnIndex)
                    .setCellValue(getAttribute(column));
        }
    }

    private String getAttribute(final AttributeCol52 column) {

        if (Objects.equals(Attribute.SALIENCE.getAttributeName(), column.getAttribute())) {
            return "PRIORITY";
        } else {
            return column.getAttribute().toUpperCase();
        }
    }

    private void addMetadata(final MetadataCol52 column) {

        addHeaderAndTitle(METADATA,
                          column.getHeader());

        fieldRow.createCell(targetColumnIndex).setCellValue(String.format("%s( $param )",
                                                                          column.getMetadata()));
    }

    private String addSetMethod(final String boundName,
                                final String factField,
                                final String value) {
        return String.format("%s.set%s%s( %s );",
                             boundName,
                             factField.substring(0, 1).toUpperCase(),
                             factField.substring(1),
                             value);
    }

    private String getColumnDataType(final int columnIndex) {
        return columnUtilities.getType(dtable.getExpandedColumns().get(columnIndex));
    }
}


text:
import Inquiry from '../db/models/inquiry'
import User from '../db/models/user'

export default {
  dashboardGet: (req, res, next) => {
    if (req.params.userId) {
      User.getUserById(req.params.userId)
        .then(user => {
          Inquiry.getAllInquiriesForUser(req.params.userId)
            .then(inquiries => {
              user.inquiries = inquiries
              User.getUserSavedTrips(req.params.userId)
                .then(savedTrips => {
                  user.savedTrips = savedTrips
                  User.getUserPostedTrips(req.params.userId)
                    .then(postedTrips => {
                      user.postedTrips = postedTrips
                      User.getUserUpvotedTrips(req.params.userId)
                        .then(upvotedTrips => {
                          user.upVotedTrips = upvotedTrips
                          User.getUserDownvotedTrips(req.params.userId)
                            .then(downvotedTrips => {
                              user.downVotedTrips = downvotedTrips
                              res.json(user)
                            })
                        })
                        .catch(error => {
                          next(error)
                        })
                    })
                    .catch(error => {
                      next(error)
                    })
                })
                .catch(error => {
                  next(error)
                })
            })
            .catch(error => {
              next(error)
            })
        })
    }
  }
}


text:
<?php

/* forms/fields/pages/pages.html.twig */
class __TwigTemplate_6f02429115944eab9b4b4ce7f97b23c224016d4818efa3a288821980c4095b40 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 1
        $this->parent = $this->loadTemplate("forms/field.html.twig", "forms/fields/pages/pages.html.twig", 1);
        $this->blocks = array(
            'global_attributes' => array($this, 'block_global_attributes'),
            'input' => array($this, 'block_input'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "forms/field.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 32
    public function block_global_attributes($context, array $blocks = array())
    {
        // line 33
        echo "    data-grav-selectize=\"";
        echo twig_escape_filter($this->env, twig_jsonencode_filter((($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "selectize", array(), "any", true, true)) ? ($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "selectize", array())) : (array()))), "html_attr");
        echo "\"
    data-grav-field=\"select\"
    data-grav-disabled=\"";
        // line 35
        echo (((null === (isset($context["originalValue"]) ? $context["originalValue"] : null))) ? ("true") : ("false"));
        echo "\"
    data-grav-default=\"";
        // line 36
        echo twig_escape_filter($this->env, twig_jsonencode_filter($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "default", array())), "html_attr");
        echo "\"
";
    }

    // line 39
    public function block_input($context, array $blocks = array())
    {
        // line 40
        echo "
getAttribute((isset($context["field"]) ? $context["field"] : null), "size", array());
        echo "\">
        <select class=\"";
        // line 41
        echo $this->getAttribute((isset($context["field"]) ? $context["field"] : null), "classes", array());
        echo "\" name=\"";
        echo ($this->env->getExtension('GravTwigExtension')->fieldNameFilter(((isset($context["scope"]) ? $context["scope"] : null) . $this->getAttribute((isset($context["field"]) ? $context["field"] : null), "name", array()))) . (($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "multiple", array())) ? ("[]") : ("")));
        echo "\"
                ";
        // line 42
        if (twig_in_filter($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "autofocus", array()), array(0 => "on", 1 => "true", 2 => 1))) {
            echo "autofocus=\"autofocus\"";
        }
        // line 43
        echo "                ";
        if (twig_in_filter($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "novalidate", array()), array(0 => "on", 1 => "true", 2 => 1))) {
            echo "novalidate=\"novalidate\"";
        }
        // line 44
        echo "                ";
        if (twig_in_filter($this->getAttribute($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) {
            echo "required=\"required\"";
        }
        // line 45
        echo "                ";
        if (twig_in_filter($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "multiple", array()), array(0 => "on", 1 => "true", 2 => 1))) {
            echo "multiple=\"multiple\"";
        }
        // line 46
        echo "                >
            ";
        // line 47
        echo $this->getAttribute($this, "options", array(0 => (isset($context["field"]) ? $context["field"] : null), 1 => (isset($context["pages"]) ? $context["pages"] : null), 2 => (isset($context["value"]) ? $context["value"] : null), 3 => 0), "method");
        echo "
        </select>

";
    }

    // line 3
    public function getoptions($__field__ = null, $__pages__ = null, $__value__ = null, $__depth__ = null)
    {
        $context = $this->env->mergeGlobals(array(
            "field" => $__field__,
            "pages" => $__pages__,
            "value" => $__value__,
            "depth" => $__depth__,
            "varargs" => func_num_args() > 4 ? array_slice(func_get_args(), 4) : array(),
        ));

        $blocks = array();

        ob_start();
        try {
            // line 4
            echo "
    ";
            // line 5
            if (($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "options", array()) && ((isset($context["depth"]) ? $context["depth"] : null) == 0))) {
                // line 6
                echo "        ";
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "options", array()));
                foreach ($context['_seq'] as $context["key"] => $context["value"]) {
                    // line 7
                    echo "            <option value=\"";
                    echo twig_escape_filter($this->env, $context["key"], "html_attr");
                    echo "\">";
                    echo $this->env->getExtension('GravTwigExtension')->translate($context["value"]);
                    echo "</option>
        ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['key'], $context['value'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 9
                echo "    ";
            }
            // line 10
            echo "
    ";
            // line 11
            if (($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "show_root", array()) && ((isset($context["depth"]) ? $context["depth"] : null) == 0))) {
                // line 12
                echo "        <option value=\"/\">/ (Root)</option>
        ";
                // line 13
                $context["depth"] = ((isset($context["depth"]) ? $context["depth"] : null) + 1);
                // line 14
                echo "    ";
            }
            // line 15
            echo "
    ";
            // line 16
            $context["indent"] = ((((isset($context["depth"]) ? $context["depth"] : null) == 0)) ? ("") : (($this->env->getExtension('GravTwigExtension')->repeatFunc("-", (isset($context["depth"]) ? $context["depth"] : null)) . " ")));
            // line 17
            echo "
    ";
            // line 18
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["pages"]) ? $context["pages"] : null), "children", array()));
            foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
                // line 19
                echo "        ";
                if (($this->getAttribute($context["page"], "routable", array(), "method") || $this->getAttribute((isset($context["field"]) ? $context["field"] : null), "show_all", array()))) {
                    // line 20
                    echo "            <option ";
                    if (($this->getAttribute($context["page"], "route", array()) == (isset($context["value"]) ? $context["value"] : null))) {
                        echo "selected=\"selected\"";
                    }
                    echo " value=\"";
                    echo $this->getAttribute($context["page"], "route", array());
                    echo "\">
                ";
                    // line 21
                    echo (isset($context["indent"]) ? $context["indent"] : null);
                    echo " ";
                    echo $this->getAttribute($context["page"], "menu", array());
                    echo "
            </option>
        ";
                }
                // line 24
                echo "        ";
                if (((twig_length_filter($this->env, $this->getAttribute($context["page"], "children", array())) > 0) && ($this->getAttribute((isset($context["field"]) ? $context["field"] : null), "show_modular", array()) ||  !$this->getAttribute($context["page"], "modular", array(), "method")))) {
                    // line 25
                    echo "
            ";
                    // line 26
                    echo $this->getAttribute($this, "options", array(0 => (isset($context["field"]) ? $context["field"] : null), 1 => $context["page"], 2 => (isset($context["value"]) ? $context["value"] : null), 3 => ((isset($context["depth"]) ? $context["depth"] : null) + 1)), "method");
                    echo "

        ";
                }
                // line 29
                echo "    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
        } catch (Exception $e) {
            ob_end_clean();

            throw $e;
        }

        return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
    }

    public function getTemplateName()
    {
        return "forms/fields/pages/pages.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  188 => 29,  182 => 26,  179 => 25,  176 => 24,  168 => 21,  159 => 20,  156 => 19,  152 => 18,  149 => 17,  147 => 16,  144 => 15,  141 => 14,  139 => 13,  136 => 12,  134 => 11,  131 => 10,  128 => 9,  117 => 7,  112 => 6,  110 => 5,  107 => 4,  92 => 3,  84 => 47,  81 => 46,  76 => 45,  71 => 44,  66 => 43,  62 => 42,  56 => 41,  51 => 40,  48 => 39,  42 => 36,  38 => 35,  32 => 33,  29 => 32,  11 => 1,);
    }
}
/* {% extends "forms/field.html.twig" %}*/
/* */
/* {% macro options(field, pages, value, depth) %}*/
/* */
/*     {% if field.options and depth == 0 %}*/
/*         {% for key, value in field.options %}*/
/*             <option value="{{ key|e('html_attr') }}">{{ value|t }}</option>*/
/*         {% endfor %}*/
/*     {% endif %}*/
/*     */
/*     {% if field.show_root and depth == 0 %}*/
/*         <option value="/">/ (Root)</option>*/
/*         {% set depth = depth +1 %}*/
/*     {% endif %}*/
/* */
/*     {% set indent = depth == 0 ? '' : repeat('-',depth) ~ ' ' %}*/
/* */
/*     {% for page in pages.children %}*/
/*         {% if page.routable() or field.show_all  %}*/
/*             <option {% if page.route == value %}selected="selected"{% endif %} value="{{ page.route }}">*/
/*                 {{indent}} {{ page.menu }}*/
/*             </option>*/
/*         {% endif %}*/
/*         {% if page.children|length > 0 and (field.show_modular or not page.modular()) %}*/
/* */
/*             {{ _self.options(field, page,value, depth + 1) }}*/
/* */
/*         {% endif %}*/
/*     {% endfor %}*/
/* {% endmacro %}*/
/* */
/* {% block global_attributes %}*/
/*     data-grav-selectize="{{ (field.selectize is defined ? field.selectize : {})|json_encode()|e('html_attr') }}"*/
/*     data-grav-field="select"*/
/*     data-grav-disabled="{{ originalValue is null ? 'true' : 'false' }}"*/
/*     data-grav-default="{{ field.default|json_encode()|e('html_attr') }}"*/
/* {% endblock %}*/
/* */
/* {% block input %}*/
/*
*/
/*         <select class="{{ field.classes }}" name="{{ (scope ~ field.name)|fieldName ~ (field.multiple ? '[]' : '') }}"*/
/*                 {% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}*/
/*                 {% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}*/
/*                 {% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}*/
/*                 {% if field.multiple in ['on', 'true', 1] %}multiple="multiple"{% endif %}*/
/*                 >*/
/*             {{ _self.options(field,pages,value, 0) }}*/
/*         </select>*/
/*
*/
/* {% endblock %}*/
/* */
/* */


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Interface gov.nih.nci.cabig.caaers.domain.repository.OrganizationRepository
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
gov.nih.nci.cabig.caaers.domain.repository.OrganizationRepository

Packages that use OrganizationRepository

gov.nih.nci.cabig.caaers.api

gov.nih.nci.cabig.caaers.domain.repository

gov.nih.nci.cabig.caaers.service.migrator

gov.nih.nci.cabig.caaers.validation.annotation

gov.nih.nci.cabig.caaers.web.admin

gov.nih.nci.cabig.caaers.web.ae

gov.nih.nci.cabig.caaers.web.participant

gov.nih.nci.cabig.caaers.web.rule.notification

gov.nih.nci.cabig.caaers.web.search

gov.nih.nci.cabig.caaers.web.security

gov.nih.nci.cabig.caaers.web.study

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.api

Fields in gov.nih.nci.cabig.caaers.api declared as OrganizationRepository

protected  OrganizationRepository
AbstractImportService.organizationRepository

Methods in gov.nih.nci.cabig.caaers.api with parameters of type OrganizationRepository

 void
AbstractImportService.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.domain.repository

Classes in gov.nih.nci.cabig.caaers.domain.repository that implement OrganizationRepository

 class
OrganizationRepositoryImpl

          The Class OrganizationRepositoryImpl.

Methods in gov.nih.nci.cabig.caaers.domain.repository with parameters of type OrganizationRepository

 void
StudyRepository.setOrganizationRepository(OrganizationRepository organizationRepository)

          Sets the organization repository.

 void
ResearchStaffRepository.setOrganizationRepository(OrganizationRepository organizationRepository)

          Sets the organization repository.

 void
InvestigatorRepositoryImpl.setOrganizationRepository(OrganizationRepository organizationRepository)

          Sets the organization repository.

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.service.migrator

Methods in gov.nih.nci.cabig.caaers.service.migrator that return OrganizationRepository

 OrganizationRepository
StudyOrganizationMigrator.getOrganizationRepository()

 OrganizationRepository
IdentifierMigrator.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.service.migrator with parameters of type OrganizationRepository

 void
StudyParticipantAssignmentMigrator.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
StudyOrganizationMigrator.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
IdentifierMigrator.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.validation.annotation

Methods in gov.nih.nci.cabig.caaers.validation.annotation that return OrganizationRepository

 OrganizationRepository
UniqueNciIdentifierForOrganizationValidator.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.validation.annotation with parameters of type OrganizationRepository

 void
UniqueNciIdentifierForOrganizationValidator.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.web.admin

Fields in gov.nih.nci.cabig.caaers.web.admin declared as OrganizationRepository

protected  OrganizationRepository
UserController.organizationRepository

protected  OrganizationRepository
OrganizationController.organizationRepository

Methods in gov.nih.nci.cabig.caaers.web.admin that return OrganizationRepository

 OrganizationRepository
UserController.getOrganizationRepository()

 OrganizationRepository
UserAjaxFacade.getOrganizationRepository()

 OrganizationRepository
INDAjaxFacade.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.web.admin with parameters of type OrganizationRepository

 void
UserController.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
UserAjaxFacade.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
OrganizationImporter.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
OrganizationController.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
INDAjaxFacade.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
ImporterFactory.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.web.ae

Methods in gov.nih.nci.cabig.caaers.web.ae that return OrganizationRepository

 OrganizationRepository
RoutingAndReviewAjaxFacade.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.web.ae with parameters of type OrganizationRepository

 void
RoutingAndReviewAjaxFacade.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.web.participant

Methods in gov.nih.nci.cabig.caaers.web.participant that return OrganizationRepository

 OrganizationRepository
CreateParticipantTab.getOrganizationRepository()

 OrganizationRepository
CreateParticipantController.getOrganizationRepository()

 OrganizationRepository
CreateParticipantAjaxFacade.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.web.participant with parameters of type OrganizationRepository

 void
CreateParticipantTab.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
CreateParticipantController.setOrganizationRepository(OrganizationRepository organizationRepository)

 void
CreateParticipantAjaxFacade.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.web.rule.notification

Methods in gov.nih.nci.cabig.caaers.web.rule.notification with parameters of type OrganizationRepository

 void
ReportDefinitionAjaxFacade.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.web.search

Methods in gov.nih.nci.cabig.caaers.web.search that return OrganizationRepository

 OrganizationRepository
SearchStudyAjaxFacade.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.web.search with parameters of type OrganizationRepository

 void
SearchStudyAjaxFacade.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.web.security

Methods in gov.nih.nci.cabig.caaers.web.security that return OrganizationRepository

 OrganizationRepository
FabricatedAuthenticationFilter.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.web.security with parameters of type OrganizationRepository

 void
FabricatedAuthenticationFilter.setOrganizationRepository(OrganizationRepository organizationRepository)

Uses of OrganizationRepository in gov.nih.nci.cabig.caaers.web.study

Methods in gov.nih.nci.cabig.caaers.web.study that return OrganizationRepository

 OrganizationRepository
CreateStudyAjaxFacade.getOrganizationRepository()

Methods in gov.nih.nci.cabig.caaers.web.study with parameters of type OrganizationRepository

 void
CreateStudyAjaxFacade.setOrganizationRepository(OrganizationRepository organizationRepository)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormAssembler
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FormAssembler))
        Me.rtbSrc = New System.Windows.Forms.RichTextBox()
        Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
        Me.FileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.NewSourceFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.LoadSourceFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.SaveSourceFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ExitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.AssemblerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.AssembleAndSaveHEXFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.AssembleAndLoadProgramToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.MenuStrip1.SuspendLayout()
        Me.SuspendLayout()
        '
        'rtbSrc
        '
        Me.rtbSrc.BackColor = System.Drawing.Color.Black
        Me.rtbSrc.Dock = System.Windows.Forms.DockStyle.Fill
        Me.rtbSrc.Font = New System.Drawing.Font("Consolas", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.rtbSrc.ForeColor = System.Drawing.Color.Yellow
        Me.rtbSrc.Location = New System.Drawing.Point(0, 24)
        Me.rtbSrc.Name = "rtbSrc"
        Me.rtbSrc.Size = New System.Drawing.Size(784, 522)
        Me.rtbSrc.TabIndex = 0
        Me.rtbSrc.Text = ""
        Me.rtbSrc.WordWrap = False
        '
        'MenuStrip1
        '
        Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.AssemblerToolStripMenuItem})
        Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
        Me.MenuStrip1.Name = "MenuStrip1"
        Me.MenuStrip1.Size = New System.Drawing.Size(784, 24)
        Me.MenuStrip1.TabIndex = 1
        Me.MenuStrip1.Text = "MenuStrip1"
        '
        'FileToolStripMenuItem
        '
        Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.NewSourceFileToolStripMenuItem, Me.LoadSourceFileToolStripMenuItem, Me.SaveSourceFileToolStripMenuItem, Me.ExitToolStripMenuItem})
        Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem"
        Me.FileToolStripMenuItem.Size = New System.Drawing.Size(123, 20)
        Me.FileToolStripMenuItem.Text = "Assembler Source File"
        '
        'NewSourceFileToolStripMenuItem
        '
        Me.NewSourceFileToolStripMenuItem.Name = "NewSourceFileToolStripMenuItem"
        Me.NewSourceFileToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
        Me.NewSourceFileToolStripMenuItem.Text = "New Source File"
        '
        'LoadSourceFileToolStripMenuItem
        '
        Me.LoadSourceFileToolStripMenuItem.Name = "LoadSourceFileToolStripMenuItem"
        Me.LoadSourceFileToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
        Me.LoadSourceFileToolStripMenuItem.Text = "Load Source File"
        '
        'SaveSourceFileToolStripMenuItem
        '
        Me.SaveSourceFileToolStripMenuItem.Name = "SaveSourceFileToolStripMenuItem"
        Me.SaveSourceFileToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
        Me.SaveSourceFileToolStripMenuItem.Text = "Save Source File"
        '
        'ExitToolStripMenuItem
        '
        Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
        Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
        Me.ExitToolStripMenuItem.Text = "Exit"
        '
        'AssemblerToolStripMenuItem
        '
        Me.AssemblerToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AssembleAndSaveHEXFileToolStripMenuItem, Me.AssembleAndLoadProgramToolStripMenuItem})
        Me.AssemblerToolStripMenuItem.Name = "AssemblerToolStripMenuItem"
        Me.AssemblerToolStripMenuItem.Size = New System.Drawing.Size(68, 20)
        Me.AssemblerToolStripMenuItem.Text = "Assembler"
        '
        'AssembleAndSaveHEXFileToolStripMenuItem
        '
        Me.AssembleAndSaveHEXFileToolStripMenuItem.Name = "AssembleAndSaveHEXFileToolStripMenuItem"
        Me.AssembleAndSaveHEXFileToolStripMenuItem.Size = New System.Drawing.Size(209, 22)
        Me.AssembleAndSaveHEXFileToolStripMenuItem.Text = "Assemble and Save HEX file"
        '
        'AssembleAndLoadProgramToolStripMenuItem
        '
        Me.AssembleAndLoadProgramToolStripMenuItem.Name = "AssembleAndLoadProgramToolStripMenuItem"
        Me.AssembleAndLoadProgramToolStripMenuItem.Size = New System.Drawing.Size(209, 22)
        Me.AssembleAndLoadProgramToolStripMenuItem.Text = "Assemble and Load Program"
        '
        'Timer1
        '
        Me.Timer1.Enabled = True
        Me.Timer1.Interval = 500
        '
        'FormAssembler
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(784, 546)
        Me.Controls.Add(Me.rtbSrc)
        Me.Controls.Add(Me.MenuStrip1)
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MainMenuStrip = Me.MenuStrip1
        Me.Name = "FormAssembler"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Assembler"
        Me.MenuStrip1.ResumeLayout(False)
        Me.MenuStrip1.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents rtbSrc As System.Windows.Forms.RichTextBox
    Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
    Friend WithEvents FileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents NewSourceFileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents LoadSourceFileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents SaveSourceFileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ExitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents AssemblerToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents AssembleAndSaveHEXFileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents AssembleAndLoadProgramToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
End Class


text:
namespace uc
{
    namespace math
    {
        namespace details
        {
            struct aligned_object
            {
                void operator () (void* d) const
                {
                    _aligned_free(d);
                }
            };
        }

        using managed_float4x4 = std::unique_ptr< math::float4x4, details::aligned_object >;

        inline managed_float4x4 make_float4x4()
        {
            math::float4x4* a = reinterpret_cast<float4x4*> (_aligned_malloc(sizeof(math::float4x4), 16));
            return managed_float4x4(a, details::aligned_object());
        }
    }
}


text:
{% extends "dashboard/base.html" %}
{% load i18n %}

{% block title %}{% trans "Delete image" %} - {{ block.super }}{% endblock %}

{% block body_class %}body-store body-products{% endblock %}

{% block header_menu %}
    {% url "dashboard:product-update" pk=product.pk as url %}
    {% include "dashboard/includes/_back-link.html" with url=url hash="#images" %}
{% endblock %}

{% block breadcrumbs %}

{% trans "Products" %}

{{ product }}

 {% trans "Delete image" %}

{% endblock %}

{% block content %}
    <form method="post">
        {% csrf_token %}
        <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">

{% trans "Are you sure you want to delete the following image?" %}

{{ product_image.alt }}

                 {% trans "Cancel" %}
                <button type="submit" class="btn materialize-red"> {% trans "Delete" %}</button>

    </form>
{% endblock %}


text:
namespace setup
{
	ReportDBManager* report_db_manager(const std::string& path)
	{
		return new FileReportDBManager(boost::filesystem::path(path));
	}
}


text:
<?php

namespace LIN3S\WPFoundation\PostTypes\Fields\Components;

/**
 * Abstract class of base custom fields components.
 * This class enforces that all the field components need to
 * construct by register method.
 *
 * @author Beñat Espiña <benatespina@gmail.com>
 * @author Gorka Laucirica <gorkalaucirica@gmail.com>
 */
abstract class FieldComponent
{
    /**
     * {@inheritdoc}
     */
    public static function register($aName, $aConnector)
    {
        if (method_exists(static::class, 'definition')) {
            $definition = static::definition($aName);
            $definition['location'] = $aConnector;
            acf_add_local_field_group($definition);
        } else {
            //@deprecated Will be removed in 2.0, and this class will implement FieldComponentInterface
            return new static($aName, $aConnector);
        }
    }

    /**
     * Constructor.
     *
     * @deprecated since version 1.4, will be removed in 2.0. Implement register() instead
     */
    protected function __construct()
    {
    }
}