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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.httpclient.URIException;
import org.archive.url.UsableURI;
import org.archive.url.UsableURIFactory;
import org.archive.wayback.UrlCanonicalizer;
import org.archive.wayback.util.ByteOp;

/**
 * Class that performs the standard Heritrix URL canonicalization. Eventually,
 * this should all be configurable, or perhaps be able to read the settings
 * used within a Heritrix crawler... or even multiple crawlers... this is hard.
 *
 * @author brad
 * @version $Date$, $Revision$
 */
public class AggressiveUrlCanonicalizer implements UrlCanonicalizer {

	private static final Logger LOGGER = Logger.getLogger(
			AggressiveUrlCanonicalizer.class.getName());

	private static final String CDX_PREFIX = " CDX ";
    /**
     * Strip leading 'www.'
     */
    private static final Pattern STRIP_WWW_REGEX =
        Pattern.compile("(?i)^(?:https?://)(www[0-9]*\\.)(?:[^/]*/.+)$");
    private static final String STRIP_WWW_CHOOSER = "/www";
//    /**
//     * Strip leading 'www44.', 'www3.', etc.
//     */
//    private static final Pattern STRIP_WWWN_REGEX =
//        Pattern.compile("(?i)^(https?://)(?:www[0-9]+\\.)([^/]*/.+)$");
    /**
     * Strip userinfo.
     */
    private static final Pattern STRIP_USERINFO_REGEX =
        Pattern.compile("^(?:(?:(?:https?)|(?:ftps?))://)([^/]+@)(?:.*)$",
            Pattern.CASE_INSENSITIVE);
    private static final String STRIP_USERINFO_CHOOSER = "@";

    /**
     * Example: PHPSESSID=9682993c8daa2c5497996114facdc805.
     */
    private static final Pattern STRIP_PHPSESSION_ID_REGEX =
    	 Pattern.compile("^(?:.+)(phpsessid=" +
    	                 "[0-9a-zA-Z]{32}&?)(?:(?:.*))?$",
    	                 Pattern.CASE_INSENSITIVE);
    private static final String STRIP_PHPSESSION_ID_CHOOSER = "phpsessid=";

    /**
     * Example: jsessionid=999A9EF028317A82AC83F0FDFE59385A.
     */
    private static final Pattern STRIP_JSESSION_ID_REGEX =
    	 Pattern.compile("^.*(jsessionid=[0-9a-zA-Z]{32}&?).*$",
    	                 Pattern.CASE_INSENSITIVE);
    private static final String STRIP_JSESSION_ID_CHOOSER = "jsessionid=";

    /**
     * Example: sid=9682993c8daa2c5497996114facdc805.
     * 'sid=' can be tricky but all sid= followed by 32 byte string
     * so far seen have been session ids.  Sid is a 32 byte string
     * like the BASE_PATTERN only 'sid' is the tail of 'phpsessid'
     * so have to have it run after the phpsessid elimination.
     */
    private static final Pattern STRIP_SID_REGEX =
        Pattern.compile("^(?:.+)" +
                "(sid=[0-9a-zA-Z]{32}&?)(?:(?:.*))?$", Pattern.CASE_INSENSITIVE);
    private static final String STRIP_SID_CHOOSER = "sid=";

    /**
     * Example:ASPSESSIONIDAQBSDSRT=EOHBLBDDPFCLHKPGGKLILNAM.
     */
    private static final Pattern STRIP_ASPSESSION_REGEX =
        Pattern.compile("^(?:.+)" +
                "(ASPSESSIONID[a-zA-Z]{8}=[a-zA-Z]{24}&?)(?:(?:.*))?$",
                    Pattern.CASE_INSENSITIVE);
    private static final String STRIP_ASPSESSION_CHOOSER = "aspsessionid";

    /**
     * Examples:
     *
     *        (.NET 2.0)
     *        http://legislature.mi.gov/(S(4hqa0555fwsecu455xqckv45))/mileg.aspx
     *     => http://legislature.mi.gov/mileg.aspx
     *
     *		  (.NET 1.0/1.1)
     *        http://legislature.mi.gov/(4hqa0555fwsecu455xqckv45)/mileg.aspx
     *     => http://legislature.mi.gov/mileg.aspx
     *
     *     For more info, see:
     *     	  http://msdn2.microsoft.com/en-us/library/aa479315.aspx
     *
     */
    private static final Pattern STRIP_ASPSESSION2_REGEX =
    	Pattern.compile(".*/(\\([0-9a-z]{24}\\)/)(?:[^\\?]+\\.aspx.*)$",
    			Pattern.CASE_INSENSITIVE);
    private static final String STRIP_ASPSESSION2_CHOOSER = ".aspx";

    /**
     * Examples:
     *
     *        (.NET 2.0)
     *        http://legislature.mi.gov/(a(4hqa0555fwsecu455xqckv45)S(4hqa0555fwsecu455xqckv45)f(4hqa0555fwsecu455xqckv45))/mileg.aspx?page=SessionSchedules
     *     => http://legislature.mi.gov/(a(4hqa0555fwsecu455xqckv45)f(4hqa0555fwsecu455xqckv45))/mileg.aspx?page=SessionSchedules
     *
     *     For more info, see:
     *     	  http://msdn2.microsoft.com/en-us/library/aa479315.aspx
     *
     */
    private static final Pattern STRIP_ASPSESSION3_REGEX =
    	Pattern.compile(".*/(\\((?:[a-z]\\([0-9a-z]{24}\\))+\\)/)[^\\?]+\\.aspx.*$",
    			Pattern.CASE_INSENSITIVE);
    private static final String STRIP_ASPSESSION3_CHOOSER = ".aspx";

    /**
     * Strip ColdFusion session IDs. Remove sessionids that look like the
     * following:
     * CFID=12412453&CFTOKEN=15501799
     * CFID=3304324&CFTOKEN=57491900&jsessionid=a63098d96360$B0$D9$A
     */
    private static final Pattern STRIP_CFSESSION_REGEX =
    	Pattern.compile(".+(cfid=[^&]+&cftoken=[^&]+(?:&jsessionid=[^&]+)?&?).*$",
    			Pattern.CASE_INSENSITIVE);
    private static final String STRIP_CFSESSION_CHOOSER = "cftoken=";

	private static final String choosers[] = {
			STRIP_USERINFO_CHOOSER,
			STRIP_WWW_CHOOSER,
			STRIP_PHPSESSION_ID_CHOOSER,
			STRIP_JSESSION_ID_CHOOSER,
			STRIP_ASPSESSION_CHOOSER,
			STRIP_ASPSESSION2_CHOOSER,
			STRIP_ASPSESSION3_CHOOSER,
			STRIP_SID_CHOOSER,
			STRIP_CFSESSION_CHOOSER
	};
	private static final Pattern strippers[] = {
			STRIP_USERINFO_REGEX,
			STRIP_WWW_REGEX,
			STRIP_PHPSESSION_ID_REGEX,
			STRIP_JSESSION_ID_REGEX,
			STRIP_ASPSESSION_REGEX,
			STRIP_ASPSESSION2_REGEX,
			STRIP_ASPSESSION3_REGEX,
			STRIP_SID_REGEX,
			STRIP_CFSESSION_REGEX
    };

    /**
     * Run a regex against a StringBuilder, removing group 1 if it matches.
     *
     * Assumes the regex has a form that wants to strip elements of the passed
     * string.  Assumes that if a match, group 1 should be removed
     * @param url Url to search in.
     * @param matcher Matcher whose form yields a group to remove
     * @return true if the StringBuilder was modified
     */
    protected boolean doStripRegexMatch(StringBuilder url, Matcher matcher) {
    	if(matcher != null && matcher.matches()) {
    		url.delete(matcher.start(1), matcher.end(1));
    		return true;
    	}
    	return false;
    }

	public String urlStringToKey(final String urlString) throws URIException {

		if(urlString.startsWith("dns:")) {
			return urlString;
		}
		String searchUrl = canonicalize(urlString);
		String scheme = UrlOperations.urlToScheme(searchUrl);
		if(scheme != null) {
			searchUrl = searchUrl.substring(scheme.length());
		} else {
			scheme = UrlOperations.HTTP_SCHEME;
		}

		if (-1 == searchUrl.indexOf("/")) {
			searchUrl = scheme + searchUrl + "/";
		} else {
			searchUrl = scheme + searchUrl;
		}

		// TODO: These next few lines look crazy -- need to be reworked.. This
		// was the only easy way I could find to get the correct unescaping
		// out of UsableURIs, possible a bug. Definitely needs some TLC in any case,
		// as building UsableURIs is *not* a cheap operation.

		// unescape anything that can be:
		UsableURI tmpURI = null;
		try {
			tmpURI = UsableURIFactory.getInstance(searchUrl);
		} catch (StringIndexOutOfBoundsException e) {
			LOGGER.warning(e.getMessage() + ": " + searchUrl);
			return searchUrl;
//		} catch(URIException e) {
//			LOGGER.warning(e.getMessage() + ": " + searchUrl);
//			return searchUrl;
		}
		tmpURI.setPath(tmpURI.getPath());

		// convert to UsableURI to perform required URI fixup:
		UsableURI searchURI = UsableURIFactory.getInstance(tmpURI.getURI());

		// replace ' ' with '+' (this is only to match Alexa's canonicalization)
		String newPath = searchURI.getEscapedPath().replace("%20","+");

		// replace multiple consecutive '/'s in the path.
		while(newPath.contains("//")) {
			newPath = newPath.replace("//","/");
		}

		// this would remove trailing a '/' character, unless the path is empty
		// but we're not going to do this just yet..
//		if((newPath.length() > 1) && newPath.endsWith("/")) {
//			newPath = newPath.substring(0,newPath.length()-1);
//		}

		StringBuilder sb = new StringBuilder(searchUrl.length());
		sb.append(searchURI.getHostBasename());

		// omit port if scheme default:
		int defaultSchemePort = UrlOperations.schemeToDefaultPort(scheme);
		if(searchURI.getPort() != defaultSchemePort
				&& searchURI.getPort() != -1) {

			sb.append(":").append(searchURI.getPort());
		}

		sb.append(newPath);
		if(searchURI.getEscapedQuery() != null) {
			sb.append("?").append(searchURI.getEscapedQuery());
		}

		return sb.toString();
	}

