text:
/*
 * %W% %E%
 */

/*
 * Glue routines called by Windows AT into the WindowsAccessBridge dll
 */

#ifndef __AccessBridgeWindowsEntryPoints_H__
#define __AccessBridgeWindowsEntryPoints_H__

#include <windows.h>
#include <jni.h>

#include "AccessBridgePackages.h"
#include "AccessBridgeCallbacks.h"

#ifdef __cplusplus
extern "C" {
#endif

    void Windows_run();

    void releaseJavaObject(long vmID, jobject object);
    void getVersionInfo(long vmID, AccessBridgeVersionInfo *info);

    // Window related functions
    HWND getTopLevelHWND(HWND descendent);
    BOOL isJavaWindow(HWND window);
    BOOL getAccessibleContextFromHWND(HWND window, long *vmID, jobject *AccessibleContext);
    HWND getHWNDFromAccessibleContext(long vmID, jobject accessibleContext);

    // returns whether two objects are the same
    BOOL isSameObject(long vmID, jobject obj1, jobject obj2);

    // Accessible Context functions
    BOOL getAccessibleContextAt(long vmID, jobject AccessibleContextParent,
                                jint x, jint y, jobject *AccessibleContext);
    BOOL getAccessibleContextWithFocus(HWND window, long *vmID, jobject *AccessibleContext);
    BOOL getAccessibleContextInfo(long vmID, jobject AccessibleContext, AccessibleContextInfo *info);
    jobject getAccessibleChildFromContext(long vmID, jobject AccessibleContext, jint childIndex);
    jobject getAccessibleParentFromContext(long vmID, jobject AccessibleContext);

    /* begin AccessibleTable */
    BOOL getAccessibleTableInfo(long vmID, jobject acParent, AccessibleTableInfo *tableInfo);
    BOOL getAccessibleTableCellInfo(long vmID, jobject accessibleTable, jint row, jint column,
                                    AccessibleTableCellInfo *tableCellInfo);

    BOOL getAccessibleTableRowHeader(long vmID, jobject acParent, AccessibleTableInfo *tableInfo);
    BOOL getAccessibleTableColumnHeader(long vmID, jobject acParent, AccessibleTableInfo *tableInfo);

    jobject getAccessibleTableRowDescription(long vmID, jobject acParent, jint row);
    jobject getAccessibleTableColumnDescription(long vmID, jobject acParent, jint column);

    jint getAccessibleTableRowSelectionCount(long vmID, jobject accessibleTable);
    BOOL isAccessibleTableRowSelected(long vmID, jobject accessibleTable, jint row);
    BOOL getAccessibleTableRowSelections(long vmID, jobject accessibleTable, jint count,
                                         jint *selections);

    jint getAccessibleTableColumnSelectionCount(long vmID, jobject accessibleTable);
    BOOL isAccessibleTableColumnSelected(long vmID, jobject accessibleTable, jint column);
    BOOL getAccessibleTableColumnSelections(long vmID, jobject accessibleTable, jint count,
                                            jint *selections);

    jint getAccessibleTableRow(long vmID, jobject accessibleTable, jint index);
    jint getAccessibleTableColumn(long vmID, jobject accessibleTable, jint index);
    jint getAccessibleTableIndex(long vmID, jobject accessibleTable, jint row, jint column);

    /* end AccessibleTable */

    BOOL getAccessibleRelationSet(long vmID, jobject accessibleContext,
                                  AccessibleRelationSetInfo *relationSetInfo);

    // AccessibleHypertext methods
    BOOL getAccessibleHypertext(long vmID, jobject accessibleContext, AccessibleHypertextInfo *hypertextInfo);

    BOOL activateAccessibleHyperlink(long vmID, jobject accessibleContext, jobject accessibleHyperlink);

    jint getAccessibleHyperlinkCount(const long vmID,
                                     const AccessibleContext accessibleContext);

    BOOL getAccessibleHypertextExt(const long vmID,
                                   const AccessibleContext accessibleContext,
                                   const jint nStartIndex,
                                   /* OUT */ AccessibleHypertextInfo *hypertextInfo);

    jint getAccessibleHypertextLinkIndex(const long vmID,
                                         const AccessibleHypertext hypertext,
                                         const jint nIndex);

    BOOL getAccessibleHyperlink(const long vmID,
                                const AccessibleHypertext hypertext,
                                const jint nIndex,
                                /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo);

    /* Accessible KeyBindings, Icons and Actions */
    BOOL getAccessibleKeyBindings(long vmID, jobject accessibleContext,
                                  AccessibleKeyBindings *keyBindings);

    BOOL getAccessibleIcons(long vmID, jobject accessibleContext,
                            AccessibleIcons *icons);

    BOOL getAccessibleActions(long vmID, jobject accessibleContext,
                              AccessibleActions *actions);

    BOOL doAccessibleActions(long vmID, jobject accessibleContext,
                             AccessibleActionsToDo *actionsToDo, jint *failure);

    /* ----- Additional AccessibleHypertext methods for Teton */

    jint getAccessibleHypertextLinkCount(const long vmID,
                                         const AccessibleContext accessibleContext);

    BOOL getAccessibleHypertextExt(const long vmID,
                                   const AccessibleContext accessibleContext,
                                   const jint nStartIndex,
                                   /* OUT */ AccessibleHypertextInfo *hypertextInfo);

    jint getAccessibleHypertextLinkIndex(const long vmID,
                                         const AccessibleContext accessibleContext,
                                         const jint nIndex);

    BOOL getAccessibleHyperlink(const long vmID,
                                const AccessibleContext accessibleContext,
                                const jint nIndex,
                                /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo);

    /* Additional utility methods */
    BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text);

    AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role);

    AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext);

    AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role);

    int getObjectDepth (const long vmID, const AccessibleContext accessibleContext);

    AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext);

    /**
     * Additional methods for Teton
     */

    /**
     * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
     * whether successful.
     *
     * Bug ID 4916682 - Implement JAWS AccessibleName policy
     */
    BOOL getVirtualAccessibleName(long vmID, AccessibleContext accessibleContext, wchar_t *name, int len);

    /**
     * Request focus for a component. Returns whether successful;
     *
     * Bug ID 4944757 - requestFocus method needed
     */
    BOOL requestFocus(long vmID, AccessibleContext accessibleContext);

    /**
     * Selects text between two indices.  Selection includes the text at the start index
     * and the text at the end index. Returns whether successful;
     *
     * Bug ID 4944758 - selectTextRange method needed
     */
    BOOL selectTextRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex);

    /**
     * Get text attributes between two indices.  The attribute list includes the text at the
     * start index and the text at the end index. Returns whether successful;
     *
     * Bug ID 4944761 - getTextAttributes between two indices method needed
     */
    BOOL getTextAttributesInRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex,
                                  AccessibleTextAttributesInfo *attributes, short *len);

    /**
     * Returns the number of visible children of a component. Returns -1 on error.
     *
     * Bug ID 4944762- getVisibleChildren for list-like components needed
     */
    int getVisibleChildrenCount(long vmID, AccessibleContext accessibleContext);

    /**
     * Gets the visible children of an AccessibleContext. Returns whether successful;
     *
     * Bug ID 4944762- getVisibleChildren for list-like components needed
     */
    BOOL getVisibleChildren(long vmID, AccessibleContext accessibleContext, int startIndex,
                            VisibleChildrenInfo *visibleChildrenInfo);

    /**
     * Set the caret to a text position. Returns whether successful;
     *
     * Bug ID 4944770 - setCaretPosition method needed
     */
    BOOL setCaretPosition(long vmID, AccessibleContext accessibleContext, int position);

    /**
     * Gets the text caret bounding rectangle
     */
    BOOL getCaretLocation(long vmID, jobject AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);

    // Accessible Text functions
    BOOL getAccessibleTextInfo(long vmID, jobject AccessibleContext, AccessibleTextInfo *textInfo, jint x, jint y);
    BOOL getAccessibleTextItems(long vmID, jobject AccessibleContext, AccessibleTextItemsInfo *textItems, jint index);
    BOOL getAccessibleTextSelectionInfo(long vmID, jobject AccessibleContext, AccessibleTextSelectionInfo *selectionInfo);
    BOOL getAccessibleTextAttributes(long vmID, jobject AccessibleContext, jint index, AccessibleTextAttributesInfo *attributes);
    BOOL getAccessibleTextRect(long vmID, jobject AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
    BOOL getAccessibleTextLineBounds(long vmID, jobject AccessibleContext, jint index, jint *startIndex, jint *endIndex);
    BOOL getAccessibleTextRange(long vmID, jobject AccessibleContext, jint start, jint end, wchar_t *text, short len);

    // Accessible Value methods
    BOOL getCurrentAccessibleValueFromContext(long vmID,jobject AccessibleContext, wchar_t *value, short len);
    BOOL getMaximumAccessibleValueFromContext(long vmID,jobject AccessibleContext, wchar_t *value, short len);
    BOOL getMinimumAccessibleValueFromContext(long vmID,jobject AccessibleContext, wchar_t *value, short len);

    // Accessible Selection methods
    void addAccessibleSelectionFromContext(long vmID,jobject AccessibleContext, int i);
    void clearAccessibleSelectionFromContext(long vmID,jobject AccessibleContext);
    jobject getAccessibleSelectionFromContext(long vmID,jobject AccessibleContext, int i);
    int getAccessibleSelectionCountFromContext(long vmID,jobject AccessibleContext);
    BOOL isAccessibleChildSelectedFromContext(long vmID,jobject AccessibleContext, int i);
    void removeAccessibleSelectionFromContext(long vmID,jobject AccessibleContext, int i);
    void selectAllAccessibleSelectionFromContext(long vmID,jobject AccessibleContext);

    // PropertyChange Event registry routines
    void setPropertyChangeFP(AccessBridge_PropertyChangeFP fp);

    // Java application shutdown
    void setJavaShutdownFP(AccessBridge_JavaShutdownFP fp);

    // Focus Event registry routines
    void setFocusGainedFP(AccessBridge_FocusGainedFP fp);
    void setFocusLostFP(AccessBridge_FocusLostFP fp);

    // Caret Event registry routines
    void setCaretUpdateFP(AccessBridge_CaretUpdateFP fp);

    // Mouse Event registry routines
    void setMouseClickedFP(AccessBridge_MouseClickedFP fp);
    void setMouseEnteredFP(AccessBridge_MouseEnteredFP fp);
    void setMouseExitedFP(AccessBridge_MouseExitedFP fp);
    void setMousePressedFP(AccessBridge_MousePressedFP fp);
    void setMouseReleasedFP(AccessBridge_MouseReleasedFP fp);

    // Menu/PopupMenu Event registry routines
    void setMenuCanceledFP(AccessBridge_MenuCanceledFP fp);
    void setMenuDeselectedFP(AccessBridge_MenuDeselectedFP fp);
    void setMenuSelectedFP(AccessBridge_MenuSelectedFP fp);
    void setPopupMenuCanceledFP(AccessBridge_PopupMenuCanceledFP fp);
    void setPopupMenuWillBecomeInvisibleFP(AccessBridge_PopupMenuWillBecomeInvisibleFP fp);
    void setPopupMenuWillBecomeVisibleFP(AccessBridge_PopupMenuWillBecomeVisibleFP fp);

    // Accessibility PropertyChange Event registry routines
    void setPropertyNameChangeFP(AccessBridge_PropertyNameChangeFP fp);
    void setPropertyDescriptionChangeFP(AccessBridge_PropertyDescriptionChangeFP fp);
    void setPropertyStateChangeFP(AccessBridge_PropertyStateChangeFP fp);
    void setPropertyValueChangeFP(AccessBridge_PropertyValueChangeFP fp);
    void setPropertySelectionChangeFP(AccessBridge_PropertySelectionChangeFP fp);
    void setPropertyTextChangeFP(AccessBridge_PropertyTextChangeFP fp);
    void setPropertyCaretChangeFP(AccessBridge_PropertyCaretChangeFP fp);
    void setPropertyVisibleDataChangeFP(AccessBridge_PropertyVisibleDataChangeFP fp);
    void setPropertyChildChangeFP(AccessBridge_PropertyChildChangeFP fp);
    void setPropertyActiveDescendentChangeFP(AccessBridge_PropertyActiveDescendentChangeFP fp);

    void setPropertyTableModelChangeFP(AccessBridge_PropertyTableModelChangeFP fp);

#ifdef __cplusplus
}
#endif

