text:
from setuptools import setup, Extension
import os
import sys

readme_note = """\
.. note::

   For the latest source, discussion, etc, please visit the
   `GitHub repository <https://github.com/spotify/annoy>`_\n\n
"""

with open('README.rst') as fobj:
    long_description = readme_note + fobj.read()

setup(name='annoy',
      version='1.0.5',
      description='Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk.',
      packages=['annoy'],
      ext_modules=[Extension('annoy.annoylib', ['src/annoymodule.cc'], libraries=['boost_python'])],
      long_description=long_description,
      author='Erik Bernhardsson',
      author_email='erikbern@spotify.com',
      url='https://github.com/spotify/annoy',
      license='Apache License 2.0',
      classifiers=[
          'Development Status :: 5 - Production/Stable',
          'Programming Language :: Python',
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 2.6',
          'Programming Language :: Python :: 2.7',
      ],
      keywords='nns, approximate nearest neighbor search',
      setup_requires=['nose>=1.0']
    )


text:
package com.loca.addressbook.userinterface;

import com.loca.addressbook.exceptions.InvalidCommandException;
import com.loca.addressbook.exceptions.InvalidCommandParameterException;
import com.loca.addressbook.userinterface.commands.Command;
import com.loca.addressbook.userinterface.commands.CommandInterpreter;

public class CommandLineInterface implements InputHandler {

    private static final String WELCOME_MESSAGE = "Welcome to AddressBook 2.0!";
    private Console systemConsole;
    private CommandInterpreter commandInterpreter;

    public CommandLineInterface(CommandInterpreter commandInterpreter, SystemConsole systemConsole) {
        this.commandInterpreter = commandInterpreter;
        this.systemConsole = systemConsole;
        this.systemConsole.registerInputHandler(this);

    }

    public void start() {
        systemConsole.print(WELCOME_MESSAGE);
        systemConsole.readUserInput();
    }

    @Override
    public void handle(CommandLine commandLine) {
        try {
            Command command = commandInterpreter.interpret(commandLine);
            command.execute();
        } catch (InvalidCommandException | InvalidCommandParameterException e) {
            systemConsole.print(e.getMessage());
        }

    }

}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using ChrisTaylor.TfsQuickTasks.WorkItems;

namespace ChrisTaylor.TfsQuickTasks.WPF
{
    public class WorkItemQueryTemplateSelector : DataTemplateSelector
    {
        public HierarchicalDataTemplate WorkItemQueryFolderTemplate
        {
            get;
            set;
        }

        public HierarchicalDataTemplate WorkItemQueryTemplate
        {
            get;
            set;
        }

        public DataTemplate WorkItemTemplate
        {
            get;
            set;
        }

        public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
        {
            base.SelectTemplate(item, container);

            if (item is TfsWorkItemQueryFolder)
                return WorkItemQueryFolderTemplate;
            else if (item is TfsWorkItemQuery)
                return WorkItemQueryTemplate;
            else if (item is TfsWorkItem)
                return WorkItemTemplate;

            return null;

        }
    }
}


text:
.owid-key-performance-indicators .md-preview p {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.owid-key-performance-indicators .md-preview p:nth-of-type(2) {
    font-size: 1rem;
}

.wp-block-owid-grid
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1rem;
}

.owid-publication-context .components-notice {
    margin: 0 0 1rem;
}


text:
'use strict';

/* App Module */

var whichOnes = angular.module('whichOnes', [
  'whichOnesDirectives',
  'whichOnesControllers',
  'ngRoute',
  'ngSanitize'
]);


