text:
package org.jetbrains.plugins.scala.extensions.implementation

import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.extensions.implementation.iterator._
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile

/**
 * Pavel Fatin
 */

trait PsiElementExtTrait extends Any {
  protected def repr: PsiElement

  def text: String = repr.getText
  def firstChild: Option[PsiElement] = Option(repr.getFirstChild)
  def lastChild: Option[PsiElement] = Option(repr.getLastChild)
  def elementAt(offset: Int): Option[PsiElement] = Option(repr.findElementAt(offset))
  def referenceAt(offset: Int): Option[PsiReference] = Option(repr.findReferenceAt(offset))
  def parent: Option[PsiElement] = Option(repr.getParent)
  def parents: Iterator[PsiElement] = new ParentsIterator(repr)
  def withParents: Iterator[PsiElement] = new ParentsIterator(repr, strict = false)

  def containingFile: Option[PsiFile] = Option(repr.getContainingFile)
  def psiManager: PsiManager = repr.getManager

  def parentsInFile: Iterator[PsiElement] = {
    repr match {
      case _: PsiFile | _: PsiDirectory => Iterator.empty
      case _ => parents.takeWhile(!_.isInstanceOf[PsiFile])
    }
  }

  def withParentsInFile: Iterator[PsiElement] = Iterator(repr) ++ parentsInFile

  def contexts: Iterator[PsiElement] = new ContextsIterator(repr)

  def getPrevSiblingNotWhitespace: PsiElement = {
    var prev: PsiElement = repr.getPrevSibling
    while (prev != null && (prev.isInstanceOf[PsiWhiteSpace] ||
            prev.getNode.getElementType == ScalaTokenTypes.tWHITE_SPACE_IN_LINE)) prev = prev.getPrevSibling
    prev
  }

  def getPrevSiblingNotWhitespaceComment: PsiElement = {
    var prev: PsiElement = repr.getPrevSibling
    while (prev != null && (prev.isInstanceOf[PsiWhiteSpace] ||
            prev.getNode.getElementType == ScalaTokenTypes.tWHITE_SPACE_IN_LINE || prev.isInstanceOf[PsiComment]))
      prev = prev.getPrevSibling
    prev
  }

  def getPrevSiblingCondition(condition: PsiElement => Boolean, strict: Boolean = true): Option[PsiElement] = {
    if (!strict && condition(repr)) return Some(repr)
    var prev: PsiElement = PsiTreeUtil.prevLeaf(repr)
    while (prev != null && !condition(prev)) {
      prev = prev.getPrevSibling
    }
    Option(prev)
  }

  def getNextSiblingNotWhitespace: PsiElement = {
    var next: PsiElement = repr.getNextSibling
    while (next != null && (next.isInstanceOf[PsiWhiteSpace] ||
            next.getNode.getElementType == ScalaTokenTypes.tWHITE_SPACE_IN_LINE)) next = next.getNextSibling
    next
  }

  def getNextSiblingNotWhitespaceComment: PsiElement = {
    var next: PsiElement = repr.getNextSibling
    while (next != null && (next.isInstanceOf[PsiWhiteSpace] ||
            next.getNode.getElementType == ScalaTokenTypes.tWHITE_SPACE_IN_LINE || next.isInstanceOf[PsiComment]))
      next = next.getNextSibling
    next
  }

  def prevSibling: Option[PsiElement] = Option(repr.getPrevSibling)
  def nextSibling: Option[PsiElement] = Option(repr.getNextSibling)

  def prevSiblings: Iterator[PsiElement] = new PrevSiblignsIterator(repr)

  def nextSiblings: Iterator[PsiElement] = new NextSiblignsIterator(repr)

  // Element + Prev. siblings
  def prevElements: Iterator[PsiElement] = new PrevElementsIterator(repr)

  // Element + Next siblings
  def nextElements: Iterator[PsiElement] = new NextElementsIterator(repr)

  def children: Iterator[PsiElement] = new ChildrenIterator(repr)

  def isAncestorOf(e: PsiElement) = PsiTreeUtil.isAncestor(repr, e, true)

  def depthFirst: Iterator[PsiElement] = depthFirst(DefaultPredicate)

  def depthFirst(predicate: PsiElement => Boolean): Iterator[PsiElement] =
    new DepthFirstIterator(repr, predicate)

  def breadthFirst: Iterator[PsiElement] = breadthFirst(DefaultPredicate)

  def breadthFirst(predicate: PsiElement => Boolean): Iterator[PsiElement] =
    new BreadthFirstIterator(repr, predicate)

  def isScope: Boolean = ScalaPsiUtil.isScope(repr)

  def scopes: Iterator[PsiElement] = contexts.filter(ScalaPsiUtil.isScope)

  def containingScalaFile: Option[ScalaFile] = repr.getContainingFile match {
    case sf: ScalaFile => Some(sf)
    case _ => None
  }

  def append(elements: PsiElement*): Seq[PsiElement] = addElementsAfter(repr, elements: _*)

  def prepend(elements: PsiElement*): Seq[PsiElement] = addElementsBefore(repr, elements: _*)

  def addElementsAfter(anchor: PsiElement, elements: PsiElement*): Seq[PsiElement] = {
    val p = repr.getParent
    elements.scanLeft(anchor)((acc, e) => p.addAfter(e, acc)).tail
  }

  def addElementsBefore(anchor: PsiElement, elements: PsiElement*): Seq[PsiElement] = {
    val p = repr.getParent
    elements.scanRight(anchor)((e, acc) => p.addAfter(e, acc)).reverse.tail
  }
}


text:
@extends('_5_view_concoction')

@section('view_concoction_content')

		<?php echo $selected_concoction->title; ?>

	<?php
		if ($selected_concoction->image_file_name != ""){
			echo "image_file_name . "' width=200>";
		} else {
			echo "";
		}
	?>
	<?php
	  	if ($selected_concoction->user_made_this == 1){
	  		echo "I made this!
";
	  	}
	?>

	  <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
	    Options

	  </button>

<a role="menuitem" tabindex="-1"
	    	href= <?php echo "/edit-concoction/" . $selected_concoction->id; ?>>Edit concoction

<a role="menuitem" tabindex="-1"
	    	href= <?php echo "/delete-concoction/" . $selected_concoction->id; ?>>Delete concoction

		Reference Link:

		<?php
		$reference_link = $selected_concoction->reference_link;
		if ($reference_link == null || $reference_link == ""){
			echo "None";
		} else {
			echo "" . $reference_link . "";
		}
		?>

		Ingredients:

<?php echo $selected_concoction->ingredients; ?>

		Directions:

<?php echo $selected_concoction->directions; ?>

		Tags:
		<?php
		$tags = $selected_concoction->tags;
		if (count($tags) == 0){
			echo "None";
		} else {
			$tag_names = array();
	  		foreach ($tags as $tag) {
		  		array_push($tag_names, $tag->name);
		  	}
		  	echo join(", ", $tag_names);
		}
		?>

@stop

redpajama_set_name: RedPajamaGithub


text:
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\widgets\ActiveForm;
use backend\models\Locations;
use kartik\select2\Select2;

/* @var $this yii\web\View */
/* @var $model backend\models\Customers */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'customer_name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'zip_code')->widget(Select2::classname(), [
            'data' => ArrayHelper::map(Locations::find()->all(), 'location_id', 'zip_code'),
            'options' => ['placeholder' => 'Select a Zip Code ...', 'id'=>'zipCode'],
        ]);
    ?>

    <?= $form->field($model, 'city')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'province')->textInput(['maxlength' => true]) ?>

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>

<?php
$script = <<< JS
// javascript stuff goes here
$('#zipCode').change(function(){
	var zipId = $(this).val();
	$.get('http://localhost/yii2/backend/web/index.php/locations/get-city-province', { zipId: zipId }, function(data){
		var data = $.parseJSON(data);
		$('#customers-city').val(data.city);
		$('#customers-province').val(data.province);
	});
});
JS;
$this->registerJs($script);
?>


text:
#include "cmsis.h"
#include "mbed_error.h"

void mbed_sdk_init(void)
{
    // NOTE: Support singleton semantics to be called from other init functions
    static int inited = 0;
    if (inited) {
        return;
    }
    inited = 1;

    SystemCoreClockUpdate();
}


text:
<?php

namespace Behat\Mink\Driver;

use Behat\Mink\Driver\Goutte\Client as ExtendedClient;
use Goutte\Client;

/**
 * Goutte driver.
 *
 * @author Konstantin Kudryashov <ever.zet@gmail.com>
 */
class GoutteDriver extends BrowserKitDriver
{
    /**
     * Initializes Goutte driver.
     *
     * @param Client $client Goutte client instance
     */
    public function __construct(Client $client = null)
    {
        parent::__construct($client ?: new ExtendedClient());
    }

    /**
     * {@inheritdoc}
     */
    public function setBasicAuth($user, $password)
    {
        if (false === $user) {
            $this->getClient()->resetAuth();

            return;
        }

        $this->getClient()->setAuth($user, $password);
    }

    /**
     * Gets the Goutte client.
     *
     * The method is overwritten only to provide the appropriate return type hint.
     *
     * @return Client
     */
    public function getClient()
    {
        return parent::getClient();
    }

    /**
     * {@inheritdoc}
     */
    public function reset()
    {
        parent::reset();
        $this->getClient()->resetAuth();
    }

    /**
     * {@inheritdoc}
     */
    protected function prepareUrl($url)
    {
        return $url;
    }
}


