text:
package com.zed.livetales;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.Log;

import org.webrtc.DataChannel;
import org.webrtc.IceCandidate;
import org.webrtc.MediaStream;
import org.webrtc.PeerConnection;
import org.webrtc.RendererCommon;
import org.webrtc.SessionDescription;
import org.webrtc.VideoRenderer;
import org.webrtc.VideoRendererGui;

import java.security.cert.Certificate;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import fi.vtt.nubomedia.kurentoroomclientandroid.KurentoRoomAPI;
import fi.vtt.nubomedia.kurentoroomclientandroid.RoomError;
import fi.vtt.nubomedia.kurentoroomclientandroid.RoomListener;
import fi.vtt.nubomedia.kurentoroomclientandroid.RoomNotification;
import fi.vtt.nubomedia.kurentoroomclientandroid.RoomResponse;
import fi.vtt.nubomedia.utilitiesandroid.LooperExecutor;
import fi.vtt.nubomedia.webrtcpeerandroid.NBMMediaConfiguration;
import fi.vtt.nubomedia.webrtcpeerandroid.NBMPeerConnection;
import fi.vtt.nubomedia.webrtcpeerandroid.NBMWebRTCPeer;

/**
 * Created by jemalpartida on 04/10/2016.
 */
@Deprecated
public class MyRoomListener implements RoomListener, NBMWebRTCPeer.Observer
{
    public MyRoomListener( String wsRoomUri, MyGLSurfaceView gl, Context context )
    {
        this.gl = gl;
        this.context = context;
        this.idMessage = 0;
        this.executor = new LooperExecutor();
        this.executor.requestStart();

        this.roomApi = new KurentoRoomAPI( executor, wsRoomUri, this );
    }

    public void useSelfSignedCertificate( boolean isSelfSignedCertificate )
    {
        this.roomApi.useSelfSignedCertificate( isSelfSignedCertificate );
    }

    public void addTrustedCertificate( String alias, Certificate certificate )
    {

        this.roomApi.addTrustedCertificate( alias, certificate );
    }

    public boolean isConnected()
    {
        return this.roomApi.isWebSocketConnected();
    }

    public void connect()
    {
        this.roomApi.connectWebSocket();
    }

    public void step1()
    {
        Log.v("MyRoomListener", "MyRoomListener::onRoomResponse::Generate SDP Offer...");
        //Se manda:
        // connectionId -> que es el nombre del usuario que crea la conexion.
        // includeLocalMedia -> T | F
        this.webRTCPeer.generateOffer( USER, false );
        Log.v("MyRoomListener", "MyRoomListener::onRoomResponse::Generate SDP Offer...Fin!");

        /*
        if( this.webRTCPeer.startLocalMedia() )
        {
            Log.v("MyRoomListener", "MyRoomListener::onRoomResponse::WEBRTCPEER is startLocalMedia: YES!");

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            Log.v("MyRoomListener", "MyRoomListener::onRoomResponse::Generate SDP Offer...");
            this.webRTCPeer.generateOffer( sessionId, false );
            Log.v("MyRoomListener", "MyRoomListener::onRoomResponse::Generate SDP Offer...Fin!");
        }
        else
            Log.v("MyRoomListener", "MyRoomListener::onRoomResponse::WEBRTCPEER is startLocalMedia: NO!");
*/
    }

    /*============================================================================================*/
    /*                               Override from RoomListener                                   */
    /*============================================================================================*/
    @Override
    public void onRoomConnected()
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onRoomConnected!" );

