text:
                Loading...

{{error}}

redpajama_set_name: RedPajamaGithub


text:
class Person < ActiveRecord::Base
  has_many :pets, inverse_of: :person
end

class Pet < ActiveRecord::Base
  belongs_to :person, touch: true, inverse_of: :pets
end

class Post < ActiveRecord::Base
  has_many :comments, dependent: :destroy
end

class User < ActiveRecord::Base
  has_many :comments, dependent: :destroy
end

class Comment < ActiveRecord::Base
  belongs_to :post, touch: true
  belongs_to :user, touch: true
end


text:
package org.sqsh.analyzers;

/**
 * The NullAnalyzer does no analysis whatsoever. It will always refuse to identify a SQL terminator.
 */
public class NullAnalyzer implements SQLAnalyzer {

    @Override
    public String getName() {
        return "None";
    }

    @Override
    public boolean isTerminated(CharSequence sql, char terminator) {
        return false;
    }
}


text:
<?xml version="1.0"?>

<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/xsd/maven-4.0.0.xsd"
>
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>${groupId}</groupId>
		<artifactId>${artifactId}</artifactId>
		<version>1.0.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>${artifactId}-wars</artifactId>
	<name>${artifactId} Wars</name>
	<packaging>pom</packaging>
</project>


text:
class BMP;
namespace BWEM {
class Map;
namespace utils {

//////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
//                                  class MapPrinter
//                                                                                //
//////////////////////////////////////////////////////////////////////////////////////////////
//

class MapPrinter
{
public:
	static const bool		showAltitude;				// renders the Altitude() value for each MiniTile
	static const bool		showAreas;					// renders Areas with distinct colors
	static const bool		showContinents;				// renders continents with distinct colors, unless showAreas == true
	static const bool		showLakes;					// prints unwalkable MiniTiles in Areas
	static const bool		showSeaSide;				// highlights Sea-MiniTiles next to Terrain-MiniTiles
	static const bool		showUnbuildable;			// renders Tiles that are not Buildable()
	static const bool		showHigherGround;			// renders Tiles for which HigherGround() == true
	static const bool		showChokePoints;			// renders the ChokePoints suggested by BWEM
	static const bool		showResources;
	static const bool		showMinerals;				// prints the Minerals, unless showResources == false
	static const bool		showGeysers;				// prints the Geysers, unless showResources == false
	static const bool		showStaticBuildings;		// prints the StaticBuildings
	static const bool		showBlockingBuildings;		// renders the StaticBuildings and the Minerals that are blocking some ChokePoint
	static const bool		showStackedNeutrals;		// renders the StaticBuildings and the Minerals that are stacked
	static const bool		showStartingLocations;		// renders the Bases that are at starting locations
	static const bool		showBases;					// prints the Bases suggested by BWEM
	static const bool		showAssignedRessources;		// renders the Ressources assigned to each Base, unless showBases == false
	static const bool		showData;					// renders the Data() value for each MiniTile

	struct Color
	{
		static const Color		higherGround;
		static const Color		unbuildable;
		static const Color		terrain;
		static const Color		sea;
		static const Color		seaSide;
		static const Color		lake;
		static const Color		tinyArea;
		static const Color		chokePoints;
		static const Color		minerals;
		static const Color		geysers;
		static const Color		staticBuildings;
		static const Color		blockingNeutrals;
		static const Color		startingLocations;
		static const Color		bases;

		Color() : red(0), green(0), blue(0) {}
		Color(int r, int g, int b) : red(uint8_t(r)), green(uint8_t(g)), blue(uint8_t(b))
		{
			bwem_assert(
				utils::CanTypeFitValue<uint8_t>(r) &&
				utils::CanTypeFitValue<uint8_t>(g) &&
				utils::CanTypeFitValue<uint8_t>(b));
		}

		uint8_t red;
		uint8_t green;
		uint8_t blue;
	};

	static void					Initialize(const Map * pMap);
	static MapPrinter &			Get()						{ bwem_assert_throw_plus(m_pMap, "MapPrinter not initialized"); return m_Instance; }

	enum dashed_t {not_dashed, dashed};
	enum fill_t {do_not_fill, fill};

	void						Point(int x, int y, Color col);
	void						Point(BWAPI::WalkPosition p, Color col) { Point(p.x, p.y, col); }

	void						Line(BWAPI::WalkPosition A, BWAPI::WalkPosition B, Color col, dashed_t dashedMode = not_dashed);

	void						Rectangle(BWAPI::WalkPosition TopLeft, BWAPI::WalkPosition BottomRight, Color col, fill_t fillMode = do_not_fill, dashed_t dashedMode = not_dashed);

	// This function will automatically crop the square so that it fits in the Map.
	void						Square(BWAPI::WalkPosition Center, int radius, Color col, fill_t fillMode = do_not_fill);

	// This function will automatically crop the circle so that it fits in the Map.
	void						Circle(BWAPI::WalkPosition Center, int radius, Color col, fill_t fillMode = do_not_fill);

								MapPrinter(const MapPrinter &) = delete;
	MapPrinter &				operator=(const MapPrinter &) = delete;

private:
								MapPrinter() = default;
								~MapPrinter();

	static bool					CanWrite();

	static std::unique_ptr<BMP>	m_pBMP;
	static MapPrinter			m_Instance;
	static const Map *			m_pMap;
	static const std::string	m_fileName;
};

}} // namespace BWEM::detail::detail

#endif


text:
package com.tech.freak.wizardpager.model;

import android.support.v4.app.Fragment;
import com.tech.freak.wizardpager.ui.GeoFragment;

public class GeoPage extends TextPage {

	public GeoPage(ModelCallbacks callbacks, String title) {
		super(callbacks, title);
	}

	@Override
	public Fragment createFragment() {
		return GeoFragment.create(getKey());
	}

	public GeoPage setValue(String value) {
		mData.putString(SIMPLE_DATA_KEY, value);
		return this;
	}
}


