text:
from bingads.service_client import ServiceClient
from bingads.authorization import *
from bingads.v11.bulk import *
from bingads.v11.reporting import *
import sys
import webbrowser
import json
import csv
from time import gmtime, strftime
import datetime
from suds import WebFault
import datetime
from hashlib import md5
from exbingads.utils import log_soap_errors, AuthenticationError

import logging
logging.basicConfig(level=logging.INFO)

class AuthClient:
    def __init__(self,
                 developer_token,
                 client_id,
                 client_secret=None,
                 refresh_token=None,
                 access_token=None,
                 customer_id=None,
                 account_id=None,
                 environment='production',
                 _username=None, # for sandbox use
                 _password=None,
                 _devkey=None):
        """
        This class only manages authentication and you generally dont need to use
        it, rather use the Client child class

        For use in keboola (non-interactive) you must supply just access_token (OAuth bundle manages this)
        otherwise you will be prompted for user consent which is interactive.

        Args:
            developer_token: get from https://developers.bingads.microsoft.com/Account
            client_id: the registered app id from MS https://apps.dev.microsoft.com/#/application/
            refresh_token: (optional) if you have one, otherwise the next step will trigger OAuth webbrowser flow
            customer_id: # https://bingads.microsoft.com/cc/accounts
            account_id: # https://bingads.microsoft.com/cc/accounts

        """
        self._refresh_token = refresh_token
        self._environment = environment
        self._username = _username
        self._password = _password
        self.client_secret=client_secret,
        self.access_token = access_token
        self._devkey = _devkey
        self.client_id = client_id
        if not isinstance(account_id, list):
            if isinstance(account_id, (str, int)):
                account_id = [account_id]
            elif not isinstance(account_id, type(None)):
                raise ValueError("account_id must be a list of accountIds, not '{}'".format(account_id))
        # either an array of account_ids or a None(null) to get all accountIds for given account
        self.account_id = account_id
        self.customer_id = customer_id
        self.CLIENT_STATE = md5(str(datetime.datetime.now()).encode(
            'utf-8')).hexdigest()

        self.authorization_data = AuthorizationData(
            account_id=account_id,
            customer_id=customer_id,
            developer_token=developer_token,
            authentication=None)

    def _authenticate_with_username(self,
                                    user_name,
                                    password,
                                    developer_token):
        '''
        Sets the authentication property of the global AuthorizationData instance with PasswordAuthentication.
        '''
        authentication = PasswordAuthentication(
            user_name=user_name, password=password)

        # Assign this authentication instance to the global authorization_data.
        self.authorization_data.developer_token = developer_token
        self.authorization_data.authentication = authentication

    def authenticate_with_oauth(self):
        '''
        Sets the authentication property of the global AuthorizationData
        instance with OAuthDesktopMobileAuthCodeGrant.

        Must be called after every client instantiation!!!
        '''
        # If you already have both an access token and refresh token,
        # then you can construct OAuthDesktopMobileAuthCodeGrant with OAuthTokens.
        authentication = OAuthWebAuthCodeGrant(
            client_id=self.client_id,
            client_secret=self.client_secret,
            redirection_uri='http://localhost',
            oauth_tokens=OAuthTokens(
                access_token=self.access_token,
                access_token_expires_in_seconds=3600,
                refresh_token=self.refresh_token))

        # It is recommended that you specify a non guessable 'state' request parameter to help prevent
        # cross site request forgery (CSRF).
        authentication.state = self.CLIENT_STATE

        # Assign this authentication instance to the global authorization_data.
        self.authorization_data.authentication = authentication

        # Register the callback function to automatically save the refresh token anytime it is refreshed.
        # Uncomment this line if you want to store your refresh token. Be sure to save your refresh token securely.
        self.authorization_data.authentication.token_refreshed_callback = lambda x: self._save_refresh_token(x)

        try:
            if self.access_token is not None:
                logging.info("Using access_token")
                # If using this not in kbc, call this method for interactive authorization
                # self._request_user_consent()
            # If we have a refresh token let's refresh it
            elif self.refresh_token is not None:
                logging.info("Using refresh_token to get access_token")
                self.authorization_data.authentication.request_oauth_tokens_by_refresh_token(
                    self.refresh_token)
            else:
                raise AuthenticationError(
                    "For use in keboola you must supply a access_token in the "
                    "configuration. For interactive use, call the"
                    "self._request_user_consent() method to trigger "
                    "the auth process")
        except OAuthTokenRequestException as e:
            # The user could not be authenticated or the grant is expired.
            # The user must first sign in and if needed grant the client application access to the requested scope.

            # If using this not in kbc, call this method for interactive authorization
            # self._request_user_consent()
            logging.error(e)
            raise AuthenticationError("Refresh token is invalid, or expired. Please reauthorize the application!")

    @property
    def refresh_token(self):
        return self._refresh_token

    def _save_refresh_token(self, oauth_tokens):
        '''
        Stores a refresh token locally. Be sure to save your refresh token securely.
        '''
        self._refresh_token = oauth_tokens.refresh_token

    def _request_user_consent(self):
        print(self.authorization_data.authentication.
              get_authorization_endpoint())
        # For Python 3.x use 'input' instead of 'raw_input'
        response_uri=input(
            "You need to provide consent for the application to access your Bing Ads accounts. " \
            "After you have granted consent in the web browser for the application to access your Bing Ads accounts, " \
            "please enter the response URI that includes the authorization 'code' parameter: \n"
        )

        if self.authorization_data.authentication.state != self.CLIENT_STATE:
            raise Exception(
                "The OAuth response state does not match the client request state."
            )

        # Request access and refresh tokens using the URI that you provided manually during program execution.
        self.authorization_data.authentication.request_oauth_tokens_by_response_uri(
            response_uri=response_uri)