        boolean isWSConnected = this.roomApi.isWebSocketConnected();
        Log.v( "MyRoomListener", "MyRoomListener ---> onRoomConnected -- EL WEBSOCKET ESTA CONECTADO:"+isWSConnected );
        if( isWSConnected )
        {
            Log.v( "MyRoomListener", "MyRoomListener ---> onRoomConnected -- ME UNO A LA ROOM:" + ROOM );
            this.roomApi.sendJoinRoom( USER, ROOM, false, this.idMessage++ );
        }
        else
        {
            Log.v( "MyRoomListener", "MyRoomListener ---> onRoomConnected -- EL WEBSOCKET NO ESTA CONECTADO!" );
        }
    }

    @Override
    public void onRoomDisconnected()
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onRoomDisconnected!" );
        this.executor.requestStop();
    }

    @Override
    public void onRoomResponse( RoomResponse response )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onRoomResponse!" );
        String responseId = response.getId();
        this.sessionId = response.getSessionId();

        List<HashMap<String,String>> values = response.getValues();

        Log.v( "MyRoomListener", "MyRoomListener ---> responseId:" + responseId );
        Log.v( "MyRoomListener", "MyRoomListener ---> sessionId :" + sessionId );
        if( values != null )
        {
            Iterator<HashMap<String,String>> it = values.iterator();
            while( it.hasNext() )
            {
                for (Map.Entry<String, String> entry :it.next().entrySet())
                {
                    String key = entry.getKey();
                    String value = entry.getValue();
                    Log.v( "MyRoomListener", "MyRoomListener ---> key:" + key + " - value:" + value );
                }
            }
            /*
            for (Map.Entry<String, String> entry : values.entrySet()) {
                String key = entry.getKey();
                String value = entry.getValue();
                Log.v( "MyRoomListener", "MyRoomListener ---> key:" + key + " - value:" + value );
            }
            */
        }

        //Configuracion...?
        if( responseId.equals("0") )
        {
            //VideoView videoView = (VideoView)((Activity)this.context).findViewById( R.id.videoView );
            //GLSurfaceView gl = new GLSurfaceView( this.context );
            //MyGLSurfaceView gl = (MyGLSurfaceView)((Activity)this.context).findViewById( R.id.videoView );

            GLSurfaceView gl2 = new GLSurfaceView(this.context);
            //((Activity)this.context).setContentView( gl2 );
            VideoRendererGui.setView( gl2, new Runnable(){
                @Override
                public void run(){
                    Log.v( "MyRoomListener", "MyRoomListener::onRoomResponse::SETVIEW OPENGL RUN" );
                }
            });

            this.localRender = VideoRendererGui.create( 72,72,25,25, RendererCommon.ScalingType.SCALE_ASPECT_FILL, false );
            NBMMediaConfiguration mediaConfiguration = new NBMMediaConfiguration();
            this.webRTCPeer = new NBMWebRTCPeer( mediaConfiguration, this.context, this.localRender, this );
            this.webRTCPeer.initialize();

            Log.v( "MyRoomListener", "MyRoomListener::onRoomResponse::WEBRTCPEER initialice called" );
        }
    }

    @Override
    public void onRoomError( RoomError error )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onRoomError!" );

        String errorCode = error.getCode();
        String errorData = error.getData();
    }

    @Override
    public void onRoomNotification( RoomNotification notification )
    {
        String method = notification.getMethod();
        Map<String, Object> values = notification.getParams();

        Log.v( "MyRoomListener", "MyRoomListener ---> onRoomNotification!" );
        Log.v( "MyRoomListener", "MyRoomListener ---> onRoomNotification - Method:" +  method );
        if( values != null )
        {
            for (Map.Entry<String, Object> entry : values.entrySet()) {
                String key = entry.getKey();
                Object value = entry.getValue();
                Log.v( "MyRoomListener", "MyRoomListener ---> key:" + key + " - value:" + value );
            }
            Long l = (Long)values.get("sdpMLineIndex");

            IceCandidate remote = new IceCandidate((String)values.get("sdpMid"),l.intValue(),(String)values.get("candidate"));
            this.webRTCPeer.addRemoteIceCandidate( remote, USER );
        }

        if( notification.getMethod().equals( RoomListener.METHOD_PARTICIPANT_JOINED ) )
        {
            // TODO
        }
        else if( notification.getMethod().equals( RoomListener.METHOD_SEND_MESSAGE ) )
        {
            // TODO
        }
        else
        {

        }
    }

    @Override
    public void onDataChannel(DataChannel dataChannel, NBMPeerConnection connection)
    {
        Log.v( "RoomManager", "RoomManager ---> onDataChannel!" );
    }

    @Override
    public void onBufferedAmountChange(long l, NBMPeerConnection connection, DataChannel channel)
    {
        Log.v( "RoomManager", "RoomManager ---> onBufferedAmountChange!" );
    }

    @Override
    public void onStateChange(NBMPeerConnection connection, DataChannel channel)
    {
        Log.v( "RoomManager", "RoomManager ---> onStateChange!" );
    }

    @Override
    public void onMessage(DataChannel.Buffer buffer, NBMPeerConnection connection, DataChannel channel)
    {
        Log.v( "RoomManager", "RoomManager ---> onMessage!" );
    }

    /*============================================================================================*/
    /*                          Override from BMWebRTCPeer.Observer                               */
    /*============================================================================================*/
    @Override
    public void onInitialize()
    {

    }

    @Override
    public void onLocalSdpOfferGenerated(SessionDescription localSdpOffer, NBMPeerConnection connection )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onLocalSdpOfferGenerated!" );
        Log.v( "MyRoomListener", "MyRoomListener ---> onLocalSdpOfferGenerated SDPOFFER - DUMP:" + localSdpOffer.toString() );
        Log.v( "MyRoomListener", "MyRoomListener ---> onLocalSdpOfferGenerated :: CONNECTION - DUMP:" + connection.toString() );

        //Se manda:
        // remoteAnswer - > localSdpOffer
        // connectionId -> Usuario que crea la conexion.
        //this.webRTCPeer.processAnswer(localSdpOffer, USER );

        //Se manda:
        // SDPOffer -> que es la descripción.
        // loopback -> T | F
        // idMsg (int)
        this.roomApi.sendPublishVideo( localSdpOffer.description ,true, this.idMessage++ );
    }

    @Override
    public void onLocalSdpAnswerGenerated( SessionDescription localSdpAnswer, NBMPeerConnection connection )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onLocalSdpAnswerGenerated!" );
    }

    @Override
    public void onIceCandidate( IceCandidate localIceCandidate, NBMPeerConnection connection )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onIceCandidate!" );

        //Se manda:
        // EndpointName -> Nombre del usuario (que crea la conexion).
        // sdp -> SDP
        // sdpMid -> SDPMID
        // sdpMLineIndex -> SDPMLineIndex (int)
        // IdMsg (int).
        this.roomApi.sendOnIceCandidate( USER, localIceCandidate.sdp, localIceCandidate.sdpMid, String.valueOf( localIceCandidate.sdpMLineIndex ) , this.idMessage++ );
    }

    @Override
    public void onIceStatusChanged(PeerConnection.IceConnectionState state, NBMPeerConnection connection )
    {
        Log.v( "MyRoomListener","MyRoomListener ---> onIceStatusChanged!" );
    }

    @Override
    public void onRemoteStreamAdded(MediaStream stream, NBMPeerConnection connection )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onRemoteStreamAdded!" );
    }

    @Override
    public void onRemoteStreamRemoved( MediaStream stream, NBMPeerConnection connection )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onRemoteStreamRemoved!" );
    }

    @Override
    public void onPeerConnectionError( String error )
    {
        Log.v( "MyRoomListener", "MyRoomListener ---> onPeerConnectionError!" );
    }

    private KurentoRoomAPI roomApi;
    private LooperExecutor executor ;
    private int idMessage;
    private Context context;
    private VideoRenderer.Callbacks localRender;
    private NBMWebRTCPeer webRTCPeer;
    private MyGLSurfaceView gl;
    private String sessionId;

    private static final String USER = "Android";
    private static final String ROOM = "r1";
}


