text:
using System;
using System.Globalization;

namespace Xaye.Fred
{
    /// <summary>
    /// Utility methods.
    /// </summary>
    public static class Extensions
    {
        private const string DateFormat = "yyyy-MM-dd";
        private const string DateTimeFormat = "yyyy-MM-dd HH:mm:sszz";

        /// <summary>
        /// Converts a string to a FRED formated date string.
        /// </summary>
        /// <param name="date">The date to convert.</param>
        /// <returns>A FRED formatted date string.</returns>
        public static string ToFredDateString(this DateTime date)
        {
            return date.ToString(DateFormat);
        }

        /// <summary>
        /// Converts a FRED formatted date string to a DateTime.
        /// </summary>
        /// <param name="date">The date string to create the date from.</param>
        /// <returns>The converted date.</returns>
        public static DateTime ToFredDate(this string date)
        {
            return DateTime.ParseExact(date, DateFormat, CultureInfo.InvariantCulture);
        }

        /// <summary>
        /// Converts a FRED formatted date and time string to a DateTime.
        /// </summary>
        /// <param name="date">The date and time string to create the date from.</param>
        /// <returns>The converted date.</returns>
        public static DateTime ToFredDateTime(this string date)
        {
            return DateTime.ParseExact(date, DateTimeFormat, CultureInfo.InvariantCulture);
        }

        /// <summary>
        /// Creates a string to a <see cref="Frequency"/>.
        /// </summary>
        /// <param name="frequency">The string to convert.</param>
        /// <returns>The converted frequency.</returns>
        public static Frequency ToFrequency(this string frequency)
        {
            var ret = Frequency.None;

            if (frequency.Equals("d"))
            {
                ret = Frequency.Daily;
            }
            else if (frequency.Equals("w"))
            {
                ret = Frequency.Weekly;
            }
            else if (frequency.Equals("bw"))
            {
                ret = Frequency.BiWeekly;
            }
            else if (frequency.Equals("m"))
            {
                ret = Frequency.Monthly;
            }
            else if (frequency.Equals("q"))
            {
                ret = Frequency.Quarterly;
            }
            else if (frequency.Equals("sa"))
            {
                ret = Frequency.SemiAnnual;
            }
            else if (frequency.Equals("a"))
            {
                ret = Frequency.Annual;
            }
            else if (frequency.Equals("wef"))
            {
                ret = Frequency.WeeklyFriday;
            }
            else if (frequency.Equals("weth"))
            {
                ret = Frequency.WeeklyThursday;
            }
            else if (frequency.Equals("wew"))
            {
                ret = Frequency.WeeklyWednesday;
            }
            else if (frequency.Equals("wetu"))
            {
                ret = Frequency.WeeklyTuesday;
            }
            else if (frequency.Equals("wem"))
            {
                ret = Frequency.WeeklyMonday;
            }
            else if (frequency.Equals("bwew"))
            {
                ret = Frequency.BiWeeklyWednesday;
            }
            else if (frequency.Equals("bwem"))
            {
                ret = Frequency.BiWeeklyMonday;
            }

            return ret;
        }

        /// <summary>
        /// Converts a <see cref="Transformation"/> to a string.
        /// </summary>
        /// <param name="transformation">The transformation to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this Transformation transformation)
        {
            var ret = string.Empty;
            switch (transformation)
            {
                    case Transformation.None:
                    ret = "lin";
                    break;
                    case Transformation.Change:
                    ret = "chg";
                    break;
                    case Transformation.ChangeYear:
                    ret = "ch1";
                    break;
                    case Transformation.PercentChange:
                    ret = "pch";
                    break;
                    case Transformation.PercentChangeYear:
                    ret = "pc1";
                    break;
                    case Transformation.CompoundedAnnualRateChange:
                    ret = "pca";
                    break;
                    case Transformation.ContinuouslyCompoundedRateChange:
                    ret = "cch";
                    break;
                    case Transformation.ContinuouslyCompoundedAnnualRateChange:
                    ret = "cca";
                    break;
                    case Transformation.Log:
                    ret = "log";
                    break;
            }

            return ret;
        }

        /// <summary>
        /// Converts a <see cref="Frequency"/> to a string.
        /// </summary>
        /// <param name="frequency">The frequency to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this Frequency frequency)
        {
            var ret = "";
            switch (frequency)
            {
                case Frequency.Daily:
                    ret = "d";
                    break;
                case Frequency.Weekly:
                    ret = "w";
                    break;
                case Frequency.BiWeekly:
                    ret = "bw";
                    break;
                case Frequency.Monthly:
                    ret = "m";
                    break;
                case Frequency.Quarterly:
                    ret = "q";
                    break;
                case Frequency.SemiAnnual:
                    ret = "sa";
                    break;
                case Frequency.Annual:
                    ret = "a";
                    break;
                case Frequency.WeeklyFriday:
                    ret = "wef";
                    break;
                case Frequency.WeeklyThursday:
                    ret = "weth";
                    break;
                case Frequency.WeeklyWednesday:
                    ret = "wew";
                    break;
                case Frequency.WeeklyTuesday:
                    ret = "wetu";
                    break;
                case Frequency.WeeklyMonday:
                    ret = "wem";
                    break;
                case Frequency.BiWeeklyWednesday:
                    ret = "bwew";
                    break;
                case Frequency.BiWeeklyMonday:
                    ret = "bwem";
                    break;
            }
            return ret;
        }

        /// <summary>
        /// Converts a <see cref="SortOrder"/> to a string.
        /// </summary>
        /// <param name="order">The order to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(SortOrder order)
        {
            return order == SortOrder.Ascending ? "asc" : "desc";
        }

        /// <summary>
        /// Converts a <see cref="AggregationMethod"/> to a string.
        /// </summary>
        /// <param name="method">The aggregation method to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(AggregationMethod method)
        {
            var ret = "";
            switch (method)
            {
                    case AggregationMethod.Average:
                    ret = "avg";
                    break;
                    case AggregationMethod.Sum:
                    ret = "sum";
                    break;
                    case AggregationMethod.EndOfPeriod:
                    ret = "eop";
                    break;
            }
            return ret;
        }

        /// <summary>
        /// Converts a <see cref="OutputType"/> to a string.
        /// </summary>
        /// <param name="type">The output type to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this OutputType type)
        {
            var ret = "";
            switch (type)
            {
                case OutputType.RealTime:
                    ret = "1";
                    break;
                case OutputType.VintageAll:
                    ret = "2";
                    break;
                case OutputType.VintageNewRevised:
                    ret = "3";
                    break;
                case OutputType.IntialReleaseOnly:
                    ret = "4";
                    break;
            }
            return ret;
        }

        /// <summary>
        /// Converts a <see cref="FileType"/> to a string.
        /// </summary>
        /// <param name="type">The file type to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this FileType type)
        {
            var ret = "";
            switch (type)
            {
                case FileType.Xml:
                    ret = "xml";
                    break;
                case FileType.Text:
                    ret = "txt";
                    break;
                case FileType.Xls:
                    ret = "xls";
                    break;
                case FileType.Json:
                    ret = "json";
                    break;
            }
            return ret;
        }

        /// <summary>
        /// Converts a <see cref="SearchType"/> to a string.
        /// </summary>
        /// <param name="type">The search type to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this SearchType type)
        {
            var ret = String.Empty;
            switch (type)
            {
                case SearchType.FullText:
                    ret = "full_text";
                    break;
                case SearchType.SeriesId:
                    ret = "series_id";
                    break;
            }
            return ret;
        }

        /// <summary>
        /// Converts a <see cref="Series.FilterBy"/> to a string.
        /// </summary>
        /// <param name="filterBy">The Series.FilterBy to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this Series.FilterBy filterBy)
        {
            var filter = String.Empty;
            switch (filterBy)
            {
                case Series.FilterBy.Frequency:
                    filter = "frequency";
                    break;
                case Series.FilterBy.SeasonalAdjustment:
                    filter = "seasonal_adjustment";
                    break;
                case Series.FilterBy.Units:
                    filter = "units";
                    break;
            }

            return filter;
        }

        /// <summary>
        /// Converts a <see cref="Series.UpdateFilterBy"/> to a string.
        /// </summary>
        /// <param name="filterBy">The Series.UpdateFilterBy to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this Series.UpdateFilterBy filterBy)
        {
            var filter = "all";
            switch (filterBy)
            {
                case Series.UpdateFilterBy.Macro:
                    filter = "macro";
                    break;
                case Series.UpdateFilterBy.Regional:
                    filter = "regional";
                    break;
            }

            return filter;
        }

        /// <summary>
        /// Converts a <see cref="Series.OrderBy"/> to a string.
        /// </summary>
        /// <param name="orderBy">The Series.OrderBy to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this Series.OrderBy orderBy)
        {
            var order = String.Empty;
            switch (orderBy)
            {
                case Series.OrderBy.SeriesId:
                    order = "series_id";
                    break;
                case Series.OrderBy.Title:
                    order = "title";
                    break;
                case Series.OrderBy.Units:
                    order = "units";
                    break;
                case Series.OrderBy.Frequency:
                    order = "frequency";
                    break;
                case Series.OrderBy.SeasonalAdjustment:
                    order = "seasonal_adjustment";
                    break;
                case Series.OrderBy.RealtimeStart:
                    order = "realtime_start";
                    break;
                case Series.OrderBy.RealtimeEnd:
                    order = "realtime_end";
                    break;
                case Series.OrderBy.LastUpdated:
                    order = "last_updated";
                    break;
                case Series.OrderBy.ObservationStart:
                    order = "observation_start";
                    break;
                case Series.OrderBy.ObservationEnd:
                    order = "observation_end";
                    break;
                case Series.OrderBy.Popularity:
                    order = "popularity";
                    break;
                case Series.OrderBy.SearchRank:
                    order = "search_rank";
                    break;
            }
            return order;
        }

        /// <summary>
        /// Converts a <see cref="Release.OrderBy"/> to a string.
        /// </summary>
        /// <param name="orderBy">The Release.OrderBy to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(this Release.OrderBy orderBy)
        {
            var order = String.Empty;
            switch (orderBy)
            {
                case Release.OrderBy.ReleaseId:
                    order = "release_id";
                    break;
                case Release.OrderBy.Name:
                    order = "name";
                    break;
                case Release.OrderBy.PressRelease:
                    order = "press_release";
                    break;
                case Release.OrderBy.RealtimeStart:
                    order = "realtime_start";
                    break;
                case Release.OrderBy.RealtimeEnd:
                    order = "realtime_end";
                    break;
            }
            return order;
        }

