text:
import subprocess
import os
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--bucket', type=str, default='')
parser.add_argument('--emr_version', type=str, default='')
parser.add_argument('--region', type=str, default='')
parser.add_argument('--user_name', type=str, default='')
parser.add_argument('--cluster_name', type=str, default='')
args = parser.parse_args()

if __name__ == "__main__":
    spark_def_path = "/usr/lib/spark/conf/spark-defaults.conf"
    spark_def_path_line1 = subprocess.check_output("cat " + spark_def_path +
                                                   " | grep spark.driver.extraClassPath | awk '{print $2}' | "
                                                   "sed 's/^:// ; s~jar:~jar ~g; s~/\*:~/\* ~g; s~:~/\* ~g'",
                                                   shell=True)
    spark_def_path_line2 = subprocess.check_output("cat " + spark_def_path +
                                                   " | grep spark.driver.extraLibraryPath | awk '{print $2}' | "
                                                   "sed 's/^:// ; s~jar:~jar ~g; s~/\*:~/\* ~g; s~:\|$~/\* ~g'",
                                                   shell=True)
    spark_def_path_line1 = spark_def_path_line1.strip('\n')
    spark_def_path_line2 = spark_def_path_line2.strip('\n')
    if args.region == 'us-east-1':
        endpoint = "https://s3.amazonaws.com"
    elif args.region == 'cn-north-1':
        endpoint = "https://s3.{}.amazonaws.com.cn".format(args.region)
    else:
        endpoint = "https://s3-{}.amazonaws.com".format(args.region)
    os.system('touch /tmp/python_version')
    python_ver = subprocess.check_output("python3.5 -V 2>/dev/null | awk '{print $2}'", shell=True)
    if python_ver != '':
        with open('/tmp/python_version', 'w') as outfile:
            outfile.write(python_ver)
    else:
        python_ver = subprocess.check_output("python3.4 -V 2>/dev/null | awk '{print $2}'", shell=True)
        with open('/tmp/python_version', 'w') as outfile:
            outfile.write(python_ver)
    os.system('/bin/tar -zhcvf /tmp/jars.tar.gz '
              '--no-recursion '
              '--absolute-names '
              '--ignore-failed-read /usr/lib/hadoop/* {} {} /usr/lib/hadoop/client/*'.
              format(spark_def_path_line1,
                     spark_def_path_line2))
    os.system('/bin/tar -zhcvf /tmp/spark.tar.gz -C /usr/lib/ spark')
    md5sum = subprocess.check_output('md5sum /tmp/jars.tar.gz', shell=True)
    with open('/tmp/jars-checksum.chk', 'w') as outfile:
        outfile.write(md5sum)
    md5sum = subprocess.check_output('md5sum /tmp/spark.tar.gz', shell=True)
    with open('/tmp/spark-checksum.chk', 'w') as outfile:
        outfile.write(md5sum)
    os.system('aws s3 cp /tmp/jars.tar.gz '
              's3://{}/jars/{}/ '
              '--endpoint-url {} '
              '--region {} --sse AES256'.
              format(args.bucket,
                     args.emr_version,
                     endpoint,
                     args.region))
    os.system('aws s3 cp /tmp/jars-checksum.chk '
              's3://{}/jars/{}/ '
              '--endpoint-url {} '
              '--region {} --sse AES256'.
              format(args.bucket,
                     args.emr_version,
                     endpoint,
                     args.region))
    os.system('aws s3 cp {} '
              's3://{}/{}/{}/ '
              '--endpoint-url {} '
              '--region {} --sse AES256'.
              format(spark_def_path,
                     args.bucket,
                     args.user_name,
                     args.cluster_name,
                     endpoint,
                     args.region))
    os.system('aws s3 cp /tmp/python_version '
              's3://{}/{}/{}/ '
              '--endpoint-url {} '
              '--region {} --sse AES256'.
              format(args.bucket,
                     args.user_name,
                     args.cluster_name,
                     endpoint,
                     args.region))
    os.system('aws s3 cp /tmp/spark.tar.gz '
              's3://{}/{}/{}/ '
              '--endpoint-url {} '
              '--region {} --sse AES256'.
              format(args.bucket,
                     args.user_name,
                     args.cluster_name,
                     endpoint,
                     args.region))
    os.system('aws s3 cp /tmp/spark-checksum.chk '
              's3://{}/{}/{}/ '
              '--endpoint-url {} '
              '--region {} --sse AES256'.
              format(args.bucket,
                     args.user_name,
                     args.cluster_name,
                     endpoint, args.region))


text:
@class GHDateSelectViewController;

@protocol GHDateSelectViewControllerDelegate <NSObject>

- (void)dateSelectViewController:(GHDateSelectViewController *)viewController didSelectDate:(NSDate *)date;
- (void)dateSelectViewControllerDidCancel:(GHDateSelectViewController *)viewController;

@end

@interface GHDateSelectViewController : KalViewController {
@private
    id<GHDateSelectViewControllerDelegate> __weak _dateDelegate;
}

@property (nonatomic, weak) id<GHDateSelectViewControllerDelegate> dateDelegate;

- (void)cancelButtonClicked:(UIBarButtonItem *)sender;

@end

redpajama_set_name: RedPajamaGithub


text:
package com.greenpepper.html;

import static org.junit.Assert.assertEquals;

import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;

import com.greenpepper.annotation.Status;
import org.junit.Test;

public class HtmlExampleTest {

