text:
package org.apache.helix;

import java.util.Date;

import org.apache.helix.PropertyKey.Builder;
import org.apache.helix.messaging.handling.HelixStateTransitionHandler;
import org.apache.helix.messaging.handling.HelixTask;
import org.apache.helix.messaging.handling.HelixTaskExecutor;
import org.apache.helix.mock.MockManager;
import org.apache.helix.mock.statemodel.MockMasterSlaveStateModel;
import org.apache.helix.mock.statemodel.MockStateModelAnnotated;
import org.apache.helix.model.CurrentState;
import org.apache.helix.model.Message;
import org.apache.helix.model.Message.MessageType;
import org.apache.helix.model.StateModelDefinition;
import org.apache.helix.participant.statemachine.StateModelFactory;
import org.apache.helix.tools.StateModelConfigGenerator;
import org.testng.AssertJUnit;
import org.testng.annotations.Test;

public class TestHelixTaskHandler {
  @Test()
  public void testInvocation() throws Exception {
    HelixTaskExecutor executor = new HelixTaskExecutor();
    System.out.println("START TestCMTaskHandler.testInvocation()");
    Message message = new Message(MessageType.STATE_TRANSITION, "Some unique id");

    message.setSrcName("cm-instance-0");
    message.setTgtSessionId("1234");
    message.setFromState("Offline");
    message.setToState("Slave");
    message.setPartitionName("TestDB_0");
    message.setMsgId("Some unique message id");
    message.setResourceName("TestDB");
    message.setTgtName("localhost");
    message.setStateModelDef("MasterSlave");
    message.setStateModelFactoryName(HelixConstants.DEFAULT_STATE_MODEL_FACTORY);
    MockMasterSlaveStateModel stateModel = new MockMasterSlaveStateModel();
    NotificationContext context;
    MockManager manager = new MockManager("clusterName");
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    StateModelDefinition stateModelDef =
        new StateModelDefinition(StateModelConfigGenerator.generateConfigForMasterSlave());
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);

    context = new NotificationContext(manager);
    CurrentState currentStateDelta = new CurrentState("TestDB");
    currentStateDelta.setState("TestDB_0", "OFFLINE");

    HelixStateTransitionHandler stHandler =
        new HelixStateTransitionHandler(null, stateModel, message, context, currentStateDelta);
    HelixTask handler;
    handler = new HelixTask(message, context, stHandler, executor);
    handler.call();
    AssertJUnit.assertTrue(stateModel.stateModelInvoked);
    System.out.println("END TestCMTaskHandler.testInvocation() at "
        + new Date(System.currentTimeMillis()));
  }

  @Test()
  public void testInvocationAnnotated() throws Exception {
    System.out.println("START TestCMTaskHandler.testInvocationAnnotated() at "
        + new Date(System.currentTimeMillis()));
    HelixTaskExecutor executor = new HelixTaskExecutor();
    Message message = new Message(MessageType.STATE_TRANSITION, "Some unique id");
    message.setSrcName("cm-instance-0");
    message.setTgtSessionId("1234");
    message.setFromState("Offline");
    message.setToState("Slave");
    message.setPartitionName("TestDB_0");
    message.setMsgId("Some unique message id");
    message.setResourceName("TestDB");
    message.setTgtName("localhost");
    message.setStateModelDef("MasterSlave");
    message.setStateModelFactoryName(HelixConstants.DEFAULT_STATE_MODEL_FACTORY);
    MockStateModelAnnotated stateModel = new MockStateModelAnnotated();
    NotificationContext context;

    MockManager manager = new MockManager("clusterName");
    HelixDataAccessor accessor = manager.getHelixDataAccessor();

    StateModelDefinition stateModelDef =
        new StateModelDefinition(StateModelConfigGenerator.generateConfigForMasterSlave());
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);

    context = new NotificationContext(manager);

    CurrentState currentStateDelta = new CurrentState("TestDB");
    currentStateDelta.setState("TestDB_0", "OFFLINE");

    StateModelFactory<MockStateModelAnnotated> stateModelFactory =
        new StateModelFactory<MockStateModelAnnotated>() {

          @Override
          public MockStateModelAnnotated createNewStateModel(String resource, String partitionName) {
            // TODO Auto-generated method stub
            return new MockStateModelAnnotated();
          }

        };

    HelixStateTransitionHandler stHandler =
        new HelixStateTransitionHandler(stateModelFactory, stateModel, message, context,
            currentStateDelta);

    HelixTask handler = new HelixTask(message, context, stHandler, executor);
    handler.call();
    AssertJUnit.assertTrue(stateModel.stateModelInvoked);
    System.out.println("END TestCMTaskHandler.testInvocationAnnotated() at "
        + new Date(System.currentTimeMillis()));
  }

}


text:
namespace Poco {

class Foundation_API Configurable
	/// A simple interface that defines
	/// getProperty() and setProperty() methods.
	///
	/// This interface is implemented by Formatter and
	/// Channel and is used to configure arbitrary
	/// channels and formatters.
	///
	/// A property is basically a name-value pair. For
	/// simplicity, both names and values are strings.
	/// Every property controls a certain aspect of a
	/// Formatter or Channel. For example, the PatternFormatter's
	/// formatting pattern is set via a property.
	///
	/// NOTE: The following property names are use internally
	/// by the logging framework and must not be used by
	/// channels or formatters:
	///   - class
	///   - pattern (Channel)
	///   - formatter (Channel)
{
public:
	Configurable();
		/// Creates the Configurable.

	virtual ~Configurable();
		/// Destroys the Configurable.

	virtual void setProperty(const std::string& name, const std::string& value) = 0;
		/// Sets the property with the given name to the given value.
		/// If a property with the given name is not supported, a
		/// PropertyNotSupportedException is thrown.

	virtual std::string getProperty(const std::string& name) const = 0;
		/// Returns the value of the property with the given name.
		/// If a property with the given name is not supported, a
		/// PropertyNotSupportedException is thrown.
};

} // namespace Poco

#endif // Foundation_Configurable_INCLUDED

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace CargoBackend\API\Booking\Service;

use CargoBackend\API\Booking\BookingService;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
 * Class BookingServiceFactory
 *
 * @package CargoBackend\API\Booking\Service
 * @author Alexander Miertsch <kontakt@codeliner.ws>
 */
class BookingServiceFactory implements FactoryInterface
{
    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return BookingService
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $configuration = $serviceLocator->get('configuration');

        return new BookingService(
            $serviceLocator->get('cargo_repository'),
            $serviceLocator->get('cargo_transaction_manager'),
            $serviceLocator->get('cargo_routing_service'),
            $configuration['locations']
        );
    }
}


text:
<android.support.v4.widget.DrawerLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:id="@+id/mainDrawer"
    android:elevation="@dimen/elevationNavDrawer"
    android:fitsSystemWindows="true"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- the drawer should slide over the app bar so we enclose everything in
    this drawer layout-->

    <!-- there will be two children views for the drawer layout-->

    <!-- the first child is the main content-->
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context=".MainActivity">

        <!-- include the tool bar here-->
        <include
            android:id="@+id/tool_bar"
            layout="@layout/tool_bar"></include>

    </LinearLayout>

    <!-- the second child view consists of the recycler view which has the
    content of the sliding drawer-->
    <android.support.v7.widget.RecyclerView
        android:layout_width="320dp"
        android:layout_height="match_parent"
        android:id="@+id/recyclerView"
        android:layout_gravity="left"
        android:background="#ffffff"
        android:scrollbars="vertical">

        </android.support.v7.widget.RecyclerView>
    <android.support.v7.widget.RecyclerView
        android:layout_width="320dp"
        android:layout_height="match_parent"
        android:id="@+id/recyclerViewRight"
        android:layout_gravity="right"
        android:background="#ffffff"
        android:scrollbars="vertical">

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

</android.support.v4.widget.DrawerLayout>


text:
package eu.rebelcorp.parse;

import org.json.JSONException;
import org.json.JSONObject;

import android.os.Bundle;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.util.TiRHelper;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import eu.rebelcorp.parse.ParseModule;
import com.parse.ParsePushBroadcastReceiver;

import com.parse.ParseAnalytics;
import android.R;
import android.os.Build;
import android.app.Notification;

public class ParseModuleBroadcastReceiver extends ParsePushBroadcastReceiver {

