text:
package com.vinsol.expensetracker.expenselisting;

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

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;

import com.flurry.android.FlurryAgent;
import com.vinsol.expensetracker.BaseActivity;
import com.vinsol.expensetracker.Constants;
import com.special.ResideMenuDemo.R;
import com.vinsol.expensetracker.entry.CameraEntry;
import com.vinsol.expensetracker.entry.Text;
import com.vinsol.expensetracker.entry.Voice;
import com.vinsol.expensetracker.expenselisting.dialog.UnknownEntryDialog;
import com.vinsol.expensetracker.helpers.CheckEntryComplete;
import com.vinsol.expensetracker.helpers.ConvertCursorToListString;
import com.vinsol.expensetracker.helpers.DatabaseAdapter;
import com.vinsol.expensetracker.helpers.DateHelper;
import com.vinsol.expensetracker.helpers.DisplayDate;
import com.vinsol.expensetracker.helpers.StringProcessing;
import com.vinsol.expensetracker.models.Entry;
import com.vinsol.expensetracker.models.ListDatetimeAmount;
import com.vinsol.expensetracker.show.ShowCamera;
import com.vinsol.expensetracker.show.ShowText;
import com.vinsol.expensetracker.show.ShowVoice;
import com.vinsol.expensetracker.sync.SyncHelper;
import com.vinsol.expensetracker.utils.GetArrayListFromString;
import com.vinsol.expensetracker.utils.Log;
import com.vinsol.expensetracker.utils.Strings;

abstract class ListingAbstract extends BaseActivity implements OnItemClickListener {

	protected List<ListDatetimeAmount> mDataDateList;
	protected SeparatedListAdapter mSeparatedListAdapter;
	protected List<Entry> mSubList;
	protected ConvertCursorToListString mConvertCursorToListString;
	protected StringProcessing mStringProcessing;
	protected ListView mListView;
	protected String highlightID = null;
	protected UnknownEntryDialog unknownDialog;
	private static final int RESULT = 35;
	protected Bundle intentExtras;
	private DatabaseAdapter mDatabaseAdapter;
	protected int type;

	@Override
	protected void onStart() {
		super.onStart();
		FlurryAgent.onStartSession(this, getString(R.string.flurry_key));
	}

	@Override
	protected void onStop() {
		super.onStop();
		FlurryAgent.onEndSession(this);
	}

	@Override
	public boolean removeGenerateReport(Menu menu) {
		return false;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView();
		intentExtras = new Bundle();
		mConvertCursorToListString = new ConvertCursorToListString(this);
		mStringProcessing = new StringProcessing();
		mDatabaseAdapter = new DatabaseAdapter(this);
		Bundle intentExtras = getIntent().getExtras();
		if(intentExtras != null && intentExtras.containsKey(Constants.KEY_HIGHLIGHT)) {
			highlightID = intentExtras.getString(Constants.KEY_HIGHLIGHT);
		}
		type = getType(intentExtras);
	}

	protected int getType(Bundle intentExtras) {
		return 0;
	}

	protected Entry getListCurrentWeek(int j) {
		Entry templist = new Entry();
		templist.id = mSubList.get(j).id;
		templist.deleted = mSubList.get(j).deleted;
		templist.myHash = mSubList.get(j).myHash;
		templist.fileToDownload = mSubList.get(j).fileToDownload;
		templist.fileUploaded = mSubList.get(j).fileUploaded;
		templist.timeInMillis = mSubList.get(j).timeInMillis;

		if (mSubList.get(j).description != null && !mSubList.get(j).description.equals("")) {
			templist.description = mSubList.get(j).description;
		} else {
			CheckEntryComplete mCheckEntryComplete = new CheckEntryComplete();
			if (mSubList.get(j).type.equals(getString(R.string.camera))) {
				if(mCheckEntryComplete.isEntryComplete(mSubList.get(j),this)) {
					templist.description = getString(R.string.finished_cameraentry);
				} else {
					templist.description = getString(R.string.unfinished_cameraentry);
				}
			} else if (mSubList.get(j).type.equals(getString(R.string.voice))) {
				if(mCheckEntryComplete.isEntryComplete(mSubList.get(j),this)) {
					templist.description = getString(R.string.finished_voiceentry);
				} else {
					templist.description = getString(R.string.unfinished_voiceentry);
				}
			} else if (mSubList.get(j).type.equals(getString(R.string.text))) {
				if(mCheckEntryComplete.isEntryComplete(mSubList.get(j),this)) {
					templist.description = getString(R.string.finished_textentry);
				} else {
					templist.description = getString(R.string.unfinished_textentry);
				}
			} else if (mSubList.get(j).type.equals(getString(R.string.favorite_entry))) {
				templist.description = "Unfinished Favorite Entry";
			} else if (mSubList.get(j).type.equals(getString(R.string.unknown))) {
				templist.description = getString(R.string.unknown_entry);
			}
		}

		if (mSubList.get(j).amount != null&& !mSubList.get(j).amount.equals("")) {
			templist.amount = mStringProcessing.getStringDoubleDecimal(mSubList.get(j).amount);
		} else {
			templist.amount = "?";
		}

		if (mSubList.get(j).favorite != null && !mSubList.get(j).favorite.equals("")) {
			templist.favorite = mSubList.get(j).favorite;
		} else {
			templist.favorite = "";
		}

		if (mSubList.get(j).type != null && !mSubList.get(j).type.equals("")) {
			templist.type = mSubList.get(j).type;
		} else {
			templist.type = "";
		}

		if(Strings.isEmpty(mSubList.get(j).idFromServer)) {
			templist.idFromServer = "";
		} else {
			templist.idFromServer = mSubList.get(j).idFromServer;
		}

		if(Strings.isEmpty(mSubList.get(j).syncBit)) {
			templist.syncBit = "";
		} else {
			templist.syncBit = mSubList.get(j).syncBit;
		}

		if(Strings.isEmpty(mSubList.get(j).updatedAt)) {
			templist.updatedAt = "";
		} else {
			templist.updatedAt = mSubList.get(j).updatedAt;
		}

		if(Strings.isEmpty(mSubList.get(j).fileUpdatedAt)) {
			templist.fileUpdatedAt = "";
		} else {
			templist.fileUpdatedAt = mSubList.get(j).fileUpdatedAt;
		}

		if(Strings.isEmpty(mSubList.get(j).location)) {
			templist.location = "";
		} else {
			templist.location = mSubList.get(j).location;
		}

		return templist;
	}

