text:
<?php

namespace MultipleFileUpload\Model;

interface IQueues
{

	/**
	 * Gets life time of file
	 * @return int
	 */
	function getLifeTime();

	/**
	 * Sets life time of file
	 * @param int $time
	 */
	function setLifeTime($time);

	/**
	 * Gets cleaning interval
	 * @return int
	 */
	function getCleanInterval();

	/**
	 * Sets cleaning interval
	 * @param int $interval
	 */
	function setCleanInterval($interval);

	/**
	 * Initializes driver
	 */
	function initialize();

	/**
	 * Gets queue (create if needed)
	 * @param string $id
	 * @return IQueue
	 */
	function getQueue($id);

	/**
	 * Gets all queues
	 * @return IQueue[]
	 */
	function getQueues();

	/**
	 * Executes cleanup
	 */
	function cleanup();
}

redpajama_set_name: RedPajamaGithub


text:
exports = module.exports = Service2;

function Service2 (config) {
    this.config = config;
}

Service2.prototype.getName = function() {
    return 'service 2'
};

Service2.prototype._send = function(options, cb) {
    cb();
};


text:
package com.ibm.xsp.extlib.component.listview;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.el.ValueBinding;

import lotus.domino.NotesException;
import lotus.domino.View;

import com.ibm.commons.util.StringUtil;
import com.ibm.xsp.extlib.builder.ControlBuilder;
import com.ibm.xsp.extlib.builder.ControlBuilder.ControlImpl;
import com.ibm.xsp.extlib.builder.ControlBuilder.IControl;
import com.ibm.xsp.extlib.component.domino.UIViewComponent;
import com.ibm.xsp.extlib.component.dynamicview.ViewDesign;
import com.ibm.xsp.extlib.component.dynamicview.ViewDesign.ColumnDef;
import com.ibm.xsp.extlib.component.dynamicview.ViewDesign.ViewDef;
import com.ibm.xsp.extlib.component.dynamicview.ViewDesign.ViewFactory;
import com.ibm.xsp.extlib.component.rest.DominoViewService;
import com.ibm.xsp.extlib.component.rest.IRestService;
import com.ibm.xsp.extlib.component.rest.UIRestService;
import com.ibm.xsp.util.FacesUtil;
import com.ibm.xsp.util.ManagedBeanUtil;
import com.ibm.xsp.util.TypedUtil;

/**
 * @author akosugi
 *
 *        ui component handler for notes list view control
 */
public class UIListView extends UIViewComponent {

    public static final String COMPONENT_TYPE = "com.ibm.xsp.extlib.listview.ListView"; // $NON-NLS-1$
    public static final String COMPONENT_FAMILY = "com.ibm.xsp.extlib.listview.ListView"; // $NON-NLS-1$
    public static final String RENDERER_TYPE = "com.ibm.xsp.extlib.listview.ListView"; //$NON-NLS-1$
    // PHIL:
    // Customization bean
    public static abstract class Customizer {
        public ViewFactory getViewFactory() {
            return null;
        }
        public boolean createColumns(FacesContext context, UIListView panel, ViewFactory f) {
            return false;
        }
        public IControl createColumn(FacesContext context, UIListView panel, int index, ColumnDef colDef) {
            return null;
        }
        public void afterCreateColumn(FacesContext context, int index, ColumnDef colDef, IControl column) {
        }
        public void afterCreateColumns(FacesContext context, UIListView panel) {
        }
    }

    private String structureComponentId;
    // dojoEvents is unused, and not serialized.
//  private ArrayList<DojoEvent> dojoEvents;
    private String onSortChanged;
    private Boolean hideColumns; // MWD breaking change 10/05/11 - this prop hides ALL child columns
    private Boolean alternateRows;
    private Boolean canBeNarrowMode;
    private Boolean showColumnNameForEmptyTitle; // formerly 'showColumnName4EmptyTitle' => breaking change on 10/03/11
    private String onCellClick;
    private String onCellDblClick;
    private Boolean dynamicView;
    private String currentView;
    private String customizerBean;

    public UIListView() {
        setRendererType(RENDERER_TYPE);
//      dojoEvents = new ArrayList<DojoEvent>();
    }

    @Override
    public String getFamily() {
        return COMPONENT_FAMILY;
    }

    public String getCustomizerBean() {
       if (customizerBean == null) {
            ValueBinding vb = getValueBinding("customizerBean"); //$NON-NLS-1$
            if (vb != null) {
                return (String)vb.getValue(FacesContext.getCurrentInstance());
            }
        }
        return customizerBean;
    }

    public void setCustomizerBean(String customizerBean) {
        this.customizerBean = customizerBean;
    }

//  public ArrayList<DojoEvent> getDojoEvents() {
//      return this.dojoEvents;
//  }
//
//  public void addDojoEvent(DojoEvent dojoEvent) {
//      dojoEvents.add(dojoEvent);
//  }

    public String getStructureComponentId() {
        if (structureComponentId != null)
            return structureComponentId;
        ValueBinding _vb = getValueBinding("structureComponentId"); // $NON-NLS-1$
        if (_vb != null)
            return (String) _vb.getValue(getFacesContext());
        else
            return null;
    }

    public void setStructureComponentId(String structure) {
        this.structureComponentId = structure;
    }

    public String getOnSortChanged() {
        if (onSortChanged != null)
            return onSortChanged;
        ValueBinding _vb = getValueBinding("onSortChanged"); // $NON-NLS-1$
        if (_vb != null)
            return (String) _vb.getValue(getFacesContext());
        else
            return null;
    }

    public void setOnSortChanged(String sortChangedAction) {
        this.onSortChanged = sortChangedAction;
    }

    public String getOnCellClick() {
        if (null != this.onCellClick) {
            return this.onCellClick;
        }
        ValueBinding _vb = getValueBinding("onCellClick"); //$NON-NLS-1$
        if (_vb != null) {
            return (java.lang.String) _vb.getValue(getFacesContext());
        } else {
            return null;
        }
    }

    public void setOnCellClick(String onCellClick) {
        this.onCellClick = onCellClick;
    }

    public String getOnCellDblClick() {
        if (null != this.onCellDblClick) {
            return this.onCellDblClick;
        }
        ValueBinding _vb = getValueBinding("onCellDblClick"); //$NON-NLS-1$
        if (_vb != null) {
            return (java.lang.String) _vb.getValue(getFacesContext());
        } else {
            return null;
        }
    }

    public void setOnCellDblClick(String onCellDblClick) {
        this.onCellDblClick = onCellDblClick;
    }

    public boolean isHideColumns() {
        if (hideColumns != null)
            return hideColumns;
        ValueBinding _vb = getValueBinding("hideColumns"); // $NON-NLS-1$
        if (_vb != null){
            Object val = _vb.getValue(getFacesContext());
            if( val instanceof Boolean ){
                return (Boolean) val;
            }
        }
        return false;
    }

    public void setHideColumns(boolean hideColumns) {
        this.hideColumns = hideColumns;
    }

    public boolean isAlternateRows() {
        if (null != this.alternateRows) {
            return this.alternateRows;
        }
        ValueBinding _vb = getValueBinding("alternateRows"); //$NON-NLS-1$
        if (_vb != null) {
            Boolean val = (Boolean) _vb.getValue(getFacesContext());
            if(val!=null) {
                return val;
            }
        }
        return false;
    }

    public void setAlternateRows(boolean alternateRows) {
        this.alternateRows = alternateRows;
    }
    public boolean isCanBeNarrowMode() {
        if (null != this.canBeNarrowMode) {
            return this.canBeNarrowMode;
        }
        ValueBinding _vb = getValueBinding("canBeNarrowMode"); //$NON-NLS-1$
        if (_vb != null) {
            Boolean val = (Boolean) _vb.getValue(getFacesContext());
            if(val!=null) {
                return val;
            }
        }
        return false;
    }

    public void setCanBeNarrowMode(boolean canBeNarrowMode) {
        this.canBeNarrowMode = canBeNarrowMode;
    }

    // MWD Commenting this out -- see if anybody cares
    // TODO Remove completely after beta and before IFR1 if no feedback
//    /**
//     * @deprecated Use {@link #isShowColumnName4EmptyTitle()} instead
//     */
//    public Boolean getShowColumnName4EmptyTitle() {
//        return isShowColumnName4EmptyTitle();
//    }

    public boolean isShowColumnNameForEmptyTitle() {
        if (null != this.showColumnNameForEmptyTitle) {
            return this.showColumnNameForEmptyTitle;
        }
        ValueBinding vb = getValueBinding("showColumnNameForEmptyTitle"); //$NON-NLS-1$
        if (vb != null) {
            Boolean val = (Boolean) vb.getValue(getFacesContext());
            if(val!=null) {
                return val;
            }
        }
        return false;
    }

