text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.sachin.filemanager.activities.MainActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

        <com.sachin.filemanager.view.PathLabelView
            android:id="@+id/path_label_view"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:background="?attr/colorPrimary" />

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_main" />

    <io.codetail.widget.RevealFrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        app:layout_behavior="com.sachin.filemanager.view.SnackHideBehavior">

        <include layout="@layout/fab_menu_layout" />

        <android.support.design.widget.BottomNavigationView
            android:id="@+id/bottom_tool_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="?attr/colorAccent"
            android:visibility="invisible"
            app:itemBackground="?attr/selectableItemBackground"
            app:itemIconTint="@android:color/white"
            app:itemTextColor="@android:color/white"
            app:menu="@menu/menu_main" />

    </io.codetail.widget.RevealFrameLayout>

</android.support.design.widget.CoordinatorLayout>


text:
package com.hinnka.devtools.ui.log;

import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;

import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * author: zhoubinjia
 * date: 2017/1/2
 */
public class LogTask {
    private volatile boolean alive = false;
    private StringBuffer logSb = new StringBuffer();
    private String tag = "*";
    private String level = "V";
    private String filter;
    private OnUpdateListener listener;
    private Handler mainHandler = new Handler(Looper.getMainLooper());
    private Handler threadHandler;
    private Process logcatProcess;
    private String buffer;

    LogTask() {
        HandlerThread thread = new HandlerThread("LogTask");
        thread.start();
        threadHandler = new Handler(thread.getLooper());
    }

    private void logcat() {
        try {
            List<String> commands = new ArrayList<>();
            Collections.addAll(commands, "logcat", "-v", "time", "-s", tag + ":" + level);
            if (!TextUtils.isEmpty(buffer)) {
                commands.add(1, "-b");
                commands.add(2, buffer);
            }
            logcatProcess = new ProcessBuilder()
                    .command(commands)
                    .redirectErrorStream(true)
                    .start();
            String line;
            BufferedReader reader = new BufferedReader(new InputStreamReader(logcatProcess.getInputStream()));
            while (alive && (line = reader.readLine()) != null) {
                if (!TextUtils.isEmpty(filter) && !line.contains(filter)) continue;
                logSb.append(line).append("\n");
                if (listener != null) {
                    mainHandler.post(new Runnable() {
                        @Override
                        public void run() {
                            listener.onUpdate(logSb.toString());
                        }
                    });
                    SystemClock.sleep(32);
                }
            }
            reader.close();
        } catch (IOException e) {
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            PrintStream ps = new PrintStream(os);
            e.printStackTrace(ps);
            logSb.append(os.toString());
        }
    }

    public void setTag(String tag) {
        if (TextUtils.isEmpty(tag)) return;
        this.tag = tag;
    }

    public void setLevel(String level) {
        if (TextUtils.isEmpty(level)) return;
        this.level = level;
    }

