text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Tufte-style Jekyll blog</title>
  <meta name="description" content="IntroductionThe Tufte Jekyll theme  is an attempt to create a website design with the look and feel of Edward Tufte's books and handouts. Tufte's style is kn...">

  <link rel="stylesheet" href="css/tufte.css">

  <link href='//fonts.googleapis.com/css?family=Lato:400,400italic' rel='stylesheet' type='text/css'>

  <link rel="canonical" href="/articles/15/tufte-style-jekyll-blog">
  <link rel="alternate" type="application/rss+xml" title="Kyle Mahowald" href="/feed.xml" />

		Google Scholar
		CV
                OSF
                		Xword

Tufte-style jekyll blog

February 19, 2015

Introduction

The Tufte Jekyll theme  is an attempt to create a website design with the look and feel of Edward Tufte's books and handouts. Tufte's style is known for its extensive use of sidenotes, tight integration of graphics with text, and well-set typography. The idea for this project is essentially cribbed wholesale from Tufte and R Markdown's Tufte Handout format11 See code.google.com/p/tufte-latex This page is an adaptation of the Tufte Handout PDF.

Jekyll customizations

This Jekyll blog theme is based on a github repository by Dave Liepmann here, which in turn was based on the R Markdown Tufte Handout. I borrowed freely from Dave's repo and have transformed many of the typographic and page-structural features into a set of custom Liquid tags that make creating content using this style much easier than writing straight HTML. Essentially, if you know markdown, and mix in a few custom Liquid tags, you can be creating a website with this document style in short order.

Basics

Color

Although paper handouts obviously have a pure white background, the web is better served by the use of slightly off-white and off-black colors. I picked #fffff8 and #111111 because they are nearly indistinguishable from their 'pure' cousins, but dial down the harsh contrast. Tufte's books are a study in spare, minimalist design. In his book The Visual Display of Quantitative Information, he uses a red ink to add some visual punctuation to the buff colored paper and dark ink. In that spirit, links are styled using a similar red color.

Headings

Tufte CSS styles headings h1, h2, and h3, making them nearly identical except for font size. The h1 should be used as a title, the h2for section headings, and h3 for subsection headings.

While this Jekyll theme supports more specific headings, if you feel the urge to reach for a heading of level 4 or higher, consider redesigning your document.

In his later books 22 http://www.edwardtufte.com/tufte/books_be, Tufte starts each section with a bit of vertical space, a non-indented paragraph, and sets the first few words of the sentence in small caps. To accomplish this using this style, enclose the sentence fragment you want styled with small caps in a custom Liquid tag called 'newthought' like so:

{% newthought 'In his later books' %}

Font

In print, Tufte uses the proprietary Monotype Bembo33 http://www.edwardtufte.com/bboard font. Electronically he uses ETBembo, available under the MIT license through Edward Tufte, Adam Schwartz, and Marc Neuwirth's Presenter project. The Tufte Jekyll Theme CSS uses ETBembo through the use of @font-face.

Code snippets ape GitHub's font selection using Microsoft's Consolas and the sans-serif font uses Tufte's choice of Gill Sans. Since this is not a free font, and some systems will not have it installed, the free google font Lato is designated as a fallback.

Figures

Margin Figures

Figure 1: Sepal length vs. petal length, colored by speciesImages and graphics play an integral role in Tufte's work. To place figures in the margin, use the custom margin figure liquid tag included in the _plugins directory like so:

{% marginfigure /assets/img/figure1.png 'Figure 1: Sepal length vs. petal length, colored by species'  %}.

Note that the caption must be enclosed in quotes for the simple liquid tag to work!

Equations

The Markdown parser being used by this Jekyll theme is Kramdown, which contains some built-in Mathjax support. Both inline and block-level mathematical figures can be added to the content.

For instance, the following inline sequence:

When , there are two solutions to

is written by enclosing a Mathjax expression with a Liquid inline tag pair ('m' and 'em') like so:

When {% m %} a \ne 0{% em %}, there are two solutions to {% m %}ax^2 + bx + c = 0{% em %}

Similarly, this block-level Mathjax expression:

is written by enclosing the expression with a Liquid block tag pair ('math' and 'endmath') like so:

{% math %}x = {-b \pm \sqrt{b^2-4ac} \over 2a}.{% endmath  %}

You can get pretty fancy, for instance, the wave equation's nabla is no big thing

All of the standard Latex equation markup is available to use inside these block tags.

Full Width Figures

If you need a full-width image or figure, another custom liquid tag is available to use. Oddly enough, it is named 'fullwidth', and this markup:

{% fullwidth /assets/img/figure2.png 'Full width figure'  %}

Yields this:

Full width figure

qplot(wt, mpg, data = mtcars, colour = factor(cyl) )

Main Column Figures

Besides margin and full width figures, you can of course also include figures constrained to the main column. Yes, you guessed it, a custom liquid tag rides to the rescue once again:

{% maincolumn /assets/img/figure3.png 'This is a caption for the image to the left'  %}

yields this:

This is a caption for the image to the left

Sidenotes and Margin notes

One of the most prominent and distinctive features of Tufte's style is the extensive use of sidenotes and margin notes. Perhaps you have noticed their use in this document already. You are very astute.

There is a wide margin to provide ample room for sidenotes and small figures. I have preserved a slight semantic distinction between sidenotes and marginnotes.

Sidenotes

Sidenotes33 This is a sidenote and contains a superscript contain a superscript. Right now, it is up to you to maintain the numbering system with these Liquid tags. Perhaps some clever person who takes a shine to this Jekyll theme will fork the repository and use some Ruby-fu and modify the sidenote.rb plugin to keep track of the numbering for you. But right now, a sidenote like the one here is created with the following markup in Markdown (what?):

{% sidenote 3 'This is a sidenote and *contains a superscript*'%}

Margin notes

Margin notesThis is a margin note without a superscript  are similar to sidenotes, but do not contain a superscript. You can place anything you want in a margin note. Well, anything that is an inline element. Block level elements can make the Kramdown parser do strange things. Same sort of markup as a sidenote, but without a number involved:

{% marginnote 'This is a margin note *without* a superscript' %}

Tables

Tabular data is presented with right-aligned text and minimal grid lines. Table captions are placed inside a marginnote Liquid Tag above the table. Be careful to leave a blank line between the marginnote and the beginning of the table to avoid goofy shit happening during the parsing step.

Of course, a table can be created using the usual html markup (<table><thead><tbody<tr><td> etc..)

Table 1: first row of metcars

	mpg	cyl	disp	hp	drat	wt

Mazda RX4	21.00	6.00	160.00	110.00	3.90	2.62

Mazda RX4 Wag	21.00	6.00	160.00	110.00	3.90	2.88

Datsun 710	22.80	4.00	108.00	93.00	3.85	2.32

Hornet 4 Drive	21.40	6.00	258.00	110.00	3.08	3.21

Hornet Sportabout	18.70	8.00	360.00	175.00	3.15	3.44

Valiant	18.10	6.00	225.00	105.00	2.76	3.46

Or  you can avail yourself of the Markdown Extra features built into Kramdown, and use the Markdown Extra table syntax to make the very same thing:

Table 2: same table with Markdown Extra markup and sane numerical precision

      mpg
      cyl
      disp
      hp
      drat
      wt

      Mazda RX4
      21
      6
      160
      110
      3.90
      2.62

      Mazda RX4 Wag
      21
      6
      160
      110
      3.90
      2.88

      Datsun 710
      22.8
      4
      108
      93
      3.85
      2.32

      Hornet 4 Drive
      21.4
      6
      258
      110
      3.08
      3.21

      Hornet Sportabout
      18.7
      8
      360
      175
      3.15
      3.44

      Valiant
      18.1
      6
      160
      105
      2.76
      3.46

Using the following markup(down):

|                 |mpg  | cyl  |  disp  |   hp   |  drat  | wt  |
|----------------:|----:|-----:|-------:|-------:|-------:|----:|
|Mazda RX4        |21   |6     |160     |110     |3.90    |2.62 |
etc..

Code

Code samples use a monospace font using the 'code' class. The Kramdown parser has the 'GFM' option enabled, which stands for 'Github Flavored Markdown', and this means that both inline code such as #include <stdio.h> and blocks of code can be delimited by surrounding them with 3 backticks:

(map tufte-style all-the-things)

is created by the following markup:

```(map tufte-style all-the-things)```

In theory, one should be able to append the language name right after the first three backticks and get some sexy code syntax highlighting, but for some reason, the only way I can make this work with the Kramdown and Rouge highlighting turned on is to enclose a block of code in the some Liquid tags. For instance, here is the Ruby code for one of the plugins included with this theme:

module Jekyll
  class RenderFullWidthTag < Liquid::Tag
require "shellwords"

    def initialize(tag_name, text, tokens)
      super
      @text = text.shellsplit
    end

    def render(context)
      "<div><img class='fullwidth' src='#{@text[0]}'/></div> " +
      "<p><span class='marginnote'>#{@text[1]}</span></p>"
    end
  end
end

Liquid::Template.register_tag('fullwidth', Jekyll::RenderFullWidthTag)

Which is created by surrounding the code with the highlight tag block pair:

{% highlight ruby %}
module Jekyll
  blah, blah...
Liquid::Template.register_tag('fullwidth', Jekyll::RenderFullWidthTag)
{% endhighlight %}

For some reason, the linenos tag modifier in the highlight tag totally screws up the code alignment, and I don't feel like sorting it out at the moment. So either don't use it, or figure it out and tell me what is going on so I can fix it.

    Tufte-style Jekyll blog - February 19, 2015 - Kyle Mahowald

© 2020   KYLE MAHOWALD

This site created with the Tufte theme for Content-centric blogging  in Jekyll.


text:
package eu.bcvsolutions.idm.core.model.event.processor.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Description;
import org.springframework.stereotype.Component;

import eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto;
import eu.bcvsolutions.idm.core.api.event.CoreEventProcessor;
import eu.bcvsolutions.idm.core.api.event.DefaultEventResult;
import eu.bcvsolutions.idm.core.api.event.EntityEvent;
import eu.bcvsolutions.idm.core.api.event.EventResult;
import eu.bcvsolutions.idm.core.api.event.EntityStateEvent.EntityStateEventType;
import eu.bcvsolutions.idm.core.api.event.processor.EntityStateProcessor;
import eu.bcvsolutions.idm.core.api.service.IdmEntityStateService;

/**
 * Deletes entity state - ensures referential integrity.
 *
 * @author Radek Tomiška
 *
 */
@Component
@Description("Deletes entity state from repository.")
public class EntityStateDeleteProcessor
		extends CoreEventProcessor<IdmEntityStateDto>
		implements EntityStateProcessor {

	public static final String PROCESSOR_NAME = "entity-state-delete-processor";
	@Autowired private IdmEntityStateService service;

	public EntityStateDeleteProcessor() {
		super(EntityStateEventType.DELETE);
	}

	@Override
	public String getName() {
		return PROCESSOR_NAME;
	}

	@Override
	public EventResult<IdmEntityStateDto> process(EntityEvent<IdmEntityStateDto> event) {
		IdmEntityStateDto entityState = event.getContent();
		//
		service.deleteInternal(entityState);
		//
		return new DefaultEventResult<>(event, this);
	}
}

redpajama_set_name: RedPajamaGithub


text:
using Insight.Base.BaseForm.Forms;

namespace Insight.Base.MainForm.Views
{
    public partial class PrintSetDialog : BaseDialog
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public PrintSetDialog()
        {
            InitializeComponent();
        }
    }
}


text:
package npanday.plugin.application;

import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import npanday.packaging.DirectoryPackagePreparer;
import npanday.packaging.MixinAsssemblyReader;
import npanday.packaging.PackagePreparationConfigurationSource;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.shared.filtering.MavenFileFilter;

import static com.google.common.base.Strings.isNullOrEmpty;
import static com.google.common.collect.Iterables.toArray;

/**
 * Maven Mojo preparing the packaging of .NET applications.
 *
 * @author Lars Corneliussen
 * @phase prepare-package
 * @goal assemble-package-files
 * @since 1.5.0-incubating
 */
public class AssemblePackageFilesMojo
    extends AbstractMojo
{
    Splitter COMMANDLINE_LISTS_SPLITTER = Splitter.on( ";" ).omitEmptyStrings().trimResults();

    /**
     * Specifies if the goal should be skipped.
     *
     * @parameter expression="$(skipPackaging)" default-value="false"
     */
    private boolean skip;

    /**
     * Assembly XML Descriptor file. This must be the path to your customized descriptor file.
     *
assemblyDescriptor will take precedence over {@see assemblyDescriptorRef}
     *
     * @parameter expression="${assemblyDescriptor}"
     */
    private String assemblyDescriptor;

    /**
     * Commandline version of {@see mixinAssemblyComponentDescriptors}. Spearate each item with a semicolon.
     *
     * @parameter expression="${mixinAssemblyComponentDescriptorList}"
     */
    private String mixinAssemblyComponentDescriptorList;

    /**
     * Component descriptors to be mixed into the main assembly descriptor from
     * {@see assemblyDescriptorRef} or {@see assemblyDescriptor}.
     *
This is particularly useful, when the assembly descriptor is provided via the classpath.
     *
     * @parameter
     */
    private String[] mixinAssemblyComponentDescriptors;

    /**
     * A references to an assembly descriptor available on the plugin's classpath. The default
     * classpath includes these built-in descriptors. You can add others by adding dependencies to the plugin.
     *
assemblyDescriptorRef will be ignored, if {@see assemblyDescriptor} is configured
     *
     * @parameter expression="${assemblyDescriptorRef}" default-value="application-defaults"
     */
    private String assemblyDescriptorRef;

    /**
     * The Maven Session Object providing both the
     * current project and the local repository.
     *
     * @parameter default-value="${session}"
     * @required
     * @readonly
     */
    private MavenSession mavenSession;

    /**
     * @component
     */
    private MavenFileFilter fileFilter;

    /**
     * @component
     */
    private MixinAsssemblyReader assemblyReader;

    /**
     * @component
     */
    private DirectoryPackagePreparer packagePreparer;

    public void execute() throws MojoExecutionException, MojoFailureException
    {
        if ( skip )
        {
            getLog().info( "NPANDAY-127-000: Application packaging was configured to be skipped" );
            return;
        }

        long startTime = System.currentTimeMillis();

        setupParameters();

        final PackagePreparationConfigurationSource packageConfig = new PackagePreparationConfigurationSource(
            mavenSession, fileFilter
        );

        if ( !isNullOrEmpty( assemblyDescriptor ) )
        {
            packageConfig.setDescriptorFile( assemblyDescriptor );
        }
        else if ( !isNullOrEmpty( assemblyDescriptorRef ) )
        {
            packageConfig.setDescriptorRef( assemblyDescriptorRef );
        }
        else
        {
            throw new MojoFailureException(
                "NPANDAY-127-008: Please configure either assemblyDescriptorRef or assemblyDescriptor"
            );
        }

        assemblyReader.setComponentDescriptors(
            Objects.firstNonNull( mixinAssemblyComponentDescriptors, new String[0] )
        );

        packagePreparer.preparePackage( packageConfig );

        long endTime = System.currentTimeMillis();
        getLog().debug( "Mojo Execution Time = " + ( endTime - startTime ) );
    }

    /**
     * Copies from commandline parameters to "real" parameters.
     */
    private void setupParameters()
    {
        if ( !isNullOrEmpty( mixinAssemblyComponentDescriptorList ) )
        {
            mixinAssemblyComponentDescriptors = toArray(
                COMMANDLINE_LISTS_SPLITTER.split( mixinAssemblyComponentDescriptorList ), String.class
            );
        }
    }
}


text:
import unittest

import IECore

import Gaffer
import GafferScene
import GafferSceneTest

class SetTest( GafferSceneTest.SceneTestCase ) :

	def test( self ) :

		p = GafferScene.Plane()
		s = GafferScene.Set()
		s["in"].setInput( p["out"] )

		s["paths"].setValue( IECore.StringVectorData( [ "/one", "/plane" ] ) )
		g = s["out"]["globals"].getValue()
		self.assertEqual( g.keys(), [ "gaffer:sets" ] )
		self.assertEqual( g["gaffer:sets"].keys(), [ "set" ] )
		self.assertEqual( set( g["gaffer:sets"]["set"].value.paths() ), set( [ "/one", "/plane" ] ) )

		s["name"].setValue( "shinyThings" )

		g = s["out"]["globals"].getValue()
		self.assertEqual( g.keys(), [ "gaffer:sets" ] )
		self.assertEqual( g["gaffer:sets"].keys(), [ "shinyThings" ] )
		self.assertEqual( set( g["gaffer:sets"]["shinyThings"].value.paths() ), set( [ "/one", "/plane" ] ) )

		s["paths"].setValue( IECore.StringVectorData( [ "/two", "/sphere" ] ) )

		g = s["out"]["globals"].getValue()
		self.assertEqual( g.keys(), [ "gaffer:sets" ] )
		self.assertEqual( g["gaffer:sets"].keys(), [ "shinyThings" ] )
		self.assertEqual( set( g["gaffer:sets"]["shinyThings"].value.paths() ), set( [ "/two", "/sphere" ] ) )

if __name__ == "__main__":
	unittest.main()


text:
<?php
include('../config/config.php');
$connect = mysqli_connect('localhost', $CONFIG['dbuser'], $CONFIG['dbpassword'], 'owncloud');

$created = new \DateTime();

$query = 'INSERT INTO oc_uc_chartconfig(created, username, charttype, chartprovider) VALUES (
"' . $created->format('Y-m-d H:i:s') . '",
"admin",
"",
"c3js")';
$result = mysqli_query($connect, $query);


text:
import angular from 'angular';
import _ from 'lodash';

