text:
package seborama.demo2.kafka.processor;

import org.apache.kafka.streams.processor.AbstractProcessor;
import org.apache.kafka.streams.processor.ProcessorContext;
import org.slf4j.LoggerFactory;
import seborama.demo2.kafka.model.Order;

import java.util.Date;

public class OrderCompletionProcessor extends AbstractProcessor<String, Order> {

    private final static org.slf4j.Logger log = LoggerFactory.getLogger(OrderCompletionProcessor.class);

    /**
     * Process the record with the given key and value.
     *
     * @param key   the key for the record
     * @param order the value for the record
     */
    @Override
    public void process(String key, Order order) {
        if (order == null) return;

        order.setCompleted(true);
        System.out.println("order = " + order);

        context().forward(order.getId() + "_" + Long.toString(new Date().getTime()), order);
    }

    /**
     * Initialize this processor with the given context. The framework ensures this is called once per processor when the topology
     * that contains it is initialized.
     * <p>
     * If this processor is to be {@link #punctuate(long) called periodically} by the framework, then this method should
     * {@link ProcessorContext#schedule(long) schedule itself} with the provided context.
     *
     * @param context the context; may not be null
     */
    @Override
    public void init(ProcessorContext context) {
        super.init(context);
    }
}


text:
title: Ahhhh…. young love
date: 2007-01-10 00:00:00 Z
permalink: "/2007/01/10/20070110ahhhh-young-love/"
categories:
- Baby E
- Uncategorized
author: Jennifer
layout: post
---

Noah and I have started a [music class](http://www.musictogether.com "music class").  Its basic premise is to entertain and encourage interaction for babies with different songs, beats, and instruments.  I loved it!

i danced, i sang, i played the tambourine, the bells, I shook the eggbeaters and beat on the floor.  Noah however,  found Audrey.  We shared a blanket and from the moment i put him down, he was staring at, playing with, flirting! (I know he's 4 months but you should have seen him, smiling and giggling at her) the whole class. So my dancing, circling and noise making went unnoticed!

I didn't get a chance to capture this unrequited love affair, i'll post a pic next week!

redpajama_set_name: RedPajamaGithub


text:
echo "Cleaning...";
rm -f ../src/main/java/camber/resources/js/webpack-output.js;
rm -f ../src/main/java/camber/public/webpack-output.js.map;

# run webpack
echo "Building Webpack...";
webpack --config webpack-production.config.js --progress --colors;

# copy files
echo "Copying...";
mv build/webpack-output.js ../src/main/java/camber/resources/js/webpack-output.js;
mv build/webpack-output.js.map ../src/main/java/camber/public/webpack-output.js.map;

# cleanup
rm -rf build;

echo "Success!";


text:
package com.devbus.sweethistory;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;

public class FormDoctorActivity extends BaseDrawerActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);

		FrameLayout mainFrame = (FrameLayout) findViewById(R.id.main_frame);
		View v = getLayoutInflater().inflate(R.layout.form_doctor, null);
		mainFrame.addView(v);
	}

}


text:
/**
 * Questions Service questions data handling
 */
angular.module('swift.services').factory('$question', [ '$http', '$swiftConfig', function($http, $swiftConfig) {

	return {
		get : doGet,
		post : doPost
	};

} ]);


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

package org.archive.modules.deciderules.surt;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.archive.checkpointing.Checkpoint;
import org.archive.checkpointing.Checkpointable;
import org.archive.io.ReadSource;
import org.archive.modules.CrawlURI;
import org.archive.modules.deciderules.DecideResult;
import org.archive.modules.deciderules.PredicatedDecideRule;
import org.archive.modules.seeds.SeedListener;
import org.archive.modules.seeds.SeedModule;
import org.archive.net.UURI;
import org.archive.spring.ConfigFile;
import org.archive.util.SurtPrefixSet;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextStartedEvent;

/**
 * Rule applies configured decision to any URIs that, when
 * expressed in SURT form, begin with one of the prefixes
 * in the configured set.
 *
 * The set can be filled with SURT prefixes implied or
 * listed in the seeds file, or another external file.
 *
 * The "also-check-via" option to implement "one hop off"
 * scoping derives from a contribution by Shifra Raffel
 * of the California Digital Library.
 *
 * @author gojomo
 */