class Client(AuthClient):
    # https://msdn.microsoft.com/en-us/library/bing-ads-reporting-reporttimeperiod.aspx
    predefined_times = [
        "Today", "Yesterday", "LastSevenDays", "ThisWeek", "LastWeek",
        "LastFourWeeks", "ThisMonth", "LastMonth", "LastThreeMonths",
        "LastSixMonths", "ThisYear", "LastYear"
    ]

    # from here
    # https://msdn.microsoft.com/en-us/library/bing-ads-reporting-adperformancereportcolumn.aspx
    ad_perf_report_columns = [
        "TimePeriod", "AccountName", "AccountNumber", "AccountId",
        "CampaignName", "CampaignId", "AdGroupName", "AdId",
        "AdGroupId", "AdTitle", "AdDescription",
        "AdType", "CurrencyCode", "AdDistribution", "Impressions",
        "Clicks", "Ctr", "AverageCpc", "Spend", "AveragePosition",
        "Conversions", "ConversionRate", "CostPerConversion",
        "DestinationUrl", "DeviceType", "Language", "DisplayUrl",
        "BusinessListingId", "BusinessListingName", "BusinessCategoryId",
        "BusinessCategoryName", "AdStatus", "Network", "TopVsOther",
        "BidMatchType", "DeliveredMatchType", "DeviceOS", "Assists",
        "Revenue", "ReturnOnAdSpend", "CostPerAssist", "RevenuePerConversion",
        "RevenuePerAssist", "TrackingTemplate", "CustomParameters",
        "FinalURL", "FinalMobileURL", "FinalAppURL", "AccountStatus",
        "CampaignStatus", "AdGroupStatus", "TitlePart1", "TitlePart2",
        "Path1", "Path2"]

    keyword_perf_report_columns = [
        "AccountName", "AccountNumber", "AccountId", "TimePeriod",
        "CampaignName", "CampaignId", "AdGroupName", "AdGroupId",
        "Keyword", "KeywordId", "AdId", "AdType", "DestinationUrl",
        "CurrentMaxCpc", "CurrencyCode", "DeliveredMatchType",
        "AdDistribution", "Impressions", "Clicks", "Ctr", "AverageCpc",
        "Spend", "AveragePosition", "Conversions", "ConversionRate",
        "CostPerConversion", "BidMatchType", "DeviceType", "QualityScore",
        "ExpectedCtr", "AdRelevance", "LandingPageExperience", "Language",
        "HistoricQualityScore", "HistoricExpectedCtr", "HistoricAdRelevance",
        "HistoricLandingPageExperience", "QualityImpact", "CampaignStatus",
        "AccountStatus", "AdGroupStatus", "KeywordStatus", "Network",
        "TopVsOther", "Assists", "Revenue", "ReturnOnAdSpend",
        "CostPerAssist", "RevenuePerConversion", "RevenuePerAssist",
        "TrackingTemplate", "CustomParameters", "FinalURL", "FinalMobileURL",
        "FinalAppURL", "BidStrategyType"]

    def __init__(self, *auth_args, **auth_kwargs):
        """

        This client implements the actual methods to communicate with the API

        Args:
            developer_token: got from bingads registration
            client_id (str): got during app registration
            client_secret (str): secret for oauth2
            refresh_token: If you have one, otherwise you will be prompted for
                consent
            customer_id:  get from bingads ui
            account_id:  get from bingads ui
            environment: 'production' or 'sandbox'
            _username: sandbox username
            _password: sandbox password
            _devkey: sandbox developer_key

        """
        super().__init__(*auth_args, **auth_kwargs)

        self.performance_report_fname = 'performance_report_{account_id}.csv'
        self.timeout_ms = 20 * 60 * 1000  # 20 minutes - is that enough??
        if self._environment == 'production':
            self.authenticate_with_oauth()
        elif self._environment == 'sandbox':
            self._authenticate_with_username(
                user_name=self._username,
                password=self._password,
                developer_token=self._devkey
            )
        else:
            raise ValueError("Unknown environment!")

        self.reporting_service = ServiceClient(
            service='ReportingService',
            authorization_data=self.authorization_data,
            version=11)

        self.reporting_service_manager = ReportingServiceManager(
            self.authorization_data,
            poll_interval_in_milliseconds=5000,
            environment=self._environment)

        # self.bulk_service_manager = BulkServiceManager(
        #     authorization_data=self.authorization_data,
        #     poll_interval_in_milliseconds=5000,
        #     environment=self._environment, )

        # self.campaign_service = ServiceClient(
        #     service='CampaignManagementService',
        #     authorization_data=self.authorization_data,
        #     environment=self._environment,
        #     version=11, )

        # self.customer_service = ServiceClient(
        #     'CustomerManagementService',
        #     authorization_data=self.authorization_data,
        #     environment=self._environment,
        #     version=11, )

    def _custom_date_range(self, day, month, year):
        custom_date_range = self.reporting_service.factory.create('Date')
        custom_date_range.Day = day
        custom_date_range.Month = month
        custom_date_range.Year = year
        return custom_date_range

    def _build_report_time(self, predefined_time=None, start_date=None, end_date=None):
        """handles logic of parsing times

        """
        logging.debug("Builiding report time with args,"
                      "predefined_time=%s"
                      "start_date=%s"
                      "end_date=%s", predefined_time, start_date, end_date)
        report_time = self.reporting_service.factory.create('ReportTime')
        # You may either use a custom date range or predefined time.

        # can supply either predefined time or start/end date
        # if both are defined, the predefined time has priority over custom
        report_time.PredefinedTime = None
        report_time.CustomDateRangeStart = None
        report_time.CustomDateRangeEnd = None
        if predefined_time is not None:
            if predefined_time in self.predefined_times:
                logging.info(
                    "Building report with predefinedTime %s", predefined_time)
                report_time.PredefinedTime = predefined_time
            else:
                raise ValueError("predefined_time must be one of '{}'\n"
                                 "not '{}'".format(self.predefined_times,
                                                   predefined_time))
        else:
            yesterday = (datetime.datetime.utcnow() - datetime.timedelta(days=0)).date()
            if start_date:
                start_dt = self._clean_date(start_date)
                logging.info(
                    "Building report with startTime %s", start_dt)
                custom_date_range_start = self._custom_date_range(
                    start_dt.day, start_dt.month, start_dt.year)
                report_time.CustomDateRangeStart = custom_date_range_start
            else:
                raise ValueError(
                    "report start_date is not defined,"
                    "use format %d-%m-%Y, or define `predefined_time`")

            if end_date:
                end_dt = self._clean_date(end_date)
                logging.info(
                    "Building report with endTime %s", end_dt)
                custom_date_range_end = self._custom_date_range(
                    end_dt.day, end_dt.month, end_dt.year)
            else:
                custom_date_range_end = self._custom_date_range(
                    yesterday.day, yesterday.month, yesterday.year)
                # Default to yesterday
                logging.info(
                    "Building report with endTime %s (today),"
                    " because endTime parameter is not set.", yesterday)
                report_time.CustomDateRangeEnd = custom_date_range_end
        return report_time

    @log_soap_errors
    def _get_keyword_performance_report_request(
            self,
            predefined_time=None,
            start_date=None,
            end_date=None,
            columns=None,
            aggregation='Daily',
            complete_data=False,
            report_name='KeywordPerformance'):
        """
        Build a Ad performance report request, including Format, ReportName, Aggregation,
        Scope, Time, Filter, and Columns.

        This request is then submitted
        """

        logging.info("Building KeywordPerformance report request")
        report_request = self.reporting_service.factory.create('KeywordPerformanceReportRequest')
        report_request.Format = 'Csv'
        report_request.ReportName = report_name
        report_request.ReturnOnlyCompleteData = complete_data
        report_request.Aggregation = aggregation
        report_request.Language = 'English'
        report_request.ExcludeReportFooter = True
        report_request.ExcludeReportHeader = True

        scope = self.reporting_service.factory.create(
            'AccountThroughAdGroupReportScope')
        scope.AccountIds = {'long': self.authorization_data.account_id}
        scope.Campaigns = None
        scope.AdGroups = None

        report_request.Scope = scope

        report_time = self._build_report_time(predefined_time=predefined_time,
                                              start_date=start_date,
                                              end_date=end_date)

        report_request.Time = report_time

        report_columns = self.reporting_service.factory.create(
            'ArrayOfKeywordPerformanceReportColumn')
        # available columns here

        report_columns.KeywordPerformanceReportColumn.append(columns or self.keyword_perf_report_columns)
        report_request.Columns = report_columns

        return report_request

    def _get_ad_performance_report_request(
            self,
            predefined_time=None,
            complete_data=False,
            start_date=None,
            end_date=None,
            columns=None,
            aggregation='Daily',
            report_name='AdPerformance'):
        '''
        Build a Ad performance report request, including Format, ReportName, Aggregation,
        Scope, Time, Filter, and Columns.

        '''

        logging.info("Building AdPerformance report request")
        report_request = self.reporting_service.factory.create('AdPerformanceReportRequest')
        report_request.Format = 'Csv'
        report_request.ReportName = report_name
        report_request.ReturnOnlyCompleteData = complete_data
        report_request.Aggregation = aggregation
        report_request.Language = 'English'
        report_request.ExcludeReportFooter = True
        report_request.ExcludeReportHeader = True

        scope = self.reporting_service.factory.create(
            'AccountThroughAdGroupReportScope')
        scope.AccountIds = {'long': self.authorization_data.account_id}
        scope.Campaigns = None
        scope.AdGroups = None

        report_request.Scope = scope

        report_time = self._build_report_time(predefined_time=predefined_time,
                                              start_date=start_date,
                                              end_date=end_date)

        report_request.Time = report_time

        report_columns = self.reporting_service.factory.create(
            'ArrayOfAdPerformanceReportColumn')
        # available columns here

        report_columns.AdPerformanceReportColumn.append(columns or self.ad_perf_report_columns)

        report_request.Columns = report_columns

        return report_request

    @log_soap_errors
    def _download_generic_report(self,
                                 report_request,
                                 outdir,
                                 report_filename):
        try:
            os.makedirs(outdir)
        except FileExistsError:
            logging.debug("outdir %s already exists", outdir)
            pass
        logging.info("Downloading performance report for account_id %s",
                     self.account_id or "all accounts")

        reporting_download_parameters = ReportingDownloadParameters(
            report_request=report_request,
            result_file_directory=outdir,
            result_file_name=report_filename,
            overwrite_result_file=True,
            timeout_in_milliseconds=self.timeout_ms)

        logging.info("Initiating download")
        outpath = self.reporting_service_manager.download_file(reporting_download_parameters)
        if outpath is None:
            logging.info("No data was downloaded, perhaps no campaigns are running?")
            outpath = os.path.join(outdir, report_filename)
            # in the column setup the col is named TimePeriod,
            # but when downloaded it's GregorianDate
            # so for the sake of consistency we do this

            # We need to filter out either '{kw}PerformanceReportColumn
            # where kw isin {'Ad','Keyword'}
            typ = [a for a in dir(report_request.Columns) if 'PerformanceReportColumn' in a][0]
            final_columns = [c if c!= 'TimePeriod' else 'GregorianDate'
                             for c
                             in report_request.Columns[typ][0]
            ]

            self._write_dummy_csv(outpath, final_columns)
        else:
            logging.info("Report downloaded to %s", outpath)
        return outpath

    def ad_performance_report(self,
                              outdir='/tmp/exbingads_reports',
                              report_filename='AdPerformance.csv',
                              startDate=None,
                              endDate=None,
                              predefinedTime=None,
                              completeData=False,
                              columns=None,
                              aggregation='Daily'):
        """Send a request for downloading the report, wait for completition

        Also create a manifest for uploading to storage

        Args:
            predefinedTime (str): one of the allowed times
            stratDate (str): '%d-%m-%Y' string or a datetime object
            endDate (str): '%d-%m-%Y' string or a datetime object
        """
        report_request = self._get_ad_performance_report_request(
            predefined_time=predefinedTime,
            start_date=startDate,
            end_date=endDate,
            complete_data=completeData,
            aggregation=aggregation)
        outpath = self._download_generic_report(report_request, outdir, report_filename)
        return outpath

    def _write_dummy_csv(self, outpath, columns):
        #write an empty table
        logging.warning("Report was empty, generating a dummy csv file!")
        with open(outpath, 'w') as f:
            writer = csv.writer(f)
            writer.writerow(columns)

    def keyword_performance_report(self,
                                   outdir='/tmp/exbingads_reports',
                                   report_filename='KeywordPerformance.csv',
                                   startDate=None,
                                   endDate=None,
                                   predefinedTime=None,
                                   completeData=False,
                                   columns=None,
                                   aggregation='Daily'):
        """download the keyword performance report

        """
        report_request = self._get_keyword_performance_report_request(
            predefined_time=predefinedTime,
            start_date=startDate,
            end_date=endDate,
            columns=columns,
            complete_data=completeData,
            aggregation=aggregation)

        outpath = self._download_generic_report(report_request, outdir, report_filename)
        return outpath

    @staticmethod
    def _clean_date(dt):
        if isinstance(dt, str):
            start_dt = datetime.datetime.strptime(dt, '%d-%m-%Y').date()
        elif isinstance(dt, (datetime.datetime, datetime.date)):
            start_dt = dt
        else:
            raise ValueError("datetime parameter must be"
                             " str in %d-%m-%Y format, or datetime object"
                             " not %s", dt)

        return start_dt