text:
{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Layout.ComboP
-- Description :  Combine multiple layouts and specify where to put new windows.
-- Copyright   :  (c) Konstantin Sobolev <konstantin.sobolev@gmail.com>
-- License     :  BSD-style (see LICENSE)
--
-- Maintainer  :  Konstantin Sobolev <konstantin.sobolev@gmail.com>
-- Stability   :  unstable
-- Portability :  unportable
--
-- A layout that combines multiple layouts and allows to specify where to put
-- new windows.
--
-----------------------------------------------------------------------------

module XMonad.Layout.ComboP (
                             -- * Usage
                             -- $usage
                             combineTwoP,
                             CombineTwoP,
                             SwapWindow(..),
                             PartitionWins(..),
                             Property(..)
                            ) where

import XMonad.Prelude
import XMonad hiding (focus)
import XMonad.StackSet ( Workspace (..), Stack(..) )
import XMonad.Layout.WindowNavigation
import XMonad.Util.WindowProperties
import qualified XMonad.StackSet as W

-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Layout.ComboP
--
-- and add something like
--
-- > combineTwoP (TwoPane 0.03 0.5) (tabbed shrinkText def) (tabbed shrinkText def) (ClassName "Firefox")
--
-- to your layouts. This way all windows with class = \"Firefox\" will always go
-- to the left pane, all others - to the right.
--
-- For more detailed instructions on editing the layoutHook see
-- <https://xmonad.org/TUTORIAL.html#customizing-xmonad the tutorial> and
-- "XMonad.Doc.Extending#Editing_the_layout_hook".
--
-- 'combineTwoP' is a simple layout combinator based on 'combineTwo' from Combo, with
-- addition of a 'Property' which tells where to put new windows. Windows mathing
-- the property will go into the first part, all others will go into the second
-- part. It supports @Move@ messages as 'combineTwo' does, but it also introduces
-- 'SwapWindow' message which sends focused window to the other part. It is
-- required because @Move@ commands don't work when one of the parts is empty.
-- To use it, import \"XMonad.Layout.WindowNavigation\", and add the following key
-- bindings (or something similar):
--
-- >    , ((modm .|. controlMask .|. shiftMask, xK_Right), sendMessage $ Move R)
-- >    , ((modm .|. controlMask .|. shiftMask, xK_Left ), sendMessage $ Move L)
-- >    , ((modm .|. controlMask .|. shiftMask, xK_Up   ), sendMessage $ Move U)
-- >    , ((modm .|. controlMask .|. shiftMask, xK_Down ), sendMessage $ Move D)
-- >    , ((modm .|. controlMask .|. shiftMask, xK_s    ), sendMessage $ SwapWindow)
--
-- For detailed instruction on editing the key binding see
-- <https://xmonad.org/TUTORIAL.html#customizing-xmonad the tutorial>.

data SwapWindow =  SwapWindow        -- ^ Swap window between panes
                 | SwapWindowN Int   -- ^ Swap window between panes in the N-th nested ComboP. @SwapWindowN 0@ equals to SwapWindow
                 deriving (Read, Show)
instance Message SwapWindow

data PartitionWins = PartitionWins  -- ^ Reset the layout and
                                    -- partition all windows into the
                                    -- correct sub-layout.  Useful for
                                    -- when window properties have
                                    -- changed and you want ComboP to
                                    -- update which layout a window
                                    -- belongs to.
                   deriving (Read, Show)
instance Message PartitionWins

data CombineTwoP l l1 l2 a = C2P [a] [a] [a] l (l1 a) (l2 a) Property
                                deriving (Read, Show)

combineTwoP :: (LayoutClass super(), LayoutClass l1 Window, LayoutClass l2 Window) =>
                super () -> l1 Window -> l2 Window -> Property -> CombineTwoP (super ()) l1 l2 Window
combineTwoP = C2P [] [] []

instance (LayoutClass l (), LayoutClass l1 Window, LayoutClass l2 Window) =>
    LayoutClass (CombineTwoP (l ()) l1 l2) Window where
    doLayout (C2P f w1 w2 super l1 l2 prop) rinput s =
        let origws = W.integrate s           -- passed in windows
            w1c = origws `intersect` w1      -- current windows in the first pane
            w2c = origws `intersect` w2      -- current windows in the second pane
            new = origws \\ (w1c ++ w2c)     -- new windows
            superstack = Just Stack { focus=(), up=[], down=[()] }
            f' = focus s:delete (focus s) f  -- list of focused windows, contains 2 elements at most
        in do
            matching <- hasProperty prop `filterM` new  -- new windows matching predecate
            let w1' = w1c ++ matching                     -- updated first pane windows
                w2' = w2c ++ (new \\ matching)            -- updated second pane windows
                s1 = differentiate f' w1'                 -- first pane stack
                s2 = differentiate f' w2'                 -- second pane stack
            ([((),r1),((),r2)], msuper') <- runLayout (Workspace "" super superstack) rinput
            (wrs1, ml1') <- runLayout (Workspace "" l1 s1) r1
            (wrs2, ml2') <- runLayout (Workspace "" l2 s2) r2
            return  (wrs1++wrs2, Just $ C2P f' w1' w2' (fromMaybe super msuper')
                (fromMaybe l1 ml1') (fromMaybe l2 ml2') prop)

    handleMessage us@(C2P f ws1 ws2 super l1 l2 prop) m
        | Just PartitionWins   <- fromMessage m = return . Just $ C2P [] [] [] super l1 l2 prop
        | Just SwapWindow      <- fromMessage m = swap us
        | Just (SwapWindowN 0) <- fromMessage m = swap us
        | Just (SwapWindowN n) <- fromMessage m = forwardToFocused us $ SomeMessage $ SwapWindowN $ n-1

        | Just (MoveWindowToWindow w1 w2) <- fromMessage m,
          w1 `elem` ws1,
          w2 `elem` ws2 = return $ Just $ C2P f (delete w1 ws1) (w1:ws2) super l1 l2 prop

        | Just (MoveWindowToWindow w1 w2) <- fromMessage m,
          w1 `elem` ws2,
          w2 `elem` ws1 = return $ Just $ C2P f (w1:ws1) (delete w1 ws2) super l1 l2 prop

        | otherwise = do ml1' <- handleMessage l1 m
                         ml2' <- handleMessage l2 m
                         msuper' <- handleMessage super m
                         if isJust msuper' || isJust ml1' || isJust ml2'
                            then return $ Just $ C2P f ws1 ws2
                                                 (fromMaybe super msuper')
                                                 (fromMaybe l1 ml1')
                                                 (fromMaybe l2 ml2') prop
                            else return Nothing

    description (C2P _ _ _ super l1 l2 prop) = "combining " ++ description l1 ++ " and "++
                                description l2 ++ " with " ++ description super ++ " using "++ show prop

-- send focused window to the other pane. Does nothing if we don't
-- own the focused window
swap :: (LayoutClass s a, LayoutClass l1 Window, LayoutClass l2 Window) =>
        CombineTwoP (s a) l1 l2 Window -> X (Maybe (CombineTwoP (s a) l1 l2 Window))
swap (C2P f ws1 ws2 super l1 l2 prop) = do
    mst <- gets (W.stack . W.workspace . W.current . windowset)
    let (ws1', ws2') = case mst of
            Nothing -> (ws1, ws2)
            Just st -> if foc `elem` ws1
                           then (foc `delete` ws1, foc:ws2)
                           else if foc `elem` ws2
                               then (foc:ws1, foc `delete` ws2)
                               else (ws1, ws2)
                       where foc = W.focus st
    if (ws1,ws2) == (ws1',ws2')
        then return Nothing
        else return $ Just $ C2P f ws1' ws2' super l1 l2 prop

-- forwards the message to the sublayout which contains the focused window
forwardToFocused :: (LayoutClass l1 Window, LayoutClass l2 Window, LayoutClass s a) =>
                    CombineTwoP (s a) l1 l2 Window -> SomeMessage -> X (Maybe (CombineTwoP (s a) l1 l2 Window))
forwardToFocused (C2P f ws1 ws2 super l1 l2 prop) m = do
    ml1 <- forwardIfFocused l1 ws1 m
    ml2 <- forwardIfFocused l2 ws2 m
    ms <- if isJust ml1 || isJust ml2
            then return Nothing
            else handleMessage super m
    if isJust ml1 || isJust ml2 || isJust ms
        then return $ Just $ C2P f ws1 ws2 (fromMaybe super ms) (fromMaybe l1 ml1) (fromMaybe l2 ml2) prop
        else return Nothing

-- forwards message m to layout l if focused window is among w
forwardIfFocused :: (LayoutClass l Window) => l Window -> [Window] -> SomeMessage -> X (Maybe (l Window))
forwardIfFocused l w m = do
    mst <- gets (W.stack . W.workspace . W.current . windowset)
    maybe (return Nothing) send mst where
    send st = if W.focus st `elem` w
                then handleMessage l m
                else return Nothing

-- code from CombineTwo
-- given two sets of zs and xs takes the first z from zs that also belongs to xs
-- and turns xs into a stack with z being current element. Acts as
-- StackSet.differentiate if zs and xs don't intersect
differentiate :: Eq q => [q] -> [q] -> Maybe (Stack q)
differentiate (z:zs) xs | z `elem` xs = Just $ Stack { focus=z
                                                     , up = reverse $ takeWhile (/=z) xs
                                                     , down = tail $ dropWhile (/=z) xs }
                        | otherwise = differentiate zs xs
differentiate [] xs = W.differentiate xs

-- vim:ts=4:shiftwidth=4:softtabstop=4:expandtab:foldlevel=20:


text:
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using Microsoft.Win32;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Ganji.EF.Contexts;
using System.Data.Entity;
using Ganji.Repo;
using ninlabs.Ganji_History.Listeners;

namespace ninlabs.Ganji_History
{
    /// <summary>
    /// This is the class that implements the package exposed by this assembly.
    ///
    /// The minimum requirement for a class to be considered a valid package for Visual Studio
    /// is to implement the IVsPackage interface and register itself with the shell.
    /// This package uses the helper classes defined inside the Managed Package Framework (MPF)
    /// to do it: it derives from the Package class that provides the implementation of the
    /// IVsPackage interface and uses the registration attributes defined in the framework to
    /// register itself and its components with the shell.
    /// </summary>
    // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is
    // a package.
    [PackageRegistration(UseManagedResourcesOnly = true)]
    // This attribute is used to register the informations needed to show the this package
    // in the Help/About dialog of Visual Studio.
    [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
    [Guid(GuidList.guidGanji_HistoryPkgString)]
    // VSContants.UICONTEXT_SolutionExists
    [ProvideAutoLoad("f1536ef8-92ec-443c-9ed7-fdadf150da82")]
    public sealed class Ganji_HistoryPackage : Package, IVsSolutionEvents
    {
        private uint m_solutionCookie = 0;
        public  EnvDTE.DTE m_dte { get; set; }

        /// <summary>
        /// Default constructor of the package.
        /// Inside this method you can place any initialization code that does not require
        /// any Visual Studio service because at this point the package object is created but
        /// not sited yet inside Visual Studio environment. The place to do all the other
        /// initialization is the Initialize method.
        /// </summary>
        public Ganji_HistoryPackage()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));
        }

        /////////////////////////////////////////////////////////////////////////////
        // Overriden Package Implementation
        #region Package Members

        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initilaization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            IVsSolution solution = (IVsSolution)GetService(typeof(SVsSolution));
            ErrorHandler.ThrowOnFailure(solution.AdviseSolutionEvents(this, out m_solutionCookie));
        }
        #endregion

        #region IVsSolutionEvents Members

        public int OnAfterCloseSolution(object pUnkReserved)
        {
            return VSConstants.S_OK;
        }

        public int OnAfterLoadProject(IVsHierarchy pStubHierarchy, IVsHierarchy pRealHierarchy)
        {
            return VSConstants.S_OK;
        }

        public int OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded)
        {
            return VSConstants.S_OK;
        }

        public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution)
        {
            InitializeWithDTEAndSolutionReady();
            return VSConstants.S_OK;
        }

        SaveListener m_saveListener;
        NavigateListener m_navigateListener;
        ExceptionListener m_exceptionListener;

        private void InitializeWithDTEAndSolutionReady()
        {
            m_dte = (EnvDTE.DTE)this.GetService(typeof(EnvDTE.DTE));

            if (m_dte == null)
                ErrorHandler.ThrowOnFailure(1);

            var solutionBase = "";
            var solutionName = "";
            if (m_dte.Solution != null)
            {
                solutionBase = System.IO.Path.GetDirectoryName(m_dte.Solution.FullName);
                solutionName = System.IO.Path.GetFileNameWithoutExtension(m_dte.Solution.FullName);
            }
            //string dbName = string.Format("Ganji.History-{0}.sdf", solutionName);

            var basePath = PreparePath();
            var ganjiContext = new GanjiContext();
            ganjiContext.RepositoryPath = System.IO.Path.Combine( basePath, "LocalHistory");
            ganjiContext.SolutionPath = solutionBase;

            CodeElementMagic.m_applicationObject = m_dte;

            HistoryContext.ConfigureDatabase(basePath);
            RemindersContext.ConfigureDatabase(basePath);
            SessionsContext.ConfigureDatabase(basePath);

            m_saveListener = new SaveListener();
            m_saveListener.Register(m_dte, ganjiContext);

            m_navigateListener = new NavigateListener();
            m_navigateListener.Register(m_dte, ganjiContext);

            m_exceptionListener = new ExceptionListener();
            m_exceptionListener.Register(m_dte, ganjiContext);
            //if (m_version != null)
            //{
            //    dbName = string.Format("ActivityDB{0}-{1}.sdf", m_version.ToString(),solutionName);
            //}

            //var basePath = PreparePath();
            //var path = System.IO.Path.Combine(basePath, dbName);
            //database = new Database(path);
            //database.OpenOrCreate();
        }

        private string PreparePath()
        {
            var basePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
            if (m_dte.Solution != null)
            {
                basePath = System.IO.Path.GetDirectoryName(m_dte.Solution.FullName);
            }
            basePath = System.IO.Path.Combine(basePath, ".HistoryData");
            if (!System.IO.Directory.Exists(basePath))
            {
                var info = System.IO.Directory.CreateDirectory(basePath);
                info.Attributes |= System.IO.FileAttributes.Hidden;
            }

            // Also prepare save/build data
            var contextPath = System.IO.Path.Combine(basePath, "LocalHistory");

            if (!System.IO.Directory.Exists(contextPath))
            {
                //System.IO.Directory.CreateDirectory(contextPath);

                var provider = new GitProviderLibGit2Sharp();
                provider.Init(contextPath);
            }

            return basePath;
        }

        public int OnBeforeCloseProject(IVsHierarchy pHierarchy, int fRemoved)
        {
            return VSConstants.S_OK;
        }

        public int OnBeforeCloseSolution(object pUnkReserved)
        {
            if (m_saveListener != null)
            {
                m_saveListener.Shutdown();
            }
            if (m_navigateListener != null)
            {
                m_navigateListener.Shutdown();
            }
            if (m_exceptionListener != null)
            {
                m_exceptionListener.Shutdown();
            }
            return VSConstants.S_OK;
        }

        public int OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy)
        {
            return VSConstants.S_OK;
        }

        public int OnQueryCloseProject(IVsHierarchy pHierarchy, int fRemoving, ref int pfCancel)
        {
            return VSConstants.S_OK;
        }

        public int OnQueryCloseSolution(object pUnkReserved, ref int pfCancel)
        {
            return VSConstants.S_OK;
        }

        public int OnQueryUnloadProject(IVsHierarchy pRealHierarchy, ref int pfCancel)
        {
            return VSConstants.S_OK;
        }

        #endregion
    }
}