	/**
	 * Idempotent operation that will determine the 'fuzziest'
	 * form of the url argument. This operation is done prior to adding records
	 * to the ResourceIndex, and prior to lookup. Current version is exactly
	 * the default found in Heritrix. When the configuration system for
	 * Heritrix stabilizes, hopefully this can use the system directly within
	 * Heritrix.
	 *
	 * @param url to be canonicalized.
	 * @return canonicalized version of url argument.
	 */
	public String canonicalize(String url) {

        if (url == null || url.length() <= 0) {
            return url;
        }

        // hang on, we're about to get aggressive:
        url = url.toLowerCase();
        StringBuilder sb = new StringBuilder(url);
        boolean changed = false;
		for(int i=0; i<choosers.length; i++) {
			if(sb.indexOf(choosers[i]) != -1) {
				changed |= doStripRegexMatch(sb,strippers[i].matcher(sb));
			}
		}
		if(changed) {
			url = sb.toString();
		}

        int index = url.lastIndexOf('?');
        if (index > 0) {
            if (index == (url.length() - 1)) {
                // '?' is last char in url.  Strip it.
                url = url.substring(0, url.length() - 1);
            } else if (url.charAt(index + 1) == '&') {
                // Next char is '&'. Strip it.
                if (url.length() == (index + 2)) {
                    // Then url ends with '?&'.  Strip them.
                    url = url.substring(0, url.length() - 2);
                } else {
                    // The '&' is redundant.  Strip it.
                    url = url.substring(0, index + 1) +
                    	url.substring(index + 2);
                }
            } else if (url.charAt(url.length() - 1) == '&') {
                // If we have a lone '&' on end of query str,
                // strip it.
                url = url.substring(0, url.length() - 1);
            }
        }
        return url;
	}

	private static void USAGE() {
		System.err.println("Usage: [-f FIELD] [-d DELIM]");
		System.exit(3);
	}
	/**
	 * @param args program arguments
	 */
	public static void main(String[] args) {
		AggressiveUrlCanonicalizer canonicalizer = new AggressiveUrlCanonicalizer();
		int n = 0;
		int i = 0;
		ArrayList<Integer> columns = new ArrayList<Integer>();

		long lineNumber = 0;
		boolean cdxPassThru = false;
		String delimiter = " ";
		while(n < args.length) {
			String arg = args[n];
			if(arg.compareTo("-cdx") == 0) {
				cdxPassThru = true;
				n++;
				continue;
			}
			if(n == (args.length -1)) {
				USAGE();
			}
			String val = args[n+1];
			if(arg.compareTo("-f") == 0) {
				columns.add(new Integer(val));
			} else if(arg.compareTo("-d") == 0) {
				delimiter = val;
			} else {
				USAGE();
			}
			n += 2;
		}
		// place default '0' in case none specified:
		if(columns.size() == 0) {
			columns.add(new Integer(1));
		}

		// convert to int[]:
		int[] cols = new int[columns.size()];
		for(int idx = 0; idx < columns.size(); idx++) {
			cols[idx] = columns.get(idx).intValue() - 1;
		}
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in,ByteOp.UTF8));
		StringBuilder sb = new StringBuilder();
		String line = null;

		while(true) {
			try {
				line = r.readLine();
			} catch (IOException e) {
				e.printStackTrace();
				System.exit(1);
			}
			if(line == null) {
				break;
			}
			lineNumber++;
			if(cdxPassThru && line.startsWith(CDX_PREFIX)) {
				System.out.println(line);
				continue;
			}
			String parts[] = line.split(delimiter);
			for(int column : cols) {
				if(column >= parts.length) {
					System.err.println("Invalid line " + lineNumber + " (" +
							line + ") skipped");
				} else {
					try {
						parts[column] = canonicalizer.urlStringToKey(parts[column]);
					} catch (URIException e) {
						System.err.println("Invalid URL in line " + lineNumber + " (" +
								line + ") skipped (" + parts[column] + ")");
						e.printStackTrace();
						continue;
					} catch (StringIndexOutOfBoundsException e) {
						System.err.println("Invalid URL in line " + lineNumber + " (" +
								line + ") skipped (" + parts[column] + ")");
						e.printStackTrace();
						continue;
					}
				}
			}
			sb.setLength(0);
			for(i = 0; i < parts.length; i++) {
				sb.append(parts[i]);
				if(i < (parts.length-1)) {
					sb.append(delimiter);
				}
			}
			System.out.println(sb.toString());
		}
	}

	public boolean isSurtForm() {
		return false;
	}
}


text:
'''activeurl django template library'''
from __future__ import absolute_import, unicode_literals

from classytags.arguments import MultiKeywordArgument
from classytags.core import Options, Tag
from django import template

from ..utils import Configuration, render_content

# django template library
register = template.Library()

class ActiveUrl(Tag, Configuration):
    '''django template tag via django-classy-tags'''
    # tag name
    name = 'activeurl'

    # template tag arguments
    options = Options(
        # all key based arguments mapped to one dict
        MultiKeywordArgument('kwargs', required=False),
        blocks=[('endactiveurl', 'nodelist')],
    )

    def render_tag(self, context, kwargs, nodelist):
        '''render content with "active" urls logic'''
        # load configuration from passed options
        self.load_configuration(**kwargs)

        # get request from context
        request = context['request']

        # get full path from request
        self.full_path = request.get_full_path()

        # render content of template tag
        context.push()
        content = nodelist.render(context)
        context.pop()

        # check content for "active" urls
        content = render_content(
            content,
            full_path=self.full_path,
            parent_tag=self.parent_tag,
            css_class=self.css_class,
            menu=self.menu,
            ignore_params=self.ignore_params,
        )

        return content

# register new template tag
register.tag(ActiveUrl)

redpajama_set_name: RedPajamaGithub


text:
package main

import (
	"fmt"
	"os"

	"github.com/dongyiyang/k8sconnection/cmd/app"
	"github.com/dongyiyang/k8sconnection/cmd/app/options"

	"k8s.io/kubernetes/pkg/util/flag"
	"k8s.io/kubernetes/pkg/util/logs"

	"github.com/spf13/pflag"
)

func main() {
	config := options.NewK8sConntrackConfig()
	config.AddFlags(pflag.CommandLine)

	flag.InitFlags()
	logs.InitLogs()
	defer logs.FlushLogs()

	s, err := app.NewK8sConntrackServer(config)
	if err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		os.Exit(1)
	}

	s.Run()
}


text:
package jswingshell.action;

import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import jswingshell.IJssController;

/**
 * Test Action Group.
 *
 * @author Mathieu Brunot
 */
public class ActionGroupTest {

  public ActionGroupTest() {}

  @BeforeClass
  public static void setUpClass() {}

  @AfterClass
  public static void tearDownClass() {}

  @Before
  public void setUp() {}

  @After
  public void tearDown() {}

  /**
   * Test of add method, of class ActionGroup.
   */
  @Test
  public void testAdd() {
    System.out.println("add");
    AbstractJssSwitchAction a = null;
    ActionGroup instance = new ActionGroup();
    instance.add(a);
  }

  /**
   * Test of remove method, of class ActionGroup.
   */
  @Test
  public void testRemove() {
    System.out.println("remove");
    AbstractJssSwitchAction a = null;
    ActionGroup instance = new ActionGroup();
    instance.remove(a);
  }

  /**
   * Test of clearSelection method, of class ActionGroup.
   */
  @Test
  public void testClearSelection() {
    System.out.println("clearSelection");
    ActionGroup instance = new ActionGroup();
    instance.clearSelection();
  }

  /**
   * Test of getElements method, of class ActionGroup.
   */
  @Test
  public void testGetElements() {
    System.out.println("getElements");
    ActionGroup instance = new ActionGroup();
    boolean expResult = true;
    boolean result = instance.getElements().isEmpty();
    assertEquals(expResult, result);
  }

  /**
   * Test of getSelection method, of class ActionGroup.
   */
  @Test
  public void testGetSelection() {
    System.out.println("getSelection");
    ActionGroup instance = new ActionGroup();
    AbstractJssSwitchAction expResult = null;
    AbstractJssSwitchAction result = instance.getSelection();
    assertEquals(expResult, result);
  }

  /**
   * Test of setSelected method, of class ActionGroup.
   */
  @Test
  public void testSetSelected() {
    System.out.println("setSelected");
    AbstractJssSwitchAction a = new AbstractJssSwitchAction() {
      @Override
      protected boolean doSwitch(IJssController shellController,
          Boolean switchValue) {
        System.out.println("DummyAction.doSwitch");
        return true;
      }

      @Override
      public String[] getCommandIdentifiers() {
        return new String[] {};
      }

      @Override
      public String getBriefHelp() {
        return "DummyAction";
      }
    };
    boolean b = false;
    ActionGroup instance = new ActionGroup();
    instance.setSelected(a, b);
  }

  /**
   * Test of isSelected method, of class ActionGroup.
   */
  @Test
  public void testIsSelected() {
    System.out.println("isSelected");
    AbstractJssSwitchAction a = null;
    ActionGroup instance = new ActionGroup();
    boolean expResult = true;
    boolean result = instance.isSelected(a);
    assertEquals(expResult, result);
  }

