text:
package org.alljoyn.bus.samples.contacts_client;

import org.alljoyn.bus.BusAttachment;
import org.alljoyn.bus.BusException;
import org.alljoyn.bus.BusListener;
import org.alljoyn.bus.Mutable;
import org.alljoyn.bus.ProxyBusObject;
import org.alljoyn.bus.SessionListener;
import org.alljoyn.bus.SessionOpts;
import org.alljoyn.bus.Status;

import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.provider.ContactsContract;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;

/*
 * This is a sample client that will receive information about the contacts stored on
 * the phone from a contacts service.
 */
public class ContactsClient extends Activity {
    static {
        System.loadLibrary("alljoyn_java");
    }

    private static final int DIALOG_CONTACT = 1;

    private static final int MESSAGE_DISPLAY_ALL_CONTACTS = 1;
    private static final int MESSAGE_DISPLAY_CONTACT = 2;
    private static final int MESSAGE_POST_TOAST = 3;
    private static final int MESSAGE_START_PROGRESS_DIALOG = 4;
    private static final int MESSAGE_STOP_PROGRESS_DIALOG = 5;

    private static final String TAG = "ContactsClient";

    private Button mGetContactsBtn;
    private ArrayAdapter<String> mContactsListAdapter;
    private ListView mContactsListView;
    private Menu menu;

    private Contact mAddressEntry;
    private NameId[] mContactNames;

    String mSingleName;
    int mSingleUserId;

    BusHandler mBusHandler;
    private ProgressDialog mDialog;

    private Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
            case MESSAGE_DISPLAY_ALL_CONTACTS:
                mContactNames = (NameId[]) msg.obj;
                /*
                 * Make sure the Contacts list is clear of any old information before filling the list.
                 */
                mContactsListAdapter.clear();

                /*
                 * Change the name of the button from "Get Contacts List" to "Update Contacts List"
                 */
                mGetContactsBtn.setText(getString(R.string.update_contacts));
                for (int i = 0; i < mContactNames.length; i++) {
                    mContactsListAdapter.add(mContactNames[i].displayName);
                }
                break;
            case MESSAGE_DISPLAY_CONTACT:
                mAddressEntry = (Contact) msg.obj;
                showDialog(DIALOG_CONTACT);
                break;
            case MESSAGE_POST_TOAST:
                Toast.makeText(getApplicationContext(), (String) msg.obj, Toast.LENGTH_LONG).show();
                break;
            case MESSAGE_START_PROGRESS_DIALOG:
                mDialog = ProgressDialog.show(ContactsClient.this,
                                              "",
                                              "Finding Contacts Service.\nPlease wait...",
                                              true,
                                              true);
                break;
            case MESSAGE_STOP_PROGRESS_DIALOG:
                mDialog.dismiss();
                break;
            default:
                break;
            }
        }
    };

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mContactsListAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
        mContactsListView = (ListView) findViewById(R.id.contact_list);
        mContactsListView.setAdapter(mContactsListAdapter);
        mContactsListView.setTextFilterEnabled(true);
        mContactsListView.setOnItemClickListener(new GetContactInformation());

        mGetContactsBtn = (Button) findViewById(R.id.get_contacts_btn);
        mGetContactsBtn.setOnClickListener(new GetContactsListener());

        mAddressEntry = new Contact();

        HandlerThread busThread = new HandlerThread("BusHandler");
        busThread.start();
        mBusHandler = new BusHandler(busThread.getLooper());
        mBusHandler.sendEmptyMessage(BusHandler.CONNECT);
        mHandler.sendEmptyMessage(MESSAGE_START_PROGRESS_DIALOG);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.mainmenu, menu);
        this.menu = menu;
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case R.id.quit:
            finish();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mBusHandler.sendEmptyMessage(BusHandler.DISCONNECT);
    }

    /**
     * Implementation of the OnClickListener attached to the "Get Contacts List"
     * "Update Contacts List"  button.  When clicked this will fill the
     * mcontactsListAdapter with an alphabetized list of all the contacts on
     * the phone.
     */
    private class GetContactsListener implements View.OnClickListener {
        public void onClick(View v) {
            mBusHandler.sendEmptyMessage(BusHandler.GET_ALL_CONTACT_NAMES);
        }
    }

    /**
     * Implementation of the OnItemClickListener for any item in the contacts
     * list.  The listener will use the the string from the list and use that
     * name to lookup an individual contact based on that name.
     */
    private class GetContactInformation implements AdapterView.OnItemClickListener {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Message msg = mBusHandler.obtainMessage(BusHandler.GET_CONTACT, mContactNames[position]);
            mBusHandler.sendMessage(msg);
        }
    }

    @Override
    protected Dialog onCreateDialog(int id) {
        Dialog dialog = null;
        try {
            switch (id) {
            case DIALOG_CONTACT: {
                dialog = new Dialog(ContactsClient.this);
                break;
            }
            default: {
                dialog = null;
                break;
            }
            }
        } catch (Throwable ex ) {
            Log.e(TAG, String.format("Throwable exception found"), ex);
        }
        return dialog;
    }

    @Override
    protected void onPrepareDialog(int id, Dialog dialog) {
        switch (id) {
        /*
         * build a dialog that show the contents of the an individual contact
         * This will dynamically build the dialog based on how much information
         * is known about the contact.
         */
        case DIALOG_CONTACT: {
            /*
             * Individual dialog elements
             */
            int PHONE_TABLE_OFFSET = 2; /* two columns before the phone numbers start */
            int EMAIL_TABLE_OFFSET = 1 + PHONE_TABLE_OFFSET + mAddressEntry.phone.length;

            /*
             * Reset the dialog to a known starting point
             */
            dialog.setContentView(R.layout.contact);
            dialog.setTitle(getString(R.string.contact_dialog_title));

            /*
             * Add the contact Name to the top of the table
             */
            TextView contactName = (TextView) dialog.findViewById(R.id.contact_name);
            contactName.setText(mAddressEntry.name);

            /*
             * Get the table layout so items can be added to it.
             */
            TableLayout contactTable = (TableLayout) dialog.findViewById(R.id.contact_table);

            /*
             * Add a phone number entry to the dialog displayed on screen for each phone number.
             */
            if (mAddressEntry.phone.length > 0) {
                for (int i = 0; i < mAddressEntry.phone.length; i++) {
                    insertPhoneToTable(contactTable, mAddressEntry.phone[i], i + PHONE_TABLE_OFFSET);
                }
            }

            /*
             * Add an email number entry to the dialog displayed on screen for each email address.
             */
            if (mAddressEntry.email.length > 0) {
                for (int i = 0; i < mAddressEntry.email.length; i++) {
                    insertEmailToTable(contactTable, mAddressEntry.email[i], i + EMAIL_TABLE_OFFSET);
                }
            }
            break;
        }
        default:
            break;
        }
    }

    /**
     * Insert a phone number into the table at the indicated position
     */
    private void insertPhoneToTable(TableLayout table, Contact.Phone phone, int position) {
        TableRow tr = new TableRow(getApplicationContext());
        TextView type = new TextView(getApplicationContext());
        type.setLayoutParams(new TableRow.LayoutParams(1));
        /*
         * If the phone type has a custom label use that label other wise pull
         * the type from the phone_types string array.
         */
        if (phone.type == ContactsContract.CommonDataKinds.Phone.TYPE_CUSTOM) {
            type.setText(phone.label);
        } else {
            Resources res = getResources();
            String[] phoneTypes = res.getStringArray(R.array.phone_types);
            type.setText(phoneTypes[phone.type]);
        }

        TextView number = new TextView(getApplicationContext());
        number.setText(phone.number);

        tr.addView(type);
        tr.addView(number);
        table.addView(tr, position);
    }

    /*
     * Insert an email address into the table at the indicated position
     */
    private void insertEmailToTable(TableLayout table, Contact.Email email, int position) {
        TableRow tr = new TableRow(getApplicationContext());
        TextView type = new TextView(getApplicationContext());
        type.setLayoutParams(new TableRow.LayoutParams(1));
        /*
         * if the email type has a custom label use that label other wise pull
         * the type from the email_types string array.
         */
        if (email.type == ContactsContract.CommonDataKinds.Email.TYPE_CUSTOM) {
            type.setText(email.label);
        } else {
            Resources res = getResources();
            String[] emailTypes = res.getStringArray(R.array.email_types);
            type.setText(emailTypes[email.type]);
        }

        TextView address = new TextView(getApplicationContext());
        address.setText(email.address);

        tr.addView(type);
        tr.addView(address);
        table.addView(tr, position);
    }

    /*
     * See the SimpleClient sample for a more complete description of the code used
     * to connect this code to the Bus
     */
    class BusHandler extends Handler {
        private static final String SERVICE_NAME = "org.alljoyn.bus.addressbook";
        private static final short CONTACT_PORT = 42;

        public static final int CONNECT = 1;
        public static final int DISCONNECT = 2;
        public static final int GET_CONTACT = 3;
        public static final int GET_ALL_CONTACT_NAMES = 4;
        public static final int JOIN_SESSION = 5;

        private BusAttachment mBus;
        private ProxyBusObject mProxyObj;
        private AddressBookInterface mAddressBookInterface;

        private int     mSessionId;
        private boolean mIsConnected;
        private boolean mIsStoppingDiscovery;

        public BusHandler(Looper looper) {
            super(looper);
            mIsConnected = false;
            mIsStoppingDiscovery = false;
        }

        @Override
        public void handleMessage(Message msg) {
            switch(msg.what) {
            case CONNECT: {
                org.alljoyn.bus.alljoyn.DaemonInit.PrepareDaemon(getApplicationContext());
                mBus = new BusAttachment(getPackageName(), BusAttachment.RemoteMessage.Receive);

                mBus.registerBusListener(new BusListener() {
                    @Override
                    public void foundAdvertisedName(String name, short transport, String namePrefix) {
                        logInfo(String.format("MyBusListener.foundAdvertisedName(%s, 0x%04x, %s)", name, transport, namePrefix));
                        /*
                         * This client will only join the first service that it sees advertising
                         * the indicated well-known name.  If the program is already a member of
                         * a session (i.e. connected to a service) we will not attempt to join
                         * another session.
                         * It is possible to join multiple session however joining multiple
                         * sessions is not shown in this sample.
                         */
                        if (! mIsConnected){
                            Message msg = obtainMessage(JOIN_SESSION, name);
                            sendMessage(msg);
                        }
                    }
                });

                Status status = mBus.connect();
                logStatus("BusAttachment.connect()", status);

                status = mBus.findAdvertisedName(SERVICE_NAME);
                logStatus(String.format("BusAttachement.findAdvertisedName(%s)", SERVICE_NAME), status);
                break;
            }
            case JOIN_SESSION: {
                if (mIsStoppingDiscovery) {
                    break;
                }

                short contactPort = CONTACT_PORT;
                SessionOpts sessionOpts = new SessionOpts();
                Mutable.IntegerValue sessionId = new Mutable.IntegerValue();

                Status status = mBus.joinSession((String) msg.obj, contactPort, sessionId, sessionOpts, new SessionListener(){
                    @Override
                    public void sessionLost(int sessionId, int reason) {
                        mIsConnected = false;
                        logInfo(String.format("MyBusListener.sessionLost(sessionId = %d, reason = %d)", sessionId, reason));
                        mHandler.sendEmptyMessage(MESSAGE_START_PROGRESS_DIALOG);
                    }
                });
                logStatus("BusAttachment.joinSession()", status);

                if (status == Status.OK) {
                    mProxyObj = mBus.getProxyBusObject(SERVICE_NAME, "/addressbook", sessionId.value,
                                                       new Class[] { AddressBookInterface.class });
                    mAddressBookInterface = mProxyObj.getInterface(AddressBookInterface.class);
                    mSessionId = sessionId.value;
                    mIsConnected = true;
                    mHandler.sendEmptyMessage(MESSAGE_STOP_PROGRESS_DIALOG);
                }
                break;
            }

            case DISCONNECT: {
                mIsStoppingDiscovery = true;
                if (mIsConnected) {
                    Status status = mBus.leaveSession(mSessionId);
                    logStatus("BusAttachment.leaveSession()", status);
                }
                mBus.disconnect();
                getLooper().quit();
                break;

            }
            // Call AddressBookInterface.getContact method and send the result to the UI handler.
            case GET_CONTACT: {
                if (mAddressBookInterface == null) {
                    break;
                }
                try {
                    NameId nameId = (NameId)msg.obj;
                    Contact reply = mAddressBookInterface.getContact(nameId.displayName, nameId.userId);
                    Message replyMsg = mHandler.obtainMessage(MESSAGE_DISPLAY_CONTACT, reply);
                    mHandler.sendMessage(replyMsg);
                } catch (BusException ex) {
                    logException("AddressBookInterface.getContact()", ex);
                }
                break;
            }
            // Call AddressBookInterface.getAllContactNames and send the result to the UI handler
            case GET_ALL_CONTACT_NAMES: {
                try {
                    NameId[] reply = mAddressBookInterface.getAllContactNames();
                    Message replyMsg = mHandler.obtainMessage(MESSAGE_DISPLAY_ALL_CONTACTS, (Object) reply);
                    mHandler.sendMessage(replyMsg);
                } catch (BusException ex) {
                    logException("AddressBookInterface.getAllContactNames()", ex);
                }
                break;
            }
            default:
                break;
            }
        }
    }

    private void logStatus(String msg, Status status) {
        String log = String.format("%s: %s", msg, status);
        if (status == Status.OK) {
            Log.i(TAG, log);
        } else {
            Message toastMsg = mHandler.obtainMessage(MESSAGE_POST_TOAST, log);
            mHandler.sendMessage(toastMsg);
            Log.e(TAG, log);
        }
    }

    private void logException(String msg, BusException ex) {
        String log = String.format("%s: %s", msg, ex);
        Message toastMsg = mHandler.obtainMessage(MESSAGE_POST_TOAST, log);
        mHandler.sendMessage(toastMsg);
        Log.e(TAG, log, ex);
    }

    private void logInfo(String msg) {
        Log.i(TAG, msg);
    }
}


