text:
package com.codepath.googleimagesearch.activities;

import java.util.ArrayList;

import org.apache.http.Header;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.R.color;
import android.app.Activity;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.SearchView;
import android.widget.SearchView.OnQueryTextListener;
import android.widget.Toast;

import com.codepath.googleimagesearch.R;
import com.codepath.googleimagesearch.adapters.ImageResultAdapter;
import com.codepath.googleimagesearch.models.ImageFilter;
import com.codepath.googleimagesearch.models.ImageResult;
import com.etsy.android.grid.StaggeredGridView;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;

public class ImageSearchActivity extends Activity implements AbsListView.OnScrollListener, AbsListView.OnItemClickListener {

	private StaggeredGridView gvResults;
	public ArrayList<ImageResult> imageResults;
	private ImageResultAdapter aImageResults;
	private Context context;
	private String queryVal = "android";
	private SearchView searchView;
	private ImageFilter imageFilter;
	private ProgressBar progressBar;

	private int scrolledPageNo = 0;

	public static final String COLOR_KEY = "imgcolor";
	public static final String SIZE_KEY = "imgsz";
	public static final String TYPE_KEY = "imgtype";
	public static final String SITE_KEY = "as_sitesearch";

	private int FILTER_REQUEST_CODE = 26;
	public static String FILTER_KEY = "result";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_image_search);
		context = this;
		imageFilter = new ImageFilter();
		// creates the data source
		imageResults = new ArrayList<ImageResult>();
		setupViews();

		Intent intent = getIntent();
		if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
			String query = intent.getStringExtra(SearchManager.QUERY);
			queryVal = query;
			prepareCall();
		}

	}

	// Should be called manually when an async task has started
    public void showProgressBar() {
//        setProgressBarIndeterminateVisibility(true);
        progressBar.setVisibility(View.VISIBLE);
    }

    // Should be called when an async task has finished
    public void hideProgressBar() {
//        setProgressBarIndeterminateVisibility(false);
    	progressBar.setVisibility(View.INVISIBLE);
    }

	private void setupViews() {
		gvResults = (StaggeredGridView) findViewById(R.id.gvResults);

		// attach the datasource to the adapter
		aImageResults = new ImageResultAdapter(this, imageResults);
		// link the adapter to the adapterview
		gvResults.setAdapter(aImageResults);
		gvResults.setOnScrollListener(this);
		gvResults.setOnItemClickListener(this);

		// OnItemLongClickListener
		gvResults.setOnItemLongClickListener(new OnItemLongClickListener() {
			@Override
	        public boolean onItemLongClick(AdapterView<?> parent, View v, int position,
	        		long id) {
				// share the image
//	        	onShareItem(v);
	        	return true;
	        }
	    });

		ViewGroup layout = (ViewGroup) findViewById(android.R.id.content).getRootView();

		progressBar = new ProgressBar(this,null,android.R.attr.progressBarStyleLarge);
		progressBar.setIndeterminate(true);
		hideProgressBar();
		RelativeLayout.LayoutParams params = new
		        RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.MATCH_PARENT);
		RelativeLayout rl = new RelativeLayout(this);
		rl.setGravity(Gravity.CENTER);
		rl.addView(progressBar);
		layout.addView(rl,params);