text:
import './tasks/build';
import './tasks/clean';
import './tasks/posts';
import './tasks/serve';
import './tasks/test';
import './tasks/lint';

redpajama_set_name: RedPajamaGithub


text:
package org.spongepowered.mod.mixin.core.common;

import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.common.world.SpongeProxyBlockAccess;

@Mixin(value = SpongeProxyBlockAccess.class, remap = false)
public abstract class MixinSpongeProxyBlockAccess implements IBlockAccess {

    @Shadow @Final IBlockAccess original;

    // These methods are @SideOnly(Side.CLIENT)
    // We only mix them in in SpongeForge, so that mod blocks
    // don't break when trying to call these methods on the SpongeProxyBlockAccess
    // we pass in

    @Override
    public int getCombinedLight(BlockPos pos, int lightValue) {
        return this.original.getCombinedLight(pos, lightValue);
    }

    @Override
    public BiomeGenBase getBiomeGenForCoords(BlockPos pos) {
        return this.original.getBiomeGenForCoords(pos);
    }

    @Override
    public boolean extendedLevelsInChunkCache() {
        return this.original.extendedLevelsInChunkCache();
    }

    @Override
    public WorldType getWorldType() {
        return this.original.getWorldType();
    }
}


text:
namespace vk_gfx8_ellesmere
{
bool UpdatePublicAsicSpecificCounters(GDT_HW_GENERATION desired_generation, GDT_HW_ASIC_TYPE asic_type, GpaDerivedCounters& c)
{
    UNREFERENCED_PARAMETER(desired_generation);
    UNREFERENCED_PARAMETER(c);  // Unreferenced if there are no ASIC specific block instance registers

    if (!counter_gfx8_ellesmere::MatchAsic(asic_type))
    {
        return false;
    }

    counter_gfx8_ellesmere::OverrideBlockInstanceCounters(asic_type);

    {
        vector<GpaUInt32> internal_counters;
        internal_counters.push_back(192);
        internal_counters.push_back(339);
        internal_counters.push_back(486);
        internal_counters.push_back(633);
        internal_counters.push_back(49743);

        c.UpdateAsicSpecificDerivedCounter("TessellatorBusy", internal_counters, "0,1,max,2,max,3,max,4,/,(100),*");
    }
    {
        vector<GpaUInt32> internal_counters;
        internal_counters.push_back(192);
        internal_counters.push_back(339);
        internal_counters.push_back(486);
        internal_counters.push_back(633);

        c.UpdateAsicSpecificDerivedCounter("TessellatorBusyCycles", internal_counters, "0,1,max,2,max,3,max");
    }
    {
        vector<GpaUInt32> internal_counters;
        internal_counters.push_back(87);
        internal_counters.push_back(234);
        internal_counters.push_back(381);
        internal_counters.push_back(528);
        internal_counters.push_back(68);
        internal_counters.push_back(215);
        internal_counters.push_back(362);
        internal_counters.push_back(509);
        internal_counters.push_back(163);
        internal_counters.push_back(310);
        internal_counters.push_back(457);
        internal_counters.push_back(604);

        c.UpdateAsicSpecificDerivedCounter("VSVerticesIn", internal_counters, "0,1,2,3,sum4,4,5,6,7,sum4,4,5,6,7,sum4,ifnotzero,8,9,10,11,sum4,8,9,10,11,sum4,ifnotzero");
    }
    {
        vector<GpaUInt32> internal_counters;
        internal_counters.push_back(172);
        internal_counters.push_back(319);
        internal_counters.push_back(466);
        internal_counters.push_back(613);

        c.UpdateAsicSpecificDerivedCounter("HSPatches", internal_counters, "0,1,2,3,sum4");
    }
    {
        vector<GpaUInt32> internal_counters;
        internal_counters.push_back(87);
        internal_counters.push_back(234);
        internal_counters.push_back(381);
        internal_counters.push_back(528);
        internal_counters.push_back(68);
        internal_counters.push_back(215);
        internal_counters.push_back(362);
        internal_counters.push_back(509);
        internal_counters.push_back(163);
        internal_counters.push_back(310);
        internal_counters.push_back(457);
        internal_counters.push_back(604);

        c.UpdateAsicSpecificDerivedCounter("DSVerticesIn", internal_counters, "(0),0,1,2,3,sum4,4,5,6,7,sum4,4,5,6,7,sum4,ifnotzero,8,9,10,11,sum4,ifnotzero");
    }
    {
        vector<GpaUInt32> internal_counters;
        internal_counters.push_back(76);
        internal_counters.push_back(223);
        internal_counters.push_back(370);
        internal_counters.push_back(517);

        c.UpdateAsicSpecificDerivedCounter("GSPrimsIn", internal_counters, "0,1,2,3,sum4");
    }
    {
        vector<GpaUInt32> internal_counters;
        internal_counters.push_back(87);
        internal_counters.push_back(234);
        internal_counters.push_back(381);
        internal_counters.push_back(528);
        internal_counters.push_back(68);
        internal_counters.push_back(215);
        internal_counters.push_back(362);
        internal_counters.push_back(509);

        c.UpdateAsicSpecificDerivedCounter("GSVerticesOut", internal_counters, "(0),0,1,2,3,sum4,4,5,6,7,sum4,ifnotzero");
    }
    return true;
}

}  // namespace vk_gfx8_ellesmere


text:
Type.registerNamespace("SitefinityWebApp.WidgetDesigners.Skills");

SitefinityWebApp.WidgetDesigners.Skills.SkillDesigner = function (element) {
    /* Initialize Skill_1 fields */
    this._skill_1 = null;

    /* Initialize Percentage_1 fields */
    this._percentage_1 = null;

    /* Initialize Skill_2 fields */
    this._skill_2 = null;

    /* Initialize Percentage_2 fields */
    this._percentage_2 = null;

    /* Calls the base constructor */
    SitefinityWebApp.WidgetDesigners.Skills.SkillDesigner.initializeBase(this, [element]);
}

SitefinityWebApp.WidgetDesigners.Skills.SkillDesigner.prototype = {
    /* --------------------------------- set up and tear down --------------------------------- */
    initialize: function () {
        /* Here you can attach to events or do other initialization */
        SitefinityWebApp.WidgetDesigners.Skills.SkillDesigner.callBaseMethod(this, 'initialize');
    },
    dispose: function () {
        /* this is the place to unbind/dispose the event handlers created in the initialize method */
        SitefinityWebApp.WidgetDesigners.Skills.SkillDesigner.callBaseMethod(this, 'dispose');
    },

    /* --------------------------------- public methods ---------------------------------- */

    findElement: function (id) {
        var result = jQuery(this.get_element()).find("#" + id).get(0);
        return result;
    },

    /* Called when the designer window gets opened and here is place to "bind" your designer to the control properties */
    refreshUI: function () {
        var controlData = this._propertyEditor.get_control().Settings; /* JavaScript clone of your control - all the control properties will be properties of the controlData too */

        /* RefreshUI Skill_1 */
        jQuery(this.get_skill_1()).val(controlData.Skill_1);

        /* RefreshUI Percentage_1 */
        jQuery(this.get_percentage_1()).val(controlData.Percentage_1);

        /* RefreshUI Skill_2 */
        jQuery(this.get_skill_2()).val(controlData.Skill_2);

        /* RefreshUI Percentage_2 */
        jQuery(this.get_percentage_2()).val(controlData.Percentage_2);
    },

    /* Called when the "Save" button is clicked. Here you can transfer the settings from the designer to the control */
    applyChanges: function () {
        var controlData = this._propertyEditor.get_control().Settings;

        /* ApplyChanges Skill_1 */
        controlData.Skill_1 = jQuery(this.get_skill_1()).val();

        /* ApplyChanges Percentage_1 */
        controlData.Percentage_1 = jQuery(this.get_percentage_1()).val();

        /* ApplyChanges Skill_2 */
        controlData.Skill_2 = jQuery(this.get_skill_2()).val();

        /* ApplyChanges Percentage_2 */
        controlData.Percentage_2 = jQuery(this.get_percentage_2()).val();
    },

    /* --------------------------------- event handlers ---------------------------------- */

    /* --------------------------------- private methods --------------------------------- */

    /* --------------------------------- properties -------------------------------------- */

    /* Skill_1 properties */
    get_skill_1: function () { return this._skill_1; },
    set_skill_1: function (value) { this._skill_1 = value; },

    /* Percentage_1 properties */
    get_percentage_1: function () { return this._percentage_1; },
    set_percentage_1: function (value) { this._percentage_1 = value; },

    /* Skill_2 properties */
    get_skill_2: function () { return this._skill_2; },
    set_skill_2: function (value) { this._skill_2 = value; },

    /* Percentage_2 properties */
    get_percentage_2: function () { return this._percentage_2; },
    set_percentage_2: function (value) { this._percentage_2 = value; }
}