text:
package de.jaide.courier.exception;

/**
 * Thrown if an expected parameter is missing.
 *
 * @author Rias A. Sherzad, JAIDE GmbH // http://www.jaide.de
 */
public class MissingParameterException extends RuntimeException {

  private static final long serialVersionUID = 8832065480539294718L;

  /**
   * Default constructor. Does nothing special, just looks good.
   */
  public MissingParameterException() {
    super();
  }

  /**
   * Creates a new MissingParameterException.
   *
   * @param message The message that yielded this Exception.
   * @param throwable The wrapped throwable.
   */
  public MissingParameterException(String message, Throwable throwable) {
    super(message, throwable);
  }

  /**
   * Creates a new MissingParameterException.
   *
   * @param message The message that yielded this Exception.
   */
  public MissingParameterException(String message) {
    super(message);
  }

  /**
   * Creates a new MissingParameterException.
   *
   * @param throwable The wrapped throwable.
   */
  public MissingParameterException(Throwable throwable) {
    super(throwable);
  }
}

redpajama_set_name: RedPajamaGithub


text:
@interface ABFlatSwitchKnobLayer : CALayer

@property (nonatomic) BOOL gripped;
@property (nonatomic) BOOL inset;

@end


text:
var methods = {
  destroy: function() {
    var $targetEls = this;

    return $targetEls.each(destroyPlugin);
  },

  init: function(options) {
    var $targetEls = this,
        targetElsLastIndex = $targetEls.length - 1,
        settings = $.extend({}, $.fn.scrollingTabs.defaults, options || {});

    // ---- tabs NOT data-driven -------------------------
    if (!settings.tabs) {

      // just wrap the selected .nav-tabs element(s) in the scroller
      return $targetEls.each(function(index) {
        var dataObj = {
              isWrapperOnly: true
            },
            $targetEl = $(this).data({ scrtabs: dataObj }),
            readyCallback = (index < targetElsLastIndex) ? null : function() {
              $targetEls.trigger(CONSTANTS.EVENTS.TABS_READY);
            };

        wrapNavTabsInstanceInScroller($targetEl, settings, readyCallback);
      });

    }

    // ---- tabs data-driven -------------------------
    return $targetEls.each(function (index) {
      var $targetEl = $(this),
          readyCallback = (index < targetElsLastIndex) ? null : function() {
            $targetEls.trigger(CONSTANTS.EVENTS.TABS_READY);
          };

      buildNavTabsAndTabContentForTargetElementInstance($targetEl, settings, readyCallback);
    });
  },

  refresh: function(options) {
    var $targetEls = this,
        settings = $.extend({}, $.fn.scrollingTabs.defaults, options || {});

    return $targetEls.each(function () {
      refreshTargetElementInstance($(this), settings);
    });
  },

  scrollToActiveTab: function() {
    return this.each(scrollToActiveTab);
  }
};

function destroyPlugin() {
  /* jshint validthis: true */
  var $targetElInstance = $(this),
      scrtabsData = $targetElInstance.data('scrtabs'),
      $tabsContainer;

  if (!scrtabsData) {
    return;
  }

  if (scrtabsData.enableSwipingElement === 'self') {
    $targetElInstance.removeClass(CONSTANTS.CSS_CLASSES.ALLOW_SCROLLBAR);
  } else if (scrtabsData.enableSwipingElement === 'parent') {
    $targetElInstance.closest('.scrtabs-tab-container').parent().removeClass(CONSTANTS.CSS_CLASSES.ALLOW_SCROLLBAR);
  }

  scrtabsData.scroller
    .off(CONSTANTS.EVENTS.DROPDOWN_MENU_SHOW)
    .off(CONSTANTS.EVENTS.DROPDOWN_MENU_HIDE);

  // if there were any dropdown menus opened, remove the css we added to
  // them so they would display correctly
  scrtabsData.scroller
    .find('[data-' + CONSTANTS.DATA_KEY_DDMENU_MODIFIED + ']')
    .css({
      display: '',
      left: '',
      top: ''
    })
    .off(CONSTANTS.EVENTS.CLICK)
    .removeAttr('data-' + CONSTANTS.DATA_KEY_DDMENU_MODIFIED);

  if (scrtabsData.scroller.hasTabClickHandler) {
    $targetElInstance
      .find('a[data-toggle="tab"]')
      .off('.scrtabs');
  }

  if (scrtabsData.isWrapperOnly) { // we just wrapped nav-tabs markup, so restore it
    // $targetElInstance is the ul.nav-tabs
    $tabsContainer = $targetElInstance.parents('.scrtabs-tab-container');

    if ($tabsContainer.length) {
      $tabsContainer.replaceWith($targetElInstance);
    }

  } else { // we generated the tabs from data so destroy everything we created
    if (scrtabsData.scroller && scrtabsData.scroller.initTabs) {
      scrtabsData.scroller.initTabs = null;
    }

    // $targetElInstance is the container for the ul.nav-tabs we generated
    $targetElInstance
      .find('.scrtabs-tab-container')
      .add('.tab-content')
      .remove();
  }

  $targetElInstance.removeData('scrtabs');

  while(--$.fn.scrollingTabs.nextInstanceId >= 0) {
    $(window).off(CONSTANTS.EVENTS.WINDOW_RESIZE + $.fn.scrollingTabs.nextInstanceId);
  }

  $('body').off(CONSTANTS.EVENTS.FORCE_REFRESH);
}

$.fn.scrollingTabs = function(methodOrOptions) {

  if (methods[methodOrOptions]) {
    return methods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));
  } else if (!methodOrOptions || (typeof methodOrOptions === 'object')) {
    return methods.init.apply(this, arguments);
  } else {
    $.error('Method ' + methodOrOptions + ' does not exist on $.scrollingTabs.');
  }
};

$.fn.scrollingTabs.nextInstanceId = 0;

$.fn.scrollingTabs.defaults = {
  tabs: null,
  propPaneId: 'paneId',
  propTitle: 'title',
  propActive: 'active',
  propDisabled: 'disabled',
  propContent: 'content',
  ignoreTabPanes: false,
  scrollToTabEdge: false,
  disableScrollArrowsOnFullyScrolled: false,
  forceActiveTab: false,
  reverseScroll: false,
  widthMultiplier: 1,
  tabClickHandler: null,
  cssClassLeftArrow: 'glyphicon glyphicon-chevron-left',
  cssClassRightArrow: 'glyphicon glyphicon-chevron-right',
  leftArrowContent: '',
  rightArrowContent: '',
  tabsLiContent: null,
  tabsPostProcessors: null,
  enableSwiping: false,
  enableRtlSupport: false,
  handleDelayedScrollbar: false,
  bootstrapVersion: 3
};


text:
QUnit.module("nxt.address");

QUnit.test("nxtAddress", function (assert) {
    var address = new NxtAddress();
    assert.equal(address.set("NXT-XK4R-7VJU-6EQG-7R335"), true, "valid address");
    assert.equal(address.toString(), "NXT-XK4R-7VJU-6EQG-7R335", "address");
    assert.equal(address.set("NXT-XK4R-7VJU-6EQG-7R336"), false, "invalid address");
});


text:
<?php
require_once("../config.php");

$catAdd = false;
$catUpd = false;
$catDel = false;

$category = new category();

if ($_POST['action'] == 'Save') {
    if (isset($_POST['hdIdAct'])) {
        if ($_POST['hdIdAct'] == ""){
            $category->save($company->id, $_POST['txtDescription']);
            $catAdd = true;
        }else{
            $category->open($_POST['hdIdAct']);
            $category->save($company->id, $_POST['txtDescription']);
            $catUpd = true;
        }
    }
}

if ($_POST['action'] == 'Delete') {
    if (isset($_POST['hdIdDE'])) {
        $category->open($_POST['hdIdDE']);
        $category->del();
        $catDel = true;
    }
}

$list_categories = $category->list_categories($company->id);
?>