text:
(function(angular) {
    'use strict';

    angular.module('viewmodel.details').controller('NameEditorController', ['$modalInstance', 'unitofwork', 'errorhandler', 'id', controller]);

    function controller($modalInstance, unitofwork, errorhandler, id) {
        this.staffingResourceId = id;
        this.firstName = null;
        this.middleName = null;
        this.lastName = null;
        this.$modalInstance = $modalInstance;

        errorhandler.includeIn(this);

        var ref = unitofwork.get(this.staffingResourceId);
        var uow = ref.value();

        var self = this;
        uow.staffingResources.withId(this.staffingResourceId)
            .then(function(data) {
                self.firstName = data.firstName;
                self.middleName = data.middleName;
                self.lastName = data.lastName;
            })
            .catch(self.handleError)
            .finally(function() { ref.release(); });
    }

    controller.prototype.confirm = function () {
        var result = {
            firstName: this.firstName,
            middleName: this.middleName,
            lastName: this.lastName
        };
        this.$modalInstance.close(result);
    }

    controller.prototype.cancel = function () {
        this.$modalInstance.dismiss('cancel');
    }

    controller.prototype.canConfirm = function() {
        return this.firstName !== '' && this.lastName !== '';
    }

})(window.angular);


text:
let TraceSource = require("./trace-source");

let TraceSources = { };
TraceSources.get = function(name) {
	if (!this[name])
		this[name] = new TraceSource(name);
	return this[name];
}

module.exports = TraceSources;


text:
import { assert } from 'chai';
import sinon from 'sinon';
import YandexLocation from '../../src/YandexLocation';
import geocode from '../fixtures/geocode.json';

const PROVIDER_CONFIG = {};

describe('YandexLocation', () => {
  it('Should properly export', () => {
    assert.isFunction(YandexLocation);
  });

  it('Should properly geocode address', done => {
    let location = new YandexLocation(PROVIDER_CONFIG);

    sinon.stub(location.getProvider(), 'geocode', address => Promise.resolve(geocode));

    location
      .geocode('Kirovohrad, Ukraine')
      .then(result => {
        assert.deepEqual(result, geocode);
        assert.ok(location.getProvider().geocode.calledOnce);
        assert.equal(location.getProvider().geocode.getCall(0).args[0], 'Kirovohrad, Ukraine');

        location.getProvider().geocode.restore();

        done();
      })
      .catch(done);
  });

  it('Should properly reverse latitude/longitude', done => {
    let location = new YandexLocation(PROVIDER_CONFIG);

    sinon.stub(location.getProvider(), 'reverse', (latitude, longitude) => Promise.resolve('Kirovohrad, Ukraine'));

    location
      .reverse(48.5131978440005, 32.25969628100046)
      .then(result => {
        assert.equal(result, 'Kirovohrad, Ukraine');
        assert.ok(location.getProvider().reverse.calledOnce);
        assert.deepEqual(location.getProvider().reverse.getCall(0).args[0], {
          lat: 48.5131978440005,
          lon: 32.25969628100046
        });

        location.getProvider().reverse.restore();

        done();
      })
      .catch(done);
  });
});


text:
package com.amazonaws.services.machinelearning.model.transform;

import java.util.Map;
import java.util.List;

import com.amazonaws.AmazonClientException;
import com.amazonaws.services.machinelearning.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.BinaryUtils;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.IdempotentUtils;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.util.json.*;

/**
 * RedshiftDataSpecMarshaller
 */
public class RedshiftDataSpecJsonMarshaller {

    /**
     * Marshall the given parameter object, and output to a SdkJsonGenerator
     */
    public void marshall(RedshiftDataSpec redshiftDataSpec,
            StructuredJsonGenerator jsonGenerator) {

        if (redshiftDataSpec == null) {
            throw new AmazonClientException(
                    "Invalid argument passed to marshall(...)");
        }

        try {
            jsonGenerator.writeStartObject();

            if (redshiftDataSpec.getDatabaseInformation() != null) {
                jsonGenerator.writeFieldName("DatabaseInformation");
                RedshiftDatabaseJsonMarshaller.getInstance().marshall(
                        redshiftDataSpec.getDatabaseInformation(),
                        jsonGenerator);
            }
            if (redshiftDataSpec.getSelectSqlQuery() != null) {
                jsonGenerator.writeFieldName("SelectSqlQuery").writeValue(
                        redshiftDataSpec.getSelectSqlQuery());
            }
            if (redshiftDataSpec.getDatabaseCredentials() != null) {
                jsonGenerator.writeFieldName("DatabaseCredentials");
                RedshiftDatabaseCredentialsJsonMarshaller.getInstance()
                        .marshall(redshiftDataSpec.getDatabaseCredentials(),
                                jsonGenerator);
            }
            if (redshiftDataSpec.getS3StagingLocation() != null) {
                jsonGenerator.writeFieldName("S3StagingLocation").writeValue(
                        redshiftDataSpec.getS3StagingLocation());
            }
            if (redshiftDataSpec.getDataRearrangement() != null) {
                jsonGenerator.writeFieldName("DataRearrangement").writeValue(
                        redshiftDataSpec.getDataRearrangement());
            }
            if (redshiftDataSpec.getDataSchema() != null) {
                jsonGenerator.writeFieldName("DataSchema").writeValue(
                        redshiftDataSpec.getDataSchema());
            }
            if (redshiftDataSpec.getDataSchemaUri() != null) {
                jsonGenerator.writeFieldName("DataSchemaUri").writeValue(
                        redshiftDataSpec.getDataSchemaUri());
            }

            jsonGenerator.writeEndObject();
        } catch (Throwable t) {
            throw new AmazonClientException(
                    "Unable to marshall request to JSON: " + t.getMessage(), t);
        }
    }