text:
require "merb-core"
require "merb-haml"
require "merb-assets"
require "merb-helpers"

require 'coderay'

require 'chef'
require 'chef/solr'

require 'chef/role'
require 'chef/webui_user'

use_template_engine :haml

Merb::Config.use do |c|
  c[:name] = "chef-server-webui"
  c[:fork_for_class_load] = false
  c[:session_id_key]     = '_chef_server_session_id'
  c[:session_secret_key] = Chef::Config.manage_secret_key
  c[:session_store]      = 'cookie'

  c[:log_level] = Chef::Config[:log_level]
  if Chef::Config[:log_location].kind_of?(String)
    c[:log_file] = Chef::Config[:log_location]
  end
end

Chef::Config[:node_name] = Chef::Config[:web_ui_client_name]
Chef::Config[:client_key] = Chef::Config[:web_ui_key]

# Create the default admin user "admin" if no admin user exists
unless Chef::WebUIUser.admin_exist
  user = Chef::WebUIUser.new
  user.name = Chef::Config[:web_ui_admin_user_name]
  user.set_password(Chef::Config[:web_ui_admin_default_password])
  user.admin = true
  user.save
end

redpajama_set_name: RedPajamaGithub


text:
package $package$.shared

object SharedMessages {
  def itWorks = "It works!"
}


text:
package werkbook.task.gtasks;

import java.util.Date;

import com.google.api.services.tasks.model.Task;

import werkbook.task.commons.exceptions.IllegalValueException;
import werkbook.task.model.tag.Tag;
import werkbook.task.model.tag.UniqueTagList;
import werkbook.task.model.task.Description;
import werkbook.task.model.task.EndDateTime;
import werkbook.task.model.task.Name;
import werkbook.task.model.task.ReadOnlyTask;
import werkbook.task.model.task.StartDateTime;
import werkbook.task.model.util.DateTimeUtil;

//@@author A0162266E
public class GTaskToTaskAdapter implements ReadOnlyTask {
    private Name name;
    private Description description;
    private StartDateTime startDateTime;
    private EndDateTime endDateTime;
    private Date lastUpdated;
    private UniqueTagList tags;

    public GTaskToTaskAdapter(Task gTask) throws IllegalValueException {
        this.name = new Name(gTask.getTitle() == "" ? "No Title" : gTask.getTitle());
        this.description = new Description(gTask.getNotes() == null ? "" : gTask.getNotes());
        this.startDateTime = new StartDateTime("");
        this.endDateTime = new EndDateTime(gTask.getDue() == null ? "" : DateTimeUtil.DATETIME_FORMATTER.format(
                gTask.getDue().getValue()));
        this.lastUpdated = new Date(gTask.getUpdated().getValue());
        this.tags = new UniqueTagList();
        this.tags.add(new Tag(gTask.getCompleted() == null ? "Incomplete" : "Complete"));
    }

    @Override
    public Name getName() {
        return this.name;
    }

    @Override
    public Description getDescription() {
        return this.description;
    }

    @Override
    public StartDateTime getStartDateTime() {
        return this.startDateTime;
    }

    @Override
    public EndDateTime getEndDateTime() {
        return this.endDateTime;
    }

    @Override
    public Date getUpdated() {
        return this.lastUpdated;
    }

    @Override
    public UniqueTagList getTags() {
        return this.tags;
    }
}


text:
'use strict';
define([
  'angular',
  './<%= serviceFile %>'
], function(angular) {
  angular.module('<%=angularModuleName%>.directive',
          [
            '<%= angularModuleName%>.service'
          ]).directive('<%=moduleName%>DirectiveExample',
          [
            '$rootScope',
            '<%=moduleName%>Service',
            function(
                    $rootScope
                    ) {
              return {
                restrict: 'E',
//                template: templateDirective,
                controller: function() {
                  //Here directive code
                },
                controllerAs: 'panel'
              };
            }
          ])
          /**
           *
           */
          .directive('shakeThat',
          ['$animate', '$window', '$rootScope', '$translate', '$log', 'UserService', 'AuthenticationService',
            function($animate, $window, $rootScope, $translate, $log, UserService, AuthenticationService) {
              return {
                require: '^form',
                scope: {
                  submit: '&',
                  submitted: '='
                },
                link: function(scope, element, attrs, form) {
                  // listen on submit event
                  element.on('submit', function() {
                    // tell angular to update scope
                    scope.$apply(function() {
                      // everything ok -> call submit fn from controller
                      if (form.$valid) {
                        UserService.logIn(form.email.$modelValue, form.password.$modelValue).success(function(data) {
                          AuthenticationService.isLogged = true;
                          $window.sessionStorage.setItem('token', data.token);
                          $rootScope.isLogged = true;
                          $rootScope.userLogged = data.user;
                          $rootScope.messageClass = 'alert alert-success';
                          $translate.refresh();
                          $rootScope.message = $translate.instant('module.<%=moduleName%>.welcome') + ' ' + data.user.name;
                          //Translations with promises
//                          $translate('module.auth.welcome')
//                                  .then(function(translation) {
//                            alert(translation)
//                            $log.debug(translation.welcome);
//                          });
                          // translate instantly from the internal state of loaded translation
                          $log.debug($translate.instant('module.<%=moduleName%>.welcome'));
                        }).error(function(status, data) {
                          $rootScope.messageClass = 'alert alert-danger';
                          $rootScope.message = $translate.instant('module.<%=moduleName%>.error_' + data);
                        });
                        return scope.submit();
                      }

                      // show error messages on submit
                      scope.submitted = true;
                      // shake that form
                      $animate.addClass(element, 'shake', function() {
                        $animate.removeClass(element, 'shake');
                      });
                    });
                  });
                }
              };
            }]);
});