    public synchronized void clear() {
        if (logcatProcess != null) {
            logcatProcess.destroy();
        }
        alive = false;
        threadHandler.post(new Runnable() {
            @Override
            public void run() {
                try {
                    Runtime.getRuntime().exec("logcat -c").waitFor();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                logSb = new StringBuffer();
                alive = true;
                logcat();
            }
        });
    }

    public void setListener(OnUpdateListener listener) {
        this.listener = listener;
    }

    public synchronized void start() {
        if (logcatProcess != null) {
            logcatProcess.destroy();
        }
        threadHandler.post(new Runnable() {
            @Override
            public void run() {
                alive = true;
                logcat();
            }
        });
    }

    public synchronized void release() {
        alive = false;
        if (logcatProcess != null) {
            logcatProcess.destroy();
        }
    }

    public String getCurrentLog() {
        return logSb.toString();
    }

    public void setFilter(String filter) {
        this.filter = filter;
    }

    public void setBuffer(String buffer) {
        this.buffer = buffer;
    }

    interface OnUpdateListener {
        void onUpdate(String log);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.usfirst.frc4915.MecanumDrive.commands.drive;

import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.command.Command;
import org.usfirst.frc4915.MecanumDrive.Robot;
import org.usfirst.frc4915.MecanumDrive.subsystems.DriveTrain;
import org.usfirst.frc4915.debuggersystem.CustomDebugger;

import java.util.List;

public class MoveStraightGivenDistanceCommand extends Command {
    public static List<CANTalon> motors = DriveTrain.motors;
    public double inputDistance;
    public double movementSpeed;
    long elapsed;
    long startTime;
    long endTime;
    double distance;
    double distanceSinceElapsed;
    private DriveTrain driveTrain = Robot.driveTrain;

    /**
     *
     * @param inputDistance Distance in feet
     * @param speed between 0 and 1. Positive or negative will have no effect on the result.
 * 					The default value is 1.
     */
    public MoveStraightGivenDistanceCommand(double inputDistance, double speed) {
        requires(driveTrain);
        this.inputDistance = inputDistance;
        movementSpeed = Math.abs(speed);
        // Distance in feet
    }

    // Called just before this Command runs the first time

    /**
     * This initializes the variables for the distance calculator.
     */
    protected void initialize() {

        // Creates variables for use in determining the time so we can compute
        // the distance traveled
        elapsed = 0;
        startTime = System.currentTimeMillis();
        Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Start time recorded: " + startTime);
        endTime = 0;
        // creates a variable to keep track of the time.
        distance = 0;
    }

    /**
     * This uses the wheel circumference and the number of rotations to compute
     * the distance traveled.
     */

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        // This loop allows for a negative input that will have the robot run
        // backwards.
        if (inputDistance < 0) {
            Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Driving backwards...");
            driveTrain.driveStraight(-movementSpeed);
        } else {
            Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Driving forwards...");
            driveTrain.driveStraight(movementSpeed);
        }
        // creates a loop to track the distance traveled
        // uses the time to determine the distance traveled since the last time
        // the robot was sampled.
        endTime = System.currentTimeMillis();
        elapsed = endTime - startTime;
        distanceSinceElapsed = 0;
        Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Recorded end time: " + endTime + " (difference of " + elapsed + " seconds)s");
        // maybe a method???
        for (CANTalon motor : motors) {
            double distanceForMotor = driveTrain.getDistanceForMotor(motor, elapsed);
            Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Distance for motor " + motor + ": " + distanceForMotor);
            distanceSinceElapsed = Math.max(distanceForMotor, distanceSinceElapsed);
            Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Distance since elapsed: " + distanceSinceElapsed);
        }

        distance += distanceSinceElapsed;
        startTime = endTime;
        Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Completed movement of " + distance + " ft.");
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        boolean finished = (Math.abs(distance) > Math.abs(inputDistance));
        Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Testing if finished: " + finished);
        return finished;
    }

    // Called once after isFinished returns true
    protected void end() {
        Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Stopping motor");
        driveTrain.getRobotDrive().stopMotor();
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
        Robot.debugger.logError(CustomDebugger.LoggerNames.DRIVETRAIN, "Command interrupted!");
        end();
    }
}


text: module("cks.viewModels.planning");


text:
import abc

from example.openstack.common.db import api as dbapi

_BACKEND_MAPPING = {'sqlalchemy': 'example.db.sqlalchemy.api'}
IMPL = dbapi.DBAPI(backend_mapping=_BACKEND_MAPPING)

def get_instance():
    """Return a DB API instance."""
    return IMPL

class Ex(object):
    """Base db class."""

    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def __init__(self):
        """Constructor"""

    @abc.abstractmethod
    def get_ex(self, ex):
        """get ex by uuid of and uuid of its ex.

        :param ex: uuid of the ex
        :return: a list of exs
        """

    @abc.abstractmethod
    def get_exs(self):
        """get list of exs by uuid

        :return: a dict of values of the ex
        """

    @abc.abstractmethod
    def create_ex(self, values):
        """create a ex

        :param values: a dict of ex data
        :return: a dict of newly created ex data
        """

    @abc.abstractmethod
    def destroy_ex(self, ex):
        """delete a ex

        :param ex: uuid of the ex
        """

    @abc.abstractmethod
    def update_ex(self, ex, values):
        """update a ex

        :param ex: uuid of the ex
        :param values: a dict of update values
        :return: a dict of newly updated ex
        """


text:
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.

olddir=`pwd`
cd $srcdir

echo -n "checking for ragel... "
which ragel || {
	echo "You need to install ragel... See http://www.complang.org/ragel/"
	exit 1
}

echo -n "checking for pkg-config... "
which pkg-config || {
	echo "*** No pkg-config found, please install it ***"
	exit 1
}

echo -n "checking for autoreconf... "
which autoreconf || {
	echo "*** No autoreconf found, please install it ***"
	exit 1
}

echo "running autoreconf --force --install --verbose"
autoreconf --force --install --verbose || exit $?

cd $olddir
echo "running configure $@"
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"


text:
/*
                                         Problem 3. Min, Max, Sum and Average of N Numbers

    Write a program that reads from the console a sequence of n integer numbers and returns the minimal, the maximal number, the sum and the average
    of all numbers (displayed with 2 digits after the decimal point).

    The input starts by the number n (alone in a line) followed by n lines, each holding an integer number.
    The output is like in the examples below.
*/

using System;

class ArithmeticalOperationsWithNumbers
{
    static void Main()
    {
        Console.Write ("How many integers will you enter: ");
        int n = int.Parse(Console.ReadLine());
        int sum = 0;
        int minimalNumber = 0;
        int maximalNumber = 0;
        int count = 0;

        int[] numbers = new int[n];

        for (int i = 0; i < n; i++)
        {
            Console.Write ("{0} number: ", i + 1);
            numbers[i] = int.Parse(Console.ReadLine());
            if (i == 0)
            {
                minimalNumber = numbers[i];
                maximalNumber = numbers[i];
            }
            sum += numbers[i];

            if (numbers[i] > maximalNumber)
            {
                maximalNumber = numbers[i];
            }

            if (numbers[i] < minimalNumber)
            {
                minimalNumber = numbers[i];
            }

            count++;
        }

        Console.WriteLine("Min {0}", minimalNumber);
        Console.WriteLine("Max {0}", maximalNumber);
        Console.WriteLine("Sum {0}", sum);
        Console.WriteLine("Average {0:F2}", (double)sum/count);
    }
}


text:
<?php
namespace Carbo\Extensions\Admin\Views;

class LogoutView extends \Carbo\Views\View implements \Carbo\Views\IAuthenticated
{
	public function request($verb, array $params = [])
	{
	}

	public function response()
	{
		$this->headers['Location'] = '..';
	}
}


text:
package com.joshmcarthur.android.dynamic_selection;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

public class MainActivity extends ListActivity {

	private static final String[] items = { "lorem", "ipsum", "dolor", "sit",
			"amet", "elit", "morbi", "vitae", "mollis", "purus", "augue" };

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		setListAdapter(new IconicAdapter());
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	class IconicAdapter extends ArrayAdapter<String> {
		IconicAdapter() {
			super(MainActivity.this, R.layout.row, R.id.label, items);

		}

		public View getView(int position, View convertView, ViewGroup parent) {
			View row = super.getView(position, convertView, parent);
			ViewHolder holder = (ViewHolder) row.getTag();

			if (holder == null) {
				holder = new ViewHolder(row);
				row.setTag(holder);
			}

			if (getModel(position).length() > 4) {
				holder.icon.setImageResource(android.R.drawable.ic_delete);
			} else {
				holder.icon.setImageResource(android.R.drawable.ic_input_add);
			}

			holder.size.setText(String.format(
					getString(R.string.string_size_template),
					items[position].length()));

			return row;
		}

		private String getModel(int position) {
			return (((IconicAdapter) getListAdapter()).getItem(position));
		}
	}

}


text:
<?php
/*
Template Name: Gallery List
*/
get_header(); ?>

	<?php do_action('foundationPress_before_content'); ?>

	<?php while (have_posts()) : the_post(); ?>
		<article <?php post_class() ?> id="post-<?php the_ID(); ?>">

<?php the_title(); ?>

				<?php //FoundationPress_entry_meta(); ?>

			<?php do_action('foundationPress_post_before_entry_content'); ?>

				<?php echo do_shortcode('[get_gallery_list type=list]'); ?>

	<?php endwhile;?>

	<?php do_action('foundationPress_after_content'); ?>

	<?php get_sidebar(); ?>

<?php get_footer(); ?>


text:
<?php
    $sDestination ='../../data/constants.php';
    require_once $sDestination;
    $temp ="";
    $mp4=".mp4";
    $jpg=".jpg";
    $png=".png";
    $defaultNav="defaultnav.jpg";
    $defaultNavJPG="nav.jpg";
    $defaultNavPNG="nav.png";
    $folderNav="nav.jpg";
    $loopCount=0;
    $baseFolder=TVPLAYER_LOCATION;//(EXTERNAL_TEXT == 1) ? EXTERNAL_FOLDER.'/content/movies' : 'content/movies';
    $folderName=isset($_POST["folder_name"]) ? $_POST["folder_name"] : '';
    $navHTML="";
    $thumbsHTML="";
    $movieHTML="";
    $scriptDir = SITE_URL.'content/'.TVPLAYER_LOCATION;
    $sImageUrl = SITE_URL.'content/'.TVPLAYER_LOCATION;;
    $fullPathPrefix = ROOT_DIR.'/content/'.TVPLAYER_LOCATION;
    $sExternalUrl = SITE_URL.EXTERNAL_FOLDER.'/content'.DIRECTORY_SEPARATOR.TVPLAYER_LOCATION;
    $moviesDir =(EXTERNAL_TEXT == 1) ? ROOT_DIR.DIRECTORY_SEPARATOR.EXTERNAL_FOLDER.DIRECTORY_SEPARATOR.'content'.DIRECTORY_SEPARATOR.TVPLAYER_LOCATION.DIRECTORY_SEPARATOR.$folderName : ROOT_DIR.DIRECTORY_SEPARATOR.'content'.DIRECTORY_SEPARATOR.TVPLAYER_LOCATION.DIRECTORY_SEPARATOR.$folderName ;

    $dir = new RecursiveDirectoryIterator( $moviesDir,FilesystemIterator::SKIP_DOTS );
    foreach(new RecursiveIteratorIterator($dir,RecursiveIteratorIterator::SELF_FIRST) as $file)
    {

        $filename= $file->getFilename();
	// echo "
File: ".$filename."
";
	// $filePath=
	// echo "filename:".$filename."
";
       /// echo strpos($filename,'.','-4');
	$title = substr( $filename ,0,strlen($filename)-4);
	$displayTitle = str_replace("-", ' ', $title);
	$displayTitle = str_replace(".", ' ', $displayTitle);
	$displayTitle = str_replace("_", ' ', $displayTitle);

	$titleLen=8;
	if (strlen($title)<=8) { $titleLen=strlen($title);}
	$shortTitle = substr( $title ,0,$titleLen);
        $itemID="'".$title."'";

        $itemUrl = (EXTERNAL_TEXT == 1) ?  SITE_URL.'/'. EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$filename:  SITE_URL.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$filename;//str_replace(SITE_URL,'', $filename);
        //$itemUrl = $fullPathPrefix.'/'.$folderName.'/'.$filename;
	$checkApple = strpos($itemUrl,".Apple");
	$currentFolder = str_replace($filename, '', $itemUrl);

	// check isn't a .dot or an .Apple item
	if ((substr( $filename ,0,1) != ".")&&($checkApple===false)) {

		// Is it a movie file or directory?
		if ($file->Isfile()  && (substr( $filename,-4) == ".mp4")) {

			//$tags = str_replace($scriptDir."/".$baseFolder,"",$currentFolder);
			//$tags = str_replace("/"," ",$tags);
			// echo $tags."
";
			$imageURLJPG = $title.$jpg;
			$imageURLPNG = $title.$png;
			$imageURLdefaultJPG = $defaultNavJPG;
			$imageURLdefaultPNG = $defaultNavPNG;

//                        $thisFullImagePathJPG=$fullPathPrefix.'/'.$folderName.'/'.$imageURLJPG;
//			$thisFullImagePathPNG=$fullPathPrefix.DIRECTORY_SEPARATOR.'/'.$folderName.'/'.$imageURLPNG;
//			$thisFullImagePathDefaultJPG=$fullPathPrefix.DIRECTORY_SEPARATOR.'/'.$folderName.'/'.$imageURLdefaultJPG;
//			$thisFullImagePathDefaultPNG=$fullPathPrefix.DIRECTORY_SEPARATOR.'/'.$folderName.'/'.$imageURLdefaultPNG;

			// If there's no thumbnail for this movie use either the default one in this folder or if that doesn't exist the default one

//				if(file_exists($thisFullImagePathJPG)) {
//					$imageURL=$imageURLJPG;
//				}   else if(file_exists($thisFullImagePathPNG)){
//					$imageURL=$imageURLPNG;
//				} else if(file_exists($thisFullImagePathDefaultJPG)){
//					$imageURL=$imageURLdefaultJPG;
//
//				} else if(file_exists($thisFullImagePathDefaultPNG)){
//					$imageURL=$imageURLdefaultPNG;
//				} else {
//					$imageURL=$defaultNav;
//				} // END thumbs image exists test

                        $thisFullImagePathJPG= (EXTERNAL_TEXT == 1) ?  ROOT_DIR.'/'. EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLJPG :  ROOT_DIR.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLJPG;
			$thisFullImagePathPNG=  (EXTERNAL_TEXT == 1) ? ROOT_DIR.'/'.EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG : ROOT_DIR.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG;
			$thisFullImagePathDefaultJPG = (EXTERNAL_TEXT == 1) ? ROOT_DIR.'/'.EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG : ROOT_DIR.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLdefaultJPG;
			$thisFullImagePathDefaultPNG= (EXTERNAL_TEXT == 1) ? ROOT_DIR.'/'.EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG : ROOT_DIR.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLdefaultPNG;

			// If there's no thumbnail for this movie use either the default one in this folder or if that doesn't exist the default one
                        //var_dump(file_exists($thisFullImagePathJPG));exit;

                       // $headers = @get_headers("$thisFullImagePathJPG");
                       	     if(file_exists($thisFullImagePathJPG)) {
					$imageURL=(EXTERNAL_TEXT == 1) ?  SITE_URL.'/'. EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLJPG :  SITE_URL.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLJPG;
				} else if(file_exists($thisFullImagePathPNG)){
					$imageURL=(EXTERNAL_TEXT == 1) ? SITE_URL.'/'.EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG : SITE_URL.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG;
				} else if(file_exists($thisFullImagePathDefaultJPG)){
					$imageURL= (EXTERNAL_TEXT == 1) ? SITE_URL.'/'.EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG : SITE_URL.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLdefaultJPG;

				} else if(file_exists($thisFullImagePathDefaultPNG)){
					$imageURL=(EXTERNAL_TEXT == 1) ? SITE_URL.'/'.EXTERNAL_FOLDER.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLPNG : SITE_URL.'/content/'.TVPLAYER_LOCATION.'/'.$folderName.'/'.$imageURLdefaultPNG;
				} else {
					$imageURL=$defaultNav;
				} // END thumbs image exists test
			// END thumbs image exists test
                        //header("Content-Type: video/mp4");
                        $iconID=$title."_icon";
                        //
		    echo '

'.$displayTitle.'
';
                    echo '<video onClick="playvid('.$itemID.');" class="videoclip" id="'.$title.'" width="1" height="1" controls preload="none" onended="videoEnded('.$itemID.')" src="'.$itemUrl.'">
			  <source src="'.$itemUrl.'" type="video/mp4">
				  Your browser does not support the video tag.
			  </video>

		  ' ;
		}
		} // END if is not apple
    } // END foreach
    ?>


text:
class CreateEventTopics < ActiveRecord::Migration
  def change
    create_table :event_topics do |t|
      t.integer :event_id, null: false
      t.integer :topic_id, null: false
      t.timestamps null: false
    end

    add_index :event_topics, :event_id
    add_index :event_topics, :topic_id

  end
end


text:
package org.msgpack;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertArrayEquals;

import java.io.IOException;

import org.msgpack.MessagePack;
import org.msgpack.type.Value;

import org.junit.Test;

public class TestSimpleConvertUnconvert {
    @Test
    public void testSimpleConvert() throws IOException {
        MessagePack msgpack = new MessagePack();
        byte[] raw = msgpack.write(new int[] {1,2,3});

        Value v = msgpack.read(raw);

        int[] array = msgpack.convert(v, new int[3]);
        assertArrayEquals(new int[] {1,2,3}, array);

        Value v2 = msgpack.unconvert(array);
        assertEquals(v, v2);
    }
}


text:
package com.atschx.adnetwork.service;

import java.util.UUID;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.atschx.adnetwork.domain.model.Token;
import com.atschx.adnetwork.domain.model.User;
import com.atschx.adnetwork.domain.repository.TokenRepository;
import com.atschx.adnetwork.domain.repository.UserRepository;
import com.atschx.adnetwork.protocol.response.SignupResult;

@Service
public class AccountService {

	private final UserRepository userRepository;
	private final TokenRepository tokenRepository;
	private final MailService mailService;

	@Autowired
	public AccountService(UserRepository userRepository, TokenRepository tokenRepository, MailService mailService) {
		super();
		this.userRepository = userRepository;
		this.tokenRepository = tokenRepository;
		this.mailService = mailService;
	}

	public User findUserByEmail(String email) {
		return userRepository.findByEmail(email);
	}

	/**
	 * 用户注册成功之后,要求激活(通过邮箱中的用户token)
	 *
	 * @param user
	 * @return
	 */
	@Transactional
	public SignupResult register(User user) {

		userRepository.saveAndFlush(user);

		final String token = UUID.randomUUID().toString().replaceAll("-", "");
		tokenRepository.save(new Token(token, user.getId(), System.currentTimeMillis() + 1000 * 60 * 60 * 24));

		if (user.getId() != null) {
			mailService.sendMail(user.getEmail(), "schh0313@126.com", "注册成功,请激活登录",
					"您可以点击这里:http://192.168.1.195:8080/signup-verify/?token=" + token);
		}

		return new SignupResult(user.getId());
	}

	public User active(String token) {
		Token tokenObj = tokenRepository.getOne(token);
		User user = null;
		if (null != tokenObj) {
			user = userRepository.findOne(tokenObj.getUid());
			user.setStatus((byte) 1);// 设置用户状态为激活 active
			userRepository.saveAndFlush(user);
		}
		tokenRepository.delete(token);
		return user;
	}

}


text:
WebInspector.DOMTreeElementPathComponent = function(domTreeElement, representedObject) {
    var node = domTreeElement.representedObject;

    var title = null;
    var className = null;

    switch (node.nodeType()) {
    case Node.ELEMENT_NODE:
        className = WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName;
        title = WebInspector.displayNameForNode(node);
        break;

    case Node.TEXT_NODE:
        className = WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName;
        title = "\"" + node.nodeValue().trimEnd(32) + "\"";
        break;

    case Node.COMMENT_NODE:
        className = WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName;
        title = "<!--" + node.nodeValue().trimEnd(32) + "-->";
        break;

    case Node.DOCUMENT_TYPE_NODE:
        className = WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName;
        title = "<!DOCTYPE>";
        break;

    case Node.DOCUMENT_NODE:
        className = WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName;
        title = node.nodeNameInCorrectCase();
        break;

    case Node.CDATA_SECTION_NODE:
        className = WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName;
        title = "<![CDATA[" + node.trimEnd(32) + "]]>";
        break;

    case Node.DOCUMENT_FRAGMENT_NODE:
        // FIXME: At some point we might want a different icon for this.
        // <rdar://problem/12800950> Need icon for DOCUMENT_FRAGMENT_NODE
        className = WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName;
        if (node.isInShadowTree())
            title = WebInspector.UIString("Shadow Content");
        else
            title = WebInspector.displayNameForNode(node);
        break;

    default:
        console.error("Unknown DOM node type: ", node.nodeType());
        className = WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName;
        title = node.nodeNameInCorrectCase();
    }

    WebInspector.HierarchicalPathComponent.call(this, title, className, representedObject || domTreeElement.representedObject);

    this._domTreeElement = domTreeElement;
};

WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName = "dom-element-icon";
WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName = "dom-text-node-icon";
WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName = "dom-comment-icon";
WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName = "dom-document-type-icon";
WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName = "dom-document-icon";
WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName = "dom-character-data-icon";
WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName = "dom-node-icon";

WebInspector.DOMTreeElementPathComponent.prototype = {
    constructor: WebInspector.DOMTreeElementPathComponent,

    // Public

    get domTreeElement()
    {
        return this._domTreeElement;
    },

    get previousSibling()
    {
        if (!this._domTreeElement.previousSibling)
            return null;
        return new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.previousSibling);
    },

    get nextSibling()
    {
        if (!this._domTreeElement.nextSibling)
            return null;
        if (this._domTreeElement.nextSibling.isCloseTag())
            return null;
        return new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.nextSibling);
    },