    // MWD  Commenting this out -- see if anybody cares
    // TODO Remove completelt after beta and before IFR1 if no feedback
//    /**
//     * @deprecated use {@link #setShowColumnName4EmptyTitle(boolean)} instead.
//     */
//    public void setShowColumnName4EmptyTitle(Boolean showColumnName4EmptyTitle) {
//        if( null != showColumnName4EmptyTitle ){
//            setShowColumnName4EmptyTitle(showColumnName4EmptyTitle.booleanValue());
//        }
//    }
    public void setShowColumnNameForEmptyTitle(boolean showColumnNameForEmptyTitle) {
        this.showColumnNameForEmptyTitle = showColumnNameForEmptyTitle;
    }

    /* (non-Javadoc)
     * @see com.ibm.xsp.extlib.component.domino.UIViewComponent#getJsId()
     */
    @Override
    public String getJsId() {
        return super.getJsId();
    }

    @Override
    public void writeActionHandlerScripts(ResponseWriter writer)
            throws IOException {
        super.writeActionHandlerScripts(writer);
        String value = this.getOnSortChanged();
        if(StringUtil.isNotEmpty(value)){
            this.writeActionHandlerScript(writer, "sortChangedAction", "col", value); // $NON-NLS-1$ $NON-NLS-2$
        }
        value = this.getOnCellClick();
        if(StringUtil.isNotEmpty(value)){
            this.writeActionHandlerScript(writer, "onCellClick", "ev,ext", value); // $NON-NLS-1$ $NON-NLS-2$
        }
        value = this.getOnCellDblClick();
        if(StringUtil.isNotEmpty(value)){
            this.writeActionHandlerScript(writer, "onCellDblClick", "ev,ext", value); // $NON-NLS-1$ $NON-NLS-2$
        }
    }
    @Override
    public Object saveState(FacesContext context) {
        Object values[] = new Object[12];
        values[0] = super.saveState(context);
        values[1] = structureComponentId;
        values[2] = onSortChanged;
        values[3] = hideColumns;
        values[4] = alternateRows;
        values[5] = canBeNarrowMode;
        values[6] = dynamicView;
        values[7] = currentView;
        values[8] = customizerBean;
        values[9] = showColumnNameForEmptyTitle;
        values[10] = onCellClick;
        values[11] = onCellDblClick;
        return values;
    }
    @Override
    public void restoreState(FacesContext context, Object state) {
        Object values[] = (Object[]) state;
        super.restoreState(context, values[0]);
        this.structureComponentId = (String) values[1];
        this.onSortChanged = (String) values[2];
        this.hideColumns = (Boolean) values[3];
        this.alternateRows = (Boolean) values[4];
        this.canBeNarrowMode = (Boolean) values[5];
        this.dynamicView = (Boolean) values[6];
        this.currentView = (String) values[7];
        this.customizerBean = (String) values[8];
        this.showColumnNameForEmptyTitle = (Boolean) values[9];
        this.onCellClick = (String) values[10];
        this.onCellDblClick = (String) values[11];
    }

    // ====================================================================
    //  Dynamic Columns Management
    // ====================================================================

    @Override
    public void encodeBegin(FacesContext context) throws IOException {
        if(dynamicView==null) {
            dynamicView = isDynamicView();
        }
        if(dynamicView) {
            updateColumns(context);
        }
        super.encodeBegin(context);
    }

    protected boolean isDynamicView() {
        // If at least one column had been added, the we consider that the view is not dynamic
        if(getChildCount()>0) {
            List<UIComponent> children = TypedUtil.getChildren(this);
            for(UIComponent c: children) {
                if(c instanceof UIListViewColumn) {
                    return false;
                }
            }
        }
        return true;
    }

    protected void updateColumns(FacesContext context) {
        try {
            String viewKey=findViewKey(context);
            if(!StringUtil.equals(viewKey, currentView)) {
                Customizer bean = loadCustomizationBean(context);
                clearColumns(context,bean);
                ViewFactory f = getViewFactory(context,bean);
                if(f!=null) {
                    createColumns(context,bean,f,ViewDesign.loadView(viewKey));
                }
                this.currentView = viewKey;
            }
        } catch(NotesException ex) {}
    }

    protected String findViewKey(FacesContext context) throws NotesException {
        // Find the data store and the view it points to
        String storeId = getStoreComponentId();
        if(StringUtil.isNotEmpty(storeId)) {
            UIComponent c = FacesUtil.getComponentFor(this, storeId);
            if(c instanceof UIRestService) {
                IRestService svc = ((UIRestService)c).getService();
                if(svc instanceof DominoViewService) {
                    String databaseName = ((DominoViewService)svc).getDatabaseName();
                    String viewName = ((DominoViewService)svc).getViewName();
                    return ViewDesign.getViewKey(databaseName, viewName);
                }
            }
        }
        return null;
    }

    protected Customizer loadCustomizationBean(FacesContext context) {
        String bean = getCustomizerBean();
        if(StringUtil.isNotEmpty(bean)) {
            return (Customizer)ManagedBeanUtil.getBean(context, bean);
        }
        return null;
    }

    protected void clearColumns(FacesContext context, Customizer bean) {
        getChildren().clear();
    }

    protected void createColumns(FacesContext context, Customizer bean, ViewFactory f, View view) {
        if(bean==null || !bean.createColumns(context, this, f)) {
            ViewDef viewDef = f.getViewDef(view);
            if(viewDef!=null) {
                // The view control already exists, it is simply wrapped into a ControlImpl
                // We then create the columns  and ask the control builder to actually
                // add the columns to the view panel and call the FacesComponent methods
                ControlImpl<UIListView> viewControl = new ControlImpl<UIListView>(this);
                int index = 0;
                for(Iterator<ColumnDef> it=viewDef.iterateColumns(); it.hasNext(); index++) {
                    ColumnDef colDef = it.next();
                    IControl viewCol = createColumn(context,bean,index,colDef);
                    viewControl.addChild(viewCol);
                }

                ControlBuilder.buildControl(context, viewControl,true);
            }
        }
        if(bean!=null) {
            bean.afterCreateColumns(context, this);
        }
    }
    protected IControl createColumn(FacesContext context, Customizer bean, int index, ColumnDef colDef) {
        if(bean!=null) {
            IControl col = bean.createColumn(context, this, index, colDef);
            if(col!=null) {
                return col;
            }
        }
        // Create the column object
        UIListViewColumn col = new UIListViewColumn();
        col.setColumnName(colDef.getName());
        col.setColumnTitle(colDef.getTitle());
        col.setWidth(String.valueOf(colDef.getWidth()));
        col.setResponse(colDef.isResponse());
        col.setTwistie(colDef.isIndentResponses());
        col.setHidden(colDef.isHidden());
        col.setCategory(colDef.isCategorized());
        boolean isAsc = colDef.isResortAscending();
        boolean isDsc = colDef.isResortDescending();
        int sort;
        if( isAsc ){
            sort = isDsc ? UIListViewColumn.SORT_BOTH : UIListViewColumn.SORT_ASCENDING;
        }else{
            sort = isDsc ? UIListViewColumn.SORT_DESCENDING : UIListViewColumn.SORT_NONE;
        }
        col.setSort( sort );
        col.setIcon( colDef.isIcon() );
        ControlImpl<UIListViewColumn> cCol = new ControlImpl<UIListViewColumn>(col);

        if(bean!=null) {
            bean.afterCreateColumn(context, index, colDef, cCol);
        }
        return cCol;
    }

    protected ViewFactory getViewFactory(FacesContext context, Customizer bean) {
        if(bean!=null) {
            ViewFactory f = bean.getViewFactory();
            if(f!=null) {
                return f;
            }
        }
        return ViewDesign.getDefaultFactory(context);
    }
}


text:
#pragma once

#include "sol-log.h"

extern struct sol_log_domain sol_fbp_log_domain;
void sol_fbp_init_log_domain(void);

#undef SOL_LOG_DOMAIN
#define SOL_LOG_DOMAIN &sol_fbp_log_domain


text:
var express = require('express');
var app = express();
const port = process.env.PORT || 3000

app.get('/', function (req, res) {
  res.send('Echo World API!');
});

app.get('/world', function (req, res) {
  res.send(JSON.stringify(process.env, null, 2));
});

app.listen(port, function () {
  console.log(`Example app listening on port ${port}!`);
});


text:
'use strict';

angular.module('crossroads')

.controller('mediaPosterCtrl', function($element) {

    // showPoster will hide the child img & svg tags,
    // then find any YouTube embeds (iframes) that are in the parent element and show it.
    // Based on logic from here: https://gist.github.com/zigotica/4438876

    this.showPoster = function() {
      var elm = $element,
          conts   = elm.contents(),
          le      = conts.length,
          ifr     = null;

      for(var i = 0; i<le; i++){
        if(conts[i].nodeType === 8) ifr = conts[i].textContent;
      }

      $element.addClass('player').html(ifr);
      $element.off('click');
    };
});


text:
layout: page
title: Mountain Studios Party
date: 2016-05-24
author: Ethan Kelley
tags: weekly links, java
status: published
summary: In hac habitasse platea dictumst.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 05/11/2017
  endDate: 05/15/2017
  ctyhocn: KANKSHX
  groupCode: MSP