#endif


text:
class CXFA_EquateRange final : public CXFA_Node {
 public:
  CXFA_EquateRange(CXFA_Document* doc, XFA_PacketType packet);
  ~CXFA_EquateRange() override;
};

#endif  // XFA_FXFA_PARSER_CXFA_EQUATERANGE_H_

redpajama_set_name: RedPajamaGithub


text:
package de.dynamicfiles.projects.gradle.plugins.javafx;

import de.dynamicfiles.projects.gradle.plugins.javafx.tasks.JfxGenerateKeystoreTask;
import de.dynamicfiles.projects.gradle.plugins.javafx.tasks.JfxNativeTask;
import de.dynamicfiles.projects.gradle.plugins.javafx.tasks.JfxJarTask;
import de.dynamicfiles.projects.gradle.plugins.javafx.tasks.JfxListBundlersTask;
import de.dynamicfiles.projects.gradle.plugins.javafx.tasks.JfxRunTask;
import de.dynamicfiles.projects.gradle.plugins.javafx.tasks.internal.JavaDetectionTools;
import de.dynamicfiles.projects.gradle.plugins.javafx.tasks.internal.MonkeyPatcher;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.gradle.api.GradleException;
import org.gradle.api.Plugin;
import org.gradle.api.Project;

/**
 *
 * @author Danny Althoff
 */
public class JavaFXGradlePlugin implements Plugin<Project> {

    public static final String ANT_JAVAFX_JAR_FILENAME = "ant-javafx.jar";

    @Override
    public void apply(Project project) {
        // can create jfx-jar only after jar-file was created
        if( project.getTasks().findByName("jar") == null ){
            throw new GradleException("Could not find jar-task. Please make sure you are applying the 'java'-plugin.");
        }
        // gradle is lame, so replace existing tasks with MY NAMES ! *battle-cry*

        // tasks will be available for the buldscript prior full evaluation
        JfxJarTask jarTask = project.getTasks().replace(JfxJarTask.JFX_TASK_NAME, JfxJarTask.class);
        JfxNativeTask nativeTask = project.getTasks().replace(JfxNativeTask.JFX_TASK_NAME, JfxNativeTask.class);
        JfxGenerateKeystoreTask generateKeystoreTask = project.getTasks().replace(JfxGenerateKeystoreTask.JFX_TASK_NAME, JfxGenerateKeystoreTask.class);
        JfxRunTask runTask = project.getTasks().replace(JfxRunTask.JFX_TASK_NAME, JfxRunTask.class);
        JfxListBundlersTask jfxListBundlersTask = project.getTasks().replace(JfxListBundlersTask.JFX_TASK_NAME, JfxListBundlersTask.class);

        String taskGroupName = "JavaFX";

        // this is for description
        jarTask.setGroup(taskGroupName);
        jarTask.setDescription("Create executable JavaFX-jar");

        nativeTask.setGroup(taskGroupName);
        nativeTask.setDescription("Create native JavaFX-bundle");

        generateKeystoreTask.setGroup(taskGroupName);
        generateKeystoreTask.setDescription("Create a Java keystore");

        runTask.setGroup(taskGroupName);
        runTask.setDescription("Start generated JavaFX-jar");

        jfxListBundlersTask.setGroup(taskGroupName);
        jfxListBundlersTask.setDescription("List all possible bundlers available on this system, use '--info' parameter for detailed information");

        jarTask.dependsOn(project.getTasks().getByName("jar"));

        // always create jfx-jar before creating native launcher/bundle
        // (in maven I had to implement a lifecycle for this ... mehhh)
        nativeTask.dependsOn(jarTask);

        // to run our jfx-jar, we have to create it first ;)
        runTask.dependsOn(jarTask);

        // extend project-model to get our settings/configuration via nice configuration
        project.getExtensions().create("jfx", JavaFXGradlePluginExtension.class);

        // adding ant-javafx.jar AFTER evaluation, because otherwise we can't know if the user has choosen to NOT patch ant-javafx.jar (in case it is required)
        project.afterEvaluate(evaluatedProject -> {
            // ugly hack by adding ant-javafx-jar for only require to apply javafx-gradle-plugin
            // ... can't change via expected way: dependencies.add("classpath", jfxAntJar)
            // https://discuss.gradle.org/t/how-to-bootstrapp-buildscript-classpath-cannot-change-configuration-classpath-after-it-has-been-resolved/7442
            addJavaFXAntJARToGradleBuildpath(evaluatedProject);
        });
    }

    private void addJavaFXAntJARToGradleBuildpath(Project project) {
        String jfxAntJarPath = "/../lib/" + ANT_JAVAFX_JAR_FILENAME;

        // on java 9, we have a different path
        if( JavaDetectionTools.IS_JAVA_9 ){
            jfxAntJarPath = "/lib/" + ANT_JAVAFX_JAR_FILENAME;
        }

        // always use ant-javafx.jar from the executing JDK (do not use environment-specific paths)
        // per spec "java.home" points to the JRE: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html
        File jfxAntJar = new File(System.getProperty("java.home") + jfxAntJarPath);

        if( !jfxAntJar.exists() ){
            throw new GradleException("Couldn't find Ant-JavaFX-library, please make sure you've installed some JDK which includes JavaFX (e.g. OracleJDK or OpenJDK and OpenJFX), and JAVA_HOME is set properly.");
        }

        // don't use SystemClassloader or current Thread-ClassLoader, as we are not maven here ;)
        ClassLoader buildscriptClassloader = project.getBuildscript().getClassLoader();

        URLClassLoader sysloader;
        // when running inside IDE or while executing java-tests, this should be handled ;)
        if( "org.gradle.internal.classloader.CachingClassLoader".equals(buildscriptClassloader.getClass().getName()) ){
            // project.getBuildscript().getDependencies().add("classpath", project.files(jfxAntJar));
            // would result into: org.gradle.api.InvalidUserDataException: Cannot change dependencies of configuration ':classpath' after it has been resolved.

            // lets mess with the classloaders...
            project.getLogger().debug("Using JavaFXGradlePlugin-class classloader");
            sysloader = (URLClassLoader) this.getClass().getClassLoader();
        } else {
            project.getLogger().debug("Using buildscript classloader");
            sysloader = (URLClassLoader) buildscriptClassloader;
        }

        // add ant-javafx.jar to the classloader (using a different way as javafx-maven-plugin ;D)
        try{
            // I'm very sorry for this ugly condition :(
            boolean usePatchedJar = System.getProperty("os.name").toLowerCase().startsWith("windows") && isGradleDaemonMode() && (JavaDetectionTools.IS_JAVA_9 || (JavaDetectionTools.IS_JAVA_8 && JavaDetectionTools.isAtLeastOracleJavaUpdateVersion(60)));
            boolean usePatchedJFXAntLib = project.getExtensions().getByType(JavaFXGradlePluginExtension.class).isUsePatchedJFXAntLib();

            // check if patched jar is required
            if( usePatchedJar && !usePatchedJFXAntLib ){
                usePatchedJar = false;
                project.getLogger().warn("You disabled the patching (by setting 'usePatchedJFXAntLib'-property to 'false' inside 'jfx'-configuration) of the " + ANT_JAVAFX_JAR_FILENAME + ", please make sure you know about the consequences.");
            }

            // check if already added! otherwise we would include/patch that file multiple times :(
            List<URL> loadedAntJavaFXLibs = Arrays.asList(sysloader.getURLs()).stream().filter(loadedURL -> {
                return loadedURL.toExternalForm().endsWith(ANT_JAVAFX_JAR_FILENAME);
            }).collect(Collectors.toList());

            boolean alreadyLoaded = loadedAntJavaFXLibs.size() > 0;
            boolean workaroundLoaded = loadedAntJavaFXLibs.stream().filter(libURL -> libURL.toExternalForm().contains(MonkeyPatcher.WORKAROUND_DIRECTORY_NAME)).count() > 0;

            project.getLogger().debug("DEBUG > Having " + loadedAntJavaFXLibs.size() + " loadedJars");

            // only when not loaded
            if( alreadyLoaded == false ){
                List<URL> antJarList = new ArrayList<>();
                if( usePatchedJar ){
                    URL patchedJfxAntJar = MonkeyPatcher.getPatchedJfxAntJar();
                    antJarList.add(patchedJfxAntJar);
                    project.getLogger().info("using patched " + ANT_JAVAFX_JAR_FILENAME + ", located at > " + patchedJfxAntJar.toExternalForm());
                } else {
                    antJarList.add(jfxAntJar.toURI().toURL());
                }
                // I really don't know, why there isn't a direct way to add some File... or just one URL,
                // but: no need to check if jar already was added ;) it's done inside
                org.gradle.internal.classloader.ClasspathUtil.addUrl(sysloader, antJarList);
            } else {
                if( !usePatchedJFXAntLib && workaroundLoaded ){
                    project.getLogger().warn("Please restart gradle-daemon! Patched " + ANT_JAVAFX_JAR_FILENAME + " is loaded, but you disabled to patch and use that file.");
                }
            }
        } catch(MalformedURLException ex){
            throw new GradleException("Could not add Ant-JavaFX-JAR to plugin-classloader", ex);
        }
    }

    protected boolean isGradleDaemonMode() {
        String javaCommand = System.getProperty("sun.java.command");
        return javaCommand != null && javaCommand.startsWith("org.gradle.launcher.daemon");
    }

}