	@Override
	public void onItemClick(final AdapterView<?> adapter, View v,final int position, long arg3) {
		final Entry mTempClickedList = (Entry) adapter.getItemAtPosition(position);
		String id = mTempClickedList.id;
		if (!id.contains(",")) {
			Bundle bundle = new Bundle();
			bundle.putParcelable(Constants.KEY_ENTRY_LIST_EXTRA, mTempClickedList);
			bundle.putInt(Constants.KEY_POSITION, position);
			CheckEntryComplete mCheckEntryComplete = new CheckEntryComplete();
			if (mTempClickedList.type.equals(getString(R.string.unknown))) {
				unknownDialog = new UnknownEntryDialog(this,mTempClickedList,new OnClickListener() {

					@Override
					public void onClick(View v) {
						DatabaseAdapter mDatabaseAdapter = new DatabaseAdapter(ListingAbstract.this);
						mDatabaseAdapter.open();
						mDatabaseAdapter.deleteExpenseEntryByID(mTempClickedList.id);
						mDatabaseAdapter.close();
						unknownDialog.dismiss();
						unknownDialogAction(mTempClickedList.id);
						Toast.makeText(ListingAbstract.this, "Deleted", Toast.LENGTH_SHORT).show();
					}
				});
			} else {
				Intent intent = null;
				if (mTempClickedList.type.equals(getString(R.string.camera))) {
					if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
						if(!mCheckEntryComplete.isEntryComplete(mTempClickedList,this)) {
							intent = new Intent(this,CameraEntry.class);
						} else {
							intent = new Intent(this,ShowCamera.class);
						}
					} else {
						Toast.makeText(this, "sdcard not available",Toast.LENGTH_SHORT).show();
					}
				} else if (mTempClickedList.type.equals(getString(R.string.text))) {
					if(!mCheckEntryComplete.isEntryComplete(mTempClickedList,this)) {
						intent = new Intent(this, Text.class);
					} else {
						intent = new Intent(this,ShowText.class);
					}
				} else if (mTempClickedList.type.equals(getString(R.string.voice))) {
					if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
						if(!mCheckEntryComplete.isEntryComplete(mTempClickedList,this)) {
							intent = new Intent(this, Voice.class);
						} else {
							intent = new Intent(this,ShowVoice.class);
						}
					} else {
						Toast.makeText(this, "sdcard not available", Toast.LENGTH_SHORT).show();
					}
				}
				if(intent != null) {
					intent.putExtras(bundle);
					startActivityForResult(intent,RESULT);
				}
			}
		} else {
			onClickElse(mTempClickedList,position);
		}
	}

	protected void doOperationsOnListview() {
		mListView = (ListView) findViewById(R.id.expense_listing_listview);
		mListView.setOnItemClickListener(this);
		mListView.setAdapter(mSeparatedListAdapter);
		noItemLayout();
		registerForContextMenu(mListView);
	}

	@Override
	public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
		AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
		if(new DateHelper(mDataDateList.get(Integer.parseInt(mSeparatedListAdapter.getSectionNumber(info.position))).dateTime).isCurrentWeek()) {
		super.onCreateContextMenu(menu, v, menuInfo);
		switch (v.getId()) {

			case R.id.expense_listing_listview:
	    	    String[] menuItems = getResources().getStringArray(R.array.listcontextmenu);
	    	    for (int i = 0; i<menuItems.length; i++) {
	    	    	menu.add(Menu.NONE, i, i, menuItems[i]);
	    	    }
				break;

			default:
				break;
		}
		}
	}

	@Override
	public boolean onContextItemSelected(MenuItem item) {
		AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();

  	    switch (item.getItemId()) {
		//Edit Action
  	    case 0:
  	    	FlurryAgent.onEvent(getString(R.string.editing_using_context_menu));
  	    	startEditPage(info.position);
			break;

		//Delete Action
  	    case 1:
  	    	FlurryAgent.onEvent(getString(R.string.deleting_using_context_menu));
  	    	Toast.makeText(this, "Deleted", Toast.LENGTH_SHORT).show();
  	    	removeItem(info.position);
  	    	ExpenseListing.resetUnfinishedEntryCount();
  	    	SyncHelper.startSync();
  	    	break;

		default:
			break;
		}
		return super.onContextItemSelected(item);
	}

	private void removeItem(int position) {
		Entry tempEntry = ((Entry)mSeparatedListAdapter.getItem(position));
		mDatabaseAdapter.open();
//		if(Strings.isEmpty(tempEntry.updatedAt)) {
//			mDatabaseAdapter.permanentDeleteEntryTableEntryID(tempEntry.id);
//		} else {
			mDatabaseAdapter.deleteExpenseEntryByID(tempEntry.id);
//		}
    	mDatabaseAdapter.close();
    	//XXX
    	if(!mSeparatedListAdapter.remove(position)) {
    		initListView();
    		return;
    	}
    	setModifiedValues();
    	noItemLayout();
	}

	private void startEditPage(int position) {
		Entry mTempClickedList = (Entry) mSeparatedListAdapter.getItem(position);
		Intent intent = null;
		Bundle bundle = new Bundle();
		bundle.putParcelable(Constants.KEY_ENTRY_LIST_EXTRA, mTempClickedList);
		bundle.putInt(Constants.KEY_POSITION, position);
		if (mTempClickedList.type.equals(getString(R.string.text))) {
			intent = new Intent(this, Text.class);
		} else {
			if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
				if (mTempClickedList.type.equals(getString(R.string.camera))) {
					intent = new Intent(this, CameraEntry.class);
				} else if (mTempClickedList.type.equals(getString(R.string.voice))) {
					intent = new Intent(this, Voice.class);
				}
			} else {
				Toast.makeText(this, "sdcard not available",Toast.LENGTH_SHORT).show();
			}
		}
		if(intent != null) {
			intent.putExtras(bundle);
			startActivityForResult(intent,RESULT);
		}
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		if (RESULT == requestCode) {
			if(data != null && data.getExtras() != null){
				intentExtras = data.getExtras();
			} else {
				intentExtras = null;
			}
			if(Activity.RESULT_OK == resultCode) {
				if(intentExtras != null && intentExtras.containsKey(Constants.KEY_DATA_CHANGED)) {
					updateListView(intentExtras);
					intentExtras.remove(Constants.KEY_DATA_CHANGED);
				} else {
					initListView();
				}
			} else if(Activity.RESULT_CANCELED == resultCode) {
				int position = -1;
				if(intentExtras != null && intentExtras.containsKey(Constants.KEY_POSITION)) {
					position = intentExtras.getInt(Constants.KEY_POSITION);
				}
				if(position != -1) {
					removeItem(position);
				} else {
					initListView();
				}
			}
		}
	}

	protected void updateListView(Bundle bundle) {
		Entry updatedEntry = bundle.getParcelable(Constants.KEY_ENTRY_LIST_EXTRA);
		int position = -1;
		if(bundle.containsKey(Constants.KEY_POSITION)) {position = bundle.getInt(Constants.KEY_POSITION);}
		Log.d("************************");
		Log.d("updating "+position);
		Log.d("************************");
		if(position != -1) {
			String sectionNumber = mSeparatedListAdapter.getSectionNumber(position);
			Object prevEntry = mSeparatedListAdapter.getItem(position);
			if(sectionNumber != null && !sectionNumber.equals("") && prevEntry != null && !prevEntry.equals("")) {
				try{
					mSeparatedListAdapter.update(updatedEntry, position, sectionNumber, (Entry) prevEntry);
				} catch (Exception e) {
					//XXX dont want to do this but sometimes it throwing error
					//
					initListView();
				}
			} else {
				initListView();
			}
			noItemLayout();
		}
	}

	@SuppressWarnings("unchecked")
	protected void addSections() {
		int j = 0;
		List<ListDatetimeAmount> dateListToSend = new ArrayList<ListDatetimeAmount>();
		int sectionNum = 0;
		@SuppressWarnings("rawtypes")
		List listString = new ArrayList<List<Entry>>();
		for (int i = 0; i < mDataDateList.size(); i++) {
			List<Entry> mList = new ArrayList<Entry>();

			String date = mDataDateList.get(i).dateTime;
			if(j < mSubList.size()) {
				Calendar toCHeckCal = Calendar.getInstance();
				toCHeckCal.setTimeInMillis(mSubList.get(j).timeInMillis);
				toCHeckCal.setFirstDayOfWeek(Calendar.MONDAY);
				while (j < mSubList.size() && date.equals(new DisplayDate(toCHeckCal).getHeaderFooterListDisplayDate(type))) {
					Entry templist = new Entry();
					Calendar mCalendar = Calendar.getInstance();
					mCalendar.setTimeInMillis(mSubList.get(j).timeInMillis);
					mCalendar.set(mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), mCalendar.get(Calendar.DAY_OF_MONTH),0,0,0);
					mCalendar.setFirstDayOfWeek(Calendar.MONDAY);
					DisplayDate mDisplayDate = new DisplayDate(mCalendar);
					if(!condition(mDisplayDate)) {
						j = mSubList.size() + 1;
						break;
					}
					if (type == R.string.sublist_thisweek) {
						templist = getListCurrentWeek(j);
						mList.add(templist);
						j++;
						if (j < mSubList.size()) {
							toCHeckCal.setTimeInMillis(mSubList.get(j).timeInMillis);
							toCHeckCal.setFirstDayOfWeek(Calendar.MONDAY);
						} else {
							break;
						}
					} else if (type == R.string.sublist_thismonth || type == R.string.sublist_thisyear || type == R.string.sublist_all) {
						toCHeckCal.setTimeInMillis(mSubList.get(j).timeInMillis);
						toCHeckCal.setFirstDayOfWeek(Calendar.MONDAY);
						while (mDataDateList.get(i).dateTime.equals(new DisplayDate(toCHeckCal).getHeaderFooterListDisplayDate(type))) {
							////// Adding i+" "+j as id
							Entry mTempSubList = new Entry();
							mTempSubList.id = mSubList.get(j).id +",";

							///// Adding tag
							Calendar tempCalendar = Calendar.getInstance();
							tempCalendar.setTimeInMillis(mSubList.get(j).timeInMillis);
							tempCalendar.set(tempCalendar.get(Calendar.YEAR), tempCalendar.get(Calendar.MONTH), tempCalendar.get(Calendar.DAY_OF_MONTH),0,0,0);
							tempCalendar.setFirstDayOfWeek(Calendar.MONDAY);
							mDisplayDate = new DisplayDate(tempCalendar);
							DisplayDate tempDisplayDate = new DisplayDate(tempCalendar);
							int isWeekOfMonth = tempCalendar.get(Calendar.WEEK_OF_MONTH);
							int isCurrentMonth = tempCalendar.get(Calendar.MONTH);
							int isCurrentYear = tempCalendar.get(Calendar.YEAR);

							mTempSubList.description = tempDisplayDate.getSubListTag(type);

							///// Adding Amount
							double temptotalAmount = 0;
							String totalAmountString = null;
							boolean isTempAmountNull = false;
							do {
								String tempAmount = mSubList.get(j).amount;
								if (tempAmount != null && !tempAmount.equals("")) {
									try {
										temptotalAmount += Double.parseDouble(tempAmount);
									} catch (NumberFormatException e) {
										e.printStackTrace();
									}
								} else {
									isTempAmountNull = true;
								}
								j++;
								if (j < mSubList.size()) {
									toCHeckCal.setTimeInMillis(mSubList.get(j).timeInMillis);
									toCHeckCal.setFirstDayOfWeek(Calendar.MONDAY);
									tempCalendar.setTimeInMillis(mSubList.get(j).timeInMillis);
									tempCalendar.set(tempCalendar.get(Calendar.YEAR), tempCalendar.get(Calendar.MONTH), tempCalendar.get(Calendar.DAY_OF_MONTH),0,0,0);
									tempCalendar.setFirstDayOfWeek(Calendar.MONDAY);
									tempDisplayDate = new DisplayDate(tempCalendar);
									if(getLoopCondition(tempCalendar,isWeekOfMonth,isCurrentMonth,isCurrentYear)) {

										mTempSubList.id = mTempSubList.id + mSubList.get(j).id+",";
									}
								} else {
									break;
								}
							} while (getLoopCondition(tempCalendar,isWeekOfMonth,isCurrentMonth,isCurrentYear));

							if (isTempAmountNull) {
								if (temptotalAmount != 0) {
									totalAmountString = temptotalAmount + " ?";
								} else {
									totalAmountString = "?";
								}
							} else {
								totalAmountString = temptotalAmount + "";
							}
							mTempSubList.amount = mStringProcessing.getStringDoubleDecimal(totalAmountString);
							mTempSubList.type = getString(type);
							mTempSubList.timeInMillis = 0L;
							mTempSubList.deleted = false;
							mTempSubList.fileToDownload = false;
							mTempSubList.fileUpdatedAt = "";
							mTempSubList.fileUploaded = false;
							mTempSubList.idFromServer = "";
							mTempSubList.myHash = "";
							mTempSubList.syncBit = "";
							mTempSubList.updatedAt = "";
							if(highlightID != null) {
								if (j <= mSubList.size()) {
									if(mTempSubList.id.contains(highlightID)) {
										startSubListing(mTempSubList);
									}
								}
							}
							mList.add(mTempSubList);
							if (j == mSubList.size()) {
								break;
							}

						}
					}
				}

			} else {
				break;
			}
			listString.add(mList);
			@SuppressWarnings("rawtypes")
			List tt = (List) listString.get(i);
			if(tt.size() > 0) {
				int temp = i;
				if(i == 0 && !new DisplayDate(mSubList.get(0).timeInMillis).isCurrentWeek()) {temp++;}
				dateListToSend.add(mDataDateList.get(temp));
				Log.d("************ Amount ***************** "+temp);
				Log.d("mDataDateList "+mDataDateList.get(temp).amount);
				mSeparatedListAdapter.addSection(sectionNum + "", new ArrayAdapter<Entry>(this, R.layout.expense_listing_tab, tt), dateListToSend);
				sectionNum++;
			}
		}
		doOperationsOnListview();
	}

	protected void startSubListing(Entry entry) {
		ArrayList<String> mArrayList = new GetArrayListFromString().getListFromTextArea(entry.id);
		for(int checkI=0; checkI<mArrayList.size(); checkI++) {
			if(mArrayList.get(checkI).equals(highlightID)) {
				Intent expenseSubListing = new Intent(this, ExpenseSubListing.class);
				Bundle extras = new Bundle();
				extras.putParcelable(Constants.KEY_ENTRY_LIST_EXTRA, entry);
				extras.putInt(Constants.KEY_TYPE, getSubListType());
				if(highlightID != null)
					extras.putString(Constants.KEY_HIGHLIGHT, highlightID);
				expenseSubListing.putExtras(extras);
				startActivityForResult(expenseSubListing, RESULT);
 				finish();
			}
		}
	}

	protected int getSubListType() {
		switch (type) {
		case R.string.sublist_all:
			return R.string.sublist_thisyear;
		case R.string.sublist_thismonth:
			return R.string.sublist_thisweek;
		case R.string.sublist_thisyear:
			return R.string.sublist_thismonth;
		default:
			return R.string.sublist_thisweek;
		}
	}

	protected boolean getLoopCondition(Calendar tempCalendar, int isWeekOfMonth, int isCurrentMonth, int isCurrentYear) {
		switch (type) {
		case R.string.sublist_all:
			return tempCalendar.get(Calendar.YEAR) == isCurrentYear;

		case R.string.sublist_thismonth:
		case R.string.sublist_thisweek:
			return tempCalendar.get(Calendar.WEEK_OF_MONTH) == isWeekOfMonth
				&& tempCalendar.get(Calendar.MONTH) == isCurrentMonth
				&& tempCalendar.get(Calendar.YEAR) == isCurrentYear;
		case R.string.sublist_thisyear:
			return tempCalendar.get(Calendar.MONTH) == isCurrentMonth
				&& tempCalendar.get(Calendar.YEAR) == isCurrentYear;
		default:
			return false;
		}
	}

	protected void onClickElse(Entry entry,int position) {
		Intent mSubListIntent = new Intent(this, ExpenseSubListing.class);
		Bundle extras = new Bundle();
		extras.putParcelable(Constants.KEY_ENTRY_LIST_EXTRA, entry);
		extras.putInt(Constants.KEY_POSITION, position);
		extras.putInt(Constants.KEY_TYPE, getSubListType());
		mSubListIntent.putExtras(extras);
		startActivityForResult(mSubListIntent,RESULT);
	}

	protected abstract void unknownDialogAction(String id);
	protected abstract void noItemButtonAction(Button noItemButton);
	protected abstract void noItemLayout();
	protected abstract void setContentView();
	protected abstract boolean condition(DisplayDate mDisplayDate);
	protected abstract void initListView();
	protected abstract void setModifiedValues();

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Quatro</logradouro><bairro>Penha II</bairro><cidade>Passos</cidade><uf>MG</uf><cep>37903360</cep></feed>

