text:
<?php $TRANSLATIONS = array(
"Contacts" => "Contacte",
"Save" => "Salvează",
"Uploading..." => "Încărcare",
"Importing..." => "a importa",
"Imported {imported} contacts. {failed} failed." => "contactele importate . esuat.",
"An address book called {name} already exists" => "numele exista deja in agenda",
"Failed adding address book: {error}" => "adaugarea agendei a esuat",
"Failed loading address books: {error}" => "adaugarea agendei a esuat.eroare",
"Indexing contacts" => "indexarea contactelor",
"Unrecoverable error loading address books: {msg}" => "agenda este irecuperabila.mesaj",
"Error." => "eroare",
"Add to..." => "adaugat in...",
"Remove from..." => "eliminat din...",
"Add group..." => "adaoga grup",
"Invalid URL: \"{url}\"" => "URL invalid.localizator uniform de resurse",
"There was an error opening a mail composer." => "s-a inregistrat o eroare in deschiderea adresei",
"Invalid email: \"{url}\"" => "email invalid",
"Cancel" => "Anulare",
"OK" => "OK",
"Add" => "Adaugă",
"Import" => "Importă",
"Close" => "Închide",
"Error" => "Eroare",
"Show CardDav link" => "Arată legătură CardDav",
"Download" => "Descarcă",
"Edit" => "Editează",
"Delete" => "Șterge",
"More..." => "Mai multe...",
"{name}'s Birthday" => "Ziua de naștere a {name}",
"Error saving contact." => "eroare in salvarea contactului",
"Information about vCard is incorrect. Please reload the page." => "Informațiile cărții de vizită sunt incorecte. Te rog reîncarcă pagina.",
"No file was uploaded. Unknown error" => "Nici un fișier nu a fost încărcat. Eroare necunoscută",
"There is no error, the file uploaded with success" => "Nu a apărut nici o eroare, fișierul a fost încărcat cu succes",
"The uploaded file exceeds the upload_max_filesize directive in php.ini" => "Fișierul are o dimensiune mai mare decât cea specificată în variabila upload_max_filesize din php.ini",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Fișierul are o dimensiune mai mare decât variabile MAX_FILE_SIZE specificată în formularul HTML",
"The uploaded file was only partially uploaded" => "Fișierul a fost încărcat doar parțial",
"No file was uploaded" => "Nu a fost încărcat nici un fișier",
"Missing a temporary folder" => "Lipsește un director temporar",
"Couldn't load temporary image: " => "nu se poate incarca imaginea temporara",
"Couldn't save temporary image: " => "Nu s-a putut salva imaginea temporară",
"No photo path was submitted." => "Nici o adresă către fotografie nu a fost transmisă",
"File doesn't exist:" => "Fișierul nu există:",
"Error loading image." => "Eroare la încărcarea imaginii.",
"Error creating temporary image" => "eroare la alegerea imaginii temporare",
"Error cropping image" => "eroare la alegerea imaginii",
"Error resizing image" => "eroare la redimensionarea imaginii",
"Error getting PHOTO property." => "eroare in gasirea proprietatilor fotografiei",
"Failed to write to disk" => "Eroare la scriere pe disc",
"Not enough storage available" => "Nu este suficient spațiu disponibil",
"Error uploading contacts to storage." => "Eroare la ",
"Could not set preference: " => "nu se pot seta preferinte",
"Contact" => "Contact",
"Other" => "Altele",
"Work" => "Servicu",
"Home" => "Acasă",
"Mobile" => "Mobil",
"Text" => "Text",
"Voice" => "Voce",
"Message" => "Mesaj",
"Fax" => "Fax",
"Video" => "Video",
"Pager" => "Pager",
"Internet" => "Internet",
"Groups" => "Grupuri",
"Keyboard shortcuts" => "Scurtături din tastatură",
"Navigation" => "Navigare",
"Next contact in list" => "Următorul contact din listă",
"Previous contact in list" => "Contactul anterior din listă",
"Actions" => "Acțiuni",
"Add new contact" => "Adaugă contact nou",
"Delete current contact" => "Șterge contactul curent",
"Add contact" => "Adaugă contact",
"Delete current photo" => "Șterge poza curentă",
"Edit current photo" => "Editează poza curentă",
"Upload new photo" => "Încarcă poză nouă",
"Select photo from ownCloud" => "Selectează poză din ownCloud",
"Name" => "Nume",
"Nickname" => "Pseudonim",
"Enter nickname" => "Introdu pseudonim",
"Title" => "Titlu",
"Organization" => "Organizație",
"Birthday" => "Zi de naștere",
"Phone" => "Telefon",
"Email" => "Email",
"Address" => "Adresă",
"Note" => "Notă",
"Web site" => "Site web",
"Delete contact" => "Șterge contact",
"Preferred" => "Preferat",
"Please specify a valid email address." => "Te rog să specifici un e-mail corect",
"Mail to address" => "Trimite mesaj la e-mail",
"Delete email address" => "Șterge e-mail",
"Enter phone number" => "Specifică numărul de telefon",
"Delete phone number" => "Șterge numărul de telefon",
"Go to web site" => "Vizitează site-ul",
"View on map" => "Vezi pe hartă",
"Street address" => "Adresa",
"Postal code" => "Codul poștal",
"City" => "Oraș",
"Country" => "Țară",
"Active" => "Activ",
"Share" => "Partajează",
"Export" => "Exportă",
"more info" => "mai multe informații",
"Primary address (Kontact et al)" => "Adresa primară (Kontact et al)",
"iOS/OS X" => "iOS/OS X",
"Addressbooks" => "Agende",
"New Address Book" => "Agendă nouă",
"Description" => "Descriere"
);


text:
package org.apache.camel.processor.intercept;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Test;

public class DualInterceptSimpleRouteTest extends ContextTestSupport {

    @Test
    public void testDualIntercept() throws Exception {
        getMockEndpoint("mock:foo").expectedMessageCount(1);
        getMockEndpoint("mock:bar").expectedMessageCount(1);
        getMockEndpoint("mock:result").expectedMessageCount(1);

        getMockEndpoint("mock:intercepted").expectedMessageCount(6);
        getMockEndpoint("mock:a").expectedMessageCount(3);
        getMockEndpoint("mock:b").expectedMessageCount(3);

        template.sendBody("direct:start", "Hello World");

        // TODO: Using multiple intercept should be avoided
        // assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                context.setTracing(true);

                // it should generally be avoid to have dual interceptors as its a bit confusing
                // but you can do it anyway
                intercept().to("mock:intercepted");

                intercept().to("mock:a").to("mock:b");

                from("direct:start")
                    .to("mock:foo").to("mock:bar").to("mock:result");
            }
        };
    }
}

redpajama_set_name: RedPajamaGithub


text:
const { registerSuite } = intern.getInterface('object');
const { assert } = intern.getPlugin('chai');
import {
	ThemedMixin,
	theme,
	ThemedProperties,
	INJECTED_THEME_KEY,
	registerThemeInjector
} from '../../../src/mixins/Themed';
import { Injector } from './../../../src/Injector';
import { WidgetBase } from '../../../src/WidgetBase';
import { Registry } from '../../../src/Registry';
import { v } from '../../../src/d';
import { stub, SinonStub } from 'sinon';

import * as baseThemeClasses1 from './../../support/styles/testWidget1.css';
import * as baseThemeClasses2 from './../../support/styles/testWidget2.css';
import * as baseThemeClasses3 from './../../support/styles/baseTheme3.css';
import * as extraClasses1 from './../../support/styles/extraClasses1.css';
import testTheme1 from './../../support/styles/theme1.css';
import testTheme2 from './../../support/styles/theme2.css';
import testTheme3 from './../../support/styles/theme3.css';

(baseThemeClasses1 as any)[' _key'] = 'testPath1';
(baseThemeClasses2 as any)[' _key'] = 'testPath2';
(baseThemeClasses3 as any)[' _key'] = 'testPath3';

let testRegistry: Registry;

@theme(baseThemeClasses1)
class TestWidget extends ThemedMixin(WidgetBase)<any> {}

@theme(baseThemeClasses2)
class SubClassTestWidget extends TestWidget {}

@theme(baseThemeClasses1)
@theme(baseThemeClasses2)
class StackedTestWidget extends ThemedMixin(WidgetBase)<ThemedProperties> {}

@theme(baseThemeClasses3)
@theme(baseThemeClasses1)
class DuplicateThemeClassWidget extends ThemedMixin(WidgetBase)<ThemedProperties> {}

@theme(baseThemeClasses3)
class ExtendedThemeClassWidget extends TestWidget {}

class NonDecoratorDuplicateThemeClassWidget extends ThemedMixin(WidgetBase)<ThemedProperties> {
	constructor() {
		super();
		theme(baseThemeClasses1)(this);
		theme(baseThemeClasses3)(this);
	}
}

let consoleStub: SinonStub;