    private static RedshiftDataSpecJsonMarshaller instance;

    public static RedshiftDataSpecJsonMarshaller getInstance() {
        if (instance == null)
            instance = new RedshiftDataSpecJsonMarshaller();
        return instance;
    }

}


text:
require 'spec_helper'

class AttrWriter; end

describe AttrWriter do
  let(:klass) { subject.class }

  it 'will accept a `lambda` as a valid callback' do
    expect do
      klass.class_eval do
        attr_writer :foo, :foo_changed => lambda { |old_value, new_value| }
      end
    end.to_not raise_error

    expect(subject).to respond_to(:foo=)
    expect(subject).not_to respond_to(:foo)
  end

  it 'will accept a `proc` as a valid callback' do
    expect do
      klass.class_eval do
        attr_writer :foo, :foo_changed => proc { |old_value, new_value| }
      end
    end.to_not raise_error

    expect(subject).to respond_to(:foo=)
    expect(subject).not_to respond_to(:foo)
  end

  it 'will accept a `String` as a valid callback' do
    expect do
      klass.class_eval do
        attr_writer :foo, :foo_changed => 'foo_changed'
      end
    end.to_not raise_error

    expect(subject).to respond_to(:foo=)
    expect(subject).not_to respond_to(:foo)
  end

  it 'will accept a `Symbol` as a valid callback' do
    expect do
      klass.class_eval do
        attr_writer :foo, :foo_changed => :foo_changed
      end
    end.to_not raise_error

    expect(subject).to respond_to(:foo=)
    expect(subject).not_to respond_to(:foo)
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="BookmarkManager">
    <bookmark url="file://$PROJECT_DIR$" />
  </component>
  <component name="ChangeListManager">
    <list default="true" id="cdb932d9-7e58-4d94-93a9-e7b232ef17da" name="Default" comment="" />
    <ignored path="JavaFxApplication.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path="$PROJECT_DIR$/out/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="CoverageDataManager">
    <SUITE FILE_PATH="coverage/CROSS$Main.coverage" NAME="Main Coverage Results" MODIFIED="1505423585368" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false">
      <FILTER>cryogen.*</FILTER>
    </SUITE>
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DebuggerManager">
    <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true" converted="true">
      <breakpoint>
        <option name="NOTIFY_CAUGHT" value="true" />
        <option name="NOTIFY_UNCAUGHT" value="true" />
        <option name="ENABLED" value="false" />
        <option name="LOG_ENABLED" value="false" />
        <option name="LOG_EXPRESSION_ENABLED" value="false" />
        <option name="SUSPEND_POLICY" value="SuspendAll" />
        <option name="SUSPEND" value="true" />
        <option name="COUNT_FILTER_ENABLED" value="false" />
        <option name="COUNT_FILTER" value="0" />
        <option name="CONDITION_ENABLED" value="true" />
        <option name="CLASS_FILTERS_ENABLED" value="false" />
        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
        <option name="CONDITION" value="" />
        <option name="LOG_MESSAGE" value="" />
      </breakpoint>
      <breakpoint>
        <option name="NOTIFY_CAUGHT" value="true" />
        <option name="NOTIFY_UNCAUGHT" value="true" />
        <option name="ENABLED" value="false" />
        <option name="LOG_ENABLED" value="false" />
        <option name="LOG_EXPRESSION_ENABLED" value="false" />
        <option name="SUSPEND_POLICY" value="SuspendAll" />
        <option name="SUSPEND" value="true" />
        <option name="COUNT_FILTER_ENABLED" value="false" />
        <option name="COUNT_FILTER" value="0" />
        <option name="CONDITION_ENABLED" value="true" />
        <option name="CLASS_FILTERS_ENABLED" value="false" />
        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
        <option name="CONDITION" value="" />
        <option name="LOG_MESSAGE" value="" />
      </breakpoint>
    </breakpoint_any>
    <ui_properties converted="true" />
    <breakpoint_rules converted="true" />
  </component>
  <component name="FavoritesManager">
    <favorites_list name="JavaFxApplication" />
  </component>
  <component name="FileColors">
    <fileColor scope="Non-Project Files (Material Default)" color="2E3C43" />
    <fileColor scope="Non-Project Files (Material Darker)" color="323232" />
    <fileColor scope="Non-Project Files (Material Lighter)" color="eae8e8" />
    <fileColor scope="Non-Project Files (Material Palenight)" color="2f2e43" />
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Class" />
      </list>
    </option>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="false" />
    </FindUsagesManager>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="GradleLocalSettings">
    <option name="externalProjectsViewState">
      <projects_view />
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/src/sample/sample.fxml" />
        <option value="$PROJECT_DIR$/src/cryogen/CROSS.java" />
        <option value="$PROJECT_DIR$/src/cryogen/InvalidProjectTitleException.java" />
        <option value="$PROJECT_DIR$/src/cryogen/SharedMemoryRepository.java" />
        <option value="$PROJECT_DIR$/src/cryogen/CROSSStart.java" />
        <option value="$PROJECT_DIR$/src/cryogen/ProjectTableEntry.java" />
        <option value="$PROJECT_DIR$/src/cryogen/Criterions.java" />
        <option value="$PROJECT_DIR$/src/cryogen/CriterionIterator.java" />
        <option value="$PROJECT_DIR$/src/cryogen/Midna.css" />
        <option value="$PROJECT_DIR$/src/cryogen/Main.java" />
        <option value="$PROJECT_DIR$/src/cryogen/CROSSStart.fxml" />
        <option value="$PROJECT_DIR$/src/cryogen/Criterions.fxml" />
        <option value="$PROJECT_DIR$/src/cryogen/CriterionIterator.fxml" />
        <option value="$PROJECT_DIR$/src/cryogen/Results.fxml" />
        <option value="$PROJECT_DIR$/src/cryogen/Results.java" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds" fullScreen="true">
    <option name="x" value="30" />
    <option name="y" value="24" />
    <option name="width" value="1882" />
    <option name="height" value="1056" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes />
  </component>
  <component name="PropertiesComponent">
    <property name="GoToFile.includeJavaFiles" value="false" />
    <property name="OverrideImplement.combined" value="false" />
    <property name="GoToClass.toSaveIncludeLibraries" value="false" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="recentsLimit" value="5" />
    <property name="MemberChooser.sorted" value="false" />
    <property name="MemberChooser.showClasses" value="true" />
    <property name="GoToClass.includeLibraries" value="false" />
    <property name="dynamic.classpath" value="false" />
    <property name="MemberChooser.copyJavadoc" value="false" />
    <property name="aspect.path.notification.shown" value="true" />
    <property name="full.screen.before.presentation.mode" value="true" />
    <property name="settings.editor.selected.configurable" value="reference.settingsdialog.IDE.editor.colors" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../NWU Pukke/~ Java Programming/2017/ITRW 212/ITRW212-GUI-Prakties" />
    <property name="project.structure.last.edited" value="Project" />
    <property name="project.structure.proportion" value="0.0" />
    <property name="project.structure.side.proportion" value="0.2" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="RunManager" selected="Application.Main">
    <configuration name="Main" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
        <pattern>
          <option name="PATTERN" value="cryogen.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <option name="MAIN_CLASS_NAME" value="cryogen.Main" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="CROSS" />
      <envs />
      <RunnerSettings RunnerId="Run" />
      <ConfigurationWrapper RunnerId="Run" />
    </configuration>
    <configuration default="true" type="Applet" factoryName="Applet">
      <module />
      <option name="HTML_USED" value="false" />
      <option name="WIDTH" value="400" />
      <option name="HEIGHT" value="300" />
      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
    </configuration>
    <configuration default="true" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
    </configuration>
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="TEST_OBJECT" value="class" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="moduleWithDependencies" />
      </option>
      <envs />
      <patterns />
    </configuration>
    <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
      <module name="" />
      <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m" />
      <option name="PROGRAM_PARAMETERS" />
      <predefined_log_file id="idea.log" enabled="true" />
    </configuration>
    <configuration default="true" type="Remote" factoryName="Remote">
      <option name="USE_SOCKET_TRANSPORT" value="true" />
      <option name="SERVER_MODE" value="false" />
      <option name="SHMEM_ADDRESS" value="javadebug" />
      <option name="HOST" value="localhost" />
      <option name="PORT" value="5005" />
    </configuration>
    <configuration default="true" type="TestNG" factoryName="TestNG">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="SUITE_NAME" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="GROUP_NAME" />
      <option name="TEST_OBJECT" value="CLASS" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="OUTPUT_DIRECTORY" />
      <option name="ANNOTATION_TYPE" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="moduleWithDependencies" />
      </option>
      <option name="USE_DEFAULT_REPORTERS" value="false" />
      <option name="PROPERTIES_FILE" />
      <envs />
      <properties />
      <listeners />
    </configuration>
    <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="scope" value="ALL" />
      <option name="testName" />
      <method />
    </configuration>
    <configuration name="<template>" type="WebApp" default="true" selected="false">
      <Host>localhost</Host>
      <Port>5050</Port>
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="cdb932d9-7e58-4d94-93a9-e7b232ef17da" name="Default" comment="" />
      <created>1359379246138</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1359379246138</updated>
      <workItem from="1359379250712" duration="1302000" />
      <workItem from="1503695422400" duration="99000" />
      <workItem from="1503695628475" duration="4072000" />
      <workItem from="1503775246918" duration="2053000" />
      <workItem from="1504727995573" duration="780000" />
      <workItem from="1505209086539" duration="2511000" />
      <workItem from="1505294302434" duration="314000" />
      <workItem from="1505378510758" duration="163000" />
      <workItem from="1505401862583" duration="19984000" />
      <workItem from="1505425381077" duration="1461000" />
      <workItem from="1505565512633" duration="41878000" />
    </task>
    <task id="LOCAL-00001" summary="Fixed errors, now runnable">
      <created>1503778217081</created>
      <option name="number" value="00001" />
      <option name="presentableId" value="LOCAL-00001" />
      <option name="project" value="LOCAL" />
      <updated>1503778217081</updated>
    </task>
    <task id="LOCAL-00002" summary="Added Criterions specification mennu">
      <created>1505406975053</created>
      <option name="number" value="00002" />
      <option name="presentableId" value="LOCAL-00002" />
      <option name="project" value="LOCAL" />
      <updated>1505406975054</updated>
    </task>
    <task id="LOCAL-00003" summary="Added Criterions specification for each project, hoewever not working correctly, make a static class to share with all objects that holds the information.">
      <created>1505426816543</created>
      <option name="number" value="00003" />
      <option name="presentableId" value="LOCAL-00003" />
      <option name="project" value="LOCAL" />
      <updated>1505426816543</updated>
    </task>
    <task id="LOCAL-00004" summary="Cleaned up some code, removed duplicate code, created one shareable memory repository class for all other classes use by accessing global->universal data and using common code.">
      <created>1505578718049</created>
      <option name="number" value="00004" />
      <option name="presentableId" value="LOCAL-00004" />
      <option name="project" value="LOCAL" />
      <updated>1505578718049</updated>
    </task>
    <task id="LOCAL-00005" summary="Updated sliders to 10 instead of 100">
      <created>1505626522616</created>
      <option name="number" value="00005" />
      <option name="presentableId" value="LOCAL-00005" />
      <option name="project" value="LOCAL" />
      <updated>1505626522616</updated>
    </task>
    <task id="LOCAL-00006" summary="Updated sliders to 10 instead of 100">
      <created>1505628456589</created>
      <option name="number" value="00006" />
      <option name="presentableId" value="LOCAL-00006" />
      <option name="project" value="LOCAL" />
      <updated>1505628456589</updated>
    </task>
    <task id="LOCAL-00007" summary="Updated sliders to 10 instead of 100">
      <created>1505628461082</created>
      <option name="number" value="00007" />
      <option name="presentableId" value="LOCAL-00007" />
      <option name="project" value="LOCAL" />
      <updated>1505628461082</updated>
    </task>
    <option name="localTasksCounter" value="8" />
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="74617000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="-27" width="1920" height="1107" extended-state="0" />
    <layout>
      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3234714" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39940828" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="combo" />
      <window_info id="Profiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="14" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32840237" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
      <window_info id="Coverage" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="5.2083336E-4" sideWeight="0.5" order="10" side_tool="true" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32920536" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.209375" sideWeight="0.6703755" order="3" side_tool="false" content_ui="combo" />
      <window_info id="Problems" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32938856" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
    <layout-to-restore>
      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="combo" />
      <window_info id="Profiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="14" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
      <window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32962447" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.209375" sideWeight="0.6703755" order="3" side_tool="false" content_ui="combo" />
      <window_info id="Problems" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout-to-restore>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
    <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
    <MESSAGE value="Fixed errors, now runnable" />
    <MESSAGE value="Added Criterions specification mennu" />
    <MESSAGE value="Added Criterions specification for each project, hoewever not working correctly, make a static class to share with all objects that holds the information." />
    <MESSAGE value="Cleaned up some code, removed duplicate code, created one shareable memory repository class for all other classes use by accessing global->universal data and using common code." />
    <MESSAGE value="Updated sliders to 10 instead of 100" />
    <option name="LAST_COMMIT_MESSAGE" value="Updated sliders to 10 instead of 100" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="5" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="antWorkspaceConfiguration">
    <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
    <option name="FILTER_TARGETS" value="false" />
  </component>
  <component name="masterDetails">
    <states>
      <state key="ArtifactsStructureConfigurable.UI">
        <settings>
          <artifact-editor />
          <last-edited>JavaFXApp</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
                <option value="0.5" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="FacetStructureConfigurable.UI">
        <settings>
          <last-edited>No facets are configured</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="GlobalLibrariesConfigurable.UI">
        <settings>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="JdkListConfigurable.UI">
        <settings>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ModuleStructureConfigurable.UI">
        <settings>
          <last-edited>CROSS</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
                <option value="0.6" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ProjectLibrariesConfigurable.UI">
        <settings>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </component>