    // Protected

    mouseOver: function()
    {
        var nodeId = this._domTreeElement.representedObject.id;
        WebInspector.domTreeManager.highlightDOMNode(nodeId);
    },

    mouseOut: function()
    {
        WebInspector.domTreeManager.hideDOMNodeHighlight();
    }
};

WebInspector.DOMTreeElementPathComponent.prototype.__proto__ = WebInspector.HierarchicalPathComponent.prototype;


text:
package net.amigocraft.sparkletrail;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

/**
 * Particle effects utility library
 * @author Maxim Roncace
 * @version 0.1.0
 */
public class ParticleEffect {

	private static Class<?> packetClass = null;
	private static Constructor<?> packetConstructor = null;
	private static Field[] fields = null;
	private static boolean netty = true;
	private static Field player_connection = null;
	private static Method player_sendPacket = null;
	private static HashMap<Class<? extends Entity>, Method> handles = new HashMap<Class<? extends Entity>, Method>();

	private static boolean newParticlePacketConstructor = false;
	private static Class<Enum> enumParticle = null;

	private ParticleType type;
	private double speed;
	private int count;
	private double radius;

	private static boolean compatible = true;

	static {
		String vString = getVersion().replace("v", "");
		double v = 0;
		if (!vString.isEmpty()){
			String[] array = vString.split("_");
			v = Double.parseDouble(array[0] + "." + array[1]);
		}
		try {
			Bukkit.getLogger().info("[ParticleLib] Server major/minor version: " + v);
			if (v < 1.7) {
				Bukkit.getLogger().info("[ParticleLib] Hooking into pre-Netty NMS classes");
				netty = false;
				packetClass = getNmsClass("Packet63WorldParticles");
				packetConstructor = packetClass.getConstructor();
				fields = packetClass.getDeclaredFields();
			}
			else {
				Bukkit.getLogger().info("[ParticleLib] Hooking into Netty NMS classes");
				packetClass = getNmsClass("PacketPlayOutWorldParticles");
				if (v < 1.8){
					Bukkit.getLogger().info("[ParticleLib] Version is < 1.8 - using old packet constructor");
					packetConstructor = packetClass.getConstructor(String.class, float.class, float.class, float.class,
							float.class, float.class, float.class, float.class, int.class);
				}
				else { // use the new constructor for 1.8
					Bukkit.getLogger().info("[ParticleLib] Version is >= 1.8 - using new packet constructor");
					newParticlePacketConstructor = true;
					enumParticle = (Class<Enum>)getNmsClass("EnumParticle");
					packetConstructor = packetClass.getDeclaredConstructor(enumParticle, boolean.class, float.class,
							float.class, float.class, float.class, float.class, float.class, float.class, int.class,
							int[].class);
				}
			}
		}
		catch (Exception ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("[ParticleLib] Failed to initialize NMS components!");
			compatible = false;
		}
	}