  /**
   * Test of getSelection method, setSelected method, isSelected method, of class ActionGroup.
   */
  @Test
  public void testSelection() {
    System.out.println("selection");
    AbstractJssSwitchAction a = new AbstractJssSwitchAction() {
      @Override
      protected boolean doSwitch(IJssController shellController,
          Boolean switchValue) {
        System.out.println("DummyAction.doSwitch");
        return true;
      }

      @Override
      public String[] getCommandIdentifiers() {
        return new String[] {};
      }

      @Override
      public String getBriefHelp() {
        return "DummyAction";
      }
    };
    boolean b = true;
    ActionGroup instance = new ActionGroup();
    instance.setSelected(a, b);

    AbstractJssSwitchAction getSelectionExpResult = a;
    AbstractJssSwitchAction getSelectionResult = instance.getSelection();
    assertEquals(getSelectionExpResult, getSelectionResult);

    boolean isSelectedExpResult = true;
    boolean isSelectedResult = instance.isSelected(a);
    assertEquals(isSelectedExpResult, isSelectedResult);
  }

  /**
   * Test of getActionCount method, of class ActionGroup.
   */
  @Test
  public void testGetActionCount() {
    System.out.println("getActionCount");
    ActionGroup instance = new ActionGroup();
    int expResult = 0;
    int result = instance.getActionCount();
    assertEquals(expResult, result);
  }

  /**
   * Test of setEnabled method, of class ActionGroup.
   */
  @Test
  public void testSetEnabled() {
    System.out.println("setEnabled");
    boolean newValue = false;
    ActionGroup instance = new ActionGroup();
    instance.setEnabled(newValue);
  }

}


text:
package javax.portlet.tck.portlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.Portlet;
import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.tck.beans.TestButton;
import javax.xml.namespace.QName;

import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2FILTERTESTS_PORTLETFILTER_APIEVENTFILTER_INITEVENT1;
import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2FILTERTESTS_PORTLETFILTER_APIEVENTFILTER_INITEVENT2;
import static javax.portlet.tck.constants.Constants.THREADID_ATTR;
import static javax.portlet.tck.constants.Constants.TCKNAMESPACE;

/**
 * This portlet implements several test cases for the JSR 362 TCK. The test case names are defined
 * in the /src/main/resources/xml-resources/additionalTCs.xml file. The build process will integrate
 * the test case names defined in the additionalTCs.xml file into the complete list of test case
 * names for execution by the driver.
 *
 * This is the main portlet for the test cases. If the test cases call for events, this portlet will
 * initiate the events, but not process them. The processing is done in the companion portlet
 * FilterTests_PortletFilter_ApiEventFilter_event
 *
 */
public class FilterTests_PortletFilter_ApiEventFilter implements Portlet {

  @Override
  public void init(PortletConfig config) throws PortletException {}

  @Override
  public void destroy() {}

  @Override
  public void processAction(ActionRequest portletReq, ActionResponse portletResp)
      throws PortletException, IOException {

    portletResp.setRenderParameters(portletReq.getParameterMap());
    long tid = Thread.currentThread().getId();
    portletReq.setAttribute(THREADID_ATTR, tid);

    QName eventQName = new QName(TCKNAMESPACE, "FilterTests_PortletFilter_ApiEventFilter");
    portletResp.setEvent(eventQName, "Hi!");
  }

  @Override
  public void render(RenderRequest portletReq, RenderResponse portletResp)
      throws PortletException, IOException {

    long tid = Thread.currentThread().getId();
    portletReq.setAttribute(THREADID_ATTR, tid);

    PrintWriter writer = portletResp.getWriter();

    /* TestCase: V2FilterTests_PortletFilter_ApiEventFilter_initEvent1 */
    /* Details: "The init(FilterConfig): method is called when an */
    /* EventFilter is configured" */
    {
      PortletURL aurl = portletResp.createActionURL();
      aurl.setParameters(portletReq.getPrivateParameterMap());
      TestButton tb = new TestButton(V2FILTERTESTS_PORTLETFILTER_APIEVENTFILTER_INITEVENT1, aurl);
      tb.writeTo(writer);
    }

    /* TestCase: V2FilterTests_PortletFilter_ApiEventFilter_initEvent2 */
    /* Details: "The init(FilterConfig): method for an EventFilter is */
    /* passed a FilterConfig object" */
    {
      PortletURL aurl = portletResp.createActionURL();
      aurl.setParameters(portletReq.getPrivateParameterMap());
      TestButton tb = new TestButton(V2FILTERTESTS_PORTLETFILTER_APIEVENTFILTER_INITEVENT2, aurl);
      tb.writeTo(writer);
    }

  }

}


text:
<?xml version="1.0" encoding="utf-8"?>

<view
	class="yuku.alkitab.base.widget.LeftDrawer$Devotion"
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="240dp"
    android:background="#263238"
    android:elevation="4dp"
	android:layout_height="match_parent"
	android:fitsSystemWindows="true"
	tools:ignore="Overdraw">

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

		<include
			layout="@layout/left_drawer_header"
			android:layout_width="match_parent"
			android:layout_height="wrap_content" />

		<Spinner
			android:id="@+id/cbKind"
			android:layout_width="match_parent"
			android:layout_height="48dp"
			android:text="*devotion name"
			tools:ignore="HardcodedText" />

		<TextView
			android:id="@+id/tCurrentDate"
			android:layout_width="match_parent"
			android:layout_height="48dp"
			android:gravity="center"
			android:text="*current date"
			android:textSize="16sp"
			tools:ignore="HardcodedText" />

		<LinearLayout
			android:layout_width="match_parent"
			android:layout_height="48dp">

			<ImageButton
				android:id="@+id/bPrev"
				style="?android:buttonBarButtonStyle"
				android:layout_width="0dp"
				android:layout_height="match_parent"
				android:layout_weight="1"
				android:contentDescription="@string/desc_previous_day"
				android:src="@drawable/ic_nav_left_light" />

			<ImageButton
				android:id="@+id/bReload"
				style="?android:buttonBarButtonStyle"
				android:layout_width="0dp"
				android:layout_height="match_parent"
				android:layout_weight="1"
				android:contentDescription="@string/redownload"
				android:src="@drawable/ic_action_reload" />

			<ImageButton
				android:id="@+id/bNext"
				style="?android:buttonBarButtonStyle"
				android:layout_width="0dp"
				android:layout_height="match_parent"
				android:layout_weight="1"
				android:contentDescription="@string/desc_next_day"
				android:src="@drawable/ic_nav_right_light" />
		</LinearLayout>

		<include
			layout="@layout/left_drawer_footer"
			android:layout_width="match_parent"
			android:layout_height="wrap_content" />

	</LinearLayout>

</view>


text:
package org.apache.mina.filter.codec.statemachine;

/**
 * {@link DecodingState} which skips space (0x20) and tab (0x09) characters.
 *
 * @author Apache MINA Project
 */
public abstract class LinearWhitespaceSkippingState extends SkippingState {

    /**
     * {@inheritDoc}
     */
    @Override
    protected boolean canSkip(byte b) {
        return b == 32 || b == 9;
    }
}


text:
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/quick_pair/scanning/fast_pair/fast_pair_discoverable_scanner_impl.h"

#include <cstdint>
#include <memory>
#include <vector>

#include "ash/quick_pair/common/constants.h"
#include "ash/quick_pair/common/device.h"
#include "ash/quick_pair/common/fast_pair/fast_pair_decoder.h"
#include "ash/quick_pair/common/logging.h"
#include "ash/quick_pair/common/pair_failure.h"
#include "ash/quick_pair/common/protocol.h"
#include "ash/quick_pair/repository/fast_pair_repository.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/check.h"
#include "base/containers/flat_set.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_util.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/services/quick_pair/quick_pair_process.h"
#include "chromeos/ash/services/quick_pair/quick_pair_process_manager.h"
#include "device/bluetooth//bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_device.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

namespace {

constexpr char kNearbyShareModelId[] = "fc128e";
constexpr int kMaxParseModelIdRetryCount = 5;

bool IsValidDeviceType(const nearby::fastpair::Device& device) {
  // TODO: Filter out based on solidified Fast Pair configuration list once
  // available.
  return device.device_type() == nearby::fastpair::DeviceType::HEADPHONES ||
         device.device_type() == nearby::fastpair::DeviceType::SPEAKER ||
         device.device_type() ==
             nearby::fastpair::DeviceType::TRUE_WIRELESS_HEADPHONES ||
         device.device_type() ==
             nearby::fastpair::DeviceType::DEVICE_TYPE_UNSPECIFIED;
}

bool IsSupportedNotificationType(const nearby::fastpair::Device& device) {
  // We only allow-list notification types that should trigger a pairing
  // notification, since we currently only support pairing. We include
  // NOTIFICATION_TYPE_UNSPECIFIED to handle the case where a Provider is
  // advertising incorrectly and conservatively allow it to show a notification,
  // matching Android behavior.
  return device.notification_type() == nearby::fastpair::NotificationType::
                                           NOTIFICATION_TYPE_UNSPECIFIED ||
         device.notification_type() ==
             nearby::fastpair::NotificationType::FAST_PAIR ||
         device.notification_type() ==
             nearby::fastpair::NotificationType::FAST_PAIR_ONE;
}

}  // namespace