    @Override
    public void onPushOpen(Context context, Intent intent) {
        Intent i = context.getPackageManager().getLaunchIntentForPackage(context.getApplicationContext().getPackageName());
        // Push open analytics
        ParseAnalytics.trackAppOpenedInBackground(intent);

        /* Check if the app is running or in background. If not, just start the app and add the
         * notification as Extra */
        if (ParseModule.getInstance() == null || ParseModule.getInstance().getState() == ParseModule.STATE_DESTROYED) {
            Log.d("onPushOpen", "App was killed; resume the app without triggering 'notificationopen'");
            i.putExtras(intent.getExtras());
            context.startActivity(i);
            return;
        }

        /* Otherwise, just resume the app if necessary, and trigger the event */
        try {
            KrollDict data = new KrollDict(new JSONObject(intent.getExtras().getString("com.parse.Data")));

            if (ParseModule.getInstance().getState() != ParseModule.STATE_RUNNING) {
                Log.d("onPushOpen", "App was in background; resume the app and trigger 'notificationopen'");
                context.startActivity(i);
            } else {
                Log.d("onPushOpen", "App is running in foreground; trigger 'notificationopen'");
            }

            ParseModule.getInstance().fireEvent("notificationopen", data);
        } catch (Exception e) {
            Log.d("onPushOpen", e.getMessage());
        }
    }

    @Override
    public void onPushReceive(Context context, Intent intent) {
        try {
        	if (intent == null) {
                Log.d("onPushReceive", "Receiver intent null");
                super.onPushReceive(context, intent);
                return;
            }

        	JSONObject pnData = new JSONObject(intent.getExtras().getString("com.parse.Data"));
            KrollDict data = new KrollDict(pnData);

            if (ParseModule.getInstance() == null) {
                Log.d("onPushReceive", "No instance of ParseModule found");
                // silent push
                if (pnData.has("content-available") == false) {
                	super.onPushReceive(context, intent);
                }
                return;
            }

            if (ParseModule.getInstance().getState() != ParseModule.STATE_DESTROYED) {
                Log.d("onPushReceive", "App is in foreground; trigger event 'notificationreceive'");

                try {
                	ParseModule.getInstance().fireEvent("notificationreceive", data);
                } catch (Exception e) {
                    Log.d("onPushReceive", e.getMessage());
                }
            } else {
                Log.d("onPushReceive", "App is not alive; 'notificationreceive' won't be triggered");
            }

            // silent push
            if (pnData.has("content-available") == false) {
                super.onPushReceive(context, intent);
            }
        } catch (Exception e) {
            Log.e("Push", "Exception: " + e.toString());
        }
    }

    @Override
    protected Notification getNotification(Context context, Intent intent) {
        Notification notification = super.getNotification(context, intent);

        try {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                notification.color = context.getResources().getColor(TiRHelper.getResource("color.parse_notification_color"));
            }
        } catch (Exception e){
            Log.e("Push", "Exception: " + e.toString());
        }

        return notification;
    }
}


text:
    <link rel="stylesheet" type="text/css" href="css/tips.css">

To select multiple fragments in the "column mode",
    keep Control+Alt+Shift(on Windows and Linux) or
    Cmd+Alt+Shift(on MAC), and drag your mouse cursor:


text:
<!DOCTYPE html>

  <title>CSS Reftest Reference</title>
  <meta charset="utf-8">
  <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
  <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">

  p b c
  p e
  p b c
  p e
  p b c
  p e

  p b c
  p e
  p b c
  p e
  p b c
  p e

  p b c
  p e
  p b c
  p e
  p b c
  p e

  p b c
  p e
  p b c
  p e
  p b c
  p e


text:
package org._24601.kasper.scripting;

import java.util.Arrays;
import java.util.List;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;

import org.kohsuke.MetaInfServices;

@MetaInfServices
public class KasperScriptEngineFactory implements ScriptEngineFactory {

	@Override
	public String getEngineName() {
		return "Kasper Engine";
	}

	@Override
	public String getEngineVersion() {
		return "0.0.1";
	}

	@Override
	public List<String> getExtensions() {
		return Arrays.asList("ksp");
	}

	@Override
	public List<String> getMimeTypes() {
		return Arrays.asList("text/x-kasper");
	}

	@Override
	public List<String> getNames() {
		return Arrays.asList("kasper");
	}

	@Override
	public String getLanguageName() {
		return "Kasper";
	}

	@Override
	public String getLanguageVersion() {
		return "0.5";
	}

	@Override
	public Object getParameter(String key) {
		// TODO Auto-generated method stub
		return "";
	}

	@Override
	public String getMethodCallSyntax(String obj, String m, String... args) {
		return "";
	}

	@Override
	public String getOutputStatement(String toDisplay) {
		return "";
	}

	@Override
	public String getProgram(String... statements) {
		return null;
	}

	@Override
	public ScriptEngine getScriptEngine() {
		return new KasperScriptEngine(this);
	}

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
AbstractReportNode (PMD 4.2.6 API)
</TITLE>

<META NAME="date" CONTENT="2011-09-14">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

net.sourceforge.pmd.dfa.report

Class AbstractReportNode

java.lang.Object
  net.sourceforge.pmd.dfa.report.AbstractReportNode

Direct Known Subclasses:
ClassNode, PackageNode, ViolationNode

public abstract class AbstractReportNode
extends java.lang.Object

Constructor Summary

AbstractReportNode()

Method Summary

 void
accept(ReportVisitor visitor)

 void
add(AbstractReportNode child)

          Adds the child at the end.

 void
addFirst(AbstractReportNode child)

          Adds the child in front of any other childs.

 void
addNumberOfViolation(int number)

 void
childrenAccept(ReportVisitor visitor)

abstract  boolean
equalsNode(AbstractReportNode arg0)

          Should compare to nodes of the tree.

 AbstractReportNode
getChildAt(int arg0)

 int
getChildCount()

 AbstractReportNode
getFirstChild()

 AbstractReportNode
getNextSibling()

 int
getNumberOfViolations()

 AbstractReportNode
getParent()

 boolean
isLeaf()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractReportNode

public AbstractReportNode()

Method Detail

equalsNode

public abstract boolean equalsNode(AbstractReportNode arg0)

Should compare to nodes of the tree.

getFirstChild

public AbstractReportNode getFirstChild()

Returns:
null If there isn't any child.

getNextSibling

public AbstractReportNode getNextSibling()

Returns:
null If there isn't any sibling.

addFirst

public void addFirst(AbstractReportNode child)

Adds the child in front of any other childs.

add

public void add(AbstractReportNode child)

Adds the child at the end.

addNumberOfViolation

public void addNumberOfViolation(int number)

getNumberOfViolations

public int getNumberOfViolations()

Returns:
The number of all violations downside the node.

childrenAccept

public void childrenAccept(ReportVisitor visitor)

accept

public void accept(ReportVisitor visitor)

getChildAt

public AbstractReportNode getChildAt(int arg0)

getChildCount

public int getChildCount()

getParent

public AbstractReportNode getParent()

isLeaf

public boolean isLeaf()

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2011 InfoEther. All Rights Reserved.


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var font = {
    getTemplate: function (styleProperties) {
        var _a = styleProperties.font, bold = _a.bold, fontName = _a.fontName, italic = _a.italic, color = _a.color, outline = _a.outline, shadow = _a.shadow, size = _a.size, strikeThrough = _a.strikeThrough, underline = _a.underline, verticalAlign = _a.verticalAlign, charSet = _a.charSet, family = _a.family;
        return {
            name: "Font",
            properties: {
                prefixedAttributes: [{
                        prefix: "ss:",
                        map: {
                            Bold: bold,
                            FontName: fontName,
                            Italic: italic,
                            Color: color,
                            Outline: outline,
                            Shadow: shadow,
                            Size: size,
                            StrikeThrough: strikeThrough,
                            Underline: underline,
                            VerticalAlign: verticalAlign
                        }
                    }, {
                        prefix: "x:",
                        map: {
                            CharSet: charSet,
                            Family: family
                        }
                    }]
            }
        };
    }
};
exports.default = font;
//# sourceMappingURL=font.js.map


text:
namespace ash {
namespace internal {

TrayNetworkStateObserver::TrayNetworkStateObserver(TrayNetwork* tray)
    : tray_(tray),
      wifi_state_(WIFI_UNKNOWN) {
  chromeos::NetworkStateHandler::Get()->AddObserver(this);
}

TrayNetworkStateObserver::~TrayNetworkStateObserver() {
  chromeos::NetworkStateHandler::Get()->RemoveObserver(this);
}

void TrayNetworkStateObserver::NetworkManagerChanged() {
  tray::NetworkDetailedView* detailed = tray_->detailed();
  bool wifi_enabled = chromeos::NetworkStateHandler::Get()->
      TechnologyEnabled(flimflam::kTypeWifi);
  WifiState wifi_state = wifi_enabled ? WIFI_ENABLED : WIFI_DISABLED;
  if ((wifi_state_ != WIFI_UNKNOWN && wifi_state_ != wifi_state) &&
      (!detailed ||
       detailed->GetViewType() == tray::NetworkDetailedView::WIFI_VIEW)) {
    tray_->set_request_wifi_view(true);
    tray_->PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false);
  }
  wifi_state_ = wifi_state;
  if (detailed)
    detailed->ManagerChanged();
}

void TrayNetworkStateObserver::NetworkListChanged() {
  tray::NetworkDetailedView* detailed = tray_->detailed();
  if (detailed)
    detailed->NetworkListChanged();
  tray_->TrayNetworkUpdated();
}

void TrayNetworkStateObserver::DeviceListChanged() {
  tray::NetworkDetailedView* detailed = tray_->detailed();
  if (detailed)
    detailed->ManagerChanged();
  tray_->TrayNetworkUpdated();
}

void TrayNetworkStateObserver::DefaultNetworkChanged(
    const chromeos::NetworkState* network) {
  tray_->TrayNetworkUpdated();
}

void TrayNetworkStateObserver::NetworkPropertiesUpdated(
    const chromeos::NetworkState* network) {
  tray_->NetworkServiceChanged(network);
  tray::NetworkDetailedView* detailed = tray_->detailed();
  if (detailed)
    detailed->NetworkServiceChanged(network);
}

}  // namespace ash
}  // namespace internal