text:
module Rpub
  class Epub
    class Toc < XmlFile
      def render
        xml.instruct!
        xml.declare! :DOCTYPE, :ncx, :PUBLIC, "-//W3C//DTD XHTML 1.1//EN", 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'
        xml.ncx :xmlns => 'http://www.daisy.org/z3986/2005/ncx/', :version => '2005-1' do
          xml.head do
            xml.meta :name => 'dtb:uid',            :content => book.uid
            xml.meta :name => 'dtb:depth',          :content => max_level
            xml.meta :name => 'dtb:totalPageCount', :content => '0'
            xml.meta :name => 'dtb:maxPageNumber',  :content => '0'
          end
          xml.docTitle { xml.text book.config.title }
          xml.navMap do
            book.chapters.each do |chapter|
              nav_points_nested_by_level chapter.toc, chapter.filename
            end
          end
        end
      end

      private

      def max_level
        book.config.max_level || 2
      end

      def play_order
        @play_order ||= 0
      end

      def play_order=(v)
        @play_order = v
      end

      def next_play_order
        self.play_order = play_order + 1
      end

      def nav_points_nested_by_level(heading, filename, level = 1)
        heading.children.each do |heading|
          html_id = heading.attr[:id]
          source = filename+'#'+html_id
          if heading.value.options[:level] <= max_level
            nav_point html_id, next_play_order, heading.value.options[:raw_text], source do
                nav_points_nested_by_level heading, filename, level + 1
            end
          end
        end
      end

      def nav_point(id, play_order, text, filename)
        xml.navPoint :id => id, :playOrder => play_order do
          xml.navLabel { xml.text text }
          xml.content :src => filename
          yield if block_given?
        end
      end
    end
  end
end


text:
die() { EXITCODE=$1; shift; printf '%s\n' "$*"; exit $EXITCODE; }

# Source the passed file.
[ -e "$1" ] && . "$1"
VERS="$2 $(date +%Y-%m-%d)"

# Perform sanity checks.
[ -z "$PKG" ] && die 1 Undefined / empty PKG
[ -z "$VERS" ] && die 2 Undefined / empty VERS
[ -z "$AUTHOR" ] && die 3 Undefined / empty AUTHOR
[ -z "$FILENAME" ] && die 4 Undefined / empty FILENAME
[ ! -e "$FILENAME" ] && die 5 File "$FILENAME" does not exist
[ -z "$EMAIL" ] && die 6 Undefined / empty EMAIL
[ -z "$DESCRIPTION" ] && die 7 Undefined / empty DESCRIPTION
[ -z "$CTANPATH" ] && die 8 Undefined / empty CTANPATH
[ -z "$TYPE" ] && die 9 Undefined / empty TYPE
[ "$TYPE" = announce -a -z "$ANNOUNCEMENT" ] &&
  die 10 TYPE is announce, but ANNOUNCEMENT is undefined / empty

# Retrieve a ticket number from CTAN.
COOKIEJAR=`mktemp`
trap 'rm $COOKIEJAR' EXIT
TICKET="$(curl -c $COOKIEJAR -s 'https://ctan.org/upload' |
  xmllint --html --xpath "//input[@name='ticket']/@value" - 2>/dev/null |
	sed -n -r '/^ value=".*"$/s/^ value="(.*)"$/\1\n/p')"
[ -z "$TICKET" ] && die 11 Failed to download ticket number

echo $FILENAME

# Send the archive.
RESPONSE=./ctan-upload.response.html
curl --form-string ticket="$TICKET" \
     --form-string pkg="$PKG" \
     --form-string vers="$VERS" \
     --form-string author="$AUTHOR" \
     --form-string uploader="$UPLOADER" \
     --form-string email="$EMAIL" \
     --form-string description="$DESCRIPTION" \
     --form-string ctanPath="$CTANPATH" \
        --form-string type="$TYPE" \
     --form-string announcement="$ANNOUNCEMENT" \
     --form-string note="$NOTE" \
     --form-string licenses="$LICENSE" \
     --form-string home="$HOMEPAGE" \
     --form-string bugs="$BUGS" \
     --form-string support="$SUPPORT" \
     --form-string announce="$ANNOUNCEMENTS" \
     --form-string repository="$REPOSITORY" \
     --form-string development="$DEVELOPMENT" \
     -F file=@"$FILENAME" \
     --form-string SUBMIT='Submit contribution' \
     -b $COOKIEJAR https://ctan.org/upload/save >$RESPONSE
grep <$RESPONSE -qF 'Your contribution has been uploaded' ||
  die 12 Upload failed.
echo "Upload succeeded"


text:
namespace app {
namespace Uno {
namespace Collections {

::uInterfaceType* IEnumerator__Uno_UX_ITemplate__typeof();

struct IEnumerator__Uno_UX_ITemplate
{
    ::uObject*(*__fp_get_Current)(void*);

    static ::uObject* Current(::uObject* __this) { return ((IEnumerator__Uno_UX_ITemplate*)uGetInterfacePtr(__this, IEnumerator__Uno_UX_ITemplate__typeof()))->__fp_get_Current((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0)); }
};

}}}

#endif


text:
<?php

namespace Google\Service\ShoppingContent;

class OrdersUpdateMerchantOrderIdResponse extends \Google\Model
{
  /**
   * @var string
   */
  public $executionStatus;
  /**
   * @var string
   */
  public $kind;