public class SurtPrefixedDecideRule extends PredicatedDecideRule implements
        SeedListener, ApplicationListener<ApplicationEvent>, Checkpointable,
        BeanNameAware {

    private static final long serialVersionUID = 3L;
    private static final Logger logger =
        Logger.getLogger(SurtPrefixedDecideRule.class.getName());

    /**
     * Source file from which to infer SURT prefixes. Any URLs in file will be
     * converted to the implied SURT prefix, and literal SURT prefixes may be
     * listed on lines beginning with a '+' character.
     *
     * @deprecated redundant now that we have
     *             {@link SurtPrefixedDecideRule#surtsSource}
     */
    public ConfigFile getSurtsSourceFile() {
        if (getSurtsSource() instanceof ConfigFile) {
            return (ConfigFile) getSurtsSource();
        } else {
            return null;
        }
    }
    /** @deprecated */
    public void setSurtsSourceFile(ConfigFile cp) {
        setSurtsSource(cp);
    }

    /**
     * Text from which to infer SURT prefixes. Any URLs will be converted to the
     * implied SURT prefix, and literal SURT prefixes may be listed on lines
     * beginning with a '+' character.
     */
    protected ReadSource surtsSource = null;
    public ReadSource getSurtsSource() {
        return surtsSource;
    }
    public void setSurtsSource(ReadSource surtsSource) {
        this.surtsSource = surtsSource;
    }

    /**
     * Should seeds also be interpreted as SURT prefixes.
     */
    protected boolean seedsAsSurtPrefixes = true;
    public boolean getSeedsAsSurtPrefixes() {
        return seedsAsSurtPrefixes;
    }
    public void setSeedsAsSurtPrefixes(boolean seedsAsSurtPrefixes) {
        this.seedsAsSurtPrefixes = seedsAsSurtPrefixes;
    }

    /**
     * Dump file to save SURT prefixes actually used: Useful debugging SURTs.
     */
    protected ConfigFile surtsDumpFile =
        new ConfigFile("surtsDumpFile","${launchId}/surts.dump");
    public ConfigFile getSurtsDumpFile() {
        return surtsDumpFile;
    }
    public void setSurtsDumpFile(ConfigFile cp) {
        this.surtsDumpFile.merge(cp);
    }

    /**
     * Whether to also make the configured decision if a URI's 'via' URI (the
     * URI from which it was discovered) in SURT form begins with any of the
     * established prefixes. For example, can be used to ACCEPT URIs that are
     * 'one hop off' URIs fitting the SURT prefixes. Default is false.
     */
    {
        setAlsoCheckVia(false);
    }
    public boolean getAlsoCheckVia() {
        return (Boolean) kp.get("alsoCheckVia");
    }
    public void setAlsoCheckVia(boolean checkVia) {
        kp.put("alsoCheckVia", checkVia);
    }

    protected SeedModule seeds;
    public SeedModule getSeeds() {
        return this.seeds;
    }
    @Autowired
    public void setSeeds(SeedModule seeds) {
        this.seeds = seeds;
        if(seeds!=null) {
            // in case this bean wasn't autowired to listeners (as if an
            // inner bean)
            seeds.addSeedListener(this);
        }
    }

    protected SurtPrefixSet surtPrefixes = new SurtPrefixSet();

    public SurtPrefixedDecideRule() {
    }

    public void concludedSeedBatch() {
        dumpSurtPrefixSet();
    }

    /**
     * Evaluate whether given object's URI is covered by the SURT prefix set
     *
     * @param object Item to evaluate.
     * @return true if item, as SURT form URI, is prefixed by an item in the set
     */
    @Override
    protected boolean evaluate(CrawlURI uri) {
        if (getAlsoCheckVia()) {
            if (innerDecide(uri.getVia())) {
                return true;
            }
        }
        return innerDecide(uri.getUURI());
    }

    private boolean innerDecide(UURI uuri) {
        String candidateSurt;
        candidateSurt = SurtPrefixSet.getCandidateSurt(uuri);
        if (candidateSurt == null) {
            return false;
        }
        if (surtPrefixes.containsPrefixOf(candidateSurt)) {
            return true;
        } else {
            return false;
        }
    }

    protected void readPrefixes() {
        buildSurtPrefixSet();
    }

    /**
     * Dump the current prefixes in use to configured dump file (if any)
     */
    protected void dumpSurtPrefixSet() {
        // dump surts to file, if appropriate
        String dumpPath = getSurtsDumpFile().getPath();
        if (!StringUtils.isEmpty(dumpPath)) {
            File dump = getSurtsDumpFile().getFile();
            try {
                FileWriter fw = new FileWriter(dump);
                try {
                    surtPrefixes.exportTo(fw);
                } finally {
                    fw.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        }
    }

    /**
     * Construct the set of prefixes to use, from the seed list (
     * which may include both URIs and '+'-prefixed directives).
     */
    protected void buildSurtPrefixSet() {
        if (getSurtsSource() != null) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("reading surt prefixes from " + getSurtsSource());
            }
            Reader reader = getSurtsSource().obtainReader();
            try {
                surtPrefixes.importFromMixed(reader, true);
            } finally {
                IOUtils.closeQuietly(reader);
            }
        }
    }

    /**
     * If appropriate, convert seed notification into prefix-addition.
     *
     * @see org.archive.modules.seeds.SeedListener#addedSeed(org.archive.modules.CrawlURI)
     */
    public void addedSeed(final CrawlURI curi) {
        if(getSeedsAsSurtPrefixes()) {
            surtPrefixes.add(prefixFrom(curi.getURI()));
        }
    }

    protected String prefixFrom(String uri) {
        return SurtPrefixSet.prefixFromPlainForceHttp(uri);
    }

    private static final String DEFAULT_ACCEPT_ADD_PREFIX_DIRECTIVE = "+";
    private static final String DEFAULT_REJECT_ADD_PREFIX_DIRECTIVE = "-";

    /**
     * Consider nonseed lines as possible SURT prefix directives. If we
     * are ACCEPTing URIs, expect '+' as the add-SURT directive. If we
     * are REJECTing URIs, expect '-' as the add-SURT directive.
     *
     * TODO: perhaps, make directive configurable, so many SeedListener
     * SurtPrefixedDecideRules can all listen for directives meant only
     * for them.
     *
     * @see org.archive.modules.seeds.SeedListener#nonseedLine(java.lang.String)
     */
    public boolean nonseedLine(String line) {
        String effectiveDirective = getEffectiveAddDirective();
        if(line.startsWith(effectiveDirective)) {
            return surtPrefixes.considerAsAddDirective(line.substring(effectiveDirective.length()));
        } else {
            // not a line this instance is interested in
            return false;
        }
    }

    private String getEffectiveAddDirective() {
        if(getDecision()==DecideResult.ACCEPT) {
            return DEFAULT_ACCEPT_ADD_PREFIX_DIRECTIVE;
        }
        if(getDecision()==DecideResult.REJECT) {
            return DEFAULT_REJECT_ADD_PREFIX_DIRECTIVE;
        }
        throw new IllegalArgumentException("decision must be ACCEPT or REJECT");
    }

    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof ContextStartedEvent) {
            if (recoveryCheckpoint != null) {
                JSONObject json = recoveryCheckpoint.loadJson(beanName);
                try {
                    JSONArray jsonArray = json.getJSONArray("surtPrefixes");
                    for (int i = 0; i < jsonArray.length(); i++) {
                        surtPrefixes.add(jsonArray.getString(i));
                    }
                } catch (JSONException e) {
                    throw new IllegalStateException(e);
                }
            } else {
                readPrefixes();
            }
        }
    }

    // BeanNameAware
    protected String beanName;
    public void setBeanName(String name) {
        this.beanName = name;
    }

    @Override
    public void startCheckpoint(Checkpoint checkpointInProgress) {
    }

    @Override
    public void doCheckpoint(Checkpoint checkpointInProgress)
            throws IOException {
        try {
            JSONObject json = new JSONObject();
            json.put("surtPrefixes", surtPrefixes);
            checkpointInProgress.saveJson(beanName, json);
        } catch (JSONException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void finishCheckpoint(Checkpoint checkpointInProgress) {
    }

    protected Checkpoint recoveryCheckpoint;
    @Override
    public void setRecoveryCheckpoint(Checkpoint recoveryCheckpoint) {
        this.recoveryCheckpoint = recoveryCheckpoint;
    }

}//EOC


text:
import type { PagicPlugin } from '../Pagic.ts';
// eslint-disable-next-line no-duplicate-imports
import type Pagic from '../Pagic.ts';
import { path } from '../../deps.ts';

export type PagicConfigSidebar = Record<string, OnePagicConfigSidebar>;

export type OnePagicConfigSidebar = (
  | {
      text?: string;
      link?: string;
      children?: OnePagicConfigSidebar;
      expanded?: boolean;
    }
  | string
)[];

export type PagePropsSidebar = {
  text: string;
  link?: string;
  pagePath?: string;
  expanded?: boolean;
  children?: PagePropsSidebar;
}[];

const sidebar: PagicPlugin = {
  name: 'sidebar',
  insert: 'after:tsx',
  fn: async (pagic) => {
    if (!pagic.config.sidebar) {
      return;
    }

    for (const pagePath of pagic.pagePaths) {
      const pageProps = pagic.pagePropsMap[pagePath];

      let parsedSidebar: Record<string, PagePropsSidebar> = {};
      for (const [prefix, oneConfig] of Object.entries({ ...pagic.getConfig(pagePath).sidebar })) {
        parsedSidebar[prefix] = parseSidebarConfig(oneConfig, pagic);
      }

      for (const [prefix, pagePropsSidebar] of Object.entries(parsedSidebar)) {
        if (`/${pageProps.outputPath}`.startsWith(prefix)) {
          pagic.pagePropsMap[pagePath] = {
            ...pageProps,
            sidebar: pagePropsSidebar,
          };
          break;
        }
      }
    }
  },
};

function parseSidebarConfig(sidebarConfig: OnePagicConfigSidebar, pagic: Pagic): PagePropsSidebar {
  return sidebarConfig
    .map((sidebarConfigItem) => {
      if (typeof sidebarConfigItem === 'string') {
        const sidebarConfigGlob = path.globToRegExp(sidebarConfigItem);
        return Object.entries(pagic.pagePropsMap)
          .filter(([key]) => sidebarConfigGlob.test(key))
          .map(([key, value]) => ({
            text: value.title,
            link: value.outputPath,
            pagePath: value.pagePath,
          }));
      }
      // Deep clone
      let item = JSON.parse(JSON.stringify(sidebarConfigItem)) as PagePropsSidebar[0];

      if (typeof item.link !== 'undefined') {
        if (typeof pagic.pagePropsMap[item.link] === 'undefined') {
          item.text = item.text ?? item.link;
        } else {
          item.pagePath = item.link;
          item.text = item.text ?? pagic.pagePropsMap[item.link].title ?? item.link;
          item.link = pagic.pagePropsMap[item.link].outputPath;
        }
      }
      if (Array.isArray(item.children)) {
        item.children = parseSidebarConfig(item.children, pagic);
      }
      return item;
    })
    .flat();
}

export default sidebar;


text:
package com.company;

public class Main {

    public static void main(String[] args) {
        System.out.println("the application is running");
    }
}


text:
blob=251989979ba2cb39e217a91aa7fefc85c554ebe1
chmod u+x pizzly
cp pizzly $PREFIX/bin

wget https://raw.githubusercontent.com/pmelsted/pizzly/${blob}/scripts/flatten_json.py -O $PREFIX/bin/pizzly_flatten_json.py
sed -i.bak '1 i\
#!/$PREFIX/bin/python -Es
' $PREFIX/bin/pizzly_flatten_json.py
chmod +x $PREFIX/bin/pizzly_flatten_json.py

wget https://raw.githubusercontent.com/pmelsted/pizzly/${blob}/scripts/get_fragment_length.py -O $PREFIX/bin/pizzly_get_fragment_length.py
sed -i.bak '1 i\
#!$PREFIX/bin/python -Es
' $PREFIX/bin/pizzly_get_fragment_length.py
chmod +x $PREFIX/bin/pizzly_get_fragment_length.py


text:
layout: post
title: wet wet pussy
titleinfo: pornvd
desc: Watch wet wet pussy. Pornhub is the ultimate xxx porn and sex site.
---

wet wet pussy

Watch wet wet pussy. Pornhub is the ultimate xxx porn and sex site.


text:
SpecBegin(SpectacleWindowPositionCalculator)
  describe(@"SpectacleWindowPositionCalculator", ^{
    CGRect visibleFrameScreen = CGRectMake(0.0f, 4.0f, 1440.0f, 873.0f);
    CGRect windowRect = CGRectMake(165.0f, 245.0f, 564.0f, 384.0f);

    it(@"should calculate a centered window's CGRect", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionCenter];

      expect(result.windowRect).to.equal(CGRectMake(438.0f, 248.0f, 564.0f, 384.0f));
    });

    it(@"should calculate a fullscreen window's CGRect", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionFullscreen];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 1440.0f, 873.0f));
    });

    it(@"should calculate a window's CGRect in the left half of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionLeftHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 720.0f, 873.0f));
    });

    it(@"should calculate a window's CGRect in the left 2/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 4.0f, 720.0f, 873.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionLeftHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 960.0f, 873.0f));
    });

    it(@"should calculate a window's CGRect in the left 1/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 4.0f, 960.0f, 873.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionLeftHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 480.0f, 873.0f));
    });

    it(@"should calculate a window's CGRect in the right half of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionRightHalf];

      expect(result.windowRect).to.equal(CGRectMake(720.0f, 4.0f, 720.0f, 873.0f));
    });

    it(@"should calculate a window's CGRect in the right 2/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(720.0f, 4.0f, 720.0f, 873.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionRightHalf];

      expect(result.windowRect).to.equal(CGRectMake(480.0f, 4.0f, 960.0f, 873.0f));
    });

    it(@"should calculate a window's CGRect in the right 1/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(480.0f, 4.0f, 960.0f, 873.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionRightHalf];

      expect(result.windowRect).to.equal(CGRectMake(960.0f, 4.0f, 480.0f, 873.0f));
    });

    it(@"should calculate a window's CGRect in the top half of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionTopHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 441.0f, 1440.0f, 436.0f));
    });

    it(@"should calculate a window's CGRect in the top 2/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 441.0f, 1440.0f, 436.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionTopHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 295.0f, 1440.0f, 582.0f));
    });

    it(@"should calculate a window's CGRect in the top 1/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 295.0f, 1440.0f, 582.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionTopHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 586.0f, 1440.0f, 291.0f));
    });

    it(@"should calculate a window's CGRect in the bottom half of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionBottomHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 1440.0f, 436.0f));
    });

    it(@"should calculate a window's CGRect in the bottom 2/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 4.0f, 1440.0f, 436.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionBottomHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 1440.0f, 582.0f));
    });

    it(@"should calculate a window's CGRect in the bottom 1/3 of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 4.0f, 1440.0f, 582.0f)
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionBottomHalf];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 1440.0f, 291.0f));
    });

    it(@"should calculate a window's CGRect in the upper left corner of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionUpperLeft];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 441.0f, 720.0f, 436.0f));
    });

    it(@"should calculate a window's CGRect in the lower left corner of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionLowerLeft];

      expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 720.0f, 436.0f));
    });

    it(@"should calculate a window's CGRect in the upper right corner of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionUpperRight];

      expect(result.windowRect).to.equal(CGRectMake(720.0f, 441.0f, 720.0f, 436.0f));
    });

    it(@"should calculate a window's CGRect in the lower right corner of the screen", ^{
      SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                             visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionLowerRight];

      expect(result.windowRect).to.equal(CGRectMake(720.0f, 4.0f, 720.0f, 436.0f));
    });

    describe(@"next thirds", ^{

      it(@"should calculate a window's CGRect in the first horizontal third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionNextThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 480.0f, 873.0f));
      });

      it(@"should calculate a window's CGRect in the second horizontal third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 4.0f, 480.0f, 873.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionNextThird];

        expect(result.windowRect).to.equal(CGRectMake(480.0f, 4.0f, 480.0f, 873.0f));
      });

      it(@"should calculate a window's CGRect in the last horizontal third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(480.0f, 4.0f, 480.0f, 873.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionNextThird];

        expect(result.windowRect).to.equal(CGRectMake(960.0f, 4.0f, 480.0f, 873.0f));
      });

      it(@"should calculate a window's CGRect in the first vertical third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(960.0f, 4.0f, 480.0f, 873.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionNextThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 586.0f, 1440.0f, 291.0f));
      });

      it(@"should calculate a window's CGRect in the second vertical third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 586.0f, 1440.0f, 291.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionNextThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 295.0f, 1440.0f, 291.0f));
      });

      it(@"should calculate a window's CGRect in the last vertical third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 295.0f, 1440.0f, 291.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionNextThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 1440.0f, 291.0f));
      });
    });

    describe(@"previous thirds", ^{

      it(@"should calculate a window's CGRect in the first horizontal third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:windowRect
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionPreviousThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 480.0f, 873.0f));
      });

      it(@"should calculate a window's CGRect in the last vertical third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 4.0f, 480.0f, 873.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionPreviousThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 1440.0f, 291.0f));
      });

      it(@"should calculate a window's CGRect in the second vertical third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 4.0f, 1440.0f, 291.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionPreviousThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 295.0f, 1440.0f, 291.0f));
      });

      it(@"should calculate a window's CGRect in the first vertical third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 295.0f, 1440.0f, 291.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionPreviousThird];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 586.0f, 1440.0f, 291.0f));
      });

      it(@"should calculate a window's CGRect in the last horizontal third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(0.0f, 586.0f, 1440.0f, 291.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionPreviousThird];

        expect(result.windowRect).to.equal(CGRectMake(960.0f, 4.0f, 480.0f, 873.0f));
      });

      it(@"should calculate a window's CGRect in the second horizontal third of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateWindowRect:CGRectMake(960.0f, 4.0f, 480.0f, 873.0f)
                                                                               visibleFrameOfScreen:visibleFrameScreen
                                                                                action:SpectacleWindowActionPreviousThird];

        expect(result.windowRect).to.equal(CGRectMake(480.0f, 4.0f, 480.0f, 873.0f));
      });
    });

    describe(@"make larger", ^{

      it(@"should calculate a window's larger CGRect when centered in the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(360.0f, 222.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(345.0f, 207.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(345.0f, 207.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(330.0f, 192.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(330.0f, 192.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(315.0f, 177.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the top edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(402.0f, 441.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(387.0f, 411.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(387.0f, 411.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(372.0f, 381.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(372.0f, 381.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(357.0f, 351.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the bottom edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(238.0f, 4.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(223.0f, 4.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(223.0f, 4.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(208.0f, 4.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(208.0f, 4.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(193.0f, 4.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the left edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 250.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 235.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 235.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 220.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 220.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 205.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the right edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(720.0f, 303.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(690.0f, 288.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(690.0f, 288.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(660.0f, 273.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(660.0f, 273.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(630.0f, 258.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the top and left edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 441.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 411.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 411.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 381.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 381.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 351.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the top and right edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(720.0f, 441.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(690.0f, 411.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(690.0f, 411.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(660.0f, 381.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(660.0f, 381.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(630.0f, 351.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the bottom and left edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 3.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 4.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 4.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the bottom and right edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(720.0f, 4.0f, 720.0f, 436.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(690.0f, 4.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(690.0f, 4.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(660.0f, 4.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(660.0f, 4.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(630.0f, 4.0f, 810.0f, 526.0f));
      });

      it(@"should calculate a window's larger CGRect when against the top and bottom edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(344.0f, 4.0f, 720.0f, 873.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(329.0f, 4.0f, 750.0f, 873.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(329.0f, 4.0f, 750.0f, 873.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(314.0f, 4.0f, 780.0f, 873.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(314.0f, 4.0f, 780.0f, 873.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(299.0f, 4.0f, 810.0f, 873.0f));
      });

      it(@"should calculate a window's larger CGRect when against the left and right edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 285.0f, 1436.0f, 446.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 270.0f, 1440.0f, 476.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 270.0f, 1440.0f, 476.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 255.0f, 1440.0f, 506.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 255.0f, 1440.0f, 506.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionLarger];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 240.0f, 1440.0f, 536.0f));
      });
    });

    describe(@"make smaller", ^{

      it(@"should calculate a window's smaller CGRect when centered in the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(315.0f, 177.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(330.0f, 192.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(330.0f, 192.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(345.0f, 207.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(345.0f, 207.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(360.0f, 222.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the top edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(357.0f, 351.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(372.0f, 381.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(372.0f, 381.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(387.0f, 411.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(387.0f, 411.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(402.0f, 441.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the bottom edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(193.0f, 4.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(208.0f, 4.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(208.0f, 4.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(223.0f, 4.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(223.0f, 4.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(238.0f, 4.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the left edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 205.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 220.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 220.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 235.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 235.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 250.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the right edge of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(630.0f, 258.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(660.0f, 273.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(660.0f, 273.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(690.0f, 288.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(690.0f, 288.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(720.0f, 303.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the top and left edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 351.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 381.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 381.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 411.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 411.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 441.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the top and right edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(630.0f, 351.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(660.0f, 381.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(660.0f, 381.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(690.0f, 411.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(690.0f, 411.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(720.0f, 441.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the bottom and left edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 4.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 4.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 4.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 4.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the bottom and right edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(630.0f, 4.0f, 810.0f, 526.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(660.0f, 4.0f, 780.0f, 496.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(660.0f, 4.0f, 780.0f, 496.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(690.0f, 4.0f, 750.0f, 466.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(690.0f, 4.0f, 750.0f, 466.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(720.0f, 4.0f, 720.0f, 436.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the top and bottom edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(299.0f, 4.0f, 810.0f, 873.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(314.0f, 4.0f, 780.0f, 873.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(314.0f, 4.0f, 780.0f, 873.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(329.0f, 4.0f, 750.0f, 873.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(329.0f, 4.0f, 750.0f, 873.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(344.0f, 4.0f, 720.0f, 873.0f));
      });

      it(@"should calculate a window's smaller CGRect when against the left and right edges of the screen", ^{
        SpectacleCalculationResult *result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 240.0f, 1440.0f, 536.0f)
                                                                                visibleFrameOfScreen:visibleFrameScreen
                                                                                sizeOffset:-1.0 * kWindowSizeOffset
                                                                                action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 255.0f, 1440.0f, 506.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 255.0f, 1440.0f, 506.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 270.0f, 1440.0f, 476.0f));

        result = [SpectacleWindowPositionCalculator calculateResizedWindowRect:CGRectMake(0.0f, 270.0f, 1440.0f, 476.0f)
                                                          visibleFrameOfScreen:visibleFrameScreen
                                                                    sizeOffset:-1.0 * kWindowSizeOffset
                                                                        action:SpectacleWindowActionSmaller];

        expect(result.windowRect).to.equal(CGRectMake(0.0f, 285.0f, 1440.0f, 446.0f));
      });
    });
  });
