text:
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.net.ssl.HttpsURLConnection;

/**
 * TMS tile downloader thread class.
 *
 * @author aecavac
 *
 */
public class TileDownloader implements Runnable {

	public TileDownloader() {
	}

	// Variables
	private String tileService;
	private String destPath;

	private int zoomLevelStartIndex = 0;
	private int zoomLevelEndIndex = 0;

	private int xStartIndex = 0;
	private int yStartIndex = 0;

	private int xEndIndex = 0;
	private int yEndIndex = 0;

	// Global Statistic Parameters
	public static int downImageCount = 0;

	/**
	 * Download tiles.
	 */
	private void downloadTiles() {

		String destImgPath = "";
		String destImgName = "";

		String tileServiceImg = "";

		for (int z = zoomLevelStartIndex; z <= zoomLevelEndIndex; z++) {

			int maxXOfCurrentZoomLevel;
			int maxYOfCurrentZoomLevel;
			int xStart;
			int yStart;
			int xEnd;
			int yEnd;

			maxXOfCurrentZoomLevel = (int) (Math.pow(2, z));
			maxYOfCurrentZoomLevel = (int) (Math.pow(2, z));

			// X start
			if ((z == zoomLevelStartIndex) && (xStartIndex != 0)) {
				xStart = xStartIndex;
			} else {
				xStart = 0;
			}

			// X end
			if ((z == zoomLevelEndIndex) && (xEndIndex != 0)) {
				xEnd = xEndIndex;
			} else {
				xEnd = maxXOfCurrentZoomLevel - 1;
			}

			for (int x = xStart; x <= xEnd; x++) {

				// Y Start
				if ((z == zoomLevelStartIndex) && (x == xStart)
						&& (yStartIndex != 0)) {
					yStart = yStartIndex;
				} else {
					yStart = 0;
				}

				// Y end
				if ((z == zoomLevelEndIndex) && (x == xEnd) && (yEndIndex != 0)) {
					yEnd = yEndIndex;
				} else {
					yEnd = maxYOfCurrentZoomLevel - 1;
				}

				for (int y = yStart; y <= yEnd; y++) {

					destImgPath = getDestPath() + "/" + z + "/" + x;
					destImgName = y + ".png";
					tileServiceImg = getTileService() + "/" + z + "/" + x + "/" + y
							+ ".png";

					//Check if image exist.
					File checkFile = new File(destImgPath + "/" + destImgName);
					if(checkFile.exists()){
//						System.out.println("EXIST : " + destImgPath + "/" + destImgName);
						continue;
					}
//					System.out.println("DOWNLOAD : " + destImgPath + "/" + destImgName);

					final byte[] imgBytes;

					if(this.getTileService().toUpperCase().startsWith("HTTPS")){
						imgBytes = this.getImageByteArrayHTTPS(tileServiceImg);
					}else{
						imgBytes = this.getImageByteArrayHTTP(tileServiceImg);
					}

					if (imgBytes == null) {
						// TODO : SAVE & TERMINATE || WAIT TO GET CONN
						return;
					}

					final boolean writeResult = this.writeImageToDestination(
							destImgPath, destImgName, imgBytes);

					if (!writeResult) {
						// TODO : SAVE & TERMINATE || WAIT TO GET CONN
						return;
					}

					downImageCount++;

					// Clean
					destImgPath = "";
					destImgName = "";
				}

				// Clean
				yStartIndex = 0;
			}

			// Clean
			xStartIndex = 0;
		}
		System.out.println("COMPLATED!");
	}

	/**
	 * Download image from http service.
	 * @param urlStr
	 * @return
	 */
	private byte[] getImageByteArrayHTTP(final String urlStr) {
		try {
			final URL url = new URL(urlStr);
			final InputStream in = new BufferedInputStream(url.openStream());
			final ByteArrayOutputStream out = new ByteArrayOutputStream();
			final byte[] buf = new byte[1024];
			int n = 0;
			while (-1 != (n = in.read(buf))) {
				out.write(buf, 0, n);
			}
			out.close();
			in.close();
			final byte[] response = out.toByteArray();
			return response;
		} catch (final Exception e) {
			System.out.println("getImageByteArrayHTTP:");
			System.out.println(urlStr);
			e.printStackTrace();
			return null;
		}
	}

	/**
	 * Download image from https service.
	 * @param urlStr
	 * @return
	 */
	private byte[] getImageByteArrayHTTPS(final String urlStr) {
		try {
			URL url = new URL(urlStr);
			HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
			if (con == null){
				return null;
			}

			final InputStream in = con.getInputStream();
			final ByteArrayOutputStream out = new ByteArrayOutputStream();
			final byte[] buf = new byte[1024];
			int n = 0;
			while (-1 != (n = in.read(buf))) {
				out.write(buf, 0, n);
			}

			out.close();
			in.close();
			final byte[] response = out.toByteArray();
			return response;
		} catch (final Exception e) {
			System.out.println("getImageByteArrayHTTPS:");
			System.out.println(urlStr);
			e.printStackTrace();
			return null;
		}
	}

	/**
	 * Write image to destination.
	 *
	 * @param destinationPath
	 * @param imageName
	 * @param image
	 * @return
	 */
	private boolean writeImageToDestination(final String destinationPath,
			final String imageName, final byte[] image) {
		try {
			final File file = new File(destinationPath);
			file.mkdirs();

			final FileOutputStream fos = new FileOutputStream(destinationPath
					+ "/" + imageName);
			fos.write(image);
			fos.close();
			return true;
		} catch (final Exception e) {
			System.out.println("writeImageToDestination:");
			System.out.println(destinationPath);
			e.printStackTrace();
			return false;
		}
	}

	public String getTileService() {
		return tileService;
	}

	public void setTileService(String tileService) {
		this.tileService = tileService;
	}

	public String getDestPath() {
		return destPath;
	}

	public void setDestPath(String destPath) {
		this.destPath = destPath;
	}

	public int getZoomLevelStartIndex() {
		return zoomLevelStartIndex;
	}

	public void setZoomLevelStartIndex(int zoomLevelStartIndex) {
		this.zoomLevelStartIndex = zoomLevelStartIndex;
	}

	public int getZoomLevelEndIndex() {
		return zoomLevelEndIndex;
	}

	public void setZoomLevelEndIndex(int zoomLevelEndIndex) {
		this.zoomLevelEndIndex = zoomLevelEndIndex;
	}

	public int getxStartIndex() {
		return xStartIndex;
	}

	public void setxStartIndex(int xStartIndex) {
		this.xStartIndex = xStartIndex;
	}

	public int getyStartIndex() {
		return yStartIndex;
	}

	public void setyStartIndex(int yStartIndex) {
		this.yStartIndex = yStartIndex;
	}

	public int getxEndIndex() {
		return xEndIndex;
	}

	public void setxEndIndex(int xEndIndex) {
		this.xEndIndex = xEndIndex;
	}

	public int getyEndIndex() {
		return yEndIndex;
	}

	public void setyEndIndex(int yEndIndex) {
		this.yEndIndex = yEndIndex;
	}

	@Override
	public void run() {
		this.downloadTiles();
	}
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.camel.impl;

import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.support.DefaultProducer;

/**
 * A base class for selector-based producers.
 */
public abstract class BaseSelectorProducer extends DefaultProducer {
    protected BaseSelectorProducer(Endpoint endpoint) {
        super(endpoint);
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        final Processor processor = getProcessor(exchange);
        if (processor != null) {
            processor.process(exchange);
        } else {
            onMissingProcessor(exchange);
        }
    }

    /**
     * Determine the processor to use to handle the exchange.
     *
     * @param exchange the message exchange
     * @return the processor to processes the message exchange
     * @throws Exception
     */
    protected abstract Processor getProcessor(Exchange exchange) throws Exception;

    /**
     * Invoked when no processor has been defined to process the message exchnage.
     *
     * @param exchange the message exchange
     * @throws Exception
     */
    protected abstract void onMissingProcessor(Exchange exchange) throws Exception;
}


text:
export function deleteAll(dir: string) {
  let docs = xdmp.directory(dir)
  while (true) {
    var doc = docs.next()
    if (doc.done) {
      break
    } else {
      xdmp.documentDelete(doc.value.baseURI)
    }
  }
}

export function deleteGraph(graph?: string) {
  var sem = require('/MarkLogic/semantics.xqy')
  graph = graph || 'http://marklogic.com/semantics#default-graph'
  sem.graphDelete(sem.iri(graph))
}

export function createCounter(uri: string) {
  xdmp.documentInsert(uri, {
    count: 0
  })
}

export function incrementCounter(uri: string): number {
  let counterDoc = cts.doc(uri)
  let counter: Counter = <any>counterDoc.root.toObject()
  let count = counter.count + 1
  xdmp.nodeReplace(counterDoc, {
    count: count
  })
  return count
}

export interface Counter {
  count: number
}


text:
from setuptools import setup, find_packages
import os

version = '1.0'

setup(name='wad.sitetheme',
      version=version,
      description="wad Diazo Plone Theme",
      long_description=open("README.txt").read() + "\n" +
                       open(os.path.join("docs", "HISTORY.txt")).read(),
      # Get more strings from
      # http://pypi.python.org/pypi?:action=list_classifiers
      classifiers=[
        "Framework :: Plone",
        "Programming Language :: Python",
        ],
      keywords='',
      author='Vorwaerts Werbung GbR',
      author_email='hallo@vorwaerts-werbung.de',
      url='http://dist.vorwaerts-werbung.de',
      license='GPL',
      packages=find_packages(exclude=['ez_setup']),
      namespace_packages=['wad'],
      include_package_data=True,
      zip_safe=False,
      install_requires=[
          'setuptools',
          'plone.app.theming',
          'plone.app.themingplugins',
          # -*- Extra requirements: -*-
      ],
      entry_points="""
      # -*- Entry points: -*-

      [z3c.autoinclude.plugin]
      target = plone
      """,
      setup_requires=["PasteScript"],
      paster_plugins=["ZopeSkel"],
      )


text:
import javax.crypto.spec.DHParameterSpec;
import java.io.*;
import java.math.BigInteger;
import java.net.Socket;
import java.security.AlgorithmParameterGenerator;
import java.security.AlgorithmParameters;
import java.security.SecureRandom;

public class ServerThread extends Thread
{
	private Server              server          = null;
	private Socket              socket          = null;
	private int                 ID              = -1;
	private String              name            = "";
	private DataInputStream     streamIn        = null;
	private DataOutputStream    streamOut       = null;

	private boolean             isAdmin         = false;
	private boolean             isGUI           = false;
	// Diffie-Hellman KeyExchange
	private BigInteger          a               = null;
	private BigInteger          p               = null;
	private String              enc_key         = "Encryption_Key";
	private boolean             key_exchanged   = false;