published: true
---
Nullam eu aliquet leo. Nam pharetra nisl purus, eget rhoncus ante vulputate at. Praesent nec porta purus. Integer lacinia imperdiet lacus, in sodales velit. Nulla facilisi. Nullam tincidunt, erat porta aliquet consequat, mi felis rhoncus libero, non viverra velit mi at urna. Nunc quis congue purus. Vivamus vel hendrerit urna. Praesent aliquet justo tempor posuere vulputate. Quisque in turpis massa. Nam ullamcorper, nisl quis iaculis lobortis, nibh est vestibulum velit, nec efficitur massa lectus sed ligula. Quisque sit amet cursus ipsum, vestibulum venenatis odio. Donec eget imperdiet ligula. Curabitur ut fringilla justo, ac cursus leo.

* Suspendisse tristique mi quis ipsum sagittis congue.

Duis feugiat nisi magna, eleifend laoreet quam pulvinar nec. Curabitur mollis nisi ac felis pulvinar, vitae pretium mi blandit. Ut pretium non eros vitae consectetur. Donec rhoncus, nulla condimentum feugiat venenatis, nisl dui posuere velit, bibendum venenatis erat eros non ipsum. Integer scelerisque porta diam sit amet auctor. Proin rhoncus pretium metus, non imperdiet sapien vestibulum id. Aliquam vitae turpis sed ante aliquam tristique viverra ac lorem. Mauris lobortis vitae ipsum id interdum. Curabitur elementum leo massa, ac porta quam blandit at. Aliquam erat volutpat.
Cras fringilla sem eu velit rhoncus fermentum. Pellentesque a maximus erat. Nullam ante lacus, sagittis id enim sed, vehicula viverra justo. Aenean suscipit libero ut nisi faucibus, non blandit odio ultrices. Donec consequat neque ac sapien molestie, vitae egestas nulla vestibulum. Nullam vel velit magna. Nunc ac rutrum leo. Quisque a ultricies purus. Donec in eros at ex hendrerit porta sed non ante.


text:
package org.apache.wicket.spring.test;

import java.io.IOException;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanNotOfRequiredTypeException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.MessageSourceResolvable;
import org.springframework.context.NoSuchMessageException;
import org.springframework.core.ResolvableType;
import org.springframework.core.env.Environment;
import org.springframework.core.io.Resource;

/**
 * Mock application context object. This mock context allows easy creation of unit tests by allowing
 * the user to put bean instances into the context.
 *
 * Only {@link #getBean(String)}, {@link #getBean(String, Class)}, and
 * {@link #getBeansOfType(Class)
 * } are implemented so far. Any other method throws
 * {@link UnsupportedOperationException}.
 *
 * @author Igor Vaynberg (ivaynberg)
 *
 */
public class ApplicationContextMock implements ApplicationContext, Serializable
{
	private static final long serialVersionUID = 1L;

	private final Map<String, Object> beans = new HashMap<>();

	/**
	 * puts bean with the given name into the context
	 *
	 * @param name
	 * @param bean
	 */
	public void putBean(final String name, final Object bean)
	{
		if (beans.containsKey(name))
		{
			throw new IllegalArgumentException("a bean with name [" + name +
				"] has already been added to the context");
		}
		beans.put(name, bean);
	}

	/**
	 * puts bean with into the context. bean object's class name will be used as the bean name.
	 *
	 * @param bean
	 */
	public void putBean(final Object bean)
	{
		putBean(bean.getClass().getName(), bean);
	}

	@Override
	public Object getBean(final String name) throws BeansException
	{
		Object bean = beans.get(name);
		if (bean == null)
		{
			throw new NoSuchBeanDefinitionException(name);
		}
		return bean;
	}

	@Override
	public Object getBean(final String name, final Object... args) throws BeansException
	{
		return getBean(name);
	}

	/**
	 * @see org.springframework.beans.factory.BeanFactory#getBean(java.lang.String, java.lang.Class)
	 */
	@Override
	@SuppressWarnings({ "unchecked" })
	public <T> T getBean(String name, Class<T> requiredType) throws BeansException
	{
		Object bean = getBean(name);
		if (!(requiredType.isAssignableFrom(bean.getClass())))
		{
			throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
		}
		return (T)bean;
	}

	/**
	 * @see org.springframework.beans.factory.ListableBeanFactory#getBeansOfType(java.lang.Class)
	 */
	@Override
	@SuppressWarnings({ "unchecked" })
	public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException
	{
		final Map<String, T> found = new HashMap<>();

		for (Entry<String, Object> entry : beans.entrySet())
		{
			if (type.isAssignableFrom(entry.getValue().getClass()))
			{
				found.put(entry.getKey(), (T)entry.getValue());
			}
		}

		return found;
	}

	@Override
	public <T> T getBean(Class<T> requiredType) throws BeansException
	{
		Iterator<T> beans = getBeansOfType(requiredType).values().iterator();

		if (beans.hasNext() == false)
		{
			throw new NoSuchBeanDefinitionException("bean of required type " + requiredType +
				" not found");
		}
		final T bean = beans.next();

		if (beans.hasNext() != false)
		{
			throw new NoSuchBeanDefinitionException("more than one bean of required type " +
				requiredType + " found");
		}
		return bean;
	}

	@Override
	public <T> T getBean(Class<T> requiredType, Object... objects) throws BeansException
	{
		return getBean(requiredType);
	}

	@Override
	public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
		throws BeansException
	{
		final Map<String, Object> found = new HashMap<>();

		for (Entry<String, Object> entry : beans.entrySet())
		{
			if (entry.getValue().getClass().isAnnotationPresent(annotationType))
			{
				found.put(entry.getKey(), entry.getValue());
			}
		}
		return found;
	}

	@Override
	public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
	{
		return findAnnotationOnClass(getBean(beanName).getClass(), annotationType);
	}

	private <A extends Annotation> A findAnnotationOnClass(Class<?> cls, Class<A> annotationType)
	{
		// lookup annotation type on class
		A annotation = cls.getAnnotation(annotationType);

		// lookup annotation type on superclass
		if (annotation == null && cls.getSuperclass() != null)
		{
			annotation = findAnnotationOnClass(cls.getSuperclass(), annotationType);
		}

		// lookup annotation type on interfaces
		if (annotation == null)
		{
			for (Class<?> intfClass : cls.getInterfaces())
			{
				annotation = findAnnotationOnClass(intfClass, annotationType);

				if (annotation != null)
				{
					break;
				}
			}
		}

		return annotation;
	}

	@Override
	public ApplicationContext getParent()
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public String getDisplayName()
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public long getStartupDate()
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public void publishEvent(final ApplicationEvent event)
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public void publishEvent(Object o)
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public boolean containsBeanDefinition(final String beanName)
	{
		return containsBean(beanName);
	}

	@Override
	public int getBeanDefinitionCount()
	{
		return beans.size();
	}

	@Override
	public String[] getBeanDefinitionNames()
	{
		return beans.keySet().toArray(new String[beans.size()]);
	}

	@Override
	public String[] getBeanNamesForType(ResolvableType resolvableType)
	{
		return new String[0];
	}

	@Override
	@SuppressWarnings({ "unchecked" })
	public String[] getBeanNamesForType(final Class type)
	{
		ArrayList<String> names = new ArrayList<>();
		for (Entry<String, Object> entry : beans.entrySet())
		{
			Object bean = entry.getValue();

			if (type.isAssignableFrom(bean.getClass()))
			{
				names.add(entry.getKey());
			}
		}
		return names.toArray(new String[names.size()]);
	}

	@Override
	@SuppressWarnings({ "unchecked" })
	public String[] getBeanNamesForType(Class type, boolean includeNonSingletons,
		boolean allowEagerInit)
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons,
		boolean allowEagerInit) throws BeansException
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public String[] getBeanNamesForAnnotation(Class<? extends Annotation> aClass)
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public boolean containsBean(final String name)
	{
		return beans.containsKey(name);
	}

	@Override
	public boolean isSingleton(final String name) throws NoSuchBeanDefinitionException
	{
		return true;
	}

	@Override
	public Class<?> getType(final String name) throws NoSuchBeanDefinitionException
	{
		Object bean = beans.get(name);
		if (bean == null)
		{
			throw new NoSuchBeanDefinitionException("No bean with name '" + name + "'");
		}
		return bean.getClass();
	}

	@Override
	public String[] getAliases(final String name) throws NoSuchBeanDefinitionException
	{
		throw new UnsupportedOperationException();
	}

	/**
	 * @see org.springframework.beans.factory.HierarchicalBeanFactory# getParentBeanFactory()
	 */
	@Override
	public BeanFactory getParentBeanFactory()
	{
		return null;
	}

	@Override
	public String getMessage(final String code, final Object[] args, final String defaultMessage,
		final Locale locale)
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public String getMessage(final String code, final Object[] args, final Locale locale)
		throws NoSuchMessageException
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public String getMessage(final MessageSourceResolvable resolvable, final Locale locale)
		throws NoSuchMessageException
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public Resource[] getResources(final String locationPattern) throws IOException
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public Resource getResource(final String location)
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public boolean containsLocalBean(final String arg0)
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public ClassLoader getClassLoader()
	{
		throw new UnsupportedOperationException();
	}

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

	@Override
	public String getApplicationName()
	{
		return "";
	}

	@Override
	public boolean isPrototype(final String name) throws NoSuchBeanDefinitionException
	{
		return !isSingleton(name);
	}

	@Override
	public boolean isTypeMatch(String s, ResolvableType resolvableType) throws NoSuchBeanDefinitionException
	{
		return false;
	}

	@Override
	@SuppressWarnings({ "unchecked" })
	public boolean isTypeMatch(final String name, final Class targetType)
		throws NoSuchBeanDefinitionException
	{
		throw new UnsupportedOperationException();
	}

	@Override
	public Environment getEnvironment()
	{
		return null;
	}
}


