text:
package org.gw4e.eclipse.studio.model;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class ModelProperties {
	public static final String PROPERTY_NAME = "name";
	public static final String PROPERTY_BLOCKED = "blocked";
	public static final String PROPERTY_DESCRIPTION = "description";
	public static final String PROPERTY_CUSTOM = "custom";
	public static final String PROPERTY_COMPONENT = "component";

	public static final String PROPERTY_GRAPH_START_ELEMENT = "graph.start.element";

	public static final String PROPERTY_VERTEX_SHARED = "vertex.shared";
	public static final String PROPERTY_VERTEX_REQUIREMENTS = "vertex.requirements";
	public static final String PROPERTY_VERTEX_SHAREDNAME = "vertex.shared.name";
	public static final String PROPERTY_VERTEX_INIT = "vertex.init";

	public static final String PROPERTY_EDGE_GUARD = "edge.guard";
	public static final String PROPERTY_EDGE_ACTION = "edge.action";
	public static final String PROPERTY_EDGE_WEIGHT = "edge.weight";
	public static final String PROPERTY_EDGE_DEPENDENCY= "edge.dependency";

	public static final String PROPERTY_EDGE_BENDPOINT= "gw.edge.bendpoint.";
	public static final String PROPERTY_VERTEX_INIT_SCRIPT = "gw.vertex.init.script";
	public static final String PROPERTY_VERTEX_WIDTH = "width";
	public static final String PROPERTY_VERTEX_HEIGHT = "height";
	public static final String PROPERTY_VERTEX_X = "x";
	public static final String PROPERTY_VERTEX_Y = "y";

	public static boolean isCustomProperty(String key) {
		if (key == null) return false;
		String temp = key.trim();
		if (PROPERTY_DESCRIPTION.equalsIgnoreCase(temp)) return false;
		if (PROPERTY_BLOCKED.equalsIgnoreCase(temp)) return false;

		if (PROPERTY_VERTEX_INIT_SCRIPT.equalsIgnoreCase(temp)) return false;
		if (PROPERTY_VERTEX_WIDTH.equalsIgnoreCase(temp)) return false;
		if (PROPERTY_VERTEX_HEIGHT.equalsIgnoreCase(temp)) return false;
		if (PROPERTY_VERTEX_X.equalsIgnoreCase(temp)) return false;
		if (PROPERTY_VERTEX_Y.equalsIgnoreCase(temp)) return false;

		if (temp.startsWith(PROPERTY_EDGE_BENDPOINT)) return false;
		return true;
	}

	public static Map<String, Object> filterCustomProperty(Map<String, Object> properties) {
		Map<String, Object> ret = new HashMap<String, Object>();
		Iterator<String> iter = properties.keySet().iterator();
		while (iter.hasNext()) {
			String key = (String) iter.next();
			if (!isCustomProperty(key)) continue;
			Object value = properties.get(key);
			ret.put(key, value);
		}
		return ret;
	}
}


text:
package org.apache.camel.component.file.remote;

import java.io.File;
import java.io.InputStream;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.file.GenericFile;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class FtpStreamingMoveTest extends FtpServerTestSupport {

    private String getFtpUrl() {
        return "ftp://admin@localhost:{{ftp.server.port}}"
               + "/mymove?password=admin&delay=1000&streamDownload=true&move=done&stepwise=false";
    }

    @Override
    @BeforeEach
    public void setUp() throws Exception {
        super.setUp();
        deleteDirectory("target/mymove");
    }

    @Test
    public void testStreamDownloadMove() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");

        sendFile(getFtpUrl(), "Hello World", "hello.txt");

        context.getRouteController().startRoute("foo");

        assertMockEndpointsSatisfied();

        GenericFile<?> remoteFile = (GenericFile<?>) mock.getExchanges().get(0).getIn().getBody();
        assertTrue(remoteFile.getBody() instanceof InputStream);

        // give time for consumer to rename file
        Thread.sleep(1000);

        File file = new File(service.getFtpRootDir() + "/mymove/done/hello.txt");
        assertTrue(file.exists(), "File should have been renamed");
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from(getFtpUrl()).routeId("foo").noAutoStartup().to("mock:result");
            }
        };
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System.Reactive;
using ReactiveUI;
using ReactiveUI.Legacy;

namespace GitHub.ViewModels.GitHubPane
{
    /// <summary>
    /// Defines the view model for the "Login Failed" view in the GitHub pane.
    /// </summary>
    public interface ILoginFailedViewModel : IPanePageViewModel
    {
        /// <summary>
        /// Gets a description of the login failure.
        /// </summary>
        UserError LoginError { get; }

        /// <summary>
        /// Gets a command which opens the Team Explorer Connect page.
        /// </summary>
        ReactiveCommand<Unit, Unit> OpenTeamExplorer { get; }

        /// <summary>
        /// Initializes the view model with an error.
        /// </summary>
        /// <param name="error">The error.</param>
        void Initialize(UserError error);
    }
}


text:
// Copyright 2016 Cloudera Inc.
//
// Licensed 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 com.cloudera.recordservice.tests;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import com.cloudera.recordservice.core.NetworkAddress;
import com.cloudera.recordservice.core.RecordServiceException;
import com.cloudera.recordservice.core.RecordServicePlannerClient;
import com.cloudera.recordservice.core.Request;
import com.cloudera.recordservice.mr.RecordServiceConfig;
import com.cloudera.recordservice.mr.ZooKeeperUtil;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.ACLProvider;
import org.apache.curator.framework.recipes.cache.PathChildrenCache;
import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent.Type;
import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.hadoop.conf.Configuration;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.data.ACL;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static com.cloudera.recordservice.tests.MiniClusterController.MiniClusterNode;

/**
 * This class tests the {@link com.cloudera.recordservice.mr.ZooKeeperUtil} class.
 * In particular, the planner auto discovery feature. This is done by starting up
 * a mini cluster.
 */
public class ZooKeeperTest {
  private static final int PLANNER_NUM = 10;
  private static final int SAMPLE_PLANNER_NUM = 3;

  // Maximum time (in sec) to wait for ZK to update membership info
  private static final int MAX_WAIT_SEC = 120;

  private static MiniClusterController controller_;
  private static Random rand_;

  // The ZK session and cache used to track membership change
  private static CuratorFramework cf_;
  private static PathChildrenCache cache_;

  // A single threaded executor used for running futures waiting for ZK event
  private static final ExecutorService executor_ = Executors.newSingleThreadExecutor();