</project>


text:
Homework 1
==========
## Homework information
Due date: 23:59:59, 27th of November, 2014.

You are to submit a single **.zip** archive named **groupNumber.fn.hw1.zip**
where **groupNumber** is your group and **fn** is your faculty number.
Upload the archive to moodle.

This is ok: ***group1.66666.hw1.zip***

This is not: ***domashno1.rar***

Your zip archive must contain only **.java** files - no folders, no other files.

Additionally, **you'll improve your grade** by +1 if you commit your work in github
and +2 if you send us a pull a request at
* https://github.com/NikolaDimitroff/DSA-Demo-Library for groups 1 and 2
* https://github.com/jorenca/SDA-Tasks for groups 4 and 5

## Task - File Encryption

You are given this interface:

```java
import java.util.LinkedList;

/**
 * You have to implement this class. The encryption algorithm is described below.
 * Replace FN with your faculty number.
 * @author Georgi Gaydarov
 */
public interface FileEncoderFN {
    /**
     * Encodes a file with the specified key and saves the result to a given file.
     * @param sourceFile - path to the initial file
     * @param destinationFile - path to the result file
     * @param key - list of replacement bytes
     */
    public void encode(String sourceFile, String destinationFile, LinkedList<Character> key);

    /**
     * Decodes a file that was encoded with the above algorithm.
     * @param encodedFile - path to encoded file
     * @param destinationFile - path to the result file
     * @param key - list of replacement bytes that were used to encode the file
     */
    public void decode(String encodedFile, String destinationFile, LinkedList<Character> key);
}
```
If your faculty number is *123456* then your class should be called `FileEncoder123456`.