redpajama_set_name: RedPajamaGithub


text:
* Differential Evolution

## Models
* Schaffer
* Osyczka2
* Kursawe
* Golinski

## Legend
* **?** represents a mutant with a better global solution.
* **+** represents a mutant with a better solution than its parent.
* **.** represents a mutation that yields a mutant worse than its parent.

## Outputs
### Schaffer on DE

![Schaffer DE](img/Schaffer_DE.png)

### Osyczka2 on DE

![Osyczka2 DE](img/Osyczka2_DE.png)

### Kursawe on DE

![Kursawe DE](img/Kursawe_DE.png)

### Golinski on DE

![Golinski DE](img/Golinski_DE.png)


text:
package com.sun.jini.test.spec.javaspace.conformance;

import java.util.logging.Level;

// net.jini
import net.jini.core.transaction.Transaction;
import net.jini.space.JavaSpace;

// com.sun.jini
import com.sun.jini.qa.harness.TestException;
import com.sun.jini.qa.harness.QAConfig;

/**
 * TransactionReadNO_WAITTest asserts that for read within the non null
 * transaction with NO_WAIT timeout:
 * 1) A timeout of NO_WAIT means to return immediately, with no waiting,
 *    which is equivalent to using a zero timeout.
 * 2) If a match is found by read, a reference to a copy of the matching
 *    entry is returned.
 * 3) If no match is found, null is returned.
 * 4) Passing a null reference for the template will match any entry.
 *
 *
 */
public class TransactionReadNO_WAITTest extends AbstractReadTestBase {

    /**
     * Sets up the testing environment.
     *
     * @param config QAConfig from the runner for setup.
     */
    public void setup(QAConfig config) throws Exception {

        // mandatory call to parent
        super.setup(config);

        // get an instance of Transaction Manager
        mgr = getTxnManager();
    }

    /**
     * This method asserts that for read within the non null transaction
     * with NO_WAIT timeout:
     * 1) a timeout of NO_WAIT means to return immediately, with no waiting,
     *    which is equivalent to using a zero timeout.
     * 2) If a match is found by read, a reference to a copy of the matching
     *    entry is returned.
     * 3) If no match is found, null is returned.
     * 4) Passing a null reference for the template will match any entry.
     *
     *
Notes:
For more information see the JavaSpaces specification
     * section 2.4.

     */
    public void run() throws Exception {
        SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2);
        SimpleEntry sampleEntry3 = new SimpleEntry("TestEntry #1", 2);
        SimpleEntry template;
        Transaction txn;
        String msg;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException("Space is not empty in the beginning.");
        }

        // write three sample entries twice to the space
        space.write(sampleEntry1, null, leaseForeverTime);
        space.write(sampleEntry1, null, leaseForeverTime);
        space.write(sampleEntry2, null, leaseForeverTime);
        space.write(sampleEntry2, null, leaseForeverTime);
        space.write(sampleEntry3, null, leaseForeverTime);
        space.write(sampleEntry3, null, leaseForeverTime);

        // create the non null transaction
        txn = getTransaction();

        /*
         * read 1-st entry from the space using the same one as a template
         * with JavaSpace.NO_WAIT timeout within the transaction
         */
        msg = testTemplate(sampleEntry1, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        /*
         * read sample entry from the space using
         * wrong template entries and JavaSpace.NO_WAIT timeout
         * within the transaction
         */
        template = new SimpleEntry("TestEntry #3", 1);
        msg = testWrongTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        // 2-nd wrong template
        template = new SimpleEntry("TestEntry #1", 3);
        msg = testWrongTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        // 3-rd wrong template
        template = new SimpleEntry("TestEntry #3", 3);
        msg = testWrongTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        // 4-th wrong template
        template = new SimpleEntry(null, 3);
        msg = testWrongTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        // 5-th wrong template
        template = new SimpleEntry("TestEntry #3", null);
        msg = testWrongTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        /*
         * read entry from the space using null as a template
         * and JavaSpace.NO_WAIT timeout within the transaction
         */
        msg = testTemplate(null, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        /*
         * read sample entries from the space using templates with
         * null as a wildcard for different fields
         * and JavaSpace.NO_WAIT timeout within the transaction
         */
        template = new SimpleEntry("TestEntry #1", null);
        msg = testTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        // try 2-nd template
        template = new SimpleEntry(null, 2);
        msg = testTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        // 3-rd template
        template = new SimpleEntry(null, null);
        msg = testTemplate(template, txn, JavaSpace.NO_WAIT, 0, false);

        if (msg != null) {
            throw new TestException(msg);
        }

        // commit the transaction
        txnCommit(txn);
    }
}


text:
'use strict';

var http = require('http'),
  noop = require('noop2'),
  safeClose = require('./index'),
  test = require('tape');

function createAndListen() {
  var server = http.createServer(noop);
  server.listen(1337);
  return server;
}

test('should not callback with error if closed', function (t) {
  t.plan(2);

  var server = createAndListen();

  server.close(function (err) {
    t.error(err);
    safeClose(server, function (e) {
      t.error(e);
    });
  });
});


text:
bool perfectScore(int number) {
    return (number >= 100);
}

auto main() -> int {
    int number;

    std::vector<int> vector;
    while (true) {
        std::cout << "Enter a test score to add (0 to stop): ";
        std::cin >> number;
        if (0 == number) {
            break;
        }
        vector.push_back(number);
    }

    auto endIterator = end(vector);
    std::function<bool(int)> f = perfectScore;
    auto iterator = find_if(begin(vector), endIterator, std::not1(f));

    if (end(vector) == iterator) {
        std::cout << "All perfect scores" << std::endl;
    }
    else {
        std::cout << "Found a \"Less-that-perfect\" score of "
                  << *iterator << std::endl;
    }

    return 0;

}


text:
create class tb(
col1 int
);

insert into tb values(10);
insert into tb values(20);
insert into tb values(30);

update tb set col1=variance(col1) where col1=10;

drop class tb;


text:
.class Landroid/preference/VolumePreference$SavedState;
.super Landroid/preference/Preference$BaseSavedState;
.source "VolumePreference.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/preference/VolumePreference;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "SavedState"
.end annotation

# static fields
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/Parcelable$Creator",
            "<",
            "Landroid/preference/VolumePreference$SavedState;",
            ">;"
        }
    .end annotation
.end field

# instance fields
.field mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 221
    new-instance v0, Landroid/preference/VolumePreference$SavedState$1;

    invoke-direct {v0}, Landroid/preference/VolumePreference$SavedState$1;-><init>()V

    sput-object v0, Landroid/preference/VolumePreference$SavedState;->CREATOR:Landroid/os/Parcelable$Creator;

    return-void
.end method

.method public constructor <init>(Landroid/os/Parcel;)V
    .locals 2
    .param p1, "source"    # Landroid/os/Parcel;

    .prologue
    .line 201
    invoke-direct {p0, p1}, Landroid/preference/Preference$BaseSavedState;-><init>(Landroid/os/Parcel;)V

    .line 198
    new-instance v0, Landroid/preference/VolumePreference$VolumeStore;

    invoke-direct {v0}, Landroid/preference/VolumePreference$VolumeStore;-><init>()V

    iput-object v0, p0, Landroid/preference/VolumePreference$SavedState;->mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

    .line 202
    iget-object v0, p0, Landroid/preference/VolumePreference$SavedState;->mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v1

    iput v1, v0, Landroid/preference/VolumePreference$VolumeStore;->volume:I

    .line 203
    iget-object v0, p0, Landroid/preference/VolumePreference$SavedState;->mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v1

    iput v1, v0, Landroid/preference/VolumePreference$VolumeStore;->originalVolume:I

    .line 204
    return-void
.end method

.method public constructor <init>(Landroid/os/Parcelable;)V
    .locals 1
    .param p1, "superState"    # Landroid/os/Parcelable;

    .prologue
    .line 218
    invoke-direct {p0, p1}, Landroid/preference/Preference$BaseSavedState;-><init>(Landroid/os/Parcelable;)V

    .line 198
    new-instance v0, Landroid/preference/VolumePreference$VolumeStore;

    invoke-direct {v0}, Landroid/preference/VolumePreference$VolumeStore;-><init>()V

    iput-object v0, p0, Landroid/preference/VolumePreference$SavedState;->mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

    .line 219
    return-void