  private static final String testConnectionStr = "localhost:2181";

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    org.apache.log4j.BasicConfigurator.configure();
    MiniClusterController.Start(0);
    controller_ = MiniClusterController.instance();
    rand_ = new Random();
    cf_ = CuratorFrameworkFactory.builder()
        .connectString(testConnectionStr)
        .connectionTimeoutMs(30 * 1000)
        .aclProvider(new TestACLProvider())
        .retryPolicy(new ExponentialBackoffRetry(1000, 3))
        .build();
    cf_.start();
    cache_ = new PathChildrenCache(cf_,
        RecordServiceConfig.ZOOKEEPER_ZNODE_DEFAULT + "/planners", true);
    cache_.start();
  }

  @AfterClass
  public static void setUpAfterClass() throws Exception {
    cf_.close();
    cache_.getListenable().clear();
    cache_.close();
    executor_.shutdownNow();
    executor_.awaitTermination(1, TimeUnit.MINUTES);
  }

  /**
   * Test ZooKeeper planner membership auto discovery for MR jobs.
   * TODO: add some negative tests
   * TODO: if the user who runs this test has kerberos credentials, then the test
   * will fail. We need to understand the reason.
   */
  @Test
  public void testPlanners() throws IOException, InterruptedException,
      ExecutionException {
    // Add a worker so that planning request won't fail
    controller_.addRecordServiced(false, true);

    List<MiniClusterNode> planners = new ArrayList<MiniClusterNode>();
    for (int i = 0; i < PLANNER_NUM; ++i) {
      planners.add(controller_.addRecordServiced(true, false));
    }

    Configuration conf = new Configuration();
    conf.set(RecordServiceConfig.ConfVars.ZOOKEEPER_CONNECTION_STRING_CONF.name,
        testConnectionStr);
    List<NetworkAddress> plannerAddresses = ZooKeeperUtil.getPlanners(conf);

    RecordServicePlannerClient planner = null;
    for (int i = 0; i < SAMPLE_PLANNER_NUM; ++i) {
      NetworkAddress address = plannerAddresses.get(rand_.nextInt(PLANNER_NUM));
      try {
        planner = new RecordServicePlannerClient.Builder().connect(
            address.hostname, address.port);
        planner.planRequest(Request.createTableScanRequest("tpch.nation"));
      } catch (RecordServiceException e) {
        assertTrue("Expected planning to succeed at address "
            + address + ", but failed with exception " + e, false);
      } finally {
        if (planner != null) planner.close();
      }
    }

    // Now randomly kill a planner node, and we should expect the addresses from
    // ZK to match the updated planner nodes.
    MiniClusterNode nodeToKill = planners.get(rand_.nextInt(PLANNER_NUM));

    // We need to create the future first and then check the future. This is because
    // the 'killNode' call also waits for certain amount of time, during which
    // the ZK event may already triggered.
    Future<Void> future = createEventFuture(Type.CHILD_REMOVED);
    controller_.killNode(nodeToKill);
    planners.remove(nodeToKill);
    checkEventFuture(future, Type.CHILD_REMOVED);
    plannerAddresses = ZooKeeperUtil.getPlanners(conf);
    checkAlivePlanners(plannerAddresses, planners);

    // Make sure the killed node is not in ZK addresses
    for (NetworkAddress addr : plannerAddresses) {
      if (addr.hostname.equals(nodeToKill.hostname_) &&
          addr.port == nodeToKill.plannerPort_) {
        assertFalse("Expected node at port " + nodeToKill.plannerPort_
            + " to be killed, but still found it in the ZK addresses.", true);
      }
    }

    // Attempt to plan on the killed node should fail
    try {
      planner = new RecordServicePlannerClient.Builder().connect(
          nodeToKill.hostname_, nodeToKill.plannerPort_);
      planner.planRequest(Request.createTableScanRequest("tpch.nation"));
      assertTrue("Expected planning on the killed node:\n" + nodeToKill
          + "\nto fail, but it still succeeded.", false);
    } catch (IOException e) {
      // Do nothing
    } catch (RecordServiceException e) {
      assertTrue("Expected IOException, but got: " + e.getClass().getName(), false);
    } finally {
      if (planner != null) planner.close();
    }

    // Adding a new planner node. The ZK addresses should also be updated accordingly
    future = createEventFuture(Type.CHILD_ADDED);
    MiniClusterNode nodeToAdd = controller_.addRecordServiced(true, false);
    planners.add(nodeToAdd);
    checkEventFuture(future, Type.CHILD_ADDED);
    checkAlivePlanners(ZooKeeperUtil.getPlanners(conf), planners);

    // We should also be able to plan request on the new node
    try {
      planner = new RecordServicePlannerClient.Builder().connect(
          nodeToAdd.hostname_, nodeToAdd.plannerPort_);
      planner.planRequest(Request.createTableScanRequest("tpch.nation"));
    } catch (RecordServiceException e) {
      assertTrue("Expected planning to succeed at address "
          + nodeToAdd.plannerPort_ + ", but failed with exception " + e, false);
    } finally {
      if (planner != null) planner.close();
    }
  }

  /**
   * Check whether the 'plannerAddresses' monitored by ZK include all addresses
   * of planners in 'planners' from the mini cluster.
   */
  private void checkAlivePlanners(List<NetworkAddress> plannerAddresses,
                                  List<MiniClusterNode> planners) {
    List<MiniClusterNode> plannersCopy = new ArrayList<MiniClusterNode>(planners);
    Iterator<MiniClusterNode> it = plannersCopy.iterator();
    while (it.hasNext()) {
      MiniClusterNode node = it.next();
      for (NetworkAddress addr : plannerAddresses) {
        if (addr.hostname.equals(node.hostname_) && addr.port == node.plannerPort_) {
          it.remove();
        }
      }
    }
    assertEquals("Found " + plannersCopy.size() + " that are not in the addresses" +
        " tracked by ZooKeeper", 0, plannersCopy.size());
  }

  /**
   * Returns a future that waits for the particular 'eventType' to happen in the
   * path tracked by 'cache_'.
   */
  private Future<Void> createEventFuture(final Type eventType)
      throws InterruptedException {
    final Status status = new Status();
    PathChildrenCacheListener listener = new PathChildrenCacheListener() {
      @Override
      public void childEvent(CuratorFramework cf, PathChildrenCacheEvent event)
          throws Exception {
        if (event.getType() == eventType) {
          status.done = true;
        }
      }
    };
    cache_.getListenable().clear();
    cache_.getListenable().addListener(listener);

    return executor_.submit(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        // Wait infinitely until the event is triggered
        while (!status.done) {
          TimeUnit.SECONDS.sleep(1);
        }
        return null;
      }
    });
  }

  // Wait until the future finished. Fail the test if timeout.
  private void checkEventFuture(Future<Void> future, Type eventType)
      throws ExecutionException, InterruptedException {
    try {
      future.get(MAX_WAIT_SEC, TimeUnit.SECONDS);
    } catch (TimeoutException e) {
      future.cancel(true);
      assertFalse("The event " + eventType + " didn't happen.", true);
    }
  }

  private static class Status {
    volatile boolean done = false;
  }

  private static class TestACLProvider implements ACLProvider {
    @Override
    public List<ACL> getDefaultAcl() {
      return ZooDefs.Ids.READ_ACL_UNSAFE;
    }
    @Override
    public List<ACL> getAclForPath(String s) {
      return getDefaultAcl();
    }
  }

}


text:
class Solution {

  public double findMedianSortedArrays(int A[], int B[]) {

  }

  public static void main(String[] args) {

  }

}


text:
package com.spotify.heroic.generator.sine;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.spotify.heroic.common.Duration;
import com.spotify.heroic.dagger.PrimaryComponent;
import com.spotify.heroic.generator.MetricGeneratorModule;
import dagger.Component;
import dagger.Module;
import dagger.Provides;

import javax.inject.Named;
import java.util.Optional;
import java.util.concurrent.TimeUnit;

import static java.util.Optional.empty;

public class SineMetricGeneratorModule implements MetricGeneratorModule {
    public static final double DEFAULT_MAGNITUDE = 100D;
    public static final Duration DEFAULT_PERIOD = Duration.of(1, TimeUnit.DAYS);
    public static final double DEFAULT_JITTER = 50D;
    public static final double DEFAULT_OFFSET = 1000D;

    private final Optional<String> id;
    private final double magnitude;
    private final Duration period;
    private final Duration step;
    private final double jitter;
    private final double offset;

    @JsonCreator
    public SineMetricGeneratorModule(
        @JsonProperty("id") Optional<String> id,
        @JsonProperty("magnitude") Optional<Double> magnitude,
        @JsonProperty("period") Optional<Duration> period,
        @JsonProperty("step") Optional<Duration> step,
        @JsonProperty("jitter") Optional<Double> jitter,
        @JsonProperty("offset") Optional<Double> offset
    ) {
        this.id = id;
        this.magnitude = magnitude.orElse(DEFAULT_MAGNITUDE);
        this.period = period.orElse(DEFAULT_PERIOD);
        this.step = step.orElseGet(
            () -> Duration.of(this.period.toMilliseconds() / 100, TimeUnit.MILLISECONDS));
        this.jitter = jitter.orElse(DEFAULT_JITTER);
        this.offset = offset.orElse(DEFAULT_OFFSET);
    }

    @Override
    public Optional<String> id() {
        return id;
    }

    @Override
    public Exposed module(
        final PrimaryComponent primary, final Depends depends, final String id
    ) {
        return DaggerSineMetricGeneratorModule_C
            .builder()
            .primaryComponent(primary)
            .depends(depends)
            .m(new M())
            .build();
    }

    @Override
    public String buildId(final int index) {
        return "sine";
    }

    @SineScope
    @Component(modules = M.class, dependencies = {PrimaryComponent.class, Depends.class})
    interface C extends Exposed {
        @Override
        SineGenerator generator();
    }

    @Module
    class M {
        @Provides
        @Named("magnitude")
        double magnitude() {
            return magnitude;
        }

        @Provides
        @Named("period")
        Duration period() {
            return period;
        }

        @Provides
        @Named("step")
        Duration step() {
            return step;
        }

        @Provides
        @Named("jitter")
        double jitter() {
            return jitter;
        }

        @Provides
        @Named("offset")
        double offset() {
            return offset;
        }
    }

    public static SineMetricGeneratorModule defaultInstance() {
        return new SineMetricGeneratorModule(empty(), empty(), empty(), empty(), empty(), empty());
    }
}


text:
title: «DICOM 1+2» (Project)
categories: [cv, project]
layout: "posts"
---

1998.05 - 2000.05
GE Vingmed Ultrasound AS
Prosjektleder, arkitekt, UI-designer og utvikler.
Beskrivelse: DICOM er en standard for utveksling av medisinske bilder som skulle integreres med EchoPAC - Vingmeds applikasjon for arkivering og analyse av ultralydsbilder og måledata.
Tommy ledet dette 2-manns prosjektet som gikk gjennom 2 produkt-utslipp og møtte alle krav fra salgsorganisasjonen.
Teknologi: C++, C og Pascal på MacOS Classic.
Hovedoppgaver og ansvar: Prosjektledelse, løsningsarkitektur, design av UI og interaksjon, utvikling og testing.


text:
<?php

namespace Symfony\Bundle\FrameworkBundle\Translation;