	/**
	 * Constructs a new particle effect for use.
	 *

	 *     Note: different values for speed and radius may hav;e different effects
	 *     depending on the particle's type.
	 *

	 * @param type the particle type
	 * @param speed the speed of the particles
	 * @param count the number of particles to spawn
	 * @param radius the radius of the particles
	 */
	public ParticleEffect(ParticleType type, double speed, int count, double radius){
		this.type = type;
		this.speed = speed;
		this.count = count;
		this.radius = radius;
	}

	/**
	 * Gets the speed of the particles in this effect
	 * @return The speed of the particles in this effect
	 */
	public double getSpeed(){
		return speed;
	}

	/**
	 * Retrieves the number of particles spawned by the effect
	 * @return The number of particles spawned by the effect
	 */
	public int getCount(){
		return count;
	}

	/**
	 * Gets the radius of the particle effect
	 * @return The radius of the particle effect
	 */
	public double getRadius(){
		return radius;
	}

	/**
	 * Send a particle effect to all players
	 * @param location The location to send the effect to
	 */
	public void sendToLocation(Location location){
		try {
			Object packet = createPacket(location);
			for (Player player : Bukkit.getOnlinePlayers()){
				sendPacket(player, packet);
			}
		}
		catch (Exception e){
			e.printStackTrace();
		}
	}