        /// <summary>
        /// Converts a <see cref="Source.OrderBy"/> to a string.
        /// </summary>
        /// <param name="orderBy">The Source.OrderBy to convert.</param>
        /// <returns>The converted string.</returns>
        public static string ToString(Source.OrderBy orderBy)
        {
            var order = string.Empty;
            switch (orderBy)
            {
                case Source.OrderBy.SourceId:
                    order = "source_id";
                    break;
                case Source.OrderBy.Name:
                    order = "name";
                    break;
                case Source.OrderBy.RealtimeStart:
                    order = "realtime_start";
                    break;
                case Source.OrderBy.RealtimeEnd:
                    order = "realtime_end";
                    break;
            }
            return order;
        }
    }
}


text:
Ensembl.Panel.RegButtons = Ensembl.Panel.Content.extend({
  constructor: function (id, params) {
    this.base(id, params);
    Ensembl.EventManager.register('partialReload', this, this.partialReload);
  },

  partialReload: function() {
    Ensembl.EventManager.triggerSpecific('updatePanel',this.id,null,null,null,null,{ background: true });
  }
});

redpajama_set_name: RedPajamaGithub


text:
set -e

# Use empty macstrap config as we want to test macstrap and not the installation of the brew packages
rm -rf ~/.macstrap/macstrap.cfg
cp ~/.macstrap/test/macstrap-test.cfg ~/.macstrap/macstrap.cfg

# List all preinstalled brew packages on Travis CI
brew deps --include-build --tree $(brew leaves)

# Uninstall preinstalled brew packages from Travis CI
brew uninstall postgis
brew uninstall postgres

# Start with the installation
macstrap install


text:
module ActiveDecorator
  module Monkey
    module ActionController
      module Base
        def rescue_with_handler(*)
          ActiveDecorator::ViewContext.push(view_context)
          super
        ensure
          ActiveDecorator::ViewContext.pop
        end
      end
    end
  end
end


text:
package io.katamari.handler;

import io.netty.channel.ChannelHandlerContext;

import io.katamari.Env;
import io.katamari.handler.InboundMessageHandler;

public class HelloWorld extends InboundMessageHandler {
  @Override
  public void messageReceived(ChannelHandlerContext ctx, Env env) throws Exception {
    env.getResponse().end("Hello World");
  }
}


text:
use prototipo_db;
--- PROBLEMA 1 ---
insert into problemas_solucoes values (1,1);
insert into problemas_solucoes values (1,2);
insert into problemas_solucoes values (1,3);
insert into problemas_solucoes values (1,4);
insert into problemas_solucoes values (1,6);
insert into problemas_solucoes values (1,7);
insert into problemas_solucoes values (1,10);
insert into problemas_solucoes values (1,11);
insert into problemas_solucoes values (1,13);
insert into problemas_solucoes values (1,24);
insert into problemas_solucoes values (1,25);
insert into problemas_solucoes values (1,26);
insert into problemas_solucoes values (1,33);
insert into problemas_solucoes values (1,35);
insert into problemas_solucoes values (1,37);
insert into problemas_solucoes values (1,38);
insert into problemas_solucoes values (1,39);
insert into problemas_solucoes values (1,40);
insert into problemas_solucoes values (1,41);

--- PROBLEMA 2 ---
insert into problemas_solucoes values (2,1);
insert into problemas_solucoes values (2,2);
insert into problemas_solucoes values (2,3);
insert into problemas_solucoes values (2,4);
insert into problemas_solucoes values (2,8);
insert into problemas_solucoes values (2,10);
insert into problemas_solucoes values (2,12);
insert into problemas_solucoes values (2,13);
insert into problemas_solucoes values (2,16);
insert into problemas_solucoes values (2,24);
insert into problemas_solucoes values (2,25);
insert into problemas_solucoes values (2,26);
insert into problemas_solucoes values (2,35);
insert into problemas_solucoes values (2,37);
insert into problemas_solucoes values (2,38);
insert into problemas_solucoes values (2,39);
insert into problemas_solucoes values (2,40);
insert into problemas_solucoes values (2,41);

--- PROBLEMA 3 ---
insert into problemas_solucoes values (3,1);
insert into problemas_solucoes values (3,2);
insert into problemas_solucoes values (3,3);
insert into problemas_solucoes values (3,4);
insert into problemas_solucoes values (3,5);
insert into problemas_solucoes values (3,6);
insert into problemas_solucoes values (3,7);
insert into problemas_solucoes values (3,8);
insert into problemas_solucoes values (3,9);
insert into problemas_solucoes values (3,10);
insert into problemas_solucoes values (3,11);
insert into problemas_solucoes values (3,13);
insert into problemas_solucoes values (3,16);
insert into problemas_solucoes values (3,24);
insert into problemas_solucoes values (3,26);
insert into problemas_solucoes values (3,27);
insert into problemas_solucoes values (3,29);
insert into problemas_solucoes values (3,32);
insert into problemas_solucoes values (3,37);
insert into problemas_solucoes values (3,38);
insert into problemas_solucoes values (3,39);
insert into problemas_solucoes values (3,40);
insert into problemas_solucoes values (3,41);

--- PROBLEMA 4 ---
insert into problemas_solucoes values (4,3);

--- PROBLEMA 5 ---
insert into problemas_solucoes values (5,2);
insert into problemas_solucoes values (5,4);
insert into problemas_solucoes values (5,8);
insert into problemas_solucoes values (5,12);
insert into problemas_solucoes values (5,13);
insert into problemas_solucoes values (5,24);
insert into problemas_solucoes values (5,25);
insert into problemas_solucoes values (5,26);
insert into problemas_solucoes values (5,37);
insert into problemas_solucoes values (5,38);

--- PROBLEMA 6 ---
insert into problemas_solucoes values (6,2);
insert into problemas_solucoes values (6,4);
insert into problemas_solucoes values (6,8);
insert into problemas_solucoes values (6,12);
insert into problemas_solucoes values (6,13);
insert into problemas_solucoes values (6,24);
insert into problemas_solucoes values (6,25);
insert into problemas_solucoes values (6,26);
insert into problemas_solucoes values (6,37);
insert into problemas_solucoes values (6,38);

--- PROBLEMA 7 ---
insert into problemas_solucoes values (7,1);
insert into problemas_solucoes values (7,2);
insert into problemas_solucoes values (7,3);
insert into problemas_solucoes values (7,4);
insert into problemas_solucoes values (7,8);
insert into problemas_solucoes values (7,10);
insert into problemas_solucoes values (7,12);
insert into problemas_solucoes values (7,13);
insert into problemas_solucoes values (7,24);
insert into problemas_solucoes values (7,25);
insert into problemas_solucoes values (7,26);
insert into problemas_solucoes values (7,35);
insert into problemas_solucoes values (7,37);
insert into problemas_solucoes values (7,38);
insert into problemas_solucoes values (7,39);
insert into problemas_solucoes values (7,40);
insert into problemas_solucoes values (7,41);

--- PROBLEMA 8 ---
insert into problemas_solucoes values (8,2);
insert into problemas_solucoes values (8,4);
insert into problemas_solucoes values (8,8);
insert into problemas_solucoes values (8,11);
insert into problemas_solucoes values (8,13);
insert into problemas_solucoes values (8,24);
insert into problemas_solucoes values (8,25);
insert into problemas_solucoes values (8,26);
insert into problemas_solucoes values (8,35);
insert into problemas_solucoes values (8,37);
insert into problemas_solucoes values (8,38);
insert into problemas_solucoes values (8,39);
insert into problemas_solucoes values (8,40);
insert into problemas_solucoes values (8,41);

--- PROBLEMA 9 ---
insert into problemas_solucoes values (9,2);
insert into problemas_solucoes values (9,4);
insert into problemas_solucoes values (9,5);
insert into problemas_solucoes values (9,8);
insert into problemas_solucoes values (9,11);
insert into problemas_solucoes values (9,12);
insert into problemas_solucoes values (9,13);
insert into problemas_solucoes values (9,24);
insert into problemas_solucoes values (9,25);
insert into problemas_solucoes values (9,26);
insert into problemas_solucoes values (9,27);
insert into problemas_solucoes values (9,35);
insert into problemas_solucoes values (9,37);
insert into problemas_solucoes values (9,38);
insert into problemas_solucoes values (9,39);
insert into problemas_solucoes values (9,40);
insert into problemas_solucoes values (9,41);

--- PROBLEMA 10 ---
insert into problemas_solucoes values (10,4);
insert into problemas_solucoes values (10,5);
insert into problemas_solucoes values (10,8);
insert into problemas_solucoes values (10,10);
insert into problemas_solucoes values (10,11);
insert into problemas_solucoes values (10,12);
insert into problemas_solucoes values (10,13);
insert into problemas_solucoes values (10,24);
insert into problemas_solucoes values (10,25);
insert into problemas_solucoes values (10,26);
insert into problemas_solucoes values (10,27);
insert into problemas_solucoes values (10,32);
insert into problemas_solucoes values (10,35);
insert into problemas_solucoes values (10,37);
insert into problemas_solucoes values (10,38);
insert into problemas_solucoes values (10,39);
insert into problemas_solucoes values (10,40);
insert into problemas_solucoes values (10,41);

--- PROBLEMA 11 ---
insert into problemas_solucoes values (11,5);
insert into problemas_solucoes values (11,8);
insert into problemas_solucoes values (11,9);
insert into problemas_solucoes values (11,11);
insert into problemas_solucoes values (11,21);
insert into problemas_solucoes values (11,27);
insert into problemas_solucoes values (11,29);

--- PROBLEMA 12 ---
insert into problemas_solucoes values (12,4);
insert into problemas_solucoes values (12,8);
insert into problemas_solucoes values (12,26);
insert into problemas_solucoes values (12,30);
insert into problemas_solucoes values (12,41);

--- PROBLEMA 13 ---
insert into problemas_solucoes values (13,4);
insert into problemas_solucoes values (13,13);
insert into problemas_solucoes values (13,24);
insert into problemas_solucoes values (13,26);
insert into problemas_solucoes values (13,35);
insert into problemas_solucoes values (13,36);
insert into problemas_solucoes values (13,41);
insert into problemas_solucoes values (13,49);