<!DOCTYPE html>

        <meta charset="utf-8" />
        <link rel="shortcut icon" href="../img/icon.png">
        <title>Categories | FOMonitor</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="description" content="" />
        <meta name="author" content="stilearning" />

        <link href="http://fonts.googleapis.com/css?family=Aclonica:regular" rel="stylesheet" type="text/css" />

        <link href="../css/bootstrap.css" rel="stylesheet" />
        <link href="../css/bootstrap-responsive.css" rel="stylesheet" />
        <link href="../css/stilearn.css" rel="stylesheet" />
        <link href="../css/stilearn-responsive.css" rel="stylesheet" />
        <link href="../css/stilearn-helper.css" rel="stylesheet" />
        <link href="../css/stilearn-icon.css" rel="stylesheet" />
        <link href="../css/font-awesome.css" rel="stylesheet" />
        <link href="../css/animate.css" rel="stylesheet" />
        <link href="../css/uniform.default.css" rel="stylesheet" />

        <link href="../css/jquery.pnotify.default.css" rel="stylesheet" />
        <link href="../css/DT_bootstrap.css" rel="stylesheet" />
        <link href="../css/responsive-tables.css" rel="stylesheet" />

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
if($catAdd){
    echo '';
}else{
    echo '';
}

if($catUpd){
    echo '';
}else{
    echo '';
}

if($catDel){
    echo '';
}else{
    echo '';
}

?>

        <?php include("../includes/_header.php"); ?>

                <?php include("../includes/_left_menu.php"); ?>

                        <?php include("../includes/_header_users.php"); ?>

 Categories ›

List

                                <button type="button" class="close" data-dismiss="alert">×</button>
                                Done! Your category was created

                                <button type="button" class="close" data-dismiss="alert">×</button>
                                Done! Your category was updated

                                <button type="button" class="close" data-dismiss="alert">×</button>
                                Done! Your category was deleted

                                                ×

                                            Categories
                                            Add

                                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Information

                                                        <form class="form-horizontal" id="form-validate" action="" method="post" />

                                                                        Description

                                                                            <input name="hdIdAct" id="hdIdAct" type="hidden"/>
                                                                            <input type="text" id="txtDescription" name="txtDescription" class="grd-white" data-validate="{required: true, messages:{required:'Please enter field required'}}" name="required" id="required" />

                                                                        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
                                                                        <button class="btn btn-primary" id="btnSave" name="action" value="Save">Save</button>

                                                        </form>

                                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Delete Category

                                                        <form class="form-horizontal" id="form-validate" action="" method="post" />
                                                            <input name="hdIdDE" id="hdIdDE" type="hidden"/>

                                                                Are you sure?

                                                            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
                                                            <button class="btn btn-primary" id="btnDelete" name="action" value="Delete">Delete</button>

                                                        </form>

                                                        Id
                                                        Description
                                                        Code
                                                        Actions

                                                    <?php foreach ($list_categories as $item) { ?>

                                                            <?php echo $item->id; ?><input name="hdId" type="hidden" value="<?php echo $item->id; ?>"/>
                                                            <?php echo $item->description; ?><input name="hdDesc" type="hidden" value="<?php echo $item->description; ?>"/>
                                                            <?php echo $item->code; ?>

                                                                Edit
                                                                Delete

                                                    <?php } ?>

                <?php include("../includes/_right_menu.php"); ?>

        <?php include("../includes/_footer.php"); ?>


text:
title: Other Offices
layout: post
categories:
    - chattanooga
excerpt: |
    There are other offices and elected officials in city government other than the mayor and City Council.
ocdid: /country:us/state:tn/place:chattanooga/citywide
---

There are other offices and elected officials in city government other than the mayor and City Council members.

### City Judges

Chattanooga's court system consists of of two city judges. They serve eight-year terms and are elected in citywide elections. They are not term-limited.

Judges Russell Bean and Sherry Patty were last re-elected in May 2014.

City judges preside over cases involving violations of City Code, as well as some criminal misdemenors within the city's jurisdiction. Examples of code violations include parking and traffic violations, cases involving animal control, and public nuisances.

### Office of City Attorney

Chattanooga's city attorney is appointed by the mayor. The city attorney's office serves the mayor, his administration and the City Council. The city attorney provides legal advice, drafts legislative language and defends the city in litigation.

### Office of Internal Audit

Chattanooga's auditor provides independent review of city functions, contracts and financial records. The auditor is appointed by an audit committee.


text:
src
    Client
        ...ALL client side stuff
        index.html
    Docs
        index.html
    Config
        BaseConfig
        AppConfig
        CacheConfig
        DbConfig
        SqlLogConfig
    Server
        Common
            Request
            Response
            Context
        Core
            Webserver (Coponent)
            Wrapper
            Caching
            Logger
            Middleware
                Authorization
                Authentication
                Intrumentation
            Database.ts - > Repository.ts
            Router.ts - >I hope this is Wrong place.
        Modules
            Base
                Routes
                Service
                Business
                Models
                    Interfaces
                        AclAttribute.ts
                    Acl.ts
                SearchEnums
                Index.ts
            Admin
                Routes
                Service
                Business
                Models
                SearchEnums
                Index.ts
            Appointment
            Reporting
        Router.ts
    Bootstrap.ts
    Index.ts

Server side Reporting- PDF -  http://www.feedhenry.com/server-side-pdf-generation-node-js/
ACL Development
EMail -
Excel Import and- https://www.npmjs.com/package/xlsx

passport-local-example - https://github.com/DevMountain/passport-local-example/blob/master/app.js
ExpressJS and PassportJS Sessions Deep Dive - https://www.airpair.com/express/posts/expressjs-and-passportjs-sessions-deep-dive
CORS Enable.
Response Compress - Enable.


text:
using System;
using MongoDB.Util;

namespace MongoDB
{
    /// <summary>
    /// </summary>
    [Serializable]
    public sealed class Code : IEquatable<Code>
    {
        /// <summary>
        ///   Initializes a new instance of the <see cref = "Code" /> class.
        /// </summary>
        public Code()
        {
        }

        /// <summary>
        ///   Initializes a new instance of the <see cref = "Code" /> class.
        /// </summary>
        /// <param name = "value">The value.</param>
        public Code(string value)
        {
            Value = value;
        }

        /// <summary>
        ///   Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        public string Value { get; set; }

        /// <summary>
        ///   Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name = "other">An object to compare with this object.</param>
        /// <returns>
        ///   true if the current object is equal to the <paramref name = "other" /> parameter; otherwise, false.
        /// </returns>
        public bool Equals(Code other)
        {
            if(ReferenceEquals(null, other))
                return false;
            return ReferenceEquals(this, other) || Equals(other.Value, Value);
        }

        /// <summary>
        ///   Determines whether the specified <see cref = "System.Object" /> is equal to this instance.
        /// </summary>
        /// <param name = "obj">The <see cref = "System.Object" /> to compare with this instance.</param>
        /// <returns>
        ///   <c>true</c> if the specified <see cref = "System.Object" /> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref = "T:System.NullReferenceException">
        ///   The <paramref name = "obj" /> parameter is null.
        /// </exception>
        public override bool Equals(object obj)
        {
            if(ReferenceEquals(null, obj))
                return false;
            if(ReferenceEquals(this, obj))
                return true;
            return obj.GetType() == typeof(Code) && Equals((Code)obj);
        }

        /// <summary>
        ///   Implements the operator ==.
        /// </summary>
        /// <param name = "left">The left.</param>
        /// <param name = "right">The right.</param>
        /// <returns>The result of the operator.</returns>
        public static bool operator ==(Code left, Code right)
        {
            return Equals(left, right);
        }

        /// <summary>
        ///   Implements the operator !=.
        /// </summary>
        /// <param name = "left">The left.</param>
        /// <param name = "right">The right.</param>
        /// <returns>The result of the operator.</returns>
        public static bool operator !=(Code left, Code right)
        {
            return !Equals(left, right);
        }

        /// <summary>
        ///   Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        ///   A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
        /// </returns>
        public override int GetHashCode()
        {
            return (Value != null ? Value.GetHashCode() : 0);
        }

        /// <summary>
        ///   Returns a <see cref = "System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        ///   A <see cref = "System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return string.Format(@"{{ ""$code"": ""{0}"" }}", JsonFormatter.Escape(Value));
        }
    }
}


text:
// Copyright 2014-2022, University of Colorado Boulder

/**
 * Generalized button for stepping forward or back.  While this class is not private, clients will generally use the
 * convenience subclasses: StepForwardButton and StepBackwardButton
 *
 * @author Sam Reid (PhET Interactive Simulations)
 * @author Chris Malley (PixelZoom, Inc.)
 */

import { Shape } from '../../../kite/js/imports.js';
import StrictOmit from '../../../phet-core/js/types/StrictOmit.js';
import InstanceRegistry from '../../../phet-core/js/documentation/InstanceRegistry.js';
import optionize from '../../../phet-core/js/optionize.js';
import { HBox, TPaint, Path, Rectangle } from '../../../scenery/js/imports.js';
import RoundPushButton, { RoundPushButtonOptions } from '../../../sun/js/buttons/RoundPushButton.js';
import stepForwardSoundPlayer from '../../../tambo/js/shared-sound-players/stepForwardSoundPlayer.js';
import sceneryPhet from '../sceneryPhet.js';
import SceneryPhetStrings from '../SceneryPhetStrings.js';

const DEFAULT_RADIUS = 20;
const MARGIN_COEFFICIENT = 10.5 / DEFAULT_RADIUS;

type Direction = 'forward' | 'backward';

type SelfOptions = {
  radius?: number;
  direction?: Direction;
  iconFill?: TPaint;
};

export type StepButtonOptions = SelfOptions &
  StrictOmit<RoundPushButtonOptions, 'content' | 'xContentOffset' | 'xMargin' | 'yMargin'>;

export default class StepButton extends RoundPushButton {

  public constructor( providedOptions?: StepButtonOptions ) {

    // these options are used in computation of other default options
    const options = optionize<StepButtonOptions, SelfOptions, RoundPushButtonOptions>()( {

      // SelfOptions
      radius: DEFAULT_RADIUS,
      direction: 'forward',
      iconFill: 'black',

      // RoundPushButtonOptions
      fireOnHold: true,
      soundPlayer: stepForwardSoundPlayer,
      innerContent: SceneryPhetStrings.a11y.stepButton.stepForwardStringProperty,
      appendDescription: true
    }, providedOptions );

    assert && assert( options.direction === 'forward' || options.direction === 'backward',
      `unsupported direction: ${options.direction}` );

    // shift the content to center align, assumes 3D appearance and specific content
    options.xContentOffset = ( options.direction === 'forward' ) ? ( 0.075 * options.radius ) : ( -0.15 * options.radius );

    assert && assert( options.xMargin === undefined && options.yMargin === undefined, 'StepButton sets margins' );
    options.xMargin = options.yMargin = options.radius * MARGIN_COEFFICIENT;

    // step icon is sized relative to the radius
    const BAR_WIDTH = options.radius * 0.15;
    const BAR_HEIGHT = options.radius * 0.9;
    const TRIANGLE_WIDTH = options.radius * 0.65;
    const TRIANGLE_HEIGHT = BAR_HEIGHT;

    // icon, in 'forward' orientation
    const barPath = new Rectangle( 0, 0, BAR_WIDTH, BAR_HEIGHT, { fill: options.iconFill } );
    const trianglePath = new Path( new Shape()
      .moveTo( 0, TRIANGLE_HEIGHT / 2 )
      .lineTo( TRIANGLE_WIDTH, 0 )
      .lineTo( 0, -TRIANGLE_HEIGHT / 2 )
      .close(), {
      fill: options.iconFill
    } );
    options.content = new HBox( {
      children: [ barPath, trianglePath ],
      spacing: BAR_WIDTH,
      rotation: ( options.direction === 'forward' ) ? 0 : Math.PI
    } );

    super( options );

    // support for binder documentation, stripped out in builds and only runs when ?binder is specified
    assert && phet.chipper.queryParameters.binder && InstanceRegistry.registerDataURL( 'scenery-phet', 'StepButton', this );
  }
}