registerSuite('ThemedMixin', {
	beforeEach() {
		testRegistry = new Registry();
		consoleStub = stub(console, 'warn');
	},
	afterEach() {
		consoleStub.restore();
	},
	tests: {
		'classes function': {
			'should return baseThemeClasses1 flagged classes via the classes function'() {
				const ThemedInstance = new TestWidget();
				const { class1, class2 } = baseThemeClasses1;
				const flaggedClasses = ThemedInstance.theme([class1, class2]);
				assert.deepEqual(flaggedClasses, [class1, class2]);
				assert.isFalse(consoleStub.called);
			},
			'should return negated classes for those that are not passed'() {
				const ThemedInstance = new TestWidget();
				const { class1 } = baseThemeClasses1;
				const flaggedClasses = ThemedInstance.theme(class1);
				assert.deepEqual(flaggedClasses, class1);
				assert.isFalse(consoleStub.called);
			},
			'should ignore any new classes that do not exist in the baseThemeClasses1 and show console error'() {
				const ThemedInstance = new TestWidget();
				const { class1 } = baseThemeClasses1;
				const newClassName = 'newClassName';
				const flaggedClasses = ThemedInstance.theme([class1, newClassName]);

				assert.deepEqual(flaggedClasses, [class1, null]);

				assert.isTrue(consoleStub.calledOnce);
				assert.strictEqual(consoleStub.firstCall.args[0], `Class name: '${newClassName}' not found in theme`);
			},
			'should split adjoined classes into multiple classes'() {
				const ThemedInstance = new TestWidget();
				ThemedInstance.__setProperties__({ theme: testTheme3 });
				const { class1, class2 } = baseThemeClasses1;
				const flaggedClasses = ThemedInstance.theme([class1, class2]);
				assert.deepEqual(flaggedClasses, ['testTheme3Class1 testTheme3AdjoinedClass1', class2]);
			},
			'should remove adjoined classes when they are no longer provided'() {
				const { class1, class2 } = baseThemeClasses1;
				const ThemedInstance = new TestWidget();
				ThemedInstance.__setProperties__({ theme: testTheme3 });
				let flaggedClasses = ThemedInstance.theme([class1, class2]);
				ThemedInstance.__setProperties__({ theme: testTheme1 });
				flaggedClasses = ThemedInstance.theme([class1, class2]);
				assert.deepEqual(flaggedClasses, [testTheme1.testPath1.class1, baseThemeClasses1.class2]);
			},
			'should return null and undefineds unprocessed'() {
				const ThemedInstance = new TestWidget();
				const { class1, class2 } = baseThemeClasses1;
				const flaggedClasses = ThemedInstance.theme([class1, null, class2, undefined]);
				assert.deepEqual(flaggedClasses, [class1, null, class2, undefined]);
				assert.isFalse(consoleStub.called);
			}
		},
		'setting a theme': {
			'should override base theme classes with theme classes'() {
				const ThemedInstance = new TestWidget();
				ThemedInstance.__setProperties__({ theme: testTheme1 });
				const { class1, class2 } = baseThemeClasses1;
				const flaggedClasses = ThemedInstance.theme([class1, class2]);
				assert.deepEqual(flaggedClasses, [testTheme1.testPath1.class1, baseThemeClasses1.class2]);
			},
			'should return new theme classes when the theme is updated'() {
				const { class1, class2 } = baseThemeClasses1;
				const ThemedInstance = new TestWidget();
				ThemedInstance.__setProperties__({ theme: testTheme1 });
				const themeClass = ThemedInstance.theme(class1);
				assert.deepEqual(themeClass, testTheme1.testPath1.class1);
				ThemedInstance.__setProperties__({ theme: testTheme2 });

				const themeClasses = ThemedInstance.theme([class1, class2]);
				assert.deepEqual(themeClasses, [testTheme2.testPath1.class1, baseThemeClasses1.class2]);
			}
		},
		'setting extra classes': {
			'should supplement base theme classes with extra classes'() {
				const ThemedInstance = new TestWidget();
				ThemedInstance.__setProperties__({ extraClasses: extraClasses1 });
				const { class1, class2 } = baseThemeClasses1;
				const flaggedClasses = ThemedInstance.theme([class1, class2]);
				assert.deepEqual(flaggedClasses, [
					`${extraClasses1.class1} ${baseThemeClasses1.class1}`,
					baseThemeClasses1.class2
				]);
			}
		},
		'setting base theme classes': {
			decorator: {
				'Themes get inherited from base classes and merged into the available classes'() {
					const { class1, class2 } = baseThemeClasses1;
					const { class3, class4 } = baseThemeClasses2;
					const ThemedInstance = new SubClassTestWidget();
					const flaggedClasses = ThemedInstance.theme([class1, class2, class3, class4]);
					assert.deepEqual(flaggedClasses, [class1, class2, class3, class4]);
				},
				'Stacked themes get merged into the available classes'() {
					const { class1, class2 } = baseThemeClasses1;
					const { class3, class4 } = baseThemeClasses2;
					const ThemedInstance = new StackedTestWidget();
					const flaggedClasses = ThemedInstance.theme([class1, class2, class3, class4]);
					assert.deepEqual(flaggedClasses, [class1, class2, class3, class4]);
				},
				'Can override classes'() {
					const { class1, class2 } = baseThemeClasses1;
					const { class1: duplicateClass1 } = baseThemeClasses3;
					const ThemedInstance = new DuplicateThemeClassWidget();
					const flaggedClasses = ThemedInstance.theme([class1, class2]);
					assert.deepEqual(flaggedClasses, [duplicateClass1, class2]);
				}
			},
			'non decorator': {
				'Themes get inherited from base classes and merged into the available classes'() {
					const { class1, class2 } = baseThemeClasses1;
					const { class3, class4 } = baseThemeClasses2;
					const ThemedInstance = new SubClassTestWidget();
					const flaggedClasses = ThemedInstance.theme([class1, class2, class3, class4]);
					assert.deepEqual(flaggedClasses, [class1, class2, class3, class4]);
				},
				'Stacked themes get merged into the available classes'() {
					const { class1, class2 } = baseThemeClasses1;
					const { class3, class4 } = baseThemeClasses2;
					const ThemedInstance = new StackedTestWidget();
					const flaggedClasses = ThemedInstance.theme([class1, class2, class3, class4]);
					assert.deepEqual(flaggedClasses, [class1, class2, class3, class4]);
				},
				'Can override classes'() {
					const { class1, class2 } = baseThemeClasses1;
					const { class1: duplicateClass1 } = baseThemeClasses3;
					const ThemedInstance = new NonDecoratorDuplicateThemeClassWidget();
					const flaggedClasses = ThemedInstance.theme([class1, class2]);
					assert.deepEqual(flaggedClasses, [duplicateClass1, class2]);
				}
			},
			extension() {
				const { class1, class2 } = baseThemeClasses1;
				const { class1: duplicateClass1 } = baseThemeClasses3;
				const ThemedInstance = new ExtendedThemeClassWidget();
				const flaggedClasses = ThemedInstance.theme([class1, class2]);
				assert.deepEqual(flaggedClasses, [duplicateClass1, class2]);
			}
		},
		'injecting a theme': {
			'theme can be injected by defining a ThemeInjector with registry'() {
				const injector = new Injector(testTheme1);
				testRegistry.defineInjector(INJECTED_THEME_KEY, injector);
				class InjectedTheme extends TestWidget {
					render() {
						return v('div', { classes: this.theme(baseThemeClasses1.class1) });
					}
				}
				const ThemedInstance = new InjectedTheme();
				ThemedInstance.__setCoreProperties__({ bind: ThemedInstance, baseRegistry: testRegistry });
				ThemedInstance.__setProperties__({});
				const renderResult: any = ThemedInstance.__render__();
				assert.deepEqual(renderResult.properties.classes, 'theme1Class1');
			},
			'theme will not be injected if a theme has been passed via a property'() {
				const injector = new Injector(testTheme1);
				testRegistry.defineInjector(INJECTED_THEME_KEY, injector);
				class InjectedTheme extends TestWidget {
					render() {
						return v('div', { classes: this.theme(baseThemeClasses1.class1) });
					}
				}
				const ThemedInstance = new InjectedTheme();
				ThemedInstance.__setCoreProperties__({ bind: ThemedInstance, baseRegistry: testRegistry });
				ThemedInstance.__setProperties__({ theme: testTheme2 });
				const renderResult: any = ThemedInstance.__render__();
				assert.deepEqual(renderResult.properties.classes, 'theme2Class1');
			},
			'does not attempt to inject if the ThemeInjector has not been defined in the registry'() {
				class InjectedTheme extends TestWidget {
					render() {
						return v('div', { classes: this.theme(baseThemeClasses1.class1) });
					}
				}
				const ThemedInstance = new InjectedTheme();
				const renderResult: any = ThemedInstance.__render__();
				assert.deepEqual(renderResult.properties.classes, 'baseClass1');
			},
			'setting the theme invalidates and the new theme is used'() {
				const themeInjectorContext = registerThemeInjector(testTheme1, testRegistry);
				class InjectedTheme extends TestWidget {
					render() {
						return v('div', { classes: this.theme(baseThemeClasses1.class1) });
					}
				}

				const testWidget = new InjectedTheme();
				testWidget.__setCoreProperties__({ bind: testWidget, baseRegistry: testRegistry });
				let renderResult: any = testWidget.__render__();
				assert.deepEqual(renderResult.properties.classes, baseThemeClasses1.class1);
				themeInjectorContext.set(testTheme2);
				testWidget.__setProperties__({});
				renderResult = testWidget.__render__();
				assert.deepEqual(renderResult.properties.classes, 'theme2Class1');
				themeInjectorContext.set(testTheme1);
				testWidget.__setProperties__({});
				renderResult = testWidget.__render__();
				assert.deepEqual(renderResult.properties.classes, 'theme1Class1');
				themeInjectorContext.set(testTheme1);
				testWidget.__setProperties__({ foo: 'bar' });
				renderResult = testWidget.__render__();
				assert.deepEqual(renderResult.properties.classes, 'theme1Class1');
			}
		},
		integration: {
			'should work as mixin to createWidgetBase'() {
				const fixedClassName = 'fixedClassName';

				class IntegrationTest extends TestWidget {
					constructor() {
						super();
					}

					render() {
						const { class1 } = baseThemeClasses1;
						return v('div', [v('div', { classes: [this.theme(class1), fixedClassName] })]);
					}
				}

				const ThemedWidget: any = new IntegrationTest();
				ThemedWidget.__setProperties__({ theme: testTheme1 });

				const result = ThemedWidget.__render__();
				assert.deepEqual(result.children![0].properties!.classes, [
					testTheme1.testPath1.class1,
					fixedClassName
				]);

				ThemedWidget.__setProperties__({ theme: testTheme2 });

				const result2 = ThemedWidget.__render__();
				assert.deepEqual(result2.children![0].properties!.classes, [
					testTheme2.testPath1.class1,
					fixedClassName
				]);
			}
		}
	}
});


text:
package org.blendee.sql;

/**
 * SELECT 文の PARTITION BY 句を表すクラスです。
 * @author 千葉 哲嗣
 */
public class PartitionByClause extends ListClause<PartitionByClause> {

	@SuppressWarnings("javadoc")
	public PartitionByClause(RuntimeId id) {
		super(id);
	}

	@Override
	protected PartitionByClause createNewInstance(RuntimeId id) {
		return new PartitionByClause(id);
	}

	@Override
	String getKeyword() {
		return hasElements() ? "PARTITION BY" : "";
	}
}


text:
package org.takes.rs;

import com.jcabi.matchers.XhtmlMatchers;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.io.IOUtils;
import org.cactoos.Text;
import org.cactoos.io.InputStreamOf;
import org.cactoos.text.Joined;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.EndsWith;
import org.takes.misc.StateAwareInputStream;

/**
 * Test case for {@link RsXslt}.
 * @since 0.1
 */
final class RsXsltTest {

    /**
     * Validate encoding.
     */
    @BeforeAll
    @SuppressWarnings("PMD.ProhibitPublicStaticMethods")
    public static void before() {
        Assumptions.assumeTrue(
            "UTF-8".equals(Charset.defaultCharset().name())
        );
    }

    @Test
    void convertsXmlToHtml() throws IOException {
        final Text xml = new Joined(
            " ",
            "<?xml-stylesheet href='/a.xsl' type='text/xsl'?>",
            "<page><data>ура</data></page>"
        );
        final Text xsl = new Joined(
            " ",
            ""
        );
        MatcherAssert.assertThat(
            IOUtils.toString(
                new RsXslt(
                    new RsText(new InputStreamOf(xml)),
                    (href, base) -> new StreamSource(new InputStreamOf(xsl))
                ).body(),
                StandardCharsets.UTF_8
            ),
            XhtmlMatchers.hasXPath("//xhtml:p[.='\u0443']")
        );
    }

    @Test
    void convertsXmlToPlainText() {
        final Text xml = new Joined(
            " ",
            "<?xml-stylesheet href='/x.xsl' type='text/xsl'?>",
            "
<name>Jeffrey</name>
"
        );
        final Text xsl = new Joined(
            " ",
            ""
        );
        MatcherAssert.assertThat(
            new RsPrint(
                new RsXslt(
                    new RsText(new InputStreamOf(xml)),
                    (href, base) -> new StreamSource(new InputStreamOf(xsl))
                )
            ),
            new EndsWith("Hey, Jeffrey!")
        );
    }

    @Test
    void closesDecoratedResponseInputStream() {
        final Text xml = new Joined(
            " ",
            "<?xml-stylesheet href='/b.xsl' type='text/xsl'?>",
            "<subject>World</subject>"
        );
        final Text xsl =
            new Joined(
                " ",
                ""
            );
        final StateAwareInputStream stream = new StateAwareInputStream(
            new InputStreamOf(xml)
        );
        MatcherAssert.assertThat(
            new RsPrint(
                new RsXslt(
                    new RsText(stream),
                    (href, base) -> new StreamSource(new InputStreamOf(xsl))
                )
            ),
            new EndsWith("Hello, World!")
        );
        MatcherAssert.assertThat(
            stream.isClosed(),
            Matchers.is(true)
        );
    }