--- PROBLEMA 14 ---
insert into problemas_solucoes values (14,4);
insert into problemas_solucoes values (14,14);
insert into problemas_solucoes values (14,26);
insert into problemas_solucoes values (14,29);
insert into problemas_solucoes values (14,33);
insert into problemas_solucoes values (14,35);
insert into problemas_solucoes values (14,36);
insert into problemas_solucoes values (14,42);
insert into problemas_solucoes values (14,43);
insert into problemas_solucoes values (14,44);
insert into problemas_solucoes values (14,45);
insert into problemas_solucoes values (14,46);
insert into problemas_solucoes values (14,47);
insert into problemas_solucoes values (14,49);

--- PROBLEMA 15 ---
insert into problemas_solucoes values (15,7);
insert into problemas_solucoes values (15,29);
insert into problemas_solucoes values (15,49);

--- PROBLEMA 16 ---
insert into problemas_solucoes values (16,1);
insert into problemas_solucoes values (16,2);
insert into problemas_solucoes values (16,3);
insert into problemas_solucoes values (16,6);
insert into problemas_solucoes values (16,7);
insert into problemas_solucoes values (16,8);
insert into problemas_solucoes values (16,9);
insert into problemas_solucoes values (16,12);
insert into problemas_solucoes values (16,13);
insert into problemas_solucoes values (16,24);
insert into problemas_solucoes values (16,25);
insert into problemas_solucoes values (16,33);
insert into problemas_solucoes values (16,41);

--- PROBLEMA 17 ---
insert into problemas_solucoes values (17,4);
insert into problemas_solucoes values (17,5);
insert into problemas_solucoes values (17,6);
insert into problemas_solucoes values (17,8);
insert into problemas_solucoes values (17,9);
insert into problemas_solucoes values (17,10);
insert into problemas_solucoes values (17,11);
insert into problemas_solucoes values (17,12);
insert into problemas_solucoes values (17,13);
insert into problemas_solucoes values (17,15);
insert into problemas_solucoes values (17,24);
insert into problemas_solucoes values (17,25);
insert into problemas_solucoes values (17,27);
insert into problemas_solucoes values (17,32);
insert into problemas_solucoes values (17,33);
insert into problemas_solucoes values (17,39);
insert into problemas_solucoes values (17,40);
insert into problemas_solucoes values (17,41);
insert into problemas_solucoes values (17,48);
insert into problemas_solucoes values (17,49);

--- PROBLEMA 18 ---
insert into problemas_solucoes values (18,7);
insert into problemas_solucoes values (18,29);
insert into problemas_solucoes values (18,49);

--- PROBLEMA 19 ---
insert into problemas_solucoes values (19,23);

--- PROBLEMA 20 ---
insert into problemas_solucoes values (20,22);

--- PROBLEMA 21 ---
insert into problemas_solucoes values (21,6);
insert into problemas_solucoes values (21,33);

--- PROBLEMA 22 ---
insert into problemas_solucoes values (22,7);
insert into problemas_solucoes values (22,29);

--- PROBLEMA 23 ---
insert into problemas_solucoes values (23,5);
insert into problemas_solucoes values (23,9);
insert into problemas_solucoes values (23,10);
insert into problemas_solucoes values (23,11);
insert into problemas_solucoes values (23,14);
insert into problemas_solucoes values (23,23);
insert into problemas_solucoes values (23,27);
insert into problemas_solucoes values (23,28);
insert into problemas_solucoes values (23,31);
insert into problemas_solucoes values (23,34);
insert into problemas_solucoes values (23,35);
insert into problemas_solucoes values (23,37);
insert into problemas_solucoes values (23,38);
insert into problemas_solucoes values (23,41);

--- PROBLEMA 24 ---
insert into problemas_solucoes values (24,10);
insert into problemas_solucoes values (24,12);
insert into problemas_solucoes values (24,13);
insert into problemas_solucoes values (24,15);
insert into problemas_solucoes values (24,17);
insert into problemas_solucoes values (24,24);
insert into problemas_solucoes values (24,33);

--- PROBLEMA 25 ---
insert into problemas_solucoes values (25,5);
insert into problemas_solucoes values (25,10);
insert into problemas_solucoes values (25,12);
insert into problemas_solucoes values (25,15);
insert into problemas_solucoes values (25,20);
insert into problemas_solucoes values (25,21);
insert into problemas_solucoes values (25,27);
insert into problemas_solucoes values (25,31);
insert into problemas_solucoes values (25,32);
insert into problemas_solucoes values (25,34);
insert into problemas_solucoes values (25,41);

--- PROBLEMA 26 ---
insert into problemas_solucoes values (26,2);
insert into problemas_solucoes values (26,7);
insert into problemas_solucoes values (26,29);
insert into problemas_solucoes values (26,30);
insert into problemas_solucoes values (26,41);
insert into problemas_solucoes values (26,49);

--- PROBLEMA 27 ---
insert into problemas_solucoes values (27,18);
insert into problemas_solucoes values (27,19);
insert into problemas_solucoes values (27,20);
insert into problemas_solucoes values (27,36);

--- PROBLEMA 28 ---
insert into problemas_solucoes values (28,18);
insert into problemas_solucoes values (28,19);
insert into problemas_solucoes values (28,36);

--- PROBLEMA 29 ---
insert into problemas_solucoes values (29,19);
insert into problemas_solucoes values (29,36);

--- PROBLEMA 30 ---
insert into problemas_solucoes values (30,17);
insert into problemas_solucoes values (30,36);

--- PROBLEMA 31 ---
insert into problemas_solucoes values (31,20);
insert into problemas_solucoes values (31,21);
insert into problemas_solucoes values (31,36);

--- PROBLEMA 32 ---
insert into problemas_solucoes values (32,1);
insert into problemas_solucoes values (32,2);
insert into problemas_solucoes values (32,3);
insert into problemas_solucoes values (32,4);
insert into problemas_solucoes values (32,5);
insert into problemas_solucoes values (32,7);
insert into problemas_solucoes values (32,8);
insert into problemas_solucoes values (32,10);
insert into problemas_solucoes values (32,13);
insert into problemas_solucoes values (32,24);
insert into problemas_solucoes values (32,25);
insert into problemas_solucoes values (32,26);
insert into problemas_solucoes values (32,27);
insert into problemas_solucoes values (32,30);
insert into problemas_solucoes values (32,35);
insert into problemas_solucoes values (32,37);
insert into problemas_solucoes values (32,38);
insert into problemas_solucoes values (32,41);

--- PROBLEMA 33 ---
insert into problemas_solucoes values (33,20);
insert into problemas_solucoes values (33,21);
insert into problemas_solucoes values (33,36);

--- PROBLEMA 34 ---
insert into problemas_solucoes values (34,2);

--- PROBLEMA 35 ---
insert into problemas_solucoes values (35,20);
insert into problemas_solucoes values (35,21);
insert into problemas_solucoes values (35,36);


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~
  ~   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.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.streams</groupId>
        <artifactId>streams-project</artifactId>
        <version>0.2-incubating-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>streams-pojo-extensions</artifactId>

    <name>streams-pojo-extensions</name>

    <description>Support for adding and modifying extension properties</description>

    <dependencies>

        <dependency>
            <groupId>org.apache.streams</groupId>
            <artifactId>streams-pojo</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>

    </build>
</project>


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars
{
    /// <summary>
    /// The Regex and Json parsers wants to work over an array of characters, however this array of
    /// characters is not the same as the array of characters a user types into a string in C# or
    /// VB. For example In C# someone may write: @"\z".  This should appear to the user the same as
    /// if they wrote "\\z" and the same as "\\\u007a".  However, as these all have wildly different
    /// presentations for the user, there needs to be a way to map back the characters it sees ( '\'
    /// and 'z' ) back to the  ranges of characters the user wrote.
    ///
    /// VirtualChar serves this purpose.  It contains the interpreted value of any language
    /// character/character-escape-sequence, as well as the original SourceText span where that
    /// interpreted character was created from.  This allows the regex and json parsers to both
    /// process input from any language uniformly, but then also produce trees and diagnostics that
    /// map back properly to the original source text locations that make sense to the user.
    /// </summary>
    internal readonly struct VirtualChar : IEquatable<VirtualChar>
    {
        public readonly char Char;
        public readonly TextSpan Span;

        public VirtualChar(char @char, TextSpan span)
        {
            if (span.IsEmpty)
            {
                throw new ArgumentException("Span should not be empty.", nameof(span));
            }

            Char = @char;
            Span = span;
        }

        public override bool Equals(object obj)
            => obj is VirtualChar vc && Equals(vc);

        public bool Equals(VirtualChar other)
            => Char == other.Char &&
               Span == other.Span;

        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = 244102310;
                hashCode = hashCode * -1521134295 + Char.GetHashCode();
                hashCode = hashCode * -1521134295 + Span.GetHashCode();
                return hashCode;
            }
        }

        public static bool operator ==(VirtualChar char1, VirtualChar char2)
            => char1.Equals(char2);

        public static bool operator !=(VirtualChar char1, VirtualChar char2)
            => !(char1 == char2);

        public static implicit operator char(VirtualChar vc) => vc.Char;
    }
}


text:
#include "tensorflow/core/framework/device_factory.h"

#include <memory>
#include <string>
#include <unordered_map>
#include <vector>

#include "absl/container/flat_hash_set.h"
#include "tensorflow/core/framework/device.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/errors.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/public/session_options.h"
#include "tensorflow/core/util/device_name_utils.h"
#include "tensorflow/core/util/env_var.h"