    @Test
    public void printEmptyTag() {
        HtmlExample example = new HtmlExample("", "
", null, "", "
", "", null, null, null);
        testPrint(example, "

");
    }

    @Test
    public void printNonEmptyTag() {
        HtmlExample example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        String expected = "
content
";
        testPrint(example, expected);
    }

    @Test
    public void printNonEmptyTagWithStyle() {
        HtmlExample example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        example.setStyle("style1", "whatever");
        testPrint(example, "
content
");
        example.setStyle("style2", "any");
        testPrint(example, "
content
");
    }

    @Test
    public void printNonEmptyTagWithCssClasses() {
        HtmlExample example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        example.setCssClasses("class1", "class2");
        testPrint(example, "
content
");
    }

    @Test
    public void printNonEmptyTagWithGPtags() {
        HtmlExample example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        example.setStatus(Status.SUCCESS);
        testPrint(example, "
content
");

        example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        example.setStatus(Status.FAILLURE);
        testPrint(example, "
content
");

        example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        example.setStatus(Status.SKIPPED);
        testPrint(example, "
content
");

        example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        example.setStatus(Status.IGNORED);
        testPrint(example, "
content
");

        example = new HtmlExample("", "
", null, "content", "
", "", null, null, null);
        example.setStatus(Status.ERROR);
        testPrint(example, "
content
");
    }

    private void testPrint(HtmlExample example, String expected) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintWriter out = new PrintWriter(baos);

        // Run
        example.print(out);

        // Verify
        out.flush();
        out.close();
        assertEquals(expected, baos.toString());
    }

}


text:
type Channel = "FAST_REFRESH"
type Event = [
  Channel,
  {
    action: string
    payload?: any
  }
]

declare global {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  interface Window {
    _gatsbyEvents: Array<Event> | { push: (event: Event) => void }
  }
}

// Use `self` here instead of `window` so it works in non-window environments (like Workers)
self._gatsbyEvents = self._gatsbyEvents || []

export function clearCompileError(): void {
  self._gatsbyEvents.push([`FAST_REFRESH`, { action: `CLEAR_COMPILE_ERROR` }])
}

export function clearRuntimeErrors(dismissOverlay: boolean): void {
  if (typeof dismissOverlay === `undefined` || dismissOverlay) {
    self._gatsbyEvents.push([
      `FAST_REFRESH`,
      { action: `CLEAR_RUNTIME_ERRORS` },
    ])
  }
}

export function showCompileError(message): void {
  if (!message) {
    return
  }

  self._gatsbyEvents.push([
    `FAST_REFRESH`,
    {
      action: `SHOW_COMPILE_ERROR`,
      payload: message,
    },
  ])
}

export function showRuntimeErrors(errors): void {
  if (!errors || !errors.length) {
    return
  }

  self._gatsbyEvents.push([
    `FAST_REFRESH`,
    {
      action: `SHOW_RUNTIME_ERRORS`,
      payload: errors,
    },
  ])
}

export function isWebpackCompileError(error): boolean {
  return (
    /Module [A-z ]+\(from/.test(error.message) ||
    /Cannot find module/.test(error.message)
  )
}

export function handleRuntimeError(error): void {
  if (error && !isWebpackCompileError(error)) {
    self._gatsbyEvents.push([
      `FAST_REFRESH`,
      {
        action: `HANDLE_RUNTIME_ERROR`,
        payload: [error],
      },
    ])
  }
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<title>jKit - jQuery based UI Toolkit - Demos</title>

	<meta name="description" content="A very easy to use, cross platform, jQuery based UI toolkit, that's still small in size, has the features you need, and doesn't get in your way of doing things!">

	<meta name="viewport" content="width=960, initial-scale=1, maximum-scale=1">
	<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

	<link rel="shortcut icon" type="image/x-icon" href="http://jquery-jkit.com/favicon.ico" />

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

jKit

A very easy to use, cross platform, jQuery based UI toolkit, that's still small in size, has the features you need, and doesn't get in your way of doing things!

Demos

Get the full demos and documentation over here: jquery-jkit.com

Binding

				Bind different things to other things. Only your imagination sets the limit.

<input type="text" id="bindingsource" value="test">

Body css.width:

		klfhdkljsfhg jdfjg dfjhg jfdhgs djhgjh dsfhg jdfhsgjk hfjkghs djkfhgkfldshjfgh dfskjhg kfdhgsk kjls v cb fsgbh g bf gb gfsh ff gh h ft h dfg hgfdh gfd h  hgf dh gf dh fgd df sd fa df as d f asd fdsafdsadfdfa  dfsafdsa f dfsa ffdsa fsd f ds f sd af dsf

		dhf kljdhgsjklfhglkfd shg ksl

		 fhjkldgh fdhgjlfdhs gdfhjg hfsdjhg jfdshg jfhdjls hgjh ghfdsjö hfk fg sdf g fd gs fg s f dfgsdg  dfgs fd g fds gdfsg fd s fgd sfgdfsgfds fgdsgfds

			klfhdkljsfhg jdfjg dfjhg jfdhgs djhgjh dsfhg jdfhsgjk hfjkghs djkfhgkfldshjfgh dfskjhg kfdhgsk kjls v cb fsgbh g bf gb gfsh ff gh h ft h dfg hgfdh gfd h  hgf dh gf dh fgd df sd fa df as d f asd fdsafdsadfdfa  dfsafdsa f dfsa ffdsa fsd f ds f sd af dsf

			dhf kljdhgsjklfhglkfd shg ksl

			 fhjkldgh fdhgjlfdhs gdfhjg hfsdjhg jfdshg jfhdjls hgjh ghfdsjö hfk fg sdf g fd gs fg s f dfgsdg  dfgs fd g fds gdfsg fd s fgd sfgdfsgfds fgdsgfds

Paragraph with content:

	dfsadf dsf sdf dsf dsafsdf sdaf dsf dsafsda

Paragraph without content:

	Click me!

0;if=1;else=0.2]">

Test the test test

Two testtest

Only one test

	reacting on viewport binding events

0;if=1;else=0.2]">
	viewport detecting box

Testlinks: test, example, whatever

	#test

	#example

Testlinks: test, example, whatever

	#test2

	#example2

Respond

				Add some lorem filltext to your site for testing.

	widget code

[ This box is at least 250 wide ]

[ This box is at least 500 wide ]

[ This box is at least 750 wide ]

Template

				Reduce repetition and load times of your page with our little templating engine.

		First entry:

		 ... 3rd entry ...

		 ... last entry.

Info Text

			Title: "Heading Text"

			Description:

			Text ...

List Entry 1

250 character jKit lorem

List Entry 2

350 character jKit lorem

List Entry 3

150 character jKit lorem

List Entry 4

2 paragraph jKit lorem

List Entry 5

Without text (removed paragraph) ...

Background

				Do you need an image that scales to the whole of the browser window, at all times? With or without distortion? Than this one's for you.

Lightbox

				Open images, or html documents in a lightbox or modal window.

Open image
Oversized image
Open square image
Open website (iFrame)
Modal dialog (iFrame)

Slideshow

				Create slideshows of images or other HTML elements, even linked ones.

First Headline

Another Headline

Even More of a Headline

Still not the last headline

The last headline

Gallery

				Create a tab navigation for inline content.

Tabs

				Create a tab navigation for inline content.

Tab 1

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.

Tab 2

At vero eos et accusam et justo duo dolores et ea rebum.

Tab 3

Duo dolores et ea rebum.

Some lorem text

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.

jKit Slideshow

A list

List Item 1

List Item 2

List Item 3

jKit Parallax

Background Layer

Middle Layer

Foreground Layer

Accordion

				Create an accordion style inline content navigation.

Title 1

			Text 1

Title 2

			Text 2

Title 3

			Text 3

Title 1

Title 2

Title 3

List Item 1

List Item 2

List Item 3

Title 1

Subtitle 1

Subsubtitle 1

									Subsubtext 1

Subsubtitle 2

									Subsubtext 2

Subtitle 2

						Subtext 2

Subtitle 3

						Subtext 3

Title 2

			Text 2

Title 3

			Text 3

Carousel

				Make content go around and around ... and around.

DIV 1 ...

DIV 2 ...

DIV 3 ...

DIV 4 ...

DIV 5 ...

DIV 6 ...

DIV 7 ...

Parallax

				This command lets you create a parallax effect of different layers triggered by mouse movement.

Background Layer

Middle Layer

Foreground Layer

Background Layer

Middle Layer

Foreground Layer

Background Layer

Middle Layer

Foreground Layer

Background Layer

Middle Layer

Foreground Layer

Background Layer

Middle Layer

Foreground Layer

Ticker

				Create a news ticker from a list of entries.

Ticker Text 1

Another one

The third ticker text

Even more text for the ticker

loading ...

Cycle

				Maske it easy to cycle through a sequence of different elements to style them differently.

List entry 1

List entry 2

List entry 3

		List entry 4

Sub entry 1

Sub entry 2

Sub entry 3

List entry 5

List entry 1

List entry 2

List entry 3

		List entry 4

Sub entry 1

Sub entry 2

Sub entry 3

List entry 5

List entry 1

List entry 2

List entry 3

		List entry 4

Sub entry 1

Sub entry 2

Sub entry 3

List entry 5

List entry 1

List entry 2

List entry 3

		List entry 4

Sub entry 1

Sub entry 2

Sub entry 3

List entry 5

This is some example text, it will look like a rainbow ... hopefully.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Animation

				Tween between different elements (frames) to create an animation.

	After four seconds ...

	On click ...

	On mouseenter and mouseleave ...

animation

made

easy

easy

really easy!

Zoom

				Zoom into an image on mouseover.

	So much detail, it's crazy! ;-)

Menu

				Create a dropdown menu that works on all browsers, especially mobiles.

Main 1

Sub 1A

Sub 1B

Sub 1C

Sub 1D

Main 2

Sub 2A

Sub 2B

Main 3

Sub 3A

Sub 3B

				Sub 3C

Sub 3C1

Sub 3C2

Main 1

Should be active

Sub 1B

Sub 1C

Sub 1D

Main 2

Sub 2A

Sub 2B

Main 3

Sub 3A

Sub 3B

				Sub 3C

Sub 3C1

Sub 3C2

Tooltip

				Show additional information on hovering a link.

Test Link
Test Link 2
Test Link with a class for styling

Content from a hidden div
Text from title attribute
Text from alt attribute
Follow the mouse

<input type="text" name="test" data-jkit="[tooltip:event=focus;text=Test Tooltip Text 7]">

Header

Paragraph

Paginate

				Lets you create paginated content.

			Name
			Location
			Birthday
			Category
			Status
			Superior
			Price (CHF)

Mr. Max Keller	CH-7278 Davos Monstein	1-29-1986	freelancer	active	#120	1.00

Ms. Sophia Roth	CH-3186 Düdingen	2-16-1955	freelancer	active	#120	25.25

Mr. Fredi Baumann	CH-6543 Arvigo	11-21-1993	freelancer	active		2.99

Ms. Hannah Zimmermann	LI-9493 Mauren	6-26-1967	freelancer	active	#1168	48.95

Ms. Maja Brunner	D-21207 Seevetal	10-22-1934	trainee	active	#120	200.10

Mr. Tom Fischer	LI-9492 Eschen	5-19-1955	freelancer	inactive	#1168	-5.05

Mr. Kon Fischer	LI-9492 Eschen	5-19-1955	freelancer	inactive	#1168	-5.05

Ms. Alina Gerber	D-21710 Engelschoff	10-15-1981	employee	active	#1168	10

Mr. Tim Gerber	CH-6543 Arvigo	12-8-1943	freelancer	active	#120	4721.45

Mr. Felix Meier	LI-9486 Schaanwald	8-26-1975	guest	active	#120	12.55

Mr. Fredi Müller	LI-9486 Schaanwald	10-24-1953	trainee	active	#120	354.50

Mr. Tim Gerber	CH-1773 Léchelles	12-25-1966	freelancer	active		42.85

Ms. Lilli Meyer	D-21207 Seevetal	11-29-1938	guest	active		87.41

Ms. Emilie Fischer	D-04299 Leipzig	11-7-1942	freelancer	active	#463	354.01

Mr. Fredi Graf	CH-6534 S. Vittore	12-7-1971	employee	active	#120	14.12

Ms. Cordelia Weber	CH-6543 Arvigo	2-23-1967	employee	active	#120	10.25

jh sdgjkgh fjdhsgdfjkhgfjkdhsg jhjksdgh fjkdhg jkfdshjkg jkfdh sgjkhfdjkshg fjhgjkfhdjsghjksh g

hdjh gjkdfhgj khfdjkgha jfhgkj gdsalhd f

j dsfjk hdjf gdshafg hdsgfa hjhdfg sdhjgfjh dsfahj ghdfg dsahgfhjsdfgh ab

j dhsfkajhdj fghjkdhg ajfhjghd sjhagjjkhgfjdh gjkhdfjkahgj

dh safhjkl hgfdjhasjdkghjhdajkhg jdfh gahjkd hsajghj fghadfjk hjgkh jkhg dfa

d skhafmh gjhdfjka ghjghjk dashjgjkhf adhfg jdhajk sg

d sfhajhdjfhjsda gjh jl

d shfjklh djkahfgjk dajksghjkghadsj jkgh jdashjk ghjksadg jgh ljhdjgks ad sjhaflkhf jkadghjh gjklhdgajhkjljksagl asdg

d dhjsfga hjgdsagads jdsha hfj hj salhfjd shakhfd jkahsd fjkdsagfjkgfdjhsagl fjhgsda l

jj sakdflh jkh djkhfjdsajhf jdsfhgdshfhjdfh jkhdsjd sfagjklg dfsjajdgjkgdsajkl jdas gljkds akl

dmh safhgjk dashjf kgjkfgd sajkgfjk sdjhgf lsdagjk gfjkdas gfg asd

jgajs fgjk

Sort

				Let visitors sort table rows by their columns.

			Name
			Location
			Birthday
			Category
			Status
			Superior
			Price (CHF)

Mr. Max Keller	CH-7278 Davos Monstein	1-29-1986	freelancer	active	#120	1.00

Ms. Sophia Roth	CH-3186 Düdingen	2-16-1955	freelancer	active	#120	25.25

Mr. Fredi Baumann	CH-6543 Arvigo	11-21-1993	freelancer	active		2.99

Ms. Hannah Zimmermann	LI-9493 Mauren	6-26-1967	freelancer	active	#1168	48.95

Ms. Maja Brunner	D-21207 Seevetal	10-22-1934	trainee	active	#120	200.10

Mr. Tom Fischer	LI-9492 Eschen	5-19-1955	freelancer	inactive	#1168	-5.05

Ms. Alina Gerber	D-21710 Engelschoff	10-15-1981	employee	active	#1168	10

Mr. Tim Gerber	CH-6543 Arvigo	12-8-1943	freelancer	active	#120	4721.45

Mr. Felix Meier	LI-9486 Schaanwald	8-26-1975	guest	active	#120	12.55

Mr. Fredi Müller	LI-9486 Schaanwald	10-24-1953	trainee	active	#120	354.50

Mr. Tim Gerber	CH-1773 Léchelles	12-25-1966	freelancer	active		42.85

Ms. Lilli Meyer	D-21207 Seevetal	11-29-1938	guest	active		87.41

Ms. Emilie Fischer	D-04299 Leipzig	11-7-1942	freelancer	active	#463	354.01

Mr. Fredi Graf	CH-6534 S. Vittore	12-7-1971	employee	active	#120	14.12

Ms. Cordelia Weber	CH-6543 Arvigo	2-23-1967	employee	active	#120	10.25

 tbody > tr;scope=all;sequence=#ddd,#fff][cycle:onevent=tablesort.complete;what=css.background;where=table > tbody > tr;scope=all;sequence=#ddd,#fff]">

				Name
				Location
				Birthday
				Category
				Status
				Superior
				Price (CHF)

Mr. Max Keller	CH-7278 Davos Monstein	1-29-1986	freelancer	active	#120	1.00

Ms. Sophia Roth	CH-3186 Düdingen	2-16-1955	freelancer	active	#120	25.25

Mr. Fredi Baumann	CH-6543 Arvigo	11-21-1993	freelancer	active		2.99

Ms. Hannah Zimmermann	LI-9493 Mauren	6-26-1967	freelancer	active	#1168	48.95

Ms. Maja Brunner	D-21207 Seevetal	10-22-1934	trainee	active	#120	200.10

Mr. Tom Fischer	LI-9492 Eschen	5-19-1955	freelancer	inactive	#1168	-5.05

Ms. Alina Gerber	D-21710 Engelschoff	10-15-1981	employee	active	#1168	10

Mr. Tim Gerber	CH-6543 Arvigo	12-8-1943	freelancer	active	#120	4721.45

Mr. Felix Meier	LI-9486 Schaanwald	8-26-1975	guest	active	#120	12.55

Mr. Fredi Müller	LI-9486 Schaanwald	10-24-1953	trainee	active	#120	354.50

Mr. Tim Gerber	CH-1773 Léchelles	12-25-1966	freelancer	active		42.85

Ms. Lilli Meyer	D-21207 Seevetal	11-29-1938	guest	active		87.41

Ms. Emilie Fischer	D-04299 Leipzig	11-7-1942	freelancer	active	#463	354.01

Mr. Fredi Graf	CH-6534 S. Vittore	12-7-1971	employee	active	#120	14.12

Ms. Cordelia Weber	CH-6543 Arvigo	2-23-1967	employee	active	#120	10.25

Filter

				Dynamically filter your content and only show what's currently needed

 li]">
	<select class="jkit-filter">
		<option value="">All</option>
		<option value="test1">test1</option>
		<option value="test2" selected>test2</option>
		<option value="test3">test3</option>
		<option value="test1 test2">test1 & test2</option>
	</select>
	<select class="jkit-filter">
		<option value="" selected>All</option>
		<option value="long">long</option>
	</select>
	<input type="text" class="jkit-filter" value="">

Entry 1 ... (test1)

Entry 2 ... (test2)

Entry 3 ... (test3)

Entry 4 ... (test2 long)

Entry 5 ... (test1 long)

Entry 6 ... (test3)

Entry 7 ... (test2)

Entry 8 ... (test1 test3)

Entry 9 ... (test1 test2)

Entry 10 ... (test99)

 tbody > tr]">
	Search: <input type="text" class="jkit-filter" value=""> (try searching for "Gerber")

				Name
				Location
				Birthday

Mr. Max Keller	CH-7278 Davos Monstein	1-29-1986

Ms. Sophia Roth	CH-3186 Düdingen	2-16-1955

Mr. Fredi Baumann	CH-6543 Arvigo	11-21-1993

Ms. Hannah Zimmermann	LI-9493 Mauren	6-26-1967

Ms. Maja Brunner	D-21207 Seevetal	10-22-1934

Mr. Tom Fischer	LI-9492 Eschen	5-19-1955

Ms. Alina Gerber	D-21710 Engelschoff	10-15-1981

Mr. Tim Gerber	CH-6543 Arvigo	12-8-1943

Mr. Felix Meier	LI-9486 Schaanwald	8-26-1975

Mr. Fredi Müller	LI-9486 Schaanwald	10-24-1953

Mr. Tim Gerber	CH-1773 Léchelles	12-25-1966

Ms. Lilli Meyer	D-21207 Seevetal	11-29-1938

Ms. Emilie Fischer	D-04299 Leipzig	11-7-1942

Mr. Fredi Graf	CH-6534 S. Vittore	12-7-1971

Ms. Cordelia Weber	CH-6543 Arvigo	2-23-1967

Form

				Create an ajax submitted form.

<form method="post" action="?" data-jkit="[form:validateonly=true]">

		Username:

		<input name="miniusername" id="miniusername" data-jkit="[validate:required=true;min=3;max=10;error=Please enter your username (3-10 characters)]">

		Password:

		<input name="minipassword" id="minipassword" type="password" data-jkit="[validate:required=true;strength=50;error=Please enter a secure password]">

		<input name="send" type="submit" value="Submit" />

</form>

Validate

				Validate form values in many different ways.

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Password: <input name="password" type="password" data-jkit="[validate:required=true;strength=50;error=Please enter a secure password]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Password: <input name="password" type="password" id="password" data-jkit="[validate:required=true;strength=50;error=Please enter a secure password]">

Repeat: <input name="passwordtest" type="password" data-jkit="[validate:required=true;same=#password;error=The two passwords don't match, please try again]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Tel. <input name="phone" data-jkit="[validate:type=phone;required=true;error=Please enter a valid phone number]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Email: <input name="email" data-jkit="[validate:type=email;required=true;error=Please enter a valid email address]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Homepage: <input name="homepage" data-jkit="[validate:type=url;error=This isn't a valid URL]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Image: <input name="avatar" type="file" data-jkit="[validate:type=extension;options=jpg,jpeg,gif;error=Please choose a valid image format]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">

		<input type="radio" id="group1_milk" name="group1" value="Milk"> Milk

		<input type="radio" id="group1_butter" name="group1" value="Butter"> Butter

		<input type="radio" id="group1_cheese" name="group1" value="Cheese"> Cheese

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">

		<input type="checkbox" id="group2_milk" name="group2_milk" value="Milk"> Milk

		<input type="checkbox" id="group2_butter" name="group2_butter" value="Butter"> Butter

		<input type="checkbox" id="group2_salt" name="group2_salt" value="Salt"> Salt

		<input type="checkbox" id="group2_cheese" name="group2_cheese" value="Cheese"> Cheese

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Date: <input name="mydate" data-jkit="[validate:type=date;required=true;error=Please add a valid date]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	Time: <input name="mytime" data-jkit="[validate:type=time;required=true;error=Please add a time]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	<input name="myint" data-jkit="[validate:type=int;min=1;required=true;error=Please add a valid positiv Integer above zero]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	<input name="myfloat" data-jkit="[validate:type=float;min=1;max=2.5;required=true;error=Please enter a float between 1 and 2.5]">

<input name="send" type="submit" value="Submit" />
</form>

<form method="post" action="?" data-jkit="[form:validateonly=true]">
	<input name="length" data-jkit="[validate:length=6;error=Please enter exactly six characters]">

<input name="send" type="submit" value="Submit" />
</form>

Ajax

				Easely convert normal href links into ajax links.

Link 1,
Link 2

	Initial text ...

Chart

				Create animated bar charts from tabular data.

			Year
			Jan.	Feb.	Mar.	Apr.	Mai	Jun.	Jul.	Aug.	Sep.	Okt.	Nov.	Dez.

			2011
			500	124	254	124	245	233	125	147	189	156	164	144

			2012
			214	124	127	452	421	12	127	189	145	123	741

Plugin

				Use a jQuery plugin the same way as your other jKit commands with the help of this command.

<input name="hint" id="hint" title="My Hint Text" data-jkit="[plugin:script=hint;hintClass=hint]">

<input name="tweet" id="tweet" data-jkit="[plugin:script=maxlength;maxCharacters=140]">

API

				Easely gather data from external API's.

Twitter count:

Facebook shares:

	Latest jKit commit:

				 by

				 by

				 by

loading ...

Scroll

				Smoothly scroll to an anchor or the top of the page.

To the top!
To the options anchor.   &nbsp
100 pixels above the options anchor.

Partially

				Hide part of an element that exceeds a specific size and make it unhidable.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Summary

				Create a summery, linked or not, of a content area

Test headline 1

Test headline 2

Test sub headline 1

Test headline 3

Test headline 4

Limit

				Limit the number of entries in a list or the number of characters in a string.

Entry 1

Entry 2

Entry 3

Entry 4

1234567890123456789012345678901234567890123456789

Hide

				Hide something at a specific time after pageload, and animated if needed.

Text ...

Remove

				Completely remove something from the page after a delay.

Text ...

Show

				Show something at a specific time after pageload, and animated if needed.

Text ...

Box 1

Box 2

Box 3

Box 4

Box 5

Box 6

Box 7

Box 8

Box 9

Box 10

Showandhide

				Show something and then hide it again. You have full control over the specifics.

Text ...

Loop

				The new blink tag, just animated. Use it on your own risk.

Text ...

Box 1

Box 2

Box 3

Box 4

Box 5

Box 6

Box 7

Box 8

Box 9

Box 10

Random

				Randomly choose one or more elements from a selection of elements.

		Text 1 (red)

		Text 2 (green)

		Text 3 (blue)

Encode

				A simple command to encode the content of an element, especially usefull for pre and code elements.

Encode

Encode

Encode

Encode

Encode

Split

				Split a string into DOM elements.

	Sun, Stars, Moon, Asteroid

Live

				Update the source of an image or an iframe periodically, great for webcam images.

Key

				Add keyboard shortcuts to links.

Move to the options with key combo "shift+up"

Open a website in a blank window with "alt+shift+o"

Open an onclick alert with "ctrl+shift+a"

Open an onclick alert with "f3"

Replace

				Replace existing content with new content, based on simple strings or regexes.

<div data-jkit="[replace:search=Fredi;replacement=Fredi Bach]">
	Hi, my name is Fredi. I'm a programmer. Fredi is also a designer.

	This product costs 123 dollars more than the other product that costs just 77 dollars.

Fontsize

				Let the user easely change the fontsize of certain elements.

<input type="button" value="bigger" data-jkit="[fontsize:steps=2;affected=#fs-example p]">
<input type="button" value="smaller" data-jkit="[fontsize:steps=-2;affected=#fs-example p]">

Some heading

Some text ...

Some more text ...

Swap

				Swap an image with an automatically preloaded replacement.

Lorem

				Add some lorem filltext to your site for testing.


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

namespace GAPPSF.Excel
{
    public class PropertyName
    {
        public const string STR_NAME = "Name";
        public const string STR_CODE = "Code";
        public const string STR_PUBLISHED = "Published";
        public const string STR_LAT = "Latitude";
        public const string STR_LON = "Longitude";
        public const string STR_COORDINATE = "Coordinate";
        public const string STR_YES = "Yes";
        public const string STR_NO = "No";
        public const string STR_AVAILABLE = "Available";
        public const string STR_ARCHIVED = "Archived";
        public const string STR_COUNTRY = "Country";
        public const string STR_STATE = "State";
        public const string STR_MUNICIPALITY = "Municipality";
        public const string STR_CITY = "City";
        public const string STR_TYPE = "Type";
        public const string STR_PLACEDBY = "Placed by";
        public const string STR_OWNER = "Owner";
        public const string STR_CONTAINER = "Container";
        public const string STR_TERRAIN = "Terrain";
        public const string STR_DIFFICULTY = "Difficulty";
        public const string STR_DESCRIPTIONTEXT = "DescriptionText";
        public const string STR_DESCRIPTIONHTML = "DescriptionHTML";
        public const string STR_URL = "Url";
        public const string STR_MEMBERONLY = "MemberOnly";
        public const string STR_CUSTOMLAT = "CustomLatitude";
        public const string STR_CUSTOMLON = "CustomLongitude";
        public const string STR_FAVORITES = "Favorites";
        public const string STR_PERSONALNOTES = "PersonalNotes";
        public const string STR_FLAGGED = "Flagged";
        public const string STR_FOUND = "Found";
        public const string STR_FOUNDDATE = "FoundDate";
        public const string STR_HINTS = "Hints";
        public const string STR_CUSTOMCOORD = "CustomCoord";
        public const string STR_AUTOCOORD = "AutoCoord";
        public const string STR_GCVOTE = "GCVote";
        public const string STR_RDX = "RDx";
        public const string STR_RDY = "RDy";
        public const string STR_ENVELOPEAREA_OTHER = "In region envelop - other";
        public const string STR_INAREA_OTHER = "In region - other";
        public const string STR_GLOBALCACHINGURL = "Globalcaching URL";
    }

    public class PropertyItemGlobalcachingUrl : PropertyItem
    {
        public PropertyItemGlobalcachingUrl()
            : base(PropertyName.STR_GLOBALCACHINGURL)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return string.Concat("http://www.globalcaching.eu/gmap/DefaultV3.aspx?wp={0}", gc.Code);
        }
    }

    public class PropertyItemEnvelopAreaOther : PropertyItem
    {
        public PropertyItemEnvelopAreaOther()
            : base(PropertyName.STR_ENVELOPEAREA_OTHER)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            StringBuilder result = new StringBuilder();
            List<Core.Data.AreaInfo> al = Shapefiles.ShapeFilesManager.Instance.GetEnvelopAreasOfLocation(new Core.Data.Location(gc.Lat, gc.Lon), Shapefiles.ShapeFilesManager.Instance.GetAreasByLevel(Core.Data.AreaType.Other));
            foreach (Core.Data.AreaInfo a in al)
            {
                result.AppendLine(a.Name);
            }
            return result.ToString();
        }
    }

    public class PropertyItemInAreaOther : PropertyItem
    {
        public PropertyItemInAreaOther()
            : base(PropertyName.STR_INAREA_OTHER)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            StringBuilder result = new StringBuilder();
            List<Core.Data.AreaInfo> al = Shapefiles.ShapeFilesManager.Instance.GetAreasOfLocation(new Core.Data.Location(gc.Lat, gc.Lon), Shapefiles.ShapeFilesManager.Instance.GetAreasByLevel(Core.Data.AreaType.Other));
            foreach (Core.Data.AreaInfo a in al)
            {
                result.AppendLine(a.Name);
            }
            return result.ToString();
        }
    }

    public class PropertyItemName : PropertyItem
    {
        public PropertyItemName()
            : base(PropertyName.STR_NAME)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Name;
        }
    }
    public class PropertyItemCode : PropertyItem
    {
        public PropertyItemCode()
            : base(PropertyName.STR_CODE)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Code;
        }
    }
    public class PropertyItemPublished : PropertyItem
    {
        public PropertyItemPublished()
            : base(PropertyName.STR_PUBLISHED)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.PublishedTime.ToString("d");
        }
    }
    public class PropertyItemLat : PropertyItem
    {
        public PropertyItemLat()
            : base(PropertyName.STR_LAT)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Lat.ToString();
        }
    }
    public class PropertyItemLon : PropertyItem
    {
        public PropertyItemLon()
            : base(PropertyName.STR_LON)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Lon.ToString();
        }
    }
    public class PropertyItemRDx : PropertyItem
    {
        public PropertyItemRDx()
            : base(PropertyName.STR_RDX)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            double x, y;
            if (Utils.Calculus.RDFromLatLong(gc.Lat, gc.Lon, out x, out y))
            {
                return x.ToString();
            }
            else
            {
                return "";
            }
        }
    }
    public class PropertyItemRDy : PropertyItem
    {
        public PropertyItemRDy()
            : base(PropertyName.STR_RDY)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            double x, y;
            if (Utils.Calculus.RDFromLatLong(gc.Lat, gc.Lon, out x, out y))
            {
                return y.ToString();
            }
            else
            {
                return "";
            }
        }
    }
    public class PropertyItemCoordinate : PropertyItem
    {
        public PropertyItemCoordinate()
            : base(PropertyName.STR_COORDINATE)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return Utils.Conversion.GetCoordinatesPresentation(gc.Lat, gc.Lon);
        }
    }
    public class PropertyItemAvailable : PropertyItem
    {
        public PropertyItemAvailable()
            : base(PropertyName.STR_AVAILABLE)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Available ? Localization.TranslationManager.Instance.Translate(PropertyName.STR_YES) as string : Localization.TranslationManager.Instance.Translate(PropertyName.STR_NO) as string;
        }
    }
    public class PropertyItemArchived : PropertyItem
    {
        public PropertyItemArchived()
            : base(PropertyName.STR_ARCHIVED)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Archived ? Localization.TranslationManager.Instance.Translate(PropertyName.STR_YES) as string : Localization.TranslationManager.Instance.Translate(PropertyName.STR_NO) as string;
        }
    }
    public class PropertyItemCountry : PropertyItem
    {
        public PropertyItemCountry()
            : base(PropertyName.STR_COUNTRY)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Country ?? "";
        }
    }
    public class PropertyItemState : PropertyItem
    {
        public PropertyItemState()
            : base(PropertyName.STR_STATE)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.State ?? "";
        }
    }
    public class PropertyItemMunicipality : PropertyItem
    {
        public PropertyItemMunicipality()
            : base(PropertyName.STR_MUNICIPALITY)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Municipality ?? "";
        }
    }
    public class PropertyItemCity : PropertyItem
    {
        public PropertyItemCity()
            : base(PropertyName.STR_CITY)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.City ?? "";
        }
    }
    public class PropertyItemType : PropertyItem
    {
        public PropertyItemType()
            : base(PropertyName.STR_TYPE)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return Localization.TranslationManager.Instance.Translate(gc.GeocacheType.Name) as string;
        }
    }
    public class PropertyItemPlacedBy : PropertyItem
    {
        public PropertyItemPlacedBy()
            : base(PropertyName.STR_PLACEDBY)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.PlacedBy ?? "";
        }
    }
    public class PropertyItemOwner : PropertyItem
    {
        public PropertyItemOwner()
            : base(PropertyName.STR_OWNER)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Owner ?? "";
        }
    }
    public class PropertyItemContainer : PropertyItem
    {
        public PropertyItemContainer()
            : base(PropertyName.STR_CONTAINER)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return Localization.TranslationManager.Instance.Translate(gc.Container.Name) as string;
        }
    }
    public class PropertyItemTerrain : PropertyItem
    {
        public PropertyItemTerrain()
            : base(PropertyName.STR_TERRAIN)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Terrain.ToString("0.#");
        }
    }
    public class PropertyItemDifficulty : PropertyItem
    {
        public PropertyItemDifficulty()
            : base(PropertyName.STR_DIFFICULTY)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Difficulty.ToString("0.#");
        }
    }
    public class PropertyItemDescriptionText : PropertyItem
    {
        public PropertyItemDescriptionText()
            : base(PropertyName.STR_DESCRIPTIONTEXT)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            StringBuilder sb = new StringBuilder();
            if (!string.IsNullOrEmpty(gc.ShortDescription))
            {
                if (gc.ShortDescriptionInHtml)
                {
                    sb.AppendLine(Utils.Conversion.StripHtmlTags(gc.ShortDescription));
                }
                else
                {
                    sb.AppendLine(gc.ShortDescription);
                }
            }
            if (!string.IsNullOrEmpty(gc.LongDescription))
            {
                if (gc.LongDescriptionInHtml)
                {
                    sb.AppendLine(Utils.Conversion.StripHtmlTags(gc.LongDescription));
                }
                else
                {
                    sb.AppendLine(gc.LongDescription);
                }
            }
            return sb.ToString();
        }
    }
    public class PropertyItemDescriptionHTML : PropertyItem
    {
        public PropertyItemDescriptionHTML()
            : base(PropertyName.STR_DESCRIPTIONHTML)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            StringBuilder sb = new StringBuilder();
            if (!string.IsNullOrEmpty(gc.ShortDescription))
            {
                if (!gc.ShortDescriptionInHtml)
                {
                    string s = gc.ShortDescription.Replace("\r\n", "cvcvcvcvcvc");
                    s = System.Web.HttpUtility.HtmlEncode(s);
                    s = s.Replace("cvcvcvcvcvc", "
");
                    sb.AppendLine(s);
                }
                else
                {
                    sb.AppendLine(gc.ShortDescription);
                }
                sb.AppendLine("
");
            }
            if (!string.IsNullOrEmpty(gc.LongDescription))
            {
                if (!gc.LongDescriptionInHtml)
                {
                    string s = gc.LongDescription.Replace("\r\n", "cvcvcvcvcvc");
                    s = System.Web.HttpUtility.HtmlEncode(s);
                    s = s.Replace("cvcvcvcvcvc", "
");
                    sb.AppendLine(s);
                }
                else
                {
                    sb.AppendLine(gc.LongDescription);
                }
            }
            return sb.ToString();
        }
    }
    public class PropertyItemUrl : PropertyItem
    {
        public PropertyItemUrl()
            : base(PropertyName.STR_URL)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Url ?? "";
        }
    }
    public class PropertyItemMemberOnly : PropertyItem
    {
        public PropertyItemMemberOnly()
            : base(PropertyName.STR_MEMBERONLY)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.MemberOnly ? Localization.TranslationManager.Instance.Translate(PropertyName.STR_YES) as string : Localization.TranslationManager.Instance.Translate(PropertyName.STR_NO) as string;
        }
    }
    public class PropertyItemCustomLat : PropertyItem
    {
        public PropertyItemCustomLat()
            : base(PropertyName.STR_CUSTOMLAT)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.ContainsCustomLatLon ? ((double)gc.CustomLat).ToString() : "";
        }
    }
    public class PropertyItemCustomLon : PropertyItem
    {
        public PropertyItemCustomLon()
            : base(PropertyName.STR_CUSTOMLON)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.ContainsCustomLatLon ? ((double)gc.CustomLon).ToString() : "";
        }
    }
    public class PropertyItemCustomCoordinate : PropertyItem
    {
        public PropertyItemCustomCoordinate()
            : base(PropertyName.STR_CUSTOMCOORD)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.ContainsCustomLatLon ? Utils.Conversion.GetCoordinatesPresentation((double)gc.CustomLat, (double)gc.CustomLon) : "";
        }
    }
    public class PropertyItemAutoCoordinate : PropertyItem
    {
        public PropertyItemAutoCoordinate()
            : base(PropertyName.STR_AUTOCOORD)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.ContainsCustomLatLon ? Utils.Conversion.GetCoordinatesPresentation((double)gc.CustomLat, (double)gc.CustomLon) : Utils.Conversion.GetCoordinatesPresentation(gc.Lat, gc.Lon);
        }
    }

    public class PropertyItemFavorites : PropertyItem
    {
        public PropertyItemFavorites()
            : base(PropertyName.STR_FAVORITES)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Favorites;
        }
    }
    public class PropertyItemPersonalNotes : PropertyItem
    {
        public PropertyItemPersonalNotes()
            : base(PropertyName.STR_PERSONALNOTES)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.PersonalNote ?? "";
        }
    }
    public class PropertyItemHints : PropertyItem
    {
        public PropertyItemHints()
            : base(PropertyName.STR_HINTS)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.EncodedHints ?? "";
        }
    }
    public class PropertyItemFlagged : PropertyItem
    {
        public PropertyItemFlagged()
            : base(PropertyName.STR_FLAGGED)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Flagged ? Localization.TranslationManager.Instance.Translate(PropertyName.STR_YES) as string : Localization.TranslationManager.Instance.Translate(PropertyName.STR_NO) as string;
        }
    }
    public class PropertyItemFound : PropertyItem
    {
        public PropertyItemFound()
            : base(PropertyName.STR_FOUND)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.Found ? Localization.TranslationManager.Instance.Translate(PropertyName.STR_YES) as string : Localization.TranslationManager.Instance.Translate(PropertyName.STR_NO) as string;
        }
    }
    public class PropertyItemFoundDate : PropertyItem
    {
        public PropertyItemFoundDate()
            : base(PropertyName.STR_FOUNDDATE)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            return gc.FoundDate == null ? "" : ((DateTime)gc.FoundDate).ToString("d");
        }
    }
    /*
    public class PropertyItemGCVote : PropertyItem
    {
        public PropertyItemGCVote()
            : base(PropertyName.STR_GCVOTE)
        {
        }
        public override object GetValue(Core.Data.Geocache gc)
        {
            string gcvote = gc.GetCustomAttribute("GCVote") as string;
            return gcvote ?? "";
        }
    }
    */
}