SitefinityWebApp.WidgetDesigners.Skills.SkillDesigner.registerClass('SitefinityWebApp.WidgetDesigners.Skills.SkillDesigner', Telerik.Sitefinity.Web.UI.ControlDesign.ControlDesignerBase);


text:
import Immutable          from 'immutable';

import configureStore     from "./configure_store";

describe('configure store', function() {

  it('setups up initial state', function() {
    const settings = {
      csrf     : "csrf_token",
      apiUrl   : "http://www.example.com"
    };
    const initialState = {
      jwt      : "jwt_token",
      settings
    };
    const store = configureStore(initialState);
    expect(store.getState().settings).toBe(settings);
    expect(store.getState().jwt).toBe('jwt_token');
  });
});


text:
import React from 'react';
import { shallow, mount } from 'enzyme';
import { enzymeFind } from 'styled-components/test-utils';
import { CTAAnalytics } from '../../../utils/analytics';
import { contactInfo } from '../../../containers/Profile/data';
import EmailLink, { StyledA } from '../index';

jest.mock('utils/analytics', () => ({
  CTAAnalytics: jest.fn(),
}));

describe('<EmailLink />', () => {
  const renderComponent = (props = contactInfo) => shallow(<EmailLink {...props} />);
  const mountComponent = (props = contactInfo) => mount(<EmailLink {...props} />);

  it('should render a <a> tag', () => {
    const component = mountComponent();
    const styledA = enzymeFind(component, StyledA);
    expect(styledA.type()).toEqual('a');
  });

  describe('should render with prop: ', () => {
    it('href', () => {
      const component = renderComponent();
      expect(component.prop('href')).toBeDefined();
    });

    it('title', () => {
      const component = renderComponent();
      expect(component.prop('title')).toBeDefined();
    });

    it('target', () => {
      const component = renderComponent();
      expect(component.prop('target')).toBeDefined();
    });

    it('onClick', () => {
      const component = renderComponent();
      expect(component.prop('onClick')).toBeDefined();
    });
  });

  it('should contain text prop', () => {
    const component = renderComponent();
    expect(component.contains(contactInfo.text)).toBe(true);
  });

  it('should call CTAAnalytics with correct parameter', () => {
    const component = mountComponent();
    component.find('a').simulate('click');
    expect(CTAAnalytics).toHaveBeenCalledWith({ category: 'Email Link' });
  });
});


text:
requirejs.config({
	deps: [ 'main' ],
	//urlArgs: Date.now(),

	paths: {
		// directory aliases
		component: '../components',

		// external
		remote: '../components/remote/remote',
		remoteStorageAngular: '../components/remotestorage-angular/remotestorage-angular',
		remoteStorage: '../vendor/remotestorage.min',
		angularFire: 'https://cdn.firebase.com/libs/angularfire/0.3.0/angularfire.min',
		firebase: 'https://cdn.firebase.com/v0/firebase',
	},

	shim: {
		remoteStorageAngular: [ 'remoteStorage' ],
		angularFire: [ 'firebase' ],
		remote: [
			// Disable the storage sistem not used here
			'remoteStorageAngular',
			'angularFire',
		],
	}
});


text:
<?php
$title = "Registration";
include "functions.php";
include "includes" . DIR_SEPARATOR . "header.php";

if (isset($_SESSION['is_logged']))
{
    header('Location: files.php');
    exit;
}
?>

    Login | New Registration

    <form action="registration.php" method="POST">

Name: <input type="text" name="username" maxlength="20" size="20"/>

Password: <input type="password" name="password" maxlength="20" size="20"/>

<input type="submit" value="Sign Up" name="register">
            <input type="reset" value="Clear">

    </form>

<?php
if (isset($_POST['register']))
{
    // Нормализация на данните
    $username = strtolower(trim($_POST['username']));
    $password = trim($_POST['password']);
    $error = FALSE;

    // Валидация на данните
    if (!CheckForValidData($username))
    {
        echo '
' . '- You have entered invalid name!';
        $error = TRUE;
    }

    if (!CheckForValidData($password))
    {
        echo '
' . '- You have entered invalid password!';
        $error = TRUE;
    }

    $users = GetUsersData(); // Чете потребителските имена и пароли от файла

    if (array_key_exists($username, $users)) // Проверка дали съществува потребител с въведеното име
    {
        echo '
' . '- Username already exist!';
        $error = TRUE;
    }

    // Добавяме новият потребител към базата
    if (!$error)
    {
        CreateNewUser(array($username, $password));
    }
}
?>

<?php include "includes" . DIR_SEPARATOR . "footer.php"; ?>


text:
use strict;
use warnings;
use JSON;
use Getopt::Long qw(:config no_ignore_case no_auto_abbrev); #avoids conflicts with ex host and help
use File::Basename;
use Pod::Usage;
use FindBin;
use Data::Dumper;

my $abspath = $FindBin::Bin;

use lib '../lib';
use Engine;
use Toolkit_helpers qw(logger trim);
use Databases;
use Group_obj;
use JS_template_obj;

my $version = $Toolkit_helpers::version;

GetOptions(
  'help|?' => \(my $help),
  'd|engine=s' => \(my $dx_host),
  'template_name=s' => \(my $template_name),
  'action=s' => \(my $action),
  'source=s@' => \(my $sources),
  'all' => (\my $all),
  'version' => \(my $print_version),
  'dever=s' => \(my $dever),
  'debug:i' => \(my $debug),
  'configfile|c=s' => \(my $config_file)
) or pod2usage(-verbose => 1,  -input=>\*DATA);

pod2usage(-verbose => 2,  -input=>\*DATA) && exit if $help;
die  "$version\n" if $print_version;

my $engine_obj = new Engine ($dever, $debug);
$engine_obj->load_config($config_file);

if (defined($all) && defined($dx_host)) {
  print "Option all (-all) and engine (-d|engine) are mutually exclusive \n";
  pod2usage(-verbose => 1,  -input=>\*DATA);
  exit (1);
}

if (!defined($action) || ( ! ( (lc $action eq 'create' ) || (lc $action eq 'delete' ) ) ) ) {
  print "Action parameter not specified or has a wrong value - $action \n";
  pod2usage(-verbose => 1,  -input=>\*DATA);
  exit (1);
}

if ((lc $action eq 'create') && (!defined($sources))) {
  print "Parameter create required -source parameter\n";
  pod2usage(-verbose => 1,  -input=>\*DATA);
  exit (1);
}

# this array will have all engines to go through (if -d is specified it will be only one engine)
my $engine_list = Toolkit_helpers::get_engine_list($all, $dx_host, $engine_obj);

my $ret = 0;

for my $engine ( sort (@{$engine_list}) ) {
  # main loop for all work
  if ($engine_obj->dlpx_connect($engine)) {
    print "Can't connect to Dephix Engine $dx_host\n\n";
    $ret = $ret + 1;
    next;
  };

  my $jstemplates = new JS_template_obj ($engine_obj, $debug );

  if (lc $action eq 'create') {
    my $databases = new Databases($engine_obj, $debug);
    my $groups = new Group_obj($engine_obj, $debug);
    my @source_array;

    for my $soitem ( @{$sources} ) {

      my @single_source = split(',', $soitem);
      if (scalar(@single_source) ne 4) {
        print "Source parameter required a 4 comma separated values - group name, database name, source name, prority\n";
        pod2usage(-verbose => 1,  -input=>\*DATA);
        exit (1);
      }

      my $source_ref = Toolkit_helpers::get_dblist_from_filter(undef, trim($single_source[0]), undef, trim($single_source[1]), $databases, $groups, undef, undef, undef, undef, undef, undef, undef, $debug);

      if ((! defined($source_ref)) || (scalar(@{$source_ref}) < 1)) {
        print "Database " . trim($single_source[0]) . "/". trim($single_source[1]) . " not found\n";
        exit(1);
      }

      if (scalar(@{$source_ref}) > 1) {
        print "Database " . trim($single_source[0]) . "/". trim($single_source[1]) .  " is not unique\n";
        exit(1);
      }

      my @sourceline;

      $sourceline[0] = ($databases->getDB($source_ref->[0]))->getReference();
      $sourceline[1] = trim($single_source[2]);
      $sourceline[2] = trim($single_source[3]);

      push(@source_array, \@sourceline);

    }

    if ($jstemplates->createTemplate($template_name, \@source_array)) {
      print "Problem with creating a template $template_name\n";
      $ret = $ret + 1;
      next;
    } else {
      print "Template $template_name created\n";
    }
  } elsif (lc $action eq 'delete') {
    my $tempref = $jstemplates->getJSTemplateByName($template_name);
    if (!defined($tempref)) {
      print "Template name $template_name not found\n";
      $ret = $ret + 1;
      next;
    } else {
      if ($jstemplates->deleteTemplate($tempref)) {
        print "Problems with deleting template $template_name\n";
        $ret = $ret + 1;
        next;
      } else {
        print "Template $template_name deleted\n";
      }
    }

  }

}