namespace ash {
namespace quick_pair {

// static
FastPairDiscoverableScannerImpl::Factory*
    FastPairDiscoverableScannerImpl::Factory::g_test_factory_ = nullptr;

// static
std::unique_ptr<FastPairDiscoverableScanner>
FastPairDiscoverableScannerImpl::Factory::Create(
    scoped_refptr<FastPairScanner> scanner,
    scoped_refptr<device::BluetoothAdapter> adapter,
    DeviceCallback found_callback,
    DeviceCallback lost_callback) {
  if (g_test_factory_) {
    return g_test_factory_->CreateInstance(
        std::move(scanner), std::move(adapter), std::move(found_callback),
        std::move(lost_callback));
  }

  return base::WrapUnique(new FastPairDiscoverableScannerImpl(
      std::move(scanner), std::move(adapter), std::move(found_callback),
      std::move(lost_callback)));
}

// static
void FastPairDiscoverableScannerImpl::Factory::SetFactoryForTesting(
    Factory* g_test_factory) {
  g_test_factory_ = g_test_factory;
}

FastPairDiscoverableScannerImpl::Factory::~Factory() = default;

FastPairDiscoverableScannerImpl::FastPairDiscoverableScannerImpl(
    scoped_refptr<FastPairScanner> scanner,
    scoped_refptr<device::BluetoothAdapter> adapter,
    DeviceCallback found_callback,
    DeviceCallback lost_callback)
    : scanner_(std::move(scanner)),
      adapter_(std::move(adapter)),
      found_callback_(std::move(found_callback)),
      lost_callback_(std::move(lost_callback)) {
  observation_.Observe(scanner_.get());
  NetworkHandler::Get()->network_state_handler()->AddObserver(this, FROM_HERE);
}

FastPairDiscoverableScannerImpl::~FastPairDiscoverableScannerImpl() {
  NetworkHandler::Get()->network_state_handler()->RemoveObserver(this,
                                                                 FROM_HERE);
}

void FastPairDiscoverableScannerImpl::OnDeviceFound(
    device::BluetoothDevice* device) {
  QP_LOG(VERBOSE) << __func__ << ": " << device->GetNameForDisplay();

  const std::vector<uint8_t>* fast_pair_service_data =
      device->GetServiceDataForUUID(kFastPairBluetoothUuid);

  if (!fast_pair_service_data) {
    QP_LOG(WARNING) << __func__
                    << ": Device doesn't have any Fast Pair Service Data.";
    return;
  }

  model_id_parse_attempts_[device->GetAddress()] = 1;

  QP_LOG(INFO) << __func__ << ": Attempting to get model ID";
  quick_pair_process::GetHexModelIdFromServiceData(
      *fast_pair_service_data,
      base::BindOnce(&FastPairDiscoverableScannerImpl::OnModelIdRetrieved,
                     weak_pointer_factory_.GetWeakPtr(), device->GetAddress()),
      base::BindOnce(&FastPairDiscoverableScannerImpl::OnUtilityProcessStopped,
                     weak_pointer_factory_.GetWeakPtr(), device->GetAddress()));
}

void FastPairDiscoverableScannerImpl::OnModelIdRetrieved(
    const std::string& address,
    const absl::optional<std::string>& model_id) {
  auto it = model_id_parse_attempts_.find(address);

  // If there's no entry in the map, the device was lost while parsing.
  if (it == model_id_parse_attempts_.end()) {
    QP_LOG(WARNING)
        << __func__
        << ": Returning early because device as lost while parsing.";
    return;
  }

  model_id_parse_attempts_.erase(it);

  if (!model_id) {
    QP_LOG(INFO) << __func__
                 << ": Returning early because no model id was parsed.";
    return;
  }

  // The Nearby Share feature advertises under the Fast Pair Service Data UUID
  // and uses a reserved model ID to enable their 'fast initiation' scenario.
  // We must detect this instance and ignore these advertisements since they
  // do not correspond to Fast Pair devices that are open to pairing.
  if (base::EqualsCaseInsensitiveASCII(model_id.value(), kNearbyShareModelId))
    return;

  FastPairRepository::Get()->GetDeviceMetadata(
      *model_id,
      base::BindOnce(
          &FastPairDiscoverableScannerImpl::OnDeviceMetadataRetrieved,
          weak_pointer_factory_.GetWeakPtr(), address, model_id.value()));
}

void FastPairDiscoverableScannerImpl::OnDeviceMetadataRetrieved(
    const std::string& address,
    const std::string model_id,
    DeviceMetadata* device_metadata,
    bool has_retryable_error) {
  if (has_retryable_error) {
    pending_devices_address_to_model_id_[address] = model_id;
    QP_LOG(WARNING) << __func__
                    << ": Could not retrieve metadata for id: " << model_id
                    << ". Waiting for network change before retry.";
    return;
  }

  if (!device_metadata) {
    QP_LOG(WARNING) << __func__
                    << ": No metadata available for id: " << model_id
                    << ". Ignoring this advertisement";
    return;
  }

  // Ignore advertisements that aren't for Fast Pair but leverage the service
  // UUID.
  if (!IsValidDeviceType(device_metadata->GetDetails())) {
    QP_LOG(WARNING)
        << __func__
        << ": Invalid device type for Fast Pair. Ignoring this advertisement";
    return;
  }

  // Ignore advertisements for unsupported notification types, such as
  // APP_LAUNCH which should launch a companion app instead of beginning Fast
  // Pair.
  if (!IsSupportedNotificationType(device_metadata->GetDetails())) {
    QP_LOG(WARNING) << __func__
                    << ": Unsupported notification type for Fast Pair. "
                       "Ignoring this advertisement";
    return;
  }

  auto device = base::MakeRefCounted<Device>(model_id, address,
                                             Protocol::kFastPairInitial);

  QP_LOG(INFO) << __func__ << ": Id: " << model_id;

  NotifyDeviceFound(std::move(device));
}

void FastPairDiscoverableScannerImpl::NotifyDeviceFound(
    scoped_refptr<Device> device) {
  device::BluetoothDevice* classic_device =
      device->classic_address().has_value()
          ? adapter_->GetDevice(device->classic_address().value())
          : nullptr;

  if (classic_device && classic_device->IsPaired()) {
    QP_LOG(ERROR) << __func__
                  << ": A discoverable advertisement "
                     "was notified for a paired classic device.";
    return;
  }

  device::BluetoothDevice* ble_device =
      adapter_->GetDevice(device->ble_address);

  if (ble_device && ble_device->IsPaired()) {
    QP_LOG(ERROR) << __func__
                  << ": A discoverable advertisement "
                     "was notified for a paired BLE device.";
    return;
  }

  // TODO(b/242100708): We currently have no way to tell if a device in pairing
  // mode is already paired to the Chromebook; the BLE device has no information
  // on the pairing state of the Classic device.

  QP_LOG(INFO) << __func__ << ": Running found callback";
  notified_devices_[device->ble_address] = device;
  found_callback_.Run(device);
}

void FastPairDiscoverableScannerImpl::OnDeviceLost(
    device::BluetoothDevice* device) {
  QP_LOG(VERBOSE) << __func__ << ": " << device->GetNameForDisplay();

  // No need to retry fetching metadata for devices that are no longer in range.
  pending_devices_address_to_model_id_.erase(device->GetAddress());

  // If we have an in-progress attempt to parse for this device, removing it
  // from this map will ensure the result is ignored.
  model_id_parse_attempts_.erase(device->GetAddress());

  auto it = notified_devices_.find(device->GetAddress());

  // Don't invoke callback if we didn't notify this device.
  if (it == notified_devices_.end())
    return;

  QP_LOG(INFO) << __func__ << ": Running lost callback";
  scoped_refptr<Device> notified_device = it->second;
  notified_devices_.erase(it);
  lost_callback_.Run(std::move(notified_device));
}

void FastPairDiscoverableScannerImpl::OnUtilityProcessStopped(
    const std::string& address,
    QuickPairProcessManager::ShutdownReason shutdown_reason) {
  int current_retry_count = model_id_parse_attempts_[address];
  if (current_retry_count > kMaxParseModelIdRetryCount) {
    QP_LOG(WARNING) << "Failed to parse model id from device more than "
                    << kMaxParseModelIdRetryCount << " times.";
    // Clean up the state here which enables trying again in the future if this
    // device is re-discovered.
    model_id_parse_attempts_.erase(address);
    return;
  }

  // Don't try to parse the model ID again if the device was lost.
  device::BluetoothDevice* device = adapter_->GetDevice(address);
  if (!device) {
    QP_LOG(WARNING) << __func__ << ": Lost device in between parse attempts.";
    model_id_parse_attempts_.erase(address);
    return;
  }

  model_id_parse_attempts_[address] = current_retry_count + 1;

  const std::vector<uint8_t>* fast_pair_service_data =
      device->GetServiceDataForUUID(kFastPairBluetoothUuid);

  QP_LOG(INFO) << __func__ << ": Retrying call to get model ID";
  quick_pair_process::GetHexModelIdFromServiceData(
      *fast_pair_service_data,
      base::BindOnce(&FastPairDiscoverableScannerImpl::OnModelIdRetrieved,
                     weak_pointer_factory_.GetWeakPtr(), address),
      base::BindOnce(&FastPairDiscoverableScannerImpl::OnUtilityProcessStopped,
                     weak_pointer_factory_.GetWeakPtr(), address));
}

void FastPairDiscoverableScannerImpl::DefaultNetworkChanged(
    const NetworkState* network) {
  // Only retry when we have an active connected network.
  if (!network || !network->IsConnectedState()) {
    return;
  }

  auto it = pending_devices_address_to_model_id_.begin();
  while (it != pending_devices_address_to_model_id_.end()) {
    FastPairRepository::Get()->GetDeviceMetadata(
        /*model_id=*/it->second,
        base::BindOnce(
            &FastPairDiscoverableScannerImpl::OnDeviceMetadataRetrieved,
            weak_pointer_factory_.GetWeakPtr(),
            /*address=*/it->first,
            /*model_id=*/it->second));

    pending_devices_address_to_model_id_.erase(it);
  }
}

}  // namespace quick_pair
}  // namespace ash


text:
<?php

function echoFunction($inMessage) {

    $returnMessage = new WSMessage($inMessage->str);

    return $returnMessage;
}

$operations = array("echoString" => "echoFunction");
$actions = array("http://php.axis2.org/samples/echoString" => "echoString");
$sec_array = array("useUsernameToken" => TRUE);

