text:
package oncecenter.wizard.newvmfromtemp;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import oncecenter.util.ImageRegistry;
import oncecenter.util.TypeUtil;
import oncecenter.views.xenconnectiontreeview.elements.VMTreeObject;
import oncecenter.views.xenconnectiontreeview.elements.VMTreeObjectSR;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wb.swt.SWTResourceManager;

import com.once.xenapi.SR;

public class SelectStorageWizardPage extends NewVMPage {

	TableViewer tableViewer;
	private Table table;
	ArrayList<Storage> srs = new ArrayList<Storage>();
	private String input = null;
	VMTreeObject template;
	Button editButton ;

	/**
	 * Create the wizard.
	 */
	public SelectStorageWizardPage() {
		super("wizardPage");
		setTitle("Ó²ÅÌÉèÖÃ");
		setDescription("ΪÐéÄâ»úÑ¡ÔñÒ»¸öÓ²Å̴洢λÖò¢É趨ӲÅÌ´óС");
	}

	/**
	 * Create contents of the wizard.
	 *
	 * @param parent
	 */
	public void createControl(Composite parent) {

		getStorageList();
		template = ((NewVmFTWizard)this.getWizard()).selectedTemp;
		Composite composite = new Composite(parent, SWT.NULL);
		composite.setLayout(new GridLayout(1,false));
		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
		Composite operateComp = new Composite(composite,SWT.NULL);
		operateComp.setLayout(new GridLayout(3,false));

		table = new Table( composite, SWT.BORDER | SWT.V_SCROLL
		        | SWT.H_SCROLL|SWT.FULL_SELECTION|SWT.MULTI);
		table.setLayoutData(new GridData(GridData.FILL_BOTH));
		table.setLinesVisible(true);

		TableColumn tc1 = new TableColumn(table, SWT.CENTER);
		TableColumn tc2 = new TableColumn(table, SWT.CENTER);
		TableColumn tc3 = new TableColumn(table, SWT.CENTER);
		TableColumn tc4 = new TableColumn(table, SWT.CENTER);
		TableColumn tc6 = new TableColumn(table, SWT.CENTER);
		TableColumn tc5 = new TableColumn(table, SWT.CENTER);
		tc1.setText("   ");
		tc2.setText("λÖÃ");
		tc3.setText("ÀàÐÍ");
		tc4.setText("´óС(G)");
		tc6.setText("¿ÉÓôóС(G)");
		tc5.setText("¹²Ïí");
		tc1.setWidth(30);
		tc2.setWidth(180);
		tc3.setWidth(80);
		tc4.setWidth(60);
		tc6.setWidth(80);
		tc5.setWidth(60);
		table.setHeaderVisible(true);

		tableViewer = new TableViewer(table);
		tableViewer.setContentProvider(new StorageContentProvider());
		tableViewer.setLabelProvider(new TableLabelProvider());

		tableViewer.setInput(srs);
		int flag = 0;
		for(Storage s:srs){
			if(s.getSize()>0)
				break;
			else
				flag++;
		}
		if(flag<srs.size()){
			table.setSelection(flag);
		}

		table.pack();

		if(table.getItemCount()==0)
			this.setPageComplete(false);

		editButton = new Button(composite,SWT.PUSH);
		editButton.setText("ÉèÖÃÓ²ÅÌ´óС");
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.END;
		editButton.setLayoutData(gridData);

		editButton.addSelectionListener(new SelectionListener(){

			@Override
			public void widgetDefaultSelected(SelectionEvent arg0) {

				widgetSelected(arg0);
			}

			@Override
			public void widgetSelected(SelectionEvent arg0) {

				int index = table.getSelectionIndex();
				if(index != -1)
				{
					EditDialog dialog = new EditDialog(Display.getCurrent().getActiveShell(),index);
					dialog.open();
				}
			}

		});
		if(srs.isEmpty())
			editButton.setEnabled(false);
		//Èç¹ûÑ¡ÔñÓÃÄ£°å´´½¨£¬²»ÓÃÑ¡Ôñ´æ´¢
		if(template != null)
		{
			table.setVisible(false);
			editButton.setVisible(false);
		}
		setControl(composite);

	}

	private void getStorageList()
	{
		boolean isAssignHost = ((NewVmFTWizard)this.getWizard()).isAssignHost;
		if(srs != null )
			srs.clear();
		if(((NewVmFTWizard)this.getWizard()).isPool){
			for(VMTreeObjectSR o:((NewVmFTWizard)this.getWizard()).srs){
				if(TypeUtil.getDiskSRTypes().contains(o.getSrType())
						&&!o.getSrType().equals(TypeUtil.localSrType)){
					Storage sr = new Storage(10,o);
					int index=0;
					for(;index<srs.size();index++){
						if(srs.get(index).getMaxSize()<sr.maxSize)
							break;
					}
					srs.add(index, sr);
				}
			}
			if(isAssignHost){
				VMTreeObjectSR localSR = (VMTreeObjectSR)((NewVmFTWizard)this.getWizard()).selectedSR;
				if(localSR != null)
				{
					Storage sr = new Storage(10,localSR);
					int index=0;
					for(;index<srs.size();index++){
						if(srs.get(index).getMaxSize()<sr.maxSize)
							break;
					}
					srs.add(index, sr);
				}
			}
		}
		else
		{
			VMTreeObjectSR localSR = (VMTreeObjectSR)((NewVmFTWizard)this.getWizard()).selectedSR;
			if(localSR != null)
			{
				Storage sr = new Storage(10,localSR);
				int index=0;
				for(;index<srs.size();index++){
					if(srs.get(index).getMaxSize()<sr.maxSize)
						break;
				}
				srs.add(index, sr);
			}
		}
	}
	class StorageContentProvider implements IStructuredContentProvider
	{

		protected TableViewer viewer;
		@Override
		public void dispose() {

		}

		@Override
		public Object[] getElements(Object inputElement) {

			if(inputElement instanceof List)
				return ((List)inputElement).toArray();
			return null;
		}

		@Override
		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {

		}

	}
	class TableLabelProvider extends LabelProvider implements ITableLabelProvider {

		 @Override
		 public Image getColumnImage(Object element, int columnIndex) {
			 if(element instanceof Storage) {
			   switch(columnIndex) {
			   case 0:
			    return ImageRegistry.getImage(ImageRegistry.STORAGE);
			   }
			  }
			  return null;
		 }

		 @Override
		 public String getColumnText(Object element, int columnIndex) {
		  if(element instanceof Storage) {
			  Storage storage=(Storage)element;
		   switch(columnIndex) {
		   case 0:
			   return "";

		   case 1:
//			   if(storage.getObject().getParent()==null){
//				   System.out.println("Õâ¸ösrûÓÐparent"+storage.getObject().getName());
//			   }
		   {
			   VMTreeObjectSR srObject = storage.getObject();
			   if(srObject.getSrType().equals(TypeUtil.localSrType)){
				   return srObject.getName() + " on " + srObject.getParent().getName();
			   }else {
				   SR.Record srRecord = srObject.getRecord();
				   String location = "";
				   if(srRecord!=null){
					   String descrip = srRecord.nameDescription;
					   if(descrip!=null){
						   String [] m = descrip.split(":");
						   if(m!=null&&m.length>1){
							   String [] n = m[1].split(" ");
							   if(n!=null&&n.length>1){
								   location += n[0];
							   }
						   }
					   }
				   }
				   if(location.length()>0){
					   return srObject.getName() + " on " + location;
				   }else{
					   return srObject.getName();
				   }
			   }
		   }

		   case 2:
		   {
			   String type = storage.getObject().getSrType();
			   if(type.equals("nfs_zfs")){
					return "gluster_zfs";
				}else{
					return type;
				}
		   }

		   case 3:
			   return storage.getSize()+"";
		   case 4:
			   return storage.getMaxSize()+"";
		   case 5:
			   return storage.getObject().getSrType().equals("local")?"²»¹²Ïí":"¹²Ïí";

		   }
		  }

		  return null;
		 }
	}

	private boolean isValid(String inputSize,Storage sr)
	{
		//Èç¹ûÊäÈëΪ¿Õ£¬·µ»Øfalse
		if(inputSize.length() == 0 || inputSize.equals(null))
			return false;
		//ÀûÓÃÕýÔò±í´ïʽÅжÏÊäÈëÊDz»ÊǸ¡µãÊý»òÕûÊýÊýÖµ
		Pattern p = Pattern.compile("^(\\+|-)?\\d+$",Pattern.CANON_EQ);
		Matcher matcher = p.matcher(inputSize);
		if(!matcher.find())
			return false;
		//ÅжÏÊäÈë²»Êdz¬³ö×î´ó×îСֵ·¶Î§
		double size = Double.parseDouble(inputSize);
		if(size > sr.maxSize || size<= sr.minSize)
			return false;
		return true;
	}

	public void refresh()
	{
		if(this.getControl() == null)
			return;
		if(template != null)
		{
			table.setVisible(false);
			editButton.setVisible(false);
		}
		else
		{
			getStorageList();
			tableViewer.setInput(srs);
			table.select(0);
		}
	}
	class EditDialog extends Dialog
	{
		private static final int OK_ID = 0;
		private static final String OK_LABEL = "È·¶¨";
		private static final int CLOSE_ID = 1;
		private static final String CLOSE_LABEL = "È¡Ïû";

		//¶Ô»°¿òÒ³Ãæ¿Ø¼þ
		private Label locationLabel;
		private Text locationText;

		private Label typeLabel;
		private Text typeText;

		private Label sizeLabel;
		private Text sizeText;

		private Label shareLabel;
		private Text shareText;

		private int index;
		private Label errorMsg;
		protected EditDialog(Shell parentShell,int index) {
			super(parentShell);

			this.index = index;
		}