    @Test
    void resolvesInClasspath() {
        MatcherAssert.assertThat(
            new RsPrint(
                new RsXslt(
                    new RsText(
                        new InputStreamOf(
                            new Joined(
                                " ",
                                "<?xml-stylesheet",
                                " href='/org/takes/rs/simple.xsl?0'",
                                " type='text/xsl'?>",
                                "
<name>Bobby</name>
"
                            )
                        )
                    )
                )
            ),
            new EndsWith("Hello, Bobby!")
        );
        MatcherAssert.assertThat(
            new RsPrint(
                new RsXslt(
                    new RsText(
                        new InputStreamOf(
                            new Joined(
                                " ",
                                "<?xml-stylesheet ",
                                " href='/org/takes/rs/simple.xsl'",
                                " type='text/xsl' ?>",
                                "
<name>Dan</name>
"
                            )
                        )
                    )
                )
            ),
            new EndsWith("Hello, Dan!")
        );
        MatcherAssert.assertThat(
            new RsPrint(
                new RsXslt(
                    new RsText(
                        new InputStreamOf(
                            new Joined(
                                " ",
                                "<?xml-stylesheet  ",
                                " href='/org/takes/rs/includes.xsl'",
                                "  type='text/xsl' ?>",
                                "
<name>Miranda</name>
"
                            )
                        )
                    )
                )
            ),
            new EndsWith("Hello, Miranda!")
        );
    }

    @Test
    void loadsExternalImports() throws IOException {
        final Text xml = new Joined(
            " ",
            "<?xml-stylesheet   ",
            " href='/org/takes/rs/stylesheet-with-include.xsl'",
            " type='text/xsl'?><page sla='0.324'/>"
        );
        MatcherAssert.assertThat(
            IOUtils.toString(
                new RsXslt(
                    new RsText(new InputStreamOf(xml))
                ).body(),
                StandardCharsets.UTF_8
            ),
            XhtmlMatchers.hasXPath(
                "/xhtml:html/xhtml:span[starts-with(@class, 'sla ')]"
            )
        );
    }

}


text:
package com.google.devtools.moe.client.testing;

import com.google.devtools.moe.client.CommandRunner;
import com.google.devtools.moe.client.FileSystem;
import com.google.devtools.moe.client.Ui;
import com.google.devtools.moe.client.codebase.ExpressionEngine;
import com.google.devtools.moe.client.codebase.ExpressionModule;
import dagger.BindsInstance;
import dagger.Component;
import javax.inject.Singleton;

/** Some conveniences for testing. */
public class TestingUtils {

  @Singleton
  @Component(modules = ExpressionModule.class)
  interface TestComponent {
    ExpressionEngine engine();

    static Builder builder() {
      return DaggerTestingUtils_TestComponent.builder();
    }

    @Component.Builder
    interface Builder {
      @BindsInstance
      Builder ui(Ui ui);

      @BindsInstance
      Builder fs(FileSystem fs);

      @BindsInstance
      Builder cmd(CommandRunner cmd);

      TestComponent build();
    }
  }

  public static ExpressionEngine expressionEngineWithRepo(Ui ui, FileSystem fs, CommandRunner cmd) {
    return TestComponent.builder().ui(ui).fs(fs).cmd(cmd).build().engine();
  }

  private TestingUtils() {}
}


text:
package game.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import game.model.*;

/**
 * This class is where all of the events of the game are defined and
 * constructed.  Ideally, these events would be defined in an XML file, but
 * this is faster and I'm making this at a hackathon.
 *
 * @author Connor Seiden
 *
 */
public class EventBuilder {

	public static List<StartEvent> buildRandomEvents(){
		List<StartEvent> randomEvents = new ArrayList<StartEvent>();

		randomEvents.add(teslaEvent());
		randomEvents.add(getDrinksEvent());

		return randomEvents;
	}

	public static List<StartEvent> buildTriggeredEvents(){
		List<StartEvent> events = new ArrayList<StartEvent>();

		//The following are the fail states, when any of your stats reach 1 or lower.
		//Put other triggered events in another method before calling it from here.
		List<Option> confirm = new ArrayList<Option>();
		Option cont = new Option(null, "OK", 0, 0, 0, 0, null);
		confirm.add(cont);
		cont.setEndGame(true);

		StartEvent healthDeath = new StartEvent("You forgot to drink your apple cider "
				+ "vinegar and your health was too poor to fight off the toxins."
				+ "  You're Dead.  Game Over.", confirm, new Requirement(-1, 0, 0, 0, null), null);

		StartEvent moneyDeath = new StartEvent("No longer able to afford an apartment, "
				+ "you moved back in with your parents on the East Coast.  You got a job in the "
				+ "adjacent city. Without having to pay rent, you pay off your "
				+ "student loans with ease and live a pleasant life.  You Lose?",
				confirm, new Requirement(0, -1, 0, 0, null), null);

		StartEvent satisfactionDeath = new StartEvent("You find no satisfaction in your life."
				+ "You realize that everything is meaningless and life has no point.  After "
				+ "coming out of your existentialist depression, you decide to wander the world."
				+ "  You're shot to death in Tibet 3 years later with no regrets. Game Over.",
				confirm, new Requirement(0, 0, -1, 0, null), null);

		events.add(healthDeath);
		events.add(moneyDeath);
		events.add(satisfactionDeath);
		events.add(fireEvent());
		return events;
	}

	public static JobApplicationEvent makeJobApplicationEvent(){

		Option cont = new Option(null, "OK", 0, 0, 0, 0, null);
		List<Option> confirm = new ArrayList<Option>();
		confirm.add(cont);

		SubEvent intResult = new SubEvent("No luck, you didn't get the job.", confirm);

		List<Option> languages = new ArrayList<Option>();
		languages.add(new Option(null, "Java", 0, 0, 0, 0, intResult));
		languages.add(new Option(null, "C#", 0, 0, 0, 0, intResult));
		languages.add(new Option(null, "Python", 0, 0, 0, 0, intResult));
		languages.add(new Option(null, "Javascript", 0, 0, 0, 0, intResult));

		Random r = new Random();
		int i = r.nextInt(4);
		languages.get(i).setSubEvent(new SubEvent("You got the job!", confirm));
		languages.get(i).setJobMod(2);

		SubEvent interview = new SubEvent("At the interview, you are asked "
				+ "which language you are the most experienced with?", languages);

		List<Option> result = new ArrayList<Option>();

		result.add(new Option(null, "Go to interview.", 0, 0, 0, 0, interview));
		result.add(new Option(null, "OK", 0, 0, -5, 0, null));

		JobApplicationEvent step1 = new JobApplicationEvent("", result);

		return step1;
	}

	public static StartEvent makeDefaultEvent(){

		Option cont = new Option(null, "OK", 0, 0, 0, 0, null);
		List<Option> confirm = new ArrayList<Option>();
		confirm.add(cont);

		List<Option> options = new ArrayList<Option>();
		StartEvent t = new StartEvent();
		t.setDescription("What do you do today?");

		List<Option> subOptions = new ArrayList<Option>();

		options.add(new Option(new Requirement(0, 0, 0, 1, null), "Apply to Jobs", 0, -5, 0, 0,
				makeJobApplicationEvent()));
		options.add(new Option(null, "Save money", -10, 0, 0, 0,
				new SubEvent("You save money by not eating (Money +0, Health -10)", confirm)));
		options.add(new Option(null, "Eat healthy", 5, -10 , 0, 0,
				new SubEvent("You eat locally grown organically sourced vegetables (Health +5, Money -10)", confirm)));
		options.add(new Option(null, "Hang out with friends", 0, -10, 5, 0,
				new SubEvent("Your friends all want to do expensive stuff (Satisfaction +5, Money -10)", confirm)));
		options.add(new Option(new Requirement(0, 0, 0, 2, null), "Go to work", -1, 5, -5, 0,
				new SubEvent("You go to work. (Money +10, Life Satisfaction -10)", confirm)));

		SubEvent t1 = new SubEvent();
		t1.setDescription("While buying your taco, a dog asks for a bite.  What do?");

		subOptions.add(new Option(null, "Give him a bite", -1, 0, 1, 0,
				new SubEvent("You helped a dog, you feel better about "
						+ "yourself, but now you're hungry (Satisfaction +5, Health -10)", confirm)));

		subOptions.add(new Option(null, "Don't give him a bite", 1, 0, -1, 0,
				new SubEvent("You feel bad about not helping the dog, "
						+ "but it was a good taco (Satisfaction -10, Health +5)", confirm)));

		t1.setOptions(subOptions);
		options.add(new Option(null, "Buy a taco", 0, 1, 0, 0, t1));

		t.setOptions(options);
		t.setPrerequisite(new Requirement(0, 0, 0, 0, null));
		return t;
	}

	private static StartEvent teslaEvent(){
		SubEvent teslas5 = new SubEvent("You save Elon Musk but get punched in the process.  "
				+ "He grumbles a thanks at you before crying and getting back in his Tesla.  "
				+ "You don't feel very satisfied. (health -15, satisfaction +2)", null);

		SubEvent teslas4 = new SubEvent("You gleefully join the man in beating up the stuck-up billionaire."
				+ "Disappointed in humanity, Elon Musk decides to no longer be the only one standing in the way"
				+ " of the world being ruled by smart AI.  The world becomes Terminator, everyone is dead. (health -100)", null);

		SubEvent teslas3 = new SubEvent("The fight ends when Elon starts crying and craps"
				+ " his pants.  Realizing that even a titan of the industry is no different than "
				+ "the rest of the awkward nerds in this valley fills you with a sense of satisfaction "
				+ "(satisfaction +15)", null);

		List<Option> choices2 = new ArrayList<Option>();
		choices2.add(new Option(null, "Watch what happens.", 0, 0, 15, 0, teslas3));
		choices2.add(new Option(null, "Help the guy beating up Elon.", -100, 0, 0, 0, teslas4));
		choices2.add(new Option(null, "I MUST SAVE ELON MUSK!", -15, 0, 2, 0, teslas5));

		SubEvent teslas2 = new SubEvent("Upon closer inspection, the guy getting his ass"
				+ " kicked is Elon Musk.  What do you do?", choices2);

		List<Option> choices1 = new ArrayList<Option>();
		choices1.add(new Option(null, "Check it out", 0, 0, 0, 0, teslas2));
		choices1.add(new Option(null, "Ignore it, you've got places to be", 0, 0, 10, 0, null));

		StartEvent teslas1 = new StartEvent("You see two Teslas pull up to a charging station at the same time.  They drivers get out and argue with each other before fighting.  One of them looks like he is getting his ass kicked.  What do you do?",
				choices1, null, null);

		return teslas1;
	}

	private static StartEvent fireEvent() {
        SubEvent  plead = new SubEvent("The boss looks at you blankly, but with a small hint of pity." +
                " It seems your excessive pleading has made you look extremely pathetic. The boss says" +
                " 'I think it would be best if you leave now.' \n" +
                "You feel very embarrassed and want to puke. (You are now unemployed. Satisfaction -20, Health -5)", null);

        SubEvent nodSilently = new SubEvent("The boss looks uncomfortable with your silence." +
                " He says 'This company needs its workers to be passionate about their job...'" +
                " He looks at you, seeming even more uncomfortable with your silence." +
                " 'I wish you the best in your future,' he says with an obviously fake smile as he tries to reach out for a handshake." +
                " You tried to go for a fist bump instead. Your - no - the boss looks even more uncomfortable, if that was even possible" +
                " He silently pulls out his phone as you turn around and walk out the door. \n" +
                "You feel ice cold inside, which in Silicon Valley means 'somewhere below 60 degrees F'." +
                " You don't feel like eating for the rest of the day. (You are now unemployed. Satisfaction -20, Health -5, Money +1)", null);

        List<Option> choices1 = new ArrayList<Option>();

        choices1.add( new Option( null, "Plead to keep your job", -5, 0, -20, 1, plead));
        choices1.add( new Option( null, "Numbly nod head in silence", -5, +1, -20, 1, nodSilently ));

        StartEvent firing = new StartEvent("Your boss calls you into his office. 'We don't really feel like you've been acting like a team player."
                + " It would be best if you and our company did a conscious uncoupling.' \n "
                + " You're getting fired. What do you do?", choices1, new Requirement(-40, 0, -40, 2, null), null);

        return firing;
}