	/**
	 * Constructs a new particle packet.
	 * @param location the location to spawn the particle effect at
	 * @return the constructed packet
	 */
	private Object createPacket(Location location){
		try {
			if (this.count <= 0){
				this.count = 1;
			}
			Object packet;
			if (netty){
				if (newParticlePacketConstructor){
					Object particleType = enumParticle.getEnumConstants()[type.getId()];
					packet = packetConstructor.newInstance(particleType,
							true, (float)location.getX(), (float)location.getY(), (float)location.getZ(),
							(float)this.radius, (float)this.radius, (float)this.radius,
							(float)this.speed, this.count, new int[0]);
				}
				else {
					packet = packetConstructor.newInstance(type.getName(),
							(float)location.getX(), (float)location.getY(), (float)location.getZ(),
							(float)this.radius, (float)this.radius, (float)this.radius,
							(float)this.speed, this.count);
				}
			}
			else {
				packet = packetConstructor.newInstance();
				for (Field f : fields){
					f.setAccessible(true);
					if (f.getName().equals("a"))
						f.set(packet, type.getName());
					else if (f.getName().equals("b"))
						f.set(packet, (float)location.getX());
					else if (f.getName().equals("c"))
						f.set(packet, (float)location.getY());
					else if (f.getName().equals("d"))
						f.set(packet, (float)location.getZ());
					else if (f.getName().equals("e") || f.getName().equals("f") || f.getName().equals("g"))
						f.set(packet, this.radius);
					else if (f.getName().equals("h"))
						f.set(packet, this.speed);
					else if (f.getName().equals("i"))
						f.set(packet, this.count);
				}
			}
			return packet;
		}
		catch (IllegalAccessException ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("{ParticleLib] Failed to construct particle effect packet!");
		}
		catch (InstantiationException ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("{ParticleLib] Failed to construct particle effect packet!");
		}
		catch (InvocationTargetException ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("{ParticleLib] Failed to construct particle effect packet!");
		}
		return null;
	}