	public ServerThread(Server server, Socket socket)
	{
		super();
		this.server =   server;
		this.socket =   socket;
		ID          =   socket.getPort();
		name        =   String.valueOf(ID);
	}

	public void startDH_KeyExchange()
	{
		String[] values = generateDhParameters().split(",");

		p = new BigInteger(values[0]);
		BigInteger g = new BigInteger(values[1]);

		SecureRandom secureRandom = new SecureRandom();
		a = new BigInteger(String.valueOf(secureRandom.nextLong()));

		BigInteger resultA = g.modPow(a, p);

		System.out.println("send: |.DH " + g.toString() + " " + p.toString() + " " + resultA.toString());
		send("|.DH " + g.toString() + " " + p.toString() + " " + resultA.toString(),true);

		new Thread(
				new Runnable() {

					public void run() {

						try {
							Thread.sleep(10000);

							if(!key_exchanged)
							{
								send("No Key-Exchanged Disconnecting!",true);
								streamOut.flush();
								server.remove(ID,3);
							}

						} catch (Exception e) {

						}

					}
				}).start();

	}

	public static String generateDhParameters()
	{
		try
		{
			AlgorithmParameterGenerator algorithmParameterGenerator = AlgorithmParameterGenerator.getInstance("DH");
			algorithmParameterGenerator.init(1024);
			AlgorithmParameters params = algorithmParameterGenerator.generateParameters();
			DHParameterSpec dhSpec = params.getParameterSpec(DHParameterSpec.class);

			return dhSpec.getP() + "," + dhSpec.getG();

		} catch (Exception ex) {

			System.out.println("Error: " + ex.getMessage());

		}
		return null;
	}

	public void send(String msg,boolean... forceSend){

		if(forceSend.length <  1)
		{
			forceSend = new boolean[1];
			forceSend[0] = false;
		}

		try
		{
			if(key_exchanged ||  forceSend[0])
			{
				msg = AES.encrypt(msg,enc_key);
				streamOut.writeUTF(msg);
				streamOut.flush();
			}
		}
		catch (Exception ex)
		{
			System.out.println(ID + " Error: " + ex.getMessage());
			server.remove(ID, 1);
			stop();
		}
	}

	public int getID() { return ID; }

	public void setClientName(String s) { name = s; send(Commands.CHANGE_NAME_LABEL + name + " (" + ID + ")"); }

	public String getClientName() { return name; }

	public boolean isAdmin() { return isAdmin; }

	public Socket getSocket() { return socket; }

	public void setAdmin(){ isAdmin = true; send(Commands.CHANGE_TITLE + "You're Admin"); }

	public void removeAdmin() { isAdmin = false; send(Commands.CHANGE_TITLE + "You're a normal User!"); }

	public boolean isGUI() { return isGUI; }

	public void setGUI() { isGUI = true; }

	public boolean isKeyExchanged() { return key_exchanged; }

	public void finaliseDiffieHellman(BigInteger b)
	{
		enc_key = b.modPow(a, p).toString();
		key_exchanged = true;

		send("Welcome " + socket.getPort() + ",\nuse /name your_name to change your name\nuse /close to close the connection");
		send(Commands.CHANGE_TITLE + "Welcome to the Server!");

	}

	public void run()
	{
		System.out.println("Server Thread " + ID + " running.");

		while (true)
		{
			try
			{
				String in = streamIn.readUTF();
				in = AES.decrypt(in,enc_key);
				server.handle(ID, in, name);
			}
			catch (Exception ex)
			{
				System.out.println(ID + " Error: " + ex.getMessage());
				server.remove(ID,1);
				stop();
			}
		}
	}
	public void open() throws IOException
	{
		streamIn = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
		streamOut = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));
	}
	public void close() throws IOException
	{
		if  (socket     != null)      socket.close();
		if  (streamIn   != null)      streamIn.close();
		if  (streamOut  != null)      streamOut.close();
	}
}


text:
package com.amazonaws.services.guardduty.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.guardduty.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * UpdateMalwareScanSettingsResult JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateMalwareScanSettingsResultJsonUnmarshaller implements Unmarshaller<UpdateMalwareScanSettingsResult, JsonUnmarshallerContext> {

    public UpdateMalwareScanSettingsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        UpdateMalwareScanSettingsResult updateMalwareScanSettingsResult = new UpdateMalwareScanSettingsResult();

        return updateMalwareScanSettingsResult;
    }

    private static UpdateMalwareScanSettingsResultJsonUnmarshaller instance;

    public static UpdateMalwareScanSettingsResultJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new UpdateMalwareScanSettingsResultJsonUnmarshaller();
        return instance;
    }
}


text:
Teste corpo HTML

Assim é um email HTML


text:
namespace carto {

    void ThreadUtils::SetThreadPriority(ThreadPriority::ThreadPriority priority) {
        // Not really supported on Windows Phone
        ::SetThreadPriority(::GetCurrentThread(), static_cast<int>(priority) * THREAD_PRIORITY_HIGHEST / static_cast<int>(ThreadPriority::MAXIMUM));
    }

    ThreadUtils::ThreadUtils() {
    }

}


text:
module Rails
  module Command
    class RunnerCommand < Base
      class_option :environment, aliases: "-e", type: :string,
        default: Rails::Command.environment.dup,
        desc: "The environment for the runner to operate under (test/development/production)"

      def help
        super
        puts self.class.desc
      end

      def self.banner(*)
        "#{super} [<'Some.ruby(code)'> | <filename.rb>]"
      end

      def perform(code_or_file = nil)
        unless code_or_file
          help
          exit 1
        end

        ENV["RAILS_ENV"] = options[:environment]

        require_application_and_environment!
        Rails.application.load_runner

        if File.exist?(code_or_file)
          $0 = code_or_file
          Kernel.load code_or_file
        else
          begin
            eval(code_or_file, binding, __FILE__, __LINE__)
          rescue SyntaxError, NameError => error
            $stderr.puts "Please specify a valid ruby command or the path of a script to run."
            $stderr.puts "Run '#{self.class.executable} -h' for help."
            $stderr.puts
            $stderr.puts error
            exit 1
          end
        end
      end
    end
  end
end


text:
@interface BADFriendsViewController ()

@property (strong, nonatomic) NSMutableArray* friendsArray;

@property (assign, nonatomic) BOOL firstTimeAppear;

@end

@implementation BADFriendsViewController

static NSInteger friendsInRequest = 20;

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.friendsArray = [NSMutableArray array];

    [self getFriendsFromServer];

    self.firstTimeAppear = YES;

}

- (void)viewDidAppear:(BOOL)animated {

    [super viewDidAppear:animated];

    if (self.firstTimeAppear) {

        self.firstTimeAppear = NO;

        [[BADServerManager sharedManager] authorizeUser:^(BADUser *user) {

            NSLog(@"Authorised user");

        }];

    }

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - API

- (void) getFriendsFromServer {

    [[BADServerManager sharedManager]
     getFriendsWithOffset:[self.friendsArray count]
     count:friendsInRequest
     onSuccess:^(NSArray *friends) {

         [self.friendsArray addObjectsFromArray:friends];

         NSMutableArray* newPaths = [NSMutableArray array];
         for (int i = (int)[self.friendsArray count] - (int)[friends count]; i < [self.friendsArray count]; i++) {
             [newPaths addObject:[NSIndexPath indexPathForRow:i inSection:0]];
         }

         [self.tableView beginUpdates];
         [self.tableView insertRowsAtIndexPaths:newPaths withRowAnimation:UITableViewRowAnimationTop];
         [self.tableView endUpdates];

     }
     onFailure:^(NSError *error, NSInteger statusCode) {
         NSLog(@"error = %@, code = %ld", [error localizedDescription], (long)statusCode);
     }];
}

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return [self.friendsArray count] + 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString* identifier = @"Cell";

    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:identifier];

    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }

    if (indexPath.row == [self.friendsArray count]) {

        cell.textLabel.text = @"end cell";
        cell.imageView.image = nil;

        [self getFriendsFromServer];

    } else {

        BADUser* friend = [self.friendsArray objectAtIndex:indexPath.row];

        cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", friend.firstName, friend.lastName];

        NSURLRequest* request = [NSURLRequest requestWithURL:friend.imageURL];

        __weak UITableViewCell* weakCell = cell;

        cell.imageView.image = nil;

        [cell.imageView
         setImageWithURLRequest:request
         placeholderImage:nil
         success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
             weakCell.imageView.image = image;
             [weakCell layoutSubviews];
         }
         failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {

         }];

    }

    return cell;
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    if (indexPath.row == [self.friendsArray count]) {
        [self getFriendsFromServer];
    }

}

@end


text:
/* Helpers for compatibility in the C modules between Python 2 and Python 3. */

#ifndef __AIPY_COMPAT_H
#define __AIPY_COMPAT_H

#if PY_MAJOR_VERSION >= 3
# define PyCapsule_Type PyCObject_Type
# define PyInt_AsLong PyLong_AsLong
# define PyInt_FromLong PyLong_FromLong
# define PyInt_Check PyLong_Check
# define PyString_FromString PyUnicode_FromString
# define PyString_Check PyUnicode_Check
# define PyString_Size PyUnicode_GET_LENGTH
# define PyString_FromStringAndSize PyUnicode_FromStringAndSize
# define PyString_AsString PyUnicode_AsUTF8
#endif

#ifndef PyMODINIT_FUNC
#define PyMODINIT_FUNC void
#endif

#if PY_MAJOR_VERSION >= 3
# define MOD_ERROR_VAL NULL
# define MOD_SUCCESS_VAL(val) val
# define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void)
# define MOD_DEF(ob, name, methods, doc) \
    static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, name, doc, -1, methods, }; \
    ob = PyModule_Create(&moduledef);
#else
# define MOD_ERROR_VAL
# define MOD_SUCCESS_VAL(val)
# define MOD_INIT(name) PyMODINIT_FUNC init##name(void)
# define MOD_DEF(ob, name, methods, doc) \
    ob = Py_InitModule3(name, methods, doc);
#endif

#endif


text:
#include <errno.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "errors.h"
#include "options.h"

enum state
{
    ENTRY_STATE,
    DASH_STATE,
    SHORT_OPTION_STATE,
    BEFORE_SHORT_ARGUMENT_STATE,
    SHORT_ARGUMENT_STATE,
    DASH_DASH_STATE,
    LONG_OPTION_STATE,
    LONG_ARGUMENT_STATE,
    OPERAND_STATE,
    FORSED_OPERAND_STATE,
    FAIL_STATE
};

struct context
{
    const char *synopsis;
    const struct option *options;
    const struct error *errors;
    const struct option *option;
    const char *s;
    int result;
};