	private static StartEvent getDrinksEvent() {
	    //Random

        SubEvent wine = new SubEvent("You want to show your team that you have good taste, so you order a glass of wine." +
                " No one on the team comments on your drink choice. You all discuss about how functional programming is the future. \n (Health -2, Money -4)", null);

        SubEvent mixedDrink = new SubEvent("You want to show your team that you are a risk-taker so you excitedly order 'The Innovator'." +
                " One team member snarks 'It\'s probably not that special.' When you receive your drink, you take a sip." +
                "It tastes exactly like a rum and Coke, but uses Vanilla Coke instead of regular. You feel disappointed by 'The Innovator'.\n" +
                "(Health - 2, Money -4, Satisfaction -1)", null);

        SubEvent IPA = new SubEvent("You want to show your team that you are down-to-earth by ordering the locally-brewed, organic IPA." +
                " All your teammates acknowledge your awesome, original choice and order the same thing." +
                " You all discuss how great it feels to support the local community." +
                " You tune out the conversation and feel proud of yourself for your drink choice.\n" +
                "(Health -2, Money -5, Satisfaction +5) ", null);

        SubEvent cheapBeer = new SubEvent(" You want to show your team that you are resourceful so you order the cheap, generic beer." +
                " Your teammates look at you as if you had just said 'My favorite language is PHP,' unironically.\n" +
                "(Health -2, Money -2, Satisfaction -3)", null);

        List<Option> drinkChoice = new ArrayList<Option>();

        //Add Choice Options
        drinkChoice.add( new Option(null, "Glass of red wine", -2, -4, 0, 0, wine) );

        drinkChoice.add( new Option(null, "Mixed drink: 'The Innovator'", -2, -4, -1, 0, mixedDrink) );

        drinkChoice.add( new Option(null, "Locally-brewed, organic IPA", -2, -5, +5, 0, IPA) );

        drinkChoice.add( new Option(null, "Cheapest generic beer", -2, -2, -3, 0, cheapBeer) );

        StartEvent getDrinks = new StartEvent("The team decides to go to a new bar in town, Clippy," +
                " You arrange for a ParCar to pick you up. One team member proudly proclaims that he would have" +
                " preferred to use Boost because they treat their workers better." +
                " The other teammates nod in agreement and you join in as well. While nodding, you think to yourself, " +
                " 'Well... I already had ParCar installed; installing the Boost app would be too annoying." +
                " I only need one ride-sharing app.' When you finish your thought, you noticed that you are still nodding" +
                " your head and your teammates are getting into your ParCar that has just arrived." +
                " You stare out the window as the rest of your team chirps to the world about how awesome Clippy will be." +
                " You all arrive to Clippy, and take a seat at the bar. The bartender asks you what you would like to drink. \n" +
                "What drink do you order?", drinkChoice, null, new Requirement(0, 0, 0, 2, null));

        return  getDrinks;

}

}


text:
ActiveRecord::Schema.define(version: 20131212193818) do

  create_table "bars", force: true do |t|
    t.string   "name"
    t.integer  "foo_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "bars", ["foo_id"], name: "index_bars_on_foo_id"

  create_table "bazs", force: true do |t|
    t.string   "name"
    t.integer  "bar_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "bazs", ["bar_id"], name: "index_bazs_on_bar_id"

  create_table "foos", force: true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

end


text:
<?php

namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section;

use Magento\Ui\Test\Block\Adminhtml\Section;
use Magento\Mtf\Client\Element\SimpleElement;

/**
 * Detail details section.
 */
class ProductDetails extends Section
{
    /**
     * Locator for category ids.
     *
     * @var string
     */
    protected $categoryIds = '.admin__field[data-index="category_ids"]';

    /**
     * Locator for following sibling of category element.
     *
     * @var string
     */
    protected $newCategoryRootElement = '.product_form_product_form_create_category_modal';

    /**
     * Fixture mapping.
     *
     * @param array|null $fields
     * @param string|null $parent
     * @return array
     */
    protected function dataMapping(array $fields = null, $parent = null)
    {
        if (isset($fields['custom_attribute'])) {
            $this->placeholders = ['attribute_code' => $fields['custom_attribute']['value']['code']];
            $this->applyPlaceholders();
        }
        return parent::dataMapping($fields, $parent);
    }

    /**
     * Fill data to fields on section.
     *
     * @param array $fields
     * @param SimpleElement|null $element
     * @return $this
     */
    public function setFieldsData(array $fields, SimpleElement $element = null)
    {
        $data = $this->dataMapping($fields);
        // Select attribute set
        if (isset($data['attribute_set_id'])) {
            $this->_fill([$data['attribute_set_id']], $element);
            unset($data['attribute_set_id']);
        }
        // Select categories
        if (isset($data['category_ids'])) {
            if (isset($fields['category_ids']['source'])
                && $fields['category_ids']['source']->getCategories() !== null
                && !$fields['category_ids']['source']->getCategories()[0]->hasData('id')
            ) {
                $this->blockFactory->create(
                    'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\NewCategoryIds',
                    ['element' => $this->browser->find($this->newCategoryRootElement)]
                )->addNewCategory($fields['category_ids']['source']->getCategories()[0]);
            } else {
                $this->_fill([$data['category_ids']], $element);
            }
            unset($data['category_ids']);
        }

        $this->_fill($data, $element);

        return $this;
    }
}


text:
title:  'Ježíš – prostředník lepší smlouvy'
date:  06/01/2022
---

>

> 8Ale když Bůh kárá svůj lid, říká: "Hle, přicházejí dny, praví Hospodin, kdy s domem izraelským i s domem judským uzavřu smlouvu novou, 9ne jako byla ta smlouva, kterou jsem uzavřel s jejich otci v den, kdy jsem je vzal za ruku, abych je vyvedl ze země egyptské. Neboť oni nezůstali v mé smlouvě, a já jsem se jich zřekl, praví Hospodin. 10A toto je smlouva, kterou uzavřu s domem izraelským po oněch dnech, praví Hospodin: Dám své zákony do jejich mysli a napíšu jim je na srdce. Budu jim Bohem a oni budou mým lidem. 11Pak už nebude učit druh druha a bratr bratra a nebude vybízet: 'Poznej Pána,' protože mě budou znát všichni, od nejmenšího až po největšího. 12Slituji se nad jejich nepravostmi a na jejich hříchy už nevzpomenu." (Žd 8,8–12)

**Osobní studium**

List Židům se v kapitolách 8 až 10 zaměřuje na dílo Ježíše jako prostředníka nové smlouvy. Problém staré smlouvy spočíval v tom, že byla jen předzvěstí všeho dobrého, co mělo teprve přijít. Její ustanovení měla předznamenávat, zobrazovat a popisovat dílo, které Ježíš vykoná v budoucnosti. Kněží představovali Ježíše, ale oni sami byli smrtelní a hříšní. Nemohli projevovat dokonalost, protože dokonalý je jen Ježíš. Kromě toho sloužili ve svatyni, která byla jen "náznakem a stínem" (Žd 8,5) nebeské svatyně.

Ježíš vykonává svou kněžskou službu v pravé svatyni a díky němu máme přístup k Bohu. Oběti zvířat představovaly Ježíšovu smrt jako oběť za nás. Jejich krev však nemohla nikoho očistit od zlého svědomí, to může jen Ježíšova krev. Jen díky Ježíši, vírou v něho a přijetím jeho prostřednické služby za nás můžeme k Bohu přistupovat se smělou důvěrou (Žd 10,19–22).

`Uvažuj o úvodním textu (Žd 8,8–12). Co nám Bůh zaslíbil v nové smlouvě? Jaký to má praktický vliv na tvůj život?`

Tím, že Otec ustanovil Ježíše naším veleknězem, uvedl do života novou smlouvu, která zrealizuje to, co stará smlouva mohla pouze naznačovat. Nová smlouva přináší to, co může uskutečnit jen dokonalý, věčný kněz, zároveň Bůh i člověk. Tento Velekněz nejenže vysvětluje a učí Boží zákon, ale také jej i vkládá do našich srdcí. Tento Velekněz nabízí oběť, která přináší odpuštění. Tento Velekněz nás očišťuje a proměňuje. Odstraní naše kamenná srdce a dá nám "srdce z masa" (Ez 36,26). Dělá z nás nové stvoření (2K 5,17). Tento Velekněz nás požehná tím nejobdivuhodnější způsobem – přivádí nás do přítomnosti samotného Otce.

Bůh ustanovil starou smlouvu, aby poukazovala na budoucí dílo Ježíše Krista. Ve svém záměru a cíli byla nádherná. Mnozí však přišli o požehnání, které jim nabídl Ježíš svou službou, protože nebyli ochotni opustit symboly a stíny staré smlouvy a přijmout pravdu, na kterou tyto symboly ukazovaly.

"Jen v Kristu měl chrám své opodstatnění. Chrámové bohoslužby byly předobrazem oběti Božího Syna. Kněžská služba měla představovat jeho prostřednickou službu. Celý systém obětní bohoslužby byl symbolem Spasitelovy smrti za vykoupení lidstva. Všechny tyto oběti ztratí význam ve chvíli, kdy se ona velká událost, kterou po věky znázorňovaly, stane skutečností." (DA 165; TV 101)

**Aplikace**

`V čem je Ježíš lepším veleknězem, než byli velekněží staré smlouvy?`

---

#### Dodatečné otázky k diskuzi

`Co je tou "starou smlouvou"? Kdo, kdy a s kým ji uzavřel?`

`Proč chce Ježíš s křesťany uzavřít novou smlouvu?`

`Proč je třeba, aby byly jeho zákony vepsány do naší mysli i srdce?`

`Jak to dopadá, když má někdo zákon zapsaný jen ve své mysli?`

`Jak to dopadá, když má někdo zákon zapsaný jen ve svém srdci?`

`Jak se mění tvůj život v závislosti na tom, jak roste tvé poznání Boha?`

`Proč potřebujeme Ježíše k uzavření této lepší smlouvy?`

`Cílem naší proměny je být  dokonalým "obrazem" Boha? Věříš, že to může být i tvůj případ? Proč?`

`Co je pro takovou proměnu potřeba? V čem spočívá?`


text:
package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.reactor.impl;

import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.XCalendar;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.reactor.XCalendarAction;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.reactor.XCalendarReactor;

/**
 *
 * @author Jingqi Xu
 */
public class XCalendarDefaultRector implements XCalendarReactor {
	//
	protected XCalendar calendar;

	/**
	 *
	 */
	public XCalendarDefaultRector(XCalendar calendar) {
		this.calendar = calendar;
	}

	/**
	 *
	 */
	@Override
	public void submit(XCalendarAction action) {
		if(this.calendar.isDisposed()) return;
		this.calendar.getDisplay().syncExec(() -> { action.apply(this.calendar); });
	}
}


text:
package com.wintenbb;

import com.wintenbb.bankManager.domain.Account;
import com.wintenbb.bankManager.domain.AccountsStatement;
import com.wintenbb.bankManager.parser.pdf.PDFParser;
import com.wintenbb.bankManager.parser.pdf.config.PDFParserConfig;
import org.junit.Assert;
import org.junit.Test;

import java.io.IOException;
import java.util.regex.Pattern;

public class CICParserTest {
	private static final String FILENAME = "Extrait de comptes Anonyme XXXXXX.. au 2012-10-03.pdf";