	/**
	 * Sends a packet to a player.
	 *

	 *     Note: this method is not typesafe!
	 *

	 * @param p the player to send a packet to
	 * @param packet the packet to send
	 * @throws IllegalArgumentException if packet is not of a proper type
	 */
	private static void sendPacket(Player p, Object packet) throws IllegalArgumentException {
		try {
			if (player_connection == null){
				player_connection = getHandle(p).getClass().getField("playerConnection");
				for (Method m : player_connection.get(getHandle(p)).getClass().getMethods()){
					if (m.getName().equalsIgnoreCase("sendPacket")){
						player_sendPacket = m;
					}
				}
			}
			player_sendPacket.invoke(player_connection.get(getHandle(p)), packet);
		}
		catch (IllegalAccessException ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("[ParticleLib] Failed to send packet!");
		}
		catch (InvocationTargetException ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("[ParticleLib] Failed to send packet!");
		}
		catch (NoSuchFieldException ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("[ParticleLib] Failed to send packet!");
		}
	}

	/**
	 * Gets the NMS handle of the given {@link Entity}.
	 * @param entity the entity get the handle of
	 * @return the entity's NMS handle
	 */
	private static Object getHandle(Entity entity){
		try {
			if (handles.get(entity.getClass()) != null)
				return handles.get(entity.getClass()).invoke(entity);
			else {
				Method entity_getHandle = entity.getClass().getMethod("getHandle");
				handles.put(entity.getClass(), entity_getHandle);
				return entity_getHandle.invoke(entity);
			}
		}
		catch (Exception ex) {
			ex.printStackTrace();
			return null;
		}
	}

	/**
	 * Gets the NMS class by the given name.
	 * @param name the name of the NMS class to get
	 * @return the NMS class of the given name
	 */
	private static Class<?> getNmsClass(String name){
		String version = getVersion();
		String className = "net.minecraft.server." + version + name;
		Class<?> clazz = null;
		try {
			clazz = Class.forName(className);
		}
		catch (ClassNotFoundException ex){
			ex.printStackTrace();
			Bukkit.getLogger().severe("[ParticleLib] Failed to load NMS class " + name + "!");
		}
		return clazz;
	}

	/**
	 * Determines the version string used by Craftbukkit's safeguard (e.g. 1_7_R4).
	 * @return the version string used by Craftbukkit's safeguard
	 */
	private static String getVersion(){
		String[] array = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",");
		if (array.length == 4)
			return array[3] + ".";
		return "";
	}

	/**
	 * Gets whether ParticleLib is compatible with the server software.
	 * @return whether ParticleLib is compatible with the server software.
	 */
	public static boolean isCompatible(){
		return compatible;
	}

	/**
	 * Enum representing valid particle types in Minecraft 1.8
	 */
	public enum ParticleType {

		EXPLOSION_NORMAL("explode", 0, 17),
		EXPLOSION_LARGE("largeexplode", 1, 1),
		EXPLOSION_HUGE("hugeexplosion", 2, 0),
		FIREWORKS_SPARK("fireworksSpark", 3, 2),
		WATER_BUBBLE("bubble", 4, 3),
		WATER_SPLASH("splash", 5, 21),
		WATER_WAKE("wake", 6, -1),
		SUSPENDED("suspended", 7, 4),
		SUSPENDED_DEPTH("depthsuspend", 8, 5),
		CRIT("crit", 9, 7),
		CRIT_MAGIC("magicCrit", 10, 8),
		SMOKE_NORMAL("smoke", 11, -1),
		SMOKE_LARGE("largesmoke", 12, 22),
		SPELL("spell", 13, 11),
		SPELL_INSTANT("instantSpell", 14, 12),
		SPELL_MOB("mobSpell", 15, 9),
		SPELL_MOB_AMBIENT("mobSpellAmbient", 16, 10),
		SPELL_WITCH("witchMagic", 17, 13),
		DRIP_WATER("dripWater", 18, 27),
		DRIP_LAVA("dripLava", 19, 28),
		VILLAGER_ANGRY("angryVillager", 20, 31),
		VILLAGER_HAPPY("happyVillager", 21, 32),
		TOWN_AURA("townaura", 22, 6),
		NOTE("note", 23, 24),
		PORTAL("portal", 24, 15),
		ENCHANTMENT_TABLE("enchantmenttable", 25, 16),
		FLAME("flame", 26, 18),
		LAVA("lava", 27, 19),
		FOOTSTEP("footstep", 28, 20),
		CLOUD("cloud", 29, 23),
		REDSTONE("reddust", 30, 24),
		SNOWBALL("snowballpoof", 31, 25),
		SNOW_SHOVEL("snowshovel", 32, 28),
		SLIME("slime", 33, 29),
		HEART("heart", 34, 30),
		BARRIER("barrier", 35, -1),
		ITEM_CRACK("iconcrack_", 36, 33),
		BLOCK_CRACK("tilecrack_", 37, 34),
		BLOCK_DUST("blockdust_", 38, -1),
		WATER_DROP("droplet", 39, -1),
		ITEM_TAKE("take", 40, -1),
		MOB_APPEARANCE("mobappearance", 41, -1);

		private String name;
		private int id;
		private int legacyId;

		ParticleType(String name, int id, int legacyId){
			this.name = name;
			this.id = id;
			this.legacyId = legacyId;
		}

		/**
		 * Gets the name of the particle effect
		 *
		 * @return The name of the particle effect
		 */
		String getName(){
			return name;
		}

		/**
		 * Gets the ID of the particle effect
		 *
		 * @return The ID of the particle effect
		 */
		int getId(){
			return id;
		}

		/**
		 * Gets the legacy ID (pre-1.8) of the particle effect
		 *
		 * @return the legacy ID of the particle effect (or -1 if introduced after 1.7)
		 */
		int getLegacyId(){
			return legacyId;
		}
	}

}


