text:
using System.Diagnostics.Contracts;
using Frontenac.Blueprints.Contracts;

namespace Frontenac.Blueprints
{
    /// <summary>
    ///     ThreadedTransactionalGraph provides more fine grained control over the transactional context.
    ///     While TransactionalGraph binds each transaction to the executing thread, ThreadedTransactionalGraph's newTransaction
    ///     returns a TransactionalGraph that represents its own transactional context independent of the executing thread.
    ///     Hence, one can have multiple threads operating against a single transaction represented by the returned TransactionalGraph object.
    ///     This is useful for parallelizing graph algorithms.
    ///     Note, that one needs to call TransactionalGraph.Commit() or TransactionalGraph.Rollback() to close the transactions returned
    /// </summary>
    [ContractClass(typeof (ThreadedTransactionalGraphContract))]
    public interface IThreadedTransactionalGraph : ITransactionalGraph
    {
        /// <summary>
        ///     Returns a TransactionalGraph that represents a transactional context independent of the executing transaction.
        /// </summary>
        /// <returns>A transactional context. Invoking TransactionalGraph.shutdown() successfully commits the transaction.</returns>
        ITransactionalGraph NewTransaction();
    }
}


text:
package example

import (
	"fmt"
	"time"

	"github.com/dshil/gometer"
)

func ExampleWriteToFile() {
	metrics := gometer.New()
	metrics.SetFormatter(gometer.NewFormatter("\n"))

	gometer.StartFileWriter(gometer.FileWriterParams{
		FilePath:       "test_file",
		UpdateInterval: time.Second,
		ErrorHandler: func(err error) {
			fmt.Println(err)
		},
	}).Stop()
}

redpajama_set_name: RedPajamaGithub


text:
---
title: "HTTP/2 Server Push in Hugo"
date: 2017-07-24T18:36:00+02:00
description: >
    As every page in Hugo can be output to multiple formats, it is easy to create Netlify's _redirects and _headers files on the fly.
categories: [blog]
keywords: []
slug: "http2-server-push-in-hugo"
aliases: []
author: bep
images:
- images/gohugoio-card-1.png
---