sceneryPhet.register( 'StepButton', StepButton );


text:
function visualizeOverviewNew( param, paramTest )
% Pass param and paramTest from mainSeg.m

if ~exist([param.dataFolder param.figureSubfolder '/'], 'dir')
    mkdir([param.dataFolder param.figureSubfolder '/']);
end
display('Overview: Split-merger segmentation parameter grid search');
figure('position', [1 1 1600 785]);
hold on;
[d, keptSamples, sampleCoord, params] = plotParam(paramTest);
% CORTEX
% Plot optimal IEDs
keptSampleCoord1T = squeeze(sampleCoord(keptSamples(:,1),1,:));
% Group 3 NN
[keptSampleCoord1, idx1, ied1] = extractCoM(keptSampleCoord1T);
tempIED1 = 1./(1./keptSampleCoord1(:,1)+1./keptSampleCoord1(:,2));
[maxVal1, maxID1] = max(tempIED1);
X = [keptSampleCoord1(maxID1,1)];
Y = [keptSampleCoord1(maxID1,2)];
Z = [keptSampleCoord1(maxID1,3)];
k = plot3(X,Y,Z, '*g', 'LineWidth', 2);
text(X(1),Y(1),['\leftarrow optimal IED: ' num2str(maxVal1/1000, '%3.2f') 'microns']);
% Output for parameters etc. of optimal IED
display('Node threshold 1, middle segmentation of 3 NN according to IED:');
display(['IED: ' num2str(ied1(maxID1)) ', Merger: ' num2str(keptSampleCoord1T(idx1(maxID1),1)) ', Split: ' num2str(keptSampleCoord1T(idx1(maxID1),2))]);
display(['Parameter: r=' num2str(params{maxID1}{1}) ', algo=' num2str(params{maxID1}{2}) ', t/h=' num2str(params{maxID1}{3}) ', ' num2str(params{maxID1}{4})]);
% Formatting
xlabel('average distance between merger [microns]');
ylabel('average distance between splits [microns]');
zlabel('number segmentation objects');
set(gca, 'XScale', 'log');
set(gca, 'YScale', 'log');
set(gca, 'XTick', [1e4 1e5 1e6]);
set(gca, 'XTickLabel', [10 100 1000]);
set(gca, 'YTick', [1e3 1e4 1e5]);
set(gca, 'YTickLabel', [1 10 100]);
grid off;
legend([d{1,1} d{1,2} d{2,1} d{2,2} d{3,1} d{3,2} k], ...
    'cortex test, hmin, r=0', 'cortex test, threshold, r=0',...
    'cortex test, hmin, r=1', 'cortex test, threshold, r=1',...
    'cortex test, hmin, r=2', 'cortex test, threshold, r=2',...
    'cortex best inter-error of 3 NN');
saveas(gcf, [param.dataFolder param.figureSubfolder filesep 'overviewComparisonNew3LAZH.fig']);
end

function [u, kept, plotted, params] = plotParam(param)
marker = {'+' 'o' 'x'};
color = [1 0 0; 0 1 0];
paramCell = getParamCombinations(param.algo);
idx = 1;
for r=1:length(param.r)
    for i=1:size(paramCell,2)
        for j=1:length(paramCell{i})
            load([param.dataFolder param.outputSubfolder  param.affMaps(1).name filesep 'seg' num2str(param.r(r)) '-' num2str(i) '-' num2str(j) '.mat'], 'v');
            eval1 = evaluateSeg(v, param.skel, 1, 1);
            kept(idx,1) = eval1.split.sum > 1 && eval1.merge.sum > 1;
            plotted(idx,1,1) = param.totalPathLength./max(eval1.merge.sum,1);
            plotted(idx,1,2) = param.totalPathLength./max(eval1.split.sum,1);
            plotted(idx,1,3) = eval1.general.maxNrObjects;
            params{idx} = {param.r(r) i paramCell{i}{j}{2}{1} paramCell{i}{j}{2}{2}};
            if kept(idx,1)
                u{r,i} = plot3(plotted(idx,1,1), plotted(idx,1,2), plotted(idx,1,3),...
                    marker{r}, 'MarkerEdgeColor', color(i,:), 'MarkerSize', 5);
            end
            idx = idx + 1;
        end
    end
end
end

function [comThreeNearestNeighbours, middleIdx, ied] = extractCoM(pointList)
    for i=1:size(pointList,1)
        distances = sqrt(sum((pointList - repmat(pointList(i,:),size(pointList,1),1)).^2,2));
        [~,idx] = sort(distances);
        comThreeNearestNeighbours(i,:) = mean(pointList(idx(1:3),:),1);
        [a, b] = sort(1./((1./pointList(idx(1:3),1))+(1./pointList(idx(1:3),2))));
        middleIdx(i) = idx(b(2));
        ied(i) = a(2);
    end
end


text:
import {LitElement, html} from "lit";
import UtilsNew from "../../../core/utils-new.js";
import BioinfoUtils from "../../../core/bioinfo/bioinfo-utils.js";

export default class CellbaseVariantAnnotationSummary extends LitElement {

    constructor() {
        super();
        this._init();
    }

    createRenderRoot() {
        return this;
    }

    static get properties() {
        return {
            variantAnnotation: {
                type: Object
            },
            consequenceTypes: {
                type: Object
            },
            proteinSubstitutionScores: {
                type: Object
            },
            minimumFreq: {
                type: Array
            },
            assembly: {
                type: String
            }
        };
    }

    _init() {
        this._prefix = UtilsNew.randomString(8);
        this.variantAnnotation = {};
    }

    update(changedProperties) {
        if (changedProperties.has("variantAnnotation")) {
            this.variantAnnotationChanged();
        }
        if (changedProperties.has("consequenceTypes") || changedProperties.has("proteinSubstitutionScores")) {
            this.setColors();
        }
        super.update(changedProperties);
    }

    isTranscriptAvailable(item) {
        return item !== "";
    }

    setColors() {
        if (this.consequenceTypes) {
            const consequenceTypeToColor = {};
            for (const category of this.consequenceTypes.categories) {
                if (category.terms) {
                    for (let j = 0; j < category.terms.length; j++) {
                        consequenceTypeToColor[category.terms[j].name] = this.consequenceTypes.style[category.terms[j].impact];
                    }
                } else {
                    if (category.id && category.name) {
                        consequenceTypeToColor[category.name] = this.consequenceTypes.style[category.impact];
                    }
                }
            }
            this.consequenceTypeToColor = consequenceTypeToColor;
        }

        if (typeof this.proteinSubstitutionScores !== "undefined") {
            const pssColor = new Map();
            for (const i in this.proteinSubstitutionScores) {
                const obj = this.proteinSubstitutionScores[i];
                Object.keys(obj).forEach(key => {
                    pssColor.set(key, obj[key]);
                });
            }
            this.pssColor = pssColor;
        }
    }

    variantAnnotationChanged() {
        const _this = this;
        if (typeof this.variantAnnotation !== "undefined") {
            if (UtilsNew.isEmpty(_this.variantAnnotation.reference)) {
                _this.variantAnnotation.reference = "-";
            }

            if (UtilsNew.isEmpty(_this.variantAnnotation.alternate)) {
                _this.variantAnnotation.alternate = "-";
            }

            // Consequence type
            // Color the consequence type
            if (typeof _this.consequenceTypeToColor !== "undefined" && typeof _this.consequenceTypeToColor[_this.variantAnnotation.displayConsequenceType] !== "undefined") {
                $("#" + _this._prefix + "CT").css("color", _this.consequenceTypeToColor[_this.variantAnnotation.displayConsequenceType]);
            }

            // Find the gene and transcript that exhibit the display consequence type
            if (typeof _this.variantAnnotation.consequenceTypes !== "undefined") {
                for (let i = 0; i < _this.variantAnnotation.consequenceTypes.length; i++) {
                    for (let j = 0; j < _this.variantAnnotation.consequenceTypes[i].sequenceOntologyTerms.length; j++) {
                        if (_this.variantAnnotation.displayConsequenceType === _this.variantAnnotation.consequenceTypes[i].sequenceOntologyTerms[j].name) {
                            _this.ctGene = _this.variantAnnotation.consequenceTypes[i].geneName;
                            _this.ctTranscript = _this.variantAnnotation.consequenceTypes[i].ensemblTranscriptId;
                            break;
                        }
                    }
                }
            }

            // PSS
            const proteinSubScore = {};
            // debugger
            if (typeof _this.variantAnnotation.consequenceTypes !== "undefined") {
                let min = 10;
                let max = 0;
                for (let i = 0; i < _this.variantAnnotation.consequenceTypes.length; i++) {
                    if (typeof _this.variantAnnotation.consequenceTypes[i].proteinVariantAnnotation !== "undefined") {
                        const gene = _this.variantAnnotation.consequenceTypes[i].geneName;
                        const transcript = _this.variantAnnotation.consequenceTypes[i].ensemblTranscriptId;
                        const scores = _this.variantAnnotation.consequenceTypes[i].proteinVariantAnnotation.substitutionScores;

                        if (typeof scores !== "undefined") {
                            for (let j = 0; j < scores.length; j++) {
                                if (scores[j].source === "sift" && scores[j].score <= min) {
                                    min = scores[j].score;
                                    proteinSubScore.sift = {score: scores[j].score, description: scores[j].description, gene: gene, transcript: transcript};
                                    // if (typeof _this.pssColor !== "undefined" && typeof _this.pssColor.get(scores[j].description) !== "undefined") {
                                    //     $("#" + _this._prefix + "Sift").css("color", _this.pssColor.get(scores[j].description));
                                    // }
                                } else if (scores[j].source === "polyphen" && scores[j].score >= max) {
                                    max = scores[j].score;
                                    proteinSubScore.polyphen = {score: scores[j].score, description: scores[j].description, gene: gene, transcript: transcript};
                                    // if (typeof _this.pssColor !== "undefined" && typeof _this.pssColor.get(scores[j].description) !== "undefined") {
                                    //     $("#" + _this._prefix + "Polyphen").css("color", _this.pssColor.get(scores[j].description));
                                    // }
                                }
                            }
                        }
                    }
                }
            }
            if (Object.keys(proteinSubScore).length === 0 && proteinSubScore.constructor === Object) {
                proteinSubScore.sift = {score: "NA", description: "NA", transcript: ""};
                proteinSubScore.polyphen = {score: "NA", description: "NA", transcript: ""};
                $("#" + _this._prefix + "Sift").css("color", "black");
                $("#" + _this._prefix + "Polyphen").css("color", "black");
            }
            _this.proteinSubScore = proteinSubScore;
            // debugger
            // CADD
            if (typeof _this.variantAnnotation.functionalScore !== "undefined") {
                for (const i in _this.variantAnnotation.functionalScore) {
                    const value = Number(_this.variantAnnotation.functionalScore[i].score).toFixed(2);
                    if (_this.variantAnnotation.functionalScore[i].source === "cadd_scaled") {
                        if (value > 15) {
                            $("#" + _this._prefix + "Cadd").css("color", "red");
                            _this.caddScaled = value;
                        } else {
                            $("#" + _this._prefix + "Cadd").css("color", "black");
                            _this.caddScaled = value;
                        }
                    }
                }
            } else {
                $("#" + _this._prefix + "Cadd").css("color", "black");
                _this.caddScaled = "NA";
            }

            // this.requestUpdate();
        }
    }