$policy = new WSPolicy(array("security"=>$sec_array));
$sec_token = new WSSecurityToken(array("user" => "Raigama",
                                       "password" => "RaigamaPW",
                                       "passwordType" => "Digest"));

$svr = new WSService(array("operations" => $operations,
                           "actions" => $actions,
                           "policy" => $policy,
                           "securityToken" => $sec_token));

$svr->reply();

?>


text:
#region S# License

#endregion S# License
namespace StockSharp.Algo.Storages
{
	using System;
	using System.Collections.Generic;
	using System.Diagnostics;
	using System.IO;
	using System.Linq;
	using IOPath = System.IO.Path;

	using MoreLinq;

	using Ecng.Collections;
	using Ecng.Common;
	using Ecng.Serialization;
	using Ecng.ComponentModel;

	using StockSharp.BusinessEntities;
	using StockSharp.Messages;
	using StockSharp.Localization;
	using StockSharp.Logging;

	/// <summary>
	/// The file storage for market data.
	/// </summary>
	public class LocalMarketDataDrive : BaseMarketDataDrive
	{
		private sealed class LocalMarketDataStorageDrive : IMarketDataStorageDrive
		{
			private readonly string _path;
			private readonly string _fileNameWithExtension;
			private readonly string _datesPath;
			private readonly DataType _dataType;

			private readonly SyncObject _cacheSync = new();

			//private static readonly Version _dateVersion = new Version(1, 0);

			public LocalMarketDataStorageDrive(DataType dataType, string path, StorageFormats format, LocalMarketDataDrive drive)
			{
				_dataType = dataType ?? throw new ArgumentNullException(nameof(dataType));

				var fileName = GetFileName(_dataType);

				if (path.IsEmpty())
					throw new ArgumentNullException(nameof(path));

				_path = path;
				_drive = drive ?? throw new ArgumentNullException(nameof(drive));
				_fileNameWithExtension = fileName + GetExtension(format);
				_datesPath = IOPath.Combine(_path, fileName + format + "Dates.txt");

				_datesDict = new Lazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>>(() =>
				{
					var retVal = new CachedSynchronizedOrderedDictionary<DateTime, DateTime>();

					if (File.Exists(_datesPath))
					{
						foreach (var date in LoadDates())
							retVal.Add(date, date);
					}
					else
					{
						var dates = IOHelper
							.GetDirectories(_path)
							.Where(dir => File.Exists(IOPath.Combine(dir, _fileNameWithExtension)))
							.Select(dir => GetDate(IOPath.GetFileName(dir)));

						foreach (var date in dates)
							retVal.Add(date, date);

						SaveDates(retVal.CachedValues);
					}

					return retVal;
				}).Track();
			}

			private readonly LocalMarketDataDrive _drive;

			IMarketDataDrive IMarketDataStorageDrive.Drive => _drive;

			public IEnumerable<DateTime> Dates => DatesDict.CachedValues;

			private readonly Lazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>> _datesDict;

			private CachedSynchronizedOrderedDictionary<DateTime, DateTime> DatesDict => _datesDict.Value;

			public void ClearDatesCache()
			{
				if (Directory.Exists(_path))
				{
					lock (_cacheSync)
						File.Delete(_datesPath);
				}

				ResetCache();
			}

			void IMarketDataStorageDrive.Delete(DateTime date)
			{
				date = date.UtcKind();

				var path = GetPath(date, true);

				if (File.Exists(path))
				{
					File.Delete(path);

					var dir = GetDirectoryName(path);

					if (Directory.EnumerateFiles(dir).IsEmpty())
					{
						lock (_cacheSync)
							IOHelper.BlockDeleteDir(dir);
					}
				}

				var dates = DatesDict;

				dates.Remove(date);

				SaveDates(Dates.ToArray());

				_availableDataTypes.Remove(_drive.Path);
			}

			void IMarketDataStorageDrive.SaveStream(DateTime date, Stream stream)
			{
				date = date.UtcKind();

				Directory.CreateDirectory(GetDataPath(date));

				using (var file = File.OpenWrite(GetPath(date, false)))
					stream.CopyTo(file);

				var dates = DatesDict;

				dates[date] = date;

				SaveDates(Dates.ToArray());

				lock (_availableDataTypes.SyncRoot)
				{
					var tuple = _availableDataTypes.TryGetValue(_drive.Path);

					if (tuple == null || !tuple.Second)
						return;

					tuple.First.Add(_dataType);
				}
			}

			Stream IMarketDataStorageDrive.LoadStream(DateTime date)
			{
				var path = GetPath(date.UtcKind(), true);

				return File.Exists(path)
					? File.Open(path, FileMode.Open, FileAccess.ReadWrite, FileShare.Read)
					: Stream.Null;
			}

			private IEnumerable<DateTime> LoadDates()
			{
				try
				{
					return Do.Invariant(() =>
					{
						using (var reader = new StreamReader(new FileStream(_datesPath, FileMode.Open, FileAccess.Read)))
						{
							//var version = new Version(file.ReadByte(), file.ReadByte());

							//if (version > _dateVersion)
							//	throw new InvalidOperationException(LocalizedStrings.Str1002Params.Put(_datesPath, version, _dateVersion));

							//var count = file.Read<int>();

							var dates = new List<DateTime>();

							while (true)
							{
								var line = reader.ReadLine();

								if (line == null)
									break;

								dates.Add(GetDate(line));
							}

							//for (var i = 0; i < count; i++)
							//{
							//	dates[i] = file.Read<DateTime>().UtcKind();
							//}

							return dates;
						}
					});
				}
				catch (Exception ex)
				{
					throw new InvalidOperationException(LocalizedStrings.Str1003Params.Put(_datesPath), ex);
				}
			}

			private void SaveDates(DateTime[] dates)
			{
				try
				{
					if (!Directory.Exists(_path))
					{
						if (dates.IsEmpty())
							return;

						Directory.CreateDirectory(_path);
					}

					var stream = new MemoryStream();

					//stream.WriteByte((byte)_dateVersion.Major);
					//stream.WriteByte((byte)_dateVersion.Minor);
					//stream.Write(dates.Length);

					Do.Invariant(() =>
					{
						var writer = new StreamWriter(stream) { AutoFlush = true };

						foreach (var date in dates)
						{
							writer.WriteLine(GetDirName(date));
							//stream.Write(date);
						}
					});

					lock (_cacheSync)
					{
						stream.Position = 0;
						stream.Save(_datesPath);
					}
				}
				catch (UnauthorizedAccessException)
				{
					// если папка с данными с правами только на чтение
				}
			}

			private string GetDataPath(DateTime date)
			{
				return IOPath.Combine(_path, GetDirName(date));
			}

			private string GetPath(DateTime date, bool isLoad)
			{
				var result = IOPath.Combine(GetDataPath(date), _fileNameWithExtension);

				Debug.WriteLine("FileAccess ({0}): {1}".Put(isLoad ? "Load" : "Save", result));
				return result;
			}

			private static string GetDirectoryName(string path)
			{
				var name = IOPath.GetDirectoryName(path);

				if (name == null)
					throw new ArgumentException(LocalizedStrings.Str1004Params.Put(path));

				return name;
			}

			public void ResetCache()
			{
				_datesDict.Reset();
			}
		}

		private readonly SynchronizedDictionary<Tuple<SecurityId, DataType, StorageFormats>, LocalMarketDataStorageDrive> _drives = new();

		/// <summary>
		/// Initializes a new instance of the <see cref="LocalMarketDataDrive"/>.
		/// </summary>
		public LocalMarketDataDrive()
			: this(Directory.GetCurrentDirectory())
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="LocalMarketDataDrive"/>.
		/// </summary>
		/// <param name="path">The path to the directory with data.</param>
		public LocalMarketDataDrive(string path)
		{
			_path = path.ToFullPathIfNeed();
		}

		private string _path;

		/// <inheritdoc />
		public override string Path
		{
			get => _path;
			set
			{
				if (value.IsEmpty())
					throw new ArgumentNullException(nameof(value));

				if (Path == value)
					return;

				_path = value;
				ResetDrives();
			}
		}

		private void ResetDrives()
		{
			lock (_drives.SyncRoot)
				_drives.Values.ForEach(d => d.ResetCache());
		}

		/// <inheritdoc />
		public override IEnumerable<SecurityId> AvailableSecurities => GetAvailableSecurities(Path);

		/// <summary>
		/// Get all available instruments.
		/// </summary>
		/// <param name="path">The path to the directory with data.</param>
		/// <returns>All available instruments.</returns>
		public static IEnumerable<SecurityId> GetAvailableSecurities(string path)
		{
			var idGenerator = new SecurityIdGenerator();

			if (!Directory.Exists(path))
				return Enumerable.Empty<SecurityId>();

			return Directory
				.EnumerateDirectories(path)
				.SelectMany(Directory.EnumerateDirectories)
				.Select(IOPath.GetFileName)
				.Select(StorageHelper.FolderNameToSecurityId)
				.Select(n => idGenerator.Split(n, true))
				.Where(t => !t.IsDefault());
		}

		private static readonly SynchronizedDictionary<string, RefPair<HashSet<DataType>, bool>> _availableDataTypes = new(StringComparer.InvariantCultureIgnoreCase);