  /**
   * @param string
   */
  public function setExecutionStatus($executionStatus)
  {
    $this->executionStatus = $executionStatus;
  }
  /**
   * @return string
   */
  public function getExecutionStatus()
  {
    return $this->executionStatus;
  }
  /**
   * @param string
   */
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  /**
   * @return string
   */
  public function getKind()
  {
    return $this->kind;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(OrdersUpdateMerchantOrderIdResponse::class, 'Google_Service_ShoppingContent_OrdersUpdateMerchantOrderIdResponse');


text:
package com.tvd12.ezyfox.monitor.test;

import com.tvd12.ezyfox.monitor.EzyCpuMonitor;
import com.tvd12.test.base.BaseTest;
import org.testng.annotations.Test;

public class EzyCpuMonitorTest extends BaseTest {

    @Test
    public void test() throws Exception {
        EzyCpuMonitor monitor = new EzyCpuMonitor();
        Thread.sleep(300);
        System.out.println(monitor.getProcessCpuLoad());
        Thread.sleep(300);
        System.out.println(monitor.getSystemCpuLoad());
    }
}


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

<TITLE>
JsObjectProperty
</TITLE>

<META NAME="date" CONTENT="2012-06-29">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.chromium.sdk

Interface JsObjectProperty

All Superinterfaces:
JsVariable

public interface JsObjectProperty
extends JsVariable

Exposes additional data if variable is a property of object and its property descriptor
 is available.

Nested Class Summary

Nested classes/interfaces inherited from interface org.chromium.sdk.JsVariable

JsVariable.SetValueCallback

Method Summary

 RelayOk
evaluateGet(JsEvaluateContext.EvaluateCallback callback,
            SyncCallback syncCallback)

          Asynchronously evaluates property getter and returns property value.

 JsValue
getGetter()

 JsFunction
getGetterAsFunction()

 JsValue
getSetter()

 boolean
isConfigurable()

 boolean
isEnumerable()

 boolean
isWritable()

Methods inherited from interface org.chromium.sdk.JsVariable

asObjectProperty, getFullyQualifiedName, getName, getValue, isMutable, isReadable, setValue

Method Detail

isWritable

boolean isWritable()

Returns:
whether property described as 'writable'

getGetter

JsValue getGetter()

Returns:
property getter value (function or undefined) or null if not an accessor property

getGetterAsFunction

JsFunction getGetterAsFunction()

Returns:
getGetter() result as function or null if cannot cast

getSetter

JsValue getSetter()

Returns:
property setter value (function or undefined) or null if not an accessor property

isConfigurable

boolean isConfigurable()

Returns:
whether property described as 'configurable'

isEnumerable

boolean isEnumerable()

Returns:
whether property described as 'enumerable'

evaluateGet

RelayOk evaluateGet(JsEvaluateContext.EvaluateCallback callback,
                    SyncCallback syncCallback)

Asynchronously evaluates property getter and returns property value. Must only be used
 if getGetterAsFunction() returns not null; otherwise behavior is undefined and
 implementation-specific.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
package com.example.dm.zhbit.ZhiHu;

import android.os.AsyncTask;
import android.webkit.WebView;

import com.example.dm.zhbit.beans.ZhiHuNewsDetailBeans;
import com.example.dm.zhbit.utiltools.HttpUtil;
import com.example.dm.zhbit.utiltools.JsonHelper;

import org.json.JSONException;

import java.io.IOException;

/**
 * ZhiHuLoadNewsDetailTask
 */
public class ZhiHuLoadNewsDetailTask extends AsyncTask<Integer, Void, ZhiHuNewsDetailBeans> {
    private WebView mWebView;

    public ZhiHuLoadNewsDetailTask(WebView mWebView) {
        this.mWebView = mWebView;
    }

    @Override
    protected ZhiHuNewsDetailBeans doInBackground(Integer... params) {
        ZhiHuNewsDetailBeans mZhiHuNewsDetailBeans = null;
        try {
            mZhiHuNewsDetailBeans = JsonHelper.parseJsonToDetail(HttpUtil.getNewsDetail(params[0]));
        } catch (IOException | JSONException e) {

        } finally {
            return mZhiHuNewsDetailBeans;
        }
    }

    @Override
    protected void onPostExecute(ZhiHuNewsDetailBeans mZhiHuNewsDetailBeans) {
        String headerImage;
        if (mZhiHuNewsDetailBeans.getImage() == null || mZhiHuNewsDetailBeans.getImage() == "") {
            headerImage = "file:///android_asset/news_detail_header_image.jpg";

        } else {
            headerImage = mZhiHuNewsDetailBeans.getImage();
        }

        StringBuilder sb = new StringBuilder();
        sb.append("
")
                .append("
")
                .append(mZhiHuNewsDetailBeans.getTitle()).append("
")
                .append("")
                .append(mZhiHuNewsDetailBeans.getImage_source()).append("")
                .append("")
                .append("

");
        String mNewsContent = "<link rel=\"stylesheet\" type=\"text/css\" href=\"news_content_style.css\"/>"
                + "<link rel=\"stylesheet\" type=\"text/css\" href=\"news_header_style.css\"/>"
                + mZhiHuNewsDetailBeans.getBody().replace("
", sb.toString());
        mWebView.loadDataWithBaseURL("file:///android_asset/", mNewsContent, "text/html", "UTF-8", null);
    }
}


text:
package org.apache.ignite.internal.processors.query.h2;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;

import java.util.List;

/** Test for SQL min() and max() optimization */
public class IgniteSqlQueryMinMaxTest extends GridCommonAbstractTest {
    /** IP finder. */
    private static final TcpDiscoveryVmIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);

    /** Name of the cache for test */
    private static final String CACHE_NAME = "intCache";

    /** Name of the second test cache */
    private static final String CACHE_NAME_2 = "valCache";

    /** {@inheritDoc} */
    @Override protected void beforeTest() throws Exception {
        super.beforeTest();

        startGrids(4);
    }

    /** {@inheritDoc} */
    @Override protected void afterTest() throws Exception {
        super.afterTest();

        stopAllGrids();
    }

    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
        IgniteConfiguration cfg = super.getConfiguration(gridName);

        TcpDiscoverySpi spi = (TcpDiscoverySpi)cfg.getDiscoverySpi();

        spi.setIpFinder(IP_FINDER);

        CacheConfiguration<?, ?> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
        ccfg.setIndexedTypes(Integer.class, Integer.class);
        ccfg.setName(CACHE_NAME);

        CacheConfiguration<?, ?> ccfg2 = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
        ccfg2.setIndexedTypes(Integer.class, ValueObj.class);
        ccfg2.setName(CACHE_NAME_2);

        cfg.setCacheConfiguration(ccfg, ccfg2);

        if ("client".equals(gridName))
            cfg.setClientMode(true);

        return cfg;
    }

    /** Check min() and max() functions in queries */
    public void testQueryMinMax() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, ValueObj> cache = client.cache(CACHE_NAME_2);

            int count = 1_000;
            for (int idx = 0; idx < count; ++idx)
                cache.put(idx, new ValueObj(count - idx - 1, 0));

            long start = System.currentTimeMillis();
            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery("select min(_key), max(_key) from ValueObj"));
            List<List<?>> result = cursor.getAll();
            assertEquals(1, result.size());
            assertEquals(0, result.get(0).get(0));
            assertEquals(count - 1, result.get(0).get(1));
            if (log.isDebugEnabled())
                log.debug("Elapsed(1): " + (System.currentTimeMillis() - start));

            start = System.currentTimeMillis();
            cursor = cache.query(new SqlFieldsQuery("select min(idxVal), max(idxVal) from ValueObj"));
            result = cursor.getAll();
            assertEquals(1, result.size());
            assertEquals(0, result.get(0).get(0));
            assertEquals(count - 1, result.get(0).get(1));
            if (log.isDebugEnabled())
                log.debug("Elapsed(2): " + (System.currentTimeMillis() - start));

            start = System.currentTimeMillis();
            cursor = cache.query(new SqlFieldsQuery("select min(nonIdxVal), max(nonIdxVal) from ValueObj"));
            result = cursor.getAll();
            assertEquals(1, result.size());
            assertEquals(0, result.get(0).get(0));
            assertEquals(count - 1, result.get(0).get(1));
            if (log.isDebugEnabled())
                log.debug("Elapsed(3): " + (System.currentTimeMillis() - start));
        }
    }

    /** Check min() and max() on empty cache */
    public void testQueryMinMaxEmptyCache() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, ValueObj> cache = client.cache(CACHE_NAME_2);

            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery("select min(idxVal), max(idxVal) from ValueObj"));
            List<List<?>> result = cursor.getAll();
            assertEquals(1, result.size());
            assertEquals(2, result.get(0).size());
            assertNull(result.get(0).get(0));
            assertNull(result.get(0).get(1));
        }
    }

    /**
     * Check min() and max() over _key use correct index
     * Test uses value object cache
     */
    public void testMinMaxQueryPlanOnKey() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, ValueObj> cache = client.cache(CACHE_NAME_2);

            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery("explain select min(_key), max(_key) from ValueObj"));
            List<List<?>> result = cursor.getAll();
            assertEquals(2, result.size());
            assertTrue(((String) result.get(0).get(0)).toLowerCase().contains("_key_pk"));
            assertTrue(((String) result.get(0).get(0)).toLowerCase().contains("direct lookup"));
        }
    }

    /**
     * Check min() and max() over value fields use correct index.
     * Test uses value object cache
     */
    public void testMinMaxQueryPlanOnFields() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, ValueObj> cache = client.cache(CACHE_NAME_2);

            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery("explain select min(idxVal), max(idxVal) from ValueObj"));
            List<List<?>> result = cursor.getAll();
            assertEquals(2, result.size());
            assertTrue(((String)result.get(0).get(0)).toLowerCase().contains("idxval_idx"));
            assertTrue(((String)result.get(0).get(0)).toLowerCase().contains("direct lookup"));
        }
    }

    /**
     * Check min() and max() over _key uses correct index
     * Test uses primitive cache
     */
    public void testSimpleMinMaxQueryPlanOnKey() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, Integer> cache = client.cache(CACHE_NAME);

            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery("explain select min(_key), max(_key) from Integer"));
            List<List<?>> result = cursor.getAll();
            assertEquals(2, result.size());
            assertTrue(((String)result.get(0).get(0)).toLowerCase().contains("_key_pk"));
            assertTrue(((String)result.get(0).get(0)).toLowerCase().contains("direct lookup"));
        }
    }

    /**
     * Check min() and max() over _val uses correct index.
     * Test uses primitive cache
     */
    public void testSimpleMinMaxQueryPlanOnValue() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, Integer> cache = client.cache(CACHE_NAME);

            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery("explain select min(_val), max(_val) from Integer"));
            List<List<?>> result = cursor.getAll();
            assertEquals(2, result.size());
            assertTrue(((String)result.get(0).get(0)).toLowerCase().contains("_val_idx"));
            assertTrue(((String)result.get(0).get(0)).toLowerCase().contains("direct lookup"));
        }
    }

    /** Check min() and max() over group */
    public void testGroupMinMax() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, ValueObj> cache = client.cache(CACHE_NAME_2);

            int count = 1_000;
            int groupSize = 100;
            for (int idx = 0; idx < count; ++idx)
                cache.put(idx, new ValueObj(count - idx - 1, groupSize));

            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery(
                    "select groupVal, min(idxVal), max(idxVal), min(nonIdxVal), max(nonIdxVal) " +
                    " from ValueObj group by groupVal order by groupVal"));
            List<List<?>> result = cursor.getAll();

            assertEquals(count / groupSize, result.size());

            for (int idx = 0; idx < result.size(); ++idx) {
                assertEquals(idx, result.get(idx).get(0));//groupVal
                int min = idx * groupSize;
                int max = (idx + 1) * groupSize - 1;
                assertEquals(min, result.get(idx).get(1));//min(idxVal)
                assertEquals(max, result.get(idx).get(2));//max(idxVal)
                assertEquals(min, result.get(idx).get(3));//min(nonIdxVal)
                assertEquals(max, result.get(idx).get(4));//max(nonIdxVal)
            }
        }
    }

    /** Check min() and max() over group with having clause */
    public void testGroupHavingMinMax() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, ValueObj> cache = client.cache(CACHE_NAME_2);

            int count = 1_000;
            int groupSize = 100;
            for (int idx = 0; idx < count; ++idx)
                cache.put(idx, new ValueObj(count - idx - 1, groupSize));

            QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery(
                    "select groupVal, min(idxVal), max(idxVal), min(nonIdxVal), max(nonIdxVal) " +
                         "from ValueObj group by groupVal having min(idxVal) = ?" ).setArgs(0));

            List<List<?>> result = cursor.getAll();
            assertEquals(1, result.size());
            assertEquals(0, result.get(0).get(0));//groupVal
            assertEquals(0, result.get(0).get(1));//min(idxVal)
            assertEquals(groupSize - 1, result.get(0).get(2));//max(idxVal)
            assertEquals(0, result.get(0).get(3));//min(nonIdxVal)
            assertEquals(groupSize - 1, result.get(0).get(4));//max(nonIdxVal)

            cursor = cache.query(new SqlFieldsQuery(
                    "select groupVal, min(idxVal), max(idxVal), min(nonIdxVal), max(nonIdxVal) " +
                         "from ValueObj group by groupVal having max(idxVal) = ?" ).setArgs(count - 1));

            result = cursor.getAll();
            assertEquals(1, result.size());
            assertEquals((count - 1)/groupSize, result.get(0).get(0));//groupVal
            assertEquals(count - groupSize, result.get(0).get(1));//min(idxVal)
            assertEquals(count - 1, result.get(0).get(2));//max(idxVal)
            assertEquals(count - groupSize, result.get(0).get(3));//min(nonIdxVal)
            assertEquals(count - 1, result.get(0).get(4));//max(nonIdxVal)
        }
    }

    /** Check min() and max() over group with joins */
    public void testJoinGroupMinMax() throws Exception {
        try (Ignite client = startGrid("client")) {
            IgniteCache<Integer, Integer> cache = client.cache(CACHE_NAME);
            IgniteCache<Integer, ValueObj> cache2 = client.cache(CACHE_NAME_2);

            int count = 1_000;
            int groupSize = 100;
            for (int idx = 0; idx < count; ++idx) {
                cache.put(idx, idx);
                cache2.put(idx, new ValueObj(count - idx - 1, groupSize));
            }

            //join a.key = b.key, collocated
            QueryCursor<List<?>> cursor = cache.query(
                    new SqlFieldsQuery("select b.groupVal, min(a._key), max(a._key), min(a._val), max(a._val), " +
                            "min(b._key), max(b._key), min(b.idxVal), max(b.idxVal), min(b.nonIdxVal), max(b.nonIdxVal) " +
                            "from \"intCache\".Integer a, \"valCache\".ValueObj b where a._key = b._key " +
                            "group by b.groupVal order by b.groupVal"));

            List<List<?>> result = cursor.getAll();
            assertEquals(count / groupSize, result.size());
            for (int idx = 0; idx < result.size(); ++idx) {
                assertEquals(idx, result.get(idx).get(0));
                int min = idx * groupSize;
                int max = (idx + 1) * groupSize - 1;
                int revMin = count - max - 1;
                int revMax = count - min - 1;

                assertEquals(revMin, result.get(idx).get(1));//min(a._key)
                assertEquals(revMax, result.get(idx).get(2));//max(a._key)
                assertEquals(revMin, result.get(idx).get(3));//min(a._val)
                assertEquals(revMax, result.get(idx).get(4));//max(a._val)
                assertEquals(revMin, result.get(idx).get(5));//min(b._key)
                assertEquals(revMax, result.get(idx).get(6));//max(b_key)
                assertEquals(min, result.get(idx).get(7));//min(b.idxVal)
                assertEquals(max, result.get(idx).get(8));//max(b.idxVal),
                assertEquals(min, result.get(idx).get(9));//min(b.nonIdxVal)
                assertEquals(max, result.get(idx).get(10));//max(b.nonIdxVal)
            }

            //join a.key = b.val, non-collocated
            cursor = cache.query(
                    new SqlFieldsQuery("select b.groupVal, min(a._key), max(a._key), min(a._val), max(a._val), " +
                            "min(b._key), max(b._key), min(b.idxVal), max(b.idxVal), min(b.nonIdxVal), max(b.nonIdxVal) " +
                            "from \"intCache\".Integer a, \"valCache\".ValueObj b where a._key = b.idxVal " +
                            "group by b.groupVal order by b.groupVal")
                            .setDistributedJoins(true));

            result = cursor.getAll();

            assertEquals(count / groupSize, result.size());
            for (int idx = 0; idx < result.size(); ++idx) {
                assertEquals(idx, result.get(idx).get(0));
                int min = idx * groupSize;
                int max = (idx + 1) * groupSize - 1;
                int revMin = count - max - 1;
                int revMax = count - min - 1;

                assertEquals(min, result.get(idx).get(1));//min(a._key)
                assertEquals(max, result.get(idx).get(2));//max(a._key)
                assertEquals(min, result.get(idx).get(3));//min(a._val)
                assertEquals(max, result.get(idx).get(4));//max(a._val)
                assertEquals(revMin, result.get(idx).get(5));//min(b._key)
                assertEquals(revMax, result.get(idx).get(6));//max(b_key)
                assertEquals(min, result.get(idx).get(7));//min(b.idxVal)
                assertEquals(max, result.get(idx).get(8));//max(b.idxVal),
                assertEquals(min, result.get(idx).get(9));//min(b.nonIdxVal)
                assertEquals(max, result.get(idx).get(10));//max(b.nonIdxVal)
            }
        }
    }

    /** Value object for test cache */
    public class ValueObj {
        /** */
        @QuerySqlField(index = true)
        private final int idxVal;

        /** */
        @QuerySqlField
        private final int nonIdxVal;

        /** used for grouping */
        @QuerySqlField
        private final int groupVal;

        /** */
        public ValueObj(int v, int g) {
            this.idxVal = v;
            this.nonIdxVal = v;
            this.groupVal = (g == 0) ? v : v / g;
        }

        /** {@inheritDoc} */
        @Override public int hashCode() {
            return idxVal;
        }

        /** {@inheritDoc} */
        @Override public boolean equals(Object o) {
            if (this == o)
                return true;

            if (!(o instanceof ValueObj))
                return false;

            ValueObj other = (ValueObj)o;
            return idxVal == other.idxVal &&
                   nonIdxVal == other.nonIdxVal &&
                   groupVal == other.groupVal;
        }
    }
}