**Netlify** recently announced support for [HTTP/2 server push](https://www.netlify.com/blog/2017/07/18/http/2-server-push-on-netlify/), and we have now added it to the **gohugo.io** sites for the main `CSS` and `JS` bundles, along with server-side 301 redirect support.

If you navigate to https://gohugo.io and look in the Chrome developer network console, you should now see `Push` as the new source ("Initiator") for the `CSS` and `JSS`:

**Setting up this in Hugo was easy:**

## 1. Configure Netlify Output Formats

Add a new custom media type and two new output formats to `config.toml`. For more on output formats in Hugo, see [Custom Output Formats](/templates/output-formats/).
```bash
[outputs]
home = [ "HTML", "RSS", "REDIR", "HEADERS" ]

[mediaTypes]
[mediaTypes."text/netlify"]
suffix = ""
delimiter = ""

[outputFormats]
[outputFormats.REDIR]
mediatype = "text/netlify"
baseName = "_redirects"
isPlainText = true
notAlternative = true
[outputFormats.HEADERS]
mediatype = "text/netlify"
baseName = "_headers"
isPlainText = true
notAlternative = true
```
## 2. Add Template For the _headers File

Add `layouts/index.headers`:

```bash
/*
  X-Frame-Options: DENY
  X-XSS-Protection: 1; mode=block
  X-Content-Type-Options: nosniff
  Referrer-Policy: origin-when-cross-origin
*/
  Link: <{{ "dist/app.bundle.js" | relURL }}>; rel=preload; as=script
  Link: <{{ "dist/main.css" | relURL }}>; rel=preload; as=style
```
The template above creates both a security header definition and a HTTP/2 server push configuration.

Also note that this is a template for the home page, so the full `Page` with its `Site` and many variables are available. You can also use `partial` to include other templates.

## 3. Add Template For the _redirects File
Add `layouts/index.redir`:
```bash
# Netlify redirects. See https://www.netlify.com/docs/redirects/
{{  range $p := .Site.Pages -}}
{{ range .Aliases }}
{{  . | printf "%-35s" }}	{{ $p.RelPermalink -}}
{{ end -}}
{{- end -}}
```
The template above creates 301 redirects for your [aliases](/content-management/urls/#aliases), so you will probably want to turn off aliases in your `config.toml`: `disableAliases = true`.


text:
package webserviceclients.fakes

import play.api.libs.json.JsValue
import play.api.libs.ws.{WSCookie, WSResponse}
import scala.xml.Elem

final class FakeResponse(override val status: Int,
                         override val statusText: String = "",
                         headers: Map[String, String] = Map.empty,
                         fakeBody: Option[String] = None,
                         fakeXml: Option[Elem] = None,
                         fakeJson: Option[JsValue] = None) extends WSResponse {

  def allHeaders: Map[String, Seq[String]] = headers.map { case (k, v) => k -> Seq(v) }.toMap
  def underlying[T]: T = ???
  def cookies: Seq[WSCookie] = Nil

  def cookie(name: String): Option[WSCookie] = None

  override def header(key: String): Option[String] = headers.get(key)

  override lazy val body: String = fakeBody.getOrElse("")
  override lazy val xml: Elem = fakeXml.get
  override lazy val json: JsValue = fakeJson.get // Beware that if you constructed with the default then calling this will throw an exception.
}

object FakeResponse {
  def apply(status: Int,
            statusText: String = "",
            headers: Map[String, String] = Map.empty,
            fakeBody: Option[String] = None,
            fakeXml: Option[Elem] = None,
            fakeJson: Option[JsValue] = None) =
    new FakeResponse(status, statusText, headers, fakeBody, fakeXml, fakeJson)
}


text:
@echo off

rem Set the Mary base installation directory in an environment variable:
set BINDIR=%~dp0

call :RESOLVE "%BINDIR%\.." MARY_BASE

set CLASSPATH=".;%MARY_BASE%\lib\*"
java -showversion -ea -Xms40m -Xmx1g -cp %CLASSPATH% "-Dmary.base=%MARY_BASE%" marytts.server.Mary
goto :EOF

:RESOLVE
set %2=%~f1
goto :EOF

echo 'TTS Server is running'


text:
/**
 * A menu item that contains a togglable checkbox by default, but that can also be a part of a radio group.
 *
 *     @example
 *     Ext.create('Ext.menu.Menu', {
 *         width: 100,
 *         height: 110,
 *         floating: false,  // usually you want this set to True (default)
 *         renderTo: Ext.getBody(),  // usually rendered by it's containing component
 *         items: [{
 *             xtype: 'menucheckitem',
 *             text: 'select all'
 *         },{
 *             xtype: 'menucheckitem',
 *             text: 'select specific'
 *         },{
 *             iconCls: 'add16',
 *             text: 'icon item'
 *         },{
 *             text: 'regular item'
 *         }]
 *     });
 */
Ext.define('Ext.menu.CheckItem', {
    extend: 'Ext.menu.Item',
    alias: 'widget.menucheckitem',

    /**
     * @cfg {Boolean} [checked=false]
     * True to render the menuitem initially checked.
     */

    /**
     * @cfg {Function} checkHandler
     * Alternative for the {@link #checkchange} event.  Gets called with the same parameters.
     */

    /**
     * @cfg {Object} scope
     * Scope for the {@link #checkHandler} callback.
     */

    /**
     * @cfg {String} group
     * Name of a radio group that the item belongs.
     *
     * Specifying this option will turn check item into a radio item.
     *
     * Note that the group name must be globally unique.
     */

    /**
     * @cfg {String} checkedCls
     * The CSS class used by {@link #cls} to show the checked state.
     * Defaults to `Ext.baseCSSPrefix + 'menu-item-checked'`.
     */
    checkedCls: Ext.baseCSSPrefix + 'menu-item-checked',
    /**
     * @cfg {String} uncheckedCls
     * The CSS class used by {@link #cls} to show the unchecked state.
     * Defaults to `Ext.baseCSSPrefix + 'menu-item-unchecked'`.
     */
    uncheckedCls: Ext.baseCSSPrefix + 'menu-item-unchecked',
    /**
     * @cfg {String} groupCls
     * The CSS class applied to this item's icon image to denote being a part of a radio group.
     * Defaults to `Ext.baseCSSClass + 'menu-group-icon'`.
     * Any specified {@link #iconCls} overrides this.
     */
    groupCls: Ext.baseCSSPrefix + 'menu-group-icon',

    /**
     * @cfg {Boolean} [hideOnClick=false]
     * Whether to not to hide the owning menu when this item is clicked.
     * Defaults to `false` for checkbox items, and to `true` for radio group items.
     */
    hideOnClick: false,

    /**
     * @cfg {Boolean} [checkChangeDisabled=false]
     * True to prevent the checked item from being toggled. Any submenu will still be accessible.
     */
    checkChangeDisabled: false,

    ariaRole: 'menuitemcheckbox',

    childEls: [
        'itemEl', 'iconEl', 'textEl', 'checkEl'
    ],

    showCheckbox: true,

    isMenuCheckItem: true,

    checkboxCls: Ext.baseCSSPrefix + 'menu-item-checkbox',

    /**
     * @event beforecheckchange
     * Fires before a change event. Return false to cancel.
     * @param {Ext.menu.CheckItem} this
     * @param {Boolean} checked
     */

    /**
     * @event checkchange
     * Fires after a change event.
     * @param {Ext.menu.CheckItem} this
     * @param {Boolean} checked
     */

    initComponent: function() {
        var me = this;

        // coerce to bool straight away
        me.checked = !!me.checked;

        me.callParent(arguments);

        Ext.menu.Manager.registerCheckable(me);

        if (me.group) {
            if (me.initialConfig.hideOnClick !== false) {
                me.hideOnClick = true;
            }
        }
    },

    beforeRender: function() {
        var me = this;

        me.callParent();
        Ext.apply(me.renderData, {
            checkboxCls: me.checkboxCls,
            showCheckbox: me.showCheckbox
        });
    },

    afterRender: function() {
        var me = this;
        me.callParent();
        me.checked = !me.checked;
        me.setChecked(!me.checked, true);
        if (me.checkChangeDisabled) {
            me.disableCheckChange();
        }
    },

    /**
     * Disables just the checkbox functionality of this menu Item. If this menu item has a submenu, that submenu
     * will still be accessible
     */
    disableCheckChange: function() {
        var me = this,
            checkEl = me.checkEl;

        if (checkEl) {
            checkEl.addCls(me.disabledCls);
        }
        // In some cases the checkbox will disappear until repainted, see: EXTJSIV-6412
        if (Ext.isIE8 && me.rendered) {
            me.el.repaint();
        }
        me.checkChangeDisabled = true;
    },

    /**
     * Reenables the checkbox functionality of this menu item after having been disabled by {@link #disableCheckChange}
     */
    enableCheckChange: function() {
        var me = this,
            checkEl = me.checkEl;

        if (checkEl) {
            checkEl.removeCls(me.disabledCls);
        }
        me.checkChangeDisabled = false;
    },

    onClick: function(e) {
        var me = this;
        if(!me.disabled && !me.checkChangeDisabled && !(me.checked && me.group)) {
            me.setChecked(!me.checked);
        }
        this.callParent([e]);
    },

    onDestroy: function() {
        Ext.menu.Manager.unregisterCheckable(this);
        this.callParent(arguments);
    },

    /**
     * Sets the checked state of the item
     * @param {Boolean} checked True to check, false to uncheck
     * @param {Boolean} [suppressEvents=false] True to prevent firing the checkchange events.
     */
    setChecked: function(checked, suppressEvents) {
        var me = this,
            checkedCls = me.checkedCls,
            uncheckedCls = me.uncheckedCls,
            el = me.el;

        if (me.checked !== checked && (suppressEvents || me.fireEvent('beforecheckchange', me, checked) !== false)) {
            if (el) {
                if (checked) {
                    el.addCls(checkedCls);
                    el.removeCls(uncheckedCls);
                } else {
                    el.addCls(uncheckedCls);
                    el.removeCls(checkedCls);
                }
            }
            me.checked = checked;
            Ext.menu.Manager.onCheckChange(me, checked);
            if (!suppressEvents) {
                Ext.callback(me.checkHandler, me.scope || me, [me, checked]);
                me.fireEvent('checkchange', me, checked);
            }
        }
    }
});


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Iskanje izgubljene datoteke</title>
<link rel="stylesheet" type="text/css" href="../vodnik_1404.css">
<link rel="stylesheet" type="text/css" >

Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu

Novice

Forum

Kaj je Ubuntu?

Pogosta vprašanja

Skupnost

Povezave

					</script>

  Namizni vodnik Ubuntu » Datoteke »

Iskanje izgubljene datoteke

V primeru da ste ustvarili ali prejeli datoteko, vendar je ne morete najti, sledite tem namigom.

V primeru da se ne spomnite, kam ste datoteko shranili. Če veste, kako ste jo preimenovali, lahko iščete po njenem imenu. Iskati se lahko naučite na Iskanje datotek.

V primeru da ste datoteko pravkar prejeli, jo je vaš spletni brskalnik morda samodejno shranil v skupno mapo. Preverite mapi Namizje in Prejeto v svoji domači mapi.

Morda ste datoteko izbrisali po nesreči. Ko datoteko izbrišete, se premakne v smeti, kjer ostane dokler smeti ročno ne izpraznite. Za navodila kako obnoviti izbrisano datoteko si oglejte Obnovitev datoteke iz Smeti.

Morda ste datoteko preimenovali na način, da je postala skrita. Datoteke, ki se začnejo z . ali končajo z ~, so v upravljalniku datotek skrite. V upravljalniku datotek kliknite na Pogled ▸ Pokaži skrite datoteke. Za več podrobnosti si oglejte Skritje datoteke.

Več podrobnosti

Datoteke, mape in iskanje — Iskanje, izbris datotek, varnostne kopije, odstranljivi pogoni ...

Pogjejte tudi

Obnovitev datoteke iz Smeti — Izbrisane datoteke so običajno poslane v Smeti. Datoteke lahko iz Smeti dobite nazaj.

Material v tem dokumentu je na voljo pod prosto licenco. To je prevod dokumentacije Ubuntu, ki jo je sestavila Ubuntu dokumentacijska ekpa za Ubuntu. V slovenščino jo je prevedla skupina Ubuntu prevajalcev. Za poročanje napak v prevodih v tej dokumentaciji ali Ubuntuju pošljite sporočilo na dopisni seznam.


text:
import pytest
from commandment.dep.dep import DEP

@pytest.mark.depsim
class TestDEP:
    def test_account(self, dep: DEP):
        dep.fetch_token()
        account = dep.account()
        assert account is not None

    def test_fetch_devices(self, dep: DEP):
        dep.fetch_token()
        devices = dep.fetch_devices()
        assert len(devices) == 500

    # def test_device_details(self, dep: DEP):
    #     dep.fetch_token()
    #     device_details = dep.device_detail()

    def test_fetch_cursor(self, dep: DEP):
        dep.fetch_token()
        for page in dep.devices():
            print(len(page))
            for d in page:
                print(d)


text:
package com.smartdevicelink.proxy.rpc;

import androidx.annotation.NonNull;

import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
import com.smartdevicelink.proxy.rpc.enums.Result;

import java.util.Hashtable;

/**
 * @since SmartDeviceLink 7.0.0
 */
public class SubtleAlertResponse extends RPCResponse {
    public static final String KEY_TRY_AGAIN_TIME = "tryAgainTime";

    /**
     * Constructs a new SubtleAlertResponse object
     */
    public SubtleAlertResponse() {
        super(FunctionID.SUBTLE_ALERT.toString());
    }

    /**
     * Constructs a new SubtleAlertResponse object indicated by the Hashtable parameter
     *
     * @param hash The Hashtable to use
     */
    public SubtleAlertResponse(Hashtable<String, Object> hash) {
        super(hash);
    }

    /**
     * Constructs a new SubtleAlertResponse object
     *
     * @param success    whether the request is successfully processed
     * @param resultCode additional information about a response returning a failed outcome
     */
    public SubtleAlertResponse(@NonNull Boolean success, @NonNull Result resultCode) {
        this();
        setSuccess(success);
        setResultCode(resultCode);
    }

    /**
     * Sets the tryAgainTime.
     *
     * @param tryAgainTime Amount of time (in milliseconds) that an app must wait before resending an alert.
     *                     If provided, another system event or overlay currently has a higher priority than this alert.
     *                     An app must not send an alert without waiting at least the amount of time dictated.
     */
    public SubtleAlertResponse setTryAgainTime(Integer tryAgainTime) {
        setParameters(KEY_TRY_AGAIN_TIME, tryAgainTime);
        return this;
    }

    /**
     * Gets the tryAgainTime.
     *
     * @return Integer Amount of time (in milliseconds) that an app must wait before resending an alert.
     * If provided, another system event or overlay currently has a higher priority than this alert.
     * An app must not send an alert without waiting at least the amount of time dictated.
     */
    public Integer getTryAgainTime() {
        return getInteger(KEY_TRY_AGAIN_TIME);
    }
}


text:
package model;

import frostillicus.FNVUtil;
import frostillicus.xsp.bean.*;
import frostillicus.xsp.model.domino.AbstractDominoManager;
import frostillicus.xsp.model.domino.DominoModelList;

@ManagedBean(name="Databases")
@ApplicationScoped
public class DatabaseDocManager extends AbstractDominoManager<DatabaseDoc> {
	private static final long serialVersionUID = 1L;

	@Override
	protected Class<DatabaseDoc> getModelClass() {
		return DatabaseDoc.class;
	}

	@Override
	protected String getViewPrefix() {
		return "Databases\\";
	}

	@Override
	public DominoModelList<DatabaseDoc> getNamedCollection(final String name, final String category) {
		if("mine".equals(name)) {
			return super.getNamedCollection("By Username", FNVUtil.getSession().getEffectiveUserName());
		}
		return super.getNamedCollection(name, category);
	}

}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">

    <title>Simple Docker UI</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="./bower_components/bootstrap/dist/css/bootstrap.min.css">

    <link rel="stylesheet" href="./bower_components/bootstrap/dist/css/bootstrap-theme.min.css">

    <link rel="stylesheet" href="./bower_components/bootcards/dist/css/bootcards-desktop.min.css">

    <link rel="stylesheet" href="css/style.css">

    <link rel="stylesheet" href="./bower_components/font-awesome/css/font-awesome.min.css">

        Simple Docker UI. (built using scala.js & React.js)
         @felixgborrego
          https://github.com/felixgborrego/docker-ui-chrome-app


text:
import fs from 'fs'
import type { Plugin } from 'vite'
import { defineConfig } from 'vite'
import Components from 'unplugin-vue-components/vite'
import Unocss from 'unocss/vite'
import { presetAttributify, presetIcons, presetUno } from 'unocss'
import { resolve } from 'pathe'
import type { VitePluginPWAAPI } from 'vite-plugin-pwa'
import { VitePWA } from 'vite-plugin-pwa'
import fg from 'fast-glob'
import {
  pwaFontStylesRegex,
  pwaFontsRegex,
  stylusDescription,
  stylusName,
  stylusShortName,
} from './.vitepress/meta'
import { optimizePages } from './.vitepress/scripts/assets'

const PWA = VitePWA({
  outDir: '.vitepress/dist',
  registerType: 'autoUpdate',
  // include all static assets under public/
  includeAssets: fg.sync('**/*.{png,svg,ico,txt}', { cwd: resolve(__dirname, 'public') }),
  manifest: {
    id: '/',
    name: stylusName,
    short_name: stylusShortName,
    description: stylusDescription,
    theme_color: '#ffffff',
    icons: [
      {
        src: 'stylus.png',
        sizes: '192x192',
        type: 'image/png',
      },
      {
        src: 'logo.svg',
        sizes: '165x165',
        type: 'image/svg',
        purpose: 'any maskable',
      },
    ],
  },
  workbox: {
    navigateFallbackDenylist: [/^\/new$/],
    runtimeCaching: [
      {
        urlPattern: pwaFontsRegex,
        handler: 'CacheFirst',
        options: {
          cacheName: 'google-fonts-cache',
          expiration: {
            maxEntries: 10,
            maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
          },
          cacheableResponse: {
            statuses: [0, 200],
          },
        },
      },
      {
        urlPattern: pwaFontStylesRegex,
        handler: 'CacheFirst',
        options: {
          cacheName: 'gstatic-fonts-cache',
          expiration: {
            maxEntries: 10,
            maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
          },
          cacheableResponse: {
            statuses: [0, 200],
          },
        },
      },
    ],
  },
})

export default defineConfig({
  plugins: [
    Components({
      include: [/\.vue/, /\.md/],
      dirs: '.vitepress/components',
      dts: '.vitepress/components.d.ts',
    }),
    Unocss({
      shortcuts: [
        ['btn', 'px-4 py-1 rounded inline-flex justify-center gap-2 text-white leading-30px children:mya !no-underline cursor-pointer disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
      ],
      presets: [
        presetUno({
          dark: 'media',
        }),
        presetAttributify(),
        presetIcons({
          scale: 1.2,
        }),
      ],
    }),
    IncludesPlugin(),
    PWA,
    {
      name: 'pwa:post',
      enforce: 'post',
      async buildEnd() {
        const pwaPlugin: VitePluginPWAAPI = PWA.find(i => i.name === 'vite-plugin-pwa')?.api
        const pwa = pwaPlugin && !pwaPlugin.disabled
        await optimizePages(pwa)
        if (pwa)
          await pwaPlugin.generateSW()
      },
    },
  ],
})

function IncludesPlugin(): Plugin {
  return {
    name: 'include-plugin',
    enforce: 'pre',
    transform(code, id) {
      let changed = false
      code = code.replace(/\[@@include\]\((.*?)\)/, (_, url) => {
        changed = true
        const full = resolve(id, url)
        return fs.readFileSync(full, 'utf-8')
      })
      if (changed)
        return code
    },
  }
}


text:
#!/usr/bin/env python3
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Lexer for Web IDL

The lexer uses the PLY library to build a tokenizer which understands
Web IDL tokens.

Web IDL, and Web IDL regular expressions can be found at:
   http://webidl.spec.whatwg.org/
PLY can be found at:
   http://www.dabeaz.com/ply/
"""

import os.path
import sys

SRC_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
sys.path.insert(0, os.path.join(SRC_DIR, 'third_party'))
from ply import lex

#
# IDL Lexer
#
class IDLLexer(object):
  # 'literals' is a value expected by lex which specifies a list of valid
  # literal tokens, meaning the token type and token value are identical.
  literals = r'"*.(){}[],;:=+-/~|&^?<>'

  # 't_ignore' contains ignored characters (spaces and tabs)
  t_ignore = ' \t'

  # 'tokens' is a value required by lex which specifies the complete list
  # of valid token types.
  tokens = [
    # Data types
      'float',
      'integer',
      'string',

    # Symbol and keywords types
      'SPECIAL_COMMENT',
      'identifier',

    # MultiChar operators
      'ELLIPSIS',
  ]

  # 'keywords' is a map of string to token type.  All tokens matching
  # KEYWORD_OR_SYMBOL are matched against keywords dictionary, to determine
  # if the token is actually a keyword.
  keywords = {
      'any': 'ANY',
      'async': 'ASYNC',
      'attribute': 'ATTRIBUTE',
      'boolean': 'BOOLEAN',
      'byte': 'BYTE',
      'ByteString': 'BYTESTRING',
      'callback': 'CALLBACK',
      'const': 'CONST',
      'constructor': 'CONSTRUCTOR',
      'deleter': 'DELETER',
      'dictionary': 'DICTIONARY',
      'DOMString': 'DOMSTRING',
      'double': 'DOUBLE',
      'enum': 'ENUM',
      'false': 'FALSE',
      'float': 'FLOAT',
      'FrozenArray': 'FROZENARRAY',
      'getter': 'GETTER',
      'includes': 'INCLUDES',
      'Infinity': 'INFINITY',
      'inherit': 'INHERIT',
      'interface': 'INTERFACE',
      'iterable': 'ITERABLE',
      'long': 'LONG',
      'maplike': 'MAPLIKE',
      'mixin': 'MIXIN',
      'namespace': 'NAMESPACE',
      'NaN': 'NAN',
      'null': 'NULL',
      'object': 'OBJECT',
      'ObservableArray': 'OBSERVABLEARRAY',
      'octet': 'OCTET',
      'optional': 'OPTIONAL',
      'or': 'OR',
      'partial': 'PARTIAL',
      'Promise': 'PROMISE',
      'readonly': 'READONLY',
      'record': 'RECORD',
      'required': 'REQUIRED',
      'sequence': 'SEQUENCE',
      'setlike': 'SETLIKE',
      'setter': 'SETTER',
      'short': 'SHORT',
      'static': 'STATIC',
      'stringifier': 'STRINGIFIER',
      'true': 'TRUE',
      'typedef': 'TYPEDEF',
      'unrestricted': 'UNRESTRICTED',
      'unsigned': 'UNSIGNED',
      'USVString': 'USVSTRING',
      'void': 'VOID'
  }

  # Token definitions
  #
  # Lex assumes any value or function in the form of 't_<TYPE>' represents a
  # regular expression where a match will emit a token of type <TYPE>.  In the
  # case of a function, the function is called when a match is made. These
  # definitions come from WebIDL.
  #
  # These need to be methods for lexer construction, despite not using self.
  # pylint: disable=R0201
  def t_ELLIPSIS(self, t):
    r'\.\.\.'
    return t

  # Regex needs to be in the docstring
  # pylint: disable=C0301
  def t_float(self, t):
    r'-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)'
    return t

  def t_integer(self, t):
    r'-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)'
    return t

  # A line ending '\n', we use this to increment the line number
  def t_LINE_END(self, t):
    r'\n+'
    self.AddLines(len(t.value))

  # We do not process escapes in the IDL strings.  Strings are exclusively
  # used for attributes and enums, and not used as typical 'C' constants.
  def t_string(self, t):
    r'"[^"]*"'
    t.value = t.value[1:-1]
    self.AddLines(t.value.count('\n'))
    return t

  # A Javadoc style comment:  /** xxx */
  # Unlike t_COMMENT, this is NOT ignored.
  # Also note that this should be defined before t_COMMENT.
  def t_SPECIAL_COMMENT(self, t):
    r'/\*\*(.|\n)+?\*/'
    self.AddLines(t.value.count('\n'))
    return t

  # A C or C++ style comment:  /* xxx */ or //
  # This token is ignored.
  def t_COMMENT(self, t):
    r'(/\*(.|\n)*?\*/)|(//.*(\n[ \t]*//.*)*)'
    self.AddLines(t.value.count('\n'))

  # A symbol or keyword.
  def t_KEYWORD_OR_SYMBOL(self, t):
    r'[_-]?[A-Za-z][A-Za-z_0-9-]*'

    # All non-keywords are assumed to be symbols
    t.type = self.keywords.get(t.value, 'identifier')

    # We strip leading underscores so that you can specify symbols with the same
    # value as a keywords (E.g. a dictionary named 'interface').
    if t.value[0] == '_':
      t.value = t.value[1:]
    return t

  def t_ANY_error(self, t):
    msg = 'Unrecognized input'
    line = self.Lexer().lineno

    # If that line has not been accounted for, then we must have hit
    # EoF, so compute the beginning of the line that caused the problem.
    if line >= len(self.index):
      # Find the offset in the line of the first word causing the issue
      word = t.value.split()[0]
      offs = self.lines[line - 1].find(word)
      # Add the computed line's starting position
      self.index.append(self.Lexer().lexpos - offs)
      msg = 'Unexpected EoF reached after'

    pos = self.Lexer().lexpos - self.index[line]
    out = self.ErrorMessage(line, pos, msg)
    sys.stderr.write(out + '\n')
    self._lex_errors += 1

  def AddLines(self, count):
    # Set the lexer position for the beginning of the next line.  In the case
    # of multiple lines, tokens can not exist on any of the lines except the
    # last one, so the recorded value for previous lines are unused.  We still
    # fill the array however, to make sure the line count is correct.
    self.Lexer().lineno += count
    for _ in range(count):
      self.index.append(self.Lexer().lexpos)

  def FileLineMsg(self, line, msg):
    # Generate a message containing the file and line number of a token.
    filename = self.Lexer().filename
    if filename:
      return "%s(%d) : %s" % (filename, line + 1, msg)
    return "<BuiltIn> : %s" % msg

  def SourceLine(self, line, pos):
    # Create a source line marker
    caret = ' ' * pos + '^'
    # We decrement the line number since the array is 0 based while the
    # line numbers are 1 based.
    return "%s\n%s" % (self.lines[line - 1], caret)

  def ErrorMessage(self, line, pos, msg):
    return "\n%s\n%s" % (
        self.FileLineMsg(line, msg),
        self.SourceLine(line, pos))

#
# Tokenizer
#
# The token function returns the next token provided by IDLLexer for matching
# against the leaf paterns.
#
  def token(self):
    tok = self.Lexer().token()
    if tok:
      self.last = tok
    return tok

  def GetTokens(self):
    outlist = []
    while True:
      t = self.Lexer().token()
      if not t:
        break
      outlist.append(t)
    return outlist

  def Tokenize(self, data, filename='__no_file__'):
    lexer = self.Lexer()
    lexer.lineno = 1
    lexer.filename = filename
    lexer.input(data)
    self.lines = data.split('\n')

  def KnownTokens(self):
    return self.tokens

  def Lexer(self):
    if not self._lexobj:
      self._lexobj = lex.lex(object=self, lextab=None, optimize=0)
    return self._lexobj

  def _AddToken(self, token):
    if token in self.tokens:
      raise RuntimeError('Same token: ' + token)
    self.tokens.append(token)

  def _AddTokens(self, tokens):
    for token in tokens:
      self._AddToken(token)

  def _AddKeywords(self, keywords):
    for key in keywords:
      value = key.upper()
      self._AddToken(value)
      self.keywords[key] = value

  def _DelKeywords(self, keywords):
    for key in keywords:
      self.tokens.remove(key.upper())
      del self.keywords[key]

  def __init__(self):
    self.index = [0]
    self._lex_errors = 0
    self.linex = []
    self.filename = None
    self.keywords = {}
    self.tokens = []
    self._AddTokens(IDLLexer.tokens)
    self._AddKeywords(IDLLexer.keywords)
    self._lexobj = None
    self.last = None
    self.lines = None

# If run by itself, attempt to build the lexer
if __name__ == '__main__':
  lexer_object = IDLLexer()


text:
/// <reference path="../../Scripts/typings/angularjs/angular.d.ts" />
/// <reference path="./errorModel.ts" />

"use strict";

module app.angular.Models {
    export class UsernameDataModel {
        value: string;
    }

    export class UsernameChangeRequestModel {
        constructor(id: string = null, name: string = null, value: string = null, streamId: string = null) {
            this.id = id;
            this.name = name;
            this.value = value;
            this.streamId = streamId;
        }

        id: string;
        name: string;
        value: string;
        streamId: string;
    }

    export class UsernameChangeResponseModel {
        data: UsernameDataModel;
        error: ErrorModel;
    }
}


text:
import sys

from sasila.system_normal.spider.spider_core import SpiderCore
from sasila.system_normal.pipeline.pic_pipeline import PicPipeline

from sasila.system_normal.processor.base_processor import BaseProcessor, Rule, LinkExtractor
from sasila.system_normal.downloader.http.spider_request import Request
from bs4 import BeautifulSoup as bs

if sys.version_info < (3, 0):
    reload(sys)
    sys.setdefaultencoding('utf-8')

class FeProcessor(BaseProcessor):
    spider_id = 'fe'
    spider_name = 'fe'
    allowed_domains = ['58.com']
    start_requests = [Request(url='http://www.58.com/daikuan/changecity/')]

    rules = (
        Rule(LinkExtractor(regex_str=r"http://[a-z]*?.58.com/daikuan/"), priority=0),
        Rule(LinkExtractor(regex_str=r"/daikuan/pn\d+/"), priority=1),
        Rule(LinkExtractor(css_str="table.small-tbimg a.t"), priority=3, callback='save'),
    )

    def save(self, response):
        if response.m_response:
            print(bs(response.m_response.content, 'lxml').title.string)

# fe_spider = SpiderCore(FeProcessor()).set_pipeline(PicPipeline())
# if __name__ == '__main__':
#     fe_spider.start()


text:
'use strict';

var connect = require('connect');
var assert = require('assert');
var request = require('request');
var domain = require('domain');

var reqContext = require('./index');
var middleware = reqContext.middleware('test');

describe('request-context', function() {
	var testValue;
	var context;

	function setAsync() {
		reqContext.setContext('test:async.value', testValue);
	}

	function setContext(req, res, next) {
		reqContext.set('test:value', testValue);
		setTimeout(function() {
			setAsync();
			next();
		}, 0);
	}

	function getContext(req, res, next) {
		context = reqContext.get('test');
		next();
	}

	beforeEach(function () {
		testValue = {
			string: 'string',
			object: {
				property: 'property'
			}
		};
	});

	describe('middleware', function () {
		var port = 9009;
		var url = 'http://127.0.0.1:' + port;

		var app;
		var server;

		before(function (done) {
			app = connect()
				.use(middleware)
				.use(setContext)
				.use(getContext);
			server = app.listen(port, done);
		});

		after(function () {
			server.close();
		});

		beforeEach(function (done) {
			request.get(url, done);
		});

		it('should attach a context object', function () {
			assert.deepEqual(context.value, testValue);
		});

		it('should provide access to the context in async functions', function () {
			assert.deepEqual(context.async.value, testValue);
		});

	});

	describe('multiple middleware', function () {
		var middleware2 = reqContext.middleware('test2');

		var port = 9009;
		var url = 'http://127.0.0.1:' + port;

		var app;
		var server;
		var contextRoot;
		var context2;
		var testValue2;

		function setAsync2() {
			reqContext.setContext('test2:async.value', testValue2);
		}

		function setContext2(req, res, next) {
			reqContext.set('test2:value', testValue2);
			setTimeout(function() {
				setAsync2();
				next();
			}, 0);
		}

		function getContext2(req, res, next) {
			contextRoot = reqContext.get(null);
			context2 = reqContext.get('test2');
			next();
		}

		before(function (done) {
			app = connect()
				.use(middleware)
				.use(setContext)
				.use(middleware2)
				.use(setContext2)
				.use(getContext)
				.use(getContext2);
			server = app.listen(port, done);
		});

		after(function () {
			server.close();
		});

		beforeEach(function (done) {
			testValue2 = {
				string: 'string2',
				object: {
					property: 'property2'
				}
			};

			request.get(url, done);
		});

		it('first namespace should be available', function () {
			assert.deepEqual(context.value, testValue);
		});

		it('second namespace should be available', function () {
			assert.deepEqual(context2.value, testValue2);
		});

		it('first namespace should be available in async functions', function () {
			assert.deepEqual(context.async.value, testValue);
		});

		it('second namespace should be available in async functions', function () {
			assert.deepEqual(context2.async.value, testValue2);
		});

		it('both namespaces should exist on a single context object', function () {
			assert.ok(contextRoot['test']);
			assert.ok(contextRoot['test2']);
		});

	});

	describe('context path syntax', function () {

		it('should set and get a property for a path', function (done) {
			var d = domain.create();

			function check() {
				assert.deepEqual(reqContext.getContext('test:value.string'), testValue.string);
				assert.deepEqual(reqContext.getContext('test:async.value.object.property'), testValue.object.property);
			}

			function run() {
				setTimeout(setAsync, 0);
				reqContext.setContext('test:value', testValue);
				setTimeout(check, 0);
				done();
			}

			d.run(run);
		});
	});

});


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np
import matplotlib.pyplot as plt
from six.moves import xrange

from wtte import weibull

def weibull_contour(Y, U, is_discrete, true_alpha, true_beta, logx=True, samples=200, lines=True):

    xlist = np.linspace(true_alpha / np.e, true_alpha * np.e, samples)
    ylist = np.linspace(true_beta / np.e, true_beta * np.e, samples)
    x_grid, y_grid = np.meshgrid(xlist, ylist)

    loglik = x_grid * 0

    if is_discrete:
        fun = weibull.discrete_loglik
    else:
        fun = weibull.continuous_loglik

    for i in xrange(len(Y)):
        loglik = loglik + \
            fun(Y[i], x_grid, y_grid, U[i])

    z_grid = loglik / len(Y)

    plt.figure()
    if logx:
        x_grid = np.log(x_grid)
        true_alpha = np.log(true_alpha)
        xlab = r'$\log(\alpha)$'
    else:
        xlab = r'$\alpha$'

    cp = plt.contourf(x_grid, y_grid, z_grid, 100, cmap='jet')
    plt.colorbar(cp)
    if lines:
        plt.axvline(true_alpha, linestyle='dashed', c='black')
        plt.axhline(true_beta, linestyle='dashed', c='black')
    plt.xlabel(xlab)
    plt.ylabel(r'$\beta$')


text:
package edu.gemini.spdb.reports.collection.report;

import edu.gemini.spModel.core.SPProgramID;
import edu.gemini.spdb.reports.IColumn;
import edu.gemini.spdb.reports.IRow;
import edu.gemini.spdb.reports.ISort;
import edu.gemini.spdb.reports.collection.table.TemplateSummaryTable.Columns;
import edu.gemini.spdb.reports.collection.util.ReportUtils;

public class TemplateSummaryTextReport extends
		AbstractTemplateSummaryReport {

	private static final ISort[] GROUPS = new ISort[] {
	};

	private static final IColumn[] COLUMNS = new IColumn[] {
		Columns.PROGRAM_ID,
		Columns.BAND,
		Columns.PROG_TOO_STATUS,
		Columns.TEMPLATE_ID,
		Columns.TARGET_NAME,
		Columns.RA,
        Columns.DEC,
        Columns.COND_CONSTRAINTS,
        Columns.INST_CONFIG,
        Columns.PHASE1_TIME,
	};

	@Override
	protected String getTemplateName() {
		return "TemplateSummaryTextReport.vm";
	}

	@Override
	protected String getFileExtension() {
		return "txt";
	}

	@Override
	protected ISort[] getGroups() {
		return GROUPS;
	}

	@Override
	protected IColumn[] getOutputColumns() {
		return COLUMNS;
	}

	@Override
	protected String getSemester(IRow row) {
        return ReportUtils.getSemester((SPProgramID) row.getValue(0));
	}
}


text:
package eu.mosaic_cloud.platform.v2.configuration;

import java.util.IdentityHashMap;
import java.util.regex.Pattern;

/**
 * Class for handling identifiers of configuration parameters. The parameters in a configuration file may form a hierarchy and
 * thus an identifier string may be absolute or relative.
 *
 * @author Ciprian Craciun, Georgiana Macariu
 */
public final class ConfigurationIdentifier
{
	private ConfigurationIdentifier (final boolean absolute, final String identifier) {
		super ();
		this.absolute = absolute;
		this.identifier = identifier;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals (final Object identifier) {
		boolean isEqual;
		if (identifier == null) {
			isEqual = false;
		} else if (identifier instanceof ConfigurationIdentifier) {
			final ConfigurationIdentifier otherId = (ConfigurationIdentifier) identifier;
			isEqual = (this.absolute == otherId.absolute) && (((this.identifier != null) && this.identifier.equals (otherId.identifier)) || ((this.identifier == null) && (otherId.identifier == null)));
		} else {
			isEqual = false;
		}
		return isEqual;
	}

	/**
	 * Returns the string identifier.
	 *
	 * @return the string identifier
	 */
	public String getIdentifier () {
		return this.identifier;
	}

	@Override
	public int hashCode () {
		final int prime = 31;
		int result = 1;
		result = (prime * result) + (this.absolute ? 1231 : 1237);
		result = (prime * result) + ((this.identifier == null) ? 0 : this.identifier.hashCode ());
		return result;
	}

	/**
	 * Returns if this identifier is absolute or not.
	 *
	 * @return true if it is absolute
	 */
	public boolean isAbsolute () {
		return this.absolute;
	}

	/**
	 * Builds the {@link ConfigurationIdentifier} object of a configuration parameter relative to this configuration identifier.
	 *
	 * @param identifier
	 *            the identifier to solve
	 * @return the built identifier
	 */
	public ConfigurationIdentifier resolve (final ConfigurationIdentifier identifier) {
		if (identifier.absolute) {
			throw new IllegalArgumentException ();
		}
		return ConfigurationIdentifier.resolveRelative (this, identifier.identifier);
	}

	/**
	 * Builds the {@link ConfigurationIdentifier} object of a configuration parameter relative to this configuration identifier.
	 *
	 * @param specification
	 *            the string specification of the identifier to be built
	 * @return the built identifier
	 */
	public ConfigurationIdentifier resolve (final String specification) {
		return ConfigurationIdentifier.resolve (this, specification);
	}

	@Override
	public String toString () {
		return this.identifier;
	}

	/**
	 * Indicates if this identifier is absolute
	 */
	private final boolean absolute;
	/**
	 * The string identifier.
	 */
	private final String identifier;

	/**
	 * Builds the {@link ConfigurationIdentifier} object of a configuration parameter given by an absolute identifier.
	 *
	 * @param reference
	 *            the parent {@link ConfigurationIdentifier} object
	 * @param specification
	 *            the string specification of the parameter identifier
	 * @return the built {@link ConfigurationIdentifier} object
	 */
	public static ConfigurationIdentifier resolveAbsolute (final String specification) {
		return ConfigurationIdentifier.resolve (ConfigurationIdentifier.ROOT, specification);
	}

	/**
	 * Builds the {@link ConfigurationIdentifier} object of a configuration parameter.
	 *
	 * @param reference
	 *            the parent {@link ConfigurationIdentifier} object
	 * @param specification
	 *            the string specification of the parameter identifier
	 * @return the built {@link ConfigurationIdentifier} object
	 */
	public static ConfigurationIdentifier resolveRelative (final ConfigurationIdentifier reference, final String specification) {
		return ConfigurationIdentifier.resolve (reference, specification);
	}

	/**
	 * Builds the {@link ConfigurationIdentifier} object of a configuration parameter.
	 *
	 * @param specification
	 *            the string specification of the parameter identifier
	 * @return the built {@link ConfigurationIdentifier} object
	 */
	public static ConfigurationIdentifier resolveRelative (final String specification) {
		return ConfigurationIdentifier.resolve (null, specification);
	}

	/**
	 * Builds the {@link ConfigurationIdentifier} object of a configuration parameter.
	 *
	 * @param reference
	 *            the parent {@link ConfigurationIdentifier} object
	 * @param specification
	 *            the string specification of the parameter identifier
	 * @return the built {@link ConfigurationIdentifier} object
	 */
	private static ConfigurationIdentifier resolve (final ConfigurationIdentifier reference, final String specification) {
		boolean isAbsolute = false;
		String identifier_;
		String identifier;
		ConfigurationIdentifier parameterIdentifier;
		if (reference == null) {
			if (specification.charAt (0) == '/') {
				isAbsolute = true;
			}
			identifier_ = specification;
		} else if (reference.absolute) {
			isAbsolute = true;
			if (reference.identifier == null) {
				identifier_ = "/" + specification;
			} else {
				identifier_ = reference.identifier + "/" + specification;
			}
			identifier_ = identifier_.replaceAll ("//", "/");
		} else {
			identifier_ = reference.identifier + "/" + specification;
		}
		if (!ConfigurationIdentifier.IDENTIFIER_PATTERN.matcher (identifier_).matches ()) {
			throw new IllegalArgumentException (String.format ("Invalid configuration identifier: `%s`", identifier_));
		}
		identifier = identifier_.intern ();
		synchronized (ConfigurationIdentifier.IDENTIFIERS) {
			if (ConfigurationIdentifier.IDENTIFIERS.containsKey (identifier)) {
				parameterIdentifier = ConfigurationIdentifier.IDENTIFIERS.get (identifier);
			} else {
				parameterIdentifier = new ConfigurationIdentifier (isAbsolute, identifier);
				ConfigurationIdentifier.IDENTIFIERS.put (parameterIdentifier.identifier, parameterIdentifier);
			}
		}
		return parameterIdentifier;
	}

	public static final ConfigurationIdentifier ROOT = new ConfigurationIdentifier (true, null);
	private static final Pattern IDENTIFIER_PATTERN = Pattern.compile ("^/?([a-z]([a-z0-9_.]*[a-z0-9])?/)*([a-z]([a-z0-9_.]*[a-z0-9])?)$", Pattern.DOTALL);
	private static final IdentityHashMap<String, ConfigurationIdentifier> IDENTIFIERS = new IdentityHashMap<String, ConfigurationIdentifier> ();
}


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

namespace MidiPlugin
{
    public class FriendlyNameAttribute : Attribute
    {
        public string Name { get; set; }
        public FriendlyNameAttribute(string Name)
        {
            this.Name = Name;
        }
    }
}


text:
<?php

/**
 * UserIdentity represents the data needed to identity a user.
 * It contains the authentication method that checks if the provided
 * data can identity the user.
 */
class UserIdentity extends CUserIdentity
{
	/**
	 * Authenticates a user.
	 * The example implementation makes sure if the username and password
	 * are both 'demo'.
	 * In practical applications, this should be changed to authenticate
	 * against some persistent user identity storage (e.g. database).
	 * @return boolean whether authentication succeeds.
	 */
        public $pass;
        public $_id;
          public function __construct($username,$password)
	{
		$this->pass=$password;
                parent::__construct($username, $password);
	}
    /**
	public function authenticate()
	{
		$users=array(
			// username => password
			'demo'=>'demo',
			'admin'=>'admin',
		);
                $user = User::model()->findByAttributes(array('username' => $this->username));
		if($user === null)

			$this->errorCode=self::ERROR_USERNAME_INVALID;
		elseif($users[$this->username]!==$this->password)
			$this->errorCode=self::ERROR_PASSWORD_INVALID;
		else
			$this->errorCode=self::ERROR_NONE;
		return !$this->errorCode;
	}
        */
          public function authenticate() {

                $user = Users::model()->findByAttributes(array('username' => $this->username));
                if ($user === null) {
                    $this->errorCode = self::ERROR_USERNAME_INVALID;
                } else {
                     if ($user->pass !== $user->encrypt($this->pass)) {
                        $this->errorCode = self::ERROR_PASSWORD_INVALID;
                    } else {
                        $this->_id = $user->id;
                          if (null === $user->login_time) {
                        $lastLogin = time();
                    } else {
                        $lastLogin = strtotime($user->login_time);
                    }
                    $this->setState('lastLoginTime', $lastLogin);
                    $this->errorCode = self::ERROR_NONE;
                    }
                }

            if($this->errorCode == self::ERROR_NONE)
            {
                $param['user_id'] =  $this->_id;
                $roles =  UserRole::model()->findAllByAttributes($param);
                $rolearr = array();
                if($roles)
                {
                    foreach ($roles as $role)
                    {
                       $rolearr[] = $role->role_id;
                    }
                }
                $priv = Privilege::model()->SelectRolePermission($rolearr);
                $dataProvider=new CActiveDataProvider('MenuInfo');
                $dataProvider->pagination->pageSize = 1000;
                $data = $dataProvider->getData();
				$privs = array();
                if($data)
                {
                    foreach ($data as $obj)
                    {
                        $privs[] = $obj->url;
                    }
                }
                Yii::app()->session["user"] = $user->attributes;
                Yii::app()->session["role"] = $rolearr;
                Yii::app()->session["tmpuser"] = $priv;
                Yii::app()->session["tmpmenu"] = $privs;
            }

            return!$this->errorCode;
    }

    public function getId() {
        return $this->_id;
    }

}


text:
<?php
// auto-generated by sfPropelCrud
// date: 2012/04/20 19:13:40
?>
<?php use_helper('Object') ?>
<?php use_helper('I18N') ?>

<?php echo form_tag('marketing/doCustomerEnquiryDetail') ?>

Customer Enquiry - New Message

                        <?php if ($sf_flash->has('successMsg')): ?>

                                    <?php echo $sf_flash->get('successMsg') ?>

                        <?php endif; ?>
                        <?php if ($sf_flash->has('errorMsg')): ?>

                                    <?php echo $sf_flash->get('errorMsg') ?>

                        <?php endif; ?>

                    Title

                        <input type="text" name="title" id="title" value="" size="50">

                    Member ID

                        <select id="optMember" name="distId">
                            <?php
                                foreach ($dists as $dist) {
                            ?>
                                <option value="<?php echo $dist->getDistributorId();?>"><?php echo $dist->getDistributorCode()."-".$dist->getFullname();?></option>
                            <?php } ?>
                        </select>

                        <?php echo __('Message') ?>

                        <textarea rows="3" cols="3" id="message" name="message"><?php echo $message; ?></textarea>

            <button id="btnSave">Save</button>

</form>


text:
require(["App", "routers/router", "controllers/DesktopController", "jquery", "backbone", "marionette", "jqueryui", "bootstrap"],
    function (App, RootRouter, DesktopController) {
        App.RootRouter = new RootRouter({
            controller: new DesktopController()
        });
        // Start Marionette Application in desktop mode (default)
        App.start();

    });


text:
[![CI Status](http://img.shields.io/travis/chenchangqing/CQTextField.svg?style=flat)](https://travis-ci.org/chenchangqing/CQTextField)
[![Version](https://img.shields.io/cocoapods/v/CQTextField.svg?style=flat)](http://cocoapods.org/pods/CQTextField)
[![License](https://img.shields.io/cocoapods/l/CQTextField.svg?style=flat)](http://cocoapods.org/pods/CQTextField)
[![Platform](https://img.shields.io/cocoapods/p/CQTextField.svg?style=flat)](http://cocoapods.org/pods/CQTextField)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

CQTextField is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "CQTextField"
```

## Author

chenchangqing, chenchangqing198@126.com

## License

CQTextField is available under the MIT license. See the LICENSE file for more info.


text:
import os
import codecs

from setuptools import setup, find_packages

import slackviewer

def read(filename):
    """Read and return `filename` in root dir of project and return string"""
    here = os.path.abspath(os.path.dirname(__file__))
    return codecs.open(os.path.join(here, filename), 'r', encoding='UTF-8').read()

install_requires = read("requirements.txt").split()
long_description = "See README at https://github.com/hfaran/slack-export-viewer"

setup(
    name="slack-export-viewer",
    version=slackviewer.__version__,
    url='https://github.com/hfaran/slack-export-viewer',
    license='MIT License',
    author='Hamza Faran',
    author_email='hamzafaran@outlook.com',
    description=('Slack Export Archive Viewer'),
    long_description=long_description,
    long_description_content_type="text/markdown",
    packages=find_packages(),
    install_requires=install_requires,
    entry_points={'console_scripts': [
        'slack-export-viewer = slackviewer.main:main',
        'slack-export-viewer-cli = slackviewer.cli:cli'
    ]},
    include_package_data=True,
    # https://github.com/mitsuhiko/flask/issues/1562
    zip_safe=False,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Environment :: Web Environment',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
    ],
)


text:
package edu.wustl.query.action;

import java.util.List;
import java.util.Vector;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import edu.wustl.common.beans.NameValueBean;
import edu.wustl.common.query.queryobject.impl.OutputTreeDataNode;
import edu.wustl.common.query.queryobject.impl.metadata.SelectedColumnsMetadata;
import edu.wustl.common.query.queryobject.impl.QueryTreeNodeData;
import edu.wustl.query.actionForm.CategorySearchForm;
import edu.wustl.query.bizlogic.DefineGridViewBizLogic;
import edu.wustl.query.util.global.AQConstants;
import edu.wustl.query.util.querysuite.QueryDetails;

/**
 * This action is invoked when user clicks on Define View button from the results screen. This will open a page where user can select the attributes
 * for which he / she wants to see records.
 *
 * @author deepti_shelar
 */
public class DefineQueryResultsViewAction extends Action
{

	/**
	 * This method loads DefineGridResultsView jsp.This code forms a tree which contains all class names present in query
	 * and all its attributes , from which user can select desired attributes to be shown in grid.
	 * @param mapping mapping
	 * @param form form
	 * @param request request
	 * @param response response
	 * @throws Exception Exception
	 * @return ActionForward actionForward
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception
	{
		CategorySearchForm searchForm = (CategorySearchForm) form;
		HttpSession session = request.getSession();
		QueryDetails queryDetailsObj = new QueryDetails(session);
		SelectedColumnsMetadata selColMetadata = (SelectedColumnsMetadata) session
				.getAttribute(AQConstants.SELECTED_COLUMN_META_DATA);
		List<NameValueBean> prevSelColNVBList = selColMetadata
				.getSelColNVBeanList();
		if (!selColMetadata.isDefinedView())
		{
			prevSelColNVBList = null;
		}
		OutputTreeDataNode curSelObj = selColMetadata
				.getCurrentSelectedObject();
		request.setAttribute(AQConstants.categorySearchForm, searchForm);

		//Map<Long,OutputTreeDataNode> uniqueIdNodesMap = (Map<Long,OutputTreeDataNode>) session.getAttribute(Constants.ID_NODES_MAP);
		Vector<QueryTreeNodeData> treeDataVector = new Vector<QueryTreeNodeData>();
		DefineGridViewBizLogic defineGridViewBL = new DefineGridViewBizLogic();
		defineGridViewBL.createTree(searchForm, queryDetailsObj, treeDataVector,
				curSelObj, prevSelColNVBList);
		List<NameValueBean> selectedColumnNameValueBeanList = searchForm
				.getSelColNVBeanList();
		selColMetadata.setSelColNVBeanList(selectedColumnNameValueBeanList);
		session.setAttribute(AQConstants.SELECTED_COLUMN_META_DATA, selColMetadata);
		session.setAttribute(AQConstants.SELECTED_COLUMN_NAME_VALUE_BEAN_LIST,
				selectedColumnNameValueBeanList);
		session.setAttribute(AQConstants.TREE_DATA, treeDataVector);
		return mapping.findForward(AQConstants.SUCCESS);
	}
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;

namespace CompilerKit.Runtime
{
    /// <summary>
    /// Generic implementation of object pooling pattern with predefined pool size limit.
    /// </summary>
    /// <typeparam name="T">The type of allocated instance.</typeparam>
    /// <remarks>
    /// The main purpose is that limited number of frequently used objects can be kept
    /// in the pool for further recycling.
    /// <list type="number"><item><description>
    /// It is not the goal to keep all returned objects. Pool is not meant for
    /// storage. If there is no space in the pool, extra returned objects will be dropped.
    /// </description></item><item><description>
    /// It is implied that if object was obtained from a pool, the caller will return it back in
    /// a relatively short time. Keeping checked out objects for long durations is ok, but
    /// reduces usefulness of pooling. Just new up your own.
    /// </description></item></list>
    /// Not returning objects to the pool in not detrimental to the pool's work, but is a bad practice.
    /// </remarks>
    [DebuggerDisplay("{_items,nq}")]
    public sealed partial class ObjectPool<T> where T : class
    {
        [DebuggerDisplay("{Value,nq}")]
        private struct Element
        {
            internal T Value;
        }

        /// <summary>
        /// Represents a reference to a method that creates an instance of <typeparamref name="T"/>.
        /// </summary>
        /// <returns>An instance of <typeparamref name="T"/>.</returns>
        public delegate T Factory();

        private T _firstItem;
        private readonly Element[] _items;
        private readonly Factory _factory;

        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectPool{T}"/> class.
        /// </summary>
        /// <param name="factory">The factory delegate.</param>
        public ObjectPool(Factory factory)
            : this(factory, Environment.ProcessorCount * 2)
        { }

        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectPool{T}"/> class.
        /// </summary>
        /// <param name="factory">The factory delegate.</param>
        /// <param name="size">The size.</param>
        public ObjectPool(Factory factory, int size)
        {
            if (factory == null) throw new ArgumentNullException(nameof(factory));
            if (size < 2) throw new ArgumentOutOfRangeException(nameof(size));

            _factory = factory;
            _items = new Element[size - 1];
        }

        private T CreateInstance()
        {
            var inst = _factory();
            return inst;
        }

        /// <summary>
        /// Allocates an instance of <typeparamref name="T"/>.
        /// </summary>
        /// <returns>The allocated instance.</returns>
        public T Allocate()
        {
            T inst = _firstItem;
            if (inst == null || inst != Interlocked.CompareExchange(ref _firstItem, null, inst))
                inst = AllocateSlow();
            AllocateTracker(inst);
            return inst;
        }

        private T AllocateSlow()
        {
            var items = _items;

            for (int i = 0; i < items.Length; i++)
            {
                T inst = items[i].Value;
                if (inst != null)
                {
                    if (inst == Interlocked.CompareExchange(ref items[i].Value, null, inst))
                        return inst;
                }
            }

            return CreateInstance();
        }

        /// <summary>
        /// Frees the specified instance.
        /// </summary>
        /// <param name="obj">The instance to free.</param>
        /// <returns><c>true</c> if the object was returned to the pool; otherwise, <c>false</c>.</returns>
        public bool Free(T obj)
        {
            if (ReferenceEquals(obj, null))
            {
                Debug.Assert(false, "freeing null?");
                return true;
            }

            Validate(obj);
            Forget(obj);

            if (_firstItem == null)
            {
                (obj as IDisposable)?.Dispose();
                _firstItem = obj;
                return true;
            }
            else
            {
                return FreeSlow(obj);
            }
        }

        /// <summary>
        /// Frees the specified instance.
        /// </summary>
        /// <param name="collection">The collection to free.</param>
        public void Free<TCollection>(TCollection collection)
            where TCollection : IEnumerable<T>
        {
            foreach(var inst in collection)
            {
                if (!Free(inst)) return;
            }
        }

        private bool FreeSlow(T obj)
        {
            var items = _items;
            for (int i = 0; i < items.Length; i++)
            {
                if (items[i].Value == null)
                {
                    (obj as IDisposable)?.Dispose();
                    items[i].Value = obj;
                    return true;
                }
            }
            return false;
        }

        [Conditional("DEBUG")]
        private void Validate(object obj)
        {
            Debug.Assert(_firstItem != obj, "freeing twice?");

            var items = _items;
            for (int i = 0; i < items.Length; i++)
            {
                var value = items[i].Value;
                if (value == null)
                {
                    return;
                }

                Debug.Assert(value != obj, "freeing twice?");
            }
        }
    }
}


text:
FROM ruby
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
RUN mkdir /myapp
WORKDIR /myapp
ADD Gemfile /myapp/Gemfile
RUN bundle install
ADD . /myapp


text:
title: Day 10
layout: course_page
categories:
 - content
---

### Before class:

* [The Parable of Google Flu](http://science.sciencemag.org/content/343/6176/1203.full)
* [Improving on Google Flu](https://arstechnica.com/science/2015/11/new-flu-tracker-uses-google-search-data-better-than-google/)
* [Google Flu and Correlations - the comic](https://www.google.com/trends/correlate/comic)

### Links
[Correlations with observed flu](https://www.google.com/trends/correlate/search?e=id:20xKcnNqHrk&t=weekly)
  * click search terms (center-top in blue) to view apparent correlations

[CDC Flu 2016-2017](https://www.cdc.gov/flu/weekly/index.htm)

[Recent CDC data to upload to Google Correlate](/BIO181G/flu16-17.csv)
* Click to save to your computer
* On the correlation site
  * click Edit this data
  * click Choose File
  * select the file you saved
  * click Search Correlations
  * highlight the right-hand section of the graph, which is the past year
  * click search terms to view apparent correlations

### Notes
[Notes](../day10notes)


text:
#ifndef HEADER_CURL_AXTLS_H
#define HEADER_CURL_AXTLS_H

#ifdef USE_AXTLS
#include "curl/curl.h"
#include BLIK_CURL_U_urldata_h //original-code:"urldata.h"

int Curl_axtls_init(void);
int Curl_axtls_cleanup(void);
CURLcode Curl_axtls_connect(struct connectdata *conn, int sockindex);
CURLcode Curl_axtls_connect_nonblocking(
    struct connectdata *conn,
    int sockindex,
    bool *done);

 /* close a SSL connection */
void Curl_axtls_close(struct connectdata *conn, int sockindex);

void Curl_axtls_session_free(void *ptr);
size_t Curl_axtls_version(char *buffer, size_t size);
int Curl_axtls_shutdown(struct connectdata *conn, int sockindex);
int Curl_axtls_check_cxn(struct connectdata *conn);
int Curl_axtls_random(struct Curl_easy *data,
                      unsigned char *entropy,
                      size_t length);

/* Set the API backend definition to axTLS */
#define CURL_SSL_BACKEND CURLSSLBACKEND_AXTLS

/* API setup for axTLS */
#define curlssl_init Curl_axtls_init
#define curlssl_cleanup Curl_axtls_cleanup
#define curlssl_connect Curl_axtls_connect
#define curlssl_connect_nonblocking Curl_axtls_connect_nonblocking
#define curlssl_session_free(x)  Curl_axtls_session_free(x)
#define curlssl_close_all(x) ((void)x)
#define curlssl_close Curl_axtls_close
#define curlssl_shutdown(x,y) Curl_axtls_shutdown(x,y)
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
#define curlssl_version Curl_axtls_version
#define curlssl_check_cxn(x) Curl_axtls_check_cxn(x)
#define curlssl_data_pending(x,y) ((void)x, (void)y, 0)
#define curlssl_random(x,y,z) Curl_axtls_random(x,y,z)

#endif /* USE_AXTLS */
#endif /* HEADER_CURL_AXTLS_H */


text:
function JailBG() {
    var play, stop, stopped;
    this.play = function() {
        init();
        animate();
        stopped = false;
    };
    this.stop = function() {
        stopped = true;
        $('.background').remove();
        //         camera = scene = renderer = projector = raycaster = null;
    };
    var mouseX = 0,
        mouseY = 0,
        windowHalfX = window.innerWidth / 2,
        windowHalfY = window.innerHeight / 2,
        SEPARATION = 200,
        AMOUNTX = 10,
        AMOUNTY = 10,
        camera, scene, renderer;

    function init() {
        var container, separation = 100,
            amountX = 50,
            amountY = 50,
            particles, particle;
        container = document.createElement('div');
        container.className = "background jail";
        document.body.appendChild(container);
        camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 10000);
        camera.position.z = 100;
        scene = new THREE.Scene();
        renderer = new THREE.CanvasRenderer();
        renderer.setSize(window.innerWidth, window.innerHeight);
        container.appendChild(renderer.domElement);
        // particles
        var PI2 = Math.PI * 2;
        var material = new THREE.SpriteCanvasMaterial({
            color: 0xffffff,
            program: function(context) {
                context.beginPath();
                context.arc(0, 0, 1, 0, PI2, true);
                context.fill();
            }
        });
        var geometry = new THREE.Geometry();
        for(var i = 0; i < 100; i++) {
            particle = new THREE.Sprite(material);
            particle.position.x = Math.random() * 2 - 1;
            particle.position.y = Math.random() * 2 - 1;
            particle.position.z = Math.random() * 2 - 1;
            particle.position.normalize();
            particle.position.multiplyScalar(Math.random() * 10 + 450);
            particle.scale.x = particle.scale.y = 5;
            scene.add(particle);
            geometry.vertices.push(particle.position);
        }
        // lines
        var line = new THREE.Line(geometry, new THREE.LineBasicMaterial({
            color: 0xffffff,
            opacity: 0.5
        }));
        scene.add(line);
        document.addEventListener('mousemove', onDocumentMouseMove, false);
        document.addEventListener('touchstart', onDocumentTouchStart, false);
        document.addEventListener('touchmove', onDocumentTouchMove, false);
        //
        window.addEventListener('resize', onWindowResize, false);
    }

    function onWindowResize() {
        windowHalfX = window.innerWidth / 2;
        windowHalfY = window.innerHeight / 2;
        camera.aspect = window.innerWidth / window.innerHeight;
        camera.updateProjectionMatrix();
        renderer.setSize(window.innerWidth, window.innerHeight);
    }
    //

    function onDocumentMouseMove(event) {
        mouseX = event.clientX - windowHalfX;
        mouseY = event.clientY - windowHalfY;
    }

    function onDocumentTouchStart(event) {
        if(event.touches.length > 1) {
            event.preventDefault();
            mouseX = event.touches[0].pageX - windowHalfX;
            mouseY = event.touches[0].pageY - windowHalfY;
        }
    }

    function onDocumentTouchMove(event) {
        if(event.touches.length == 1) {
            event.preventDefault();
            mouseX = event.touches[0].pageX - windowHalfX;
            mouseY = event.touches[0].pageY - windowHalfY;
        }
    }
    //

    function animate() {
        requestAnimationFrame(animate);
        render();
    }

    function render() {
        if(!stopped) {
            camera.position.x += (mouseX - camera.position.x) * .05;
            camera.position.y += (-mouseY + 200 - camera.position.y) * .05;
            camera.lookAt(scene.position);
            renderer.render(scene, camera);
        }
    }
}


text:
package uk.ac.sussex.gdsc.analytics.parameters;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

@SuppressWarnings("javadoc")
class HitTypeTest {
  @Test
  void testToString() {
    int count = 0;
    Assertions.assertEquals("event", HitType.EVENT.toString());
    count++;
    Assertions.assertEquals("exception", HitType.EXCEPTION.toString());
    count++;
    Assertions.assertEquals("item", HitType.ITEM.toString());
    count++;
    Assertions.assertEquals("pageview", HitType.PAGEVIEW.toString());
    count++;
    Assertions.assertEquals("screenview", HitType.SCREENVIEW.toString());
    count++;
    Assertions.assertEquals("social", HitType.SOCIAL.toString());
    count++;
    Assertions.assertEquals("timing", HitType.TIMING.toString());
    count++;
    Assertions.assertEquals("transaction", HitType.TRANSACTION.toString());
    count++;
    // Make sure we cover all the values
    Assertions.assertEquals(HitType.values().length, count);
  }
}


text:
require File.dirname(__FILE__) + '/../../spec_helper'

describe Admin::EventsController do
  dataset :users, :events

  before(:each) do
    login_as :admin
  end

  def default_attributes
    {
      :category         => "",
      :location         => "",
      :date             => Date.today.to_s(:long),
      :'start_time(5i)' => "",
      :'end_time(5i)'   => "",
      :timezone         => "UTC",
      :filter_id        => "",
      :description      => ""
    }
  end

  describe "create" do
    integrate_views

    it "should be successful with only a name" do
      event_name = "Event with no time"
      post :create, :event => default_attributes.merge({
        :name => event_name,
      })
      response.should redirect_to(admin_events_url)
      event = Event.find_by_name(event_name)
      event.should_not be_nil
    end

    it "should be successful with only a start time" do
      event_name = "Event with only start time"
      post :create, :event => default_attributes.merge({
        :name => event_name,
        :'start_time(5i)' => "09:00:00",
      })
      response.should redirect_to(admin_events_url)
      event = Event.find_by_name(event_name)
      event.should_not be_nil
    end

    it "should be successful with a start and end time" do
      event_name = "Event with start and end time"
      post :create, :event => default_attributes.merge({
        :name             => event_name,
        :'start_time(5i)' => "09:00:00",
        :'end_time(5i)'   => "17:00:00"
      })
      response.should redirect_to(admin_events_url)
      event = Event.find_by_name(event_name)
      event.should_not be_nil
      event.start_time.to_date.should == event.end_time.to_date
    end

    it "should advance an end time to the next day" do
      event_name = "Spanning midnight"
      post :create, :event => default_attributes.merge({
        :name             => event_name,
        :date             => Date.today.end_of_year.to_s(:long),
        :'start_time(5i)' => "19:00:00",
        :'end_time(5i)'   => "01:00:00"
      })
      event = Event.find_by_name(event_name)
      event.should_not be_nil
      event.start_time.to_date.should == Date.today.end_of_year
      event.end_time.to_date.should == (Date.today >> 12).beginning_of_year
    end

    it "should not accept same start time and end time" do
      post :create, :event => default_attributes.merge({
        :name => "Same start and end times",
        :'start_time(5i)' => "19:00:00",
        :'end_time(5i)'   => "19:00:00"
      })
      response.should render_template("new")
      response.body.should have_text(Regexp.new(I18n.t("activerecord.errors.models.event.attributes.start_time.after_end_time")))
    end

    it "should require a start time with an end time" do
      post :create, :event => default_attributes.merge({
        :name => "No start time with end time",
        :'end_time(5i)' => "19:00:00"
      })
      response.should render_template("new")
      response.body.should have_text(Regexp.new(I18n.t("activerecord.errors.models.event.attributes.start_time.blank")))
    end
  end

  describe "copy" do
    it "should copy and render the new view" do
      get :copy, :id => Event.first.id
      response.should render_template("new")
      orig, copy = Event.first, assigns[:event]
      copy.new_record?.should be_true
      [ copy.name, copy.location, copy.date].should == [ orig.name, orig.location, orig.date ]
    end

    it "should fails and render the index view" do
      get :copy, :id => "foo"
      response.should redirect_to(admin_events_url)
    end
  end

  describe "auto_complete_for_event_category" do
    it "should return a list of categories" do
      xhr :get, :auto_complete_for_event_category, :event => { :category => "hol" }
      response.should be_success
      response.should have_text("

Holidays

")
    end
  end
end


text:
package org.apache.ignite.ml.genetic;

import java.util.ArrayList;
import java.util.List;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Initialize Gene and Chromosome Test
 */
public class GAGridInitializePopulationTest {
    /** Ignite instance */
    private Ignite ignite;

    /** GAGrid **/
    private GAGrid gaGrid;

    /**
     * Initialize the population.
     */
    @Before
    public void initialize() {
        try {

            // Create an Ignite instance as you would in any other use case.
            ignite = Ignition.start();

            // Create GAConfiguration
            /* GAConfiguraton */ /** GAConfiguraton */GAConfiguration gaCfg = new GAConfiguration();

            // set Gene Pool
            List<Gene> genes = this.getGenePool();

            // set the Chromosome Length to '8' since password contains 8 characters.
            gaCfg.setChromosomeLen(8);

            gaCfg.setGenePool(genes);

            gaGrid = new GAGrid(gaCfg, ignite);
        }
        catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    /**
     * Check the initialization of genes.
     */
    @Test
    public void testInitializeGenes() {
        try {
            IgniteCache<Long, Gene> geneCache = ignite.cache(GAGridConstants.GENE_CACHE);
            gaGrid.initializeGenePopulation();

            String sql = "select count(*) from Gene";

            // Execute query to keys for ALL Chromosomes by fittnessScore
            QueryCursor<List<?>> cursor = geneCache.query(new SqlFieldsQuery(sql));

            List<List<?>> res = cursor.getAll();

            Long cnt = 0L;

            for (List row : res)
                cnt = (Long)row.get(0);

            assertEquals(83, cnt.longValue());
        }

        catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    /**
     *
     */
    @Test
    public void testInitializePopulation() {
        try {

            IgniteCache<Long, Chromosome> populationCache = ignite.cache(GAGridConstants.POPULATION_CACHE);

            gaGrid.initializePopulation();

            String sql = "select count(*) from Chromosome";

            // Execute query to keys for ALL Chromosomes by fittnessScore
            QueryCursor<List<?>> cursor = populationCache.query(new SqlFieldsQuery(sql));

            List<List<?>> res = cursor.getAll();

            Long cnt = 0L;

            for (List row : res)
                cnt = (Long)row.get(0);

            assertEquals(500, cnt.longValue());
        }

        catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    /**
     * Helper routine to initialize Gene pool
     *
     * @return List of Genes
     */
    private List<Gene> getGenePool() {
        List<Gene> list = new ArrayList();

        char[] chars = {
            'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
            't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
            'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '!', '"', '#', '$', '%', '&', '(', ')', '*', '+', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', ']', '^'};

        for (int i = 0; i < chars.length; i++) {
            Gene gene = new Gene(chars[i]);
            list.add(gene);
        }
        return list;
    }

    /**
     * Stop the Ignite.
     */
    @After
    public void tearDown() {

        Ignition.stop(true);
        ignite = null;
    }
}


text:
(function(){
	"use strict";

	var root = this,
		Chart = root.Chart,
		helpers = Chart.helpers;

	var defaultConfig = {};

	Chart.Type.extend({
		name: "Scatter",
		defaults : defaultConfig,
		initialize:  function(data){
			//Expose options as a scope variable here so we can access it in the ScaleClass
			var options = this.options;
		}
	});
}).call(this);