You are given a path to a file which has to be encoded.
You are also given a path where to write the resulting file.
Finally, you are given a list of 256 bytes, each different from the others.
Your task is to implement the encryption and decryption methods described above
using the following algorithm:

```
For i = 0, i < sourceFile.lengthInBytes, i++
    char b = sourceFile[i]
    if i is a prime number or 1:
        write b to the destination file as is
    else:
        write to the destination file the value of the b-th element of the key
```
Here's an example. Let's say you are given the following source file and key:

**Source file**: 4 3 2 0 5...

**Key**: 123 101 111 222 251 42...

Then the output file should start like this:

**Output**: 251 3 2 0 42 ...

* i = 0 is not a prime, we replace it with the 4th element of the key (write 251 to the output).
* i = 1 is a special case and fits in the prime number category, we leave it as is (write 3 to the output)
* i = 2 is a prime, we leave it as is (write 2 to the output)
* i = 3 is a prime, leave it as is (write 0 to the output)
* i = 4 is not a prime, replace it with 5th element of the key (write 42 to the output)

To put it another way:

The first, second, third, fifth, seventh, etc... byte in the input file is preserved.
The fourth, sixth, eighth, ninth, etc. byte in the input file is encoded.
Your class should be able to encode files in this manner and decode them accordingly.

## Grading scale

We'll run your solution on several tests and compare it with ours using the following
formula:

`performance = sum(authorSolutionTime[i] / yourSolutionTime[i]) / testCount`
(`i` is for every test example)

Your marks will be assigned using this sample code:

```java
int grade = 2;
if (performance > 0.7)
    grade = 6;
else if (performance > 0.5)
    grade = 5;
else if (performance > 0.3)
    grade = 4;
else if (performance > 0.1)
    grade = 3;
```

If any of your tests gives a wrong result, you'll get 0 points for it.

If you cheat by copying your solution from a classmate or the internet, you'll get 0
points for the **ALL** tests.

## Notes
* The files you are to encode will be no larger than 300kb.


text:
function [newPhi, newVarBound] = ...
  CBIG_AuthorTopic_EstimateVariationalDistribution(params, ...
  newVarBound, varBoundFlag)
% [newPhi, newVarBound] = ...
%   CBIG_AuthorTopic_EstimateVariationalDistribution(params, ...
%   newVarBound, varBoundFlag)
%
% Update the parameters of the variation distribution phi of the
% Collapsed Variational Bayes (CVB) algorithm.
% Optionally update the lower bound of the data log likelihood.
%
% Input:
%  - params      : struct containing parameters of the author-topic model
%                  and the CVB algorithm.
%  - newVarBound : current estimate of the lower bound of the data log
%                  likelihood.
%  - varBoundFlag: if true, update the lower bound and do nothing otherwise.
% Output:
%  - newPhi      : updated estimate of the parameters of the variational
%                  distribution.
%  - newVarBound : updated estimate of the variational log likelihood.
%
% Example:
%   [newPhi, newVarBound] = ...
%     CBIG_AuthorTopic_EstimateVariationalDistribution(params, ...
%     newVarBound, true)
%   Update the parameters of the variational distribution and the lower
%   bound of the data log likelihood.
%
% Reference:
%   1) Eq(14) of the Supplemental S1 of Ngo et al., 2019,
%      "Beyond Consensus: Embracing Heterogeneity in Curated
%       Neuroimaging Meta-Analysis"
%
% Written by Gia H. Ngo and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

  newPhi = cell(params.E, 1);
  for e = 1:params.E
    Ne = params.fociCounts(e);
    Te = params.expByNumTasks(e);
    newPhi{e} = zeros(Ne, params.K, Te, 'single');
  end;

  [newPhi, newVarBound] = CBIG_AuthorTopic_ComputeVariationalTerm__N_c(params, newPhi, newVarBound, varBoundFlag);
  [newPhi, newVarBound] = CBIG_AuthorTopic_ComputeVariationalTerm__N_cv(params, newPhi, newVarBound, varBoundFlag);
  [newPhi, newVarBound] = CBIG_AuthorTopic_ComputeVariationalTerm__N_t(params, newPhi, newVarBound, varBoundFlag);
  [newPhi, newVarBound] = CBIG_AuthorTopic_ComputeVariationalTerm__N_tc(params, newPhi, newVarBound, varBoundFlag);

  % normalize new phi
  newPhi = CBIG_AuthorTopic_NormalizePhi(newPhi, params);


text:
/**
 * Package for User.
 * @author Wladyslaw Lazin (mailto:wladislaw.lazin@gmail.com)
 * @version $Id$
 * @since 26.11.17
 */
package ru.job4j.userconvert;


text:
namespace syncer {
class WriteNode;

namespace syncable {

class BaseWriteTransaction;

enum CreateNewUpdateItem {
  CREATE_NEW_UPDATE_ITEM
};

enum CreateNewTypeRoot { CREATE_NEW_TYPE_ROOT };

// This Entry includes all the operations one can safely perform on the sync
// thread.  In particular, it does not expose setters to make changes that need
// to be communicated to the model (and the model's thread).  It is not possible
// to change an entry's SPECIFICS or UNIQUE_POSITION fields with this kind of
// entry.
class SYNC_EXPORT_PRIVATE ModelNeutralMutableEntry : public Entry {
 public:
  ModelNeutralMutableEntry(BaseWriteTransaction* trans,
                           CreateNewUpdateItem,
                           const Id& id);
  ModelNeutralMutableEntry(BaseWriteTransaction* trans,
                           CreateNewTypeRoot,
                           ModelType type);
  ModelNeutralMutableEntry(BaseWriteTransaction* trans, GetByHandle, int64);
  ModelNeutralMutableEntry(BaseWriteTransaction* trans, GetById, const Id&);
  ModelNeutralMutableEntry(
      BaseWriteTransaction* trans,
      GetByClientTag,
      const std::string& tag);
  ModelNeutralMutableEntry(
      BaseWriteTransaction* trans,
      GetTypeRoot,
      ModelType type);

  inline BaseWriteTransaction* base_write_transaction() const {
    return base_write_transaction_;
  }

  // Non-model-changing setters.  These setters will change properties internal
  // to the node.  These fields are important for bookkeeping in the sync
  // internals, but it is not necessary to communicate changes in these fields
  // to the local models.
  //
  // Some of them trigger the re-indexing of the entry.  They return true on
  // success and false on failure, which occurs when putting the value would
  // have caused a duplicate in the index.  The setters that never fail return
  // void.
  void PutBaseVersion(int64 value);
  void PutServerVersion(int64 value);
  void PutServerMtime(base::Time value);
  void PutServerCtime(base::Time value);
  bool PutId(const Id& value);
  void PutServerParentId(const Id& value);
  bool PutIsUnsynced(bool value);
  bool PutIsUnappliedUpdate(bool value);
  void PutServerIsDir(bool value);
  void PutServerIsDel(bool value);
  void PutServerNonUniqueName(const std::string& value);
  bool PutUniqueServerTag(const std::string& value);
  bool PutUniqueClientTag(const std::string& value);
  void PutUniqueBookmarkTag(const std::string& tag);
  void PutServerSpecifics(const sync_pb::EntitySpecifics& value);
  void PutBaseServerSpecifics(const sync_pb::EntitySpecifics& value);
  void PutServerUniquePosition(const UniquePosition& value);
  void PutServerAttachmentMetadata(const sync_pb::AttachmentMetadata& value);
  void PutSyncing(bool value);