text:
package net.techreadiness.ui.tags;

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

import javax.servlet.jsp.JspException;

import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;

public abstract class ParentTag extends BaseTag {

	private boolean collectingChildren;

	private List<BaseTag> children = new ArrayList<>();

	@Override
	public void doTag() throws JspException, IOException {
		super.doTag();
	}

	public void collectChildren() throws JspException, IOException {
		collectingChildren = true;
		invokeBody();
		collectingChildren = false;
	}

	public boolean isCollectingChildren() {
		return collectingChildren;
	}

	public List<BaseTag> getChildren() {
		return children;
	}

	public <T> List<T> getChildren(Class<T> type) {
		return Lists.newArrayList(Iterables.filter(children, type));
	}
}


text:
use neon::prelude::*;

mod js {
    pub mod arrays;
    pub mod boxed;
    pub mod coercions;
    pub mod errors;
    pub mod functions;
    pub mod numbers;
    pub mod objects;
    pub mod types;
    pub mod strings;
}

use js::arrays::*;
use js::boxed::*;
use js::coercions::*;
use js::errors::*;
use js::functions::*;
use js::numbers::*;
use js::objects::*;
use js::types::*;
use js::strings::*;

register_module!(|mut cx| {
    let greeting = cx.string("Hello, World!");
    let greeting_copy = greeting.value(&mut cx);
    let greeting_copy = cx.string(greeting_copy);

    cx.export_value("greeting", greeting)?;
    cx.export_value("greetingCopy", greeting_copy)?;

    // Global singletons.
    let undefined = cx.undefined();
    let null = cx.null();
    let b_true = cx.boolean(true);
    let b_false = cx.boolean(false);

    assert_eq!(b_true.value(&mut cx), true);
    assert_eq!(b_false.value(&mut cx), false);

    cx.export_value("undefined", undefined)?;
    cx.export_value("null", null)?;
    cx.export_value("true", b_true)?;
    cx.export_value("false", b_false)?;

    let one = cx.number(1);
    let two = cx.number(2.1);
    assert_eq!(one.value(&mut cx), 1.0);
    assert_eq!(two.value(&mut cx), 2.1);
    cx.export_value("one", one)?;
    cx.export_value("two", two)?;

    // Plain objects.
    let rust_created = cx.empty_object();
    {
        let a = cx.number(1);
        // set at name
        rust_created.set(&mut cx, "a", a)?;
        // set at index
        rust_created.set(&mut cx, 0, a)?;
    }
    {
        let whatever = cx.boolean(true);
        rust_created.set(&mut cx, "whatever", whatever)?;
    }

    assert_eq!({
        let v: Handle<JsNumber> = rust_created.get(&mut cx, "a")?.downcast_or_throw(&mut cx)?;
        v.value(&mut cx)
    }, 1.0f64);
    assert_eq!({
        let v: Handle<JsNumber> = rust_created.get(&mut cx, 0)?.downcast_or_throw(&mut cx)?;
        v.value(&mut cx)
    }, 1.0f64);
    assert_eq!({
        let v: Handle<JsBoolean> = rust_created.get(&mut cx, "whatever")?.downcast_or_throw(&mut cx)?;
        v.value(&mut cx)
    }, true);

    let property_names = rust_created.get_own_property_names(&mut cx)?
        .to_vec(&mut cx)?
        .into_iter()
        .map(|value| {
            let string: Handle<JsString> = value.downcast_or_throw(&mut cx)?;
            Ok(string.value(&mut cx))
        })
        .collect::<Result<Vec<_>, _>>()?;
    assert_eq!(property_names, &["0", "a", "whatever"]);

    cx.export_value("rustCreated", rust_created)?;

    fn add1(mut cx: FunctionContext) -> JsResult<JsNumber> {
        let x = cx.argument::<JsNumber>(0)?.value(&mut cx);
        Ok(cx.number(x + 1.0))
    }

    cx.export_function("add1", add1)?;

    cx.export_function("return_js_string", return_js_string)?;

    cx.export_function("return_js_number", return_js_number)?;
    cx.export_function("return_large_js_number", return_large_js_number)?;
    cx.export_function("return_negative_js_number", return_negative_js_number)?;
    cx.export_function("return_float_js_number", return_float_js_number)?;
    cx.export_function("return_negative_float_js_number", return_negative_float_js_number)?;
    cx.export_function("accept_and_return_js_number", accept_and_return_js_number)?;
    cx.export_function("accept_and_return_large_js_number", accept_and_return_large_js_number)?;
    cx.export_function("accept_and_return_float_js_number", accept_and_return_float_js_number)?;
    cx.export_function("accept_and_return_negative_js_number", accept_and_return_negative_js_number)?;

    cx.export_function("return_js_function", return_js_function)?;
    cx.export_function("call_js_function", call_js_function)?;
    cx.export_function("construct_js_function", construct_js_function)?;
    cx.export_function("num_arguments", num_arguments)?;
    cx.export_function("return_this", return_this)?;
    cx.export_function("require_object_this", require_object_this)?;
    cx.export_function("is_argument_zero_some", is_argument_zero_some)?;
    cx.export_function("require_argument_zero_string", require_argument_zero_string)?;
    cx.export_function("check_string_and_number", check_string_and_number)?;
    cx.export_function("execute_scoped", execute_scoped)?;
    cx.export_function("compute_scoped", compute_scoped)?;

    cx.export_function("return_js_array", return_js_array)?;
    cx.export_function("return_js_array_with_number", return_js_array_with_number)?;
    cx.export_function("return_js_array_with_string", return_js_array_with_string)?;
    cx.export_function("read_js_array", read_js_array)?;

    cx.export_function("to_string", to_string)?;

    cx.export_function("return_js_global_object", return_js_global_object)?;
    cx.export_function("return_js_object", return_js_object)?;
    cx.export_function("return_js_object_with_number", return_js_object_with_number)?;
    cx.export_function("return_js_object_with_string", return_js_object_with_string)?;
    cx.export_function("return_js_object_with_mixed_content", return_js_object_with_mixed_content)?;

    cx.export_function("return_array_buffer", return_array_buffer)?;
    cx.export_function("read_array_buffer_with_lock", read_array_buffer_with_lock)?;
    cx.export_function("read_array_buffer_with_borrow", read_array_buffer_with_borrow)?;
    cx.export_function("write_array_buffer_with_lock", write_array_buffer_with_lock)?;
    cx.export_function("write_array_buffer_with_borrow_mut", write_array_buffer_with_borrow_mut)?;
    cx.export_function("return_buffer", return_buffer)?;
    cx.export_function("read_buffer_with_lock", read_buffer_with_lock)?;
    cx.export_function("read_buffer_with_borrow", read_buffer_with_borrow)?;
    cx.export_function("write_buffer_with_lock", write_buffer_with_lock)?;
    cx.export_function("write_buffer_with_borrow_mut", write_buffer_with_borrow_mut)?;

    cx.export_function("is_array", is_array)?;
    cx.export_function("is_array_buffer", is_array_buffer)?;
    cx.export_function("is_boolean", is_boolean)?;
    cx.export_function("is_buffer", is_buffer)?;
    cx.export_function("is_error", is_error)?;
    cx.export_function("is_null", is_null)?;
    cx.export_function("is_number", is_number)?;
    cx.export_function("is_object", is_object)?;
    cx.export_function("is_string", is_string)?;
    cx.export_function("is_undefined", is_undefined)?;

    cx.export_function("new_error", new_error)?;
    cx.export_function("new_type_error", new_type_error)?;
    cx.export_function("new_range_error", new_range_error)?;
    cx.export_function("throw_error", throw_error)?;
    cx.export_function("downcast_error", downcast_error)?;

    cx.export_function("panic", panic)?;
    cx.export_function("panic_after_throw", panic_after_throw)?;

    cx.export_function("throw_and_catch", throw_and_catch)?;
    cx.export_function("call_and_catch", call_and_catch)?;
    cx.export_function("is_construct", is_construct)?;

    fn call_get_own_property_names(mut cx: FunctionContext) -> JsResult<JsArray> {
        let object = cx.argument::<JsObject>(0)?;
        object.get_own_property_names(&mut cx)
    }

    cx.export_function("get_own_property_names", call_get_own_property_names)?;

    cx.export_function("person_new", person_new)?;
    cx.export_function("person_greet", person_greet)?;
    cx.export_function("ref_person_new", ref_person_new)?;
    cx.export_function("ref_person_greet", ref_person_greet)?;
    cx.export_function("ref_person_set_name", ref_person_set_name)?;
    cx.export_function("ref_person_fail", ref_person_fail)?;
    cx.export_function("external_unit", external_unit)?;

    Ok(())
});