text:
//-----------------------------------------------------------------------
// <copyright file="ApiHelper.cs" company="Crimson Space Media">
//    Copyright Crimson Space Media
// </copyright>
//-----------------------------------------------------------------------

namespace SharedLibrary.Helpers
{
    using System.Net.Http;
    using System.Net.Http.Headers;

    /// <summary>
    /// API helper class
    /// </summary>
    public static class ApiHelper
    {
        /// <summary>
        /// Makes the API request.
        /// </summary>
        /// <param name="url">The URL.</param>
        /// <returns>The API response</returns>
        /// <exception cref="HttpRequestException">API request failed</exception>
        public static string MakeApiRequest(string url)
        {
            var client = new HttpClient();
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            HttpResponseMessage messge = client.GetAsync(url).Result;
            string description = string.Empty;
            if (!messge.IsSuccessStatusCode)
            {
                throw new HttpRequestException("Api request failed");
            }

            return messge.Content.ReadAsStringAsync().Result;
        }
    }
}


text:
'use strict';

const models = require('./index');

/**
 * DatabricksNotebook activity.
 *
 * @extends models['ExecutionActivity']
 */
class DatabricksNotebookActivity extends models['ExecutionActivity'] {
  /**
   * Create a DatabricksNotebookActivity.
   * @member {object} notebookPath The absolute path of the notebook to be run
   * in the Databricks Workspace. This path must begin with a slash. Type:
   * string (or Expression with resultType string).
   * @member {object} [baseParameters] Base parameters to be used for each run
   * of this job.If the notebook takes a parameter that is not specified, the
   * default value from the notebook will be used.
   * @member {array} [libraries] A list of libraries to be installed on the
   * cluster that will execute the job.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DatabricksNotebookActivity
   *
   * @returns {object} metadata of DatabricksNotebookActivity
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DatabricksNotebook',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'Activity',
        className: 'DatabricksNotebookActivity',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          dependsOn: {
            required: false,
            serializedName: 'dependsOn',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ActivityDependencyElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    className: 'ActivityDependency'
                  }
              }
            }
          },
          userProperties: {
            required: false,
            serializedName: 'userProperties',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'UserPropertyElementType',
                  type: {
                    name: 'Composite',
                    className: 'UserProperty'
                  }
              }
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          linkedServiceName: {
            required: false,
            serializedName: 'linkedServiceName',
            type: {
              name: 'Composite',
              className: 'LinkedServiceReference'
            }
          },
          policy: {
            required: false,
            serializedName: 'policy',
            type: {
              name: 'Composite',
              additionalProperties: {
                type: {
                  name: 'Dictionary',
                  value: {
                      required: false,
                      serializedName: 'ObjectElementType',
                      type: {
                        name: 'Object'
                      }
                  }
                }
              },
              className: 'ActivityPolicy'
            }
          },
          notebookPath: {
            required: true,
            serializedName: 'typeProperties.notebookPath',
            type: {
              name: 'Object'
            }
          },
          baseParameters: {
            required: false,
            serializedName: 'typeProperties.baseParameters',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          libraries: {
            required: false,
            serializedName: 'typeProperties.libraries',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Dictionary',
                    value: {
                        required: false,
                        serializedName: 'ObjectElementType',
                        type: {
                          name: 'Object'
                        }
                    }
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = DatabricksNotebookActivity;


text:
<?php

namespace Company\DatabaseBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Office
 *
 * @ORM\Table(name="office")
 * @ORM\Entity
 */
class Office
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="address", type="string", length=200, nullable=false)
     */
    private $address;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Company\DatabaseBundle\Entity\Employee", mappedBy="office")
     */
    private $employee;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->employee = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set address
     *
     * @param string $address
     * @return Office
     */
    public function setAddress($address)
    {
        $this->address = $address;

        return $this;
    }

    /**
     * Get address
     *
     * @return string
     */
    public function getAddress()
    {
        return $this->address;
    }

    /**
     * Add employee
     *
     * @param \Company\DatabaseBundle\Entity\Employee $employee
     * @return Office
     */
    public function addEmployee(\Company\DatabaseBundle\Entity\Employee $employee)
    {
        $this->employee[] = $employee;

        return $this;
    }

    /**
     * Remove employee
     *
     * @param \Company\DatabaseBundle\Entity\Employee $employee
     */
    public function removeEmployee(\Company\DatabaseBundle\Entity\Employee $employee)
    {
        $this->employee->removeElement($employee);
    }

    /**
     * Get employee
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEmployee()
    {
        return $this->employee;
    }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/modern.css">
        <link rel="stylesheet" href="css/theme-dark.css">
        <link rel="stylesheet" href="css/modern-responsive.css">

        <link rel="stylesheet" href="css/ringo-profile.css">

                            $User
                            $User

Settings

Help

Logout

$Username

                    Calculator

10

Mail

                    Video

                    Pictures

5

                    Store
                    6

                    Music

michael_angiulo

                        I just saw Thor last night. It was awesome! I think you'd love it.

RT @julie_green

                    Tweet@rama

                    YouTube

mattberg@live.com

Re: Wedding Annoucement!

                        Congratulations! I'm really excited to celebrate with you all. Thanks for...

tina@live.com

Re: Wedding Annoucement!

                        Huh! Waw!!! I'm really excited to celebrate with you all. Thanks for...

12

                    Internet Explorer

                    Excel 2013

                    Word 2013

                    OneNote 2013

                    Photos

This is a desert eagle. He is very hungry and angry bird.

10

                    Internet Explorer

                    Excel 2013

                    Word 2013

                    OneNote 2013

This is a desert eagle. He is very hungry and angry bird.

10

                    Internet Explorer

                    Excel 2013

                    Word 2013

                    OneNote 2013

                    Photos


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

<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
           id="com.adamwadeharris.sms"
      version="0.1.0">
    <name>Sms</name>
    <description>Cordova SMS Send Plugin</description>
    <license>MIT</license>
    <keywords>cordova,phonegap,sms</keywords>

    <js-module src="www/sms.js" name="Sms">
        <clobbers target="window.sms" />
    </js-module>

    <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="Sms">
                <param name="android-package" value="com.adamwadeharris.sms.Sms"/>
            </feature>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permission.SEND_SMS" />
        </config-file>

        <source-file src="src/android/Sms.java" target-dir="src/com/adamwadeharris/sms" />
    </platform>

    <!-- ios -->
    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="Sms">
                <param name="ios-package" value="Sms" />
            </feature>
        </config-file>
        <header-file src="src/ios/Sms.h" />
        <source-file src="src/ios/Sms.m" />
        <framework src="MessageUI.framework" />
    </platform>
</plugin>


text:
package gov.nih.nci.caintegrator.util;

import java.util.HashMap;

import org.apache.log4j.Logger;

/**
 * Author: Ram Bhattaru
 * Date:   Jul 17, 2006
 * Time:   2:23:03 PM
 */
