text:
.class Lcom/android/systemui/globalactions/GlobalActionsDialog$30$1;
.super Ljava/lang/Object;
.source "GlobalActionsDialog.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/systemui/globalactions/GlobalActionsDialog$30;->onPress()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$1:Lcom/android/systemui/globalactions/GlobalActionsDialog$30;

# direct methods
.method constructor <init>(Lcom/android/systemui/globalactions/GlobalActionsDialog$30;)V
    .locals 0

    iput-object p1, p0, Lcom/android/systemui/globalactions/GlobalActionsDialog$30$1;->this$1:Lcom/android/systemui/globalactions/GlobalActionsDialog$30;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 6

    const/high16 v5, 0x14000000

    iget-object v2, p0, Lcom/android/systemui/globalactions/GlobalActionsDialog$30$1;->this$1:Lcom/android/systemui/globalactions/GlobalActionsDialog$30;

    iget-object v2, v2, Lcom/android/systemui/globalactions/GlobalActionsDialog$30;->this$0:Lcom/android/systemui/globalactions/GlobalActionsDialog;

    invoke-static {v2}, Lcom/android/systemui/globalactions/GlobalActionsDialog;->-get12(Lcom/android/systemui/globalactions/GlobalActionsDialog;)Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string/jumbo v3, "isBikeMode"

    const/4 v4, 0x0

    invoke-static {v2, v3, v4}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v2

    const/4 v3, 0x1

    if-ne v2, v3, :cond_0

    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    new-instance v2, Landroid/content/ComponentName;

    const-string/jumbo v3, "com.samsung.android.app.bikemode"

    const-string/jumbo v4, "com.samsung.android.app.bikemodeBMActivities.BMONUnpinnedScreen"

    invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    const-string/jumbo v2, "com.samsung.android.app.bikemode.ACTION_CLOSE_APP"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    invoke-virtual {v0, v5}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    iget-object v2, p0, Lcom/android/systemui/globalactions/GlobalActionsDialog$30$1;->this$1:Lcom/android/systemui/globalactions/GlobalActionsDialog$30;

    iget-object v2, v2, Lcom/android/systemui/globalactions/GlobalActionsDialog$30;->this$0:Lcom/android/systemui/globalactions/GlobalActionsDialog;

    invoke-static {v2}, Lcom/android/systemui/globalactions/GlobalActionsDialog;->-get12(Lcom/android/systemui/globalactions/GlobalActionsDialog;)Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    :goto_0
    return-void

    :cond_0
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    new-instance v2, Landroid/content/ComponentName;

    const-string/jumbo v3, "com.samsung.android.app.bikemode"

    const-string/jumbo v4, "com.samsung.android.app.bikemode.BMActivities.BMSplashScreen"

    invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    invoke-virtual {v1, v5}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    iget-object v2, p0, Lcom/android/systemui/globalactions/GlobalActionsDialog$30$1;->this$1:Lcom/android/systemui/globalactions/GlobalActionsDialog$30;

    iget-object v2, v2, Lcom/android/systemui/globalactions/GlobalActionsDialog$30;->this$0:Lcom/android/systemui/globalactions/GlobalActionsDialog;

    invoke-static {v2}, Lcom/android/systemui/globalactions/GlobalActionsDialog;->-get12(Lcom/android/systemui/globalactions/GlobalActionsDialog;)Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto :goto_0
.end method


text:
using System.Collections.Generic;
using Revida.Sitecore.Assurance.Model;

namespace Revida.Sitecore.Services.Client
{
    public interface ISitecoreServiceClient
    {
        List<SitecoreItem> GetSitecoreCmsTreeUrls();

        bool Login();

        bool Logout();
    }
}

redpajama_set_name: RedPajamaGithub


text:
This is an optional module for enabling automatic scan-to-buy actions from amazon.com.