namespace tensorflow {

namespace {

static mutex* get_device_factory_lock() {
  static mutex device_factory_lock(LINKER_INITIALIZED);
  return &device_factory_lock;
}

struct FactoryItem {
  std::unique_ptr<DeviceFactory> factory;
  int priority;
  bool is_pluggable_device;
};

std::unordered_map<string, FactoryItem>& device_factories() {
  static std::unordered_map<string, FactoryItem>* factories =
      new std::unordered_map<string, FactoryItem>;
  return *factories;
}

bool IsDeviceFactoryEnabled(const string& device_type) {
  std::vector<string> enabled_devices;
  TF_CHECK_OK(tensorflow::ReadStringsFromEnvVar(
      /*env_var_name=*/"TF_ENABLED_DEVICE_TYPES", /*default_val=*/"",
      &enabled_devices));
  if (enabled_devices.empty()) {
    return true;
  }
  return std::find(enabled_devices.begin(), enabled_devices.end(),
                   device_type) != enabled_devices.end();
}
}  // namespace

// static
int32 DeviceFactory::DevicePriority(const string& device_type) {
  tf_shared_lock l(*get_device_factory_lock());
  std::unordered_map<string, FactoryItem>& factories = device_factories();
  auto iter = factories.find(device_type);
  if (iter != factories.end()) {
    return iter->second.priority;
  }

  return -1;
}

bool DeviceFactory::IsPluggableDevice(const string& device_type) {
  tf_shared_lock l(*get_device_factory_lock());
  std::unordered_map<string, FactoryItem>& factories = device_factories();
  auto iter = factories.find(device_type);
  if (iter != factories.end()) {
    return iter->second.is_pluggable_device;
  }
  return false;
}

// static
void DeviceFactory::Register(const string& device_type,
                             std::unique_ptr<DeviceFactory> factory,
                             int priority, bool is_pluggable_device) {
  if (!IsDeviceFactoryEnabled(device_type)) {
    LOG(INFO) << "Device factory '" << device_type << "' disabled by "
              << "TF_ENABLED_DEVICE_TYPES environment variable.";
    return;
  }
  mutex_lock l(*get_device_factory_lock());
  std::unordered_map<string, FactoryItem>& factories = device_factories();
  auto iter = factories.find(device_type);
  if (iter == factories.end()) {
    factories[device_type] = {std::move(factory), priority,
                              is_pluggable_device};
  } else {
    if (iter->second.priority < priority) {
      iter->second = {std::move(factory), priority, is_pluggable_device};
    } else if (iter->second.priority == priority) {
      LOG(FATAL) << "Duplicate registration of device factory for type "
                 << device_type << " with the same priority " << priority;
    }
  }
}

DeviceFactory* DeviceFactory::GetFactory(const string& device_type) {
  tf_shared_lock l(*get_device_factory_lock());
  auto it = device_factories().find(device_type);
  if (it == device_factories().end()) {
    return nullptr;
  } else if (!IsDeviceFactoryEnabled(device_type)) {
    LOG(FATAL) << "Device type " << device_type  // Crash OK
               << " had factory registered but was explicitly disabled by "
               << "`TF_ENABLED_DEVICE_TYPES`. This environment variable needs "
               << "to be set at program startup.";
  }
  return it->second.factory.get();
}

Status DeviceFactory::ListAllPhysicalDevices(std::vector<string>* devices) {
  // CPU first. A CPU device is required.
  // TODO(b/183974121): Consider merge the logic into the loop below.
  auto cpu_factory = GetFactory("CPU");
  if (!cpu_factory) {
    return errors::NotFound(
        "CPU Factory not registered. Did you link in threadpool_device?");
  }

  size_t init_size = devices->size();
  TF_RETURN_IF_ERROR(cpu_factory->ListPhysicalDevices(devices));
  if (devices->size() == init_size) {
    return errors::NotFound("No CPU devices are available in this process");
  }

  // Then the rest (including GPU).
  tf_shared_lock l(*get_device_factory_lock());
  for (auto& p : device_factories()) {
    auto factory = p.second.factory.get();
    if (factory != cpu_factory) {
      TF_RETURN_IF_ERROR(factory->ListPhysicalDevices(devices));
    }
  }

  return OkStatus();
}

Status DeviceFactory::ListPluggablePhysicalDevices(
    std::vector<string>* devices) {
  tf_shared_lock l(*get_device_factory_lock());
  for (auto& p : device_factories()) {
    if (p.second.is_pluggable_device) {
      auto factory = p.second.factory.get();
      TF_RETURN_IF_ERROR(factory->ListPhysicalDevices(devices));
    }
  }
  return OkStatus();
}

Status DeviceFactory::GetAnyDeviceDetails(
    int device_index, std::unordered_map<string, string>* details) {
  if (device_index < 0) {
    return errors::InvalidArgument("Device index out of bounds: ",
                                   device_index);
  }
  const int orig_device_index = device_index;

  // Iterate over devices in the same way as in ListAllPhysicalDevices.
  auto cpu_factory = GetFactory("CPU");
  if (!cpu_factory) {
    return errors::NotFound(
        "CPU Factory not registered. Did you link in threadpool_device?");
  }

  // TODO(b/183974121): Consider merge the logic into the loop below.
  std::vector<string> devices;
  TF_RETURN_IF_ERROR(cpu_factory->ListPhysicalDevices(&devices));
  if (device_index < devices.size()) {
    return cpu_factory->GetDeviceDetails(device_index, details);
  }
  device_index -= devices.size();

  // Then the rest (including GPU).
  tf_shared_lock l(*get_device_factory_lock());
  for (auto& p : device_factories()) {
    auto factory = p.second.factory.get();
    if (factory != cpu_factory) {
      devices.clear();
      // TODO(b/146009447): Find the factory size without having to allocate a
      // vector with all the physical devices.
      TF_RETURN_IF_ERROR(factory->ListPhysicalDevices(&devices));
      if (device_index < devices.size()) {
        return factory->GetDeviceDetails(device_index, details);
      }
      device_index -= devices.size();
    }
  }

  return errors::InvalidArgument("Device index out of bounds: ",
                                 orig_device_index);
}

Status DeviceFactory::AddCpuDevices(
    const SessionOptions& options, const string& name_prefix,
    std::vector<std::unique_ptr<Device>>* devices) {
  auto cpu_factory = GetFactory("CPU");
  if (!cpu_factory) {
    return errors::NotFound(
        "CPU Factory not registered. Did you link in threadpool_device?");
  }
  size_t init_size = devices->size();
  TF_RETURN_IF_ERROR(cpu_factory->CreateDevices(options, name_prefix, devices));
  if (devices->size() == init_size) {
    return errors::NotFound("No CPU devices are available in this process");
  }

  return OkStatus();
}

Status DeviceFactory::AddDevices(
    const SessionOptions& options, const string& name_prefix,
    std::vector<std::unique_ptr<Device>>* devices) {
  // CPU first. A CPU device is required.
  // TODO(b/183974121): Consider merge the logic into the loop below.
  TF_RETURN_IF_ERROR(AddCpuDevices(options, name_prefix, devices));

  absl::flat_hash_set<std::string> allowed_device_types;
  for (const auto& device_filter : options.config.device_filters()) {
    DeviceNameUtils::ParsedName parsed;
    if (!DeviceNameUtils::ParseFullOrLocalName(device_filter, &parsed)) {
      return errors::InvalidArgument(
          absl::StrCat("Invalid device filter: ", device_filter));
    }
    if (parsed.has_type) {
      allowed_device_types.insert(parsed.type);
    }
  }

  auto cpu_factory = GetFactory("CPU");
  // Then the rest (including GPU).
  mutex_lock l(*get_device_factory_lock());
  for (auto& p : device_factories()) {
    if (!allowed_device_types.empty() &&
        !allowed_device_types.contains(p.first)) {
      continue;  // Skip if the device type is not found from the device filter.
    }
    auto factory = p.second.factory.get();
    if (factory != cpu_factory) {
      TF_RETURN_IF_ERROR(factory->CreateDevices(options, name_prefix, devices));
    }
  }

  return OkStatus();
}

std::unique_ptr<Device> DeviceFactory::NewDevice(const string& type,
                                                 const SessionOptions& options,
                                                 const string& name_prefix) {
  auto device_factory = GetFactory(type);
  if (!device_factory) {
    return nullptr;
  }
  SessionOptions opt = options;
  (*opt.config.mutable_device_count())[type] = 1;
  std::vector<std::unique_ptr<Device>> devices;
  TF_CHECK_OK(device_factory->CreateDevices(opt, name_prefix, &devices));
  int expected_num_devices = 1;
  auto iter = options.config.device_count().find(type);
  if (iter != options.config.device_count().end()) {
    expected_num_devices = iter->second;
  }
  DCHECK_EQ(devices.size(), static_cast<size_t>(expected_num_devices));
  return std::move(devices[0]);
}

}  // namespace tensorflow