text:
#include "GTM.h"

#include <cstdlib>
#include <iostream>

//
//  Test the Set and Get methods
//

int main( int argc, char * argv [] )
{
  GTM gtm;

  std::string globalName = "^Capital";
  std::string setValue = "London";

  try
    {

    gtm.Set( globalName, setValue );

    std::string getValue;

    gtm.Get( globalName, getValue );

    std::cout << globalName << " = " << getValue << std::endl;

    }
  catch( std::runtime_error & excp )
    {
    std::cerr << excp.what() << std::endl;
    }

  return EXIT_SUCCESS;
}


text:
package com.fabio.database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;

import com.fabio.settings.Settings;

/**
 * Testdb Description: simple hello world db example of a standalone
 * persistent db application
 *
 * every time it runs it adds some more rows to sample_table, does a query and
 * prints the results to standard out
 *
 */
public class DBManager {

	Connection conn; // our connnection to the db - presist for life of program

	// we dont want this garbage collected until we are done
	public DBManager(String db_file_name_prefix) throws Exception {

		// Load the HSQL Database Engine JDBC driver
		// hsqldb.jar should be in the class path or made part of the current
		// jar
		Class.forName(Settings.DATABASE_DRIVER);

		// connect to the database. This will load the db files and start the
		// database if it is not alread running.
		// db_file_name_prefix is used to open or create files that hold the
		// state
		// of the db.
		// It can contain directory names relative to the
		// current working directory
		conn = DriverManager.getConnection(Settings.DATABASE_URL + db_file_name_prefix, // filenames
				Settings.DATABASE_USERNAME, Settings.DATABASE_PASSWORD);
	}

	public Connection getConnection() {
		return conn;
	}

	public void shutdown() throws SQLException {

		Statement st = conn.createStatement();

		// db writes out to files and performs clean shuts down
		// otherwise there will be an unclean shutdown
		// when program ends
		st.execute("SHUTDOWN");
		conn.close(); // if there are no other open connection
	}

	// use for SQL command SELECT
	public synchronized void query(String expression) throws SQLException {

		Statement st = null;
		ResultSet rs = null;

		st = conn.createStatement(); // statement objects can be reused with
		// repeated calls to execute but we
		// choose to make a new one each time
		rs = st.executeQuery(expression); // run the query

		// do something with the result set.
		dump(rs);
		st.close();
		// NOTE!! if you close a statement the associated ResultSet
		// is closed too
		// so you should copy the contents to some other object.
		// the result set is invalidated also if you recycle an Statement
		// and try to execute some other query before the result set has been
		// completely examined.
	}