exit $ret;

__DATA__

=head1 SYNOPSIS

 dx_ctl_js_template     [ -engine|d <delphix identifier> | -all ] [ -configfile file ]
                        -action create | delete
                        -template_name template_name
                        [ -source GroupName,DatabaseName,SourceName,Priority ]
                        [ -help|? ]
                        [ -debug ]

=head1 DESCRIPTION

Run a action on the JetStream container

=head1 ARGUMENTS

Delphix Engine selection - if not specified a default host(s) from dxtools.conf will be used.

=over 3

=item B<-engine|d>
Specify Delphix Engine name from dxtools.conf file

=item B<-all>
Display databases on all Delphix appliance

=item B<-configfile file>
Location of the configuration file.
A config file search order is as follow:
- configfile parameter
- DXTOOLKIT_CONF variable
- dxtools.conf from dxtoolkit location

=item B<-action create | delete>
Run an action on template

=item B<-template_name template_name>
Name of container's templates

=back

=head1 OPTIONS

=over 3

=item B<-source GroupName,DatabaseName,SourceName,Priority >
Comma separated list defining a template source (can be repeated if there are more sources)

=item B<-help>
Print this screen

=item B<-debug>
Turn on debugging

=back

=head1 Examples

Create a new templates based on one source

 dx_ctl_js_template -d Landshark51 -source "Sources, Oracle dsource, oracle, 1"  -action create -template_name template_new
 Template template_new created

Create a new templates based on two sources

 dx_ctl_js_template -d Landshark51 -source "Sources, Oracle dsource, oracle, 1" -source "Sources, Sybase dsource, sybase, 1"  -action create -template_name template2
 Template template2 created

Deleting template

 dx_ctl_js_template -d Landshark51 -action delete -template_name template2
 Template template2 deleted

=cut


text:
layout: splash
title: BAFA 2017
author_profile: false
classes:
  - landing
  - dark-theme
header:
  overlay_filter: "rgba(2, 83,167,0.4)"
  overlay_image: /assets/images/banner_net_2.jpg
  # cta_label: "Registration closed"
  # cta_url: ""

excerpt: 12-13 October 2017, Utrecht, The Netherlands

feature_speakers:
    - image_path: /assets/speakers/r_egnor.jpg
      alt: ""
      title: "Dr. Roian Egnor"
      excerpt: "
        Janelia Research Campus

        Topic:
*Something old and something new: using ethology and machine vision to decipher mouse social behavior*
      "
      url: /egnor
    - image_path: /assets/speakers/b_fisher.jpg
      alt: ""
      title: "Prof. Robert Fisher"
      excerpt: "
        University of Edinburgh

        Topic:
*Visual analysis of animal behaviour*
      "
      url: "/fisher"
    - image_path: /assets/speakers/l_vanderschuren.jpg
      alt: ""
      title: "Prof. Louk Vanderschuren"
      excerpt: "
        Utrecht University

        Topic:
*All Work and No Play: Studying the Neural Mechanisms of Social Play Behaviour in Rats*
      "
      url: "/vanderschuren"
    - image_path: /assets/speakers/y_winter.jpg
      alt: ""
      title: "Prof. York Winter"
      excerpt: "
        Humboldt University, Berlin

        Topic:
*Towards full automation of behaviour training and behaviour measurement*
      "
      url: "/winter"
---

# Thanks

We thank all participants and speakers for making this first BAFA workshop a success! Let's keep up the good work.

# Welcome to BAFA 2017
Behavioral Neuroscience relies more and more on computational methods such as automated measuring tools for rodent behavior. Our goal is to stimulate the collaboration between neuroscientists and computer scientists for the development and improvement of such tools. Specifically, we aim at bringing the two fields closer together by increasing the understanding of each other's challenges and requirements. Streamlining the efforts into a common direction will increase the validity and acceptance of the developed tools. Eventually, automated measuring tools form a part of a refined, standardized methodology for animal behavior research that improves the reproducibility of the results and the value for translating them to the human.

The BAFA workshop focuses on studying practical questions or ideas that are pitched by our invited speakers. Every pitch is followed by a break-out session in which the participants either work out one specific component of the idea in detail or map out the wider topic including opportunities, limitations and challenges. The highlights are collected in brief discussion rounds.

# Speakers
We proudly announce our four keynote speakers who will pitch their ideas for a better analysis with fewer animals.

{% include feature_row id="feature_speakers" %}

# Organizers
BAFA 2017 is organized by

* **Malte Lorbach**, Utrecht University, Department of Information and Computing Sciences
* **Ronald Poppe**, Utrecht University, Department of Information and Computing Sciences
* **Judith Homberg**, Radboud University Medical Center, Donders Institute for Brain, Cognition, and Behavior


text:
<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.radcheb</groupId>
	<artifactId>storm-tweets-sentiment</artifactId>
	<version>1.0-SNAPSHOT</version>
	<name>${project.artifactId}</name>
	<description>A storm topology to analyse tweets sentiment</description>
	<inceptionYear>2015</inceptionYear>

	<properties>
		<!-- <maven.compiler.source>1.5</maven.compiler.source> <maven.compiler.target>1.5</maven.compiler.target> -->
		<encoding>UTF-8</encoding>
		<scala.version>2.10.0</scala.version>
		<scala.main>com.radcheb.App</scala.main>
		<java.main>com.radcheb.stormtweets.SentimentAnalysisTopology</java.main>
	</properties>

	<repositories>
		<repository>
			<id>scala-tools.org</id>
			<name>Scala-Tools Maven2 Repository</name>
			<url>http://scala-tools.org/repo-releases</url>
		</repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>scala-tools.org</id>
			<name>Scala-Tools Maven2 Repository</name>
			<url>http://scala-tools.org/repo-releases</url>
		</pluginRepository>
	</pluginRepositories>

	<dependencies>
		<dependency>
			<groupId>org.scala-lang</groupId>
			<artifactId>scala-library</artifactId>
			<version>${scala.version}</version>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.1</version>
			<scope>test</scope>
		</dependency>
		<!-- <dependency> <groupId>org.scalatest</groupId> <artifactId>scalatest</artifactId>
			<version>1.2</version> <scope>test</scope> </dependency> -->
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<version>4.3.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.3.2</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>2.4.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.storm</groupId>
			<artifactId>storm-core</artifactId>
			<version>0.9.4</version>
<!-- 			<scope>provided</scope>
 -->			<exclusions>
				<exclusion>
					<artifactId>slf4j-api</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
				<exclusion>
					<artifactId>log4j-over-slf4j</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.kafka</groupId>
			<artifactId>kafka_2.10</artifactId>
			<version>0.8.2.0</version>
			<exclusions>
				<exclusion>
					<artifactId>slf4j-log4j12</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.storm</groupId>
			<artifactId>storm-kafka</artifactId>
			<version>0.9.4</version>
			<exclusions>
				<exclusion>
					<artifactId>slf4j-api</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-common</artifactId>
			<version>2.4.0</version>
			<exclusions>
				<exclusion>
					<artifactId>log4j</artifactId>
					<groupId>log4j</groupId>
				</exclusion>
				<exclusion>
					<artifactId>slf4j-api</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
				<exclusion>
					<artifactId>slf4j-log4j12</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-client</artifactId>
			<version>2.4.0</version>
			<exclusions>
				<exclusion>
					<artifactId>log4j</artifactId>
					<groupId>log4j</groupId>
				</exclusion>
				<exclusion>
					<artifactId>slf4j-api</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
				<exclusion>
					<artifactId>slf4j-log4j12</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>commons-configuration</groupId>
			<artifactId>commons-configuration</artifactId>
			<version>1.9</version>
			<exclusions>
				<exclusion>
					<groupId>log4j</groupId>
					<artifactId>log4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.4</version>
				</plugin>
				<plugin>
					<groupId>org.scala-tools</groupId>
					<artifactId>maven-scala-plugin</artifactId>
					<version>2.10.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.0</version>
					<configuration>
						<source>1.7</source>
						<target>1.7</target>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<sourceDirectory>src/main/java</sourceDirectory>
		<testSourceDirectory>src/test/java</testSourceDirectory>
		<plugins>
			<plugin>
				<groupId>org.scala-tools</groupId>
				<artifactId>maven-scala-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<mainClass>${scala.main}</mainClass>
						</manifest>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>scala-compile-first</id>
						<phase>process-resources</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
					<execution>
						<id>scala-test-compile</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<manifest>
							<mainClass>${java.main}</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>			<!-- A plugin to add excution parameters -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.4.0</version>
				<executions>
					<execution>
						<goals>
							<goal>java</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<mainClass>${java.main}</mainClass>
					<!-- optional -->
					<arguments>
						<!-- <argument>1</argument> -->
					</arguments>
				</configuration>
			</plugin>
			<!-- The maven jar plugin to build a customized jar (add main in manifest) -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<!-- The main class -->
							<mainClass>${java.main}</mainClass>
							<addClasspath>true</addClasspath>
							<classpathLayoutType>custom</classpathLayoutType>
							<!-- required to use libraries -->
							<customClasspathLayout>lib/$${artifact.artifactId}-$${artifact.version}$${dashClassifier?}.$${artifact.extension}
							</customClasspathLayout>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<!-- used to copy library files in the lib directory used in excution -->
			<plugin>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.3</version>
				<configuration>
					<outputDirectory>${project.build.directory}/lib</outputDirectory>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