text:
layout: page
title: Vincent Lucas's 98th Birthday
date: 2016-05-24
author: Kathryn Richards
tags: weekly links, java
status: published
summary: Duis congue velit quis purus.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 12/04/2016
  endDate: 12/08/2016
  ctyhocn: SAVATHX
  groupCode: VL9B
published: true
---
Ut sit amet ligula iaculis, varius tortor a, consequat orci. Sed leo est, posuere ac tincidunt ut, pellentesque at leo. In hac habitasse platea dictumst. In cursus porttitor ligula, quis eleifend lorem pulvinar eu. Donec pellentesque non leo et viverra. Pellentesque mattis auctor lacus non congue. Nunc varius lectus non ipsum blandit fermentum. Maecenas eros urna, commodo a nulla et, venenatis suscipit urna. Phasellus lorem nisi, finibus eu tincidunt nec, pharetra in tellus. Curabitur blandit nunc ac auctor congue. Donec sed auctor metus.

1 Mauris porttitor justo in lorem bibendum malesuada
1 Nam faucibus magna eget arcu pellentesque gravida
1 Pellentesque iaculis velit id ante vestibulum malesuada
1 Donec ultricies arcu sit amet magna pharetra, nec aliquet nibh tincidunt.

Praesent et ante metus. Fusce non vehicula lacus. Nunc efficitur, erat nec rhoncus sodales, elit dui fringilla erat, sit amet euismod dui nunc sit amet massa. Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed scelerisque dolor eu tellus sollicitudin, ut vulputate felis condimentum. Curabitur at scelerisque libero, vel mollis arcu. Nulla elementum fringilla lorem et elementum. Nulla pellentesque nec dolor accumsan tincidunt. Aenean hendrerit laoreet purus. Phasellus sollicitudin, odio sit amet luctus vestibulum, arcu mauris condimentum magna, non sagittis neque leo ac sem. Quisque in dolor malesuada, dictum augue et, sagittis nisl. Integer at fermentum sapien. Nulla eu mi a metus faucibus dictum. Vivamus vitae sollicitudin libero. Donec laoreet neque sem, quis rhoncus quam mollis sit amet.


text:
package com.opensymphony.xwork2.validator.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 *
 * This annotation has been deprecated since 2.1 as its previous purpose, to define classes that support annotation validations,
 * is no longer necessary.
 *
 *
 *
 Annotation usage:
 *
 *
 *
The Validation annotation must be applied at Type level.
 *
 *
 *
 Annotation parameters:
 *
 *
 *

 *

 *  Parameter
 *  Required
 *  Default
 *  Notes
 *

 *

 * validations
 * yes
 *
 *
 *

 *

 *
 *
 *
 Example code:
 *
 * An Annotated Interface
 *

 *
 * @Validation()
 * public interface AnnotationDataAware {
 *
 *     void setBarObj(Bar b);
 *
 *     Bar getBarObj();
 *
 *     @RequiredFieldValidator(message = "You must enter a value for data.")
 *     @RequiredStringValidator(message = "You must enter a value for data.")
 *     void setData(String data);
 *
 *     String getData();
 * }
 *
 *

 *
 *
 Example code:
 *
 * An Annotated Class
 *

 *
 * @Validation()
 * public class SimpleAnnotationAction extends ActionSupport {
 *
 *     @RequiredFieldValidator(type = ValidatorType.FIELD, message = "You must enter a value for bar.")
 *     @IntRangeFieldValidator(type = ValidatorType.FIELD, min = "6", max = "10", message = "bar must be between ${min} and ${max}, current value is ${bar}.")
 *     public void setBar(int bar) {
 *         this.bar = bar;
 *     }
 *
 *     public int getBar() {
 *         return bar;
 *     }
 *
 *     @Validations(
 *             requiredFields =
 *                     {@RequiredFieldValidator(type = ValidatorType.SIMPLE, fieldName = "customfield", message = "You must enter a value for field.")},
 *             requiredStrings =
 *                     {@RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "stringisrequired", message = "You must enter a value for string.")},
 *             emails =
 *                     { @EmailValidator(type = ValidatorType.SIMPLE, fieldName = "emailaddress", message = "You must enter a value for email.")},
 *             urls =
 *                     { @UrlValidator(type = ValidatorType.SIMPLE, fieldName = "hreflocation", message = "You must enter a value for email.")},
 *             stringLengthFields =
 *                     {@StringLengthFieldValidator(type = ValidatorType.SIMPLE, trim = true, minLength="10" , maxLength = "12", fieldName = "needstringlength", message = "You must enter a stringlength.")},
 *             intRangeFields =
 *                     { @IntRangeFieldValidator(type = ValidatorType.SIMPLE, fieldName = "intfield", min = "6", max = "10", message = "bar must be between ${min} and ${max}, current value is ${bar}.")},
 *             dateRangeFields =
 *                     {@DateRangeFieldValidator(type = ValidatorType.SIMPLE, fieldName = "datefield", min = "-1", max = "99", message = "bar must be between ${min} and ${max}, current value is ${bar}.")},
 *             expressions = {
 *                 @ExpressionValidator(expression = "foo > 1", message = "Foo must be greater than Bar 1. Foo = ${foo}, Bar = ${bar}."),
 *                 @ExpressionValidator(expression = "foo > 2", message = "Foo must be greater than Bar 2. Foo = ${foo}, Bar = ${bar}."),
 *                 @ExpressionValidator(expression = "foo > 3", message = "Foo must be greater than Bar 3. Foo = ${foo}, Bar = ${bar}."),
 *                 @ExpressionValidator(expression = "foo > 4", message = "Foo must be greater than Bar 4. Foo = ${foo}, Bar = ${bar}."),
 *                 @ExpressionValidator(expression = "foo > 5", message = "Foo must be greater than Bar 5. Foo = ${foo}, Bar = ${bar}.")
 *     }
 *     )
 *     public String execute() throws Exception {
 *         return SUCCESS;
 *     }
 * }
 *
 *
 *

 *
 * @author Rainer Hermanns
 * @deprecated Since Struts 2.1 because it isn't necessary anymore
 * @version $Id: Validation.java 894090 2009-12-27 18:18:29Z martinc $
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Validation {

    /**
     * Used for class or interface validation rules.
     */
    Validations[] validations() default {};
}


text:
package org.apache.flink.table.planner.plan.rules.logical

import org.apache.calcite.plan.hep.HepMatchOrder
import org.apache.calcite.rel.rules.SortProjectTransposeRule
import org.apache.calcite.tools.RuleSets
import org.apache.flink.table.api.SqlParserException
import org.apache.flink.table.planner.plan.nodes.logical.{FlinkLogicalLegacyTableSourceScan, FlinkLogicalSort}
import org.apache.flink.table.planner.plan.optimize.program.{FlinkBatchProgram, FlinkHepRuleSetProgramBuilder, HEP_RULES_EXECUTION_TYPE}
import org.apache.flink.table.planner.utils.{TableConfigUtils, TableTestBase}
import org.junit.{Before, Test}

/**
 * Test for [[PushLimitIntoLegacyTableSourceScanRule]].
 */
class PushLimitIntoLegacyTableSourceScanRuleTest extends TableTestBase {
  protected val util = batchTestUtil()

  @Before
  def setup(): Unit = {
    util.buildBatchProgram(FlinkBatchProgram.DEFAULT_REWRITE)
    val calciteConfig = TableConfigUtils.getCalciteConfig(util.tableEnv.getConfig)
    calciteConfig.getBatchProgram.get.addLast(
      "rules",
      FlinkHepRuleSetProgramBuilder.newBuilder
        .setHepRulesExecutionType(HEP_RULES_EXECUTION_TYPE.RULE_COLLECTION)
        .setHepMatchOrder(HepMatchOrder.BOTTOM_UP)
        .add(RuleSets.ofList(PushLimitIntoLegacyTableSourceScanRule.INSTANCE,
          SortProjectTransposeRule.INSTANCE,
          // converts calcite rel(RelNode) to flink rel(FlinkRelNode)
          FlinkLogicalSort.BATCH_CONVERTER,
          FlinkLogicalLegacyTableSourceScan.CONVERTER))
        .build()
    )

    val ddl =
      s"""
         |CREATE TABLE LimitTable (
         |  a int,
         |  b bigint,
         |  c string
         |) WITH (
         |  'connector.type' = 'TestLimitableTableSource',
         |  'is-bounded' = 'true'
         |)
       """.stripMargin
    util.tableEnv.executeSql(ddl)
  }

  @Test(expected = classOf[SqlParserException])
  def testLimitWithNegativeOffset(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable LIMIT 10 OFFSET -1")
  }

  @Test(expected = classOf[SqlParserException])
  def testNegativeLimitWithoutOffset(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable LIMIT -1")
  }

  @Test(expected = classOf[SqlParserException])
  def testMysqlLimit(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable LIMIT 1, 10")
  }

  @Test
  def testCanPushdownLimitWithoutOffset(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable LIMIT 5")
  }

  @Test
  def testCanPushdownLimitWithOffset(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable LIMIT 10 OFFSET 1")
  }

  @Test
  def testCanPushdownFetchWithOffset(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY")
  }

  @Test
  def testCanPushdownFetchWithoutOffset(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable FETCH FIRST 10 ROWS ONLY")
  }

  @Test
  def testCannotPushDownWithoutLimit(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable OFFSET 10")
  }

  @Test
  def testCannotPushDownWithoutFetch(): Unit = {
    util.verifyPlan("SELECT a, c FROM LimitTable OFFSET 10 ROWS")
  }

  @Test
  def testCannotPushDownWithOrderBy(): Unit = {
    val sqlQuery = "SELECT a, c FROM LimitTable ORDER BY c LIMIT 10"
    util.verifyPlan(sqlQuery)
  }
}


text:
/**
 */
package org.tud.inf.st.mbt.features.provider;

import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;

import org.tud.inf.st.mbt.features.FeaturesPackage;