class instanceInfoChart {
  constructor() {
    'ngInject';

    this.restrict = 'E';
    this.controller = 'instanceInfoChartCtrl';
    this.controllerAs = 'instanceInfoChart';
    this.scope = {
      detailItems: '=',
      barColor: '@?'
    };

    this.link = (scope, element) => {

      scope.$watch('detailItems', newItems => {
        redraw(newItems);
      });

      function redraw(items) {
        const charWidth = 400;
        const minBarWidth = 10;
        const maxBarWidth = 350;
        const barHeight = 20;
        const textHeight = 20;
        const textPadding = 5;
        const chartOffset = 12;

        const maxValue = _.maxBy(items, 'count').count;
        const minValue = _.minBy(items, 'count').count;

        const svg = d3.select(element[0])
                      .append('svg')
                      .attr('width', charWidth)
                      .attr('height', (barHeight + textHeight) * items.length);

        const scale = d3.scaleLinear()
                        .domain([minValue, maxValue])
                        .range([minBarWidth, maxBarWidth]);

        svg.selectAll('rect')
           .data(items)
           .enter()
           .append('rect')
           .attr('x', 0)
           .attr('y', (d, i) => {
             return i * (barHeight + textHeight) + textHeight;
           })
           .attr('width', d => {
             return scale(d.count);
           })
           .attr('height', barHeight)
           .attr('fill', scope.barColor || '#000');

        svg.append('g')
           .selectAll('text')
           .data(items)
           .enter()
           .append('text')
           .text(d => {
             return numberWithCommas(d.count);
           })
           .attr('x', d => {
             return scale(d.count) + textPadding;
           })
           .attr('y', (d, i) => {
             return i * (barHeight + textHeight) + textHeight + barHeight / 2 + 2;
           });

        svg.append('g')
           .selectAll('text')
           .data(items)
           .enter()
           .append('text')
           .text(d => {
             return d.name;
           })
           .attr('x', 0)
           .attr('y', (d, i) => {
             return i * (barHeight + textHeight) + chartOffset;
           });
      }

      function numberWithCommas(number) {
        return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
      }
    };
  }
}

angular.module('OpenDataDiscovery').directive('instanceInfoChart', () => new instanceInfoChart());

export default instanceInfoChart;


text:
<!doctype html>

		<meta charset="utf-8">

		<title>FAI - James Kingsmill</title>

		<meta name="description" content="FemoroAcetabular Impingement">
		<meta name="author" content="James Kingsmill">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/black.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

Femoro-Acetabular Impingement

James Kingsmill

2015

Background Info

Ultimate Frisbee Highlights

Ultimate Throwing Techniques

Outline

Anatomy

Causes

Symptoms

Treatments

Where does AT fit in?

Anatomy of a Hip

Acetabulum

Femoral Head

Labrum

Cartilage

Ligamentum Teres

Types of FAI

Cam

Pincer

Mixed

Causes

...Correction

Predisposing Factors

Young

...often

Active

...usually

Male

...mostly

Activities

Football

Dancing

Martial Arts

Meaning...

Large Hip ROM

Axial Loading of Hip

Torsional Forces

Ultimate Throwing Techniques

Symptoms

Walking Patterns

Antalgic Gait

Antalgic Gait

Trendelenburg Gait

Trendelenburg Gait

Brandenburg Gate

Positive Impingement Test

90% of FAI sufferers test positive

Volunteer?

False Positives

(Other Possible Causes)

Hip dysplasia

Avascular necrosis

You mean when your mentor turns into a zombie?

No, that's avuncular necrosis.

Slipped Capital Femoral Epiphysis

Is that a thing?

Legg-Calv&eacute-Perthes Disease

Stop making these up.

Diagnosis

Xray

MRI

MRA

CT Scan

Damage

Cartilage damage

Labral tears

Osteoarthritis

Treatments

Non-Surgical

NSAIDs

Cortisone

Physiotherapy

Massage

Root cause?

Surgical

Joint Reshaping

Labral Repair

Cartilage Regrowth

Ligament Repair

Types

Open Surgery

Arthroscopy

Open Surgery

Turn away now if you're squeamish

Seriously

Arthroscopy

It's not any more pleasant

Arthroscopy

Post-Operative Treatment

Motor Control Strategies

Hip Weakness

Postural Misalignment

Initial Regime

Improving ROM

Light stretching

Core Stabilisation

TrA, Pelvic Floor

Gluteal Activation

Bridging, Clams, Mule Kicks, Drinking Bird

Advanced Regime

Functional Movements

Squats, Lunges

Stability Exercises

Wobble Boards, Dynadiscs

Impact Exercises

Hopping, Landing

Where do we come in?

Diagnosis and Referral

Rehabilitation

"Generally, motor control retraining is more important than strength or power of individual muscles."

- Fowler Kennedy Sports Medicine Clinic

AT teachers are experts at:

Observing movement patterns

Retraining motor control

Rewiring the software

What are we not experts at?

Conclusion

Questions?

References