typedef int (* match_t)(const struct option *option, const char *p, int size);

static int as_long_option(const struct option *option, const char *p, int length)
{
    return option->long_name && strlen(option->long_name) == length && !strncmp(p, option->long_name, length);
}

static int as_short_option(const struct option *option, const char *p, int length)
{
    return option->short_name && strlen(option->short_name) == length && !strncmp(p, option->short_name, length);
}

static int has_option(struct context *context, const char *p, match_t match)
{
    const struct option *option = context->options;

    while (option->role != OTHER_OPTION)
    {
        if (match(option, context->s, p - context->s))
            break;

        option++;
    }

    context->option = option;
    return option->role != OTHER_OPTION && option->handler;
}

static int has_other_option(struct context *context)
{
    const struct option *option = context->options;

    while (option->role != OTHER_OPTION)
        option++;

    context->option = option;
    return option->role == OTHER_OPTION && option->handler;
}

static int has_argument(const struct context *context)
{
    return context->option->role == JOINT_OPTION;
}

static enum state fail(struct context *context, int result)
{
    const struct error *error = context->errors;
    const char *usage = "Unexpected error";

    context->result = result;

    while (error->result)
    {
        if (result == error->result)
        {
            usage = result == INTERNAL_ERROR ? strerror(errno) : error->usage;
            break;
        }
        error++;
    }

    fprintf(stdout, TTY_NONE " " TTY_BOLD "FAILED" TTY_NONE " [%s, %d]\n", usage, result);
    return FAIL_STATE;
}

static enum state done(enum state state)
{
    fprintf(stdout, TTY_NONE " done\n");
    return state;
}

static enum state invoke(struct context *context, const char *p, enum state state)
{
    int result = INVALID_OPTION;

    switch (context->option->role)
    {
    case PLAIN_OPTION:
        result = ((plain_handler_t)context->option->handler)();
        break;

    case JOINT_OPTION:
        result = ((joint_handler_t)context->option->handler)(context->s);
        break;

    case USAGE_OPTION:
        result = ((usage_handler_t)context->option->handler)(context->synopsis, context->options, context->errors);
        break;

    case OTHER_OPTION:
        result = ((other_handler_t)context->option->handler)(context->s);
        break;

    default:
        break;
    }

    context->s = 0;
    return result ? fail(context, result) : done(state);
}

static enum state invalid(struct context *context, const char *p)
{
    fprintf(stdout, TTY_NONE "Processing \"%*s\"...", (int)(p - context->s), context->s);
    return fail(context, INVALID_OPTION);
}

static enum state clean(struct context *context, enum state state)
{
    context->s = 0;
    return state;
}

static void collect(struct context *context, const char *p)
{
    if (context->s == 0)
        context->s = p;
}

static enum state process(struct context *context, enum state state, const char *p)
{
    const char dash = '-';
    const char equal = '=';
    const char null = 0;

    collect(context, p);

    switch (state)
    {
    case ENTRY_STATE:
        if (*p == dash)
            return clean(context, DASH_STATE);

        return OPERAND_STATE;

    case DASH_STATE:
        if (*p == dash)
            return clean(context, DASH_DASH_STATE);

        if (isalnum(*p) && has_option(context, p + 1, as_short_option))
            return has_argument(context) ? clean(context, BEFORE_SHORT_ARGUMENT_STATE) : invoke(context, p, SHORT_OPTION_STATE);

        break;

    case SHORT_OPTION_STATE:
        if (*p == null)
            return clean(context, ENTRY_STATE);

        if (isalnum(*p) && has_option(context, p + 1, as_short_option))
            return has_argument(context) ? invalid(context, p) : invoke(context, p, SHORT_OPTION_STATE);

        break;

    case BEFORE_SHORT_ARGUMENT_STATE:
        if (*p == null)
            return clean(context, SHORT_ARGUMENT_STATE);

        return SHORT_ARGUMENT_STATE;

    case SHORT_ARGUMENT_STATE:
        if (*p == null)
            return invoke(context, p, ENTRY_STATE);

        return SHORT_ARGUMENT_STATE;

    case DASH_DASH_STATE:
        if (*p == null)
            return clean(context, FORSED_OPERAND_STATE);

        if (isalnum(*p))
            return LONG_OPTION_STATE;

        break;

    case LONG_OPTION_STATE:
        if (*p == null && has_option(context, p, as_long_option))
            return has_argument(context) ? clean(context, LONG_ARGUMENT_STATE) : invoke(context, p, ENTRY_STATE);

        if (*p == equal && has_option(context, p, as_long_option))
            return has_argument(context) ? clean(context, LONG_ARGUMENT_STATE) : invalid(context, p);

        if (isalnum(*p) || ispunct(*p))
            return LONG_OPTION_STATE;

        break;

    case LONG_ARGUMENT_STATE:
        if (*p == null)
            return invoke(context, p, ENTRY_STATE);

        return LONG_ARGUMENT_STATE;

    case OPERAND_STATE:
    case FORSED_OPERAND_STATE:
        if (*p == null)
            return has_other_option(context) ? invoke(context, p, state == OPERAND_STATE ? ENTRY_STATE : state) : invalid(context, p);

        return state;

    default:
        break;
    }

    return invalid(context, p);
}

int invoke_options(const char *synopsis, const struct option options[], const struct error errors[], int argc, char *argv[])
{
    struct context context = {synopsis, options, errors, 0, 0, 0};
    enum state state = ENTRY_STATE;
    const char *p = (argc--, *++argv);

    while (argc)
    {
        if ((state = process(&context, state, p)) == FAIL_STATE)
            break;

        p = *p ? p + 1 : (argc--, *++argv);
    }

    if ((state == LONG_ARGUMENT_STATE) || (state == SHORT_ARGUMENT_STATE))
        process(&context, state, "");

    return context.result;
}

static void usage(FILE *file, const char *p, int width)
{
    const char *s = p;
    int column = 0;

    while (*p)
    {
        if (isspace(*p))
        {
            if (column >= width)
            {
                fprintf(file, "\t%.*s\n", column, s);
                column = 0;
            }

            if (column == 0)
                s = p + 1;

            if (column)
                column++;
        }
        else
        {
            column++;
        }

        p++;
    }
    fprintf(file, "\t%.*s\n\n", column, s);
}

int usage_options(const char *synopsis, const struct option options[], const struct error errors[])
{
    const struct option *option = options;
    const struct error *error = errors;

    fprintf(stdout, TTY_NONE "Synopsis:\n");
    fprintf(stdout, TTY_NONE "\t%s\n\n", synopsis);
    fprintf(stdout, TTY_NONE "Options:\n");

    while (option->role != OTHER_OPTION)
    {
        if (option->short_name && option->long_name)
        {
            fprintf(stdout, TTY_BOLD "-%s, --%s", option->short_name, option->long_name);
        }
        else
        {
            if (option->short_name)
                fprintf(stdout, TTY_BOLD "-%s", option->short_name);

            if (option->long_name)
                fprintf(stdout, TTY_BOLD "--%s", option->long_name);
        }

        fprintf(stdout, option->role == JOINT_OPTION ? TTY_NONE " " TTY_UNLN "ARG\n" TTY_NONE : TTY_NONE "\n" TTY_NONE);
        usage(stdout, option->usage, 40);
        option++;
    }

    fprintf(stdout, TTY_NONE "Return values:\n");

    while (error->result)
    {
        fprintf(stdout, TTY_UNLN "%d" TTY_NONE "\t%s\n", error->result, error->usage);
        error++;
    }

    fprintf(stdout, TTY_UNLN "%d" TTY_NONE "\t%s\n", error->result, error->usage);
    fprintf(stdout, TTY_NONE "\nPrintitng help...");
    return 0;
}


text:
<TITLE>Review for Simon Birch (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Simon Birch (1998)

reviewed by
Greg King

SIMON BIRCH (PG).
(Hollywood Pictures/Buena Vista International)
Director: Mark Steven Johnson
Stars: Joseph Mazzello, Ian Mitchell Smith, Oliver Platt, David
Starthairn, Jan Hooks, Ashley Judd, Jim
Carrey, Dana Ivey
Running time: 110 minutes.

Last year we had two films about killer meteors heading
towards earth, and two animated films looking at the secret world
inside an ant colony.  This year we have two similar films exploring
the unique friendship that develops between two twelve year old
outcasts, one suffering from genetic birth defects, the other obsessed
with his father.

Adapted from the novel A Prayer For Owen Meany, written by
John Irving (The World According To Garp, etc), Simon Birch is a
touching tale of a childhood friendship that leaves a lasting
impression.  This moving but overly saccharine story also shares many
ideas and themes with the upcoming The Mighty.  It's unfortunate that
the decidedly inferior Simon Birch is being released locally before
that far more powerful, inspiring and genuinely moving film.

Writer/director Mark Steven Johnson (best known for writing
the two Grumpy Old Men films) has made numerous changes to Irving's
sprawling novel, but has retained its spirit and flavour.  Set in
1964, the film focuses on one crucial year in the life of the
eponymous Simon and his best friend Joe Wenteworth (Joseph Mazzello,
from Jurassic Park, The River Wild, etc).

Pint sized Simon (newcomer Ian Mitchell Smith) was the
smallest birth ever recorded at Gravestown's hospital.  A small,
precocious and slightly deformed kid, he is largely neglected by his
apathetic parents and ridiculed by many of the unsympathetic
townsfolk.  Simon believes that he is God's instrument on this earth,
but is impatient about waiting to find out his true purpose.  His
strong faith leads him to constantly clash with the humourless
reverend Russell (David Strathairn), who lacks the traditional
Christian values of tolerance, compassion and forgiveness.

The illegitimate Joe doesn't know the identity of his father,
and his mother (Ashley Judd) goes to her grave with the secret.  Simon
becomes involved in helping Joe search to uncover the identity of his
father, a quest that will change their lives and have devastating
consequences.

As with The Mighty, the two young stars hold their own against
the more accomplished adult performers.  Both Mazzello and Smith
develop a wonderful rapport that enriches the movie, and their
engaging performances provide the film with its solid emotional punch.
Smith delivers a wonderful performance in a demanding role.  He is
likely to have a short film career (pardon the pun), because he
suffers from a rare degenerative disease, and there probably aren't a
lot of roles around for someone with his distinctive stature and
physical size.  (Smith apparently also auditioned for a very similar
role in The Mighty, but eventually lost out to Macaulay Culkin's
younger brother Keiran.)

As usual, the very talented Mazzello is excellent, bringing
intelligence and a sense of compassion to his role.  Jim Carrey
appears briefly as the adult Joe, who narrates this quirky but
engaging tale.  The very busy Oliver Platt delivers a nicely
understated but sympathetic performance as Ben, the drama teacher who
becomes a surrogate father to the orphaned Joe.

Best known as a screen writer, Johnson makes his directorial
debut here, but his direction is occasionally a little flaccid.  The
film seems overlong, and episodic in nature, and could have been
tightened up in a number of areas.  Johnson also seems unsure of his
target audience.  The film includes a number of potentially crowd
pleasing elements - there's tragedy, big emotional moments, and lots
of comedy, especially during the staging of the town's "first, full
contact Christmas Pageant."  As the film is set in the early '60's,
Johnson also uses the almost obligatory soundtrack to help bring the
era to life.

Simon Birch may well be a moving and heart breaking tale of a
beautiful friendship between two pre-pubescent boys, but somehow it
seems phoney and unnecessarily manipulative when compared to the
superior The Mighty.  Unfortunately, local audiences will have to wait
a couple of months before they can compare the two and make up their
own minds about their respective qualities.

***
greg king
http://www.netau.com.au/gregking

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
//
//  NSString+Extension.m
//  15-QQ
//
//  Created by Madao on 15/6/9.
//  Copyright (c) 2015年 Madao. All rights reserved.
//

#import "NSString+Extension.h"
#import <CommonCrypto/CommonDigest.h>

@implementation NSString (Extension)

/**
 *  计算文本框尺寸
 *
 *  @param maxSize 文本框最大尺寸
 *  @param font    文本字体
 *
 */
- (CGSize)sizeWithFont:(UIFont *)font andMaxSize:(CGSize)maxSize{

    NSDictionary *attrs = @{NSFontAttributeName:font};
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes: attrs context:nil].size;

}