/**
 * This is the item provider adapter for a {@link org.tud.inf.st.mbt.features.Without} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class WithoutItemProvider
	extends BinarySetOperatorItemProvider
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public WithoutItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

		}
		return itemPropertyDescriptors;
	}

	/**
	 * This returns Without.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/Without"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		return getString("_UI_Without_type");
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);
	}

	/**
	 * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
		Object childFeature = feature;
		Object childObject = child;

		boolean qualify =
			childFeature == FeaturesPackage.Literals.BINARY_SET_OPERATOR__OPERAND1 ||
			childFeature == FeaturesPackage.Literals.BINARY_SET_OPERATOR__OPERAND2;

		if (qualify) {
			return getString
				("_UI_CreateChild_text2",
				 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
		}
		return super.getCreateChildText(owner, feature, child, selection);
	}

}


text:
namespace Teference.Zoho.Api
{
    #region Namespace

    using Newtonsoft.Json;

    #endregion

    internal sealed class ZsSubscriptionJson : ZsErrorJson
    {
        [JsonProperty("subscription")]
        public ZsSubscription Subscription { get; set; }
    }
}


text:
package adv;

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

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.NLineInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.MultipleOutputs;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

import simple.FastaSimpleJob;
import utils.HdfsLoader;

public class FastaAdvancedJob extends Configured implements Tool
{
	private static Log LOG = LogFactory.getLog(FastaAdvancedJob.class);

	public static final String TARGET = "TARGET";
	public static final String INPUT_NAME = "BIGFILE";
	public static final String OUTPUT_NAME = "OUTPUT_";
	public static final String DELIMITATOR = "%";
	public static String ALIGNMENTS_DIR = "ALIGNMENTS_";

	public static final String WORKING_FILE_NAME = "fastamapreduce.working.file";
	public static final String TARGET_CHECKSUM = "fastamapreduce.working.md5";

	public static final String MAPREDUCE_LINE_PER_MAPPER_PROPERTY = "mapreduce.input.lineinputformat.linespermap";
	public static final int MAPREDUCE_LINE_PER_MAPPER = 1;

	public static String cleanOutputName(String s)
	{
		return s.replaceAll(".", "").replaceAll("-", "").replaceAll("_", "");
	}

	@Override
	public int run(String[] args) throws Exception
	{
		GenericOptionsParser parser = new GenericOptionsParser(getConf(), args);
		String[] argv = parser.getRemainingArgs();
		LOG.info("Starting....");
		HdfsLoader loader = HdfsLoader.getInstance().setup(getConf());
		String inputDir = argv[0];
		LOG.info("preparing input....");
		Map<String, String> checksums = HDFSInputHelper.prepareInputFile(inputDir, INPUT_NAME, DELIMITATOR);
		loader.copyOnHdfs(INPUT_NAME, INPUT_NAME);
		LOG.info("input ready....");

		List<String> keys = new ArrayList<String>(checksums.keySet());
		long totalTime = System.currentTimeMillis();
		int numOfFiles = keys.size();
		LOG.info("launching " + numOfFiles + " jobs....");
		for (int i = 0; i < numOfFiles; i++)
		{
			LOG.info("launching job " + i + " of " + numOfFiles + " ....");
			String file = keys.get(i);
			Configuration config = getConf();
			config.setInt(FastaSimpleJob.MAPREDUCE_LINERECORD_LENGTH, Integer.MAX_VALUE);
			Job job = Job.getInstance(config, getClass().getSimpleName());
			config = job.getConfiguration(); // it must be done since it changes after job init

			config.set(WORKING_FILE_NAME, file);
			config.set(TARGET_CHECKSUM, checksums.get(file));

			String outputDir = OUTPUT_NAME + i;
			String alignDir = ALIGNMENTS_DIR + file;

			loader.deleteFromHdfs(TARGET);
			loader.deleteFromHdfs(outputDir);
			loader.deleteFromHdfs(alignDir);
			loader.mkdir(alignDir);
			loader.copyOnHdfs(inputDir + "/" + file, TARGET);

//			job.addCacheFile(new Path(TARGET).toUri());

			job.setJarByClass(FastaAdvancedJob.class);
			job.setMapperClass(FastaAdvMapper.class);
//			job.setCombinerClass(FastaAdvReducer.class);
			job.setReducerClass(FastaAdvReducer.class);

			job.setMapOutputKeyClass(Text.class);
			job.setMapOutputValueClass(Text.class);

			job.setOutputKeyClass(Text.class);
			job.setOutputValueClass(Text.class);

			MultipleOutputs.addNamedOutput(job, checksums.get(file), TextOutputFormat.class, Text.class, Text.class);

			job.setInputFormatClass(NLineInputFormat.class);

			NLineInputFormat.addInputPath(job, new Path(INPUT_NAME));

		    FileOutputFormat.setOutputPath(job, new Path(outputDir));

		    config.setInt(MAPREDUCE_LINE_PER_MAPPER_PROPERTY, MAPREDUCE_LINE_PER_MAPPER);

		    long startTime = System.currentTimeMillis();

		    if (job.waitForCompletion(true))
		    {
		    	LOG.info("Job completed for file [" + file + "] in " + (System.currentTimeMillis() - startTime) + " ms");
		    }
		    else
		    {
		    	LOG.info("Job failed for file [" + file + "] in " + (System.currentTimeMillis() - startTime) + " ms");
		    }
		}

		loader.deleteFromHdfs(TARGET);
    	LOG.info("All jobs[" + numOfFiles + "] completed in " + (System.currentTimeMillis() - totalTime) + " ms");

		return 0;
	}

	public static void main(String[] args)
	{
		int result = -1;
		try
		{
			result = ToolRunner.run(new FastaAdvancedJob(), args);
		}
		catch (Exception e)
		{
			e.printStackTrace();
			System.out.println("Job failed.");
		}
		System.exit(result);
	}

}


text:
package org.traccar.protocol;

import org.traccar.StringProtocolEncoder;
import org.traccar.model.Command;
import org.traccar.Protocol;

public class GranitProtocolSmsEncoder extends StringProtocolEncoder {

    public GranitProtocolSmsEncoder(Protocol protocol) {
        super(protocol);
    }

    @Override
    protected String encodeCommand(Command command) {
        switch (command.getType()) {
        case Command.TYPE_REBOOT_DEVICE:
            return "BB+RESET";
        case Command.TYPE_POSITION_PERIODIC:
            return formatCommand(command, "BB+BBMD=%s", Command.KEY_FREQUENCY);
        default:
            return null;
        }
    }

}


text:
function foo(i, deopt = false) {
    if (i == 0) {
        if (deopt) {
            // Trigger an eager deopt.
            %_DeoptimizeNow();
        }
    } else {
        foo(i - 1, deopt);
    }
}
%PrepareFunctionForOptimization(foo);

%PrepareFunctionForOptimization(foo);
foo(10);
foo(10);
%OptimizeFunctionOnNextCall(foo);
foo(10);

assertOptimized(foo);

foo(10, true);

assertUnoptimized(foo);


text:
import (
    "golang.org/x/net/context"
    "golang.org/x/oauth2"
    "golang.org/x/oauth2/google"
    newappengine "google.golang.org/appengine"
    newurlfetch "google.golang.org/appengine/urlfetch"

    "appengine"
)

var Endpoint = oauth2.Endpoint{
    AuthURL:  "https://www.facebook.com/dialog/oauth",
    TokenURL: "https://graph.facebook.com/oauth/access_token",
}

func handler(w http.ResponseWriter, r *http.Request) {
    var c appengine.Context = appengine.NewContext(r)
    c.Infof("Logging a message with the old package")

    var ctx context.Context = newappengine.NewContext(r)
    client := &http.Client{
        Transport: &oauth2.Transport{
            Source: google.AppEngineTokenSource(ctx, "scope"),
            Base:   &newurlfetch.Transport{Context: ctx},
        },
    }
    client.Get("...")
}


text:
package com.meltmedia.cadmium.core.commands;

import com.meltmedia.cadmium.core.SiteDownService;

public class DummySiteDownService implements SiteDownService {

  public boolean didStart = false;
  public boolean didStop = false;
  public boolean isOn = false;

  @Override
  public void start() {
    didStart = true;
    isOn = true;
  }

  @Override
  public void stop() {
    didStop = true;
    isOn = false;
  }

	@Override
	public boolean isOn() {
		return isOn;
	}

}


text:
#include "DataLayer.h"

namespace paddle {

REGISTER_LAYER(data, DataLayer);

void DataLayer::copyDataToOutput(Argument& output) {
  if (output.deviceId == data_.deviceId) {
    output.value = data_.value;
    output.in = data_.in;
    output.grad = data_.grad;
    output.ids = data_.ids;
  } else {
    SetDevice device(output.deviceId);
    if (data_.value) {
      if (!output.value) {
        output.value = data_.value->clone(data_.value->getHeight(),
                                          data_.value->getWidth(),
                                          useGpu(output.deviceId));
      } else {
        output.value->resize(data_.value->getHeight(), data_.value->getWidth());
      }
      output.value->copyFrom(*data_.value);
    }
    if (data_.grad) {
      Matrix::resizeOrCreate(output.grad,
                             data_.grad->getHeight(),
                             data_.grad->getWidth(),
                             /* trans= */ false,
                             useGpu(output.deviceId));
    }
    if (data_.ids) {
      IVector::resizeOrCreate(
          output.ids, data_.ids->getSize(), useGpu(output.deviceId));
      output.ids->copyFrom(*data_.ids);
    }
  }
  if (config_.height() && config_.width()) {
    output.setFrameHeight(config_.height());
    output.setFrameWidth(config_.width());
  } else {
    output.setFrameHeight(data_.getFrameHeight());
    output.setFrameWidth(data_.getFrameWidth());
  }
  output.cpuSequenceDims = data_.cpuSequenceDims;
  output.sequenceStartPositions = data_.sequenceStartPositions;
  output.subSequenceStartPositions = data_.subSequenceStartPositions;
  output.strs = data_.strs;

  output.notifyValueReady();
}

}  // namespace paddle


text:
<widget id="dc:" xmlns="http://www.w3.org/ns/widgets">
  <name>dc</name>
  <content src="index.php"  type="text/html"/>
</widget>


text:
package com.siyeh.ig.classlayout;

import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;

public class ClassWithOnlyPrivateConstructorsInspectionTest extends LightInspectionTestCase {

  public void testSimple() {
    doTest("class /*Class 'X' with only 'private' constructors should be declared 'final'*/X/**/ {" +
           "  private X() {}" +
           "  private X(int i) {}" +
           "}");
  }

  public void testExtendingInnerClass() {
    doTest("class X {\n" +
           "  private X() {}\n" +
           "  class Y {\n" +
           "    class Z extends X{}\n" +
           "  }\n" +
           "}");
  }

  public void testNoConstructors() {
    doTest("class X {}");
  }

  public void testNoWarnOnFinalClass() {
    doTest("final class X {" +
           "  private X() {}" +
           "}");
  }

  public void testEnum() {
    doTest("enum Currencies {\n" +
           "    EURO, DOLLAR;\n" +
           "    private Currencies() {\n" +
           "    }\n" +
           "}");
  }

  public void testPublicConstructor() {
    doTest("class A {" +
           "  public A() {}" +
           "}");
  }

  @Nullable
  @Override
  protected InspectionProfileEntry getInspection() {
    return new ClassWithOnlyPrivateConstructorsInspection();
  }
}


text:
https://education.github.com

https://github.blog/2020-03-18-set-up-your-digital-classroom-with-github-classroom/ (utilise github actions pour noter les élèves)