		protected void configureShell(Shell shell)
		{
			super.configureShell(shell);
			shell.setText("ÉèÖÃÓ²ÅÌ´óС");
			shell.setBackground(new Color(null,255,255,255));
		}
		protected Control createDialogArea(Composite parent)
		{

			Storage sr = srs.get(index);

			Composite composite = new Composite(parent,SWT.NONE);
			GridLayout layout = new GridLayout(3,true);
			layout.makeColumnsEqualWidth = false;
			composite.setLayout(layout);
			composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

			locationLabel = new Label(composite,SWT.NONE);
			locationLabel.setText("´æ´¢Î»Öà  £º");
			locationText = new Text(composite,SWT.NONE);
			locationText.setText(sr.getObject().getName() + " on "+sr.getObject().getParent().getName());
			locationText.setEditable(false);
			new Label(composite,SWT.NONE);

			typeLabel = new Label(composite,SWT.NONE);
			typeLabel.setText("´æ´¢ÀàÐÍ  £º");
			typeText = new Text(composite, SWT.NONE);
			typeText.setText(sr.getObject().getSrType());
			typeText.setEditable(false);
			new Label(composite,SWT.NONE);

			sizeLabel = new Label(composite, SWT.NONE);
			sizeLabel.setText("´æ´¢´óС  £º");
			sizeText = new Text(composite, SWT.BORDER);
			sizeText.setFocus();
			sizeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
			sizeText.setText(sr.getSize()+"");
			new Label(composite,SWT.NONE).setText("G");
//		 	sizeText.addModifyListener( new ModifyListener(){
//		         public void modifyText(ModifyEvent e) {
//		        	input = sizeText.getText();
//		        	Storage storage = (Storage)tableViewer.getElementAt(table.getSelectionIndex());
//		         	if(!isValid(input,storage))
//		         	{
//		         		String errorMsg = "ÇëÊäÈëÔÚ" + storage.minSize + "--" + storage.maxSize + "Ö®¼äµÄÕýÕûÊý";
//		        		InputErrorDialog dialog = new InputErrorDialog(Display.getCurrent().getActiveShell(),errorMsg);
//		        		dialog.open();
//		         	}
//		         	int index = table.getSelectionIndex();
//		        	srs.get(index).setSize(input);
//		         }
//		        }) ;
			shareLabel = new Label(composite,SWT.NONE);
			shareLabel.setText("ÊÇ·ñ¹²Ïí  £º");
			shareText = new Text(composite,SWT.NONE);
			shareText.setText(sr.getObject().getSrType().equals("local")?"²»¹²Ïí":"¹²Ïí");
			shareText.setEditable(false);
			new Label(composite,SWT.NONE);

			new Label(composite,SWT.NONE);
			errorMsg = new Label(composite,SWT.NONE);
			errorMsg.setText("                                            ");
			errorMsg.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));

			return parent;
		}

		protected void createButtonsForButtonBar(Composite parent)
		{
			createButton(parent,EditDialog.OK_ID,EditDialog.OK_LABEL,true);
			createButton(parent,EditDialog.CLOSE_ID,EditDialog.CLOSE_LABEL,true);
		}

		protected void buttonPressed(int buttonId)
		{
			if(EditDialog.OK_ID == buttonId)
			{
				input = sizeText.getText().split("G")[0];
				System.out.println("input:" + input);
	        	Storage storage = (Storage)tableViewer.getElementAt(table.getSelectionIndex());
	         	if(!isValid(input,storage))
	         	{
	         		String msg = "ÇëÊäÈëÔÚ" + storage.minSize + "--" + storage.maxSize + "Ö®¼äµÄÕýÕûÊý";
	         		errorMsg.setText(msg);
	         	}
	         	else
	         	{
	         		int index = table.getSelectionIndex();
		        	srs.get(index).setSize(input);
					tableViewer.setInput(srs);
					//tableViewer.refresh();
					this.close();
	         	}
			}
			else if(EditDialog.CLOSE_ID == buttonId)
			{
				this.close();
			}
		}

	}
	class InputErrorDialog extends Dialog
	{
		private CLabel imageCLabel;

		private String errorMsg = null;
		private Label errorLabel;
		private static final int CLOSE_ID = 0;
		private static final String CLOSE_LABEL = "Close";
		protected InputErrorDialog(Shell parentShell,String errorMsg) {
			super(parentShell);

			this.errorMsg = errorMsg;

		}

		protected Control createDialogArea(Composite parent)
		{
			Composite composite = (Composite)super.createDialogArea(parent);
			GridLayout layout = new GridLayout(2,true);
			layout.verticalSpacing = 22;
			layout.horizontalSpacing = 15;
			layout.makeColumnsEqualWidth = false;
			composite.setLayout(layout);
			imageCLabel = new CLabel(composite, SWT.NONE);
			imageCLabel.setImage(ImageRegistry.getImage(ImageRegistry.SERVICENOTOPEN));
			GridData imgData = new GridData();
			imgData.verticalSpan = 2;
			imageCLabel.setLayoutData(imgData);

			errorLabel = new Label(composite, SWT.NONE);
			errorLabel.setText(errorMsg);

			return parent;
		}

		protected void createButtonsForButtonBar(Composite parent)
		{
			createButton(parent,InputErrorDialog.CLOSE_ID,InputErrorDialog.CLOSE_LABEL,true);
		}

		protected void buttonPressed(int buttonId)
		{
			if(InputErrorDialog.CLOSE_ID == buttonId)
				close();
		}
	}

	class Storage {
		private Long size;
		private VMTreeObjectSR object;
		private double maxSize;
		private double minSize;
		public Storage(double size,VMTreeObjectSR object){
			//this.setSize(size);
			this.setObject(object);
			SR.Record srRecord = (SR.Record)object.getRecord();
			if(srRecord.physicalSize==null||srRecord.physicalUtilisation==null){
				this.setMaxSize(Double.MAX_VALUE);
			}else{
				this.setMaxSize((srRecord.physicalSize - srRecord.physicalUtilisation)/1024/1024/1024);
			}
//			System.out.println(srRecord.nameLabel+"µÄ×Ü´óСÊÇ"+srRecord.physicalSize);
//			System.out.println(srRecord.nameLabel+"µÄʹÓÃÁ¿ÊÇ"+srRecord.physicalUtilisation);
//			System.out.println(srRecord.nameLabel+"µÄÊ£Óà¿Õ¼äÊÇ"+this.maxSize+"G");
			this.setMinSize(0);
			this.setSize((size>this.getMaxSize())?this.getMaxSize():size);
		}

		public VMTreeObjectSR getObject() {
			return object;
		}
		public void setObject(VMTreeObjectSR object) {
			this.object = object;
		}

		public double getMaxSize() {
			return maxSize;
		}

		public void setMaxSize(double maxSize) {
			this.maxSize = maxSize;
		}

		public double getMinSize() {
			return minSize;
		}

		public void setMinSize(double minSize) {
			this.minSize = minSize;
		}

		public Long getSize() {
			return size;
		}

		public void setSize(Long size) {
			this.size = size;
		}

		public void setSize(String size) {
			this.size = Long.parseLong(size);
		}

		public void setSize(double size) {
			this.size = (long) Math.floor(size);
		}
	}
	@Override
	protected boolean nextButtonClick() {

		int index = table.getSelectionIndex();

		if(index != -1&&table.getItemCount()>0)
		{
			Storage sr = srs.get(index);
			((NewVmFTWizard)this.getWizard()).storage = sr.getSize();
			((NewVmFTWizard)this.getWizard()).selectedSR = sr.getObject();
			((NewVmFTWizard)this.getWizard()).isShare = sr.getObject().getSrType().equals("local")?
					false:true;
			 IWizardPage nextPage = getWizard().getNextPage(this);
			 if(nextPage instanceof FinishWizardPage)
				 ((FinishWizardPage)nextPage).refresh();
			return true;
		}
		return false;

	}

}


text:
Learning how to use both Python and the Django Web Framework

Using Python 3.4.3 and Pip 6.0.8 with Django 1.8

The tutorial I'm using can be found at http://www.tangowithdjango.com/

redpajama_set_name: RedPajamaGithub


text:
global _start 	; entry for linker

; === [ extern functions ] === ;
extern 	kmain

; === [ multiboot ] === ;
multiboot_flags_malign 	equ 1 << 0
multiboot_flags_mmap 	equ 1 << 1
multiboot_flags 	equ multiboot_flags_malign | multiboot_flags_mmap
multiboot_magicsum 	equ 0x1badb002
multiboot_checksum 	equ -(multiboot_flags + multiboot_magicsum)

section .text
align 4
	dd 	multiboot_magicsum
	dd 	multiboot_flags
	dd 	multiboot_checksum

; === [ paging ] === ;
kern_page_size 	equ 	0x1000

; === [ kernel early ] === ;
_start:
	mov 	esp, kstack
	call 	kmain

	.end:
		cli
		hlt
		jmp 	.end

; === [ kernel stack ] === ;
section .bss
align 32
kstack:
	resb 	kern_page_size


text:
package xml.brevaide;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import data.brevaide.Question;

import android.util.Xml;

public class QuestionsXMLHandler {
	private static final String ns = null;

	public ArrayList<Question> parse(InputStream in) throws XmlPullParserException, IOException {
	        try {
	            XmlPullParser parser = Xml.newPullParser();
	            parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
	            parser.setInput(in, null);
	            parser.nextTag();
	            return readQuestions(parser);
	        } finally {
	            in.close();
	        }
	    }

	private ArrayList<Question> readQuestions(XmlPullParser parser) throws XmlPullParserException, IOException {

		ArrayList<Question> questions = new ArrayList<Question>();

	    parser.require(XmlPullParser.START_TAG, ns, "questions");

	    while (parser.next() != XmlPullParser.END_TAG) {
	        if (parser.getEventType() != XmlPullParser.START_TAG) {
	            continue;
	        }
	        String name = parser.getName();
	        // Starts by looking for the entry tag
	        if (name.equals("question")) {
	            questions.add(readQuestion(parser));
	        } else {
	            skip(parser);
	        }
	    }
	    return questions;
	}

