text:
class AddUrlhtmlToItems < ActiveRecord::Migration
  def change
    add_column :items, :url_html, :string
  end
end

redpajama_set_name: RedPajamaGithub


text:
..
      Licensed under the Apache License, Version 2.0 (the "License"); you may
      not use this file except in compliance with the License. You may obtain
      a copy of the License at

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

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

=====================================
How to get (more) involved with Nova
=====================================

So you want to get more involved with Nova. Welcome!

New to OpenStack?
==================

If you are new to OpenStack, please read the general guides on how you can
get more involved with OpenStack:

* http://www.openstack.org/assets/welcome-guide/OpenStackWelcomeGuide.pdf
* https://wiki.openstack.org/wiki/How_To_Contribute
* http://www.openstack.org/community/

New to Nova?
============

So you are new to Nova. We are currently working on some docs so its easy
to get more involved. Please see the drafts that are available here:

* Mentoring efforts, and getting started tips:
  https://wiki.openstack.org/wiki/Nova/Mentoring
* Info on process, with a focus on how you can go from an idea
  to getting code merged Nova:
  https://wiki.openstack.org/wiki/Nova/Liberty_Release_Schedule


text:
package org.apache.spark.sql.types

import scala.math.{Ordering, Integral, Numeric}
import scala.reflect.runtime.universe.typeTag

import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.sql.catalyst.ScalaReflectionLock

/**
 * :: DeveloperApi ::
 * The data type representing `Int` values. Please use the singleton [[DataTypes.IntegerType]].
 */
@DeveloperApi
class IntegerType private() extends IntegralType {
  // The companion object and this class is separated so the companion object also subclasses
  // this type. Otherwise, the companion object would be of type "IntegerType$" in byte code.
  // Defined with a private constructor so the companion object is the only possible instantiation.
  private[sql] type InternalType = Int
  @transient private[sql] lazy val tag = ScalaReflectionLock.synchronized { typeTag[InternalType] }
  private[sql] val numeric = implicitly[Numeric[Int]]
  private[sql] val integral = implicitly[Integral[Int]]
  private[sql] val ordering = implicitly[Ordering[InternalType]]

  /**
   * The default size of a value of the IntegerType is 4 bytes.
   */
  override def defaultSize: Int = 4

  override def simpleString: String = "int"

  private[spark] override def asNullable: IntegerType = this
}

case object IntegerType extends IntegerType


text:
#pragma once

#include "htmlpage.h"
#include "request.h"

class HelpPage : public HtmlPage
{
public:
    explicit HelpPage(const Request &request);
    HelpPage(const HelpPage &in) = delete;
    HelpPage(HelpPage &&in) = delete;
    HelpPage& operator=(const HelpPage &in) = delete;
    virtual ~HelpPage() = default;
};


text:
class CreateCategory < ActiveRecord::Migration
  def self.up
    create_table :categories do |t|
      t.string :name
      t.string :ancestry
      t.integer :mother_id
      t.timestamps
    end
    add_index :categories, :mother_id
  end

  def self.down
    drop_table :categories
  end
end


text:
package org.dlangplugin.run;

import com.intellij.application.options.ModulesComboBox;
import com.intellij.execution.configuration.EnvironmentVariablesComponent;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.ui.TextComponentAccessor;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.ui.RawCommandLineEditor;
import org.dlangplugin.DLangBundle;
import org.dlangplugin.module.DLangModuleType;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.Map;

/** DUB build system configuration UI.
 * @see https://github.com/D-Programming-Language/dub
 */
public class DLangRunDubConfigurationEditor extends SettingsEditor<DLangRunDubConfiguration>{
    private JPanel myMainPanel;
    private ModulesComboBox comboModule;
    private JCheckBox cbRunAfterBuild;
    private JCheckBox cbVerbose;
    private JCheckBox cbQuiet;
    private TextFieldWithBrowseButton pathWorkingDir;
    private RawCommandLineEditor textParameters;
    private EnvironmentVariablesComponent envVariables;

    /** Update editor UI with data of DLangRunDubConfiguration.
     * All components must be changed according to "config" data. */
    @Override
    protected void resetEditorFrom(DLangRunDubConfiguration config) {
        comboModule.fillModules(config.getProject(), DLangModuleType.getInstance());
        comboModule.setSelectedModule(config.getConfigurationModule().getModule());
        cbRunAfterBuild.setSelected(config.isRunAfterBuild());
        cbVerbose.setSelected(config.isVerbose());
        cbQuiet.setSelected(config.isQuiet());

        pathWorkingDir.setText(config.getWorkingDir());
        textParameters.setText(config.getAdditionalParams());
        Map<String,String> envVars = config.getEnvVars();
        if(envVars != null) {
            envVariables.setEnvs(config.getEnvVars());
        }
    }

    /** Save state of editor UI to DLangRunDubConfiguration instance. */
    @Override
    protected void applyEditorTo(DLangRunDubConfiguration config) throws ConfigurationException {
        config.setModule(comboModule.getSelectedModule());
        config.setRunAfterBuild(cbRunAfterBuild.isSelected());
        config.setVerbose(cbVerbose.isSelected());
        config.setQuiet(cbQuiet.isSelected());
        config.setWorkingDir(pathWorkingDir.getText());
        config.setAdditionalParams(textParameters.getText());
        config.setEnvVars(envVariables.getEnvs());
    }

    @NotNull
    @Override
    protected JComponent createEditor() {
        FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
        fcd.setShowFileSystemRoots(true);
        fcd.setTitle(DLangBundle.message("dmd.run.config.selectworkingdir.title"));
        fcd.setDescription(DLangBundle.message("dmd.run.config.selectworkingdir.description"));
        fcd.setHideIgnored(false);

        pathWorkingDir.addBrowseFolderListener(null,
                new TextFieldWithBrowseButton.BrowseFolderActionListener<JTextField>(fcd.getTitle(), fcd.getDescription(),
                        pathWorkingDir, null, fcd, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) );

        return myMainPanel;
    }

    @Override
    protected void disposeEditor() {
    }
}


text:
import settingsMenu from '@/services/settingsMenu';
import template from './settings-screen.html';

export default function init(ngModule) {
  ngModule.component('settingsScreen', {
    transclude: true,
    template,
    controller($location, currentUser) {
      this.settingsMenu = settingsMenu;
      this.isActive = menuItem => menuItem.isActive($location.path());
      this.isAvailable = permission => permission === undefined || currentUser.hasPermission(permission);
    },
  });
}

init.init = true;


text:
package coop.ekologia.presentation.controller.cms;

import java.io.IOException;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import coop.ekologia.DTO.cms.PageDTO;
import coop.ekologia.presentation.EkologiaServlet;
import coop.ekologia.service.cms.PageServiceInterface;

@WebServlet("/home")
public class HomeServlet extends EkologiaServlet {
	private static final long serialVersionUID = -4096633312380583816L;
	public static final String routing = "/home";

	@EJB
	private PageServiceInterface pageService;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		PageDTO page = pageService.getPageFromUrl("home");
		if (page != null) {
			req.setAttribute("page", page);
			forwardToJsp("cms/home", req, resp);
		}
	}
}


text:
// SEE command_line_parser.h FOR INTERFACE DOCUMENTATION

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "command_line_parser.h"

static char *flag_name_terminators = "=";

Command_Line_Schema*
new_command_line_schema(char *program_name)
{
    Command_Line_Schema* self = malloc(sizeof(Command_Line_Schema));
    if(self == NULL) {
        fprintf(stderr, "%s : failed allocating memory : new_command_line_schema\n", program_name);
        exit(EXIT_FAILURE);
    }

    self->program_name = program_name;
    self->flag_descriptions = NULL;
    self->number_of_flag_descriptions = 0;
    self->process_non_flag_arg = NULL;

    return self;
}

void
destroy_command_line_schema(Command_Line_Schema *self)
{
    free(self);
}

void
set_flag_descriptions(Command_Line_Schema *self,
                      Command_Line_Flag fds[],
                      int number_of_flag_descriptions)
{
    self->number_of_flag_descriptions = number_of_flag_descriptions;
    self->flag_descriptions = fds;
}

void
set_non_flag_arg_callback(
        Command_Line_Schema *self,
        void (*process_non_flag_arg)(char *argument, int argument_sequence_order, void *context))
{
    self->process_non_flag_arg = process_non_flag_arg;
}

// returns NULL is s doesn't start by the prefix, and the first
// character after the prefix otherwise
static char*
strip_prefix_from(char *prefix, char *s)
{
    loop:
    if(*prefix == 0) {
        return s;
    } else if(*prefix != *s) {
        return NULL;
    } else if(*s == 0) {
        return NULL;
    } else {
        prefix ++;
        s ++;
        goto loop;
    }
}

static void
process_long_flag(char *full_flag_arg, Command_Line_Schema *schema, void *context)
{
    size_t flag_name_length = strcspn(full_flag_arg, flag_name_terminators);  // length of anything before "="

    for(int i=0; i<schema->number_of_flag_descriptions; i++) {
        if(schema->flag_descriptions[i].long_flag != NULL) {
            size_t ref_flag_name_length = strlen(schema->flag_descriptions[i].long_flag);
            if(flag_name_length == ref_flag_name_length &&
               !strncmp(full_flag_arg, schema->flag_descriptions[i].long_flag, flag_name_length)) {
                schema->flag_descriptions[i].callback(full_flag_arg, context);
                return;
            }
        }
    }
    fprintf(stderr, "%s : unknown option : --%s\n", schema->program_name, full_flag_arg);
    exit(1);
}

static void
process_short_flag(char flag, char *full_flag_arg, Command_Line_Schema *schema, void *context)
{
    for(int i=0; i<schema->number_of_flag_descriptions; i++) {
        if(schema->flag_descriptions[i].short_flag == flag) {
            schema->flag_descriptions[i].callback(full_flag_arg, context);
            return;
        }
    }
    fprintf(stderr, "%s : unknown option : -%c\n", schema->program_name, flag);
    exit(1);
}