		/// <inheritdoc />
		public override IEnumerable<DataType> GetAvailableDataTypes(SecurityId securityId, StorageFormats format)
		{
			var ext = GetExtension(format);

			IEnumerable<DataType> GetDataTypes(string secPath)
			{
				return IOHelper
				       .GetDirectories(secPath)
				       .SelectMany(dateDir => Directory.GetFiles(dateDir, "*" + ext))
				       .Select(IOPath.GetFileNameWithoutExtension)
				       .Distinct()
				       .Select(GetDataType)
				       .Where(t => t != null)
				       .OrderBy(d =>
				       {
					       if (!d.IsCandles)
						       return 0;

					       return d.MessageType == typeof(TimeFrameCandleMessage)
						       ? ((TimeSpan)d.Arg).Ticks : long.MaxValue;
				       });
			}

			if (securityId.IsDefault())
			{
				lock (_availableDataTypes.SyncRoot)
				{
					var tuple = _availableDataTypes.SafeAdd(Path, key => RefTuple.Create(new HashSet<DataType>(), false));

					if (!tuple.Second)
					{
						tuple.First.AddRange(Directory
		                     .EnumerateDirectories(Path)
		                     .SelectMany(Directory.EnumerateDirectories)
		                     .SelectMany(GetDataTypes));

						tuple.Second = true;
					}

					return tuple.First.ToArray();
				}
			}

			var s = GetSecurityPath(securityId);

			return Directory.Exists(s) ? GetDataTypes(s) : Enumerable.Empty<DataType>();
		}

		/// <inheritdoc />
		public override IMarketDataStorageDrive GetStorageDrive(SecurityId securityId, DataType dataType, StorageFormats format)
		{
			if (dataType is null)
				throw new ArgumentNullException(nameof(dataType));

			if (dataType.IsSecurityRequired && securityId == default)
				throw new ArgumentNullException(nameof(securityId));

			return _drives.SafeAdd(Tuple.Create(securityId, dataType, format),
				key => new LocalMarketDataStorageDrive(dataType, GetSecurityPath(securityId), format, this));
		}

		/// <inheritdoc />
		public override void Verify()
		{
			if (!Directory.Exists(Path))
				throw new InvalidOperationException(LocalizedStrings.DirectoryNotExist.Put(Path));
		}

		/// <inheritdoc />
		public override void LookupSecurities(SecurityLookupMessage criteria, ISecurityProvider securityProvider, Action<SecurityMessage> newSecurity, Func<bool> isCancelled, Action<int, int> updateProgress)
		{
			if (criteria == null)
				throw new ArgumentNullException(nameof(criteria));

			if (securityProvider == null)
				throw new ArgumentNullException(nameof(securityProvider));

			if (newSecurity == null)
				throw new ArgumentNullException(nameof(newSecurity));

			if (isCancelled == null)
				throw new ArgumentNullException(nameof(isCancelled));

			if (updateProgress == null)
				throw new ArgumentNullException(nameof(updateProgress));

			var securityPaths = new List<string>();
			var progress = 0;

			foreach (var letterDir in IOHelper.GetDirectories(Path))
			{
				if (isCancelled())
					break;

				var name = IOPath.GetFileName(letterDir);

				if (name == null || name.Length != 1)
					continue;

				securityPaths.AddRange(IOHelper.GetDirectories(letterDir));
			}

			if (isCancelled())
				return;

			var iterCount = securityPaths.Count;

			updateProgress(0, iterCount);

			var existingIds = securityProvider.LookupAll().Select(s => s.Id).ToIgnoreCaseSet();

			foreach (var securityPath in securityPaths)
			{
				if (isCancelled())
					break;

				var securityId = IOPath.GetFileName(securityPath).FolderNameToSecurityId();

				if (!existingIds.Contains(securityId))
				{
					var firstDataFile =
						Directory.EnumerateDirectories(securityPath)
							.SelectMany(d => Directory.EnumerateFiles(d, "*.bin")
								.Concat(Directory.EnumerateFiles(d, "*.csv"))
								.OrderBy(f => IOPath.GetExtension(f).EqualsIgnoreCase(".bin") ? 0 : 1))
							.FirstOrDefault();

					if (firstDataFile != null)
					{
						var id = securityId.ToSecurityId();

						decimal priceStep;

						if (IOPath.GetExtension(firstDataFile).EqualsIgnoreCase(".bin"))
						{
							try
							{
								priceStep = File.ReadAllBytes(firstDataFile).Range(6, 16).To<decimal>();
							}
							catch (Exception ex)
							{
								throw new InvalidOperationException(LocalizedStrings.Str2929Params.Put(firstDataFile), ex);
							}
						}
						else
							priceStep = 0.01m;

						var security = new SecurityMessage
						{
							SecurityId = securityId.ToSecurityId(),
							PriceStep = priceStep,
							Name = id.SecurityCode,
						};

						if (security.IsMatch(criteria))
							newSecurity(security);

						existingIds.Add(securityId);
					}
				}

				updateProgress(progress++, iterCount);
			}
		}

		/// <summary>
		/// To get the file extension for the format.
		/// </summary>
		/// <param name="format">Format.</param>
		/// <returns>The extension.</returns>
		public static string GetExtension(StorageFormats format)
		{
			switch (format)
			{
				case StorageFormats.Binary:
					return ".bin";
				case StorageFormats.Csv:
					return ".csv";
				default:
					throw new ArgumentOutOfRangeException(nameof(format), format, LocalizedStrings.Str1219);
			}
		}

		/// <summary>
		/// Get data type and parameter for the specified file name.
		/// </summary>
		/// <param name="fileName">The file name.</param>
		/// <returns>Data type and parameter associated with the type. For example, <see cref="CandleMessage.Arg"/>.</returns>
		public static DataType GetDataType(string fileName)
		{
			try
			{
				return fileName.FileNameToDataType();
			}
			catch (Exception ex)
			{
				ex.LogError();
				return null;
			}
		}

		/// <summary>
		/// To get the file name by the type of data.
		/// </summary>
		/// <param name="dataType">Data type info.</param>
		/// <param name="format">Storage format. If set an extension will be added to the file name.</param>
		/// <param name="throwIfUnknown">Throw exception if the specified type is unknown.</param>
		/// <returns>The file name.</returns>
		public static string GetFileName(DataType dataType, StorageFormats? format = null, bool throwIfUnknown = true)
		{
			var fileName = dataType.DataTypeToFileName();

			if (fileName == null)
			{
				if (throwIfUnknown)
					throw new NotSupportedException(LocalizedStrings.Str2872Params.Put(dataType.ToString()));

				return null;
			}

			if (format != null)
				fileName += GetExtension(format.Value);

			return fileName;
		}

		/// <summary>
		/// To get the file name by the type of data.
		/// </summary>
		/// <param name="dataType">Data type.</param>
		/// <param name="arg">The parameter associated with the <paramref name="dataType" /> type. For example, <see cref="CandleMessage.Arg"/>.</param>
		/// <param name="format">Storage format. If set an extension will be added to the file name.</param>
		/// <returns>The file name.</returns>
		[Obsolete]
		public static string GetFileName(Type dataType, object arg, StorageFormats? format = null)
		{
			if (dataType == null)
				throw new ArgumentNullException(nameof(dataType));

			return GetFileName(DataType.Create(dataType, arg), format);
		}

		private const string _dateFormat = "yyyy_MM_dd";

		/// <summary>
		/// Convert directory name to the date.
		/// </summary>
		/// <param name="dirName">Directory name.</param>
		/// <returns>The date.</returns>
		public static DateTime GetDate(string dirName)
		{
			return dirName.ToDateTime(_dateFormat).UtcKind();
		}

		/// <summary>
		/// Convert the date to directory name.
		/// </summary>
		/// <param name="date">The date.</param>
		/// <returns>Directory name.</returns>
		public static string GetDirName(DateTime date)
		{
			return date.ToString(_dateFormat);
		}

		/// <summary>
		/// To get the path to the folder with market data for the instrument.
		/// </summary>
		/// <param name="securityId">Security ID.</param>
		/// <returns>The path to the folder with market data.</returns>
		public string GetSecurityPath(SecurityId securityId)
		{
			var id = securityId == default ? TraderHelper.AllSecurity.Id : securityId.ToStringId();

			var folderName = id.SecurityIdToFolderName();

			return IOPath.Combine(Path, folderName.Substring(0, 1), folderName);
		}
	}
}


text:
require 'rails_helper'
require "#{Rails.root}/lib/wiki_course_edits"