- (CGSize)sizeWithFont:(UIFont *)font
{
    return [self sizeWithFont:font andMaxSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
}

- (NSInteger)fileSize
{
    NSFileManager *mgr = [NSFileManager defaultManager];
    // 判断是否为文件
    BOOL dir = NO;
    BOOL exists = [mgr fileExistsAtPath:self isDirectory:&dir];
    // 文件\文件夹不存在
    if (exists == NO) return 0;

    if (dir) { // self是一个文件夹
        // 遍历caches里面的所有内容 --- 直接和间接内容
        NSArray *subpaths = [mgr subpathsAtPath:self];
        NSInteger totalByteSize = 0;
        for (NSString *subpath in subpaths) {
            // 获得全路径
            NSString *fullSubpath = [self stringByAppendingPathComponent:subpath];
            // 判断是否为文件
            BOOL dir = NO;
            [mgr fileExistsAtPath:fullSubpath isDirectory:&dir];
            if (dir == NO) { // 文件
                totalByteSize += [[mgr attributesOfItemAtPath:fullSubpath error:nil][NSFileSize] integerValue];
            }
        }
        return totalByteSize;
    } else { // self是一个文件
        return [[mgr attributesOfItemAtPath:self error:nil][NSFileSize] integerValue];
    }
}

- (NSString *)md5 {
    const char *cStr = [self UTF8String];
    unsigned char result[16];

    CC_MD5(cStr, (CC_LONG)strlen(cStr), result);

    return [NSString stringWithFormat:
            @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
            result[0], result[1], result[2], result[3],
            result[4], result[5], result[6], result[7],
            result[8], result[9], result[10], result[11],
            result[12], result[13], result[14], result[15]];
}

@end


text:
<?xml version="1.0"?>
<!--

-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <container name="non_cachable_container1-1" label="test1" htmlTag="div" htmlId="non_cachable_container11" htmlClass="class11">
        <block class="Magento\Framework\View\Element\Text" name="block-1-in-non-cacheable-container1" cacheable="false">
            <action method="setText">
                <argument name="text" xsi:type="string">Test11</argument>
            </action>
        </block>
    </container>
</layout>


text:
#ifndef __ARCH_MIPS_INTERRUPT_HH__
#define __ARCH_MIPS_INTERRUPT_HH__

#include <string>

#include "arch/mips/faults.hh"
#include "base/compiler.hh"
#include "base/misc.hh"
#include "params/MipsInterrupts.hh"
#include "sim/serialize.hh"
#include "sim/sim_object.hh"

class BaseCPU;
class Checkpoint;

namespace MipsISA
{

class Interrupts : public SimObject
{
  public:
    typedef MipsInterruptsParams Params;

    const Params *
    params() const
    {
        return dynamic_cast<const Params *>(_params);
    }

    Interrupts(Params * p) : SimObject(p)
    {
    }

    void
    setCPU(BaseCPU *_cpu)
    {}

    //  post(int int_num, int index) is responsible
    //  for posting an interrupt. It sets a bit
    //  in intstatus corresponding to Cause IP*. The
    //  MIPS register Cause is updated by updateIntrInfo
    //  which is called by checkInterrupts
    //
    void post(int int_num, ThreadContext *tc);
    void post(int int_num, int index);

    // clear(int int_num, int index) is responsible
    //  for clearing an interrupt. It clear a bit
    //  in intstatus corresponding to Cause IP*. The
    //  MIPS register Cause is updated by updateIntrInfo
    //  which is called by checkInterrupts
    //
    void clear(int int_num, ThreadContext* tc);
    void clear(int int_num, int index);

    //  clearAll() is responsible
    //  for clearing all interrupts. It clears all bits
    //  in intstatus corresponding to Cause IP*. The
    //  MIPS register Cause is updated by updateIntrInfo
    //  which is called by checkInterrupts
    //
    void clearAll(ThreadContext *tc);
    void clearAll();

    // getInterrupt(ThreadContext * tc) checks if an interrupt
    //  should be returned. It ands the interrupt mask and
    //  and interrupt pending bits to see if one exists. It
    //  also makes sure interrupts are enabled (IE) and
    //  that ERL and ERX are not set
    //
    Fault getInterrupt(ThreadContext *tc);

    // updateIntrInfo(ThreadContext *tc) const syncs the
    //  MIPS cause register with the instatus variable. instatus
    //  is essentially a copy of the MIPS cause[IP7:IP0]
    //
    void updateIntrInfo(ThreadContext *tc) const;
    bool interruptsPending(ThreadContext *tc) const;
    bool onCpuTimerInterrupt(ThreadContext *tc) const;

    bool
    checkInterrupts(ThreadContext *tc) const
    {
        return interruptsPending(tc);
    }

    void
    serialize(CheckpointOut &cp) const override
    {
        fatal("Serialization of Interrupts Unimplemented for MIPS");
    }

    void
    unserialize(CheckpointIn &cp) override
    {
        fatal("Unserialization of Interrupts Unimplemented for MIPS");
    }
};

}

#endif


text:
Reports instance methods having the same name and the same number of parameters with the same or compatible types as
a method in a superclass. In this case, the child method overloads the parent method, instead of overriding it.
While that may be intended, if unintended it may result in latent bugs.

Use the checkbox below also report even if the parameter types are not compatible.

Powered by InspectionGadgets


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Blog - Fishing Template</title>
	<link rel="stylesheet" href="css/style.css" type="text/css">

					Register/

					My Account

					Help/

					Contact Us

						Shopping Cart: 0 item

						$ 0.00

						Home

						Featured Products

						Products

						Gift Card

						Clearance

Blog

Recent Post

							Cras tempor turpis

							Mattis tempor

							Lectus tincidunt

							Pharetra metus

							Donec vitae vehicula

Archive

							Cras tempor turpis

							Mattis tempor

							Lectus tincidunt

							Pharetra metus

							Donec vitae vehicula

					This is just a place holder, so you can see what the site would look like.

						This website template has been designed by Free Website Templates for you, for free. You can replace all this text with your own text. You can remove any link to our website from this website template, you're free to use this website template without linking back to us. If you're having problems editing this website template, then don't hesitate to ask for help on the Forumss.

						Cras tincidunt tortor vel arcu pharetra et molestie enim vehicula. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer non nulla nec nunc interdum imperdiet non vitae dui. Aliquam vulputate augue in odio egestas tincidunt. Integer eget tortor ligula. Vestibulum dictum scelerisque justo nec cursus. Donec euismod placerat lligula, vitae faucibus enim adipiscing sed. Nullam nec magna diam, id cursus justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.Phasellus sagittis eros quam, in tincidunt nisl. Nullam porta, tellus venenatis sodales semper, arcu massa lobortis orci, eu lobortis massa lectus id magna. Nullam sodales ipsum in massa consectetur sollicitudin in ac lorem. Sed vel enim arcu.

						Looking for more templates? Just browse through all our Free Website	Templates and find what you´re looking for. But if you don´t find any website template you can use, you can try our Free Web Design service and tell us all about it. Maybe you´re looking for something different, something special. And we love the challenge of doing something	different and something special.

				 © Copyright © 2011. All rights reserved

Shop

							Products

							Featured Products

							Clearance

							Gift Card

About

							The Company

							Shipping FAQ's

							Blog

							Help

lets be friends & Share us to the world


text:
<?php

/**
 * Rendering function that implements simple template inheritance.
 *
 * UView renders plain PHP templates with support for basic template inheritance
 * "à la Twig".
 *
 * @param string $_template Name of the template to render without the extention.
 * @param array  $_data     Optional. Data to feed to the template.
 * @param string $_dir      Optional. Root directory for the templates. Default: templates/.
 *
 * @return string Rendered text.
 */
function uview(string $_template, array $_data = [], string $_dir = 'templates/')
{
    extract($_data);

    $_data['__parent'] =  null;

    // Starts a block: captures the content of the block in the _data scope.
    // Only the content of the top block is stored.
    $block = function($name) use(&$_data) {
        ob_start(function($buf) use(&$name, &$_data) {
            if(empty($_data[$name])) {
                $_data[$name] = $buf;
            }
            return $_data[$name];
        });
    };

    // Ends a block: flushes the top-most output buffer and leaves the block.
    $endblock = function() use (&$_data) {
        ob_end_flush();
    };

    // Extends a template by setting the name of the parent template.
    $extends = function($name) use (&$_data) {
        $_data['__parent'] = $name;
    };

    // Rendering of the template for the cuurent level.
    ob_start();
    require("$_dir$_template.php");
    $_content = trim(ob_get_contents());
    ob_end_clean();

    $parent = $_data['__parent'];

    // If a parent template exists, uview is called recursively.
    return isset($parent) ? uview($parent, $_data, $_dir) : $_content;
}


text:
package org.apache.archiva.policies;

/**
 * Options for download error update policies
 *
 * @author Martin Stockhammer <martin_s@apache.org>
 */
public enum DownloadErrorOption implements PolicyOption {

    STOP("stop"),QUEUE("queue-error"),IGNORE("ignore"),ALWAYS("always"), NOT_PRESENT("not-present");

    private final String id;

    DownloadErrorOption(String id) {
        this.id = id;
    }

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

    @Override
    public PolicyOption ofId(String id) {
        for (StandardOption option : StandardOption.values()) {
            if (option.getId().equals(id)) {
                return option;
            }
        }
        return StandardOption.NOOP;
    }

    @Override
    public String toString() {
        return id;
    }
}


text:
import { LatLng } from '@agm/core';
import { Http } from '@angular/http';
import { Injectable } from '@angular/core';
import {Observable} from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';

@Injectable()
export class DataService {

  constructor(private http: Http) {}

  getEstado (codigo_estado: number) {
    return this.http.get(`assets/data/coordenadas/${codigo_estado}.json`)
      .map((response) => response.json());
  }

  listEstados(): Array<Object> {
    const data = [];

    this.http.get('assets/data/estados.json')
    .map((response) => response.json())
    .subscribe(estados => {
      estados.map(estado => {
        data.push({
          codigo: estado.codigo,
          nome: estado.nome,
          uf: estado.uf,
          latLng: estado.capital.latLng.reverse()
        });
      });
    });
    return data;
  }

  listRegioesIntermediarias(estado: number): Array<Object> {
    const data = [];

    this.http.get(`assets/data/regioes.intermediarias.json`)
    .map((response) => response.json())
    .subscribe(regioes => {
      regioes[estado].map(regiao => {
        data.push({codigo: regiao.codigo, nome: regiao.nome});
      });
    });

    return data;
  }

  listRegioesImediatas(regiaoIntermediaria: number): Array<Object> {
    const data = [];

    this.http.get(`assets/data/regioes.imediatas.json`)
    .map((response) => response.json())
    .subscribe(regioes => {
      regioes[regiaoIntermediaria].map(regiao => {
        data.push({codigo: regiao.codigo, nome: regiao.nome});
      });
    });

    return data;
  }

  getCodigoByUF(uf, estadosList) {
    return estadosList.filter((estado) => {
      return estado.uf.includes(uf);
    }).map(estado => estado.codigo)[0];
  }

  getCapitalLatLng(codigo, estadosList) {
    return estadosList.filter((estado) => {
      return estado.codigo.includes(codigo);
    }).map(estado => { return estado.latLng; })[0];
  }

  listMunicipios() {
    return this.http.get('assets/data/municipios.json')
    .map((response) => response.json());

  }

}


text:
package org.apache.cordova.imageprocessing;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;

public class ImageProcessing extends CordovaPlugin {

    public static final String LOG_TAG = "ImageProcessing";
    public CallbackContext callbackContext;

    private Bitmap resize(Bitmap image, int newWidth, int newHeight, boolean keepScale)
    {
		if (newWidth > 0 && newHeight > 0) {
        int width = image.getWidth();
        int height = image.getHeight();
        int finalWidth = width;
        int finalHeight = height;

    		/*if(keepScale)
    		{
		        //Log.d("autocrop", width + " x " + height);
		        float scaleFactor = (width > height) ? (float)maxWidth / width : (float)maxHeight / height;
            //Log.d("autocrop", "" + scaleFactor);
            finalWidth = (int)(width * scaleFactor);
		        finalHeight = (int)(height * scaleFactor);
	        }*/

	        image = Bitmap.createScaledBitmap(image, finalWidth, finalHeight, true);
	        return image;
	    } else {
	        return image;
	    }
    }

    private void saveImage(Bitmap image, String destinationUri) throws JSONException, IOException
    {
      //TODO: Support the full path
      File folder = new File(Environment.getExternalStorageDirectory(), "Pictures");
      if (!folder.exists()) {
        folder.mkdirs();
      }

      File f = new File(folder, destinationUri);

      FileOutputStream fos = new FileOutputStream(f);
      image.compress(Bitmap.CompressFormat.PNG, 100, fos);

      JSONObject jsonRes = new JSONObject();
      jsonRes.put("filePath",f.getAbsolutePath());
      PluginResult result = new PluginResult(PluginResult.Status.OK, jsonRes);
      callbackContext.sendPluginResult(result);
    }

    @Override
    public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
        Log.d(LOG_TAG, "action: " + action);
        Log.d(LOG_TAG, "args: " + args.toString());

        this.callbackContext = callbackContext;

        if (action.equals("resize")) {
          final String sourceUri = (String) args.get(0);
          final String destinationUri = (String) args.get(1);
          final int newWidth = args.getInt(2);
          final int newHeight = args.getInt(3);
          final boolean keepScale = args.getBoolean(4);

          super.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public void run() {
              try
              {
                //TODO: Validate if image exists
                //TODO: Image quality
                Bitmap image = BitmapFactory.decodeFile(sourceUri);

                Bitmap newImage = resize(image, newWidth, newHeight, keepScale);

                saveImage(newImage, destinationUri);

              } catch (JSONException e) {
                callbackContext.error(e.getMessage());

              } catch (IOException e) {
                callbackContext.error(e.getMessage());
              }
            }
          });

          return true;
        }
        else if (action.equals("rotate")) {
        }
        else if (action.equals("crop")) {
        }

        callbackContext.success();
        return true;
    }

}