text:
<?php

namespace Namshi\JOSE;

use InvalidArgumentException;
use Namshi\JOSE\Base64\Base64Encoder;
use Namshi\JOSE\Base64\Base64UrlSafeEncoder;
use Namshi\JOSE\Signer\SignerInterface;
use Namshi\JOSE\Base64\Encoder;

/**
 * Class representing a JSOn Web Signature.
 */
class JWS extends JWT
{
    protected $signature;
    protected $isSigned = false;
    protected $encodedSignature;

    /**
     * Constructor
     *
     * @param string $algorithm
     * @param string $type
     */
    public function __construct($algorithm, $type = null)
    {
        parent::__construct(array(), array('alg' => $algorithm, 'typ' => $type ?: "JWS"));
    }

    /**
     * Signs the JWS signininput.
     *
     * @param  resource $key
     * @return string
     */
    public function sign($key)
    {
        $this->signature = $this->getSigner()->sign($this->generateSigninInput(), $key);
        $this->isSigned  = true;

        return $this->signature;
    }

    /**
     * Returns the signature representation of the JWS.
     *
     * @return string
     */
    public function getSignature()
    {
        if ($this->isSigned()) {
            return $this->signature;
        }

        return null;
    }

    /**
     * Checks whether the JSW has already been signed.
     *
     * @return bool
     */
    public function isSigned()
    {
        return (bool) $this->isSigned;
    }