text:
'use strict';

require('mocha');
const assert = require('assert');
const Converter = require('..');
let converter;

describe('options', function() {
  beforeEach(() => (converter = new Converter()));

  describe('options.variables', function() {
    it('should return a list of all variables', function() {
      converter.convert('{% upcase "name" %}', {variables: true});
      assert(Array.isArray(converter.variables));
      assert.equal(converter.variables.length, 1);
    });

    it('should include block helpers', function() {
      converter.convert('{% raw %}{% endraw %}', {variables: true});
      assert(Array.isArray(converter.variables));
      assert.equal(converter.variables.length, 1);
      assert.equal(converter.variables[0], 'raw');
    });

    it('should reset variables when convert is called', function() {
      converter.convert('{% upcase "name" %}', {variables: true});
      assert.equal(converter.variables.length, 1);

      converter.convert('', {variables: true});
      assert.equal(converter.variables.length, 0);
    });
  });
});


text:
package org.slc.sli.domain;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;

import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import com.mongodb.BasicDBObjectBuilder;
import com.mongodb.DBObject;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.slc.sli.common.domain.NaturalKeyDescriptor;
import org.slc.sli.common.util.uuid.UUIDGeneratorStrategy;
import org.slc.sli.validation.NoNaturalKeysDefinedException;
import org.slc.sli.validation.schema.NaturalKeyExtractor;