text:
package com.alrokayan.fix.arabic.iPhoneUTF8;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

import android.app.*;
import android.content.*;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.ClipboardManager;
import android.view.*;
import android.widget.*;
import android.util.Log;

public class ArabicFixForiPhoneActivity extends Activity implements Runnable {
	EditText ArabicString = null;
	LinearLayout MainLayout = null;
	LinearLayout TextLinearLayout = null;
	LinearLayout ButtonLinearLayout = null;
	Button mButton_Convert = null;
	Button mButton_Clear_n_Past = null;

	String CorrectionForiPhone = "";
	String Squares = "";

	String UnSupportedHexs = " ";
	ArrayList<Character> UnSupportedChars = new ArrayList<Character>();
	int UnSupportedCharsCount = 0;

	Context c = this;

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

		MainLayout = new LinearLayout(this);
		TextLinearLayout = new LinearLayout(this);
		ButtonLinearLayout = new LinearLayout(this);

		ArabicString = new EditText(this);
		ArabicString.setText("");
		ArabicString.setGravity(Gravity.TOP);
		ArabicString.setLayoutParams(new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT,1));
		TextLinearLayout.addView(ArabicString);

		mButton_Convert = new Button(this);
		mButton_Convert.setText("تصحيح ونسخ");
		mButton_Convert.setLayoutParams(new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT,1));
		ButtonLinearLayout.addView(mButton_Convert);
		mButton_Convert.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				try {
					convert();
				} catch (UnsupportedEncodingException e) {
					e.printStackTrace();
				}
			}
		});

		mButton_Clear_n_Past = new Button(this);
		mButton_Clear_n_Past.setText("مسح المحتوى ثم لصق");
		mButton_Clear_n_Past.setLayoutParams(new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT,1));
		ButtonLinearLayout.addView(mButton_Clear_n_Past);
		mButton_Clear_n_Past.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
				ArabicString.setText(clipboard.getText());

				Context context = getApplicationContext();
				CharSequence text = "تم اللصق";
				int duration = Toast.LENGTH_SHORT;
				Toast toast = Toast.makeText(context, text, duration);
				toast.show();
			}
		});

		MainLayout.setOrientation(LinearLayout.VERTICAL);
		TextLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT,1));
		MainLayout.addView(ButtonLinearLayout);
		MainLayout.addView(TextLinearLayout);
		setContentView(MainLayout);
	}

	private ProgressDialog pd;

	public void convert() throws UnsupportedEncodingException{

		pd = ProgressDialog.show(this, "جاري التصحيح ...", "الرجاء الإنتظار..", true, false);

		Squares = ArabicString.getText().toString();

		Thread thread = new Thread(this);
		thread.start();
	}

	@Override
	public void run() {

		Log.d("convert function", "BEFORE: "+Squares);
		Log.d("convert function", getUTF8(Squares));

		CorrectionForiPhone = "";

		for(int i=0; i< Squares.length(); i++)
		{
			String UTF8Hex = UnicodeFormatter.charToHex(Squares.charAt(i));

			if(UTF8Hex.startsWith("FE"))
			{
				if(UTF8Hex.charAt(2) == '8')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u0621"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u0622"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u0622"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u0623"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u0623"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u0624"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u0624"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u0625"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u0625"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u0626"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u0626"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u0626"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u0626"; continue;}

					if(UTF8Hex.charAt(3) == 'D')
					{CorrectionForiPhone+="\u0627"; continue;}

					if(UTF8Hex.charAt(3) == 'E')
					{CorrectionForiPhone+="\u0627"; continue;}

					if(UTF8Hex.charAt(3) == 'F')
					{CorrectionForiPhone+="\u0628"; continue;}
				}

				if(UTF8Hex.charAt(2) == '9')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u0628"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u0628"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u0628"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u0629"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u0629"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u062A"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u062A"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u062A"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u062A"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u062B"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u062B"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u062B"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u062B"; continue;}

					if(UTF8Hex.charAt(3) == 'D')
					{CorrectionForiPhone+="\u062C"; continue;}

					if(UTF8Hex.charAt(3) == 'E')
					{CorrectionForiPhone+="\u062C"; continue;}

					if(UTF8Hex.charAt(3) == 'F')
					{CorrectionForiPhone+="\u062C"; continue;}
				}

				if(UTF8Hex.charAt(2) == 'A')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u062C"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u062D"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u062D"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u062D"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u062D"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u062E"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u062E"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u062E"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u062E"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u062F"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u062F"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u0630"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u0630"; continue;}

					if(UTF8Hex.charAt(3) == 'D')
					{CorrectionForiPhone+="\u0631"; continue;}

					if(UTF8Hex.charAt(3) == 'E')
					{CorrectionForiPhone+="\u0631"; continue;}

					if(UTF8Hex.charAt(3) == 'F')
					{CorrectionForiPhone+="\u0632"; continue;}
				}

				if(UTF8Hex.charAt(2) == 'B')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u0632"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u0633"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u0633"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u0633"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u0633"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u0634"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u0634"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u0634"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u0634"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u0635"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u0635"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u0635"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u0635"; continue;}

					if(UTF8Hex.charAt(3) == 'D')
					{CorrectionForiPhone+="\u0636"; continue;}

					if(UTF8Hex.charAt(3) == 'E')
					{CorrectionForiPhone+="\u0636"; continue;}

					if(UTF8Hex.charAt(3) == 'F')
					{CorrectionForiPhone+="\u0636"; continue;}
				}

				if(UTF8Hex.charAt(2) == 'C')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u0636"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u0637"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u0637"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u0637"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u0637"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u0638"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u0638"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u0638"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u0638"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u0639"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u0639"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u0639"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u0639"; continue;}

					if(UTF8Hex.charAt(3) == 'D')
					{CorrectionForiPhone+="\u063A"; continue;}

					if(UTF8Hex.charAt(3) == 'E')
					{CorrectionForiPhone+="\u063A"; continue;}

					if(UTF8Hex.charAt(3) == 'F')
					{CorrectionForiPhone+="\u063A"; continue;}
				}

				if(UTF8Hex.charAt(2) == 'D')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u063A"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u0641"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u0641"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u0641"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u0641"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u0642"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u0642"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u0642"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u0642"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u0643"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u0643"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u0643"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u0643"; continue;}

					if(UTF8Hex.charAt(3) == 'D')
					{CorrectionForiPhone+="\u0644"; continue;}

					if(UTF8Hex.charAt(3) == 'E')
					{CorrectionForiPhone+="\u0644"; continue;}

					if(UTF8Hex.charAt(3) == 'F')
					{CorrectionForiPhone+="\u0644"; continue;}
				}

				if(UTF8Hex.charAt(2) == 'E')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u0644"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u0645"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u0645"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u0645"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u0645"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u0646"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u0646"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u0646"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u0646"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u0647"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u0647"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u0647"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u0647"; continue;}

					if(UTF8Hex.charAt(3) == 'D')
					{CorrectionForiPhone+="\u0648"; continue;}

					if(UTF8Hex.charAt(3) == 'E')
					{CorrectionForiPhone+="\u0648"; continue;}

					if(UTF8Hex.charAt(3) == 'F')
					{CorrectionForiPhone+="\u0649"; continue;}
				}

				if(UTF8Hex.charAt(2) == 'F')
				{
					if(UTF8Hex.charAt(3) == '0')
					{CorrectionForiPhone+="\u0649"; continue;}

					if(UTF8Hex.charAt(3) == '1')
					{CorrectionForiPhone+="\u064A"; continue;}

					if(UTF8Hex.charAt(3) == '2')
					{CorrectionForiPhone+="\u064A"; continue;}

					if(UTF8Hex.charAt(3) == '3')
					{CorrectionForiPhone+="\u064A"; continue;}

					if(UTF8Hex.charAt(3) == '4')
					{CorrectionForiPhone+="\u064A"; continue;}

					if(UTF8Hex.charAt(3) == '5')
					{CorrectionForiPhone+="\u0644"+"\u0622"; continue;}

					if(UTF8Hex.charAt(3) == '6')
					{CorrectionForiPhone+="\u0644"+"\u0622"; continue;}

					if(UTF8Hex.charAt(3) == '7')
					{CorrectionForiPhone+="\u0644"+"\u0623"; continue;}

					if(UTF8Hex.charAt(3) == '8')
					{CorrectionForiPhone+="\u0644"+"\u0623"; continue;}

					if(UTF8Hex.charAt(3) == '9')
					{CorrectionForiPhone+="\u0644"+"\u0625"; continue;}

					if(UTF8Hex.charAt(3) == 'A')
					{CorrectionForiPhone+="\u0644"+"\u0625"; continue;}

					if(UTF8Hex.charAt(3) == 'B')
					{CorrectionForiPhone+="\u0644"+"\u0627"; continue;}

					if(UTF8Hex.charAt(3) == 'C')
					{CorrectionForiPhone+="\u0644"+"\u0627"; continue;}
				}

			}

			// Restore preferences
			SharedPreferences settings = getPreferences(0);
			Boolean ShowMessage = settings.getBoolean("ShowMessage", true);

			if(ShowMessage && UTF8Hex.compareToIgnoreCase("FB50")>0 && UTF8Hex.compareToIgnoreCase("FDFF")<0)
			{
				char UnSupportedChar = UnicodeFormatter.HexToChar(UTF8Hex);

				if(!UnSupportedChars.contains(UnSupportedChar))
				{
					UnSupportedHexs+=UTF8Hex+" ";
					UnSupportedChars.add(UnSupportedChar);
					UnSupportedCharsCount++;
				}
			}

			if(ShowMessage && UTF8Hex.compareToIgnoreCase("FE81")>0 && UTF8Hex.compareToIgnoreCase("FEFD")<0)
			{
				char UnSupportedChar = UnicodeFormatter.HexToChar(UTF8Hex);

				if(!UnSupportedChars.contains(UnSupportedChar))
				{
					UnSupportedHexs+=UTF8Hex+" ";
					UnSupportedChars.add(UnSupportedChar);
					UnSupportedCharsCount++;
				}
			}

			CorrectionForiPhone+=Squares.charAt(i);
		}

		Log.d("convert function", "UnSupportedCharsCount: "+UnSupportedCharsCount);
		Log.d("convert function", "UnSupportedHexs: "+UnSupportedHexs);
		Log.d("convert function", "UnSupportedChars: "+UnSupportedChars);
		Log.d("convert function", "AFTER: "+CorrectionForiPhone);
		Log.d("convert function", getUTF8(CorrectionForiPhone));

		ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
		clipboard.setText(CorrectionForiPhone);

		handler.sendEmptyMessage(0);

		Log.d("convert function", "Your Text WAS: "+Squares+"\nAnd Now Become: "+CorrectionForiPhone);
	}

	private Handler handler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			pd.dismiss();
			CharSequence text = "تم النسخ";
			int duration = Toast.LENGTH_SHORT;
			Toast toast = Toast.makeText(c, text, duration);
			toast.show();
			ArabicString.setText(CorrectionForiPhone);

			// Restore preferences
			SharedPreferences settings = getPreferences(0);
			Boolean ShowMessage = settings.getBoolean("ShowMessage", true);

			if(UnSupportedCharsCount>0 && ShowMessage)
			{
				String UnSupportedCharsString = "";
				for (char UnSupportedChar : UnSupportedChars) {
					UnSupportedCharsString+= " "+UnSupportedChar;
				}
				String Message="تم النسخ، لكن هناك بعض الحروف غير مدعومه .. هل تود إبلاغ المبرمج عن هذه الحروف ليتم تصحيحها في الإصدار القادم؟ ";
				final String ToDevMessage = "Version: 1.4\nUnSupportedCharsCount: "+UnSupportedCharsCount+"\nUnSupportedHexs: "+UnSupportedHexs+"\nUnSupportedCharsString: "+UnSupportedCharsString;

				new AlertDialog.Builder(c)
				.setTitle("خطأ بسيط")
				.setMessage(Message)
				.setPositiveButton("لا تزعجنا بهالرساله", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						// We need an Editor object to make preference changes.
						// All objects are from android.context.Context
						SharedPreferences settings = getPreferences(0);
						SharedPreferences.Editor editor = settings.edit();
						editor.putBoolean("ShowMessage", false);

						// Commit the edits!
						editor.commit();

						CharSequence text = "خلاص ماراح تشوف هالرساله";
						int duration = Toast.LENGTH_SHORT;
						Toast toast = Toast.makeText(c, text, duration);
						toast.show();
					}
				})
				.setNeutralButton("لاحقا", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						//Nothing
					}
				})
				.setNegativeButton("نعم", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
						String aEmailList[] = { "support@alrokayan.com" };
						emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);
						emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Andriod Arabic Fix - v1.4");
						emailIntent.setType("plain/text");
						emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, ToDevMessage);
						startActivity(Intent.createChooser(emailIntent, "إرسال إيميل عن طريق:"));
					}
				})

				.show();
			}

		}
	};

	public static String getUTF8(String string) {
		String result = "";
		for (int k = 0; k < string.length(); k++) {
			String subresult = "Char: " + string.charAt(k) + " UTF-8 HEX: " + UnicodeFormatter.charToHex(string.charAt(k));
			System.out.println(subresult);
			result+=subresult;
		}
		return result;
	}
}