.end method

# virtual methods
.method getVolumeStore()Landroid/preference/VolumePreference$VolumeStore;
    .locals 1

    .prologue
    .line 214
    iget-object v0, p0, Landroid/preference/VolumePreference$SavedState;->mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

    return-object v0
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .locals 1
    .param p1, "dest"    # Landroid/os/Parcel;
    .param p2, "flags"    # I

    .prologue
    .line 208
    invoke-super {p0, p1, p2}, Landroid/preference/Preference$BaseSavedState;->writeToParcel(Landroid/os/Parcel;I)V

    .line 209
    iget-object v0, p0, Landroid/preference/VolumePreference$SavedState;->mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

    iget v0, v0, Landroid/preference/VolumePreference$VolumeStore;->volume:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 210
    iget-object v0, p0, Landroid/preference/VolumePreference$SavedState;->mVolumeStore:Landroid/preference/VolumePreference$VolumeStore;

    iget v0, v0, Landroid/preference/VolumePreference$VolumeStore;->originalVolume:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 211
    return-void
.end method


text:
#include "traffic/DragonflyGlobalWorstCaseTrafficPattern.h"

#include <gtest/gtest.h>
#include <json/json.h>
#include <mut/mut.h>
#include <prim/prim.h>
#include <strop/strop.h>

#include <vector>

#include "test/TestSetup_TEST.h"

TEST(DragonflyGlobalWorstCaseTrafficPattern, permutation) {
  for (u32 net = 0; net < 100; net++) {
    TestSetup setup(1, 1, 0xDEAD * net + 0xBEEF);

    u32 groupCount = gSim->rnd.nextU64(1, 20);
    u32 groupSize = gSim->rnd.nextU64(1, 20);
    u32 concentration = gSim->rnd.nextU64(1, 20);

    for (u32 test = 0; test < 100; test++) {
      Json::Value settings;
      settings["group_count"] = groupCount;
      settings["group_size"] = groupSize;
      settings["concentration"] = concentration;
      settings["random"] = false;

      u32 selfGroup = gSim->rnd.nextU64(0, groupCount - 1);
      u32 selfLocal = gSim->rnd.nextU64(0, groupSize - 1);
      u32 selfConc = gSim->rnd.nextU64(0, concentration - 1);

      u32 self = ((selfGroup * groupSize * concentration) +
                  (selfLocal * concentration) +
                  (selfConc));

      DragonflyGlobalWorstCaseTrafficPattern* tp =
          new DragonflyGlobalWorstCaseTrafficPattern(
              "TP", nullptr, groupCount * groupSize * concentration, self,
              settings);

      u32 expDestGroup = groupCount - selfGroup - 1;
      u32 expDestLocal = selfLocal;
      u32 expDestConc = selfConc;
      u32 expDest = ((expDestGroup * groupSize * concentration) +
                     (expDestLocal * concentration) +
                     (expDestConc));

      for (u32 cnt = 0; cnt < 100; cnt++) {
        u32 dest = tp->nextDestination();
        ASSERT_EQ(dest, expDest);
      }

      delete tp;
    }
  }
}

TEST(DragonflyGlobalWorstCaseTrafficPattern, random) {
  const u32 DEBUG = 0;  // 0=off 1=min 2=max

  f64 wc = 0.0;

  const u32 CONFIGS = 100;
  const u32 TESTS = 10;
  const u32 ROUNDS = 10000;

  for (u32 net = 0; net < CONFIGS; net++) {
    TestSetup setup(1, 1, 0xDEAD * net + 0xBEEF);

    u32 groupCount;
    u32 groupSize;
    u32 concentration;

    do {
      groupCount = gSim->rnd.nextU64(1, 20);
      groupSize = gSim->rnd.nextU64(1, 20);
      concentration = gSim->rnd.nextU64(1, 20);
    } while ((groupSize * concentration) < 5);

    if (DEBUG > 1) {
      printf("config: gc=%u gs=%u c=%u\n",
             groupCount, groupSize, concentration);
    }
    for (u32 test = 0; test < TESTS; test++) {
      Json::Value settings;
      settings["group_count"] = groupCount;
      settings["group_size"] = groupSize;
      settings["concentration"] = concentration;
      settings["random"] = true;

      u32 selfGroup = gSim->rnd.nextU64(0, groupCount - 1);
      u32 selfLocal = gSim->rnd.nextU64(0, groupSize - 1);
      u32 selfConc = gSim->rnd.nextU64(0, concentration - 1);

      u32 self = ((selfGroup * groupSize * concentration) +
                  (selfLocal * concentration) +
                  (selfConc));

      if (DEBUG > 1) {
        printf("self: g=%u l=%u c=%u s=%u\n",
               selfGroup, selfLocal, selfConc, self);
      }

      DragonflyGlobalWorstCaseTrafficPattern* tp =
          new DragonflyGlobalWorstCaseTrafficPattern(
              "TP", nullptr, groupCount * groupSize * concentration, self,
              settings);

      u32 expDestGroup = groupCount - selfGroup -1;

      std::vector<u32> destCounts(groupSize * concentration, 0);
      for (u32 cnt = 0; cnt < ROUNDS; cnt++) {
        u32 dest = tp->nextDestination();
        u32 destGroup = dest / (groupSize * concentration);
        u32 destLocalIndex = dest % (groupSize * concentration);

        ASSERT_EQ(destGroup, expDestGroup);
        destCounts.at(destLocalIndex)++;
      }

      f64 mean = mut::arithmeticMean<u32>(destCounts);
      f64 variance = mut::variance<u32>(destCounts, mean);
      f64 stddev = mut::standardDeviation<u32>(variance);
      if (DEBUG > 1) {
        printf("%f %f %f\n", mean, variance, stddev);
        printf("%s\n", strop::vecString<u32>(destCounts).c_str());
      }

      f64 expMean = (f64)ROUNDS / (f64)(groupSize * concentration);
      ASSERT_NEAR(mean, expMean, 0.001);
      f64 relStddev = stddev / ROUNDS;
      ASSERT_LE(relStddev, 0.01);

      if (relStddev > wc) {
        wc = relStddev;
        if (DEBUG > 0) {
          printf("%f: gc=%u gs=%u c=%u\n", relStddev,
                 groupCount, groupSize, concentration);
        }
      }

      delete tp;
    }
  }
}


text:
using Microsoft.AspNetCore.Mvc.ViewEngines;

namespace FormFactory.AspMvc.Wrappers
{
    public class FormFactoryViewFinderResult : IViewFinderResult
    {
        private readonly ViewEngineResult _findPartialView;

        public FormFactoryViewFinderResult(ViewEngineResult findPartialView)
        {
            _findPartialView = findPartialView;
        }

        public View View
        {
            get
            {
                if (_findPartialView.View == null) return null;
                return new FormFactoryView(_findPartialView.View);
            }
        }
    }
}