text:
// Copyright (c) 2005-2008 ASCLEPIOS Project, INRIA Sophia-Antipolis (France)
// All rights reserved.
//
// This file is part of the ImageIO Library, and as been adapted for
// CGAL (www.cgal.org).
// You can redistribute it and/or  modify it under the terms of the
// GNU Lesser General Public License as published by the Free Software Foundation;
// either version 3 of the License, or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// These files are provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s)     :  ASCLEPIOS Project (INRIA Sophia-Antipolis), Laurent Rineau

#ifndef _recbuffer_h_
#define _recbuffer_h_

#include "typedefs.h"
#include "recline.h"

extern int GradientModulus( void *bufferIn, bufferType typeIn,
			    void *bufferOut, bufferType typeOut,
			    int *bufferDims, int *borderLengths,
			    float *filterCoefs, recursiveFilterType filterType );
extern int Laplacian_2D( void *bufferIn, bufferType typeIn,
			 void *bufferOut, bufferType typeOut,
			 int *bufferDims, int *borderLengths,
			 float *filterCoefs, recursiveFilterType filterType );
extern int Laplacian( void *bufferIn, bufferType typeIn,
		      void *bufferOut, bufferType typeOut,
		      int *bufferDims, int *borderLengths,
		      float *filterCoefs, recursiveFilterType filterType );

extern int GradientHessianGradient_2D( void *bufferIn, bufferType typeIn,
			 void *bufferOut, bufferType typeOut,
			 int *bufferDims, int *borderLengths,
			 float *filterCoefs, recursiveFilterType filterType );
extern int GradientHessianGradient( void *bufferIn, bufferType typeIn,
		      void *bufferOut, bufferType typeOut,
		      int *bufferDims, int *borderLengths,
		      float *filterCoefs, recursiveFilterType filterType );

/* Recursive filtering on 3D buffers.
 *
 * DESCRIPTION:
 * Performs recursive filtering on 3D buffers.
 * Each direction (X, Y or Z) is performed
 * independently (separability).
 *
 * A direction is filtered if there are enough
 * points along this direction (at least 5),
 * if the coefficient along this direction is
 * positive, and if the derivative's order along
 * this direction is not NODERIVATIVE (see
 * derivativeOrder).
 *
 * Once a line along a direction is extracted for
 * filtering, one may want to add points at both
 * ends of the line to avoid cut-off effects. The
 * value of each endpoint is repeated n times.
 * Thus the length of the line is increased by
 * 2*n.
 *
 * PARAMETERS:
 *
 * - bufferDims[0] is the dimension along X,
 *
 *   bufferDims[1] is the dimension along Y,
 *
 *   bufferDims[2] is the dimension along Y.
 *
 * - borderLengths[0] is the number of points to be
 *   added at both ends of each X line (if
 *   positive). The value of each endpoint is
 *   repeated borderLengths[0] times to produce
 *   a line of length
 *   bufferDims[0] + 2 * borderLengths[0].
 *
 *   borderLengths[1] is the number of points to be
 *   added at both ends of each Y line.
 *
 *   borderLengths[2] is the number of points to be
 *   added at both ends of each Z line.
 *
 * - derivatives[0] is the order of the derivative
 *   to be computed along direction X.
 *
 *   derivatives[1] is the order of the derivative
 *   to be computed along direction Y.
 *
 *   derivatives[2] is the order of the derivative
 *   to be computed along direction Z.
 *
 * - filterCoefs[0] is the coefficient of the filter
 *   to be applied along direction X.
 *
 *   filterCoefs[1] is the coefficient of the filter
 *   to be applied along direction Y.
 *
 *   filterCoefs[2] is the coefficient of the filter
 *   to be applied along direction Z.
 *
 * - filterType is the type of recursive filter to
 *   be applied to the 3D buffer.
 *
 * RETURN:
 *
 * - 0 in case of error
 *
 * - 1 if successful
 *
 * SEE ALSO:
 *
 * - bufferType.
 *
 * - derivativeOrder.
 *
 * - recursiveFilterType.
 *
 * - InitRecursiveCoefficients
 */
extern int RecursiveFilterOnBuffer( void *bufferIn, /* input buffer */
				    bufferType typeIn, /* type of the input buffer */
				    void *bufferOut, /* output buffer */
				    bufferType typeOut, /* type of the output buffer */
				    int *bufferDims, /* buffers' dimensions */
				    int *borderLengths, /* number of points to be added at both ends */
				    derivativeOrder *derivatives, /* order of derivatives to be computed */
				    float *filterCoefs, /* coefficients of the filters to be applied */
				    recursiveFilterType filterType /* type of the recursive filter to be applied */
				    );

/* Turn on verbose mode.
 *
 * DESCRIPTION:
 * Some information will be written on stderr when processing.
 * It will turn on the verbose mode of recline too, by
 * calling Recline_verbose();
 */
extern void Recbuffer_verbose ( );

/* Turn off verbose mode.
 *
 * DESCRIPTION:
 * Nothing will be written on stderr when processing.
 * Exactly the contrary of Recbuffer_verbose ().
 * It will turn off the verbose mode of recline too.
 */
extern void Recbuffer_noverbose ( );

#ifdef CGAL_HEADER_ONLY
#include "recbuffer_impl.h"
#endif // CGAL_HEADER_ONLY

#endif /* _recbuffer_h_ */


text:
IBMSD is recognized as one of the most significant IT service delivery center of IBM Corporation from more than 25 delivery centers around the world.

We have provided a wide array of IT services to the leading organizations in Thailand since 2002. Today, there are more than 1,000 IBMers under our blue umbrella.

At IBMSD, you will never standstill. We provide the world class environment that full of incredible opportunities to learn and grow on your desired career.

You will be a member of 400,000 IBMers' community who always think, share and act their expertise for the better future.

Being the leader of the industry, all of our contributions always make the future not only to our customer, but also to our industry and to our world.

We are now looking for new IBMer who are ready to join the journey, to share the passion and to make the future with us.


text:
struct config_struct {
    int bytes_per_line;
    int backup_on;
    int backup_now;
    char backup_time[256];
    char backup_source[256];
    char backup_target[256];
    char live_site[256];
};

// #define MAX_CONFIG_VARIABLE_LEN 20
// #define CONFIG_LINE_BUFFER_SIZE 100
// #define MAX_LLIST_NAME_LEN 256
// #define MAX_OUT_NAME_LEN 256

int read_int_from_config_line(char* config_line);
void read_str_from_config_line(char* config_line, char* val);
struct config_struct read_config_file();

#endif //ASSIGNMENT1_CONFIGURATION_H


text:
/* MtDec.h -- Multi-thread Decoder
2020-03-05 : Igor Pavlov : Public domain */

#ifndef __MT_DEC_H
#define __MT_DEC_H

#include "7zTypes.h"

#ifndef _7ZIP_ST
#include "Threads.h"
#endif

EXTERN_C_BEGIN

#ifndef _7ZIP_ST

#ifndef _7ZIP_ST
  #define MTDEC__THREADS_MAX 32
#else
  #define MTDEC__THREADS_MAX 1
#endif

typedef struct
{
  ICompressProgress *progress;
  SRes res;
  UInt64 totalInSize;
  UInt64 totalOutSize;
  CCriticalSection cs;
} CMtProgress;

void MtProgress_Init(CMtProgress *p, ICompressProgress *progress);
SRes MtProgress_Progress_ST(CMtProgress *p);
SRes MtProgress_ProgressAdd(CMtProgress *p, UInt64 inSize, UInt64 outSize);
SRes MtProgress_GetError(CMtProgress *p);
void MtProgress_SetError(CMtProgress *p, SRes res);

struct _CMtDec;

typedef struct
{
  struct _CMtDec *mtDec;
  unsigned index;
  void *inBuf;

  size_t inDataSize_Start; // size of input data in start block
  UInt64 inDataSize;       // total size of input data in all blocks

  CThread thread;
  CAutoResetEvent canRead;
  CAutoResetEvent canWrite;
  void  *allocaPtr;
} CMtDecThread;

void MtDecThread_FreeInBufs(CMtDecThread *t);

typedef enum
{
  MTDEC_PARSE_CONTINUE, // continue this block with more input data
  MTDEC_PARSE_OVERFLOW, // MT buffers overflow, need switch to single-thread
  MTDEC_PARSE_NEW,      // new block
  MTDEC_PARSE_END       // end of block threading. But we still can return to threading after Write(&needContinue)
} EMtDecParseState;