	@Test
	public void test() throws IOException {
		AccountsStatement extrait;
		extrait = new PDFParser(CICParserTest.class.getClassLoader().getResourceAsStream(FILENAME), PDFParserConfig.CIC)
				.treat();

		Assert.assertTrue(Pattern.matches("(\\s*<<Suite au verso>>)", " <<Suite au verso>>"));

		Assert.assertNotNull(extrait);
		Assert.assertEquals(3, extrait.getAccounts().size());

		Account account = extrait.getAccounts().get("00099999902");
		Assert.assertEquals(23, account.getLines().size());

		Assert.assertEquals("AAAAAAAA AAAAAAAA AAAAA CARTE 99999999", account.getLines().get(0).getFullLabel());
		Assert.assertEquals("PAIEMENT CB 9999 DDDDDD MCDONALD'S CARTE 99999999",
				account.getLines().get(3).getFullLabel());
		Assert.assertEquals("LLLLLLLLLLLLLLLLLL REF 99999999", account.getLines().get(19).getFullLabel());
		Assert.assertEquals("MMMMMMMMM 99999999", account.getLines().get(20).getFullLabel());
	}

}


text:
import json

WHITESPACE='\t\n\r '
BUFSIZE=8192

def json_objects(readable):
    """ Generator producing a stream of JSON objects from a file-like object

    Should only be used for lists or objects, as literal values may be split
    between read buffers and decoded as separate values (e.g., 1234 -> 12, 34
    if 1234 ends upp crossing a buffer boundary)
    """
    dec = json.JSONDecoder()
    buf = readable.read(BUFSIZE)
    while True:
        buf = buf.lstrip(WHITESPACE)
        try:
            obj, off = dec.raw_decode(buf)
            yield obj
            buf = buf[off:]
        except ValueError:
            chunk = readable.read(BUFSIZE)
            if len(chunk) == 0:
                break
            else:
                buf += chunk


text:
layout: post
title: day1
date: 2018-08-21-21-06-58
author: techenomics1
comments: true
categories: [Uncategorized]---


text:
package org.wso2.carbon.sampledevice.api.util;

import java.io.File;

/**
 * This is an utility class to hold zip files.
 */
public class ZipArchive {

    private File zipFile = null;
    private String fileName = null;

    public ZipArchive(String fileName, File zipFile) {
        this.fileName = fileName;
        this.zipFile = zipFile;
    }

    public File getZipFile() {
        return zipFile;
    }

    public String getFileName() {
        return fileName;
    }
}


text:
var Component = require('../../component')
var html = require('nanohtml')

module.exports = class Header extends Component {
  constructor (name, state, emit) {
    super(name)
    this.state = state
    this.emit = emit
  }

  update () {
    return false
  }

  createElement () {
    return html`

todos

      <input class="new-todo"
        autofocus
        placeholder="What needs to be done?"
        onkeydown=${this.createTodo.bind(this)} />
    `
  }

  createTodo (e) {
    var value = e.target.value
    if (e.keyCode === 13) {
      e.target.value = ''
      this.emit('todos:create', value)
    }
  }
}


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

	<title>Type (LevelTools API)</title>
	<meta name="date" content="2012-08-09"/>
	<meta name="keywords" content="Type class"/>
	<link href="../stylesheet.css" type="text/css" rel="stylesheet"/>

Type

type

class

			The haXe Reflection API enables you to retreive informations about any value,
	Classes and Enums at runtime.

Static Methods

		public
		allEnums<T>(e : Enum<T>) : Array<T>

Returns the list of all enum values that don't take any parameter.

		public
		createEmptyInstance<T>(cl : Class<T>) : T

Similar to Reflect.createInstance excepts that the constructor is not called.
		This enables you to create an instance without any side-effect.

		public
		createEnum<T>(e : Enum<T>, constr : String, ?params : Array<Dynamic>) : T

Create an instance of an enum by using a constructor name and parameters.

		public
		createEnumIndex<T>(e : Enum<T>, index : Int, ?params : Array<Dynamic>) : T

Create an instance of an enum by using a constructor index and parameters.

		public
		createInstance<T>(cl : Class<T>, args : Array<Dynamic>) : T

Creates an instance of the given class with the list of constructor arguments.

		private
		describe(t : Dynamic, fact : Bool) : Array<String>

		public
		enumConstructor(e : EnumValue) : String

Returns the constructor of an enum

		public
		enumEq<T>(a : T, b : T) : Bool

Recursively compare two enums constructors and parameters.

		public
			inline
		enumIndex(e : EnumValue) : Int

Returns the index of the constructor of an enum

		public
		enumParameters(e : EnumValue) : Array<Dynamic>

Returns the parameters of an enum

		public
		getClass<T>(o : T) : Class<T>

Returns the class of a value or null if this value is not a Class instance.

		public
		getClassFields(c : Class<Dynamic>) : Array<String>

Returns the list of a class static fields.

		public
		getClassName(c : Class<Dynamic>) : String

Returns the complete name of a class.

		public
		getEnum(o : EnumValue) : Enum<Dynamic>

Returns the enum of a value or null if this value is not an Enum instance.

		public
		getEnumConstructs(e : Enum<Dynamic>) : Array<String>

Returns all the available constructor names for an enum.

		public
		getEnumName(e : Enum<Dynamic>) : String

Returns the complete name of an enum.

		public
		getInstanceFields(c : Class<Dynamic>) : Array<String>

Returns the list of instance fields.

		public
		getSuperClass(c : Class<Dynamic>) : Class<Dynamic>

Returns the super-class of a class, or null if no super class.

		public
		resolveClass(name : String) : Class<Dynamic>

Evaluates a class from a name. The class must have been compiled
		to be accessible.

		public
		resolveEnum(name : String) : Enum<Dynamic>

Evaluates an enum from a name. The enum must have been compiled
		to be accessible.

		public
		typeof(v : Dynamic) : ValueType

Returns the runtime type of a value.


text:
/*global tarteaucitron */
tarteaucitron.lang = {
    "middleBarHead": "☝ 🍪",
    "adblock": "Hei! Tämä sivusto antaa sinun valita ja hallita kolmansien osapuolten asettamia evästeitä.",
    "adblock_call": "Estä adblocker muuttaaksesi asetuksia.",
    "reload": "Päivitä sivu",

    "alertBigScroll": "Jatkamalla selailua,",
    "alertBigClick": "Jatkamalla tämän sivuston selailua,",
    "alertBig": "hyväksyt kolmansien osapuolien tarjoamia palveluita",

    "alertBigPrivacy": "Tämä sivusto käyttää evästeitä ja antaa sinun hallita niitä.",
    "alertSmall": "Hallinnoi palveluja",
    "acceptAll": "OK, hyväksy kaikki",
    "personalize": "Personoi",
    "close": "Sulje",

    "privacyUrl": "Tietosuoja",

    "all": "Kaikkien palveluiden valinta",

    "info": "Yksityisyyden suojaaminen",
    "disclaimer": "Hyväksymällä kolmansien osapuolten palvelut, hyväksyt toiminnan kannalta tarpeellisten evästeiden ja seurantateknologioiden käytön.",
    "allow": "Hyväksy",
    "deny": "Kiellä",
    "noCookie": "Tämä palvelu ei käytä evästeitä",
    "useCookie": "Tämä palvelu voidaan asentaa",
    "useCookieCurrent": "Tämä palvelu on asennettu",
    "useNoCookie": "Tämä palvelu ei ole asentanut evästeitä",
    "more": "Lue lisää",
    "source": "Katso virallinen nettisivu",
    "credit": "Evästeiden hallinta: tarteaucitron.js",
    "noServices": "Tämä sivusto ei käytä evästeitä, jotka vaativat suostumustasi.",

    "toggleInfoBox": "Näytä/piilota tiedot evästeistä ja niiden säilytyksestä",
    "title": "Evästeiden hallintapaneeli",
    "cookieDetail": "Evästetiedot",
    "ourSite": "sivustollamme",
    "newWindow": "uusi ikkuna",
    "allowAll": "Hyväksy kaikki evästeet",
    "denyAll": "Kiellä kaikki evästeet",

    "fallback": "hylätty.",

    "ads": {
        "title": "Mainosverkosto",
        "details": "Mainosverkostot saattavat saada tuloja myymällä mainostilaa sivustolla."
    },
    "analytic": {
        "title": "Yleisön mittaaminen",
        "details": "Les services de mesure d'audience permettent de générer des statistiques de fréquentation utiles à l'amélioration du site."
    },
    "social": {
        "title": "Sosiaaliset verkostot",
        "details": "Sosiaaliset verkostot voivat helpottaa sivuston käytettävyyttä ja mainontaa"
    },
    "video": {
        "title": "Videot",
        "details": "Videoiden toistopalvelut auttavat rikastamaan sivuston markkinointia ja kasvattaa sen näkyvyyttä"
    },

    "comment": {

        "title": "Kommentit",

        "details": "Kommentoinnin ylläpito helpottaa kommenttien arkistointia ja roskapostin hallintaa."
    },
    "support": {
        "title": "Tuki",
        "details": "Ohjelmointirajapintoja käytetään eri ohjelmistojen, kuten hakukoneiden, sijaintien tai käännösten, lataamiseen."
    },
    "api": {
        "title": "Ohjelmointirajapinnat",
        "details": "Ohjelmointirajapintoja käytetään eri ohjelmistojen, kuten hakukoneiden, sijaintien tai käännösten, lataamiseen,..."
    },
    "other": {
        "title": "Muut",
        "details": "Palvelut web-sisältöjen näyttämiseen."
    }
};


text:
namespace blink {

InstalledAppController::~InstalledAppController() {}

void InstalledAppController::provideTo(LocalFrame& frame,
                                       WebInstalledAppClient* client) {
  ASSERT(RuntimeEnabledFeatures::installedAppEnabled());

  InstalledAppController* controller =
      new InstalledAppController(frame, client);
  Supplement<LocalFrame>::provideTo(frame, supplementName(), controller);
}

InstalledAppController* InstalledAppController::from(LocalFrame& frame) {
  InstalledAppController* controller = static_cast<InstalledAppController*>(
      Supplement<LocalFrame>::from(frame, supplementName()));
  ASSERT(controller);
  return controller;
}

InstalledAppController::InstalledAppController(LocalFrame& frame,
                                               WebInstalledAppClient* client)
    : DOMWindowProperty(&frame), m_client(client) {}

const char* InstalledAppController::supplementName() {
  return "InstalledAppController";
}

void InstalledAppController::getInstalledApps(
    const WebSecurityOrigin& url,
    std::unique_ptr<AppInstalledCallbacks> callback) {
  // When detached, the client is no longer valid.
  if (!m_client) {
    callback.release()->onError();
    return;
  }

  // Client is expected to take ownership of the callback
  m_client->getInstalledRelatedApps(url, std::move(callback));
}

void InstalledAppController::frameDestroyed() {
  m_client = nullptr;
  DOMWindowProperty::frameDestroyed();
}

DEFINE_TRACE(InstalledAppController) {
  Supplement<LocalFrame>::trace(visitor);
  DOMWindowProperty::trace(visitor);
}

}  // namespace blink


text:
{% extends "manage/event_request.html" %}
{% set page = "events" %}

{% block manage_title %}
  {% if event.slug %}
    Editing event "{{ event.title }}"
    Permalink by ID
  {% else %}
    Editing event "{{ event.title }}"
  {% endif %}
{% endblock %}

{% block site_css %}
  {{ super() }}
  {% stylesheet 'event_edit' %}
{% endblock %}

{% block site_js %}
  {{ super() }}
  {% javascript 'event_edit' %}
{% endblock %}