    /**
     * Returns the string representing the JWT.
     *
     * @return string
     */
    public function getTokenString()
    {
        $signinInput = $this->generateSigninInput();

        return sprintf("%s.%s", $signinInput, $this->encoder->encode($this->getSignature()));
    }

    /**
     * Creates an instance of a JWS from a JWT.
     *
     * @param string $jwsTokenString
     * @return JWS
     * @throws \InvalidArgumentException
     */
    public static function load($jwsTokenString, $allowUnsecure = false, Encoder $encoder = null)
    {
        if ($encoder === null) {
            $encoder = strpbrk($jwsTokenString, '+/=') ? new Base64Encoder() : new Base64UrlSafeEncoder();
        }

        $parts = explode('.', $jwsTokenString);

        if (count($parts) === 3) {
            $header  = json_decode($encoder->decode($parts[0]), true);
            $payload = json_decode($encoder->decode($parts[1]), true);

            if (is_array($header) && is_array($payload)) {
                if (strtolower($header['alg']) === 'none' && !$allowUnsecure) {
                    throw new InvalidArgumentException(sprintf('The token "%s" cannot be validated in a secure context, as it uses the unallowed "none" algorithm', $jwsTokenString));
                }

                $jws = new self($header['alg'], isset($header['typ']) ? $header['typ'] : null);

                $jws->setEncoder($encoder)
                    ->setHeader($header)
                    ->setPayload($payload)
                    ->setEncodedSignature($parts[2]);

                return $jws;
            }
        }

        throw new InvalidArgumentException(sprintf('The token "%s" is an invalid JWS', $jwsTokenString));
    }