from skrf.vi import vna as mv_vna
from skrf import Network
import pdb
import multiprocessing

class Private():
    def __init__(self):
        self.network = None
        self.vna = None
        self.ax = None
        self.logger = multiprocessing.get_logger()
        self.plot_format = 'Magnitude[dB]'
private = Private()

def connect_to_vna(text_gpib_address,text_gpib_timeout,choice_vna_model,\
        button_connect_to_vna,**kwargs):

    vna_class_dict = {\
            'HP8510C':mv_vna.HP8510C,\
            'HP8720':mv_vna.HP8720,\
            }
    if private.vna is not None:
        private.vna.close()
        private.vna = None
        button_connect_to_vna.label='Disconnected.'
        private.logger.error('VNA Disconnected ')
    else:
        try:
            private.vna = vna_class_dict[choice_vna_model.value]\
                    (int(text_gpib_address.value), \
                    timeout=int(text_gpib_timeout.value))
            button_connect_to_vna.label='Connected.'
            private.logger.info('VNA connected.')
        except:
            private.logger.error('VNA failed to load. ')
            button_connect_to_vna.label='Failed.'

def open_file(file_dialog, file_dialog_result,mpl_plot, **kwargs):
    file_dialog_result.value = file_dialog.open()
    private.network = Network(file_dialog_result.value)
    update_plot(mpl_plot)

def clear_file_dialog( file_dialog_result,**kwargs):
    file_dialog_result.value = ''

def save_file(file_dialog, file_dialog_result,**kwargs):
    if private.network is not None:
        if file_dialog_result.value is '':
            file_dialog_result.value = file_dialog.save()
        private.network.write_touchstone(file_dialog_result.value)
        private.logger.info('file: %s written.'%file_dialog_result.value)
    else:
        private.logger.error('No Network in memory')

def get_one_port(m,n, mpl_plot, *args, **kwargs):
    private.logger.info('Getting S%i%i'%(m,n))
    if private.vna is None:
        private.logger.error('VNA not connected')
    else:
        private.network = private.vna.__getattribute__('s%i%i'%(m,n))
        update_plot(mpl_plot    )

def get_two_port(mpl_plot, **kwargs):
    if private.vna is None:
        private.logger.error('VNA not connected')
    else:
        private.network = private.vna.two_port
        update_plot(mpl_plot)

def get_switch_terms(file_dialog_forward_switch_terms,\
        file_dialog_reverse_switch_terms, **kwargs):
    private.switch_terms = private.vna.switch_terms
    file_dialog_forward_switch_terms.title = 'Save Forward Switch Term'
    file_dialog_forward_switch_terms.filename = 'forward_switch_term.s1p'
    private.switch_terms[0].write_touchstone(\
            file_dialog_forward_switch_terms.save())
    file_dialog_reverse_switch_terms.title = 'Save Reverse Switch Term'
    file_dialog_reverse_switch_terms.filename = 'reverse_switch_term.s1p'
    private.switch_terms[1].write_touchstone(\
            file_dialog_reverse_switch_terms.save())

def get_s11(mpl_plot,  **kwargs):
    return get_one_port(1,1,mpl_plot)
def get_s12(mpl_plot, **kwargs):
    return get_one_port(1,2,mpl_plot)
def get_s21(mpl_plot, **kwargs):
    return get_one_port(2,1,mpl_plot)
def get_s22(mpl_plot, **kwargs):
    return get_one_port(2,2,mpl_plot)

def clear_plot(mpl_plot, **kwargs):
    mpl_plot.clear()
    mpl_plot.show()

def change_plot_format(radio_plot_format,mpl_plot, **kwargs):
    private.plot_format = radio_plot_format.value
    clear_plot(mpl_plot)
    update_plot(mpl_plot)

def update_plot(mpl_plot, **kwargs):
    plot_format = private.plot_format
    network = private.network
    type_dict = {\
            'Magnitude[dB]':'s_db',\
            'Phase[deg]':'s_deg',\
            'Smith Chart':'',\
            }
    #FUTURE FIX: this will work once bug is fixed in pythics
    #private.ax = mpl_plot.get_axes()
    #private.network.plot_s_db(m-1,n-1, ax = private.ax)
    for m in range (network.number_of_ports):
        for n in range(network.number_of_ports):
            mpl_plot.plot(network.frequency.f_scaled, \
                    network.__getattribute__(type_dict[plot_format])[:,m,n]\
                    , label= network.name )
            mpl_plot.set_xlabel('Frequency[%s]'%(network.frequency.unit))
            mpl_plot.set_ylabel(plot_format)
    mpl_plot.set_title(plot_format)
    mpl_plot.legend()
    mpl_plot.axis('tight')
    mpl_plot.show()


text:
"""empty message

Revision ID: afa58b54a8fe
Revises: 5d4aee209354
Create Date: 2019-04-18 17:40:20.275827

"""
from alembic import op
import sqlalchemy as sa
from waitlist.utility.sde import update_invtypes
from waitlist.base import db
from waitlist.storage.database import MarketGroup, InvGroup, InvCategory, InvType

# revision identifiers, used by Alembic.
revision = 'afa58b54a8fe'
down_revision = '5d4aee209354'
branch_labels = None
depends_on = None

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('fk_invmarketgroups_parent_group_id_invmarketgroups', 'invmarketgroups', type_='foreignkey')
    # adjust the type for the KF
    op.alter_column('invtypes', 'market_group_id', type_=sa.Integer, existing_type=sa.BigInteger)
    op.create_foreign_key(op.f('fk_invmarketgroups_parent_group_id_invmarketgroups'), 'invmarketgroups', 'invmarketgroups', ['parent_group_id'], ['market_group_id'], onupdate='CASCADE', ondelete='CASCADE')

    # now we actually need to make sure all of the ones we use FK to are up to date
    # this updates market groups and inventory groups+categories
    # only do this if there is any inventory data

    market_count = db.session.query(sa.func.count(MarketGroup.marketGroupID)).scalar()
    invgroup_count = db.session.query(sa.func.count(InvGroup.groupID)).scalar()
    invcat_count = db.session.query(sa.func.count(InvCategory.categoryID)).scalar()
    invtype_count = db.session.query(sa.func.count(InvType.typeID)).scalar()
    print("Queried counts")
    max_count = max(market_count, invgroup_count, invcat_count, invtype_count)
    if max_count > 0:
        print("We are updating all inventory data now, this can take a while")
        update_invtypes()
        print("Updating inventory data done")
    else:
        print("Empty database, no need to upgrade data")
    db.session.remove()

    # now we are ready to apply new FKs
    op.create_foreign_key(op.f('fk_invtypes_market_group_id_invmarketgroups'), 'invtypes', 'invmarketgroups', ['market_group_id'], ['market_group_id'], onupdate='CASCADE', ondelete='CASCADE')
    op.create_foreign_key(op.f('fk_invtypes_group_id_invgroup'), 'invtypes', 'invgroup', ['group_id'], ['group_id'], onupdate='CASCADE', ondelete='CASCADE')
    # ### end Alembic commands ###

def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('fk_invtypes_group_id_invgroup'), 'invtypes', type_='foreignkey')
    op.drop_constraint(op.f('fk_invtypes_market_group_id_invmarketgroups'), 'invtypes', type_='foreignkey')
    op.drop_constraint(op.f('fk_invmarketgroups_parent_group_id_invmarketgroups'), 'invmarketgroups', type_='foreignkey')
    op.alter_column('invtypes', 'market_group_id', _type=sa.BigInteger, existing_type=sa.Integer)
    op.create_foreign_key('fk_invmarketgroups_parent_group_id_invmarketgroups', 'invmarketgroups', 'invmarketgroups', ['parent_group_id'], ['market_group_id'])
    # ### end Alembic commands ###


text:
package se.uu.farmbio.vs.examples

import java.io.{ ByteArrayInputStream, ObjectInputStream, FileInputStream, PrintWriter, File }
import java.sql.DriverManager

import org.apache.spark.mllib.regression.LabeledPoint
import org.openscience.cdk.DefaultChemObjectBuilder
import org.openscience.cdk.interfaces.IAtomContainer
import org.openscience.cdk.io.iterator.IteratingSDFReader

import scopt.OptionParser
import se.uu.farmbio.vs.{ MLlibSVM, SGUtils_Serial }

import se.uu.it.cp.InductiveClassifier

/**
 * @author laeeq
 */

object StandalonePrediction {

  case class Arglist(
    master: String = null,
    conformersFile: String = null,
    sig2IdPath: String = null,
    filePath: String = null)