{% block content_class %}col-md-6{% endblock %}
{% block extra_columns %}

    {% for approval in event.approval_set.all() %}

      {% if approval.processed %}
        {% set badge = 'success' if approval.approved else 'important' %}

          {{ 'Approved' if approval.approved else 'Rejected' }}

        {{ approval.group }}

        {{ approval.processed_time|js_date }}
{{ approval.user.email }}
        {% if approval.comment %}
          - {{ approval.comment }}
        {% endif %}
      {% else %}
        Needs review from {{ approval.group }}
      {% endif %}

    {% endfor %}
    {% if not almost_equal(event.modified, event.created) %}

      Modified
      {{ event.modified|js_date }}
{{ event.modified_user.email }}

    {% endif %}

      Created
      {{ event.created|js_date }}
{{ event.creator.email }}

    {% if suggested_event %}

        Requested by

      {% if suggested_event.submitted %}
        {{ suggested_event.submitted | js_date }}
      {% else %}

        suggested event submission retracted
      {% endif %}

      {{ suggested_event.user.email }}
      See request

    {% endif %}

      Event Metadata

    {% if event.metadata %}

        {% for key, value in event.metadata %}

              {{ key }}

              {{ value | text_to_html }}

        {% endfor %}

    {% endif %}

      Manage Metadata

    {% if event.duration %}

      Duration:
      {{ show_duration(event.duration, include_seconds=True) }}

    {% endif %}

    {% if archived_hits or live_hits %}

      {% if archived_hits %}

Archived hits:

{{ thousands(archived_hits) }}

      {% endif %}
      {% if live_hits %}

Live hits:

{{ thousands(live_hits) }}

      {% endif %}
      {% if archived_hits and live_hits %}

Total hits:

{{ thousands(archived_hits + live_hits) }}

      {% endif %}

    {% endif %}

    {% if suggested_event and suggested_event.upload %}

File Upload (from requested event)

            Name:

              {{ suggested_event.upload.file_name }}

            Size:

              {{ suggested_event.upload.size | filesizeformat }}
              {% if suggested_event.upload.upload_time %}

                  ({{ show_duration(suggested_event.upload.upload_time) }} to upload)

              {% endif %}

Upload a different file

    {% elif event.upload %}

File Upload

             Name:

                 {{ event.upload.file_name }}

             Size:

               {{ event.upload.size | filesizeformat }}
               {% if event.upload.upload_time %}

                   ({{ show_duration(event.upload.upload_time) }} to upload)

               {% endif %}

           {% if count_event_uploads and request.user.is_superuser %}

                 See all {{ count_event_uploads }} uploads for this event

           {% endif %}

Upload a different file

    {% elif event.is_pending() or event.is_processing() %}

File Upload

Upload original file

    {% endif %}

    {% if event.is_live() and event.is_scheduled() %}
    <form action="{{ url('manage:stop_live_event', event.pk) }}" method="post" class="side-section">
      {% csrf_token %}

        <button class="btn btn-danger"
           title="This will change the status to pending and redirect you to upload the file"
           >Stop Live event</button>

    </form>
    {% endif %}

Tweets

    {% for tweet in tweets %}
      {% if loop.first %}

      {% endif %}

        "{{ truncate_words(tweet.text, 10) }}"

        {% if tweet.sent_date %}
          Sent {{ tweet.sent_date|js_date }}
          {% if tweet.include_placeholder %}
          (with placeholder image)
          {% endif %}
        {% else %}
          {% if not tweet.event.is_scheduled() %}
            Needs to be scheduled first
          {% elif tweet.event.needs_approval() %}
            Needs to be approved first
          {% else %}
            Not yet sent
            ({{ tweet.send_date|js_date }})
          {% endif %}

        {% endif %}

      {% if loop.last %}
{% endif %}
    {% endfor %}

    {% if tweets %}
      Manage tweets
    {% elif event.is_public() %}
      Prepare a new tweet
    {% else %}
      Not a public event
    {% endif %}

    {% if is_vidly_event %}

Vid.ly Media

      Finding out
      {% if perms.main.add_vidlysubmission %}
      {% set submission_count=vidly_submissions.count() %}
      {% if submission_count %}

        {% if submission_count == 1 %}1 Vid.ly Submission{% else %}{{ submission_count }} Vid.ly Submissions{% endif %}

      {% endif %}
      {% endif %}

    {% endif %}

Discussions

      {% if discussion %}
        Discussion
        {% if discussion.enabled %}
        enabled
        {% else %}
        disabled
        {% endif %}
      {% else %}
        Discussion not configured
      {% endif %}

      {% if discussion %}
        {{ comments_count }} posted comments
      {% endif %}

    {% if approvals %}

Approval Requested

    {% for approval in approvals %}

{{ approval.group.name }}

        {% if approval.approved %}
          Approved by {{ approval.user.email }}
        {% else %}
          {% if approval.processed %}
            Rejected by {{ approval.user.email }}
            {% if approval.comment %}

Comment: {{ approval.comment }}
            {% endif %}
          {% else %}
            Waiting.
          {% endif %}
        {% endif %}

    {% endfor %}

    {% endif %}

    {% if stuck_pending %}
    <form action="{{ url('manage:event_archive_auto', event.pk) }}" method="post">

Pending to archive

This event is pending but has a finished Vid.ly submission.

    <button class="btn btn-primary btn-xs">Auto Archive now</button>

    {% endif %}

Event Assignment

        {% if assignment %}
          {% set users_count = assignment.users.count() %}
          {% set locations_count = assignment.locations.count() %}
          {{ users_count }} user{{ users_count|pluralize }},
          {{ locations_count }} location{{ locations_count|pluralize }} assigned
        {% else %}
          No assignments set up
        {% endif %}

      {% if event.location %}

(default location: {{ event.location }})
      {% endif %}

Closed Captions

        {{ closed_captions.count() }} uploaded

Event Transcript

        {% if event.transcript %}
        {{ event.transcript | wordcount }} words
        {% else %}
        0 words
        {% endif %}

Survey

      {% if survey %}
      {% if survey.active %}Survey active{% else %}Survey not active{% endif %}
      {% else %}
        Associate with survey
      {% endif %}

Chapters

      Chapters ({{ chapters_count }})

    {% if is_superuser %}

Archive Time

      {% if event.archive_time %}
      {{ event.archive_time | js_date }}
      {% else %}
      Not archived
      {% endif %}

      Change

    {% if event.is_removed() %}

Really Delete

        This event last changed {{ event.modified | js_date }}

      Delete

    <form action="{{ url('manage:event_delete', event.id) }}"
          method="post"
          class="really-delete-confirmation">
      {% csrf_token %}
      Are you sure?

      This will delete everything associated with this event.

      <button type="submit" class="btn btn-xs btn-primary"
      >Yes delete forever</button>
      Cancel
    </form>
    {% endif %}
    {% endif %}

    {% if vidly_tag_domains %}

Vidly CDN Domains

    {% for vidly_tag_domain in vidly_tag_domains %}

        {{ vidly_tag_domain.type }}{% if vidly_tag_domain.private %} (private){% endif %}:
        {{ vidly_tag_domain.domain }}
        {{ vidly_tag_domain.modified | js_date }}

    {% endfor %}
    <form action="{{ url('manage:reset_vidly_tag_domains', event.id) }}" method="post">
      {% csrf_token %}
      <button class="btn btn-xs btn-primary cancel">Reset domains</button>
    </form>

    {% endif %}

{% endblock %}

{% block manage_content %}

    <button type="button" class="close" data-dismiss="alert">×Close</button>

      Note!

      This event's privacy does not match the token protection of its Vid.ly
      video.

      Simply pressing the "Save changes" button will correct this.

    <button type="button" class="close" data-dismiss="alert">×Close</button>

      Warning!

      This event's Template environment does not match
      the default Template environment for this Template, Location and Privacy.

      See the matching location.

    <form action="{{ url('manage:event_template_environment_mismatch', event.id) }}" method="post">
      {% csrf_token %}
      <button class="btn btn-primary" type="submit">Correct this event's Template environment</button>
    </form>

  {% include "manage/_default_form_upload.html" %}

  {% if suggested_event_comments %}

Additional comments from original requested event

  {% set comments=suggested_event_comments %}
  {% include "manage/_suggestion_comments.html" %}

  {% endif %}

{% endblock %}


text:
<title>PongOut - List Themes</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        Toggle navigation

      </button>
      PongOut

Levels

Themes

<?php

include_once('config.php');

$mysqli = new mysqli(constant("DB_HOST"), constant("DB_USER"), constant("DB_PASSWORD"), constant("DB_NAME"));
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}

$query="SELECT * FROM themes";
$result = $mysqli->query($query);

$num = $result->num_rows;
$mysqli->close();

$i = 0;
while ($i < $num) {

    $result->data_seek($i);
    $row = $result->fetch_assoc();

    $id     = $row['id'];
    $output = $row['name'];
?>

<div class="panel panel-default" id="theme<?php echo $id; ?>">

<?php echo $output; ?>

                    <img width="120" src="themes/<?php echo $id ?>/bg.png" />
                    <img width="30" src="themes/<?php echo $id ?>/ball.png" />
                    <img width="30" src="themes/<?php echo $id ?>/brick.png" />
                    <img width="30" src="themes/<?php echo $id ?>/paddle.png" />

<a href='edit_theme.php?id=<?php echo $id; ?>' class="btn btn-primary">Edit

<a href='list_themes.php' class="btn btn-danger" onclick='deleteRow(<?php echo $id; ?>);return false;'>Delete

<?php
    $i++;
} ?>

    <form action='new_theme.php' method='GET' class="text-right">
        <input type='submit' class="btn btn-primary" name='do' value='Create new theme'/>
    </form>

Are you sure you wish to delete this theme?


text:
import { TextDocument, Position, Range, WorkspaceEdit } from 'vscode';
import { LexDocument, ISymbol } from '../parser/lexParser'

export function doLEXRename(document: TextDocument, position: Position, newName: string, lexDocument: LexDocument): WorkspaceEdit | null {
    const offset = document.offsetAt(position);
    const node = lexDocument.getEmbeddedCode(offset);
    if (node) {
        return null;
    }

    const word = document.getText(document.getWordRangeAtPosition(position));
    var symbol: ISymbol | undefined = lexDocument.defines[word] || lexDocument.states[word];
    const edits = new WorkspaceEdit();
    symbol?.references.forEach(reference => {
        edits.replace(document.uri, new Range(document.positionAt(reference[0]), document.positionAt(reference[1])), newName);
    })
    return edits;
}