text:
//
//  MovVideoCapture.m
//  KeyboardCatPublisher
//
//  Created by Charley Robinson on 6/10/14.
//  Copyright (c) 2014 Charley Robinson. All rights reserved.
//

#import "MovVideoCapture.h"
#import <AVFoundation/AVFoundation.h>

#define MOV_REMOTE_URL \
@"https://s3.amazonaws.com/artifact.tokbox.com/charley/keyboardcat.mov"
#define MOV_NAME @"keyboardcat.mov"

@interface MovVideoCapture () <AVCaptureVideoDataOutputSampleBufferDelegate>

@end

@implementation MovVideoCapture {
    OTVideoFrame* _frameHolder;
    AVCaptureSession* _captureSession;
    CMTime _lastTimeStamp;
    CGSize _frameSize;
    dispatch_queue_t _decodeQueue;
    BOOL _capturing;
}

@synthesize videoCaptureConsumer;

- (id)init {
    self = [super init];
    if (self) {
        _decodeQueue = dispatch_queue_create("sample-queue", 0);
        _capturing = NO;
    }
    return self;
}

- (void)downloadMov {
    NSString *stringURL = MOV_REMOTE_URL;
    NSURL  *url = [NSURL URLWithString:stringURL];
    NSData *urlData = [NSData dataWithContentsOfURL:url];
    if ( urlData )
    {
        NSString* filePath =
        [NSString stringWithFormat:@"%@/%@", NSTemporaryDirectory(), MOV_NAME];
        [urlData writeToFile:filePath atomically:YES];
    }
}

// Create and configure a capture session and start it running
- (void)setupCaptureSession
{
    NSError *error=[[NSError alloc]init];

    NSString *filePathString=[NSString stringWithFormat:@"%@/%@",
                               NSTemporaryDirectory(),
                              MOV_NAME];

    NSURL *movieUrl=[[NSURL alloc] initFileURLWithPath:filePathString];
    AVURLAsset *movieAsset=[[AVURLAsset alloc] initWithURL:movieUrl
                                                   options:nil];

    /* allocate assetReader */
    AVAssetReader *assetReader=[[AVAssetReader alloc] initWithAsset:movieAsset
                                                              error:&error];

    /* get video track(s) from movie asset */
    NSArray *videoTracks=[movieAsset tracksWithMediaType:AVMediaTypeVideo];

    /* get first video track, if there is any */
    AVAssetTrack *videoTrack0=[videoTracks objectAtIndex:0];

    /* determine image dimensions of images stored in movie asset */
    _frameSize =[videoTrack0 naturalSize];
    NSLog(@"movie asset natual size: size.width=%f size.height=%f",
          _frameSize.width, _frameSize.height);

    /* Ensure our send buffer is setup for this video. Since we're asking
     * AVFoundation for NV12, we'll do the same here.
     */
    OTVideoFormat* format =
    [OTVideoFormat videoFormatNV12WithWidth:_frameSize.width
                                     height:_frameSize.height];
    _frameHolder = [[OTVideoFrame alloc] initWithFormat:format];

    /* set the desired video frame format into attribute dictionary */
    NSDictionary* dictionary=
    [NSDictionary dictionaryWithObjectsAndKeys:
     [NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange],
     (NSString*)kCVPixelBufferPixelFormatTypeKey,
     nil];

    /* construct the actual track output and add it to the asset reader */
    AVAssetReaderTrackOutput* assetReaderOutput=
    [[AVAssetReaderTrackOutput alloc]
     initWithTrack:videoTrack0
     outputSettings:dictionary]; //nil or dictionary

    /* main parser loop */
    NSInteger i=0;
    if([assetReader canAddOutput:assetReaderOutput]){
        [assetReader addOutput:assetReaderOutput];

        NSLog(@"asset added to output.");

        /* start asset reader */
        if([assetReader startReading]==YES){
            /* read off the samples */
            CMSampleBufferRef buffer;
            while(_capturing &&
                  [assetReader status]==AVAssetReaderStatusReading)
            {
                double startTime = CACurrentMediaTime();
                buffer=[assetReaderOutput copyNextSampleBuffer];
                i++;
                CMSampleTimingInfo timingInfo = kCMTimingInfoInvalid;
                CMSampleBufferGetSampleTimingInfo(buffer, 0, &timingInfo);
                CMTime oldTS = _lastTimeStamp;
                CMTime currentTS = timingInfo.presentationTimeStamp;
                double previousTime =
                (double)oldTS.value / (double)oldTS.timescale;
                double currentTime =
                (double)currentTS.value / (double)currentTS.timescale;

                _lastTimeStamp = timingInfo.presentationTimeStamp;
                if (buffer) {
                    [self sendSampleBuffer:buffer
                             withTimestamp:timingInfo.presentationTimeStamp];
                }

                double finishTime = CACurrentMediaTime();
                double decodeTime = finishTime - startTime;
                // assuming the frame intervals are consistent,
                // and the next decode time will be the same, this is an
                // appropriate amount to sleep between processing frames
                double sleepTime = currentTime - previousTime - decodeTime;
                [NSThread sleepForTimeInterval:sleepTime];

                NSLog(@"decoding frame #%d done.", i);
                if (buffer) {
                    CFRelease(buffer);
                }
                buffer = NULL;
            }
        }
        else {
            NSLog(@"could not start reading asset.");
            NSLog(@"reader status: %d", [assetReader status]);
        }
    }
    else {
        NSLog(@"could not add asset to output.");
    }
}

- (void)sendSampleBuffer:(CMSampleBufferRef)sampleBuffer
           withTimestamp:(CMTime)timestamp
{
    CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
    CVPixelBufferLockBaseAddress(imageBuffer, 0);

    // clear previous pointers
    [_frameHolder.planes setCount:0];

    // copy new pointers
    for (int i = 0; i < CVPixelBufferGetPlaneCount(imageBuffer); i++) {
        uint8_t* plane = CVPixelBufferGetBaseAddressOfPlane(imageBuffer, i);
        [_frameHolder.planes addPointer:plane];
    }

    // No need to rotate since we're just reading from a file.
    _frameHolder.orientation = OTVideoOrientationUp;

    // Copy the timestamp from the video
    _frameHolder.timestamp = timestamp;

    // Send the frame to OpenTok.
    [videoCaptureConsumer consumeFrame:_frameHolder];

    CVPixelBufferUnlockBaseAddress(imageBuffer, 0);
}

#pragma mark OTVideoCapture

/**
 * Initializes the video capturer.
 */
- (void)initCapture {
    dispatch_async(_decodeQueue, ^() {
        [self downloadMov];
    });
}

/**
 * Releases the video capturer.
 */
- (void)releaseCapture {

}

/**
 * Starts capturing video.
 */
- (int32_t)startCapture {
    _capturing = YES;
    dispatch_async(_decodeQueue, ^() {
        @autoreleasepool {
            while (_capturing) {
                [self setupCaptureSession];
            }
        }
    });
    return 0;
}

/**
 * Stops capturing video.
 */
- (int32_t)stopCapture {
    _capturing = NO;
    return 0;
}

/**
 * Whether video is being captured.
 */
- (BOOL)isCaptureStarted {
    return _capturing;
}

/**
 * The video format of the video capturer.
 * @param videoFormat The video format used.
 */
- (int32_t)captureSettings:(OTVideoFormat*)videoFormat {
    // We don't know at the time this is called, so skip this function.
    return 0;
}

@end


text:
<?php
namespace FluidTYPO3\Flux\Form\Field\Inline;

use FluidTYPO3\Flux\Form\Field\AbstractFieldTest;
use FluidTYPO3\Flux\Form;

/**
 * @package Flux
 */
class FalTest extends AbstractFieldTest {

	/**
	 * @var array
	 */
	protected $chainProperties = array(
		'collapseAll' => FALSE,
		'expandSingle' => FALSE,
		'newRecordLinkAddTitle' => FALSE,
		'newRecordLinkPosition' => Form::POSITION_TOP,
		'useCombination' => FALSE,
		'useSortable' => FALSE,
		'showPossibleLocalizationRecords' => FALSE,
		'showRemovedLocalizationRecords' => FALSE,
		'showAllLocalizationLink' => FALSE,
		'showSynchronizationLink' => FALSE,
		'enabledControls' => array(
			Form::CONTROL_INFO => FALSE,
			Form::CONTROL_NEW => TRUE,
			Form::CONTROL_DRAGDROP => TRUE,
			Form::CONTROL_SORT => TRUE,
			Form::CONTROL_HIDE => TRUE,
			Form::CONTROL_DELETE => FALSE,
			Form::CONTROL_LOCALISE => FALSE,
		)
	);

}