text:
import {parallel} from 'async'
import {extname} from 'path'
import {debug, extend, map, match} from '../../utils'

let log = debug('metalsmith:minify')

const DEFAULTS = {
  pattern: '**/*.+(css|html|js)'
}

export default function (options) {
  options = extend({}, DEFAULTS, options)

  let {pattern} = options

  return function (files, metalsmith, done) {
    let tasks = map(files, function (data, file) {
      return function (callback) {
        if (!match(file, pattern)) {
          return callback()
        }

        let extension = extname(file).substr(1)
        let contents = data.contents.toString()
        let processor = require(`./${extension}`).default
        let processed = function (err, contents) {
          if (err) {
            return callback(err)
          }

          data.contents = contents
          callback()
        }

        log('minifying %s', file)
        processor(contents, processed)
      }
    })

    parallel(tasks, function (err) {
      if (err) {
        return done(err)
      }

      done()
    })
  }
}


text:
<?php

namespace OCA\user_ldap\tests\mapping;

use OCA\User_LDAP\Mapping\UserMapping;

class Test_UserMapping extends AbstractMappingTest {
	public function getMapper(\OCP\IDBConnection $dbMock) {
		return new UserMapping($dbMock);
	}
}


text:
[![npm-version][npm-badge]][npm-url]

[npm-badge]: https://img.shields.io/npm/v/gulp-tam.svg
[npm-url]: https://www.npmjs.com/package/gulp-tam

> Gulp integration for [Tam][tam-url].

[tam-url]: https://github.com/arrowrowe/tam

# Install

```sh
npm i --save-dev gulp-tam
```

Note that you still need to install [Tam][1].

# Usage

```javascript
var gulp = require('gulp');
var tam = require('tam');
var gulpTam = require('gulp-tam')(gulp, tam)('./assets.json');

gulp.task('clean', gulpTam.clean);  // Remove the dist directory
gulp.task('build', gulpTam.build);  // Generate dist and the linked list
gulp.task('watch', gulpTam.watch);  // Watch the src directory and the assets

// You can have two gulpTam for frontstage and backstage!
var GulpTam = require('gulp-tam')(gulp, tam);
var gulpTamFrontStage = GulpTam('./assets-frontstage.json');
var gulpTamBackStage = GulpTam('./assets-backstage.json');
```


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
    android:id="@+id/news_cv"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginBottom="16dp">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal">

        <ImageView
            android:id="@+id/news_item_photo"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:maxHeight="200dp"
            android:minHeight="100dp"
            android:layout_marginBottom="-60dp"
            android:layout_alignParentTop="true"
            android:adjustViewBounds="true"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/news_item_header"
            android:textSize="30sp"
            android:text="BLABLA"
            android:textAlignment="center"
            android:layout_below="@+id/news_item_photo"
            android:background="@color/blackTransparent"
            android:textColor="@color/cardview_light_background"
            android:padding="25dp"
            />
        <LinearLayout
            android:id="@+id/news_user_linear"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_below="@+id/news_item_photo"
            android:padding="3dp">
            <TextView
                android:id="@+id/news_user_name"
                android:layout_width="75dp"
                android:layout_height="wrap_content"
                android:textAlignment="center"
                android:padding="3dp"
                android:textStyle="italic"
                android:textColor="@color/cardview_light_background"/>
            <de.hdodenhof.circleimageview.CircleImageView
                android:id="@+id/news_user_photo"
                android:layout_width="75dp"
                android:layout_height="75dp"
                android:layout_gravity="center"
                android:src="@mipmap/ic_launcher"
                app:civ_border_width="2dp"
                app:civ_border_color="#17A3FA"/>
        </LinearLayout>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/news_item_content"
            android:text="blablabla"
            android:textAlignment="center"
            android:paddingTop="10dp"
            android:paddingBottom="15dp"
            android:layout_below="@+id/news_item_header"
            />

    </RelativeLayout>

</android.support.v7.widget.CardView>


text:
package com.zpff.airhockey;

import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ConfigurationInfo;
import android.opengl.GLSurfaceView;

import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends Activity {
    private GLSurfaceView mGLView;
    private boolean       mRendererSet = false;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mGLView = new GLSurfaceView(this);

        final ActivityManager avManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configInfo = avManager.getDeviceConfigurationInfo();
        final boolean supportGLES2 = configInfo.reqGlEsVersion >= 0x20000;

        if(supportGLES2){
            mGLView.setEGLContextClientVersion(2);

            mGLView.setRenderer(new MyRenderer(this));
            mRendererSet = true;
        } else{
            Toast.makeText(this, "Device cannot support OpenGL ES 2.0.",Toast.LENGTH_SHORT).show();
            return ;
        }

        setContentView(mGLView);
    }

    @Override
    protected void onPause(){
        super.onPause();
        if(mRendererSet){
            mGLView.onPause();
        }
    }

    @Override
    protected void onResume(){
        super.onResume();
        if(mRendererSet){
            mGLView.onResume();
        }
    }

}


text:
package stackcommands

import "github.com/rackspace/rack/internal/github.com/codegangsta/cli"

var commandPrefix = "orchestration stack"
var serviceClientType = "orchestration"

// Get returns all the commands allowed for an `orchestration stack` request.
func Get() []cli.Command {
	return []cli.Command{
		abandon,
		adopt,
		create,
		get,
		getTemplate,
		list,
		listEvents,
		preview,
		remove,
		update,
	}
}