	// use for SQL command SELECT
	public synchronized ResultSet queryWithResultSet(String expression) throws SQLException {

		Statement st = null;
		ResultSet rs = null;

		st = conn.createStatement(); // statement objects can be reused with
		// repeated calls to execute but we
		// choose to make a new one each time
		rs = st.executeQuery(expression); // run the query

		return rs;
	}

	// use for SQL commands CREATE, DROP, INSERT and UPDATE
	public synchronized void update(String expression) throws SQLException {

		Statement st = null;

		st = conn.createStatement(); // statements

		int i = st.executeUpdate(expression); // run the query

		if (i == -1) {
			System.out.println("db error : " + expression);
		}

		st.close();
	} // void update()

	public static void dump(ResultSet rs) throws SQLException {

		// the order of the rows in a cursor
		// are implementation dependent unless you use the SQL ORDER statement
		ResultSetMetaData meta = rs.getMetaData();
		int colmax = meta.getColumnCount();
		int i;
		Object o = null;

		// the result set is a cursor into the data. You can only
		// point to one row at a time
		// assume we are pointing to BEFORE the first row
		// rs.next() points to next row and returns true
		// or false if there is no next row, which breaks the loop
		for (; rs.next();) {
			for (i = 0; i < colmax; ++i) {
				o = rs.getObject(i + 1); // Is SQL the first column is indexed

				// with 1 not 0
				System.out.print(o.toString() + " ");
			}

			System.out.println(" ");
		}
	} // void dump( ResultSet rs )

	public static void main(String[] args) {

		DBManager db = null;

		try {
			db = new DBManager("my_database");
		} catch (Exception ex1) {
			ex1.printStackTrace(); // could not start db

			return; // bye bye
		}

		try {

			// make an empty table
			//
			// by declaring the id column IDENTITY, the db will automatically
			// generate unique values for new rows- useful for row keys
			db.update("CREATE TABLE sample_table ( id INTEGER IDENTITY, str_col VARCHAR(256), num_col INTEGER)");
		} catch (SQLException ex2) {
		}

		try {

			// add some rows - will create duplicates if run more then once
			// the id column is automatically generated
			db.update("INSERT INTO sample_table(str_col,num_col) VALUES('Ford', 100)");
			db.update("INSERT INTO sample_table(str_col,num_col) VALUES('Toyota', 200)");
			db.update("INSERT INTO sample_table(str_col,num_col) VALUES('Honda', 300)");
			db.update("INSERT INTO sample_table(str_col,num_col) VALUES('GM', 400)");

			// do a query
			db.query("SELECT * FROM sample_table WHERE num_col < 250");

			// at end of program
			db.shutdown();
		} catch (SQLException ex3) {
			ex3.printStackTrace();
		}
	} // main()
} // class Testdb


text:
package mesosphere.marathon
package tasks

import java.util

import mesosphere.UnitTest
import mesosphere.marathon.tasks.PortsMatcher.{ PortRange, PortWithRole }

import scala.collection.immutable.Seq
import scala.util.Random

class PortWithRoleRandomPortsFromRangesTest extends UnitTest {

  private[this] def portRange(role: String, begin: Long, end: Long): PortRange = {
    PortRange(role, begin.toInt, end.toInt)
  }

  private[this] def withRandomSeeds(input: Seq[PortRange], expectedOutput: Seq[PortWithRole]): Unit = {
    for (seed <- 1 to 10) {
      withClue(s"seed = $seed") {
        val rand = new Random(new util.Random(seed.toLong))

        assert(PortWithRole.lazyRandomPortsFromRanges(rand)(input).to[Set] == expectedOutput.to[Set])
      }
    }

  }

  "PortWithRoleRandomPortsFromRanges" should {
    "works for empty seq" in {
      assert(PortWithRole.lazyRandomPortsFromRanges()(Seq.empty).to[Seq] == Seq.empty)
    }

    "works for one element range" in {
      assert(
        PortWithRole.lazyRandomPortsFromRanges()(Seq(portRange("role", 10, 10))).to[Seq] == Seq(PortWithRole("role", 10)))
    }

    "works for one range with four ports" in {
      withRandomSeeds(
        input = Seq(
          portRange("role", 10, 13)
        ),
        expectedOutput = (10 to 13).map(PortWithRole("role", _))
      )
    }

    "works for multiple ranges" in {
      withRandomSeeds(
        input = Seq(
          portRange("role", 10, 13),
          portRange("marathon", 14, 20),
          portRange("role", 21, 30)
        ),
        expectedOutput =
          (10 to 13).map(PortWithRole("role", _)) ++
            (14 to 20).map(PortWithRole("marathon", _)) ++
            (21 to 30).map(PortWithRole("role", _))
      )
    }
  }
}


text:
package com.timetable.allforme3.timetable;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.Toast;
import android.widget.ToggleButton;
import android.os.Bundle;

/**
 * Created by allforme3 on 15/02/2015.
 */
public class About extends Fragment {

    private NavigationDrawerFragment.NavigationDrawerCallbacks mCallbacks;
    View rootview;
    public boolean setup;

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        rootview = inflater.inflate(R.layout.about, container, false);
        return rootview;

    }
}

    /*
               public void addMainButtonListener() {
                    ToggleButton toggle = (ToggleButton) rootview.findViewById(R.id.toggleButton);
                    toggle.setOnCheckedChangeListener(new ToggleButton.OnCheckedChangeListener() {
                        public void onCheckedChanged(ToggleButton buttonView, boolean isChecked) {
                            if (isChecked) {
                                LinearLayout layout =(LinearLayout) rootview.findViewById(R.id.about_page);
                                layout.setBackground(getResources().getDrawable(R.drawable.allan));
                                Toast.makeText(getActivity(),"Look at that face!",Toast.LENGTH_SHORT);
                                mCallbacks.onNavigationDrawerItemSelected(5);
                            } else {
                                LinearLayout layout =(LinearLayout) rootview.findViewById(R.id.about_page);
                                layout.setBackgroundColor(android.R.color.white);
                                mCallbacks.onNavigationDrawerItemSelected(5);

                            }
                        }
                    });
                }

} */