text:
def fill_grid_seq(rows, columns, mines):
    grid=[['.' for i in range(columns)] for j in range(rows)]
    for mine in range(mines//columns*columns):
        row=mine//rows
        column=mine-mine//rows*rows
        print(row,column)
        grid[row][column]="*"
    return grid

def fill_grid(rows,columns, mines):
    grid=[['.' for i in range(columns)] for j in range(rows)]
    if mines>=1:
        grid[0][0]="*"
    mines-=1
    row_holder=0
    column_holder=0
    while mines>0:
        for i in range(1,max(rows, columns)):
            if not grid[row_holder][i]=='*':
                try:
                    grid[row_holder][i]="*"
                    mines-=1
                    if mines==0:
                        break
                except IndexError:
                    pass
            if not grid[i][column_holder]=='*':
                try:
                    grid[i][column_holder]="*"
                    mines-=1
                    if mines==0:
                        break
                except IndexError:
                    pass
        row_holder+=1
        column_holder+=1
    return grid

def possible_win(rows, columns, mines):
    if rows*columns-mines==1:
        return True


text:
<?php

/**
 * Doctrine_Query_Exception
 *
 * @package     Doctrine
 * @subpackage  Query
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @link        www.phpdoctrine.org
 * @since       1.0
 * @version     $Revision: 4252 $
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
 */
class Doctrine_Query_Exception extends Doctrine_Exception
{ }


text:
--TEST--
Test DateTime::setTimezone () function : error conditions
--FILE--
<?php
/* Prototype  : public DateTime DateTime::setTimezone  ( DateTimeZone $timezone  )
 * Description: Sets the time zone for the DateTime object
 * Source code: ext/date/php_date.c
 * Alias to functions: date_timezone_set
 */

date_default_timezone_set("UTC");

echo "*** Testing DateTime::setTimezone () : error conditions ***\n";

$datetime = new DateTime("2009-01-30 17:57:32");

echo "\n-- Testing DateTime::setTimezone () function with zero arguments --\n";
var_dump( $datetime->setTimezone() );

echo "\n-- Testing DateTime::setTimezone () function with more than expected no. of arguments --\n";
$timezone  = new DateTimezone("GMT");
$extra_arg = 99;
var_dump( $datetime->setTimezone($timezone, $extra_arg) );

?>
===DONE===
--EXPECTF--
*** Testing DateTime::setTimezone () : error conditions ***

-- Testing DateTime::setTimezone () function with zero arguments --

Warning: DateTime::setTimezone() expects exactly 1 parameter, 0 given in %s on line %d
bool(false)

-- Testing DateTime::setTimezone () function with more than expected no. of arguments --

Warning: DateTime::setTimezone() expects exactly 1 parameter, 2 given in %s on line %d
bool(false)
===DONE===


text:
#pragma once

#include "geometry/r3x3_matrix.hpp"

#include <string>
#include <utility>

#include "base/macros.hpp"
#include "glog/logging.h"
#include "quantities/elementary_functions.hpp"
#include "quantities/quantities.hpp"

namespace principia {
namespace geometry {
namespace internal_r3x3_matrix {

using quantities::SIUnit;

template<typename Scalar>
R3x3Matrix<Scalar>::R3x3Matrix(R3Element<Scalar> const& row_x,
                               R3Element<Scalar> const& row_y,
                               R3Element<Scalar> const& row_z)
    : row_x_(row_x), row_y_(row_y), row_z_(row_z) {}

template<typename Scalar>
Scalar R3x3Matrix<Scalar>::Trace() const {
  return row_x_.x + row_y_.y + row_z_.z;
}

template<typename Scalar>
Cube<Scalar> R3x3Matrix<Scalar>::Determinant() const {
  return row_x_.x * row_y_.y * row_z_.z +
         row_x_.y * row_y_.z * row_z_.x +
         row_x_.z * row_y_.x * row_z_.y -
         row_x_.z * row_y_.y * row_z_.x -
         row_x_.y * row_y_.x * row_z_.z -
         row_x_.x * row_y_.z * row_z_.y;
}

template<typename Scalar>
FORCE_INLINE(inline) Scalar R3x3Matrix<Scalar>::operator()(
    int const r, int const c) const {
  switch (r) {
    case 0:
      return row_x_[c];
    case 1:
      return row_y_[c];
    case 2:
      return row_z_[c];
    default:
      DLOG(FATAL) << FUNCTION_SIGNATURE
                  << " indices = {" << r << ", " << c << "}";
      base::noreturn();
  }
}

template<typename Scalar>
R3x3Matrix<Scalar> R3x3Matrix<Scalar>::Transpose() const {
  return R3x3Matrix({row_x_.x, row_y_.x, row_z_.x},
                    {row_x_.y, row_y_.y, row_z_.y},
                    {row_x_.z, row_y_.z, row_z_.z});
}

template<typename Scalar>
R3x3Matrix<Scalar>& R3x3Matrix<Scalar>::operator+=(
    R3x3Matrix const& right) {
  return *this = *this + right;
}

template<typename Scalar>
R3x3Matrix<Scalar>& R3x3Matrix<Scalar>::operator-=(
    R3x3Matrix const& right) {
  return *this = *this - right;
}

template<typename Scalar>
R3x3Matrix<Scalar>& R3x3Matrix<Scalar>::operator*=(
    R3x3Matrix const& right) {
  return *this = *this * right;
}

template<typename Scalar>
R3x3Matrix<Scalar>& R3x3Matrix<Scalar>::operator*=(double const right) {
  return *this = *this * right;
}

template<typename Scalar>
R3x3Matrix<Scalar>& R3x3Matrix<Scalar>::operator/=(double const right) {
  return *this = *this / right;
}

template<typename Scalar>
template<typename S, typename>
R3x3Matrix<S> R3x3Matrix<Scalar>::Identity() {
  return R3x3Matrix<S>({1, 0, 0},
                       {0, 1, 0},
                       {0, 0, 1});
}

template<typename Scalar>
void R3x3Matrix<Scalar>::WriteToMessage(
    not_null<serialization::R3x3Matrix*> const message) const {
  row_x_.WriteToMessage(message->mutable_row_x());
  row_y_.WriteToMessage(message->mutable_row_y());
  row_z_.WriteToMessage(message->mutable_row_z());
}

template<typename Scalar>
R3x3Matrix<Scalar> R3x3Matrix<Scalar>::ReadFromMessage(
    serialization::R3x3Matrix const& message) {
  return R3x3Matrix(R3Element<Scalar>::ReadFromMessage(message.row_x()),
                    R3Element<Scalar>::ReadFromMessage(message.row_y()),
                    R3Element<Scalar>::ReadFromMessage(message.row_z()));
}

template<typename Scalar>
R3x3Matrix<Scalar> operator+(R3x3Matrix<Scalar> const& right) {
  return R3x3Matrix<Scalar>(+right.row_x_, +right.row_y_, +right.row_z_);
}

template<typename Scalar>
R3x3Matrix<Scalar> operator-(R3x3Matrix<Scalar> const& right) {
  return R3x3Matrix<Scalar>(-right.row_x_, -right.row_y_, -right.row_z_);
}

template<typename Scalar>
R3x3Matrix<Scalar> operator+(R3x3Matrix<Scalar> const& left,
                             R3x3Matrix<Scalar> const& right) {
  return R3x3Matrix<Scalar>(left.row_x_ + right.row_x_,
                            left.row_y_ + right.row_y_,
                            left.row_z_ + right.row_z_);
}

template<typename Scalar>
R3x3Matrix<Scalar> operator-(R3x3Matrix<Scalar> const& left,
                             R3x3Matrix<Scalar> const& right) {
  return R3x3Matrix<Scalar>(left.row_x_ - right.row_x_,
                            left.row_y_ - right.row_y_,
                            left.row_z_ - right.row_z_);
}

template<typename LScalar, typename RScalar>
R3x3Matrix<Product<LScalar, RScalar>> operator*(
    R3x3Matrix<LScalar> const& left,
    R3x3Matrix<RScalar> const& right) {
  R3x3Matrix<RScalar> const t_right = right.Transpose();
  return R3x3Matrix<Product<LScalar, RScalar>>(
             {Dot(left.row_x_, t_right.row_x_),
              Dot(left.row_x_, t_right.row_y_),
              Dot(left.row_x_, t_right.row_z_)},
             {Dot(left.row_y_, t_right.row_x_),
              Dot(left.row_y_, t_right.row_y_),
              Dot(left.row_y_, t_right.row_z_)},
             {Dot(left.row_z_, t_right.row_x_),
              Dot(left.row_z_, t_right.row_y_),
              Dot(left.row_z_, t_right.row_z_)});
}

template<typename LScalar, typename RScalar>
R3Element<Product<LScalar, RScalar>> operator*(
    R3x3Matrix<LScalar> const& left,
    R3Element<RScalar> const& right) {
  return R3Element<Product<LScalar, RScalar>>({Dot(left.row_x_, right),
                                               Dot(left.row_y_, right),
                                               Dot(left.row_z_, right)});
}

template<typename LScalar, typename RScalar>
R3Element<Product<LScalar, RScalar>> operator*(
    R3Element<LScalar> const& left,
    R3x3Matrix<RScalar> const& right) {
  R3x3Matrix<RScalar> const t_right = right.Transpose();
  return R3Element<Product<LScalar, RScalar>>({Dot(left, t_right.row_x_),
                                               Dot(left, t_right.row_y_),
                                               Dot(left, t_right.row_z_)});
}

template<typename LScalar, typename RScalar, typename>
R3x3Matrix<Product<LScalar, RScalar>> operator*(
    LScalar const& left,
    R3x3Matrix<RScalar> const& right) {
  return R3x3Matrix<Product<LScalar, RScalar>>(left * right.row_x_,
                                               left * right.row_y_,
                                               left * right.row_z_);
}

template<typename LScalar, typename RScalar, typename>
R3x3Matrix<Product<LScalar, RScalar>> operator*(
    R3x3Matrix<LScalar> const& left,
    RScalar const& right) {
  return R3x3Matrix<Product<LScalar, RScalar>>(left.row_x_ * right,
                                               left.row_y_ * right,
                                               left.row_z_ * right);
}

template<typename LScalar, typename RScalar, typename>
R3x3Matrix<Quotient<LScalar, RScalar>> operator/(
    R3x3Matrix<LScalar> const& left,
    RScalar const& right) {
  return R3x3Matrix<Quotient<LScalar, RScalar>>(left.row_x_ / right,
                                                left.row_y_ / right,
                                                left.row_z_ / right);
}

template<typename LScalar, typename RScalar>
R3x3Matrix<Product<LScalar, RScalar>> KroneckerProduct(
    R3Element<LScalar> const& left,
    R3Element<RScalar> const& right) {
  return R3x3Matrix<Product<LScalar, RScalar>>(left.x * right,
                                               left.y * right,
                                               left.z * right);
}

template<typename Scalar>
bool operator==(R3x3Matrix<Scalar> const& left,
                R3x3Matrix<Scalar> const& right) {
  return left.row_x_ == right.row_x_ &&
         left.row_y_ == right.row_y_ &&
         left.row_z_ == right.row_z_;
}

template<typename Scalar>
bool operator!=(R3x3Matrix<Scalar> const& left,
                R3x3Matrix<Scalar> const& right) {
  return left.row_x_ != right.row_x_ ||
         left.row_y_ != right.row_y_ ||
         left.row_z_ != right.row_z_;
}

template<typename Scalar>
std::string DebugString(R3x3Matrix<Scalar> const& r3x3_matrix) {
  std::string result = "{";
  result += DebugString(r3x3_matrix.row_x_);
  result += ", ";
  result += DebugString(r3x3_matrix.row_y_);
  result += ", ";
  result += DebugString(r3x3_matrix.row_z_);
  result +="}";
  return result;
}

template<typename Scalar>
std::ostream& operator<<(std::ostream& out,
                         R3x3Matrix<Scalar> const& r3x3_matrix) {
  out << DebugString(r3x3_matrix);
  return out;
}

}  // namespace internal_r3x3_matrix
}  // namespace geometry
}  // namespace principia


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="6ce02b9b-2025-4a63-9f81-1eae8e37ecee" name="Default" comment="" />
    <ignored path="webpack-run-middleware.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="webpack-run-middleware" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="middleware.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/middleware.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="29" column="0" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
              <folding>
                <element signature="n#!!doc" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="README.md" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/README.md">
          <provider editor-type-id="MarkdownPreviewEditor">
            <state />
          </provider>
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="60" column="0" selection-start-line="60" selection-start-column="0" selection-end-line="60" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="package.json" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/package.json">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.031441048">
              <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/middleware.js" />
        <option value="$PROJECT_DIR$/README.md" />
        <option value="$PROJECT_DIR$/package.json" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" />
  <component name="JsBuildToolPackageJson" detection-done="true" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="155" />
    <option name="y" value="15" />
    <option name="width" value="2332" />
    <option name="height" value="1332" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="webpack-run-middleware" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="webpack-run-middleware" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="webpack-run-middleware" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scratches" />
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="js-jscs-nodeInterpreter" value="C:\Program Files\nodejs\node.exe" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
      <method />
    </configuration>
    <configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
      <option name="cucumberJsArguments" value="" />
      <option name="executablePath" />
      <option name="filePath" />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
      <command value="run-script" />
      <scripts />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
      <node-options />
      <working-directory>$PROJECT_DIR$</working-directory>
      <pass-parent-env>true</pass-parent-env>
      <envs />
      <ui>bdd</ui>
      <extra-mocha-options />
      <test-kind>DIRECTORY</test-kind>
      <test-directory />
      <recursive>false</recursive>
      <method />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="6ce02b9b-2025-4a63-9f81-1eae8e37ecee" name="Default" comment="" />
      <created>1449359683194</created>
      <option name="number" value="Default" />
      <updated>1449359683194</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="155" y="15" width="2332" height="1332" extended-state="0" />
    <editor active="true" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17517605" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.29743028" sideWeight="0.49622643" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32883817" sideWeight="0.48770493" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12588029" sideWeight="0.51229507" order="3" side_tool="true" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/middleware.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="29" column="0" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
          <folding>
            <element signature="n#!!doc" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider editor-type-id="MarkdownPreviewEditor">
        <state />
      </provider>
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="60" column="0" selection-start-line="60" selection-start-column="0" selection-end-line="60" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/middleware.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="164" column="70" selection-start-line="164" selection-start-column="70" selection-end-line="164" selection-end-column="70" />
          <folding>
            <element signature="n#!!doc" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider editor-type-id="MarkdownPreviewEditor">
        <state />
      </provider>
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="28" column="48" selection-start-line="28" selection-start-column="48" selection-end-line="28" selection-end-column="48" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider editor-type-id="MarkdownPreviewEditor">
        <state />
      </provider>
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="60" column="0" selection-start-line="60" selection-start-column="0" selection-end-line="60" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/middleware.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="29" column="0" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
          <folding>
            <element signature="n#!!doc" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.031441048">
          <caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
<?php

class ArrayList
{
    const DEFAULT_CAPACITY = 10;
    const MAX_ARRAY_SIZE = PHP_INT_MAX;

    private $size;
    private $elements;

    public function __construct()
    {
        $this->size = 0;
        $this->elements = new SplFixedArray(self::DEFAULT_CAPACITY);
    }

    public function size()
    {
        return $this->size;
    }

    public function add($element)
    {
        $size = $this->size;

        $this->ensureCapacityInternal($size + 1);
        $this->elements[$size] = $element;
        $this->size++;
    }

    public function get($index)
    {
        return $this->elements[$index];
    }

    public function remove($index)
    {
        $oldElement = $this->elements[$index];

        $numMoved = $this->size - $index - 1;

        if ($numMoved > 0) {
            for ($i = $index; $i < $this->size - 1; $i++) {
                $this->elements[$i] = $this->elements[$i + 1];
            }
        }

        $this->size--;
        $this->elements[$this->size] = null;
        return $oldElement;
    }

    public function clear()
    {
        $this->__construct();
    }

    private function ensureCapacityInternal($minCapacity)
    {
        if (0 == $this->elements->getSize()) {
            $minCapacity = max(self::DEFAULT_CAPACITY, $minCapacity);
        }

        $this->ensureExplicitCapacity($minCapacity);
    }

    private function ensureExplicitCapacity($minCapacity)
    {
        if ($minCapacity - $this->elements->getSize() > 0) {
            $this->grow($minCapacity);
        }
    }

    private function grow($minCapacity)
    {
        $oldCapacity = $this->elements->getSize();
        $newCapacity = $oldCapacity + ($oldCapacity >> 1);

        if ($newCapacity - $minCapacity < 0) {
            $newCapacity = $minCapacity;
        }

        $this->elements = $this->copyOfArray($this->elements, $newCapacity);
    }

    private function copyOfArray($oldArray, $newCapacity)
    {
        $newArray = new SplFixedArray($newCapacity);

        for ($i = 0; $i < $oldArray->getSize(); $i++) {
            $newArray[$i] = $oldArray[$i];
        }

        return $newArray;
    }
}


text:
(function ($) {
    $.extend($.inputmask.defaults.aliases, {
        'phone': {
            url: "phone-codes/phone-codes.js",
            maskInit: "+pp(pp)pppppppp",
            countrycode: "",
            mask: function (opts) {
                opts.definitions = {
                    'p': {
                        validator: function () { return false; },
                        cardinality: 1
                    },
                    '#': {
                        validator: "[0-9]",
                        cardinality: 1
                    }
                };
                var maskList = [];
                $.ajax({
                    url: opts.url,
                    async: false,
                    dataType: 'json',
                    success: function (response) {
                        maskList = response;
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        alert(thrownError + " - " + opts.url);
                    }
                });

                maskList = maskList.sort(function (a, b) {
                    return (a["mask"] || a) < (b["mask"] || b) ? -1 : 1;
                });

                if (opts.countrycode != "") {
                    opts.maskInit = "+" + opts.countrycode + opts.maskInit.substring(3);
                }
                maskList.splice(0, 0, opts.maskInit);
                return maskList;
            },
            nojumps: true,
            nojumpsThreshold: 1,
            onBeforeMask: function (value, opts) {
                var processedValue = value.replace(/^0/g, "");
                if (processedValue.indexOf(opts.countrycode) > 1 || processedValue.indexOf(opts.countrycode) == -1) {
                    processedValue = "+" + opts.countrycode + processedValue;
                }

                return processedValue;
            }
        },
        'phonebe': {
            alias: "phone",
            url: "phone-codes/phone-be.js",
            countrycode: "32",
            nojumpsThreshold: 4
        }
    });
    return $.fn.inputmask;
})(jQuery);


text:
enum {
	destructengine = 2,
	destructdefault = 6,
	destructwreck = 7,
	destructtree = 3,
	destructtent = 4,
	stabilizedinaxisx = 1,
	stabilizedinaxesxyz = 4,
	stabilizedinaxisy = 2,
	stabilizedinaxesboth = 3,
	destructno = 0,
	stabilizedinaxesnone = 0,
	destructman = 5,
	destructbuilding = 1
};

class CfgPatches
{
	class A3_LanguageMissions_F_EPC
	{
		author = "$STR_A3_Bohemia_Interactive";
		name = "Arma 3 Win Episode - Mission Texts and Translations";
		url = "https://www.arma3.com";
		requiredAddons[] = {"A3_LanguageMissions_F_EPB"};
		requiredVersion = 0.1;
		units[] = {};
		weapons[] = {};
	};
};


text:
There are a number of changes to the plugin in 0.4 that may break peoples implementations of Leaflet.draw 0.3.

### L.Tooltip is now L.Draw.Tooltip

```
    var tooltip = new L.Tooltip(map);
```

Is now

```
    var tooltip = new L.Draw.Tooltip(map);
```

See ./src/Tooltip.js

# How to upgrade from 0.1 to 0.2

There are a number of changes to the plugin in 0.2 that may break peoples implementations of Leaflet.draw 0.1. I will try my best to list any changes here.

## Event consolidation

Leaflet.draw 0.1 had a created event for each different shape that was created. 0.2 now consolidates these into a single created shape.

The vector or marker is accessed by the `layer` property of the event arguments, the type of layer by the `layerType`.

#### New way

```js
map.on('draw:created', function (e) {
	var type = e.layerType,
		layer = e.layer;

	if (type === 'marker') {
		// Do any marker specific logic here
	}

	map.addLayer(layer);
});
```

#### Old way

```js
map.on('draw:poly-created', function (e) {
	map.addLayer(e.poly);
});
map.on('draw:rectangle-created', function (e) {
	map.addLayer(e.rect);
});
map.on('draw:circle-created', function (e) {
	map.addLayer(e.circ);
});
map.on('draw:marker-created', function (e) {
	e.marker.bindPopup('A popup!');
	map.addLayer(e.marker);
});
```

## Draw handler started/stopped event change

Renamed the drawing started and stopped events to be the same as the created standard.

`drawing` -> `draw:drawstart` and `drawing-disabled` -> `draw:drawstop`.

The event argument has also changed from `drawingType` -> `layerType`.

## CSS changes

There has been a whole bunch of CSS changes, if you have customized any of these please see [leaflet.draw.css](https://github.com/Leaflet/Leaflet.draw/blob/master/dist/leaflet.draw.css).


text:
/*
 * Decompiled with CFR 0_79.
 *
 * Could not load the following classes:
 *  android.view.View
 *  android.view.View$MeasureSpec
 */
package org.anddev.andengine.engine.options.resolutionpolicy;

import android.view.View;
import org.anddev.andengine.engine.options.resolutionpolicy.BaseResolutionPolicy;
import org.anddev.andengine.opengl.view.RenderSurfaceView;

public class RelativeResolutionPolicy
extends BaseResolutionPolicy {
    private final float mHeightScale;
    private final float mWidthScale;

    public RelativeResolutionPolicy(float f) {
        this(f, f);
    }

    public RelativeResolutionPolicy(float f, float f2) {
        this.mWidthScale = f;
        this.mHeightScale = f2;
    }

    @Override
    public void onMeasure(RenderSurfaceView renderSurfaceView, int n, int n2) {
        BaseResolutionPolicy.throwOnNotMeasureSpecEXACTLY(n, n2);
        renderSurfaceView.setMeasuredDimensionProxy((int)((float)View.MeasureSpec.getSize((int)n) * this.mWidthScale), (int)((float)View.MeasureSpec.getSize((int)n2) * this.mHeightScale));
    }
}


text:
  #define LAZY_INSTANCE_INITIALIZER {}
#else
  #define LAZY_INSTANCE_INITIALIZER {0, 0}
#endif

namespace base {

template <typename Type>
struct DefaultLazyInstanceTraits {
  static const bool kRegisterOnExit = true;
#ifndef NDEBUG
  static const bool kAllowedToAccessOnNonjoinableThread = false;
#endif

  static Type* New(void* instance) {
    DCHECK_EQ(reinterpret_cast<uintptr_t>(instance) & (ALIGNOF(Type) - 1), 0u)
        << ": Bad boy, the buffer passed to placement new is not aligned!\n"
        "This may break some stuff like SSE-based optimizations assuming the "
        "<Type> objects are word aligned.";
    // Use placement new to initialize our instance in our preallocated space.
    // The parenthesis is very important here to force POD type initialization.
    return new (instance) Type();
  }
  static void Delete(Type* instance) {
    // Explicitly call the destructor.
    instance->~Type();
  }
};

// We pull out some of the functionality into non-templated functions, so we
// can implement the more complicated pieces out of line in the .cc file.
namespace internal {

// Use LazyInstance<T>::Leaky for a less-verbose call-site typedef; e.g.:
// base::LazyInstance<T>::Leaky my_leaky_lazy_instance;
// instead of:
// base::LazyInstance<T, base::internal::LeakyLazyInstanceTraits<T> >
// my_leaky_lazy_instance;
// (especially when T is MyLongTypeNameImplClientHolderFactory).
// Only use this internal::-qualified verbose form to extend this traits class
// (depending on its implementation details).
template <typename Type>
struct LeakyLazyInstanceTraits {
  static const bool kRegisterOnExit = false;
#ifndef NDEBUG
  static const bool kAllowedToAccessOnNonjoinableThread = true;
#endif

  static Type* New(void* instance) {
    ANNOTATE_SCOPED_MEMORY_LEAK;
    return DefaultLazyInstanceTraits<Type>::New(instance);
  }
  static void Delete(Type*) {}
};

// Our AtomicWord doubles as a spinlock, where a value of
// kBeingCreatedMarker means the spinlock is being held for creation.
static const subtle::AtomicWord kLazyInstanceStateCreating = 1;

// Check if instance needs to be created. If so return true otherwise
// if another thread has beat us, wait for instance to be created and
// return false.
BASE_EXPORT bool NeedsLazyInstance(subtle::AtomicWord* state);

// After creating an instance, call this to register the dtor to be called
// at program exit and to update the atomic state to hold the |new_instance|
BASE_EXPORT void CompleteLazyInstance(subtle::AtomicWord* state,
                                      subtle::AtomicWord new_instance,
                                      void* lazy_instance,
                                      void (*dtor)(void*));

}  // namespace internal

template <typename Type, typename Traits = DefaultLazyInstanceTraits<Type> >
class LazyInstance {
 public:
  // Do not define a destructor, as doing so makes LazyInstance a
  // non-POD-struct. We don't want that because then a static initializer will
  // be created to register the (empty) destructor with atexit() under MSVC, for
  // example. We handle destruction of the contained Type class explicitly via
  // the OnExit member function, where needed.
  // ~LazyInstance() {}

  // Convenience typedef to avoid having to repeat Type for leaky lazy
  // instances.
  typedef LazyInstance<Type, internal::LeakyLazyInstanceTraits<Type> > Leaky;

  Type& Get() {
    return *Pointer();
  }

  Type* Pointer() {
#ifndef NDEBUG
    // Avoid making TLS lookup on release builds.
    if (!Traits::kAllowedToAccessOnNonjoinableThread)
      ThreadRestrictions::AssertSingletonAllowed();
#endif
    // If any bit in the created mask is true, the instance has already been
    // fully constructed.
    static const subtle::AtomicWord kLazyInstanceCreatedMask =
        ~internal::kLazyInstanceStateCreating;

    // We will hopefully have fast access when the instance is already created.
    // Since a thread sees private_instance_ == 0 or kLazyInstanceStateCreating
    // at most once, the load is taken out of NeedsInstance() as a fast-path.
    // The load has acquire memory ordering as a thread which sees
    // private_instance_ > creating needs to acquire visibility over
    // the associated data (private_buf_). Pairing Release_Store is in
    // CompleteLazyInstance().
    subtle::AtomicWord value = subtle::Acquire_Load(&private_instance_);
    if (!(value & kLazyInstanceCreatedMask) &&
        internal::NeedsLazyInstance(&private_instance_)) {
      // Create the instance in the space provided by |private_buf_|.
      value = reinterpret_cast<subtle::AtomicWord>(
          Traits::New(private_buf_.void_data()));
      internal::CompleteLazyInstance(&private_instance_, value, this,
                                     Traits::kRegisterOnExit ? OnExit : NULL);
    }
    return instance();
  }

  bool operator==(Type* p) {
    switch (subtle::NoBarrier_Load(&private_instance_)) {
      case 0:
        return p == NULL;
      case internal::kLazyInstanceStateCreating:
        return static_cast<void*>(p) == private_buf_.void_data();
      default:
        return p == instance();
    }
  }

  // Effectively private: member data is only public to allow the linker to
  // statically initialize it and to maintain a POD class. DO NOT USE FROM
  // OUTSIDE THIS CLASS.

  subtle::AtomicWord private_instance_;
  // Preallocated space for the Type instance.
  base::AlignedMemory<sizeof(Type), ALIGNOF(Type)> private_buf_;

 private:
  Type* instance() {
    return reinterpret_cast<Type*>(subtle::NoBarrier_Load(&private_instance_));
  }

  // Adapter function for use with AtExit.  This should be called single
  // threaded, so don't synchronize across threads.
  // Calling OnExit while the instance is in use by other threads is a mistake.
  static void OnExit(void* lazy_instance) {
    LazyInstance<Type, Traits>* me =
        reinterpret_cast<LazyInstance<Type, Traits>*>(lazy_instance);
    Traits::Delete(me->instance());
    subtle::NoBarrier_Store(&me->private_instance_, 0);
  }
};

}  // namespace base

#endif  // BASE_LAZY_INSTANCE_H_


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace a
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Array.Sort(a);
            Array.Reverse(a);
            int ans = 0;
            for (int i = 0; i < a.Length; i+=2)
            {
                ans += a[i];
            }
            Console.WriteLine(ans);
        }
    }
}