	private Question readQuestion(XmlPullParser parser) throws XmlPullParserException, IOException {
		parser.require(XmlPullParser.START_TAG, ns, "question");

	    String text = parser.getAttributeValue(null, "text");
	    int answerID = Integer.parseInt(parser.getAttributeValue(null, "answerID"));
	    int reponseCounter = 0;
		String[] answers = new String[3];

		while (parser.next() != XmlPullParser.END_TAG) {
	        if (parser.getEventType() != XmlPullParser.START_TAG) {
	            continue;
	        }
	        String name = parser.getName();
	        if (name.equals("reponse") && reponseCounter < 3) {
	            answers[reponseCounter] = readReponse(parser);
	            reponseCounter++;
	        } else {
	            skip(parser);
	        }
	    }

		return new Question(text, answers, answerID);
	}

	private String readReponse(XmlPullParser parser) throws IOException, XmlPullParserException {
	    parser.require(XmlPullParser.START_TAG, ns, "reponse");

	    String reponse = "";

	    if (parser.next() == XmlPullParser.TEXT) {
	        reponse = parser.getText();
	        parser.nextTag();
	    }
	    parser.require(XmlPullParser.END_TAG, ns, "reponse");

	    return reponse;
	}

	private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {
	    if (parser.getEventType() != XmlPullParser.START_TAG) {
	        throw new IllegalStateException();
	    }
	    int depth = 1;
	    while (depth != 0) {
	        switch (parser.next()) {
	        case XmlPullParser.END_TAG:
	            depth--;
	            break;
	        case XmlPullParser.START_TAG:
	            depth++;
	            break;
	        }
	    }
	 }

}


text:
    Remove Registry: {{ vm.selectedRegistry.name }}

Are you sure you want to remove this registry?

        No

        Yes

                 Refresh

                 Add Registry

                <input ng-model="tableFilter" placeholder="Search registries..." reset-field/>

                        Registries

There are no registries.

                        Name
                        Address

                        {{r.name}}
                        {{r.addr}}

 0 && filteredContainers.length === 0">

                        Registries

No registries matched your filter query


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DotAspect.BuildTask")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DotAspect.BuildTask")]
[assembly: AssemblyCopyright("Copyright (c) 20016-2017 Andrey Osintsev <ozzy.ext@gmail.com>")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8ae32571-c8ad-48a7-a804-ebd2150a74be")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.3.1201")]
[assembly: AssemblyFileVersion("1.2.3.1201")]

[assembly: InternalsVisibleTo("DotAspect.BuildTask.Test")]
[assembly: InternalsVisibleTo("AssemblyProcessingTest")]


text:
package org.wso2.carbon.apimgt.gateway.handlers.streaming.sse;

import org.apache.axis2.context.MessageContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.synapse.transport.passthru.DefaultStreamInterceptor;
import org.apache.synapse.transport.passthru.PassThroughConstants;
import org.wso2.carbon.apimgt.gateway.handlers.WebsocketUtil;
import org.wso2.carbon.apimgt.gateway.internal.ServiceReferenceHolder;
import org.wso2.carbon.apimgt.gateway.throttling.publisher.ThrottleDataPublisher;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.dto.APIKeyValidationInfoDTO;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import org.wso2.carbon.context.PrivilegedCarbonContext;

import java.nio.ByteBuffer;

import static org.wso2.carbon.apimgt.gateway.handlers.streaming.sse.SseApiConstants.SSE_THROTTLE_DTO;

/**
 * This is used for handling throttling, and analytics event publishing of sse apis (subset of streaming apis).
 */
public class SseStreamInterceptor extends DefaultStreamInterceptor {

    private static final Log log = LogFactory.getLog(SseStreamInterceptor.class);

    @Override
    public boolean interceptTargetResponse(MessageContext axisCtx) {
        Object artifactType = axisCtx.getProperty(PassThroughConstants.SYNAPSE_ARTIFACT_TYPE);
        return APIConstants.API_TYPE_SSE.equals(artifactType);
    }

    @Override
    public boolean targetResponse(ByteBuffer buffer, MessageContext axis2Ctx) {
        int eventCount = getEventCount(buffer);
        return handleThrottlingAndAnalytics(eventCount, axis2Ctx);
    }

    private int getEventCount(ByteBuffer buffer) {
        int count = 0;
        // do process
        return count;
    }

    private boolean handleThrottlingAndAnalytics(int eventCount, MessageContext axi2Ctx) {

        boolean throttleResult = false;
        Object throttleObject = axi2Ctx.getProperty(SSE_THROTTLE_DTO);
        if (throttleObject != null) {

            ThrottleDTO throttleDTO = (ThrottleDTO) throttleObject;
            APIKeyValidationInfoDTO infoDTO = new APIKeyValidationInfoDTO();

            String tenantDomain = infoDTO.getSubscriberTenantDomain();
            try {
                PrivilegedCarbonContext.startTenantFlow();
                PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
                boolean isThrottled = WebsocketUtil.isThrottled(null, null, null);
                if (isThrottled) {
                    if (APIUtil.isAnalyticsEnabled()) {
                        //  dataCollector.collectData();
                    }
                    return false;
                }
            } finally {
                PrivilegedCarbonContext.endTenantFlow();
            }
            Object[] objects =
                    new Object[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null,
                            null, null, null };
            org.wso2.carbon.databridge.commons.Event event = new org.wso2.carbon.databridge.commons.Event(
                    "org.wso2.throttle.request.stream:1.0.0", System.currentTimeMillis(), null, null, objects);

            ThrottleDataPublisher throttleDataPublisher =
                    ServiceReferenceHolder.getInstance().getThrottleDataPublisher();
            if (throttleDataPublisher != null) {
                // todo need to publish per number of events
                throttleDataPublisher.getDataPublisher().tryPublish(event);
            } else {
                log.error("Cannot publish events to traffic manager because ThrottleDataPublisher "
                                  + "has not been initialised");
            }
            return true;
        } else {
            log.error("Throttle object cannot be null.");
        }
        return throttleResult;
    }
}


text:
import * as fp from "@iml/fp";
import * as maybe from "@iml/maybe";

const getHostByFqdn = (hosts, fqdn) => maybe.map(x => x.id, fp.find(x => x.fqdn === fqdn)(hosts));

type objArr = [Object[], Object];

export function addHostIds([servers, logs]: objArr) {
  logs.objects = logs.objects.map(log => {
    const hostId = maybe.withDefault(() => {}, getHostByFqdn(servers, log.fqdn));

    return {
      ...log,
      host_id: hostId
    };
  });

  return logs;
}


text:
<?php

/* AppBundle::_partials/header.html.twig */
class __TwigTemplate_be2f8935aac4340fe5f1560437770fd0d9cd43bd2fe83fd668bf6c510f8e5d0a extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "

env->getExtension('routing')->getPath("app_homepage");
        echo "\">";
        echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("action.homepage"), "html", null, true);
        echo "

env->getExtension('routing')->getPath("app_about_us");
        echo "\">";
        echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("action.about_us"), "html", null, true);
        echo "

env->getExtension('routing')->getPath("app_news");
        echo "\">";
        echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("action.news"), "html", null, true);
        echo "

        ";
        // line 8
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable(array(0 => "en", 1 => "pl"));
        foreach ($context['_seq'] as $context["_key"] => $context["locale"]) {
            // line 9
            echo "
env, $this->env->getExtension('routing')->getPath($this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : null), "request", array()), "get", array(0 => "_route"), "method"), twig_array_merge($this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : null), "request", array()), "get", array(0 => "_route_params"), "method"), array("_locale" => $context["locale"]))), "html", null, true);
            echo "\">";
            echo twig_escape_filter($this->env, $context["locale"], "html", null, true);
            echo "

        ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['locale'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 11
        echo "

";
    }

    public function getTemplateName()
    {
        return "AppBundle::_partials/header.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  58 => 11,  47 => 9,  43 => 8,  35 => 5,  29 => 4,  23 => 3,  19 => 1,);
    }
}


text:
Scripts
=======

A bunch of standalone or nearly standalone scripts for various things, which don't deserve their own repositories.


text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.keyboard_accessory.tab_layout_component;

import static android.support.test.espresso.matcher.ViewMatchers.assertThat;

import static org.hamcrest.Matchers.is;

import static org.chromium.chrome.browser.keyboard_accessory.tab_layout_component.KeyboardAccessoryTabLayoutProperties.ACTIVE_TAB;
import static org.chromium.chrome.browser.keyboard_accessory.tab_layout_component.KeyboardAccessoryTabLayoutProperties.TABS;
import static org.chromium.chrome.browser.keyboard_accessory.tab_layout_component.KeyboardAccessoryTabLayoutProperties.TAB_SELECTION_CALLBACKS;
import static org.chromium.content_public.browser.test.util.TestThreadUtils.runOnUiThreadBlocking;

import android.support.test.filters.MediumTest;
import android.widget.FrameLayout;

import com.google.android.material.tabs.TabLayout;

import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.keyboard_accessory.AccessoryTabType;
import org.chromium.chrome.browser.keyboard_accessory.R;
import org.chromium.chrome.browser.keyboard_accessory.data.KeyboardAccessoryData;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.ui.modelutil.ListModel;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.test.util.DummyUiActivity;
import org.chromium.ui.test.util.DummyUiActivityTestCase;