static void
process_short_flags(char *full_bag_of_flags, Command_Line_Schema *schema, void *context)
{
    size_t flag_bag_length = strcspn(full_bag_of_flags, flag_name_terminators);  // length of anything before "="
    for(size_t flag_index=0 ; flag_index<flag_bag_length ; flag_index++) {
        process_short_flag( full_bag_of_flags[flag_index], full_bag_of_flags, schema, context);
    }
}

int
parse_command_line(int argc, char **argv,
                   Command_Line_Schema *schema,
                   void *context)
{
    int non_flag_args_count = 0;
    for(int i=1; i<argc; i++) {
        char *stripped_arg = strip_prefix_from("--", argv[i]);
        if(stripped_arg != NULL) {
            process_long_flag(stripped_arg, schema, context);
            continue;
        }

        stripped_arg = strip_prefix_from("-", argv[i]);
        if(stripped_arg != NULL) {
            process_short_flags(stripped_arg, schema, context);
            continue;
        }

        if(schema->process_non_flag_arg != NULL) {
            schema->process_non_flag_arg(argv[i], non_flag_args_count, context);
            non_flag_args_count ++;
        }
    }
    return 0;
}


text:
layout: default
lecturer: Martin Golumbic
schedule: Spring (TBD)
location: TBD
title: Algorithmic Graph Theory
abstract: The past twenty years have been an amazingly fruitful period of research in algorithmic graph theory and structured families of graphs. Especially important have been the theory and applications of new intersection graph models such as generalizations of permutation graphs and interval graphs. These have lead to new families of perfect graphs and many algorithmic results.
year: 2018
---


text:
package com.alibaba.jstorm.zk;

import java.io.IOException;
import java.net.InetSocketAddress;

import org.apache.zookeeper.server.NIOServerCnxnFactory;
import org.apache.zookeeper.server.ZooKeeperServer;

public class Factory extends NIOServerCnxnFactory {

	public Factory(InetSocketAddress addr, int maxcc) throws IOException {
		super();
		this.configure(addr, maxcc);
	}

	public ZooKeeperServer getZooKeeperServer() {
		return zkServer;
	}

}


text:
package infrastructure;

/**
 * Created by Дима on 06.11.2017.
 */
public class StringUtils {

    public static void main(String[] args) {

        System.out.println(randomString("alpha", 10));
        System.out.println(randomString("numeric", 10));
        System.out.println(randomString("alphanumeric", 10));
        System.out.println(randomString("hex", 16));
    }

//    метод для генерации рандомной строки с числами, цифрами и числами+цифры
    public static String randomString(String mode, int length){
        String alphabet;
        switch (mode){
            case "alpha":
                alphabet = "abcdefghijklmnopqrstuvwxyz";
                break;
            case "numeric":
                alphabet = "0123456789";
                break;
            case "alphanumeric":
                alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
                break;
            case "hex":
                alphabet = "0123456789abcdef";
                break;
                default:
                    alphabet = "";
        }

        String result = "";
        for (int i=0; i<length;i++){
            int index = (int)(Math.random()*alphabet.length());
            result = result + alphabet.charAt(index);
        }

        return result;
    }
}


text:
#ifndef LARGE_OBJECT_H
#define LARGE_OBJECT_H

#include "utils/snapshot.h"

/*----------
 * Data about a currently-open large object.
 *
 * id is the logical OID of the large object
 * snapshot is the snapshot to use for read/write operations
 * subid is the subtransaction that opened the desc (or currently owns it)
 * offset is the current seek offset within the LO
 * flags contains some flag bits
 *
 * NOTE: in current usage, flag bit IFS_RDLOCK is *always* set, and we don't
 * bother to test for it.  Permission checks are made at first read or write
 * attempt, not during inv_open(), so we have other bits to remember that.
 *
 * NOTE: before 7.1, we also had to store references to the separate table
 * and index of a specific large object.  Now they all live in pg_largeobject
 * and are accessed via a common relation descriptor.
 *----------
 */
typedef struct LargeObjectDesc
{
	Oid			id;				/* LO's identifier */
	Snapshot	snapshot;		/* snapshot to use */
	SubTransactionId subid;		/* owning subtransaction ID */
	uint64		offset;			/* current seek pointer */
	int			flags;			/* see flag bits below */

/* bits in flags: */
#define IFS_RDLOCK		(1 << 0)	/* LO was opened for reading */
#define IFS_WRLOCK		(1 << 1)	/* LO was opened for writing */
#define IFS_RD_PERM_OK	(1 << 2)	/* read permission has been verified */
#define IFS_WR_PERM_OK	(1 << 3)	/* write permission has been verified */

} LargeObjectDesc;

/*
 * Each "page" (tuple) of a large object can hold this much data
 *
 * We could set this as high as BLCKSZ less some overhead, but it seems
 * better to make it a smaller value, so that not as much space is used
 * up when a page-tuple is updated.  Note that the value is deliberately
 * chosen large enough to trigger the tuple toaster, so that we will
 * attempt to compress page tuples in-line.  (But they won't be moved off
 * unless the user creates a toast-table for pg_largeobject...)
 *
 * Also, it seems to be a smart move to make the page size be a power of 2,
 * since clients will often be written to send data in power-of-2 blocks.
 * This avoids unnecessary tuple updates caused by partial-page writes.
 *
 * NB: Changing LOBLKSIZE requires an initdb.
 */
#define LOBLKSIZE		(BLCKSZ / 4)

/*
 * Maximum length in bytes for a large object.  To make this larger, we'd
 * have to widen pg_largeobject.pageno as well as various internal variables.
 */
#define MAX_LARGE_OBJECT_SIZE	((int64) INT_MAX * LOBLKSIZE)

/*
 * Function definitions...
 */

/* inversion stuff in inv_api.c */
extern void close_lo_relation(bool isCommit);
extern Oid	inv_create(Oid lobjId);
extern LargeObjectDesc *inv_open(Oid lobjId, int flags, MemoryContext mcxt);
extern void inv_close(LargeObjectDesc *obj_desc);
extern int	inv_drop(Oid lobjId);
extern int64 inv_seek(LargeObjectDesc *obj_desc, int64 offset, int whence);
extern int64 inv_tell(LargeObjectDesc *obj_desc);
extern int	inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes);
extern int	inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes);
extern void inv_truncate(LargeObjectDesc *obj_desc, int64 len);

#endif   /* LARGE_OBJECT_H */


text:
"""
PureMVC Python Demo - wxPython Employee Admin
By Toby de Havilland <toby.de.havilland@puremvc.org>
Copyright(c) 2007-08 Toby de Havilland, Some rights reserved.
Addapted for pyjamas: Kees Bos
"""

from puremvc.patterns.mediator import Mediator

import model, vo
import ApplicationConstants
from ApplicationConstants import Command, Notification

from pyjamas.Window import alert

class DialogMediator(Mediator):

    NAME = 'DialogMediator'

    def __init__(self, viewComponent):
        super(DialogMediator, self).__init__(DialogMediator.NAME, viewComponent)
        self.viewComponent.mediator = self

    def listNotificationInterests(self):
        return [
        Notification.SHOW_DIALOG,
        ]

    def handleNotification(self, note):
        try:
            noteName = note.getName()
            if noteName == Notification.SHOW_DIALOG:
                alert(note.getBody())
        except:
            raise

class UserFormMediator(Mediator):

    NAME = 'UserFormMediator'

    userProxy = None

    def __init__(self, viewComponent):
        super(UserFormMediator, self).__init__(UserFormMediator.NAME, viewComponent)
        self.viewComponent.mediator = self
        self.viewComponent.addBtn.addClickListener(self.onAdd)
        self.viewComponent.cancelBtn.addClickListener(self.onCancel)

        self.userProxy = self.facade.retrieveProxy(model.UserProxy.NAME)
        self.viewComponent.updateDepartmentCombo(ApplicationConstants.DeptList,
                                                 ApplicationConstants.DEPT_NONE_SELECTED)

    def listNotificationInterests(self):
        return [
        Notification.NEW_USER,
        Notification.USER_DELETED,
        Notification.USER_SELECTED
        ]

    def handleNotification(self, note):
        try:
            noteName = note.getName()
            if noteName == Notification.NEW_USER:
                self.viewComponent.updateMode(self.viewComponent.MODE_ADD)
                self.clearForm()
                self.viewComponent.firstInput.setFocus(True)

            if noteName == Notification.USER_DELETED:
                self.viewComponent.user = None
                self.clearForm()

            if noteName == Notification.USER_SELECTED:
                user = note.getBody()
                if not user:
                    self.clearForm()
                else:
                    self.viewComponent.updateUser(note.getBody())
                    self.viewComponent.updateMode(self.viewComponent.MODE_EDIT)
        except:
            raise

    def clearForm(self):
        self.viewComponent.user = None
        self.viewComponent.usernameInput.setText('')
        self.viewComponent.firstInput.setText('')
        self.viewComponent.lastInput.setText('')
        self.viewComponent.emailInput.setText('')
        self.viewComponent.passwordInput.setText('')
        self.viewComponent.confirmInput.setText('')
        self.viewComponent.departmentCombo.setItemTextSelection(None)

    def onAdd(self, evnt):
        if self.viewComponent.mode == self.viewComponent.MODE_ADD:
            self.addUser()
        else:
            self.updateUser()

    def addUser(self):
        l = self.viewComponent.departmentCombo.getSelectedItemText(True)
        l = l and l[0] or None
        user = vo.UserVO(self.viewComponent.usernameInput.getText(),
                         self.viewComponent.firstInput.getText(),
                         self.viewComponent.lastInput.getText(),
                         self.viewComponent.emailInput.getText(),
                         self.viewComponent.passwordInput.getText(),
                         l)
        self.viewComponent.user = user
        self.userProxy.addItem(user)
        self.sendNotification(Notification.USER_ADDED, user)
        self.clearForm()

    def updateUser(self):
        l = self.viewComponent.departmentCombo.getSelectedItemText(True)
        l = l and l[0] or None
        user = vo.UserVO(self.viewComponent.usernameInput.getText(),
                         self.viewComponent.firstInput.getText(),
                         self.viewComponent.lastInput.getText(),
                         self.viewComponent.emailInput.getText(),
                         self.viewComponent.passwordInput.getText(),
                         l)
        self.viewComponent.user = user
        self.userProxy.updateItem(user)
        self.sendNotification(Notification.USER_UPDATED, user)
        self.clearForm()

    def onCancel(self, evnt):
        self.sendNotification(Notification.CANCEL_SELECTED)
        self.clearForm()