text:
$(document).ready(function(){

  $('[rel=tooltip]').tooltip();

  $('.lhs-holder').css('height', $(window).height() - 71 );
  $('.inner-nav').css('height', $(window).height() - 126 );
  $('.object-area').css('height', $(window).height() - 172 );
  $('.object-area').css('width', $(window).width() - 248 );
  $('.object-area.wide').css('width', $(window).width() - 48 );

  $('input[name=notify-digest]').parent().on('click', function(ev){
    ev.stopPropagation();
  });

  $('body').on('click', '.info-expand a', function() {
    var $this = $(this),
        $show_hide = $this.closest('.row-fluid').next('.hidden-fields-area');

    if($this.hasClass("active")) {
      $show_hide.slideUp('fast');
      $this.removeClass("active");
    } else {
      $show_hide.slideDown('fast');
      $this.addClass("active");
    }

    return false;

  });

  $('body').on('click', '.expand-link a', function() {
    var $this = $(this),
        $show_hide = $this.closest('.row-fluid').next('.hidden-fields-area');

    if($this.hasClass("active")) {
      $show_hide.slideUp('fast');
      $this.removeClass("active");
    } else {
      $show_hide.slideDown('fast');
      $this.addClass("active");
    }

    return false;

  });

  $('body').on('click', 'ul.tree-structure .item-main .grcobject, ul.tree-structure .item-main .openclose', function(e) {
    openclose.call(this);
    e.stopPropagation();
  });
  $.fn.openclose = openclose;
  function openclose(command) {
    var $that = $(this)
    , use_slide = $that.length < 100

    $that.each(function(){
      var $this = $(this)
        , $main = $this.closest('.item-main')
        , $li = $main.closest('li')
        , $content = $li.children('.item-content')
        , $icon = $main.find('.openclose')
        , $parentTree = $this.closest('ul.new-tree')
        , cmd = command;

      if(typeof cmd !== "string" || cmd === "toggle") {
        cmd = $icon.hasClass("active") ? "close" : "open";
      }

      if (cmd === "close") {

        use_slide ? $content.slideUp(50) : $content.css("display", "none");
        $icon.removeClass('active');
        $li.removeClass('item-open');
        // Only remove tree open if there are no open siblings
        !$li.siblings('.item-open').length && $parentTree.removeClass('tree-open');
        $content.removeClass('content-open');
      } else if(cmd === "open") {
        use_slide ? $content.slideDown(50) : $content.css("display", "block");
        $icon.addClass('active');
        $li.addClass('item-open');
        $parentTree.addClass('tree-open');
        $content.addClass('content-open');
      }
    });

    return this;

  }

  $.fn.openclose = openclose;

  $('body').on('click', '.advanced-filter-trigger', function() {
    var $this = $(this),
        $filters = $this.closest('.inner-tree').find('.advanced-filters');

    if($this.hasClass("active")) {
      $filters.slideUp('fast');
      $this.removeClass("active");
      $this.html(' Show Filters');
    } else {
      $filters.slideDown('fast');
      $this.addClass("active");
      $this.html(' Hide Filters');
    }

    return false;

  });

  $('.autogenerate').change(function(){
    $('.autogenerate-result').toggleClass('active', $(this).val() == 'control');
  });

  $('body').on('click', '.accordion-group > a', function() {
    var $this = $(this),
        $subNav = $this.closest('.accordion-group').find('.sub-level'),
        $subAction = $this.closest('.accordion-group').find('.sub-actions');

    if($this.hasClass("active")) {
      $subNav.slideUp('fast');
      $subAction.slideUp('fast');
      $this.removeClass("active");
    } else {
      $subNav.slideDown('fast');
      $subAction.slideDown('fast');
      $this.addClass("active");
    }

    return false;

  });

  $('body').on('click', '.inner-accordion-group > a', function() {
    var $this = $(this),
        $subNav = $this.closest('.inner-accordion-group').find('.lhn-items-list'),
        $subAction = $this.closest('.inner-accordion-group').find('.lhn-items-list-actions');

    if($this.hasClass("active")) {
      $this.removeClass("active");
      $subNav.slideUp('fast');
      $subAction.slideUp('fast');
    } else {
      $this.addClass("active");
      $subNav.slideDown('fast');
      $subAction.slideDown('fast');
    }

    return false;

  });

  $('body').on('click', '.accordion-group-inner > .arrow', function() {
    var $this = $(this),
        $subNav = $this.closest('.accordion-group-inner').find('.sub-level');

    if($this.hasClass("active")) {
      $subNav.slideUp('fast');
      $this.removeClass("active");
    } else {
      $subNav.slideDown('fast');
      $this.addClass("active");
    }

    return false

  });

  $( ".date" ).datepicker();

  $(function() {
    var people = [
      "Vladan Mitevski",
      "Predrag Kanazir",
      "Dan Ring",
      "Silas Barta",
      "Cassius Clay"
    ];
    var program = [
      "Google Fiber",
      "LEED",
      "ISO 27001 Program",
      "CFR 21 Part 11",
      "HIPAA",
      "HR Program",
      "SOX Compliance Program",
      "Contract Compliance",
      "PCI Compliance Program",
    ]
    var object = [
      "Stability and Perpetuability"
    ]

    var object2 = [
      "CTRL - Access Control",
      "CTRL - Non Critical Security",
      "POL - User Policy",
      "POL - Universal Policy"
    ]

    var tasks = [
      "Proof Reading",
      "Validate Mappings",
      "Peer Review"
    ]
  });

  // New Assessment Created
  $('body').on('click', '#addAssessmentCreated', function() {
    $('#newAssessment').modal('hide');
    $('#assessmentCountObjectNav').html('2');
    $('#assessmentCountWidget').html('(2)');
    $('#mainAssessmentsCountNew').html('2');
    $('#addAssessment').fadeIn();
    $('#mainAssessmentNew').fadeIn();

  });

  // New Object under Assessment Created
  $('body').on('click', '#addObjectUnderAssessmentCreated', function() {
    $('#newObjectToAssessment').modal('hide');
    $('#objectUnderAssessmentCountObjectNav').html('5');
    $('#objectItemUnderAssessmentCountObjectNav').html('5');
    $('#addObjectUnderAssessment').fadeIn();
  });

  // Create New Task
  $('body').on('click', '#createNewTask', function() {
    $('#newTask').modal('hide');
    $('#newlyCreatedTaskTitle').html('Clean up');
    $('#newlyCreatedTask').fadeIn();
    $('#taskCounter').html('1');
  });

  // Create New File
  $('body').on('click', '#createNewFile', function() {
    $('#newFile').modal('hide');
    $('#newlyCreatedFile').fadeIn();
    $('#fileCounter').html('3');
  });

  $('body').on('click', '.show-long', function() {
    var $this = $(this),
        $description = $this.closest('.show-description').find('.tree-description');

    $this.hide();
    $description.removeClass('short');

    return false;
  });

  $('.workflow-accordion').on('show', function (e) {
    $(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active');
  });

  $('.workflow-accordion').on('hide', function (e) {
    $(this).find('.accordion-toggle').not($(e.target)).removeClass('active');
  });

  $('#assessmentWorkflowChoose').on('change', function(){
    var id = $(this).val()
      , workflow = null;
    new Workflow.List({}).each(function(v){
      if(v.id == id){
        workflow = v;
      }
    });
    if(id == "new"){
      workflow = new Workflow({_new: true, title: "", tasks: [], reviews: []});
    }
    $("workflow-app").trigger("workflow_selected", workflow);
    $('#accordionContentReview').show();
    $('#accordionContentTasks').show();
    return;
    if($(this).val() == 'newWorkflow') {
      $('#regularWorkflowLabel').hide();
      $('#newWorkflowLabel').show();
      $('#newWorkflowTitle').show();
      $('.workflow-accordion .accordion-group .accordion-body').each(function(){
        $(this).addClass('in');
      });
      $('#accordionContentReview').show();
      $('#accordionContentTasks').show();
      $('#showTasksCount').html('3');
      $('#showReviewCount').html('2');
    } else if ($(this).val() == 'existingWorkflow') {
      $('.workflow-accordion .accordion-group .accordion-body').each(function(){
        $(this).addClass('in');
      });
      $('#accordionContentReview').show();
      $('#accordionContentTasks').show();
      $('#showTasksCount').html('3');
      $('#showReviewCount').html('2');
    } else {
      $('#regularWorkflowLabel').show();
      $('#newWorkflowLabel').hide();
      $('#newWorkflowTitle').hide();

      $('.workflow-accordion .accordion-group .accordion-body').each(function(){
        $(this).removeClass('in');
      });
      $('#accordionContentReview').hide();
      $('#accordionContentTasks').hide();
      $('#showTasksCount').html('0');
      $('#showReviewCount').html('0');
    }
  });

  $('body').on('click', '#addWorkflow', function() {
    $('#setupWorkflow').modal('hide');
    $('#workflowNotSet').hide();
    $('#workflowSet').show();
    $('#workflowTasksCount').html('3');
    $('#workflowReviewCount').html('2');
    $('#workflowTasks').show();
    $('#workflowReviews').show();
    $('#workflowFrequency').show();
    $('#workflowSetup').hide();
    $('#workflowEdit').show();
    $('#noWorkflow').hide();
  });

  $('body').on('mouseover', '.section-add', function() {
    var $this = $(this)
    ,   $sectionExpand = $this.closest('.section-expandable').find('.section-expander');

    $this.hide();
    $sectionExpand.show();
  });

  $('body').on('click', '#addSingleObjectTrigger', function() {
    $('#addSingleObject').show();
    $('#objectFooterUtility').hide();
  });

  $('body').on('click', '#addSingleControl', function() {
    $('#addSingleObject').hide();
    $('#addedObject').show();
    $('#objectsCounter').html('(5)');
    $('#objectsMainCounter').html('5');
    $('#objectFooterUtility').show();
    $('.section-expander').hide();
    $('.section-add').show();
    $('#noObjects').html('5 Objects selected').css('font-style','normal').css('color','#000');
    $('#startAssessment').removeClass('disabled');
  });

  $('body').on('click', '#cancelSingleControl', function() {
    $('#objectFooterUtility').show();
    $('#addSingleObject').hide();
    $('.section-expander').hide();
    $('.section-add').show();
  });

  $("#objectAll").click(function () {
    $(".object-check-single").prop('checked', $(this).prop('checked'));
    if($('#objectAll').attr('checked', true)) {
      $('#objectAdd').show();
    } else {
      $('#objectAdd').hide();
    }
  });

  $('body').on('click', '#objectAdd a', function() {
    $('#objectStep2').hide();
    $('#objectAdd').hide();
    $('#objectStep3').show();
    $('#objectsCounter').html('(4)');
    $('#objectsMainCounter').html('4');
  });

  $('body').on('click', '#addRule', function() {
    $('#newRule').show();
  });

  $('body').on('click', '#objectReview', function() {
    $('#objectStep1').hide();
    $('#objectStep2').show();
    $('#objectAdd').show();
  });

  $('body').on('click', '#addEntryTrigger', function() {
    $('#entryText').show();
    $(this).hide();
  });

  $('body').on('click', '#addEntryButton', function() {
    $('#newEntry').show();
    $('#addEntryTrigger').show();
    $('#entryText').hide();
    $('#entriesCount').html('2');
    $('#taskEntryCounterMain').html('1');
  });

  $('body').on('click', '#startObject', function() {
    $('#finishObject').show();
    $(this).hide();
  });

  $('body').on('click', '#startTask', function() {
    $(this).hide();
    $('#finishTask').show();
  });
  $('body').on('click', '#startTask2', function() {
    $(this).hide();
    $('#finishTask2').show();
  });
  $('body').on('click', '#startTask3', function() {
    $(this).hide();
    $('#finishTask3').show();
  });

  $('body').on('click', '#finishTask', function() {
    $('#verifyTask').show();
    $(this).hide();
  });

  $('body').on('click', '#finishTask2', function() {
    $(this).hide();
    $('#verifyTask2').show();
  });

  $('body').on('click', '#finishTaskSpecial', function() {
    $(this).hide();
    $('#verifyTaskSpecial').show();
  });

  $('body').on('click', '#finishTask3', function() {
    $(this).hide();
    $('#verifyTask3').show();
  });

  $('body').on('click', '#verifyTask', function() {
    $(this).closest('.tree-item').removeClass('rq-draft');
    $(this).closest('.tree-item').addClass('rq-accepted');
    $(this).hide();
    $('#taskDone').show();
  });

  $('body').on('click', '#verifyTask2', function() {
    $(this).closest('.tree-item').removeClass('rq-draft');
    $(this).closest('.tree-item').addClass('rq-accepted');
    $(this).hide();
    $('#taskDone2').show();
  });

  $('body').on('click', '#verifyTask3', function() {
    $(this).closest('.tree-item').removeClass('rq-draft');
    $(this).closest('.tree-item').addClass('rq-accepted');
    $(this).hide();
    $('#taskDone3').show();
  });

  $('body').on('click', '#peerReviewActive', function() {
    $(this).hide();
    $('#peerReview').show();
  });

  $('body').on('click', '#partyReviewActive', function() {
    $(this).hide();
    $('#partyReview').show();
  });

  $('body').on('click', '#peerReviewComplete', function() {
    $(this).hide();
    $('#reviewNoteDone').show();
    $('#addNote').hide();
  });

  $('body').on('click', '#partyReviewComplete', function() {
    $(this).hide();
    $('#reviewNoteDone2').show();
    $('#addNote2').hide();
    $('#finishObject').removeClass('disabled');
  });

  $('body').on('click', '#finishObject', function() {
    $(this).closest('.tree-item').removeClass('rq-amended-request').addClass('rq-accepted');
    $(this).hide();
    $('#objectMessage').show();
  });

  $('body').on('click', '#filterTrigger', function() {
    $('#objectStep2').hide();
    $('#objectStep1').show();
  });

  $('body').on('click', '#filterTriggerFooter', function() {
    $('#objectStep2').hide();
    $('#objectStep3').hide();
    $('#objectStep1').show();
  });

  $('body').on('click', '#addTaskGroup', function() {
    $('#TaskGroupItem').show();
    $('#TaskGroupCounter').html('1');
    $('#objectsMainCounter4').html('1');
    $('#workflowStart').removeClass('disabled');
  });

  $('body').on('click', '#cancelTaskGroup', function() {
    $('#addSingleObject').hide();
    $('#objectFooterUtility').show();
  });

  $('body').on('click', '#TaskDescription', function() {
    $('#TaskHolder').show();
    $('#TaskDescription').hide();
  });

  $('body').on('click', '#descriptionCancel', function() {
    $('#TaskHolder').hide();
    $('#TaskDescription').show();
  });

  $('body').on('click', '#descriptionSave', function() {
    $('#TaskHolder').hide();
    $('#TaskDescription').hide();
    $('#TaskUpdated').show();
  });

  $('body').on('click', '#objectAddTrigger', function() {
    $('#objectList').show();
    $('#objectWorkflowCounter').html('2');
  });

  $('body').on('click', '#taskAdd', function() {
    $('#taskList').show();
    $('#lockTrigger').show();
    $('#taskWorkflowCounter').html('3');
  });

  $("#taskLock").change(function () {
    if($(this).is(':checked')) {
      $('#taskAdd').addClass('disabled');
      $('.task-list .objective-selector a').addClass('disabled');
    } else {
      $('#taskAdd').removeClass('disabled');
      $('.task-list .objective-selector a').removeClass('disabled');
    }
  });

  $("body").on('change', '.object-check-single', function() {
    if($(this).is(':checked')) {
      $(this).closest('.tree-item').removeClass('disabled');
    } else {
      $(this).closest('.tree-item').addClass('disabled');
    }
  });

  $('body').on('click', '#titleChange', function() {
    $(this).closest('h3').hide();
    $('#taskGroupTitle').show();
  });

  $('body').on('click', '#editFieldSave', function() {
    $('#titleChange').closest('h3').show();
    $('#taskGroupTitle').hide();
  });

  $('body').on('click', '#editFieldCancel', function() {
    $('#titleChange').closest('h3').show();
    $('#taskGroupTitle').hide();
  });

  $('body').on('click', '#endWorkflowTrigger', function() {
    $('.internav .progress-object').addClass('finished');
    $('#endWorkflowTrigger').hide();
    $('.internav .inner-nav-button span.message').show();
    $('.header-message').show();
    $('.workflow-group').addClass('finished');
    $('.finished-number').show();
  });

  $('body').on('click', '#cancelEntry', function() {
    $('#entryText').hide();
    $('#addEntryTrigger').show();
  });

  $('body').on('click', '#editEntryTrigger', function() {
    $('#firstEntry').hide();
    $('#editEntry').show();
  });

  $('body').on('click', '#editEntrySave', function() {
    $('#firstEntry').show();
    $('#editEntry').hide();
  });

  $('body').on('click', '#editEntryCancel', function() {
    $('#firstEntry').show();
    $('#editEntry').hide();
  });

  $('#frequency').on('change', function(){
    if($(this).val() == 'one_time') {
      $('.frequency-wrap').hide();
      $('#one-time').show();
    } else if ($(this).val() == 'weekly') {
      $('.frequency-wrap').hide();
      $('#weekly').show();
    } else if ($(this).val() == 'monthly') {
      $('.frequency-wrap').hide();
      $('#monthly').show();
    } else if ($(this).val() == 'quarterly') {
      $('.frequency-wrap').hide();
      $('#quarterly').show();
    } else if ($(this).val() == 'annually') {
      $('.frequency-wrap').hide();
      $('#annually').show();
    } else if ($(this).val() == 'continuos') {
      $('.frequency-wrap').hide();
      $('#continuos').show();
    }
  });

  // Hide fields in modals
  $(".modal .field-hide").each(function() {
    var $this = $(this),
        $hideable = $(this).closest('[class*="span"].hideable'),
        $innerHide = $this.closest('[class*="span"]').find('.hideable'),
        $resetForm = $this.closest('.modal-body').find('.reset-form');

    $this.click(function() {
      $this.closest('.inner-hide').addClass('inner-hideable');
      $hideable.hide();
      $resetForm.fadeIn(500);

      for(var i=0; i < $this.closest('.hide-wrap.hideable').find('.inner-hideable').length; i++) {
        if(i == 1) {
          $this.closest('.inner-hide').parent('.hideable').hide();
        }
      };
      return false

    });

    $resetForm.click(function() {
      $this.closest('.inner-hide').removeClass('inner-hideable');
      $hideable.show();
      $('.inner-hide').parent('.hideable').show();
      $resetForm.fadeOut(500);
      return false
    });
  });

  // Custom Attribute select
  $('.if-upload').fadeOut(500);
  $('.attr-custom').change(function() {
    if (this.value == '3') {
      $('.if-dropdown').fadeIn(500);
      $('.if-checkbox').fadeOut(500);
      $('.if-upload').fadeOut(500);
    } else if (this.value == "4") {
      $('.if-dropdown').fadeOut(500);
      $('.if-checkbox').fadeOut(500);
      $('.if-upload').fadeOut(500);
    } else if (this.value == "5") {
      $('.if-dropdown').fadeOut(500);
      $('.if-checkbox').fadeOut(500);
      $('.if-upload').fadeIn(500);
    } else {
      $('.if-dropdown').fadeOut(500);
      $('.if-checkbox').fadeIn(500);
      $('.if-upload').fadeOut(500);
    }
  });

  // Add Custom Attribute
  $('body').on('click', '#addAttribute', function() {
    $("#NewAttribute").show();
    $("#customAttribute").modal('hide');
  });

  // Custom attribute disable edit link
  $(".disabled-link").on("click", function(ev) {
    ev.preventDefault();
  });

  $("#attribute-cat-trigger").on("click", function() {
    var $this = $(this);
        $activeList = $this.closest("li"),
        $list = $this.closest(".internav").find("li"),
        $activeWidget = $this.closest("body").find("#attribute_cat"),
        $widget = $this.closest("body").find(".widget");

    $widget.hide();
    $activeWidget.show();
    $list.removeClass("active");
    $activeList.addClass("active");
  });

  $("#object-attribute-trigger").on("click", function() {
    var $this = $(this);
        $activeList = $this.closest("li"),
        $list = $this.closest(".internav").find("li"),
        $activeWidget = $this.closest("body").find("#object_attribute_widget"),
        $widget = $this.closest("body").find(".widget");

    $widget.hide();
    $activeWidget.show();
    $list.removeClass("active");
    $activeList.addClass("active");
  });

  $("#addCategory").on("click", function() {
    var $this = $(this),
        $newCategory = $("#newCategory");

    $this.modal('hide');
    $newCategory.show();
  });

  // Custom Reporting
  $(".save-template input[type=checkbox]").each(function() {
    var $this = $(this),
        $label = $(this).closest("label");
    if($(this).prop('disabled')) {
      $label.addClass("disabled");
    }
  });

  $(".attribute-trigger").each(function() {
    $(".attribute-trigger").popover({
      html: true,
      trigger: "click",
      content: function(){
        return $(this).next('.attr-wrap').html();
      },
      placement: "bottom",
      template: '

'
    });

    $(this).on('shown.bs.popover', function () {
      $(this).addClass("active");
      $(this).next(".popover-manual-close").find(".popover-close").click(function (e) {
          $(".attribute-trigger").popover("hide");
      });
    });

    $(this).on('hidden.bs.popover', function () {
      $(this).removeClass("active");
    });
  });

  // "Save report as" checkbox sync
  $(".report-save-check").change(function() {
    $(".report-save-check-bottom").prop("checked", this.checked);
  });

  $(".report-save-check-bottom").change(function() {
    $(".report-save-check").prop("checked", this.checked);
  });

  // Close all popovers with a class "popover-manual-close" if you click anywhere except inside popover
  $("html").on("mouseup", function(el) {
    if(!$(el.target).closest(".popover-manual-close").length) {
      $(".popover-manual-close").each(function(){
        $(this.previousSibling).popover('hide');
      });
    }
  });

  // Dropdown menu form stop propagation
  $(".dropdown-menu").on("click", function(el) {
      var $this = $(this);

    if($this.hasClass("dropdown-menu-form")) {
      el.stopPropagation();
    }
  });

  // Top navigation show/hide
  function topNav() {
    var options = {
          duration: 800,
          easing: 'easeOutExpo'
        },
        $this = $(this),
        $tooltip = $this.find("i"),
        $nav = $this.closest("body").find(".top-inner-nav"),
        $lhn_nav = $this.closest("body").find(".lhs-holder"),
        $lhn_type = $this.closest("body").find(".lhn-type"),
        $bar = $this.closest("body").find(".bar-v"),
        $content = $this.closest("body").find(".object-area"),
        $fake_merge = $content.add($bar);
    if($this.hasClass("active")) {
      $this.removeClass("active");
      $nav.animate({top: "19"}, options);
      $fake_merge.animate({top: "49"}, options);
      $lhn_nav.animate({top: "99"}, options);
      $lhn_type.animate({top: "65"}, options);
    } else {
      $this.addClass("active");
      $nav.animate({top: "48"}, options);
      $fake_merge.animate({top: "78"}, options);
      $lhn_nav.animate({top: "128"}, options);
      $lhn_type.animate({top: "94"}, options);
    }
  }

  // LHN show/hide
  function lhnAnimate() {
    var options = {
          duration: 100,
          easing: 'easeOutExpo'
        },
        $this = $(this),
        $lhn = $this.closest("body").find(".lhs-holder"),
        lhn_width = $lhn.width() - 20,
        $lhn_bar = $this.closest("body").find(".bar-v"),
        $lhnType = $this.closest("body").find(".lhn-type"),
        $lhs_search = $this.closest("body").find(".lhs-search");
    if($this.hasClass("active")) {
      $this.removeClass("active");
      $lhn.removeClass("active").animate({left: "-240"}, options).css("width", "240px");
      $lhnType.removeClass("active").animate({left: "-240"}, options).css("width", "240px");
      $lhs_search.removeClass("active").css("width", "196px");
      $lhs_search.find(".widgetsearch").css("width", "130px");
    } else {
      $this.addClass("active");
      $lhn.addClass("active").animate({left: "0"}, options);
      $lhnType.addClass("active").animate({left: "0"}, options);
      $lhs_search.addClass("active");
    }
  }

  $(".nav-trigger").on("click", topNav);
  $(".lhn-trigger").on("click", lhnAnimate);

  /*
  TO-DO: when clicking everywhere else except inside lhn if lhn is active it should be closed.
  $(document).on('click', function(event) {
    if (!$(event.target).closest(".lhs-holder.active").length) {
      $(".lhs-holder").removeClass("active").animate({left: "-240"}, 800, 'easeOutExpo').css("width", "240px");
    }
  });
  */

  // top nav dropdown position
  function dropdownPosition() {
    var $this = $(this),
        $dropdown = $this.closest(".hidden-widgets-list").find(".dropdown-menu"),
        $menu_item = $dropdown.find(".inner-nav-item").find("a"),
        dropdown_height = $dropdown.outerHeight(),
        offset = $this.offset(),
        top_pos = offset.top + 36,
        left_pos = offset.left,
        win = $(window),
        win_height = win.height(),
        footer_height = $(".footer").outerHeight(),
        remain_height = win_height - footer_height,
        win_width = win.width();

    if(win_width - left_pos < 322) {
      $dropdown.addClass("right-pos");
    } else {
      $dropdown.removeClass("right-pos");
    }
    if(remain_height - top_pos < dropdown_height) {
      $dropdown.addClass("mid-pos");
    } else {
      $dropdown.removeClass("mid-pos");
    }
    if($menu_item.length === 1) {
      $dropdown.addClass("one-item");
    } else {
      $dropdown.removeClass("one-item");
    }

  }
  $(".dropdown-toggle").on("click", dropdownPosition);

  // Main title slide to right
  function slideRight() {
    var options = {
          duration: 1500,
          easing: 'easeOutExpo'
        },
        $this = $(this),
        $to_slide = $this.closest("h1").find(".title-slide"),
        $to_show = $this.closest("h1").find(".title-prev"),
        win = $(window),
        win_width = win.width(),
        slide_amount = win_width;

    $to_slide.animate({ "left": "+=" + slide_amount }, options);
  }

  $(".title-trigger").on("click", slideRight);

  $(".select").on("click", function(el) {
    var $this = $(this),
        $this_item = $this.closest(".tree-item"),
        $all_items = $(".tree-item");

    if($this_item.hasClass("active")) {
      $all_items.removeClass("active");
    } else {
      $all_items.removeClass("active");
      $this_item.addClass("active");
    }
  });

  // Workflow 2nd tier show/hide task-group, tasks and objects
  $("#taskGroupPinSelect").on("click", function(e) {
    $("#taskGroupPin").show();
    $("#taskPin").hide();
    $("#objectPin").hide();
  });

  $("#taskPinSelect").on("click", function(e) {
    $("#taskGroupPin").hide();
    $("#taskPin").show();
    $("#objectPin").hide();
  });

  $("#objectPinSelect").on("click", function(e) {
    $("#taskGroupPin").hide();
    $("#taskPin").hide();
    $("#objectPin").show();
  });

  // Audit 2nd tier show/hide requests, responses and objects
  $("#auditRequestSelect").on("click", function(e) {
    $("#auditRequestPin").show();
    $("#auditResponsePin").hide();
    $("#auditObjectPin").hide();
    $("#auditEvidencePin").hide();
    $("#auditMeetingPin").hide();
  });

  $("#auditResponseSelect").on("click", function(e) {
    $("#auditRequestPin").hide();
    $("#auditResponsePin").show();
    $("#auditObjectPin").hide();
    $("#auditEvidencePin").hide();
    $("#auditMeetingPin").hide();
  });

  $("#auditObjectSelect").on("click", function(e) {
    $("#auditRequestPin").hide();
    $("#auditResponsePin").hide();
    $("#auditObjectPin").show();
    $("#auditEvidencePin").hide();
    $("#auditMeetingPin").hide();
  });

  $("#auditEvidenceSelect").on("click", function(e) {
    $("#auditRequestPin").hide();
    $("#auditResponsePin").hide();
    $("#auditObjectPin").hide();
    $("#auditEvidencePin").show();
    $("#auditMeetingPin").hide();
  });

  $("#auditMeetingSelect").on("click", function(e) {
    $("#auditRequestPin").hide();
    $("#auditResponsePin").hide();
    $("#auditObjectPin").hide();
    $("#auditEvidencePin").hide();
    $("#auditMeetingPin").show();
  });

  // show/hide add auditor in audit info widget
  $("#auditorFiledWrapTrigger").on("click", function() {
    var $this = $(this),
        $field_wrap = $this.closest(".wrap-row").find("#auditorFiledWrap");

    if($this.hasClass("active")) {
      $this.removeClass("active").show();
      $field_wrap.slideUp();
    } else {
      $this.addClass("active").hide();
      $field_wrap.slideDown();
    }
  });

});

// Widget search active state
function searchFilter() {
  var $this = $(this),
      $field = $this.closest(".lhs-search").find(".widgetsearch"),
      $filter_icon = $this.closest(".lhs-search").find(".filter-off");

  $field.addClass("active");
  $filter_icon.addClass("active");
}

function searchActive() {
  var $this = $(this),
      $button = $this.closest(".lhs-search").find(".widgetsearch-submit"),
      $search_field = $this.closest(".lhs-search").find(".widgetsearch"),
      $filter_icon = $this.closest(".lhs-search").find(".filter-off");

  if($this.val().trim() !== "") {
    $button.addClass("active");
    $button.bind("click", searchFilter);
  } else {
    $button.removeClass("active");
    $search_field.removeClass("active");
    $filter_icon.removeClass("active");
  }
}

$(".widgetsearch").on("keyup", searchActive);

// Pin content height options
function pinContent() {
  var options = {
        duration: 800,
        easing: 'easeOutExpo'
      },
      $pin = $(".pin-content"),
      $pin_height = $pin.height(),
      $info = $(".pin-content").find(".info"),
      $widget = $(".widget"),
      $widget_no_pin = $(".widget-no-pin"),
      $window = $(window),
      $win_height = $window.height(),
      $win_height_part = $win_height / 3,
      $pin_max = $win_height_part * 2,
      $pin_default = $win_height_part,
      $pin_min = 30;

  $info.css("height", $pin_default);
  $widget.css("margin-bottom", $win_height_part + 80);
  $widget_no_pin.css("margin-bottom", "0");

  $(".pin-action .max").on("click", function() {
    $info.animate({height: $pin_max}, options);
  });
  $(".pin-action .default").on("click", function() {
    $info.animate({height: $pin_default}, options);
    $widget.css("margin-bottom", $win_height_part + 80);
  });
  $(".pin-action .min").on("click", function() {
    $info.animate({height: $pin_min}, options);
    $widget.css("margin-bottom", 115);
  });
}

jQuery(pinContent);
jQuery(window).on("resize", pinContent);

// LHN pin
$(".lhn-pin").on("click", function() {
  var $this = $(this),
      $lhn_button = $(".lhn-trigger"),
      $lhn_bar = $(".bar-v");

  if ($this.hasClass("active")) {
    $this.removeClass("active");
    $lhn_button.removeClass("disabled");
    $lhn_button.attr("disabled", false);
    $lhn_bar.removeClass("disabled");
    $lhn_bar.attr("disabled", false);
  } else {
    $this.addClass("active");
    $lhn_button.addClass("disabled");
    $lhn_button.attr("disabled", true);
    $lhn_bar.addClass("disabled");
    $lhn_bar.attr("disabled", true);
  }
});

// Make sure the windows are resized properly

jQuery(resize_areas);
jQuery(window).on("resize", resize_areas);

// The function is borrowed from dashboard.js
function resize_areas() {
  var $window, $lhs, $lhsHolder, $area, $header, $footer, $innerNav,
      $objectArea, $bar, winHeight, winWidth, objectWidth, headerWidth,
      lhsWidth, footerMargin, internavHeight;

  $window = $(window);
  $lhs = $(".lhs");
  $lhsHolder = $(".lhs-holder");
  $lhsHolderActive = $(".lhs-holder.active");
  $footer = $(".footer");
  $header = $(".header-content");
  $innerNav = $(".inner-nav");
  $objectArea = $(".object-area");
  $objectAreaActive = $(".object-area.active");
  $topNav = $(".top-inner-nav");
  $area = $(".area");
  $bar = $(".bar-v");
  $lhsSearch = $(".lhs-search");
  $lhsSearchActive = $(".lhs-search.active");
  $lhnType = $(".lhn-type");

  winHeight = $window.height();
  winWidth = $window.width();
  header_height = $(".header").height();
  header_content_height = $(".header-content").height();
  top_nav_height = $(".top-inner-nav").height();
  footer_height = $(".footer").outerHeight();
  lhsHeight = winHeight - header_height - header_content_height - top_nav_height - footer_height - 60;
  footerMargin = lhsHeight;
  internavHeight = winHeight - 156;
  lhsWidth = $lhsHolder.width();
  lhsSearchWidth = $lhsSearch.width() - 30;
  lhsSearchWidthActive = $lhsSearchActive.width() - 30;
  barWidth = $bar.is(":visible") ? $bar.outerWidth() : 0;
  internavWidth = $innerNav.width() || 0; // || 0 for pages without inner-nav
  objectWidthActive = winWidth - lhsWidth - barWidth;
  objectWidth = winWidth;
  //headerWidth = winWidth - lhsWidth - barWidth - 20;
  headerWidth = winWidth - 40;
  lhnType_width = lhsWidth;

  $lhsHolder.css("height",lhsHeight).css("width", lhsWidth);
  $lhsHolderActive.css("left", "0");
  $bar.css("height",lhsHeight);
  $footer.css("margin-top",footerMargin);
  $innerNav.css("height",internavHeight);
  $header.css("width",headerWidth);
  $topNav.css("width",objectWidth);
  $(".widgetsearch").css("width", lhsSearchWidth - 36);
  $lhsSearchActive.css("width", lhsWidth - 40);
  $objectArea
    .css("margin-left","0")
    .css("height",internavHeight)
    .css("width",objectWidth);
  $objectAreaActive
    .css("margin-left", lhsWidth + 8)
    .css("width",objectWidthActive);
  $area.css("margin-left", "0");
  $lhnType.css("width", lhnType_width);
}


text:
				Traffic pole name:
				{{ Camera.Parent.Name }}

				Camera Id
				Camera

	        	From
	            <input id="{{ComponentId}}_fromdiv" type="text" class="form-control input-small" [(ngModel)]="from"
	            																				 [formControl]="fromForm">

	        	To
	            <input id="{{ComponentId}}_todiv" type="text" class="form-control input-small" [(ngModel)]="to"
	            																			   [formControl]="toForm">

			<select id="{{ComponentId}}_GraphType" class="custom-select" style="float:right; width: 100%;"
																		(change)="onGraphTypeChange($event.target.value)"
																		[(ngModel)]="graphType"
																		[formControl]="graphTypeForm">
				<option value="" disabled selected>Select graph type</option>
				<option value="LineGraph">Line graph</option>
			  	<option value="BarGraph">Bar graph</option>
			</select>

			<select id="{{ComponentId}}_ViewType" class="custom-select" style="width: 100%"
																		(change)="onViewTypeChange($event.target.value)"
																		[(ngModel)]="viewType"
																		[formControl]="viewTypeForm">
				<option value="" disabled selected>Select view type</option>
				<option value="Hour">Hour</option>
			  	<option value="Day">Day</option>
			  	<option value="Weekend">Weekend</option>
				<option value="Month">Month</option>
				<option value="Year">Year</option>
			</select>

   View graph

   Reset

'From' must less than 'To' date.

Please select 'From' date.

Please select 'To' date.

Please select 'Graph Type'.

Please select 'view Type'.

		<chart style="display: block;" [options]="chartOptions" (load)="SaveChart($event.context)"></chart>

                <button id="CameraAnnoucementCloseModalBtn" type="button" style="display: none;" data-dismiss="modal">Close</button>


text:
package java.rmi.server;

import gnu.java.rmi.server.RMIIncomingThread;

import java.io.OutputStream;
import java.io.PrintStream;

/**
 * A common superclass for the server implementations.
 */
public abstract class RemoteServer
    extends RemoteObject
{
  private static final long serialVersionUID = - 4100238210092549637L;

  /**
   * Does nothing, delegates to super().
   */
  protected RemoteServer()
  {
    super();
  }

  /**
   * Does nothing, delegates to super(ref).
   */
  protected RemoteServer(RemoteRef ref)
  {
    super(ref);
  }

  /**
   * Get the host of the calling client. The current thread must be an instance
   * of the {@link RMIIncomingThread}.
   *
   * @return the client host address
   *
   * @throws ServerNotActiveException if the current thread is not an instance
   * of the RMIIncomingThread.
   */
  public static String getClientHost() throws ServerNotActiveException
  {
    Thread currThread = Thread.currentThread();
    if (currThread instanceof RMIIncomingThread)
      {
        RMIIncomingThread incomingThread = (RMIIncomingThread) currThread;
        return incomingThread.getClientHost();
      }
    else
      {
        throw new ServerNotActiveException(
          "Unknown client host - current thread not instance of 'RMIIncomingThread'");
      }
  }

  /**
   * Set the stream for logging RMI calls.
   *
   * @param out the stream to set or null to turn the logging off.
   */
  public static void setLog(OutputStream out)
  {
    throw new Error("Not implemented");
  }

  /**
   * Get the stream for logging RMI calls.
   *
   * @return the associated stream.
   */
  public static PrintStream getLog()
  {
    throw new Error("Not implemented");
  }

}


text:
package fixtures.bodydictionary;

import java.util.List;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level;

/**
 * The interface for AutoRestSwaggerBATdictionaryService class.
 */
public interface AutoRestSwaggerBATdictionaryService {
    /**
     * Gets the URI used as the base for all cloud service requests.
     *
     * @return the BaseUri value.
     */
    String getBaseUri();

    /**
     * Gets the list of interceptors the OkHttp client will execute.
     *
     * @return the list of interceptors.
     */
    List<Interceptor> getClientInterceptors();

    /**
     * Sets the logging level for OkHttp client.
     *
     * @param logLevel the logging level enum.
     */
    void setLogLevel(Level logLevel);

    /**
     * Gets the Dictionary object to access its operations.
     * @return the dictionary value.
     */
    Dictionary getDictionary();

}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>BrightstarDB - NoSQL for .NET</title>
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="Stylesheet" href="css/main.css" />
    <link rel="icon" href="images/favicon.ico" />
    <link rel="alternate" type="application/rss+xml" title="BrightstarDB Blog » Feed"
        href="/blog/?feed=rss2" />

        <hgroup>

            <form method="get" action="/search.html" id="searchForm">
            <input id="q" type="text" name="q" />
            <button title="Search" class="button">

            </button>
            </form>
        </hgroup>

        Documentation Download Blog Community

            <hgroup>

                    BrightstarDB

            </hgroup>

                A fast and scalable NoSQL database for the
                    .NET platform with code-first data model generation.

                Schema-Free Triple Store

                BrightstarDB implements the powerfully simple W3C Semantic Web data model, RDF.
                The RDF data model uses triples to represent data of all shapes. BrightstarDB does
                not require the definition of fixed schema, allowing great flexibility in what data
                is stored and how it is connected together. This associative data model is a great
                fit for many real world applications.

                Transactional

                BrightstarDB offers a fully ACID transaction model where commits never block reads,
                reads never block updates and reads never see uncommitted updates.

                High Performance

                Thanks to automatic, dedicated indexes, client and server caching models BrightstarDB
                is blisteringly fast for updates and reads.

                NoSQL Entity Framework

                BrightstarDB is unique in that it offers a full Entity Framework model over the
                underlying data store. This means developers have the flexibility of a NoSQL store
                but with the power and familiarity of working with typed objects when building applications.

                LINQ & OData Support

                On .NET the language of query is LINQ. BrightstarDB has a custom LINQ implementation
                that maps LINQ queries into SPARQL to be run natively against the data. Through
                its Entity Framework any BrightstarDB store can expose an OData endpoint.

                Historical Data Access

                BrightstarDB never overwrites data, meaning it is possible to access a store at
                any point in its life time. Query the data as it stood a month ago, or even roll
                back the store to any previous point. Data stores can periodically be condenses
                to remove historical data if required.

                Automatic Indexing

                Many SQL and NoSQL systems require the developer to define all the required indexes
                for their specific application. BrightstarDB automatically indexes all relationships
                and property values at insert time.

                    Navigation

Documentation

Download

Blog

Community

                    Keep in Touch!

                    Follow @BrightstarDB

                Blog RSS Feed

            © Networked Planet Limited 2011


text:
namespace MassTransit.Middleware
{
    using System;
    using System.Collections.Concurrent;
    using System.Diagnostics;
    using System.Threading.Tasks;
    using Configuration;
    using Transports;

    public class SendPipe :
        ISendPipe
    {
        readonly ConcurrentDictionary<Type, IMessagePipe> _outputPipes;
        readonly ISendPipeSpecification _specification;

        public SendPipe(ISendPipeSpecification specification)
        {
            _specification = specification;
            _outputPipes = new ConcurrentDictionary<Type, IMessagePipe>();
        }

        public void Probe(ProbeContext context)
        {
            var scope = context.CreateScope("sendPipe");

            foreach (var outputPipe in _outputPipes.Values)
                outputPipe.Probe(scope);
        }

        [DebuggerNonUserCode]
        [DebuggerStepThrough]
        public Task Send<T>(SendContext<T> context)
            where T : class
        {
            return _outputPipes.GetOrAdd(typeof(T), x => new MessagePipe<T>(_specification.GetMessageSpecification<T>())).Send(context);
        }

        interface IMessagePipe :
            IProbeSite
        {
            Task Send<T>(SendContext<T> context)
                where T : class;
        }

        class MessagePipe<TMessage> :
            IMessagePipe
            where TMessage : class
        {
            readonly Lazy<IMessageSendPipe<TMessage>> _output;
            readonly IMessageSendPipeSpecification<TMessage> _specification;

            public MessagePipe(IMessageSendPipeSpecification<TMessage> specification)
            {
                _specification = specification;

                _output = new Lazy<IMessageSendPipe<TMessage>>(CreateMessagePipe);
            }

            public Task Send<T>(SendContext<T> context)
                where T : class
            {
                return _output.Value.Send((SendContext<TMessage>)context);
            }

            public void Probe(ProbeContext context)
            {
                _output.Value.Probe(context);
            }

            IMessageSendPipe<TMessage> CreateMessagePipe()
            {
                IPipe<SendContext<TMessage>> messagePipe = _specification.BuildMessagePipe();

                return new MessageSendPipe<TMessage>(messagePipe);
            }
        }
    }
}


text:
Partial Class DeviceDetails
    Inherits System.Web.UI.Page

End Class