text:
<?xml version="1.0"?>
<Document>

	<Sentence>
		<value>A breast biopsy is the removal of breast tissue to examine it for signs of breast cancer or other disorders.</value>
		<pattern_crowdsource> A [[breast|C0006141]] [[biopsy|C0005558]] is the removal of breast tissue to examine it for signs of [[breast cancer|C0006142]] or other [[disorders|C0012634]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>breast</surface-form>
				<RDF-ID>C0006141</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>biopsy</surface-form>
				<RDF-ID>C0005558</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>removal</surface-form>
				<RDF-ID>C0728940</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast tissue</surface-form>
				<RDF-ID>C1521747</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>signs</surface-form>
				<RDF-ID>C0220913</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast cancer</surface-form>
				<RDF-ID>C0006142</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>disorders</surface-form>
				<RDF-ID>C0012634</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0006142 ISA C0012634</triple>
			<triple>C0012634 ISA C0006142</triple>
			<triple>C0006141 LOCATION_OF C0005558</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>This article focuses on stereotactic breast biopsy, which uses mammography to help pinpoint the spot in the breast that needs to be removed.</value>
		<pattern_crowdsource> This article focuses on stereotactic [[breast|C0006141]] [[biopsy|C0005558]], which uses [[mammography|C0024671]] to help pinpoint the spot in the [[breast|C0006141]] that needs to be removed.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>stereotactic</surface-form>
				<RDF-ID>C0729296</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast</surface-form>
				<RDF-ID>C0006141</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>biopsy</surface-form>
				<RDF-ID>C0005558</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mammography</surface-form>
				<RDF-ID>C0024671</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>spot</surface-form>
				<RDF-ID>C0329155</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast</surface-form>
				<RDF-ID>C0006141</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0006141 LOCATION_OF C0005558</triple>
			<triple>C0006141 LOCATION_OF C0024671</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>The table is raised and the doctor performs the biopsy from underneath.</value>
		<pattern_crowdsource> The table is raised and the [[doctor|C0031831]] performs the [[biopsy|C0005558]] from underneath.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>doctor</surface-form>
				<RDF-ID>C0031831</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>biopsy</surface-form>
				<RDF-ID>C0005558</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0005558 ADMINISTERED_TO C0031831</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>The biopsy is done in the following way:  - The health care provider first cleans the area on your breast.</value>
		<pattern_crowdsource> The [[biopsy|C0005558]] is done in the following way:  - The health care provider first cleans the area on your [[breast|C0006141]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>biopsy</surface-form>
				<RDF-ID>C0005558</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>following</surface-form>
				<RDF-ID>C0332282</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>health care provider</surface-form>
				<RDF-ID>C0018724</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>first</surface-form>
				<RDF-ID>C1279901</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>area</surface-form>
				<RDF-ID>C0205146</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast</surface-form>
				<RDF-ID>C0006141</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0006141 LOCATION_OF C0005558</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>- The doctor makes a very small cut on your breast over the area that needs to be biopsied.</value>
		<pattern_crowdsource> - The doctor makes a very small [[cut|C0000925]] on your [[breast|C0006141]] over the area that needs to be biopsied.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>doctor</surface-form>
				<RDF-ID>C0031831</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>very</surface-form>
				<RDF-ID>C0442824</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>small</surface-form>
				<RDF-ID>C0700321</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>cut</surface-form>
				<RDF-ID>C0000925</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast</surface-form>
				<RDF-ID>C0006141</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>over</surface-form>
				<RDF-ID>C0205136</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>area</surface-form>
				<RDF-ID>C0205146</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0006141 LOCATION_OF C0000925</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>- A small metal clip may be placed into the breast in the biopsy area.</value>
		<pattern_crowdsource> - A small metal [[clip|C0175722]] may be placed into the [[breast|C0006141]] in the biopsy area.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>small</surface-form>
				<RDF-ID>C0700321</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>metal</surface-form>
				<RDF-ID>C0025552</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>clip</surface-form>
				<RDF-ID>C0175722</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast</surface-form>
				<RDF-ID>C0006141</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>biopsy</surface-form>
				<RDF-ID>C0005558</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>area</surface-form>
				<RDF-ID>C0205146</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0006141 LOCATION_OF C0175722</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Ice and pressure are applied to the site to stop any bleeding.</value>
		<pattern_crowdsource> [[Ice|C0020746]] and pressure are applied to the site to stop any [[bleeding|C0019080]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Ice</surface-form>
				<RDF-ID>C0020746</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>pressure</surface-form>
				<RDF-ID>C0234222</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>site</surface-form>
				<RDF-ID>C0205145</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>bleeding</surface-form>
				<RDF-ID>C0019080</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0020746 DISRUPTS C0019080</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>You can use acetaminophen (Tylenol) or ibuprofen (Advil) for pain relief.</value>
		<pattern_crowdsource> You can use [[acetaminophen|C0000970]] ([[Tylenol|C0699142]]) or [[ibuprofen|C0020740]] ([[Advil|C0593507]]) for [[pain relief|C0451615]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>acetaminophen</surface-form>
				<RDF-ID>C0000970</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Tylenol</surface-form>
				<RDF-ID>C0699142</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>ibuprofen</surface-form>
				<RDF-ID>C0020740</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Advil</surface-form>
				<RDF-ID>C0593507</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>pain relief</surface-form>
				<RDF-ID>C0451615</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0699142 ISA C0000970</triple>
			<triple>C0593507 ISA C0020740</triple>
			<triple>C0451615 USES C0020740</triple>
			<triple>C0451615 USES C0699142</triple>
			<triple>C0451615 USES C0593507</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Two main types of breast cancer may be found:  - Ductal carcinoma starts in the tubes (ducts) that move milk from the breast to the nipple.</value>
		<pattern_crowdsource> Two main types of [[breast cancer|C0006142]] may be found:  - Ductal carcinoma starts in the tubes (ducts) that move milk from the [[breast|C0006141]] to the nipple.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Two</surface-form>
				<RDF-ID>C0205448</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>main</surface-form>
				<RDF-ID>C0205225</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>types</surface-form>
				<RDF-ID>C0332307</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast cancer</surface-form>
				<RDF-ID>C0006142</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Ductal carcinoma</surface-form>
				<RDF-ID>C1527349</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>tubes</surface-form>
				<RDF-ID>C1547937</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>milk</surface-form>
				<RDF-ID>C0026131</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast</surface-form>
				<RDF-ID>C0006141</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>nipple</surface-form>
				<RDF-ID>C0028109</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0006141 LOCATION_OF C0006142</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>- Lobular carcinoma starts in parts of the breast called lobules, which produce milk.</value>
		<pattern_crowdsource> - [[Lobular carcinoma|C0206692]] starts in parts of the [[breast called lobules|C0222617]], which produce [[milk|C0026131]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Lobular carcinoma</surface-form>
				<RDF-ID>C0206692</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>parts</surface-form>
				<RDF-ID>C0449719</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>breast called lobules</surface-form>
				<RDF-ID>C0222617</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>milk</surface-form>
				<RDF-ID>C0026131</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0206692 PART_OF C0222617</triple>
			<triple>C0222617 PRODUCES C0026131</triple>
		</triples>
	</Sentence>

</Document>


text:
package net.spanbroek.expert;

import java.util.*;

/**
 * Represents a logical 'not' expression.
 */
public class NotExpression implements Expression {

    /**
     * The expression operand.
     */
    private Expression operand = null;

    /**
     * Evaluates the expression in the specified context.
     */
    public boolean evaluate(Properties context) {
        return !operand.evaluate(context);
    }

    /**
     * Returns the expression operand.
     */
    public Expression getOperand() {
        return operand;
    }

    /**
     * Sets the expression operand.
     */
    public void setOperand(Expression operand) {
        this.operand = operand;
    }

}


text:
package ch.icclab.cyclops.usecases.tnova.impl;

import java.util.ArrayList;

/**
 * @author Manu
 *         Created on 10.12.15.
 */
public class TnovaUDRResponse {
    private String time;
    private Double usage;

    public String getTime() {
        return time;
    }

    public Double getUsage() {
        return usage;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public void setUsage(Double usage){
        this.usage = usage;
    }

    public void setFields(ArrayList<Object> value, ArrayList<String> columns) {
        this.setTime((String) value.get(columns.indexOf("time")));
        this.setUsage(getDoubleValue(value.get(columns.indexOf("usage"))));
    }

    private Double getDoubleValue(Object number){
        try{
            return (Double) number;
        }catch (Exception e){
            return Double.parseDouble(number.toString());
        }
    }
}


text:
package com.innovez.sample.domain.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table(name="innvz_department")
@SuppressWarnings("serial")
public class Department implements Serializable {
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id")
	private Short id;

	@NotBlank
	@Column(name="name")
	private String name;

	public Short getId() {
		return id;
	}
	public void setId(Short id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
}


text:
using System.Collections.Generic;
using ServiceStack;
#if V3
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface.ServiceModel;
#endif

namespace FluentMigrator.ServiceStack.ServiceModel
{
    public sealed class MigrationInfoResponse : IHasResponseStatus
    {
        public List<MigrationInfo> Migrations { get; set; }

        public string Info { get; set; }

        public ResponseStatus ResponseStatus { get; set; }

        public string Database { get; set; }
    }
}


text:
package com.example.android.apis.animation;

// Need the following import to get access to the app resources, since this
// class is in a sub-package.
import android.animation.*;
import android.view.animation.AccelerateInterpolator;
import com.example.android.apis.R;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RadialGradient;
import android.graphics.Shader;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Bundle;
import android.view.View;
import android.view.animation.BounceInterpolator;
import android.widget.Button;
import android.widget.LinearLayout;

/**
 * This application demonstrates the seeking capability of ValueAnimator. The SeekBar in the
 * UI allows you to set the position of the animation. Pressing the Run button will play from
 * the current position of the animation.
 */
public class MultiPropertyAnimation extends org.bbs.apklauncher.api.Base_Activity {

    private static final int DURATION = 1500;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.animation_multi_property);
        LinearLayout container = (LinearLayout) findViewById(R.id.container);
        final MyAnimationView animView = new MyAnimationView(this);
        container.addView(animView);

        Button starter = (Button) findViewById(R.id.startButton);
        starter.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                animView.startAnimation();
            }
        });

    }

    public class MyAnimationView extends View implements ValueAnimator.AnimatorUpdateListener {

        private static final float BALL_SIZE = 100f;

        public final ArrayList<ShapeHolder> balls = new ArrayList<ShapeHolder>();
        AnimatorSet animation = null;
        Animator bounceAnim = null;
        ShapeHolder ball = null;

        public MyAnimationView(Context context) {
            super(context);
            addBall(50, 0);
            addBall(150, 0);
            addBall(250, 0);
            addBall(350, 0);
        }

        private void createAnimation() {
            if (bounceAnim == null) {
                ShapeHolder ball;
                ball = balls.get(0);
                ObjectAnimator yBouncer = ObjectAnimator.ofFloat(ball, "y",
                        ball.getY(), getHeight() - BALL_SIZE).setDuration(DURATION);
                yBouncer.setInterpolator(new BounceInterpolator());
                yBouncer.addUpdateListener(this);

                ball = balls.get(1);
                PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("y", ball.getY(),
                        getHeight() - BALL_SIZE);
                PropertyValuesHolder pvhAlpha = PropertyValuesHolder.ofFloat("alpha", 1.0f, 0f);
                ObjectAnimator yAlphaBouncer = ObjectAnimator.ofPropertyValuesHolder(ball,
                        pvhY, pvhAlpha).setDuration(DURATION/2);
                yAlphaBouncer.setInterpolator(new AccelerateInterpolator());
                yAlphaBouncer.setRepeatCount(1);
                yAlphaBouncer.setRepeatMode(ValueAnimator.REVERSE);

                ball = balls.get(2);
                PropertyValuesHolder pvhW = PropertyValuesHolder.ofFloat("width", ball.getWidth(),
                        ball.getWidth() * 2);
                PropertyValuesHolder pvhH = PropertyValuesHolder.ofFloat("height", ball.getHeight(),
                        ball.getHeight() * 2);
                PropertyValuesHolder pvTX = PropertyValuesHolder.ofFloat("x", ball.getX(),
                        ball.getX() - BALL_SIZE/2f);
                PropertyValuesHolder pvTY = PropertyValuesHolder.ofFloat("y", ball.getY(),
                        ball.getY() - BALL_SIZE/2f);
                ObjectAnimator whxyBouncer = ObjectAnimator.ofPropertyValuesHolder(ball, pvhW, pvhH,
                        pvTX, pvTY).setDuration(DURATION/2);
                whxyBouncer.setRepeatCount(1);
                whxyBouncer.setRepeatMode(ValueAnimator.REVERSE);

                ball = balls.get(3);
                pvhY = PropertyValuesHolder.ofFloat("y", ball.getY(), getHeight() - BALL_SIZE);
                float ballX = ball.getX();
                Keyframe kf0 = Keyframe.ofFloat(0f, ballX);
                Keyframe kf1 = Keyframe.ofFloat(.5f, ballX + 100f);
                Keyframe kf2 = Keyframe.ofFloat(1f, ballX + 50f);
                PropertyValuesHolder pvhX = PropertyValuesHolder.ofKeyframe("x", kf0, kf1, kf2);
                ObjectAnimator yxBouncer = ObjectAnimator.ofPropertyValuesHolder(ball, pvhY,
                        pvhX).setDuration(DURATION/2);
                yxBouncer.setRepeatCount(1);
                yxBouncer.setRepeatMode(ValueAnimator.REVERSE);

                bounceAnim = new AnimatorSet();
                ((AnimatorSet)bounceAnim).playTogether(yBouncer, yAlphaBouncer, whxyBouncer,
                        yxBouncer);
            }
        }

        public void startAnimation() {
            createAnimation();
            bounceAnim.start();
        }

        private ShapeHolder addBall(float x, float y) {
            OvalShape circle = new OvalShape();
            circle.resize(BALL_SIZE, BALL_SIZE);
            ShapeDrawable drawable = new ShapeDrawable(circle);
            ShapeHolder shapeHolder = new ShapeHolder(drawable);
            shapeHolder.setX(x);
            shapeHolder.setY(y);
            int red = (int)(100 + Math.random() * 155);
            int green = (int)(100 + Math.random() * 155);
            int blue = (int)(100 + Math.random() * 155);
            int color = 0xff000000 | red << 16 | green << 8 | blue;
            Paint paint = drawable.getPaint();
            int darkColor = 0xff000000 | red/4 << 16 | green/4 << 8 | blue/4;
            RadialGradient gradient = new RadialGradient(37.5f, 12.5f,
                    50f, color, darkColor, Shader.TileMode.CLAMP);
            paint.setShader(gradient);
            shapeHolder.setPaint(paint);
            balls.add(shapeHolder);
            return shapeHolder;
        }

        @Override
        protected void onDraw(Canvas canvas) {
            for (ShapeHolder ball : balls) {
                canvas.translate(ball.getX(), ball.getY());
                ball.getShape().draw(canvas);
                canvas.translate(-ball.getX(), -ball.getY());
            }
        }

        public void onAnimationUpdate(ValueAnimator animation) {
            invalidate();
        }

    }
}


text:
const path = require('path');

const createSrcPath = (pathname) => path.resolve(__dirname, 'src', pathname);

const config = {
  entry: {
    config: './src/config/index.js',
    live_config: './src/live_config/index.js',
    viewer: './src/viewer/index.js'
  },

  output: {
    path: path.resolve(__dirname, 'public'),
    filename: '[name].js'
  },

  resolve: {
    alias: {
      components: createSrcPath('components'),
      viewer: createSrcPath('viewer'),
      config: createSrcPath('config'),
      liveconfig: createSrcPath('live_config'),
      reducers: createSrcPath('reducers')
    }
  },

  module: {
    loaders: [
      { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
      { test: /\.jsx$/, loader: 'babel-loader', exclude: /node_modules/ },
    ]
  },

  devServer: {
    contentBase: path.resolve(__dirname, 'public'),
    historyApiFallback: true,
    inline: true,
    open: true,
    port: 8080
  }
};

module.exports = config;


text:
<META http-equiv="content-type" content="text/html;charset=iso-8859-9"/><meta name="viewport" content="width=device-width, initial-scale=1"><title>ac</title> <link rel="stylesheet"  href="css/jquery.mobile-1.2.0.css" />

CEMAL HALÝFE

Geri

On beþinci ve on altýncý yüzyýllarda Anadolu'da yetiþen alimlerden ve evliyadan. Ýsmi Ýshak,
lakabý Cemaleddin'dir. O zamanki Karaman iline baðlý Aksaray'dan olduðu için Karamani ve
Aksarayi nisbeleriyle tanýndý. Cemaleddin Ýshak Karamani veya Cemal Halife diye meþhur
oldu. Büyük alim ve büyük veli Cemaleddin-i Aksarayi hazretlerinin neslindendir.
Aksaray'da doðmuþ olup, doðum tarihi bilinmemektedir. 1526 (H.933) senesinde Ýstanbul'da
vefat etti. Kabri, Ýstanbul'da Çapa civarýnda Molla Gürani Camiinin karþýsýndaki Koruklu
Tekkesi yanýndadýr.

Aksaray'ýn meþhur ve asil ailelerinden Cemalioðullarý veya Cemali ailesine mensub olan
Cemal Halife, küçük yaþta ilim tahsiline baþladý. Ýlk tahsilini Aksaray'da yaptý. Dedelerinden
Cemaleddin Aksarayi hazretlerinin uzun seneler ilim okuttuðu ve talebe yetiþtirdiði Zincirli
Medresesinde okudu. Temel ilimleri öðrendikten sonra o devrin önemli ilim ve kültür
merkezlerinden olan Konya'ya giderek, Konya Medreselerinde çeþitli alimlerden akli ve nakli
ilimleri tahsil etti. Meþhur Osmanlý alimleri, Kadýzade, Molla Muslihuddin Kastalani ve
Kestelli gibi zatlardan ilim öðrendi. Ayrýca o devrin meþhur hat yani güzel yazý üstadlarýndan
Yakut-ý Musta'sými'nin nesih yazýsýný öðrendi. Hat sanatýnda kendini yetiþtirip devrinin
büyük ve meþhur hattatlarý
arasýnda yer aldý. Fatih Sultan Mehmed Han ona Ýbn-i Hacib'in
nahiv ilmiyle ilgili Kafiye adlý meþhur eserini yazdýrdý. Bundan dolayý Cemal Halifeye bol
ihsanlarda ve iltifatlarda bulundu. Padiþahýn verdiði hediye para ile Hicaz'a gitti ve Hac
ibadetini yerine getirip sevgili Peygamberimizin kabr-i þeriflerini ziyaret etti. Bu mübarek
yolculuðu sýrasýnda çeþitli Ýslam memleketlerinden gelen alimlerle görüþtü, ilmi sohbetlerde
bulundu. Pek çok velinin sohbetlerinde bulunup tasavvufa karþý alaka duydu.

Bir ara hacca gitti. Hac dönüþünde bir müddet müderrislik yapýp ilim öðretti. Tasavvufta
Halvetiyye yolu büyüklerinden Molla Yahya Þirvani'nin halifelerinden Habib Ömer-i
Karamani'ye baðlandý. Zahiri ilimlerde yüksek dereceye ulaþmýþ olmasýna raðmen, asýl
maksada kavuþmanýn ve Allahü tealanýn rýzasýna kavuþmanýn batýni, gizli ilimleri öðrenmek
ve bu yolda çalýþmakla olacaðýný anlayýp tasavvuf yolunda büyük gayret gösterdi. Hocasýnýn
hizmetinde ve sohbetinde bulundu. Çok riyazet ve mücahedelerden sonra tasavvuf yolunda
velilik derecesine ulaþtý. Hocasý Habib-i Ömer Karamani ona insanlara Ýslamiyetin emir ve
yasaklarýný anlatmak ve talebe yetiþtirmek hususunda icazet verdi. Cemal Halife bir müddet
memleketi olan Aksaray'da kalýp insanlara hakký, hakikatý anlattý. Onlarýn dünya ve ahirette
kurtuluþa ermelerine vesile oldu.

Cemal Halife, tasavvuf yolunda yükselip hocasýndan icazet aldýktan sona Aksaray'dan
Ýstanbul'a geldi. Hemþehrisi ve akrabasý Sadrazam Piri Mehmed Paþa kendisine bir dergah
yaptýrdý. Bu dergahta talebe yetiþtirmekle meþgul olan Cemal Halife, insanlara Ýslam dininin
emir ve yasaklarýný anlatýp onlarýn saadete ve Allahü tealanýn rýzasýna kavuþmalarý için gayret
etti. Onun vaz ve sohbetlerine uzaktan yakýndan çok kimse gelerek istifade etti. Kuvvetli bir
hatib olan Cemal halife konuþmalarýyla müminleri coþturur, onlara marifet deryasýndan
inciler daðýtýrdý. Vaz esnasýnda bazan coþar ve aðlardý. Aðlamaktan konuþamadýðý zamanlar
olurdu. Onun bu tesirli sözlerini duyanlar kendilerinden geçer, yaptýklarýna piþman olurlardý.
Nice günahkar kimse onun nasihatlarýný dinleyerek tövbe etmiþti. Onun bu husustaki
þöhretini duyup gelen hýristiyanlar vaz ve nasihatlarýný dinleyip müslüman olurlardý.

Cemal Halife 1526 (H.933) senesinde vazife yaptýðý Koruklu Dergahýnda vefat etti. Eyüp
Sultan hazretlerinin karþýsýndaki Sütlüce kabristanýna defnedildi. Kabrinin yanýna
Süleymaniye Camiinin yazýlarýný yazan Hattat Karahisarlý'nýn talebesi Hattat Hasan Çelebi ve
Þair Yetim Ali Çelebi de defnedildiler. Cemal Halifenin kabri daha sonra, Çapa civarýnda
Molla Gürani Camiinin karþýsýndaki Piri Mehmed Paþanýn yaptýrdýðý Koruklu Dergahýnýn
yanýna nakledildi. Þimdi Molla Gürani Camii yok olmuþ, Koruklu Tekkesi de yýkýlmýþ yalnýz
mezarlýðý kalmýþtýr. Koruklu Tekkesi Halveti tekkesiydi. Burada þeyhlik yapan Seyyid
Mehmed Efendi ve kayýnbabasý
Þeyh Mehmed Fahri Efendi, Odabaþý çarþýsý yakýnýndaki

Koruk mahallesinden olduklarý için tekke sonradan Koruklu ismiyle anýldý.

Birçok alim ve devlet adamý, Cemal Halife'nin sevenleri ve talebeleri arasýnda yer aldý.
Þakayýk-ý Nu'maniyye adlý eserin müellifi Taþköprülüzade onun talebelerindendi. Cemal
Halifenin kendisi gibi zahiri ve batýni ilimlerde iyi yetiþmiþ ve müderrislik yapmýþ bir oðlu
vardý. Nakþibendiyye yoluna mensub olan oðlu Mehmed Efendi, Ýstanbul'daki Emir Buhari
dergahýnda þeyh olarak vazife yaptý.

Eserleri: Cemal Halifenin çeþitli ilimlerde yazdýðý kýymetli eserleri þunlardýr:

1- Navabi: Sarf ilmiyle ilgili bir eserdir. Mevlana Arapzade bu eseri kopya ederek yanýnda
saklamýþtýr. 2) Tefsir-i Beydavi'ye Haþiye, 3) Tefsir-i Cemali: Mücadele suresinden
baþlayarakKur'an-ý kerimin sonuna kadardýr. 4) Hadis-i Erbein (Kýrk Hadis) Þerhi, 5)
Etvar-ý Süluk Hakkýnda Risale, 6) Vahdet-i Vücud Risalesi, 7) Arapça kasideler.
Eserlerinin hepsi yazma olup basýlmamýþtýr.