typedef struct
{
  // in
  int startCall;
  const Byte *src;
  size_t srcSize;
      // in  : (srcSize == 0) is allowed
      // out : it's allowed to return less that actually was used ?
  int srcFinished;

  // out
  EMtDecParseState state;
  BoolInt canCreateNewThread;
  UInt64 outPos; // check it (size_t)
} CMtDecCallbackInfo;

typedef struct
{
  void (*Parse)(void *p, unsigned coderIndex, CMtDecCallbackInfo *ci);

  // PreCode() and Code():
  // (SRes_return_result != SZ_OK) means stop decoding, no need another blocks
  SRes (*PreCode)(void *p, unsigned coderIndex);
  SRes (*Code)(void *p, unsigned coderIndex,
      const Byte *src, size_t srcSize, int srcFinished,
      UInt64 *inCodePos, UInt64 *outCodePos, int *stop);
  // stop - means stop another Code calls

  /* Write() must be called, if Parse() was called
      set (needWrite) if
      {
         && (was not interrupted by progress)
         && (was not interrupted in previous block)
      }

    out:
      if (*needContinue), decoder still need to continue decoding with new iteration,
         even after MTDEC_PARSE_END
      if (*canRecode), we didn't flush current block data, so we still can decode current block later.
  */
  SRes (*Write)(void *p, unsigned coderIndex,
      BoolInt needWriteToStream,
      const Byte *src, size_t srcSize, BoolInt isCross,
      // int srcFinished,
      BoolInt *needContinue,
      BoolInt *canRecode);

} IMtDecCallback2;

typedef struct _CMtDec
{
  /* input variables */

  size_t inBufSize;        /* size of input block */
  unsigned numThreadsMax;
  // size_t inBlockMax;
  unsigned numThreadsMax_2;

  ISeqInStream *inStream;
  // const Byte *inData;
  // size_t inDataSize;

  ICompressProgress *progress;
  ISzAllocPtr alloc;

  IMtDecCallback2 *mtCallback;
  void *mtCallbackObject;

  /* internal variables */

  size_t allocatedBufsSize;

  BoolInt exitThread;
  WRes exitThreadWRes;

  UInt64 blockIndex;
  BoolInt isAllocError;
  BoolInt overflow;
  SRes threadingErrorSRes;

  BoolInt needContinue;

  // CAutoResetEvent finishedEvent;

  SRes readRes;
  SRes codeRes;

  BoolInt wasInterrupted;

  unsigned numStartedThreads_Limit;
  unsigned numStartedThreads;

  Byte *crossBlock;
  size_t crossStart;
  size_t crossEnd;
  UInt64 readProcessed;
  BoolInt readWasFinished;
  UInt64 inProcessed;

  unsigned filledThreadStart;
  unsigned numFilledThreads;

  #ifndef _7ZIP_ST
  BoolInt needInterrupt;
  UInt64 interruptIndex;
  CMtProgress mtProgress;
  CMtDecThread threads[MTDEC__THREADS_MAX];
  #endif
} CMtDec;

void MtDec_Construct(CMtDec *p);
void MtDec_Destruct(CMtDec *p);

/*
MtDec_Code() returns:
  SZ_OK - in most cases
  MY_SRes_HRESULT_FROM_WRes(WRes_error) - in case of unexpected error in threading function
*/

SRes MtDec_Code(CMtDec *p);
Byte *MtDec_GetCrossBuff(CMtDec *p);

int MtDec_PrepareRead(CMtDec *p);
const Byte *MtDec_Read(CMtDec *p, size_t *inLim);

#endif

EXTERN_C_END

#endif


text:
<?php

defined('JPATH_PLATFORM') or die;

JFormHelper::loadFieldClass('groupedlist');

JLoader::register('FinderHelperLanguage', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/language.php');

/**
 * Form Field class for the Joomla CMS.
 * Supports a select grouped list of finder content map.
 *
 * @since  3.6.0
 */
class JFormFieldContentMap extends JFormFieldGroupedList
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  3.6.0
	 */
	public $type = 'ContentMap';

	/**
	 * Method to get the list of content map options grouped by first level.
	 *
	 * @return  array  The field option objects as a nested array in groups.
	 *
	 * @since   3.6.0
	 */
	protected function getGroups()
	{
		$groups = array();

		// Get the database object and a new query object.
		$db = JFactory::getDbo();

		// Levels subquery.
		$levelQuery = $db->getQuery(true);
		$levelQuery->select('title AS branch_title, 1 as level')
			->select($db->quoteName('id'))
			->from($db->quoteName('#__finder_taxonomy'))
			->where($db->quoteName('parent_id') . ' = 1');
		$levelQuery2 = $db->getQuery(true);
		$levelQuery2->select('b.title AS branch_title, 2 as level')
			->select($db->quoteName('a.id'))
			->from($db->quoteName('#__finder_taxonomy', 'a'))
			->join('LEFT', $db->quoteName('#__finder_taxonomy', 'b') . ' ON ' . $db->qn('a.parent_id') . ' = ' . $db->qn('b.id'))
			->where($db->quoteName('a.parent_id') . ' NOT IN (0, 1)');

		$levelQuery->union($levelQuery2);

		// Main query.
		$query = $db->getQuery(true)
			->select($db->quoteName('a.title', 'text'))
			->select($db->quoteName('a.id', 'value'))
			->select($db->quoteName('d.level'))
			->from($db->quoteName('#__finder_taxonomy', 'a'))
			->join('LEFT', '(' . $levelQuery . ') AS d ON ' . $db->qn('d.id') . ' = ' . $db->qn('a.id'))
			->where($db->quoteName('a.parent_id') . ' <> 0')
			->order('d.branch_title ASC, d.level ASC, a.title ASC');

		$db->setQuery($query);

		try
		{
			$contentMap = $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			return;
		}

		// Build the grouped list array.
		if ($contentMap)
		{
			$lang = JFactory::getLanguage();

			foreach ($contentMap as $branch)
			{
				if ((int) $branch->level === 1)
				{
					$name = $branch->text;
				}
				else
				{
					$levelPrefix = str_repeat('- ', max(0, $branch->level - 1));

					if (trim($name, '**') == 'Language')
					{
						$text = FinderHelperLanguage::branchLanguageTitle($branch->text);
					}
					else
					{
						$key = FinderHelperLanguage::branchSingular($branch->text);
						$text = $lang->hasKey($key) ? JText::_($key) : $branch->text;
					}

					// Initialize the group if necessary.
					if (!isset($groups[$name]))
					{
						$groups[$name] = array();
					}

					$groups[$name][] = JHtml::_('select.option', $branch->value, $levelPrefix . $text);
				}
			}
		}

		// Merge any additional groups in the XML definition.
		$groups = array_merge(parent::getGroups(), $groups);

		return $groups;
	}
}


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.
 */

#ifndef _JArray_H
#define _JArray_H

#ifdef PYTHON
#include <Python.h>
#include "macros.h"

#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#endif

extern jobjectArray fromPySequence(jclass cls, PyObject *sequence);
extern jobjectArray fromPySequence(jclass cls, PyObject **args, int length);
extern PyObject *PyErr_SetJavaError();

extern PyTypeObject *PY_TYPE(JArrayObject);
extern PyTypeObject *PY_TYPE(JArrayString);
extern PyTypeObject *PY_TYPE(JArrayBool);
extern PyTypeObject *PY_TYPE(JArrayByte);
extern PyTypeObject *PY_TYPE(JArrayChar);
extern PyTypeObject *PY_TYPE(JArrayDouble);
extern PyTypeObject *PY_TYPE(JArrayFloat);
extern PyTypeObject *PY_TYPE(JArrayInt);
extern PyTypeObject *PY_TYPE(JArrayLong);
extern PyTypeObject *PY_TYPE(JArrayShort);

#else

typedef int Py_ssize_t;

#endif /* PYTHON */

#include "JCCEnv.h"
#include "java/lang/Object.h"

template<typename T> class JArray : public java::lang::Object {
public:
    Py_ssize_t length;

    explicit JArray<T>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }
    JArray<T>(const JArray<T>& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

#ifdef PYTHON
    JArray<T>(PyObject *sequence) : java::lang::Object(fromPySequence(env->getClass(T::initializeClass), sequence)) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }

    JArray<T>(jclass cls, PyObject *sequence) : java::lang::Object(fromPySequence(cls, sequence)) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }

    JArray<T>(jclass cls, PyObject **args, int length) : java::lang::Object(fromPySequence(cls, args, length)) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }

    PyObject *toSequence(PyObject *(*wrapfn)(const T&))
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        PyObject *list = PyList_New(length);

        for (Py_ssize_t i = 0; i < length; i++)
            PyList_SET_ITEM(list, i, (*wrapfn)((*this)[i]));

        return list;
    }

    PyObject *get(Py_ssize_t n, PyObject *(*wrapfn)(const T&))
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
                return (*wrapfn)((*this)[n]);
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }
#endif

    T operator[](Py_ssize_t n) {
        return T(env->getObjectArrayElement((jobjectArray) this$, n));
    }
};