text:
define([
    'jquery',
    'underscore',
    'backbone',
    'handlebars',
    './WizardBaseView',
    '../renderFunctions'
], function($, _, Backbone, Handlebars, BaseView){

    var SuperClass = BaseView;

    var navItemView = SuperClass.extend({

        navItemTpl: Handlebars.compile(

            '
' +
                '' +
                '{{step}} {{title}}'+
                '
'),

        events: {
            // Disabled for now
//            "click .wizard-nav-item" : "switchCard"
        },

        initialize: function() {
            var me = this;
            me.model.on('change',me.render,me);

        },

        render: function() {
            this.$el.html(this.navItemTpl(this.model.toJSON()));
            return this;
        },

        switchCard: function(e) {
            // Will trigger a change event
            // Disabled for now until we get figured out how side navigation should work in light of the fact that there
            // can be sub-steps for each card that aren't reflected in the nav panel
//            if (this.model.get('visited') && !this.model.get('active'))  {
//                // This event is intended to trigger a switch to the selected card
//                this.model.set('switchToMe', true);
//            }
        }
    });

    return navItemView;
});


text:
// Copyright (c) Jeremy W. Kuhne. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using WInterop.Storage;

namespace WInterop.Support;

public static class Conversion
{
    private static readonly DateTime s_oleBaseDate = new(year: 1899, month: 12, day: 30);
    private const double MinOleDate = -657435.0;
    private const double MaxOleDate = 2958466.0;

    public static ulong HighLowToLong(uint high, uint low) => ((ulong)high) << 32 | low;
    public static long HighLowToLong(int high, int low) => (long)HighLowToLong((uint)high, (uint)low);
    public static uint HighLowToInt(ushort high, ushort low) => ((uint)high) << 16 | low;
    public static int HighLowToInt(short high, short low) => (int)HighLowToInt((ushort)high, (ushort)low);

    // Note that we always cast IntPtr to ulong to avoid checked blocks

    public static ushort HighWord(nint value) => (ushort)(((ulong)value >> 16) & 0xFFFF);
    public static ushort HighWord(nuint value) => (ushort)(((ulong)value >> 16) & 0xFFFF);
    public static uint HighWord(ulong value) => (uint)(value >> 32);
    public static ushort HighWord(uint value) => (ushort)(value >> 16);
    public static short HighWord(int value) => (short)HighWord((uint)value);

    public static ushort LowWord(nint value) => (ushort)((ulong)value);
    public static ushort LowWord(nuint value) => (ushort)((ulong)value);
    public static uint LowWord(ulong value) => (uint)value;
    public static ushort LowWord(uint value) => (ushort)value;
    public static short LowWord(int value) => (short)LowWord((uint)value);

    public static DesiredAccess FileAccessToDesiredAccess(System.IO.FileAccess fileAccess)
        => fileAccess switch
        {
                // See FileStream.Init to see how the mapping is done in .NET
                System.IO.FileAccess.Read => DesiredAccess.GenericRead,
            System.IO.FileAccess.Write => DesiredAccess.GenericWrite,
            System.IO.FileAccess.ReadWrite => DesiredAccess.GenericRead | DesiredAccess.GenericWrite,
            _ => 0,
        };

    public static System.IO.FileAccess DesiredAccessToFileAccess(DesiredAccess desiredAccess)
    {
        System.IO.FileAccess fileAccess = 0;
        if ((desiredAccess & (DesiredAccess.GenericRead | DesiredAccess.ReadData)) > 0)
            fileAccess = System.IO.FileAccess.Read;

        if ((desiredAccess & (DesiredAccess.GenericWrite | DesiredAccess.WriteData)) > 0)
            fileAccess = fileAccess == System.IO.FileAccess.Read ? System.IO.FileAccess.ReadWrite : System.IO.FileAccess.Write;

        return fileAccess;
    }

    public static ShareModes FileShareToShareMode(System.IO.FileShare fileShare)
    {
        // See additional comments on ShareMode
        fileShare &= ~System.IO.FileShare.Inheritable;
        return unchecked((ShareModes)fileShare);
    }

    public static FileFlags FileOptionsToFileFlags(System.IO.FileOptions fileOptions)
        => unchecked((FileFlags)fileOptions);

    public static CreationDisposition FileModeToCreationDisposition(System.IO.FileMode fileMode)
        => fileMode == System.IO.FileMode.Append ? CreationDisposition.OpenAlways : (CreationDisposition)fileMode;

    /// <summary>
    ///  Convert a native OLE Variant VT_DATE to a DateTime.
    /// </summary>
    /// <exception cref="ArgumentOutOfRangeException">
    ///  Thrown if the value is outside of the allowable range for an OLE Date (Dates must be between 100AD
    ///  and 10000AD).
    /// </exception>
    public static DateTime VariantDateToDateTime(double value)
    {
        // The base time for OLE is 12:00:00 AM 12/30/1899, with the integer part being number of
        // days ahead or behind of the base date and the fractional part being the fraction of a
        // day _ahead_ of the calculated day. (e.g. 0.75 == -0.75). The fractional day is then rounded
        // to the nearest half second.
        //
        // Dates must be between 100AD and 10000AD.
        //
        // https://blogs.msdn.microsoft.com/ericlippert/2003/09/16/erics-complete-guide-to-vt_date/

        if (value < MinOleDate || value > MaxOleDate)
            throw new ArgumentOutOfRangeException(nameof(value));

        long dayOffsetInTicks = (long)value * TimeSpan.TicksPerDay;
        long fractionalDayTicks = Math.Abs((long)((value - (long)value) * TimeSpan.TicksPerDay));

        // TODO: Technically we need to round to the nearest half second, but .NET doesn't do this

        return new DateTime(s_oleBaseDate.Ticks + dayOffsetInTicks + fractionalDayTicks);
    }

    /// <summary>
    ///  Endian swaps an unsigned short.
    /// </summary>
    /// <param name="source">The unsigned short to swap.</param>
    /// <returns>The swapped unsigned short.</returns>
    public static ushort EndianSwap(ushort source) => (ushort)(((uint)source << 8) | ((uint)source >> 8));

    /// <summary>
    ///  Endian swaps a short.
    /// </summary>
    /// <param name="source">The short to swap.</param>
    /// <returns>The swapped  short.</returns>
    public static short EndianSwap(short source) => (short)EndianSwap((ushort)source);

    /// <summary>
    ///  Endian swaps an unsigned int.
    /// </summary>
    /// <param name="source">The unsigned int to swap.</param>
    /// <returns>The swapped unsigned int.</returns>
    public static uint EndianSwap(uint source)
    {
        return (source << 24)
            | ((source & 0x0000FF00) << 8)
            | ((source & 0x00FF0000) >> 8)
            | (source >> 24);
    }

    /// <summary>
    ///  Endian swaps an int.
    /// </summary>
    /// <param name="source">The int to swap.</param>
    /// <returns>The swapped int.</returns>
    public static int EndianSwap(int source) => (int)EndianSwap((uint)source);

    /// <summary>
    ///  Endian swaps an unsigned long.
    /// </summary>
    /// <param name="source">The unsigned long to swap.</param>
    /// <returns>The swapped unsigned long.</returns>
    public static ulong EndianSwap(ulong source)
    {
        return (source << 56)
            | ((source & 0x000000000000FF00) << 40)
            | ((source & 0x0000000000FF0000) << 24)
            | ((source & 0x00000000FF000000) << 8)
            | ((source & 0x000000FF00000000) >> 8)
            | ((source & 0x0000FF0000000000) >> 24)
            | ((source & 0x00FF000000000000) >> 40)
            | (source >> 56);
    }

    /// <summary>
    ///  Endian swaps a long.
    /// </summary>
    /// <param name="source">The long to swap.</param>
    /// <returns>The swapped long.</returns>
    public static long EndianSwap(long source) => (long)EndianSwap((ulong)source);

    /// <summary>
    ///  Wraps a span around a buffer that points to a null terminated string.
    /// </summary>
    public static unsafe ReadOnlySpan<char> NullTerminatedStringToSpan(char* buffer)
    {
        if (buffer == null)
            return default;

        char* end = buffer;
        while (*(++end) != '\0') { }

        return new ReadOnlySpan<char>(buffer, (int)(end - buffer));
    }

    /// <summary>
    ///  Converts bool to native BOOL.
    /// </summary>
    public static int ToBOOL(this bool value) => value ? 1 : 0;

    /// <summary>
    ///  Converts native BOOL to bool.
    /// </summary>
    public static bool FromBOOL(this int value) => value != 0;
}


text:
test(function () {
    assert_equals(
        phantom.resolveRelativeUrl(
            "../scripts/foo.js",
            "http://example.com/topic/page.html"),
        "http://example.com/scripts/foo.js");

    assert_equals(
        phantom.fullyDecodeUrl(
        "https://ja.wikipedia.org/wiki/%E8%87%A8%E6%B5%B7%E5%AD%A6%E6%A0%A1"),
        "https://ja.wikipedia.org/wiki/臨海学校");

}, "resolveRelativeUrl and fullyDecodeUrl");


text:
@rem Script to build LuaJIT under "Visual Studio .NET Command Prompt".
@rem Do not run from this directory; run it from the toplevel: etc\luavs.bat .
@rem It creates lua51.dll, lua51.lib and luajit.exe in src.
@rem (contributed by David Manura and Mike Pall)

@setlocal
@set MYCOMPILE=cl  /nologo /MD  /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE /I . /I ..\dynasm
@set MYCOMPILED=cl /nologo /MDd /Od /W3 /c  /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_MBCS" /D "LUAJIT_ASSERT"  /D "_CRT_SECURE_NO_DEPRECATE" /FD /EHsc /RTC1 /I . /I ..\dynasm
@set MYLINK=lib /nologo

cd src

%MYCOMPILE% l*.c
del lua.obj luac.obj
%MYLINK% /out:..\bin\lua51.lib l*.obj
del *.obj *.manifest

%MYCOMPILED% l*.c
del lua.obj luac.obj
%MYLINK% /out:..\bin\lua51D.lib l*.obj
del *.obj *.manifest

cd ..


text:
package cd.synapsehub.smartgeotools.task;

import android.os.AsyncTask;

import com.android.volley.RequestQueue;

import java.util.ArrayList;

import cd.synapsehub.smartgeotools.callbacks.UpcomingMoviesLoadedListener;
import cd.synapsehub.smartgeotools.extras.MovieUtils;
import cd.synapsehub.smartgeotools.network.VolleySingleton;
import cd.synapsehub.smartgeotools.pojo.Movie;

public class TaskLoadUpcomingMovies extends AsyncTask<Void, Void, ArrayList<Movie>> {
    private UpcomingMoviesLoadedListener myComponent;
    private VolleySingleton volleySingleton;
    private RequestQueue requestQueue;

    public TaskLoadUpcomingMovies(UpcomingMoviesLoadedListener myComponent) {

        this.myComponent = myComponent;
        volleySingleton = VolleySingleton.getInstance();
        requestQueue = volleySingleton.getRequestQueue();
    }

    @Override
    protected ArrayList<Movie> doInBackground(Void... params) {

        ArrayList<Movie> listMovies = MovieUtils.loadUpcomingMovies(requestQueue);
        return listMovies;
    }

    @Override
    protected void onPostExecute(ArrayList<Movie> listMovies) {
        if (myComponent != null) {
            myComponent.onUpcomingMoviesLoaded(listMovies);
        }
    }
}


text:
package nl.ndervorst.commons.scalapimps

trait Adapter[X] {self =>
  type This = self.type
  val adaptee: X
  val adapt: This = self
}

object Adapter {
  implicit def adaptee[Adaptee](adapter: Adapter[Adaptee]) = adapter.adaptee
}

object IterableW {
  def zipMerge[E](it1: Iterable[E], it2: Iterable[E])(implicit o: Ordering[E]): Iterable[(Option[E], Option[E])] = null
}

class Series[X: Ordering, Y](val adaptee: Iterable[(X, Y)]) extends Adapter[Iterable[(X, Y)]] {
  val order = implicitly[Ordering[X]]
  def zipMerge(other: Series[X, Y]): Series[X, (Option[Y], Option[Y])] = IterableW.zipMerge(this, other)(new Ordering[(X, Y)] {
    def compare(xy1: (X, Y), xy2: (X, Y)) = order.compare(xy1._1, xy2._1)
  }).map {
    case _ => null
  }
}

object Series {
  implicit def wrap[X: Ordering, Y](itble: Iterable[(X, Y)]): Series[X, Y] = new Series(itble)
}


text:
<?php

namespace RunOpenCode\Bundle\ExchangeRate\Tests\Validator\Constraints;

use PHPUnit\Framework\TestCase;
use RunOpenCode\Bundle\ExchangeRate\Validator\Constraints\ExchangeRate;
use RunOpenCode\Bundle\ExchangeRate\Validator\Constraints\ExchangeRateValidator;
use RunOpenCode\ExchangeRate\Configuration;
use RunOpenCode\ExchangeRate\Contract\RatesConfigurationRegistryInterface;
use RunOpenCode\ExchangeRate\Model\Rate;
use RunOpenCode\ExchangeRate\Registry\RatesConfigurationRegistry;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;

/**
 * Class ExchangeRateValidatorTest
 *
 * @package RunOpenCode\Bundle\ExchangeRate\Tests\Validator\Constraints
 */
class ExchangeRateValidatorTest extends TestCase
{
    /**
     * @test
     *
     * @expectedException \RunOpenCode\Bundle\ExchangeRate\Exception\InvalidArgumentException
     * @expectedExceptionMessage Expected instance of "RunOpenCode\Bundle\ExchangeRate\Validator\Constraints\ExchangeRate", got "Constraint".
     */
    public function itExpectsExchangeRateConstraintClass()
    {
        $validator = new ExchangeRateValidator($this->getMockBuilder(RatesConfigurationRegistryInterface::class)->getMock());
        $validator->validate(null, $this->getMockBuilder(Constraint::class)->setMockClassName('Constraint')->getMock());
    }

    /**
     * @test
     *
     * @expectedException \RunOpenCode\Bundle\ExchangeRate\Exception\InvalidArgumentException
     * @expectedExceptionMessage Expected instance of "RunOpenCode\ExchangeRate\Contract\RateInterface", got "RunOpenCode\Bundle\ExchangeRate\Tests\Validator\Constraints\ExchangeRateValidatorTest".
     */
    public function itExpectsToValidateRate()
    {
        $validator = new ExchangeRateValidator($this->getMockBuilder(RatesConfigurationRegistryInterface::class)->getMock());
        $validator->validate($this, new ExchangeRate());
    }

    /**
     * @test
     */
    public function validationPass()
    {
        $registry = new RatesConfigurationRegistry([
            new Configuration('EUR', 'median', 'dummy_source')
        ]);

        $validator = new ExchangeRateValidator($registry);

        $validationContext = $this->getMockBuilder(ExecutionContextInterface::class)->getMock();

        $validationContext
            ->expects($this->never())
            ->method('buildViolation')
            ->willReturn($validationContext);

        $validator->initialize($validationContext);

        $validator->validate(new Rate(
            'dummy_source',
            10,
            'EUR',
            'median',
            new \DateTime('now'),
            'RSD'
        ), new ExchangeRate());
    }

    /**
     * @test
     */
    public function validationPassOnNull()
    {
        $registry = new RatesConfigurationRegistry([
            new Configuration('EUR', 'median', 'dummy_source')
        ]);

        $validator = new ExchangeRateValidator($registry);

        $validationContext = $this->getMockBuilder(ExecutionContextInterface::class)->getMock();

        $validationContext
            ->expects($this->never())
            ->method('buildViolation')
            ->willReturn($validationContext);

        $validator->initialize($validationContext);

        $validator->validate(null, new ExchangeRate());
    }

    /**
     * @test
     */
    public function validationFails()
    {
        $registry = new RatesConfigurationRegistry([
            new Configuration('CHF', 'median', 'dummy_source')
        ]);

        $validator = new ExchangeRateValidator($registry);
        $constraint = new ExchangeRate();

        $validationContext = $this->getMockBuilder(ExecutionContextInterface::class)->getMock();
        $validationBuilder = $this->getMockBuilder(ConstraintViolationBuilderInterface::class)->getMock();

        $validationContext
            ->expects($this->exactly(1))
            ->method('buildViolation')
            ->with($constraint->message)
            ->willReturn($validationBuilder);

        $validationBuilder
            ->expects($this->exactly(3))
            ->method('setParameter')
            ->willReturn($validationBuilder);

        $validationBuilder
            ->expects($this->exactly(1))
            ->method('setTranslationDomain')
            ->willReturn($validationBuilder);

        $validationBuilder
            ->expects($this->exactly(1))
            ->method('addViolation')
            ->willReturn($validationBuilder);

        $validator->initialize($validationContext);

        $validator->validate(new Rate(
            'dummy_source',
            10,
            'EUR',
            'median',
            new \DateTime('now'),
            'RSD'
        ), $constraint);
    }
}


text:
/*
 *
 * exported fuctions:
 *
 * int drv_generic_i2c_open (void)
 *   reads 'Port' entry from config and opens
 *   the i2c port
 *   returns 0 if ok, -1 on failure
 *
 * int drv_generic_i2c_close (void)
 *   closes i2c port
 *   returns 0 if ok, -1 on failure
 *
 * unsigned char drv_generic_i2c_wire (char *name, char *deflt)
 *   reads wiring for one data signal from config
 *   returns 1<<bitpos or 255 on error
 *
 * void drv_generic_i2c_data (unsigned char value)
 *   put data bits on DB1..DB8
 *
 * void drv_generic_i2c_command(unsigned char command, unsigned char *data,unsigned char length)
 *   send command and the data to the i2c device
 *
 */

#ifndef _DRV_GENERIC_I2C_H_
#define _DRV_GENERIC_I2C_H_

int drv_generic_i2c_open(const char *section, const char *driver);
int drv_generic_i2c_close(void);
unsigned char drv_generic_i2c_wire(const char *name, const char *deflt);
void drv_generic_i2c_byte(const unsigned char data);
void drv_generic_i2c_data(const unsigned char data);
void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length);