  // Do a simple property-only update of the PARENT_ID field.  Use with caution.
  //
  // The normal Put(IS_PARENT) call will move the item to the front of the
  // sibling order to maintain the linked list invariants when the parent
  // changes.  That's usually what you want to do, but it's inappropriate
  // when the caller is trying to change the parent ID of a the whole set
  // of children (e.g. because the ID changed during a commit).  For those
  // cases, there's this function.  It will corrupt the sibling ordering
  // if you're not careful.
  void PutParentIdPropertyOnly(const Id& parent_id);

  // This is similar to what one would expect from Put(TRANSACTION_VERSION),
  // except that it doesn't bother to invoke 'SaveOriginals'.  Calling that
  // function is at best unnecessary, since the transaction will have already
  // used its list of mutations by the time this function is called.
  void UpdateTransactionVersion(int64 version);

 protected:
  explicit ModelNeutralMutableEntry(BaseWriteTransaction* trans);

  syncable::MetahandleSet* GetDirtyIndexHelper();

 private:
  friend class syncer::WriteNode;
  friend class Directory;

  // Don't allow creation on heap, except by sync API wrappers.
  void* operator new(size_t size) { return (::operator new)(size); }

  // Kind of redundant. We should reduce the number of pointers
  // floating around if at all possible. Could we store this in Directory?
  // Scope: Set on construction, never changed after that.
  BaseWriteTransaction* const base_write_transaction_;

  DISALLOW_COPY_AND_ASSIGN(ModelNeutralMutableEntry);
};

}  // namespace syncable
}  // namespace syncer

#endif  // SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_


text:
package com.missionhub.ui;

import android.support.v4.view.MenuItemCompat;
import android.view.Menu;
import android.view.MenuItem;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.missionhub.R;