template<> class JArray<jobject> : public java::lang::Object {
  public:
    Py_ssize_t length;

    JArray<jobject>(jclass cls, Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewObjectArray(n, cls, NULL)) {
        length = env->getArrayLength((jobjectArray) this$);
    }

    JArray<jobject>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }

    JArray<jobject>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

#ifdef PYTHON
    JArray<jobject>(jclass cls, PyObject *sequence) : java::lang::Object(fromPySequence(cls, sequence)) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }

    JArray<jobject>(jclass cls, PyObject **args, int length) : java::lang::Object(fromPySequence(cls, args, length)) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }

    PyObject *toSequence(PyObject *(*wrapfn)(const jobject&))
    {
        return toSequence(0, length, wrapfn);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi,
                         PyObject *(*wrapfn)(const jobject&))
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);

        if (!wrapfn)
            wrapfn = java::lang::t_Object::wrap_jobject;

        for (Py_ssize_t i = lo; i < hi; i++) {
            jobject jobj = env->getObjectArrayElement((jobjectArray) this$, i);
            PyObject *obj = (*wrapfn)(jobj);

            PyList_SET_ITEM(list, i - lo, obj);
        }

        return list;
    }

    PyObject *get(Py_ssize_t n, PyObject *(*wrapfn)(const jobject&))
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!wrapfn)
                    wrapfn = java::lang::t_Object::wrap_jobject;

                jobject jobj =
                    env->getObjectArrayElement((jobjectArray) this$, n);

                return (*wrapfn)(jobj);
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                jobject jobj;

                if (PyString_Check(obj) || PyUnicode_Check(obj))
                    jobj = env->fromPyString(obj);
                else if (!PyObject_TypeCheck(obj, &PY_TYPE(JObject)))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }
                else
                    jobj = ((t_JObject *) obj)->object.this$;

                try {
                    env->setObjectArrayElement((jobjectArray) this$, n, jobj);
                } catch (int e) {
                    switch (e) {
                      case _EXC_JAVA:
                        PyErr_SetJavaError();
                        return -1;
                      default:
                        throw;
                    }
                }

                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap(PyObject *(*wrapfn)(const jobject&)) const;
#endif

    jobject operator[](Py_ssize_t n) {
        return (jobject) env->getObjectArrayElement((jobjectArray) this$, n);
    }
};

template<> class JArray<jstring> : public java::lang::Object {
  public:
    Py_ssize_t length;

    JArray<jstring>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jobjectArray) this$) : 0;
    }

    JArray<jstring>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jstring>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewObjectArray(n, env->findClass("java/lang/String"), NULL)) {
        length = env->getArrayLength((jobjectArray) this$);
    }

#ifdef PYTHON
    JArray<jstring>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewObjectArray(PySequence_Length(sequence), env->findClass("java/lang/String"), NULL)) {
        length = env->getArrayLength((jobjectArray) this$);

        for (Py_ssize_t i = 0; i < length; i++) {
            PyObject *obj = PySequence_GetItem(sequence, i);

            if (obj == NULL)
                break;

            jstring str = env->fromPyString(obj);

            Py_DECREF(obj);
            if (PyErr_Occurred())
                break;

            env->setObjectArrayElement((jobjectArray) this$, i, str);
            env->get_vm_env()->DeleteLocalRef(str);
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);

        for (Py_ssize_t i = lo; i < hi; i++) {
            jstring str = (jstring)
                env->getObjectArrayElement((jobjectArray) this$, i);
            PyObject *obj = env->fromJString(str, 1);

            PyList_SET_ITEM(list, i - lo, obj);
        }

        return list;
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                jstring str = (jstring)
                    env->getObjectArrayElement((jobjectArray) this$, n);
                PyObject *obj = env->fromJString(str, 1);

                return obj;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                jstring str = env->fromPyString(obj);

                if (PyErr_Occurred())
                    return -1;

                env->setObjectArrayElement((jobjectArray) this$, n, str);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jstring operator[](Py_ssize_t n) {
        return (jstring) env->getObjectArrayElement((jobjectArray) this$, n);
    }
};