/**
 * View tests for the keyboard accessory tab layout component.
 */
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class KeyboardAccessoryTabLayoutViewTest extends DummyUiActivityTestCase {
    private PropertyModel mModel;
    private KeyboardAccessoryTabLayoutView mView;

    private KeyboardAccessoryData.Tab createTestTab(String contentDescription) {
        return new KeyboardAccessoryData.Tab("Passwords",
                getActivity().getResources().getDrawable(android.R.drawable.ic_lock_lock),
                contentDescription,
                R.layout.empty_accessory_sheet, // Unused.
                AccessoryTabType.ALL,
                null); // Unused.
    }

    private CharSequence getTabDescriptionAt(int position) {
        TabLayout.Tab tab = mView.getTabAt(position);
        assert tab != null : "No tab at " + position;
        return tab.getContentDescription();
    }

    @BeforeClass
    public static void setUpBeforeActivityLaunched() {
        DummyUiActivity.setTestLayout(R.layout.keyboard_accessory_tabs);
    }

    @Override
    public void setUpTest() throws Exception {
        super.setUpTest();

        runOnUiThreadBlocking(() -> {
            mModel = new PropertyModel.Builder(TABS, ACTIVE_TAB, TAB_SELECTION_CALLBACKS)
                             .with(TABS, new ListModel<>())
                             .with(ACTIVE_TAB, null)
                             .build();
            mView = (KeyboardAccessoryTabLayoutView) ((FrameLayout) getActivity().findViewById(
                                                              android.R.id.content))
                            .getChildAt(0);
            KeyboardAccessoryTabLayoutCoordinator.createTabViewBinder(mModel, mView);
        });
    }

    @Test
    @MediumTest
    public void testRemovesTabs() {
        runOnUiThreadBlocking(() -> {
            mModel.get(TABS).set(new KeyboardAccessoryData.Tab[] {createTestTab("FirstTab"),
                    createTestTab("SecondTab"), createTestTab("ThirdTab")});
        });

        CriteriaHelper.pollUiThread(() -> mView.getTabCount() == 3);

        assertThat(getTabDescriptionAt(0), is("FirstTab"));
        assertThat(getTabDescriptionAt(1), is("SecondTab"));
        assertThat(getTabDescriptionAt(2), is("ThirdTab"));

        runOnUiThreadBlocking(() -> mModel.get(TABS).remove(mModel.get(TABS).get(1)));

        CriteriaHelper.pollUiThread(() -> mView.getTabCount() == 2);
        assertThat(getTabDescriptionAt(0), is("FirstTab"));
        assertThat(getTabDescriptionAt(1), is("ThirdTab"));
    }

    @Test
    @MediumTest
    public void testAddsTabs() {
        runOnUiThreadBlocking(() -> {
            mModel.get(TABS).set(new KeyboardAccessoryData.Tab[] {
                    createTestTab("FirstTab"), createTestTab("SecondTab")});
        });

        CriteriaHelper.pollUiThread(() -> mView.getTabCount() == 2);
        assertThat(getTabDescriptionAt(0), is("FirstTab"));
        assertThat(getTabDescriptionAt(1), is("SecondTab"));

        runOnUiThreadBlocking(() -> mModel.get(TABS).add(createTestTab("ThirdTab")));

        CriteriaHelper.pollUiThread(() -> mView.getTabCount() == 3);
        assertThat(getTabDescriptionAt(0), is("FirstTab"));
        assertThat(getTabDescriptionAt(1), is("SecondTab"));
        assertThat(getTabDescriptionAt(2), is("ThirdTab"));
    }
}


text:
#include "ShareLogParserBytom.h"

///////////////  template instantiation ///////////////
// Without this, some linking errors will issued.
// If you add a new derived class of Share, add it at the following.
template class ShareLogDumperT<ShareBytom>;
template class ShareLogParserT<ShareBytom>;
template class ShareLogParserServerT<ShareBytom>;


text:
package com.intellij.codeInsight;

import com.intellij.ide.highlighter.XmlFileType;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.editor.Document;
import com.intellij.psi.*;
import com.intellij.psi.impl.DebugUtil;
import com.intellij.psi.impl.source.xml.XmlFileImpl;
import com.intellij.psi.xml.XmlFile;
import com.intellij.testFramework.ParsingTestCase;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.PsiTestUtil;
import com.intellij.util.IncorrectOperationException;

import java.io.File;