#endif


text:
try {
  CreditCardNanny.pluginFlavour = "Firefox";
  CreditCardNanny.gaTrack = function(eventName, additionalData) {
    // a no-op
    return true;
  };
  CreditCardNanny.debug = function(msg) {
    if (CreditCardNanny.Constants.loggingEnabled) {
      var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
                                     .getService(Components.interfaces.nsIConsoleService);
      consoleService.logStringMessage(msg);
    }
  };
  CreditCardNanny.getStorage = function() {
    return CreditCardNanny.storage;
  };
} catch (err) {
  // could not load this extension!
}


text:
try:
    from setuptools import setup, Extension
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, Extension

from numpy import get_include as np_include

if __name__ == '__main__':
    setup(
        name='colorfinder',
        version='0.2.0',
        description='A tool for finding colors in an image',
        author='Yigit Ozen',
        license='MIT',
        packages=['colorfinder'],
        ext_modules=[Extension('_pymeanshift',
                               ['pymeanshift/ms.cpp', 'pymeanshift/msImageProcessor.cpp', 'pymeanshift/rlist.cpp',
                                'pymeanshift/RAList.cpp', 'pymeanshift/pymeanshift.cpp'],
                               depends=['pymeanshift/ms.h', 'pymeanshift/msImageProcessor.h', 'pymeanshift/RAList.h',
                                        'pymeanshift/rlist.h', 'pymeanshift/tdef.h'],
                               language='c++',
                               include_dirs=[np_include()]
        )],
        package_data={
            'colorfinder': ['*.json'],
        },
        data_files=[("", ["LICENSE", "README.rst"])],
        install_requires=[
            'Pillow',
            'numpy',
            'scipy',
        ]
    )


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

<title>ManyToAny (Hibernate JavaDocs)</title>
<meta name="date" content="2014-03-03">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Required |

Optional

Detail:

Element

org.hibernate.annotations

Annotation Type ManyToAny

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface ManyToAny

This is the collection-valued form of @Any definitions.  Defines a ToMany-style association pointing
to one of several entity types depending on a local discriminator.  See Any for further information.

See Also:

Any

Required Element Summary

Required Elements

Modifier and Type
Required Element and Description

Column
metaColumn

Optional Element Summary

Optional Elements

Modifier and Type
Optional Element and Description

FetchType
fetch

String
metaDef

Element Detail

metaColumn

public abstract Column metaColumn

Metadata dicriminator column description, This column will hold the meta value corresponding to the
targeted entity.

metaDef

public abstract String metaDef

Metadata definition used.
If defined, should point to a @AnyMetaDef name
If not defined, the local (ie in the same field or property) @AnyMetaDef is used

Default:

""

fetch

public abstract FetchType fetch

Defines whether the value of the field or property should be lazily loaded or must be
eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime
that the value must be eagerly fetched. The LAZY strategy is applied when bytecode
enhancement is used. If not specified, defaults to EAGER.

Default:

javax.persistence.FetchType.EAGER

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Required |

Optional

Detail:

Element

Copyright © 2001-2014 Red Hat, Inc.  All Rights Reserved.


text:
angular
  .module('flickrPhotosApp.controllers', []);


text:
module MusicUtils

  # This exception its raised when
  # a given note is invalid
  class InvalidNote < StdError
    attr_reader :note

    def initialize(msg, original=$!, note)
      super(msg, original)
      @note = note
    end
  end

end


text:
angular.module('adminApp').controller("imageSettingsCtrl", ["$scope", "$http", "$filter", "ServerService",
	function (scope, http, filter, ServerService) {

	console.log("ordersCtrl!");
	scope.msg = "ordersCtrl!";

	scope.adminName = "Pais admin";

	scope.newType = {
		"name" : "",
		"description" : "",
		"status" : 1
	}

	scope.newFreq = {
		"name" : "",
		"description" : "",
		"status" : 1
	}

	scope.getImageTypes = function() {
		ServerService.getImageTypes().then(function (data) {
                        if (data) {
                           scope.imageTypes = data;
                        } else {
                            alert("Error occured.");
                        }
		}, function(reason) {
		    alert("Error occured.");
		});
	}
	scope.getImageTypes();

	scope.isActive = function (id) {
		for (var i = scope.imageTypes.length - 1; i >= 0; i--) {
			if (scope.imageTypes[i].id == id && scope.imageTypes[i].active == "1") {
				return true;
			} else {
				return false;
			}
		};
	}

	scope.toggleStatus = function (id) {
		for (var i = scope.imageTypes.length - 1; i >= 0; i--) {
			if (scope.imageTypes[i].id == id) {
				if (scope.imageTypes[i].active == "1") {
					scope.imageTypes[i].active = "0";
				} else {
					scope.imageTypes[i].active = "1";
				}
				ServerService.updateImageType(scope.imageTypes[i]).then(function (data) {
                        if (data) {
                           scope.getImageTypes();
                        } else {
                            alert("Error occured.");
                        }
				}, function(reason) {
				    alert("Error occured.");
				});
			}
		};
	}

	scope.addNewType = function () {
		ServerService.addImageType(scope.newType).then(function (data) {
                        if (data) {

								scope.newType = {
									"name" : "",
									"description" : "",
									"status" : 1
								}

								scope.getImageTypes();

                        } else {
                            alert("Error occured.");
                        }
		}, function(reason) {
			 alert("Error occured.");
		});
	}

	scope.deleteImageType = function (id) {
		ServerService.deleteImageType(id).then(function (data) {
                        if (data) {

								scope.getImageTypes();

                        } else {
                           alert("Error occured.");
                        }
		}, function(reason) {
			 alert("Error occured.");
		});
	}

	scope.getAllFrequencies = function () {
		ServerService.getFrequencies().then(function (data) {
                        if (data) {

							scope.frequencies = data;

                        } else {
                            alert("Error occured.");
                        }
		}, function(reason) {
			 alert("Error occured.");
		});
	}

	scope.getAllFrequencies();

	scope.deleteFrequency = function (id) {
		ServerService.deleteFrequency(id).then(function (data) {
                        if (data) {

								scope.getAllFrequencies();

                        } else {
                            alert("Error occured.");
                        }
		}, function(reason) {
			 alert("Error occured.");
		});
	}

	scope.addNewFreq = function () {
		ServerService.addNewFreq(scope.newFreq).then(function (data) {
                        if (data) {

								scope.newFreq = {
									"name" : "",
									"description" : "",
									"status" : 1
								}

								scope.getAllFrequencies();

                        } else {
                            alert("Error occured.");
                        }
		}, function(reason) {
			 alert("Error occured.");
		});
	}

	scope.toggleFreqStatus = function (id) {
		for (var i = scope.frequencies.length - 1; i >= 0; i--) {
			if (scope.frequencies[i].id == id) {
				if (scope.frequencies[i].active == "1") {
					scope.frequencies[i].active = "0";
				} else {
					scope.frequencies[i].active = "1";
				}
				ServerService.updateFrequency(scope.frequencies[i]).then(function (data) {
                        if (data) {
                           scope.getAllFrequencies();
                        } else {
                           alert("Error occured.");
                        }
				}, function(reason) {
				    alert("Error occured.");
				});
			}
		};
	}

}]);