/*
 * The following is derived from code at http://github.com/nikic/PHP-Parser
 *
 * Copyright (c) 2011 by Nikita Popov
 *
 * Some rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *
 *     * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *       with the distribution.
 *
 *     * The names of the contributors may not be used to endorse or
 *       promote products derived from this software without specific
 *       prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

class PhpStringTokenParser
{
    protected static $replacements = array(
        '\\' => '\\',
        '$'  =>  '$',
        'n'  => "\n",
        'r'  => "\r",
        't'  => "\t",
        'f'  => "\f",
        'v'  => "\v",
        'e'  => "\x1B",
    );

    /**
     * Parses a string token.
     *
     * @param string $str String token content
     *
     * @return string The parsed string
     */
    public static function parse($str)
    {
        $bLength = 0;
        if ('b' === $str[0]) {
            $bLength = 1;
        }

        if ('\'' === $str[$bLength]) {
            return str_replace(
                array('\\\\', '\\\''),
                array(  '\\',   '\''),
                substr($str, $bLength + 1, -1)
            );
        } else {
            return self::parseEscapeSequences(substr($str, $bLength + 1, -1), '"');
        }
    }

    /**
     * Parses escape sequences in strings (all string types apart from single quoted).
     *
     * @param string      $str   String without quotes
     * @param null|string $quote Quote type
     *
     * @return string String with escape sequences parsed
     */
    public static function parseEscapeSequences($str, $quote)
    {
        if (null !== $quote) {
            $str = str_replace('\\' . $quote, $quote, $str);
        }

        return preg_replace_callback(
            '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3})~',
            array(__CLASS__, 'parseCallback'),
            $str
        );
    }

    public static function parseCallback($matches)
    {
        $str = $matches[1];

        if (isset(self::$replacements[$str])) {
            return self::$replacements[$str];
        } elseif ('x' === $str[0] || 'X' === $str[0]) {
            return chr(hexdec($str));
        } else {
            return chr(octdec($str));
        }
    }

    /**
     * Parses a constant doc string.
     *
     * @param string $startToken Doc string start token content (<<<SMTHG)
     * @param string $str        String token content
     *
     * @return string Parsed string
     */
    public static function parseDocString($startToken, $str)
    {
        // strip last newline (thanks tokenizer for sticking it into the string!)
        $str = preg_replace('~(\r\n|\n|\r)$~', '', $str);

        // nowdoc string
        if (false !== strpos($startToken, '\'')) {
            return $str;
        }

        return self::parseEscapeSequences($str, null);
    }
}


text:
#include <nxt_auto_config.h>

#include <jni.h>
#include <nxt_unit.h>
#include <string.h>

#include "nxt_jni.h"
#include "nxt_jni_InputStream.h"
#include "nxt_jni_URLClassLoader.h"

static jint JNICALL nxt_java_InputStream_readLine(JNIEnv *env, jclass cls,
    jlong req_info_ptr, jarray b, jint off, jint len);
static jboolean JNICALL nxt_java_InputStream_isFinished(JNIEnv *env, jclass cls,
    jlong req_info_ptr);
static jint JNICALL nxt_java_InputStream_readByte(JNIEnv *env, jclass cls,
    jlong req_info_ptr);
static jint JNICALL nxt_java_InputStream_read(JNIEnv *env, jclass cls,
    jlong req_info_ptr, jarray b, jint off, jint len);
static jlong JNICALL nxt_java_InputStream_skip(JNIEnv *env, jclass cls,
    jlong req_info_ptr, jlong n);
static jint JNICALL nxt_java_InputStream_available(JNIEnv *env, jclass cls,
    jlong req_info_ptr);

static jclass  nxt_java_InputStream_class;

int
nxt_java_initInputStream(JNIEnv *env, jobject cl)
{
    int     res;
    jclass  cls;

    cls = nxt_java_loadClass(env, cl, "nginx.unit.InputStream");
    if (cls == NULL) {
        return NXT_UNIT_ERROR;
    }

    nxt_java_InputStream_class = (*env)->NewGlobalRef(env, cls);
    (*env)->DeleteLocalRef(env, cls);

    JNINativeMethod is_methods[] = {
        { (char *) "readLine",
          (char *) "(J[BII)I",
          nxt_java_InputStream_readLine },

        { (char *) "isFinished",
          (char *) "(J)Z",
          nxt_java_InputStream_isFinished },

        { (char *) "read",
          (char *) "(J)I",
          nxt_java_InputStream_readByte },

        { (char *) "read",
          (char *) "(J[BII)I",
          nxt_java_InputStream_read },

        { (char *) "skip",
          (char *) "(JJ)J",
          nxt_java_InputStream_skip },

        { (char *) "available",
          (char *) "(J)I",
          nxt_java_InputStream_available },
    };

    res = (*env)->RegisterNatives(env, nxt_java_InputStream_class,
                                  is_methods,
                                  sizeof(is_methods) / sizeof(is_methods[0]));

    nxt_unit_debug(NULL, "registered InputStream methods: %d", res);

    if (res != 0) {
        (*env)->DeleteGlobalRef(env, cls);
        return NXT_UNIT_ERROR;
    }

    return NXT_UNIT_OK;
}

static jint JNICALL
nxt_java_InputStream_readLine(JNIEnv *env, jclass cls,
    jlong req_info_ptr, jarray out, jint off, jint len)
{
    uint8_t                  *data;
    ssize_t                  res;
    nxt_unit_request_info_t  *req;

    req = nxt_jlong2ptr(req_info_ptr);

    data = (*env)->GetPrimitiveArrayCritical(env, out, NULL);

    res = nxt_unit_request_readline_size(req, len);

    if (res > 0) {
        res = nxt_unit_request_read(req, data + off, res);
    }

    nxt_unit_req_debug(req, "readLine '%.*s'", (int) res, (char *) data + off);

    (*env)->ReleasePrimitiveArrayCritical(env, out, data, 0);

    return res > 0 ? res : -1;
}

static jboolean JNICALL
nxt_java_InputStream_isFinished(JNIEnv *env, jclass cls, jlong req_info_ptr)
{
    nxt_unit_request_info_t  *req;

    req = nxt_jlong2ptr(req_info_ptr);

    return req->content_length == 0;
}

static jint JNICALL
nxt_java_InputStream_readByte(JNIEnv *env, jclass cls, jlong req_info_ptr)
{
    uint8_t                  b;
    ssize_t                  size;
    nxt_unit_request_info_t  *req;

    req = nxt_jlong2ptr(req_info_ptr);

    size = nxt_unit_request_read(req, &b, 1);

    return size == 1 ? b : -1;
}

static jint JNICALL
nxt_java_InputStream_read(JNIEnv *env, jclass cls, jlong req_info_ptr,
    jarray b, jint off, jint len)
{
    uint8_t                  *data;
    ssize_t                  res;
    nxt_unit_request_info_t  *req;

    req = nxt_jlong2ptr(req_info_ptr);

    data = (*env)->GetPrimitiveArrayCritical(env, b, NULL);

    res = nxt_unit_request_read(req, data + off, len);

    nxt_unit_req_debug(req, "read '%.*s'", (int) res, (char *) data + off);

    (*env)->ReleasePrimitiveArrayCritical(env, b, data, 0);

    return res > 0 ? res : -1;
}

static jlong JNICALL
nxt_java_InputStream_skip(JNIEnv *env, jclass cls, jlong req_info_ptr, jlong n)
{
    size_t                   rest, b_size;
    nxt_unit_buf_t           *buf;
    nxt_unit_request_info_t  *req;

    req = nxt_jlong2ptr(req_info_ptr);

    rest = n;

    buf = req->content_buf;

    while (buf != NULL) {
        b_size = buf->end - buf->free;
        b_size = rest < b_size ? rest : b_size;

        buf->free += b_size;
        rest -= b_size;

        if (rest == 0) {
            if (buf->end == buf->free) {
                buf = nxt_unit_buf_next(buf);
            }

            break;
        }

        buf = nxt_unit_buf_next(buf);
    }

    n = n < (jlong) req->content_length ? n : (jlong) req->content_length;

    req->content_length -= n;

    return n;
}

static jint JNICALL
nxt_java_InputStream_available(JNIEnv *env, jclass cls, jlong req_info_ptr)
{
    nxt_unit_request_info_t  *req;

    req = nxt_jlong2ptr(req_info_ptr);

    return req->content_length;
}