/** Tests the Mongo Entity. */

public class MongoEntityTest {

    private UUIDGeneratorStrategy mockGeneratorStrategy;

    private NaturalKeyExtractor mockNaturalKeyExtractor;

    private static final String FIXED_UUID = "2012wd-type1uuid"; // new UUID(42L, 5150L);

    @Before
    public void init() {

        mockGeneratorStrategy = Mockito.mock(UUIDGeneratorStrategy.class);

        when(mockGeneratorStrategy.generateId()).thenReturn(FIXED_UUID);
        when(mockGeneratorStrategy.generateId(new NaturalKeyDescriptor(Mockito.anyMap()))).thenReturn(FIXED_UUID);

        mockNaturalKeyExtractor = Mockito.mock(NaturalKeyExtractor.class);
    }

    @Test
    public void testUUID() throws NoNaturalKeysDefinedException {

        Map<String, Object> body = new HashMap<String, Object>();

        MongoEntity entity = new MongoEntity("student", body);

        NaturalKeyDescriptor desc = new NaturalKeyDescriptor();
        when(mockNaturalKeyExtractor.getNaturalKeyDescriptor(entity)).thenReturn(desc);
        when(mockGeneratorStrategy.generateId(desc)).thenReturn(FIXED_UUID);

        DBObject obj = entity.toDBObject(mockGeneratorStrategy, mockNaturalKeyExtractor);

        MongoEntity entity2 = MongoEntity.fromDBObject(obj);

        assertEquals(entity2.getEntityId(), FIXED_UUID);
        assertTrue(obj.get("_id") instanceof String);
    }

    @Test
    public void testUUIDNoStrategy() {

        String uuid = UUID.randomUUID().toString();

        MongoEntity entity = createEntity(uuid);

        DBObject obj = entity.toDBObject(null, mockNaturalKeyExtractor);

        MongoEntity entity2 = MongoEntity.fromDBObject(obj);

        assertEquals(entity2.getEntityId(), uuid.toString());
        assertTrue(obj.get("_id") instanceof String);
    }