  def main(args: Array[String]) {
    val defaultParams = Arglist()
    val parser = new OptionParser[Arglist]("StandalonePrediction") {
      head("Predicting ligands with ready-made model")
      arg[String]("<conformers-file>")
        .required()
        .text("path to input SDF conformers file")
        .action((x, c) => c.copy(conformersFile = x))
      arg[String]("<sig2IdMap-file-Path>")
        .required()
        .text("path for loading old sig2Id Mapping File")
        .action((x, c) => c.copy(sig2IdPath = x))
      arg[String]("<predictions-file-Path>")
        .required()
        .text("path to predictions")
        .action((x, c) => c.copy(filePath = x))
    }

    parser.parse(args, defaultParams).map { params =>
      run(params)
    } getOrElse {
      sys.exit(1)
    }
    System.exit(0)
  }

  def run(params: Arglist) {
    //New molecules
    val sdfFile = new File(params.conformersFile);

    //Loading oldSig2ID Mapping
    val oldSig2ID = SGUtils_Serial.loadSig2IdMap(params.sig2IdPath)

    //Creating IteratingSDFReader for reading molecules
    val reader = new IteratingSDFReader(
      new FileInputStream(sdfFile), DefaultChemObjectBuilder.getInstance())

    //Getting Seq of IAtomContainer from reader
    var res = Seq[(IAtomContainer)]()
    while (reader.hasNext()) {
      //for each molecule in the record compute the signature
      val mol = reader.next
      res = res ++ Seq(mol)
    }

    //Array of IAtomContainers
    val iAtomArray = res.toArray

    //Unit sent as carry, later we can add any type required
    val iAtomArrayWithFakeCarry = iAtomArray.map { case x => (Unit, x) }

    //Generate Signature(in vector form) of New Molecule(s)
    val newSigns = SGUtils_Serial.atoms2LP_carryData(iAtomArrayWithFakeCarry, oldSig2ID, 1, 3)

    //Load Model
    val svmModel = loadModel()

    //Predict New molecule(s)
    val predictions = newSigns.map { case (sdfMols, features) => (features, svmModel.predict(features.toArray, 0.5)) }

    //Update Predictions to the Prediction Table
    val pw = new PrintWriter(params.filePath)
    predictions.foreach(pw.println(_))
    pw.close
  }

  def loadModel() = {
    //Connection Initialization
    Class.forName("org.mariadb.jdbc.Driver")
    val jdbcUrl = s"jdbc:mysql://localhost:3306/db_profile?user=root&password=2264421_root"
    val connection = DriverManager.getConnection(jdbcUrl)

    //Reading Pre-trained model from Database
    var model: InductiveClassifier[MLlibSVM, LabeledPoint] = null
    if (!(connection.isClosed())) {

      val sqlRead = connection.prepareStatement("SELECT r_model FROM MODELS")
      val rs = sqlRead.executeQuery()
      rs.next()

      val modelStream = rs.getObject("r_model").asInstanceOf[Array[Byte]]
      val modelBaip = new ByteArrayInputStream(modelStream)
      val modelOis = new ObjectInputStream(modelBaip)
      model = modelOis.readObject().asInstanceOf[InductiveClassifier[MLlibSVM, LabeledPoint]]

      rs.close
      sqlRead.close
      connection.close()
    } else {
      println("MariaDb Connection is Close")
      System.exit(1)
    }
    model
  }

}


text:
import React, { Component, PropTypes, Children, cloneElement } from 'react';
import Navbar from '../Navbar/navIndex';
import Header from '../Layout/headerPresenter';
import Footer from '../Layout/footerPresenter';
import HeaderBlock from '../Layout/headerBlockPresenter';
import MainBlock from '../Layout/mainBlockPresenter';
import {
  container,
  headerBlock,
  mainBlock,
  stickyActive,
  footerActive,
  copyright,
  aboutUs,
  landing,
  loginContainer,
  fitbitLogin,
  jawboneLogin,
} from '../../css/main.css';

class App extends Component {
  constructor(props) {
    super(props);
    this.isSticky = '';
    this.isFooter = '';
    this.onFooter = false;
    this.handleScroll = this.handleScroll.bind(this);
  }

  componentDidMount() {
    window.addEventListener('scroll', this.handleScroll);
  }

  componentWillUnmount() {
    window.removeEventListener('scroll', this.handleScroll);
  }

  handleScroll() {
    const { scrollTop } = document.body;
    const aRender = 150; // re-render trigger area
    const fScroll = 3350; // footer y-coordinate
    const hScroll = 750; // header y-coordinate
    const reRender = (
      (scrollTop > hScroll && scrollTop < hScroll + aRender) || (scrollTop < hScroll && scrollTop > hScroll - aRender) ||
      (scrollTop > fScroll && scrollTop < fScroll + aRender) || (scrollTop < fScroll && scrollTop > fScroll - aRender)
    );
    this.isSticky = scrollTop > hScroll ? stickyActive : '';
    this.isFooter = scrollTop > fScroll ? footerActive : '';
    this.onFooter = scrollTop > fScroll;
    if (reRender) this.setState({}); // trigger component re-rendering
  }

  render() {
    const { isAuth, children, history, user } = this.props;
    const { isSticky, isFooter, onFooter } = this;
    // const authCheck = (isAuth === 'false'); // disable auth for development purpose; comment this out in production
    const authCheck = (isAuth === 'true' || localStorage.getItem('auth') === 'true' && user.length !== 0); // uncomment this in production
    const childrenWithProps = Children.map(children, (child) => cloneElement(child, { isSticky })); // passing props to child components
    const classnames = `${container} ${isSticky}`; // add multiple class names
    return (

        {authCheck &&

            {isSticky &&
              <HeaderBlock headerBlock={headerBlock} />
            }
            {!isFooter &&

            }
            <MainBlock mainBlock={mainBlock} />
            {childrenWithProps}
            <Navbar
              hist={history}
              isSticky={isSticky}
              isFooter={isFooter}
              onFooter={onFooter}
              handleScroll={this.handleScroll}
            />
            <MainBlock mainBlock={mainBlock} />

        }
        {!authCheck &&

Welcome to Fitomo

Sign in with Fitbit

Sign in with Jawbone

        }

    );
  }
}

export default App;

App.propTypes = {
  isAuth: PropTypes.string.isRequired,
  user: PropTypes.array.isRequired,
  children: PropTypes.object.isRequired,
  history: PropTypes.object.isRequired,
};


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**is_construction** | **bool** |  | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
module Dragon
  class PlaceNarrator < Narrator
    alias_method :place, :model

    def narrate(terminal)
      if place.is_a?(Room)
        describe prefix: prefix, suffix: " of a #{place.building.describe}", terminal: terminal
      else
        describe prefix: prefix, terminal: terminal
      end

      if place.people.any?
        descriptor = describe_number_of_people(place.people.count)
        terminal.say "There #{descriptor} here: #{describe_people(place.people)}."
      end
    end

    def prefix
      "You are #{place_preposition} the "
    end

    def place_preposition
      if place.is_a?(Room)
        'in'
      elsif place.is_a?(Area)
        'wandering near'
      elsif place.is_a?(Building)
        'at'
      end
    end

    def describe_people(people)
      people.map(&:describe).join('; ')
    end

    def describe_number_of_people(number)
      case number
      when 0 then
        'is nobody'
      when 1 then
        'is one person'
      when 2 then
        'are two people'
      when (3..4) then
        'are a few people'
      when (5..6) then
        'are a bunch of people'
      else
        'is a crowd of people'
      end
    end
  end
end


text:
angular
    .module('app', [
        'ui.router'
        ])
    .config(['$urlRouterProvider', '$stateProvider', '$locationProvider', function($urlRouterProvider, $stateProvider, $locationProvider){
        $locationProvider.html5Mode(true);
        $urlRouterProvider.otherwise('/'); //seems to control what happens when navigating directly to routes from within the domain of the app

        //given to us by ui-router
        $stateProvider
            .state('home', {
                url: '/',
                templateUrl: 'app/home/home.html',
                controller: 'homeController'
            })
            .state('about', {
                url: '/about',
                templateUrl: 'app/about/about.html',
                controller: 'aboutController'
            });
    }]);


text:
title: Clustering Riak
layout: post
og_image_url: "https://blog.virtengine.com/res/gotalk-intro.png"
description: Clustering Riak
---

 Riak is a distributed NoSQL key-value data store that offers extremely high availability, fault tolerance, operational simplicity and scalability.[2] In addition to the open-source version, it comes in a supported enterprise version and a cloud storage version that is ideal for cloud computing environments.

 Written in Erlang, Riak has fault tolerance data replication and automatic data distribution across the cluster for performance and resilience

 Riak has a pluggable backend for its core storage, with the default storage backend being Bitcask.[7] LevelDB is also supported.

 **System Setup**

    	OS : Ubuntu 14.04.2 LTS
        Riak : Riak 2.1.1
Riak cluster needs atleast two servers. My servers are

	riak1's ip address is 192.168.1.11
    riak2's ip address is 192.168.1.12

`Do the installation(install riak step) in all the servers`

###### Install Riak :
Riak installation in pretty easy. Just wget the debian package from site and dpkg it.

    $ wget https://s3.amazonaws.com/downloads.basho.com/riak/2.1/2.1.1/ubuntu/trusty/riak_2.1.1-1_amd64.deb
    $ sudo dpkg -i riak_2.1.1-1_amd64.deb

After installing riak, we need to start it manually. Before starting riak, let's change the riak configuration.