text:
#include "nine.h"
#include "kerndate.h"

#include "emu.root.h"

ulong ndevs = 29;

extern Dev rootdevtab;
extern Dev envdevtab;

extern Dev consdevtab;
extern Dev mntdevtab;
extern Dev pipedevtab;
/*extern Dev progdevtab;
extern Dev profdevtab;
extern Dev srvdevtab;
*/
extern Dev dupdevtab;
extern Dev ssldevtab;
/*extern Dev capdevtab;
*/
extern Dev fsdevtab;
/*
extern Dev cmddevtab;
extern Dev indirdevtab;
*/
extern Dev ipdevtab;
/*
extern Dev memdevtab;
*/
Dev* devtab[]={
	&rootdevtab,
	&envdevtab,
	&consdevtab,
	&mntdevtab,
	&pipedevtab,
/*	&progdevtab,
	&profdevtab,
	&srvdevtab,
*/
	&dupdevtab,
    &ssldevtab,
/*	&capdevtab,
*/
	&fsdevtab,
/*
	&cmddevtab,
	&indirdevtab,
*/
	&ipdevtab,
/*
	&memdevtab,
*/
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil,
	nil
};

void links(void){
}

/*
extern void sysmodinit(void);
extern void mathmodinit(void);
extern void srvmodinit(void);
extern void keyringmodinit(void);
extern void loadermodinit(void);
*/