TASAVVUF EHLÝNÝARA
Cemal Halife çok ibadet eder ve az yerdi. Kendi iþlerini kendi görmeyi tercih ederdi. Yemeðini
kendisi piþirir, çamaþýrýný kendi yýkardý. Çok temiz idi. Geceleri ibadetle geçirir, Allahü tealaya
yalvarýr, dua ederdi. Zengin, fakir herkese ayný davranýr, ayýrým yapmazdý. Bir defasýnda
talebelerinden Taþköprülüzade, ziyaretine giderek nasihat istedi. Ona buyurdu ki:

"Ýrfan ehli kimselerin, zamanýmýzdaki tasavvufu bilmeyen sufilere tabi olmamasý lazýmdýr.
Zamanýmýzda tasavvufu ve tasavvuf hallerini bilen kimse yok gibidir. Tevhid ile ilhad yani dinsizliði
birbirinden herkes ayýramaz. Þimdi sen, bulunduðun yolda devam et. Eðer kalbinde tasavvufa meyl
artarsa, dinin hududunu gözeten, emirleri ve yasaklarý
iyi bilip bunlara uyan bir tasavvuf ehlini ara.
Çünkü tarikatýn esasý, dinin emir ve yasaklarýna, bütün edeplerine eksiksiz uymaktýr. Tarikat ve
hakikatýn temeli, hazret-i Muhammed'in sallallahü aleyhi ve sellem þeriatýnýn hükümlerine uymaktýr.
Eteðine sarýldýðýn ve tabi olduðun kimsenin, Ýslamiyetin emirlerine muhalif, uygun olmýyan ufak bir
hareketini bile görsen onu hemen terket."