text:
@font-face {
    font-family: 'digital';
    src: url('digital.ttf');
    src: url('digital.ttf') format('ttf'), url('digital.ttf')  format('truetype');
}
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -ms-box-sizing: border-box;
    -o-box-sizing: border-box;
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
    background: darkgray;
    position: relative;
}

#settings {
    background: white;
    position: fixed;
    right: -9em;
    top: 2em;
    bottom: 0;
    width: 10em;
    padding: 1em;
    z-index: 3;
    box-shadow: 0 0.2em 0.2em 0.2em rgba(100, 100, 100, 0.5);
}
#settings.visible {
    right: 0;
}

#g {
    line-height: 2em;
    height: 2em;
    font-size: 2em;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -1em;
    text-decoration: none;
    color: black;
}
#g:before {
    content: '<'
}
.visible #g:before {
    content: '>';
}
#settings input[type="number"] {
    width: 90%;
    margin: 0 auto;
}

.button {
    box-shadow: inset 0 1px 0 0 #fff;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf));
    background: -moz-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
    background: -webkit-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
    background: -o-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
    background: -ms-linear-gradient(top, #ededed 5%, #dfdfdf 100%);
    background: linear-gradient(to bottom, #ededed 5%, #dfdfdf 100%);
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf',GradientType=0);
    background-color: #ededed;
    border-radius: 6px;
    border: 1px solid #dcdcdc;
    display: inline-block;
    cursor: pointer;
    color: #777;
    font-family: Arial;
    font-size: 15px;
    font-weight: bold;
    padding: 6px 24px;
    text-decoration: none;
    text-shadow: 0 1px 0 #fff;
}
input:checked + .button,
.button:hover,
.button.active {
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed));
    background: -moz-linear-gradient(top, #dfdfdf 5%, #ededed 100%);
    background: -webkit-linear-gradient(top, #dfdfdf 5%, #ededed 100%);
    background: -o-linear-gradient(top, #dfdfdf 5%, #ededed 100%);
    background: -ms-linear-gradient(top, #dfdfdf 5%, #ededed 100%);
    background: linear-gradient(to bottom, #dfdfdf 5%, #ededed 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed',GradientType=0);
    background-color: #dfdfdf;
}
input:checked + .button,
.button:active,
.button.active {
    position: relative;
    top: 3px;
}
.hidden {
    position: absolute;
    left: -999em;
}

#top-menu {
    position: fixed;
    right: 10%;
    top: 0;
    left: 10%;
    padding: 1em;
    /*height: 3em;*/
    vertical-align: middle;
    background: white;
    z-index: 2;
    box-shadow: 0 0.2em 0.2em 0.2em rgba(100, 100, 100, 0.5);
    text-align: center;
}

#timer, #mines-left {
    float: left;
    font-family: 'digital', sans-serif;
    font-size: 2em;
    background: black;
    color: red;
}
#mines-left {
    float: right;
}
/*#s {
    text-align: center;
}*/
#author {
    position: absolute;
    bottom: 0.5em;
    display: block;
    text-align: center;
    left: 0;
    right: 0;
    color: black;
    text-decoration: underline;
}

#popular {
    list-style: none;
    padding: 0;
    margin: 0;
}

#name {
    text-align: center;
    border: 0;
}
@media all and (max-width: 699px) {
  #top-menu {
    left: 0;
    right: 0;
    padding: 0;
  }
}


text:
package com.oracle.truffle.llvm.parser.bc.impl.parser.bc.records;

import com.oracle.truffle.llvm.parser.bc.impl.parser.bc.Parser;
import com.oracle.truffle.llvm.parser.bc.impl.parser.bc.ParserResult;

public final class UserRecordFixedOperand extends UserRecordOperand {

    private final long width;

    public UserRecordFixedOperand(long width) {
        super();
        this.width = width;
    }

    @Override
    protected ParserResult get(Parser parser) {
        return parser.read(width);
    }

    @Override
    public String toString() {
        return String.format("i%d", width);
    }
}


text:
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>

void far_away(void);

int main(void) {
  /*
   * This is useful test only if the branch distance here is more than
   * 32MB, which is the limit for ARM branches.
   */
  assert((uintptr_t) &far_away > (uintptr_t) &main);
  assert((uintptr_t) &far_away - (uintptr_t) &main > (32 << 20));
  far_away();
  return 1;
}


text:
<?php

namespace QueueVideo\Models\Queue;

use QueueVideo\Models\IdentityMapAbstract;
use QueueVideo\Models\Room\Room;

class IdentityMap extends IdentityMapAbstract {
	private $queues;

	public function __construct(DataMapperInterface $dm) {
		$this->queues = array();
		$this->_dataMapper = $dm;
		return $this;
	}

	/**
	* @param $id
	* @return bool
	*/
	private function isQueueCached($id){
		return isset($this->queues[$id]);
	}

	/**
	* @param $id
	* @return Queue
	*/
	public function fetchQueueById($id) {
		if(!$this->isQueueCached($id)) {
			$this->queues[$id] = $this->_dataMapper->fetchQueueById($id);
		}
		return $this->queues[$id];
	}

	/**
	* @param $id
	* @return Queue
	*/
	public function fetchQueueByRoom(Room $room) {
		if(!$this->isQueueCached($room->getQueueId())) {
			$this->queues[$room->getQueueId()] = $this->_dataMapper->fetchQueueByRoom($room);
		}
		return $this->queues[$room->getQueueId()];
	}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Web Requests: $http - POST</title>
    <link rel="stylesheet" href="http://cdn.jsdelivr.net/highlight.js/9.5.0/styles/github.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/presentation.css" />

$http POST

JavaScript

var $ctrl = this;
$ctrl.newSupplier = {};
$ctrl.postNewSupplier = postNewSupplier;
getSuppliers();

function postNewSupplier(){
    $http.post('http://my.server.net/api/suppliers', $ctrl.newSupplier)
            .then(getSuppliers);
}

function getSuppliers(){
    $http.get('http://my.server.net/api/suppliers')
            .then(function(response){
                $ctrl.suppliers = response.data;});
}


text:
FROM phpearth/php:7.1-apache

MAINTAINER Ádám Liszkai <adaliszk@gmail.com>

ARG RUN_TYPE=default
ARG BUILD_DATE
ARG VCS_REF

LABEL org.label-schema.build-date=$BUILD_DATE \
      org.label-schema.vcs-url="https://github.com/adaliszk/bechmark-php-cli.git" \
      org.label-schema.vcs-ref=$VCS_REF \
      org.label-schema.schema-version="0.1.0" \
      org.label-schema.vendor="adaliszk" \
      org.label-schema.name="bechmark-php-cli" \
      org.label-schema.description="Simple tester to check different php versions and installed modules how's effect the script runtimes" \
      org.label-schema.url="https://github.com/adaliszk/bechmark-php-cli.git"

# Add project files
ADD . /srv

# Configure Apache2 VHOST
ADD ./vhost.conf /etc/apache2/sites-enabled/default

# Expose HTTP port
EXPOSE 80

# Run the default CMD
CMD ["/sbin/runit-wrapper"]


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import { FormattedMessage } from 'react-intl';

import {
  Row,
  Col,
  Modal,
  Button,
  TextField
} from '@folio/stripes/components';

import css from './WithCopyModal.css';

function withCopyModal(WrappedComponent) {
  return class extends Component {
    static propTypes = {
      isOpen: PropTypes.bool.isRequired,
      link: PropTypes.string.isRequired,
      modalHeader: PropTypes.node.isRequired,
      onClose: PropTypes.func.isRequired,
    };

    constructor(props) {
      super(props);

      this.copyInput = React.createRef();
    }

    handleClick = () => {
      this.copyInput.current.select();
      document.execCommand('copy');
    };

    render() {
      const {
        isOpen,
        link,
        onClose,
        modalHeader,
      } = this.props;

      return (
        <Modal
          dismissible
          size="small"
          open={isOpen}
          label={modalHeader}
          onClose={onClose}
        >
          <WrappedComponent {...this.props} />
          <Row className={css.copyControl}>
            <Col xs={9}>
              <TextField
                hasClearIcon={false}
                inputRef={this.copyInput}
                value={link}
                readOnly
              />
            </Col>
            <Col xs={3}>
              <Button
                buttonStyle="primary"
                onClick={this.handleClick}
              >
                <FormattedMessage id="ui-users.extended.copyLink" />
              </Button>
            </Col>
          </Row>
        </Modal>
      );
    }
  };
}

export default withCopyModal;


text:
<?php

namespace FivePercent\Bundle\IntegrationBundle\DependencyInjection\Compiler;

use FivePercent\Bundle\IntegrationBundle\DependencyInjection\IntegrationExtension;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

/**
 * Compile model transformers
 *
 * @author Vitaliy Zhuk <zhuk2205@gmail.com>
 */
class AddModelTransformerPass implements CompilerPassInterface
{
    use AttributesFixerTrait;