Femoral Acetabular Impingement, Pate (http://dcpracticeinsights.net/mpacms/dc/article.php?id=53605)

Femoroacetabular Impingement, Magill et al (http://benthamopen.com/contents/pdf/TOSMJ/TOSMJ-4-75.)pdf

Surgical Treatment of Femoroacetabular Impingement, AMA (http://www.bcbsks.com/customerservice/Providers/MedicalPolicies/policies/policies/SurgicalTreatment_FemoroacetabularImpingement_2014-10-15.pdf)

Radiographic Prevalence of Femoroacetabular Impingement in a Young Population with Hip Complaints Is High, Ochoa et al (http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3049607)

Current concepts in management of femoroacetabular impingement, Wilson et al (http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3557322)

Hip Arthroscopy Protocol for Femoroacetabular Impingement, Fowler Kennedy Sports Medicine Clinic (http://fowlerkennedy.com/wp-content/uploads/2013/04/Hip_Protocol_for_Arthroscopy_of_Femoroacetabular_Impingement.pdf)

Femoro-acetabular Impingement (FAI), running-physio.com (http://www.running-physio.com/femoro-acetabular-impingement-fai)

Hip FAI and Labral Tear: Diagnosis to Treatment (https://hipfai.wordpress.com)

Femoroacetabular Impingement – Etiology, Diagnosis, and Treatment of FAI, Reinold (http://www.mikereinold.com/2011/03/femoroacetabular-impingement-etiology-diagnosis-and-treatment-of-fai.html)

FemoroAcetabular Impingement (FAI), Park Clinic Orthopaedics (http://www.parkclinic.com.au/home/conditions-treatment/hip/femoroacetabular-impingement-fai)

Slipped capital femoral epiphysis, Wikipedia (http://en.wikipedia.org/wiki/Slipped_capital_femoral_epiphysis)

Legg–Calv&eacute–Perthes disease, Wikipedia (http://en.wikipedia.org/wiki/Legg%E2%80%93Calv%C3%A9%E2%80%93Perthes_disease)

Septic Arthritis, Wikipedia (http://en.wikipedia.org/wiki/Septic_arthritis)

Hip Dysplasia (Human), Wikipedia (http://en.wikipedia.org/wiki/Hip_dysplasia_(human))


text:
    <form id="upload-form" role="form" method="POST" enctype="multipart/form-data" action="/api/images">

                <input id="upload-input"  name="upload" type="file">

            <input id="file-info" type="text" class="form-control" value="" placeholder="Imagen no seleccionada" disabled>

              <button id="upload-button" type="button" class="btn btn-primary btn-small" disabled="disabled">

              </button>

    </form>
    Al seleccionar una imagen se habilitará el botón para subir


text:
import { AbstractImporter } from '../abstract-importer';
import * as fs from 'fs';
import * as moment from 'moment';
import * as Papa from 'papaparse';
import * as path from 'path';
import { Transaction } from '../../../type/transaction';
import { TransactionType } from '../../../type/transaction-type';

class CoinbaseImporter extends AbstractImporter {
  public isValid(filePath: string) {
    return (
      filePath.toLowerCase().includes('coinbase') &&
      filePath.toLowerCase().includes('csv')
    );
  }

  public parseFile(filePath): Promise<Transaction[]> {
    return new Promise((resolve, reject) => {
      const transactions: Transaction[] = [];

      // Parse local CSV file
      const file = fs.readFileSync(path.join(filePath), 'utf8');
      Papa.parse(file, {
        header: false,
        complete: (results) => {
          let foundTransactions = false;

          try {
            results.data.forEach((transaction, index) => {
              if (transaction && transaction[0] === 'Timestamp') {
                foundTransactions = true;
              } else if (foundTransactions && transaction && transaction[0]) {
                const currency = transaction[8];
                const date = moment(transaction[0], 'YYYY-MM-DD HH:mm:ss');
                const fee = parseFloat(transaction[9]);
                const price = parseFloat(transaction[7]);
                const quantity = parseFloat(transaction[2]);

                let transactionType;
                const note = transaction[5];
                if (note.includes('Bought')) {
                  transactionType = TransactionType.Buy;
                } else if (quantity < 0) {
                  transactionType = TransactionType.Sell;
                } else if (note.toLowerCase().includes('bonus')) {
                  transactionType = TransactionType.Bonus;
                }

                const symbol = transaction[3];

                if (symbol && transactionType) {
                  const newTransaction = new Transaction({
                    currency,
                    date: date.toISOString(),
                    fee: fee || 0,
                    quantity: Math.abs(quantity),
                    symbol,
                    type: transactionType,
                    unitPrice: Math.abs((price - fee) / quantity) || 0
                  });

                  transactions.push(newTransaction);
                }
              }
            });
          } catch (err) {
            console.log(err);
          }

          resolve(transactions);
        }
      });
    });
  }
}

export const coinbaseImporter = new CoinbaseImporter();


text:
#import "NSObject.h"

#import "EDImmutableObject-Protocol.h"
#import "NSCopying-Protocol.h"

@class EDPhoneticInfo, EDRunsCollection, NSString;

// Not exported
@interface EDString : NSObject <NSCopying, EDImmutableObject>
{
    NSString *mString;
    EDRunsCollection *mRuns;
    EDPhoneticInfo *mPhoneticInfo;
    _Bool mDoNotModify;
}

+ (id)edStringWithString:(id)arg1 runs:(id)arg2;
+ (id)edStringWithString:(id)arg1;
+ (id)string;
- (void)setDoNotModify:(_Bool)arg1;
- (void)setRuns:(id)arg1;
- (id)runs;
- (void)setPhoneticInfo:(id)arg1;
- (id)phoneticInfo;
- (void)setString:(id)arg1;
- (id)string;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (unsigned long long)hash;
- (_Bool)isEqual:(id)arg1;
- (_Bool)isEqualToEDString:(id)arg1;
- (_Bool)isEqualToString:(id)arg1;
- (void)dealloc;
- (id)initWithString:(id)arg1 runs:(id)arg2;
- (id)initWithString:(id)arg1;
- (id)init;

@end


text:
<?php
namespace Meling\Cart\Cards;

/**
 * Interface Implementation
 * @package Meling\Cart\Cards
 */
interface Implementation
{
    public function discount();

    public function id();

    public function name();

    public function rewards();

}


text:
namespace android.media
{
	[global::MonoJavaBridge.JavaClass()]
	public partial class SoundPool : java.lang.Object
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		protected SoundPool(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		[global::MonoJavaBridge.JavaInterface(typeof(global::android.media.SoundPool.OnLoadCompleteListener_))]
		public partial interface OnLoadCompleteListener  : global::MonoJavaBridge.IJavaObject
		{
			void onLoadComplete(android.media.SoundPool arg0, int arg1, int arg2);
		}

		[global::MonoJavaBridge.JavaProxy(typeof(global::android.media.SoundPool.OnLoadCompleteListener))]
		internal sealed partial class OnLoadCompleteListener_ : java.lang.Object, OnLoadCompleteListener
		{
			internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
			internal OnLoadCompleteListener_(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
			{
			}
			private static global::MonoJavaBridge.MethodId _m0;
			void android.media.SoundPool.OnLoadCompleteListener.onLoadComplete(android.media.SoundPool arg0, int arg1, int arg2)
			{
				global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.OnLoadCompleteListener_.staticClass, "onLoadComplete", "(Landroid/media/SoundPool;II)V", ref global::android.media.SoundPool.OnLoadCompleteListener_._m0, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
			}
			static OnLoadCompleteListener_()
			{
				global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
				global::android.media.SoundPool.OnLoadCompleteListener_.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/media/SoundPool$OnLoadCompleteListener"));
			}
		}

		public delegate void OnLoadCompleteListenerDelegate(android.media.SoundPool arg0, int arg1, int arg2);

		internal partial class OnLoadCompleteListenerDelegateWrapper : java.lang.Object, OnLoadCompleteListener
		{
			internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
			protected OnLoadCompleteListenerDelegateWrapper(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
			{
			}
			private static global::MonoJavaBridge.MethodId _m0;
			public OnLoadCompleteListenerDelegateWrapper() : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
			{
				global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
				if (global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper._m0.native == global::System.IntPtr.Zero)
					global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper._m0 = @__env.GetMethodIDNoThrow(global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper.staticClass, "<init>", "()V");
				global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper.staticClass, global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper._m0);
				Init(@__env, handle);
			}
			static OnLoadCompleteListenerDelegateWrapper()
			{
				global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
				global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/media/SoundPool_OnLoadCompleteListenerDelegateWrapper"));
			}
		}
		internal partial class OnLoadCompleteListenerDelegateWrapper
		{
			private OnLoadCompleteListenerDelegate myDelegate;
			public void onLoadComplete(android.media.SoundPool arg0, int arg1, int arg2)
			{
				myDelegate(arg0, arg1, arg2);
			}
			public static implicit operator OnLoadCompleteListenerDelegateWrapper(OnLoadCompleteListenerDelegate d)
			{
				global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper ret = new global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper();
				ret.myDelegate = d;
				global::MonoJavaBridge.JavaBridge.SetGCHandle(global::MonoJavaBridge.JNIEnv.ThreadEnv, ret);
				return ret;
			}
		}
		private static global::MonoJavaBridge.MethodId _m0;
		protected override void finalize()
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "finalize", "()V", ref global::android.media.SoundPool._m0);
		}
		private static global::MonoJavaBridge.MethodId _m1;
		public virtual int load(android.content.Context arg0, int arg1, int arg2)
		{
			return global::MonoJavaBridge.JavaBridge.CallIntMethod(this, global::android.media.SoundPool.staticClass, "load", "(Landroid/content/Context;II)I", ref global::android.media.SoundPool._m1, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
		}
		private static global::MonoJavaBridge.MethodId _m2;
		public virtual int load(android.content.res.AssetFileDescriptor arg0, int arg1)
		{
			return global::MonoJavaBridge.JavaBridge.CallIntMethod(this, global::android.media.SoundPool.staticClass, "load", "(Landroid/content/res/AssetFileDescriptor;I)I", ref global::android.media.SoundPool._m2, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
		}
		private static global::MonoJavaBridge.MethodId _m3;
		public virtual int load(java.io.FileDescriptor arg0, long arg1, long arg2, int arg3)
		{
			return global::MonoJavaBridge.JavaBridge.CallIntMethod(this, global::android.media.SoundPool.staticClass, "load", "(Ljava/io/FileDescriptor;JJI)I", ref global::android.media.SoundPool._m3, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3));
		}
		private static global::MonoJavaBridge.MethodId _m4;
		public virtual int load(java.lang.String arg0, int arg1)
		{
			return global::MonoJavaBridge.JavaBridge.CallIntMethod(this, global::android.media.SoundPool.staticClass, "load", "(Ljava/lang/String;I)I", ref global::android.media.SoundPool._m4, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
		}
		private static global::MonoJavaBridge.MethodId _m5;
		public virtual void setPriority(int arg0, int arg1)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "setPriority", "(II)V", ref global::android.media.SoundPool._m5, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
		}
		private static global::MonoJavaBridge.MethodId _m6;
		public virtual void stop(int arg0)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "stop", "(I)V", ref global::android.media.SoundPool._m6, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		private static global::MonoJavaBridge.MethodId _m7;
		public virtual void resume(int arg0)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "resume", "(I)V", ref global::android.media.SoundPool._m7, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		private static global::MonoJavaBridge.MethodId _m8;
		public virtual void release()
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "release", "()V", ref global::android.media.SoundPool._m8);
		}
		private static global::MonoJavaBridge.MethodId _m9;
		public virtual bool unload(int arg0)
		{
			return global::MonoJavaBridge.JavaBridge.CallBooleanMethod(this, global::android.media.SoundPool.staticClass, "unload", "(I)Z", ref global::android.media.SoundPool._m9, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		private static global::MonoJavaBridge.MethodId _m10;
		public virtual int play(int arg0, float arg1, float arg2, int arg3, int arg4, float arg5)
		{
			return global::MonoJavaBridge.JavaBridge.CallIntMethod(this, global::android.media.SoundPool.staticClass, "play", "(IFFIIF)I", ref global::android.media.SoundPool._m10, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg5));
		}
		private static global::MonoJavaBridge.MethodId _m11;
		public virtual void pause(int arg0)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "pause", "(I)V", ref global::android.media.SoundPool._m11, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		private static global::MonoJavaBridge.MethodId _m12;
		public virtual void setVolume(int arg0, float arg1, float arg2)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "setVolume", "(IFF)V", ref global::android.media.SoundPool._m12, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
		}
		private static global::MonoJavaBridge.MethodId _m13;
		public virtual void autoPause()
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "autoPause", "()V", ref global::android.media.SoundPool._m13);
		}
		private static global::MonoJavaBridge.MethodId _m14;
		public virtual void autoResume()
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "autoResume", "()V", ref global::android.media.SoundPool._m14);
		}
		private static global::MonoJavaBridge.MethodId _m15;
		public virtual void setLoop(int arg0, int arg1)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "setLoop", "(II)V", ref global::android.media.SoundPool._m15, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
		}
		private static global::MonoJavaBridge.MethodId _m16;
		public virtual void setRate(int arg0, float arg1)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "setRate", "(IF)V", ref global::android.media.SoundPool._m16, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
		}
		private static global::MonoJavaBridge.MethodId _m17;
		public virtual void setOnLoadCompleteListener(android.media.SoundPool.OnLoadCompleteListener arg0)
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.media.SoundPool.staticClass, "setOnLoadCompleteListener", "(Landroid/media/SoundPool$OnLoadCompleteListener;)V", ref global::android.media.SoundPool._m17, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
		}
		public void setOnLoadCompleteListener(global::android.media.SoundPool.OnLoadCompleteListenerDelegate arg0)
		{
			setOnLoadCompleteListener((global::android.media.SoundPool.OnLoadCompleteListenerDelegateWrapper)arg0);
		}
		private static global::MonoJavaBridge.MethodId _m18;
		public SoundPool(int arg0, int arg1, int arg2) : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			if (global::android.media.SoundPool._m18.native == global::System.IntPtr.Zero)
				global::android.media.SoundPool._m18 = @__env.GetMethodIDNoThrow(global::android.media.SoundPool.staticClass, "<init>", "(III)V");
			global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.media.SoundPool.staticClass, global::android.media.SoundPool._m18, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
			Init(@__env, handle);
		}
		static SoundPool()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.media.SoundPool.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/media/SoundPool"));
		}
	}
}


text:
/**
 * @file
 *
 * Overrides for ctools modal.
 *
 */

(function ($) {
  /**
   * Override CTools modal show function so it can recognize the Bootstrap modal classes correctly
   */
  Drupal.CTools.Modal.show = function(choice) {
    var opts = {};

    if (choice && typeof choice == 'string' && Drupal.settings[choice]) {
      // This notation guarantees we are actually copying it.
      $.extend(true, opts, Drupal.settings[choice]);
    }
    else if (choice) {
      $.extend(true, opts, choice);
    }

    var defaults = {
      modalTheme: 'CToolsModalDialog',
      throbberTheme: 'CToolsModalThrobber',
      animation: 'show',
      animationSpeed: 'fast',
      modalSize: {
        type: 'scale',
        width: .8,
        height: .8,
        addWidth: 0,
        addHeight: 0,
        // How much to remove from the inner content to make space for the
        // theming.
        contentRight: 25,
        contentBottom: 45
      },
      modalOptions: {
        opacity: .55,
        background: '#fff'
      }
    };

    var settings = {};
    $.extend(true, settings, defaults, Drupal.settings.CToolsModal, opts);

    if (Drupal.CTools.Modal.currentSettings && Drupal.CTools.Modal.currentSettings != settings) {
      Drupal.CTools.Modal.modal.remove();
      Drupal.CTools.Modal.modal = null;
    }

    Drupal.CTools.Modal.currentSettings = settings;

    var resize = function(e) {
      // When creating the modal, it actually exists only in a theoretical
      // place that is not in the DOM. But once the modal exists, it is in the
      // DOM so the context must be set appropriately.
      var context = e ? document : Drupal.CTools.Modal.modal;

      if (Drupal.CTools.Modal.currentSettings.modalSize.type == 'scale') {
        var width = $(window).width() * Drupal.CTools.Modal.currentSettings.modalSize.width;
        var height = $(window).height() * Drupal.CTools.Modal.currentSettings.modalSize.height;
      }
      else {
        var width = Drupal.CTools.Modal.currentSettings.modalSize.width;
        var height = Drupal.CTools.Modal.currentSettings.modalSize.height;
      }

      // Use the additionol pixels for creating the width and height.
      $('div.ctools-modal-dialog', context).css({
        'width': width + Drupal.CTools.Modal.currentSettings.modalSize.addWidth + 'px',
        'height': height + Drupal.CTools.Modal.currentSettings.modalSize.addHeight + 'px'
      });
      $('div.ctools-modal-dialog .modal-body', context).css({
        'width': (width - Drupal.CTools.Modal.currentSettings.modalSize.contentRight) + 'px',
        'height': (height - Drupal.CTools.Modal.currentSettings.modalSize.contentBottom) + 'px'
      });
    }

    if (!Drupal.CTools.Modal.modal) {
      Drupal.CTools.Modal.modal = $(Drupal.theme(settings.modalTheme));
      if (settings.modalSize.type == 'scale') {
        $(window).bind('resize', resize);
      }
    }

    resize();

    $('.modal-title', Drupal.CTools.Modal.modal).html(Drupal.CTools.Modal.currentSettings.loadingText);
    Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed);
    $('#modalContent .modal-body').html(Drupal.theme(settings.throbberTheme));
  };

  /**
   * Provide the HTML to create the modal dialog in the Bootstrap style.
   */
  Drupal.theme.prototype.CToolsModalDialog = function () {
    var html = ''
    html += '
'
    html += '
'
    html += '
'
    html += '
';
    html += '          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
    html += '

';
    html += '
';
    html += '
';
    html += '
';
    html += '
';
    html += '
';
    html += '
';

    return html;
  }

  /**
   * Provide the HTML to create a nice looking loading progress bar.
   */
  Drupal.theme.prototype.CToolsModalThrobber = function () {
    var html = '';
    html += '
';
    html += '
';
    html += '

';
    html += '
';
    html += '
';

    return html;
  };

})(jQuery);