class UserListMediator(Mediator):

    NAME = 'UserListMediator'

    userProxy = None

    def __init__(self, viewComponent):
        super(UserListMediator, self).__init__(UserListMediator.NAME, viewComponent)
        self.viewComponent.newBtn.addClickListener(self.onNewUser)
        self.viewComponent.deleteBtn.addClickListener(self.onDeleteUser)
        self.viewComponent.userGrid.addTableListener(self.onSelectUser)

        self.userProxy = self.facade.retrieveProxy(model.UserProxy.NAME)
        self.viewComponent.updateUserGrid(self.userProxy.getUsers())

    def listNotificationInterests(self):
        return [
        Notification.CANCEL_SELECTED,
        Notification.USER_UPDATED,
        Notification.USER_ADDED,
        Notification.USER_DELETED
        ]

    def handleNotification(self, note):
        try:
            noteName = note.getName()
            self.viewComponent.deSelect()
            if noteName == Notification.CANCEL_SELECTED:
                self.viewComponent.deSelect()
                self.viewComponent.updateUserGrid(self.userProxy.getUsers())

            elif noteName == Notification.USER_UPDATED:
                self.viewComponent.deSelect()
                self.viewComponent.updateUserGrid(self.userProxy.getUsers())

            elif noteName == Notification.USER_ADDED:
                self.viewComponent.deSelect()
                self.viewComponent.updateUserGrid(self.userProxy.getUsers())

            elif noteName == Notification.USER_DELETED:
                self.viewComponent.deSelect()
                self.viewComponent.updateUserGrid(self.userProxy.getUsers())
        except:
            raise

    def onSelectUser(self, evt):
        self.sendNotification(Notification.USER_SELECTED,
                              self.viewComponent.selectedUser)

    def onNewUser(self, evnt):
        self.viewComponent.deSelect()
        self.sendNotification(Notification.NEW_USER)

    def onDeleteUser(self, evnt):
        if self.viewComponent.selectedUser:
            self.sendNotification(Command.DELETE_USER,
                                  self.viewComponent.selectedUser)
            self.viewComponent.deSelect()

class RolePanelMediator(Mediator):

    NAME = 'RolePanelMediator'

    roleProxy = None

    def __init__(self, viewComponent):
        super(RolePanelMediator, self).__init__(RolePanelMediator.NAME, viewComponent)
        self.viewComponent.addBtn.addClickListener(self.onAddRole)
        self.viewComponent.removeBtn.addClickListener(self.onRemoveRole)

        self.roleProxy = self.facade.retrieveProxy(model.RoleProxy.NAME)
        self.viewComponent.updateRoleCombo(ApplicationConstants.RoleList,
                                           ApplicationConstants.ROLE_NONE_SELECTED)

    def getRolePanel(self):
        return viewComponent

    def onAddRole(self, evnt):
        self.roleProxy.addRoleToUser(self.viewComponent.user, self.viewComponent.selectedRole)

    def onRemoveRole(self, evnt):
        self.roleProxy.removeRoleFromUser(self.viewComponent.user, self.viewComponent.selectedRole)
        self.viewComponent.updateRoleList(self.roleProxy.getUserRoles(self.viewComponent.user.username))

    def listNotificationInterests(self):
        return [
        Notification.NEW_USER,
        Notification.USER_ADDED,
        Notification.USER_UPDATED,
        Notification.USER_DELETED,
        Notification.CANCEL_SELECTED,
        Notification.USER_SELECTED,
        Command.ADD_ROLE_RESULT,
        ]

    def handleNotification(self, note):
        try:
            noteName = note.getName()

            if noteName == Notification.NEW_USER:
                self.clearForm()

            elif noteName == Notification.USER_ADDED:
                self.viewComponent.user = note.getBody()
                roleVO = vo.RoleVO(self.viewComponent.user.username)
                self.roleProxy.addItem(roleVO)
                self.clearForm()

            elif noteName == Notification.USER_UPDATED:
                self.clearForm()

            elif noteName == Notification.USER_DELETED:
                self.clearForm()

            elif noteName == Notification.CANCEL_SELECTED:
                self.clearForm()

            elif noteName == Notification.USER_SELECTED:
                self.viewComponent.user = note.getBody()
                if not self.viewComponent.user:
                    self.viewComponent.updateRoleList(self.roleProxy.getUserRoles(None))
                else:
                    self.viewComponent.updateRoleList(self.roleProxy.getUserRoles(self.viewComponent.user.username))

            elif noteName == Command.ADD_ROLE_RESULT:
                self.viewComponent.updateRoleList(self.roleProxy.getUserRoles(self.viewComponent.user.username))
        except:
            raise

    def clearForm(self):
        self.viewComponent.user = None
        self.viewComponent.updateRoleList([])
        self.viewComponent.roleCombo.setItemTextSelection(None)