    render() {
        const variantRegion = this.variantAnnotation.chromosome + ":" + this.variantAnnotation.start + "-" + this.variantAnnotation.start;
        if (this.variantAnnotation === undefined || this.variantAnnotation === "" || this.proteinSubScore === undefined) {
            return;
        }

        const variantId = this.variantAnnotation.id ? this.variantAnnotation.id : `${this.variantAnnotation.chromosome}:${this.variantAnnotation.start}:${this.variantAnnotation.reference}:${this.variantAnnotation.alternate}`;

        return html`

Summary

                                Id

                                    ${variantId}

                            ${this.variantAnnotation?.hgvs?.length ? html`

                                    HGVS
                                    ${this.variantAnnotation.hgvs.map(item => html` ${item}<br> `)}

                            ` : null}

                                Alleles
                                ${this.variantAnnotation.reference}/${this.variantAnnotation.alternate}

                                Location

                                        ${this.variantAnnotation.chromosome}:${this.variantAnnotation.start}
                                        ${this.variantAnnotation.end ? html`<div>-${this.variantAnnotation.end}</div>`: null}

                            ${this.variantAnnotation.type ? html`

                                    Type
                                    ${this.variantAnnotation.type}

                            ` : null }

                            ${this.variantAnnotation.ancestralAllele ? html`

                                    Ancestral Allele
                                    ${this.variantAnnotation.ancestralAllele}

                            ` : null}

                            ${this.variantAnnotation.minorAlleleFreq ? html`

                                    MAF
                                    ${this.variantAnnotation.minorAlleleFreq} (${this.variantAnnotation.minorAllele})

                            ` : null}

                                Most Severe Consequence Type

                                        ${this.variantAnnotation.displayConsequenceType}
                                        ${this.ctGene ? html`
                                            (Gene : ${this.ctGene}, Transcript : ${this.ctTranscript})
                                        ` : null }

                                Most Severe Deleterious Score

                                            ${this.proteinSubScore.sift.description}

                                        ${this.isTranscriptAvailable(this.proteinSubScore.sift.transcript) ? html`
                                            (Gene:${this.proteinSubScore.sift.gene}, Transcript: ${this.proteinSubScore.sift.transcript})
                                        ` : null }

                                Polyphen

                                        ${this.proteinSubScore.polyphen.description}
                                        ${this.isTranscriptAvailable(this.proteinSubScore.polyphen.transcript) ? html`
                                            (Gene:${this.proteinSubScore.polyphen.gene}, Transcript: ${this.proteinSubScore.polyphen.transcript})
                                        ` : null}

                                CADD Scaled
                                ${this.caddScaled}

        `;
    }

}

customElements.define("cellbase-variant-annotation-summary", CellbaseVariantAnnotationSummary);


text:
package io.confluent.examples.connectandstreams.javaproducer;

import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.LongSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

import io.confluent.examples.connectandstreams.avro.Location;
import io.confluent.kafka.serializers.AbstractKafkaSchemaSerDeConfig;
import io.confluent.kafka.serializers.KafkaAvroSerializer;

public class Driver {

  static final Logger LOGGER = LoggerFactory.getLogger(Driver.class);
  static final String INPUT_TOPIC = "javaproducer-locations";
  static final String DEFAULT_TABLE_LOCATIONS = "/usr/local/lib/table.locations";
  static final String DEFAULT_BOOTSTRAP_SERVERS = "localhost:9092";
  static final String DEFAULT_SCHEMA_REGISTRY_URL = "http://localhost:8081";

  public static void main(final String[] args) throws Exception {

    if (args.length > 3) {
      throw new IllegalArgumentException("usage: ... "
                                         + "[<bootstrap.servers> (optional, default: " + DEFAULT_BOOTSTRAP_SERVERS
                                         + ")] "
                                         + "[<schema.registry.url> (optional, default: " + DEFAULT_SCHEMA_REGISTRY_URL
                                         + ")] "
                                         + "[<table.locations> (optional, default: " + DEFAULT_TABLE_LOCATIONS + ")] ");
    }

    final String bootstrapServers = args.length > 0 ? args[0] : DEFAULT_BOOTSTRAP_SERVERS;
    final String schemaRegistryUrl = args.length > 1 ? args[1] : DEFAULT_SCHEMA_REGISTRY_URL;
    final String tableLocations = args.length > 2 ? args[2] : DEFAULT_TABLE_LOCATIONS;

    LOGGER.info("Connecting to Kafka cluster via bootstrap servers " + bootstrapServers);
    LOGGER.info("Connecting to Confluent schema registry at " + schemaRegistryUrl);
    LOGGER.info("Reading locations table from file " + tableLocations);

    final List<Location> locationsList = new ArrayList<>();
    try (final BufferedReader br = new BufferedReader(new FileReader(tableLocations))) {
      String line;
      while ((line = br.readLine()) != null) {
        final String[] parts = line.split("\\|");
        locationsList.add(new Location(Long.parseLong(parts[0]), parts[1],
                                       Long.parseLong(parts[2])));
      }
    }

    final Properties props = new Properties();
    props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
    props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, LongSerializer.class);
    props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, KafkaAvroSerializer.class);
    props.put(AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryUrl);
    final KafkaProducer<Long, Location>
        locationProducer =
        new KafkaProducer<Long, Location>(props);

    locationsList.forEach(t -> {
      LOGGER.info("Writing location information for '" + t.getId() + "' to input topic " + INPUT_TOPIC);
      final ProducerRecord<Long, Location> record = new ProducerRecord<>(INPUT_TOPIC, t.getId(), t);
      locationProducer.send(record);
    });

    locationProducer.close();

  }

}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>Redirecting...</title>
<link rel="canonical" href="SqlserverUpserts.html">
<meta http-equiv="refresh" content="0; url=SqlserverUpserts.html">

Redirecting…

Click here if you are not redirected.


text:
module.exports = function (grunt) {

};


text:
actions :install, :remove, :enable, :disable
default_action :install

attribute :name,          :kind_of => String, :required => true, :name_attribute => true
attribute :runtime_name,  :kind_of => String, :default => 'noname'
attribute :path,          :kind_of => String, :default => 'nopath'
attribute :url,           :kind_of => String, :default => 'nourl'
attribute :cli,           :kind_of => String

attr_accessor :exists


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>BiwaScheme</title>
    <link href="/website/css/screen.css" rel="stylesheet" type="text/css">
    <link href="https://cdn.jsdelivr.net/npm/jquery.terminal/css/jquery.terminal.min.css" rel="stylesheet"/>
    <link href="/website/css/prism-coy.css" rel="stylesheet" type="text/css"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

Features

Getting Started

Reference

FAQ

Other docs

How to build BiwaScheme

Prerequisites

Node.js

npm

Command

$ npm install
$ npm run build

This will create these js files.

./release/biwascheme.js (IIFE, contains jQuery)

./release/biwascheme-min.js (IIFE, contains jQuery, compressed)

./release/biwascheme.mjs (ESM, without jQuery)

./release/node_biwascheme.js (Contains some Node-only functions instead of those for browsers)


text:
package com.thoughtworks.xstream.io.xml;

import com.thoughtworks.xstream.io.AbstractDriver;
import com.thoughtworks.xstream.io.naming.NameCoder;

/**
 * Base class for HierarchicalStreamDrivers to use XML-based HierarchicalStreamReader and HierarchicalStreamWriter.
 *
 * @author Mauro Talevi
 * @author Jörg Schaible
 * @since 1.2
 * @deprecated As of 1.4
 */
@Deprecated
public abstract class AbstractXmlDriver extends AbstractDriver {

    /**
     * Creates a AbstractXmlFriendlyDriver with default XmlFriendlyReplacer
     *
     * @deprecated As of 1.4
     */
    @Deprecated
    public AbstractXmlDriver() {
        this(new XmlFriendlyNameCoder());
    }

    /**
     * Creates a AbstractXmlFriendlyDriver with default XmlFriendlyReplacer
     *
     * @since 1.4
     * @deprecated As of 1.4
     */
    @Deprecated
    public AbstractXmlDriver(final NameCoder nameCoder) {
        super(nameCoder);
    }

    /**
     * Creates a AbstractXmlFriendlyDriver with custom XmlFriendlyReplacer
     *
     * @param replacer the XmlFriendlyReplacer
     * @deprecated As of 1.4
     */
    @Deprecated
    public AbstractXmlDriver(final XmlFriendlyReplacer replacer) {
        this((NameCoder)replacer);
    }

    /**
     * @deprecated As of 1.4
     */
    @Deprecated
    protected XmlFriendlyReplacer xmlFriendlyReplacer() {
        final NameCoder nameCoder = getNameCoder();
        return nameCoder instanceof XmlFriendlyReplacer ? (XmlFriendlyReplacer)nameCoder : null;
    }

}


text:
package no.nordicsemi.android.nrfbeacon.common;

import no.nordicsemi.android.nrfbeacon.R;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class BoardHelpFragment extends DialogFragment {
	public static final int MODE_DFU = 1;
	public static final int MODE_UPDATE = 2;

	private static final String MODE = "mode";

	public static BoardHelpFragment getInstance(final int mode) {
		final BoardHelpFragment fragment = new BoardHelpFragment();

		final Bundle args = new Bundle();
		args.putInt(MODE, mode);
		fragment.setArguments(args);

		return fragment;
	}

	@Override
	public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
		final Bundle bundle = getArguments();
		final int mode = bundle.getInt(MODE);

		getDialog().setTitle(R.string.update_about_title);
		final TextView aboutView = (TextView) inflater.inflate(R.layout.fragment_dialog_help, container, false);
		switch (mode) {
		case MODE_DFU:
			aboutView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.beacon_sw1, 0, 0, 0);
			aboutView.setText(R.string.update_about_message_dfu);
			break;
		case MODE_UPDATE:
		default:
			aboutView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.beacon_sw2, 0, 0, 0);
			aboutView.setText(R.string.update_about_message_update);
			break;
		}
		return aboutView;
	}
}


text:
package alluxio.master.file.meta;

import alluxio.master.journal.checkpoint.CheckpointName;

/**
 * Keeps track of which files are in the TO_BE_PERSISTED persistence state.
 */
public class ToBePersistedFileIds extends CheckpointedIdHashSet {
  @Override
  public CheckpointName getCheckpointName() {
    return CheckpointName.TO_BE_PERSISTED_FILE_IDS;
  }
}