    /**
     * @var IntegrationExtension
     */
    private $integrationExtension;

    /**
     * Construct
     *
     * @param IntegrationExtension $integrationExtension
     */
    public function __construct(IntegrationExtension $integrationExtension)
    {
        $this->integrationExtension = $integrationExtension;
    }

    /**
     * {@inheritDoc}
     */
    public function process(ContainerBuilder $container)
    {
        if (!$this->integrationExtension->isModelTransformerEnabled()) {
            if (count($container->findTaggedServiceIds('model_transformer'))) {
                throw new \RuntimeException('Could not compile model transformer, because system is not enabled.');
            }

            return;
        }

        $transformerManagerDefinition = $container->getDefinition('model_transformer');

        foreach ($container->findTaggedServiceIds('model_transformer') as $id => $tags) {
            $attributes = $this->fixAttributes($tags);

            $attributes += [
                'priority' => 0
            ];

            $definition = $container->getDefinition($id);
            $class = $definition->getClass();

            try {
                $class = $container->getParameterBag()->resolveValue($class);
                $refClass = new \ReflectionClass($class);
                $requiredInterface = 'FivePercent\Component\ModelTransformer\ModelTransformerInterface';

                if (!$refClass->implementsInterface($requiredInterface)) {
                    throw new \RuntimeException(sprintf(
                        'The model transformer should implement "%s" interface.',
                        $requiredInterface
                    ));
                }
            } catch (\Exception $e) {
                throw new \RuntimeException(sprintf(
                    'Could not compile model transformer with service id "%s".',
                    $id
                ), 0, $e);
            }

            $transformerManagerDefinition->addMethodCall('addTransformer', [
                new Reference($id),
                $attributes['priority']
            ]);
        }
    }
}


text:
var foo = async (await): Promise<void> => {
}


text:
if __name__ == '__main__' :
	import os
	os.sys.path.append(os.path.abspath('../..'))
########################################################################

import wx

# Real time plotting
import visvis

# GUI components
from libs.gui.basic_window import BasicWindow

from ga_tab import GA_Tab

# Hardware
from libs.dev.spectrometer_ocean_optics import ManagerOceanOpticsSpectrometer as ManagerSpectrometer
from libs.dev.spectrometer_ocean_optics import OceanOpticsSpectrometerTab as SpectrometerTab
#from libs.dev.camera_istar import ManagerIStarCamera as ManagerSpectrometer
#from libs.dev.camera_istar import IStarCameraTab as SpectrometerTab

from libs.dev.pulse_shaper import ManagerShaper, PulseShaperTab

########################################################################

class SettingsNotebook (wx.Notebook) :
	"""
	GUI for listing all settings
	"""
	def __init__(self, parent, DevSpectrometer, DevPulseShaper ):
		"""
		`DevSpectrometer` is a spectrometer manager
		"""
		wx.Notebook.__init__(self, parent)

		self.ODD_GA = GA_Tab(self)
		self.AddPage(self.ODD_GA, "ODD GA")

		self.Spectrometer = SpectrometerTab(self, DevSpectrometer)
		self.AddPage (self.Spectrometer, "Spectrometer")

		self.PulseShaper = PulseShaperTab(self, DevPulseShaper)
		self.AddPage (self.PulseShaper, "Pulse shaper")

		# Dictionary to bind names to tabs for saving and loading settings
		self.settings_to_tabs = {"Spectrometer" : self.Spectrometer,
			"PulseShaper" : self.PulseShaper, "ODD_GA" : self.ODD_GA }

########################################################################

class ODDExperiment  (BasicWindow) :

	def __init__ (self, parent) :
		# Starting spectrometer
		self.Spectrometer = ManagerSpectrometer()
		self.SpectrometerProc = self.Spectrometer.start()

		# Starting pulse shaper
		self.PulseShaper = ManagerShaper()
		self.PulseShaperProc = self.PulseShaper.start()

		# Create GUI
		dw, dh = wx.DisplaySize()
		wx.Frame.__init__ (self, parent, title="ODD for multiple fluoresce marker concentration measurements",
								size=(0.9*dw, 0.88*dh) )

		self.ConstructGUI ()
		self.Center()
		self.Maximize()
		self.Show ()
		wx.EVT_CLOSE (self, self.on_close)

	def __del__ (self) :
		# Close spectrometer
		self.Spectrometer.exit(); self.SpectrometerProc.join()

		# Close pulse shaper
		self.PulseShaper.exit(); self.PulseShaperProc.join()

	def ConstructGUI (self) :
		""" Build GUI """
		self.panel = wx.Panel(self)
		sizer = wx.GridBagSizer ()

		############################ Settings Notebook ############################
		self.SettingsNotebook = SettingsNotebook(self.panel, self.Spectrometer, self.PulseShaper)
		sizer.Add(self.SettingsNotebook, pos=(0, 0), span=(1, 1), flag=wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT , border=10)

		############################ Command panel ############################
		boxsizer = wx.BoxSizer (wx.VERTICAL)

		# Interactively display spectrum
		boxsizer.Add (self.CreateShowSpectrumButton(), flag=wx.EXPAND, border=5)

		# Separator
		boxsizer.Add (wx.StaticText(self.panel), flag=wx.EXPAND, border=5)

		# Separator
		boxsizer.Add (wx.StaticText(self.panel), flag=wx.EXPAND, border=5)

		# Send random phase to the pulse shaper
		boxsizer.Add (self.CreateRandomPhaseButton(), flag=wx.EXPAND, border=5)
		# Send random amplitude to the pulse shaper
		boxsizer.Add (self.CreateRandomAmplitudeButton(), flag=wx.EXPAND, border=5)
		# Send zero amplitude and zero phase to the pulse shaper
		boxsizer.Add (self.CreateZeroAmplitudeButton(), flag=wx.EXPAND, border=5)

		# Open pulse shaper equalizer
		boxsizer.Add (self.CreatePulseShaperEqualizerButton(), flag=wx.EXPAND, border=5)

		# Separator
		boxsizer.Add (wx.StaticText(self.panel), flag=wx.EXPAND, border=5)

		# Save settings
		boxsizer.Add( self.CreateSaveSettingsButton(), flag=wx.EXPAND, border=5)
		# Load settings
		boxsizer.Add( self.CreateLoadSettingsButton(), flag=wx.EXPAND, border=5)

		sizer.Add(boxsizer, pos=(1, 0), span=(1, 1), flag=wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT|wx.GROW, border=10)
		########################### End of constructing panel ######################################
		self.panel.SetSizer (sizer)

		############################# Setting visvis #######################################
		Figure = app.GetFigureClass()
		self.fig = Figure(self)

		boxsizer = wx.BoxSizer (wx.HORIZONTAL)
		boxsizer.Add(self.panel, 0.5, wx.EXPAND)
		boxsizer.Add(self.fig._widget, 2, wx.EXPAND)