text:
.pwd-strength-meter .label-container.row {
    margin-bottom: 0px;
    margin-top: 12px;
}

.pwd-strength-meter .strength-label {
    margin-right: 12px;
}

.pwd-strength-meter .progress-label {
    float: right;
}

.pwd-strength-meter .pwd-error-label {
    color: red;
}

.pwd-strength-meter ul.pwd-suggestions li {
    list-style-type: disc !important;
    margin-bottom: 8px;
    color: grey;
    margin-left: 16px;
    font-size: 15px;
}


text:
[![Build Status](https://travis-ci.org/lambdacube3d/lambdacube-quake3.svg?branch=master)](https://travis-ci.org/lambdacube3d/lambdacube-quake3)
[![Join the chat at https://gitter.im/lambdacube-quake3/community](https://badges.gitter.im/lambdacube-quake3/community.svg)](https://gitter.im/lambdacube-quake3/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# First person shooter game in Haskell
However to be honest at current stage it's just a map viewer...

The motivation of the project is to experiment with purely functional design of a real word 3D computer game.

For technical details check presentation video [The innards of a purely functional 3D shooter game engine (influenced by Quake 3)](https://skillsmatter.com/skillscasts/8733-the-innards-of-a-purely-functional-3d-shooter-game-engine-influenced-by-quake-3) from Haskell Exchange 2016.

To get an overview of LambdaCube 3D watch the showcase [presentation video](https://www.youtube.com/watch?v=IjtjSqkEhDY).

### System Requirements
- OS: Windows/Linux/macOS
- Graphics: OpenGL 3.3 or better

### Install Steps
#### 0. Clone this repository
```git clone https://github.com/lambdacube3d/lambdacube-quake3.git```

#### 1. Get pak0.pk3
First you have to get the **pak0.pk3** file which contains the game data. You can get it for free from **Quake3 Demo** version. Here are some alternatives:
- **(a)** [download](https://github.com/patdohere/dockerfiles/raw/master/quakejs-stack/quakejs/base/baseq3/pak0.pk3) Quake3 Demo pak0.pk3 directly (**EASY**)
- **(b)** [step by step](https://slackalaxy.wordpress.com/2015/07/05/quake-iii-demo/) instructions to extract pak0.pk3 from Quake 3 Demo, first [download](http://www.filewatcher.com/m/linuxq3ademo-1.11-6.x86.gz.sh.49289300-0.html
) linuxq3ademo-1.11-6.x86.gz.sh

If you own the full version of the game you can use the **pak0.pk3** from it also.

Then copy **pak0.pk3** to the directory where you execute the application from. E.g. ```./lambdacube-quake3```

#### 2. On **Linux** install the following libraries.
   i.e. on Ubuntu:
   ```
   sudo apt install libgl1-mesa-dev libxi-dev libxcursor-dev libxinerama-dev libxrandr-dev zlib1g-dev libpulse-dev
   ```
   For other Linux distributions make sure the corresponing packages are installed.

   *These libraries required for OpenGL development.*

#### 3. Compile & Run

To compile you will need [Haskell Stack](https://docs.haskellstack.org/en/stable/README/).

```
stack setup
stack build
stack exec q3mapviewer
```

### Example Run
When you run it you have to select a map by typing it's name. E.g.
```
bash-3.2$ stack exec q3mapviewer
Available maps:
q3dm1 q3dm17 q3dm7 q3tourney2
Enter map name:
q3tourney2
```
The application will search **pak0.pk3** in the current directory and also will create the ```.lc_q3.cache``` folder to cache the compiled graphics pipelines. It reduces the loading time if the map was loaded before.
![Quake III level viewer](https://raw.githubusercontent.com/csabahruska/quake3/master/lambdacube-dsl-quake3.jpg)


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

<TITLE>
CTXYAdjustHandle (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.sl.draw.binding

Class CTXYAdjustHandle

java.lang.Object
  org.apache.poi.sl.draw.binding.CTXYAdjustHandle

public class CTXYAdjustHandle
extends java.lang.Object

Java class for CT_XYAdjustHandle complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="CT_XYAdjustHandle">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="pos" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D"/>
       </sequence>
       <attribute name="gdRefX" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideName" />
       <attribute name="minX" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
       <attribute name="maxX" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
       <attribute name="gdRefY" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideName" />
       <attribute name="minY" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
       <attribute name="maxY" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
     </restriction>
   </complexContent>
 </complexType>

Field Summary

protected  java.lang.String
gdRefX

protected  java.lang.String
gdRefY

protected  java.lang.String
maxX

protected  java.lang.String
maxY

protected  java.lang.String
minX

protected  java.lang.String
minY

protected  CTAdjPoint2D
pos

Constructor Summary

CTXYAdjustHandle()

Method Summary

 java.lang.String
getGdRefX()

          Gets the value of the gdRefX property.

 java.lang.String
getGdRefY()

          Gets the value of the gdRefY property.

 java.lang.String
getMaxX()

          Gets the value of the maxX property.

 java.lang.String
getMaxY()

          Gets the value of the maxY property.

 java.lang.String
getMinX()

          Gets the value of the minX property.

 java.lang.String
getMinY()

          Gets the value of the minY property.

 CTAdjPoint2D
getPos()

          Gets the value of the pos property.

 boolean
isSetGdRefX()

 boolean
isSetGdRefY()

 boolean
isSetMaxX()

 boolean
isSetMaxY()

 boolean
isSetMinX()

 boolean
isSetMinY()

 boolean
isSetPos()

 void
setGdRefX(java.lang.String value)

          Sets the value of the gdRefX property.

 void
setGdRefY(java.lang.String value)

          Sets the value of the gdRefY property.

 void
setMaxX(java.lang.String value)

          Sets the value of the maxX property.

 void
setMaxY(java.lang.String value)

          Sets the value of the maxY property.

 void
setMinX(java.lang.String value)

          Sets the value of the minX property.

 void
setMinY(java.lang.String value)

          Sets the value of the minY property.

 void
setPos(CTAdjPoint2D value)

          Sets the value of the pos property.

Methods inherited from class java.lang.Object

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

Field Detail

pos

protected CTAdjPoint2D pos

gdRefX

protected java.lang.String gdRefX

minX

protected java.lang.String minX

maxX

protected java.lang.String maxX

gdRefY

protected java.lang.String gdRefY

minY

protected java.lang.String minY

maxY

protected java.lang.String maxY

Constructor Detail

CTXYAdjustHandle

public CTXYAdjustHandle()

Method Detail

getPos

public CTAdjPoint2D getPos()

Gets the value of the pos property.

Returns:
possible object is
     CTAdjPoint2D

setPos

public void setPos(CTAdjPoint2D value)

Sets the value of the pos property.

Parameters:
value - allowed object is
     CTAdjPoint2D

isSetPos

public boolean isSetPos()

getGdRefX

public java.lang.String getGdRefX()

Gets the value of the gdRefX property.

Returns:
possible object is
     String

setGdRefX

public void setGdRefX(java.lang.String value)

Sets the value of the gdRefX property.

Parameters:
value - allowed object is
     String

isSetGdRefX

public boolean isSetGdRefX()

getMinX

public java.lang.String getMinX()

Gets the value of the minX property.

Returns:
possible object is
     String

setMinX

public void setMinX(java.lang.String value)

Sets the value of the minX property.

Parameters:
value - allowed object is
     String

isSetMinX

public boolean isSetMinX()

getMaxX

public java.lang.String getMaxX()

Gets the value of the maxX property.

Returns:
possible object is
     String

setMaxX

public void setMaxX(java.lang.String value)

Sets the value of the maxX property.

Parameters:
value - allowed object is
     String

isSetMaxX

public boolean isSetMaxX()

getGdRefY

public java.lang.String getGdRefY()

Gets the value of the gdRefY property.

Returns:
possible object is
     String

setGdRefY

public void setGdRefY(java.lang.String value)

Sets the value of the gdRefY property.

Parameters:
value - allowed object is
     String

isSetGdRefY

public boolean isSetGdRefY()

getMinY

public java.lang.String getMinY()

Gets the value of the minY property.

Returns:
possible object is
     String

setMinY

public void setMinY(java.lang.String value)

Sets the value of the minY property.

Parameters:
value - allowed object is
     String

isSetMinY

public boolean isSetMinY()

getMaxY

public java.lang.String getMaxY()

Gets the value of the maxY property.

Returns:
possible object is
     String

setMaxY

public void setMaxY(java.lang.String value)

Sets the value of the maxY property.

Parameters:
value - allowed object is
     String

isSetMaxY

public boolean isSetMaxY()

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2017 The Apache Software Foundation or
        its licensors, as applicable.


text:
require "support/shared/integration/integration_helper"

describe "Chef::Resource.property validation" do
  include IntegrationSupport

  module Namer
    @i = 0
    def self.next_resource_name
      "chef_resource_property_spec_#{@i += 1}"
    end

    def self.reset_index
      @current_index = 0
    end

    def self.current_index
      @current_index
    end

    def self.next_index
      @current_index += 1
    end
  end

  def lazy(&block)
    Chef::DelayedEvaluator.new(&block)
  end

  before do
    Namer.reset_index
  end

  def self.new_resource_name
    Namer.next_resource_name
  end

  let(:resource_class) do
    new_resource_name = self.class.new_resource_name
    Class.new(Chef::Resource) do
      resource_name new_resource_name
      def blah
        Namer.next_index
      end

      def self.blah
        "class#{Namer.next_index}"
      end
    end
  end

  let(:resource) do
    resource_class.new("blah")
  end

  def self.english_join(values)
    return "<nothing>" if values.size == 0
    return values[0].inspect if values.size == 1
    "#{values[0..-2].map { |v| v.inspect }.join(", ")} and #{values[-1].inspect}"
  end

  def self.with_property(*properties, &block)
    tags_index = properties.find_index { |p| !p.is_a?(String) }
    if tags_index
      properties, tags = properties[0..tags_index - 1], properties[tags_index..-1]
    else
      tags = []
    end
    properties = properties.map { |property| "property #{property}" }
    context "With properties #{english_join(properties)}", *tags do
      before do
        properties.each do |property_str|
          resource_class.class_eval(property_str, __FILE__, __LINE__)
        end
      end
      instance_eval(&block)
    end
  end

  def self.validation_test(validation, success_values, failure_values, *tags)
    with_property ":x, #{validation}", *tags do
      it "gets nil when retrieving the initial (non-set) value" do
        expect(resource.x).to be_nil
      end
      success_values.each do |v|
        it "value #{v.inspect} is valid" do
          resource.instance_eval { @x = "default" }
          expect(resource.x v).to eq v
          expect(resource.x).to eq v
        end
      end
      failure_values.each do |v|
        it "value #{v.inspect} is invalid" do
          expect { resource.x v }.to raise_error Chef::Exceptions::ValidationFailed
          resource.instance_eval { @x = "default" }
          expect { resource.x v }.to raise_error Chef::Exceptions::ValidationFailed
        end
      end
      it "setting x to nil when it is already nil does not emit a warning" do
        expect(resource.x nil).to be_nil
        expect(resource.x).to be_nil
      end
      unless tags.include?(:nillable)
        it "changing x to nil warns that the get will change to a set in Chef 13 and does not change the value" do
          resource.instance_eval { @x = "default" }
          expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError,
            /An attempt was made to change x from "default" to nil by calling x\(nil\). In Chef 12, this does a get rather than a set. In Chef 13, this will change to set the value to nil./
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          expect(resource.x nil).to eq "default"
          expect(resource.x).to eq "default"
        end
      end
    end
    if tags.include?(:nil_is_valid)
      with_property ":x, #{validation}, default: nil" do
        it "setting x to nil when it is already nil does not emit a warning" do
          expect(resource.x nil).to be_nil
          expect(resource.x).to be_nil
        end
        it "changing x to nil warns that the get will change to a set in Chef 13 and does not change the value" do
          resource.instance_eval { @x = "default" }
          expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError,
            /An attempt was made to change x from "default" to nil by calling x\(nil\). In Chef 12, this does a get rather than a set. In Chef 13, this will change to set the value to nil./
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          expect(resource.x nil).to eq "default"
          expect(resource.x).to eq "default"
        end
      end
    elsif tags.include?(:nillable)
      with_property ":x, #{validation}, nillable: true" do
        it "changing x to nil with nillable true overwrites defaults and just works" do
          resource.instance_eval { @x = "default" }
          expect { resource.x nil }.not_to raise_error
          expect(resource.x nil).to eq nil
          expect(resource.x).to eq nil
        end
      end
    else
      it "property :x, #{validation}, default: nil warns that the default is invalid" do
        expect { resource_class.class_eval("property :x, #{validation}, default: nil", __FILE__, __LINE__) }.to raise_error Chef::Exceptions::DeprecatedFeatureError,
          /Default value nil is invalid for property x of resource chef_resource_property_spec_(\d+). Possible fixes: 1. Remove 'default: nil' if nil means 'undefined'. 2. Set a valid default value if there is a reasonable one. 3. Allow nil as a valid value of your property \(for example, 'property :x, \[ String, nil \], default: nil'\)./
      end
      context "With property :x, #{validation}, default: nil" do
        before do
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          resource_class.class_eval("property :x, #{validation}, default: nil", __FILE__, __LINE__)
          Chef::Config[:treat_deprecation_warnings_as_errors] = true
        end

        it "changing x to nil emits a warning that the value is invalid and does not change the value" do
          resource.instance_eval { @x = "default" }
          expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError,
            /nil is an invalid value for x of resource chef_resource_property_spec_(\d+). In Chef 13, this warning will change to an error./
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          expect(resource.x nil).to eq "default"
          expect(resource.x).to eq "default"
        end
      end
    end
  end

  context "basic get, set, and nil set" do
    with_property ":x, kind_of: String" do
      context "when the variable already has a value" do
        before do
          resource.instance_eval { @x = "default" }
        end
        it "get succeeds" do
          expect(resource.x).to eq "default"
        end
        it "set to valid value succeeds" do
          expect(resource.x "str").to eq "str"
          expect(resource.x).to eq "str"
        end
        it "set to invalid value raises ValidationFailed" do
          expect { resource.x 10 }.to raise_error Chef::Exceptions::ValidationFailed
        end
        it "set to nil emits a deprecation warning and does a get" do
          expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          resource.x "str"
          expect(resource.x nil).to eq "str"
          expect(resource.x).to eq "str"
        end
      end
      context "when the variable does not have an initial value" do
        it "get succeeds" do
          expect(resource.x).to be_nil
        end
        it "set to valid value succeeds" do
          expect(resource.x "str").to eq "str"
          expect(resource.x).to eq "str"
        end
        it "set to invalid value raises ValidationFailed" do
          expect { resource.x 10 }.to raise_error Chef::Exceptions::ValidationFailed
        end
        it "set to nil emits no warning because the value would not change" do
          expect(resource.x nil).to be_nil
        end
      end
    end
    with_property ":x, [ String, nil ]" do
      context "when the variable already has a value" do
        before do
          resource.instance_eval { @x = "default" }
        end
        it "get succeeds" do
          expect(resource.x).to eq "default"
        end
        it "set(nil) emits a warning that the value will be set, but does not set the value" do
          expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError,
            /An attempt was made to change x from "default" to nil by calling x\(nil\). In Chef 12, this does a get rather than a set. In Chef 13, this will change to set the value to nil./
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          expect(resource.x nil).to eq "default"
          expect(resource.x).to eq "default"
        end
        it "set to valid value succeeds" do
          expect(resource.x "str").to eq "str"
          expect(resource.x).to eq "str"
        end
        it "set to invalid value raises ValidationFailed" do
          expect { resource.x 10 }.to raise_error Chef::Exceptions::ValidationFailed
        end
      end
      context "when the variable does not have an initial value" do
        it "get succeeds" do
          expect(resource.x).to be_nil
        end
        it "set(nil) sets the value" do
          expect(resource.x nil).to be_nil
          expect(resource.x).to be_nil
        end
        it "set to valid value succeeds" do
          expect(resource.x "str").to eq "str"
          expect(resource.x).to eq "str"
        end
        it "set to invalid value raises ValidationFailed" do
          expect { resource.x 10 }.to raise_error Chef::Exceptions::ValidationFailed
        end
      end
    end
  end

  # Bare types
  context "bare types" do
    validation_test "String",
      [ "hi" ],
      [ 10 ]

    validation_test ":a",
      [ :a ],
      [ :b ]

    validation_test ":a, is: :b",
      [ :a, :b ],
      [ :c ]

    validation_test ":a, is: [ :b, :c ]",
      [ :a, :b, :c ],
      [ :d ]

    validation_test "[ :a, :b ], is: :c",
      [ :a, :b, :c ],
      [ :d ]

    validation_test "[ :a, :b ], is: [ :c, :d ]",
      [ :a, :b, :c, :d ],
      [ :e ]

    validation_test "nil",
      [ ],
      [ :a ],
      :nil_is_valid

    validation_test "[ nil ]",
      [ ],
      [ :a ],
      :nil_is_valid

    validation_test "[]",
      [],
      [ :a ]

    validation_test "[ String, nil ], nillable: true",
      [ nil, "thing" ],
      [ :nope, false ],
      :nillable
  end

  # is
  context "is" do
    # Class
    validation_test "is: String",
      [ "a", "" ],
      [ :a, 1 ]

    # Value
    validation_test "is: :a",
      [ :a ],
      [ :b ]

    validation_test "is: [ :a, :b ]",
      [ :a, :b ],
      [ [ :a, :b ] ]

    validation_test "is: [ [ :a, :b ] ]",
      [ [ :a, :b ] ],
      [ :a, :b ]

    # Regex
    validation_test "is: /abc/",
      %w{abc wowabcwow},
      [ "", "abac" ]

    # Property
    validation_test "is: Chef::Property.new(is: :a)",
      [ :a ],
      [ :b ]

    # RSpec Matcher
    class Globalses
      extend RSpec::Matchers
    end

    validation_test "is: Globalses.eq(10)",
      [ 10 ],
      [ 1 ]

    # Proc
    validation_test "is: proc { |x| x }",
      [ true, 1 ],
      [ false ]

    validation_test "is: proc { |x| x > blah }",
      [ 10 ],
      [ -1 ]

    validation_test "is: nil",
      [ ],
      [ "a" ],
      :nil_is_valid

    validation_test "is: [ String, nil ]",
      [ "a" ],
      [ :b ],
      :nil_is_valid

    validation_test "is: []",
      [],
      [ :a ]
  end

  # Combination
  context "combination" do
    validation_test 'kind_of: String, equal_to: "a"',
      [ "a" ],
      [ "b" ],
      :nil_is_valid
  end

  # equal_to
  context "equal_to" do
    # Value
    validation_test "equal_to: :a",
      [ :a ],
      [ :b ],
      :nil_is_valid

    validation_test "equal_to: [ :a, :b ]",
      [ :a, :b ],
      [ [ :a, :b ] ],
      :nil_is_valid

    validation_test "equal_to: [ [ :a, :b ] ]",
      [ [ :a, :b ] ],
      [ :a, :b ],
      :nil_is_valid

    validation_test "equal_to: nil",
      [ ],
      [ "a" ],
      :nil_is_valid

    validation_test 'equal_to: [ "a", nil ]',
      [ "a" ],
      [ "b" ],
      :nil_is_valid

    validation_test 'equal_to: [ nil, "a" ]',
      [ "a" ],
      [ "b" ],
      :nil_is_valid

    validation_test "equal_to: []",
      [],
      [ :a ],
      :nil_is_valid

  end

  # kind_of
  context "kind_of" do
    validation_test "kind_of: String",
      [ "a" ],
      [ :b ],
      :nil_is_valid

    validation_test "kind_of: [ String, Symbol ]",
      [ "a", :b ],
      [ 1 ],
      :nil_is_valid

    validation_test "kind_of: [ Symbol, String ]",
      [ "a", :b ],
      [ 1 ],
      :nil_is_valid

    validation_test "kind_of: NilClass",
      [ ],
      [ "a" ],
      :nil_is_valid

    validation_test "kind_of: [ NilClass, String ]",
      [ "a" ],
      [ :a ],
      :nil_is_valid

    validation_test "kind_of: []",
      [],
      [ :a ],
      :nil_is_valid

    validation_test "kind_of: nil",
      [],
      [ :a ],
      :nil_is_valid
  end

  # regex
  context "regex" do
    validation_test "regex: /abc/",
      [ "xabcy" ],
      [ "gbh", 123 ],
      :nil_is_valid

    validation_test "regex: [ /abc/, /z/ ]",
      %w{xabcy aza},
      [ "gbh", 123 ],
      :nil_is_valid

    validation_test "regex: [ /z/, /abc/ ]",
      %w{xabcy aza},
      [ "gbh", 123 ],
      :nil_is_valid

    validation_test "regex: [ [ /z/, /abc/ ], [ /n/ ] ]",
      %w{xabcy aza ana},
      [ "gbh", 123 ],
      :nil_is_valid

    validation_test "regex: []",
      [],
      [ :a ],
      :nil_is_valid

    validation_test "regex: nil",
      [],
      [ :a ],
      :nil_is_valid
  end

  # callbacks
  context "callbacks" do
    validation_test 'callbacks: { "a" => proc { |x| x > 10 }, "b" => proc { |x| x%2 == 0 } }',
      [ 12 ],
      [ 11, 4 ],
      :nil_is_valid

    validation_test 'callbacks: { "a" => proc { |x| x%2 == 0 }, "b" => proc { |x| x > 10 } }',
      [ 12 ],
      [ 11, 4 ],
      :nil_is_valid

    validation_test 'callbacks: { "a" => proc { |x| x.nil? } }',
      [ ],
      [ "a" ],
      :nil_is_valid

    validation_test "callbacks: {}",
      [ :a ],
      [],
      :nil_is_valid
  end

  # respond_to
  context "respond_to" do
    validation_test "respond_to: :split",
      [ "hi" ],
      [ 1 ],
      :nil_is_valid

    validation_test 'respond_to: "split"',
      [ "hi" ],
      [ 1 ],
      :nil_is_valid

    validation_test "respond_to: :to_s",
      [ :a ],
      [],
      :nil_is_valid

    validation_test "respond_to: [ :split, :to_s ]",
      [ "hi" ],
      [ 1 ],
      :nil_is_valid

    validation_test "respond_to: %w(split to_s)",
      [ "hi" ],
      [ 1 ],
      :nil_is_valid

    validation_test "respond_to: [ :to_s, :split ]",
      [ "hi" ],
      [ 1 ],
      :nil_is_valid

    validation_test "respond_to: []",
      [ :a ],
      [],
      :nil_is_valid

    validation_test "respond_to: nil",
      [ :a ],
      [],
      :nil_is_valid
  end

  context "cannot_be" do
    validation_test "cannot_be: :empty",
      [ 1, [1, 2], { a: 10 } ],
      [ [] ],
      :nil_is_valid

    validation_test 'cannot_be: "empty"',
      [ 1, [1, 2], { a: 10 } ],
      [ [] ],
      :nil_is_valid

    validation_test "cannot_be: [ :empty, :nil ]",
      [ 1, [1, 2], { a: 10 } ],
      [ [] ],
      :nil_is_valid

    validation_test 'cannot_be: [ "empty", "nil" ]',
      [ 1, [1, 2], { a: 10 } ],
      [ [] ],
      :nil_is_valid

    validation_test "cannot_be: [ :nil, :empty ]",
      [ 1, [1, 2], { a: 10 } ],
      [ [] ],
      :nil_is_valid

    validation_test "cannot_be: [ :empty, :nil, :blahblah ]",
      [ 1, [1, 2], { a: 10 } ],
      [ [] ],
      :nil_is_valid

    validation_test "cannot_be: []",
      [ :a ],
      [],
      :nil_is_valid

    validation_test "cannot_be: nil",
      [ :a ],
      [],
      :nil_is_valid

  end

  context "required" do
    with_property ":x, required: true" do
      it "if x is not specified, retrieval fails" do
        expect { resource.x }.to raise_error Chef::Exceptions::ValidationFailed
      end
      it "value 1 is valid" do
        expect(resource.x 1).to eq 1
        expect(resource.x).to eq 1
      end
      it "value nil emits a validation failed error because it must have a value" do
        expect { resource.x nil }.to raise_error Chef::Exceptions::ValidationFailed
      end
      context "and value is set to something other than nil" do
        before { resource.x 10 }
        it "value nil emits a deprecation warning and does a get" do
          expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          resource.x 1
          expect(resource.x nil).to eq 1
          expect(resource.x).to eq 1
        end
      end
    end

    with_property ":x, [String, nil], required: true" do
      it "if x is not specified, retrieval fails" do
        expect { resource.x }.to raise_error Chef::Exceptions::ValidationFailed
      end
      it "value nil is not valid (required means 'not nil')" do
        expect { resource.x nil }.to raise_error Chef::Exceptions::ValidationFailed
      end
      it "value '1' is valid" do
        expect(resource.x "1").to eq "1"
        expect(resource.x).to eq "1"
      end
      it "value 1 is invalid" do
        expect { resource.x 1 }.to raise_error Chef::Exceptions::ValidationFailed
      end
    end

    with_property ":x, name_property: true, required: true" do
      it "if x is not specified, the name property is returned" do
        expect(resource.x).to eq "blah"
      end
      it "value 1 is valid" do
        expect(resource.x 1).to eq 1
        expect(resource.x).to eq 1
      end
      it "value nil emits a deprecation warning and does a get" do
        expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError
        Chef::Config[:treat_deprecation_warnings_as_errors] = false
        resource.x 1
        expect(resource.x nil).to eq 1
        expect(resource.x).to eq 1
      end
    end

    with_property ":x, default: 10, required: true" do
      it "if x is not specified, the default is returned" do
        expect(resource.x).to eq 10
      end
      it "value 1 is valid" do
        expect(resource.x 1).to eq 1
        expect(resource.x).to eq 1
      end
      it "value nil is invalid" do
        expect { resource.x nil }.to raise_error Chef::Exceptions::DeprecatedFeatureError
        Chef::Config[:treat_deprecation_warnings_as_errors] = false
        resource.x 1
        expect(resource.x nil).to eq 1
        expect(resource.x).to eq 1
      end
    end
  end

  context "custom validators (def _pv_blarghle)" do
    before do
      Chef::Config[:treat_deprecation_warnings_as_errors] = false
    end

    with_property ":x, blarghle: 1" do
      context "and a class that implements _pv_blarghle" do
        before do
          resource_class.class_eval do
            def _pv_blarghle(opts, key, value)
              if _pv_opts_lookup(opts, key) != value
                raise Chef::Exceptions::ValidationFailed, "ouch"
              end
            end
          end
        end

        it "value 1 is valid" do
          expect(resource.x 1).to eq 1
          expect(resource.x).to eq 1
        end

        it "value '1' is invalid" do
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          expect { resource.x "1" }.to raise_error Chef::Exceptions::ValidationFailed
        end

        it "value nil does a get" do
          Chef::Config[:treat_deprecation_warnings_as_errors] = false
          resource.x 1
          resource.x nil
          expect(resource.x).to eq 1
        end
      end
    end

    with_property ":x, blarghle: 1" do
      context "and a class that implements _pv_blarghle" do
        before do
          resource_class.class_eval do
            def _pv_blarghle(opts, key, value)
              if _pv_opts_lookup(opts, key) != value
                raise Chef::Exceptions::ValidationFailed, "ouch"
              end
            end
          end
        end

        it "value 1 is valid" do
          expect(resource.x 1).to eq 1
          expect(resource.x).to eq 1
        end

        it "value '1' is invalid" do
          expect { resource.x "1" }.to raise_error Chef::Exceptions::ValidationFailed
        end

        it "value nil does a get" do
          resource.x 1
          resource.x nil
          expect(resource.x).to eq 1
        end
      end
    end
  end
end


text:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

require_once(__DIR__.'/../config.php');
require_once(__DIR__.'/../lib/database.php');
require_once(__DIR__.'/../lib/sharedfunctions.php');
require_once(__DIR__.'/../corelib/dataaccess.php');

$uinfo = checkLoggedInUser(false, $error);
$dbUser = getUserRecord($uinfo);
$loggedUserID = $dbUser->id;

if($uinfo==false) exit();

if (isset($_GET['notificationId']) && is_numeric($_GET['notificationId']) && $_GET['notificationId'] >= 0 ) {
	$notificationId = dataConnection::safe($_GET['notificationId']);

} else exit();

$query ="UPDATE notification SET seen=1  WHERE id=$notificationId";
$result = dataConnection::runquery($query);

?>


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    NSString *bundlePath1 = [[NSBundle mainBundle] pathForResource:@"BaseSample" ofType:@"bundle"];
    NSString *bundlePath2 = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"bundle"];
    NSString *bundlePath3 = [[NSBundle mainBundle] pathForResource:@"Assets" ofType:@"bundle"];
    AWLThemeManager *mgr = [[AWLThemeManager alloc] init];
    [mgr addTheme:bundlePath1];
    [mgr addTheme:bundlePath2];
    mgr.currentTheme = [mgr addTheme:bundlePath3];
    UIImage *img = [mgr imageNamed:@"icon"];
    UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
    imgView.center = CGPointMake(CGRectGetWidth(self.view.bounds)/2, CGRectGetHeight(self.view.bounds)/2);
    [self.view addSubview:imgView];

    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
    titleLabel.center = CGPointMake(imgView.center.x, CGRectGetMaxY(imgView.frame) + 30);
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.backgroundColor = [UIColor whiteColor];
    titleLabel.textColor = [mgr colorForKey:@"Content_Text_Color"];
    titleLabel.font = [mgr fontForKey:@"Content_Font"];
    titleLabel.text = @"Hello, world!";
    [self.view addSubview:titleLabel];

    self.view.backgroundColor = [mgr colorForKey:@"View_BG_Color"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
module Maguro
  class Heroku

    attr_reader :builder, :app_name, :organization, :production_name, :staging_name

    def initialize(builder, app_name, organization)
      @builder = builder
      @app_name = app_name.gsub(/[_ ]/,'-')
      @organization = organization
      @production_name = "#{@organization}-#{@app_name}"
      @staging_name = "#{@organization}-#{@app_name}-staging"
    end

    def create_app(app_name, remote_name)
      builder.run "heroku apps:create #{app_name} --remote #{remote_name}"
    end

    # https://addons.heroku.com/heroku-postgresql
    def add_database(app_name)
      builder.run "heroku addons:add heroku-postgresql --app #{app_name}"
    end

    # https://addons.heroku.com/pgbackups
    # length can be "week" or "month"
    def add_pg_backup(app_name, length="month")
      builder.run "heroku addons:add pgbackups:auto-#{length} --app #{app_name}"
    end

    def create
      create_app(staging_name, "staging")
      create_app(production_name, "production")

      add_database(staging_name)
      add_database(production_name)

      add_pg_backup(staging_name, "week")
      add_pg_backup(production_name)
    end

    def push
      builder.git push: "production master:master"
      builder.git push: "staging master:master"
    end
  end
end


text:
The `seq` utility allows you to output a sequence of values.

You can start at `1` by default.

```bash
$ seq 3
1
2
3
```

Or you can specify the starting value.

```bash
$ seq 10 13
10
11
12
13
```

Adding a third argument in between those two will specify the step value that
should be taken to get from one to the other.

```bash
$ seq 6 3 15
6
9
12
15
```

That sequence starts at 6 and goes to 15 with a step value of 3.

See `man seq` for more details.