riak's configuraton file is at `/etc/riak/riak.conf`

change the nodename of riak first,
	default

    	nodename = riak@LOCALHOST_IP

  Change it as

  		nodename = riak@SYSTEM_IP_ADDRESS

  Command to do this change

    	$ sudo sed -i 's/^[ \t]*nodename = riak.*/nodename = riak@SYSTEM_IP_ADDRESS/' /etc/riak/riak.conf

  Where $SYSTEM_IP_ADDRESS is YOUR_LOCAL_SYSTEM_IP

  In the same way change the http.listner and protobuf.listner ip

  	$ sudo sed -i 's/^[ \t]*listener.http.internal =.*/listener.http.internal = SYSTEM_IP_ADDRESS:8098/' /etc/riak/riak.conf
  	$ sudo sed -i 's/^[ \t]*listener.protobuf.internal =.*/listener.protobuf.internal = SYSTEM_IP_ADDRESS:8087/' /etc/riak/riak.conf

Start riak in all the servers

    $ sudo riak start

Now you have running riak in all the servers. In my case,

	riak@RIAK1_IP_ADDRESS
    riak@RIAK2_IP_ADDRESS
Both are running without any problem

###### Make Cluster

Now it is time to make cluster

From riak@RIAK1_IP_ADDRESS server, run this commands

	$ sudo riak-admin cluster join riak@RIAK2_IP_ADDRESS
    $ sudo riak-admin cluster plan
	$ sudo riak-admin cluster commit

That's it. Servers are clustered. You can check cluster status

	$ sudo riak-admin cluster status

  The result should be like

	  ---- Cluster Status ----
	Ring ready: true

	+------------------------+------+-------+-----+-------+
	|          node          |status| avail |ring |pending|
	+------------------------+------+-------+-----+-------+
	|     riak@RIAK1_IP_ADDRESS |valid |  up   | 50.0|  --   |
	| (C) riak@RIAK2_IP_ADDRESS |valid |  up   | 50.0|  --   |
	+------------------------+------+-------+-----+-------+

	Key: (C) = Claimant; availability marked with '!' is unexpected


text:
package alien4cloud.security.groups;

import java.beans.IntrospectionException;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import alien4cloud.security.model.Group;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.mapping.MappingBuilder;
import org.springframework.stereotype.Component;

import alien4cloud.dao.ESGenericSearchDAO;
import alien4cloud.dao.model.GetMultipleDataResult;
import alien4cloud.exception.IndexingServiceException;

@Component("group-dao")
public class ElasticSearchGroupDao extends ESGenericSearchDAO implements IAlienGroupDao {
    @Resource
    private MappingBuilder mappingBuilder;

    @PostConstruct
    public void initEnvironment() {
        // init ES annotation scanning
        try {
            mappingBuilder.initialize(Group.class.getPackage().getName());
        } catch (IntrospectionException | IOException e) {
            throw new IndexingServiceException("Could not initialize elastic search mapping builder", e);
        }
        // init indexes and mapped classes
        initIndices(Group.class.getSimpleName().toLowerCase(), null, new Class<?>[] { Group.class });
        initCompleted();
    }

    @Override
    public void save(Group group) {
        super.save(group);
    }

    @Override
    public Group find(String id) {
        return super.findById(Group.class, id);
    }

    @Override
    public void delete(String groupId) {
        delete(Group.class, groupId);
    }

    @Override
    public boolean isGroupWithNameExist(String groupName) {
        return super.count(Group.class, QueryBuilders.termQuery("name", groupName)) > 0;
    }

    @Override
    public GetMultipleDataResult search(String searchQuery, Map<String, String[]> filters, int from, int size) {
        return super.search(Group.class, searchQuery, filters, from, size);
    }

    @Override
    public GetMultipleDataResult find(Map<String, String[]> filters, int maxElements) {
        return super.find(Group.class, filters, maxElements);
    }

    @Override
    public List<Group> find(String... ids) {
        return super.findByIds(Group.class, ids);
    }

    @Override
    public Group findByName(String groupName) {
        return super.customFind(Group.class, QueryBuilders.termQuery("name", groupName));
    }

}


text:
layout: page
title: Tags
header: Posts By Tag
description: "This page shows a list of tags used in this blog."
group: navigation
---
{% capture tags %}
    {% for tag in site.tags %}
        {{ tag[0] | replace:' ',' ' }}
    {% endfor %}
{% endcapture %}

{% assign sorted_tags = tags | split:' ' | sort %}

    {% assign tags_list = sorted_tags %}
    {% include helpers/tags_list %}

{% for tag in sorted_tags %}
    {% assign actual_tag_name = tag | replace:' ',' ' %}

{{ actual_tag_name }}

        {% assign pages_list = site.tags[actual_tag_name] %}
        {% include helpers/pages_list %}

{% endfor %}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CitadelsApp.KindOfMagic
{
    internal class MagicAttribute : Attribute
    {
    }
}


text:
{% extends "base.html" %}
{% block content %}

Create new dataset

<form action="" method="post" name="create" enctype="multipart/form-data">
    {{ form.hidden_tag() }}
    {{ form.csrf_token }}

        <col style="width:45%">
        <col style="width:10%">
        <col style="width:45%">

                    Name
                    {{ form.name(class="form-control",
                    placeholder="enter a unique name to identify the dataset")}}

                    Folder (classification)
                    {{ form.folder(class="form-control")}}

                    Description
                    {{ form.description(class="form-control", rows=3,
                    placeholder="enter the objective of this dataset and the meaning of data")}}

                    Source
                    {{ form.source(class="form-control",
                    placeholder="origin or source of the dataset")}}

                    URL
                    {{ form.url(class="form-control",
                    placeholder="url of the description dataset")}}

                    Mode
                    {{ form.mode(class="form-control", **{"onchange":"changeMode(this.value)"}) }}

                    Data access mode
                    {{ form.mode_file(class="form-control", **{"onchange":"changeModeFile(this.value)"}) }}

                    Columns file

                        {{ form.filename_cols(class="form-control",
                        placeholder="optional file with description of the columns")}}

                        {{ form.file_cols(class="form-control") }}

                    Train set file

                        {{ form.filename_train(class="form-control",
                        placeholder="data file for training and evaluation") }}

                        {{ form.file_train(class="form-control") }}

                    Test set file

                        {{ form.filename_test(class="form-control",
                        placeholder="test file in benchmark mode") }}

                        {{ form.file_test(class="form-control") }}

                        Submit set file

                            {{ form.filename_submit(class="form-control",
                            placeholder="submit file in competition mode")}}

                            {{ form.file_submit(class="form-control") }}

                            Cancel

                            <button class="btn btn-primary">Save</button>

</form>

{% endblock %}


text:
require "rails_helper"

describe StyleGuide::Scss do
  describe "#file_review" do
    it "returns a completed file review" do
      style_guide = build_style_guide
      commit_file = build_commit_file

      result = style_guide.file_review(commit_file)

      expect(result).to be_completed
    end

    it "schedules a review job" do
      allow(Resque).to receive(:enqueue)
      style_guide = build_style_guide("config")
      commit_file = build_commit_file

      style_guide.file_review(commit_file)

      expect(Resque).to have_received(:enqueue).with(
        ScssReviewJob,
        filename: commit_file.filename,
        commit_sha: commit_file.sha,
        pull_request_number: commit_file.pull_request_number,
        patch: commit_file.patch,
        content: commit_file.content,
        config: "config"
      )
    end
  end

  describe "#file_included?" do
    it "returns true" do
      style_guide = build_style_guide

      expect(style_guide.file_included?(double)).to eq true
    end
  end

  private

  def build_style_guide(config = "config")
    repo_config = double("RepoConfig", raw_for: config)
    StyleGuide::Scss.new(repo_config, "ralph")
  end

  def build_commit_file
    line = double(
      "Line",
      changed?: true,
      content: "blah",
      number: 1,
      patch_position: 2
    )
    double(
      "CommitFile",
      content: "codes",
      filename: "lib/a.scss",
      line_at: line,
      sha: "abc123",
      patch: "patch",
      pull_request_number: 123
    )
  end
end


text:
export PS1="\w$ "

# Generic bash commands

function check_gems_outdated {
  if [ -f ./Gemfile ]; then
    bundle outdated
  fi
}

function check_yarn_outdated {
  if [ -f ./yarn.lock ]; then
    yarn outdated
  fi
}

function check_pods_outdated {
  if [ -f ./Gemfile ]; then
    if [ -f ./Podfile ]; then
      bundle exec pod outdated
    fi
  else
    if [ -f ./Podfile ]; then
      pod outdated
    fi
  fi
}

function outdated {
  check_gems_outdated
  check_pods_outdated
  check_yarn_outdated
}


text:
There are two methods for getting started with this repo.

#### Familiar with Git?
Checkout this repo, install dependencies, then start the gulp process with the following:

```
> git clone https://github.com/Mats2Nithin/Videobrowser.git
> npm install
> npm start
```

#### Not Familiar with Git?
Click [here](https://github.com/Mats2Nithin/Videobrowser) then download the .zip file.  Extract the contents of the zip file, then open your terminal, change to the project directory, and:

```
> npm install
> npm start
```