text:
from sys import exit

from os.path import join, dirname, basename, realpath

from csv import DictReader as csv_dict_reader

from subprocess import Popen

from argparse import ArgumentParser as argument_parser

###############################################################################

def printable_cmd(c):
  """Converts a `list` of `str`s representing a shell command to a printable
  `str`."""
  return " ".join(map(lambda e: '"' + str(e) + '"', c))

###############################################################################

def print_file(p):
  """Open the path `p` and print its contents to `stdout`."""
  print "********************************************************************************"
  with open(p) as f:
    for line in f:
      print line,
  print "********************************************************************************"

###############################################################################

ap = argument_parser(
  description = (
    "CUDA Eris driver script: runs a benchmark suite multiple times, combines "
    "the results, and outputs them in the CUDA Eris performance result format."
  )
)

ap.add_argument(
  "-b", "--benchmark",
  help = ("The location of the benchmark suite executable to run."),
  type = str,
  default = join(dirname(realpath(__file__)), "bench"),
  metavar = "R"
)

ap.add_argument(
  "-p", "--postprocess",
  help = ("The location of the postprocessing script to run to combine the "
          "results."),
  type = str,
  default = join(dirname(realpath(__file__)), "combine_benchmark_results.py"),
  metavar = "R"
)

ap.add_argument(
  "-r", "--runs",
  help = ("Run the benchmark suite `R` times.a),"),
  type = int, default = 5,
  metavar = "R"
)

args = ap.parse_args()

if args.runs <= 0:
  print "ERROR: `--runs` must be greater than `0`."
  ap.print_help()
  exit(1)

BENCHMARK_EXE             = args.benchmark
BENCHMARK_NAME            = basename(BENCHMARK_EXE)
POSTPROCESS_EXE           = args.postprocess
OUTPUT_FILE_NAME          = lambda i: BENCHMARK_NAME + "_" + str(i) + ".csv"
COMBINED_OUTPUT_FILE_NAME = BENCHMARK_NAME + "_combined.csv"

###############################################################################

print '&&&& RUNNING {0}'.format(BENCHMARK_NAME)

print '#### RUNS {0}'.format(args.runs)

###############################################################################

print '#### CMD {0}'.format(BENCHMARK_EXE)

for i in xrange(args.runs):
  with open(OUTPUT_FILE_NAME(i), "w") as output_file:
    print '#### RUN {0} OUTPUT -> {1}'.format(i, OUTPUT_FILE_NAME(i))

    p = None

    try:
      p = Popen(BENCHMARK_EXE, stdout = output_file, stderr = output_file)
      p.communicate()
    except OSError as ex:
      print_file(OUTPUT_FILE_NAME(i))
      print '#### ERROR Caught OSError `{0}`.'.format(ex)
      print '&&&& FAILED {0}'.format(BENCHMARK_NAME)
      exit(-1)

  print_file(OUTPUT_FILE_NAME(i))

  if p.returncode != 0:
    print '#### ERROR Process exited with code {0}.'.format(p.returncode)
    print '&&&& FAILED {0}'.format(BENCHMARK_NAME)
    exit(p.returncode)

###############################################################################

post_cmd = [POSTPROCESS_EXE]

# Add dependent variable options.
post_cmd += ["-dSTL Average Walltime,STL Walltime Uncertainty,STL Trials"]
post_cmd += ["-dSTL Average Throughput,STL Throughput Uncertainty,STL Trials"]
post_cmd += ["-dThrust Average Walltime,Thrust Walltime Uncertainty,Thrust Trials"]
post_cmd += ["-dThrust Average Throughput,Thrust Throughput Uncertainty,Thrust Trials"]

post_cmd += [OUTPUT_FILE_NAME(i) for i in range(args.runs)]

print '#### CMD {0}'.format(printable_cmd(post_cmd))

with open(COMBINED_OUTPUT_FILE_NAME, "w") as output_file:
  p = None

  try:
    p = Popen(post_cmd, stdout = output_file, stderr = output_file)
    p.communicate()
  except OSError as ex:
    print_file(COMBINED_OUTPUT_FILE_NAME)
    print '#### ERROR Caught OSError `{0}`.'.format(ex)
    print '&&&& FAILED {0}'.format(BENCHMARK_NAME)
    exit(-1)

  print_file(COMBINED_OUTPUT_FILE_NAME)

  if p.returncode != 0:
    print '#### ERROR Process exited with code {0}.'.format(p.returncode)
    print '&&&& FAILED {0}'.format(BENCHMARK_NAME)
    exit(p.returncode)

  with open(COMBINED_OUTPUT_FILE_NAME) as input_file:
    reader = csv_dict_reader(input_file)

    variable_units = reader.next() # Get units header row.

    distinguishing_variables = reader.fieldnames

    measured_variables = [
      ("STL Average Throughput",    "+"),
      ("Thrust Average Throughput", "+")
    ]

    for record in reader:
      for variable, directionality in measured_variables:
        # Don't monitor regressions for STL implementations, nvbug 28980890:
        if "STL" in variable:
          continue
        print "&&&& PERF {0}_{1}_{2}bit_{3}mib_{4} {5} {6}{7}".format(
          record["Algorithm"],
          record["Element Type"],
          record["Element Size"],
          record["Total Input Size"],
          variable.replace(" ", "_").lower(),
          record[variable],
          directionality,
          variable_units[variable]
        )

###############################################################################

print '&&&& PASSED {0}'.format(BENCHMARK_NAME)


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Multisport extends CI_Controller {

	public function index()
	{
		$data['main_view']='apparel/multisport/home';
		$this->load->view('apparel/template',$data);
	}
	public function shirts()
	{
		$data['main_view']='apparel/multisport/shirts';
		$this->load->view('apparel/template',$data);
	}
	public function shorts()
	{
		$data['main_view']='apparel/multisport/shorts';
		$this->load->view('apparel/template',$data);
	}
	public function goalies()
	{
		$data['main_view']='apparel/multisport/goalies';
		$this->load->view('apparel/template',$data);
	}
		public function kits()
	{
		$data['main_view']='apparel/multisport/kits';
		$this->load->view('apparel/template',$data);
	}
	public function socks()
	{
		$data['main_view']='apparel/multisport/socks';
		$this->load->view('apparel/template',$data);
	}
	public function diy_shirts()
	{
		$data['main_view']='apparel/multisport/diy_shirts';
		$this->load->view('apparel/template',$data);
	}
	public function diy_shorts()
	{
		$data['main_view']='apparel/multisport/diy_shorts';
		$this->load->view('apparel/template',$data);
	}
	/*public function prices()
	{
		$data['main_view']='apparel/multisport/prices';
		$this->load->view('apparel/template',$data);
	}*/
	public function sizes()
	{
		$data['main_view']='apparel/multisport/sizes';
		$this->load->view('apparel/template',$data);
	}
	public function order()
	{
		$data['main_view']='apparel/multisport/order';
		$this->load->view('apparel/template',$data);
	}

}


text:
package template

import (
	"fmt"
	"io/ioutil"
	"net"
	"net/http"
	"net/url"
	"os"
	"path/filepath"
)

// Fetch fetchs content from the given URL string.  Supported schemes are http:// https:// file:// unix://
func Fetch(s string, opt Options) ([]byte, error) {
	u, err := url.Parse(s)
	if err != nil {
		return nil, err
	}
	switch u.Scheme {
	case "file":
		return ioutil.ReadFile(u.Path)

	case "http", "https":
		resp, err := http.Get(u.String())
		if err != nil {
			return nil, err
		}
		defer resp.Body.Close()
		return ioutil.ReadAll(resp.Body)

	case "unix":
		// unix: will look for a socket that matches the host name at a
		// directory path set by environment variable.
		c, err := socketClient(u, opt.SocketDir)
		if err != nil {
			return nil, err
		}
		u.Scheme = "http"
		resp, err := c.Get(u.String())
		if err != nil {
			return nil, err
		}
		defer resp.Body.Close()
		return ioutil.ReadAll(resp.Body)
	}

	return nil, fmt.Errorf("unsupported url:%s", s)
}

func socketClient(u *url.URL, socketDir string) (*http.Client, error) {
	socketPath := filepath.Join(socketDir, u.Host)
	if f, err := os.Stat(socketPath); err != nil {
		return nil, err
	} else if f.Mode()&os.ModeSocket == 0 {
		return nil, fmt.Errorf("not-a-socket:%v", socketPath)
	}
	return &http.Client{
		Transport: &http.Transport{
			Dial: func(proto, addr string) (conn net.Conn, err error) {
				return net.Dial("unix", socketPath)
			},
		},
	}, nil
}


text:
using System;
using System.Linq.Expressions;
using Money.Internal.Helpers;

namespace Money
{
    public sealed partial class Money<T>
    {
        public static Money<T> operator ++(Money<T> me)
        {
            var val = BinaryOperationHelper.AddChecked(me.Amount, NumericTypeHelper.ConvertTo<T>(1));
            return new Money<T>(val, me.Currency);
        }

        public static Money<T> operator --(Money<T> me)
        {
            var val = BinaryOperationHelper.SubtractChecked(me.Amount, NumericTypeHelper.ConvertTo<T>(1));
            return new Money<T>(val, me.Currency);
        }

        public static Money<T> operator -(Money<T> me)
        {
            return ApplyUnaryOperation(me.Amount, me.Currency, Expression.NegateChecked);
        }

        private static Money<T> ApplyUnaryOperation(
            T amount,
            Currency currency,
            Func<Expression, UnaryExpression> unaryExpressionFunction)
        {
            var currentValue = Expression.Constant(amount, typeof(T));
            var unaryExpression = unaryExpressionFunction(currentValue);
            var newValue = Expression.Lambda<Func<T>>(unaryExpression).Compile()();
            return new Money<T>(newValue, currency);
        }
    }
}


text:
@class RecipeDetailModel;

@interface DataBaseSingleton : NSObject

+ (instancetype)sharedManager;

- (BOOL)insertDataFrom:(RecipeDetailModel *)recipe;

- (NSMutableArray *)selectAll;

- (BOOL)deleteRecipeById:(NSString *)recipeId;

@end


text:
package com.sap.core.odata.api.processor;

import com.sap.core.odata.api.ODataCallback;
import com.sap.core.odata.api.exception.ODataApplicationException;

/**
 * This interface is called if an error occurred and is process inside the exception mapper.
 * @author SAP AG
 *
 */
public interface ODataErrorCallback extends ODataCallback {
  /**
   * This method can be used to handle an error differently than the exception mapper would.
   *
Any returned Response will be directly transported to the client.
   *
Any thrown {@link ODataApplicationException} will be transformed into the OData error format.
   *
Any thrown runtime exception will result in an 500 Internal Server error with the Text: "Exception during error handling occurred!" No OData formatting will be applied.
   *
To serialize an error into the OData format the {@link com.sap.core.odata.api.ep.EntityProvider} writeErrorDocument can be used.
   * @param context of this error
   * @return the response which will be propagated to the client
   * @throws ODataApplicationException
   */
  ODataResponse handleError(ODataErrorContext context) throws ODataApplicationException;
}