public class XmlReparseTest extends AbstractReparseTestCase {
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    setFileType(XmlFileType.INSTANCE);
  }

  public void test1() {
    String s1 = "";
    String s2 = "";

    prepareFile(s1, s2);
    final String beforeReparse = DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true);
    insert("");
    assertEquals("Tree changed after empty reparse", beforeReparse, DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true));
  }

  public void testTagData1() {
    String s1 = "";
    String s2 = "";

    prepareFile(s1, s2);
    insert("x");
    insert(" ");
    insert("xxxxx");
    insert("\n");
    insert("xxxxx");
  }

  public void testTagData2() {
    String s1 = "\nSomeDataHere";
    String s2 = "\n";

    prepareFile(s1, s2);

    PsiElement element1 = ((XmlFile)myDummyFile).getDocument().getRootTag();

    insert("x");
    insert(" ");
    insert("xxxxx");
    insert("\n");
    insert("xxxxx");

    assertSame(element1, ((XmlFile)myDummyFile).getDocument().getRootTag());
  }

  public void testTagInTag1() {
    String s1 = "";
    String s2 = "";

    prepareFile(s1, s2);

    insert("<");
    insert("c");
    insert("/");
    insert(">");
  }

  public void testTagInTag2() {
    String s1 = "";
    String s2 = "";

    prepareFile(s1, s2);

    insert("<");
    insert("c");
    insert(">");
    insert("\nxxx \nxxxx\n");
    insert("<");
    insert("/");
    insert("c");
    insert(">");
  }

  public void testTagInTag3() {
    String s1 = "";
    String s2 = "";

    prepareFile(s1, s2);

    insert("<");
    insert("/");
    insert("b");
    insert(">");
  }

  public void testSCR5925() {
    String s1 = "<one>     <two ";
    String s2 = ",b\"/></one>";

    prepareFile(s1, s2);
    insert("a");
    insert("t");
    insert("t");
    insert("r");
    insert("=");
    insert("\"");
  }

  public void testXmlReparseProblem() throws IncorrectOperationException {
    prepareFile("
\n" +
                "
\n" +
                "\n" +
                "<table width"," 	\n" +
               "
\n" +
               "
");
    insert("=");
  }
  private static final String marker = "<marker>";
  public void testXmlDeclDtd() throws Exception {
    PsiFile file = myFixture.addFileToProject("x.xml", "<!DOCTYPE name [\n" +
                                       "  <!ELEMENT name (" + marker+ "a b c d" + marker+ ")>\n" +
                                       "  <!ELEMENT name2 (" + marker+ "%entity;" + marker+ ")>\n" +
                                       "]>\n" +
                                       "<name></name>");

    PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getProject());
    Document document = documentManager.getDocument(file);

    removeGarbage(document);

    documentManager.commitAllDocuments();
    String myFullDataPath = getTestDataPath() + "psi/xml";
    ParsingTestCase.doCheckResult(myFullDataPath, file, true, "testXmlDeclDtd", false, false);
  }

  private void removeGarbage(Document document) {
    int i = document.getText().indexOf(marker);
    if (i==-1) return;
    WriteCommandAction.runWriteCommandAction(getProject(), () -> document.replaceString(i, i + marker.length(), ""));

    removeGarbage(document);
  }

  @Override
  protected String getTestDataPath() {
    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
  }

  public void testXml() {
    setFileType(XmlFileType.INSTANCE);
    String text2 = "</root>";
    final String text1 = "<root>/n";
    prepareFile(text1, text2);
    insert("<");
    PsiElement element = myDummyFile.findElementAt(10);
    assert element != null;
    assertNotNull(element.getTextRange());
  }

  public void testNoExceptionsDummyIdentifierMovementWithSpace() {
    setFileType(XmlFileType.INSTANCE);
    String text1 = "<rf oot><xc></root>";
    String text2 = "<root><f xc></root>"; // moved "f " to another place
    prepareFile(text1, "");
    Document document = myDummyFile.getViewProvider().getDocument();
    WriteCommandAction.runWriteCommandAction(getProject(), () -> {
      ((XmlFile)myDummyFile).getRootTag().replace(XmlElementFactory.getInstance(getProject()).createTagFromText(text2));
    });
    PsiTestUtil.checkFileStructure(myDummyFile);
    assertEquals(text2, myDummyFile.getText());
    assertEquals(text2, document.getText());
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/act_prof_root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/act_prof_toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="3dp"
        android:orientation="vertical"
        android:background="?attr/colorPrimary"
        android:elevation="0dp">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/act_prof_toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:theme="?attr/toolbarTheme"
            app:popupTheme="?attr/toolbarPopupMenu" />

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/act_prof_subToolbar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/activator_toolbar_height"
            android:layout_marginTop="0dp">

            <RelativeLayout
                android:id="@+id/act_prof_toolbar_reLa1"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

                <androidx.cardview.widget.CardView
                    android:layout_width="@dimen/run_stop_indicator_width"
                    android:layout_height="@dimen/run_stop_indicator_height"
                    android:layout_marginEnd="@dimen/run_stop_indicator_margin_end_activator"
                    android:layout_marginTop="@dimen/run_stop_indicator_margin_top"
                    android:layout_alignParentEnd="true"
                    android:layout_centerVertical="true"
                    app:cardElevation="0dp"
                    app:cardCornerRadius="15dp"
                    app:cardBackgroundColor="@android:color/transparent">

                    <ImageView
                        android:id="@+id/act_prof_run_stop_indicator"
                        android:layout_width="@dimen/run_stop_indicator_width"
                        android:layout_height="match_parent"
                        android:padding="6dp"
                        android:adjustViewBounds="true"
                        android:contentDescription="@string/run_stop_events_indicator"
                        android:scaleType="fitCenter"
                        android:src="@drawable/ic_traffic_light_stopped"
                        android:background="?attr/selectableItemBackground" />

                </androidx.cardview.widget.CardView>

            </RelativeLayout>

        </androidx.appcompat.widget.Toolbar>

    </LinearLayout>

    <FrameLayout
        android:id="@+id/act_prof_list_frLa1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:foreground="?android:windowContentOverlay">

        <androidx.fragment.app.FragmentContainerView
            android:id="@+id/activate_profile_list"
            android:name="sk.henrichg.phoneprofilesplus.ActivatorListFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".ActivatorActivity" />

    </FrameLayout>

</LinearLayout>


text:
title: 'Weather Forecast summer break from 1st of June to 31st of August 2019'
image:
published: true
categories: en News
ref: 2019-05-31-weather-forecast-summer
lang: en
traffictypes:
  - Road
tags:
  - APIs
---

Weather forecasts will be on a summer break from 1st of June to 31st of August 2019 and the data will stay on it's last state.

We apologize for any inconvenience caused by the break and the late announcement.


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

    <integer name="latest_wallpapers_column_count">1</integer>
    <integer name="wallpapers_column_count">2</integer>
    <integer name="categories_column_count">1</integer>

    <integer name="wallpaper_details_column_count">2</integer>

    <integer name="about_column_count">1</integer>

</resources>


text:
<?php

namespace Ecommerce\EcommerceBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use  Ecommerce\EcommerceBundle\Entity\Categorie;

class CategorieData extends AbstractFixture implements OrderedFixtureInterface
{
    public function load(ObjectManager $manager)
    {

        $Categorie2= new Categorie();
        $Categorie2-> setNom('Automobile');
        $Categorie2->setImageId(($this->getReference('media5'))->getId());
        $manager->persist($Categorie2);

        $Categorie3= new Categorie();
        $Categorie3-> setNom('Jeux video et console');
        $Categorie3->setImageId(($this->getReference('media3'))->getId());
        $manager->persist($Categorie3);

        $Categorie4= new Categorie();
        $Categorie4-> setNom('Higt-Tech');
        $Categorie4->setImageId(($this->getReference('media12'))->getId());
        $manager->persist($Categorie4);

        $Categorie6= new Categorie();
        $Categorie6-> setNom('Mobile et telephone');
        $Categorie6->setImageId(($this->getReference('media12'))->getId());
        $manager->persist($Categorie6);

        $Categorie7= new Categorie();
        $Categorie7-> setNom('Vetements');
        $Categorie7->setImageId(($this->getReference('media12'))->getId());
        $manager->persist($Categorie7);

        $Categorie5= new Categorie();
        $Categorie5-> setNom('Sports');
        $Categorie5->setImageId(($this->getReference('media12'))->getId());
        $manager->persist($Categorie5);

        $manager->flush();

        $this->addReference('categorie2', $Categorie2);
        $this->addReference('categorie3', $Categorie3);
        $this->addReference('categorie4', $Categorie4);
        $this->addReference('categorie5', $Categorie5);
        $this->addReference('categorie6', $Categorie6);
        $this->addReference('categorie7', $Categorie7);

    }

     public function getOrder()
    {
        // the order in which fixtures will be loaded
        // the lower the number, the sooner that this fixture is loaded
        return 2;
    }
}


text:
/**
 * This class is generated by jOOQ
 */
package org.openforis.collect.persistence.jooq.tables.records;

import org.jooq.Field;
import org.jooq.Record3;
import org.jooq.Row3;
import org.jooq.impl.TableRecordImpl;
import org.openforis.collect.persistence.jooq.tables.OfcDataCleansingChainSteps;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class OfcDataCleansingChainStepsRecord extends TableRecordImpl<OfcDataCleansingChainStepsRecord> implements Record3<Integer, Integer, Integer> {

	private static final long serialVersionUID = -16386751;

	/**
	 * Setter for collect.ofc_data_cleansing_chain_steps.chain_id.
	 */
	public void setChainId(Integer value) {
		setValue(0, value);
	}

	/**
	 * Getter for collect.ofc_data_cleansing_chain_steps.chain_id.
	 */
	public Integer getChainId() {
		return (Integer) getValue(0);
	}

	/**
	 * Setter for collect.ofc_data_cleansing_chain_steps.step_id.
	 */
	public void setStepId(Integer value) {
		setValue(1, value);
	}

	/**
	 * Getter for collect.ofc_data_cleansing_chain_steps.step_id.
	 */
	public Integer getStepId() {
		return (Integer) getValue(1);
	}

	/**
	 * Setter for collect.ofc_data_cleansing_chain_steps.pos.
	 */
	public void setPos(Integer value) {
		setValue(2, value);
	}

	/**
	 * Getter for collect.ofc_data_cleansing_chain_steps.pos.
	 */
	public Integer getPos() {
		return (Integer) getValue(2);
	}

	// -------------------------------------------------------------------------
	// Record3 type implementation
	// -------------------------------------------------------------------------

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Row3<Integer, Integer, Integer> fieldsRow() {
		return (Row3) super.fieldsRow();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Row3<Integer, Integer, Integer> valuesRow() {
		return (Row3) super.valuesRow();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Field<Integer> field1() {
		return OfcDataCleansingChainSteps.OFC_DATA_CLEANSING_CHAIN_STEPS.CHAIN_ID;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Field<Integer> field2() {
		return OfcDataCleansingChainSteps.OFC_DATA_CLEANSING_CHAIN_STEPS.STEP_ID;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Field<Integer> field3() {
		return OfcDataCleansingChainSteps.OFC_DATA_CLEANSING_CHAIN_STEPS.POS;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Integer value1() {
		return getChainId();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Integer value2() {
		return getStepId();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Integer value3() {
		return getPos();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public OfcDataCleansingChainStepsRecord value1(Integer value) {
		setChainId(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public OfcDataCleansingChainStepsRecord value2(Integer value) {
		setStepId(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public OfcDataCleansingChainStepsRecord value3(Integer value) {
		setPos(value);
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public OfcDataCleansingChainStepsRecord values(Integer value1, Integer value2, Integer value3) {
		value1(value1);
		value2(value2);
		value3(value3);
		return this;
	}

	// -------------------------------------------------------------------------
	// Constructors
	// -------------------------------------------------------------------------

	/**
	 * Create a detached OfcDataCleansingChainStepsRecord
	 */
	public OfcDataCleansingChainStepsRecord() {
		super(OfcDataCleansingChainSteps.OFC_DATA_CLEANSING_CHAIN_STEPS);
	}

	/**
	 * Create a detached, initialised OfcDataCleansingChainStepsRecord
	 */
	public OfcDataCleansingChainStepsRecord(Integer chainId, Integer stepId, Integer pos) {
		super(OfcDataCleansingChainSteps.OFC_DATA_CLEANSING_CHAIN_STEPS);

		setValue(0, chainId);
		setValue(1, stepId);
		setValue(2, pos);
	}
}


text:
<?php

namespace Symfony\Bundle\SecurityBundle\Debug;

use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\VarDumper\Caster\ClassStub;

/**
 * Wraps a security listener for calls record.
 *
 * @author Robin Chalas <robin.chalas@gmail.com>
 *
 * @internal
 */
final class WrappedListener
{
    use TraceableListenerTrait;

    public function __construct(callable $listener)
    {
        $this->listener = $listener;
    }

    public function __invoke(RequestEvent $event)
    {
        $startTime = microtime(true);
        ($this->listener)($event);
        $this->time = microtime(true) - $startTime;
        $this->response = $event->getResponse();
    }
}


text:
import React from 'react'
import renderer from 'react-test-renderer'
import { AlertBox } from './'
import { CrossIconNext } from 'kitten'

describe('<AlertBox />', () => {
  it('should matches with default snapshot', () => {
    const component = renderer.create(<AlertBox>Alert !</AlertBox>).toJSON()
    expect(component).toMatchSnapshot()
  })
  it('should matches with custom fit snapshot', () => {
    const component = renderer
      .create(<AlertBox fit="content">Alert !</AlertBox>)
      .toJSON()
    expect(component).toMatchSnapshot()
  })
  it('should matches with custom iconPosition snapshot', () => {
    const component = renderer
      .create(<AlertBox iconPosition="center">Alert !</AlertBox>)
      .toJSON()
    expect(component).toMatchSnapshot()
  })
  it('should matches with custom status snapshot', () => {
    const component = renderer
      .create(<AlertBox status="danger">Alert !</AlertBox>)
      .toJSON()
    expect(component).toMatchSnapshot()
  })
  it('should matches with no icon snapshot', () => {
    const component = renderer
      .create(<AlertBox displayIcon={false}>Alert !</AlertBox>)
      .toJSON()
    expect(component).toMatchSnapshot()
  })
  it('should matches with custom icon snapshot', () => {
    const component = renderer
      .create(<AlertBox icon={<CrossIconNext />}>Alert !</AlertBox>)
      .toJSON()
    expect(component).toMatchSnapshot()
  })
})


text:
package org.finra.datagenerator

import java.util
import java.util.concurrent.atomic.AtomicBoolean

import org.finra.datagenerator.consumer.DataConsumer
import org.finra.datagenerator.distributor.multithreaded.SingleThreadedProcessing
import org.finra.datagenerator.engine.Frontier

/**
 * Frontier implementation for generating data with model
 *
 * Created by Brijesh on 5/28/2015.
 */
class RandomNumberFrontier extends Frontier with java.io.Serializable {

  /**
   * Iterate for loop from 1 to Number in each frontier
   * Generate random number string and add them to Map
   * Add Map to Queue
   *
   * @param randomNumberQueue Random Number Queue
   * @param flag Atomic boolean flag
   */
  override def searchForScenarios(randomNumberQueue:util.Queue[util.Map[String, String]], flag: AtomicBoolean) : Unit = {

    this.synchronized {

      for (i <- 1 to RandomNumberEngine.numberInEachFrontier) {

        //Generate Random Number and add it to Map
        val randomNumber = scala.util.Random
        val value = randomNumber.nextInt(100000).toString

        val key = "Key for Random Number"

        val randomNumberMap = new util.HashMap[String, String]()

        randomNumberMap.put(key, value)

        //Add randomNumberMap to randomNumberQueue
        randomNumberQueue.add(randomNumberMap)

      }
    }
  }

  override def searchForScenarios(singleThreadedProcessing: SingleThreadedProcessing, flag: AtomicBoolean) {
    //dfs(null, consumer, flag, flag)
  }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.compute.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.compute.models.SubResourceReadOnly;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Describes a Virtual Machine Scale Set Extension. */
@JsonFlatten
@Fluent
public class VirtualMachineScaleSetExtensionInner extends SubResourceReadOnly {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionInner.class);

    /*
     * The name of the extension.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Resource type
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /*
     * If a value is provided and is different from the previous value, the
     * extension handler will be forced to update even if the extension
     * configuration has not changed.
     */
    @JsonProperty(value = "properties.forceUpdateTag")
    private String forceUpdateTag;

    /*
     * The name of the extension handler publisher.
     */
    @JsonProperty(value = "properties.publisher")
    private String publisher;

    /*
     * Specifies the type of the extension; an example is
     * "CustomScriptExtension".
     */
    @JsonProperty(value = "properties.type")
    private String typePropertiesType;

    /*
     * Specifies the version of the script handler.
     */
    @JsonProperty(value = "properties.typeHandlerVersion")
    private String typeHandlerVersion;

    /*
     * Indicates whether the extension should use a newer minor version if one
     * is available at deployment time. Once deployed, however, the extension
     * will not upgrade minor versions unless redeployed, even with this
     * property set to true.
     */
    @JsonProperty(value = "properties.autoUpgradeMinorVersion")
    private Boolean autoUpgradeMinorVersion;

    /*
     * Json formatted public settings for the extension.
     */
    @JsonProperty(value = "properties.settings")
    private Object settings;

    /*
     * The extension can contain either protectedSettings or
     * protectedSettingsFromKeyVault or no protected settings at all.
     */
    @JsonProperty(value = "properties.protectedSettings")
    private Object protectedSettings;

    /*
     * The provisioning state, which only appears in the response.
     */
    @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * Collection of extension names after which this extension needs to be
     * provisioned.
     */
    @JsonProperty(value = "properties.provisionAfterExtensions")
    private List<String> provisionAfterExtensions;

    /**
     * Get the name property: The name of the extension.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: The name of the extension.
     *
     * @param name the name value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the type property: Resource type.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension
     * handler will be forced to update even if the extension configuration has not changed.
     *
     * @return the forceUpdateTag value.
     */
    public String forceUpdateTag() {
        return this.forceUpdateTag;
    }

    /**
     * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension
     * handler will be forced to update even if the extension configuration has not changed.
     *
     * @param forceUpdateTag the forceUpdateTag value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withForceUpdateTag(String forceUpdateTag) {
        this.forceUpdateTag = forceUpdateTag;
        return this;
    }

    /**
     * Get the publisher property: The name of the extension handler publisher.
     *
     * @return the publisher value.
     */
    public String publisher() {
        return this.publisher;
    }

    /**
     * Set the publisher property: The name of the extension handler publisher.
     *
     * @param publisher the publisher value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withPublisher(String publisher) {
        this.publisher = publisher;
        return this;
    }

    /**
     * Get the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension".
     *
     * @return the typePropertiesType value.
     */
    public String typePropertiesType() {
        return this.typePropertiesType;
    }

    /**
     * Set the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension".
     *
     * @param typePropertiesType the typePropertiesType value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withTypePropertiesType(String typePropertiesType) {
        this.typePropertiesType = typePropertiesType;
        return this;
    }

    /**
     * Get the typeHandlerVersion property: Specifies the version of the script handler.
     *
     * @return the typeHandlerVersion value.
     */
    public String typeHandlerVersion() {
        return this.typeHandlerVersion;
    }

    /**
     * Set the typeHandlerVersion property: Specifies the version of the script handler.
     *
     * @param typeHandlerVersion the typeHandlerVersion value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withTypeHandlerVersion(String typeHandlerVersion) {
        this.typeHandlerVersion = typeHandlerVersion;
        return this;
    }

    /**
     * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one
     * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless
     * redeployed, even with this property set to true.
     *
     * @return the autoUpgradeMinorVersion value.
     */
    public Boolean autoUpgradeMinorVersion() {
        return this.autoUpgradeMinorVersion;
    }

    /**
     * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one
     * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless
     * redeployed, even with this property set to true.
     *
     * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) {
        this.autoUpgradeMinorVersion = autoUpgradeMinorVersion;
        return this;
    }

    /**
     * Get the settings property: Json formatted public settings for the extension.
     *
     * @return the settings value.
     */
    public Object settings() {
        return this.settings;
    }

    /**
     * Set the settings property: Json formatted public settings for the extension.
     *
     * @param settings the settings value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withSettings(Object settings) {
        this.settings = settings;
        return this;
    }

    /**
     * Get the protectedSettings property: The extension can contain either protectedSettings or
     * protectedSettingsFromKeyVault or no protected settings at all.
     *
     * @return the protectedSettings value.
     */
    public Object protectedSettings() {
        return this.protectedSettings;
    }

    /**
     * Set the protectedSettings property: The extension can contain either protectedSettings or
     * protectedSettingsFromKeyVault or no protected settings at all.
     *
     * @param protectedSettings the protectedSettings value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withProtectedSettings(Object protectedSettings) {
        this.protectedSettings = protectedSettings;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state, which only appears in the response.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be
     * provisioned.
     *
     * @return the provisionAfterExtensions value.
     */
    public List<String> provisionAfterExtensions() {
        return this.provisionAfterExtensions;
    }

    /**
     * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be
     * provisioned.
     *
     * @param provisionAfterExtensions the provisionAfterExtensions value to set.
     * @return the VirtualMachineScaleSetExtensionInner object itself.
     */
    public VirtualMachineScaleSetExtensionInner withProvisionAfterExtensions(List<String> provisionAfterExtensions) {
        this.provisionAfterExtensions = provisionAfterExtensions;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}


text:
package database.jdbc;

import javax.sql.RowSet;
import javax.sql.rowset.RowSetFactory;
import javax.sql.rowset.RowSetProvider;

/** Demonstrate simple use of the CachedRowSet.
 */
// BEGIN main
public class CachedRowSetDemo {
    public static void main(String[] args) throws Exception {
        RowSet rs;

        RowSetFactory rsFactory = RowSetProvider.newFactory();
        rs = rsFactory.createCachedRowSet();

        rs.setUrl("jdbc:postgresql:tmclub");
        rs.setUsername("ian");
        rs.setPassword("secret");

        rs.setCommand("select * from members where name like ?");
        rs.setString(1, "I%");

        // This will cause the RowSet to connect, fetch its data, and
        // disconnect
        rs.execute();

        // Some time later, the client tries to do something.

        // Suppose we want to update data:
        while (rs.next()) {
            if (rs.getInt("id") == 42) {
                rs.setString(1, "Marvin");
                rs.updateRow();    // Normal JDBC

                // This additional call tells the CachedRowSet to connect
                // to its database and send the updated data back.
                rs.updateRow();
            }
        }

        // If we're all done...
        rs.close();
    }
}
// END main


text:
"""
sentry.plugins.bases.notify
~~~~~~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function

import logging
import six

from django import forms

from sentry.app import (
    digests,
    ratelimiter,
)
from sentry.digests import get_option_key as get_digest_option_key
from sentry.digests.notifications import (
    event_to_record,
    unsplit_key,
)
from sentry.plugins import Notification, Plugin
from sentry.models import (
    ProjectOption,
    UserOption,
)
from sentry.tasks.digests import deliver_digest

class NotificationConfigurationForm(forms.Form):
    pass

class BaseNotificationUserOptionsForm(forms.Form):
    def __init__(self, plugin, user, *args, **kwargs):
        self.plugin = plugin
        self.user = user
        super(BaseNotificationUserOptionsForm, self).__init__(*args, **kwargs)

    def get_title(self):
        return self.plugin.get_conf_title()

    def get_description(self):
        return ""

    def save(self):
        raise NotImplementedError

class NotificationPlugin(Plugin):
    description = ('Notify project members when a new event is seen for the first time, or when an '
                   'already resolved event has changed back to unresolved.')
    # site_conf_form = NotificationConfigurationForm
    project_conf_form = NotificationConfigurationForm

    def get_plugin_type(self):
        return 'notification'

    def notify(self, notification):
        event = notification.event
        return self.notify_users(event.group, event)

    def rule_notify(self, event, futures):
        rules = []
        extra = {
            'event_id': event.id,
            'group_id': event.group_id,
            'plugin': self.slug,
        }
        log_event = 'dispatched'
        for future in futures:
            rules.append(future.rule)
            extra['rule_id'] = future.rule.id
            if not future.kwargs:
                continue
            raise NotImplementedError('The default behavior for notification de-duplication does not support args')

        project = event.group.project
        extra['project_id'] = project.id
        if hasattr(self, 'notify_digest') and digests.enabled(project):
            get_digest_option = lambda key: ProjectOption.objects.get_value(
                project,
                get_digest_option_key(self.get_conf_key(), key),
            )
            digest_key = unsplit_key(self, event.group.project)
            extra['digest_key'] = digest_key
            immediate_delivery = digests.add(
                digest_key,
                event_to_record(event, rules),
                increment_delay=get_digest_option('increment_delay'),
                maximum_delay=get_digest_option('maximum_delay'),
            )
            if immediate_delivery:
                deliver_digest.delay(digest_key)
            else:
                log_event = 'digested'

        else:
            notification = Notification(
                event=event,
                rules=rules,
            )
            self.notify(notification)

        self.logger.info('notification.%s' % log_event, extra=extra)

    def notify_users(self, group, event, fail_silently=False):
        raise NotImplementedError

    def notify_about_activity(self, activity):
        pass

    def get_sendable_users(self, project):
        """
        Return a collection of user IDs that are eligible to receive
        notifications for the provided project.
        """
        conf_key = self.get_conf_key()

        alert_settings = dict(
            (o.user_id, int(o.value))
            for o in UserOption.objects.filter(
                project=project,
                key='%s:alert' % conf_key,
            )
        )

        disabled = set(u for u, v in six.iteritems(alert_settings) if v == 0)

        member_set = set(project.member_set.exclude(
            user__in=disabled,
        ).values_list('user', flat=True))

        # determine members default settings
        members_to_check = set(u for u in member_set if u not in alert_settings)
        if members_to_check:
            disabled = set(UserOption.objects.filter(
                key='subscribe_by_default',
                value='0',
                user__in=members_to_check,
            ).values_list('user', flat=True))
            member_set = [x for x in member_set if x not in disabled]

        return member_set

    def __is_rate_limited(self, group, event):
        return ratelimiter.is_limited(
            project=group.project,
            key=self.get_conf_key(),
            limit=10,
        )

    def is_configured(self, project):
        raise NotImplementedError

    def should_notify(self, group, event):
        project = event.project
        if not self.is_configured(project=project):
            return False

        if group.is_ignored():
            return False

        # If the plugin doesn't support digests or they are not enabled,
        # perform rate limit checks to support backwards compatibility with
        # older plugins.
        if not (hasattr(self, 'notify_digest') and digests.enabled(project)) and self.__is_rate_limited(group, event):
            logger = logging.getLogger('sentry.plugins.{0}'.format(self.get_conf_key()))
            logger.info('notification.rate_limited', extra={'project_id': project.id})
            return False

        return True

    def test_configuration(self, project):
        from sentry.utils.samples import create_sample_event
        event = create_sample_event(project, platform='python')
        notification = Notification(event=event)
        return self.notify(notification)

    def get_notification_doc_html(self, **kwargs):
        return ""

# Backwards-compatibility
NotifyConfigurationForm = NotificationConfigurationForm
NotifyPlugin = NotificationPlugin


text:
<!DOCTYPE html>

    <link href="../../css/bootstrap.css" rel="stylesheet"/>
    <title>Bootstrap Grid System</title>

Bootstrap Grid System

        Use grid classes to layout page into rows and columns.
        Use row class to layout the page vertically.
        Use column family of classes to layout the page horizontally.

Twelve

          There are 12 column classes that set a div's
          width to 12 different sizes. Column class names are
          cs-xx-1, cs-xx-2, etc, cs-xx-12.
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Six

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Six

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Four

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Four

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Four

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Three

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Three

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Three

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Three

          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Kiwi.Renderers.GLElementArrayBuffer - Kiwi.js</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

            API Docs for: 1.4.0

APIs

Classes

Modules

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

Kiwi.Animations.Animation

Kiwi.Animations.Sequence

Kiwi.Animations.Tween

Kiwi.Animations.Tweens.Easing.Back

Kiwi.Animations.Tweens.Easing.Bounce

Kiwi.Animations.Tweens.Easing.Circular

Kiwi.Animations.Tweens.Easing.Cubic

Kiwi.Animations.Tweens.Easing.Elastic

Kiwi.Animations.Tweens.Easing.Exponential

Kiwi.Animations.Tweens.Easing.Linear

Kiwi.Animations.Tweens.Easing.Quadratic

Kiwi.Animations.Tweens.Easing.Quartic

Kiwi.Animations.Tweens.Easing.Quintic

Kiwi.Animations.Tweens.Easing.Sinusoidal

Kiwi.Animations.Tweens.TweenManager

Kiwi.Camera

Kiwi.CameraManager

Kiwi.Component

Kiwi.ComponentManager

Kiwi.Components.AnimationManager

Kiwi.Components.ArcadePhysics

Kiwi.Components.Box

Kiwi.Components.Input

Kiwi.Components.Sound

Kiwi.Entity

Kiwi.Files.AudioFile

Kiwi.Files.DataFile

Kiwi.Files.DataLibrary

Kiwi.Files.File

Kiwi.Files.FileStore

Kiwi.Files.Loader

Kiwi.Files.TextureFile

Kiwi.Game

Kiwi.GameManager

Kiwi.GameObjects.Sprite

Kiwi.GameObjects.StaticImage

Kiwi.GameObjects.TextField

Kiwi.GameObjects.Tilemap.TileMap

Kiwi.GameObjects.Tilemap.TileMapLayer

Kiwi.GameObjects.Tilemap.TileMapLayerIsometric

Kiwi.GameObjects.Tilemap.TileMapLayerOrthogonal

Kiwi.GameObjects.Tilemap.TileType

Kiwi.Geom.AABB

Kiwi.Geom.Circle

Kiwi.Geom.Intersect

Kiwi.Geom.IntersectResult

Kiwi.Geom.Line

Kiwi.Geom.Matrix

Kiwi.Geom.Point

Kiwi.Geom.Ray

Kiwi.Geom.Rectangle

Kiwi.Geom.Transform

Kiwi.Geom.Vector2

Kiwi.Group

Kiwi.HUD.HUDComponents.Counter

Kiwi.HUD.HUDComponents.Time

Kiwi.HUD.HUDComponents.WidgetInput

Kiwi.HUD.HUDDisplay

Kiwi.HUD.HUDManager

Kiwi.HUD.HUDWidget

Kiwi.HUD.Widget.Bar

Kiwi.HUD.Widget.BasicScore

Kiwi.HUD.Widget.Button

Kiwi.HUD.Widget.Icon

Kiwi.HUD.Widget.IconBar

Kiwi.HUD.Widget.Menu

Kiwi.HUD.Widget.MenuItem

Kiwi.HUD.Widget.TextField

Kiwi.HUD.Widget.Time

Kiwi.IChild

Kiwi.Input.Finger

Kiwi.Input.InputManager

Kiwi.Input.Key

Kiwi.Input.Keyboard

Kiwi.Input.Keycodes

Kiwi.Input.Mouse

Kiwi.Input.MouseCursor

Kiwi.Input.Pointer

Kiwi.Input.Touch

Kiwi.PluginManager

Kiwi.Renderers.CanvasRenderer

Kiwi.Renderers.GLArrayBuffer

Kiwi.Renderers.GLBlendMode

Kiwi.Renderers.GLElementArrayBuffer

Kiwi.Renderers.GLRenderManager

Kiwi.Renderers.GLTextureManager

Kiwi.Renderers.GLTextureWrapper

Kiwi.Renderers.Renderer

Kiwi.Renderers.TextureAtlasRenderer

Kiwi.Shaders.ShaderManager

Kiwi.Shaders.ShaderPair

Kiwi.Shaders.TextureAtlasShader

Kiwi.Signal

Kiwi.SignalBinding

Kiwi.Sound.Audio

Kiwi.Sound.AudioLibrary

Kiwi.Sound.AudioManager

Kiwi.Stage

Kiwi.State

Kiwi.StateConfig

Kiwi.StateManager

Kiwi.System.Bootstrap

Kiwi.System.Device

Kiwi.Textures.SingleImage

Kiwi.Textures.SpriteSheet

Kiwi.Textures.TextureAtlas

Kiwi.Textures.TextureLibrary

Kiwi.Time.Clock

Kiwi.Time.ClockManager

Kiwi.Time.MasterClock

Kiwi.Time.Timer

Kiwi.Time.TimerEvent

Kiwi.Utils.Canvas

Kiwi.Utils.Color

Kiwi.Utils.Common

Kiwi.Utils.GameMath

Kiwi.Utils.Log

Kiwi.Utils.RandomDataGenerator

Kiwi.Utils.RequestAnimationFrame

Kiwi.Utils.Version

Animations

Components

Easing

Files

GameObjects

Geom

HUD

HUDComponents

Input

Kiwi

Renderers

Shaders

Sound

System

Textures

Tilemap

Time

Tweens

Utils

Utils.

Widget

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

            <input type="checkbox" id="api-show-deprecated">
            Deprecated

Kiwi.Renderers.GLElementArrayBuffer Class

            Defined in: src\render\GLElementArrayBuffer.ts:10

            Module: Renderers

            Parent Module: Kiwi

Encapsulates a WebGL Element Array Buffer

Constructor

Kiwi.Renderers.GLElementArrayBuffer

            (

                        gl

                        [_itemSize]

                        [_indices]

                        [init=true]

)

            GLElementArrayBuffer

                Defined in

        src\render\GLElementArrayBuffer.ts:10

Parameters:

                        gl
                        WebGLRenderingContent

                        [_itemSize]
                        Number
                        optional

                        [_indices]
                        Number
                        optional

                        [init=true]
                        Boolean
                        optional

Returns:

                        GLElementArrayBuffer:

Index

Methods

Properties

Item Index

Methods

                                clear

                                init

                                refresh

Properties

                                buffer

                                indices

                                itemSize

                                numItems

                                square

                                    static

Methods

clear

        ()

        public

                Defined in

        src\render\GLElementArrayBuffer.ts:65

Clears the indices array.

init

            (

                        gl

)

            WebGLBuffer

        public

                Defined in

        src\render\GLElementArrayBuffer.ts:74

Initialises the Element Array Buffer

Parameters:

                        gl
                        WebGLRenderingContext

Returns:

                        WebGLBuffer:

refresh

            (

                        gl

                        indices

)

            WebGLBuffer

        public

                Defined in

        src\render\GLElementArrayBuffer.ts:89

Refreshes the Element Array Buffer

Parameters:

                        gl
                        WebGLRenderingContext

                        indices
                        Number

Returns:

                        WebGLBuffer:

Properties

buffer

    WebGLBuffer

        public

                Defined in

        src\render\GLElementArrayBuffer.ts:41

The Element Array Buffer object

indices

    Number

        public

                Defined in

        src\render\GLElementArrayBuffer.ts:33

An array of indices

itemSize

    Number

        public

                Defined in

        src\render\GLElementArrayBuffer.ts:49

The size of each buffer item

numItems

    Number

        public

                Defined in

        src\render\GLElementArrayBuffer.ts:57

The numbe of items in the buffer

square

    Number

        public

        static

                Defined in

        src\render\GLElementArrayBuffer.ts:105

The required indices for a single quad.

Default: [0,1,2,0,2,3]


text:
require "minitest/autorun"
require "minitest/reporters"
if ENV["CI"] == "true"
  Minitest::Reporters.use! Minitest::Reporters::DefaultReporter.new
else
  Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
end

require "active_attr"
require "strip_attributes"

class Tableless
  include ActiveAttr::BasicModel
  include ActiveAttr::TypecastedAttributes
  include ActiveAttr::Serialization

  include ActiveModel::Validations::Callbacks
end

# Avoid annoying deprecation warning
I18n.enforce_available_locales = true

# Remove this after we drop support for Rails 3.2 and Minitest 4.x
Minitest::Test = Minitest::Unit::TestCase unless defined?(Minitest::Test)


text:
package com.google.test.metric;

import java.util.ArrayList;
import java.util.List;

public class JavaType extends Type {

  public static final Type VOID = new Type("void", "V");
  public static final Type BYTE = new Type("byte", "B");
  public static final Type SHORT = new Type("short", "S");
  public static final Type INT = new Type("int", "I");
  public static final Type BOOLEAN = new Type("boolean", "Z");
  public static final Type CHAR = new Type("char", "C");
  public static final Type LONG = new Type("long", "J");
  public static final Type DOUBLE = new Type("double", "D");
  public static final Type FLOAT = new Type("float", "F");
  public static final Type OBJECT = fromClass(Object.class);

  private JavaType(String name, String code) {
    super(name, code);
  }

  public static boolean isDoubleSlot(Type type) {
    return type == DOUBLE || type == LONG;
  }

  public static Type fromClass(Class<?> clazz) {
    if (clazz == Byte.class) {
      return BYTE;
    } else if (clazz == Short.class) {
      return SHORT;
    } else if (clazz == Integer.class) {
      return INT;
    } else if (clazz == Boolean.class) {
      return BOOLEAN;
    } else if (clazz == Character.class) {
      return CHAR;
    } else if (clazz == Long.class) {
      return LONG;
    } else if (clazz == Double.class) {
      return DOUBLE;
    } else if (clazz == Float.class) {
      return FLOAT;
    } else if (clazz.isArray()) {
      return fromClass(clazz.getComponentType()).toArray();
    } else {
      return fromJava(clazz.getName());
    }
  }

  public static Type fromJava(String clazz) {
    if (clazz.contains(";")) {
      throw new IllegalArgumentException();
    }
    clazz = clazz.replace('/', '.');
    String jvm = "L" + clazz.replace('.', '/') + ";";
    return new Type(0, clazz, jvm);
  }

  public static Type fromDesc(String desc) {
    char ch = desc.charAt(0);
    switch (ch) {
    case 'V':
      return VOID;
    case 'B':
      return BYTE;
    case 'S':
      return SHORT;
    case 'Z':
      return BOOLEAN;
    case 'C':
      return CHAR;
    case 'I':
      return INT;
    case 'J':
      return LONG;
    case 'F':
      return FLOAT;
    case 'D':
      return DOUBLE;
    case '[':
      return fromDesc(desc.substring(1)).toArray();
    case 'L':
      String javaClass = desc.substring(1, desc.length() - 1);
      javaClass = javaClass.replace('/', '.').replace('$', '.');
      return new Type(0, javaClass, desc);
    default:
      throw new IllegalArgumentException(desc);
    }
  }

  public static Type fromDescReturn(String desc) {
    return fromDesc(desc.split("\\(.*\\)")[1]);
  }

  public static List<Type> fromDescParameters(String desc) {
    ArrayList<Type> list = new ArrayList<Type>();
    int start = 1;
    int end = 1;
    while (end < desc.length()) {
      char ch = desc.charAt(end);
      if (ch == ')') {
        if (start != end) {
          list.add(fromDesc(desc.substring(start, end)));
        }
        return list;
      } else if (ch == 'L') {
        while (desc.charAt(end) != ';') {
          end++;
          if (end == desc.length()) {
            throw new IllegalArgumentException("Did you forget closing ';'");
          }
        }
        end++;
        list.add(fromDesc(desc.substring(start, end)));
        start = end;
      } else if (ch == '[') {
        end++;
      } else {
        end++;
        list.add(fromDesc(desc.substring(start, end)));
        start = end;
      }
    }
    throw new IllegalArgumentException("Did you forget closing ')'");
  }
}


text:
<script>
try {
    // a parser for this grammar:
    // 'hot'* 'coffee'

    var parser = new PKSequence();
    parser.add(new PKRepetition(new PKLiteral("hot")));
    parser.add(new PKLiteral("coffee"));

    var s = "hot hot hot coffee";
    var a = new PKTokenAssembly(s);
    a = parser.completeMatch(a);
    print(a);
} catch (e) {
    print(e);
}

// prints:
// [hot, hot, hot, coffee]hot/hot/hot/coffee^

// the line above is the string representation of a TokenAssembly
// the first half of the string shows that the assembly's stack currently contains four literal tokens [hot, hot, hot, coffee]
// the second half shows what has been consumed from the string, and the current cursor position (at the end)

</script>


text:
 /*
 *  EGL support
 */

#define SAVE_CONFIG_ATTRIB(ENUM, NAME) \
    eglGetConfigAttrib(display, config, ENUM, &value); \
    trIntegerValue(event, NAME, value);

TRhandle @EGLConfig.serialize(TREvent* event, TRhandle handle)
{
    /* Query all the needed parameters of the config */
    EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    EGLint     value;
    EGLConfig  config  = (EGLConfig)handle;

    /*
     * Discarded values:
     *   NATIVE_VISUAL_ID, NATIVE_VISUAL_TYPE, EGL_MAX_PBUFFER_WIDTH,
     *   EGL_MAX_PBUFFER_HEIGHT, EGL_MAX_PBUFFER_PIXELS
     */
    SAVE_CONFIG_ATTRIB(EGL_CONFIG_ID,               "config_id");
    SAVE_CONFIG_ATTRIB(EGL_BUFFER_SIZE,             "buffer_size");
    SAVE_CONFIG_ATTRIB(EGL_RED_SIZE,                "red_size");
    SAVE_CONFIG_ATTRIB(EGL_GREEN_SIZE,              "green_size");
    SAVE_CONFIG_ATTRIB(EGL_BLUE_SIZE,               "blue_size");
    SAVE_CONFIG_ATTRIB(EGL_ALPHA_SIZE,              "alpha_size");
    SAVE_CONFIG_ATTRIB(EGL_BIND_TO_TEXTURE_RGB,     "bind_to_texture_rgb");
    SAVE_CONFIG_ATTRIB(EGL_BIND_TO_TEXTURE_RGBA,    "bind_to_texture_rgba");
    SAVE_CONFIG_ATTRIB(EGL_CONFIG_CAVEAT,           "config_caveat");
    SAVE_CONFIG_ATTRIB(EGL_DEPTH_SIZE,              "depth_size");
    SAVE_CONFIG_ATTRIB(EGL_LEVEL,                   "level");
    SAVE_CONFIG_ATTRIB(EGL_MAX_SWAP_INTERVAL,       "max_swap_interval");
    SAVE_CONFIG_ATTRIB(EGL_MIN_SWAP_INTERVAL,       "min_swap_interval");
    SAVE_CONFIG_ATTRIB(EGL_NATIVE_RENDERABLE,       "native_renderable");
    SAVE_CONFIG_ATTRIB(EGL_SAMPLE_BUFFERS,          "sample_buffers");
    SAVE_CONFIG_ATTRIB(EGL_SAMPLES,                 "samples");
    SAVE_CONFIG_ATTRIB(EGL_STENCIL_SIZE,            "stencil_size");
    SAVE_CONFIG_ATTRIB(EGL_SURFACE_TYPE,            "surface_type");
    SAVE_CONFIG_ATTRIB(EGL_TRANSPARENT_TYPE,        "transparent_type");
    SAVE_CONFIG_ATTRIB(EGL_TRANSPARENT_RED_VALUE,   "transparent_red");
    SAVE_CONFIG_ATTRIB(EGL_TRANSPARENT_GREEN_VALUE, "transparent_green");
    SAVE_CONFIG_ATTRIB(EGL_TRANSPARENT_BLUE_VALUE,  "transparent_blue");
    SAVE_CONFIG_ATTRIB(EGL_LUMINANCE_SIZE,          "luminance_size");
    SAVE_CONFIG_ATTRIB(EGL_ALPHA_MASK_SIZE,         "alpha_mask_size");
    SAVE_CONFIG_ATTRIB(EGL_RENDERABLE_TYPE,         "renderable_type");
}

/* EGL hooks */
void eglInitialize.major()
{
    trIntegerArrayValue(event, "major", 1, major);
}

void eglInitialize.minor()
{
    trIntegerArrayValue(event, "minor", 1, minor);
}

/**
 *  A macro for saving EGL_NONE terminated attribute lists
 */
#define SAVE_ATTRIB_LIST(attrib_list)                                 \
    int length = 0;                                                   \
    const EGLint* attr = attrib_list;                                 \
    while (attr && *attr != EGL_NONE)                                 \
    {                                                                 \
        attr   += 2;                                                  \
        length += 2;                                                  \
    }                                                                 \
    trIntegerArrayValue(event, #attrib_list, length ? length + 1 : 0, \
                        attrib_list);

void eglChooseConfig.attrib_list()
{
    SAVE_ATTRIB_LIST(attrib_list);
}

void eglChooseConfig.configs()
{
    trIntegerArrayValue(event, "configs", config_size, configs);
}

void eglChooseConfig.num_config()
{
    trIntegerArrayValue(event, "num_config", 1, num_config);
}

void eglCreateContext.attrib_list()
{
    SAVE_ATTRIB_LIST(attrib_list);
}

void eglCreatePbufferSurface.attrib_list()
{
    SAVE_ATTRIB_LIST(attrib_list);
}

void eglCreatePbufferSurface.attrib_list()
{
    SAVE_ATTRIB_LIST(attrib_list);
}

void eglCreatePixmapSurface.attrib_list()
{
    SAVE_ATTRIB_LIST(attrib_list);
}

void eglCreateWindowSurface.attrib_list()
{
    SAVE_ATTRIB_LIST(attrib_list);
}

/* No such function in the reference implementation */
/*
void eglCreatePbufferFromClientBuffer.attrib_list()
{
    SAVE_ATTRIB_LIST(attrib_list);
}
*/

void eglGetConfigAttrib.value()
{
    trIntegerArrayValue(event, "value", 1, value);
}

void eglGetConfigs.configs()
{
    trIntegerArrayValue(event, "configs", config_size, configs);
}

void eglGetConfigs.num_config()
{
    trIntegerArrayValue(event, "num_config", 1, num_config);
}

void eglQueryContext.value()
{
    trIntegerArrayValue(event, "value", 1, value);
}

void eglQuerySurface.value()
{
    trIntegerArrayValue(event, "value", 1, value);
}

void eglQueryString.@return()
{
    trByteArrayValue(event, 0, ret ? triStringLength(ret) + 1 : 0, (const TRubyte*)ret);
}