class UnicodeFormatter {
	static public String charToHex(char c) {
		// Returns hex String representation of char c
		byte hi = (byte) (c >>> 8);
		byte lo = (byte) (c & 0xff);
		return byteToHex(hi) + byteToHex(lo);
	}

	static public String byteToHex(byte b) {
		// Returns hex String representation of byte b
		char hexDigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',
				'B', 'C', 'D', 'E', 'F' };
		char[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };
		return new String(array);
	}

	static public char HexToChar(String hex)
	{
		Log.d("convert function", "HEX: "+hex);
		int i= Integer.parseInt(hex,16);
		Log.d("convert function", "Decimal: "+i);
		char c = (char)i;
		Log.d("convert function", "Char is: "+c);
		return c;
	}

} // class


text:
Disclaimer: This is not an official Google product.

Copyright 2018 Google Inc.

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

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

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

## (SV)CCA for Representational Insights in Deep Neural Networks

This repository contains code and [jupyter notebook tutorials](https://github.com/google/svcca/tree/master/tutorials) on results in the following papers, as well as suggested extensions and open problems.
1. ["SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability"](https://arxiv.org/abs/1706.05806). _Neural Information Processing Systems (NeurIPS) 2017_
2. ["Insights on Representational Similarity in Deep Neural Networks with Canonical Correlation"](https://arxiv.org/abs/1806.05759). _Neural Information Processing Systems (NeurIPS) 2018_

### Code Structure and Usage
The [tutorials](https://github.com/google/svcca/tree/master/tutorials) overview all of the main scripts, provide an example implementation of SVCCA, and also discuss existing applications and new directions.

The main script is [cca_core](https://github.com/google/svcca/blob/master/cca_core.py) which can be used to compute CCA between two neural networks and outputs both the CCA correlation coefficients as well as the CCA directions. The CCA for Conv Layers tutorial outlines applications to convolutional layers.

Aside from this main script, implementations of _Partial Least Squares_, [numpy_pls.py](https://github.com/google/svcca/blob/master/numpy_pls.py) and PCA, [numpy_pca.py](https://github.com/google/svcca/blob/master/numpy_pca.py) are also provided. These methods are overviewed in the Other Methods Tutorial.

### Results from the Papers

#### Learning Dynamics
In both papers, we studied the per-layer learning dynamics: how different layers in a network converge through training. For both convolutional networks and recurrent neural networks, we found that lower layers tend to converge faster than higher layers. This means that not all layers need to be trained all the way through training. We can save ccomputation and prevent overfitting by consecutively freezing layers -- _freeze training_. Preliminary experiments support the effectiveness of freeze training, but there are many open questions (different architectures, varying learning rates) to explore further.

The figures above show results for conv/resnets and language models on PTB and WikiText-2. This method also highlights other structural properties of the architecture. The 2x2 blocks in the conv net are caused by batch norm layers, which are representationally identical to the previous layer. We also see that residual layers in the resnet create grid like patterns, having higher representational similarity with previous layers.

#### Generalizing and Memorizing Networks
Following the experiment proposed in [Zhang et. al](https://arxiv.org/abs/1611.03530) we trained networks as normal on CIFAR-10 (generalizing networks), and on a fixed permutation of labels on CIFAR-10 (memorizing networks.) We then applied (PW)CCA to measure the layerwise similarity between (1) the group of generalizing networks (2) the group of memorizing networks (3) between generalizing and memorizing networks. In earlier layers, all three groups are about at similar. In higher (deeper) layers however, we see that (1) is much more similar than (2). Interestingly, (3) is _as similar as_ (2) -- surprising as the two sets of networks are trained on different tasks!

#### Interpreting the Latent Representations
While most of the results so far have focused on comparing two layers with CCA, we can also use it to compare the similarity between an intermediate vector, and a ground truth output vector, corresponding to a particular class. We perform this experiment with a subset of Imagenet classes (firetruck, husky, eskimo dog, two terriers) on the Imagenet Resnet. CCA similarity highlights differences between classes that are easier to learn -- learned much earlier in the network -- (e.g. firetruck) and harder classes, only learned much later on (e.g. husky).

### References

If you use this code, please consider citing either or both of the following papers:

    @incollection{NIPS2017_7188,
    title = {SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability},
    author = {Raghu, Maithra and Gilmer, Justin and Yosinski, Jason and Sohl-Dickstein, Jascha},
    booktitle = {Advances in Neural Information Processing Systems 30},
    editor = {I. Guyon and U. V. Luxburg and S. Bengio and H. Wallach and R. Fergus and S. Vishwanathan and R. Garnett},
    pages = {6076--6085},
    year = {2017},
    publisher = {Curran Associates, Inc.},
    url = {http://papers.nips.cc/paper/7188-svcca-singular-vector-canonical-correlation-analysis-for-deep-learning-dynamics-and-interpretability.pdf}
    }

    @incollection{NIPS2018_7815,
    title = {Insights on representational similarity in neural networks with canonical correlation},
    author = {Morcos, Ari and Raghu, Maithra and Bengio, Samy},
    booktitle = {Advances in Neural Information Processing Systems 31},
    editor = {S. Bengio and H. Wallach and H. Larochelle and K. Grauman and N. Cesa-Bianchi and R. Garnett},
    pages = {5732--5741},
    year = {2018},
    publisher = {Curran Associates, Inc.},
    url = {http://papers.nips.cc/paper/7815-insights-on-representational-similarity-in-neural-networks-with-canonical-correlation.pdf}
    }


text:
__author__ = 'David Oreper'

class FilterCriteria:
    def __init__(self,):
        pass

    def matches(self, aPerson):
        return True

class KeyMatchesCriteria(FilterCriteria):
    def __init__(self, expectedValue):
        FilterCriteria.__init__(self)
        self.expectedValue = expectedValue or ""

    def _matches(self, actualValue):
        return actualValue.lower() == self.expectedValue.lower()

class ProductCriteria(KeyMatchesCriteria):
    def matches(self, aPerson):
        return self._matches(aPerson.getProduct())

class FunctionalGroupCriteria(KeyMatchesCriteria):
    def matches(self, aPerson):
        return self._matches(aPerson.getFunction())

class FeatureTeamCriteria(KeyMatchesCriteria):
    def matches(self, aPerson):
        return self._matches(aPerson.getFeatureTeam())

class LocationCriteria(KeyMatchesCriteria):
    def matches(self, aPerson):
        return self._matches(aPerson.getLocation())

class CostCenterCriteria(KeyMatchesCriteria):
    def matches(self, aPerson):
        return self._matches(aPerson.getCostCenter())

class ManagerCriteria(FilterCriteria):
    def __init__(self, manager):
        FilterCriteria.__init__(self)
        self.manager = manager

    def matches(self, aPerson):
        personManager = aPerson.getManagerFullName()

        # Do explicit checks to make sure the manager field is populated before evaluating to avoid case
        # where person has no manager set and falsely matches because manager we're checking has one of these
        # fields empty
        if self.manager:
            if self.manager.getFullName() and (personManager == self.manager.getFullName()):
                return True
            if self.manager.getRawName() and (personManager == self.manager.getRawName()):
                return True
            if self.manager.getNormalizedRawName() and (personManager == self.manager.getNormalizedRawName()):
                return True

            if self.manager.getRawNickName():
                if personManager == self.manager.getPreferredName():
                    return True
            return False

        return not personManager

class ManagerEmptyCriteria(FilterCriteria):
    def __init__(self):
        FilterCriteria.__init__(self)

    def matches(self, aPerson):
        personManager = aPerson.getManagerFullName().lower().strip()

        if personManager == "" or personManager == "tbd":
            return True

        return False

class IsInternCriteria(FilterCriteria):
    def __init__(self, isIntern):
        FilterCriteria.__init__(self)
        self.isIntern = isIntern

    def matches(self, aPerson):
        return aPerson.isIntern() == self.isIntern

class IsExpatCriteria(FilterCriteria):
    def __init__(self, isExpat):
        FilterCriteria.__init__(self)
        self.isExpat = isExpat

    def matches(self, aPerson):
        return aPerson.isExpat() == self.isExpat

class IsTBHCriteria(FilterCriteria):
    def __init__(self, isTBH):
        FilterCriteria.__init__(self)
        self.isTBH = isTBH

    def matches(self, aPerson):
        return aPerson.isTBH() == self.isTBH

class IsProductManagerCriteria(FilterCriteria):
    def __init__(self, isProductManager):
        FilterCriteria.__init__(self)
        self.isProductManager = isProductManager

    def matches(self, aPerson):
        return aPerson.isProductManager() == self.isProductManager

class IsCrossFuncCriteria(FilterCriteria):
    def __init__(self, isCrossFunc):
        FilterCriteria.__init__(self)
        self.isCrossFunc = isCrossFunc

    def matches(self, aPerson):
        return aPerson.isCrossFunc() == self.isCrossFunc

class IsManagerCriteria(FilterCriteria):
    def __init__(self, isManager):
        FilterCriteria.__init__(self)
        self.isManager = isManager

    def matches(self, aPerson):
        return aPerson.isManager() == self.isManager


text:
{% extends 'global/base.html' %}
{% load i18n static %}

{% block menu %}{% endblock %}
{% block title %}{% trans "Django Girls Impact Report 2016-2017" %}{% endblock %}
{% block description %}{% trans "Thanks to the organizers, coaches, and volunteers in countries all over the world, 2016-2017 was an absolutely incredible year for Django Girls. Read all about our challenges and achievements from 2016-2017." %}{% endblock %}
{% block og_title %}{% trans "Django Girls Impact Report 2016-2017" %}{% endblock %}
{% block og_description %}{% trans "Thanks to the organizers, coaches, and volunteers in countries all over the world, 2016-2017 was an absolutely incredible year for Django Girls. Read all about our challenges and achievements from 2016-2017." %}{% endblock %}
{% block og_image %}https://djangogirls.org/static/img/report-2015/report.jpg{% endblock %}

{% block extra_js %}{% endblock %}

{% block content %}

{% trans "Impact Report 2016-2017" %}

                  {% blocktrans trimmed %}
                   Django Girls Foundation is an initiative that aims to introduce women and girls who never coded before
                   to the world of technology and increase the diversity of the tech industry. We achieve this by organising
                   one-day workshops and inviting women to come and learn how to build the internet using HTML, CSS, Python and Django.
                   Django Girls is a volunteer run organisation with volunteers all over the world. Django Girls has two part-time paid staff
                   members and the support team (six awesome ladies who are also volunteers) to help provide support to all other volunteers.
                  {% endblocktrans %}

                 {% blocktrans trimmed %}
                   This Impact Report aims to celebrate achievements of the Django Girls community in the past two years, and showcase
                   the incredible growth of the organization. For the first time ever, we're also presenting results of a survey
                   we conducted with almost 600 past Django Girls attendees to see if Django Girls Foundation actually achieves
                   the goal of our mission: to bring more women into tech industry!
                 {% endblocktrans %}

{% trans "✨ Highlights ✨" %}

                    {% blocktrans trimmed %}
                      👭👫👬 Django Girls community grew to 1069 volunteers who have organised 377 free workshops with 102 more being currently planned. That's more than 3000 hours of happy coding!
                    {% endblocktrans %}

                    {% blocktrans trimmed %}
                      👩💻 21% of participants in our survey started working in tech after attending Django Girls workshop. 👉
                    {% endblocktrans %}

                    {% blocktrans trimmed %}
                      💯 In the last 2 years we improved our tools to support the growth of the organisation, maintended our free online resources (our tutorial is now in 14 languages!), started Django Girls Store as a fundraising effort, shipped 146 organizer kits and more.  👉
                    {% endblocktrans %}

                    {% blocktrans trimmed %}
                      📈🎉 In July 2017, on our 3rd birthday, we also celebrated our 10,000th workshop attendee 👉
                    {% endblocktrans %}

                    {% blocktrans trimmed %}
                      🎓 We learned that 79% of Django Girls alumnis are still learning programming after the workshop. 👉
                    {% endblocktrans %}

                    {% blocktrans trimmed %}
                      📚 693,524 people used our free online tutorial in the last year
                    {% endblocktrans %}

{% trans "Growth 📈" %}

              {% trans "Map of Django Girls event from July 2014 to July 2017" %}

                    {% trans "2014-2015" %}
                    {% trans "2015-2016" %}
                    {% trans "2016-2017" %}

{% trans "Number of Django Girls workshops" %}	51	122	188

{% trans "Number of participants" %}	1681	4129	~4373*

{% trans "Number of cities" %}	42	102	163

{% trans "Number of new cities" %}	-	79	108

{% trans "Number of countries" %}	26	48	54

{% trans "Number of new countries" %}	-	28	13

{% trans "Unique users reading our Tutorial" %}	73,392	313,064	693,524

              {% trans "* Gathering events data on number of participants is delayed." %}

{% trans "Foundation's Activities 👩💻👩💻👩💻" %}

{% trans "🌎 Maintenance & translation of our free online resources" %}

                          {% blocktrans trimmed %}
                            The curriculum we developed Django Girls Tutorial is used in our workshops to introduce attendees to web development
                            using Python and Django. The tutorial has been published online for free to allow everyone to learn without the need
                            to attend an in-person workshop.
 We are proud that the tutorial has been now translated into 14 languages
                            We are thankful to all the volunteers who have made this possible.
                          {% endblocktrans %}

                          {% blocktrans trimmed %}
                            The popularity of the online tutorial keeps growing significantly faster than our in-person workshops.
                            In the second year it gained a 328.95% increase in the number of unique users who used the tutorial,
                            and 121.53% increase in the last year. Since the tutorial as been published, it's been read by
                            1,068,995 of people!
                          {% endblocktrans %}

                        <video style="width: 100%; margin-top: 120px;" autoplay loop>
                          <source src="https://s3-us-west-2.amazonaws.com/djangogirls/workshop_box.mp4" type="video/mp4">
                          {% trans "Your browser does not support the video tag." %}
                        </video>

{% trans "🎁 Organiser Starter Kits" %}

                          {% blocktrans trimmed %}
                            We realised that there are certain things such as room decorations and swag (stickers, buttons and tattoos)
                            that are needed by all event organisers. We lowered the costs of decorations and swag for each event
                            by ordering them in bulk from suppliers and stock them in the Django Girls shop. Organisers then order
                            the Organizer Starter Kit from our shop for a small donation, and we donated a number of them to events
                            organised in developing countries. We are super excited that we managed to
                            introduce the Django Girls Starter Kit in 2016.
                          {% endblocktrans %}

                          {% blocktrans trimmed %}
                            Since the introduction, 146 events have received their starter kits which has helped them make their events awesome!
                            Out of those, 28 were donated for free for events in need.
                          {% endblocktrans %}

{% trans "💰 Fundraising" %}

                          {% blocktrans trimmed %}
                            Most of our funds were generated through corporate and individual donations through Patreon, an online
                            donation management system. In 2016, we also managed to introduce Django Girls shop where we sell swag
                            such as t-shirts, socks and tote bags as a way of making the charity sustainable. Details of how much
                            was raised in 2016 are shown in the table below:
                          {% endblocktrans %}

                              {% trans "Activity" %}
                              {% trans "Amount" %}
                              {% trans "Notes" %}

{% trans "Patreon donations" %}	$12,546.71	{% trans "Patreon donation have been steadly decreasing in the last months" %}

{% trans "Django Girls Store" %}	£7,258.00

{% trans "Organiser Starter Kits" %}	£701.80

{% trans "Participants Survey" %}

              {% blocktrans trimmed %}
                We have celebrated reaching our milestone of 10,000 workshop participants by conducting a survey to see
                how Django Girls alumni are doing after attending the workshop in their city. We reached out to our former
                attendees and received an overwhelming response from 519 awesome women who shared with us their experiences
                with Django Girls and how attending the workshop changed their lives.
              {% endblocktrans %}

              {% blocktrans trimmed %}
                The ages of the respondents ranged from 14 to 65 years, with 71% being under the age of 30.
                This shows that Django Girls workshops are open and welcoming to women and girls irrespective of their age,
                as long they have an interest in technology and learning programming
              {% endblocktrans %}

              {% blocktrans trimmed %}
                We'd like to acknowledge that even though the total number of responses
                received is a significant representative sample of the Django Girls alumni, it is likely that most
                of the women who responded to our survey stayed active in the tech industry after attending our workshops
                and hence the results could be positively skewed.
              {% endblocktrans %}

{% trans "Participants' Involvement in Tech Activities" %}

                      {% blocktrans trimmed %}
                        We asked the respondents if they were involved in tech-related activities after the workshop.
                        The tech activities included attending tech events, organising Django Girls and similar tech events,
                        coaching at Django Girls workshops, teaching or working in tech, working on coding projects and enrolling
                        for programming courses.
                      {% endblocktrans %}

                      {% trans "We were excited to learn that 73% of the respondents are still involved tech-related activities after the event." %}

                    <canvas id="involvement-chart"></canvas>

                      {% blocktrans trimmed %}
                        These statistics show that our workshops are generating interest in technology and programming
                        in the participants who attends them. This interest then results in them organising other
                        workshops and tech events as well as attending tech events for some of the women. These findings
                        prove that Django Girls workshops have been a successful intervention to
                        increase the number of women involved in engineering and programming.
                      {% endblocktrans %}

{% trans "Participants' learning to code after the workshop" %}

                    <canvas id="learning-chart"></canvas>

                      {% trans "We were also interested in finding out whether our former participants continued learning programming after attending the workshop." %}

                      {% blocktrans trimmed %}
                        79% of women attending Django Girls workshop continued learning programming after and 7% were planning to continue learning
                      {% endblocktrans %}

                      {% blocktrans trimmed %}
                        1% of participants had tried and given up while 13% had not continued learning programming after the workshop.
                      {% endblocktrans %}

                      {% blocktrans trimmed %}
                        The findings showed that the majority of the women who attend Django Girls workshops continue learning to code after.
                        The women continued learning in various ways; some on their own, enrolling for online coding courses or enrolling into universities.
                        These findings show that Django Girls is indeed increasing the number of women in the programming field, who will one
                        day be employed as programmers after they have developed their programming skills.
                      {% endblocktrans %}

{% trans "Participants' Employment in Tech after attending workshops" %}

                    <canvas id="employment-chart"></canvas>

                      {% blocktrans trimmed %}
                        The biggest question we were interested to answer was to know how many of the women started working in tech as
                        developers after attending the workshop.
                      {% endblocktrans %}

                        {% trans "We were impressed to learn that 21% of Django Girls' former attendees are now hired as developers after attending the workshop!" %}

                      {% blocktrans trimmed %}
                        It was also interesting to note that 15% of the attendees of were already working in tech and hence their
                        newly acquired skills made their jobs better. About 23% had not yet got jobs as developers but were still
                        developing their skills so they could get jobs in the future while the remaining 40% had not got tech jobs
                        and did not indicate their future plans.
                      {% endblocktrans %}

                      {% blocktrans trimmed %}
                        This further affirmed that our work has had positive results in the lives of women we introduced to coding
                        as well as the tech industry that hires these women. We are proud that at least 109 women now work as
                        developers after attending the workshop. This is a big achievement which we are happy about!
                      {% endblocktrans %}

{% trans "Impact of Django Girls workshops on Participants' lives" %}

                    <canvas id="impact-chart"></canvas>

                      {% blocktrans trimmed %}
                        We were also interested in learning other ways the participants had been impacted by attending a Django Girls workshop.
                      {% endblocktrans %}

                        {% trans "The survey showed that 93% of the participants had been impacted positively in different ways." %}

                      {% blocktrans trimmed %}
                        The survey showed that about 43% had been inspired by meeting other women in tech resulting in them becoming more involved
                        in tech by organising tech events and attending other tech events. Many of these women were so inspired to learn that the
                        tech industry and programming are for women as well.
                      {% endblocktrans %}

                      {% blocktrans trimmed %}
                        About 25% had been excited that learnt new knowledge about technology, programming and web development;
                        gained experienced and experienced personal growth. About 14% of the participants had been happy to have
                        been able to meet new friends and new connections within the tech industry whom they have kept in touch
                        with since the workshop. About 11% of the participants had changed their career path and became interested
                        in a career in the tech industry prompting them to continue learning to code so they could one day become
                        developers. Only 7% said there was no remarkable impact on their lives due to participation in the workshop.
                      {% endblocktrans %}

{% trans "Summary" %}

              {% blocktrans trimmed %}
                The findings show that Django Girls has been successful in inspiring women to fall in love with
                programming as participants are exposed to women who are in the programming discipline within
                their own communities. The friendly environment that Django Girls workshops provide enables
                women who have never programmed before to learn to code and thereby arousing interest in tech
                and causing many of these women to work towards a career change and aim to be employed in the tech
                industry. The friendly environment also creates an atmosphere for making new friends and creating
                new network connections, fostering the beauty of the Django community which strives to be welcoming and diverse.
              {% endblocktrans %}

#IAmDjangoGirl

                {% blocktrans trimmed %}
                  On our third birthday, we asked our Twitter community to tell us about the ways Django Girls
                  impacted their lives. The response we received was overwhelmingly positive:
                {% endblocktrans %}

#IAmADjangoGirl Thanks to Django Girls, I carved out a whole new career & life for myself, and met some amazing people along the way! 🎉🎉
— Jen (@OuiDoll) July 21, 2017

HBDay to #DjangoGirls ! Its been an amazing journey with folks here in Korea.6 workshops already held and 1 more on the way #IAmADjangoGirl pic.twitter.com/qMy4Xn4vfu
— Hassan Abid (하산) (@hassanabidpk) July 21, 2017

🎉 Y'all!! I used to be an awesome English teacher but now, because of @djangogirls, I'm an awesome django developer. #IAmADjangoGirl ❤ pic.twitter.com/3C15jLGFeg
— Rachell (@Rachell_Calhoun) July 21, 2017

From trainee @ home, coach two times and organizer once. I can tell you that @djangogirls changed my life in many good ways #IAmADjangoGirl pic.twitter.com/MbUuN5bc0R
— Jessica Temporal (@jesstemporal) July 21, 2017

Thanks to @djangogirls I became more self-confident and learned that you don't need super powers to change the world  #IAmADjangoGirl pic.twitter.com/5xVJ58TwEH
— Ola Sendecka (@asendecka) July 21, 2017

Happy 3rd birthday to @djangogirls! I feel amazingly lucky to have been a part of @DjangoGirlsPDX for the past 2 years. 🙌💕 #IAmADjangoGirl pic.twitter.com/g4512ebKgl
— Terian 💀💾🌸 (@spine_cone) July 21, 2017

🎂 3 years ago I attended @djangogirls and it was the kickstart of my new awesome life as a programmer + many other things 🎈 #IAmADjangoGirl pic.twitter.com/6GIcYq0ftP
— Dori Czapari (@doriczapari) July 21, 2017

#IAmADjangoGirl  Thanks to djangogirls I participated in some beautiful workshops and I met new friends. pic.twitter.com/h4oEFCGbKz
— Fiorella de luca (@fiorella_deluca) July 21, 2017

The decision 2 organize d 1st @DjangoGirlsLAG was 1 of the best I ever made. I am grateful 4 d experience HBD @djangogirls #IAmADjangoGirl
— Aisha Bello #PyConNG (@AishaXBello) July 21, 2017

Thank you@AishaXBello @DjangoGirlsLAG @djangogirls. Because of y'all, programming became my thing #IAmADjangoGirl
— Hamdalah (@GeekHijabi) July 21, 2017

Organising & coaching with @djangogirls has brought so many amazing opportunities and wonderful people into my life! #IAmADjangoGirl 🎂🎈💙💜🦋
— Helen ST 🚲💚 (@helenst) July 21, 2017

Three years ago I attended the @djangogirls workshop and now I'm working as Python dev. I've learnt so much thanks to you! #IAmADjangoGirl pic.twitter.com/vKbfczTZ6X
— Agatku (@AgataGrdal) July 21, 2017

Attending Django Girls Ota changed my mind of Women in STEM. Now I do all I can to encourage more Women/Girls into STEM. #Iamadjangogirl pic.twitter.com/qJc3lzCKiw
— Ada Lilian Oragudosi (@Oragudosi_Ada) July 21, 2017

#IAmADjangoGirl. I started contributing to organize Django Girls events in Italy in 2015 and I'm proud I met so many passionate women! pic.twitter.com/sPrHSqPXrc
— Laura Bartoli (@LauraCelesteBar) July 21, 2017

Django Girls helped me out to go back to the time when I used to code as a hobby ❤ #IAmADjangoGirl #Happybday pic.twitter.com/lfrpcUYESq
— Paula Côrte Real (@paulacortereal) July 21, 2017

I organized two @djangogirls Brazil and it was amazing to see the smiles and lives that changed! Happy B-day! #IAmADjangoGirl
— Leticia Portella (@leleportella) July 21, 2017

Happy birthday @djangogirls 1st attended @DjangoGirlsPyUK then organised two @DjangoGirlsMcr organising third & more to come #IAmADjangoGirl pic.twitter.com/agwL42er1a
— le (@lwyso) July 21, 2017

Thank you @djangogirls for giving me the confidence to become a developer and  to run workshops to help others do the same! #IAmADjangoGirl pic.twitter.com/ALL3beAIK4
— 🥞Päivi ✨ (@peconias) July 21, 2017

@djangogirls taught me  a lot of being confident and awesome :).   Happy birthday ^^ #IAmADjangoGirl pic.twitter.com/smm5Nwwqb7
— Aina Anjary Fenomamy (@anjania_catus) July 21, 2017

                      <big>{% trans "See more success stories" %} 👉</big>

{% trans "Sponsors 📢" %}

                {% blocktrans trimmed %}
                  Again, we would like to thank amazing sponsors of Django Girls and of the individual Django Girls workshops all over the world.
                  They help us make Django Girls sustainable and more importantly, they help local organizers keep their events free.
                  We want Django Girls to be accessible to many people as possible, and that couldn't happen without them.
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  Known for Elasticsearch, Kibana, Beats, and Logstash, Elastic creates products to to search, analyze, and visualize your data,
                  allowing you to get actionable insight in real time. Before becoming one of our biggest sponsors, they also sponsored several local events. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  The Django Software Foundation (DSF) is a non-profit organization created to promote, support, and advance the development of Django.
                  They've helped many Django Girls events that had problems finding local sponsors. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  The Python Software Foundation (PSF) is a non-profit organization that holds the intellectual property rights behind the Python programming language.
                  They are one of the biggest sponsors for local events. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  GitHub is a Git repository hosting service. They have sponsored many Django Girls events, and they provide useful materials for new learners
                  like cheat-sheets. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  Divio, that created Django CMS and Aldryn, uses Python and Django to provide support for website installation, maintenance, troubleshooting, and development.
                  They sponsored many local events and joined as Patreon supporters in June 2015. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  Lincoln Loop is a full service web studio offering user experience and development based on the Django Web Framework.
                  They joined our Patreon campaign in April 2015, and have contributed to local events. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  Since May, Django Girls has been hosted on PythonAnywhere! They host, run, and code Python in the cloud, and have made the lives of our
                  attendees much easier by being really simple and pleasant to use. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  Mandrill is a transactional email platform from MailChimp. They'vebeen supporting our emails since September 2015 and have also
                  sponsored local events. Thanks <3
                {% endblocktrans %}

                {% blocktrans trimmed %}
                  We would also like to thank our regular donors from Patreon: your commitment to help us every month is amazing. Thanks <3
                {% endblocktrans %}

{% endblock %}


text:
package com.orientechnologies.orient.core.sql.functions.conversion;

import com.orientechnologies.common.log.OLogManager;
import com.orientechnologies.orient.core.command.OCommandContext;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.sql.method.misc.OAbstractSQLMethod;
import com.orientechnologies.orient.core.util.ODateHelper;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * Transforms a value to date. If the conversion is not possible, null is returned.
 *
 * @author Johann Sorel (Geomatys)
 * @author Luca Garulli (l.garulli--(at)--orientdb.com)
 */
public class OSQLMethodAsDate extends OAbstractSQLMethod {

  public static final String NAME = "asdate";

  public OSQLMethodAsDate() {
    super(NAME, 0, 0);
  }

  @Override
  public String getSyntax() {
    return "asDate()";
  }

  @Override
  public Object execute(
      Object iThis,
      OIdentifiable iCurrentRecord,
      OCommandContext iContext,
      Object ioResult,
      Object[] iParams) {
    if (iThis != null) {
      if (iThis instanceof Date) {
        Calendar cal = new GregorianCalendar();
        cal.setTime((Date) iThis);
        cal.set(Calendar.HOUR, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
      } else if (iThis instanceof Number) {
        Date val = new Date(((Number) iThis).longValue());
        Calendar cal = new GregorianCalendar();
        cal.setTime(val);
        cal.set(Calendar.HOUR, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
      } else {
        try {
          return ODateHelper.getDateFormatInstance(ODatabaseRecordThreadLocal.instance().get())
              .parse(iThis.toString());
        } catch (ParseException e) {
          OLogManager.instance().error(this, "Error during %s execution", e, NAME);
        }
      }
    }
    return null;
  }
}


text:
#if !defined(BOOST_SPIRIT_LEX_TEST_MAR_23_2007_0721PM)
#define BOOST_SPIRIT_LEX_TEST_MAR_23_2007_0721PM

#include <boost/variant.hpp>
#include <boost/range/iterator_range.hpp>

namespace spirit_test
{
    ///////////////////////////////////////////////////////////////////////////
    struct display_type
    {
        template<typename T>
        void operator()(T const &) const
        {
            std::cout << typeid(T).name() << std::endl;
        }

        template<typename T>
        static void print()
        {
            std::cout << typeid(T).name() << std::endl;
        }
    };

    ///////////////////////////////////////////////////////////////////////////
    display_type const display = {};

    ///////////////////////////////////////////////////////////////////////////
    template <typename Iterator>
    inline boost::iterator_range<Iterator> const&
    get_iterpair(boost::iterator_range<Iterator> const& itp)
    {
        return itp;
    }

    template <typename Iterator, BOOST_VARIANT_ENUM_PARAMS(typename T)>
    inline boost::iterator_range<Iterator> const&
    get_iterpair(boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& v)
    {
        return boost::get<boost::iterator_range<Iterator> >(v);
    }

    ///////////////////////////////////////////////////////////////////////////
    template <typename Lexer, typename Char>
    inline bool
    test(Lexer& lex, Char const* input, std::size_t token_id = 0,
        Char const* state = NULL)
    {
        typedef typename Lexer::iterator_type iterator_type;
        typedef std::basic_string<Char> string_type;

        string_type str(input);
        typename string_type::iterator it = str.begin();

        iterator_type first = lex.begin(it, str.end());
        iterator_type last = lex.end();

        bool r = true;

        if (NULL != state) {
            std::size_t stateid = lex.map_state(state);
            r = r && (static_cast<unsigned>(~0) != stateid);
            first.set_state(stateid);
        }

        r = r && lex;
        r = r && first != last;

        if (token_id != 0)
            r = r && (*first).id() == token_id;
        else
            r = r && (*first).id() != 0;

        using namespace boost;

        typedef typename Lexer::iterator_type::base_iterator_type iterator;
        typedef iterator_range<iterator> iterpair_type;
        iterpair_type const& ip = get_iterpair<iterator>((*first).value());

        r = r && string_type(ip.begin(), ip.end()) == str;
        return r && first != last && ++first == last;
    }
}

#endif


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Shapes;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.IO;
using System.Diagnostics;
using System.Windows.Navigation;
using System.Windows.Input;

namespace ExampleAppWPF
{
    class MyPinCreationDetailsView : Control
    {
        private IntPtr m_nativeCallerPointer;
        private MainWindow m_currentWindow;

        protected Image m_takePhotoButton = null;
        protected Button m_selectFromGalleryButton = null;
        protected Button m_submitButton = null;
        protected Button m_closeButton = null;
        protected Image m_poiImage = null;
        protected TextBox m_title = null;
        protected TextBox m_description = null;
        protected CheckBox m_shouldShareButton = null;
        protected TextBlock m_termsAndConditionsLink = null;
        protected ScrollViewer m_scrollSection = null;

        private byte[] m_imageBuffer = null;
        private Uri m_currentImageUri = null;

        private int JPEG_QUALITY = 90;
        private string TERMS_AND_CONDITIONS_LINK = "http://eegeo.com/tos";

        private ImageSource m_prevSource;

        private System.Windows.Documents.Hyperlink m_tosLink;

        private MyPinCreationDetailsTutorialDialogBox m_tutorialDialogBox;
        private Button m_tutorialCancelButton;
        private int m_tutorialViewCount = 0;
        private double m_tutorialTopMargin = 0;

        private bool m_isInKioskMode;

        static MyPinCreationDetailsView()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(MyPinCreationDetailsView), new FrameworkPropertyMetadata(typeof(MyPinCreationDetailsView)));
        }

        public MyPinCreationDetailsView(IntPtr nativeCallerPointer, Boolean isInKioskMode)
        {
            m_nativeCallerPointer = nativeCallerPointer;
            m_isInKioskMode = isInKioskMode;

            m_currentWindow = (MainWindow)Application.Current.MainWindow;
            m_currentWindow.MainGrid.Children.Add(this);

            Visibility = Visibility.Hidden;
        }

        void Destroy()
        {
            m_closeButton.Click -= OnCloseClick;
            m_selectFromGalleryButton.Click -= OnSelectFromGalleryClick;
            m_submitButton.Click -= OnSubmitClick;
            m_tosLink.Click -= OnHyperlinkClick;
            m_description.ManipulationBoundaryFeedback -= OnDescriptionViewBoundaryFeedback;

            m_currentWindow.MainGrid.Children.Remove(this);

            RemoveTutorialDialog();
        }

        private DependencyObject CheckAndGetProperty(string name)
        {
            var prop = GetTemplateChild(name);
            System.Diagnostics.Debug.Assert(prop != null, "Property cannot be found!!");
            return prop;
        }

        public override void OnApplyTemplate()
        {
            m_title = CheckAndGetProperty("TitleBox") as TextBox;
            m_description = CheckAndGetProperty("DescBox") as TextBox;
            m_shouldShareButton = CheckAndGetProperty("ToShare") as CheckBox;
            m_submitButton = CheckAndGetProperty(m_isInKioskMode ? "ConfirmKioskButton" : "ConfirmButton") as Button;
            m_selectFromGalleryButton = CheckAndGetProperty("AddImageButton") as Button;
            m_poiImage = CheckAndGetProperty("SelectedImage") as Image;
            m_tosLink = CheckAndGetProperty("TermsLink") as System.Windows.Documents.Hyperlink;

            m_prevSource = m_poiImage.Source;

            m_closeButton = CheckAndGetProperty(m_isInKioskMode ? "CloseKioskButton" : "CloseButton") as Button;
            m_closeButton.Click += OnCloseClick;
            m_selectFromGalleryButton.Click += OnSelectFromGalleryClick;
            m_submitButton.Click += OnSubmitClick;
            m_tosLink.Click += OnHyperlinkClick;

            m_description.ManipulationBoundaryFeedback += OnDescriptionViewBoundaryFeedback;

            Thickness detailsViewMargin = (Thickness)Application.Current.Resources["PinCreationDetailsMargin"];
            if (detailsViewMargin != null)
            {
                m_tutorialTopMargin = detailsViewMargin.Top;
            }
        }

        private void OnDescriptionViewBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
        {
            e.Handled = true;
        }

        private void OnHyperlinkClick(object sender, RoutedEventArgs e)
        {
            Process.Start(new ProcessStartInfo("http://www.eegeo.com/tos/"));
            e.Handled = true;
        }

        private void OnSelectFromGalleryClick(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();

            dlg.Filter = "Image Files(*.bmp;*.jpg;*.jpeg;*.png)|*.bmp;*.jpg;*.jpeg;*.png";

            var result = dlg.ShowDialog();

            if(result == System.Windows.Forms.DialogResult.OK)
            {
                string filename = dlg.FileName;

                try
                {
                    m_imageBuffer = System.IO.File.ReadAllBytes(filename);
                    m_poiImage.Source = new BitmapImage(new Uri(filename));
                }
                catch(System.IO.IOException ex)
                {
                    m_imageBuffer = null;
                    return;
                }
                catch(NotSupportedException ex)
                {
                    m_imageBuffer = null;
                    return;
                }
            }
        }

        private void OnSubmitClick(object sender, RoutedEventArgs e)
        {
            if(m_isInKioskMode && m_tutorialViewCount == 0)
            {
                ++m_tutorialViewCount;
                ShowTutorialDialog();
            }
            else
            {
                ExampleApp.MyPinCreationDetailsViewCLI.SubmitButtonpressed(m_nativeCallerPointer);
            }
        }

        private void OnCloseClick(object sender, RoutedEventArgs e)
        {
            ExampleApp.MyPinCreationDetailsViewCLI.CloseButtonPressed(m_nativeCallerPointer);
        }

        public void Show()
        {
            Visibility = Visibility.Visible;
            m_currentWindow.DisableInput();

            m_title.Text = string.Empty;
            m_description.Text = string.Empty;
            m_shouldShareButton.IsChecked = false;
            m_poiImage.Source = m_prevSource;
            m_imageBuffer = null;
        }

        public void Dismiss()
        {
            Visibility = Visibility.Hidden;
            m_currentWindow.EnableInput();

            RemoveTutorialDialog();
        }

        private void ShowTutorialDialog()
        {
            Dismiss();

            m_tutorialDialogBox = new MyPinCreationDetailsTutorialDialogBox("Pin Created", "Your pin has been created.");
            m_tutorialDialogBox.Owner = m_currentWindow;
            Point pos = m_currentWindow.PointToScreen(new Point((m_currentWindow.ActualWidth - m_tutorialDialogBox.Width) / 2, m_tutorialTopMargin));
            m_tutorialDialogBox.Left = pos.X;
            m_tutorialDialogBox.Top = pos.Y;
            m_tutorialDialogBox.Show();

            m_tutorialCancelButton = (Button)m_tutorialDialogBox.FindName("CancelButton");
            m_tutorialCancelButton.Click += CancelTutorialDialog;
        }

        private void CancelTutorialDialog(object sender, EventArgs e)
        {
            ExampleApp.MyPinCreationDetailsViewCLI.SubmitButtonpressed(m_nativeCallerPointer);

            RemoveTutorialDialog();
        }

        private void RemoveTutorialDialog()
        {
            if (m_tutorialCancelButton != null)
            {
                m_tutorialCancelButton.Click -= CancelTutorialDialog;
                m_tutorialCancelButton = null;
            }

            if (m_tutorialDialogBox != null)
            {
                m_tutorialDialogBox.Close();
                m_tutorialDialogBox = null;
            }
        }

        public void ResetTutorialViewCount()
        {
            m_tutorialViewCount = 0;
        }

        public string GetTitle()
        {
            if (m_title.Text.Length > 0)
            {
                return m_title.Text;
            }

            return "Untitled";
        }

        public string GetDescription()
        {
            return m_description.Text;
        }

        public bool GetShouldShare()
        {
            if (m_shouldShareButton.IsChecked == null)
                return false;
            else
                return (bool)m_shouldShareButton.IsChecked;

        }

        public byte[] GetImageBuffer()
        {
            return m_imageBuffer;
        }

        public int GetImageBufferSize()
        {
            return m_imageBuffer == null ? 0 : m_imageBuffer.Length;
        }
    }
}


text:
<?php

require_once('config.php');

$result = api_query("marketorders", array("marketid" => 26));

echo "<pre>".print_r($result, true)."</pre>";

?>


text:
// .NAME vtkCell - abstract class to specify cell behavior
// .SECTION Description
// vtkCell is an abstract class that specifies the interfaces for data cells.
// Data cells are simple topological elements like points, lines, polygons,
// and tetrahedra of which visualization datasets are composed. In some
// cases visualization datasets may explicitly represent cells (e.g.,
// vtkPolyData, vtkUnstructuredGrid), and in some cases, the datasets are
// implicitly composed of cells (e.g., vtkStructuredPoints).
//
// .SECTION Caveats
// The \#define VTK_CELL_SIZE is a parameter used to construct cells and provide
// a general guideline for controlling object execution. This parameter is
// not a hard boundary: you can create cells with more points.

// .SECTION See Also
// vtkHexahedron vtkLine vtkPixel vtkPolyLine vtkPolyVertex
// vtkPolygon vtkQuad vtkTetra vtkTriangle
// vtkTriangleStrip vtkVertex vtkVoxel vtkWedge vtkPyramid

#ifndef vtkCell_h
#define vtkCell_h

#define VTK_CELL_SIZE 512
#define VTK_TOL 1.e-05 // Tolerance for geometric calculation

#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkObject.h"

#include "vtkIdList.h" // Needed for inline methods
#include "vtkCellType.h" // Needed to define cell types

class vtkCellArray;
class vtkCellData;
class vtkDataArray;
class vtkPointData;
class vtkIncrementalPointLocator;
class vtkPoints;

class VTKCOMMONDATAMODEL_EXPORT vtkCell : public vtkObject
{
public:
  vtkTypeMacro(vtkCell,vtkObject);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Initialize cell from outside with point ids and point
  // coordinates specified.
  void Initialize(int npts, vtkIdType *pts, vtkPoints *p);

  // Description:
  // Copy this cell by reference counting the internal data structures.
  // This is safe if you want a "read-only" copy. If you modify the cell
  // you might wish to use DeepCopy().
  virtual void ShallowCopy(vtkCell *c);

  // Description:
  // Copy this cell by completely copying internal data structures. This is
  // slower but safer than ShallowCopy().
  virtual void DeepCopy(vtkCell *c);

  // Description:
  // Return the type of cell.
  virtual int GetCellType() = 0;

  // Description:
  // Return the topological dimensional of the cell (0,1,2, or 3).
  virtual int GetCellDimension() = 0;

  // Description:
  // Non-linear cells require special treatment beyond the usual cell type
  // and connectivity list information.  Most cells in VTK are implicit
  // cells.
  virtual int IsLinear() {return 1;}

  // Description:
  // Some cells require initialization prior to access. For example, they
  // may have to triangulate themselves or set up internal data structures.
  virtual int RequiresInitialization() {return 0;}
  virtual void Initialize() {}

  // Description:
  // Explicit cells require additional representational information
  // beyond the usual cell type and connectivity list information.
  // Most cells in VTK are implicit cells.
  virtual int IsExplicitCell() {return 0;}

  // Description:
  // Determine whether the cell requires explicit face representation, and
  // methods for setting and getting the faces (see vtkPolyhedron for example
  // usage of these methods).
  virtual int RequiresExplicitFaceRepresentation() {return 0;}
  virtual void SetFaces(vtkIdType *vtkNotUsed(faces)) {}
  virtual vtkIdType *GetFaces() {return NULL;}

  // Description:
  // Get the point coordinates for the cell.
  vtkPoints *GetPoints() {return this->Points;}

  // Description:
  // Return the number of points in the cell.
  vtkIdType GetNumberOfPoints() {return this->PointIds->GetNumberOfIds();}

  // Description:
  // Return the number of edges in the cell.
  virtual int GetNumberOfEdges() = 0;

  // Description:
  // Return the number of faces in the cell.
  virtual int GetNumberOfFaces() = 0;

  // Description:
  // Return the list of point ids defining the cell.
  vtkIdList *GetPointIds() {return this->PointIds;}

  // Description:
  // For cell point i, return the actual point id.
  vtkIdType GetPointId(int ptId) {return this->PointIds->GetId(ptId);}

  // Description:
  // Return the edge cell from the edgeId of the cell.
  virtual vtkCell *GetEdge(int edgeId) = 0;

  // Description:
  // Return the face cell from the faceId of the cell.
  virtual vtkCell *GetFace(int faceId) = 0;

  // Description:
  // Given parametric coordinates of a point, return the closest cell
  // boundary, and whether the point is inside or outside of the cell. The
  // cell boundary is defined by a list of points (pts) that specify a face
  // (3D cell), edge (2D cell), or vertex (1D cell). If the return value of
  // the method is != 0, then the point is inside the cell.
  virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts) = 0;

  // Description:
  // Given a point x[3] return inside(=1), outside(=0) cell, or (-1)
  // computational problem encountered; evaluate
  // parametric coordinates, sub-cell id (!=0 only if cell is composite),
  // distance squared of point x[3] to cell (in particular, the sub-cell
  // indicated), closest point on cell to x[3] (unless closestPoint is null,
  // in which case, the closest point and dist2 are not found), and
  // interpolation weights in cell. (The number of weights is equal to the
  // number of points defining the cell). Note: on rare occasions a -1 is
  // returned from the method. This means that numerical error has occurred
  // and all data returned from this method should be ignored. Also,
  // inside/outside is determine parametrically. That is, a point is inside
  // if it satisfies parametric limits. This can cause problems for cells of
  // topological dimension 2 or less, since a point in 3D can project onto
  // the cell within parametric limits but be "far" from the cell.  Thus the
  // value dist2 may be checked to determine true in/out.
  virtual int EvaluatePosition(double x[3], double* closestPoint,
                               int& subId, double pcoords[3],
                               double& dist2, double *weights) = 0;

  // Description:
  // Determine global coordinate (x[3]) from subId and parametric coordinates.
  // Also returns interpolation weights. (The number of weights is equal to
  // the number of points in the cell.)
  virtual void EvaluateLocation(int& subId, double pcoords[3],
                                double x[3], double *weights) = 0;

  // Description:
  // Generate contouring primitives. The scalar list cellScalars are
  // scalar values at each cell point. The point locator is essentially a
  // points list that merges points as they are inserted (i.e., prevents
  // duplicates). Contouring primitives can be vertices, lines, or
  // polygons. It is possible to interpolate point data along the edge
  // by providing input and output point data - if outPd is NULL, then
  // no interpolation is performed. Also, if the output cell data is
  // non-NULL, the cell data from the contoured cell is passed to the
  // generated contouring primitives. (Note: the CopyAllocate() method
  // must be invoked on both the output cell and point data. The
  // cellId refers to the cell from which the cell data is copied.)
  virtual void Contour(double value, vtkDataArray *cellScalars,
                       vtkIncrementalPointLocator *locator, vtkCellArray *verts,
                       vtkCellArray *lines, vtkCellArray *polys,
                       vtkPointData *inPd, vtkPointData *outPd,
                       vtkCellData *inCd, vtkIdType cellId,
                       vtkCellData *outCd) = 0;

  // Description:
  // Cut (or clip) the cell based on the input cellScalars and the
  // specified value. The output of the clip operation will be one or
  // more cells of the same topological dimension as the original cell.
  // The flag insideOut controls what part of the cell is considered inside -
  // normally cell points whose scalar value is greater than "value" are
  // considered inside. If insideOut is on, this is reversed. Also, if the
  // output cell data is non-NULL, the cell data from the clipped cell is
  // passed to the generated contouring primitives. (Note: the CopyAllocate()
  // method must be invoked on both the output cell and point data. The
  // cellId refers to the cell from which the cell data is copied.)
  virtual void Clip(double value, vtkDataArray *cellScalars,
                    vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
                    vtkPointData *inPd, vtkPointData *outPd,
                    vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
                    int insideOut) = 0;

  // Description:
  // Intersect with a ray. Return parametric coordinates (both line and cell)
  // and global intersection coordinates, given ray definition p1[3], p2[3] and tolerance tol.
  // The method returns non-zero value if intersection occurs. A parametric distance t
  // between 0 and 1 along the ray representing the intersection point, the point coordinates
  // x[3] in data coordinates and also pcoords[3] in parametric coordinates. subId is the index
  // within the cell if a composed cell like a triangle strip.
  virtual int IntersectWithLine(double p1[3], double p2[3],
                                double tol, double& t, double x[3],
                                double pcoords[3], int& subId) = 0;

  // Description:
  // Generate simplices of proper dimension. If cell is 3D, tetrahedron are
  // generated; if 2D triangles; if 1D lines; if 0D points. The form of the
  // output is a sequence of points, each n+1 points (where n is topological
  // cell dimension) defining a simplex. The index is a parameter that controls
  // which triangulation to use (if more than one is possible). If numerical
  // degeneracy encountered, 0 is returned, otherwise 1 is returned.
  // This method does not insert new points: all the points that define the
  // simplices are the points that define the cell.
  virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;

  // Description:
  // Compute derivatives given cell subId and parametric coordinates. The
  // values array is a series of data value(s) at the cell points. There is a
  // one-to-one correspondence between cell point and data value(s). Dim is
  // the number of data values per cell point. Derivs are derivatives in the
  // x-y-z coordinate directions for each data value. Thus, if computing
  // derivatives for a scalar function in a hexahedron, dim=1, 8 values are
  // supplied, and 3 deriv values are returned (i.e., derivatives in x-y-z
  // directions). On the other hand, if computing derivatives of velocity
  // (vx,vy,vz) dim=3, 24 values are supplied ((vx,vy,vz)1, (vx,vy,vz)2,
  // ....()8), and 9 deriv values are returned
  // ((d(vx)/dx),(d(vx)/dy),(d(vx)/dz), (d(vy)/dx),(d(vy)/dy), (d(vy)/dz),
  // (d(vz)/dx),(d(vz)/dy),(d(vz)/dz)).
  virtual void Derivatives(int subId, double pcoords[3], double *values,
                           int dim, double *derivs) = 0;

  // Description:
  // Compute cell bounding box (xmin,xmax,ymin,ymax,zmin,zmax). Copy result
  // into user provided array.
  void GetBounds(double bounds[6]);

  // Description:
  // Compute cell bounding box (xmin,xmax,ymin,ymax,zmin,zmax). Return pointer
  // to array of six double values.
  double *GetBounds();

  // Description:
  // Compute Length squared of cell (i.e., bounding box diagonal squared).
  double GetLength2();

  // Description:
  // Return center of the cell in parametric coordinates.  Note that the
  // parametric center is not always located at (0.5,0.5,0.5). The return
  // value is the subId that the center is in (if a composite cell). If you
  // want the center in x-y-z space, invoke the EvaluateLocation() method.
  virtual int GetParametricCenter(double pcoords[3]);

  // Description:
  // Return the distance of the parametric coordinate provided to the
  // cell. If inside the cell, a distance of zero is returned. This is
  // used during picking to get the correct cell picked. (The tolerance
  // will occasionally allow cells to be picked who are not really
  // intersected "inside" the cell.)
  virtual double GetParametricDistance(double pcoords[3]);

  // Description:
  // Return whether this cell type has a fixed topology or whether the
  // topology varies depending on the data (e.g., vtkConvexPointSet).
  // This compares to composite cells that are typically composed of
  // primary cells (e.g., a triangle strip composite cell is made up of
  // triangle primary cells).
  virtual int IsPrimaryCell() {return 1;}

  // Description:
  // Return a contiguous array of parametric coordinates of the points
  // defining this cell. In other words, (px,py,pz, px,py,pz, etc..)  The
  // coordinates are ordered consistent with the definition of the point
  // ordering for the cell. This method returns a non-NULL pointer when
  // the cell is a primary type (i.e., IsPrimaryCell() is true). Note that
  // 3D parametric coordinates are returned no matter what the topological
  // dimension of the cell.
  virtual double *GetParametricCoords();

  // Description:
  // Compute the interpolation functions/derivatives
  // (aka shape functions/derivatives)
  // No-ops at this level. Typically overridden in subclasses.
  virtual void InterpolateFunctions(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(weight))
    {
    }
  virtual void InterpolateDerivs(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(derivs))
    {
    }

  // left public for quick computational access
  vtkPoints *Points;
  vtkIdList *PointIds;

protected:
  vtkCell();
  ~vtkCell();

  double Bounds[6];

private:
  vtkCell(const vtkCell&);  // Not implemented.
  void operator=(const vtkCell&);  // Not implemented.
};

#endif