    private MongoEntity createEntity(String uuid) {

        Map<String, Object> body = new HashMap<String, Object>();
        Map<String, Object> metaData = new HashMap<String, Object>();
        MongoEntity entity = new MongoEntity("student", uuid, body, metaData, null, null);

        return entity;
    }

    @SuppressWarnings("unchecked")
    @Test
    public void testCreateCalculatedValue() throws IllegalAccessException, InvocationTargetException,
            NoSuchMethodException {
        Map<String, Object> body = new HashMap<String, Object>();
        Map<String, Object> calcValue = new HashMap<String, Object>();
        Map<String, Object> assessments = new HashMap<String, Object>();
        Map<String, Object> mathTest = new HashMap<String, Object>();
        Map<String, Object> highestEver = new HashMap<String, Object>();
        highestEver.put("ScaleScore", "28.0");
        mathTest.put("HighestEver", highestEver);
        assessments.put("ACT", mathTest);
        calcValue.put("assessments", assessments);
        DBObject dbObject = new BasicDBObjectBuilder().add("_id", "42").add("body", body)
                .add("calculatedValues", calcValue).get();
        CalculatedData<String> data = MongoEntity.fromDBObject(dbObject).getCalculatedValues();
        assertEquals(
                Arrays.asList(new CalculatedDatum<String>("assessments", "HighestEver", "ACT", "ScaleScore", "28.0")),
                data.getCalculatedValues());
    }

    @SuppressWarnings("unchecked")
    @Test
    public void testCreateAggregate() {
        Map<String, Object> body = new HashMap<String, Object>();
        Map<String, Object> aggregate = new HashMap<String, Object>();
        Map<String, Object> assessments = new HashMap<String, Object>();
        Map<String, Object> mathTest = new HashMap<String, Object>();
        Map<String, Integer> highestEver = new HashMap<String, Integer>();
        highestEver.put("E", 15);
        highestEver.put("2", 20);
        mathTest.put("HighestEver", highestEver);
        assessments.put("ACT", mathTest);
        aggregate.put("assessments", assessments);
        DBObject dbObject = new BasicDBObjectBuilder().add("_id", "42").add("body", body)
                .add("aggregations", aggregate).get();
        CalculatedData<Map<String, Integer>> data = MongoEntity.fromDBObject(dbObject).getAggregates();
        assertEquals(Arrays.asList(new CalculatedDatum<Map<String, Integer>>("assessments", "HighestEver", "ACT",
                "aggregate", highestEver)), data.getCalculatedValues());

    }

}


text:
#pragma once

#include "AuxiliaryBarrier.h"
#include "JSObject.h"

namespace JSC {

class LLIntOffsetsExtractor;

// This class serves two purposes:
//
// 1) It provides those parts of JSGenericTypedArrayView that don't depend
//    on template parameters.
//
// 2) It represents the DOM/WebCore-visible "JSArrayBufferView" type, which
//    C++ code uses when it wants to pass around a view of an array buffer
//    without concern for the actual type of the view.
//
// These two roles are quite different. (1) is just a matter of optimizing
// compile and link times by having as much code and data as possible not
// be subject to template specialization. (2) is *almost* a matter of
// semantics; indeed at the very least it is a matter of obeying a contract
// that we have with WebCore right now.
//
// One convenient thing that saves us from too much crazy is that
// ArrayBufferView is not instantiable.

// Typed array views have different modes depending on how big they are and
// whether the user has done anything that requires a separate backing
// buffer or the DOM-specified neutering capabilities.
enum TypedArrayMode : uint32_t {
    // Small and fast typed array. B is unused, V points to a vector
    // allocated in copied space, and M = FastTypedArray. V's liveness is
    // determined entirely by the view's liveness.
    FastTypedArray,

    // A large typed array that still attempts not to waste too much
    // memory. B is initialized to point to a slot that could hold a
    // buffer pointer, V points to a vector allocated using fastCalloc(),
    // and M = OversizeTypedArray. V's liveness is determined entirely by
    // the view's liveness, and the view will add a finalizer to delete V.
    OversizeTypedArray,

    // A typed array that was used in some crazy way. B's IndexingHeader
    // is hijacked to contain a reference to the native array buffer. The
    // native typed array view points back to the JS view. V points to a
    // vector allocated using who-knows-what, and M = WastefulTypedArray.
    // The view does not own the vector.
    WastefulTypedArray,

    // A data view. B is unused, V points to a vector allocated using who-
    // knows-what, and M = DataViewMode. The view does not own the vector.
    // There is an extra field (in JSDataView) that points to the
    // ArrayBuffer.
    DataViewMode
};

inline bool hasArrayBuffer(TypedArrayMode mode)
{
    return mode >= WastefulTypedArray;
}

// When WebCore uses a JSArrayBufferView, it expects to be able to get the native
// ArrayBuffer and little else. This requires slowing down and wasting memory,
// and then accessing things via the Butterfly. When JS uses a JSArrayBufferView
// it is always via the usual methods in the MethodTable, so this class's
// implementation of those has no need to even exist - we could at any time sink
// code into JSGenericTypedArrayView if it was convenient.

class JSArrayBufferView : public JSNonFinalObject {
public:
    typedef JSNonFinalObject Base;
    static const unsigned fastSizeLimit = 1000;

    static size_t sizeOf(uint32_t length, uint32_t elementSize)
    {
        return (length * elementSize + sizeof(EncodedJSValue) - 1)
            & ~(sizeof(EncodedJSValue) - 1);
    }

    static size_t allocationSize(size_t inlineCapacity)
    {
        ASSERT_UNUSED(inlineCapacity, !inlineCapacity);
        return sizeof(JSArrayBufferView);
    }

protected:
    class ConstructionContext {
        WTF_MAKE_NONCOPYABLE(ConstructionContext);

    public:
        enum InitializationMode { ZeroFill, DontInitialize };

        JS_EXPORT_PRIVATE ConstructionContext(VM&, Structure*, uint32_t length, uint32_t elementSize, InitializationMode = ZeroFill);

        // This is only for constructing fast typed arrays. It's used by the JIT's slow path.
        ConstructionContext(Structure*, uint32_t length, void* vector);

        JS_EXPORT_PRIVATE ConstructionContext(
            VM&, Structure*, RefPtr<ArrayBuffer>&&,
            unsigned byteOffset, unsigned length);

        enum DataViewTag { DataView };
        ConstructionContext(
            Structure*, RefPtr<ArrayBuffer>&&,
            unsigned byteOffset, unsigned length, DataViewTag);

        bool operator!() const { return !m_structure; }

        Structure* structure() const { return m_structure; }
        void* vector() const { return m_vector; }
        uint32_t length() const { return m_length; }
        TypedArrayMode mode() const { return m_mode; }
        Butterfly* butterfly() const { return m_butterfly; }