template<> class JArray<jboolean> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jbooleanArray array;
        jboolean *elts;
    public:
        arrayElements(jbooleanArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetBooleanArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseBooleanArrayElements(array, elts, 0);
        }
        operator jboolean *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jbooleanArray) this$);
    }

    JArray<jboolean>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jboolean>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jboolean>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewBooleanArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jboolean>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewBooleanArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jboolean *buf = (jboolean *) elts;

        for (Py_ssize_t i = 0; i < length; i++) {
            PyObject *obj = PySequence_GetItem(sequence, i);

            if (!obj)
                break;

            if (obj == Py_True || obj == Py_False)
            {
                buf[i] = (jboolean) (obj == Py_True);
                Py_DECREF(obj);
            }
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                Py_DECREF(obj);
                break;
            }
        }
    }

    JArray<jboolean>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewBooleanArray(length)) {
        arrayElements elts = elements();
        jboolean *buf = (jboolean *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (obj == Py_True || obj == Py_False)
                buf[i] = (jboolean) (obj == Py_True);
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);
        arrayElements elts = elements();
        jboolean *buf = (jboolean *) elts;

        for (Py_ssize_t i = lo; i < hi; i++) {
            jboolean value = buf[i];
            PyObject *obj = value ? Py_True : Py_False;

            Py_INCREF(obj);
            PyList_SET_ITEM(list, i - lo, obj);
        }

        return list;
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
                Py_RETURN_BOOL(elements()[n]);
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                elements()[n] = (jboolean) PyObject_IsTrue(obj);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jboolean operator[](Py_ssize_t n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jboolean *elts = (jboolean *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jboolean value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

template<> class JArray<jbyte> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jbyteArray array;
        jbyte *elts;
    public:
        arrayElements(jbyteArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetByteArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseByteArrayElements(array, elts, 0);
        }
        operator jbyte *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jbyteArray) this$);
    }

    JArray<jbyte>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jbyte>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jbyte>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewByteArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jbyte>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewByteArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jbyte *buf = (jbyte *) elts;

        if (PyString_Check(sequence))
            memcpy(buf, PyString_AS_STRING(sequence), length);
        else
            for (Py_ssize_t i = 0; i < length; i++) {
                PyObject *obj = PySequence_GetItem(sequence, i);

                if (!obj)
                    break;

                if (PyString_Check(obj) && (PyString_GET_SIZE(obj) == 1))
                {
                    buf[i] = (jbyte) PyString_AS_STRING(obj)[0];
                    Py_DECREF(obj);
                }
                else if (PyInt_CheckExact(obj))
                {
                    buf[i] = (jbyte) PyInt_AS_LONG(obj);
                    Py_DECREF(obj);
                }
                else
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    Py_DECREF(obj);
                    break;
                }
            }
    }

    JArray<jbyte>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewByteArray(length)) {
        arrayElements elts = elements();
        jbyte *buf = (jbyte *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (PyString_Check(obj) && (PyString_GET_SIZE(obj) == 1))
                buf[i] = (jbyte) PyString_AS_STRING(obj)[0];
            else if (PyInt_CheckExact(obj))
                buf[i] = (jbyte) PyInt_AS_LONG(obj);
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    char getType()
    {
        return 'Z';
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        arrayElements elts = elements();
        jbyte *buf = (jbyte *) elts;
        PyObject *tuple = PyTuple_New(hi - lo);

        for (Py_ssize_t i = 0; i < hi - lo; i++)
            PyTuple_SET_ITEM(tuple, i, PyInt_FromLong(buf[lo + i]));

        return tuple;
    }

    PyObject *to_string_()
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        arrayElements elts = elements();
        jbyte *buf = (jbyte *) elts;

        return PyString_FromStringAndSize((char *) buf, length);
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                jbyte b = (*this)[n];
                return PyInt_FromLong(b);
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!PyInt_CheckExact(obj))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }

                elements()[n] = (jbyte) PyInt_AS_LONG(obj);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jbyte operator[](Py_ssize_t n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jbyte *elts = (jbyte *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jbyte value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

template<> class JArray<jchar> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jcharArray array;
        jchar *elts;
    public:
        arrayElements(jcharArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetCharArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseCharArrayElements(array, elts, 0);
        }
        operator jchar *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jcharArray) this$);
    }

    JArray<jchar>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jchar>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jchar>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewCharArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jchar>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewCharArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jchar *buf = (jchar *) elts;

        if (PyUnicode_Check(sequence))
        {
            if (sizeof(Py_UNICODE) == sizeof(jchar))
                memcpy(buf, PyUnicode_AS_UNICODE(sequence),
                       length * sizeof(jchar));
            else
            {
                Py_UNICODE *pchars = PyUnicode_AS_UNICODE(sequence);
                for (Py_ssize_t i = 0; i < length; i++)
                    buf[i] = (jchar) pchars[i];
            }
        }
        else
            for (Py_ssize_t i = 0; i < length; i++) {
                PyObject *obj = PySequence_GetItem(sequence, i);

                if (!obj)
                    break;

                if (PyUnicode_Check(obj) && (PyUnicode_GET_SIZE(obj) == 1))
                {
                    buf[i] = (jchar) PyUnicode_AS_UNICODE(obj)[0];
                    Py_DECREF(obj);
                }
                else
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    Py_DECREF(obj);
                    break;
                }
            }
    }

    JArray<jchar>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewCharArray(length)) {
        arrayElements elts = elements();
        jchar *buf = (jchar *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (PyUnicode_Check(obj) && (PyUnicode_GET_SIZE(obj) == 1))
                buf[i] = (jchar) PyUnicode_AS_UNICODE(obj)[0];
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        arrayElements elts = elements();
        jchar *buf = (jchar *) elts;

        if (sizeof(Py_UNICODE) == sizeof(jchar))
            return PyUnicode_FromUnicode((const Py_UNICODE *) buf + lo,
                                         hi - lo);
        else
        {
            PyObject *string = PyUnicode_FromUnicode(NULL, hi - lo);
            Py_UNICODE *pchars = PyUnicode_AS_UNICODE(string);

            for (Py_ssize_t i = lo; i < hi; i++)
                pchars[i - lo] = (Py_UNICODE) buf[i];

            return string;
        }
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                jchar c = (*this)[n];

                if (sizeof(Py_UNICODE) == sizeof(jchar))
                    return PyUnicode_FromUnicode((const Py_UNICODE *) &c, 1);
                else
                {
                    PyObject *string = PyUnicode_FromUnicode(NULL, 1);
                    Py_UNICODE *pchars = PyUnicode_AS_UNICODE(string);

                    pchars[0] = (Py_UNICODE) c;

                    return string;
                }
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!PyUnicode_Check(obj))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }
                if (PyUnicode_GET_SIZE(obj) != 1)
                {
                    PyErr_SetObject(PyExc_ValueError, obj);
                    return -1;
                }

                elements()[n] = (jchar) PyUnicode_AS_UNICODE(obj)[0];
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jchar operator[](Py_ssize_t n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jchar *elts = (jchar *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jchar value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

template<> class JArray<jdouble> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jdoubleArray array;
        jdouble *elts;
    public:
        arrayElements(jdoubleArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetDoubleArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseDoubleArrayElements(array, elts, 0);
        }
        operator jdouble *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jdoubleArray) this$);
    }

    JArray<jdouble>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jdouble>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jdouble>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewDoubleArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jdouble>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewDoubleArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jdouble *buf = (jdouble *) elts;

        for (Py_ssize_t i = 0; i < length; i++) {
            PyObject *obj = PySequence_GetItem(sequence, i);

            if (!obj)
                break;

            if (PyFloat_Check(obj))
            {
                buf[i] = (jdouble) PyFloat_AS_DOUBLE(obj);
                Py_DECREF(obj);
            }
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                Py_DECREF(obj);
                break;
            }
        }
    }

    JArray<jdouble>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewDoubleArray(length)) {
        arrayElements elts = elements();
        jdouble *buf = (jdouble *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (PyFloat_Check(obj))
                buf[i] = (jdouble) PyFloat_AS_DOUBLE(obj);
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);
        arrayElements elts = elements();
        jdouble *buf = (jdouble *) elts;

        for (Py_ssize_t i = lo; i < hi; i++)
            PyList_SET_ITEM(list, i - lo, PyFloat_FromDouble((double) buf[i]));

        return list;
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
                return PyFloat_FromDouble((double) (*this)[n]);
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!PyFloat_Check(obj))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }

                elements()[n] = (jdouble) PyFloat_AS_DOUBLE(obj);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jdouble operator[](Py_ssize_t n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jdouble *elts = (jdouble *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jdouble value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

template<> class JArray<jfloat> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jfloatArray array;
        jfloat *elts;
    public:
        arrayElements(jfloatArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetFloatArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseFloatArrayElements(array, elts, 0);
        }
        operator jfloat *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jfloatArray) this$);
    }

    JArray<jfloat>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jfloat>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jfloat>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewFloatArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jfloat>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewFloatArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jfloat *buf = (jfloat *) elts;

        for (Py_ssize_t i = 0; i < length; i++) {
            PyObject *obj = PySequence_GetItem(sequence, i);

            if (!obj)
                break;

            if (PyFloat_Check(obj))
            {
                buf[i] = (jfloat) PyFloat_AS_DOUBLE(obj);
                Py_DECREF(obj);
            }
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                Py_DECREF(obj);
                break;
            }
        }
    }

    JArray<jfloat>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewFloatArray(length)) {
        arrayElements elts = elements();
        jfloat *buf = (jfloat *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (PyFloat_Check(obj))
                buf[i] = (jfloat) PyFloat_AS_DOUBLE(obj);
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);
        arrayElements elts = elements();
        jfloat *buf = (jfloat *) elts;

        for (Py_ssize_t i = lo; i < hi; i++)
            PyList_SET_ITEM(list, i - lo, PyFloat_FromDouble((double) buf[i]));

        return list;
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
                return PyFloat_FromDouble((double) (*this)[n]);
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!PyFloat_Check(obj))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }

                elements()[n] = (jfloat) PyFloat_AS_DOUBLE(obj);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jfloat operator[](Py_ssize_t n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jfloat *elts = (jfloat *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jfloat value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

template<> class JArray<jint> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jintArray array;
        jint *elts;
    public:
        arrayElements(jintArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetIntArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseIntArrayElements(array, elts, 0);
        }
        operator jint *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jintArray) this$);
    }

    JArray<jint>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jint>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jint>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewIntArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jint>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewIntArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jint *buf = (jint *) elts;

        for (Py_ssize_t i = 0; i < length; i++) {
            PyObject *obj = PySequence_GetItem(sequence, i);

            if (!obj)
                break;

            if (PyInt_Check(obj))
            {
                buf[i] = (jint) PyInt_AS_LONG(obj);
                Py_DECREF(obj);
            }
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                Py_DECREF(obj);
                break;
            }
        }
    }

    JArray<jint>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewIntArray(length)) {
        arrayElements elts = elements();
        jint *buf = (jint *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (PyInt_Check(obj))
                buf[i] = (jint) PyInt_AS_LONG(obj);
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);
        arrayElements elts = elements();
        jint *buf = (jint *) elts;

        for (Py_ssize_t i = lo; i < hi; i++)
            PyList_SET_ITEM(list, i - lo, PyInt_FromLong(buf[i]));

        return list;
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
                return PyInt_FromLong((*this)[n]);
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!PyInt_Check(obj))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }

                elements()[n] = (jint) PyInt_AS_LONG(obj);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jint operator[](Py_ssize_t n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jint *elts = (jint *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jint value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

template<> class JArray<jlong> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jlongArray array;
        jlong *elts;
    public:
        arrayElements(jlongArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetLongArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseLongArrayElements(array, elts, 0);
        }
        operator jlong *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jlongArray) this$);
    }

    JArray<jlong>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jlong>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jlong>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewLongArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jlong>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewLongArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jlong *buf = (jlong *) elts;

        for (Py_ssize_t i = 0; i < length; i++) {
            PyObject *obj = PySequence_GetItem(sequence, i);

            if (!obj)
                break;

            if (PyLong_Check(obj))
            {
                buf[i] = (jlong) PyLong_AsLongLong(obj);
                Py_DECREF(obj);
            }
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                Py_DECREF(obj);
                break;
            }
        }
    }

    JArray<jlong>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewLongArray(length)) {
        arrayElements elts = elements();
        jlong *buf = (jlong *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (PyLong_Check(obj))
                buf[i] = (jlong) PyLong_AsLongLong(obj);
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);
        arrayElements elts = elements();
        jlong *buf = (jlong *) elts;

        for (Py_ssize_t i = lo; i < hi; i++)
            PyList_SET_ITEM(list, i - lo, PyLong_FromLongLong((long long) buf[i]));

        return list;
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
                return PyLong_FromLongLong((long long) (*this)[n]);
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!PyLong_Check(obj))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }

                elements()[n] = (jlong) PyLong_AsLongLong(obj);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jlong operator[](long n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jlong *elts = (jlong *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jlong value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

template<> class JArray<jshort> : public java::lang::Object {
  public:
    Py_ssize_t length;

    class arrayElements {
    private:
        jboolean isCopy;
        jshortArray array;
        jshort *elts;
    public:
        arrayElements(jshortArray array) {
            this->array = array;
            elts = env->get_vm_env()->GetShortArrayElements(array, &isCopy);
        }
        virtual ~arrayElements() {
            env->get_vm_env()->ReleaseShortArrayElements(array, elts, 0);
        }
        operator jshort *() {
            return elts;
        }
    };

    arrayElements elements() {
        return arrayElements((jshortArray) this$);
    }

    JArray<jshort>(jobject obj) : java::lang::Object(obj) {
        length = this$ ? env->getArrayLength((jarray) this$) : 0;
    }

    JArray<jshort>(const JArray& obj) : java::lang::Object(obj) {
        length = obj.length;
    }

    JArray<jshort>(Py_ssize_t n) : java::lang::Object(env->get_vm_env()->NewShortArray(n)) {
        length = env->getArrayLength((jarray) this$);
    }

#ifdef PYTHON
    JArray<jshort>(PyObject *sequence) : java::lang::Object(env->get_vm_env()->NewShortArray(PySequence_Length(sequence))) {
        length = env->getArrayLength((jarray) this$);
        arrayElements elts = elements();
        jshort *buf = (jshort *) elts;

        for (Py_ssize_t i = 0; i < length; i++) {
            PyObject *obj = PySequence_GetItem(sequence, i);

            if (!obj)
                break;

            if (PyInt_Check(obj))
            {
                buf[i] = (jshort) PyInt_AS_LONG(obj);
                Py_DECREF(obj);
            }
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                Py_DECREF(obj);
                break;
            }
        }
    }

    JArray<jshort>(PyObject **args, int length) : java::lang::Object(env->get_vm_env()->NewShortArray(length)) {
        arrayElements elts = elements();
        jshort *buf = (jshort *) elts;

        for (int i = 0; i < length; i++) {
            PyObject *obj = args[i];

            if (!obj)
                break;

            if (PyInt_Check(obj))
                buf[i] = (jshort) PyInt_AS_LONG(obj);
            else
            {
                PyErr_SetObject(PyExc_TypeError, obj);
                break;
            }
        }
    }

    PyObject *toSequence()
    {
        return toSequence(0, length);
    }

    PyObject *toSequence(Py_ssize_t lo, Py_ssize_t hi)
    {
        if (this$ == NULL)
            Py_RETURN_NONE;

        if (lo < 0) lo = length + lo;
        if (lo < 0) lo = 0;
        else if (lo > length) lo = length;
        if (hi < 0) hi = length + hi;
        if (hi < 0) hi = 0;
        else if (hi > length) hi = length;
        if (lo > hi) lo = hi;

        PyObject *list = PyList_New(hi - lo);
        arrayElements elts = elements();
        jshort *buf = (jshort *) elts;

        for (Py_ssize_t i = lo; i < hi; i++)
            PyList_SET_ITEM(list, i - lo, PyInt_FromLong(buf[i]));

        return list;
    }

    PyObject *get(Py_ssize_t n)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
                return PyInt_FromLong((long) (*this)[n]);
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return NULL;
    }

    int set(Py_ssize_t n, PyObject *obj)
    {
        if (this$ != NULL)
        {
            if (n < 0)
                n = length + n;

            if (n >= 0 && n < length)
            {
                if (!PyInt_Check(obj))
                {
                    PyErr_SetObject(PyExc_TypeError, obj);
                    return -1;
                }

                elements()[n] = (jshort) PyInt_AS_LONG(obj);
                return 0;
            }
        }

        PyErr_SetString(PyExc_IndexError, "index out of range");
        return -1;
    }

    PyObject *wrap() const;
#endif

    jshort operator[](Py_ssize_t n) {
        JNIEnv *vm_env = env->get_vm_env();
        jboolean isCopy = 0;
        jshort *elts = (jshort *)
            vm_env->GetPrimitiveArrayCritical((jarray) this$, &isCopy);
        jshort value = elts[n];

        vm_env->ReleasePrimitiveArrayCritical((jarray) this$, elts, 0);

        return value;
    }
};