//		makeNetworkCall(queryVal, scrolledPageNo);
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		 // Handle presses on the action bar items
	    switch (item.getItemId()) {
	        case R.id.action_filter:
	        	showImageFilter();
	        	return true;
	        default:
	            return super.onOptionsItemSelected(item);
	    }
	}

	@Override
	protected void onNewIntent(Intent intent) {
		prepareCall();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater menuInflater = getMenuInflater();
		menuInflater.inflate(R.menu.image_search, menu);

		MenuItem searchItem = menu.findItem(R.id.action_search);
	    searchView = (SearchView) searchItem.getActionView();

		SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
		searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

		try{

	    	searchView.setOnQueryTextListener(new OnQueryTextListener() {
			       @Override
			       public boolean onQueryTextSubmit(String query) {
			    	   queryVal = query;
			    	   hideSoftKeyboard(searchView);
			    	   prepareCall();
			           return true;
			       }

			       @Override
			       public boolean onQueryTextChange(String newText) {
			           return false;
			       }
			   });

	    }catch(Exception ex){
	    	System.out.println(ex.getStackTrace());
	    }

		return true;
	}

	// dsiplays the Image Filter with advanced filter options
	private void showImageFilter() {
		Intent i = new Intent(ImageSearchActivity.this, ImageFilterActivity.class);
		i.putExtra(FILTER_KEY, imageFilter);
		startActivityForResult(i, FILTER_REQUEST_CODE);
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		if(requestCode == FILTER_REQUEST_CODE){
			if(resultCode == RESULT_OK){
				imageFilter = (ImageFilter) data.getSerializableExtra("result");
				prepareCall();
			}
		}

	}

	private RequestParams getRequestParams(){
		RequestParams params = new RequestParams();

		if(!isEmpty(imageFilter.getColor())){
			params.put(COLOR_KEY, imageFilter.getColor());
		}
		if(!isEmpty(imageFilter.getSize())){
			params.put(SIZE_KEY, imageFilter.getSize());
		}
		if(!isEmpty(imageFilter.getType())){
			params.put(TYPE_KEY, imageFilter.getType());
		}
		if(!isEmpty(imageFilter.getSite())){
			params.put(SITE_KEY, imageFilter.getSite());
		}

		return params;
	}

	private boolean isEmpty(String str){
		if(str == null || str.trim().length() == 0 || str.equals("") || str.equals("any")){
			return true;
		}
		return false;
	}

	@Override
	public void onItemClick(AdapterView<?> adapterView, View view,
			int position, long id) {
		Intent i = new Intent(ImageSearchActivity.this, ImageDisplayActivity.class);
//		// get the image result to display
		ImageResult imageResult = imageResults.get(position);
//		// pass image result into the intent
		i.putExtra(FILTER_KEY, imageResult);
//		// launch the activity
		startActivity(i);

	}

	@Override
	public void onScrollStateChanged(AbsListView view, int scrollState) {
		Log.d("Activity", "onScrollStateChanged:" + scrollState);
	}

	@Override
	public void onScroll(AbsListView view, int firstVisibleItem,
			int visibleItemCount, int totalItemCount) {
		if (((firstVisibleItem + visibleItemCount) >= totalItemCount) &&
			scrolledPageNo<=8 && totalItemCount > 0){
			scrolledPageNo++;
			makeNetworkCall(queryVal, scrolledPageNo);
		}
	}

	private void prepareCall(){
		getWindow().getDecorView().setBackgroundColor(color.background_dark);
		showProgressBar();
		clearAdapter();
		scrolledPageNo = 0;
 	   	if(!isEmpty(queryVal)){
 	 	   	makeNetworkCall(queryVal, 0);
 	   	}
 	   	hideProgressBar();
	}

	private void clearAdapter() {
		aImageResults.clear();
		aImageResults.notifyDataSetInvalidated();
	}

	private void makeNetworkCall(String query, int page){
		String q = "q="+Uri.encode(query)+"&rsz=8&start="+ ((page*7) + 1);
		AsyncHttpClient client = new AsyncHttpClient();
		if (!checkIfNetworkAvailable()) {
			Toast.makeText(this, "Network not available. Try again later", Toast.LENGTH_SHORT).show();
			return;
		}
		RequestParams requestParams = getRequestParams();
		String searchUrl = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&" + q;
		client.get(searchUrl, requestParams, new JsonHttpResponseHandler(){
			@Override
			public void onSuccess(int statusCode, Header[] headers,
					JSONObject response) {
				Log.d("debug", response.toString());
				JSONArray imageResultsJson = null;
				try{
					imageResultsJson = response.getJSONObject("responseData").getJSONArray("results");
					if (imageResultsJson != null){
						aImageResults.addAll(ImageResult.fromJSONArray(imageResultsJson));
						aImageResults.notifyDataSetChanged();
					}
				}
				catch(JSONException e){
					e.printStackTrace();
				}
			}

			@Override
			public void onFailure(int statusCode, Header[] headers,
					String responseString, Throwable throwable) {
				// Handle the failure and alert the user to retry
			   Toast.makeText(context, "Network failure : "+ throwable.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
			}
		});
	}

	private void hideSoftKeyboard(View view) {
		InputMethodManager inputMethodMgr = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
		inputMethodMgr.hideSoftInputFromWindow(view.getWindowToken(), 0);
	}

	private Boolean checkIfNetworkAvailable() {
        ConnectivityManager connManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo nwInfo = connManager.getActiveNetworkInfo();
        return nwInfo != null && nwInfo.isConnectedOrConnecting();
    }
}


text:
title: "Modèle de grilles d'exercice pour Krita"
date: 2015-02-05 12:00
thumb: '/img/blog/poses-exercise.jpg'
lang_en: '/en/blog/exercise-templates-for-krita'
tags:
  - téléchargement
  - tutoriels
  - croquis
---

Depuis des années, je n'avais pas de bon moyen de m'entraîner au dessin quotidiennement, car je n'avais pas trouvé un exercice qui correspondait à mes besoins...

Et s'entraîner régulièrement est la meilleur façon de devenir meilleur en dessin ;)

Mais récemment, j'ai trouvé un moyen ! Inspiré par cette [vidéo](http://www.ctrlpaint.com/videos/quick-pose-gesture-sketching) de Matt Kohr (en anglais), et avec la géniale ressource que j'ai trouvé ici : http://artists.pixelovely.com/ (en anglais aussi), je peux maintenant prendre une demi-heure chaque jour pour m'entraîner !

![Exercice de poses](/img/blog/poses-exercise.jpg)