import org.holoeverywhere.LayoutInflater;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class ProgressItemHelper {

    final private Set<Object> mTasks = Collections.synchronizedSet(new HashSet<Object>());
    private Animation mAnimation;
    private MenuItem mRefreshItem;
    private ImageView mRefreshView;

    public ProgressItemHelper() {
    }

    public void onCreateOptionsMenu(final Menu menu) {
        mRefreshItem = menu.add(Menu.NONE, R.id.action_refresh, Menu.NONE, R.string.action_refresh).setIcon(R.drawable.ic_action_refresh);
        MenuItemCompat.setShowAsAction(mRefreshItem, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
        update();
    }

    public void onDestroyView() {
        mRefreshView = null;
    }

    public void onCreateView(final LayoutInflater inflater) {
        mAnimation = AnimationUtils.loadAnimation(inflater.getContext(), R.anim.clockwise_refresh);
        mAnimation.setRepeatCount(Animation.INFINITE);
        mRefreshView = (ImageView) inflater.inflate(R.layout.refresh_icon, null);
        update();
    }

    private synchronized void update() {
        if (mRefreshItem == null || mRefreshView == null || mAnimation == null) return;

        if (!mTasks.isEmpty()) {
            mRefreshView.startAnimation(mAnimation);
            MenuItemCompat.setActionView(mRefreshItem, mRefreshView);
        } else {
            mRefreshView.clearAnimation();
            MenuItemCompat.setActionView(mRefreshItem, null);
        }
    }

    public synchronized void addProgress(final Object task) {
        mTasks.add(task);
        update();
    }

    public synchronized void removeProgress(final Object task) {
        mTasks.remove(task);
        update();
    }

    public synchronized void clearProgress() {
        mTasks.clear();
        update();
    }

    public synchronized boolean hasProgress(final Object task) {
        return mTasks.contains(task);
    }
}


text:
FBC.RoomPickerColumn = function() {
    var that = this;

    var _suggestedRooms = {}, // presence of key used to avoid duplicates
        _gotTop10 = false,
        _gotPages = false,
        _top10 = {},
        _pages = {}; // for some reason suggested rooms (not top 10) are called "pages"... i don't remember. maps shortName -> bool. oh yeah, because they were FB pages.

    this.joinRoom = function(data) {
        FBC.RoomManager.joinRoom(data, that.pub);
    };

    this.joinRoomName = function(roomName) {
        // roomName is a shortname, i.e. a subreddit like "pics" or "wtf"
        FBC.RoomManager.joinRoomName(roomName, that.pub);
    };

    this.roomLinkLi = function(room, numonline, callback) {
        // `room` is an API <Room>, not a FBC.Room object
        var li = $('
');
        if (room.image_url) {
            li.append($('').addClass('room_icon'));
        }
        var div = $('
').appendTo(li);
        var title = FBC.Room(room).displayName();
        div.append($('').addClass('fakelink').text(title));
        div.append($('
'));
        var numOnlineMsg;

        // Got rid of this case because we always have numonline
        // for rooms that exist, since the get top 10 fetched
        // all rooms info.
        //if ((numonline === null) || (numonline === undefined)) {
        //    numOnlineMsg = ' ';
        //} else if (!numonline) {

        if (!numonline) {
            numOnlineMsg = 'Get this room started';
        } else {
            numOnlineMsg = numonline + ' online'
        }
        div.append($('').html(numOnlineMsg).css('color', '#666666'));
        li.click(callback);
        return li;
    };

    this.gotTop10 = function(rooms) {
        // `rooms` is a list of [<Room>, numonline] tuples
        console.log('gotTop10 got', rooms);
        _gotTop10 = true;
        _top10 = {};
        var ul = $('.top_rooms ul', that.element);
        ul.empty();
        var numSuggested = 0;
        $.each(rooms, function(_idx, roomPair) {
            var room = roomPair[0],
                numOnline = roomPair[1];
            var normName = FBC.API.normalizeShortname(room.shortname);
            if (_pages[normName]) {
                // We already suggested this room
                return;
            }
            if (FBC.RoomManager.inRoom(room.id)) {
                return;
            }
            numSuggested++;
            _top10[normName] = true;
            var li = that.roomLinkLi(
                room,
                numOnline,
                function() { that.joinRoom(room); }
            );
            ul.append(li);
        });
        if (numSuggested) {
            $('.top_rooms', that.element).show();
        }
        if (_gotTop10 && _gotPages) {
            $('.loading_suggestions', this.element).hide();
        }
    };

    this.gotRoomSuggestions = function(rooms) {
        // TODO: factor out w/above
        console.log('gotRoomSuggestions ', rooms);
        _gotPages = true;
        _pages = {};
        var ul = $('.interest_rooms ul', that.element);
        ul.empty();
        var numSuggested = 0;
        $.each(rooms, function(_idx, room) {
            // val is (<Room>, subreddit_id) tuple
            if (_top10[room.shortname]) {
                return;
            }
            if (FBC.RoomManager.inRoom(room.id)) {
                return;
            }
            numSuggested++;
            _pages[room.shortname] = true;
            var li = that.roomLinkLi(
                room,
                FBC.RoomDB.numOnline(room.id),
                function() { that.joinRoom(room); }
            );
            ul.append(li);
        });
        if (numSuggested) {
            $('.interest_rooms', that.element).show();
        }
        if (_gotTop10 && _gotPages) {
            $('.loading_suggestions', this.element).hide();
        }
    };

    this.userUpdated = function() {
        /* Suggest Reddit rooms to all Users:*/
        if (FBC.User) {
            $('.loading_suggestions', this.element).show();
            _gotPages = false;
            $('.interest_rooms', that.element).hide();
            $.ajax({
                type: 'GET',
                url: '/d/roomsuggestions/',
                dataType: 'json',
                success: function(data){
                    FBC.RoomDB.whenReady(
                        function() {
                            try {
                                that.gotRoomSuggestions(data);
                            } catch(e) {
                                console.log("ERROR when suggesting:");
                                console.log(e);
                            }
                        }
                    );
                },
                error: FBC.GlobalError
            });
        } else {
            _gotPages = true;
            if (_gotTop10) {
                $('.loading_suggestions', this.element).hide();
            }
        }
    };

    this.setupEvents = function() {
        $('.closer', this.element).click(function() {
            FBC.ColumnManager.deleteColumn(that.pub);
        });
        $('form', this.element).submit(function() {
            var roomName = $('input:text', this).val();
            // DON'T normalize; do it server-side so as to maintain case
            roomName = $.trim(roomName);
            if (!roomName.length) {
                return false;
            }
            $('input', this).attr('disabled', 'disabled');
            that.joinRoomName(roomName);
            return false;
        });
    };

    this.init = function() {
        FBC.ColumnPrototype.init.apply(this, arguments);
        FBC.RoomDB.getTop10(this.gotTop10);
    }
}
FBC.RoomPickerColumn.prototype = FBC.ColumnPrototype;


text:
<!DOCTYPE html>

    <title>LoginViewController Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

SymondsTimetable Docs (100% documented)

        SymondsTimetable Reference

        LoginViewController Class Reference

            Classes

                AddFriendViewController

                AppDelegate

                Attributions

                AttributionsViewController

                CloudKitManager

                Day

                – Error

                Friend

                FriendLesson

                FriendRequest

                – CloudKitError

                FriendRequestTableViewCell

                FriendTableViewCell

                FriendsViewController

                Lesson

                – LessonType

                LessonDetailsTableViewCell

                LessonFriendTableViewCell

                LessonRoomTableViewCell

                LessonStaffTableViewCell

                LessonViewController

                ListingTableViewCell

                LoginViewController

                PrimaryUser

                – Settings

                – Error

                PushRightSegue

                SettingsViewController

                SplashViewController

                SymondsAPI

                – Error

                – CallResult

                – AuthenticationResult

                – GrantType

                – APICallType

                TimetableLessonCell

                TimetableViewController

                UserListing

            Functions

                merge(left:right:inOrder:)

                mergeSort(_:_:)

            Protocols

                ErrorKind

                User

            Structs

                Attribution

                STError

LoginViewController

class LoginViewController: UIViewController

Displays a web view to the user that loads the Symonds Data Service login
page, so the user can log in.

IBOutlets

                    webView

The web view that displays the login page.

Declaration

Swift

@IBOutlet weak var webView: UIWebView!

IBActions

                    cancelTapped(_:)

Called when the user taps the cancel button.

Declaration

Swift

@IBAction func cancelTapped(_ sender: UIBarButtonItem)

© 2017 . All rights reserved. (Last updated: 2017-04-13)

Generated by jazzy ♪♫ v0.7.5, a Realm project.


text:
package de.nierbeck.cassandra.embedded.shell.cql;

import java.util.List;

import org.apache.karaf.shell.api.action.Action;
import org.apache.karaf.shell.api.action.Argument;
import org.apache.karaf.shell.api.action.Command;
import org.apache.karaf.shell.api.action.Completion;
import org.apache.karaf.shell.api.action.Parsing;
import org.apache.karaf.shell.api.action.lifecycle.Reference;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.apache.karaf.shell.support.completers.StringsCompleter;
import org.apache.karaf.shell.support.table.ShellTable;

import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Session;

import de.nierbeck.cassandra.embedded.shell.CqlExecuter;
import de.nierbeck.cassandra.embedded.shell.SessionParameter;

/**
 * Should support:
 *
 * DESCRIBE KEYSPACES
 * 		Output is a list of all keyspace names.
 *
 * DESCRIBE KEYSPACE keyspace_name
 * 		Output is a list of CQL commands that could be used to recreate the given keyspace, and the tables in it. In some cases, as the CQL interface matures, there will be some metadata about a keyspace that is not representable with CQL. That metadata will not be shown.
 *
 * 		The <keyspacename> argument can be omitted when using a non-system keyspace; in that case, the current keyspace is described.
 *
 * DESCRIBE <FULL> SCHEMA
 * 		Output is a list of CQL commands that could be used to recreate the entire user-created schema. Works as though DESCRIBE KEYSPACE <k> was invoked for each keyspace k. Use DESCRIBE FULL SCHEMA to include the system keyspaces.
 *
 * DESCRIBE TABLES
 * 		Output is a list of the names of all tables in the current keyspace, or in all keyspaces if there is no current keyspace.
 *
 * DESCRIBE TABLE table_name
 * 		Output is a list of CQL commands that could be used to recreate the given table. In some cases, there might be table metadata that is not representable and it is not shown.
 *
 * DESCRIBE TYPE type_name
 * 		Output is a list of components of type_name.
 *
 * DESCRIBE TYPES
 * 		Output is a list of user-defined types.
 *
 * ATTENTION, currently only TABLE, TABLES and KEYSPACES are supported.
 *
 */
@Command(scope = "cassandra:cqlsh", name = "DESCRIBE", description = "execute USE cql commands")
@Parsing(CqlParser.class)
@Service
public class DescribeCommand implements Action {

	@Reference
	protected org.apache.karaf.shell.api.console.Session session;

	@Argument(name = "describe", description = "DESCRIBE ?", required = true, multiValued = true)
	@Completion(caseSensitive = false, values = { "keyspaces", "TABLES" }, value = StringsCompleter.class)
	private List<String> describe;

	public Object execute() throws Exception {
		Session session = (Session) this.session.get(SessionParameter.CASSANDRA_SESSION);

		if (session == null) {
			System.err.println("No active session found--run the connect command first");
			return null;
		}

		String loggedKeyspace = session.getLoggedKeyspace();

		ShellTable table = new ShellTable();

		ResultSet execute = null;

		switch (describe.get(0)) {
			case "TABLES":
			case "tables":
				execute = session
						.execute("select table_name from system_schema.tables where keyspace_name = '"
								+ session.getLoggedKeyspace() + "';");
				break;
			case "table":
			case "TABLE":
				String keyspaceName = loggedKeyspace;
				String tableName = describe.get(1).trim();
				if (keyspaceName == null) {
					String[] split = tableName.split("\\.");
					keyspaceName = split[0].trim();
					tableName = split[1].trim();
				}
				String select = String
						.format("SELECT column_name, type FROM system_schema.columns WHERE keyspace_name = '%s' AND table_name = '%s' ALLOW FILTERING",
								keyspaceName, tableName);
				execute = session.execute(select);
				break;
			case "keyspaces":
			default:
				execute = session.execute("select * from  system_schema.keyspaces;");
				break;
		}

		if (execute != null) {
			CqlExecuter.cassandraRowFormater(table, execute);
			table.print(System.out);
		}

		return null;
	}

}


text:
<?php

namespace tests\Nicofuma\SwaggerBundle\Validator;

use Nicofuma\SwaggerBundle\Exception\NoValidatorException;
use Nicofuma\SwaggerBundle\Validator\ValidatorMap;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\RequestMatcher;
use tests\Nicofuma\SwaggerBundle\SwaggerTestCase;

/**
 * @covers \Nicofuma\SwaggerBundle\Validator\ValidatorMap
 */
class ValidatorMapTest extends SwaggerTestCase
{
    public function testGetValidatorNotFound()
    {
        $this->expectException(NoValidatorException::class);

        $map = [];
        $container = new Container();
        $request = $this->createMockRequest('GET', '/foo/bar');

        $map = new ValidatorMap($container, $map);
        $map->getValidator($request);
    }

    public function testGetValidatorNoMatcher()
    {
        $map = [
            'validator1' => new RequestMatcher('^/$'),
            'validator2' => null,
        ];

        $container = $this->prophesize(Container::class);
        $container->get('validator2')->shouldBeCalled();

        $request = $this->createMockRequest('GET', '/foo/bar');

        $map = new ValidatorMap($container->reveal(), $map);
        $map->getValidator($request);
    }

    public function testGetValidator()
    {
        $map = [
            'validator1' => new RequestMatcher('^/$'),
            'validator2' => new RequestMatcher('^/foo'),
        ];

        $container = $this->prophesize(Container::class);
        $container->get('validator2')->shouldBeCalled();

        $request = $this->createMockRequest('GET', '/foo/bar');

        $map = new ValidatorMap($container->reveal(), $map);
        $map->getValidator($request);
    }
}


text:
@interface XPNewPwdViewController : UIViewController

@end