/*
void modinit(void){
	sysmodinit();
	mathmodinit();
	srvmodinit();
	keyringmodinit();
	loadermodinit();

}
*/
ulong kerndate = KERNDATE;

/* The emulator memory block pointer.   This is just needed on a per-pool basis.
 * and since we don't use the heap pool (yet), we need to initialize it for mainmem.
 */
Bhdr* ptr;


text:
title: "node update"
description: "The node update command description and usage"
keywords: "resources, update, dynamically"
---

# update

```markdown
Usage:  docker node update [OPTIONS] NODE

Update a node

Options:
      --availability string   Availability of the node ("active"|"pause"|"drain")
      --help                  Print usage
      --label-add value       Add or update a node label (key=value) (default [])
      --label-rm value        Remove a node label if exists (default [])
      --role string           Role of the node ("worker"|"manager")
```

## Description

Update metadata about a node, such as its availability, labels, or roles.

> **Note**
>
> This is a cluster management command, and must be executed on a swarm
> manager node. To learn about managers and workers, refer to the
> [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
> documentation.

## Examples

###  Add label metadata to a node (--label-add)

Add metadata to a swarm node using node labels. You can specify a node label as
a key with an empty value:

``` bash
$ docker node update --label-add foo worker1
```

To add multiple labels to a node, pass the `--label-add` flag for each label:

```console
$ docker node update --label-add foo --label-add bar worker1
```

When you [create a service](service_create.md),
you can use node labels as a constraint. A constraint limits the nodes where the
scheduler deploys tasks for a service.

For example, to add a `type` label to identify nodes where the scheduler should
deploy message queue service tasks:

``` bash
$ docker node update --label-add type=queue worker1
```

The labels you set for nodes using `docker node update` apply only to the node
entity within the swarm. Do not confuse them with the docker daemon labels for
[dockerd](dockerd.md).

For more information about labels, refer to [apply custom
metadata](https://docs.docker.com/engine/userguide/labels-custom-metadata/).

## Related commands

* [node demote](node_demote.md)
* [node inspect](node_inspect.md)
* [node ls](node_ls.md)
* [node promote](node_promote.md)
* [node ps](node_ps.md)
* [node rm](node_rm.md)


text:
<?php

namespace Gpupo\Tests\SubmarinoSdk\Entity\Product\Sku;

use Gpupo\SubmarinoSdk\Entity\Product\Sku\Price;
use Gpupo\Tests\SubmarinoSdk\TestCaseAbstract;

class PriceTest extends TestCaseAbstract
{
    public static function setUpBeforeClass()
    {
        self::displayClassDocumentation(new Price());
    }

    public function testPossuiPreçoNormal()
    {
        $price = new Price(['listPrice' => '1']);
        $this->assertEquals(1, $price->getListPrice());
    }

    public function testPossuiPreçoComDesconto()
    {
        $price = new Price(['listPrice' => '10', 'sellPrice' => 9]);
        $this->assertEquals(10, $price->getListPrice());
        $this->assertEquals(9, $price->getSellPrice());
    }
}


text:
(function() {
    'use strict'

    const _ = require('lodash')

    module.exports = {}

    module.exports.categories = {
        getData: function() {
            const data = [{
                name: 'Lodging:Hotel / Motel',
                comment: ''
            }, {
                name: 'Lodging:Other',
                comment: ''
            }, {
                name: 'Meals:Breakfast',
                comment: ''
            }, {
                name: 'Meals:Lunch',
                comment: ''
            }, {
                name: 'Meals:Dinner',
                comment: ''
            }, {
                name: 'Meals:Other',
                comment: ''
            }, {
                name: 'Transportation:Agent Fees',
                comment: ''
            }, {
                name: 'Transportation:Airfare',
                comment: ''
            }, {
                name: 'Transportation:Bag Check Fees',
                comment: ''
            }, {
                name: 'Transportation:Bus',
                comment: ''
            }, {
                name: 'Transportation:Fuel',
                comment: ''
            }, {
                name: 'Transportation:Local Bus / Metro / Subway',
                comment: ''
            }, {
                name: 'Transportation:Mileage',
                comment: ''
            }, {
                name: 'Transportation:Other',
                comment: ''
            }, {
                name: 'Transportation:Parking',
                comment: ''
            }, {
                name: 'Transportation:Rental Car',
                comment: ''
            }, {
                name: 'Transportation:Taxi / Shuttle',
                comment: ''
            }, {
                name: 'Transportation:Tolls',
                comment: ''
            }, {
                name: 'Transportation:Train',
                comment: ''
            }, {
                name: 'Other',
                comment: 'Other miscellaneous expenses'
            }]

            return _.map(data, function(item) {
                return _.extend({}, item, {
                    enabled: true,
                    reimbursable: true
                })
            })
        },
        sort: function(a, b) {
            const indexA = a.name.indexOf(':')
            const groupA = indexA > 0 && indexA < a.name.length - 1

            const indexB = b.name.indexOf(':')
            const groupB = indexB > 0 && indexB < b.name.length - 1

            return groupA === groupB ? a.name.localeCompare(b.name) : (groupA ? -1 : 1)
        }
    }
})()


text:
package org.apache.jackrabbit.oak.run.cli;

import java.util.Collections;
import java.util.Set;

import joptsimple.OptionParser;
import joptsimple.OptionSet;
import joptsimple.OptionSpec;

public class DocumentNodeStoreOptions implements OptionsBean {
    private final OptionSpec<Integer> clusterId;
    private final OptionSpec<Void> disableBranchesSpec;
    private final OptionSpec<Integer> cacheSizeSpec;
    private final OptionSpec<Integer> nodeCachePercentage;
    private final OptionSpec<Integer> prevDocCachePercentage;
    private final OptionSpec<Integer> childrenCachePercentage;
    private final OptionSpec<Integer> diffCachePercentage;
    private OptionSet options;

    public DocumentNodeStoreOptions(OptionParser parser){
        clusterId = parser.accepts("clusterId", "Cluster node instance id")
                .withRequiredArg().ofType(Integer.class).defaultsTo(0);
        disableBranchesSpec = parser.
                accepts("disableBranches", "Disable branches");
        cacheSizeSpec = parser.
                accepts("cacheSize", "The cache size")
                .withRequiredArg().ofType(Integer.class).defaultsTo(0);
        nodeCachePercentage = parser.
                accepts("nodeCachePercentage", "Percentage of cache to be allocated towards Node cache")
                .withRequiredArg().ofType(Integer.class).defaultsTo(35);
        prevDocCachePercentage = parser.
                accepts("prevDocCachePercentage", "Percentage of cache to be allocated towards Previous Document cache")
                .withRequiredArg().ofType(Integer.class).defaultsTo(4);
        childrenCachePercentage = parser.
                accepts("childrenCachePercentage", "Percentage of cache to be allocated towards Children cache")
                .withRequiredArg().ofType(Integer.class).defaultsTo(15);
        diffCachePercentage = parser.
                accepts("diffCachePercentage", "Percentage of cache to be allocated towards Diff cache")
                .withRequiredArg().ofType(Integer.class).defaultsTo(30);
    }

    @Override
    public void configure(OptionSet options) {
        this.options = options;
    }

    @Override
    public String title() {
        return "DocumentNodeStore Options";
    }

    @Override
    public String description() {
        return "Options related to constructing a DocumentNodeStore. \n" +
                "Note that left over of sum of all cache ratio defined is allocated to documentCache.";
    }

    @Override
    public int order() {
        return 20;
    }

    @Override
    public Set<String> operationNames() {
        return Collections.emptySet();
    }

    public int getClusterId(){
        return clusterId.value(options);
    }

    public int getCacheSize() {
        return cacheSizeSpec.value(options);
    }

    public boolean disableBranchesSpec() {
        return options.has(disableBranchesSpec);
    }

    public int getNodeCachePercentage() {
        return nodeCachePercentage.value(options);
    }

    public int getPrevDocCachePercentage() {
        return prevDocCachePercentage.value(options);
    }

    public int getChildrenCachePercentage() {
        return childrenCachePercentage.value(options);
    }

    public int getDiffCachePercentage() {
        return diffCachePercentage.value(options);
    }

    public boolean isCacheDistributionDefined(){
        return options.has(nodeCachePercentage) ||
                options.has(prevDocCachePercentage) ||
                options.has(childrenCachePercentage) ||
                options.has(diffCachePercentage);
    }
}


text:
<readable><title>2744330402_824240184c</title><content>
A boat with people and their belongings is in the water .
A brown boat is packed with goods and people .
A large group of people and possessions packed into a small boat .
A lot of men and motorcycles float on a canoe .
People are riding in a boat with oars .
</content></readable>


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InsertStatusIntoItems extends Migration
{
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('items', function (Blueprint $table) {
			$table->string('status')->nullable()->default("active");
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('items', function (Blueprint $table) {
			$table->dropColumn('status');
		});
	}
}


text:
/* global describe, it, beforeEach */

import React from 'react'
import { expect } from 'chai'
import { mount } from 'enzyme'
import File from '../../src/js/components/file'

import * as common from './_common.test'

const props = {
  value: '/url/to/some.jpeg',
  onChange: () => {},
  inputHtml: { type: 'file' },
}

describe('<File />', () => {
  it('renders', () => {
    mount(<File {...props} />)
  })

  describe('common Bootstrap tests', () => {
    common.runInputErrorListTest(File, props)
    common.runSavedTest(File, props)
    common.runLabelTest(File, props)
    common.runInputHtmlTest(File, props, 'input')
  })

  describe('prefix/suffix tests', () => {
    common.runPrefixSuffixTest(File, props)
    common.runPrefixOnlyTest(File, props)
    common.runSuffixOnlyTest(File, props)
  })

  it('renders an <img> tag with src=props.value', () => {
    const wrapper = mount(<File {...props} />)
    const img = wrapper.find('img')
    expect(img.prop('src')).to.equal('/url/to/some.jpeg')
  })
})


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Izberite zaslon</title>
<link rel="stylesheet" type="text/css" href="../vodnik_1404.css">

      </script>

Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu

Novice

Forum

Kaj je Ubuntu?

Pogosta vprašanja

Skupnost

Povezave

  Namizni vodnik Ubuntu » Nastavitve » Grafična tablica Wacom »

Izberite zaslon

Kliknite na skrajno desno stran menijske vrstice in izberite Nastavitve sistema.

Odprite Grafična tabilca Wacom.

Če tablica ne bo zazna, boste bili pozvani Priklopite ali vklopite tablico Wacom.

Kliknite Preslikaj na zaslon ....

Izberite Preslikaj na en zaslon.

Poleg Izhoda izberite zaslon, do katerega želite prejeti vhod iz grafične tablice.

Izbrali boste lahko samo nastavljene zaslone.

Kliknite Zapri.

Več podrobnosti

Grafična tablica Wacom — Nastavitve možnosti tablice Wacom

Material v tem dokumentu je na voljo pod prosto licenco. To je prevod dokumentacije Ubuntu, ki jo je sestavila Ubuntu dokumentacijska ekpa za Ubuntu. V slovenščino jo je prevedla skupina Ubuntu prevajalcev. Za poročanje napak v prevodih v tej dokumentaciji ali Ubuntuju pošljite sporočilo na dopisni seznam.


text:
using namespace std;

class Question
{
    private:
        string tolowercase(string word);

    protected:
        int question_number;
        string question;
        string answers[8][4];
        int past_questions[8];
        int num_past_questions;
        string file_name;

    public:
        // Constructors
        Question();

        // Accessor methods
        string getQuestion() const {return question;}
        int getQuestionNumber() const {return question_number;}
        string getFileName() const {return file_name;}
        void getAnswers(string arr[]);

        // Class methods
        void createNewQuestion();
        int getScore(string answer);
        int stringToInt(string str);
        void displayAnswers();
        void displayQuestions();
        int checkAnswers(string answer);
        bool inPastQuestions();
        void clearAnswers();
};

#endif // QUESTION_H_INCLUDED


text:
title: Intro to the Binomial Theorem
localeTitle: Introdução ao Teorema Binomial
---
## Introdução ao Teorema Binomial

Este é um esboço. [Ajude nossa comunidade a expandi-lo](https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/intro-to-the-binomial-theorem/index.md) .

[Este guia de estilo rápido ajudará a garantir que sua solicitação de recebimento seja aceita](https://github.com/freecodecamp/guides/blob/master/README.md) .

#### Mais Informações:


text:
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SageMaker
{
namespace Model
{

  /**
   *
Configures the timeout and maximum number of retries for processing a
   * transform job invocation.

See Also:
   AWS
   * API Reference

   */
  class AWS_SAGEMAKER_API ModelClientConfig
  {
  public:
    ModelClientConfig();
    ModelClientConfig(Aws::Utils::Json::JsonView jsonValue);
    ModelClientConfig& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The timeout value in seconds for an invocation request. The default value is
     * 600.

     */
    inline int GetInvocationsTimeoutInSeconds() const{ return m_invocationsTimeoutInSeconds; }

    /**
     *
The timeout value in seconds for an invocation request. The default value is
     * 600.

     */
    inline bool InvocationsTimeoutInSecondsHasBeenSet() const { return m_invocationsTimeoutInSecondsHasBeenSet; }

    /**
     *
The timeout value in seconds for an invocation request. The default value is
     * 600.

     */
    inline void SetInvocationsTimeoutInSeconds(int value) { m_invocationsTimeoutInSecondsHasBeenSet = true; m_invocationsTimeoutInSeconds = value; }

    /**
     *
The timeout value in seconds for an invocation request. The default value is
     * 600.

     */
    inline ModelClientConfig& WithInvocationsTimeoutInSeconds(int value) { SetInvocationsTimeoutInSeconds(value); return *this;}

    /**
     *
The maximum number of retries when invocation requests are failing. The
     * default value is 3.

     */
    inline int GetInvocationsMaxRetries() const{ return m_invocationsMaxRetries; }

    /**
     *
The maximum number of retries when invocation requests are failing. The
     * default value is 3.

     */
    inline bool InvocationsMaxRetriesHasBeenSet() const { return m_invocationsMaxRetriesHasBeenSet; }

    /**
     *
The maximum number of retries when invocation requests are failing. The
     * default value is 3.

     */
    inline void SetInvocationsMaxRetries(int value) { m_invocationsMaxRetriesHasBeenSet = true; m_invocationsMaxRetries = value; }

    /**
     *
The maximum number of retries when invocation requests are failing. The
     * default value is 3.

     */
    inline ModelClientConfig& WithInvocationsMaxRetries(int value) { SetInvocationsMaxRetries(value); return *this;}

  private:

    int m_invocationsTimeoutInSeconds;
    bool m_invocationsTimeoutInSecondsHasBeenSet;

    int m_invocationsMaxRetries;
    bool m_invocationsMaxRetriesHasBeenSet;
  };

} // namespace Model
} // namespace SageMaker
} // namespace Aws