public class ThreadPool {
    static HashMap allThreads = new HashMap();
    public final static long MAX_THREADS = 50;
    public static long THREAD_COUNT = 0;
    private static Logger logger = Logger.getLogger(ThreadPool.class);

    public synchronized static AppThread newAppThread(MyRunnable r) {
        while (THREAD_COUNT >= MAX_THREADS ) {
            try {
                Thread.currentThread().sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        AppThread appThread = new AppThread(r);
        logger.debug("BEGIN: New thread created.  Thread Count: " + ThreadPool.THREAD_COUNT);
        return appThread;
    }

    public static class AppThread {
        private MyRunnable ar = null;
        Thread t = null;
        Long ID;

        public void execute() {
             ar.codeToRun();
             synchronized(allThreads) {
                THREAD_COUNT--;
                allThreads.remove(this.getID());
             }
            logger.debug("END: Thread completed.  Thread Count: " + ThreadPool.THREAD_COUNT);
        }
        private  AppThread(MyRunnable appRunnable) {
            this.ar = appRunnable;
            t= new Thread(new Runnable() {
                public void run() {
                    execute();
                }
            });
            synchronized(allThreads) {
                THREAD_COUNT++;
                ID = new Long(System.currentTimeMillis() + THREAD_COUNT);
                allThreads.put(this.getID(), this);
            }
        }
        public Long getID(){
            return ID;
        }
        public void start() {
            t.start();
        }
    }

    public static interface MyRunnable {
        public void codeToRun();
    }
}


text:
comments: true
date: 2015-08-16 03:45:57+00:00
layout: article
slug: memberi-dan-menghapus-password-file-pdf-di-linux
title: Memberi dan Menghapus password file PDF di Linux
categories: linux
tags: [linux, security]
ads: true
youtubeId: hIDBsmaetYU
image:
  feature:
  teaser: leds_photo.jpg

---

Untuk Encrypt & Decrypt password pdf dilinux bisa menggunakan tool `pdftk` , tapi sebelumnya pastikan Java telah terinstall di sistem Linux anda install pdftk berbasis debian (Ubuntu , Mint dkk):

```bash
sudo apt-get install pdftk
```

install pdftk berbasis redhat lihat petunjuk disini: [https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/](https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/) ketik di terminal : `pdftk` jika muncul pdftk command instructions berarti pdftk telah berhasil terpasang di Linux anda

# Encrypt

    pdftk <source>.pdf output <destination>.pdf userpw <password>

contoh:

    pdftk plain.pdf output pass.pdf userpw rahasia

plain.pdf

nama file sumber yang tidak terpassword

pass.pdf

nama file hasil enkripse yang sudah terpassword

rahasia

passwordnya

# Decrypt

Ini adalah kebalikan cara di atas

    pdftk <source>.pdf input <password> output <destination>.pdf

contoh:

    pdftk pass.pdf input_pw rahasia output plain.pdf

pass.pdf

nama file sumber yang ada password

out.pdf

nama file hasil dekripsi yang sudah dihilangkan passwordnya

rahasia

passwordnya

Nonton Videonya

{% include youtube.html id=page.youtubeId %}


text:
package bumpCmd

import (
	// Stdlib
	"os"

	// Internal
	"github.com/salsaflow/salsaflow/app/appflags"
	"github.com/salsaflow/salsaflow/errs"
	"github.com/salsaflow/salsaflow/git/gitutil"
	"github.com/salsaflow/salsaflow/version"

	// Other
	"gopkg.in/tchap/gocli.v2"
)

var Command = &gocli.Command{
	UsageLine: "bump [-commit] VERSION",
	Short:     "bump version to the specified value",
	Long: `
  Bump the version string to the specified value.

  In case -commit is set, the changes are committed as well.
  The repository must be clean for the commit to be created.
	`,
	Action: run,
}

var (
	flagCommit bool
)

func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagCommit, "commit", flagCommit,
		"commit the new version string")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}

func run(cmd *gocli.Command, args []string) {
	if len(args) != 1 {
		cmd.Usage()
		os.Exit(2)
	}

	if err := runMain(args[0]); err != nil {
		errs.Fatal(err)
	}
}

func runMain(versionString string) error {
	// Make sure the version string is correct.
	task := "Parse the command line VERSION argument"
	ver, err := version.Parse(versionString)
	if err != nil {
		hint := `
The version string must be in the form of Major.Minor.Patch
and no part of the version string can be omitted.

`
		return errs.NewErrorWithHint(task, err, hint)
	}

	// In case -commit is set, set and commit the version string.
	if flagCommit {
		currentBranch, err := gitutil.CurrentBranch()
		if err != nil {
			return err
		}

		_, err = version.SetForBranch(ver, currentBranch)
		return err
	}

	// Otherwise just set the version.
	return version.Set(ver)
}