    private:
        Structure* m_structure;
        void* m_vector;
        uint32_t m_length;
        TypedArrayMode m_mode;
        Butterfly* m_butterfly;
    };

    JS_EXPORT_PRIVATE JSArrayBufferView(VM&, ConstructionContext&);
    JS_EXPORT_PRIVATE void finishCreation(VM&);

    static bool put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);

    static void visitChildren(JSCell*, SlotVisitor&);

public:
    TypedArrayMode mode() const { return m_mode; }
    bool hasArrayBuffer() const { return JSC::hasArrayBuffer(mode()); }

    bool isShared();
    JS_EXPORT_PRIVATE ArrayBuffer* unsharedBuffer();
    ArrayBuffer* possiblySharedBuffer();
    JSArrayBuffer* unsharedJSBuffer(ExecState* exec);
    JSArrayBuffer* possiblySharedJSBuffer(ExecState* exec);
    RefPtr<ArrayBufferView> unsharedImpl();
    RefPtr<ArrayBufferView> possiblySharedImpl();
    bool isNeutered() { return hasArrayBuffer() && !vector(); }
    void neuter();

    void* vector() const { return m_vector.get(); }

    unsigned byteOffset();
    unsigned length() const { return m_length; }

    DECLARE_EXPORT_INFO;

    static ptrdiff_t offsetOfVector() { return OBJECT_OFFSETOF(JSArrayBufferView, m_vector); }
    static ptrdiff_t offsetOfLength() { return OBJECT_OFFSETOF(JSArrayBufferView, m_length); }
    static ptrdiff_t offsetOfMode() { return OBJECT_OFFSETOF(JSArrayBufferView, m_mode); }

    static RefPtr<ArrayBufferView> toWrapped(VM&, JSValue);

private:
    static void finalize(JSCell*);

protected:
    friend class LLIntOffsetsExtractor;

    ArrayBuffer* existingBufferInButterfly();

    static String toStringName(const JSObject*, ExecState*);

    AuxiliaryBarrier<void*> m_vector;
    uint32_t m_length;
    TypedArrayMode m_mode;
};

} // namespace JSC

namespace WTF {

JS_EXPORT_PRIVATE void printInternal(PrintStream&, JSC::TypedArrayMode);

} // namespace WTF


text:
namespace wgt
{
namespace QtHelpers
{

static IQtFramework * s_qtFramework = nullptr;

//==============================================================================
QVariant toQVariant(const Variant & variant, QObject* parent)
{
	if (s_qtFramework == nullptr)
	{
		s_qtFramework = Context::queryInterface< IQtFramework >();
	}
	if (s_qtFramework != nullptr)
	{
		return s_qtFramework->toQVariant(variant, parent);
	}

	return QVariant( QVariant::Invalid );
}

//==============================================================================
QVariant toQVariant( const ObjectHandle & object, QObject* parent )
{
	return toQVariant( Variant( object ), parent );
}

//==============================================================================
Variant toVariant( const QVariant & qVariant )
{
	Variant variant;

	if (s_qtFramework == nullptr)
	{
		s_qtFramework = Context::queryInterface< IQtFramework >();
	}
	if (s_qtFramework != nullptr)
	{
		return s_qtFramework->toVariant( qVariant );
	}

	return Variant();
}

//==============================================================================
QQuickItem * findChildByObjectName( QObject * parent, const char * controlName )
{
	std::list< QObject * > queue;
	queue.push_back( parent );

	QString targetName( controlName );

	std::set< QObject * > visited;
	while (queue.empty() == false)
	{
		QQuickItem * child = qobject_cast< QQuickItem * >( queue.front() );
		if (child == NULL)
		{
			QWindow * window = qobject_cast< QWindow * >( queue.front() );
			queue.pop_front();
			if (window == NULL)
			{
				continue;
			}
			const QObjectList & children = window->children();
			for( QObjectList::const_iterator it = children.begin();
				it != children.end(); ++it )
			{
				std::pair< std::set< QObject * >::iterator, bool > insertIt =
					visited.insert( *it );
				if( insertIt.second )
				{
					queue.push_back( *it );
				}
			}
			continue;
		}
		if (targetName == child->objectName())
		{
			return child;
		}
		queue.pop_front();

		QList< QQuickItem * > children = child->childItems();
		for( QList< QQuickItem * >::const_iterator it = children.begin();
			it != children.end(); ++it )
		{
			std::pair< std::set< QObject * >::iterator, bool > insertIt =
				visited.insert( *it );
			if( insertIt.second )
			{
				queue.push_back( *it );
			}
		}
	}
	return NULL;
}

QUrl resolveQmlPath( const QQmlEngine & qmlEngine, const char * relativePath )
{
	QUrl url;

	if (relativePath == nullptr)
	{
		NGT_ERROR_MSG( "QtHelpers::resolveQmlPath(): relativePath is NULL.\n" );
		return url;
	}

	QStringList paths = qmlEngine.importPathList();

	for (auto path : paths)
	{
		QFileInfo info( QDir( path ), relativePath );
		if (info.exists() && info.isFile())
		{
			url = QUrl::fromLocalFile( info.canonicalFilePath() );
			break;
		}
	}

	//fallback to qrc
	if (url.isEmpty())
	{
		url.setScheme( "qrc" );
		if (relativePath[0] != '/')
		{
			url.setPath( QString( "/" ) + relativePath );
		}
		else
		{
			url.setPath( relativePath );
		}
	}

	return url;
}

};
} // end namespace wgt


text:
\hypertarget{classmmasgis_1_1anagrafica_1_1Click}{
\section{mmasgis::anagrafica::Click Class Reference}
\label{classmmasgis_1_1anagrafica_1_1Click}\index{mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}}
}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
def \hyperlink{classmmasgis_1_1anagrafica_1_1Click_aafa2a1e55f9ee39e80c63e5bd1e5c1ef}{\_\-\_\-init\_\-\_\-}
\item
def \hyperlink{classmmasgis_1_1anagrafica_1_1Click_a7424e0b7d24e93fab3cd69277c1196b5}{click}
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
\hyperlink{classmmasgis_1_1anagrafica_1_1Click_ad42df0a202340a69ad009068d360d006}{started}
\item
\hyperlink{classmmasgis_1_1anagrafica_1_1Click_a7d313410095a4552b247fe70b99c442f}{start}
\item
\hyperlink{classmmasgis_1_1anagrafica_1_1Click_a8a95c44c19f799cc8082faae9331c566}{end}
\end{DoxyCompactItemize}