- [x] You'll need to designate an administrator to set-up and maintain GitHub at your school.
- [x] If you're new to GitHub.com (GitHub Enterprise Cloud), you'll need to make an Organization and choose the 'Enterprise' plan.
      The GitHub.com URL linking to your organization will need to be included in your GitHub Campus Program application.
- [x] Have an authorized individual sign the GitHub Campus Program Order Form.
- [x] Please upload the completed Order Form (attached), along with a logo we can feature on the GitHub site,
      through our GitHub Campus Program Application.

## :one: Github Learning Lab

[s'enregistrer à => ](1.Github-Learning-Lab/0.Installation)

## :two: Github Campus Advisors

[s'enregistrer à => ](2.Campus-Advisors)

## :three: Visualizing Git

http://git-school.github.io/visualizing-git/

# :four: Github University 2020

https://github.com/education/github-university-2020

# :five: Github ClassRoom 2020 Report

https://education.github.com/classroom-report/2020


text:
from os.path import join

import bzt

from bzt.modules.aggregator import DataPoint, KPISet
from bzt.modules.k6 import K6Executor, K6LogReader
from bzt.utils import EXE_SUFFIX
from tests.unit import BZTestCase, ExecutorTestCase, RESOURCES_DIR, ROOT_LOGGER

TOOL_NAME = join(RESOURCES_DIR, "k6", "k6_mock" + EXE_SUFFIX)
K6_SCRIPT = join(RESOURCES_DIR, "k6", "k6_script.js")

class TestK6Executor(ExecutorTestCase):
    EXECUTOR = K6Executor
    CMD_LINE = None

    def start_subprocess(self, args, **kwargs):
        self.CMD_LINE = " ".join(args)

    def test_full(self):
        self.configure({"execution": {
            "concurrency": 5,
            "hold-for": "30",
            "iterations": 50,
            "scenario": {"script": K6_SCRIPT}}})

        tmp_eac = bzt.utils.exec_and_communicate
        try:
            bzt.utils.exec_and_communicate = lambda *args, **kwargs: ("", "")
            self.obj.prepare()
        finally:
            bzt.utils.exec_and_communicate = tmp_eac

        self.obj.get_widget()
        self.obj.k6.tool_name = TOOL_NAME
        self.obj.startup()
        self.obj.check()
        self.obj.shutdown()
        self.obj.post_process()

    def simple_run(self, config):
        self.configure(config)

        tmp_eac = bzt.utils.exec_and_communicate
        try:
            bzt.utils.exec_and_communicate = lambda *args, **kwargs: ("", "")
            self.obj.prepare()
        finally:
            bzt.utils.exec_and_communicate = tmp_eac

        self.obj.engine.start_subprocess = self.start_subprocess
        self.obj.startup()
        self.obj.post_process()

    def test_kpi_file(self):
        self.simple_run({
            "execution": {
                "scenario": {"script": K6_SCRIPT},
                "executor": "k6"
            },
        })
        self.assertIn(f"--out csv={self.obj.kpi_file}", self.CMD_LINE)

    def test_concurrency(self):
        self.simple_run({
            "execution": {
                "concurrency": "5",
                "scenario": {"script": K6_SCRIPT},
                "executor": "k6"
            },
        })
        self.assertIn("--vus 5", self.CMD_LINE)

    def test_hold_for(self):
        self.simple_run({
            "execution": {
                "hold-for": "30",
                "scenario": {"script": K6_SCRIPT},
                "executor": "k6"
            },
        })
        self.assertIn("--duration 30s", self.CMD_LINE)

    def test_iterations(self):
        self.simple_run({
            "execution": {
                "iterations": "100",
                "scenario": {"script": K6_SCRIPT},
                "executor": "k6"
            },
        })
        self.assertIn("--iterations 100", self.CMD_LINE)

    def test_iterations_multiplied(self):
        self.simple_run({
            "execution": {
                "iterations": "10",
                "concurrency": "10",
                "scenario": {"script": K6_SCRIPT},
                "executor": "k6"
            },
        })
        self.assertIn("--iterations 100", self.CMD_LINE)

class TestK6Reader(BZTestCase):
    def test_read(self):
        log_path = join(RESOURCES_DIR, "k6", "k6_kpi.csv")
        obj = K6LogReader(log_path, ROOT_LOGGER)
        points = list(obj.datapoints(True))

        self.assertEqual(len(points), 4)

        for datapoint in points:
            self.assertTrue(datapoint['ts'] > 1500000000)
        self.assertEqual(points[-1][DataPoint.CUMULATIVE][''][KPISet.SUCCESSES], 2)
        self.assertEqual(points[-1][DataPoint.CUMULATIVE][''][KPISet.FAILURES], 2)


text:
namespace content {
namespace {

const int kMinimumDelayBetweenUpdatesMS = 100;

// This matches what blink's ProgrssTracker has traditionally used for a
// minimum progress value.
const double kMinimumProgress = 0.1;

}

LoadProgressTracker::LoadProgressTracker(RenderViewImpl* render_view)
    : render_view_(render_view),
      total_progress_(0.0),
      weak_factory_(this) {
}

LoadProgressTracker::~LoadProgressTracker() {
}

void LoadProgressTracker::DidStartLoading(int frame_routing_id) {
  progresses_[frame_routing_id] = kMinimumProgress;
  SendChangeLoadProgress();
}

void LoadProgressTracker::DidStopLoading(int frame_routing_id) {
  if (progresses_.find(frame_routing_id) == progresses_.end())
    return;

  // Load stopped while we were still tracking load.  Make sure we update
  // progress based on this frame's completion.
  progresses_[frame_routing_id] = 1.0;
  SendChangeLoadProgress();
  // Then we clean-up our states.
  if (total_progress_ == 1.0)
    ResetStates();
}

void LoadProgressTracker::DidChangeLoadProgress(int frame_routing_id,
                                                double progress) {
  progresses_[frame_routing_id] = progress;

  // We send the progress change to the browser immediately for the first and
  // last updates.  Also, since the message loop may be pretty busy when a page
  // is loaded, it might not execute a posted task in a timely manner so we make
  // sure to immediately send progress report if enough time has passed.
  base::TimeDelta min_delay =
      base::TimeDelta::FromMilliseconds(kMinimumDelayBetweenUpdatesMS);
  if (progress == 1.0 || last_time_progress_sent_.is_null() ||
      base::TimeTicks::Now() - last_time_progress_sent_ > min_delay) {
    // If there is a pending task to send progress, it is now obsolete.
    weak_factory_.InvalidateWeakPtrs();
    SendChangeLoadProgress();
    if (total_progress_ == 1.0)
      ResetStates();
    return;
  }

  if (weak_factory_.HasWeakPtrs())
    return;

  base::MessageLoop::current()->PostDelayedTask(
      FROM_HERE,
      base::Bind(&LoadProgressTracker::SendChangeLoadProgress,
                 weak_factory_.GetWeakPtr()),
      min_delay);
}

void LoadProgressTracker::SendChangeLoadProgress() {
  last_time_progress_sent_ = base::TimeTicks::Now();
  double progress = 0.0;
  unsigned frameCount = 0;
  ProgressMap::iterator end = progresses_.end();
  for (ProgressMap::iterator it = progresses_.begin(); it != end; ++it) {
    progress += it->second;
    frameCount++;
  }
  if (frameCount == 0)
    return;
  progress /= frameCount;
  DCHECK(progress <= 1.0);

  if (progress <= total_progress_)
    return;
  total_progress_ = progress;

  render_view_->Send(
      new ViewHostMsg_DidChangeLoadProgress(render_view_->routing_id(),
                                            progress));
}

void LoadProgressTracker::ResetStates() {
  progresses_.clear();
  total_progress_ = 0.0;
  weak_factory_.InvalidateWeakPtrs();
  last_time_progress_sent_ = base::TimeTicks();
}

}  // namespace content


text:
<?php

    require_once __DIR__.'/core/lib/Twig/Autoloader.php';
    Twig_Autoloader::register();

    /* DEBUG ONLY */
    define('TwigPress_Debug', true);
    define('TwigPress_Template_URI', get_stylesheet_directory_uri().'/templates');

    class WP_API_Proxy{
        /*
            Description: Proxy Wordpress APIs so they could be available to Twig without mapping them.
            Based upon: Darko Goles (http://inchoo.net/wordpress/twig-wordpress-part2/)
        */
        public function __call($function,$arguments) {
            if (!function_exists($function)) {
                trigger_error('['.get_class(self).'] '.'function ['.$function.'] do not exist. Is it a Wordpress API?',E_USER_ERROR);
                return NULL;
            }
            return call_user_func_array($function,$arguments);
        }
    }

    class TwigPress_API_Proxy{
        public function __call($function,$arguments) {
            if (!function_exists($function)) {
                trigger_error('['.get_class(self).'] '.'function ['.$function.'] do not exist. Is it a Wordpress API?',E_USER_ERROR);
                return NULL;
            }
            return call_user_func_array($function,$arguments);
        }
        /* APIs */
        public function addCss($path){
            $hash = md5(TwigPress_Template_URI.$path);
            wp_register_style($hash,TwigPress_Template_URI.$path);
            wp_enqueue_style($hash);
        }
        public function addJs($path){
            $hash = md5(TwigPress_Template_URI.$path);
            wp_register_script($hash,TwigPress_Template_URI.$path);
            wp_enqueue_script($hash);
        }
    }

    class TwigPress{
        protected $apis;
        protected $twig;
        function __construct($args = array()){
            $loader = new Twig_Loader_Filesystem(get_stylesheet_directory().'/templates');
            $this->twig = new Twig_Environment($loader, array(
                'cache' => TwigPress_Debug ? false : get_stylesheet_directory().'/cache',
                'debug' => TwigPress_Debug
            ));
            if(TwigPress_Debug) $this->twig->addExtension(new Twig_Extension_Debug());
            $this->render(get_current_template(),$args['vars']);
        }
        protected function render($name,$tpl_vars = array()){
            if(isset($name)){
                $this->set_base_api('fn', new TwigPress_API_Proxy());
                $this->set_base_api('template_name',$name);

                $template = $this->twig->loadTemplate($name.'.twig');
                echo $template->render($this->init_apis($tpl_vars));
            }else $this->display_error('No template specified.');
        }
        protected function init_apis($tpl_vars = array()){
            $core_vars = array(
                "twpapi" => $this->get_base_api(),
                "wpapi" => new WP_API_Proxy(),
                "tplapi" => $tpl_vars
            );

            return $core_vars;
        }
        protected function get_base_api(){
            $this->set_base_api('base_uri',TwigPress_Template_URI);
            return $this->apis;
        }
        protected function set_base_api($key,$value){
            $this->apis[$key] = $value;
        }
        /* UTILITY */
        protected function display_error($error){
            trigger_error('['.get_class($this).'] '.$error,E_USER_ERROR);
        }
    }

    /*
        Description: get the current requested template
        URL: http://wordpress.stackexchange.com/questions/10537/get-name-of-the-current-template-file/10565#10565
    */
    add_filter('template_include','var_template_include');
    function var_template_include($t){
        $tpl_path = pathinfo($t);
        $GLOBALS['current_theme_template'] = $tpl_path['filename'];
        return $t;
    }
    function get_current_template(){
        if(!isset($GLOBALS['current_theme_template'])) return false;
        return $GLOBALS['current_theme_template'];
    }


text:
package com.hpe.caf.config.file;

import com.hpe.caf.api.BootstrapConfiguration;
import com.hpe.caf.api.Cipher;
import com.hpe.caf.api.ConfigurationException;
import com.hpe.caf.api.ConfigurationSourceProvider;
import com.hpe.caf.api.Decoder;
import com.hpe.caf.api.ManagedConfigurationSource;
import com.hpe.caf.naming.ServicePath;

public class FileConfigurationSourceProvider implements ConfigurationSourceProvider
{
    @Override
    public ManagedConfigurationSource getConfigurationSource(final BootstrapConfiguration bootstrapProvider, final Cipher cipher,
                                                             final ServicePath servicePath, final Decoder decoder)
        throws ConfigurationException
    {
        return new FileConfigurationSource(bootstrapProvider, cipher, servicePath, decoder);
    }
}


text:
Official golang implementation of the Ethereum protocol.

[![API Reference](
https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667
)](https://godoc.org/github.com/ethereum/go-ethereum)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

Automated builds are available for stable releases and the unstable master branch.
Binary archives are published at https://geth.ethereum.org/downloads/.

## Building the source

For prerequisites and detailed build instructions please read the
[Installation Instructions](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum)
on the wiki.

Building geth requires both a Go (version 1.7 or later) and a C compiler.
You can install them using your favourite package manager.
Once the dependencies are installed, run

    make geth

or, to build the full suite of utilities:

    make all

## Executables

The go-ethereum project comes with several wrappers/executables found in the `cmd` directory.

| Command    | Description |
|:----------:|-------------|
| **`geth`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default) archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `geth --help` and the [CLI Wiki page](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) for command line options |
| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) with expanded functionality if the contract bytecode is also available. However it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) wiki page for details. |
| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
| `disasm` | Bytecode disassembler to convert EVM (Ethereum Virtual Machine) bytecode into more user friendly assembly-like opcodes (e.g. `echo "6001" | disasm`). For details on the individual opcodes, please see pages 22-30 of the [Ethereum Yellow Paper](http://gavwood.com/paper.pdf). |
| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow insolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). |
| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereum/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/ethereum/rpc-tests/blob/master/README.md) for details. |
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
| `swarm`    | swarm daemon and tools. This is the entrypoint for the swarm network. `swarm --help` for command line options and subcommands. See https://swarm-guide.readthedocs.io for swarm documentation. |