text:
import java.util.*;
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import java.awt.event.*;

public abstract class ListeningGameComponent extends GameComponent implements MouseListener, MouseMotionListener, KeyListener
{
	public boolean mousePressed1 = false, mousePressed2 = false, mousePressed3 = false;
	public ArrayList<String> keysPressed = new ArrayList();
	public boolean debug = false;

	/**
	 * The x location of the mouse.
	 */
	public int mouseX = 0;
	/**
	 * The y location of the mouse.
	 */
	public int mouseY = 0;

	/**
	 * Constructs a ListeningGameComponent with a width of w, and a height of h.
	 *
	 * @param  w  width
	 * @param  h  height
	 * @see         JPanel
	 */
	public ListeningGameComponent(int w, int h)
	{
		super(w,h);
		addMouseListener(this);
		addMouseMotionListener(this);
		addKeyListener(this);
	}

	/**
	 * The method that draws the component.
	 *
	 * @param	g 	the {@link Graphics} on which the component will be drawn
	 */
	public abstract void draw(Graphics g);

	/**
	 * The method that updates the component.
	 */
	public abstract void update();

	/**
	 * Does nothing. Activated when the mouse is pressed and released.
	 * @param	e	a mouse event
	 */
	public void mouseClicked(MouseEvent e){}

	/**
	 * Does nothing. Activated when the mouse enters the component.
	 * @param	e	a mouse event
	 */
	public void mouseEntered(MouseEvent e){}

	/**
	 * Does nothing. Activated when the mouse exits the component.
	 * @param	e	a mouse event
	 */
	public void mouseExited(MouseEvent e){}

	/**
	 * Updates the mouse variables.
	 * @param	e	a mouse event
	 */
	public void mousePressed(MouseEvent e)
	{
		if(e.getButton() == e.BUTTON1)
			mousePressed1 = true;
		if(e.getButton() == e.BUTTON2)
			mousePressed2 = true;
		if(e.getButton() == e.BUTTON3)
			mousePressed3 = true;
	}

	/**
	 * Updates the mouse variables.
	 * @param	e	a mouse event
	 */
	public void mouseReleased(MouseEvent e)
	{
		if(e.getButton() == e.BUTTON1)
			mousePressed1 = false;
		if(e.getButton() == e.BUTTON2)
			mousePressed2 = false;
		if(e.getButton() == e.BUTTON3)
			mousePressed3 = false;
	}

	/**
	 * Updates the mouse variables.
	 * @param	e	a mouse event
	 */
	public void mouseDragged(MouseEvent e)
	{
		if(e.getButton() == e.BUTTON1)
			mousePressed1 = !mousePressed1;
		if(e.getButton() == e.BUTTON2)
			mousePressed2 = !mousePressed2;
		if(e.getButton() == e.BUTTON3)
			mousePressed3 = !mousePressed3;
		mouseX = e.getX();
		mouseY = e.getY();
	}

	/**
	 * Updates the mouse variables.
	 * @param	e	a mouse event
	 */
	public void mouseMoved(MouseEvent e)
	{
		mousePressed1 = false;
		mousePressed2 = false;
		mousePressed3 = false;

		mouseX = e.getX();
		mouseY = e.getY();
	}

	/**
	 * Updates the keyboard variables.
	 * @param	e	a key event
	 */
	public void keyPressed(KeyEvent e)
	{
		if(debug)
			System.out.println(e.getKeyText(e.getKeyCode()));
		keysPressed.add(e.getKeyText(e.getKeyCode()));
	}

	/**
	 * Updates the keyboard variables.
	 * @param	e	a key event
	 */
	public void keyReleased(KeyEvent e)
	{
		for(int i = 0; i < keysPressed.size(); i++)
		{
			if(keysPressed.get(i).equals(e.getKeyText(e.getKeyCode())))
			{
				keysPressed.remove(i);
				i--;
			}
		}
	}

	/**
	 * Updates the keyboard variables.
	 * @param	e	a key event
	 */
	public void keyTyped(KeyEvent e){}

	/**
	 * Returns weather a mouse button is pressed.
	 * @param	b	button number
	 * @return	true if the button is pressed
	 */
	public boolean isMousePressed(int b)
	{
		if(b == 1)
			return mousePressed1;
		else if(b == 2)
			return mousePressed2;
		else if(b == 3)
			return mousePressed3;

		return false;
	}

	/**
	 * Returns weather any mouse button is pressed.
	 * @return	true if the button is pressed
	 */
	public boolean isMousePressed()
	{
		if(mousePressed1)
			return mousePressed1;
		else if(mousePressed2)
			return mousePressed2;
		else if(mousePressed3)
			return mousePressed3;

		return false;
	}

	/**
	 * Returns weather a mouse button is pressed.
	 * @param	k	the key pressed (Ex. "A", "B", "C"...")
	 * @return	true if the key is pressed
	 */
	public boolean isKeyPressed(String k)
	{
		for(int i = 0; i < keysPressed.size(); i++)
		{
			if(keysPressed.get(i).equalsIgnoreCase(k))
			{
				return true;
			}
		}
		return false;
	}

	//returns the number of keys pressed.
	public int getKeysPressed()
	{
		return keysPressed.size();
	}

	public void resetKeys()
	{
		keysPressed = new ArrayList();
	}
}