		#########################################################################################
		self.SetSizer (boxsizer)
		self.SetAutoLayout(True)
		self.Layout()

#########################################################################

if __name__ == '__main__' :
	app = visvis.use('wx')
	app.Create()
	ODDExperiment (None)
	app.Run()


text:
{# {% load comments %} #}
{# {% load uni_form_tags %} #}
{#  #}
{# {% get_comment_form for rev.page as comment_form %} #}
{# <form action="{% comment_form_target %}" method="post" accept-charset="utf-8" class="uniForm"> #}
{#     <fieldset> #}
{#         {{ comment_form|as_uni_form }} #}
{#
 #}
{#             <input type="submit" value="Post Comment"> #}
{#
 #}
{#     </fieldset> #}
{# </form> #}

{# http://stackoverflow.com/questions/2393237/how-to-extend-the-comments-framework-django-by-removing-unnecesary-fields #}

{% load comments i18n %}
{% if user.is_authenticated %}
    <form action="{% comment_form_target %}" method="post">
        {% csrf_token %}
        {% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
        {% for field in form %}
            {% if field.is_hidden %}
                {{ field }}
            {% else %}
                {% if field.name != "name" and field.name != "email" and field.name != "url" %}
                    {% if field.errors %}{{ field.errors }}{% endif %}

                    {{ field }}

                {% endif %}
            {% endif %}
        {% endfor %}
        <input type="submit" name="post" class="submit-post" value="{% trans "Add Comment" %}" />
    </form>
{% else %}
    I'm sorry, but you must be signed in to submit comments.
{% endif %}


text:
/* --------------------------------

Primary style

-------------------------------- */
*, *::after, *::before {
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  font-size: 1.6rem;
  font-family: "Open Sans", sans-serif;
  color: #363558;
  background: url("../../../images/symbols/gradient.svg") center no-repeat;
  background-size: cover;
}

a {
  color: #544173;
  text-decoration: none;
}

h1, h2 {
  font-family: "Vollkorn", serif;
}

/* --------------------------------

Patterns - reusable parts of our design

-------------------------------- */
.overflow-hidden {
  overflow: hidden;
}

/* --------------------------------

Header

-------------------------------- */
header {
  height: 100vh;
  line-height: 170px;
  text-align: center;
  background: url("../../../images/TraditionalB.jpg") no-repeat center;
  background-size: cover;
}
header h1 {
  font-size: 2.2rem;
  color: #363558;
}
@media only screen and (min-width: 600px) {
  header {
    height: 200px;
    line-height: 200px;
  }
  header h1 {
    font-size: 3rem;
  }
}

/* --------------------------------

Main content

-------------------------------- */
.cd-main {
  overflow-x: hidden;
  color: black;
}
.cd-main::before {
  /* never visible - this is used in jQuery to check the current MQ */
  display: none;
  content: 'mobile';
}
.cd-main > * {
  -webkit-transition: -webkit-transform 0.5s 0.4s;
  -moz-transition: -moz-transform 0.5s 0.4s;
  transition: transform 0.5s 0.4s;
}
.cd-main.fold-is-open > * {
  /* on mobile - translate .cd-main content to the right when the .cd-folding-panel is open */
  -webkit-transform: translateX(100%);
  -moz-transform: translateX(100%);
  -ms-transform: translateX(100%);
  -o-transform: translateX(100%);
  transform: translateX(100%);
  -webkit-transition: -webkit-transform 0.5s 0s;
  -moz-transition: -moz-transform 0.5s 0s;
  transition: transform 0.5s 0s;
}
@media only screen and (min-width: 600px) {
  .cd-main.fold-is-open > * {
    -webkit-transform: translateX(600px);
    -moz-transform: translateX(600px);
    -ms-transform: translateX(600px);
    -o-transform: translateX(600px);
    transform: translateX(600px);
  }
}
@media only screen and (min-width: 1100px) {
  .cd-main::before {
    /* never visible - this is used in jQuery to check the current MQ */
    content: 'desktop';
  }
  .cd-main.fold-is-open > * {
    /* reset style - on bigger devices we translate the gallery items */
    -webkit-transform: translateX(0);
    -moz-transform: translateX(0);
    -ms-transform: translateX(0);
    -o-transform: translateX(0);
    transform: translateX(0);
  }
}

.cd-gallery::after {
  clear: both;
  content: "";
  display: table;
}
.cd-gallery::before {
  /* this is the dark layer covering the .cd-gallery when the .cd-folding-panel is open */
  display: block;
  content: '';
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(28, 23, 38, 0.6);
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.5s 0.4s, visibility 0s 0.9s;
  -moz-transition: opacity 0.5s 0.4s, visibility 0s 0.9s;
  transition: opacity 0.5s 0.4s, visibility 0s 0.9s;
}
.fold-is-open .cd-gallery::before {
  visibility: visible;
  opacity: 1;
  -webkit-transition: opacity 0.5s 0s, visibility 0s 0s;
  -moz-transition: opacity 0.5s 0s, visibility 0s 0s;
  transition: opacity 0.5s 0s, visibility 0s 0s;
}

.cd-item {
  width: 90%;
  height: 150px;
  text-align: center;
  /* Force Hardware Acceleration */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: -webkit-transform 0.5s 0.4s;
  -moz-transition: -moz-transform 0.5s 0.4s;
  transition: transform 0.5s 0.4s;
  border-radius: 15px;
  margin-top: 20px;
}
.cd-item > a {
  display: table;
  height: 100%;
  width: 100%;
  overflow: hidden;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.cd-item > a.dark-text {
  color: #363558;
}
.cd-item > a.dark-text b {
  border-color: #363558;
}
.cd-item div {
  display: table-cell;
  vertical-align: middle;
}
.cd-item:nth-of-type(1) {
  background-color: #F25B40;
}
.cd-item:nth-of-type(2) {
  background-color: #544173;
}
.cd-item:nth-of-type(3) {
  background-color: #dadcdc;
}
.cd-item:nth-of-type(4) {
  background-color: #65d29b;
}
.cd-item:nth-of-type(5) {
  background-color: #acacac;
}
.cd-item:nth-of-type(6) {
  background-color: #26899a;
}
.cd-item h2 {
  font-size: 2.2rem;
}
.cd-item p {
  line-height: 1.2;
  font-size: 1.4rem;
  opacity: 0.6;
  padding: 1em 0;
}
.cd-item b {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 1em 1.3em;
  border-radius: 50em;
  border: 1px solid #ffffff;
}
@media only screen and (min-width: 1100px) {
  .cd-item {
    width: 50%;
    float: left;
    height: 520px;
    -webkit-transition: -webkit-transform 0.5s 0.4s;
    -moz-transition: -moz-transform 0.5s 0.4s;
    transition: transform 0.5s 0.4s;
  }
  .cd-item h2 {
    font-size: 3rem;
  }
  .cd-item p {
    font-size: 1.6rem;
  }
  .cd-item h2, .cd-item p {
    -webkit-transform: translateY(30px);
    -moz-transform: translateY(30px);
    -ms-transform: translateY(30px);
    -o-transform: translateY(30px);
    transform: translateY(30px);
    -webkit-transition: -webkit-transform 0.3s 0.1s;
    -moz-transition: -moz-transform 0.3s 0.1s;
    transition: transform 0.3s 0.1s;
  }
  .cd-item b {
    opacity: 0;
    -webkit-transform: translateY(20px);
    -moz-transform: translateY(20px);
    -ms-transform: translateY(20px);
    -o-transform: translateY(20px);
    transform: translateY(20px);
    -webkit-transition: opacity 0.3s 0s, -webkit-transform 0.3s 0s;
    -moz-transition: opacity 0.3s 0s, -moz-transform 0.3s 0s;
    transition: opacity 0.3s 0s, transform 0.3s 0s;
  }
  .no-touch .cd-item a:hover h2, .no-touch .cd-item a:hover p {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
    -webkit-transition: -webkit-transform 0.3s 0s;
    -moz-transition: -moz-transform 0.3s 0s;
    transition: transform 0.3s 0s;
  }
  .no-touch .cd-item a:hover b {
    opacity: 1;
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
    -webkit-transition: opacity 0.3s 0.1s, -webkit-transform 0.3s 0.1s;
    -moz-transition: opacity 0.3s 0.1s, -moz-transform 0.3s 0.1s;
    transition: opacity 0.3s 0.1s, transform 0.3s 0.1s;
  }
  .fold-is-open .cd-item {
    -webkit-transition: -webkit-transform 0.5s 0s;
    -moz-transition: -moz-transform 0.5s 0s;
    transition: transform 0.5s 0s;
    -webkit-transform: translateX(-400px);
    -moz-transform: translateX(-400px);
    -ms-transform: translateX(-400px);
    -o-transform: translateX(-400px);
    transform: translateX(-400px);
  }
  .fold-is-open .cd-item:nth-of-type(3n) {
    -webkit-transform: translateX(400px);
    -moz-transform: translateX(400px);
    -ms-transform: translateX(400px);
    -o-transform: translateX(400px);
    transform: translateX(400px);
  }
}

/* --------------------------------

folding panel

-------------------------------- */
.cd-folding-panel {
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100%;
  visibility: hidden;
  overflow: hidden;
  -webkit-transition: visibility 0s 0.9s;
  -moz-transition: visibility 0s 0.9s;
  transition: visibility 0s 0.9s;
}
.cd-folding-panel .fold-left,
.cd-folding-panel .fold-right {
  /* the :after elements of .fold-left and .fold-right are the 2 fold sides */
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
  /* enable a 3D-space for children elements */
  -webkit-perspective: 2000px;
  -moz-perspective: 2000px;
  perspective: 2000px;
}
.cd-folding-panel .fold-left::after,
.cd-folding-panel .fold-right::after {
  /* 2 fold sides */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  /* Force Hardware Acceleration */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: -webkit-transform 0.5s 0.4s, background-color 0.5s 0.4s;
  -moz-transition: -moz-transform 0.5s 0.4s, background-color 0.5s 0.4s;
  transition: transform 0.5s 0.4s, background-color 0.5s 0.4s;
}
.cd-folding-panel .fold-right {
  -webkit-perspective-origin: 0% 50%;
  -moz-perspective-origin: 0% 50%;
  perspective-origin: 0% 50%;
}
.cd-folding-panel .fold-right::after {
  -webkit-transform-origin: right center;
  -moz-transform-origin: right center;
  -ms-transform-origin: right center;
  -o-transform-origin: right center;
  transform-origin: right center;
  -webkit-transform: translateX(-100%) rotateY(-90deg);
  -moz-transform: translateX(-100%) rotateY(-90deg);
  -ms-transform: translateX(-100%) rotateY(-90deg);
  -o-transform: translateX(-100%) rotateY(-90deg);
  transform: translateX(-100%) rotateY(-90deg);
  background-color: #c0c3c3;
}
.cd-folding-panel .fold-left {
  /* on mobile only the right fold side is visible */
  display: none;
}
.cd-folding-panel .fold-left::after {
  background-color: #f9fafa;
}
.cd-folding-panel .cd-close {
  /* 'X' close icon */
  position: absolute;
  z-index: 1;
  display: inline-block;
  top: 10px;
  right: 10px;
  height: 44px;
  width: 44px;
  /* image replacement */
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  opacity: 0;
  -webkit-transition: opacity 0.2s 0s;
  -moz-transition: opacity 0.2s 0s;
  transition: opacity 0.2s 0s;
}
.cd-folding-panel .cd-close::after, .cd-folding-panel .cd-close::before {
  /* lines of 'X' icon */
  content: '';
  position: absolute;
  height: 3px;
  width: 32px;
  left: 50%;
  top: 50%;
  background-color: #544173;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: opacity 0.2s;
  -moz-transition: opacity 0.2s;
  transition: opacity 0.2s;
}
.cd-folding-panel .cd-close::after {
  -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg);
  -moz-transform: translateX(-50%) translateY(-50%) rotate(45deg);
  -ms-transform: translateX(-50%) translateY(-50%) rotate(45deg);
  -o-transform: translateX(-50%) translateY(-50%) rotate(45deg);
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
}
.cd-folding-panel .cd-close::before {
  -webkit-transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  -moz-transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  -ms-transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  -o-transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  transform: translateX(-50%) translateY(-50%) rotate(-45deg);
}
.cd-folding-panel.is-open {
  visibility: visible;
  -webkit-transition: visibility 0s 0s;
  -moz-transition: visibility 0s 0s;
  transition: visibility 0s 0s;
}
.cd-folding-panel.is-open .fold-right::after,
.cd-folding-panel.is-open .fold-left::after {
  -webkit-transform: translateX(0);
  -moz-transform: translateX(0);
  -ms-transform: translateX(0);
  -o-transform: translateX(0);
  transform: translateX(0);
  -webkit-transition: -webkit-transform 0.5s 0s, background-color 0.5s 0s;
  -moz-transition: -moz-transform 0.5s 0s, background-color 0.5s 0s;
  transition: transform 0.5s 0s, background-color 0.5s 0s;
}
.cd-folding-panel.is-open .fold-right::after {
  background-color: #f9fafa;
}
.cd-folding-panel.is-open .cd-close {
  opacity: 1;
  -webkit-transition: opacity 0.2s 0.5s;
  -moz-transition: opacity 0.2s 0.5s;
  transition: opacity 0.2s 0.5s;
}
@media only screen and (min-width: 600px) {
  .cd-folding-panel {
    width: 600px;
  }
}
@media only screen and (min-width: 1100px) {
  .cd-folding-panel {
    left: 50%;
    right: auto;
    -webkit-transform: translateX(-50%);
    -moz-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    -o-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 800px;
  }
  .cd-folding-panel .fold-left,
  .cd-folding-panel .fold-right {
    width: 50%;
    float: left;
    height: 100%;
  }
  .cd-folding-panel .fold-right {
    /* change perspective-origin so that the 2 fold sides have the same vanishing point */
    -webkit-perspective-origin: 0% 50%;
    -moz-perspective-origin: 0% 50%;
    perspective-origin: 0% 50%;
  }
  .cd-folding-panel .fold-right::after {
    -webkit-transform-origin: right center;
    -moz-transform-origin: right center;
    -ms-transform-origin: right center;
    -o-transform-origin: right center;
    transform-origin: right center;
    -webkit-transform: translateX(-100%) rotateY(-90deg);
    -moz-transform: translateX(-100%) rotateY(-90deg);
    -ms-transform: translateX(-100%) rotateY(-90deg);
    -o-transform: translateX(-100%) rotateY(-90deg);
    transform: translateX(-100%) rotateY(-90deg);
  }
  .cd-folding-panel .fold-left {
    display: block;
    /* change perspective-origin so that the 2 fold sides have the same vanishing point */
    -webkit-perspective-origin: 100% 50%;
    -moz-perspective-origin: 100% 50%;
    perspective-origin: 100% 50%;
  }
  .cd-folding-panel .fold-left::after {
    -webkit-transform-origin: left center;
    -moz-transform-origin: left center;
    -ms-transform-origin: left center;
    -o-transform-origin: left center;
    transform-origin: left center;
    -webkit-transform: translateX(100%) rotateY(90deg);
    -moz-transform: translateX(100%) rotateY(90deg);
    -ms-transform: translateX(100%) rotateY(90deg);
    -o-transform: translateX(100%) rotateY(90deg);
    transform: translateX(100%) rotateY(90deg);
  }
}

.cd-fold-content {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  padding: 4em 2em;
  visibility: hidden;
  -webkit-transition: visibility 0s 0.4s;
  -moz-transition: visibility 0s 0.4s;
  transition: visibility 0s 0.4s;
  color: black;
}
.cd-fold-content > * {
  opacity: 1;
  -webkit-transform: translateY(20px);
  -moz-transform: translateY(20px);
  -ms-transform: translateY(20px);
  -o-transform: translateY(20px);
  transform: translateY(20px);
}
.cd-fold-content h2 {
  font-size: 2.4rem;
  -webkit-transition: -webkit-transform 0.2s 0.2s, opacity 0.2s 0.2s;
  -moz-transition: -moz-transform 0.2s 0.2s, opacity 0.2s 0.2s;
  transition: transform 0.2s 0.2s, opacity 0.2s 0.2s;
  color: black;
}
.cd-fold-content p, .cd-fold-content em {
  line-height: 1.6;
  color: black;
}
.cd-fold-content em {
  display: inline-block;
  margin: 1em 0;
  color: black;
  font-family: "Vollkorn", serif;
  font-size: 1.8rem;
  -webkit-transition: -webkit-transform 0.2s 0.1s, opacity 0.2s 0.1s;
  -moz-transition: -moz-transform 0.2s 0.1s, opacity 0.2s 0.1s;
  transition: transform 0.2s 0.1s, opacity 0.2s 0.1s;
}
.cd-fold-content p {
  color: black;
  margin-bottom: 1em;
  font-size: 1.4rem;
  -webkit-transition: -webkit-transform 0.2s 0s, opacity 0.2s 0s;
  -moz-transition: -moz-transform 0.2s 0s, opacity 0.2s 0s;
  transition: transform 0.2s 0s, opacity 0.2s 0s;
}
.is-open .cd-fold-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: visible;
  -webkit-transition: visibility 0s 0.5s;
  -moz-transition: visibility 0s 0.5s;
  transition: visibility 0s 0.5s;
}
.is-open .cd-fold-content > * {
  opacity: 1;
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0);
}
.is-open .cd-fold-content h2 {
  -webkit-transition: -webkit-transform 0.2s 0.5s, opacity 0.2s 0.5s;
  -moz-transition: -moz-transform 0.2s 0.5s, opacity 0.2s 0.5s;
  transition: transform 0.2s 0.5s, opacity 0.2s 0.5s;
}
.is-open .cd-fold-content em {
  -webkit-transition: -webkit-transform 0.2s 0.6s, opacity 0.2s 0.6s;
  -moz-transition: -moz-transform 0.2s 0.6s, opacity 0.2s 0.6s;
  transition: transform 0.2s 0.6s, opacity 0.2s 0.6s;
}
.is-open .cd-fold-content p {
  -webkit-transition: -webkit-transform 0.2s 0.7s, opacity 0.2s 0.7s;
  -moz-transition: -moz-transform 0.2s 0.7s, opacity 0.2s 0.7s;
  transition: transform 0.2s 0.7s, opacity 0.2s 0.7s;
}
@media only screen and (min-width: 600px) {
  .cd-fold-content h2 {
    font-size: 3.2rem;
  }
}
@media only screen and (min-width: 1100px) {
  .cd-fold-content {
    padding: 4em;
  }
  .cd-fold-content > * {
    -webkit-transform: translateY(40px);
    -moz-transform: translateY(40px);
    -ms-transform: translateY(40px);
    -o-transform: translateY(40px);
    transform: translateY(40px);
  }
  .cd-fold-content em {
    font-size: 2.2rem;
  }
  .cd-fold-content p {
    font-size: 1.6rem;
  }
}

/* --------------------------------

Javascript disabled

-------------------------------- */
.no-js .cd-fold-content.single-page {
  position: static;
  visibility: visible;
  height: auto;
  background-color: #dadcdc;
}
.no-js .cd-fold-content.single-page > * {
  opacity: 1;
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0);
}


text:
#ifndef _ALTOVA_INCLUDED_AIMXML_ALTOVA__ALTOVA_CGeometricShapeEntity
#define _ALTOVA_INCLUDED_AIMXML_ALTOVA__ALTOVA_CGeometricShapeEntity

#include "type_.CMarkupEntity.h"

namespace AIMXML
{

class CGeometricShapeEntity : public ::AIMXML::CMarkupEntity
{
public:
	AIMXML_EXPORT CGeometricShapeEntity(xercesc::DOMNode* const& init);
	AIMXML_EXPORT CGeometricShapeEntity(CGeometricShapeEntity const& init);
	void operator=(CGeometricShapeEntity const& other) { m_node = other.m_node; }
	static altova::meta::ComplexType StaticInfo() { return altova::meta::ComplexType(types + _altova_ti_altova_CGeometricShapeEntity); }
	MemberElement<iso::CCD, _altova_mi_altova_CGeometricShapeEntity_altova_questionTypeCode> questionTypeCode;
	struct questionTypeCode { typedef Iterator<iso::CCD> iterator; };
	MemberElement<iso::CINT, _altova_mi_altova_CGeometricShapeEntity_altova_shapeIdentifier> shapeIdentifier;
	struct shapeIdentifier { typedef Iterator<iso::CINT> iterator; };
	MemberElement<iso::CST, _altova_mi_altova_CGeometricShapeEntity_altova_label> label;
	struct label { typedef Iterator<iso::CST> iterator; };
	MemberElement<iso::CST, _altova_mi_altova_CGeometricShapeEntity_altova_description> description;
	struct description { typedef Iterator<iso::CST> iterator; };
	MemberElement<iso::CBL, _altova_mi_altova_CGeometricShapeEntity_altova_includeFlag> includeFlag;
	struct includeFlag { typedef Iterator<iso::CBL> iterator; };
	MemberElement<iso::CST, _altova_mi_altova_CGeometricShapeEntity_altova_comment> comment;
	struct comment { typedef Iterator<iso::CST> iterator; };
	MemberElement<iso::CST, _altova_mi_altova_CGeometricShapeEntity_altova_lineColor> lineColor;
	struct lineColor { typedef Iterator<iso::CST> iterator; };
	MemberElement<iso::CST, _altova_mi_altova_CGeometricShapeEntity_altova_lineOpacity> lineOpacity;
	struct lineOpacity { typedef Iterator<iso::CST> iterator; };
	MemberElement<iso::CST, _altova_mi_altova_CGeometricShapeEntity_altova_lineStyle> lineStyle;
	struct lineStyle { typedef Iterator<iso::CST> iterator; };
	MemberElement<iso::CST, _altova_mi_altova_CGeometricShapeEntity_altova_lineThickness> lineThickness;
	struct lineThickness { typedef Iterator<iso::CST> iterator; };
	MemberElement<iso::CINT, _altova_mi_altova_CGeometricShapeEntity_altova_questionIndex> questionIndex;
	struct questionIndex { typedef Iterator<iso::CINT> iterator; };
	MemberElement<iso::CCD, _altova_mi_altova_CGeometricShapeEntity_altova_interpolationMethod> interpolationMethod;
	struct interpolationMethod { typedef Iterator<iso::CCD> iterator; };
	AIMXML_EXPORT void SetXsiType();
};

}	// namespace AIMXML

#endif // _ALTOVA_INCLUDED_AIMXML_ALTOVA__ALTOVA_CGeometricShapeEntity


text:
@implementation NSString (Formatting)

- (NSAttributedString *)outlinedAttributedString {
    NSDictionary *attributes = @{ NSStrokeColorAttributeName : [UIColor whiteColor],
                                  NSForegroundColorAttributeName : [UIColor blackColor],
                                  NSStrokeWidthAttributeName : [NSNumber numberWithFloat:-2.0]
                                  };
    return [[NSAttributedString alloc] initWithString:self attributes:attributes];
}

@end


text:
"""
Print the number of bases in a nib file.

usage: %prog nib_file
"""

from bx.seq import nib as seq_nib
import sys

nib = seq_nib.NibFile( file( sys.argv[1] ) )
print nib.length


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">
    <move element="catalog.leftnav" destination="content.top" after="-"/>
</layout>


text:
package org.codehaus.xharness.log;

import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.easymock.MockControl;
import org.easymock.classextension.MockClassControl;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class LinkLoggerTest extends TestCase {
    public LinkLoggerTest(String name) {
        super(name);
    }

    public static void main(String[] args) throws Exception {
        if (System.getProperty("gui") != null) {
            String[] newArgs = new String[args.length + 2];
            System.arraycopy(args, 0, newArgs, 0, args.length);
            newArgs[args.length] = LinkLoggerTest.class.getName();
            newArgs[args.length + 1] = "-noloading";
            junit.swingui.TestRunner.main(newArgs);
        } else {
            String[] newArgs = new String[args.length + 1];
            System.arraycopy(args, 0, newArgs, 0, args.length);
            newArgs[args.length] = LinkLoggerTest.class.getName();
            junit.textui.TestRunner.main(newArgs);
        }
    }

    public static Test suite() {
        return new TestSuite(LinkLoggerTest.class);
    }

    public void testGetTaskType() throws Exception {
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();

        MockControl trCtrl = MockClassControl.createControl(TaskRegistry.class);
        TaskRegistry registry = (TaskRegistry)trCtrl.getMock();
        registry.getNextId();
        trCtrl.setReturnValue(101);
        registry.getProject();
        trCtrl.setReturnValue(project);

        prCtrl.replay();
        trCtrl.replay();

        LinkLogger logger = new LinkLogger(registry, null, null, null, null);
        assertEquals("Wrong task type", Result.LINK, logger.getTaskType());

        prCtrl.verify();
        trCtrl.verify();
    }

    public void testMessageLogged() throws Exception {
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();

        MockControl trCtrl = MockClassControl.createControl(TaskRegistry.class);
        TaskRegistry registry = (TaskRegistry)trCtrl.getMock();
        registry.getNextId();
        trCtrl.setReturnValue(101);
        registry.getProject();
        trCtrl.setReturnValue(project);

        MockControl tkCtrl = MockClassControl.createControl(Task.class);
        Task task = (Task)tkCtrl.getMock();

        MockControl evCtrl = MockClassControl.createControl(BuildEvent.class);
        BuildEvent event = (BuildEvent)evCtrl.getMock();
        event.getMessage();
        evCtrl.setReturnValue("blah", 2);
        event.getTask();
        evCtrl.setReturnValue(task, 3);
        event.getPriority();
        evCtrl.setReturnValue(2);

        prCtrl.replay();
        trCtrl.replay();
        tkCtrl.replay();
        evCtrl.replay();

        LinkLogger logger = new LinkLogger(registry, task, null, null, null);
        logger.messageLogged(event);
        assertEquals("Wrong log", "", logger.getLineBuffer().toString());

        prCtrl.verify();
        trCtrl.verify();
        tkCtrl.verify();
        evCtrl.verify();
    }
}


text:
package br.com.pandox.nfdonate.domain.socialEntity;

import br.com.pandox.nfdonate.domain.CNPJ;
import br.com.pandox.nfdonate.domain.socialEntity.approved.AACD;
import br.com.pandox.nfdonate.domain.socialEntity.approved.AMPARA;
import br.com.pandox.nfdonate.domain.socialEntity.approved.HospitalCancerBarretos;

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

public class ApprovedSocialEntities {

	List<SocialEntity> socialEntities;

	public ApprovedSocialEntities() {
		init();
	}

	void init() {
		HospitalCancerBarretos hospitalCancerBarretos = new HospitalCancerBarretos();
		AACD aacd = new AACD();
		AMPARA ampara = new AMPARA();

		socialEntities = new ArrayList<>();

		socialEntities.add(hospitalCancerBarretos);
		socialEntities.add(aacd);
		socialEntities.add(ampara);
	}

	public boolean isApproved(CNPJ cnpj) {
		for (SocialEntity socialEntity : socialEntities) {
			if (socialEntity.cnpj().equals(cnpj)) {
				return true;
			}
		}

		return false;
	}
}


text:
adsApp.controller('CategoriesController', ['$scope', '$rootScope', 'categoriesData', 'filter', function ($scope, $rootScope, categoriesData, filter) {
    $scope.categoryId = null;
    categoriesData.getCategories()
        .$promise
        .then(function (data) {
            $scope.categories = data;
        }, function (error) {
            console.log(error);
        });

    $scope.categoryClicked = function categoryClicked(category) {
        if (category != null) {
            $scope.categoryId = category.id;
        } else {
            $scope.categoryId = null;
        }
        filter.filterByCategory(category);
        $rootScope.$broadcast('categoryClicked', category);
    }
}]);


text:
macro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage)

    string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource)
    if (_insource)
        file(REMOVE [CMakeCache.txt CMakeFiles])
        message(FATAL_ERROR "${_errorMessage}")
    endif (_insource)

endmacro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD)

# vim:ts=4:sw=4:expandtab