## Running geth

Going through all the possible command line flags is out of scope here (please consult our
[CLI Wiki page](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options)), but we've
enumerated a few common parameter combos to get you up to speed quickly on how you can run your
own Geth instance.

### Full node on the main Ethereum network

By far the most common scenario is people wanting to simply interact with the Ethereum network:
create accounts; transfer funds; deploy and interact with contracts. For this particular use-case
the user doesn't care about years-old historical data, so we can fast-sync quickly to the current
state of the network. To do so:

```
$ geth --fast --cache=512 console
```

This command will:

 * Start geth in fast sync mode (`--fast`), causing it to download more data in exchange for avoiding
   processing the entire history of the Ethereum network, which is very CPU intensive.
 * Bump the memory allowance of the database to 512MB (`--cache=512`), which can help significantly in
   sync times especially for HDD users. This flag is optional and you can set it as high or as low as
   you'd like, though we'd recommend the 512MB - 2GB range.
 * Start up Geth's built-in interactive [JavaScript console](https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console),
   (via the trailing `console` subcommand) through which you can invoke all official [`web3` methods](https://github.com/ethereum/wiki/wiki/JavaScript-API)
   as well as Geth's own [management APIs](https://github.com/ethereum/go-ethereum/wiki/Management-APIs).
   This too is optional and if you leave it out you can always attach to an already running Geth instance
   with `geth --attach`.

### Full node on the Ethereum test network

Transitioning towards developers, if you'd like to play around with creating Ethereum contracts, you
almost certainly would like to do that without any real money involved until you get the hang of the
entire system. In other words, instead of attaching to the main network, you want to join the **test**
network with your node, which is fully equivalent to the main network, but with play-Ether only.

```
$ geth --testnet --fast --cache=512 console
```

The `--fast`, `--cache` flags and `console` subcommand have the exact same meaning as above and they
are equially useful on the testnet too. Please see above for their explanations if you've skipped to
here.

Specifying the `--testnet` flag however will reconfigure your Geth instance a bit:

 * Instead of using the default data directory (`~/.ethereum` on Linux for example), Geth will nest
   itself one level deeper into a `testnet` subfolder (`~/.ethereum/testnet` on Linux).
 * Instead of connecting the main Ethereum network, the client will connect to the test network,
   which uses different P2P bootnodes, different network IDs and genesis states.

*Note: Although there are some internal protective measures to prevent transactions from crossing
over between the main network and test network (different starting nonces), you should make sure to
always use separate accounts for play-money and real-money. Unless you manually move accounts, Geth
will by default correctly separate the two networks and will not make any accounts available between
them.*

#### Docker quick start

One of the quickest ways to get Ethereum up and running on your machine is by using Docker:

```
docker run -d --name ethereum-node -v /Users/alice/ethereum:/root \
           -p 8545:8545 -p 30303:30303 \
           ethereum/client-go --fast --cache=512
```

This will start geth in fast sync mode with a DB memory allowance of 512MB just as the above command does.  It will also create a persistent volume in your home directory for saving your blockchain as well as map the default ports. There is also an `alpine` tag available for a slim version of the image.

### Programatically interfacing Geth nodes

As a developer, sooner rather than later you'll want to start interacting with Geth and the Ethereum
network via your own programs and not manually through the console. To aid this, Geth has built in
support for a JSON-RPC based APIs ([standard APIs](https://github.com/ethereum/wiki/wiki/JSON-RPC) and
[Geth specific APIs](https://github.com/ethereum/go-ethereum/wiki/Management-APIs)). These can be
exposed via HTTP, WebSockets and IPC (unix sockets on unix based platforms, and named pipes on Windows).

The IPC interface is enabled by default and exposes all the APIs supported by Geth, whereas the HTTP
and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons.
These can be turned on/off and configured as you'd expect.

HTTP based JSON-RPC API options:

  * `--rpc` Enable the HTTP-RPC server
  * `--rpcaddr` HTTP-RPC server listening interface (default: "localhost")
  * `--rpcport` HTTP-RPC server listening port (default: 8545)
  * `--rpcapi` API's offered over the HTTP-RPC interface (default: "eth,net,web3")
  * `--rpccorsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
  * `--ws` Enable the WS-RPC server
  * `--wsaddr` WS-RPC server listening interface (default: "localhost")
  * `--wsport` WS-RPC server listening port (default: 8546)
  * `--wsapi` API's offered over the WS-RPC interface (default: "eth,net,web3")
  * `--wsorigins` Origins from which to accept websockets requests
  * `--ipcdisable` Disable the IPC-RPC server
  * `--ipcapi` API's offered over the IPC-RPC interface (default: "admin,debug,eth,miner,net,personal,shh,txpool,web3")
  * `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it)

You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect
via HTTP, WS or IPC to a Geth node configured with the above flags and you'll need to speak [JSON-RPC](http://www.jsonrpc.org/specification)
on all transports. You can reuse the same connection for multiple requests!

**Note: Please understand the security implications of opening up an HTTP/WS based transport before
doing so! Hackers on the internet are actively trying to subvert Ethereum nodes with exposed APIs!
Further, all browser tabs can access locally running webservers, so malicious webpages could try to
subvert locally available APIs!**

### Operating a private network

Maintaining your own private network is more involved as a lot of configurations taken for granted in
the official networks need to be manually set up.

#### Defining the private genesis state

First, you'll need to create the genesis state of your networks, which all nodes need to be aware of
and agree upon. This consists of a small JSON file (e.g. call it `genesis.json`):

```json
{
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x20000",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}
```

The above fields should be fine for most purposes, although we'd recommend changing the `nonce` to
some random value so you prevent unknown remote nodes from being able to connect to you. If you'd
like to pre-fund some accounts for easier testing, you can populate the `alloc` field with account
configs:

```json
"alloc": {
  "0x0000000000000000000000000000000000000001": {"balance": "111111111"},
  "0x0000000000000000000000000000000000000002": {"balance": "222222222"}
}
```

With the genesis state defined in the above JSON file, you'll need to initialize **every** Geth node
with it prior to starting it up to ensure all blockchain parameters are correctly set:

```
$ geth init path/to/genesis.json
```

#### Creating the rendezvous point

With all nodes that you want to run initialized to the desired genesis state, you'll need to start a
bootstrap node that others can use to find each other in your network and/or over the internet. The
clean way is to configure and run a dedicated bootnode:

```
$ bootnode --genkey=boot.key
$ bootnode --nodekey=boot.key
```

With the bootnode online, it will display an [`enode` URL](https://github.com/ethereum/wiki/wiki/enode-url-format)
that other nodes can use to connect to it and exchange peer information. Make sure to replace the
displayed IP address information (most probably `[::]`) with your externally accessible IP to get the
actual `enode` URL.

*Note: You could also use a full fledged Geth node as a bootnode, but it's the less recommended way.*

#### Starting up your member nodes

With the bootnode operational and externally reachable (you can try `telnet <ip> <port>` to ensure
it's indeed reachable), start every subsequent Geth node pointed to the bootnode for peer discovery
via the `--bootnodes` flag. It will probably also be desirable to keep the data directory of your
private network separated, so do also specify a custom `--datadir` flag.

```
$ geth --datadir=path/to/custom/data/folder --bootnodes=<bootnode-enode-url-from-above>
```

*Note: Since your network will be completely cut off from the main and test networks, you'll also
need to configure a miner to process transactions and create new blocks for you.*

#### Running a private miner

Mining on the public Ethereum network is a complex task as it's only feasible using GPUs, requiring
an OpenCL or CUDA enabled `ethminer` instance. For information on such a setup, please consult the
[EtherMining subreddit](https://www.reddit.com/r/EtherMining/) and the [Genoil miner](https://github.com/Genoil/cpp-ethereum)
repository.

In a private network setting however, a single CPU miner instance is more than enough for practical
purposes as it can produce a stable stream of blocks at the correct intervals without needing heavy
resources (consider running on a single thread, no need for multiple ones either). To start a Geth
instance for mining, run it with all your usual flags, extended by:

```
$ geth <usual-flags> --mine --minerthreads=1 --etherbase=0x0000000000000000000000000000000000000000
```

Which will start mining bocks and transactions on a single CPU thread, crediting all proceedings to
the account specified by `--etherbase`. You can further tune the mining by changing the default gas
limit blocks converge to (`--targetgaslimit`) and the price transactions are accepted at (`--gasprice`).

## Contribution

Thank you for considering to help out with the source code! We welcome contributions from
anyone on the internet, and are grateful for even the smallest of fixes!

If you'd like to contribute to go-ethereum, please fork, fix, commit and send a pull request
for the maintainers to review and merge into the main code base. If you wish to submit more
complex changes though, please check up with the core devs first on [our gitter channel](https://gitter.im/ethereum/go-ethereum)
to ensure those changes are in line with the general philosophy of the project and/or get some
early feedback which can make both your efforts much lighter as well as our review and merge
procedures quick and simple.

Please make sure your contributions adhere to our coding guidelines:

 * Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
 * Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
 * Pull requests need to be based on and opened against the `master` branch.
 * Commit messages should be prefixed with the package(s) they modify.
   * E.g. "eth, rpc: make trace configs optional"

Please see the [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)
for more details on configuring your environment, managing project dependencies and testing procedures.

## License

The go-ethereum library (i.e. all code outside of the `cmd` directory) is licensed under the
[GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html), also
included in our repository in the `COPYING.LESSER` file.

The go-ethereum binaries (i.e. all code inside of the `cmd` directory) is licensed under the
[GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html), also included
in our repository in the `COPYING` file.


text:
[@concord-consortium/interactive-api-host](../README.md) › [Globals](../globals.md) › [ITextDecorationHandlerInfo](itextdecorationhandlerinfo.md)

# Interface: ITextDecorationHandlerInfo

## Hierarchy

* ITextDecorationBaseInfo

  ↳ **ITextDecorationHandlerInfo**

## Index

### Properties

* [eventListeners](itextdecorationhandlerinfo.md#eventlisteners)
* [replace](itextdecorationhandlerinfo.md#replace)
* [wordClass](itextdecorationhandlerinfo.md#wordclass)
* [words](itextdecorationhandlerinfo.md#words)

## Properties

###  eventListeners

• **eventListeners**: *IEventListeners*

___

###  replace

• **replace**: *string*

*Inherited from [ITextDecorationInfo](itextdecorationinfo.md).[replace](itextdecorationinfo.md#replace)*

___

###  wordClass

• **wordClass**: *string*

*Inherited from [ITextDecorationInfo](itextdecorationinfo.md).[wordClass](itextdecorationinfo.md#wordclass)*

___

###  words

• **words**: *string[]*

*Inherited from [ITextDecorationInfo](itextdecorationinfo.md).[words](itextdecorationinfo.md#words)*


text:
package uz.greenwhite.slidingmenu.support.v10.service.life_cycle;

public final class ActivityLife {

    public static final ActivityLife instance = new ActivityLife();

    private int lifeCycle;

    public void onStart() {
        this.lifeCycle = LifeCycle.START;
    }

    public void onStop() {
        this.lifeCycle = LifeCycle.STOP;
    }

    public int getState() {
        return this.lifeCycle;
    }
}


text:
package org.elasticsearch.action.admin.indices.optimize;

import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;

import java.io.IOException;

/**
 * A request to optimize one or more indices. In order to optimize on all the indices, pass an empty array or
 * <tt>null</tt> for the indices.
 *

 *
{@link #waitForMerge(boolean)} allows to control if the call will block until the optimize completes and
 * defaults to <tt>true</tt>.
 *

 *
{@link #maxNumSegments(int)} allows to control the number of segments to optimize down to. By default, will
 * cause the optimize process to optimize down to half the configured number of segments.
 *
 *
 * @see org.elasticsearch.client.Requests#optimizeRequest(String...)
 * @see org.elasticsearch.client.IndicesAdminClient#optimize(OptimizeRequest)
 * @see OptimizeResponse
 */
public class OptimizeRequest extends BroadcastOperationRequest {

    public static final class Defaults {
        public static final boolean WAIT_FOR_MERGE = true;
        public static final int MAX_NUM_SEGMENTS = -1;
        public static final boolean ONLY_EXPUNGE_DELETES = false;
        public static final boolean FLUSH = true;
        public static final boolean REFRESH = true;
    }

    private boolean waitForMerge = Defaults.WAIT_FOR_MERGE;

    private int maxNumSegments = Defaults.MAX_NUM_SEGMENTS;

    private boolean onlyExpungeDeletes = Defaults.ONLY_EXPUNGE_DELETES;

    private boolean flush = Defaults.FLUSH;

    private boolean refresh = Defaults.FLUSH;

    /**
     * Constructs an optimization request over one or more indices.
     *
     * @param indices The indices to optimize, no indices passed means all indices will be optimized.
     */
    public OptimizeRequest(String... indices) {
        super(indices);
        // we want to do the optimize in parallel on local shards...
        operationThreading(BroadcastOperationThreading.THREAD_PER_SHARD);
    }

    public OptimizeRequest() {

    }

    @Override
    public OptimizeRequest listenerThreaded(boolean threadedListener) {
        super.listenerThreaded(threadedListener);
        return this;
    }

    @Override
    public OptimizeRequest operationThreading(BroadcastOperationThreading operationThreading) {
        super.operationThreading(operationThreading);
        return this;
    }

    /**
     * Should the call block until the optimize completes. Defaults to <tt>true</tt>.
     */
    public boolean waitForMerge() {
        return waitForMerge;
    }

    /**
     * Should the call block until the optimize completes. Defaults to <tt>true</tt>.
     */
    public OptimizeRequest waitForMerge(boolean waitForMerge) {
        this.waitForMerge = waitForMerge;
        return this;
    }

    /**
     * Will optimize the index down to <= maxNumSegments. By default, will cause the optimize
     * process to optimize down to half the configured number of segments.
     */
    public int maxNumSegments() {
        return maxNumSegments;
    }

    /**
     * Will optimize the index down to <= maxNumSegments. By default, will cause the optimize
     * process to optimize down to half the configured number of segments.
     */
    public OptimizeRequest maxNumSegments(int maxNumSegments) {
        this.maxNumSegments = maxNumSegments;
        return this;
    }

    /**
     * Should the optimization only expunge deletes from the index, without full optimization.
     * Defaults to full optimization (<tt>false</tt>).
     */
    public boolean onlyExpungeDeletes() {
        return onlyExpungeDeletes;
    }

    /**
     * Should the optimization only expunge deletes from the index, without full optimization.
     * Defaults to full optimization (<tt>false</tt>).
     */
    public OptimizeRequest onlyExpungeDeletes(boolean onlyExpungeDeletes) {
        this.onlyExpungeDeletes = onlyExpungeDeletes;
        return this;
    }

    /**
     * Should flush be performed after the optimization. Defaults to <tt>true</tt>.
     */
    public boolean flush() {
        return flush;
    }

    /**
     * Should flush be performed after the optimization. Defaults to <tt>true</tt>.
     */
    public OptimizeRequest flush(boolean flush) {
        this.flush = flush;
        return this;
    }

    /**
     * Should refresh be performed after the optimization. Defaults to <tt>true</tt>.
     */
    public boolean refresh() {
        return refresh;
    }

    /**
     * Should refresh be performed after the optimization. Defaults to <tt>true</tt>.
     */
    public OptimizeRequest refresh(boolean refresh) {
        this.refresh = refresh;
        return this;
    }

    public void readFrom(StreamInput in) throws IOException {
        super.readFrom(in);
        waitForMerge = in.readBoolean();
        maxNumSegments = in.readInt();
        onlyExpungeDeletes = in.readBoolean();
        flush = in.readBoolean();
        refresh = in.readBoolean();
    }

    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        out.writeBoolean(waitForMerge);
        out.writeInt(maxNumSegments);
        out.writeBoolean(onlyExpungeDeletes);
        out.writeBoolean(flush);
        out.writeBoolean(refresh);
    }
}


text:
title:  Jesus, troens opphavsmann og fullender
date:  05/03/2022
---

### Bakgrunnsstoff
Hebr 10,35–39, Rom 1,17, Hebr 11, Jos 2,9–11, Hebr 12,1–3

>
Minnevers

> Med blikket festet på ham som er troens opphavsmann og fullender, Jesus. For å få den gleden han hadde i vente, holdt han ut på korset uten å bry seg om skammen, og nå har han satt seg på høyre side av Guds trone (Hebr 12,2).

Hebr 11 og 12 er trolig bokens mest populære kapitler. De beskriver kristenlivet som et løp der vi alle deltar og der alle trofaste vil få belønningen. De beskriver også frelsens drama som et løp der fortidens troshelter holdt ut til tross for lidelser og uten at de ennå har mottatt belønningen.

Og det er fordi historien ender med oss også, ikke bare dem. Vi er i siste akt. Dramaet kulminerer med at vi går inn og løper den siste etappen, og med Jesus sittende ved mållinjen ved Guds høyre hånd. Han oppmuntrer oss og er det store forbildet på hvordan vi skal fullføre løpet. Han er det store vitnet om at belønningen er reell, og han er forløperen som åpner veien for oss (6,19–20; 10,19–23).

Hebr 11 forklarer at tro er tillit til Guds løfter, selv om vi ikke kan se oppfyllelsen ennå. Dette studiet vil se på hva tro er og hvordan vi får den gjennom eksemplene fra fortiden, men spesielt gjennom Jesu eksempel, «troens opphavsmann og fullender» (Hebr 12,2).


text:
<html>
<head>
<style>
p.special:before { content: "Special: " }
p.special:first-letter { color: #ffd800; }
p.special:after { content: "[The End]" }
</style>
<head>
<body>
<p class="special">
The "S" to the left should be gold.  This is testing :before used in conjunction with :first-letter.
</p>


text:
package com.yahoo.yqlplus.engine.internal.bytecode;

import com.yahoo.yqlplus.engine.internal.compiler.CodeEmitter;
import com.yahoo.yqlplus.engine.internal.compiler.EvaluatedExpression;
import com.yahoo.yqlplus.engine.internal.plan.types.TypeWidget;
import com.yahoo.yqlplus.engine.internal.plan.types.base.BaseTypeExpression;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;

final class EnumConstant extends BaseTypeExpression implements EvaluatedExpression {
    private final Enum value;

    EnumConstant(TypeWidget type, Enum value) {
        super(type);
        this.value = value;
    }

    @Override
    public void generate(CodeEmitter environment) {
        environment.getMethodVisitor().visitFieldInsn(Opcodes.GETSTATIC, Type.getInternalName(value.getDeclaringClass()), value.name(), Type.getDescriptor(value.getDeclaringClass()));
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.github.tgits</groupId>
	<artifactId>basic-algorithmic-workouts</artifactId>
	<packaging>jar</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>basic-algorithmic-workouts</name>
	<url>http://maven.apache.org</url>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>


text:
require 'test_helper'
require 'headless'

class SortTest < ActionDispatch::IntegrationTest
  def setup
    use_driver(:selenium)
  end

  # test "dropdown shows sort links" do
  #   user = login
  #   visit books_path
  #   assert { page.has_selector? "a.sort_dropdown" }
  #   assert { page.has_no_selector? "li.sort_link" }
  #   find("a.sort_dropdown").click
  #   assert { page.has_selector? "li.sort_link"}
  #   assert { page.has_selector? "a#alphabetically"}
  #   assert { page.has_selector? "a#date_added"}
  #   assert { page.has_selector? "a#year_published"}
  #   assert { page.has_selector? "a#most_popular"}
  #   assert { page.has_no_selector? "a.reverse_order"}
  #   find("a#alphabetically").click
  #   assert { page.has_selector? "a.reverse_order"}
  # end
  #
  # test "books can be sorted alphabetically" do
  #   user = login
  #   visit books_path
  #   find("a.sort_dropdown").click
  #   find("#alphabetically").click
  #   alpha_titles = page.all('.title')
  #   assert_equal "AMyString", alpha_titles[0].text
  #   assert_equal "BMyString", alpha_titles[1].text
  #   assert_equal "CMyString", alpha_titles[2].text
  #   find("a.reverse_order").click
  #   alpha_titles = page.all('.title')
  #   assert_equal "EMyString", alpha_titles[0].text
  #   assert_equal "DMyString", alpha_titles[1].text
  #   assert_equal "CMyString", alpha_titles[2].text
  # end
  #
  # test "books can be sorted by date added" do
  #   user = login
  #   visit books_path
  #   find("a.sort_dropdown").click
  #   find("a#year_published").click
  #   publi_years = page.all('.year-created')
  #   assert_equal "2014", publi_years[0].text
  #   assert_equal "2001", publi_years[1].text
  #   assert_equal "1995", publi_years[2].text
  #   find("a.reverse_order").click
  #   publi_years = page.all('.year-created')
  #   assert_equal "1970", publi_years[0].text
  #   assert_equal "1990", publi_years[1].text
  #   assert_equal "1995", publi_years[2].text
  # end
end


text:
'''
Created on 21/9/2015

@author: victor
'''
import sys
import numpy
import matplotlib.pyplot as plt
from trajectory_comparison import tools

if __name__ == '__main__':
    energies_file = sys.argv[1]
    energy_handler = open(energies_file, "r")

    if len(sys.argv[1]) > 2:
        skip = int(sys.argv[2])
    else:
        skip = 0

    energies = []
    traj_energy = []
    for line in energy_handler:
        ml = line.strip('\n')
        if ml != "###":
            traj_energy.append(float(ml))
        else:
            energies.append(traj_energy[skip:-1])
            traj_energy = []
    energies.append(traj_energy)
    energy_handler.close()

    colors = tools.define_tableau20_cm()

    for i in range(len(energies)):
        ax = plt.plot(energies[i], color=colors[i%len(colors)])
        plt.ticklabel_format(useOffset=False)
    plt.savefig("%s.svg"%sys.argv[1])


text:
import React, { Component } from 'react';
import { StyleSheet, View, ScrollView } from 'react-native';
import { connect } from 'react-redux';
import { withTheme, Text } from 'react-native-paper';
import moment from 'moment';
import camelCase from 'lodash.camelcase';
import DatePicker from 'react-native-datepicker';
import Icon from 'react-native-vector-icons/FontAwesome';
import RankingList from './RankingList';
import NovelRankingList from './NovelRankingList';
import PXTouchable from '../../components/PXTouchable';
import PXBottomSheet from '../../components/PXBottomSheet';
import PXBottomSheetButton from '../../components/PXBottomSheetButton';
import PXBottomSheetCancelButton from '../../components/PXBottomSheetCancelButton';
import { connectLocalization } from '../../components/Localization';
import {
  RANKING_ILLUST,
  R18_RANKING_ILLUST,
  R18G_RANKING_ILLUST,
  RANKING_MANGA,
  R18_RANKING_MANGA,
  R18G_RANKING_MANGA,
  RANKING_NOVEL,
  R18_RANKING_NOVEL,
  R18G_RANKING_NOVEL,
  RANKING_TYPES,
} from '../../common/constants';
import { globalStyles, globalStyleVariables } from '../../styles';

const styles = StyleSheet.create({
  filterContainer: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    margin: 10,
  },
  rankingPickerContainer: {
    marginRight: 10,
  },
  rankingPicker: {
    flexDirection: 'row',
    alignItems: 'center',
    borderColor: 'gray',
    borderWidth: 1,
    paddingHorizontal: 10,
    height: 42,
  },
  rankingPickerText: {
    padding: 10,
  },
  rankingPickerIcon: {
    paddingLeft: 5,
  },
  bottomSheetListItem: {
    flexDirection: 'row',
    justifyContent: 'flex-start',
    alignItems: 'center',
    height: 48,
  },
  bottomSheetText: {
    marginLeft: 32,
  },
  bottomSheetCancelIcon: {
    marginLeft: 3,
  },
  bottomSheetCancelText: {
    marginLeft: 36,
  },
  datePicker: {
    flex: 1,
    borderColor: 'gray',
    borderWidth: 1,
  },
  dateInput: {
    borderWidth: 0,
  },
  dateTouchBody: {
    height: null,
  },
});

class PastRanking extends Component {
  constructor(props) {
    super(props);
    const { rankingType } = props;
    let mode;
    if (rankingType === RANKING_TYPES.ILLUST) {
      this.ranking = RANKING_ILLUST;
      this.r18Ranking = R18_RANKING_ILLUST;
      this.r18GRanking = R18G_RANKING_ILLUST;
      mode = 'day';
    } else if (rankingType === RANKING_TYPES.MANGA) {
      this.ranking = RANKING_MANGA;
      this.r18Ranking = R18_RANKING_MANGA;
      this.r18GRanking = R18G_RANKING_MANGA;
      mode = 'day_manga';
    } else if (rankingType === RANKING_TYPES.NOVEL) {
      this.ranking = RANKING_NOVEL;
      this.r18Ranking = R18_RANKING_NOVEL;
      this.r18GRanking = R18G_RANKING_NOVEL;
      mode = 'day';
    }
    this.state = {
      isOpenRankingModeBottomSheet: false,
      date: moment().subtract(2, 'days').format('YYYY-MM-DD'),
      mode,
    };
  }

  openRankingModeBottomSheet = () => {
    this.setState({ isOpenRankingModeBottomSheet: true });
  };

  handleOnCancelRankingModeBottomSheet = () => {
    this.setState({ isOpenRankingModeBottomSheet: false });
  };

  handleOnPressRankingMode = (mode) => {
    this.setState({ mode });
    this.handleOnCancelRankingModeBottomSheet();
  };

  handleOnDateChange = (date) => {
    this.setState({ date });
  };

  mapRankingString = (ranking) => {
    const { i18n } = this.props;
    return i18n[`ranking${ranking.charAt(0).toUpperCase() + ranking.slice(1)}`];
  };

  renderRankingOptions = (ranking, rankingMode) => (
    <PXBottomSheetButton
      key={ranking}
      onPress={() => this.handleOnPressRankingMode(rankingMode)}
      iconName="md-funnel"
      iconType="ionicon"
      text={this.mapRankingString(ranking)}
    />
  );

  render() {
    const { user, i18n, route, rankingMode, rankingType, theme } = this.props;
    const { date, mode, isOpenRankingModeBottomSheet } = this.state;
    const selectedRankingMode =
      rankingType === RANKING_TYPES.MANGA ? mode.replace('_manga', '') : mode;
    return (
      <View style={globalStyles.container}>
        <View style={styles.filterContainer}>
          <PXTouchable
            style={styles.rankingPickerContainer}
            onPress={this.openRankingModeBottomSheet}
          >
            <View style={styles.rankingPicker}>
              <Text style={styles.rankingPickerText}>
                {this.mapRankingString(camelCase(selectedRankingMode))}
              </Text>
              <Icon
                name="caret-down"
                size={24}
                style={styles.rankingPickerIcon}
                color={theme.colors.text}
              />
            </View>
          </PXTouchable>
          <DatePicker
            style={styles.datePicker}
            customStyles={{
              dateInput: styles.dateInput,
              dateTouchBody: styles.dateTouchBody,
              dateText: {
                color: theme.colors.text,
              },
              btnTextConfirm: {
                height: 20,
                color: globalStyleVariables.PRIMARY_COLOR,
              },
              btnTextCancel: {
                height: 20,
                color: '#000',
              },
            }}
            date={date}
            mode="date"
            placeholder="select date"
            format="YYYY-MM-DD"
            minDate="2007-09-13"
            maxDate={new Date()}
            confirmBtnText={i18n.ok}
            cancelBtnText={i18n.cancel}
            showIcon
            onDateChange={this.handleOnDateChange}
          />
        </View>
        {rankingType === RANKING_TYPES.NOVEL ? (
          <NovelRankingList
            rankingMode={rankingMode}
            options={{ date, mode }}
            route={route}
          />
        ) : (
          <RankingList
            rankingMode={rankingMode}
            options={{ date, mode }}
            route={route}
          />
        )}

        <PXBottomSheet
          visible={isOpenRankingModeBottomSheet}
          onCancel={this.handleOnCancelRankingModeBottomSheet}
        >
          <ScrollView>
            {Object.keys(this.ranking).map((ranking) =>
              this.renderRankingOptions(ranking, this.ranking[ranking]),
            )}
            {user &&
              user.x_restrict > 0 &&
              Object.keys(this.r18Ranking).map((ranking) =>
                this.renderRankingOptions(ranking, this.r18Ranking[ranking]),
              )}
            {user &&
              user.x_restrict > 1 &&
              Object.keys(this.r18GRanking).map((ranking) =>
                this.renderRankingOptions(ranking, this.r18GRanking[ranking]),
              )}
            <PXBottomSheetCancelButton
              onPress={this.handleOnCancelRankingModeBottomSheet}
              text={i18n.cancel}
            />
          </ScrollView>
        </PXBottomSheet>
      </View>
    );
  }
}

export default withTheme(
  connectLocalization(
    connect((state) => ({
      user: state.auth.user,
    }))(PastRanking),
  ),
);


text:
var fritzboxtools = require('../lib/fritzboxtools');
var util = require('util')
var argv = require('yargs')
			.usage('Usage: $0 --fboxuri [string] --user [string] --pass [string] --interval [int]')
    		.demand(['user', 'pass'])
    		.default('fboxuri', 'fritz.box')
    		.default('interval', 3000)
    		.argv;

var fbox = new fritzboxtools(argv.fboxuri);

fbox.login(argv.user, argv.pass, function(){

	fbox.getData(function(d){

		console.dir(d);

	}, argv.interval);

});