text:
[![NPM](https://nodei.co/npm/grunt-dust-compiler.png?downloads=true)](https://www.npmjs.org/package/grunt-dust-compiler)

> A grunt task for compiling dust templates.

## Prerequisites

In order to compile dust templates dustjs-linkedin must be installed globally to use the `dustc` command:

```shell
npm install -g dustjs-linkedin
```

## Getting Started
This plugin requires Grunt `~0.4.0`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-dust-compiler --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-dust-compiler');
```

*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4)*

## Dustc task
_Run this task with the `grunt dustc` command._

Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.
### Options

#### registerFileName
Type: `Boolean`
Default: `false`

By default dust templates are compiled and registered with its relative path. If `registerFileName` is set to `true`, then the compiled template(s) will be registered with only its filename.

### Usage Examples

```js
dustc: {
  main: {
    files: [
      // includes files within path
      {expand: true, src: ['path/*'], dest: 'dest/', filter: 'isFile'},

      // includes files within path and its sub-directories
      {expand: true, src: ['path/**'], dest: 'dest/'},

      // makes all src relative to cwd
      {expand: true, cwd: 'path/', src: ['**'], dest: 'dest/'},

      // register dust templates individually with register property
      {src: ['path/file.dust'], dest: 'dest/file.js', register: 'foo'},
    ]
  }
}
```

This task supports all the file mapping format Grunt supports. Please read [Globbing patterns](http://gruntjs.com/configuring-tasks#globbing-patterns) and [Building the files object dynamically](http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically) for additional details.

Here are some additional examples, given the following file tree:
```shell
$ tree -I node_modules
.
├── Gruntfile.js
└── src
    ├── a
    └── subdir
        └── b

2 directories, 3 files
```

**Compile a single file tree:**
```js
dustc: {
  main: {
    src: 'src/*',
    dest: 'dest/',
  },
},
```

```shell
$ grunt dustc
Running "dustc:main" (dustc) task
Created 1 directories, copied 1 files

Done, without errors.
$ tree -I node_modules
.
├── Gruntfile.js
├── dest
│   └── src
│       ├── a
│       └── subdir
└── src
    ├── a
    └── subdir
        └── b

5 directories, 4 files
```

**Flattening the filepath output:**

```js
dustc: {
  main: {
    expand: true,
    cwd: 'src/',
    src: '**',
    dest: 'dest/',
    flatten: true,
    filter: 'isFile',
  },
},
```

```shell
$ grunt dustc
Running "dustc:main" (dustc) task
Copied 2 files

Done, without errors.
$ tree -I node_modules
.
├── Gruntfile.js
├── dest
│   ├── a
│   └── b
└── src
    ├── a
    └── subdir
        └── b

3 directories, 5 files
```

##### Troubleshooting

By default, if a file or directory is not found it is quietly ignored. If the file should exist, and non-existence generate an error, then add `nonull:true`. For instance, this Gruntfile.js entry:

```js
dustc: {
  main: {
    nonull: true,
    src: 'not-there',
    dest: 'create-me',
  },
},
```

gives this output:

```shell
$ grunt dustc
Running "dustc:main" (dustc) task
Warning: Unable to read "not-there" file (Error code: ENOENT). Use --force to continue.

Aborted due to warnings.
```

---

Task submitted by Matthew Schneider


text: <!DOCTYPE html PUBLIC "a" "B">


text:
import TransformParser from "../lib/TransformParser.js";
import SampleHandler from "../lib/SampleHandler.js";

const parser = new TransformParser();
const source = "matrix(1, 2, 3, 4, 5, 6)";

parser.setHandler(new SampleHandler());
parser.parseTransform(source);


text:
#ifndef SFML_SOUNDRECORDER_HPP
#define SFML_SOUNDRECORDER_HPP

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/Export.hpp>
#include <SFML/System/Thread.hpp>
#include <vector>

namespace sf
{
////////////////////////////////////////////////////////////
/// \brief Abstract base class for capturing sound data
///
////////////////////////////////////////////////////////////
class SFML_AUDIO_API SoundRecorder
{
public :

    ////////////////////////////////////////////////////////////
    /// \brief destructor
    ///
    ////////////////////////////////////////////////////////////
    virtual ~SoundRecorder();

    ////////////////////////////////////////////////////////////
    /// \brief Start the capture
    ///
    /// The \a sampleRate parameter defines the number of audio samples
    /// captured per second. The higher, the better the quality
    /// (for example, 44100 samples/sec is CD quality).
    /// This function uses its own thread so that it doesn't block
    /// the rest of the program while the capture runs.
    /// Please note that only one capture can happen at the same time.
    ///
    /// \param sampleRate Desired capture rate, in number of samples per second
    ///
    /// \see stop
    ///
    ////////////////////////////////////////////////////////////
    void start(unsigned int sampleRate = 44100);

    ////////////////////////////////////////////////////////////
    /// \brief Stop the capture
    ///
    /// \see start
    ///
    ////////////////////////////////////////////////////////////
    void stop();

    ////////////////////////////////////////////////////////////
    /// \brief Get the sample rate
    ///
    /// The sample rate defines the number of audio samples
    /// captured per second. The higher, the better the quality
    /// (for example, 44100 samples/sec is CD quality).
    ///
    /// \return Sample rate, in samples per second
    ///
    ////////////////////////////////////////////////////////////
    unsigned int getSampleRate() const;

    ////////////////////////////////////////////////////////////
    /// \brief Check if the system supports audio capture
    ///
    /// This function should always be called before using
    /// the audio capture features. If it returns false, then
    /// any attempt to use sf::SoundRecorder or one of its derived
    /// classes will fail.
    ///
    /// \return True if audio capture is supported, false otherwise
    ///
    ////////////////////////////////////////////////////////////
    static bool isAvailable();

protected :

    ////////////////////////////////////////////////////////////
    /// \brief Default constructor
    ///
    /// This constructor is only meant to be called by derived classes.
    ///
    ////////////////////////////////////////////////////////////
    SoundRecorder();

    ////////////////////////////////////////////////////////////
    /// \brief Start capturing audio data
    ///
    /// This virtual function may be overriden by a derived class
    /// if something has to be done every time a new capture
    /// starts. If not, this function can be ignored; the default
    /// implementation does nothing.
    ///
    /// \return True to start the capture, or false to abort it
    ///
    ////////////////////////////////////////////////////////////
    virtual bool onStart();

    ////////////////////////////////////////////////////////////
    /// \brief Process a new chunk of recorded samples
    ///
    /// This virtual function is called every time a new chunk of
    /// recorded data is available. The derived class can then do
    /// whatever it wants with it (storing it, playing it, sending
    /// it over the network, etc.).
    ///
    /// \param samples     Pointer to the new chunk of recorded samples
    /// \param sampleCount Number of samples pointed by \a samples
    ///
    /// \return True to continue the capture, or false to stop it
    ///
    ////////////////////////////////////////////////////////////
    virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount) = 0;

    ////////////////////////////////////////////////////////////
    /// \brief Stop capturing audio data
    ///
    /// This virtual function may be overriden by a derived class
    /// if something has to be done every time the capture
    /// ends. If not, this function can be ignored; the default
    /// implementation does nothing.
    ///
    ////////////////////////////////////////////////////////////
    virtual void onStop();

private :

    ////////////////////////////////////////////////////////////
    /// \brief Function called as the entry point of the thread
    ///
    /// This function starts the recording loop, and returns
    /// only when the capture is stopped.
    ///
    ////////////////////////////////////////////////////////////
    void record();

    ////////////////////////////////////////////////////////////
    /// \brief Get the new available audio samples and process them
    ///
    /// This function is called continuously during the
    /// capture loop. It retrieves the captured samples and
    /// forwards them to the derived class.
    ///
    ////////////////////////////////////////////////////////////
    void processCapturedSamples();

    ////////////////////////////////////////////////////////////
    /// \brief Clean up the recorder's internal resources
    ///
    /// This function is called when the capture stops.
    ///
    ////////////////////////////////////////////////////////////
    void cleanup();

    ////////////////////////////////////////////////////////////
    // Member data
    ////////////////////////////////////////////////////////////
    Thread             m_thread;      ///< Thread running the background recording task
    std::vector<Int16> m_samples;     ///< Buffer to store captured samples
    unsigned int       m_sampleRate;  ///< Sample rate
    bool               m_isCapturing; ///< Capturing state
};

} // namespace sf

#endif // SFML_SOUNDRECORDER_HPP

////////////////////////////////////////////////////////////
/// \class sf::SoundRecorder
/// \ingroup audio
///
/// sf::SoundBuffer provides a simple interface to access
/// the audio recording capabilities of the computer
/// (the microphone). As an abstract base class, it only cares
/// about capturing sound samples, the task of making something
/// useful with them is left to the derived class. Note that
/// SFML provides a built-in specialization for saving the
/// captured data to a sound buffer (see sf::SoundBufferRecorder).
///
/// A derived class has only one virtual function to override:
/// \li onProcessSamples provides the new chunks of audio samples while the capture happens
///
/// Moreover, two additionnal virtual functions can be overriden
/// as well if necessary:
/// \li onStart is called before the capture happens, to perform custom initializations
/// \li onStop is called after the capture ends, to perform custom cleanup
///
/// The audio capture feature may not be supported or activated
/// on every platform, thus it is recommended to check its
/// availability with the isAvailable() function. If it returns
/// false, then any attempt to use an audio recorder will fail.
///
/// It is important to note that the audio capture happens in a
/// separate thread, so that it doesn't block the rest of the
/// program. In particular, the onProcessSamples and onStop
/// virtual functions (but not onStart) will be called
/// from this separate thread. It is important to keep this in
/// mind, because you may have to take care of synchronization
/// issues if you share data between threads.
///
/// Usage example:
/// \code
/// class CustomRecorder : public sf::SoundRecorder
/// {
///     virtual bool onStart() // optional
///     {
///         // Initialize whatever has to be done before the capture starts
///         ...
///
///         // Return true to start playing
///         return true;
///     }
///
///     virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount)
///     {
///         // Do something with the new chunk of samples (store them, send them, ...)
///         ...
///
///         // Return true to continue playing
///         return true;
///     }
///
///     virtual void onStop() // optional
///     {
///         // Clean up whatever has to be done after the capture ends
///         ...
///     }
/// }
///
/// // Usage
/// if (CustomRecorder::isAvailable())
/// {
///     CustomRecorder recorder;
///     recorder.start();
///     ...
///     recorder.stop();
/// }
/// \endcode
///
/// \see sf::SoundBufferRecorder
///
////////////////////////////////////////////////////////////


text:
title: 'array_split: Multi-dimensional array partitioning'
tags:
  - multi-dimensional array
  - partitioning
  - tile
  - tiling
  - domain decomposition
  - python
  - ndarray
  - numpy
authors:
 - name: Shane J Latham
   orcid: 0000-0001-8033-4665
   affiliation: 1
affiliations:
 - name: Department of Applied Mathematics, Research School of Physics and Engineering, The Australian National University
   index: 1
date: 12 September 2017
bibliography: paper.bib
---

# Summary

The `array_split` [@latham2017arraysplit] Python package extends existing dense
array partitioning capabilities found in the `numpy` [@walt2011numpy] (`numpy.array_split`)
and `skimage` [@van2014scikit] (`skimage.util.view_as_blocks`) Python packages.
In particular, it provides the means for partitioning
based on *array shape* (rather than requiring an actual `numpy.ndarray` object)
and can partition into *sub-arrays* based on a variety of criteria including:
per-axis number of partitions, total number of sub-arrays (with per-axis
number of partition constraints), explicit sub-array shape and constraining a
partitioning with an upper bound on the resulting sub-array number of bytes.

Application areas include:

Parallel Processing
:   Data parallelism by partitioning array for multi-process concurrency
    (e.g. `multiprocessing` [@pythonmultiprocessingmodule] or `mpi4py` [@dalcin2011parallel])
    based on number of cores,
    or partitioning for accelerator hardware concurrency
    (e.g. `pyopencl` or `pycuda` [kloeckner_pycuda_2012]) based on hardware memory limits.

File I/O
:   Partitioning large arrays for output to separate files
    (e.g. as part of a
    [virtual dataset](https://support.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesVirtualDatasetDocs.html "HDF5 Virtual Dataset (VDS) Documentation")
    [@hdf5, @collette_python_hdf5_2014]) based on maximum file size, or out-of-core partitioning
    based on in-core memory limits.

# References


text:
if RUBY_PLATFORM == 'java'
  class Enumerator
    class Lazy
      def initialize(coll)

        @lazy = Yid.new do |yielder|
          if block_given?
            coll.each do |x|
              yield yielder, x
            end
          else
            coll.each do |x|
              yielder.yield x
            end
          end
        end
      end

      def each
        loop { yield @lazy.next }
      rescue StopIteration
      end

      def select
        Lazy.new(self) do |yielder, *vals|
          result = yield(*vals)
          yielder.yield(*vals) if result
        end
      end

      def map
        Lazy.new(self) do |yielder, *vals|
          yielder.yield yield(*vals)
        end
      end

      def take(n)
        i = 0
        Lazy.new(self) do |yielder, *vals|
          if i < n
            i += 1
            yielder.yield(*vals)
          else
            raise StopIteration
          end
        end
      end

      def take_while
        stop_iter = false
        Lazy.new(self) do |yielder, *vals|
          raise StopIteration if stop_iter
          result = yield(*vals)
          if result
            yielder.yield(*vals)
          else
            stop_iter = true
          end
        end
      end

      def drop(n)
        i = 0
        Lazy.new(self) do |yielder, *vals|
          if i < n
            i += 1
          else
            yielder.yield(*vals)
          end
        end
      end

      def drop_while
        to_drop = true
        Lazy.new(self) do |yielder, *vals|
          if to_drop
            to_drop = false unless yield(*vals)
          end

          unless to_drop
            yielder.yield(*vals)
          end
        end
      end

      def next
        @lazy.next
      end

      def force
        ret = []
        while val = @lazy.next
          ret << val
        end
      rescue StopIteration
        ret
      end

      private
      # kudos http://stackoverflow.com/a/19660333/482757
      class Yid
        def initialize(&block)
          # creates a new Fiber to be used as an Yielder
          @yielder  = Fiber.new do
            yield Fiber
            raise StopIteration # raise an error if there is no more calls
          end
        end

        def next
          # return the value and wait until the next call
          @yielder.resume
        end
      end
    end
  end

  module Laziable
    def lazy
      Enumerator::Lazy.new(self)
    end
  end

  class Range
    include Laziable
  end
end


text: yarpn-lib -- Library for Yet Another RPN Compiler and Interpreter


text:
import { NgModule } from '@angular/core';
import { FusionChartsComponent } from './src/fusioncharts.component';
import { FusionChartsDirective } from './src/fusioncharts.directive';
import { FusionChartsPipe } from './src/fusioncharts.pipe';
import { FusionChartsStatic, FusionChartsService } from './src/fusioncharts.service';
export { FusionChartsComponent, FusionChartsDirective, FusionChartsPipe, FusionChartsStatic };
var FusionChartsModule = /** @class */ (function () {
    function FusionChartsModule() {
    }
    // Keep this for backward compatible
    FusionChartsModule.forRoot = function (fcCore) {
        var fcModules = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            fcModules[_i - 1] = arguments[_i];
        }
        return {
            ngModule: FusionChartsModule,
            providers: [{
                    provide: FusionChartsStatic,
                    useValue: {
                        core: fcCore,
                        modules: fcModules
                    }
                }]
        };
    };
    FusionChartsModule.fcRoot = function (fcCore) {
        var fcModules = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            fcModules[_i - 1] = arguments[_i];
        }
        FusionChartsService.setFCRoot({
            core: fcCore,
            modules: fcModules
        });
    };
    FusionChartsModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [
                        FusionChartsComponent,
                        FusionChartsDirective,
                        FusionChartsPipe
                    ],
                    exports: [
                        FusionChartsComponent,
                        FusionChartsDirective,
                        FusionChartsPipe
                    ],
                    providers: [
                        FusionChartsService,
                        FusionChartsStatic
                    ]
                },] },
    ];
    /** @nocollapse */
    FusionChartsModule.ctorParameters = function () { return []; };
    return FusionChartsModule;
}());
export { FusionChartsModule };
//# sourceMappingURL=index.js.map


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/menu_watch_character"
        android:icon="@drawable/ic_action_search"
        android:showAsAction="ifRoom"
        android:title="@string/watch_character"
        app:showAsAction="ifRoom" />

</menu>


text:
UberModel connects your legacy datasource to your ruby application, allowing
you to map legacy calls (TCP server, non-relational DB, etc) to Ruby models.

Tight integration exists between UberModel and ActiveRecord, allowing for
2-way associations that are handled transparently.

Unlike ActiveRecord, model attributes are defined manually by the user.  Data
access is handled by custom adapters, written by the user, which specify how to
interact with your datasource.  Each UberModel class will have a model module
that shadows it, specifying how to perform the 4 CRUD actions.

## Installation

Add this line to your application's Gemfile:

    gem 'uber_model'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install uber_model

## Usage

TODO: Write usage instructions here

## Contributing

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


text:
A fast vagrant global-status command.

## Description

`vagrant-global-status` is fast `vagrant global-status` command.
It parses directly vagrant machine-index file, not use Ruby VM.

```console
$ time vagrant global-status
vagrant global-status  0.97s user 0.09s system 99% cpu 1.072 total

$ time vagrant-global-status
vagrant-global-status  0.00s user 0.00s system 68% cpu 0.007 total # fast!!
```

## Usage

```console
$ vagrant-global-status
3369de2 default virtualbox poweroff /Users/name/vagrant-dir
```

### With vagrant-peco

If you are using [peco](https://github.com/peco/peco), you can select vagrant-global-status, and execute command !

See: [vagrant-peco](https://github.com/monochromegane/vagrant-peco)

![](https://raw.githubusercontent.com/monochromegane/vagrant-peco/master/images/vagrant-peco-up.gif)

## Installation

### Developer

```console
$ go get github.com/monochromegane/vagrant-global-status/...
```

### User

Download from the following url.

- [https://github.com/monochromegane/vagrant-global-status/releases](https://github.com/monochromegane/vagrant-global-status/releases)

### Note

`vagrant-global-status` depends on the following.

- [Vagrant 1.6 or higher (vagrant global-status)](http://www.vagrantup.com/blog/feature-preview-vagrant-1-6-global-status.html)

## Code status

[![wercker status](https://app.wercker.com/status/8169cbc1fb1e057433f7a06f0dd0cf97/m/master "wercker status")](https://app.wercker.com/project/bykey/8169cbc1fb1e057433f7a06f0dd0cf97)

[![Build Status](https://travis-ci.org/monochromegane/vagrant-global-status.svg?branch=master)](https://travis-ci.org/monochromegane/vagrant-global-status)

## GoDoc

- [GoDoc: vagrant-global-status](https://godoc.org/github.com/monochromegane/vagrant-global-status)

## Contributing

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


text:
MacOSXShell
===========

Shell scripts that are useful on Mac OSX

setuplaunchagent
----------------

Shell script that helps with managing LaunchAgents. These can be useful for running things in the background of your Mac.

Examples:

* To set the Network Location based on IP


text:
@interface JRThreadDetialController : JRViewController

@end


text:
function varargout = quiver(N, varargin)
% QUIVER   Draw phase plot diagrams, based on ODEs specified with CHEBOPS
%
% Calling sequence:
%   H = QUIVER(N, AXIS, 'OPT1', VAL1, ...)
%
% Here, the inputs are:
%   N    : A chebop, whose N.op arguments specifies a second order scalar ODE,
%          or a coupled system of two first order ODEs.
%   AXIS : A 4-vector with elements [XMIN XMAX YMIN YMAX] that specify the
%          rectangular region shown on the phase plot. If none is passed, the
%          default values [-1 1 -1 1] are used.
%
% It is possible to pass the method various option pairs of the form
% 'OPTIONNAME', OPTIONVALUE. The options supported are:
%   'XPTS'      : An integer, specifying the resolution of the x-axis for the
%                 quiver plot. Default value: 10.
%   'YPTS'      : An integer, specifying the resolution of the y-axis for the
%                 quiver plot. Default value: 10.
%   'NORMALIZE' : A Boolean, which determines whether the arrows on the quiver
%                 plot or normalized all to have the same length. Default value:
%                 false.
%   'SCALE':      By default, quiver automatically scales the arrows to fit
%                 within the grid. By passing a SCALE argument S, the arrows are
%                 fitted within the grid and then stretched by S. Use S = 0 to
%                 plot the arrows without the automatic scaling. See the
%                 documentation for the built-in MATLAB QUIVER for more
%                 information.
%   LINESPEC      Specifies options for the quiver plot. The LINESPEC argument
%                 can either be a string supported by the MATLAB PLOT command,
%                 such as 'ro', or a parameter/value pair to specify additional
%                 properties of the quiver lines, such as
%                   quiver(N,[0 2 0 2], 'k', 'linewidth', 1.4).
%
% The optional output is
%   H   : A quivergroup handle.
%
% Note: The CHEBOP QUIVER command works by reformulating higher order problems
% as coupled first order systems, evaluating the resulting first order system at
% grid that should be interpreted as values of u and u', then calling the
% built-ing MATLAB QUIVER method on the results.
%
% Example 1 -- van der Pol equation (second order ODE)
%   N = chebop(0,100);
%   N.op = @(t,u) diff(u, 2) - 3*(1-u^2)*diff(u) + u;
%   quiver(N,[-2.5 2.5 -5.5 5.5], 'r', 'xpts', 40, 'ypts', 40, 'scale', .5, ...
%       'normalize', true, 'linewidth', 1.5)
%   hold on % Plot a particular solution on top of quiver plot
%   N.lbc = [2; 0];
%   u = N\0;
%   plot(u, diff(u),'linewidth',2)
%
% Example 2 -- Lotka-Volterra (first order coupled system)
%   N = chebop(@(t,u,v) [diff(u)-2.*u+u.*v; diff(v)+v-u.*v], [0 4]);
%   quiver(N, [0 2.5 0 4])
%   hold on
%   N.lbc = @(u,v) [u - 0.5; v - 1]; % Initial populations
%   [u, v] = N\0;
%   plot(u, v, 'linewidth', 2)
%   plot(0.5, 1,'m*','markersize',15) % Mark initial condition

% Copyright 2016 by The University of Oxford and The Chebfun Developers. See
% http://www.chebfun.org/ for Chebfun information.

% Set default values:
scale = 1;
normalize = false;
u0 = [];
xpts = 20;
ypts = 20;
axisLims = [-1 1 -1 1];

% The limits for the axes have to appear in the first entry of varargin if
% they're specified. They'll always be a 4-vector.
if ( ~isempty(varargin) && length(varargin{1}) == 4 )
    axisLims = varargin{1};
    % Throw away the axisLims:
    varargin(1) = [];
end

% Cell for linespecs
linespec = {};

% Parse VARARGIN, go through all elements:
while ( ~isempty(varargin) )
    if ( ~ischar(varargin{1}) && ~isnumeric(varargin{2}) )
        error('followpath:inputArgument','Incorrect options input arguments');
    end

    throwAwayLength = 2;
    switch lower(varargin{1})
        case 'normalize'
            normalize = varargin{2};
        case 'xpts'
            xpts = varargin{2};
        case 'ypts'
            ypts = varargin{2};
        case 'scale'
            scale = varargin{2};
        otherwise
            % Must have gotten something to do with linespec
            findNorm = strcmpi(varargin, 'normalize');
            findXpts = strcmpi(varargin, 'xpts');
            findYpts = strcmpi(varargin, 'ypts');
            findScale = strcmpi(varargin, 'scale');
            optionPos = findNorm | findXpts | findYpts | findScale;
            nextOption = find(optionPos, 1, 'first');
            % If nextOption is empty, we only got linespec options left
            if ( isempty(nextOption) )
                nextOption = length(varargin) + 1;
            end
            linespec = [linespec, varargin{1:nextOption - 1}];
            throwAwayLength = nextOption - 1;
    end

    % Throw away option name and argument and move on:
    varargin(1:throwAwayLength) = [];
end

% Extract the x and y limits:
xl = axisLims(1:2);
yl = axisLims(3:4);

% If ylim is empty, we solve the problem to obtain a range for plotting on:
if ( isempty(xl) )
    u0 = N\0;
    xl = 1.1*minandmax(u0);
end

if ( isempty(yl) )
    if ( isempty(u0) )
        u0 = N\0;
    end
    yl = 1.1*minandmax(diff(u0));
end

% Convert the operator in N to first order.
firstOrderFun = treeVar.toFirstOrder(N.op, 0, N.domain);

% Vectors for constructing a meshgrid:
y1 = linspace(xl(1), xl(end), xpts);
y2 = linspace(yl(1), yl(end), ypts);

% Get a meshgrid for points of interests in the phase plane.
[x,y] = meshgrid(y1, y2);
u = zeros(size(x));
v = zeros(size(x));

% Phase plane portraits really only make sense for autonomous systems, which
% shouldn't depend on t, hence, we simply take t = 0 for evaluating.
t = 0;

% Check if we got passed a system of too high order:
numEquations = length(strfind(func2str(firstOrderFun),';'));

if ( numEquations > 2 )
    error('CHEBFUN:CHEBOP:quiver:tooHighOrder', ...
        ['The ODE passed to chebop/quiver must either be a scalar, second ' ...
        'order ODE or a system of two first order equations.'])
end

% [TODO]: Could probably vectorize this, with reshapes. For now, just loop.
for i = 1:numel(x)
    res = firstOrderFun(t,[x(i); y(i)]);
    u(i) = res(1);
    v(i) = res(2);
end

if ( normalize )
    % Make all arrows equal length:
    nrm = sqrt(u.^2 + v.^2);
    u = u./nrm;
    v = v./nrm;
end

h = quiver(x, y, u, v, scale,linespec{:});

% Set x and y limits:
xlim(xl);
ylim(yl);
if ( nargout > 0 )
    varargout{1} = h;
else

end


text:
<?php

/**
 * @file
 * Contains \Drupal\block\Plugin\DisplayVariant\BlockPageVariant.
 */

namespace Drupal\block\Plugin\DisplayVariant;

use Drupal\block\BlockRepositoryInterface;
use Drupal\Core\Block\MainContentBlockPluginInterface;
use Drupal\Core\Block\MessagesBlockPluginInterface;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Display\PageVariantInterface;
use Drupal\Core\Entity\EntityViewBuilderInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Display\VariantBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides a page display variant that decorates the main content with blocks.
 *
 * To ensure essential information is displayed, each essential part of a page
 * has a corresponding block plugin interface, so that BlockPageVariant can
 * automatically provide a fallback in case no block for each of these
 * interfaces is placed.
 *
 * @see \Drupal\Core\Block\MainContentBlockPluginInterface
 * @see \Drupal\Core\Block\MessagesBlockPluginInterface
 *
 * @PageDisplayVariant(
 *   id = "block_page",
 *   admin_label = @Translation("Page with blocks")
 * )
 */
class BlockPageVariant extends VariantBase implements PageVariantInterface, ContainerFactoryPluginInterface {

  /**
   * The block repository.
   *
   * @var \Drupal\block\BlockRepositoryInterface
   */
  protected $blockRepository;

  /**
   * The block view builder.
   *
   * @var \Drupal\Core\Entity\EntityViewBuilderInterface
   */
  protected $blockViewBuilder;

  /**
   * The Block entity type list cache tags.
   *
   * @var string[]
   */
  protected $blockListCacheTags;

  /**
   * The render array representing the main page content.
   *
   * @var array
   */
  protected $mainContent = [];

  /**
   * Constructs a new BlockPageVariant.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin ID for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\block\BlockRepositoryInterface $block_repository
   *   The block repository.
   * @param \Drupal\Core\Entity\EntityViewBuilderInterface $block_view_builder
   *   The block view builder.
   * @param string[] $block_list_cache_tags
   *   The Block entity type list cache tags.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, BlockRepositoryInterface $block_repository, EntityViewBuilderInterface $block_view_builder, array $block_list_cache_tags) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->blockRepository = $block_repository;
    $this->blockViewBuilder = $block_view_builder;
    $this->blockListCacheTags = $block_list_cache_tags;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      $container->get('block.repository'),
      $container->get('entity.manager')->getViewBuilder('block'),
      $container->get('entity.manager')->getDefinition('block')->getListCacheTags()
    );
  }

  /**
   * {@inheritdoc}
   */
  public function setMainContent(array $main_content) {
    $this->mainContent = $main_content;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function build() {
    // Track whether blocks showing the main content and messages are displayed.
    $main_content_block_displayed = FALSE;
    $messages_block_displayed = FALSE;

    $build = [
      '#cache' => [
        'tags' => $this->blockListCacheTags,
      ],
    ];
    // Load all region content assigned via blocks.
    $cacheable_metadata_list = [];
    foreach ($this->blockRepository->getVisibleBlocksPerRegion($cacheable_metadata_list) as $region => $blocks) {
      /** @var $blocks \Drupal\block\BlockInterface[] */
      foreach ($blocks as $key => $block) {
        $block_plugin = $block->getPlugin();
        if ($block_plugin instanceof MainContentBlockPluginInterface) {
          $block_plugin->setMainContent($this->mainContent);
          $main_content_block_displayed = TRUE;
        }
        elseif ($block_plugin instanceof MessagesBlockPluginInterface) {
          $messages_block_displayed = TRUE;
        }
        $build[$region][$key] = $this->blockViewBuilder->view($block);

        // The main content block cannot be cached: it is a placeholder for the
        // render array returned by the controller. It should be rendered as-is,
        // with other placed blocks "decorating" it.
        if ($block_plugin instanceof MainContentBlockPluginInterface) {
          unset($build[$region][$key]['#cache']['keys']);
        }
      }
      if (!empty($build[$region])) {
        // \Drupal\block\BlockRepositoryInterface::getVisibleBlocksPerRegion()
        // returns the blocks in sorted order.
        $build[$region]['#sorted'] = TRUE;
      }
    }

    // If no block that shows the main content is displayed, still show the main
    // content. Otherwise the end user will see all displayed blocks, but not
    // the main content they came for.
    if (!$main_content_block_displayed) {
      $build['content']['system_main'] = $this->mainContent;
    }

    // If no block displays status messages, still render them.
    if (!$messages_block_displayed) {
      $build['content']['messages'] = [
        '#weight' => -1000,
        '#type' => 'status_messages',
      ];
    }

    // The access results' cacheability is currently added to the top level of the
    // render array. This is done to prevent issues with empty regions being
    // displayed.
    // This would need to be changed to allow caching of block regions, as each
    // region must then have the relevant cacheable metadata.
    $merged_cacheable_metadata = CacheableMetadata::createFromRenderArray($build);
    foreach ($cacheable_metadata_list as $cacheable_metadata) {
      $merged_cacheable_metadata = $merged_cacheable_metadata->merge($cacheable_metadata);
    }
    $merged_cacheable_metadata->applyTo($build);

    return $build;
  }

}


text:
/**CFile****************************************************************

  FileName    [ioWriteBlif.c]

  SystemName  [ABC: Logic synthesis and verification system.]

  PackageName [Command processing package.]

  Synopsis    [Procedures to write BLIF files.]

  Author      [Alan Mishchenko]

  Affiliation [UC Berkeley]

  Date        [Ver. 1.0. Started - June 20, 2005.]

  Revision    [$Id: ioWriteBlif.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]

***********************************************************************/

#include "io.h"
#include "main.h"
#include "mio.h"

////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

static void Io_NtkWrite( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
static void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
static void Io_NtkWritePis( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
static void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
static void Io_NtkWriteSubckt( FILE * pFile, Abc_Obj_t * pNode );
static void Io_NtkWriteAsserts( FILE * pFile, Abc_Ntk_t * pNtk );
static void Io_NtkWriteNodeGate( FILE * pFile, Abc_Obj_t * pNode, int Length );
static void Io_NtkWriteNodeFanins( FILE * pFile, Abc_Obj_t * pNode );
static void Io_NtkWriteNode( FILE * pFile, Abc_Obj_t * pNode, int Length );
static void Io_NtkWriteLatch( FILE * pFile, Abc_Obj_t * pLatch );

////////////////////////////////////////////////////////////////////////
///                     FUNCTION DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

/**Function*************************************************************

  Synopsis    [Write the network into a BLIF file with the given name.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
{
    Abc_Ntk_t * pNtkTemp;
    // derive the netlist
    pNtkTemp = Abc_NtkToNetlist(pNtk);
    if ( pNtkTemp == NULL )
    {
        fprintf( stdout, "Writing BLIF has failed.\n" );
        return;
    }
    Io_WriteBlif( pNtkTemp, FileName, fWriteLatches );
    Abc_NtkDelete( pNtkTemp );
}

/**Function*************************************************************

  Synopsis    [Write the network into a BLIF file with the given name.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_WriteBlif( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
{
    FILE * pFile;
    Abc_Ntk_t * pNtkTemp;
    int i;
    assert( Abc_NtkIsNetlist(pNtk) );
    // start writing the file
    pFile = fopen( FileName, "w" );
    if ( pFile == NULL )
    {
        fprintf( stdout, "Io_WriteBlif(): Cannot open the output file.\n" );
        return;
    }
    fprintf( pFile, "# Benchmark \"%s\" written by ABC on %s\n", pNtk->pName, Extra_TimeStamp() );
    // write the master network
    Io_NtkWrite( pFile, pNtk, fWriteLatches );
    // make sure there is no logic hierarchy
    assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
    // write the hierarchy if present
    if ( Abc_NtkBlackboxNum(pNtk) > 0 )
    {
        Vec_PtrForEachEntry( pNtk->pDesign->vModules, pNtkTemp, i )
        {
            if ( pNtkTemp == pNtk )
                continue;
            fprintf( pFile, "\n\n" );
            Io_NtkWrite( pFile, pNtkTemp, fWriteLatches );
        }
    }
    fclose( pFile );
}

/**Function*************************************************************

  Synopsis    [Write the network into a BLIF file with the given name.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWrite( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
{
    Abc_Ntk_t * pExdc;
    assert( Abc_NtkIsNetlist(pNtk) );
    // write the model name
    fprintf( pFile, ".model %s\n", Abc_NtkName(pNtk) );
    // write the network
    Io_NtkWriteOne( pFile, pNtk, fWriteLatches );
    // write EXDC network if it exists
    pExdc = Abc_NtkExdc( pNtk );
    if ( pExdc )
    {
        fprintf( pFile, "\n" );
        fprintf( pFile, ".exdc\n" );
        Io_NtkWriteOne( pFile, pExdc, fWriteLatches );
    }
    // finalize the file
    fprintf( pFile, ".end\n" );
}

/**Function*************************************************************

  Synopsis    [Write one network.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
{
    ProgressBar * pProgress;
    Abc_Obj_t * pNode, * pLatch;
    int i, Length;

    // write the PIs
    fprintf( pFile, ".inputs" );
    Io_NtkWritePis( pFile, pNtk, fWriteLatches );
    fprintf( pFile, "\n" );

    // write the POs
    fprintf( pFile, ".outputs" );
    Io_NtkWritePos( pFile, pNtk, fWriteLatches );
    fprintf( pFile, "\n" );

    // write the assertions
    if ( Abc_NtkAssertNum(pNtk) )
    {
        fprintf( pFile, ".asserts" );
        Io_NtkWriteAsserts( pFile, pNtk );
        fprintf( pFile, "\n" );
    }

    // write the blackbox
    if ( Abc_NtkHasBlackbox( pNtk ) )
    {
        fprintf( pFile, ".blackbox\n" );
        return;
    }

    // write the timing info
    Io_WriteTimingInfo( pFile, pNtk );

    // write the latches
    if ( fWriteLatches && !Abc_NtkIsComb(pNtk) )
    {
        fprintf( pFile, "\n" );
        Abc_NtkForEachLatch( pNtk, pLatch, i )
            Io_NtkWriteLatch( pFile, pLatch );
        fprintf( pFile, "\n" );
    }

    // write the subcircuits
    assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
    if ( Abc_NtkBlackboxNum(pNtk) > 0 )
    {
        fprintf( pFile, "\n" );
        Abc_NtkForEachBlackbox( pNtk, pNode, i )
            Io_NtkWriteSubckt( pFile, pNode );
        fprintf( pFile, "\n" );
    }

    // write each internal node
    Length = Abc_NtkHasMapping(pNtk)? Mio_LibraryReadGateNameMax(pNtk->pManFunc) : 0;
    pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
    Abc_NtkForEachNode( pNtk, pNode, i )
    {
        Extra_ProgressBarUpdate( pProgress, i, NULL );
        Io_NtkWriteNode( pFile, pNode, Length );
    }
    Extra_ProgressBarStop( pProgress );
}

/**Function*************************************************************

  Synopsis    [Writes the primary input list.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWritePis( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
{
    Abc_Obj_t * pTerm, * pNet;
    int LineLength;
    int AddedLength;
    int NameCounter;
    int i;

    LineLength  = 7;
    NameCounter = 0;

    if ( fWriteLatches )
    {
        Abc_NtkForEachPi( pNtk, pTerm, i )
        {
            pNet = Abc_ObjFanout0(pTerm);
            // get the line length after this name is written
            AddedLength = strlen(Abc_ObjName(pNet)) + 1;
            if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
            { // write the line extender
                fprintf( pFile, " \\\n" );
                // reset the line length
                LineLength  = 0;
                NameCounter = 0;
            }
            fprintf( pFile, " %s", Abc_ObjName(pNet) );
            LineLength += AddedLength;
            NameCounter++;
        }
    }
    else
    {
        Abc_NtkForEachCi( pNtk, pTerm, i )
        {
            pNet = Abc_ObjFanout0(pTerm);
            // get the line length after this name is written
            AddedLength = strlen(Abc_ObjName(pNet)) + 1;
            if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
            { // write the line extender
                fprintf( pFile, " \\\n" );
                // reset the line length
                LineLength  = 0;
                NameCounter = 0;
            }
            fprintf( pFile, " %s", Abc_ObjName(pNet) );
            LineLength += AddedLength;
            NameCounter++;
        }
    }
}

/**Function*************************************************************

  Synopsis    [Writes the primary input list.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
{
    Abc_Obj_t * pTerm, * pNet;
    int LineLength;
    int AddedLength;
    int NameCounter;
    int i;

    LineLength  = 8;
    NameCounter = 0;

    if ( fWriteLatches )
    {
        Abc_NtkForEachPo( pNtk, pTerm, i )
        {
            pNet = Abc_ObjFanin0(pTerm);
            // get the line length after this name is written
            AddedLength = strlen(Abc_ObjName(pNet)) + 1;
            if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
            { // write the line extender
                fprintf( pFile, " \\\n" );
                // reset the line length
                LineLength  = 0;
                NameCounter = 0;
            }
            fprintf( pFile, " %s", Abc_ObjName(pNet) );
            LineLength += AddedLength;
            NameCounter++;
        }
    }
    else
    {
        Abc_NtkForEachCo( pNtk, pTerm, i )
        {
            if ( Abc_ObjIsAssert(pTerm) )
                continue;
            pNet = Abc_ObjFanin0(pTerm);
            // get the line length after this name is written
            AddedLength = strlen(Abc_ObjName(pNet)) + 1;
            if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
            { // write the line extender
                fprintf( pFile, " \\\n" );
                // reset the line length
                LineLength  = 0;
                NameCounter = 0;
            }
            fprintf( pFile, " %s", Abc_ObjName(pNet) );
            LineLength += AddedLength;
            NameCounter++;
        }
    }
}

/**Function*************************************************************

  Synopsis    [Writes the assertion list.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWriteAsserts( FILE * pFile, Abc_Ntk_t * pNtk )
{
    Abc_Obj_t * pTerm, * pNet;
    int LineLength;
    int AddedLength;
    int NameCounter;
    int i;

    LineLength  = 8;
    NameCounter = 0;

    Abc_NtkForEachAssert( pNtk, pTerm, i )
    {
        pNet = Abc_ObjFanin0(pTerm);
        // get the line length after this name is written
        AddedLength = strlen(Abc_ObjName(pNet)) + 1;
        if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
        { // write the line extender
            fprintf( pFile, " \\\n" );
            // reset the line length
            LineLength  = 0;
            NameCounter = 0;
        }
        fprintf( pFile, " %s", Abc_ObjName(pNet) );
        LineLength += AddedLength;
        NameCounter++;
    }
}

/**Function*************************************************************

  Synopsis    [Write subcircuit info into a file.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWriteSubckt( FILE * pFile, Abc_Obj_t * pNode )
{
    Abc_Ntk_t * pModel = pNode->pData;
    Abc_Obj_t * pTerm;
	char * str;
    int i;
	int LineLength;
    int AddedLength;

	// write the subcircuit
    fprintf( pFile, ".subckt %s", Abc_NtkName(pModel) );

	LineLength = 8 + strlen(Abc_NtkName(pModel)) + 1;

    // write pairs of the formal=actual names
    Abc_NtkForEachPi( pModel, pTerm, i )
    {
		str = Abc_ObjName(Abc_ObjFanout0(pTerm));
        fprintf( pFile, " %s", str );
		AddedLength = strlen(str) + 1;

        pTerm = Abc_ObjFanin( pNode, i );

		str = Abc_ObjName(Abc_ObjFanin0(pTerm));
        fprintf( pFile, "=%s", str );
		AddedLength += strlen(str) + 1;

		if ( LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
        {
            fprintf( pFile, " \\\n" );
            LineLength  = 0;
        }
		else
		{
			LineLength += AddedLength;
		}
    }

    Abc_NtkForEachPo( pModel, pTerm, i )
    {
		str = Abc_ObjName(Abc_ObjFanin0(pTerm));
        fprintf( pFile, " %s", str );
		AddedLength = strlen(str) + 1;

        pTerm = Abc_ObjFanout( pNode, i );

		str = Abc_ObjName(Abc_ObjFanout0(pTerm));
        fprintf( pFile, "=%s", str );
		AddedLength += strlen(str) + 1;

		if ( LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
        {
            fprintf( pFile, " \\\n" );
            LineLength  = 0;
        }
		else
		{
			LineLength += AddedLength;
		}
    }

	fprintf( pFile, "\n" );
}

/**Function*************************************************************

  Synopsis    [Write the latch into a file.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWriteLatch( FILE * pFile, Abc_Obj_t * pLatch )
{
    Abc_Obj_t * pNetLi, * pNetLo;
	Abc_LatchInfo_t *pLatchInfo;
    int Reset;

	pLatchInfo = ((Abc_LatchInfo_t *)(pLatch->pData));

    pNetLi = Abc_ObjFanin0( Abc_ObjFanin0(pLatch) );
    pNetLo = Abc_ObjFanout0( Abc_ObjFanout0(pLatch) );
    Reset  = pLatchInfo->InitValue;
    // write the latch line
    fprintf( pFile, ".latch" );
    fprintf( pFile, " %10s",    Abc_ObjName(pNetLi) );
    fprintf( pFile, " %10s",    Abc_ObjName(pNetLo) );

	switch (pLatchInfo->LatchType)
    {
    case ABC_RISING_EDGE:
        fprintf( pFile, " re");
        break;
    case ABC_FALLING_EDGE:
        fprintf( pFile, " fe");
        break;
    case ABC_ACTIVE_HIGH:
        fprintf( pFile, " ah");
        break;
    case ABC_ACTIVE_LOW:
        fprintf( pFile, " al");
        break;
    default:
        fprintf( pFile, " as");
        break;
    }

    fprintf( pFile, " %10s",   ((Abc_LatchInfo_t *)pLatch->pData)->pClkName);
    fprintf( pFile, "  %d\n",   Reset-1 );
}

/**Function*************************************************************

  Synopsis    [Write the node into a file.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWriteNode( FILE * pFile, Abc_Obj_t * pNode, int Length )
{
    if ( Abc_NtkHasMapping(pNode->pNtk) )
    {
        // write the .gate line
        fprintf( pFile, ".gate" );
        Io_NtkWriteNodeGate( pFile, pNode, Length );
        fprintf( pFile, "\n" );
    }
    else
    {
        // write the .names line
        fprintf( pFile, ".names" );
        Io_NtkWriteNodeFanins( pFile, pNode );
        fprintf( pFile, "\n" );
        // write the cubes
        fprintf( pFile, "%s", Abc_ObjData(pNode) );
    }
}

/**Function*************************************************************

  Synopsis    [Writes the primary input list.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWriteNodeGate( FILE * pFile, Abc_Obj_t * pNode, int Length )
{
    Mio_Gate_t * pGate = pNode->pData;
    Mio_Pin_t * pGatePin;
    int i;
    // write the node
    fprintf( pFile, " %-*s ", Length, Mio_GateReadName(pGate) );
    for ( pGatePin = Mio_GateReadPins(pGate), i = 0; pGatePin; pGatePin = Mio_PinReadNext(pGatePin), i++ )
        fprintf( pFile, "%s=%s ", Mio_PinReadName(pGatePin), Abc_ObjName( Abc_ObjFanin(pNode,i) ) );
    assert ( i == Abc_ObjFaninNum(pNode) );
    fprintf( pFile, "%s=%s", Mio_GateReadOutName(pGate), Abc_ObjName( Abc_ObjFanout0(pNode) ) );
}

/**Function*************************************************************

  Synopsis    [Writes the primary input list.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_NtkWriteNodeFanins( FILE * pFile, Abc_Obj_t * pNode )
{
    Abc_Obj_t * pNet;
    int LineLength;
    int AddedLength;
    int NameCounter;
    char * pName;
    int i;

    LineLength  = 6;
    NameCounter = 0;
    Abc_ObjForEachFanin( pNode, pNet, i )
    {
        // get the fanin name
        pName = Abc_ObjName(pNet);
        // get the line length after the fanin name is written
        AddedLength = strlen(pName) + 1;
        if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
        { // write the line extender
            fprintf( pFile, " \\\n" );
            // reset the line length
            LineLength  = 0;
            NameCounter = 0;
        }
        fprintf( pFile, " %s", pName );
        LineLength += AddedLength;
        NameCounter++;
    }

    // get the output name
    pName = Abc_ObjName(Abc_ObjFanout0(pNode));
    // get the line length after the output name is written
    AddedLength = strlen(pName) + 1;
    if ( NameCounter && LineLength + AddedLength > 75 )
    { // write the line extender
        fprintf( pFile, " \\\n" );
        // reset the line length
        LineLength  = 0;
        NameCounter = 0;
    }
    fprintf( pFile, " %s", pName );
}

/**Function*************************************************************

  Synopsis    [Writes the timing info.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Io_WriteTimingInfo( FILE * pFile, Abc_Ntk_t * pNtk )
{
    Abc_Obj_t * pNode;
    Abc_Time_t * pTime, * pTimeDef;
    int i;

    if ( pNtk->pManTime == NULL )
        return;

    pTimeDef = Abc_NtkReadDefaultArrival( pNtk );
    fprintf( pFile, ".default_input_arrival %g %g\n", pTimeDef->Rise, pTimeDef->Fall );
    Abc_NtkForEachPi( pNtk, pNode, i )
    {
        pTime = Abc_NodeReadArrival(pNode);
        if ( pTime->Rise == pTimeDef->Rise && pTime->Fall == pTimeDef->Fall )
            continue;
        fprintf( pFile, ".input_arrival %s %g %g\n", Abc_ObjName(pNode), pTime->Rise, pTime->Fall );
    }
}

////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////


text:
[![Build Status](https://travis-ci.org/riywo/anypow.png?branch=master)](https://travis-ci.org/riywo/anypow)

Simpe rack proxy to use Pow in any language.

## Installation

Add this line to your application's Gemfile:

    gem 'anypow'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install anypow

## Usage

    $ cat config.ru
    require "anypow"
    extend Anypow
    run_pow "plackup -p $PORT"

You can also use [foreman](https://github.com/ddollar/foreman) with pow!

    $ cat config.ru
    require "anypow"
    extend Anypow
    run_pow "foreman start -p $PORT"
    require ::File.expand_path('../config/environment',  __FILE__)
    run Rails.application

    $ cat Procfile
    web: rackup -p $PORT
    worker: rake worker:start

## Contributing

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


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Mvc2.Views.Shared
{
    public partial class Site : System.Web.Mvc.ViewMasterPage
    {
    }
}


text:
package org.apache.hyracks.storage.am.lsm.common.impls;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperation;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperationScheduler;

public class SynchronousScheduler implements ILSMIOOperationScheduler {
    private static final Logger LOGGER = Logger.getLogger(SynchronousScheduler.class.getName());
    public static final SynchronousScheduler INSTANCE = new SynchronousScheduler();

    private SynchronousScheduler() {
    }

    @Override
    public void scheduleOperation(ILSMIOOperation operation) throws HyracksDataException {
        try {
            operation.call();
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "IO Operation failed", e);
            throw HyracksDataException.create(e);
        }
    }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Peucedanum wilmsianum H.Wolff

### Remarks
null


text:
var CSV = require("../lib");
var count = 0;
var start = new Date().getTime();

var file = __dirname + "/csv-file.csv";

var options = {
    delimiter: ",",
    charset: "utf8",
    headers: true
}

// push here the rows
var rows = [];

CSV.parse(file, options, function (err, row, next, bytes) {

    if (err) { return console.log(err); }

    if (row !== null) {
        ++count;
        rows.push(row);
        next();
    } else {
        console.log(count + " Rows parsed in "+ ((new Date().getTime() - start) / 1000) + "s (" + (bytes / 1000000).toFixed(2) + "MB)");
        console.log("Result:");
        console.log(JSON.stringify(rows, null, 2));
    }
});


text:
<?php

if (!\function_exists('getallheaders')) {
    /**
     * Get all HTTP header key/values as an associative array for the current request.
     *
     * @return string[string] The HTTP header key/value pairs.
     */
    function getallheaders()
    {
        $headers = array();
        $copy_server = array('CONTENT_TYPE' => 'Content-Type', 'CONTENT_LENGTH' => 'Content-Length', 'CONTENT_MD5' => 'Content-Md5');
        foreach ($_SERVER as $key => $value) {
            if (\substr($key, 0, 5) === 'HTTP_') {
                $key = \substr($key, 5);
                if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) {
                    $key = \str_replace(' ', '-', \ucwords(\strtolower(\str_replace('_', ' ', $key))));
                    $headers[$key] = $value;
                }
            } elseif (isset($copy_server[$key])) {
                $headers[$copy_server[$key]] = $value;
            }
        }
        if (!isset($headers['Authorization'])) {
            if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
                $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
            } elseif (isset($_SERVER['PHP_AUTH_USER'])) {
                $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
                $headers['Authorization'] = 'Basic ' . \base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass);
            } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) {
                $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST'];
            }
        }
        return $headers;
    }
}


text:
class CreateSpreadsheets < ActiveRecord::Migration
  def self.up
    create_table :spreadsheets do |t|
      t.integer :data_file_id
      t.integer :content_blob_id
      t.timestamps
    end
  end

  def self.down
    drop_table :spreadsheets
  end
end


text:
package cucumber.runtime;

import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Utils {
    public static <T> List<T> listOf(int size, T obj) {
        List<T> list = new ArrayList<T>();
        for (int i = 0; i < size; i++) {
            list.add(obj);
        }
        return list;
    }

    public static boolean isInstantiable(Class<?> clazz) {
        boolean isNonStaticInnerClass = !Modifier.isStatic(clazz.getModifiers()) && clazz.getEnclosingClass() != null;
        return Modifier.isPublic(clazz.getModifiers()) && !Modifier.isAbstract(clazz.getModifiers()) && !isNonStaticInnerClass;
    }

    public static boolean hasConstructor(Class<?> clazz, Class[] paramTypes) {
        try {
            clazz.getConstructor(paramTypes);
            return true;
        } catch (NoSuchMethodException e) {
            return false;
        }
    }

    public static String packagePath(Class clazz) {
        return packagePath(packageName(clazz.getName()));
    }

    public static String packagePath(String packageName) {
        return packageName.replace('.', '/');
    }

    public static String packageName(String className) {
        return className.substring(0, Math.max(0, className.lastIndexOf(".")));
    }

    public static <T> Iterator<T> emptyIterator() {
        return new Iterator<T>() {

            @Override
            public boolean hasNext() {
                return false;
            }

            @Override
            public T next() {
                throw new UnsupportedOperationException();
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }
}


text: Android Tile Repeat