Mais puisque je travaille en numérique (avec le génial logiciel [Krita](https://krita.org/) ), une dernière chose manquait : un fichier modèle pour démarrer rapidement l'exercice le matin.

Donc, je l'ai fait, et peut-être que vous êtes intéressés par la méthode et la ressource, donc je le partage [ici](https://github.com/nylnook/exercise-grids-templates-for-krita/archive/1.0.1.zip). (Licence Creative Commons Zero)

Ces modèles sont très simples : un fichier est une image de 8192x8192px, ce qui donne 64 cases de 1024x1024px pour dessiner (ou 64 poses de 1 minute), et l'autre est une image de 4096x4096px, ce qui donne 16 cases de 1024x1024px pour une session plus courte, ou pour travailler avec un ordinateur moins puissant.

## Installation

pour les installer, décompressez l'archive, et copiez le dossier ( *templates* ) dans le dossier des préférences utilisateurs de Krita (exemple sur Linux : ~/.kde4/share/apps/krita/ ).
Vous pouvez aussi ouvrir le dossier des préférences depuis Krita : Édition > Ressources > Ouvrir le dossier des préférences.
N'oubliez pas de redémarrer Krita pour voir apparaître les nouveaux modèles.

## Comment l'utiliser

Choisissez une brosse type crayon (ou une autre brosse avec laquelle vous voulez vous entraîner), zoomez sur la première case, et démarrer un session sur un de ces sites web : http://artists.pixelovely.com/ or http://www.posemaniacs.com/.
Arrêtez-vous quand la session est finie, ou quand chaque case est remplie. Vous pouvez déborder des lignes ;)

redpajama_set_name: RedPajamaGithub


text:
package de.saxsys.mvvmfx.examples.books.backend;

import static com.theoryinpractise.halbuilder.api.RepresentationFactory.HAL_JSON;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;

import org.jboss.resteasy.client.jaxrs.cache.BrowserCacheFeature;
import org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPFilter;
import org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.theoryinpractise.halbuilder.api.ContentRepresentation;
import com.theoryinpractise.halbuilder.api.Link;
import com.theoryinpractise.halbuilder.api.ReadableRepresentation;
import com.theoryinpractise.halbuilder.jaxrs.JaxRsHalBuilderReaderSupport;

public class LibraryServiceImpl implements Serializable, LibraryService {

	private static final long serialVersionUID = 1L;
	private static final String BASE_URL = "http://localhost:8080/rest";
	private static final Logger LOGGER = LoggerFactory.getLogger(LibraryServiceImpl.class);

	private Client apiClient;

	public LibraryServiceImpl() {
		apiClient =
				ClientBuilder.newClient()
						.register(JaxRsHalBuilderReaderSupport.class)
						.register(BrowserCacheFeature.class)
						.register(GZIPDecodingInterceptor.class)
						.register(AcceptEncodingGZIPFilter.class);
	}

	@Override
	public List<Book> search(String query, Consumer<Error> errorCallback) {
		try {
			// home
			Response responseHome = apiClient.target(BASE_URL).request(HAL_JSON).get();
			ContentRepresentation repHome = responseHome.readEntity(ContentRepresentation.class);
			// search
			Link searchLink = repHome.getLinkByRel("lib:search");
			String href = HalUtil.replaceParam(searchLink.getHref(), query);
			Response responseSearch = apiClient.target(href).request(HAL_JSON).get();
			ContentRepresentation repSearch =
					responseSearch.readEntity(ContentRepresentation.class);
			Collection<ReadableRepresentation> resultSet =
					repSearch.getResourceMap().get("lib:book");
			List<Book> books = new ArrayList<>();
			if (null != resultSet) {
				for (ReadableRepresentation rep : resultSet) {
					Book book = toBook(rep);
					if (null == book.getTitle() || null == book.getAuthor()) {
						// get book
						Response response =
								apiClient.target(book.getHref()).request(HAL_JSON).get();
						ContentRepresentation repBook =
								response.readEntity(ContentRepresentation.class);
						book = toBook(repBook);
					}
					books.add(book);
				}
			}
			return books;
		} catch (Throwable e) {
			LOGGER.error("Error during search", e);
			errorCallback.accept(Error.error("Error during search", e.getMessage()));
			return new ArrayList<>();
		}
	}

	@Override
	public Book showDetails(Book book, Consumer<Error> errorCallback) {
		LOGGER.debug("Show details for book at {}", book.getHref());
		try {
			Response response = apiClient.target(book.getHref()).request(HAL_JSON).get();
			ContentRepresentation rep = response.readEntity(ContentRepresentation.class);
			return toBook(rep);
		} catch (Exception e) {
			LOGGER.error("Error retrieving book", e);
			errorCallback.accept(Error.error("Error retrieving book", e.getMessage()));
			return null;
		}
	}

	private Book toBook(ReadableRepresentation rep) {
		return new Book(
				rep.getResourceLink().getHref(), (String) rep.getValue("title", null),
				(String) rep.getValue("author", null), (String) rep.getValue("description",
						null));
	}
}


text:
package pl.java.scalatech.feature;

import org.springframework.test.context.TestContext;
import org.springframework.test.context.TestExecutionListener;

import lombok.extern.slf4j.Slf4j;
@Slf4j
public class MyTestExecutionListener implements TestExecutionListener {

    @Override
    public void beforeTestClass(TestContext testContext) throws Exception {
        log.info("beforeTestClass: {}",testContext);

    }

    @Override
    public void prepareTestInstance(TestContext testContext) throws Exception {
        log.info("prepareTestInstance:{}",testContext);
    }

    @Override
    public void beforeTestMethod(TestContext testContext) throws Exception {
        log.info("beforeTestMethod: {}",testContext);
    }

    @Override
    public void afterTestMethod(TestContext testContext) throws Exception {
        log.info("afterTestMethod: {}",testContext);
    }

    @Override
    public void afterTestClass(TestContext testContext) throws Exception {
        log.info("afterTestClass: {}",testContext);
    }

}


text:
@interface MMWormholeCoordinatedFileTransiting : MMWormholeFileTransiting

@end


text:
module JSONAPI
  class Paginator
    def initialize(_params)
    end

    def apply(_relation, _order_options)
      # relation
    end

    def links_page_params(_options = {})
      # :nocov:
      {}
      # :nocov:
    end

    class << self
      def requires_record_count
        # :nocov:
        false
        # :nocov:
      end

      def paginator_for(paginator)
        paginator_class_name = "#{paginator.to_s.camelize}Paginator"
        paginator_class_name.safe_constantize if paginator_class_name
      end
    end
  end
end

class OffsetPaginator < JSONAPI::Paginator
  attr_reader :limit, :offset

  def initialize(params)
    parse_pagination_params(params)
    verify_pagination_params
  end

  def self.requires_record_count
    true
  end

  def apply(relation, _order_options)
    relation.offset(@offset).limit(@limit)
  end

  def links_page_params(options = {})
    record_count = options[:record_count]
    links_page_params = {}

    links_page_params['first'] = {
      'offset' => 0,
      'limit' => @limit
    }

    if @offset > 0
      previous_offset = @offset - @limit

      previous_offset = 0 if previous_offset < 0

      links_page_params['prev'] = {
        'offset' => previous_offset,
        'limit' => @limit
      }
    end

    next_offset = @offset + @limit

    unless next_offset >= record_count
      links_page_params['next'] = {
        'offset' => next_offset,
        'limit' => @limit
      }
    end

    if record_count
      last_offset = record_count - @limit

      last_offset = 0 if last_offset < 0

      links_page_params['last'] = {
        'offset' => last_offset,
        'limit' => @limit
      }
    end

    links_page_params
  end

  private

  def parse_pagination_params(params)
    if params.nil?
      @offset = 0
      @limit = JSONAPI.configuration.default_page_size
    elsif params.is_a?(ActionController::Parameters)
      validparams = params.permit(:offset, :limit)

      @offset = validparams[:offset] ? validparams[:offset].to_i : 0
      @limit = validparams[:limit] ? validparams[:limit].to_i : JSONAPI.configuration.default_page_size
    else
      fail JSONAPI::Exceptions::InvalidPageObject.new
    end
  rescue ActionController::UnpermittedParameters => e
    raise JSONAPI::Exceptions::PageParametersNotAllowed.new(e.params)
  end

  def verify_pagination_params
    if @limit < 1
      fail JSONAPI::Exceptions::InvalidPageValue.new(:limit, @limit)
    elsif @limit > JSONAPI.configuration.maximum_page_size
      fail JSONAPI::Exceptions::InvalidPageValue.new(:limit, @limit,
                                                     "Limit exceeds maximum page size of #{JSONAPI.configuration.maximum_page_size}.")
    end

    if @offset < 0
      fail JSONAPI::Exceptions::InvalidPageValue.new(:offset, @offset)
    end
  end
end

class PagedPaginator < JSONAPI::Paginator
  attr_reader :size, :number

  def initialize(params)
    parse_pagination_params(params)
    verify_pagination_params
  end

  def self.requires_record_count
    true
  end

  def apply(relation, _order_options)
    offset = (@number - 1) * @size
    relation.offset(offset).limit(@size)
  end

  def links_page_params(options = {})
    record_count = options[:record_count]
    page_count = (record_count / @size.to_f).ceil

    links_page_params = {}

    links_page_params['first'] = {
      'number' => 1,
      'size' => @size
    }

    if @number > 1
      links_page_params['prev'] = {
        'number' => @number - 1,
        'size' => @size
      }
    end

    unless @number >= page_count
      links_page_params['next'] = {
        'number' => @number + 1,
        'size' => @size
      }
    end

    if record_count
      links_page_params['last'] = {
        'number' => page_count == 0 ? 1 : page_count,
        'size' => @size
      }
    end

    links_page_params
  end

  private

  def parse_pagination_params(params)
    if params.nil?
      @number = 1
      @size = JSONAPI.configuration.default_page_size
    elsif params.is_a?(ActionController::Parameters)
      validparams = params.permit(:number, :size)

      @size = validparams[:size] ? validparams[:size].to_i : JSONAPI.configuration.default_page_size
      @number = validparams[:number] ? validparams[:number].to_i : 1
    else
      @size = JSONAPI.configuration.default_page_size
      @number = params.to_i
    end
  rescue ActionController::UnpermittedParameters => e
    raise JSONAPI::Exceptions::PageParametersNotAllowed.new(e.params)
  end

  def verify_pagination_params
    if @size < 1
      fail JSONAPI::Exceptions::InvalidPageValue.new(:size, @size)
    elsif @size > JSONAPI.configuration.maximum_page_size
      fail JSONAPI::Exceptions::InvalidPageValue.new(:size, @size,
                                                     "size exceeds maximum page size of #{JSONAPI.configuration.maximum_page_size}.")
    end

    if @number < 1
      fail JSONAPI::Exceptions::InvalidPageValue.new(:number, @number)
    end
  end
end


text:
package connectivity;

import javax.net.ssl.SSLSocket;
import java.net.*;
import java.io.*;

/**
 * This class is responsible for maintaining the connections coming into the server
 * which is given a separate SocketProcess thread which handles the requests.
 */
public class ClientConnection extends Thread {

    private final Socket socket;
    String inputLine, outputLine, message;

    public ClientConnection(SSLSocket socket) {
        this.socket = socket;
    }

    /**
     * Runs the thread and checks for incoming messages and sends outgoing messages.
     */
    public void run() {
        try (
                PrintWriter out = new PrintWriter(this.socket.getOutputStream(), true);
                BufferedReader in = new BufferedReader(new InputStreamReader(this.socket.getInputStream()))
            ) {
            label:
            do {
                if (!(inputLine = in.readLine()).endsWith("END")) {
                    do {
                    } while (!(inputLine = in.readLine()).endsWith("END"));
                }

                message = inputLine.substring(0, inputLine.length() - "END".length());

                outputLine = SocketAPI.getResponseFor(message);
                out.println(outputLine);

                switch (outputLine) {
                    case "Close":
                        break label;
                }
            } while (true);
            ServerConnections.closeConnection(this);
        } catch (SocketException e) {
            System.out.println("Closed socket " + socket.getInetAddress());
        } catch (NullPointerException e) {
            try {
                ServerConnections.closeConnection(this);
            } catch (IOException e1) {
                e1.printStackTrace();
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * Closes the socket connection
     *
     * @throws IOException
     */
    public void closeConnection() throws IOException {
        try {
            this.socket.close();
        } catch (IOException e) {
            System.err.println("Error closing connection");
            e.printStackTrace();
            throw e;
        }
    }

    public Socket getSocket() {
        return socket;
    }
}


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

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:orientation="horizontal"
        android:weightSum="4"
        >

        <android.support.v4.widget.Space
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>

        <RadioButton
            android:id="@+id/single"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/single"
            />

        <RadioButton
            android:id="@+id/repeat"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/repeat"/>
    </RadioGroup>

    <RelativeLayout
        android:id="@+id/pick_date_area"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:fitsSystemWindows="true"
        >

        <TextView
            android:id="@+id/date"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:paddingEnd="10dp"
            android:paddingStart="10dp"
            android:text="@string/date"
            android:textColor="@color/primary_text"
            android:textSize="18sp"
            />

        <TextView
            android:id="@+id/pick_date"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_toEndOf="@id/date"
            android:drawableEnd="@drawable/ic_keyboard_arrow_right_black_24dp"
            android:gravity="center"
            tools:text="2016年10月10日"
            />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/pick_time_area"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:layout_marginTop="10dp"
        android:fitsSystemWindows="true"
        >

        <TextView
            android:id="@+id/time"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:paddingEnd="10dp"
            android:paddingStart="10dp"
            android:text="@string/time"
            android:textColor="@color/primary_text"
            android:textSize="18sp"
            />

        <TextView
            android:id="@+id/pick_time"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_toEndOf="@id/time"
            android:drawableEnd="@drawable/ic_keyboard_arrow_right_black_24dp"
            android:gravity="center"
            tools:text="上午10点58分"
            />

    </RelativeLayout>

    <Button
        android:id="@+id/ensure"
        style="@style/Widget.AppCompat.Button.Colored"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="10dp"
        android:fitsSystemWindows="true"
        android:text="@string/ensure"/>

</LinearLayout>


text:
typedef struct {Action action; void * data;} Entry;

static pthread_mutex_t mutex;
static Entry * entries;
static unsigned size, count;

void action_initialize(void)
{
    static int initialized;
    if (initialized)
        return;

    pthread_mutex_init(&mutex, NULL);
    initialized = 1;
}

int action_count(void)
{
    return count;
}

void action_add(Action action, void * data)
{
    LOCK(mutex);

    if (count == size)
    {
        size = imax(size * 2, 1);
        entries = (Entry *) realloc(entries, size * sizeof(Entry));
    }

    entries[count].action = action;
    entries[count].data = data;

    ++ count;

    UNLOCK(mutex);
}

void action_process(void)
{
    Entry * local_entries;
    int local_count, i;

    LOCK(mutex);

    if (!entries)
    {
        UNLOCK(mutex);
        return;
    }

    local_entries = entries;
    local_count = count;

    entries = NULL;
    count = 0;
    size = 0;

    UNLOCK(mutex);

    for (i = 0; i != local_count; ++ i)
    {
        Action action = local_entries[i].action;
        void * data = local_entries[i].data;

        if (action(data))
        {
            action_add(action, data);
        }
        else
        {
            free(data);
        }
    }

    free(local_entries);
}


text: Your uploaded images will be placed here.


text:
"""
=====================================================
Optimization and root finding (:mod:`scipy.optimize`)
=====================================================

.. currentmodule:: scipy.optimize

Optimization
============

Local Optimization
------------------

.. autosummary::
   :toctree: generated/

   minimize - Unified interface for minimizers of multivariate functions
   minimize_scalar - Unified interface for minimizers of univariate functions
   OptimizeResult - The optimization result returned by some optimizers
   OptimizeWarning - The optimization encountered problems

The `minimize` function supports the following methods:

.. toctree::

   optimize.minimize-neldermead
   optimize.minimize-powell
   optimize.minimize-cg
   optimize.minimize-bfgs
   optimize.minimize-newtoncg
   optimize.minimize-lbfgsb
   optimize.minimize-tnc
   optimize.minimize-cobyla
   optimize.minimize-slsqp
   optimize.minimize-dogleg
   optimize.minimize-trustncg

The `minimize_scalar` function supports the following methods:

.. toctree::

   optimize.minimize_scalar-brent
   optimize.minimize_scalar-bounded
   optimize.minimize_scalar-golden

The specific optimization method interfaces below in this subsection are
not recommended for use in new scripts; all of these methods are accessible
via a newer, more consistent interface provided by the functions above.

General-purpose multivariate methods:

.. autosummary::
   :toctree: generated/

   fmin - Nelder-Mead Simplex algorithm
   fmin_powell - Powell's (modified) level set method
   fmin_cg - Non-linear (Polak-Ribiere) conjugate gradient algorithm
   fmin_bfgs - Quasi-Newton method (Broydon-Fletcher-Goldfarb-Shanno)
   fmin_ncg - Line-search Newton Conjugate Gradient

Constrained multivariate methods:

.. autosummary::
   :toctree: generated/

   fmin_l_bfgs_b - Zhu, Byrd, and Nocedal's constrained optimizer
   fmin_tnc - Truncated Newton code
   fmin_cobyla - Constrained optimization by linear approximation
   fmin_slsqp - Minimization using sequential least-squares programming
   differential_evolution - stochastic minimization using differential evolution

Univariate (scalar) minimization methods:

.. autosummary::
   :toctree: generated/

   fminbound - Bounded minimization of a scalar function
   brent - 1-D function minimization using Brent method
   golden - 1-D function minimization using Golden Section method

Equation (Local) Minimizers
---------------------------

.. autosummary::
   :toctree: generated/

   leastsq - Minimize the sum of squares of M equations in N unknowns
   nnls - Linear least-squares problem with non-negativity constraint

Global Optimization
-------------------

.. autosummary::
   :toctree: generated/

   basinhopping - Basinhopping stochastic optimizer
   brute - Brute force searching optimizer
   differential_evolution - stochastic minimization using differential evolution

Rosenbrock function
-------------------

.. autosummary::
   :toctree: generated/

   rosen - The Rosenbrock function.
   rosen_der - The derivative of the Rosenbrock function.
   rosen_hess - The Hessian matrix of the Rosenbrock function.
   rosen_hess_prod - Product of the Rosenbrock Hessian with a vector.

Fitting
=======

.. autosummary::
   :toctree: generated/

   curve_fit -- Fit curve to a set of points

Root finding
============

Scalar functions
----------------
.. autosummary::
   :toctree: generated/

   brentq - quadratic interpolation Brent method
   brenth - Brent method, modified by Harris with hyperbolic extrapolation
   ridder - Ridder's method
   bisect - Bisection method
   newton - Secant method or Newton's method

Fixed point finding:

.. autosummary::
   :toctree: generated/

   fixed_point - Single-variable fixed-point solver

Multidimensional
----------------

General nonlinear solvers:

.. autosummary::
   :toctree: generated/

   root - Unified interface for nonlinear solvers of multivariate functions
   fsolve - Non-linear multi-variable equation solver
   broyden1 - Broyden's first method
   broyden2 - Broyden's second method

The `root` function supports the following methods:

.. toctree::

   optimize.root-hybr
   optimize.root-lm
   optimize.root-broyden1
   optimize.root-broyden2
   optimize.root-anderson
   optimize.root-linearmixing
   optimize.root-diagbroyden
   optimize.root-excitingmixing
   optimize.root-krylov
   optimize.root-dfsane

Large-scale nonlinear solvers:

.. autosummary::
   :toctree: generated/

   newton_krylov
   anderson

Simple iterations:

.. autosummary::
   :toctree: generated/

   excitingmixing
   linearmixing
   diagbroyden

:mod:`Additional information on the nonlinear solvers <scipy.optimize.nonlin>`

Linear Programming
==================

Simplex Algorithm:

.. autosummary::
   :toctree: generated/

   linprog -- Linear programming using the simplex algorithm
   linprog_verbose_callback -- Sample callback function for linprog

The `linprog` function supports the following methods:

.. toctree::

   optimize.linprog-simplex

Utilities
=========

.. autosummary::
   :toctree: generated/

   approx_fprime - Approximate the gradient of a scalar function
   bracket - Bracket a minimum, given two starting points
   check_grad - Check the supplied derivative using finite differences
   line_search - Return a step that satisfies the strong Wolfe conditions

   show_options - Show specific options optimization solvers
   LbfgsInvHessProduct - Linear operator for L-BFGS approximate inverse Hessian

"""

from __future__ import division, print_function, absolute_import

from .optimize import *
from ._minimize import *
from ._root import *
from .minpack import *
from .zeros import *
from .lbfgsb import fmin_l_bfgs_b, LbfgsInvHessProduct
from .tnc import fmin_tnc
from .cobyla import fmin_cobyla
from .nonlin import *
from .slsqp import fmin_slsqp
from .nnls import nnls
from ._basinhopping import basinhopping
from ._linprog import linprog, linprog_verbose_callback
from ._differentialevolution import differential_evolution

__all__ = [s for s in dir() if not s.startswith('_')]
from numpy.testing import Tester
test = Tester().test
bench = Tester().bench


text:
'use strict';

var assert = require('assert'),
    helpers = require('../../lib/helpers');

describe('helpers - getMessageType', function () {

  //////////////////////////////
  // Get Message Type
  //////////////////////////////

  it('getMessageType - [severity: 1]', function (done) {
    var result = helpers.getMessageType({severity: 1}),
        expect = 'warning';

    assert.equal(expect, result);
    done();
  });

  it('getMessageType - [severity: 2]', function (done) {
    var result = helpers.getMessageType({severity: 2}),
        expect = 'error';

    assert.equal(expect, result);
    done();
  });
  it('getMessageType - []', function (done) {
    var result = helpers.getMessageType({}),
        expect = 'warning';

    assert.equal(expect, result);
    done();
  });
});


text:
FROM python:3.7

RUN pip install tox \
  # Install Git LFS
  && curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \
  && apt-get install git-lfs


text:
The mummichog (Fundulus heteroclitus) is a small killifish found along the Atlantic coast of the United States and
  Canada. Also known as Atlantic killifish, mummies, gudgeons, and mud minnows, these fish inhabit brackish and coastal
  waters including estuaries and salt marshes. The species is noted for its hardiness and ability to tolerate highly
  variable salinity, temperature fluctuations from 6 to 35 °C (43 to 95 °F), very low oxygen levels
  (down to 1 mg/L), and heavily polluted ecosystems. As a result, the mummichog is a popular research subject in
  embryological, physiological, and toxicological studies. It is also the first fish ever sent to space, aboard Skylab
  in 1973.

The gene annotation process was carried out using a combination of protein-to-genome alignments, annotation mapping
  from a suitable reference species and RNA-seq alignments (where RNA-seq data with appropriate meta data were publicly
  available). For each candidate gene region, a selection process was applied to choose the most appropriate set of
  transcripts based on evolutionary distance, experimental evidence for the source data and quality of the alignments.
  Small ncRNAs were obtained using a combination of BLAST and Infernal/RNAfold. Pseudogenes were calculated by looking
  at genes with a large percentage of non-biological introns (introns of <10bp), where the gene was covered in
  repeats, or where the gene was single exon and evidence of a functional multi-exon paralog was found elsewhere in the
  genome. lincRNAs were generated via RNA-seq data where no evidence of protein homology or protein domains could
  be found in the transcript.

    Detailed information on fish clade
      genebuild
    (PDF)

  In accordance with the
  Fort Lauderdale Agreement, please check the
  publication status of the genome/assembly before publishing any genome-wide analyses using these data.


text:
<?php

class findSubscriberSources
{

  /**
   *
   * @var AuthToken $token
   * @access public
   */
  public $token;

  /**
   *
   * @var LookupPreferences $lookupPrefs
   * @access public
   */
  public $lookupPrefs;

}


text:
namespace Microsoft.Azure.Management.VideoAnalyzer
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Microsoft.Rest.Serialization;
    using Models;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Net.Http;

    /// <summary>
    /// Azure Video Analyzer ARM Client
    /// </summary>
    public partial class VideoAnalyzerClient : ServiceClient<VideoAnalyzerClient>, IVideoAnalyzerClient, IAzureClient
    {
        /// <summary>
        /// The base URI of the service.
        /// </summary>
        public System.Uri BaseUri { get; set; }

        /// <summary>
        /// Gets or sets json serialization settings.
        /// </summary>
        public JsonSerializerSettings SerializationSettings { get; private set; }

        /// <summary>
        /// Gets or sets json deserialization settings.
        /// </summary>
        public JsonSerializerSettings DeserializationSettings { get; private set; }

        /// <summary>
        /// Credentials needed for the client to connect to Azure.
        /// </summary>
        public ServiceClientCredentials Credentials { get; private set; }

        /// <summary>
        /// The API version to use for this operation.
        /// </summary>
        public string ApiVersion { get; private set; }

        /// <summary>
        /// The ID of the target subscription.
        /// </summary>
        public string SubscriptionId { get; set; }

        /// <summary>
        /// The preferred language for the response.
        /// </summary>
        public string AcceptLanguage { get; set; }

        /// <summary>
        /// The retry timeout in seconds for Long Running Operations. Default value is
        /// 30.
        /// </summary>
        public int? LongRunningOperationRetryTimeout { get; set; }

        /// <summary>
        /// Whether a unique x-ms-client-request-id should be generated. When set to
        /// true a unique x-ms-client-request-id value is generated and included in
        /// each request. Default is true.
        /// </summary>
        public bool? GenerateClientRequestId { get; set; }

        /// <summary>
        /// Gets the IOperations.
        /// </summary>
        public virtual IOperations Operations { get; private set; }

        /// <summary>
        /// Gets the IVideoAnalyzersOperations.
        /// </summary>
        public virtual IVideoAnalyzersOperations VideoAnalyzers { get; private set; }

        /// <summary>
        /// Gets the ILocationsOperations.
        /// </summary>
        public virtual ILocationsOperations Locations { get; private set; }

        /// <summary>
        /// Gets the IEdgeModulesOperations.
        /// </summary>
        public virtual IEdgeModulesOperations EdgeModules { get; private set; }

        /// <summary>
        /// Gets the IVideosOperations.
        /// </summary>
        public virtual IVideosOperations Videos { get; private set; }

        /// <summary>
        /// Gets the IAccessPoliciesOperations.
        /// </summary>
        public virtual IAccessPoliciesOperations AccessPolicies { get; private set; }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='httpClient'>
        /// HttpClient to be used
        /// </param>
        /// <param name='disposeHttpClient'>
        /// True: will dispose the provided httpClient on calling VideoAnalyzerClient.Dispose(). False: will not dispose provided httpClient</param>
        protected VideoAnalyzerClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
        {
            Initialize();
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        protected VideoAnalyzerClient(params DelegatingHandler[] handlers) : base(handlers)
        {
            Initialize();
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        protected VideoAnalyzerClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
        {
            Initialize();
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        protected VideoAnalyzerClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            BaseUri = baseUri;
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        protected VideoAnalyzerClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            BaseUri = baseUri;
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public VideoAnalyzerClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
        {
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='httpClient'>
        /// HttpClient to be used
        /// </param>
        /// <param name='disposeHttpClient'>
        /// True: will dispose the provided httpClient on calling VideoAnalyzerClient.Dispose(). False: will not dispose provided httpClient</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public VideoAnalyzerClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
        {
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public VideoAnalyzerClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
        {
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public VideoAnalyzerClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            BaseUri = baseUri;
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the VideoAnalyzerClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public VideoAnalyzerClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            BaseUri = baseUri;
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// An optional partial-method to perform custom initialization.
        /// </summary>
        partial void CustomInitialize();
        /// <summary>
        /// Initializes client properties.
        /// </summary>
        private void Initialize()
        {
            Operations = new Operations(this);
            VideoAnalyzers = new VideoAnalyzersOperations(this);
            Locations = new LocationsOperations(this);
            EdgeModules = new EdgeModulesOperations(this);
            Videos = new VideosOperations(this);
            AccessPolicies = new AccessPoliciesOperations(this);
            BaseUri = new System.Uri("https://management.azure.com");
            ApiVersion = "2021-05-01-preview";
            AcceptLanguage = "en-US";
            LongRunningOperationRetryTimeout = 30;
            GenerateClientRequestId = true;
            SerializationSettings = new JsonSerializerSettings
            {
                Formatting = Newtonsoft.Json.Formatting.Indented,
                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
                ContractResolver = new ReadOnlyJsonContractResolver(),
                Converters = new List<JsonConverter>
                    {
                        new Iso8601TimeSpanConverter()
                    }
            };
            SerializationSettings.Converters.Add(new TransformationJsonConverter());
            DeserializationSettings = new JsonSerializerSettings
            {
                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
                ContractResolver = new ReadOnlyJsonContractResolver(),
                Converters = new List<JsonConverter>
                    {
                        new Iso8601TimeSpanConverter()
                    }
            };
            SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<AuthenticationBase>("@type"));
            DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<AuthenticationBase>("@type"));
            SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<TokenKey>("@type"));
            DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<TokenKey>("@type"));
            CustomInitialize();
            DeserializationSettings.Converters.Add(new TransformationJsonConverter());
            DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
        }
    }
}


text:
<?php require_once './vendor/autoload.php';

/**
 *
 * ActivityTracker
 *
 * This web panel was quickly built in order to
 * interact with the MySQL database that holds
 * the activity data tracked by the ActivityTracker
 * minecraft plugin.
 *
 */

// disable error reporting for
// production purposes.
error_reporting(E_ALL);
ini_set("display_errors", 0);

// Instantiate the ActivityTracker.
$tracker = new ActivityTracker\Tracker();

?>
<!DOCTYPE html>
<html>
<head>
  <title>ActivityTracker</title>

  <!-- Stylesheets -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

  <script src="ActivityTracker/Chart.js"></script>

</head>
<body>

  <!-- Page content -->
  <div class="container-fluid">
    <?php echo $tracker->page(); ?>
  </div>
  <!-- Scripts -->
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

</body>
</html>


text:
(function() {
	var app = angular.module('dfaMachine', ['ngSanitize', 'dfa-directives', 'diagram-controller']);

	app.controller('dfaController', ["$scope" , function($scope) {
		// HELPER VARS
		this.statesCounter = 0;

		// INSTANCE VARS
		this.alphabet = "";
		this.initial_state = "";
		this.states = [];
		this.accepted_states = [];
		this.transition_function = {};

		// Helper Functions
		var emptyState, buildAcceptedStates;

		// Machine running vars
		this.string = "";

		this.current_state = "";
		this.accepted = false;
		this.next_symbol_index = -1;
		this.next_symbol = '';
		this.finished = false;

		this.test = function() {
			// Create diagram
			$scope.$$childHead.diag.create(this);
			this.accepted = this.run();
			this.finished = true;
			this.next_symbol_index = this.string.length;
		}
		this.testByStep = function() {
			// Va empezando
			if (this.next_symbol_index == -1 ) {
				this.current_state = this.initial_state;
				this.next_symbol = this.string[0];
				// Create diagram
				$scope.$$childHead.diag.create(this);
				// Highlight el estado
				$scope.$$childHead.diag.highlight(this.current_state);
				this.next_symbol_index++;
			} else if (this.next_symbol_index < this.string.length) { // Ya empezó pero aún no termina de probar todo el string
				var symbol = this.string[this.next_symbol_index];
				this.current_state = this.transition(this.current_state, symbol);
				this.next_symbol_index++;
				this.next_symbol = this.string[this.next_symbol_index];
				// Highlight el estado
				$scope.$$childHead.diag.highlight(this.current_state);
			}

			if (this.next_symbol_index == this.string.length) { // Terminó de probar todo el string
				this.finished = true;
				this.accepted = ( this.accepted_states.indexOf(this.current_state) >= 0 );
			}
		}
		this.restart = function() {
			this.next_symbol_index = -1;
			this.accepted = false;
			this.finished = false;
			this.current_state = "";
		}
		this.run = function() {
			// this.next_symbol_index = 0;
			this.current_state = this.initial_state;
			for (var i = 0; i < this.string.length; i++) {
				var s = this.string[i]; // obtener el simbolo en la posicion i
				this.current_state = this.transition(this.current_state, s);
			}
			$scope.$$childHead.diag.highlight(this.current_state); // Highlight
			// 2) True si lo acepta, false si no
			return (this.accepted_states.indexOf(this.current_state) >= 0);
		}
		this.transition = function(q, s) {
			// return transitionFn['q1']['b']; //  return q0
			return this.transition_function[q][s];
		}

		// Instance Functions
		this.addState = function() {
			this.states.push(this.state);
			this.statesCounter++;

			// Update accepted_states
			this.accepted_states = buildAcceptedStates(this.states);

			// Update transition_function
			updateTransitionFunction(this.transition_function, this.getSymbols(), this.state);

			// Add the state to the diagram

			// Empty state
			this.state = emptyState(this.statesCounter);
		};

		this.removeState = function(index) {
			var deleted = this.states.splice(index, 1)[0];
			this.statesCounter--;
			this.state = emptyState(this.statesCounter);

			if (this.statesCounter == 0 || deleted.description === this.initial_state) {
				this.initial_state = "";
			}

			// Update accepted_states
			this.accepted_states = buildAcceptedStates(this.states);

			// Update transition_function
			this.transition_function = buildTransitionFunction(this.states, this.getSymbols());
		}

		this.showInput = function() {
			var input = "";
			for (var i = 0; i < this.string.length; i++) {
				if ( (i+1) == this.next_symbol_index) {
					input += "" + this.string[i] + "";
				} else {
					input += this.string[i];
				}
			}
			return input;
		}

		this.getSymbols = function() {
			return this.alphabet.split('');
		}
		this.nextSymbol = function() {
			return this.alphabet[this.next_symbol_index];
		}
		this.getTransitionSymbols = function() {
			var symbols = [];
			for (var state in this.transition_function) {
				for (var symbol in this.transition_function[state] ) {
					symbols.push(symbol);
				}
				break;
			}
			return symbols;
		}

		this.refreshTransitionFunction = function() {
			this.transition_function = buildTransitionFunction(this.states, this.getSymbols());
		}

		// Helper Functions
		buildAcceptedStates = function(states) {
			var accepted_states = [];
			for(var i = 0; i < states.length; i++) {
				if (states[i].accepted) {
					accepted_states.push(states[i].description);
				}
			}
			return accepted_states;
		}

		emptyState = function(counter) {
			return {
				description: "q" + counter,
				accepted: false
			};
		}
		var buildTransitionFunction = function(states, symbols) {
			var transitionFn = {};
			for (var i = 0; i < states.length; i++) {
				var el = {};
				transitionFn[states[i].description] = el;
				for(var j = 0; j < symbols.length; j++) {
					el[symbols[j]] = "";
				}
			}
			return transitionFn;
		}
		var updateTransitionFunction = function(transitionFn, symbols, state) {
			var el = {};
			for (var i = 0; i < symbols.length; i++) {
				el[symbols[i]] = "";
			}
			transitionFn[state.description] = el;
		}

		// Sample initial input
		this.initialize = function() {
			this.statesCounter = 2;
			this.string = "abbababb";
			this.alphabet = "ab";
			this.initial_state = "q0";

			this.states = [
				{
					description: "q0",
					accepted: false
				},
				{
					description: "q1",
					accepted: true
				}
			];
			this.transition_function = {
				"q0": {
					"a": "q0",
					"b": "q1"
				},
				"q1": {
					"a": "q0",
					"b": "q1"
				}
			};
		}
		// this.initialize();
		this.accepted_states = buildAcceptedStates(this.states);
		this.state = emptyState(this.statesCounter);
	}]);

})();


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _pure = require('recompose/pure');

var _pure2 = _interopRequireDefault(_pure);

var _SvgIcon = require('../../SvgIcon');

var _SvgIcon2 = _interopRequireDefault(_SvgIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ActionReportProblem = function ActionReportProblem(props) {
  return _react2.default.createElement(
    _SvgIcon2.default,
    props,
    _react2.default.createElement('path', { d: 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z' })
  );
};
ActionReportProblem = (0, _pure2.default)(ActionReportProblem);
ActionReportProblem.displayName = 'ActionReportProblem';
ActionReportProblem.muiName = 'SvgIcon';

exports.default = ActionReportProblem;


text:
class QDragEnterEvent;
class QDropEvent;
class QImage;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_actionOpen_triggered();

    void on_buttonBrowseOutput_clicked();

    void on_actionDirectories_triggered();

    void on_checkBoxOverwrite_toggled(bool checked);

private:
    Ui::MainWindow *ui;

    QSettings config;

    void setRowImage(int row, const QImage& image);
};

#endif // MAINWINDOW_HPP