\subsection{Detailed Description}
\begin{DoxyVerb}
 questa classe implementa un timer
 per risolvere un problema sui tasti di navigazione di anagrafica, sono troppo sensibili  e sulla lista dei risultati avanza a 2 alla volta
 questo problema e' sorto dopo aver sostituito i QPushButton con dei QAction all'interno della toolbar
 il costruttore e' un costruttore standard, non richiede nessun parametro
 @param started: boolean registra lo stato del timer se lanciato e' True, altrimenti e' False
 @param start: float memorizza il timestamp in cui il timer viene lanciato
 @param end:float memorizza il temestamp in cui viene fermato il timer
\end{DoxyVerb}

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classmmasgis_1_1anagrafica_1_1Click_aafa2a1e55f9ee39e80c63e5bd1e5c1ef}{
\index{mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}!\_\-\_\-init\_\-\_\-@{\_\-\_\-init\_\-\_\-}}
\index{\_\-\_\-init\_\-\_\-@{\_\-\_\-init\_\-\_\-}!mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}}
\subsubsection[{\_\-\_\-init\_\-\_\-}]{\setlength{\rightskip}{0pt plus 5cm}def mmasgis::anagrafica::Click::\_\-\_\-init\_\-\_\- (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}
\label{classmmasgis_1_1anagrafica_1_1Click_aafa2a1e55f9ee39e80c63e5bd1e5c1ef}

\subsection{Member Function Documentation}
\hypertarget{classmmasgis_1_1anagrafica_1_1Click_a7424e0b7d24e93fab3cd69277c1196b5}{
\index{mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}!click@{click}}
\index{click@{click}!mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}}
\subsubsection[{click}]{\setlength{\rightskip}{0pt plus 5cm}def mmasgis::anagrafica::Click::click (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{t}
\end{DoxyParamCaption}
)}}
\label{classmmasgis_1_1anagrafica_1_1Click_a7424e0b7d24e93fab3cd69277c1196b5}
\begin{DoxyVerb}
lancia il timer e lo resetta ogni volta che viene invocato
@param t:int timeout del click o meglio soglia di tempo al di sotto della quale non si vuole percepire il click sul pulsante e il metodo ritornera' False
@return boolean:True al primo avvio e se self.end-self.start>t
\end{DoxyVerb}

\subsection{Member Data Documentation}
\hypertarget{classmmasgis_1_1anagrafica_1_1Click_a8a95c44c19f799cc8082faae9331c566}{
\index{mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}!end@{end}}
\index{end@{end}!mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}}
\subsubsection[{end}]{\setlength{\rightskip}{0pt plus 5cm}{\bf mmasgis::anagrafica::Click::end}}}
\label{classmmasgis_1_1anagrafica_1_1Click_a8a95c44c19f799cc8082faae9331c566}
\hypertarget{classmmasgis_1_1anagrafica_1_1Click_a7d313410095a4552b247fe70b99c442f}{
\index{mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}!start@{start}}
\index{start@{start}!mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}{\bf mmasgis::anagrafica::Click::start}}}
\label{classmmasgis_1_1anagrafica_1_1Click_a7d313410095a4552b247fe70b99c442f}
\hypertarget{classmmasgis_1_1anagrafica_1_1Click_ad42df0a202340a69ad009068d360d006}{
\index{mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}!started@{started}}
\index{started@{started}!mmasgis::anagrafica::Click@{mmasgis::anagrafica::Click}}
\subsubsection[{started}]{\setlength{\rightskip}{0pt plus 5cm}{\bf mmasgis::anagrafica::Click::started}}}
\label{classmmasgis_1_1anagrafica_1_1Click_ad42df0a202340a69ad009068d360d006}

The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item
\hyperlink{anagrafica_8py}{anagrafica.py}\end{DoxyCompactItemize}


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

namespace Esri_Telecom_Tools.Core
{
    /// <summary>
    /// Encapsulates a combination of buffer tube and fiber count
    /// </summary>
    public class FiberCableConfiguration
    {
        private string _displayName = "";
        private string _detailDesc = "";
        private int _bufferCount = -1;
        private int _totalFiberCount = -1;
        private int _fibersPerTube = -1;

        /// <summary>
        /// Constructs a new FiberCableConfiguration
        /// </summary>
        /// <param name="bufferCount">Total number of buffer tubes</param>
        /// <param name="fiberCount">Total Number of fiber strands</param>
        public FiberCableConfiguration(int bufferCount, int totalFiberCount)
        {
            _bufferCount = bufferCount;
            _totalFiberCount = totalFiberCount;
            _fibersPerTube = totalFiberCount / bufferCount;
        }

        /// <summary>
        /// Constructs a new FiberCableConfiguration
        /// </summary>
        /// <param name="bufferCount">Total number of buffer tubes</param>
        /// <param name="strandsPerTube">Number of fiber strands per tube</param>
        /// <param name="displayName">Name that will appear in any dropdowns</param>
        /// <param name="detailDesc">Name or text that will appear in detailed descriptions</param>
        public FiberCableConfiguration(int bufferCount, int strandsPerTube, string displayName, string detailDesc)
        {
            _bufferCount = bufferCount;
            _fibersPerTube = strandsPerTube;
            _totalFiberCount = bufferCount * strandsPerTube;
            _displayName = displayName;
            _detailDesc = detailDesc;
        }

        /// <summary>
        /// The display name
        /// </summary>
        public string DisplayName
        {
            get
            {
                return _displayName;
            }
        }

        /// <summary>
        /// The detail name
        /// </summary>
        public string DetailDesc
        {
            get
            {
                return _detailDesc;
            }
        }

        /// <summary>
        /// The total number of buffer tubes
        /// </summary>
        public int BufferCount
        {
            get
            {
                return _bufferCount;
            }
        }

        /// <summary>
        /// The total number of fiber strands
        /// </summary>
        public int TotalFiberCount
        {
            get
            {
                return _totalFiberCount;
            }
        }

        /// <summary>
        /// The calculated (rounded if necessary) number of fiber strands
        /// </summary>
        public int FibersPerTube
        {
            get
            {
                return _fibersPerTube;
            }
        }

        /// <summary>
        /// A clear representation of the configuration.
        /// </summary>
        /// <returns>string</returns>
        public override string ToString()
        {
            return string.Format("{0} x {1} ({2} strands)", _bufferCount, _fibersPerTube, _totalFiberCount);
        }
    }
}


text:
#ifndef SVGFEPointLightElement_h
#define SVGFEPointLightElement_h

#include "core/svg/SVGFELightElement.h"

namespace WebCore {

class SVGFEPointLightElement FINAL : public SVGFELightElement {
public:
    static PassRefPtr<SVGFEPointLightElement> create(const QualifiedName&, Document*);

private:
    SVGFEPointLightElement(const QualifiedName&, Document*);

    virtual PassRefPtr<LightSource> lightSource() const;
};

} // namespace WebCore

#endif