text: 1. Started work on a complete overhaul of the front-end boilerplate


text:
class Startup
	def initialize( status, config, output )
		@status	= status
		@config	= config
		@output	= output
	end

	# Check socket library
	def checksocket
		@output.std( "Checking for socket libs ......... " )
		begin
			require 'socket'
			@output.good( "[OK]\n" )
		rescue LoadError
			@output.bad( "[NO]\n" )
			@output.info( "Ruby socket library needs to be installed.\n" )
			Process.exit
		end
	end

	# Check for OpenSSL
	def checkopenssl
		@output.std( "Checking for openssl support ..... " )
		begin
			require 'openssl'

			@output.good( "[OK]" )
			if( @config.ssl )
				@output.good( "\n" )
			else
				@output.info( " (unused)\n" )
			end
			@status.ssl( 1 )
		rescue LoadError
			@output.bad( "[NO]" )
			if( @config.ssl )
				@output.bad( "\n" )
			else
				@output.info( " (unused)\n" )
			end

			@status.ssl( 0 )
		end
	end

	# Check for threading
	def checkthreads
		@output.std( "Checking for threading support ... " )
		begin
			require 'thread'
			@status.threads( 1 )

			@output.good( "[OK]" )
			if( @config.threads )
				@output.good( "\n" )
			else
				@output.info( " (unused)\n" )
			end

		rescue LoadError
			@status.threads( 0 )

			@output.bad( "[NO]" )
			if( @config.threads )
				@output.bad( "\n" )
			else
				@output.info( " (unused)\n" )
			end

			if( !@config.threadingfallback )
				@output.info( "No threading support, and fallback is disabled.\n" )
				Process.exit
			end
		end
	end

	def checkreadline
		@output.std( "Checking for readline support .... " )
		begin
			require "readline"
			@status.readline( 1 )

			@output.good( "[OK]\n" )

		rescue LoadError
			@status.readline( 0 )

			@output.bad( "[NO]" )
			@output.info( " (using STDIO)\n" )
		end
	end

	def checkoutputqueuing
		if( RUBY_VERSION =~ /^1\.8/ )
			@output.info( "Old Ruby version detected.\n" )
			@output.info( "\tOutput queuing is not available.\n" )
			@output.info( "\tTab completion on console not available.\n" )
			@status.tabcomplete( 0 )
		end
	end

	# Check if directories exist
	def checkdirectorydata
		@output.std( "Checking for data directory ...... " )
		if( File.directory? @config.datadir )
			@output.good( "[OK]\n" )
		else
			begin
				Dir::mkdir( @config.datadir )
				@output.info( "[CREATED]\n" )
			rescue
				@output.bad( "[NO]\n" )
			end
		end
	end

	def checkdirectoryplugins
		@output.std( "Checking for plugin directory .... " )
		if( File.directory? @config.plugindir )
			@output.good( "[OK]\n" )
		else
			begin
				Dir::mkdir( @config.plugindir )
				@output.info( "[CREATED]\n" )
			rescue
				@output.bad( "[NO]\n" )
			end
		end
	end
end


text:
<?php

namespace Vipa\AdminBundle\Controller;

use APY\DataGridBundle\Grid\Column\ActionsColumn;
use APY\DataGridBundle\Grid\Row;
use APY\DataGridBundle\Grid\Source\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Vipa\AdminBundle\Form\Type\SubjectType;
use Vipa\CoreBundle\Controller\VipaController as Controller;
use Vipa\CoreBundle\Helper\TreeHelper;
use Vipa\JournalBundle\Entity\Subject;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Csrf\Exception\TokenNotFoundException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Vipa\AdminBundle\Events\AdminEvent;
use Vipa\AdminBundle\Events\AdminEvents;

/**
 * Subject controller.
 *
 */
class AdminSubjectController extends Controller
{

    /**
     * Lists all Subject entities.
     *
     * @param Request $request
     * @return Response
     */
    public function indexAction(Request $request)
    {
        $source = new Entity("VipaJournalBundle:Subject");
        $grid = $this->get('grid')->setSource($source);

        $gridAction = $this->get('grid_action');
        $actionColumn = new ActionsColumn("actions", 'actions');
        $rowAction[] = $gridAction->showAction('vipa_admin_subject_show', 'id');
        $rowAction[] = $gridAction->editAction('vipa_admin_subject_edit', 'id');
        $rowAction[] = $gridAction->deleteAction('vipa_admin_subject_delete', 'id');
        $actionColumn->setRowActions($rowAction);
        $grid->addColumn($actionColumn);

        /** @var ArrayCollection|Subject[] $all */
        $all = $this
            ->getDoctrine()
            ->getRepository('VipaJournalBundle:Subject')
            ->findAll();

        $data = [
            'grid' => $grid,
            'tree' => TreeHelper::createSubjectTreeView(TreeHelper::SUBJECT_ADMIN, $this->get('router'), $all)
        ];

        return $grid->getGridResponse('VipaAdminBundle:AdminSubject:index.html.twig', $data);
    }

    /**
     * Creates a new Subject entity.
     *
     * @param  Request $request
     * @return RedirectResponse|Response
     */
    public function createAction(Request $request)
    {
        /** @var $dispatcher EventDispatcherInterface */
        $dispatcher = $this->get('event_dispatcher');
        $entity = new Subject();
        $entity->setCurrentLocale($request->getDefaultLocale());
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);
        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity->setSlug($entity->getTranslationByLocale($request->getDefaultLocale())->getSubject());
            $em->persist($entity);
            $em->flush();
            $this->successFlashBag('successful.create');

            $event = new AdminEvent([
                'eventType' => 'create',
                'entity'    => $entity,
            ]);
            $dispatcher->dispatch(AdminEvents::ADMIN_SUBJECT_CHANGE, $event);
            return $this->redirectToRoute('vipa_admin_subject_show', ['id' => $entity->getId()]);
        }

        return $this->render(
            'VipaAdminBundle:AdminSubject:new.html.twig',
            array(
                'entity' => $entity,
                'form' => $form->createView(),
            )
        );
    }

    /**
     * Creates a form to create a Subject entity.
     *
     * @param Subject $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(Subject $entity)
    {
        $form = $this->createForm(
            new SubjectType(),
            $entity,
            array(
                'action' => $this->generateUrl('vipa_admin_subject_create'),
                'method' => 'POST',
            )
        );
        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }

    /**
     * Displays a form to create a new Subject entity.
     *
     */
    public function newAction()
    {
        $entity = new Subject();
        $form = $this->createCreateForm($entity);

        return $this->render(
            'VipaAdminBundle:AdminSubject:new.html.twig',
            array(
                'entity' => $entity,
                'form' => $form->createView(),
            )
        );
    }

    /**
     * Finds and displays a Subject entity.
     *
     * @param Request $request
     * @param Subject $entity
     * @return Response
     */
    public function showAction(Request $request, Subject $entity)
    {
        $this->throw404IfNotFound($entity);
        $entity->setDefaultLocale($request->getDefaultLocale());
        $token = $this
            ->get('security.csrf.token_manager')
            ->refreshToken('vipa_admin_subject'.$entity->getId());

        return $this->render(
            'VipaAdminBundle:AdminSubject:show.html.twig',
            ['entity' => $entity, 'token' => $token]
        );
    }

    /**
     * Displays a form to edit an existing Subject entity.
     *
     * @param  Subject $entity
     * @return Response
     */
    public function editAction(Subject $entity)
    {
        $this->throw404IfNotFound($entity);
        $editForm = $this->createEditForm($entity);

        return $this->render(
            'VipaAdminBundle:AdminSubject:edit.html.twig',
            array(
                'entity' => $entity,
                'edit_form' => $editForm->createView(),
            )
        );
    }

    /**
     * Creates a form to edit a Subject entity.
     *
     * @param Subject $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createEditForm(Subject $entity)
    {
        $form = $this->createForm(
            new SubjectType($entity->getId()),
            $entity,
            array(
                'action' => $this->generateUrl('vipa_admin_subject_update', array('id' => $entity->getId())),
                'method' => 'PUT',
            )
        );

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }

    /**
     * Edits an existing Subject entity.
     *
     * @param  Request $request
     * @param  Subject $entity
     * @return RedirectResponse|Response
     */
    public function updateAction(Request $request, Subject $entity)
    {
        $this->throw404IfNotFound($entity);
        /** @var $dispatcher EventDispatcherInterface */
        $dispatcher = $this->get('event_dispatcher');
        $em = $this->getDoctrine()->getManager();
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);
        if ($editForm->isValid()) {
            $entity->setSlug($entity->getTranslationByLocale($request->getDefaultLocale())->getSubject());
            $em->flush();
            $this->successFlashBag('successful.update');

            $event = new AdminEvent([
                'eventType' => 'update',
                'entity'    => $entity,
            ]);
            $dispatcher->dispatch(AdminEvents::ADMIN_SUBJECT_CHANGE, $event);
            return $this->redirectToRoute('vipa_admin_subject_edit', ['id' => $entity->getId()]);
        }

        return $this->render(
            'VipaAdminBundle:AdminSubject:edit.html.twig',
            array(
                'entity' => $entity,
                'edit_form' => $editForm->createView(),
            )
        );
    }

    /**
     * @param  Request $request
     * @param  Subject $entity
     * @return RedirectResponse
     */
    public function deleteAction(Request $request, Subject $entity)
    {
        $this->throw404IfNotFound($entity);
        /** @var $dispatcher EventDispatcherInterface */
        $dispatcher = $this->get('event_dispatcher');
        $em = $this->getDoctrine()->getManager();

        $csrf = $this->get('security.csrf.token_manager');
        $token = $csrf->getToken('vipa_admin_subject'.$entity->getId());
        if ($token != $request->get('_token')) {
            throw new TokenNotFoundException("Token Not Found!");
        }
        $this->get('vipa_core.delete.service')->check($entity);
        $event = new AdminEvent([
            'eventType' => 'delete',
            'entity'    => $entity,
        ]);
        $dispatcher->dispatch(AdminEvents::ADMIN_SUBJECT_CHANGE, $event);
        $em->remove($entity);
        $em->flush();
        $this->successFlashBag('successful.remove');

        return $this->redirectToRoute('vipa_admin_subject_index');
    }
}


text:
package com.opengamma.analytics.financial.instrument.inflation;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;

import org.testng.annotations.Test;
import org.threeten.bp.Period;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.temporal.TemporalAdjusters;

import com.opengamma.analytics.financial.instrument.index.IndexPrice;
import com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationYearOnYearMonthly;
import com.opengamma.analytics.financial.interestrate.payments.derivative.Coupon;
import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixed;
import com.opengamma.analytics.financial.schedule.ScheduleCalculator;
import com.opengamma.financial.convention.businessday.BusinessDayConvention;
import com.opengamma.financial.convention.businessday.BusinessDayConventions;
import com.opengamma.financial.convention.calendar.Calendar;
import com.opengamma.financial.convention.calendar.MondayToFridayCalendar;
import com.opengamma.financial.convention.daycount.DayCount;
import com.opengamma.financial.convention.daycount.DayCounts;
import com.opengamma.timeseries.DoubleTimeSeries;
import com.opengamma.timeseries.precise.zdt.ImmutableZonedDateTimeDoubleTimeSeries;
import com.opengamma.util.money.Currency;
import com.opengamma.util.test.TestGroup;
import com.opengamma.util.time.DateUtils;