text:
module PageObject
  module Elements
    class CheckBox < Element

    end

    ::PageObject::Elements.type_to_class[:checkbox] = ::PageObject::Elements::CheckBox
  end
end


text:
from itertools import permutations
from math import factorial

n = 5
seq = range(1, n+1)

print factorial(n)

for perm in permutations(seq):
    print " ".join(map(str, perm))


text:
<?php

namespace PHPoole\Collection\Menu;

use PHPoole\Collection\Collection as PHPooleCollection;
use PHPoole\Collection\ItemInterface;

/**
 * Class Menu.
 */
class Menu extends PHPooleCollection implements ItemInterface
{
    /**
     * Add menu entry.
     * {@inheritdoc}
     */
    public function add(ItemInterface $item)
    {
        $this->items[$item->getId()] = $item;

        return $this;
    }
}


text:
void thearchive_generate_scraper_requests(const ScraperSearchParams& params, std::queue< std::unique_ptr<ScraperRequest> >& requests,
	std::vector<ScraperSearchResult>& results);

void thearchive_process_httpreq(const std::unique_ptr<HttpReq>& req, std::vector<ScraperSearchResult>& results);

class TheArchiveRequest : public ScraperHttpRequest
{
public:
	TheArchiveRequest(std::vector<ScraperSearchResult>& resultsWrite, const std::string& url) : ScraperHttpRequest(resultsWrite, url) {}
protected:
	void process(const std::unique_ptr<HttpReq>& req, std::vector<ScraperSearchResult>& results) override;
};


text:
declare namespace MusicKit {
    /**
     * @todo add types for Apple Music API Objects
     */
    interface Resource {
        attributes: {
            albumName: string;
            artistName: string;
            durationInMillis: number;
            name: string;
        };
    }
    type AddToLibraryParameters = any;
    type QueryParameters = Record<string, any>;

    /**
     * An object that represents artwork.
     */
    interface Artwork {
        bgColor: string;
        height: number;
        width: number;
        textColor1: string;
        textColor2: string;
        textColor3: string;
        textColor4: string;
        url: string;
    }

    /**
     * This class represents the Apple Music API.
     */
    interface API {
        /**
         * An instance of the Cloud library.
         */
        library: Library;
        /**
         * The storefront used for making calls to the API.
         */
        storefrontId: string;
        /**
         * Fetch one or more activities using their identifiers.
         *
         * @param ids An array of activity identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        activities(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch an activity using its identifier.
         *
         * @param id An activity identifier.
         * @param parameters A query params object that is serialized and passed
         * directly to the Apple Music API.
         */
        activity(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Add a catalog resource to a user's library.
         */
        addToLibrary(parameters?: AddToLibraryParameters): Promise<void>;
        /**
         * Fetch an album using its identifier.
         *
         * @param id An album identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        album(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more albums using their identifiers.
         *
         * @param ids An array of album identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        albums(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch an Apple curator using its identifier.
         *
         * @param id An Apple curator identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        appleCurator(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more Apple curators using their identifiers.
         *
         * @param ids An array of Apple curator identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        appleCurators(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch an artist using its identifier.
         *
         * @param id An artist identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        artist(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more artists using their identifiers.
         *
         * @param ids An array of artist identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        artists(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch one or more charts.
         *
         * @param types An array of chart types.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        charts(types: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a curator using its identifier.
         *
         * @param id A curator identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        curator(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more curators using their identifiers.
         *
         * @param ids An array of curator identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        curators(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a genre using its identifier.
         *
         * @param id An array of
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        genre(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more genres using their identifiers.
         *
         * @param ids An array of genre identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        genres(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch the resources in heavy rotation for the user.
         *
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        historyHeavyRotation(parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a music video using its identifier.
         *
         * @param id An array of video identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        musicVideo(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more music videos using their identifiers.
         *
         * @param ids An array of music video identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        musicVideos(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a playlist using its identifier.
         *
         * @param id A playlist identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        playlist(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more playlists using their identifiers.
         *
         * @param ids An array of playlist identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        playlists(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch the recently played resources for the user.
         *
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        recentPlayed(parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a recommendation using its identifier.
         *
         * @param id A recommendation identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        recommendation(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more recommendations using their identifiers.
         *
         * @param ids An array of recommendation identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        recommendations(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Search the catalog using a query.
         *
         * @param term The term to search.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        search(term: string, parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch the search term results for a hint.
         *
         * @param term The term to search.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        searchHints(term: string, parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a song using its identifier.
         *
         * @param ids An array of identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        song(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more songs using their identifiers.
         *
         * @param ids An array of song identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        songs(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a station using its identifier.
         *
         * @param id A station identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        station(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more stations using their identifiers.
         *
         * @param ids An array of station identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        stations(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
        /**
         * Fetch a storefront using its identifier.
         *
         * @param id A storefront identifier.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        storefront(id: string, parameters?: QueryParameters): Promise<Resource>;
        /**
         * Fetch one or more storefronts using their identifiers.
         *
         * @param ids An array of storefront identifiers.
         * @param parameters A query parameters object that is serialized and passed
         * directly to the Apple Music API.
         */
        storefronts(ids: string[], parameters?: QueryParameters): Promise<Resource[]>;
    }
}


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [puppeteer](./puppeteer.md) > [Protocol](./puppeteer.protocol.md) > [Network](./puppeteer.protocol.network.md) > [RequestPattern](./puppeteer.protocol.network.requestpattern.md) > [resourceType](./puppeteer.protocol.network.requestpattern.resourcetype.md)

## Protocol.Network.RequestPattern.resourceType property

If set, only requests for matching resource types will be intercepted.

<b>Signature:</b>

```typescript
resourceType?: ResourceType;
```