This code depends on the [python-amazon-product-api](https://bitbucket.org/basti/python-amazon-product-api/wiki/Home) which can be installed using pip:

```sh
sudo pip install python-amazon-product-api
```


text:
namespace Microsoft.SqlServer.Server
{
    internal enum ExtendedClrTypeCode
    {
        Invalid = -1,
        Boolean,                    // System.Boolean
        Byte,                       // System.Byte
        Char,                       // System.Char
        DateTime,                   // System.DateTime
        DBNull,                     // System.DBNull
        Decimal,                    // System.Decimal
        Double,                     // System.Double
        Empty,                      // null reference
        Int16,                      // System.Int16
        Int32,                      // System.Int32
        Int64,                      // System.Int64
        SByte,                      // System.SByte
        Single,                     // System.Single
        String,                     // System.String
        UInt16,                     // System.UInt16
        UInt32,                     // System.UInt32
        UInt64,                     // System.UInt64
        Object,                     // System.Object
        ByteArray,                  // System.ByteArray
        CharArray,                  // System.CharArray
        Guid,                       // System.Guid
        SqlBinary,                  // System.Data.SqlTypes.SqlBinary
        SqlBoolean,                 // System.Data.SqlTypes.SqlBoolean
        SqlByte,                    // System.Data.SqlTypes.SqlByte
        SqlDateTime,                // System.Data.SqlTypes.SqlDateTime
        SqlDouble,                  // System.Data.SqlTypes.SqlDouble
        SqlGuid,                    // System.Data.SqlTypes.SqlGuid
        SqlInt16,                   // System.Data.SqlTypes.SqlInt16
        SqlInt32,                   // System.Data.SqlTypes.SqlInt32
        SqlInt64,                   // System.Data.SqlTypes.SqlInt64
        SqlMoney,                   // System.Data.SqlTypes.SqlMoney
        SqlDecimal,                 // System.Data.SqlTypes.SqlDecimal
        SqlSingle,                  // System.Data.SqlTypes.SqlSingle
        SqlString,                  // System.Data.SqlTypes.SqlString
        SqlChars,                   // System.Data.SqlTypes.SqlChars
        SqlBytes,                   // System.Data.SqlTypes.SqlBytes
        SqlXml,                     // System.Data.SqlTypes.SqlXml
        DataTable,                  // System.Data.DataTable
        DbDataReader,               // System.Data.DbDataReader (SqlDataReader falls under this category)
        IEnumerableOfSqlDataRecord, // System.Collections.Generic.IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord>
        TimeSpan,                   // System.TimeSpan
        DateTimeOffset,             // System.DateTimeOffset
        Stream,                     // System.IO.Stream
        TextReader,                 // System.IO.TextReader
        XmlReader,                  // System.Xml.XmlReader
        Last = XmlReader,           // end-of-enum marker
        First = Boolean,            // beginning-of-enum marker
    };
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/SharedPreferencesLecture8.iml" filepath="$PROJECT_DIR$/SharedPreferencesLecture8.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
    </modules>
  </component>
</project>


text:
(function ( jQuery ) {

	function vc_viewport_video()
	{
		jQuery('.enable-on-viewport').each(function(index, element) {
            var is_on_viewport = jQuery(this).isVdoOnScreen();
			if(jQuery(this).hasClass('hosted-video') && (!jQuery(this).hasClass('override-controls')))
			{
				if(is_on_viewport)
				{
					jQuery(this)[0].play();
					jQuery(this).parent().parent().parent().find('.video-controls').attr('data-action','play');
					jQuery(this).parent().parent().parent().find('.video-controls').html('');
				}
				else
				{
					jQuery(this)[0].pause();
					jQuery(this).parent().parent().parent().find('.video-controls').attr('data-action','pause');
					jQuery(this).parent().parent().parent().find('.video-controls').html('');
				}
			}
        });
	}

	jQuery(window).scroll(function(){
		vc_viewport_video();
	});

	jQuery.fn.isVdoOnScreen = function(){
		var win =jQuery(window);

		var viewport = {
			top : win.scrollTop(),
			left : win.scrollLeft()
		};
		viewport.right = viewport.left + win.width();
		viewport.bottom = viewport.top + win.height()-200;

		var bounds = this.offset();
		bounds.right = bounds.left + this.outerWidth();
		bounds.bottom = bounds.top + this.outerHeight()-300;

		return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
	};

	jQuery.fn.ultimate_video_bg = function(option) {
		jQuery(this).each(function(){
			var selector =jQuery(this);
			var vdo = selector.data('ultimate-video');
			var vdo2 = selector.data('ultimate-video2');
			var muted =selector.data('ultimate-video-muted');
			var loop =selector.data('ultimate-video-loop');
			var autoplay =selector.data('ultimate-video-autoplay');
			var poster =selector.data('ultimate-video-poster');
			var ride = selector.data('bg-override');
			var start = selector.data('start-time');
			var stop = selector.data('stop-time');
			var anim_style= selector.data('upb-bg-animation');
			var overlay_color = selector.data('upb-overlay-color');
			var viewport_vdo = selector.data('viewport-video');
			var controls = selector.data('controls');
			var controls_color = selector.data('controls-color');
			var fadeout = selector.data('fadeout');
			var fadeout_percentage = selector.data('fadeout-percentage');
			var parallax_content = selector.data('parallax-content');
			var parallax_content_sense = selector.data('parallax-content-sense');
			var disble_mobile = selector.data('row-effect-mobile-disable');

			if( overlay_color != ''){
				overlay_color = '

';
			}
			if(stop!=0){
				stop = stop;
			}else{
				stop ='';
			}
			var parent = selector.prev();
			selector.remove();
			selector = parent;

			var vd_html = selector.html();
			selector.addClass('upb_video_class');
			selector.attr('data-row-effect-mobile-disable',disble_mobile);
			if(fadeout == 'fadeout_row_value')
			{
				selector.addClass('vc-row-fade');
				selector.data('fadeout-percentage',fadeout_percentage);
			}
			if(parallax_content == 'parallax_content_value')
			{
				selector.addClass('vc-row-translate');
				selector.attr('data-parallax-content-sense', parallax_content_sense);
			}
			selector.attr('data-upb_br_animation',anim_style);
			if(vdo){
				if(vdo.indexOf('youtube.com')!=-1){
					option='youtube';
				}
				else if (vdo.indexOf('vimeo.com')!=-1){
					option='vimeo'
				}
			}

			var control_html = '';
			if(controls == 'display_control'){
				control_html = '';
			}

			if(option=='youtube' || option=='vimeo'){
				selector.html('

');
			}else{
				selector.html('

<video class="upb_video-src"></video>'+control_html+overlay_color+'

');
			}

			selector.find('.upb_video-text').html(vd_html);
			if(option=='youtube'){
				vdo = vdo.substring((vdo.indexOf('watch?v='))+8,(vdo.indexOf('watch?v='))+19);
				var content = selector.find('.upb_video-bg');
				if(loop=='loop') loop=true;
				if(muted=='muted') muted=true;
				content.attr('data-vdo',vdo);content.attr('data-loop',loop);content.attr('data-poster',poster);
				content.attr('data-muted',muted);content.attr('data-start',start);content.attr('data-stop',stop);

				if(viewport_vdo === true)
				{
					content.addClass('enable-on-viewport');
					content.addClass('youtube-video');
					vc_viewport_video();
				}
			}else if(option=='vimeo'){
				vdo = vdo.substring((vdo.indexOf('vimeo.com/'))+10,(vdo.indexOf('vimeo.com/'))+18);
				var content = selector.find('.upb_video-bg');
				content.html('')
			}
			else{
				var content = selector.find('.upb_video-src');

				if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
				{
					jQuery('<source/>', {
						type: 'video/mp4',
						src: vdo
					}).appendTo(content);
					if(vdo2 != '')
					{
						var vdo2_type = '';
						if(vdo2.match(/.ogg/i))
							vdo2_type = 'video/ogg';
						else if(vdo2.match(/.webm/i))
							vdo2_type = 'video/webm';
						if(vdo2_type != '')
						{
							jQuery('<source/>', {
								type: vdo2_type,
								src: vdo2
							}).appendTo(content);
						}
					}

					if(muted=='muted'){ content.attr({'muted':muted}); }
					if(loop=='loop'){ content.attr({'loop':loop}); }
					if(poster){ content.attr({'poster':poster}); }
					content.attr({'preload':'auto'});
					if(viewport_vdo === true)
					{
						content.addClass('enable-on-viewport');
						content.addClass('hosted-video');
						vc_viewport_video();
					}
					else
					{
						if(autoplay=='autoplay'){ content.attr({'autoplay':autoplay}); }
					}
				}
				else
				{
					if(poster != '')
						content.parent().css({'background-image':'url('+poster+')'});
					content.remove();
				}
			}
			var resizee = function(){
				var w,h,ancenstor,al='',bl='';
				ancenstor = selector;
				selector = selector.find('.upb_video-bg');
				if(ride=='full'){
					ancenstor= jQuery('body');
				}
				if(ride=='ex-full'){
					ancenstor= jQuery('html');
				}
				if( ! isNaN(ride)){
					for(var i=0;i<ride;i++){
						if(ancenstor.prop("tagName")!='HTML'){
							ancenstor = ancenstor.parent();
						}else{
							break;
						}
					}
				}
				h = selector.parents('upb_video_class').outerHeight();
				w = ancenstor.outerWidth();
				if(ride=='browser_size'){
					h = jQuery(window).height();
					w = jQuery(window).width();
					ancenstor.css('min-height',h+'px');
				}
				selector.css({'min-height':h+'px','min-width':w+'px'});
				if(ancenstor.offset()){
					al = ancenstor.offset().left;
					if(selector.offset()){
						bl = selector.offset().left;
					}
				}
			 	var width =w,
	            pWidth, // player width, to be defined
	            //height = selector.height(),
	            height = h,
	            pHeight, // player height, tbd
	        	vimeovideoplayer = selector.find('.upb_vimeo_iframe');
	        	youvideoplayer = selector.find('.upb_utube_iframe');
	        	embeddedvideoplayer = selector.find('.upb_video-src');
	        	var ratio =(16/9);
		        if(vimeovideoplayer){
			        if (width / ratio < height) { // if new video height < window height (gap underneath)
		                pWidth = Math.ceil(height * ratio); // get new player width
		                vimeovideoplayer.width(pWidth).height(height).css({left: (width - pWidth) / 2, top: 0}); // player width is greater, offset left; reset top
		            } else { // new video width < window width (gap to right)
		                pHeight = Math.ceil(width / ratio); // get new player height
		                vimeovideoplayer.width(width).height(pHeight).css({left: 0, top: (height - pHeight) / 2}); // player height is greater, offset top; reset left
		            }
		        }
		        if(embeddedvideoplayer){
			        if (width / (16/9) < height) {
			            pWidth = Math.ceil(height * (16/9));
			            embeddedvideoplayer.width(pWidth).height(height).css({left: (width - pWidth) / 2, top: 0});
			        } else {
			            pHeight = Math.ceil(width / (16/9));
			            //youvideoplayer.width(width).height(pHeight).css({left: 0, top: (height - pHeight) / 2});
			            embeddedvideoplayer.width(width).height(pHeight).css({left: 0, top: 0});
			        }
		        }
		    }
		    resizee();
			jQuery(window).load(function(){
		    	resizee();
		    });
		    jQuery(window).resize(function(){
		    	resizee();
		    });
		})
		return this;
	}

	jQuery.fn.ultimate_bg_shift = function() {
		jQuery(this).each(function(){
			var selector =jQuery(this);
			var bg = selector.data('ultimate-bg');   // dep in vc v4.1
			var style = selector.data('ultimate-bg-style');
			var bg_color = selector.prev().css('background-color');
			var rep = selector.data('bg-img-repeat');
			var size = selector.data('bg-img-size');
			var pos = selector.data('bg-img-position');
			var sense = selector.data('parallx_sense');
			var ride = selector.data('bg-override');
			var attach = selector.data('bg_img_attach');
			var anim_style= selector.data('upb-bg-animation');
			var al,bl,overlay_color='';
			var overlay_color = selector.data('upb-overlay-color');
			var fadeout = selector.data('fadeout');
			var fadeout_percentage = selector.data('fadeout-percentage');
			var parallax_content = selector.data('parallax-content');
			var parallax_content_sense = selector.data('parallax-content-sense');
			var animation = selector.data('bg-animation');
			var animation_type = selector.data('bg-animation-type');
			var animation_repeat = selector.data('animation-repeat');
			var disble_mobile = selector.data('row-effect-mobile-disable');
			var disble_mobile_img_parallax = selector.data('img-parallax-mobile-disable');

			if(overlay_color!=''){
				//overlay_color = '

';
			}

			var parent = selector.prev();
			var last_html = parent.html();

			if(ride == "browser_size")
			{
				parent.html('');
				var brw_text_wrapper = '

';
			}
			else
				var brw_text_wrapper = '';

			parent.prepend('
'+overlay_color+'
'+brw_text_wrapper);

			selector.remove();
			selector = parent;

			if(ride == "browser_size")
			{
				selector.find('.upb-background-text').html(last_html);
				selector.addClass('full-browser-size');
			}

			selector.attr('data-row-effect-mobile-disable',disble_mobile);
			selector.attr('data-img-parallax-mobile-disable',disble_mobile_img_parallax);
			if(fadeout == 'fadeout_row_value')
			{
				selector.addClass('vc-row-fade');
				selector.data('fadeout-percentage',fadeout_percentage);
			}
			if(parallax_content == 'parallax_content_value')
			{
				selector.addClass('vc-row-translate');
				selector.attr('data-parallax-content-sense', parallax_content_sense);
			}

			selector.css('background-image','');
			selector = selector.find('.upb_row_bg');

			selector.attr('data-upb_br_animation',anim_style);
			if(size!='automatic'){
				selector.css({'background-size':size});
			}
			else{
				selector.addClass('upb_bg_size_automatic');
			}
			selector.css({'background-repeat':rep,'background-position':pos,'background-color':bg_color});
			if(style=='vcpb-fs-jquery' || style=='vcpb-mlvp-jquery'){
				selector.attr('data-img-array',bg);
			}
			else{
				selector.css({'background-image':bg,'background-attachment':attach});
			}
			selector.attr('data-parallax_sense',sense);
			selector.attr('data-bg-override',ride);
			selector.attr('data-bg-animation',animation);
			selector.attr('data-bg-animation-type',animation_type);
			selector.attr('data-animation-repeat',animation_repeat);

			selector.addClass(style);
			var resize = function(){
				var w,h,ancenstor,al,bl;
				ancenstor = selector.parent();
				if(ride=='full'){
					ancenstor= jQuery('body');
					al=0;
				}
				if(ride=='ex-full'){
					ancenstor= jQuery('html');
					al=0;
				}
				if( ! isNaN(ride)){
					for(var i=0;i<ride;i++){
						if(ancenstor.prop("tagName")!='HTML'){
							ancenstor = ancenstor.parent();
						}else{
							break;
						}
					}
					al = ancenstor.offset().left;
				}
				h = selector.parent().outerHeight();
				w = ancenstor.outerWidth();
				selector.css({'min-height':h+'px','min-width':w+'px'});
				bl = selector.offset().left;
				selector.css({'left':-(Math.abs(al-bl))+'px'});
				if(ride=='browser_size'){
					selector.parent().css('min-height',jQuery(window).height()+'px');
				}
			}
			resize();
			jQuery(window).load(function(){
				resize();
			});
			jQuery(window).resize(function(){
				resize();
			});
		})
		return this;
	}
	jQuery.fn.ultimate_grad_shift = function() {
		jQuery(this).each(function(){
			var selector =jQuery(this);
			var grad = selector.data('grad');
			var parent = selector.prev();
			var last_html = parent.html();
			var ride = jQuery(this).data('bg-override');
			var overlay_color = selector.data('upb-overlay-color');
			var anim_style= selector.data('upb-bg-animation');
			var fadeout = selector.data('fadeout');
			var fadeout_percentage = selector.data('fadeout-percentage');
			var parallax_content = selector.data('parallax-content');
			var parallax_content_sense = selector.data('parallax-content-sense');
			var disble_mobile = selector.data('row-effect-mobile-disable');

			if(overlay_color!=''){
				overlay_color = '

';
			}
			if(ride == "browser_size")
			{
				parent.html('');
				var brw_text_wrapper = '

';
			}
			else
				var brw_text_wrapper = '';
			parent.prepend('
'+overlay_color+'
'+brw_text_wrapper);
			selector.remove();
			selector = parent;
			selector.attr('data-row-effect-mobile-disable',disble_mobile);
			if(fadeout == 'fadeout_row_value')
			{
				selector.addClass('vc-row-fade');
				selector.data('fadeout-percentage',fadeout_percentage);
			}
			if(parallax_content == 'parallax_content_value')
			{
				selector.addClass('vc-row-translate');
				selector.attr('data-parallax-content-sense', parallax_content_sense);
			}
			if(ride == "browser_size")
			{
				selector.find('.upb-background-text').html(last_html);
				selector.addClass('full-browser-size');
			}
			selector.css('background-image','');
			selector = selector.find('.upb_row_bg');
			selector.attr('data-upb_br_animation',anim_style);
			grad = grad.replace('url(data:image/svg+xml;base64,','');
	    	var e_pos = grad.indexOf(';');
	    	grad = grad.substring(e_pos+1);
			selector.attr('style',grad);
			selector.attr('data-bg-override',ride);
			if(ride == 'browser_size')
				selector.parent().find('.upb-background-text-wrapper').addClass('full-browser-size');
		})
		return this;
	}
	jQuery.fn.ultimate_bg_color_shift = function() {
		jQuery(this).each(function(){
			var selector = jQuery(this);
			var parent = selector.prev();
			var last_html = parent.html();
			var ride = jQuery(this).data('bg-override');
			var bg_color = jQuery(this).data('bg-color');
			var fadeout = selector.data('fadeout');
			var fadeout_percentage = selector.data('fadeout-percentage');
			var parallax_content = selector.data('parallax-content');
			var parallax_content_sense = selector.data('parallax-content-sense');
			var disble_mobile = selector.data('row-effect-mobile-disable');

			if(ride == "browser_size")
			{
				parent.html('');
				var brw_text_wrapper = '

';
			}
			else
				var brw_text_wrapper = '';
			parent.prepend('

'+brw_text_wrapper);
			selector.remove();
			selector = parent;
			selector.attr('data-row-effect-mobile-disable',disble_mobile);
			if(fadeout == 'fadeout_row_value')
			{
				selector.addClass('vc-row-fade');
				selector.data('fadeout-percentage',fadeout_percentage);
			}
			if(parallax_content == 'parallax_content_value')
			{
				selector.addClass('vc-row-translate');
				selector.attr('data-parallax-content-sense', parallax_content_sense);
			}
			if(ride == "browser_size")
				selector.find('.upb-background-text').html(last_html);
			selector.css('background-image','');
			selector = selector.find('.upb_row_bg');
			selector.css({'background':bg_color});
			selector.attr('data-bg-override',ride);
			if(ride == 'browser_size')
				selector.parent().find('.upb-background-text-wrapper').addClass('full-browser-size');
		})
		return this;
	}
	jQuery.fn.ultimate_parallax_animation = function(applyTo) {
		var windowHeight = jQuery(window).height();
		var getHeight = function(obj) {
				return obj.height();
			};
		var $this = jQuery(this);
		var prev_pos = jQuery(window).scrollTop();
		function updata(){
			var firstTop;
			var paddingTop = 0;
			var pos = jQuery(window).scrollTop();
			$this.each(function(){
				if(jQuery(this).data('upb_br_animation')=='upb_fade_animation'){
					firstTop = jQuery(this).offset().top;
					var $element = jQuery(this);
					var top = $element.offset().top;
					var height = getHeight($element);
					if (top + height < pos || top > pos + windowHeight-100) {
						return;
					}
					var pos_change = prev_pos-pos;
					if ((top+height)-windowHeight < pos) {
						var op_c = (pos_change/windowHeight);
						if(applyTo=='parent'){
							var op = parseInt(jQuery(this).css('opacity'));
							op += op_c/2.3;
							jQuery(this).parents('.wpb_row').css({opacity :op})
						}
						if(applyTo=='self'){
							var op = parseInt(jQuery(this).css('opacity'));
							op += op_c/2.3;
							jQuery(this).css({opacity :op})
						}
					}
					prev_pos = pos;
				}
			});
		}
		jQuery(window).bind('scroll', updata).resize(updata);
		updata();
	}
}( jQuery ));
 // Auto Initialization
 jQuery(document).ready(function(){

	 var temp_vdo_pos = 0;

	 	jQuery('.upb_content_video, .upb_content_iframe').prev().css('background-image','').css('background-repeat','');
		jQuery('.upb_content_video').ultimate_video_bg();
		jQuery('.upb_bg_img').ultimate_bg_shift();
		jQuery('.upb_content_iframe').ultimate_video_bg();
		jQuery('.upb_grad').ultimate_grad_shift();
		jQuery('.upb_color').ultimate_bg_color_shift();

		jQuery('.upb_no_bg').each(function(index, nobg) {
            var no_bg_fadeout = jQuery(nobg).attr('data-fadeout');
			var fadeout_percentage = jQuery(nobg).data('fadeout-percentage');
			var parallax_content = jQuery(nobg).data('parallax-content');
			var parallax_content_sense = jQuery(nobg).data('parallax-content-sense');

			var disble_mobile = jQuery(nobg).data('row-effect-mobile-disable');
			jQuery(nobg).prev().attr('row-effect-mobile-disable',disble_mobile);

			if(no_bg_fadeout == 'fadeout_row_value')
			{
				jQuery(nobg).prev().addClass('vc-row-fade');
				jQuery(nobg).prev().data('fadeout-percentage',fadeout_percentage);
			}
			if(parallax_content == 'parallax_content_value')
			{
				jQuery(nobg).prev().addClass('vc-row-translate');
				jQuery(nobg).prev().attr('data-parallax-content-sense', parallax_content_sense);
			}
        });
		jQuery('.upb_no_bg').remove();

		var resizees = function(){
	    	jQuery('.upb_row_bg').each(function() {
				var ride = jQuery(this).data('bg-override');
				var ancenstor,parent;
				parent = jQuery(this).parent();
				if(ride=='browser_size'){
					ancenstor=jQuery('html');
				}
				if(ride == 'ex-full'){
					ancenstor = jQuery('html');
				}
				else if(ride == 'full'){
					ancenstor = jQuery('body');
				}

				else if(! isNaN(ride)){
					ancenstor = parent;
					for ( var i = 0; i < ride; i++ ) {
						if ( ancenstor.is('html') ) {
							break;
						}
						ancenstor = ancenstor.parent();
					}
				}
				var al= parseInt( ancenstor.css('paddingLeft') );
				var ar= parseInt( ancenstor.css('paddingRight') )
				var w = al+ar + ancenstor.width();
				var bl = - ( parent.offset().left - ancenstor.offset().left );
				if ( bl > 0 ) {	left = 0; }
				jQuery(this).css({'width': w,'left': bl	})
				if(ride=='browser_size'){
					parent.css('min-height',jQuery(window).height()+'px');
					var rheight = jQuery(this);
					//console.log(jQuery(this).find('.upb-background-text-wrapper'));
					if(parent.find('.upb-background-text-wrapper').length > 0)
					{
						parent.find('.upb-background-text-wrapper').css('min-height',jQuery(window).height()+'px');
					}
				}
			});

			jQuery(window).load(function(){
				jQuery('.upb_video-bg').each(function(index,ele) {
					var ride = jQuery(this).data('bg-override');
					var ancenstor,parent;
					parent = jQuery(this).parents('.wpb_row');
					if(ride=='browser_size'){
						ancenstor=jQuery('html');
					}
					if(ride == 'ex-full'){
						ancenstor = jQuery('html');
						jQuery(this).parents('.upb_video_class').css('overflow','visible');
					}
					else if(ride == 'full'){
						ancenstor = jQuery('body');
						jQuery(this).parents('.upb_video_class').css('overflow','visible');
					}
					else if(! isNaN(ride)){
						ancenstor = parent;
						for ( var i = 1; i < ride; i++ ) {
							if ( ancenstor.is('html') ) {
								break;
							}
							ancenstor = ancenstor.parent();
						}
					}
					var al= parseInt( ancenstor.css('paddingLeft') );
					var ar= parseInt( ancenstor.css('paddingRight') );
					var vc_margin = parseInt( ancenstor.css('marginLeft') ); //vc row margin
					var w = ancenstor.outerWidth();
					var vdo_left = jQuery(this).offset().left;
					var vdo_left_pos = jQuery(this).position().left;
					var div_left = ancenstor.offset().left;
					var cal_left = div_left - vdo_left;
					if(vdo_left_pos < 0)
						cal_left = vdo_left_pos + cal_left;

					if(index == 0)
						temp_vdo_pos = vdo_left_pos;
					if(temp_vdo_pos > 0)
						cal_left = temp_vdo_pos;

					jQuery(this).css({'width': w,'min-width':w,'left': cal_left });
					var ratio =(16/9);
					pHeight = Math.ceil(w / ratio);
					children = jQuery(this).children();

					children.css({'width': w,'min-width':w});

					var is_poster = jQuery(this).css('background-image');

					if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
					{
						children.css({'height':pHeight});
						if(ride=='browser_size'){
							parent.addClass('video-browser-size');
							parent.css('min-height',jQuery(window).height()+'px');

							if(parent.find('.upb_video-text-wrapper').length > 0)
							{
								parent.find('.upb_video-text-wrapper').addClass('full-browser-size');
								parent.find('.upb_video-text-wrapper').css('min-height',jQuery(window).height()+'px');
							}
						}
					}
					else
					{
						if(typeof is_poster === 'undefined' || is_poster == 'none')
						{
							children.css({'max-height':'auto','height':'auto'});
							parent.css('min-height','auto');
						}
					}
				});
			});
		};
		resizees();
		//jQuery('.upb_video-bg').parents('.upb_video_class').css('overflow','visible');
		jQuery(window).load(function(){
			resizees();
		});
		jQuery(window).resize(function(){
			resizees();
		});

		jQuery('.video-controls').click(function(e) {
            var current_action = jQuery(this).attr('data-action');

			var vdo = jQuery(this).parent().find('.upb_video-src');
			if(current_action == 'pause')
			{
				jQuery(this).attr('data-action','play');
				vdo[0].play();
				jQuery(this).html('');
			}
			else
			{
				jQuery(this).attr('data-action','pause');
				vdo[0].pause();
				jQuery(this).html('');
			}

			if(vdo.hasClass('enable-on-viewport'))
			{
				vdo.addClass('override-controls');
			}
        });

		//row animation execution
		jQuery('.vcpb-animated').each(function(index, element) {
			var repeat = jQuery(element).data('animation-repeat');
			jQuery(this).css({'background-repeat':repeat});
			var mobile_disable = jQuery(element).parent().attr('data-img-parallax-mobile-disable');
			if(typeof mobile_disable == "undefined")
				mobile_disable = 'false';
			else
				mobile_disable = mobile_disable.toString();
			if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
				var is_mobile = 'false';
			else
				var is_mobile = 'true';
			if(is_mobile == 'true' && mobile_disable == 'true')
				var disable_row_effect = 'true';
			else
				var disable_row_effect = 'false';
			if(disable_row_effect == 'false')
			{
				var scrollSpeed = 10;
				if(jQuery(this).attr('data-parallax_sense') != '')
					scrollSpeed = jQuery(this).attr('data-parallax_sense');

				scrollSpeed = 100 - scrollSpeed;

				var animation_type = jQuery(this).attr('data-bg-animation-type');
				var animation = jQuery(this).attr('data-bg-animation');

				// set the default position
				var current = 0;
				// set the direction
				var direction = animation_type;
				//Calls the scrolling function repeatedly
				setInterval(function(e){
					if(animation == 'right-animation' || animation == 'bottom-animation')
						current -= 1;
					else
						current += 1;
					jQuery(element).css("backgroundPosition", (direction == 'h') ? current+"px 0" : "0 " + current+"px");
				}, scrollSpeed);
			}
        });
 });


text:
'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');
var less = require('gulp-less');
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var rename = require("gulp-rename");
var browserSync = require('browser-sync');

gulp.task('less', function() {
    gulp.src('assets/less/layout.less')
        .pipe(less().on('error', gutil.log))
        .pipe(autoprefixer({
            browsers: ['last 2 versions'],
            cascade: false
        }))
        .pipe(minifycss())
        .pipe(rename("app.min.css"))
        .pipe(gulp.dest('build/'))
        .pipe(browserSync.stream());
});


text:
@class PublicWifiApKeyInfo;

@protocol PublicWifiApInfoListViewControllerDelegate <NSObject>
- (void)onPublicWifiApInfoViewContorllerWillGoBack;
- (void)onPublicWifiApInfoSelected:(PublicWifiApKeyInfo *)arg1;
@end


text:
__author__ = 'fahadadeel'
import jpype
import os.path
from WorkingWithDocumentConversion import PdfToSvg

asposeapispath = os.path.join(os.path.abspath("../../../"), "lib")

print "You need to put your Aspose.Words for Java APIs .jars in this folder:\n"+asposeapispath

jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath)

testObject = PdfToSvg('data/')
testObject.main()


text:
package org.jf.smali;

import com.google.common.collect.*;
import com.google.common.primitives.*;

import org.jf.dexlib2.base.*;
import org.jf.dexlib2.iface.*;

import java.util.*;

import javax.annotation.*;

public class SmaliMethodParameter extends BaseMethodParameter implements WithRegister {
    public static final Comparator<WithRegister> COMPARATOR = (o1, o2) -> Ints.compare(o1.getRegister(), o2.getRegister());
    public final int register;
    @Nonnull
    public final String type;
    @Nonnull
    public Set<? extends Annotation> annotations;
    @Nullable
    public String name;

    public SmaliMethodParameter(int register, @Nonnull String type) {
        this.register = register;
        this.type = type;
        this.annotations = ImmutableSet.of();
    }

    @Override
    public int getRegister() {
        return register;
    }

    @Nonnull
    @Override
    public String getType() {
        return type;
    }

    @Nonnull
    @Override
    public Set<? extends Annotation> getAnnotations() {
        return annotations;
    }

    @Nullable
    @Override
    public String getName() {
        return name;
    }

    @Nullable
    @Override
    public String getSignature() {
        return null;
    }
}


text:
import { StyleSheet } from 'react-native';

const size = 100;
export default styles = StyleSheet.create({
  avatar: {
    width: size,
    height: size,
    borderRadius: size / 2,
    borderWidth: 3,
    borderColor: '#FFFFFF',
  },
});


text:
@class NSString, QBarCodeView, UILabel, UIView, WCCircularProgressView;

@interface WCPayOfflinePayCodeView : MMUIView <WCCircularProgressViewDelegate>
{
    double _secondsToRefresh;
    _Bool _inAnimation;
    _Bool _enable;
    int _payCodeStyle;
    NSString *_barCodeString;
    NSString *_qrCodeString;
    id <WCPayOfflinePayCodeViewDelegate> _delegate;
    QBarCodeView *_imageBarView;
    UILabel *_barCodeLabel;
    UIView *_barCodeBackGroundView;
    QBarCodeView *_imageQRView;
    UIView *_qRCodeBackGroundView;
    WCCircularProgressView *_progressView;
    UIView *_maskView;
}

+ (double)height;
+ (double)barCodeWidth;
+ (double)qrCodeWidth;
@property(retain, nonatomic) UIView *maskView; // @synthesize maskView=_maskView;
@property(retain, nonatomic) WCCircularProgressView *progressView; // @synthesize progressView=_progressView;
@property(retain, nonatomic) UIView *qRCodeBackGroundView; // @synthesize qRCodeBackGroundView=_qRCodeBackGroundView;
@property(retain, nonatomic) QBarCodeView *imageQRView; // @synthesize imageQRView=_imageQRView;
@property(retain, nonatomic) UIView *barCodeBackGroundView; // @synthesize barCodeBackGroundView=_barCodeBackGroundView;
@property(retain, nonatomic) UILabel *barCodeLabel; // @synthesize barCodeLabel=_barCodeLabel;
@property(retain, nonatomic) QBarCodeView *imageBarView; // @synthesize imageBarView=_imageBarView;
@property(nonatomic) __weak id <WCPayOfflinePayCodeViewDelegate> delegate; // @synthesize delegate=_delegate;
@property(copy, nonatomic) NSString *qrCodeString; // @synthesize qrCodeString=_qrCodeString;
@property(copy, nonatomic) NSString *barCodeString; // @synthesize barCodeString=_barCodeString;
@property(nonatomic) _Bool enable; // @synthesize enable=_enable;
@property(nonatomic) int payCodeStyle; // @synthesize payCodeStyle=_payCodeStyle;
- (void).cxx_destruct;
- (void)circularProgressViewDidTapped:(id)arg1;
- (void)exitFullScreenWithView:(id)arg1 animation:(_Bool)arg2;
- (void)codeViewTapped:(id)arg1;
- (void)exitFullScreenIfNeedAnimation:(_Bool)arg1;
- (void)updateCodeImage;
- (void)updateCodeImageWithPayCodeStyle:(int)arg1;
- (_Bool)inFullscreen;
- (void)triggerSuccessRefreshAnimation;
- (void)updateAutoRefreshCount;
- (void)cancelAutoRefreshCounting;
- (void)startAutoRefreshCountingAfterSeconds:(unsigned long long)arg1;
- (void)startAutoRefreshCounting;
- (void)resetViews;
- (void)dealloc;
- (void)setAlpha:(double)arg1;
- (void)adjustViews;
- (void)commonInit;
- (id)initWithFrame:(struct CGRect)arg1;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


text:
package com.haulmont.cuba.gui.components;

import javax.annotation.Nullable;

/**
 * Interface for UI components that provide additional objects for framework as part of component API.
 *
 * @see DataGrid
 * @see FieldGroup
 * @see ActionsHolder
 */
public interface HasSubParts {
    @Nullable
    Object getSubPart(String name);
}


text:
use crossbeam_channel::{Receiver, Sender};
use log::error;
use regex::Regex;

use super::*;

pub struct Collector {
	receiver: Receiver<traverser::Directory>,
	sender: Sender<inserter::Item>,
	album_art_pattern: Option<Regex>,
}

impl Collector {
	pub fn new(
		receiver: Receiver<traverser::Directory>,
		sender: Sender<inserter::Item>,
		album_art_pattern: Option<Regex>,
	) -> Self {
		Self {
			receiver,
			sender,
			album_art_pattern,
		}
	}

	pub fn collect(&self) {
		while let Ok(directory) = self.receiver.recv() {
			self.collect_directory(directory);
		}
	}

	fn collect_directory(&self, directory: traverser::Directory) {
		let mut directory_album = None;
		let mut directory_year = None;
		let mut directory_artist = None;
		let mut inconsistent_directory_album = false;
		let mut inconsistent_directory_year = false;
		let mut inconsistent_directory_artist = false;

		let directory_artwork = self.get_artwork(&directory);
		let directory_path_string = directory.path.to_string_lossy().to_string();
		let directory_parent_string = directory.parent.map(|p| p.to_string_lossy().to_string());

		for song in directory.songs {
			let tags = song.metadata;
			let path_string = song.path.to_string_lossy().to_string();

			if tags.year.is_some() {
				inconsistent_directory_year |=
					directory_year.is_some() && directory_year != tags.year;
				directory_year = tags.year;
			}

			if tags.album.is_some() {
				inconsistent_directory_album |=
					directory_album.is_some() && directory_album != tags.album;
				directory_album = tags.album.as_ref().cloned();
			}

			if tags.album_artist.is_some() {
				inconsistent_directory_artist |=
					directory_artist.is_some() && directory_artist != tags.album_artist;
				directory_artist = tags.album_artist.as_ref().cloned();
			} else if tags.artist.is_some() {
				inconsistent_directory_artist |=
					directory_artist.is_some() && directory_artist != tags.artist;
				directory_artist = tags.artist.as_ref().cloned();
			}

			let artwork_path = if tags.has_artwork {
				Some(path_string.clone())
			} else {
				directory_artwork.as_ref().cloned()
			};

			if let Err(e) = self.sender.send(inserter::Item::Song(inserter::Song {
				path: path_string,
				parent: directory_path_string.clone(),
				disc_number: tags.disc_number.map(|n| n as i32),
				track_number: tags.track_number.map(|n| n as i32),
				title: tags.title,
				duration: tags.duration.map(|n| n as i32),
				artist: tags.artist,
				album_artist: tags.album_artist,
				album: tags.album,
				year: tags.year,
				artwork: artwork_path,
				lyricist: tags.lyricist,
				composer: tags.composer,
				genre: tags.genre,
				label: tags.label,
			})) {
				error!("Error while sending song from collector: {}", e);
			}
		}

		if inconsistent_directory_year {
			directory_year = None;
		}
		if inconsistent_directory_album {
			directory_album = None;
		}
		if inconsistent_directory_artist {
			directory_artist = None;
		}

		if let Err(e) = self
			.sender
			.send(inserter::Item::Directory(inserter::Directory {
				path: directory_path_string,
				parent: directory_parent_string,
				artwork: directory_artwork,
				album: directory_album,
				artist: directory_artist,
				year: directory_year,
				date_added: directory.created,
			})) {
			error!("Error while sending directory from collector: {}", e);
		}
	}

	fn get_artwork(&self, directory: &traverser::Directory) -> Option<String> {
		let regex_artwork = directory.other_files.iter().find_map(|path| {
			let matches = path
				.file_name()
				.and_then(|name| name.to_str())
				.map(|name| match &self.album_art_pattern {
					Some(pattern) => pattern.is_match(name),
					None => false,
				})
				.unwrap_or(false);
			if matches {
				Some(path.to_string_lossy().to_string())
			} else {
				None
			}
		});

		let embedded_artwork = directory.songs.iter().find_map(|song| {
			if song.metadata.has_artwork {
				Some(song.path.to_string_lossy().to_string())
			} else {
				None
			}
		});

		regex_artwork.or(embedded_artwork)
	}
}


text: require 'netsuite_rails/netsuite_rails'


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

angular.module('flowableModeler').controller('FlowableDecisionTableReferenceCtrl',
    [ '$scope', '$modal', '$http', function($scope, $modal, $http) {

     // Config for the modal window
     var opts = {
         template:  'editor-app/configuration/properties/decisiontable-reference-popup.html?version=' + Date.now(),
         scope: $scope
     };

     // Open the dialog
     _internalCreateModal(opts, $modal, $scope);
}]);

angular.module('flowableModeler').controller('FlowableDecisionTableReferencePopupCtrl', ['$rootScope', '$scope', '$http', '$location', 'editorManager',
    function($rootScope, $scope, $http, $location, editorManager) {

        $scope.state = {
            'loadingDecisionTables': true,
            'decisionTableError': false
        };

        $scope.popup = {
            'state': 'decisionTableReference'
        };

        $scope.foldersBreadCrumbs = [];

        // Make click outside dialog also call close.
        $scope.$parent.$on('modal.hide.before', function() {
            $scope.close();
            $scope.$parent.$apply();
        });

        // Close button handler
        $scope.close = function() {
            $scope.property.newVariablesMapping = undefined;
            $scope.property.mode = 'read';
            $scope.$hide();
        };

        // Selecting/deselecting a decision table
        $scope.selectDecisionTable = function(decisionTable, $event) {
            $event.stopPropagation();
            if ($scope.selectedDecisionTable && $scope.selectedDecisionTable.id && decisionTable.id == $scope.selectedDecisionTable.id) {
                // un-select the current selection
                $scope.selectedDecisionTable = null;
            } else {
                $scope.selectedDecisionTable = decisionTable;
            }
        };

        $scope.isSelected = function () {
            if ($scope.selectedDecisionTable && $scope.selectedDecisionTable.id) {
                return true;
            }
            return false;
        };

        // Saving the selected value
        $scope.save = function() {
            if ($scope.selectedDecisionTable) {
                $scope.property.value = {
                    'id': $scope.selectedDecisionTable.id,
                    'name': $scope.selectedDecisionTable.name,
                    'key': $scope.selectedDecisionTable.key
                };

            } else {
                $scope.property.value = null;
            }
            $scope.updatePropertyInModel($scope.property);
            $scope.close();
        };

        // Open the selected value
        $scope.open = function() {
            if ($scope.selectedDecisionTable) {
                $scope.property.value = {
                    'id': $scope.selectedDecisionTable.id,
                    'name': $scope.selectedDecisionTable.name,
                    'key': $scope.selectedDecisionTable.key
                };
                $scope.updatePropertyInModel($scope.property);

                var modelMetaData = editorManager.getBaseModelData();
                var json = editorManager.getModel();
                json = JSON.stringify(json);

                var params = {
                    modeltype: modelMetaData.model.modelType,
                    json_xml: json,
                    name: modelMetaData.name,
                    key: modelMetaData.key,
                    description: modelMetaData.description,
                    newversion: false,
                    lastUpdated: modelMetaData.lastUpdated
                };

                // Update
                $http({
                    method: 'POST',
                    data: params,
                    ignoreErrors: true,
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
                    },
                    transformRequest: function (obj) {
	                    var str = [];
	                    for (var p in obj) {
	                        str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
	                    }
	                    return str.join("&");
	                },
                    url: FLOWABLE.URL.putModel(modelMetaData.modelId)
                })

                .success(function(data, status, headers, config) {
                        editorManager.handleEvents({
                            type: ORYX.CONFIG.EVENT_SAVED
                        });

						$rootScope.addHistoryItem($scope.selectedShape.resourceId);
						$location.path('decision-table-editor/' + $scope.selectedDecisionTable.id);
                    })
                    .error(function(data, status, headers, config) {

                    });

                $scope.close();
            }
        };

        $scope.newDecisionTable = function() {
            $scope.property.value.variablesmapping = [];

            $scope.popup.state = 'newDecisionTable';

            var modelMetaData = editorManager.getBaseModelData();

            $scope.model = {
                loading: false,
                decisionTable: {
                    name: '',
                    key: '',
                    description: '',
                    modelType: 4
                },
                defaultStencilSet: undefined,
                decisionTableStencilSets: []
            };
        };

        $scope.createDecisionTable = function() {

            if (!$scope.model.decisionTable.name || $scope.model.decisionTable.name.length == 0 ||
            	!$scope.model.decisionTable.key || $scope.model.decisionTable.key.length == 0) {

                return;
            }

            var stencilSetId = $scope.model.decisionTable.stencilSet;
            $scope.model.loading = true;

            $http({
                method: 'POST',
                url: FLOWABLE.APP_URL.getModelsUrl(),
                data: $scope.model.decisionTable
            }).
            success(function(data, status, headers, config) {

                var newDecisionTableId = data.id;
                $scope.property.value = {
                    'id': newDecisionTableId,
                    'name': data.name,
                    'key': data.key
                };
                $scope.updatePropertyInModel($scope.property);

                var modelMetaData = editorManager.getBaseModelData();
                var json = editorManager.getModel();
                json = JSON.stringify(json);

                var params = {
                    modeltype: modelMetaData.model.modelType,
                    json_xml: json,
                    name: modelMetaData.name,
                    key: modelMetaData.key,
                    description: modelMetaData.description,
                    newversion: false,
                    lastUpdated: modelMetaData.lastUpdated,
                    stencilSet: stencilSetId
                };

                // Update
                $http({
                    method: 'POST',
                    data: params,
                    ignoreErrors: true,
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
                    },
                    transformRequest: function (obj) {
	                    var str = [];
	                    for (var p in obj) {
	                        str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
	                    }
	                    return str.join("&");
	                },
                    url: FLOWABLE.URL.putModel(modelMetaData.modelId)
                })

                .success(function(data, status, headers, config) {
                        editorManager.handleEvents({
                            type: ORYX.CONFIG.EVENT_SAVED
                        });

                        $scope.model.loading = false;
                        $scope.$hide();

                        $rootScope.addHistoryItem($scope.selectedShape.resourceId);
                        $location.path('decision-table-editor/' + newDecisionTableId);
                    })
                    .error(function(data, status, headers, config) {
                        $scope.model.loading = false;
                        $scope.$hide();
                    });

            }).
            error(function(data, status, headers, config) {
                $scope.model.loading = false;
                $scope.model.errorMessage = data.message;
            });
        };

        $scope.cancel = function() {
            $scope.close();
        };

        $scope.resetCurrent = function () {
            for (var i = 0, found = false; i < $scope.decisionTables.length && found === false; i++) {
                var table = $scope.decisionTables[i];
                if (table.id === $scope.property.value.id) {
                    $scope.selectedDecisionTable = table;
                    found = true;
                }
            }
        };

        $scope.loadDecisionTables = function() {
            var modelMetaData = editorManager.getBaseModelData();
            $http.get(FLOWABLE.APP_URL.getDecisionTableModelsUrl())
                .success(
                    function(response) {
                        $scope.state.loadingDecisionTables = false;
                        $scope.state.decisionTableError = false;
                        $scope.decisionTables = response.data;
                        $scope.resetCurrent();
                    })
                .error(
                    function(data, status, headers, config) {
                        $scope.state.loadingDecisionTables = false;
                        $scope.state.decisionTableError = true;
                    });
        };

        if ($scope.property && $scope.property.value && $scope.property.value.id) {
            $scope.selectedDecisionTable = $scope.property.value;
            $scope.storedId = $scope.property.value.id;
        }

        $scope.loadDecisionTables();
    }
]);


text:
/**
 * Provides algorithms for fitting additive groves (AGs).
 */
package wulfric.predictor.tree.ensemble.ag;


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.04.07 at 04:41:42 PM EDT
//

package org.oasis_open.docs.s_ramp.ns.s_ramp_v1;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for eventEnum.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="eventEnum">
 *   <restriction base="{http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0}baseArtifactEnum">
 *     <enumeration value="Event"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "eventEnum")
@XmlEnum(BaseArtifactEnum.class)
public enum EventEnum {

    @XmlEnumValue("Event")
    EVENT(BaseArtifactEnum.EVENT);
    private final BaseArtifactEnum value;

    EventEnum(BaseArtifactEnum v) {
        value = v;
    }

    public BaseArtifactEnum value() {
        return value;
    }

    public static EventEnum fromValue(BaseArtifactEnum v) {
        for (EventEnum c: EventEnum.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v.toString());
    }

}


text:
noisypix
========

Noisy pix is an Coldfusion, HTML 5 image resizing tool.


text:
import getopt
import copy

from optparse \
    import \
        Option, OptionGroup, OptionParser

import bento

from bento._config \
    import \
        BENTO_SCRIPT
from bento.core.utils \
    import \
        to_camel_case
from bento.commands.options \
    import \
        OptionsContext

from bento.commands.errors \
    import \
        UsageException

USAGE = """\
bentomaker %(version)s -- an alternative to distutils-based systems
Usage: %(name)s [command [options]]
"""

class Command(object):
    long_descr = """\
Purpose: command's purposed (default description)
Usage: command's usage (default description)
"""
    short_descr = None
    # XXX: decide how to deal with subcommands options
    common_options = [Option('-h', '--help',
                             help="Show this message and exits.",
                             action="store_true")]

    def run(self, ctx):
        raise NotImplementedError("run method should be implemented by command classes.")

    def shutdown(self, ctx):
        pass

class HelpCommand(Command):
    long_descr = """\
Purpose: Show help on a command or other topic.
Usage:   bentomaker help [TOPIC] or bentomaker help [COMMAND]."""
    short_descr = "gives help on a given topic or command."
    def run(self, ctx):
        cmd_args = ctx.get_command_arguments()
        p = ctx.options_context.parser
        o, a = p.parse_args(cmd_args)
        if o.help:
            p.print_help()
            return
        if len(a) < 1:
            print get_simple_usage()
            return

        # Parse the options for help command itself
        cmd_name = None
        help_args = []
        if not cmd_args[0].startswith('-'):
            cmd_name = cmd_args[0]
            cmd_args.pop(0)
        else:
            # eat all the help options
            _args = [cmd_args.pop(0)]
            while not _args[0].startswith('-') and len(cmd_args) > 0:
                _args.append(cmd_args.pop(0))
            help_args = _args
            cmd_name = cmd_args[0]

        options_context = ctx.options_registry.get_options(cmd_name)
        if ctx.options_registry.is_registered(cmd_name):
            p = options_context.parser
            p.print_help()
        else:
            raise UsageException("error: command %s not recognized" % cmd_name)

def fill_string(s, minlen):
    if len(s) < minlen:
        s += " " * (minlen - len(s))
    return s

def get_simple_usage():
    ret = [USAGE % {"name": "bentomaker",
                    "version": bento.__version__}]
    ret.append("Basic Commands:")

    commands = []

    def add_group(cmd_names):
        for name in cmd_names:
            v = COMMANDS_REGISTRY.get_command(name)
            doc = v.short_descr
            if doc is None:
                doc = "undocumented"
            header = "  %(script)s %(cmd_name)s" % \
                        {"script": "bentomaker",
                         "cmd_name": name}
            commands.append((header, doc))
    add_group(["configure", "build", "install"])
    commands.append(("", ""))
    add_group(["sdist", "build_wininst", "build_egg"])
    commands.append(("", ""))

    commands.append(("  %s help configure" % "bentomaker",
                     "more help on e.g. configure command"))
    commands.append(("  %s help commands" % "bentomaker",
                     "list all commands"))
    commands.append(("  %s help globals" % "bentomaker",
                     "show global options"))

    minlen = max([len(header) for header, hlp in commands]) + 2
    for header, hlp in commands:
        ret.append(fill_string(header, minlen) + hlp)
    return "\n".join(ret)

# Decorator to create a new command class from a simple function
def command(f):
    bypass_help = True
    def _dec(f):
        klass_name = "%sCommand" % to_camel_case(f.__name__)

        class _CmdFakeMetaclass(type):
            def __init__(cls, name, bases, d):
                super(_CmdFakeMetaclass, cls).__init__(name, bases, d)
                name = cls.__name__

        klass = _CmdFakeMetaclass(klass_name, (Command,), {})

        if f.__name__.startswith("_"):
            COMMANDS_REGISTRY.register_command(f.__name__, klass, public=False)
        else:
            COMMANDS_REGISTRY.register_command(f.__name__, klass)
        if bypass_help:
            def run(self, ctx):
                o, a = ctx.options_context.parser.parse_args(ctx.get_command_arguments())
                if o.help:
                    ctx.options_context.parser.print_help()
                    return
                return f(ctx)
        else:
            run = lambda self, ctx: f(ctx)
        klass.run = run
        if f.__doc__:
            klass.long_descr = f.__doc__
        return f
    return _dec(f)

class CommandRegistry(object):
    def __init__(self):
        # command line name -> command class
        self._klasses = {}
        # command line name -> None for private commands
        self._privates = {}

    def register_command(self, name, cmd_klass, public=True):
        if self._klasses.has_key(name):
            raise ValueError("context for command %r already registered !" % name)
        else:
            self._klasses[name] = cmd_klass
            if not public:
                self._privates[name] = None

    def get_command(self, name):
        cmd_klass = self._klasses.get(name, None)
        if cmd_klass is None:
            raise ValueError("No command class registered for name %r" % name)
        else:
            return cmd_klass

    def get_command_names(self):
        return self._klasses.keys()

    def get_public_command_names(self):
        return [k for k in self._klasses.keys() if not self._privates.has_key(k)]

    def get_command_name(self, klass):
        for k, v in self._klasses.iteritems():
            if v == klass:
                return k
        raise ValueError("Unregistered class %r" % klass)

    def get_command_name_from_class_name(self, class_name):
        for k, v in self._klasses.iteritems():
            if v.__name__ == class_name:
                return k
        raise ValueError("Unregistered class %r" % class_name)

# FIXME: singleton
COMMANDS_REGISTRY = CommandRegistry()


text:
/*-----------------------contact_form-------------------*/
.contact-notice { text-align: center; padding: 10px; background: #DFF2BF; border: 1px solid; color: #4F8A10; margin-bottom: 10px; }
form.contact { font-size: 16px; }
form.contact div { clear: left; margin-bottom: 10px; }
form.contact label { float: left; margin-right: 10px; text-align: right; width: 100px; font-weight: bold; vertical-align: top; padding-top: 10px; }
form.contact input[type="text"],
form.contact input[type="email"]
    { background-color:#fdeaeb; width: 350px; line-height: 26px; font-size: 20px; min-height: 26px; }
form.contact textarea { background-color:#fdeaeb; width: 350px; height: 150px; line-height: 26px; font-size: 20px; }
form.contact input[type="submit"] { margin-left: 110px; width: 358px; line-height: 26px; font-size: 20px; min-height: 26px; }
form.contact ul li { color: #ff0000; margin-bottom: 5px; }
form.contact_c { font-size: 16px; }
form.contact_c div { clear: left; margin-bottom: 10px; }
form.contact_c label { float: left;  text-align: right; width: 10px; font-weight: bold; vertical-align: top; padding-top: 10px; }
form.contact_c input[type="text"],
form.contact input[type="user"]
    {  width: 620px; line-height: 26px; font-size: 20px; min-height: 26px; }
form.contact_c textarea {  width: 620px; height: 150px; line-height: 26px; font-size: 20px; }
form.contact_c input[type="submit"] {  width: 628px; line-height: 26px; font-size: 20px; min-height: 26px; }
form.contact_c ul li { color: #ff0000; margin-bottom: 5px; }


text:
package org.vitrivr.cineast.core.features.exporter;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
import javax.imageio.ImageIO;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vitrivr.cineast.core.data.frames.VideoFrame;
import org.vitrivr.cineast.core.data.segments.SegmentContainer;
import org.vitrivr.cineast.core.db.PersistencyWriterSupplier;
import org.vitrivr.cineast.core.db.setup.EntityCreator;
import org.vitrivr.cineast.core.features.extractor.Extractor;
import org.vitrivr.cineast.core.util.LogHelper;

public class ShotThumbnailsExporter implements Extractor {

  private static final Logger LOGGER = LogManager.getLogger();

  private static final String PROPERTY_NAME_DESTINATION = "destination";
  private static final String PROPERTY_NAME_FORMAT = "format";

  /**
   * Destination folder.
   */
  private final File folder;

  /**
   * Output format for thumbnails. Defaults to PNG.
   */
  private final String format;

  /**
   * Default constructor - no parameters.
   */
  public ShotThumbnailsExporter() {
    this(new HashMap<>());
  }

  /**
   * Constructor with property HashMap that allows for passing of parameters.
   *

   * Supported parameters:
   *
   *

   *
destination: Path where shot thumbnails should be stored.

   *
format: The image format to use (PNG, JPEG).

   *

   *
   * @param properties HashMap containing named properties
   */
  public ShotThumbnailsExporter(Map<String, String> properties) {
    this.folder = new File(properties.getOrDefault(PROPERTY_NAME_DESTINATION, "./thumbnails"));
    this.format = properties.getOrDefault(PROPERTY_NAME_FORMAT, "JPG");
  }

  @Override
  public void init(PersistencyWriterSupplier supply) {
    if (!this.folder.exists()) {
      this.folder.mkdirs();
    }
  }

  @Override
  public void processSegment(SegmentContainer shot) {

    File imageFolder = new File(this.folder, shot.getSuperId());
    File img = new File(imageFolder, shot.getId() + "." + this.format.toLowerCase());
    if (img.exists()) {
      return;
    }
    VideoFrame mostRepresentativeFrame = shot.getMostRepresentativeFrame();
    if (mostRepresentativeFrame == VideoFrame.EMPTY_VIDEO_FRAME) {
      return;
    }
    BufferedImage thumb = mostRepresentativeFrame.getImage().getThumbnailImage();
    try {
      if (!imageFolder.exists()) {
        imageFolder.mkdirs();
      }
      boolean writeSuccess = ImageIO.write(thumb, format, img);
      if (!writeSuccess) {
        LOGGER.warn("Could not find appropriate writer for thumbnail \"{}\", attempting conversion.", shot.getId());
        BufferedImage convertedThumb = new BufferedImage(thumb.getWidth(), thumb.getHeight(), BufferedImage.TYPE_INT_RGB);
        convertedThumb.getGraphics().drawImage(thumb, 0, 0, null);
        writeSuccess = ImageIO.write(convertedThumb, format, img);
        if (!writeSuccess) {
          LOGGER.error("Could not find appropriate writer for thumbnail \"{}\", even after conversion!", shot.getId());
        }
      }
    } catch (IOException e) {
      LOGGER.error("Could not write thumbnail image: {}", LogHelper.getStackTrace(e));
    }
  }

  @Override
  public void finish() { /* Nothing to finish. */ }

  @Override
  public void initalizePersistentLayer(Supplier<EntityCreator> supply) { /* Nothing to init. */ }

  @Override
  public void dropPersistentLayer(Supplier<EntityCreator> supply) { /* Nothing to drop. */ }
}


text:
package com.kloudless;

import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.stream.Collectors;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import com.kloudless.exceptions.ApiException;
import com.kloudless.models.Resource;
import com.kloudless.models.ResourceList;
import com.kloudless.models.ResponseBase;
import com.kloudless.models.ResponseJson;
import com.kloudless.models.ResponseRaw;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.EntityBuilder;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPatch;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

/**
 * Client object is a useful tool to handle any http interaction between client and Kloudless API
 * Server.
 */
public abstract class BaseHttpClient {
    static Gson gson = new GsonBuilder().setPrettyPrinting().create();

    /**
     * Get the prefix of URL
     *
     * @return String url prefix
     */
    abstract public String getUrlPrefix();

    /**
     * Get default http headers
     *
     * @return Map, key, value pair of arguments
     */
    abstract public Map<String, Object> getDefaultHeaders();

    /**
     * Get default http query string
     *
     * @return Map, key, value pair of query parameters
     */
    abstract public Map<String, Object> getDefaultQueryParameters();

    /**
     * Http GET method
     *
     * @param url URL of API supported by Kloudless API server.
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase get(String url) throws ApiException {
        return get(url, null);
    }

    /**
     * Http GET method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param headers Addition header parameter in this request.
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase get(String url, Map<String, Object> headers) throws ApiException {
        return runHttpTransaction("GET", url, "Json", headers, null);
    }

    /**
     * Http GET method for download
     *
     * @param url     URL of a Kloudless API endpoint
     * @return ResponseRaw  A ResponseRaw instance
     * @throws ApiException An error if the response status code isn't 2xx
     */
    public ResponseRaw getBinary(String url) throws ApiException {
        return getBinary(url, null);
    }

    /**
     * Http GET method for download
     *
     * @param url     URL of a Kloudless API endpoint
     * @param headers Additional headers for the request
     * @return ResponseRaw  A ResponseRaw instance
     * @throws ApiException An error if the response status code isn't 2xx
     */
    public ResponseRaw getBinary(String url, Map<String, Object> headers) throws ApiException {
        return (ResponseRaw) runHttpTransaction(
                "GET", url, "Json", headers, null, false);
    }

    /**
     * Http POST method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param content The post data will be in the request boby
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase post(String url, Map<String, Object> content) throws ApiException {
        return post(url, null, content);
    }

    /**
     * Http POST method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param headers Addition header parameter in this request.
     * @param content The post data wiil be in the request body
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase post(String url, Map<String, Object> headers, Map<String, Object> content)
            throws ApiException {
        return runHttpTransaction("POST", url, "Json", headers, content);
    }

    /**
     * Http POST method
     *
     * @param url        URL of API supported by Kloudless API server.
     * @param headers    Addition header parameter in this request.
     * @param uploadFile File object will be posted to the server.
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase post(String url, Map<String, Object> headers, File uploadFile)
            throws ApiException {
        return runHttpTransaction("POST", url, "File", headers, uploadFile);
    }

    /**
     * Http PATCH method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param content The patch data will be in the request boby
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase patch(String url, Map<String, Object> content) throws ApiException {
        return patch(url, null, content);
    }

    /**
     * Http PATCH method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param headers Addition header parameter in this request.
     * @param content The patch data wiil be in the request body
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase patch(String url, Map<String, Object> headers, Map<String, Object> content)
            throws ApiException {
        return runHttpTransaction("PATCH", url, "Json", headers, content);
    }

    /**
     * Http PATCH method
     *
     * @param url        URL of API supported by Kloudless API server.
     * @param headers    Addition header parameter in this request.
     * @param uploadFile File object will be patch to the server.
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase patch(String url, Map<String, Object> headers, File uploadFile)
            throws ApiException {
        return runHttpTransaction("PATCH", url, "File", headers, uploadFile);
    }

    /**
     * Http PUT method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param content The put data will be in the request boby
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase put(String url, Map<String, Object> content) throws ApiException {
        return put(url, null, content);
    }

    /**
     * Http PUT method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param headers Addition header parameter in this request.
     * @param content The put data wiil be in the request body
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase put(String url, Map<String, Object> headers, Map<String, Object> content)
            throws ApiException {
        return runHttpTransaction("PUT", url, "Json", headers, content);
    }

    /**
     * Http PUT method
     *
     * @param url        URL of API supported by Kloudless API server.
     * @param headers    Addition header parameter in this request.
     * @param uploadFile File object will be put to the server.
     * @return ResponseBase Class and list of data or JsonObject is inside the data attribute.
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase put(String url, Map<String, Object> headers, File uploadFile)
            throws ApiException {
        return runHttpTransaction("PUT", url, "File", headers, uploadFile);
    }

    /**
     * Http DELETE method
     *
     * @param url URL of API supported by Kloudless API server.
     * @return ResponseBase object but might be empty content
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase delete(String url) throws ApiException {
        return delete(url, null);
    }

    /**
     * Http DELETE method
     *
     * @param url     URL of API supported by Kloudless API server.
     * @param headers Addition header parameter in this request.
     * @return ResponseBase object but might be empty content
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    public ResponseBase delete(String url, Map<String, Object> headers) throws ApiException {
        return runHttpTransaction("DELETE", url, "Json", headers, null);
    }

    /**
     * This method finds the proper rawExecute method and dispatches the request
     *
     * @param method  the HTTP method
     * @param url     the URL string
     * @param format  String should be one of Json, File or Form
     * @param headers the key-value pairs of the request headers
     * @param content the key-value pairs of the request body
     * @return ResponseBase A ResponseBase instance
     * @throws ApiException Error if the request failed
     */
    private ResponseBase runHttpTransaction(
            String method, String url, String format, Map<String, Object> headers,
            Object content) throws ApiException {
        return runHttpTransaction(method, url, format, headers, content, true);
    }

    /**
     * This method finds the proper rawExecute method and dispatches the request
     *
     * @param method  the HTTP method
     * @param url     the URL string
     * @param format  String should be one of Json, File or Form
     * @param headers the key-value pairs of the request headers
     * @param content the key-value pairs of the request body
     * @param tryJson whether to try parsing the response body as a JSON object
     * @return ResponseBase A ResponseBase instance
     * @throws ApiException Error if the request failed
     */
    private ResponseBase runHttpTransaction(
            String method, String url, String format, Map<String, Object> headers,
            Object content, Boolean tryJson) throws ApiException {
        url = assembleUrl(url);
        headers = mergeHeaders(headers);
        format = format.toUpperCase();
        HttpResponse httpResponse;
        switch (format) {
            case "JSON":
                httpResponse = rawJsonExecute(method, url, headers, content);
                break;
            case "FORM":
                httpResponse = rawFormExecute(method, url, headers, content);
                break;
            case "FILE":
                httpResponse = rawFileExecute(method, url, headers, content);
                break;
            default:
                throw new IllegalArgumentException("Invalid HTTP method: " + format);
        }
        return responseFactory(httpResponse, url, headers, method, tryJson);
    }

    /**
     * The method of execute the http request and supports form data content
     *
     * @param method  the Http method
     * @param url     the url string
     * @param headers the key, value pairs of http headers
     * @param content the key, value pairs of http body
     * @return HttpResponse the httpResponse object
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    protected HttpResponse rawFormExecute(String method, String url, Map<String, Object> headers,
            Object content) throws ApiException {

        try {
            content = Optional.ofNullable(content).orElse(new HashMap<String, Object>());
            List<NameValuePair> requestContent = new ArrayList<NameValuePair>();
            for (Entry entry : ((Map<String, Object>) content).entrySet()) {
                requestContent.add(
                        new BasicNameValuePair((String) entry.getKey(), (String) entry.getValue()));
            }
            HttpEntity entity = new UrlEncodedFormEntity(requestContent);
            return handleResponse(assembleHttpRequest(method, url, entity, headers,
                    ContentType.APPLICATION_FORM_URLENCODED.getMimeType()));
        } catch (ApiException | ParseException | IOException e) {
            throw new ApiException(
                    "Run http " + method + " to " + url + " failed, " + e.getMessage(), e);
        }
    }

    /**
     * The method of execute the http request and supports json data content
     *
     * @param method  the Http method
     * @param url     the url string
     * @param headers the key, value pairs of http headers
     * @param content the key, value pairs of http body
     * @return HttpResponse the httpResponse object
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    protected HttpResponse rawJsonExecute(String method, String url, Map<String, Object> headers,
            Object content) throws ApiException {
        try {
            content = (Map<String, Object>) Optional.ofNullable(content)
                    .orElse(new HashMap<String, Object>());
            HttpEntity entity = new StringEntity(gson.toJson(content).toString());
            return handleResponse(assembleHttpRequest(method, url, entity, headers,
                    ContentType.APPLICATION_JSON.getMimeType()));
        } catch (ApiException | ParseException | IOException e) {
            throw new ApiException(
                    "Run http " + method + " to " + url + " failed, " + e.getMessage(), e);
        }
    }

    /**
     * The method of execute the http request and supports file uploading
     *
     * @param method     the Http method
     * @param url        the url string
     * @param headers    the key, value pairs of http headers
     * @param uploadFile the file object to upload
     * @return HttpResponse the httpResponse object
     * @throws ApiException An error if any data other than 2xx from Kloudless API server or
     *                      upstream services.
     */
    protected HttpResponse rawFileExecute(String method, String url, Map<String, Object> headers,
            Object uploadFile) throws ApiException {
        try {
            HttpEntity entity = EntityBuilder.create().setFile((File) uploadFile).build();
            return handleResponse(assembleHttpRequest(method, url, entity, headers,
                    ContentType.APPLICATION_OCTET_STREAM.getMimeType()));
        } catch (ApiException | ParseException | IOException e) {
            throw new ApiException(
                    "Run http " + method + " to " + url + " failed, " + e.getMessage(), e);
        }
    }

    /**
     * This method is assemble HttpReques object
     *
     * @param method      the Http method
     * @param url         the url string
     * @param entity      the object of HttpEntity
     * @param headers     the key, value pairs of http headers
     * @param contentType the contentType of this http rquest header
     * @return HttpRequestBase The HttpRequest object
     * @throws UnsupportedEncodingException Error when the unsupport method is inputed
     */
    private static HttpRequestBase assembleHttpRequest(String method, String url, HttpEntity entity,
            Map<String, Object> headers, String contentType) throws UnsupportedEncodingException {
        HttpRequestBase request = requestFactory(method, Application.getBaseUrl() + url, entity);
        request = assembleHeaders(request, headers, contentType);
        return request;
    }

    /**
     * The method of receving the httpResponse and check the status of httpResponse
     *
     * @param request A HttpRequest object which has populated all essential data
     * @return HttpResponse the HttpResponse object
     * @throws ApiException            An error if any data other than 2xx from Kloudless API server
     *                                 or upstream services.
     * @throws ClientProtocolException Error when http call failed
     * @throws IOException             Error when http call failed
     * @throws ParseException          Error when parse the JsonObject failed
     */
    private static HttpResponse handleResponse(HttpRequestBase request)
            throws ClientProtocolException, IOException, ApiException, ParseException {
        HttpClient httpClient = HttpClients.createDefault();
        HttpResponse response = httpClient.execute(request);
        if (response.getStatusLine().getStatusCode() < 200
                || response.getStatusLine().getStatusCode() >= 300) {
            throw new ApiException("Get error response from API server, status code:"
                    + response.getStatusLine().getStatusCode() + ", and its message"
                    + EntityUtils.toString(response.getEntity()), null);
        }
        return response;
    }

    /**
     * This method merge header from API call and default Headers in the Client object and
     * attributes of default headers will be overwrite if duplicated
     *
     * @param headers the key value in headers from API call.
     * @return mergedHeaders the final key value of headers
     */
    protected Map<String, Object> mergeHeaders(Map<String, Object> headers) {
        headers = Optional.ofNullable(headers).orElse(new HashMap<String, Object>());
        Map<String, Object> mergedMap = new HashMap<String, Object>();

        mergedMap.putAll(this.getDefaultHeaders());
        // overwrited by additional headers
        mergedMap.putAll(headers);

        return mergedMap;
    }

    /**
     * Add headers from key value map to request object
     *
     * @param request     the HttpRequest object
     * @param headers     the key value pair of headers
     * @param contentType the content type in the headers
     * @return HttpRequest object
     */
    private static HttpRequestBase assembleHeaders(HttpRequestBase request,
            Map<String, Object> headers, String contentType) {
        for (Entry entry : headers.entrySet()) {
            request.addHeader((String) entry.getKey(), (String) entry.getValue());
        }
        request.addHeader("User-Agent", "kloudless-java/" + Application.getSDKVersion());
        request.addHeader("Content-Type", contentType);
        return request;
    }

    /**
     * Assemble the whole Url for http request
     *
     * @param url relative url path from parameters of API call
     * @return String URL with baseUrl , prefix , paths and query string.
     */
    protected String assembleUrl(String url) {
        return this.getUrlPrefix() + appendDefaultQueryParameters(url);
    }

    /**
     * This method is merge query parameters from API call and existed query parameters which might
     * from Client object or generated and populated to Resource object.
     *
     * @param url relative url path from parameters of API call
     * @return String the handled query string
     */
    private String appendDefaultQueryParameters(String url) {
        if (url.indexOf("?") != -1) {
            String[] urls = url.split("\\?");
            url = urls[0] + "?" + toQueryString(mergeDeaultQueryParameters(getQueryParams(url)));
        } else {
            String queryString =
                    toQueryString(mergeDeaultQueryParameters(new HashMap<String, String>()));
            if (!queryString.isEmpty()) {
                url = url + "?" + queryString;
            }
        }

        return url;
    }

    /**
     * Parse the query string to key, value pair of query parameters
     *
     * @param url relative url path from parameters of API call
     * @return map the key, value pairs of query parameters
     */
    private Map<String, String> getQueryParams(String url) {
        String[] urls = url.split("\\?");
        String[] queryString = urls[1].split("&");
        return Arrays.asList(queryString).stream().map(param -> param.split("=", 2))
                .collect(Collectors.toMap(a -> a[0], a -> a[1]));
    }

    /**
     * Merge the query parameters with defaultQueryParameters
     *
     * @param querys Key value pairs of query parameters from API call
     * @return map A merged key value pair of query parameters
     */
    private Map<String, String> mergeDeaultQueryParameters(Map<String, String> querys) {
        for (Entry entry : this.getDefaultQueryParameters().entrySet()) {
            if (!querys.containsKey(entry.getKey())) {
                querys.put((String) entry.getKey(), (String) entry.getValue());
            }
        }
        return querys;
    }

    /**
     * Transfer key value pair of query parameters to query string
     *
     * @param queryParameters Key value pairs of query parameters
     * @return String queryString
     */
    private static String toQueryString(Map<String, String> queryParameters) {
        return queryParameters.entrySet().stream()
                .map(element -> element.getKey() + "=" + element.getValue())
                .collect(Collectors.joining("&"));
    }

    /**
     * Factory of httpRequest object
     *
     * @param method http method
     * @param url    the string of url
     * @param entity the http body
     * @return HttpRequest a http request object.
     * @throws UnsupportedEncodingException Error when the http method is not supported
     */
    private static HttpRequestBase requestFactory(String method, String url, HttpEntity entity)
            throws UnsupportedEncodingException {
        switch (method) {
            case "GET":
                return new HttpGet(url);
            case "POST":
                HttpPost post = new HttpPost(url);
                post.setEntity(entity);
                return post;
            case "PUT":
                HttpPut put = new HttpPut(url);
                put.setEntity(entity);
                return put;
            case "PATCH":
                HttpPatch patch = new HttpPatch(url);
                patch.setEntity(entity);
                return patch;
            case "DELETE":
                return new HttpDelete(url);
            default:
                throw new IllegalArgumentException("Invalid HTTP method: " + method);
        }
    }

    /**
     * Response object factory generates Resource/ResourceList/ResponseRaw object
     *
     * @param response httpResponse object
     * @param url      the url string of current http request
     * @param headers  the key value pairs of current http headers
     * @param method   the http method
     * @param tryJson  whether to try parse the response body as a JSON object
     * @return ResponseBase object, could be ResponseRaw, Resource, or ResourceList depends on the
     *         JsonObject type from API Server
     * @throws ApiException Errors when trandfer to ResponseBase object
     */
    private ResponseBase responseFactory(
            HttpResponse response, String url, Map<String, Object> headers, String method,
            Boolean tryJson) throws ApiException {
        if (response != null && response.getEntity() != null
                && tryJson
                && ContentType.get(response.getEntity()).toString()
                        .equals(ContentType.APPLICATION_JSON.getMimeType())) {
            try {
                JsonObject data =
                        gson.fromJson(EntityUtils.toString(response.getEntity()), JsonObject.class);
                if (data.has("type") && "object_list".equals(data.get("type").getAsString())) {
                    List<Resource> tmpList = new ArrayList<Resource>();
                    JsonArray array = data.get("objects").getAsJsonArray();
                    for (int i = 0; i < array.size(); i++) {
                        JsonObject element = array.get(i).getAsJsonObject();
                        Resource one = new Resource(element,
                                generateResourceUrl(url, element, method, true), headers);
                        tmpList.add(one);
                    }

                    ResourceList rList = new ResourceList(url, headers, tmpList, data);
                    return rList;

                } else if (data.has("id")) {
                    return new Resource(data, generateResourceUrl(url, data, method, false),
                            headers);
                } else {
                    return new ResponseJson(data, url, headers);
                }
            } catch (JsonSyntaxException | ParseException | IOException | URISyntaxException e) {
                throw new ApiException("Generate Resource object failed, " + e.getMessage(), e);
            }

        } else {
            return new ResponseRaw(response, url, headers);
        }
    }

    /**
     * This method temporarily handle query string.
     *
     * @param url       the url of this http query
     * @param data      the response object
     * @param method    the http method
     * @param isListUrl boolean of the queried url is for list or not
     * @return String of handled url
     * @throws URISyntaxException the error occurs when url format is invalid
     */
    private static String generateResourceUrl(String url, JsonObject data, String method,
            boolean isListUrl) throws URISyntaxException {
        if (url.indexOf("?") != -1) {
            String[] unhandledUrl = url.split("\\?");
            return assembleUrlWithId(unhandledUrl[0], data, method, isListUrl) + "?"
                    + unhandledUrl[1];
        }
        return assembleUrlWithId(url, data, method, isListUrl);
    }

    /**
     * Assemale or retrieve url from original http reqeust
     *
     * @param url       url of original http URL
     * @param data      JsonObject data
     * @param method    the http method
     * @param isListUrl boolean of this url is querying list or object
     * @return String the url with object Id
     * @throws URISyntaxException errors if the url is invalid
     */
    private static String assembleUrlWithId(String url, JsonObject data, String method,
            boolean isListUrl) throws URISyntaxException {
        Optional<JsonElement> href = Optional.ofNullable(data.get("href"));
        if (href.isPresent()) {
            String fromHref = href.get().getAsString();
            URI tempUrl = new URIBuilder(fromHref).build();
            return tempUrl.getPath();
        }
        Optional<JsonElement> id = Optional.ofNullable(data.get("id"));
        if (id.isPresent()) {
            Optional<JsonElement> dataOptional = Optional.ofNullable(data.get("type"));
            Optional<JsonElement> apiOptional = Optional.ofNullable(data.get("api"));
            String apiType = apiOptional.isPresent() ? apiOptional.get().getAsString() : "";
            String dataType = dataOptional.isPresent() ? dataOptional.get().getAsString() : "";
            if (apiType.equals("storage")) {
                URI tempUrl = new URIBuilder(url).build();
                String[] paths = tempUrl.getPath().split("/");
                return String.join("/", Arrays.asList(paths).subList(0, 4))
                        + String.format("/%s/%ss/%s", apiType, dataType, id.get().getAsString());
            }
            if (method.equals("POST") || isListUrl) {
                URI tempUrl = new URIBuilder(url).build();
                return tempUrl.getPath() + "/" + id.get().getAsString();
            }
        }
        return url;
    }
}


text:
import * as React from 'react';
import { Checkbox } from '../Checkbox/Checkbox';
import { Table, TableHeader, TableHeaderItem, TableRow, TableRowItem } from './Table';

import { mount } from 'enzyme';

describe('Table', () => {
	test('renders correctly', () => {
		const tree = mount(
			<Table>
				<TableHeader>
					<TableHeaderItem flex={2} justify="center">
						<Checkbox checked={false} onClickCheckbox={(e, data) => alert(`Clicked!: ${data.value}`)} />
					</TableHeaderItem>
					<TableHeaderItem flex={8}>Mailing list name</TableHeaderItem>
					<TableHeaderItem flex={3}>SEGMENTS</TableHeaderItem>
					<TableHeaderItem flex={3}>Change (last day)</TableHeaderItem>
					<TableHeaderItem flex={3}>Active recipients</TableHeaderItem>
					<TableHeaderItem flex={3}>Tags</TableHeaderItem>
					<TableHeaderItem flex={2} />
				</TableHeader>
				<TableRow>
					<TableRowItem flex={2} justify="center">
						<Checkbox fontColor="grey" checked={false} onClickCheckbox={(e, data) => alert(`Clicked!: ${data.value}`)} />
					</TableRowItem>
					<TableRowItem flex={8}>Main mailing list #1</TableRowItem>
					<TableRowItem flex={3}>2</TableRowItem>
					<TableRowItem flex={3}>+12</TableRowItem>
					<TableRowItem flex={3}>124,543</TableRowItem>
					<TableRowItem flex={3}>Tags component!</TableRowItem>
					<TableRowItem flex={2}>Actions</TableRowItem>
				</TableRow>
				<TableRow>
					<TableRowItem flex={2} justify="center">
						<Checkbox fontColor="grey" checked={false} onClickCheckbox={(e, data) => alert(`Clicked!: ${data.value}`)} />
					</TableRowItem>
					<TableRowItem flex={8}>Main mailing list #2</TableRowItem>
					<TableRowItem flex={3}>3</TableRowItem>
					<TableRowItem flex={3}>+7</TableRowItem>
					<TableRowItem flex={3}>80,000</TableRowItem>
					<TableRowItem flex={3}>Tags component!</TableRowItem>
					<TableRowItem flex={2}>Actions</TableRowItem>
				</TableRow>
			</Table>
		);

		expect(tree).toMatchSnapshot();
	});
});