#ifdef PYTHON

template<typename T> class t_JArray {
public:
    PyObject_HEAD
    JArray<T> array;
};

template<typename T, typename U> class t_JArrayWrapper {
public:
    static PyObject *wrap_Object(const JArray<T> &array)
    {
        if (!!array)
            return array.wrap(U::wrap_jobject);

        Py_RETURN_NONE;
    }

    static PyObject *wrap_jobject(const jobject &array)
    {
        if (!!array)
            return JArray<T>(array).wrap(U::wrap_jobject);

        Py_RETURN_NONE;
    }
};

template<typename T> class t_JArrayWrapper<T, T> {
public:
    static PyObject *wrap_Object(const JArray<T> &array)
    {
        if (!!array)
            return array.wrap();

        Py_RETURN_NONE;
    }

    static PyObject *wrap_jobject(const jobject &array)
    {
        if (!!array)
            return JArray<T>(array).wrap();

        Py_RETURN_NONE;
    }
};

#endif

#endif /* _JArray_H */


text:
					{{ for(var i = it.page * it.no_posts_per_page; i < (it.page * it.no_posts_per_page) + it.no_posts_per_page; i++) { }}
						{{? it.posts[i] && typeof it.posts[i].html !== undefined}}

{{=it.posts[i].title}}

{{=it.moment(it.posts[i].date).add(1, 'minute').format('D MMMM YYYY')}}

{{=it.posts_html[it.posts[i].html]}}

								Comments

						{{?}}
					{{ } }}

						{{? it.page > 0}}
						 previous page</
						{{?}}

						{{? it.page < it.last_page}}
						next page
						{{?}}

About me

Contact

					{{? it.categories.length !== 0}}

Categories

						{{ for(var i = 0; i < it.categories.length; i++) { }}

{{=it.categories[i].category}}

						{{ } }}

					{{?}}

Recent Posts

					{{ for(var i = 0; i < it.recent_posts.length; i++) { }}

{{=it.recent_posts[i].title}}

					{{ } }}

All Posts

						{{? it.page > 0}}
						 previous page</
						{{?}}

						{{? it.page < it.last_page}}
						next page
						{{?}}


text:
from django.db.models.query import QuerySet, EmptyQuerySet
from django.dispatch import dispatcher
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist

# Size of each "chunk" for get_iterator calls.
# Larger values are slightly faster at the expense of more storage space.
GET_ITERATOR_CHUNK_SIZE = 100

def ensure_default_manager(sender):
    cls = sender
    if not hasattr(cls, '_default_manager'):
        # Create the default manager, if needed.
        try:
            cls._meta.get_field('objects')
            raise ValueError, "Model %s must specify a custom Manager, because it has a field named 'objects'" % cls.__name__
        except FieldDoesNotExist:
            pass
        cls.add_to_class('objects', Manager())

dispatcher.connect(ensure_default_manager, signal=signals.class_prepared)

class Manager(object):
    # Tracks each time a Manager instance is created. Used to retain order.
    creation_counter = 0

    def __init__(self):
        super(Manager, self).__init__()
        # Increase the creation counter, and save our local copy.
        self.creation_counter = Manager.creation_counter
        Manager.creation_counter += 1
        self.model = None

    def contribute_to_class(self, model, name):
        # TODO: Use weakref because of possible memory leak / circular reference.
        self.model = model
        setattr(model, name, ManagerDescriptor(self))
        if not hasattr(model, '_default_manager') or self.creation_counter < model._default_manager.creation_counter:
            model._default_manager = self

    #######################
    # PROXIES TO QUERYSET #
    #######################

    def get_empty_query_set(self):
        return EmptyQuerySet(self.model)

    def get_query_set(self):
        """Returns a new QuerySet object.  Subclasses can override this method
        to easily customise the behaviour of the Manager.
        """
        return QuerySet(self.model)

    def none(self):
        return self.get_empty_query_set()

    def all(self):
        return self.get_query_set()

    def count(self):
        return self.get_query_set().count()

    def dates(self, *args, **kwargs):
        return self.get_query_set().dates(*args, **kwargs)

    def distinct(self, *args, **kwargs):
        return self.get_query_set().distinct(*args, **kwargs)

    def extra(self, *args, **kwargs):
        return self.get_query_set().extra(*args, **kwargs)

    def get(self, *args, **kwargs):
        return self.get_query_set().get(*args, **kwargs)

    def get_or_create(self, **kwargs):
        return self.get_query_set().get_or_create(**kwargs)

    def create(self, **kwargs):
        return self.get_query_set().create(**kwargs)

    def filter(self, *args, **kwargs):
        return self.get_query_set().filter(*args, **kwargs)

    def complex_filter(self, *args, **kwargs):
        return self.get_query_set().complex_filter(*args, **kwargs)

    def exclude(self, *args, **kwargs):
        return self.get_query_set().exclude(*args, **kwargs)

    def in_bulk(self, *args, **kwargs):
        return self.get_query_set().in_bulk(*args, **kwargs)

    def iterator(self, *args, **kwargs):
        return self.get_query_set().iterator(*args, **kwargs)

    def latest(self, *args, **kwargs):
        return self.get_query_set().latest(*args, **kwargs)

    def order_by(self, *args, **kwargs):
        return self.get_query_set().order_by(*args, **kwargs)

    def select_related(self, *args, **kwargs):
        return self.get_query_set().select_related(*args, **kwargs)

    def values(self, *args, **kwargs):
        return self.get_query_set().values(*args, **kwargs)

class ManagerDescriptor(object):
    # This class ensures managers aren't accessible via model instances.
    # For example, Poll.objects works, but poll_obj.objects raises AttributeError.
    def __init__(self, manager):
        self.manager = manager

    def __get__(self, instance, type=None):
        if instance != None:
            raise AttributeError, "Manager isn't accessible via %s instances" % type.__name__
        return self.manager