describe WikiCourseEdits do
  let(:course) { create(:course, id: 1, submitted: true, home_wiki_id: 1) }
  let(:user) { create(:user) }
  let(:enrolling_user) { create(:user, username: 'EnrollingUser') }

  before :each do
    stub_oauth_edit
  end

  describe '#update_course' do
    it 'edits a Wikipedia page representing a course' do
      expect_any_instance_of(WikiEdits).to receive(:post_whole_page).and_call_original
      WikiCourseEdits.new(action: :update_course,
                          course: course,
                          current_user: user)
    end

    it 'edits the course page with the delete option' do
      expect_any_instance_of(WikiEdits).to receive(:post_whole_page).and_call_original
      WikiCourseEdits.new(action: :update_course,
                          course: course,
                          current_user: user,
                          delete: true)
    end

    it 'reposts a clean version after hitting the spamblacklist' do
      stub_oauth_edit_spamblacklist
      expect_any_instance_of(WikiEdits).to receive(:post_whole_page).twice.and_call_original
      WikiCourseEdits.new(action: :update_course,
                          course: course,
                          current_user: user)
    end
  end

  describe '#announce_course' do
    # Posts to the Wiki Education dashboard by default in tests
    it 'posts to the userpage of the instructor and a noticeboard' do
      expect_any_instance_of(WikiEdits).to receive(:add_to_page_top) # userpage edit
      expect_any_instance_of(WikiEdits).to receive(:add_new_section) # noticeboard edit
      WikiCourseEdits.new(action: :announce_course,
                          course:  course,
                          current_user: user,
                          instructor: nil) # defaults to current user
    end

    context 'makes correct edits on the Wiki Education Dashboard' do
      it 'posts to dashboard using correct templates' do
        expect_any_instance_of(WikiEdits).to receive(:add_to_page_top)
          .with("User:Ragesock",
                user,
                "{{course instructor|course = [[#{course.wiki_title}]] }}\n",
                "New course announcement: [[#{course.wiki_title}]].")
        WikiCourseEdits.new(action: :announce_course,
                            course:  course,
                            current_user: user,
                            instructor: nil)
      end
    end

    context 'makes correct edits on P&E Outreach Dashboard' do
      before :each do
        @dashboard_url = ENV['dashboard_url']
        ENV['dashboard_url'] = "outreachdashboard.wmflabs.org"
      end

      after :each do
        ENV['dashboard_url'] = @dashboard_url
      end

      context 'for enabled projects' do
        it 'posts to P&E Dashboard' do
          expect_any_instance_of(WikiEdits).to receive(:add_to_page_top)
          expect_any_instance_of(WikiEdits).to receive(:add_new_section)
          WikiCourseEdits.new(action: :announce_course,
                              course:  course,
                              current_user: user,
                              instructor: nil)
        end

        it 'posts to P&E Dashboard with correct template' do
          expect_any_instance_of(WikiEdits).to receive(:add_to_page_top)
            .with("User:Ragesock",
                  user,
                  "{{program instructor|course = [[#{course.wiki_title}]] }}\n",
                  "New course announcement: [[#{course.wiki_title}]].")
          WikiCourseEdits.new(action: :announce_course,
                              course:  course,
                              current_user: user,
                              instructor: nil)
        end
      end

      context 'for disabled projects' do
        before { stub_wiki_validation }
        let(:wiki) {create(:wiki, language: 'pt', project: 'wikipedia') }
        let(:course) { create(:course, id: 1, submitted: true, home_wiki_id: wiki.id) }

        it 'does not post to P&E Dashboard' do
          expect_any_instance_of(WikiEdits).to_not receive(:add_to_page_top)
          expect_any_instance_of(WikiEdits).to_not receive(:add_new_section)
          WikiCourseEdits.new(action: :announce_course,
                              course:  course,
                              current_user: user,
                              instructor: nil)
        end
      end
    end
  end

  describe '#enroll_in_course' do
    # Posts to the Wiki Education dashboard by default in tests
    it 'posts to the userpage of the enrolling student and their sandbox' do
      expect_any_instance_of(WikiEdits).to receive(:add_to_page_top).thrice
      WikiCourseEdits.new(action: :enroll_in_course,
                          course: course,
                          current_user: user,
                          enrolling_user: enrolling_user)
    end

    context 'makes correct edits on P&E Outreach Dashboard' do
      before :each do
        @dashboard_url = ENV['dashboard_url']
        ENV['dashboard_url'] = "outreachdashboard.wmflabs.org"
      end

      after do
        ENV['dashboard_url'] = @dashboard_url
      end

      context 'for enabled projects' do
        it 'posts to P&E Dashboard' do
          # Only twice for outreachdashboard, for user page and talk page.
          # Sandbox templates are skipped for non-Wiki Ed edits.
          expect_any_instance_of(WikiEdits).to receive(:add_to_page_top).twice
          WikiCourseEdits.new(action: :enroll_in_course,
                              course: course,
                              current_user: user,
                              enrolling_user: enrolling_user)
        end
      end

      context 'for disabled projects' do
        before { stub_wiki_validation }
        let(:wiki) {create(:wiki, language: 'pt', project: 'wikipedia')}
        let(:course) { create(:course, id: 1, submitted: true, home_wiki_id: wiki.id) }

        it 'does not post to P&E Dashboard' do
          expect_any_instance_of(WikiEdits).to_not receive(:add_to_page_top)
          WikiCourseEdits.new(action: :enroll_in_course,
                              course: course,
                              current_user: user,
                              enrolling_user: enrolling_user)
        end
      end
    end
  end

  describe '#update_assignments' do
    before { stub_wiki_validation }
    let(:selfie) { create(:article, title: 'Selfie') }
    let(:selfie_talk) { create(:article, title: 'Selfie', namespace: Article::Namespaces::TALK) }
    let(:redirect) { create(:article, title: 'Athletics_in_Epic_Poetry') }

    context 'when the course is not yet approved for a campaign' do
      it 'does not make assignment edits' do
        expect_any_instance_of(WikiEdits).not_to receive(:post_whole_page)
        create(:assignment,
               user_id: user.id,
               course_id: course.id,
               article_title: 'Selfie',
               article_id: selfie.id,
               role: Assignment::Roles::ASSIGNED_ROLE)
        create(:assignment,
               user_id: user.id,
               course_id: course.id,
               article_title: 'Talk:Selfie',
               article_id: selfie_talk.id,
               role: Assignment::Roles::REVIEWING_ROLE)
        WikiCourseEdits.new(action: :update_assignments,
                            course: course,
                            current_user: user)
      end
    end

    context 'when the course is approved and in a campaign' do
      let(:campaign) { create(:campaign) }
      let!(:campaigns_course) do
        create(:campaigns_course, campaign_id: campaign.id, course_id: course.id)
      end

      context 'posts are made' do
        before :each do
          stub_raw_action
          allow_any_instance_of(WikiApi).to receive(:redirect?).and_return(false)
          create(:assignment,
                 user_id: user.id,
                 course_id: course.id,
                 article_title: 'Selfie',
                 article_id: selfie.id,
                 role: Assignment::Roles::ASSIGNED_ROLE)
          create(:assignment,
                 user_id: user.id,
                 course_id: course.id,
                 article_title: 'Talk:Selfie',
                 article_id: selfie_talk.id,
                 role: Assignment::Roles::REVIEWING_ROLE)
        end

        # Posts to the Wiki Education dashboard by default in tests
        it 'updates talk pages and course page with assignment info' do
          expect_any_instance_of(WikiEdits).to receive(:post_whole_page).at_least(:once)
          WikiCourseEdits.new(action: :update_assignments,
                              course: course,
                              current_user: user)
        end

        context 'makes correct edits on P&E Outreach Dashboard' do
          before :each do
            @dashboard_url = ENV['dashboard_url']
            ENV['dashboard_url'] = "outreachdashboard.wmflabs.org"
          end

          after do
            ENV['dashboard_url'] = @dashboard_url
          end

          context 'for enabled projects' do
            it 'posts to P&E Dashboard' do
              expect_any_instance_of(WikiEdits).to receive(:post_whole_page).at_least(:once)
              WikiCourseEdits.new(action: :update_assignments,
                                  course: course,
                                  current_user: user)
            end
          end

          context 'for disabled projects' do
            let(:wiki) { Wiki.get_or_create(language: 'pt', project: 'wikipedia') }
            let(:course) { create(:course, submitted: true, home_wiki_id: wiki.id) }

            it 'does not post to P&E Dashboard' do
              expect_any_instance_of(WikiEdits).to_not receive(:post_whole_page)
              WikiCourseEdits.new(action: :update_assignments,
                                  course: course,
                                  current_user: user)
            end
          end
        end
      end

      context 'posts are not made' do
        it 'does not post if page is a redirect' do
          allow_any_instance_of(WikiApi).to receive(:redirect?).and_return(true)
          expect_any_instance_of(WikiEdits).not_to receive(:post_whole_page)
          create(:assignment,
                 user_id: user.id,
                 course_id: course.id,
                 article_title: 'Athletics_in_Epic_Poetry',
                 article_id: redirect.id,
                 role: Assignment::Roles::ASSIGNED_ROLE)
          WikiCourseEdits.new(action: :update_assignments,
                              course: course,
                              current_user: user)
        end

        it 'does not post if assignment has no article_id' do
          expect_any_instance_of(WikiEdits).not_to receive(:post_whole_page)
          create(:assignment,
                 user_id: user.id,
                 course_id: course.id,
                 article_title: 'Selfie',
                 article_id: nil,
                 role: Assignment::Roles::ASSIGNED_ROLE)
          WikiCourseEdits.new(action: :update_assignments,
                              course: course,
                              current_user: user)
        end

        it 'does not post if assignment is an Available Article with no assigned user' do
          expect_any_instance_of(WikiEdits).not_to receive(:post_whole_page)
          create(:assignment,
                 user_id: nil,
                 course_id: course.id,
                 article_title: 'Selfie',
                 article_id: selfie.id,
                 role: Assignment::Roles::ASSIGNED_ROLE)
          WikiCourseEdits.new(action: :update_assignments,
                              course: course,
                              current_user: user)
        end
      end
    end
  end

  context 'for course types that DO NOT make edits' do
    let(:visiting_scholarship) { create(:visiting_scholarship, submitted: true) }
    let(:editathon) { create(:editathon, submitted: true) }
    let(:legacy_course) { create(:legacy_course) }

    it 'returns immediately without making any edits' do
      expect_any_instance_of(WikiEdits).not_to receive(:post_whole_page)
      WikiCourseEdits.new(action: :update_course,
                          course: visiting_scholarship,
                          current_user: user)
      WikiCourseEdits.new(action: :update_course,
                          course: editathon,
                          current_user: user)
      WikiCourseEdits.new(action: :update_course,
                          course: legacy_course,
                          current_user: user)
    end
  end

  context 'for course types that DO make edits' do
    let(:basic_course) { create(:basic_course, submitted: true) }

    it 'makes edits' do
      expect_any_instance_of(WikiEdits).to receive(:post_whole_page).and_call_original
      WikiCourseEdits.new(action: :update_course,
                          course: basic_course,
                          current_user: user)
    end
  end
end


text:
package com.dualion;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableJpaRepositories("com.dualion.repository")
@EnableTransactionManagement
@EnableElasticsearchRepositories("com.dualion.repository.search")
public class ElasticsearchTestApplication {

	private static final Logger log = LoggerFactory.getLogger(ElasticsearchTestApplication.class);

	public static void main(String[] args) {
        SpringApplication.run(ElasticsearchTestApplication.class, args);
    }

}