    /**
     * Verifies that the internal signin input corresponds to the encoded
     * signature previously stored (@see JWS::load).
     *
     * @param resource|string $key
     * @param string $algo The algorithms this JWS should be signed with. Use it if you want to restrict which algorithms you want to allow to be validated.
     * @return bool
     */
    public function verify($key, $algo = null)
    {
        if (empty($key) || ($algo && $this->header['alg'] !== $algo)) {
            return false;
        }

        $decodedSignature = $this->encoder->decode($this->getEncodedSignature());
        $signinInput      = $this->generateSigninInput();

        return $this->getSigner()->verify($key, $decodedSignature, $signinInput);
    }

    /**
     * Checks that the JWS has been signed with a valid private key by verifying it with a public $key
     * and the token is not expired.
     *
     * @param resource|string $key
     * @param string $algo The algorithms this JWS should be signed with. Use it if you want to restrict which algorithms you want to allow to be validated.
     *
     * @return bool
     */
    public function isValid($key, $algo = null)
    {
        return $this->verify($key, $algo) && ! $this->isExpired();
    }

    /**
     * Returns the base64 encoded signature.
     *
     * @return string
     */
    public function getEncodedSignature()
    {
        return $this->encodedSignature;
    }

    /**
     * Sets the base64 encoded signature.
     *
     * @param  string $encodedSignature
     * @return JWS
     */
    public function setEncodedSignature($encodedSignature)
    {
        $this->encodedSignature = $encodedSignature;

        return $this;
    }

    /**
     * Returns the signer responsible to encrypting / decrypting this JWS.
     *
     * @return SignerInterface
     * @throws \InvalidArgumentException
     */
    protected function getSigner()
    {
        $signerClass = sprintf("Namshi\\JOSE\\Signer\\%s", $this->header['alg']);

        if (class_exists($signerClass)) {
            return new $signerClass();
        }

        throw new InvalidArgumentException(sprintf("The algorithm '%s' is not supported", $this->header['alg']));
    }