/**
 * Tests the year on year inflation constructors.
 */
@Test(groups = TestGroup.UNIT)
public class CouponInflationYearOnYearMonthlyDefinitionTest {

  private static final String NAME = "Euro HICP x";
  private static final Currency CUR = Currency.EUR;
  private static final IndexPrice PRICE_INDEX = new IndexPrice(NAME, CUR);
  private static final Calendar CALENDAR = new MondayToFridayCalendar("A");
  private static final BusinessDayConvention BUSINESS_DAY = BusinessDayConventions.MODIFIED_FOLLOWING;
  private static final ZonedDateTime START_DATE = DateUtils.getUTCDate(2008, 8, 18);
  private static final Period COUPON_TENOR = Period.ofYears(10);
  private static final ZonedDateTime PAYMENT_DATE = ScheduleCalculator.getAdjustedDate(START_DATE, COUPON_TENOR, BUSINESS_DAY, CALENDAR);
  private static final ZonedDateTime ACCRUAL_END_DATE = PAYMENT_DATE;
  private static final ZonedDateTime ACCRUAL_START_DATE = ACCRUAL_END_DATE.minusMonths(12);
  private static final double NOTIONAL = 98765432;
  private static final int MONTH_LAG = 3;
  private static final ZonedDateTime REFERENCE_END_DATE = PAYMENT_DATE.minusMonths(MONTH_LAG).with(TemporalAdjusters.lastDayOfMonth());
  private static final ZonedDateTime REFERENCE_START_DATE = REFERENCE_END_DATE.minusMonths(12).with(TemporalAdjusters.lastDayOfMonth());
  private static final CouponInflationYearOnYearMonthlyDefinition YoY_COUPON_DEFINITION = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0,
      NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, REFERENCE_START_DATE, REFERENCE_END_DATE, false);
  private static final DayCount ACT_ACT = DayCounts.ACT_ACT_ISDA;

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullCurrency() {
    new CouponInflationYearOnYearMonthlyDefinition(null, PAYMENT_DATE, ACCRUAL_START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, REFERENCE_START_DATE,
        REFERENCE_END_DATE, false);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullPay() {
    new CouponInflationYearOnYearMonthlyDefinition(CUR, null, ACCRUAL_START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, REFERENCE_START_DATE,
        REFERENCE_END_DATE, false);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullStart() {
    new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, null, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, REFERENCE_START_DATE,
        REFERENCE_END_DATE, false);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullEnd() {
    new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, null, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, REFERENCE_START_DATE,
        REFERENCE_END_DATE, false);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullIndex() {
    new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, null, MONTH_LAG, 3, REFERENCE_START_DATE,
        REFERENCE_END_DATE, false);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullRefStart() {
    new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, null, REFERENCE_END_DATE, false);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullRefEnd() {
    new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3, REFERENCE_START_DATE, null, false);
  }

  @Test
  /**
   * Tests the class getter.
   */
  public void getter() {
    assertEquals("Inflation Year on Year coupon: getter", CUR, YoY_COUPON_DEFINITION.getCurrency());
    assertEquals("Inflation Year on Year coupon: getter", PAYMENT_DATE, YoY_COUPON_DEFINITION.getPaymentDate());
    assertEquals("Inflation Year on Year coupon: getter", ACCRUAL_START_DATE, YoY_COUPON_DEFINITION.getAccrualStartDate());
    assertEquals("Inflation Year on Year coupon: getter", ACCRUAL_END_DATE, YoY_COUPON_DEFINITION.getAccrualEndDate());
    assertEquals("Inflation Year on Year coupon: getter", 1.0, YoY_COUPON_DEFINITION.getPaymentYearFraction());
    assertEquals("Inflation Year on Year coupon: getter", NOTIONAL, YoY_COUPON_DEFINITION.getNotional());
    assertEquals("Inflation Year on Year coupon: getter", PRICE_INDEX, YoY_COUPON_DEFINITION.getPriceIndex());
    assertEquals("Inflation Year on Year coupon: getter", REFERENCE_START_DATE, YoY_COUPON_DEFINITION.getReferenceStartDate());
    assertEquals("Inflation Year on Year coupon: getter", REFERENCE_END_DATE, YoY_COUPON_DEFINITION.getReferenceEndDate());
    assertEquals("Inflation Year on Year coupon: getter", MONTH_LAG, YoY_COUPON_DEFINITION.getConventionalMonthLag());
  }

  /**
   *
   */
  @Test
  /**
   * Tests the equal and hash-code methods.
   */
  public void equalHash() {
    assertEquals(YoY_COUPON_DEFINITION, YoY_COUPON_DEFINITION);
    final CouponInflationYearOnYearMonthlyDefinition couponDuplicate = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0, NOTIONAL,
        PRICE_INDEX,
        MONTH_LAG, 3, REFERENCE_START_DATE, REFERENCE_END_DATE, false);
    assertEquals(YoY_COUPON_DEFINITION, couponDuplicate);
    assertEquals(YoY_COUPON_DEFINITION.hashCode(), couponDuplicate.hashCode());
    CouponInflationYearOnYearMonthlyDefinition modified;
    modified = new CouponInflationYearOnYearMonthlyDefinition(Currency.AUD, ACCRUAL_END_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3,
        REFERENCE_START_DATE, REFERENCE_END_DATE, false);
    assertFalse(YoY_COUPON_DEFINITION.equals(modified));
    modified = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE.minusDays(1), ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3,
        REFERENCE_START_DATE, REFERENCE_END_DATE, false);
    assertFalse(YoY_COUPON_DEFINITION.equals(modified));
    modified = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE.minusDays(1), 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3,
        REFERENCE_START_DATE, REFERENCE_END_DATE, false);
    assertFalse(YoY_COUPON_DEFINITION.equals(modified));
    modified = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3,
        REFERENCE_START_DATE.minusDays(1), REFERENCE_END_DATE, false);
    assertFalse(YoY_COUPON_DEFINITION.equals(modified));
    modified = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3,
        REFERENCE_START_DATE, REFERENCE_END_DATE.minusDays(1), false);
    assertFalse(YoY_COUPON_DEFINITION.equals(modified));
    modified = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 2.0, NOTIONAL, PRICE_INDEX, MONTH_LAG, 3,
        REFERENCE_START_DATE, REFERENCE_END_DATE, false);
    assertFalse(YoY_COUPON_DEFINITION.equals(modified));
    modified = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, 1.0, NOTIONAL + 10.0, PRICE_INDEX, MONTH_LAG, 3,
        REFERENCE_START_DATE, REFERENCE_END_DATE, false);
    assertFalse(YoY_COUPON_DEFINITION.equals(modified));
  }

  @Test
  /**
   * Tests the first based on indexation lag.
   */
  public void from2() {
    final CouponInflationYearOnYearMonthlyDefinition constructor = new CouponInflationYearOnYearMonthlyDefinition(CUR, PAYMENT_DATE, ACCRUAL_START_DATE, PAYMENT_DATE, 1.0, NOTIONAL, PRICE_INDEX,
        MONTH_LAG,
        3, REFERENCE_START_DATE, REFERENCE_END_DATE, false);
    final CouponInflationYearOnYearMonthlyDefinition from = CouponInflationYearOnYearMonthlyDefinition.from(ACCRUAL_START_DATE, PAYMENT_DATE, NOTIONAL, PRICE_INDEX, MONTH_LAG, false);
    assertEquals("Inflation zero-coupon : from", constructor, from);
  }

  @Test
  public void toDerivativesNoData() {
    final ZonedDateTime pricingDate = DateUtils.getUTCDate(2011, 7, 29);
    final Coupon yearOnYearCouponConverted = YoY_COUPON_DEFINITION.toDerivative(pricingDate);
    final double paymentTime = ACT_ACT.getDayCountFraction(pricingDate, PAYMENT_DATE);
    final double referenceStartTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_START_DATE);
    final double referenceEndTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_END_DATE);
    final double naturalPaymentStartPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_START_DATE);
    final double naturalPaymentEndPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_END_DATE);
    final CouponInflationYearOnYearMonthly yearOnYearCoupon = new CouponInflationYearOnYearMonthly(CUR, paymentTime, 1.0, NOTIONAL, PRICE_INDEX, referenceStartTime,
        naturalPaymentStartPaymentTime, referenceEndTime, naturalPaymentEndPaymentTime, false);
    assertEquals("Inflation zero-coupon: toDerivative", yearOnYearCouponConverted, yearOnYearCoupon);
  }

  @Test
  public void toDerivativesStartMonthNotknown() {
    final ZonedDateTime pricingDate = DateUtils.getUTCDate(2011, 7, 29);
    final DoubleTimeSeries<ZonedDateTime> priceIndexTS = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2017, 4, 30),
      DateUtils.getUTCDate(2017, 5, 31), DateUtils.getUTCDate(2018, 4, 30), DateUtils.getUTCDate(2018, 5, 31) },
        new double[] {
          127.23, 127.43, 128.23, 128.43 });
    final Coupon yearOnYearCouponConverted = YoY_COUPON_DEFINITION.toDerivative(pricingDate, priceIndexTS);
    final double paymentTime = ACT_ACT.getDayCountFraction(pricingDate, PAYMENT_DATE);
    final double referenceStartTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_START_DATE);
    final double referenceEndTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_END_DATE);
    final double naturalPaymentStartPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_START_DATE);
    final double naturalPaymentEndPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_END_DATE);
    final CouponInflationYearOnYearMonthly yearOnYearCoupon = new CouponInflationYearOnYearMonthly(CUR, paymentTime, 1.0, NOTIONAL, PRICE_INDEX, referenceStartTime,
        naturalPaymentStartPaymentTime, referenceEndTime, naturalPaymentEndPaymentTime, false);
    assertEquals("Inflation zero-coupon: toDerivative", yearOnYearCoupon, yearOnYearCouponConverted);
  }

  @Test
  public void toDerivativesStartMonthKnown() {
    final ZonedDateTime pricingDate = DateUtils.getUTCDate(2018, 7, 25);
    final DoubleTimeSeries<ZonedDateTime> priceIndexTS = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2017, 5, 31),
      DateUtils.getUTCDate(2017, 6, 30), DateUtils.getUTCDate(2018, 5, 31), DateUtils.getUTCDate(2018, 6, 30) },
        new double[] {
          127.23, 127.43, 128.23, 128.43 });
    final Coupon zeroCouponConverted = YoY_COUPON_DEFINITION.toDerivative(pricingDate, priceIndexTS);
    final double paymentTime = ACT_ACT.getDayCountFraction(pricingDate, PAYMENT_DATE);
    final CouponFixed zeroCoupon = new CouponFixed(CUR, paymentTime, 1.0, NOTIONAL, 128.23 / 127.23 - 1.0);
    assertEquals("Inflation zero-coupon: toDerivative", zeroCoupon, zeroCouponConverted);
  }

}


text:
@interface LPView : LPContentView

@property (nonatomic, copy) NSString *title;

@end