text:
This is a simple tool to create a physical photobook.
Server Code is written in PHP and uses the MySQL Database.
Client Code is written in JavaScript/jQuery.

__Please note:__ This Project is in an early state of development, so you might encounter some bugs as well as unimplemented functions. Also, further development states might not be compatible with this version.

[Livedemo](http://online-fotobook-creator.de)

## Features

* Photo upload
* Organize Pictures / Photobooks
* Move (X,Y,Z) and rotate Pictures and Text-Elements
* Zoom Pages
* Next/Previous Page
* Support for Touch Devices

## License

This Project is published under the MIT-License.

The Project uses other Open Source Projects as follows
* jQuery
* jQuery-UI
* jQuery-Rotate
* jQuery-UI-Punch

## Roadmap

* Export to Cewe Photobook File
* Export to other Manufacturer
* Undo Redo
* Mask Pictures
* Administration
* UI for Mobil/Touch Devices
* Install File
* Image Import from various Sources like Facebook or Flickr


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>br.com.simasoft</groupId>
  <artifactId>editorav2</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>editorav2 Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
  	<dependency>
		<groupId>postgresql</groupId>
		<artifactId>postgresql</artifactId>
		<version>9.1-901-1.jdbc4</version>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-core</artifactId>
		<version>4.2.4.RELEASE</version>
	</dependency>
	<dependency>
		<groupId>org.springframework.data</groupId>
		<artifactId>spring-data-jpa</artifactId>
		<version>1.9.2.RELEASE</version>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-test</artifactId>
		<version>4.2.4.RELEASE</version>
	</dependency>
	<dependency>
		<groupId>org.hibernate</groupId>
		<artifactId>hibernate-core</artifactId>
		<version>4.3.11.Final</version>
	</dependency>
	<dependency>
		<groupId>commons-dbcp</groupId>
		<artifactId>commons-dbcp</artifactId>
		<version>1.4</version>
	</dependency>
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-core</artifactId>
		<version>2.5</version>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-simple</artifactId>
		<version>1.7.16</version>
	</dependency>
    <dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.12</version>
	</dependency>
  </dependencies>
  <build>
    <finalName>editorav2</finalName>
  </build>
</project>


text:
#ifndef TM_SDRAM_H
#define TM_SDRAM_H 100
/**
 * Library dependencies
 * - STM32F4xx
 * - STM32F4xx RCC
 * - STM32F4xx GPIO
 * - STM32F4xx FMC
 * - defines.h
 */
/**
 * Includes
 */
#include "stm32f4xx.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_fmc.h"
#include "defines.h"
//SDRAM start address
#define SDRAM_START_ADR			(uint32_t)0xD0000000
//SDRAM max memory width = 8MB
#define SDRAM_MEMORY_WIDTH		(uint32_t)0x800000

#define SDRAM_TIMEOUT			((uint32_t)0xFFFF)

/**
 * Initialize SD ram
 *
 * Returns 0 if SDRAM was not properly configured, otherwise 1
 */
extern uint8_t TM_SDRAM_Init(void);

/**
 * Initialize SD ram used pins for FMC
 *
 * Called internally
 */
extern void TM_SDRAM_InitPins(void);

/**
 * Write 8 bit value to SDRAM
 *
 * Parameters:
 * 	- uint32_t address:
 * 		address from 0x000000 to 0x7FFFFF for 8MBytes
 * 	- uint8_t value:
 * 		value to be saved in SDRAM
 */
extern uint8_t TM_SDRAM_Write8(uint32_t address, uint8_t value);

/**
 * Read 8 bit value from SDRAM
 *
 * Parameters:
 * 	- uint32_t address
 * 		address to read from ram location
 * Return: value stored at desired location
 */
extern uint8_t TM_SDRAM_Read8(uint32_t address);

/**
 * Write 16 bit value to SDRAM
 *
 * Parameters:
 * 	- uint32_t address:
 * 		address from 0x000000 to 0x7FFFFF for 8MBytes
 * 	- uint16_t value:
 * 		value to be saved in SDRAM
 */
extern uint8_t TM_SDRAM_Write16(uint32_t address, uint16_t value);

/**
 * Read 16 bit value from SDRAM
 *
 * Parameters:
 * 	- uint32_t address
 * 		address to read from ram location
 * Return: value stored at desired location
 */
extern uint16_t TM_SDRAM_Read16(uint32_t address);

/**
 * Write 32 bit value to SDRAM
 *
 * Parameters:
 * 	- uint32_t address:
 * 		address from 0x00 to 0x7FFFFF for 8MBytes
 * 	- uint32_t value:
 * 		value to be saved in SDRAM
 */
extern uint8_t TM_SDRAM_Write32(uint32_t address, uint32_t value);

/**
 * Read 32 bit value from SDRAM
 *
 * Parameters:
 * 	- uint32_t address
 * 		address to read from ram location
 * Return: value stored at desired location
 */
extern uint32_t TM_SDRAM_Read32(uint32_t address);

#endif


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using WzComparerR2.WzLib;
using WzComparerR2.Animation;

namespace WzComparerR2.MapRender
{
    public class ParticleDesc
    {
        public string Name { get; set; }
        public int TotalParticle { get; set; }
        public float Angle { get; set; }
        public float AngleVar { get; set; }
        public float Duration { get; set; }
        public ParticleBlendFunc BlendFuncSrc { get; set; }
        public ParticleBlendFunc BlendFuncDst { get; set; }
        public Color StartColor { get; set; }
        public Color StartColorVar { get; set; }
        public Color EndColor { get; set; }
        public Color EndColorVar { get; set; }
        public int MiddlePoint0 { get; set; }
        public int MiddlePointAlpha0 { get; set; }
        public int MiddlePoint1 { get; set; }
        public int MiddlePointAlpha1 { get; set; }
        public float StartSize { get; set; }
        public float StartSizeVar { get; set; }
        public float EndSize { get; set; }
        public float EndSizeVar { get; set; }
        public float PosX { get; set; }
        public float PosY { get; set; }
        public float PosVarX { get; set; }
        public float PosVarY { get; set; }
        public float StartSpin { get; set; }
        public float StartSpinVar { get; set; }
        public float EndSpin { get; set; }
        public float EndSpinVar { get; set; }
        public ParticleGravityDesc Gravity { get; set; }
        public ParticleRadiusDesc Radius { get; set; }
        public float Life { get; set; }
        public float LifeVar { get; set; }
        public bool OpacityModifyRGB { get; set; }
        public int PositionType { get; set; }
        public Frame Texture { get; set; }
    }

    public class ParticleGravityDesc
    {
        public float X { get; set; }
        public float Y { get; set; }
        public float Speed { get; set; }
        public float SpeedVar { get; set; }
        public float RadialAccel { get; set; }
        public float RadialAccelVar { get; set; }
        public float TangentialAccel { get; set; }
        public float TangentialAccelVar { get; set; }
        public bool RotationIsDir { get; set; }
    }

    public class ParticleRadiusDesc
    {
        public float StartRadius { get; set; }
        public float StartRadiusVar { get; set; }
        public float EndRadius { get; set; }
        public float EndRadiusVar { get; set; }
        public float RotatePerSecond { get; set; }
        public float RotatePerSecondVar { get; set; }
    }

    //same as d3d11blend
    public enum ParticleBlendFunc
    {
        ZERO = 1,
        ONE = 2,
        SRC_COLOR = 3,
        INV_SRC_COLOR = 4,
        SRC_ALPHA = 5,
        INV_SRC_ALPHA = 6,
        DEST_ALPHA = 7,
        INV_DEST_ALPHA = 8,
        DEST_COLOR = 9,
        INV_DEST_COLOR = 10,
    }
}


text:
package com.belonk.quartz.examples.example13;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.PersistJobDataAfterExecution;

/**
 * This job has the same functionality of SimpleRecoveryJob except that this job implements is 'stateful', in that it
 * will have it's data (JobDataMap) automatically re-persisted after each execution, and only one instance of the
 * JobDetail can be executed at a time.
 *
 * @author Bill Kratzer
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class SimpleRecoveryStatefulJob extends SimpleRecoveryJob {

  public SimpleRecoveryStatefulJob() {
    super();
  }
}


text:
package in.tombo.kashiki.keybind;

public class Stroke {
  private SupportKey supportKey;
  private int key;

  public Stroke(SupportKey supportKey, int key) {
    this.supportKey = supportKey;
    this.key = key;
  }

  public SupportKey getSupportKey() {
    return supportKey;
  }

  public int getKey() {
    return key;
  }

  @Override
  public String toString() {
    return String.format("Stroke[%s-%s]", supportKey, key);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj instanceof Stroke) {
      Stroke stroke = (Stroke) obj;
      return (this.key == stroke.key) && (this.supportKey == stroke.supportKey);
    }
    return false;
  }
}


text:
enyo.requiresWindow(function() {
	if (window.PalmSystem) {
		var xhr = window.enyo.xhr.request({url: Tellurium.nubPath + "tellurium_config.json", sync: true});
		var resp = xhr && xhr.responseText;
		if (!resp || !resp.length) {
			return;
		}
		window.addEventListener('load', function() {
			Tellurium.setup(window.enyo);
			console.log("Tellurium loading...");
		}, false);
	}
});


text:
Hikr Elevation Service
======================

Parses GeoJSON files (sent as pasted text) by adding elevation to all coordinates: paths, points and polygons. _Requires SRTM data_.

**Warning**
If you7re trying to run this service and coming up with errors, note the `elevation` folder. For the elevation service to function properly, it needs to be filled with .hgt files in the SRTM format, named according to the pattern `N34E135.hgt`. The script assumes this file to contain elevation data for latitude 34 degrees north and longitude 135 degrees east.

Thanks
------

Big thanks to Henri and Frank.

This service wouldn't be possible without NASA's SRTM data.

License
-------
The code is licensed under the MIT license. See License.md for details.