1) Sicilli Osmani; c.2, s.82

2) Þakayýk-ý Nu'maniyye Tercümesi (Mecdi Efendi); s.372

3) Tacü't-Tevarih; c.2, s.595

4) Lemezat; varak. 161b

5) Osmanlý Müellifleri; c.1, s.80

6) Aksaray Tarihi; c.2, s.2264


text:
package org.ranji.lemon.model.liquid.authority;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Role implements Serializable{

	private static final long serialVersionUID = -2561045793807899015L;
	private int id;
	private String roleName; // 角色名称
	private String displayName; //角色名称 中文
	private int roleExtendPId; // 角色的父ID
	private String rolePName;  //父角色名(数据显示用)
	private int roleRelyId; //  角色依赖ID
	private String roleRelyName; //依赖角色名(数据显示用)
	private int roleMaxNum; // 最大限制用户数
	private String remarks;  //备注
	private List<Role> list = new ArrayList<Role>();
	private List<Operation> operationList = new ArrayList<Operation>();

	public List<Operation> getOperationList() {
		return operationList;
	}

	public void setOperationList(List<Operation> operationList) {
		this.operationList = operationList;
	}

	public List<Role> getList() {
		return list;
	}

	public void setList(List<Role> list) {
		this.list = list;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getRolePName() {
		return rolePName;
	}

	public void setRolePName(String rolePName) {
		this.rolePName = rolePName;
	}

	public String getRoleRelyName() {
		return roleRelyName;
	}

	public void setRoleRelyName(String roleRelyName) {
		this.roleRelyName = roleRelyName;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}
	public int getRoleExtendPId() {
		return roleExtendPId;
	}

	public void setRoleExtendPId(int roleExtendPId) {
		this.roleExtendPId = roleExtendPId;
	}

	public int getRoleRelyId() {
		return roleRelyId;
	}

	public void setRoleRelyId(int roleRelyId) {
		this.roleRelyId = roleRelyId;
	}

	public int getRoleMaxNum() {
		return roleMaxNum;
	}

	public void setRoleMaxNum(int roleMaxNum) {
		this.roleMaxNum = roleMaxNum;
	}
	//重写对象比较规则
	@Override
	public boolean equals(Object obj) {
        if (this == obj)      //传入的对象就是它自己,如s.equals(s);肯定是相等的;
            return true;
        if (obj == null)     //如果传入的对象是空,肯定不相等
            return false;
        if (getClass() != obj.getClass())  //如果不是同一个类型的,如Studnet类和Animal类,
                                           //也不用比较了,肯定是不相等的
            return false;
        Role other = (Role) obj;
        if (id == 0) {
            if (other.id!= 0)
                return false;
        } else if (id!=other.getId())   //如果id属性相等,则相等
            return false;
        return true;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<component-set>
  <components>

    <component>
      <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
      <role-hint>ide</role-hint>
      <implementation>org.jetbrains.idea.maven.server.embedder.CustomMaven3ArtifactFactory</implementation>
      <description />
      <isolated-realm>false</isolated-realm>
      <requirements>
        <requirement>
          <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
          <role-hint />
          <field-name>artifactHandlerManager</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.apache.maven.plugin.PluginDescriptorCache</role>
      <role-hint>ide</role-hint>
      <implementation>org.jetbrains.idea.maven.server.embedder.CustomPluginDescriptorCache</implementation>
      <description />
      <isolated-realm>false</isolated-realm>
    </component>

    <component>
      <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
      <role-hint>ide</role-hint>
      <implementation>org.jetbrains.idea.maven.server.embedder.CustomMaven3ArtifactResolver</implementation>
      <description />
      <isolated-realm>false</isolated-realm>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.logging.Logger</role>
          <role-hint />
          <field-name>logger</field-name>
        </requirement>
        <requirement>
          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
          <role-hint />
          <field-name>artifactFactory</field-name>
        </requirement>
        <requirement>
          <role>org.apache.maven.artifact.resolver.ArtifactCollector</role>
          <role-hint />
          <field-name>artifactCollector</field-name>
        </requirement>
        <requirement>
          <role>org.apache.maven.artifact.resolver.ResolutionErrorHandler</role>
          <role-hint />
          <field-name>resolutionErrorHandler</field-name>
        </requirement>
        <requirement>
          <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
          <role-hint />
          <field-name>source</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.PlexusContainer</role>
          <role-hint />
          <field-name>container</field-name>
        </requirement>
        <requirement>
          <role>org.apache.maven.plugin.LegacySupport</role>
          <role-hint />
          <field-name>legacySupport</field-name>
        </requirement>
        <requirement>
          <role>org.sonatype.aether.RepositorySystem</role>
          <role-hint />
          <field-name>repoSystem</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role>
      <role-hint>ide</role-hint>
      <implementation>org.jetbrains.idea.maven.server.embedder.CustomMaven3RepositoryMetadataManager</implementation>
      <description />
      <isolated-realm>false</isolated-realm>
      <requirements>
        <requirement>
          <role>org.apache.maven.repository.legacy.WagonManager</role>
          <role-hint />
          <field-name>wagonManager</field-name>
        </requirement>
        <requirement>
          <role>org.apache.maven.repository.legacy.UpdateCheckManager</role>
          <role-hint />
          <field-name>updateCheckManager</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.apache.maven.project.interpolation.ModelInterpolator</role>
      <role-hint>ide</role-hint>
      <implementation>org.jetbrains.idea.maven.server.embedder.CustomMaven3ModelInterpolator</implementation>
      <description />
      <isolated-realm>false</isolated-realm>
    </component>

    <component>
      <role>org.apache.maven.model.interpolation.ModelInterpolator</role>
      <role-hint>ide</role-hint>
      <implementation>org.jetbrains.idea.maven.server.embedder.CustomMaven3ModelInterpolator2</implementation>
      <description />
      <isolated-realm>false</isolated-realm>
    </component>

  </components>
</component-set>


text:
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">5dp</dimen>
    <dimen name="activity_vertical_margin">5dp</dimen>
    <dimen name="fab_margin">16dp</dimen>
    <dimen name="title">17dp</dimen>
    <dimen name="appaddrs">15dip</dimen>
    <dimen name="lastupdt">13dip</dimen>
    <dimen name="uptime">13dip</dimen>
    <dimen name="spacing">2sp</dimen>
    <dimen name="node_height">70dp</dimen>
    <dimen name="node_title_padding">10dp</dimen>
    <dimen name="node_title">15dp</dimen>
    <dimen name="node_width">70dp</dimen>
    <dimen name="card_margin">5dp</dimen>
    <dimen name="card_node_radius">2dp</dimen>
    <dimen name="ic_conn_overflow_width">20dp</dimen>
    <dimen name="ic_conn_overflow_height">30dp</dimen>
    <dimen name="ic_conn_overflow_margin_top">10dp</dimen>
    <dimen name="grid_cell_size">180dp</dimen>
</resources>