text:
<template name="customFieldsForm">
{{#if customFields}}

		{{#each customFields}}

				{{#if $eq field.type 'select'}}
					{{# unless ../new}}

							{{_ fieldName}}

								<select name="{{fieldName}}" data-customfield="true">
									{{#each field.options}}
										<option value="{{.}}" selected="{{selectedField . ..}}">{{_ .}}</option>
									{{/each}}
								</select>

					{{else}}

{{_ fieldName}}

								<select name="{{fieldName}}" data-customfield="true" class="rc-input__element">
									<option></option>
									{{#each field.options}}
										<option value="{{.}}" selected="{{selectedField . ..}}">{{_ .}}</option>
									{{/each}}
								</select>

					{{/unless}}
				{{/if}}
				{{#if $eq field.type 'text'}}
					{{# unless ../new}}

							{{_ fieldName}}

								<input type="text" name="{{fieldName}}" id="{{fieldName}}" data-customfield="true" value="{{fieldValue}}" maxlength="{{field.maxLength}}" />

					{{else}}

{{_ fieldName}}

								<input type="text" class="rc-input__element"  name="{{fieldName}}" id="{{fieldName}}" data-customfield="true" value="{{fieldValue}}" maxlength="{{field.maxLength}}">

					{{/unless}}
				{{/if}}

		{{/each}}

{{/if}}
</template>


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.wjf.dynamicapploader"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"></uses-permission>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>

    <application
        android:name=".MyApplicaiton"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".activity.SplashActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <activity android:name=".activity.MainActivity"></activity>

        <activity android:name=".activity.PluginStoreActivity"></activity>

        <receiver android:name=".receiver.DownloadReceiver">
            <intent-filter>
                <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
                <action android:name="android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED"/>
            </intent-filter>
        </receiver>

        <service android:name="com.wjf.dynamicapploader.service.HostDataService"
                 android:process=":remote">
            <intent-filter>
                <action android:name="android.intent.action.HostDataService" />
            </intent-filter>
        </service>

        <service android:name=".service.HostMessengerService"
                 android:process=":remote">
            <intent-filter>
                <action android:name="android.intent.action.HostMessengerService" />
            </intent-filter>
        </service>
    </application>

</manifest>


text:
module Nanoc
  module Core
    class Document
      include Nanoc::Core::ContractsSupport

      # @return [Nanoc::Core::Content]
      attr_reader :content

      # @return [Nanoc::Core::Identifier]
      attr_reader :identifier

      # @return [String, nil]
      attr_accessor :checksum_data

      # @return [String, nil]
      attr_accessor :content_checksum_data

      # @return [String, nil]
      attr_accessor :attributes_checksum_data

      c_content = C::Or[String, Nanoc::Core::Content]
      c_attributes = C::Or[Hash, Proc]
      c_identifier = C::Or[String, Nanoc::Core::Identifier]
      c_checksum_data = C::KeywordArgs[
        checksum_data: C::Optional[C::Maybe[String]],
        content_checksum_data: C::Optional[C::Maybe[String]],
        attributes_checksum_data: C::Optional[C::Maybe[String]],
      ]

      contract c_content, c_attributes, c_identifier, c_checksum_data => C::Any
      # @param [String, Nanoc::Core::Content] content
      #
      # @param [Hash, Proc] attributes
      #
      # @param [String, Nanoc::Core::Identifier] identifier
      #
      # @param [String, nil] checksum_data
      #
      # @param [String, nil] content_checksum_data
      #
      # @param [String, nil] attributes_checksum_data
      def initialize(content, attributes, identifier, checksum_data: nil, content_checksum_data: nil, attributes_checksum_data: nil)
        @content = Nanoc::Core::Content.create(content)
        @attributes = Nanoc::Core::LazyValue.new(attributes).map(&:__nanoc_symbolize_keys_recursively)
        @identifier = Nanoc::Core::Identifier.from(identifier)

        @checksum_data = checksum_data
        @content_checksum_data = content_checksum_data
        @attributes_checksum_data = attributes_checksum_data

        # Precalculate for performance
        @hash = [self.class, identifier].hash
        reference
      end

      # @return [Hash]
      def attributes
        @attributes.value
      end

      contract C::None => self
      # @return [void]
      def freeze
        super
        @content.freeze
        @attributes.freeze
        self
      end

      contract String => self
      def with_identifier_prefix(prefix)
        other = dup
        other.identifier = @identifier.prefix(prefix)
        other
      end

      contract C::None => String
      # @abstract
      #
      # @return Unique reference to this object
      def reference
        raise NotImplementedError
      end

      contract C::Or[Nanoc::Core::Identifier, String] => Nanoc::Core::Identifier
      def identifier=(new_identifier)
        @identifier = Nanoc::Core::Identifier.from(new_identifier)
      end

      contract Nanoc::Core::Content => C::Any
      def content=(new_content)
        @content = new_content

        @checksum_data = nil
        @content_checksum_data = nil
      end

      def set_attribute(key, value)
        attributes[key] = value

        @checksum_data = nil
        @attributes_checksum_data = nil
      end

      contract C::None => String
      def inspect
        "<#{self.class} identifier=\"#{identifier}\">"
      end

      contract C::None => C::Num
      def hash
        @hash
      end

      contract C::Any => C::Bool
      def ==(other)
        other.respond_to?(:identifier) && identifier == other.identifier
      end

      contract C::Any => C::Bool
      def eql?(other)
        other.is_a?(self.class) && identifier == other.identifier
      end
    end
  end
end


text:
from aurora import webapp
from aurora.webapp import foundation, mapping

__all__ = ['Application']

class Application(webapp.Application):
    """ Web Blogging application
    """

    def __init__(self):
        self.mapper.add_rule(mapping.Route('/'), _handler=self.list_posts)
        self.mapper.add_rule(mapping.Route('/post/(?P<id>\d+)'),
            _handler=self.show_post)
        self.mapper.add_rule(mapping.Route('/compose'),
            _handler=self.add_post)

    def list_posts(self, request: foundation.Request) -> foundation.Response:
        """ List summaries for posts added more recently. """
        return request.response_factory(text="""

List of posts

Post title

                        Post summary (or the initial segment of post
                        content).

Post title

                        Post summary (or the initial segment of post
                        content).

Post title

                        Post summary (or the initial segment of post
                        content).

        """)

    def show_post(self, request: foundation.Request) -> foundation.Response:
        """ Show a post. """
        return request.response_factory(text="""

Post title

                    Post content (full).

        """)

    def add_post(self, request: foundation.Request) -> foundation.Response:
        """ Add a new Blog post. """
        return request.response_factory(text="""

Add new post

                <form action="/add" method="post">
                    <fieldset>
                        <legend>Add Post</legend>

                            Title

                                <input type="text" id="title" name="title"></input>

                            Content

                                <textarea id="content" name="content" class="xlarge" rows="3"></textarea>

                            <input class="btn primary" type="submit" name="submit" value="Add" />

                    </fieldset>
                </form>

        """)

if __name__ == '__main__':
    from wsgiref import simple_server
    from aurora.webapp import foundation

    wsgi_app = foundation.wsgi(Application())
    httpd = simple_server.make_server('', 8008, wsgi_app)

    print("Serving on port 8008...")
    httpd.serve_forever()


text:
import PyKDL
import numpy as np

import urdf_parser_py
from urdf_parser_py.urdf import URDF
import pykdl_utils.kdl_parser as kdl_urdf

# this hack in for fixed torso_1_joint
def kdl_tree_from_urdf_model_velma(urdf, js_inactive_names_vector, js_pos):
    segment_map = {}
    segment_id = 0
    segment_name_id_map = {}
    segment_parent_map = {}
    root = urdf.get_root()
    tree = PyKDL.Tree(root)

    segment_map[segment_id] = None
    segment_parent_map[segment_id] = None
    segment_name_id_map[root] = segment_id
    segment_id += 1

    def add_children_to_tree(parent, segment_id):
        if parent in urdf.child_map:
            for joint, child_name in urdf.child_map[parent]:
                if joint in js_inactive_names_vector:
                    print "setting as fixed:", joint, js_pos[joint]
                    joint_rot = -js_pos[joint]
                    urdf.joint_map[joint].joint_type = 'fixed'
#                if parent == 'torso_link0' and child_name == 'torso_link1':
#                    joint_rot = -torso_1_joint_value
#                    urdf.joint_map[joint].joint_type = 'fixed'
#                elif parent == 'torso_link1' and child_name == 'torso_link2':
#                    joint_rot = torso_1_joint_value
#                    urdf.joint_map[joint].joint_type = 'fixed'
                else:
                    joint_rot = 0.0
                child = urdf.link_map[child_name]
                if child.inertial is not None:
                    kdl_inert = kdl_urdf.urdf_inertial_to_kdl_rbi(child.inertial)
                else:
                    kdl_inert = PyKDL.RigidBodyInertia()
                kdl_jnt = kdl_urdf.urdf_joint_to_kdl_joint(urdf.joint_map[joint])
                kdl_origin = kdl_urdf.urdf_pose_to_kdl_frame(urdf.joint_map[joint].origin) * PyKDL.Frame(PyKDL.Rotation.RotZ(joint_rot))
                kdl_sgm = PyKDL.Segment(child_name, kdl_jnt,
                                      kdl_origin, kdl_inert)

                segment_map[segment_id] = kdl_sgm
                segment_parent_map[segment_id] = segment_name_id_map[parent]
                segment_name_id_map[child_name] = segment_id
                segment_id += 1

                tree.addSegment(kdl_sgm, parent)
                segment_id = add_children_to_tree(child_name, segment_id)
        return segment_id
    add_children_to_tree(root, segment_id)
    return tree, segment_map, segment_parent_map, segment_name_id_map

class VelmaFkIkSolver:

    def calculateFk(self, link_name, js_pos):
        q = PyKDL.JntArray(self.fk_chains[link_name].getNrOfJoints())
        ja_idx = 0
        for js_name in self.fk_joint_state_name[link_name]:
            q[ja_idx] = js_pos[js_name]
            ja_idx += 1

        fr = PyKDL.Frame()
        self.fk_solvers[link_name].JntToCart(q, fr)
        return fr

    def calculateFk2(self, base_name, end_name, q):
        q_fk = PyKDL.JntArray( self.jac_solver_chain_len_map[(base_name, end_name)] )
        q_fk_idx = 0
        for q_idx in self.jac_solver_q_indices_map[(base_name, end_name)]:
            q_fk[q_fk_idx] = q[q_idx]
#            print q_fk_idx, q_idx, q_fk[q_fk_idx]
            q_fk_idx += 1
        fr = PyKDL.Frame()
        self.fk_solver_map[(base_name, end_name)].JntToCart(q_fk, fr)
        return fr

    def simulateTrajectory(self, link_name, init_js, T_B_Ed):

        chain_length = self.ik_chains[link_name].getNrOfJoints()

        q_end = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
        q_init = PyKDL.JntArray(chain_length)
        for ja_idx in range(chain_length):
            q_init[ja_idx] = init_js[self.ik_joint_state_name[link_name][ja_idx]]

        T_B_BB = self.calculateFk(self.ik_base, init_js)
        T_BB_B = T_B_BB.Inverse()

        q_out = PyKDL.JntArray(chain_length)
        T_BB_Ed = T_BB_B * T_B_Ed
        status = self.ik_solvers[link_name].CartToJnt(q_init, T_BB_Ed, q_out)
        if status != 0:
            print "simulateTrajectory status:", status
            return None
        for i in range(chain_length):
            q_end[i] = q_out[i]
        return q_end

#    def calculateIk(self, link_name, T_B_Ed):
#        for i in range(0,5):
#            q_init = PyKDL.JntArray(7)
#            for j in range(0,7):
#                q_init[j] = random.uniform(self.q_min[j]+0.1, self.q_max[j]-0.1)
#                status = self.ik_solver.CartToJnt(q_init, fr, self.q_out)
#                if status == 0:# and not self.hasSingularity(self.q_out):
#                    success = True
#                    break

    def createSegmentToJointMap(self, joint_names_vector, inactive_joint_names):
        self.segment_id_q_id_map = {}
        for q_idx in range(len(joint_names_vector)):
            joint_name = joint_names_vector[q_idx]
            for seg_id in self.segment_map:
                seg = self.segment_map[seg_id]
                if seg == None:
                    continue
                if joint_name == seg.getJoint().getName():
                    self.segment_id_q_id_map[seg_id] = q_idx
#                    print "createSegmentToJointMap", joint_name, seg_id, q_idx

        self.inactive_segment_id_q_id_map = {}
        for q_idx in range(len(inactive_joint_names)):
            joint_name = inactive_joint_names[q_idx]
            for seg_id in self.segment_map:
                seg = self.segment_map[seg_id]
                if seg == None:
                    continue
                if joint_name == seg.getJoint().getName():
                    self.inactive_segment_id_q_id_map[seg_id] = q_idx
#                    print "createSegmentToJointMap", joint_name, seg_id, q_idx

    def createJacobianFkSolvers(self, base_name, end_name, joint_names_vector):
        if not hasattr(self, 'jac_solver_chain_map'):
            self.jac_solver_chain_map = {}
            self.jac_solver_map = {}
            self.jac_solver_names_map = {}
            self.jac_solver_q_indices_map = {}
            self.jac_solver_chain_len_map = {}
            self.fk_solver_map = {}
        if not (base_name, end_name) in self.jac_solver_chain_map:
            chain = self.tree.getChain(base_name, end_name)
            self.jac_solver_chain_map[(base_name, end_name)] = chain
            self.jac_solver_map[(base_name, end_name)] = PyKDL.ChainJntToJacSolver( chain )
            self.jac_solver_names_map[(base_name, end_name)] = joint_names_vector
            self.jac_solver_q_indices_map[(base_name, end_name)] = []
            self.fk_solver_map[(base_name, end_name)] = PyKDL.ChainFkSolverPos_recursive(chain)
            for chain_q_idx in range(chain.getNrOfSegments()):
                joint = chain.getSegment(chain_q_idx).getJoint()
                chain_joint_name = joint.getName()
                chain_joint_type = joint.getType()
                if chain_joint_type == PyKDL.Joint.None:
                    continue
                print "chain", chain_joint_name, chain_joint_type
                q_idx = 0
                for joint_name in joint_names_vector:
                    if joint_name == chain_joint_name:
                        self.jac_solver_q_indices_map[(base_name, end_name)].append(q_idx)
                        break
                    q_idx += 1
                if q_idx == len(joint_names_vector):
                    print "ERROR: createJacobianSolver", chain_joint_name, " not in", joint_names_vector
                    exit(0)
            self.jac_solver_chain_len_map[(base_name, end_name)] = len(self.jac_solver_q_indices_map[(base_name, end_name)])
            print "joints in the chain:", self.jac_solver_chain_len_map[(base_name, end_name)]
        else:
            print "ERROR: createJacobianSolver: solver already exists"
            exit(0)

    def getJacobian(self, base_name, end_name, q):
        # extract joint values for the chain
        q_jac = PyKDL.JntArray( self.jac_solver_chain_len_map[(base_name, end_name)] )
        q_jac_idx = 0
        for q_idx in self.jac_solver_q_indices_map[(base_name, end_name)]:
            q_jac[q_jac_idx] = q[q_idx]
            q_jac_idx += 1
        jac_small = PyKDL.Jacobian( self.jac_solver_chain_map[(base_name, end_name)].getNrOfJoints() )
        self.jac_solver_map[(base_name, end_name)].JntToJac(q_jac, jac_small)

        # create the jacobian for all joints
        jac_big = np.matrix(np.zeros( (6, len(q)) ))

        for col_idx in range(jac_small.columns()):
            q_idx = self.jac_solver_q_indices_map[(base_name, end_name)][col_idx]
            col = jac_small.getColumn(col_idx)
            for row_idx in range(6):
                jac_big[row_idx, q_idx] = col[row_idx]
        return jac_big

    def isParentRec(self, parent_idx, child_idx):
        if child_idx == None:
            return False
        if child_idx == parent_idx:
            return True
        return self.isParentRec(parent_idx, self.segment_parent_map[child_idx])

    def isParent(self, parent_name, child_name):
        parent_idx = self.segment_name_id_map[parent_name]
        child_idx = self.segment_name_id_map[child_name]
        return self.isParentRec( parent_idx, child_idx)

    def getChain(self, link_idx):
        chain = []
        while link_idx != None:
            chain.append(link_idx)
            link_idx = self.segment_parent_map[link_idx]
        return chain

    def getAffectedDof(self, link1_name, link2_name):
        link1_idx = self.segment_name_id_map[link1_name]
        link2_idx = self.segment_name_id_map[link2_name]
        ch1 = self.getChain(link1_idx)
        ch2 = self.getChain(link2_idx)
        ch1.reverse()
        ch2.reverse()

        last_common_link_idx = None
        for ch_idx in range(min(len(ch1), len(ch2))):
            if ch1[ch_idx] != ch2[ch_idx]:
                break
            last_common_link_idx = ch1[ch_idx]

        ch1.reverse()
        ch2.reverse()

        affected_dofs = []
        for l_idx in ch1:
            if l_idx == last_common_link_idx:
                break
            if l_idx in self.segment_id_q_id_map:
                dof_idx = self.segment_id_q_id_map[l_idx]
                if not dof_idx in affected_dofs:
                    affected_dofs.append(dof_idx)
        return affected_dofs

    def getJacobianForX(self, jac, link_name, x, q, iq, base_name='torso_base'):
        link_index = self.segment_name_id_map[link_name]
        # Lets search the tree-element
        # If segmentname is not inside the tree, back out:
        # Let's make the jacobian zero:
        for q_idx in range(len(q)):
            jac.setColumn(q_idx, PyKDL.Twist())

        T_total = PyKDL.Frame(x)
        root_index = self.segment_name_id_map[base_name]
        l_index = link_index
        # Lets recursively iterate until we are in the root segment
        while l_index != root_index:
            # get the corresponding q_nr for this TreeElement:
            # get the pose of the segment:
            seg_kdl = self.segment_map[l_index]
            if seg_kdl.getJoint().getType() == PyKDL.Joint.None:
                q_idx = None
                q_seg = 0.0
            elif l_index in self.segment_id_q_id_map:
                try:
                    q_idx = self.segment_id_q_id_map[l_index]
                except KeyError as ke:
                    print ke.errno, ke.strerror
                    print "joint type", seg_kdl.getJoint().getType(), " joint name", seg_kdl.getJoint().getName()
                    exit(0)
                q_seg = q[q_idx]
            else:
                q_idx = self.inactive_segment_id_q_id_map[l_index]
                q_seg = iq[q_idx]

            T_local = seg_kdl.pose(q_seg)
            # calculate new T_end:
            T_total = T_local * T_total
            # get the twist of the segment:
            t_local = self.segment_map[l_index].twist(q_seg, 1.0)
            # transform the endpoint of the local twist to the global endpoint:
            t_local = t_local.RefPoint(T_total.p - T_local.p)
            # transform the base of the twist to the endpoint
            t_local = T_total.M.Inverse(t_local)
            # store the twist in the jacobian:
            if q_idx != None:
                jac.setColumn(q_idx,t_local)
            else:
                if t_local.vel.Norm() > 0.000001 or t_local.rot.Norm() > 0.000001:
                    print "ERROR: JntToJac t_local != 0", t_local
                    exit(0)
            # goto the parent
            l_index = self.segment_parent_map[l_index]
        # Change the base of the complete jacobian from the endpoint to the base
#        changeBase(jac, T_total.M, jac);
        jac.changeBase(T_total.M)
        return 0;

    def getJacobiansForPairX(self, jac1, jac2, link_name1, x1, link_name2, x2, q, iq):
        # get the first common link
        link_index1 = self.segment_name_id_map[link_name1]
        l_index = link_index1
        link1_chain = set()
        while True:
            link1_chain.add(l_index)
            if l_index in self.segment_parent_map:
                l_index = self.segment_parent_map[l_index]
            else:
                break

        link_index2 = self.segment_name_id_map[link_name2]
        l_index = link_index2
        while True:
            if l_index in link1_chain:
                break
            if l_index in self.segment_parent_map:
                l_index = self.segment_parent_map[l_index]
            else:
                # this is unexpected
                return None

        common_link_name = self.segment_id_name_map[l_index]
        self.getJacobianForX(jac1, link_name1, x1, q, iq, base_name=common_link_name)
        self.getJacobianForX(jac2, link_name2, x2, q, iq, base_name=common_link_name)

    def __init__(self, js_inactive_names_vector, js_pos, limit_submap=None):
        self.robot = URDF.from_parameter_server()

        self.tree, self.segment_map, self.segment_parent_map, self.segment_name_id_map = kdl_tree_from_urdf_model_velma(self.robot, js_inactive_names_vector, js_pos)
        self.segment_id_name_map = {}
        for seg_name in self.segment_name_id_map:
            seg_id = self.segment_name_id_map[seg_name]
            self.segment_id_name_map[seg_id] = seg_name

        fk_links = [
        "torso_link0",
        "left_arm_7_link",
        "right_arm_7_link",
        "left_HandPalmLink",
        "right_HandPalmLink",
        'head_kinect_rgb_optical_frame',
        ]
        self.fk_chains = {}
        self.fk_solvers = {}
        self.fk_joint_state_name = {}
        for link_name in fk_links:
            self.fk_chains[link_name] = self.tree.getChain("torso_base", link_name)
            self.fk_solvers[link_name] = PyKDL.ChainFkSolverPos_recursive(self.fk_chains[link_name])

            self.fk_joint_state_name[link_name] = []
            for seg_idx in range(self.fk_chains[link_name].getNrOfSegments()):
                joint = self.fk_chains[link_name].getSegment(seg_idx).getJoint()
                if joint.getType() == PyKDL.Joint.None:
                    continue
                joint_name = joint.getName()

                self.fk_joint_state_name[link_name].append(joint_name)

        self.ik_base = "torso_link0"
        ik_links = [
        "left_HandPalmLink",
        "right_HandPalmLink",
        "left_arm_7_link",
        "right_arm_7_link",
        ]

        self.joint_limit_map = {}
        for j in self.robot.joints:
            if j.limit != None:
                if limit_submap != None and j.name in limit_submap:
                    j.limit.lower = limit_submap[j.name][0]
                    j.limit.upper = limit_submap[j.name][1]
                self.joint_limit_map[j.name] = j.limit

        self.ik_fk_solver = {}
        self.vel_ik_solver = {}
        self.q_min = {}
        self.q_max = {}
        self.ik_solvers = {}
        self.ik_chains = {}
        self.ik_joint_state_name = {}
        for link_name in ik_links:
            # get chain
            self.ik_chains[link_name] = self.tree.getChain(self.ik_base, link_name)

            # get limits
            self.q_min[link_name] = PyKDL.JntArray(self.ik_chains[link_name].getNrOfJoints())
            self.q_max[link_name] = PyKDL.JntArray(self.ik_chains[link_name].getNrOfJoints())
            j_idx = 0
            self.ik_joint_state_name[link_name] = []
            for seg_idx in range(self.ik_chains[link_name].getNrOfSegments()):
                joint = self.ik_chains[link_name].getSegment(seg_idx).getJoint()
                if joint.getType() == PyKDL.Joint.None:
                    continue
                joint_name = joint.getName()
                self.q_min[link_name][j_idx] = self.joint_limit_map[joint_name].lower
                self.q_max[link_name][j_idx] = self.joint_limit_map[joint_name].upper
                self.ik_joint_state_name[link_name].append(joint_name)
                j_idx += 1
            # prepare fk solver for ik solver
            self.ik_fk_solver[link_name] = PyKDL.ChainFkSolverPos_recursive(self.ik_chains[link_name])
            self.vel_ik_solver[link_name] = PyKDL.ChainIkSolverVel_pinv(self.ik_chains[link_name])
            self.ik_solvers[link_name] = PyKDL.ChainIkSolverPos_NR_JL(self.ik_chains[link_name], self.q_min[link_name], self.q_max[link_name], self.ik_fk_solver[link_name], self.vel_ik_solver[link_name], 100)


text:
/************************************************************************
 *
 * button.cpp
 * Button class implementation
 *
 ************************************************************************/

#include "button.h"

#include <GL/gl.h>

#include <iostream>

/**
 * Constructor. The button takes ownership of the texture. If the texture
 * is NULL, no texture will be drawn on the button.
 */
Button::Button(Texture *tex)
    : tex(tex), pressed(false), toggle(false), enabled(true)
{
}

/**
 * Destructor.
 */
Button::~Button()
{
    //if tex has been used
    if (tex) {
        delete tex;
    }
}

/**
 * Return whether the button is pressed.
 */
bool Button::isPressed()
{
    return pressed;
}

/**
 * Resets the button.
 */
void Button::reset()
{
    pressed = false;
}

/**
 * Returns the texture. This may be NULL.
 */
Texture *Button::getTexture()
{
    return tex;
}

/**
 * Set the toggle state of the button. If tog is true, the button
 * will be rendered as if it is pushed in.
 */
void Button::setToggle(bool tog)
{
    toggle = tog;
}

/**
 * Returns the toggle state of the button.
 */
bool Button::getToggle()
{
    return toggle;
}

/**
 * Set the enabled state of the button. If enable is false, the button
 * is disabled and cannot be pressed. The button is reset if the new
 * enabled state is different from the last.
 */
void Button::setEnabled(bool enable)
{
    if (enable != getEnabled()) {
        reset();
    }
    enabled = enable;
}

/**
 * Returns the enabled state of the button.
 */
bool Button::getEnabled()
{
    return enabled;
}

/**
 * Draw the button.
 */
void Button::draw(float dt)
{
    //only draw it if it is enabled
    if (!getEnabled()) {
        glColor3f(0, 0, 0);
    } else if (getToggle() || isInside(getMousePosition())) {
        glColor3f(0.5, 0.5, 0.5);
    } else {
        glColor3f(1, 1, 1);
    }

    //enable texturing
    glEnable(GL_TEXTURE_2D);
    if (tex) {
        tex->bind();
        glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    }

    //enable blending
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    //draw the vertices
    glBegin(GL_QUADS);
    glTexCoord2f(0, 1); glVertex2f(0, 0);
    glTexCoord2f(1, 1); glVertex2f(getSize().x, 0);
    glTexCoord2f(1, 0); glVertex2f(getSize().x, getSize().y);
    glTexCoord2f(0, 0); glVertex2f(0, getSize().y);
    glEnd();

    glDisable(GL_BLEND);
}

/**
 * Handles a mouse button click.
 */
bool Button::onHandleButtonEvent(ButtonEvent event)
{
    //check that the button is enabled
    if (getEnabled()) {
        if ((event.getButton() == ButtonEvent::LEFT) &&
            (event.getState() == ButtonEvent::RELEASED)) {
            pressed = true;
            return true;
        }
    }
    return false;
}


text:
.marker-properties,
.metadata {
    border-collapse:collapse;
    font-size:11px;
    width:100%;
    overflow:auto;
    border-bottom:1px solid #ccc;

    /* Equal to 6 rows */
    max-height:189px;
}

.marker-properties {
    display:block;
}

.metadata {
    display:table;
}

.marker-properties th {
    width:33.3333%;
    min-width:100px;
    white-space:nowrap;
    border:1px solid #ccc;
}

.marker-properties td {
    width:60%;
}

.marker-properties.display td,
.marker-properties.display th {
    padding:5px 10px;
}

.marker-properties tr:last-child td,
.marker-properties tr:last-child th {
    border-bottom:none;
}

.marker-properties tr:nth-child(even) th,
.marker-properties tr:nth-child(even) td,
.metadata tr:nth-child(even) td {
    background-color:#f7f7f7;
}

.geojsonio-feature .leaflet-popup-content-wrapper {
    float: left;
    width: 100%;
    padding: 0;
}

.geojsonio-feature .leaflet-popup-content {
    float: left;
    padding: 0 !important;
    width:100%;
}

.geojsonio-feature .leaflet-popup-tip-container {
    float: left;
    margin-left: 50%;
    right: 10px;
}

datalist {
    overflow: auto;
    height: 150px;
}

/* Tabs
------------------------------------------------------- */
.tabs-ui {
    position:relative;
    width: 250px;
}

.tab .tab-toggle {
    background:#eee;
    cursor:pointer;
}

.tab .tab-toggle:hover {
    background:#f7f7f7;
}

.tab .hide { display:none; }

.tab .content {
    display: none;
    background:white;
    overflow:auto;
}

.tab [type=radio]:checked ~ label {
    background:white;
    border-top-width: 0;
    z-index:2;
}

.tab [type=radio]:checked ~ label ~ .content {
    z-index:1;
    display: block;
}

.add-row-button {
    color: #2980b9;
}

.add-row-button:hover {
    cursor: pointer;
    color: #199CF4;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
    <type>org.netbeans.modules.apisupport.project</type>
    <configuration>
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
            <code-name-base>org.joeffice.poi</code-name-base>
            <suite-component/>
            <module-dependencies/>
            <public-packages>
                <package>javax.xml</package>
                <package>javax.xml.namespace</package>
                <package>javax.xml.stream</package>
                <package>javax.xml.stream.events</package>
                <package>javax.xml.stream.util</package>
                <package>org.apache.commons.codec</package>
                <package>org.apache.commons.codec.binary</package>
                <package>org.apache.commons.codec.digest</package>
                <package>org.apache.commons.codec.language</package>
                <package>org.apache.commons.codec.net</package>
                <package>org.apache.commons.logging</package>
                <package>org.apache.commons.logging.impl</package>
                <package>org.apache.log4j</package>
                <package>org.apache.log4j.chainsaw</package>
                <package>org.apache.log4j.config</package>
                <package>org.apache.log4j.helpers</package>
                <package>org.apache.log4j.jdbc</package>
                <package>org.apache.log4j.jmx</package>
                <package>org.apache.log4j.lf5</package>
                <package>org.apache.log4j.lf5.util</package>
                <package>org.apache.log4j.lf5.viewer</package>
                <package>org.apache.log4j.lf5.viewer.categoryexplorer</package>
                <package>org.apache.log4j.lf5.viewer.configure</package>
                <package>org.apache.log4j.net</package>
                <package>org.apache.log4j.nt</package>
                <package>org.apache.log4j.or</package>
                <package>org.apache.log4j.or.jms</package>
                <package>org.apache.log4j.or.sax</package>
                <package>org.apache.log4j.spi</package>
                <package>org.apache.log4j.varia</package>
                <package>org.apache.log4j.xml</package>
                <package>org.apache.poi</package>
                <package>org.apache.poi.common.usermodel</package>
                <package>org.apache.poi.ddf</package>
                <package>org.apache.poi.dev</package>
                <package>org.apache.poi.extractor</package>
                <package>org.apache.poi.hpsf</package>
                <package>org.apache.poi.hpsf.extractor</package>
                <package>org.apache.poi.hpsf.wellknown</package>
                <package>org.apache.poi.hssf</package>
                <package>org.apache.poi.hssf.dev</package>
                <package>org.apache.poi.hssf.eventmodel</package>
                <package>org.apache.poi.hssf.eventusermodel</package>
                <package>org.apache.poi.hssf.eventusermodel.dummyrecord</package>
                <package>org.apache.poi.hssf.extractor</package>
                <package>org.apache.poi.hssf.model</package>
                <package>org.apache.poi.hssf.record</package>
                <package>org.apache.poi.hssf.record.aggregates</package>
                <package>org.apache.poi.hssf.record.cf</package>
                <package>org.apache.poi.hssf.record.chart</package>
                <package>org.apache.poi.hssf.record.common</package>
                <package>org.apache.poi.hssf.record.cont</package>
                <package>org.apache.poi.hssf.record.crypto</package>
                <package>org.apache.poi.hssf.record.pivottable</package>
                <package>org.apache.poi.hssf.usermodel</package>
                <package>org.apache.poi.hssf.util</package>
                <package>org.apache.poi.openxml4j.exceptions</package>
                <package>org.apache.poi.openxml4j.opc</package>
                <package>org.apache.poi.openxml4j.opc.internal</package>
                <package>org.apache.poi.openxml4j.opc.internal.marshallers</package>
                <package>org.apache.poi.openxml4j.opc.internal.signature</package>
                <package>org.apache.poi.openxml4j.opc.internal.unmarshallers</package>
                <package>org.apache.poi.openxml4j.opc.signature</package>
                <package>org.apache.poi.openxml4j.util</package>
                <package>org.apache.poi.poifs.common</package>
                <package>org.apache.poi.poifs.crypt</package>
                <package>org.apache.poi.poifs.dev</package>
                <package>org.apache.poi.poifs.eventfilesystem</package>
                <package>org.apache.poi.poifs.filesystem</package>
                <package>org.apache.poi.poifs.nio</package>
                <package>org.apache.poi.poifs.property</package>
                <package>org.apache.poi.poifs.storage</package>
                <package>org.apache.poi.ss</package>
                <package>org.apache.poi.ss.extractor</package>
                <package>org.apache.poi.ss.format</package>
                <package>org.apache.poi.ss.formula</package>
                <package>org.apache.poi.ss.formula.atp</package>
                <package>org.apache.poi.ss.formula.constant</package>
                <package>org.apache.poi.ss.formula.eval</package>
                <package>org.apache.poi.ss.formula.eval.forked</package>
                <package>org.apache.poi.ss.formula.function</package>
                <package>org.apache.poi.ss.formula.functions</package>
                <package>org.apache.poi.ss.formula.ptg</package>
                <package>org.apache.poi.ss.formula.udf</package>
                <package>org.apache.poi.ss.usermodel</package>
                <package>org.apache.poi.ss.usermodel.charts</package>
                <package>org.apache.poi.ss.util</package>
                <package>org.apache.poi.ss.util.cellwalk</package>
                <package>org.apache.poi.util</package>
                <package>org.apache.poi.xslf</package>
                <package>org.apache.poi.xslf.extractor</package>
                <package>org.apache.poi.xslf.model</package>
                <package>org.apache.poi.xslf.model.geom</package>
                <package>org.apache.poi.xslf.usermodel</package>
                <package>org.apache.poi.xslf.util</package>
                <package>org.apache.poi.xssf.dev</package>
                <package>org.apache.poi.xssf.eventusermodel</package>
                <package>org.apache.poi.xssf.extractor</package>
                <package>org.apache.poi.xssf.model</package>
                <package>org.apache.poi.xssf.streaming</package>
                <package>org.apache.poi.xssf.usermodel</package>
                <package>org.apache.poi.xssf.usermodel.charts</package>
                <package>org.apache.poi.xssf.usermodel.extensions</package>
                <package>org.apache.poi.xssf.usermodel.helpers</package>
                <package>org.apache.poi.xssf.util</package>
                <package>org.apache.poi.xwpf.extractor</package>
                <package>org.apache.poi.xwpf.model</package>
                <package>org.apache.poi.xwpf.usermodel</package>
                <package>org.apache.xmlbeans</package>
                <package>org.apache.xmlbeans.impl.common</package>
                <package>org.apache.xmlbeans.impl.config</package>
                <package>org.apache.xmlbeans.impl.inst2xsd</package>
                <package>org.apache.xmlbeans.impl.inst2xsd.util</package>
                <package>org.apache.xmlbeans.impl.jam</package>
                <package>org.apache.xmlbeans.impl.jam.annotation</package>
                <package>org.apache.xmlbeans.impl.jam.internal</package>
                <package>org.apache.xmlbeans.impl.jam.internal.classrefs</package>
                <package>org.apache.xmlbeans.impl.jam.internal.elements</package>
                <package>org.apache.xmlbeans.impl.jam.internal.javadoc</package>
                <package>org.apache.xmlbeans.impl.jam.internal.parser</package>
                <package>org.apache.xmlbeans.impl.jam.internal.reflect</package>
                <package>org.apache.xmlbeans.impl.jam.mutable</package>
                <package>org.apache.xmlbeans.impl.jam.provider</package>
                <package>org.apache.xmlbeans.impl.jam.visitor</package>
                <package>org.apache.xmlbeans.impl.jam.xml</package>
                <package>org.apache.xmlbeans.impl.piccolo.io</package>
                <package>org.apache.xmlbeans.impl.piccolo.util</package>
                <package>org.apache.xmlbeans.impl.piccolo.xml</package>
                <package>org.apache.xmlbeans.impl.regex</package>
                <package>org.apache.xmlbeans.impl.richParser</package>
                <package>org.apache.xmlbeans.impl.schema</package>
                <package>org.apache.xmlbeans.impl.soap</package>
                <package>org.apache.xmlbeans.impl.store</package>
                <package>org.apache.xmlbeans.impl.tool</package>
                <package>org.apache.xmlbeans.impl.util</package>
                <package>org.apache.xmlbeans.impl.validator</package>
                <package>org.apache.xmlbeans.impl.values</package>
                <package>org.apache.xmlbeans.impl.xb.ltgfmt</package>
                <package>org.apache.xmlbeans.impl.xb.ltgfmt.impl</package>
                <package>org.apache.xmlbeans.impl.xb.substwsdl</package>
                <package>org.apache.xmlbeans.impl.xb.substwsdl.impl</package>
                <package>org.apache.xmlbeans.impl.xb.xmlconfig</package>
                <package>org.apache.xmlbeans.impl.xb.xmlconfig.impl</package>
                <package>org.apache.xmlbeans.impl.xb.xmlschema</package>
                <package>org.apache.xmlbeans.impl.xb.xmlschema.impl</package>
                <package>org.apache.xmlbeans.impl.xb.xsdownload</package>
                <package>org.apache.xmlbeans.impl.xb.xsdownload.impl</package>
                <package>org.apache.xmlbeans.impl.xb.xsdschema</package>
                <package>org.apache.xmlbeans.impl.xb.xsdschema.impl</package>
                <package>org.apache.xmlbeans.impl.xsd2inst</package>
                <package>org.apache.xmlbeans.soap</package>
                <package>org.apache.xmlbeans.xml.stream</package>
                <package>org.apache.xmlbeans.xml.stream.events</package>
                <package>org.apache.xmlbeans.xml.stream.utils</package>
                <package>org.dom4j</package>
                <package>org.dom4j.bean</package>
                <package>org.dom4j.datatype</package>
                <package>org.dom4j.dom</package>
                <package>org.dom4j.dtd</package>
                <package>org.dom4j.io</package>
                <package>org.dom4j.jaxb</package>
                <package>org.dom4j.rule</package>
                <package>org.dom4j.rule.pattern</package>
                <package>org.dom4j.swing</package>
                <package>org.dom4j.tree</package>
                <package>org.dom4j.util</package>
                <package>org.dom4j.xpath</package>
                <package>org.dom4j.xpp</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.chart</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.chart.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.chartDrawing</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.chartDrawing.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.compatibility</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.compatibility.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.diagram</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.diagram.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.lockedCanvas</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.lockedCanvas.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.main</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.main.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.picture</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.picture.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.impl</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing</package>
                <package>org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.bibliography</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.bibliography.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.characteristics</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.characteristics.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.customProperties</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.customProperties.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.customXml</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.customXml.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.extendedProperties</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.math</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.math.impl</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.relationships</package>
                <package>org.openxmlformats.schemas.officeDocument.x2006.relationships.impl</package>
                <package>org.openxmlformats.schemas.presentationml.x2006.main</package>
                <package>org.openxmlformats.schemas.presentationml.x2006.main.impl</package>
                <package>org.openxmlformats.schemas.schemaLibrary.x2006.main</package>
                <package>org.openxmlformats.schemas.schemaLibrary.x2006.main.impl</package>
                <package>org.openxmlformats.schemas.spreadsheetml.x2006.main</package>
                <package>org.openxmlformats.schemas.spreadsheetml.x2006.main.impl</package>
                <package>org.openxmlformats.schemas.wordprocessingml.x2006.main</package>
                <package>org.openxmlformats.schemas.wordprocessingml.x2006.main.impl</package>
                <package>org.w3c.dom</package>
                <package>repackage</package>
                <package>schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707</package>
                <package>schemaorg_apache_xmlbeans.system.sXMLCONFIG</package>
                <package>schemaorg_apache_xmlbeans.system.sXMLLANG</package>
                <package>schemaorg_apache_xmlbeans.system.sXMLSCHEMA</package>
                <package>schemaorg_apache_xmlbeans.system.sXMLTOOLS</package>
                <package>schemasMicrosoftComOfficeExcel</package>
                <package>schemasMicrosoftComOfficeExcel.impl</package>
                <package>schemasMicrosoftComOfficeOffice</package>
                <package>schemasMicrosoftComOfficeOffice.impl</package>
                <package>schemasMicrosoftComOfficePowerpoint</package>
                <package>schemasMicrosoftComOfficePowerpoint.impl</package>
                <package>schemasMicrosoftComOfficeWord</package>
                <package>schemasMicrosoftComOfficeWord.impl</package>
                <package>schemasMicrosoftComVml</package>
                <package>schemasMicrosoftComVml.impl</package>
            </public-packages>
            <class-path-extension>
                <runtime-relative-path>ext/poi-3.9-20121203.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/poi-3.9-20121203.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/commons-codec-1.5.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/commons-codec-1.5.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/dom4j-1.6.1.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/dom4j-1.6.1.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/stax-api-1.0.1.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/stax-api-1.0.1.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/commons-logging-1.1.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/commons-logging-1.1.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/ooxml-schemas-1.1.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/ooxml-schemas-1.1.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/log4j-1.2.13.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/log4j-1.2.13.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/poi-ooxml-3.9-20121203.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/poi-ooxml-3.9-20121203.jar</binary-origin>
            </class-path-extension>
            <class-path-extension>
                <runtime-relative-path>ext/xmlbeans-2.3.0.jar</runtime-relative-path>
                <binary-origin>release/modules/ext/xmlbeans-2.3.0.jar</binary-origin>
            </class-path-extension>
        </data>
    </configuration>
</project>


text:
USE Kinder_garden
--13.	Ñóìè îïëàò âö³ëîìó âñüîãî çàêëàäó çà ïåâíèé ïðîì³æîê ÷àñó
GO
IF OBJECT_ID (N'dbo.FuncSumOfDateForGarden', N'FN') IS NOT NULL
    DROP FUNCTION dbo.FuncSumOfDateForGarden;
GO
CREATE FUNCTION FuncSumOfDateForGarden(@date_begin DATE, @date_end DATE)
	RETURNS INT AS
		BEGIN
		DECLARE @t INT
		SET @t = (
			SELECT SUM([Ñóììà çà âåñü ïåðèîä]) AS [Îáùàÿ ñóììà ñàäèêà]
			FROM (SELECT COUNT(Visits_Journal.id_visit)*Sections.cost AS [Ñóììà çà âåñü ïåðèîä]
			FROM (Sections INNER JOIN Visits_Journal ON Sections.id_section = Visits_Journal.id_section)
				INNER JOIN List_of_section ON Sections.id_section = List_of_section.id_section
			WHERE (YEAR(@date_begin) + MONTH(@date_begin) * 0.01 <=
					YEAR(Visits_Journal.date_visit) + MONTH(Visits_Journal.date_visit) * 0.01 + DAY(Visits_Journal.date_visit) * 0.0001)
				AND (YEAR(@date_end) + MONTH(@date_end) * 0.01 >=
					YEAR(Visits_Journal.date_visit) + MONTH(Visits_Journal.date_visit) * 0.01 + DAY(Visits_Journal.date_visit) * 0.0001)
			GROUP BY Sections.cost, Visits_Journal.id_visit) AS X
			)
		RETURN @t
		END
--

GO
USE Kinder_garden
SELECT Kinder_garden.dbo.FuncSumOfDateForGarden('2000-10-01', '2015-11-12') AS [Îáùàÿ ñóììà îïëàò íà çàâåäåíèå]
--///--


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/background_view"
        android:layout_width="match_parent"
        android:layout_height="72dp"
        android:background="@color/color_primary">

        <TextView
            android:id="@+id/title_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:paddingEnd="16dp"
            android:paddingStart="72dp"
            android:textColor="@android:color/white"
            android:textSize="17sp" />

    </FrameLayout>

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/refresh_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/background_view">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:scrollbarStyle="outsideOverlay"
            android:scrollbars="vertical" />

    </android.support.v4.widget.SwipeRefreshLayout>

    <net.i2p.android.ext.floatingactionbutton.FloatingActionsMenu
        android:id="@+id/fab_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_below="@+id/background_view"
        android:layout_marginEnd="7dp"
        android:layout_marginTop="-34dp"
        android:visibility="gone"
        fab:fab_addButtonColorNormal="@color/fab_normal"
        fab:fab_addButtonColorPressed="@color/fab_pressed"
        fab:fab_addButtonPlusIconColor="@color/color_primary"
        fab:fab_expandDirection="down"
        fab:fab_labelStyle="@style/menu_labels_style"
        fab:fab_labelsPosition="right">

        <net.i2p.android.ext.floatingactionbutton.FloatingActionButton
            android:id="@+id/backup_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/fab_normal_menu"
            fab:fab_colorPressed="@color/fab_pressed_menu"
            fab:fab_icon="@drawable/ic_backup"
            fab:fab_size="mini"
            fab:fab_title="@string/backup" />

        <net.i2p.android.ext.floatingactionbutton.FloatingActionButton
            android:id="@+id/add_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/fab_normal_menu"
            fab:fab_colorPressed="@color/fab_pressed_menu"
            fab:fab_icon="@drawable/ic_pen"
            fab:fab_size="mini"
            fab:fab_title="@string/add" />

    </net.i2p.android.ext.floatingactionbutton.FloatingActionsMenu>

</RelativeLayout>


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>ActionController::Caching::ConfigMethods</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />

            Ruby on Rails 4.1.8

            Module
            ActionController::Caching::ConfigMethods

/usr/local/share/gems/gems/actionpack-4.1.8/lib/action_controller/caching.rb

Methods

C

                cache_store,

                cache_store=

Instance Public methods

              cache_store()

            Link

                Source:
                show

# File ../../../../usr/local/share/gems/gems/actionpack-4.1.8/lib/action_controller/caching.rb, line 35
def cache_store
  config.cache_store
end

              cache_store=(store)

            Link

                Source:
                show

# File ../../../../usr/local/share/gems/gems/actionpack-4.1.8/lib/action_controller/caching.rb, line 39
def cache_store=(store)
  config.cache_store = ActiveSupport::Cache.lookup_store(store)
end