SpecEnd


text:
package org.assertj.core.internal.longs;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.catchThrowable;
import static org.assertj.core.error.ShouldBeLess.shouldBeLess;
import static org.assertj.core.test.TestData.someInfo;
import static org.assertj.core.util.FailureMessages.actualIsNull;

import static org.mockito.Mockito.verify;

import org.assertj.core.api.AssertionInfo;
import org.assertj.core.internal.Longs;
import org.assertj.core.internal.LongsBaseTest;
import org.junit.jupiter.api.Test;

/**
 * Tests for <code>{@link Longs#assertLessThan(AssertionInfo, Long, long)}</code>.
 *
 * @author Alex Ruiz
 * @author Joel Costigliola
 */
class Longs_assertLessThan_Test extends LongsBaseTest {

  @Test
  void should_fail_if_actual_is_null() {
    assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> longs.assertLessThan(someInfo(), null, 8L))
                                                   .withMessage(actualIsNull());
  }

  @Test
  void should_pass_if_actual_is_less_than_other() {
    longs.assertLessThan(someInfo(), 6L, 8L);
  }

  @Test
  void should_fail_if_actual_is_equal_to_other() {
    AssertionInfo info = someInfo();

    Throwable error = catchThrowable(() -> longs.assertLessThan(info, 6L, 6L));

    assertThat(error).isInstanceOf(AssertionError.class);
    verify(failures).failure(info, shouldBeLess(6L, 6L));
  }

  @Test
  void should_fail_if_actual_is_greater_than_other() {
    AssertionInfo info = someInfo();

    Throwable error = catchThrowable(() -> longs.assertLessThan(info, 8L, 6L));

    assertThat(error).isInstanceOf(AssertionError.class);
    verify(failures).failure(info, shouldBeLess(8L, 6L));
  }

  @Test
  void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {
    assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> longsWithAbsValueComparisonStrategy.assertLessThan(someInfo(), null, 8L))
                                                   .withMessage(actualIsNull());
  }

  @Test
  void should_pass_if_actual_is_less_than_other_according_to_custom_comparison_strategy() {
    longsWithAbsValueComparisonStrategy.assertLessThan(someInfo(), 6L, -8L);
  }

  @Test
  void should_fail_if_actual_is_equal_to_other_according_to_custom_comparison_strategy() {
    AssertionInfo info = someInfo();

    Throwable error = catchThrowable(() -> longsWithAbsValueComparisonStrategy.assertLessThan(info, 6L, -6L));

    assertThat(error).isInstanceOf(AssertionError.class);
    verify(failures).failure(info, shouldBeLess(6L, -6L, absValueComparisonStrategy));
  }

  @Test
  void should_fail_if_actual_is_greater_than_other_according_to_custom_comparison_strategy() {
    AssertionInfo info = someInfo();

    Throwable error = catchThrowable(() -> longsWithAbsValueComparisonStrategy.assertLessThan(info, -8L, 6L));

    assertThat(error).isInstanceOf(AssertionError.class);
    verify(failures).failure(info, shouldBeLess(-8L, 6L, absValueComparisonStrategy));
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ListAdapter (J0Widget 1.0.3 API)</title>
<meta name="date" content="2014-06-19">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

ru.jango.j0widget

Class ListAdapter<T>

java.lang.Object

android.widget.BaseAdapter

ru.jango.j0widget.ListAdapter<T>

All Implemented Interfaces:

android.widget.Adapter, android.widget.ListAdapter, android.widget.SpinnerAdapter, java.lang.Iterable<T>

public abstract class ListAdapter<T>
extends android.widget.BaseAdapter
implements java.lang.Iterable<T>

A simple wrapper for BaseAdapter. Acts like an ArrayAdapter,
 but doesn't need Context or any resources for displaying items.

Field Summary

Fields inherited from interface android.widget.Adapter

IGNORE_ITEM_VIEW_TYPE, NO_SELECTION

Constructor Summary

Constructors

Constructor and Description

ListAdapter()

Method Summary

Methods

Modifier and Type
Method and Description

void
add(T item)

void
addAll(java.util.Collection<T> newItems)

void
clear()

java.util.List<T>
getAll()

int
getCount()

T
getItem(int position)

long
getItemId(int position)

java.util.Iterator<T>
iterator()

void
remove(int index)

void
remove(T item)

void
sort(java.util.Comparator<T> cmp)

Methods inherited from class android.widget.BaseAdapter

areAllItemsEnabled, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface android.widget.Adapter

getView

Constructor Detail

ListAdapter

public ListAdapter()

Method Detail

getCount

public int getCount()

Specified by:

getCount in interface android.widget.Adapter

getItem

public T getItem(int position)

Specified by:

getItem in interface android.widget.Adapter

getItemId

public long getItemId(int position)

Specified by:

getItemId in interface android.widget.Adapter

iterator

public java.util.Iterator<T> iterator()

Specified by:

iterator in interface java.lang.Iterable<T>

clear

public void clear()

getAll

public java.util.List<T> getAll()

addAll

public void addAll(java.util.Collection<T> newItems)

add

public void add(T item)

remove

public void remove(T item)

remove

public void remove(int index)

sort

public void sort(java.util.Comparator<T> cmp)

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
require 'rails_helper'

RSpec.describe Purchaser, type: :model do
  it "should should require a name" do
    purchaser = Purchaser.new
    expect(purchaser.valid?).to be(false)
  end

  it "should not allow 2 purchasers to have the same name" do
    purchaser1 = Purchaser.new({ name: "松橋明裕子" })
    expect(purchaser1.valid?).to be(true)
    purchaser1.save!

    purchaser2 = Purchaser.new({ name: "松橋明裕子"})
    expect(purchaser2.valid?).to be(false)
    expect { purchaser2.save! }.to raise_error(ActiveRecord::RecordInvalid)
  end
end


text:
require 'faraday'
require 'faraday_middleware/parse_csv'

Faraday::Response.register_middleware csv: FaradayMiddleware::ParseCSV


text:
// <copyright file="SBingMainPage.Actions.cs" company="Automate The Planet Ltd.">
// Copyright 2021 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>https://automatetheplanet.com/</site>
namespace HuddlePageObjectsPartialClassesSingleton.SingletonBingMainPage
{
    public partial class SBingMainPage : WebPage<SBingMainPage>
    {
        private readonly string _url = @"http://www.bing.com/";

        public void Navigate() => WrappedDriver.Navigate().GoToUrl(_url);

        public void Search(string textToType)
        {
            SearchBox.Clear();
            SearchBox.SendKeys(textToType);
            GoButton.Click();
        }
    }
}


text:
using System;

// Write a program that reads a string from the console and lists all different words in the
// string along with information how many times each word is found.

class WordsCount
{
    static char[] separators = { ' ', ',', '?', '.', '!', ';', '\t', '\r', '\n', '*', '-', '/',
                                   ':', '(', ')', '_', '<', '>', '\\'};
    static void Main()
    {
        Console.Write("Enter some text: ");
        string someText = Console.ReadLine();
        someText = someText.ToLower();

        PrintWords(someText);
    }

    static void PrintWords(string someText)
    {
        string[] textArray = someText.Split(separators, StringSplitOptions.RemoveEmptyEntries);

        int wordCount = 0;
        string currentWord;

        for (int i = 0; i < textArray.Length; i++)
        {
            if (textArray[i] != string.Empty && IsNotNumber(textArray[i]))
            {
                currentWord = textArray[i];
                wordCount = CountWords(textArray, currentWord, i);
                Console.WriteLine("{0} --> {1} time(s).", currentWord, wordCount);
                MarkFoundWords(textArray, currentWord);
            }
        }
    }

    static bool IsNotNumber(string currentWord)
    {
        int digitCount = 0;
        for (int i = 0; i < currentWord.Length; i++)
        {
            if (char.IsDigit(currentWord[i]))
            {
                digitCount++;
            }
        }
        if (digitCount == currentWord.Length)
        {
            return false;
        }
        return true;
    }

    static void MarkFoundWords(string[] textArray, string currentWord)
    {
        string marker = string.Empty;
        for (int i = 0; i < textArray.Length; i++)
        {
            if (textArray[i] == currentWord)
            {
                textArray[i] = marker;
            }
        }
    }

    static int CountWords(string[] textArray, string currentWord, int index)
    {
        int count = 0;
        for (int i = index; i < textArray.Length; i++)
        {
            if (textArray[i] == currentWord)
            {
                count++;
            }
        }
        return count;
    }
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Project : CRM
 * Date    : 29-10-2016
 * Author  : Asim Bilal
 */
class Questionnaire extends CI_Controller {

    //constructor
    function __construct() {
        parent::__construct();
        $this->load->model('QuestionnaireModel');
        $this->load->model('PublishModel');
        $this->load->helper('string');
    }

    /*
     * Function Name: Index
     * Description: Show Questionnaire
     */
    public function index() {

        $company_id = $this->session->userdata('company_id');
        $this->load->view('common/header');
        $data['Questionnaire'] = $this->QuestionnaireModel->getByCompanyId($company_id);
        $data['PublishSurvey'] = $this->QuestionnaireModel->getPublishSurveyByCompanyId($company_id);
        $this->load->view('Questionnaire/Questionnaire', array('data' => $data));
        $this->load->view('common/footer');

    }

    /*
     * Function Name: Publish
     * Description: Publish Questionnaire
     */
    public function publish() {

        $user_id = $this->session->userdata('id');
        $publish_date = date("Y-m-d");
        $expire_date = $this->input->post('expire_date');
        $questionnaire_id = $this->input->post('questionnaire_id');
        $type = $this->input->post('type');
        $data = array (
            'user_id' => $user_id,
            'publish_date' => $publish_date,
            'expire_date' => $expire_date,
            'questionnaire_id' => $questionnaire_id,
            'type' => $type,
            'token' => random_string('unique', 50)
            );
        $this->PublishModel->insert($data);
        $this->QuestionnaireModel->updateStatus($questionnaire_id, 'publish');
        redirect('Questionnaire');

    }

    /*
     * Function Name: Unpublish
     * Description: Unpublish Survey
     */
    public function Unpublish() {

        $surveyId = $this->uri->segment(3);
        $expire_date = date("Y-m-d");
        $data = array (
            'status' => ''
            );

        $this->QuestionnaireModel->update('id', $surveyId, $data);
        $this->PublishModel->updatePublishSurveyExpireDate( $surveyId );

        redirect('Questionnaire');

    }
}


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">

<dom-module id="labs002-skeletonobject">

<template>

Hello from {{objectname}}

{{username}}

HASH: {{objecthash}}

	<input type="text" id="userinput" value="{{objectdata.username}}"/>
	<button on-tap="save">Save</button>

  </template>

</dom-module>


text:
/**
 * API Facet to make calls to methods in the usergroups.users namespace.
 *
 * This provides functions to call:
 *   - list: {@link https://api.slack.com/methods/usergroups.users.list|usergroups.users.list}
 *   - update: {@link https://api.slack.com/methods/usergroups.users.update|usergroups.users.update}
 *
 */

function UsergroupsUsersFacet(makeAPICall) {
  this.name = 'usergroups.users';
  this.makeAPICall = makeAPICall;
}

/**
 * List all users in a User Group
 * @see {@link https://api.slack.com/methods/usergroups.users.list|usergroups.users.list}
 *
 * @param {?} usergroup - The encoded ID of the User Group to update.
 * @param {Object=} opts
 * @param {?} opts.include_disabled - Allow results that involve disabled User Groups.
 * @param {function=} optCb Optional callback, if not using promises.
 */
UsergroupsUsersFacet.prototype.list = function list(usergroup, opts, optCb) {
  var requiredArgs = {
    usergroup: usergroup
  };

  return this.makeAPICall('usergroups.users.list', requiredArgs, opts, optCb);
};

/**
 * Update the list of users for a User Group
 * @see {@link https://api.slack.com/methods/usergroups.users.update|usergroups.users.update}
 *
 * @param {?} usergroup - The encoded ID of the User Group to update.
 * @param {?} users - A comma separated string of encoded user IDs that represent the entire list
 *   of users for the User Group.
 * @param {Object=} opts
 * @param {?} opts.include_count - Include the number of users in the User Group.
 * @param {function=} optCb Optional callback, if not using promises.
 */
UsergroupsUsersFacet.prototype.update = function update(usergroup, users, opts, optCb) {
  var requiredArgs = {
    usergroup: usergroup,
    users: users
  };

  return this.makeAPICall('usergroups.users.update', requiredArgs, opts, optCb);
};

module.exports = UsergroupsUsersFacet;


text:
function fillcontent () {
  var element = document.getElementsByClassName('autofill')[0]
  element.innerHTML = 'If you can read this line JavaScript worked.'
}

window.onload = fillcontent