    /**
     * Checks whether the token is expired.
     *
     * @return bool
     */
    protected function isExpired()
    {
        $payload = $this->getPayload();

        if (isset($payload['exp']) && is_numeric($payload['exp'])) {
            $now = new \DateTime('now');

            return ($now->format('U') - $payload['exp']) > 0;
        }

        return false;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:weightSum="1">

        <RelativeLayout
            android:layout_width="fill_parent"
            android:orientation="vertical"
            android:layout_height="0dp"
            android:layout_weight="0.15"
            android:background="@color/dark_lvl1" >

            <ImageView
                android:layout_width="fill_parent"
                android:layout_height="80dp"
                android:id="@+id/imageView12"
                android:scaleType="fitXY"
                android:adjustViewBounds="true"
                android:src="@drawable/flyfirefly_logo_plain" />

            <ImageView
                android:layout_width="fill_parent"
                android:layout_height="80dp"
                android:id="@+id/imageView13"
                android:layout_centerVertical="true"
                android:padding="10dp"
                android:scaleType="centerInside"
                android:adjustViewBounds="true"
                android:src="@drawable/flyfirefly_logo_text" />
        </RelativeLayout>

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:layout_weight="0.85"
            android:background="@drawable/grey_with_white_gradient">

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:paddingLeft="10dp"
                android:paddingTop="5dp"
                android:paddingRight="10dp">

                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:padding="5dp"
                    android:layout_marginBottom="5dp"
                    android:background="@drawable/shape_stroke">

                    <LinearLayout
                        android:orientation="vertical"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:layout_gravity="right"
                        android:background="@color/black">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:text="@string/book_flight"
                            android:id="@+id/txt_loginpssword"
                            android:gravity="center"
                            android:textSize="@dimen/font21sp"
                            android:textColor="@color/white"
                            android:textStyle="bold"/>

                    </LinearLayout>

                    <LinearLayout
                        android:orientation="vertical"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginTop="1dp">

                        <ImageView
                            android:layout_width="fill_parent"
                            android:layout_height="40dp"
                            android:scaleType="fitXY"
                            android:adjustViewBounds="true"
                            android:src="@drawable/flight_detail_header"/>
                    </LinearLayout>

                    <LinearLayout
                        android:orientation="vertical"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                        <LinearLayout
                            android:orientation="vertical"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:background="@color/actionBarColour_default_theme"
                            android:padding="3dp">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="SUBANG - PENANG"
                                android:textSize="19dp"
                                android:textColor="@color/white"
                                android:id="@+id/txtPort"
                                android:textStyle="bold"
                                android:layout_marginBottom="1dp"/>

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="(Going Flight)"
                                android:textColor="@color/white"
                                android:id="@+id/textView33"
                                android:textStyle="bold"
                                android:layout_marginBottom="1dp"/>

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="22 JAN 2015"
                                android:textSize="20dp"
                                android:textStyle="bold"
                                android:textColor="@color/white"/>
                        </LinearLayout>

                        <com.fly.firefly.utils.ExpandAbleGridView
                            android:id="@+id/flightDeparture"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:columnWidth="220dp"
                            android:gravity="center"
                            android:horizontalSpacing="1dp"
                            android:numColumns="1"
                            android:stretchMode="columnWidth"
                            android:verticalSpacing="1dp">
                        </com.fly.firefly.utils.ExpandAbleGridView>

                        <LinearLayout
                            android:orientation="vertical"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:background="@color/actionBarColour_default_theme"
                            android:padding="3dp">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="PENANG - SUBANG"
                                android:textSize="19dp"
                                android:textColor="@color/white"
                                android:textStyle="bold"
                                android:layout_marginBottom="1dp"/>

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="(Return Flight)"
                                android:textColor="@color/white"
                                android:textStyle="bold"
                                android:layout_marginBottom="1dp"/>

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="22 JAN 2015"
                                android:textSize="20dp"
                                android:textStyle="bold"
                                android:textColor="@color/white"
                                android:id="@+id/textView34" />
                        </LinearLayout>

                        <com.fly.firefly.utils.ExpandAbleGridView
                            android:id="@+id/flightArrival"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:columnWidth="220dp"
                            android:gravity="center"
                            android:horizontalSpacing="1dp"
                            android:numColumns="1"
                            android:stretchMode="columnWidth"
                            android:verticalSpacing="1dp">
                        </com.fly.firefly.utils.ExpandAbleGridView>
                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:weightSum="1"
                    android:gravity="center">

                    <Button
                        android:layout_width="0dp"
                        android:layout_weight="0.5"
                        android:layout_height="wrap_content"
                        android:text="Back"
                        android:layout_marginRight="15dp"/>

                    <Button
                        android:layout_width="0dp"
                        android:layout_weight="0.5"
                        android:layout_height="wrap_content"
                        android:text="Next"
                        android:id="@+id/btnPersonalDetail"/>
                </LinearLayout>

            </LinearLayout>

        </LinearLayout>
    </LinearLayout>

</ScrollView>


text:
using Eventing.Client.Http;
using Eventing.Core.Serialization;
using Newtonsoft.Json;
using System;
using System.IO;
using System.Threading.Tasks;

namespace Eventing.OfflineClient.EntityFramework.Tests
{
    public class EntityFramworkPendingMessageQueueSpec
    {
        protected EntityFramworkPendingMessageQueue repository;
        protected OfflineClientBase outbox;
        protected TestableHttpClient http;
        protected Func<bool, PendingMessageQueueDbContext> contextFactory;

        public EntityFramworkPendingMessageQueueSpec()
        {
            this.contextFactory = readOnly => new PendingMessageQueueDbContext(readOnly, "TestDb");
            this.http = new TestableHttpClient();
            this.repository = new EntityFramworkPendingMessageQueue(this.contextFactory);
            this.outbox = new OfflineClientBase(this.http, new NewtonsoftJsonSerializer(TypeNameHandling.None), this.repository);
        }
    }

    public class TestableHttpClient : IHttpLite
    {
        private bool isOffline;

        public void SetOffline()
        {
            this.isOffline = true;
        }

        public int TryToSendCount { get; private set; } = 0;

        public async Task<TResult> Post<TContent, TResult>(string uri, TContent content, string token = null)
        {
            this.TryToSendCount++;
            if (this.isOffline)
            {
                throw new ServiceUnavailableException();
            }
            return await Task.FromResult<TResult>(default(TResult));
        }

        public async Task Post<TContent>(string uri, TContent content, string token = null)
        {
            await this.TryPost();
        }

        public async Task Post(string uri, string jsonContent, string token = null)
        {
            await this.TryPost();
        }

        private async Task TryPost()
        {
            this.TryToSendCount++;
            if (this.isOffline)
            {
                throw new ServiceUnavailableException();
            }
            await Task.Delay(0);
        }

        #region Unused Here
        public Task<Stream> Get(string uri, string token = null)
        {
            return Task.FromResult<Stream>(null);
        }

        public Task<TResult> Get<TResult>(string uri, string token = null)
        {
            return Task.FromResult<TResult>(default(TResult));
        }

        public Task<TResult> Post<TResult>(string uri, string jsonContent, string token = null)
        {
            return Task.FromResult<TResult>(default(TResult));
        }

        public Task Upload(string uri, Stream fileStream, string fileName, string metadatos, string token = null)
        {
            return Task.CompletedTask;
        }

        public Task<TResult> Upload<TResult>(string uri, Stream fileStream, string fileName, string metadatos, string token = null)
        {
            return Task.FromResult<TResult>(default(TResult));
        }
        #endregion
    }
}


text:
package ml.combust.mleap.xgboost.runtime

import biz.k11i.xgboost.Predictor
import ml.combust.mleap.core.types._
import ml.combust.mleap.runtime.frame.{DefaultLeapFrame, Transformer}
import ml.combust.mleap.tensor.SparseTensor
import ml.combust.mleap.xgboost.runtime.testing.{BoosterUtils, BundleSerializationUtils, CachedDatasetUtils, ClassifierUtils, FloatingPointApproximations}
import ml.dmlc.xgboost4j.scala.Booster
import org.apache.spark.ml.linalg.Vectors
import org.scalatest.FunSpec
import XgbConverters._

class XGBoostPredictorClassificationModelParitySpec extends FunSpec
  with BoosterUtils
  with CachedDatasetUtils
  with BundleSerializationUtils
  with FloatingPointApproximations {

  def equalityTestRowByRowMultinomialProbability(
                                       booster: Booster,
                                       mleapTransformer: Transformer,
                                       leapFrameDataset: DefaultLeapFrame) = {

    val featuresColumnIndex = leapFrameDataset.schema.indexOf("features").get

    leapFrameDataset.dataset.foreach {
      r =>
        val mleapResult = mleapTransformer.transform(DefaultLeapFrame(leapFrameDataset.schema, Seq(r))).get
        val mleapProbabilityColIndex = mleapResult.schema.indexOf("probability").get

        val singleRowDMatrix = r(featuresColumnIndex).asInstanceOf[SparseTensor[Double]].asXGB
        val boosterResult = booster.predict(singleRowDMatrix, false, 0).head
        val boosterProbability = Vectors.dense(boosterResult.map(_.toDouble)).toDense

        assert(
          almostEqualSequences(
            Seq(boosterProbability.values),
            Seq(mleapResult.dataset.head.getTensor[Double](mleapProbabilityColIndex).toArray)
          )
        )
    }
  }

  /**
    * A Predictor only provides a probability column for performance reasons
    */
  def probabilityColumnEqualityTest(mleapFrame1: DefaultLeapFrame, mleapFrame2: DefaultLeapFrame) = {
    val probabilityFrame1 = mleapFrame1.select("probability").get
    val probabilityFrame2 = mleapFrame2.select("probability").get

    val probabilityIndex = probabilityFrame1.schema.indexOf("probability").get

    probabilityFrame1.dataset zip probabilityFrame2.dataset foreach {
      case (row1, row2) => {
        assert(
          almostEqualSequences(
            Seq(row1.getTensor[Double](probabilityIndex).toArray),
            Seq(row2.getTensor[Double](probabilityIndex).toArray)))
      }
    }
  }

  it("We can deserialize an xgboost object into a Predictor by changing the MLeapOp") {
    val deserializedPredictor: XGBoostPredictorClassification = ClassifierUtils.deserializedXGBoostPredictor.asInstanceOf[XGBoostPredictorClassification]
    assert(deserializedPredictor.model.impl.predictor.isInstanceOf[Predictor])
  }

  it("A pre-serialization XGBoost4j model has the same results of a deserialized Predictor model") {
    val preSerializationXGBoost4jResult = ClassifierUtils.mleapTransformer.transform(leapFrameBinomial).get
    val predictorModelResult = ClassifierUtils.deserializedXGBoostPredictor.transform(leapFrameBinomial).get
    probabilityColumnEqualityTest(preSerializationXGBoost4jResult, predictorModelResult)
  }

  it("A deserialized XGBoost4j has the same results of a deserialized Predictor"){
    val deserializedXGBoost4jResult = ClassifierUtils.deserializedmleapTransformer.transform(leapFrameBinomial).get
    val deserializedPredictorResult = ClassifierUtils.deserializedXGBoostPredictor.transform(leapFrameBinomial).get
    probabilityColumnEqualityTest(deserializedPredictorResult, deserializedXGBoost4jResult)
  }

  it("Predictor has the correct inputs and an output probability column") {
    val numFeatures = ClassifierUtils.deserializedXGBoostPredictor.asInstanceOf[XGBoostPredictorClassification].model.numFeatures
    assert(ClassifierUtils.deserializedXGBoostPredictor.schema.fields ==
      Seq(StructField("features", TensorType(BasicType.Double, Seq(numFeatures))),
        StructField("probability", TensorType(BasicType.Double, Seq(2)))))
  }

  it("[Multinomial] An XGBoost4j Booster has the same results as a deserialized Predictor"){
    equalityTestRowByRowMultinomialProbability(ClassifierUtils.multinomialBooster, ClassifierUtils.deserializedMultinomialXGBoostPredictor, leapFrameMultinomial)
  }

  it("[Multinomial] XGBoostPredictorMultinomialClassificationModel results are the same pre and post serialization") {
    val xgboost4jResult = ClassifierUtils.multinomialMleapTransformer.transform(leapFrameMultinomial).get
    val predictorResult = ClassifierUtils.deserializedMultinomialXGBoostPredictor.transform(leapFrameMultinomial).get
    probabilityColumnEqualityTest(xgboost4jResult, predictorResult)
  }

  it("XGBoost4j and Predictor results are the same when using a dense dataset") {
    val denseLeapFrame = toDenseFeaturesLeapFrame(leapFrameBinomial)
    val xgboost4jResult = ClassifierUtils.mleapTransformer.transform(denseLeapFrame).get
    val predictorResult = ClassifierUtils.deserializedXGBoostPredictor.transform(denseLeapFrame).get
    probabilityColumnEqualityTest(xgboost4jResult, predictorResult)
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WebTemplate.Controllers
{
    public class SubmitBTRController : Controller
    {
        // GET: SubmitBTR
        public ActionResult Index()
        {
            return View();
        }
    }
}


text:
..
 This work is licensed under a Creative Commons Attribution 3.0 Unported
 License.

 http://creativecommons.org/licenses/by/3.0/legalcode

================================================================
Support Linux on System z (S/390) as a hypervisor platform
================================================================

https://blueprints.launchpad.net/cinder/+spec/linux-systemz

There are some platform-specific changes needed in order to allow Cinder
manage FCP-based block storage on Linux on System z.

Additional OpenStack functionality beyond initial Cinder support is not part of
this blueprint; we will have specific additional blueprints for that, as
needed.

Required support in Nova is described by a separate blueprint which is listed
as a dependency below.

iSCSI does not require any changes.

Problem description
===================

Linux on System z differs from other Linux platforms in the following
respects:

* System z uses a different format for device file paths (ccw-based, rather
  than pci-based)

* Auto-discovery for fibre-channel devices can be configured online, or
  offline. In case auto-discovery is turned off, devices need to be
  added, and removed explicitly by OpenStack (unit_add, unit_remove)

* vHBAs may be turned online, or offline. Offline vHBAs need to be
  ignored.

Use Cases
=========

Proposed change
===============

Change code in Cinder to address these issues, dependent on the host
capabilities indicating a CPU architecture of ``arch.S390X``, and
``arch.S390``.
For details, see section `Work Items`_.

Alternatives
------------

None

Data model impact
-----------------

None

REST API impact
---------------

None

Security impact
---------------

None

Notifications impact
--------------------

None

Other end user impact
---------------------

None

Performance Impact
------------------

None

Other deployer impact
---------------------

None (no need for platform-specific parameters in cinder.conf as part of this
blueprint)

Developer impact
----------------

None (changes should not affect other platforms)

Implementation
==============

Assignee(s)
-----------

Primary assignee:
  stefan-amann

Other contributors:
  mzoeller
  maiera

Work Items
----------

In ``cinder/brick/initiator/connector.py``:

* connect_volume needs to support the System z specific format of the
  device file paths and issue the unit_add command (which is done
  by calling the new configure_scsi_device() function)

  ::

    if platform.machine() == 's390x':
        target_lun = "0x00%02d000000000000" %
                     int(connection_properties.get('target_lun', 0))
        host_device = ("/dev/disk/by-path/ccw-%s-zfcp-%s:%s" %
                      (pci_num,
                       target_wwn,
                       target_lun))
        self._linuxfc.configure_scsi_device(pci_num, target_wwn, target_lun)
    else :
        host_device = ("/dev/disk/by-path/pci-%s-fc-%s-lun-%s" %
                      (pci_num,
                       target_wwn,
                       connection_properties.get('target_lun', 0)))
    host_devices.append(host_device)

* disconnect_volume needs to support the System z specific format of the
  device file paths and issue the unit_remove command (which is done by
  calling the new deconfigre_scsi_device() function)

  ::

    for device in devices:
        self._linuxscsi.remove_scsi_device(device["device"])
    if platform.machine() == 's390x':
        ports = connection_properties['target_wwn']
        wwns = []
        # we support a list of wwns or a single wwn
        if isinstance(ports, list):
            for wwn in ports:
                wwns.append(str(wwn))
        elif isinstance(ports, basestring):
            wwns.append(str(ports))
        hbas = self._linuxfc.get_fc_hbas_info()
        for hba in hbas:
            pci_num = self._get_pci_num(hba)
            if pci_num is not None:
                for wwn in wwns:
                    target_wwn = "0x%s" % wwn.lower()
                    target_lun = "0x00%02d000000000000"
                        % int(connection_properties.get('target_lun', 0))
                    host_device = ("/dev/disk/by-path/ccw-%s-zfcp-%s:%s" %
                                  (pci_num,
                                   target_wwn,
                                   target_lun))
                    self._linuxfc.deconfigure_scsi_device(
                                   pci_num,
                                   target_wwn,
                                   target_lun)

In ``cinder/brick/initiator/linuxfc.py``:

* Utility functions to execute the unit_add, or unit_remove command.

  ::

    def configure_scsi_device(self, device_number, target_wwn, lun):
        out = None
        err = None
        zfcp_device_command = ("/sys/bus/ccw/drivers/zfcp/%s/%s/unit_add" %
                                (device_number,
                                 target_wwn))
        try:
            self.echo_scsi_command(zfcp_device_command, lun)
        except putils.ProcessExecutionError as exc:
            LOG.warn(_("zKVM unit_add call failed exit (
                                   %(code)s), stderr (%(stderr)s)")
                     % {'code': exc.exit_code, 'stderr': exc.stderr})

    def deconfigure_scsi_device(self, device_number, target_wwn, lun):
        out = None
        err = None
        zfcp_device_command = ("/sys/bus/ccw/drivers/zfcp/%s/%s/unit_remove" %
                                (device_number,
                                 target_wwn))
        try:
            self.echo_scsi_command(zfcp_device_command, lun)
        except putils.ProcessExecutionError as exc:
            LOG.warn(_("zKVM unit_remove call failed
                        exit (%(code)s), stderr (%(stderr)s)")
                     % {'code': exc.exit_code, 'stderr': exc.stderr})

* Have get_fc_hbas_info() only return enabled vHBAs for System z.

  ::

    hbas_info = []
        for hba in hbas:
            if (platform.machine() != 's390x')
                or (hba['port_state'] == 'Online'):
                    ...same as today

Dependencies
============

Nova blueprint to add support for KVM/libvirt in Linux on System z
https://blueprints.launchpad.net/nova/+spec/libvirt-kvm-systemz

Testing
=======

Unit test:

* Unit tests will be added and performed on System z, as well as
  Intel-based machines.
* We will provide an environment for CI testing on System z.
  This is described by the Nova blueprint which is listed as a dependency.
  We will test Cinder and Nova on System z in this environment.

Documentation Impact
====================

* No changes needed in config docs.

* Doc changes for the platform will be made as needed (details are to be
  determined).

References
==========

* Linux on System z Device Driver book,
  http://public.dhe.ibm.com/software/dw/linux390/docu/l316dd25.pdf

* Linux on System z,
  http://www.ibm.com/developerworks/linux/linux390/


text:
using namespace std;

namespace mtconnect {
  using namespace entity;
  namespace device_model {
    using namespace data_item;

    // Component public methods
    Component::Component(const std::string &name, const entity::Properties &props)
      : Entity(name, props)
    {
      m_id = get<string>("id");
      m_name = maybeGet<string>("name");
      m_uuid = maybeGet<string>("uuid");
    }

    void Component::connectDataItems()
    {
      auto items = getList("DataItems");
      if (items)
      {
        for (auto &item : *items)
          dynamic_pointer_cast<data_item::DataItem>(item)->setComponent(getptr());
      }
    }

    void Component::connectCompositions()
    {
      auto comps = getList("Compositions");
      if (comps)
      {
        for (auto &comp : *comps)
          dynamic_pointer_cast<Composition>(comp)->setComponent(getptr());
      }
    }

    void Component::buildDeviceMaps(DevicePtr device)
    {
      device->registerComponent(getptr());
      auto items = getList("DataItems");
      if (items)
      {
        for (auto &item : *items)
        {
          auto di = dynamic_pointer_cast<data_item::DataItem>(item);
          device->registerDataItem(di);
          di->makeTopic();
        }
      }

      auto children = getChildren();
      if (children)
      {
        for (auto &child : *children)
        {
          auto cp = dynamic_pointer_cast<Component>(child);
          cp->setParent(getptr());
          cp->setDevice(device);
          cp->buildDeviceMaps(device);
        }
      }
    }

    FactoryPtr Component::getFactory()
    {
      static FactoryPtr factory;
      if (!factory)
      {
        auto dataItems = DataItem::getFactory();
        auto compositions = Composition::getFactory();
        auto configuration = configuration::Configuration::getFactory();
        auto description = Description::getFactory();
        auto references = Reference::getFactory();
        factory = make_shared<Factory>(
            Requirements {// Attributes
                          {"id", true},
                          {"name", false},
                          {"nativeName", false},
                          {"sampleRate", DOUBLE, false},
                          {"sampleInterval", DOUBLE, false},
                          {"uuid", false},
                          {"Description", ENTITY, description, false},
                          {"DataItems", ENTITY_LIST, dataItems, false},
                          {"Compositions", ENTITY_LIST, compositions, false},
                          {"References", ENTITY_LIST, references, false},
                          {"Configuration", ENTITY, configuration, false}},
            [](const std::string &name, Properties &props) -> EntityPtr {
              auto ptr = make_shared<Component>(name, props);
              ptr->initialize();
              return dynamic_pointer_cast<Entity>(ptr);
            });
        factory->setOrder(
            {"Description", "Configuration", "DataItems", "Compositions", "References"});
        auto component = make_shared<Factory>(
            Requirements {{"Component", ENTITY, factory, 1, Requirement::Infinite}});
        component->registerFactory(regex(".+"), factory);
        component->registerMatchers();
        factory->addRequirements(Requirements {{"Components", ENTITY_LIST, component, false}});
      }
      return factory;
    }

    Component::~Component() {}

    void Component::resolveReferences(DevicePtr device)
    {
      auto references = getList("References");
      if (references)
      {
        for (auto &reference : *references)
        {
          dynamic_pointer_cast<Reference>(reference)->resolve(device);
        }
      }
      auto children = getChildren();
      if (children)
      {
        for (const auto &child : *children)
          dynamic_pointer_cast<Component>(child)->resolveReferences(device);
      }
    }

    void Component::addDataItem(DataItemPtr dataItem, entity::ErrorList &errors)
    {
      if (addToList("DataItems", Component::getFactory(), dataItem, errors))
      {
        dataItem->setComponent(getptr());
        auto device = getDevice();
        if (device)
          device->registerDataItem(dataItem);
      }
    }
  }  // namespace device_model
}  // namespace mtconnect


text:
layout: default
title: DevOps consulting in Copenhagen
image: images/1500x500.jpg
link: /devops-consulting-in-copenhagen
permalink: /devops-consulting-in-copenhagen
excerpt: I've been consulting for the past four years. In this post I write down every thought I have around it. Read it if you are contemplating consulting, need practical advice on how to start, or if you are interested how I experienced this period.
published: false

---

## Freelance DevOps consulting in Copenhagen

{{ page.date | date: "%Y-%m-%d" }}

I've been consulting for the past four years. In this post I write down every thought I have about it.

Read it if you are contemplating consulting, need practical advice on how to start, or if you are interested how I experienced this period.

### Getting the first gig

Getting the first gig, or any gig, is what people are the most anxious about in freelance consulting.

I've spent ten years in employment before I made the change, and naturally this should have been my main concern starting out. Going from a fixed monthly income to something uncertain should surely freak out people - or their moms at least.

But this was not the case for me. Partly because I successfully deceipt my brain with the mantra, that worst case, I can always get a job, but for the most part, I started out with a financial cushion. I started out in Octber 2016, with a money enough that I should not need to start job hunting until April 2017.

So here was I with a relative peace of mind, started out with researching container technologies, writing blog posts about it.
, and searching for my first gig. This peace of mind lasted for little over a month, besides content marketing I tried with direct outreach on email, LinkedIn and Twitter.


text:
<?php

namespace Http;

class Router
{
    /** @var RouteRule[] */
    private $ruleList = array();
    /** @var RouteRule[][] */
    private $routeIndex = array();
    /** @var RouteRule[][] */
    private $patternIndex = array();

    /**
     * @static
     * @param array $config
     * <code>
     *  array(
     *      array('<controler:(foo|bar)>', '<controller>/index'),
     *      ...
     *  )
     * </code>
     * @return Router
     */
    public static function fromArray(array $config)
    {
        $router = new self;
        foreach($config as $routeParams) {
            $router->addRouteRule(new RouteRule($routeParams[1], $routeParams[0]));
        }
        return $router;
    }

    /**
     * @param RouteRule[] $routeRuleList
     */
    public function setRouteRuleList(array $routeRuleList)
    {
        $this->ruleList = array();
        $this->routeIndex = array();
        $this->patternIndex = array();
        foreach($routeRuleList as $routeRule) {
            $this->addRouteRule($routeRule);
        }
    }

    /**
     * @param RouteRule $rule
     */
    public function addRouteRule(RouteRule $rule)
    {
        $this->ruleList[] = $rule;
        $this->routeIndex[$rule->getRoute()][] = $rule;
        $this->patternIndex[$rule->getPattern()][] = $rule;
    }

    /**
     * Parses a URL based on this rule.
     * @param string $path
     * @return null|string the route that consists of the controller ID and action ID or null
     * @throws RouterException on error found route rule
     */
    public function matchUrl($path)
    {
        $path = '/' . trim($path, '/'); // add root path delimiter
        if(isset($this->patternIndex[$path])) {
            /** @var $routeRule RouteRule */
            foreach($this->patternIndex[$path] as $routeRule) {
                if($route = $routeRule->matchUrl($path)) {
                    return $route;
                }
            }
        }
        foreach($this->ruleList as $routeRule) {
            if($route = $routeRule->matchUrl($path)) {
                return $route;
            }
        }
        throw new RouterException("Unable to resolve the request \"$path\"", 404);
    }

    /**
     * Constructs a URL.
     * @param string $route the controller and the action (e.g. article/read)
     * @param array $params list of GET parameters (name=>value). Both the name and value will be URL-encoded.
     * If the name is '#', the corresponding value will be treated as an anchor
     * and will be appended at the end of the URL.
     * @return string the constructed URL
     * @throws RouterException on error found route rule
     */
    public function createUrl($route, array $params = array())
    {
        if(isset($params['#'])) {
            $anchor = '#' . $params['#'];
            unset($params['#']);
        } else {
            $anchor = '';
        }
        $route = trim($route, '/');
        /** @var $routeRule RouteRule */
        if(isset($this->routeIndex[$route])) {
            foreach($this->routeIndex[$route] as $routeRule) {
                if($url = $routeRule->createUrl($route, $params)) {
                    return $url . $anchor;
                }
            }
        }
        foreach($this->ruleList as $routeRule) {
            if($url = $routeRule->createUrl($route, $params)) {
                return $url . $anchor;
            }
        }
        throw new RouterException("Unable to resolve the route \"$route\"", 404);
    }
}


text:
package org.eclipse.collections.api.bimap;

import org.eclipse.collections.api.bag.ImmutableBagIterable;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.predicate.Predicate;
import org.eclipse.collections.api.block.predicate.Predicate2;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.map.ImmutableMapIterable;
import org.eclipse.collections.api.multimap.set.ImmutableSetMultimap;
import org.eclipse.collections.api.ordered.OrderedIterable;
import org.eclipse.collections.api.partition.set.PartitionImmutableSet;
import org.eclipse.collections.api.set.ImmutableSet;
import org.eclipse.collections.api.tuple.Pair;

/**
 * A {@link BiMap} whose contents cannot be altered after initialization.
 *
 * @since 4.2
 */
public interface ImmutableBiMap<K, V> extends BiMap<K, V>, ImmutableMapIterable<K, V>
{
    @Override
    ImmutableBiMap<K, V> newWithKeyValue(K key, V value);

    @Override
    ImmutableBiMap<K, V> newWithAllKeyValues(Iterable<? extends Pair<? extends K, ? extends V>> keyValues);

    @Override
    ImmutableBiMap<K, V> newWithAllKeyValueArguments(Pair<? extends K, ? extends V>... keyValuePairs);

    @Override
    ImmutableBiMap<K, V> newWithoutKey(K key);

    @Override
    ImmutableBiMap<K, V> newWithoutAllKeys(Iterable<? extends K> keys);

    @Override
    ImmutableBiMap<V, K> inverse();

    @Override
    ImmutableSetMultimap<V, K> flip();

    @Override
    ImmutableBiMap<V, K> flipUniqueValues();

    @Override
    ImmutableBiMap<K, V> tap(Procedure<? super V> procedure);

    @Override
    ImmutableBiMap<K, V> select(Predicate2<? super K, ? super V> predicate);

    @Override
    ImmutableBiMap<K, V> reject(Predicate2<? super K, ? super V> predicate);

    @Override
    <K2, V2> ImmutableBiMap<K2, V2> collect(Function2<? super K, ? super V, Pair<K2, V2>> function);

    @Override
    <R> ImmutableBiMap<K, R> collectValues(Function2<? super K, ? super V, ? extends R> function);

    @Override
    ImmutableSet<V> select(Predicate<? super V> predicate);

    @Override
    <P> ImmutableSet<V> selectWith(Predicate2<? super V, ? super P> predicate, P parameter);

    @Override
    ImmutableSet<V> reject(Predicate<? super V> predicate);

    @Override
    <P> ImmutableSet<V> rejectWith(Predicate2<? super V, ? super P> predicate, P parameter);

    @Override
    PartitionImmutableSet<V> partition(Predicate<? super V> predicate);

    @Override
    <P> PartitionImmutableSet<V> partitionWith(Predicate2<? super V, ? super P> predicate, P parameter);

    @Override
    <S> ImmutableSet<S> selectInstancesOf(Class<S> clazz);

    @Override
    <V1> ImmutableBagIterable<V1> collect(Function<? super V, ? extends V1> function);

    @Override
    <P, V1> ImmutableBagIterable<V1> collectWith(Function2<? super V, ? super P, ? extends V1> function, P parameter);

    @Override
    <V1> ImmutableBagIterable<V1> collectIf(Predicate<? super V> predicate, Function<? super V, ? extends V1> function);

    @Override
    <V1> ImmutableBagIterable<V1> flatCollect(Function<? super V, ? extends Iterable<V1>> function);

    @Override
    <V1> ImmutableSetMultimap<V1, V> groupBy(Function<? super V, ? extends V1> function);

    @Override
    <V1> ImmutableSetMultimap<V1, V> groupByEach(Function<? super V, ? extends Iterable<V1>> function);

    @Override
    <VV> ImmutableBiMap<VV, V> groupByUniqueKey(Function<? super V, ? extends VV> function);

    /**
     * @deprecated in 8.0. Use {@link OrderedIterable#zip(Iterable)} instead.
     */
    @Override
    @Deprecated
    <S> ImmutableSet<Pair<V, S>> zip(Iterable<S> that);

    /**
     * @deprecated in 8.0. Use {@link OrderedIterable#zipWithIndex()} instead.
     */
    @Override
    @Deprecated
    ImmutableSet<Pair<V, Integer>> zipWithIndex();
}


text:
{% extends 'admin/base.html' %}

{% block access_control %}
{% if current_user.is_authenticated %}

         {{ current_user.login }}

    Log out

{% endif %}
{% endblock %}


text:
import { NgModule } from '@angular/core';

import { NgbdSharedModule } from '../../shared';
import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
import { NgbdApiPage } from '../shared/api-page/api.component';
import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
import { NgbdAlertBasic } from './demos/basic/alert-basic';
import { NgbdAlertCloseable } from './demos/closeable/alert-closeable';
import { NgbdAlertConfig } from './demos/config/alert-config';
import { NgbdAlertCustom } from './demos/custom/alert-custom';
import { NgbdAlertSelfclosing } from './demos/selfclosing/alert-selfclosing';

const DEMO_DIRECTIVES = [NgbdAlertBasic, NgbdAlertCloseable, NgbdAlertSelfclosing, NgbdAlertCustom, NgbdAlertConfig];

const DEMOS = {
  basic: {
    title: 'Basic Alert',
    type: NgbdAlertBasic,
    code: require('!!raw-loader!./demos/basic/alert-basic'),
    markup: require('!!raw-loader!./demos/basic/alert-basic.html')
  },
  closeable: {
    title: 'Closable Alert',
    type: NgbdAlertCloseable,
    code: require('!!raw-loader!./demos/closeable/alert-closeable'),
    markup: require('!!raw-loader!./demos/closeable/alert-closeable.html')
  },
  selfclosing: {
    title: 'Self closing alert',
    type: NgbdAlertSelfclosing,
    code: require('!!raw-loader!./demos/selfclosing/alert-selfclosing'),
    markup: require('!!raw-loader!./demos/selfclosing/alert-selfclosing.html')
  },
  custom: {
    title: 'Custom alert',
    type: NgbdAlertCustom,
    code: require('!!raw-loader!./demos/custom/alert-custom'),
    markup: require('!!raw-loader!./demos/custom/alert-custom.html')
  },
  config: {
    title: 'Global configuration of alerts',
    type: NgbdAlertConfig,
    code: require('!!raw-loader!./demos/config/alert-config'),
    markup: require('!!raw-loader!./demos/config/alert-config.html')
  }
};

export const ROUTES = [
  { path: '', pathMatch: 'full', redirectTo: 'examples' },
  { path: '',
    component: ComponentWrapper,
    children: [
      { path: 'examples', component: NgbdExamplesPage },
      { path: 'api', component: NgbdApiPage }
    ]
  }
];

@NgModule({
  imports: [NgbdSharedModule, NgbdComponentsSharedModule ],
  declarations: DEMO_DIRECTIVES,
  entryComponents: DEMO_DIRECTIVES
})
export class NgbdAlertModule {
  constructor(demoList: NgbdDemoList) {
    demoList.register('alert', DEMOS);
  }
}


text:
module Halfs.HalfsState
  (
    HalfsState(..)
  )
  where

import Data.Map as M
import Data.Word

import Halfs.BlockMap            (BlockMap)
import Halfs.Errors              (HalfsError)
import Halfs.Monad               (HalfsT)
import Halfs.Protection          (UserID, GroupID)
import Halfs.SuperBlock          (SuperBlock)
import Halfs.Types               (DirHandle, FileHandle, InodeRef, LockedRscRef)

import System.Device.BlockDevice (BlockDevice)

type HalfsM b r l m a = HalfsT HalfsError (Maybe (HalfsState b r l m)) m a
type FHMapVal b r l m = (FileHandle r l, Word64, HalfsM b r l m ())

data HalfsState b r l m = HalfsState {
    hsBlockDev         :: BlockDevice m
  , hsUserID           :: UserID
  , hsGroupID          :: GroupID
  , hsLogger           :: Maybe (String -> m ())
  , hsSizes            :: (Word64, Word64, Word64, Word64)
    -- ^ explicitly memoized Inode.computeSizes
  , hsBlockMap         :: BlockMap b r l
  , hsSuperBlock       :: r SuperBlock
  , hsLock             :: l
  , hsNumFileNodes     :: LockedRscRef l r Word64
  , hsDHMap            :: LockedRscRef l r (M.Map InodeRef (DirHandle r l))
    -- ^ Tracks active directory handles; we probably want to add a
    -- (refcounting?) expiry mechanism so that the size of the map is
    -- bounded.  TODO.
  , hsFHMap            :: LockedRscRef l r (M.Map InodeRef (FHMapVal b r l m))
    -- ^ Tracks active file handles, their open counts, and an
    -- on-final-close hook.  This last monadic action is executed
    -- whenever the open count becomes 0 (we do this because, e.g.,
    -- unlinking files can cause deferred resource allocation for
    -- currently-open files).

  , hsInodeLockMap     :: LockedRscRef l r (M.Map InodeRef (l, Word64))
    -- ^ Tracks refcnt'd inode locks. For now, these are single reader/writer
    -- locks.
  }